( input: StaticToolInput<TStore, TInputSchema>, )
| 463 | } |
| 464 | |
| 465 | export const tool = < |
| 466 | TStore = unknown, |
| 467 | TInputSchema extends StaticToolSchema | undefined = StaticToolSchema | undefined, |
| 468 | >( |
| 469 | input: StaticToolInput<TStore, TInputSchema>, |
| 470 | ): StaticToolDecl<TStore> => ({ |
| 471 | name: input.name, |
| 472 | description: input.description, |
| 473 | inputSchema: input.inputSchema, |
| 474 | outputSchema: input.outputSchema, |
| 475 | annotations: input.annotations, |
| 476 | handler: ({ args, ctx, elicit }) => |
| 477 | decodeStaticToolArgs(input.inputSchema, args).pipe( |
| 478 | Effect.flatMap((decoded) => |
| 479 | input.execute( |
| 480 | decoded as TInputSchema extends StaticToolSchema |
| 481 | ? StandardSchemaV1.InferOutput<TInputSchema> |
| 482 | : unknown, |
| 483 | { ctx, elicit }, |
| 484 | ), |
| 485 | ), |
| 486 | ), |
| 487 | }); |
| 488 | |
| 489 | export interface StaticIntegrationDecl<TStore = unknown> { |
| 490 | readonly id: string; |
no test coverage detected