@wrongstack/tui 0.319.0 → 0.319.1

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.
@@ -12,6 +12,6 @@ interface HelpPanelProps {
12
12
  selected: number;
13
13
  hint?: string | undefined;
14
14
  }
15
- export declare function HelpPanel({ entries, filter, selected, hint, }: HelpPanelProps): React.ReactElement;
15
+ export declare function HelpPanel({ entries, filter, selected, hint }: HelpPanelProps): React.ReactElement;
16
16
  export {};
17
17
  //# sourceMappingURL=help-panel.d.ts.map
@@ -1,11 +1,11 @@
1
1
  import type React from 'react';
2
2
  import type { HistoryProps } from './types.js';
3
- export { AssistantBody, assistantContentWidth, MESSAGE_PANEL_BORDER_WIDTH, MESSAGE_PANEL_CHROME_WIDTH, splitFencedBlocks } from './assistant.js';
3
+ export { AssistantBody, assistantContentWidth, MESSAGE_PANEL_BORDER_WIDTH, MESSAGE_PANEL_CHROME_WIDTH, splitFencedBlocks, } from './assistant.js';
4
4
  export { Banner } from './banner.js';
5
5
  export { CodeBlock, DiffBlock, DiffFileBlock, type DiffFilePreview, type DiffLineKind, type DiffLineRow, type DiffPreview, extractDiffPreview, extractMultiFileDiffs, extractReplaceDiffs, formatDiffStats, formatMultiDiffSummary, MULTI_DIFF_MAX_FILES, MULTI_DIFF_MAX_ROWS, MULTI_DIFF_SUMMARY_THRESHOLD, type MultiDiffSummary, parseUnifiedDiff, summarizeMultiFileDiffs, } from './code-block.js';
6
6
  export { Entry } from './entry.js';
7
7
  export type { AutonomyAgentStatus, BodySegment, HistoryEntry, HistoryProps } from './types.js';
8
- export { AssistantStreamBox, assistantStreamBoxHeight, countLines, firstNonEmpty, fmtBytes, fmtDuration, fmtTok, formatMatchHit, formatToolArgs, formatToolOutput, formatToolVisualOutput, MAX_STREAM_DISPLAY_CHARS, numOf, scanNumberedRange, shortenPath, streamBoxRows, stringOf, ToolOutputLines, ToolStreamBox, type ToolVisualLine, type ToolVisualLineKind, tailForDisplay, toolStreamBoxHeight, truncMid, tryParseJson } from './utils.js';
8
+ export { AssistantStreamBox, assistantStreamBoxHeight, countLines, firstNonEmpty, fmtBytes, fmtDuration, fmtTok, formatMatchHit, formatToolArgs, formatToolOutput, formatToolVisualOutput, MAX_STREAM_DISPLAY_CHARS, numOf, scanNumberedRange, shortenPath, streamBoxRows, stringOf, ToolOutputLines, ToolStreamBox, type ToolVisualLine, type ToolVisualLineKind, tailForDisplay, toolStreamBoxHeight, truncMid, tryParseJson, } from './utils.js';
9
9
  /**
10
10
  * History component — renders committed entries via <Static> so they
11
11
  * flow into terminal scrollback.
@@ -1,7 +1,7 @@
1
1
  import type { TodoItem } from '@wrongstack/core/agent';
2
2
  import type { Lang } from '../../highlight.js';
3
3
  import type { HistoryEntry } from '../../history-entry.js';
4
- export type { AutonomyAgentStatus, HistoryEntry, MemoryActivationItem } from '../../history-entry.js';
4
+ export type { AutonomyAgentStatus, HistoryEntry, MemoryActivationItem, } from '../../history-entry.js';
5
5
  export interface HistoryProps {
6
6
  entries: HistoryEntry[];
7
7
  /**
@@ -1,10 +1,10 @@
1
- export { countLines, firstNonEmpty, fmtBytes, fmtDuration, fmtTok, formatMatchHit, numOf, scanNumberedRange, shortenPath, stringOf, truncMid, tryParseJson } from './basic-format.js';
1
+ export { countLines, firstNonEmpty, fmtBytes, fmtDuration, fmtTok, formatMatchHit, numOf, scanNumberedRange, shortenPath, stringOf, truncMid, tryParseJson, } from './basic-format.js';
2
2
  export { AssistantStreamBox, assistantStreamBoxHeight, MAX_STREAM_DISPLAY_CHARS, streamBoxRows, ToolStreamBox, tailForDisplay, toolStreamBoxHeight, } from './stream-box.js';
3
3
  export { ToolOutputLines } from './visual-lines.js';
4
4
  export type { ToolVisualLine, ToolVisualLineKind } from './tool-visual-types.js';
5
5
  import type { ToolVisualLine } from './tool-visual-types.js';
6
6
  export { formatToolArgs } from './tool-arg-format.js';
7
- export { extractSageBlock, resolveEntrySage, type SageSplit, parseSageMemoryLine, type ParsedSageMemoryLine } from './sage-output-format.js';
7
+ export { extractSageBlock, resolveEntrySage, type SageSplit, parseSageMemoryLine, type ParsedSageMemoryLine, } from './sage-output-format.js';
8
8
  /**
9
9
  * Like `formatToolOutput` but strips SAGE-injected memory lines first.
10
10
  * Returns the tool output lines and any SAGE block lines separately.
@@ -1,2 +1,2 @@
1
- export { AssistantBody, AssistantStreamBox, assistantStreamBoxHeight, type AutonomyAgentStatus, assistantContentWidth, Banner, type BodySegment, CodeBlock, countLines, DiffBlock, DiffFileBlock, type DiffFilePreview, type DiffLineKind, type DiffLineRow, type DiffPreview, Entry, extractDiffPreview, extractMultiFileDiffs, extractReplaceDiffs, firstNonEmpty, fmtBytes, fmtDuration, fmtTok, formatMatchHit, formatMultiDiffSummary, formatToolArgs, formatToolOutput, formatToolVisualOutput, History, type HistoryEntry, type HistoryProps, MAX_STREAM_DISPLAY_CHARS, MESSAGE_PANEL_BORDER_WIDTH, MESSAGE_PANEL_CHROME_WIDTH, MULTI_DIFF_MAX_FILES, MULTI_DIFF_MAX_ROWS, MULTI_DIFF_SUMMARY_THRESHOLD, type MultiDiffSummary, numOf, parseUnifiedDiff, scanNumberedRange, shortenPath, splitFencedBlocks, streamBoxRows, stringOf, summarizeMultiFileDiffs, ToolOutputLines, ToolStreamBox, type ToolVisualLine, type ToolVisualLineKind, tailForDisplay, toolStreamBoxHeight, truncMid, tryParseJson } from './history/index.js';
1
+ export { AssistantBody, AssistantStreamBox, assistantStreamBoxHeight, type AutonomyAgentStatus, assistantContentWidth, Banner, type BodySegment, CodeBlock, countLines, DiffBlock, DiffFileBlock, type DiffFilePreview, type DiffLineKind, type DiffLineRow, type DiffPreview, Entry, extractDiffPreview, extractMultiFileDiffs, extractReplaceDiffs, firstNonEmpty, fmtBytes, fmtDuration, fmtTok, formatMatchHit, formatMultiDiffSummary, formatToolArgs, formatToolOutput, formatToolVisualOutput, History, type HistoryEntry, type HistoryProps, MAX_STREAM_DISPLAY_CHARS, MESSAGE_PANEL_BORDER_WIDTH, MESSAGE_PANEL_CHROME_WIDTH, MULTI_DIFF_MAX_FILES, MULTI_DIFF_MAX_ROWS, MULTI_DIFF_SUMMARY_THRESHOLD, type MultiDiffSummary, numOf, parseUnifiedDiff, scanNumberedRange, shortenPath, splitFencedBlocks, streamBoxRows, stringOf, summarizeMultiFileDiffs, ToolOutputLines, ToolStreamBox, type ToolVisualLine, type ToolVisualLineKind, tailForDisplay, toolStreamBoxHeight, truncMid, tryParseJson, } from './history/index.js';
2
2
  //# sourceMappingURL=history.d.ts.map
@@ -13,6 +13,6 @@ interface ModePickerProps {
13
13
  hint?: string | undefined;
14
14
  }
15
15
  export declare function toModeOptions(modes: Mode[], activeId: string | null): ModeOption[];
16
- export declare function ModePicker({ modes, selected, hint, }: ModePickerProps): React.ReactElement;
16
+ export declare function ModePicker({ modes, selected, hint }: ModePickerProps): React.ReactElement;
17
17
  export {};
18
18
  //# sourceMappingURL=mode-picker.d.ts.map
@@ -9,6 +9,6 @@ interface ShadowPanelProps {
9
9
  shadow: ShadowState;
10
10
  hint?: string | undefined;
11
11
  }
12
- export declare function ShadowPanel({ shadow, hint, }: ShadowPanelProps): React.ReactElement;
12
+ export declare function ShadowPanel({ shadow, hint }: ShadowPanelProps): React.ReactElement;
13
13
  export {};
14
14
  //# sourceMappingURL=shadow-panel.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
2
  import type { StatusBarProps } from './status-bar-types.js';
3
3
  export { contextBarColor, fmtElapsed, hasTokenDisplay, nodeText, planChipFit, renderMeter, renderProgress, stateChip, type TokenDisplayTotals, tokenDisplayTotals, truncateChip, } from './status-bar-format.js';
4
- export { chipColor, SPINNER_INTERVAL_MS, STACK_ORANGE, STATUSLINE_ICONS } from './status-bar-icons.js';
4
+ export { chipColor, SPINNER_INTERVAL_MS, STACK_ORANGE, STATUSLINE_ICONS, } from './status-bar-icons.js';
5
5
  export type { BrainStatusChip, ContextWindow, FleetAgentDetail, FleetCounts, MailboxStatus, PlanCounts, StatusBarProps, TaskCounts, TodoCounts, } from './status-bar-types.js';
6
6
  /**
7
7
  * Four-rail status bar — one semantic question per line, left-to-right in
@@ -9,7 +9,7 @@ interface UseModePickerOptions {
9
9
  getModes?: (() => Promise<GetModesResult>) | undefined;
10
10
  }
11
11
  export declare function buildModePickerOptions(result: GetModesResult): import("../components/mode-picker.js").ModeOption[];
12
- export declare function useModePicker({ dispatch, getModes, }: UseModePickerOptions): {
12
+ export declare function useModePicker({ dispatch, getModes }: UseModePickerOptions): {
13
13
  openModePicker: () => Promise<void>;
14
14
  };
15
15
  export {};
package/dist/index.js CHANGED
@@ -69,7 +69,14 @@ async function chronicleHealth(projectRoot) {
69
69
  ...quarantined[0] ? { lastError: quarantined[0].reason } : health2.watcher.lastError ? { lastError: health2.watcher.lastError } : {}
70
70
  };
71
71
  } catch (error) {
72
- return failureService("chronicle", "Chronicle telemetry", true, access?.mode ?? "unavailable", error, Date.now() - startedAt);
72
+ return failureService(
73
+ "chronicle",
74
+ "Chronicle telemetry",
75
+ true,
76
+ access?.mode ?? "unavailable",
77
+ error,
78
+ Date.now() - startedAt
79
+ );
73
80
  } finally {
74
81
  await access?.close();
75
82
  }
@@ -90,7 +97,9 @@ async function codebaseIndexHealth(projectRoot) {
90
97
  };
91
98
  }
92
99
  try {
93
- const health2 = await checkCodebaseIndexServerHealth(projectRoot, void 0, { timeoutMs: 2e3 });
100
+ const health2 = await checkCodebaseIndexServerHealth(projectRoot, void 0, {
101
+ timeoutMs: 2e3
102
+ });
94
103
  const connection = getIndexState().server;
95
104
  return {
96
105
  id: "codebase-index",
@@ -112,12 +121,26 @@ async function codebaseIndexHealth(projectRoot) {
112
121
  } catch (error) {
113
122
  if (isOfflineConnectionError(error)) {
114
123
  return {
115
- ...failureService("codebase-index", "Codebase index", false, "on-demand project-server", error, Date.now() - startedAt),
124
+ ...failureService(
125
+ "codebase-index",
126
+ "Codebase index",
127
+ false,
128
+ "on-demand project-server",
129
+ error,
130
+ Date.now() - startedAt
131
+ ),
116
132
  status: "offline",
117
133
  detail: "Not running for this project; it starts on demand when indexing is used."
118
134
  };
119
135
  }
120
- return failureService("codebase-index", "Codebase index", false, "project-server", error, Date.now() - startedAt);
136
+ return failureService(
137
+ "codebase-index",
138
+ "Codebase index",
139
+ false,
140
+ "project-server",
141
+ error,
142
+ Date.now() - startedAt
143
+ );
121
144
  }
122
145
  }
123
146
  async function sageHealth(projectRoot) {
@@ -163,7 +186,14 @@ async function sageHealth(projectRoot) {
163
186
  activeRequests: status.pendingRequests
164
187
  };
165
188
  } catch (error) {
166
- return failureService("sage", "SAGE memory", false, "project-server", error, Date.now() - startedAt);
189
+ return failureService(
190
+ "sage",
191
+ "SAGE memory",
192
+ false,
193
+ "project-server",
194
+ error,
195
+ Date.now() - startedAt
196
+ );
167
197
  } finally {
168
198
  connection.close();
169
199
  }
@@ -184,7 +214,14 @@ async function kanbanHealth(projectRoot) {
184
214
  try {
185
215
  connection = await getKanbanServerConnection(projectRoot);
186
216
  } catch (error) {
187
- return failureService("kanban", "Kanban IPC", false, "project-server", error, Date.now() - startedAt);
217
+ return failureService(
218
+ "kanban",
219
+ "Kanban IPC",
220
+ false,
221
+ "project-server",
222
+ error,
223
+ Date.now() - startedAt
224
+ );
188
225
  }
189
226
  if (!connection) {
190
227
  return {
@@ -214,7 +251,14 @@ async function kanbanHealth(projectRoot) {
214
251
  uptimeMs: Date.now() - new Date(status.startedAt).getTime()
215
252
  };
216
253
  } catch (error) {
217
- return failureService("kanban", "Kanban IPC", true, "project-server", error, Date.now() - startedAt);
254
+ return failureService(
255
+ "kanban",
256
+ "Kanban IPC",
257
+ true,
258
+ "project-server",
259
+ error,
260
+ Date.now() - startedAt
261
+ );
218
262
  }
219
263
  }
220
264
  async function mailboxHealth(projectRoot) {
@@ -262,7 +306,14 @@ async function mailboxHealth(projectRoot) {
262
306
  uptimeMs: Date.now() - new Date(status.startedAt).getTime()
263
307
  };
264
308
  } catch (error) {
265
- return failureService("mailbox", "Mailbox IPC", true, "project-server", error, Date.now() - startedAt);
309
+ return failureService(
310
+ "mailbox",
311
+ "Mailbox IPC",
312
+ true,
313
+ "project-server",
314
+ error,
315
+ Date.now() - startedAt
316
+ );
266
317
  } finally {
267
318
  connection.close();
268
319
  }
@@ -3951,9 +4002,7 @@ function ThresholdSection({
3951
4002
  const nextBoundary = ZONES.find((z) => curVal < z.from);
3952
4003
  const maxTok = data.ctxMaxTokens ?? 0;
3953
4004
  const diffPct = nextBoundary ? nextBoundary.from - curVal : 0;
3954
- const headroom = nextBoundary && maxTok > 0 ? `${fmtPct(diffPct)} (${fmtTok2(
3955
- diffPct / 100 * maxTok
3956
- )}) until ${nextBoundary.desc}` : nextBoundary ? `${fmtPct(diffPct)} until ${nextBoundary.desc}` : "in the final zone \u2014 compaction is overdue";
4005
+ const headroom = nextBoundary && maxTok > 0 ? `${fmtPct(diffPct)} (${fmtTok2(diffPct / 100 * maxTok)}) until ${nextBoundary.desc}` : nextBoundary ? `${fmtPct(diffPct)} until ${nextBoundary.desc}` : "in the final zone \u2014 compaction is overdue";
3957
4006
  const LABEL_W = 9;
3958
4007
  const RANGE_W = 9;
3959
4008
  const azClr = zoneColor(activeZone);
@@ -5055,7 +5104,7 @@ function FleetPanel({
5055
5104
  glyphs.fleet,
5056
5105
  " AGENT SWARM"
5057
5106
  ] }),
5058
- terminal.columns >= 60 ? /* @__PURE__ */ jsx8(Text, { color: theme.textMuted, children: " / parallel workspace" }) : null,
5107
+ terminal.columns >= 60 ? /* @__PURE__ */ jsx8(Text, { color: theme.textMuted, children: " / parallel workspace" }) : null,
5059
5108
  /* @__PURE__ */ jsx8(Box, { flexGrow: 1 }),
