( input: StaticToolInput<TStore, TInputSchema>, )
| 518 | } |
| 519 | |
| 520 | export const tool = < |
| 521 | TStore = unknown, |
| 522 | TInputSchema extends StaticToolSchema | undefined = StaticToolSchema | undefined, |
| 523 | >( |
| 524 | input: StaticToolInput<TStore, TInputSchema>, |
| 525 | ): StaticToolDecl<TStore> => ({ |
| 526 | name: input.name, |
| 527 | description: input.description, |
| 528 | inputSchema: input.inputSchema, |
| 529 | outputSchema: input.outputSchema, |
| 530 | annotations: input.annotations, |
| 531 | handler: ({ args, ctx, elicit }) => |
| 532 | decodeStaticToolArgs(input.inputSchema, args).pipe( |
| 533 | Effect.flatMap((decoded) => |
| 534 | input.execute( |
| 535 | decoded as TInputSchema extends StaticToolSchema |
| 536 | ? StandardSchemaV1.InferOutput<TInputSchema> |
| 537 | : unknown, |
| 538 | { ctx, elicit }, |
| 539 | ), |
| 540 | ), |
| 541 | ), |
| 542 | }); |
| 543 | |
| 544 | export interface StaticIntegrationDecl<TStore = unknown> { |
| 545 | readonly id: string; |
no test coverage detected