( schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], side: StandardJsonSchemaSide, )
| 1509 | }; |
| 1510 | |
| 1511 | const staticToolSchemaRoot = ( |
| 1512 | schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], |
| 1513 | side: StandardJsonSchemaSide, |
| 1514 | ): unknown | undefined => { |
| 1515 | if (!schema) return undefined; |
| 1516 | const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined; |
| 1517 | if (!isReadonlyRecord(standard)) return schema; |
| 1518 | const jsonSchema = standard["jsonSchema"]; |
| 1519 | if (!isReadonlyRecord(jsonSchema)) return schema; |
| 1520 | const materialize = (jsonSchema as StandardJsonSchemaFns)[side]; |
| 1521 | return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema; |
| 1522 | }; |
| 1523 | |
| 1524 | export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 1525 | config: ExecutorConfig<TPlugins>, |
no test coverage detected