(contexts: Tool.Context[])
| 23 | const agent = AgentV2.ID.make("build") |
| 24 | const assistantMessageID = SessionMessage.ID.make("msg_application_tool") |
| 25 | const contextual = (contexts: Tool.Context[]) => |
| 26 | Tool.make({ |
| 27 | description: "Read application context", |
| 28 | input: Schema.Struct({ query: Schema.String }), |
| 29 | output: Schema.Struct({ answer: Schema.String }), |
| 30 | execute: ({ query }, context) => |
| 31 | Effect.sync(() => { |
| 32 | contexts.push(context) |
| 33 | return { answer: query.toUpperCase() } |
| 34 | }), |
| 35 | toModelOutput: ({ output }) => [ |
| 36 | { type: "text", text: output.answer }, |
| 37 | { type: "file", data: "aGVsbG8=", mime: "image/png", name: "result.png" }, |
| 38 | ], |
| 39 | }) |
| 40 | |
| 41 | describe("ApplicationTools", () => { |
| 42 | it.effect("keeps the Core carrier opaque and executes its single handler", () => |
no test coverage detected