zidane-gui 9.1.4 → 9.1.9

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 (73) hide show
  1. package/out/main/index.js +525 -142
  2. package/out/preload/index.mjs +28 -9
  3. package/out/renderer/assets/{43YPWK3Q-BLwohgFu.js → 43YPWK3Q-BVJpf1u1.js} +6 -6
  4. package/out/renderer/assets/{45MVAN6X-DCPmrh2y.js → 45MVAN6X-BWuIeWOc.js} +5 -5
  5. package/out/renderer/assets/{46GJKBLZ-n_NiMQEY.js → 46GJKBLZ-41BAHmt4.js} +10 -10
  6. package/out/renderer/assets/{63WH7YNF-B0-gnOSz.js → 63WH7YNF-DuatnhlB.js} +8 -8
  7. package/out/renderer/assets/{6DDU7VKX-BKAF5gyQ.js → 6DDU7VKX-BAI-vKC1.js} +6 -6
  8. package/out/renderer/assets/{CLQLV5VT-BIZsXon4.js → CLQLV5VT-CmHu2HE3.js} +6 -6
  9. package/out/renderer/assets/{CUSPXG5M-Donlp74Y.js → CUSPXG5M-DE3uzfbs.js} +6 -6
  10. package/out/renderer/assets/{CodeEditor-80QT2Pyq.js → CodeEditor-CIwCP1F_.js} +3 -3
  11. package/out/renderer/assets/{ComposerEditor-CXpNHoo1.js → ComposerEditor-leA8S_Yk.js} +2 -2
  12. package/out/renderer/assets/{D3L7O4X2-BCbmkNpB.js → D3L7O4X2-BZ4caDcX.js} +4 -4
  13. package/out/renderer/assets/{D5TW5CPZ-Bp-wetYa.js → D5TW5CPZ-BXdKc68h.js} +1 -1
  14. package/out/renderer/assets/{DiffsTab-Dy8a_hwG.js → DiffsTab-CyRIVfQk.js} +5 -5
  15. package/out/renderer/assets/{EGADTWYV-CqSrkc7g.js → EGADTWYV-Bf6Kicdv.js} +5 -5
  16. package/out/renderer/assets/{EOJSJZXM-BTI84tys.js → EOJSJZXM-NAa-K4U0.js} +8 -8
  17. package/out/renderer/assets/{EditorWorkers-Durn1REy.js → EditorWorkers-CY0St-9O.js} +4 -4
  18. package/out/renderer/assets/{FilesTab-h32FFVsw.js → FilesTab-CnRw0KCN.js} +111 -17
  19. package/out/renderer/assets/{G2OEIG6X-CS8YUqSL.js → G2OEIG6X-BarwxCkp.js} +5 -5
  20. package/out/renderer/assets/{GXJ2T77W-BHaQFzB4.js → GXJ2T77W-CyQVHlsG.js} +6 -6
  21. package/out/renderer/assets/{HX3UMAK7-DOOY2pSg.js → HX3UMAK7-BcoG4mYG.js} +5 -5
  22. package/out/renderer/assets/{IU7WZTP6-D7pwhQLH.js → IU7WZTP6-kOLrUSwF.js} +1 -1
  23. package/out/renderer/assets/{J5J2NR2G-SPjkbJgo.js → J5J2NR2G-DE-SGCIz.js} +4 -4
  24. package/out/renderer/assets/{JRCWTJEL-DT7JLR7k.js → JRCWTJEL-DZY5HKk0.js} +3 -3
  25. package/out/renderer/assets/{KHUP5TOH-BX0A2YHC.js → KHUP5TOH-DevvG2jY.js} +1 -1
  26. package/out/renderer/assets/{L74FQTH5-MbDLfIZo.js → L74FQTH5-CnOj-zIY.js} +4 -4
  27. package/out/renderer/assets/{LAV4ZXOS-ClHlsIHg.js → LAV4ZXOS-BATWssHi.js} +6 -6
  28. package/out/renderer/assets/{LBIZYCRR-DmofT7Vk.js → LBIZYCRR-BXTsyX1O.js} +7 -7
  29. package/out/renderer/assets/{LFFXNLRS-yLLLefJM.js → LFFXNLRS-BpnXEoXM.js} +3 -3
  30. package/out/renderer/assets/{LLLWOAQD-DNhT1-qV.js → LLLWOAQD-BjLHR3Pk.js} +1 -1
  31. package/out/renderer/assets/{LTYQZ5U5-BxUtiilS.js → LTYQZ5U5-CDOIyknV.js} +8 -8
  32. package/out/renderer/assets/{NDSCUZ25-DltJ5xGa.js → NDSCUZ25-Bl1idg0d.js} +2 -2
  33. package/out/renderer/assets/{NMN3IKWL-BXUYzi9o.js → NMN3IKWL-BYE2yrn3.js} +9 -9
  34. package/out/renderer/assets/{NMUA3R2D-CAVxt8OJ.js → NMUA3R2D-Xl410xeQ.js} +7 -7
  35. package/out/renderer/assets/{NY5A6PPW-B3P5KUoQ.js → NY5A6PPW-CkzCXBsB.js} +3 -3
  36. package/out/renderer/assets/{OHJ2EJXK-CKyEtj37.js → OHJ2EJXK-DCVoLmOH.js} +1 -1
  37. package/out/renderer/assets/{OU2GIT2H-i9HfUuBk.js → OU2GIT2H-DG4LbVmY.js} +4 -4
  38. package/out/renderer/assets/{PDMLSE6I-BnbSSXbG.js → PDMLSE6I-Cr8MjczD.js} +2 -2
  39. package/out/renderer/assets/{PJ7X32S5-Do_rplzd.js → PJ7X32S5-DFZu5Xsj.js} +5 -5
  40. package/out/renderer/assets/{RLLQ44NJ-SEvjKAya.js → RLLQ44NJ-D-LvBssh.js} +7 -7
  41. package/out/renderer/assets/{S6DWMCK5-CK9P5x9H.js → S6DWMCK5-BQEAXG2z.js} +8 -8
  42. package/out/renderer/assets/{STIOTUT7-KYZS5tvF.js → STIOTUT7-jszPNHGr.js} +6 -6
  43. package/out/renderer/assets/{SXSLPWUD-ylCpsia5.js → SXSLPWUD-CEMEDuKR.js} +2 -2
  44. package/out/renderer/assets/{TR4WJQGX-DXlqK6NQ.js → TR4WJQGX-8wGWCKKm.js} +1 -1
  45. package/out/renderer/assets/{UWRPUF3N-7_KSfEv0.js → UWRPUF3N-ONJaPLUk.js} +1 -1
  46. package/out/renderer/assets/{VSWIZJ7B-qmPn48eQ.js → VSWIZJ7B-DbkRTlJD.js} +1 -1
  47. package/out/renderer/assets/{WM7NR6YK-D4oWq6L3.js → WM7NR6YK-CFy2rge0.js} +4 -4
  48. package/out/renderer/assets/{WXKV2YEK-DsK-bqP8.js → WXKV2YEK-BFHYSpQF.js} +3 -3
  49. package/out/renderer/assets/{XLHPVVFU-4_9lhZe2.js → XLHPVVFU-BJFPh1Rn.js} +1 -1
  50. package/out/renderer/assets/{YNX532HU-C1DPijVc.js → YNX532HU-3QqofRh5.js} +5 -5
  51. package/out/renderer/assets/{YUPSMAUO-0pM5w-ie.js → YUPSMAUO-COLbQro8.js} +1 -1
  52. package/out/renderer/assets/{ZFRCZTLK-4EIJek0V.js → ZFRCZTLK-BuPbgRNC.js} +6 -6
  53. package/out/renderer/assets/{ZZDR4CN3-B_T2R-Zh.js → ZZDR4CN3-Do4onAxu.js} +4 -4
  54. package/out/renderer/assets/{core-2jWUG3m-.js → core-T80gwwf3.js} +2251 -1661
  55. package/out/renderer/assets/{file-tabs-DwqRIh1X.js → file-tabs-DWQZlQfx.js} +5 -5
  56. package/out/renderer/assets/{ghostty-web-DnI2p8KS.js → ghostty-web-DXNGAB4P.js} +1 -1
  57. package/out/renderer/assets/{highlights-6LT5DvBO.js → highlights-B0vcJ7-n.js} +2 -2
  58. package/out/renderer/assets/{highlights-DmxOEap0.js → highlights-Yvd7kpJw.js} +3 -3
  59. package/out/renderer/assets/{index-BnnCv70H.js → index-BbyDWT39.js} +465 -284
  60. package/out/renderer/assets/{index-C-Dal-Bp.css → index-CsOxRbAw.css} +186 -20
  61. package/out/renderer/assets/{kit-CdRTRA2T.js → kit-DgkO1_s6.js} +5641 -1986
  62. package/out/renderer/assets/{langs-D9nZatrh.js → langs-7bXaMxtL.js} +1 -1
  63. package/out/renderer/assets/{lazy-C1DShJVi.js → lazy-DE7xn_YD.js} +3 -3
  64. package/out/renderer/assets/{loader-BlmA-DDi.js → loader-CdKsI-e2.js} +1 -1
  65. package/out/renderer/assets/{pierre-theme-DpuLJ_93.js → pierre-theme-BouAfjrk.js} +7 -7
  66. package/out/renderer/assets/{shiki-RupN-xqP.js → shiki-CIKuDsHH.js} +3 -3
  67. package/out/renderer/assets/{stream-tokenizer-DLDzyMrK.js → stream-tokenizer-JLLsdqkH.js} +1 -1
  68. package/out/renderer/assets/{themes-B1aebwax.js → themes-mM7Qtyxf.js} +2 -2
  69. package/out/renderer/assets/{useDetachCleanup-BXvhEVk-.js → useDetachCleanup-1PVBQ1U4.js} +2 -2
  70. package/out/renderer/assets/{useFolderChanges-BHQktE6l.js → useFolderChanges-_vflCTEj.js} +144 -73
  71. package/out/renderer/index.html +4 -4
  72. package/package.json +2 -2
  73. package/scripts/app-installer.mjs +10 -1
