( schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], side: StandardJsonSchemaSide, )
| 1285 | }; |
| 1286 | |
| 1287 | const staticToolSchemaRoot = ( |
| 1288 | schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], |
| 1289 | side: StandardJsonSchemaSide, |
| 1290 | ): unknown | undefined => { |
| 1291 | if (!schema) return undefined; |
| 1292 | const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined; |
| 1293 | if (!isReadonlyRecord(standard)) return schema; |
| 1294 | const jsonSchema = standard["jsonSchema"]; |
| 1295 | if (!isReadonlyRecord(jsonSchema)) return schema; |
| 1296 | const materialize = (jsonSchema as StandardJsonSchemaFns)[side]; |
| 1297 | return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema; |
| 1298 | }; |
| 1299 | |
| 1300 | export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 1301 | config: ExecutorConfig<TPlugins>, |
no test coverage detected