gogcli-mcp-contacts 3.0.0 → 4.0.1

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.js CHANGED
@@ -132,7 +132,6 @@ __export(external_exports, {
132
132
  ZodPrefault: () => ZodPrefault,
133
133
  ZodPreprocess: () => ZodPreprocess,
134
134
  ZodPromise: () => ZodPromise,
135
- ZodProperties: () => ZodProperties,
136
135
  ZodReadonly: () => ZodReadonly,
137
136
  ZodRealError: () => ZodRealError,
138
137
  ZodRecord: () => ZodRecord,
@@ -176,6 +175,7 @@ __export(external_exports, {
176
175
  creditCard: () => creditCard2,
177
176
  cuid: () => cuid3,
178
177
  cuid2: () => cuid22,
178
+ currencyCode: () => currencyCode2,
179
179
  custom: () => custom,
180
180
  date: () => date2,
181
181
  decode: () => decode2,
@@ -269,7 +269,7 @@ __export(external_exports, {
269
269
  preprocess: () => preprocess,
270
270
  prettifyError: () => prettifyError,
271
271
  promise: () => promise,
272
- properties: () => properties,
272
+ properties: () => _properties,
273
273
  property: () => _property,
274
274
  readonly: () => readonly,
275
275
  record: () => record,
@@ -357,6 +357,7 @@ __export(core_exports2, {
357
357
  $ZodCheckMultipleOf: () => $ZodCheckMultipleOf,
358
358
  $ZodCheckNumberFormat: () => $ZodCheckNumberFormat,
359
359
  $ZodCheckOverwrite: () => $ZodCheckOverwrite,
360
+ $ZodCheckProperties: () => $ZodCheckProperties,
360
361
  $ZodCheckProperty: () => $ZodCheckProperty,
361
362
  $ZodCheckRegex: () => $ZodCheckRegex,
362
363
  $ZodCheckSizeEquals: () => $ZodCheckSizeEquals,
@@ -410,7 +411,6 @@ __export(core_exports2, {
410
411
  $ZodPrefault: () => $ZodPrefault,
411
412
  $ZodPreprocess: () => $ZodPreprocess,
412
413
  $ZodPromise: () => $ZodPromise,
413
- $ZodProperties: () => $ZodProperties,
414
414
  $ZodReadonly: () => $ZodReadonly,
415
415
  $ZodRealError: () => $ZodRealError,
416
416
  $ZodRecord: () => $ZodRecord,
@@ -578,6 +578,7 @@ __export(core_exports2, {
578
578
  _xor: () => _xor,
579
579
  base64Charset: () => base64Charset,
580
580
  base64urlCharset: () => base64urlCharset,
581
+ canParseURL: () => canParseURL,
581
582
  clone: () => clone,
582
583
  compile: () => compile,
583
584
  compileFn: () => compileFn,
@@ -600,7 +601,6 @@ __export(core_exports2, {
600
601
  initializeContext: () => initializeContext,
601
602
  isBackEdge: () => isBackEdge,
602
603
  isRecursiveSchema: () => isRecursiveSchema,
603
- isTransforming: () => isTransforming,
604
604
  isValidBase64: () => isValidBase64,
605
605
  isValidBase64URL: () => isValidBase64URL,
606
606
  isValidCIDRv6: () => isValidCIDRv6,
@@ -637,6 +637,7 @@ __export(core_exports2, {
637
637
  util: () => util_exports,
638
638
  validate: () => validate,
639
639
  validateAsync: () => validateAsync,
640
+ validateURL: () => validateURL,
640
641
  version: () => version,
641
642
  withParser: () => withParser
642
643
  });
@@ -1378,9 +1379,6 @@ function members(proto, table) {
1378
1379
  else
1379
1380
  defineBound(proto, key, desc.value);
1380
1381
  }
1381
- for (const sym of Object.getOwnPropertySymbols(table)) {
1382
- defineBound(proto, sym, table[sym]);
1383
- }
1384
1382
  }
1385
1383
  function own(inst, key, value, enumerable = true) {
1386
1384
  Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
@@ -1533,8 +1531,7 @@ function $constructor(name, initializer3, proto, params) {
1533
1531
  } finally {
1534
1532
  _zodDesc.value = void 0;
1535
1533
  }
1536
- }
1537
- if (inst._zod.traits.has(name)) {
1534
+ } else if (inst._zod.traits.has(name)) {
1538
1535
  return;
1539
1536
  }
1540
1537
  inst._zod.traits.add(name);
@@ -1976,6 +1973,7 @@ __export(regexes_exports, {
1976
1973
  creditCard: () => creditCard,
1977
1974
  cuid: () => cuid,
1978
1975
  cuid2: () => cuid2,
1976
+ currencyCode: () => currencyCode,
1979
1977
  date: () => date,
1980
1978
  datetime: () => datetime,
1981
1979
  domain: () => domain,
@@ -2074,6 +2072,7 @@ var domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a
2074
2072
  var httpProtocol = /^https?$/;
2075
2073
  var e164 = /^\+[1-9]\d{6,14}$/;
2076
2074
  var creditCard = /^\d(?:[ -]?\d){11,18}$/;
2075
+ var currencyCode = /^(?: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)$/;
2077
2076
  var iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
2078
2077
  var 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])))`;
2079
2078
  function anchor(source) {
@@ -2558,6 +2557,34 @@ var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst,
2558
2557
  return;
2559
2558
  };
2560
2559
  });
2560
+ var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (inst, def) => {
2561
+ $ZodCheck.init(inst, def);
2562
+ hide(inst, Symbol.iterator, function* () {
2563
+ yield inst;
2564
+ });
2565
+ let entries;
2566
+ inst._zod.check = (payload) => {
2567
+ if (payload.value == null) {
2568
+ payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
2569
+ return void 0;
2570
+ }
2571
+ entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
2572
+ const input2 = payload.value;
2573
+ let proms;
2574
+ for (const [key, schema] of entries) {
2575
+ const result = schema._zod.run({ value: input2[key], issues: [] }, {});
2576
+ if (result instanceof Promise) {
2577
+ proms ?? (proms = []);
2578
+ proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key)));
2579
+ } else {
2580
+ handleCheckPropertyResult(result, payload, key);
2581
+ }
2582
+ }
2583
+ if (proms)
2584
+ return Promise.all(proms).then(() => void 0);
2585
+ return void 0;
2586
+ };
2587
+ });
2561
2588
  var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
2562
2589
  $ZodCheck.init(inst, def);
2563
2590
  const mimeSet = new Set(def.mime);
@@ -2625,7 +2652,7 @@ ${content.join("\n")}
2625
2652
  var version = {
2626
2653
  major: 4,
2627
2654
  minor: 6,
2628
- patch: 1
2655
+ patch: 5
2629
2656
  };
2630
2657
 
2631
2658
  // ../../node_modules/zod/v4/core/schemas.js
@@ -2813,11 +2840,32 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
2813
2840
  });
2814
2841
  var URL_BAD_FORMAT = 1;
2815
2842
  var URL_UNPARSEABLE = 2;
2843
+ function canParseURL(input2) {
2844
+ try {
2845
+ if (typeof URL !== "undefined" && typeof URL.canParse === "function")
2846
+ return URL.canParse(input2);
2847
+ new URL(input2);
2848
+ return true;
2849
+ } catch {
2850
+ return false;
2851
+ }
2852
+ }
2853
+ function validateURL(trimmed, def) {
2854
+ if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
2855
+ return canParseURL(trimmed) || URL_UNPARSEABLE;
2856
+ }
2857
+ return parseURLObject(trimmed, def);
2858
+ }
2816
2859
  function parseURLObject(trimmed, def) {
2817
2860
  if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
2818
2861
  return URL_BAD_FORMAT;
2819
2862
  }
2820
2863
  try {
2864
+ if (typeof URL !== "undefined") {
2865
+ const URLStatic = URL;
2866
+ if (typeof URLStatic.parse === "function")
2867
+ return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
2868
+ }
2821
2869
  return new URL(trimmed);
2822
2870
  } catch {
2823
2871
  return URL_UNPARSEABLE;
@@ -2840,7 +2888,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
2840
2888
  inst._zod.check = (payload) => {
2841
2889
  try {
2842
2890
  const trimmed = payload.value.trim();
2843
- const url2 = parseURLObject(trimmed, def);
2891
+ const url2 = validateURL(trimmed, def);
2844
2892
  if (url2 === URL_BAD_FORMAT) {
2845
2893
  payload.issues.push({
2846
2894
  code: "invalid_format",
@@ -2862,6 +2910,10 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
2862
2910
  });
2863
2911
  return;
2864
2912
  }
2913
+ if (url2 === true) {
2914
+ payload.value = stripTabAndNewline(trimmed);
2915
+ return;
2916
+ }
2865
2917
  if (def.hostname && !urlHostnameOk(url2, def.hostname)) {
2866
2918
  payload.issues.push({
2867
2919
  code: "invalid_format",
@@ -2951,12 +3003,7 @@ var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
2951
3003
  function isValidIPv6(value) {
2952
3004
  if (!ipv6Alphabet.test(value))
2953
3005
  return false;
2954
- try {
2955
- new URL(`http://[${value}]`);
2956
- return true;
2957
- } catch {
2958
- return false;
2959
- }
3006
+ return canParseURL(`http://[${value}]`);
2960
3007
  }
2961
3008
  var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
2962
3009
  def.pattern ?? (def.pattern = ipv6);
@@ -3429,7 +3476,7 @@ function handlePropertyResult(result, final, key, input2, optin, optout) {
3429
3476
  return;
3430
3477
  }
3431
3478
  if (result.value === void 0) {
3432
- if (isPresent) {
3479
+ if (isPresent || optin === "defaulted" && !isOptionalOut) {
3433
3480
  final.value[key] = void 0;
3434
3481
  }
3435
3482
  } else {
@@ -3665,16 +3712,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3665
3712
  doc.write(`
3666
3713
  if (${id}.issues.length) {${prefixStr(id, k)}
3667
3714
  }
3668
-
3669
- if (${id}.value === undefined) {
3670
- if (${isPresent}) {
3671
- newResult[${k}] = undefined;
3672
- }
3715
+ `);
3716
+ if (optin === "defaulted") {
3717
+ doc.write(`newResult[${k}] = ${id}.value;`);
3673
3718
  } else {
3719
+ doc.write(`
3720
+ if (${id}.value !== undefined || ${isPresent}) {
3674
3721
  newResult[${k}] = ${id}.value;
3675
3722
  }
3676
-
3677
3723
  `);
3724
+ }
3678
3725
  }
3679
3726
  }
3680
3727
  doc.write(`payload.value = newResult;`);
@@ -5021,59 +5068,6 @@ function handleRefineResult(result, payload, input2, inst) {
5021
5068
  payload.issues.push(issue(_iss));
5022
5069
  }
5023
5070
  }
5024
- function handlePropertiesResult(result, payload, key) {
5025
- if (result.issues.length) {
5026
- payload.issues.push(...prefixIssues(key, result.issues));
5027
- }
5028
- }
5029
- var $ZodProperties = /* @__PURE__ */ $constructor("$ZodProperties", (inst, def) => {
5030
- $ZodType.init(inst, def);
5031
- $ZodCheck.init(inst, def);
5032
- const memo3 = globalConfig.memoizer;
5033
- memo3?.attach(inst);
5034
- let entries;
5035
- const runShape = (payload, ctx) => {
5036
- entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
5037
- const input2 = payload.value;
5038
- let proms;
5039
- for (const [key, schema] of entries) {
5040
- const result = schema._zod.run({ value: input2[key], issues: [] }, ctx);
5041
- if (result instanceof Promise) {
5042
- proms ?? (proms = []);
5043
- proms.push(result.then((result2) => handlePropertiesResult(result2, payload, key)));
5044
- } else {
5045
- handlePropertiesResult(result, payload, key);
5046
- }
5047
- }
5048
- if (proms)
5049
- return Promise.all(proms).then(() => void 0);
5050
- return void 0;
5051
- };
5052
- inst._zod.parse = (payload, ctx) => {
5053
- const input2 = payload.value;
5054
- if (input2 === null || typeof input2 !== "object" && typeof input2 !== "function") {
5055
- payload.issues.push({ expected: "object", code: "invalid_type", input: input2, inst });
5056
- return payload;
5057
- }
5058
- if (ctx.direction === "backward")
5059
- ctx = { ...ctx, direction: "forward" };
5060
- if (memo3)
5061
- memo3.alloc(inst, payload, input2, ctx);
5062
- const result = runShape(payload, ctx);
5063
- return result instanceof Promise ? result.then(() => payload) : payload;
5064
- };
5065
- inst._zod.check = (payload) => {
5066
- if (payload.value == null) {
5067
- payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
5068
- return void 0;
5069
- }
5070
- return runShape(payload, {});
5071
- };
5072
- }, {
5073
- *[Symbol.iterator]() {
5074
- yield this;
5075
- }
5076
- });
5077
5071
 
5078
5072
  // ../../node_modules/zod/v4/core/memoizer.js
5079
5073
  var $ZodCyclicError = class extends Error {
@@ -5085,7 +5079,7 @@ var $ZodCyclicError = class extends Error {
5085
5079
  var STATE = "~memo";
5086
5080
  var NO_ISSUES = [];
5087
5081
  function isRef(value) {
5088
- return value !== null && (typeof value === "object" || typeof value === "function");
5082
+ return value !== null && typeof value === "object";
5089
5083
  }
5090
5084
  function cloneIssues(issues) {
5091
5085
  return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
@@ -5134,9 +5128,6 @@ function isRecursive(inst, stack, resolve) {
5134
5128
  check2(def.catchall);
5135
5129
  break;
5136
5130
  }
5137
- case "properties":
5138
- merge2(shape(def.shape, false));
5139
- break;
5140
5131
  case "array":
5141
5132
  check2(def.element);
5142
5133
  break;
@@ -5464,6 +5455,7 @@ var error = () => {
5464
5455
  json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",
5465
5456
  e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",
5466
5457
  credit_card: "\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",
5458
+ currency_code: "\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",
5467
5459
  iban: "IBAN",
5468
5460
  jwt: "JWT",
5469
5461
  template_literal: "\u0645\u062F\u062E\u0644"
@@ -5575,6 +5567,7 @@ var error2 = () => {
5575
5567
  json_string: "JSON string",
5576
5568
  e164: "E.164 number",
5577
5569
  credit_card: "kredit kart\u0131 n\xF6mr\u0259si",
5570
+ currency_code: "valyuta kodu",
5578
5571
  iban: "IBAN",
5579
5572
  jwt: "JWT",
5580
5573
  template_literal: "input"
@@ -5735,6 +5728,7 @@ var error3 = () => {
5735
5728
  json_string: "JSON \u0440\u0430\u0434\u043E\u043A",
5736
5729
  e164: "\u043D\u0443\u043C\u0430\u0440 E.164",
5737
5730
  credit_card: "\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",
5731
+ currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
5738
5732
  iban: "IBAN",
5739
5733
  jwt: "JWT",
5740
5734
  template_literal: "\u0443\u0432\u043E\u0434"
@@ -5853,6 +5847,7 @@ var error4 = () => {
5853
5847
  json_string: "JSON \u043D\u0438\u0437",
5854
5848
  e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
5855
5849
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",
5850
+ currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
5856
5851
  iban: "IBAN",
5857
5852
  jwt: "JWT",
5858
5853
  template_literal: "\u0432\u0445\u043E\u0434"
@@ -5978,6 +5973,7 @@ var error5 = () => {
5978
5973
  json_string: "JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",
5979
5974
  e164: "E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",
5980
5975
  credit_card: "\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",
5976
+ currency_code: "\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",
5981
5977
  iban: "IBAN",
5982
5978
  jwt: "JWT",
5983
5979
  template_literal: "\u0987\u09A8\u09AA\u09C1\u099F"
@@ -6091,6 +6087,7 @@ var error6 = () => {
6091
6087
  json_string: "cadena JSON",
6092
6088
  e164: "n\xFAmero E.164",
6093
6089
  credit_card: "n\xFAmero de targeta de cr\xE8dit",
6090
+ currency_code: "codi de moneda",
6094
6091
  iban: "IBAN",
6095
6092
  jwt: "JWT",
6096
6093
  template_literal: "entrada"
@@ -6204,6 +6201,7 @@ var error7 = () => {
6204
6201
  json_string: "\u062F\u06D5\u0642\u06CC JSON",
6205
6202
  e164: "\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",
6206
6203
  credit_card: "\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",
6204
+ currency_code: "\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",
6207
6205
  iban: "IBAN",
6208
6206
  jwt: "JWT",
6209
6207
  template_literal: "\u062A\u06CE\u06A9\u0631\u062F\u06D5"
@@ -6336,6 +6334,7 @@ var error8 = () => {
6336
6334
  json_string: "\u0159et\u011Bzec ve form\xE1tu JSON",
6337
6335
  e164: "\u010D\xEDslo E.164",
6338
6336
  credit_card: "\u010D\xEDslo kreditn\xED karty",
6337
+ currency_code: "k\xF3d m\u011Bny",
6339
6338
  iban: "IBAN",
6340
6339
  jwt: "JWT",
6341
6340
  template_literal: "vstup"
@@ -6452,6 +6451,7 @@ var error9 = () => {
6452
6451
  json_string: "JSON-streng",
6453
6452
  e164: "E.164-nummer",
6454
6453
  credit_card: "kreditkortnummer",
6454
+ currency_code: "valutakode",
6455
6455
  iban: "IBAN",
6456
6456
  jwt: "JWT",
6457
6457
  template_literal: "input"
@@ -6572,6 +6572,7 @@ var error10 = () => {
6572
6572
  json_string: "JSON-String",
6573
6573
  e164: "E.164-Nummer",
6574
6574
  credit_card: "Kreditkartennummer",
6575
+ currency_code: "W\xE4hrungscode",
6575
6576
  iban: "IBAN",
6576
6577
  jwt: "JWT",
6577
6578
  template_literal: "Eingabe"
@@ -6685,6 +6686,7 @@ var error11 = () => {
6685
6686
  json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
6686
6687
  e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
6687
6688
  credit_card: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",
6689
+ currency_code: "\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",
6688
6690
  iban: "IBAN",
6689
6691
  jwt: "JWT",
6690
6692
  template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
@@ -6796,6 +6798,7 @@ var error12 = () => {
6796
6798
  base64url: "base64url-encoded string",
6797
6799
  json_string: "JSON string",
6798
6800
  e164: "E.164 number",
6801
+ currency_code: "currency code",
6799
6802
  credit_card: "credit card number",
6800
6803
  iban: "IBAN",
6801
6804
  jwt: "JWT",
@@ -6921,6 +6924,7 @@ var error13 = () => {
6921
6924
  json_string: "JSON-karaktraro",
6922
6925
  e164: "E.164-nombro",
6923
6926
  credit_card: "kreditkarta numero",
6927
+ currency_code: "valuta kodo",
6924
6928
  iban: "IBAN",
6925
6929
  jwt: "JWT",
6926
6930
  template_literal: "enigo"
@@ -7034,6 +7038,7 @@ var error14 = () => {
7034
7038
  json_string: "cadena JSON",
7035
7039
  e164: "n\xFAmero E.164",
7036
7040
  credit_card: "n\xFAmero de tarjeta de cr\xE9dito",
7041
+ currency_code: "c\xF3digo de moneda",
7037
7042
  iban: "IBAN",
7038
7043
  jwt: "JWT",
7039
7044
  template_literal: "entrada"
@@ -7171,6 +7176,7 @@ var error15 = () => {
7171
7176
  json_string: "JSON \u0631\u0634\u062A\u0647",
7172
7177
  e164: "E.164 \u0639\u062F\u062F",
7173
7178
  credit_card: "\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",
7179
+ currency_code: "\u06A9\u062F \u0627\u0631\u0632",
7174
7180
  iban: "IBAN",
7175
7181
  jwt: "JWT",
7176
7182
  template_literal: "\u0648\u0631\u0648\u062F\u06CC"
@@ -7294,6 +7300,7 @@ var error16 = () => {
7294
7300
  json_string: "JSON-merkkijono",
7295
7301
  e164: "E.164-luku",
7296
7302
  credit_card: "luottokortin numero",
7303
+ currency_code: "valuuttakoodi",
7297
7304
  iban: "IBAN",
7298
7305
  jwt: "JWT",
7299
7306
  template_literal: "templaattimerkkijono"
@@ -7406,6 +7413,7 @@ var error17 = () => {
7406
7413
  json_string: "cha\xEEne de caract\xE8res JSON",
7407
7414
  e164: "num\xE9ro au format E.164",
7408
7415
  credit_card: "num\xE9ro de carte de cr\xE9dit",
7416
+ currency_code: "code de devise",
7409
7417
  iban: "IBAN",
7410
7418
  jwt: "JWT",
7411
7419
  template_literal: "entr\xE9e"
@@ -7536,6 +7544,7 @@ var error18 = () => {
7536
7544
  json_string: "cha\xEEne JSON",
7537
7545
  e164: "num\xE9ro E.164",
7538
7546
  credit_card: "num\xE9ro de carte de cr\xE9dit",
7547
+ currency_code: "code de devise",
7539
7548
  iban: "IBAN",
7540
7549
  jwt: "JWT",
7541
7550
  template_literal: "entr\xE9e"
@@ -7648,6 +7657,7 @@ var error19 = () => {
7648
7657
  json_string: "JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",
7649
7658
  e164: "E.164 \u0AA8\u0A82\u0AAC\u0AB0",
7650
7659
  credit_card: "\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",
7660
+ currency_code: "\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",
7651
7661
  iban: "IBAN",
7652
7662
  jwt: "JWT",
7653
7663
  template_literal: "\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"
@@ -7797,6 +7807,7 @@ var error20 = () => {
7797
7807
  json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" },
7798
7808
  e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" },
7799
7809
  credit_card: { label: "\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9", gender: "m" },
7810
+ currency_code: { label: "\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2", gender: "m" },
7800
7811
  iban: { label: "IBAN", gender: "m" },
7801
7812
  jwt: { label: "JWT", gender: "m" },
7802
7813
  template_literal: { label: "\u05E7\u05DC\u05D8", gender: "m" },
@@ -7962,6 +7973,7 @@ var error21 = () => {
7962
7973
  json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",
7963
7974
  e164: "E.164 \u0938\u0902\u0916\u094D\u092F\u093E",
7964
7975
  credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",
7976
+ currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
7965
7977
  iban: "IBAN",
7966
7978
  jwt: "JWT",
7967
7979
  template_literal: "\u0907\u0928\u092A\u0941\u091F"
@@ -8072,6 +8084,7 @@ var error22 = () => {
8072
8084
  json_string: "JSON tekst",
8073
8085
  e164: "E.164 broj",
8074
8086
  credit_card: "broj kreditne kartice",
8087
+ currency_code: "kod valute",
8075
8088
  iban: "IBAN",
8076
8089
  jwt: "JWT",
8077
8090
  template_literal: "unos"
@@ -8199,6 +8212,7 @@ var error23 = () => {
8199
8212
  json_string: "JSON string",
8200
8213
  e164: "E.164 sz\xE1m",
8201
8214
  credit_card: "hitelk\xE1rtyasz\xE1m",
8215
+ currency_code: "p\xE9nznemk\xF3d",
8202
8216
  iban: "IBAN",
8203
8217
  jwt: "JWT",
8204
8218
  template_literal: "bemenet"
@@ -8352,6 +8366,7 @@ var error24 = () => {
8352
8366
  json_string: "JSON \u057F\u0578\u0572",
8353
8367
  e164: "E.164 \u0570\u0561\u0574\u0561\u0580",
8354
8368
  credit_card: "\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",
8369
+ currency_code: "\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",
8355
8370
  iban: "IBAN",
8356
8371
  jwt: "JWT",
8357
8372
  template_literal: "\u0574\u0578\u0582\u057F\u0584"
@@ -8470,6 +8485,7 @@ var error25 = () => {
8470
8485
  json_string: "string JSON",
8471
8486
  e164: "angka E.164",
8472
8487
  credit_card: "nomor kartu kredit",
8488
+ currency_code: "kode mata uang",
8473
8489
  iban: "IBAN",
8474
8490
  jwt: "JWT",
8475
8491
  template_literal: "input"
@@ -8581,6 +8597,7 @@ var error26 = () => {
8581
8597
  json_string: "JSON strengur",
8582
8598
  e164: "E.164 t\xF6lugildi",
8583
8599
  credit_card: "kreditkortan\xFAmer",
8600
+ currency_code: "gjaldmi\xF0ilsk\xF3\xF0i",
8584
8601
  iban: "IBAN",
8585
8602
  jwt: "JWT",
8586
8603
  template_literal: "gildi"
@@ -8695,6 +8712,7 @@ var error27 = () => {
8695
8712
  json_string: "stringa JSON",
8696
8713
  e164: "numero E.164",
8697
8714
  credit_card: "numero di carta di credito",
8715
+ currency_code: "codice valuta",
8698
8716
  iban: "IBAN",
8699
8717
  jwt: "JWT",
8700
8718
  template_literal: "input"
@@ -8808,6 +8826,7 @@ var error28 = () => {
8808
8826
  json_string: "JSON\u6587\u5B57\u5217",
8809
8827
  e164: "E.164\u756A\u53F7",
8810
8828
  credit_card: "\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",
8829
+ currency_code: "\u901A\u8CA8\u30B3\u30FC\u30C9",
8811
8830
  iban: "IBAN",
8812
8831
  jwt: "JWT",
8813
8832
  template_literal: "\u5165\u529B\u5024"
@@ -8920,6 +8939,7 @@ var error29 = () => {
8920
8939
  json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
8921
8940
  e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
8922
8941
  credit_card: "\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
8942
+ currency_code: "\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",
8923
8943
  iban: "IBAN",
8924
8944
  jwt: "JWT",
8925
8945
  template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
@@ -9037,6 +9057,7 @@ var error30 = () => {
9037
9057
  json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",
9038
9058
  e164: "\u179B\u17C1\u1781 E.164",
9039
9059
  credit_card: "\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",
9060
+ currency_code: "\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",
9040
9061
  iban: "IBAN",
9041
9062
  jwt: "JWT",
9042
9063
  template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"
@@ -9157,6 +9178,7 @@ var error31 = () => {
9157
9178
  json_string: "JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",
9158
9179
  e164: "E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
9159
9180
  credit_card: "\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
9181
+ currency_code: "\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",
9160
9182
  iban: "IBAN",
9161
9183
  jwt: "JWT",
9162
9184
  template_literal: "\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"
@@ -9272,6 +9294,7 @@ var error32 = () => {
9272
9294
  json_string: "JSON \uBB38\uC790\uC5F4",
9273
9295
  e164: "E.164 \uBC88\uD638",
9274
9296
  credit_card: "\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",
9297
+ currency_code: "\uD1B5\uD654 \uCF54\uB4DC",
9275
9298
  iban: "IBAN",
9276
9299
  jwt: "JWT",
9277
9300
  template_literal: "\uC785\uB825"
@@ -9470,6 +9493,7 @@ var error33 = () => {
9470
9493
  json_string: "JSON eilut\u0117",
9471
9494
  e164: "E.164 numeris",
9472
9495
  credit_card: "kredito kortel\u0117s numeris",
9496
+ currency_code: "valiutos kodas",
9473
9497
  iban: "IBAN",
9474
9498
  jwt: "JWT",
9475
9499
  template_literal: "\u012Fvestis"
@@ -9595,6 +9619,7 @@ var error34 = () => {
9595
9619
  json_string: "JSON \u043D\u0438\u0437\u0430",
9596
9620
  e164: "E.164 \u0431\u0440\u043E\u0458",
9597
9621
  credit_card: "\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",
9622
+ currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
9598
9623
  iban: "IBAN",
9599
9624
  jwt: "JWT",
9600
9625
  template_literal: "\u0432\u043D\u0435\u0441"
@@ -9709,6 +9734,7 @@ var error35 = () => {
9709
9734
  json_string: "string JSON",
9710
9735
  e164: "nombor E.164",
9711
9736
  credit_card: "nombor kad kredit",
9737
+ currency_code: "kod mata wang",
9712
9738
  iban: "IBAN",
9713
9739
  jwt: "JWT",
9714
9740
  template_literal: "input"
@@ -9821,6 +9847,7 @@ var error36 = () => {
9821
9847
  json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",
9822
9848
  e164: "E.164 \u0928\u092E\u094D\u092C\u0930",
9823
9849
  credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",
9850
+ currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
9824
9851
  iban: "IBAN",
9825
9852
  jwt: "JWT",
9826
9853
  template_literal: "\u0907\u0928\u092A\u0941\u091F"
@@ -9932,6 +9959,7 @@ var error37 = () => {
9932
9959
  json_string: "JSON string",
9933
9960
  e164: "E.164-nummer",
9934
9961
  credit_card: "creditcardnummer",
9962
+ currency_code: "valutacode",
9935
9963
  iban: "IBAN",
9936
9964
  jwt: "JWT",
9937
9965
  template_literal: "invoer"
@@ -10047,6 +10075,7 @@ var error38 = () => {
10047
10075
  json_string: "JSON-streng",
10048
10076
  e164: "E.164-nummer",
10049
10077
  credit_card: "kredittkortnummer",
10078
+ currency_code: "valutakode",
10050
10079
  iban: "IBAN",
10051
10080
  jwt: "JWT",
10052
10081
  template_literal: "input"
@@ -10160,6 +10189,7 @@ var error39 = () => {
10160
10189
  json_string: "JSON-streng",
10161
10190
  e164: "E.164-nummer",
10162
10191
  credit_card: "kredittkortnummer",
10192
+ currency_code: "valutakode",
10163
10193
  iban: "IBAN",
10164
10194
  jwt: "JWT",
10165
10195
  template_literal: "input"
@@ -10273,6 +10303,7 @@ var error40 = () => {
10273
10303
  json_string: "JSON metin",
10274
10304
  e164: "E.164 say\u0131s\u0131",
10275
10305
  credit_card: "i'tib\xE2r kart\u0131 numaras\u0131",
10306
+ currency_code: "para birimi kodu",
10276
10307
  iban: "IBAN",
10277
10308
  jwt: "JWT",
10278
10309
  template_literal: "giren"
@@ -10387,6 +10418,7 @@ var error41 = () => {
10387
10418
  json_string: "JSON \u0645\u062A\u0646",
10388
10419
  e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",
10389
10420
  credit_card: "\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",
10421
+ currency_code: "\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",
10390
10422
  iban: "IBAN",
10391
10423
  jwt: "JWT",
10392
10424
  template_literal: "\u0648\u0631\u0648\u062F\u064A"
@@ -10506,6 +10538,7 @@ var error42 = () => {
10506
10538
  json_string: "ci\u0105g znak\xF3w w formacie JSON",
10507
10539
  e164: "liczba E.164",
10508
10540
  credit_card: "numer karty kredytowej",
10541
+ currency_code: "kod waluty",
10509
10542
  iban: "IBAN",
10510
10543
  jwt: "JWT",
10511
10544
  template_literal: "wej\u015Bcie"
@@ -10620,6 +10653,7 @@ var error43 = () => {
10620
10653
  json_string: "o texto JSON",
10621
10654
  e164: "o n\xFAmero E.164",
10622
10655
  credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
10656
+ currency_code: "o c\xF3digo de moeda",
10623
10657
  iban: "o IBAN",
10624
10658
  jwt: "o JWT",
10625
10659
  template_literal: "a entrada"
@@ -10763,6 +10797,7 @@ var error44 = () => {
10763
10797
  json_string: "o texto JSON",
10764
10798
  e164: "o n\xFAmero E.164",
10765
10799
  credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
10800
+ currency_code: "o c\xF3digo de moeda",
10766
10801
  iban: "o IBAN",
10767
10802
  jwt: "o JWT",
10768
10803
  template_literal: "a entrada"
@@ -10907,6 +10942,7 @@ var error45 = () => {
10907
10942
  json_string: "\u0219ir JSON",
10908
10943
  e164: "num\u0103r E.164",
10909
10944
  credit_card: "num\u0103r de card de credit",
10945
+ currency_code: "cod valutar",
10910
10946
  iban: "IBAN",
10911
10947
  jwt: "JWT",
10912
10948
  template_literal: "intrare"
@@ -11079,6 +11115,7 @@ var error46 = () => {
11079
11115
  json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430",
11080
11116
  e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
11081
11117
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",
11118
+ currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
11082
11119
  iban: "IBAN",
11083
11120
  jwt: "JWT",
11084
11121
  template_literal: "\u0432\u0432\u043E\u0434"
@@ -11197,6 +11234,7 @@ var error47 = () => {
11197
11234
  json_string: "re\u0165azec vo form\xE1te JSON",
11198
11235
  e164: "\u010D\xEDslo E.164",
11199
11236
  credit_card: "\u010D\xEDslo kreditnej karty",
11237
+ currency_code: "k\xF3d meny",
11200
11238
  iban: "IBAN",
11201
11239
  jwt: "JWT",
11202
11240
  template_literal: "vstup"
@@ -11313,6 +11351,7 @@ var error48 = () => {
11313
11351
  json_string: "JSON niz",
11314
11352
  e164: "E.164 \u0161tevilka",
11315
11353
  credit_card: "\u0161tevilka kreditne kartice",
11354
+ currency_code: "koda valute",
11316
11355
  iban: "IBAN",
11317
11356
  jwt: "JWT",
11318
11357
  template_literal: "vnos"
@@ -11427,6 +11466,7 @@ var error49 = () => {
11427
11466
  json_string: "JSON-str\xE4ng",
11428
11467
  e164: "E.164-nummer",
11429
11468
  credit_card: "kreditkortsnummer",
11469
+ currency_code: "valutakod",
11430
11470
  iban: "IBAN",
11431
11471
  jwt: "JWT",
11432
11472
  template_literal: "mall-literal"
@@ -11542,6 +11582,7 @@ var error50 = () => {
11542
11582
  json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD",
11543
11583
  e164: "E.164 \u0B8E\u0BA3\u0BCD",
11544
11584
  credit_card: "\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",
11585
+ currency_code: "\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",
11545
11586
  iban: "IBAN",
11546
11587
  jwt: "JWT",
11547
11588
  template_literal: "input"
@@ -11657,6 +11698,7 @@ var error51 = () => {
11657
11698
  json_string: "\u0441\u0430\u0442\u0440\u0438 JSON",
11658
11699
  e164: "\u0440\u0430\u049B\u0430\u043C\u0438 E.164",
11659
11700
  credit_card: "\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",
11701
+ currency_code: "\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",
11660
11702
  iban: "IBAN",
11661
11703
  jwt: "JWT",
11662
11704
  template_literal: "\u0432\u0443\u0440\u0443\u0434"
@@ -11773,6 +11815,7 @@ var error52 = () => {
11773
11815
  json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
11774
11816
  e164: "\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",
11775
11817
  credit_card: "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",
11818
+ currency_code: "\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",
11776
11819
  iban: "IBAN",
11777
11820
  jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",
11778
11821
  template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"
@@ -11888,6 +11931,7 @@ var error53 = () => {
11888
11931
  json_string: "JSON setiri",
11889
11932
  e164: "E.164 nomeri",
11890
11933
  credit_card: "kredit kartyny\u0148 nomeri",
11934
+ currency_code: "wal\xFDuta kody",
11891
11935
  iban: "IBAN",
11892
11936
  jwt: "JWT",
11893
11937
  template_literal: "\u015Fablon"
@@ -11995,6 +12039,7 @@ var error54 = () => {
11995
12039
  json_string: "JSON dizesi",
11996
12040
  e164: "E.164 say\u0131s\u0131",
11997
12041
  credit_card: "kredi kart\u0131 numaras\u0131",
12042
+ currency_code: "para birimi kodu",
11998
12043
  iban: "IBAN",
11999
12044
  jwt: "JWT",
12000
12045
  template_literal: "\u015Eablon dizesi"
@@ -12105,6 +12150,7 @@ var error55 = () => {
12105
12150
  json_string: "\u0440\u044F\u0434\u043E\u043A JSON",
12106
12151
  e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
12107
12152
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",
12153
+ currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",
12108
12154
  iban: "IBAN",
12109
12155
  jwt: "JWT",
12110
12156
  template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"
@@ -12223,6 +12269,7 @@ var error56 = () => {
12223
12269
  json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",
12224
12270
  e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631",
12225
12271
  credit_card: "\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",
12272
+ currency_code: "\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",
12226
12273
  iban: "IBAN",
12227
12274
  jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",
12228
12275
  template_literal: "\u0627\u0646 \u067E\u0679"
@@ -12338,6 +12385,7 @@ var error57 = () => {
12338
12385
  json_string: "JSON satr",
12339
12386
  e164: "E.164 raqam",
12340
12387
  credit_card: "kredit karta raqami",
12388
+ currency_code: "valyuta kodi",
12341
12389
  iban: "IBAN",
12342
12390
  jwt: "JWT",
12343
12391
  template_literal: "kirish"
@@ -12451,6 +12499,7 @@ var error58 = () => {
12451
12499
  json_string: "chu\u1ED7i JSON",
12452
12500
  e164: "s\u1ED1 E.164",
12453
12501
  credit_card: "s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",
12502
+ currency_code: "m\xE3 ti\u1EC1n t\u1EC7",
12454
12503
  iban: "IBAN",
12455
12504
  jwt: "JWT",
12456
12505
  template_literal: "\u0111\u1EA7u v\xE0o"
@@ -12564,6 +12613,7 @@ var error59 = () => {
12564
12613
  json_string: "JSON\u5B57\u7B26\u4E32",
12565
12614
  e164: "E.164\u53F7\u7801",
12566
12615
  credit_card: "\u4FE1\u7528\u5361\u53F7",
12616
+ currency_code: "\u8D27\u5E01\u4EE3\u7801",
12567
12617
  iban: "IBAN",
12568
12618
  jwt: "JWT",
12569
12619
  template_literal: "\u8F93\u5165"
@@ -12678,6 +12728,7 @@ var error60 = () => {
12678
12728
  json_string: "JSON \u5B57\u4E32",
12679
12729
  e164: "E.164 \u6578\u503C",
12680
12730
  credit_card: "\u4FE1\u7528\u5361\u865F",
12731
+ currency_code: "\u8CA8\u5E63\u4EE3\u78BC",
12681
12732
  iban: "IBAN",
12682
12733
  jwt: "JWT",
12683
12734
  template_literal: "\u8F38\u5165"
@@ -12790,6 +12841,7 @@ var error61 = () => {
12790
12841
  json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON",
12791
12842
  e164: "n\u1ECD\u0301mb\xE0 E.164",
12792
12843
  credit_card: "n\u1ECDmba kaadi gbese",
12844
+ currency_code: "koodu ow\xF3",
12793
12845
  iban: "IBAN",
12794
12846
  jwt: "JWT",
12795
12847
  template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"
@@ -13168,7 +13220,7 @@ function generateChecks(doc, ctx, schema, accessor) {
13168
13220
  generatePropertyCheck(doc, ctx, def, currentAccessor);
13169
13221
  break;
13170
13222
  case "properties":
13171
- generatePropertiesChecks(doc, ctx, def, currentAccessor, false);
13223
+ generatePropertiesChecks(doc, ctx, def, currentAccessor);
13172
13224
  break;
13173
13225
  case "overwrite": {
13174
13226
  const newAccessor = newVar(ctx);
@@ -13278,11 +13330,11 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
13278
13330
  doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
13279
13331
  }
13280
13332
  }
13281
- function generatePropertiesChecks(doc, ctx, def, accessor, schemaRole) {
13333
+ function generatePropertiesChecks(doc, ctx, def, accessor) {
13282
13334
  if (def.when) {
13283
13335
  throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
13284
13336
  }
13285
- doc.write(schemaRole ? `if (${accessor} === null || (typeof ${accessor} !== "object" && typeof ${accessor} !== "function")) return INVALID;` : `if (${accessor} == null) return INVALID;`);
13337
+ doc.write(`if (${accessor} == null) return INVALID;`);
13286
13338
  const shape = def.shape;
13287
13339
  for (const key of Reflect.ownKeys(shape)) {
13288
13340
  const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
@@ -13372,7 +13424,7 @@ var PATTERN_IS_COMPLETE = /* @__PURE__ */ new Set([
13372
13424
  "uuid",
13373
13425
  "xid"
13374
13426
  ]);
13375
- function generateStringFormatCheck(doc, ctx, def, accessor) {
13427
+ function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
13376
13428
  const fmt = def.format;
13377
13429
  if (fmt === "base64") {
13378
13430
  const validator = addConstant(ctx, isValidBase64);
@@ -13412,7 +13464,7 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
13412
13464
  }
13413
13465
  const formatDef = def;
13414
13466
  if (fmt === "url" || fmt === "httpurl" || formatDef.normalize || formatDef.hostname !== void 0 || formatDef.protocol !== void 0) {
13415
- const parseConst = addConstant(ctx, parseURLObject);
13467
+ const parseConst = addConstant(ctx, validateURL);
13416
13468
  const defConst = addConstant(ctx, def);
13417
13469
  const trimVar = newVar(ctx);
13418
13470
  const urlVar = newVar(ctx);
@@ -13427,6 +13479,8 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
13427
13479
  const protocolConst = addConstant(ctx, urlProtocolOk);
13428
13480
  doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
13429
13481
  }
13482
+ if (!needsValue)
13483
+ return null;
13430
13484
  const outputVar = newVar(ctx);
13431
13485
  const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
13432
13486
  doc.write(`const ${outputVar} = ${outputExpr};`);
@@ -13486,7 +13540,7 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
13486
13540
  let typeAccessor;
13487
13541
  switch (type) {
13488
13542
  case "string":
13489
- typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
13543
+ typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
13490
13544
  break;
13491
13545
  case "number":
13492
13546
  typeAccessor = generateNumberCheck(doc, schema, accessor);
@@ -13592,10 +13646,6 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
13592
13646
  case "custom":
13593
13647
  typeAccessor = generateCustomCheck(doc, ctx, schema, accessor);
13594
13648
  break;
13595
- case "properties":
13596
- generatePropertiesChecks(doc, ctx, schema._zod.def, accessor, true);
13597
- typeAccessor = accessor;
13598
- break;
13599
13649
  case "transform":
13600
13650
  typeAccessor = generateTransformCheck(doc, ctx, schema, accessor);
13601
13651
  break;
@@ -13611,12 +13661,12 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
13611
13661
  return null;
13612
13662
  return generateChecks(doc, ctx, schema, typeAccessor);
13613
13663
  }
13614
- function generateStringCheck(doc, ctx, schema, accessor) {
13664
+ function generateStringCheck(doc, ctx, schema, accessor, needsValue = true) {
13615
13665
  doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
13616
13666
  const def = schema._zod.def;
13617
13667
  if (def.format === void 0)
13618
13668
  return accessor;
13619
- return generateStringFormatCheck(doc, ctx, def, accessor);
13669
+ return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
13620
13670
  }
13621
13671
  function generateNumberCheck(doc, schema, accessor) {
13622
13672
  doc.write(`if (typeof ${accessor} !== "number" || !Number.isFinite(${accessor})) return INVALID;`);
@@ -13734,7 +13784,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
13734
13784
  }
13735
13785
  }
13736
13786
  const outputVar = newVar(ctx);
13737
- const hasConditionalKeys = allKeys.some((k) => mayOutputUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
13787
+ const hasConditionalKeys = allKeys.some((k) => mayOmitUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
13738
13788
  if (!buildsValue) {
13739
13789
  if (unknownKeysMode === "schema") {
13740
13790
  const knownSet = keys.length > 0 ? addConstant(ctx, new Set(keys)) : null;
@@ -13761,7 +13811,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
13761
13811
  const out = propOutputs.get(k);
13762
13812
  if (dropsWhenAbsent(propShape[k])) {
13763
13813
  doc.write(`if (${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
13764
- } else if (mayOutputUndefined(propShape[k])) {
13814
+ } else if (mayOmitUndefined(propShape[k])) {
13765
13815
  doc.write(`if (${out} !== undefined || ${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
13766
13816
  } else {
13767
13817
  doc.write(`${outputVar}[${kx}] = ${out};`);
@@ -13894,6 +13944,9 @@ function fastPathAcceptsAbsence(schema) {
13894
13944
  function dropsWhenAbsent(schema) {
13895
13945
  return schema._zod.optin === "optional" && schema._zod.optout === "optional";
13896
13946
  }
13947
+ function mayOmitUndefined(schema) {
13948
+ return (schema._zod.optin !== "defaulted" || schema._zod.optout === "optional") && mayOutputUndefined(schema);
13949
+ }
13897
13950
  function mayOutputUndefined(schema) {
13898
13951
  const def = schema._zod.def;
13899
13952
  switch (def.type) {
@@ -14513,20 +14566,18 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
14513
14566
  }
14514
14567
 
14515
14568
  // ../../node_modules/zod/v4/core/api.js
14569
+ function snapshotChecks(def) {
14570
+ if (def.checks)
14571
+ def.checks = [...def.checks];
14572
+ return def;
14573
+ }
14516
14574
  // @__NO_SIDE_EFFECTS__
14517
14575
  function _string(Class2, params) {
14518
- return new Class2({
14519
- type: "string",
14520
- ...normalizeParams(params)
14521
- });
14576
+ return new Class2(snapshotChecks({ type: "string", ...normalizeParams(params) }));
14522
14577
  }
14523
14578
  // @__NO_SIDE_EFFECTS__
14524
14579
  function _coercedString(Class2, params) {
14525
- return new Class2({
14526
- type: "string",
14527
- coerce: true,
14528
- ...normalizeParams(params)
14529
- });
14580
+ return new Class2(snapshotChecks({ type: "string", coerce: true, ...normalizeParams(params) }));
14530
14581
  }
14531
14582
  // @__NO_SIDE_EFFECTS__
14532
14583
  function _email(Class2, params) {
@@ -14830,20 +14881,11 @@ function _isoDuration(Class2, params) {
14830
14881
  }
14831
14882
  // @__NO_SIDE_EFFECTS__
14832
14883
  function _number(Class2, params) {
14833
- return new Class2({
14834
- type: "number",
14835
- checks: [],
14836
- ...normalizeParams(params)
14837
- });
14884
+ return new Class2(snapshotChecks({ type: "number", checks: [], ...normalizeParams(params) }));
14838
14885
  }
14839
14886
  // @__NO_SIDE_EFFECTS__
14840
14887
  function _coercedNumber(Class2, params) {
14841
- return new Class2({
14842
- type: "number",
14843
- coerce: true,
14844
- checks: [],
14845
- ...normalizeParams(params)
14846
- });
14888
+ return new Class2(snapshotChecks({ type: "number", coerce: true, checks: [], ...normalizeParams(params) }));
14847
14889
  }
14848
14890
  // @__NO_SIDE_EFFECTS__
14849
14891
  function _int(Class2, params) {
@@ -15185,9 +15227,8 @@ function _property(property, schema, params) {
15185
15227
  });
15186
15228
  }
15187
15229
  // @__NO_SIDE_EFFECTS__
15188
- function _properties(Class2, shape, params) {
15189
- return new Class2({
15190
- type: "properties",
15230
+ function _properties(shape, params) {
15231
+ return new $ZodCheckProperties({
15191
15232
  check: "properties",
15192
15233
  shape,
15193
15234
  ...normalizeParams(params)
@@ -15822,11 +15863,11 @@ function foldObjects(members2) {
15822
15863
  }
15823
15864
  objects.push(member);
15824
15865
  }
15825
- const properties2 = {};
15866
+ const properties = {};
15826
15867
  const required2 = /* @__PURE__ */ new Set();
15827
15868
  for (const object2 of objects) {
15828
15869
  for (const key in object2.properties) {
15829
- if (Object.prototype.hasOwnProperty.call(properties2, key))
15870
+ if (Object.prototype.hasOwnProperty.call(properties, key))
15830
15871
  continue;
15831
15872
  const parts = [];
15832
15873
  for (const other of objects) {
@@ -15837,12 +15878,12 @@ function foldObjects(members2) {
15837
15878
  parts.push(part);
15838
15879
  }
15839
15880
  const merged = parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts };
15840
- assignProp(properties2, key, merged);
15881
+ assignProp(properties, key, merged);
15841
15882
  }
15842
15883
  for (const key of object2.required ?? [])
15843
15884
  required2.add(key);
15844
15885
  }
15845
- const folded = { type: "object", properties: properties2 };
15886
+ const folded = { type: "object", properties };
15846
15887
  if (required2.size)
15847
15888
  folded.required = [...required2];
15848
15889
  if (objects.every((object2) => object2.additionalProperties === false)) {
@@ -16464,17 +16505,15 @@ var objectProcessor = (schema, ctx, _json, params) => {
16464
16505
  path: [...params.path, "properties", key]
16465
16506
  }));
16466
16507
  }
16467
- const allKeys = new Set(Object.keys(shape));
16468
- const requiredKeys = new Set([...allKeys].filter((key) => {
16508
+ const requiredKeys = [];
16509
+ for (const key of Object.keys(shape)) {
16469
16510
  const field = def.shape[key];
16470
- if (ctx.io === "input") {
16471
- return inputOptin(field) === void 0;
16472
- } else {
16473
- return field._zod.optout === void 0;
16511
+ if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) {
16512
+ requiredKeys.push(key);
16474
16513
  }
16475
- }));
16476
- if (requiredKeys.size > 0) {
16477
- json2.required = Array.from(requiredKeys);
16514
+ }
16515
+ if (requiredKeys.length > 0) {
16516
+ json2.required = requiredKeys;
16478
16517
  }
16479
16518
  if (def.catchall?._zod.def.type === "never") {
16480
16519
  json2.additionalProperties = false;
@@ -16488,31 +16527,6 @@ var objectProcessor = (schema, ctx, _json, params) => {
16488
16527
  });
16489
16528
  }
16490
16529
  };
16491
- var propertiesProcessor = (schema, ctx, _json, params) => {
16492
- const json2 = _json;
16493
- const def = schema._zod.def;
16494
- if (Object.getOwnPropertySymbols(def.shape).length && handleUnrepresentable(schema, ctx, json2, params, "Symbol keys cannot be represented in JSON Schema")) {
16495
- return;
16496
- }
16497
- if (ctx.io === "output") {
16498
- for (const key in def.shape) {
16499
- if (isTransforming(def.shape[key]) && handleUnrepresentable(schema, ctx, json2, params, `z.properties() returns its input, so the output of a transforming schema at key "${key}" cannot be represented in JSON Schema`)) {
16500
- return;
16501
- }
16502
- }
16503
- }
16504
- json2.type = "object";
16505
- json2.properties = {};
16506
- for (const key in def.shape) {
16507
- assignProp(json2.properties, key, processSchema(def.shape[key], ctx, {
16508
- ...params,
16509
- path: [...params.path, "properties", key]
16510
- }));
16511
- }
16512
- const required2 = Object.keys(def.shape).filter((key) => inputOptin(def.shape[key]) === void 0);
16513
- if (required2.length > 0)
16514
- json2.required = required2;
16515
- };
16516
16530
  var unionProcessor = (schema, ctx, json2, params) => {
16517
16531
  const def = schema._zod.def;
16518
16532
  const isExclusive = def.inclusive === false;
@@ -16832,7 +16846,6 @@ var allProcessors = {
16832
16846
  file: fileProcessor,
16833
16847
  success: successProcessor,
16834
16848
  custom: customProcessor,
16835
- properties: propertiesProcessor,
16836
16849
  function: functionProcessor,
16837
16850
  transform: transformProcessor,
16838
16851
  map: mapProcessor,
@@ -17029,7 +17042,6 @@ __export(schemas_exports2, {
17029
17042
  ZodPrefault: () => ZodPrefault,
17030
17043
  ZodPreprocess: () => ZodPreprocess,
17031
17044
  ZodPromise: () => ZodPromise,
17032
- ZodProperties: () => ZodProperties,
17033
17045
  ZodReadonly: () => ZodReadonly,
17034
17046
  ZodRecord: () => ZodRecord,
17035
17047
  ZodSet: () => ZodSet,
@@ -17067,6 +17079,7 @@ __export(schemas_exports2, {
17067
17079
  creditCard: () => creditCard2,
17068
17080
  cuid: () => cuid3,
17069
17081
  cuid2: () => cuid22,
17082
+ currencyCode: () => currencyCode2,
17070
17083
  custom: () => custom,
17071
17084
  date: () => date2,
17072
17085
  describe: () => describe2,
@@ -17121,7 +17134,6 @@ __export(schemas_exports2, {
17121
17134
  prefault: () => prefault,
17122
17135
  preprocess: () => preprocess,
17123
17136
  promise: () => promise,
17124
- properties: () => properties,
17125
17137
  readonly: () => readonly,
17126
17138
  record: () => record,
17127
17139
  refine: () => refine,
@@ -17175,6 +17187,7 @@ __export(checks_exports2, {
17175
17187
  normalize: () => _normalize,
17176
17188
  overwrite: () => _overwrite,
17177
17189
  positive: () => _positive,
17190
+ properties: () => _properties,
17178
17191
  property: () => _property,
17179
17192
  regex: () => _regex,
17180
17193
  size: () => _size,
@@ -17634,8 +17647,8 @@ function url(params) {
17634
17647
  }
17635
17648
  function httpUrl(params) {
17636
17649
  return _url(ZodURL, {
17637
- protocol: regexes_exports.httpProtocol,
17638
- hostname: regexes_exports.domain,
17650
+ protocol: httpProtocol,
17651
+ hostname: domain,
17639
17652
  ...util_exports.normalizeParams(params)
17640
17653
  });
17641
17654
  }
@@ -17773,10 +17786,13 @@ function stringFormat(format, fnOrRegex, _params = {}) {
17773
17786
  return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
17774
17787
  }
17775
17788
  function hostname2(_params) {
17776
- return _stringFormat(ZodCustomStringFormat, "hostname", regexes_exports.hostname, _params);
17789
+ return _stringFormat(ZodCustomStringFormat, "hostname", hostname, _params);
17777
17790
  }
17778
17791
  function hex2(_params) {
17779
- return _stringFormat(ZodCustomStringFormat, "hex", regexes_exports.hex, _params);
17792
+ return _stringFormat(ZodCustomStringFormat, "hex", hex, _params);
17793
+ }
17794
+ function currencyCode2(_params) {
17795
+ return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
17780
17796
  }
17781
17797
  function hash(alg, params) {
17782
17798
  const enc = params?.enc ?? "hex";
@@ -18641,14 +18657,6 @@ var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
18641
18657
  ZodType.init(inst, def);
18642
18658
  inst._zod.processJSONSchema = (ctx, json2, params) => customProcessor(inst, ctx, json2, params);
18643
18659
  });
18644
- var ZodProperties = /* @__PURE__ */ $constructor("ZodProperties", (inst, def) => {
18645
- _ensureDefaultMemoizer();
18646
- $ZodProperties.init(inst, def);
18647
- ZodType.init(inst, def);
18648
- });
18649
- function properties(shape, params) {
18650
- return _properties(ZodProperties, shape, params);
18651
- }
18652
18660
  function check(fn) {
18653
18661
  const ch = new $ZodCheck({
18654
18662
  check: "custom"
@@ -18672,7 +18680,7 @@ var ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) =>
18672
18680
  ZodCustom.init(inst, def);
18673
18681
  }, {
18674
18682
  properties(shape, params) {
18675
- return this.check(properties(shape, params));
18683
+ return this.check(_properties(shape, params));
18676
18684
  }
18677
18685
  });
18678
18686
  function _instanceof(cls, params = {}) {
@@ -19259,10 +19267,10 @@ function convertBaseSchema(schema, ctx) {
19259
19267
  }
19260
19268
  case "object": {
19261
19269
  const shape = {};
19262
- const properties2 = schema.properties || {};
19270
+ const properties = schema.properties || {};
19263
19271
  const requiredSet = new Set(schema.required || []);
19264
19272
  const additionalSchema = typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : void 0;
19265
- for (const [key, propSchema] of Object.entries(properties2)) {
19273
+ for (const [key, propSchema] of Object.entries(properties)) {
19266
19274
  const propZodSchema = convertSchema(propSchema, ctx);
19267
19275
  assignProp(shape, key, requiredSet.has(key) ? propZodSchema : propZodSchema.optional());
19268
19276
  }
@@ -19507,21 +19515,21 @@ function visit(schema, fnOrHandlers) {
19507
19515
  const h = fnOrHandlers[node2._zod.def.type];
19508
19516
  return h ? h(node2, rewritten) : node2;
19509
19517
  };
19510
- const cache2 = /* @__PURE__ */ new Map();
19518
+ const cache = /* @__PURE__ */ new Map();
19511
19519
  function run2(s) {
19512
- const cached2 = cache2.get(s);
19520
+ const cached2 = cache.get(s);
19513
19521
  if (cached2 === RESOLVING) {
19514
19522
  return new $ZodLazy({
19515
19523
  type: "lazy",
19516
- getter: () => cache2.get(s)
19524
+ getter: () => cache.get(s)
19517
19525
  });
19518
19526
  }
19519
19527
  if (cached2 !== void 0)
19520
19528
  return cached2;
19521
- cache2.set(s, RESOLVING);
19529
+ cache.set(s, RESOLVING);
19522
19530
  const inner = mapInner(s);
19523
19531
  const mapped = fn(inner, inner !== s);
19524
- cache2.set(s, mapped);
19532
+ cache.set(s, mapped);
19525
19533
  return mapped;
19526
19534
  }
19527
19535
  function mapInner(s) {
@@ -19623,18 +19631,6 @@ function visit(schema, fnOrHandlers) {
19623
19631
  const { _cachedInner, ...rest } = def;
19624
19632
  return clone(s, { ...rest, getter: () => run2(original()) });
19625
19633
  }
19626
- case "properties": {
19627
- const oldShape = def.shape;
19628
- let changed = false;
19629
- const newShape = {};
19630
- for (const k of Reflect.ownKeys(oldShape)) {
19631
- const mapped = run2(oldShape[k]);
19632
- if (mapped !== oldShape[k])
19633
- changed = true;
19634
- newShape[k] = mapped;
19635
- }
19636
- return changed ? clone(s, { ...def, shape: newShape }) : s;
19637
- }
19638
19634
  // A leaf by choice: `parts` are regex fragments, not data positions.
19639
19635
  case "template_literal":
19640
19636
  // Leaves.
@@ -23617,8 +23613,8 @@ function scanXMcpHeaderDeclarations(inputSchema) {
23617
23613
  type
23618
23614
  });
23619
23615
  }
23620
- const properties2 = schema.properties;
23621
- if (properties2 !== null && typeof properties2 === "object") for (const [key, child] of Object.entries(properties2)) {
23616
+ const properties = schema.properties;
23617
+ if (properties !== null && typeof properties === "object") for (const [key, child] of Object.entries(properties)) {
23622
23618
  const fault$1 = visit2(child, [...path, key], reachable);
23623
23619
  if (fault$1 !== void 0) return fault$1;
23624
23620
  }
@@ -23873,9 +23869,9 @@ function isLibraryFormatPattern(format, pattern, vendor) {
23873
23869
  }
23874
23870
  function promptArgumentsFromStandardSchema(schema) {
23875
23871
  const jsonSchema = standardSchemaToJsonSchema(schema, "input");
23876
- const properties2 = jsonSchema.properties || {};
23872
+ const properties = jsonSchema.properties || {};
23877
23873
  const required2 = jsonSchema.required || [];
23878
- return Object.entries(properties2).map(([name, prop]) => ({
23874
+ return Object.entries(properties).map(([name, prop]) => ({
23879
23875
  name,
23880
23876
  description: prop?.description,
23881
23877
  required: required2.includes(name)
@@ -26719,8 +26715,8 @@ var require_defaults = /* @__PURE__ */ __commonJSMin(((exports) => {
26719
26715
  const codegen_1 = require_codegen();
26720
26716
  const util_1 = require_util();
26721
26717
  function assignDefaults(it, ty) {
26722
- const { properties: properties2, items } = it.schema;
26723
- if (ty === "object" && properties2) for (const key in properties2) assignDefault(it, key, properties2[key].default);
26718
+ const { properties, items } = it.schema;
26719
+ if (ty === "object" && properties) for (const key in properties) assignDefault(it, key, properties[key].default);
26724
26720
  else if (ty === "array" && Array.isArray(items)) items.forEach((sch, i) => assignDefault(it, i, sch.default));
26725
26721
  }
26726
26722
  exports.assignDefaults = assignDefaults;
@@ -26752,8 +26748,8 @@ var require_code = /* @__PURE__ */ __commonJSMin(((exports) => {
26752
26748
  });
26753
26749
  }
26754
26750
  exports.checkReportMissingProp = checkReportMissingProp;
26755
- function checkMissingProp({ gen, data, it: { opts } }, properties2, missing) {
26756
- return (0, codegen_1.or)(...properties2.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`)));
26751
+ function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
26752
+ return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`)));
26757
26753
  }
26758
26754
  exports.checkMissingProp = checkMissingProp;
26759
26755
  function reportMissingProp(cxt, missing) {
@@ -28794,8 +28790,8 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
28794
28790
  return this;
28795
28791
  }
28796
28792
  case "object": {
28797
- const cacheKey2 = schemaKeyRef;
28798
- this._cache.delete(cacheKey2);
28793
+ const cacheKey = schemaKeyRef;
28794
+ this._cache.delete(cacheKey);
28799
28795
  let id = schemaKeyRef[this.opts.schemaId];
28800
28796
  if (id) {
28801
28797
  id = (0, resolve_1.normalizeId)(id);
@@ -28938,10 +28934,10 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
28938
28934
  Ajv2.ValidationError = validation_error_1.default;
28939
28935
  Ajv2.MissingRefError = ref_error_1.default;
28940
28936
  exports.default = Ajv2;
28941
- function checkOptions(checkOpts, options, msg, log = "error") {
28937
+ function checkOptions(checkOpts, options, msg, log2 = "error") {
28942
28938
  for (const key in checkOpts) {
28943
28939
  const opt = key;
28944
- if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);
28940
+ if (opt in options) this.logger[log2](`${msg}: option ${key}. ${checkOpts[opt]}`);
28945
28941
  }
28946
28942
  }
28947
28943
  function getSchEnv(keyRef) {
@@ -30029,10 +30025,10 @@ var require_properties = /* @__PURE__ */ __commonJSMin(((exports) => {
30029
30025
  const allProps = (0, code_1.allSchemaProperties)(schema);
30030
30026
  for (const prop of allProps) it.definedProperties.add(prop);
30031
30027
  if (it.opts.unevaluated && allProps.length && it.props !== true) it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
30032
- const properties2 = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
30033
- if (properties2.length === 0) return;
30028
+ const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
30029
+ if (properties.length === 0) return;
30034
30030
  const valid = gen.name("valid");
30035
- for (const prop of properties2) {
30031
+ for (const prop of properties) {
30036
30032
  if (hasDefault(prop)) applyPropertySchema(prop);
30037
30033
  else {
30038
30034
  gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));
@@ -33899,240 +33895,7 @@ var pageSchema = {
33899
33895
  };
33900
33896
 
33901
33897
  // ../gogcli-mcp/src/runner.ts
33902
- import { AsyncLocalStorage } from "node:async_hooks";
33903
33898
  import { delimiter, join } from "node:path";
33904
- function isGogFileArg(arg) {
33905
- return typeof arg !== "string";
33906
- }
33907
- var RUNNER_TRANSPORT_BRAND = /* @__PURE__ */ Symbol.for("gogcli.RunnerTransportError");
33908
- var RunnerTransportError = class extends Error {
33909
- kind;
33910
- status;
33911
- constructor(message, kind, status) {
33912
- super(message);
33913
- this.name = "RunnerTransportError";
33914
- this.kind = kind;
33915
- this.status = status;
33916
- Object.defineProperty(this, RUNNER_TRANSPORT_BRAND, { value: true });
33917
- }
33918
- };
33919
- function isRunnerTransportError(err) {
33920
- return err instanceof Error && err[RUNNER_TRANSPORT_BRAND] === true;
33921
- }
33922
- var runExecutor = new AsyncLocalStorage();
33923
- var defaultExecutor;
33924
- function setDefaultGogExecutor(executor) {
33925
- defaultExecutor = executor ? { executor } : void 0;
33926
- }
33927
- function activeExecutor() {
33928
- return runExecutor.getStore() ?? defaultExecutor;
33929
- }
33930
- var TIMEOUT_MS = 3e4;
33931
- function readonlyEnvEnabled() {
33932
- return readEnvVar("GOG_READONLY") !== void 0 && parseBoolEnv("GOG_READONLY", { default: true });
33933
- }
33934
- function sanitizedEnv() {
33935
- const result = {};
33936
- for (const [key, value] of Object.entries(process.env)) {
33937
- if (key === "GOG_ACCESS_TOKEN") continue;
33938
- if (key === "GOOGLE_APPLICATION_CREDENTIALS") continue;
33939
- if (/(_TOKEN|_SECRET|_KEY|_CREDENTIALS)$/.test(key)) continue;
33940
- result[key] = value;
33941
- }
33942
- return result;
33943
- }
33944
- var TOKEN_LEFT_BOUNDARY = "(?<![A-Za-z0-9+/])";
33945
- var GOOGLE_TOKEN_PATTERNS = [
33946
- new RegExp(`${TOKEN_LEFT_BOUNDARY}ya29\\.[A-Za-z0-9._\\-]+`, "g"),
33947
- // OAuth2 access tokens
33948
- new RegExp(`${TOKEN_LEFT_BOUNDARY}1//[A-Za-z0-9._\\-]+`, "g")
33949
- // OAuth2 refresh tokens
33950
- ];
33951
- function redactGoogleTokens(text) {
33952
- let redacted = text;
33953
- for (const re of GOOGLE_TOKEN_PATTERNS) {
33954
- redacted = redacted.replace(re, "[REDACTED]");
33955
- }
33956
- return redacted;
33957
- }
33958
- function redactSecrets2(text) {
33959
- return redactGoogleTokens(redactSecrets(text));
33960
- }
33961
- var OPAQUE_FIELD_VALUE = "[A-Za-z0-9+/_-]{16,}={0,2}";
33962
- var opaquePlaceholder = (i) => `\0gogOpaque${i}\0`;
33963
- function redactPreservingOpaqueFields(text, fields, redact) {
33964
- const lifted = [];
33965
- let staged = text;
33966
- for (const field of fields) {
33967
- const escaped = field.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
33968
- const re = new RegExp(`("${escaped}"\\s*:\\s*")(${OPAQUE_FIELD_VALUE})(")`, "g");
33969
- staged = staged.replace(re, (_m, open2, value, close) => {
33970
- lifted.push(value);
33971
- return `${open2}${opaquePlaceholder(lifted.length - 1)}${close}`;
33972
- });
33973
- }
33974
- if (lifted.length === 0) return redact(text);
33975
- let redacted = redact(staged);
33976
- lifted.forEach((value, i) => {
33977
- redacted = redacted.split(opaquePlaceholder(i)).join(value);
33978
- });
33979
- return redacted;
33980
- }
33981
- function augmentedPath() {
33982
- const home = process.env.HOME;
33983
- const candidates = [
33984
- process.env.PATH ?? "",
33985
- "/opt/homebrew/bin",
33986
- "/usr/local/bin",
33987
- home ? `${home}/.local/bin` : "",
33988
- home ? `${home}/go/bin` : ""
33989
- ];
33990
- const seen = /* @__PURE__ */ new Set();
33991
- const parts = [];
33992
- for (const c of candidates) {
33993
- if (!c) continue;
33994
- for (const dir of c.split(delimiter)) {
33995
- if (!dir || seen.has(dir)) continue;
33996
- seen.add(dir);
33997
- parts.push(dir);
33998
- }
33999
- }
34000
- return parts.join(delimiter);
34001
- }
34002
- function formatTimeout(ms) {
34003
- const seconds = Math.round(ms / 1e3);
34004
- if (seconds >= 60) {
34005
- const minutes = Math.round(seconds / 60);
34006
- return `${ms}ms (${minutes} minute${minutes !== 1 ? "s" : ""})`;
34007
- }
34008
- return `${ms}ms`;
34009
- }
34010
- async function spawnWithTempFiles(args, opts) {
34011
- const { mkdtemp, mkdir, writeFile, rm } = await import("node:fs/promises");
34012
- const { tmpdir } = await import("node:os");
34013
- const dir = await mkdtemp(join(tmpdir(), "gogcli-mcp-"));
34014
- try {
34015
- const argv = [];
34016
- let seq = 0;
34017
- for (const arg of args) {
34018
- if (!isGogFileArg(arg)) {
34019
- argv.push(arg);
34020
- continue;
34021
- }
34022
- const sub = join(dir, String(seq));
34023
- seq += 1;
34024
- await mkdir(sub, { recursive: true, mode: 448 });
34025
- const path = join(sub, arg.filename ?? `${arg.flag}.${arg.ext ?? "txt"}`);
34026
- const data = arg.encoding === "base64" ? Buffer.from(arg.contents, "base64") : Buffer.from(arg.contents, "utf8");
34027
- await writeFile(path, data, { mode: 384 });
34028
- argv.push(arg.positional ? path : `--${arg.flag}=${path}`);
34029
- }
34030
- return await spawnGog(argv, opts);
34031
- } finally {
34032
- await rm(dir, { recursive: true, force: true }).catch(() => {
34033
- });
34034
- }
34035
- }
34036
- function spawnExecutor(args, opts) {
34037
- if (args.some(isGogFileArg)) {
34038
- return spawnWithTempFiles(args, opts);
34039
- }
34040
- return spawnGog(args, opts);
34041
- }
34042
- async function spawnGog(fullArgs, opts) {
34043
- const { timeout, interactive = false, spawner, binary = false } = opts;
34044
- const spawn = spawner ?? (await import("node:child_process")).spawn;
34045
- const effectiveTimeout = timeout ?? TIMEOUT_MS;
34046
- return new Promise((resolve, reject) => {
34047
- const childEnv = { ...sanitizedEnv(), PATH: augmentedPath() };
34048
- const child = spawn(readEnvVar("GOG_PATH") ?? "gog", fullArgs, { env: childEnv });
34049
- const stdoutChunks = [];
34050
- const stderrChunks = [];
34051
- let settled = false;
34052
- const timer = setTimeout(() => {
34053
- settled = true;
34054
- child.kill();
34055
- reject(new Error(`gog timed out after ${formatTimeout(effectiveTimeout)}`));
34056
- }, effectiveTimeout);
34057
- child.stdout.on("data", (chunk) => {
34058
- stdoutChunks.push(chunk);
34059
- });
34060
- child.stderr.on("data", (chunk) => {
34061
- stderrChunks.push(chunk);
34062
- });
34063
- child.on("close", (code) => {
34064
- clearTimeout(timer);
34065
- if (settled) return;
34066
- settled = true;
34067
- const stderr = Buffer.concat(stderrChunks).toString().trim();
34068
- if (code === 0) {
34069
- if (binary) {
34070
- resolve(Buffer.concat(stdoutChunks).toString("base64"));
34071
- return;
34072
- }
34073
- const stdout = Buffer.concat(stdoutChunks).toString();
34074
- if (interactive && stderr) {
34075
- resolve(stdout + "\n" + stderr);
34076
- } else {
34077
- resolve(stdout);
34078
- }
34079
- } else {
34080
- reject(new Error(stderr || `gog exited with code ${code}`));
34081
- }
34082
- });
34083
- child.on("error", (err) => {
34084
- clearTimeout(timer);
34085
- if (settled) return;
34086
- settled = true;
34087
- if (err.code === "ENOENT") {
34088
- reject(new Error(
34089
- "gog executable not found. Install gogcli (https://github.com/openclaw/gogcli) or set GOG_PATH in your MCP client config to the absolute binary path (run `which gog` in a terminal to find it)."
34090
- ));
34091
- return;
34092
- }
34093
- reject(err);
34094
- });
34095
- });
34096
- }
34097
- function assembleArgs(args, opts) {
34098
- const effectiveAccount = opts.account ?? readEnvVar("GOG_ACCOUNT");
34099
- const fullArgs = ["--json", "--color=never"];
34100
- if (!opts.interactive) {
34101
- fullArgs.push("--no-input");
34102
- }
34103
- if (opts.readonly || readonlyEnvEnabled()) {
34104
- fullArgs.push("--readonly");
34105
- }
34106
- if (effectiveAccount) {
34107
- fullArgs.push("--account", effectiveAccount);
34108
- }
34109
- fullArgs.push(...args);
34110
- return fullArgs;
34111
- }
34112
- async function run(args, options = {}) {
34113
- const { account, spawner, interactive = false, timeout, readonly: readonly2 = false, redactMode = "full", opaqueFields } = options;
34114
- const base = redactMode === "tokens" ? redactGoogleTokens : redactSecrets2;
34115
- const redact = opaqueFields?.length ? (text) => redactPreservingOpaqueFields(text, opaqueFields, base) : base;
34116
- const fullArgs = assembleArgs(args, { account, interactive, readonly: readonly2 });
34117
- const store = activeExecutor();
34118
- try {
34119
- let output2;
34120
- if (spawner) {
34121
- output2 = await spawnExecutor(fullArgs, { timeout, interactive, spawner });
34122
- } else if (store) {
34123
- output2 = await store.executor(fullArgs, { timeout, interactive });
34124
- } else {
34125
- output2 = await spawnExecutor(fullArgs, { timeout, interactive });
34126
- }
34127
- return redact(output2);
34128
- } catch (err) {
34129
- const message = base(err instanceof Error ? err.message : String(err));
34130
- if (isRunnerTransportError(err)) {
34131
- throw new RunnerTransportError(message, err.kind, err.status);
34132
- }
34133
- throw new Error(message);
34134
- }
34135
- }
34136
33899
 
34137
33900
  // ../gogcli-mcp/src/timestamps.ts
34138
33901
  var DEFAULT_DISPLAY_TZ = "America/New_York";
@@ -34333,6 +34096,204 @@ function normalizeTimestamps(text, tz = displayTimeZone(), naiveTz = naiveSource
34333
34096
  return JSON.stringify(parsed, null, detectIndent(text));
34334
34097
  }
34335
34098
 
34099
+ // ../gogcli-mcp/src/runner.ts
34100
+ function isGogFileArg(arg) {
34101
+ return typeof arg !== "string";
34102
+ }
34103
+ var TIMEOUT_MS = 3e4;
34104
+ function readonlyEnvEnabled() {
34105
+ return readEnvVar("GOG_READONLY") !== void 0 && parseBoolEnv("GOG_READONLY", { default: true });
34106
+ }
34107
+ function sanitizedEnv() {
34108
+ const result = {};
34109
+ for (const [key, value] of Object.entries(process.env)) {
34110
+ if (key === "GOG_ACCESS_TOKEN") continue;
34111
+ if (key === "GOOGLE_APPLICATION_CREDENTIALS") continue;
34112
+ if (/(_TOKEN|_SECRET|_KEY|_CREDENTIALS)$/.test(key)) continue;
34113
+ result[key] = value;
34114
+ }
34115
+ return result;
34116
+ }
34117
+ var TOKEN_LEFT_BOUNDARY = "(?<![A-Za-z0-9+/])";
34118
+ var GOOGLE_TOKEN_PATTERNS = [
34119
+ new RegExp(`${TOKEN_LEFT_BOUNDARY}ya29\\.[A-Za-z0-9._\\-]+`, "g"),
34120
+ // OAuth2 access tokens
34121
+ new RegExp(`${TOKEN_LEFT_BOUNDARY}1//[A-Za-z0-9._\\-]+`, "g")
34122
+ // OAuth2 refresh tokens
34123
+ ];
34124
+ function redactGoogleTokens(text) {
34125
+ let redacted = text;
34126
+ for (const re of GOOGLE_TOKEN_PATTERNS) {
34127
+ redacted = redacted.replace(re, "[REDACTED]");
34128
+ }
34129
+ return redacted;
34130
+ }
34131
+ function redactSecrets2(text) {
34132
+ return redactGoogleTokens(redactSecrets(text));
34133
+ }
34134
+ var OPAQUE_FIELD_VALUE = "[A-Za-z0-9+/_-]{16,}={0,2}";
34135
+ var opaquePlaceholder = (i) => `\0gogOpaque${i}\0`;
34136
+ function redactPreservingOpaqueFields(text, fields, redact) {
34137
+ const lifted = [];
34138
+ let staged = text;
34139
+ for (const field of fields) {
34140
+ const escaped = field.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
34141
+ const re = new RegExp(`("${escaped}"\\s*:\\s*")(${OPAQUE_FIELD_VALUE})(")`, "g");
34142
+ staged = staged.replace(re, (_m, open2, value, close) => {
34143
+ lifted.push(value);
34144
+ return `${open2}${opaquePlaceholder(lifted.length - 1)}${close}`;
34145
+ });
34146
+ }
34147
+ if (lifted.length === 0) return redact(text);
34148
+ let redacted = redact(staged);
34149
+ lifted.forEach((value, i) => {
34150
+ redacted = redacted.split(opaquePlaceholder(i)).join(value);
34151
+ });
34152
+ return redacted;
34153
+ }
34154
+ function augmentedPath() {
34155
+ const home = process.env.HOME;
34156
+ const candidates = [
34157
+ process.env.PATH ?? "",
34158
+ "/opt/homebrew/bin",
34159
+ "/usr/local/bin",
34160
+ home ? `${home}/.local/bin` : "",
34161
+ home ? `${home}/go/bin` : ""
34162
+ ];
34163
+ const seen = /* @__PURE__ */ new Set();
34164
+ const parts = [];
34165
+ for (const c of candidates) {
34166
+ if (!c) continue;
34167
+ for (const dir of c.split(delimiter)) {
34168
+ if (!dir || seen.has(dir)) continue;
34169
+ seen.add(dir);
34170
+ parts.push(dir);
34171
+ }
34172
+ }
34173
+ return parts.join(delimiter);
34174
+ }
34175
+ function formatTimeout(ms) {
34176
+ const seconds = Math.round(ms / 1e3);
34177
+ if (seconds >= 60) {
34178
+ const minutes = Math.round(seconds / 60);
34179
+ return `${ms}ms (${minutes} minute${minutes !== 1 ? "s" : ""})`;
34180
+ }
34181
+ return `${ms}ms`;
34182
+ }
34183
+ async function spawnWithTempFiles(args, opts) {
34184
+ const { mkdtemp, mkdir, writeFile, rm } = await import("node:fs/promises");
34185
+ const { tmpdir } = await import("node:os");
34186
+ const dir = await mkdtemp(join(tmpdir(), "gogcli-mcp-"));
34187
+ try {
34188
+ const argv = [];
34189
+ let seq = 0;
34190
+ for (const arg of args) {
34191
+ if (!isGogFileArg(arg)) {
34192
+ argv.push(arg);
34193
+ continue;
34194
+ }
34195
+ const sub = join(dir, String(seq));
34196
+ seq += 1;
34197
+ await mkdir(sub, { recursive: true, mode: 448 });
34198
+ const path = join(sub, arg.filename ?? `${arg.flag}.${arg.ext ?? "txt"}`);
34199
+ const data = arg.encoding === "base64" ? Buffer.from(arg.contents, "base64") : Buffer.from(arg.contents, "utf8");
34200
+ await writeFile(path, data, { mode: 384 });
34201
+ argv.push(arg.positional ? path : `--${arg.flag}=${path}`);
34202
+ }
34203
+ return await spawnGog(argv, opts);
34204
+ } finally {
34205
+ await rm(dir, { recursive: true, force: true }).catch(() => {
34206
+ });
34207
+ }
34208
+ }
34209
+ function spawnExecutor(args, opts) {
34210
+ if (args.some(isGogFileArg)) {
34211
+ return spawnWithTempFiles(args, opts);
34212
+ }
34213
+ return spawnGog(args, opts);
34214
+ }
34215
+ async function spawnGog(fullArgs, opts) {
34216
+ const { timeout, interactive = false, spawner, binary = false } = opts;
34217
+ const spawn = spawner ?? (await import("node:child_process")).spawn;
34218
+ const effectiveTimeout = timeout ?? TIMEOUT_MS;
34219
+ return new Promise((resolve, reject) => {
34220
+ const childEnv = { ...sanitizedEnv(), GOG_TIMEZONE: naiveSourceTimeZone(), PATH: augmentedPath() };
34221
+ const child = spawn(readEnvVar("GOG_PATH") ?? "gog", fullArgs, { env: childEnv });
34222
+ const stdoutChunks = [];
34223
+ const stderrChunks = [];
34224
+ let settled = false;
34225
+ const timer = setTimeout(() => {
34226
+ settled = true;
34227
+ child.kill();
34228
+ reject(new Error(`gog timed out after ${formatTimeout(effectiveTimeout)}`));
34229
+ }, effectiveTimeout);
34230
+ child.stdout.on("data", (chunk) => {
34231
+ stdoutChunks.push(chunk);
34232
+ });
34233
+ child.stderr.on("data", (chunk) => {
34234
+ stderrChunks.push(chunk);
34235
+ });
34236
+ child.on("close", (code) => {
34237
+ clearTimeout(timer);
34238
+ if (settled) return;
34239
+ settled = true;
34240
+ const stderr = Buffer.concat(stderrChunks).toString().trim();
34241
+ if (code === 0) {
34242
+ if (binary) {
34243
+ resolve(Buffer.concat(stdoutChunks).toString("base64"));
34244
+ return;
34245
+ }
34246
+ const stdout = Buffer.concat(stdoutChunks).toString();
34247
+ if (interactive && stderr) {
34248
+ resolve(stdout + "\n" + stderr);
34249
+ } else {
34250
+ resolve(stdout);
34251
+ }
34252
+ } else {
34253
+ reject(new Error(stderr || `gog exited with code ${code}`));
34254
+ }
34255
+ });
34256
+ child.on("error", (err) => {
34257
+ clearTimeout(timer);
34258
+ if (settled) return;
34259
+ settled = true;
34260
+ if (err.code === "ENOENT") {
34261
+ reject(new Error(
34262
+ "gog executable not found. Install gogcli (https://github.com/openclaw/gogcli) or set GOG_PATH in your MCP client config to the absolute binary path (run `which gog` in a terminal to find it)."
34263
+ ));
34264
+ return;
34265
+ }
34266
+ reject(err);
34267
+ });
34268
+ });
34269
+ }
34270
+ function assembleArgs(args, opts) {
34271
+ const effectiveAccount = opts.account ?? readEnvVar("GOG_ACCOUNT");
34272
+ const fullArgs = ["--json", "--color=never"];
34273
+ if (!opts.interactive) {
34274
+ fullArgs.push("--no-input");
34275
+ }
34276
+ if (opts.readonly || readonlyEnvEnabled()) {
34277
+ fullArgs.push("--readonly");
34278
+ }
34279
+ if (effectiveAccount) {
34280
+ fullArgs.push("--account", effectiveAccount);
34281
+ }
34282
+ fullArgs.push(...args);
34283
+ return fullArgs;
34284
+ }
34285
+ async function run(args, options = {}) {
34286
+ const { account, spawner, interactive = false, timeout, readonly: readonly2 = false, redactMode = "full", opaqueFields } = options;
34287
+ const base = redactMode === "tokens" ? redactGoogleTokens : redactSecrets2;
34288
+ const redact = opaqueFields?.length ? (text) => redactPreservingOpaqueFields(text, opaqueFields, base) : base;
34289
+ const fullArgs = assembleArgs(args, { account, interactive, readonly: readonly2 });
34290
+ try {
34291
+ return redact(await spawnExecutor(fullArgs, { timeout, interactive, spawner }));
34292
+ } catch (err) {
34293
+ throw new Error(base(err instanceof Error ? err.message : String(err)));
34294
+ }
34295
+ }
34296
+
34336
34297
  // ../gogcli-mcp/src/pagination.ts
34337
34298
  function detectIndent2(text) {
34338
34299
  const match = /\n(\s+)\S/.exec(text);
@@ -34429,14 +34390,6 @@ var AUTH_HINT = "\n\nAuthentication may have expired. Use gog_auth_add to re-aut
34429
34390
  var INVALID_GRANT_HINT = '\n\nThe stored refresh token was rejected (invalid_grant): it has expired or been revoked, so the whole account is signed out and re-authorization is required. The most common cause is the 7-day refresh-token limit Google applies to OAuth apps whose consent screen is still in "Testing" mode. Re-authorize with gog_auth_add (opens a browser) or gog_auth_add_url + gog_auth_add_complete (remote/headless). To stop this recurring, publish the OAuth consent screen to "In production" in the Google Cloud project that owns the OAuth client. Ask the user if they would like to re-authenticate.';
34430
34391
  var TRANSIENT_HINT = "\n\nThis error is often transient. Retry the same call before trying a different approach (do not fall back to smaller writes or row-by-row operations).";
34431
34392
  var GRID_LIMIT_HINT = "\n\nThe target range is outside the sheet's current grid. Add the missing rows or columns first with gog_sheets_insert (dimension: rows or cols), then retry the write.";
34432
- var RUNNER_TRANSPORT_AUTH_HINT = "\n\nThis is the CONNECTOR's own transport auth failing, not your Google sign-in. The gog-runner backend rejected the bearer token this server sent, so the request never reached gog and no Google credential was checked \u2014 the Google account is not the problem and re-authorizing it cannot fix this. An operator must make the Worker secret GOG_RUNNER_KEY equal RUNNER_KEY on the Fly app (wrangler secret put GOG_RUNNER_KEY / fly secrets set RUNNER_KEY), then retry.";
34433
- var RUNNER_TRANSPORT_HINTS = {
34434
- "transport-auth": RUNNER_TRANSPORT_AUTH_HINT,
34435
- // The request itself was malformed, so the runner will refuse it identically
34436
- // every time. Nothing to advise beyond the message the runner already gave.
34437
- "transport-request": "",
34438
- "transport-retryable": TRANSIENT_HINT
34439
- };
34440
34393
  function formatAccountList(raw) {
34441
34394
  try {
34442
34395
  const parsed = JSON.parse(raw);
@@ -34449,12 +34402,11 @@ function formatAccountList(raw) {
34449
34402
  }
34450
34403
  async function diagnose(err) {
34451
34404
  const errText = errorText(err);
34452
- const transportHint = isRunnerTransportError(err) ? RUNNER_TRANSPORT_HINTS[err.kind] : void 0;
34453
34405
  const isInvalidGrant = INVALID_GRANT_PATTERN.test(errText);
34454
34406
  const isTransientError = !DEFINITE_AUTH_PATTERN.test(errText) && TRANSIENT_ERROR_PATTERN.test(errText);
34455
34407
  const isAuthError = !isTransientError && AUTH_ERROR_PATTERN.test(errText);
34456
34408
  const isGridLimitError = GRID_LIMIT_ERROR_PATTERN.test(errText);
34457
- const hint = transportHint ?? (isInvalidGrant ? INVALID_GRANT_HINT : isAuthError ? AUTH_HINT : isTransientError ? TRANSIENT_HINT : isGridLimitError ? GRID_LIMIT_HINT : "");
34409
+ const hint = isInvalidGrant ? INVALID_GRANT_HINT : isAuthError ? AUTH_HINT : isTransientError ? TRANSIENT_HINT : isGridLimitError ? GRID_LIMIT_HINT : "";
34458
34410
  try {
34459
34411
  const accounts = formatAccountList(await run(["auth", "list"]));
34460
34412
  return errorResult(`${errText}
@@ -34515,8 +34467,8 @@ function formatOneAccountHealth(a, now) {
34515
34467
  const age = ageInDays(a.created_at, now);
34516
34468
  const ageStr = age === null ? "" : ` Authorized ${age.toFixed(1)} day(s) ago.`;
34517
34469
  if (a.valid === false) {
34518
- const cause2 = INVALID_GRANT_PATTERN.test(a.error ?? "") ? 'refresh token expired or revoked \u2014 commonly the 7-day limit on OAuth consent screens still in "Testing" mode' : a.error?.trim() || "unknown error";
34519
- return `\u2717 ${email3}: NEEDS RE-AUTH \u2014 ${cause2}.${ageStr} Re-authorize with gog_auth_add (browser) or gog_auth_add_url + gog_auth_add_complete (remote/headless).`;
34470
+ const cause = INVALID_GRANT_PATTERN.test(a.error ?? "") ? 'refresh token expired or revoked \u2014 commonly the 7-day limit on OAuth consent screens still in "Testing" mode' : a.error?.trim() || "unknown error";
34471
+ return `\u2717 ${email3}: NEEDS RE-AUTH \u2014 ${cause}.${ageStr} Re-authorize with gog_auth_add (browser) or gog_auth_add_url + gog_auth_add_complete (remote/headless).`;
34520
34472
  }
34521
34473
  if (a.valid === true) {
34522
34474
  let line = `\u2713 ${email3}: token valid.${ageStr}`;
@@ -34570,7 +34522,7 @@ function registerAuthToolsWith(server, defaultServices) {
34570
34522
  }
34571
34523
  });
34572
34524
  server.registerTool("gog_auth_health", {
34573
- description: 'Check the LIVE health of each stored Google account. Unlike gog_auth_status (which only reports keyring/config setup), this performs a real token refresh against Google, so it detects expired or revoked (invalid_grant) refresh tokens \u2014 the account-wide sign-out that blocks every service. Reports per account: whether the token is currently valid, the mapped cause when it is not, how long ago it was authorized, and a warning as it approaches the 7-day refresh-token limit that applies to OAuth apps whose consent screen is still in "Testing" mode. Run it proactively to re-authorize on your own schedule instead of mid-task. On the hosted connector this is the ONLY check that measures Google: a connector showing "connected" or "refreshed" has verified the connector key that reaches the gog machine, and nothing else \u2014 the Google credential lives on that machine and can be dead while the connection looks perfectly healthy.',
34525
+ description: `Check the LIVE health of each stored Google account. Unlike gog_auth_status (which only reports keyring/config setup), this performs a real token refresh against Google, so it detects expired or revoked (invalid_grant) refresh tokens \u2014 the account-wide sign-out that blocks every service. Reports per account: whether the token is currently valid, the mapped cause when it is not, how long ago it was authorized, and a warning as it approaches the 7-day refresh-token limit that applies to OAuth apps whose consent screen is still in "Testing" mode. Run it proactively to re-authorize on your own schedule instead of mid-task. On a hosted deployment this is the ONLY check that measures Google: a connector showing "connected" or "refreshed" has verified the client's connection to the MCP host, and nothing else \u2014 the Google credential lives in gog's keyring on that host and can be dead while the connection looks perfectly healthy.`,
34574
34526
  annotations: { readOnlyHint: true },
34575
34527
  inputSchema: external_exports.object({})
34576
34528
  }, async () => {
@@ -34612,7 +34564,7 @@ function registerAuthToolsWith(server, defaultServices) {
34612
34564
  }
34613
34565
  });
34614
34566
  server.registerTool("gog_auth_add_url", {
34615
- description: "Begin REMOTE/headless Google authorization (step 1 of 2). Returns a sign-in URL to open in any browser \u2014 no local server or terminal on the gogcli host is needed, so this works over the hosted connector where the interactive gog_auth_add cannot. Hand the URL to the user; after they sign in, the browser is redirected to a localhost URL that fails to load \u2014 that is expected. They copy that full redirected URL (from the address bar) and you pass it to gog_auth_add_complete. The link is valid for 10 minutes. If you pass a custom `services` here, pass the SAME value to gog_auth_add_complete or the second step will not match this one.",
34567
+ description: "Begin REMOTE/headless Google authorization (step 1 of 2). Returns a sign-in URL to open in any browser \u2014 no local server or terminal on the gogcli host is needed, so this works on a hosted deployment where the interactive gog_auth_add cannot. Hand the URL to the user; after they sign in, the browser is redirected to a localhost URL that fails to load \u2014 that is expected. They copy that full redirected URL (from the address bar) and you pass it to gog_auth_add_complete. The link is valid for 10 minutes. If you pass a custom `services` here, pass the SAME value to gog_auth_add_complete or the second step will not match this one.",
34616
34568
  inputSchema: external_exports.object({
34617
34569
  email: external_exports.string().describe("Google account email to authorize"),
34618
34570
  services: external_exports.string().optional().default(defaultServices).describe(servicesDescribe),
@@ -34686,9 +34638,9 @@ var reminderParams = {
34686
34638
 
34687
34639
  // ../gogcli-mcp/src/attachments.ts
34688
34640
  var MAX_INLINE_ATTACHMENT_BYTES = 8 * 1024 * 1024;
34689
- var RUNNER_MAX_BODY_BYTES = 32 * 1024 * 1024;
34690
- var RUNNER_BODY_JSON_RESERVE_BYTES = 256 * 1024;
34691
- var MAX_REQUEST_PAYLOAD_WIRE_BYTES = RUNNER_MAX_BODY_BYTES - RUNNER_BODY_JSON_RESERVE_BYTES;
34641
+ var REQUEST_MAX_BODY_BYTES = 32 * 1024 * 1024;
34642
+ var REQUEST_BODY_JSON_RESERVE_BYTES = 256 * 1024;
34643
+ var MAX_REQUEST_PAYLOAD_WIRE_BYTES = REQUEST_MAX_BODY_BYTES - REQUEST_BODY_JSON_RESERVE_BYTES;
34692
34644
  var MAX_INLINE_ATTACHMENT_TOTAL_BYTES = Math.floor(MAX_REQUEST_PAYLOAD_WIRE_BYTES * 3 / 4);
34693
34645
  var formatMiB = (bytes) => `${Math.floor(bytes / (1024 * 1024))} MiB`;
34694
34646
  var INLINE_ATTACHMENT_LIMITS_TEXT = `up to ${formatMiB(MAX_INLINE_ATTACHMENT_BYTES)} per file and ${formatMiB(MAX_INLINE_ATTACHMENT_TOTAL_BYTES)} in total`;
@@ -34701,7 +34653,7 @@ var inlineAttachmentSchema = external_exports.object({
34701
34653
  )
34702
34654
  });
34703
34655
  var attachInlineParam = external_exports.array(inlineAttachmentSchema).optional().describe(
34704
- `Attachments supplied as BYTES rather than as server-side paths \u2014 use this whenever you hold a file and the gog server does not, which is always the case on the hosted connector and on any remote deployment. Each entry is {filename, contentBase64} (${INLINE_ATTACHMENT_LIMITS_TEXT}). Can be combined with \`attach\`: the two name disjoint files (paths read on the server vs. bytes sent with the call), and both end up as ordinary attachments on the message.`
34656
+ `Attachments supplied as BYTES rather than as server-side paths \u2014 use this whenever you hold a file and the gog server does not, which is always the case on a hosted deployment (e.g. mcp-host). Each entry is {filename, contentBase64} (${INLINE_ATTACHMENT_LIMITS_TEXT}). Can be combined with \`attach\`: the two name disjoint files (paths read on the server vs. bytes sent with the call), and both end up as ordinary attachments on the message.`
34705
34657
  );
34706
34658
 
34707
34659
  // ../gogcli-mcp/src/tools/contacts.ts
@@ -34771,7 +34723,7 @@ var replySchema = {
34771
34723
  remove: external_exports.array(external_exports.string()).optional().describe("Remove these recipients from all fields (repeatable) \u2014 e.g. to drop someone from a reply-all."),
34772
34724
  subject: external_exports.string().optional().describe('Override reply subject (default: "Re: <original>"). A changed subject starts a NEW Gmail thread.'),
34773
34725
  noQuote: external_exports.boolean().optional().describe("Do not include the original message quoted below the reply (default: the original is quoted)"),
34774
- attach: external_exports.array(external_exports.string()).optional().describe(`File paths to attach (repeatable), resolved ON THE GOG SERVER's filesystem \u2014 NOT this client's. Only usable when gog runs on the same machine you do (local stdio); on the hosted connector or any GOG_RUNNER_URL backend these paths do not exist and the call fails with "no such file or directory" \u2014 use attachInline there. Read on the server, base64-encoded with a MIME type inferred from the extension.`),
34726
+ attach: external_exports.array(external_exports.string()).optional().describe(`File paths to attach (repeatable), resolved ON THE GOG SERVER's filesystem \u2014 NOT this client's. Only usable when gog runs on the same machine you do (local stdio); on a hosted deployment (e.g. mcp-host) these paths do not exist and the call fails with "no such file or directory" \u2014 use attachInline there. Read on the server, base64-encoded with a MIME type inferred from the extension.`),
34775
34727
  attachInline: attachInlineParam,
34776
34728
  from: external_exports.string().optional().describe("Send from this email address (must be a verified send-as alias)"),
34777
34729
  autoFromAddressedAlias: external_exports.boolean().optional().describe("When from is omitted, send from the verified send-as alias the original message was addressed TO, instead of the account's primary address \u2014 so a reply to mail sent to an alias goes back out from that alias. Ignored when from is set."),
@@ -34792,490 +34744,70 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
34792
34744
  );
34793
34745
 
34794
34746
  // ../gogcli-mcp/src/server.ts
34795
- var VERSION = true ? "3.0.0" : "0.0.0";
34747
+ var VERSION = true ? "4.0.1" : "0.0.0";
34796
34748
 
34797
- // ../gogcli-mcp/src/auth-log.ts
34798
- var FAILURES = /* @__PURE__ */ new Set([
34799
- "token.mint-failed",
34800
- "grant.dead",
34801
- "replay.failed",
34802
- "runner.auth-failed",
34803
- "connect.key-rejected",
34804
- // An enrolment that could not proceed is a failure even though nobody is at
34805
- // fault: it is the only trace a half-enrolled connector leaves behind, and
34806
- // the absence of exactly this record is why DEFECT 4 could not be explained.
34807
- "connect.runner-unreachable",
34808
- "connect.google-unhealthy",
34809
- "refusal.google-unhealthy",
34810
- // The loudest record on this branch, and the only one that means "we cannot
34811
- // explain this". Google refused a real call while a live check of the same
34812
- // credential, taken seconds later, succeeded — so neither the 7-day cliff nor
34813
- // a revoked grant accounts for it. It is filed as a failure precisely because
34814
- // it is the record nobody may scroll past: it is the only evidence that could
34815
- // ever justify building something on the hosted path, and its absence over
34816
- // time is what retires that theory for good.
34817
- "refusal.google-ok"
34818
- ]);
34819
- var PREFIX = "gog-auth ";
34820
- var TAG_CHARS = 12;
34821
- function credentialTag(cacheKeyHash) {
34822
- return cacheKeyHash.slice(0, TAG_CHARS);
34823
- }
34824
- function logAuthTransition(event, context) {
34825
- const record2 = JSON.stringify({ at: (/* @__PURE__ */ new Date()).toISOString(), event, ...context });
34826
- const write = FAILURES.has(event) ? console.error : console.warn;
34827
- write(PREFIX + redactSecrets2(record2));
34828
- }
34829
-
34830
- // ../gogcli-mcp/src/google-token.ts
34831
- var TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token";
34832
- var EXPIRY_MARGIN_MS = 12e4;
34833
- var cache = /* @__PURE__ */ new Map();
34834
- var inFlight = /* @__PURE__ */ new Map();
34835
- async function cacheKey(refreshToken, clientId) {
34836
- const data = new TextEncoder().encode(`${clientId}\0${refreshToken}`);
34837
- const digest = await crypto.subtle.digest("SHA-256", data);
34838
- return Array.from(new Uint8Array(digest), (b) => b.toString(16).padStart(2, "0")).join("");
34839
- }
34840
- function makeAccessTokenSource(env) {
34841
- const direct = readEnvVar("GOG_ACCESS_TOKEN", { env });
34842
- if (direct) return async () => direct;
34843
- const refreshToken = readEnvVar("GOG_REFRESH_TOKEN", { env });
34844
- if (!refreshToken) return void 0;
34845
- const clientId = readEnvVar("GOG_CLIENT_ID", { env });
34846
- const clientSecret = readEnvVar("GOG_CLIENT_SECRET", { env });
34847
- if (!clientId || !clientSecret) {
34848
- const missing = [!clientId && "GOG_CLIENT_ID", !clientSecret && "GOG_CLIENT_SECRET"].filter(Boolean).join(" and ");
34849
- return async () => {
34850
- throw new Error(
34851
- `GOG_REFRESH_TOKEN is set but ${missing} is not, so no access token can be minted. Set the OAuth client alongside the refresh token, or unset GOG_REFRESH_TOKEN to use the backend\u2019s own identity.`
34852
- );
34853
- };
34854
- }
34855
- let keyPromise;
34856
- const key = () => keyPromise ??= cacheKey(refreshToken, clientId);
34857
- const logCacheHits = parseBoolEnv("GOG_AUTH_LOG_CACHE_HITS", { env });
34858
- const read = async () => {
34859
- const k = await key();
34860
- const hit = cache.get(k);
34861
- if (hit && hit.expiresAt - EXPIRY_MARGIN_MS > Date.now()) {
34862
- if (logCacheHits) logAuthTransition("token.cache-hit", { credential: credentialTag(k) });
34863
- return hit.accessToken;
34864
- }
34865
- let pending = inFlight.get(k);
34866
- if (!pending) {
34867
- pending = exchange(refreshToken, clientId, clientSecret).then((minted2) => {
34868
- cache.set(k, minted2);
34869
- logAuthTransition("token.minted", {
34870
- credential: credentialTag(k),
34871
- reason: `valid for ${Math.round((minted2.expiresAt - Date.now()) / 1e3)}s`
34872
- });
34873
- return minted2;
34874
- }).catch((err) => {
34875
- logAuthTransition(err.grantDead ? "grant.dead" : "token.mint-failed", {
34876
- credential: credentialTag(k),
34877
- reason: err.message
34878
- });
34879
- throw err;
34880
- }).finally(() => inFlight.delete(k));
34881
- inFlight.set(k, pending);
34882
- }
34883
- const minted = await pending;
34884
- return minted.accessToken;
34885
- };
34886
- const invalidate = async (rejected) => {
34887
- const k = await key();
34888
- const hit = cache.get(k);
34889
- if (!hit || hit.accessToken !== rejected) {
34890
- logAuthTransition("token.evict-noop", {
34891
- credential: credentialTag(k),
34892
- reason: hit ? "a concurrent caller had already replaced this credential\u2019s token" : "no token was cached for this credential"
34893
- });
34894
- return false;
34895
- }
34896
- cache.delete(k);
34897
- logAuthTransition("token.evicted", {
34898
- credential: credentialTag(k),
34899
- reason: "Google rejected this access token; the next read will mint a new one"
34900
- });
34901
- return true;
34902
- };
34903
- return Object.assign(read, {
34904
- invalidate,
34905
- credentialId: async () => credentialTag(await key())
34906
- });
34907
- }
34908
- var TokenExchangeError = class extends Error {
34909
- /**
34910
- * The REFRESH token is dead (Google's `invalid_grant`), not merely the access
34911
- * token. Carried as a flag rather than re-read from the message, because
34912
- * inferring the author of a failure from prose several authors can produce is
34913
- * precisely the mistake this branch exists to undo. `instanceof` is safe: the
34914
- * class is thrown and caught inside this one module.
34915
- */
34916
- grantDead;
34917
- constructor(message, grantDead) {
34918
- super(message);
34919
- this.grantDead = grantDead;
34920
- }
34749
+ // ../gogcli-mcp/src/bootstrap-auth.ts
34750
+ import { join as join2 } from "node:path";
34751
+ var AUTH_BOOTSTRAP_MARKER = "auth-bootstrap.sha256";
34752
+ var VARS = ["GOG_CLIENT_ID", "GOG_CLIENT_SECRET", "GOG_REFRESH_TOKEN", "GOG_ACCOUNT"];
34753
+ var log = (line) => {
34754
+ process.stderr.write(`[gogcli-mcp] auth bootstrap: ${line}
34755
+ `);
34921
34756
  };
34922
- async function exchange(refreshToken, clientId, clientSecret) {
34923
- let res;
34757
+ var jsonFile = (name, payload) => ({
34758
+ kind: "file",
34759
+ flag: name,
34760
+ ext: "json",
34761
+ contents: JSON.stringify(payload),
34762
+ positional: true
34763
+ });
34764
+ async function accountListed(account, spawner) {
34924
34765
  try {
34925
- res = await fetch(TOKEN_ENDPOINT, {
34926
- method: "POST",
34927
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
34928
- body: new URLSearchParams({
34929
- grant_type: "refresh_token",
34930
- refresh_token: refreshToken,
34931
- client_id: clientId,
34932
- client_secret: clientSecret
34933
- }).toString()
34934
- });
34935
- } catch (err) {
34936
- throw new TokenExchangeError(
34937
- `the Google token exchange could not be reached: ${err instanceof Error ? err.message : String(err)}`,
34938
- false
34939
- );
34940
- }
34941
- const body = await res.json().catch(() => ({}));
34942
- if (!res.ok) {
34943
- if (body.error === "invalid_grant") {
34944
- throw new TokenExchangeError(
34945
- 'the stored refresh token was rejected (invalid_grant): it has expired or been revoked, so this account must be re-authorized (commonly the 7-day limit on OAuth consent screens still in "Testing" mode). Re-enrol with gog_auth_add_url + gog_auth_add_complete and store the new refresh token.',
34946
- true
34947
- );
34948
- }
34949
- throw new TokenExchangeError(
34950
- `the access token could not be refreshed (HTTP ${res.status}${body.error ? `, ${body.error}` : ""})`,
34951
- false
34952
- );
34953
- }
34954
- if (!body.access_token) {
34955
- throw new TokenExchangeError(
34956
- "the access token could not be refreshed: Google returned no access_token",
34957
- false
34958
- );
34959
- }
34960
- const expiresInMs = (body.expires_in ?? 3600) * 1e3;
34961
- return { accessToken: body.access_token, expiresAt: Date.now() + expiresInMs };
34962
- }
34963
-
34964
- // ../gogcli-mcp/src/google-probe.ts
34965
- var bool = (value) => typeof value === "boolean" ? value : void 0;
34966
- var cause = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
34967
- function readGoogleProbe(body) {
34968
- const record2 = typeof body === "object" && body !== null ? body : {};
34969
- const measured = bool(record2.measured);
34970
- const reported = cause(record2.error);
34971
- if (measured === false) {
34972
- return {
34973
- kind: "unmeasured",
34974
- reason: reported ?? "the runner reported it could not measure the Google layer"
34975
- };
34976
- }
34977
- if (measured === true) {
34978
- if (bool(record2.ok) === true) return { kind: "ok" };
34979
- return {
34980
- kind: "unhealthy",
34981
- reason: reported ?? "the runner reported the Google layer unhealthy with no cause"
34982
- };
34766
+ const out = await run(["auth", "list"], { spawner, account });
34767
+ const accounts = JSON.parse(out).accounts ?? [];
34768
+ return accounts.some((a) => a.email?.toLowerCase() === account.toLowerCase());
34769
+ } catch {
34770
+ return false;
34983
34771
  }
34984
- return {
34985
- kind: "unmeasured",
34986
- reason: reported ? `the runner did not report whether it measured the Google layer; it said: ${reported}` : "the runner did not report whether it measured the Google layer"
34987
- };
34988
34772
  }
34989
-
34990
- // ../gogcli-mcp/src/connector-runtime.ts
34991
- var DEFAULT_TIMEOUT_MS = 3e4;
34992
- var DEADLINE_GRACE_MS = 5e3;
34993
- var MIN_REPLAY_BUDGET_MS = 1e3;
34994
- var REFUSAL_PROBE_TIMEOUT_MS = 4e3;
34995
- var MIN_PROBE_BUDGET_MS = 1e3;
34996
- var PROBE_INTERVAL_MS = 6e4;
34997
- var RUNNER_GOG_FAILED = 422;
34998
- var RUNNER_DRAINING = 503;
34999
- var RUNNER_BAD_REQUEST = 400;
35000
- var RUNNER_BAD_KEY = 401;
35001
- var GogFailedError = class extends Error {
35002
- /** gog's stderr alone, with no echoed argv mixed in. */
35003
- stderr;
35004
- constructor(message, stderr) {
35005
- super(message);
35006
- this.stderr = stderr;
35007
- }
35008
- };
35009
- var GOOGLE_TOKEN_REJECTED_PATTERN = /Google API error \(401\b|invalid[ _]authentication[ _]credentials|\bACCESS_TOKEN_EXPIRED\b|\binvalid_token\b/i;
35010
- var REFRESH_TOKEN_DEAD_PATTERN = /\binvalid_grant\b/i;
35011
- var READ_ONLY_SUBCOMMANDS = /* @__PURE__ */ new Set([
35012
- "cat",
35013
- "describe",
35014
- "get",
35015
- "info",
35016
- "list",
35017
- "list-slides",
35018
- "ls",
35019
- "metadata",
35020
- "read-slide",
35021
- "search",
35022
- "services",
35023
- "status",
35024
- "structure"
35025
- ]);
35026
- function gogTarget(args) {
35027
- const words = args.filter((arg) => typeof arg === "string");
35028
- let service;
35029
- for (let i = 0; i < words.length; i += 1) {
35030
- const word = words[i];
35031
- if (word.startsWith("-")) {
35032
- if (word === "--account") i += 1;
35033
- continue;
35034
- }
35035
- if (service === void 0) {
35036
- service = word;
35037
- continue;
35038
- }
35039
- return { service, subcommand: word };
35040
- }
35041
- return { service };
35042
- }
35043
- async function remintAfterGoogleRejection(err, used, args, readAccessToken, deadlineAt, probeGoogle) {
35044
- if (!(err instanceof GogFailedError)) return void 0;
35045
- const grantDead = REFRESH_TOKEN_DEAD_PATTERN.test(err.stderr);
35046
- if (!grantDead && !GOOGLE_TOKEN_REJECTED_PATTERN.test(err.stderr)) return void 0;
35047
- const { service, subcommand } = gogTarget(args);
35048
- const credential = await readAccessToken?.credentialId?.();
35049
- const where = { credential, service };
35050
- if (grantDead) {
35051
- logAuthTransition("grant.dead", {
35052
- ...where,
35053
- reason: "gog reported invalid_grant: the stored refresh token is dead, so no token can be minted and this account must be re-authorized"
35054
- });
35055
- return void 0;
35056
- }
35057
- if (!used) {
35058
- await probeGoogle(where);
35059
- logAuthTransition("replay.declined", {
35060
- ...where,
35061
- reason: "no access token was supplied with the call, so gog acted as the backend volume\u2019s own identity"
35062
- });
35063
- return void 0;
35064
- }
35065
- if (!readAccessToken?.invalidate) {
35066
- logAuthTransition("replay.declined", {
35067
- ...where,
35068
- reason: "this token source cannot mint a replacement, so a replay would resend the rejected token"
35069
- });
35070
- return void 0;
35071
- }
35072
- const evicted = await readAccessToken.invalidate(used);
35073
- if (subcommand === void 0 || !READ_ONLY_SUBCOMMANDS.has(subcommand)) {
35074
- logAuthTransition("replay.declined", {
35075
- ...where,
35076
- reason: `not replayable: '${subcommand ?? "(none)"}' is not a known read-only subcommand and a write could double-apply`
35077
- });
35078
- return void 0;
35079
- }
35080
- if (!evicted) {
35081
- logAuthTransition("replay.declined", {
35082
- ...where,
35083
- reason: "the rejected token was already superseded, so the cache holds the token a replay would send"
35084
- });
35085
- return void 0;
35086
- }
35087
- const fresh = await readAccessToken();
35088
- if (!fresh) {
35089
- logAuthTransition("replay.declined", {
35090
- ...where,
35091
- reason: "the token source produced no token after eviction; replaying without one would act as the backend"
35092
- });
35093
- return void 0;
34773
+ async function bootstrapGogAuth(env = process.env, options = {}) {
34774
+ const values = VARS.map((key) => readEnvVar(key, { env }));
34775
+ const missing = VARS.filter((_key, i) => values[i] === void 0);
34776
+ if (missing.length === VARS.length) return "unconfigured";
34777
+ if (missing.length > 0) {
34778
+ log(`skipped, missing ${missing.join(", ")}`);
34779
+ return "incomplete";
35094
34780
  }
35095
- const budgetMs = deadlineAt - Date.now();
35096
- if (budgetMs < MIN_REPLAY_BUDGET_MS) {
35097
- logAuthTransition("replay.declined", {
35098
- ...where,
35099
- reason: `only ${budgetMs}ms of the call\u2019s deadline remained, so a replay could only time out; the rejected token was evicted, so the next call mints a fresh one`
35100
- });
35101
- return void 0;
35102
- }
35103
- return { token: fresh, budgetMs, invalidate: readAccessToken.invalidate, ...where };
35104
- }
35105
- function makeFlyExecutor(endpoint, key, readAccessToken) {
35106
- let lastProbeAt = Number.NEGATIVE_INFINITY;
35107
- const probeGoogleAfterRefusal = async (where, deadlineAt) => {
35108
- const record2 = { ...where, endpoint };
35109
- const now = Date.now();
35110
- const remainingMs = deadlineAt - now;
35111
- if (remainingMs < MIN_PROBE_BUDGET_MS) {
35112
- logAuthTransition("refusal.google-unmeasured", {
35113
- ...record2,
35114
- reason: `only ${remainingMs}ms of the call\u2019s deadline remained, so the Google layer was not measured rather than delay the caller\u2019s own error`
35115
- });
35116
- return;
35117
- }
35118
- if (now - lastProbeAt < PROBE_INTERVAL_MS) {
35119
- logAuthTransition("refusal.google-unmeasured", {
35120
- ...record2,
35121
- // "attempted", not "measured". `lastProbeAt` is stamped before the
35122
- // fetch and is deliberately NOT reset when the probe comes back with no
35123
- // verdict (a 404 from a runner too old to have the endpoint, a timeout,
35124
- // a dead socket) — the backend cost this throttle exists to bound was
35125
- // paid either way, and resetting it would let a retry loop storm a
35126
- // runner that is already unwell. So the timestamp stays and the sentence
35127
- // has to be the true one: on this branch a log line may not assert a
35128
- // measurement that never happened, and the previous probe may well have
35129
- // measured nothing at all.
35130
- reason: "a Google probe was attempted recently, so another was not sent: this probe spawns gog on the backend and takes the keyring\u2019s exclusive lock"
35131
- });
35132
- return;
35133
- }
35134
- lastProbeAt = now;
35135
- let event;
35136
- let reason;
35137
- try {
35138
- const res = await fetch(`${endpoint}/health/google`, {
35139
- headers: { Authorization: `Bearer ${key}` },
35140
- // Never more than the probe's own budget, never more than the call has
35141
- // left. `Math.min` rather than a plain constant because the second
35142
- // bound is the caller's, and it outranks ours.
35143
- signal: AbortSignal.timeout(Math.min(REFUSAL_PROBE_TIMEOUT_MS, remainingMs))
35144
- });
35145
- if (!res.ok) {
35146
- event = "refusal.google-unmeasured";
35147
- reason = `the runner did not answer the Google probe (HTTP ${res.status})`;
35148
- } else {
35149
- const verdict = readGoogleProbe(await res.json());
35150
- if (verdict.kind === "ok") {
35151
- event = "refusal.google-ok";
35152
- reason = "Google refused this call, yet a live token check on the same volume succeeded \u2014 so a dead or expired refresh token does not explain this refusal";
35153
- } else {
35154
- event = verdict.kind === "unhealthy" ? "refusal.google-unhealthy" : "refusal.google-unmeasured";
35155
- reason = verdict.reason;
35156
- }
35157
- }
35158
- } catch (err) {
35159
- event = "refusal.google-unmeasured";
35160
- reason = err instanceof Error ? err.message : String(err);
35161
- }
35162
- logAuthTransition(event, { ...record2, reason });
35163
- };
35164
- return async (args, opts) => {
35165
- const deadlineMs = (opts?.timeout ?? DEFAULT_TIMEOUT_MS) + DEADLINE_GRACE_MS;
35166
- const accessToken = await readAccessToken?.();
35167
- const deadlineAt = Date.now() + deadlineMs;
35168
- try {
35169
- return await attempt(endpoint, key, args, accessToken, deadlineMs);
35170
- } catch (err) {
35171
- const replay = await remintAfterGoogleRejection(
35172
- err,
35173
- accessToken,
35174
- args,
35175
- readAccessToken,
35176
- deadlineAt,
35177
- (where2) => probeGoogleAfterRefusal(where2, deadlineAt)
35178
- );
35179
- if (replay === void 0) throw err;
35180
- const where = { credential: replay.credential, service: replay.service, endpoint };
35181
- logAuthTransition("replay.attempted", {
35182
- ...where,
35183
- reason: "Google rejected the access token; replaying this read once with a freshly minted one"
35184
- });
35185
- try {
35186
- const stdout = await attempt(endpoint, key, args, replay.token, replay.budgetMs);
35187
- logAuthTransition("replay.succeeded", where);
35188
- return stdout;
35189
- } catch (replayErr) {
35190
- logAuthTransition("replay.failed", { ...where, reason: String(replayErr) });
35191
- if (replayErr instanceof GogFailedError && GOOGLE_TOKEN_REJECTED_PATTERN.test(replayErr.stderr)) {
35192
- await replay.invalidate(replay.token);
35193
- }
35194
- throw replayErr;
35195
- }
35196
- }
35197
- };
35198
- }
35199
- async function attempt(endpoint, key, args, accessToken, deadlineMs) {
35200
- let res;
34781
+ const [clientId, clientSecret, refreshToken, account] = values;
34782
+ const { spawner } = options;
35201
34783
  try {
35202
- res = await fetch(endpoint + "/run", {
35203
- method: "POST",
35204
- headers: {
35205
- Authorization: "Bearer " + key,
35206
- "Content-Type": "application/json"
35207
- },
35208
- body: JSON.stringify(accessToken ? { args, accessToken } : { args }),
35209
- signal: AbortSignal.timeout(deadlineMs)
35210
- });
35211
- } catch (err) {
35212
- const name = err instanceof Error ? err.name : "";
35213
- if (name === "TimeoutError" || name === "AbortError") {
35214
- throw new RunnerTransportError(
35215
- `gog-runner did not respond within ${deadlineMs}ms (${endpoint}) \u2014 the Fly backend may be cold or wedged`,
35216
- "transport-retryable"
35217
- );
35218
- }
35219
- throw err;
35220
- }
35221
- if (!res.ok) {
35222
- const body = await res.json().catch(() => null);
35223
- const detail = body && typeof body.error === "string" ? body.stderr && body.stderr.trim() && body.stderr.trim() !== body.error.trim() ? `${body.error}
35224
- ${body.stderr}` : body.error : "";
35225
- if (res.status === RUNNER_GOG_FAILED) {
35226
- throw new GogFailedError(
35227
- detail || "gog failed on the runner (no detail supplied)",
35228
- typeof body?.stderr === "string" ? body.stderr : ""
35229
- );
35230
- }
35231
- if (res.status === RUNNER_BAD_KEY) {
35232
- logAuthTransition("runner.auth-failed", {
35233
- service: gogTarget(args).service,
35234
- endpoint,
35235
- reason: "the gog-runner rejected the connector\u2019s bearer token, so gog never ran and no Google credential was read; GOG_RUNNER_KEY does not match the Fly app\u2019s RUNNER_KEY"
35236
- });
35237
- throw new RunnerTransportError(
35238
- "gog-runner rejected the connector's bearer token, so the request never reached gog and no Google credential was involved. The Worker secret GOG_RUNNER_KEY no longer matches RUNNER_KEY on the Fly app; set them to the same value (wrangler secret put GOG_RUNNER_KEY / fly secrets set RUNNER_KEY) and retry.",
35239
- "transport-auth",
35240
- res.status
35241
- );
35242
- }
35243
- if (res.status === RUNNER_BAD_REQUEST) {
35244
- throw new RunnerTransportError(
35245
- detail || "gog-runner rejected the request (no detail supplied)",
35246
- "transport-request",
35247
- res.status
35248
- );
35249
- }
35250
- if (res.status === RUNNER_DRAINING || body?.retryable === true) {
35251
- throw new RunnerTransportError(
35252
- `gog-runner is restarting; retry this call.${detail ? ` ${detail}` : ""}`,
35253
- "transport-retryable",
35254
- res.status
35255
- );
35256
- }
35257
- if (detail) {
35258
- throw new Error(detail);
35259
- }
35260
- throw new RunnerTransportError(
35261
- `gog-runner HTTP ${res.status}: the response did not come from the runner, so the request never reached gog. The backend Machine was most likely starting or shutting down \u2014 this is transient, retry the same call.`,
35262
- "transport-retryable",
35263
- res.status
34784
+ const { createHash } = await import("node:crypto");
34785
+ const { mkdir, readFile, writeFile, chmod } = await import("node:fs/promises");
34786
+ const home = options.home ?? (await import("node:os")).homedir();
34787
+ const dir = join2(home, ".gogcli-mcp");
34788
+ const marker = join2(dir, AUTH_BOOTSTRAP_MARKER);
34789
+ const fingerprint = createHash("sha256").update(values.join("\0")).digest("hex");
34790
+ const previous = await readFile(marker, "utf8").catch(() => void 0);
34791
+ if (previous === fingerprint && await accountListed(account, spawner)) return "present";
34792
+ await run(
34793
+ ["auth", "credentials", "set", jsonFile("credentials", { installed: { client_id: clientId, client_secret: clientSecret } })],
34794
+ { spawner, account }
35264
34795
  );
34796
+ await run(
34797
+ ["auth", "tokens", "import", jsonFile("token", { email: account, refresh_token: refreshToken })],
34798
+ { spawner, account }
34799
+ );
34800
+ await mkdir(dir, { recursive: true, mode: 448 });
34801
+ await chmod(dir, 448);
34802
+ await writeFile(marker, fingerprint, { mode: 384 });
34803
+ await chmod(marker, 384);
34804
+ return "imported";
34805
+ } catch (err) {
34806
+ let message = redactSecrets2(errorText(err));
34807
+ for (const value of [clientSecret, refreshToken]) message = message.split(value).join("[REDACTED]");
34808
+ log(`failed, ${message}`);
34809
+ return "failed";
35265
34810
  }
35266
- const { stdout } = await res.json();
35267
- return stdout;
35268
- }
35269
-
35270
- // ../gogcli-mcp/src/remote-runner.ts
35271
- function useRemoteGogRunner(env = process.env) {
35272
- const endpoint = readEnvVar("GOG_RUNNER_URL", { env });
35273
- const key = readEnvVar("GOG_RUNNER_KEY", { env });
35274
- if (!endpoint || !key) return false;
35275
- setDefaultGogExecutor(
35276
- makeFlyExecutor(endpoint.replace(/\/+$/, ""), key, makeAccessTokenSource(env))
35277
- );
35278
- return true;
35279
34811
  }
35280
34812
 
35281
34813
  // ../gogcli-mcp/src/blob-urls.ts
@@ -35283,6 +34815,9 @@ var BLOB_URL_MAX_TTL_MS = 24 * 60 * 60 * 1e3;
35283
34815
  var BLOB_URL_CEILING_MARGIN_MS = 60 * 1e3;
35284
34816
  var BLOB_URL_DEFAULT_TTL_MS = 60 * 60 * 1e3;
35285
34817
 
34818
+ // ../gogcli-mcp/src/blob-upload.ts
34819
+ var MAX_BLOB_UPLOAD_BYTES = 100 * 1024 * 1024;
34820
+
35286
34821
  // src/tools/contacts-extra.ts
35287
34822
  function registerExtraContactsTools(server) {
35288
34823
  server.registerTool("gog_people_me", {
@@ -35491,7 +35026,7 @@ function registerExtraContactsTools(server) {
35491
35026
  }
35492
35027
 
35493
35028
  // src/index.ts
35494
- useRemoteGogRunner();
35029
+ await bootstrapGogAuth();
35495
35030
  await runMcp({
35496
35031
  name: "gogcli-contacts",
35497
35032
  version: VERSION,