(node: Record<string, unknown>)
| 201 | * an object and cannot express null through a type array. |
| 202 | */ |
| 203 | const toolFileSchemaFor = (node: Record<string, unknown>): Record<string, unknown> => { |
| 204 | const annotations: Record<string, unknown> = {}; |
| 205 | if (typeof node.title === "string") annotations.title = node.title; |
| 206 | if (typeof node.description === "string") annotations.description = node.description; |
| 207 | |
| 208 | return nullableType(node) |
| 209 | ? { anyOf: [ToolFileJsonSchema, { type: "null" }], ...annotations } |
| 210 | : { ...(ToolFileJsonSchema as Record<string, unknown>), ...annotations }; |
| 211 | }; |
| 212 | |
| 213 | /** |
| 214 | * Rewrite one multipart property. Deliberately limited to the two shapes the |
no test coverage detected