Files
oh-my-pi/patches/@ark%2Fschema@0.56.0.patch
T
can1357 7c295faa52 feat: added native support for ArkType schemas alongside Zod
- Added native support for parsing, normalized validation, and serialization of ArkType schemas throughout the agent pipeline.
- Implemented pruning of unconstrained union branches and normalization helpers to handle unrepresentable strict-mode branches.
- Patched ArkType's schema package to preserve declared object key order during serialization.
- Integrated ArkType schemas into `agent-loop` and migrated coding agent tool parameters to ArkType format.
2026-06-18 00:59:56 +02:00

30 lines
1.6 KiB
Diff

diff --git a/node_modules/@ark/schema/.bun-tag-de36d37c69a0e3d4 b/.bun-tag-de36d37c69a0e3d4
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/out/constraint.js b/out/constraint.js
index 80bd4ac7cb93deafa34af1595d320368c7cf1b90..4c7d64865edd612ed75698e0420d3435bc408d82 100644
--- a/out/constraint.js
+++ b/out/constraint.js
@@ -51,8 +51,10 @@ export const constraintKeyParser = (kind) => (schema, ctx) => {
}
const nodes = schema.map(schema => ctx.$.node(kind, schema));
// predicate order must be preserved to ensure inputs are narrowed
- // and checked in the correct order
- if (kind === "predicate")
+ // and checked in the correct order; required/optional preserve authored
+ // key order too so tool wire schemas stream in declaration order rather
+ // than alphabetized-by-hash order (oh-my-pi patch)
+ if (kind === "predicate" || kind === "required" || kind === "optional")
return nodes;
return nodes.sort((l, r) => (l.hash < r.hash ? -1 : 1));
}
@@ -107,7 +109,7 @@ export const flattenConstraints = (inner) => {
.sort((l, r) => l.precedence < r.precedence ? -1
: l.precedence > r.precedence ? 1
// preserve order for predicates
- : l.kind === "predicate" && r.kind === "predicate" ? 0
+ : (l.kind === "predicate" && r.kind === "predicate") || (l.kind === r.kind && (l.kind === "required" || l.kind === "optional")) ? 0
: l.hash < r.hash ? -1
: 1);
return result;