@ariestools/aries-chain-serve 0.1.21 → 0.2.0

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.
Files changed (2) hide show
  1. package/dist/bin/chainServer.mjs +200 -258
  2. package/package.json +13 -14
@@ -18,7 +18,7 @@ var __exportAll = (all, no_symbols) => {
18
18
  return target;
19
19
  };
20
20
  //#endregion
21
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/util.js
21
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
22
22
  function getEnumValues(entries) {
23
23
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
24
24
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -433,7 +433,6 @@ function members(proto, table) {
433
433
  });
434
434
  else defineBound(proto, key, desc.value);
435
435
  }
436
- for (const sym of Object.getOwnPropertySymbols(table)) defineBound(proto, sym, table[sym]);
437
436
  }
438
437
  /** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
439
438
  function own(inst, key, value, enumerable = true) {
@@ -574,7 +573,7 @@ function constantCatch(value) {
574
573
  return fn;
575
574
  }
576
575
  //#endregion
577
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/core.js
576
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
578
577
  var _a$1;
579
578
  const _zodDesc = {
580
579
  value: void 0,
@@ -619,8 +618,7 @@ function $constructor(name, initializer, proto, params) {
619
618
  } finally {
620
619
  _zodDesc.value = void 0;
621
620
  }
622
- }
623
- if (inst._zod.traits.has(name)) return;
621
+ } else if (inst._zod.traits.has(name)) return;
624
622
  inst._zod.traits.add(name);
625
623
  initializer(inst, def);
626
624
  if (initialized) {
@@ -681,7 +679,7 @@ function config(newConfig) {
681
679
  return globalConfig;
682
680
  }
683
681
  //#endregion
684
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/errors.js
682
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
685
683
  function _getMessage() {
686
684
  const internals = this._zod;
687
685
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -797,7 +795,7 @@ function formatError$1(error, mapper = (issue) => issue.message) {
797
795
  return fieldErrors;
798
796
  }
799
797
  //#endregion
800
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/parse.js
798
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
801
799
  function finalizeParams(callee, params) {
802
800
  return {
803
801
  callee: params?.callee ?? callee,
@@ -1004,7 +1002,7 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
1004
1002
  return _safeParseAsync(_Err)(schema, value, _ctx);
1005
1003
  };
1006
1004
  //#endregion
1007
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/regexes.js
1005
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.js
1008
1006
  var regexes_exports = /* @__PURE__ */ __exportAll({
1009
1007
  anyString: () => anyString,
1010
1008
  base64: () => base64$1,
@@ -1017,6 +1015,7 @@ var regexes_exports = /* @__PURE__ */ __exportAll({
1017
1015
  creditCard: () => creditCard$1,
1018
1016
  cuid: () => cuid$1,
1019
1017
  cuid2: () => cuid2$1,
1018
+ currencyCode: () => currencyCode$1,
1020
1019
  date: () => date$2,
1021
1020
  datetime: () => datetime$1,
1022
1021
  domain: () => domain,
@@ -1129,6 +1128,7 @@ const domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+
1129
1128
  const httpProtocol = /^https?$/;
1130
1129
  const e164$1 = /^\+[1-9]\d{6,14}$/;
1131
1130
  const creditCard$1 = /^\d(?:[ -]?\d){11,18}$/;
1131
+ const currencyCode$1 = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;
1132
1132
  const iban$1 = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
1133
1133
  const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
1134
1134
  /** Anchors a pattern source. The interpolation lives here rather than at the call site because
@@ -1191,7 +1191,7 @@ const sha512_hex = /^[0-9a-fA-F]{128}$/;
1191
1191
  const sha512_base64 = /*@__PURE__*/ fixedBase64(86, "==");
1192
1192
  const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);
1193
1193
  //#endregion
1194
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/checks.js
1194
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
1195
1195
  const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
1196
1196
  var _a;
1197
1197
  inst._zod ?? (inst._zod = {});
@@ -1586,6 +1586,38 @@ const $ZodCheckProperty = /*@__PURE__*/ $constructor("$ZodCheckProperty", (inst,
1586
1586
  handleCheckPropertyResult(result, payload, def.property);
1587
1587
  };
1588
1588
  });
1589
+ const $ZodCheckProperties = /*@__PURE__*/ $constructor("$ZodCheckProperties", (inst, def) => {
1590
+ $ZodCheck.init(inst, def);
1591
+ hide(inst, Symbol.iterator, function* () {
1592
+ yield inst;
1593
+ });
1594
+ let entries;
1595
+ inst._zod.check = (payload) => {
1596
+ if (payload.value == null) {
1597
+ payload.issues.push({
1598
+ expected: "object",
1599
+ code: "invalid_type",
1600
+ input: payload.value,
1601
+ inst
1602
+ });
1603
+ return;
1604
+ }
1605
+ entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
1606
+ const input = payload.value;
1607
+ let proms;
1608
+ for (const [key, schema] of entries) {
1609
+ const result = schema._zod.run({
1610
+ value: input[key],
1611
+ issues: []
1612
+ }, {});
1613
+ if (result instanceof Promise) {
1614
+ proms ?? (proms = []);
1615
+ proms.push(result.then((result) => handleCheckPropertyResult(result, payload, key)));
1616
+ } else handleCheckPropertyResult(result, payload, key);
1617
+ }
1618
+ if (proms) return Promise.all(proms).then(() => void 0);
1619
+ };
1620
+ });
1589
1621
  const $ZodCheckMimeType = /*@__PURE__*/ $constructor("$ZodCheckMimeType", (inst, def) => {
1590
1622
  $ZodCheck.init(inst, def);
1591
1623
  const mimeSet = new Set(def.mime);
@@ -1607,7 +1639,7 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
1607
1639
  };
1608
1640
  });
1609
1641
  //#endregion
1610
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/doc.js
1642
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.js
1611
1643
  var Doc = class {
1612
1644
  constructor(args = [], closed = {}) {
1613
1645
  this.content = [];
@@ -1641,14 +1673,14 @@ var Doc = class {
1641
1673
  }
1642
1674
  };
1643
1675
  //#endregion
1644
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/versions.js
1676
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
1645
1677
  const version = {
1646
1678
  major: 4,
1647
1679
  minor: 6,
1648
- patch: 1
1680
+ patch: 5
1649
1681
  };
1650
1682
  //#endregion
1651
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/schemas.js
1683
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
1652
1684
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1653
1685
  var _a;
1654
1686
  inst ?? (inst = {});
@@ -1808,10 +1840,27 @@ const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
1808
1840
  def.pattern ?? (def.pattern = email$1);
1809
1841
  $ZodStringFormat.init(inst, def);
1810
1842
  });
