From 1708faf85b876c292f88c09bf889f4670d0c00a6 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 14 Jul 2026 00:38:14 +0800 Subject: [PATCH] refactor(cli): remove obsolete gateway call options export (#106549) --- scripts/deadcode-exports.baseline.mjs | 1 - src/cli/gateway-cli/call.ts | 12 +----------- .../gateway-cli/register.option-collisions.test.ts | 8 -------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/scripts/deadcode-exports.baseline.mjs b/scripts/deadcode-exports.baseline.mjs index fd79d2bda412..28e4f2876b17 100644 --- a/scripts/deadcode-exports.baseline.mjs +++ b/scripts/deadcode-exports.baseline.mjs @@ -1263,7 +1263,6 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [ "src/cli/cron-cli/register.cron-simple.ts: loadCronJobForShow", "src/cli/daemon-cli/launchd-recovery.ts: LAUNCH_AGENT_RECOVERY_MESSAGE", "src/cli/daemon-cli/response.ts: buildDaemonHintItems", - "src/cli/gateway-cli/call.ts: gatewayCallOpts", "src/cli/gateway-cli/qa-parent-watchdog.ts: QA_PARENT_PID_ENV", "src/cli/gateway-cli/qa-parent-watchdog.ts: QA_STAGED_RUNTIME_ROOT_ENV", "src/cli/gateway-cli/qa-parent-watchdog.ts: QA_TEMP_ROOT_ENV", diff --git a/src/cli/gateway-cli/call.ts b/src/cli/gateway-cli/call.ts index 17587f19ccaa..5e92fc6d9faa 100644 --- a/src/cli/gateway-cli/call.ts +++ b/src/cli/gateway-cli/call.ts @@ -1,5 +1,4 @@ -// Shared gateway RPC command options and progress-wrapped CLI call helper. -import type { Command } from "commander"; +// Progress-wrapped Gateway RPC helper shared by CLI command surfaces. import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES, @@ -22,15 +21,6 @@ export type GatewayRpcOpts = { const DEFAULT_GATEWAY_RPC_TIMEOUT_MS = 10_000; -export const gatewayCallOpts = (cmd: Command) => - cmd - .option("--url ", "Gateway WebSocket URL (defaults to gateway.remote.url when configured)") - .option("--token ", "Gateway token (if required)") - .option("--password ", "Gateway password (password auth)") - .option("--timeout ", "Timeout in ms", "10000") - .option("--expect-final", "Wait for final response (agent)", false) - .option("--json", "Output JSON", false); - export const callGatewayCli = async (method: string, opts: GatewayRpcOpts, params?: unknown) => { const timeoutMs = opts.timeout === null diff --git a/src/cli/gateway-cli/register.option-collisions.test.ts b/src/cli/gateway-cli/register.option-collisions.test.ts index 2c37ee31d0ba..c1d557334a92 100644 --- a/src/cli/gateway-cli/register.option-collisions.test.ts +++ b/src/cli/gateway-cli/register.option-collisions.test.ts @@ -46,14 +46,6 @@ vi.mock("../../commands/gateway-status.js", () => ({ })); vi.mock("./call.js", () => ({ - gatewayCallOpts: (cmd: Command) => - cmd - .option("--url ", "Gateway WebSocket URL") - .option("--token ", "Gateway token") - .option("--password ", "Gateway password") - .option("--timeout ", "Timeout in ms", "10000") - .option("--expect-final", "Wait for final response (agent)", false) - .option("--json", "Output JSON", false), callGatewayCli: (method: string, opts: unknown, params?: unknown) => mocks.callGatewayCli(method, opts, params), }));