@wrongstack/tui 0.305.1 → 0.306.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -293,7 +293,7 @@ var init_connections_health = __esm({
293
293
  // src/app.tsx
294
294
  import * as path7 from "node:path";
295
295
  import { applyRewindToConversation, DefaultSessionRewinder } from "@wrongstack/core/storage";
296
- import React9, { useCallback as useCallback25, useEffect as useEffect66, useRef as useRef38 } from "react";
296
+ import React9, { useCallback as useCallback25, useEffect as useEffect67, useRef as useRef38 } from "react";
297
297
 
298
298
  // src/ink.tsx
299
299
  import { Box as InkBox, Text as InkText } from "ink";
@@ -20734,6 +20734,9 @@ function SendModePicker({
20734
20734
  ] });
20735
20735
  }
20736
20736
 
20737
+ // src/components/settings-picker.tsx
20738
+ import { useEffect as useEffect24 } from "react";
20739
+
20737
20740
  // src/components/settings-picker-filter.ts
20738
20741
  function fuzzyMatch(haystack, needle) {
20739
20742
  const lower = haystack.toLowerCase();
@@ -21630,27 +21633,30 @@ function renderPickerRow(row, fieldIdx, selected, filterActive, highlightSegment
21630
21633
  ] }) : /* @__PURE__ */ jsx73(Text, { bold: true, children: labelStr.padEnd(26) }),
21631
21634
  /* @__PURE__ */ jsx73(Text, { color: "cyan", children: String(row.value ?? "").padEnd(12) }),
21632
21635
  /* @__PURE__ */ jsx73(Text, { dimColor: true, children: row.detail ?? "" })
21633
- ] }, `row-${row.label ?? fieldIdx}`);
21636
+ ] }, `row-${fieldIdx}`);
21634
21637
  }
