( ctx context.Context, scope toolspkg.Scope, req toolspkg.CallRequest, )
| 149 | } |
| 150 | |
| 151 | func (n *daemonNativeTools) agentCreate( |
| 152 | ctx context.Context, |
| 153 | scope toolspkg.Scope, |
| 154 | req toolspkg.CallRequest, |
| 155 | ) (toolspkg.ToolResult, error) { |
| 156 | var input agentCreateInput |
| 157 | if err := decodeNativeInput(req, &input); err != nil { |
| 158 | return toolspkg.ToolResult{}, err |
| 159 | } |
| 160 | createReq, err := n.agentCreateRequest(req.ToolID, scope, input) |
| 161 | if err != nil { |
| 162 | return toolspkg.ToolResult{}, err |
| 163 | } |
| 164 | agent, err := core.CreateAgentFromRequest( |
| 165 | ctx, |
| 166 | createReq, |
| 167 | n.deps.HomePaths, |
| 168 | n.deps.Workspaces, |
| 169 | string(req.ToolID), |
| 170 | ) |
| 171 | if err != nil { |
| 172 | return toolspkg.ToolResult{}, nativeAgentCreateToolError(req.ToolID, err) |
| 173 | } |
| 174 | payload := core.AgentPayloadFromDef(agent) |
| 175 | return structuredResult(map[string]any{"agent": payload}, "agent "+payload.Name) |
| 176 | } |
| 177 | |
| 178 | func (n *daemonNativeTools) agentCreateRequest( |
| 179 | id toolspkg.ToolID, |
nothing calls this directly
no test coverage detected