@codexhost/cli-linux-arm64 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +3166 -3040
  4. package/app/console-web.js +1156 -585
  5. package/app/desktop-controller.mjs +645 -264
  6. package/app/host-runtime.mjs +10906 -10282
  7. package/app/plugins/antigravity/plugin.mjs +515 -369
  8. package/app/plugins/claude-code/plugin.mjs +583 -438
  9. package/app/plugins/codebuddy/plugin.mjs +551 -429
  10. package/app/plugins/codex-usage/plugin.mjs +344 -224
  11. package/app/plugins/copilot/plugin.mjs +408 -286
  12. package/app/plugins/cursor-cli/plugin.mjs +499 -360
  13. package/app/plugins/deepseek-harness/plugin.mjs +759 -520
  14. package/app/plugins/devin/plugin.mjs +385 -265
  15. package/app/plugins/grok/plugin.mjs +638 -516
  16. package/app/plugins/hermes/plugin.mjs +456 -334
  17. package/app/plugins/kimi-code/plugin.mjs +454 -332
  18. package/app/plugins/kiro-cli/plugin.mjs +445 -325
  19. package/app/plugins/omp/plugin.mjs +707 -339
  20. package/app/plugins/opencode/plugin.mjs +873 -741
  21. package/app/plugins/pi/plugin.mjs +481 -359
  22. package/app/plugins/qoder/plugin.mjs +682 -560
  23. package/app/plugins/qoder-cn/plugin.mjs +682 -560
  24. package/app/plugins/qwen-code/plugin.mjs +475 -355
  25. package/app/plugins/workbuddy/plugin.mjs +549 -429
  26. package/app/plugins/zcode/plugin.mjs +352 -232
  27. package/app/renderer-extension.js +1706 -945
  28. package/app/web/assets/{index-IvFk9KT-.js → index-DUOvhHbV.js} +82 -82
  29. package/app/web/codexhost-settings.js +416 -51
  30. package/app/web/index.html +1 -1
  31. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +64 -64
  32. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
  33. package/app/web/plugins/deepseek-ai__dsh-api-workspace-controller/client.js +1 -1
  34. package/app/web/plugins/deepseek-ai__dsh-client-shortcuts/client.js +1 -1
  35. package/app/web/plugins/deepseek-ai__dsh-client-ui-brand-official/client.js +1 -1
  36. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +74 -74
  37. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +72 -72
  38. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +97 -97
  39. package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +1 -1
  40. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +2 -2
  41. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
  42. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
  43. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +8 -8
  44. package/app/web-modules/server.mjs +2132 -1312
  45. package/bin/codexhost +0 -0
  46. package/libexec/codexhost-shim +0 -0
  47. package/libexec/codexhost-updater +0 -0
  48. package/package.json +1 -1
@@ -716,8 +716,8 @@ function cached(getter) {
716
716
  }
717
717
  };
718
718
  }
