UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.54 kB
import{o as writeRuntimeJson,r as defaultRuntime}from"./runtime-DIcLIHcp.mjs";import{r as terminalText}from"./safe-text-B_QTgn0s.mjs";import{a as displayPath}from"./utils-Dlk0IYAa.mjs";import{t as formatCliCommand}from"./command-format-D7KhNLP0.mjs";import{n as throwExpectedCliError}from"./expected-cli-error-oDVmXYil.mjs";import{t as runWithLocalStateOwner}from"./local-state-owner-fjzTarAw.mjs";import{t as createAgentTeam}from"./agent-team-G9C6ztTS.mjs"; //!src/commands/agents.commands.team.ts async function agentsTeamCreateCommand(e){const t=await runWithLocalStateOwner({method:`agents.team.create`,params:{},target:`agent team`,onForeignOwner:`refuse`,runLocal:()=>createAgentTeam(e)});if(t.status===`error`)throwExpectedCliError(t.message);const n=t.ambientOwnerId!==t.coordinatorId?`ambient owner stays ${t.ambientOwnerId}; talk to the coordinator by name`:void 0;const r=t.agents.map(({agentId:e,name:t,workspace:n,agentDir:r})=>({agentId:e,name:t,workspace:n,agentDir:r}));if(e.json){writeRuntimeJson(defaultRuntime,{coordinatorId:t.coordinatorId,agents:r,ambientOwnerId:t.ambientOwnerId,...n?{note:n}:{}});return}defaultRuntime.log(terminalText`Created team with coordinator "${t.coordinatorId}":`);for(const e of r)defaultRuntime.log(terminalText`- ${e.agentId}: ${displayPath(e.workspace)}`);if(n)defaultRuntime.log(terminalText`${n}`);defaultRuntime.log(`Talk to the coordinator: ${formatCliCommand(terminalText`openclaw agent --agent ${t.coordinatorId} --message "Describe your task"`)}`)}export{agentsTeamCreateCommand};