Files
openclaw-zero-token/commands/onboard-interactive.ts
sjhu 571e14a236 feat: upgrade to upstream v2026.3.28
Major upgrade from e26988a38 to upstream v2026.3.28 (f9b107928).
Key changes:
- Upstream src/, ui/, extensions/ (89 bundled extensions)
- Zero-token web providers preserved in src/zero-token/
- AskOnce plugin restored and registered as CLI command
- Added missing packages: @anthropic-ai/vertex-sdk, @modelcontextprotocol/sdk
- Fixed tsconfig rootDir, skipLibCheck for plugin-sdk DTS build
- Added askonce to bundled plugin metadata and package.json exports
- Fixed AskOnce CLI command registration (missing commands metadata)
- Restored AskOnce adapter imports (correct 5-level relative paths)
- Removed stale migration artifacts from root directory
2026-03-30 17:58:12 +08:00

32 lines
1.1 KiB
TypeScript

import type { RuntimeEnv } from "../runtime.js";
import { defaultRuntime } from "../runtime.js";
import { restoreTerminalState } from "../terminal/restore.js";
import { createClackPrompter } from "../wizard/clack-prompter.js";
import { WizardCancelledError } from "../wizard/prompts.js";
import { runSetupWizard } from "../wizard/setup.js";
import type { OnboardOptions } from "./onboard-types.js";
export async function runInteractiveSetup(
opts: OnboardOptions,
runtime: RuntimeEnv = defaultRuntime,
) {
const prompter = createClackPrompter();
let exitCode: number | null = null;
try {
await runSetupWizard(opts, runtime, prompter);
} catch (err) {
if (err instanceof WizardCancelledError) {
// Best practice: cancellation is not a successful completion.
exitCode = 1;
return;
}
throw err;
} finally {
// Keep stdin paused so non-daemon runs can exit cleanly (e.g. Docker setup).
restoreTerminalState("setup finish", { resumeStdinIfPaused: false });
if (exitCode !== null) {
runtime.exit(exitCode);
}
}
}