@wrongstack/tui 0.316.1 → 0.317.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
@@ -386,17 +386,24 @@ function mixHexColors(colorA, colorB, weight) {
386
386
  return `#${[r, g, bl].map((c) => c.toString(16).padStart(2, "0")).join("")}`;
387
387
  }
388
388
  function parseHexColor(hex) {
389
- const m = /^#?([0-9a-f]{6})$/i.exec(hex.trim());
389
+ const m = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());
390
390
  if (!m) return null;
391
- const n = Number.parseInt(m[1], 16);
391
+ const raw = m[1];
392
+ if (raw.length === 3) {
393
+ const r = Number.parseInt(raw[0] + raw[0], 16);
394
+ const g = Number.parseInt(raw[1] + raw[1], 16);
395
+ const b = Number.parseInt(raw[2] + raw[2], 16);
396
+ return [r, g, b];
397
+ }
398
+ const n = Number.parseInt(raw, 16);
392
399
  return [n >> 16 & 255, n >> 8 & 255, n & 255];
393
400
  }
394
401
  function detectSupportsBackground(env = process.env, isTTY = process.stdout.isTTY ?? false) {
395
402
  if (!isTTY) return false;
396
- if (typeof env.NO_COLOR === "string" && env.NO_COLOR !== "") return false;
397
- const colorterm = env.COLORTERM ?? "";
403
+ if (typeof env["NO_COLOR"] === "string" && env["NO_COLOR"] !== "") return false;
404
+ const colorterm = env["COLORTERM"] ?? "";
398
405
  if (/^(truecolor|24bit)$/i.test(colorterm)) return true;
399
- const term = env.TERM ?? "";
406
+ const term = env["TERM"] ?? "";
400
407
  if (/truecolor|24bit/i.test(term)) return true;
401
408
  if (/256(color)?/i.test(term)) return true;
402
409
  if (colorterm !== "" && colorterm !== "false") return true;
@@ -5556,6 +5563,9 @@ function renderProgressBar(progress, trend, width = 20) {
5556
5563
  ] });
5557
5564
  }
5558
5565
 
5566
+ // src/components/help-overlay.tsx
5567
+ import { useState as useState7 } from "react";
5568
+
5559
5569
  // src/f-key-panels.ts
5560
5570
  var F_KEY_PANEL_ENTRIES = [
5561
5571
  {
@@ -5692,7 +5702,7 @@ function actionForFKeyPanel(entry, hiddenItems = []) {
5692
5702
  }
5693
5703
 
5694
5704
  // src/components/help-overlay.tsx
5695
- import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
5705
+ import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
5696
5706
  function helpSections() {
5697
5707
  const nav = [];
5698
5708
  nav.push(
@@ -5878,66 +5888,84 @@ function splitIntoColumns(entries) {
5878
5888
  }
5879
5889
  return [left, right];
5880
5890
  }
5891
+ function buildHelpRows(sections) {
5892
+ const rows = [];
5893
+ for (const sec of sections) {
5894
+ rows.push({ kind: "section", title: sec.title });
5895
+ if (sec.title === "Tool Colors") {
5896
+ const [leftCol, rightCol] = splitIntoColumns(sec.entries);
5897
+ for (let i = 0; i < leftCol.length; i++) {
5898
+ const left = leftCol[i];
5899
+ if (!left) continue;
5900
+ rows.push({ kind: "pair", left, right: rightCol[i] });
5901
+ }
5902
+ } else {
5903
+ for (const entry of sec.entries) {
5904
+ rows.push({ kind: "entry", keys: entry.keys, desc: entry.desc });
5905
+ }
5906
+ }
5907
+ }
5908
+ return rows;
5909
+ }
5881
5910
  function HelpOverlay() {
5882
- const sections = helpSections();
5883
- const otherSections = sections.filter((s2) => s2.title !== "Tool Colors");
5911
+ const rows = buildHelpRows(helpSections());
5912
+ const size = useMonitorSize();
5913
+ const [cursor, setCursor] = useState7(0);
5914
+ const limit = Math.max(3, size.contentRows - 3);
5915
+ const lastRow = Math.max(0, rows.length - 1);
5916
+ const page = Math.max(1, limit - 1);
5917
+ useInput((_input, key) => {
5918
+ if (key.upArrow) setCursor((c) => Math.max(0, c - 1));
5919
+ else if (key.downArrow) setCursor((c) => Math.min(lastRow, c + 1));
5920
+ else if (key.pageUp) setCursor((c) => Math.max(0, c - page));
5921
+ else if (key.pageDown) setCursor((c) => Math.min(lastRow, c + page));
5922
+ });
5923
+ const win = panelWindow(rows.length, cursor, limit);
5924
+ const visible = rows.slice(win.start, win.end);
5884
5925
  const otherKeyWidth = Math.max(
5885
- ...otherSections.flatMap((s2) => s2.entries.map((e) => e.keys.length)),
5926
+ ...rows.filter((r) => r.kind === "entry").map((r) => r.keys.length),
5927
+ 0
5928
+ );
5929
+ const otherKeyCol = otherKeyWidth + 2;
5930
+ const descWidth = Math.max(0, size.contentWidth - otherKeyCol);
5931
+ const toolKeyWidth = Math.max(
5932
+ ...rows.filter((r) => r.kind === "pair").flatMap((r) => [r.left.keys.length, r.right?.keys.length ?? 0]),
5886
5933
  0
5887
5934
  );
5888
- const toolSection = sections.find((s2) => s2.title === "Tool Colors");
5889
- const toolKeyWidth = toolSection ? Math.max(...toolSection.entries.map((e) => e.keys.length), 0) : 0;
5935
+ const toolKeyCol = toolKeyWidth + 2;
5936
+ const toolDescWidth = Math.max(
5937
+ 0,
5938
+ Math.floor((size.contentWidth - 2 * toolKeyCol - 2) / 2)
5939
+ );
5890
5940
  return /* @__PURE__ */ jsxs10(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
5891
5941
  /* @__PURE__ */ jsxs10(Box, { flexDirection: "row", gap: 1, children: [
5892
5942
  /* @__PURE__ */ jsx11(Text, { bold: true, color: theme.accent, children: "Keyboard shortcuts" }),
5893
- /* @__PURE__ */ jsx11(Text, { dimColor: true, children: "\xB7 Esc to close" })
5943
+ /* @__PURE__ */ jsx11(Text, { dimColor: true, children: "\xB7 \u2191/\u2193 scroll \xB7 PgUp/PgDn page \xB7 Esc to close" })
5894
5944
  ] }),
5895
- sections.map((sec) => {
5896
- if (sec.title === "Tool Colors") {
5897
- const [leftCol, rightCol] = splitIntoColumns(sec.entries);
5898
- return /* @__PURE__ */ jsxs10(Box, { flexDirection: "column", marginTop: 1, children: [
5899
- /* @__PURE__ */ jsx11(Text, { bold: true, color: theme.brand, children: sec.title }),
5900
- /* @__PURE__ */ jsxs10(Box, { flexDirection: "row", gap: 2, children: [
5901
- /* @__PURE__ */ jsx11(Box, { flexDirection: "column", children: leftCol.map((e, i) => /* @__PURE__ */ jsxs10(
5902
- Box,
5903
- {
5904
- flexDirection: "row",
5905
- children: [
5906
- /* @__PURE__ */ jsx11(Text, { color: theme.accent, children: e.keys.padEnd(toolKeyWidth + 2) }),
5907
- /* @__PURE__ */ jsx11(Text, { dimColor: true, children: e.desc })
5908
- ]
5909
- },
5910
- i
5911
- )) }),
5912
- /* @__PURE__ */ jsx11(Box, { flexDirection: "column", children: rightCol.map((e, i) => /* @__PURE__ */ jsxs10(
5913
- Box,
5914
- {
5915
- flexDirection: "row",
5916
- children: [
5917
- /* @__PURE__ */ jsx11(Text, { color: theme.accent, children: e.keys.padEnd(toolKeyWidth + 2) }),
5918
- /* @__PURE__ */ jsx11(Text, { dimColor: true, children: e.desc })
5919
- ]
5920
- },
5921
- i
5922
- )) })
5923
- ] })
5924
- ] }, sec.title);
5925
- }
5926
- return /* @__PURE__ */ jsxs10(Box, { flexDirection: "column", marginTop: 1, children: [
5927
- /* @__PURE__ */ jsx11(Text, { bold: true, color: theme.brand, children: sec.title }),
5928
- sec.entries.map((e, i) => /* @__PURE__ */ jsxs10(
5929
- Box,
5930
- {
5931
- flexDirection: "row",
5932
- children: [
5933
- /* @__PURE__ */ jsx11(Text, { color: theme.accent, children: e.keys.padEnd(otherKeyWidth + 2) }),
5934
- /* @__PURE__ */ jsx11(Text, { dimColor: true, children: e.desc })
5935
- ]
5936
- },
5937
- i
5938
- ))
5939
- ] }, sec.title);
5940
- })
5945
+ win.above > 0 ? /* @__PURE__ */ jsx11(Text, { dimColor: true, children: ` \u2191 ${win.above} more` }) : null,
5946
+ visible.map((row, i) => {
5947
+ if (row.kind === "section") {
5948
+ return /* @__PURE__ */ jsx11(Text, { bold: true, color: theme.brand, children: row.title }, `section-${row.title}`);
5949
+ }
5950
+ if (row.kind === "entry") {
5951
+ return /* @__PURE__ */ jsxs10(Text, { children: [
5952
+ /* @__PURE__ */ jsx11(Text, { color: theme.accent, children: row.keys.padEnd(otherKeyCol) }),
5953
+ /* @__PURE__ */ jsx11(Text, { dimColor: true, children: truncatePanelText(row.desc, descWidth) })
5954
+ ] }, `entry-${win.start + i}`);
5955
+ }
5956
+ const leftDesc = truncatePanelText(row.left.desc, toolDescWidth).padEnd(
5957
+ toolDescWidth + 2
5958
+ );
5959
+ return /* @__PURE__ */ jsxs10(Text, { children: [
5960
+ /* @__PURE__ */ jsx11(Text, { color: theme.accent, children: row.left.keys.padEnd(toolKeyCol) }),
5961
+ /* @__PURE__ */ jsx11(Text, { dimColor: true, children: leftDesc }),
5962
+ row.right ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
5963
+ /* @__PURE__ */ jsx11(Text, { color: theme.accent, children: row.right.keys.padEnd(toolKeyCol) }),
5964
+ /* @__PURE__ */ jsx11(Text, { dimColor: true, children: truncatePanelText(row.right.desc, toolDescWidth) })
5965
+ ] }) : null
5966
+ ] }, `pair-${win.start + i}`);
5967
+ }),
5968
+ win.below > 0 ? /* @__PURE__ */ jsx11(Text, { dimColor: true, children: ` \u2193 ${win.below} more` }) : null
5941
5969
  ] });
5942
5970
  }
5943
5971
 
@@ -5957,7 +5985,7 @@ import {
5957
5985
  updateTask
5958
5986
  } from "@wrongstack/kanban";
5959
5987
  import { applySessionKanbanTaskToSource } from "@wrongstack/tools/session-kanban";
5960
- import { useEffect as useEffect6, useMemo as useMemo3, useState as useState7 } from "react";
5988
+ import { useEffect as useEffect6, useMemo as useMemo3, useState as useState8 } from "react";
5961
5989
 
5962
5990
  // src/kanban-audit.ts
5963
5991
  var DEFAULT_REVIEW_STALE_AFTER_MS = 72 * 60 * 60 * 1e3;
@@ -6287,7 +6315,7 @@ function severityRank(severity) {
6287
6315
  }
6288
6316
 
6289
6317
  // src/components/kanban-panel.tsx
