flavor-code 1.4.2 → 1.4.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +28 -1
  2. package/README.zh-CN.md +28 -1
  3. package/dist/{app-4CUS3GEJ.js → app-G35YBHPR.js} +593 -536
  4. package/dist/apply-WOW3QU5I.js +51 -0
  5. package/dist/broker-cli-X5H46FZV.js +15 -0
  6. package/dist/check-CSKTV4O2.js +16 -0
  7. package/dist/chunk-3563SW4X.js +10513 -0
  8. package/dist/chunk-3UX2CGDW.js +1955 -0
  9. package/dist/chunk-4TMLXZVZ.js +75 -0
  10. package/dist/chunk-6F66UXBI.js +48 -0
  11. package/dist/{chunk-KMBDK4SN.js → chunk-6URQ7FIF.js} +24 -88
  12. package/dist/chunk-6X62CGMA.js +193 -0
  13. package/dist/chunk-7Y64WNBB.js +8930 -0
  14. package/dist/chunk-AA4QNKTF.js +501 -0
  15. package/dist/chunk-BDX777JR.js +11 -0
  16. package/dist/chunk-CVP5OUHD.js +103 -0
  17. package/dist/chunk-EWD7FWTH.js +14547 -0
  18. package/dist/chunk-FAJ6YDZK.js +630 -0
  19. package/dist/{chunk-N5MXHJKD.js → chunk-GTFP2R5I.js} +1 -1
  20. package/dist/{chunk-7YFHRORG.js → chunk-HGTCIHWA.js} +383 -172
  21. package/dist/chunk-IDJAHEG6.js +43501 -0
  22. package/dist/chunk-IQEEFDEE.js +389 -0
  23. package/dist/chunk-IU3UBETC.js +30 -0
  24. package/dist/chunk-K7UGGWJV.js +1003 -0
  25. package/dist/chunk-KRWWCVXA.js +74 -0
  26. package/dist/chunk-OKHV7CTB.js +482 -0
  27. package/dist/chunk-PULWAH6E.js +474 -0
  28. package/dist/chunk-PZ5NKRVA.js +85 -0
  29. package/dist/chunk-RBAZLFKB.js +1022 -0
  30. package/dist/chunk-RV3EXUXM.js +30 -0
  31. package/dist/chunk-SJUIIHIA.js +2130 -0
  32. package/dist/{chunk-W2TIY6JY.js → chunk-T6RE76D2.js} +1993 -493
  33. package/dist/chunk-TIEOVQW6.js +61 -0
  34. package/dist/chunk-WLZUAVVU.js +15 -0
  35. package/dist/chunk-X442CJJH.js +114 -0
  36. package/dist/{chunk-RAYH6K2H.js → chunk-Y7EH4NVO.js} +1 -1
  37. package/dist/{chunk-S32JRDZK.js → chunk-ZKKVSR37.js} +6 -1
  38. package/dist/{claude-ink-VQU3C5UL.js → claude-ink-BE56DB6N.js} +9 -4
  39. package/dist/cli-3MF6EL2H.js +163 -0
  40. package/dist/cli-main.js +3805 -473
  41. package/dist/cli.js +50 -4
  42. package/dist/config/load.d.ts +8 -0
  43. package/dist/config/schema.d.ts +11 -0
  44. package/dist/context/manager.d.ts +2 -0
  45. package/dist/desktop/main.js +4299 -1150
  46. package/dist/desktop/preload.cjs +30 -0
  47. package/dist/desktop-renderer/assets/index-BWklSoOO.css +1 -0
  48. package/dist/desktop-renderer/assets/index-DCqIrF1S.js +153 -0
  49. package/dist/desktop-renderer/assets/{interactive-terminal-ouQQ3brz.js → interactive-terminal-B6GbpzIn.js} +1 -1
  50. package/dist/desktop-renderer/index.html +2 -2
  51. package/dist/doctor-OHCGK52S.js +20 -0
  52. package/dist/load-QK6CMLDF.js +25 -0
  53. package/dist/log-ATFIPRNU.js +19 -0
  54. package/dist/manager-5SI4MPES.js +191 -0
  55. package/dist/models/anthropic.d.ts +3 -0
  56. package/dist/node-LOIXT44J.js +879 -0
  57. package/dist/plugin-worker-entry.js +1 -1
  58. package/dist/production-6DIZ6YLQ.js +46 -0
  59. package/dist/production.d.ts +28 -1
  60. package/dist/project-3QXE22TG.js +11 -0
  61. package/dist/react-M6JGXSJZ.js +7 -0
  62. package/dist/recorder-FAGJJH3N.js +11 -0
  63. package/dist/sdk/index.js +30 -8
  64. package/dist/server-2KLKPHPL.js +11 -0
  65. package/dist/session/store.d.ts +1 -0
  66. package/dist/store-ZIHN6363.js +18 -0
  67. package/dist/usage-summary-G5FBOJLK.js +13 -0
  68. package/dist/write-stream-CGD57URC.js +77 -0
  69. package/package.json +1 -1
  70. package/dist/chunk-B23V72YR.js +0 -170
  71. package/dist/chunk-QKND3FX7.js +0 -26103
  72. package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +0 -1
  73. package/dist/desktop-renderer/assets/index-CPXrzFgv.js +0 -154
  74. package/dist/load-UPOG3XQR.js +0 -19
@@ -1,27 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
3
- import {
4
- statusPresentation
5
- } from "./chunk-RAYH6K2H.js";
6
- import {
7
- COMMAND_DESCRIPTIONS,
8
- MVP_COMMANDS,
9
- charWidth,
10
- checkForUpdate,
11
- createGlobTool,
12
- createProductionRuntime,
13
- createTranscriptState,
14
- isDestructiveTool,
15
- message,
16
- modelContentTranscriptText,
17
- packageVersion,
18
- redactErrorText,
19
- thinkingWindow,
20
- transcriptReducer,
21
- withTimeout
22
- } from "./chunk-QKND3FX7.js";
23
- import "./chunk-N5MXHJKD.js";
24
- import "./chunk-7YFHRORG.js";
2
+ import { createRequire as createFlavorRequire } from "node:module"; const require = createFlavorRequire(import.meta.url);
25
3
  import {
26
4
  Box_default,
27
5
  ClockContext,
@@ -33,37 +11,96 @@ import {
33
11
  Text,
34
12
  instances_default,
35
13
  osc,
14
+ require_jsx_runtime,
36
15
  shiftAnchor,
37
16
  stringWidth,
38
17
  stripAnsi,
39
18
  useStdout,
40
19
  use_app_default,
41
20
  use_input_default
42
- } from "./chunk-W2TIY6JY.js";
21
+ } from "./chunk-T6RE76D2.js";
22
+ import {
23
+ require_react
24
+ } from "./chunk-PULWAH6E.js";
25
+ import {
26
+ statusPresentation
27
+ } from "./chunk-Y7EH4NVO.js";
28
+ import {
29
+ source_default
30
+ } from "./chunk-AA4QNKTF.js";
31
+ import {
32
+ COMMAND_DESCRIPTIONS,
33
+ MVP_COMMANDS,
34
+ createGlobTool,
35
+ createProductionRuntime,
36
+ isDestructiveTool
37
+ } from "./chunk-IDJAHEG6.js";
43
38
  import {
44
- execFileNoThrow,
45
39
  getGraphemeSegmenter
46
- } from "./chunk-B23V72YR.js";
47
- import "./chunk-S32JRDZK.js";
40
+ } from "./chunk-TIEOVQW6.js";
41
+ import "./chunk-OKHV7CTB.js";
42
+ import "./chunk-K7UGGWJV.js";
43
+ import {
44
+ execFileNoThrow
45
+ } from "./chunk-IU3UBETC.js";
46
+ import "./chunk-PZ5NKRVA.js";
47
+ import {
48
+ checkForUpdate
49
+ } from "./chunk-6F66UXBI.js";
50
+ import "./chunk-3UX2CGDW.js";
51
+ import {
52
+ k
53
+ } from "./chunk-7Y64WNBB.js";
54
+ import "./chunk-CVP5OUHD.js";
55
+ import "./chunk-3563SW4X.js";
56
+ import "./chunk-RBAZLFKB.js";
57
+ import "./chunk-FAJ6YDZK.js";
58
+ import {
59
+ redactErrorText
60
+ } from "./chunk-WLZUAVVU.js";
61
+ import {
62
+ packageVersion
63
+ } from "./chunk-RV3EXUXM.js";
64
+ import "./chunk-IQEEFDEE.js";
65
+ import "./chunk-GTFP2R5I.js";
66
+ import "./chunk-HGTCIHWA.js";
67
+ import {
68
+ charWidth,
69
+ createTranscriptState,
70
+ modelContentTranscriptText,
71
+ thinkingWindow,
72
+ transcriptReducer,
73
+ withTimeout
74
+ } from "./chunk-SJUIIHIA.js";
75
+ import {
76
+ message
77
+ } from "./chunk-BDX777JR.js";
78
+ import "./chunk-6X62CGMA.js";
79
+ import "./chunk-EWD7FWTH.js";
80
+ import "./chunk-KRWWCVXA.js";
81
+ import "./chunk-X442CJJH.js";
82
+ import {
83
+ __toESM
84
+ } from "./chunk-ZKKVSR37.js";
48
85
 
49
86
  // src/ui/app.tsx
87
+ var import_react8 = __toESM(require_react(), 1);
50
88
  import { basename as basename3 } from "path";
51
89
  import { homedir } from "os";
52
- import React4, { useEffect as useEffect3, useMemo as useMemo3, useReducer, useRef as useRef4, useState as useState2 } from "react";
53
90
 
54
91
  // src/claude-ink/hooks/use-animation-frame.ts
55
- import { useContext as useContext2, useEffect, useState } from "react";
92
+ var import_react2 = __toESM(require_react(), 1);
56
93
 
57
94
  // src/claude-ink/hooks/use-terminal-viewport.ts
