mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 12:56:01 -06:00
refactor(commands): privatize setup types (#106771)
* refactor(commands): privatize setup types * chore(deadcode): refresh export baseline
This commit is contained in:
committed by
GitHub
parent
d9e360f047
commit
359c8917ec
@@ -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",
|
||||
|
||||
@@ -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<typeof runRemoteGatewayInferenceOnboarding>[2]
|
||||
>;
|
||||
|
||||
const restoreTerminalState = vi.hoisted(() => vi.fn());
|
||||
|
||||
|
||||
@@ -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<RuntimePluginInstallResult> => ({
|
||||
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<RuntimePluginInstallResult> => ({
|
||||
cfg,
|
||||
required: false,
|
||||
installed: false,
|
||||
}),
|
||||
),
|
||||
vi.fn(async ({ cfg }: { cfg: OpenClawConfig }) => ({
|
||||
cfg,
|
||||
required: false,
|
||||
installed: false,
|
||||
})),
|
||||
);
|
||||
vi.mock("../../copilot-runtime-plugin-install.js", () => ({
|
||||
ensureCopilotRuntimePluginForModelSelection,
|
||||
|
||||
@@ -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<typeof runRemoteGatewayInferenceOnboarding>[0];
|
||||
type RemoteGatewayInferenceOnboardingDeps = NonNullable<
|
||||
Parameters<typeof runRemoteGatewayInferenceOnboarding>[2]
|
||||
>;
|
||||
|
||||
type GatewayCall = NonNullable<RemoteGatewayInferenceOnboardingDeps["callGateway"]>;
|
||||
type RunGuidedOnboarding = NonNullable<RemoteGatewayInferenceOnboardingDeps["runGuidedOnboarding"]>;
|
||||
|
||||
@@ -26,7 +26,7 @@ const GATEWAY_CRESTODIAN_CHAT_TIMEOUT_MS = 190_000;
|
||||
|
||||
type CallGateway = <T>(options: CallGatewayCliOptions) => Promise<T>;
|
||||
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user