5060
5109
  /* @__PURE__ */ jsxs7(Text, { color: runningCount > 0 ? theme.success : theme.textMuted, bold: runningCount > 0, children: [
5061
5110
  runningCount > 0 ? "\u25CF" : "\u25CB",
@@ -5064,14 +5113,14 @@ function FleetPanel({
5064
5113
  " LIVE"
5065
5114
  ] }),
5066
5115
  terminal.columns >= 72 ? /* @__PURE__ */ jsxs7(Text, { color: theme.textMuted, children: [
5067
- " ",
5116
+ " ",
5068
5117
  totalIterations,
5069
5118
  "i \xB7 ",
5070
5119
  totalTools,
5071
5120
  "t"
5072
5121
  ] }) : null,
5073
5122
  cost && terminal.columns >= 88 ? /* @__PURE__ */ jsxs7(Text, { color: theme.success, children: [
5074
- " ",
5123
+ " ",
5075
5124
  cost
5076
5125
  ] }) : null
5077
5126
  ] }),
@@ -5085,10 +5134,10 @@ function FleetPanel({
5085
5134
  collabSession.bugCount,
5086
5135
  " bugs \xB7 ",
5087
5136
  collabSession.planCount,
5088
- " plans \xB7 ",
5089
- collabSession.evalCount,
5137
+ " plans \xB7",
5090
5138
  " ",
5091
- "reviews"
5139
+ collabSession.evalCount,
5140
+ " reviews"
5092
5141
  ] }),
