( input: StaticToolInput<TStore, TInputSchema>, )
| 499 | } |
| 500 | |
| 501 | export const tool = < |
| 502 | TStore = unknown, |
| 503 | TInputSchema extends StaticToolSchema | undefined = StaticToolSchema | undefined, |
| 504 | >( |
| 505 | input: StaticToolInput<TStore, TInputSchema>, |
| 506 | ): StaticToolDecl<TStore> => ({ |
| 507 | name: input.name, |
| 508 | description: input.description, |
| 509 | inputSchema: input.inputSchema, |
| 510 | outputSchema: input.outputSchema, |
| 511 | annotations: input.annotations, |
| 512 | handler: ({ args, ctx, elicit }) => |
| 513 | decodeStaticToolArgs(input.inputSchema, args).pipe( |
| 514 | Effect.flatMap((decoded) => |
| 515 | input.execute( |
| 516 | decoded as TInputSchema extends StaticToolSchema |
| 517 | ? StandardSchemaV1.InferOutput<TInputSchema> |
| 518 | : unknown, |
| 519 | { ctx, elicit }, |
| 520 | ), |
| 521 | ), |
| 522 | ), |
| 523 | }); |
| 524 | |
| 525 | export interface StaticIntegrationDecl<TStore = unknown> { |
| 526 | readonly id: string; |
no test coverage detected