21635
- function buildVisibleSectionHeaders(rows, fieldRowIndex, windowStart, windowEnd) {
21636
- const sectionFields = [];
21637
- let curHeader = -1;
21638
- for (let i = 0; i < rows.length; i++) {
21639
- if (rows[i]?.section) curHeader = i;
21640
- else if (curHeader >= 0) {
21641
- const fieldIdx = fieldRowIndex.indexOf(i);
21642
- if (fieldIdx === -1) continue;
21643
- const entry = sectionFields.find((s2) => s2.headerIdx === curHeader);
21644
- if (entry) {
21645
- entry.fieldEnd = fieldIdx + 1;
21646
- } else {
21647
- sectionFields.push({ headerIdx: curHeader, fieldStart: fieldIdx, fieldEnd: fieldIdx + 1 });
21648
- }
21649
- }
21638
+ function deriveSettingsSectionFieldStarts(fieldRowIndex) {
21639
+ const starts = [];
21640
+ for (let fieldIdx = 0; fieldIdx < fieldRowIndex.length; fieldIdx++) {
21641
+ const rowIdx = fieldRowIndex[fieldIdx] ?? 0;
21642
+ const previousRowIdx = fieldIdx > 0 ? fieldRowIndex[fieldIdx - 1] ?? 0 : -1;
21643
+ if (fieldIdx === 0 || rowIdx - previousRowIdx > 1) starts.push(fieldIdx);
21650
21644
  }
21651
- return new Set(
21652
- sectionFields.filter((section) => section.fieldStart < windowEnd && section.fieldEnd > windowStart).map((section) => section.headerIdx)
21653
- );
21645
+ return starts;
21646
+ }
21647
+ function buildVisibleSectionHeaders(rows, fieldRowIndex, windowStart, windowEnd) {
21648
+ const sectionStarts = deriveSettingsSectionFieldStarts(fieldRowIndex);
21649
+ const visibleHeaders = /* @__PURE__ */ new Set();
21650
+ for (let i = 0; i < sectionStarts.length; i++) {
21651
+ const fieldStart = sectionStarts[i] ?? 0;
21652
+ const fieldEnd = sectionStarts[i + 1] ?? fieldRowIndex.length;
21653
+ if (fieldStart >= windowEnd || fieldEnd <= windowStart) continue;
21654
+ const firstFieldRow = fieldRowIndex[fieldStart];
21655
+ if (firstFieldRow === void 0) continue;
21656
+ const headerIdx = firstFieldRow - 1;
21657
+ if (rows[headerIdx]?.section) visibleHeaders.add(headerIdx);
21658
+ }
21659
+ return visibleHeaders;
21654
21660
  }
21655
21661
  function SettingsPickerRowList({
21656
21662
  rows,
@@ -21660,10 +21666,12 @@ function SettingsPickerRowList({
21660
21666
  rankedResults,
21661
21667
  highlightSegments,
21662
21668
  windowStart,
21663
- windowEnd
21669
+ windowEnd,
21670
+ filterWindowStart,
21671
+ filterWindowEnd
21664
21672
  }) {
21665
21673
  if (filterActive) {
21666
- return /* @__PURE__ */ jsx73(Fragment27, { children: rankedResults.map((result) => {
21674
+ return /* @__PURE__ */ jsx73(Fragment27, { children: rankedResults.slice(filterWindowStart, filterWindowEnd).map((result) => {
21667
21675
  const fieldIdx = result.chord.field;
21668
21676
  const rowIdx = fieldRowIndex[fieldIdx] ?? -1;
21669
21677
  const row = rows[rowIdx];
@@ -21742,7 +21750,9 @@ function SettingsPicker({
21742
21750
  nextStepsTool,
21743
21751
  readSymbols,
21744
21752
  panelPositions,
21745
- hint
21753
+ inputHeight,
21754
+ hint,
21755
+ onLayoutComputed
21746
21756
  }) {
21747
21757
  const boolVal = (v) => v ? "on" : "off";
21748
21758
  const rows = [
@@ -22015,50 +22025,134 @@ function SettingsPicker({
22015
22025
  for (let i = 0; i < rows.length; i++) {
22016
22026
  if (!rows[i]?.section) fieldRowIndex.push(i);
22017
22027
  }
22028
+ useEffect24(() => {
22029
+ onLayoutComputed?.({ rows, fieldRowIndex });
22030
+ });
22018
22031
  const { filterActive, rankedResults, filteredFieldIndices, highlightSegments } = buildSettingsFilterState(filter, SETTINGS_PICKER_JUMP_CHORDS);
22019
22032
  const { stdout } = useStdout();
22020
22033
  const termRows = stdout?.rows ?? 24;
22021
- const VISIBLE_FIELDS = Math.max(8, termRows - 26);
22034
+ const termCols = stdout?.columns ?? 80;
22035
+ const contentWidth = Math.max(10, termCols - 4);
22036
+ const fieldLineCount = (fieldIdx) => {
22037
+ const rowIdx = fieldRowIndex[fieldIdx];
22038
+ const row = rowIdx === void 0 ? void 0 : rows[rowIdx];
22039
+ const printableWidth = 2 + Math.max(26, (row?.label ?? "").length) + Math.max(12, String(row?.value ?? "").length) + (row?.detail ?? "").length;
22040
+ return Math.max(1, Math.ceil(printableWidth / contentWidth));
22041
+ };
22042
+ const INPUT_ROWS = inputHeight ?? 3;
22043
+ const bottomChromeRows = statuslineMode === "detailed" ? 5 : 2;
22044
+ const BORDER_ROWS = 2;
22045
+ const BASE_CHROME_ROWS = contentWidth < 64 ? 4 : 3;
22046
+ const pickerHeight = Math.max(8, termRows - INPUT_ROWS - bottomChromeRows);
22047
+ const innerHeight = pickerHeight - BORDER_ROWS;
22022
22048
  const totalFields = fieldRowIndex.length;
22023
- const windowStart = totalFields <= VISIBLE_FIELDS ? 0 : Math.max(0, Math.min(field - Math.floor(VISIBLE_FIELDS / 2), totalFields - VISIBLE_FIELDS));
22049
+ const sectionFieldStarts = deriveSettingsSectionFieldStarts(fieldRowIndex);
22050
+ const countWindowLines = (start, end) => {
22051
+ let lines = 0;
22052
+ for (let fieldIdx = start; fieldIdx < end; fieldIdx++) {
22053
+ lines += fieldLineCount(fieldIdx);
22054
+ }
22055
+ for (const secStart of sectionFieldStarts) {
22056
+ if (secStart >= start && secStart < end) lines++;
22057
+ }
22058
+ if (start > 0 && !sectionFieldStarts.includes(start)) lines++;
22059
+ return lines;
22060
+ };
22061
+ const windowStartFor = (n) => totalFields <= n ? 0 : Math.max(0, Math.min(field - Math.floor(n / 2), totalFields - n));
22062
+ const windowFits = (fieldCount) => {
22063
+ const start = windowStartFor(fieldCount);
22064
+ const end = Math.min(start + fieldCount, totalFields);
22065
+ const scrollIndicatorRows = (start > 0 ? 1 : 0) + (end < totalFields ? 1 : 0);
22066
+ const chromeRows = BASE_CHROME_ROWS + scrollIndicatorRows + (hint ? 1 : 0);
22067
+ return countWindowLines(start, end) + chromeRows <= innerHeight;
22068
+ };
22069
+ let lo = 3;
22070
+ let hi = totalFields;
22071
+ let VISIBLE_FIELDS = Math.min(3, totalFields);
22072
+ while (lo <= hi) {
22073
+ const mid = Math.floor((lo + hi) / 2);
22074
+ if (windowFits(mid)) {
22075
+ VISIBLE_FIELDS = mid;
22076
+ lo = mid + 1;
22077
+ } else {
22078
+ hi = mid - 1;
22079
+ }
22080
+ }
22081
+ const windowStart = windowStartFor(VISIBLE_FIELDS);
22024
22082
  const windowEnd = Math.min(windowStart + VISIBLE_FIELDS, totalFields);
22025
22083
  const hasAbove = windowStart > 0;
22026
22084
  const hasBelow = windowEnd < totalFields;
22027
- return /* @__PURE__ */ jsxs71(Box, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, children: [
22028
- /* @__PURE__ */ jsx74(Text, { color: "cyan", bold: true, children: "\u2501\u2501 Settings \u2501\u2501" }),
22029
- filterActive ? /* @__PURE__ */ jsx74(
22030
- Text,
22031
- {
22032
- color: "yellow",
22033
- bold: true,
22034
- children: `Filter: ${filter} (${filteredFieldIndices.length} match${filteredFieldIndices.length === 1 ? "" : "es"})`
22035
- }
22036
- ) : /* @__PURE__ */ jsx74(Text, { dimColor: true, children: "\u2191/\u2193 field \xB7 \u2190/\u2192 change + autosave \xB7 `/` to search \xB7 F5 to close" }),
22037
- hasAbove && !filterActive ? /* @__PURE__ */ jsx74(Text, { dimColor: true, children: ` \u2191 ${windowStart} field${windowStart === 1 ? "" : "s"} above` }) : null,
22038
- filterActive && filteredFieldIndices.length === 0 ? /* @__PURE__ */ jsx74(Text, { dimColor: true, italic: true, children: "No matching settings rows." }) : null,
22039
- /* @__PURE__ */ jsx74(
22040
- SettingsPickerRowList,
22041
- {
22042
- rows,
22043
- field,
22044
- fieldRowIndex,
22045
- filterActive,
22046
- rankedResults,
22047
- highlightSegments,
22048
- windowStart,
22049
- windowEnd
22050
- }
22051
- ),
22052
- hasBelow && !filterActive ? /* @__PURE__ */ jsx74(
22053
- Text,
22054
- {
22055
- dimColor: true,
22056
- children: ` \u2193 ${totalFields - windowEnd} field${totalFields - windowEnd === 1 ? "" : "s"} below`
22057
- }
22058
- ) : null,
22059
- /* @__PURE__ */ jsx74(Text, { dimColor: true, children: configScope === "project" ? "Persisted to <project>/.wrongstack/config.json" : `Persisted to ${profileConfigPath}` }),
22060
- hint ? /* @__PURE__ */ jsx74(Text, { color: "yellow", children: hint }) : null
22061
- ] });
22085
+ const maxFilteredFieldLines = Math.max(
22086
+ 1,
22087
+ ...rankedResults.map((result) => fieldLineCount(result.chord.field))
22088
+ );
22089
+ const FILTER_CHROME_ROWS = BASE_CHROME_ROWS + 2;
22090
+ const FILTER_VISIBLE_FIELDS = Math.max(
22091
+ 3,
22092
+ Math.floor((innerHeight - FILTER_CHROME_ROWS - (hint ? 1 : 0)) / maxFilteredFieldLines)
22093
+ );
22094
+ const filterMatchCount = rankedResults.length;
22095
+ const filterSelectedIdx = filterActive ? rankedResults.findIndex((r) => r.chord.field === field) : -1;
22096
+ const filterWindowStart = !filterActive || filterMatchCount <= FILTER_VISIBLE_FIELDS || filterSelectedIdx < 0 ? 0 : Math.max(
22097
+ 0,
22098
+ Math.min(
22099
+ filterSelectedIdx - Math.floor(FILTER_VISIBLE_FIELDS / 2),
22100
+ filterMatchCount - FILTER_VISIBLE_FIELDS
22101
+ )
22102
+ );
22103
+ const filterWindowEnd = Math.min(filterWindowStart + FILTER_VISIBLE_FIELDS, filterMatchCount);
22104
+ const filterHasAbove = filterActive && filterWindowStart > 0;
22105
+ const filterHasBelow = filterActive && filterWindowEnd < filterMatchCount;
22106
+ return /* @__PURE__ */ jsxs71(
22107
+ Box,
22108
+ {
22109
+ flexDirection: "column",
22110
+ borderStyle: "round",
22111
+ borderColor: "yellow",
22112
+ paddingX: 1,
22113
+ height: pickerHeight,
22114
+ overflowY: "hidden",
22115
+ children: [
22116
+ /* @__PURE__ */ jsx74(Text, { color: "cyan", bold: true, children: "\u2501\u2501 Settings \u2501\u2501" }),
22117
+ filterActive ? /* @__PURE__ */ jsx74(
22118
+ Text,
22119
+ {
22120
+ color: "yellow",
22121
+ bold: true,
22122
+ children: `Filter: ${filter} (${filteredFieldIndices.length} match${filteredFieldIndices.length === 1 ? "" : "es"})`
22123
+ }
22124
+ ) : /* @__PURE__ */ jsx74(Text, { dimColor: true, children: "\u2191/\u2193 field \xB7 \u2190/\u2192 change + autosave \xB7 `/` to search \xB7 F5 to close" }),
22125
+ filterActive && filterHasAbove ? /* @__PURE__ */ jsx74(Text, { dimColor: true, children: ` \u2191 ${filterWindowStart} match${filterWindowStart === 1 ? "" : "es"} above` }) : null,
22126
+ !filterActive && hasAbove ? /* @__PURE__ */ jsx74(Text, { dimColor: true, children: ` \u2191 ${windowStart} field${windowStart === 1 ? "" : "s"} above` }) : null,
22127
+ filterActive && filteredFieldIndices.length === 0 ? /* @__PURE__ */ jsx74(Text, { dimColor: true, italic: true, children: "No matching settings rows." }) : null,
22128
+ /* @__PURE__ */ jsx74(
22129
+ SettingsPickerRowList,
22130
+ {
22131
+ rows,
22132
+ field,
22133
+ fieldRowIndex,
22134
+ filterActive,
22135
+ rankedResults,
22136
+ highlightSegments,
22137
+ windowStart,
22138
+ windowEnd,
22139
+ filterWindowStart,
22140
+ filterWindowEnd
22141
+ }
22142
+ ),
22143
+ filterActive && filterHasBelow ? /* @__PURE__ */ jsx74(Text, { dimColor: true, children: ` \u2193 ${filterMatchCount - filterWindowEnd} match${filterMatchCount - filterWindowEnd === 1 ? "" : "es"} below` }) : null,
22144
+ !filterActive && hasBelow ? /* @__PURE__ */ jsx74(
22145
+ Text,
22146
+ {
22147
+ dimColor: true,
22148
+ children: ` \u2193 ${totalFields - windowEnd} field${totalFields - windowEnd === 1 ? "" : "s"} below`
22149
+ }
22150
+ ) : null,
22151
+ /* @__PURE__ */ jsx74(Text, { dimColor: true, children: configScope === "project" ? "Persisted to <project>/.wrongstack/config.json" : `Persisted to ${profileConfigPath}` }),
22152
+ hint ? /* @__PURE__ */ jsx74(Text, { color: "yellow", children: hint }) : null
22153
+ ]
22154
+ }
22155
+ );
22062
22156
  }
22063
22157
 
22064
22158
  // src/components/shadow-panel.tsx
@@ -24412,10 +24506,10 @@ function TopicCheckPanel({ prompt }) {
24412
24506
 
24413
24507
  // src/hooks/use-sidebar-panel-data.ts
24414
24508
  import { getProcessRegistry as getProcessRegistry3 } from "@wrongstack/tools";
24415
- import { useEffect as useEffect24, useState as useState24 } from "react";
24509
+ import { useEffect as useEffect25, useState as useState24 } from "react";
24416
24510
  function useSidebarProcessList(enabled = true) {
24417
24511
  const [data, setData] = useState24({ activeCount: 0, totalCount: 0, processes: [] });
24418
- useEffect24(() => {
24512
+ useEffect25(() => {
24419
24513
  if (!enabled) return;
24420
24514
  const read = () => {
24421
24515
  const registry = getProcessRegistry3();
@@ -24436,7 +24530,7 @@ function useSidebarProcessList(enabled = true) {
24436
24530
  }
24437
24531
  function useSidebarConnections(projectRoot, enabled = true) {
24438
24532
  const [connections, setConnections] = useState24([]);
24439
- useEffect24(() => {
24533
+ useEffect25(() => {
24440
24534
  if (!enabled) return;
24441
24535
  let cancelled = false;
24442
24536
  const poll = async () => {
@@ -24465,7 +24559,7 @@ function useSidebarConnections(projectRoot, enabled = true) {
24465
24559
  }
24466
24560
  function useSidebarKanban(projectRoot, enabled = true) {
24467
24561
  const [data, setData] = useState24({ columns: [], totalActive: 0, activeCardTitles: [] });
24468
- useEffect24(() => {
24562
+ useEffect25(() => {
24469
24563
  if (!enabled) return;
24470
24564
  let cancelled = false;
24471
24565
  const poll = async () => {
@@ -24798,6 +24892,7 @@ function AppView({ host, runtime }) {
24798
24892
  nextStepsTool: state.settingsPicker.nextStepsTool,
24799
24893
  readSymbols: state.settingsPicker.readSymbols,
24800
24894
  panelPositions: state.settingsPicker.panelPositions,
24895
+ inputHeight,
24801
24896
  filter: state.settingsPicker.filter,
24802
24897
  hint: state.settingsPicker.hint
24803
24898
  }
@@ -26636,7 +26731,7 @@ function useAppPickerKeys({
26636
26731
 
26637
26732
  // src/hooks/use-app-runtime-refs.ts
26638
26733
  import { InputBuilder } from "@wrongstack/core/agent";
26639
- import { useEffect as useEffect25, useRef as useRef10 } from "react";
26734
+ import { useEffect as useEffect26, useRef as useRef10 } from "react";
26640
26735
 
26641
26736
  // src/token-previews.ts
26642
26737
  var TOKEN_PREVIEWS_MAX_ENTRIES = 64;
@@ -26776,7 +26871,7 @@ function useAppRuntimeRefs(attachments, state) {
26776
26871
  builderRef.current = new InputBuilder({ store: attachments });
26777
26872
  }
26778
26873
  const activeCtrlRef = useRef10(null);
26779
- useEffect25(
26874
+ useEffect26(
26780
26875
  () => () => {
26781
26876
  activeCtrlRef.current?.abort("TUI unmounted");
26782
26877
  activeCtrlRef.current = null;
@@ -26834,7 +26929,7 @@ function useAppRuntimeRefs(attachments, state) {
26834
26929
  }
26835
26930
 
26836
26931
  // src/hooks/use-app-session-state.ts
26837
- import { useEffect as useEffect26, useMemo as useMemo9, useReducer } from "react";
26932
+ import { useEffect as useEffect27, useMemo as useMemo9, useReducer } from "react";
26838
26933
 
26839
26934
  // src/checkpoint-retention.ts
26840
26935
  var TUI_CHECKPOINTS_MAX_ENTRIES = 200;
@@ -31124,7 +31219,7 @@ function useAppSessionState(options) {
31124
31219
  }),
31125
31220
  [options.sessionsDir]
31126
31221
  );
31127
- useEffect26(() => {
31222
+ useEffect27(() => {
31128
31223
  void layoutStore.load();
31129
31224
  return () => {
31130
31225
  void layoutStore.flushNow();
@@ -31134,7 +31229,7 @@ function useAppSessionState(options) {
31134
31229
  }
31135
31230
 
31136
31231
  // src/hooks/use-auth-panel.ts
31137
- import { useCallback as useCallback7, useEffect as useEffect27, useRef as useRef11 } from "react";
31232
+ import { useCallback as useCallback7, useEffect as useEffect28, useRef as useRef11 } from "react";
31138
31233
  function abortError() {
31139
31234
  return Object.assign(new Error("Cancelled"), { name: "AbortError" });
31140
31235
  }
@@ -31160,14 +31255,14 @@ function useAuthPanel(opts) {
31160
31255
  promptRef.current = null;
31161
31256
  pending?.reject(abortError());
31162
31257
  }, []);
31163
- useEffect27(() => {
31258
+ useEffect28(() => {
31164
31259
  mountedRef.current = true;
31165
31260
  return () => {
31166
31261
  mountedRef.current = false;
31167
31262
  abortLiveFlow();
31168
31263
  };
31169
31264
  }, [abortLiveFlow]);
31170
- useEffect27(() => {
31265
+ useEffect28(() => {
31171
31266
  if (!open) abortLiveFlow();
31172
31267
  }, [open, abortLiveFlow]);
31173
31268
  const reloadProviders = useCallback7(async () => {
@@ -31521,7 +31616,7 @@ function useAuthPanel(opts) {
31521
31616
  }
31522
31617
 
31523
31618
  // src/hooks/use-autonomous-coordinator.ts
31524
- import { useCallback as useCallback8, useEffect as useEffect28, useRef as useRef12 } from "react";
31619
+ import { useCallback as useCallback8, useEffect as useEffect29, useRef as useRef12 } from "react";
31525
31620
  function useAutonomousCoordinator(subscribeCoordinatorEvents, dispatch) {
31526
31621
  const dispatchRef = useRef12(dispatch);
31527
31622
  dispatchRef.current = dispatch;
@@ -31531,7 +31626,7 @@ function useAutonomousCoordinator(subscribeCoordinatorEvents, dispatch) {
31531
31626
  event
31532
31627
  });
31533
31628
  }, []);
31534
- useEffect28(() => {
31629
+ useEffect29(() => {
31535
31630
  if (!subscribeCoordinatorEvents) return;
31536
31631
  const unsubscribe = subscribeCoordinatorEvents(handler);
31537
31632
  return unsubscribe;
@@ -31541,7 +31636,7 @@ function useAutonomousCoordinator(subscribeCoordinatorEvents, dispatch) {
31541
31636
  // src/hooks/use-autonomy-drivers.ts
31542
31637
  import { toErrorMessage as toErrorMessage3 } from "@wrongstack/core/utils";
31543
31638
  import {
31544
- useEffect as useEffect29,
31639
+ useEffect as useEffect30,
31545
31640
  useRef as useRef13
31546
31641
  } from "react";
31547
31642
  function useAutonomyDrivers({
@@ -31559,7 +31654,7 @@ function useAutonomyDrivers({
31559
31654
  parallelLoopRunningRef
31560
31655
  }) {
31561
31656
  const mountedRef = useRef13(true);
31562
- useEffect29(() => {
31657
+ useEffect30(() => {
31563
31658
  mountedRef.current = true;
31564
31659
  return () => {
31565
31660
  mountedRef.current = false;
@@ -31651,7 +31746,7 @@ function useAutonomyDrivers({
31651
31746
  };
31652
31747
  const runParallelLoopRef = useRef13(runParallelLoop);
31653
31748
  runParallelLoopRef.current = runParallelLoop;
31654
- useEffect29(() => {
31749
+ useEffect30(() => {
31655
31750
  if (!subscribeEternalIteration) return;
31656
31751
  const unsub = subscribeEternalIteration((entry) => {
31657
31752
  const mark = entry.status === "success" ? "\u2713" : entry.status === "failure" ? "\u2717" : entry.status === "aborted" ? "\u2298" : "\xB7";
@@ -31662,7 +31757,7 @@ function useAutonomyDrivers({
31662
31757
  });
31663
31758
  return unsub;
31664
31759
  }, [subscribeEternalIteration]);
31665
- useEffect29(() => {
31760
+ useEffect30(() => {
31666
31761
  if (!subscribeEternalStage) return;
31667
31762
  const unsub = subscribeEternalStage((stage) => {
31668
31763
  dispatch({ type: "eternalStage", stage });
@@ -31998,7 +32093,7 @@ function useBrainPanel(opts) {
31998
32093
  }
31999
32094
 
32000
32095
  // src/hooks/use-brain-risk-sync.ts
32001
- import { useCallback as useCallback9, useEffect as useEffect30, useRef as useRef14 } from "react";
32096
+ import { useCallback as useCallback9, useEffect as useEffect31, useRef as useRef14 } from "react";
32002
32097
  function useBrainRiskSync({
32003
32098
  dispatch,
32004
32099
  riskLevel,
@@ -32012,7 +32107,7 @@ function useBrainRiskSync({
32012
32107
  [dispatch]
32013
32108
  );
32014
32109
  const prevRiskRef = useRef14(riskLevel);
32015
- useEffect30(() => {
32110
+ useEffect31(() => {
32016
32111
  if (!brainPanelOpen) return;
32017
32112
  if (riskLevel !== prevRiskRef.current && onBrainRiskLevel) {
32018
32113
  prevRiskRef.current = riskLevel;
@@ -32026,7 +32121,7 @@ function useBrainRiskSync({
32026
32121
 
32027
32122
  // src/hooks/use-client-telemetry.ts
32028
32123
  import { projectSlug } from "@wrongstack/core/utils";
32029
- import { useEffect as useEffect31 } from "react";
32124
+ import { useEffect as useEffect32 } from "react";
32030
32125
  function useClientTelemetry({
32031
32126
  events,
32032
32127
  clientId,
@@ -32037,7 +32132,7 @@ function useClientTelemetry({
32037
32132
  restoreDebugStreamCallback,
32038
32133
  dispatch
32039
32134
  }) {
32040
- useEffect31(() => {
32135
+ useEffect32(() => {
32041
32136
  if (!clientId || !events) return;
32042
32137
  let toolCalls = 0;
32043
32138
  const emitStatus = () => {
@@ -32079,7 +32174,7 @@ function useClientTelemetry({
32079
32174
  offIterCompleted();
32080
32175
  };
32081
32176
  }, [events, clientId, tokenCounter, getAutonomy, agent.ctx.model, agent.ctx.projectRoot]);
32082
- useEffect31(() => {
32177
+ useEffect32(() => {
32083
32178
  if (!registerDebugStreamCallback) return;
32084
32179
  let cancelled = false;
32085
32180
  registerDebugStreamCallback((stats) => {
@@ -32113,7 +32208,7 @@ import { toErrorMessage as toErrorMessage4 } from "@wrongstack/core/utils";
32113
32208
  import { getProcessRegistry as getProcessRegistry6 } from "@wrongstack/tools";
32114
32209
  import {
32115
32210
  useCallback as useCallback10,
32116
- useEffect as useEffect32,
32211
+ useEffect as useEffect33,
32117
32212
  useMemo as useMemo10
32118
32213
  } from "react";
32119
32214
 
@@ -33922,7 +34017,7 @@ function useCoreTuiCommands({
33922
34017
  }) {
33923
34018
  const stdout = { columns: terminalWidth };
33924
34019
  const getCronJobs = useMemo10(() => createCronJobsGetter(agent), [agent]);
33925
- useEffect32(() => {
34020
+ useEffect33(() => {
33926
34021
  slashRegistry.register(createKillSlashCommand());
33927
34022
  slashRegistry.register(createPsSlashCommand());
33928
34023
  slashRegistry.register(createCronSlashCommand({ getCronJobs }));
@@ -33995,7 +34090,7 @@ function useCoreTuiCommands({
33995
34090
  getModeLabel,
33996
34091
  getCronJobs
33997
34092
  ]);
33998
- useEffect32(() => {
34093
+ useEffect33(() => {
33999
34094
  return () => {
34000
34095
  getProcessRegistry6().killAll({ preserveBackground: true });
34001
34096
  };
@@ -34027,7 +34122,7 @@ function useCoreTuiCommands({
34027
34122
  },
34028
34123
  [liveDirector, clearPendingConfirms, dispatch]
34029
34124
  );
34030
- useEffect32(() => {
34125
+ useEffect33(() => {
34031
34126
  const cmd = {
34032
34127
  name: "steer",
34033
34128
  description: "Interrupt the running agent (incl. fleet) and redirect: /steer <new direction>",
@@ -34059,7 +34154,7 @@ function useCoreTuiCommands({
34059
34154
  slashRegistry.unregister("steer");
34060
34155
  };
34061
34156
  }, [slashRegistry, director, runSteerSequence]);
34062
- useEffect32(() => {
34157
+ useEffect33(() => {
34063
34158
  const cmd = {
34064
34159
  name: "rewind",
34065
34160
  description: "Open checkpoint timeline to rewind session: /rewind [checkpoint-index]",
@@ -34096,7 +34191,7 @@ function useCoreTuiCommands({
34096
34191
  slashRegistry.unregister("rewind");
34097
34192
  };
34098
34193
  }, [slashRegistry, handleRewindTo]);
34099
- useEffect32(() => {
34194
+ useEffect33(() => {
34100
34195
  const cmd = {
34101
34196
  name: "agents",
34102
34197
  description: "Toggle the agents monitor overlay.",
@@ -34118,7 +34213,7 @@ function useCoreTuiCommands({
34118
34213
  }
34119
34214
 
34120
34215
  // src/hooks/use-director-fleet-bridge.ts
34121
- import { useEffect as useEffect33, useRef as useRef16 } from "react";
34216
+ import { useEffect as useEffect34, useRef as useRef16 } from "react";
34122
34217
  import { stripNextStepsBlock } from "@wrongstack/tools/next-steps";
34123
34218
 
34124
34219
  // src/hooks/fleet-chat-coalescer.ts
@@ -34206,10 +34301,10 @@ function useDirectorFleetBridge({
34206
34301
  const labelsRef = useRef16(/* @__PURE__ */ new Map());
34207
34302
  const chatModeRef = useRef16(chatMode);
34208
34303
  const gate = useFleetGenerationGate(sessionGenerationRef);
34209
- useEffect33(() => {
34304
+ useEffect34(() => {
34210
34305
  chatModeRef.current = chatMode;
34211
34306
  }, [chatMode]);
34212
- useEffect33(() => {
34307
+ useEffect34(() => {
34213
34308
  const d = director;
34214
34309
  if (!d) return;
34215
34310
  const batch = [];
@@ -34644,13 +34739,13 @@ function handleCollabDone(event, dispatch, stateRef) {
34644
34739
  }
34645
34740
 
34646
34741
  // src/hooks/use-enhance-runtime-state.ts
34647
- import { useEffect as useEffect34, useRef as useRef17, useState as useState25 } from "react";
34742
+ import { useEffect as useEffect35, useRef as useRef17, useState as useState25 } from "react";
34648
34743
  function useEnhanceRuntimeState({
34649
34744
  enhanceEnabled,
34650
34745
  midRunSendPicker
34651
34746
  }) {
34652
34747
  const enhanceEnabledRef = useRef17(enhanceEnabled);
34653
- useEffect34(() => {
34748
+ useEffect35(() => {
34654
34749
  enhanceEnabledRef.current = enhanceEnabled;
34655
34750
  }, [enhanceEnabled]);
34656
34751
  const midRunSendPickerRef = useRef17(midRunSendPicker);
@@ -34683,7 +34778,7 @@ function useEnhanceRuntimeState({
34683
34778
 
34684
34779
  // src/hooks/use-exit-command.ts
34685
34780
  import { getProcessRegistry as getProcessRegistry7 } from "@wrongstack/tools";
34686
- import { useCallback as useCallback12, useEffect as useEffect35, useRef as useRef18 } from "react";
34781
+ import { useCallback as useCallback12, useEffect as useEffect36, useRef as useRef18 } from "react";
34687
34782
 
34688
34783
  // src/exit-slash.ts
34689
34784
  var DESCRIPTION = "Exit the TUI. While a leader run or any subagent is still active, asks for an explicit Enter/Esc confirmation before terminating them.";
@@ -34789,7 +34884,7 @@ function useExitCommand({
34789
34884
  },
34790
34885
  [dispatch, terminateWork]
34791
34886
  );
34792
- useEffect35(() => {
34887
+ useEffect36(() => {
34793
34888
  const cmd = createExitSlashCommand({
34794
34889
  isLeaderActive: () => interruptController?.isRunning?.() ?? stateRef.current.status !== "idle",
34795
34890
  countRunningSubagents: () => Object.values(stateRef.current.fleet).filter((e) => e.status === "running").length,
@@ -34809,7 +34904,7 @@ function useExitCommand({
34809
34904
  import * as fs3 from "node:fs/promises";
34810
34905
  import * as path4 from "node:path";
34811
34906
  import { toErrorMessage as toErrorMessage5 } from "@wrongstack/core/utils";
34812
- import { useEffect as useEffect36 } from "react";
34907
+ import { useEffect as useEffect37 } from "react";
34813
34908
 
34814
34909
  // src/file-search.ts
34815
34910
  import * as fs2 from "node:fs/promises";
@@ -34911,7 +35006,7 @@ function detectAtToken(buffer, cursor) {
34911
35006
  }
34912
35007
  function useFileSearch(options) {
34913
35008
  const { state, dispatch, projectRoot, builderRef, draftRef, setDraft, tokenPreviewsRef } = options;
34914
- useEffect36(() => {
35009
+ useEffect37(() => {
34915
35010
  const detected = detectAtToken(state.buffer, state.cursor);
34916
35011
  if (!detected) {
34917
35012
  if (state.picker.open) dispatch({ type: "pickerClose" });
@@ -34988,7 +35083,7 @@ function fileReadContract(filePath, bytes) {
34988
35083
  }
34989
35084
 
34990
35085
  // src/hooks/use-git-session-status.ts
34991
- import { useEffect as useEffect37, useRef as useRef19, useState as useState26 } from "react";
35086
+ import { useEffect as useEffect38, useRef as useRef19, useState as useState26 } from "react";
34992
35087
 
34993
35088
  // src/git-info.ts
34994
35089
  import { spawn } from "node:child_process";
@@ -35092,10 +35187,10 @@ function useGitSessionStatus({
35092
35187
  const [gitInfo, setGitInfo] = useState26(null);
35093
35188
  const previousBranchRef = useRef19(null);
35094
35189
  const gitHidden = hiddenItems.includes("git");
35095
- useEffect37(() => {
35190
+ useEffect38(() => {
35096
35191
  if (gitHidden) previousBranchRef.current = null;
35097
35192
  }, [gitHidden]);
35098
- useEffect37(() => {
35193
+ useEffect38(() => {
35099
35194
  if (gitHidden) return;
35100
35195
  let cancelled = false;
35101
35196
  const refresh = () => {
@@ -35129,7 +35224,7 @@ function useGitSessionStatus({
35129
35224
  clearInterval(timer);
35130
35225
  };
35131
35226
  }, [agent.ctx, gitHidden]);
35132
- useEffect37(() => {
35227
+ useEffect38(() => {
35133
35228
  if (!getLiveSessions) return;
35134
35229
  let cancelled = false;
35135
35230
  const poll = async () => {
@@ -35167,7 +35262,7 @@ function useHelpPanel(dispatch, slashRegistry) {
35167
35262
  }
35168
35263
 
35169
35264
  // src/hooks/use-history-copy-notice.ts
35170
- import { useCallback as useCallback14, useEffect as useEffect38, useRef as useRef20 } from "react";
35265
+ import { useCallback as useCallback14, useEffect as useEffect39, useRef as useRef20 } from "react";
35171
35266
  function useHistoryCopyNotice(dispatch) {
35172
35267
  const copiedHintTimerRef = useRef20(null);
35173
35268
  const onHistoryCopy = useCallback14(
@@ -35181,7 +35276,7 @@ function useHistoryCopyNotice(dispatch) {
35181
35276
  },
35182
35277
  [dispatch]
35183
35278
  );
35184
- useEffect38(
35279
+ useEffect39(
35185
35280
  () => () => {
35186
35281
  if (copiedHintTimerRef.current) clearTimeout(copiedHintTimerRef.current);
35187
35282
  },
@@ -35191,14 +35286,14 @@ function useHistoryCopyNotice(dispatch) {
35191
35286
  }
35192
35287
 
35193
35288
  // src/hooks/use-history-viewport-sync.ts
35194
- import { useEffect as useEffect39, useLayoutEffect as useLayoutEffect2, useRef as useRef21, useState as useState27 } from "react";
35289
+ import { useEffect as useEffect40, useLayoutEffect as useLayoutEffect2, useRef as useRef21, useState as useState27 } from "react";
35195
35290
  function useHistoryViewportSync(input) {
35196
35291
  const { stdoutRows, viewportRows, setViewportRows } = input;
35197
35292
  const bottomRegionRef = useRef21(null);
35198
35293
  const statusBarWrapRef = useRef21(null);
35199
35294
  const belowStatusBarRef = useRef21(null);
35200
35295
  const [termRows, setTermRows] = useState27(stdoutRows ?? 24);
35201
- useEffect39(() => {
35296
+ useEffect40(() => {
35202
35297
  const handleResize = () => setTermRows(process.stdout.rows ?? 24);
35203
35298
  process.stdout.prependListener("resize", handleResize);
35204
35299
  return () => {
@@ -35218,7 +35313,7 @@ function useHistoryViewportSync(input) {
35218
35313
 
35219
35314
  // src/hooks/use-initial-prompt.ts
35220
35315
  import { buildGoalPreamble } from "@wrongstack/core/execution";
35221
- import { useEffect as useEffect40, useRef as useRef22 } from "react";
35316
+ import { useEffect as useEffect41, useRef as useRef22 } from "react";
35222
35317
  function useInitialPrompt({
35223
35318
  initialGoal,
35224
35319
  initialAsk,
@@ -35227,7 +35322,7 @@ function useInitialPrompt({
35227
35322
  dispatch
35228
35323
  }) {
35229
35324
  const bootInjectedRef = useRef22(false);
35230
- useEffect40(() => {
35325
+ useEffect41(() => {
35231
35326
  if (bootInjectedRef.current) return;
35232
35327
  const goal = initialGoal?.trim();
35233
35328
  const ask = initialAsk?.trim();
@@ -35274,7 +35369,7 @@ function useInitialPrompt({
35274
35369
  import { DefaultSecretScrubber } from "@wrongstack/core/security";
35275
35370
  import { INPUT_HISTORY_DEFAULT_MAX, InputHistoryStore } from "@wrongstack/core/storage";
35276
35371
  import { resolveWstackPaths as resolveWstackPaths3 } from "@wrongstack/core/utils";
35277
- import { useEffect as useEffect41, useMemo as useMemo12, useRef as useRef23 } from "react";
35372
+ import { useEffect as useEffect42, useMemo as useMemo12, useRef as useRef23 } from "react";
35278
35373
  function useInputHistoryPersistence({
35279
35374
  projectRoot,
35280
35375
  inputHistory,
@@ -35288,7 +35383,7 @@ function useInputHistoryPersistence({
35288
35383
  const inputHistoryLoadedRef = useRef23(false);
35289
35384
  const inputHistorySaveTimerRef = useRef23(void 0);
35290
35385
  const inputHistoryLastSavedRef = useRef23("");
35291
- useEffect41(() => {
35386
+ useEffect42(() => {
35292
35387
  if (!inputHistoryStore) return;
35293
35388
  let cancelled = false;
35294
35389
  inputHistoryStore.load().then((entries) => {
@@ -35304,7 +35399,7 @@ function useInputHistoryPersistence({
35304
35399
  cancelled = true;
35305
35400
  };
35306
35401
  }, [inputHistoryStore, dispatch]);
35307
- useEffect41(() => {
35402
+ useEffect42(() => {
35308
35403
  if (!inputHistoryStore || !inputHistoryLoadedRef.current) return;
35309
35404
  const snapshot = JSON.stringify(inputHistory);
35310
35405
  if (snapshot === inputHistoryLastSavedRef.current) return;
@@ -35324,7 +35419,7 @@ function useInputHistoryPersistence({
35324
35419
  import { getProcessRegistry as getProcessRegistry8 } from "@wrongstack/tools";
35325
35420
  import {
35326
35421
  useCallback as useCallback15,
35327
- useEffect as useEffect42,
35422
+ useEffect as useEffect43,
35328
35423
  useRef as useRef24
35329
35424
  } from "react";
35330
35425
  var INTERRUPT_PRESS_WINDOW_MS = 2e3;
@@ -35523,7 +35618,7 @@ function useInterruptLadder({
35523
35618
  onExit,
35524
35619
  exit
35525
35620
  ]);
35526
- useEffect42(() => {
35621
+ useEffect43(() => {
35527
35622
  process.on("SIGINT", runInterruptLadder);
35528
35623
  return () => {
35529
35624
  process.off("SIGINT", runInterruptLadder);
@@ -35549,7 +35644,7 @@ function useKanbanBoardFocus() {
35549
35644
  }
35550
35645
 
35551
35646
  // src/hooks/use-live-settings-state.ts
35552
- import { useEffect as useEffect43, useRef as useRef26 } from "react";
35647
+ import { useEffect as useEffect44, useRef as useRef26 } from "react";
35553
35648
  function useLiveSettingsState({
35554
35649
  getSettings,
35555
35650
  titleController,
@@ -35565,7 +35660,7 @@ function useLiveSettingsState({
35565
35660
  const confirmExitRef = useRef26(confirmExit);
35566
35661
  confirmExitRef.current = liveSettings?.confirmExit ?? confirmExit;
35567
35662
  const liveTitleAnimation = liveSettings?.titleAnimation;
35568
- useEffect43(() => {
35663
+ useEffect44(() => {
35569
35664
  if (!titleController) return;
35570
35665
  titleController.setEnabled(liveTitleAnimation !== false);
35571
35666
  }, [titleController, liveTitleAnimation]);
@@ -35580,10 +35675,10 @@ function useLiveSettingsState({
35580
35675
  }
35581
35676
 
35582
35677
  // src/hooks/use-live-todos.ts
35583
- import { useEffect as useEffect44, useState as useState29 } from "react";
35678
+ import { useEffect as useEffect45, useState as useState29 } from "react";
35584
35679
  function useLiveTodos(context) {
35585
35680
  const [todos, setTodos] = useState29(() => [...context.todos]);
35586
- useEffect44(() => {
35681
+ useEffect45(() => {
35587
35682
  setTodos([...context.todos]);
35588
35683
  return context.state.onChange((change) => {
35589
35684
  if (change.kind === "todos_replaced") setTodos([...change.todos]);
@@ -35593,7 +35688,7 @@ function useLiveTodos(context) {
35593
35688
  }
35594
35689
 
35595
35690
  // src/hooks/use-mailbox-view-model.ts
35596
- import { useEffect as useEffect45, useState as useState30 } from "react";
35691
+ import { useEffect as useEffect46, useState as useState30 } from "react";
35597
35692
  function useMailboxViewModel(events) {
35598
35693
  const [mailboxStatus, setMailboxStatus] = useState30({
35599
35694
  unread: 0,
@@ -35603,7 +35698,7 @@ function useMailboxViewModel(events) {
35603
35698
  const [mailboxPanelOpen, setMailboxPanelOpen] = useState30(false);
35604
35699
  const [mailboxMessages, setMailboxMessages] = useState30([]);
35605
35700
  const [mailboxAgents, setMailboxAgents] = useState30([]);
35606
- useEffect45(() => {
35701
+ useEffect46(() => {
35607
35702
  const AGENT_ONLINE_TTL_MS = 12e4;
35608
35703
  const lastSeen = /* @__PURE__ */ new Map();
35609
35704
  const unsubUnread = events.onPattern("mailbox.unread_count", (_event, payload) => {
@@ -35665,7 +35760,7 @@ function useMailboxViewModel(events) {
35665
35760
  unsubSnapshot();
35666
35761
  };
35667
35762
  }, [events]);
35668
- useEffect45(() => {
35763
+ useEffect46(() => {
35669
35764
  const unsubMessage = events.onPattern("mailbox.received", (_event, payload) => {
35670
35765
  const data = payload;
35671
35766
  if (!data?.messageId) return;
@@ -35816,7 +35911,7 @@ function useModelPickRequest(opts) {
35816
35911
  }
35817
35912
 
35818
35913
  // src/hooks/use-mouse-tracking.ts
35819
- import { useEffect as useEffect46, useRef as useRef27, useState as useState31 } from "react";
35914
+ import { useEffect as useEffect47, useRef as useRef27, useState as useState31 } from "react";
35820
35915
  function useMouseTracking(input) {
35821
35916
  const { initialMouseMode, overlayOpen, protocol, stdout } = input;
35822
35917
  const [mouseMode, setMouseMode] = useState31(initialMouseMode);
@@ -35828,7 +35923,7 @@ function useMouseTracking(input) {
35828
35923
  });
35829
35924
  const mouseTrackingSequence = mouseTrackingOn ? mouseMode ? MOUSE_DRAG_ON : MOUSE_CLICK_ON : MOUSE_OFF;
35830
35925
  const mouseWrittenRef = useRef27(null);
35831
- useEffect46(() => {
35926
+ useEffect47(() => {
35832
35927
  if (mouseWrittenRef.current === mouseTrackingSequence) return;
35833
35928
  mouseWrittenRef.current = mouseTrackingSequence;
35834
35929
  try {
@@ -35836,7 +35931,7 @@ function useMouseTracking(input) {
35836
35931
  } catch {
35837
35932
  }
35838
35933
  }, [mouseTrackingSequence, stdout]);
35839
- useEffect46(
35934
+ useEffect47(
35840
35935
  () => () => {
35841
35936
  const wasTracking = mouseWrittenRef.current !== null && mouseWrittenRef.current !== MOUSE_OFF;
35842
35937
  mouseWrittenRef.current = null;
@@ -35864,7 +35959,7 @@ import {
35864
35959
  import { todoTool } from "@wrongstack/tools/todo";
35865
35960
  import {
35866
35961
  useCallback as useCallback17,
35867
- useEffect as useEffect47,
35962
+ useEffect as useEffect48,
35868
35963
  useRef as useRef28,
35869
35964
  useState as useState32
35870
35965
  } from "react";
@@ -35925,13 +36020,13 @@ function useNextStepsAutoSubmit({
35925
36020
  const autoSubmitLoopGuardRef = useRef28(createAutoProceedLoopGuard());
35926
36021
  const continuationAttemptTrackerRef = useRef28(createContinuationAttemptTracker());
35927
36022
  const [nextStepsRecheck, setNextStepsRecheck] = useState32(0);
35928
- useEffect47(() => {
36023
+ useEffect48(() => {
35929
36024
  autoSubmitStreakRef.current = 0;
35930
36025
  autoSubmitCapWarnedRef.current = false;
35931
36026
  autoSubmitLoopGuardRef.current.reset();
35932
36027
  continuationAttemptTrackerRef.current.reset();
35933
36028
  }, [autonomyLive]);
35934
- useEffect47(() => {
36029
+ useEffect48(() => {
35935
36030
  const liveAutonomy = getAutonomy?.() ?? autonomyLive;
35936
36031
  if (state.status !== "idle" || liveAutonomy !== "auto") {
35937
36032
  clearInterval(nextStepsAutoSubmitTimerRef.current);
@@ -36191,7 +36286,7 @@ ${GROUNDED_NO_PROGRESS_STEER}` : suggestion;
36191
36286
 
36192
36287
  // src/hooks/use-panel-controllers.ts
36193
36288
  import { toErrorMessage as toErrorMessage6 } from "@wrongstack/core/utils";
36194
- import React8, { useEffect as useEffect48 } from "react";
36289
+ import React8, { useEffect as useEffect49 } from "react";
36195
36290
 
36196
36291
  // src/on-panel-open.ts
36197
36292
  function createPanelOpenDispatcher(deps) {
@@ -36325,7 +36420,7 @@ function usePanelControllers({
36325
36420
  dispatch({ type: "sessionsPanelBusy", on: false });
36326
36421
  }
36327
36422
  }, [getLiveSessions]);
36328
- useEffect48(() => {
36423
+ useEffect49(() => {
36329
36424
  if (!onPanelOpen) return;
36330
36425
  const dispatcher = createPanelOpenDispatcher({
36331
36426
  dispatch,
@@ -36352,7 +36447,7 @@ function usePanelControllers({
36352
36447
  openShadowPanel,
36353
36448
  openHelpPanel
36354
36449
  ]);
36355
- useEffect48(() => {
36450
+ useEffect49(() => {
36356
36451
  if (!state.sessionsPanelOpen || !getLiveSessions) return void 0;
36357
36452
  const t = setInterval(() => {
36358
36453
  void loadLiveSessions();
@@ -36432,7 +36527,7 @@ function usePanelControllers({
36432
36527
  if (!getPluginItems) return;
36433
36528
  dispatch({ type: "pluginPickerSetItems", items: getPluginItems() });
36434
36529
  }, [getPluginItems]);
36435
- useEffect48(() => {
36530
+ useEffect49(() => {
36436
36531
  if (!state.pluginPicker.open) return;
36437
36532
  refreshPluginPicker();
36438
36533
  }, [state.pluginPicker.open, refreshPluginPicker]);
@@ -36464,7 +36559,7 @@ function usePanelControllers({
36464
36559
  if (!getMcpServers) return;
36465
36560
  dispatch({ type: "mcpPickerSetItems", items: getMcpServers() });
36466
36561
  }, [getMcpServers]);
36467
- useEffect48(() => {
36562
+ useEffect49(() => {
36468
36563
  if (!state.mcpPicker.open) return;
36469
36564
  refreshMcpPicker();
36470
36565
  }, [state.mcpPicker.open, refreshMcpPicker]);
@@ -36508,7 +36603,7 @@ function usePanelControllers({
36508
36603
  dispatch({ type: "toolsPickerSetItems", items });
36509
36604
  setLiveToolCount(items.filter((item) => item.enabled).length);
36510
36605
  }, [getToolsItems]);
36511
- useEffect48(() => {
36606
+ useEffect49(() => {
36512
36607
  if (!state.toolsPicker.open) return;
36513
36608
  refreshToolsPicker();
36514
36609
  }, [state.toolsPicker.open, refreshToolsPicker]);
@@ -36746,7 +36841,7 @@ function usePromptPicker({
36746
36841
  import { tuiStreamFlushMs } from "@wrongstack/core/utils";
36747
36842
  import { DEFAULT_MIN_IMPORTANCE as DEFAULT_MIN_IMPORTANCE2, DEFAULT_MIN_SCORE as DEFAULT_MIN_SCORE2, MIN_RELATION_STRENGTH as MIN_RELATION_STRENGTH2 } from "@wrongstack/sage";
36748
36843
  import { isFinalTurnStopReason as isFinalTurnStopReason2 } from "@wrongstack/tools/next-steps";
36749
- import { useEffect as useEffect49 } from "react";
36844
+ import { useEffect as useEffect50 } from "react";
36750
36845
 
36751
36846
  // src/memory-lifecycle-entry.ts
36752
36847
  function memoryLifecycleEntry(event, payload) {
@@ -36946,7 +37041,7 @@ function useProviderEventBridge({
36946
37041
  assistantCommittedThisRunRef,
36947
37042
  setMemoryContextMonitor
36948
37043
  }) {
36949
- useEffect49(() => {
37044
+ useEffect50(() => {
36950
37045
  const FLUSH_MS2 = tuiStreamFlushMs();
36951
37046
  let pendingToolStream = null;
36952
37047
  const pendingSageStats = /* @__PURE__ */ new Map();
@@ -37320,7 +37415,7 @@ function useProviderEventBridge({
37320
37415
  }
37321
37416
 
37322
37417
  // src/hooks/use-queue-manager.ts
37323
- import { useEffect as useEffect50, useRef as useRef31 } from "react";
37418
+ import { useEffect as useEffect51, useRef as useRef31 } from "react";
37324
37419
 
37325
37420
  // src/queue-slash.ts
37326
37421
  var USAGE5 = "Usage:\n /queue \u2014 list pending messages\n /queue list \u2014 same as /queue\n /queue clear \u2014 drop all pending messages\n /queue delete N M\u2026 \u2014 drop messages at 1-based positions\n /queue picker on|off \u2014 toggle the mid-run send-mode picker (queue/btw/steer)\n /queue picker \u2014 show whether the picker is on";
@@ -37428,7 +37523,7 @@ function useQueueManager({
37428
37523
  midRunSendPickerRef
37429
37524
  }) {
37430
37525
  const persistState = useRef31({ running: false, pending: null });
37431
- useEffect50(() => {
37526
+ useEffect51(() => {
37432
37527
  if (!queueStore) return;
37433
37528
  let cancelled = false;
37434
37529
  queueStore.read().then((items) => {
@@ -37455,7 +37550,7 @@ function useQueueManager({
37455
37550
  cancelled = true;
37456
37551
  };
37457
37552
  }, [queueStore]);
37458
- useEffect50(() => {
37553
+ useEffect51(() => {
37459
37554
  if (!queueStore) return;
37460
37555
  const raw = stateRef.current.queue.map(
37461
37556
  ({
@@ -37484,10 +37579,10 @@ function useQueueManager({
37484
37579
  }
37485
37580
  })();
37486
37581
  }, [stateRef.current.queue, queueStore, stateRef]);
37487
- useEffect50(() => {
37582
+ useEffect51(() => {
37488
37583
  onQueueChange?.(stateRef.current.queue.map((q) => q.displayText));
37489
37584
  }, [stateRef.current.queue, onQueueChange, stateRef]);
37490
- useEffect50(() => {
37585
+ useEffect51(() => {
37491
37586
  const cmd = createQueueSlashCommand({
37492
37587
  getQueue: () => stateRef.current.queue,
37493
37588
  clear: () => dispatch({ type: "queueClear" }),
@@ -37510,7 +37605,7 @@ function useQueueManager({
37510
37605
  }
37511
37606
 
37512
37607
  // src/hooks/use-session-interrupt-controller.ts
37513
- import { useEffect as useEffect51 } from "react";
37608
+ import { useEffect as useEffect52 } from "react";
37514
37609
  function useSessionInterruptController({
37515
37610
  interruptController,
37516
37611
  dispatch,
@@ -37532,7 +37627,7 @@ function useSessionInterruptController({
37532
37627
  getSddRun,
37533
37628
  switchAutonomy
37534
37629
  }) {
37535
- useEffect51(() => {
37630
+ useEffect52(() => {
37536
37631
  if (!interruptController) return;
37537
37632
  let pendingClearResolve = null;
37538
37633
  let pendingSlashResolve = null;
@@ -37659,15 +37754,15 @@ function useSessionInterruptController({
37659
37754
  }
37660
37755
 
37661
37756
  // src/hooks/use-settings-auto-save.ts
37662
- import { useEffect as useEffect52, useRef as useRef32 } from "react";
37757
+ import { useEffect as useEffect53, useRef as useRef32 } from "react";
37663
37758
  function useSettingsAutoSave(state, saveSettings, dispatch) {
37664
37759
  const settingsAutoSaveGateRef = useRef32(true);
37665
- useEffect52(() => {
37760
+ useEffect53(() => {
37666
37761
  if (state.settingsPicker.open) {
37667
37762
  settingsAutoSaveGateRef.current = true;
37668
37763
  }
37669
37764
  }, [state.settingsPicker.open]);
37670
- useEffect52(() => {
37765
+ useEffect53(() => {
37671
37766
  const sp = state.settingsPicker;
37672
37767
  const save = saveSettings;
37673
37768
  if (!sp.open || !save) return;
@@ -37823,14 +37918,14 @@ function useShadowPanel(dispatch, host) {
37823
37918
  }
37824
37919
 
37825
37920
  // src/hooks/use-slash-picker.ts
37826
- import { useCallback as useCallback20, useEffect as useEffect53 } from "react";
37921
+ import { useCallback as useCallback20, useEffect as useEffect54 } from "react";
37827
37922
  function useSlashPicker({
37828
37923
  state,
37829
37924
  slashRegistry,
37830
37925
  dispatch,
37831
37926
  setDraft
37832
37927
  }) {
37833
- useEffect53(() => {
37928
+ useEffect54(() => {
37834
37929
  const trimmed = state.buffer.trimStart();
37835
37930
  if (!trimmed.startsWith("/") || /\s/.test(trimmed)) {
37836
37931
  if (state.slashPicker.open) dispatch({ type: "slashPickerClose" });
@@ -37868,7 +37963,7 @@ function useStableKeyHandler(handleKey) {
37868
37963
  // src/hooks/use-statusbar-view-model.ts
37869
37964
  import * as fs4 from "node:fs/promises";
37870
37965
  import { getContextBreakdown } from "@wrongstack/core/utils";
37871
- import { useEffect as useEffect54, useMemo as useMemo13, useState as useState33 } from "react";
37966
+ import { useEffect as useEffect55, useMemo as useMemo13, useState as useState33 } from "react";
37872
37967
 
37873
37968
  // src/context-fill.ts
37874
37969
  function resolveContextFill(inputs) {
@@ -38002,7 +38097,7 @@ function useStatusbarViewModel({
38002
38097
  const taskHidden = hiddenItems.includes("tasks");
38003
38098
  const planPath = agent.ctx.meta["plan.path"];
38004
38099
  const [planCounts, setPlanCounts] = useState33(null);
38005
- useEffect54(() => {
38100
+ useEffect55(() => {
38006
38101
  if (planHidden) return;
38007
38102
  if (typeof planPath !== "string" || !planPath) {
38008
38103
  setPlanCounts(null);
@@ -38049,7 +38144,7 @@ function useStatusbarViewModel({
38049
38144
  }, [planPath, planHidden]);
38050
38145
  const taskPath = agent.ctx.meta["task.path"];
38051
38146
  const [taskCounts, setTaskCounts] = useState33(null);
38052
- useEffect54(() => {
38147
+ useEffect55(() => {
38053
38148
  if (taskHidden) return;
38054
38149
  if (typeof taskPath !== "string" || !taskPath) {
38055
38150
  setTaskCounts(null);
@@ -38119,7 +38214,7 @@ function useStatusbarViewModel({
38119
38214
  }
38120
38215
 
38121
38216
  // src/hooks/use-statusline-hidden-sync.ts
38122
- import { useEffect as useEffect55 } from "react";
38217
+ import { useEffect as useEffect56 } from "react";
38123
38218
  function statuslineHiddenDiffers(hookHidden, pickerHidden) {
38124
38219
  const currentHidden = new Set(hookHidden);
38125
38220
  const pickerHiddenSet = new Set(pickerHidden);
@@ -38131,7 +38226,7 @@ function useStatuslineHiddenSync({
38131
38226
  hiddenItems,
38132
38227
  setHiddenItems
38133
38228
  }) {
38134
- useEffect55(() => {
38229
+ useEffect56(() => {
38135
38230
  if (!pickerOpen) return;
38136
38231
  if (statuslineHiddenDiffers(hiddenItems, pickerHidden)) {
38137
38232
  setHiddenItems([...pickerHidden]);
@@ -38140,7 +38235,7 @@ function useStatuslineHiddenSync({
38140
38235
  }
38141
38236
 
38142
38237
  // src/hooks/use-stream-chip-expiration.ts
38143
- import { useEffect as useEffect56, useRef as useRef34 } from "react";
38238
+ import { useEffect as useEffect57, useRef as useRef34 } from "react";
38144
38239
  function computeStreamChipActions(input) {
38145
38240
  const actions = [];
38146
38241
  const visible = new Set(input.visibleChipKeys);
@@ -38167,7 +38262,7 @@ function useStreamChipExpiration({
38167
38262
  }) {
38168
38263
  const prevBrainPromptRef = useRef34(brainPrompt);
38169
38264
  const prevEnhanceRef = useRef34(enhance);
38170
- useEffect56(() => {
38265
+ useEffect57(() => {
38171
38266
  const actions = computeStreamChipActions({
38172
38267
  brainPromptNow: !!brainPrompt,
38173
38268
  brainPromptPrev: !!prevBrainPromptRef.current,
@@ -38179,7 +38274,7 @@ function useStreamChipExpiration({
38179
38274
  prevBrainPromptRef.current = brainPrompt;
38180
38275
  prevEnhanceRef.current = enhance;
38181
38276
  }, [brainPrompt, enhance, visibleChips, dispatch]);
38182
- useEffect56(() => {
38277
+ useEffect57(() => {
38183
38278
  const interval = setInterval(() => {
38184
38279
  const expired = computeExpiredChipKeys(visibleChips, Date.now());
38185
38280
  for (const key of expired) {
@@ -38191,9 +38286,9 @@ function useStreamChipExpiration({
38191
38286
  }
38192
38287
 
38193
38288
  // src/hooks/use-theme-state.ts
38194
- import { useEffect as useEffect57 } from "react";
38289
+ import { useEffect as useEffect58 } from "react";
38195
38290
  function useThemeState({ configStore }) {
38196
- useEffect57(() => {
38291
+ useEffect58(() => {
38197
38292
  if (!configStore) return;
38198
38293
  const initial = configStore.get().themePreset;
38199
38294
  if (initial && initial !== getActiveThemeName()) {
@@ -38215,7 +38310,7 @@ function useThemeState({ configStore }) {
38215
38310
  import * as os from "node:os";
38216
38311
  import { loadGoal } from "@wrongstack/core/storage";
38217
38312
  import { resolveWstackPaths as resolveWstackPaths5 } from "@wrongstack/core/utils";
38218
- import { useCallback as useCallback22, useEffect as useEffect58, useMemo as useMemo14, useRef as useRef35, useState as useState34 } from "react";
38313
+ import { useCallback as useCallback22, useEffect as useEffect59, useMemo as useMemo14, useRef as useRef35, useState as useState34 } from "react";
38219
38314
 
38220
38315
  // src/heap-watchdog.ts
38221
38316
  import {
@@ -38262,7 +38357,7 @@ function useTuiActivity({
38262
38357
  const [rolledThinkingWord, setRolledThinkingWord] = useState34(() => pickRandomTuiThinkingWord());
38263
38358
  const thinkingWorking = status === "running" || status === "streaming";
38264
38359
  const prevThinkingWorkingRef = useRef35(false);
38265
- useEffect58(() => {
38360
+ useEffect59(() => {
38266
38361
  if (thinkingWorking && !prevThinkingWorkingRef.current) {
38267
38362
  setRolledThinkingWord((previous) => pickRandomTuiThinkingWord(previous));
38268
38363
  }
@@ -38275,14 +38370,14 @@ function useTuiActivity({
38275
38370
  );
38276
38371
  const startedAtRef = useRef35(Date.now());
38277
38372
  const [nowTick, setNowTick] = useState34(Date.now());
38278
- useEffect58(() => {
38373
+ useEffect59(() => {
38279
38374
  const timer = setInterval(() => setNowTick(Date.now()), 1e4);
38280
38375
  return () => clearInterval(timer);
38281
38376
  }, []);
38282
38377
  const [workingTimeBase, setWorkingTimeBase] = useState34(0);
38283
38378
  const workingStartRef = useRef35(null);
38284
38379
  const prevStatusRef = useRef35(status);
38285
- useEffect58(() => {
38380
+ useEffect59(() => {
38286
38381
  if (prevStatusRef.current === status) return;
38287
38382
  const wasWorking = prevStatusRef.current === "running" || prevStatusRef.current === "streaming";
38288
38383
  const isWorking = status === "running" || status === "streaming";
@@ -38298,7 +38393,7 @@ function useTuiActivity({
38298
38393
  const [fleetWorkingBase, setFleetWorkingBase] = useState34(0);
38299
38394
  const fleetWorkingStartRef = useRef35(null);
38300
38395
  const prevFleetRunningRef = useRef35(0);
38301
- useEffect58(() => {
38396
+ useEffect59(() => {
38302
38397
  const running = fleetRunningCount;
38303
38398
  if (prevFleetRunningRef.current === running) return;
38304
38399
  const wasRunning = prevFleetRunningRef.current > 0;
@@ -38344,7 +38439,7 @@ function useTuiActivity({
38344
38439
  pushMetricHistory(cpuHistoryRef.current, pct / 100);
38345
38440
  return pct;
38346
38441
  }, [nowTick]);
38347
- useEffect58(() => {
38442
+ useEffect59(() => {
38348
38443
  const stopHeapWatchdog = startSharedHeapWatchdog({
38349
38444
  collectStats: () => {
38350
38445
  const currentState = stateRef.current;
@@ -38425,7 +38520,7 @@ function useTuiActivity({
38425
38520
  }).catch(() => {
38426
38521
  });
38427
38522
  }, [dispatch, projectRoot]);
38428
- useEffect58(() => {
38523
+ useEffect59(() => {
38429
38524
  refreshGoalSummary();
38430
38525
  }, [nowTick, refreshGoalSummary]);
38431
38526
  const enhanceDots = enhanceBusy ? timingFrame % 36 : 0;
@@ -38448,7 +38543,7 @@ function useTuiActivity({
38448
38543
  }
38449
38544
 
38450
38545
  // src/hooks/use-tui-controllers.ts
38451
- import { useEffect as useEffect59 } from "react";
38546
+ import { useEffect as useEffect60 } from "react";
38452
38547
  function useTuiControllers({
38453
38548
  dispatch,
38454
38549
  fleetChat,
@@ -38458,7 +38553,7 @@ function useTuiControllers({
38458
38553
  enhanceController,
38459
38554
  agentsMonitorController
38460
38555
  }) {
38461
- useEffect59(() => {
38556
+ useEffect60(() => {
38462
38557
  if (!fleetStreamController) return;
38463
38558
  fleetStreamController.mode = fleetChat;
38464
38559
  fleetStreamController.setMode = (mode) => {
@@ -38470,12 +38565,12 @@ function useTuiControllers({
38470
38565
  };
38471
38566
  };
38472
38567
  }, [dispatch, fleetStreamController, fleetChat]);
38473
- useEffect59(() => {
38568
+ useEffect60(() => {
38474
38569
  if (fleetStreamController) {
38475
38570
  fleetStreamController.mode = fleetChat;
38476
38571
  }
38477
38572
  }, [fleetStreamController, fleetChat]);
38478
- useEffect59(() => {
38573
+ useEffect60(() => {
38479
38574
  if (!enhanceController) return;
38480
38575
  enhanceController.enabled = enhanceEnabled;
38481
38576
  enhanceController.setEnabled = (enabled) => {
@@ -38487,7 +38582,7 @@ function useTuiControllers({
38487
38582
  };
38488
38583
  };
38489
38584
  }, [dispatch, enhanceController, enhanceEnabled]);
38490
- useEffect59(() => {
38585
+ useEffect60(() => {
38491
38586
  if (!agentsMonitorController) return;
38492
38587
  agentsMonitorController.visible = agentsMonitorOpen;
38493
38588
  agentsMonitorController.setVisible = (visible) => {
@@ -38501,14 +38596,14 @@ function useTuiControllers({
38501
38596
  };
38502
38597
  };
38503
38598
  }, [agentsMonitorController, agentsMonitorOpen, dispatch]);
38504
- useEffect59(() => {
38599
+ useEffect60(() => {
38505
38600
  if (agentsMonitorController) agentsMonitorController.visible = agentsMonitorOpen;
38506
38601
  }, [agentsMonitorController, agentsMonitorOpen]);
38507
38602
  }
38508
38603
 
38509
38604
  // src/hooks/use-tui-environment-state.ts
38510
38605
  import { getIndexState as getIndexState2, getProcessRegistry as getProcessRegistry9, onIndexStateChange } from "@wrongstack/tools";
38511
- import { useEffect as useEffect60, useRef as useRef36, useState as useState36 } from "react";
38606
+ import { useEffect as useEffect61, useRef as useRef36, useState as useState36 } from "react";
38512
38607
 
38513
38608
  // src/hooks/use-statusline-state.ts
38514
38609
  import { useState as useState35 } from "react";
@@ -38566,7 +38661,7 @@ function useTuiEnvironmentState({
38566
38661
  const memoryRecordTotalRef = useRef36(memoryRecordTotal);
38567
38662
  memoryRecordTotalRef.current = memoryRecordTotal;
38568
38663
  const activeMemoryInContext = activeMemoryContextCount(memoryContextMonitor);
38569
- useEffect60(() => {
38664
+ useEffect61(() => {
38570
38665
  let cancelled = false;
38571
38666
  const refreshTotal = async () => {
38572
38667
  try {
@@ -38595,16 +38690,16 @@ function useTuiEnvironmentState({
38595
38690
  const hiddenItemsRef = useRef36(statusline.hiddenItems);
38596
38691
  hiddenItemsRef.current = statusline.hiddenItems;
38597
38692
  const [liveToolCount, setLiveToolCount] = useState36(toolCount);
38598
- useEffect60(() => setLiveToolCount(toolCount), [toolCount]);
38693
+ useEffect61(() => setLiveToolCount(toolCount), [toolCount]);
38599
38694
  const [indexState, setIndexState] = useState36(() => getIndexState2());
38600
- useEffect60(() => {
38695
+ useEffect61(() => {
38601
38696
  setIndexState(getIndexState2());
38602
38697
  return onIndexStateChange(setIndexState);
38603
38698
  }, []);
38604
38699
  const [breakerCountdown, setBreakerCountdown] = useState36(
38605
38700
  () => getProcessRegistry9().getBreakerCountdown()
38606
38701
  );
38607
- useEffect60(() => {
38702
+ useEffect61(() => {
38608
38703
  const settings = getSettings?.();
38609
38704
  if (settings) {
38610
38705
  getProcessRegistry9().setBreakerConfig({
@@ -38615,7 +38710,7 @@ function useTuiEnvironmentState({
38615
38710
  return getProcessRegistry9().onBreakerCountdownChange(setBreakerCountdown);
38616
38711
  }, [getSettings]);
38617
38712
  const breakerArmed = breakerCountdown !== null;
38618
- useEffect60(() => {
38713
+ useEffect61(() => {
38619
38714
  if (!breakerArmed) return;
38620
38715
  const timer = setInterval(
38621
38716
  () => setBreakerCountdown(getProcessRegistry9().getBreakerCountdown()),
@@ -38623,10 +38718,10 @@ function useTuiEnvironmentState({
38623
38718
  );
38624
38719
  return () => clearInterval(timer);
38625
38720
  }, [breakerArmed]);
38626
- useEffect60(() => {
38721
+ useEffect61(() => {
38627
38722
  statusline.setHiddenItems([...statuslineHiddenItems]);
38628
38723
  }, [statuslineHiddenItems, statusline.setHiddenItems]);
38629
- useEffect60(() => {
38724
+ useEffect61(() => {
38630
38725
  setStatuslineHiddenItems(statusline.hiddenItems);
38631
38726
  saveStatuslineHiddenItems(statusline.hiddenItems).catch?.((error) => {
38632
38727
  console.error(
@@ -38656,13 +38751,13 @@ function useTuiEnvironmentState({
38656
38751
  }
38657
38752
 
38658
38753
  // src/hooks/use-tui-event-bridge.ts
38659
- import { useCallback as useCallback24, useEffect as useEffect63 } from "react";
38754
+ import { useCallback as useCallback24, useEffect as useEffect64 } from "react";
38660
38755
 
38661
38756
  // src/hooks/use-brain-events.ts
38662
- import { useEffect as useEffect61 } from "react";
38757
+ import { useEffect as useEffect62 } from "react";
38663
38758
  var MONITOR_INTERVENTION_GRACE_MS = 5e3;
38664
38759
  function useBrainEvents(events, dispatch, getSessionId) {
38665
- useEffect61(() => {
38760
+ useEffect62(() => {
38666
38761
  const isCurrentSession2 = (sessionId) => {
38667
38762
  const current = getSessionId?.();
38668
38763
  return !sessionId || !current || sessionId === current;
@@ -38832,7 +38927,7 @@ function useBrainEvents(events, dispatch, getSessionId) {
38832
38927
 
38833
38928
  // src/hooks/use-subagent-events.ts
38834
38929
  import { expectDefined as expectDefined5 } from "@wrongstack/core/utils";
38835
- import { useCallback as useCallback23, useEffect as useEffect62, useRef as useRef37 } from "react";
38930
+ import { useCallback as useCallback23, useEffect as useEffect63, useRef as useRef37 } from "react";
38836
38931
  var STREAM_COLORS2 = ["cyan", "magenta", "yellow", "green", "blue"];
38837
38932
  function providerContextLimitHistoryEntry(event) {
38838
38933
  if (event.source !== "provider" || event.decreased !== true || typeof event.previousMaxContext !== "number" || event.previousMaxContext <= event.maxContext) {
@@ -38889,7 +38984,7 @@ function useSubagentEvents(events, dispatch, setActiveMaxContext, getSessionId,
38889
38984
  []
38890
38985
  // labelsRef is a stable ref
38891
38986
  );
38892
- useEffect62(() => {
38987
+ useEffect63(() => {
38893
38988
  const seen = /* @__PURE__ */ new Set();
38894
38989
  const isCurrentSession2 = (sessionId) => {
38895
38990
  const current = getSessionId?.();
@@ -39234,7 +39329,7 @@ function useTuiEventBridge({
39234
39329
  useGoalEvents(subscribeGoal, dispatch, stateRef, getSessionId);
39235
39330
  }
39236
39331
  function useSessionEvents(events, dispatch, onClearHistory, getSessionId) {
39237
- useEffect63(() => {
39332
+ useEffect64(() => {
39238
39333
  const isCurrentSession2 = (sessionId) => {
39239
39334
  const current = getSessionId?.();
39240
39335
  return !sessionId || !current || sessionId === current;
@@ -39265,7 +39360,7 @@ function useSessionEvents(events, dispatch, onClearHistory, getSessionId) {
39265
39360
  }, [events, dispatch, onClearHistory, getSessionId]);
39266
39361
  }
39267
39362
  function useGoalEvents(subscribeGoal, dispatch, stateRef, getSessionId) {
39268
- useEffect63(() => {
39363
+ useEffect64(() => {
39269
39364
  if (!subscribeGoal) return;
39270
39365
  const isCurrentSession2 = (sessionId) => {
39271
39366
  const current = getSessionId?.();
@@ -39487,7 +39582,7 @@ import {
39487
39582
  setDesignOverrides
39488
39583
  } from "@wrongstack/core/design";
39489
39584
  import { toErrorMessage as toErrorMessage9 } from "@wrongstack/core/utils";
39490
- import { useEffect as useEffect64 } from "react";
39585
+ import { useEffect as useEffect65 } from "react";
39491
39586
  function useTuiSlashCommands({
39492
39587
  slashRegistry,
39493
39588
  getPickableProviders,
@@ -39508,7 +39603,7 @@ function useTuiSlashCommands({
39508
39603
  switchAutonomy,
39509
39604
  listSessions
39510
39605
  }) {
39511
- useEffect64(() => {
39606
+ useEffect65(() => {
39512
39607
  if (!getPickableProviders || !switchProviderAndModel) return;
39513
39608
  const cmd = {
39514
39609
  name: "model",
@@ -39524,7 +39619,7 @@ function useTuiSlashCommands({
39524
39619
  slashRegistry.unregister("model");
39525
39620
  };
39526
39621
  }, [slashRegistry, getPickableProviders, switchProviderAndModel, openModelPicker]);
39527
- useEffect64(() => {
39622
+ useEffect65(() => {
39528
39623
  const cmd = {
39529
39624
  name: "f",
39530
39625
  description: "Open F-key panel picker. Arrow keys to navigate, Enter to open, Esc to close.",
@@ -39538,7 +39633,7 @@ function useTuiSlashCommands({
39538
39633
  slashRegistry.unregister("f");
39539
39634
  };
39540
39635
  }, [slashRegistry, openFKeyPicker]);
39541
- useEffect64(() => {
39636
+ useEffect65(() => {
39542
39637
  const cmd = {
39543
39638
  name: "design",
39544
39639
  description: "Design Studio: /design (picker) | <kit> [stack] | off | foundations | set <k=v> | tune <k=v> | swap <kit> | materialize [stack] [path] | verify.",
@@ -39670,7 +39765,7 @@ ${menu}` };
39670
39765
  slashRegistry.unregister("design");
39671
39766
  };
39672
39767
  }, [slashRegistry, projectRoot, agent]);
39673
- useEffect64(() => {
39768
+ useEffect65(() => {
39674
39769
  if (!getSettings || !saveSettings) return;
39675
39770
  const cmd = {
39676
39771
  name: "settings",
@@ -39777,7 +39872,7 @@ Available chords:
39777
39872
  slashRegistry.unregister("settings");
39778
39873
  };
39779
39874
  }, [slashRegistry, getSettings, saveSettings, openSettings, dispatch]);
39780
- useEffect64(() => {
39875
+ useEffect65(() => {
39781
39876
  const cmd = {
39782
39877
  name: "settings-get",
39783
39878
  aliases: ["config-get", "get"],
@@ -39809,7 +39904,7 @@ Available chords:
39809
39904
  slashRegistry.unregister("settings-get");
39810
39905
  };
39811
39906
  }, [slashRegistry, state.settingsPicker]);
39812
- useEffect64(() => {
39907
+ useEffect65(() => {
39813
39908
  const cmd = {
39814
39909
  name: "statusline",
39815
39910
  aliases: ["sl"],
@@ -39862,7 +39957,7 @@ Available chords:
39862
39957
  slashRegistry.unregister("statusline");
39863
39958
  };
39864
39959
  }, [slashRegistry, openStatuslinePicker, setHiddenItems]);
39865
- useEffect64(() => {
39960
+ useEffect65(() => {
39866
39961
  const cmd = {
39867
39962
  name: "mailbox",
39868
39963
  aliases: ["inbox", "mail"],
@@ -39877,7 +39972,7 @@ Available chords:
39877
39972
  slashRegistry.unregister("mailbox");
39878
39973
  };
39879
39974
  }, [slashRegistry]);
39880
- useEffect64(() => {
39975
+ useEffect65(() => {
39881
39976
  if (!switchAutonomy) return;
39882
39977
  const cmd = {
39883
39978
  name: "autonomy",
@@ -39893,7 +39988,7 @@ Available chords:
39893
39988
  slashRegistry.unregister("autonomy");
39894
39989
  };
39895
39990
  }, [slashRegistry, switchAutonomy]);
39896
- useEffect64(() => {
39991
+ useEffect65(() => {
39897
39992
  const cmd = {
39898
39993
  name: "theme",
39899
39994
  description: "Pick a TUI color theme preset interactively (picker).",
@@ -39925,7 +40020,7 @@ Available chords:
39925
40020
  slashRegistry.unregister("theme");
39926
40021
  };
39927
40022
  }, [slashRegistry, dispatch]);
39928
- useEffect64(() => {
40023
+ useEffect65(() => {
39929
40024
  const cmd = {
39930
40025
  name: "resume",
39931
40026
  aliases: ["load"],
@@ -39957,7 +40052,7 @@ Available chords:
39957
40052
 
39958
40053
  // src/hooks/use-working-dir-chip.ts
39959
40054
  import * as path6 from "node:path";
39960
- import { useEffect as useEffect65, useState as useState37 } from "react";
40055
+ import { useEffect as useEffect66, useState as useState37 } from "react";
39961
40056
  function formatWorkingDirChip(workingDir, projectRoot) {
39962
40057
  if (!workingDir || workingDir === projectRoot) return void 0;
39963
40058
  const impl = workingDir.includes("\\") || projectRoot.includes("\\") ? path6.win32 : path6;
@@ -39969,7 +40064,7 @@ function useWorkingDirChip(ctx, projectRoot) {
39969
40064
  const [workingDirChip, setWorkingDirChip] = useState37(
39970
40065
  () => formatWorkingDirChip(ctx.workingDir, projectRoot)
39971
40066
  );
39972
- useEffect65(() => {
40067
+ useEffect66(() => {
39973
40068
  setWorkingDirChip(formatWorkingDirChip(ctx.workingDir, projectRoot));
39974
40069
  return ctx.onWorkingDirChanged((newDir) => {
39975
40070
  setWorkingDirChip(formatWorkingDirChip(newDir, projectRoot));
@@ -42383,7 +42478,7 @@ function App(props) {
42383
42478
  liveSettings,
42384
42479
  mailbox.mailboxPanelOpen
42385
42480
  );
42386
- useEffect66(() => {
42481
+ useEffect67(() => {
42387
42482
  titleController?.setModel(liveModel);
42388
42483
  }, [titleController, liveModel]);
42389
42484
  const activity = useTuiActivity({
@@ -42420,7 +42515,7 @@ function App(props) {
42420
42515
  dispatch,
42421
42516
  open: state.authPanel.open
42422
42517
  });
42423
- useEffect66(() => {
42518
+ useEffect67(() => {
42424
42519
  if (!secretInputController) return;
42425
42520
  const previousSecret = secretInputController.readSecret;
42426
42521
  const previousText = secretInputController.readText;
@@ -42517,7 +42612,7 @@ function App(props) {
42517
42612
  dispatch({ type: "clearInput" });
42518
42613
  };
42519
42614
  const staleGuardRef = useRef38(JSON.stringify({ a: "", y: false, m: "", model: "", provider: "" }));
42520
- useEffect66(() => {
42615
+ useEffect67(() => {
42521
42616
  const poll = () => {
42522
42617
  const a = getAutonomy?.() ?? "off";
42523
42618
  const y = getYolo?.() ?? false;