5093
5142
  collabSession.sessionId ? /* @__PURE__ */ jsxs7(Text, { color: theme.textMuted, children: [
5094
5143
  " \xB7 ",
@@ -5132,7 +5181,7 @@ function FleetPanel({
5132
5181
  terminal.columns >= 64 ? /* @__PURE__ */ jsx8(Text, { color: theme.textMuted, children: "F3 details" }) : null
5133
5182
  ] }),
5134
5183
  todoRows.map((row) => /* @__PURE__ */ jsxs7(Box, { height: 1, children: [
5135
- /* @__PURE__ */ jsx8(Text, { color: theme.textMuted, children: " \u251C\u2500 " }),
5184
+ /* @__PURE__ */ jsx8(Text, { color: theme.textMuted, children: " \u251C\u2500 " }),
5136
5185
  /* @__PURE__ */ jsx8(Text, { color: row.color, children: row.marker }),
5137
5186
  /* @__PURE__ */ jsx8(Text, { children: " " }),
5138
5187
  /* @__PURE__ */ jsx8(
@@ -5744,7 +5793,10 @@ function helpSections() {
5744
5793
  { keys: "/fleet", desc: "multi-agent fleet controls" },
5745
5794
  { keys: "/goal", desc: "set an autonomous goal" },
5746
5795
  { keys: "/autonomy", desc: "autonomy mode (eternal / off)" },
5747
- { keys: "/settings", desc: "settings picker (also: /settings <chord> <value> \xB7 /settings reset <chord>)" },
5796
+ {
5797
+ keys: "/settings",
5798
+ desc: "settings picker (also: /settings <chord> <value> \xB7 /settings reset <chord>)"
5799
+ },
5748
5800
  { keys: "/settings-get", desc: "show setting value(s) without opening picker" },
5749
5801
  { keys: "/clear", desc: "clear the conversation" }
5750
5802
  ]
@@ -5933,10 +5985,7 @@ function HelpOverlay() {
5933
5985
  0
5934
5986
  );
5935
5987
  const toolKeyCol = toolKeyWidth + 2;
5936
- const toolDescWidth = Math.max(
5937
- 0,
5938
- Math.floor((size.contentWidth - 2 * toolKeyCol - 2) / 2)
5939
- );
5988
+ const toolDescWidth = Math.max(0, Math.floor((size.contentWidth - 2 * toolKeyCol - 2) / 2));
5940
5989
  return /* @__PURE__ */ jsxs10(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
5941
5990
  /* @__PURE__ */ jsxs10(Box, { flexDirection: "row", gap: 1, children: [
5942
5991
  /* @__PURE__ */ jsx11(Text, { bold: true, color: theme.accent, children: "Keyboard shortcuts" }),
@@ -5953,9 +6002,7 @@ function HelpOverlay() {
5953
6002
  /* @__PURE__ */ jsx11(Text, { dimColor: true, children: truncatePanelText(row.desc, descWidth) })
5954
6003
  ] }, `entry-${win.start + i}`);
5955
6004
  }
5956
- const leftDesc = truncatePanelText(row.left.desc, toolDescWidth).padEnd(
5957
- toolDescWidth + 2
5958
- );
6005
+ const leftDesc = truncatePanelText(row.left.desc, toolDescWidth).padEnd(toolDescWidth + 2);
5959
6006
  return /* @__PURE__ */ jsxs10(Text, { children: [
5960
6007
  /* @__PURE__ */ jsx11(Text, { color: theme.accent, children: row.left.keys.padEnd(toolKeyCol) }),
5961
6008
  /* @__PURE__ */ jsx11(Text, { dimColor: true, children: leftDesc }),
@@ -8368,7 +8415,11 @@ function applyMemoryContextSnapshot(state, payload) {
8368
8415
  }
8369
8416
  }
8370
8417
  }
8371
- return { ...state, memories: pruneExitedMemories(memories), transitions: transitions.slice(0, 100) };
8418
+ return {
8419
+ ...state,
8420
+ memories: pruneExitedMemories(memories),
8421
+ transitions: transitions.slice(0, 100)
8422
+ };
8372
8423
  }
8373
8424
  function placeholder(id, at, state) {
8374
8425
  return {
@@ -11358,8 +11409,10 @@ function formatExpiry(expiresAt) {
11358
11409
  const now = Date.now();
11359
11410
  const msLeft = expiry - now;
11360
11411
  if (msLeft <= 0) return { text: "expired", color: UI_COLORS.error };
11361
- if (msLeft < 60 * 6e4) return { text: `${Math.round(msLeft / 6e4)}m left`, color: UI_COLORS.error };
11362
- if (msLeft < 24 * 60 * 6e4) return { text: `${Math.round(msLeft / (60 * 6e4))}h left`, color: UI_COLORS.warning };
11412
+ if (msLeft < 60 * 6e4)
11413
+ return { text: `${Math.round(msLeft / 6e4)}m left`, color: UI_COLORS.error };
11414
+ if (msLeft < 24 * 60 * 6e4)
11415
+ return { text: `${Math.round(msLeft / (60 * 6e4))}h left`, color: UI_COLORS.warning };
11363
11416
  return { text: `${Math.round(msLeft / (24 * 60 * 6e4))}d left`, color: UI_COLORS.inactive };
11364
11417
  }
11365
11418
  function keySummary(keyRow) {
@@ -11714,7 +11767,7 @@ function AutonomyPicker({
11714
11767
  /* @__PURE__ */ jsx32(Text, { color: "cyan", bold: true, children: "\u2501\u2501 Autonomy Mode \u2501\u2501" }),
11715
11768
  /* @__PURE__ */ jsx32(Text, { dimColor: true, children: "\u2191/\u2193 navigate \xB7 Enter select \xB7 Esc cancel \xB7 Ctrl+C exit" }),
11716
11769
  hasAbove ? /* @__PURE__ */ jsxs32(Text, { dimColor: true, children: [
11717
- " \u2026 ",
11770
+ " \u2026 ",
11718
11771
  start,
11719
11772
  " more above"
11720
11773
  ] }) : null,
@@ -11735,7 +11788,7 @@ function AutonomyPicker({
11735
11788
  );
11736
11789
  }),
11737
11790
  hasBelow ? /* @__PURE__ */ jsxs32(Text, { dimColor: true, children: [
11738
- " \u2026 ",
11791
+ " \u2026 ",
11739
11792
  options.length - end,
11740
11793
  " more below"
11741
11794
  ] }) : null,
@@ -16096,7 +16149,7 @@ function DesignPicker({ kits, selected, stack }) {
16096
16149
  ] }),
16097
16150
  kits.length === 0 ? /* @__PURE__ */ jsx44(Text, { dimColor: true, children: "No design kits installed." }) : /* @__PURE__ */ jsxs44(Fragment15, { children: [
16098
16151
  hasAbove ? /* @__PURE__ */ jsxs44(Text, { dimColor: true, children: [
16099
- " \u2026 ",
16152
+ " \u2026 ",
16100
16153
  start,
16101
16154
  " more above"
16102
16155
  ] }) : null,
@@ -16109,7 +16162,7 @@ function DesignPicker({ kits, selected, stack }) {
16109
16162
  ] }) }, kit.id);
16110
16163
  }),
16111
16164
  hasBelow ? /* @__PURE__ */ jsxs44(Text, { dimColor: true, children: [
16112
- " \u2026 ",
16165
+ " \u2026 ",
16113
16166
  kits.length - end,
16114
16167
  " more below"
16115
16168
  ] }) : null
@@ -16769,12 +16822,7 @@ function windowRows(rows, focus, max) {
16769
16822
  }
16770
16823
  return { rows: rows.slice(start, end), start, end, contextHeader };
16771
16824
  }
16772
- function HelpPanel({
16773
- entries,
16774
- filter,
16775
- selected,
16776
- hint
16777
- }) {
16825
+ function HelpPanel({ entries, filter, selected, hint }) {
16778
16826
  const { stdout } = useStdout();
16779
16827
  const termRows = stdout?.rows ?? 24;
16780
16828
  const maxVisible = Math.max(6, termRows - CHROME_ROWS3);
@@ -16957,11 +17005,7 @@ function familyColor(family) {
16957
17005
  return "yellow";
16958
17006
  }
16959
17007
  }
16960
- function ModePicker({
16961
- modes,
16962
- selected,
16963
- hint
16964
- }) {
17008
+ function ModePicker({ modes, selected, hint }) {
16965
17009
  const activeMode = modes.find((mode) => mode.isActive);
16966
17010
  const modeMeta = `${modes.length} mode${modes.length === 1 ? "" : "s"}`;
16967
17011
  return /* @__PURE__ */ jsxs53(Box, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 1, children: [
@@ -17746,10 +17790,7 @@ function RefineFailurePanel({
17746
17790
  });
17747
17791
  if (view === "pick") {
17748
17792
  const total = filteredModels.length;
17749
- const start = Math.max(
17750
- 0,
17751
- Math.min(cursor - Math.floor(PICK_WINDOW / 2), total - PICK_WINDOW)
17752
- );
17793
+ const start = Math.max(0, Math.min(cursor - Math.floor(PICK_WINDOW / 2), total - PICK_WINDOW));
17753
17794
  const windowStart = Math.max(0, start);
17754
17795
  const visible = filteredModels.slice(windowStart, windowStart + PICK_WINDOW);
17755
17796
  return /* @__PURE__ */ jsxs59(
@@ -18068,7 +18109,7 @@ function ResumePicker({
18068
18109
  error ? /* @__PURE__ */ jsx61(Text, { color: "red", children: error }) : null,
18069
18110
  sessions.length === 0 && !busy ? /* @__PURE__ */ jsx61(Text, { dimColor: true, children: "No sessions found." }) : /* @__PURE__ */ jsxs61(Fragment22, { children: [
18070
18111
  hasAbove ? /* @__PURE__ */ jsxs61(Text, { dimColor: true, children: [
18071
- " \u2026 ",
18112
+ " \u2026 ",
18072
18113
  start,
18073
18114
  " more above"
18074
18115
  ] }) : null,
@@ -18103,7 +18144,8 @@ function ResumePicker({
18103
18144
  ")"
18104
18145
  ] }) : null,
18105
18146
  /* @__PURE__ */ jsxs61(Text, { dimColor: true, children: [
18106
- " \xB7 ",
18147
+ " ",
18148
+ "\xB7 ",
18107
18149
  s2.id,
18108
18150
  " \xB7 ",
18109
18151
  date
@@ -18132,7 +18174,7 @@ function ResumePicker({
18132
18174
  ] }, s2.id);
18133
18175
  }),
18134
18176
  hasBelow ? /* @__PURE__ */ jsxs61(Text, { dimColor: true, children: [
18135
- " \u2026 ",
18177
+ " \u2026 ",
18136
18178
  sessions.length - end,
18137
18179
  " more below"
18138
18180
  ] }) : null
@@ -18208,17 +18250,25 @@ function SendModePicker({
18208
18250
  /* @__PURE__ */ jsx62(Text, { color: "white", children: formatSendModeMessagePreview(messagePreview) })
18209
18251
  ] }) : null,
18210
18252
  /* @__PURE__ */ jsx62(Text, { dimColor: true, children: "q/b/s pick \xB7 \u2191/\u2193 move \xB7 Enter select \xB7 Esc \u2192 back to input" }),
18211
- SEND_MODE_OPTIONS.map((opt, i) => /* @__PURE__ */ jsxs62(Text, { inverse: i === selected, ...i === selected ? { color: opt.color } : {}, children: [
18212
- i === selected ? "\u203A " : " ",
18213
- /* @__PURE__ */ jsxs62(Text, { bold: true, color: opt.color, children: [
18214
- "[",
18215
- opt.key,
18216
- "]"
18217
- ] }),
18218
- " ",
18219
- /* @__PURE__ */ jsx62(Text, { bold: true, children: opt.label.padEnd(12) }),
18220
- /* @__PURE__ */ jsx62(Text, { dimColor: true, children: opt.description })
18221
- ] }, opt.mode))
18253
+ SEND_MODE_OPTIONS.map((opt, i) => /* @__PURE__ */ jsxs62(
18254
+ Text,
18255
+ {
18256
+ inverse: i === selected,
18257
+ ...i === selected ? { color: opt.color } : {},
18258
+ children: [
18259
+ i === selected ? "\u203A " : " ",
18260
+ /* @__PURE__ */ jsxs62(Text, { bold: true, color: opt.color, children: [
18261
+ "[",
18262
+ opt.key,
18263
+ "]"
18264
+ ] }),
18265
+ " ",
18266
+ /* @__PURE__ */ jsx62(Text, { bold: true, children: opt.label.padEnd(12) }),
18267
+ /* @__PURE__ */ jsx62(Text, { dimColor: true, children: opt.description })
18268
+ ]
18269
+ },
18270
+ opt.mode
18271
+ ))
18222
18272
  ] });
18223
18273
  }
18224
18274
 
@@ -18835,10 +18885,16 @@ function resolveSettingsFieldValue(field, input) {
18835
18885
  if (field === 60) {
18836
18886
  const url = input.trim();
18837
18887
  if (url.length === 0) {
18838
- return { ok: false, error: `"${input}" is not a valid proxy URL. Use http://host:port or https://host:port.` };
18888
+ return {
18889
+ ok: false,
18890
+ error: `"${input}" is not a valid proxy URL. Use http://host:port or https://host:port.`
18891
+ };
18839
18892
  }
18840
18893
  if (!/^https?:\/\//i.test(url)) {
18841
- return { ok: false, error: `"${input}" is not a valid proxy URL. Use http://host:port or https://host:port.` };
18894
+ return {
18895
+ ok: false,
18896
+ error: `"${input}" is not a valid proxy URL. Use http://host:port or https://host:port.`
18897
+ };
18842
18898
  }
18843
18899
  return { ok: true, patch: { wrongProxyUrl: url }, label, displayValue: url };
18844
18900
  }
@@ -19713,7 +19769,13 @@ function SettingsPicker({
19713
19769
  children: `Filter: ${filter} (${filteredFieldIndices.length} match${filteredFieldIndices.length === 1 ? "" : "es"})`
19714
19770
  }
19715
19771
  ) : /* @__PURE__ */ jsx64(Text, { dimColor: true, children: "\u2191/\u2193 field \xB7 \u2190/\u2192 change + autosave \xB7 `/` to search \xB7 F5 to close" }),
19716
- filterActive && filterHasAbove ? /* @__PURE__ */ jsx64(Text, { dimColor: true, children: ` \u2191 ${filterWindowStart} match${filterWindowStart === 1 ? "" : "es"} above` }) : null,
19772
+ filterActive && filterHasAbove ? /* @__PURE__ */ jsx64(
19773
+ Text,
19774
+ {
19775
+ dimColor: true,
19776
+ children: ` \u2191 ${filterWindowStart} match${filterWindowStart === 1 ? "" : "es"} above`
19777
+ }
19778
+ ) : null,
19717
19779
  !filterActive && hasAbove ? /* @__PURE__ */ jsx64(Text, { dimColor: true, children: ` \u2191 ${windowStart} field${windowStart === 1 ? "" : "s"} above` }) : null,
19718
19780
  filterActive && filteredFieldIndices.length === 0 ? /* @__PURE__ */ jsx64(Text, { dimColor: true, italic: true, children: "No matching settings rows." }) : null,
19719
19781
  /* @__PURE__ */ jsx64(
@@ -19731,7 +19793,13 @@ function SettingsPicker({
19731
19793
  filterWindowEnd
19732
19794
  }
19733
19795
  ),
19734
- filterActive && filterHasBelow ? /* @__PURE__ */ jsx64(Text, { dimColor: true, children: ` \u2193 ${filterMatchCount - filterWindowEnd} match${filterMatchCount - filterWindowEnd === 1 ? "" : "es"} below` }) : null,
19796
+ filterActive && filterHasBelow ? /* @__PURE__ */ jsx64(
19797
+ Text,
19798
+ {
19799
+ dimColor: true,
19800
+ children: ` \u2193 ${filterMatchCount - filterWindowEnd} match${filterMatchCount - filterWindowEnd === 1 ? "" : "es"} below`
19801
+ }
19802
+ ) : null,
19735
19803
  !filterActive && hasBelow ? /* @__PURE__ */ jsx64(
19736
19804
  Text,
19737
19805
  {
@@ -19748,10 +19816,7 @@ function SettingsPicker({
19748
19816
 
19749
19817
  // src/components/shadow-panel.tsx
19750
19818
  import { jsx as jsx65, jsxs as jsxs65 } from "react/jsx-runtime";
19751
- function ShadowPanel({
19752
- shadow,
19753
- hint
19754
- }) {
19819
+ function ShadowPanel({ shadow, hint }) {
19755
19820
  return /* @__PURE__ */ jsxs65(Box, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 1, children: [
19756
19821
  /* @__PURE__ */ jsx65(Text, { bold: true, color: "blue", children: "\u2501\u2501 Shadow Agent \u2501\u2501" }),
19757
19822
  /* @__PURE__ */ jsx65(Text, { dimColor: true, children: "s start \xB7 t stop \xB7 i cycle interval \xB7 m cycle model \xB7 Esc close" }),
@@ -19768,7 +19833,7 @@ function ShadowPanel({
19768
19833
  /* @__PURE__ */ jsxs65(Box, { marginTop: 1, children: [
19769
19834
  /* @__PURE__ */ jsx65(Text, { bold: true, children: "Interval: " }),
19770
19835
  /* @__PURE__ */ jsx65(Text, { color: "yellow", children: shadow.intervalMs >= 1e3 ? `${shadow.intervalMs / 1e3}s` : `${shadow.intervalMs}ms` }),
19771
- /* @__PURE__ */ jsx65(Text, { dimColor: true, children: " (min 5s)" })
19836
+ /* @__PURE__ */ jsx65(Text, { dimColor: true, children: " (min 5s)" })
19772
19837
  ] }),
19773
19838
  /* @__PURE__ */ jsx65(Box, { marginTop: 1, children: /* @__PURE__ */ jsx65(Text, { dimColor: true, children: shadow.running ? "Press t to stop the Shadow Agent" : "Press s to start the Shadow Agent" }) })
19774
19839
  ] }),
@@ -20018,7 +20083,7 @@ function SlashMenu({ query, matches, selected }) {
20018
20083
  ] }),
20019
20084
  /* @__PURE__ */ jsx69(Text, { dimColor: true, children: "Type to filter commands by name, alias, or description." }),
20020
20085
  hiddenAbove > 0 && /* @__PURE__ */ jsxs69(Text, { dimColor: true, children: [
20021
- " \u2191 ",
20086
+ " \u2191 ",
20022
20087
  hiddenAbove,
20023
20088
  " more"
20024
20089
  ] }),
@@ -20034,25 +20099,33 @@ function SlashMenu({ query, matches, selected }) {
20034
20099
  ] }, `cat-${row.category}`);
20035
20100
  }
20036
20101
  const { match: m, index: i } = row;
20037
- return /* @__PURE__ */ jsxs69(Text, { inverse: i === selected, ...i === selected ? { color: "cyan" } : {}, children: [
20038
- i === selected ? "\u203A " : " ",
20039
- /* @__PURE__ */ jsx69(Text, { bold: true, children: m.name }),
20040
- m.argsHint ? /* @__PURE__ */ jsxs69(Text, { dimColor: true, children: [
20041
- " ",
20042
- m.argsHint
20043
- ] }) : null,
20044
- m.matchedAlias ? /* @__PURE__ */ jsxs69(Text, { dimColor: true, children: [
20045
- " alias /",
20046
- m.matchedAlias
20047
- ] }) : null,
20048
- /* @__PURE__ */ jsxs69(Text, { dimColor: true, children: [
20049
- " \u2014 ",
20050
- m.description
20051
- ] })
20052
- ] }, m.name);
20102
+ return /* @__PURE__ */ jsxs69(
20103
+ Text,
20104
+ {
20105
+ inverse: i === selected,
20106
+ ...i === selected ? { color: "cyan" } : {},
20107
+ children: [
20108
+ i === selected ? "\u203A " : " ",
20109
+ /* @__PURE__ */ jsx69(Text, { bold: true, children: m.name }),
20110
+ m.argsHint ? /* @__PURE__ */ jsxs69(Text, { dimColor: true, children: [
20111
+ " ",
20112
+ m.argsHint
20113
+ ] }) : null,
20114
+ m.matchedAlias ? /* @__PURE__ */ jsxs69(Text, { dimColor: true, children: [
20115
+ " alias /",
20116
+ m.matchedAlias
20117
+ ] }) : null,
20118
+ /* @__PURE__ */ jsxs69(Text, { dimColor: true, children: [
20119
+ " \u2014 ",
20120
+ m.description
20121
+ ] })
20122
+ ]
20123
+ },
20124
+ m.name
20125
+ );
20053
20126
  }),
20054
20127
  hiddenBelow > 0 && /* @__PURE__ */ jsxs69(Text, { dimColor: true, children: [
20055
- " \u2193 ",
20128
+ " \u2193 ",
20056
20129
  hiddenBelow,
20057
20130
  " more"
20058
20131
  ] }),
@@ -20289,13 +20362,12 @@ function ThemePreview({
20289
20362
  /* @__PURE__ */ jsx71(Text, { dimColor: true, children: "sample" }),
20290
20363
  /* @__PURE__ */ jsxs71(Box, { flexDirection: "column", children: [
20291
20364
  /* @__PURE__ */ jsx71(Text, { color: preset.user, bold: true, children: "USER:" }),
20292
- /* @__PURE__ */ jsx71(Text, { color: preset.textPrimary, children: " Summarize the changes in this session." }),
20365
+ /* @__PURE__ */ jsx71(Text, { color: preset.textPrimary, children: " Summarize the changes in this session." }),
20293
20366
  /* @__PURE__ */ jsx71(Text, { color: preset.assistant, bold: true, children: "ASSISTANT:" }),
20294
- /* @__PURE__ */ jsx71(Text, { color: preset.textPrimary, children: " I reviewed the diff and updated the picker." }),
20367
+ /* @__PURE__ */ jsx71(Text, { color: preset.textPrimary, children: " I reviewed the diff and updated the picker." }),
20295
20368
  /* @__PURE__ */ jsxs71(Text, { color: preset.tool, children: [
20296
20369
  " ",
20297
- "\u2733 tool: read \xB7 edit \xB7 test",
20298
- " ",
20370
+ "\u2733 tool: read \xB7 edit \xB7 test ",
20299
20371
  /* @__PURE__ */ jsx71(Text, { color: preset.success, children: "\u2713 passed" })
20300
20372
  ] })
20301
20373
  ] })
@@ -20354,13 +20426,13 @@ function ThemePreview({
20354
20426
  render: /* @__PURE__ */ jsxs71(Box, { flexDirection: "column", children: [
20355
20427
  /* @__PURE__ */ jsx71(Text, { dimColor: true, children: "palette" }),
20356
20428
  /* @__PURE__ */ jsxs71(Box, { flexDirection: "row", children: [
20357
- /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.accent, children: " " }),
20358
- /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.brandPrimary, children: " " }),
20359
- /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.brandAccent, children: " " }),
20360
- /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.surface, children: " " }),
20361
- /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.surfaceRaised, children: " " }),
20362
- /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.diffAddBg, children: " " }),
20363
- /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.diffDelBg, children: " " })
20429
+ /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.accent, children: " " }),
20430
+ /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.brandPrimary, children: " " }),
20431
+ /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.brandAccent, children: " " }),
20432
+ /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.surface, children: " " }),
20433
+ /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.surfaceRaised, children: " " }),
20434
+ /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.diffAddBg, children: " " }),
20435
+ /* @__PURE__ */ jsx71(Text, { backgroundColor: preset.diffDelBg, children: " " })
20364
20436
  ] })
