@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 (_3) {
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 (_3) {
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((r5) => handlePropertyResult(r5, payload, key, input, isOptionalIn, isOptionalOut)));
3004
+ proms.push(r.then((r5) => handlePropertyResult(r5, 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 el2 = shape[key];
3072
3072
  const isOptionalIn = el2._zod.optin === "optional";
3073
3073
  const isOptionalOut = el2._zod.optout === "optional";
3074
- const r = el2._zod.run({ value: input[key], issues: [] }, ctx);
3074
+ const r = el2._zod.run({ value: input2[key], issues: [] }, ctx);
3075
3075
  if (r instanceof Promise) {
3076
- proms.push(r.then((r5) => handlePropertyResult(r5, payload, key, input, isOptionalIn, isOptionalOut)));
3076
+ proms.push(r.then((r5) => handlePropertyResult(r5, 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((rr2) => {
3543
3543
  itemResults[i] = rr2;
@@ -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 el2 of rest) {
3553
3553
  i++;
3554
3554
  const result = def.rest._zod.run({ value: el2, 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((k3) => propertyKeyTypes.has(typeof k3)).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((r5) => handleRefineResult(r5, payload, input, inst));
4355
+ return r.then((r5) => handleRefineResult(r5, 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(tx2) {
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,14 +17076,46 @@ 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/desktop-attachments.js
17058
17112
  var ATTACHED_FILES_HEADING = /^\s*# Files mentioned by the user:[ \t]*(?:\r?\n|$)/u;
17059
17113
  var REQUEST_HEADING = /(?:^|\n)## My request:[ \t]*(?:\r?\n|$)/u;
17060
17114
  var IMAGE_ATTACHMENT_PATTERN = /(?:^|\n)## [^\r\n]+: ((?:\/|[A-Za-z]:[\\/]|\\\\)[^\r\n]+)\r?\nImage attachment: true(?=\r?\n|$)/gu;
17061
17115
  var CONTROL_CHARACTER_PATTERN = /[\u0000-\u001f\u007f]/u;
17062
- function desktopImageAttachmentPaths(text2) {
17063
- const end = text2.search(REQUEST_HEADING);
17064
- const context = end < 0 ? text2 : text2.slice(0, end);
17116
+ function desktopImageAttachmentPaths(text3) {
17117
+ const end = text3.search(REQUEST_HEADING);
17118
+ const context = end < 0 ? text3 : text3.slice(0, end);
17065
17119
  if (!ATTACHED_FILES_HEADING.test(context))
17066
17120
  return [];
17067
17121
  return [...context.matchAll(IMAGE_ATTACHMENT_PATTERN)].map((match) => match[1] ?? "").filter((path18) => path18.length > 0 && !CONTROL_CHARACTER_PATTERN.test(path18));
@@ -17114,17 +17168,67 @@ var remoteSshSetupResultSchema = external_exports.object({ state: external_expor
17114
17168
 
17115
17169
  // ../../shared-contracts/dist/remote-sessions.js
17116
17170
  var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
17117
- var identity = external_exports.string().min(1).max(1024);
17171
+ var REMOTE_IDENTITY_MAX_LENGTH = 1024;
17172
+ var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
17118
17173
  var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
17119
17174
  var thread = { ...target, threadId: identity };
17175
+ var text = external_exports.string().min(1).max(8e3);
17176
+ var input = { text, requestId: identity };
17177
+ var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
17178
+ external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
17179
+ external_exports.object({
17180
+ accepted: external_exports.literal(false),
17181
+ code: external_exports.enum([
17182
+ "remote/queue-unavailable",
17183
+ "remote/steer-unavailable",
17184
+ "remote/turn-changed",
17185
+ "remote/send-rejected",
17186
+ "session/queue-item-not-found",
17187
+ "session/queue-item-starting"
17188
+ ]),
17189
+ message: external_exports.string()
17190
+ })
17191
+ ]);
17192
+ var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
17193
+ external_exports.object({ available: external_exports.literal(false) }),
17194
+ external_exports.object({
17195
+ available: external_exports.literal(true),
17196
+ items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
17197
+ })
17198
+ ]);
17120
17199
  var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
17121
17200
  external_exports.strictObject({ kind: external_exports.literal("hosts") }),
17201
+ external_exports.strictObject({
17202
+ kind: external_exports.literal("create"),
17203
+ ...target,
17204
+ cwd: external_exports.string().min(1).max(8192),
17205
+ epoch: identity
17206
+ }),
17207
+ external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
17208
+ external_exports.strictObject({
17209
+ kind: external_exports.literal("inspectHarness"),
17210
+ ...target,
17211
+ epoch: identity,
17212
+ cwd: external_exports.string().min(1).max(8192),
17213
+ harnessId: identity
17214
+ }),
17215
+ external_exports.strictObject({
17216
+ kind: external_exports.literal("startSelected"),
17217
+ ...target,
17218
+ epoch: identity,
17219
+ cwd: external_exports.string().min(1).max(8192),
17220
+ harnessId: identity,
17221
+ model: external_exports.string().min(1).max(4096),
17222
+ serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
17223
+ reasoningEffort: identity.optional()
17224
+ }),
17122
17225
  external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
17123
17226
  external_exports.strictObject({
17124
17227
  kind: external_exports.literal("list"),
17125
17228
  ...target,
17126
17229
  cursor: external_exports.string().nullable(),
17127
- archived: external_exports.boolean()
17230
+ archived: external_exports.boolean(),
17231
+ includeLoaded: external_exports.literal(true).optional()
17128
17232
  }),
17129
17233
  external_exports.strictObject({
17130
17234
  kind: external_exports.literal("read"),
@@ -17154,9 +17258,25 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
17154
17258
  kind: external_exports.literal("prompt"),
17155
17259
  ...thread,
17156
17260
  epoch: identity,
17157
- text: external_exports.string().min(1).max(8e3),
17261
+ text,
17158
17262
  requestId: identity.optional()
17159
17263
  }),
17264
+ external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
17265
+ external_exports.strictObject({
17266
+ kind: external_exports.literal("delivery"),
17267
+ ...thread,
17268
+ epoch: identity,
17269
+ action: external_exports.discriminatedUnion("kind", [
17270
+ external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input }),
17271
+ external_exports.strictObject({ kind: external_exports.literal("steer"), ...input, turnId: identity }),
17272
+ external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
17273
+ external_exports.strictObject({
17274
+ kind: external_exports.literal("start"),
17275
+ itemId: identity,
17276
+ onlyIfHead: external_exports.literal(true).optional()
17277
+ })
17278
+ ])
17279
+ }),
17160
17280
  external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
17161
17281
  external_exports.strictObject({
17162
17282
  kind: external_exports.literal("rename"),
@@ -17667,8 +17787,8 @@ function liveHarnessCommandPrompt(catalog, idPrefix, commandId, argumentText) {
17667
17787
  const descriptor = catalog.commands.find(({ id: id3 }) => id3 === commandId);
17668
17788
  if (!descriptor)
17669
17789
  return null;
17670
- const text2 = typeof argumentText === "string" ? argumentText.trim() : "";
17671
- return text2 ? `${descriptor.invocation} ${text2}` : descriptor.invocation;
17790
+ const text3 = typeof argumentText === "string" ? argumentText.trim() : "";
17791
+ return text3 ? `${descriptor.invocation} ${text3}` : descriptor.invocation;
17672
17792
  }
17673
17793
  function mergeLiveHarnessCommands(builtIns, idPrefix, live, exclusions = {}) {
17674
17794
  if (!live)
@@ -17708,9 +17828,9 @@ function subagentConfiguration(value) {
17708
17828
  if (typeof value !== "object" || value === null || Array.isArray(value))
17709
17829
  return {};
17710
17830
  const row = value;
17711
- const text2 = (value2) => typeof value2 === "string" && value2.trim() ? value2 : void 0;
17712
- const model2 = row.model === "inherit" ? void 0 : text2(row.model);
17713
- const reasoningEffort = text2(row.reasoningEffort) ?? text2(row.reasoning_effort) ?? text2(row.thinking);
17831
+ const text3 = (value2) => typeof value2 === "string" && value2.trim() ? value2 : void 0;
17832
+ const model2 = row.model === "inherit" ? void 0 : text3(row.model);
17833
+ const reasoningEffort = text3(row.reasoningEffort) ?? text3(row.reasoning_effort) ?? text3(row.thinking);
17714
17834
  return { ...model2 ? { model: model2 } : {}, ...reasoningEffort ? { reasoningEffort } : {} };
17715
17835
  }
17716
17836
  function inheritSubagentConfiguration(child, parent) {
@@ -17883,13 +18003,13 @@ function consumeBrokerFrames(socket, onFrame, onError, maxBytes = HARNESS_BROKER
17883
18003
  bufferedBytes = required2;
17884
18004
  if (newline < 0)
17885
18005
  return;
17886
- const text2 = buffered.toString("utf8", 0, bufferedBytes);
18006
+ const text3 = buffered.toString("utf8", 0, bufferedBytes);
17887
18007
  bufferedBytes = 0;
17888
18008
  if (buffered.length > 64 * 1024)
17889
18009
  buffered = Buffer.alloc(0);
17890
- if (text2.length > 0) {
18010
+ if (text3.length > 0) {
17891
18011
  try {
17892
- const value = JSON.parse(text2);
18012
+ const value = JSON.parse(text3);
17893
18013
  onFrame(value);
17894
18014
  } catch (error52) {
17895
18015
  fail(error52 instanceof SyntaxError ? new Error("Harness broker received invalid JSON") : error52 instanceof Error ? error52 : new Error(String(error52)));
@@ -18276,7 +18396,7 @@ var harnessOutputSchema = external_exports.custom((value) => {
18276
18396
  });
18277
18397
 
18278
18398
  // ../../harness-broker/dist/session-import-client.js
18279
- function createBrokerSessionImportCapability(input) {
18399
+ function createBrokerSessionImportCapability(input2) {
18280
18400
  let listing = null;
18281
18401
  const closed = () => ({
18282
18402
  ok: false,
@@ -18296,13 +18416,13 @@ function createBrokerSessionImportCapability(input) {
18296
18416
  const identities = /* @__PURE__ */ new Set();
18297
18417
  let total;
18298
18418
  for (; ; ) {
18299
- if (input.isClosed())
18419
+ if (input2.isClosed())
18300
18420
  return closed();
18301
- const result = await input.request("adapter.sessionImport.list", {
18421
+ const result = await input2.request("adapter.sessionImport.list", {
18302
18422
  offset: candidates.length,
18303
18423
  limit: HARNESS_BROKER_SESSION_IMPORT_PAGE_SIZE
18304
18424
  });
18305
- if (input.isClosed())
18425
+ if (input2.isClosed())
18306
18426
  return closed();
18307
18427
  if (!result.ok)
18308
18428
  return result;
@@ -18320,12 +18440,12 @@ function createBrokerSessionImportCapability(input) {
18320
18440
  return { ok: true, value: candidates };
18321
18441
  }
18322
18442
  } catch (error52) {
18323
- return { ok: false, error: input.error(error52) };
18443
+ return { ok: false, error: input2.error(error52) };
18324
18444
  }
18325
18445
  };
18326
18446
  return {
18327
18447
  listCandidates() {
18328
- if (input.isClosed())
18448
+ if (input2.isClosed())
18329
18449
  return Promise.resolve(closed());
18330
18450
  listing ??= list().finally(() => {
18331
18451
  listing = null;
@@ -18333,20 +18453,20 @@ function createBrokerSessionImportCapability(input) {
18333
18453
  return listing;
18334
18454
  },
18335
18455
  async resolveCandidate(nativeSessionId) {
18336
- if (input.isClosed())
18456
+ if (input2.isClosed())
18337
18457
  return closed();
18338
18458
  try {
18339
- const result = await input.request("adapter.sessionImport.resolve", { nativeSessionId });
18340
- if (input.isClosed())
18459
+ const result = await input2.request("adapter.sessionImport.resolve", { nativeSessionId });
18460
+ if (input2.isClosed())
18341
18461
  return closed();
18342
18462
  if (!result.ok)
18343
18463
  return result;
18344
18464
  const source = brokerSessionImportSourceSchema.safeParse(result.value);
18345
- if (!source.success || source.data.nativeRef.harnessId !== input.harnessId || source.data.candidate.nativeSessionId !== nativeSessionId)
18465
+ if (!source.success || source.data.nativeRef.harnessId !== input2.harnessId || source.data.candidate.nativeSessionId !== nativeSessionId)
18346
18466
  return invalid();
18347
18467
  return { ok: true, value: source.data };
18348
18468
  } catch (error52) {
18349
- return { ok: false, error: input.error(error52) };
18469
+ return { ok: false, error: input2.error(error52) };
18350
18470
  }
18351
18471
  }
18352
18472
  };
@@ -18926,17 +19046,17 @@ var BrokeredHarnessAdapter = class {
18926
19046
  #credits = null;
18927
19047
  #creditsRefresh = null;
18928
19048
  subagents = {
18929
- readSnapshot: async (input) => {
19049
+ readSnapshot: async (input2) => {
18930
19050
  try {
18931
- return parseHarnessResult(await this.#request("adapter.subagent.readSnapshot", input));
19051
+ return parseHarnessResult(await this.#request("adapter.subagent.readSnapshot", input2));
18932
19052
  } catch (error52) {
18933
19053
  return { ok: false, error: this.#error(error52) };
18934
19054
  }
18935
19055
  }
18936
19056
  };
18937
- constructor(input = {}) {
18938
- this.harnessId = harnessPluginIdSchema.parse(input.harnessId ?? "claude-code");
18939
- if (input.sessionImport) {
19057
+ constructor(input2 = {}) {
19058
+ this.harnessId = harnessPluginIdSchema.parse(input2.harnessId ?? "claude-code");
19059
+ if (input2.sessionImport) {
18940
19060
  this.sessionImport = createBrokerSessionImportCapability({
18941
19061
  harnessId: this.harnessId,
18942
19062
  request: async (method, params) => parseHarnessResult(await this.#request(method, params, method === "adapter.sessionImport.resolve")),
@@ -18944,20 +19064,20 @@ var BrokeredHarnessAdapter = class {
18944
19064
  error: (error52) => this.#error(error52)
18945
19065
  });
18946
19066
  }
18947
- if (input.accountCredits !== false) {
19067
+ if (input2.accountCredits !== false) {
18948
19068
  this.credits = () => this.#credits;
18949
19069
  this.refreshCredits = () => this.#refreshAccountCredits();
18950
19070
  }
18951
- this.#forwardEnvironment = input.forwardDelegationEnvironment === true;
18952
- if (input.commandCatalog)
18953
- this.commandCatalog = input.commandCatalog;
18954
- if (input.liveCommandCatalog)
19071
+ this.#forwardEnvironment = input2.forwardDelegationEnvironment === true;
19072
+ if (input2.commandCatalog)
19073
+ this.commandCatalog = input2.commandCatalog;
19074
+ if (input2.liveCommandCatalog)
18955
19075
  this.liveCommandCatalog = true;
18956
- this.#descriptorPath = input.descriptorPath ?? defaultHarnessBrokerDescriptorPath(input.environment, this.harnessId);
18957
- this.#isInstalled = input.isInstalled;
18958
- const environment = input.environment ?? process.env;
18959
- this.#startBroker = input.startBroker === false ? void 0 : input.startBroker ?? (process.platform === "darwin" && !input.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
18960
- this.#startTimeoutMs = input.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
19076
+ this.#descriptorPath = input2.descriptorPath ?? defaultHarnessBrokerDescriptorPath(input2.environment, this.harnessId);
19077
+ this.#isInstalled = input2.isInstalled;
19078
+ const environment = input2.environment ?? process.env;
19079
+ this.#startBroker = input2.startBroker === false ? void 0 : input2.startBroker ?? (process.platform === "darwin" && !input2.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
19080
+ this.#startTimeoutMs = input2.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
18961
19081
  }
18962
19082
  #refreshAccountCredits() {
18963
19083
  if (this.#closed)
@@ -18989,11 +19109,11 @@ var BrokeredHarnessAdapter = class {
18989
19109
  return null;
18990
19110
  }
18991
19111
  }
18992
- async inspect(input = {}) {
19112
+ async inspect(input2 = {}) {
18993
19113
  if (this.#closed)
18994
19114
  return failedInspection("Aqua Harness broker adapter is closed");
18995
19115
  try {
18996
- return harnessInspectionSchema.parse(await this.#request("adapter.inspect", input, true));
19116
+ return harnessInspectionSchema.parse(await this.#request("adapter.inspect", input2, true));
18997
19117
  } catch (error52) {
18998
19118
  this.#connection = null;
18999
19119
  if (error52 instanceof HarnessNotInstalledError)
@@ -19005,12 +19125,12 @@ var BrokeredHarnessAdapter = class {
19005
19125
  const result = await this.#request("adapter.normalizeStoredModelRef", { ref, catalog }, true);
19006
19126
  return harnessModelRefSchema.nullable().parse(result) ?? void 0;
19007
19127
  }
19008
- async open(input) {
19128
+ async open(input2) {
19009
19129
  if (this.#closed)
19010
19130
  return { ok: false, error: unavailable("Aqua Harness broker adapter is closed", false) };
19011
- const safeInput = { ...input };
19131
+ const safeInput = { ...input2 };
19012
19132
  delete safeInput.environment;
19013
- if (this.#forwardEnvironment && input.environment) {
19133
+ if (this.#forwardEnvironment && input2.environment) {
19014
19134
  const allowed2 = [
19015
19135
  "CODEXHOST_CLI_PATH",
19016
19136
  "CODEXHOST_CLI_NODE_PATH",
@@ -19018,7 +19138,7 @@ var BrokeredHarnessAdapter = class {
19018
19138
  "CODEXHOST_RUNTIME_TOKEN",
19019
19139
  "CODEXHOST_THREAD_ID"
19020
19140
  ];
19021
- const environment = Object.fromEntries(Object.entries(input.environment).filter(([key, value]) => allowed2.includes(key) && value !== void 0));
19141
+ const environment = Object.fromEntries(Object.entries(input2.environment).filter(([key, value]) => allowed2.includes(key) && value !== void 0));
19022
19142
  if (Object.keys(environment).length)
19023
19143
  safeInput.environment = environment;
19024
19144
  }
@@ -19144,11 +19264,11 @@ function isClaudeModelRequest(model2) {
19144
19264
  function claudeUsageRecord(requestId, model2, usage, extra = {}) {
19145
19265
  if (!isRecord2(usage))
19146
19266
  return { kind: "missing" };
19147
- const input = count2(usage.input_tokens);
19267
+ const input2 = count2(usage.input_tokens);
19148
19268
  const output = count2(usage.output_tokens);
19149
19269
  const cacheRead = count2(usage.cache_read_input_tokens ?? 0);
19150
19270
  const cacheWrite = count2(usage.cache_creation_input_tokens ?? 0);
19151
- if (input === null || output === null || cacheRead === null || cacheWrite === null) {
19271
+ if (input2 === null || output === null || cacheRead === null || cacheWrite === null) {
19152
19272
  return { kind: "missing" };
19153
19273
  }
19154
19274
  const split = isRecord2(usage.cache_creation) ? usage.cache_creation : null;
@@ -19165,7 +19285,7 @@ function claudeUsageRecord(requestId, model2, usage, extra = {}) {
19165
19285
  model: model2,
19166
19286
  // Claude Code's providers (first-party, Bedrock, Vertex, gateways) differ in model IDs,
19167
19287
  // not in list prices; the model ID alone resolves the price.
19168
- inputTokens: input + cacheRead + cacheWrite,
19288
+ inputTokens: input2 + cacheRead + cacheWrite,
19169
19289
  cachedInputTokens: cacheRead,
19170
19290
  cacheWriteInputTokens: cacheWrite,
19171
19291
  // Mirrors Claude Code's own pricing: one-hour writes are capped by the total writes.
@@ -19358,14 +19478,14 @@ async function readClaudeUsage(file2, signal) {
19358
19478
  const entry = record3.kind === "request" && at2 !== null && usageEntryFromRequest(record3.request, at2);
19359
19479
  if (entry)
19360
19480
  entries.push(withUsageSession(entry, {
19361
- sessionId: text(sessionId),
19362
- cwd: text(cwd),
19481
+ sessionId: text2(sessionId),
19482
+ cwd: text2(cwd),
19363
19483
  title: customTitle ?? generatedTitle ?? firstPrompt
19364
19484
  }));
19365
19485
  }
19366
19486
  return entries;
19367
19487
  }
19368
- function text(value) {
19488
+ function text2(value) {
19369
19489
  return typeof value === "string" ? value : void 0;
19370
19490
  }
19371
19491
  function claudeUserPrompt(message) {
@@ -55135,15 +55255,15 @@ function sessionImportTitle(value, maxLength = HARNESS_SESSION_IMPORT_TITLE_MAX_
55135
55255
  return normalized;
55136
55256
  return `${characters.slice(0, maxLength - 1).join("").trimEnd()}…`;
55137
55257
  }
55138
- function sessionImportCandidate(input) {
55139
- const time3 = typeof input.updatedAt === "number" ? input.updatedAt : typeof input.updatedAt === "string" ? Date.parse(input.updatedAt) : Number.NaN;
55258
+ function sessionImportCandidate(input2) {
55259
+ const time3 = typeof input2.updatedAt === "number" ? input2.updatedAt : typeof input2.updatedAt === "string" ? Date.parse(input2.updatedAt) : Number.NaN;
55140
55260
  const parsed = harnessSessionImportCandidateSchema.safeParse({
55141
- nativeSessionId: input.nativeSessionId,
55142
- cwd: input.cwd,
55143
- title: typeof input.title === "string" && input.title.trim().length > 0 ? input.title : null,
55261
+ nativeSessionId: input2.nativeSessionId,
55262
+ cwd: input2.cwd,
55263
+ title: typeof input2.title === "string" && input2.title.trim().length > 0 ? input2.title : null,
55144
55264
  updatedAt: Math.floor(time3),
55145
55265
  // Unknown must stay unknown; only an explicit boolean is a native statement.
55146
- running: typeof input.running === "boolean" ? input.running : null
55266
+ running: typeof input2.running === "boolean" ? input2.running : null
55147
55267
  });
55148
55268
  return parsed.success ? parsed.data : null;
55149
55269
  }
@@ -55216,8 +55336,8 @@ function userText(message) {
55216
55336
  if (!isRecord5(message) || message.role !== "user")
55217
55337
  return null;
55218
55338
  const { content } = message;
55219
- const text2 = typeof content === "string" ? cleanText(content) : Array.isArray(content) ? cleanText(content.filter((block) => isRecord5(block) && block.type === "text" && typeof block.text === "string").map((block) => String(block.text)).join(" ")) : null;
55220
- return text2 && !CLAUDE_INTERNAL_USER_TEXT.test(text2) ? text2 : null;
55339
+ const text3 = typeof content === "string" ? cleanText(content) : Array.isArray(content) ? cleanText(content.filter((block) => isRecord5(block) && block.type === "text" && typeof block.text === "string").map((block) => String(block.text)).join(" ")) : null;
55340
+ return text3 && !CLAUDE_INTERNAL_USER_TEXT.test(text3) ? text3 : null;
55221
55341
  }
55222
55342
  function claudeProjectsDirectory2(environment) {
55223
55343
  const home = (process.platform === "win32" ? environment.USERPROFILE : environment.HOME) || os3.homedir();
@@ -55535,8 +55655,8 @@ var VERSION_MANAGER_ROOTS = "<version-managers>";
55535
55655
  function installRootExtensions(platform) {
55536
55656
  return platform === "win32" ? [".exe", ".cmd"] : [""];
55537
55657
  }
55538
- function resolveHomeDirectory(input) {
55539
- return input.homeDirectory ?? environmentValue(input.environment, "HOME") ?? environmentValue(input.environment, "USERPROFILE") ?? os4.homedir();
55658
+ function resolveHomeDirectory(input2) {
55659
+ return input2.homeDirectory ?? environmentValue(input2.environment, "HOME") ?? environmentValue(input2.environment, "USERPROFILE") ?? os4.homedir();
55540
55660
  }
55541
55661
  function templateVariables(environment, platform, home) {
55542
55662
  const pathFlavor = targetPath(platform);
@@ -55569,36 +55689,36 @@ function expandInstallRoot(template, environment, platform, home) {
55569
55689
  });
55570
55690
  return unresolved ? void 0 : joinTemplate(platform, substituted);
55571
55691
  }
55572
- function installRootDirectories(spec, input, dependencies, platform, home) {
55692
+ function installRootDirectories(spec, input2, dependencies, platform, home) {
55573
55693
  const templates = (platform === "win32" ? spec.installRoots?.windows : spec.installRoots?.posix) ?? [];
55574
55694
  const directories = [];
55575
55695
  for (const template of templates) {
55576
55696
  if (template === VERSION_MANAGER_ROOTS) {
55577
55697
  directories.push(...versionManagerBinaryDirectories({
55578
55698
  platform,
55579
- environment: input.environment,
55699
+ environment: input2.environment,
55580
55700
  home,
55581
55701
  ...dependencies.subdirectories ? { subdirectories: dependencies.subdirectories } : {}
55582
55702
  }));
55583
55703
  continue;
55584
55704
  }
55585
- const directory = expandInstallRoot(template, input.environment, platform, home);
55705
+ const directory = expandInstallRoot(template, input2.environment, platform, home);
55586
55706
  if (directory !== void 0)
55587
55707
  directories.push(directory);
55588
55708
  }
55589
55709
  return directories;
55590
55710
  }
55591
- function harnessCandidates(spec, input, dependencies = {}) {
55592
- const platform = input.platform ?? process.platform;
55711
+ function harnessCandidates(spec, input2, dependencies = {}) {
55712
+ const platform = input2.platform ?? process.platform;
55593
55713
  const pathFlavor = targetPath(platform);
55594
- const configured = input.command ?? (spec.commandEnvironmentVariable ? environmentValue(input.environment, spec.commandEnvironmentVariable) : void 0);
55714
+ const configured = input2.command ?? (spec.commandEnvironmentVariable ? environmentValue(input2.environment, spec.commandEnvironmentVariable) : void 0);
55595
55715
  const command = configured ?? spec.command;
55596
55716
  if (pathFlavor.isAbsolute(command) || command.includes("/") || command.includes("\\")) {
55597
55717
  return [{ candidate: command, source: "configured" }];
55598
55718
  }
55599
55719
  const candidates = [];
55600
- const extensions = executableExtensions(command, platform, input.environment);
55601
- for (const directory of pathDirectories(input.environment, platform)) {
55720
+ const extensions = executableExtensions(command, platform, input2.environment);
55721
+ for (const directory of pathDirectories(input2.environment, platform)) {
55602
55722
  for (const extension of extensions) {
55603
55723
  candidates.push({
55604
55724
  candidate: pathFlavor.join(directory, command + extension),
@@ -55608,8 +55728,8 @@ function harnessCandidates(spec, input, dependencies = {}) {
55608
55728
  }
55609
55729
  if (configured !== void 0)
55610
55730
  return candidates;
55611
- const home = resolveHomeDirectory(input);
55612
- for (const directory of installRootDirectories(spec, input, dependencies, platform, home)) {
55731
+ const home = resolveHomeDirectory(input2);
55732
+ for (const directory of installRootDirectories(spec, input2, dependencies, platform, home)) {
55613
55733
  for (const extension of installRootExtensions(platform)) {
55614
55734
  candidates.push({
55615
55735
  candidate: pathFlavor.join(directory, spec.command + extension),
@@ -55619,12 +55739,12 @@ function harnessCandidates(spec, input, dependencies = {}) {
55619
55739
  }
55620
55740
  return candidates;
55621
55741
  }
55622
- function resolveHarnessExecutable(spec, input, dependencies = {}) {
55623
- const platform = input.platform ?? process.platform;
55742
+ function resolveHarnessExecutable(spec, input2, dependencies = {}) {
55743
+ const platform = input2.platform ?? process.platform;
55624
55744
  const isExecutable = dependencies.isExecutable ?? ((candidate) => isExecutableFile(candidate, platform));
55625
55745
  const runnable = spec.runnableCandidate ?? ((candidate) => candidate);
55626
55746
  const context = { platform, isExecutable };
55627
- for (const { candidate, source } of harnessCandidates(spec, input, dependencies)) {
55747
+ for (const { candidate, source } of harnessCandidates(spec, input2, dependencies)) {
55628
55748
  const executable = runnable(candidate, context);
55629
55749
  if (executable !== void 0 && isExecutable(executable))
55630
55750
  return { executable, source };
@@ -55635,13 +55755,13 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
55635
55755
  // ../../harness-discovery/dist/installation.js
55636
55756
  import { execFile as execFile2 } from "node:child_process";
55637
55757
  import { homedir } from "node:os";
55638
- function runInstallationCommand(command, args, environment, timeout = 3e4) {
55758
+ function runInstallationCommand(command, args, environment, timeout = 3e4, cwd) {
55639
55759
  const env = withNodeRuntimeOnPath(environment);
55640
55760
  const invocation = /\.[cm]?js$/i.test(command) ? commandInvocation(process.execPath, [command, ...args], env) : commandInvocation(command, args, env);
55641
55761
  return new Promise((resolve5, reject) => {
55642
55762
  const child = execFile2(invocation.command, invocation.arguments, {
55643
55763
  env,
55644
- cwd: env.HOME ?? env.USERPROFILE ?? homedir(),
55764
+ cwd: cwd ?? env.HOME ?? env.USERPROFILE ?? homedir(),
55645
55765
  encoding: "utf8",
55646
55766
  timeout,
55647
55767
  killSignal: "SIGKILL",
@@ -55704,7 +55824,7 @@ function createInstallationManager(options) {
55704
55824
  const check2 = () => checking ??= options.check().finally(() => {
55705
55825
  checking = void 0;
55706
55826
  });
55707
- return (action) => {
55827
+ return (action, confirmedVersion) => {
55708
55828
  if (updating)
55709
55829
  return updating;
55710
55830
  if (action === "check")
@@ -55715,6 +55835,8 @@ function createInstallationManager(options) {
55715
55835
  return before;
55716
55836
  if (!before.canUpdate)
55717
55837
  throw new Error(before.message ?? "This installation cannot be updated automatically");
55838
+ if ((before.latestVerifiedVersion !== void 0 || confirmedVersion !== void 0) && before.latestVersion !== confirmedVersion)
55839
+ return { ...before, confirmationRequired: true };
55718
55840
  await options.update(before);
55719
55841
  const after = await check2();
55720
55842
  if (after.currentVersion === before.currentVersion)
@@ -55749,8 +55871,8 @@ function referencesNpmBin(shim, name, bin) {
55749
55871
  if (bin.includes(".."))
55750
55872
  return false;
55751
55873
  const target2 = `node_modules/${name}/${bin.replace(/^\.\//, "")}`.toLowerCase();
55752
- const text2 = shim.replaceAll("\\", "/").toLowerCase();
55753
- return text2.includes(`%dp0%/${target2}"`) || text2.includes(`%~dp0/${target2}"`);
55874
+ const text3 = shim.replaceAll("\\", "/").toLowerCase();
55875
+ return text3.includes(`%dp0%/${target2}"`) || text3.includes(`%~dp0/${target2}"`);
55754
55876
  }
55755
55877
  async function npmInstallation(command, packages, environment) {
55756
55878
  let selected = await realpath4(command);
@@ -55759,7 +55881,7 @@ async function npmInstallation(command, packages, environment) {
55759
55881
  const root = path8.dirname(selected);
55760
55882
  for (const name of packages) {
55761
55883
  const directory2 = path8.join(root, "node_modules", ...name.split("/"));
55762
- const metadata = await readFile3(path8.join(directory2, "package.json"), "utf8").then((text2) => JSON.parse(text2)).catch(() => null);
55884
+ const metadata = await readFile3(path8.join(directory2, "package.json"), "utf8").then((text3) => JSON.parse(text3)).catch(() => null);
55763
55885
  const bins = typeof metadata?.bin === "string" ? [metadata.bin] : Object.values(metadata?.bin ?? {});
55764
55886
  const bin = bins.find((entry) => referencesNpmBin(shim, name, entry));
55765
55887
  if (bin) {
@@ -55770,7 +55892,7 @@ async function npmInstallation(command, packages, environment) {
55770
55892
  }
55771
55893
  let directory = path8.dirname(selected);
55772
55894
  for (let depth = 0; depth < 8; depth++) {
55773
- const metadata = await readFile3(path8.join(directory, "package.json"), "utf8").then((text2) => JSON.parse(text2)).catch(() => null);
55895
+ const metadata = await readFile3(path8.join(directory, "package.json"), "utf8").then((text3) => JSON.parse(text3)).catch(() => null);
55774
55896
  if (metadata?.name && packages.includes(metadata.name)) {
55775
55897
  const name = metadata.name;
55776
55898
  const currentVersion = installationVersion(metadata.version);
@@ -55911,12 +56033,12 @@ var claudeCodeDiscoverySpec = {
55911
56033
  return isExecutable(native) ? native : void 0;
55912
56034
  }
55913
56035
  };
55914
- function resolveClaudeCodeExecutable(input = {}, dependencies = {}) {
55915
- const platform = input.platform ?? process.platform;
56036
+ function resolveClaudeCodeExecutable(input2 = {}, dependencies = {}) {
56037
+ const platform = input2.platform ?? process.platform;
55916
56038
  const resolution = resolveHarnessExecutable(claudeCodeDiscoverySpec, {
55917
- ...input.command ? { command: input.command } : {},
55918
- environment: input.environment ?? process.env,
55919
- ...input.homeDirectory ? { homeDirectory: input.homeDirectory } : {},
56039
+ ...input2.command ? { command: input2.command } : {},
56040
+ environment: input2.environment ?? process.env,
56041
+ ...input2.homeDirectory ? { homeDirectory: input2.homeDirectory } : {},
55920
56042
  platform
55921
56043
  }, dependencies);
55922
56044
  if (!resolution)
@@ -56563,14 +56685,14 @@ function subagentContinuesInBackground(nativeResult, outputText) {
56563
56685
  return outputText?.includes("The agent is working in the background.") ?? false;
56564
56686
  }
56565
56687
  function resultText(content, nativeResult) {
56566
- let text2 = "";
56688
+ let text3 = "";
56567
56689
  if (typeof content === "string") {
56568
- text2 = content;
56690
+ text3 = content;
56569
56691
  } else if (Array.isArray(content)) {
56570
- text2 = content.flatMap((block) => isRecord8(block) && block.type === "text" && typeof block.text === "string" ? [block.text] : []).join("");
56692
+ text3 = content.flatMap((block) => isRecord8(block) && block.type === "text" && typeof block.text === "string" ? [block.text] : []).join("");
56571
56693
  }
56572
- if (text2.length > 0)
56573
- return text2;
56694
+ if (text3.length > 0)
56695
+ return text3;
56574
56696
  if (!isRecord8(nativeResult))
56575
56697
  return void 0;
56576
56698
  const stdout = typeof nativeResult.stdout === "string" ? nativeResult.stdout : "";
@@ -56583,8 +56705,8 @@ function userMessageText(content) {
56583
56705
  return content;
56584
56706
  if (!Array.isArray(content))
56585
56707
  return null;
56586
- const text2 = content.flatMap((block) => isRecord8(block) && block.type === "text" && typeof block.text === "string" ? [block.text] : []).join("");
56587
- return text2.length > 0 ? text2 : null;
56708
+ const text3 = content.flatMap((block) => isRecord8(block) && block.type === "text" && typeof block.text === "string" ? [block.text] : []).join("");
56709
+ return text3.length > 0 ? text3 : null;
56588
56710
  }
56589
56711
  function parseClaudeTaskNotification(message) {
56590
56712
  if (!isRecord8(message) || message.type !== "user" || !isRecord8(message.message))
@@ -57022,9 +57144,9 @@ var ClaudeNativeTurnAccumulator = class {
57022
57144
  events.push({ type: "text.delta", messageId, delta: delta.text });
57023
57145
  return;
57024
57146
  }
57025
- const text2 = delta?.type === "thinking_delta" && typeof delta.thinking === "string" ? delta.thinking : "";
57147
+ const text3 = delta?.type === "thinking_delta" && typeof delta.thinking === "string" ? delta.thinking : "";
57026
57148
  const signature = delta?.type === "signature_delta" && typeof delta.signature === "string" ? delta.signature : "";
57027
- if (!start && !text2 && !signature)
57149
+ if (!start && !text3 && !signature)
57028
57150
  return;
57029
57151
  let thinking = state.thinking.get(index);
57030
57152
  if (!thinking) {
@@ -57041,13 +57163,13 @@ var ClaudeNativeTurnAccumulator = class {
57041
57163
  if (thinking.stopped)
57042
57164
  return;
57043
57165
  thinking.signature += signature;
57044
- if (text2) {
57045
- thinking.text += text2;
57166
+ if (text3) {
57167
+ thinking.text += text3;
57046
57168
  thinking.streamed = true;
57047
57169
  events.push({
57048
57170
  type: "reasoning.delta",
57049
57171
  messageId: `${messageId}:thinking:${index}`,
57050
- delta: text2
57172
+ delta: text3
57051
57173
  });
57052
57174
  }
57053
57175
  }
@@ -57155,15 +57277,15 @@ var ClaudeNativeTurnAccumulator = class {
57155
57277
  if (thinking.streamed)
57156
57278
  events.push({ type: "reasoning.completed", messageId });
57157
57279
  }
57158
- #publishNarration(thinking, messageId, signature, text2, events) {
57159
- if (!text2 || thinking?.narrationPublished || !isClaudeNarrationSignature(signature))
57280
+ #publishNarration(thinking, messageId, signature, text3, events) {
57281
+ if (!text3 || thinking?.narrationPublished || !isClaudeNarrationSignature(signature))
57160
57282
  return;
57161
57283
  if (thinking)
57162
57284
  thinking.narrationPublished = true;
57163
57285
  events.push({
57164
57286
  type: "narration.completed",
57165
57287
  messageId,
57166
- text: text2,
57288
+ text: text3,
57167
57289
  ...thinking?.streamed ? {} : { completeOnly: true }
57168
57290
  });
57169
57291
  }
@@ -57430,42 +57552,42 @@ var controlCommandNamePattern = /<command-name>\s*\/(?:model|compact)\s*<\/comma
57430
57552
  var recapCommandNamePattern = /<command-name>\s*\/recap\s*<\/command-name>/u;
57431
57553
  var initCommandNamePattern = /<command-name>\s*\/init\s*<\/command-name>/u;
57432
57554
  var localCommandStdoutPattern = /^\s*<local-command-stdout>([\s\S]*)<\/local-command-stdout>\s*$/u;
57433
- function isLocalCommandRecord(text2) {
57434
- return localCommandRecordPattern.test(text2);
57555
+ function isLocalCommandRecord(text3) {
57556
+ return localCommandRecordPattern.test(text3);
57435
57557
  }
57436
- function isTaskNotificationRecord(text2) {
57437
- return taskNotificationRecordPattern.test(text2);
57558
+ function isTaskNotificationRecord(text3) {
57559
+ return taskNotificationRecordPattern.test(text3);
57438
57560
  }
57439
- function isControlCommandEnvelope(text2) {
57440
- return commandEnvelopePattern.test(text2) && controlCommandNamePattern.test(text2);
57561
+ function isControlCommandEnvelope(text3) {
57562
+ return commandEnvelopePattern.test(text3) && controlCommandNamePattern.test(text3);
57441
57563
  }
57442
- function isNamedCommandEnvelope(text2, namePattern) {
57443
- return commandEnvelopePattern.test(text2) && namePattern.test(text2);
57564
+ function isNamedCommandEnvelope(text3, namePattern) {
57565
+ return commandEnvelopePattern.test(text3) && namePattern.test(text3);
57444
57566
  }
57445
- function displayedUserText(text2) {
57446
- if (isNamedCommandEnvelope(text2, initCommandNamePattern))
57567
+ function displayedUserText(text3) {
57568
+ if (isNamedCommandEnvelope(text3, initCommandNamePattern))
57447
57569
  return "/init";
57448
- if (isNamedCommandEnvelope(text2, recapCommandNamePattern))
57570
+ if (isNamedCommandEnvelope(text3, recapCommandNamePattern))
57449
57571
  return "/recap";
57450
- return text2;
57572
+ return text3;
57451
57573
  }
57452
57574
  var WORKFLOW_TASK_FRAME = "[Workflow harness — computed task]";
57453
57575
  var WORKFLOW_TASK_MARKER = "The computed task text follows:\n";
57454
57576
  var WORKFLOW_REQUEST_FRAME = "[Workflow harness — user request]";
57455
- function workflowTaskText(text2) {
57456
- if (!text2.startsWith(WORKFLOW_TASK_FRAME))
57457
- return text2;
57458
- const marker = text2.indexOf(WORKFLOW_TASK_MARKER);
57577
+ function workflowTaskText(text3) {
57578
+ if (!text3.startsWith(WORKFLOW_TASK_FRAME))
57579
+ return text3;
57580
+ const marker = text3.indexOf(WORKFLOW_TASK_MARKER);
57459
57581
  if (marker < 0)
57460
- return text2;
57461
- const lines = text2.slice(marker + WORKFLOW_TASK_MARKER.length).split("\n");
57582
+ return text3;
57583
+ const lines = text3.slice(marker + WORKFLOW_TASK_MARKER.length).split("\n");
57462
57584
  if (!lines.every((line) => line.trim().length === 0 || line.startsWith(" ")))
57463
- return text2;
57585
+ return text3;
57464
57586
  const task = lines.map((line) => line.slice(2)).join("\n").trim();
57465
- return task.length > 0 ? task : text2;
57587
+ return task.length > 0 ? task : text3;
57466
57588
  }
57467
- function localCommandStdoutText(text2) {
57468
- const match = localCommandStdoutPattern.exec(text2);
57589
+ function localCommandStdoutText(text3) {
57590
+ const match = localCommandStdoutPattern.exec(text3);
57469
57591
  if (!match)
57470
57592
  return null;
57471
57593
  return match[1] ?? "";
@@ -57702,9 +57824,9 @@ function mapClaudeSnapshotWithCheckpointIds(values, sessionId, mcpServers, tasks
57702
57824
  formatVersion: 1
57703
57825
  })
57704
57826
  } : {},
57705
- input: visibleUserTextParts(user).map((text2) => ({
57827
+ input: visibleUserTextParts(user).map((text3) => ({
57706
57828
  type: "text",
57707
- text: displayedUserText(text2)
57829
+ text: displayedUserText(text3)
57708
57830
  })),
57709
57831
  items: turnMessages.flatMap((message) => {
57710
57832
  if (message.type === "steering") {
@@ -57720,7 +57842,7 @@ function mapClaudeSnapshotWithCheckpointIds(values, sessionId, mcpServers, tasks
57720
57842
  ];
57721
57843
  }
57722
57844
  if (message.type === "user") {
57723
- const recapOutput = visibleUserTextParts(user).some((text3) => isNamedCommandEnvelope(text3, recapCommandNamePattern)) ? textParts(message.message.content).map(localCommandStdoutText).find((text3) => text3 !== null && text3.length > 0) : void 0;
57845
+ const recapOutput = visibleUserTextParts(user).some((text4) => isNamedCommandEnvelope(text4, recapCommandNamePattern)) ? textParts(message.message.content).map(localCommandStdoutText).find((text4) => text4 !== null && text4.length > 0) : void 0;
57724
57846
  if (!recapOutput)
57725
57847
  return [];
57726
57848
  return [
@@ -57738,14 +57860,14 @@ function mapClaudeSnapshotWithCheckpointIds(values, sessionId, mcpServers, tasks
57738
57860
  return [];
57739
57861
  const assistantOutcome = outcome.status === "failed" && (!message.failed || message.nested) ? { status: "succeeded" } : itemOutcome(outcome);
57740
57862
  const content = message.message.content;
57741
- const text2 = textParts(content).join("");
57863
+ const text3 = textParts(content).join("");
57742
57864
  if (!Array.isArray(content)) {
57743
- return text2.length > 0 ? [
57865
+ return text3.length > 0 ? [
57744
57866
  {
57745
57867
  item: {
57746
57868
  type: "agentMessage",
57747
57869
  itemId: claudeTranscriptItemId(user.uuid, "agentMessage", agentMessageOrdinal += 1),
57748
- text: text2
57870
+ text: text3
57749
57871
  },
57750
57872
  outcome: assistantOutcome
57751
57873
  }
@@ -57782,12 +57904,12 @@ function mapClaudeSnapshotWithCheckpointIds(values, sessionId, mcpServers, tasks
57782
57904
  }
57783
57905
  continue;
57784
57906
  }
57785
- if (block.type === "text" && !projectedText && text2.length > 0) {
57907
+ if (block.type === "text" && !projectedText && text3.length > 0) {
57786
57908
  items.push({
57787
57909
  item: {
57788
57910
  type: "agentMessage",
57789
57911
  itemId: claudeTranscriptItemId(user.uuid, "agentMessage", agentMessageOrdinal += 1),
57790
- text: text2
57912
+ text: text3
57791
57913
  },
57792
57914
  outcome: assistantOutcome
57793
57915
  });
@@ -57853,8 +57975,8 @@ function mapClaudeSnapshotWithCheckpointIds(values, sessionId, mcpServers, tasks
57853
57975
  }
57854
57976
  return { snapshot: { turns }, turnCheckpointIds };
57855
57977
  }
57856
- function historyToolItem(itemId, toolName, input, output, mcpServers) {
57857
- const argumentsResult = jsonValueSchema.safeParse(input);
57978
+ function historyToolItem(itemId, toolName, input2, output, mcpServers) {
57979
+ const argumentsResult = jsonValueSchema.safeParse(input2);
57858
57980
  const item = claudeToolItem(itemId, toolName, argumentsResult.success ? argumentsResult.data : null, mcpServers);
57859
57981
  return output ? { ...item, output: { content: [{ type: "text", text: output }] } } : item;
57860
57982
  }
@@ -57874,8 +57996,8 @@ function toolResultBlocks(messages) {
57874
57996
  function toolResultOutput(block) {
57875
57997
  if (!block)
57876
57998
  return void 0;
57877
- const text2 = textParts(block.content).join("");
57878
- return text2.length > 0 ? text2 : void 0;
57999
+ const text3 = textParts(block.content).join("");
58000
+ return text3.length > 0 ? text3 : void 0;
57879
58001
  }
57880
58002
  function resultSubagentId(value, block) {
57881
58003
  const nativeResult = value.tool_use_result;
@@ -58013,10 +58135,10 @@ function mapClaudeSubagentSnapshot(values, parentSessionId, nativeSubagentId2, p
58013
58135
  formatVersion: 1
58014
58136
  })
58015
58137
  } : {},
58016
- input: user ? visibleUserTextParts(user).map((text2) => ({
58138
+ input: user ? visibleUserTextParts(user).map((text3) => ({
58017
58139
  type: "text",
58018
- text: turns.length === 0 ? workflowTaskText(text2) : text2
58019
- })) : turns.length === 0 ? [subagentPrompt2(parentValues, nativeSubagentId2)].filter((text2) => text2 !== void 0).map((text2) => ({ type: "text", text: text2 })) : [],
58140
+ text: turns.length === 0 ? workflowTaskText(text3) : text3
58141
+ })) : turns.length === 0 ? [subagentPrompt2(parentValues, nativeSubagentId2)].filter((text3) => text3 !== void 0).map((text3) => ({ type: "text", text: text3 })) : [],
58020
58142
  items,
58021
58143
  outcome
58022
58144
  });
@@ -58076,10 +58198,10 @@ async function readHistory(dependencies, cwd, sessionId) {
58076
58198
  };
58077
58199
  }
58078
58200
  }
58079
- async function forkClaudeSession(input) {
58080
- const sourceRef = nativeSessionRefSchema.safeParse(input.sourceRef);
58081
- const checkpoint = input.kind === "fork" ? nativeCheckpointRefSchema.safeParse(input.checkpoint) : null;
58082
- if (!sourceRef.success || sourceRef.data.harnessId !== input.harnessId || checkpoint && (!checkpoint.success || checkpoint.data.harnessId !== input.harnessId || checkpoint.data.nativeSessionId !== sourceRef.data.nativeSessionId)) {
58201
+ async function forkClaudeSession(input2) {
58202
+ const sourceRef = nativeSessionRefSchema.safeParse(input2.sourceRef);
58203
+ const checkpoint = input2.kind === "fork" ? nativeCheckpointRefSchema.safeParse(input2.checkpoint) : null;
58204
+ if (!sourceRef.success || sourceRef.data.harnessId !== input2.harnessId || checkpoint && (!checkpoint.success || checkpoint.data.harnessId !== input2.harnessId || checkpoint.data.nativeSessionId !== sourceRef.data.nativeSessionId)) {
58083
58205
  return {
58084
58206
  ok: false,
58085
58207
  error: error51("invalidRequest", "Claude Code Fork identity does not belong to the source Session", false)
@@ -58087,7 +58209,7 @@ async function forkClaudeSession(input) {
58087
58209
  }
58088
58210
  let sourceInfo;
58089
58211
  try {
58090
- sourceInfo = await input.dependencies.getSessionInfo({
58212
+ sourceInfo = await input2.dependencies.getSessionInfo({
58091
58213
  sessionId: sourceRef.data.nativeSessionId
58092
58214
  });
58093
58215
  } catch {
@@ -58108,29 +58230,29 @@ async function forkClaudeSession(input) {
58108
58230
  error: error51("protocolError", "Claude Code Session working directory is unavailable", false)
58109
58231
  };
58110
58232
  }
58111
- const sourceHistory = await readHistory(input.dependencies, input.cwd, sourceRef.data.nativeSessionId);
58233
+ const sourceHistory = await readHistory(input2.dependencies, input2.cwd, sourceRef.data.nativeSessionId);
58112
58234
  if (!sourceHistory.ok)
58113
58235
  return sourceHistory;
58114
58236
  const source = { ok: true, value: sourceHistory.value.snapshot };
58115
- if (input.kind === "rollbackLastTurn" && source.value.turns.length === 0) {
58237
+ if (input2.kind === "rollbackLastTurn" && source.value.turns.length === 0) {
58116
58238
  return {
58117
58239
  ok: false,
58118
58240
  error: error51("invalidRequest", "Claude Code Session has no Turn to roll back", false)
58119
58241
  };
58120
58242
  }
58121
- if (input.kind === "rollbackLastTurn" && source.value.turns.length === 1) {
58243
+ if (input2.kind === "rollbackLastTurn" && source.value.turns.length === 1) {
58122
58244
  let nativeRef;
58123
58245
  try {
58124
- nativeRef = await input.pendingSessions.create(input.cwd, input.configuration);
58246
+ nativeRef = await input2.pendingSessions.create(input2.cwd, input2.configuration);
58125
58247
  } catch {
58126
58248
  return {
58127
58249
  ok: false,
58128
58250
  error: error51("nativeFailure", "Claude Code empty rollback could not be persisted", true)
58129
58251
  };
58130
58252
  }
58131
- const sourceAfter2 = await readSnapshot(input.dependencies, input.cwd, sourceRef.data.nativeSessionId);
58253
+ const sourceAfter2 = await readSnapshot(input2.dependencies, input2.cwd, sourceRef.data.nativeSessionId);
58132
58254
  if (!sourceAfter2.ok || !isDeepStrictEqual(sourceAfter2.value, source.value)) {
58133
- await input.pendingSessions.discard(nativeRef, input.cwd).catch(() => void 0);
58255
+ await input2.pendingSessions.discard(nativeRef, input2.cwd).catch(() => void 0);
58134
58256
  return {
58135
58257
  ok: false,
58136
58258
  error: error51("protocolError", "Claude Code source history changed during rollback", false)
@@ -58141,14 +58263,14 @@ async function forkClaudeSession(input) {
58141
58263
  value: { sessionId: nativeRef.nativeSessionId, nativeRef, openMode: "create" }
58142
58264
  };
58143
58265
  }
58144
- const boundaryIndex = input.kind === "rollbackLastTurn" ? source.value.turns.length - 2 : (
58266
+ const boundaryIndex = input2.kind === "rollbackLastTurn" ? source.value.turns.length - 2 : (
58145
58267
  // A live checkpoint names the last root Assistant record seen while the Turn ran;
58146
58268
  // the persisted Turn checkpoint can be a later root tool_result of the same Turn.
58147
58269
  // Fork at that Turn's final checkpoint so the native prefix keeps the whole Turn.
58148
58270
  sourceHistory.value.turnCheckpointIds.findIndex((ids, index) => checkpoint?.success && source.value.turns[index]?.checkpoint !== void 0 && ids.some((id3) => matchesClaudeCheckpointId(id3, checkpoint.data.checkpointId)))
58149
58271
  );
58150
58272
  const retained = source.value.turns[boundaryIndex];
58151
- const boundaryId = retained?.checkpoint?.checkpointId ?? (input.kind === "rollbackLastTurn" ? retained?.nativeTurnRef.nativeTurnKey : void 0);
58273
+ const boundaryId = retained?.checkpoint?.checkpointId ?? (input2.kind === "rollbackLastTurn" ? retained?.nativeTurnRef.nativeTurnKey : void 0);
58152
58274
  if (boundaryIndex < 0 || !boundaryId) {
58153
58275
  return {
58154
58276
  ok: false,
@@ -58157,13 +58279,13 @@ async function forkClaudeSession(input) {
58157
58279
  }
58158
58280
  let derivedSessionId;
58159
58281
  try {
58160
- const forked = await input.dependencies.forkSession({
58282
+ const forked = await input2.dependencies.forkSession({
58161
58283
  checkpointId: boundaryId,
58162
- cwd: input.cwd,
58284
+ cwd: input2.cwd,
58163
58285
  sourceSessionId: sourceRef.data.nativeSessionId
58164
58286
  });
58165
58287
  const derivedRef = nativeSessionRefSchema.safeParse({
58166
- harnessId: input.harnessId,
58288
+ harnessId: input2.harnessId,
58167
58289
  nativeSessionId: forked.sessionId,
58168
58290
  formatVersion: 1
58169
58291
  });
@@ -58178,11 +58300,11 @@ async function forkClaudeSession(input) {
58178
58300
  };
58179
58301
  }
58180
58302
  const cleanup = async () => {
58181
- await input.dependencies.deleteSession({ cwd: input.cwd, sessionId: derivedSessionId }).catch(() => void 0);
58303
+ await input2.dependencies.deleteSession({ cwd: input2.cwd, sessionId: derivedSessionId }).catch(() => void 0);
58182
58304
  };
58183
58305
  const [derived, sourceAfter] = await Promise.all([
58184
- readSnapshot(input.dependencies, input.cwd, derivedSessionId),
58185
- readSnapshot(input.dependencies, input.cwd, sourceRef.data.nativeSessionId)
58306
+ readSnapshot(input2.dependencies, input2.cwd, derivedSessionId),
58307
+ readSnapshot(input2.dependencies, input2.cwd, sourceRef.data.nativeSessionId)
58186
58308
  ]);
58187
58309
  if (!derived.ok) {
58188
58310
  await cleanup();
@@ -58197,7 +58319,7 @@ async function forkClaudeSession(input) {
58197
58319
  const derivedContent = derived.value.turns.map(comparableTurn);
58198
58320
  const sourceIds = nativeIds(source.value);
58199
58321
  const derivedIds = nativeIds(derived.value);
58200
- if (input.kind === "rollbackLastTurn" && sourceAfter.value.turns.length !== source.value.turns.length || sourceAfter.value.turns.length < source.value.turns.length || !isDeepStrictEqual(sourceAfter.value.turns.slice(0, source.value.turns.length), source.value.turns) || !isDeepStrictEqual(derivedContent, expectedPrefix) || derivedIds.size === 0 || [...derivedIds].some((id3) => sourceIds.has(id3))) {
58322
+ if (input2.kind === "rollbackLastTurn" && sourceAfter.value.turns.length !== source.value.turns.length || sourceAfter.value.turns.length < source.value.turns.length || !isDeepStrictEqual(sourceAfter.value.turns.slice(0, source.value.turns.length), source.value.turns) || !isDeepStrictEqual(derivedContent, expectedPrefix) || derivedIds.size === 0 || [...derivedIds].some((id3) => sourceIds.has(id3))) {
58201
58323
  await cleanup();
58202
58324
  return {
58203
58325
  ok: false,
@@ -58229,10 +58351,10 @@ async function existingFile(file2) {
58229
58351
  return false;
58230
58352
  }
58231
58353
  }
58232
- async function findClaudeTranscript(input) {
58233
- const projectsDirectory = path12.join(configDirectory(input.environment), "projects");
58234
- const name = `${input.sessionId}.jsonl`;
58235
- const expected = path12.join(projectsDirectory, projectDirectoryName(input.cwd), name);
58354
+ async function findClaudeTranscript(input2) {
58355
+ const projectsDirectory = path12.join(configDirectory(input2.environment), "projects");
58356
+ const name = `${input2.sessionId}.jsonl`;
58357
+ const expected = path12.join(projectsDirectory, projectDirectoryName(input2.cwd), name);
58236
58358
  if (await existingFile(expected))
58237
58359
  return expected;
58238
58360
  let projects;
@@ -58273,8 +58395,8 @@ async function* transcriptLines(transcript) {
58273
58395
  function isRecord11(value) {
58274
58396
  return typeof value === "object" && value !== null && !Array.isArray(value);
58275
58397
  }
58276
- async function readClaudeTranscript(input) {
58277
- const transcript = await findClaudeTranscript(input);
58398
+ async function readClaudeTranscript(input2) {
58399
+ const transcript = await findClaudeTranscript(input2);
58278
58400
  if (!transcript)
58279
58401
  return null;
58280
58402
  const messages = /* @__PURE__ */ new Map();
@@ -58290,7 +58412,7 @@ async function readClaudeTranscript(input) {
58290
58412
  if (!isRecord11(entry) || entry.type !== "user" && entry.type !== "assistant" && entry.type !== "attachment" || typeof entry.uuid !== "string" || entry.type !== "attachment" && !isRecord11(entry.message)) {
58291
58413
  continue;
58292
58414
  }
58293
- messages.set(entry.uuid, { ...entry, session_id: input.sessionId });
58415
+ messages.set(entry.uuid, { ...entry, session_id: input2.sessionId });
58294
58416
  }
58295
58417
  return [...messages.values()];
58296
58418
  }
@@ -58327,8 +58449,8 @@ function remapSameAs(value, copies) {
58327
58449
  }
58328
58450
  return count3;
58329
58451
  }
58330
- async function remapForkedSessionReferences(input) {
58331
- const transcript = await findClaudeTranscript(input);
58452
+ async function remapForkedSessionReferences(input2) {
58453
+ const transcript = await findClaudeTranscript(input2);
58332
58454
  if (!transcript)
58333
58455
  return 0;
58334
58456
  const contents = await readFile5(transcript, "utf8");
@@ -58370,6 +58492,7 @@ async function remapForkedSessionReferences(input) {
58370
58492
  }
58371
58493
 
58372
58494
  // dist/model-catalog.js
58495
+ import { Buffer as Buffer3 } from "node:buffer";
58373
58496
  import { readFile as readFile6 } from "node:fs/promises";
58374
58497
  import os7 from "node:os";
58375
58498
  import path13 from "node:path";
@@ -58449,6 +58572,7 @@ function claudeThinkingFlagSettings(next, previous) {
58449
58572
  }
58450
58573
 
58451
58574
  // dist/model-catalog.js
58575
+ var LEGACY_MODEL_REF_PREFIX = "claude-model-v1.";
58452
58576
  var modelInfoSchema = external_exports.object({
58453
58577
  value: harnessModelRefSchema.shape.id,
58454
58578
  displayName: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH),
@@ -58480,7 +58604,28 @@ function claudeModelValue(ref) {
58480
58604
  return id3 === "default" ? void 0 : id3;
58481
58605
  }
58482
58606
  function normalizeStoredClaudeModelRef(ref, catalog) {
58483
- return normalizeLegacyBase64ModelRef(ref, catalog, "claude-model-v1.");
58607
+ if (catalogModelForRef(catalog, ref))
58608
+ return ref;
58609
+ if (ref.serviceTier)
58610
+ return void 0;
58611
+ const legacy2 = normalizeLegacyBase64ModelRef(ref, catalog, LEGACY_MODEL_REF_PREFIX);
58612
+ if (legacy2)
58613
+ return legacy2;
58614
+ let id3 = ref.id;
58615
+ if (id3.startsWith(LEGACY_MODEL_REF_PREFIX)) {
58616
+ const encoded = id3.slice(LEGACY_MODEL_REF_PREFIX.length);
58617
+ id3 = Buffer3.from(encoded, "base64url").toString("utf8");
58618
+ if (Buffer3.from(id3).toString("base64url") !== encoded)
58619
+ return void 0;
58620
+ }
58621
+ const alias = /^(?:claude-)?fable(?: *(\[1m\]))?$/iu.exec(id3);
58622
+ if (!alias)
58623
+ return void 0;
58624
+ const matches = catalog.models.filter(({ ref: ref2 }) => {
58625
+ const fable = /^claude-fable-\d+(?:-\d+)*(?: *(\[1m\]))?$/iu.exec(ref2.id);
58626
+ return !ref2.serviceTier && fable && Boolean(fable[1]) === Boolean(alias[1]);
58627
+ });
58628
+ return matches.length === 1 ? matches[0]?.ref : void 0;
58484
58629
  }
58485
58630
  function resolveClaudeConfigDirectory(environment = process.env) {
58486
58631
  return path13.resolve(environment.CLAUDE_CONFIG_DIR ?? path13.join(os7.homedir(), ".claude"));
@@ -59023,13 +59168,13 @@ function parseContextUsage(value) {
59023
59168
  }
59024
59169
  return { usedTokens, maxTokens, model: model2 };
59025
59170
  }
59026
- function parseQuestions(input) {
59027
- if (!Array.isArray(input.questions) || input.questions.length < 1 || input.questions.length > 4) {
59171
+ function parseQuestions(input2) {
59172
+ if (!Array.isArray(input2.questions) || input2.questions.length < 1 || input2.questions.length > 4) {
59028
59173
  return null;
59029
59174
  }
59030
59175
  const questions = [];
59031
59176
  const questionTexts = /* @__PURE__ */ new Set();
59032
- for (const value of input.questions) {
59177
+ for (const value of input2.questions) {
59033
59178
  if (!isRecord13(value))
59034
59179
  return null;
59035
59180
  const question = value.question;
@@ -59055,8 +59200,8 @@ function parseQuestions(input) {
59055
59200
  function boundedDisplayText(value, maxLength) {
59056
59201
  if (typeof value !== "string")
59057
59202
  return null;
59058
- const text2 = value.trim();
59059
- return text2.length > 0 && text2.length <= maxLength ? text2 : null;
59203
+ const text3 = value.trim();
59204
+ return text3.length > 0 && text3.length <= maxLength ? text3 : null;
59060
59205
  }
59061
59206
  var SESSION_PERMISSION_DESTINATIONS = /* @__PURE__ */ new Set(["session", "cliArg"]);
59062
59207
  var PERSISTENT_PERMISSION_DESTINATIONS = /* @__PURE__ */ new Set([
@@ -59125,10 +59270,10 @@ function denied(toolUseId, message) {
59125
59270
  decisionClassification: "user_reject"
59126
59271
  };
59127
59272
  }
59128
- function allowed(toolUseId, input, suggestions) {
59273
+ function allowed(toolUseId, input2, suggestions) {
59129
59274
  return {
59130
59275
  behavior: "allow",
59131
- updatedInput: input,
59276
+ updatedInput: input2,
59132
59277
  toolUseID: toolUseId,
59133
59278
  decisionClassification: suggestions ? "user_permanent" : "user_temporary",
59134
59279
  ...suggestions ? { updatedPermissions: suggestions } : {}
@@ -59300,7 +59445,7 @@ var ClaudeSdkTransport = class {
59300
59445
  // Claude Code CLI, so project CLAUDE.md and .claude/skills apply.
59301
59446
  permissionMode: this.#permissionMode,
59302
59447
  ...this.#allowDangerouslySkipPermissions ? { allowDangerouslySkipPermissions: true } : {},
59303
- canUseTool: (toolName, input, options) => this.#canUseTool(toolName, input, options),
59448
+ canUseTool: (toolName, input2, options) => this.#canUseTool(toolName, input2, options),
59304
59449
  persistSession: true,
59305
59450
  includePartialMessages: true,
59306
59451
  forwardSubagentText: true,
@@ -59690,7 +59835,7 @@ var ClaudeSdkTransport = class {
59690
59835
  });
59691
59836
  return attempt;
59692
59837
  }
59693
- #canUseTool(toolName, input, options) {
59838
+ #canUseTool(toolName, input2, options) {
59694
59839
  const sink = this.#interactionSink();
59695
59840
  const validToolName = boundedDisplayText(toolName, APPROVAL_TITLE_MAX_LENGTH);
59696
59841
  if (this.#closing || !sink || !validToolName || typeof options.requestId !== "string" || options.requestId.length === 0 || typeof options.toolUseID !== "string" || options.toolUseID.length === 0 || options.signal.aborted || this.#controlRequestIds.has(options.requestId)) {
@@ -59701,13 +59846,13 @@ var ClaudeSdkTransport = class {
59701
59846
  const requestId = `claude-${toolName === "AskUserQuestion" ? "question" : "approval"}-${this.#interactionOrdinal}`;
59702
59847
  let request;
59703
59848
  if (toolName === "AskUserQuestion") {
59704
- const questions = parseQuestions(input);
59849
+ const questions = parseQuestions(input2);
59705
59850
  request = questions ? { type: "question", requestId, questions } : null;
59706
59851
  } else if (toolName === "ExitPlanMode") {
59707
59852
  request = {
59708
59853
  type: "planApproval",
59709
59854
  requestId,
59710
- plan: typeof input.plan === "string" && input.plan.trim().length > 0 ? input.plan : null
59855
+ plan: typeof input2.plan === "string" && input2.plan.trim().length > 0 ? input2.plan : null
59711
59856
  };
59712
59857
  } else {
59713
59858
  request = parseApprovalRequest(requestId, toolName, options, agentId ? this.#workflowAgentLabels.get(agentId) : void 0);
@@ -59719,7 +59864,7 @@ var ClaudeSdkTransport = class {
59719
59864
  const pending = {
59720
59865
  agentScoped: agentId !== void 0,
59721
59866
  controlRequestId: options.requestId,
59722
- input,
59867
+ input: input2,
59723
59868
  request,
59724
59869
  resolve: resolve5,
59725
59870
  signal: options.signal,
@@ -60669,12 +60814,12 @@ var ClaudeBackgroundCommandItems = class {
60669
60814
  await handle.close().catch(() => void 0);
60670
60815
  }
60671
60816
  }
60672
- #append(followed, text2) {
60673
- if (text2.length === 0 || followed.completed)
60817
+ #append(followed, text3) {
60818
+ if (text3.length === 0 || followed.completed)
60674
60819
  return;
60675
60820
  const room = this.#outputLimit - followed.output.length;
60676
- const accepted = text2.length > room ? text2.slice(0, Math.max(0, room)) : text2;
60677
- if (text2.length > room)
60821
+ const accepted = text3.length > room ? text3.slice(0, Math.max(0, room)) : text3;
60822
+ if (text3.length > room)
60678
60823
  followed.truncated = true;
60679
60824
  if (accepted.length === 0)
60680
60825
  return;
@@ -60724,17 +60869,17 @@ function toolFailure(toolName) {
60724
60869
  retryable: false
60725
60870
  };
60726
60871
  }
60727
- function boundedToolOutput(text2, limit) {
60728
- if (!text2 || text2.length === 0)
60872
+ function boundedToolOutput(text3, limit) {
60873
+ if (!text3 || text3.length === 0)
60729
60874
  return void 0;
60730
- const truncated = text2.length > limit;
60875
+ const truncated = text3.length > limit;
60731
60876
  return {
60732
- content: [{ type: "text", text: truncated ? text2.slice(0, limit) : text2 }],
60877
+ content: [{ type: "text", text: truncated ? text3.slice(0, limit) : text3 }],
60733
60878
  ...truncated ? { truncated: true } : {}
60734
60879
  };
60735
60880
  }
60736
60881
  function toolOutputText(output) {
60737
- return output?.content.filter((content) => content.type === "text").map(({ text: text2 }) => text2).join("") ?? "";
60882
+ return output?.content.filter((content) => content.type === "text").map(({ text: text3 }) => text3).join("") ?? "";
60738
60883
  }
60739
60884
  var ClaudeToolLifecycle = class {
60740
60885
  #cwd;
@@ -61013,17 +61158,17 @@ async function imageBlock(file2, steer) {
61013
61158
  await handle.close().catch(() => void 0);
61014
61159
  }
61015
61160
  }
61016
- async function claudeUserContent(text2, { steer = false } = {}) {
61017
- const paths = [...new Set(desktopImageAttachmentPaths(text2))];
61161
+ async function claudeUserContent(text3, { steer = false } = {}) {
61162
+ const paths = [...new Set(desktopImageAttachmentPaths(text3))];
61018
61163
  if (paths.length === 0)
61019
- return text2;
61020
- const content = [{ type: "text", text: text2 }];
61164
+ return text3;
61165
+ const content = [{ type: "text", text: text3 }];
61021
61166
  for (const file2 of paths) {
61022
61167
  const block = await imageBlock(file2, steer);
61023
61168
  if (block)
61024
61169
  content.push(block);
61025
61170
  }
61026
- return content.length > 1 ? content : text2;
61171
+ return content.length > 1 ? content : text3;
61027
61172
  }
61028
61173
 
61029
61174
  // dist/claude-code-adapter.js
@@ -61171,8 +61316,8 @@ function startupFailure(error52) {
61171
61316
  }
61172
61317
  if (error52 instanceof ClaudeUltracodeUnavailableError)
61173
61318
  return claudeUltracodeFailure(error52);
61174
- const text2 = error52 instanceof Error ? error52.message.toLowerCase() : "";
61175
- if (text2.includes("not logged in") || text2.includes("authentication") || text2.includes("api key")) {
61319
+ const text3 = error52 instanceof Error ? error52.message.toLowerCase() : "";
61320
+ if (text3.includes("not logged in") || text3.includes("authentication") || text3.includes("api key")) {
61176
61321
  return {
61177
61322
  code: "authenticationRequired",
61178
61323
  message: "Claude Code authentication is required",
@@ -61405,7 +61550,7 @@ var ClaudeHarnessSession = class {
61405
61550
  this.#latestUsage = this.initialUsage;
61406
61551
  this.#pendingSessions = options.pendingSessions;
61407
61552
  const environment = options.environment;
61408
- this.#createTransport = environment ? (input) => dependencies.createTransport({ ...input, environment }) : dependencies.createTransport;
61553
+ this.#createTransport = environment ? (input2) => dependencies.createTransport({ ...input2, environment }) : dependencies.createTransport;
61409
61554
  this.#bypassPermissionsAvailable = options.bypassPermissionsAvailable;
61410
61555
  this.#randomUUID = dependencies.randomUUID;
61411
61556
  this.#readSessionMessages = dependencies.readSessionMessages;
@@ -61607,8 +61752,8 @@ var ClaudeHarnessSession = class {
61607
61752
  }
61608
61753
  };
61609
61754
  }
61610
- const text2 = command.input.map((input) => input.text).join("\n");
61611
- if (text2.length === 0) {
61755
+ const text3 = command.input.map((input2) => input2.text).join("\n");
61756
+ if (text3.length === 0) {
61612
61757
  return {
61613
61758
  ok: false,
61614
61759
  error: {
@@ -61619,7 +61764,7 @@ var ClaudeHarnessSession = class {
61619
61764
  };
61620
61765
  }
61621
61766
  this.#acceptingTurn = true;
61622
- const content = await claudeUserContent(text2);
61767
+ const content = await claudeUserContent(text3);
61623
61768
  const startingTransport = this.#transport === null;
61624
61769
  let transport;
61625
61770
  try {
@@ -61729,8 +61874,8 @@ var ClaudeHarnessSession = class {
61729
61874
  return { ok: true, value: { turnId: command.turnId } };
61730
61875
  }
61731
61876
  async #steer(command) {
61732
- const text2 = command.input.map((input) => input.text).join("\n");
61733
- if (text2.length === 0) {
61877
+ const text3 = command.input.map((input2) => input2.text).join("\n");
61878
+ if (text3.length === 0) {
61734
61879
  return {
61735
61880
  ok: false,
61736
61881
  error: {
@@ -61740,7 +61885,7 @@ var ClaudeHarnessSession = class {
61740
61885
  }
61741
61886
  };
61742
61887
  }
61743
- const content = await claudeUserContent(text2, { steer: true });
61888
+ const content = await claudeUserContent(text3, { steer: true });
61744
61889
  const active2 = this.#active;
61745
61890
  if (!active2 || active2.command.turnId !== command.turnId) {
61746
61891
  return { ok: false, error: invalidState("Claude Code steer target is not the active Turn") };
@@ -63570,8 +63715,8 @@ var ClaudeCodeAdapter = class {
63570
63715
  });
63571
63716
  usageStatistics;
63572
63717
  subagents = {
63573
- readSnapshot: async (input) => {
63574
- if (input.parent.harnessId !== this.harnessId || input.nativeSubagentId.trim().length === 0) {
63718
+ readSnapshot: async (input2) => {
63719
+ if (input2.parent.harnessId !== this.harnessId || input2.nativeSubagentId.trim().length === 0) {
63575
63720
  return {
63576
63721
  ok: false,
63577
63722
  error: {
@@ -63584,18 +63729,18 @@ var ClaudeCodeAdapter = class {
63584
63729
  try {
63585
63730
  const [messages, parentMessages] = await Promise.all([
63586
63731
  this.#dependencies.readSubagentMessages({
63587
- cwd: input.cwd,
63588
- sessionId: input.parent.nativeSessionId,
63589
- nativeSubagentId: input.nativeSubagentId
63732
+ cwd: input2.cwd,
63733
+ sessionId: input2.parent.nativeSessionId,
63734
+ nativeSubagentId: input2.nativeSubagentId
63590
63735
  }),
63591
63736
  this.#dependencies.readSessionMessages({
63592
- cwd: input.cwd,
63593
- sessionId: input.parent.nativeSessionId
63737
+ cwd: input2.cwd,
63738
+ sessionId: input2.parent.nativeSessionId
63594
63739
  })
63595
63740
  ]);
63596
63741
  return {
63597
63742
  ok: true,
63598
- value: mapClaudeSubagentSnapshot(messages, input.parent.nativeSessionId, input.nativeSubagentId, parentMessages ?? [])
63743
+ value: mapClaudeSubagentSnapshot(messages, input2.parent.nativeSessionId, input2.nativeSubagentId, parentMessages ?? [])
63599
63744
  };
63600
63745
  } catch {
63601
63746
  return {
@@ -63659,16 +63804,16 @@ var ClaudeCodeAdapter = class {
63659
63804
  environment: options.environment ?? process.env
63660
63805
  });
63661
63806
  },
63662
- createInspector: (input) => new ClaudeSdkModelInspector({
63663
- ...input,
63807
+ createInspector: (input2) => new ClaudeSdkModelInspector({
63808
+ ...input2,
63664
63809
  ...options.command ? { command: options.command } : {},
63665
63810
  environment: options.environment ?? process.env,
63666
63811
  closeTimeoutMs: this.#closeTimeoutMs
63667
63812
  }),
63668
- createTransport: (input) => new ClaudeSdkTransport({
63669
- ...input,
63813
+ createTransport: (input2) => new ClaudeSdkTransport({
63814
+ ...input2,
63670
63815
  ...options.command ? { command: options.command } : {},
63671
- environment: input.environment ?? options.environment ?? process.env,
63816
+ environment: input2.environment ?? options.environment ?? process.env,
63672
63817
  closeTimeoutMs: this.#closeTimeoutMs,
63673
63818
  abortTimeoutMs: this.#cancelTimeoutMs
63674
63819
  }),
@@ -63702,16 +63847,16 @@ var ClaudeCodeAdapter = class {
63702
63847
  readSubagentMessages: ({ cwd, sessionId, nativeSubagentId: nativeSubagentId2 }) => z5t(sessionId, nativeSubagentId2, { dir: cwd })
63703
63848
  };
63704
63849
  }
63705
- async inspect(input = {}) {
63850
+ async inspect(input2 = {}) {
63706
63851
  if (this.#closePromise) {
63707
63852
  return {
63708
63853
  status: "unavailable",
63709
63854
  error: invalidState("Claude Code Adapter is closing")
63710
63855
  };
63711
63856
  }
63712
- const cwd = path15.resolve(input.cwd ?? process.cwd());
63857
+ const cwd = path15.resolve(input2.cwd ?? process.cwd());
63713
63858
  const current = this.#inspectionInFlight.get(cwd);
63714
- if (input.refresh) {
63859
+ if (input2.refresh) {
63715
63860
  this.#inspectionCache.clear();
63716
63861
  this.#inspectionInFlight.clear();
63717
63862
  if (current)
@@ -63853,14 +63998,14 @@ var ClaudeCodeAdapter = class {
63853
63998
  }
63854
63999
  }
63855
64000
  }
63856
- async open(input) {
64001
+ async open(input2) {
63857
64002
  if (this.#closePromise) {
63858
64003
  return {
63859
64004
  ok: false,
63860
64005
  error: invalidState("Claude Code Adapter is closing")
63861
64006
  };
63862
64007
  }
63863
- if (input.cwd.length === 0) {
64008
+ if (input2.cwd.length === 0) {
63864
64009
  return {
63865
64010
  ok: false,
63866
64011
  error: {
@@ -63870,7 +64015,7 @@ var ClaudeCodeAdapter = class {
63870
64015
  }
63871
64016
  };
63872
64017
  }
63873
- if (input.kind === "rollbackLastTurn" && [...this.#sessions].some((session2) => session2.blocksRollback(input.sourceRef.nativeSessionId))) {
64018
+ if (input2.kind === "rollbackLastTurn" && [...this.#sessions].some((session2) => session2.blocksRollback(input2.sourceRef.nativeSessionId))) {
63874
64019
  return {
63875
64020
  ok: false,
63876
64021
  error: {
@@ -63881,9 +64026,9 @@ var ClaudeCodeAdapter = class {
63881
64026
  };
63882
64027
  }
63883
64028
  let requestedThinkingOptionId = CLAUDE_DEFAULT_THINKING_OPTION_ID;
63884
- if ((input.kind === "create" || input.kind === "rollbackLastTurn" || input.kind === "resume") && input.thinkingOptionId) {
64029
+ if ((input2.kind === "create" || input2.kind === "rollbackLastTurn" || input2.kind === "resume") && input2.thinkingOptionId) {
63885
64030
  try {
63886
- requestedThinkingOptionId = parseClaudeThinkingOptionId(input.thinkingOptionId);
64031
+ requestedThinkingOptionId = parseClaudeThinkingOptionId(input2.thinkingOptionId);
63887
64032
  } catch {
63888
64033
  return {
63889
64034
  ok: false,
@@ -63895,9 +64040,9 @@ var ClaudeCodeAdapter = class {
63895
64040
  };
63896
64041
  }
63897
64042
  }
63898
- if ((input.kind === "create" || input.kind === "rollbackLastTurn" || input.kind === "resume") && input.model) {
64043
+ if ((input2.kind === "create" || input2.kind === "rollbackLastTurn" || input2.kind === "resume") && input2.model) {
63899
64044
  try {
63900
- claudeModelValue(input.model);
64045
+ claudeModelValue(input2.model);
63901
64046
  } catch {
63902
64047
  return {
63903
64048
  ok: false,
@@ -63909,7 +64054,7 @@ var ClaudeCodeAdapter = class {
63909
64054
  };
63910
64055
  }
63911
64056
  }
63912
- let requestedPermissionModeId = input.kind === "create" ? input.permissionModeId ?? (input.executionPolicy === "unattended-full-access" ? encodeClaudePermissionModeId("auto") : CLAUDE_DEFAULT_PERMISSION_MODE_ID) : input.kind === "rollbackLastTurn" || input.kind === "resume" ? input.permissionModeId ?? CLAUDE_DEFAULT_PERMISSION_MODE_ID : CLAUDE_DEFAULT_PERMISSION_MODE_ID;
64057
+ let requestedPermissionModeId = input2.kind === "create" ? input2.permissionModeId ?? (input2.executionPolicy === "unattended-full-access" ? encodeClaudePermissionModeId("auto") : CLAUDE_DEFAULT_PERMISSION_MODE_ID) : input2.kind === "rollbackLastTurn" || input2.kind === "resume" ? input2.permissionModeId ?? CLAUDE_DEFAULT_PERMISSION_MODE_ID : CLAUDE_DEFAULT_PERMISSION_MODE_ID;
63913
64058
  try {
63914
64059
  decodeClaudePermissionModeId(requestedPermissionModeId);
63915
64060
  } catch {
@@ -63922,10 +64067,10 @@ var ClaudeCodeAdapter = class {
63922
64067
  }
63923
64068
  };
63924
64069
  }
63925
- const environment = input.environment ? { ...this.#environment, ...input.environment } : void 0;
64070
+ const environment = input2.environment ? { ...this.#environment, ...input2.environment } : void 0;
63926
64071
  const bypassPermissionsAvailable = this.#dependencies.bypassPermissionsAvailable(environment);
63927
64072
  if (!bypassPermissionsAvailable && requestedPermissionModeId === "bypassPermissions") {
63928
- if (input.kind === "create") {
64073
+ if (input2.kind === "create") {
63929
64074
  return {
63930
64075
  ok: false,
63931
64076
  error: {
@@ -63937,15 +64082,15 @@ var ClaudeCodeAdapter = class {
63937
64082
  }
63938
64083
  requestedPermissionModeId = CLAUDE_DEFAULT_PERMISSION_MODE_ID;
63939
64084
  }
63940
- const cwd = path15.resolve(input.cwd);
63941
- if (input.kind === "rollbackLastTurn") {
64085
+ const cwd = path15.resolve(input2.cwd);
64086
+ if (input2.kind === "rollbackLastTurn") {
63942
64087
  for (const source of this.#sessions) {
63943
- const ready = await source.prepareRollback(input.sourceRef.nativeSessionId);
64088
+ const ready = await source.prepareRollback(input2.sourceRef.nativeSessionId);
63944
64089
  if (!ready.ok)
63945
64090
  return ready;
63946
64091
  }
63947
64092
  }
63948
- const nativeRef = input.kind === "resume" ? nativeSessionRefSchema.safeParse(input.nativeRef) : null;
64093
+ const nativeRef = input2.kind === "resume" ? nativeSessionRefSchema.safeParse(input2.nativeRef) : null;
63949
64094
  if (nativeRef && (!nativeRef.success || nativeRef.data.harnessId !== this.harnessId)) {
63950
64095
  return {
63951
64096
  ok: false,
@@ -63956,12 +64101,12 @@ var ClaudeCodeAdapter = class {
63956
64101
  }
63957
64102
  };
63958
64103
  }
63959
- const forked = input.kind === "fork" || input.kind === "rollbackLastTurn" ? await forkClaudeSession({
63960
- ...input.kind === "fork" ? { kind: "fork", checkpoint: input.checkpoint } : {
64104
+ const forked = input2.kind === "fork" || input2.kind === "rollbackLastTurn" ? await forkClaudeSession({
64105
+ ...input2.kind === "fork" ? { kind: "fork", checkpoint: input2.checkpoint } : {
63961
64106
  kind: "rollbackLastTurn",
63962
64107
  pendingSessions: this.#pendingSessions,
63963
64108
  configuration: {
63964
- ...input.model ? { effectiveModel: input.model } : {},
64109
+ ...input2.model ? { effectiveModel: input2.model } : {},
63965
64110
  effectiveThinkingOptionId: requestedThinkingOptionId,
63966
64111
  effectivePermissionModeId: requestedPermissionModeId
63967
64112
  }
@@ -63969,13 +64114,13 @@ var ClaudeCodeAdapter = class {
63969
64114
  cwd,
63970
64115
  dependencies: this.#dependencies,
63971
64116
  harnessId: this.harnessId,
63972
- sourceRef: input.sourceRef
64117
+ sourceRef: input2.sourceRef
63973
64118
  }) : null;
63974
64119
  if (forked && !forked.ok)
63975
64120
  return forked;
63976
64121
  const durableRef = forked?.ok ? forked.value.nativeRef : nativeRef?.success ? nativeRef.data : void 0;
63977
- let openMode = forked?.ok && forked.value.openMode === "create" || input.kind === "create" ? "create" : "resume";
63978
- let requestedModel = input.kind !== "fork" ? input.model : void 0;
64122
+ let openMode = forked?.ok && forked.value.openMode === "create" || input2.kind === "create" ? "create" : "resume";
64123
+ let requestedModel = input2.kind !== "fork" ? input2.model : void 0;
63979
64124
  if (durableRef && isPendingClaudeSession(durableRef)) {
63980
64125
  try {
63981
64126
  const pending = await this.#pendingSessions.read(durableRef, cwd);
@@ -63984,7 +64129,7 @@ var ClaudeCodeAdapter = class {
63984
64129
  cwd,
63985
64130
  sessionId: durableRef.nativeSessionId
63986
64131
  });
63987
- if ((messages?.length ?? 0) > 0 || input.kind === "resume" && input.knownTurnRefs?.length)
64132
+ if ((messages?.length ?? 0) > 0 || input2.kind === "resume" && input2.knownTurnRefs?.length)
63988
64133
  throw new Error("Pending Session unexpectedly contains history");
63989
64134
  openMode = "create";
63990
64135
  }
@@ -63996,7 +64141,7 @@ var ClaudeCodeAdapter = class {
63996
64141
  decodeClaudePermissionModeId(pending.configuration.effectivePermissionModeId);
63997
64142
  requestedModel = pending.configuration.effectiveModel ?? requestedModel;
63998
64143
  requestedThinkingOptionId = pending.configuration.effectiveThinkingOptionId ?? requestedThinkingOptionId;
63999
- requestedPermissionModeId = input.kind === "resume" && input.permissionModeId ? requestedPermissionModeId : pending.configuration.effectivePermissionModeId ?? requestedPermissionModeId;
64144
+ requestedPermissionModeId = input2.kind === "resume" && input2.permissionModeId ? requestedPermissionModeId : pending.configuration.effectivePermissionModeId ?? requestedPermissionModeId;
64000
64145
  if (!bypassPermissionsAvailable && requestedPermissionModeId === "bypassPermissions") {
64001
64146
  requestedPermissionModeId = CLAUDE_DEFAULT_PERMISSION_MODE_ID;
64002
64147
  }
@@ -64018,7 +64163,7 @@ var ClaudeCodeAdapter = class {
64018
64163
  bypassPermissionsAvailable,
64019
64164
  openMode,
64020
64165
  pendingSessions: this.#pendingSessions,
64021
- knownConfiguration: input.kind === "rollbackLastTurn" || input.kind === "resume" && Boolean(input.model || input.thinkingOptionId) || Boolean(durableRef && isPendingClaudeSession(durableRef)),
64166
+ knownConfiguration: input2.kind === "rollbackLastTurn" || input2.kind === "resume" && Boolean(input2.model || input2.thinkingOptionId) || Boolean(durableRef && isPendingClaudeSession(durableRef)),
64022
64167
  ...durableRef ? { nativeRef: durableRef } : {},
64023
64168
  sessionId,
64024
64169
  usageHistory,
@@ -64106,12 +64251,12 @@ import { readFile as readFile7, realpath as realpath5 } from "node:fs/promises";
64106
64251
  import { homedir as homedir2 } from "node:os";
64107
64252
  import path16 from "node:path";
64108
64253
  async function readSettings(file2) {
64109
- const text2 = await readFile7(file2, "utf8").catch((error52) => {
64254
+ const text3 = await readFile7(file2, "utf8").catch((error52) => {
64110
64255
  if (error52.code === "ENOENT")
64111
64256
  return "{}";
64112
64257
  throw error52;
64113
64258
  });
64114
- const settings = JSON.parse(text2);
64259
+ const settings = JSON.parse(text3);
64115
64260
  if (!settings || typeof settings !== "object" || Array.isArray(settings))
64116
64261
  throw new Error("Claude update settings are invalid");
64117
64262
  return settings;