(input: {
readonly toolCallId: string
readonly toolName: string
readonly state: ErrorToolState
readonly cwd?: string
})
| 199 | } |
| 200 | |
| 201 | export function errorToolUpdate(input: { |
| 202 | readonly toolCallId: string |
| 203 | readonly toolName: string |
| 204 | readonly state: ErrorToolState |
| 205 | readonly cwd?: string |
| 206 | }): ToolCallUpdate { |
| 207 | return { |
| 208 | toolCallId: input.toolCallId, |
| 209 | status: "failed", |
| 210 | kind: toToolKind(input.toolName), |
| 211 | title: toolTitle(input.toolName, input.state.input, undefined), |
| 212 | locations: toLocations(input.toolName, input.state.input, input.cwd), |
| 213 | rawInput: rawInput(input.toolName, input.state.input, input.cwd), |
| 214 | content: [ |
| 215 | { |
| 216 | type: "content", |
| 217 | content: { |
| 218 | type: "text", |
| 219 | text: input.state.error, |
| 220 | }, |
| 221 | }, |
| 222 | ], |
| 223 | rawOutput: { |
| 224 | error: input.state.error, |
| 225 | metadata: input.state.metadata, |
| 226 | }, |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | export function completedToolRawOutput(state: CompletedToolState) { |
| 231 | return { |
no test coverage detected