6290
- import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
6318
+ import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
6291
6319
  function KanbanPanel({
6292
6320
  projectRoot,
6293
6321
  sessionId,
@@ -6297,14 +6325,14 @@ function KanbanPanel({
6297
6325
  initialBoardId
6298
6326
  }) {
6299
6327
  const eventContext = { sessionId, actor: "tui-operator" };
6300
- const [boards, setBoards] = useState7([]);
6301
- const [selectedBoard, setSelectedBoard] = useState7(0);
6302
- const [selectedTask, setSelectedTask] = useState7(0);
6303
- const [board, setBoard] = useState7(null);
6304
- const [loading, setLoading] = useState7(true);
6305
- const [error, setError] = useState7(null);
6306
- const [notice, setNotice] = useState7(null);
6307
- const [prompt, setPrompt] = useState7(null);
6328
+ const [boards, setBoards] = useState8([]);
6329
+ const [selectedBoard, setSelectedBoard] = useState8(0);
6330
+ const [selectedTask, setSelectedTask] = useState8(0);
6331
+ const [board, setBoard] = useState8(null);
6332
+ const [loading, setLoading] = useState8(true);
6333
+ const [error, setError] = useState8(null);
6334
+ const [notice, setNotice] = useState8(null);
6335
+ const [prompt, setPrompt] = useState8(null);
6308
6336
  const sortedColumns = useMemo3(
6309
6337
  () => [...board?.columns ?? []].sort((a, b) => a.order - b.order),
6310
6338
  [board]
@@ -6635,7 +6663,7 @@ function KanbanPanel({
6635
6663
  " board",
6636
6664
  boards.length === 1 ? "" : "s"
6637
6665
  ] }),
6638
- board ? /* @__PURE__ */ jsxs11(Fragment4, { children: [
6666
+ board ? /* @__PURE__ */ jsxs11(Fragment5, { children: [
6639
6667
  /* @__PURE__ */ jsx12(Text, { dimColor: true, children: "|" }),
6640
6668
  /* @__PURE__ */ jsx12(Text, { children: board.title })
6641
6669
  ] }) : null,
@@ -6855,7 +6883,7 @@ function TaskDetail({
6855
6883
  }) {
6856
6884
  return /* @__PURE__ */ jsxs11(Box, { flexDirection: "column", width: 34, borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
6857
6885
  /* @__PURE__ */ jsx12(Text, { bold: true, color: "cyan", children: "Task" }),
6858
- !task ? /* @__PURE__ */ jsx12(Text, { dimColor: true, children: "No task selected." }) : /* @__PURE__ */ jsxs11(Fragment4, { children: [
6886
+ !task ? /* @__PURE__ */ jsx12(Text, { dimColor: true, children: "No task selected." }) : /* @__PURE__ */ jsxs11(Fragment5, { children: [
6859
6887
  /* @__PURE__ */ jsx12(Text, { wrap: "truncate", children: task.title }),
6860
6888
  /* @__PURE__ */ jsxs11(Text, { dimColor: true, children: [
6861
6889
  "ID ",
@@ -7079,7 +7107,7 @@ function BoardSummary({
7079
7107
  "scope ",
7080
7108
  describeKanbanBoundary(board.boundary)
7081
7109
  ] }),
7082
- target ? /* @__PURE__ */ jsxs11(Fragment4, { children: [
7110
+ target ? /* @__PURE__ */ jsxs11(Fragment5, { children: [
7083
7111
  /* @__PURE__ */ jsx12(Text, { dimColor: true, children: "|" }),
7084
7112
  /* @__PURE__ */ jsxs11(Text, { dimColor: true, children: [
7085
7113
  "next board: ",
@@ -7124,7 +7152,7 @@ function clamp(value, min, max) {
7124
7152
  }
7125
7153
 
7126
7154
  // src/components/key-hint-bar.tsx
7127
- import { useEffect as useEffect7, useState as useState8 } from "react";
7155
+ import { useEffect as useEffect7, useState as useState9 } from "react";
7128
7156
  import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
7129
7157
  var IDLE_MESSAGES = [
7130
7158
  { key: "", label: "github.com/wrongstack/wrongstack" },
@@ -7180,7 +7208,7 @@ function hintsFor(ctx) {
7180
7208
  function KeyHintBar({ context }) {
7181
7209
  const hints = hintsFor(context);
7182
7210
  const idle = isIdleContext(context);
7183
- const [idleIndex, setIdleIndex] = useState8(0);
7211
+ const [idleIndex, setIdleIndex] = useState9(0);
7184
7212
  useEffect7(() => {
7185
7213
  if (!idle) return;
7186
7214
  const id = setInterval(() => {
@@ -7288,7 +7316,7 @@ function MailboxPanel({
7288
7316
  }
7289
7317
 
7290
7318
  // src/components/phase-monitor.tsx
7291
- import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
7319
+ import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
7292
7320
  var fmtElapsed2 = (ms) => {
7293
7321
  const s2 = Math.floor(ms / 1e3);
7294
7322
  const m = Math.floor(s2 / 60);
@@ -7339,7 +7367,7 @@ function PhaseMonitor({
7339
7367
  "\u2713",
7340
7368
  done.length
7341
7369
  ] }),
7342
- failed.length > 0 ? /* @__PURE__ */ jsxs14(Fragment5, { children: [
7370
+ failed.length > 0 ? /* @__PURE__ */ jsxs14(Fragment6, { children: [
7343
7371
  /* @__PURE__ */ jsx15(Text, { dimColor: true, children: "\xB7" }),
7344
7372
  /* @__PURE__ */ jsxs14(Text, { color: "red", children: [
7345
7373
  "\u2717",
@@ -7360,14 +7388,14 @@ function PhaseMonitor({
7360
7388
  /* @__PURE__ */ jsx15(Text, { bold: true, children: phase.name }),
7361
7389
  /* @__PURE__ */ jsx15(Text, { dimColor: true, children: "\xB7" }),
7362
7390
  /* @__PURE__ */ jsx15(Text, { color: s2.color, children: s2.label }),
7363
- isRunning ? /* @__PURE__ */ jsxs14(Fragment5, { children: [
7391
+ isRunning ? /* @__PURE__ */ jsxs14(Fragment6, { children: [
7364
7392
  /* @__PURE__ */ jsx15(Text, { dimColor: true, children: "\xB7" }),
7365
7393
  /* @__PURE__ */ jsxs14(Text, { dimColor: true, children: [
7366
7394
  "elapsed ",
7367
7395
  elapsed
7368
7396
  ] })
7369
7397
  ] }) : null,
7370
- phase.totalTasks > 0 && /* @__PURE__ */ jsxs14(Fragment5, { children: [
7398
+ phase.totalTasks > 0 && /* @__PURE__ */ jsxs14(Fragment6, { children: [
7371
7399
  /* @__PURE__ */ jsx15(Text, { dimColor: true, children: "\xB7" }),
7372
7400
  /* @__PURE__ */ jsxs14(Text, { dimColor: true, children: [
7373
7401
  "tasks ",
@@ -7584,14 +7612,14 @@ function PhasePanel({ phases, nowTick }) {
7584
7612
  import * as fs from "node:fs/promises";
7585
7613
  import * as path from "node:path";
7586
7614
  import { resolveWstackPaths, sessionScopedPath } from "@wrongstack/core/utils";
7587
- import { useCallback as useCallback2, useEffect as useEffect11, useMemo as useMemo5, useState as useState12 } from "react";
7615
+ import { useCallback as useCallback2, useEffect as useEffect11, useMemo as useMemo5, useState as useState13 } from "react";
7588
7616
 
7589
7617
  // src/components/status-bar.tsx
7590
7618
  import { expectDefined } from "@wrongstack/core/utils";
7591
7619
  import { useMemo as useMemo4 } from "react";
7592
7620
 
7593
7621
  // src/hooks/use-chip-staleness-guard.ts
7594
- import { useCallback, useEffect as useEffect8, useRef, useState as useState9 } from "react";
7622
+ import { useCallback, useEffect as useEffect8, useRef, useState as useState10 } from "react";
7595
7623
  var DEFAULT_STALENESS_THRESHOLD_MS = 15e3;
7596
7624
  var DEFAULT_CHECK_INTERVAL_MS = 1e4;
7597
7625
  var DEFAULT_MAX_RECOVERIES = 5;
@@ -7608,10 +7636,10 @@ function useChipStalenessGuard(opts) {
7608
7636
  checkIntervalMs = DEFAULT_CHECK_INTERVAL_MS,
7609
7637
  maxRecoveries = DEFAULT_MAX_RECOVERIES
7610
7638
  } = opts;
7611
- const [renderNonce, setRenderNonce] = useState9(0);
7612
- const [diagnoses, setDiagnoses] = useState9([]);
7639
+ const [renderNonce, setRenderNonce] = useState10(0);
7640
+ const [diagnoses, setDiagnoses] = useState10([]);
7613
7641
  const recoveryCountRef = useRef(0);
7614
- const [recoveryCount, setRecoveryCount] = useState9(0);
7642
+ const [recoveryCount, setRecoveryCount] = useState10(0);
7615
7643
  const lastSpinnerPhaseRef = useRef(spinnerPhase);
7616
7644
  const lastSpinnerChangeAtRef = useRef(Date.now());
7617
7645
  const lastTokenFingerprintRef = useRef(tokenFingerprint);
@@ -7694,10 +7722,10 @@ function computeTokenFingerprint(input, output, cost) {
7694
7722
  }
7695
7723
 
7696
7724
  // src/hooks/use-todos-auto-clear.ts
7697
- import { useEffect as useEffect9, useRef as useRef2, useState as useState10 } from "react";
7725
+ import { useEffect as useEffect9, useRef as useRef2, useState as useState11 } from "react";
7698
7726
  var TODOS_CLEAR_DELAY_MS = 3e3;
7699
7727
  function useTodosAutoClear(todos) {
7700
- const [todosCleared, setTodosCleared] = useState10(false);
7728
+ const [todosCleared, setTodosCleared] = useState11(false);
7701
7729
  const todosClearTimerRef = useRef2(null);
7702
7730
  useEffect9(() => {
7703
7731
  const hasActive = todos && (todos.pending > 0 || todos.inProgress > 0);
@@ -7730,7 +7758,7 @@ function useTodosAutoClear(todos) {
7730
7758
  }
7731
7759
 
7732
7760
  // src/hooks/use-token-counter-refresh.ts
7733
- import { useEffect as useEffect10, useState as useState11 } from "react";
7761
+ import { useEffect as useEffect10, useState as useState12 } from "react";
7734
7762
  function snapshotTokenCounter(tokenCounter) {
7735
7763
  return {
7736
7764
  usage: tokenCounter.total(),
@@ -7740,7 +7768,7 @@ function snapshotTokenCounter(tokenCounter) {
7740
7768
  };
7741
7769
  }
7742
7770
  function useTokenCounterRefresh(tokenCounter, events, sessionId) {
7743
- const [data, setData] = useState11(
7771
+ const [data, setData] = useState12(
7744
7772
  () => tokenCounter ? snapshotTokenCounter(tokenCounter) : void 0
7745
7773
  );
7746
7774
  useEffect10(() => {
@@ -7970,7 +7998,7 @@ function PowerlineRail({
7970
7998
  }
7971
7999
 
7972
8000
  // src/components/status-bar-chips.tsx
7973
- import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
8001
+ import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
7974
8002
  function BrainChip({
7975
8003
  brain,
7976
8004
  monochrome
@@ -7998,7 +8026,7 @@ function EternalStageChip({
7998
8026
  return /* @__PURE__ */ jsx18(Text, { color: color(theme.accent), children: monochrome ? `decide: ${stage.reason}` : `\u25C7 decide: ${stage.reason}` });
7999
8027
  case "execute":
8000
8028
  return /* @__PURE__ */ jsxs17(Text, { color: color(theme.success), children: [
8001
- monochrome ? null : /* @__PURE__ */ jsxs17(Fragment6, { children: [
8029
+ monochrome ? null : /* @__PURE__ */ jsxs17(Fragment7, { children: [
8002
8030
  icon("\u25B6"),
8003
8031
  " "
8004
8032
  ] }),
@@ -8380,7 +8408,7 @@ function numberValue(value) {
8380
8408
  }
8381
8409
 
8382
8410
  // src/components/status-bar-rails.tsx
8383
- import { Fragment as Fragment7, jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
8411
+ import { Fragment as Fragment8, jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
8384
8412
  function buildPrimaryChips(p) {
8385
8413
  const {
8386
8414
  context,
@@ -8842,7 +8870,7 @@ function buildWorkRowEntries(p) {
8842
8870
  },
8843
8871
  {
8844
8872
  id: "next_steps",
8845
- node: hasNextStepsAutoSubmit && nextStepsAutoSubmitCountdown != null && showChip("next_steps") ? /* @__PURE__ */ jsxs18(Fragment7, { children: [
8873
+ node: hasNextStepsAutoSubmit && nextStepsAutoSubmitCountdown != null && showChip("next_steps") ? /* @__PURE__ */ jsxs18(Fragment8, { children: [
8846
8874
  /* @__PURE__ */ jsx19(Text, { color: isNoColor ? void 0 : nextStepsColor, bold: true, children: isNoColor ? `${nextStepsAutoSubmitCountdown}s` : `${STATUSLINE_ICONS.next_steps} ${nextStepsAutoSubmitCountdown}s` }),
8847
8875
  /* @__PURE__ */ jsxs18(Text, { dimColor: !isNoColor, children: [
8848
8876
  " ",
@@ -8971,7 +8999,7 @@ function buildMemoryDetailChips(memoryContextMonitor, Sage, isNoColor) {
8971
8999
  /* @__PURE__ */ jsxs18(Text, { children: [
8972
9000
  Sage.total,
8973
9001
  " total",
8974
- reportedActive > 0 ? /* @__PURE__ */ jsxs18(Fragment7, { children: [
9002
+ reportedActive > 0 ? /* @__PURE__ */ jsxs18(Fragment8, { children: [
8975
9003
  /* @__PURE__ */ jsx19(Text, { dimColor: !isNoColor, children: " \xB7 " }),
8976
9004
  /* @__PURE__ */ jsxs18(Text, { color: chipColor(theme.success, isNoColor), children: [
8977
9005
  reportedActive,
@@ -9034,7 +9062,7 @@ import {
9034
9062
  DEFAULT_LINES,
9035
9063
  STATUSLINE_ITEMS
9036
9064
  } from "@wrongstack/core/statusline";
9037
- import { Fragment as Fragment8, jsxs as jsxs19 } from "react/jsx-runtime";
9065
+ import { Fragment as Fragment9, jsxs as jsxs19 } from "react/jsx-runtime";
9038
9066
  function canonicalChipKey(entryId) {
9039
9067
  if (entryId === "primary-0") return "context";
9040
9068
  if (entryId.startsWith("detail-")) return "mailbox";
@@ -9061,7 +9089,7 @@ function placeAnchors(rails, anchors, lines) {
9061
9089
  if (!anchor.node) continue;
9062
9090
  const line = assignedLine(anchor.key, DEFAULT_LINES[anchor.key], lines);
9063
9091
  const rail = rails[line - 1];
9064
- rail.rightAnchor = rail.rightAnchor ? /* @__PURE__ */ jsxs19(Fragment8, { children: [
9092
+ rail.rightAnchor = rail.rightAnchor ? /* @__PURE__ */ jsxs19(Fragment9, { children: [
9065
9093
  rail.rightAnchor,
9066
9094
  " ",
9067
9095
  anchor.node
@@ -9398,12 +9426,12 @@ function planFilePath(projectRoot, sessionId, scope) {
9398
9426
  return path.join(base, "backlog.plan.json");
9399
9427
  }
9400
9428
  function usePlanPanelData(projectRoot, sessionId, enabled = true) {
9401
- const [items, setItems] = useState12([]);
9402
- const [title, setTitle2] = useState12(void 0);
9403
- const [scope, setScope] = useState12("session");
9404
- const [loading, setLoading] = useState12(true);
9405
- const [error, setError] = useState12(null);
9406
- const [updatedAt, setUpdatedAt] = useState12(void 0);
9429
+ const [items, setItems] = useState13([]);
9430
+ const [title, setTitle2] = useState13(void 0);
9431
+ const [scope, setScope] = useState13("session");
9432
+ const [loading, setLoading] = useState13(true);
9433
+ const [error, setError] = useState13(null);
9434
+ const [updatedAt, setUpdatedAt] = useState13(void 0);
9407
9435
  const load = useCallback2(
9408
9436
  async (scope_, quiet = false) => {
9409
9437
  if (!quiet) setLoading(true);
@@ -9453,7 +9481,7 @@ function PlanPanel({
9453
9481
  projectRoot,
9454
9482
  sessionId
9455
9483
  );
9456
- const [selected, setSelected] = useState12(0);
9484
+ const [selected, setSelected] = useState13(0);
9457
9485
  async function handleScopeSwitch(newScope) {
9458
9486
  await load(newScope);
9459
9487
  }
@@ -9600,14 +9628,14 @@ function PlanRow({
9600
9628
  }
9601
9629
 
9602
9630
  // src/components/process-list.tsx
9603
- import { useEffect as useEffect12, useState as useState13 } from "react";
9631
+ import { useEffect as useEffect12, useState as useState14 } from "react";
9604
9632
  import { getProcessRegistry } from "@wrongstack/tools";
9605
9633
  import { jsx as jsx22, jsxs as jsxs22 } from "react/jsx-runtime";
9606
9634
  function ProcessListMonitor() {
9607
9635
  const size = useMonitorSize();
9608
- const [, setTick] = useState13(0);
9609
- const [selectedIndex, setSelectedIndex] = useState13(0);
9610
- const [pendingAction, setPendingAction] = useState13(null);
9636
+ const [, setTick] = useState14(0);
9637
+ const [selectedIndex, setSelectedIndex] = useState14(0);
9638
+ const [pendingAction, setPendingAction] = useState14(null);
9611
9639
  useEffect12(() => {
9612
9640
  const id = setInterval(() => setTick((t) => t + 1), 1e3);
9613
9641
  return () => clearInterval(id);
@@ -9773,7 +9801,7 @@ function ProcessListMonitor() {
9773
9801
  }
9774
9802
 
9775
9803
  // src/components/queue-panel.tsx
9776
- import { useCallback as useCallback3, useEffect as useEffect13, useState as useState14 } from "react";
9804
+ import { useCallback as useCallback3, useEffect as useEffect13, useState as useState15 } from "react";
9777
9805
  import { jsx as jsx23, jsxs as jsxs23 } from "react/jsx-runtime";
9778
9806
  function QueuePanel({
9779
9807
  items,
@@ -9783,8 +9811,8 @@ function QueuePanel({
9783
9811
  onToggleRefine
9784
9812
  }) {
9785
9813
  const size = useMonitorSize();
9786
- const [selected, setSelected] = useState14(0);
9787
- const [confirmClear, setConfirmClear] = useState14(false);
9814
+ const [selected, setSelected] = useState15(0);
9815
+ const [confirmClear, setConfirmClear] = useState15(false);
9788
9816
  const maxVisible = Math.max(3, size.contentRows - 2);
9789
9817
  const window = panelWindow(items.length, selected, maxVisible);
9790
9818
  const visible = items.slice(window.start, window.end);
@@ -10056,7 +10084,7 @@ function SddBoardOverlay({
10056
10084
  }
10057
10085
 
10058
10086
  // src/components/sessions-panel.tsx
10059
- import { Fragment as Fragment9, jsx as jsx25, jsxs as jsxs25 } from "react/jsx-runtime";
10087
+ import { Fragment as Fragment10, jsx as jsx25, jsxs as jsxs25 } from "react/jsx-runtime";
10060
10088
  function statusIcon2(status) {
10061
10089
  switch (status) {
10062
10090
  case "active":
@@ -10225,7 +10253,7 @@ function SessionsPanel({
10225
10253
  " agents"
10226
10254
  ] })
10227
10255
  ] }),
10228
- isSelected ? /* @__PURE__ */ jsxs25(Fragment9, { children: [
10256
+ isSelected ? /* @__PURE__ */ jsxs25(Fragment10, { children: [
10229
10257
  /* @__PURE__ */ jsxs25(Text, { color: theme.textMuted, children: [
10230
10258
  " ",
10231
10259
  truncatePanelText(s2.workingDir, size.contentWidth - 4),
@@ -10276,11 +10304,11 @@ function SessionsPanel({
10276
10304
  }
10277
10305
 
10278
10306
  // src/components/todos-monitor.tsx
10279
- import { useEffect as useEffect14, useState as useState15 } from "react";
10307
+ import { useEffect as useEffect14, useState as useState16 } from "react";
10280
10308
  import { jsx as jsx26, jsxs as jsxs26 } from "react/jsx-runtime";
10281
10309
  function TodosMonitor({ todos }) {
10282
10310
  const size = useMonitorSize();
10283
- const [selected, setSelected] = useState15(0);
10311
+ const [selected, setSelected] = useState16(0);
10284
10312
  const done = todos.filter((t) => t.status === "completed").length;
10285
10313
  const inProgress = todos.filter((t) => t.status === "in_progress").length;
10286
10314
  const pending = todos.filter((t) => t.status === "pending").length;
@@ -10410,7 +10438,7 @@ function TodosMonitor({ todos }) {
10410
10438
  }
10411
10439
 
10412
10440
  // src/components/worktree-monitor.tsx
10413
- import { useEffect as useEffect15, useState as useState16 } from "react";
10441
+ import { useEffect as useEffect15, useState as useState17 } from "react";
10414
10442
  import { jsx as jsx27, jsxs as jsxs27 } from "react/jsx-runtime";
10415
10443
  var fmtElapsed4 = (ms) => {
10416
10444
  const s2 = Math.floor(ms / 1e3);
@@ -10442,7 +10470,7 @@ function WorktreeMonitor({
10442
10470
  onClose
10443
10471
  }) {
10444
10472
  const size = useMonitorSize();
10445
- const [selected, setSelected] = useState16(0);
10473
+ const [selected, setSelected] = useState17(0);
10446
10474
  const shortcutsEnabled = usePanelShortcutsEnabled();
10447
10475
  useInput((input, key) => {
10448
10476
  if (key.escape === true || shortcutsEnabled && isWorktreeMonitorCloseKey(input, key))
@@ -10695,7 +10723,7 @@ function renderRunningTools(running) {
10695
10723
  }
10696
10724
 
10697
10725
  // src/app-status-region.tsx
10698
- import { Fragment as Fragment10, jsx as jsx29, jsxs as jsxs29 } from "react/jsx-runtime";
10726
+ import { Fragment as Fragment11, jsx as jsx29, jsxs as jsxs29 } from "react/jsx-runtime";
10699
10727
  function AppStatusRegion({
10700
10728
  host,
10701
10729
  runtime,
@@ -10781,7 +10809,7 @@ function AppStatusRegion({
10781
10809
  const projectRoot = agent.ctx.projectRoot;
10782
10810
  const panelPositions = effectivePanelPositions(state, liveSettings);
10783
10811
  const routedToBottom = (id) => panelPositions[id] === "bottom";
10784
- return /* @__PURE__ */ jsxs29(Fragment10, { children: [
10812
+ return /* @__PURE__ */ jsxs29(Fragment11, { children: [
10785
10813
  /* @__PURE__ */ jsx29(Box, { ref: statusBarWrapRef, flexDirection: "column", flexShrink: 0, children: /* @__PURE__ */ jsx29(
10786
10814
  StatusBar,
10787
10815
  {
@@ -11943,7 +11971,7 @@ function cyclePreset(presets, current, delta) {
11943
11971
  }
11944
11972
 
11945
11973
  // src/components/brain-panel.tsx
11946
- import { Fragment as Fragment11, jsx as jsx34, jsxs as jsxs34 } from "react/jsx-runtime";
11974
+ import { Fragment as Fragment12, jsx as jsx34, jsxs as jsxs34 } from "react/jsx-runtime";
11947
11975
  var CHROME_ROWS2 = 14;
11948
11976
  var RISK_DESCS = {
11949
11977
  off: "Human decides everything",
@@ -12274,7 +12302,7 @@ function BrainPanel({
12274
12302
  ] }),
12275
12303
  /* @__PURE__ */ jsxs34(Box, { marginTop: 1, flexDirection: "column", children: [
12276
12304
  /* @__PURE__ */ jsx34(Text, { bold: true, color: "blue", children: "Recent decisions" }),
12277
- total === 0 ? /* @__PURE__ */ jsx34(Text, { dimColor: true, children: " No decisions recorded yet this session." }) : /* @__PURE__ */ jsxs34(Fragment11, { children: [
12305
+ total === 0 ? /* @__PURE__ */ jsx34(Text, { dimColor: true, children: " No decisions recorded yet this session." }) : /* @__PURE__ */ jsxs34(Fragment12, { children: [
12278
12306
  above > 0 ? /* @__PURE__ */ jsx34(Text, { dimColor: true, children: ` \u2191 ${above} more` }) : null,
12279
12307
  log.slice(windowStart, windowEnd).map((entry, i) => {
12280
12308
  const index = windowStart + i;
@@ -12935,12 +12963,20 @@ function firstNonEmpty(text) {
12935
12963
  return line ? line.replace(/\s+/g, " ").trim() : void 0;
12936
12964
  }
12937
12965
  function formatMatchHit(hit) {
12938
- if (typeof hit === "string") return truncMid(hit, 70);
12966
+ if (typeof hit === "string") {
12967
+ const m = hit.match(/^((?:[A-Za-z]:)?[^:]+):(\d+)[:\-](.*)$/);
12968
+ if (m?.[1] && m[2]) {
12969
+ const head = `${shortenPath(m[1], 40)}:${m[2]}`;
12970
+ const snippet2 = m[3]?.trim();
12971
+ return snippet2 ? `${head} ${truncMid(snippet2.replace(/\s+/g, " "), 40)}` : head;
12972
+ }
12973
+ return truncMid(hit, 70);
12974
+ }
12939
12975
  if (hit && typeof hit === "object") {
12940
12976
  const o = hit;
12941
- const file = stringOf(o["file"]) ?? stringOf(o["path"]);
12942
- const line = numOf(o["line"]) ?? numOf(o["lineNumber"]);
12943
- const snippet2 = stringOf(o["text"]) ?? stringOf(o["match"]) ?? stringOf(o["preview"]);
12977
+ const file = stringOf(o["file"]) ?? stringOf(o["path"]) ?? stringOf(o["filename"]) ?? stringOf(o["Filename"]);
12978
+ const line = numOf(o["line"]) ?? numOf(o["lineNumber"]) ?? numOf(o["line_number"]) ?? numOf(o["LineNumber"]);
12979
+ const snippet2 = stringOf(o["text"]) ?? stringOf(o["match"]) ?? stringOf(o["preview"]) ?? stringOf(o["lineContent"]) ?? stringOf(o["LineContent"]) ?? stringOf(o["line_content"]);
12944
12980
  if (file) {
12945
12981
  const head = line !== void 0 ? `${shortenPath(file, 40)}:${line}` : shortenPath(file, 50);
12946
12982
  return snippet2 ? `${head} ${truncMid(snippet2.replace(/\s+/g, " "), 40)}` : head;
@@ -12958,6 +12994,12 @@ var MAX_STREAM_LINES = 8;
12958
12994
  var WRITE_CREATE_STREAM_LINES = 3;
12959
12995
  var TOOL_STREAM_MARGIN_ROWS = 2;
12960
12996
  var TOOL_STREAM_HEADER_ROWS = 1;
12997
+ var ASSISTANT_STREAM_LINES = 6;
12998
+ var ASSISTANT_STREAM_MARGIN_ROWS = 2;
12999
+ var ASSISTANT_STREAM_HEADER_ROWS = 1;
13000
+ function assistantStreamBoxHeight() {
13001
+ return ASSISTANT_STREAM_MARGIN_ROWS + ASSISTANT_STREAM_HEADER_ROWS + ASSISTANT_STREAM_LINES;
13002
+ }
12961
13003
  function toolStreamBoxHeight(name) {
12962
13004
  const contentRows2 = name === "write" ? WRITE_CREATE_STREAM_LINES : MAX_STREAM_LINES;
12963
13005
  return TOOL_STREAM_MARGIN_ROWS + TOOL_STREAM_HEADER_ROWS + contentRows2;
@@ -13028,6 +13070,37 @@ var ToolStreamBox = React.memo(function ToolStreamBox2({
13028
13070
  }
13029
13071
  );
13030
13072
  });
13073
+ var AssistantStreamBox = React.memo(function AssistantStreamBox2({
13074
+ text,
13075
+ termWidth
13076
+ }) {
13077
+ const contentWidth = Math.max(1, Math.min(termWidth - 4, 100));
13078
+ const totalLines = text.split("\n").length;
13079
+ const hidden = Math.max(0, totalLines - ASSISTANT_STREAM_LINES);
13080
+ const rows = streamBoxRows(text, ASSISTANT_STREAM_LINES, contentWidth);
13081
+ const color = theme.assistant ?? "cyan";
13082
+ return /* @__PURE__ */ jsxs37(
13083
+ Box,
13084
+ {
13085
+ flexDirection: "column",
13086
+ marginY: 1,
13087
+ borderStyle: "single",
13088
+ borderTop: false,
13089
+ borderRight: false,
13090
+ borderBottom: false,
13091
+ borderColor: color,
13092
+ paddingLeft: 1,
13093
+ children: [
13094
+ /* @__PURE__ */ jsxs37(Box, { flexDirection: "row", children: [
13095
+ /* @__PURE__ */ jsx37(Text, { color, children: "\u2726 " }),
13096
+ /* @__PURE__ */ jsx37(Text, { bold: true, color, children: "assistant \xB7 streaming" }),
13097
+ hidden > 0 ? /* @__PURE__ */ jsx37(Text, { dimColor: true, children: ` (${totalLines} lines, showing last ${ASSISTANT_STREAM_LINES})` }) : null
13098
+ ] }),
13099
+ /* @__PURE__ */ jsx37(Box, { flexDirection: "column", marginLeft: 1, children: rows.map((r, i) => /* @__PURE__ */ jsx37(Text, { color: "white", italic: Boolean(r.italic), children: r.text || " " }, i)) })
13100
+ ]
13101
+ }
13102
+ );
13103
+ });
13031
13104
  function tailForDisplay(text, maxChars) {
13032
13105
  if (text.length <= maxChars) return text;
13033
13106
  const cut = text.length - maxChars;
@@ -13039,23 +13112,23 @@ function tailForDisplay(text, maxChars) {
13039
13112
  }
13040
13113
 
13041
13114
  // src/components/history/visual-lines.tsx
13042
- import { Fragment as Fragment12, jsx as jsx38, jsxs as jsxs38 } from "react/jsx-runtime";
13115
+ import { Fragment as Fragment13, jsx as jsx38, jsxs as jsxs38 } from "react/jsx-runtime";
13043
13116
  var VISUAL_TEXT_BUDGET = 92;
13044
13117
  function ToolOutputLines({
13045
13118
  lines,
13046
13119
  hasFollowingBlock
13047
13120
  }) {
13048
- return /* @__PURE__ */ jsx38(Fragment12, { children: lines.map((line, i) => {
13121
+ return /* @__PURE__ */ jsx38(Fragment13, { children: lines.map((line, i) => {
13049
13122
  const branch = i === lines.length - 1 && !hasFollowingBlock ? " \u2514\u2500 " : " \u251C\u2500 ";
13050
13123
  const color = colorForVisualKind(line.kind);
13051
13124
  return /* @__PURE__ */ jsxs38(Text, { children: [
13052
13125
  /* @__PURE__ */ jsx38(Text, { dimColor: true, children: branch }),
13053
13126
  line.marker ? /* @__PURE__ */ jsx38(Text, { color, bold: true, children: line.marker }) : null,
13054
- line.path ? /* @__PURE__ */ jsxs38(Fragment12, { children: [
13127
+ line.path ? /* @__PURE__ */ jsxs38(Fragment13, { children: [
13055
13128
  /* @__PURE__ */ jsx38(Text, { color: "cyan", children: shortenPath(sanitizeTerminalText(line.path), 56) }),
13056
13129
  /* @__PURE__ */ jsx38(Text, { dimColor: true, children: " " })
13057
13130
  ] }) : null,
13058
- line.lineNo ? /* @__PURE__ */ jsxs38(Fragment12, { children: [
13131
+ line.lineNo ? /* @__PURE__ */ jsxs38(Fragment13, { children: [
13059
13132
  /* @__PURE__ */ jsx38(Text, { color: "yellow", children: String(line.lineNo).padStart(4, " ") }),
13060
13133
  /* @__PURE__ */ jsx38(Text, { dimColor: true, children: " \u2502 " })
13061
13134
  ] }) : null,
@@ -13145,7 +13218,7 @@ function appendOutputPreview(rows, output, kind) {
13145
13218
  }
13146
13219
  function bodyLines(text) {
13147
13220
  const lines = text.replace(/\r/g, "").split("\n");
13148
- if (lines.length > 0 && /^[^\n]+(?:\s+\([^)]*\))?$/.test(lines[0] ?? "")) {
13221
+ if (lines.length > 1 && /^[^\s()]+\s+\([^)]*=[^)]*\)$/.test(lines[0] ?? "")) {
13149
13222
  return lines.slice(1);
13150
13223
  }
13151
13224
  return lines;
@@ -13478,6 +13551,37 @@ function visualCodebase(toolName, text, ok) {
13478
13551
  }
13479
13552
  return rows.slice(0, VISUAL_MAX_LINES2);
13480
13553
  }
13554
+ if (toolName === "codebase-incoming-calls" || toolName === "codebase-outgoing-calls") {
13555
+ const total = numOf(obj["total"]) ?? (Array.isArray(obj["calls"]) ? obj["calls"].length : 0);
13556
+ const targetSymbol = stringOf(obj["symbol"]) ?? "";
13557
+ const label = toolName === "codebase-incoming-calls" ? `${total} caller${total === 1 ? "" : "s"} for "${targetSymbol}"` : `${total} outgoing call${total === 1 ? "" : "s"} from "${targetSymbol}"`;
13558
+ const rows = [
13559
+ {
13560
+ kind: "ok",
13561
+ marker: "ok ",
13562
+ text: label
13563
+ }
13564
+ ];
13565
+ const calls = Array.isArray(obj["calls"]) ? obj["calls"] : [];
13566
+ for (const call of calls.slice(0, 5)) {
13567
+ if (call && typeof call === "object") {
13568
+ const c = call;
13569
+ const sym = c["symbol"] && typeof c["symbol"] === "object" ? c["symbol"] : void 0;
13570
+ const file = stringOf(sym?.["file"]) ?? stringOf(c["file"]);
13571
+ const line = numOf(sym?.["line"]) ?? numOf(c["line"]);
13572
+ const name = stringOf(sym?.["name"]) ?? stringOf(c["name"]);
13573
+ const sig = stringOf(sym?.["signature"]) ?? stringOf(c["signature"]);
13574
+ const callType = stringOf(c["callType"]);
13575
+ rows.push({
13576
+ kind: "match",
13577
+ path: file,
13578
+ lineNo: line?.toString(),
13579
+ text: [name, callType ? `[${callType}]` : void 0, sig].filter(Boolean).join(" \xB7 ")
13580
+ });
13581
+ }
13582
+ }
13583
+ return rows.slice(0, VISUAL_MAX_LINES2);
13584
+ }
13481
13585
  if (toolName === "codebase-index") {
13482
13586
  const errors = Array.isArray(obj["errors"]) ? obj["errors"] : [];
13483
13587
  return [
@@ -13551,7 +13655,7 @@ function visualLsp(toolName, text, ok) {
13551
13655
  });
13552
13656
  continue;
13553
13657
  }
13554
- const location = line.match(/^(.+):(\d+):(\d+)$/);
13658
+ const location = line.match(/^((?:[A-Za-z]:)?[^:]+):(\d+):(\d+)$/);
13555
13659
  if (location?.[1]) {
13556
13660
  push({ kind: "path", path: location[1], lineNo: location[2], text: `column ${location[3]}` });
13557
13661
  continue;
@@ -13963,13 +14067,17 @@ function formatToolArgs(toolName, input) {
13963
14067
  const obj = input;
13964
14068
  switch (toolName) {
13965
14069
  case "read":
14070
+ case "view_file":
13966
14071
  case "write":
14072
+ case "write_to_file":
13967
14073
  case "edit":
14074
+ case "replace_file_content":
13968
14075
  case "patch":
13969
14076
  case "list_dir":
14077
+ case "list_directory":
13970
14078
  case "ls":
13971
14079
  case "tree": {
13972
- const p = stringOf(obj["path"]) ?? stringOf(obj["file"]);
14080
+ const p = stringOf(obj["path"]) ?? stringOf(obj["file"]) ?? stringOf(obj["AbsolutePath"]) ?? stringOf(obj["TargetFile"]) ?? stringOf(obj["DirectoryPath"]);
13973
14081
  return p ? shortenPath(p, ARG_BUDGET) : "";
13974
14082
  }
13975
14083
  case "document": {
@@ -13979,23 +14087,30 @@ function formatToolArgs(toolName, input) {
13979
14087
  return [target, scope, style].filter(Boolean).join(" \xB7 ");
13980
14088
  }
13981
14089
  case "grep":
14090
+ case "grep_search":
13982
14091
  case "search":
13983
14092
  case "replace": {
13984
- const pat = stringOf(obj["pattern"]) ?? stringOf(obj["query"]);
13985
- const scope = stringOf(obj["path"]) ?? stringOf(obj["glob"]);
14093
+ const pat = stringOf(obj["pattern"]) ?? stringOf(obj["query"]) ?? stringOf(obj["Query"]);
14094
+ const scope = stringOf(obj["path"]) ?? stringOf(obj["glob"]) ?? stringOf(obj["SearchPath"]) ?? stringOf(obj["search_path"]);
13986
14095
  const head = pat ? `"${truncMid(pat, 36)}"` : "";
13987
14096
  const tail = scope ? ` in ${shortenPath(scope, 28)}` : "";
13988
14097
  return `${head}${tail}` || (stringOf(obj["command"]) ?? "");
13989
14098
  }
13990
- case "glob": {
13991
- const pat = stringOf(obj["pattern"]) ?? stringOf(obj["glob"]);
13992
- return pat ? `"${truncMid(pat, ARG_BUDGET - 2)}"` : "";
14099
+ case "glob":
14100
+ case "find_by_name":
14101
+ case "find_files": {
14102
+ const pat = stringOf(obj["pattern"]) ?? stringOf(obj["glob"]) ?? stringOf(obj["Pattern"]);
14103
+ const dir = stringOf(obj["SearchDirectory"]) ?? stringOf(obj["path"]);
14104
+ const head = pat ? `"${truncMid(pat, ARG_BUDGET - (dir ? 22 : 2))}"` : "";
14105
+ const tail = dir ? ` in ${shortenPath(dir, 18)}` : "";
14106
+ return `${head}${tail}`;
13993
14107
  }
13994
14108
  case "bash":
13995
14109
  case "shell":
14110
+ case "run_command":
13996
14111
  case "install":
13997
14112
  case "git": {
13998
- const cmd = stringOf(obj["command"]) ?? stringOf(obj["args"]);
14113
+ const cmd = stringOf(obj["command"]) ?? stringOf(obj["args"]) ?? stringOf(obj["CommandLine"]);
13999
14114
  return cmd ? truncMid(cmd, ARG_BUDGET) : "";
14000
14115
  }
14001
14116
  case "exec": {
@@ -14018,10 +14133,16 @@ function formatToolArgs(toolName, input) {
14018
14133
  }
14019
14134
  case "fetch":
14020
14135
  case "webfetch":
14021
- case "web_fetch": {
14022
- const u = stringOf(obj["url"]);
14136
+ case "web_fetch":
14137
+ case "read_url_content": {
14138
+ const u = stringOf(obj["url"]) ?? stringOf(obj["Url"]);
14023
14139
  return u ? truncMid(u, ARG_BUDGET) : "";
14024
14140
  }
14141
+ case "search_web":
14142
+ case "web_search": {
14143
+ const q = stringOf(obj["query"]) ?? stringOf(obj["q"]);
14144
+ return q ? `"${truncMid(q, ARG_BUDGET - 2)}"` : "";
14145
+ }
14025
14146
  case "todo": {
14026
14147
  const list = obj["todos"];
14027
14148
  if (Array.isArray(list)) return `${list.length} item${list.length === 1 ? "" : "s"}`;
@@ -14556,20 +14677,23 @@ function formatToolVisualOutput(toolName, output, ok, input) {
14556
14677
  if (!output) return void 0;
14557
14678
  const text = output.trim();
14558
14679
  if (!text) return void 0;
14559
- if (toolName === "read") return visualRead(text);
14560
- if (toolName === "grep" || toolName === "search") return visualSearch(toolName, text);
14561
- if (toolName === "glob") return visualPathList(toolName, text);
14680
+ if (toolName === "read" || toolName === "view_file") return visualRead(text);
14681
+ if (toolName === "grep" || toolName === "search" || toolName === "grep_search")
14682
+ return visualSearch(toolName, text);
14683
+ if (toolName === "glob" || toolName === "find" || toolName === "find_by_name" || toolName === "find_files" || toolName === "list_dir" || toolName === "dir_list" || toolName === "list_directory") {
14684
+ return visualPathList(toolName, text);
14685
+ }
14562
14686
  if (toolName === "tree") return visualTree(text);
14563
- if (toolName === "edit" || toolName === "write" || toolName === "diff" || toolName === "patch" || toolName === "replace") {
14687
+ if (toolName === "edit" || toolName === "replace_file_content" || toolName === "write" || toolName === "write_to_file" || toolName === "diff" || toolName === "patch" || toolName === "replace") {
14564
14688
  return visualEdit(toolName, text, ok);
14565
14689
  }
14566
- if (toolName === "bash" || toolName === "shell" || toolName === "git" || toolName === "exec" || toolName === "install") {
14690
+ if (toolName === "bash" || toolName === "shell" || toolName === "run_command" || toolName === "git" || toolName === "exec" || toolName === "install") {
14567
14691
  return visualCommand(toolName, text, ok);
14568
14692
  }
14569
14693
  if (toolName === "test" || toolName === "lint" || toolName === "typecheck" || toolName === "format") {
14570
14694
  return visualVerifier(toolName, text, ok);
14571
14695
  }
14572
- if (toolName === "fetch" || toolName === "webfetch" || toolName === "web_fetch") {
14696
+ if (toolName === "fetch" || toolName === "webfetch" || toolName === "web_fetch" || toolName === "read_url_content") {
14573
14697
  return visualFetch(text);
14574
14698
  }
14575
14699
  if (toolName === "json") return visualJson(text);
@@ -14587,7 +14711,7 @@ function formatToolVisualOutput(toolName, output, ok, input) {
14587
14711
  return visualToolCatalog(toolName, text);
14588
14712
  if (toolName === "tool_use" || toolName === "batch_tool_use")
14589
14713
  return visualMetaExecution(toolName, text, ok);
14590
- if (toolName === "codebase-index" || toolName === "codebase-search" || toolName === "codebase-stats") {
14714
+ if (toolName === "codebase-index" || toolName === "codebase-search" || toolName === "codebase-stats" || toolName === "codebase-incoming-calls" || toolName === "codebase-outgoing-calls") {
14591
14715
  return visualCodebase(toolName, text, ok);
14592
14716
  }
14593
14717
  if (toolName.startsWith("lsp_") || toolName === "codebase-lsp-search") {
@@ -14695,8 +14819,8 @@ function visualSearch(toolName, text) {
14695
14819
  consumed++;
14696
14820
  continue;
14697
14821
  }
14698
- const direct = line.match(/^(.+?):(\d+):(.*)$/);
14699
- const grouped = line.match(/^(\d+):(.*)$/);
14822
+ const direct = line.match(/^((?:[A-Za-z]:)?[^:]+):(\d+)[:\-](.*)$/);
14823
+ const grouped = line.match(/^(\d+)[:\-](.*)$/);
14700
14824
  if (direct?.[1] && direct[2]) {
14701
14825
  rows.push({ kind: "match", path: direct[1], lineNo: direct[2], text: direct[3] ?? "" });
14702
14826
  consumed++;
@@ -14727,25 +14851,32 @@ function visualSearchMatches(matches, count) {
14727
14851
  }
14728
14852
  function parseMatchHit(hit) {
14729
14853
  if (typeof hit === "string") {
14730
- const m = hit.match(/^(.+?):(\d+):(.*)$/);
14854
+ const m = hit.match(/^((?:[A-Za-z]:)?[^:]+):(\d+)[:\-](.*)$/);
14731
14855
  return m?.[1] && m[2] ? { path: m[1], line: m[2], text: m[3] ?? "" } : { text: hit };
14732
14856
  }
14733
14857
  if (hit && typeof hit === "object") {
14734
14858
  const o = hit;
14735
- const path12 = stringOf(o["file"]) ?? stringOf(o["path"]) ?? stringOf(o["url"]);
14736
- const line = numOf(o["line"]) ?? numOf(o["lineNumber"]);
14859
+ const path12 = stringOf(o["file"]) ?? stringOf(o["path"]) ?? stringOf(o["url"]) ?? stringOf(o["filename"]) ?? stringOf(o["Filename"]);
14860
+ const lineNum = numOf(o["line"]) ?? numOf(o["lineNumber"]) ?? numOf(o["line_number"]) ?? numOf(o["LineNumber"]);
14861
+ const line = lineNum === void 0 ? void 0 : String(lineNum);
14737
14862
  const title = stringOf(o["title"]);
14738
- const snippet2 = stringOf(o["snippet"]);
14739
- const text = stringOf(o["text"]) ?? stringOf(o["match"]) ?? stringOf(o["preview"]) ?? [title, snippet2].filter(Boolean).join(" \u2014 ");
14740
- return { path: path12, line: line === void 0 ? void 0 : String(line), text };
14863
+ const snippet2 = stringOf(o["snippet"]) ?? stringOf(o["lineContent"]) ?? stringOf(o["LineContent"]) ?? stringOf(o["line_content"]);
14864
+ const text = stringOf(o["text"]) ?? stringOf(o["match"]) ?? stringOf(o["preview"]) ?? snippet2 ?? title ?? [title, snippet2].filter(Boolean).join(" \u2014 ");
14865
+ return { path: path12, line, text };
14741
14866
  }
14742
14867
  return void 0;
14743
14868
  }
14744
14869
  function visualPathList(toolName, text) {
14745
14870
  const json = tryParseJson(text);
14746
- const files = json && typeof json === "object" && Array.isArray(json["files"]) ? json["files"].filter(
14747
- (v) => typeof v === "string"
14748
- ) : bodyLines(text).filter((line) => line.trim() && !line.startsWith(`${toolName}:`));
14871
+ const rawList = json && typeof json === "object" ? Array.isArray(json["files"]) ? json["files"] : Array.isArray(json["paths"]) ? json["paths"] : Array.isArray(json["matches"]) ? json["matches"] : Array.isArray(json["entries"]) ? json["entries"] : Array.isArray(json) ? json : void 0 : void 0;
14872
+ const files = rawList ? rawList.map((v) => {
14873
+ if (typeof v === "string") return v;
14874
+ if (v && typeof v === "object") {
14875
+ const o = v;
14876
+ return stringOf(o["path"]) ?? stringOf(o["relativePath"]) ?? stringOf(o["name"]) ?? stringOf(o["file"]);
14877
+ }
14878
+ return void 0;
14879
+ }).filter((v) => typeof v === "string") : bodyLines(text).filter((line) => line.trim() && !line.startsWith(`${toolName}:`));
14749
14880
  if (files.length === 0) return void 0;
14750
14881
  const rows = files.slice(0, VISUAL_MAX_LINES6).map(
14751
14882
  (file) => ({
@@ -14759,6 +14890,20 @@ function visualPathList(toolName, text) {
14759
14890
  return rows;
14760
14891
  }
14761
14892
  function visualTree(text) {
14893
+ const json = tryParseJson(text);
14894
+ if (json && typeof json === "object") {
14895
+ const obj = json;
14896
+ const files = numOf(obj["total_files"]) ?? numOf(obj["files"]);
14897
+ const dirs = numOf(obj["total_dirs"]) ?? numOf(obj["dirs"]);
14898
+ if (files !== void 0 || dirs !== void 0) {
14899
+ const parts = [
14900
+ files !== void 0 ? `${files} file${files === 1 ? "" : "s"}` : void 0,
14901
+ dirs !== void 0 ? `${dirs} dir${dirs === 1 ? "" : "s"}` : void 0,
14902
+ obj["truncated"] === true ? "truncated" : void 0
14903
+ ].filter(Boolean);
14904
+ return [{ kind: "meta", text: parts.join(" \xB7 ") }];
14905
+ }
14906
+ }
14762
14907
  const lines = bodyLines(text).filter((line) => line.trim());
14763
14908
  if (lines.length === 0) return void 0;
14764
14909
  const rows = lines.slice(0, VISUAL_MAX_LINES6).map(
@@ -15019,7 +15164,7 @@ function extractPatchHeaderPath(diffText) {
15019
15164
  }
15020
15165
 
15021
15166
  // src/components/history/code-block.tsx
15022
- import { Fragment as Fragment13, jsx as jsx39, jsxs as jsxs39 } from "react/jsx-runtime";
15167
+ import { Fragment as Fragment14, jsx as jsx39, jsxs as jsxs39 } from "react/jsx-runtime";
15023
15168
  var MAX_CODE_LINES = 80;
15024
15169
  var DIFF_MAX_LINES = 200;
15025
15170
  var MULTI_DIFF_MAX_FILES = 20;
@@ -15149,7 +15294,10 @@ function DiffFileBlock({
15149
15294
  contentWidth
15150
15295
  }) {
15151
15296
  return /* @__PURE__ */ jsxs39(Box, { flexDirection: "column", marginTop: 1, children: [
15152
- /* @__PURE__ */ jsx39(Text, { dimColor: true, italic: true, children: path12 }),
15297
+ /* @__PURE__ */ jsxs39(Box, { flexDirection: "row", marginBottom: 0, children: [
15298
+ /* @__PURE__ */ jsx39(Text, { bold: true, color: theme.accent, children: `\u{1F4C4} ${path12}` }),
15299
+ preview.added > 0 || preview.removed > 0 ? /* @__PURE__ */ jsx39(Text, { dimColor: true, children: ` (${preview.added > 0 ? `+${preview.added}` : ""}${preview.added > 0 && preview.removed > 0 ? " " : ""}${preview.removed > 0 ? `-${preview.removed}` : ""})` }) : null
15300
+ ] }),
15153
15301
  /* @__PURE__ */ jsx39(
15154
15302
  DiffBlock,
15155
15303
  {
@@ -15161,6 +15309,7 @@ function DiffFileBlock({
15161
15309
  hiddenRemoved: preview.hiddenRemoved,
15162
15310
  useColor,
15163
15311
  lang: langFromPath(path12),
15312
+ showStats: false,
15164
15313
  contentWidth
15165
15314
  }
15166
15315
  )
@@ -15300,7 +15449,7 @@ function DiffBlock({
15300
15449
  return /* @__PURE__ */ jsx39(Box, { flexDirection: "column", children: segments.map((seg, si) => {
15301
15450
  const pad = padBody(seg);
15302
15451
  return /* @__PURE__ */ jsxs39(Text, { backgroundColor: bg, children: [
15303
- si === 0 ? /* @__PURE__ */ jsxs39(Fragment13, { children: [
15452
+ si === 0 ? /* @__PURE__ */ jsxs39(Fragment14, { children: [
15304
15453
  /* @__PURE__ */ jsx39(Text, { dimColor: true, children: ` ${ln} ` }),
15305
15454
  /* @__PURE__ */ jsx39(Text, { color: markerColor, bold: true, children: marker }),
15306
15455
  /* @__PURE__ */ jsx39(Text, { children: " " })
@@ -15311,7 +15460,7 @@ function DiffBlock({
15311
15460
  }) }, key);
15312
15461
  }
15313
15462
  return /* @__PURE__ */ jsx39(Box, { flexDirection: "column", children: segments.map((seg, si) => /* @__PURE__ */ jsxs39(Text, { children: [
15314
- si === 0 ? /* @__PURE__ */ jsxs39(Fragment13, { children: [
15463
+ si === 0 ? /* @__PURE__ */ jsxs39(Fragment14, { children: [
15315
15464
  /* @__PURE__ */ jsx39(Text, { dimColor: true, children: ` ${ln} ` }),
15316
15465
  /* @__PURE__ */ jsx39(Text, { color: markerColor, bold: true, children: marker }),
15317
15466
  /* @__PURE__ */ jsx39(Text, { children: " " })
@@ -15520,7 +15669,7 @@ function ConfirmPrompt({
15520
15669
 
15521
15670
  // src/components/connections-panel.tsx
15522
15671
  init_connections_health();
15523
- import { useCallback as useCallback4, useEffect as useEffect16, useRef as useRef3, useState as useState17 } from "react";
15672
+ import { useCallback as useCallback4, useEffect as useEffect16, useRef as useRef3, useState as useState18 } from "react";
15524
15673
  import { jsx as jsx41, jsxs as jsxs41 } from "react/jsx-runtime";
15525
15674
  var REFRESH_MS = 8e3;
15526
15675
  var STATUS_GLYPH = {
@@ -15590,9 +15739,9 @@ function ConnectionsPanel({
15590
15739
  projectRoot,
15591
15740
  onClose
15592
15741
  }) {
15593
- const [report, setReport] = useState17(null);
15594
- const [loading, setLoading] = useState17(true);
15595
- const [error, setError] = useState17(null);
15742
+ const [report, setReport] = useState18(null);
15743
+ const [loading, setLoading] = useState18(true);
15744
+ const [error, setError] = useState18(null);
15596
15745
  const cancelledRef = useRef3(false);
15597
15746
  const fetch2 = useCallback4(async () => {
15598
15747
  try {
@@ -15729,7 +15878,7 @@ function ContinueConfirmPanel({
15729
15878
  }
15730
15879
 
15731
15880
  // src/components/coordinator-panel.tsx
15732
- import { useEffect as useEffect17, useState as useState18 } from "react";
15881
+ import { useEffect as useEffect17, useState as useState19 } from "react";
15733
15882
  import { jsx as jsx43, jsxs as jsxs43 } from "react/jsx-runtime";
15734
15883
  var KIND_COLOR = {
15735
15884
  goal: theme.accent,
@@ -15763,7 +15912,7 @@ function CoordinatorPanel({
15763
15912
  onClose
15764
15913
  }) {
15765
15914
  const size = useMonitorSize();
15766
- const [selectedGoal, setSelectedGoal] = useState18(0);
15915
+ const [selectedGoal, setSelectedGoal] = useState19(0);
15767
15916
  const { goals, timeline, knowledgeCount, healthy } = coordinator;
15768
15917
  useEffect17(() => {
15769
15918
  setSelectedGoal((value) => Math.min(value, Math.max(0, goals.length - 1)));
@@ -15926,7 +16075,7 @@ function CoordinatorPanel({
15926
16075
  }
15927
16076
 
15928
16077
  // src/components/design-picker.tsx
15929
- import { Fragment as Fragment14, jsx as jsx44, jsxs as jsxs44 } from "react/jsx-runtime";
16078
+ import { Fragment as Fragment15, jsx as jsx44, jsxs as jsxs44 } from "react/jsx-runtime";
15930
16079
  function DesignPicker({ kits, selected, stack }) {
15931
16080
  const { start, end, hasAbove, hasBelow } = useWindowedPicker({
15932
16081
  total: kits.length,
@@ -15945,7 +16094,7 @@ function DesignPicker({ kits, selected, stack }) {
15945
16094
  stack,
15946
16095
  " \xB7 Enter apply \xB7 Esc cancel"
15947
16096
  ] }),
15948
- kits.length === 0 ? /* @__PURE__ */ jsx44(Text, { dimColor: true, children: "No design kits installed." }) : /* @__PURE__ */ jsxs44(Fragment14, { children: [
16097
+ kits.length === 0 ? /* @__PURE__ */ jsx44(Text, { dimColor: true, children: "No design kits installed." }) : /* @__PURE__ */ jsxs44(Fragment15, { children: [
15949
16098
  hasAbove ? /* @__PURE__ */ jsxs44(Text, { dimColor: true, children: [
15950
16099
  " \u2026 ",
15951
16100
  start,
@@ -15970,7 +16119,7 @@ function DesignPicker({ kits, selected, stack }) {
15970
16119
 
15971
16120
  // src/components/enhance-panel.tsx
15972
16121
  import { useEffect as useEffect18, useRef as useRef4 } from "react";
15973
- import { Fragment as Fragment15, jsx as jsx45, jsxs as jsxs45 } from "react/jsx-runtime";
16122
+ import { Fragment as Fragment16, jsx as jsx45, jsxs as jsxs45 } from "react/jsx-runtime";
15974
16123
  function normalizePreviewText(text) {
15975
16124
  return text.replace(/\s+/g, " ").trim();
15976
16125
  }
@@ -16271,7 +16420,7 @@ function EnhancePanel({
16271
16420
  /* @__PURE__ */ jsx45(KeyHint, { keyName: "R", label: "retry", color: theme.brand }),
16272
16421
  /* @__PURE__ */ jsx45(KeyHint, { keyName: "T", label: "edit", color: theme.warn }),
16273
16422
  /* @__PURE__ */ jsx45(KeyHint, { keyName: "Esc", label: "cancel", color: theme.error })
16274
- ] }) : /* @__PURE__ */ jsxs45(Fragment15, { children: [
16423
+ ] }) : /* @__PURE__ */ jsxs45(Fragment16, { children: [
16275
16424
  /* @__PURE__ */ jsxs45(Box, { height: 1, gap: 2, children: [
16276
16425
  /* @__PURE__ */ jsx45(
16277
16426
  KeyHint,
@@ -16385,7 +16534,7 @@ function ExitConfirmPanel({
16385
16534
  }
16386
16535
 
16387
16536
  // src/components/f-key-picker.tsx
16388
- import { Fragment as Fragment16, jsx as jsx48, jsxs as jsxs48 } from "react/jsx-runtime";
16537
+ import { Fragment as Fragment17, jsx as jsx48, jsxs as jsxs48 } from "react/jsx-runtime";
16389
16538
  function FKeyPicker({ selected }) {
16390
16539
  const size = useMonitorSize();
16391
16540
  const safeSelected = Math.min(Math.max(0, selected), F_KEY_PANEL_ENTRIES.length - 1);
@@ -16430,7 +16579,7 @@ function FKeyPicker({ selected }) {
16430
16579
  Math.max(14, size.columns >= 92 ? 34 : size.contentWidth - 12)
16431
16580
  )
16432
16581
  ] }),
16433
- size.columns >= 92 ? /* @__PURE__ */ jsxs48(Fragment16, { children: [
16582
+ size.columns >= 92 ? /* @__PURE__ */ jsxs48(Fragment17, { children: [
16434
16583
  /* @__PURE__ */ jsx48(Box, { flexGrow: 1 }),
16435
16584
  /* @__PURE__ */ jsx48(Text, { color: theme.textMuted, children: truncatePanelText(entry.helpDescription, 42) })
16436
16585
  ] }) : null
@@ -16447,7 +16596,7 @@ function FKeyPicker({ selected }) {
16447
16596
  }
16448
16597
 
16449
16598
  // src/components/fallback-overlay.tsx
16450
- import { useEffect as useEffect19, useRef as useRef5, useState as useState19 } from "react";
16599
+ import { useEffect as useEffect19, useRef as useRef5, useState as useState20 } from "react";
16451
16600
  import { jsx as jsx49, jsxs as jsxs49 } from "react/jsx-runtime";
16452
16601
  function FallbackOverlay({
16453
16602
  from,
@@ -16458,7 +16607,7 @@ function FallbackOverlay({
16458
16607
  onChoose,
16459
16608
  onMove
16460
16609
  }) {
16461
- const [remaining, setRemaining] = useState19(Math.max(1, autoSwitchSeconds));
16610
+ const [remaining, setRemaining] = useState20(Math.max(1, autoSwitchSeconds));
16462
16611
  const resolvedRef = useRef5(false);
16463
16612
  const selectedRef = useRef5(selected);
16464
16613
  selectedRef.current = selected;
@@ -16574,7 +16723,7 @@ function highlight(path12, _query) {
16574
16723
  }
16575
16724
 
16576
16725
  // src/components/help-panel.tsx
16577
- import { Fragment as Fragment17, jsx as jsx51, jsxs as jsxs51 } from "react/jsx-runtime";
16726
+ import { Fragment as Fragment18, jsx as jsx51, jsxs as jsxs51 } from "react/jsx-runtime";
16578
16727
  var CATEGORY_ORDER = ["Run", "Session", "Inspect", "Agent", "Config", "App"];
16579
16728
  var CHROME_ROWS3 = 7;
16580
16729
  function normalizeQuery(raw) {
@@ -16654,7 +16803,7 @@ function HelpPanel({
16654
16803
  'No commands match "',
16655
16804
  filter,
16656
16805
  '".'
16657
- ] }) : /* @__PURE__ */ jsxs51(Fragment17, { children: [
16806
+ ] }) : /* @__PURE__ */ jsxs51(Fragment18, { children: [
16658
16807
  hiddenAbove > 0 && !hasFilter ? /* @__PURE__ */ jsx51(Text, { dimColor: true, children: ` \u2191 ${hiddenAbove} more` }) : null,
16659
16808
  contextHeader && !hasFilter ? /* @__PURE__ */ jsxs51(Text, { bold: true, color: "yellow", dimColor: true, children: [
16660
16809
  " ",
@@ -16706,7 +16855,7 @@ function HelpPanel({
16706
16855
  }
16707
16856
 
16708
16857
  // src/components/mcp-picker.tsx
16709
- import { Fragment as Fragment18, jsx as jsx52, jsxs as jsxs52 } from "react/jsx-runtime";
16858
+ import { Fragment as Fragment19, jsx as jsx52, jsxs as jsxs52 } from "react/jsx-runtime";
16710
16859
  var CHROME_ROWS4 = 17;
16711
16860
  function statusBadge(status, enabled) {
16712
16861
  if (!enabled) return /* @__PURE__ */ jsx52(Text, { dimColor: true, children: "\u25CB disabled" });
@@ -16742,7 +16891,7 @@ function McpPicker({
16742
16891
  return /* @__PURE__ */ jsxs52(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [
16743
16892
  /* @__PURE__ */ jsx52(Text, { bold: true, color: "cyan", children: "MCP Servers" }),
16744
16893
  /* @__PURE__ */ jsx52(Text, { dimColor: true, children: "\u2191/\u2193 select \xB7 Enter/\u2190/\u2192 toggle enable \xB7 r restart \xB7 Esc close" }),
16745
- /* @__PURE__ */ jsx52(Box, { marginTop: 1, flexDirection: "column", children: items.length === 0 ? /* @__PURE__ */ jsx52(Text, { dimColor: true, children: busy ? "Loading servers\u2026" : "No MCP servers configured." }) : /* @__PURE__ */ jsxs52(Fragment18, { children: [
16894
+ /* @__PURE__ */ jsx52(Box, { marginTop: 1, flexDirection: "column", children: items.length === 0 ? /* @__PURE__ */ jsx52(Text, { dimColor: true, children: busy ? "Loading servers\u2026" : "No MCP servers configured." }) : /* @__PURE__ */ jsxs52(Fragment19, { children: [
16746
16895
  above > 0 ? /* @__PURE__ */ jsx52(Text, { dimColor: true, children: ` \u2191 ${above} more` }) : null,
16747
16896
  items.slice(windowStart, windowEnd).map((item, i) => {
16748
16897
  const index = windowStart + i;
@@ -17112,7 +17261,7 @@ function formatCost(value) {
17112
17261
  }
17113
17262
 
17114
17263
  // src/components/plugin-picker.tsx
17115
- import { Fragment as Fragment19, jsx as jsx55, jsxs as jsxs55 } from "react/jsx-runtime";
17264
+ import { Fragment as Fragment20, jsx as jsx55, jsxs as jsxs55 } from "react/jsx-runtime";
17116
17265
  var CHROME_ROWS5 = 17;
17117
17266
  var MAX_PICKER_ITEMS = 15;
17118
17267
  function PluginPicker({
@@ -17137,7 +17286,7 @@ function PluginPicker({
17137
17286
  hasLockedRows ? " \xB7 \u{1F512} = locked" : "",
17138
17287
  " \xB7 Esc close"
17139
17288
  ] }),
17140
- /* @__PURE__ */ jsx55(Box, { marginTop: 1, flexDirection: "column", children: items.length === 0 ? /* @__PURE__ */ jsx55(Text, { dimColor: true, children: busy ? "Loading plugins\u2026" : "No plugins available." }) : /* @__PURE__ */ jsxs55(Fragment19, { children: [
17289
+ /* @__PURE__ */ jsx55(Box, { marginTop: 1, flexDirection: "column", children: items.length === 0 ? /* @__PURE__ */ jsx55(Text, { dimColor: true, children: busy ? "Loading plugins\u2026" : "No plugins available." }) : /* @__PURE__ */ jsxs55(Fragment20, { children: [
17141
17290
  above > 0 ? /* @__PURE__ */ jsx55(Text, { dimColor: true, children: ` \u2191 ${above} more` }) : null,
17142
17291
  items.slice(windowStart, windowEnd).map((item, i) => {
17143
17292
  const index = windowStart + i;
@@ -17422,7 +17571,7 @@ function PromptPicker({
17422
17571
  }
17423
17572
 
17424
17573
  // src/components/refine-countdown-panel.tsx
17425
- import { useEffect as useEffect20, useRef as useRef6, useState as useState20 } from "react";
17574
+ import { useEffect as useEffect20, useRef as useRef6, useState as useState21 } from "react";
17426
17575
  import { jsx as jsx58, jsxs as jsxs58 } from "react/jsx-runtime";
17427
17576
  function RefineCountdownPanel({
17428
17577
  original,
@@ -17431,7 +17580,7 @@ function RefineCountdownPanel({
17431
17580
  providerId,
17432
17581
  model
17433
17582
  }) {
17434
- const [remaining, setRemaining] = useState20(Math.max(1, seconds));
17583
+ const [remaining, setRemaining] = useState21(Math.max(1, seconds));
17435
17584
  const resolvedRef = useRef6(false);
17436
17585
  const onDecisionRef = useRef6(onDecision);
17437
17586
  useEffect20(() => {
@@ -17510,7 +17659,7 @@ function RefineCountdownPanel({
17510
17659
  }
17511
17660
 
17512
17661
  // src/components/refine-failure-panel.tsx
17513
- import { useState as useState21, useMemo as useMemo6 } from "react";
17662
+ import { useState as useState22, useMemo as useMemo6 } from "react";
17514
17663
  import { jsx as jsx59, jsxs as jsxs59 } from "react/jsx-runtime";
17515
17664
  function filterRefineModels(models, query) {
17516
17665
  const normalized = query.trim().toLowerCase();
@@ -17532,9 +17681,9 @@ function RefineFailurePanel({
17532
17681
  onDecision
17533
17682
  }) {
17534
17683
  const columns = useColumns();
17535
- const [view, setView] = useState21("options");
17536
- const [cursor, setCursor] = useState21(0);
17537
- const [query, setQuery] = useState21("");
17684
+ const [view, setView] = useState22("options");
17685
+ const [cursor, setCursor] = useState22(0);
17686
+ const [query, setQuery] = useState22("");
17538
17687
  const filteredModels = useMemo6(() => filterRefineModels(models, query), [models, query]);
17539
17688
  const width = Math.max(30, columns - 4);
17540
17689
  const canPick = models.length > 0;
@@ -17739,7 +17888,7 @@ function RefineFailurePanel({
17739
17888
  }
17740
17889
 
17741
17890
  // src/components/resource-menu.tsx
17742
- import { Fragment as Fragment20, jsx as jsx60, jsxs as jsxs60 } from "react/jsx-runtime";
17891
+ import { Fragment as Fragment21, jsx as jsx60, jsxs as jsxs60 } from "react/jsx-runtime";
17743
17892
  function ResourceMenu({
17744
17893
  snapshot,
17745
17894
  selected,
@@ -17862,11 +18011,11 @@ function ResourceDetail({
17862
18011
  ] }),
17863
18012
  detail.value
17864
18013
  ] }, `${detail.label}:${detail.value}`)),
17865
- item.body ? /* @__PURE__ */ jsxs60(Fragment20, { children: [
18014
+ item.body ? /* @__PURE__ */ jsxs60(Fragment21, { children: [
17866
18015
  /* @__PURE__ */ jsx60(Text, { children: " " }),
17867
18016
  /* @__PURE__ */ jsx60(Text, { wrap: "wrap", children: truncate2(item.body, bodyLimit) })
17868
18017
  ] }) : null,
17869
- item.actions && item.actions.length > 0 ? /* @__PURE__ */ jsxs60(Fragment20, { children: [
18018
+ item.actions && item.actions.length > 0 ? /* @__PURE__ */ jsxs60(Fragment21, { children: [
17870
18019
  /* @__PURE__ */ jsx60(Text, { children: " " }),
17871
18020
  /* @__PURE__ */ jsx60(Text, { color: theme.textMuted, wrap: "wrap", children: item.actions.map((action) => `${action.key} ${action.label}`).join(" \xB7 ") })
17872
18021
  ] }) : null
@@ -17892,7 +18041,7 @@ function truncate2(value, max) {
17892
18041
  }
17893
18042
 
17894
18043
  // src/components/resume-picker.tsx
17895
- import { Fragment as Fragment21, jsx as jsx61, jsxs as jsxs61 } from "react/jsx-runtime";
18044
+ import { Fragment as Fragment22, jsx as jsx61, jsxs as jsxs61 } from "react/jsx-runtime";
17896
18045
  function ResumePicker({
17897
18046
  sessions,
17898
18047
  selected,
@@ -17917,7 +18066,7 @@ function ResumePicker({
17917
18066
  `${sessions.length > 0 ? `${selected + 1}/${sessions.length} \xB7 ` : ""}\u2191/\u2193 navigate \xB7 Enter select \xB7 Esc cancel`
17918
18067
  ) }),
17919
18068
  error ? /* @__PURE__ */ jsx61(Text, { color: "red", children: error }) : null,
17920
- sessions.length === 0 && !busy ? /* @__PURE__ */ jsx61(Text, { dimColor: true, children: "No sessions found." }) : /* @__PURE__ */ jsxs61(Fragment21, { children: [
18069
+ sessions.length === 0 && !busy ? /* @__PURE__ */ jsx61(Text, { dimColor: true, children: "No sessions found." }) : /* @__PURE__ */ jsxs61(Fragment22, { children: [
17921
18070
  hasAbove ? /* @__PURE__ */ jsxs61(Text, { dimColor: true, children: [
17922
18071
  " \u2026 ",
17923
18072
  start,
@@ -19024,14 +19173,14 @@ function buildResetPatch(field) {
19024
19173
  }
19025
19174
 
19026
19175
  // src/components/settings-picker-row-list.tsx
19027
- import { Fragment as Fragment22, jsx as jsx63, jsxs as jsxs63 } from "react/jsx-runtime";
19176
+ import { Fragment as Fragment23, jsx as jsx63, jsxs as jsxs63 } from "react/jsx-runtime";
19028
19177
  function renderPickerRow(row, fieldIdx, selected, filterActive, highlightSegments) {
19029
19178
  const labelStr = row.label ?? "";
19030
19179
  const segments = highlightSegments(labelStr);
19031
19180
  const padNeeded = Math.max(0, 26 - labelStr.length);
19032
19181
  return /* @__PURE__ */ jsxs63(Text, { inverse: selected, ...selected ? { color: "yellow" } : {}, children: [
19033
19182
  selected ? "\u203A " : " ",
19034
- filterActive ? /* @__PURE__ */ jsxs63(Fragment22, { children: [
19183
+ filterActive ? /* @__PURE__ */ jsxs63(Fragment23, { children: [
19035
19184
  segments.map((seg, j) => /* @__PURE__ */ jsx63(Text, { bold: true, ...seg.match ? { color: "yellow" } : { dimColor: true }, children: seg.text }, j)),
19036
19185
  /* @__PURE__ */ jsx63(Text, { bold: true, dimColor: true, children: " ".repeat(padNeeded) })
19037
19186
  ] }) : /* @__PURE__ */ jsx63(Text, { bold: true, children: labelStr.padEnd(26) }),
@@ -19075,7 +19224,7 @@ function SettingsPickerRowList({
19075
19224
  filterWindowEnd
19076
19225
  }) {
19077
19226
  if (filterActive) {
19078
- return /* @__PURE__ */ jsx63(Fragment22, { children: rankedResults.slice(filterWindowStart, filterWindowEnd).map((result) => {
19227
+ return /* @__PURE__ */ jsx63(Fragment23, { children: rankedResults.slice(filterWindowStart, filterWindowEnd).map((result) => {
19079
19228
  const fieldIdx = result.chord.field;
19080
19229
  const rowIdx = fieldRowIndex[fieldIdx] ?? -1;
19081
19230
  const row = rows[rowIdx];
@@ -19084,7 +19233,7 @@ function SettingsPickerRowList({
19084
19233
  }) });
19085
19234
  }
19086
19235
  const visibleSections = buildVisibleSectionHeaders(rows, fieldRowIndex, windowStart, windowEnd);
19087
- return /* @__PURE__ */ jsx63(Fragment22, { children: rows.map((row, i) => {
19236
+ return /* @__PURE__ */ jsx63(Fragment23, { children: rows.map((row, i) => {
19088
19237
  const fieldAtRow = fieldRowIndex.indexOf(i);
19089
19238
  if (fieldAtRow === -1) {
19090
19239
  if (!visibleSections.has(i)) return null;
@@ -20315,7 +20464,7 @@ var PREVIEW_MIN_ROWS = 12;
20315
20464
  var PREVIEW_FULL_ROWS = 18;
20316
20465
 
20317
20466
  // src/components/tools-picker.tsx
20318
- import { Fragment as Fragment23, jsx as jsx73, jsxs as jsxs73 } from "react/jsx-runtime";
20467
+ import { Fragment as Fragment24, jsx as jsx73, jsxs as jsxs73 } from "react/jsx-runtime";
20319
20468
  var CHROME_ROWS6 = 15;
20320
20469
  var MAX_PICKER_ITEMS2 = 15;
20321
20470
  function toolActionLabel(enabled) {
@@ -20436,7 +20585,7 @@ function ToolsPicker({
20436
20585
  'No tools match "',
20437
20586
  filter,
20438
20587
  '".'
20439
- ] }) : /* @__PURE__ */ jsxs73(Fragment23, { children: [
20588
+ ] }) : /* @__PURE__ */ jsxs73(Fragment24, { children: [
20440
20589
  hiddenAbove > 0 ? /* @__PURE__ */ jsx73(Text, { dimColor: true, children: ` \u2191 ${hiddenAbove} more` }) : null,
20441
20590
  displayRows.map(({ item, index }) => {
20442
20591
  const focused = index === visibleSelected;
@@ -20513,7 +20662,7 @@ function TopicCheckPanel({ prompt }) {
20513
20662
  }
20514
20663
 
20515
20664
  // src/app-view-pickers.tsx
20516
- import { Fragment as Fragment24, jsx as jsx75, jsxs as jsxs75 } from "react/jsx-runtime";
20665
+ import { Fragment as Fragment25, jsx as jsx75, jsxs as jsxs75 } from "react/jsx-runtime";
20517
20666
  var CONTINUE_CONFIRM_DELAY_MS = 4e3;
20518
20667
  function AppViewPickers({
20519
20668
  host,
@@ -20553,7 +20702,7 @@ function AppViewPickers({
20553
20702
  const { nowTick, enhanceDots } = activity;
20554
20703
  const { setYoloLive } = environment;
20555
20704
  const { inputHeight } = viewState;
20556
- return /* @__PURE__ */ jsxs75(Fragment24, { children: [
20705
+ return /* @__PURE__ */ jsxs75(Fragment25, { children: [
20557
20706
  state.picker.open ? /* @__PURE__ */ jsx75(
20558
20707
  FilePicker,
20559
20708
  {
@@ -21218,7 +21367,7 @@ function Card({
21218
21367
 
21219
21368
  // src/components/sidebar-panel-frame.tsx
21220
21369
  import React6 from "react";
21221
- import { Fragment as Fragment25, jsx as jsx77, jsxs as jsxs77 } from "react/jsx-runtime";
21370
+ import { Fragment as Fragment26, jsx as jsx77, jsxs as jsxs77 } from "react/jsx-runtime";
21222
21371
  function trunc(s2, max) {
21223
21372
  return truncateDisplay(s2, max);
21224
21373
  }
@@ -21322,7 +21471,7 @@ function SidebarPanelFrame({
21322
21471
  innerWidth - 4 - (effectivePill && innerWidth >= 22 ? displayWidth(getPillLabel(effectivePill)) + 2 : 0)
21323
21472
  )
21324
21473
  ) }),
21325
- effectivePill && innerWidth >= 22 ? /* @__PURE__ */ jsxs77(Fragment25, { children: [
21474
+ effectivePill && innerWidth >= 22 ? /* @__PURE__ */ jsxs77(Fragment26, { children: [
21326
21475
  /* @__PURE__ */ jsx77(Box, { flexGrow: 1 }),
21327
21476
  effectivePill
21328
21477
  ] }) : null
@@ -21352,7 +21501,7 @@ function getPillLabel(pill) {
21352
21501
  }
21353
21502
 
21354
21503
  // src/components/sidebar-content.tsx
21355
- import { Fragment as Fragment26, jsx as jsx78, jsxs as jsxs78 } from "react/jsx-runtime";
21504
+ import { Fragment as Fragment27, jsx as jsx78, jsxs as jsxs78 } from "react/jsx-runtime";
21356
21505
  function trunc2(s2, max) {
21357
21506
  if (s2.length <= max) return s2;
21358
21507
  return `${s2.slice(0, Math.max(1, max - 1))}\u2026`;
@@ -21539,7 +21688,7 @@ function DialRow({
21539
21688
  /* @__PURE__ */ jsx78(Text, { color, children: dialGlyph(ratio) }),
21540
21689
  /* @__PURE__ */ jsx78(Text, { children: " " }),
21541
21690
  /* @__PURE__ */ jsx78(Text, { color, bold: true, children: value }),
21542
- spark ? /* @__PURE__ */ jsxs78(Fragment26, { children: [
21691
+ spark ? /* @__PURE__ */ jsxs78(Fragment27, { children: [
21543
21692
  /* @__PURE__ */ jsx78(Box, { flexGrow: 1 }),
21544
21693
  /* @__PURE__ */ jsx78(Text, { color, children: spark })
21545
21694
  ] }) : null
@@ -21606,7 +21755,7 @@ function SidebarContent({
21606
21755
  ]
21607
21756
  }
21608
21757
  ) : null,
21609
- /* @__PURE__ */ jsx78(Card, { innerWidth, accent: ctxColor, children: (bodyWidth) => /* @__PURE__ */ jsxs78(Fragment26, { children: [
21758
+ /* @__PURE__ */ jsx78(Card, { innerWidth, accent: ctxColor, children: (bodyWidth) => /* @__PURE__ */ jsxs78(Fragment27, { children: [
21610
21759
  /* @__PURE__ */ jsxs78(Box, { width: bodyWidth, justifyContent: "space-between", children: [
21611
21760
  /* @__PURE__ */ jsxs78(Box, { children: [
21612
21761
  /* @__PURE__ */ jsx78(Text, { color: theme.accent, bold: true, children: glyphs.railHeavy }),
@@ -21618,7 +21767,7 @@ function SidebarContent({
21618
21767
  /* @__PURE__ */ jsx78(Text, { color: theme.textMuted, wrap: "truncate", children: provider ? `${glyphs.diamondOpen} ${trunc2(provider.toUpperCase(), Math.max(1, bodyWidth - 2))}` : `${glyphs.diamondOpen} ACTIVE` }),
21619
21768
  /* @__PURE__ */ jsx78(Text, { color: theme.textPrimary, bold: true, wrap: "truncate", children: trunc2(modelIdentity, bodyWidth) })
21620
21769
  ] }) : null,
21621
- contextWindow ? /* @__PURE__ */ jsxs78(Fragment26, { children: [
21770
+ contextWindow ? /* @__PURE__ */ jsxs78(Fragment27, { children: [
21622
21771
  (() => {
21623
21772
  const tokensLabel = `${fmtTok(contextWindow.used)} / ${fmtTok(contextWindow.max)}`;
21624
21773
  const pctLabel = `${ctxPct} `;
@@ -21720,7 +21869,7 @@ function SidebarContent({
21720
21869
  /* @__PURE__ */ jsx78(Card, { innerWidth, accent: hasCacheActivity ? theme.success : void 0, children: (bodyWidth) => {
21721
21870
  const meterInner = Math.max(1, bodyWidth - 2);
21722
21871
  const dynamicMeter = renderMeter(cs.hitRatio, meterInner);
21723
- return /* @__PURE__ */ jsxs78(Fragment26, { children: [
21872
+ return /* @__PURE__ */ jsxs78(Fragment27, { children: [
21724
21873
  /* @__PURE__ */ jsx78(
21725
21874
  SidebarSectionHeader,
21726
21875
  {
@@ -21734,17 +21883,17 @@ function SidebarContent({
21734
21883
  badgeMuted: !hasCacheActivity
21735
21884
  }
21736
21885
  ),
21737
- hasCacheActivity ? /* @__PURE__ */ jsxs78(Fragment26, { children: [
21886
+ hasCacheActivity ? /* @__PURE__ */ jsxs78(Fragment27, { children: [
21738
21887
  /* @__PURE__ */ jsx78(Box, { width: bodyWidth, flexDirection: "row", children: /* @__PURE__ */ jsx78(Text, { color: theme.success, children: dynamicMeter }) }),
21739
21888
  bodyWidth >= 28 ? /* @__PURE__ */ jsx78(Box, { flexDirection: "row", width: bodyWidth, justifyContent: "space-between", children: /* @__PURE__ */ jsxs78(Text, { color: theme.textSecondary, wrap: "truncate", children: [
21740
21889
  "read ",
21741
21890
  /* @__PURE__ */ jsx78(Text, { color: theme.textPrimary, bold: true, children: fmtTok(cs.readTokens) }),
21742
- cs.writeTokens > 0 ? /* @__PURE__ */ jsxs78(Fragment26, { children: [
21891
+ cs.writeTokens > 0 ? /* @__PURE__ */ jsxs78(Fragment27, { children: [
21743
21892
  " \xB7 ",
21744
21893
  "write ",
21745
21894
  /* @__PURE__ */ jsx78(Text, { color: theme.textPrimary, bold: true, children: fmtTok(cs.writeTokens) })
21746
21895
  ] }) : null,
21747
- cs.savedUsd > 0 ? /* @__PURE__ */ jsxs78(Fragment26, { children: [
21896
+ cs.savedUsd > 0 ? /* @__PURE__ */ jsxs78(Fragment27, { children: [
21748
21897
  " \xB7 ",
21749
21898
  "saved",
21750
21899
  " ",
@@ -21753,7 +21902,7 @@ function SidebarContent({
21753
21902
  cs.savedUsd.toFixed(2)
21754
21903
  ] })
21755
21904
  ] }) : null
21756
- ] }) }) : /* @__PURE__ */ jsxs78(Fragment26, { children: [
21905
+ ] }) }) : /* @__PURE__ */ jsxs78(Fragment27, { children: [
21757
21906
  /* @__PURE__ */ jsxs78(Box, { flexDirection: "row", width: bodyWidth, justifyContent: "space-between", children: [
21758
21907
  /* @__PURE__ */ jsxs78(Text, { color: theme.textSecondary, wrap: "truncate", children: [
21759
21908
  "read ",
@@ -21783,7 +21932,7 @@ function SidebarContent({
21783
21932
  const isWarnLoad = (cpuPercent ?? 0) > 60 || (processMemory?.load ?? 0) > 0.6;
21784
21933
  const healthBadge = isHighLoad ? "HIGH" : isWarnLoad ? "WARN" : "HEALTHY";
21785
21934
  const healthColor = isHighLoad ? theme.error : isWarnLoad ? theme.warn : theme.success;
21786
- return /* @__PURE__ */ jsxs78(Fragment26, { children: [
21935
+ return /* @__PURE__ */ jsxs78(Fragment27, { children: [
21787
21936
  /* @__PURE__ */ jsx78(
21788
21937
  SidebarSectionHeader,
21789
21938
  {
@@ -21806,7 +21955,7 @@ function SidebarContent({
21806
21955
  innerWidth: bodyWidth
21807
21956
  }
21808
21957
  ) : null,
21809
- processMemory ? /* @__PURE__ */ jsxs78(Fragment26, { children: [
21958
+ processMemory ? /* @__PURE__ */ jsxs78(Fragment27, { children: [
21810
21959
  /* @__PURE__ */ jsx78(
21811
21960
  DialRow,
21812
21961
  {
@@ -21835,7 +21984,7 @@ function SidebarContent({
21835
21984
  {
21836
21985
  innerWidth,
21837
21986
  accent: running > 0 ? theme.monitor.fleet : theme.borderSubtle,
21838
- children: (bodyWidth) => /* @__PURE__ */ jsxs78(Fragment26, { children: [
21987
+ children: (bodyWidth) => /* @__PURE__ */ jsxs78(Fragment27, { children: [
21839
21988
  /* @__PURE__ */ jsx78(
21840
21989
  SidebarSectionHeader,
21841
21990
  {
@@ -21909,7 +22058,7 @@ function SidebarContent({
21909
22058
  {
21910
22059
  innerWidth,
21911
22060
  accent: mission.done === mission.total ? theme.success : theme.warn,
21912
- children: (bodyWidth) => /* @__PURE__ */ jsxs78(Fragment26, { children: [
22061
+ children: (bodyWidth) => /* @__PURE__ */ jsxs78(Fragment27, { children: [
21913
22062
  /* @__PURE__ */ jsx78(
21914
22063
  SidebarSectionHeader,
21915
22064
  {
@@ -21977,7 +22126,7 @@ function SidebarContent({
21977
22126
  ] })
21978
22127
  }
21979
22128
  ) : null,
21980
- ((liveSessions?.length ?? 0) > 0 || (resumeSessions?.length ?? 0) > 0) && !effectiveSidebarRoutes?.has("sessions") ? /* @__PURE__ */ jsx78(Card, { innerWidth, marginBottom: 0, accent: theme.success, children: (bodyWidth) => /* @__PURE__ */ jsxs78(Fragment26, { children: [
22129
+ ((liveSessions?.length ?? 0) > 0 || (resumeSessions?.length ?? 0) > 0) && !effectiveSidebarRoutes?.has("sessions") ? /* @__PURE__ */ jsx78(Card, { innerWidth, marginBottom: 0, accent: theme.success, children: (bodyWidth) => /* @__PURE__ */ jsxs78(Fragment27, { children: [
21981
22130
  /* @__PURE__ */ jsx78(
21982
22131
  SidebarSectionHeader,
21983
22132
  {
@@ -22138,7 +22287,7 @@ function SidebarWorklistRow({
22138
22287
  }
22139
22288
 
22140
22289
  // src/components/sidebar-panels-task.tsx
22141
- import { Fragment as Fragment27, jsx as jsx80, jsxs as jsxs80 } from "react/jsx-runtime";
22290
+ import { Fragment as Fragment28, jsx as jsx80, jsxs as jsxs80 } from "react/jsx-runtime";
22142
22291
  function PlanPanelSidebar({
22143
22292
  openCount,
22144
22293
  inProgressCount,
@@ -22343,7 +22492,7 @@ function ProcessListPanelSidebar({
22343
22492
  /* @__PURE__ */ jsx80(Text, { color: statusVisual2.color, children: statusVisual2.glyph }),
22344
22493
  /* @__PURE__ */ jsx80(Text, { color: theme.textPrimary, children: " " }),
22345
22494
  /* @__PURE__ */ jsx80(Text, { wrap: "truncate", children: trunc(p.name, Math.max(4, bodyWidth - 2 - (showPid ? displayWidth(pidLabel) + 1 : 0))) }),
22346
- showPid ? /* @__PURE__ */ jsxs80(Fragment27, { children: [
22495
+ showPid ? /* @__PURE__ */ jsxs80(Fragment28, { children: [
22347
22496
  /* @__PURE__ */ jsx80(Box, { flexGrow: 1 }),
22348
22497
  /* @__PURE__ */ jsx80(Text, { color: theme.textMuted, children: pidLabel })
22349
22498
  ] }) : null
@@ -22383,7 +22532,7 @@ function GoalPanelSidebar({
22383
22532
  goal.goalState.toUpperCase()
22384
22533
  ] }) : null,
22385
22534
  footer: "F9 details",
22386
- children: !goal ? /* @__PURE__ */ jsx80(EmptyState, { message: "no mission set", innerWidth: bodyWidth }) : /* @__PURE__ */ jsxs80(Fragment27, { children: [
22535
+ children: !goal ? /* @__PURE__ */ jsx80(EmptyState, { message: "no mission set", innerWidth: bodyWidth }) : /* @__PURE__ */ jsxs80(Fragment28, { children: [
22387
22536
  /* @__PURE__ */ jsx80(
22388
22537
  SidebarSectionHeader,
22389
22538
  {
@@ -22466,7 +22615,7 @@ function SessionsPanelSidebar({
22466
22615
  right: inner < PILL_MIN_INNER_WIDTH ? /* @__PURE__ */ jsx80(Text, { color: total > 0 ? theme.success : theme.textMuted, children: total }) : void 0,
22467
22616
  footer: "F10 details",
22468
22617
  children: [
22469
- live.length > 0 ? /* @__PURE__ */ jsxs80(Fragment27, { children: [
22618
+ live.length > 0 ? /* @__PURE__ */ jsxs80(Fragment28, { children: [
22470
22619
  /* @__PURE__ */ jsx80(
22471
22620
  SidebarSectionHeader,
22472
22621
  {
@@ -22489,7 +22638,7 @@ function SessionsPanelSidebar({
22489
22638
  " ",
22490
22639
  trunc(s2.projectName, Math.max(4, bodyWidth - (showAgentCount ? 6 : 2)))
22491
22640
  ] }),
22492
- showAgentCount ? /* @__PURE__ */ jsxs80(Fragment27, { children: [
22641
+ showAgentCount ? /* @__PURE__ */ jsxs80(Fragment28, { children: [
22493
22642
  /* @__PURE__ */ jsx80(Box, { flexGrow: 1 }),
22494
22643
  /* @__PURE__ */ jsxs80(Text, { color: theme.textMuted, children: [
22495
22644
  s2.agentCount,
@@ -22499,7 +22648,7 @@ function SessionsPanelSidebar({
22499
22648
  ] }, s2.sessionId);
22500
22649
  })
22501
22650
  ] }) : null,
22502
- resume.length > 0 ? /* @__PURE__ */ jsxs80(Fragment27, { children: [
22651
+ resume.length > 0 ? /* @__PURE__ */ jsxs80(Fragment28, { children: [
22503
22652
  /* @__PURE__ */ jsx80(
22504
22653
  SidebarSectionHeader,
22505
22654
  {
@@ -22535,7 +22684,7 @@ function SessionsPanelSidebar({
22535
22684
  ]
22536
22685
  }
22537
22686
  ),
22538
- showRelativeTime ? /* @__PURE__ */ jsxs80(Fragment27, { children: [
22687
+ showRelativeTime ? /* @__PURE__ */ jsxs80(Fragment28, { children: [
22539
22688
  /* @__PURE__ */ jsx80(Box, { flexGrow: 1 }),
22540
22689
  /* @__PURE__ */ jsx80(Text, { color: theme.textMuted, children: rel })
22541
22690
  ] }) : null
@@ -22623,7 +22772,7 @@ function KanbanPanelSidebar({
22623
22772
  }
22624
22773
 
22625
22774
  // src/components/sidebar-panels-workspace.tsx
22626
- import { Fragment as Fragment28, jsx as jsx81, jsxs as jsxs81 } from "react/jsx-runtime";
22775
+ import { Fragment as Fragment29, jsx as jsx81, jsxs as jsxs81 } from "react/jsx-runtime";
22627
22776
  function ProjectPickerSidebar({
22628
22777
  items,
22629
22778
  selected,
@@ -22783,14 +22932,14 @@ function AgentsPanelSidebar({
22783
22932
  /* @__PURE__ */ jsx81(Text, { color: theme.warn, children: running.length }),
22784
22933
  /* @__PURE__ */ jsx81(Text, { color: theme.textMuted, children: " " }),
22785
22934
  /* @__PURE__ */ jsx81(Text, { color: theme.success, children: done.length }),
22786
- failed.length > 0 ? /* @__PURE__ */ jsxs81(Fragment28, { children: [
22935
+ failed.length > 0 ? /* @__PURE__ */ jsxs81(Fragment29, { children: [
22787
22936
  /* @__PURE__ */ jsx81(Text, { color: theme.textMuted, children: " " }),
22788
22937
  /* @__PURE__ */ jsx81(Text, { color: theme.error, children: failed.length })
22789
22938
  ] }) : null
22790
22939
  ] }) : void 0,
22791
22940
  footer: `F3 details ${glyphs.dividerDiamond} $${totalCost.toFixed(4)}`,
22792
22941
  children: [
22793
- hotAgent ? /* @__PURE__ */ jsxs81(Fragment28, { children: [
22942
+ hotAgent ? /* @__PURE__ */ jsxs81(Fragment29, { children: [
22794
22943
  /* @__PURE__ */ jsx81(
22795
22944
  SidebarSectionHeader,
22796
22945
  {
@@ -22831,7 +22980,7 @@ function AgentsPanelSidebar({
22831
22980
  /* @__PURE__ */ jsx81(Text, { color: v.color, children: v.glyph }),
22832
22981
  /* @__PURE__ */ jsx81(Text, { color: theme.textPrimary, children: " " }),
22833
22982
  /* @__PURE__ */ jsx81(Text, { wrap: "truncate", children: name }),
22834
- showElapsed ? /* @__PURE__ */ jsxs81(Fragment28, { children: [
22983
+ showElapsed ? /* @__PURE__ */ jsxs81(Fragment29, { children: [
22835
22984
  /* @__PURE__ */ jsx81(Box, { flexGrow: 1 }),
22836
22985
  /* @__PURE__ */ jsx81(Text, { color: theme.textMuted, children: elapsedLabel })
22837
22986
  ] }) : null
@@ -22891,7 +23040,7 @@ function WorktreePanelSidebar({
22891
23040
  "D",
22892
23041
  merged
22893
23042
  ] }),
22894
- failed > 0 ? /* @__PURE__ */ jsxs81(Fragment28, { children: [
23043
+ failed > 0 ? /* @__PURE__ */ jsxs81(Fragment29, { children: [
22895
23044
  /* @__PURE__ */ jsx81(Text, { color: theme.textMuted, children: " " }),
22896
23045
  /* @__PURE__ */ jsxs81(Text, { color: theme.error, children: [
22897
23046
  "!",
@@ -22914,7 +23063,7 @@ function WorktreePanelSidebar({
22914
23063
  /* @__PURE__ */ jsx81(Text, { color: v.color, children: v.glyph }),
22915
23064
  /* @__PURE__ */ jsx81(Text, { color: theme.textPrimary, children: " " }),
22916
23065
  /* @__PURE__ */ jsx81(Text, { wrap: "truncate", children: branch }),
22917
- showDiff ? /* @__PURE__ */ jsxs81(Fragment28, { children: [
23066
+ showDiff ? /* @__PURE__ */ jsxs81(Fragment29, { children: [
22918
23067
  /* @__PURE__ */ jsx81(Box, { flexGrow: 1 }),
22919
23068
  /* @__PURE__ */ jsx81(Text, { color: theme.textMuted, children: diff })
22920
23069
  ] }) : null
@@ -23061,7 +23210,7 @@ function ConnectionsPanelSidebar({
23061
23210
  c.name,
23062
23211
  Math.max(3, bodyWidth - rowChrome - (lat ? displayWidth(lat) + 1 : 0))
23063
23212
  ) }),
23064
- lat ? /* @__PURE__ */ jsxs81(Fragment28, { children: [
23213
+ lat ? /* @__PURE__ */ jsxs81(Fragment29, { children: [
23065
23214
  /* @__PURE__ */ jsx81(Box, { flexGrow: 1 }),
23066
23215
  /* @__PURE__ */ jsx81(Text, { color, children: lat })
23067
23216
  ] }) : null
@@ -23124,7 +23273,7 @@ function WrongProxyPanelSidebar({
23124
23273
  )
23125
23274
  )
23126
23275
  ] }),
23127
- showLatency && latencyLabel ? /* @__PURE__ */ jsxs81(Fragment28, { children: [
23276
+ showLatency && latencyLabel ? /* @__PURE__ */ jsxs81(Fragment29, { children: [
23128
23277
  /* @__PURE__ */ jsx81(Box, { flexGrow: 1 }),
23129
23278
  /* @__PURE__ */ jsx81(Text, { color: theme.textMuted, children: latencyLabel })
23130
23279
  ] }) : null
@@ -23324,7 +23473,7 @@ function AppViewSidebar({
23324
23473
  }
23325
23474
 
23326
23475
  // src/components/input.tsx
23327
- import { memo as memo2, useEffect as useEffect22, useRef as useRef7, useState as useState22 } from "react";
23476
+ import { memo as memo2, useEffect as useEffect22, useRef as useRef7, useState as useState23 } from "react";
23328
23477
 
23329
23478
  // src/fn-keys.ts
23330
23479
  function fnKey(data) {
@@ -23545,7 +23694,7 @@ function isLeakedMouseInput(input) {
23545
23694
  }
23546
23695
 
23547
23696
  // src/components/composer-status-chip.tsx
23548
- import { Fragment as Fragment29, jsx as jsx83, jsxs as jsxs83 } from "react/jsx-runtime";
23697
+ import { Fragment as Fragment30, jsx as jsx83, jsxs as jsxs83 } from "react/jsx-runtime";
23549
23698
  var SPINNER_INTERVAL_MS2 = 1e3;
23550
23699
  var ACTIVITY_INTERVAL_MS = 130;
23551
23700
  var ACTIVITY_FRAMES_UNICODE = ["\xB7", "\u25E6", "\u2022", "\u25CF", "\u25C9", "\u25CF", "\u2022", "\u25E6"];
@@ -23620,7 +23769,7 @@ function composerStatusReservedWidth(status) {
23620
23769
  }
23621
23770
  function withPad(node, contentWidth, reservedWidth) {
23622
23771
  const pad = Math.max(0, reservedWidth - contentWidth);
23623
- return /* @__PURE__ */ jsxs83(Fragment29, { children: [
23772
+ return /* @__PURE__ */ jsxs83(Fragment30, { children: [
23624
23773
  node,
23625
23774
  pad > 0 ? /* @__PURE__ */ jsx83(Text, { children: " ".repeat(pad) }) : null
23626
23775
  ] });
@@ -23704,7 +23853,7 @@ function ComposerStatusChip({
23704
23853
  }
23705
23854
 
23706
23855
  // src/components/input.tsx
23707
- import { Fragment as Fragment30, jsx as jsx84, jsxs as jsxs84 } from "react/jsx-runtime";
23856
+ import { Fragment as Fragment31, jsx as jsx84, jsxs as jsxs84 } from "react/jsx-runtime";
23708
23857
  var DEFAULT_INPUT_PROMPT = `${glyphs.prompt} `;
23709
23858
  function ComposerTopRail({
23710
23859
  width,
@@ -23729,7 +23878,7 @@ function ComposerTopRail({
23729
23878
  const remaining = Math.max(0, available - titleW - statusSectionW);
23730
23879
  return /* @__PURE__ */ jsxs84(Text, { bold: true, color: disabled ? theme.error : theme.brandPrimary, children: [
23731
23880
  "\u256D",
23732
- title ? /* @__PURE__ */ jsxs84(Fragment30, { children: [
23881
+ title ? /* @__PURE__ */ jsxs84(Fragment31, { children: [
23733
23882
  /* @__PURE__ */ jsx84(Text, { children: "\u2500 " }),
23734
23883
  staticMode ? /* @__PURE__ */ jsx84(Text, { bold: true, children: glyphs.brand }) : /* @__PURE__ */ jsx84(ComposerActivityIcon, { status, idleGlyph: glyphs.brand, disabled }),
23735
23884
  /* @__PURE__ */ jsx84(Text, { children: ` ${title}` }),
@@ -24020,7 +24169,7 @@ var Input = memo2(function Input2({
24020
24169
  }
24021
24170
  }
24022
24171
  }
24023
- const [vScroll, setVScroll] = useState22(0);
24172
+ const [vScroll, setVScroll] = useState23(0);
24024
24173
  const vScrollRef = useRef7(vScroll);
24025
24174
  vScrollRef.current = vScroll;
24026
24175
  const clampedScroll = needsScroll ? Math.max(0, Math.min(vScroll, rows.length - MAX_VISIBLE_ROWS)) : 0;
@@ -24092,7 +24241,7 @@ import {
24092
24241
  useLayoutEffect,
24093
24242
  useMemo as useMemo10,
24094
24243
  useRef as useRef10,
24095
- useState as useState23
24244
+ useState as useState24
24096
24245
  } from "react";
24097
24246
 
24098
24247
  // src/height-cache.ts
@@ -24845,9 +24994,17 @@ function liveToolStreamCopyHit(opts) {
24845
24994
 
24846
24995
  // src/components/history/tool-group.tsx
24847
24996
  import { memo as memo3 } from "react";
24848
- import { Fragment as Fragment31, jsx as jsx86, jsxs as jsxs85 } from "react/jsx-runtime";
24997
+ import { Fragment as Fragment32, jsx as jsx86, jsxs as jsxs85 } from "react/jsx-runtime";
24849
24998
  var MAX_TOOL_GROUP_ENTRIES = 12;
24850
- var STRUCTURED_DIFF_TOOLS = /* @__PURE__ */ new Set(["edit", "write", "replace", "diff", "patch"]);
24999
+ var STRUCTURED_DIFF_TOOLS = /* @__PURE__ */ new Set([
25000
+ "edit",
25001
+ "replace_file_content",
25002
+ "write",
25003
+ "write_to_file",
25004
+ "replace",
25005
+ "diff",
25006
+ "patch"
25007
+ ]);
24851
25008
  function hasInjectedMemory(entry) {
24852
25009
  return resolveEntrySage(entry.output, entry.sageLines).sageLines.length > 0;
24853
25010
  }
@@ -24878,13 +25035,19 @@ function estimateRenderGroupRows(group, contentWidth, showSageMemoryInject) {
24878
25035
  const { cleanOutput, sageLines } = resolveEntrySage(entry.output, entry.sageLines);
24879
25036
  const memoryLines = sageLines.slice(1);
24880
25037
  const panelContentWidth = Math.max(1, contentWidth - 4);
24881
- const sagePanelRows = showSageMemoryInject === false || memoryLines.length === 0 ? 0 : 4 + memoryLines.reduce((sum, line) => {
25038
+ const headerWidth = displayWidth(
25039
+ `\u{1F9E0} SAGE MEMORY INJECTED \xB7 ${entry.name} ${memoryLines.length} ${memoryLines.length === 1 ? "memory" : "memories"}`
25040
+ );
25041
+ const headerRows = Math.max(1, Math.ceil(headerWidth / panelContentWidth));
25042
+ const sagePanelRows = showSageMemoryInject === false || memoryLines.length === 0 ? 0 : 2 + headerRows + memoryLines.reduce((sum, line, index) => {
24882
25043
  const parsed = parseSageMemoryLine(line);
24883
25044
  const bodySource = parsed ? parsed.text : line;
24884
25045
  const bodyWidth = displayWidth(sanitizeTerminalText(bodySource));
24885
25046
  const bodyRows = Math.max(1, Math.ceil(bodyWidth / panelContentWidth));
24886
- const kvRows = panelContentWidth < 48 ? 2 : 1;
24887
- return sum + 1 + bodyRows + kvRows;
25047
+ const badgeCount = (parsed?.id ? 1 : 0) + (parsed?.anchor ? 1 : 0) + (parsed?.relation ? 1 : 0) + (parsed?.tags && parsed.tags.length > 0 ? 1 : 0);
25048
+ const kvRows = panelContentWidth < 50 ? badgeCount : panelContentWidth < 70 ? Math.max(1, Math.ceil(badgeCount / 2)) : 1;
25049
+ const sep2 = index > 0 ? 1 : 0;
25050
+ return sum + 1 + bodyRows + kvRows + sep2;
24888
25051
  }, 0);
24889
25052
  if (entry.resultRenderMode === "simple") return 3 + sagePanelRows;
24890
25053
  if (STRUCTURED_DIFF_TOOLS.has(entry.name)) {
@@ -25058,7 +25221,7 @@ function ToolGroupItem({
25058
25221
  return /* @__PURE__ */ jsxs85(Text, { children: [
25059
25222
  /* @__PURE__ */ jsx86(Text, { bold: true, color: statusColor3, children: statusMark }),
25060
25223
  /* @__PURE__ */ jsx86(Text, { dimColor: true, children: ` #${index}` }),
25061
- argPreview ? /* @__PURE__ */ jsxs85(Fragment31, { children: [
25224
+ argPreview ? /* @__PURE__ */ jsxs85(Fragment32, { children: [
25062
25225
  /* @__PURE__ */ jsx86(Text, { children: " " }),
25063
25226
  /* @__PURE__ */ jsx86(Text, { color: theme.textSecondary, children: argPreview })
25064
25227
  ] }) : null,
@@ -25642,7 +25805,7 @@ function useActiveTheme() {
25642
25805
  }
25643
25806
 
25644
25807
  // src/components/history/banner.tsx
25645
- import { Fragment as Fragment32, jsx as jsx89, jsxs as jsxs87 } from "react/jsx-runtime";
25808
+ import { Fragment as Fragment33, jsx as jsx89, jsxs as jsxs87 } from "react/jsx-runtime";
25646
25809
  var STACK_ORANGE2 = () => theme.brandPrimary;
25647
25810
  var SIGNAL_PINK = () => theme.brandAccent;
25648
25811
  var BORDER = () => theme.borderDefault;
@@ -25792,7 +25955,7 @@ function ProfileRow({
25792
25955
  return /* @__PURE__ */ jsxs87(Text, { children: [
25793
25956
  /* @__PURE__ */ jsx89(Text, { color: STACK_ORANGE2(), children: icon }),
25794
25957
  /* @__PURE__ */ jsx89(Text, { color: STACK_ORANGE2(), bold: true, children: ` ${trunc3(label, labelWidth).padEnd(labelWidth)} ` }),
25795
- segIdx >= 0 && profileSegment ? /* @__PURE__ */ jsxs87(Fragment32, { children: [
25958
+ segIdx >= 0 && profileSegment ? /* @__PURE__ */ jsxs87(Fragment33, { children: [
25796
25959
  /* @__PURE__ */ jsx89(Text, { color: MUTED(), children: displayPath.slice(0, segIdx) }),
25797
25960
  /* @__PURE__ */ jsx89(Text, { color: STACK_ORANGE2(), bold: true, children: profileSegment }),
25798
25961
  /* @__PURE__ */ jsx89(Text, { color: MUTED(), children: displayPath.slice(segIdx + profileSegment.length) })
@@ -25808,7 +25971,7 @@ function Footer({
25808
25971
  return /* @__PURE__ */ jsx89(Box, { flexDirection: "column", alignItems: "center", marginTop: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs87(Text, { children: [
25809
25972
  /* @__PURE__ */ jsx89(Text, { color: SIGNAL_PINK(), children: "\u25C6 " }),
25810
25973
  /* @__PURE__ */ jsx89(Text, { dimColor: true, children: OSC8_WRONGSTACK }),
25811
- !compact || contentWidth >= 35 ? /* @__PURE__ */ jsxs87(Fragment32, { children: [
25974
+ !compact || contentWidth >= 35 ? /* @__PURE__ */ jsxs87(Fragment33, { children: [
25812
25975
  /* @__PURE__ */ jsx89(Text, { dimColor: true, children: " \xB7 " }),
25813
25976
  /* @__PURE__ */ jsx89(Text, { color: STACK_ORANGE2(), children: "\u2605 " }),
25814
25977
  /* @__PURE__ */ jsx89(Text, { dimColor: true, children: OSC8_GITHUB })
@@ -25904,10 +26067,10 @@ function Banner({
25904
26067
  ] }) : null
25905
26068
  ] }),
25906
26069
  /* @__PURE__ */ jsx89(Box, { justifyContent: "center", marginTop: compact ? 0 : 1, children: /* @__PURE__ */ jsx89(BrandMark, { pinkRow }) }),
25907
- compact ? /* @__PURE__ */ jsxs87(Fragment32, { children: [
26070
+ compact ? /* @__PURE__ */ jsxs87(Fragment33, { children: [
25908
26071
  /* @__PURE__ */ jsx89(Box, { justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx89(GradientText, { text: "WrongStack" }) }),
25909
26072
  /* @__PURE__ */ jsx89(Box, { justifyContent: "center", children: /* @__PURE__ */ jsx89(Text, { color: MUTED(), children: trunc3("TERMINAL AI ENGINE", contentWidth) }) })
25910
- ] }) : /* @__PURE__ */ jsxs87(Fragment32, { children: [
26073
+ ] }) : /* @__PURE__ */ jsxs87(Fragment33, { children: [
25911
26074
  /* @__PURE__ */ jsx89(Box, { justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx89(PixelWordmark, {}) }),
25912
26075
  /* @__PURE__ */ jsx89(Box, { justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx89(Text, { color: MUTED(), italic: true, children: "BUILT ON THE WRONG STACK. SHIPPED ANYWAY." }) })
25913
26076
  ] }),
@@ -26144,7 +26307,7 @@ function SageKv({ label, value }) {
26144
26307
  }
26145
26308
 
26146
26309
  // src/components/history/tool-card.tsx
26147
- import { Fragment as Fragment33, jsx as jsx92, jsxs as jsxs90 } from "react/jsx-runtime";
26310
+ import { Fragment as Fragment34, jsx as jsx92, jsxs as jsxs90 } from "react/jsx-runtime";
26148
26311
  function ToolCard({
26149
26312
  glyph: glyph2,
26150
26313
  color,
@@ -26181,7 +26344,7 @@ function ToolCard({
26181
26344
  visibleDetail ? /* @__PURE__ */ jsx92(Text, { color: theme.textSecondary, children: ` ${visibleDetail}` }) : null,
26182
26345
  visibleMeta ? /* @__PURE__ */ jsx92(Text, { color: theme.textMuted, children: ` \xB7 ${visibleMeta}` }) : null
26183
26346
  ] }),
26184
- hasBody ? /* @__PURE__ */ jsxs90(Fragment33, { children: [
26347
+ hasBody ? /* @__PURE__ */ jsxs90(Fragment34, { children: [
26185
26348
  /* @__PURE__ */ jsx92(
26186
26349
  Box,
26187
26350
  {
@@ -26229,7 +26392,8 @@ function ToolEntry({
26229
26392
  entry.ok,
26230
26393
  entry.input
26231
26394
  );
26232
- const diff2 = entry.ok ? extractDiffPreview(entry.name, outputForFormatting, entry.input) : void 0;
26395
+ const diffSource = entry.name === "replace_file_content" ? "edit" : entry.name === "write_to_file" ? "write" : entry.name;
26396
+ const diff2 = entry.ok ? extractDiffPreview(diffSource, outputForFormatting, entry.input) : void 0;
26233
26397
  const multiDiffs2 = entry.ok && !diff2 && (entry.name === "replace" || entry.name === "diff" || entry.name === "patch") ? extractMultiFileDiffs(entry.name, outputForFormatting, entry.input) : void 0;
26234
26398
  const sizeChip2 = (() => {
26235
26399
  if (!entry.ok) return "";
@@ -26247,24 +26411,28 @@ function ToolEntry({
26247
26411
  })();
26248
26412
  const mutation2 = (() => {
26249
26413
  const name = entry.name;
26250
- if (name !== "edit" && name !== "write" && name !== "patch" && name !== "replace") {
26414
+ if (name !== "edit" && name !== "replace_file_content" && name !== "write" && name !== "write_to_file" && name !== "patch" && name !== "replace" && name !== "diff") {
26251
26415
  return void 0;
26252
26416
  }
26253
26417
  if (!entry.ok || !diff2 && !multiDiffs2) return void 0;
26254
26418
  const inputObj = entry.input && typeof entry.input === "object" ? entry.input : void 0;
26255
26419
  const outJson = tryParseJson(outputForFormatting.trim());
26256
26420
  const outObj = outJson && typeof outJson === "object" ? outJson : void 0;
26257
- const created = name === "write" && (outObj?.["created"] === true || /^[^\n]*\bcreated=true\b/.test(outputForFormatting));
26258
- const verb = created ? "Write" : "Update";
26259
- const path12 = stringOf(inputObj?.["path"]) ?? stringOf(outObj?.["path"]);
26421
+ const created = (name === "write" || name === "write_to_file") && (outObj?.["created"] === true || /^[^\n]*\bcreated=true\b/.test(outputForFormatting));
26422
+ const verb = name === "diff" ? "Diff" : created ? "Write" : "Update";
26423
+ const outFiles = Array.isArray(outObj?.["files"]) ? outObj?.["files"] : void 0;
26424
+ const firstOutFile = outFiles && outFiles.length > 0 ? stringOf(outFiles[0]) : void 0;
26425
+ const path12 = stringOf(inputObj?.["path"]) ?? stringOf(inputObj?.["TargetFile"]) ?? stringOf(inputObj?.["file"]) ?? stringOf(inputObj?.["files"]) ?? stringOf(inputObj?.["a"]) ?? stringOf(outObj?.["path"]) ?? firstOutFile;
26260
26426
  const agg = multiDiffs2 ? summarizeMultiFileDiffs(multiDiffs2) : void 0;
26261
- const target = multiDiffs2 ? agg?.fileCount === 1 ? multiDiffs2[0].path : `${agg?.fileCount ?? multiDiffs2.length} files` : path12 ?? "file";
26427
+ const target = multiDiffs2 ? agg?.fileCount === 1 ? multiDiffs2[0].path : `${agg?.fileCount ?? multiDiffs2.length} files` : path12 ?? "changes";
26262
26428
  return {
26263
26429
  verb,
26264
26430
  target,
26265
26431
  added: agg ? agg.added : diff2?.added ?? 0,
26266
26432
  removed: agg ? agg.removed : diff2?.removed ?? 0,
26267
- lang: langFromPath(multiDiffs2 ? "" : path12 ?? "")
26433
+ lang: langFromPath(
26434
+ multiDiffs2 && multiDiffs2.length > 1 ? "" : multiDiffs2?.[0]?.path ?? path12 ?? ""
26435
+ )
26268
26436
  };
26269
26437
  })();
26270
26438
  return {
@@ -26438,7 +26606,7 @@ var USER_LABEL = "\u{1F464} USER ";
26438
26606
  var INFO_PREFIX = "\u2139 ";
26439
26607
 
26440
26608
  // src/components/history/entry.tsx
26441
- import { Fragment as Fragment34, jsx as jsx94, jsxs as jsxs92 } from "react/jsx-runtime";
26609
+ import { Fragment as Fragment35, jsx as jsx94, jsxs as jsxs92 } from "react/jsx-runtime";
26442
26610
  var Entry = React7.memo(function Entry2({
26443
26611
  entry,
26444
26612
  termWidth,
@@ -26487,7 +26655,7 @@ var Entry = React7.memo(function Entry2({
26487
26655
  /* @__PURE__ */ jsx94(Text, { bold: true, color: theme.user, children: USER_LABEL }),
26488
26656
  /* @__PURE__ */ jsx94(Text, { color: "white", children: sanitizeTerminalText(entry.text) }),
26489
26657
  entry.queued ? /* @__PURE__ */ jsx94(Text, { dimColor: true, children: " (queued)" }) : null,
26490
- entry.pasteContent ? /* @__PURE__ */ jsxs92(Fragment34, { children: [
26658
+ entry.pasteContent ? /* @__PURE__ */ jsxs92(Fragment35, { children: [
26491
26659
  entry.text ? "\n" : null,
26492
26660
  /* @__PURE__ */ jsxs92(Text, { dimColor: true, children: [
26493
26661
  " \u21B3 ",
@@ -26784,7 +26952,7 @@ var Entry = React7.memo(function Entry2({
26784
26952
  /* @__PURE__ */ jsx94(Text, { bold: true, color: entry.agentColor, children: sanitizeTerminalText(entry.agentLabel) }),
26785
26953
  /* @__PURE__ */ jsx94(Text, { children: " " }),
26786
26954
  /* @__PURE__ */ jsx94(Text, { color: theme.textSecondary, children: lines[0] ?? "" }),
26787
- entry.detail ? /* @__PURE__ */ jsxs92(Fragment34, { children: [
26955
+ entry.detail ? /* @__PURE__ */ jsxs92(Fragment35, { children: [
26788
26956
  /* @__PURE__ */ jsx94(Text, { color: theme.textMuted, children: " \xB7 " }),
26789
26957
  /* @__PURE__ */ jsx94(Text, { color: theme.textMuted, children: sanitizeTerminalText(entry.detail) })
26790
26958
  ] }) : null
@@ -26799,7 +26967,7 @@ var Entry = React7.memo(function Entry2({
26799
26967
  });
26800
26968
 
26801
26969
  // src/components/history/index.tsx
26802
- import { Fragment as Fragment35, jsx as jsx95, jsxs as jsxs93 } from "react/jsx-runtime";
26970
+ import { Fragment as Fragment36, jsx as jsx95, jsxs as jsxs93 } from "react/jsx-runtime";
26803
26971
  var History = memo6(function History2({
26804
26972
  entries,
26805
26973
  generation,
@@ -26860,7 +27028,7 @@ var History = memo6(function History2({
26860
27028
  const staticKey = `${generation ?? 0}-${staticRevision}-${presentationKey}`;
26861
27029
  const staticEntries = pendingEntries;
26862
27030
  void toolStream;
26863
- return /* @__PURE__ */ jsxs93(Fragment35, { children: [
27031
+ return /* @__PURE__ */ jsxs93(Fragment36, { children: [
26864
27032
  /* @__PURE__ */ jsx95(Static, { items: staticEntries, children: (entry) => /* @__PURE__ */ jsx95(Box, { marginBottom: entry.kind === "turn-summary" ? 1 : 0, children: /* @__PURE__ */ jsx95(
26865
27033
  Entry,
26866
27034
  {
@@ -27273,6 +27441,7 @@ var MAX_UNDERFILL_BUMPS = 8;
27273
27441
  var ScrollableHistory = memo7(function ScrollableHistory2({
27274
27442
  entries,
27275
27443
  toolStream,
27444
+ streamingText,
27276
27445
  viewportRows,
27277
27446
  controllerRef,
27278
27447
  onScrollInfo,
@@ -27292,7 +27461,7 @@ var ScrollableHistory = memo7(function ScrollableHistory2({
27292
27461
  const raw = stdout?.columns ?? 80;
27293
27462
  return maxWidth ? Math.min(raw, maxWidth) : raw;
27294
27463
  }, [stdout, maxWidth]);
27295
- const [viewportWidth, setViewportWidth] = useState23(resolveViewportWidth);
27464
+ const [viewportWidth, setViewportWidth] = useState24(resolveViewportWidth);
27296
27465
  const termWidth = useMemo10(
27297
27466
  () => Math.max(1, viewportWidth - SCROLLBAR_HIT_WIDTH),
27298
27467
  [viewportWidth]
@@ -27309,6 +27478,8 @@ var ScrollableHistory = memo7(function ScrollableHistory2({
27309
27478
  }, [stdout, resolveViewportWidth]);
27310
27479
  const toolTail = toolStream?.text ? tailForDisplay(toolStream.text, MAX_STREAM_DISPLAY_CHARS) : "";
27311
27480
  const toolTailHeight = toolTail && toolStream ? toolStreamBoxHeight(toolStream.name) : 0;
27481
+ const assistantTail = streamingText ? tailForDisplay(streamingText, MAX_STREAM_DISPLAY_CHARS) : "";
27482
+ const assistantTailHeight = assistantTail ? assistantStreamBoxHeight() : 0;
27312
27483
  const groupedEntries = useMemo10(() => groupEntries(entries), [entries]);
27313
27484
  const groupIds = useMemo10(() => groupedEntries.map(renderGroupId), [groupedEntries]);
27314
27485
  const groupIdsKey = groupIds.join(",");
@@ -27395,8 +27566,8 @@ var ScrollableHistory = memo7(function ScrollableHistory2({
27395
27566
  preparedEstimateWidthRef.current = termWidth;
27396
27567
  }
27397
27568
  const vp = Math.max(1, viewportRows);
27398
- const [anchor, setAnchor] = useState23(null);
27399
- const [mountBump, setMountBump] = useState23(0);
27569
+ const [anchor, setAnchor] = useState24(null);
27570
+ const [mountBump, setMountBump] = useState24(0);
27400
27571
  const prevTermWidthRef = useRef10(termWidth);
27401
27572
  if (prevTermWidthRef.current !== termWidth) {
27402
27573
  prevTermWidthRef.current = termWidth;
@@ -27407,12 +27578,12 @@ var ScrollableHistory = memo7(function ScrollableHistory2({
27407
27578
  prevVpRef.current = viewportRows;
27408
27579
  setMountBump(0);
27409
27580
  }
27410
- const [, setMeasureTick] = useState23(0);
27581
+ const [, setMeasureTick] = useState24(0);
27411
27582
  const geometry = {
27412
27583
  cache: heightCache,
27413
27584
  groupCount: groupedEntries.length,
27414
27585
  viewportRows: vp,
27415
- tailRows: toolTailHeight
27586
+ tailRows: toolTailHeight + assistantTailHeight
27416
27587
  };
27417
27588
  const groupIndexById = useMemo10(() => {
27418
27589
  const indexes = /* @__PURE__ */ new Map();
@@ -27481,12 +27652,13 @@ var ScrollableHistory = memo7(function ScrollableHistory2({
27481
27652
  historyTotalRows: totalRows
27482
27653
  });
27483
27654
  const offsetFromBottom = scrolled ? Math.max(0, maxTopRow(geometry) - anchorTopRow(geometry, effectiveAnchor)) : 0;
27655
+ const mountedTailRows = plan.mountTail ? toolTailHeight + assistantTailHeight : 0;
27484
27656
  const copyRegistry = buildCopyRegistry({
27485
27657
  renderGroups,
27486
27658
  heightCache,
27487
27659
  scrolled,
27488
27660
  clip: clip2,
27489
- tailRows: plan.mountTail ? toolTailHeight : 0,
27661
+ tailRows: mountedTailRows,
27490
27662
  viewportRows: vp,
27491
27663
  iconCol: termWidth,
27492
27664
  showModelReasoning,
@@ -27500,7 +27672,7 @@ var ScrollableHistory = memo7(function ScrollableHistory2({
27500
27672
  heightCache,
27501
27673
  scrolled,
27502
27674
  clip: clip2,
27503
- tailRows: plan.mountTail ? toolTailHeight : 0,
27675
+ tailRows: mountedTailRows,
27504
27676
  viewportRows: vp,
27505
27677
  showModelReasoning
27506
27678
  });
@@ -27642,6 +27814,13 @@ var ScrollableHistory = memo7(function ScrollableHistory2({
27642
27814
  startedAt: toolStream.startedAt,
27643
27815
  termWidth
27644
27816
  }
27817
+ ) : null,
27818
+ plan.mountTail && assistantTail ? /* @__PURE__ */ jsx97(
27819
+ AssistantStreamBox,
27820
+ {
27821
+ text: assistantTail,
27822
+ termWidth
27823
+ }
27645
27824
  ) : null
27646
27825
  ] })
27647
27826
  }
@@ -27662,7 +27841,7 @@ var ScrollableHistory = memo7(function ScrollableHistory2({
27662
27841
 
27663
27842
  // src/hooks/use-sidebar-panel-data.ts
27664
27843
  import { getProcessRegistry as getProcessRegistry3 } from "@wrongstack/tools";
27665
- import { useEffect as useEffect26, useState as useState24 } from "react";
27844
+ import { useEffect as useEffect26, useState as useState25 } from "react";
27666
27845
  function sameList(a, b, eq) {
27667
27846
  if (a === b) return true;
27668
27847
  if (a.length !== b.length) return false;
@@ -27672,7 +27851,7 @@ function sameList(a, b, eq) {
27672
27851
  return true;
27673
27852
  }
27674
27853
  function useSidebarProcessList(enabled = true) {
27675
- const [data, setData] = useState24({ activeCount: 0, totalCount: 0, processes: [] });
27854
+ const [data, setData] = useState25({ activeCount: 0, totalCount: 0, processes: [] });
27676
27855
  useEffect26(() => {
27677
27856
  if (!enabled) return;
27678
27857
  const read = () => {
@@ -27700,7 +27879,7 @@ function useSidebarProcessList(enabled = true) {
27700
27879
  return data;
27701
27880
  }
27702
27881
  function useSidebarConnections(projectRoot, enabled = true) {
27703
- const [connections, setConnections] = useState24([]);
27882
+ const [connections, setConnections] = useState25([]);
27704
27883
  useEffect26(() => {
27705
27884
  if (!enabled) return;
27706
27885
  let cancelled = false;
@@ -27740,7 +27919,7 @@ function setProxyData(setData, next) {
27740
27919
  );
27741
27920
  }
27742
27921
  function useSidebarWrongProxy(url, enabled = true) {
27743
- const [data, setData] = useState24(null);
27922
+ const [data, setData] = useState25(null);
27744
27923
  useEffect26(() => {
27745
27924
  if (!enabled || !url) {
27746
27925
  setData(null);
@@ -27809,7 +27988,7 @@ function useSidebarWrongProxy(url, enabled = true) {
27809
27988
  return data;
27810
27989
  }
27811
27990
  function useSidebarKanban(projectRoot, enabled = true) {
27812
- const [data, setData] = useState24({ columns: [], totalActive: 0, activeCardTitles: [] });
27991
+ const [data, setData] = useState25({ columns: [], totalActive: 0, activeCardTitles: [] });
27813
27992
  useEffect26(() => {
27814
27993
  if (!enabled) return;
27815
27994
  let cancelled = false;
@@ -27935,6 +28114,7 @@ function AppView({ host, runtime }) {
27935
28114
  {
27936
28115
  entries: state.entries,
27937
28116
  toolStream: state.toolStream,
28117
+ streamingText: state.streamingText,
27938
28118
  viewportRows: state.viewportRows,
27939
28119
  maxWidth: mainColumnWidth,
27940
28120
  controllerRef: historyScrollRef,
@@ -40536,7 +40716,7 @@ function handleCollabDone(event, dispatch, stateRef) {
40536
40716
  }
40537
40717
 
40538
40718
  // src/hooks/use-enhance-runtime-state.ts
40539
- import { useEffect as useEffect37, useRef as useRef20, useState as useState25 } from "react";
40719
+ import { useEffect as useEffect37, useRef as useRef20, useState as useState26 } from "react";
40540
40720
  function useEnhanceRuntimeState({
40541
40721
  enhanceEnabled,
40542
40722
  midRunSendPicker
@@ -40549,11 +40729,11 @@ function useEnhanceRuntimeState({
40549
40729
  const enhanceAbortRef = useRef20(null);
40550
40730
  const enhanceCancelledRef = useRef20(false);
40551
40731
  const enhanceOriginalRef = useRef20("");
40552
- const [enhanceCountdown, setEnhanceCountdown] = useState25(null);
40553
- const [enhanceStartedAt, setEnhanceStartedAt] = useState25(null);
40554
- const [enhanceDurationMs, setEnhanceDurationMs] = useState25(null);
40555
- const [refineProviderId, setRefineProviderId] = useState25(null);
40556
- const [refineModel, setRefineModel] = useState25(null);
40732
+ const [enhanceCountdown, setEnhanceCountdown] = useState26(null);
40733
+ const [enhanceStartedAt, setEnhanceStartedAt] = useState26(null);
40734
+ const [enhanceDurationMs, setEnhanceDurationMs] = useState26(null);
40735
+ const [refineProviderId, setRefineProviderId] = useState26(null);
40736
+ const [refineModel, setRefineModel] = useState26(null);
40557
40737
  return {
40558
40738
  enhanceEnabledRef,
40559
40739
  midRunSendPickerRef,
@@ -40894,7 +41074,7 @@ function fileReadContract(filePath, bytes) {
40894
41074
 
40895
41075
  // src/hooks/use-git-session-status.ts
40896
41076
  import { watchProjectTree } from "@wrongstack/core/utils";
40897
- import { useEffect as useEffect40, useRef as useRef22, useState as useState26 } from "react";
41077
+ import { useEffect as useEffect40, useRef as useRef22, useState as useState27 } from "react";
40898
41078
 
40899
41079
  // src/git-info.ts
40900
41080
  import { spawn } from "node:child_process";
@@ -40991,7 +41171,7 @@ function useGitSessionStatus({
40991
41171
  setSessionCount,
40992
41172
  hiddenItems = []
40993
41173
  }) {
40994
- const [gitInfo, setGitInfo] = useState26(null);
41174
+ const [gitInfo, setGitInfo] = useState27(null);
40995
41175
  const previousBranchRef = useRef22(null);
40996
41176
  const gitHidden = hiddenItems.includes("git");
40997
41177
  useEffect40(() => {
@@ -41086,7 +41266,7 @@ function useHelpPanel(dispatch, slashRegistry) {
41086
41266
  // src/hooks/use-history-archive.ts
41087
41267
  import * as fsp2 from "node:fs/promises";
41088
41268
  import * as path6 from "node:path";
41089
- import { useCallback as useCallback16, useEffect as useEffect41, useRef as useRef23, useState as useState27 } from "react";
41269
+ import { useCallback as useCallback16, useEffect as useEffect41, useRef as useRef23, useState as useState28 } from "react";
41090
41270
 
41091
41271
  // src/history-archive.ts
41092
41272
  import * as fsp from "node:fs/promises";
@@ -41248,7 +41428,7 @@ function useHistoryArchive({
41248
41428
  const loadingRef = useRef23(false);
41249
41429
  const entriesRef = useRef23(entries);
41250
41430
  entriesRef.current = entries;
41251
- const [archiveGeneration, setArchiveGeneration] = useState27(0);
41431
+ const [archiveGeneration, setArchiveGeneration] = useState28(0);
41252
41432
  useEffect41(() => {
41253
41433
  if (!sessionsDir || !sessionId) return;
41254
41434
  let disposed = false;
@@ -41349,14 +41529,14 @@ function useHistoryCopyNotice(dispatch) {
41349
41529
  }
41350
41530
 
41351
41531
  // src/hooks/use-history-viewport-sync.ts
41352
- import { useEffect as useEffect43, useLayoutEffect as useLayoutEffect2, useRef as useRef25, useState as useState28 } from "react";
41532
+ import { useEffect as useEffect43, useLayoutEffect as useLayoutEffect2, useRef as useRef25, useState as useState29 } from "react";
41353
41533
  function useHistoryViewportSync(input) {
41354
41534
  const { stdoutRows, viewportRows, setViewportRows } = input;
41355
41535
  const bottomRegionRef = useRef25(null);
41356
41536
  const statusBarWrapRef = useRef25(null);
41357
41537
  const belowStatusBarRef = useRef25(null);
41358
- const [termRows, setTermRows] = useState28(stdoutRows ?? 24);
41359
- const [statusBarRows, setStatusBarRows] = useState28(2);
41538
+ const [termRows, setTermRows] = useState29(stdoutRows ?? 24);
41539
+ const [statusBarRows, setStatusBarRows] = useState29(2);
41360
41540
  useEffect43(() => {
41361
41541
  const handleResize = () => setTermRows(process.stdout.rows ?? 24);
41362
41542
  process.stdout.prependListener("resize", handleResize);
@@ -41700,9 +41880,9 @@ function useInterruptLadder({
41700
41880
  }
41701
41881
 
41702
41882
  // src/hooks/use-kanban-board-focus.ts
41703
- import { useRef as useRef29, useState as useState29 } from "react";
41883
+ import { useRef as useRef29, useState as useState30 } from "react";
41704
41884
  function useKanbanBoardFocus() {
41705
- const [focusedBoardId, setFocusedBoardId] = useState29(null);
41885
+ const [focusedBoardId, setFocusedBoardId] = useState30(null);
41706
41886
  const boardFocusRef = useRef29(null);
41707
41887
  if (!boardFocusRef.current) {
41708
41888
  boardFocusRef.current = {
@@ -41747,9 +41927,9 @@ function useLiveSettingsState({
41747
41927
  }
41748
41928
 
41749
41929
  // src/hooks/use-live-todos.ts
41750
- import { useEffect as useEffect48, useState as useState30 } from "react";
41930
+ import { useEffect as useEffect48, useState as useState31 } from "react";
41751
41931
  function useLiveTodos(context) {
41752
- const [todos, setTodos] = useState30(() => [...context.todos]);
41932
+ const [todos, setTodos] = useState31(() => [...context.todos]);
41753
41933
  useEffect48(() => {
41754
41934
  setTodos([...context.todos]);
41755
41935
  return context.state.onChange((change) => {
@@ -41760,16 +41940,16 @@ function useLiveTodos(context) {
41760
41940
  }
41761
41941
 
41762
41942
  // src/hooks/use-mailbox-view-model.ts
41763
- import { useEffect as useEffect49, useState as useState31 } from "react";
41943
+ import { useEffect as useEffect49, useState as useState32 } from "react";
41764
41944
  function useMailboxViewModel(events) {
41765
- const [mailboxStatus, setMailboxStatus] = useState31({
41945
+ const [mailboxStatus, setMailboxStatus] = useState32({
41766
41946
  unread: 0,
41767
41947
  onlineAgents: 0,
41768
41948
  onlineClients: { tui: 0, webui: 0, repl: 0 }
41769
41949
  });
41770
- const [mailboxPanelOpen, setMailboxPanelOpen] = useState31(false);
41771
- const [mailboxMessages, setMailboxMessages] = useState31([]);
41772
- const [mailboxAgents, setMailboxAgents] = useState31([]);
41950
+ const [mailboxPanelOpen, setMailboxPanelOpen] = useState32(false);
41951
+ const [mailboxMessages, setMailboxMessages] = useState32([]);
41952
+ const [mailboxAgents, setMailboxAgents] = useState32([]);
41773
41953
  useEffect49(() => {
41774
41954
  const AGENT_ONLINE_TTL_MS = 12e4;
41775
41955
  const lastSeen = /* @__PURE__ */ new Map();
@@ -41983,11 +42163,11 @@ function useModelPickRequest(opts) {
41983
42163
  }
41984
42164
 
41985
42165
  // src/hooks/use-mouse-tracking.ts
41986
- import { useEffect as useEffect50, useRef as useRef31, useState as useState32 } from "react";
42166
+ import { useEffect as useEffect50, useRef as useRef31, useState as useState33 } from "react";
41987
42167
  function useMouseTracking(input) {
41988
42168
  const { initialMouseMode, initialNativeMouse, overlayOpen, protocol, stdout } = input;
41989
- const [mouseMode, setMouseMode] = useState32(initialMouseMode);
41990
- const [nativeMouse, setNativeMouse] = useState32(initialNativeMouse ?? false);
42169
+ const [mouseMode, setMouseMode] = useState33(initialMouseMode);
42170
+ const [nativeMouse, setNativeMouse] = useState33(initialNativeMouse ?? false);
41991
42171
  const mouseTrackingOn = shouldEnableMouseTracking({
41992
42172
  fullMode: mouseMode,
41993
42173
  overlayOpen,
@@ -42035,7 +42215,7 @@ import {
42035
42215
  useCallback as useCallback20,
42036
42216
  useEffect as useEffect51,
42037
42217
  useRef as useRef32,
42038
- useState as useState33
42218
+ useState as useState34
42039
42219
  } from "react";
42040
42220
  async function commitTodoTransition(agent, todos) {
42041
42221
  if (!agent?.ctx?.state) return null;
@@ -42080,10 +42260,10 @@ function useNextStepsAutoSubmit({
42080
42260
  clearDraft,
42081
42261
  runBlocksRef
42082
42262
  }) {
42083
- const [nextStepsAutoSubmitCountdown, setNextStepsAutoSubmitCountdown] = useState33(
42263
+ const [nextStepsAutoSubmitCountdown, setNextStepsAutoSubmitCountdown] = useState34(
42084
42264
  null
42085
42265
  );
42086
- const [nextStepsAutoSubmitLabel, setNextStepsAutoSubmitLabel] = useState33(null);
42266
+ const [nextStepsAutoSubmitLabel, setNextStepsAutoSubmitLabel] = useState34(null);
42087
42267
  const nextStepsAutoSubmitSuggestionRef = useRef32(null);
42088
42268
  const nextStepsAutoSubmitSourceRef = useRef32(null);
42089
42269
  const nextStepsAutoSubmitTodoIdRef = useRef32(null);
@@ -42093,7 +42273,7 @@ function useNextStepsAutoSubmit({
42093
42273
  const autoSubmitCapWarnedRef = useRef32(false);
42094
42274
  const autoSubmitLoopGuardRef = useRef32(createAutoProceedLoopGuard());
42095
42275
  const continuationAttemptTrackerRef = useRef32(createContinuationAttemptTracker());
42096
- const [nextStepsRecheck, setNextStepsRecheck] = useState33(0);
42276
+ const [nextStepsRecheck, setNextStepsRecheck] = useState34(0);
42097
42277
  useEffect51(() => {
42098
42278
  autoSubmitStreakRef.current = 0;
42099
42279
  autoSubmitCapWarnedRef.current = false;
@@ -43122,10 +43302,20 @@ function useProviderEventBridge({
43122
43302
  }
43123
43303
  };
43124
43304
  const flush = () => {
43305
+ if (activeRunGenerationRef.current !== sessionGenerationRef.current) {
43306
+ pendingToolStream = null;
43307
+ pendingDeltaRef.current = "";
43308
+ flushTimerRef.current = null;
43309
+ return;
43310
+ }
43125
43311
  if (pendingToolStream) {
43126
43312
  dispatch({ type: "toolStreamAppend", ...pendingToolStream });
43127
43313
  pendingToolStream = null;
43128
43314
  }
43315
+ if (pendingDeltaRef.current) {
43316
+ dispatch({ type: "streamDelta", delta: pendingDeltaRef.current });
43317
+ pendingDeltaRef.current = "";
43318
+ }
43129
43319
  recordStreamFlush();
43130
43320
  flushTimerRef.current = null;
43131
43321
  };
@@ -43142,12 +43332,16 @@ function useProviderEventBridge({
43142
43332
  MAX_ASSISTANT_STREAM_RETAINED_CHARS
43143
43333
  );
43144
43334
  appendStreamSegment("assistant", text);
43335
+ pendingDeltaRef.current += text;
43336
+ scheduleFlush();
43145
43337
  });
43146
43338
  const offThinking = events.on("provider.thinking_delta", (e) => {
43147
43339
  if (activeRunGenerationRef.current !== sessionGenerationRef.current) return;
43148
43340
  const text = e.text.replace(/\x1b?\[200~|\x1b?\[201~/g, "");
43149
43341
  recordProviderThinkingDelta(text.length);
43150
43342
  appendStreamSegment("thinking", text);
43343
+ pendingDeltaRef.current += text;
43344
+ scheduleFlush();
43151
43345
  });
43152
43346
  const offToolStart = events.on("tool.started", (e) => {
43153
43347
  dispatch({ type: "toolStarted", id: e.id, name: e.name });
@@ -43788,6 +43982,7 @@ function useSessionInterruptController({
43788
43982
  clearTimeout(flushTimerRef.current);
43789
43983
  flushTimerRef.current = null;
43790
43984
  }
43985
+ dispatch({ type: "streamReset" });
43791
43986
  dispatch({ type: "status", status: "aborting" });
43792
43987
  interrupted = true;
43793
43988
  }
@@ -44183,7 +44378,7 @@ function useStatusSyncInterval({
44183
44378
  // src/hooks/use-statusbar-view-model.ts
44184
44379
  import * as fs4 from "node:fs/promises";
44185
44380
  import { getContextBreakdown } from "@wrongstack/core/utils";
44186
- import { useEffect as useEffect59, useMemo as useMemo15, useState as useState34 } from "react";
44381
+ import { useEffect as useEffect59, useMemo as useMemo15, useState as useState35 } from "react";
44187
44382
 
44188
44383
  // src/context-fill.ts
44189
44384
  function resolveContextFill(inputs) {
@@ -44319,7 +44514,7 @@ function useStatusbarViewModel({
44319
44514
  const planHidden = hiddenItems.includes("plan");
44320
44515
  const taskHidden = hiddenItems.includes("tasks");
44321
44516
  const planPath = agent.ctx.meta["plan.path"];
44322
- const [planCounts, setPlanCounts] = useState34(null);
44517
+ const [planCounts, setPlanCounts] = useState35(null);
44323
44518
  useEffect59(() => {
44324
44519
  if (planHidden) return;
44325
44520
  if (typeof planPath !== "string" || !planPath) {
@@ -44366,7 +44561,7 @@ function useStatusbarViewModel({
44366
44561
  };
44367
44562
  }, [planPath, planHidden]);
44368
44563
  const taskPath = agent.ctx.meta["task.path"];
44369
- const [taskCounts, setTaskCounts] = useState34(null);
44564
+ const [taskCounts, setTaskCounts] = useState35(null);
44370
44565
  useEffect59(() => {
44371
44566
  if (taskHidden) return;
44372
44567
  if (typeof taskPath !== "string" || !taskPath) {
@@ -44577,7 +44772,7 @@ import * as fs5 from "node:fs/promises";
44577
44772
  import * as os from "node:os";
44578
44773
  import { loadGoal } from "@wrongstack/core/storage";
44579
44774
  import { resolveWstackPaths as resolveWstackPaths5 } from "@wrongstack/core/utils";
44580
- import { useCallback as useCallback26, useEffect as useEffect63, useMemo as useMemo16, useRef as useRef39, useState as useState35 } from "react";
44775
+ import { useCallback as useCallback26, useEffect as useEffect63, useMemo as useMemo16, useRef as useRef39, useState as useState36 } from "react";
44581
44776
 
44582
44777
  // src/heap-watchdog.ts
44583
44778
  import {
@@ -44622,7 +44817,7 @@ function useTuiActivity({
44622
44817
  builderRef
44623
44818
  }) {
44624
44819
  recordTuiAppRender();
44625
- const [rolledThinkingWord, setRolledThinkingWord] = useState35(() => pickRandomTuiThinkingWord());
44820
+ const [rolledThinkingWord, setRolledThinkingWord] = useState36(() => pickRandomTuiThinkingWord());
44626
44821
  const thinkingWorking = status === "running" || status === "streaming";
44627
44822
  const prevThinkingWorkingRef = useRef39(false);
44628
44823
  useEffect63(() => {
@@ -44637,12 +44832,12 @@ function useTuiActivity({
44637
44832
  [fleet]
44638
44833
  );
44639
44834
  const startedAtRef = useRef39(Date.now());
44640
- const [nowTick, setNowTick] = useState35(Date.now());
44835
+ const [nowTick, setNowTick] = useState36(Date.now());
44641
44836
  useEffect63(() => {
44642
44837
  const timer = setInterval(() => setNowTick(Date.now()), 1e4);
44643
44838
  return () => clearInterval(timer);
44644
44839
  }, []);
44645
- const [workingTimeBase, setWorkingTimeBase] = useState35(0);
44840
+ const [workingTimeBase, setWorkingTimeBase] = useState36(0);
44646
44841
  const workingStartRef = useRef39(null);
44647
44842
  const prevStatusRef = useRef39(status);
44648
44843
  useEffect63(() => {
@@ -44658,7 +44853,7 @@ function useTuiActivity({
44658
44853
  }
44659
44854
  prevStatusRef.current = status;
44660
44855
  }, [status]);
44661
- const [fleetWorkingBase, setFleetWorkingBase] = useState35(0);
44856
+ const [fleetWorkingBase, setFleetWorkingBase] = useState36(0);
44662
44857
  const fleetWorkingStartRef = useRef39(null);
44663
44858
  const prevFleetRunningRef = useRef39(0);
44664
44859
  useEffect63(() => {
@@ -44885,22 +45080,22 @@ function useTuiControllers({
44885
45080
 
44886
45081
  // src/hooks/use-tui-environment-state.ts
44887
45082
  import { getIndexState as getIndexState2, getProcessRegistry as getProcessRegistry9, onIndexStateChange } from "@wrongstack/tools";
44888
- import { useEffect as useEffect65, useRef as useRef40, useState as useState37 } from "react";
45083
+ import { useEffect as useEffect65, useRef as useRef40, useState as useState38 } from "react";
44889
45084
 
44890
45085
  // src/hooks/use-statusline-state.ts
44891
- import { useState as useState36 } from "react";
45086
+ import { useState as useState37 } from "react";
44892
45087
  function useStatuslineState(opts) {
44893
- const [liveModel, setLiveModel] = useState36(opts.model);
44894
- const [liveProvider, setLiveProvider] = useState36(opts.provider ?? "agent");
44895
- const [activeMaxContext, setActiveMaxContext] = useState36(opts.effectiveMaxContext);
44896
- const [yoloLive, setYoloLive] = useState36(opts.yolo);
44897
- const [autonomyLive, setAutonomyLive] = useState36(opts.getAutonomy?.() ?? "off");
44898
- const [liveModeLabel, setLiveModeLabel] = useState36(opts.modeLabel ?? "");
44899
- const [hiddenItems, setHiddenItems] = useState36(
45088
+ const [liveModel, setLiveModel] = useState37(opts.model);
45089
+ const [liveProvider, setLiveProvider] = useState37(opts.provider ?? "agent");
45090
+ const [activeMaxContext, setActiveMaxContext] = useState37(opts.effectiveMaxContext);
45091
+ const [yoloLive, setYoloLive] = useState37(opts.yolo);
45092
+ const [autonomyLive, setAutonomyLive] = useState37(opts.getAutonomy?.() ?? "off");
45093
+ const [liveModeLabel, setLiveModeLabel] = useState37(opts.modeLabel ?? "");
45094
+ const [hiddenItems, setHiddenItems] = useState37(
44900
45095
  Array.isArray(opts.statuslineHiddenItems) ? [...opts.statuslineHiddenItems] : [...opts.statuslineHiddenItems]
44901
45096
  );
44902
- const [lines, setLines] = useState36(opts.statuslineLines ?? {});
44903
- const [sessionCount, setSessionCount] = useState36(0);
45097
+ const [lines, setLines] = useState37(opts.statuslineLines ?? {});
45098
+ const [sessionCount, setSessionCount] = useState37(0);
44904
45099
  return {
44905
45100
  liveModel,
44906
45101
  setLiveModel,
@@ -44940,8 +45135,8 @@ function useTuiEnvironmentState({
44940
45135
  setStatuslineHiddenItems,
44941
45136
  saveStatuslineHiddenItems
44942
45137
  }) {
44943
- const [memoryContextMonitor, setMemoryContextMonitor] = useState37(emptyMemoryContextMonitor);
44944
- const [memoryRecordTotal, setMemoryRecordTotal] = useState37();
45138
+ const [memoryContextMonitor, setMemoryContextMonitor] = useState38(emptyMemoryContextMonitor);
45139
+ const [memoryRecordTotal, setMemoryRecordTotal] = useState38();
44945
45140
  const memoryContextMonitorRef = useRef40(memoryContextMonitor);
44946
45141
  memoryContextMonitorRef.current = memoryContextMonitor;
44947
45142
  const memoryRecordTotalRef = useRef40(memoryRecordTotal);
@@ -44976,14 +45171,14 @@ function useTuiEnvironmentState({
44976
45171
  });
44977
45172
  const hiddenItemsRef = useRef40(statusline.hiddenItems);
44978
45173
  hiddenItemsRef.current = statusline.hiddenItems;
44979
- const [liveToolCount, setLiveToolCount] = useState37(toolCount);
45174
+ const [liveToolCount, setLiveToolCount] = useState38(toolCount);
44980
45175
  useEffect65(() => setLiveToolCount(toolCount), [toolCount]);
44981
- const [indexState, setIndexState] = useState37(() => getIndexState2());
45176
+ const [indexState, setIndexState] = useState38(() => getIndexState2());
44982
45177
  useEffect65(() => {
44983
45178
  setIndexState(getIndexState2());
44984
45179
  return onIndexStateChange(setIndexState);
44985
45180
  }, []);
44986
- const [breakerCountdown, setBreakerCountdown] = useState37(
45181
+ const [breakerCountdown, setBreakerCountdown] = useState38(
44987
45182
  () => getProcessRegistry9().getBreakerCountdown()
44988
45183
  );
44989
45184
  useEffect65(() => {
@@ -46497,7 +46692,7 @@ Available chords:
46497
46692
 
46498
46693
  // src/hooks/use-working-dir-chip.ts
46499
46694
  import * as path8 from "node:path";
46500
- import { useEffect as useEffect70, useState as useState38 } from "react";
46695
+ import { useEffect as useEffect70, useState as useState39 } from "react";
46501
46696
  function formatWorkingDirChip(workingDir, projectRoot) {
46502
46697
  if (!workingDir || workingDir === projectRoot) return void 0;
46503
46698
  const impl = workingDir.includes("\\") || projectRoot.includes("\\") ? path8.win32 : path8;
@@ -46506,7 +46701,7 @@ function formatWorkingDirChip(workingDir, projectRoot) {
46506
46701
  return rel.replaceAll(impl.sep, "/");
46507
46702
  }
46508
46703
  function useWorkingDirChip(ctx, projectRoot) {
46509
- const [workingDirChip, setWorkingDirChip] = useState38(
46704
+ const [workingDirChip, setWorkingDirChip] = useState39(
46510
46705
  () => formatWorkingDirChip(ctx.workingDir, projectRoot)
46511
46706
  );
46512
46707
  useEffect70(() => {