( schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], side: StandardJsonSchemaSide, )
| 1800 | }; |
| 1801 | |
| 1802 | const staticToolSchemaRoot = ( |
| 1803 | schema: StaticToolDecl["inputSchema"] | StaticToolDecl["outputSchema"], |
| 1804 | side: StandardJsonSchemaSide, |
| 1805 | ): unknown | undefined => { |
| 1806 | if (!schema) return undefined; |
| 1807 | const standard = isReadonlyRecord(schema) ? schema["~standard"] : undefined; |
| 1808 | if (!isReadonlyRecord(standard)) return schema; |
| 1809 | const jsonSchema = standard["jsonSchema"]; |
| 1810 | if (!isReadonlyRecord(jsonSchema)) return schema; |
| 1811 | const materialize = (jsonSchema as StandardJsonSchemaFns)[side]; |
| 1812 | return typeof materialize === "function" ? materialize({ target: "draft-07" }) : jsonSchema; |
| 1813 | }; |
| 1814 | |
| 1815 | export const createExecutor = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 1816 | config: ExecutorConfig<TPlugins>, |
no test coverage detected