58
- import { useCallback, useContext, useLayoutEffect, useRef } from "react";
95
+ var import_react = __toESM(require_react(), 1);
59
96
  function useTerminalViewport() {
60
- const terminalSize = useContext(TerminalSizeContext);
61
- const elementRef = useRef(null);
62
- const entryRef = useRef({ isVisible: true });
63
- const setElement = useCallback((el) => {
97
+ const terminalSize = (0, import_react.useContext)(TerminalSizeContext);
98
+ const elementRef = (0, import_react.useRef)(null);
99
+ const entryRef = (0, import_react.useRef)({ isVisible: true });
100
+ const setElement = (0, import_react.useCallback)((el) => {
64
101
  elementRef.current = el;
65
102
  }, []);
66
- useLayoutEffect(() => {
103
+ (0, import_react.useLayoutEffect)(() => {
67
104
  const element = elementRef.current;
68
105
  if (!element?.yogaNode || !terminalSize) {
69
106
  return;
@@ -96,11 +133,11 @@ function useTerminalViewport() {
96
133
 
97
134
  // src/claude-ink/hooks/use-animation-frame.ts
98
135
  function useAnimationFrame(intervalMs = 16) {
99
- const clock = useContext2(ClockContext);
136
+ const clock = (0, import_react2.useContext)(ClockContext);
100
137
  const [viewportRef, { isVisible }] = useTerminalViewport();
101
- const [time, setTime] = useState(() => clock?.now() ?? 0);
138
+ const [time, setTime] = (0, import_react2.useState)(() => clock?.now() ?? 0);
102
139
  const active = isVisible && intervalMs !== null;
103
- useEffect(() => {
140
+ (0, import_react2.useEffect)(() => {
104
141
  if (!clock || !active) return;
105
142
  let lastUpdate = clock.now();
106
143
  const onChange = () => {
@@ -116,11 +153,11 @@ function useAnimationFrame(intervalMs = 16) {
116
153
  }
117
154
 
118
155
  // src/claude-ink/hooks/use-selection.ts
119
- import { useContext as useContext3, useMemo, useSyncExternalStore } from "react";
156
+ var import_react3 = __toESM(require_react(), 1);
120
157
  function useSelection() {
121
- useContext3(StdinContext_default);
158
+ (0, import_react3.useContext)(StdinContext_default);
122
159
  const ink = instances_default.get(process.stdout);
123
- return useMemo(() => {
160
+ return (0, import_react3.useMemo)(() => {
124
161
  if (!ink) {
125
162
  return {
126
163
  copySelection: () => "",
@@ -160,10 +197,10 @@ function useSelection() {
160
197
  }
161
198
 
162
199
  // src/claude-ink/hooks/use-terminal-title.ts
163
- import { useContext as useContext4, useEffect as useEffect2 } from "react";
200
+ var import_react4 = __toESM(require_react(), 1);
164
201
  function useTerminalTitle(title) {
165
- const writeRaw = useContext4(TerminalWriteContext);
166
- useEffect2(() => {
202
+ const writeRaw = (0, import_react4.useContext)(TerminalWriteContext);
203
+ (0, import_react4.useEffect)(() => {
167
204
  if (title === null || !writeRaw) return;
168
205
  const clean = stripAnsi(title);
169
206
  writeRaw(osc(OSC.SET_TITLE_AND_ICON, clean));
@@ -171,22 +208,19 @@ function useTerminalTitle(title) {
171
208
  }
172
209
 
173
210
  // src/ui/assistant-text.tsx
174
- import React2 from "react";
211
+ var import_react6 = __toESM(require_react(), 1);
175
212
 
176
213
  // src/ui/markdown.tsx
177
- import React, { useMemo as useMemo2, useRef as useRef2 } from "react";
178
- import chalk2 from "chalk";
179
- import { marked } from "marked";
214
+ var import_react5 = __toESM(require_react(), 1);
180
215
 
181
216
  // src/ui/highlight.ts
182
- import chalk from "chalk";
183
- chalk.level = Math.max(chalk.level, 3);
184
- var KEYWORD = chalk.hex("#c586c0");
185
- var STRING = chalk.hex("#ce9178");
186
- var COMMENT = chalk.gray.italic;
187
- var NUMBER = chalk.hex("#b5cea8");
188
- var FUNCTION = chalk.hex("#dcdcaa");
189
- var ATTRIBUTE = chalk.hex("#d7ba7d");
217
+ source_default.level = Math.max(source_default.level, 3);
218
+ var KEYWORD = source_default.hex("#c586c0");
219
+ var STRING = source_default.hex("#ce9178");
220
+ var COMMENT = source_default.gray.italic;
221
+ var NUMBER = source_default.hex("#b5cea8");
222
+ var FUNCTION = source_default.hex("#dcdcaa");
223
+ var ATTRIBUTE = source_default.hex("#d7ba7d");
190
224
  var KEYWORDS = {
191
225
  javascript: /* @__PURE__ */ new Set([
192
226
  "await",
@@ -613,7 +647,7 @@ function highlightCode(source, language = void 0) {
613
647
  }
614
648
 
615
649
  // src/ui/markdown.tsx
616
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
650
+ var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
617
651
  var CODE_BLOCK_BORDER = {
618
652
  top: "\u2500",
619
653
  bottom: "\u2500",
@@ -625,12 +659,12 @@ var CODE_BLOCK_BORDER = {
625
659
  bottomRight: "\u256F"
626
660
  };
627
661
  function MarkdownViewInner({ text }) {
628
- const stablePrefixRef = useRef2("");
662
+ const stablePrefixRef = (0, import_react5.useRef)("");
629
663
  if (!text.startsWith(stablePrefixRef.current)) stablePrefixRef.current = "";
630
664
  const boundary = stablePrefixRef.current.length;
631
- const suffixTokens = useMemo2(() => {
665
+ const suffixTokens = (0, import_react5.useMemo)(() => {
632
666
  try {
633
- return marked.lexer(text.substring(boundary), { gfm: true, async: false });
667
+ return k.lexer(text.substring(boundary), { gfm: true, async: false });
634
668
  } catch {
635
669
  return [];
636
670
  }
@@ -642,68 +676,68 @@ function MarkdownViewInner({ text }) {
642
676
  if (advance > 0) stablePrefixRef.current = text.substring(0, boundary + advance);
643
677
  const stablePrefix = stablePrefixRef.current;
644
678
  const unstableSuffix = text.substring(stablePrefix.length);
645
- return /* @__PURE__ */ jsxs(Box_default, { flexDirection: "column", width: "100%", children: [
646
- stablePrefix.length > 0 ? /* @__PURE__ */ jsx(MarkdownSegment, { text: stablePrefix }) : null,
647
- unstableSuffix.length > 0 ? /* @__PURE__ */ jsx(MarkdownSegment, { text: unstableSuffix }) : null
679
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
680
+ stablePrefix.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MarkdownSegment, { text: stablePrefix }) : null,
681
+ unstableSuffix.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MarkdownSegment, { text: unstableSuffix }) : null
648
682
  ] });
649
683
  }
650
- var MarkdownSegment = React.memo(function MarkdownSegment2({ text }) {
651
- const tokens = useMemo2(() => {
684
+ var MarkdownSegment = import_react5.default.memo(function MarkdownSegment2({ text }) {
685
+ const tokens = (0, import_react5.useMemo)(() => {
652
686
  try {
653
- return marked.lexer(text, { gfm: true, async: false });
687
+ return k.lexer(text, { gfm: true, async: false });
654
688
  } catch {
655
689
  return [];
656
690
  }
657
691
  }, [text]);
658
- return /* @__PURE__ */ jsx(Fragment, { children: tokens.map((token, index) => /* @__PURE__ */ jsx(BlockToken, { token }, index)) });
692
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: tokens.map((token, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BlockToken, { token }, index)) });
659
693
  });
660
- var MarkdownView = React.memo(MarkdownViewInner);
661
- var BlockToken = React.memo(function BlockToken2({ token }) {
694
+ var MarkdownView = import_react5.default.memo(MarkdownViewInner);
695
+ var BlockToken = import_react5.default.memo(function BlockToken2({ token }) {
662
696
  switch (token.type) {
663
697
  case "space":
664
- return /* @__PURE__ */ jsx(Box_default, { height: 1 });
698
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { height: 1 });
665
699
  case "heading":
666
- return /* @__PURE__ */ jsx(HeadingView, { token });
700
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeadingView, { token });
667
701
  case "paragraph":
668
- return /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsx(InlineTokens, { tokens: token.tokens ?? [] }) });
702
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InlineTokens, { tokens: token.tokens ?? [] }) });
669
703
  case "code":
670
- return /* @__PURE__ */ jsx(CodeBlock, { token });
704
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CodeBlock, { token });
671
705
  case "blockquote":
672
- return /* @__PURE__ */ jsx(BlockquoteView, { token });
706
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BlockquoteView, { token });
673
707
  case "list":
674
- return /* @__PURE__ */ jsx(ListView, { token });
708
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListView, { token });
675
709
  case "hr":
676
- return /* @__PURE__ */ jsx(HrView, {});
710
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HrView, {});
677
711
  case "table":
678
- return /* @__PURE__ */ jsx(TableView, { token });
712
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableView, { token });
679
713
  case "html":
680
- return /* @__PURE__ */ jsx(Text, { dimColor: true, children: "[html]" });
714
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { dimColor: true, children: "[html]" });
681
715
  default:
682
716
  if ("text" in token && typeof token.text === "string") {
683
- return /* @__PURE__ */ jsx(Text, { children: token.text });
717
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: token.text });
684
718
  }
685
719
  return null;
686
720
  }
687
721
  });
688
722
  function HeadingView({ token }) {
689
- const styled = useMemo2(() => {
723
+ const styled = (0, import_react5.useMemo)(() => {
690
724
  const inner = renderInlineText(token.tokens);
691
725
  switch (token.depth) {
692
726
  case 1:
693
- return chalk2.bold.hex("#7dd3fc")(inner);
727
+ return source_default.bold.hex("#7dd3fc")(inner);
694
728
  case 2:
695
- return chalk2.bold.hex("#67e8f9")(inner);
729
+ return source_default.bold.hex("#67e8f9")(inner);
696
730
  case 3:
697
- return chalk2.bold.hex("#93c5fd")(inner);
731
+ return source_default.bold.hex("#93c5fd")(inner);
698
732
  default:
699
- return chalk2.italic.hex("#93c5fd")(inner);
733
+ return source_default.italic.hex("#93c5fd")(inner);
700
734
  }
701
735
  }, [token.depth, token.tokens]);
702
- return /* @__PURE__ */ jsx(Text, { children: styled });
736
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: styled });
703
737
  }
704
738
  function CodeBlock({ token }) {
705
- const styledSource = useMemo2(() => highlightCode(token.text, token.lang), [token.text, token.lang]);
706
- const lines = useMemo2(() => styledSource.split("\n"), [styledSource]);
739
+ const styledSource = (0, import_react5.useMemo)(() => highlightCode(token.text, token.lang), [token.text, token.lang]);
740
+ const lines = (0, import_react5.useMemo)(() => styledSource.split("\n"), [styledSource]);
707
741
  const langLabel = token.lang?.trim();
708
742
  const label = langLabel && langLabel.length > 0 ? langLabel : "code";
709
743
  return (
@@ -712,7 +746,7 @@ function CodeBlock({ token }) {
712
746
  // resizes can change that width without changing this memoized token.
713
747
  // Building a line from process.stdout.columns overflows those narrower
714
748
  // parents and desynchronizes the terminal's physical auto-wrap cursor.
715
- /* @__PURE__ */ jsx(
749
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
716
750
  Box_default,
717
751
  {
718
752
  flexDirection: "column",
@@ -722,28 +756,28 @@ function CodeBlock({ token }) {
722
756
  borderColor: "gray",
723
757
  borderText: { content: ` ${label} `, position: "top", align: "start", offset: 1 },
724
758
  opaque: true,
725
- children: /* @__PURE__ */ jsx(Box_default, { flexDirection: "column", paddingX: 1, children: lines.map((line, i) => /* @__PURE__ */ jsx(Text, { color: "gray", wrap: "truncate-end", children: line.length > 0 ? line : " " }, i)) })
759
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { flexDirection: "column", paddingX: 1, children: lines.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "gray", wrap: "truncate-end", children: line.length > 0 ? line : " " }, i)) })
726
760
  }
727
761
  )
728
762
  );
729
763
  }
730
764
  function BlockquoteView({ token }) {
731
- return /* @__PURE__ */ jsx(Box_default, { flexDirection: "column", children: token.tokens.map((child, i) => {
765
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { flexDirection: "column", children: token.tokens.map((child, i) => {
732
766
  const inline = "tokens" in child ? child.tokens ?? [] : [];
733
- return /* @__PURE__ */ jsxs(Text, { children: [
734
- /* @__PURE__ */ jsx(Text, { color: "gray", children: "\u2502 " }),
735
- /* @__PURE__ */ jsx(InlineTokens, { tokens: inline })
767
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [
768
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "gray", children: "\u2502 " }),
769
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InlineTokens, { tokens: inline })
736
770
  ] }, i);
737
771
  }) });
738
772
  }
739
773
  function HrView() {
740
774
  const { stdout } = useStdout();
741
775
  const width = Math.max(8, (stdout?.columns ?? 80) - 4);
742
- return /* @__PURE__ */ jsx(Text, { color: "gray", children: "\u2500".repeat(width) });
776
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "gray", children: "\u2500".repeat(width) });
743
777
  }
744
778
  function ListView({ token }) {
745
779
  const start = typeof token.start === "number" ? token.start : 1;
746
- return /* @__PURE__ */ jsx(Box_default, { flexDirection: "column", children: token.items.map((item, i) => /* @__PURE__ */ jsx(ListItemView, { item, index: start + i, ordered: token.ordered }, i)) });
780
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { flexDirection: "column", children: token.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListItemView, { item, index: start + i, ordered: token.ordered }, i)) });
747
781
  }
748
782
  function ListItemView({
749
783
  item,
@@ -769,28 +803,28 @@ function ListItemView({
769
803
  blockTokens.push(child);
770
804
  }
771
805
  }
772
- return /* @__PURE__ */ jsxs(Box_default, { flexDirection: "column", children: [
773
- /* @__PURE__ */ jsxs(Text, { children: [
774
- /* @__PURE__ */ jsxs(Text, { color: "cyan", children: [
806
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", children: [
807
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [
808
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { color: "cyan", children: [
775
809
  bullet,
776
810
  " "
777
811
  ] }),
778
812
  inlineTokens.map((child, i) => {
779
813
  if (child.type === "paragraph") {
780
- return /* @__PURE__ */ jsx(InlineTokens, { tokens: child.tokens ?? [] }, i);
814
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InlineTokens, { tokens: child.tokens ?? [] }, i);
781
815
  }
782
816
  const tokens = child.tokens ?? [];
783
- return tokens.length > 0 ? /* @__PURE__ */ jsx(InlineTokens, { tokens }, i) : /* @__PURE__ */ jsx(Text, { children: child.text }, i);
817
+ return tokens.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InlineTokens, { tokens }, i) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: child.text }, i);
784
818
  })
785
819
  ] }),
786
- blockTokens.map((child, i) => /* @__PURE__ */ jsx(Box_default, { marginLeft: 2, children: /* @__PURE__ */ jsx(BlockToken, { token: child }) }, i))
820
+ blockTokens.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BlockToken, { token: child }) }, i))
787
821
  ] });
788
822
  }
789
823
  function TableView({ token }) {
790
824
  const { stdout } = useStdout();
791
825
  const maxWidth = stdout?.columns ?? 80;
792
826
  const colCount = token.header.length;
793
- if (colCount === 0) return /* @__PURE__ */ jsx(Text, { dimColor: true, children: "[empty table]" });
827
+ if (colCount === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { dimColor: true, children: "[empty table]" });
794
828
  const colWidth = Math.max(8, Math.floor((maxWidth - colCount * 3) / colCount));
795
829
  const pad = (value, w, align) => {
796
830
  const stripped = stripAnsi2(value);
@@ -812,33 +846,33 @@ function TableView({ token }) {
812
846
  if (align === "center") return ":" + "\u2500".repeat(colWidth - 2) + ":";
813
847
  return "\u2500".repeat(colWidth);
814
848
  });
815
- return /* @__PURE__ */ jsxs(Box_default, { flexDirection: "column", children: [
816
- /* @__PURE__ */ jsx(Text, { children: token.header.map((cell, i) => pad(cell.text, colWidth, cell.align ?? "left")).join(" \u2502 ") }),
817
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: separator.join(" \u2502 ") }),
818
- token.rows.map((row, ri) => /* @__PURE__ */ jsx(Text, { children: row.map((cell, i) => pad(cell.text, colWidth, token.header[i]?.align ?? "left")).join(" \u2502 ") }, ri))
849
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", children: [
850
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: token.header.map((cell, i) => pad(cell.text, colWidth, cell.align ?? "left")).join(" \u2502 ") }),
851
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { dimColor: true, children: separator.join(" \u2502 ") }),
852
+ token.rows.map((row, ri) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: row.map((cell, i) => pad(cell.text, colWidth, token.header[i]?.align ?? "left")).join(" \u2502 ") }, ri))
819
853
  ] });
820
854
  }
821
855
  function InlineTokens({ tokens }) {
822
- return /* @__PURE__ */ jsx(Text, { children: tokens.map((token, i) => /* @__PURE__ */ jsx(InlineToken, { token }, i)) });
856
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: tokens.map((token, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InlineToken, { token }, i)) });
823
857
  }
824
858
  function InlineToken({ token }) {
825
859
  switch (token.type) {
826
860
  case "text":
827
- return /* @__PURE__ */ jsx(Text, { children: token.raw ?? token.text });
861
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: token.raw ?? token.text });
828
862
  case "strong":
829
- return /* @__PURE__ */ jsx(Text, { bold: true, children: renderInlineText(token.tokens) });
863
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { bold: true, children: renderInlineText(token.tokens) });
830
864
  case "em":
831
- return /* @__PURE__ */ jsx(Text, { italic: true, children: renderInlineText(token.tokens) });
865
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { italic: true, children: renderInlineText(token.tokens) });
832
866
  case "del":
833
- return /* @__PURE__ */ jsx(Text, { strikethrough: true, children: renderInlineText(token.tokens) });
867
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { strikethrough: true, children: renderInlineText(token.tokens) });
834
868
  case "codespan":
835
- return /* @__PURE__ */ jsx(Text, { color: "black", backgroundColor: "gray", children: token.text });
869
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "black", backgroundColor: "gray", children: token.text });
836
870
  case "link": {
837
871
  const link = token;
838
872
  const inner = renderInlineText(link.tokens);
839
- return /* @__PURE__ */ jsxs(Text, { children: [
873
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [
840
874
  inner,
841
- /* @__PURE__ */ jsxs(Text, { dimColor: true, color: "blue", children: [
875
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, color: "blue", children: [
842
876
  " (",
843
877
  link.href,
844
878
  ")"
@@ -847,21 +881,21 @@ function InlineToken({ token }) {
847
881
  }
848
882
  case "image": {
849
883
  const img = token;
850
- return /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
884
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
851
885
  "[image: ",
852
886
  img.text,
853
887
  "]"
854
888
  ] });
855
889
  }
856
890
  case "br":
857
- return /* @__PURE__ */ jsx(Text, { children: "\n" });
891
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: "\n" });
858
892
  case "escape":
859
- return /* @__PURE__ */ jsx(Text, { children: token.text });
893
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: token.text });
860
894
  case "html":
861
895
  return null;
862
896
  default:
863
897
  if ("text" in token && typeof token.text === "string") {
864
- return /* @__PURE__ */ jsx(Text, { children: token.text });
898
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: token.text });
865
899
  }
866
900
  return null;
867
901
  }
@@ -882,13 +916,13 @@ function inlineTokenToString(token) {
882
916
  case "text":
883
917
  return token.raw ?? token.text;
884
918
  case "strong":
885
- return chalk2.bold(renderInlineText(token.tokens));
919
+ return source_default.bold(renderInlineText(token.tokens));
886
920
  case "em":
887
- return chalk2.italic(renderInlineText(token.tokens));
921
+ return source_default.italic(renderInlineText(token.tokens));
888
922
  case "del":
889
- return chalk2.strikethrough(renderInlineText(token.tokens));
923
+ return source_default.strikethrough(renderInlineText(token.tokens));
890
924
  case "codespan":
891
- return chalk2.bgGray.black(` ${token.text} `);
925
+ return source_default.bgGray.black(` ${token.text} `);
892
926
  case "escape":
893
927
  return token.text;
894
928
  case "br":
@@ -896,7 +930,7 @@ function inlineTokenToString(token) {
896
930
  case "link": {
897
931
  const link = token;
898
932
  const inner = renderInlineText(link.tokens);
899
- return `${inner} ${chalk2.blue.underline.dim(`(${link.href})`)}`;
933
+ return `${inner} ${source_default.blue.underline.dim(`(${link.href})`)}`;
900
934
  }
901
935
  default:
902
936
  if ("text" in token && typeof token.text === "string") return token.text;
@@ -905,11 +939,11 @@ function inlineTokenToString(token) {
905
939
  }
906
940
 
907
941
  // src/ui/assistant-text.tsx
908
- import { jsx as jsx2 } from "react/jsx-runtime";
942
+ var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
909
943
  function AssistantTextInner({ text }) {
910
- return /* @__PURE__ */ jsx2(MarkdownView, { text });
944
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MarkdownView, { text });
911
945
  }
912
- var AssistantText = React2.memo(AssistantTextInner);
946
+ var AssistantText = import_react6.default.memo(AssistantTextInner);
913
947
 
914
948
  // src/ui/signals.ts
915
949
  function createSessionInterruptHandler(getSession, shutdown, options) {
@@ -970,8 +1004,8 @@ function wrapPromptInput(input, codePointCursor, options) {
970
1004
  }
971
1005
 
972
1006
  // src/ui/task-progress.tsx
973
- import { useRef as useRef3 } from "react";
974
- import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
1007
+ var import_react7 = __toESM(require_react(), 1);
1008
+ var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
975
1009
  function TaskStatusLine({
976
1010
  block,
977
1011
  interactive,
@@ -983,8 +1017,8 @@ function TaskStatusLine({
983
1017
  const { stdout } = useStdout();
984
1018
  const foreground = interactive && (block.activity === "model" || block.task?.role === "main");
985
1019
  const [ref, time] = useAnimationFrame(running && foreground ? 120 : null);
986
- const startedAt = useRef3(void 0);
987
- const previousState = useRef3(block.state);
1020
+ const startedAt = (0, import_react7.useRef)(void 0);
1021
+ const previousState = (0, import_react7.useRef)(block.state);
988
1022
  if (running && (startedAt.current === void 0 || previousState.current !== "running")) startedAt.current = time;
989
1023
  if (!running) startedAt.current = void 0;
990
1024
  previousState.current = block.state;
@@ -1005,7 +1039,7 @@ function TaskStatusLine({
1005
1039
  }
1006
1040
  const thinking = block.thinkingText;
1007
1041
  const thinkingVisible = running && block.activity === "model" && thinking !== void 0 && thinking.length > 0;
1008
- const thinkingScroll = useRef3({ start: 0, lastTime: time });
1042
+ const thinkingScroll = (0, import_react7.useRef)({ start: 0, lastTime: time });
1009
1043
  if (!thinkingVisible) {
1010
1044
  thinkingScroll.current = { start: 0, lastTime: time };
1011
1045
  }
@@ -1030,28 +1064,28 @@ function TaskStatusLine({
1030
1064
  ...metaLabel === void 0 ? [] : [{ text: ` ${metaLabel}`, color: metaColor ?? "ansi:blackBright" }]
1031
1065
  ];
1032
1066
  const boundedText = textWidth === void 0 || maxTextLines === void 0 ? void 0 : limitTaskTextSegments(textSegments, textWidth, maxTextLines).segments;
1033
- return /* @__PURE__ */ jsxs2(Box_default, { flexDirection: "column", width: "100%", children: [
1034
- /* @__PURE__ */ jsx3(Box_default, { ref, flexDirection: "row", width: "100%", children: boundedText === void 0 ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
1035
- /* @__PURE__ */ jsxs2(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: [
1067
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
1068
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box_default, { ref, flexDirection: "row", width: "100%", children: boundedText === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1069
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: [
1036
1070
  presentation.glyph,
1037
1071
  " "
1038
1072
  ] }),
1039
- badge ? /* @__PURE__ */ jsxs2(Text, { color: badgeColor, children: [
1073
+ badge ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text, { color: badgeColor, children: [
1040
1074
  badge,
1041
1075
  " "
1042
1076
  ] }) : null,
1043
- /* @__PURE__ */ jsx3(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: before }),
1044
- statusLabel !== void 0 ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
1045
- /* @__PURE__ */ jsx3(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: " \xB7 " }),
1046
- /* @__PURE__ */ jsx3(Text, { color: statusColor ?? presentation.color, children: statusLabel })
1077
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: before }),
1078
+ statusLabel !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1079
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: " \xB7 " }),
1080
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: statusColor ?? presentation.color, children: statusLabel })
1047
1081
  ] }) : null,
1048
- after ? /* @__PURE__ */ jsx3(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: after }) : null,
1049
- metaLabel === void 0 ? null : /* @__PURE__ */ jsxs2(Text, { color: metaColor ?? "ansi:blackBright", children: [
1082
+ after ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: after }) : null,
1083
+ metaLabel === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text, { color: metaColor ?? "ansi:blackBright", children: [
1050
1084
  " ",
1051
1085
  metaLabel
1052
1086
  ] })
1053
- ] }) : /* @__PURE__ */ jsx3(Text, { children: boundedText.map((segment, index) => /* @__PURE__ */ jsx3(Text, { ...segment.color === void 0 ? {} : { color: segment.color }, children: segment.text }, index)) }) }),
1054
- thinkingLine === void 0 ? null : /* @__PURE__ */ jsx3(ThinkingLineView, { text: thinkingLine })
1087
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { children: boundedText.map((segment, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { ...segment.color === void 0 ? {} : { color: segment.color }, children: segment.text }, index)) }) }),
1088
+ thinkingLine === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ThinkingLineView, { text: thinkingLine })
1055
1089
  ] });
