( schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], side: StandardJsonSchemaSide, )
| 1894 | }; |
| 1895 | |
| 1896 | const staticToolSchemaRoot = ( |
| 1897 | schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], |
| 1898 | side: StandardJsonSchemaSide, |
| 1899 | ): unknown | undefined => { |
| 1900 | if (!schema) return undefined; |
| 1901 | const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined; |
| 1902 | if (!isReadonlyRecord(standard)) return schema; |
| 1903 | const jsonSchema = standard["jsonSchema"]; |
| 1904 | if (!isReadonlyRecord(jsonSchema)) return schema; |
| 1905 | const materialize = (jsonSchema as StandardJsonSchemaFns)[side]; |
| 1906 | return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema; |
| 1907 | }; |
| 1908 | |
| 1909 | export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 1910 | config: ExecutorConfig<TPlugins>, |
no test coverage detected