( schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], side: StandardJsonSchemaSide, )
| 1531 | }; |
| 1532 | |
| 1533 | const staticToolSchemaRoot = ( |
| 1534 | schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], |
| 1535 | side: StandardJsonSchemaSide, |
| 1536 | ): unknown | undefined => { |
| 1537 | if (!schema) return undefined; |
| 1538 | const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined; |
| 1539 | if (!isReadonlyRecord(standard)) return schema; |
| 1540 | const jsonSchema = standard["jsonSchema"]; |
| 1541 | if (!isReadonlyRecord(jsonSchema)) return schema; |
| 1542 | const materialize = (jsonSchema as StandardJsonSchemaFns)[side]; |
| 1543 | return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema; |
| 1544 | }; |
| 1545 | |
| 1546 | export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 1547 | config: ExecutorConfig<TPlugins>, |
no test coverage detected