20365
20437
  ] })
20366
20438
  }
@@ -20418,7 +20490,7 @@ function ThemePicker({
20418
20490
  /* @__PURE__ */ jsx72(Text, { color: "cyan", bold: true, children: "\u2501\u2501 TUI Theme \u2501\u2501" }),
20419
20491
  /* @__PURE__ */ jsx72(Text, { dimColor: true, children: "\u2191/\u2193 navigate \xB7 Enter apply \xB7 Esc cancel" }),
20420
20492
  hasAbove ? /* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
20421
- " \u2026 ",
20493
+ " \u2026 ",
20422
20494
  start,
20423
20495
  " more above"
20424
20496
  ] }) : null,
@@ -20434,7 +20506,7 @@ function ThemePicker({
20434
20506
  ] }, opt.id);
20435
20507
  }),
20436
20508
  hasBelow ? /* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
20437
- " \u2026 ",
20509
+ " \u2026 ",
20438
20510
  options.length - end,
20439
20511
  " more below"
20440
20512
  ] }) : null,
@@ -20672,14 +20744,7 @@ function AppViewPickers({
20672
20744
  routedToSidebar,
20673
20745
  panelPositions
20674
20746
  }) {
20675
- const {
20676
- agent,
20677
- events,
20678
- getSettings,
20679
- onYolo,
20680
- profileConfigPath,
20681
- saveSettings
20682
- } = host;
20747
+ const { agent, events, getSettings, onYolo, profileConfigPath, saveSettings } = host;
20683
20748
  const {
20684
20749
  state,
20685
20750
  dispatch,
@@ -21089,10 +21154,7 @@ function AppViewPickers({
21089
21154
  const t = setTimeout(resolve, 1500);
21090
21155
  t.unref?.();
21091
21156
  });
21092
- void Promise.race([
21093
- escConfirmDir.terminateAll().catch(() => void 0),
21094
- cap
21095
- ]);
21157
+ void Promise.race([escConfirmDir.terminateAll().catch(() => void 0), cap]);
21096
21158
  }
21097
21159
  const droppedCount = state.queue.length;
21098
21160
  if (droppedCount > 0) dispatch({ type: "queueClear" });
@@ -21801,9 +21863,7 @@ function SidebarContent({
21801
21863
  rows.push([activeSegments[i], activeSegments[i + 1]]);
21802
21864
  }
21803
21865
  return rows.map(([left, right]) => {
21804
- const leftPct = fmtRatioPct(
21805
- left.tokens / Math.max(1, contextWindow.max)
21806
- );
21866
+ const leftPct = fmtRatioPct(left.tokens / Math.max(1, contextWindow.max));
21807
21867
  const rightPct = right ? fmtRatioPct(right.tokens / Math.max(1, contextWindow.max)) : "0%";
21808
21868
  return /* @__PURE__ */ jsxs78(
21809
21869
  Box,
@@ -21841,9 +21901,7 @@ function SidebarContent({
21841
21901
  });
21842
21902
  }
21843
21903
  return activeSegments.map((segment) => {
21844
- const pct = fmtRatioPct(
21845
- segment.tokens / Math.max(1, contextWindow.max)
21846
- );
21904
+ const pct = fmtRatioPct(segment.tokens / Math.max(1, contextWindow.max));
21847
21905
  return /* @__PURE__ */ jsxs78(
21848
21906
  Box,
21849
21907
  {
@@ -21892,11 +21950,13 @@ function SidebarContent({
21892
21950
  hasCacheActivity ? /* @__PURE__ */ jsxs78(Fragment27, { children: [
21893
21951
  /* @__PURE__ */ jsx78(Box, { width: bodyWidth, flexDirection: "row", children: /* @__PURE__ */ jsx78(Text, { color: theme.success, children: dynamicMeter }) }),
21894
21952
  bodyWidth >= 28 ? /* @__PURE__ */ jsx78(Box, { flexDirection: "row", width: bodyWidth, justifyContent: "space-between", children: /* @__PURE__ */ jsxs78(Text, { color: theme.textSecondary, wrap: "truncate", children: [
21895
- "read ",
21953
+ "read",
21954
+ " ",
21896
21955
  /* @__PURE__ */ jsx78(Text, { color: theme.textPrimary, bold: true, children: fmtTok(cs.readTokens) }),
21897
21956
  cs.writeTokens > 0 ? /* @__PURE__ */ jsxs78(Fragment27, { children: [
21898
21957
  " \xB7 ",
21899
- "write ",
21958
+ "write",
21959
+ " ",
21900
21960
  /* @__PURE__ */ jsx78(Text, { color: theme.textPrimary, bold: true, children: fmtTok(cs.writeTokens) })
21901
21961
  ] }) : null,
21902
21962
  cs.savedUsd > 0 ? /* @__PURE__ */ jsxs78(Fragment27, { children: [
@@ -21911,11 +21971,13 @@ function SidebarContent({
21911
21971
  ] }) }) : /* @__PURE__ */ jsxs78(Fragment27, { children: [
21912
21972
  /* @__PURE__ */ jsxs78(Box, { flexDirection: "row", width: bodyWidth, justifyContent: "space-between", children: [
21913
21973
  /* @__PURE__ */ jsxs78(Text, { color: theme.textSecondary, wrap: "truncate", children: [
21914
- "read ",
21974
+ "read",
21975
+ " ",
21915
21976
  /* @__PURE__ */ jsx78(Text, { color: theme.textPrimary, bold: true, children: fmtTok(cs.readTokens) })
21916
21977
  ] }),
21917
21978
  cs.writeTokens > 0 ? /* @__PURE__ */ jsxs78(Text, { color: theme.textSecondary, wrap: "truncate", children: [
21918
- "write ",
21979
+ "write",
21980
+ " ",
21919
21981
  /* @__PURE__ */ jsx78(Text, { color: theme.textPrimary, bold: true, children: fmtTok(cs.writeTokens) })
21920
21982
  ] }) : null
21921
21983
  ] }),
@@ -22497,7 +22559,10 @@ function ProcessListPanelSidebar({
22497
22559
  return /* @__PURE__ */ jsxs80(Box, { flexDirection: "row", width: bodyWidth, children: [
22498
22560
  /* @__PURE__ */ jsx80(Text, { color: statusVisual2.color, children: statusVisual2.glyph }),
22499
22561
  /* @__PURE__ */ jsx80(Text, { color: theme.textPrimary, children: " " }),
22500
- /* @__PURE__ */ jsx80(Text, { wrap: "truncate", children: trunc(p.name, Math.max(4, bodyWidth - 2 - (showPid ? displayWidth(pidLabel) + 1 : 0))) }),
22562
+ /* @__PURE__ */ jsx80(Text, { wrap: "truncate", children: trunc(
22563
+ p.name,
22564
+ Math.max(4, bodyWidth - 2 - (showPid ? displayWidth(pidLabel) + 1 : 0))
22565
+ ) }),
22501
22566
  showPid ? /* @__PURE__ */ jsxs80(Fragment28, { children: [
22502
22567
  /* @__PURE__ */ jsx80(Box, { flexGrow: 1 }),
22503
22568
  /* @__PURE__ */ jsx80(Text, { color: theme.textMuted, children: pidLabel })
@@ -22562,7 +22627,9 @@ function GoalPanelSidebar({
22562
22627
  ),
22563
22628
  /* @__PURE__ */ jsxs80(Box, { marginTop: 1, width: bodyWidth, children: [
22564
22629
  /* @__PURE__ */ jsx80(Text, { color: theme.success, children: glyphs.barFull.repeat(Math.round(progress / 100 * bodyWidth)) }),
22565
- /* @__PURE__ */ jsx80(Text, { color: theme.borderSubtle, children: glyphs.barEmpty.repeat(Math.max(0, bodyWidth - Math.round(progress / 100 * bodyWidth))) })
22630
+ /* @__PURE__ */ jsx80(Text, { color: theme.borderSubtle, children: glyphs.barEmpty.repeat(
22631
+ Math.max(0, bodyWidth - Math.round(progress / 100 * bodyWidth))
22632
+ ) })
22566
22633
  ] }),
22567
22634
  /* @__PURE__ */ jsx80(
22568
22635
  SidebarSectionHeader,
@@ -22640,10 +22707,18 @@ function SessionsPanelSidebar({
22640
22707
  const showAgentCount = inner >= METRIC_MIN_BODY_WIDTH;
22641
22708
  return /* @__PURE__ */ jsxs80(Box, { flexDirection: "row", width: bodyWidth, children: [
22642
22709
  /* @__PURE__ */ jsx80(Text, { color, children: icon }),
22643
- /* @__PURE__ */ jsxs80(Text, { color: isCurrent ? theme.accent : theme.textPrimary, bold: isCurrent, wrap: "truncate", children: [
22644
- " ",
22645
- trunc(s2.projectName, Math.max(4, bodyWidth - (showAgentCount ? 6 : 2)))
22646
- ] }),
22710
+ /* @__PURE__ */ jsxs80(
22711
+ Text,
22712
+ {
22713
+ color: isCurrent ? theme.accent : theme.textPrimary,
22714
+ bold: isCurrent,
22715
+ wrap: "truncate",
22716
+ children: [
22717
+ " ",
22718
+ trunc(s2.projectName, Math.max(4, bodyWidth - (showAgentCount ? 6 : 2)))
22719
+ ]
22720
+ }
22721
+ ),
22647
22722
  showAgentCount ? /* @__PURE__ */ jsxs80(Fragment28, { children: [
22648
22723
  /* @__PURE__ */ jsx80(Box, { flexGrow: 1 }),
22649
22724
  /* @__PURE__ */ jsxs80(Text, { color: theme.textMuted, children: [
@@ -22901,10 +22976,17 @@ function FleetPanelSidebar({
22901
22976
  const name = trunc(e.name || e.id, Math.max(4, bodyWidth - 4));
22902
22977
  return /* @__PURE__ */ jsxs81(Box, { flexDirection: "row", width: bodyWidth, children: [
22903
22978
  /* @__PURE__ */ jsx81(Text, { color: v.color, children: v.glyph }),
22904
- /* @__PURE__ */ jsxs81(Text, { color: e.status === "running" ? theme.textPrimary : theme.textSecondary, wrap: "truncate", children: [
22905
- " ",
22906
- name
22907
- ] })
22979
+ /* @__PURE__ */ jsxs81(
22980
+ Text,
22981
+ {
22982
+ color: e.status === "running" ? theme.textPrimary : theme.textSecondary,
22983
+ wrap: "truncate",
22984
+ children: [
22985
+ " ",
22986
+ name
22987
+ ]
22988
+ }
22989
+ )
22908
22990
  ] }, e.id);
22909
22991
  })
22910
22992
  }
@@ -23188,7 +23270,9 @@ function ConnectionsPanelSidebar({
23188
23270
  ),
23189
23271
  /* @__PURE__ */ jsxs81(Box, { flexDirection: "row", width: bodyWidth, children: [
23190
23272
  /* @__PURE__ */ jsx81(Text, { color: okCount > 0 ? theme.success : theme.borderSubtle, children: glyphs.barFull.repeat(
23191
- Math.round(okCount / Math.max(1, connections.length || 1) * Math.max(4, bodyWidth - 4))
23273
+ Math.round(
23274
+ okCount / Math.max(1, connections.length || 1) * Math.max(4, bodyWidth - 4)
23275
+ )
23192
23276
  ) }),
23193
23277
  /* @__PURE__ */ jsx81(Text, { color: theme.borderSubtle, children: glyphs.barEmpty.repeat(
23194
23278
  Math.max(
@@ -23224,7 +23308,9 @@ function ConnectionsPanelSidebar({
23224
23308
  /* @__PURE__ */ jsxs81(Box, { flexDirection: "row", width: bodyWidth, children: [
23225
23309
  /* @__PURE__ */ jsxs81(Text, { color, dimColor: true, wrap: "truncate", children: [
23226
23310
  " ",
23227
- glyphs.workingDirectory.repeat(Math.max(1, Math.min(bodyWidth - 2, 3 + i % 4)))
23311
+ glyphs.workingDirectory.repeat(
23312
+ Math.max(1, Math.min(bodyWidth - 2, 3 + i % 4))
23313
+ )
23228
23314
  ] }),
23229
23315
  /* @__PURE__ */ jsxs81(Text, { color: theme.textMuted, children: [
23230
23316
  " link ",
@@ -24191,7 +24277,15 @@ var Input = memo2(function Input2({
24191
24277
  }, [needsScroll]);
24192
24278
  const visibleRows = needsScroll ? rows.slice(clampedScroll, clampedScroll + MAX_VISIBLE_ROWS) : rows;
24193
24279
  if (hidden) {
24194
- return /* @__PURE__ */ jsx84(Box, { height: Math.max(3, placeholderHeight ?? (needsScroll ? MAX_VISIBLE_ROWS + 2 : rows.length + 2)) });
24280
+ return /* @__PURE__ */ jsx84(
24281
+ Box,
24282
+ {
24283
+ height: Math.max(
24284
+ 3,
24285
+ placeholderHeight ?? (needsScroll ? MAX_VISIBLE_ROWS + 2 : rows.length + 2)
24286
+ )
24287
+ }
24288
+ );
24195
24289
  }
24196
24290
  const railStatus = status ?? (disabled ? { kind: "aborting" } : { kind: "idle", fleetRunning: 0 });
24197
24291
  const scrollIndicator = needsScroll && rows.length > MAX_VISIBLE_ROWS ? ` ${clampedScroll + 1}/${rows.length}` : "";
@@ -24240,15 +24334,7 @@ var Input = memo2(function Input2({
24240
24334
  });
24241
24335
 
24242
24336
  // src/components/scrollable-history.tsx
24243
- import {
24244
- memo as memo7,
24245
- useCallback as useCallback6,
24246
- useEffect as useEffect25,
24247
- useLayoutEffect,
24248
- useMemo as useMemo10,
24249
- useRef as useRef10,
24250
- useState as useState24
24251
- } from "react";
24337
+ import { memo as memo7, useCallback as useCallback6, useEffect as useEffect25, useLayoutEffect, useMemo as useMemo10, useRef as useRef10, useState as useState24 } from "react";
24252
24338
 
24253
24339
  // src/height-cache.ts
24254
24340
  var DEFAULT_ENTRY_HEIGHT = 3;
@@ -24790,10 +24876,7 @@ function planPinned(geometry, extraRows = 0) {
24790
24876
  } else {
24791
24877
  startIdx = Math.min(
24792
24878
  startIdx,
24793
- Math.max(
24794
- 0,
24795
- groupCount - (Math.max(1, geometry.viewportRows) + OVERSCAN_ROWS + extraRows)
24796
- )
24879
+ Math.max(0, groupCount - (Math.max(1, geometry.viewportRows) + OVERSCAN_ROWS + extraRows))
24797
24880
  );
24798
24881
  }
24799
24882
  return { startIdx, endIdx: groupCount, mountTail: true };
@@ -25290,11 +25373,7 @@ import { parseNextSteps } from "@wrongstack/tools/next-steps";
25290
25373
  import React7, { useEffect as useEffect23, useMemo as useMemo8 } from "react";
25291
25374
 
25292
25375
  // src/history-entry.ts
25293
- import {
25294
- DEFAULT_MIN_IMPORTANCE,
25295
- DEFAULT_MIN_SCORE,
25296
- MIN_RELATION_STRENGTH
25297
- } from "@wrongstack/sage";
25376
+ import { DEFAULT_MIN_IMPORTANCE, DEFAULT_MIN_SCORE, MIN_RELATION_STRENGTH } from "@wrongstack/sage";
25298
25377
  var MEMORY_GATE_DEFAULTS = {
25299
25378
  minScore: DEFAULT_MIN_SCORE,
25300
25379
  minImportance: DEFAULT_MIN_IMPORTANCE,
@@ -26522,14 +26601,7 @@ function ToolEntry({
26522
26601
  ]
26523
26602
  }
26524
26603
  ),
26525
- showSageMemoryInject !== false ? /* @__PURE__ */ jsx93(
26526
- SageMemoryBlock,
26527
- {
26528
- sageLines,
26529
- toolName: entry.name,
26530
- stats: entry.sageStats
26531
- }
26532
- ) : null
26604
+ showSageMemoryInject !== false ? /* @__PURE__ */ jsx93(SageMemoryBlock, { sageLines, toolName: entry.name, stats: entry.sageStats }) : null
26533
26605
  ] });
26534
26606
  }
26535
26607
  const toolContentWidth = Math.max(1, termWidth - 2);
@@ -26549,13 +26621,7 @@ function ToolEntry({
26549
26621
  termWidth,
26550
26622
  hasBody: hasToolBody,
26551
26623
  children: [
26552
- visualLines && entry.resultRenderMode !== "simple" ? /* @__PURE__ */ jsx93(
26553
- ToolOutputLines,
26554
- {
26555
- lines: visualLines,
26556
- hasFollowingBlock: Boolean(diff || multiDiffs)
26557
- }
26558
- ) : visualLines ? /* @__PURE__ */ jsx93(ToolOutputLines, { lines: visualLines, hasFollowingBlock: false }) : entry.resultRenderMode === "simple" ? null : outLines.map((line, i) => {
26624
+ visualLines && entry.resultRenderMode !== "simple" ? /* @__PURE__ */ jsx93(ToolOutputLines, { lines: visualLines, hasFollowingBlock: Boolean(diff || multiDiffs) }) : visualLines ? /* @__PURE__ */ jsx93(ToolOutputLines, { lines: visualLines, hasFollowingBlock: false }) : entry.resultRenderMode === "simple" ? null : outLines.map((line, i) => {
26559
26625
  const connector = i === outLines.length - 1 && !diff && !multiDiffs ? " \u2514\u2500 " : " \u251C\u2500 ";
26560
26626
  return /* @__PURE__ */ jsxs91(Text, { children: [
26561
26627
  /* @__PURE__ */ jsx93(Text, { color, dimColor: true, children: connector }),
@@ -27821,13 +27887,7 @@ var ScrollableHistory = memo7(function ScrollableHistory2({
27821
27887
  termWidth
27822
27888
  }
27823
27889
  ) : null,
27824
- plan.mountTail && assistantTail ? /* @__PURE__ */ jsx97(
27825
- AssistantStreamBox,
27826
- {
27827
- text: assistantTail,
27828
- termWidth
27829
- }
27830
- ) : null
27890
+ plan.mountTail && assistantTail ? /* @__PURE__ */ jsx97(AssistantStreamBox, { text: assistantTail, termWidth }) : null
27831
27891
  ] })
27832
27892
  }
27833
27893
  ),
@@ -28528,7 +28588,10 @@ async function routeInputKey(host, input, key) {
28528
28588
  if (host.state.status === "running" || host.state.status === "streaming" || host.state.status === "aborting") {
28529
28589
  host.dispatch({
28530
28590
  type: "addEntry",
28531
- entry: { kind: "info", text: "Input locked \u2014 wait for the agent to finish before pasting." }
28591
+ entry: {
28592
+ kind: "info",
28593
+ text: "Input locked \u2014 wait for the agent to finish before pasting."
28594
+ }
28532
28595
  });
28533
28596
  } else {
28534
28597
  await host.pasteClipboardText();
@@ -29740,7 +29803,9 @@ function buildSteeringPreamble(snapshot, newDirection) {
29740
29803
  ctx.push(`- in-flight tools (now cancelled): ${snapshot.runningTools.join(", ")}`);
29741
29804
  }
29742
29805
  if (snapshot?.subagentsTerminated && snapshot.subagentsTerminated > 0) {
29743
- const subDetails = snapshot.subagents.map((s2) => `${s2.label}${s2.tool ? ` (was running: ${s2.tool})` : ""}`).join(", ");
29806
+ const subDetails = snapshot.subagents.map(
29807
+ (s2) => `${s2.label}${s2.tool ? ` (was running: ${s2.tool})` : ""}`
29808
+ ).join(", ");
29744
29809
  ctx.push(
29745
29810
  `- subagents (${snapshot.subagentsTerminated} terminated by me, do NOT await them): ${subDetails}`
29746
29811
  );
@@ -30791,13 +30856,7 @@ function useStableKeyHandler(handleKey) {
30791
30856
 
30792
30857
  // src/hooks/use-app-execution-pipeline.ts
30793
30858
  function useAppExecutionPipeline(args) {
30794
- const {
30795
- keyHandlerParams,
30796
- runBlocksParams,
30797
- submitParams,
30798
- runBlocksRef,
30799
- submitRef
30800
- } = args;
30859
+ const { keyHandlerParams, runBlocksParams, submitParams, runBlocksRef, submitRef } = args;
30801
30860
  const handleKey = createAppKeyHandler(keyHandlerParams);
30802
30861
  const runBlocks = createRunBlocksController(runBlocksParams);
30803
30862
  runBlocksRef.current = runBlocks;
@@ -32788,9 +32847,7 @@ var TUI_RESUME_EXCLUDED_MARKER_SOURCES = /* @__PURE__ */ new Set([
32788
32847
  "delegate_completed"
32789
32848
  ]);
32790
32849
  var MARKER_EVENT_TYPES = new Set(
32791
- [...SESSION_MARKER_EVENT_TYPES].filter(
32792
- (type) => !TUI_RESUME_EXCLUDED_MARKER_SOURCES.has(type)
32793
- )
32850
+ [...SESSION_MARKER_EVENT_TYPES].filter((type) => !TUI_RESUME_EXCLUDED_MARKER_SOURCES.has(type))
32794
32851
  );
32795
32852
  function markerToEntry(marker) {
32796
32853
  if (marker.level === "error") return { kind: "error", text: marker.text };
@@ -35582,7 +35639,10 @@ function reducePanelPickers(state, action) {
35582
35639
  };
35583
35640
  }
35584
35641
  case "toolsPickerClose":
35585
- return { ...state, toolsPicker: { ...state.toolsPicker, open: false, busy: false, filter: void 0 } };
35642
+ return {
35643
+ ...state,
35644
+ toolsPicker: { ...state.toolsPicker, open: false, busy: false, filter: void 0 }
35645
+ };
35586
35646
  case "toolsPickerMove": {
35587
35647
  const count = state.toolsPicker.items.length;
35588
35648
  if (count === 0) return state;
@@ -35707,7 +35767,13 @@ function reducePanelPickers(state, action) {
35707
35767
  return {
35708
35768
  ...state,
35709
35769
  ...closePanels(state),
35710
- helpPanel: { open: true, entries: action.entries, selected: 0, filter: "", hint: void 0 }
35770
+ helpPanel: {
35771
+ open: true,
35772
+ entries: action.entries,
35773
+ selected: 0,
35774
+ filter: "",
35775
+ hint: void 0
35776
+ }
35711
35777
  };
35712
35778
  case "helpClose":
35713
35779
  return { ...state, helpPanel: { ...state.helpPanel, open: false, filter: "" } };
@@ -36391,7 +36457,11 @@ function reduceSettingsValues(state, action) {
36391
36457
  return state;
36392
36458
  }
36393
36459
  case "settingsValueSet": {
36394
- const { panelPositions: panelPositionsPatch, showAgentSwarmPanel: swarmPatch, ...restPatch } = action.patch;
36460
+ const {
36461
+ panelPositions: panelPositionsPatch,
36462
+ showAgentSwarmPanel: swarmPatch,
36463
+ ...restPatch
36464
+ } = action.patch;
36395
36465
  const mergedPanelPositions = panelPositionsPatch !== void 0 ? { ...state.settingsPicker.panelPositions, ...panelPositionsPatch } : state.settingsPicker.panelPositions;
36396
36466
  const fleetPos = mergedPanelPositions?.fleet;
36397
36467
  const derivedSwarmMode = swarmPatch !== void 0 ? swarmPatch : fleetPos === "sidebar" ? "sidebar" : state.settingsPicker.showAgentSwarmPanel === "off" ? "off" : "bottom";
@@ -37587,10 +37657,7 @@ function useAutonomousCoordinator(subscribeCoordinatorEvents, dispatch) {
37587
37657
 
37588
37658
  // src/hooks/use-autonomy-drivers.ts
37589
37659
  import { toErrorMessage as toErrorMessage6 } from "@wrongstack/core/utils";
37590
- import {
37591
- useEffect as useEffect32,
37592
- useRef as useRef16
37593
- } from "react";
37660
+ import { useEffect as useEffect32, useRef as useRef16 } from "react";
37594
37661
  var BETWEEN_ITERATION_YIELD_MS = 200;
37595
37662
  function yieldBetweenIterations(ms = BETWEEN_ITERATION_YIELD_MS) {
37596
37663
  return new Promise((resolve) => setTimeout(resolve, ms));
@@ -39416,7 +39483,8 @@ function parseMemoryFlags(tokens) {
39416
39483
  else errors.push(`--scope must be one of: ${MEMORY_SCOPE_VALUES.join(", ")}.`);
39417
39484
  break;
39418
39485
  case "status":
39419
- if (value && MEMORY_STATUS_VALUES.includes(value)) out.status = value;
39486
+ if (value && MEMORY_STATUS_VALUES.includes(value))
39487
+ out.status = value;
39420
39488
  else errors.push(`--status must be one of: ${MEMORY_STATUS_VALUES.join(", ")}.`);
39421
39489
  break;
39422
39490
  case "tag":
@@ -39665,10 +39733,14 @@ function createMemorySlashCommand(deps) {
39665
39733
  const limitVal = limitMatch ? Math.min(MAX_MEMORY_LIMIT, Math.max(1, Number.parseInt(limitMatch[1], 10))) : DEFAULT_MEMORY_LIMIT;
39666
39734
  const query = remainingTokens.filter((t) => t !== "--relations").join(" ").replace(/--status\s+\w+/g, "").replace(/--kind\s+\w+/g, "").replace(/--limit\s+\d+/g, "").trim();
39667
39735
  if (statusVal !== void 0 && !MEMORY_STATUS_VALUES.includes(statusVal)) {
39668
- return { message: `Invalid --status "${statusVal}". Valid: ${MEMORY_STATUS_VALUES.join(", ")}` };
39736
+ return {
39737
+ message: `Invalid --status "${statusVal}". Valid: ${MEMORY_STATUS_VALUES.join(", ")}`
39738
+ };
39669
39739
  }
39670
39740
  if (kindVal !== void 0 && !MEMORY_KIND_VALUES.includes(kindVal)) {
39671
- return { message: `Invalid --kind "${kindVal}". Valid: ${MEMORY_KIND_VALUES.join(", ")}` };
39741
+ return {
39742
+ message: `Invalid --kind "${kindVal}". Valid: ${MEMORY_KIND_VALUES.join(", ")}`
39743
+ };
39672
39744
  }
39673
39745
  const resolvedStatus = statusVal;
39674
39746
  try {
@@ -39719,9 +39791,13 @@ function createMemorySlashCommand(deps) {
39719
39791
  const textPreview = mem.text.length > 120 ? `${mem.text.slice(0, 118)}\u2026` : mem.text;
39720
39792
  const tags = mem.tags.length > 0 ? ` \u{1F3F7}\uFE0F ${mem.tags.map((t) => `\`${t}\``).join(" ")}` : "";
39721
39793
  lines.push(`> ${kindEmoji} **${textPreview}**`);
39722
- lines.push(`> \`${mem.id}\` \xB7 ${mem.kind} \xB7 ${mem.status} \xB7 importance ${mem.importance} \xB7 confidence ${mem.confidence}`);
39794
+ lines.push(
39795
+ `> \`${mem.id}\` \xB7 ${mem.kind} \xB7 ${mem.status} \xB7 importance ${mem.importance} \xB7 confidence ${mem.confidence}`
39796
+ );
39723
39797
  if (tags) lines.push(`> ${tags.slice(1).trim()}`);
39724
- const anchor = mem.anchors?.find((a) => a.path || a.symbol || a.command);
39798
+ const anchor = mem.anchors?.find(
39799
+ (a) => a.path || a.symbol || a.command
39800
+ );
39725
39801
  if (anchor) {
39726
39802
  lines.push(`> \u{1F4CE} \`${anchor.path ?? anchor.symbol ?? anchor.command ?? ""}\``);
39727
39803
  }
@@ -39737,7 +39813,9 @@ function createMemorySlashCommand(deps) {
39737
39813
  }
39738
39814
  const moreAvailable = page.total > page.memories.length;
39739
39815
  if (moreAvailable) {
39740
- lines.push(`*Showing ${page.memories.length} of ${page.total} \u2014 use \`/memory gather --limit ${Math.min(MAX_MEMORY_LIMIT, limitVal * 2)}\` for more*`);
39816
+ lines.push(
39817
+ `*Showing ${page.memories.length} of ${page.total} \u2014 use \`/memory gather --limit ${Math.min(MAX_MEMORY_LIMIT, limitVal * 2)}\` for more*`
39818
+ );
39741
39819
  }
39742
39820
  return { message: lines.join("\n") };
39743
39821
  } catch (err) {
@@ -40253,10 +40331,7 @@ function useFleetGenerationGate(sessionGenerationRef) {
40253
40331
  const forget = useCallback13((subagentId) => {
40254
40332
  spawnGenRef.current.delete(subagentId);
40255
40333
  }, []);
40256
- return useMemo13(
40257
- () => ({ track, isLive, forget, sweep }),
40258
- [track, isLive, forget, sweep]
40259
- );
40334
+ return useMemo13(() => ({ track, isLive, forget, sweep }), [track, isLive, forget, sweep]);
40260
40335
  }
40261
40336
 
40262
40337
  // src/hooks/use-director-fleet-bridge.ts
@@ -41675,11 +41750,7 @@ function useInputHistoryPersistence({
41675
41750
 
41676
41751
  // src/hooks/use-interrupt-ladder.ts
41677
41752
  import { getProcessRegistry as getProcessRegistry8 } from "@wrongstack/tools";
41678
- import {
41679
- useCallback as useCallback18,
41680
- useEffect as useEffect46,
41681
- useRef as useRef28
41682
- } from "react";
41753
+ import { useCallback as useCallback18, useEffect as useEffect46, useRef as useRef28 } from "react";
41683
41754
  var INTERRUPT_PRESS_WINDOW_MS = 2e3;
41684
41755
  function useInterruptLadder({
41685
41756
  stateRef,
@@ -42123,10 +42194,7 @@ import { useCallback as useCallback19 } from "react";
42123
42194
  function buildModePickerOptions(result) {
42124
42195
  return toModeOptions(result.modes, result.activeId);
42125
42196
  }
42126
- function useModePicker({
42127
- dispatch,
42128
- getModes
42129
- }) {
42197
+ function useModePicker({ dispatch, getModes }) {
42130
42198
  const openModePicker = useCallback19(async () => {
42131
42199
  if (!getModes) return;
42132
42200
  const result = await getModes();
@@ -44334,9 +44402,7 @@ function useStatusSyncInterval({
44334
44402
  runEternalLoopRef,
44335
44403
  runParallelLoopRef
44336
44404
  }) {
44337
- const staleGuardRef = useRef37(
44338
- JSON.stringify({ a: "", y: false, m: "", model: "", provider: "" })
44339
- );
44405
+ const staleGuardRef = useRef37(JSON.stringify({ a: "", y: false, m: "", model: "", provider: "" }));
44340
44406
  useEffect58(() => {
44341
44407
  const poll = () => {
44342
44408
  const a = getAutonomy?.() ?? "off";
@@ -45093,7 +45159,9 @@ import { useState as useState37 } from "react";
45093
45159
  function useStatuslineState(opts) {
45094
45160
  const [liveModel, setLiveModel] = useState37(opts.model);
45095
45161
  const [liveProvider, setLiveProvider] = useState37(opts.provider ?? "agent");
45096
- const [activeMaxContext, setActiveMaxContext] = useState37(opts.effectiveMaxContext);
45162
+ const [activeMaxContext, setActiveMaxContext] = useState37(
45163
+ opts.effectiveMaxContext
45164
+ );
45097
45165
  const [yoloLive, setYoloLive] = useState37(opts.yolo);
45098
45166
  const [autonomyLive, setAutonomyLive] = useState37(opts.getAutonomy?.() ?? "off");
45099
45167
  const [liveModeLabel, setLiveModeLabel] = useState37(opts.modeLabel ?? "");
@@ -45277,7 +45345,13 @@ function useBrainEvents(events, dispatch, getSessionId) {
45277
45345
  councilTraces.delete(p.request.id);
45278
45346
  councilVotes.delete(p.request.id);
45279
45347
  const decision = decisionSummary(p.decision);
45280
- dispatch({ type: "brainStatus", state: status, source: p.request.source, risk: p.request.risk, summary: decision });
45348
+ dispatch({
45349
+ type: "brainStatus",
45350
+ state: status,
45351
+ source: p.request.source,
45352
+ risk: p.request.risk,
45353
+ summary: decision
45354
+ });
45281
45355
  if (status === "ask_human") {
45282
45356
  const prompt = {
45283
45357
  requestId: p.request.id,
@@ -45292,7 +45366,19 @@ function useBrainEvents(events, dispatch, getSessionId) {
45292
45366
  dispatch({ type: "brainPromptClear" });
45293
45367
  }
45294
45368
  const rationale = p.decision.type === "deny" ? void 0 : p.decision.rationale;
45295
- dispatch({ type: "addEntry", entry: { kind: "brain", status, source: p.request.source, risk: p.request.risk, question: p.request.question, decision, rationale, ...council ? { council } : {} } });
45369
+ dispatch({
45370
+ type: "addEntry",
45371
+ entry: {
45372
+ kind: "brain",
45373
+ status,
45374
+ source: p.request.source,
45375
+ risk: p.request.risk,
45376
+ question: p.request.question,
45377
+ decision,
45378
+ rationale,
45379
+ ...council ? { council } : {}
45380
+ }
45381
+ });
45296
45382
  };
45297
45383
  const pendingMonitorAnswers = /* @__PURE__ */ new Map();
45298
45384
  const SHOWN_MONITOR_ANSWERS_MAX = 500;
@@ -45306,7 +45392,13 @@ function useBrainEvents(events, dispatch, getSessionId) {
45306
45392
  };
45307
45393
  const offRequested = events.on("brain.decision_requested", ({ sessionId, request }) => {
45308
45394
  if (!isCurrentSession2(sessionId)) return;
45309
- dispatch({ type: "brainStatus", state: "deciding", source: request.source, risk: request.risk, summary: requestSummary(request) });
45395
+ dispatch({
45396
+ type: "brainStatus",
45397
+ state: "deciding",
45398
+ source: request.source,
45399
+ risk: request.risk,
45400
+ summary: requestSummary(request)
45401
+ });
45310
45402
  });
45311
45403
  const offAnswered = events.on("brain.decision_answered", (payload) => {
45312
45404
  if (!isCurrentSession2(payload.sessionId)) return;
@@ -45459,9 +45551,7 @@ function labelFor2(labelsRef, id, name) {
45459
45551
  }
45460
45552
  function useSubagentEvents(events, dispatch, setActiveMaxContext, getSessionId, getChatMode, sessionGenerationRef) {
45461
45553
  const labelsRef = useRef41(/* @__PURE__ */ new Map());
45462
- const ctxDispatchRef = useRef41(
45463
- /* @__PURE__ */ new Map()
45464
- );
45554
+ const ctxDispatchRef = useRef41(/* @__PURE__ */ new Map());
45465
45555
  const leaderCtxDispatchRef = useRef41(void 0);
45466
45556
  const leaderCtxFlushRef = useRef41(void 0);
45467
45557
  const latestLeaderCtxPctRef = useRef41(void 0);
@@ -45811,7 +45901,14 @@ function useTuiEventBridge({
45811
45901
  sessionGenerationRef
45812
45902
  }) {
45813
45903
  const getChatMode = useCallback28(() => stateRef.current.fleetChat, [stateRef]);
45814
- useSubagentEvents(events, dispatch, setActiveMaxContext, getSessionId, getChatMode, sessionGenerationRef);
45904
+ useSubagentEvents(
45905
+ events,
45906
+ dispatch,
45907
+ setActiveMaxContext,
45908
+ getSessionId,
45909
+ getChatMode,
45910
+ sessionGenerationRef
45911
+ );
45815
45912
  useSessionEvents(events, dispatch, onClearHistory, getSessionId);
45816
45913
  useBrainEvents(events, dispatch, getSessionId);
45817
45914
  useGoalEvents(subscribeGoal, dispatch, stateRef, getSessionId);
@@ -46046,7 +46143,10 @@ function useGoalEvents(subscribeGoal, dispatch, stateRef, getSessionId) {
46046
46143
  break;
46047
46144
  }
46048
46145
  case "countdown.tick": {
46049
- dispatch({ type: "countdownTick", remainingSeconds: payload.remaining });
46146
+ dispatch({
46147
+ type: "countdownTick",
46148
+ remainingSeconds: payload.remaining
46149
+ });
46050
46150
  break;
46051
46151
  }
46052
46152
  }
@@ -47952,7 +48052,10 @@ function startTerminalTitle(opts) {
47952
48052
  events.on("iteration.started", () => touch("thinking")),
47953
48053
  events.on("provider.text_delta", () => touch("thinking")),
47954
48054
  events.on("provider.thinking_delta", () => touch("thinking")),
47955
- events.on("tool.started", (e) => touch("tool", e.name ?? "tool")),
48055
+ events.on(
48056
+ "tool.started",
48057
+ (e) => touch("tool", e.name ?? "tool")
48058
+ ),
47956
48059
  events.on("tool.executed", () => touch("thinking"))
47957
48060
  ];
47958
48061
  const write = (s2) => {
@@ -52,11 +52,11 @@
52
52
  */
53
53
  import type { ValidationResult } from './input-validation/result.js';
54
54
  export { ALLOWED_ACTION_TYPES } from './input-validation/action-types.js';
55
- export { ALLOWED_ENTRY_KINDS, ALLOWED_FLEET_STATUSES, ALLOWED_KEY_EVENT_FIELDS, ALLOWED_MOUSE_BUTTONS, ALLOWED_MOUSE_KINDS, TEXT_BEARING_ENTRY_KINDS } from './input-validation/allow-lists.js';
56
- export { MAX_ACTION_DEPTH, MAX_ACTION_STRING_FIELD, MAX_BATCHED_ACTIONS, MAX_ENTRY_TEXT_CHARS, MAX_FLEET_ENTRIES, MAX_HISTORY_ENTRIES, MAX_INPUT_BUFFER_CHARS, MAX_PASTE_CHARS, MAX_PASTE_FRAGMENT_CHARS, MAX_PICKER_MATCHES, MAX_RECENT_MESSAGES, MAX_RECENT_TOOLS } from './input-validation/limits.js';
55
+ export { ALLOWED_ENTRY_KINDS, ALLOWED_FLEET_STATUSES, ALLOWED_KEY_EVENT_FIELDS, ALLOWED_MOUSE_BUTTONS, ALLOWED_MOUSE_KINDS, TEXT_BEARING_ENTRY_KINDS, } from './input-validation/allow-lists.js';
56
+ export { MAX_ACTION_DEPTH, MAX_ACTION_STRING_FIELD, MAX_BATCHED_ACTIONS, MAX_ENTRY_TEXT_CHARS, MAX_FLEET_ENTRIES, MAX_HISTORY_ENTRIES, MAX_INPUT_BUFFER_CHARS, MAX_PASTE_CHARS, MAX_PASTE_FRAGMENT_CHARS, MAX_PICKER_MATCHES, MAX_RECENT_MESSAGES, MAX_RECENT_TOOLS, } from './input-validation/limits.js';
57
57
  export type { ValidationError, ValidationOk, ValidationResult, } from './input-validation/result.js';
58
58
  export { validateFleetEntry, validateRestoreEntry } from './input-validation/state-entries.js';
59
- export { validateMouseEvent, validatePasteContent, validateStdinFragment } from './input-validation/terminal.js';
59
+ export { validateMouseEvent, validatePasteContent, validateStdinFragment, } from './input-validation/terminal.js';
60
60
  export declare function validateAction(action: {
61
61
  type: string;
62
62
  [key: string]: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/tui",
3
- "version": "0.319.0",
3
+ "version": "0.319.1",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack terminal UI: Ink-based interactive renderer with history, pickers, and slash menus.",
6
6
  "repository": {
@@ -26,12 +26,12 @@
26
26
  "!dist/**/*.map"
27
27
  ],
28
28
  "dependencies": {
29
- "@wrongstack/core": "0.319.0",
30
- "@wrongstack/kanban": "0.319.0",
31
- "@wrongstack/runtime": "0.319.0",
32
- "@wrongstack/sage": "0.319.0",
33
- "@wrongstack/sdd": "0.319.0",
34
- "@wrongstack/tools": "0.319.0",
29
+ "@wrongstack/core": "0.319.1",
30
+ "@wrongstack/kanban": "0.319.1",
31
+ "@wrongstack/runtime": "0.319.1",
32
+ "@wrongstack/sage": "0.319.1",
33
+ "@wrongstack/sdd": "0.319.1",
34
+ "@wrongstack/tools": "0.319.1",
35
35
  "ink": "7.1.1",
36
36
  "react": "^19.2.8",
37
37
  "string-width": "8.2.2",