719
- function nullish(input) {
720
- return input === null || input === void 0;
719
+ function nullish(input2) {
720
+ return input2 === null || input2 === void 0;
721
721
  }
722
722
  function cleanRegex(source) {
723
723
  const start = source.startsWith("^") ? 1 : 0;
@@ -804,8 +804,8 @@ function randomString(length = 10) {
804
804
  function esc(str) {
805
805
  return JSON.stringify(str);
806
806
  }
807
- function slugify(input) {
808
- return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
807
+ function slugify(input2) {
808
+ return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
809
809
  }
810
810
  var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
811
811
  };
@@ -1210,19 +1210,19 @@ function finalizeIssue(iss, ctx, config2) {
1210
1210
  }
1211
1211
  return rest;
1212
1212
  }
1213
- function getSizableOrigin(input) {
1214
- if (input instanceof Set)
1213
+ function getSizableOrigin(input2) {
1214
+ if (input2 instanceof Set)
1215
1215
  return "set";
1216
- if (input instanceof Map)
1216
+ if (input2 instanceof Map)
1217
1217
  return "map";
1218
- if (input instanceof File)
1218
+ if (input2 instanceof File)
1219
1219
  return "file";
1220
1220
  return "unknown";
1221
1221
  }
1222
- function getLengthableOrigin(input) {
1223
- if (Array.isArray(input))
1222
+ function getLengthableOrigin(input2) {
1223
+ if (Array.isArray(input2))
1224
1224
  return "array";
1225
- if (typeof input === "string")
1225
+ if (typeof input2 === "string")
1226
1226
  return "string";
1227
1227
  return "unknown";
1228
1228
  }
@@ -1248,12 +1248,12 @@ function parsedType(data) {
1248
1248
  return t;
1249
1249
  }
1250
1250
  function issue(...args) {
1251
- const [iss, input, inst] = args;
1251
+ const [iss, input2, inst] = args;
1252
1252
  if (typeof iss === "string") {
1253
1253
  return {
1254
1254
  message: iss,
1255
1255
  code: "custom",
1256
- input,
1256
+ input: input2,
1257
1257
  inst
1258
1258
  };
1259
1259
  }
@@ -1797,23 +1797,23 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
1797
1797
  bag.pattern = integer;
1798
1798
  });
1799
1799
  inst._zod.check = (payload) => {
1800
- const input = payload.value;
1800
+ const input2 = payload.value;
1801
1801
  if (isInt) {
1802
- if (!Number.isInteger(input)) {
1802
+ if (!Number.isInteger(input2)) {
1803
1803
  payload.issues.push({
1804
1804
  expected: origin,
1805
1805
  format: def.format,
1806
1806
  code: "invalid_type",
1807
1807
  continue: false,
1808
- input,
1808
+ input: input2,
1809
1809
  inst
1810
1810
  });
1811
1811
  return;
1812
1812
  }
1813
- if (!Number.isSafeInteger(input)) {
1814
- if (input > 0) {
1813
+ if (!Number.isSafeInteger(input2)) {
1814
+ if (input2 > 0) {
1815
1815
  payload.issues.push({
1816
- input,
1816
+ input: input2,
1817
1817
  code: "too_big",
1818
1818
  maximum: Number.MAX_SAFE_INTEGER,
1819
1819
  note: "Integers must be within the safe integer range.",
@@ -1824,7 +1824,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
1824
1824
  });
1825
1825
  } else {
1826
1826
  payload.issues.push({
1827
- input,
1827
+ input: input2,
1828
1828
  code: "too_small",
1829
1829
  minimum: Number.MIN_SAFE_INTEGER,
1830
1830
  note: "Integers must be within the safe integer range.",
@@ -1837,10 +1837,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
1837
1837
  return;
1838
1838
  }
1839
1839
  }
1840
- if (input < minimum) {
1840
+ if (input2 < minimum) {
1841
1841
  payload.issues.push({
1842
1842
  origin: "number",
1843
- input,
1843
+ input: input2,
1844
1844
  code: "too_small",
1845
1845
  minimum,
1846
1846
  inclusive: true,
@@ -1848,10 +1848,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
1848
1848
  continue: !def.abort
1849
1849
  });
1850
1850
  }
1851
- if (input > maximum) {
1851
+ if (input2 > maximum) {
1852
1852
  payload.issues.push({
1853
1853
  origin: "number",
1854
- input,
1854
+ input: input2,
1855
1855
  code: "too_big",
1856
1856
  maximum,
1857
1857
  inclusive: true,
@@ -1871,11 +1871,11 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
1871
1871
  bag.maximum = maximum;
1872
1872
  });
1873
1873
  inst._zod.check = (payload) => {
1874
- const input = payload.value;
1875
- if (input < minimum) {
1874
+ const input2 = payload.value;
1875
+ if (input2 < minimum) {
1876
1876
  payload.issues.push({
1877
1877
  origin: "bigint",
1878
- input,
1878
+ input: input2,
1879
1879
  code: "too_small",
1880
1880
  minimum,
1881
1881
  inclusive: true,
@@ -1883,10 +1883,10 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
1883
1883
  continue: !def.abort
1884
1884
  });
1885
1885
  }
1886
- if (input > maximum) {
1886
+ if (input2 > maximum) {
1887
1887
  payload.issues.push({
1888
1888
  origin: "bigint",
1889
- input,
1889
+ input: input2,
1890
1890
  code: "too_big",
1891
1891
  maximum,
1892
1892
  inclusive: true,
@@ -1909,16 +1909,16 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
1909
1909
  inst2._zod.bag.maximum = def.maximum;
1910
1910
  });
1911
1911
  inst._zod.check = (payload) => {
1912
- const input = payload.value;
1913
- const size = input.size;
1912
+ const input2 = payload.value;
1913
+ const size = input2.size;
1914
1914
  if (size <= def.maximum)
1915
1915
  return;
1916
1916
  payload.issues.push({
1917
- origin: getSizableOrigin(input),
1917
+ origin: getSizableOrigin(input2),
1918
1918
  code: "too_big",
1919
1919
  maximum: def.maximum,
1920
1920
  inclusive: true,
1921
- input,
1921
+ input: input2,
1922
1922
  inst,
1923
1923
  continue: !def.abort
1924
1924
  });
@@ -1937,16 +1937,16 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
1937
1937
  inst2._zod.bag.minimum = def.minimum;
1938
1938
  });
1939
1939
  inst._zod.check = (payload) => {
1940
- const input = payload.value;
1941
- const size = input.size;
1940
+ const input2 = payload.value;
1941
+ const size = input2.size;
1942
1942
  if (size >= def.minimum)
1943
1943
  return;
1944
1944
  payload.issues.push({
1945
- origin: getSizableOrigin(input),
1945
+ origin: getSizableOrigin(input2),
1946
1946
  code: "too_small",
1947
1947
  minimum: def.minimum,
1948
1948
  inclusive: true,
1949
- input,
1949
+ input: input2,
1950
1950
  inst,
1951
1951
  continue: !def.abort
1952
1952
  });
@@ -1966,13 +1966,13 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
1966
1966
  bag.size = def.size;
1967
1967
  });
1968
1968
  inst._zod.check = (payload) => {
1969
- const input = payload.value;
1970
- const size = input.size;
1969
+ const input2 = payload.value;
1970
+ const size = input2.size;
1971
1971
  if (size === def.size)
1972
1972
  return;
1973
1973
  const tooBig = size > def.size;
1974
1974
  payload.issues.push({
1975
- origin: getSizableOrigin(input),
1975
+ origin: getSizableOrigin(input2),
1976
1976
  ...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
1977
1977
  inclusive: true,
1978
1978
  exact: true,
@@ -1995,17 +1995,17 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
1995
1995
  inst2._zod.bag.maximum = def.maximum;
1996
1996
  });
1997
1997
  inst._zod.check = (payload) => {
1998
- const input = payload.value;
1999
- const length = input.length;
1998
+ const input2 = payload.value;
1999
+ const length = input2.length;
2000
2000
  if (length <= def.maximum)
2001
2001
  return;
2002
- const origin = getLengthableOrigin(input);
2002
+ const origin = getLengthableOrigin(input2);
2003
2003
  payload.issues.push({
2004
2004
  origin,
2005
2005
  code: "too_big",
2006
2006
  maximum: def.maximum,
2007
2007
  inclusive: true,
2008
- input,
2008
+ input: input2,
2009
2009
  inst,
2010
2010
  continue: !def.abort
2011
2011
  });
@@ -2024,17 +2024,17 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
2024
2024
  inst2._zod.bag.minimum = def.minimum;
2025
2025
  });
2026
2026
  inst._zod.check = (payload) => {
2027
- const input = payload.value;
2028
- const length = input.length;
2027
+ const input2 = payload.value;
2028
+ const length = input2.length;
2029
2029
  if (length >= def.minimum)
2030
2030
  return;
2031
- const origin = getLengthableOrigin(input);
2031
+ const origin = getLengthableOrigin(input2);
2032
2032
  payload.issues.push({
2033
2033
  origin,
2034
2034
  code: "too_small",
2035
2035
  minimum: def.minimum,
2036
2036
  inclusive: true,
2037
- input,
2037
+ input: input2,
2038
2038
  inst,
2039
2039
  continue: !def.abort
2040
2040
  });
@@ -2054,11 +2054,11 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
2054
2054
  bag.length = def.length;
2055
2055
  });
2056
2056
  inst._zod.check = (payload) => {
2057
- const input = payload.value;
2058
- const length = input.length;
2057
+ const input2 = payload.value;
2058
+ const length = input2.length;
2059
2059
  if (length === def.length)
2060
2060
  return;
2061
- const origin = getLengthableOrigin(input);
2061
+ const origin = getLengthableOrigin(input2);
2062
2062
  const tooBig = length > def.length;
2063
2063
  payload.issues.push({
2064
2064
  origin,
@@ -2729,15 +2729,15 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
2729
2729
  payload.value = Number(payload.value);
2730
2730
  } catch (_) {
2731
2731
  }
2732
- const input = payload.value;
2733
- if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
2732
+ const input2 = payload.value;
2733
+ if (typeof input2 === "number" && !Number.isNaN(input2) && Number.isFinite(input2)) {
2734
2734
  return payload;
2735
2735
  }
2736
- const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
2736
+ const received = typeof input2 === "number" ? Number.isNaN(input2) ? "NaN" : !Number.isFinite(input2) ? "Infinity" : void 0 : void 0;
2737
2737
  payload.issues.push({
2738
2738
  expected: "number",
2739
2739
  code: "invalid_type",
2740
- input,
2740
+ input: input2,
2741
2741
  inst,
2742
2742
  ...received ? { received } : {}
2743
2743
  });
@@ -2757,13 +2757,13 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
2757
2757
  payload.value = Boolean(payload.value);
2758
2758
  } catch (_) {
2759
2759
  }
2760
- const input = payload.value;
2761
- if (typeof input === "boolean")
2760
+ const input2 = payload.value;
2761
+ if (typeof input2 === "boolean")
2762
2762
  return payload;
2763
2763
  payload.issues.push({
2764
2764
  expected: "boolean",
2765
2765
  code: "invalid_type",
2766
- input,
2766
+ input: input2,
2767
2767
  inst
2768
2768
  });
2769
2769
  return payload;
@@ -2796,13 +2796,13 @@ var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, d
2796
2796
  var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
2797
2797
  $ZodType.init(inst, def);
2798
2798
  inst._zod.parse = (payload, _ctx) => {
2799
- const input = payload.value;
2800
- if (typeof input === "symbol")
2799
+ const input2 = payload.value;
2800
+ if (typeof input2 === "symbol")
2801
2801
  return payload;
2802
2802
  payload.issues.push({
2803
2803
  expected: "symbol",
2804
2804
  code: "invalid_type",
2805
- input,
2805
+ input: input2,
2806
2806
  inst
2807
2807
  });
2808
2808
  return payload;
@@ -2813,13 +2813,13 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
2813
2813
  inst._zod.pattern = _undefined;
2814
2814
  inst._zod.values = /* @__PURE__ */ new Set([void 0]);
2815
2815
  inst._zod.parse = (payload, _ctx) => {
2816
- const input = payload.value;
2817
- if (typeof input === "undefined")
2816
+ const input2 = payload.value;
2817
+ if (typeof input2 === "undefined")
2818
2818
  return payload;
2819
2819
  payload.issues.push({
2820
2820
  expected: "undefined",
2821
2821
  code: "invalid_type",
2822
- input,
2822
+ input: input2,
2823
2823
  inst
2824
2824
  });
2825
2825
  return payload;
@@ -2830,13 +2830,13 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
2830
2830
  inst._zod.pattern = _null;
2831
2831
  inst._zod.values = /* @__PURE__ */ new Set([null]);
2832
2832
  inst._zod.parse = (payload, _ctx) => {
2833
- const input = payload.value;
2834
- if (input === null)
2833
+ const input2 = payload.value;
2834
+ if (input2 === null)
2835
2835
  return payload;
2836
2836
  payload.issues.push({
2837
2837
  expected: "null",
2838
2838
  code: "invalid_type",
2839
- input,
2839
+ input: input2,
2840
2840
  inst
2841
2841
  });
2842
2842
  return payload;
@@ -2865,13 +2865,13 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
2865
2865
  var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
2866
2866
  $ZodType.init(inst, def);
2867
2867
  inst._zod.parse = (payload, _ctx) => {
2868
- const input = payload.value;
2869
- if (typeof input === "undefined")
2868
+ const input2 = payload.value;
2869
+ if (typeof input2 === "undefined")
2870
2870
  return payload;
2871
2871
  payload.issues.push({
2872
2872
  expected: "void",
2873
2873
  code: "invalid_type",
2874
- input,
2874
+ input: input2,
2875
2875
  inst
2876
2876
  });
2877
2877
  return payload;
@@ -2886,15 +2886,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
2886
2886
  } catch (_err) {
2887
2887
  }
2888
2888
  }
2889
- const input = payload.value;
2890
- const isDate = input instanceof Date;
2891
- const isValidDate = isDate && !Number.isNaN(input.getTime());
2889
+ const input2 = payload.value;
2890
+ const isDate = input2 instanceof Date;
2891
+ const isValidDate = isDate && !Number.isNaN(input2.getTime());
2892
2892
  if (isValidDate)
2893
2893
  return payload;
2894
2894
  payload.issues.push({
2895
2895
  expected: "date",
2896
2896
  code: "invalid_type",
2897
- input,
2897
+ input: input2,
2898
2898
  ...isDate ? { received: "Invalid Date" } : {},
2899
2899
  inst
2900
2900
  });
@@ -2910,20 +2910,20 @@ function handleArrayResult(result, final, index) {
2910
2910
  var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
2911
2911
  $ZodType.init(inst, def);
2912
2912
  inst._zod.parse = (payload, ctx) => {
2913
- const input = payload.value;
2914
- if (!Array.isArray(input)) {
2913
+ const input2 = payload.value;
2914
+ if (!Array.isArray(input2)) {
2915
2915
  payload.issues.push({
2916
2916
  expected: "array",
2917
2917
  code: "invalid_type",
2918
- input,
2918
+ input: input2,
2919
2919
  inst
2920
2920
  });
2921
2921
  return payload;
2922
2922
  }
2923
- payload.value = Array(input.length);
2923
+ payload.value = Array(input2.length);
2924
2924
  const proms = [];
2925
- for (let i = 0; i < input.length; i++) {
2926
- const item = input[i];
2925
+ for (let i = 0; i < input2.length; i++) {
2926
+ const item = input2[i];
2927
2927
  const result = def.element._zod.run({
2928
2928
  value: item,
2929
2929
  issues: []
@@ -2940,8 +2940,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
2940
2940
  return payload;
2941
2941
  };
2942
2942
  });
2943
- function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
2944
- const isPresent = key in input;
2943
+ function handlePropertyResult(result, final, key, input2, isOptionalIn, isOptionalOut) {
2944
+ const isPresent = key in input2;
2945
2945
  if (result.issues.length) {
2946
2946
  if (isOptionalIn && isOptionalOut && !isPresent) {
2947
2947
  return;
@@ -2983,14 +2983,14 @@ function normalizeDef(def) {
2983
2983
  optionalKeys: new Set(okeys)
2984
2984
  };
2985
2985
  }
2986
- function handleCatchall(proms, input, payload, ctx, def, inst) {
2986
+ function handleCatchall(proms, input2, payload, ctx, def, inst) {
2987
2987
  const unrecognized = [];
2988
2988
  const keySet = def.keySet;
2989
2989
  const _catchall = def.catchall._zod;
2990
2990
  const t = _catchall.def.type;
2991
2991
  const isOptionalIn = _catchall.optin === "optional";
2992
2992
  const isOptionalOut = _catchall.optout === "optional";
2993
- for (const key in input) {
2993
+ for (const key in input2) {
2994
2994
  if (key === "__proto__")
2995
2995
  continue;
2996
2996
  if (keySet.has(key))
@@ -2999,18 +2999,18 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
2999
2999
  unrecognized.push(key);
3000
3000
  continue;
3001
3001
  }
3002
- const r = _catchall.run({ value: input[key], issues: [] }, ctx);
3002
+ const r = _catchall.run({ value: input2[key], issues: [] }, ctx);
3003
3003
  if (r instanceof Promise) {
3004
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
3004
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
3005
3005
  } else {
3006
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
3006
+ handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
3007
3007
  }
3008
3008
  }
3009
3009
  if (unrecognized.length) {
3010
3010
  payload.issues.push({
3011
3011
  code: "unrecognized_keys",
3012
3012
  keys: unrecognized,
3013
- input,
3013
+ input: input2,
3014
3014
  inst
3015
3015
  });
3016
3016
  }
@@ -3054,12 +3054,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3054
3054
  let value;
3055
3055
  inst._zod.parse = (payload, ctx) => {
3056
3056
  value ?? (value = _normalized.value);
3057
- const input = payload.value;
3058
- if (!isObject2(input)) {
3057
+ const input2 = payload.value;
3058
+ if (!isObject2(input2)) {
3059
3059
  payload.issues.push({
3060
3060
  expected: "object",
3061
3061
  code: "invalid_type",
3062
- input,
3062
+ input: input2,
3063
3063
  inst
3064
3064
  });
3065
3065
  return payload;
@@ -3071,17 +3071,17 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3071
3071
  const el = shape[key];
3072
3072
  const isOptionalIn = el._zod.optin === "optional";
3073
3073
  const isOptionalOut = el._zod.optout === "optional";
3074
- const r = el._zod.run({ value: input[key], issues: [] }, ctx);
3074
+ const r = el._zod.run({ value: input2[key], issues: [] }, ctx);
3075
3075
  if (r instanceof Promise) {
3076
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
3076
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
3077
3077
  } else {
3078
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
3078
+ handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
3079
3079
  }
3080
3080
  }
3081
3081
  if (!catchall) {
3082
3082
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
3083
3083
  }
3084
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
3084
+ return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
3085
3085
  };
3086
3086
  });
3087
3087
  var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
@@ -3190,12 +3190,12 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3190
3190
  let value;
3191
3191
  inst._zod.parse = (payload, ctx) => {
3192
3192
  value ?? (value = _normalized.value);
3193
- const input = payload.value;
3194
- if (!isObject2(input)) {
3193
+ const input2 = payload.value;
3194
+ if (!isObject2(input2)) {
3195
3195
  payload.issues.push({
3196
3196
  expected: "object",
3197
3197
  code: "invalid_type",
3198
- input,
3198
+ input: input2,
3199
3199
  inst
3200
3200
  });
3201
3201
  return payload;
@@ -3206,7 +3206,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3206
3206
  payload = fastpass(payload, ctx);
3207
3207
  if (!catchall)
3208
3208
  return payload;
3209
- return handleCatchall([], input, payload, ctx, value, inst);
3209
+ return handleCatchall([], input2, payload, ctx, value, inst);
3210
3210
  }
3211
3211
  return superParse(payload, ctx);
3212
3212
  };
@@ -3366,17 +3366,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3366
3366
  return map2;
3367
3367
  });
3368
3368
  inst._zod.parse = (payload, ctx) => {
3369
- const input = payload.value;
3370
- if (!isObject(input)) {
3369
+ const input2 = payload.value;
3370
+ if (!isObject(input2)) {
3371
3371
  payload.issues.push({
3372
3372
  code: "invalid_type",
3373
3373
  expected: "object",
3374
- input,
3374
+ input: input2,
3375
3375
  inst
3376
3376
  });
3377
3377
  return payload;
3378
3378
  }
3379
- const opt = disc.value.get(input?.[def.discriminator]);
3379
+ const opt = disc.value.get(input2?.[def.discriminator]);
3380
3380
  if (opt) {
3381
3381
  return opt._zod.run(payload, ctx);
3382
3382
  }
@@ -3389,7 +3389,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3389
3389
  note: "No matching discriminator",
3390
3390
  discriminator: def.discriminator,
3391
3391
  options: Array.from(disc.value.keys()),
3392
- input,
3392
+ input: input2,
3393
3393
  path: [def.discriminator],
3394
3394
  inst
3395
3395
  });
@@ -3399,9 +3399,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3399
3399
  var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
3400
3400
  $ZodType.init(inst, def);
3401
3401
  inst._zod.parse = (payload, ctx) => {
3402
- const input = payload.value;
3403
- const left = def.left._zod.run({ value: input, issues: [] }, ctx);
3404
- const right = def.right._zod.run({ value: input, issues: [] }, ctx);
3402
+ const input2 = payload.value;
3403
+ const left = def.left._zod.run({ value: input2, issues: [] }, ctx);
3404
+ const right = def.right._zod.run({ value: input2, issues: [] }, ctx);
3405
3405
  const async = left instanceof Promise || right instanceof Promise;
3406
3406
  if (async) {
3407
3407
  return Promise.all([left, right]).then(([left2, right2]) => {
@@ -3498,10 +3498,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3498
3498
  $ZodType.init(inst, def);
3499
3499
  const items = def.items;
3500
3500
  inst._zod.parse = (payload, ctx) => {
3501
- const input = payload.value;
3502
- if (!Array.isArray(input)) {
3501
+ const input2 = payload.value;
3502
+ if (!Array.isArray(input2)) {
3503
3503
  payload.issues.push({
3504
- input,
3504
+ input: input2,
3505
3505
  inst,
3506
3506
  expected: "tuple",
3507
3507
  code: "invalid_type"
@@ -3513,23 +3513,23 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3513
3513
  const optinStart = getTupleOptStart(items, "optin");
3514
3514
  const optoutStart = getTupleOptStart(items, "optout");
3515
3515
  if (!def.rest) {
3516
- if (input.length < optinStart) {
3516
+ if (input2.length < optinStart) {
3517
3517
  payload.issues.push({
3518
3518
  code: "too_small",
3519
3519
  minimum: optinStart,
3520
3520
  inclusive: true,
3521
- input,
3521
+ input: input2,
3522
3522
  inst,
3523
3523
  origin: "array"
3524
3524
  });
3525
3525
  return payload;
3526
3526
  }
3527
- if (input.length > items.length) {
3527
+ if (input2.length > items.length) {
3528
3528
  payload.issues.push({
3529
3529
  code: "too_big",
3530
3530
  maximum: items.length,
3531
3531
  inclusive: true,
3532
- input,
3532
+ input: input2,
3533
3533
  inst,
3534
3534
  origin: "array"
3535
3535
  });
@@ -3537,7 +3537,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3537
3537
  }
3538
3538
  const itemResults = new Array(items.length);
3539
3539
  for (let i = 0; i < items.length; i++) {
3540
- const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
3540
+ const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
3541
3541
  if (r instanceof Promise) {
3542
3542
  proms.push(r.then((rr) => {
3543
3543
  itemResults[i] = rr;
@@ -3548,7 +3548,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3548
3548
  }
3549
3549
  if (def.rest) {
3550
3550
  let i = items.length - 1;
3551
- const rest = input.slice(items.length);
3551
+ const rest = input2.slice(items.length);
3552
3552
  for (const el of rest) {
3553
3553
  i++;
3554
3554
  const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
@@ -3560,9 +3560,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3560
3560
  }
3561
3561
  }
3562
3562
  if (proms.length) {
3563
- return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
3563
+ return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input2, optoutStart));
3564
3564
  }
3565
- return handleTupleResults(itemResults, payload, items, input, optoutStart);
3565
+ return handleTupleResults(itemResults, payload, items, input2, optoutStart);
3566
3566
  };
3567
3567
  });
3568
3568
  function getTupleOptStart(items, key) {
@@ -3578,10 +3578,10 @@ function handleTupleResult(result, final, index) {
3578
3578
  }
3579
3579
  final.value[index] = result.value;
3580
3580
  }
3581
- function handleTupleResults(itemResults, final, items, input, optoutStart) {
3581
+ function handleTupleResults(itemResults, final, items, input2, optoutStart) {
3582
3582
  for (let i = 0; i < items.length; i++) {
3583
3583
  const r = itemResults[i];
3584
- const isPresent = i < input.length;
3584
+ const isPresent = i < input2.length;
3585
3585
  if (r.issues.length) {
3586
3586
  if (!isPresent && i >= optoutStart) {
3587
3587
  final.value.length = i;
@@ -3591,7 +3591,7 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
3591
3591
  }
3592
3592
  final.value[i] = r.value;
3593
3593
  }
3594
- for (let i = final.value.length - 1; i >= input.length; i--) {
3594
+ for (let i = final.value.length - 1; i >= input2.length; i--) {
3595
3595
  if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
3596
3596
  final.value.length = i;
3597
3597
  } else {
@@ -3603,12 +3603,12 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
3603
3603
  var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
3604
3604
  $ZodType.init(inst, def);
3605
3605
  inst._zod.parse = (payload, ctx) => {
3606
- const input = payload.value;
3607
- if (!isPlainObject(input)) {
3606
+ const input2 = payload.value;
3607
+ if (!isPlainObject(input2)) {
3608
3608
  payload.issues.push({
3609
3609
  expected: "record",
3610
3610
  code: "invalid_type",
3611
- input,
3611
+ input: input2,
3612
3612
  inst
3613
3613
  });
3614
3614
  return payload;
@@ -3637,7 +3637,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
3637
3637
  continue;
3638
3638
  }
3639
3639
  const outKey = keyResult.value;
3640
- const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
3640
+ const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
3641
3641
  if (result instanceof Promise) {
3642
3642
  proms.push(result.then((result2) => {
3643
3643
  if (result2.issues.length) {
@@ -3654,7 +3654,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
3654
3654
  }
3655
3655
  }
3656
3656
  let unrecognized;
3657
- for (const key in input) {
3657
+ for (const key in input2) {
3658
3658
  if (!recordKeys.has(key)) {
3659
3659
  unrecognized = unrecognized ?? [];
3660
3660
  unrecognized.push(key);
@@ -3663,17 +3663,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
3663
3663
  if (unrecognized && unrecognized.length > 0) {
3664
3664
  payload.issues.push({
3665
3665
  code: "unrecognized_keys",
3666
- input,
3666
+ input: input2,
3667
3667
  inst,
3668
3668
  keys: unrecognized
3669
3669
  });
3670
3670
  }
3671
3671
  } else {
3672
3672
  payload.value = {};
3673
- for (const key of Reflect.ownKeys(input)) {
3673
+ for (const key of Reflect.ownKeys(input2)) {
3674
3674
  if (key === "__proto__")
3675
3675
  continue;
3676
- if (!Object.prototype.propertyIsEnumerable.call(input, key))
3676
+ if (!Object.prototype.propertyIsEnumerable.call(input2, key))
3677
3677
  continue;
3678
3678
  let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
3679
3679
  if (keyResult instanceof Promise) {
@@ -3691,7 +3691,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
3691
3691
  }
3692
3692
  if (keyResult.issues.length) {
3693
3693
  if (def.mode === "loose") {
3694
- payload.value[key] = input[key];
3694
+ payload.value[key] = input2[key];
3695
3695
  } else {
3696
3696
  payload.issues.push({
3697
3697
  code: "invalid_key",
@@ -3704,7 +3704,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
3704
3704
  }
3705
3705
  continue;
3706
3706
  }
3707
- const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
3707
+ const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
3708
3708
  if (result instanceof Promise) {
3709
3709
  proms.push(result.then((result2) => {
3710
3710
  if (result2.issues.length) {
@@ -3729,27 +3729,27 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
3729
3729
  var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
3730
3730
  $ZodType.init(inst, def);
3731
3731
  inst._zod.parse = (payload, ctx) => {
3732
- const input = payload.value;
3733
- if (!(input instanceof Map)) {
3732
+ const input2 = payload.value;
3733
+ if (!(input2 instanceof Map)) {
3734
3734
  payload.issues.push({
3735
3735
  expected: "map",
3736
3736
  code: "invalid_type",
3737
- input,
3737
+ input: input2,
3738
3738
  inst
3739
3739
  });
3740
3740
  return payload;
3741
3741
  }
3742
3742
  const proms = [];
3743
3743
  payload.value = /* @__PURE__ */ new Map();
3744
- for (const [key, value] of input) {
3744
+ for (const [key, value] of input2) {
3745
3745
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
3746
3746
  const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
3747
3747
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
3748
3748
  proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
3749
- handleMapResult(keyResult2, valueResult2, payload, key, input, inst, ctx);
3749
+ handleMapResult(keyResult2, valueResult2, payload, key, input2, inst, ctx);
3750
3750
  }));
3751
3751
  } else {
3752
- handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
3752
+ handleMapResult(keyResult, valueResult, payload, key, input2, inst, ctx);
3753
3753
  }
3754
3754
  }
3755
3755
  if (proms.length)
@@ -3757,7 +3757,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
3757
3757
  return payload;
3758
3758
  };
3759
3759
  });
3760
- function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
3760
+ function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
3761
3761
  if (keyResult.issues.length) {
3762
3762
  if (propertyKeyTypes.has(typeof key)) {
3763
3763
  final.issues.push(...prefixIssues(key, keyResult.issues));
@@ -3765,7 +3765,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
3765
3765
  final.issues.push({
3766
3766
  code: "invalid_key",
3767
3767
  origin: "map",
3768
- input,
3768
+ input: input2,
3769
3769
  inst,
3770
3770
  issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
3771
3771
  });
@@ -3778,7 +3778,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
3778
3778
  final.issues.push({
3779
3779
  origin: "map",
3780
3780
  code: "invalid_element",
3781
- input,
3781
+ input: input2,
3782
3782
  inst,
3783
3783
  key,
3784
3784
  issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
@@ -3790,10 +3790,10 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
3790
3790
  var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
3791
3791
  $ZodType.init(inst, def);
3792
3792
  inst._zod.parse = (payload, ctx) => {
3793
- const input = payload.value;
3794
- if (!(input instanceof Set)) {
3793
+ const input2 = payload.value;
3794
+ if (!(input2 instanceof Set)) {
3795
3795
  payload.issues.push({
3796
- input,
3796
+ input: input2,
3797
3797
  inst,
3798
3798
  expected: "set",
3799
3799
  code: "invalid_type"
@@ -3802,7 +3802,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
3802
3802
  }
3803
3803
  const proms = [];
3804
3804
  payload.value = /* @__PURE__ */ new Set();
3805
- for (const item of input) {
3805
+ for (const item of input2) {
3806
3806
  const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
3807
3807
  if (result instanceof Promise) {
3808
3808
  proms.push(result.then((result2) => handleSetResult(result2, payload)));
@@ -3827,14 +3827,14 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
3827
3827
  inst._zod.values = valuesSet;
3828
3828
  inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
3829
3829
  inst._zod.parse = (payload, _ctx) => {
3830
- const input = payload.value;
3831
- if (valuesSet.has(input)) {
3830
+ const input2 = payload.value;
3831
+ if (valuesSet.has(input2)) {
3832
3832
  return payload;
3833
3833
  }
3834
3834
  payload.issues.push({
3835
3835
  code: "invalid_value",
3836
3836
  values,
3837
- input,
3837
+ input: input2,
3838
3838
  inst
3839
3839
  });
3840
3840
  return payload;
@@ -3849,14 +3849,14 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
3849
3849
  inst._zod.values = values;
3850
3850
  inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
3851
3851
  inst._zod.parse = (payload, _ctx) => {
3852
- const input = payload.value;
3853
- if (values.has(input)) {
3852
+ const input2 = payload.value;
3853
+ if (values.has(input2)) {
3854
3854
  return payload;
3855
3855
  }
3856
3856
  payload.issues.push({
3857
3857
  code: "invalid_value",
3858
3858
  values: def.values,
3859
- input,
3859
+ input: input2,
3860
3860
  inst
3861
3861
  });
3862
3862
  return payload;
@@ -3865,13 +3865,13 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
3865
3865
  var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
3866
3866
  $ZodType.init(inst, def);
3867
3867
  inst._zod.parse = (payload, _ctx) => {
3868
- const input = payload.value;
3869
- if (input instanceof File)
3868
+ const input2 = payload.value;
3869
+ if (input2 instanceof File)
3870
3870
  return payload;
3871
3871
  payload.issues.push({
3872
3872
  expected: "file",
3873
3873
  code: "invalid_type",
3874
- input,
3874
+ input: input2,
3875
3875
  inst
3876
3876
  });
3877
3877
  return payload;
@@ -3901,8 +3901,8 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
3901
3901
  return payload;
3902
3902
  };
3903
3903
  });
3904
- function handleOptionalResult(result, input) {
3905
- if (input === void 0 && (result.issues.length || result.fallback)) {
3904
+ function handleOptionalResult(result, input2) {
3905
+ if (input2 === void 0 && (result.issues.length || result.fallback)) {
3906
3906
  return { issues: [], value: void 0 };
3907
3907
  }
3908
3908
  return result;
@@ -3920,11 +3920,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
3920
3920
  });
3921
3921
  inst._zod.parse = (payload, ctx) => {
3922
3922
  if (def.innerType._zod.optin === "optional") {
3923
- const input = payload.value;
3923
+ const input2 = payload.value;
3924
3924
  const result = def.innerType._zod.run(payload, ctx);
3925
3925
  if (result instanceof Promise)
3926
- return result.then((r) => handleOptionalResult(r, input));
3927
- return handleOptionalResult(result, input);
3926
+ return result.then((r) => handleOptionalResult(r, input2));
3927
+ return handleOptionalResult(result, input2);
3928
3928
  }
3929
3929
  if (payload.value === void 0) {
3930
3930
  return payload;
@@ -4349,20 +4349,20 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
4349
4349
  return payload;
4350
4350
  };
4351
4351
  inst._zod.check = (payload) => {
4352
- const input = payload.value;
4353
- const r = def.fn(input);
4352
+ const input2 = payload.value;
4353
+ const r = def.fn(input2);
4354
4354
  if (r instanceof Promise) {
4355
- return r.then((r2) => handleRefineResult(r2, payload, input, inst));
4355
+ return r.then((r2) => handleRefineResult(r2, payload, input2, inst));
4356
4356
  }
4357
- handleRefineResult(r, payload, input, inst);
4357
+ handleRefineResult(r, payload, input2, inst);
4358
4358
  return;
4359
4359
  };
4360
4360
  });
4361
- function handleRefineResult(result, payload, input, inst) {
4361
+ function handleRefineResult(result, payload, input2, inst) {
4362
4362
  if (!result) {
4363
4363
  const _iss = {
4364
4364
  code: "custom",
4365
- input,
4365
+ input: input2,
4366
4366
  inst,
4367
4367
  // incorporates params.error into issue reporting
4368
4368
  path: [...inst._zod.def.path ?? []],
@@ -7649,8 +7649,8 @@ function ko_default() {
7649
7649
  }
7650
7650
 
7651
7651
  // ../../../node_modules/zod/v4/locales/lt.js
7652
- var capitalizeFirstCharacter = (text2) => {
7653
- return text2.charAt(0).toUpperCase() + text2.slice(1);
7652
+ var capitalizeFirstCharacter = (text3) => {
7653
+ return text3.charAt(0).toUpperCase() + text3.slice(1);
7654
7654
  };
7655
7655
  function getUnitTypeFromNumber(number4) {
7656
7656
  const abs = Math.abs(number4);
@@ -11050,23 +11050,23 @@ function _overwrite(tx) {
11050
11050
  }
11051
11051
  // @__NO_SIDE_EFFECTS__
11052
11052
  function _normalize(form) {
11053
- return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
11053
+ return /* @__PURE__ */ _overwrite((input2) => input2.normalize(form));
11054
11054
  }
11055
11055
  // @__NO_SIDE_EFFECTS__
11056
11056
  function _trim() {
11057
- return /* @__PURE__ */ _overwrite((input) => input.trim());
11057
+ return /* @__PURE__ */ _overwrite((input2) => input2.trim());
11058
11058
  }
11059
11059
  // @__NO_SIDE_EFFECTS__
11060
11060
  function _toLowerCase() {
11061
- return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
11061
+ return /* @__PURE__ */ _overwrite((input2) => input2.toLowerCase());
11062
11062
  }
11063
11063
  // @__NO_SIDE_EFFECTS__
11064
11064
  function _toUpperCase() {
11065
- return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
11065
+ return /* @__PURE__ */ _overwrite((input2) => input2.toUpperCase());
11066
11066
  }
11067
11067
  // @__NO_SIDE_EFFECTS__
11068
11068
  function _slugify() {
11069
- return /* @__PURE__ */ _overwrite((input) => slugify(input));
11069
+ return /* @__PURE__ */ _overwrite((input2) => slugify(input2));
11070
11070
  }
11071
11071
  // @__NO_SIDE_EFFECTS__
11072
11072
  function _array(Class2, element, params) {
@@ -11371,8 +11371,8 @@ function _stringbool(Classes, _params) {
11371
11371
  type: "pipe",
11372
11372
  in: stringSchema,
11373
11373
  out: booleanSchema,
11374
- transform: ((input, payload) => {
11375
- let data = input;
11374
+ transform: ((input2, payload) => {
11375
+ let data = input2;
11376
11376
  if (params.case !== "sensitive")
11377
11377
  data = data.toLowerCase();
11378
11378
  if (truthySet.has(data)) {
@@ -11391,8 +11391,8 @@ function _stringbool(Classes, _params) {
11391
11391
  return {};
11392
11392
  }
11393
11393
  }),
11394
- reverseTransform: ((input, _payload) => {
11395
- if (input === true) {
11394
+ reverseTransform: ((input2, _payload) => {
11395
+ if (input2 === true) {
11396
11396
  return truthyArray[0] || "true";
11397
11397
  } else {
11398
11398
  return falsyArray[0] || "false";
@@ -12288,9 +12288,9 @@ var allProcessors = {
12288
12288
  optional: optionalProcessor,
12289
12289
  lazy: lazyProcessor
12290
12290
  };
12291
- function toJSONSchema(input, params) {
12292
- if ("_idmap" in input) {
12293
- const registry2 = input;
12291
+ function toJSONSchema(input2, params) {
12292
+ if ("_idmap" in input2) {
12293
+ const registry2 = input2;
12294
12294
  const ctx2 = initializeContext({ ...params, processors: allProcessors });
12295
12295
  const defs = {};
12296
12296
  for (const entry of registry2._idmap.entries()) {
@@ -12318,9 +12318,9 @@ function toJSONSchema(input, params) {
12318
12318
  return { schemas };
12319
12319
  }
12320
12320
  const ctx = initializeContext({ ...params, processors: allProcessors });
12321
- process2(input, ctx);
12322
- extractDefs(ctx, input);
12323
- return finalize(ctx, input);
12321
+ process2(input2, ctx);
12322
+ extractDefs(ctx, input2);
12323
+ return finalize(ctx, input2);
12324
12324
  }
12325
12325
 
12326
12326
  // ../../../node_modules/zod/v4/core/json-schema-generator.js
@@ -14597,7 +14597,7 @@ var codexhostErrorSchema = external_exports.strictObject({
14597
14597
 
14598
14598
  // ../../shared-contracts/dist/harness-presentation.js
14599
14599
  var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
14600
- var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
14600
+ var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text3) => text3.trim().length > 0);
14601
14601
  var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
14602
14602
  label: displayText(256).optional(),
14603
14603
  description: displayText(1024).optional()
@@ -14686,7 +14686,7 @@ var usageMeasurementsSchema = external_exports.object({
14686
14686
  outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
14687
14687
  timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
14688
14688
  }).strict();
14689
- var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
14689
+ var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text3) => text3.length <= maximum));
14690
14690
  var composerIndicatorsSchema = external_exports.array(external_exports.object({
14691
14691
  kind: external_exports.literal("countdown"),
14692
14692
  id: external_exports.string().min(1).max(64),
@@ -15069,6 +15069,8 @@ var externalThreadInspectionSchema = external_exports.object({
15069
15069
  effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
15070
15070
  availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
15071
15071
  effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
15072
+ /** Live Session catalog when it, not the Adapter inspection, contains `effectiveModel`. */
15073
+ catalog: harnessModelCatalogSchema.optional(),
15072
15074
  history: harnessHistoryCapabilitiesSchema,
15073
15075
  usage: threadUsageSnapshotSchema.optional(),
15074
15076
  locked: external_exports.literal(true)
@@ -15127,9 +15129,9 @@ var threadSteeringInspectParamsSchema = external_exports.object({
15127
15129
  }).strict();
15128
15130
  var threadSteeringContextSchema = external_exports.object({
15129
15131
  kind: external_exports.literal("application"),
15130
- value: external_exports.string().transform((text2, context) => {
15132
+ value: external_exports.string().transform((text3, context) => {
15131
15133
  try {
15132
- return JSON.parse(text2);
15134
+ return JSON.parse(text3);
15133
15135
  } catch {
15134
15136
  context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
15135
15137
  return external_exports.NEVER;
@@ -15264,8 +15266,8 @@ var desktopExtensionHttpUrlSchema = external_exports.string().trim().max(2048).r
15264
15266
  const { username, password } = new URL(value);
15265
15267
  return !username && !password && !/[\\\s]/u.test(value);
15266
15268
  }, "URL must not contain credentials, backslashes, or whitespace");
15267
- function localizedText(text2) {
15268
- return external_exports.strictObject({ en: text2, "zh-CN": text2 });
15269
+ function localizedText(text3) {
15270
+ return external_exports.strictObject({ en: text3, "zh-CN": text3 });
15269
15271
  }
15270
15272
  var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
15271
15273
  var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
@@ -15382,8 +15384,8 @@ var desktopExtensionTrustTierSchema = external_exports.enum(["official", "commun
15382
15384
  function isGitHubDesktopExtensionZipballUrl(url2) {
15383
15385
  return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
15384
15386
  }
15385
- var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input) => {
15386
- const url2 = new URL(input);
15387
+ var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input2) => {
15388
+ const url2 = new URL(input2);
15387
15389
  return /\.zip$/iu.test(url2.pathname) || isGitHubDesktopExtensionZipballUrl(url2) || url2.origin === "https://github.com" && /^\/[\w-]+\/[\w.-]+\/zipball(?:\/.+)?\/?$/u.test(url2.pathname) || url2.origin === "https://codeload.github.com" && /^\/[\w-]+\/[\w.-]+\/(?:zip|zipball|legacy\.zip)\/.+$/u.test(url2.pathname);
15388
15390
  }, "Expected a .zip download URL or a GitHub zipball URL");
15389
15391
  var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
@@ -15734,6 +15736,8 @@ var CLIENT_CHANNEL_METHODS = [
15734
15736
  "codexhost/workspace/read",
15735
15737
  "codexhost/thread/tree/read",
15736
15738
  "codexhost/thread/pins/list",
15739
+ "codexhost/thread/sections/list",
15740
+ "codexhost/thread/sections/move",
15737
15741
  "codexhost/thread/pins/set",
15738
15742
  "codexhost/harness/plugins/list",
15739
15743
  "codexhost/harness/inspect",
@@ -15772,8 +15776,21 @@ var CLIENT_CHANNEL_METHODS = [
15772
15776
  "codexhost/update/check",
15773
15777
  "codexhost/update/start",
15774
15778
  "codexhost/update/status",
15779
+ "codexhost/announcement/get",
15780
+ "codexhost/announcement/acknowledge",
15775
15781
  "codexhost/sessions/loaded/list"
15776
15782
  ];
15783
+ var clientThreadSectionsSchema = external_exports.object({
15784
+ sections: external_exports.array(external_exports.object({
15785
+ id: external_exports.string().min(1),
15786
+ name: external_exports.string().min(1),
15787
+ threads: external_exports.array(jsonObjectSchema)
15788
+ }).strict())
15789
+ }).strict();
15790
+ var clientThreadSectionMoveSchema = external_exports.object({
15791
+ threadId: external_exports.string().min(1).max(1024),
15792
+ sectionId: external_exports.string().min(1).max(1024).nullable()
15793
+ }).strict();
15777
15794
  var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
15778
15795
  var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
15779
15796
  var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
@@ -16315,8 +16332,8 @@ var harnessPreferencePatchSchema = external_exports.strictObject({
16315
16332
  operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
16316
16333
  initializeOnly: external_exports.boolean().optional(),
16317
16334
  expectedRevision: external_exports.number().int().nonnegative().optional()
16318
- }).superRefine((input, ctx) => {
16319
- for (const operation of input.operations) {
16335
+ }).superRefine((input2, ctx) => {
16336
+ for (const operation of input2.operations) {
16320
16337
  if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
16321
16338
  ctx.addIssue({
16322
16339
  code: "custom",
@@ -16718,13 +16735,18 @@ var harnessLaunchSettingsSchema = external_exports.object({
16718
16735
  // ../../shared-contracts/dist/harness-installation.js
16719
16736
  var harnessInstallationParamsSchema = external_exports.object({
16720
16737
  harnessId: harnessIdSchema,
16721
- action: external_exports.enum(["check", "update", "install"])
16722
- }).strict();
16738
+ action: external_exports.enum(["check", "update", "install"]),
16739
+ confirmedVersion: external_exports.string().min(1).max(128).optional()
16740
+ }).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
16723
16741
  var harnessInstallationStateSchema = external_exports.object({
16724
16742
  currentVersion: external_exports.string().min(1).max(128),
16725
16743
  latestVersion: external_exports.string().min(1).max(128),
16726
16744
  updateAvailable: external_exports.boolean(),
16727
16745
  canUpdate: external_exports.boolean(),
16746
+ /** Present when the Adapter has a verified list and the available target is outside it. */
16747
+ latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
16748
+ /** Update preflight stopped before running the installer; latestVersion needs confirmation. */
16749
+ confirmationRequired: external_exports.literal(true).optional(),
16728
16750
  /** Defaults to CLI; some Harnesses ship only inside a desktop application. */
16729
16751
  versionKind: external_exports.enum(["cli", "application"]).optional(),
16730
16752
  /** Official download opened by the user; does not imply an automatic installation. */
@@ -17054,6 +17076,38 @@ var updateStatusResultSchema = external_exports.strictObject({
17054
17076
  status: updateStatusSchema.nullable()
17055
17077
  });
17056
17078
 
17079
+ // ../../shared-contracts/dist/release-announcement.js
17080
+ var RELEASE_ANNOUNCEMENT_MAX_THEMES = 12;
17081
+ var releaseAnnouncementThemeSchema = external_exports.strictObject({
17082
+ icon: external_exports.string().min(1).max(16).optional(),
17083
+ title: external_exports.string().min(1).max(120),
17084
+ body: external_exports.string().min(1).max(1200),
17085
+ contributors: external_exports.array(external_exports.string().min(1).max(39)).max(30)
17086
+ });
17087
+ var releaseAnnouncementContentSchema = external_exports.strictObject({
17088
+ summary: external_exports.string().min(1).max(600).optional(),
17089
+ themes: external_exports.array(releaseAnnouncementThemeSchema).min(1).max(RELEASE_ANNOUNCEMENT_MAX_THEMES)
17090
+ });
17091
+ var releaseAnnouncementSchema = external_exports.strictObject({
17092
+ version: updateSemanticVersionSchema,
17093
+ publishedAt: external_exports.iso.datetime(),
17094
+ url: external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u),
17095
+ zh: releaseAnnouncementContentSchema.nullable(),
17096
+ en: releaseAnnouncementContentSchema.nullable()
17097
+ }).refine((value) => value.zh !== null || value.en !== null, {
17098
+ message: "an announcement needs at least one language"
17099
+ });
17100
+ var releaseAnnouncementGetParamsSchema = external_exports.strictObject({
17101
+ manual: external_exports.boolean().optional()
17102
+ });
17103
+ var releaseAnnouncementGetResultSchema = external_exports.strictObject({
17104
+ announcement: releaseAnnouncementSchema.nullable(),
17105
+ unread: external_exports.boolean()
17106
+ });
17107
+ var releaseAnnouncementAcknowledgeParamsSchema = external_exports.strictObject({
17108
+ version: updateSemanticVersionSchema
17109
+ });
17110
+
17057
17111
  // ../../shared-contracts/dist/thread-watch-notice.js
17058
17112
  var THREAD_WATCH_NOTICE_OUTCOMES = [
17059
17113
  "completed",
@@ -17101,17 +17155,67 @@ var remoteSshSetupResultSchema = external_exports.object({ state: external_expor
17101
17155
 
17102
17156
  // ../../shared-contracts/dist/remote-sessions.js
17103
17157
  var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
17104
- var identity = external_exports.string().min(1).max(1024);
17158
+ var REMOTE_IDENTITY_MAX_LENGTH = 1024;
17159
+ var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
17105
17160
  var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
17106
17161
  var thread = { ...target, threadId: identity };
17162
+ var text = external_exports.string().min(1).max(8e3);
17163
+ var input = { text, requestId: identity };
17164
+ var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
17165
+ external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
17166
+ external_exports.object({
17167
+ accepted: external_exports.literal(false),
17168
+ code: external_exports.enum([
17169
+ "remote/queue-unavailable",
17170
+ "remote/steer-unavailable",
17171
+ "remote/turn-changed",
17172
+ "remote/send-rejected",
17173
+ "session/queue-item-not-found",
17174
+ "session/queue-item-starting"
17175
+ ]),
17176
+ message: external_exports.string()
17177
+ })
17178
+ ]);
17179
+ var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
17180
+ external_exports.object({ available: external_exports.literal(false) }),
17181
+ external_exports.object({
17182
+ available: external_exports.literal(true),
17183
+ items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
17184
+ })
17185
+ ]);
17107
17186
  var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
17108
17187
  external_exports.strictObject({ kind: external_exports.literal("hosts") }),
17188
+ external_exports.strictObject({
17189
+ kind: external_exports.literal("create"),
17190
+ ...target,
17191
+ cwd: external_exports.string().min(1).max(8192),
17192
+ epoch: identity
17193
+ }),
17194
+ external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
17195
+ external_exports.strictObject({
17196
+ kind: external_exports.literal("inspectHarness"),
17197
+ ...target,
17198
+ epoch: identity,
17199
+ cwd: external_exports.string().min(1).max(8192),
17200
+ harnessId: identity
17201
+ }),
17202
+ external_exports.strictObject({
17203
+ kind: external_exports.literal("startSelected"),
17204
+ ...target,
17205
+ epoch: identity,
17206
+ cwd: external_exports.string().min(1).max(8192),
17207
+ harnessId: identity,
17208
+ model: external_exports.string().min(1).max(4096),
17209
+ serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
17210
+ reasoningEffort: identity.optional()
17211
+ }),
17109
17212
  external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
17110
17213
  external_exports.strictObject({
17111
17214
  kind: external_exports.literal("list"),
17112
17215
  ...target,
17113
17216
  cursor: external_exports.string().nullable(),
17114
- archived: external_exports.boolean()
17217
+ archived: external_exports.boolean(),
17218
+ includeLoaded: external_exports.literal(true).optional()
17115
17219
  }),
17116
17220
  external_exports.strictObject({
17117
17221
  kind: external_exports.literal("read"),
@@ -17141,9 +17245,25 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
17141
17245
  kind: external_exports.literal("prompt"),
17142
17246
  ...thread,
17143
17247
  epoch: identity,
17144
- text: external_exports.string().min(1).max(8e3),
17248
+ text,
17145
17249
  requestId: identity.optional()
17146
17250
  }),
17251
+ external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
17252
+ external_exports.strictObject({
17253
+ kind: external_exports.literal("delivery"),
17254
+ ...thread,
17255
+ epoch: identity,
17256
+ action: external_exports.discriminatedUnion("kind", [
17257
+ external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input }),
17258
+ external_exports.strictObject({ kind: external_exports.literal("steer"), ...input, turnId: identity }),
17259
+ external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
17260
+ external_exports.strictObject({
17261
+ kind: external_exports.literal("start"),
17262
+ itemId: identity,
17263
+ onlyIfHead: external_exports.literal(true).optional()
17264
+ })
17265
+ ])
17266
+ }),
17147
17267
  external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
17148
17268
  external_exports.strictObject({
17149
17269
  kind: external_exports.literal("rename"),
@@ -17683,9 +17803,9 @@ function subagentConfiguration(value) {
17683
17803
  if (typeof value !== "object" || value === null || Array.isArray(value))
17684
17804
  return {};
17685
17805
  const row = value;
17686
- const text2 = (value2) => typeof value2 === "string" && value2.trim() ? value2 : void 0;
17687
- const model2 = row.model === "inherit" ? void 0 : text2(row.model);
17688
- const reasoningEffort = text2(row.reasoningEffort) ?? text2(row.reasoning_effort) ?? text2(row.thinking);
17806
+ const text3 = (value2) => typeof value2 === "string" && value2.trim() ? value2 : void 0;
17807
+ const model2 = row.model === "inherit" ? void 0 : text3(row.model);
17808
+ const reasoningEffort = text3(row.reasoningEffort) ?? text3(row.reasoning_effort) ?? text3(row.thinking);
17689
17809
  return { ...model2 ? { model: model2 } : {}, ...reasoningEffort ? { reasoningEffort } : {} };
17690
17810
  }
17691
17811
  function inheritSubagentConfiguration(child, parent) {
@@ -17858,13 +17978,13 @@ function consumeBrokerFrames(socket, onFrame, onError, maxBytes = HARNESS_BROKER
17858
17978
  bufferedBytes = required2;
17859
17979
  if (newline2 < 0)
17860
17980
  return;
17861
- const text2 = buffered.toString("utf8", 0, bufferedBytes);
17981
+ const text3 = buffered.toString("utf8", 0, bufferedBytes);
17862
17982
  bufferedBytes = 0;
17863
17983
  if (buffered.length > 64 * 1024)
17864
17984
  buffered = Buffer.alloc(0);
17865
- if (text2.length > 0) {
17985
+ if (text3.length > 0) {
17866
17986
  try {
17867
- const value = JSON.parse(text2);
17987
+ const value = JSON.parse(text3);
17868
17988
  onFrame(value);
17869
17989
  } catch (error51) {
17870
17990
  fail(error51 instanceof SyntaxError ? new Error("Harness broker received invalid JSON") : error51 instanceof Error ? error51 : new Error(String(error51)));
@@ -18251,7 +18371,7 @@ var harnessOutputSchema = external_exports.custom((value) => {
18251
18371
  });
18252
18372
 
18253
18373
  // ../../harness-broker/dist/session-import-client.js
18254
- function createBrokerSessionImportCapability(input) {
18374
+ function createBrokerSessionImportCapability(input2) {
18255
18375
  let listing = null;
18256
18376
  const closed = () => ({
18257
18377
  ok: false,
@@ -18271,13 +18391,13 @@ function createBrokerSessionImportCapability(input) {
18271
18391
  const identities = /* @__PURE__ */ new Set();
18272
18392
  let total;
18273
18393
  for (; ; ) {
18274
- if (input.isClosed())
18394
+ if (input2.isClosed())
18275
18395
  return closed();
18276
- const result = await input.request("adapter.sessionImport.list", {
18396
+ const result = await input2.request("adapter.sessionImport.list", {
18277
18397
  offset: candidates.length,
18278
18398
  limit: HARNESS_BROKER_SESSION_IMPORT_PAGE_SIZE
18279
18399
  });
18280
- if (input.isClosed())
18400
+ if (input2.isClosed())
18281
18401
  return closed();
18282
18402
  if (!result.ok)
18283
18403
  return result;
@@ -18295,12 +18415,12 @@ function createBrokerSessionImportCapability(input) {
18295
18415
  return { ok: true, value: candidates };
18296
18416
  }
18297
18417
  } catch (error51) {
18298
- return { ok: false, error: input.error(error51) };
18418
+ return { ok: false, error: input2.error(error51) };
18299
18419
  }
18300
18420
  };
18301
18421
  return {
18302
18422
  listCandidates() {
18303
- if (input.isClosed())
18423
+ if (input2.isClosed())
18304
18424
  return Promise.resolve(closed());
18305
18425
  listing ??= list().finally(() => {
18306
18426
  listing = null;
@@ -18308,20 +18428,20 @@ function createBrokerSessionImportCapability(input) {
18308
18428
  return listing;
18309
18429
  },
18310
18430
  async resolveCandidate(nativeSessionId) {
18311
- if (input.isClosed())
18431
+ if (input2.isClosed())
18312
18432
  return closed();
18313
18433
  try {
18314
- const result = await input.request("adapter.sessionImport.resolve", { nativeSessionId });
18315
- if (input.isClosed())
18434
+ const result = await input2.request("adapter.sessionImport.resolve", { nativeSessionId });
18435
+ if (input2.isClosed())
18316
18436
  return closed();
18317
18437
  if (!result.ok)
18318
18438
  return result;
18319
18439
  const source = brokerSessionImportSourceSchema.safeParse(result.value);
18320
- if (!source.success || source.data.nativeRef.harnessId !== input.harnessId || source.data.candidate.nativeSessionId !== nativeSessionId)
18440
+ if (!source.success || source.data.nativeRef.harnessId !== input2.harnessId || source.data.candidate.nativeSessionId !== nativeSessionId)
18321
18441
  return invalid();
18322
18442
  return { ok: true, value: source.data };
18323
18443
  } catch (error51) {
18324
- return { ok: false, error: input.error(error51) };
18444
+ return { ok: false, error: input2.error(error51) };
18325
18445
  }
18326
18446
  }
18327
18447
  };
@@ -18901,17 +19021,17 @@ var BrokeredHarnessAdapter = class {
18901
19021
  #credits = null;
18902
19022
  #creditsRefresh = null;
18903
19023
  subagents = {
18904
- readSnapshot: async (input) => {
19024
+ readSnapshot: async (input2) => {
18905
19025
  try {
18906
- return parseHarnessResult(await this.#request("adapter.subagent.readSnapshot", input));
19026
+ return parseHarnessResult(await this.#request("adapter.subagent.readSnapshot", input2));
18907
19027
  } catch (error51) {
18908
19028
  return { ok: false, error: this.#error(error51) };
18909
19029
  }
18910
19030
  }
18911
19031
  };
18912
- constructor(input = {}) {
18913
- this.harnessId = harnessPluginIdSchema.parse(input.harnessId ?? "claude-code");
18914
- if (input.sessionImport) {
19032
+ constructor(input2 = {}) {
19033
+ this.harnessId = harnessPluginIdSchema.parse(input2.harnessId ?? "claude-code");
19034
+ if (input2.sessionImport) {
18915
19035
  this.sessionImport = createBrokerSessionImportCapability({
18916
19036
  harnessId: this.harnessId,
18917
19037
  request: async (method, params) => parseHarnessResult(await this.#request(method, params, method === "adapter.sessionImport.resolve")),
@@ -18919,20 +19039,20 @@ var BrokeredHarnessAdapter = class {
18919
19039
  error: (error51) => this.#error(error51)
18920
19040
  });
18921
19041
  }
18922
- if (input.accountCredits !== false) {
19042
+ if (input2.accountCredits !== false) {
18923
19043
  this.credits = () => this.#credits;
18924
19044
  this.refreshCredits = () => this.#refreshAccountCredits();
18925
19045
  }
18926
- this.#forwardEnvironment = input.forwardDelegationEnvironment === true;
18927
- if (input.commandCatalog)
18928
- this.commandCatalog = input.commandCatalog;
18929
- if (input.liveCommandCatalog)
19046
+ this.#forwardEnvironment = input2.forwardDelegationEnvironment === true;
19047
+ if (input2.commandCatalog)
19048
+ this.commandCatalog = input2.commandCatalog;
19049
+ if (input2.liveCommandCatalog)
18930
19050
  this.liveCommandCatalog = true;
18931
- this.#descriptorPath = input.descriptorPath ?? defaultHarnessBrokerDescriptorPath(input.environment, this.harnessId);
18932
- this.#isInstalled = input.isInstalled;
18933
- const environment = input.environment ?? process.env;
18934
- this.#startBroker = input.startBroker === false ? void 0 : input.startBroker ?? (process.platform === "darwin" && !input.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
18935
- this.#startTimeoutMs = input.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
19051
+ this.#descriptorPath = input2.descriptorPath ?? defaultHarnessBrokerDescriptorPath(input2.environment, this.harnessId);
19052
+ this.#isInstalled = input2.isInstalled;
19053
+ const environment = input2.environment ?? process.env;
19054
+ this.#startBroker = input2.startBroker === false ? void 0 : input2.startBroker ?? (process.platform === "darwin" && !input2.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
19055
+ this.#startTimeoutMs = input2.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
18936
19056
  }
18937
19057
  #refreshAccountCredits() {
18938
19058
  if (this.#closed)
@@ -18964,11 +19084,11 @@ var BrokeredHarnessAdapter = class {
18964
19084
  return null;
18965
19085
  }
18966
19086
  }
18967
- async inspect(input = {}) {
19087
+ async inspect(input2 = {}) {
18968
19088
  if (this.#closed)
18969
19089
  return failedInspection("Aqua Harness broker adapter is closed");
18970
19090
  try {
18971
- return harnessInspectionSchema.parse(await this.#request("adapter.inspect", input, true));
19091
+ return harnessInspectionSchema.parse(await this.#request("adapter.inspect", input2, true));
18972
19092
  } catch (error51) {
18973
19093
  this.#connection = null;
18974
19094
  if (error51 instanceof HarnessNotInstalledError)
@@ -18980,12 +19100,12 @@ var BrokeredHarnessAdapter = class {
18980
19100
  const result = await this.#request("adapter.normalizeStoredModelRef", { ref, catalog }, true);
18981
19101
  return harnessModelRefSchema.nullable().parse(result) ?? void 0;
18982
19102
  }
18983
- async open(input) {
19103
+ async open(input2) {
18984
19104
  if (this.#closed)
18985
19105
  return { ok: false, error: unavailable("Aqua Harness broker adapter is closed", false) };
18986
- const safeInput = { ...input };
19106
+ const safeInput = { ...input2 };
18987
19107
  delete safeInput.environment;
18988
- if (this.#forwardEnvironment && input.environment) {
19108
+ if (this.#forwardEnvironment && input2.environment) {
18989
19109
  const allowed = [
18990
19110
  "CODEXHOST_CLI_PATH",
18991
19111
  "CODEXHOST_CLI_NODE_PATH",
@@ -18993,7 +19113,7 @@ var BrokeredHarnessAdapter = class {
18993
19113
  "CODEXHOST_RUNTIME_TOKEN",
18994
19114
  "CODEXHOST_THREAD_ID"
18995
19115
  ];
18996
- const environment = Object.fromEntries(Object.entries(input.environment).filter(([key, value]) => allowed.includes(key) && value !== void 0));
19116
+ const environment = Object.fromEntries(Object.entries(input2.environment).filter(([key, value]) => allowed.includes(key) && value !== void 0));
18997
19117
  if (Object.keys(environment).length)
18998
19118
  safeInput.environment = environment;
18999
19119
  }
@@ -19238,7 +19358,7 @@ var CODEBUDDY_RUNTIME_PROFILE = {
19238
19358
  var OUTPUT_LIMIT = 64e3;
19239
19359
  var record3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
19240
19360
  var rows = (value) => Array.isArray(value) ? value.map(record3) : [];
19241
- var text = (value) => typeof value === "string" ? value : "";
19361
+ var text2 = (value) => typeof value === "string" ? value : "";
19242
19362
  var CodeBuddyError = class extends Error {
19243
19363
  code;
19244
19364
  constructor(code, message) {
@@ -19260,15 +19380,15 @@ function failure(code, message, profile = CODEBUDDY_RUNTIME_PROFILE) {
19260
19380
  return { ok: false, error: nativeError(new CodeBuddyError(code, message), profile) };
19261
19381
  }
19262
19382
  function nativeTurnError(stopReason, meta3, profile) {
19263
- const fallback = `Native Turn stopped: ${text(stopReason) || "unknown"} (${text(meta3["codebuddy.ai/outcome"]) || "no native outcome"})`;
19264
- const raw = text(meta3["codebuddy.ai/errorMessage"]).trim();
19383
+ const fallback = `Native Turn stopped: ${text2(stopReason) || "unknown"} (${text2(meta3["codebuddy.ai/outcome"]) || "no native outcome"})`;
19384
+ const raw = text2(meta3["codebuddy.ai/errorMessage"]).trim();
19265
19385
  let diagnostic = "";
19266
19386
  let category;
19267
19387
  if (raw) {
19268
19388
  try {
19269
19389
  const error51 = record3(JSON.parse(raw));
19270
19390
  const data = record3(error51.data);
19271
- diagnostic = text(data.details).trim() || text(error51.message).trim();
19391
+ diagnostic = text2(data.details).trim() || text2(error51.message).trim();
19272
19392
  category = data.category;
19273
19393
  } catch {
19274
19394
  diagnostic = raw;
@@ -19365,13 +19485,13 @@ function configuration(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
19365
19485
  const thinkingOptions = rows(thought.options).map((option) => harnessThinkingOptionSchema.parse({ id: option.value, label: option.name }));
19366
19486
  const currentThinking = thinkingOptions.find((option) => option.id === thought.currentValue);
19367
19487
  const models = rows(model2.options).map((option) => ({
19368
- ref: modelRef(text(option.value)),
19369
- label: text(option.name)
19488
+ ref: modelRef(text2(option.value)),
19489
+ label: text2(option.name)
19370
19490
  }));
19371
- const currentModelRef = modelRef(text(model2.currentValue));
19491
+ const currentModelRef = modelRef(text2(model2.currentValue));
19372
19492
  let currentModel = models.find((item) => item.ref.id === currentModelRef.id);
19373
19493
  if (!currentModel && profile.allowUnlistedModelSelection) {
19374
- currentModel = { ref: currentModelRef, label: text(model2.currentValue) };
19494
+ currentModel = { ref: currentModelRef, label: text2(model2.currentValue) };
19375
19495
  models.push(currentModel);
19376
19496
  }
19377
19497
  if (!currentModel)
@@ -19389,9 +19509,9 @@ function configuration(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
19389
19509
  modes: rows(mode.options).map((option) => ({
19390
19510
  id: option.value,
19391
19511
  label: option.name,
19392
- localizations: permissionLocalizations(text(option.name), text(option.description)),
19512
+ localizations: permissionLocalizations(text2(option.name), text2(option.description)),
19393
19513
  ...option.description ? { description: option.description } : {},
19394
- ...["bypassPermissions", "fullAccess"].includes(text(option.value)) ? { dangerous: true } : {}
19514
+ ...["bypassPermissions", "fullAccess"].includes(text2(option.value)) ? { dangerous: true } : {}
19395
19515
  })),
19396
19516
  defaultModeId: mode.currentValue
19397
19517
  });
@@ -19843,9 +19963,9 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader
19843
19963
  } }));
19844
19964
  }
19845
19965
  }
19846
- function splitLines(text2) {
19847
- const hasTrailingNl = text2.endsWith("\n");
19848
- const result = text2.split("\n").map((line) => line + "\n");
19966
+ function splitLines(text3) {
19967
+ const hasTrailingNl = text3.endsWith("\n");
19968
+ const result = text3.split("\n").map((line) => line + "\n");
19849
19969
  if (hasTrailingNl) {
19850
19970
  result.pop();
19851
19971
  } else {
@@ -19890,7 +20010,7 @@ function commandCatalog(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
19890
20010
  const seen = /* @__PURE__ */ new Set();
19891
20011
  return {
19892
20012
  commands: rows(value).flatMap((entry) => {
19893
- const name = text(entry.name).replace(/^\//u, "");
20013
+ const name = text2(entry.name).replace(/^\//u, "");
19894
20014
  if (record3(entry._meta).type === "skill" || excluded.has(name) || seen.has(name) || isExcludedLiveCommand(name))
19895
20015
  return [];
19896
20016
  const parsed = harnessCommandCatalogSchema.safeParse({
@@ -19904,7 +20024,7 @@ function commandCatalog(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
19904
20024
  "zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" }
19905
20025
  }
19906
20026
  } : {},
19907
- ...text(entry.description).trim() ? { description: text(entry.description).trim().slice(0, 512) } : {},
20027
+ ...text2(entry.description).trim() ? { description: text2(entry.description).trim().slice(0, 512) } : {},
19908
20028
  argumentMode: name === "compact" || record3(entry.input).hint ? "text" : "none"
19909
20029
  }
19910
20030
  ]
@@ -19941,22 +20061,22 @@ function contentText(value) {
19941
20061
  if (Array.isArray(value))
19942
20062
  return value.map(contentText).join("");
19943
20063
  const item = record3(value);
19944
- return text(item.text) || (item.type === "content" ? contentText(item.content) : "");
20064
+ return text2(item.text) || (item.type === "content" ? contentText(item.content) : "");
19945
20065
  }
19946
- function toolItem(callId, name, input, cwd) {
20066
+ function toolItem(callId, name, input2, cwd) {
19947
20067
  const itemId = hostItemIdSchema.parse(`tool-${callId}`);
19948
20068
  if (["Bash", "PowerShell"].includes(name))
19949
20069
  return {
19950
20070
  type: "commandExecution",
19951
20071
  itemId,
19952
- command: text(record3(input).command) || name,
20072
+ command: text2(record3(input2).command) || name,
19953
20073
  cwd
19954
20074
  };
19955
20075
  return {
19956
20076
  type: "toolExecution",
19957
20077
  itemId,
19958
20078
  toolName: name,
19959
- arguments: jsonValueSchema.parse(input ?? {})
20079
+ arguments: jsonValueSchema.parse(input2 ?? {})
19960
20080
  };
19961
20081
  }
19962
20082
  function toolOutput(value) {
@@ -20054,7 +20174,7 @@ var CodeBuddyTurnOutput = class {
20054
20174
  const delta = contentText(update.content);
20055
20175
  if (!delta)
20056
20176
  return;
20057
- const messageId = text(meta3["codebuddy.ai/llmMessageId"]) || text(update.messageId) || text(meta3["codebuddy.ai/messageId"]);
20177
+ const messageId = text2(meta3["codebuddy.ai/llmMessageId"]) || text2(update.messageId) || text2(meta3["codebuddy.ai/messageId"]);
20058
20178
  if (this.#messageId !== messageId) {
20059
20179
  this.completeMessage();
20060
20180
  this.#messageId = messageId;
@@ -20083,7 +20203,7 @@ var CodeBuddyTurnOutput = class {
20083
20203
  }
20084
20204
  if (kind !== "tool_call" && kind !== "tool_call_update")
20085
20205
  return;
20086
- const callId = text(update.toolCallId);
20206
+ const callId = text2(update.toolCallId);
20087
20207
  if (!callId || this.#finished.has(`tool-${callId}`))
20088
20208
  return;
20089
20209
  const previous = this.#tools.get(callId) ?? {};
@@ -20096,7 +20216,7 @@ var CodeBuddyTurnOutput = class {
20096
20216
  const terminal = update.status === "completed" || update.status === "failed";
20097
20217
  if (!terminal && !record3(merged._meta)["codebuddy.ai/toolArgumentsComplete"])
20098
20218
  return;
20099
- const name = text(record3(merged._meta)["codebuddy.ai/toolName"]) || text(merged.title) || `${this.profile.displayName} tool`;
20219
+ const name = text2(record3(merged._meta)["codebuddy.ai/toolName"]) || text2(merged.title) || `${this.profile.displayName} tool`;
20100
20220
  const id2 = `tool-${callId}`;
20101
20221
  let item = this.#items.get(id2)?.item;
20102
20222
  if (!item) {
@@ -20134,7 +20254,7 @@ var CodeBuddyTurnOutput = class {
20134
20254
  for (const diff of rows(merged.content)) {
20135
20255
  if (diff.type !== "diff" || typeof diff.path !== "string" || typeof diff.newText !== "string")
20136
20256
  continue;
20137
- const unifiedDiff = createTwoFilesPatch(diff.path, diff.path, text(diff.oldText), diff.newText);
20257
+ const unifiedDiff = createTwoFilesPatch(diff.path, diff.path, text2(diff.oldText), diff.newText);
20138
20258
  if (unifiedDiff.length > OUTPUT_LIMIT)
20139
20259
  continue;
20140
20260
  changes.push({
@@ -20175,26 +20295,26 @@ var CodeBuddyTurnOutput = class {
20175
20295
  var validCodeBuddyChildId = (id2) => /^agent-[a-zA-Z0-9_-]{1,100}$/u.test(id2);
20176
20296
  function codeBuddyChildId(value) {
20177
20297
  const row = record3(value);
20178
- const structured = text(record3(record3(record3(row.providerData).toolResult).subAgent).sessionId);
20298
+ const structured = text2(record3(record3(record3(row.providerData).toolResult).subAgent).sessionId);
20179
20299
  const body = contentText(row.rawOutput ?? row.output);
20180
20300
  const id2 = structured || /\[Agent ID: (agent-[a-zA-Z0-9_-]+)\]\s*$/u.exec(body)?.[1];
20181
20301
  return id2 && validCodeBuddyChildId(id2) ? id2 : void 0;
20182
20302
  }
20183
- function codeBuddyDelegation(callId, input, status, childId, displayName = "CodeBuddy") {
20184
- const args = record3(input);
20185
- const resumed = text(args.resume);
20303
+ function codeBuddyDelegation(callId, input2, status, childId, displayName = "CodeBuddy") {
20304
+ const args = record3(input2);
20305
+ const resumed = text2(args.resume);
20186
20306
  const nativeId = childId ?? (validCodeBuddyChildId(resumed) ? resumed : void 0);
20187
20307
  return {
20188
20308
  type: "subagentDelegation",
20189
20309
  itemId: hostItemIdSchema.parse(`tool-${callId}`),
20190
20310
  operation: resumed ? "send" : "spawn",
20191
- ...text(args.prompt) ? { prompt: text(args.prompt) } : {},
20311
+ ...text2(args.prompt) ? { prompt: text2(args.prompt) } : {},
20192
20312
  subagents: [
20193
20313
  {
20194
20314
  subagentId: nativeId ?? callId,
20195
20315
  ...nativeId ? { nativeSubagentId: nativeId } : {},
20196
- description: text(args.description) || `${displayName} Subagent`,
20197
- ...text(args.subagent_type) ? { role: text(args.subagent_type) } : {},
20316
+ description: text2(args.description) || `${displayName} Subagent`,
20317
+ ...text2(args.subagent_type) ? { role: text2(args.subagent_type) } : {},
20198
20318
  ...subagentConfiguration(args),
20199
20319
  background: args.run_in_background === true,
20200
20320
  status
@@ -20297,7 +20417,7 @@ async function matchesAnyHistoricalCwd(value, candidates) {
20297
20417
  if (await sameCwd(value, candidate))
20298
20418
  return true;
20299
20419
  } catch (error51) {
20300
- if (!(error51 instanceof CodeBuddyError) && !["ENOENT", "ENOTDIR"].includes(text(record3(error51).code)))
20420
+ if (!(error51 instanceof CodeBuddyError) && !["ENOENT", "ENOTDIR"].includes(text2(record3(error51).code)))
20301
20421
  throw error51;
20302
20422
  }
20303
20423
  }
@@ -20356,12 +20476,12 @@ async function codeBuddyHistory(cwd, ref, environment, tolerateIncompleteTail, p
20356
20476
  const checkedDirectories = /* @__PURE__ */ new Set();
20357
20477
  const inheritedRows = /* @__PURE__ */ new Map();
20358
20478
  for (const row of transaction?.inheritedContents ? parseRows(transaction.inheritedContents) : []) {
20359
- const id2 = text(row.id);
20479
+ const id2 = text2(row.id);
20360
20480
  const candidates2 = inheritedRows.get(id2) ?? [];
20361
20481
  candidates2.push(row);
20362
20482
  inheritedRows.set(id2, candidates2);
20363
20483
  }
20364
- const inherited = (row) => inheritedRows.get(text(row.id))?.some((candidate) => isDeepStrictEqual(candidate, row)) === true;
20484
+ const inherited = (row) => inheritedRows.get(text2(row.id))?.some((candidate) => isDeepStrictEqual(candidate, row)) === true;
20365
20485
  if (transaction) {
20366
20486
  for (const row of parsed.rows) {
20367
20487
  if (inherited(row)) {
@@ -20384,7 +20504,7 @@ async function codeBuddyHistory(cwd, ref, environment, tolerateIncompleteTail, p
20384
20504
  const active2 = nativeHistoryRows(parsed.contents);
20385
20505
  if (provenance.inheritedPrefixRows > active2.length || nativeRowsDigest(active2.slice(0, provenance.inheritedPrefixRows)) !== provenance.inheritedPrefixSha256)
20386
20506
  throw new CodeBuddyError("protocolError", "Derived Native Session prefix verification failed");
20387
- const marker = parsed.rows.find((row) => text(row.id) === provenance.bindingMarkerId);
20507
+ const marker = parsed.rows.find((row) => text2(row.id) === provenance.bindingMarkerId);
20388
20508
  if (!marker || marker.sessionId !== ref.nativeSessionId || typeof marker.cwd !== "string" || !await sameCwd(marker.cwd, cwd))
20389
20509
  throw new CodeBuddyError("protocolError", "Derived Native Session target marker is missing");
20390
20510
  checkedDirectories.add(cwd);
@@ -20452,8 +20572,8 @@ var NATIVE_MESSAGE_TYPES = /* @__PURE__ */ new Set([
20452
20572
  "function_call_result"
20453
20573
  ]);
20454
20574
  function pendingNativeHistoryRewind(contents) {
20455
- const last = parseRows(contents).findLast((row) => row.type === "resend-fork-notice" || NATIVE_MESSAGE_TYPES.has(text(row.type)));
20456
- return last?.type === "resend-fork-notice" ? { forkPointId: text(last.parentId) || null } : void 0;
20575
+ const last = parseRows(contents).findLast((row) => row.type === "resend-fork-notice" || NATIVE_MESSAGE_TYPES.has(text2(row.type)));
20576
+ return last?.type === "resend-fork-notice" ? { forkPointId: text2(last.parentId) || null } : void 0;
20457
20577
  }
20458
20578
  function isNativeCompactionSummary(row) {
20459
20579
  const data = record3(row.providerData);
@@ -20470,15 +20590,15 @@ function collectNativeHistoryRows(contents, followCompactionParent) {
20470
20590
  let leaf = "";
20471
20591
  for (const row of parseRows(contents)) {
20472
20592
  if (row.type === "resend-fork-notice") {
20473
- leaf = text(row.parentId);
20593
+ leaf = text2(row.parentId);
20474
20594
  continue;
20475
20595
  }
20476
- if (!NATIVE_MESSAGE_TYPES.has(text(row.type)))
20596
+ if (!NATIVE_MESSAGE_TYPES.has(text2(row.type)))
20477
20597
  continue;
20478
- if (!text(row.id))
20598
+ if (!text2(row.id))
20479
20599
  throw new CodeBuddyError("protocolError", "Native message is missing its stable ID");
20480
- entries.set(text(row.id), row);
20481
- leaf = text(row.id);
20600
+ entries.set(text2(row.id), row);
20601
+ leaf = text2(row.id);
20482
20602
  }
20483
20603
  const chain = [], seen = /* @__PURE__ */ new Set();
20484
20604
  while (leaf) {
@@ -20489,9 +20609,9 @@ function collectNativeHistoryRows(contents, followCompactionParent) {
20489
20609
  if (!row)
20490
20610
  throw new CodeBuddyError("protocolError", "Native history parent is missing");
20491
20611
  chain.push(row);
20492
- leaf = text(row.parentId);
20612
+ leaf = text2(row.parentId);
20493
20613
  if (!leaf && followCompactionParent && isNativeCompactionSummary(row)) {
20494
- const logicalParent = text(row.logicalParentId);
20614
+ const logicalParent = text2(row.logicalParentId);
20495
20615
  if (logicalParent && !entries.has(logicalParent))
20496
20616
  throw new CodeBuddyError("protocolError", "Native compaction parent is missing");
20497
20617
  leaf = logicalParent;
@@ -20533,7 +20653,7 @@ function snapshotFromHistory(contents, ref, cwd, profile = CODEBUDDY_RUNTIME_PRO
20533
20653
  for (const row of history) {
20534
20654
  const data = record3(row.providerData);
20535
20655
  if (row.type === "message" && row.role === "user")
20536
- compactUser = data.agent === "compact" ? text(row.id) : void 0;
20656
+ compactUser = data.agent === "compact" ? text2(row.id) : void 0;
20537
20657
  if (compactUser && row.role === "assistant" && data.compactType === "user-command")
20538
20658
  manualCompactions.add(compactUser);
20539
20659
  }
@@ -20547,7 +20667,7 @@ function snapshotFromHistory(contents, ref, cwd, profile = CODEBUDDY_RUNTIME_PRO
20547
20667
  current.items.push({
20548
20668
  item: {
20549
20669
  type: "agentMessage",
20550
- itemId: hostItemIdSchema.parse(`agentMessage-${text(row.id)}`),
20670
+ itemId: hostItemIdSchema.parse(`agentMessage-${text2(row.id)}`),
20551
20671
  text: localOutput[1] ?? ""
20552
20672
  },
20553
20673
  outcome: { status: "succeeded" }
@@ -20558,7 +20678,7 @@ function snapshotFromHistory(contents, ref, cwd, profile = CODEBUDDY_RUNTIME_PRO
20558
20678
  }
20559
20679
  if (supportsNativeCommands && data.skipRun === true && body.startsWith('<system-reminder data-role="command-caveat">'))
20560
20680
  continue;
20561
- if (supportsNativeCommands && row.type === "message" && row.role === "user" && data.agent === "compact" && !manualCompactions.has(text(row.id)))
20681
+ if (supportsNativeCommands && row.type === "message" && row.role === "user" && data.agent === "compact" && !manualCompactions.has(text2(row.id)))
20562
20682
  continue;
20563
20683
  if (row.type === "message" && row.role === "user" && data.startsNewUserRequest === false && !localCommand && data.agent !== "compact" && !isNativeCompactionSummary(row)) {
20564
20684
  const contextOnly = body.trim().length > 0 && body.replace(/<system-reminder\b[^>]*\sdata-role=(["'])user-context\1[^>]*>[\s\S]*?<\/system-reminder>/gu, "").trim().length === 0;
@@ -20579,7 +20699,7 @@ function snapshotFromHistory(contents, ref, cwd, profile = CODEBUDDY_RUNTIME_PRO
20579
20699
  current.items.push({
20580
20700
  item: {
20581
20701
  type: "contextCompaction",
20582
- itemId: hostItemIdSchema.parse(`compact-${text(row.id)}`)
20702
+ itemId: hostItemIdSchema.parse(`compact-${text2(row.id)}`)
20583
20703
  },
20584
20704
  outcome
20585
20705
  });
@@ -20620,7 +20740,7 @@ function snapshotFromHistory(contents, ref, cwd, profile = CODEBUDDY_RUNTIME_PRO
20620
20740
  current.items.push({
20621
20741
  item: {
20622
20742
  type: "contextCompaction",
20623
- itemId: hostItemIdSchema.parse(`compact-${text(row.id)}`)
20743
+ itemId: hostItemIdSchema.parse(`compact-${text2(row.id)}`)
20624
20744
  },
20625
20745
  outcome
20626
20746
  });
@@ -20629,7 +20749,7 @@ function snapshotFromHistory(contents, ref, cwd, profile = CODEBUDDY_RUNTIME_PRO
20629
20749
  }
20630
20750
  continue;
20631
20751
  }
20632
- const model2 = text(record3(row.providerData).model);
20752
+ const model2 = text2(record3(row.providerData).model);
20633
20753
  if (model2)
20634
20754
  current.model = modelRef(model2);
20635
20755
  if (row.type === "message" && row.role === "assistant" || row.type === "reasoning") {
@@ -20637,7 +20757,7 @@ function snapshotFromHistory(contents, ref, cwd, profile = CODEBUDDY_RUNTIME_PRO
20637
20757
  const body2 = contentText(row.content) || contentText(row.rawContent);
20638
20758
  if (body2)
20639
20759
  current.items.push({
20640
- item: { type, itemId: hostItemIdSchema.parse(`${type}-${text(row.id)}`), text: body2 },
20760
+ item: { type, itemId: hostItemIdSchema.parse(`${type}-${text2(row.id)}`), text: body2 },
20641
20761
  outcome: { status: "succeeded" }
20642
20762
  });
20643
20763
  if (row.role === "assistant" && row.status === "completed") {
@@ -20648,17 +20768,17 @@ function snapshotFromHistory(contents, ref, cwd, profile = CODEBUDDY_RUNTIME_PRO
20648
20768
  } else if (row.type === "function_call") {
20649
20769
  if (row.status === "incomplete" && data.isPartialAborted === true && data.discard === true)
20650
20770
  continue;
20651
- let input = row.arguments;
20652
- if (typeof input === "string") {
20771
+ let input2 = row.arguments;
20772
+ if (typeof input2 === "string") {
20653
20773
  try {
20654
- input = JSON.parse(input);
20774
+ input2 = JSON.parse(input2);
20655
20775
  } catch {
20656
20776
  throw new CodeBuddyError("protocolError", "Invalid native Tool arguments");
20657
20777
  }
20658
20778
  }
20659
- const callId = text(row.callId);
20779
+ const callId = text2(row.callId);
20660
20780
  const snapshot = {
20661
- item: row.name === "Agent" ? codeBuddyDelegation(callId, input, "running", void 0, profile.displayName) : toolItem(callId, text(row.name), input, typeof row.cwd === "string" ? row.cwd : cwd),
20781
+ item: row.name === "Agent" ? codeBuddyDelegation(callId, input2, "running", void 0, profile.displayName) : toolItem(callId, text2(row.name), input2, typeof row.cwd === "string" ? row.cwd : cwd),
20662
20782
  outcome: toolOutcome("unknown", profile)
20663
20783
  };
20664
20784
  tools.set(callId, snapshot);
@@ -20670,7 +20790,7 @@ function snapshotFromHistory(contents, ref, cwd, profile = CODEBUDDY_RUNTIME_PRO
20670
20790
  applyResult(snapshot, early);
20671
20791
  }
20672
20792
  } else if (row.type === "function_call_result") {
20673
- const callId = text(row.callId);
20793
+ const callId = text2(row.callId);
20674
20794
  const snapshot = tools.get(callId);
20675
20795
  if (snapshot)
20676
20796
  applyResult(snapshot, row);
@@ -20694,13 +20814,13 @@ function usageCount(value) {
20694
20814
  function historyUsageRequests(contents, historical) {
20695
20815
  const usages = /* @__PURE__ */ new Map();
20696
20816
  for (const row of nativeRawHistoryRows(contents)) {
20697
- if (!NATIVE_MESSAGE_TYPES.has(text(row.type)))
20817
+ if (!NATIVE_MESSAGE_TYPES.has(text2(row.type)))
20698
20818
  continue;
20699
20819
  const data = record3(row.providerData);
20700
20820
  if (data.isSubAgent === true || !Object.keys(record3(data.rawUsage)).length)
20701
20821
  continue;
20702
- if (text(data.messageId))
20703
- usages.set(text(data.messageId), data);
20822
+ if (text2(data.messageId))
20823
+ usages.set(text2(data.messageId), data);
20704
20824
  }
20705
20825
  const requests = [];
20706
20826
  let complete = true;
@@ -20715,14 +20835,14 @@ function historyUsageRequests(contents, historical) {
20715
20835
  }
20716
20836
  function providerUsageRequest(requestId, data, historical) {
20717
20837
  const usage = record3(data.rawUsage);
20718
- const model2 = text(data.model) || text(data.requestModelId);
20719
- const input = usageCount(usage.prompt_tokens);
20838
+ const model2 = text2(data.model) || text2(data.requestModelId);
20839
+ const input2 = usageCount(usage.prompt_tokens);
20720
20840
  const output = usageCount(usage.completion_tokens);
20721
20841
  const cached2 = usageCount(record3(usage.prompt_tokens_details).cached_tokens ?? 0);
20722
20842
  const written = usageCount(usage.prompt_cache_write_tokens ?? 0);
20723
20843
  const thinking = usageCount(usage.completion_thinking_tokens);
20724
20844
  const unverifiedCache = [usage.cache_read_input_tokens, usage.cache_creation_input_tokens].some((value) => value !== void 0 && value !== 0);
20725
- if (!model2 || input === null || output === null || cached2 === null || written === null || unverifiedCache) {
20845
+ if (!model2 || input2 === null || output === null || cached2 === null || written === null || unverifiedCache) {
20726
20846
  return null;
20727
20847
  }
20728
20848
  try {
@@ -20730,7 +20850,7 @@ function providerUsageRequest(requestId, data, historical) {
20730
20850
  requestId,
20731
20851
  ...historical ? { historical: true } : {},
20732
20852
  model: model2,
20733
- inputTokens: input,
20853
+ inputTokens: input2,
20734
20854
  cachedInputTokens: cached2,
20735
20855
  cacheWriteInputTokens: written,
20736
20856
  outputTokens: output,
@@ -20744,8 +20864,8 @@ function historyUsage(contents) {
20744
20864
  const requests = /* @__PURE__ */ new Map();
20745
20865
  for (const row of nativeHistoryRows(contents)) {
20746
20866
  const data = record3(row.providerData), usage = record3(data.rawUsage);
20747
- if (Object.keys(usage).length && text(data.messageId))
20748
- requests.set(text(data.messageId), usage);
20867
+ if (Object.keys(usage).length && text2(data.messageId))
20868
+ requests.set(text2(data.messageId), usage);
20749
20869
  }
20750
20870
  if (!requests.size)
20751
20871
  return null;
@@ -20760,10 +20880,10 @@ function historyUsage(contents) {
20760
20880
  };
20761
20881
  const result = {};
20762
20882
  const latest = [...requests.values()].at(-1);
20763
- const input = usageCount(latest?.prompt_tokens);
20883
+ const input2 = usageCount(latest?.prompt_tokens);
20764
20884
  const cached2 = usageCount(record3(latest?.prompt_tokens_details).cached_tokens);
20765
- if (input !== null && input > 0 && cached2 !== null && cached2 <= input)
20766
- result.cacheHitRatePercent = cached2 / input * 100;
20885
+ if (input2 !== null && input2 > 0 && cached2 !== null && cached2 <= input2)
20886
+ result.cacheHitRatePercent = cached2 / input2 * 100;
20767
20887
  for (const [host, native] of Object.entries(fields)) {
20768
20888
  const values = [...requests.values()].map((usage) => native(usage));
20769
20889
  if (values.every((value) => typeof value === "number" && Number.isFinite(value) && value >= 0)) {
@@ -23530,7 +23650,7 @@ var LineBuffer = class {
23530
23650
  };
23531
23651
 
23532
23652
  // ../../../node_modules/@agentclientprotocol/sdk/dist/stream.js
23533
- function ndJsonStream(output, input) {
23653
+ function ndJsonStream(output, input2) {
23534
23654
  const textEncoder = new TextEncoder();
23535
23655
  const textDecoder = new TextDecoder();
23536
23656
  let cancelled = false;
@@ -23553,7 +23673,7 @@ function ndJsonStream(output, input) {
23553
23673
  }
23554
23674
  }
23555
23675
  };
23556
- const reader = input.getReader();
23676
+ const reader = input2.getReader();
23557
23677
  inputReader = reader;
23558
23678
  try {
23559
23679
  while (true) {
@@ -23636,8 +23756,8 @@ var zGuardCreateElicitationResponseCancel = object({
23636
23756
  });
23637
23757
 
23638
23758
  // ../../../node_modules/@agentclientprotocol/sdk/dist/acp.js
23639
- function ndJsonStream2(output, input) {
23640
- return ndJsonStream(output, input);
23759
+ function ndJsonStream2(output, input2) {
23760
+ return ndJsonStream(output, input2);
23641
23761
  }
23642
23762
  function emptyObjectResponse(response) {
23643
23763
  return response ?? {};
@@ -25224,8 +25344,8 @@ var VERSION_MANAGER_ROOTS = "<version-managers>";
25224
25344
  function installRootExtensions(platform) {
25225
25345
  return platform === "win32" ? [".exe", ".cmd"] : [""];
25226
25346
  }
25227
- function resolveHomeDirectory(input) {
25228
- return input.homeDirectory ?? environmentValue(input.environment, "HOME") ?? environmentValue(input.environment, "USERPROFILE") ?? os2.homedir();
25347
+ function resolveHomeDirectory(input2) {
25348
+ return input2.homeDirectory ?? environmentValue(input2.environment, "HOME") ?? environmentValue(input2.environment, "USERPROFILE") ?? os2.homedir();
25229
25349
  }
25230
25350
  function templateVariables(environment, platform, home) {
25231
25351
  const pathFlavor = targetPath(platform);
@@ -25258,36 +25378,36 @@ function expandInstallRoot(template, environment, platform, home) {
25258
25378
  });
25259
25379
  return unresolved ? void 0 : joinTemplate(platform, substituted);
25260
25380
  }
25261
- function installRootDirectories(spec, input, dependencies, platform, home) {
25381
+ function installRootDirectories(spec, input2, dependencies, platform, home) {
25262
25382
  const templates = (platform === "win32" ? spec.installRoots?.windows : spec.installRoots?.posix) ?? [];
25263
25383
  const directories = [];
25264
25384
  for (const template of templates) {
25265
25385
  if (template === VERSION_MANAGER_ROOTS) {
25266
25386
  directories.push(...versionManagerBinaryDirectories({
25267
25387
  platform,
25268
- environment: input.environment,
25388
+ environment: input2.environment,
25269
25389
  home,
25270
25390
  ...dependencies.subdirectories ? { subdirectories: dependencies.subdirectories } : {}
25271
25391
  }));
25272
25392
  continue;
25273
25393
  }
25274
- const directory = expandInstallRoot(template, input.environment, platform, home);
25394
+ const directory = expandInstallRoot(template, input2.environment, platform, home);
25275
25395
  if (directory !== void 0)
25276
25396
  directories.push(directory);
25277
25397
  }
25278
25398
  return directories;
25279
25399
  }
25280
- function harnessCandidates(spec, input, dependencies = {}) {
25281
- const platform = input.platform ?? process.platform;
25400
+ function harnessCandidates(spec, input2, dependencies = {}) {
25401
+ const platform = input2.platform ?? process.platform;
25282
25402
  const pathFlavor = targetPath(platform);
25283
- const configured = input.command ?? (spec.commandEnvironmentVariable ? environmentValue(input.environment, spec.commandEnvironmentVariable) : void 0);
25403
+ const configured = input2.command ?? (spec.commandEnvironmentVariable ? environmentValue(input2.environment, spec.commandEnvironmentVariable) : void 0);
25284
25404
  const command = configured ?? spec.command;
25285
25405
  if (pathFlavor.isAbsolute(command) || command.includes("/") || command.includes("\\")) {
25286
25406
  return [{ candidate: command, source: "configured" }];
25287
25407
  }
25288
25408
  const candidates = [];
25289
- const extensions = executableExtensions(command, platform, input.environment);
25290
- for (const directory of pathDirectories(input.environment, platform)) {
25409
+ const extensions = executableExtensions(command, platform, input2.environment);
25410
+ for (const directory of pathDirectories(input2.environment, platform)) {
25291
25411
  for (const extension of extensions) {
25292
25412
  candidates.push({
25293
25413
  candidate: pathFlavor.join(directory, command + extension),
@@ -25297,8 +25417,8 @@ function harnessCandidates(spec, input, dependencies = {}) {
25297
25417
  }
25298
25418
  if (configured !== void 0)
25299
25419
  return candidates;
25300
- const home = resolveHomeDirectory(input);
25301
- for (const directory of installRootDirectories(spec, input, dependencies, platform, home)) {
25420
+ const home = resolveHomeDirectory(input2);
25421
+ for (const directory of installRootDirectories(spec, input2, dependencies, platform, home)) {
25302
25422
  for (const extension of installRootExtensions(platform)) {
25303
25423
  candidates.push({
25304
25424
  candidate: pathFlavor.join(directory, spec.command + extension),
@@ -25308,12 +25428,12 @@ function harnessCandidates(spec, input, dependencies = {}) {
25308
25428
  }
25309
25429
  return candidates;
25310
25430
  }
25311
- function resolveHarnessExecutable(spec, input, dependencies = {}) {
25312
- const platform = input.platform ?? process.platform;
25431
+ function resolveHarnessExecutable(spec, input2, dependencies = {}) {
25432
+ const platform = input2.platform ?? process.platform;
25313
25433
  const isExecutable = dependencies.isExecutable ?? ((candidate) => isExecutableFile(candidate, platform));
25314
25434
  const runnable = spec.runnableCandidate ?? ((candidate) => candidate);
25315
25435
  const context = { platform, isExecutable };
25316
- for (const { candidate, source } of harnessCandidates(spec, input, dependencies)) {
25436
+ for (const { candidate, source } of harnessCandidates(spec, input2, dependencies)) {
25317
25437
  const executable = runnable(candidate, context);
25318
25438
  if (executable !== void 0 && isExecutable(executable))
25319
25439
  return { executable, source };
@@ -25324,13 +25444,13 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
25324
25444
  // ../../harness-discovery/dist/installation.js
25325
25445
  import { execFile as execFile2 } from "node:child_process";
25326
25446
  import { homedir as homedir2 } from "node:os";
25327
- function runInstallationCommand(command, args, environment, timeout = 3e4) {
25447
+ function runInstallationCommand(command, args, environment, timeout = 3e4, cwd) {
25328
25448
  const env = withNodeRuntimeOnPath(environment);
25329
25449
  const invocation = /\.[cm]?js$/i.test(command) ? commandInvocation(process.execPath, [command, ...args], env) : commandInvocation(command, args, env);
25330
25450
  return new Promise((resolve, reject) => {
25331
25451
  const child = execFile2(invocation.command, invocation.arguments, {
25332
25452
  env,
25333
- cwd: env.HOME ?? env.USERPROFILE ?? homedir2(),
25453
+ cwd: cwd ?? env.HOME ?? env.USERPROFILE ?? homedir2(),
25334
25454
  encoding: "utf8",
25335
25455
  timeout,
25336
25456
  killSignal: "SIGKILL",
@@ -25546,8 +25666,8 @@ var CodeBuddyAcpClient = class {
25546
25666
  async configure(sessionId, configId, value) {
25547
25667
  return record3(await this.#request(() => this.#connection.setSessionConfigOption({ sessionId, configId, value }), "ACP configuration"));
25548
25668
  }
25549
- async prompt(sessionId, input) {
25550
- return record3(await this.#request(() => this.#connection.prompt({ sessionId, prompt: [{ type: "text", text: input }] })));
25669
+ async prompt(sessionId, input2) {
25670
+ return record3(await this.#request(() => this.#connection.prompt({ sessionId, prompt: [{ type: "text", text: input2 }] })));
25551
25671
  }
25552
25672
  async cancel(sessionId) {
25553
25673
  await this.#request(() => this.#connection.cancel({ sessionId }), "ACP cancel");
@@ -25646,7 +25766,7 @@ function inheritedChildren(parent) {
25646
25766
  const historicalCwds = child.historicalCwds;
25647
25767
  const recordedCwds = child.recordedCwds;
25648
25768
  const workspaceBindings = child.workspaceBindings;
25649
- if (!validCodeBuddyChildId(text(child.childId)) || !/^[A-Za-z0-9][A-Za-z0-9_-]{0,199}$/u.test(text(child.nativeSessionId)) || !Number.isSafeInteger(child.inheritedBytes) || Number(child.inheritedBytes) < 0 || Number(child.inheritedBytes) > CODEBUDDY_CHILD_MAX_BYTES || !Number.isSafeInteger(child.inheritedRows) || Number(child.inheritedRows) < 0 || typeof child.inheritedSha256 !== "string" || !/^[a-f0-9]{64}$/u.test(child.inheritedSha256) || !Array.isArray(historicalCwds) || historicalCwds.length > 256 || historicalCwds.some((cwd) => typeof cwd !== "string" || !cwd) || !Array.isArray(recordedCwds) || recordedCwds.length > 256 || recordedCwds.some((cwd) => typeof cwd !== "string" || !cwd) || !Array.isArray(workspaceBindings) || workspaceBindings.length > 256)
25769
+ if (!validCodeBuddyChildId(text2(child.childId)) || !/^[A-Za-z0-9][A-Za-z0-9_-]{0,199}$/u.test(text2(child.nativeSessionId)) || !Number.isSafeInteger(child.inheritedBytes) || Number(child.inheritedBytes) < 0 || Number(child.inheritedBytes) > CODEBUDDY_CHILD_MAX_BYTES || !Number.isSafeInteger(child.inheritedRows) || Number(child.inheritedRows) < 0 || typeof child.inheritedSha256 !== "string" || !/^[a-f0-9]{64}$/u.test(child.inheritedSha256) || !Array.isArray(historicalCwds) || historicalCwds.length > 256 || historicalCwds.some((cwd) => typeof cwd !== "string" || !cwd) || !Array.isArray(recordedCwds) || recordedCwds.length > 256 || recordedCwds.some((cwd) => typeof cwd !== "string" || !cwd) || !Array.isArray(workspaceBindings) || workspaceBindings.length > 256)
25650
25770
  throw new CodeBuddyError("protocolError", "Inherited Subagent provenance is invalid");
25651
25771
  const bindings = workspaceBindings.map((candidate2) => {
25652
25772
  const binding = record3(candidate2);
@@ -25661,13 +25781,13 @@ function inheritedChildren(parent) {
25661
25781
  const boundCanonical = new Set(bindings.map((binding) => binding.canonicalCwd));
25662
25782
  if (boundRecorded.size !== bindings.length || new Set(recordedCwds).size !== recordedCwds.length || boundRecorded.size !== new Set(recordedCwds).size || recordedCwds.some((cwd) => !boundRecorded.has(cwd)) || new Set(historicalCwds).size !== historicalCwds.length || boundCanonical.size !== new Set(historicalCwds).size || historicalCwds.some((cwd) => !boundCanonical.has(cwd)))
25663
25783
  throw new CodeBuddyError("protocolError", "Inherited Subagent provenance is inconsistent");
25664
- const childId = text(child.childId);
25784
+ const childId = text2(child.childId);
25665
25785
  if (seen.has(childId))
25666
25786
  throw new CodeBuddyError("protocolError", "Inherited Subagent provenance is ambiguous");
25667
25787
  seen.add(childId);
25668
25788
  return {
25669
25789
  childId,
25670
- nativeSessionId: text(child.nativeSessionId),
25790
+ nativeSessionId: text2(child.nativeSessionId),
25671
25791
  inheritedBytes: Number(child.inheritedBytes),
25672
25792
  inheritedRows: Number(child.inheritedRows),
25673
25793
  inheritedSha256: child.inheritedSha256,
@@ -25696,7 +25816,7 @@ async function validateCodeBuddyChildContents(contents, parent, childId, cwd, to
25696
25816
  if (!validCodeBuddyChildId(childId))
25697
25817
  throw new CodeBuddyError("invalidRequest", "Invalid native Subagent ID");
25698
25818
  const parsed = parseCodeBuddyChild(contents, tolerateIncompleteTail);
25699
- const sessions = new Set(parsed.entries.map((row) => text(row.sessionId)).filter(Boolean));
25819
+ const sessions = new Set(parsed.entries.map((row) => text2(row.sessionId)).filter(Boolean));
25700
25820
  if (sessions.size !== 1)
25701
25821
  throw new CodeBuddyError("protocolError", "Subagent transcript identity is missing or mixed");
25702
25822
  const nativeSessionId = [...sessions][0];
@@ -25789,7 +25909,7 @@ async function codeBuddyChildPrefixThrough(contents, lastId, child) {
25789
25909
  const row = child.entries[rowIndex++];
25790
25910
  if (!row)
25791
25911
  throw new CodeBuddyError("protocolError", "Subagent transcript rows changed");
25792
- if (text(row.id) === lastId) {
25912
+ if (text2(row.id) === lastId) {
25793
25913
  if (match >= 0)
25794
25914
  throw new CodeBuddyError("protocolError", "Agent result has an ambiguous child range");
25795
25915
  match = rowIndex - 1;
@@ -25921,32 +26041,32 @@ function withoutIdentity(row) {
25921
26041
  function assertCopiedPrefix(source, copied) {
25922
26042
  if (copied.length < source.length)
25923
26043
  throw new CodeBuddyError("unsupported", "Native Fork omitted history");
25924
- const ids = new Map(source.map((row, index) => [text(row.id), text(copied[index]?.id)]));
26044
+ const ids = new Map(source.map((row, index) => [text2(row.id), text2(copied[index]?.id)]));
25925
26045
  for (const [index, row] of source.entries()) {
25926
26046
  const clone2 = copied[index];
25927
26047
  if (!clone2)
25928
26048
  throw new CodeBuddyError("unsupported", "Native Fork omitted history");
25929
- if (!isDeepStrictEqual3(withoutIdentity(row), withoutIdentity(clone2)) || ["parentId", "logicalParentId"].some((key) => text(clone2[key]) !== (ids.get(text(row[key])) ?? "")))
26049
+ if (!isDeepStrictEqual3(withoutIdentity(row), withoutIdentity(clone2)) || ["parentId", "logicalParentId"].some((key) => text2(clone2[key]) !== (ids.get(text2(row[key])) ?? "")))
25930
26050
  throw new CodeBuddyError("unsupported", "Native Fork did not preserve the exact history prefix");
25931
26051
  }
25932
26052
  }
25933
26053
  function commandCaveat(row) {
25934
26054
  return record3(row?.providerData).skipRun === true && JSON.stringify(row?.content).includes('data-role=\\"command-caveat\\"');
25935
26055
  }
25936
- function retainedRowCount(input, contents, sourceCwd = input.cwd, profile = CODEBUDDY_RUNTIME_PROFILE) {
26056
+ function retainedRowCount(input2, contents, sourceCwd = input2.cwd, profile = CODEBUDDY_RUNTIME_PROFILE) {
25937
26057
  const rows2 = nativeHistoryRows(contents);
25938
- const turns = snapshotFromHistory(contents, input.sourceRef, sourceCwd, profile, {
26058
+ const turns = snapshotFromHistory(contents, input2.sourceRef, sourceCwd, profile, {
25939
26059
  includeCompactionHistory: false
25940
26060
  }).turns;
25941
26061
  let excluded2;
25942
- if (input.kind === "rollbackLastTurn") {
26062
+ if (input2.kind === "rollbackLastTurn") {
25943
26063
  if (!turns.length)
25944
26064
  throw new CodeBuddyError("invalidState", "Native Session has no Turn to revise");
25945
26065
  excluded2 = turns.at(-1)?.nativeTurnRef.nativeTurnKey;
25946
26066
  } else {
25947
- const checkpoint = input.checkpoint;
26067
+ const checkpoint = input2.checkpoint;
25948
26068
  const index = turns.findIndex((turn) => turn.nativeTurnRef.nativeTurnKey === checkpoint.checkpointId);
25949
- if (checkpoint.harnessId !== profile.harnessId || checkpoint.nativeSessionId !== input.sourceRef.nativeSessionId || checkpoint.formatVersion !== 1 || index < 0)
26069
+ if (checkpoint.harnessId !== profile.harnessId || checkpoint.nativeSessionId !== input2.sourceRef.nativeSessionId || checkpoint.formatVersion !== 1 || index < 0)
25950
26070
  throw new CodeBuddyError("checkpointNotFound", "Native Fork checkpoint was not found");
25951
26071
  excluded2 = turns[index + 1]?.nativeTurnRef.nativeTurnKey;
25952
26072
  }
@@ -26028,10 +26148,10 @@ function referencedChildren(rows2) {
26028
26148
  const data = record3(row.providerData);
26029
26149
  if (row.status === "incomplete" && data.isPartialAborted === true && data.discard === true)
26030
26150
  continue;
26031
- const callId2 = text(row.callId);
26151
+ const callId2 = text2(row.callId);
26032
26152
  if (!callId2 || calls.has(callId2))
26033
26153
  throw new CodeBuddyError("protocolError", "Agent delegation identity is ambiguous");
26034
- const resumed2 = text(argumentsRecord(row.arguments).resume);
26154
+ const resumed2 = text2(argumentsRecord(row.arguments).resume);
26035
26155
  if (resumed2 && !validCodeBuddyChildId(resumed2))
26036
26156
  throw new CodeBuddyError("protocolError", "Agent delegation has an invalid child identity");
26037
26157
  calls.set(callId2, resumed2 || void 0);
@@ -26039,18 +26159,18 @@ function referencedChildren(rows2) {
26039
26159
  }
26040
26160
  if (row.type !== "function_call_result")
26041
26161
  continue;
26042
- const callId = text(row.callId);
26162
+ const callId = text2(row.callId);
26043
26163
  if (!calls.has(callId))
26044
26164
  continue;
26045
26165
  const subagent = record3(record3(record3(row.providerData).toolResult).subAgent);
26046
- const childId = text(subagent.sessionId);
26166
+ const childId = text2(subagent.sessionId);
26047
26167
  if (!validCodeBuddyChildId(childId))
26048
26168
  throw new CodeBuddyError("unsupported", "Retained Agent result has no verified native child identity");
26049
26169
  const resumed = calls.get(callId);
26050
26170
  if (resumed && resumed !== childId)
26051
26171
  throw new CodeBuddyError("protocolError", "Agent result changed its child identity");
26052
- const lastId = text(subagent.lastId);
26053
- const afterId = text(subagent.afterId);
26172
+ const lastId = text2(subagent.lastId);
26173
+ const afterId = text2(subagent.afterId);
26054
26174
  if (!lastId)
26055
26175
  throw new CodeBuddyError("unsupported", "Retained Agent result has no bounded child transcript range");
26056
26176
  const child = children.get(childId) ?? { childId, ranges: [] };
@@ -26067,7 +26187,7 @@ function referencedChildren(rows2) {
26067
26187
  function assertChildRanges(rows2, child) {
26068
26188
  const positions = /* @__PURE__ */ new Map();
26069
26189
  for (const [index, row] of rows2.entries()) {
26070
- const id2 = text(row.id);
26190
+ const id2 = text2(row.id);
26071
26191
  if (!id2)
26072
26192
  continue;
26073
26193
  const matches = positions.get(id2) ?? [];
@@ -26193,13 +26313,13 @@ async function copyInheritedChildren(options) {
26193
26313
  }
26194
26314
  }
26195
26315
  async function deriveCodeBuddySession(options) {
26196
- const { input, environment, factory, signal } = options;
26197
- const sourceCwd = options.sourceCwd ?? input.cwd;
26316
+ const { input: input2, environment, factory, signal } = options;
26317
+ const sourceCwd = options.sourceCwd ?? input2.cwd;
26198
26318
  const profile = options.profile ?? CODEBUDDY_RUNTIME_PROFILE;
26199
26319
  const strictHistoryBinding = profile.historyCapabilities?.forkAcrossCwd === true;
26200
- validateNativeRef(input.sourceRef, profile);
26201
- const source = await codeBuddyNativeHistory(sourceCwd, input.sourceRef, environment, profile);
26202
- const retained = retainedRowCount(input, source.contents, sourceCwd, profile);
26320
+ validateNativeRef(input2.sourceRef, profile);
26321
+ const source = await codeBuddyNativeHistory(sourceCwd, input2.sourceRef, environment, profile);
26322
+ const retained = retainedRowCount(input2, source.contents, sourceCwd, profile);
26203
26323
  const sourceRows = nativeHistoryRows(source.contents);
26204
26324
  const childReferences = referencedChildren(sourceRows.slice(0, retained));
26205
26325
  const temporary = nativeSessionRefSchema.parse({
@@ -26207,18 +26327,18 @@ async function deriveCodeBuddySession(options) {
26207
26327
  nativeSessionId: randomUUID3(),
26208
26328
  formatVersion: 1
26209
26329
  });
26210
- await (options.copy ?? copyCodeBuddySession)(sourceCwd, input.sourceRef.nativeSessionId, temporary.nativeSessionId, environment, signal, options.invocationFactory ?? codeBuddyInvocation);
26330
+ await (options.copy ?? copyCodeBuddySession)(sourceCwd, input2.sourceRef.nativeSessionId, temporary.nativeSessionId, environment, signal, options.invocationFactory ?? codeBuddyInvocation);
26211
26331
  const nativeCopy = await codeBuddyNativeHistory(sourceCwd, temporary, environment, profile, {
26212
26332
  ...strictHistoryBinding ? { requirePrimary: true } : {},
26213
26333
  inheritedContents: source.contents
26214
26334
  });
26215
26335
  if (!isDeepStrictEqual3(nativeHistoryRows(nativeCopy.contents), sourceRows))
26216
26336
  throw new CodeBuddyError("unsupported", "Native history copy changed the source prefix");
26217
- const bridge = strictHistoryBinding ? await bridgeCopyToTarget(sourceCwd, input.cwd, temporary, nativeCopy.contents, environment, profile) : void 0;
26337
+ const bridge = strictHistoryBinding ? await bridgeCopyToTarget(sourceCwd, input2.cwd, temporary, nativeCopy.contents, environment, profile) : void 0;
26218
26338
  if (strictHistoryBinding) {
26219
26339
  let targetCopy;
26220
26340
  try {
26221
- targetCopy = await codeBuddyNativeHistory(input.cwd, temporary, environment, profile, {
26341
+ targetCopy = await codeBuddyNativeHistory(input2.cwd, temporary, environment, profile, {
26222
26342
  requirePrimary: true,
26223
26343
  inheritedContents: nativeCopy.contents
26224
26344
  });
@@ -26240,7 +26360,7 @@ async function deriveCodeBuddySession(options) {
26240
26360
  let client2;
26241
26361
  try {
26242
26362
  client2 = factory({
26243
- cwd: input.cwd,
26363
+ cwd: input2.cwd,
26244
26364
  environment,
26245
26365
  ephemeral: false,
26246
26366
  temporarySessionId: temporary.nativeSessionId,
@@ -26273,7 +26393,7 @@ async function deriveCodeBuddySession(options) {
26273
26393
  if (signal.aborted)
26274
26394
  throw new CodeBuddyError("invalidState", "Adapter closed during Fork");
26275
26395
  await client2.initialize();
26276
- const opened = await client2.open(input.cwd, temporary.nativeSessionId);
26396
+ const opened = await client2.open(input2.cwd, temporary.nativeSessionId);
26277
26397
  if (opened.sessionId && opened.sessionId !== temporary.nativeSessionId)
26278
26398
  throw new CodeBuddyError("protocolError", "ACP loaded a different temporary Session");
26279
26399
  const nativeState = configuration(opened.configOptions, profile).state;
@@ -26283,7 +26403,7 @@ async function deriveCodeBuddySession(options) {
26283
26403
  const result = await bounded(client2.prompt(temporary.nativeSessionId, "/fork"), 2e4, "Native Fork", abort);
26284
26404
  if (failure2)
26285
26405
  throw failure2;
26286
- if (result.stopReason !== "end_turn" || !derivedId || [input.sourceRef.nativeSessionId, temporary.nativeSessionId].includes(derivedId))
26406
+ if (result.stopReason !== "end_turn" || !derivedId || [input2.sourceRef.nativeSessionId, temporary.nativeSessionId].includes(derivedId))
26287
26407
  throw new CodeBuddyError("unsupported", "Native Fork did not report a separate Session");
26288
26408
  const preliminaryRef = nativeSessionRefSchema.parse({
26289
26409
  harnessId: profile.harnessId,
@@ -26295,29 +26415,29 @@ async function deriveCodeBuddySession(options) {
26295
26415
  ...sourceRows.flatMap((row) => typeof row.cwd === "string" ? [row.cwd] : []),
26296
26416
  ...source.historicalCwds,
26297
26417
  sourceCwd,
26298
- input.cwd
26418
+ input2.cwd
26299
26419
  ])
26300
26420
  ];
26301
26421
  const historyTransaction = strictHistoryBinding ? { requirePrimary: true, allowedHistoricalCwds: historicalCwds } : void 0;
26302
- const forked = await codeBuddyNativeHistory(input.cwd, preliminaryRef, environment, profile, historyTransaction);
26422
+ const forked = await codeBuddyNativeHistory(input2.cwd, preliminaryRef, environment, profile, historyTransaction);
26303
26423
  const forkRows = nativeHistoryRows(forked.contents);
26304
26424
  assertCopiedPrefix(sourceRows, forkRows);
26305
- const marker = strictHistoryBinding ? nativeRawHistoryRows(forked.contents).findLast((row) => Boolean(text(row.id)) && row.sessionId === derivedId && typeof row.cwd === "string" && sameResolvedPath(row.cwd, input.cwd)) : void 0;
26425
+ const marker = strictHistoryBinding ? nativeRawHistoryRows(forked.contents).findLast((row) => Boolean(text2(row.id)) && row.sessionId === derivedId && typeof row.cwd === "string" && sameResolvedPath(row.cwd, input2.cwd)) : void 0;
26306
26426
  if (strictHistoryBinding && !marker)
26307
26427
  throw new CodeBuddyError("unsupported", "Native Fork did not persist a target binding marker");
26308
26428
  if (!client2.rollback)
26309
26429
  throw new CodeBuddyError("unsupported", "Native history rewind is unavailable");
26310
- const point = retained ? text(forkRows[retained - 1]?.id) : null;
26430
+ const point = retained ? text2(forkRows[retained - 1]?.id) : null;
26311
26431
  const rewound = await client2.rollback(derivedId, point);
26312
26432
  if (rewound.applied !== true || (rewound.actualForkPointId ?? null) !== point)
26313
26433
  throw new CodeBuddyError("nativeFailure", "Native history rewind was not confirmed");
26314
- const verified = await codeBuddyNativeHistory(input.cwd, preliminaryRef, environment, profile, historyTransaction);
26434
+ const verified = await codeBuddyNativeHistory(input2.cwd, preliminaryRef, environment, profile, historyTransaction);
26315
26435
  const finalRows = nativeHistoryRows(verified.contents);
26316
26436
  if (!isDeepStrictEqual3(finalRows, forkRows.slice(0, retained)))
26317
26437
  throw new CodeBuddyError("nativeFailure", "Native history rewind did not persist the exact prefix");
26318
26438
  const inheritedChildren2 = await copyInheritedChildren({
26319
26439
  references: childReferences,
26320
- sourceRef: input.sourceRef,
26440
+ sourceRef: input2.sourceRef,
26321
26441
  sourceCwd,
26322
26442
  sourceHistoryFile: source.file,
26323
26443
  targetRef: preliminaryRef,
@@ -26329,33 +26449,33 @@ async function deriveCodeBuddySession(options) {
26329
26449
  ...preliminaryRef,
26330
26450
  locator: strictHistoryBinding ? {
26331
26451
  codebuddyDerived: 1,
26332
- boundCwd: codeBuddyCanonicalCwd(input.cwd),
26333
- targetProjectSlug: codeBuddyProjectSlug(input.cwd, profile),
26452
+ boundCwd: codeBuddyCanonicalCwd(input2.cwd),
26453
+ targetProjectSlug: codeBuddyProjectSlug(input2.cwd, profile),
26334
26454
  inheritedPrefixRows: finalRows.length,
26335
26455
  inheritedPrefixSha256: nativeRowsDigest(finalRows),
26336
- bindingMarkerId: text(marker?.id),
26456
+ bindingMarkerId: text2(marker?.id),
26337
26457
  ...inheritedChildLocator
26338
26458
  } : { codebuddyDerived: 1, ...inheritedChildLocator }
26339
26459
  });
26340
- await codeBuddyNativeHistory(input.cwd, ref, environment, profile);
26341
- const after = await codeBuddyNativeHistory(sourceCwd, input.sourceRef, environment, profile);
26460
+ await codeBuddyNativeHistory(input2.cwd, ref, environment, profile);
26461
+ const after = await codeBuddyNativeHistory(sourceCwd, input2.sourceRef, environment, profile);
26342
26462
  if (after.contents !== source.contents)
26343
26463
  throw new CodeBuddyError("sessionBusy", "Source history changed during Fork");
26344
26464
  if (signal.aborted)
26345
26465
  throw new CodeBuddyError("invalidState", "Adapter closed during Fork");
26346
- const saved = record3(record3(input.sourceRef.locator).configuration);
26466
+ const saved = record3(record3(input2.sourceRef.locator).configuration);
26347
26467
  const state = options.state ?? {
26348
26468
  ...nativeState,
26349
- ...text(saved.model) ? { effectiveModel: modelRef(text(saved.model)) } : {}
26469
+ ...text2(saved.model) ? { effectiveModel: modelRef(text2(saved.model)) } : {}
26350
26470
  };
26351
- const model2 = input.kind === "rollbackLastTurn" && input.model ? input.model : state.effectiveModel;
26352
- const thinking = input.kind === "rollbackLastTurn" && input.thinkingOptionId ? input.thinkingOptionId : options.state?.effectiveThinkingOptionId ?? (text(saved.thinking) ? harnessThinkingOptionIdSchema.parse(saved.thinking) : state.effectiveThinkingOptionId);
26353
- const mode = input.kind === "rollbackLastTurn" && input.permissionModeId ? input.permissionModeId : options.state?.effectivePermissionModeId ?? (text(saved.mode) ? harnessPermissionModeIdSchema.parse(saved.mode) : state.effectivePermissionModeId);
26471
+ const model2 = input2.kind === "rollbackLastTurn" && input2.model ? input2.model : state.effectiveModel;
26472
+ const thinking = input2.kind === "rollbackLastTurn" && input2.thinkingOptionId ? input2.thinkingOptionId : options.state?.effectiveThinkingOptionId ?? (text2(saved.thinking) ? harnessThinkingOptionIdSchema.parse(saved.thinking) : state.effectiveThinkingOptionId);
26473
+ const mode = input2.kind === "rollbackLastTurn" && input2.permissionModeId ? input2.permissionModeId : options.state?.effectivePermissionModeId ?? (text2(saved.mode) ? harnessPermissionModeIdSchema.parse(saved.mode) : state.effectivePermissionModeId);
26354
26474
  const resume = {
26355
26475
  kind: "resume",
26356
26476
  nativeRef: ref,
26357
- cwd: input.cwd,
26358
- ...input.environment ? { environment: input.environment } : {},
26477
+ cwd: input2.cwd,
26478
+ ...input2.environment ? { environment: input2.environment } : {},
26359
26479
  ...model2 ? { model: model2 } : {},
26360
26480
  ...thinking ? { thinkingOptionId: thinking } : {},
26361
26481
  ...mode ? { permissionModeId: mode } : {}
@@ -26459,15 +26579,15 @@ function sessionImportTitle(value, maxLength = HARNESS_SESSION_IMPORT_TITLE_MAX_
26459
26579
  return normalized;
26460
26580
  return `${characters.slice(0, maxLength - 1).join("").trimEnd()}…`;
26461
26581
  }
26462
- function sessionImportCandidate(input) {
26463
- const time3 = typeof input.updatedAt === "number" ? input.updatedAt : typeof input.updatedAt === "string" ? Date.parse(input.updatedAt) : Number.NaN;
26582
+ function sessionImportCandidate(input2) {
26583
+ const time3 = typeof input2.updatedAt === "number" ? input2.updatedAt : typeof input2.updatedAt === "string" ? Date.parse(input2.updatedAt) : Number.NaN;
26464
26584
  const parsed = harnessSessionImportCandidateSchema.safeParse({
26465
- nativeSessionId: input.nativeSessionId,
26466
- cwd: input.cwd,
26467
- title: typeof input.title === "string" && input.title.trim().length > 0 ? input.title : null,
26585
+ nativeSessionId: input2.nativeSessionId,
26586
+ cwd: input2.cwd,
26587
+ title: typeof input2.title === "string" && input2.title.trim().length > 0 ? input2.title : null,
26468
26588
  updatedAt: Math.floor(time3),
26469
26589
  // Unknown must stay unknown; only an explicit boolean is a native statement.
26470
- running: typeof input.running === "boolean" ? input.running : null
26590
+ running: typeof input2.running === "boolean" ? input2.running : null
26471
26591
  });
26472
26592
  return parsed.success ? parsed.data : null;
26473
26593
  }
@@ -26580,10 +26700,10 @@ async function readFacts(file2, signal) {
26580
26700
  else if (row.type === "ai-title")
26581
26701
  generatedTitle = sessionImportTitle(row.aiTitle);
26582
26702
  else {
26583
- const text2 = userText(row);
26584
- if (text2 !== null) {
26703
+ const text3 = userText(row);
26704
+ if (text3 !== null) {
26585
26705
  hasUser = true;
26586
- firstPrompt ??= sessionImportTitle(text2);
26706
+ firstPrompt ??= sessionImportTitle(text3);
26587
26707
  }
26588
26708
  }
26589
26709
  }
@@ -26756,8 +26876,8 @@ var CodeBuddyInteractions = class {
26756
26876
  this.client = client2;
26757
26877
  this.profile = profile;
26758
26878
  }
26759
- #question(turnId, input) {
26760
- const questions = rows(record3(input).questions);
26879
+ #question(turnId, input2) {
26880
+ const questions = rows(record3(input2).questions);
26761
26881
  if (!questions.length || questions.length > 4)
26762
26882
  throw new CodeBuddyError("protocolError", `Invalid ${this.profile.displayName} question count`);
26763
26883
  return {
@@ -26767,16 +26887,16 @@ var CodeBuddyInteractions = class {
26767
26887
  title: this.profile.displayName,
26768
26888
  questions: questions.map((question, index) => {
26769
26889
  const options = rows(question.options).map((option) => ({
26770
- value: text(option.label),
26771
- label: text(option.label),
26772
- ...option.description ? { description: text(option.description) } : {}
26890
+ value: text2(option.label),
26891
+ label: text2(option.label),
26892
+ ...option.description ? { description: text2(option.description) } : {}
26773
26893
  }));
26774
- if (!text(question.question) || !options.length || options.some((option) => !option.value))
26894
+ if (!text2(question.question) || !options.length || options.some((option) => !option.value))
26775
26895
  throw new CodeBuddyError("protocolError", `Malformed ${this.profile.displayName} question`);
26776
26896
  return {
26777
- id: text(question.id) || `q_${index}`,
26897
+ id: text2(question.id) || `q_${index}`,
26778
26898
  type: "choice",
26779
- prompt: text(question.question),
26899
+ prompt: text2(question.question),
26780
26900
  options,
26781
26901
  multiple: question.multiSelect === true,
26782
26902
  allowOther: true,
@@ -26786,7 +26906,7 @@ var CodeBuddyInteractions = class {
26786
26906
  };
26787
26907
  }
26788
26908
  permission(turnId, request) {
26789
- const name = text(record3(request.toolCall._meta)["codebuddy.ai/toolName"]);
26909
+ const name = text2(record3(request.toolCall._meta)["codebuddy.ai/toolName"]);
26790
26910
  if (name === "AskUserQuestion") {
26791
26911
  const interaction2 = this.#question(turnId, request.toolCall.rawInput);
26792
26912
  return new Promise((resolve) => {
@@ -27087,21 +27207,21 @@ var CodeBuddySubagents = class {
27087
27207
  }
27088
27208
  update(value) {
27089
27209
  const update = record3(value), meta3 = record3(update._meta);
27090
- const parentCallId = text(meta3["codebuddy.ai/parentToolCallId"]);
27210
+ const parentCallId = text2(meta3["codebuddy.ai/parentToolCallId"]);
27091
27211
  if (parentCallId) {
27092
27212
  const call2 = this.#calls.get(parentCallId);
27093
27213
  if (call2 && !call2.observationDone) {
27094
- const requestId = text(meta3["codebuddy.ai/conversationRequestId"]);
27214
+ const requestId = text2(meta3["codebuddy.ai/conversationRequestId"]);
27095
27215
  if (requestId)
27096
27216
  call2.requestId = requestId;
27097
- const progress = update.sessionUpdate === "tool_call" && meta3["codebuddy.ai/toolArgumentsComplete"] ? text(update.title) : "";
27217
+ const progress = update.sessionUpdate === "tool_call" && meta3["codebuddy.ai/toolArgumentsComplete"] ? text2(update.title) : "";
27098
27218
  if (progress)
27099
27219
  this.#update(call2, { resultSummary: progress.slice(0, 2e3) });
27100
27220
  this.#watch();
27101
27221
  }
27102
27222
  return true;
27103
27223
  }
27104
- const callId = text(update.toolCallId), name = text(meta3["codebuddy.ai/toolName"]);
27224
+ const callId = text2(update.toolCallId), name = text2(meta3["codebuddy.ai/toolName"]);
27105
27225
  let call = this.#calls.get(callId);
27106
27226
  if (!call && name !== "Agent" && meta3["codebuddy.ai/isSubagent"] !== true)
27107
27227
  return false;
@@ -27294,9 +27414,9 @@ var CodeBuddySession = class {
27294
27414
  #usage = null;
27295
27415
  #refreshingUsage = false;
27296
27416
  #context = {};
27297
- constructor(input, environment, factory, readHistory = readNativeHistory, onClose = () => {
27417
+ constructor(input2, environment, factory, readHistory = readNativeHistory, onClose = () => {
27298
27418
  }, profile = CODEBUDDY_RUNTIME_PROFILE) {
27299
- this.input = input;
27419
+ this.input = input2;
27300
27420
  this.environment = environment;
27301
27421
  this.factory = factory;
27302
27422
  this.readHistory = readHistory;
@@ -27312,7 +27432,7 @@ var CodeBuddySession = class {
27312
27432
  };
27313
27433
  this.subagents = new CodeBuddySubagents({
27314
27434
  parent: () => this.#ref,
27315
- cwd: input.cwd,
27435
+ cwd: input2.cwd,
27316
27436
  environment,
27317
27437
  emit: (event) => {
27318
27438
  if (event.type === "item.started" && event.item.type === "subagentDelegation")
@@ -27358,7 +27478,7 @@ var CodeBuddySession = class {
27358
27478
  }
27359
27479
  if (this.#replay)
27360
27480
  return;
27361
- if ((text(record3(update._meta)["codebuddy.ai/parentToolCallId"]) || !this.#active?.output.hasItem(`tool-${text(update.toolCallId)}`)) && this.subagents.update(update))
27481
+ if ((text2(record3(update._meta)["codebuddy.ai/parentToolCallId"]) || !this.#active?.output.hasItem(`tool-${text2(update.toolCallId)}`)) && this.subagents.update(update))
27362
27482
  return;
27363
27483
  if (update.sessionUpdate === "config_option_update" && this.#config)
27364
27484
  this.#apply(configuration(update.configOptions, this.profile));
@@ -27410,7 +27530,7 @@ var CodeBuddySession = class {
27410
27530
  this.#assertClient(generation);
27411
27531
  const opened = await client2.open(this.input.cwd, this.#ref?.nativeSessionId);
27412
27532
  this.#assertClient(generation);
27413
- const sessionId = this.#ref?.nativeSessionId ?? text(opened.sessionId);
27533
+ const sessionId = this.#ref?.nativeSessionId ?? text2(opened.sessionId);
27414
27534
  if (!sessionId || opened.sessionId && opened.sessionId !== sessionId)
27415
27535
  throw new CodeBuddyError("protocolError", "ACP returned a different Native Session identity");
27416
27536
  if (rewind) {
@@ -27442,12 +27562,12 @@ var CodeBuddySession = class {
27442
27562
  this.#apply(configuration(opened.configOptions, this.profile), false);
27443
27563
  if (this.input.kind === "create" && this.input.executionPolicy === "unattended-full-access") {
27444
27564
  await this.#configure("mode", "fullAccess");
27445
- } else if (this.input.permissionModeId || text(saved.mode))
27446
- await this.#configure("mode", this.input.permissionModeId ?? text(saved.mode));
27447
- if (this.input.model || text(saved.model))
27448
- await this.#configure("model", this.input.model?.id ?? text(saved.model));
27449
- if (this.input.thinkingOptionId || text(saved.thinking))
27450
- await this.#configure("thought_level", this.input.thinkingOptionId ?? text(saved.thinking));
27565
+ } else if (this.input.permissionModeId || text2(saved.mode))
27566
+ await this.#configure("mode", this.input.permissionModeId ?? text2(saved.mode));
27567
+ if (this.input.model || text2(saved.model))
27568
+ await this.#configure("model", this.input.model?.id ?? text2(saved.model));
27569
+ if (this.input.thinkingOptionId || text2(saved.thinking))
27570
+ await this.#configure("thought_level", this.input.thinkingOptionId ?? text2(saved.thinking));
27451
27571
  if (this.#fault || this.#closed)
27452
27572
  throw new CodeBuddyError("invalidState", "Native Session failed while opening");
27453
27573
  this.initialState = { ...this.#state };
@@ -27862,9 +27982,9 @@ var CodeBuddyAdapter = class {
27862
27982
  this.#invocation = options.invocationFactory ?? codeBuddyInvocation;
27863
27983
  this.#factory = options.clientFactory ?? ((clientOptions) => new CodeBuddyAcpClient(clientOptions, void 0, this.#invocation));
27864
27984
  }
27865
- inspect(input = {}) {
27866
- const cwd = input.cwd ?? process.cwd();
27867
- if (input.refresh)
27985
+ inspect(input2 = {}) {
27986
+ const cwd = input2.cwd ?? process.cwd();
27987
+ if (input2.refresh)
27868
27988
  this.#cache.clear();
27869
27989
  let inspection = this.#cache.get(cwd);
27870
27990
  if (!inspection) {
@@ -27917,24 +28037,24 @@ var CodeBuddyAdapter = class {
27917
28037
  }
27918
28038
  }
27919
28039
  }
27920
- async open(input) {
28040
+ async open(input2) {
27921
28041
  if (this.#closed)
27922
28042
  return failure("invalidState", "Adapter is closed", this.#profile);
27923
- if (input.kind === "create" && input.executionPolicy === "unattended-full-access" && input.permissionModeId && input.permissionModeId !== "fullAccess")
28043
+ if (input2.kind === "create" && input2.executionPolicy === "unattended-full-access" && input2.permissionModeId && input2.permissionModeId !== "fullAccess")
27924
28044
  return failure("invalidRequest", "Unattended execution requires native fullAccess permissions", this.#profile);
27925
28045
  let session;
27926
28046
  try {
27927
- if (!(await stat3(input.cwd)).isDirectory())
28047
+ if (!(await stat3(input2.cwd)).isDirectory())
27928
28048
  throw new CodeBuddyError("invalidRequest", "Working directory is not a directory");
27929
28049
  if (this.#closed)
27930
28050
  throw new CodeBuddyError("invalidState", "Adapter closed while opening Session");
27931
- if (input.kind === "resume")
27932
- validateNativeRef(input.nativeRef, this.#profile);
27933
- if (input.kind === "fork" || input.kind === "rollbackLastTurn") {
28051
+ if (input2.kind === "resume")
28052
+ validateNativeRef(input2.nativeRef, this.#profile);
28053
+ if (input2.kind === "fork" || input2.kind === "rollbackLastTurn") {
27934
28054
  const capabilities = capabilitiesForProfile(this.#profile).history;
27935
- if (input.kind === "fork" && !capabilities.fork || input.kind === "rollbackLastTurn" && !capabilities.rollbackLastTurn)
28055
+ if (input2.kind === "fork" && !capabilities.fork || input2.kind === "rollbackLastTurn" && !capabilities.rollbackLastTurn)
27936
28056
  throw new CodeBuddyError("unsupported", `${this.#profile.displayName} does not expose this verified history operation`);
27937
- const sourceRef = input.sourceRef;
28057
+ const sourceRef = input2.sourceRef;
27938
28058
  validateNativeRef(sourceRef, this.#profile);
27939
28059
  const source = [...this.#sessions].find((candidate) => candidate.initialState.nativeRef?.nativeSessionId === sourceRef.nativeSessionId);
27940
28060
  const snapshot = await source?.readSnapshot();
@@ -27942,14 +28062,14 @@ var CodeBuddyAdapter = class {
27942
28062
  throw new CodeBuddyError("invalidState", "Adapter closed while reading source Session");
27943
28063
  if (snapshot && !snapshot.ok)
27944
28064
  return snapshot;
27945
- const boundCwd = text(record3(sourceRef.locator).boundCwd);
27946
- const sourceCwd = (source?.input.cwd ?? boundCwd) || input.cwd;
27947
- if (input.kind === "fork" && !capabilities.forkAcrossCwd && codeBuddyCanonicalCwd(sourceCwd) !== codeBuddyCanonicalCwd(input.cwd))
28065
+ const boundCwd = text2(record3(sourceRef.locator).boundCwd);
28066
+ const sourceCwd = (source?.input.cwd ?? boundCwd) || input2.cwd;
28067
+ if (input2.kind === "fork" && !capabilities.forkAcrossCwd && codeBuddyCanonicalCwd(sourceCwd) !== codeBuddyCanonicalCwd(input2.cwd))
27948
28068
  throw new CodeBuddyError("unsupported", `${this.#profile.displayName} does not support cross-directory Fork`);
27949
28069
  const derivation = deriveCodeBuddySession({
27950
- input,
28070
+ input: input2,
27951
28071
  sourceCwd,
27952
- environment: { ...this.#environment, ...input.environment },
28072
+ environment: { ...this.#environment, ...input2.environment },
27953
28073
  factory: this.#factory,
27954
28074
  invocationFactory: this.#invocation,
27955
28075
  profile: this.#profile,
@@ -27958,14 +28078,14 @@ var CodeBuddyAdapter = class {
27958
28078
  });
27959
28079
  this.#derivations.add(derivation);
27960
28080
  try {
27961
- input = await derivation;
28081
+ input2 = await derivation;
27962
28082
  } finally {
27963
28083
  this.#derivations.delete(derivation);
27964
28084
  }
27965
28085
  }
27966
28086
  if (this.#closed)
27967
28087
  throw new CodeBuddyError("invalidState", "Adapter closed while opening Session");
27968
- session = new CodeBuddySession(input, { ...this.#environment, ...input.environment }, this.#factory, this.options.readHistory, () => {
28088
+ session = new CodeBuddySession(input2, { ...this.#environment, ...input2.environment }, this.#factory, this.options.readHistory, () => {
27969
28089
  if (session)
27970
28090
  this.#sessions.delete(session);
27971
28091
  }, this.#profile);
@@ -28582,8 +28702,8 @@ var WorkBuddyAdapter = class extends CodeBuddyAdapter {
28582
28702
  });
28583
28703
  this.#productModels = platform === "win32" ? productModels ?? (() => loadWorkBuddyProductModels(environment)) : async () => [];
28584
28704
  }
28585
- async inspect(input = {}) {
28586
- const inspection = await super.inspect(input);
28705
+ async inspect(input2 = {}) {
28706
+ const inspection = await super.inspect(input2);
28587
28707
  if (inspection.status !== "ready")
28588
28708
  return inspection;
28589
28709
  const productModels = await this.#productModels().catch(() => []);
@@ -28594,8 +28714,8 @@ var WorkBuddyAdapter = class extends CodeBuddyAdapter {
28594
28714
  catalog: mergeWorkBuddyProductModels(inspection.catalog, productModels)
28595
28715
  });
28596
28716
  }
28597
- async open(input) {
28598
- if (input.kind === "create" && input.executionPolicy === "unattended-full-access" && input.permissionModeId && input.permissionModeId !== "fullAccess") {
28717
+ async open(input2) {
28718
+ if (input2.kind === "create" && input2.executionPolicy === "unattended-full-access" && input2.permissionModeId && input2.permissionModeId !== "fullAccess") {
28599
28719
  return {
28600
28720
  ok: false,
28601
28721
  error: {
@@ -28605,7 +28725,7 @@ var WorkBuddyAdapter = class extends CodeBuddyAdapter {
28605
28725
  }
28606
28726
  };
28607
28727
  }
28608
- return super.open(input);
28728
+ return super.open(input2);
28609
28729
  }
28610
28730
  };
28611
28731