(schema: Schema.Top | undefined)
| 10 | const defs: Record<string, JsonSchema> = {}; |
| 11 | |
| 12 | function schemaToRef(schema: Schema.Top | undefined): string | undefined { |
| 13 | if (!schema) return undefined; |
| 14 | |
| 15 | const identifier = getSchemaIdentifier(schema); |
| 16 | const document = Schema.toJsonSchemaDocument(schema); |
| 17 | Object.assign(defs, document.definitions); |
| 18 | |
| 19 | if (identifier) { |
| 20 | return identifier; |
| 21 | } |
| 22 | |
| 23 | // Inline schema without an identifier — store under a generated key |
| 24 | const key = `__inline_${Object.keys(defs).length}`; |
| 25 | defs[key] = document.schema; |
| 26 | return key; |
| 27 | } |
| 28 | |
| 29 | const tools = catalog.tools.map((tool) => ({ |
| 30 | path: tool.path, |
no test coverage detected