( schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], side: StandardJsonSchemaSide, )
| 1262 | }; |
| 1263 | |
| 1264 | const staticToolSchemaRoot = ( |
| 1265 | schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], |
| 1266 | side: StandardJsonSchemaSide, |
| 1267 | ): unknown | undefined => { |
| 1268 | if (!schema) return undefined; |
| 1269 | const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined; |
| 1270 | if (!isReadonlyRecord(standard)) return schema; |
| 1271 | const jsonSchema = standard["jsonSchema"]; |
| 1272 | if (!isReadonlyRecord(jsonSchema)) return schema; |
| 1273 | const materialize = (jsonSchema as StandardJsonSchemaFns)[side]; |
| 1274 | return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema; |
| 1275 | }; |
| 1276 | |
| 1277 | export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 1278 | config: ExecutorConfig<TPlugins>, |
no test coverage detected