fix(plugin): preserve tool attachments (#27157)

This commit is contained in:
Aiden Cline 2026-05-12 16:23:15 -05:00 committed by GitHub
commit cb511f78ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 68 additions and 2 deletions

View file

@ -27,7 +27,21 @@ type AskInput = {
metadata: { [key: string]: any }
}
export type ToolResult = string | { output: string; metadata?: { [key: string]: any } }
export type ToolAttachment = {
type: "file"
mime: string
url: string
filename?: string
}
export type ToolResult =
| string
| {
title?: string
output: string
metadata?: { [key: string]: any }
attachments?: ToolAttachment[]
}
export function tool<Args extends z.ZodRawShape>(input: {
description: string