diff --git a/scripts/deadcode-exports.baseline.mjs b/scripts/deadcode-exports.baseline.mjs index b835649aee8e..bf0b3f685426 100644 --- a/scripts/deadcode-exports.baseline.mjs +++ b/scripts/deadcode-exports.baseline.mjs @@ -1133,11 +1133,8 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [ "src/commands/onboard-inference.ts: detectNativeCodexAppServer", "src/commands/onboard-non-interactive/local.ts: resolveGatewayHealthProbeToken", "src/commands/onboard-non-interactive/local.ts: resolveInstallDaemonGatewayHealthTiming", - "src/commands/onboard-remote-gateway.ts: RemoteGatewayInferenceOnboardingDeps", - "src/commands/onboard-remote-gateway.ts: RemoteGatewayInferenceTarget", "src/commands/onboard-skills.ts: testing", "src/commands/onboarding-plugin-install.ts: testing", - "src/commands/runtime-plugin-install.ts: RuntimePluginInstallResult", "src/commands/sessions-tail.ts: setSessionsTailFollowIntervalMsForTests", "src/commands/sessions.ts: testing", "src/commands/status.command.ts: resolvePairingRecoveryContext", diff --git a/src/commands/onboard-guided.test.ts b/src/commands/onboard-guided.test.ts index acf71cbac8c8..f74f420dc746 100644 --- a/src/commands/onboard-guided.test.ts +++ b/src/commands/onboard-guided.test.ts @@ -10,10 +10,11 @@ import { createSubsystemLogger } from "../logging/subsystem.js"; import type { RuntimeEnv } from "../runtime.js"; import type { WizardPrompter, WizardSelectParams } from "../wizard/prompts.js"; import { runGuidedOnboarding, type GuidedOnboardingDeps } from "./onboard-guided.js"; -import { - runRemoteGatewayInferenceOnboarding, - type RemoteGatewayInferenceOnboardingDeps, -} from "./onboard-remote-gateway.js"; +import { runRemoteGatewayInferenceOnboarding } from "./onboard-remote-gateway.js"; + +type RemoteGatewayInferenceOnboardingDeps = NonNullable< + Parameters[2] +>; const restoreTerminalState = vi.hoisted(() => vi.fn()); diff --git a/src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.test.ts b/src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.test.ts index 40beaab592ff..f2f49a725956 100644 --- a/src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.test.ts +++ b/src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.test.ts @@ -1,30 +1,25 @@ // Non-interactive plugin provider auth tests cover provider choice setup and runtime plugin install requirements. import { beforeEach, describe, expect, it, vi } from "vitest"; import type { OpenClawConfig } from "../../../config/config.js"; -import type { RuntimePluginInstallResult } from "../../runtime-plugin-install.js"; import { applyNonInteractivePluginProviderChoice } from "./auth-choice.plugin-providers.js"; const ensureCodexRuntimePluginForModelSelection = vi.hoisted(() => - vi.fn( - async ({ cfg }: { cfg: OpenClawConfig }): Promise => ({ - cfg, - required: false, - installed: false, - }), - ), + vi.fn(async ({ cfg }: { cfg: OpenClawConfig }) => ({ + cfg, + required: false, + installed: false, + })), ); vi.mock("../../codex-runtime-plugin-install.js", () => ({ CODEX_RUNTIME_PLUGIN_ID: "codex", ensureCodexRuntimePluginForModelSelection, })); const ensureCopilotRuntimePluginForModelSelection = vi.hoisted(() => - vi.fn( - async ({ cfg }: { cfg: OpenClawConfig }): Promise => ({ - cfg, - required: false, - installed: false, - }), - ), + vi.fn(async ({ cfg }: { cfg: OpenClawConfig }) => ({ + cfg, + required: false, + installed: false, + })), ); vi.mock("../../copilot-runtime-plugin-install.js", () => ({ ensureCopilotRuntimePluginForModelSelection, diff --git a/src/commands/onboard-remote-gateway.test.ts b/src/commands/onboard-remote-gateway.test.ts index b4d5c4f0cdd1..92d79314eb50 100644 --- a/src/commands/onboard-remote-gateway.test.ts +++ b/src/commands/onboard-remote-gateway.test.ts @@ -5,11 +5,12 @@ import type { CallGatewayCliOptions } from "../gateway/call.js"; import type { RuntimeEnv } from "../runtime.js"; import { WizardCancelledError } from "../wizard/prompts.js"; import type { GuidedOnboardingDeps } from "./onboard-guided.js"; -import { - runRemoteGatewayInferenceOnboarding, - type RemoteGatewayInferenceOnboardingDeps, - type RemoteGatewayInferenceTarget, -} from "./onboard-remote-gateway.js"; +import { runRemoteGatewayInferenceOnboarding } from "./onboard-remote-gateway.js"; + +type RemoteGatewayInferenceTarget = Parameters[0]; +type RemoteGatewayInferenceOnboardingDeps = NonNullable< + Parameters[2] +>; type GatewayCall = NonNullable; type RunGuidedOnboarding = NonNullable; diff --git a/src/commands/onboard-remote-gateway.ts b/src/commands/onboard-remote-gateway.ts index d791676a5c81..6b03425ed0d3 100644 --- a/src/commands/onboard-remote-gateway.ts +++ b/src/commands/onboard-remote-gateway.ts @@ -26,7 +26,7 @@ const GATEWAY_CRESTODIAN_CHAT_TIMEOUT_MS = 190_000; type CallGateway = (options: CallGatewayCliOptions) => Promise; -export type RemoteGatewayInferenceTarget = { +type RemoteGatewayInferenceTarget = { config: OpenClawConfig; gatewayUrl: string; token?: string; @@ -34,7 +34,7 @@ export type RemoteGatewayInferenceTarget = { tlsFingerprint?: string; }; -export type RemoteGatewayInferenceOnboardingDeps = { +type RemoteGatewayInferenceOnboardingDeps = { callGateway?: CallGateway; createPrompter?: GuidedOnboardingDeps["createPrompter"]; runTui?: typeof import("../tui/tui.js").runTui; diff --git a/src/commands/runtime-plugin-install.ts b/src/commands/runtime-plugin-install.ts index ad812955d330..6bc508df8ceb 100644 --- a/src/commands/runtime-plugin-install.ts +++ b/src/commands/runtime-plugin-install.ts @@ -23,7 +23,7 @@ type RuntimePluginInstallDescriptor = { }; /** Result returned after ensuring a runtime plugin for a selected model. */ -export type RuntimePluginInstallResult = { +type RuntimePluginInstallResult = { cfg: OpenClawConfig; required: boolean; installed: boolean;