Skip to content

Commit 720c0ab

Browse files
committed
refactor(gateway): remove unused scoped call wrapper
1 parent 70e39da commit 720c0ab

3 files changed

Lines changed: 5 additions & 16 deletions

File tree

‎src/agents/tools/gateway.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Gateway call helper tests pin URL override, token, and RPC scope behavior for
22
// agent tools that route through the local gateway client.
33
import { afterAll, beforeEach, describe, expect, it, vi } from "vitest";
4-
import type { CallGatewayScopedOptions } from "../../gateway/call.js";
4+
import type { CallGatewayOptions } from "../../gateway/call.js";
55
import { createEmptyPluginRegistry } from "../../plugins/registry-empty.js";
66
import { setActivePluginRegistry } from "../../plugins/runtime.js";
77
import { callGatewayTool, readGatewayCallOptions, resolveGatewayOptions } from "./gateway.js";
@@ -46,13 +46,13 @@ vi.mock("../../infra/device-identity.js", () => ({
4646
},
4747
}));
4848

49-
function capturedGatewayCall(): CallGatewayScopedOptions {
49+
function capturedGatewayCall(): CallGatewayOptions {
5050
expect(mocks.callGateway).toHaveBeenCalledTimes(1);
5151
const call = mocks.callGateway.mock.calls[0];
5252
if (!call) {
5353
throw new Error("expected callGateway to be called");
5454
}
55-
return call[0] as CallGatewayScopedOptions;
55+
return call[0] as CallGatewayOptions;
5656
}
5757

5858
describe("gateway tool defaults", () => {

‎src/gateway/call.test.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ const {
208208
buildGatewayProbeConnectionDetails,
209209
callGateway,
210210
callGatewayCli,
211-
callGatewayScoped,
212211
formatGatewayClientRequestErrorJson,
213212
formatGatewayTransportErrorJson,
214213
isGatewayTransportError,
@@ -757,10 +756,10 @@ describe("callGateway url resolution", () => {
757756
it("passes explicit scopes through, including empty arrays", async () => {
758757
setLocalLoopbackGatewayConfig();
759758

760-
await callGatewayScoped({ method: "health", scopes: ["operator.read"] });
759+
await callGateway({ method: "health", scopes: ["operator.read"] });
761760
expect(lastClientOptions?.scopes).toEqual(["operator.read"]);
762761

763-
await callGatewayScoped({ method: "health", scopes: [] });
762+
await callGateway({ method: "health", scopes: [] });
764763
expect(lastClientOptions?.scopes).toStrictEqual([]);
765764
});
766765

‎src/gateway/call.ts‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ type CallGatewayBaseOptions = {
100100
configPath?: string;
101101
};
102102

103-
export type CallGatewayScopedOptions = CallGatewayBaseOptions & {
104-
scopes: OperatorScope[];
105-
};
106-
107103
export type CallGatewayCliOptions = CallGatewayBaseOptions & {
108104
scopes?: OperatorScope[];
109105
};
@@ -1235,12 +1231,6 @@ export async function buildGatewayProbeConnectionDetails(
12351231
};
12361232
}
12371233

1238-
export async function callGatewayScoped<T = Record<string, unknown>>(
1239-
opts: CallGatewayScopedOptions,
1240-
): Promise<T> {
1241-
return await callGatewayWithScopes(opts, opts.scopes);
1242-
}
1243-
12441234
export async function callGatewayCli<T = Record<string, unknown>>(
12451235
opts: CallGatewayCliOptions,
12461236
): Promise<T> {

0 commit comments

Comments
 (0)