UNPKG

@gguf/claw

Version:

Multi-channel AI gateway with extensible messaging integrations

199 lines (197 loc) 10.6 kB
import { Dt as theme, _ as defaultRuntime } from "./entry.js"; import "./auth-profiles-DFa1zzNy.js"; import "./exec-CBKBIMpA.js"; import "./agent-scope-RzK9Zcks.js"; import "./github-copilot-token-DuFIqfeC.js"; import "./model-DY9t1aT6.js"; import "./pi-model-discovery-Do3xMEtM.js"; import "./frontmatter-D-YR-Ghi.js"; import "./skills-DJmGZazd.js"; import "./manifest-registry-DS2iK5AZ.js"; import "./config-B2kL1ciP.js"; import "./client-CDjZdZtI.js"; import "./call-DXhJGwEy.js"; import "./message-channel-CVHJDItx.js"; import "./pairing-token-Byh6drgn.js"; import "./subagent-registry-C7Edpn23.js"; import "./sessions-BD5dyLxb.js"; import "./tokens-D5RzuaYP.js"; import "./normalize-Db7Xtx2v.js"; import "./accounts-BpzwDfBB.js"; import "./bindings-KqaGKS1E.js"; import "./logging-CFvkxgcX.js"; import "./send-BFiRlO6V.js"; import "./plugins-RqhjLCb6.js"; import "./send-CWDtU8Gi.js"; import "./with-timeout-nVWy7PWz.js"; import "./deliver-CeVE1Jh-.js"; import "./diagnostic-774btyou.js"; import "./diagnostic-session-state-HO94DMou.js"; import "./accounts-B3D4iWUP.js"; import "./send-DCCBUsNn.js"; import "./image-ops-lDlFpoR2.js"; import "./pi-embedded-helpers-NVEtaJwl.js"; import "./sandbox-CO-R8v6J.js"; import "./common-DcSh1hZE.js"; import "./chrome-52ZF7gmE.js"; import "./tailscale-BzRVNhMW.js"; import "./auth-Dq2pFnjj.js"; import "./server-context-C1f7cijA.js"; import "./routes-BJmh1Ify.js"; import "./redact-C2s6sr73.js"; import "./errors-CFEPAPWc.js"; import "./fs-safe-3YwsxSr5.js"; import "./paths-CXKNzNjU.js"; import "./ssrf-Cv2DiHsm.js"; import "./store-e6fIrP17.js"; import "./ports-59j-bA53.js"; import "./trash-DVLJ0k6q.js"; import "./dock-BZuwgj1O.js"; import "./accounts-Jg3_1Y-r.js"; import "./paths-CXpciDEv.js"; import "./thinking-CJPPUYWd.js"; import "./models-config-5zJ39mUb.js"; import "./reply-prefix-DJOqzjBt.js"; import "./memory-cli-C3uas9sI.js"; import "./manager-D3ZmOwqt.js"; import "./gemini-auth-CdgAkz2K.js"; import "./sqlite-1-TCahE6.js"; import "./retry-BcjnIuo-.js"; import "./chunk-Z2NYDchs.js"; import "./markdown-tables-GCHx-nGT.js"; import "./fetch-guard-B5BAqVyD.js"; import "./local-roots-SkDT1Wv8.js"; import "./ir-DAwVi0a7.js"; import "./render-e7fENCYH.js"; import "./commands-registry-CRmMPJQ9.js"; import "./image-QGUQCdGh.js"; import "./tool-display-Cs1uRaRV.js"; import "./runner-D81xREgc.js"; import "./model-catalog-DLoDxnxL.js"; import "./session-utils-C3Oi9cXA.js"; import "./skill-commands-D2rmj6w8.js"; import "./workspace-dirs-BXftTDSV.js"; import "./pairing-store-CruPwgBw.js"; import "./fetch-vg2oFVIH.js"; import "./exec-approvals-BZA6z4HM.js"; import "./nodes-screen-x7YKy8Ay.js"; import "./session-cost-usage-CpxG9Mup.js"; import "./pi-tools.policy-DeRwGLEO.js"; import "./control-service-DGleRjGJ.js"; import "./stagger-CArN2YVJ.js"; import "./channel-selection-DoXlsBhe.js"; import "./send-C3RIrBTr.js"; import "./outbound-attachment-CdFWGHgJ.js"; import "./delivery-queue-DKdWlR61.js"; import "./send-0Nz3O9Jc.js"; import "./resolve-route-BONxzeyg.js"; import "./channel-activity-BYGpAtHP.js"; import "./tables-BrqD0SUa.js"; import "./proxy-DL3MD6-P.js"; import { t as formatDocsLink } from "./links-CW8Bx7rK.js"; import { n as runCommandWithRuntime } from "./cli-utils-CCaEbxAz.js"; import "./help-format-B0pWGnZs.js"; import "./progress-BAHiAaDW.js"; import "./replies-CuUAAFF2.js"; import "./onboard-helpers-CEx2tGVB.js"; import "./prompt-style-DwCXob2h.js"; import "./pairing-labels-DtxjElSq.js"; import "./note-D3Xn5qjj.js"; import "./clack-prompter-DOOcFy2t.js"; import "./daemon-runtime-DL5x9CWn.js"; import "./runtime-guard-DcwOrtgH.js"; import "./systemd-BeKZd5oD.js"; import "./service-CIkh5YiN.js"; import "./health-75545GOF.js"; import "./onboarding-DXYmd7jj.js"; import "./shared-DpLvAirU.js"; import "./auth-token-B5F1NkdJ.js"; import "./logging-BGewRZy0.js"; import { n as formatAuthChoiceChoicesForCli } from "./auth-choice-options-DEXqZb42.js"; import "./openai-model-default-DYWb04WS.js"; import "./vllm-setup-DYvSzA2g.js"; import "./systemd-linger-CgYzp_8H.js"; import "./model-picker-DAMy-RVG.js"; import "./onboard-custom-B1zhrCJR.js"; import { n as ONBOARD_PROVIDER_AUTH_FLAGS, t as onboardCommand } from "./onboard-Cw8jn-zS.js"; //#region src/cli/program/register.onboard.ts function resolveInstallDaemonFlag(command, opts) { if (!command || typeof command !== "object") return; const getOptionValueSource = "getOptionValueSource" in command ? command.getOptionValueSource : void 0; if (typeof getOptionValueSource !== "function") return; if (getOptionValueSource.call(command, "skipDaemon") === "cli") return false; if (getOptionValueSource.call(command, "installDaemon") === "cli") return Boolean(opts.installDaemon); } const AUTH_CHOICE_HELP = formatAuthChoiceChoicesForCli({ includeLegacyAliases: true, includeSkip: true }); function registerOnboardCommand(program) { const command = program.command("onboard").description("Interactive wizard to set up the gateway, workspace, and skills").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/onboard", "docs.openclaw.ai/cli/onboard")}\n`).option("--workspace <dir>", "Agent workspace directory (default: ~/.openclaw/workspace)").option("--reset", "Reset config + credentials + sessions + workspace before running wizard").option("--non-interactive", "Run without prompts", false).option("--accept-risk", "Acknowledge that agents are powerful and full system access is risky (required for --non-interactive)", false).option("--flow <flow>", "Wizard flow: quickstart|advanced|manual").option("--mode <mode>", "Wizard mode: local|remote").option("--auth-choice <choice>", `Auth: ${AUTH_CHOICE_HELP}`).option("--token-provider <id>", "Token provider id (non-interactive; used with --auth-choice token)").option("--token <token>", "Token value (non-interactive; used with --auth-choice token)").option("--token-profile-id <id>", "Auth profile id (non-interactive; default: <provider>:manual)").option("--token-expires-in <duration>", "Optional token expiry duration (e.g. 365d, 12h)").option("--cloudflare-ai-gateway-account-id <id>", "Cloudflare Account ID").option("--cloudflare-ai-gateway-gateway-id <id>", "Cloudflare AI Gateway ID"); for (const providerFlag of ONBOARD_PROVIDER_AUTH_FLAGS) command.option(providerFlag.cliOption, providerFlag.description); command.option("--custom-base-url <url>", "Custom provider base URL").option("--custom-api-key <key>", "Custom provider API key (optional)").option("--custom-model-id <id>", "Custom provider model ID").option("--custom-provider-id <id>", "Custom provider ID (optional; auto-derived by default)").option("--custom-compatibility <mode>", "Custom provider API compatibility: openai|anthropic (default: openai)").option("--gateway-port <port>", "Gateway port").option("--gateway-bind <mode>", "Gateway bind: loopback|tailnet|lan|auto|custom").option("--gateway-auth <mode>", "Gateway auth: token|password").option("--gateway-token <token>", "Gateway token (token auth)").option("--gateway-password <password>", "Gateway password (password auth)").option("--remote-url <url>", "Remote Gateway WebSocket URL").option("--remote-token <token>", "Remote Gateway token (optional)").option("--tailscale <mode>", "Tailscale: off|serve|funnel").option("--tailscale-reset-on-exit", "Reset tailscale serve/funnel on exit").option("--install-daemon", "Install gateway service").option("--no-install-daemon", "Skip gateway service install").option("--skip-daemon", "Skip gateway service install").option("--daemon-runtime <runtime>", "Daemon runtime: node|bun").option("--skip-channels", "Skip channel setup").option("--skip-skills", "Skip skills setup").option("--skip-health", "Skip health check").option("--skip-ui", "Skip Control UI/TUI prompts").option("--node-manager <name>", "Node manager for skills: npm|pnpm|bun").option("--json", "Output JSON summary", false); command.action(async (opts, commandRuntime) => { await runCommandWithRuntime(defaultRuntime, async () => { const installDaemon = resolveInstallDaemonFlag(commandRuntime, { installDaemon: Boolean(opts.installDaemon) }); const gatewayPort = typeof opts.gatewayPort === "string" ? Number.parseInt(opts.gatewayPort, 10) : void 0; await onboardCommand({ workspace: opts.workspace, nonInteractive: Boolean(opts.nonInteractive), acceptRisk: Boolean(opts.acceptRisk), flow: opts.flow, mode: opts.mode, authChoice: opts.authChoice, tokenProvider: opts.tokenProvider, token: opts.token, tokenProfileId: opts.tokenProfileId, tokenExpiresIn: opts.tokenExpiresIn, anthropicApiKey: opts.anthropicApiKey, openaiApiKey: opts.openaiApiKey, openrouterApiKey: opts.openrouterApiKey, aiGatewayApiKey: opts.aiGatewayApiKey, cloudflareAiGatewayAccountId: opts.cloudflareAiGatewayAccountId, cloudflareAiGatewayGatewayId: opts.cloudflareAiGatewayGatewayId, cloudflareAiGatewayApiKey: opts.cloudflareAiGatewayApiKey, moonshotApiKey: opts.moonshotApiKey, kimiCodeApiKey: opts.kimiCodeApiKey, geminiApiKey: opts.geminiApiKey, zaiApiKey: opts.zaiApiKey, xiaomiApiKey: opts.xiaomiApiKey, qianfanApiKey: opts.qianfanApiKey, minimaxApiKey: opts.minimaxApiKey, syntheticApiKey: opts.syntheticApiKey, veniceApiKey: opts.veniceApiKey, togetherApiKey: opts.togetherApiKey, huggingfaceApiKey: opts.huggingfaceApiKey, opencodeZenApiKey: opts.opencodeZenApiKey, xaiApiKey: opts.xaiApiKey, litellmApiKey: opts.litellmApiKey, customBaseUrl: opts.customBaseUrl, customApiKey: opts.customApiKey, customModelId: opts.customModelId, customProviderId: opts.customProviderId, customCompatibility: opts.customCompatibility, gatewayPort: typeof gatewayPort === "number" && Number.isFinite(gatewayPort) ? gatewayPort : void 0, gatewayBind: opts.gatewayBind, gatewayAuth: opts.gatewayAuth, gatewayToken: opts.gatewayToken, gatewayPassword: opts.gatewayPassword, remoteUrl: opts.remoteUrl, remoteToken: opts.remoteToken, tailscale: opts.tailscale, tailscaleResetOnExit: Boolean(opts.tailscaleResetOnExit), reset: Boolean(opts.reset), installDaemon, daemonRuntime: opts.daemonRuntime, skipChannels: Boolean(opts.skipChannels), skipSkills: Boolean(opts.skipSkills), skipHealth: Boolean(opts.skipHealth), skipUi: Boolean(opts.skipUi), nodeManager: opts.nodeManager, json: Boolean(opts.json) }, defaultRuntime); }); }); } //#endregion export { registerOnboardCommand };