( input: StaticToolInput<TStore, TInputSchema>, )
| 482 | } |
| 483 | |
| 484 | export const tool = < |
| 485 | TStore = unknown, |
| 486 | TInputSchema extends StaticToolSchema | undefined = StaticToolSchema | undefined, |
| 487 | >( |
| 488 | input: StaticToolInput<TStore, TInputSchema>, |
| 489 | ): StaticToolDecl<TStore> => ({ |
| 490 | name: input.name, |
| 491 | description: input.description, |
| 492 | inputSchema: input.inputSchema, |
| 493 | outputSchema: input.outputSchema, |
| 494 | annotations: input.annotations, |
| 495 | handler: ({ args, ctx, elicit }) => |
| 496 | decodeStaticToolArgs(input.inputSchema, args).pipe( |
| 497 | Effect.flatMap((decoded) => |
| 498 | input.execute( |
| 499 | decoded as TInputSchema extends StaticToolSchema |
| 500 | ? StandardSchemaV1.InferOutput<TInputSchema> |
| 501 | : unknown, |
| 502 | { ctx, elicit }, |
| 503 | ), |
| 504 | ), |
| 505 | ), |
| 506 | }); |
| 507 | |
| 508 | export interface StaticIntegrationDecl<TStore = unknown> { |
| 509 | readonly id: string; |
no test coverage detected