openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
45 lines (44 loc) • 1.83 kB
JavaScript
import { r as defaultRuntime } from "./runtime-B-SLYP-m.mjs";
import { r as isTerminalInteractive } from "./terminal-interactivity-B_L_vZTP.mjs";
import { n as runInteractiveOnboarding } from "./onboard-interactive-runner-DkSapFQL.mjs";
import { t as createClackPrompter } from "./clack-prompter-oqVcatgQ.mjs";
import { t as runSetupWizard } from "./setup-DrRVtrWk.mjs";
//#region src/commands/onboard-interactive.ts
/** Runs the interactive setup wizard and maps user cancellation to exit code 1. */
async function runInteractiveSetup(e, t = defaultRuntime) {
const n = createClackPrompter();
await runInteractiveOnboarding(async () => await runSetupWizard(e, t, n), t);
}
/**
* Opens the OpenClaw onboarding conversation used by the guided escape hatch.
* The first-run greeting proposes a setup plan and keeps subsequent setup and
* agent handoff in the same conversation.
*/
async function runConversationalOnboarding(e, t = defaultRuntime) {
if (!isTerminalInteractive()) {
t.error("Onboarding needs an interactive TTY. Use `openclaw onboard --non-interactive --accept-risk ...` for automation.");
t.exit(1);
return;
}
const { captureRuntimeConfigAsyncReader: n } = await import("./io-DeTUDO0h.mjs");
await n()();
const { verifySetupInference: r } = await import("./system-agent/setup-inference.js");
const i = await r({
runtime: t,
bindSession: true
});
if (!i.ok) {
t.error(`OpenClaw requires working inference: ${i.error}`);
t.exit(1);
return;
}
const { runSystemAgent: a } = await import("./system-agent/system-agent.js");
await a({
welcomeVariant: "onboarding",
...e.workspace ? { setupWorkspace: e.workspace } : {},
...e.agentName ? { setupAgentName: e.agentName } : {},
verifiedInference: i.binding
}, t);
}
//#endregion
export { runConversationalOnboarding, runInteractiveSetup };