Browse Source

fix: add missing metadata() and ask() defintions to ToolContext type (#8269)

Daniel M Brasil 2 months ago
parent
commit
73d5cacc06
1 changed files with 9 additions and 0 deletions
  1. 9 0
      packages/plugin/src/tool.ts

+ 9 - 0
packages/plugin/src/tool.ts

@@ -5,6 +5,15 @@ export type ToolContext = {
   messageID: string
   agent: string
   abort: AbortSignal
+  metadata(input: { title?: string; metadata?: { [key: string]: any } }): void
+  ask(input: AskInput): Promise<void>
+}
+
+type AskInput = {
+  permission: string
+  patterns: string[]
+  always: string[]
+  metadata: { [key: string]: any }
 }
 
 export function tool<Args extends z.ZodRawShape>(input: {