@honcho-ai/claude-honcho 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +95 -12
  3. package/dist/chunk-1nsms6f4.js +50 -0
  4. package/dist/chunk-1nsms6f4.js.map +10 -0
  5. package/dist/{chunk-jr0fd6n2.js → chunk-1xa1wr00.js} +2 -2
  6. package/dist/{chunk-9pntsn3x.js → chunk-43gww8dc.js} +1 -1
  7. package/dist/chunk-81cb25yy.js +35 -0
  8. package/dist/{chunk-6yybt92z.js.map → chunk-81cb25yy.js.map} +1 -1
  9. package/dist/{chunk-yfrrc1d5.js → chunk-acwn3613.js} +64 -106
  10. package/dist/chunk-acwn3613.js.map +13 -0
  11. package/dist/{chunk-49wja30f.js → chunk-d99xh4kg.js} +1 -1
  12. package/dist/{chunk-xdntcesh.js → chunk-g0m354bn.js} +758 -210
  13. package/dist/{chunk-xdntcesh.js.map → chunk-g0m354bn.js.map} +8 -4
  14. package/dist/{chunk-4ryv9310.js → chunk-mm5vjhpr.js} +240 -210
  15. package/dist/{chunk-4ryv9310.js.map → chunk-mm5vjhpr.js.map} +2 -2
  16. package/dist/{chunk-d2gc13m0.js → chunk-pdnbydfe.js} +10 -12
  17. package/dist/{chunk-d2gc13m0.js.map → chunk-pdnbydfe.js.map} +2 -2
  18. package/dist/{chunk-xtdvbfxw.js → chunk-qp4ng9m0.js} +6 -6
  19. package/dist/{chunk-xtdvbfxw.js.map → chunk-qp4ng9m0.js.map} +2 -2
  20. package/dist/{chunk-4zgbdwm4.js → chunk-w3tnmcx7.js} +6 -6
  21. package/dist/{chunk-4zgbdwm4.js.map → chunk-w3tnmcx7.js.map} +1 -1
  22. package/dist/hooks/post-tool-use.js +22 -21
  23. package/dist/hooks/post-tool-use.js.map +3 -3
  24. package/dist/hooks/pre-compact.js +21 -65
  25. package/dist/hooks/pre-compact.js.map +3 -4
  26. package/dist/hooks/pre-tool-honcho.js +5 -5
  27. package/dist/hooks/pre-tool-honcho.js.map +1 -1
  28. package/dist/hooks/save-user-message.js +45 -27
  29. package/dist/hooks/save-user-message.js.map +4 -3
  30. package/dist/hooks/session-end.js +13 -13
  31. package/dist/hooks/session-end.js.map +2 -2
  32. package/dist/hooks/session-start.js +38 -38
  33. package/dist/hooks/session-start.js.map +2 -2
  34. package/dist/hooks/stop.js +20 -20
  35. package/dist/hooks/stop.js.map +1 -1
  36. package/dist/hooks/user-prompt.js +367 -10
  37. package/dist/hooks/user-prompt.js.map +5 -3
  38. package/dist/mcp-server.js +550 -739
  39. package/dist/mcp-server.js.map +3 -3
  40. package/dist/skills/backfill-runner.js +545 -47
  41. package/dist/skills/backfill-runner.js.map +9 -4
  42. package/dist/skills/setup-runner.js +47 -194
  43. package/dist/skills/setup-runner.js.map +4 -6
  44. package/dist/skills/status-runner.js +16 -17
  45. package/dist/skills/status-runner.js.map +2 -2
  46. package/package.json +1 -1
  47. package/dist/chunk-084dpgp3.js +0 -556
  48. package/dist/chunk-084dpgp3.js.map +0 -10
  49. package/dist/chunk-6yybt92z.js +0 -106
  50. package/dist/chunk-dxbm7kmf.js +0 -331
  51. package/dist/chunk-dxbm7kmf.js.map +0 -10
  52. package/dist/chunk-gnp95nzg.js +0 -438
  53. package/dist/chunk-gnp95nzg.js.map +0 -12
  54. package/dist/chunk-jgtvcc65.js +0 -90
  55. package/dist/chunk-jgtvcc65.js.map +0 -10
  56. package/dist/chunk-wm6hvkcv.js +0 -245
  57. package/dist/chunk-wm6hvkcv.js.map +0 -10
  58. package/dist/chunk-yfrrc1d5.js.map +0 -12
  59. /package/dist/{chunk-jr0fd6n2.js.map → chunk-1xa1wr00.js.map} +0 -0
  60. /package/dist/{chunk-9pntsn3x.js.map → chunk-43gww8dc.js.map} +0 -0
  61. /package/dist/{chunk-49wja30f.js.map → chunk-d99xh4kg.js.map} +0 -0
@@ -1,9 +1,39 @@
1
- import {
2
- __commonJS
3
- } from "./chunk-gnp95nzg.js";
1
+ var __create = Object.create;
2
+ var __getProtoOf = Object.getPrototypeOf;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ function __accessProp(key) {
7
+ return this[key];
8
+ }
9
+ var __toESMCache_node;
10
+ var __toESMCache_esm;
11
+ var __toESM = (mod, isNodeMode, target) => {
12
+ var canCache = mod != null && typeof mod === "object";
13
+ if (canCache) {
14
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
15
+ var cached = cache.get(mod);
16
+ if (cached)
17
+ return cached;
18
+ }
19
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
20
+ const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
21
+ if (mod && typeof mod === "object" || typeof mod === "function") {
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
28
+ }
29
+ if (canCache)
30
+ cache.set(mod, to);
31
+ return to;
32
+ };
33
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
4
34
 
5
35
  // node_modules/@honcho-ai/sdk/dist/http/errors.js