1811
- /** Parses a URL for `$ZodURL`, applying the one guard the URL constructor cannot express. Returns the parsed URL, or a code naming the stage that rejected it — the runtime needs that distinction to pick an issue note, and compiled code only needs to know it is not a URL. */
1843
+ function canParseURL(input) {
1844
+ try {
1845
+ if (typeof URL !== "undefined" && typeof URL.canParse === "function") return URL.canParse(input);
1846
+ new URL(input);
1847
+ return true;
1848
+ } catch {
1849
+ return false;
1850
+ }
1851
+ }
1852
+ function validateURL(trimmed, def) {
1853
+ if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) return canParseURL(trimmed) || 2;
1854
+ return parseURLObject(trimmed, def);
1855
+ }
1856
+ /** Parses a URL while preserving the non-normalizing HTTP guard. */
1812
1857
  function parseURLObject(trimmed, def) {
1813
1858
  if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return 1;
1814
1859
  try {
1860
+ if (typeof URL !== "undefined") {
1861
+ const URLStatic = URL;
1862
+ if (typeof URLStatic.parse === "function") return URLStatic.parse(trimmed) ?? 2;
1863
+ }
1815
1864
  return new URL(trimmed);
1816
1865
  } catch {
1817
1866
  return 2;
@@ -1835,7 +1884,7 @@ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
1835
1884
  inst._zod.check = (payload) => {
1836
1885
  try {
1837
1886
  const trimmed = payload.value.trim();
1838
- const url = parseURLObject(trimmed, def);
1887
+ const url = validateURL(trimmed, def);
1839
1888
  if (url === 1) {
1840
1889
  payload.issues.push({
1841
1890
  code: "invalid_format",
@@ -1857,6 +1906,10 @@ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
1857
1906
  });
1858
1907
  return;
1859
1908
  }
1909
+ if (url === true) {
1910
+ payload.value = stripTabAndNewline(trimmed);
1911
+ return;
1912
+ }
1860
1913
  if (def.hostname && !urlHostnameOk(url, def.hostname)) payload.issues.push({
1861
1914
  code: "invalid_format",
1862
1915
  format: "url",
@@ -1946,12 +1999,7 @@ const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
1946
1999
  const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
1947
2000
  function isValidIPv6(value) {
1948
2001
  if (!ipv6Alphabet.test(value)) return false;
1949
- try {
1950
- new URL(`http://[${value}]`);
1951
- return true;
1952
- } catch {
1953
- return false;
1954
- }
2002
+ return canParseURL(`http://[${value}]`);
1955
2003
  }
1956
2004
  const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
1957
2005
  def.pattern ?? (def.pattern = ipv6$1);
@@ -2379,7 +2427,7 @@ function handlePropertyResult(result, final, key, input, optin, optout) {
2379
2427
  return;
2380
2428
  }
2381
2429
  if (result.value === void 0) {
2382
- if (isPresent) final.value[key] = void 0;
2430
+ if (isPresent || optin === "defaulted" && !isOptionalOut) final.value[key] = void 0;
2383
2431
  } else final.value[key] = result.value;
2384
2432
  }
2385
2433
  const NO_SYMBOL_KEYS = [];
@@ -2588,19 +2636,18 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
2588
2636
  }
2589
2637
 
2590
2638
  `);
2591
- else doc.write(`
2639
+ else {
2640
+ doc.write(`
2592
2641
  if (${id}.issues.length) {${prefixStr(id, k)}
2593
2642
  }
2594
-
2595
- if (${id}.value === undefined) {
2596
- if (${isPresent}) {
2597
- newResult[${k}] = undefined;
2598
- }
2599
- } else {
2643
+ `);
2644
+ if (optin === "defaulted") doc.write(`newResult[${k}] = ${id}.value;`);
2645
+ else doc.write(`
2646
+ if (${id}.value !== undefined || ${isPresent}) {
2600
2647
  newResult[${k}] = ${id}.value;
2601
2648
  }
2602
-
2603
2649
  `);
2650
+ }
2604
2651
  }
2605
2652
  doc.write(`payload.value = newResult;`);
2606
2653
  doc.write(`return payload;`);
@@ -3774,67 +3821,8 @@ function handleRefineResult(result, payload, input, inst) {
3774
3821
  payload.issues.push(issue(_iss));
3775
3822
  }
3776
3823
  }
3777
- function handlePropertiesResult(result, payload, key) {
3778
- if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
3779
- }
3780
- const $ZodProperties = /*@__PURE__*/ $constructor("$ZodProperties", (inst, def) => {
3781
- $ZodType.init(inst, def);
3782
- $ZodCheck.init(inst, def);
3783
- const memo = globalConfig.memoizer;
3784
- memo?.attach(inst);
3785
- let entries;
3786
- const runShape = (payload, ctx) => {
3787
- entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
3788
- const input = payload.value;
3789
- let proms;
3790
- for (const [key, schema] of entries) {
3791
- const result = schema._zod.run({
3792
- value: input[key],
3793
- issues: []
3794
- }, ctx);
3795
- if (result instanceof Promise) {
3796
- proms ?? (proms = []);
3797
- proms.push(result.then((result) => handlePropertiesResult(result, payload, key)));
3798
- } else handlePropertiesResult(result, payload, key);
3799
- }
3800
- if (proms) return Promise.all(proms).then(() => void 0);
3801
- };
3802
- inst._zod.parse = (payload, ctx) => {
3803
- const input = payload.value;
3804
- if (input === null || typeof input !== "object" && typeof input !== "function") {
3805
- payload.issues.push({
3806
- expected: "object",
3807
- code: "invalid_type",
3808
- input,
3809
- inst
3810
- });
3811
- return payload;
3812
- }
3813
- if (ctx.direction === "backward") ctx = {
3814
- ...ctx,
3815
- direction: "forward"
3816
- };
3817
- if (memo) memo.alloc(inst, payload, input, ctx);
3818
- const result = runShape(payload, ctx);
3819
- return result instanceof Promise ? result.then(() => payload) : payload;
3820
- };
3821
- inst._zod.check = (payload) => {
3822
- if (payload.value == null) {
3823
- payload.issues.push({
3824
- expected: "object",
3825
- code: "invalid_type",
3826
- input: payload.value,
3827
- inst
3828
- });
3829
- return;
3830
- }
3831
- return runShape(payload, {});
3832
- };
3833
- }, { *[Symbol.iterator]() {
3834
- yield this;
3835
- } });
3836
3824
  //#endregion
3837
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/memoizer.js
3825
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.js
3838
3826
  var $ZodCyclicError = class extends Error {
3839
3827
  constructor() {
3840
3828
  super(`Cannot parse a reference cycle that closes through a transform`);
@@ -3845,7 +3833,7 @@ var $ZodCyclicError = class extends Error {
3845
3833
  const STATE = "~memo";
3846
3834
  const NO_ISSUES = [];
3847
3835
  function isRef(value) {
3848
- return value !== null && (typeof value === "object" || typeof value === "function");
3836
+ return value !== null && typeof value === "object";
3849
3837
  }
3850
3838
  function cloneIssues(issues) {
3851
3839
  return issues.map((iss) => iss.path ? {
@@ -3892,9 +3880,6 @@ function isRecursive(inst, stack, resolve) {
3892
3880
  check(def.catchall);
3893
3881
  break;
3894
3882
  }
3895
- case "properties":
3896
- merge(shape(def.shape, false));
3897
- break;
3898
3883
  case "array":
3899
3884
  check(def.element);
3900
3885
  break;
@@ -4090,7 +4075,7 @@ function isBackEdge(ctx, value) {
4090
4075
  return backEdges !== void 0 && isRef(value) && backEdges.has(value);
4091
4076
  }
4092
4077
  //#endregion
4093
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/locales/en.js
4078
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.js
4094
4079
  const error = () => {
4095
4080
  const Sizable = {
4096
4081
  string: {
@@ -4145,6 +4130,7 @@ const error = () => {
4145
4130
  base64url: "base64url-encoded string",
4146
4131
  json_string: "JSON string",
4147
4132
  e164: "E.164 number",
4133
+ currency_code: "currency code",
4148
4134
  credit_card: "credit card number",
4149
4135
  iban: "IBAN",
4150
4136
  jwt: "JWT",
@@ -4197,7 +4183,7 @@ function en_default() {
4197
4183
  return { localeError: error() };
4198
4184
  }
4199
4185
  //#endregion
4200
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/registries.js
4186
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.js
4201
4187
  var _a;
4202
4188
  var $ZodRegistry = class {
4203
4189
  constructor() {
@@ -4244,13 +4230,17 @@ function registry() {
4244
4230
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
4245
4231
  const globalRegistry = globalThis.__zod_globalRegistry;
4246
4232
  //#endregion
4247
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/api.js
4233
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
4234
+ function snapshotChecks(def) {
4235
+ if (def.checks) def.checks = [...def.checks];
4236
+ return def;
4237
+ }
4248
4238
  // @__NO_SIDE_EFFECTS__
4249
4239
  function _string(Class, params) {
4250
- return new Class({
4240
+ return new Class(snapshotChecks({
4251
4241
  type: "string",
4252
4242
  ...normalizeParams(params)
4253
- });
4243
+ }));
4254
4244
  }
4255
4245
  // @__NO_SIDE_EFFECTS__
4256
4246
  function _email(Class, params) {
@@ -4552,11 +4542,11 @@ function _isoDuration(Class, params) {
4552
4542
  }
4553
4543
  // @__NO_SIDE_EFFECTS__
4554
4544
  function _number(Class, params) {
4555
- return new Class({
4545
+ return new Class(snapshotChecks({
4556
4546
  type: "number",
4557
4547
  checks: [],
4558
4548
  ...normalizeParams(params)
4559
- });
4549
+ }));
4560
4550
  }
4561
4551
  // @__NO_SIDE_EFFECTS__
4562
4552
  function _int(Class, params) {
@@ -4869,9 +4859,8 @@ function _property(property, schema, params) {
4869
4859
  });
4870
4860
  }
4871
4861
  // @__NO_SIDE_EFFECTS__
4872
- function _properties(Class, shape, params) {
4873
- return new Class({
4874
- type: "properties",
4862
+ function _properties(shape, params) {
4863
+ return new $ZodCheckProperties({
4875
4864
  check: "properties",
4876
4865
  shape,
4877
4866
  ...normalizeParams(params)
@@ -5080,7 +5069,7 @@ function _stringFormat(Class, format, fnOrRegex, _params = {}) {
5080
5069
  return new Class(def);
5081
5070
  }
5082
5071
  //#endregion
5083
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/to-json-schema.js
5072
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
5084
5073
  function assignProps(target, ...sources) {
5085
5074
  for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
5086
5075
  return target;
@@ -5524,7 +5513,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
5524
5513
  return finalize(ctx, schema);
5525
5514
  };
5526
5515
  //#endregion
5527
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/json-schema-processors.js
5516
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.js
5528
5517
  const narrowMin = (agg, key, value) => {
5529
5518
  if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
5530
5519
  };
@@ -5794,13 +5783,12 @@ const objectProcessor = (schema, ctx, _json, params) => {
5794
5783
  key
5795
5784
  ]
5796
5785
  }));
5797
- const allKeys = new Set(Object.keys(shape));
5798
- const requiredKeys = new Set([...allKeys].filter((key) => {
5786
+ const requiredKeys = [];
5787
+ for (const key of Object.keys(shape)) {
5799
5788
  const field = def.shape[key];
5800
- if (ctx.io === "input") return inputOptin(field) === void 0;
5801
- else return field._zod.optout === void 0;
5802
- }));
5803
- if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
5789
+ if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) requiredKeys.push(key);
5790
+ }
5791
+ if (requiredKeys.length > 0) json.required = requiredKeys;
5804
5792
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
5805
5793
  else if (!def.catchall) {
5806
5794
  if (ctx.io === "output") json.additionalProperties = false;
@@ -6094,7 +6082,7 @@ const lazyProcessor = (schema, ctx, _json, params) => {
6094
6082
  seen.ref = innerType;
6095
6083
  };
6096
6084
  //#endregion
6097
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/checks.js
6085
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/checks.js
6098
6086
  var checks_exports = /* @__PURE__ */ __exportAll({
6099
6087
  endsWith: () => _endsWith,
6100
6088
  gt: () => _gt,
@@ -6116,6 +6104,7 @@ var checks_exports = /* @__PURE__ */ __exportAll({
6116
6104
  normalize: () => _normalize,
6117
6105
  overwrite: () => _overwrite,
6118
6106
  positive: () => _positive,
6107
+ properties: () => _properties,
6119
6108
  property: () => _property,
6120
6109
  regex: () => _regex,
6121
6110
  size: () => _size,
@@ -6127,7 +6116,7 @@ var checks_exports = /* @__PURE__ */ __exportAll({
6127
6116
  uppercase: () => _uppercase
6128
6117
  });
6129
6118
  //#endregion
6130
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/errors.js
6119
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.js
6131
6120
  const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
6132
6121
  function _lazyMethod(proto, key, make) {
6133
6122
  Object.defineProperty(proto, key, {
@@ -6177,7 +6166,7 @@ const initializer = (inst, issues) => {
6177
6166
  };
6178
6167
  const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
6179
6168
  //#endregion
6180
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/parse.js
6169
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.js
6181
6170
  const parse = /* @__PURE__ */ _parse(ZodRealError);
6182
6171
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
6183
6172
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -6191,7 +6180,7 @@ const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
6191
6180
  const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
6192
6181
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
6193
6182
  //#endregion
6194
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/schemas.js
6183
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.js
6195
6184
  var schemas_exports = /* @__PURE__ */ __exportAll({
6196
6185
  ZodAny: () => ZodAny,
6197
6186
  ZodArray: () => ZodArray,
@@ -6249,7 +6238,6 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
6249
6238
  ZodPrefault: () => ZodPrefault,
6250
6239
  ZodPreprocess: () => ZodPreprocess,
6251
6240
  ZodPromise: () => ZodPromise,
6252
- ZodProperties: () => ZodProperties,
6253
6241
  ZodReadonly: () => ZodReadonly,
6254
6242
  ZodRecord: () => ZodRecord,
6255
6243
  ZodSet: () => ZodSet,
@@ -6287,6 +6275,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
6287
6275
  creditCard: () => creditCard,
6288
6276
  cuid: () => cuid,
6289
6277
  cuid2: () => cuid2,
6278
+ currencyCode: () => currencyCode,
6290
6279
  custom: () => custom,
6291
6280
  date: () => date$1,
6292
6281
  describe: () => describe,
@@ -6341,7 +6330,6 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
6341
6330
  prefault: () => prefault,
6342
6331
  preprocess: () => preprocess,
6343
6332
  promise: () => promise,
6344
- properties: () => properties,
6345
6333
  readonly: () => readonly,
6346
6334
  record: () => record$1,
6347
6335
  refine: () => refine$1,
@@ -6903,6 +6891,9 @@ function hostname(_params) {
6903
6891
  function hex(_params) {
6904
6892
  return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, "hex", hex$1, _params);
6905
6893
  }
6894
+ function currencyCode(_params) {
6895
+ return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode$1, _params);
6896
+ }
6906
6897
  function hash(alg, params) {
6907
6898
  const format = `${alg}_${params?.enc ?? "hex"}`;
6908
6899
  const regex = regexes_exports[format];
@@ -7740,14 +7731,6 @@ const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
7740
7731
  ZodType.init(inst, def);
7741
7732
  inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
7742
7733
  });
7743
- const ZodProperties = /*@__PURE__*/ $constructor("ZodProperties", (inst, def) => {
7744
- _ensureDefaultMemoizer();
7745
- $ZodProperties.init(inst, def);
7746
- ZodType.init(inst, def);
7747
- });
7748
- function properties(shape, params) {
7749
- return /* @__PURE__ */ _properties(ZodProperties, shape, params);
7750
- }
7751
7734
  function check(fn) {
7752
7735
  const ch = new $ZodCheck({ check: "custom" });
7753
7736
  ch._zod.check = fn;
@@ -7767,7 +7750,7 @@ const meta = meta$1;
7767
7750
  const ZodInstanceOf = /*@__PURE__*/ $constructor("ZodInstanceOf", (inst, def) => {
7768
7751
  ZodCustom.init(inst, def);
7769
7752
  }, { properties(shape, params) {
7770
- return this.check(properties(shape, params));
7753
+ return this.check(/* @__PURE__ */ _properties(shape, params));
7771
7754
  } });
7772
7755
  function _instanceof(cls, params = {}) {
7773
7756
  const inst = new ZodInstanceOf({
@@ -7815,7 +7798,7 @@ function preprocess(fn, schema) {
7815
7798
  });
7816
7799
  }
7817
7800
  //#endregion
7818
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/compat.js
7801
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/compat.js
7819
7802
  /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
7820
7803
  var ZodFirstPartyTypeKind;
7821
7804
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
@@ -7824,10 +7807,14 @@ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
7824
7807
  ...checks_exports
7825
7808
  });
7826
7809
  //#endregion
7827
- //#region ../../node_modules/.pnpm/@ariestools+provider-model@1.3.0_zod@4.6.1/node_modules/@ariestools/provider-model/dist/neutral/index.mjs
7810
+ //#region ../../node_modules/.pnpm/@ariestools+provider-model@2.0.0_zod@4.6.5/node_modules/@ariestools/provider-model/dist/neutral/index.mjs
7828
7811
  var ConnectionConfigZod = looseObject({ type: string$1().min(1) });
7829
7812
  var ConnectionsConfigZod = record$1(string$1(), ConnectionConfigZod).default({});
7830
- strictObject({ dependencies: array$1(string$1().min(1)).default([]) });
7813
+ var ProviderMonikerZod = string$1().min(1);
7814
+ strictObject({
7815
+ dependencies: array$1(ProviderMonikerZod).default([]),
7816
+ optionalDependencies: array$1(ProviderMonikerZod).optional()
7817
+ });
7831
7818
  var ProviderBindingConfigZod = strictObject({
7832
7819
  connection: string$1().min(1).optional(),
7833
7820
  options: record$1(string$1(), unknown()).optional(),
@@ -7838,7 +7825,7 @@ var ProviderConfigFieldsZod = object({
7838
7825
  providerBindings: record$1(string$1(), ProviderBindingConfigZod).default({})
7839
7826
  });
7840
7827
  //#endregion
7841
- //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/mini/schemas.js
7828
+ //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/mini/schemas.js
7842
7829
  const ZodMiniType = /*@__PURE__*/ $constructor("ZodMiniType", (inst, def) => {
7843
7830
  if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
7844
7831
  $ZodType.init(inst, def);
@@ -9434,19 +9421,19 @@ const API_NAME = "trace";
9434
9421
  }
9435
9422
  }).getInstance();
9436
9423
  //#endregion
9437
- //#region ../../node_modules/.pnpm/@ariestools+telemetry@8.3.0_@opentelemetry+api@1.9.1/node_modules/@ariestools/telemetry/dist/neutral/index.mjs
9438
- var color$1 = (open, close = 39) => {
9424
+ //#region ../../node_modules/.pnpm/@ariestools+telemetry@9.0.1_@opentelemetry+api@1.9.1/node_modules/@ariestools/telemetry/dist/neutral/index.mjs
9425
+ var color = (open, close = 39) => {
9439
9426
  return (value) => `\x1B[${open}m${value}\x1B[${close}m`;
9440
9427
  };
9441
- var logColors$1 = {
9442
- green: color$1(32),
9443
- grey: color$1(90),
9444
- magenta: color$1(35),
9445
- red: color$1(31),
9446
- white: color$1(37),
9447
- yellow: color$1(33)
9428
+ var logColors = {
9429
+ green: color(32),
9430
+ grey: color(90),
9431
+ magenta: color(35),
9432
+ red: color(31),
9433
+ white: color(37),
9434
+ yellow: color(33)
9448
9435
  };
9449
- function spanDurationInMillis$1(span2) {
9436
+ function spanDurationInMillis(span2) {
9450
9437
  return span2.duration[0] * 1e3 + span2.duration[1] / 1e6;
9451
9438
  }
9452
9439
  (class _XyConsoleSpanExporterImplementation {
@@ -9460,11 +9447,11 @@ function spanDurationInMillis$1(span2) {
9460
9447
  ];
9461
9448
  /** Chalk color functions corresponding to each log level. */
9462
9449
  static logLevelToChalkColor = [
9463
- logColors$1.grey,
9464
- logColors$1.white,
9465
- logColors$1.green,
9466
- logColors$1.yellow,
9467
- logColors$1.red
9450
+ logColors.grey,
9451
+ logColors.white,
9452
+ logColors.green,
9453
+ logColors.yellow,
9454
+ logColors.red
9468
9455
  ];
9469
9456
  logger;
9470
9457
  _logLevel;
@@ -9480,8 +9467,8 @@ function spanDurationInMillis$1(span2) {
9480
9467
  for (const span2 of spans) {
9481
9468
  const spanLevel = this.spanLevel(span2);
9482
9469
  if (spanLevel < this.logLevel) continue;
9483
- const duration = spanDurationInMillis$1(span2);
9484
- this.logger.log(logColors$1.grey([
9470
+ const duration = spanDurationInMillis(span2);
9471
+ this.logger.log(logColors.grey([
9485
9472
  `Span [${span2.name}]`,
9486
9473
  this.logColor(spanLevel)(`${duration}ms`),
9487
9474
  `TraceId: ${span2.spanContext().traceId}`
@@ -9498,7 +9485,7 @@ function spanDurationInMillis$1(span2) {
9498
9485
  * @returns A chalk color function.
9499
9486
  */
9500
9487
  logColor(level) {
9501
- return _XyConsoleSpanExporterImplementation.logLevelToChalkColor[level] ?? logColors$1.magenta;
9488
+ return _XyConsoleSpanExporterImplementation.logLevelToChalkColor[level] ?? logColors.magenta;
9502
9489
  }
9503
9490
  shutdown() {
9504
9491
  return Promise.resolve();
@@ -9510,7 +9497,7 @@ function spanDurationInMillis$1(span2) {
9510
9497
  */
9511
9498
  spanLevel(span2) {
9512
9499
  let logLevel = 0;
9513
- const duration = spanDurationInMillis$1(span2);
9500
+ const duration = spanDurationInMillis(span2);
9514
9501
  for (let x = _XyConsoleSpanExporterImplementation.durationToLogLevel.length - 1; x >= 0; x--) if (duration > _XyConsoleSpanExporterImplementation.durationToLogLevel[x]) {
9515
9502
  logLevel = x;
9516
9503
  break;
@@ -9519,7 +9506,7 @@ function spanDurationInMillis$1(span2) {
9519
9506
  }
9520
9507
  });
9521
9508
  //#endregion
9522
- //#region ../../node_modules/.pnpm/@ariestools+sdk@8.3.0_@opentelemetry+api@1.9.1_zod@4.6.1/node_modules/@ariestools/sdk/dist/node/index.mjs
9509
+ //#region ../../node_modules/.pnpm/@ariestools+sdk@9.0.1_@opentelemetry+api@1.9.1_zod@4.6.5/node_modules/@ariestools/sdk/dist/node/index.mjs
9523
9510
  var __defProp$1 = Object.defineProperty;
9524
9511
  var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
9525
9512
  var __decorateClass$1 = (decorators, target, key, kind) => {
@@ -9682,8 +9669,15 @@ function abortError(signal) {
9682
9669
  cause: reason
9683
9670
  });
9684
9671
  }
9685
- function readChunk(reader, signal) {
9686
- if (signal == null) return reader.read();
9672
+ function responseTooLargeError(response) {
9673
+ return new FetchError("Response body exceeds maxResponseBytes", {
9674
+ type: "response-too-large",
9675
+ status: response.status,
9676
+ statusText: response.statusText
9677
+ });
9678
+ }
9679
+ function unlessAborted(start, signal) {
9680
+ if (signal == null) return start();
9687
9681
  return new Promise((resolve, reject) => {
9688
9682
  let settled = false;
9689
9683
  const finish = (outcome) => {
@@ -9700,7 +9694,7 @@ function readChunk(reader, signal) {
9700
9694
  return;
9701
9695
  }
9702
9696
  try {
9703
- reader.read().then((value) => signal.aborted ? onAbort() : finish({ value })).catch((error) => finish({ error }));
9697
+ start().then((value) => signal.aborted ? onAbort() : finish({ value })).catch((error) => finish({ error }));
9704
9698
  } catch (error) {
9705
9699
  finish({ error });
9706
9700
  }
@@ -9719,7 +9713,7 @@ async function readStreamText(reader, maxResponseBytes, signal, response) {
9719
9713
  let failure;
9720
9714
  try {
9721
9715
  while (true) {
9722
- const result = await readChunk(reader, signal);
9716
+ const result = await unlessAborted(() => reader.read(), signal);
9723
9717
  if (signal?.aborted === true) throw abortError(signal);
9724
9718
  if (result.done) {
9725
9719
  parts.push(decoder.decode());
@@ -9729,11 +9723,7 @@ async function readStreamText(reader, maxResponseBytes, signal, response) {
9729
9723
  const chunk = result.value;
9730
9724
  if (!ArrayBuffer.isView(chunk) || Object.prototype.toString.call(chunk) !== "[object Uint8Array]") throw new TypeError("Response body chunks must be Uint8Array values");
9731
9725
  if (maxResponseBytes !== void 0) {
9732
- if (chunk.byteLength > maxResponseBytes - bytes) throw new FetchError("Response body exceeds maxResponseBytes", {
9733
- type: "response-too-large",
9734
- status: response.status,
9735
- statusText: response.statusText
9736
- });
9726
+ if (chunk.byteLength > maxResponseBytes - bytes) throw responseTooLargeError(response);
9737
9727
  bytes += chunk.byteLength;
9738
9728
  }
9739
9729
  const text = decoder.decode(chunk, { stream: true });
@@ -9747,6 +9737,17 @@ async function readStreamText(reader, maxResponseBytes, signal, response) {
9747
9737
  reader.releaseLock();
9748
9738
  }
9749
9739
  }
9740
+ function isReadableStream(body) {
9741
+ return typeof body === "object" && body !== null && "getReader" in body && typeof body.getReader === "function";
9742
+ }
9743
+ async function readBufferedText(response, maxResponseBytes, signal) {
9744
+ const text = await unlessAborted(() => response.text(), signal);
9745
+ if (signal?.aborted === true) throw abortError(signal);
9746
+ if (maxResponseBytes !== void 0) {
9747
+ if (new TextEncoder().encode(text).byteLength > maxResponseBytes) throw responseTooLargeError(response);
9748
+ }
9749
+ return text;
9750
+ }
9750
9751
  async function readResponseText(response, options = {}) {
9751
9752
  const { maxResponseBytes, signal } = options;
9752
9753
  validateMaxResponseBytes(maxResponseBytes);
@@ -9757,7 +9758,8 @@ async function readResponseText(response, options = {}) {
9757
9758
  if (signal?.aborted === true) throw abortError(signal);
9758
9759
  return "";
9759
9760
  }
9760
- return await readStreamText(body.getReader(), maxResponseBytes, signal, response);
9761
+ if (isReadableStream(body)) return await readStreamText(body.getReader(), maxResponseBytes, signal, response);
9762
+ return await readBufferedText(response, maxResponseBytes, signal);
9761
9763
  }
9762
9764
  function contextualizeReadError(error, context, options) {
9763
9765
  const failure = toFetchError(error, context);
@@ -11072,8 +11074,6 @@ var AbstractCreatableWithFactory = class extends AbstractCreatable {
11072
11074
  }
11073
11075
  };
11074
11076
  AbstractCreatableWithFactory = __decorateClass$1([creatable()], AbstractCreatableWithFactory);
11075
- Math.PI / 180;
11076
- 180 / Math.PI;
11077
11077
  var AsTypeFactory = {
11078
11078
  create: (typeCheck) => {
11079
11079
  const func = (value, assertOrConfig, config) => {
@@ -11116,92 +11116,7 @@ var JsonValueZod = /* @__PURE__ */ _lazy(() => /* @__PURE__ */ union([
11116
11116
  ]));
11117
11117
  globalThis.crypto?.subtle;
11118
11118
  //#endregion
11119
- //#region ../../node_modules/.pnpm/@ariestools+telemetry@8.1.9_@opentelemetry+api@1.9.1/node_modules/@ariestools/telemetry/dist/neutral/index.mjs
11120
- var color = (open, close = 39) => {
11121
- return (value) => `\x1B[${open}m${value}\x1B[${close}m`;
11122
- };
11123
- var logColors = {
11124
- green: color(32),
11125
- grey: color(90),
11126
- magenta: color(35),
11127
- red: color(31),
11128
- white: color(37),
11129
- yellow: color(33)
11130
- };
11131
- function spanDurationInMillis(span2) {
11132
- return span2.duration[0] * 1e3 + span2.duration[1] / 1e6;
11133
- }
11134
- (class _XyConsoleSpanExporterImplementation {
11135
- /** Duration thresholds (in ms) that map to increasing log levels. */
11136
- static durationToLogLevel = [
11137
- 0,
11138
- 1,
11139
- 10,
11140
- 100,
11141
- 1e3
11142
- ];
11143
- /** Chalk color functions corresponding to each log level. */
11144
- static logLevelToChalkColor = [
11145
- logColors.grey,
11146
- logColors.white,
11147
- logColors.green,
11148
- logColors.yellow,
11149
- logColors.red
11150
- ];
11151
- logger;
11152
- _logLevel;
11153
- constructor(logLevel = 0, logger = console) {
11154
- this._logLevel = logLevel;
11155
- this.logger = logger;
11156
- }
11157
- /** The minimum log level required for a span to be exported. */
11158
- get logLevel() {
11159
- return this._logLevel;
11160
- }
11161
- export(spans, resultCallback) {
11162
- for (const span2 of spans) {
11163
- const spanLevel = this.spanLevel(span2);
11164
- if (spanLevel < this.logLevel) continue;
11165
- const duration = spanDurationInMillis(span2);
11166
- this.logger.log(logColors.grey([
11167
- `Span [${span2.name}]`,
11168
- this.logColor(spanLevel)(`${duration}ms`),
11169
- `TraceId: ${span2.spanContext().traceId}`
11170
- ].join(", ")));
11171
- }
11172
- resultCallback?.({ code: 0 });
11173
- }
11174
- forceFlush() {
11175
- return Promise.resolve();
11176
- }
11177
- /**
11178
- * Returns the chalk color function for the given log level.
11179
- * @param level - The log level index.
11180
- * @returns A chalk color function.
11181
- */
11182
- logColor(level) {
11183
- return _XyConsoleSpanExporterImplementation.logLevelToChalkColor[level] ?? logColors.magenta;
11184
- }
11185
- shutdown() {
11186
- return Promise.resolve();
11187
- }
11188
- /**
11189
- * Determines the log level of a span based on its duration.
11190
- * @param span - The span to evaluate.
11191
- * @returns The numeric log level (index into durationToLogLevel).
11192
- */
11193
- spanLevel(span2) {
11194
- let logLevel = 0;
11195
- const duration = spanDurationInMillis(span2);
11196
- for (let x = _XyConsoleSpanExporterImplementation.durationToLogLevel.length - 1; x >= 0; x--) if (duration > _XyConsoleSpanExporterImplementation.durationToLogLevel[x]) {
11197
- logLevel = x;
11198
- break;
11199
- }
11200
- return logLevel;
11201
- }
11202
- });
11203
- //#endregion
11204
- //#region ../../node_modules/.pnpm/@ariestools+actor@1.3.0_@ariestools+sdk@8.3.0_@opentelemetry+api@1.9.1_zod@4.6.1__@opentelemetry+api@1.9.1_zod@4.6.1/node_modules/@ariestools/actor/dist/neutral/index.mjs
11119
+ //#region ../../node_modules/.pnpm/@ariestools+actor@2.0.0_@ariestools+sdk@9.0.1_@opentelemetry+api@1.9.1_zod@4.6.5__@opentelemetry+api@1.9.1_zod@4.6.5/node_modules/@ariestools/actor/dist/neutral/index.mjs
11205
11120
  var __defProp = Object.defineProperty;
11206
11121
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11207
11122
  var __decorateClass = (decorators, target, key, kind) => {
@@ -11210,6 +11125,25 @@ var __decorateClass = (decorators, target, key, kind) => {
11210
11125
  if (kind && result) __defProp(target, key, result);
11211
11126
  return result;
11212
11127
  };
11128
+ async function traceActorLifecycle(observers, stage, actor, work) {
11129
+ const completions = [];
11130
+ for (const observer of observers) try {
11131
+ completions.push(observer(stage, actor));
11132
+ } catch {}
11133
+ const finish = (outcome) => {
11134
+ for (const complete of completions) try {
11135
+ Promise.resolve(complete(outcome)).catch(() => {});
11136
+ } catch {}
11137
+ };
11138
+ try {
11139
+ const result = await work();
11140
+ finish(result === false ? "failed" : "completed");
11141
+ return result;
11142
+ } catch (error) {
11143
+ finish("failed");
11144
+ throw error;
11145
+ }
11146
+ }
11213
11147
  function isSupervisedActor(actor) {
11214
11148
  const candidate = actor;
11215
11149
  return typeof candidate.runReadyHandler === "function" && typeof candidate.whenReady === "function" && "readyState" in actor;
@@ -11221,6 +11155,7 @@ var Orchestrator = class extends AbstractCreatable {
11221
11155
  attemptedActors = /* @__PURE__ */ new Set();
11222
11156
  inFlightStarts = /* @__PURE__ */ new Map();
11223
11157
  isTerminalShutdown = false;
11158
+ lifecycleObservers = /* @__PURE__ */ new Set();
11224
11159
  shutdownPromise;
11225
11160
  get readyState() {
11226
11161
  if (this.actors.length === 0) return "pending";
@@ -11234,6 +11169,13 @@ var Orchestrator = class extends AbstractCreatable {
11234
11169
  isShuttingDown() {
11235
11170
  return this.shuttingDown;
11236
11171
  }
11172
+ /** Observe actual lifecycle operations without changing supervision policy. */
11173
+ observeLifecycle(observer) {
11174
+ this.lifecycleObservers.add(observer);
11175
+ return () => {
11176
+ this.lifecycleObservers.delete(observer);
11177
+ };
11178
+ }
11237
11179
  /**
11238
11180
  * Registers an actor.
11239
11181
  * (We won't activate the actor until `start()` is called.)
@@ -11265,7 +11207,7 @@ var Orchestrator = class extends AbstractCreatable {
11265
11207
  }
11266
11208
  if (isSupervisedActor(actor)) (async () => {
11267
11209
  try {
11268
- await actor.runReadyHandler();
11210
+ await traceActorLifecycle(this.lifecycleObservers.values().toArray(), "ready", actor, async () => await actor.runReadyHandler());
11269
11211
  } catch (err) {
11270
11212
  this.logError(`[Orchestrator] Actor [${actor.name}] readyHandler failed: ${formatError(err)}`);
11271
11213
  }
@@ -11326,7 +11268,7 @@ var Orchestrator = class extends AbstractCreatable {
11326
11268
  }
11327
11269
  for (const actor of this.actors) if (isSupervisedActor(actor)) (async () => {
11328
11270
  try {
11329
- await actor.runReadyHandler();
11271
+ await traceActorLifecycle(this.lifecycleObservers.values().toArray(), "ready", actor, async () => await actor.runReadyHandler());
11330
11272
  } catch (err) {
11331
11273
  this.logError(`[Orchestrator] Actor [${actor.name}] readyHandler failed: ${formatError(err)}`);
11332
11274
  }
@@ -11406,7 +11348,7 @@ var Orchestrator = class extends AbstractCreatable {
11406
11348
  startActor(actor) {
11407
11349
  const existing = this.inFlightStarts.get(actor);
11408
11350
  if (existing !== void 0) return existing;
11409
- const trackedStart = Promise.resolve().then(async () => await actor.start()).finally(() => {
11351
+ const trackedStart = Promise.resolve().then(async () => await traceActorLifecycle(this.lifecycleObservers.values().toArray(), "start", actor, async () => await actor.start())).finally(() => {
11410
11352
  if (this.inFlightStarts.get(actor) === trackedStart) this.inFlightStarts.delete(actor);
11411
11353
  });
11412
11354
  this.inFlightStarts.set(actor, trackedStart);
@@ -11430,7 +11372,7 @@ var Orchestrator = class extends AbstractCreatable {
11430
11372
  }
11431
11373
  }
11432
11374
  async stopAttemptedActors(actors = [...this.attemptedActors]) {
11433
- const results = await Promise.allSettled(actors.map((actor) => this.stopActor(actor)));
11375
+ const results = await Promise.allSettled(actors.map(async (actor) => await traceActorLifecycle(this.lifecycleObservers.values().toArray(), "stop", actor, async () => await this.stopActor(actor))));
11434
11376
  const errors = [];
11435
11377
  for (const [index, result] of results.entries()) {
11436
11378
  const actor = actors[index];
@@ -11454,8 +11396,8 @@ ${err.stack}` : "";
11454
11396
  return String(err);
11455
11397
  }
11456
11398
  //#endregion
11457
- //#region ../../node_modules/.pnpm/@ariestools+actor-system@1.3.0_@ariestools+sdk@8.3.0_@opentelemetry+api@1.9.1_zod@4.6.1_e4d63a6db742046cbc8d622a2f828386/node_modules/@ariestools/actor-system/dist/neutral/index.mjs
11458
- var ActorSystemSelectionZod = strictObject({
11399
+ //#region ../../node_modules/.pnpm/@ariestools+actor-engine@2.0.0_@ariestools+sdk@9.0.1_@opentelemetry+api@1.9.1_zod@4.6.5_2b61bbfd264e3c480d92886f2c92cd0f/node_modules/@ariestools/actor-engine/dist/neutral/index.mjs
11400
+ var ActorEngineSelectionZod = strictObject({
11459
11401
  config: unknown().optional(),
11460
11402
  host: string$1().min(1).optional(),
11461
11403
  id: string$1().min(1).optional(),
@@ -11473,9 +11415,9 @@ var ActorSystemSelectionZod = strictObject({
11473
11415
  path: ["name"]
11474
11416
  });
11475
11417
  });
11476
- ProviderConfigFieldsZod.extend({ actors: array$1(ActorSystemSelectionZod).default([]) });
11418
+ ProviderConfigFieldsZod.extend({ actors: array$1(ActorEngineSelectionZod).default([]) });
11477
11419
  //#endregion
11478
- //#region ../../node_modules/.pnpm/@ariestools+cli-kit@1.2.3_@ariestools+actor-model@1.3.0_@ariestools+sdk@8.3.0_@opentele_12686f89e232b4319a2511392ce53195/node_modules/@ariestools/cli-kit/dist/node/index.mjs
11420
+ //#region ../../node_modules/.pnpm/@ariestools+cli-kit@2.0.1_@ariestools+actor-model@2.0.0_@ariestools+sdk@9.0.1_@opentele_c5aa5735122b0635be68b42196f05dd1/node_modules/@ariestools/cli-kit/dist/node/index.mjs
11479
11421
  async function runServiceUntilInterrupt(host, stop) {
11480
11422
  await new Promise((resolve, reject) => {
11481
11423
  const dispose = host.onInterrupt(async () => {
@@ -11490,7 +11432,7 @@ async function runServiceUntilInterrupt(host, stop) {
11490
11432
  });
11491
11433
  }
11492
11434
  //#endregion
11493
- //#region ../../node_modules/.pnpm/@ariestools+cli-kit-node@1.2.3_@ariestools+actor-model@1.3.0_@ariestools+sdk@8.3.0_@ope_7b18c786a1c8bb7b1298534a22a75fd9/node_modules/@ariestools/cli-kit-node/dist/node/index.mjs
11435
+ //#region ../../node_modules/.pnpm/@ariestools+cli-kit-node@2.0.1_@ariestools+actor-model@2.0.0_@ariestools+sdk@9.0.1_@ope_5b74c0d688aa74d26c2f7d16c9a53eac/node_modules/@ariestools/cli-kit-node/dist/node/index.mjs
11494
11436
  function resolveEnvironmentValue(key, layers) {
11495
11437
  for (const layer of layers) {
11496
11438
  if (!Object.hasOwn(layer, key)) continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariestools/aries-chain-serve",
3
- "version": "0.1.21",
3
+ "version": "0.2.0",
4
4
  "description": "Aries chain REST server: serves the XL1 published-chain S3 layout from one origin with /blocks, /state, /indexes subfolders",
5
5
  "keywords": [
6
6
  "ariestools",
@@ -38,23 +38,22 @@
38
38
  "s3rver": "~3.7.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@ariestools/actor-model": "~1.3.0",
42
- "@ariestools/actor-system": "~1.3.0",
43
- "@ariestools/cli-kit": "~1.2.3",
44
- "@ariestools/cli-kit-node": "~1.2.3",
45
- "@ariestools/toolchain": "~10.0.6",
46
- "@ariestools/tsconfig": "~10.0.6",
47
- "@aws-sdk/client-s3": "~3.1129.0",
48
- "@types/node": "~26.5.1",
41
+ "@ariestools/actor-model": "~2.0.0",
42
+ "@ariestools/actor-system": "~2.0.0",
43
+ "@ariestools/cli-kit": "~2.0.1",
44
+ "@ariestools/cli-kit-node": "~2.0.1",
45
+ "@ariestools/toolchain": "~10.0.8",
46
+ "@ariestools/tsconfig": "~10.0.8",
47
+ "@aws-sdk/client-s3": "~3.1144.0",
48
+ "@types/node": "~26.6.3",
49
49
  "@types/s3rver": "~3.7.4",
50
- "rolldown": "~1.2.8",
50
+ "rolldown": "~1.2.12",
51
51
  "typescript": "~6.0.3",
52
- "vite": "~8.3.0",
53
- "vitest": "~5.0.0",
54
- "zod": "~4.6.1"
52
+ "vite": "~8.3.1",
53
+ "vitest": "~5.0.3"
55
54
  },
56
55
  "engines": {
57
- "node": ">=18.17.1"
56
+ "node": ">=26"
58
57
  },
59
58
  "engineStrict": true,
60
59
  "publishConfig": {