( input: StaticToolInput<TStore, TInputSchema>, )
| 531 | } |
| 532 | |
| 533 | export const tool = < |
| 534 | TStore = unknown, |
| 535 | TInputSchema extends StaticToolSchema | undefined = StaticToolSchema | undefined, |
| 536 | >( |
| 537 | input: StaticToolInput<TStore, TInputSchema>, |
| 538 | ): StaticToolDecl<TStore> => ({ |
| 539 | name: input.name, |
| 540 | description: input.description, |
| 541 | inputSchema: input.inputSchema, |
| 542 | outputSchema: input.outputSchema, |
| 543 | annotations: input.annotations, |
| 544 | handler: ({ args, ctx, elicit }) => |
| 545 | decodeStaticToolArgs(input.inputSchema, args).pipe( |
| 546 | Effect.flatMap((decoded) => |
| 547 | input.execute( |
| 548 | decoded as TInputSchema extends StaticToolSchema |
| 549 | ? StandardSchemaV1.InferOutput<TInputSchema> |
| 550 | : unknown, |
| 551 | { ctx, elicit }, |
| 552 | ), |
| 553 | ), |
| 554 | ), |
| 555 | }); |
| 556 | |
| 557 | export interface StaticIntegrationDecl<TStore = unknown> { |
| 558 | readonly id: string; |
no test coverage detected