( schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], side: StandardJsonSchemaSide, )
| 1523 | }; |
| 1524 | |
| 1525 | const staticToolSchemaRoot = ( |
| 1526 | schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], |
| 1527 | side: StandardJsonSchemaSide, |
| 1528 | ): unknown | undefined => { |
| 1529 | if (!schema) return undefined; |
| 1530 | const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined; |
| 1531 | if (!isReadonlyRecord(standard)) return schema; |
| 1532 | const jsonSchema = standard["jsonSchema"]; |
| 1533 | if (!isReadonlyRecord(jsonSchema)) return schema; |
| 1534 | const materialize = (jsonSchema as StandardJsonSchemaFns)[side]; |
| 1535 | return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema; |
| 1536 | }; |
| 1537 | |
| 1538 | export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 1539 | config: ExecutorConfig<TPlugins>, |
no test coverage detected