@agent-score/commerce 2.6.1 → 2.6.2

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.
package/dist/index.mjs CHANGED
@@ -5533,9 +5533,9 @@ function stringifyPrimitive(value) {
5533
5533
  return `"${value}"`;
5534
5534
  return `${value}`;
5535
5535
  }
5536
- function optionalKeys(shape) {
5537
- return Object.keys(shape).filter((k) => {
5538
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
5536
+ function optionalKeys(shape2) {
5537
+ return Object.keys(shape2).filter((k) => {
5538
+ return shape2[k]._zod.optin === "optional" && shape2[k]._zod.optout === "optional";
5539
5539
  });
5540
5540
  }
5541
5541
  function pick(schema, mask) {
@@ -5588,15 +5588,15 @@ function omit(schema, mask) {
5588
5588
  });
5589
5589
  return clone(schema, def);
5590
5590
  }
5591
- function extend(schema, shape) {
5592
- if (!isPlainObject(shape)) {
5591
+ function extend(schema, shape2) {
5592
+ if (!isPlainObject(shape2)) {
5593
5593
  throw new Error("Invalid input to extend: expected a plain object");
5594
5594
  }
5595
5595
  const checks = schema._zod.def.checks;
5596
5596
  const hasChecks = checks && checks.length > 0;
5597
5597
  if (hasChecks) {
5598
5598
  const existingShape = schema._zod.def.shape;
5599
- for (const key in shape) {
5599
+ for (const key in shape2) {
5600
5600
  if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
5601
5601
  throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
5602
5602
  }
@@ -5604,20 +5604,20 @@ function extend(schema, shape) {
5604
5604
  }
5605
5605
  const def = mergeDefs(schema._zod.def, {
5606
5606
  get shape() {
5607
- const _shape = { ...schema._zod.def.shape, ...shape };
5607
+ const _shape = { ...schema._zod.def.shape, ...shape2 };
5608
5608
  assignProp(this, "shape", _shape);
5609
5609
  return _shape;
5610
5610
  }
5611
5611
  });
5612
5612
  return clone(schema, def);
5613
5613
  }
5614
- function safeExtend(schema, shape) {
5615
- if (!isPlainObject(shape)) {
5614
+ function safeExtend(schema, shape2) {
5615
+ if (!isPlainObject(shape2)) {
5616
5616
  throw new Error("Invalid input to safeExtend: expected a plain object");
5617
5617
  }
5618
5618
  const def = mergeDefs(schema._zod.def, {
5619
5619
  get shape() {
5620
- const _shape = { ...schema._zod.def.shape, ...shape };
5620
+ const _shape = { ...schema._zod.def.shape, ...shape2 };
5621
5621
  assignProp(this, "shape", _shape);
5622
5622
  return _shape;
5623
5623
  }
@@ -5651,7 +5651,7 @@ function partial(Class2, schema, mask) {
5651
5651
  const def = mergeDefs(schema._zod.def, {
5652
5652
  get shape() {
5653
5653
  const oldShape = schema._zod.def.shape;
5654
- const shape = { ...oldShape };
5654
+ const shape2 = { ...oldShape };
5655
5655
  if (mask) {
5656
5656
  for (const key in mask) {
5657
5657
  if (!(key in oldShape)) {
@@ -5659,21 +5659,21 @@ function partial(Class2, schema, mask) {
5659
5659
  }
5660
5660
  if (!mask[key])
5661
5661
  continue;
5662
- shape[key] = Class2 ? new Class2({
5662
+ shape2[key] = Class2 ? new Class2({
5663
5663
  type: "optional",
5664
5664
  innerType: oldShape[key]
5665
5665
  }) : oldShape[key];
5666
5666
  }
5667
5667
  } else {
5668
5668
  for (const key in oldShape) {
5669
- shape[key] = Class2 ? new Class2({
5669
+ shape2[key] = Class2 ? new Class2({
5670
5670
  type: "optional",
5671
5671
  innerType: oldShape[key]
5672
5672
  }) : oldShape[key];
5673
5673
  }
5674
5674
  }
5675
- assignProp(this, "shape", shape);
5676
- return shape;
5675
+ assignProp(this, "shape", shape2);
5676
+ return shape2;
5677
5677
  },
5678
5678
  checks: []
5679
5679
  });
@@ -5683,29 +5683,29 @@ function required(Class2, schema, mask) {
5683
5683
  const def = mergeDefs(schema._zod.def, {
5684
5684
  get shape() {
5685
5685
  const oldShape = schema._zod.def.shape;
5686
- const shape = { ...oldShape };
5686
+ const shape2 = { ...oldShape };
5687
5687
  if (mask) {
5688
5688
  for (const key in mask) {
5689
- if (!(key in shape)) {
5689
+ if (!(key in shape2)) {
5690
5690
  throw new Error(`Unrecognized key: "${key}"`);
5691
5691
  }
5692
5692
  if (!mask[key])
5693
5693
  continue;
5694
- shape[key] = new Class2({
5694
+ shape2[key] = new Class2({
5695
5695
  type: "nonoptional",
5696
5696
  innerType: oldShape[key]
5697
5697
  });
5698
5698
  }
5699
5699
  } else {
5700
5700
  for (const key in oldShape) {
5701
- shape[key] = new Class2({
5701
+ shape2[key] = new Class2({
5702
5702
  type: "nonoptional",
5703
5703
  innerType: oldShape[key]
5704
5704
  });
5705
5705
  }
5706
5706
  }
5707
- assignProp(this, "shape", shape);
5708
- return shape;
5707
+ assignProp(this, "shape", shape2);
5708
+ return shape2;
5709
5709
  }
5710
5710
  });
5711
5711
  return clone(schema, def);
@@ -8000,10 +8000,10 @@ var init_schemas = __esm({
8000
8000
  }
8001
8001
  const _normalized = cached(() => normalizeDef(def));
8002
8002
  defineLazy(inst._zod, "propValues", () => {
8003
- const shape = def.shape;
8003
+ const shape2 = def.shape;
8004
8004
  const propValues = {};
8005
- for (const key in shape) {
8006
- const field = shape[key]._zod;
8005
+ for (const key in shape2) {
8006
+ const field = shape2[key]._zod;
8007
8007
  if (field.values) {
8008
8008
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
8009
8009
  for (const v of field.values)
@@ -8029,9 +8029,9 @@ var init_schemas = __esm({
8029
8029
  }
8030
8030
  payload.value = {};
8031
8031
  const proms = [];
8032
- const shape = value.shape;
8032
+ const shape2 = value.shape;
8033
8033
  for (const key of value.keys) {
8034
- const el = shape[key];
8034
+ const el = shape2[key];
8035
8035
  const isOptionalIn = el._zod.optin === "optional";
8036
8036
  const isOptionalOut = el._zod.optout === "optional";
8037
8037
  const r = el._zod.run({ value: input[key], issues: [] }, ctx);
@@ -8051,7 +8051,7 @@ var init_schemas = __esm({
8051
8051
  $ZodObject.init(inst, def);
8052
8052
  const superParse = inst._zod.parse;
8053
8053
  const _normalized = cached(() => normalizeDef(def));
8054
- const generateFastpass = (shape) => {
8054
+ const generateFastpass = (shape2) => {
8055
8055
  const doc = new Doc(["shape", "payload", "ctx"]);
8056
8056
  const normalized = _normalized.value;
8057
8057
  const parseStr = (key) => {
@@ -8068,7 +8068,7 @@ var init_schemas = __esm({
8068
8068
  for (const key of normalized.keys) {
8069
8069
  const id = ids[key];
8070
8070
  const k = esc(key);
8071
- const schema = shape[key];
8071
+ const schema = shape2[key];
8072
8072
  const isOptionalIn = schema?._zod?.optin === "optional";
8073
8073
  const isOptionalOut = schema?._zod?.optout === "optional";
8074
8074
  doc.write(`const ${id} = ${parseStr(key)};`);
@@ -8142,7 +8142,7 @@ var init_schemas = __esm({
8142
8142
  doc.write(`payload.value = newResult;`);
8143
8143
  doc.write(`return payload;`);
8144
8144
  const fn = doc.compile();
8145
- return (payload, ctx) => fn(shape, payload, ctx);
8145
+ return (payload, ctx) => fn(shape2, payload, ctx);
8146
8146
  };
8147
8147
  let fastpass;
8148
8148
  const isObject3 = isObject;
@@ -17200,14 +17200,14 @@ var init_json_schema_processors = __esm({
17200
17200
  const def = schema._zod.def;
17201
17201
  json2.type = "object";
17202
17202
  json2.properties = {};
17203
- const shape = def.shape;
17204
- for (const key in shape) {
17205
- json2.properties[key] = process2(shape[key], ctx, {
17203
+ const shape2 = def.shape;
17204
+ for (const key in shape2) {
17205
+ json2.properties[key] = process2(shape2[key], ctx, {
17206
17206
  ...params,
17207
17207
  path: [...params.path, "properties", key]
17208
17208
  });
17209
17209
  }
17210
- const allKeys = new Set(Object.keys(shape));
17210
+ const allKeys = new Set(Object.keys(shape2));
17211
17211
  const requiredKeys = new Set([...allKeys].filter((key) => {
17212
17212
  const v = def.shape[key]._zod;
17213
17213
  if (ctx.io === "input") {
@@ -18068,47 +18068,47 @@ function array(element, params) {
18068
18068
  }
18069
18069
  // @__NO_SIDE_EFFECTS__
18070
18070
  function keyof(schema) {
18071
- const shape = schema._zod.def.shape;
18072
- return /* @__PURE__ */ _enum2(Object.keys(shape));
18071
+ const shape2 = schema._zod.def.shape;
18072
+ return /* @__PURE__ */ _enum2(Object.keys(shape2));
18073
18073
  }
18074
18074
  // @__NO_SIDE_EFFECTS__
18075
- function object(shape, params) {
18075
+ function object(shape2, params) {
18076
18076
  const def = {
18077
18077
  type: "object",
18078
- shape: shape ?? {},
18078
+ shape: shape2 ?? {},
18079
18079
  ...normalizeParams(params)
18080
18080
  };
18081
18081
  return new ZodMiniObject(def);
18082
18082
  }
18083
18083
  // @__NO_SIDE_EFFECTS__
18084
- function strictObject(shape, params) {
18084
+ function strictObject(shape2, params) {
18085
18085
  return new ZodMiniObject({
18086
18086
  type: "object",
18087
- shape,
18087
+ shape: shape2,
18088
18088
  catchall: /* @__PURE__ */ never(),
18089
18089
  ...normalizeParams(params)
18090
18090
  });
18091
18091
  }
18092
18092
  // @__NO_SIDE_EFFECTS__
18093
- function looseObject(shape, params) {
18093
+ function looseObject(shape2, params) {
18094
18094
  return new ZodMiniObject({
18095
18095
  type: "object",
18096
- shape,
18096
+ shape: shape2,
18097
18097
  catchall: /* @__PURE__ */ unknown(),
18098
18098
  ...normalizeParams(params)
18099
18099
  });
18100
18100
  }
18101
18101
  // @__NO_SIDE_EFFECTS__
18102
- function extend2(schema, shape) {
18103
- return extend(schema, shape);
18102
+ function extend2(schema, shape2) {
18103
+ return extend(schema, shape2);
18104
18104
  }
18105
18105
  // @__NO_SIDE_EFFECTS__
18106
- function safeExtend2(schema, shape) {
18107
- return safeExtend(schema, shape);
18106
+ function safeExtend2(schema, shape2) {
18107
+ return safeExtend(schema, shape2);
18108
18108
  }
18109
18109
  // @__NO_SIDE_EFFECTS__
18110
- function merge2(schema, shape) {
18111
- return extend(schema, shape);
18110
+ function merge2(schema, shape2) {
18111
+ return extend(schema, shape2);
18112
18112
  }
18113
18113
  // @__NO_SIDE_EFFECTS__
18114
18114
  function pick2(schema, mask) {
@@ -20146,7 +20146,7 @@ var version3;
20146
20146
  var init_version2 = __esm({
20147
20147
  "node_modules/viem/_esm/errors/version.js"() {
20148
20148
  "use strict";
20149
- version3 = "2.54.4";
20149
+ version3 = "2.54.6";
20150
20150
  }
20151
20151
  });
20152
20152
 
@@ -21141,14 +21141,14 @@ function fromResponse2(response) {
21141
21141
  throw new Error(`Missing ${Headers2.paymentReceipt} header.`);
21142
21142
  return deserialize4(header);
21143
21143
  }
21144
- var Schema2;
21144
+ var shape, BaseSchema, Schema2;
21145
21145
  var init_Receipt = __esm({
21146
21146
  "node_modules/mppx/dist/Receipt.js"() {
21147
21147
  "use strict";
21148
21148
  init_esm2();
21149
21149
  init_Constants();
21150
21150
  init_zod();
21151
- Schema2 = object({
21151
+ shape = {
21152
21152
  /** Payment method used (e.g., "tempo", "stripe"). */
21153
21153
  method: string2(),
21154
21154
  /** Method-specific reference (e.g., transaction hash). */
@@ -21161,7 +21161,9 @@ var init_Receipt = __esm({
21161
21161
  status: literal("success"),
21162
21162
  /** RFC 3339 settlement timestamp. */
21163
21163
  timestamp: datetime3()
21164
- });
21164
+ };
21165
+ BaseSchema = object(shape);
21166
+ Schema2 = looseObject(shape);
21165
21167
  }
21166
21168
  });
21167
21169
 
@@ -22572,7 +22574,7 @@ function createAgentScoreCore(options) {
22572
22574
  } = options;
22573
22575
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
22574
22576
  const agentMemoryHint = buildAgentMemoryHint(aipTrustedIssuers);
22575
- const defaultUa = `@agent-score/commerce@${"2.6.1"}`;
22577
+ const defaultUa = `@agent-score/commerce@${"2.6.2"}`;
22576
22578
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
22577
22579
  const sdk = new AgentScore({ apiKey, baseUrl, userAgent: userAgentHeader });
22578
22580
  const sessionSdkCache = /* @__PURE__ */ new Map();