UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

39 lines (38 loc) • 1.49 kB
import { n as normalizeAgentId } from "./agent-id-CQjtp2ft.mjs"; import { i as validateAgentTeamMemberIds, r as loadAgentTeamPreset } from "./agent-roles-BJUCg-FF.mjs"; import { n as validateFirstOnboardingAgentName } from "./onboard-agent-SekSk9j4.mjs"; //#region src/commands/onboard-first-agent.ts async function promptFirstOnboardingAgent(e, t, n, r = false, i) { if (e) return; const a = i?.team ?? (i?.offerTeam === true && !t && await n.select({ message: "What would you like to create?", initialValue: "one", options: [{ value: "one", label: "One agent" }, { value: "team", label: "A small team: a chief of staff plus specialists" }] }) === "team"); const o = a ? await loadAgentTeamPreset() : void 0; const s = o?.specialists.map(({ id: e }) => e) ?? []; const validateName = (e) => validateFirstOnboardingAgentName(e) ?? (o ? validateAgentTeamMemberIds([normalizeAgentId(e), ...s]) : void 0); const c = o?.coordinator.id ?? "main"; const l = t ?? (r ? c : await n.text({ message: a ? "What should we call your chief of staff?" : "What should we call your first agent?", initialValue: c, validate: validateName })); const u = validateName(l); if (u) throw new Error(u); return { name: l, ...a ? { team: true } : {} }; } async function showSessionMigrationWarnings(e, t) { if (t?.length) await e.note(t.join("\n"), "Session history migration"); } //#endregion export { showSessionMigrationWarnings as n, promptFirstOnboardingAgent as t };