Merge remote-tracking branch 'origin/master' into codex/simp-session-log-representation

This commit is contained in:
Tianyi Cui
2026-07-15 15:56:11 +08:00
22 files changed
+3354 -6

No files matched your search

+9
View File
@@ -478,6 +478,15 @@ function walkSchemaExpr(
}
return
}
// A union of objects (discriminated union config): collect keys from all
// variants. Each variant is visited the same way as an intersect element.
if (method === 'union' && call.arguments[0] && ts.isArrayLiteralExpression(call.arguments[0])) {
for (const el of call.arguments[0].elements) {
const part = unwrapExpr(el)
if (ts.isCallExpression(part)) { visit(part); continue }
}
return
}
// A chained refinement (`z.object({…}).default(…)` etc.): the keys live on
// the call the chain hangs off — keep unwrapping toward it.
const base = unwrapExpr(call.expression.expression)