1056
1090
  }
1057
1091
  function limitTaskTextSegments(segments, width, maxLines = 3) {
@@ -1116,9 +1150,9 @@ function limitTaskTextSegments(segments, width, maxLines = 3) {
1116
1150
  var THINKING_RAIL = "#416f84";
1117
1151
  var THINKING_TEXT = "#91a0a8";
1118
1152
  function ThinkingLineView({ text }) {
1119
- return /* @__PURE__ */ jsxs2(Box_default, { flexDirection: "row", children: [
1120
- /* @__PURE__ */ jsx3(Text, { color: THINKING_RAIL, children: "\u2502 " }),
1121
- /* @__PURE__ */ jsx3(Text, { color: THINKING_TEXT, wrap: "truncate-end", children: text })
1153
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box_default, { flexDirection: "row", children: [
1154
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: THINKING_RAIL, children: "\u2502 " }),
1155
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: THINKING_TEXT, wrap: "truncate-end", children: text })
1122
1156
  ] });
1123
1157
  }
1124
1158
  var SPLIT_TRACK_MIN_COLUMNS = 96;
@@ -1142,7 +1176,7 @@ function TaskProgressPanel({
1142
1176
  const hoverProps = (track) => ({
1143
1177
  onMouseEnter: () => onHoverChange?.(track)
1144
1178
  });
1145
- return /* @__PURE__ */ jsx3(
1179
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1146
1180
  Box_default,
1147
1181
  {
1148
1182
  flexDirection: "column",
@@ -1150,7 +1184,7 @@ function TaskProgressPanel({
1150
1184
  width: "100%",
1151
1185
  maxHeight,
1152
1186
  onMouseLeave: () => onHoverChange?.(null),
1153
- children: split ? /* @__PURE__ */ jsx3(
1187
+ children: split ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1154
1188
  SplitTracks,
1155
1189
  {
1156
1190
  taskBlocks,
@@ -1162,7 +1196,7 @@ function TaskProgressPanel({
1162
1196
  subagentScrollRef,
1163
1197
  hoverProps
1164
1198
  }
1165
- ) : hasTasks && hasSubagents ? /* @__PURE__ */ jsx3(
1199
+ ) : hasTasks && hasSubagents ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1166
1200
  StackedTracks,
1167
1201
  {
1168
1202
  taskBlocks,
@@ -1174,7 +1208,7 @@ function TaskProgressPanel({
1174
1208
  subagentScrollRef,
1175
1209
  hoverProps
1176
1210
  }
1177
- ) : /* @__PURE__ */ jsx3(
1211
+ ) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1178
1212
  SingleTrack,
1179
1213
  {
1180
1214
  role: hasTasks ? "main" : "subagent",
@@ -1203,14 +1237,14 @@ function SplitTracks({
1203
1237
  const availableWidth = columns - SPLIT_TRACK_GUTTER_COLUMNS;
1204
1238
  const leftWidth = Math.max(1, Math.floor(availableWidth * SPLIT_TRACK_MAIN_RATIO));
1205
1239
  const rightWidth = Math.max(1, availableWidth - leftWidth);
1206
- return /* @__PURE__ */ jsxs2(Fragment2, { children: [
1207
- /* @__PURE__ */ jsxs2(Box_default, { flexDirection: "row", width: "100%", children: [
1208
- /* @__PURE__ */ jsx3(Box_default, { width: leftWidth, ...hoverProps("main"), children: /* @__PURE__ */ jsx3(TrackHeader, { role: "main", count: taskBlocks.length, width: leftWidth }) }),
1209
- /* @__PURE__ */ jsx3(Text, { color: "ansi:white", children: "\u2500\u252C\u2500" }),
1210
- /* @__PURE__ */ jsx3(Box_default, { width: rightWidth, ...hoverProps("subagent"), children: /* @__PURE__ */ jsx3(TrackHeader, { role: "subagent", count: subagentBlocks.length, width: rightWidth }) })
1240
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1241
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box_default, { flexDirection: "row", width: "100%", children: [
1242
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box_default, { width: leftWidth, ...hoverProps("main"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TrackHeader, { role: "main", count: taskBlocks.length, width: leftWidth }) }),
1243
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: "ansi:white", children: "\u2500\u252C\u2500" }),
1244
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box_default, { width: rightWidth, ...hoverProps("subagent"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TrackHeader, { role: "subagent", count: subagentBlocks.length, width: rightWidth }) })
1211
1245
  ] }),
1212
- contentHeight <= 0 ? null : /* @__PURE__ */ jsxs2(Box_default, { flexDirection: "row", width: "100%", height: contentHeight, children: [
1213
- /* @__PURE__ */ jsx3(Box_default, { width: leftWidth, minWidth: 0, flexDirection: "column", ...hoverProps("main"), children: /* @__PURE__ */ jsx3(
1246
+ contentHeight <= 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box_default, { flexDirection: "row", width: "100%", height: contentHeight, children: [
1247
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box_default, { width: leftWidth, minWidth: 0, flexDirection: "column", ...hoverProps("main"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1214
1248
  TrackScrollBox,
1215
1249
  {
1216
1250
  ref: mainScrollRef,
@@ -1221,8 +1255,8 @@ function SplitTracks({
1221
1255
  maxTextLines: 2
1222
1256
  }
1223
1257
  ) }),
1224
- /* @__PURE__ */ jsx3(TrackDivider, { height: contentHeight }),
1225
- /* @__PURE__ */ jsx3(Box_default, { width: rightWidth, minWidth: 0, flexDirection: "column", ...hoverProps("subagent"), children: /* @__PURE__ */ jsx3(
1258
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TrackDivider, { height: contentHeight }),
1259
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box_default, { width: rightWidth, minWidth: 0, flexDirection: "column", ...hoverProps("subagent"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1226
1260
  TrackScrollBox,
1227
1261
  {
1228
1262
  ref: subagentScrollRef,
@@ -1247,12 +1281,12 @@ function StackedTracks({
1247
1281
  hoverProps
1248
1282
  }) {
1249
1283
  if (height <= 1) {
1250
- return /* @__PURE__ */ jsx3(Box_default, { ...hoverProps("main"), children: /* @__PURE__ */ jsx3(TrackHeader, { role: "main", count: taskBlocks.length, width: columns }) });
1284
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box_default, { ...hoverProps("main"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TrackHeader, { role: "main", count: taskBlocks.length, width: columns }) });
1251
1285
  }
1252
1286
  const mainHeight = Math.ceil(height / 2);
1253
1287
  const subagentHeight = Math.floor(height / 2);
1254
- return /* @__PURE__ */ jsxs2(Fragment2, { children: [
1255
- /* @__PURE__ */ jsx3(
1288
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1289
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1256
1290
  SingleTrack,
1257
1291
  {
1258
1292
  role: "main",
@@ -1264,7 +1298,7 @@ function StackedTracks({
1264
1298
  hoverProps
1265
1299
  }
1266
1300
  ),
1267
- /* @__PURE__ */ jsx3(
1301
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1268
1302
  SingleTrack,
1269
1303
  {
1270
1304
  role: "subagent",
@@ -1288,9 +1322,9 @@ function SingleTrack({
1288
1322
  hoverProps
1289
1323
  }) {
1290
1324
  const contentHeight = Math.max(0, height - 1);
1291
- return /* @__PURE__ */ jsxs2(Box_default, { flexDirection: "column", width: "100%", height, ...hoverProps(role), children: [
1292
- /* @__PURE__ */ jsx3(TrackHeader, { role, count: blocks.length, width }),
1293
- contentHeight <= 0 ? null : /* @__PURE__ */ jsx3(
1325
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box_default, { flexDirection: "column", width: "100%", height, ...hoverProps(role), children: [
1326
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TrackHeader, { role, count: blocks.length, width }),
1327
+ contentHeight <= 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1294
1328
  TrackScrollBox,
1295
1329
  {
1296
1330
  ref: scrollRef,
@@ -1311,7 +1345,7 @@ function TrackScrollBox({
1311
1345
  width,
1312
1346
  maxTextLines
1313
1347
  }) {
1314
- return /* @__PURE__ */ jsx3(
1348
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1315
1349
  ScrollBox_default,
1316
1350
  {
1317
1351
  ...ref === void 0 ? {} : { ref },
@@ -1321,7 +1355,7 @@ function TrackScrollBox({
1321
1355
  height,
1322
1356
  maxHeight: height,
1323
1357
  paddingX: 1,
1324
- children: blocks.map((block) => /* @__PURE__ */ jsx3(
1358
+ children: blocks.map((block) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1325
1359
  TaskStatusLine,
1326
1360
  {
1327
1361
  block,
@@ -1339,10 +1373,10 @@ function TrackHeader({ role, count, width }) {
1339
1373
  const label = role === "main" ? `task plan (${count})` : `subagents (${count})`;
1340
1374
  const prefix = `\u2500\u2500 ${label} `;
1341
1375
  const line = prefix.length >= width ? prefix.slice(0, Math.max(0, width)) : `${prefix}${"\u2500".repeat(width - prefix.length)}`;
1342
- return /* @__PURE__ */ jsx3(Text, { color: "ansi:white", wrap: "truncate-end", children: line });
1376
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: "ansi:white", wrap: "truncate-end", children: line });
1343
1377
  }
1344
1378
  function TrackDivider({ height }) {
1345
- return /* @__PURE__ */ jsx3(Box_default, { flexDirection: "column", width: SPLIT_TRACK_GUTTER_COLUMNS, flexShrink: 0, children: Array.from({ length: height }, (_, index) => /* @__PURE__ */ jsx3(Text, { color: "ansi:white", children: " \u2502 " }, index)) });
1379
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box_default, { flexDirection: "column", width: SPLIT_TRACK_GUTTER_COLUMNS, flexShrink: 0, children: Array.from({ length: height }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: "ansi:white", children: " \u2502 " }, index)) });
1346
1380
  }
1347
1381
 
1348
1382
  // src/ui/file-diff-style.ts
@@ -1590,7 +1624,7 @@ function comparePaths(left, right) {
1590
1624
  }
1591
1625
 
1592
1626
  // src/ui/welcome.tsx
1593
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1627
+ var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
1594
1628
  var WIDE_WELCOME_COLUMNS = 72;
1595
1629
  var FLAVOR_ACCENT = "#67D4FF";
1596
1630
  var FLAVOR_WORDMARK = [
@@ -1606,7 +1640,7 @@ function WelcomeCard({
1606
1640
  columns
1607
1641
  }) {
1608
1642
  const wide = Math.max(1, Math.floor(columns)) >= WIDE_WELCOME_COLUMNS;
1609
- const updateHint = updateTo === void 0 ? null : /* @__PURE__ */ jsxs3(Text, { color: "yellowBright", wrap: "wrap", children: [
1643
+ const updateHint = updateTo === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: "yellowBright", wrap: "wrap", children: [
1610
1644
  "\u25B2 ",
1611
1645
  "Update available: v",
1612
1646
  packageVersion(),
@@ -1616,8 +1650,8 @@ function WelcomeCard({
1616
1650
  updateTo,
1617
1651
  "\nRun: flavor update"
1618
1652
  ] });
1619
- return /* @__PURE__ */ jsx4(Box_default, { width: "100%", borderStyle: "round", borderColor: "yellow", paddingX: 1, children: wide ? /* @__PURE__ */ jsxs3(Box_default, { width: "100%", flexDirection: "row", children: [
1620
- /* @__PURE__ */ jsxs3(
1653
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { width: "100%", borderStyle: "round", borderColor: "yellow", paddingX: 1, children: wide ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { width: "100%", flexDirection: "row", children: [
1654
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1621
1655
  Box_default,
1622
1656
  {
1623
1657
  width: "36%",
@@ -1630,55 +1664,55 @@ function WelcomeCard({
1630
1664
  borderColor: "yellow",
1631
1665
  paddingRight: 1,
1632
1666
  children: [
1633
- /* @__PURE__ */ jsx4(Text, { bold: true, color: "yellowBright", children: "Welcome back!" }),
1634
- /* @__PURE__ */ jsx4(Text, { color: FLAVOR_ACCENT, children: FLAVOR_WORDMARK }),
1635
- serviceName === void 0 ? null : /* @__PURE__ */ jsx4(Text, { color: "cyan", wrap: "truncate-end", children: serviceName }),
1636
- /* @__PURE__ */ jsx4(Text, { dimColor: true, wrap: "truncate-end", children: model }),
1637
- /* @__PURE__ */ jsx4(Text, { dimColor: true, wrap: "truncate-end", children: workspaceName }),
1638
- /* @__PURE__ */ jsxs3(Text, { dimColor: true, wrap: "truncate-end", children: [
1667
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { bold: true, color: "yellowBright", children: "Welcome back!" }),
1668
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: FLAVOR_ACCENT, children: FLAVOR_WORDMARK }),
1669
+ serviceName === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "cyan", wrap: "truncate-end", children: serviceName }),
1670
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: model }),
1671
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: workspaceName }),
1672
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
1639
1673
  "v",
1640
1674
  packageVersion()
1641
1675
  ] })
1642
1676
  ]
1643
1677
  }
1644
1678
  ),
1645
- /* @__PURE__ */ jsxs3(Box_default, { flexGrow: 1, flexDirection: "column", paddingLeft: 1, children: [
1646
- /* @__PURE__ */ jsx4(Text, { bold: true, color: "yellowBright", children: "Tips for getting started" }),
1647
- /* @__PURE__ */ jsxs3(Text, { children: [
1679
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { flexGrow: 1, flexDirection: "column", paddingLeft: 1, children: [
1680
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { bold: true, color: "yellowBright", children: "Tips for getting started" }),
1681
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { children: [
1648
1682
  "Run ",
1649
- /* @__PURE__ */ jsx4(Text, { color: "cyan", children: "/init" }),
1683
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "cyan", children: "/init" }),
1650
1684
  " to create or refresh FLAVOR.md"
1651
1685
  ] }),
1652
- /* @__PURE__ */ jsxs3(Text, { children: [
1686
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { children: [
1653
1687
  "Type ",
1654
- /* @__PURE__ */ jsx4(Text, { color: "cyan", children: "@" }),
1688
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "cyan", children: "@" }),
1655
1689
  " to attach a project file"
1656
1690
  ] }),
1657
- /* @__PURE__ */ jsx4(Box_default, { height: 1 }),
1658
- /* @__PURE__ */ jsx4(Text, { bold: true, color: "yellowBright", children: "Quick commands" }),
1659
- /* @__PURE__ */ jsxs3(Text, { children: [
1660
- /* @__PURE__ */ jsx4(Text, { color: "cyan", children: "/help" }),
1691
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { height: 1 }),
1692
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { bold: true, color: "yellowBright", children: "Quick commands" }),
1693
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { children: [
1694
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "cyan", children: "/help" }),
1661
1695
  " \xB7 ",
1662
- /* @__PURE__ */ jsx4(Text, { color: "cyan", children: "/config" }),
1696
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "cyan", children: "/config" }),
1663
1697
  " \xB7 ",
1664
- /* @__PURE__ */ jsx4(Text, { color: "cyan", children: "/tasks" })
1698
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "cyan", children: "/tasks" })
1665
1699
  ] }),
1666
1700
  updateHint
1667
1701
  ] })
1668
- ] }) : /* @__PURE__ */ jsxs3(Box_default, { width: "100%", flexDirection: "column", children: [
1669
- /* @__PURE__ */ jsx4(Text, { bold: true, color: FLAVOR_ACCENT, children: "\u25C6 Flavor Code" }),
1670
- /* @__PURE__ */ jsx4(Text, { children: "Welcome back!" }),
1671
- /* @__PURE__ */ jsxs3(Text, { dimColor: true, wrap: "truncate-end", children: [
1702
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { width: "100%", flexDirection: "column", children: [
1703
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { bold: true, color: FLAVOR_ACCENT, children: "\u25C6 Flavor Code" }),
1704
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { children: "Welcome back!" }),
1705
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
1672
1706
  model,
1673
1707
  " \xB7 ",
1674
1708
  workspaceName,
1675
1709
  " \xB7 v",
1676
1710
  packageVersion()
1677
1711
  ] }),
1678
- /* @__PURE__ */ jsxs3(Text, { children: [
1679
- /* @__PURE__ */ jsx4(Text, { color: "cyan", children: "/init" }),
1712
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { children: [
1713
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "cyan", children: "/init" }),
1680
1714
  " setup \xB7 ",
1681
- /* @__PURE__ */ jsx4(Text, { color: "cyan", children: "/help" }),
1715
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "cyan", children: "/help" }),
1682
1716
  " commands"
1683
1717
  ] }),
1684
1718
  updateHint
@@ -2014,7 +2048,7 @@ var PromptHistoryStore = class {
2014
2048
  };
2015
2049
 
2016
2050
  // src/ui/app.tsx
2017
- import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
2051
+ var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
2018
2052
  var HISTORY_CAP = 200;
2019
2053
  var CLIPBOARD_SHORTCUT_FALLBACK_MS = 300;
2020
2054
  var BUILTIN_SLASH_CANDIDATES = MVP_COMMANDS.map((name) => ({ name, description: COMMAND_DESCRIPTIONS[name] }));
@@ -2241,65 +2275,65 @@ function appRuntimeOptions(props, output, onApprovalChange) {
2241
2275
  onToolsChange: onApprovalChange
2242
2276
  };
2243
2277
  }
2244
- function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2278
+ function App({ workspace, home, resumeSession, instanceId, palAlias, onSessionEnd }) {
2245
2279
  const { exit } = use_app_default();
2246
2280
  const { stdout } = useStdout();
2247
- const [runtime, setRuntime] = useState2();
2248
- const [input, setInput] = useState2("");
2249
- const [pastedBlocks, setPastedBlocks] = useState2([]);
2250
- const [imageAttachments, setImageAttachments] = useState2([]);
2251
- const [clipboardNotice, setClipboardNotice] = useState2();
2252
- const [history, setHistory] = useState2([]);
2253
- const [historyCursor, setHistoryCursor] = useState2(0);
2254
- const [approvalExpanded, setApprovalExpanded] = useState2(false);
2255
- const [expandedOutput, setExpandedOutput] = useState2(false);
2256
- const [promptCursor, setPromptCursor] = useState2(0);
2257
- const [slashCandidates, setSlashCandidates] = useState2(
2281
+ const [runtime, setRuntime] = (0, import_react8.useState)();
2282
+ const [input, setInput] = (0, import_react8.useState)("");
2283
+ const [pastedBlocks, setPastedBlocks] = (0, import_react8.useState)([]);
2284
+ const [imageAttachments, setImageAttachments] = (0, import_react8.useState)([]);
2285
+ const [clipboardNotice, setClipboardNotice] = (0, import_react8.useState)();
2286
+ const [history, setHistory] = (0, import_react8.useState)([]);
2287
+ const [historyCursor, setHistoryCursor] = (0, import_react8.useState)(0);
2288
+ const [approvalExpanded, setApprovalExpanded] = (0, import_react8.useState)(false);
2289
+ const [expandedOutput, setExpandedOutput] = (0, import_react8.useState)(false);
2290
+ const [promptCursor, setPromptCursor] = (0, import_react8.useState)(0);
2291
+ const [slashCandidates, setSlashCandidates] = (0, import_react8.useState)(
2258
2292
  () => buildSlashCandidates(BUILTIN_SLASH_CANDIDATES, [], [])
2259
2293
  );
2260
- const [slashSelection, setSlashSelection] = useState2(0);
2261
- const [dismissedSlashInput, setDismissedSlashInput] = useState2();
2262
- const [mentionCandidates, setMentionCandidates] = useState2([]);
2263
- const [mentionSelection, setMentionSelection] = useState2(0);
2264
- const [dismissedMentionInput, setDismissedMentionInput] = useState2();
2265
- const [pendingPrompts, setPendingPrompts] = useState2([]);
2266
- const [revision, setRevision] = useState2(0);
2267
- const [ideContext, setIdeContext] = useState2();
2268
- const [questionIndex, setQuestionIndex] = useState2(0);
2269
- const [questionAnswers, setQuestionAnswers] = useState2({});
2270
- const [customQuestionActive, setCustomQuestionActive] = useState2(false);
2271
- const [columns, setColumns] = useState2(stdout?.columns ?? 80);
2272
- const [rows, setRows] = useState2(stdout?.rows ?? 24);
2273
- const [updateTo, setUpdateTo] = useState2();
2274
- const [transcript, dispatch] = useReducer(transcriptReducer, void 0, createTranscriptState);
2275
- const scrollRef = useRef4(null);
2276
- const mainTaskScrollRef = useRef4(null);
2277
- const subagentTaskScrollRef = useRef4(null);
2278
- const hoveredTaskTrack = useRef4(null);
2279
- const runtimeRef = useRef4(void 0);
2280
- const pendingPromptRef = useRef4(void 0);
2294
+ const [slashSelection, setSlashSelection] = (0, import_react8.useState)(0);
2295
+ const [dismissedSlashInput, setDismissedSlashInput] = (0, import_react8.useState)();
2296
+ const [mentionCandidates, setMentionCandidates] = (0, import_react8.useState)([]);
2297
+ const [mentionSelection, setMentionSelection] = (0, import_react8.useState)(0);
2298
+ const [dismissedMentionInput, setDismissedMentionInput] = (0, import_react8.useState)();
2299
+ const [pendingPrompts, setPendingPrompts] = (0, import_react8.useState)([]);
2300
+ const [revision, setRevision] = (0, import_react8.useState)(0);
2301
+ const [ideContext, setIdeContext] = (0, import_react8.useState)();
2302
+ const [questionIndex, setQuestionIndex] = (0, import_react8.useState)(0);
2303
+ const [questionAnswers, setQuestionAnswers] = (0, import_react8.useState)({});
2304
+ const [customQuestionActive, setCustomQuestionActive] = (0, import_react8.useState)(false);
2305
+ const [columns, setColumns] = (0, import_react8.useState)(stdout?.columns ?? 80);
2306
+ const [rows, setRows] = (0, import_react8.useState)(stdout?.rows ?? 24);
2307
+ const [updateTo, setUpdateTo] = (0, import_react8.useState)();
2308
+ const [transcript, dispatch] = (0, import_react8.useReducer)(transcriptReducer, void 0, createTranscriptState);
2309
+ const scrollRef = (0, import_react8.useRef)(null);
2310
+ const mainTaskScrollRef = (0, import_react8.useRef)(null);
2311
+ const subagentTaskScrollRef = (0, import_react8.useRef)(null);
2312
+ const hoveredTaskTrack = (0, import_react8.useRef)(null);
2313
+ const runtimeRef = (0, import_react8.useRef)(void 0);
2314
+ const pendingPromptRef = (0, import_react8.useRef)(void 0);
2281
2315
  pendingPromptRef.current ??= new PendingPromptQueue();
2282
- const closing = useRef4(false);
2283
- const clipboardBusy = useRef4(false);
2284
- const clipboardFallbackTimer = useRef4(null);
2285
- const terminalTextPasteRevision = useRef4(0);
2286
- const textBuf = useRef4({ pending: "", timer: null });
2287
- const thinkingBuf = useRef4({ pending: "", timer: null });
2288
- const promptDraftRef = useRef4({
2316
+ const closing = (0, import_react8.useRef)(false);
2317
+ const clipboardBusy = (0, import_react8.useRef)(false);
2318
+ const clipboardFallbackTimer = (0, import_react8.useRef)(null);
2319
+ const terminalTextPasteRevision = (0, import_react8.useRef)(0);
2320
+ const textBuf = (0, import_react8.useRef)({ pending: "", timer: null });
2321
+ const thinkingBuf = (0, import_react8.useRef)({ pending: "", timer: null });
2322
+ const promptDraftRef = (0, import_react8.useRef)({
2289
2323
  text: input,
2290
2324
  cursor: promptCursor,
2291
2325
  pastedBlocks,
2292
2326
  imageAttachments
2293
2327
  });
2294
- const promptEditHistory = useRef4(new PromptEditHistory());
2295
- const historyRef = useRef4([]);
2296
- const historyCursorRef = useRef4(0);
2297
- const historyDraftRef = useRef4(void 0);
2298
- const reverseSearchRef = useRef4(void 0);
2299
- const promptHistoryStoreRef = useRef4(void 0);
2328
+ const promptEditHistory = (0, import_react8.useRef)(new PromptEditHistory());
2329
+ const historyRef = (0, import_react8.useRef)([]);
2330
+ const historyCursorRef = (0, import_react8.useRef)(0);
2331
+ const historyDraftRef = (0, import_react8.useRef)(void 0);
2332
+ const reverseSearchRef = (0, import_react8.useRef)(void 0);
2333
+ const promptHistoryStoreRef = (0, import_react8.useRef)(void 0);
2300
2334
  promptHistoryStoreRef.current ??= new PromptHistoryStore({ home: home ?? homedir(), workspace, maxEntries: HISTORY_CAP });
2301
2335
  promptDraftRef.current = { text: input, cursor: promptCursor, pastedBlocks, imageAttachments };
2302
- useEffect3(() => () => {
2336
+ (0, import_react8.useEffect)(() => () => {
2303
2337
  if (clipboardFallbackTimer.current !== null) clearTimeout(clipboardFallbackTimer.current);
2304
2338
  }, []);
2305
2339
  const commitPromptDraft = (next, recordHistory = true) => {
@@ -2318,7 +2352,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2318
2352
  if (next.imageAttachments !== void 0) setImageAttachments(next.imageAttachments);
2319
2353
  };
2320
2354
  useTerminalTitle("Flavor Code");
2321
- useEffect3(() => {
2355
+ (0, import_react8.useEffect)(() => {
2322
2356
  let disposed = false;
2323
2357
  void promptHistoryStoreRef.current.load().then((entries) => {
2324
2358
  if (disposed) return;
@@ -2363,18 +2397,18 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2363
2397
  closing.current = true;
2364
2398
  await shutdownRuntime(active, exit, (error) => {
2365
2399
  dispatch({ type: "submit-error", message: error });
2366
- });
2400
+ }, { ...onSessionEnd === void 0 ? {} : { onSessionEnd } });
2367
2401
  };
2368
- const shutdownRef = useRef4(shutdown);
2402
+ const shutdownRef = (0, import_react8.useRef)(shutdown);
2369
2403
  shutdownRef.current = shutdown;
2370
- const interruptRef = useRef4(void 0);
2404
+ const interruptRef = (0, import_react8.useRef)(void 0);
2371
2405
  interruptRef.current ??= createSessionInterruptHandler(
2372
2406
  () => runtimeRef.current?.session,
2373
2407
  () => shutdownRef.current(runtimeRef.current),
2374
2408
  { forceExit: () => process.exit(1) }
2375
2409
  );
2376
2410
  const interrupt = interruptRef.current;
2377
- useEffect3(() => {
2411
+ (0, import_react8.useEffect)(() => {
2378
2412
  let disposed = false;
2379
2413
  const FLUSH_MS = 100;
2380
2414
  const receive = (event) => {
@@ -2447,7 +2481,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2447
2481
  `));
2448
2482
  };
2449
2483
  }, [workspace, home, resumeSession, instanceId, palAlias]);
2450
- useEffect3(() => {
2484
+ (0, import_react8.useEffect)(() => {
2451
2485
  if (runtime === void 0) return;
2452
2486
  let disposed = false;
2453
2487
  void runtime.services.skills().then((skills) => {
@@ -2469,8 +2503,8 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2469
2503
  disposed = true;
2470
2504
  };
2471
2505
  }, [runtime, revision]);
2472
- useEffect3(() => installSigintHandler(process, interrupt), [interrupt]);
2473
- useEffect3(() => {
2506
+ (0, import_react8.useEffect)(() => installSigintHandler(process, interrupt), [interrupt]);
2507
+ (0, import_react8.useEffect)(() => {
2474
2508
  let disposed = false;
2475
2509
  void checkForUpdate(packageVersion()).then((version) => {
2476
2510
  if (version !== void 0 && !disposed) setUpdateTo(version);
@@ -2479,7 +2513,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2479
2513
  disposed = true;
2480
2514
  };
2481
2515
  }, []);
2482
- useEffect3(() => {
2516
+ (0, import_react8.useEffect)(() => {
2483
2517
  if (runtime?.services.ideContext === void 0) {
2484
2518
  setIdeContext(void 0);
2485
2519
  return;
@@ -2509,7 +2543,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2509
2543
  clearInterval(timer);
2510
2544
  };
2511
2545
  }, [runtime]);
2512
- useEffect3(() => {
2546
+ (0, import_react8.useEffect)(() => {
2513
2547
  const controller = new AbortController();
2514
2548
  let disposed = false;
2515
2549
  void createGlobTool(workspace, { defaultLimit: 1e4 }).execute({ pattern: "**", limit: 1e4 }, controller.signal).then((result) => {
@@ -2523,7 +2557,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2523
2557
  controller.abort();
2524
2558
  };
2525
2559
  }, [workspace]);
2526
- useEffect3(() => {
2560
+ (0, import_react8.useEffect)(() => {
2527
2561
  if (!stdout || typeof stdout.on !== "function") return;
2528
2562
  const onResize = () => {
2529
2563
  setColumns(stdout.columns ?? 80);
@@ -2539,13 +2573,13 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2539
2573
  const questions = runtime?.services.questions.pending;
2540
2574
  const memoryReviews = runtime?.memoryReviews.pending ?? [];
2541
2575
  const memoryAutoDismissSeconds = runtime?.memoryReviews.autoDismissSeconds ?? 0;
2542
- useEffect3(() => {
2576
+ (0, import_react8.useEffect)(() => {
2543
2577
  setQuestionIndex(0);
2544
2578
  setQuestionAnswers({});
2545
2579
  setCustomQuestionActive(false);
2546
2580
  }, [questions]);
2547
- useEffect3(() => setApprovalExpanded(false), [approval?.id]);
2548
- const derivedSlashCompletion = useMemo3(
2581
+ (0, import_react8.useEffect)(() => setApprovalExpanded(false), [approval?.id]);
2582
+ const derivedSlashCompletion = (0, import_react8.useMemo)(
2549
2583
  () => deriveSlashCompletion(input, promptCursor, slashCandidates, slashSelection),
2550
2584
  [input, promptCursor, slashCandidates, slashSelection]
2551
2585
  );
@@ -2969,7 +3003,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2969
3003
  setDismissedMentionInput(void 0);
2970
3004
  }
2971
3005
  });
2972
- if (runtime === void 0) return /* @__PURE__ */ jsx5(
3006
+ if (runtime === void 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2973
3007
  StartingLayout,
2974
3008
  {
2975
3009
  workspaceName: basename3(workspace),
@@ -2981,7 +3015,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2981
3015
  }
2982
3016
  );
2983
3017
  const llmServiceName = runtime.services.llmServiceName?.();
2984
- return /* @__PURE__ */ jsx5(
3018
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2985
3019
  TerminalLayout,
2986
3020
  {
2987
3021
  model: runtime.services.mainModel(),
@@ -3030,7 +3064,7 @@ function StartingLayout({
3030
3064
  columns,
3031
3065
  rows
3032
3066
  }) {
3033
- return /* @__PURE__ */ jsx5(
3067
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3034
3068
  TerminalLayout,
3035
3069
  {
3036
3070
  model: "starting",
@@ -3050,7 +3084,15 @@ var CLI_VISIBLE_TURN_LIMIT = 40;
3050
3084
  var CLI_VISIBLE_BLOCK_LIMIT = 320;
3051
3085
  var CLI_VISIBLE_BLOCKS_PER_TURN = 80;
3052
3086
  var CLI_VISIBLE_TEXT_CHARS = 32e3;
3053
- function cliRenderBudget(rows, columns) {
3087
+ function cliRenderBudget(rows, columns, expanded = false) {
3088
+ if (expanded) {
3089
+ return {
3090
+ turns: Number.POSITIVE_INFINITY,
3091
+ blocks: Number.POSITIVE_INFINITY,
3092
+ blocksPerTurn: Number.POSITIVE_INFINITY,
3093
+ textChars: Number.POSITIVE_INFINITY
3094
+ };
3095
+ }
3054
3096
  const viewportRows = Math.max(8, Math.floor(rows));
3055
3097
  const viewportColumns = Math.max(20, Math.floor(columns));
3056
3098
  const screenMultiplier = 4;
@@ -3131,6 +3173,9 @@ function boundedCliPresentation(presentation, maxTextChars = CLI_VISIBLE_TEXT_CH
3131
3173
  return presentation;
3132
3174
  }
3133
3175
  function boundedCliTurn(turn, maxBlocks = CLI_VISIBLE_BLOCKS_PER_TURN, maxTextChars = CLI_VISIBLE_TEXT_CHARS) {
3176
+ const uncapped = !Number.isFinite(maxTextChars);
3177
+ const toolTextLimit = uncapped ? maxTextChars : CLI_VISIBLE_TEXT_CHARS;
3178
+ const promptLimit = uncapped ? maxTextChars : 16e3;
3134
3179
  const blockLimit = Math.max(1, Math.floor(maxBlocks));
3135
3180
  const hiddenBlocks = Math.max(0, turn.blocks.length - blockLimit);
3136
3181
  const visible = turn.blocks.slice(-blockLimit).map((block) => block.kind === "text" ? { ...block, text: boundedCliDisplayText(block.text, maxTextChars) } : {
@@ -3138,37 +3183,37 @@ function boundedCliTurn(turn, maxBlocks = CLI_VISIBLE_BLOCKS_PER_TURN, maxTextCh
3138
3183
  ...block.details === void 0 ? {} : {
3139
3184
  details: boundedCliDisplayText(
3140
3185
  block.details,
3141
- block.tool !== void 0 || block.presentation !== void 0 ? CLI_VISIBLE_TEXT_CHARS : maxTextChars
3186
+ block.tool !== void 0 || block.presentation !== void 0 ? toolTextLimit : maxTextChars
3142
3187
  )
3143
3188
  },
3144
3189
  ...block.presentation === void 0 ? {} : {
3145
- presentation: boundedCliPresentation(block.presentation, CLI_VISIBLE_TEXT_CHARS)
3190
+ presentation: boundedCliPresentation(block.presentation, toolTextLimit)
3146
3191
  }
3147
3192
  });
3148
3193
  const blocks = hiddenBlocks === 0 ? visible : [{
3149
3194
  kind: "status",
3150
3195
  id: `display-window:${turn.id}`,
3151
3196
  state: "info",
3152
- text: `\xB7 ${hiddenBlocks} earlier output items hidden to keep the terminal responsive`
3197
+ text: `\xB7 ${hiddenBlocks} earlier output items hidden to keep the terminal responsive \xB7 ${outputToggleShortcut()} to view all`
3153
3198
  }, ...visible];
3154
3199
  return {
3155
3200
  hiddenBlocks,
3156
3201
  turn: {
3157
3202
  ...turn,
3158
- prompt: boundedCliDisplayText(turn.prompt, 16e3),
3203
+ prompt: boundedCliDisplayText(turn.prompt, promptLimit),
3159
3204
  blocks,
3160
3205
  statusLines: blocks.filter((block) => block.kind === "status").map((block) => block.text)
3161
3206
  }
3162
3207
  };
3163
3208
  }
3164
- function cliTranscriptWindow(completed, maxTurns = CLI_VISIBLE_TURN_LIMIT, maxBlocks = CLI_VISIBLE_BLOCK_LIMIT, maxTextChars = CLI_VISIBLE_TEXT_CHARS) {
3209
+ function cliTranscriptWindow(completed, maxTurns = CLI_VISIBLE_TURN_LIMIT, maxBlocks = CLI_VISIBLE_BLOCK_LIMIT, maxTextChars = CLI_VISIBLE_TEXT_CHARS, maxBlocksPerTurn = CLI_VISIBLE_BLOCKS_PER_TURN) {
3165
3210
  const turns = [];
3166
3211
  let remainingBlocks = Math.max(1, Math.floor(maxBlocks));
3167
3212
  let hiddenBlocks = 0;
3168
3213
  for (let index = completed.length - 1; index >= 0 && turns.length < Math.max(1, Math.floor(maxTurns)); index -= 1) {
3169
3214
  const source = completed[index];
3170
3215
  if (remainingBlocks <= 0) break;
3171
- const allowance = Math.min(CLI_VISIBLE_BLOCKS_PER_TURN, remainingBlocks);
3216
+ const allowance = Math.min(maxBlocksPerTurn, remainingBlocks);
3172
3217
  const bounded = boundedCliTurn(source, allowance, maxTextChars);
3173
3218
  turns.push(bounded.turn);
3174
3219
  hiddenBlocks += bounded.hiddenBlocks;
@@ -3218,14 +3263,14 @@ function TerminalLayout({
3218
3263
  const dividerWidth = Math.max(1, columns - 1);
3219
3264
  const outputShortcut = outputToggleShortcut();
3220
3265
  const showWelcome = completed.length === 0 && active === void 0;
3221
- const budget = useMemo3(
3222
- () => cliRenderBudget(rows, columns),
3223
- [rows, columns]
3266
+ const budget = (0, import_react8.useMemo)(
3267
+ () => cliRenderBudget(rows, columns, expandedOutput),
3268
+ [rows, columns, expandedOutput]
3224
3269
  );
3225
- const activeTaskBlocks = useMemo3(() => active?.blocks.filter(
3270
+ const activeTaskBlocks = (0, import_react8.useMemo)(() => active?.blocks.filter(
3226
3271
  (block) => block.kind === "status" && block.task !== void 0
3227
3272
  ) ?? [], [active]);
3228
- const activeWithoutTasks = useMemo3(() => {
3273
+ const activeWithoutTasks = (0, import_react8.useMemo)(() => {
3229
3274
  if (active === void 0) return void 0;
3230
3275
  const raw = {
3231
3276
  ...active,
@@ -3233,8 +3278,8 @@ function TerminalLayout({
3233
3278
  };
3234
3279
  return boundedCliTurn(raw, budget.blocksPerTurn, budget.textChars).turn;
3235
3280
  }, [active, budget]);
3236
- const completedWindow = useMemo3(
3237
- () => cliTranscriptWindow(completed, budget.turns, budget.blocks, budget.textChars),
3281
+ const completedWindow = (0, import_react8.useMemo)(
3282
+ () => cliTranscriptWindow(completed, budget.turns, budget.blocks, budget.textChars, budget.blocksPerTurn),
3238
3283
  [completed, budget]
3239
3284
  );
3240
3285
  const questionRows = questions === void 0 ? 0 : 4 + (questions[questionIndex]?.options.length ?? 0) + questions.length * 2;
@@ -3245,32 +3290,34 @@ function TerminalLayout({
3245
3290
  const availableBottomRows = Math.max(1, rows - taskPanelRows - 1);
3246
3291
  const bottomMaxRows = Math.min(availableBottomRows, Math.max(Math.floor(rows / 2), fixedBottomRows + 1));
3247
3292
  const promptMaxLines = Math.max(1, bottomMaxRows - fixedBottomRows);
3248
- return /* @__PURE__ */ jsxs4(Box_default, { height: rows, width: "100%", flexDirection: "column", overflow: "hidden", children: [
3249
- /* @__PURE__ */ jsxs4(ScrollBox_default, { ...scrollRef === void 0 ? {} : { ref: scrollRef }, flexGrow: 1, flexDirection: "column", stickyScroll: true, children: [
3250
- showWelcome ? /* @__PURE__ */ jsx5(WelcomeCard, { model, ...serviceName === void 0 ? {} : { serviceName }, workspaceName, ...updateTo === void 0 ? {} : { updateTo }, columns }) : /* @__PURE__ */ jsxs4(Text, { dimColor: true, children: [
3293
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { height: rows, width: "100%", flexDirection: "column", overflow: "hidden", children: [
3294
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(ScrollBox_default, { ...scrollRef === void 0 ? {} : { ref: scrollRef }, flexGrow: 1, flexDirection: "column", stickyScroll: true, children: [
3295
+ showWelcome ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WelcomeCard, { model, ...serviceName === void 0 ? {} : { serviceName }, workspaceName, ...updateTo === void 0 ? {} : { updateTo }, columns }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, children: [
3251
3296
  "flavor \xB7 ",
3252
3297
  model,
3253
3298
  " \xB7 ",
3254
3299
  workspaceName
3255
3300
  ] }),
3256
- /* @__PURE__ */ jsx5(Box_default, { height: 1 }),
3257
- completedWindow.hiddenTurns > 0 || completedWindow.hiddenBlocks > 0 ? /* @__PURE__ */ jsxs4(Text, { dimColor: true, children: [
3301
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { height: 1 }),
3302
+ completedWindow.hiddenTurns > 0 || completedWindow.hiddenBlocks > 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, children: [
3258
3303
  "\u2026 ",
3259
3304
  completedWindow.hiddenTurns,
3260
3305
  " earlier turns and ",
3261
3306
  completedWindow.hiddenBlocks,
3262
- " output items hidden to keep the terminal responsive"
3307
+ " output items hidden to keep the terminal responsive \xB7 ",
3308
+ outputShortcut,
3309
+ " to view all"
3263
3310
  ] }) : null,
3264
- completedWindow.turns.map((turn, index) => /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", children: [
3265
- index > 0 ? /* @__PURE__ */ jsx5(TurnSeparator, { width: columns }) : null,
3266
- /* @__PURE__ */ jsx5(TurnView, { turn, interactive: false, workspaceName, expandedOutput })
3311
+ completedWindow.turns.map((turn, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", children: [
3312
+ index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TurnSeparator, { width: columns }) : null,
3313
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TurnView, { turn, interactive: false, workspaceName, expandedOutput })
3267
3314
  ] }, turn.id)),
3268
- activeWithoutTasks === void 0 ? null : /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", children: [
3269
- completedWindow.turns.length > 0 ? /* @__PURE__ */ jsx5(TurnSeparator, { width: columns }) : null,
3270
- /* @__PURE__ */ jsx5(TurnView, { turn: activeWithoutTasks, interactive: activeSession, workspaceName, expandedOutput })
3315
+ activeWithoutTasks === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", children: [
3316
+ completedWindow.turns.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TurnSeparator, { width: columns }) : null,
3317
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TurnView, { turn: activeWithoutTasks, interactive: activeSession, workspaceName, expandedOutput })
3271
3318
  ] })
3272
3319
  ] }),
3273
- /* @__PURE__ */ jsx5(
3320
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3274
3321
  TaskProgressPanel,
3275
3322
  {
3276
3323
  blocks: activeTaskBlocks,
@@ -3282,67 +3329,67 @@ function TerminalLayout({
3282
3329
  ...onTaskPanelHoverChange === void 0 ? {} : { onHoverChange: onTaskPanelHoverChange }
3283
3330
  }
3284
3331
  ),
3285
- /* @__PURE__ */ jsxs4(Box_default, { position: "relative", flexShrink: 0, width: "100%", children: [
3286
- completion === void 0 && mentionCompletion === void 0 ? null : /* @__PURE__ */ jsxs4(Box_default, { position: "absolute", bottom: "100%", left: 0, right: 0, flexDirection: "column", opaque: true, children: [
3287
- completion === void 0 ? null : /* @__PURE__ */ jsx5(SlashMenu, { completion }),
3288
- mentionCompletion === void 0 ? null : /* @__PURE__ */ jsx5(MentionMenu, { completion: mentionCompletion, ...onMentionSelect === void 0 ? {} : { onSelect: onMentionSelect } })
3332
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { position: "relative", flexShrink: 0, width: "100%", children: [
3333
+ completion === void 0 && mentionCompletion === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { position: "absolute", bottom: "100%", left: 0, right: 0, flexDirection: "column", opaque: true, children: [
3334
+ completion === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlashMenu, { completion }),
3335
+ mentionCompletion === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MentionMenu, { completion: mentionCompletion, ...onMentionSelect === void 0 ? {} : { onSelect: onMentionSelect } })
3289
3336
  ] }),
3290
- /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", flexShrink: 0, maxHeight: bottomMaxRows, width: "100%", overflowY: "hidden", children: [
3291
- approval === void 0 ? null : /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", marginBottom: 1, children: [
3292
- /* @__PURE__ */ jsxs4(Text, { color: "magenta", children: [
3337
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", flexShrink: 0, maxHeight: bottomMaxRows, width: "100%", overflowY: "hidden", children: [
3338
+ approval === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
3339
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "magenta", children: [
3293
3340
  "\u250C\u2500 approval \xB7 ",
3294
3341
  approval.tool
3295
3342
  ] }),
3296
- /* @__PURE__ */ jsxs4(Text, { wrap: "truncate-end", color: "magentaBright", children: [
3343
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { wrap: "truncate-end", color: "magentaBright", children: [
3297
3344
  "\u2502 ",
3298
3345
  approval.reason ?? "This action needs permission."
3299
3346
  ] }),
3300
- approvalExpanded ? approvalDetailLines(approval).map((line, index) => /* @__PURE__ */ jsxs4(Text, { color: "magentaBright", wrap: "truncate-end", children: [
3347
+ approvalExpanded ? approvalDetailLines(approval).map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "magentaBright", wrap: "truncate-end", children: [
3301
3348
  "\u2502 ",
3302
3349
  line
3303
3350
  ] }, `${approval.id}:detail:${index}`)) : null,
3304
- isDestructiveTool(approval.tool) || approval.allowAlways === false ? /* @__PURE__ */ jsxs4(Text, { bold: true, color: "magenta", children: [
3351
+ isDestructiveTool(approval.tool) || approval.allowAlways === false ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { bold: true, color: "magenta", children: [
3305
3352
  "\u2514\u2500 ",
3306
- /* @__PURE__ */ jsx5(Text, { color: "cyan", children: "v" }),
3353
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", children: "v" }),
3307
3354
  "=details / ",
3308
- /* @__PURE__ */ jsx5(Text, { color: "green", children: "y" }),
3355
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "green", children: "y" }),
3309
3356
  "=once / ",
3310
- /* @__PURE__ */ jsx5(Text, { color: "cyan", children: "e" }),
3357
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", children: "e" }),
3311
3358
  "=accept edits / ",
3312
- /* @__PURE__ */ jsx5(Text, { color: "red", children: "n" }),
3359
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "red", children: "n" }),
3313
3360
  "=deny"
3314
- ] }) : /* @__PURE__ */ jsxs4(Text, { bold: true, color: "magenta", children: [
3361
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { bold: true, color: "magenta", children: [
3315
3362
  "\u2514\u2500 ",
3316
- /* @__PURE__ */ jsx5(Text, { color: "cyan", children: "v" }),
3363
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", children: "v" }),
3317
3364
  "=details / ",
3318
- /* @__PURE__ */ jsx5(Text, { color: "green", children: "y" }),
3365
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "green", children: "y" }),
3319
3366
  "=once / ",
3320
- /* @__PURE__ */ jsx5(Text, { color: "yellow", children: "a" }),
3367
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "yellow", children: "a" }),
3321
3368
  "=same-type / ",
3322
- /* @__PURE__ */ jsx5(Text, { color: "cyan", children: "e" }),
3369
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "cyan", children: "e" }),
3323
3370
  "=accept edits / ",
3324
- /* @__PURE__ */ jsx5(Text, { color: "red", children: "n" }),
3371
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "red", children: "n" }),
3325
3372
  "=deny"
3326
3373
  ] })
3327
3374
  ] }),
3328
- !questions || questions.length === 0 ? null : /* @__PURE__ */ jsx5(QuestionCards, { questions, activeIndex: questionIndex, answers: questionAnswers, customActive: customQuestionActive }),
3329
- memoryReviews.length === 0 ? null : /* @__PURE__ */ jsx5(MemoryReviewCards, { reviews: memoryReviews, autoDismissSeconds: memoryAutoDismissSeconds }),
3330
- pendingPrompts.length === 0 ? null : /* @__PURE__ */ jsxs4(Text, { color: "yellow", wrap: "truncate-end", children: [
3375
+ !questions || questions.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(QuestionCards, { questions, activeIndex: questionIndex, answers: questionAnswers, customActive: customQuestionActive }),
3376
+ memoryReviews.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MemoryReviewCards, { reviews: memoryReviews, autoDismissSeconds: memoryAutoDismissSeconds }),
3377
+ pendingPrompts.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "yellow", wrap: "truncate-end", children: [
3331
3378
  "Pending (",
3332
3379
  pendingPrompts.length,
3333
3380
  ") \xB7 ",
3334
3381
  queuedPromptLabel(pendingPrompts.at(-1)),
3335
3382
  " \xB7 Esc edit latest"
3336
3383
  ] }),
3337
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: "\u2500".repeat(dividerWidth) }),
3338
- imageAttachments.map((image, index) => /* @__PURE__ */ jsxs4(Text, { color: "cyan", wrap: "truncate-end", children: [
3384
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: "\u2500".repeat(dividerWidth) }),
3385
+ imageAttachments.map((image, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "cyan", wrap: "truncate-end", children: [
3339
3386
  "[Image #",
3340
3387
  index + 1,
3341
3388
  "] ",
3342
3389
  image.name ?? basename3(image.source.path)
3343
3390
  ] }, `${image.sha256}:${index}`)),
3344
- clipboardNotice === void 0 ? null : /* @__PURE__ */ jsx5(Text, { color: "yellow", wrap: "truncate-end", children: clipboardNotice }),
3345
- /* @__PURE__ */ jsx5(
3391
+ clipboardNotice === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "yellow", wrap: "truncate-end", children: clipboardNotice }),
3392
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3346
3393
  PromptLine,
3347
3394
  {
3348
3395
  input,
@@ -3354,10 +3401,10 @@ function TerminalLayout({
3354
3401
  ...onPromptCursorChange === void 0 ? {} : { onCursorChange: onPromptCursorChange }
3355
3402
  }
3356
3403
  ),
3357
- /* @__PURE__ */ jsx5(
3404
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3358
3405
  FooterStatus,
3359
3406
  {
3360
- hint: completion !== void 0 ? "\u2191/\u2193 select \xB7 Tab complete \xB7 Esc close" : mentionCompletion !== void 0 ? "\u2191/\u2193 select \xB7 Tab complete \xB7 click choose \xB7 Esc close" : activeSession ? `Esc ${pendingPrompts.length > 0 ? "edit latest" : "stop"} \xB7 Ctrl+C cancel \xB7 Enter queue \xB7 Ctrl/Cmd+R history \xB7 ${outputShortcut} ${expandedOutput ? "collapse" : "expand"} tools` : `Enter send \xB7 \u2191\u2193/Ctrl/Cmd+R history \xB7 ${outputShortcut} ${expandedOutput ? "collapse" : "expand"} tools \xB7 Ctrl+C exit`,
3407
+ hint: completion !== void 0 ? "\u2191/\u2193 select \xB7 Tab complete \xB7 Esc close" : mentionCompletion !== void 0 ? "\u2191/\u2193 select \xB7 Tab complete \xB7 click choose \xB7 Esc close" : activeSession ? `Esc ${pendingPrompts.length > 0 ? "edit latest" : "stop"} \xB7 Ctrl+C cancel \xB7 Enter queue \xB7 Ctrl/Cmd+R history \xB7 ${outputShortcut} ${expandedOutput ? "collapse all output" : "expand all output"}` : `Enter send \xB7 \u2191\u2193/Ctrl/Cmd+R history \xB7 ${outputShortcut} ${expandedOutput ? "collapse all output" : "expand all output"} \xB7 Ctrl+C exit`,
3361
3408
  ...ideContext === void 0 ? {} : { ideContext }
3362
3409
  }
3363
3410
  )
@@ -3370,9 +3417,9 @@ function FooterStatus({
3370
3417
  ideContext
3371
3418
  }) {
3372
3419
  const ide = ideFooterPresentation(ideContext);
3373
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "row", width: "100%", justifyContent: "space-between", children: [
3374
- /* @__PURE__ */ jsx5(Box_default, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ jsx5(Text, { dimColor: true, wrap: "truncate-end", children: hint }) }),
3375
- ide === void 0 ? null : /* @__PURE__ */ jsx5(Box_default, { flexShrink: 0, marginLeft: 1, children: /* @__PURE__ */ jsxs4(Text, { color: "cyan", wrap: "truncate-end", children: [
3420
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "row", width: "100%", justifyContent: "space-between", children: [
3421
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: hint }) }),
3422
+ ide === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { flexShrink: 0, marginLeft: 1, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "cyan", wrap: "truncate-end", children: [
3376
3423
  "\u29C9 ",
3377
3424
  ide
3378
3425
  ] }) })
@@ -3386,36 +3433,36 @@ function ideFooterPresentation(context) {
3386
3433
  return `${count} ${count === 1 ? "line" : "lines"} selected`;
3387
3434
  }
3388
3435
  function QuestionCards({ questions, activeIndex, answers, customActive }) {
3389
- return /* @__PURE__ */ jsx5(Box_default, { flexDirection: "column", marginBottom: 1, children: questions.map((q, qi) => /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", marginBottom: qi < questions.length - 1 ? 1 : 0, children: [
3390
- /* @__PURE__ */ jsxs4(Text, { bold: true, color: "cyan", children: [
3436
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { flexDirection: "column", marginBottom: 1, children: questions.map((q, qi) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", marginBottom: qi < questions.length - 1 ? 1 : 0, children: [
3437
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { bold: true, color: "cyan", children: [
3391
3438
  "\u250C\u2500 ",
3392
3439
  q.header
3393
3440
  ] }),
3394
- /* @__PURE__ */ jsxs4(Text, { wrap: "truncate-end", color: "cyanBright", children: [
3441
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { wrap: "truncate-end", color: "cyanBright", children: [
3395
3442
  "\u2502 ",
3396
3443
  q.question
3397
3444
  ] }),
3398
- qi < activeIndex ? /* @__PURE__ */ jsxs4(Text, { color: "green", children: [
3445
+ qi < activeIndex ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "green", children: [
3399
3446
  "\u2502 \u2713 ",
3400
3447
  answers[qi]
3401
- ] }) : qi > activeIndex ? null : q.options.map((opt, oi) => /* @__PURE__ */ jsxs4(Text, { color: "cyan", children: [
3448
+ ] }) : qi > activeIndex ? null : q.options.map((opt, oi) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "cyan", children: [
3402
3449
  "\u2502 ",
3403
- /* @__PURE__ */ jsx5(Text, { bold: true, color: "green", children: oi + 1 }),
3450
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, color: "green", children: oi + 1 }),
3404
3451
  ". ",
3405
3452
  opt.label,
3406
- /* @__PURE__ */ jsxs4(Text, { dimColor: true, children: [
3453
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, children: [
3407
3454
  " ",
3408
3455
  opt.description
3409
3456
  ] })
3410
3457
  ] }, oi)),
3411
- qi === activeIndex ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
3412
- /* @__PURE__ */ jsxs4(Text, { color: "cyan", children: [
3458
+ qi === activeIndex ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
3459
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "cyan", children: [
3413
3460
  "\u2502 ",
3414
- /* @__PURE__ */ jsx5(Text, { bold: true, color: "green", children: q.options.length + 1 }),
3461
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, color: "green", children: q.options.length + 1 }),
3415
3462
  ". Custom input",
3416
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: " Type your own answer" })
3463
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: " Type your own answer" })
3417
3464
  ] }),
3418
- /* @__PURE__ */ jsxs4(Text, { dimColor: true, color: "cyan", children: [
3465
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, color: "cyan", children: [
3419
3466
  "\u2514\u2500 ",
3420
3467
  customActive ? "Type below and press Enter; Esc returns to choices" : `Press 1-${q.options.length + 1} to choose; Esc dismisses`
3421
3468
  ] })
@@ -3424,46 +3471,46 @@ function QuestionCards({ questions, activeIndex, answers, customActive }) {
3424
3471
  }
3425
3472
  function MemoryReviewCards({ reviews, autoDismissSeconds }) {
3426
3473
  const review = reviews[0];
3427
- const [remaining, setRemaining] = useState2(autoDismissSeconds);
3428
- useEffect3(() => {
3474
+ const [remaining, setRemaining] = (0, import_react8.useState)(autoDismissSeconds);
3475
+ (0, import_react8.useEffect)(() => {
3429
3476
  if (autoDismissSeconds <= 0) return;
3430
3477
  setRemaining(autoDismissSeconds);
3431
3478
  const timer = setInterval(() => setRemaining((current) => Math.max(0, current - 1)), 1e3);
3432
3479
  return () => clearInterval(timer);
3433
3480
  }, [review.id, autoDismissSeconds]);
3434
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", marginBottom: 1, children: [
3435
- /* @__PURE__ */ jsxs4(Text, { bold: true, color: "yellow", children: [
3481
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
3482
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { bold: true, color: "yellow", children: [
3436
3483
  "\u250C\u2500 Long-term memory requires confirmation (",
3437
3484
  reviews.length,
3438
3485
  ")"
3439
3486
  ] }),
3440
- /* @__PURE__ */ jsxs4(Text, { color: "yellowBright", wrap: "truncate-end", children: [
3487
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "yellowBright", wrap: "truncate-end", children: [
3441
3488
  "\u2502 [",
3442
3489
  review.type,
3443
3490
  "] ",
3444
3491
  review.content
3445
3492
  ] }),
3446
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: "\u2502 Model-generated content is not stored until you approve it." }),
3447
- /* @__PURE__ */ jsxs4(Text, { color: "yellow", children: [
3493
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: "\u2502 Model-generated content is not stored until you approve it." }),
3494
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "yellow", children: [
3448
3495
  "\u2514\u2500 ",
3449
- /* @__PURE__ */ jsx5(Text, { bold: true, children: "Ctrl+Y" }),
3496
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, children: "Ctrl+Y" }),
3450
3497
  " save / ",
3451
- /* @__PURE__ */ jsx5(Text, { bold: true, children: "Ctrl+N" }),
3498
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, children: "Ctrl+N" }),
3452
3499
  " ignore",
3453
- autoDismissSeconds > 0 ? /* @__PURE__ */ jsx5(Text, { bold: true, color: "cyanBright", children: ` (auto-dismiss in ${remaining}s)` }) : " (conversation remains available)"
3500
+ autoDismissSeconds > 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, color: "cyanBright", children: ` (auto-dismiss in ${remaining}s)` }) : " (conversation remains available)"
3454
3501
  ] })
3455
3502
  ] });
3456
3503
  }
3457
3504
  function SlashMenu({ completion }) {
3458
3505
  const visible = completion.items.slice(completion.windowStart, completion.windowStart + 6);
3459
- return /* @__PURE__ */ jsx5(Box_default, { flexDirection: "column", width: "100%", children: visible.map((candidate, visibleIndex) => {
3506
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { flexDirection: "column", width: "100%", children: visible.map((candidate, visibleIndex) => {
3460
3507
  const index = completion.windowStart + visibleIndex;
3461
3508
  const presentation = slashCandidatePresentation(index === completion.selectedIndex);
3462
- return /* @__PURE__ */ jsxs4(Text, { ...presentation.rowStyle, wrap: "truncate-end", children: [
3509
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { ...presentation.rowStyle, wrap: "truncate-end", children: [
3463
3510
  presentation.marker,
3464
- /* @__PURE__ */ jsx5(HighlightedName, { name: candidate.name, query: completion.query, matchStyle: presentation.matchStyle }),
3465
- candidate.kind === "skill" || candidate.kind === "plugin" ? /* @__PURE__ */ jsx5(Text, { color: candidate.kind === "skill" ? "magentaBright" : "cyanBright", children: ` ${candidate.kind}` }) : null,
3466
- candidate.description === void 0 ? null : /* @__PURE__ */ jsx5(Text, { dimColor: true, children: ` ${normalizeSlashDescription(candidate.description)}` })
3511
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HighlightedName, { name: candidate.name, query: completion.query, matchStyle: presentation.matchStyle }),
3512
+ candidate.kind === "skill" || candidate.kind === "plugin" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: candidate.kind === "skill" ? "magentaBright" : "cyanBright", children: ` ${candidate.kind}` }) : null,
3513
+ candidate.description === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: ` ${normalizeSlashDescription(candidate.description)}` })
3467
3514
  ] }, `${candidate.kind}:${candidate.name}`);
3468
3515
  }) });
3469
3516
  }
@@ -3472,19 +3519,19 @@ function MentionMenu({
3472
3519
  onSelect
3473
3520
  }) {
3474
3521
  const visible = completion.items.slice(completion.windowStart, completion.windowStart + 6);
3475
- return /* @__PURE__ */ jsx5(Box_default, { flexDirection: "column", width: "100%", children: visible.map((path, visibleIndex) => {
3522
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { flexDirection: "column", width: "100%", children: visible.map((path, visibleIndex) => {
3476
3523
  const index = completion.windowStart + visibleIndex;
3477
3524
  const presentation = mentionCandidatePresentation(index === completion.selectedIndex);
3478
- return /* @__PURE__ */ jsx5(
3525
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3479
3526
  Box_default,
3480
3527
  {
3481
3528
  width: "100%",
3482
3529
  onClick: (event) => {
3483
3530
  if (!event.cellIsBlank) onSelect?.(path);
3484
3531
  },
3485
- children: /* @__PURE__ */ jsxs4(Text, { ...presentation.textStyle, wrap: "truncate-end", children: [
3532
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { ...presentation.textStyle, wrap: "truncate-end", children: [
3486
3533
  presentation.marker,
3487
- presentation.highlightMatches ? /* @__PURE__ */ jsx5(HighlightedName, { name: path, query: completion.query, matchStyle: presentation.matchStyle }) : path
3534
+ presentation.highlightMatches ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HighlightedName, { name: path, query: completion.query, matchStyle: presentation.matchStyle }) : path
3488
3535
  ] })
3489
3536
  },
3490
3537
  path
@@ -3497,16 +3544,16 @@ function HighlightedName({
3497
3544
  matchStyle
3498
3545
  }) {
3499
3546
  const ranges = matchRanges(name, query);
3500
- if (ranges.length === 0) return /* @__PURE__ */ jsx5(Text, { children: name });
3547
+ if (ranges.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { children: name });
3501
3548
  const parts = [];
3502
3549
  let cursor = 0;
3503
3550
  for (const [start, end] of ranges) {
3504
3551
  if (start > cursor) parts.push(name.slice(cursor, start));
3505
- parts.push(/* @__PURE__ */ jsx5(Text, { ...matchStyle, children: name.slice(start, end) }, `${start}:${end}`));
3552
+ parts.push(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { ...matchStyle, children: name.slice(start, end) }, `${start}:${end}`));
3506
3553
  cursor = end;
3507
3554
  }
3508
3555
  if (cursor < name.length) parts.push(name.slice(cursor));
3509
- return /* @__PURE__ */ jsx5(Text, { children: parts });
3556
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { children: parts });
3510
3557
  }
3511
3558
  function jumpScroll(scroll, delta) {
3512
3559
  const maximum = Math.max(0, scroll.getScrollHeight() - scroll.getViewportHeight());
@@ -3540,25 +3587,25 @@ function scrollUp(scroll, amount) {
3540
3587
  else scroll.scrollBy(-amount);
3541
3588
  }
3542
3589
  function TurnSeparator({ width }) {
3543
- return /* @__PURE__ */ jsx5(Text, { dimColor: true, children: "\u2500".repeat(Math.max(1, width - 1)) });
3590
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: "\u2500".repeat(Math.max(1, width - 1)) });
3544
3591
  }
3545
- var TurnView = React4.memo(function TurnView2({
3592
+ var TurnView = import_react8.default.memo(function TurnView2({
3546
3593
  turn,
3547
3594
  interactive,
3548
3595
  workspaceName,
3549
3596
  expandedOutput
3550
3597
  }) {
3551
3598
  if (turn.kind === "compaction") {
3552
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", marginBottom: 1, borderStyle: "round", borderColor: "ansi:yellowBright", paddingX: 1, children: [
3553
- /* @__PURE__ */ jsx5(Text, { color: "ansi:yellowBright", bold: true, children: turn.prompt }),
3554
- turn.blocks.map((block, index) => block.kind === "status" ? /* @__PURE__ */ jsx5(StatusBlockView, { block, interactive, workspaceName, expandedOutput }, block.id) : /* @__PURE__ */ jsx5(Box_default, { children: /* @__PURE__ */ jsx5(AssistantText, { text: block.text }) }, `${turn.id}-text-${index}`))
3599
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, borderStyle: "round", borderColor: "ansi:yellowBright", paddingX: 1, children: [
3600
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:yellowBright", bold: true, children: turn.prompt }),
3601
+ turn.blocks.map((block, index) => block.kind === "status" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StatusBlockView, { block, interactive, workspaceName, expandedOutput }, block.id) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AssistantText, { text: block.text }) }, `${turn.id}-text-${index}`))
3555
3602
  ] });
3556
3603
  }
3557
3604
  if (turn.source?.kind === "pal") {
3558
3605
  const context = turn.source.context === void 0 ? "" : ` \xB7 ${turn.source.context}`;
3559
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", marginBottom: 1, children: [
3560
- /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
3561
- /* @__PURE__ */ jsxs4(Text, { color: "cyanBright", bold: true, children: [
3606
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
3607
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
3608
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "cyanBright", bold: true, children: [
3562
3609
  "PAL \xB7 ",
3563
3610
  turn.source.alias,
3564
3611
  " (",
@@ -3566,20 +3613,20 @@ var TurnView = React4.memo(function TurnView2({
3566
3613
  ")",
3567
3614
  context
3568
3615
  ] }),
3569
- /* @__PURE__ */ jsx5(Text, { color: "ansi:whiteBright", children: turn.prompt })
3616
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:whiteBright", children: turn.prompt })
3570
3617
  ] }),
3571
- /* @__PURE__ */ jsx5(Box_default, { flexDirection: "column", paddingLeft: 2, marginTop: 1, children: turn.blocks.map((block, index) => block.kind === "status" ? /* @__PURE__ */ jsx5(StatusBlockView, { block, interactive, workspaceName, expandedOutput }, block.id) : /* @__PURE__ */ jsx5(Box_default, { marginBottom: 1, children: /* @__PURE__ */ jsx5(AssistantText, { text: block.text }) }, `${turn.id}-text-${index}`)) })
3618
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { flexDirection: "column", paddingLeft: 2, marginTop: 1, children: turn.blocks.map((block, index) => block.kind === "status" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StatusBlockView, { block, interactive, workspaceName, expandedOutput }, block.id) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AssistantText, { text: block.text }) }, `${turn.id}-text-${index}`)) })
3572
3619
  ] });
3573
3620
  }
3574
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", marginBottom: 1, children: [
3575
- /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "row", backgroundColor: "#3a3a3a", paddingX: 1, paddingY: 0, children: [
3576
- /* @__PURE__ */ jsx5(Text, { color: "ansi:whiteBright", bold: true, backgroundColor: "#3a3a3a", children: "\u276F" }),
3577
- /* @__PURE__ */ jsxs4(Text, { color: "ansi:whiteBright", bold: true, backgroundColor: "#3a3a3a", children: [
3621
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
3622
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "row", backgroundColor: "#3a3a3a", paddingX: 1, paddingY: 0, children: [
3623
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:whiteBright", bold: true, backgroundColor: "#3a3a3a", children: "\u276F" }),
3624
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "ansi:whiteBright", bold: true, backgroundColor: "#3a3a3a", children: [
3578
3625
  " ",
3579
3626
  turn.prompt
3580
3627
  ] })
3581
3628
  ] }),
3582
- /* @__PURE__ */ jsx5(Box_default, { flexDirection: "column", paddingLeft: 2, marginTop: 1, children: turn.blocks.map((block, index) => block.kind === "status" ? /* @__PURE__ */ jsx5(StatusBlockView, { block, interactive, workspaceName, expandedOutput }, block.id) : /* @__PURE__ */ jsx5(Box_default, { marginBottom: 1, children: /* @__PURE__ */ jsx5(AssistantText, { text: block.text }) }, `${turn.id}-text-${index}`)) })
3629
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { flexDirection: "column", paddingLeft: 2, marginTop: 1, children: turn.blocks.map((block, index) => block.kind === "status" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StatusBlockView, { block, interactive, workspaceName, expandedOutput }, block.id) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AssistantText, { text: block.text }) }, `${turn.id}-text-${index}`)) })
3583
3630
  ] });
3584
3631
  });
3585
3632
  var DIFF_CONTENT = fileDiffLineStyle("context").contentColor;
@@ -3588,11 +3635,11 @@ var DIFF_ADDED_MARKER = fileDiffLineStyle("added").markerColor;
3588
3635
  function FileDiffView({ presentation, expanded }) {
3589
3636
  const operation = presentation.operation === "create" ? "Create" : presentation.operation === "delete" ? "Delete" : "Update";
3590
3637
  if (presentation.operation === "delete") {
3591
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "row", children: [
3592
- /* @__PURE__ */ jsx5(Text, { color: DIFF_REMOVED_MARKER, children: "\u25CF" }),
3593
- /* @__PURE__ */ jsxs4(Text, { color: DIFF_CONTENT, children: [
3638
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "row", children: [
3639
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: DIFF_REMOVED_MARKER, children: "\u25CF" }),
3640
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: DIFF_CONTENT, children: [
3594
3641
  " ",
3595
- /* @__PURE__ */ jsx5(Text, { bold: true, children: operation }),
3642
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, children: operation }),
3596
3643
  "(",
3597
3644
  basename3(presentation.path),
3598
3645
  ")"
@@ -3600,29 +3647,29 @@ function FileDiffView({ presentation, expanded }) {
3600
3647
  ] });
3601
3648
  }
3602
3649
  const lineWidth = Math.max(1, ...presentation.lines.map((line) => Math.max(line.oldLine ?? 0, line.newLine ?? 0))).toString().length;
3603
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", width: "100%", children: [
3604
- /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "row", children: [
3605
- /* @__PURE__ */ jsx5(Text, { color: DIFF_ADDED_MARKER, children: "\u25CF" }),
3606
- /* @__PURE__ */ jsxs4(Text, { color: DIFF_CONTENT, children: [
3650
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
3651
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "row", children: [
3652
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: DIFF_ADDED_MARKER, children: "\u25CF" }),
3653
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: DIFF_CONTENT, children: [
3607
3654
  " ",
3608
- /* @__PURE__ */ jsx5(Text, { bold: true, children: operation }),
3655
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, children: operation }),
3609
3656
  "(",
3610
3657
  basename3(presentation.path),
3611
3658
  ")"
3612
3659
  ] })
3613
3660
  ] }),
3614
- /* @__PURE__ */ jsxs4(Text, { color: DIFF_CONTENT, children: [
3661
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: DIFF_CONTENT, children: [
3615
3662
  " \u2514 Added ",
3616
3663
  lineCount(presentation.added),
3617
3664
  ", removed ",
3618
3665
  lineCount(presentation.removed)
3619
3666
  ] }),
3620
- (expanded ? presentation.lines : []).map((line, index) => /* @__PURE__ */ jsx5(FileDiffRow, { line, lineWidth }, `${line.kind}:${line.oldLine ?? ""}:${line.newLine ?? ""}:${index}`))
3667
+ (expanded ? presentation.lines : []).map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FileDiffRow, { line, lineWidth }, `${line.kind}:${line.oldLine ?? ""}:${line.newLine ?? ""}:${index}`))
3621
3668
  ] });
3622
3669
  }
3623
3670
  function FileDiffRow({ line, lineWidth }) {
3624
3671
  if (line.kind === "omitted") {
3625
- return /* @__PURE__ */ jsxs4(Text, { color: DIFF_CONTENT, dimColor: true, children: [
3672
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: DIFF_CONTENT, dimColor: true, children: [
3626
3673
  " ".repeat(lineWidth + 4),
3627
3674
  line.text
3628
3675
  ] });
@@ -3631,14 +3678,14 @@ function FileDiffRow({ line, lineWidth }) {
3631
3678
  const marker = line.kind === "removed" ? "-" : line.kind === "added" ? "+" : " ";
3632
3679
  const { backgroundColor, markerColor, contentColor } = fileDiffLineStyle(line.kind);
3633
3680
  const prefix = `${String(number ?? "").padStart(lineWidth)} ${marker}| `;
3634
- return /* @__PURE__ */ jsxs4(
3681
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
3635
3682
  Box_default,
3636
3683
  {
3637
3684
  flexDirection: "row",
3638
3685
  width: "100%",
3639
3686
  ...backgroundColor === void 0 ? {} : { backgroundColor },
3640
3687
  children: [
3641
- /* @__PURE__ */ jsx5(
3688
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3642
3689
  Text,
3643
3690
  {
3644
3691
  color: markerColor,
@@ -3647,7 +3694,7 @@ function FileDiffRow({ line, lineWidth }) {
3647
3694
  children: prefix
3648
3695
  }
3649
3696
  ),
3650
- /* @__PURE__ */ jsx5(
3697
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3651
3698
  Text,
3652
3699
  {
3653
3700
  color: contentColor,
@@ -3663,18 +3710,18 @@ function lineCount(count) {
3663
3710
  return `${count} ${count === 1 ? "line" : "lines"}`;
3664
3711
  }
3665
3712
  function StatusLine({ block, interactive }) {
3666
- if (block.progress !== void 0) return /* @__PURE__ */ jsx5(CompactProgressLine, { progress: block.progress });
3713
+ if (block.progress !== void 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CompactProgressLine, { progress: block.progress });
3667
3714
  const running = block.state === "running";
3668
3715
  const [ref, time] = useAnimationFrame(running && interactive ? 120 : null);
3669
3716
  const color = statusLineColor(block);
3670
3717
  const frames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
3671
3718
  const spinner = running && interactive ? frames[Math.floor(Math.max(0, time) / 120) % frames.length] + " " : "";
3672
- return /* @__PURE__ */ jsxs4(Box_default, { ref, flexDirection: "row", children: [
3673
- /* @__PURE__ */ jsxs4(Text, { ...color === void 0 ? { dimColor: true } : { color }, children: [
3719
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { ref, flexDirection: "row", children: [
3720
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { ...color === void 0 ? { dimColor: true } : { color }, children: [
3674
3721
  spinner,
3675
3722
  block.text
3676
3723
  ] }),
3677
- block.hint === void 0 ? null : /* @__PURE__ */ jsxs4(Text, { dimColor: true, wrap: "truncate-end", children: [
3724
+ block.hint === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
3678
3725
  " (",
3679
3726
  block.hint,
3680
3727
  ")"
@@ -3690,13 +3737,13 @@ function statusLineColor(block) {
3690
3737
  }
3691
3738
  function CompactProgressLine({ progress }) {
3692
3739
  const presentation = compactProgressPresentation(progress);
3693
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "row", children: [
3694
- /* @__PURE__ */ jsx5(Text, { children: "Compacting context " }),
3695
- presentation.cells.map((cell, index) => /* @__PURE__ */ jsxs4(Text, { color: cell.color, children: [
3740
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "row", children: [
3741
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { children: "Compacting context " }),
3742
+ presentation.cells.map((cell, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: cell.color, children: [
3696
3743
  "\u25A0",
3697
3744
  index === presentation.cells.length - 1 ? "" : " "
3698
3745
  ] }, index)),
3699
- /* @__PURE__ */ jsxs4(Text, { dimColor: true, children: [
3746
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, children: [
3700
3747
  " ",
3701
3748
  presentation.progress,
3702
3749
  "%"
@@ -3727,13 +3774,13 @@ function PromptLine({
3727
3774
  lineStarts.push(nextLineStart);
3728
3775
  nextLineStart += [...line].length;
3729
3776
  }
3730
- return /* @__PURE__ */ jsx5(Box_default, { width: "100%", flexDirection: "column", paddingX: PROMPT_HORIZONTAL_PADDING, children: visibleLines.map((line, visibleIndex) => {
3777
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { width: "100%", flexDirection: "column", paddingX: PROMPT_HORIZONTAL_PADDING, children: visibleLines.map((line, visibleIndex) => {
3731
3778
  const lineIndex = windowStart + visibleIndex;
3732
3779
  const isCursorLine = lineIndex === wrap.cursor.line;
3733
3780
  const points = [...line];
3734
3781
  const cursorCol = wrap.cursor.column;
3735
3782
  const styledCount = Math.max(0, Math.min(points.length, tokenLength - (lineStarts[lineIndex] ?? 0)));
3736
- return /* @__PURE__ */ jsxs4(
3783
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
3737
3784
  Box_default,
3738
3785
  {
3739
3786
  ...onCursorChange === void 0 ? {} : {
@@ -3747,8 +3794,8 @@ function PromptLine({
3747
3794
  }
3748
3795
  },
3749
3796
  children: [
3750
- /* @__PURE__ */ jsx5(Text, { color: "yellow", bold: true, children: lineIndex === 0 ? "\u276F " : " " }),
3751
- /* @__PURE__ */ jsx5(PromptLineContent, { points, cursor: cursorCol, cursorVisible: isCursorLine, styledCount })
3797
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "yellow", bold: true, children: lineIndex === 0 ? "\u276F " : " " }),
3798
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PromptLineContent, { points, cursor: cursorCol, cursorVisible: isCursorLine, styledCount })
3752
3799
  ]
3753
3800
  },
3754
3801
  lineIndex
@@ -3764,14 +3811,14 @@ function StatusBlockView({
3764
3811
  const visibleBlock = cliToolTitle(block);
3765
3812
  const outcome = cliToolOutcome(block);
3766
3813
  const toolOutput = block.tool !== void 0 || block.presentation !== void 0;
3767
- const primary = visibleBlock.activity === "model" || visibleBlock.task !== void 0 ? /* @__PURE__ */ jsx5(TaskStatusLine, { block: visibleBlock, interactive }) : visibleBlock.state === "completed" && visibleBlock.presentation !== void 0 ? /* @__PURE__ */ jsx5(ToolPresentationView, { presentation: visibleBlock.presentation, workspaceName, expandedOutput }) : /* @__PURE__ */ jsx5(StatusLine, { block: visibleBlock, interactive });
3768
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", children: [
3814
+ const primary = visibleBlock.activity === "model" || visibleBlock.task !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TaskStatusLine, { block: visibleBlock, interactive }) : visibleBlock.state === "completed" && visibleBlock.presentation !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ToolPresentationView, { presentation: visibleBlock.presentation, workspaceName, expandedOutput }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StatusLine, { block: visibleBlock, interactive });
3815
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", children: [
3769
3816
  primary,
3770
- outcome === void 0 ? null : /* @__PURE__ */ jsx5(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ jsxs4(Text, { dimColor: true, children: [
3817
+ outcome === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, children: [
3771
3818
  "\u2514 ",
3772
3819
  outcome
3773
3820
  ] }) }),
3774
- block.details === void 0 || block.presentation?.kind === "changeset" || toolOutput && !expandedOutput ? null : /* @__PURE__ */ jsx5(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ jsx5(AssistantText, { text: block.details }) })
3821
+ block.details === void 0 || block.presentation?.kind === "changeset" || toolOutput && !expandedOutput ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AssistantText, { text: block.details }) })
3775
3822
  ] });
3776
3823
  }
3777
3824
  function ToolPresentationView({
@@ -3779,17 +3826,17 @@ function ToolPresentationView({
3779
3826
  workspaceName,
3780
3827
  expandedOutput
3781
3828
  }) {
3782
- if (presentation.kind === "changeset") return /* @__PURE__ */ jsx5(ChangeSetPresentationView, { presentation, workspaceName, expanded: expandedOutput });
3783
- if (presentation.kind === "file-change") return /* @__PURE__ */ jsx5(FileDiffView, { presentation, expanded: expandedOutput });
3784
- if (presentation.kind === "terminal") return /* @__PURE__ */ jsx5(CommandPresentationView, { presentation, expanded: expandedOutput });
3785
- if (presentation.kind === "web") return /* @__PURE__ */ jsx5(WebPresentationView, { presentation, expanded: expandedOutput });
3786
- if (presentation.kind === "job") return /* @__PURE__ */ jsx5(JobPresentationView, { presentation, expanded: expandedOutput });
3787
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", paddingLeft: 2, children: [
3788
- /* @__PURE__ */ jsxs4(Text, { children: [
3829
+ if (presentation.kind === "changeset") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChangeSetPresentationView, { presentation, workspaceName, expanded: expandedOutput });
3830
+ if (presentation.kind === "file-change") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FileDiffView, { presentation, expanded: expandedOutput });
3831
+ if (presentation.kind === "terminal") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CommandPresentationView, { presentation, expanded: expandedOutput });
3832
+ if (presentation.kind === "web") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WebPresentationView, { presentation, expanded: expandedOutput });
3833
+ if (presentation.kind === "job") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(JobPresentationView, { presentation, expanded: expandedOutput });
3834
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, children: [
3835
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { children: [
3789
3836
  presentation.title,
3790
3837
  presentation.summary ? ` \xB7 ${presentation.summary}` : ""
3791
3838
  ] }),
3792
- !expandedOutput || presentation.details === void 0 ? null : /* @__PURE__ */ jsx5(AssistantText, { text: presentation.details })
3839
+ !expandedOutput || presentation.details === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AssistantText, { text: presentation.details })
3793
3840
  ] });
3794
3841
  }
3795
3842
  var CHANGESET_TONE = "#b99bf8";
@@ -3803,10 +3850,10 @@ function ChangeSetPresentationView({
3803
3850
  const removed = presentation.files.reduce((total, file) => total + file.removed, 0);
3804
3851
  const fileLabel = presentation.files.length === 1 ? "FILE" : "FILES";
3805
3852
  const showing = presentation.files.length > visibleFiles.length ? ` \xB7 Showing ${visibleFiles.length} of ${presentation.files.length}` : "";
3806
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
3807
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3808
- /* @__PURE__ */ jsx5(Text, { color: CHANGESET_TONE, children: "\u250C\u2500 " }),
3809
- /* @__PURE__ */ jsxs4(Text, { color: CHANGESET_TONE, bold: true, children: [
3853
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
3854
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
3855
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: CHANGESET_TONE, children: "\u250C\u2500 " }),
3856
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: CHANGESET_TONE, bold: true, children: [
3810
3857
  "CHANGESET \xB7 ",
3811
3858
  presentation.files.length,
3812
3859
  " ",
@@ -3816,37 +3863,37 @@ function ChangeSetPresentationView({
3816
3863
  visibleFiles.map((file) => {
3817
3864
  const operation = file.operation.toUpperCase();
3818
3865
  const stats = `+${file.added} -${file.removed}`;
3819
- return /* @__PURE__ */ jsxs4(Box_default, { children: [
3820
- /* @__PURE__ */ jsx5(Text, { color: CHANGESET_TONE, children: "\u2502 " }),
3821
- /* @__PURE__ */ jsx5(Text, { color: changeSetOperationColor(file.operation), bold: true, children: operation.padEnd(8) }),
3822
- /* @__PURE__ */ jsxs4(Text, { children: [
3823
- /* @__PURE__ */ jsxs4(Text, { color: "ansi:green", children: [
3866
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
3867
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: CHANGESET_TONE, children: "\u2502 " }),
3868
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: changeSetOperationColor(file.operation), bold: true, children: operation.padEnd(8) }),
3869
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { children: [
3870
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "ansi:green", children: [
3824
3871
  "+",
3825
3872
  file.added
3826
3873
  ] }),
3827
3874
  " ",
3828
- /* @__PURE__ */ jsxs4(Text, { color: "#e06c50", children: [
3875
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "#e06c50", children: [
3829
3876
  "-",
3830
3877
  file.removed
3831
3878
  ] }),
3832
3879
  " ".repeat(Math.max(1, 9 - stats.length))
3833
3880
  ] }),
3834
- /* @__PURE__ */ jsx5(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: workspaceRelativePath(file.path, workspaceName) })
3881
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: workspaceRelativePath(file.path, workspaceName) })
3835
3882
  ] }, `${file.operation}:${file.path}`);
3836
3883
  }),
3837
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3838
- /* @__PURE__ */ jsx5(Text, { color: CHANGESET_TONE, children: "\u2514\u2500 " }),
3839
- /* @__PURE__ */ jsxs4(Text, { children: [
3840
- /* @__PURE__ */ jsxs4(Text, { color: "ansi:green", children: [
3884
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
3885
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: CHANGESET_TONE, children: "\u2514\u2500 " }),
3886
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { children: [
3887
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "ansi:green", children: [
3841
3888
  "+",
3842
3889
  added
3843
3890
  ] }),
3844
3891
  " ",
3845
- /* @__PURE__ */ jsxs4(Text, { color: "#e06c50", children: [
3892
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "#e06c50", children: [
3846
3893
  "-",
3847
3894
  removed
3848
3895
  ] }),
3849
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: showing })
3896
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: showing })
3850
3897
  ] })
3851
3898
  ] })
3852
3899
  ] });
@@ -3875,28 +3922,28 @@ function CommandPresentationView({
3875
3922
  const perStreamLimit = expanded ? Number.POSITIVE_INFINITY : 0;
3876
3923
  const stdout = boundedCommandLines(presentation.stdout ?? "", perStreamLimit);
3877
3924
  const stderr = boundedCommandLines(presentation.stderr ?? "", perStreamLimit);
3878
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
3879
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3880
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u250C\u2500 " }),
3881
- /* @__PURE__ */ jsxs4(Text, { color: tone, bold: true, children: [
3925
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
3926
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
3927
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u250C\u2500 " }),
3928
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: tone, bold: true, children: [
3882
3929
  label,
3883
3930
  " \xB7 ",
3884
3931
  state.toUpperCase()
3885
3932
  ] })
3886
3933
  ] }),
3887
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3888
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2502 " }),
3889
- /* @__PURE__ */ jsx5(Text, { color: "ansi:whiteBright", bold: true, wrap: "truncate-end", children: presentation.command ?? presentation.title })
3934
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
3935
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u2502 " }),
3936
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:whiteBright", bold: true, wrap: "truncate-end", children: presentation.command ?? presentation.title })
3890
3937
  ] }),
3891
- stdout.total === 0 ? null : /* @__PURE__ */ jsx5(CommandOutputSection, { label: "OUTPUT", value: stdout, tone, error: false }),
3892
- stderr.total === 0 ? null : /* @__PURE__ */ jsx5(CommandOutputSection, { label: "ERROR", value: stderr, tone, error: true }),
3893
- !expanded || presentation.diagnostic === void 0 ? null : /* @__PURE__ */ jsxs4(Box_default, { children: [
3894
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2502 " }),
3895
- /* @__PURE__ */ jsx5(Text, { color: tone, children: presentation.diagnostic })
3938
+ stdout.total === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CommandOutputSection, { label: "OUTPUT", value: stdout, tone, error: false }),
3939
+ stderr.total === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CommandOutputSection, { label: "ERROR", value: stderr, tone, error: true }),
3940
+ !expanded || presentation.diagnostic === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
3941
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u2502 " }),
3942
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: presentation.diagnostic })
3896
3943
  ] }),
3897
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3898
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2514\u2500 " }),
3899
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: commandFooter(presentation, state) })
3944
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
3945
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u2514\u2500 " }),
3946
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: commandFooter(presentation, state) })
3900
3947
  ] })
3901
3948
  ] });
3902
3949
  }
@@ -3906,17 +3953,17 @@ function CommandOutputSection({
3906
3953
  tone,
3907
3954
  error
3908
3955
  }) {
3909
- return /* @__PURE__ */ jsxs4(Fragment3, { children: [
3910
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3911
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u251C\u2500 " }),
3912
- /* @__PURE__ */ jsx5(Text, { color: error ? "#e06c50" : tone, bold: true, children: label }),
3913
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: ` \xB7 ${value.total} ${value.total === 1 ? "LINE" : "LINES"}` }),
3914
- value.hidden === 0 ? null : /* @__PURE__ */ jsx5(Text, { dimColor: true, children: ` \xB7 ${value.head.length + value.tail.length} SHOWN` })
3956
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
3957
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
3958
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u251C\u2500 " }),
3959
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: error ? "#e06c50" : tone, bold: true, children: label }),
3960
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: ` \xB7 ${value.total} ${value.total === 1 ? "LINE" : "LINES"}` }),
3961
+ value.hidden === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: ` \xB7 ${value.head.length + value.tail.length} SHOWN` })
3915
3962
  ] }),
3916
- value.head.map((line, index) => /* @__PURE__ */ jsx5(CommandOutputLine, { line, tone, error }, `head:${index}`)),
3917
- value.hidden === 0 ? null : /* @__PURE__ */ jsxs4(Box_default, { children: [
3918
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2502 " }),
3919
- /* @__PURE__ */ jsxs4(Text, { dimColor: true, children: [
3963
+ value.head.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CommandOutputLine, { line, tone, error }, `head:${index}`)),
3964
+ value.hidden === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
3965
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u2502 " }),
3966
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, children: [
3920
3967
  "\u2026 ",
3921
3968
  value.hidden,
3922
3969
  " ",
@@ -3924,13 +3971,13 @@ function CommandOutputSection({
3924
3971
  " hidden"
3925
3972
  ] })
3926
3973
  ] }),
3927
- value.tail.map((line, index) => /* @__PURE__ */ jsx5(CommandOutputLine, { line, tone, error }, `tail:${index}`))
3974
+ value.tail.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CommandOutputLine, { line, tone, error }, `tail:${index}`))
3928
3975
  ] });
3929
3976
  }
3930
3977
  function CommandOutputLine({ line, tone, error }) {
3931
- return /* @__PURE__ */ jsxs4(Box_default, { children: [
3932
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2502 " }),
3933
- /* @__PURE__ */ jsx5(Text, { color: error ? "#e06c50" : "#b8bcc2", wrap: "truncate-end", children: line === "" ? " " : line })
3978
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
3979
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u2502 " }),
3980
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: error ? "#e06c50" : "#b8bcc2", wrap: "truncate-end", children: line === "" ? " " : line })
3934
3981
  ] });
3935
3982
  }
3936
3983
  function boundedCommandLines(output, limit) {
@@ -3960,51 +4007,51 @@ function WebPresentationView({
3960
4007
  expanded
3961
4008
  }) {
3962
4009
  const items = presentation.items ?? [];
3963
- if (presentation.items === void 0) return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
3964
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3965
- /* @__PURE__ */ jsx5(Text, { color: "#5f87af", children: "\u250C\u2500 " }),
3966
- /* @__PURE__ */ jsx5(Text, { color: "ansi:cyanBright", bold: true, children: "WEB FETCH" }),
3967
- presentation.summary === void 0 ? null : /* @__PURE__ */ jsx5(Text, { dimColor: true, children: ` \xB7 ${presentation.summary}` })
4010
+ if (presentation.items === void 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
4011
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4012
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#5f87af", children: "\u250C\u2500 " }),
4013
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:cyanBright", bold: true, children: "WEB FETCH" }),
4014
+ presentation.summary === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: ` \xB7 ${presentation.summary}` })
3968
4015
  ] }),
3969
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3970
- /* @__PURE__ */ jsx5(Text, { color: "#5f87af", children: "\u2502 " }),
3971
- /* @__PURE__ */ jsx5(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: presentation.url ?? presentation.title })
4016
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4017
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
4018
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: presentation.url ?? presentation.title })
3972
4019
  ] }),
3973
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3974
- /* @__PURE__ */ jsx5(Text, { color: "#5f87af", children: "\u2514\u2500 " }),
3975
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: "Page content added to context" })
4020
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4021
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#5f87af", children: "\u2514\u2500 " }),
4022
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: "Page content added to context" })
3976
4023
  ] })
3977
4024
  ] });
3978
4025
  const visibleItems = expanded ? items : [];
3979
4026
  const query = presentation.title.replace(/^Search:\s*/iu, "").trim();
3980
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
3981
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3982
- /* @__PURE__ */ jsx5(Text, { color: "#5f87af", children: "\u250C\u2500 " }),
3983
- /* @__PURE__ */ jsx5(Text, { color: "ansi:cyanBright", bold: true, children: "WEB SEARCH" }),
3984
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: ` \xB7 ${items.length} ${items.length === 1 ? "RESULT" : "RESULTS"}` })
4027
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
4028
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4029
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#5f87af", children: "\u250C\u2500 " }),
4030
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:cyanBright", bold: true, children: "WEB SEARCH" }),
4031
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: ` \xB7 ${items.length} ${items.length === 1 ? "RESULT" : "RESULTS"}` })
3985
4032
  ] }),
3986
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3987
- /* @__PURE__ */ jsx5(Text, { color: "#5f87af", children: "\u2502 " }),
3988
- /* @__PURE__ */ jsx5(Text, { color: "ansi:whiteBright", bold: true, wrap: "truncate-end", children: query })
4033
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4034
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
4035
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:whiteBright", bold: true, wrap: "truncate-end", children: query })
3989
4036
  ] }),
3990
- /* @__PURE__ */ jsx5(Text, { color: "#5f87af", children: "\u2502" }),
3991
- visibleItems.map((item, index) => /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", children: [
3992
- /* @__PURE__ */ jsxs4(Box_default, { children: [
3993
- /* @__PURE__ */ jsx5(Text, { color: "#5f87af", children: "\u2502 " }),
3994
- /* @__PURE__ */ jsx5(Text, { color: "ansi:cyanBright", bold: true, children: String(index + 1).padStart(2, "0") }),
3995
- /* @__PURE__ */ jsxs4(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: [
4037
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#5f87af", children: "\u2502" }),
4038
+ visibleItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", children: [
4039
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4040
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
4041
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:cyanBright", bold: true, children: String(index + 1).padStart(2, "0") }),
4042
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: [
3996
4043
  " ",
3997
4044
  item.title
3998
4045
  ] })
3999
4046
  ] }),
4000
- /* @__PURE__ */ jsxs4(Box_default, { children: [
4001
- /* @__PURE__ */ jsx5(Text, { color: "#5f87af", children: "\u2502 " }),
4002
- /* @__PURE__ */ jsx5(Text, { dimColor: true, wrap: "truncate-end", children: compactWebSource(item.url) })
4047
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4048
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#5f87af", children: "\u2502 " }),
4049
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: compactWebSource(item.url) })
4003
4050
  ] })
4004
4051
  ] }, item.url)),
4005
- /* @__PURE__ */ jsxs4(Box_default, { children: [
4006
- /* @__PURE__ */ jsx5(Text, { color: "#5f87af", children: "\u2514\u2500 " }),
4007
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: items.length > visibleItems.length ? `Showing ${visibleItems.length} of ${items.length}` : `${items.length} ${items.length === 1 ? "source" : "sources"}` })
4052
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4053
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#5f87af", children: "\u2514\u2500 " }),
4054
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: items.length > visibleItems.length ? `Showing ${visibleItems.length} of ${items.length}` : `${items.length} ${items.length === 1 ? "source" : "sources"}` })
4008
4055
  ] })
4009
4056
  ] });
4010
4057
  }
@@ -4022,43 +4069,43 @@ function JobPresentationView({
4022
4069
  presentation,
4023
4070
  expanded
4024
4071
  }) {
4025
- if (presentation.action === "list") return /* @__PURE__ */ jsx5(JobListPresentationView, { presentation, expanded });
4072
+ if (presentation.action === "list") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(JobListPresentationView, { presentation, expanded });
4026
4073
  const state = presentation.state ?? "running";
4027
4074
  const tone = jobStateColor(state);
4028
4075
  const lines = jobOutputLines(presentation.output ?? "");
4029
4076
  const visibleLines = expanded ? lines : [];
4030
4077
  const hiddenLines = lines.length - visibleLines.length;
4031
4078
  const showLog = presentation.action === "read" || presentation.action === "kill" || lines.length > 0;
4032
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
4033
- /* @__PURE__ */ jsxs4(Box_default, { children: [
4034
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u250C\u2500 " }),
4035
- /* @__PURE__ */ jsxs4(Text, { color: tone, bold: true, children: [
4079
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
4080
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4081
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u250C\u2500 " }),
4082
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: tone, bold: true, children: [
4036
4083
  "JOB \xB7 ",
4037
4084
  state.toUpperCase()
4038
4085
  ] })
4039
4086
  ] }),
4040
- /* @__PURE__ */ jsxs4(Box_default, { children: [
4041
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2502 " }),
4042
- /* @__PURE__ */ jsx5(Text, { color: "ansi:whiteBright", bold: true, children: presentation.id ?? "unknown job" }),
4043
- presentation.jobKind === void 0 ? null : /* @__PURE__ */ jsx5(Text, { dimColor: true, children: ` \xB7 ${presentation.jobKind}` })
4087
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4088
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u2502 " }),
4089
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:whiteBright", bold: true, children: presentation.id ?? "unknown job" }),
4090
+ presentation.jobKind === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: ` \xB7 ${presentation.jobKind}` })
4044
4091
  ] }),
4045
- presentation.label === void 0 ? null : /* @__PURE__ */ jsxs4(Box_default, { children: [
4046
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2502 " }),
4047
- /* @__PURE__ */ jsx5(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: presentation.label })
4092
+ presentation.label === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4093
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u2502 " }),
4094
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "ansi:whiteBright", wrap: "truncate-end", children: presentation.label })
4048
4095
  ] }),
4049
- presentation.error === void 0 ? null : /* @__PURE__ */ jsxs4(Box_default, { children: [
4050
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2502 " }),
4051
- /* @__PURE__ */ jsx5(Text, { color: "#e06c50", wrap: "truncate-end", children: presentation.error })
4096
+ presentation.error === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4097
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u2502 " }),
4098
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#e06c50", wrap: "truncate-end", children: presentation.error })
4052
4099
  ] }),
4053
- showLog ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
4054
- /* @__PURE__ */ jsxs4(Box_default, { children: [
4055
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u251C\u2500 " }),
4056
- /* @__PURE__ */ jsx5(Text, { color: tone, bold: true, children: "LOG" }),
4057
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: lines.length === 0 ? " \xB7 NO NEW OUTPUT" : ` \xB7 ${lines.length} ${lines.length === 1 ? "LINE" : "LINES"}` })
4100
+ showLog ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4101
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4102
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u251C\u2500 " }),
4103
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, bold: true, children: "LOG" }),
4104
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: lines.length === 0 ? " \xB7 NO NEW OUTPUT" : ` \xB7 ${lines.length} ${lines.length === 1 ? "LINE" : "LINES"}` })
4058
4105
  ] }),
4059
- hiddenLines > 0 ? /* @__PURE__ */ jsxs4(Box_default, { children: [
4060
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2502 " }),
4061
- /* @__PURE__ */ jsxs4(Text, { dimColor: true, children: [
4106
+ hiddenLines > 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4107
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u2502 " }),
4108
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, children: [
4062
4109
  "\u2026 ",
4063
4110
  hiddenLines,
4064
4111
  " earlier ",
@@ -4066,11 +4113,11 @@ function JobPresentationView({
4066
4113
  " hidden"
4067
4114
  ] })
4068
4115
  ] }) : null,
4069
- visibleLines.map((line, index) => /* @__PURE__ */ jsx5(JobLogLine, { line, tone }, `${index}:${line}`))
4116
+ visibleLines.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(JobLogLine, { line, tone }, `${index}:${line}`))
4070
4117
  ] }) : null,
4071
- /* @__PURE__ */ jsxs4(Box_default, { children: [
4072
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2514\u2500 " }),
4073
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: jobFooter(presentation) })
4118
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4119
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u2514\u2500 " }),
4120
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: jobFooter(presentation) })
4074
4121
  ] })
4075
4122
  ] });
4076
4123
  }
@@ -4080,41 +4127,41 @@ function JobListPresentationView({
4080
4127
  }) {
4081
4128
  const jobs = presentation.jobs ?? [];
4082
4129
  const visibleJobs = expanded ? jobs : [];
4083
- return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
4084
- /* @__PURE__ */ jsxs4(Box_default, { children: [
4085
- /* @__PURE__ */ jsx5(Text, { color: "#d7a657", children: "\u250C\u2500 " }),
4086
- /* @__PURE__ */ jsxs4(Text, { color: "#d7a657", bold: true, children: [
4130
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
4131
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4132
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#d7a657", children: "\u250C\u2500 " }),
4133
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "#d7a657", bold: true, children: [
4087
4134
  "JOBS \xB7 ",
4088
4135
  jobs.length
4089
4136
  ] })
4090
4137
  ] }),
4091
- jobs.length === 0 ? /* @__PURE__ */ jsxs4(Box_default, { children: [
4092
- /* @__PURE__ */ jsx5(Text, { color: "#d7a657", children: "\u2502 " }),
4093
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: "No background jobs" })
4094
- ] }) : visibleJobs.map((job) => /* @__PURE__ */ jsxs4(Box_default, { children: [
4095
- /* @__PURE__ */ jsx5(Text, { color: "#d7a657", children: "\u2502 " }),
4096
- /* @__PURE__ */ jsx5(Text, { color: jobStateColor(job.state), bold: true, children: job.state.toUpperCase().padEnd(9) }),
4097
- /* @__PURE__ */ jsxs4(Text, { color: "ansi:whiteBright", children: [
4138
+ jobs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4139
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#d7a657", children: "\u2502 " }),
4140
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: "No background jobs" })
4141
+ ] }) : visibleJobs.map((job) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4142
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#d7a657", children: "\u2502 " }),
4143
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: jobStateColor(job.state), bold: true, children: job.state.toUpperCase().padEnd(9) }),
4144
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "ansi:whiteBright", children: [
4098
4145
  " ",
4099
4146
  job.id
4100
4147
  ] }),
4101
- /* @__PURE__ */ jsxs4(Text, { dimColor: true, wrap: "truncate-end", children: [
4148
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
4102
4149
  " \xB7 ",
4103
4150
  job.label
4104
4151
  ] })
4105
4152
  ] }, job.id)),
4106
- /* @__PURE__ */ jsxs4(Box_default, { children: [
4107
- /* @__PURE__ */ jsx5(Text, { color: "#d7a657", children: "\u2514\u2500 " }),
4108
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: jobs.length > visibleJobs.length ? `Showing ${visibleJobs.length} of ${jobs.length}` : `${jobs.length} ${jobs.length === 1 ? "job" : "jobs"}` })
4153
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4154
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "#d7a657", children: "\u2514\u2500 " }),
4155
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: jobs.length > visibleJobs.length ? `Showing ${visibleJobs.length} of ${jobs.length}` : `${jobs.length} ${jobs.length === 1 ? "job" : "jobs"}` })
4109
4156
  ] })
4110
4157
  ] });
4111
4158
  }
4112
4159
  function JobLogLine({ line, tone }) {
4113
4160
  const error = /^(?:\[stderr\]|ERR(?:OR)?(?:!|:|\s)|npm ERR!)/iu.test(line.trimStart());
4114
4161
  const stage = /^={3}.*={3}$/u.test(line.trim());
4115
- return /* @__PURE__ */ jsxs4(Box_default, { children: [
4116
- /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2502 " }),
4117
- /* @__PURE__ */ jsx5(
4162
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
4163
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: tone, children: "\u2502 " }),
4164
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4118
4165
  Text,
4119
4166
  {
4120
4167
  ...error ? { color: "#e06c50" } : stage ? { color: "ansi:cyanBright", bold: true } : { dimColor: true },
@@ -4286,11 +4333,11 @@ function PromptLineContent({
4286
4333
  styledCount
4287
4334
  }) {
4288
4335
  const tokenStyle = completedSlashTokenPresentation();
4289
- return /* @__PURE__ */ jsxs4(Text, { children: [
4336
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { children: [
4290
4337
  points.map((point, index) => {
4291
4338
  const styled = index < styledCount;
4292
4339
  const caret = cursorVisible && index === cursor;
4293
- return /* @__PURE__ */ jsx5(
4340
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4294
4341
  Text,
4295
4342
  {
4296
4343
  ...styled ? tokenStyle : {},
@@ -4300,7 +4347,7 @@ function PromptLineContent({
4300
4347
  index
4301
4348
  );
4302
4349
  }),
4303
- cursorVisible && cursor >= points.length ? /* @__PURE__ */ jsx5(Text, { inverse: true, children: " " }) : null
4350
+ cursorVisible && cursor >= points.length ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { inverse: true, children: " " }) : null
4304
4351
  ] });
4305
4352
  }
4306
4353
  function editPrompt(state, edit) {
@@ -4375,6 +4422,13 @@ var FORCE_EXIT_GRACE_MS = 250;
4375
4422
  async function shutdownRuntime(runtime, exit, report, options = {}) {
4376
4423
  const timeoutMs = options.shutdownTimeoutMs ?? SHUTDOWN_TIMEOUT_MS;
4377
4424
  let timedOut = false;
4425
+ if (runtime?.sessionId !== void 0 && options.onSessionEnd !== void 0) {
4426
+ try {
4427
+ options.onSessionEnd(runtime.sessionId);
4428
+ } catch (error) {
4429
+ safeReport(report, safeUiError(error));
4430
+ }
4431
+ }
4378
4432
  try {
4379
4433
  const outcome = await withTimeout(closeAndDisposeRuntime(runtime, report), timeoutMs);
4380
4434
  timedOut = outcome.timedOut;
@@ -4441,6 +4495,7 @@ export {
4441
4495
  isCopyShortcut,
4442
4496
  isOutputToggleShortcut,
4443
4497
  isPlatformShortcut,
4498
+ jumpScroll,
4444
4499
  navigateHistory,
4445
4500
  navigatePromptHistory,
4446
4501
  outputToggleShortcut,
@@ -4456,6 +4511,8 @@ export {
4456
4511
  reverseSearchHistory,
4457
4512
  runTerminalSubmissionChain,
4458
4513
  runningEscapeAction,
4514
+ scrollDown,
4515
+ scrollUp,
4459
4516
  selectWheelScrollTarget,
4460
4517
  shutdownRuntime,
4461
4518
  slashKeyAction,