@aexhq/sdk 1.0.5-canary → 1.0.6-canary

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -131,6 +131,18 @@ export function errorFromZod(error) {
131
131
  }
132
132
  /** Parse `input` against `schema`, throwing the family's own error text on failure. */
133
133
  export function parseWire(schema, input) {
134
+ const meta = wireObjectMeta.get(schema);
135
+ if (meta && input !== null && typeof input === "object" && !Array.isArray(input)) {
136
+ // Zod deliberately skips `__proto__` while collecting unknown keys so a
137
+ // plain-object output cannot have its prototype replaced. That safety
138
+ // rule must not turn an attacker-controlled field into an accepted field;
139
+ // recover the strict wire-object diagnostic before Zod sees the input.
140
+ const unknownKey = Object.keys(input).find((key) => !meta.permitted.includes(key));
141
+ if (unknownKey !== undefined) {
142
+ const diagnostic = meta.unknownKey(meta.resolvePath([]), unknownKey, meta.permitted);
143
+ throw typeof diagnostic === "string" ? new Error(diagnostic) : diagnostic;
144
+ }
145
+ }
134
146
  const result = z.safeParse(schema, input);
135
147
  if (!result.success) {
136
148
  throw structuredError(schema, result.error) ?? errorFromZod(result.error);
package/dist/cli.mjs CHANGED
@@ -1782,6 +1782,14 @@ function errorFromZod(error) {
1782
1782
  return new Error(primaryIssue(error.issues)?.message ?? "invalid input");
1783
1783
  }
1784
1784
  function parseWire(schema, input) {
1785
+ const meta2 = wireObjectMeta.get(schema);
1786
+ if (meta2 && input !== null && typeof input === "object" && !Array.isArray(input)) {
1787
+ const unknownKey = Object.keys(input).find((key) => !meta2.permitted.includes(key));
1788
+ if (unknownKey !== void 0) {
1789
+ const diagnostic = meta2.unknownKey(meta2.resolvePath([]), unknownKey, meta2.permitted);
1790
+ throw typeof diagnostic === "string" ? new Error(diagnostic) : diagnostic;
1791
+ }
1792
+ }
1785
1793
  const result = safeParse(schema, input);
1786
1794
  if (!result.success) {
1787
1795
  throw structuredError(schema, result.error) ?? errorFromZod(result.error);
@@ -1 +1 @@
1
- 7c9ef23d338e4cb7205bf51f442ec53bec5b6c18c103e700b9ad4344fb9913a0 cli.mjs
1
+ 1f35333a7b3ceb4bbf8461214ae7a9b23cf985195b36e68b61e5e6a016f1f0c2 cli.mjs
package/dist/version.d.ts CHANGED
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * Used by the (future) User-Agent header on outbound SDK requests.
8
8
  */
9
- export declare const SDK_VERSION = "1.0.5-canary";
9
+ export declare const SDK_VERSION = "1.0.6-canary";
package/dist/version.js CHANGED
@@ -6,5 +6,5 @@
6
6
  *
7
7
  * Used by the (future) User-Agent header on outbound SDK requests.
8
8
  */
9
- export const SDK_VERSION = "1.0.5-canary";
9
+ export const SDK_VERSION = "1.0.6-canary";
10
10
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aexhq/sdk",
3
- "version": "1.0.5-canary",
3
+ "version": "1.0.6-canary",
4
4
  "description": "TypeScript SDK for autonomous agent sessions with managed Vercel AI Gateway model access.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -55,6 +55,6 @@
55
55
  "zod": "4.4.3"
56
56
  },
57
57
  "aexRelease": {
58
- "sourceSha": "3f747bd862826938ba13bba2304d9260e829efeb"
58
+ "sourceSha": "ee2aa45e4ad7e3af492f0ecd109c95c550d3ea7a"
59
59
  }
60
60
  }