( schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], side: StandardJsonSchemaSide, )
| 1880 | }; |
| 1881 | |
| 1882 | const staticToolSchemaRoot = ( |
| 1883 | schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], |
| 1884 | side: StandardJsonSchemaSide, |
| 1885 | ): unknown | undefined => { |
| 1886 | if (!schema) return undefined; |
| 1887 | const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined; |
| 1888 | if (!isReadonlyRecord(standard)) return schema; |
| 1889 | const jsonSchema = standard["jsonSchema"]; |
| 1890 | if (!isReadonlyRecord(jsonSchema)) return schema; |
| 1891 | const materialize = (jsonSchema as StandardJsonSchemaFns)[side]; |
| 1892 | return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema; |
| 1893 | }; |
| 1894 | |
| 1895 | export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 1896 | config: ExecutorConfig<TPlugins>, |
no test coverage detected