(opts: {
output: string | ContentPart | ContentPart[];
message?: string;
brief?: string;
})
| 51 | } |
| 52 | |
| 53 | export function toolOk(opts: { |
| 54 | output: string | ContentPart | ContentPart[]; |
| 55 | message?: string; |
| 56 | brief?: string; |
| 57 | }): ToolReturnValue { |
| 58 | const display: DisplayBlock[] = []; |
| 59 | if (opts.brief) display.push({ type: 'brief', text: opts.brief }); |
| 60 | return { |
| 61 | isError: false, |
| 62 | output: normalizeOutput(opts.output), |
| 63 | message: opts.message ?? '', |
| 64 | display, |
| 65 | }; |
| 66 | } |
| 67 | |
| 68 | export function toolError(opts: { |
| 69 | message: string; |