@@ -130,6 +130,7 @@ const SESSION_FIELDS = {
130
130
  "favorite": "boolean",
131
131
  "isMain": "boolean",
132
132
  "spaceId": "string",
133
+ "scheduleId": "string",
133
134
  "providerKey": "string",
134
135
  "modelId": "string",
135
136
  "account": "string",
@@ -138,7 +139,8 @@ const SESSION_FIELDS = {
138
139
  "repoKey": "string",
139
140
  "environment.kind": "string",
140
141
  "environment.state": "string",
141
- "environment.branch": "string"
142
+ "environment.branch": "string",
143
+ "wakes": "string"
142
144
  };
143
145
  const FACET_EXTENSION_ID = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
144
146
  const FACET_KEY = /^[A-Z_][\w-]{0,63}$/i;
@@ -205,7 +207,7 @@ function readField(row, path) {
205
207
  const field = parseFieldPath(path);
206
208
  return field ? readParsedField(row, field) : void 0;
207
209
  }
208
- const UNIT_MS = {
210
+ const UNIT_MS$1 = {
209
211
  s: 1e3,
210
212
  m: 6e4,
211
213
  h: 36e5,
@@ -222,7 +224,7 @@ function resolveTime(bound, now) {
222
224
  if (typeof bound !== "string") return void 0;
223
225
  if (bound === "now") return now;
224
226
  const rel = RELATIVE.exec(bound);
225
- if (rel) return now + (rel[1] === "-" ? -1 : 1) * Number(rel[2]) * UNIT_MS[rel[3]];
227
+ if (rel) return now + (rel[1] === "-" ? -1 : 1) * Number(rel[2]) * UNIT_MS$1[rel[3]];
226
228
  if (!ISO_DATE.test(bound)) return void 0;
227
229
  const zoned = /(?:Z|[+-]\d{2}:\d{2})$/.test(bound);
228
230
  const ms = Date.parse(bound.length === 10 ? `${bound}T00:00:00Z` : zoned ? bound : `${bound}Z`);
@@ -1134,10 +1136,10 @@ function compileQuery(where, options = {}) {
1134
1136
  const issues = validateQuery(where);
1135
1137
  if (issues.length > 0) throw new SessionQueryError(issues);
1136
1138
  const test = build(where);
1137
- const clock = clockOf(options);
1139
+ const clock2 = clockOf(options);
1138
1140
  return (row) => {
1139
1141
  let at;
1140
- return test(row, () => at ??= clock());
1142
+ return test(row, () => at ??= clock2());
1141
1143
  };
1142
1144
  }
1143
1145
  const collator$2 = new Intl.Collator("en", {
@@ -1764,514 +1766,1435 @@ function titleFromText(text) {
1764
1766
  if (!line) return null;
1765
1767
  return line.length > TITLE_FROM_TEXT_MAX ? `${line.slice(0, TITLE_FROM_TEXT_MAX)}…` : line;
1766
1768
  }
1767
- function searchHighlightRanges(text, query) {
1768
- const parsed = parseQuery(query.trim());
1769
- if (parsed.tokens.length === 0) return [];
1770
- const lowerText = lower(text);
1771
- const phrase = findTermRanges(lowerText, parsed.phraseLower);
1772
- if (phrase.length > 0) return mergeRanges(phrase, text.length);
1773
- const exact = parsed.tokens.flatMap((token) => findTermRanges(lowerText, token.lower));
1774
- if (exact.length > 0) return mergeRanges(exact, text.length);
1775
- return mergeRanges(parsed.tokens.flatMap((token) => findFuzzyWordRange(lowerText, token.lower) ?? []), text.length);
1776
- }
1777
- function highlightSegments(text, ranges) {
1778
- const normalized = mergeRanges(ranges, text.length);
1779
- if (!normalized.length) return [{
1780
- text,
1781
- highlighted: false
1782
- }];
1783
- const segments = [];
1784
- let cursor = 0;
1785
- for (const range of normalized) {
1786
- if (range.start > cursor) segments.push({
1787
- text: text.slice(cursor, range.start),
1788
- highlighted: false
1789
- });
1790
- if (range.end > range.start) segments.push({
1791
- text: text.slice(range.start, range.end),
1792
- highlighted: true
1793
- });
1794
- cursor = range.end;
1795
- }
1796
- if (cursor < text.length) segments.push({
1797
- text: text.slice(cursor),
1798
- highlighted: false
1799
- });
1800
- return segments.filter((segment) => segment.text.length > 0);
1801
- }
1802
- function parseQuery(query) {
1803
- const tokens = tokenize(query);
1804
- const phrase = tokens.map((token) => token.text).join(" ");
1805
- return {
1806
- tokens: tokens.map((token) => ({
1807
- ...token,
1808
- lower: lower(token.text)
1809
- })),
1810
- phraseLower: lower(phrase)
1811
- };
1812
- }
1813
- function tokenize(query) {
1814
- const tokens = [];
1815
- let i = 0;
1816
- while (i < query.length) {
1817
- while (i < query.length && /\s/u.test(query[i])) i += 1;
1818
- if (i >= query.length) break;
1819
- if (query[i] === '"') {
1820
- const start2 = i + 1;
1821
- i += 1;
1822
- let value = "";
1823
- while (i < query.length && query[i] !== '"') {
1824
- value += query[i];
1825
- i += 1;
1826
- }
1827
- tokens.push({
1828
- text: value,
1829
- start: start2,
1830
- end: i
1831
- });
1832
- if (query[i] === '"') i += 1;
1833
- continue;
1834
- }
1835
- const start = i;
1836
- while (i < query.length && !/\s/u.test(query[i])) i += 1;
1837
- tokens.push({
1838
- text: query.slice(start, i),
1839
- start,
1840
- end: i
1841
- });
1842
- }
1843
- return tokens.filter((token) => token.text.length > 0);
1844
- }
1845
- function findTermRanges(text, termLower) {
1846
- if (!termLower) return [];
1847
- const ranges = [];
1848
- let from = 0;
1849
- while (from <= text.length) {
1850
- const index = text.indexOf(termLower, from);
1851
- if (index === -1) break;
1852
- ranges.push({
1853
- start: index,
1854
- end: index + termLower.length
1855
- });
1856
- from = index + Math.max(1, termLower.length);
1857
- }
1858
- return ranges;
1769
+ const merged = /* @__PURE__ */ new WeakMap();
1770
+ function isTopPrompt(event) {
1771
+ return event.kind === "user-prompt" && !event.childId && (event.depth ?? 0) === 0;
1859
1772
  }
1860
- function findFuzzyWordRange(text, termLower) {
1861
- if (termLower.length < 4) return null;
1862
- const maxEdits = termLower.length >= 9 ? 2 : 1;
1863
- const words2 = text.matchAll(/[\p{L}\p{N}_-]+/gu);
1864
- let best = null;
1865
- for (const match of words2) {
1866
- const candidate = match[0].toLocaleLowerCase();
1867
- if (Math.abs(candidate.length - termLower.length) > maxEdits) continue;
1868
- const distance = boundedEditDistance(candidate, termLower, maxEdits);
1869
- if (distance === null) continue;
1870
- if (1 - distance / Math.max(candidate.length, termLower.length) < 0.8) continue;
1871
- if (!best || distance < best.distance || distance === best.distance && candidate.length < best.end - best.start) {
1872
- const start = match.index ?? 0;
1873
- best = {
1874
- start,
1875
- end: start + match[0].length,
1876
- distance
1773
+ function gatherCommandNotes(events) {
1774
+ if (!events.some((e) => e.kind === "command-note")) return events;
1775
+ const out = [];
1776
+ let notes = [];
1777
+ const flush = () => {
1778
+ if (notes.length === 0) return;
1779
+ const first = notes[0];
1780
+ const key = notes.map((n) => n.text).join("\0");
1781
+ let event = first;
1782
+ if (notes.length > 1) {
1783
+ const cached = merged.get(first);
1784
+ event = cached?.key === key ? cached.event : {
1785
+ ...first,
1786
+ text: notes.map((n) => n.text).join(", ")
1877
1787
  };
1788
+ merged.set(first, {
1789
+ key,
1790
+ event
1791
+ });
1878
1792
  }
1879
- }
1880
- return best ? [{
1881
- start: best.start,
1882
- end: best.end
1883
- }] : null;
1884
- }
1885
- function boundedEditDistance(left, right, limit) {
1886
- let previous = Array.from({ length: right.length + 1 }, (_, i) => i);
1887
- for (let i = 1; i <= left.length; i++) {
1888
- const current = [i];
1889
- let rowMin = i;
1890
- for (let j = 1; j <= right.length; j++) {
1891
- const value = Math.min(current[j - 1] + 1, previous[j] + 1, previous[j - 1] + (left[i - 1] === right[j - 1] ? 0 : 1));
1892
- current.push(value);
1893
- rowMin = Math.min(rowMin, value);
1894
- }
1895
- if (rowMin > limit) return null;
1896
- previous = current;
1897
- }
1898
- const distance = previous[right.length];
1899
- return distance <= limit ? distance : null;
1900
- }
1901
- function mergeRanges(ranges, max) {
1902
- const sorted = ranges.map((range) => ({
1903
- start: clamp(range.start, 0, max),
1904
- end: clamp(range.end, 0, max)
1905
- })).filter((range) => range.end > range.start).sort((a, b) => a.start - b.start || a.end - b.end);
1906
- const merged2 = [];
1907
- for (const range of sorted) {
1908
- const last = merged2[merged2.length - 1];
1909
- if (!last || range.start > last.end) {
1910
- merged2.push({ ...range });
1793
+ let at = out.length;
1794
+ while (at > 0 && out[at - 1].kind === "separator") at--;
1795
+ out.splice(at, 0, event);
1796
+ notes = [];
1797
+ };
1798
+ for (const event of events) {
1799
+ if (isTopPrompt(event)) flush();
1800
+ if (event.kind === "command-note" && !event.childId) {
1801
+ notes.push(event);
1911
1802
  continue;
1912
1803
  }
1913
- last.end = Math.max(last.end, range.end);
1804
+ out.push(event);
1914
1805
  }
1915
- return merged2;
1916
- }
1917
- function clamp(value, min, max) {
1918
- return Math.min(max, Math.max(min, value));
1806
+ flush();
1807
+ return out.length === events.length && out.every((e, i) => e === events[i]) ? events : out;
1919
1808
  }
1920
- function lower(value) {
1921
- return value.toLocaleLowerCase();
1809
+ const ALWAYS_SHOWN_NESTED_TOOLS = /* @__PURE__ */ new Set(["present_plan", "ask_user"]);
1810
+ function nestedCallShown(call, codemodeShowCalls) {
1811
+ return codemodeShowCalls || call.runsNestedAgent === true || call.tool !== void 0 && ALWAYS_SHOWN_NESTED_TOOLS.has(call.tool);
1922
1812
  }
1923
- const EDIT_TOOL_NAMES = /* @__PURE__ */ new Set([
1924
- "edit",
1925
- "multi_edit",
1926
- "write_file"
1927
- ]);
1928
- function isEditErrorResult(text) {
1929
- if (text.startsWith("Edit error:")) return true;
1930
- if (text.startsWith("Tool failed:")) return true;
1931
- if (text.startsWith("multi_edit error:")) return true;
1932
- if (text.startsWith("[fully denied]")) return true;
1933
- if (text.includes("\n<edit-outcomes>\n") || text.startsWith("<edit-outcomes>\n")) return true;
1813
+ const ESC = 27;
1814
+ const TEXT$1 = 0;
1815
+ const AFTER_ESC = 1;
1816
+ const CSI = 2;
1817
+ const STRING = 3;
1818
+ const STRING_ESC = 4;
1819
+ function hasAnsi(text) {
1820
+ for (let i = 0; i < text.length; i++) {
1821
+ const code = text.charCodeAt(i);
1822
+ if (code === ESC || code === 155 || code === 157 || code === 13 || code === 8) return true;
1823
+ }
1934
1824
  return false;
1935
1825
  }
1936
- function isUserBashEvent(event) {
1937
- return event.tool === "shell" && event.callId?.startsWith("bash_") === true;
1826
+ function sameStyle(a, b) {
1827
+ if (a === b) return true;
1828
+ if (!a || !b) return false;
1829
+ return a.fg === b.fg && a.bg === b.bg && a.bold === b.bold && a.dim === b.dim && a.italic === b.italic && a.underline === b.underline && a.inverse === b.inverse;
1938
1830
  }
1939
- function retagUserPromptEventsFromRefs(events, refs) {
1940
- if (refs.length === 0) return events;
1941
- let changed = false;
1942
- const next = [...events];
1943
- for (const ref of refs) {
1944
- const texts = new Set(ref.texts);
1945
- for (let i = next.length - 1; i >= 0; i--) {
1946
- const e = next[i];
1947
- if (e.kind !== "user-prompt" || e.turnId) continue;
1948
- if (texts.has(e.text) || ref.attachmentOnly && e.text.trim().length === 0 && (e.attachments?.length ?? 0) > 0) {
1949
- next[i] = {
1950
- ...e,
1951
- turnId: ref.id
1952
- };
1953
- changed = true;
1954
- break;
1955
- }
1956
- }
1957
- }
1958
- return changed ? next : events;
1831
+ function hex(n) {
1832
+ return Math.max(0, Math.min(255, n)).toString(16).padStart(2, "0");
1959
1833
  }
1960
- function isCacheNotice(notice) {
1961
- return notice?.label === "cache" || notice?.label === "reasoning";
1834
+ function extendedColor(params, i) {
1835
+ if (params[i] === 5) return [params[i + 1] !== void 0 ? Math.max(0, Math.min(255, params[i + 1])) : void 0, i + 2];
1836
+ if (params[i] === 2) return [`#${hex(params[i + 1] ?? 0)}${hex(params[i + 2] ?? 0)}${hex(params[i + 3] ?? 0)}`, i + 4];
1837
+ return [void 0, i + 1];
1962
1838
  }
1963
- function isVisible(event, settings) {
1964
- if (event.parentToolCallId !== void 0 && !event.runsNestedAgent && !settings.codemodeShowCalls) return false;
1965
- if (settings.hideSubagentOutput) {
1966
- if ((event.depth ?? 0) > 0) return event.kind === "spawn-start" || event.kind === "spawn-end";
1967
- if (event.kind === "tool-result" && event.tool === "spawn") return false;
1968
- }
1969
- if (settings.showEditDiffs && event.kind === "tool-result" && event.tool && EDIT_TOOL_NAMES.has(event.tool) && !isEditErrorResult(event.text)) return false;
1970
- switch (event.kind) {
1971
- case "thinking":
1972
- return settings.showThinking;
1973
- case "tool":
1974
- return settings.toolCallDisplay !== "hidden" || isUserBashEvent(event);
1975
- case "tool-result":
1976
- return settings.showToolResults || isUserBashEvent(event);
1977
- case "run-summary":
1978
- return settings.showRunReceipt;
1979
- case "info":
1980
- return settings.showCacheNotices || !isCacheNotice(event.notice);
1981
- case "spawn-queued":
1982
- return settings.transcriptDensity === "compact";
1983
- case "tool-progress":
1984
- return false;
1985
- default:
1986
- return true;
1839
+ function applySgr(style, raw) {
1840
+ const params = raw === "" ? [0] : raw.split(/[;:]/).map((p) => p === "" ? 0 : Number(p));
1841
+ let next = { ...style };
1842
+ for (let i = 0; i < params.length; i++) {
1843
+ const p = params[i];
1844
+ if (p === 0) next = {};
1845
+ else if (p === 1) next.bold = true;
1846
+ else if (p === 2) next.dim = true;
1847
+ else if (p === 3) next.italic = true;
1848
+ else if (p === 4) next.underline = true;
1849
+ else if (p === 7) next.inverse = true;
1850
+ else if (p === 22) {
1851
+ delete next.bold;
1852
+ delete next.dim;
1853
+ } else if (p === 23) delete next.italic;
1854
+ else if (p === 24) delete next.underline;
1855
+ else if (p === 27) delete next.inverse;
1856
+ else if (p >= 30 && p <= 37) next.fg = p - 30;
1857
+ else if (p >= 90 && p <= 97) next.fg = p - 90 + 8;
1858
+ else if (p === 39) delete next.fg;
1859
+ else if (p >= 40 && p <= 47) next.bg = p - 40;
1860
+ else if (p >= 100 && p <= 107) next.bg = p - 100 + 8;
1861
+ else if (p === 49) delete next.bg;
1862
+ else if (p === 38 || p === 48) {
1863
+ const [color, after] = extendedColor(params, i + 1);
1864
+ if (color !== void 0) {
1865
+ if (p === 38) next.fg = color;
1866
+ else next.bg = color;
1867
+ }
1868
+ i = after - 1;
1869
+ }
1987
1870
  }
1871
+ if (Object.keys(next).length === 0) return void 0;
1872
+ return sameStyle(style, next) ? style : next;
1988
1873
  }
1989
- function turnSelectionOwnership(events) {
1990
- const orderedTurnIds = [];
1991
- const summaryByTurn = /* @__PURE__ */ new Map();
1992
- const callOwner = /* @__PURE__ */ new Map();
1993
- for (const e of events) {
1994
- if (!e.turnId) continue;
1995
- if (e.childId) continue;
1996
- let summary = summaryByTurn.get(e.turnId);
1997
- if (!summary) {
1998
- orderedTurnIds.push(e.turnId);
1999
- summary = {
2000
- kinds: [],
2001
- resultCallIds: []
2002
- };
2003
- summaryByTurn.set(e.turnId, summary);
2004
- }
2005
- summary.kinds.push(e.kind);
2006
- if (e.callId) {
2007
- if (e.kind === "tool") callOwner.set(e.callId, e.turnId);
2008
- else if (e.kind === "tool-result") summary.resultCallIds.push(e.callId);
1874
+ function createAnsiLines() {
1875
+ let state = TEXT$1;
1876
+ let params = "";
1877
+ let style;
1878
+ let line = [];
1879
+ let pendingCr = false;
1880
+ const append = (text) => {
1881
+ if (pendingCr) {
1882
+ line = [];
1883
+ pendingCr = false;
2009
1884
  }
2010
- }
2011
- const ownership = /* @__PURE__ */ new Map();
2012
- let lastToolEmitterTurnId = null;
2013
- for (const tid of orderedTurnIds) {
2014
- const { kinds, resultCallIds } = summaryByTurn.get(tid);
2015
- if (kinds.length > 0 && kinds.every((k) => k === "tool-result")) {
2016
- const exactOwner = resultCallIds.map((callId) => callOwner.get(callId)).find((owner) => owner !== void 0 && owner !== tid);
2017
- if (exactOwner) ownership.set(tid, exactOwner);
2018
- else if (lastToolEmitterTurnId) ownership.set(tid, lastToolEmitterTurnId);
2019
- continue;
1885
+ const last = line[line.length - 1];
1886
+ if (last && sameStyle(last.style, style)) {
1887
+ last.text += text;
1888
+ return;
2020
1889
  }
2021
- if (kinds.includes("tool")) lastToolEmitterTurnId = tid;
2022
- }
2023
- return ownership;
2024
- }
2025
- function selectableTurnIds(events, settings, visible, opts) {
2026
- const ownership = turnSelectionOwnership(events);
2027
- const visibleCount = settings ? /* @__PURE__ */ new Map() : null;
2028
- if (settings && visibleCount) for (const e of events) {
2029
- if (!e.turnId || e.childId) continue;
2030
- if (!isVisible(e, settings)) continue;
2031
- visibleCount.set(e.turnId, (visibleCount.get(e.turnId) ?? 0) + 1);
2032
- }
2033
- const seen2 = /* @__PURE__ */ new Set();
2034
- const ordered = [];
2035
- for (const e of events) {
2036
- if (!e.turnId) continue;
2037
- if (e.childId) continue;
2038
- if (seen2.has(e.turnId)) continue;
2039
- if (ownership.has(e.turnId)) continue;
2040
- if (visibleCount && (visibleCount.get(e.turnId) ?? 0) === 0) continue;
2041
- seen2.add(e.turnId);
2042
- ordered.push(e.turnId);
2043
- }
2044
- return ordered;
2045
- }
2046
- function parseMachineKind(kind) {
2047
- const match = /^(local|worktree)@(.+)$/.exec(kind);
2048
- return match ? {
2049
- base: match[1],
2050
- name: match[2]
2051
- } : null;
2052
- }
2053
- function isValidMachineName(name) {
2054
- return /^[\w.-]{1,64}$/.test(name);
2055
- }
2056
- const FAILED = /(?:^|\n\n)\[✗ Streaming failed (before any output|mid-output)(?:: ([\s\S]*))?\.?\]\s*$/;
2057
- const ABORTED = /(?:^|\n\n)\[⏹ Streaming was aborted\.\]\s*$/;
2058
- function splitStreamFailure(text) {
2059
- const aborted = ABORTED.exec(text);
2060
- if (aborted) {
2061
- const before = text.slice(0, aborted.index).trimEnd();
2062
- return {
2063
- text: before,
2064
- failure: {
2065
- message: "",
2066
- midOutput: before !== "",
2067
- aborted: true
2068
- }
2069
- };
2070
- }
2071
- const m = FAILED.exec(text);
2072
- if (!m) return {
2073
- text,
2074
- failure: null
1890
+ line.push(style ? {
1891
+ text,
1892
+ style
1893
+ } : { text });
2075
1894
  };
2076
- return {
2077
- text: text.slice(0, m.index).trimEnd(),
2078
- failure: {
2079
- message: (m[2] ?? "").trim(),
2080
- midOutput: m[1] === "mid-output",
2081
- aborted: false
2082
- }
1895
+ const backspace = () => {
1896
+ const last = line[line.length - 1];
1897
+ if (!last) return;
1898
+ last.text = last.text.slice(0, -1);
1899
+ if (last.text === "") line.pop();
2083
1900
  };
2084
- }
2085
- function mayHaveStreamFailure(text) {
2086
- return text.includes("[✗ Streaming failed") || text.includes("[⏹ Streaming was aborted");
2087
- }
2088
- const SHELL_FENCE_LANGUAGES = /* @__PURE__ */ new Set([
2089
- "bash",
2090
- "sh",
2091
- "shell",
2092
- "zsh",
2093
- "console"
2094
- ]);
2095
- const PROMPT_LINE = /^\$ /;
2096
- function isShellFence(language) {
2097
- return language !== void 0 && SHELL_FENCE_LANGUAGES.has(language.trim().toLowerCase());
2098
- }
2099
- function shellOf(language) {
2100
- const lang = language.trim().toLowerCase();
2101
- return lang === "zsh" ? "zsh" : lang === "sh" ? "sh" : "bash";
2102
- }
2103
- function shellBlockPlan(code, language) {
2104
- if (!isShellFence(language) || code.length > 65536) return null;
2105
- const lines = code.replace(/\r\n?/g, "\n").split("\n");
2106
- const script = (lines.some((line) => PROMPT_LINE.test(line)) ? lines.filter((line) => PROMPT_LINE.test(line)).map((line) => line.replace(PROMPT_LINE, "")) : lines).join("\n").trim();
2107
- if (script === "") return null;
2108
- const commands = script.split("\n").filter((line) => line.trim() !== "" && !line.trim().startsWith("#"));
2109
- if (commands.length === 0) return null;
2110
1901
  return {
2111
- script,
2112
- shell: shellOf(language),
2113
- oneLine: commands.length === 1 && !commands[0].trimEnd().endsWith("\\")
1902
+ push(chunk) {
1903
+ const done = [];
1904
+ let i = 0;
1905
+ while (i < chunk.length) {
1906
+ const code = chunk.charCodeAt(i);
1907
+ if (state === TEXT$1) {
1908
+ if (code === ESC) state = AFTER_ESC;
1909
+ else if (code === 10) {
1910
+ done.push(line);
1911
+ line = [];
1912
+ pendingCr = false;
1913
+ } else if (code === 13) pendingCr = true;
1914
+ else if (code === 8) backspace();
1915
+ else if (code === 155) {
1916
+ state = CSI;
1917
+ params = "";
1918
+ } else if (code === 157) state = STRING;
1919
+ else if (code === 9 || code >= 32 && !(code >= 127 && code < 160)) {
1920
+ let end = i + 1;
1921
+ while (end < chunk.length) {
1922
+ const c2 = chunk.charCodeAt(end);
1923
+ if (c2 === ESC || c2 === 10 || c2 === 13 || c2 === 8 || c2 < 32 && c2 !== 9 || c2 >= 127 && c2 < 160) break;
1924
+ end++;
1925
+ }
1926
+ append(chunk.slice(i, end));
1927
+ i = end;
1928
+ continue;
1929
+ }
1930
+ } else if (state === AFTER_ESC) {
1931
+ if (code === 91) {
1932
+ state = CSI;
1933
+ params = "";
1934
+ } else if (code === 93 || code === 80 || code === 88 || code === 94 || code === 95) state = STRING;
1935
+ else if (code < 32 || code > 47) state = TEXT$1;
1936
+ } else if (state === CSI) {
1937
+ if (code >= 64 && code <= 126) {
1938
+ if (code === 109) style = applySgr(style, params);
1939
+ state = TEXT$1;
1940
+ } else if (params.length < 64) params += chunk[i];
1941
+ } else if (state === STRING) {
1942
+ if (code === 7 || code === 156) state = TEXT$1;
1943
+ else if (code === ESC) state = STRING_ESC;
1944
+ } else state = code === 92 ? TEXT$1 : STRING;
1945
+ i++;
1946
+ }
1947
+ return done;
1948
+ },
1949
+ partial: () => pendingCr ? [] : line
2114
1950
  };
2115
1951
  }
2116
- function delimiter(script) {
2117
- const lines = new Set(script.split("\n"));
2118
- let name = "ZIDANE_BLOCK";
2119
- for (let n = 1; lines.has(name); n++) name = `ZIDANE_BLOCK_${n}`;
2120
- return name;
2121
- }
2122
- function writeScript(script) {
2123
- const end = delimiter(script);
2124
- return `f=$(mktemp "\${TMPDIR:-/tmp}/zidane-block.XXXXXX") || exit 1
2125
- cat > "$f" <<'${end}'
2126
- ${script}
2127
- ${end}
2128
- `;
1952
+ function parseAnsi(text) {
1953
+ const reader = createAnsiLines();
1954
+ const lines = reader.push(text);
1955
+ lines.push(reader.partial());
1956
+ return lines;
2129
1957
  }
2130
- function blockTerminalInput(plan) {
2131
- if (plan.oneLine) return `${plan.script}
2132
- `;
2133
- return `${writeScript(plan.script).replace(" || exit 1", "")}${plan.shell} "$f"; rm -f "$f"
2134
- `;
1958
+ function ansiLineText(spans) {
1959
+ return spans.map((span) => span.text).join("");
2135
1960
  }
2136
- function hash(text) {
2137
- let h = 2166136261;
2138
- for (let i = 0; i < text.length; i++) {
2139
- h ^= text.charCodeAt(i);
2140
- h = Math.imul(h, 16777619);
2141
- }
2142
- return (h >>> 0).toString(16).padStart(8, "0");
1961
+ function stripAnsi(text) {
1962
+ if (!hasAnsi(text)) return text;
1963
+ return parseAnsi(text).map(ansiLineText).join("\n");
2143
1964
  }
2144
- function blockRunKey(turnId, code) {
2145
- return `${turnId}:${hash(code)}`;
1965
+ function clipAnsiLine(spans, max) {
1966
+ if (ansiLineText(spans).length <= max) return [...spans];
1967
+ const out = [];
1968
+ let room = max - 1;
1969
+ for (const span of spans) {
1970
+ if (room <= 0) break;
1971
+ const text = span.text.slice(0, room);
1972
+ out.push(span.style ? {
1973
+ text,
1974
+ style: span.style
1975
+ } : { text });
1976
+ room -= text.length;
1977
+ }
1978
+ out.push({ text: "…" });
1979
+ return out;
2146
1980
  }
2147
- const TERMINAL_HISTORY_MAX_CHARS = 4194304;
2148
- const TERMINAL_VIEW_SCROLLBACK = 5e3;
2149
- const TERMINAL_VIEW_MAX_LINES = 6e3;
2150
- const TRACKED_MODES = /* @__PURE__ */ new Set([
2151
- 1,
2152
- 7,
2153
- 9,
2154
- 12,
2155
- 25,
2156
- 47,
2157
- 1e3,
2158
- 1002,
2159
- 1003,
2160
- 1004,
2161
- 1005,
2162
- 1006,
2163
- 1015,
2164
- 1016,
2165
- 1047,
2166
- 1049,
2167
- 2004
2168
- ]);
2169
- const DEFAULT_ON = /* @__PURE__ */ new Set([7, 25]);
2170
- const ALT_MODES = [
2171
- 47,
2172
- 1047,
2173
- 1049
2174
- ];
2175
- const EMPTY_MODES = {
2176
- modes: /* @__PURE__ */ new Map(),
2177
- keypad: null,
2178
- altAt: null
2179
- };
2180
- const SEQUENCE = /\x1B(?:\[\?([0-9;]*)([hl])|([=>c]))/g;
2181
- const PREFIX = /^(?:\x1B\[\?\d+[hl]|\x1B=)*/;
2182
- const altActive = (modes) => ALT_MODES.some((m) => modes.get(m) === true);
2183
- function scanModes(state, text, base) {
2184
- if (!text.includes("\x1B")) return state;
2185
- let next = state;
2186
- let modes = null;
2187
- SEQUENCE.lastIndex = 0;
2188
- for (let m = SEQUENCE.exec(text); m; m = SEQUENCE.exec(text)) {
2189
- if (m[3] === "c") {
2190
- next = EMPTY_MODES;
2191
- modes = null;
2192
- continue;
2193
- }
2194
- if (m[3]) {
2195
- const keypad = m[3] === "=";
2196
- if (next.keypad !== keypad) next = {
2197
- ...next,
2198
- keypad
2199
- };
2200
- continue;
2201
- }
2202
- const on = m[2] === "h";
2203
- const wasAlt = next.altAt !== null;
2204
- for (const p of m[1].split(";")) {
2205
- const mode = Number(p);
2206
- if (!TRACKED_MODES.has(mode) || next.modes.get(mode) === on) continue;
2207
- if (!modes) {
2208
- modes = new Map(next.modes);
2209
- next = {
2210
- ...next,
2211
- modes
1981
+ function createOutputTail(maxLines, lineChars) {
1982
+ const tail = [];
1983
+ const commands = /* @__PURE__ */ new Map();
1984
+ let nextId = 0;
1985
+ const shape = (spans) => {
1986
+ const clipped = clipAnsiLine(spans, lineChars);
1987
+ const text = ansiLineText(clipped);
1988
+ return clipped.some((span) => span.style) ? {
1989
+ text,
1990
+ spans: clipped
1991
+ } : { text };
1992
+ };
1993
+ const push = (entry) => {
1994
+ tail.push(entry);
1995
+ if (tail.length > maxLines) tail.splice(0, tail.length - maxLines);
1996
+ };
1997
+ return {
1998
+ item(stream, text, line) {
1999
+ const at = line !== void 0 ? { line } : {};
2000
+ for (const spans of createAnsiLines().push(`${text}
2001
+ `)) push({
2002
+ id: nextId++,
2003
+ stream,
2004
+ ...shape(spans),
2005
+ ...at
2006
+ });
2007
+ },
2008
+ chunk(stream, text, line) {
2009
+ const key = `${stream}\0${line ?? ""}`;
2010
+ let command = commands.get(key);
2011
+ if (!command) {
2012
+ command = {
2013
+ reader: createAnsiLines(),
2014
+ stream,
2015
+ ...line !== void 0 ? { line } : {}
2212
2016
  };
2017
+ commands.set(key, command);
2213
2018
  }
2214
- modes.set(mode, on);
2019
+ const at = line !== void 0 ? { line } : {};
2020
+ for (const spans of command.reader.push(text)) {
2021
+ push({
2022
+ id: command.openId ?? nextId++,
2023
+ stream,
2024
+ ...shape(spans),
2025
+ ...at
2026
+ });
2027
+ command.openId = void 0;
2028
+ }
2029
+ if (command.reader.partial().length > 0 && command.openId === void 0) command.openId = nextId++;
2030
+ },
2031
+ lines() {
2032
+ const open = [...commands.values()].flatMap(({ reader, stream, line, openId }) => {
2033
+ const spans = reader.partial();
2034
+ return spans.length === 0 || openId === void 0 ? [] : [{
2035
+ id: openId,
2036
+ stream,
2037
+ ...shape(spans),
2038
+ ...line !== void 0 ? { line } : {}
2039
+ }];
2040
+ });
2041
+ return [...tail, ...open].slice(-maxLines);
2215
2042
  }
2216
- if (modes && next.modes === modes) {
2217
- const alt = altActive(modes);
2218
- if (alt !== wasAlt) next = {
2219
- ...next,
2220
- altAt: alt ? base + m.index : null
2221
- };
2043
+ };
2044
+ }
2045
+ const SCRIPT_OUTPUT_TAIL_LINES = 8;
2046
+ function upsertToolProgress(events, event) {
2047
+ if (event.kind === "tool-progress") {
2048
+ const at = events.findLastIndex((e) => e.kind === "tool-progress" && e.callId === event.callId && e.childId === event.childId);
2049
+ if (at !== -1) {
2050
+ const next = events.slice();
2051
+ next[at] = event;
2052
+ return next;
2222
2053
  }
2223
2054
  }
2224
- return next;
2055
+ return [...events, event];
2225
2056
  }
2226
- function modePrefix(state) {
2227
- let out = "";
2228
- for (const [mode, on] of state.modes) if (on !== DEFAULT_ON.has(mode)) out += `\x1B[?${mode}${on ? "h" : "l"}`;
2229
- if (state.keypad) out += "\x1B=";
2230
- return out;
2057
+ function scriptProgressByCall(events) {
2058
+ const found = /* @__PURE__ */ new Map();
2059
+ for (const event of events) if (event.kind === "tool-progress" && event.callId && event.scriptProgress) found.set(scriptProgressKey(event.callId, event.childId), event.scriptProgress);
2060
+ return found;
2231
2061
  }
2232
- function modePrefixLength(text) {
2233
- return PREFIX.exec(text)[0].length;
2062
+ function scriptProgressKey(callId, childId) {
2063
+ return `${childId ?? ""}\0${callId}`;
2234
2064
  }
2235
- const CARRY_MAX = 32;
2236
- function sliceEnd(text, from, size) {
2237
- const end = Math.min(text.length, from + Math.max(1, size));
2238
- if (end < text.length && end - from > 1) {
2239
- const code = text.charCodeAt(end - 1);
2240
- if (code >= 55296 && code <= 56319) return end - 1;
2065
+ const OPTIONS_LINE = /^\s*\/\/ @options:(.*)$/;
2066
+ function readOptions(json) {
2067
+ let value;
2068
+ try {
2069
+ value = JSON.parse(json);
2070
+ } catch {
2071
+ return {
2072
+ other: [],
2073
+ raw: json
2074
+ };
2241
2075
  }
2242
- return end;
2243
- }
2244
- function countLines(text) {
2245
- let n = 0;
2246
- for (let i = text.indexOf("\n"); i !== -1; i = text.indexOf("\n", i + 1)) n++;
2247
- return n;
2076
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return {
2077
+ other: [],
2078
+ raw: json
2079
+ };
2080
+ const options = { other: [] };
2081
+ for (const [key, field] of Object.entries(value)) if (key === "timeout_ms" && typeof field === "number") options.timeoutMs = field;
2082
+ else if (key === "max_output_tokens" && typeof field === "number") options.maxOutputTokens = field;
2083
+ else options.other.push({
2084
+ key,
2085
+ value: JSON.stringify(field)
2086
+ });
2087
+ return options;
2248
2088
  }
2249
- var OutputHistory = class {
2250
- maxChars;
2251
- chunks = [];
2252
- head = 0;
2253
- chars = 0;
2254
- lineCount = 0;
2255
- state = EMPTY_MODES;
2256
- carry = "";
2257
- clean = true;
2258
- maxLines;
2259
- /** Stream offset after the last chunk. */
2260
- end = 0;
2261
- /**
2262
- * @param maxChars - Evict the oldest chunks once more characters than this are kept (the newest chunk always stays).
2263
- * @param options - Further caps.
2264
- */
2265
- constructor(maxChars, options = {}) {
2266
- this.maxChars = maxChars;
2267
- this.maxLines = options.maxLines ?? Infinity;
2268
- }
2269
- /** Stream offset of the oldest character kept. */
2270
- get start() {
2271
- return this.head < this.chunks.length ? this.chunks[this.head].at : this.end;
2089
+ function scriptProgressView(code, progress, finished, ok = true, result) {
2090
+ const ended = finished || progress?.ended !== void 0;
2091
+ const endedOk = progress?.ended !== void 0 ? progress.ended === "ok" : ok;
2092
+ const error = ended && !endedOk && result ? scriptErrorOf(result) : void 0;
2093
+ const source = code.split("\n").map((line) => line.replace(/\r$/, ""));
2094
+ const optionsMatch = source[0] !== void 0 ? OPTIONS_LINE.exec(source[0]) : null;
2095
+ const options = optionsMatch ? readOptions(optionsMatch[1].trim()) : void 0;
2096
+ let first = optionsMatch ? 1 : 0;
2097
+ while (first < source.length && source[first].trim() === "") first++;
2098
+ let last = source.length - 1;
2099
+ while (last >= first && source[last].trim() === "") last--;
2100
+ const byLine = new Map(progress?.lines.map((entry) => [entry.line, entry]));
2101
+ const furthest = progress?.lines.length ? progress.lines[progress.lines.length - 1].line : 0;
2102
+ const reached = ended && endedOk ? Number.POSITIVE_INFINITY : furthest;
2103
+ const at = ended ? void 0 : progress?.at;
2104
+ const masked = progress ? maskScriptSource(code).split("\n") : [];
2105
+ const roundsOf = (entry) => Math.ceil(entry.calls / Math.max(1, callSitesIn(masked[entry.line - 1] ?? "")));
2106
+ const loops = progress ? viewLoops(scriptLoops(code), byLine, roundsOf, first + 1, last + 1, at) : [];
2107
+ const loopOf = (line) => loops.findLast((loop) => loop.start <= line && line <= loop.end);
2108
+ const lines = [];
2109
+ for (let i = first; i <= last; i++) {
2110
+ const number = i + 1;
2111
+ const entry = byLine.get(number);
2112
+ const loop = loopOf(number);
2113
+ const behind = loop?.active === true && at !== void 0 && loop.rounds > 1;
2114
+ let state;
2115
+ if (error?.line === number) state = "failed";
2116
+ else if (!progress) state = "passed";
2117
+ else if (entry?.status === "running" || entry?.status === "waiting") state = entry.status;
2118
+ else if (entry) state = behind && (number > at || roundsOf(entry) < loop.rounds) ? "previous" : entry.status === "ok" ? "done" : "failed";
2119
+ else if (behind) state = number <= at ? "passed" : "previous";
2120
+ else state = number <= reached ? "passed" : "idle";
2121
+ lines.push({
2122
+ number,
2123
+ label: number - first,
2124
+ text: source[i],
2125
+ state,
2126
+ calls: entry?.calls ?? 0,
2127
+ ...state === "waiting" && entry?.until !== void 0 ? { until: entry.until } : {}
2128
+ });
2272
2129
  }
2273
- /** Characters kept. */
2274
- get size() {
2130
+ const lastLine = lines.at(-1);
2131
+ if (progress && ended && endedOk && lastLine?.state === "passed") lastLine.state = "done";
2132
+ const done = progress?.done ?? 0;
2133
+ const total = progress ? countOnceCallSites(code) : void 0;
2134
+ const exact = total !== void 0 && done + (progress?.running ?? 0) <= total;
2135
+ const running = progress?.lines.find((entry) => entry.status === "running" || entry.status === "waiting")?.line;
2136
+ return {
2137
+ lines,
2138
+ ...options !== void 0 ? { options } : {},
2139
+ tracked: progress !== void 0,
2140
+ done,
2141
+ running: progress?.running ?? 0,
2142
+ failed: progress?.failed ?? 0,
2143
+ ...exact ? {
2144
+ total,
2145
+ percent: ended && endedOk ? 100 : Math.min(100, Math.round(done / total * 100))
2146
+ } : {},
2147
+ ...!ended && progress ? { active: running ?? at ?? (furthest || void 0) } : {},
2148
+ loops,
2149
+ output: progress?.output ?? [],
2150
+ ...error && lines.some((line) => line.number === error.line) ? { error } : {}
2151
+ };
2152
+ }
2153
+ function viewLoops(found, byLine, roundsOf, first, last, at) {
2154
+ const shown = found.filter((loop) => loop.start >= first && loop.end <= last);
2155
+ const innermost = (line) => shown.findLast((loop) => loop.start <= line && line <= loop.end);
2156
+ const rounds = /* @__PURE__ */ new Map();
2157
+ for (const entry of byLine.values()) {
2158
+ const loop = innermost(entry.line);
2159
+ if (loop) rounds.set(loop, Math.max(rounds.get(loop) ?? 0, roundsOf(entry)));
2160
+ }
2161
+ return shown.map((loop) => ({
2162
+ ...loop,
2163
+ rounds: rounds.get(loop) ?? 0,
2164
+ active: at !== void 0 && loop.start <= at && at <= loop.end,
2165
+ depth: shown.filter((outer) => outer !== loop && outer.start <= loop.start && loop.end <= outer.end).length
2166
+ }));
2167
+ }
2168
+ const SCRIPT_ERROR = /^Script error: (.+)$/m;
2169
+ const EXCERPT_LINE = /^(\d+) \| /m;
2170
+ function scriptErrorOf(result) {
2171
+ const message = SCRIPT_ERROR.exec(result)?.[1]?.trim();
2172
+ const line = EXCERPT_LINE.exec(result)?.[1];
2173
+ return message && line ? {
2174
+ line: Number(line),
2175
+ message
2176
+ } : void 0;
2177
+ }
2178
+ function maskScriptSource(code) {
2179
+ const out = code.split("");
2180
+ const blank = (from, to) => {
2181
+ for (let k = from; k < to; k++) if (out[k] !== "\n") out[k] = " ";
2182
+ };
2183
+ const templates = [];
2184
+ let braces = 0;
2185
+ let prev = "";
2186
+ let i = 0;
2187
+ const n = code.length;
2188
+ const templateText = () => {
2189
+ const start = i;
2190
+ while (i < n) {
2191
+ const c2 = code[i];
2192
+ if (c2 === "\\") {
2193
+ i += 2;
2194
+ continue;
2195
+ }
2196
+ if (c2 === "`") {
2197
+ blank(start, i);
2198
+ i++;
2199
+ prev = "`";
2200
+ return;
2201
+ }
2202
+ if (c2 === "$" && code[i + 1] === "{") {
2203
+ blank(start, i);
2204
+ templates.push(braces);
2205
+ i += 2;
2206
+ prev = "{";
2207
+ return;
2208
+ }
2209
+ i++;
2210
+ }
2211
+ blank(start, n);
2212
+ };
2213
+ while (i < n) {
2214
+ const c2 = code[i];
2215
+ if (c2 === "/" && code[i + 1] === "/") {
2216
+ const end = code.indexOf("\n", i);
2217
+ blank(i, end === -1 ? n : end);
2218
+ i = end === -1 ? n : end;
2219
+ continue;
2220
+ }
2221
+ if (c2 === "/" && code[i + 1] === "*") {
2222
+ const end = code.indexOf("*/", i + 2);
2223
+ blank(i, end === -1 ? n : end + 2);
2224
+ i = end === -1 ? n : end + 2;
2225
+ continue;
2226
+ }
2227
+ if (c2 === '"' || c2 === "'") {
2228
+ let j = i + 1;
2229
+ while (j < n && code[j] !== c2 && code[j] !== "\n") j += code[j] === "\\" ? 2 : 1;
2230
+ blank(i + 1, Math.min(j, n));
2231
+ i = j + 1;
2232
+ prev = c2;
2233
+ continue;
2234
+ }
2235
+ if (c2 === "`") {
2236
+ i++;
2237
+ templateText();
2238
+ continue;
2239
+ }
2240
+ if (c2 === "/" && (prev === "" || "(,=:[!&|?{};+-*%<>~^".includes(prev))) {
2241
+ let j = i + 1;
2242
+ let inClass = false;
2243
+ while (j < n && code[j] !== "\n") {
2244
+ const d = code[j];
2245
+ if (d === "\\") {
2246
+ j += 2;
2247
+ continue;
2248
+ }
2249
+ if (d === "[") inClass = true;
2250
+ else if (d === "]") inClass = false;
2251
+ else if (d === "/" && !inClass) break;
2252
+ j++;
2253
+ }
2254
+ blank(i + 1, Math.min(j, n));
2255
+ i = j + 1;
2256
+ prev = ")";
2257
+ continue;
2258
+ }
2259
+ if (c2 === "{") braces++;
2260
+ else if (c2 === "}") {
2261
+ if (templates.length > 0 && templates[templates.length - 1] === braces) {
2262
+ templates.pop();
2263
+ i++;
2264
+ templateText();
2265
+ continue;
2266
+ }
2267
+ braces--;
2268
+ }
2269
+ if (!/\s/.test(c2)) prev = /[\w$]/.test(c2) ? "w" : c2;
2270
+ i++;
2271
+ }
2272
+ return out.join("");
2273
+ }
2274
+ const TOOL_CALL = /\btools\s*(?:\.\s*[A-Z_$][\w$]*|\[\s*(["'`])\s*\1\s*\])\s*\(/gi;
2275
+ const TOOL_REF = /\btools\b/g;
2276
+ const SH_CALL = /(?<![\w$.])sh\s*\(/g;
2277
+ const SH_REF = /(?<![\w$.])sh\b/g;
2278
+ const WORD = /[\w$]/;
2279
+ const SLEEP_CALL = /(?<![\w$.])sleep\s*\(/g;
2280
+ function callSitesIn(masked) {
2281
+ return (masked.match(TOOL_CALL)?.length ?? 0) + (masked.match(SH_CALL)?.length ?? 0) + (masked.match(SLEEP_CALL)?.length ?? 0);
2282
+ }
2283
+ const CONTINUES = /^(?:[.?:+\-*/%&|^=<>,]|else\b)/;
2284
+ const ITERATORS = /* @__PURE__ */ new Set([
2285
+ "map",
2286
+ "forEach",
2287
+ "flatMap",
2288
+ "filter",
2289
+ "reduce",
2290
+ "reduceRight",
2291
+ "some",
2292
+ "every",
2293
+ "find",
2294
+ "findIndex",
2295
+ "findLast",
2296
+ "findLastIndex"
2297
+ ]);
2298
+ function walkScopes(masked, onWord) {
2299
+ const loops = [];
2300
+ const stack = [];
2301
+ let pending = null;
2302
+ let pendingLoop;
2303
+ let nextParen = null;
2304
+ let nextParenFrom = 0;
2305
+ let fnLoop;
2306
+ let word = null;
2307
+ let last = "";
2308
+ let afterDo = false;
2309
+ const repeating = () => stack.some((scope) => scope.repeats);
2310
+ const pop = (at) => {
2311
+ const scope = stack.pop();
2312
+ if (scope.loop) {
2313
+ loops.push({
2314
+ ...scope.loop,
2315
+ to: at
2316
+ });
2317
+ afterDo = masked.startsWith("do", scope.loop.from);
2318
+ }
2319
+ return scope;
2320
+ };
2321
+ const callbackAt = (at) => {
2322
+ const top = stack[stack.length - 1];
2323
+ return top?.close === ")" && top.callee !== void 0 && ITERATORS.has(top.callee) ? {
2324
+ from: at,
2325
+ kind: "callback"
2326
+ } : void 0;
2327
+ };
2328
+ const push = (scope, loop) => {
2329
+ stack.push(loop ? {
2330
+ ...scope,
2331
+ loop
2332
+ } : scope);
2333
+ };
2334
+ const openBody = () => {
2335
+ if (pending === "loopBody") push({
2336
+ close: "stmt",
2337
+ repeats: true
2338
+ }, pendingLoop);
2339
+ else if (pending === "arrowBody") push({
2340
+ close: "expr",
2341
+ repeats: true
2342
+ }, pendingLoop);
2343
+ pending = null;
2344
+ pendingLoop = void 0;
2345
+ };
2346
+ const closeTo = (close, at) => {
2347
+ while (stack.length > 0) {
2348
+ const scope = pop(at);
2349
+ if (scope.close === close) return scope;
2350
+ }
2351
+ };
2352
+ const popWhile = (closes, at) => {
2353
+ while (stack.length > 0 && closes.includes(stack[stack.length - 1].close)) pop(at);
2354
+ };
2355
+ let i = 0;
2356
+ const n = masked.length;
2357
+ while (i < n) {
2358
+ const c2 = masked[i];
2359
+ if (/\s/.test(c2)) {
2360
+ if (c2 === "\n" && stack[stack.length - 1]?.close === "stmt" && !CONTINUES.test(masked.slice(i + 1).trimStart())) pop(i);
2361
+ i++;
2362
+ continue;
2363
+ }
2364
+ if (WORD.test(c2)) {
2365
+ let j = i;
2366
+ while (j < n && WORD.test(masked[j])) j++;
2367
+ const text = masked.slice(i, j);
2368
+ const doTail = afterDo && text === "while";
2369
+ afterDo = false;
2370
+ openBody();
2371
+ if (onWord?.(i, repeating()) === false) return loops;
2372
+ if (doTail) nextParen = "cond";
2373
+ else if (text === "for" || text === "while") {
2374
+ nextParen = "loop";
2375
+ nextParenFrom = i;
2376
+ } else if (text === "if" || text === "switch" || text === "catch" || text === "with") nextParen = "cond";
2377
+ else if (text === "function") {
2378
+ nextParen = "fn";
2379
+ fnLoop = callbackAt(i);
2380
+ } else if (text === "do") {
2381
+ pending = "loopBody";
2382
+ pendingLoop = {
2383
+ from: i,
2384
+ kind: "loop"
2385
+ };
2386
+ }
2387
+ word = {
2388
+ text,
2389
+ dotted: last === "."
2390
+ };
2391
+ last = "w";
2392
+ i = j;
2393
+ continue;
2394
+ }
2395
+ const callee = word?.dotted ? word.text : void 0;
2396
+ word = null;
2397
+ last = c2;
2398
+ afterDo = false;
2399
+ if (c2 === "=" && masked[i + 1] === ">") {
2400
+ pending = "arrowBody";
2401
+ pendingLoop = callbackAt(i);
2402
+ i += 2;
2403
+ continue;
2404
+ }
2405
+ if (c2 === "{") {
2406
+ push({
2407
+ close: "}",
2408
+ repeats: pending === "loopBody" || pending === "fnBody" || pending === "braceIsFn" || pending === "arrowBody"
2409
+ }, pendingLoop);
2410
+ pending = null;
2411
+ pendingLoop = void 0;
2412
+ i++;
2413
+ continue;
2414
+ }
2415
+ if (c2 === ";") {
2416
+ popWhile(["stmt", "expr"], i);
2417
+ pending = null;
2418
+ pendingLoop = void 0;
2419
+ i++;
2420
+ continue;
2421
+ }
2422
+ if (c2 === ",") {
2423
+ popWhile(["expr"], i);
2424
+ pending = null;
2425
+ pendingLoop = void 0;
2426
+ i++;
2427
+ continue;
2428
+ }
2429
+ if (c2 === ")" || c2 === "]" || c2 === "}") {
2430
+ const scope = closeTo(c2, i);
2431
+ pending = null;
2432
+ pendingLoop = void 0;
2433
+ if (c2 === ")" && scope) {
2434
+ if (scope.kind === "loop") {
2435
+ pending = "loopBody";
2436
+ pendingLoop = {
2437
+ from: scope.from ?? i,
2438
+ kind: "loop"
2439
+ };
2440
+ } else if (scope.kind === "fn") {
2441
+ pending = "fnBody";
2442
+ pendingLoop = scope.fnLoop;
2443
+ } else if (scope.kind === "other") pending = "braceIsFn";
2444
+ }
2445
+ i++;
2446
+ continue;
2447
+ }
2448
+ openBody();
2449
+ if (c2 === "(") {
2450
+ const kind = nextParen ?? "other";
2451
+ stack.push({
2452
+ close: ")",
2453
+ repeats: false,
2454
+ kind,
2455
+ ...kind === "other" && callee !== void 0 ? { callee } : {},
2456
+ ...kind === "loop" ? { from: nextParenFrom } : {},
2457
+ ...kind === "fn" && fnLoop ? { fnLoop } : {}
2458
+ });
2459
+ nextParen = null;
2460
+ fnLoop = void 0;
2461
+ } else if (c2 === "[") stack.push({
2462
+ close: "]",
2463
+ repeats: false
2464
+ });
2465
+ i++;
2466
+ }
2467
+ while (stack.length > 0) pop(n);
2468
+ return loops;
2469
+ }
2470
+ function scriptLoops(code) {
2471
+ const starts = [0];
2472
+ for (let i = 0; i < code.length; i++) if (code[i] === "\n") starts.push(i + 1);
2473
+ const lineAt = (offset) => {
2474
+ let lo = 0;
2475
+ let hi = starts.length - 1;
2476
+ while (lo < hi) {
2477
+ const mid = lo + hi + 1 >> 1;
2478
+ if (starts[mid] <= offset) lo = mid;
2479
+ else hi = mid - 1;
2480
+ }
2481
+ return lo + 1;
2482
+ };
2483
+ return walkScopes(maskScriptSource(code)).map((loop) => ({
2484
+ start: lineAt(loop.from),
2485
+ end: lineAt(Math.max(loop.from, loop.to)),
2486
+ kind: loop.kind
2487
+ })).sort((a, b) => a.start - b.start || b.end - a.end);
2488
+ }
2489
+ function countOnceCallSites(code) {
2490
+ const masked = maskScriptSource(code);
2491
+ const sites = /* @__PURE__ */ new Set();
2492
+ for (const match of masked.matchAll(TOOL_CALL)) sites.add(match.index);
2493
+ if ((masked.match(TOOL_REF)?.length ?? 0) !== sites.size) return void 0;
2494
+ const shCalls = [...masked.matchAll(SH_CALL)];
2495
+ if ((masked.match(SH_REF)?.length ?? 0) !== shCalls.length) return void 0;
2496
+ for (const match of shCalls) sites.add(match.index);
2497
+ if (sites.size === 0) return void 0;
2498
+ let repeated = false;
2499
+ walkScopes(masked, (index, repeating) => {
2500
+ if (sites.has(index) && repeating) {
2501
+ repeated = true;
2502
+ return false;
2503
+ }
2504
+ });
2505
+ return repeated ? void 0 : sites.size;
2506
+ }
2507
+ function searchHighlightRanges(text, query) {
2508
+ const parsed = parseQuery(query.trim());
2509
+ if (parsed.tokens.length === 0) return [];
2510
+ const lowerText = lower(text);
2511
+ const phrase = findTermRanges(lowerText, parsed.phraseLower);
2512
+ if (phrase.length > 0) return mergeRanges(phrase, text.length);
2513
+ const exact = parsed.tokens.flatMap((token) => findTermRanges(lowerText, token.lower));
2514
+ if (exact.length > 0) return mergeRanges(exact, text.length);
2515
+ return mergeRanges(parsed.tokens.flatMap((token) => findFuzzyWordRange(lowerText, token.lower) ?? []), text.length);
2516
+ }
2517
+ function highlightSegments(text, ranges) {
2518
+ const normalized = mergeRanges(ranges, text.length);
2519
+ if (!normalized.length) return [{
2520
+ text,
2521
+ highlighted: false
2522
+ }];
2523
+ const segments = [];
2524
+ let cursor = 0;
2525
+ for (const range of normalized) {
2526
+ if (range.start > cursor) segments.push({
2527
+ text: text.slice(cursor, range.start),
2528
+ highlighted: false
2529
+ });
2530
+ if (range.end > range.start) segments.push({
2531
+ text: text.slice(range.start, range.end),
2532
+ highlighted: true
2533
+ });
2534
+ cursor = range.end;
2535
+ }
2536
+ if (cursor < text.length) segments.push({
2537
+ text: text.slice(cursor),
2538
+ highlighted: false
2539
+ });
2540
+ return segments.filter((segment) => segment.text.length > 0);
2541
+ }
2542
+ function parseQuery(query) {
2543
+ const tokens = tokenize(query);
2544
+ const phrase = tokens.map((token) => token.text).join(" ");
2545
+ return {
2546
+ tokens: tokens.map((token) => ({
2547
+ ...token,
2548
+ lower: lower(token.text)
2549
+ })),
2550
+ phraseLower: lower(phrase)
2551
+ };
2552
+ }
2553
+ function tokenize(query) {
2554
+ const tokens = [];
2555
+ let i = 0;
2556
+ while (i < query.length) {
2557
+ while (i < query.length && /\s/u.test(query[i])) i += 1;
2558
+ if (i >= query.length) break;
2559
+ if (query[i] === '"') {
2560
+ const start2 = i + 1;
2561
+ i += 1;
2562
+ let value = "";
2563
+ while (i < query.length && query[i] !== '"') {
2564
+ value += query[i];
2565
+ i += 1;
2566
+ }
2567
+ tokens.push({
2568
+ text: value,
2569
+ start: start2,
2570
+ end: i
2571
+ });
2572
+ if (query[i] === '"') i += 1;
2573
+ continue;
2574
+ }
2575
+ const start = i;
2576
+ while (i < query.length && !/\s/u.test(query[i])) i += 1;
2577
+ tokens.push({
2578
+ text: query.slice(start, i),
2579
+ start,
2580
+ end: i
2581
+ });
2582
+ }
2583
+ return tokens.filter((token) => token.text.length > 0);
2584
+ }
2585
+ function findTermRanges(text, termLower) {
2586
+ if (!termLower) return [];
2587
+ const ranges = [];
2588
+ let from = 0;
2589
+ while (from <= text.length) {
2590
+ const index = text.indexOf(termLower, from);
2591
+ if (index === -1) break;
2592
+ ranges.push({
2593
+ start: index,
2594
+ end: index + termLower.length
2595
+ });
2596
+ from = index + Math.max(1, termLower.length);
2597
+ }
2598
+ return ranges;
2599
+ }
2600
+ function findFuzzyWordRange(text, termLower) {
2601
+ if (termLower.length < 4) return null;
2602
+ const maxEdits = termLower.length >= 9 ? 2 : 1;
2603
+ const words2 = text.matchAll(/[\p{L}\p{N}_-]+/gu);
2604
+ let best = null;
2605
+ for (const match of words2) {
2606
+ const candidate = match[0].toLocaleLowerCase();
2607
+ if (Math.abs(candidate.length - termLower.length) > maxEdits) continue;
2608
+ const distance = boundedEditDistance(candidate, termLower, maxEdits);
2609
+ if (distance === null) continue;
2610
+ if (1 - distance / Math.max(candidate.length, termLower.length) < 0.8) continue;
2611
+ if (!best || distance < best.distance || distance === best.distance && candidate.length < best.end - best.start) {
2612
+ const start = match.index ?? 0;
2613
+ best = {
2614
+ start,
2615
+ end: start + match[0].length,
2616
+ distance
2617
+ };
2618
+ }
2619
+ }
2620
+ return best ? [{
2621
+ start: best.start,
2622
+ end: best.end
2623
+ }] : null;
2624
+ }
2625
+ function boundedEditDistance(left, right, limit) {
2626
+ let previous = Array.from({ length: right.length + 1 }, (_, i) => i);
2627
+ for (let i = 1; i <= left.length; i++) {
2628
+ const current = [i];
2629
+ let rowMin = i;
2630
+ for (let j = 1; j <= right.length; j++) {
2631
+ const value = Math.min(current[j - 1] + 1, previous[j] + 1, previous[j - 1] + (left[i - 1] === right[j - 1] ? 0 : 1));
2632
+ current.push(value);
2633
+ rowMin = Math.min(rowMin, value);
2634
+ }
2635
+ if (rowMin > limit) return null;
2636
+ previous = current;
2637
+ }
2638
+ const distance = previous[right.length];
2639
+ return distance <= limit ? distance : null;
2640
+ }
2641
+ function mergeRanges(ranges, max) {
2642
+ const sorted = ranges.map((range) => ({
2643
+ start: clamp(range.start, 0, max),
2644
+ end: clamp(range.end, 0, max)
2645
+ })).filter((range) => range.end > range.start).sort((a, b) => a.start - b.start || a.end - b.end);
2646
+ const merged2 = [];
2647
+ for (const range of sorted) {
2648
+ const last = merged2[merged2.length - 1];
2649
+ if (!last || range.start > last.end) {
2650
+ merged2.push({ ...range });
2651
+ continue;
2652
+ }
2653
+ last.end = Math.max(last.end, range.end);
2654
+ }
2655
+ return merged2;
2656
+ }
2657
+ function clamp(value, min, max) {
2658
+ return Math.min(max, Math.max(min, value));
2659
+ }
2660
+ function lower(value) {
2661
+ return value.toLocaleLowerCase();
2662
+ }
2663
+ const EDIT_TOOL_NAMES = /* @__PURE__ */ new Set([
2664
+ "edit",
2665
+ "multi_edit",
2666
+ "write_file"
2667
+ ]);
2668
+ function isEditErrorResult(text) {
2669
+ if (text.startsWith("Edit error:")) return true;
2670
+ if (text.startsWith("Tool failed:")) return true;
2671
+ if (text.startsWith("multi_edit error:")) return true;
2672
+ if (text.startsWith("[fully denied]")) return true;
2673
+ if (text.includes("\n<edit-outcomes>\n") || text.startsWith("<edit-outcomes>\n")) return true;
2674
+ return false;
2675
+ }
2676
+ function isUserBashEvent(event) {
2677
+ return event.tool === "shell" && event.callId?.startsWith("bash_") === true;
2678
+ }
2679
+ function retagUserPromptEventsFromRefs(events, refs) {
2680
+ if (refs.length === 0) return events;
2681
+ let changed = false;
2682
+ const next = [...events];
2683
+ for (const ref of refs) {
2684
+ const texts = new Set(ref.texts);
2685
+ for (let i = next.length - 1; i >= 0; i--) {
2686
+ const e = next[i];
2687
+ if (e.kind !== "user-prompt" || e.turnId) continue;
2688
+ if (texts.has(e.text) || ref.attachmentOnly && e.text.trim().length === 0 && (e.attachments?.length ?? 0) > 0) {
2689
+ next[i] = {
2690
+ ...e,
2691
+ turnId: ref.id
2692
+ };
2693
+ changed = true;
2694
+ break;
2695
+ }
2696
+ }
2697
+ }
2698
+ return changed ? next : events;
2699
+ }
2700
+ function isCacheNotice(notice) {
2701
+ return notice?.label === "cache" || notice?.label === "reasoning";
2702
+ }
2703
+ function isVisible(event, settings) {
2704
+ if (event.parentToolCallId !== void 0 && !nestedCallShown(event, settings.codemodeShowCalls)) return false;
2705
+ if (settings.hideSubagentOutput) {
2706
+ if ((event.depth ?? 0) > 0) return event.kind === "spawn-start" || event.kind === "spawn-end";
2707
+ if (event.kind === "tool-result" && event.tool === "spawn") return false;
2708
+ }
2709
+ if (settings.showEditDiffs && event.kind === "tool-result" && event.tool && EDIT_TOOL_NAMES.has(event.tool) && !isEditErrorResult(event.text)) return false;
2710
+ switch (event.kind) {
2711
+ case "thinking":
2712
+ return settings.showThinking;
2713
+ case "tool":
2714
+ return settings.toolCallDisplay !== "hidden" || isUserBashEvent(event);
2715
+ case "tool-result":
2716
+ return settings.showToolResults || isUserBashEvent(event);
2717
+ case "run-summary":
2718
+ return settings.showRunReceipt;
2719
+ case "info":
2720
+ return settings.showCacheNotices || !isCacheNotice(event.notice);
2721
+ case "spawn-queued":
2722
+ return settings.transcriptDensity === "compact";
2723
+ case "tool-progress":
2724
+ return false;
2725
+ default:
2726
+ return true;
2727
+ }
2728
+ }
2729
+ function turnSelectionOwnership(events) {
2730
+ const orderedTurnIds = [];
2731
+ const summaryByTurn = /* @__PURE__ */ new Map();
2732
+ const callOwner = /* @__PURE__ */ new Map();
2733
+ for (const e of events) {
2734
+ if (!e.turnId) continue;
2735
+ if (e.childId) continue;
2736
+ let summary = summaryByTurn.get(e.turnId);
2737
+ if (!summary) {
2738
+ orderedTurnIds.push(e.turnId);
2739
+ summary = {
2740
+ kinds: [],
2741
+ resultCallIds: []
2742
+ };
2743
+ summaryByTurn.set(e.turnId, summary);
2744
+ }
2745
+ summary.kinds.push(e.kind);
2746
+ if (e.callId) {
2747
+ if (e.kind === "tool") callOwner.set(e.callId, e.turnId);
2748
+ else if (e.kind === "tool-result") summary.resultCallIds.push(e.callId);
2749
+ }
2750
+ }
2751
+ const ownership = /* @__PURE__ */ new Map();
2752
+ let lastToolEmitterTurnId = null;
2753
+ for (const tid of orderedTurnIds) {
2754
+ const { kinds, resultCallIds } = summaryByTurn.get(tid);
2755
+ if (kinds.length > 0 && kinds.every((k) => k === "tool-result")) {
2756
+ const exactOwner = resultCallIds.map((callId) => callOwner.get(callId)).find((owner) => owner !== void 0 && owner !== tid);
2757
+ if (exactOwner) ownership.set(tid, exactOwner);
2758
+ else if (lastToolEmitterTurnId) ownership.set(tid, lastToolEmitterTurnId);
2759
+ continue;
2760
+ }
2761
+ if (kinds.includes("tool")) lastToolEmitterTurnId = tid;
2762
+ }
2763
+ return ownership;
2764
+ }
2765
+ function selectableTurnIds(events, settings, visible, opts) {
2766
+ const ownership = turnSelectionOwnership(events);
2767
+ const visibleCount = settings ? /* @__PURE__ */ new Map() : null;
2768
+ if (settings && visibleCount) for (const e of events) {
2769
+ if (!e.turnId || e.childId) continue;
2770
+ if (!isVisible(e, settings)) continue;
2771
+ visibleCount.set(e.turnId, (visibleCount.get(e.turnId) ?? 0) + 1);
2772
+ }
2773
+ const seen2 = /* @__PURE__ */ new Set();
2774
+ const ordered = [];
2775
+ for (const e of events) {
2776
+ if (!e.turnId) continue;
2777
+ if (e.childId) continue;
2778
+ if (seen2.has(e.turnId)) continue;
2779
+ if (ownership.has(e.turnId)) continue;
2780
+ if (visibleCount && (visibleCount.get(e.turnId) ?? 0) === 0) continue;
2781
+ seen2.add(e.turnId);
2782
+ ordered.push(e.turnId);
2783
+ }
2784
+ return ordered;
2785
+ }
2786
+ function parseMachineKind(kind) {
2787
+ const match = /^(local|worktree)@(.+)$/.exec(kind);
2788
+ return match ? {
2789
+ base: match[1],
2790
+ name: match[2]
2791
+ } : null;
2792
+ }
2793
+ function isValidMachineName(name) {
2794
+ return /^[\w.-]{1,64}$/.test(name);
2795
+ }
2796
+ const FAILED = /(?:^|\n\n)\[✗ Streaming failed (before any output|mid-output)(?:: ([\s\S]*))?\.?\]\s*$/;
2797
+ const ABORTED = /(?:^|\n\n)\[⏹ Streaming was aborted\.\]\s*$/;
2798
+ function splitStreamFailure(text) {
2799
+ const aborted = ABORTED.exec(text);
2800
+ if (aborted) {
2801
+ const before = text.slice(0, aborted.index).trimEnd();
2802
+ return {
2803
+ text: before,
2804
+ failure: {
2805
+ message: "",
2806
+ midOutput: before !== "",
2807
+ aborted: true
2808
+ }
2809
+ };
2810
+ }
2811
+ const m = FAILED.exec(text);
2812
+ if (!m) return {
2813
+ text,
2814
+ failure: null
2815
+ };
2816
+ return {
2817
+ text: text.slice(0, m.index).trimEnd(),
2818
+ failure: {
2819
+ message: (m[2] ?? "").trim(),
2820
+ midOutput: m[1] === "mid-output",
2821
+ aborted: false
2822
+ }
2823
+ };
2824
+ }
2825
+ function mayHaveStreamFailure(text) {
2826
+ return text.includes("[✗ Streaming failed") || text.includes("[⏹ Streaming was aborted");
2827
+ }
2828
+ const UNIT_MS = {
2829
+ m: 6e4,
2830
+ min: 6e4,
2831
+ mins: 6e4,
2832
+ minute: 6e4,
2833
+ minutes: 6e4,
2834
+ h: 36e5,
2835
+ hour: 36e5,
2836
+ hours: 36e5,
2837
+ d: 864e5,
2838
+ day: 864e5,
2839
+ days: 864e5
2840
+ };
2841
+ function localTimeZone() {
2842
+ try {
2843
+ return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
2844
+ } catch {
2845
+ return "UTC";
2846
+ }
2847
+ }
2848
+ const SECOND_MS = {
2849
+ s: 1e3,
2850
+ sec: 1e3,
2851
+ secs: 1e3,
2852
+ second: 1e3,
2853
+ seconds: 1e3
2854
+ };
2855
+ function amount(count, unit, seconds = false) {
2856
+ const key = unit.toLowerCase();
2857
+ const ms = UNIT_MS[key] ?? (seconds ? SECOND_MS[key] : void 0);
2858
+ return ms && Number(count) > 0 ? Number(count) * ms : null;
2859
+ }
2860
+ const WHEN_RULES = [
2861
+ {
2862
+ head: /^in\s+(\d+)\s*([a-z]+)\b/i,
2863
+ trigger: (m, now) => {
2864
+ const ms = amount(m[1], m[2], true);
2865
+ return ms === null ? null : {
2866
+ kind: "at",
2867
+ at: now + ms
2868
+ };
2869
+ }
2870
+ },
2871
+ {
2872
+ head: /^every\s+(\d+)\s*([a-z]+)\b/i,
2873
+ trigger: (m, now) => {
2874
+ const ms = amount(m[1], m[2]);
2875
+ return ms === null ? null : {
2876
+ kind: "every",
2877
+ everyMs: ms,
2878
+ anchor: now
2879
+ };
2880
+ }
2881
+ },
2882
+ {
2883
+ head: /^(?:daily|every\s+day)\s+(?:at\s+)?(\d{1,2})(?::(\d{2}))?\b/i,
2884
+ trigger: (m, _now, tz) => {
2885
+ const time = clock(m[1], m[2]);
2886
+ return time ? {
2887
+ kind: "cron",
2888
+ expr: `${time.minute} ${time.hour} * * *`,
2889
+ tz
2890
+ } : null;
2891
+ }
2892
+ },
2893
+ {
2894
+ head: /^(?:weekdays|every\s+weekday)\s+(?:at\s+)?(\d{1,2})(?::(\d{2}))?\b/i,
2895
+ trigger: (m, _now, tz) => {
2896
+ const time = clock(m[1], m[2]);
2897
+ return time ? {
2898
+ kind: "cron",
2899
+ expr: `${time.minute} ${time.hour} * * 1-5`,
2900
+ tz
2901
+ } : null;
2902
+ }
2903
+ },
2904
+ {
2905
+ head: /^cron\s+"([^"]+)"/i,
2906
+ trigger: (m, _now, tz) => ({
2907
+ kind: "cron",
2908
+ expr: m[1].trim(),
2909
+ tz
2910
+ })
2911
+ },
2912
+ {
2913
+ head: /^tomorrow\s+(?:at\s+)?(\d{1,2})(?::(\d{2}))?\b/i,
2914
+ trigger: (m, now) => {
2915
+ const time = clock(m[1], m[2]);
2916
+ return time ? {
2917
+ kind: "at",
2918
+ at: localTime(now, time, 1)
2919
+ } : null;
2920
+ }
2921
+ },
2922
+ {
2923
+ head: /^at\s+(\d{1,2})(?::(\d{2}))?\b/i,
2924
+ trigger: (m, now) => {
2925
+ const time = clock(m[1], m[2]);
2926
+ if (!time) return null;
2927
+ const today = localTime(now, time, 0);
2928
+ return {
2929
+ kind: "at",
2930
+ at: today > now ? today : localTime(now, time, 1)
2931
+ };
2932
+ }
2933
+ }
2934
+ ];
2935
+ function parseWhen(text, now, tz = localTimeZone()) {
2936
+ const input = text.trim();
2937
+ for (const rule of WHEN_RULES) {
2938
+ const match = rule.head.exec(input);
2939
+ if (!match) continue;
2940
+ const trigger = rule.trigger(match, now, tz);
2941
+ return trigger ? {
2942
+ trigger,
2943
+ rest: input.slice(match[0].length).trim()
2944
+ } : null;
2945
+ }
2946
+ return null;
2947
+ }
2948
+ function clock(hour, minute) {
2949
+ const h = Number(hour);
2950
+ const min = minute === void 0 ? 0 : Number(minute);
2951
+ return h <= 23 && min <= 59 ? {
2952
+ hour: h,
2953
+ minute: min
2954
+ } : null;
2955
+ }
2956
+ function localTime(now, time, dayOffset) {
2957
+ const date = new Date(now);
2958
+ date.setDate(date.getDate() + dayOffset);
2959
+ date.setHours(time.hour, time.minute, 0, 0);
2960
+ return date.getTime();
2961
+ }
2962
+ function describeTrigger(trigger, now, options) {
2963
+ switch (trigger.kind) {
2964
+ case "at":
2965
+ return `once, ${describeTime(trigger.at, now, options)}`;
2966
+ case "every":
2967
+ return `every ${describeDuration(trigger.everyMs)}`;
2968
+ case "cron":
2969
+ return `cron ${trigger.expr} (${trigger.tz})`;
2970
+ }
2971
+ }
2972
+ const pad2 = (n) => String(n).padStart(2, "0");
2973
+ function describeTime(at, now, options) {
2974
+ const date = new Date(at);
2975
+ const hm = `${pad2(date.getHours())}:${pad2(date.getMinutes())}${options?.seconds ? `:${pad2(date.getSeconds())}` : ""}`;
2976
+ const day = (offset) => {
2977
+ const d = new Date(now);
2978
+ d.setDate(d.getDate() + offset);
2979
+ return d.toDateString();
2980
+ };
2981
+ if (date.toDateString() === day(0)) return `today ${hm}`;
2982
+ if (date.toDateString() === day(1)) return `tomorrow ${hm}`;
2983
+ return `${date.toLocaleDateString("en-US", {
2984
+ weekday: "short",
2985
+ day: "numeric",
2986
+ month: "short"
2987
+ })} ${hm}`;
2988
+ }
2989
+ function describeDuration(ms) {
2990
+ const minutes = Math.round(ms / 6e4);
2991
+ const d = Math.floor(minutes / 1440);
2992
+ const h = Math.floor(minutes % 1440 / 60);
2993
+ const m = minutes % 60;
2994
+ return [
2995
+ d ? `${d} d` : "",
2996
+ h ? `${h} h` : "",
2997
+ m ? `${m} min` : ""
2998
+ ].filter(Boolean).join(" ") || "0 min";
2999
+ }
3000
+ const SHELL_FENCE_LANGUAGES = /* @__PURE__ */ new Set([
3001
+ "bash",
3002
+ "sh",
3003
+ "shell",
3004
+ "zsh",
3005
+ "console"
3006
+ ]);
3007
+ const PROMPT_LINE = /^\$ /;
3008
+ function isShellFence(language) {
3009
+ return language !== void 0 && SHELL_FENCE_LANGUAGES.has(language.trim().toLowerCase());
3010
+ }
3011
+ function shellOf(language) {
3012
+ const lang = language.trim().toLowerCase();
3013
+ return lang === "zsh" ? "zsh" : lang === "sh" ? "sh" : "bash";
3014
+ }
3015
+ function promptedLines(lines) {
3016
+ const kept = [];
3017
+ let continued = false;
3018
+ for (const line of lines) {
3019
+ if (PROMPT_LINE.test(line)) kept.push(line.replace(PROMPT_LINE, ""));
3020
+ else if (continued) kept.push(line);
3021
+ else continue;
3022
+ continued = line.trimEnd().endsWith("\\");
3023
+ }
3024
+ return kept;
3025
+ }
3026
+ function shellBlockPlan(code, language) {
3027
+ if (!isShellFence(language) || code.length > 65536) return null;
3028
+ const lines = code.replace(/\r\n?/g, "\n").split("\n");
3029
+ const script = (lines.some((line) => PROMPT_LINE.test(line)) ? promptedLines(lines) : lines).join("\n").trim();
3030
+ if (script === "") return null;
3031
+ const commands = script.split("\n").filter((line) => line.trim() !== "" && !line.trim().startsWith("#"));
3032
+ if (commands.length === 0) return null;
3033
+ return {
3034
+ script,
3035
+ shell: shellOf(language),
3036
+ oneLine: commands.length === 1 && !commands[0].trimEnd().endsWith("\\")
3037
+ };
3038
+ }
3039
+ function delimiter(script) {
3040
+ const lines = new Set(script.split("\n"));
3041
+ let name = "ZIDANE_BLOCK";
3042
+ for (let n = 1; lines.has(name); n++) name = `ZIDANE_BLOCK_${n}`;
3043
+ return name;
3044
+ }
3045
+ function writeScript(script) {
3046
+ const end = delimiter(script);
3047
+ return `f=$(mktemp "\${TMPDIR:-/tmp}/zidane-block.XXXXXX") || exit 1
3048
+ cat > "$f" <<'${end}'
3049
+ ${script}
3050
+ ${end}
3051
+ `;
3052
+ }
3053
+ function blockTerminalInput(plan) {
3054
+ if (plan.oneLine) return `${plan.script}
3055
+ `;
3056
+ return `${writeScript(plan.script).replace(" || exit 1", "")}${plan.shell} "$f"; rm -f "$f"
3057
+ `;
3058
+ }
3059
+ function hash(text) {
3060
+ let h = 2166136261;
3061
+ for (let i = 0; i < text.length; i++) {
3062
+ h ^= text.charCodeAt(i);
3063
+ h = Math.imul(h, 16777619);
3064
+ }
3065
+ return (h >>> 0).toString(16).padStart(8, "0");
3066
+ }
3067
+ function blockRunKey(turnId, code) {
3068
+ return `${turnId}:${hash(code)}`;
3069
+ }
3070
+ const TERMINAL_HISTORY_MAX_CHARS = 4194304;
3071
+ const TERMINAL_VIEW_SCROLLBACK = 5e3;
3072
+ const TERMINAL_VIEW_MAX_LINES = 6e3;
3073
+ const TRACKED_MODES = /* @__PURE__ */ new Set([
3074
+ 1,
3075
+ 7,
3076
+ 9,
3077
+ 12,
3078
+ 25,
3079
+ 47,
3080
+ 1e3,
3081
+ 1002,
3082
+ 1003,
3083
+ 1004,
3084
+ 1005,
3085
+ 1006,
3086
+ 1015,
3087
+ 1016,
3088
+ 1047,
3089
+ 1049,
3090
+ 2004
3091
+ ]);
3092
+ const DEFAULT_ON = /* @__PURE__ */ new Set([7, 25]);
3093
+ const ALT_MODES = [
3094
+ 47,
3095
+ 1047,
3096
+ 1049
3097
+ ];
3098
+ const EMPTY_MODES = {
3099
+ modes: /* @__PURE__ */ new Map(),
3100
+ keypad: null,
3101
+ altAt: null
3102
+ };
3103
+ const SEQUENCE = /\x1B(?:\[\?([0-9;]*)([hl])|([=>c]))/g;
3104
+ const PREFIX = /^(?:\x1B\[\?\d+[hl]|\x1B=)*/;
3105
+ const altActive = (modes) => ALT_MODES.some((m) => modes.get(m) === true);
3106
+ function scanModes(state, text, base) {
3107
+ if (!text.includes("\x1B")) return state;
3108
+ let next = state;
3109
+ let modes = null;
3110
+ SEQUENCE.lastIndex = 0;
3111
+ for (let m = SEQUENCE.exec(text); m; m = SEQUENCE.exec(text)) {
3112
+ if (m[3] === "c") {
3113
+ next = EMPTY_MODES;
3114
+ modes = null;
3115
+ continue;
3116
+ }
3117
+ if (m[3]) {
3118
+ const keypad = m[3] === "=";
3119
+ if (next.keypad !== keypad) next = {
3120
+ ...next,
3121
+ keypad
3122
+ };
3123
+ continue;
3124
+ }
3125
+ const on = m[2] === "h";
3126
+ const wasAlt = next.altAt !== null;
3127
+ for (const p of m[1].split(";")) {
3128
+ const mode = Number(p);
3129
+ if (!TRACKED_MODES.has(mode) || next.modes.get(mode) === on) continue;
3130
+ if (!modes) {
3131
+ modes = new Map(next.modes);
3132
+ next = {
3133
+ ...next,
3134
+ modes
3135
+ };
3136
+ }
3137
+ modes.set(mode, on);
3138
+ }
3139
+ if (modes && next.modes === modes) {
3140
+ const alt = altActive(modes);
3141
+ if (alt !== wasAlt) next = {
3142
+ ...next,
3143
+ altAt: alt ? base + m.index : null
3144
+ };
3145
+ }
3146
+ }
3147
+ return next;
3148
+ }
3149
+ function modePrefix(state) {
3150
+ let out = "";
3151
+ for (const [mode, on] of state.modes) if (on !== DEFAULT_ON.has(mode)) out += `\x1B[?${mode}${on ? "h" : "l"}`;
3152
+ if (state.keypad) out += "\x1B=";
3153
+ return out;
3154
+ }
3155
+ function modePrefixLength(text) {
3156
+ return PREFIX.exec(text)[0].length;
3157
+ }
3158
+ const CARRY_MAX = 32;
3159
+ function sliceEnd(text, from, size) {
3160
+ const end = Math.min(text.length, from + Math.max(1, size));
3161
+ if (end < text.length && end - from > 1) {
3162
+ const code = text.charCodeAt(end - 1);
3163
+ if (code >= 55296 && code <= 56319) return end - 1;
3164
+ }
3165
+ return end;
3166
+ }
3167
+ function countLines(text) {
3168
+ let n = 0;
3169
+ for (let i = text.indexOf("\n"); i !== -1; i = text.indexOf("\n", i + 1)) n++;
3170
+ return n;
3171
+ }
3172
+ var OutputHistory = class {
3173
+ maxChars;
3174
+ chunks = [];
3175
+ head = 0;
3176
+ chars = 0;
3177
+ lineCount = 0;
3178
+ state = EMPTY_MODES;
3179
+ carry = "";
3180
+ clean = true;
3181
+ maxLines;
3182
+ /** Stream offset after the last chunk. */
3183
+ end = 0;
3184
+ /**
3185
+ * @param maxChars - Evict the oldest chunks once more characters than this are kept (the newest chunk always stays).
3186
+ * @param options - Further caps.
3187
+ */
3188
+ constructor(maxChars, options = {}) {
3189
+ this.maxChars = maxChars;
3190
+ this.maxLines = options.maxLines ?? Infinity;
3191
+ }
3192
+ /** Stream offset of the oldest character kept. */
3193
+ get start() {
3194
+ return this.head < this.chunks.length ? this.chunks[this.head].at : this.end;
3195
+ }
3196
+ /** Characters kept. */
3197
+ get size() {
2275
3198
  return this.chars;
2276
3199
  }
2277
3200
  /** Modes in force after everything pushed (an unfinished trailing sequence not yet applied). */
@@ -2576,9 +3499,74 @@ const HOST_TOOLS = [
2576
3499
  name: "ssh",
2577
3500
  label: "ssh",
2578
3501
  icon: "i-ph-terminal",
2579
- why: "git over ssh"
3502
+ why: "git over ssh",
3503
+ versionArgs: ["-V"]
2580
3504
  }
2581
3505
  ];
3506
+ const RIPGREP = "14.1.1";
3507
+ const RIPGREP_TARGETS = {
3508
+ x64: "x86_64-unknown-linux-musl",
3509
+ arm64: "aarch64-unknown-linux-gnu"
3510
+ };
3511
+ const BUN = "curl -fsSL https://bun.sh/install | bash";
3512
+ const BREW = {
3513
+ gh: "gh",
3514
+ glab: "glab",
3515
+ node: "node",
3516
+ python3: "python",
3517
+ rg: "ripgrep",
3518
+ git: "git"
3519
+ };
3520
+ const APT = {
3521
+ git: "git",
3522
+ node: "nodejs",
3523
+ python3: "python3",
3524
+ ssh: "openssh-client",
3525
+ rg: "ripgrep"
3526
+ };
3527
+ const PAGES = {
3528
+ gh: "https://github.com/cli/cli#installation",
3529
+ glab: "https://gitlab.com/gitlab-org/cli#installation",
3530
+ docker: "https://docs.docker.com/engine/install/",
3531
+ node: "https://nodejs.org/en/download",
3532
+ python3: "https://www.python.org/downloads/",
3533
+ rg: "https://github.com/BurntSushi/ripgrep#installation",
3534
+ git: "https://git-scm.com/downloads",
3535
+ ssh: "https://www.openssh.com/portable.html",
3536
+ bun: "https://bun.sh/docs/installation"
3537
+ };
3538
+ function toolInstall(name, capabilities) {
3539
+ if (!HOST_TOOLS.some((tool) => tool.name === name)) return void 0;
3540
+ const { platform, arch } = capabilities.os;
3541
+ const { brew = false, apt = false } = capabilities.installers ?? {};
3542
+ if (name === "bun" && (platform === "linux" || platform === "darwin")) return {
3543
+ kind: "run",
3544
+ command: BUN
3545
+ };
3546
+ if (platform === "darwin" && brew && BREW[name]) return {
3547
+ kind: "run",
3548
+ command: `brew install ${BREW[name]}`
3549
+ };
3550
+ if (platform === "linux" && name === "rg" && RIPGREP_TARGETS[arch]) {
3551
+ const dir = `ripgrep-${RIPGREP}-${RIPGREP_TARGETS[arch]}`;
3552
+ return {
3553
+ kind: "run",
3554
+ command: `mkdir -p "$HOME/.local/bin" && curl -fsSL https://github.com/BurntSushi/ripgrep/releases/download/${RIPGREP}/${dir}.tar.gz | tar -xz -C "$HOME/.local/bin" --strip-components=1 ${dir}/rg`
3555
+ };
3556
+ }
3557
+ if (platform === "linux" && name === "docker") return {
3558
+ kind: "copy",
3559
+ command: "curl -fsSL https://get.docker.com | sudo sh"
3560
+ };
3561
+ if (platform === "linux" && apt && APT[name]) return {
3562
+ kind: "copy",
3563
+ command: `sudo apt-get install -y ${APT[name]}`
3564
+ };
3565
+ return PAGES[name] ? {
3566
+ kind: "link",
3567
+ url: PAGES[name]
3568
+ } : void 0;
3569
+ }
2582
3570
  function hasTool(capabilities, name) {
2583
3571
  return capabilities?.tools.find((tool) => tool.name === name)?.found;
2584
3572
  }
@@ -3008,6 +3996,8 @@ const DEFAULT_SETTINGS = {
3008
3996
  useDaemon: false,
3009
3997
  remoteHosts: false,
3010
3998
  orchestration: false,
3999
+ schedules: false,
4000
+ schedulesAgent: true,
3011
4001
  loadProjectExtensions: false,
3012
4002
  importForeignConfigs: false,
3013
4003
  importRulerConfigs: true,
@@ -3015,9 +4005,10 @@ const DEFAULT_SETTINGS = {
3015
4005
  subagentModels: true,
3016
4006
  imageGeneration: true,
3017
4007
  webSearch: true,
4008
+ secrets: false,
3018
4009
  imageModel: "",
3019
4010
  maxParallelSubagents: 3,
3020
- queueMessages: true,
4011
+ messageDelivery: "queue",
3021
4012
  theme: "default",
3022
4013
  showAllProjects: false,
3023
4014
  spaces: false,
@@ -3723,7 +4714,7 @@ function gruvboxTheme(id, label, p) {
3723
4714
  }
3724
4715
  const GRUVBOX_DARK = /* @__PURE__ */ gruvboxTheme("gruvbox-dark", "Gruvbox Dark", DARK);
3725
4716
  const GRUVBOX_LIGHT = /* @__PURE__ */ gruvboxTheme("gruvbox-light", "Gruvbox Light", LIGHT);
3726
- const TEXT$1 = "#1f2328";
4717
+ const TEXT = "#1f2328";
3727
4718
  const DIM = "#656d76";
3728
4719
  const MUTE = "#8c959f";
3729
4720
  const BORDER = "#d0d7de";
@@ -3756,7 +4747,7 @@ const LIGHT_THEME = {
3756
4747
  focusedBackgroundColor: "transparent",
3757
4748
  selectedBackgroundColor: "transparent",
3758
4749
  selectedTextColor: BRAND,
3759
- textColor: TEXT$1,
4750
+ textColor: TEXT,
3760
4751
  descriptionColor: MUTE,
3761
4752
  selectedDescriptionColor: DIM
3762
4753
  },
@@ -3788,7 +4779,7 @@ const LIGHT_THEME = {
3788
4779
  }
3789
4780
  },
3790
4781
  syntax: {
3791
- "default": { fg: TEXT$1 },
4782
+ "default": { fg: TEXT },
3792
4783
  "markup.heading": {
3793
4784
  fg: BRAND,
3794
4785
  bold: true
@@ -3802,19 +4793,19 @@ const LIGHT_THEME = {
3802
4793
  bold: true
3803
4794
  },
3804
4795
  "markup.heading.3": {
3805
- fg: TEXT$1,
4796
+ fg: TEXT,
3806
4797
  bold: true
3807
4798
  },
3808
4799
  "markup.bold": {
3809
- fg: TEXT$1,
4800
+ fg: TEXT,
3810
4801
  bold: true
3811
4802
  },
3812
4803
  "markup.strong": {
3813
- fg: TEXT$1,
4804
+ fg: TEXT,
3814
4805
  bold: true
3815
4806
  },
3816
4807
  "markup.italic": {
3817
- fg: TEXT$1,
4808
+ fg: TEXT,
3818
4809
  italic: true
3819
4810
  },
3820
4811
  "markup.link": {
@@ -3866,15 +4857,15 @@ const LIGHT_THEME = {
3866
4857
  "constructor": { fg: "#953800" },
3867
4858
  "attribute": { fg: "#0550ae" },
3868
4859
  "tag": { fg: "#116329" },
3869
- "variable": { fg: TEXT$1 },
4860
+ "variable": { fg: TEXT },
3870
4861
  "variable.builtin": { fg: "#0550ae" },
3871
4862
  "variable.parameter": { fg: "#953800" },
3872
4863
  "variable.member": { fg: "#0550ae" },
3873
4864
  "property": { fg: "#0550ae" },
3874
4865
  "operator": { fg: "#cf222e" },
3875
4866
  "punctuation": { fg: DIM },
3876
- "punctuation.bracket": { fg: TEXT$1 },
3877
- "punctuation.delimiter": { fg: TEXT$1 },
4867
+ "punctuation.bracket": { fg: TEXT },
4868
+ "punctuation.delimiter": { fg: TEXT },
3878
4869
  "label": { fg: "#0550ae" }
3879
4870
  }
3880
4871
  };
@@ -4326,6 +5317,21 @@ const SETTINGS_KEYWORDS = {
4326
5317
  "main session",
4327
5318
  "daemon"
4328
5319
  ],
5320
+ schedules: [
5321
+ "reminder",
5322
+ "remind",
5323
+ "cron",
5324
+ "schedule",
5325
+ "timer",
5326
+ "recurring"
5327
+ ],
5328
+ schedulesAgent: [
5329
+ "reminder",
5330
+ "remind",
5331
+ "cron",
5332
+ "schedule",
5333
+ "agent"
5334
+ ],
4329
5335
  sidebarRunDetails: [
4330
5336
  "sidebar",
4331
5337
  "status",
@@ -4373,10 +5379,13 @@ const SETTINGS_KEYWORDS = {
4373
5379
  "sequence",
4374
5380
  "graph"
4375
5381
  ],
4376
- queueMessages: [
5382
+ messageDelivery: [
4377
5383
  "queue",
5384
+ "queuing",
5385
+ "steer",
5386
+ "steering",
4378
5387
  "send while running",
4379
- "steer"
5388
+ "interrupt"
4380
5389
  ],
4381
5390
  maxCostUsd: [
4382
5391
  "budget",
@@ -4420,6 +5429,18 @@ const SETTINGS_TOGGLES = [
4420
5429
  label: "Main session",
4421
5430
  description: "Pin a session that starts, steers and reads your other sessions. Needs the daemon."
4422
5431
  },
5432
+ {
5433
+ category: "agent",
5434
+ key: "schedules",
5435
+ label: "Reminders",
5436
+ description: "Send a prompt to a session at a set time, once or on a repeat. Extensions can schedule their own reminders."
5437
+ },
5438
+ {
5439
+ category: "agent",
5440
+ key: "schedulesAgent",
5441
+ label: "Agent can set reminders",
5442
+ description: 'Give the agent a tool to schedule prompts to its own session, such as "check the CI in 20 minutes". Needs Reminders.'
5443
+ },
4423
5444
  {
4424
5445
  category: "agent",
4425
5446
  key: "useDaemon",
@@ -4544,12 +5565,6 @@ const SETTINGS_TOGGLES = [
4544
5565
  label: "Auto-compact",
4545
5566
  description: "Summarize the conversation when the context passes the threshold below."
4546
5567
  },
4547
- {
4548
- category: "agent",
4549
- key: "queueMessages",
4550
- label: "Queue messages",
4551
- description: "Hold messages sent during a run until it ends. When off, they go into the running turn."
4552
- },
4553
5568
  {
4554
5569
  category: "agent",
4555
5570
  key: "subagentModels",
@@ -4568,6 +5583,12 @@ const SETTINGS_TOGGLES = [
4568
5583
  label: "Web search",
4569
5584
  description: "Let the agent search the web for docs, errors and recent changes."
4570
5585
  },
5586
+ {
5587
+ category: "agent",
5588
+ key: "secrets",
5589
+ label: "Secrets",
5590
+ description: "Let the agent ask you for an API key or a token. zidane keeps it in a private file for this project, out of the chat, and hides it in tool output."
5591
+ },
4571
5592
  {
4572
5593
  category: "agent",
4573
5594
  key: "decisions",
@@ -4882,6 +5903,15 @@ const APPROVAL_MODE_OPTIONS = [
4882
5903
  description: "Run every tool call without asking. Typing into a terminal you opened still asks."
4883
5904
  }
4884
5905
  ];
5906
+ const MESSAGE_DELIVERY_OPTIONS = [{
5907
+ value: "steer",
5908
+ label: "Steering",
5909
+ description: "Your message goes into the run. The agent reads it after its current step and changes course."
5910
+ }, {
5911
+ value: "queue",
5912
+ label: "Queuing",
5913
+ description: "Your message waits in a queue. zidane sends it when the run ends."
5914
+ }];
4885
5915
  const DURABILITY_OPTIONS = [
4886
5916
  {
4887
5917
  value: "resume-ask",
@@ -4934,6 +5964,13 @@ const SETTINGS_CHOICES = [
4934
5964
  description: "Keep a checkpoint of each run so it can continue after a crash. Applies to new runs. Unavailable on stores other than SQLite.",
4935
5965
  options: DURABILITY_OPTIONS
4936
5966
  },
5967
+ {
5968
+ category: "agent",
5969
+ key: "messageDelivery",
5970
+ label: "Messages during a run",
5971
+ description: "What happens to a message that you send while the agent works. Alt+Enter sends one message the other way.",
5972
+ options: MESSAGE_DELIVERY_OPTIONS
5973
+ },
4937
5974
  {
4938
5975
  category: "ui",
4939
5976
  key: "openIn",
@@ -5763,6 +6800,12 @@ function waitedMs(wait, now) {
5763
6800
  function workedMs(startedAt, wait, now) {
5764
6801
  return Math.max(now - startedAt - waitedMs(wait, now), 0);
5765
6802
  }
6803
+ function isRunEstimated(view) {
6804
+ return !("problem" in view);
6805
+ }
6806
+ function estimateViewAt(view) {
6807
+ return isRunEstimated(view) ? view.at : view.problem.at;
6808
+ }
5766
6809
  function estimateReadout(view, now) {
5767
6810
  const worked = workedMs(view.startedAt, {
5768
6811
  ms: view.waitMs,
@@ -5787,6 +6830,7 @@ function formatEstimate(ms) {
5787
6830
  if (seconds < 60) return `~${Math.max(Math.ceil(seconds / 10) * 10, 10)}s`;
5788
6831
  const minutes = Math.ceil(seconds / 60);
5789
6832
  if (minutes < 60) return `~${minutes}m`;
6833
+ if (minutes > 1440) return "24h+";
5790
6834
  if (minutes < 600) {
5791
6835
  const rounded = Math.round(minutes / 5) * 5;
5792
6836
  const h = Math.floor(rounded / 60);
@@ -6002,6 +7046,15 @@ const ONBOARDING_FEATURES = [
6002
7046
  unlocks: "Runs that keep going after you close the window, and one session open in several windows.",
6003
7047
  prevents: "Losing a long run when its window closes."
6004
7048
  },
7049
+ {
7050
+ key: "schedules",
7051
+ group: "background",
7052
+ surfaces: BOTH,
7053
+ includes: ["schedulesAgent"],
7054
+ example: "For example, you type `/remind in 20m check the deploy`. Twenty minutes later, the session gets the message and runs it.",
7055
+ unlocks: "Prompts that run later or on a repeat, and an agent that can come back to a task on its own.",
7056
+ prevents: "Forgetting to come back to a long task, and checking the same thing by hand every morning."
7057
+ },
6005
7058
  {
6006
7059
  key: "browser",
6007
7060
  group: "desktop",
@@ -6036,6 +7089,14 @@ const ONBOARDING_FEATURES = [
6036
7089
  example: "For example, a project adds a `/deploy` command in its `.zidane/extensions` folder.",
6037
7090
  unlocks: "Extensions that a project ships load when you open it, such as its own commands.",
6038
7091
  prevents: "Off, code from a repository that you clone never runs on its own."
7092
+ },
7093
+ {
7094
+ key: "secrets",
7095
+ group: "trust",
7096
+ surfaces: BOTH,
7097
+ example: "For example, the agent needs a Tailscale auth key to set up test machines. It asks for it in a password field, and its commands read it from a private file.",
7098
+ unlocks: "The agent can ask you for an API key or a token when a task needs one. Its commands use it, and the chat never shows it.",
7099
+ prevents: "Keys pasted into the chat, where the model, the transcript and the logs keep them."
6039
7100
  }
6040
7101
  ];
6041
7102
  const ONBOARDING_FEATURE_GROUPS = [
@@ -6253,7 +7314,7 @@ const ONBOARDING_STEPS = [
6253
7314
  scope: "shared",
6254
7315
  label: "Conversation",
6255
7316
  title: "How much detail do you want to see?",
6256
- lede: "Pick a preset. The preview shows a sample conversation with it."
7317
+ lede: "Pick a preset. The preview shows a sample conversation with it. Then pick what happens to a message that you send while the agent works."
6257
7318
  },
6258
7319
  {
6259
7320
  id: "autonomy",
@@ -6340,16 +7401,19 @@ function featureStepSettings() {
6340
7401
  const ONBOARDING_STEP_SETTINGS = {
6341
7402
  import: ["importForeignConfigs"],
6342
7403
  look: ["theme", "mouseInteractions"],
6343
- conversation: TRANSCRIPT_PRESET_KEYS,
7404
+ conversation: [...TRANSCRIPT_PRESET_KEYS, "messageDelivery"],
6344
7405
  autonomy: [
6345
7406
  "approvalMode",
6346
7407
  "sandbox",
6347
7408
  "sandboxNetwork",
6348
7409
  "maxCostUsd"
6349
7410
  ],
6350
- features: featureStepSettings()
7411
+ features: /* @__PURE__ */ featureStepSettings()
6351
7412
  };
6352
- const ONBOARDING_SETTING_KEYS = [...new Set(Object.values(ONBOARDING_STEP_SETTINGS).flatMap((keys) => keys ?? []))];
7413
+ const ONBOARDING_SETTING_KEYS = /* @__PURE__ */ stepSettingKeys(ONBOARDING_STEP_SETTINGS);
7414
+ function stepSettingKeys(steps) {
7415
+ return [...new Set(Object.values(steps).flatMap((keys) => keys ?? []))];
7416
+ }
6353
7417
  function stepsFor(context, path) {
6354
7418
  const mode = context.mode === "full" && path === "quick" ? "quick" : context.mode;
6355
7419
  return planOnboarding({
@@ -7098,6 +8162,9 @@ const MCP_STATUS_LABEL = {
7098
8162
  "bootstrap-error": "Couldn't connect",
7099
8163
  "key-refused": "Key refused"
7100
8164
  };
8165
+ function otherDelivery(delivery) {
8166
+ return delivery === "steer" ? "queue" : "steer";
8167
+ }
7101
8168
  function customModelTargets(query, providers, fallbackProviderKey) {
7102
8169
  const { modelId, named } = splitProviderPrefix(query, providers);
7103
8170
  if (!modelId) return [];
@@ -7698,6 +8765,23 @@ const TUTORIALS = {
7698
8765
  detail: "Paste its address and the token. Its sessions run there, and a run keeps going when you close this window."
7699
8766
  }
7700
8767
  ]
8768
+ },
8769
+ secrets: {
8770
+ title: "How secrets work",
8771
+ steps: [
8772
+ {
8773
+ title: "The agent asks for a key",
8774
+ detail: "When a task needs an API key or a token, the agent asks you for it in a password field."
8775
+ },
8776
+ {
8777
+ title: "zidane keeps it out of the chat",
8778
+ detail: "It stays in a private file for this project, for the time you pick. The chat and the transcript never show it."
8779
+ },
8780
+ {
8781
+ title: "Commands read it from the file",
8782
+ detail: "Commands read it at $ZIDANE_SECRETS/NAME, and tool output shows [secret:NAME]. You revoke it in the Secrets panel or in Settings."
8783
+ }
8784
+ ]
7701
8785
  }
7702
8786
  };
7703
8787
  const ON_SERVER = {
@@ -7732,7 +8816,11 @@ const ON_SERVER = {
7732
8816
  title: "Every app uses them",
7733
8817
  detail: `Every session on ${host} uses them, from any app. A key in its environment works too.`
7734
8818
  }
7735
- })
8819
+ }),
8820
+ secrets: (host) => ({ 1: {
8821
+ title: "zidane keeps it out of the chat",
8822
+ detail: `It stays in a private file on ${host}, for this project, for the time you pick. The chat and the transcript never show it.`
8823
+ } })
7736
8824
  };
7737
8825
  function tutorialOnServer(topic, host) {
7738
8826
  const words2 = TUTORIALS[topic];
@@ -8103,6 +9191,16 @@ const APPROVAL_MODE_TRADEOFFS = {
8103
9191
  prevents: "Nothing. Turn on the sandbox, or work in a folder that you can throw away."
8104
9192
  }
8105
9193
  };
9194
+ const MESSAGE_DELIVERY_TRADEOFFS = {
9195
+ steer: {
9196
+ unlocks: "You correct the agent while it works. It reads your message after its current step.",
9197
+ prevents: "Work in the wrong direction until the run ends."
9198
+ },
9199
+ queue: {
9200
+ unlocks: "You type your next request while the agent works. The current run goes on as you asked.",
9201
+ prevents: "A change of plan in the middle of a step."
9202
+ }
9203
+ };
8106
9204
  const SETTING_TRADEOFFS = {
8107
9205
  sandbox: {
8108
9206
  unlocks: "More freedom for the agent, with less risk to your computer.",
@@ -8296,7 +9394,7 @@ function appendThinkingLines(prev, delta, owner, depth, turnId, options = {}) {
8296
9394
  return result;
8297
9395
  }
8298
9396
  function discardThinking(events, owner, turnId) {
8299
- const kept = events.filter((e) => !(e.kind === "thinking" && e.turnId === turnId && ownerOf(e) === owner));
9397
+ const kept = events.filter((e) => !((e.kind === "thinking" || e.kind === "markdown") && e.turnId === turnId && ownerOf(e) === owner));
8300
9398
  return kept.length === events.length ? events : kept;
8301
9399
  }
8302
9400
  function finalizeStreamingMarkdown(events) {
@@ -9108,6 +10206,35 @@ function planAttachment(file) {
9108
10206
  mediaType: isTextType(declared) ? declared : "text/plain"
9109
10207
  };
9110
10208
  }
10209
+ function authPrimaryAction(auth) {
10210
+ return auth.kind === "busy" || auth.kind === "network" ? "retry" : "sign-in";
10211
+ }
10212
+ function authOffersSignInFallback(auth) {
10213
+ return auth.kind === "busy";
10214
+ }
10215
+ function authProviderKeys(auth) {
10216
+ return [...new Set([auth.providerId, auth.provider].filter((key) => !!key))];
10217
+ }
10218
+ function sameAuthTarget(a, b) {
10219
+ return a.source === b.source && authProviderKeys(a).some((key) => authProviderKeys(b).includes(key)) && (a.accountId ?? null) === (b.accountId ?? null);
10220
+ }
10221
+ function authFailureHeadline(auth, label = auth.provider) {
10222
+ const who = auth.accountLabel ? `${label} (${auth.accountLabel})` : label;
10223
+ switch (auth.kind) {
10224
+ case "expired":
10225
+ return `${who} sign-in expired`;
10226
+ case "revoked":
10227
+ return `${who} sign-in was revoked`;
10228
+ case "missing":
10229
+ return `Not signed in to ${who}`;
10230
+ case "busy":
10231
+ return `${who} sign-in is stuck refreshing in another process${auth.holderPid ? ` (pid ${auth.holderPid})` : ""}`;
10232
+ case "network":
10233
+ return `Couldn't reach ${label} to refresh the sign-in`;
10234
+ case "rejected":
10235
+ return `${who} rejected the credentials`;
10236
+ }
10237
+ }
9111
10238
  const SUBCOMMAND_PROGRAMS = /* @__PURE__ */ new Set([
9112
10239
  "git",
9113
10240
  "gh",
@@ -9965,7 +11092,6 @@ function parseKeyValueLines(raw, opts) {
9965
11092
  };
9966
11093
  }
9967
11094
  const INBOX_PANEL_ID = "inbox";
9968
- const TODOS_PANEL_ID = "todos";
9969
11095
  const QUEUE_PANEL_ID = "queue";
9970
11096
  const ARTIFACTS_PANEL_ID = "artifacts";
9971
11097
  const DIFFS_PANEL_ID = "diffs";
@@ -9973,6 +11099,8 @@ const FILES_PANEL_ID = "files";
9973
11099
  const BROWSER_PANEL_ID = "browser";
9974
11100
  const TERMINAL_PANEL_ID = "terminal";
9975
11101
  const SIDE_PANEL_ID = "side";
11102
+ const SECRETS_PANEL_ID = "secrets";
11103
+ const REMINDERS_PANEL_ID = "reminders";
9976
11104
  const BUILTIN_PANEL_TABS = [
9977
11105
  {
9978
11106
  id: INBOX_PANEL_ID,
@@ -9983,15 +11111,6 @@ const BUILTIN_PANEL_TABS = [
9983
11111
  },
9984
11112
  builtin: true
9985
11113
  },
9986
- {
9987
- id: TODOS_PANEL_ID,
9988
- label: "Todos",
9989
- icon: {
9990
- gui: "i-ph-list-checks",
9991
- tui: "▣"
9992
- },
9993
- builtin: true
9994
- },
9995
11114
  {
9996
11115
  id: QUEUE_PANEL_ID,
9997
11116
  label: "Queue",
@@ -10054,12 +11173,32 @@ const BUILTIN_PANEL_TABS = [
10054
11173
  tui: "◇"
10055
11174
  },
10056
11175
  builtin: true
11176
+ },
11177
+ {
11178
+ id: SECRETS_PANEL_ID,
11179
+ label: "Secrets",
11180
+ icon: {
11181
+ gui: "i-ph-key",
11182
+ tui: "⚿"
11183
+ },
11184
+ builtin: true
11185
+ },
11186
+ {
11187
+ id: REMINDERS_PANEL_ID,
11188
+ label: "Reminders",
11189
+ icon: {
11190
+ gui: "i-ph-alarm",
11191
+ tui: "◷"
11192
+ },
11193
+ builtin: true
10057
11194
  }
10058
11195
  ];
10059
11196
  function buildPanelCatalog(extensionPanels, options = {}) {
10060
11197
  const tabs = [];
10061
11198
  for (const tab of BUILTIN_PANEL_TABS) {
10062
11199
  if (tab.id === "artifacts" && options.showArtifacts === false) continue;
11200
+ if (tab.id === "secrets" && options.showSecrets !== true) continue;
11201
+ if (tab.id === "reminders" && options.showReminders !== true) continue;
10063
11202
  if (options.omitBuiltins?.includes(tab.id)) continue;
10064
11203
  tabs.push(tab);
10065
11204
  }
@@ -10074,7 +11213,9 @@ function buildPanelCatalog(extensionPanels, options = {}) {
10074
11213
  label: p.label,
10075
11214
  builtin: false,
10076
11215
  owner: p.owner,
10077
- ...p.icon ? { icon: p.icon } : {}
11216
+ ...p.icon ? { icon: p.icon } : {},
11217
+ ...p.ownerName ? { ownerName: p.ownerName } : {},
11218
+ ...p.ownerIcon ? { ownerIcon: p.ownerIcon } : {}
10078
11219
  });
10079
11220
  }
10080
11221
  return tabs;
@@ -10305,885 +11446,311 @@ const EMPTY_RATE = {
10305
11446
  const WINDOW_MS = 3e3;
10306
11447
  const MIN_SPAN_MS = 1200;
10307
11448
  const SMOOTHING = 0.35;
10308
- function stepStreamRate(state, sample) {
10309
- const point = {
10310
- t: sample.elapsedMs,
10311
- n: sample.outputTokens
10312
- };
10313
- if (state.turnId !== sample.turnId) return {
10314
- turnId: sample.turnId,
10315
- samples: [point],
10316
- estimated: sample.estimated,
10317
- rate: null
10318
- };
10319
- const last = state.samples[state.samples.length - 1];
10320
- if (state.estimated === true && !sample.estimated || last !== void 0 && point.n < last.n || !last) return {
10321
- ...state,
10322
- samples: [point],
10323
- estimated: sample.estimated
10324
- };
10325
- if (point.t <= last.t) return state;
10326
- const kept = [...state.samples, point];
10327
- let start = 0;
10328
- while (start < kept.length - 2 && kept[start + 1].t <= point.t - WINDOW_MS) start++;
10329
- const samples = kept.slice(start);
10330
- const base = samples[0];
10331
- const span = point.t - base.t;
10332
- let rate = state.rate;
10333
- if (span >= MIN_SPAN_MS) {
10334
- const reading = (point.n - base.n) / span * 1e3;
10335
- if (reading >= 0 && reading <= 6e3) rate = rate === null ? reading : rate + SMOOTHING * (reading - rate);
10336
- }
10337
- return {
10338
- turnId: state.turnId,
10339
- samples,
10340
- estimated: sample.estimated,
10341
- rate
10342
- };
10343
- }
10344
- function streamRateValue(state) {
10345
- if (state.rate === null) return null;
10346
- const rounded = Math.round(state.rate);
10347
- return rounded > 0 ? rounded : null;
10348
- }
10349
- const USER_TODO_ID_PREFIX = "user-";
10350
- function nextTodoId(items) {
10351
- const taken = new Set(items.map((i) => i.id));
10352
- for (let n = 1; ; n++) {
10353
- const id = `${USER_TODO_ID_PREFIX}${n}`;
10354
- if (!taken.has(id)) return id;
10355
- }
10356
- }
10357
- function addTodo(items, content) {
10358
- const trimmed = content.trim();
10359
- if (!trimmed) return [...items];
10360
- return [...items, {
10361
- id: nextTodoId(items),
10362
- content: trimmed,
10363
- status: "pending"
10364
- }];
10365
- }
10366
- function editTodo(items, id, content) {
10367
- const trimmed = content.trim();
10368
- if (!trimmed) return [...items];
10369
- return items.map((item) => item.id === id ? {
10370
- ...item,
10371
- content: trimmed
10372
- } : item);
10373
- }
10374
- function removeTodo(items, id) {
10375
- return items.filter((item) => item.id !== id);
10376
- }
10377
- function clearTodos() {
10378
- return [];
10379
- }
10380
- function cycleTodoStatus(items, id) {
10381
- const target = items.find((item) => item.id === id);
10382
- if (!target) return [...items];
10383
- const next = nextStatus(target.status);
10384
- return items.map((item) => {
10385
- if (item.id === id) return {
10386
- ...item,
10387
- status: next
10388
- };
10389
- if (next === "in_progress" && item.status === "in_progress") return {
10390
- ...item,
10391
- status: "pending"
10392
- };
10393
- return item;
10394
- });
10395
- }
10396
- function nextStatus(status) {
10397
- switch (status) {
10398
- case "pending":
10399
- return "in_progress";
10400
- case "in_progress":
10401
- return "completed";
10402
- default:
10403
- return "pending";
10404
- }
10405
- }
10406
- function buildTodoRetryMessage(item) {
10407
- return `Retry this todo (currently ${item.status}): "${item.content}"`;
10408
- }
10409
- const RESET_UNITS = [
10410
- ["d", 86400],
10411
- ["h", 3600],
10412
- ["min", 60],
10413
- ["s", 1]
10414
- ];
10415
- function formatResetDelay(ms) {
10416
- const largest = (seconds2) => RESET_UNITS.findIndex(([, size2]) => seconds2 >= size2);
10417
- const seconds = Math.max(1, Math.ceil(ms / 1e3));
10418
- const grain = RESET_UNITS[Math.min(largest(seconds) + 1, RESET_UNITS.length - 1)][1];
10419
- const rounded = Math.ceil(seconds / grain) * grain;
10420
- const index = largest(rounded);
10421
- const [unit, size] = RESET_UNITS[index];
10422
- const next = RESET_UNITS[index + 1];
10423
- const rest = next ? rounded % size / next[1] : 0;
10424
- return rest > 0 ? `${Math.floor(rounded / size)} ${unit} ${rest} ${next[0]}` : `${Math.floor(rounded / size)} ${unit}`;
10425
- }
10426
- const TODO_STATUS_GLYPHS = {
10427
- pending: "☐",
10428
- in_progress: "◐",
10429
- completed: "☑",
10430
- cancelled: "☒"
10431
- };
10432
- function accentColor(accent, COLOR) {
10433
- switch (accent) {
10434
- case "brand":
10435
- return COLOR.brand;
10436
- case "warn":
10437
- return COLOR.warn;
10438
- case "model":
10439
- return COLOR.model;
10440
- default:
10441
- return COLOR.accent;
10442
- }
10443
- }
10444
- function showsAccount(snapshot, all) {
10445
- return snapshot.account !== null && all.some((s) => s !== snapshot && s.providerKey === snapshot.providerKey);
10446
- }
10447
- function activeSnapshotFor(all, providerKey, account) {
10448
- const mine = all.filter((s) => s.providerKey === providerKey);
10449
- return (account ? mine.find((s) => s.credentialId === account) : void 0) ?? mine.find((s) => s.activeCredential) ?? mine[0] ?? null;
10450
- }
10451
- function mostConstrainedWindow(snapshot) {
10452
- let worst = null;
10453
- for (const win of snapshot.windows) if (!worst || win.usedPercent > worst.usedPercent) worst = win;
10454
- return worst;
10455
- }
10456
- function formatUsagePercent(usedPercent) {
10457
- return Number.isInteger(usedPercent) ? String(usedPercent) : usedPercent.toFixed(1);
10458
- }
10459
- function usageTone(usedPercent) {
10460
- if (usedPercent >= 85) return "error";
10461
- if (usedPercent >= 60) return "warn";
10462
- return "ok";
10463
- }
10464
- function resetLabel(resetsAt, now = Date.now()) {
10465
- if (resetsAt === null) return null;
10466
- const remaining = resetsAt - now;
10467
- return remaining > 0 ? `resets in ${formatResetDelay(remaining)}` : "resetting";
10468
- }
10469
- function updatedLabel(snapshots, now = Date.now()) {
10470
- let newest = -Infinity;
10471
- for (const s of snapshots) newest = Math.max(newest, s.fetchedAt);
10472
- if (!Number.isFinite(newest)) return null;
10473
- const seconds = Math.max(0, Math.floor((now - newest) / 1e3));
10474
- if (seconds < 60) return `updated ${seconds}s ago`;
10475
- return `updated ${Math.floor(seconds / 60)}m ago`;
10476
- }
10477
- function formatCredits(value) {
10478
- return value >= 100 ? value.toFixed(0) : value.toFixed(2);
10479
- }
10480
- function formatBalance(credits) {
10481
- const remaining = formatCredits(credits.remaining);
10482
- return credits.total === null ? remaining : `${remaining} / ${formatCredits(credits.total)}`;
10483
- }
10484
- function mergeReplyText(turn) {
10485
- const { content } = turn;
10486
- if (!isClaudeReply(turn)) return content;
10487
- let merged2;
10488
- for (let i = 0; i < content.length; i++) {
10489
- const block = content[i];
10490
- const prev = merged2 ? merged2.at(-1) : content[i - 1];
10491
- if (block.type === "text" && prev?.type === "text") {
10492
- merged2 ??= content.slice(0, i);
10493
- merged2[merged2.length - 1] = {
10494
- type: "text",
10495
- text: prev.text + block.text
10496
- };
10497
- } else merged2?.push(block);
10498
- }
10499
- return merged2 ?? content;
10500
- }
10501
- function isClaudeReply(turn) {
10502
- return turn.role === "assistant" && turn.usage?.modelId?.startsWith("claude") === true;
10503
- }
10504
- function modelPickKey(provider, model, account) {
10505
- return account ? `${provider}\0${model}\0${account}` : `${provider}\0${model}`;
10506
- }
10507
- function toggleKeyed(chain, entry, keyOf2) {
10508
- const key = keyOf2(entry);
10509
- const idx = chain.findIndex((e) => keyOf2(e) === key);
10510
- if (idx === -1) return [...chain, entry];
10511
- return [...chain.slice(0, idx), ...chain.slice(idx + 1)];
10512
- }
10513
- function pickPrimaryKeyed(chain, entry, keyOf2) {
10514
- const key = keyOf2(entry);
10515
- return [entry, ...chain.filter((e) => keyOf2(e) !== key)];
10516
- }
10517
- function positionKeyed(chain, key, keyOf2) {
10518
- const idx = chain.findIndex((e) => keyOf2(e) === key);
10519
- return idx === -1 ? null : idx + 1;
10520
- }
10521
- function chainsEqualKeyed(a, b, keyOf2) {
10522
- return a.length === b.length && a.every((e, i) => keyOf2(e) === keyOf2(b[i]));
10523
- }
10524
- function reorderKeyed(chain, key, delta, keyOf2) {
10525
- const from = chain.findIndex((e) => keyOf2(e) === key);
10526
- const to = from + delta;
10527
- if (from < 0 || to < 0 || to >= chain.length) return chain;
10528
- const next = [...chain];
10529
- const [entry] = next.splice(from, 1);
10530
- next.splice(to, 0, entry);
10531
- return next;
10532
- }
10533
- function chainAccountConflict(chain, entry) {
10534
- return chain.some((e) => e.provider === entry.provider && (e.account ?? void 0) !== (entry.account ?? void 0));
10535
- }
10536
- function rememberableChain(chain, providerOf, scope) {
10537
- const primary = chain[0];
10538
- if (primary === void 0) return null;
10539
- if (!scope.onServer) return [...chain];
10540
- if (!scope.canRunHere(providerOf(primary))) return null;
10541
- return chain.filter((entry) => scope.canRunHere(providerOf(entry)));
10542
- }
10543
- function turnAsText(turn) {
10544
- const parts = [];
10545
- for (const block of mergeReplyText(turn)) if (block.type === "text" && !block.systemNote && block.text.trim()) parts.push(block.text);
10546
- else if (block.type === "thinking" && block.text.trim()) parts.push(`[thinking]
10547
- ${block.text}`);
10548
- else if (block.type === "tool_call") parts.push(`[tool call: ${block.name}]
10549
- ${stringifyArgs(block.input)}`);
10550
- else if (block.type === "tool_result") parts.push(`[tool result]
10551
- ${typeof block.output === "string" ? block.output : JSON.stringify(block.output, null, 2)}`);
10552
- else if (block.type === "compact-summary") parts.push(`[compaction summary: ${block.replacesTurnIds.length} turn${block.replacesTurnIds.length === 1 ? "" : "s"}]
10553
- ${block.summary}`);
10554
- return parts.join("\n\n");
10555
- }
10556
- function editableTurnText(turn) {
10557
- return mergeReplyText(turn).filter((block) => block.type === "text" && !block.systemNote).map((block) => block.text).join("\n\n");
10558
- }
10559
- function stringifyArgs(input) {
10560
- try {
10561
- return JSON.stringify(input, null, 2);
10562
- } catch {
10563
- return String(input);
11449
+ function stepStreamRate(state, sample) {
11450
+ const point = {
11451
+ t: sample.elapsedMs,
11452
+ n: sample.outputTokens
11453
+ };
11454
+ if (state.turnId !== sample.turnId) return {
11455
+ turnId: sample.turnId,
11456
+ samples: [point],
11457
+ estimated: sample.estimated,
11458
+ rate: null
11459
+ };
11460
+ const last = state.samples[state.samples.length - 1];
11461
+ if (state.estimated === true && !sample.estimated || last !== void 0 && point.n < last.n || !last) return {
11462
+ ...state,
11463
+ samples: [point],
11464
+ estimated: sample.estimated
11465
+ };
11466
+ if (point.t <= last.t) return state;
11467
+ const kept = [...state.samples, point];
11468
+ let start = 0;
11469
+ while (start < kept.length - 2 && kept[start + 1].t <= point.t - WINDOW_MS) start++;
11470
+ const samples = kept.slice(start);
11471
+ const base = samples[0];
11472
+ const span = point.t - base.t;
11473
+ let rate = state.rate;
11474
+ if (span >= MIN_SPAN_MS) {
11475
+ const reading = (point.n - base.n) / span * 1e3;
11476
+ if (reading >= 0 && reading <= 6e3) rate = rate === null ? reading : rate + SMOOTHING * (reading - rate);
10564
11477
  }
10565
- }
10566
- function countNeighbors(turnIds, turnId) {
10567
- const idx = turnIds.indexOf(turnId);
10568
- if (idx === -1) return null;
10569
11478
  return {
10570
- before: idx,
10571
- after: turnIds.length - 1 - idx
11479
+ turnId: state.turnId,
11480
+ samples,
11481
+ estimated: sample.estimated,
11482
+ rate
10572
11483
  };
10573
11484
  }
10574
- const LOCAL_HOST = /^(?:localhost|127(?:\.\d{1,3}){3}|0\.0\.0\.0|\[::1\]|[\w-]+\.localhost)(?::\d+)?(?:[/?#]|$)/i;
10575
- const HOST_LIKE = /^(?:[\w-]+\.)+[a-z]{2,}(?::\d+)?(?:[/?#]|$)/i;
10576
- const PORT_ONLY = /^:?(\d{2,5})([/?#].*)?$/;
10577
- function normalizeBrowserUrl(input) {
10578
- const text = input.trim();
10579
- if (!text) return null;
10580
- const port = PORT_ONLY.exec(text);
10581
- if (port) return canonical(`http://localhost:${port[1]}${port[2] ?? ""}`);
10582
- if (/^[a-z][a-z\d+.-]*:\/\//i.test(text)) return isAllowedBrowserUrl(text) ? canonical(text) : null;
10583
- if (/\s/.test(text)) return null;
10584
- if (LOCAL_HOST.test(text)) return canonical(`http://${text}`);
10585
- if (HOST_LIKE.test(text)) return canonical(`https://${text}`);
10586
- return null;
10587
- }
10588
- function isAllowedBrowserUrl(url) {
10589
- if (url === "about:blank") return true;
10590
- try {
10591
- const { protocol } = new URL(url);
10592
- return protocol === "http:" || protocol === "https:";
10593
- } catch {
10594
- return false;
10595
- }
10596
- }
10597
- function canonical(url) {
10598
- try {
10599
- return new URL(url).toString();
10600
- } catch {
10601
- return null;
10602
- }
11485
+ function streamRateValue(state) {
11486
+ if (state.rate === null) return null;
11487
+ const rounded = Math.round(state.rate);
11488
+ return rounded > 0 ? rounded : null;
10603
11489
  }
10604
- const merged = /* @__PURE__ */ new WeakMap();
10605
- function isTopPrompt(event) {
10606
- return event.kind === "user-prompt" && !event.childId && (event.depth ?? 0) === 0;
11490
+ const SESSION_SCOPE = "session";
11491
+ function planProgress(plan) {
11492
+ const out = {
11493
+ completed: 0,
11494
+ cancelled: 0,
11495
+ inProgress: 0,
11496
+ pending: 0,
11497
+ total: plan.steps.length,
11498
+ activeIndex: -1
11499
+ };
11500
+ for (const s of plan.steps) if (s.status === "completed") out.completed++;
11501
+ else if (s.status === "cancelled") out.cancelled++;
11502
+ else if (s.status === "in_progress") out.inProgress++;
11503
+ else out.pending++;
11504
+ out.activeIndex = plan.steps.findIndex((s) => s.status === "in_progress");
11505
+ if (out.activeIndex < 0) out.activeIndex = plan.steps.findIndex((s) => s.status === "pending");
11506
+ return out;
10607
11507
  }
10608
- function gatherCommandNotes(events) {
10609
- if (!events.some((e) => e.kind === "command-note")) return events;
10610
- const out = [];
10611
- let notes = [];
10612
- const flush = () => {
10613
- if (notes.length === 0) return;
10614
- const first = notes[0];
10615
- const key = notes.map((n) => n.text).join("\0");
10616
- let event = first;
10617
- if (notes.length > 1) {
10618
- const cached = merged.get(first);
10619
- event = cached?.key === key ? cached.event : {
10620
- ...first,
10621
- text: notes.map((n) => n.text).join(", ")
10622
- };
10623
- merged.set(first, {
10624
- key,
10625
- event
10626
- });
10627
- }
10628
- let at = out.length;
10629
- while (at > 0 && out[at - 1].kind === "separator") at--;
10630
- out.splice(at, 0, event);
10631
- notes = [];
10632
- };
10633
- for (const event of events) {
10634
- if (isTopPrompt(event)) flush();
10635
- if (event.kind === "command-note" && !event.childId) {
10636
- notes.push(event);
10637
- continue;
10638
- }
10639
- out.push(event);
10640
- }
10641
- flush();
10642
- return out.length === events.length && out.every((e, i) => e === events[i]) ? events : out;
11508
+ function planProgressLabel(progress) {
11509
+ if (progress.total === 0) return null;
11510
+ return `${progress.inProgress > 0 ? progress.activeIndex + 1 : progress.completed + progress.cancelled}/${progress.total}`;
10643
11511
  }
10644
- const ESC = 27;
10645
- const TEXT = 0;
10646
- const AFTER_ESC = 1;
10647
- const CSI = 2;
10648
- const STRING = 3;
10649
- const STRING_ESC = 4;
10650
- function hasAnsi(text) {
10651
- for (let i = 0; i < text.length; i++) {
10652
- const code = text.charCodeAt(i);
10653
- if (code === ESC || code === 155 || code === 157 || code === 13 || code === 8) return true;
11512
+ const MARKS = {
11513
+ pending: "[ ]",
11514
+ in_progress: "[>]",
11515
+ completed: "[x]",
11516
+ cancelled: "[-]"
11517
+ };
11518
+ function formatPlanForModel(plan) {
11519
+ const p = planProgress(plan);
11520
+ const lines = [`${plan.title ? `Plan "${plan.title}"` : "Task list"} (${plan.state}${plan.stopReason ? `: ${plan.stopReason.replace("_", " ")}` : ""}) · ${p.completed}/${p.total} completed`];
11521
+ for (const s of plan.steps) {
11522
+ const extra = s.status === "cancelled" && s.cancelledBy === "user" ? " (cancelled by user)" : s.added ? " (added)" : "";
11523
+ lines.push(`${MARKS[s.status]} ${s.id}: ${s.title}${extra}`);
10654
11524
  }
10655
- return false;
11525
+ return lines.join("\n");
10656
11526
  }
10657
- function sameStyle(a, b) {
10658
- if (a === b) return true;
10659
- if (!a || !b) return false;
10660
- return a.fg === b.fg && a.bg === b.bg && a.bold === b.bold && a.dim === b.dim && a.italic === b.italic && a.underline === b.underline && a.inverse === b.inverse;
11527
+ function buildPlanResumeMessage(plan) {
11528
+ return `Resume ${plan.title ? `the plan "${plan.title}"` : "your task list"}${plan.stoppedAt ? ` from step ${plan.stoppedAt}` : ""}. Call todowrite with its step ids as you continue.
11529
+
11530
+ ${formatPlanForModel(plan)}`;
10661
11531
  }
10662
- function hex(n) {
10663
- return Math.max(0, Math.min(255, n)).toString(16).padStart(2, "0");
11532
+ function buildStepRetryMessage(step) {
11533
+ return `Retry step ${step.id} (currently ${step.status}): "${step.title}"`;
10664
11534
  }
10665
- function extendedColor(params, i) {
10666
- if (params[i] === 5) return [params[i + 1] !== void 0 ? Math.max(0, Math.min(255, params[i + 1])) : void 0, i + 2];
10667
- if (params[i] === 2) return [`#${hex(params[i + 1] ?? 0)}${hex(params[i + 2] ?? 0)}${hex(params[i + 3] ?? 0)}`, i + 4];
10668
- return [void 0, i + 1];
11535
+ const SECRET_TTLS = [
11536
+ "1h",
11537
+ "24h",
11538
+ "7d",
11539
+ "never"
11540
+ ];
11541
+ const DEFAULT_SECRET_TTL = "24h";
11542
+ const SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
11543
+ function isSecretName(name) {
11544
+ return typeof name === "string" && SECRET_NAME_PATTERN.test(name);
11545
+ }
11546
+ function isSecretAnswer(value) {
11547
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
11548
+ const kind = value.kind;
11549
+ return kind === "secret-value" || kind === "secret-declined";
11550
+ }
11551
+ function isSecretReference(value) {
11552
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
11553
+ const cast = value;
11554
+ if (typeof cast.secret !== "string" || "value" in cast) return false;
11555
+ return cast.declined === true || typeof cast.path === "string";
10669
11556
  }
10670
- function applySgr(style, raw) {
10671
- const params = raw === "" ? [0] : raw.split(/[;:]/).map((p) => p === "" ? 0 : Number(p));
10672
- let next = { ...style };
10673
- for (let i = 0; i < params.length; i++) {
10674
- const p = params[i];
10675
- if (p === 0) next = {};
10676
- else if (p === 1) next.bold = true;
10677
- else if (p === 2) next.dim = true;
10678
- else if (p === 3) next.italic = true;
10679
- else if (p === 4) next.underline = true;
10680
- else if (p === 7) next.inverse = true;
10681
- else if (p === 22) {
10682
- delete next.bold;
10683
- delete next.dim;
10684
- } else if (p === 23) delete next.italic;
10685
- else if (p === 24) delete next.underline;
10686
- else if (p === 27) delete next.inverse;
10687
- else if (p >= 30 && p <= 37) next.fg = p - 30;
10688
- else if (p >= 90 && p <= 97) next.fg = p - 90 + 8;
10689
- else if (p === 39) delete next.fg;
10690
- else if (p >= 40 && p <= 47) next.bg = p - 40;
10691
- else if (p >= 100 && p <= 107) next.bg = p - 100 + 8;
10692
- else if (p === 49) delete next.bg;
10693
- else if (p === 38 || p === 48) {
10694
- const [color, after] = extendedColor(params, i + 1);
10695
- if (color !== void 0) {
10696
- if (p === 38) next.fg = color;
10697
- else next.bg = color;
10698
- }
10699
- i = after - 1;
10700
- }
10701
- }
10702
- if (Object.keys(next).length === 0) return void 0;
10703
- return sameStyle(style, next) ? style : next;
11557
+ const RESET_UNITS = [
11558
+ ["d", 86400],
11559
+ ["h", 3600],
11560
+ ["min", 60],
11561
+ ["s", 1]
11562
+ ];
11563
+ function formatResetDelay(ms) {
11564
+ const largest = (seconds2) => RESET_UNITS.findIndex(([, size2]) => seconds2 >= size2);
11565
+ const seconds = Math.max(1, Math.ceil(ms / 1e3));
11566
+ const grain = RESET_UNITS[Math.min(largest(seconds) + 1, RESET_UNITS.length - 1)][1];
11567
+ const rounded = Math.ceil(seconds / grain) * grain;
11568
+ const index = largest(rounded);
11569
+ const [unit, size] = RESET_UNITS[index];
11570
+ const next = RESET_UNITS[index + 1];
11571
+ const rest = next ? rounded % size / next[1] : 0;
11572
+ return rest > 0 ? `${Math.floor(rounded / size)} ${unit} ${rest} ${next[0]}` : `${Math.floor(rounded / size)} ${unit}`;
10704
11573
  }
10705
- function createAnsiLines() {
10706
- let state = TEXT;
10707
- let params = "";
10708
- let style;
10709
- let line = [];
10710
- let pendingCr = false;
10711
- const append = (text) => {
10712
- if (pendingCr) {
10713
- line = [];
10714
- pendingCr = false;
10715
- }
10716
- const last = line[line.length - 1];
10717
- if (last && sameStyle(last.style, style)) {
10718
- last.text += text;
10719
- return;
10720
- }
10721
- line.push(style ? {
10722
- text,
10723
- style
10724
- } : { text });
10725
- };
10726
- const backspace = () => {
10727
- const last = line[line.length - 1];
10728
- if (!last) return;
10729
- last.text = last.text.slice(0, -1);
10730
- if (last.text === "") line.pop();
10731
- };
10732
- return {
10733
- push(chunk) {
10734
- const done = [];
10735
- let i = 0;
10736
- while (i < chunk.length) {
10737
- const code = chunk.charCodeAt(i);
10738
- if (state === TEXT) {
10739
- if (code === ESC) state = AFTER_ESC;
10740
- else if (code === 10) {
10741
- done.push(line);
10742
- line = [];
10743
- pendingCr = false;
10744
- } else if (code === 13) pendingCr = true;
10745
- else if (code === 8) backspace();
10746
- else if (code === 155) {
10747
- state = CSI;
10748
- params = "";
10749
- } else if (code === 157) state = STRING;
10750
- else if (code === 9 || code >= 32 && !(code >= 127 && code < 160)) {
10751
- let end = i + 1;
10752
- while (end < chunk.length) {
10753
- const c2 = chunk.charCodeAt(end);
10754
- if (c2 === ESC || c2 === 10 || c2 === 13 || c2 === 8 || c2 < 32 && c2 !== 9 || c2 >= 127 && c2 < 160) break;
10755
- end++;
10756
- }
10757
- append(chunk.slice(i, end));
10758
- i = end;
10759
- continue;
10760
- }
10761
- } else if (state === AFTER_ESC) {
10762
- if (code === 91) {
10763
- state = CSI;
10764
- params = "";
10765
- } else if (code === 93 || code === 80 || code === 88 || code === 94 || code === 95) state = STRING;
10766
- else if (code < 32 || code > 47) state = TEXT;
10767
- } else if (state === CSI) {
10768
- if (code >= 64 && code <= 126) {
10769
- if (code === 109) style = applySgr(style, params);
10770
- state = TEXT;
10771
- } else if (params.length < 64) params += chunk[i];
10772
- } else if (state === STRING) {
10773
- if (code === 7 || code === 156) state = TEXT;
10774
- else if (code === ESC) state = STRING_ESC;
10775
- } else state = code === 92 ? TEXT : STRING;
10776
- i++;
10777
- }
10778
- return done;
10779
- },
10780
- partial: () => pendingCr ? [] : line
10781
- };
11574
+ function accentColor(accent, COLOR) {
11575
+ switch (accent) {
11576
+ case "brand":
11577
+ return COLOR.brand;
11578
+ case "warn":
11579
+ return COLOR.warn;
11580
+ case "model":
11581
+ return COLOR.model;
11582
+ default:
11583
+ return COLOR.accent;
11584
+ }
10782
11585
  }
10783
- function parseAnsi(text) {
10784
- const reader = createAnsiLines();
10785
- const lines = reader.push(text);
10786
- lines.push(reader.partial());
10787
- return lines;
11586
+ function showsAccount(snapshot, all) {
11587
+ return snapshot.account !== null && all.some((s) => s !== snapshot && s.providerKey === snapshot.providerKey);
10788
11588
  }
10789
- function ansiLineText(spans) {
10790
- return spans.map((span) => span.text).join("");
11589
+ function activeSnapshotFor(all, providerKey, account) {
11590
+ const mine = all.filter((s) => s.providerKey === providerKey);
11591
+ return (account ? mine.find((s) => s.credentialId === account) : void 0) ?? mine.find((s) => s.activeCredential) ?? mine[0] ?? null;
10791
11592
  }
10792
- function stripAnsi(text) {
10793
- if (!hasAnsi(text)) return text;
10794
- return parseAnsi(text).map(ansiLineText).join("\n");
11593
+ function mostConstrainedWindow(snapshot) {
11594
+ let worst = null;
11595
+ for (const win of snapshot.windows) if (!worst || win.usedPercent > worst.usedPercent) worst = win;
11596
+ return worst;
10795
11597
  }
10796
- function clipAnsiLine(spans, max) {
10797
- if (ansiLineText(spans).length <= max) return [...spans];
10798
- const out = [];
10799
- let room = max - 1;
10800
- for (const span of spans) {
10801
- if (room <= 0) break;
10802
- const text = span.text.slice(0, room);
10803
- out.push(span.style ? {
10804
- text,
10805
- style: span.style
10806
- } : { text });
10807
- room -= text.length;
10808
- }
10809
- out.push({ text: "…" });
10810
- return out;
11598
+ function formatUsagePercent(usedPercent) {
11599
+ return Number.isInteger(usedPercent) ? String(usedPercent) : usedPercent.toFixed(1);
10811
11600
  }
10812
- function createOutputTail(maxLines, lineChars) {
10813
- const tail = [];
10814
- const commands = /* @__PURE__ */ new Map();
10815
- let nextId = 0;
10816
- const shape = (spans) => {
10817
- const clipped = clipAnsiLine(spans, lineChars);
10818
- const text = ansiLineText(clipped);
10819
- return clipped.some((span) => span.style) ? {
10820
- text,
10821
- spans: clipped
10822
- } : { text };
10823
- };
10824
- const push = (entry) => {
10825
- tail.push(entry);
10826
- if (tail.length > maxLines) tail.splice(0, tail.length - maxLines);
10827
- };
10828
- return {
10829
- item(stream, text, line) {
10830
- const at = line !== void 0 ? { line } : {};
10831
- for (const spans of createAnsiLines().push(`${text}
10832
- `)) push({
10833
- id: nextId++,
10834
- stream,
10835
- ...shape(spans),
10836
- ...at
10837
- });
10838
- },
10839
- chunk(stream, text, line) {
10840
- const key = `${stream}\0${line ?? ""}`;
10841
- let command = commands.get(key);
10842
- if (!command) {
10843
- command = {
10844
- reader: createAnsiLines(),
10845
- stream,
10846
- ...line !== void 0 ? { line } : {}
10847
- };
10848
- commands.set(key, command);
10849
- }
10850
- const at = line !== void 0 ? { line } : {};
10851
- for (const spans of command.reader.push(text)) {
10852
- push({
10853
- id: command.openId ?? nextId++,
10854
- stream,
10855
- ...shape(spans),
10856
- ...at
10857
- });
10858
- command.openId = void 0;
10859
- }
10860
- if (command.reader.partial().length > 0 && command.openId === void 0) command.openId = nextId++;
10861
- },
10862
- lines() {
10863
- const open = [...commands.values()].flatMap(({ reader, stream, line, openId }) => {
10864
- const spans = reader.partial();
10865
- return spans.length === 0 || openId === void 0 ? [] : [{
10866
- id: openId,
10867
- stream,
10868
- ...shape(spans),
10869
- ...line !== void 0 ? { line } : {}
10870
- }];
10871
- });
10872
- return [...tail, ...open].slice(-maxLines);
10873
- }
10874
- };
11601
+ function usageTone(usedPercent) {
11602
+ if (usedPercent >= 85) return "error";
11603
+ if (usedPercent >= 60) return "warn";
11604
+ return "ok";
10875
11605
  }
10876
- const SCRIPT_OUTPUT_TAIL_LINES = 8;
10877
- function upsertToolProgress(events, event) {
10878
- if (event.kind === "tool-progress") {
10879
- const at = events.findLastIndex((e) => e.kind === "tool-progress" && e.callId === event.callId && e.childId === event.childId);
10880
- if (at !== -1) {
10881
- const next = events.slice();
10882
- next[at] = event;
10883
- return next;
10884
- }
10885
- }
10886
- return [...events, event];
11606
+ function resetLabel(resetsAt, now = Date.now()) {
11607
+ if (resetsAt === null) return null;
11608
+ const remaining = resetsAt - now;
11609
+ return remaining > 0 ? `resets in ${formatResetDelay(remaining)}` : "resetting";
10887
11610
  }
10888
- function scriptProgressByCall(events) {
10889
- const found = /* @__PURE__ */ new Map();
10890
- for (const event of events) if (event.kind === "tool-progress" && event.callId && event.scriptProgress) found.set(scriptProgressKey(event.callId, event.childId), event.scriptProgress);
10891
- return found;
11611
+ function updatedLabel(snapshots, now = Date.now()) {
11612
+ let newest = -Infinity;
11613
+ for (const s of snapshots) newest = Math.max(newest, s.fetchedAt);
11614
+ if (!Number.isFinite(newest)) return null;
11615
+ const seconds = Math.max(0, Math.floor((now - newest) / 1e3));
11616
+ if (seconds < 60) return `updated ${seconds}s ago`;
11617
+ return `updated ${Math.floor(seconds / 60)}m ago`;
10892
11618
  }
10893
- function scriptProgressKey(callId, childId) {
10894
- return `${childId ?? ""}\0${callId}`;
11619
+ function formatCredits(value) {
11620
+ return value >= 100 ? value.toFixed(0) : value.toFixed(2);
10895
11621
  }
10896
- const OPTIONS_LINE = /^\s*\/\/ @options:(.*)$/;
10897
- function readOptions(json) {
10898
- let value;
10899
- try {
10900
- value = JSON.parse(json);
10901
- } catch {
10902
- return {
10903
- other: [],
10904
- raw: json
10905
- };
11622
+ function formatBalance(credits) {
11623
+ const remaining = formatCredits(credits.remaining);
11624
+ return credits.total === null ? remaining : `${remaining} / ${formatCredits(credits.total)}`;
11625
+ }
11626
+ function mergeReplyText(turn) {
11627
+ const { content } = turn;
11628
+ if (!isClaudeReply(turn)) return content;
11629
+ let merged2;
11630
+ for (let i = 0; i < content.length; i++) {
11631
+ const block = content[i];
11632
+ const prev = merged2 ? merged2.at(-1) : content[i - 1];
11633
+ if (block.type === "text" && prev?.type === "text") {
11634
+ merged2 ??= content.slice(0, i);
11635
+ merged2[merged2.length - 1] = {
11636
+ type: "text",
11637
+ text: prev.text + block.text
11638
+ };
11639
+ } else merged2?.push(block);
10906
11640
  }
10907
- if (typeof value !== "object" || value === null || Array.isArray(value)) return {
10908
- other: [],
10909
- raw: json
10910
- };
10911
- const options = { other: [] };
10912
- for (const [key, field] of Object.entries(value)) if (key === "timeout_ms" && typeof field === "number") options.timeoutMs = field;
10913
- else if (key === "max_output_tokens" && typeof field === "number") options.maxOutputTokens = field;
10914
- else options.other.push({
10915
- key,
10916
- value: JSON.stringify(field)
10917
- });
10918
- return options;
11641
+ return merged2 ?? content;
10919
11642
  }
10920
- function scriptProgressView(code, progress, finished, ok = true, result) {
10921
- const ended = finished || progress?.ended !== void 0;
10922
- const endedOk = progress?.ended !== void 0 ? progress.ended === "ok" : ok;
10923
- const error = ended && !endedOk && result ? scriptErrorOf(result) : void 0;
10924
- const source = code.split("\n").map((line) => line.replace(/\r$/, ""));
10925
- const optionsMatch = source[0] !== void 0 ? OPTIONS_LINE.exec(source[0]) : null;
10926
- const options = optionsMatch ? readOptions(optionsMatch[1].trim()) : void 0;
10927
- let first = optionsMatch ? 1 : 0;
10928
- while (first < source.length && source[first].trim() === "") first++;
10929
- let last = source.length - 1;
10930
- while (last >= first && source[last].trim() === "") last--;
10931
- const byLine = new Map(progress?.lines.map((entry) => [entry.line, entry]));
10932
- const furthest = progress?.lines.length ? progress.lines[progress.lines.length - 1].line : 0;
10933
- const reached = ended && endedOk ? Number.POSITIVE_INFINITY : furthest;
10934
- const lines = [];
10935
- for (let i = first; i <= last; i++) {
10936
- const number = i + 1;
10937
- const entry = byLine.get(number);
10938
- const state = error?.line === number ? "failed" : !progress ? "passed" : entry ? entry.status === "running" ? "running" : entry.status === "ok" ? "done" : "failed" : number <= reached ? "passed" : "idle";
10939
- lines.push({
10940
- number,
10941
- label: number - first,
10942
- text: source[i],
10943
- state,
10944
- calls: entry?.calls ?? 0
10945
- });
11643
+ function isClaudeReply(turn) {
11644
+ return turn.role === "assistant" && turn.usage?.modelId?.startsWith("claude") === true;
11645
+ }
11646
+ function modelPickKey(provider, model, account) {
11647
+ return account ? `${provider}\0${model}\0${account}` : `${provider}\0${model}`;
11648
+ }
11649
+ function toggleKeyed(chain, entry, keyOf2) {
11650
+ const key = keyOf2(entry);
11651
+ const idx = chain.findIndex((e) => keyOf2(e) === key);
11652
+ if (idx === -1) return [...chain, entry];
11653
+ return [...chain.slice(0, idx), ...chain.slice(idx + 1)];
11654
+ }
11655
+ function pickPrimaryKeyed(chain, entry, keyOf2) {
11656
+ const key = keyOf2(entry);
11657
+ return [entry, ...chain.filter((e) => keyOf2(e) !== key)];
11658
+ }
11659
+ function positionKeyed(chain, key, keyOf2) {
11660
+ const idx = chain.findIndex((e) => keyOf2(e) === key);
11661
+ return idx === -1 ? null : idx + 1;
11662
+ }
11663
+ function chainsEqualKeyed(a, b, keyOf2) {
11664
+ return a.length === b.length && a.every((e, i) => keyOf2(e) === keyOf2(b[i]));
11665
+ }
11666
+ function reorderKeyed(chain, key, delta, keyOf2) {
11667
+ const from = chain.findIndex((e) => keyOf2(e) === key);
11668
+ const to = from + delta;
11669
+ if (from < 0 || to < 0 || to >= chain.length) return chain;
11670
+ const next = [...chain];
11671
+ const [entry] = next.splice(from, 1);
11672
+ next.splice(to, 0, entry);
11673
+ return next;
11674
+ }
11675
+ function chainAccountConflict(chain, entry) {
11676
+ return chain.some((e) => e.provider === entry.provider && (e.account ?? void 0) !== (entry.account ?? void 0));
11677
+ }
11678
+ function rememberableChain(chain, providerOf, scope) {
11679
+ const primary = chain[0];
11680
+ if (primary === void 0) return null;
11681
+ if (!scope.onServer) return [...chain];
11682
+ if (!scope.canRunHere(providerOf(primary))) return null;
11683
+ return chain.filter((entry) => scope.canRunHere(providerOf(entry)));
11684
+ }
11685
+ function turnAsText(turn) {
11686
+ const parts = [];
11687
+ for (const block of mergeReplyText(turn)) if (block.type === "text" && !block.systemNote && block.text.trim()) parts.push(block.text);
11688
+ else if (block.type === "thinking" && block.text.trim()) parts.push(`[thinking]
11689
+ ${block.text}`);
11690
+ else if (block.type === "tool_call") parts.push(`[tool call: ${block.name}]
11691
+ ${stringifyArgs(block.input)}`);
11692
+ else if (block.type === "tool_result") parts.push(`[tool result]
11693
+ ${typeof block.output === "string" ? block.output : JSON.stringify(block.output, null, 2)}`);
11694
+ else if (block.type === "compact-summary") parts.push(`[compaction summary: ${block.replacesTurnIds.length} turn${block.replacesTurnIds.length === 1 ? "" : "s"}]
11695
+ ${block.summary}`);
11696
+ return parts.join("\n\n");
11697
+ }
11698
+ function editableTurnText(turn) {
11699
+ return mergeReplyText(turn).filter((block) => block.type === "text" && !block.systemNote).map((block) => block.text).join("\n\n");
11700
+ }
11701
+ function stringifyArgs(input) {
11702
+ try {
11703
+ return JSON.stringify(input, null, 2);
11704
+ } catch {
11705
+ return String(input);
10946
11706
  }
10947
- const lastLine = lines.at(-1);
10948
- if (progress && ended && endedOk && lastLine?.state === "passed") lastLine.state = "done";
10949
- const done = progress?.done ?? 0;
10950
- const total = progress ? countOnceCallSites(code) : void 0;
10951
- const exact = total !== void 0 && done + (progress?.running ?? 0) <= total;
10952
- const running = progress?.lines.find((entry) => entry.status === "running")?.line;
11707
+ }
11708
+ function countNeighbors(turnIds, turnId) {
11709
+ const idx = turnIds.indexOf(turnId);
11710
+ if (idx === -1) return null;
10953
11711
  return {
10954
- lines,
10955
- ...options !== void 0 ? { options } : {},
10956
- tracked: progress !== void 0,
10957
- done,
10958
- running: progress?.running ?? 0,
10959
- failed: progress?.failed ?? 0,
10960
- ...exact ? {
10961
- total,
10962
- percent: ended && endedOk ? 100 : Math.min(100, Math.round(done / total * 100))
10963
- } : {},
10964
- ...!ended && progress ? { active: running ?? (furthest || void 0) } : {},
10965
- output: progress?.output ?? [],
10966
- ...error && lines.some((line) => line.number === error.line) ? { error } : {}
11712
+ before: idx,
11713
+ after: turnIds.length - 1 - idx
10967
11714
  };
10968
11715
  }
10969
- const SCRIPT_ERROR = /^Script error: (.+)$/m;
10970
- const EXCERPT_LINE = /^(\d+) \| /m;
10971
- function scriptErrorOf(result) {
10972
- const message = SCRIPT_ERROR.exec(result)?.[1]?.trim();
10973
- const line = EXCERPT_LINE.exec(result)?.[1];
10974
- return message && line ? {
10975
- line: Number(line),
10976
- message
10977
- } : void 0;
11716
+ const LOCAL_HOST = /^(?:localhost|127(?:\.\d{1,3}){3}|0\.0\.0\.0|\[::1\]|[\w-]+\.localhost)(?::\d+)?(?:[/?#]|$)/i;
11717
+ const HOST_LIKE = /^(?:[\w-]+\.)+[a-z]{2,}(?::\d+)?(?:[/?#]|$)/i;
11718
+ const PORT_ONLY = /^:?(\d{2,5})([/?#].*)?$/;
11719
+ function normalizeBrowserUrl(input) {
11720
+ const text = input.trim();
11721
+ if (!text) return null;
11722
+ const port = PORT_ONLY.exec(text);
11723
+ if (port) return canonical(`http://localhost:${port[1]}${port[2] ?? ""}`);
11724
+ if (/^[a-z][a-z\d+.-]*:\/\//i.test(text)) return isAllowedBrowserUrl(text) ? canonical(text) : null;
11725
+ if (/\s/.test(text)) return null;
11726
+ if (LOCAL_HOST.test(text)) return canonical(`http://${text}`);
11727
+ if (HOST_LIKE.test(text)) return canonical(`https://${text}`);
11728
+ return null;
10978
11729
  }
10979
- function maskScriptSource(code) {
10980
- const out = code.split("");
10981
- const blank = (from, to) => {
10982
- for (let k = from; k < to; k++) if (out[k] !== "\n") out[k] = " ";
10983
- };
10984
- const templates = [];
10985
- let braces = 0;
10986
- let prev = "";
10987
- let i = 0;
10988
- const n = code.length;
10989
- const templateText = () => {
10990
- const start = i;
10991
- while (i < n) {
10992
- const c2 = code[i];
10993
- if (c2 === "\\") {
10994
- i += 2;
10995
- continue;
10996
- }
10997
- if (c2 === "`") {
10998
- blank(start, i);
10999
- i++;
11000
- prev = "`";
11001
- return;
11002
- }
11003
- if (c2 === "$" && code[i + 1] === "{") {
11004
- blank(start, i);
11005
- templates.push(braces);
11006
- i += 2;
11007
- prev = "{";
11008
- return;
11009
- }
11010
- i++;
11011
- }
11012
- blank(start, n);
11013
- };
11014
- while (i < n) {
11015
- const c2 = code[i];
11016
- if (c2 === "/" && code[i + 1] === "/") {
11017
- const end = code.indexOf("\n", i);
11018
- blank(i, end === -1 ? n : end);
11019
- i = end === -1 ? n : end;
11020
- continue;
11021
- }
11022
- if (c2 === "/" && code[i + 1] === "*") {
11023
- const end = code.indexOf("*/", i + 2);
11024
- blank(i, end === -1 ? n : end + 2);
11025
- i = end === -1 ? n : end + 2;
11026
- continue;
11027
- }
11028
- if (c2 === '"' || c2 === "'") {
11029
- let j = i + 1;
11030
- while (j < n && code[j] !== c2 && code[j] !== "\n") j += code[j] === "\\" ? 2 : 1;
11031
- blank(i + 1, Math.min(j, n));
11032
- i = j + 1;
11033
- prev = c2;
11034
- continue;
11035
- }
11036
- if (c2 === "`") {
11037
- i++;
11038
- templateText();
11039
- continue;
11040
- }
11041
- if (c2 === "/" && (prev === "" || "(,=:[!&|?{};+-*%<>~^".includes(prev))) {
11042
- let j = i + 1;
11043
- let inClass = false;
11044
- while (j < n && code[j] !== "\n") {
11045
- const d = code[j];
11046
- if (d === "\\") {
11047
- j += 2;
11048
- continue;
11049
- }
11050
- if (d === "[") inClass = true;
11051
- else if (d === "]") inClass = false;
11052
- else if (d === "/" && !inClass) break;
11053
- j++;
11054
- }
11055
- blank(i + 1, Math.min(j, n));
11056
- i = j + 1;
11057
- prev = ")";
11058
- continue;
11059
- }
11060
- if (c2 === "{") braces++;
11061
- else if (c2 === "}") {
11062
- if (templates.length > 0 && templates[templates.length - 1] === braces) {
11063
- templates.pop();
11064
- i++;
11065
- templateText();
11066
- continue;
11067
- }
11068
- braces--;
11069
- }
11070
- if (!/\s/.test(c2)) prev = /[\w$]/.test(c2) ? "w" : c2;
11071
- i++;
11730
+ function isAllowedBrowserUrl(url) {
11731
+ if (url === "about:blank") return true;
11732
+ try {
11733
+ const { protocol } = new URL(url);
11734
+ return protocol === "http:" || protocol === "https:";
11735
+ } catch {
11736
+ return false;
11072
11737
  }
11073
- return out.join("");
11074
11738
  }
11075
- const TOOL_CALL = /\btools\s*(?:\.\s*[A-Z_$][\w$]*|\[\s*(["'`])\s*\1\s*\])\s*\(/gi;
11076
- const TOOL_REF = /\btools\b/g;
11077
- const SH_CALL = /(?<![\w$.])sh\s*\(/g;
11078
- const SH_REF = /(?<![\w$.])sh\b/g;
11079
- const WORD = /[\w$]/;
11080
- function countOnceCallSites(code) {
11081
- const masked = maskScriptSource(code);
11082
- const sites = /* @__PURE__ */ new Set();
11083
- for (const match of masked.matchAll(TOOL_CALL)) sites.add(match.index);
11084
- if ((masked.match(TOOL_REF)?.length ?? 0) !== sites.size) return void 0;
11085
- const shCalls = [...masked.matchAll(SH_CALL)];
11086
- if ((masked.match(SH_REF)?.length ?? 0) !== shCalls.length) return void 0;
11087
- for (const match of shCalls) sites.add(match.index);
11088
- if (sites.size === 0) return void 0;
11089
- const stack = [];
11090
- let pending = null;
11091
- let nextParen = null;
11092
- const repeating = () => stack.some((scope) => scope.repeats);
11093
- const openBody = () => {
11094
- if (pending === "loopBody") stack.push({
11095
- close: "stmt",
11096
- repeats: true
11097
- });
11098
- else if (pending === "arrowBody") stack.push({
11099
- close: "expr",
11100
- repeats: true
11101
- });
11102
- pending = null;
11103
- };
11104
- const closeTo = (close) => {
11105
- while (stack.length > 0) {
11106
- const scope = stack.pop();
11107
- if (scope.close === close) return scope;
11108
- }
11109
- };
11110
- const popWhile = (closes) => {
11111
- while (stack.length > 0 && closes.includes(stack[stack.length - 1].close)) stack.pop();
11112
- };
11113
- let i = 0;
11114
- const n = masked.length;
11115
- while (i < n) {
11116
- const c2 = masked[i];
11117
- if (/\s/.test(c2)) {
11118
- i++;
11119
- continue;
11120
- }
11121
- if (WORD.test(c2)) {
11122
- let j = i;
11123
- while (j < n && WORD.test(masked[j])) j++;
11124
- const word = masked.slice(i, j);
11125
- openBody();
11126
- if (sites.has(i) && repeating()) return void 0;
11127
- if (word === "for" || word === "while") nextParen = "loop";
11128
- else if (word === "if" || word === "switch" || word === "catch" || word === "with") nextParen = "cond";
11129
- else if (word === "function") nextParen = "fn";
11130
- else if (word === "do") pending = "loopBody";
11131
- i = j;
11132
- continue;
11133
- }
11134
- if (c2 === "=" && masked[i + 1] === ">") {
11135
- pending = "arrowBody";
11136
- i += 2;
11137
- continue;
11138
- }
11139
- if (c2 === "{") {
11140
- const repeats = pending === "loopBody" || pending === "fnBody" || pending === "braceIsFn" || pending === "arrowBody";
11141
- stack.push({
11142
- close: "}",
11143
- repeats
11144
- });
11145
- pending = null;
11146
- i++;
11147
- continue;
11148
- }
11149
- if (c2 === ";") {
11150
- popWhile(["stmt", "expr"]);
11151
- pending = null;
11152
- i++;
11153
- continue;
11154
- }
11155
- if (c2 === ",") {
11156
- popWhile(["expr"]);
11157
- pending = null;
11158
- i++;
11159
- continue;
11160
- }
11161
- if (c2 === ")" || c2 === "]" || c2 === "}") {
11162
- const scope = closeTo(c2);
11163
- pending = null;
11164
- if (c2 === ")" && scope) {
11165
- if (scope.kind === "loop") pending = "loopBody";
11166
- else if (scope.kind === "fn") pending = "fnBody";
11167
- else if (scope.kind === "other") pending = "braceIsFn";
11168
- }
11169
- i++;
11170
- continue;
11171
- }
11172
- openBody();
11173
- if (c2 === "(") {
11174
- stack.push({
11175
- close: ")",
11176
- repeats: false,
11177
- kind: nextParen ?? "other"
11178
- });
11179
- nextParen = null;
11180
- } else if (c2 === "[") stack.push({
11181
- close: "]",
11182
- repeats: false
11183
- });
11184
- i++;
11739
+ function canonical(url) {
11740
+ try {
11741
+ return new URL(url).toString();
11742
+ } catch {
11743
+ return null;
11185
11744
  }
11186
- return sites.size;
11745
+ }
11746
+ function scheduleLabel(schedule) {
11747
+ if (schedule.name) return schedule.name;
11748
+ if (schedule.action.kind === "extension") return `${schedule.action.extensionId}: ${schedule.action.handler}`;
11749
+ const text = schedule.action.text.replace(/\s+/g, " ").trim();
11750
+ return text.length > 48 ? `${text.slice(0, 47)}…` : text;
11751
+ }
11752
+ function scheduleTargetSession(action) {
11753
+ return action.kind === "prompt" && "sessionId" in action ? action.sessionId : void 0;
11187
11754
  }
11188
11755
  const SYNC_CATEGORIES = [
11189
11756
  "settings",
@@ -11259,9 +11826,10 @@ function extensionMark(input) {
11259
11826
  kind: "icon",
11260
11827
  gui: own
11261
11828
  };
11262
- if (native?.brand) return {
11829
+ const brand = input.brand?.trim() || native?.brand;
11830
+ if (brand) return {
11263
11831
  kind: "brand",
11264
- brand: native.brand
11832
+ brand
11265
11833
  };
11266
11834
  const nativeIcon = native?.icon?.gui?.trim();
11267
11835
  if (nativeIcon) return {
@@ -11589,318 +12157,340 @@ async function runBlockOnHost(client, sessionId, request, options = {}) {
11589
12157
  }
11590
12158
  }
11591
12159
  export {
11592
- DIFFS_PANEL_ID as $,
12160
+ daysEndingAt as $,
11593
12161
  APPROVAL_MODE_OPTIONS as A,
11594
- fmtTokens as B,
11595
- parseCommandInvocation as C,
12162
+ ageStep as B,
12163
+ fmtTokens as C,
11596
12164
  DURABILITY_OPTIONS as D,
11597
- findReferences as E,
11598
- GITHUB_ISSUE_PROVIDER_ID as F,
12165
+ parseCommandInvocation as E,
12166
+ findReferences as F,
11599
12167
  GITHUB_PULL_PROVIDER_ID as G,
11600
- githubRefKey as H,
11601
- isFenceClose as I,
11602
- parseFenceOpen as J,
11603
- isShellFence as K,
11604
- nameFromModelId as L,
11605
- hasAnsi as M,
11606
- parseAnsi as N,
12168
+ GITHUB_ISSUE_PROVIDER_ID as H,
12169
+ githubRefKey as I,
12170
+ isFenceClose as J,
12171
+ parseFenceOpen as K,
12172
+ isShellFence as L,
12173
+ MESSAGE_DELIVERY_OPTIONS as M,
12174
+ nameFromModelId as N,
11607
12175
  ONBOARDING_WORDS as O,
11608
- scriptProgressView as P,
11609
- SCRIPT_OUTPUT_TAIL_LINES as Q,
12176
+ hasAnsi as P,
12177
+ parseAnsi as Q,
11610
12178
  RUN_WAITING_LABEL as R,
11611
12179
  SYNC_CATEGORY_INFO as S,
11612
- formatRunDuration as T,
11613
- toolInputCode as U,
11614
- summarizeOutcomes as V,
11615
- computeLineDiff as W,
11616
- heatmapThresholds as X,
11617
- daysEndingAt as Y,
11618
- heatmapLevel as Z,
12180
+ scriptProgressView as T,
12181
+ SCRIPT_OUTPUT_TAIL_LINES as U,
12182
+ formatRunDuration as V,
12183
+ toolInputCode as W,
12184
+ summarizeOutcomes as X,
12185
+ computeLineDiff as Y,
12186
+ heatmapThresholds as Z,
11619
12187
  __vitePreload as _,
11620
12188
  parseBindingSpecs as a,
11621
- NATIVE_EXTENSIONS as a$,
11622
- FILES_PANEL_ID as a0,
11623
- blockRunKey as a1,
11624
- createOutputTail as a2,
11625
- smoothCharsForTick as a3,
11626
- takeChars as a4,
11627
- scriptProgressByCall as a5,
11628
- isUserBashEvent as a6,
11629
- scriptProgressKey as a7,
11630
- formatToolCall as a8,
11631
- displayNameFor as a9,
11632
- resolveSessionSpace as aA,
11633
- isExtensionSpaceId as aB,
11634
- compileQuery as aC,
11635
- renderTemplate as aD,
11636
- readField as aE,
11637
- validateQuery as aF,
11638
- validateGroupBy as aG,
11639
- validateSort as aH,
11640
- viewQuery as aI,
11641
- SessionQueryError as aJ,
11642
- normalizeSpaces as aK,
11643
- activeSpaceOf as aL,
11644
- sessionDirLabel as aM,
11645
- projectNameOf as aN,
11646
- formatCostLabel as aO,
11647
- rememberableChain as aP,
11648
- QUEUE_PANEL_ID as aQ,
11649
- INBOX_PANEL_ID as aR,
11650
- TODOS_PANEL_ID as aS,
11651
- modelDisplayName as aT,
11652
- settingKeywords as aU,
11653
- toggleApplies as aV,
11654
- requirementMet as aW,
11655
- toggleHeldOn as aX,
11656
- bindingAlternatives as aY,
11657
- nativeExtensionByName as aZ,
11658
- extensionMark as a_,
11659
- spawnParents as aa,
11660
- summarizeTools as ab,
11661
- planFold as ac,
11662
- noteLabel as ad,
11663
- thoughtLabel as ae,
11664
- toolOverview as af,
11665
- foldSummary as ag,
11666
- foldsInCompactShape as ah,
11667
- createRunStopMarker as ai,
11668
- mergeTargetIndex as aj,
11669
- finalizeStreamingMarkdown as ak,
11670
- upsertToolProgress as al,
11671
- ownerOf as am,
11672
- appendThinkingLines as an,
11673
- appendMarkdownDelta as ao,
11674
- reconcileEvents as ap,
11675
- retagUserPromptEventsFromRefs as aq,
11676
- finalizeStreamingMarkdownForOwner as ar,
11677
- discardThinking as as,
11678
- parseMachineKind as at,
11679
- orderByMachine as au,
11680
- machineBlockedReason as av,
11681
- inferPromptRefs as aw,
11682
- titleFromText as ax,
11683
- groupRows as ay,
11684
- DEFAULT_SPACE_ID as az,
11685
- SYNC_MODE_LABEL as b,
11686
- stripAnsi as b$,
11687
- DEFAULT_EXTENSION_SOURCE_UNREACHABLE as b0,
11688
- skillCategory as b1,
11689
- skillPickOf as b2,
11690
- RECOMMENDED_SKILL_SOURCES as b3,
11691
- githubPreviewImageUrl as b4,
11692
- githubAvatarUrl as b5,
11693
- DEFAULT_EXTENSION_SOURCE as b6,
11694
- skillTokenWeights as b7,
11695
- formatTokens as b8,
11696
- instructionPreviewLines as b9,
11697
- parseModelSetting as bA,
11698
- DEFAULT_MODEL_PICK as bB,
11699
- estimateReadout as bC,
11700
- formatEstimate as bD,
11701
- previewLine as bE,
11702
- spawnStartParts as bF,
11703
- runStatusKey as bG,
11704
- runFoldStatus as bH,
11705
- RUN_STATUS_TIME_MS as bI,
11706
- formatElapsed as bJ,
11707
- CONTINUE_PROMPT as bK,
11708
- SESSION_EVENT_STATUS_STYLE as bL,
11709
- sessionEventMeta as bM,
11710
- sessionEventExcerpt as bN,
11711
- shortSessionId as bO,
11712
- describeSpawnEnd as bP,
11713
- ATTACHMENT_SNIFF_BYTES as bQ,
11714
- planAttachment as bR,
11715
- formatBytes as bS,
11716
- MAX_IMAGE_ATTACHMENT_BYTES as bT,
11717
- formatCostUsd as bU,
11718
- formatTokenCount as bV,
11719
- formatRunReceiptCells as bW,
11720
- RUN_RECEIPT_SWITCH_GLYPH as bX,
11721
- RUN_RECEIPT_TURN_GLYPH as bY,
11722
- shellBlockPlan as bZ,
11723
- blockTerminalInput as b_,
11724
- instructionOriginBadge as ba,
11725
- filterLogRecords as bb,
11726
- formatLogLine as bc,
11727
- LOG_LEVEL_CYCLE as bd,
11728
- groupSkillPicks as be,
11729
- enabledMcpsWith as bf,
11730
- MCP_KEY_REFUSED_HINT as bg,
11731
- MCP_STATUS_LABEL as bh,
11732
- MCP_TRANSPORTS as bi,
11733
- CONNECTORS as bj,
11734
- connectorInstalled as bk,
11735
- ageString as bl,
11736
- validateMcpForm as bm,
11737
- DEFAULT_OAUTH_ACCOUNT_LABEL as bn,
11738
- providerBrand as bo,
11739
- currentModelKeys as bp,
11740
- customModelTargets as bq,
11741
- modelPickKey as br,
11742
- pickPrimaryKeyed as bs,
11743
- chainAccountConflict as bt,
11744
- positionKeyed as bu,
11745
- toggleKeyed as bv,
11746
- reorderKeyed as bw,
11747
- cacheHintText as bx,
11748
- CACHE_HINT_MIN_TOKENS as by,
11749
- formatModelSetting as bz,
12189
+ modelDisplayName as a$,
12190
+ heatmapLevel as a0,
12191
+ DIFFS_PANEL_ID as a1,
12192
+ FILES_PANEL_ID as a2,
12193
+ blockRunKey as a3,
12194
+ createOutputTail as a4,
12195
+ smoothCharsForTick as a5,
12196
+ takeChars as a6,
12197
+ scriptProgressByCall as a7,
12198
+ isUserBashEvent as a8,
12199
+ scriptProgressKey as a9,
12200
+ machineBlockedReason as aA,
12201
+ inferPromptRefs as aB,
12202
+ titleFromText as aC,
12203
+ groupRows as aD,
12204
+ estimateViewAt as aE,
12205
+ DEFAULT_SPACE_ID as aF,
12206
+ resolveSessionSpace as aG,
12207
+ isExtensionSpaceId as aH,
12208
+ compileQuery as aI,
12209
+ renderTemplate as aJ,
12210
+ readField as aK,
12211
+ validateQuery as aL,
12212
+ validateGroupBy as aM,
12213
+ validateSort as aN,
12214
+ viewQuery as aO,
12215
+ SessionQueryError as aP,
12216
+ normalizeSpaces as aQ,
12217
+ activeSpaceOf as aR,
12218
+ sessionDirLabel as aS,
12219
+ projectNameOf as aT,
12220
+ formatCostLabel as aU,
12221
+ rememberableChain as aV,
12222
+ QUEUE_PANEL_ID as aW,
12223
+ describeTime as aX,
12224
+ REMINDERS_PANEL_ID as aY,
12225
+ INBOX_PANEL_ID as aZ,
12226
+ planProgressLabel as a_,
12227
+ formatToolCall as aa,
12228
+ displayNameFor as ab,
12229
+ spawnParents as ac,
12230
+ summarizeTools as ad,
12231
+ planFold as ae,
12232
+ noteLabel as af,
12233
+ thoughtLabel as ag,
12234
+ toolOverview as ah,
12235
+ foldSummary as ai,
12236
+ foldsInCompactShape as aj,
12237
+ nestedCallShown as ak,
12238
+ createRunStopMarker as al,
12239
+ authProviderKeys as am,
12240
+ sameAuthTarget as an,
12241
+ mergeTargetIndex as ao,
12242
+ finalizeStreamingMarkdown as ap,
12243
+ upsertToolProgress as aq,
12244
+ ownerOf as ar,
12245
+ appendThinkingLines as as,
12246
+ appendMarkdownDelta as at,
12247
+ reconcileEvents as au,
12248
+ retagUserPromptEventsFromRefs as av,
12249
+ finalizeStreamingMarkdownForOwner as aw,
12250
+ discardThinking as ax,
12251
+ parseMachineKind as ay,
12252
+ orderByMachine as az,
12253
+ authFailureHeadline as b,
12254
+ ATTACHMENT_SNIFF_BYTES as b$,
12255
+ settingKeywords as b0,
12256
+ toggleApplies as b1,
12257
+ requirementMet as b2,
12258
+ toggleHeldOn as b3,
12259
+ bindingAlternatives as b4,
12260
+ nativeExtensionByName as b5,
12261
+ extensionMark as b6,
12262
+ NATIVE_EXTENSIONS as b7,
12263
+ DEFAULT_EXTENSION_SOURCE_UNREACHABLE as b8,
12264
+ skillCategory as b9,
12265
+ pickPrimaryKeyed as bA,
12266
+ chainAccountConflict as bB,
12267
+ positionKeyed as bC,
12268
+ toggleKeyed as bD,
12269
+ reorderKeyed as bE,
12270
+ cacheHintText as bF,
12271
+ CACHE_HINT_MIN_TOKENS as bG,
12272
+ formatModelSetting as bH,
12273
+ parseModelSetting as bI,
12274
+ DEFAULT_MODEL_PICK as bJ,
12275
+ isRunEstimated as bK,
12276
+ estimateReadout as bL,
12277
+ formatEstimate as bM,
12278
+ previewLine as bN,
12279
+ spawnStartParts as bO,
12280
+ runStatusKey as bP,
12281
+ runFoldStatus as bQ,
12282
+ RUN_STATUS_TIME_MS as bR,
12283
+ formatElapsed as bS,
12284
+ CONTINUE_PROMPT as bT,
12285
+ authPrimaryAction as bU,
12286
+ authOffersSignInFallback as bV,
12287
+ SESSION_EVENT_STATUS_STYLE as bW,
12288
+ sessionEventMeta as bX,
12289
+ sessionEventExcerpt as bY,
12290
+ shortSessionId as bZ,
12291
+ describeSpawnEnd as b_,
12292
+ skillPickOf as ba,
12293
+ RECOMMENDED_SKILL_SOURCES as bb,
12294
+ githubPreviewImageUrl as bc,
12295
+ githubAvatarUrl as bd,
12296
+ DEFAULT_EXTENSION_SOURCE as be,
12297
+ skillTokenWeights as bf,
12298
+ formatTokens as bg,
12299
+ instructionPreviewLines as bh,
12300
+ instructionOriginBadge as bi,
12301
+ filterLogRecords as bj,
12302
+ formatLogLine as bk,
12303
+ LOG_LEVEL_CYCLE as bl,
12304
+ groupSkillPicks as bm,
12305
+ enabledMcpsWith as bn,
12306
+ MCP_KEY_REFUSED_HINT as bo,
12307
+ MCP_STATUS_LABEL as bp,
12308
+ MCP_TRANSPORTS as bq,
12309
+ CONNECTORS as br,
12310
+ connectorInstalled as bs,
12311
+ ageString as bt,
12312
+ validateMcpForm as bu,
12313
+ DEFAULT_OAUTH_ACCOUNT_LABEL as bv,
12314
+ providerBrand as bw,
12315
+ currentModelKeys as bx,
12316
+ customModelTargets as by,
12317
+ modelPickKey as bz,
11750
12318
  canonicalKeyName as c,
11751
- removeTodo as c$,
11752
- isCacheNotice as c0,
11753
- gatherCommandNotes as c1,
11754
- turnSelectionOwnership as c2,
11755
- runTailActivity as c3,
11756
- transcriptPresetOf as c4,
11757
- transcriptPreset as c5,
11758
- TRANSCRIPT_PRESETS as c6,
11759
- ONBOARDING_PREVIEW_EVENTS as c7,
11760
- autoTextModelId as c8,
11761
- newSpaceId as c9,
11762
- machineSetupCommand as cA,
11763
- clockText as cB,
11764
- machineVersionDiffers as cC,
11765
- clockOrDateText as cD,
11766
- lastSeenText as cE,
11767
- HOST_TOOLS as cF,
11768
- capabilityTags as cG,
11769
- hasTool as cH,
11770
- syncAgo as cI,
11771
- SYNC_MODES as cJ,
11772
- SYNC_CATEGORIES as cK,
11773
- syncMarkerOf as cL,
11774
- settingField as cM,
11775
- panelBadgeText as cN,
11776
- TERMINAL_PANEL_ID as cO,
11777
- tidyPromptText as cP,
11778
- splitPromptSegments as cQ,
11779
- TODO_STATUS_GLYPHS as cR,
11780
- turnAsText as cS,
11781
- modePrefixLength as cT,
11782
- sliceEnd as cU,
11783
- OutputHistory as cV,
11784
- TERMINAL_HISTORY_MAX_CHARS as cW,
11785
- TERMINAL_VIEW_MAX_LINES as cX,
11786
- TERMINAL_VIEW_SCROLLBACK as cY,
11787
- moveTab as cZ,
11788
- cycleTodoStatus as c_,
11789
- sessionBadgeTarget as ca,
11790
- highlightSegments as cb,
11791
- searchHighlightRanges as cc,
11792
- sortRows as cd,
11793
- blendHsl as ce,
11794
- activeSnapshotFor as cf,
11795
- mostConstrainedWindow as cg,
11796
- usageTone as ch,
11797
- formatUsagePercent as ci,
11798
- resetLabel as cj,
11799
- compactingParts as ck,
11800
- chainsEqualKeyed as cl,
11801
- accentColor as cm,
11802
- parseSessionKey as cn,
11803
- EMPTY_RATE as co,
11804
- stepStreamRate as cp,
11805
- streamRateValue as cq,
11806
- retryLabel as cr,
11807
- parseRepoInput as cs,
11808
- LOCAL_HOST_KEY as ct,
11809
- defaultSessionModel as cu,
11810
- defaultSessionKnobs as cv,
11811
- defaultSessionAgent as cw,
11812
- MACHINE_LINK_STATE_TEXT as cx,
11813
- DAEMON_HEALTH_STYLE as cy,
11814
- isValidMachineName as cz,
11815
- createOnboardingRun as d,
11816
- normalizeBrowserUrl as d$,
11817
- clearTodos as d0,
11818
- editTodo as d1,
11819
- buildTodoRetryMessage as d2,
11820
- addTodo as d3,
11821
- formatCount as d4,
11822
- editableTurnText as d5,
11823
- updatedLabel as d6,
11824
- showsAccount as d7,
11825
- formatBalance as d8,
11826
- usageBlockView as d9,
11827
- createChatsCompletionProvider as dA,
11828
- patchInlineGhost as dB,
11829
- createSkillsCompletionProvider as dC,
11830
- uniqueSkillNamesFromReferences as dD,
11831
- buildUnifiedDiff as dE,
11832
- rankPaletteItems as dF,
11833
- groupPaletteRows as dG,
11834
- TRANSCRIPT_PRESET_PALETTE_ID as dH,
11835
- transcriptPresetPalettePicker as dI,
11836
- transcriptPresetOfPaletteItem as dJ,
11837
- transcriptPresetNotice as dK,
11838
- transcriptPresetPaletteItem as dL,
11839
- spaceOfSwitchItem as dM,
11840
- spaceSwitchItems as dN,
11841
- SETUP_PALETTE_ITEM as dO,
11842
- sessionKey as dP,
11843
- LOCAL_HOST_NAME as dQ,
11844
- ARTIFACT_BADGES_MAX as dR,
11845
- spacesEnabled as dS,
11846
- ARTIFACTS_PANEL_ID as dT,
11847
- buildPanelCatalog as dU,
11848
- MEDIA_BY_EXTENSION as dV,
11849
- USAGE_BLOCK_ID as dW,
11850
- nativeExtensionSource as dX,
11851
- connectorServerConfig as dY,
11852
- machineWaiting as dZ,
11853
- SIDE_PANEL_ID as d_,
11854
- usageBlockContent as da,
11855
- settingsSidebar as db,
11856
- settingsSearchIndex as dc,
11857
- isolationLabel as dd,
11858
- LOCAL_SERVER_BRANDS as de,
11859
- connectorById as df,
11860
- onboardingFeatureCopy as dg,
11861
- SETTINGS_CHOICES as dh,
11862
- APPROVAL_MODE_TRADEOFFS as di,
11863
- SETTING_TRADEOFFS as dj,
11864
- connectorsFromImport as dk,
11865
- connectorInputError as dl,
11866
- CONNECTOR_CATEGORIES as dm,
11867
- connectorAuthText as dn,
11868
- NATIVE_EXTENSION_GROUPS as dp,
11869
- nativeExtensionNeedText as dq,
11870
- onboardingFeatures as dr,
11871
- ONBOARDING_FEATURE_GROUPS as ds,
11872
- defaultImportSelection as dt,
11873
- ONBOARDING_AGENT_BRANDS as du,
11874
- onboardingSwitchedFeatures as dv,
11875
- onboardingImportParts as dw,
11876
- mergeSuggestions as dx,
11877
- createCommandsCompletionProvider as dy,
11878
- createFilesCompletionProvider as dz,
11879
- ONBOARDING_STEPS as e,
11880
- BROWSER_PANEL_ID as e0,
11881
- decisionsEnabled as e1,
11882
- countNeighbors as e2,
11883
- selectableTurnIds as e3,
11884
- runBlockOnHost as e4,
11885
- canSkipOnboardingStep as f,
11886
- currentOnboardingStep as g,
11887
- pushPaletteRecent as h,
11888
- SETTINGS_TOGGLES as i,
12319
+ syncMarkerOf as c$,
12320
+ planAttachment as c0,
12321
+ MAX_FILE_ATTACHMENT_BYTES as c1,
12322
+ formatBytes as c2,
12323
+ MAX_IMAGE_ATTACHMENT_BYTES as c3,
12324
+ formatCostUsd as c4,
12325
+ formatTokenCount as c5,
12326
+ formatRunReceiptCells as c6,
12327
+ RUN_RECEIPT_SWITCH_GLYPH as c7,
12328
+ RUN_RECEIPT_TURN_GLYPH as c8,
12329
+ shellBlockPlan as c9,
12330
+ parseSessionKey as cA,
12331
+ EMPTY_RATE as cB,
12332
+ stepStreamRate as cC,
12333
+ streamRateValue as cD,
12334
+ parseWhen as cE,
12335
+ scheduleTargetSession as cF,
12336
+ retryLabel as cG,
12337
+ parseRepoInput as cH,
12338
+ LOCAL_HOST_KEY as cI,
12339
+ defaultSessionModel as cJ,
12340
+ defaultSessionKnobs as cK,
12341
+ defaultSessionAgent as cL,
12342
+ MACHINE_LINK_STATE_TEXT as cM,
12343
+ DAEMON_HEALTH_STYLE as cN,
12344
+ isValidMachineName as cO,
12345
+ machineSetupCommand as cP,
12346
+ clockText as cQ,
12347
+ machineVersionDiffers as cR,
12348
+ clockOrDateText as cS,
12349
+ lastSeenText as cT,
12350
+ HOST_TOOLS as cU,
12351
+ capabilityTags as cV,
12352
+ toolInstall as cW,
12353
+ hasTool as cX,
12354
+ syncAgo as cY,
12355
+ SYNC_MODES as cZ,
12356
+ SYNC_CATEGORIES as c_,
12357
+ blockTerminalInput as ca,
12358
+ stripAnsi as cb,
12359
+ isCacheNotice as cc,
12360
+ gatherCommandNotes as cd,
12361
+ turnSelectionOwnership as ce,
12362
+ runTailActivity as cf,
12363
+ transcriptPresetOf as cg,
12364
+ transcriptPreset as ch,
12365
+ TRANSCRIPT_PRESETS as ci,
12366
+ ONBOARDING_PREVIEW_EVENTS as cj,
12367
+ autoTextModelId as ck,
12368
+ newSpaceId as cl,
12369
+ sessionBadgeTarget as cm,
12370
+ highlightSegments as cn,
12371
+ searchHighlightRanges as co,
12372
+ sortRows as cp,
12373
+ blendHsl as cq,
12374
+ activeSnapshotFor as cr,
12375
+ mostConstrainedWindow as cs,
12376
+ usageTone as ct,
12377
+ formatUsagePercent as cu,
12378
+ resetLabel as cv,
12379
+ compactingParts as cw,
12380
+ otherDelivery as cx,
12381
+ chainsEqualKeyed as cy,
12382
+ accentColor as cz,
12383
+ SYNC_MODE_LABEL as d,
12384
+ rankPaletteItems as d$,
12385
+ settingField as d0,
12386
+ panelBadgeText as d1,
12387
+ TERMINAL_PANEL_ID as d2,
12388
+ SECRET_TTLS as d3,
12389
+ DEFAULT_SECRET_TTL as d4,
12390
+ isSecretAnswer as d5,
12391
+ isSecretReference as d6,
12392
+ tidyPromptText as d7,
12393
+ splitPromptSegments as d8,
12394
+ SECRETS_PANEL_ID as d9,
12395
+ LOCAL_SERVER_BRANDS as dA,
12396
+ connectorById as dB,
12397
+ onboardingFeatureCopy as dC,
12398
+ SETTINGS_CHOICES as dD,
12399
+ APPROVAL_MODE_TRADEOFFS as dE,
12400
+ SETTING_TRADEOFFS as dF,
12401
+ connectorsFromImport as dG,
12402
+ connectorInputError as dH,
12403
+ CONNECTOR_CATEGORIES as dI,
12404
+ connectorAuthText as dJ,
12405
+ MESSAGE_DELIVERY_TRADEOFFS as dK,
12406
+ NATIVE_EXTENSION_GROUPS as dL,
12407
+ nativeExtensionNeedText as dM,
12408
+ onboardingFeatures as dN,
12409
+ ONBOARDING_FEATURE_GROUPS as dO,
12410
+ defaultImportSelection as dP,
12411
+ ONBOARDING_AGENT_BRANDS as dQ,
12412
+ onboardingSwitchedFeatures as dR,
12413
+ onboardingImportParts as dS,
12414
+ mergeSuggestions as dT,
12415
+ createCommandsCompletionProvider as dU,
12416
+ createFilesCompletionProvider as dV,
12417
+ createChatsCompletionProvider as dW,
12418
+ patchInlineGhost as dX,
12419
+ createSkillsCompletionProvider as dY,
12420
+ uniqueSkillNamesFromReferences as dZ,
12421
+ buildUnifiedDiff as d_,
12422
+ turnAsText as da,
12423
+ modePrefixLength as db,
12424
+ sliceEnd as dc,
12425
+ OutputHistory as dd,
12426
+ TERMINAL_HISTORY_MAX_CHARS as de,
12427
+ TERMINAL_VIEW_MAX_LINES as df,
12428
+ TERMINAL_VIEW_SCROLLBACK as dg,
12429
+ moveTab as dh,
12430
+ SESSION_SCOPE as di,
12431
+ planProgress as dj,
12432
+ buildStepRetryMessage as dk,
12433
+ buildPlanResumeMessage as dl,
12434
+ isSecretName as dm,
12435
+ scheduleLabel as dn,
12436
+ describeTrigger as dp,
12437
+ formatCount as dq,
12438
+ editableTurnText as dr,
12439
+ updatedLabel as ds,
12440
+ showsAccount as dt,
12441
+ formatBalance as du,
12442
+ usageBlockView as dv,
12443
+ usageBlockContent as dw,
12444
+ settingsSidebar as dx,
12445
+ settingsSearchIndex as dy,
12446
+ isolationLabel as dz,
12447
+ createOnboardingRun as e,
12448
+ groupPaletteRows as e0,
12449
+ TRANSCRIPT_PRESET_PALETTE_ID as e1,
12450
+ transcriptPresetPalettePicker as e2,
12451
+ transcriptPresetOfPaletteItem as e3,
12452
+ transcriptPresetNotice as e4,
12453
+ transcriptPresetPaletteItem as e5,
12454
+ spaceOfSwitchItem as e6,
12455
+ spaceSwitchItems as e7,
12456
+ SETUP_PALETTE_ITEM as e8,
12457
+ sessionKey as e9,
12458
+ LOCAL_HOST_NAME as ea,
12459
+ ARTIFACT_BADGES_MAX as eb,
12460
+ spacesEnabled as ec,
12461
+ ARTIFACTS_PANEL_ID as ed,
12462
+ buildPanelCatalog as ee,
12463
+ MEDIA_BY_EXTENSION as ef,
12464
+ USAGE_BLOCK_ID as eg,
12465
+ nativeExtensionSource as eh,
12466
+ connectorServerConfig as ei,
12467
+ machineWaiting as ej,
12468
+ SIDE_PANEL_ID as ek,
12469
+ normalizeBrowserUrl as el,
12470
+ BROWSER_PANEL_ID as em,
12471
+ decisionsEnabled as en,
12472
+ countNeighbors as eo,
12473
+ selectableTurnIds as ep,
12474
+ runBlockOnHost as eq,
12475
+ ONBOARDING_STEPS as f,
12476
+ canSkipOnboardingStep as g,
12477
+ currentOnboardingStep as h,
12478
+ pushPaletteRecent as i,
11889
12479
  joinNames as j,
11890
- DEFAULT_SETTINGS as k,
12480
+ SETTINGS_TOGGLES as k,
11891
12481
  lentServerMachines as l,
11892
12482
  modelConcern as m,
11893
- pickTab as n,
11894
- openForAttention as o,
12483
+ DEFAULT_SETTINGS as n,
12484
+ pickTab as o,
11895
12485
  parseBindingSpec as p,
11896
- openProactive as q,
12486
+ openForAttention as q,
11897
12487
  runRetryingLabel as r,
11898
- cycleTab as s,
11899
- closePanel as t,
11900
- togglePanel as u,
11901
- mergeBadgeMenu as v,
12488
+ openProactive as s,
12489
+ cycleTab as t,
12490
+ closePanel as u,
12491
+ togglePanel as v,
11902
12492
  builtinBadgeActions as w,
11903
- builtinBadgeEffect as x,
11904
- isBadgeColor as y,
11905
- ageStep as z
12493
+ mergeBadgeMenu as x,
12494
+ builtinBadgeEffect as y,
12495
+ isBadgeColor as z
11906
12496
  };