UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

33 lines (32 loc) • 1.46 kB
import { a as writeRuntimeJson, r as defaultRuntime } from "./runtime-BRg2NubB.mjs"; import { p as shortenHomePath } from "./utils-CitNzLyF.mjs"; import { t as formatCliCommand } from "./command-format-DwEdrDKL.mjs"; import { u as throwExpectedCliError } from "./failure-output-Cq0Ej4cE.mjs"; import { t as createAgentTeam } from "./agent-team-DDChTw1v.mjs"; //#region src/commands/agents.commands.team.ts async function agentsTeamCreateCommand(opts, runtime = defaultRuntime) { const result = await createAgentTeam(opts); if (result.status === "error") throwExpectedCliError(result.message); const note = result.ambientOwnerId !== result.coordinatorId ? `ambient owner stays ${result.ambientOwnerId}; talk to the coordinator by name` : void 0; const agents = result.agents.map(({ agentId, name, workspace, agentDir }) => ({ agentId, name, workspace, agentDir })); if (opts.json) { writeRuntimeJson(runtime, { coordinatorId: result.coordinatorId, agents, ambientOwnerId: result.ambientOwnerId, ...note ? { note } : {} }); return; } runtime.log(`Created team with coordinator "${result.coordinatorId}":`); for (const agent of agents) runtime.log(`- ${agent.agentId}: ${shortenHomePath(agent.workspace)}`); if (note) runtime.log(note); runtime.log(`Talk to the coordinator: ${formatCliCommand(`openclaw agent --agent ${result.coordinatorId} --message "Describe your task"`)}`); } //#endregion export { agentsTeamCreateCommand };