(schema: z.ZodType)
| 46 | } |
| 47 | |
| 48 | function toJsonSchemaSafe(schema: z.ZodType): Record<string, unknown> { |
| 49 | try { |
| 50 | return z.toJSONSchema(schema, { io: 'input' }) as Record<string, unknown> |
| 51 | } catch { |
| 52 | return { type: 'object', properties: {} } |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | function hasMeaningfulJsonSchema(jsonSchema: Record<string, unknown>): boolean { |
| 57 | const properties = jsonSchema.properties |