( schema: StaticToolSchema | undefined, args: unknown, )
| 378 | } |
| 379 | |
| 380 | const decodeStaticToolArgs = ( |
| 381 | schema: StaticToolSchema | undefined, |
| 382 | args: unknown, |
| 383 | ): Effect.Effect<unknown, unknown> => { |
| 384 | if (schema == null) return Effect.succeed(args); |
| 385 | return Effect.promise(() => Promise.resolve(schema["~standard"].validate(args))).pipe( |
| 386 | Effect.flatMap((result) => |
| 387 | "value" in result ? Effect.succeed(result.value) : Effect.fail(result), |
| 388 | ), |
| 389 | ); |
| 390 | }; |
| 391 | |
| 392 | export interface StaticToolInput< |
| 393 | TStore = unknown, |