6
- var require_errors = __commonJS((exports) => {
36
+ var require_errors = __commonJS(function(exports) {
7
37
  Object.defineProperty(exports, "__esModule", { value: true });
8
38
  exports.ConnectionError = exports.TimeoutError = exports.ServerError = exports.RateLimitError = exports.NotFoundError = exports.UnprocessableEntityError = exports.ConflictError = exports.PermissionDeniedError = exports.AuthenticationError = exports.BadRequestError = exports.HonchoError = undefined;
9
39
  exports.createErrorFromResponse = createErrorFromResponse;
@@ -125,7 +155,7 @@ var require_errors = __commonJS((exports) => {
125
155
  });
126
156
 
127
157
  // node_modules/@honcho-ai/sdk/dist/message.js
128
- var require_message = __commonJS((exports) => {
158
+ var require_message = __commonJS(function(exports) {
129
159
  Object.defineProperty(exports, "__esModule", { value: true });
130
160
  exports.Message = undefined;
131
161
 
@@ -152,7 +182,7 @@ var require_message = __commonJS((exports) => {
152
182
  });
153
183
 
154
184
  // node_modules/@honcho-ai/sdk/dist/pagination.js
155
- var require_pagination = __commonJS((exports) => {
185
+ var require_pagination = __commonJS(function(exports) {
156
186
  Object.defineProperty(exports, "__esModule", { value: true });
157
187
  exports.Page = undefined;
158
188
 
@@ -232,14 +262,14 @@ var require_pagination = __commonJS((exports) => {
232
262
  });
233
263
 
234
264
  // node_modules/@honcho-ai/sdk/dist/api-version.js
235
- var require_api_version = __commonJS((exports) => {
265
+ var require_api_version = __commonJS(function(exports) {
236
266
  Object.defineProperty(exports, "__esModule", { value: true });
237
267
  exports.API_VERSION = undefined;
238
268
  exports.API_VERSION = "v3";
239
269
  });
240
270
 
241
271
  // node_modules/zod/v4/core/core.cjs
242
- var require_core = __commonJS((exports) => {
272
+ var require_core = __commonJS(function(exports) {
243
273
  Object.defineProperty(exports, "__esModule", { value: true });
244
274
  exports.globalConfig = exports.$ZodAsyncError = exports.$brand = exports.NEVER = undefined;
245
275
  exports.$constructor = $constructor;
@@ -307,7 +337,7 @@ var require_core = __commonJS((exports) => {
307
337
  });
308
338
 
309
339
  // node_modules/zod/v4/core/util.cjs
310
- var require_util = __commonJS((exports) => {
340
+ var require_util = __commonJS(function(exports) {
311
341
  Object.defineProperty(exports, "__esModule", { value: true });
312
342
  exports.Class = exports.BIGINT_FORMAT_RANGES = exports.NUMBER_FORMAT_RANGES = exports.primitiveTypes = exports.propertyKeyTypes = exports.getParsedType = exports.allowsEval = exports.captureStackTrace = undefined;
313
343
  exports.assertEqual = assertEqual;
@@ -686,7 +716,7 @@ var require_util = __commonJS((exports) => {
686
716
  checks: []
687
717
  });
688
718
  }
689
- function partial(Class2, schema, mask) {
719
+ function partial(Class, schema, mask) {
690
720
  const oldShape = schema._zod.def.shape;
691
721
  const shape = { ...oldShape };
692
722
  if (mask) {
@@ -696,14 +726,14 @@ var require_util = __commonJS((exports) => {
696
726
  }
697
727
  if (!mask[key])
698
728
  continue;
699
- shape[key] = Class2 ? new Class2({
729
+ shape[key] = Class ? new Class({
700
730
  type: "optional",
701
731
  innerType: oldShape[key]
702
732
  }) : oldShape[key];
703
733
  }
704
734
  } else {
705
735
  for (const key in oldShape) {
706
- shape[key] = Class2 ? new Class2({
736
+ shape[key] = Class ? new Class({
707
737
  type: "optional",
708
738
  innerType: oldShape[key]
709
739
  }) : oldShape[key];
@@ -715,7 +745,7 @@ var require_util = __commonJS((exports) => {
715
745
  checks: []
716
746
  });
717
747
  }
718
- function required(Class2, schema, mask) {
748
+ function required(Class, schema, mask) {
719
749
  const oldShape = schema._zod.def.shape;
720
750
  const shape = { ...oldShape };
721
751
  if (mask) {
@@ -725,14 +755,14 @@ var require_util = __commonJS((exports) => {
725
755
  }
726
756
  if (!mask[key])
727
757
  continue;
728
- shape[key] = new Class2({
758
+ shape[key] = new Class({
729
759
  type: "nonoptional",
730
760
  innerType: oldShape[key]
731
761
  });
732
762
  }
733
763
  } else {
734
764
  for (const key in oldShape) {
735
- shape[key] = new Class2({
765
+ shape[key] = new Class({
736
766
  type: "nonoptional",
737
767
  innerType: oldShape[key]
738
768
  });
@@ -816,7 +846,7 @@ var require_util = __commonJS((exports) => {
816
846
  });
817
847
 
818
848
  // node_modules/zod/v4/core/errors.cjs
819
- var require_errors2 = __commonJS((exports) => {
849
+ var require_errors2 = __commonJS(function(exports) {
820
850
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
821
851
  if (k2 === undefined)
822
852
  k2 = k;
@@ -899,8 +929,8 @@ var require_errors2 = __commonJS((exports) => {
899
929
  return issue.message;
900
930
  };
901
931
  const fieldErrors = { _errors: [] };
902
- const processError = (error2) => {
903
- for (const issue of error2.issues) {
932
+ const processError = (error) => {
933
+ for (const issue of error.issues) {
904
934
  if (issue.code === "invalid_union" && issue.errors.length) {
905
935
  issue.errors.map((issues) => processError({ issues }));
906
936
  } else if (issue.code === "invalid_key") {
@@ -935,9 +965,9 @@ var require_errors2 = __commonJS((exports) => {
935
965
  return issue.message;
936
966
  };
937
967
  const result = { errors: [] };
938
- const processError = (error2, path = []) => {
968
+ const processError = (error, path = []) => {
939
969
  var _a, _b;
940
- for (const issue of error2.issues) {
970
+ for (const issue of error.issues) {
941
971
  if (issue.code === "invalid_union" && issue.errors.length) {
942
972
  issue.errors.map((issues) => processError({ issues }, issue.path));
943
973
  } else if (issue.code === "invalid_key") {
@@ -1006,7 +1036,7 @@ var require_errors2 = __commonJS((exports) => {
1006
1036
  });
1007
1037
 
1008
1038
  // node_modules/zod/v4/core/parse.cjs
1009
- var require_parse = __commonJS((exports) => {
1039
+ var require_parse = __commonJS(function(exports) {
1010
1040
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
1011
1041
  if (k2 === undefined)
1012
1042
  k2 = k;
@@ -1101,7 +1131,7 @@ var require_parse = __commonJS((exports) => {
1101
1131
  });
1102
1132
 
1103
1133
  // node_modules/zod/v4/core/regexes.cjs
1104
- var require_regexes = __commonJS((exports) => {
1134
+ var require_regexes = __commonJS(function(exports) {
1105
1135
  Object.defineProperty(exports, "__esModule", { value: true });
1106
1136
  exports.uppercase = exports.lowercase = exports.undefined = exports.null = exports.boolean = exports.number = exports.integer = exports.bigint = exports.string = exports.date = exports.e164 = exports.domain = exports.hostname = exports.base64url = exports.base64 = exports.cidrv6 = exports.cidrv4 = exports.ipv6 = exports.ipv4 = exports.browserEmail = exports.unicodeEmail = exports.rfc5322Email = exports.html5Email = exports.email = exports.uuid7 = exports.uuid6 = exports.uuid4 = exports.uuid = exports.guid = exports.extendedDuration = exports.duration = exports.nanoid = exports.ksuid = exports.xid = exports.ulid = exports.cuid2 = exports.cuid = undefined;
1107
1137
  exports.emoji = emoji;
@@ -1154,13 +1184,13 @@ var require_regexes = __commonJS((exports) => {
1154
1184
  return new RegExp(`^${timeSource(args)}$`);
1155
1185
  }
1156
1186
  function datetime(args) {
1157
- const time2 = timeSource({ precision: args.precision });
1187
+ const time = timeSource({ precision: args.precision });
1158
1188
  const opts = ["Z"];
1159
1189
  if (args.local)
1160
1190
  opts.push("");
1161
1191
  if (args.offset)
1162
1192
  opts.push(`([+-]\\d{2}:\\d{2})`);
1163
- const timeRegex = `${time2}(?:${opts.join("|")})`;
1193
+ const timeRegex = `${time}(?:${opts.join("|")})`;
1164
1194
  return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
1165
1195
  }
1166
1196
  var string = (params) => {
@@ -1181,7 +1211,7 @@ var require_regexes = __commonJS((exports) => {
1181
1211
  });
1182
1212
 
1183
1213
  // node_modules/zod/v4/core/checks.cjs
1184
- var require_checks = __commonJS((exports) => {
1214
+ var require_checks = __commonJS(function(exports) {
1185
1215
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
1186
1216
  if (k2 === undefined)
1187
1217
  k2 = k;
@@ -1233,8 +1263,8 @@ var require_checks = __commonJS((exports) => {
1233
1263
  exports.$ZodCheckLessThan = core.$constructor("$ZodCheckLessThan", (inst, def) => {
1234
1264
  exports.$ZodCheck.init(inst, def);
1235
1265
  const origin = numericOriginMap[typeof def.value];
1236
- inst._zod.onattach.push((inst2) => {
1237
- const bag = inst2._zod.bag;
1266
+ inst._zod.onattach.push((inst) => {
1267
+ const bag = inst._zod.bag;
1238
1268
  const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
1239
1269
  if (def.value < curr) {
1240
1270
  if (def.inclusive)
@@ -1261,8 +1291,8 @@ var require_checks = __commonJS((exports) => {
1261
1291
  exports.$ZodCheckGreaterThan = core.$constructor("$ZodCheckGreaterThan", (inst, def) => {
1262
1292
  exports.$ZodCheck.init(inst, def);
1263
1293
  const origin = numericOriginMap[typeof def.value];
1264
- inst._zod.onattach.push((inst2) => {
1265
- const bag = inst2._zod.bag;
1294
+ inst._zod.onattach.push((inst) => {
1295
+ const bag = inst._zod.bag;
1266
1296
  const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
1267
1297
  if (def.value > curr) {
1268
1298
  if (def.inclusive)
@@ -1288,9 +1318,9 @@ var require_checks = __commonJS((exports) => {
1288
1318
  });
1289
1319
  exports.$ZodCheckMultipleOf = /* @__PURE__ */ core.$constructor("$ZodCheckMultipleOf", (inst, def) => {
1290
1320
  exports.$ZodCheck.init(inst, def);
1291
- inst._zod.onattach.push((inst2) => {
1321
+ inst._zod.onattach.push((inst) => {
1292
1322
  var _a;
1293
- (_a = inst2._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
1323
+ (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
1294
1324
  });
1295
1325
  inst._zod.check = (payload) => {
1296
1326
  if (typeof payload.value !== typeof def.value)
@@ -1314,8 +1344,8 @@ var require_checks = __commonJS((exports) => {
1314
1344
  const isInt = def.format?.includes("int");
1315
1345
  const origin = isInt ? "int" : "number";
1316
1346
  const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];
1317
- inst._zod.onattach.push((inst2) => {
1318
- const bag = inst2._zod.bag;
1347
+ inst._zod.onattach.push((inst) => {
1348
+ const bag = inst._zod.bag;
1319
1349
  bag.format = def.format;
1320
1350
  bag.minimum = minimum;
1321
1351
  bag.maximum = maximum;
@@ -1385,8 +1415,8 @@ var require_checks = __commonJS((exports) => {
1385
1415
  exports.$ZodCheckBigIntFormat = core.$constructor("$ZodCheckBigIntFormat", (inst, def) => {
1386
1416
  exports.$ZodCheck.init(inst, def);
1387
1417
  const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];
1388
- inst._zod.onattach.push((inst2) => {
1389
- const bag = inst2._zod.bag;
1418
+ inst._zod.onattach.push((inst) => {
1419
+ const bag = inst._zod.bag;
1390
1420
  bag.format = def.format;
1391
1421
  bag.minimum = minimum;
1392
1422
  bag.maximum = maximum;
@@ -1422,10 +1452,10 @@ var require_checks = __commonJS((exports) => {
1422
1452
  const val = payload.value;
1423
1453
  return !util.nullish(val) && val.size !== undefined;
1424
1454
  });
1425
- inst._zod.onattach.push((inst2) => {
1426
- const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1455
+ inst._zod.onattach.push((inst) => {
1456
+ const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1427
1457
  if (def.maximum < curr)
1428
- inst2._zod.bag.maximum = def.maximum;
1458
+ inst._zod.bag.maximum = def.maximum;
1429
1459
  });
1430
1460
  inst._zod.check = (payload) => {
1431
1461
  const input = payload.value;
@@ -1449,10 +1479,10 @@ var require_checks = __commonJS((exports) => {
1449
1479
  const val = payload.value;
1450
1480
  return !util.nullish(val) && val.size !== undefined;
1451
1481
  });
1452
- inst._zod.onattach.push((inst2) => {
1453
- const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1482
+ inst._zod.onattach.push((inst) => {
1483
+ const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1454
1484
  if (def.minimum > curr)
1455
- inst2._zod.bag.minimum = def.minimum;
1485
+ inst._zod.bag.minimum = def.minimum;
1456
1486
  });
1457
1487
  inst._zod.check = (payload) => {
1458
1488
  const input = payload.value;
@@ -1476,8 +1506,8 @@ var require_checks = __commonJS((exports) => {
1476
1506
  const val = payload.value;
1477
1507
  return !util.nullish(val) && val.size !== undefined;
1478
1508
  });
1479
- inst._zod.onattach.push((inst2) => {
1480
- const bag = inst2._zod.bag;
1509
+ inst._zod.onattach.push((inst) => {
1510
+ const bag = inst._zod.bag;
1481
1511
  bag.minimum = def.size;
1482
1512
  bag.maximum = def.size;
1483
1513
  bag.size = def.size;
@@ -1506,10 +1536,10 @@ var require_checks = __commonJS((exports) => {
1506
1536
  const val = payload.value;
1507
1537
  return !util.nullish(val) && val.length !== undefined;
1508
1538
  });
1509
- inst._zod.onattach.push((inst2) => {
1510
- const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1539
+ inst._zod.onattach.push((inst) => {
1540
+ const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1511
1541
  if (def.maximum < curr)
1512
- inst2._zod.bag.maximum = def.maximum;
1542
+ inst._zod.bag.maximum = def.maximum;
1513
1543
  });
1514
1544
  inst._zod.check = (payload) => {
1515
1545
  const input = payload.value;
@@ -1535,10 +1565,10 @@ var require_checks = __commonJS((exports) => {
1535
1565
  const val = payload.value;
1536
1566
  return !util.nullish(val) && val.length !== undefined;
1537
1567
  });
1538
- inst._zod.onattach.push((inst2) => {
1539
- const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1568
+ inst._zod.onattach.push((inst) => {
1569
+ const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1540
1570
  if (def.minimum > curr)
1541
- inst2._zod.bag.minimum = def.minimum;
1571
+ inst._zod.bag.minimum = def.minimum;
1542
1572
  });
1543
1573
  inst._zod.check = (payload) => {
1544
1574
  const input = payload.value;
@@ -1564,8 +1594,8 @@ var require_checks = __commonJS((exports) => {
1564
1594
  const val = payload.value;
1565
1595
  return !util.nullish(val) && val.length !== undefined;
1566
1596
  });
1567
- inst._zod.onattach.push((inst2) => {
1568
- const bag = inst2._zod.bag;
1597
+ inst._zod.onattach.push((inst) => {
1598
+ const bag = inst._zod.bag;
1569
1599
  bag.minimum = def.length;
1570
1600
  bag.maximum = def.length;
1571
1601
  bag.length = def.length;
@@ -1591,8 +1621,8 @@ var require_checks = __commonJS((exports) => {
1591
1621
  exports.$ZodCheckStringFormat = core.$constructor("$ZodCheckStringFormat", (inst, def) => {
1592
1622
  var _a, _b;
1593
1623
  exports.$ZodCheck.init(inst, def);
1594
- inst._zod.onattach.push((inst2) => {
1595
- const bag = inst2._zod.bag;
1624
+ inst._zod.onattach.push((inst) => {
1625
+ const bag = inst._zod.bag;
1596
1626
  bag.format = def.format;
1597
1627
  if (def.pattern) {
1598
1628
  bag.patterns ?? (bag.patterns = new Set);
@@ -1647,8 +1677,8 @@ var require_checks = __commonJS((exports) => {
1647
1677
  const escapedRegex = util.escapeRegex(def.includes);
1648
1678
  const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
1649
1679
  def.pattern = pattern;
1650
- inst._zod.onattach.push((inst2) => {
1651
- const bag = inst2._zod.bag;
1680
+ inst._zod.onattach.push((inst) => {
1681
+ const bag = inst._zod.bag;
1652
1682
  bag.patterns ?? (bag.patterns = new Set);
1653
1683
  bag.patterns.add(pattern);
1654
1684
  });
@@ -1670,8 +1700,8 @@ var require_checks = __commonJS((exports) => {
1670
1700
  exports.$ZodCheck.init(inst, def);
1671
1701
  const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);
1672
1702
  def.pattern ?? (def.pattern = pattern);
1673
- inst._zod.onattach.push((inst2) => {
1674
- const bag = inst2._zod.bag;
1703
+ inst._zod.onattach.push((inst) => {
1704
+ const bag = inst._zod.bag;
1675
1705
  bag.patterns ?? (bag.patterns = new Set);
1676
1706
  bag.patterns.add(pattern);
1677
1707
  });
@@ -1693,8 +1723,8 @@ var require_checks = __commonJS((exports) => {
1693
1723
  exports.$ZodCheck.init(inst, def);
1694
1724
  const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);
1695
1725
  def.pattern ?? (def.pattern = pattern);
1696
- inst._zod.onattach.push((inst2) => {
1697
- const bag = inst2._zod.bag;
1726
+ inst._zod.onattach.push((inst) => {
1727
+ const bag = inst._zod.bag;
1698
1728
  bag.patterns ?? (bag.patterns = new Set);
1699
1729
  bag.patterns.add(pattern);
1700
1730
  });
@@ -1725,7 +1755,7 @@ var require_checks = __commonJS((exports) => {
1725
1755
  issues: []
1726
1756
  }, {});
1727
1757
  if (result instanceof Promise) {
1728
- return result.then((result2) => handleCheckPropertyResult(result2, payload, def.property));
1758
+ return result.then((result) => handleCheckPropertyResult(result, payload, def.property));
1729
1759
  }
1730
1760
  handleCheckPropertyResult(result, payload, def.property);
1731
1761
  return;
@@ -1734,8 +1764,8 @@ var require_checks = __commonJS((exports) => {
1734
1764
  exports.$ZodCheckMimeType = core.$constructor("$ZodCheckMimeType", (inst, def) => {
1735
1765
  exports.$ZodCheck.init(inst, def);
1736
1766
  const mimeSet = new Set(def.mime);
1737
- inst._zod.onattach.push((inst2) => {
1738
- inst2._zod.bag.mime = def.mime;
1767
+ inst._zod.onattach.push((inst) => {
1768
+ inst._zod.bag.mime = def.mime;
1739
1769
  });
1740
1770
  inst._zod.check = (payload) => {
1741
1771
  if (mimeSet.has(payload.value.type))
@@ -1757,7 +1787,7 @@ var require_checks = __commonJS((exports) => {
1757
1787
  });
1758
1788
 
1759
1789
  // node_modules/zod/v4/core/doc.cjs
1760
- var require_doc = __commonJS((exports) => {
1790
+ var require_doc = __commonJS(function(exports) {
1761
1791
  Object.defineProperty(exports, "__esModule", { value: true });
1762
1792
  exports.Doc = undefined;
1763
1793
 
@@ -1801,7 +1831,7 @@ var require_doc = __commonJS((exports) => {
1801
1831
  });
1802
1832
 
1803
1833
  // node_modules/zod/v4/core/versions.cjs
1804
- var require_versions = __commonJS((exports) => {
1834
+ var require_versions = __commonJS(function(exports) {
1805
1835
  Object.defineProperty(exports, "__esModule", { value: true });
1806
1836
  exports.version = undefined;
1807
1837
  exports.version = {
@@ -1812,7 +1842,7 @@ var require_versions = __commonJS((exports) => {
1812
1842
  });
1813
1843
 
1814
1844
  // node_modules/zod/v4/core/schemas.cjs
1815
- var require_schemas = __commonJS((exports) => {
1845
+ var require_schemas = __commonJS(function(exports) {
1816
1846
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
1817
1847
  if (k2 === undefined)
1818
1848
  k2 = k;
@@ -1864,25 +1894,25 @@ var require_schemas = __commonJS((exports) => {
1864
1894
  inst._zod.def = def;
1865
1895
  inst._zod.bag = inst._zod.bag || {};
1866
1896
  inst._zod.version = versions_js_1.version;
1867
- const checks2 = [...inst._zod.def.checks ?? []];
1897
+ const checks = [...inst._zod.def.checks ?? []];
1868
1898
  if (inst._zod.traits.has("$ZodCheck")) {
1869
- checks2.unshift(inst);
1899
+ checks.unshift(inst);
1870
1900
  }
1871
- for (const ch of checks2) {
1901
+ for (const ch of checks) {
1872
1902
  for (const fn of ch._zod.onattach) {
1873
1903
  fn(inst);
1874
1904
  }
1875
1905
  }
1876
- if (checks2.length === 0) {
1906
+ if (checks.length === 0) {
1877
1907
  (_a = inst._zod).deferred ?? (_a.deferred = []);
1878
1908
  inst._zod.deferred?.push(() => {
1879
1909
  inst._zod.run = inst._zod.parse;
1880
1910
  });
1881
1911
  } else {
1882
- const runChecks = (payload, checks3, ctx) => {
1912
+ const runChecks = (payload, checks, ctx) => {
1883
1913
  let isAborted = util.aborted(payload);
1884
1914
  let asyncResult;
1885
- for (const ch of checks3) {
1915
+ for (const ch of checks) {
1886
1916
  if (ch._zod.def.when) {
1887
1917
  const shouldRun = ch._zod.def.when(payload);
1888
1918
  if (!shouldRun)
@@ -1924,9 +1954,9 @@ var require_schemas = __commonJS((exports) => {
1924
1954
  if (result instanceof Promise) {
1925
1955
  if (ctx.async === false)
1926
1956
  throw new core.$ZodAsyncError;
1927
- return result.then((result2) => runChecks(result2, checks2, ctx));
1957
+ return result.then((result) => runChecks(result, checks, ctx));
1928
1958
  }
1929
- return runChecks(result, checks2, ctx);
1959
+ return runChecks(result, checks, ctx);
1930
1960
  };
1931
1961
  }
1932
1962
  inst["~standard"] = {
@@ -1953,7 +1983,7 @@ var require_schemas = __commonJS((exports) => {
1953
1983
  if (def.coerce)
1954
1984
  try {
1955
1985
  payload.value = String(payload.value);
1956
- } catch (_2) {}
1986
+ } catch (_) {}
1957
1987
  if (typeof payload.value === "string")
1958
1988
  return payload;
1959
1989
  payload.issues.push({
@@ -2096,16 +2126,16 @@ var require_schemas = __commonJS((exports) => {
2096
2126
  exports.$ZodIPv4 = core.$constructor("$ZodIPv4", (inst, def) => {
2097
2127
  def.pattern ?? (def.pattern = regexes.ipv4);
2098
2128
  exports.$ZodStringFormat.init(inst, def);
2099
- inst._zod.onattach.push((inst2) => {
2100
- const bag = inst2._zod.bag;
2129
+ inst._zod.onattach.push((inst) => {
2130
+ const bag = inst._zod.bag;
2101
2131
  bag.format = `ipv4`;
2102
2132
  });
2103
2133
  });
2104
2134
  exports.$ZodIPv6 = core.$constructor("$ZodIPv6", (inst, def) => {
2105
2135
  def.pattern ?? (def.pattern = regexes.ipv6);
2106
2136
  exports.$ZodStringFormat.init(inst, def);
2107
- inst._zod.onattach.push((inst2) => {
2108
- const bag = inst2._zod.bag;
2137
+ inst._zod.onattach.push((inst) => {
2138
+ const bag = inst._zod.bag;
2109
2139
  bag.format = `ipv6`;
2110
2140
  });
2111
2141
  inst._zod.check = (payload) => {
@@ -2166,8 +2196,8 @@ var require_schemas = __commonJS((exports) => {
2166
2196
  exports.$ZodBase64 = core.$constructor("$ZodBase64", (inst, def) => {
2167
2197
  def.pattern ?? (def.pattern = regexes.base64);
2168
2198
  exports.$ZodStringFormat.init(inst, def);
2169
- inst._zod.onattach.push((inst2) => {
2170
- inst2._zod.bag.contentEncoding = "base64";
2199
+ inst._zod.onattach.push((inst) => {
2200
+ inst._zod.bag.contentEncoding = "base64";
2171
2201
  });
2172
2202
  inst._zod.check = (payload) => {
2173
2203
  if (isValidBase64(payload.value))
@@ -2191,8 +2221,8 @@ var require_schemas = __commonJS((exports) => {
2191
2221
  exports.$ZodBase64URL = core.$constructor("$ZodBase64URL", (inst, def) => {
2192
2222
  def.pattern ?? (def.pattern = regexes.base64url);
2193
2223
  exports.$ZodStringFormat.init(inst, def);
2194
- inst._zod.onattach.push((inst2) => {
2195
- inst2._zod.bag.contentEncoding = "base64url";
2224
+ inst._zod.onattach.push((inst) => {
2225
+ inst._zod.bag.contentEncoding = "base64url";
2196
2226
  });
2197
2227
  inst._zod.check = (payload) => {
2198
2228
  if (isValidBase64URL(payload.value))
@@ -2465,7 +2495,7 @@ var require_schemas = __commonJS((exports) => {
2465
2495
  issues: []
2466
2496
  }, ctx);
2467
2497
  if (result instanceof Promise) {
2468
- proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
2498
+ proms.push(result.then((result) => handleArrayResult(result, payload, i)));
2469
2499
  } else {
2470
2500
  handleArrayResult(result, payload, i);
2471
2501
  }
@@ -2618,7 +2648,7 @@ var require_schemas = __commonJS((exports) => {
2618
2648
  const r = el._zod.run({ value: input[key], issues: [] }, ctx);
2619
2649
  const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
2620
2650
  if (r instanceof Promise) {
2621
- proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult(r2, payload, key, input) : handleObjectResult(r2, payload, key)));
2651
+ proms.push(r.then((r) => isOptional ? handleOptionalObjectResult(r, payload, key, input) : handleObjectResult(r, payload, key)));
2622
2652
  } else if (isOptional) {
2623
2653
  handleOptionalObjectResult(r, payload, key, input);
2624
2654
  } else {
@@ -2642,7 +2672,7 @@ var require_schemas = __commonJS((exports) => {
2642
2672
  }
2643
2673
  const r = _catchall.run({ value: input[key], issues: [] }, ctx);
2644
2674
  if (r instanceof Promise) {
2645
- proms.push(r.then((r2) => handleObjectResult(r2, payload, key)));
2675
+ proms.push(r.then((r) => handleObjectResult(r, payload, key)));
2646
2676
  } else {
2647
2677
  handleObjectResult(r, payload, key);
2648
2678
  }
@@ -2713,8 +2743,8 @@ var require_schemas = __commonJS((exports) => {
2713
2743
  }
2714
2744
  if (!async)
2715
2745
  return handleUnionResults(results, payload, inst, ctx);
2716
- return Promise.all(results).then((results2) => {
2717
- return handleUnionResults(results2, payload, inst, ctx);
2746
+ return Promise.all(results).then((results) => {
2747
+ return handleUnionResults(results, payload, inst, ctx);
2718
2748
  });
2719
2749
  };
2720
2750
  });
@@ -2790,8 +2820,8 @@ var require_schemas = __commonJS((exports) => {
2790
2820
  const right = def.right._zod.run({ value: input, issues: [] }, ctx);
2791
2821
  const async = left instanceof Promise || right instanceof Promise;
2792
2822
  if (async) {
2793
- return Promise.all([left, right]).then(([left2, right2]) => {
2794
- return handleIntersectionResults(payload, left2, right2);
2823
+ return Promise.all([left, right]).then(([left, right]) => {
2824
+ return handleIntersectionResults(payload, left, right);
2795
2825
  });
2796
2826
  }
2797
2827
  return handleIntersectionResults(payload, left, right);
@@ -2899,7 +2929,7 @@ var require_schemas = __commonJS((exports) => {
2899
2929
  issues: []
2900
2930
  }, ctx);
2901
2931
  if (result instanceof Promise) {
2902
- proms.push(result.then((result2) => handleTupleResult(result2, payload, i)));
2932
+ proms.push(result.then((result) => handleTupleResult(result, payload, i)));
2903
2933
  } else {
2904
2934
  handleTupleResult(result, payload, i);
2905
2935
  }
@@ -2913,7 +2943,7 @@ var require_schemas = __commonJS((exports) => {
2913
2943
  issues: []
2914
2944
  }, ctx);
2915
2945
  if (result instanceof Promise) {
2916
- proms.push(result.then((result2) => handleTupleResult(result2, payload, i)));
2946
+ proms.push(result.then((result) => handleTupleResult(result, payload, i)));
2917
2947
  } else {
2918
2948
  handleTupleResult(result, payload, i);
2919
2949
  }
@@ -2951,11 +2981,11 @@ var require_schemas = __commonJS((exports) => {
2951
2981
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
2952
2982
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
2953
2983
  if (result instanceof Promise) {
2954
- proms.push(result.then((result2) => {
2955
- if (result2.issues.length) {
2956
- payload.issues.push(...util.prefixIssues(key, result2.issues));
2984
+ proms.push(result.then((result) => {
2985
+ if (result.issues.length) {
2986
+ payload.issues.push(...util.prefixIssues(key, result.issues));
2957
2987
  }
2958
- payload.value[key] = result2.value;
2988
+ payload.value[key] = result.value;
2959
2989
  }));
2960
2990
  } else {
2961
2991
  if (result.issues.length) {
@@ -3003,11 +3033,11 @@ var require_schemas = __commonJS((exports) => {
3003
3033
  }
3004
3034
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
3005
3035
  if (result instanceof Promise) {
3006
- proms.push(result.then((result2) => {
3007
- if (result2.issues.length) {
3008
- payload.issues.push(...util.prefixIssues(key, result2.issues));
3036
+ proms.push(result.then((result) => {
3037
+ if (result.issues.length) {
3038
+ payload.issues.push(...util.prefixIssues(key, result.issues));
3009
3039
  }
3010
- payload.value[keyResult.value] = result2.value;
3040
+ payload.value[keyResult.value] = result.value;
3011
3041
  }));
3012
3042
  } else {
3013
3043
  if (result.issues.length) {
@@ -3042,8 +3072,8 @@ var require_schemas = __commonJS((exports) => {
3042
3072
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
3043
3073
  const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
3044
3074
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
3045
- proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
3046
- handleMapResult(keyResult2, valueResult2, payload, key, input, inst, ctx);
3075
+ proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {
3076
+ handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
3047
3077
  }));
3048
3078
  } else {
3049
3079
  handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
@@ -3102,7 +3132,7 @@ var require_schemas = __commonJS((exports) => {
3102
3132
  for (const item of input) {
3103
3133
  const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
3104
3134
  if (result instanceof Promise) {
3105
- proms.push(result.then((result2) => handleSetResult(result2, payload)));
3135
+ proms.push(result.then((result) => handleSetResult(result, payload)));
3106
3136
  } else
3107
3137
  handleSetResult(result, payload);
3108
3138
  }
@@ -3175,8 +3205,8 @@ var require_schemas = __commonJS((exports) => {
3175
3205
  const _out = def.transform(payload.value, payload);
3176
3206
  if (_ctx.async) {
3177
3207
  const output = _out instanceof Promise ? _out : Promise.resolve(_out);
3178
- return output.then((output2) => {
3179
- payload.value = output2;
3208
+ return output.then((output) => {
3209
+ payload.value = output;
3180
3210
  return payload;
3181
3211
  });
3182
3212
  }
@@ -3236,7 +3266,7 @@ var require_schemas = __commonJS((exports) => {
3236
3266
  }
3237
3267
  const result = def.innerType._zod.run(payload, ctx);
3238
3268
  if (result instanceof Promise) {
3239
- return result.then((result2) => handleDefaultResult(result2, def));
3269
+ return result.then((result) => handleDefaultResult(result, def));
3240
3270
  }
3241
3271
  return handleDefaultResult(result, def);
3242
3272
  };
@@ -3267,7 +3297,7 @@ var require_schemas = __commonJS((exports) => {
3267
3297
  inst._zod.parse = (payload, ctx) => {
3268
3298
  const result = def.innerType._zod.run(payload, ctx);
3269
3299
  if (result instanceof Promise) {
3270
- return result.then((result2) => handleNonOptionalResult(result2, inst));
3300
+ return result.then((result) => handleNonOptionalResult(result, inst));
3271
3301
  }
3272
3302
  return handleNonOptionalResult(result, inst);
3273
3303
  };
@@ -3288,8 +3318,8 @@ var require_schemas = __commonJS((exports) => {
3288
3318
  inst._zod.parse = (payload, ctx) => {
3289
3319
  const result = def.innerType._zod.run(payload, ctx);
3290
3320
  if (result instanceof Promise) {
3291
- return result.then((result2) => {
3292
- payload.value = result2.issues.length === 0;
3321
+ return result.then((result) => {
3322
+ payload.value = result.issues.length === 0;
3293
3323
  return payload;
3294
3324
  });
3295
3325
  }
@@ -3305,13 +3335,13 @@ var require_schemas = __commonJS((exports) => {
3305
3335
  inst._zod.parse = (payload, ctx) => {
3306
3336
  const result = def.innerType._zod.run(payload, ctx);
3307
3337
  if (result instanceof Promise) {
3308
- return result.then((result2) => {
3309
- payload.value = result2.value;
3310
- if (result2.issues.length) {
3338
+ return result.then((result) => {
3339
+ payload.value = result.value;
3340
+ if (result.issues.length) {
3311
3341
  payload.value = def.catchValue({
3312
3342
  ...payload,
3313
3343
  error: {
3314
- issues: result2.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))
3344
+ issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))
3315
3345
  },
3316
3346
  input: payload.value
3317
3347
  });
@@ -3357,7 +3387,7 @@ var require_schemas = __commonJS((exports) => {
3357
3387
  inst._zod.parse = (payload, ctx) => {
3358
3388
  const left = def.in._zod.run(payload, ctx);
3359
3389
  if (left instanceof Promise) {
3360
- return left.then((left2) => handlePipeResult(left2, def, ctx));
3390
+ return left.then((left) => handlePipeResult(left, def, ctx));
3361
3391
  }
3362
3392
  return handlePipeResult(left, def, ctx);
3363
3393
  };
@@ -3459,7 +3489,7 @@ var require_schemas = __commonJS((exports) => {
3459
3489
  const input = payload.value;
3460
3490
  const r = def.fn(input);
3461
3491
  if (r instanceof Promise) {
3462
- return r.then((r2) => handleRefineResult(r2, payload, input, inst));
3492
+ return r.then((r) => handleRefineResult(r, payload, input, inst));
3463
3493
  }
3464
3494
  handleRefineResult(r, payload, input, inst);
3465
3495
  return;
@@ -3482,7 +3512,7 @@ var require_schemas = __commonJS((exports) => {
3482
3512
  });
3483
3513
 
3484
3514
  // node_modules/zod/v4/locales/ar.cjs
3485
- var require_ar = __commonJS((exports) => {
3515
+ var require_ar = __commonJS(function(exports) {
3486
3516
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
3487
3517
  if (k2 === undefined)
3488
3518
  k2 = k;
@@ -3636,7 +3666,7 @@ var require_ar = __commonJS((exports) => {
3636
3666
  });
3637
3667
 
3638
3668
  // node_modules/zod/v4/locales/az.cjs
3639
- var require_az = __commonJS((exports) => {
3669
+ var require_az = __commonJS(function(exports) {
3640
3670
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
3641
3671
  if (k2 === undefined)
3642
3672
  k2 = k;
@@ -3789,7 +3819,7 @@ var require_az = __commonJS((exports) => {
3789
3819
  });
3790
3820
 
3791
3821
  // node_modules/zod/v4/locales/be.cjs
3792
- var require_be = __commonJS((exports) => {
3822
+ var require_be = __commonJS(function(exports) {
3793
3823
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
3794
3824
  if (k2 === undefined)
3795
3825
  k2 = k;
@@ -3991,7 +4021,7 @@ var require_be = __commonJS((exports) => {
3991
4021
  });
3992
4022
 
3993
4023
  // node_modules/zod/v4/locales/ca.cjs
3994
- var require_ca = __commonJS((exports) => {
4024
+ var require_ca = __commonJS(function(exports) {
3995
4025
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
3996
4026
  if (k2 === undefined)
3997
4027
  k2 = k;
@@ -4146,7 +4176,7 @@ var require_ca = __commonJS((exports) => {
4146
4176
  });
4147
4177
 
4148
4178
  // node_modules/zod/v4/locales/cs.cjs
4149
- var require_cs = __commonJS((exports) => {
4179
+ var require_cs = __commonJS(function(exports) {
4150
4180
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
4151
4181
  if (k2 === undefined)
4152
4182
  k2 = k;
@@ -4319,7 +4349,7 @@ var require_cs = __commonJS((exports) => {
4319
4349
  });
4320
4350
 
4321
4351
  // node_modules/zod/v4/locales/de.cjs
4322
- var require_de = __commonJS((exports) => {
4352
+ var require_de = __commonJS(function(exports) {
4323
4353
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
4324
4354
  if (k2 === undefined)
4325
4355
  k2 = k;
@@ -4473,7 +4503,7 @@ var require_de = __commonJS((exports) => {
4473
4503
  });
4474
4504
 
4475
4505
  // node_modules/zod/v4/locales/en.cjs
4476
- var require_en = __commonJS((exports) => {
4506
+ var require_en = __commonJS(function(exports) {
4477
4507
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
4478
4508
  if (k2 === undefined)
4479
4509
  k2 = k;
@@ -4630,7 +4660,7 @@ var require_en = __commonJS((exports) => {
4630
4660
  });
4631
4661
 
4632
4662
  // node_modules/zod/v4/locales/eo.cjs
4633
- var require_eo = __commonJS((exports) => {
4663
+ var require_eo = __commonJS(function(exports) {
4634
4664
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
4635
4665
  if (k2 === undefined)
4636
4666
  k2 = k;
@@ -4786,7 +4816,7 @@ var require_eo = __commonJS((exports) => {
4786
4816
  });
4787
4817
 
4788
4818
  // node_modules/zod/v4/locales/es.cjs
4789
- var require_es = __commonJS((exports) => {
4819
+ var require_es = __commonJS(function(exports) {
4790
4820
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
4791
4821
  if (k2 === undefined)
4792
4822
  k2 = k;
@@ -4940,7 +4970,7 @@ var require_es = __commonJS((exports) => {
4940
4970
  });
4941
4971
 
4942
4972
  // node_modules/zod/v4/locales/fa.cjs
4943
- var require_fa = __commonJS((exports) => {
4973
+ var require_fa = __commonJS(function(exports) {
4944
4974
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
4945
4975
  if (k2 === undefined)
4946
4976
  k2 = k;
@@ -5100,7 +5130,7 @@ var require_fa = __commonJS((exports) => {
5100
5130
  });
5101
5131
 
5102
5132
  // node_modules/zod/v4/locales/fi.cjs
5103
- var require_fi = __commonJS((exports) => {
5133
+ var require_fi = __commonJS(function(exports) {
5104
5134
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
5105
5135
  if (k2 === undefined)
5106
5136
  k2 = k;
@@ -5260,7 +5290,7 @@ var require_fi = __commonJS((exports) => {
5260
5290
  });
5261
5291
 
5262
5292
  // node_modules/zod/v4/locales/fr.cjs
5263
- var require_fr = __commonJS((exports) => {
5293
+ var require_fr = __commonJS(function(exports) {
5264
5294
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
5265
5295
  if (k2 === undefined)
5266
5296
  k2 = k;
@@ -5414,7 +5444,7 @@ var require_fr = __commonJS((exports) => {
5414
5444
  });
5415
5445
 
5416
5446
  // node_modules/zod/v4/locales/fr-CA.cjs
5417
- var require_fr_CA = __commonJS((exports) => {
5447
+ var require_fr_CA = __commonJS(function(exports) {
5418
5448
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
5419
5449
  if (k2 === undefined)
5420
5450
  k2 = k;
@@ -5569,7 +5599,7 @@ var require_fr_CA = __commonJS((exports) => {
5569
5599
  });
5570
5600
 
5571
5601
  // node_modules/zod/v4/locales/he.cjs
5572
- var require_he = __commonJS((exports) => {
5602
+ var require_he = __commonJS(function(exports) {
5573
5603
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
5574
5604
  if (k2 === undefined)
5575
5605
  k2 = k;
@@ -5723,7 +5753,7 @@ var require_he = __commonJS((exports) => {
5723
5753
  });
5724
5754
 
5725
5755
  // node_modules/zod/v4/locales/hu.cjs
5726
- var require_hu = __commonJS((exports) => {
5756
+ var require_hu = __commonJS(function(exports) {
5727
5757
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
5728
5758
  if (k2 === undefined)
5729
5759
  k2 = k;
@@ -5877,7 +5907,7 @@ var require_hu = __commonJS((exports) => {
5877
5907
  });
5878
5908
 
5879
5909
  // node_modules/zod/v4/locales/id.cjs
5880
- var require_id = __commonJS((exports) => {
5910
+ var require_id = __commonJS(function(exports) {
5881
5911
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
5882
5912
  if (k2 === undefined)
5883
5913
  k2 = k;
@@ -6031,7 +6061,7 @@ var require_id = __commonJS((exports) => {
6031
6061
  });
6032
6062
 
6033
6063
  // node_modules/zod/v4/locales/it.cjs
6034
- var require_it = __commonJS((exports) => {
6064
+ var require_it = __commonJS(function(exports) {
6035
6065
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6036
6066
  if (k2 === undefined)
6037
6067
  k2 = k;
@@ -6185,7 +6215,7 @@ var require_it = __commonJS((exports) => {
6185
6215
  });
6186
6216
 
6187
6217
  // node_modules/zod/v4/locales/ja.cjs
6188
- var require_ja = __commonJS((exports) => {
6218
+ var require_ja = __commonJS(function(exports) {
6189
6219
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6190
6220
  if (k2 === undefined)
6191
6221
  k2 = k;
@@ -6338,7 +6368,7 @@ var require_ja = __commonJS((exports) => {
6338
6368
  });
6339
6369
 
6340
6370
  // node_modules/zod/v4/locales/kh.cjs
6341
- var require_kh = __commonJS((exports) => {
6371
+ var require_kh = __commonJS(function(exports) {
6342
6372
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6343
6373
  if (k2 === undefined)
6344
6374
  k2 = k;
@@ -6493,7 +6523,7 @@ var require_kh = __commonJS((exports) => {
6493
6523
  });
6494
6524
 
6495
6525
  // node_modules/zod/v4/locales/ko.cjs
6496
- var require_ko = __commonJS((exports) => {
6526
+ var require_ko = __commonJS(function(exports) {
6497
6527
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6498
6528
  if (k2 === undefined)
6499
6529
  k2 = k;
@@ -6652,7 +6682,7 @@ var require_ko = __commonJS((exports) => {
6652
6682
  });
6653
6683
 
6654
6684
  // node_modules/zod/v4/locales/mk.cjs
6655
- var require_mk = __commonJS((exports) => {
6685
+ var require_mk = __commonJS(function(exports) {
6656
6686
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6657
6687
  if (k2 === undefined)
6658
6688
  k2 = k;
@@ -6807,7 +6837,7 @@ var require_mk = __commonJS((exports) => {
6807
6837
  });
6808
6838
 
6809
6839
  // node_modules/zod/v4/locales/ms.cjs
6810
- var require_ms = __commonJS((exports) => {
6840
+ var require_ms = __commonJS(function(exports) {
6811
6841
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6812
6842
  if (k2 === undefined)
6813
6843
  k2 = k;
@@ -6961,7 +6991,7 @@ var require_ms = __commonJS((exports) => {
6961
6991
  });
6962
6992
 
6963
6993
  // node_modules/zod/v4/locales/nl.cjs
6964
- var require_nl = __commonJS((exports) => {
6994
+ var require_nl = __commonJS(function(exports) {
6965
6995
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6966
6996
  if (k2 === undefined)
6967
6997
  k2 = k;
@@ -7116,7 +7146,7 @@ var require_nl = __commonJS((exports) => {
7116
7146
  });
7117
7147
 
7118
7148
  // node_modules/zod/v4/locales/no.cjs
7119
- var require_no = __commonJS((exports) => {
7149
+ var require_no = __commonJS(function(exports) {
7120
7150
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
7121
7151
  if (k2 === undefined)
7122
7152
  k2 = k;
@@ -7270,7 +7300,7 @@ var require_no = __commonJS((exports) => {
7270
7300
  });
7271
7301
 
7272
7302
  // node_modules/zod/v4/locales/ota.cjs
7273
- var require_ota = __commonJS((exports) => {
7303
+ var require_ota = __commonJS(function(exports) {
7274
7304
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
7275
7305
  if (k2 === undefined)
7276
7306
  k2 = k;
@@ -7424,7 +7454,7 @@ var require_ota = __commonJS((exports) => {
7424
7454
  });
7425
7455
 
7426
7456
  // node_modules/zod/v4/locales/ps.cjs
7427
- var require_ps = __commonJS((exports) => {
7457
+ var require_ps = __commonJS(function(exports) {
7428
7458
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
7429
7459
  if (k2 === undefined)
7430
7460
  k2 = k;
@@ -7584,7 +7614,7 @@ var require_ps = __commonJS((exports) => {
7584
7614
  });
7585
7615
 
7586
7616
  // node_modules/zod/v4/locales/pl.cjs
7587
- var require_pl = __commonJS((exports) => {
7617
+ var require_pl = __commonJS(function(exports) {
7588
7618
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
7589
7619
  if (k2 === undefined)
7590
7620
  k2 = k;
@@ -7739,7 +7769,7 @@ var require_pl = __commonJS((exports) => {
7739
7769
  });
7740
7770
 
7741
7771
  // node_modules/zod/v4/locales/pt.cjs
7742
- var require_pt = __commonJS((exports) => {
7772
+ var require_pt = __commonJS(function(exports) {
7743
7773
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
7744
7774
  if (k2 === undefined)
7745
7775
  k2 = k;
@@ -7893,7 +7923,7 @@ var require_pt = __commonJS((exports) => {
7893
7923
  });
7894
7924
 
7895
7925
  // node_modules/zod/v4/locales/ru.cjs
7896
- var require_ru = __commonJS((exports) => {
7926
+ var require_ru = __commonJS(function(exports) {
7897
7927
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
7898
7928
  if (k2 === undefined)
7899
7929
  k2 = k;
@@ -8095,7 +8125,7 @@ var require_ru = __commonJS((exports) => {
8095
8125
  });
8096
8126
 
8097
8127
  // node_modules/zod/v4/locales/sl.cjs
8098
- var require_sl = __commonJS((exports) => {
8128
+ var require_sl = __commonJS(function(exports) {
8099
8129
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
8100
8130
  if (k2 === undefined)
8101
8131
  k2 = k;
@@ -8250,7 +8280,7 @@ var require_sl = __commonJS((exports) => {
8250
8280
  });
8251
8281
 
8252
8282
  // node_modules/zod/v4/locales/sv.cjs
8253
- var require_sv = __commonJS((exports) => {
8283
+ var require_sv = __commonJS(function(exports) {
8254
8284
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
8255
8285
  if (k2 === undefined)
8256
8286
  k2 = k;
@@ -8406,7 +8436,7 @@ var require_sv = __commonJS((exports) => {
8406
8436
  });
8407
8437
 
8408
8438
  // node_modules/zod/v4/locales/ta.cjs
8409
- var require_ta = __commonJS((exports) => {
8439
+ var require_ta = __commonJS(function(exports) {
8410
8440
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
8411
8441
  if (k2 === undefined)
8412
8442
  k2 = k;
@@ -8561,7 +8591,7 @@ var require_ta = __commonJS((exports) => {
8561
8591
  });
8562
8592
 
8563
8593
  // node_modules/zod/v4/locales/th.cjs
8564
- var require_th = __commonJS((exports) => {
8594
+ var require_th = __commonJS(function(exports) {
8565
8595
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
8566
8596
  if (k2 === undefined)
8567
8597
  k2 = k;
@@ -8716,7 +8746,7 @@ var require_th = __commonJS((exports) => {
8716
8746
  });
8717
8747
 
8718
8748
  // node_modules/zod/v4/locales/tr.cjs
8719
- var require_tr = __commonJS((exports) => {
8749
+ var require_tr = __commonJS(function(exports) {
8720
8750
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
8721
8751
  if (k2 === undefined)
8722
8752
  k2 = k;
@@ -8871,7 +8901,7 @@ var require_tr = __commonJS((exports) => {
8871
8901
  });
8872
8902
 
8873
8903
  // node_modules/zod/v4/locales/ua.cjs
8874
- var require_ua = __commonJS((exports) => {
8904
+ var require_ua = __commonJS(function(exports) {
8875
8905
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
8876
8906
  if (k2 === undefined)
8877
8907
  k2 = k;
@@ -9025,7 +9055,7 @@ var require_ua = __commonJS((exports) => {
9025
9055
  });
9026
9056
 
9027
9057
  // node_modules/zod/v4/locales/ur.cjs
9028
- var require_ur = __commonJS((exports) => {
9058
+ var require_ur = __commonJS(function(exports) {
9029
9059
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
9030
9060
  if (k2 === undefined)
9031
9061
  k2 = k;
@@ -9180,7 +9210,7 @@ var require_ur = __commonJS((exports) => {
9180
9210
  });
9181
9211
 
9182
9212
  // node_modules/zod/v4/locales/vi.cjs
9183
- var require_vi = __commonJS((exports) => {
9213
+ var require_vi = __commonJS(function(exports) {
9184
9214
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
9185
9215
  if (k2 === undefined)
9186
9216
  k2 = k;
@@ -9334,7 +9364,7 @@ var require_vi = __commonJS((exports) => {
9334
9364
  });
9335
9365
 
9336
9366
  // node_modules/zod/v4/locales/zh-CN.cjs
9337
- var require_zh_CN = __commonJS((exports) => {
9367
+ var require_zh_CN = __commonJS(function(exports) {
9338
9368
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
9339
9369
  if (k2 === undefined)
9340
9370
  k2 = k;
@@ -9488,7 +9518,7 @@ var require_zh_CN = __commonJS((exports) => {
9488
9518
  });
9489
9519
 
9490
9520
  // node_modules/zod/v4/locales/zh-TW.cjs
9491
- var require_zh_TW = __commonJS((exports) => {
9521
+ var require_zh_TW = __commonJS(function(exports) {
9492
9522
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
9493
9523
  if (k2 === undefined)
9494
9524
  k2 = k;
@@ -9643,7 +9673,7 @@ var require_zh_TW = __commonJS((exports) => {
9643
9673
  });
9644
9674
 
9645
9675
  // node_modules/zod/v4/locales/index.cjs
9646
- var require_locales = __commonJS((exports) => {
9676
+ var require_locales = __commonJS(function(exports) {
9647
9677
  var __importDefault = exports && exports.__importDefault || function(mod) {
9648
9678
  return mod && mod.__esModule ? mod : { default: mod };
9649
9679
  };
@@ -9808,7 +9838,7 @@ var require_locales = __commonJS((exports) => {
9808
9838
  });
9809
9839
 
9810
9840
  // node_modules/zod/v4/core/registries.cjs
9811
- var require_registries = __commonJS((exports) => {
9841
+ var require_registries = __commonJS(function(exports) {
9812
9842
  Object.defineProperty(exports, "__esModule", { value: true });
9813
9843
  exports.globalRegistry = exports.$ZodRegistry = exports.$input = exports.$output = undefined;
9814
9844
  exports.registry = registry;
@@ -9865,7 +9895,7 @@ var require_registries = __commonJS((exports) => {
9865
9895
  });
9866
9896
 
9867
9897
  // node_modules/zod/v4/core/api.cjs
9868
- var require_api = __commonJS((exports) => {
9898
+ var require_api = __commonJS(function(exports) {
9869
9899
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
9870
9900
  if (k2 === undefined)
9871
9901
  k2 = k;
@@ -10872,7 +10902,7 @@ var require_api = __commonJS((exports) => {
10872
10902
  });
10873
10903
 
10874
10904
  // node_modules/zod/v4/core/function.cjs
10875
- var require_function = __commonJS((exports) => {
10905
+ var require_function = __commonJS(function(exports) {
10876
10906
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
10877
10907
  if (k2 === undefined)
10878
10908
  k2 = k;
@@ -10985,7 +11015,7 @@ var require_function = __commonJS((exports) => {
10985
11015
  });
10986
11016
 
10987
11017
  // node_modules/zod/v4/core/to-json-schema.cjs
10988
- var require_to_json_schema = __commonJS((exports) => {
11018
+ var require_to_json_schema = __commonJS(function(exports) {
10989
11019
  Object.defineProperty(exports, "__esModule", { value: true });
10990
11020
  exports.JSONSchemaGenerator = undefined;
10991
11021
  exports.toJSONSchema = toJSONSchema;
@@ -11477,7 +11507,7 @@ var require_to_json_schema = __commonJS((exports) => {
11477
11507
  const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
11478
11508
  if (params.external) {
11479
11509
  const externalId = params.external.registry.get(entry[0])?.id;
11480
- const uriGenerator = params.external.uri ?? ((id2) => id2);
11510
+ const uriGenerator = params.external.uri ?? ((id) => id);
11481
11511
  if (externalId) {
11482
11512
  return { ref: uriGenerator(externalId) };
11483
11513
  }
@@ -11502,11 +11532,11 @@ var require_to_json_schema = __commonJS((exports) => {
11502
11532
  seen.def = { ...seen.schema };
11503
11533
  if (defId)
11504
11534
  seen.defId = defId;
11505
- const schema2 = seen.schema;
11506
- for (const key in schema2) {
11507
- delete schema2[key];
11535
+ const schema = seen.schema;
11536
+ for (const key in schema) {
11537
+ delete schema[key];
11508
11538
  }
11509
- schema2.$ref = ref;
11539
+ schema.$ref = ref;
11510
11540
  };
11511
11541
  if (params.cycles === "throw") {
11512
11542
  for (const entry of this.seen.entries()) {
@@ -11545,30 +11575,30 @@ var require_to_json_schema = __commonJS((exports) => {
11545
11575
  }
11546
11576
  }
11547
11577
  }
11548
- const flattenRef = (zodSchema, params2) => {
11578
+ const flattenRef = (zodSchema, params) => {
11549
11579
  const seen = this.seen.get(zodSchema);
11550
- const schema2 = seen.def ?? seen.schema;
11551
- const _cached = { ...schema2 };
11580
+ const schema = seen.def ?? seen.schema;
11581
+ const _cached = { ...schema };
11552
11582
  if (seen.ref === null) {
11553
11583
  return;
11554
11584
  }
11555
11585
  const ref = seen.ref;
11556
11586
  seen.ref = null;
11557
11587
  if (ref) {
11558
- flattenRef(ref, params2);
11588
+ flattenRef(ref, params);
11559
11589
  const refSchema = this.seen.get(ref).schema;
11560
- if (refSchema.$ref && params2.target === "draft-7") {
11561
- schema2.allOf = schema2.allOf ?? [];
11562
- schema2.allOf.push(refSchema);
11590
+ if (refSchema.$ref && params.target === "draft-7") {
11591
+ schema.allOf = schema.allOf ?? [];
11592
+ schema.allOf.push(refSchema);
11563
11593
  } else {
11564
- Object.assign(schema2, refSchema);
11565
- Object.assign(schema2, _cached);
11594
+ Object.assign(schema, refSchema);
11595
+ Object.assign(schema, _cached);
11566
11596
  }
11567
11597
  }
11568
11598
  if (!seen.isParent)
11569
11599
  this.override({
11570
11600
  zodSchema,
11571
- jsonSchema: schema2,
11601
+ jsonSchema: schema,
11572
11602
  path: seen.path ?? []
11573
11603
  });
11574
11604
  };
@@ -11616,11 +11646,11 @@ var require_to_json_schema = __commonJS((exports) => {
11616
11646
  exports.JSONSchemaGenerator = JSONSchemaGenerator;
11617
11647
  function toJSONSchema(input, _params) {
11618
11648
  if (input instanceof registries_js_1.$ZodRegistry) {
11619
- const gen2 = new JSONSchemaGenerator(_params);
11649
+ const gen = new JSONSchemaGenerator(_params);
11620
11650
  const defs = {};
11621
11651
  for (const entry of input._idmap.entries()) {
11622
11652
  const [_, schema] = entry;
11623
- gen2.process(schema);
11653
+ gen.process(schema);
11624
11654
  }
11625
11655
  const schemas = {};
11626
11656
  const external = {
@@ -11630,13 +11660,13 @@ var require_to_json_schema = __commonJS((exports) => {
11630
11660
  };
11631
11661
  for (const entry of input._idmap.entries()) {
11632
11662
  const [key, schema] = entry;
11633
- schemas[key] = gen2.emit(schema, {
11663
+ schemas[key] = gen.emit(schema, {
11634
11664
  ..._params,
11635
11665
  external
11636
11666
  });
11637
11667
  }
11638
11668
  if (Object.keys(defs).length > 0) {
11639
- const defsSegment = gen2.target === "draft-2020-12" ? "$defs" : "definitions";
11669
+ const defsSegment = gen.target === "draft-2020-12" ? "$defs" : "definitions";
11640
11670
  schemas.__shared = {
11641
11671
  [defsSegment]: defs
11642
11672
  };
@@ -11747,12 +11777,12 @@ var require_to_json_schema = __commonJS((exports) => {
11747
11777
  });
11748
11778
 
11749
11779
  // node_modules/zod/v4/core/json-schema.cjs
11750
- var require_json_schema = __commonJS((exports) => {
11780
+ var require_json_schema = __commonJS(function(exports) {
11751
11781
  Object.defineProperty(exports, "__esModule", { value: true });
11752
11782
  });
11753
11783
 
11754
11784
  // node_modules/zod/v4/core/index.cjs
11755
- var require_core2 = __commonJS((exports) => {
11785
+ var require_core2 = __commonJS(function(exports) {
11756
11786
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
11757
11787
  if (k2 === undefined)
11758
11788
  k2 = k;
@@ -11810,7 +11840,7 @@ var require_core2 = __commonJS((exports) => {
11810
11840
  });
11811
11841
 
11812
11842
  // node_modules/zod/v4/classic/checks.cjs
11813
- var require_checks2 = __commonJS((exports) => {
11843
+ var require_checks2 = __commonJS(function(exports) {
11814
11844
  Object.defineProperty(exports, "__esModule", { value: true });
11815
11845
  exports.toUpperCase = exports.toLowerCase = exports.trim = exports.normalize = exports.overwrite = exports.mime = exports.property = exports.endsWith = exports.startsWith = exports.includes = exports.uppercase = exports.lowercase = exports.regex = exports.length = exports.minLength = exports.maxLength = exports.size = exports.minSize = exports.maxSize = exports.multipleOf = exports.nonnegative = exports.nonpositive = exports.negative = exports.positive = exports.gte = exports.gt = exports.lte = exports.lt = undefined;
11816
11846
  var index_js_1 = require_core2();
@@ -11901,7 +11931,7 @@ var require_checks2 = __commonJS((exports) => {
11901
11931
  });
11902
11932
 
11903
11933
  // node_modules/zod/v4/classic/iso.cjs
11904
- var require_iso = __commonJS((exports) => {
11934
+ var require_iso = __commonJS(function(exports) {
11905
11935
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
11906
11936
  if (k2 === undefined)
11907
11937
  k2 = k;
@@ -11973,7 +12003,7 @@ var require_iso = __commonJS((exports) => {
11973
12003
  });
11974
12004
 
11975
12005
  // node_modules/zod/v4/classic/errors.cjs
11976
- var require_errors3 = __commonJS((exports) => {
12006
+ var require_errors3 = __commonJS(function(exports) {
11977
12007
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
11978
12008
  if (k2 === undefined)
11979
12009
  k2 = k;
@@ -12024,7 +12054,7 @@ var require_errors3 = __commonJS((exports) => {
12024
12054
  value: (issue) => inst.issues.push(issue)
12025
12055
  },
12026
12056
  addIssues: {
12027
- value: (issues2) => inst.issues.push(...issues2)
12057
+ value: (issues) => inst.issues.push(...issues)
12028
12058
  },
12029
12059
  isEmpty: {
12030
12060
  get() {
@@ -12040,7 +12070,7 @@ var require_errors3 = __commonJS((exports) => {
12040
12070
  });
12041
12071
 
12042
12072
  // node_modules/zod/v4/classic/parse.cjs
12043
- var require_parse2 = __commonJS((exports) => {
12073
+ var require_parse2 = __commonJS(function(exports) {
12044
12074
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
12045
12075
  if (k2 === undefined)
12046
12076
  k2 = k;
@@ -12084,7 +12114,7 @@ var require_parse2 = __commonJS((exports) => {
12084
12114
  });
12085
12115
 
12086
12116
  // node_modules/zod/v4/classic/schemas.cjs
12087
- var require_schemas2 = __commonJS((exports) => {
12117
+ var require_schemas2 = __commonJS(function(exports) {
12088
12118
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
12089
12119
  if (k2 === undefined)
12090
12120
  k2 = k;
@@ -12210,16 +12240,16 @@ var require_schemas2 = __commonJS((exports) => {
12210
12240
  core.$ZodType.init(inst, def);
12211
12241
  inst.def = def;
12212
12242
  Object.defineProperty(inst, "_def", { value: def });
12213
- inst.check = (...checks2) => {
12243
+ inst.check = (...checks) => {
12214
12244
  return inst.clone({
12215
12245
  ...def,
12216
12246
  checks: [
12217
12247
  ...def.checks ?? [],
12218
- ...checks2.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
12248
+ ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
12219
12249
  ]
12220
12250
  });
12221
12251
  };
12222
- inst.clone = (def2, params) => core.clone(inst, def2, params);
12252
+ inst.clone = (def, params) => core.clone(inst, def, params);
12223
12253
  inst.brand = () => inst;
12224
12254
  inst.register = (reg, meta) => {
12225
12255
  reg.add(inst, meta);
@@ -12230,7 +12260,7 @@ var require_schemas2 = __commonJS((exports) => {
12230
12260
  inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
12231
12261
  inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
12232
12262
  inst.spa = inst.safeParseAsync;
12233
- inst.refine = (check2, params) => inst.check(refine(check2, params));
12263
+ inst.refine = (check, params) => inst.check(refine(check, params));
12234
12264
  inst.superRefine = (refinement) => inst.check(superRefine(refinement));
12235
12265
  inst.overwrite = (fn) => inst.check(checks.overwrite(fn));
12236
12266
  inst.optional = () => optional(inst);
@@ -12241,8 +12271,8 @@ var require_schemas2 = __commonJS((exports) => {
12241
12271
  inst.or = (arg) => union([inst, arg]);
12242
12272
  inst.and = (arg) => intersection(inst, arg);
12243
12273
  inst.transform = (tx) => pipe(inst, transform(tx));
12244
- inst.default = (def2) => _default(inst, def2);
12245
- inst.prefault = (def2) => prefault(inst, def2);
12274
+ inst.default = (def) => _default(inst, def);
12275
+ inst.prefault = (def) => prefault(inst, def);
12246
12276
  inst.catch = (params) => _catch(inst, params);
12247
12277
  inst.pipe = (target) => pipe(inst, target);
12248
12278
  inst.readonly = () => readonly(inst);
@@ -12903,8 +12933,8 @@ var require_schemas2 = __commonJS((exports) => {
12903
12933
  };
12904
12934
  const output = def.transform(payload.value, payload);
12905
12935
  if (output instanceof Promise) {
12906
- return output.then((output2) => {
12907
- payload.value = output2;
12936
+ return output.then((output) => {
12937
+ payload.value = output;
12908
12938
  return payload;
12909
12939
  });
12910
12940
  }
@@ -13140,7 +13170,7 @@ var require_schemas2 = __commonJS((exports) => {
13140
13170
  });
13141
13171
 
13142
13172
  // node_modules/zod/v4/classic/compat.cjs
13143
- var require_compat = __commonJS((exports) => {
13173
+ var require_compat = __commonJS(function(exports) {
13144
13174
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
13145
13175
  if (k2 === undefined)
13146
13176
  k2 = k;
@@ -13209,7 +13239,7 @@ var require_compat = __commonJS((exports) => {
13209
13239
  });
13210
13240
 
13211
13241
  // node_modules/zod/v4/classic/coerce.cjs
13212
- var require_coerce = __commonJS((exports) => {
13242
+ var require_coerce = __commonJS(function(exports) {
13213
13243
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
13214
13244
  if (k2 === undefined)
13215
13245
  k2 = k;
@@ -13268,7 +13298,7 @@ var require_coerce = __commonJS((exports) => {
13268
13298
  });
13269
13299
 
13270
13300
  // node_modules/zod/v4/classic/external.cjs
13271
- var require_external = __commonJS((exports) => {
13301
+ var require_external = __commonJS(function(exports) {
13272
13302
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
13273
13303
  if (k2 === undefined)
13274
13304
  k2 = k;
@@ -13388,7 +13418,7 @@ var require_external = __commonJS((exports) => {
13388
13418
  });
13389
13419
 
13390
13420
  // node_modules/zod/index.cjs
13391
- var require_zod = __commonJS((exports) => {
13421
+ var require_zod = __commonJS(function(exports) {
13392
13422
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
13393
13423
  if (k2 === undefined)
13394
13424
  k2 = k;
@@ -13435,7 +13465,7 @@ var require_zod = __commonJS((exports) => {
13435
13465
  });
13436
13466
 
13437
13467
  // node_modules/@honcho-ai/sdk/dist/validation.js
13438
- var require_validation = __commonJS((exports) => {
13468
+ var require_validation = __commonJS(function(exports) {
13439
13469
  Object.defineProperty(exports, "__esModule", { value: true });
13440
13470
  exports.ConclusionQueryParamsSchema = exports.LimitSchema = exports.WorkspaceConfigSchema = exports.WorkspaceMetadataSchema = exports.MessageAdditionToApiSchema = exports.MessageAdditionSchema = exports.PeerRemovalSchema = exports.PeerAdditionToApiSchema = exports.PeerAdditionSchema = exports.PeerCardContentSchema = exports.CardTargetSchema = exports.PeerGetRepresentationParamsSchema = exports.GetRepresentationParamsSchema = exports.FileUploadSchema = exports.QueueStatusOptionsSchema = exports.ContextParamsSchema = exports.RepresentationOptionsSchema = exports.ChatQuerySchema = exports.FilterSchema = exports.SearchQueryLikeSchema = exports.SearchQueryObjectSchema = exports.SearchQuerySchema = exports.MessageInputSchema = exports.MessageConfigurationSchema = exports.MessageMetadataSchema = exports.MessageContentSchema = exports.SessionPeerConfigSchema = exports.SessionIdSchema = exports.SessionConfigSchema = exports.DreamConfigSchema = exports.SummaryConfigSchema = exports.PeerCardConfigSchema = exports.ReasoningConfigSchema = exports.SessionMetadataSchema = exports.PeerIdSchema = exports.PeerConfigSchema = exports.PeerMetadataSchema = exports.HonchoConfigSchema = exports.WorkspaceIdSchema = undefined;
13441
13471
  exports.normalizeSearchQuery = normalizeSearchQuery;
@@ -13843,7 +13873,7 @@ var require_validation = __commonJS((exports) => {
13843
13873
  });
13844
13874
 
13845
13875
  // node_modules/@honcho-ai/sdk/dist/conclusions.js
13846
- var require_conclusions = __commonJS((exports) => {
13876
+ var require_conclusions = __commonJS(function(exports) {
13847
13877
  Object.defineProperty(exports, "__esModule", { value: true });
13848
13878
  exports.ConclusionScope = exports.Conclusion = undefined;
13849
13879
  var api_version_1 = require_api_version();
@@ -13981,7 +14011,7 @@ var require_conclusions = __commonJS((exports) => {
13981
14011
  });
13982
14012
 
13983
14013
  // node_modules/@honcho-ai/sdk/dist/http/streaming.js
13984
- var require_streaming = __commonJS((exports) => {
14014
+ var require_streaming = __commonJS(function(exports) {
13985
14015
  Object.defineProperty(exports, "__esModule", { value: true });
13986
14016
  exports.DialecticStreamResponse = undefined;
13987
14017
  exports.parseSSE = parseSSE;
@@ -14079,7 +14109,7 @@ var require_streaming = __commonJS((exports) => {
14079
14109
  });
14080
14110
 
14081
14111
  // node_modules/@honcho-ai/sdk/dist/session_context.js
14082
- var require_session_context = __commonJS((exports) => {
14112
+ var require_session_context = __commonJS(function(exports) {
14083
14113
  Object.defineProperty(exports, "__esModule", { value: true });
14084
14114
  exports.SessionContext = exports.SessionSummaries = exports.Summary = undefined;
14085
14115
  var message_1 = require_message();
@@ -14199,7 +14229,7 @@ var require_session_context = __commonJS((exports) => {
14199
14229
  });
14200
14230
 
14201
14231
  // node_modules/@honcho-ai/sdk/dist/peer.js
14202
- var require_peer = __commonJS((exports) => {
14232
+ var require_peer = __commonJS(function(exports) {
14203
14233
  Object.defineProperty(exports, "__esModule", { value: true });
14204
14234
  exports.Peer = exports.PeerContext = undefined;
14205
14235
  var api_version_1 = require_api_version();
@@ -14495,7 +14525,7 @@ var require_peer = __commonJS((exports) => {
14495
14525
  });
14496
14526
 
14497
14527
  // node_modules/@honcho-ai/sdk/dist/utils.js
14498
- var require_utils = __commonJS((exports) => {
14528
+ var require_utils = __commonJS(function(exports) {
14499
14529
  Object.defineProperty(exports, "__esModule", { value: true });
14500
14530
  exports.resolveId = resolveId;
14501
14531
  exports.transformQueueStatus = transformQueueStatus;
@@ -14527,7 +14557,7 @@ var require_utils = __commonJS((exports) => {
14527
14557
  });
14528
14558
 
14529
14559
  // node_modules/@honcho-ai/sdk/dist/session.js
14530
- var require_session = __commonJS((exports) => {
14560
+ var require_session = __commonJS(function(exports) {
14531
14561
  Object.defineProperty(exports, "__esModule", { value: true });
14532
14562
  exports.Session = undefined;
14533
14563
  var api_version_1 = require_api_version();
@@ -14912,7 +14942,7 @@ var require_session = __commonJS((exports) => {
14912
14942
  });
14913
14943
 
14914
14944
  // node_modules/@honcho-ai/sdk/dist/http/client.js
14915
- var require_client = __commonJS((exports) => {
14945
+ var require_client2 = __commonJS(function(exports) {
14916
14946
  Object.defineProperty(exports, "__esModule", { value: true });
14917
14947
  exports.HonchoHTTPClient = undefined;
14918
14948
  var errors_1 = require_errors();
@@ -15134,11 +15164,11 @@ var require_client = __commonJS((exports) => {
15134
15164
  });
15135
15165
 
15136
15166
  // node_modules/@honcho-ai/sdk/dist/client.js
15137
- var require_client2 = __commonJS((exports) => {
15167
+ var require_client = __commonJS(function(exports) {
15138
15168
  Object.defineProperty(exports, "__esModule", { value: true });
15139
15169
  exports.Honcho = undefined;
15140
15170
  var api_version_1 = require_api_version();
15141
- var client_1 = require_client();
15171
+ var client_1 = require_client2();
15142
15172
  var message_1 = require_message();
15143
15173
  var pagination_1 = require_pagination();
15144
15174
  var peer_1 = require_peer();
@@ -15444,7 +15474,525 @@ var require_client2 = __commonJS((exports) => {
15444
15474
  exports.Honcho = Honcho;
15445
15475
  });
15446
15476
 
15447
- export { require_errors, require_message, require_pagination, require_conclusions, require_streaming, require_session_context, require_session, require_peer, require_client2 as require_client };
15477
+ // src/config.ts
15478
+ import { homedir as homedir2 } from "os";
15479
+ import { join as join3, basename, dirname, resolve, sep } from "path";
15480
+ import { fileURLToPath } from "url";
15481
+ import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, statSync, writeFileSync as writeFileSync2 } from "fs";
15482
+
15483
+ // src/git.ts
15484
+ import { execSync } from "child_process";
15485
+ import { existsSync } from "fs";
15486
+ import { join } from "path";
15487
+ function isGitRepo(cwd) {
15488
+ return existsSync(join(cwd, ".git"));
15489
+ }
15490
+ function gitCommand(cwd, args) {
15491
+ try {
15492
+ return execSync(`git ${args}`, { cwd, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
15493
+ } catch {
15494
+ return null;
15495
+ }
15496
+ }
15497
+ function captureGitState(cwd) {
15498
+ if (!isGitRepo(cwd)) {
15499
+ return null;
15500
+ }
15501
+ const branch = gitCommand(cwd, "rev-parse --abbrev-ref HEAD") || "unknown";
15502
+ const commit = gitCommand(cwd, "rev-parse --short HEAD") || "unknown";
15503
+ const commitMessage = gitCommand(cwd, "log -1 --format=%s") || "";
15504
+ const statusOutput = gitCommand(cwd, "status --porcelain") || "";
15505
+ const isDirty = statusOutput.length > 0;
15506
+ const dirtyFiles = isDirty ? statusOutput.split(`
15507
+ `).filter((line) => line.trim()).map((line) => line.slice(3).trim()).slice(0, 20) : [];
15508
+ return {
15509
+ branch,
15510
+ commit,
15511
+ commitMessage,
15512
+ isDirty,
15513
+ dirtyFiles,
15514
+ timestamp: new Date().toISOString()
15515
+ };
15516
+ }
15517
+
15518
+ // src/cache.ts
15519
+ import { homedir } from "os";
15520
+ import { join as join2 } from "path";
15521
+ import { existsSync as existsSync2, readFileSync, writeFileSync, mkdirSync } from "fs";
15522
+ var CACHE_DIR = join2(homedir(), ".honcho");
15523
+ var ID_CACHE_FILE = join2(CACHE_DIR, "cache.json");
15524
+ var CONTEXT_CACHE_FILE = join2(CACHE_DIR, "context-cache.json");
15525
+ function ensureCacheDir() {
15526
+ if (!existsSync2(CACHE_DIR)) {
15527
+ mkdirSync(CACHE_DIR, { recursive: true });
15528
+ }
15529
+ }
15530
+ function loadIdCache() {
15531
+ ensureCacheDir();
15532
+ if (!existsSync2(ID_CACHE_FILE)) {
15533
+ return {};
15534
+ }
15535
+ try {
15536
+ return JSON.parse(readFileSync(ID_CACHE_FILE, "utf-8"));
15537
+ } catch {
15538
+ return {};
15539
+ }
15540
+ }
15541
+ function getClaudeInstanceId() {
15542
+ const cache = loadIdCache();
15543
+ return cache.claudeInstanceId || null;
15544
+ }
15545
+ function getInstanceIdForCwd(cwd) {
15546
+ const cache = loadIdCache();
15547
+ return cache.sessions?.[cwd]?.instanceId ?? null;
15548
+ }
15549
+ var CONTEXT_CACHE_KNOWN_KEYS = new Set([
15550
+ "claudeContext",
15551
+ "summaries",
15552
+ "messageCount"
15553
+ ]);
15554
+ var GIT_STATE_FILE = join2(CACHE_DIR, "git-state.json");
15555
+ // node_modules/@honcho-ai/harness-plugin-core/src/telemetry.ts
15556
+ var HEADER_HOST = "X-Honcho-Host";
15557
+ var HEADER_PLUGIN = "X-Honcho-Plugin";
15558
+ var HEADER_AGENT_MODEL = "X-Honcho-Agent-Model";
15559
+ function sanitize(value) {
15560
+ if (typeof value !== "string")
15561
+ return;
15562
+ const s = value.replace(/[\r\n]+/g, " ").trim();
15563
+ return s || undefined;
15564
+ }
15565
+ function token(name, ver) {
15566
+ const clean = (v) => sanitize(v)?.replace(/[\s()/;]+/g, "-");
15567
+ const n = clean(name);
15568
+ const v = clean(ver);
15569
+ if (n && v)
15570
+ return `${n}/${v}`;
15571
+ return n || v;
15572
+ }
15573
+ function hostHeaderValue(id = {}) {
15574
+ const host = token(id.host, id.hostVersion);
15575
+ if (!host)
15576
+ return;
15577
+ const platform = token(id.platform ?? process.platform, undefined);
15578
+ return platform ? `${host} (${platform})` : host;
15579
+ }
15580
+ function pluginHeaderValue(id = {}) {
15581
+ return token(id.plugin, id.pluginVersion);
15582
+ }
15583
+ function telemetryHeaders(id = {}, extra) {
15584
+ const headers = {};
15585
+ const host = hostHeaderValue(id);
15586
+ const plugin = pluginHeaderValue(id);
15587
+ const model = sanitize(id.model);
15588
+ if (host)
15589
+ headers[HEADER_HOST] = host;
15590
+ if (plugin)
15591
+ headers[HEADER_PLUGIN] = plugin;
15592
+ if (model)
15593
+ headers[HEADER_AGENT_MODEL] = model;
15594
+ if (extra) {
15595
+ for (const [k, v] of Object.entries(extra)) {
15596
+ const value = sanitize(v);
15597
+ if (value)
15598
+ headers[k] = value;
15599
+ }
15600
+ }
15601
+ return headers;
15602
+ }
15603
+ // src/config.ts
15604
+ function sanitizeForSessionName(s) {
15605
+ return s.toLowerCase().replace(/[^a-z0-9-_]/g, "-");
15606
+ }
15607
+ var HONCHO_BASE_URLS = {
15608
+ production: "https://api.honcho.dev/v3",
15609
+ local: "http://localhost:8000/v3"
15610
+ };
15611
+ var _detectedHost = null;
15612
+ function setDetectedHost2(host) {
15613
+ _detectedHost = host;
15614
+ }
15615
+ function getDetectedHost() {
15616
+ return _detectedHost ?? "claude_code";
15617
+ }
15618
+ var DEFAULT_WORKSPACE = {
15619
+ cursor: "cursor",
15620
+ claude_code: "claude_code",
15621
+ obsidian: "obsidian"
15622
+ };
15623
+ var DEFAULT_AI_PEER = {
15624
+ cursor: "cursor",
15625
+ claude_code: "claude",
15626
+ obsidian: "honcho"
15627
+ };
15628
+ function deepEqual(a, b) {
15629
+ if (a === b)
15630
+ return true;
15631
+ if (a == null || b == null)
15632
+ return a === b;
15633
+ if (typeof a !== typeof b)
15634
+ return false;
15635
+ if (typeof a !== "object")
15636
+ return false;
15637
+ const aObj = a;
15638
+ const bObj = b;
15639
+ const keys = new Set([...Object.keys(aObj), ...Object.keys(bObj)]);
15640
+ for (const key of keys) {
15641
+ if (!deepEqual(aObj[key], bObj[key]))
15642
+ return false;
15643
+ }
15644
+ return true;
15645
+ }
15646
+ var CONFIG_DIR = join3(homedir2(), ".honcho");
15647
+ var CONFIG_FILE = join3(CONFIG_DIR, "config.json");
15648
+ function getConfigDir2() {
15649
+ return CONFIG_DIR;
15650
+ }
15651
+ function getConfigPath2() {
15652
+ return CONFIG_FILE;
15653
+ }
15654
+ function configExists2() {
15655
+ return existsSync3(CONFIG_FILE);
15656
+ }
15657
+ function getPluginVersion() {
15658
+ const root = process.env.CLAUDE_PLUGIN_ROOT;
15659
+ const candidates = [
15660
+ ...root ? [join3(root, ".claude-plugin", "plugin.json")] : [],
15661
+ fileURLToPath(new URL("../.claude-plugin/plugin.json", import.meta.url))
15662
+ ];
15663
+ for (const manifest of candidates) {
15664
+ try {
15665
+ const version = JSON.parse(readFileSync2(manifest, "utf-8")).version;
15666
+ if (typeof version === "string" && version)
15667
+ return version;
15668
+ } catch {}
15669
+ }
15670
+ return "unknown";
15671
+ }
15672
+ function loadConfig2(host) {
15673
+ const resolvedHost = host ?? getDetectedHost();
15674
+ if (configExists2()) {
15675
+ try {
15676
+ const content = readFileSync2(CONFIG_FILE, "utf-8");
15677
+ const raw = JSON.parse(content);
15678
+ return resolveConfig2(raw, resolvedHost);
15679
+ } catch {}
15680
+ }
15681
+ return loadConfigFromEnv2(resolvedHost);
15682
+ }
15683
+ function resolveConfig2(raw, host) {
15684
+ const hostBlock = raw.hosts?.[host] ?? raw.hosts?.[host.replace(/_/g, "-")] ?? raw.hosts?.[host.replace(/-/g, "_")];
15685
+ const apiKey = process.env.HONCHO_API_KEY || hostBlock?.apiKey || raw.apiKey;
15686
+ if (!apiKey)
15687
+ return null;
15688
+ const peerName = raw.peerName || process.env.HONCHO_PEER_NAME || process.env.USER || process.env.USERNAME || "user";
15689
+ let workspace;
15690
+ let aiPeer;
15691
+ if (raw.globalOverride === true) {
15692
+ workspace = raw.workspace ?? DEFAULT_WORKSPACE[host];
15693
+ aiPeer = raw.aiPeer ?? hostBlock?.aiPeer ?? DEFAULT_AI_PEER[host];
15694
+ } else if (hostBlock) {
15695
+ workspace = hostBlock.workspace ?? DEFAULT_WORKSPACE[host];
15696
+ aiPeer = hostBlock.aiPeer ?? DEFAULT_AI_PEER[host];
15697
+ } else {
15698
+ workspace = process.env.HONCHO_WORKSPACE ?? raw.workspace ?? DEFAULT_WORKSPACE[host];
15699
+ if (host === "cursor") {
15700
+ aiPeer = raw.cursorPeer ?? DEFAULT_AI_PEER["cursor"];
15701
+ } else {
15702
+ aiPeer = raw.claudePeer ?? DEFAULT_AI_PEER["claude_code"];
15703
+ }
15704
+ }
15705
+ const config = {
15706
+ apiKey,
15707
+ peerName,
15708
+ workspace,
15709
+ aiPeer,
15710
+ sessionStrategy: hostBlock?.sessionStrategy ?? raw.sessionStrategy,
15711
+ sessionPeerPrefix: hostBlock?.sessionPeerPrefix ?? raw.sessionPeerPrefix,
15712
+ sessions: raw.sessions,
15713
+ saveMessages: hostBlock?.saveMessages ?? raw.saveMessages,
15714
+ saveToolUse: hostBlock?.saveToolUse ?? raw.saveToolUse,
15715
+ saveGitEvents: hostBlock?.saveGitEvents ?? raw.saveGitEvents,
15716
+ reasoningLevel: hostBlock?.reasoningLevel ?? raw.reasoningLevel,
15717
+ observationMode: hostBlock?.observationMode ?? raw.observationMode,
15718
+ messageUpload: hostBlock?.messageUpload ?? raw.messageUpload,
15719
+ contextRefresh: hostBlock?.contextRefresh ?? raw.contextRefresh,
15720
+ endpoint: hostBlock?.endpoint ?? raw.endpoint,
15721
+ redactPatterns: hostBlock?.redactPatterns ?? raw.redactPatterns,
15722
+ injection: hostBlock?.injection ?? raw.injection,
15723
+ rememberTool: hostBlock?.rememberTool ?? raw.rememberTool,
15724
+ enabled: hostBlock?.enabled ?? raw.enabled,
15725
+ logging: hostBlock?.logging ?? raw.logging,
15726
+ globalOverride: raw.globalOverride
15727
+ };
15728
+ return mergeWithEnvVars(config);
15729
+ }
15730
+ function loadConfigFromEnv2(host) {
15731
+ const apiKey = process.env.HONCHO_API_KEY;
15732
+ if (!apiKey) {
15733
+ return null;
15734
+ }
15735
+ const resolvedHost = host ?? getDetectedHost();
15736
+ const peerName = process.env.HONCHO_PEER_NAME || process.env.USER || process.env.USERNAME || "user";
15737
+ const workspace = process.env.HONCHO_WORKSPACE || DEFAULT_WORKSPACE[resolvedHost];
15738
+ const hostPeerEnv = resolvedHost === "cursor" ? process.env.HONCHO_CURSOR_PEER : process.env.HONCHO_CLAUDE_PEER;
15739
+ const aiPeer = process.env.HONCHO_AI_PEER || hostPeerEnv || DEFAULT_AI_PEER[resolvedHost];
15740
+ const endpoint = process.env.HONCHO_ENDPOINT;
15741
+ const config = {
15742
+ apiKey,
15743
+ peerName,
15744
+ workspace,
15745
+ aiPeer,
15746
+ saveMessages: process.env.HONCHO_SAVE_MESSAGES !== "false",
15747
+ saveToolUse: process.env.HONCHO_SAVE_TOOL_USE === "true",
15748
+ saveGitEvents: process.env.HONCHO_SAVE_GIT_EVENTS === "true",
15749
+ enabled: process.env.HONCHO_ENABLED !== "false",
15750
+ logging: process.env.HONCHO_LOGGING !== "false"
15751
+ };
15752
+ if (endpoint) {
15753
+ if (endpoint === "local") {
15754
+ config.endpoint = { environment: "local" };
15755
+ } else if (endpoint.startsWith("http")) {
15756
+ config.endpoint = { baseUrl: endpoint };
15757
+ }
15758
+ }
15759
+ return config;
15760
+ }
15761
+ function mergeWithEnvVars(config) {
15762
+ if (process.env.HONCHO_API_KEY) {
15763
+ config.apiKey = process.env.HONCHO_API_KEY;
15764
+ }
15765
+ if (process.env.HONCHO_PEER_NAME) {
15766
+ config.peerName = process.env.HONCHO_PEER_NAME;
15767
+ }
15768
+ if (process.env.HONCHO_ENABLED === "false") {
15769
+ config.enabled = false;
15770
+ }
15771
+ if (process.env.HONCHO_LOGGING === "false") {
15772
+ config.logging = false;
15773
+ }
15774
+ if (process.env.HONCHO_SAVE_TOOL_USE !== undefined) {
15775
+ config.saveToolUse = process.env.HONCHO_SAVE_TOOL_USE === "true";
15776
+ }
15777
+ if (process.env.HONCHO_SAVE_GIT_EVENTS !== undefined) {
15778
+ config.saveGitEvents = process.env.HONCHO_SAVE_GIT_EVENTS === "true";
15779
+ }
15780
+ return config;
15781
+ }
15782
+ function saveConfig2(config) {
15783
+ if (!existsSync3(CONFIG_DIR)) {
15784
+ mkdirSync2(CONFIG_DIR, { recursive: true });
15785
+ }
15786
+ let existing = {};
15787
+ if (existsSync3(CONFIG_FILE)) {
15788
+ try {
15789
+ existing = JSON.parse(readFileSync2(CONFIG_FILE, "utf-8"));
15790
+ } catch {}
15791
+ }
15792
+ if (config.sessions !== undefined) {
15793
+ existing.sessions = config.sessions;
15794
+ }
15795
+ const host = getDetectedHost();
15796
+ if (!existing.hosts)
15797
+ existing.hosts = {};
15798
+ const existingHost = existing.hosts[host] ?? {};
15799
+ const hostEntry = {};
15800
+ const setHostIfExplicit = (key, value, rootValue) => {
15801
+ if (value === undefined)
15802
+ return;
15803
+ const hasHostOverride = Object.prototype.hasOwnProperty.call(existingHost, key);
15804
+ if (hasHostOverride || !deepEqual(value, rootValue)) {
15805
+ hostEntry[key] = value;
15806
+ }
15807
+ };
15808
+ setHostIfExplicit("workspace", config.workspace, existing.workspace ?? DEFAULT_WORKSPACE[host]);
15809
+ setHostIfExplicit("aiPeer", config.aiPeer, existing.aiPeer ?? DEFAULT_AI_PEER[host]);
15810
+ const enabledForSave = process.env.HONCHO_ENABLED === "false" && config.enabled === false ? existingHost.enabled : config.enabled;
15811
+ const loggingForSave = process.env.HONCHO_LOGGING === "false" && config.logging === false ? existingHost.logging : config.logging;
15812
+ setHostIfExplicit("enabled", enabledForSave, existing.enabled);
15813
+ setHostIfExplicit("logging", loggingForSave, existing.logging);
15814
+ setHostIfExplicit("saveMessages", config.saveMessages, existing.saveMessages);
15815
+ setHostIfExplicit("sessionStrategy", config.sessionStrategy, existing.sessionStrategy);
15816
+ setHostIfExplicit("sessionPeerPrefix", config.sessionPeerPrefix, existing.sessionPeerPrefix);
15817
+ setHostIfExplicit("reasoningLevel", config.reasoningLevel, existing.reasoningLevel);
15818
+ setHostIfExplicit("observationMode", config.observationMode, existing.observationMode);
15819
+ setHostIfExplicit("messageUpload", config.messageUpload, existing.messageUpload);
15820
+ setHostIfExplicit("contextRefresh", config.contextRefresh, existing.contextRefresh);
15821
+ setHostIfExplicit("redactPatterns", config.redactPatterns, existing.redactPatterns);
15822
+ setHostIfExplicit("endpoint", config.endpoint, existing.endpoint);
15823
+ setHostIfExplicit("injection", config.injection, existing.injection);
15824
+ setHostIfExplicit("rememberTool", config.rememberTool, existing.rememberTool);
15825
+ if (existingHost.apiKey !== undefined) {
15826
+ hostEntry.apiKey = existingHost.apiKey;
15827
+ }
15828
+ existing.hosts[host] = hostEntry;
15829
+ writeFileSync2(CONFIG_FILE, JSON.stringify(existing, null, 2));
15830
+ }
15831
+ function saveRootField2(field, value) {
15832
+ if (!existsSync3(CONFIG_DIR)) {
15833
+ mkdirSync2(CONFIG_DIR, { recursive: true });
15834
+ }
15835
+ let existing = {};
15836
+ if (existsSync3(CONFIG_FILE)) {
15837
+ try {
15838
+ existing = JSON.parse(readFileSync2(CONFIG_FILE, "utf-8"));
15839
+ } catch {}
15840
+ }
15841
+ existing[field] = value;
15842
+ writeFileSync2(CONFIG_FILE, JSON.stringify(existing, null, 2));
15843
+ }
15844
+ function getClaudeSettingsPath2() {
15845
+ return join3(homedir2(), ".claude", "settings.json");
15846
+ }
15847
+ function getClaudeSettingsDir2() {
15848
+ return join3(homedir2(), ".claude");
15849
+ }
15850
+ function resolveWorktreeMainRoot(dir) {
15851
+ try {
15852
+ const gitPath = join3(dir, ".git");
15853
+ if (!statSync(gitPath).isFile())
15854
+ return null;
15855
+ const match = readFileSync2(gitPath, "utf-8").match(/^gitdir:\s*(.+?)\s*$/m);
15856
+ if (!match)
15857
+ return null;
15858
+ const gitdir = resolve(dir, match[1]);
15859
+ const idx = gitdir.lastIndexOf(`${sep}worktrees${sep}`);
15860
+ if (idx === -1)
15861
+ return null;
15862
+ const gitContainer = gitdir.slice(0, idx);
15863
+ if (basename(gitContainer) === ".git")
15864
+ return dirname(gitContainer);
15865
+ if (gitContainer.endsWith(".git"))
15866
+ return gitContainer;
15867
+ return null;
15868
+ } catch {
15869
+ return null;
15870
+ }
15871
+ }
15872
+ var MAX_GIT_WALK_UP = 12;
15873
+ function worktreeMainRootFor(cwd) {
15874
+ try {
15875
+ let dir = resolve(cwd);
15876
+ for (let i = 0;i < MAX_GIT_WALK_UP; i++) {
15877
+ if (existsSync3(join3(dir, ".git")))
15878
+ return resolveWorktreeMainRoot(dir);
15879
+ const parent = dirname(dir);
15880
+ if (parent === dir)
15881
+ break;
15882
+ dir = parent;
15883
+ }
15884
+ } catch {}
15885
+ return null;
15886
+ }
15887
+ function getSessionForPath(cwd, mainRoot) {
15888
+ const config = loadConfig2();
15889
+ if (!config?.sessions)
15890
+ return null;
15891
+ if (config.sessions[cwd])
15892
+ return config.sessions[cwd];
15893
+ const mr = mainRoot === undefined ? worktreeMainRootFor(cwd) : mainRoot;
15894
+ if (mr && config.sessions[mr])
15895
+ return config.sessions[mr];
15896
+ return null;
15897
+ }
15898
+ function deriveSessionName(strategy, cwd, opts = {}) {
15899
+ const usePrefix = opts.sessionPeerPrefix !== false;
15900
+ const peerPart = opts.peerName ? sanitizeForSessionName(opts.peerName) : "user";
15901
+ const repoPart = sanitizeForSessionName(basename(cwd));
15902
+ const base = usePrefix ? `${peerPart}-${repoPart}` : repoPart;
15903
+ switch (strategy) {
15904
+ case "git-branch": {
15905
+ if (opts.branch) {
15906
+ const branchPart = sanitizeForSessionName(opts.branch);
15907
+ return `${base}-${branchPart}`;
15908
+ }
15909
+ return base;
15910
+ }
15911
+ case "chat-instance": {
15912
+ if (opts.instanceId) {
15913
+ return usePrefix ? `${peerPart}-chat-${opts.instanceId}` : `chat-${opts.instanceId}`;
15914
+ }
15915
+ return base;
15916
+ }
15917
+ case "per-directory":
15918
+ default:
15919
+ return base;
15920
+ }
15921
+ }
15922
+ function getSessionName2(cwd, instanceId) {
15923
+ const config = loadConfig2();
15924
+ const strategy = config?.sessionStrategy ?? "per-directory";
15925
+ const mainRoot = worktreeMainRootFor(cwd);
15926
+ if (strategy === "per-directory") {
15927
+ const configuredSession = getSessionForPath(cwd, mainRoot);
15928
+ if (configuredSession) {
15929
+ return configuredSession;
15930
+ }
15931
+ }
15932
+ let branch;
15933
+ if (strategy === "git-branch") {
15934
+ branch = captureGitState(cwd)?.branch;
15935
+ }
15936
+ let resolvedInstanceId;
15937
+ if (strategy === "chat-instance") {
15938
+ resolvedInstanceId = instanceId || getInstanceIdForCwd(cwd) || getClaudeInstanceId() || undefined;
15939
+ }
15940
+ return deriveSessionName(strategy, mainRoot ?? cwd, {
15941
+ peerName: config?.peerName,
15942
+ sessionPeerPrefix: config?.sessionPeerPrefix,
15943
+ branch,
15944
+ instanceId: resolvedInstanceId
15945
+ });
15946
+ }
15947
+ function getContextRefreshConfig2() {
15948
+ const config = loadConfig2();
15949
+ return {
15950
+ messageThreshold: config?.contextRefresh?.messageThreshold ?? 30,
15951
+ ttlSeconds: config?.contextRefresh?.ttlSeconds ?? 300,
15952
+ skipDialectic: config?.contextRefresh?.skipDialectic ?? false
15953
+ };
15954
+ }
15955
+ function getHonchoBaseUrlForEndpoint(endpoint) {
15956
+ if (endpoint?.baseUrl) {
15957
+ const url = endpoint.baseUrl;
15958
+ return url.endsWith("/v3") ? url : `${url}/v3`;
15959
+ }
15960
+ if (endpoint?.environment === "local") {
15961
+ return HONCHO_BASE_URLS.local;
15962
+ }
15963
+ return HONCHO_BASE_URLS.production;
15964
+ }
15965
+ function getHonchoBaseUrl(config) {
15966
+ return getHonchoBaseUrlForEndpoint(config.endpoint);
15967
+ }
15968
+ function getTelemetryHeaders(host = getDetectedHost()) {
15969
+ return telemetryHeaders({
15970
+ host: host.replace(/_/g, "-"),
15971
+ plugin: "claude-honcho",
15972
+ pluginVersion: getPluginVersion()
15973
+ });
15974
+ }
15975
+ function getHonchoClientOptions2(config) {
15976
+ return {
15977
+ apiKey: config.apiKey,
15978
+ baseURL: getHonchoBaseUrl(config),
15979
+ workspaceId: config.workspace,
15980
+ timeout: 120000,
15981
+ maxRetries: 1,
15982
+ defaultHeaders: getTelemetryHeaders()
15983
+ };
15984
+ }
15985
+ function getEndpointInfo2(config) {
15986
+ if (config.endpoint?.baseUrl) {
15987
+ return { type: "custom", url: config.endpoint.baseUrl };
15988
+ }
15989
+ if (config.endpoint?.environment === "local") {
15990
+ return { type: "local", url: HONCHO_BASE_URLS.local };
15991
+ }
15992
+ return { type: "production", url: HONCHO_BASE_URLS.production };
15993
+ }
15994
+ var VALID_ENVIRONMENTS = new Set(["production", "local"]);
15995
+ export { __toESM, __commonJS, require_errors, require_message, require_pagination, require_conclusions, require_streaming, require_session_context, require_session, require_peer, require_client, telemetryHeaders, setDetectedHost2, getConfigDir2, getConfigPath2, configExists2, loadConfig2, loadConfigFromEnv2, saveConfig2, saveRootField2, getClaudeSettingsPath2, getClaudeSettingsDir2, getSessionName2, getContextRefreshConfig2, getHonchoClientOptions2, getEndpointInfo2 };
15448
15996
 
15449
- //# debugId=567E6885C838D4C364756E2164756E21
15450
- //# sourceMappingURL=chunk-xdntcesh.js.map
15997
+ //# debugId=D1060418A178034464756E2164756E21
15998
+ //# sourceMappingURL=chunk-g0m354bn.js.map