( schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], side: StandardJsonSchemaSide, )
| 1561 | }; |
| 1562 | |
| 1563 | const staticToolSchemaRoot = ( |
| 1564 | schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], |
| 1565 | side: StandardJsonSchemaSide, |
| 1566 | ): unknown | undefined => { |
| 1567 | if (!schema) return undefined; |
| 1568 | const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined; |
| 1569 | if (!isReadonlyRecord(standard)) return schema; |
| 1570 | const jsonSchema = standard["jsonSchema"]; |
| 1571 | if (!isReadonlyRecord(jsonSchema)) return schema; |
| 1572 | const materialize = (jsonSchema as StandardJsonSchemaFns)[side]; |
| 1573 | return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema; |
| 1574 | }; |
| 1575 | |
| 1576 | export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 1577 | config: ExecutorConfig<TPlugins>, |
no test coverage detected