reasonix 0.36.1 → 0.36.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dashboard/dist/app.js +405 -196
  2. package/dashboard/dist/app.js.map +1 -1
  3. package/dist/cli/{chat-7AF5SPAJ.js → chat-QSM6JKUA.js} +7 -7
  4. package/dist/cli/{chunk-ZU45XW3P.js → chunk-4D6TT2IB.js} +10 -2
  5. package/dist/cli/chunk-4D6TT2IB.js.map +1 -0
  6. package/dist/cli/{chunk-2MCYGFLK.js → chunk-C5543CRX.js} +17 -16
  7. package/dist/cli/chunk-C5543CRX.js.map +1 -0
  8. package/dist/cli/{chunk-KJQIA4US.js → chunk-K6W64QVE.js} +48 -29
  9. package/dist/cli/chunk-K6W64QVE.js.map +1 -0
  10. package/dist/cli/{chunk-3OBWN2NH.js → chunk-NHV5YGTB.js} +421 -333
  11. package/dist/cli/chunk-NHV5YGTB.js.map +1 -0
  12. package/dist/cli/{chunk-QRUQ2BFT.js → chunk-RNSZYYGB.js} +109 -41
  13. package/dist/cli/chunk-RNSZYYGB.js.map +1 -0
  14. package/dist/cli/{chunk-QPNZWUZF.js → chunk-S4GF3HPO.js} +26 -1
  15. package/dist/cli/chunk-S4GF3HPO.js.map +1 -0
  16. package/dist/cli/{code-SWI4EBME.js → code-6C5A2CY3.js} +17 -9
  17. package/dist/cli/code-6C5A2CY3.js.map +1 -0
  18. package/dist/cli/index.js +10 -10
  19. package/dist/cli/{prompt-YEKXMNNV.js → prompt-QSEB7HNQ.js} +3 -3
  20. package/dist/cli/{run-FK5UBIIM.js → run-AG4Y45X7.js} +5 -5
  21. package/dist/cli/{server-W4XJK4GX.js → server-GNHR5K3N.js} +4 -4
  22. package/dist/cli/{sessions-YZXWMIWW.js → sessions-MHRF3GU4.js} +5 -5
  23. package/dist/cli/{version-DWD6RLIU.js → version-7AL4JZ63.js} +5 -5
  24. package/dist/index.d.ts +29 -1
  25. package/dist/index.js +146 -45
  26. package/dist/index.js.map +1 -1
  27. package/package.json +1 -1
  28. package/dist/cli/chunk-2MCYGFLK.js.map +0 -1
  29. package/dist/cli/chunk-3OBWN2NH.js.map +0 -1
  30. package/dist/cli/chunk-KJQIA4US.js.map +0 -1
  31. package/dist/cli/chunk-QPNZWUZF.js.map +0 -1
  32. package/dist/cli/chunk-QRUQ2BFT.js.map +0 -1
  33. package/dist/cli/chunk-ZU45XW3P.js.map +0 -1
  34. package/dist/cli/code-SWI4EBME.js.map +0 -1
  35. /package/dist/cli/{chat-7AF5SPAJ.js.map → chat-QSM6JKUA.js.map} +0 -0
  36. /package/dist/cli/{prompt-YEKXMNNV.js.map → prompt-QSEB7HNQ.js.map} +0 -0
  37. /package/dist/cli/{run-FK5UBIIM.js.map → run-AG4Y45X7.js.map} +0 -0
  38. /package/dist/cli/{server-W4XJK4GX.js.map → server-GNHR5K3N.js.map} +0 -0
  39. /package/dist/cli/{sessions-YZXWMIWW.js.map → sessions-MHRF3GU4.js.map} +0 -0
  40. /package/dist/cli/{version-DWD6RLIU.js.map → version-7AL4JZ63.js.map} +0 -0
@@ -34,7 +34,7 @@ import {
34
34
  toWholeFileEditBlock,
35
35
  walkFilesStream,
36
36
  webFetch
37
- } from "./chunk-QRUQ2BFT.js";
37
+ } from "./chunk-RNSZYYGB.js";
38
38
  import {
39
39
  McpClient,
40
40
  SseTransport,
@@ -50,7 +50,7 @@ import {
50
50
  } from "./chunk-XHQIK7B6.js";
51
51
  import {
52
52
  MemoryStore
53
- } from "./chunk-ZU45XW3P.js";
53
+ } from "./chunk-4D6TT2IB.js";
54
54
  import {
55
55
  KeystrokeProvider,
56
56
  SingleSelect,
@@ -101,7 +101,7 @@ import {
101
101
  resolveSlashAlias,
102
102
  savePlanState,
103
103
  suggestSlashCommands
104
- } from "./chunk-2MCYGFLK.js";
104
+ } from "./chunk-C5543CRX.js";
105
105
  import {
106
106
  fetchSmitheryDetail,
107
107
  loadMorePages,
@@ -117,13 +117,13 @@ import {
117
117
  formatCommandResult,
118
118
  pauseGate,
119
119
  runCommand
120
- } from "./chunk-QPNZWUZF.js";
120
+ } from "./chunk-S4GF3HPO.js";
121
121
  import {
122
122
  PROJECT_MEMORY_FILE,
123
123
  SkillStore,
124
124
  memoryEnabled,
125
125
  readProjectMemory
126
- } from "./chunk-KJQIA4US.js";
126
+ } from "./chunk-K6W64QVE.js";
127
127
  import {
128
128
  HOOK_EVENTS,
129
129
  formatHookOutcomeMessage,
@@ -214,7 +214,7 @@ import {
214
214
 
215
215
  // src/cli/commands/chat.tsx
216
216
  import { render } from "ink";
217
- import React63, { useState as useState22 } from "react";
217
+ import React65, { useState as useState22 } from "react";
218
218
 
219
219
  // src/mcp/summary.ts
220
220
  function buildMcpServerSummary(opts) {
@@ -237,8 +237,8 @@ function buildMcpServerSummary(opts) {
237
237
  // src/cli/ui/App.tsx
238
238
  import { statSync } from "fs";
239
239
  import { resolve as resolve2 } from "path";
240
- import { Box as Box49, Text as Text52, useStdout as useStdout15 } from "ink";
241
- import React60, { useCallback as useCallback11, useEffect as useEffect12, useMemo as useMemo9, useRef as useRef9, useState as useState20 } from "react";
240
+ import { Box as Box50, Text as Text53, useStdout as useStdout15 } from "ink";
241
+ import React62, { useCallback as useCallback11, useEffect as useEffect12, useMemo as useMemo9, useRef as useRef9, useState as useState20 } from "react";
242
242
 
243
243
  // src/code/checkpoints.ts
244
244
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
@@ -6552,9 +6552,42 @@ function truncateCells(value, maxCells) {
6552
6552
  return `${value.slice(0, maxCells - 1)}\u2026`;
6553
6553
  }
6554
6554
 
6555
- // src/cli/ui/WelcomeBanner.tsx
6555
+ // src/cli/ui/ThemePicker.tsx
6556
6556
  import { Box as Box24, Text as Text24 } from "ink";
6557
6557
  import React28 from "react";
6558
+ function ThemePicker({
6559
+ currentPreference,
6560
+ activeTheme,
6561
+ onChoose
6562
+ }) {
6563
+ const choices = ["auto", ...listThemeNames()];
6564
+ const items = choices.map((value) => ({
6565
+ value,
6566
+ label: value,
6567
+ hint: describeTheme(value, currentPreference, activeTheme)
6568
+ }));
6569
+ return /* @__PURE__ */ React28.createElement(Box24, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React28.createElement(Text24, { bold: true }, "Theme"), /* @__PURE__ */ React28.createElement(
6570
+ SingleSelect,
6571
+ {
6572
+ items,
6573
+ initialValue: currentPreference,
6574
+ onSubmit: (value) => onChoose({ kind: "select", value }),
6575
+ onCancel: () => onChoose({ kind: "quit" }),
6576
+ footer: "\u2191\u2193 pick \xB7 \u23CE confirm \xB7 esc cancel"
6577
+ }
6578
+ ));
6579
+ }
6580
+ function describeTheme(value, currentPreference, activeTheme) {
6581
+ const tags = [];
6582
+ if (value === currentPreference) tags.push("current preference");
6583
+ if (value === activeTheme) tags.push("active now");
6584
+ if (value === "auto") tags.push("use REASONIX_THEME or default");
6585
+ return tags.join(" \xB7 ");
6586
+ }
6587
+
6588
+ // src/cli/ui/WelcomeBanner.tsx
6589
+ import { Box as Box25, Text as Text25 } from "ink";
6590
+ import React29 from "react";
6558
6591
  var HINTS = ["/help", "/init", "/memory", "/cost"];
6559
6592
  function WelcomeBanner({
6560
6593
  inCodeMode,
@@ -6564,8 +6597,8 @@ function WelcomeBanner({
6564
6597
  const tagline = inCodeMode ? t("ui.taglineCode") : t("ui.taglineChat");
6565
6598
  const taglineSub = t("ui.taglineSub");
6566
6599
  const startTextRaw = t("ui.startSessionHint");
6567
- return /* @__PURE__ */ React28.createElement(Box24, { flexDirection: "column", alignItems: "center", marginY: 1 }, /* @__PURE__ */ React28.createElement(
6568
- Box24,
6600
+ return /* @__PURE__ */ React29.createElement(Box25, { flexDirection: "column", alignItems: "center", marginY: 1 }, /* @__PURE__ */ React29.createElement(
6601
+ Box25,
6569
6602
  {
6570
6603
  flexDirection: "column",
6571
6604
  alignItems: "center",
@@ -6574,9 +6607,9 @@ function WelcomeBanner({
6574
6607
  paddingX: 4,
6575
6608
  paddingY: 1
6576
6609
  },
6577
- /* @__PURE__ */ React28.createElement(Box24, { flexDirection: "row", gap: 2 }, /* @__PURE__ */ React28.createElement(Text24, { color: TONE.brand, bold: true }, "REASONIX"), /* @__PURE__ */ React28.createElement(Text24, { color: FG.faint }, "\xD7"), /* @__PURE__ */ React28.createElement(Box24, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React28.createElement(Text24, null, "\u{1F40B}"), /* @__PURE__ */ React28.createElement(Text24, { color: TONE.accent, bold: true }, "DeepSeek"))),
6578
- /* @__PURE__ */ React28.createElement(Box24, { marginTop: 1, flexDirection: "column", alignItems: "center" }, /* @__PURE__ */ React28.createElement(Text24, { color: FG.body }, tagline), /* @__PURE__ */ React28.createElement(Text24, { color: FG.meta }, taglineSub))
6579
- ), /* @__PURE__ */ React28.createElement(Box24, { marginTop: 1 }, /* @__PURE__ */ React28.createElement(Text24, { color: FG.sub }, startTextRaw)), /* @__PURE__ */ React28.createElement(Box24, { marginTop: 1, flexDirection: "row", gap: 3 }, HINTS.map((cmd) => /* @__PURE__ */ React28.createElement(Text24, { key: cmd, color: FG.meta }, cmd))), inCodeMode && workspaceRoot ? /* @__PURE__ */ React28.createElement(Box24, { marginTop: 1, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React28.createElement(Text24, { color: TONE.brand }, "\u25B8 workspace"), /* @__PURE__ */ React28.createElement(Text24, { color: FG.faint }, "\xB7"), /* @__PURE__ */ React28.createElement(Text24, { color: FG.body }, workspaceRoot), /* @__PURE__ */ React28.createElement(Text24, { color: FG.faint }, " (relaunch with --dir <path> to switch)")) : null, dashboardUrl ? /* @__PURE__ */ React28.createElement(Box24, { marginTop: 1, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React28.createElement(Text24, { color: TONE.brand, bold: true }, "\u25B8 web"), /* @__PURE__ */ React28.createElement(Text24, { color: FG.faint }, "\xB7"), /* @__PURE__ */ React28.createElement(Text24, { color: TONE.accent }, dashboardUrl)) : null);
6610
+ /* @__PURE__ */ React29.createElement(Box25, { flexDirection: "row", gap: 2 }, /* @__PURE__ */ React29.createElement(Text25, { color: TONE.brand, bold: true }, "REASONIX"), /* @__PURE__ */ React29.createElement(Text25, { color: FG.faint }, "\xD7"), /* @__PURE__ */ React29.createElement(Box25, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React29.createElement(Text25, null, "\u{1F40B}"), /* @__PURE__ */ React29.createElement(Text25, { color: TONE.accent, bold: true }, "DeepSeek"))),
6611
+ /* @__PURE__ */ React29.createElement(Box25, { marginTop: 1, flexDirection: "column", alignItems: "center" }, /* @__PURE__ */ React29.createElement(Text25, { color: FG.body }, tagline), /* @__PURE__ */ React29.createElement(Text25, { color: FG.meta }, taglineSub))
6612
+ ), /* @__PURE__ */ React29.createElement(Box25, { marginTop: 1 }, /* @__PURE__ */ React29.createElement(Text25, { color: FG.sub }, startTextRaw)), /* @__PURE__ */ React29.createElement(Box25, { marginTop: 1, flexDirection: "row", gap: 3 }, HINTS.map((cmd) => /* @__PURE__ */ React29.createElement(Text25, { key: cmd, color: FG.meta }, cmd))), inCodeMode && workspaceRoot ? /* @__PURE__ */ React29.createElement(Box25, { marginTop: 1, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React29.createElement(Text25, { color: TONE.brand }, "\u25B8 workspace"), /* @__PURE__ */ React29.createElement(Text25, { color: FG.faint }, "\xB7"), /* @__PURE__ */ React29.createElement(Text25, { color: FG.body }, workspaceRoot), /* @__PURE__ */ React29.createElement(Text25, { color: FG.faint }, " (relaunch with --dir <path> to switch)")) : null, dashboardUrl ? /* @__PURE__ */ React29.createElement(Box25, { marginTop: 1, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React29.createElement(Text25, { color: TONE.brand, bold: true }, "\u25B8 web"), /* @__PURE__ */ React29.createElement(Text25, { color: FG.faint }, "\xB7"), /* @__PURE__ */ React29.createElement(Text25, { color: TONE.accent }, dashboardUrl)) : null);
6580
6613
  }
6581
6614
 
6582
6615
  // src/cli/ui/bang.ts
@@ -6774,6 +6807,7 @@ function applySlashResult(result, ctx) {
6774
6807
  return { kind: "consumed" };
6775
6808
  }
6776
6809
  if (result.clear) {
6810
+ ctx.resetPendingModals?.();
6777
6811
  ctx.stdoutWrite("\x1B[2J\x1B[3J\x1B[H");
6778
6812
  ctx.log.reset();
6779
6813
  if (result.info) ctx.log.pushInfo(result.info);
@@ -6879,7 +6913,7 @@ function handleToolStart(ev, ctx) {
6879
6913
  ctx.setOngoingTool({ name: ev.toolName ?? "?", args: ev.toolArgs });
6880
6914
  ctx.setToolProgress(null);
6881
6915
  ctx.toolStartedAtRef.current = Date.now();
6882
- ctx.translator.toolStart(ev.toolName ?? "?", parseJsonOrRaw(ev.toolArgs));
6916
+ ctx.translator.toolStart(ev.toolName ?? "?", parseJsonOrRaw(ev.toolArgs), ev.callId);
6883
6917
  if (!ctx.codeModeOn || !ev.toolArgs) return;
6884
6918
  try {
6885
6919
  const parsed = JSON.parse(ev.toolArgs);
@@ -6940,7 +6974,7 @@ function handleToolEvent(ev, ctx) {
6940
6974
  }
6941
6975
 
6942
6976
  // src/cli/ui/state/provider.tsx
6943
- import React29 from "react";
6977
+ import React30 from "react";
6944
6978
 
6945
6979
  // src/cli/ui/state/reducer.ts
6946
6980
  function reduce(state, event) {
@@ -7304,26 +7338,26 @@ function createStore(session, initialCards) {
7304
7338
  }
7305
7339
 
7306
7340
  // src/cli/ui/state/provider.tsx
7307
- var StoreCtx = React29.createContext(null);
7341
+ var StoreCtx = React30.createContext(null);
7308
7342
  function AgentStoreProvider({
7309
7343
  session,
7310
7344
  initialCards,
7311
7345
  children
7312
7346
  }) {
7313
- const initialCardsRef = React29.useRef(initialCards);
7314
- const store = React29.useMemo(() => createStore(session, initialCardsRef.current), [session]);
7315
- return /* @__PURE__ */ React29.createElement(StoreCtx.Provider, { value: store }, children);
7347
+ const initialCardsRef = React30.useRef(initialCards);
7348
+ const store = React30.useMemo(() => createStore(session, initialCardsRef.current), [session]);
7349
+ return /* @__PURE__ */ React30.createElement(StoreCtx.Provider, { value: store }, children);
7316
7350
  }
7317
7351
  function useAgentStore() {
7318
- const store = React29.useContext(StoreCtx);
7352
+ const store = React30.useContext(StoreCtx);
7319
7353
  if (!store) throw new Error("useAgentStore must be used inside AgentStoreProvider");
7320
7354
  return store;
7321
7355
  }
7322
7356
  function useAgentState(selector) {
7323
7357
  const store = useAgentStore();
7324
- const subscribe = React29.useCallback((cb) => store.subscribe(cb), [store]);
7325
- const getSnapshot = React29.useCallback(() => selector(store.getState()), [store, selector]);
7326
- return React29.useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
7358
+ const subscribe = React30.useCallback((cb) => store.subscribe(cb), [store]);
7359
+ const getSnapshot = React30.useCallback(() => selector(store.getState()), [store, selector]);
7360
+ return React30.useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
7327
7361
  }
7328
7362
  function useDispatch() {
7329
7363
  return useAgentStore().dispatch;
@@ -7784,8 +7818,8 @@ ${stack}` : message
7784
7818
  endStreaming(id, aborted) {
7785
7819
  dispatch({ type: "streaming.end", id, aborted });
7786
7820
  },
7787
- startTool(name, args) {
7788
- const id = nextId2("tool");
7821
+ startTool(name, args, presetId) {
7822
+ const id = presetId ?? nextId2("tool");
7789
7823
  dispatch({ type: "tool.start", id, name, args });
7790
7824
  return id;
7791
7825
  },
@@ -7843,21 +7877,21 @@ function useTranscriptWriter(transcriptRef, model2, prefixHash) {
7843
7877
  }
7844
7878
 
7845
7879
  // src/cli/ui/layout/CardStream.tsx
7846
- import { Box as Box44, Text as Text46, useBoxMetrics } from "ink";
7847
- import React53, { useEffect as useEffect7, useRef as useRef5 } from "react";
7880
+ import { Box as Box45, Text as Text47, useBoxMetrics } from "ink";
7881
+ import React55, { useEffect as useEffect7, useRef as useRef5 } from "react";
7848
7882
 
7849
7883
  // src/cli/ui/cards/CardRenderer.tsx
7850
- import { Box as Box43, Text as Text45 } from "ink";
7851
- import React52 from "react";
7884
+ import { Box as Box44, Text as Text46 } from "ink";
7885
+ import React54 from "react";
7852
7886
 
7853
7887
  // src/cli/ui/cards/CtxCard.tsx
7854
- import { Box as Box27, Text as Text26 } from "ink";
7855
- import React32 from "react";
7888
+ import { Box as Box28, Text as Text27 } from "ink";
7889
+ import React33 from "react";
7856
7890
 
7857
7891
  // src/cli/ui/primitives/Card.tsx
7858
- import { Box as Box25 } from "ink";
7859
- import React30, { useContext as useContext3 } from "react";
7860
- var ActiveCardContext = React30.createContext(true);
7892
+ import { Box as Box26 } from "ink";
7893
+ import React31, { useContext as useContext3 } from "react";
7894
+ var ActiveCardContext = React31.createContext(true);
7861
7895
  var STRIPE_BORDER = {
7862
7896
  topLeft: " ",
7863
7897
  top: " ",
@@ -7871,10 +7905,10 @@ var STRIPE_BORDER = {
7871
7905
  function Card({ tone, children }) {
7872
7906
  const active = useContext3(ActiveCardContext);
7873
7907
  if (!active) {
7874
- return /* @__PURE__ */ React30.createElement(Box25, { flexDirection: "column" }, children);
7908
+ return /* @__PURE__ */ React31.createElement(Box26, { flexDirection: "column" }, children);
7875
7909
  }
7876
- return /* @__PURE__ */ React30.createElement(
7877
- Box25,
7910
+ return /* @__PURE__ */ React31.createElement(
7911
+ Box26,
7878
7912
  {
7879
7913
  flexDirection: "column",
7880
7914
  borderStyle: STRIPE_BORDER,
@@ -7891,8 +7925,8 @@ function Card({ tone, children }) {
7891
7925
  }
7892
7926
 
7893
7927
  // src/cli/ui/primitives/CardHeader.tsx
7894
- import { Box as Box26, Text as Text25 } from "ink";
7895
- import React31, { useContext as useContext4 } from "react";
7928
+ import { Box as Box27, Text as Text26 } from "ink";
7929
+ import React32, { useContext as useContext4 } from "react";
7896
7930
  function CardHeader({
7897
7931
  glyph,
7898
7932
  tone,
@@ -7905,13 +7939,13 @@ function CardHeader({
7905
7939
  }) {
7906
7940
  const active = useContext4(ActiveCardContext);
7907
7941
  const visibleMeta = active ? meta : meta?.filter((item) => typeof item !== "string");
7908
- return /* @__PURE__ */ React31.createElement(Box26, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React31.createElement(Text25, { color: tone }, glyph), titleBg ? /* @__PURE__ */ React31.createElement(Text25, { backgroundColor: titleBg, color: titleColor ?? tone, bold: true }, ` ${title} `) : /* @__PURE__ */ React31.createElement(Text25, { bold: true, color: titleColor ?? tone }, title), subtitle ? /* @__PURE__ */ React31.createElement(Text25, { color: FG.body }, subtitle) : null, visibleMeta?.map((item, i) => {
7942
+ return /* @__PURE__ */ React32.createElement(Box27, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React32.createElement(Text26, { color: tone }, glyph), titleBg ? /* @__PURE__ */ React32.createElement(Text26, { backgroundColor: titleBg, color: titleColor ?? tone, bold: true }, ` ${title} `) : /* @__PURE__ */ React32.createElement(Text26, { bold: true, color: titleColor ?? tone }, title), subtitle ? /* @__PURE__ */ React32.createElement(Text26, { color: FG.body }, subtitle) : null, visibleMeta?.map((item, i) => {
7909
7943
  const isStr = typeof item === "string";
7910
7944
  const text = isStr ? item : item.text;
7911
7945
  const color = isStr ? FG.faint : item.color;
7912
7946
  return (
7913
7947
  // biome-ignore lint/suspicious/noArrayIndexKey: meta items are positional
7914
- /* @__PURE__ */ React31.createElement(React31.Fragment, { key: `m-${i}` }, /* @__PURE__ */ React31.createElement(Text25, { color: FG.faint }, "\xB7"), /* @__PURE__ */ React31.createElement(Text25, { color }, text))
7948
+ /* @__PURE__ */ React32.createElement(React32.Fragment, { key: `m-${i}` }, /* @__PURE__ */ React32.createElement(Text26, { color: FG.faint }, "\xB7"), /* @__PURE__ */ React32.createElement(Text26, { color }, text))
7915
7949
  );
7916
7950
  }), active ? right : null);
7917
7951
  }
@@ -7920,13 +7954,13 @@ function CardHeader({
7920
7954
  var BAR_CELLS = 32;
7921
7955
  function row(label, tokens, ratio, color) {
7922
7956
  const filled = Math.max(0, Math.min(BAR_CELLS, Math.round(ratio * BAR_CELLS)));
7923
- return /* @__PURE__ */ React32.createElement(Box27, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React32.createElement(Text26, { color: FG.sub }, label.padEnd(7)), /* @__PURE__ */ React32.createElement(Text26, { color }, "\u2588".repeat(filled)), /* @__PURE__ */ React32.createElement(Text26, { color: FG.faint }, "\u2591".repeat(BAR_CELLS - filled)), /* @__PURE__ */ React32.createElement(Text26, { bold: true, color: FG.body }, tokens.toLocaleString()), /* @__PURE__ */ React32.createElement(Text26, { color: FG.faint }, `\xB7 ${(ratio * 100).toFixed(1)}%`));
7957
+ return /* @__PURE__ */ React33.createElement(Box28, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React33.createElement(Text27, { color: FG.sub }, label.padEnd(7)), /* @__PURE__ */ React33.createElement(Text27, { color }, "\u2588".repeat(filled)), /* @__PURE__ */ React33.createElement(Text27, { color: FG.faint }, "\u2591".repeat(BAR_CELLS - filled)), /* @__PURE__ */ React33.createElement(Text27, { bold: true, color: FG.body }, tokens.toLocaleString()), /* @__PURE__ */ React33.createElement(Text27, { color: FG.faint }, `\xB7 ${(ratio * 100).toFixed(1)}%`));
7924
7958
  }
7925
7959
  function CtxCard({ card }) {
7926
7960
  const cap = Math.max(1, card.ctxMax);
7927
7961
  const used = card.systemTokens + card.toolsTokens + card.logTokens + card.inputTokens;
7928
7962
  const usedPct = used / cap * 100;
7929
- return /* @__PURE__ */ React32.createElement(Card, { tone: TONE.brand }, /* @__PURE__ */ React32.createElement(
7963
+ return /* @__PURE__ */ React33.createElement(Card, { tone: TONE.brand }, /* @__PURE__ */ React33.createElement(
7930
7964
  CardHeader,
7931
7965
  {
7932
7966
  glyph: "\u2318",
@@ -7934,8 +7968,8 @@ function CtxCard({ card }) {
7934
7968
  title: t("cardTitles.context"),
7935
7969
  meta: [`${used.toLocaleString()} / ${cap.toLocaleString()} (${usedPct.toFixed(1)}%)`]
7936
7970
  }
7937
- ), row(t("cardLabels.system"), card.systemTokens, card.systemTokens / cap, TONE.brand), row(t("cardLabels.tools"), card.toolsTokens, card.toolsTokens / cap, TONE.warn), row(t("cardLabels.log"), card.logTokens, card.logTokens / cap, TONE.ok), row(t("cardLabels.input"), card.inputTokens, card.inputTokens / cap, TONE.accent), card.topTools.length > 0 ? /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Text26, { color: FG.faint }, `${t("cardLabels.topTools")} \xB7 ${card.toolsCount} ${t("cardLabels.tools")} \xB7 ${card.logMessages} ${t("cardLabels.logMsgs")}`), card.topTools.slice(0, 5).map((tool) => /* @__PURE__ */ React32.createElement(Box27, { key: `${tool.turn}-${tool.name}`, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React32.createElement(Text26, { color: FG.sub }, tool.name), /* @__PURE__ */ React32.createElement(
7938
- Text26,
7971
+ ), row(t("cardLabels.system"), card.systemTokens, card.systemTokens / cap, TONE.brand), row(t("cardLabels.tools"), card.toolsTokens, card.toolsTokens / cap, TONE.warn), row(t("cardLabels.log"), card.logTokens, card.logTokens / cap, TONE.ok), row(t("cardLabels.input"), card.inputTokens, card.inputTokens / cap, TONE.accent), card.topTools.length > 0 ? /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(Text27, { color: FG.faint }, `${t("cardLabels.topTools")} \xB7 ${card.toolsCount} ${t("cardLabels.tools")} \xB7 ${card.logMessages} ${t("cardLabels.logMsgs")}`), card.topTools.slice(0, 5).map((tool) => /* @__PURE__ */ React33.createElement(Box28, { key: `${tool.turn}-${tool.name}`, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React33.createElement(Text27, { color: FG.sub }, tool.name), /* @__PURE__ */ React33.createElement(
7972
+ Text27,
7939
7973
  {
7940
7974
  color: FG.faint
7941
7975
  },
@@ -7944,8 +7978,8 @@ function CtxCard({ card }) {
7944
7978
  }
7945
7979
 
7946
7980
  // src/cli/ui/cards/DiffCard.tsx
7947
- import { Box as Box28, Text as Text27 } from "ink";
7948
- import React33 from "react";
7981
+ import { Box as Box29, Text as Text28 } from "ink";
7982
+ import React34 from "react";
7949
7983
  var LINE_COLOR = {
7950
7984
  ctx: FG.sub,
7951
7985
  add: TONE.ok,
@@ -7960,7 +7994,7 @@ var LINE_GLYPH = {
7960
7994
  };
7961
7995
  function DiffCard({ card }) {
7962
7996
  const showFooter = card.hunks.length > 0;
7963
- return /* @__PURE__ */ React33.createElement(Card, { tone: TONE.ok }, /* @__PURE__ */ React33.createElement(
7997
+ return /* @__PURE__ */ React34.createElement(Card, { tone: TONE.ok }, /* @__PURE__ */ React34.createElement(
7964
7998
  CardHeader,
7965
7999
  {
7966
8000
  glyph: "\xB1",
@@ -7972,12 +8006,12 @@ function DiffCard({ card }) {
7972
8006
  { text: `-${card.stats.del}`, color: TONE.err }
7973
8007
  ]
7974
8008
  }
7975
- ), card.hunks.map((hunk) => /* @__PURE__ */ React33.createElement(Box28, { key: `${card.id}:${hunk.header}`, flexDirection: "column" }, /* @__PURE__ */ React33.createElement(Text27, { italic: true, color: FG.faint }, hunk.header), hunk.lines.map((line, li) => /* @__PURE__ */ React33.createElement(Box28, { key: `${card.id}:${hunk.header}:${li}`, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React33.createElement(Text27, { color: LINE_COLOR[line.kind] }, LINE_GLYPH[line.kind]), /* @__PURE__ */ React33.createElement(Text27, { color: LINE_COLOR[line.kind], dimColor: line.kind === "ctx" }, line.text))))), showFooter && /* @__PURE__ */ React33.createElement(Box28, { flexDirection: "row", gap: 2 }, /* @__PURE__ */ React33.createElement(Text27, { bold: true, color: TONE.ok }, "[a] apply"), /* @__PURE__ */ React33.createElement(Text27, { color: FG.sub }, "[s] skip"), /* @__PURE__ */ React33.createElement(Text27, { bold: true, color: TONE.err }, "[r] reject")));
8009
+ ), card.hunks.map((hunk) => /* @__PURE__ */ React34.createElement(Box29, { key: `${card.id}:${hunk.header}`, flexDirection: "column" }, /* @__PURE__ */ React34.createElement(Text28, { italic: true, color: FG.faint }, hunk.header), hunk.lines.map((line, li) => /* @__PURE__ */ React34.createElement(Box29, { key: `${card.id}:${hunk.header}:${li}`, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React34.createElement(Text28, { color: LINE_COLOR[line.kind] }, LINE_GLYPH[line.kind]), /* @__PURE__ */ React34.createElement(Text28, { color: LINE_COLOR[line.kind], dimColor: line.kind === "ctx" }, line.text))))), showFooter && /* @__PURE__ */ React34.createElement(Box29, { flexDirection: "row", gap: 2 }, /* @__PURE__ */ React34.createElement(Text28, { bold: true, color: TONE.ok }, "[a] apply"), /* @__PURE__ */ React34.createElement(Text28, { color: FG.sub }, "[s] skip"), /* @__PURE__ */ React34.createElement(Text28, { bold: true, color: TONE.err }, "[r] reject")));
7976
8010
  }
7977
8011
 
7978
8012
  // src/cli/ui/cards/DoctorCard.tsx
7979
- import { Box as Box29, Text as Text28 } from "ink";
7980
- import React34 from "react";
8013
+ import { Box as Box30, Text as Text29 } from "ink";
8014
+ import React35 from "react";
7981
8015
  var LEVEL_GLYPH = {
7982
8016
  ok: "\u2713",
7983
8017
  warn: "\u26A0",
@@ -8000,12 +8034,12 @@ function DoctorCard({ card }) {
8000
8034
  const fail = card.checks.filter((c) => c.level === "fail").length;
8001
8035
  const labelWidth = card.checks.reduce((m, c) => Math.max(m, c.label.length), 0);
8002
8036
  const summary = `${card.checks.length} checks \xB7 ${ok} passed${warn > 0 ? ` \xB7 ${warn} warn` : ""}${fail > 0 ? ` \xB7 ${fail} fail` : ""}`;
8003
- return /* @__PURE__ */ React34.createElement(Card, { tone: CARD.tool.color }, /* @__PURE__ */ React34.createElement(CardHeader, { glyph: "\u2695", tone: CARD.tool.color, title: "doctor", meta: [summary] }), card.checks.map((c) => /* @__PURE__ */ React34.createElement(Box29, { key: c.label, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React34.createElement(Text28, { color: levelColor[c.level] }, LEVEL_GLYPH[c.level]), /* @__PURE__ */ React34.createElement(Text28, { bold: true, color: fg.body }, c.label.padEnd(labelWidth + 1)), /* @__PURE__ */ React34.createElement(Text28, { color: fg.sub }, c.detail), /* @__PURE__ */ React34.createElement(Text28, { color: levelColor[c.level] }, LEVEL_TAG[c.level]))));
8037
+ return /* @__PURE__ */ React35.createElement(Card, { tone: CARD.tool.color }, /* @__PURE__ */ React35.createElement(CardHeader, { glyph: "\u2695", tone: CARD.tool.color, title: "doctor", meta: [summary] }), card.checks.map((c) => /* @__PURE__ */ React35.createElement(Box30, { key: c.label, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React35.createElement(Text29, { color: levelColor[c.level] }, LEVEL_GLYPH[c.level]), /* @__PURE__ */ React35.createElement(Text29, { bold: true, color: fg.body }, c.label.padEnd(labelWidth + 1)), /* @__PURE__ */ React35.createElement(Text29, { color: fg.sub }, c.detail), /* @__PURE__ */ React35.createElement(Text29, { color: levelColor[c.level] }, LEVEL_TAG[c.level]))));
8004
8038
  }
8005
8039
 
8006
8040
  // src/cli/ui/cards/ErrorCard.tsx
8007
- import { Box as Box30, Text as Text29 } from "ink";
8008
- import React35 from "react";
8041
+ import { Box as Box31, Text as Text30 } from "ink";
8042
+ import React36 from "react";
8009
8043
  var STACK_TAIL = 5;
8010
8044
  function ErrorCard({ card }) {
8011
8045
  const retryNote = card.retries !== void 0 && card.retries > 0 ? `${card.retries} ${t("cardLabels.retries")}` : null;
@@ -8015,7 +8049,7 @@ function ErrorCard({ card }) {
8015
8049
  const stackHidden = stackTrunc ? stackLines.length - stackVisible.length : 0;
8016
8050
  const hasStack = stackVisible.length > 0;
8017
8051
  const messageLines = card.message.split("\n");
8018
- return /* @__PURE__ */ React35.createElement(Card, { tone: TONE.err }, /* @__PURE__ */ React35.createElement(
8052
+ return /* @__PURE__ */ React36.createElement(Card, { tone: TONE.err }, /* @__PURE__ */ React36.createElement(
8019
8053
  CardHeader,
8020
8054
  {
8021
8055
  glyph: "\u2716",
@@ -8023,19 +8057,19 @@ function ErrorCard({ card }) {
8023
8057
  title: card.title || t("cardTitles.error"),
8024
8058
  meta: retryNote ? [retryNote] : void 0
8025
8059
  }
8026
- ), messageLines.map((line, i) => /* @__PURE__ */ React35.createElement(Text29, { key: `${card.id}:msg:${i}`, color: TONE.err }, line || " ")), hasStack ? /* @__PURE__ */ React35.createElement(Box30, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React35.createElement(Text29, { color: FG.meta }, t("cardLabels.stackTrace")), stackHidden > 0 ? /* @__PURE__ */ React35.createElement(Text29, { color: FG.faint }, t(
8060
+ ), messageLines.map((line, i) => /* @__PURE__ */ React36.createElement(Text30, { key: `${card.id}:msg:${i}`, color: TONE.err }, line || " ")), hasStack ? /* @__PURE__ */ React36.createElement(Box31, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React36.createElement(Text30, { color: FG.meta }, t("cardLabels.stackTrace")), stackHidden > 0 ? /* @__PURE__ */ React36.createElement(Text30, { color: FG.faint }, t(
8027
8061
  stackHidden === 1 ? "cardLabels.earlierStackLine" : "cardLabels.earlierStackLines",
8028
8062
  { count: stackHidden }
8029
- )) : null, stackVisible.map((line, i) => /* @__PURE__ */ React35.createElement(Text29, { key: `${card.id}:stk:${stackHidden + i}`, color: FG.meta }, line || " "))) : null);
8063
+ )) : null, stackVisible.map((line, i) => /* @__PURE__ */ React36.createElement(Text30, { key: `${card.id}:stk:${stackHidden + i}`, color: FG.meta }, line || " "))) : null);
8030
8064
  }
8031
8065
 
8032
8066
  // src/cli/ui/cards/LiveCard.tsx
8033
- import { Box as Box31, Text as Text31 } from "ink";
8034
- import React37 from "react";
8067
+ import { Box as Box32, Text as Text32 } from "ink";
8068
+ import React38 from "react";
8035
8069
 
8036
8070
  // src/cli/ui/primitives/Spinner.tsx
8037
- import { Text as Text30 } from "ink";
8038
- import React36 from "react";
8071
+ import { Text as Text31 } from "ink";
8072
+ import React37 from "react";
8039
8073
  var FRAMES = {
8040
8074
  circle: ["\u25D0", "\u25D3", "\u25D1", "\u25D2"],
8041
8075
  braille: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827"]
@@ -8044,7 +8078,7 @@ function Spinner({ kind = "circle", color, bold }) {
8044
8078
  const frames = FRAMES[kind];
8045
8079
  const tick = useTick();
8046
8080
  const frame = tick % frames.length;
8047
- return /* @__PURE__ */ React36.createElement(Text30, { bold, color }, frames[frame]);
8081
+ return /* @__PURE__ */ React37.createElement(Text31, { bold, color }, frames[frame]);
8048
8082
  }
8049
8083
 
8050
8084
  // src/cli/ui/cards/LiveCard.tsx
@@ -8071,12 +8105,12 @@ var VARIANT_GLYPH = {
8071
8105
  function LiveCard({ card }) {
8072
8106
  const color = TONE_TO_COLOR[card.tone];
8073
8107
  const glyph = VARIANT_GLYPH[card.variant];
8074
- return /* @__PURE__ */ React37.createElement(Box31, { paddingLeft: 2, flexDirection: "row", gap: 1 }, card.variant === "thinking" ? /* @__PURE__ */ React37.createElement(Spinner, { kind: "circle", color, bold: true }) : /* @__PURE__ */ React37.createElement(Text31, { bold: true, color }, glyph), /* @__PURE__ */ React37.createElement(Text31, { color: FG.body }, card.text), card.meta !== void 0 ? /* @__PURE__ */ React37.createElement(Text31, { color: FG.faint }, `\xB7 ${card.meta}`) : null);
8108
+ return /* @__PURE__ */ React38.createElement(Box32, { paddingLeft: 2, flexDirection: "row", gap: 1 }, card.variant === "thinking" ? /* @__PURE__ */ React38.createElement(Spinner, { kind: "circle", color, bold: true }) : /* @__PURE__ */ React38.createElement(Text32, { bold: true, color }, glyph), /* @__PURE__ */ React38.createElement(Text32, { color: FG.body }, card.text), card.meta !== void 0 ? /* @__PURE__ */ React38.createElement(Text32, { color: FG.faint }, `\xB7 ${card.meta}`) : null);
8075
8109
  }
8076
8110
 
8077
8111
  // src/cli/ui/cards/MemoryCard.tsx
8078
- import { Box as Box32, Text as Text32 } from "ink";
8079
- import React38 from "react";
8112
+ import { Box as Box33, Text as Text33 } from "ink";
8113
+ import React39 from "react";
8080
8114
  var CATEGORY_ORDER = [
8081
8115
  "user",
8082
8116
  "feedback",
@@ -8105,7 +8139,7 @@ function MemoryCard({ card }) {
8105
8139
  const counts = countByCategory(card.entries);
8106
8140
  const summary = CATEGORY_ORDER.filter((c) => counts[c] > 0).map((c) => `${counts[c]} ${c}`).join(" \xB7 ");
8107
8141
  const tokens = card.tokens > 1024 ? `~${(card.tokens / 1024).toFixed(1)}K tok` : `~${card.tokens} tok`;
8108
- return /* @__PURE__ */ React38.createElement(Card, { tone: FG.meta }, /* @__PURE__ */ React38.createElement(
8142
+ return /* @__PURE__ */ React39.createElement(Card, { tone: FG.meta }, /* @__PURE__ */ React39.createElement(
8109
8143
  CardHeader,
8110
8144
  {
8111
8145
  glyph: "\u2311",
@@ -8118,7 +8152,7 @@ function MemoryCard({ card }) {
8118
8152
  const all = card.entries.filter((e) => e.category === category);
8119
8153
  const shown = all.slice(0, 5);
8120
8154
  const remaining = all.length - shown.length;
8121
- return /* @__PURE__ */ React38.createElement(Box32, { key: category, flexDirection: "column" }, /* @__PURE__ */ React38.createElement(Text32, { color: FG.faint }, `${CATEGORY_LABEL[category]} (${counts[category]})`), shown.map((entry) => /* @__PURE__ */ React38.createElement(Box32, { key: `${category}:${entry.summary}`, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React38.createElement(Text32, { color: CATEGORY_GLYPH_COLOR[category] }, CATEGORY_GLYPH[category]), /* @__PURE__ */ React38.createElement(Text32, { color: FG.sub }, entry.summary))), remaining > 0 ? /* @__PURE__ */ React38.createElement(Text32, { color: FG.faint }, `\u22EE +${remaining} more`) : null);
8155
+ return /* @__PURE__ */ React39.createElement(Box33, { key: category, flexDirection: "column" }, /* @__PURE__ */ React39.createElement(Text33, { color: FG.faint }, `${CATEGORY_LABEL[category]} (${counts[category]})`), shown.map((entry) => /* @__PURE__ */ React39.createElement(Box33, { key: `${category}:${entry.summary}`, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React39.createElement(Text33, { color: CATEGORY_GLYPH_COLOR[category] }, CATEGORY_GLYPH[category]), /* @__PURE__ */ React39.createElement(Text33, { color: FG.sub }, entry.summary))), remaining > 0 ? /* @__PURE__ */ React39.createElement(Text33, { color: FG.faint }, `\u22EE +${remaining} more`) : null);
8122
8156
  }));
8123
8157
  }
8124
8158
  function countByCategory(entries) {
@@ -8133,8 +8167,8 @@ function countByCategory(entries) {
8133
8167
  }
8134
8168
 
8135
8169
  // src/cli/ui/cards/PlanCard.tsx
8136
- import { Box as Box33, Text as Text33 } from "ink";
8137
- import React39 from "react";
8170
+ import { Box as Box34, Text as Text34 } from "ink";
8171
+ import React40 from "react";
8138
8172
  var STATUS_GLYPH = {
8139
8173
  queued: "\u25CB",
8140
8174
  running: "\u25B6",
@@ -8160,11 +8194,11 @@ function PlanCard({ card }) {
8160
8194
  const hasRunning = card.steps.some((s) => s.status === "running");
8161
8195
  const cardTone = hasRunning ? toneActive.accent : tone.accent;
8162
8196
  const window = pickWindow(card.steps);
8163
- return /* @__PURE__ */ React39.createElement(Card, { tone: cardTone }, /* @__PURE__ */ React39.createElement(CardHeader, { glyph: "\u229E", tone: cardTone, title: card.title, meta: [progress] }), window.hiddenBefore > 0 ? /* @__PURE__ */ React39.createElement(Box33, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React39.createElement(Text33, { color: tone.ok }, "\u2713"), /* @__PURE__ */ React39.createElement(Text33, { color: fg.faint }, `\u22EF ${window.hiddenBefore} done`)) : null, window.steps.map((step) => {
8197
+ return /* @__PURE__ */ React40.createElement(Card, { tone: cardTone }, /* @__PURE__ */ React40.createElement(CardHeader, { glyph: "\u229E", tone: cardTone, title: card.title, meta: [progress] }), window.hiddenBefore > 0 ? /* @__PURE__ */ React40.createElement(Box34, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React40.createElement(Text34, { color: tone.ok }, "\u2713"), /* @__PURE__ */ React40.createElement(Text34, { color: fg.faint }, `\u22EF ${window.hiddenBefore} done`)) : null, window.steps.map((step) => {
8164
8198
  const isActive = step.status === "running";
8165
8199
  const titleColor = isActive ? fg.strong : fg.sub;
8166
- return /* @__PURE__ */ React39.createElement(Box33, { key: step.id, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React39.createElement(Text33, { color: statusColor[step.status] }, STATUS_GLYPH[step.status]), /* @__PURE__ */ React39.createElement(Text33, { bold: isActive, color: titleColor }, `${step.indexLabel}. ${step.title}`), isActive ? /* @__PURE__ */ React39.createElement(Text33, { color: toneActive.brand }, "\u2190 in progress") : null);
8167
- }), window.hiddenAfter > 0 ? /* @__PURE__ */ React39.createElement(Box33, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React39.createElement(Text33, { color: fg.faint }, "\u25CB"), /* @__PURE__ */ React39.createElement(Text33, { color: fg.faint }, `\u22EF ${window.hiddenAfter} upcoming`)) : null);
8200
+ return /* @__PURE__ */ React40.createElement(Box34, { key: step.id, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React40.createElement(Text34, { color: statusColor[step.status] }, STATUS_GLYPH[step.status]), /* @__PURE__ */ React40.createElement(Text34, { bold: isActive, color: titleColor }, `${step.indexLabel}. ${step.title}`), isActive ? /* @__PURE__ */ React40.createElement(Text34, { color: toneActive.brand }, "\u2190 in progress") : null);
8201
+ }), window.hiddenAfter > 0 ? /* @__PURE__ */ React40.createElement(Box34, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React40.createElement(Text34, { color: fg.faint }, "\u25CB"), /* @__PURE__ */ React40.createElement(Text34, { color: fg.faint }, `\u22EF ${window.hiddenAfter} upcoming`)) : null);
8168
8202
  }
8169
8203
  function pickWindow(steps) {
8170
8204
  if (steps.length <= VISIBLE_WINDOW) {
@@ -8192,8 +8226,8 @@ function anchorIndex(steps) {
8192
8226
  }
8193
8227
 
8194
8228
  // src/cli/ui/cards/ReasoningCard.tsx
8195
- import { Box as Box34, Text as Text35, useStdout as useStdout9 } from "ink";
8196
- import React41 from "react";
8229
+ import { Box as Box35, Text as Text36, useStdout as useStdout9 } from "ink";
8230
+ import React42 from "react";
8197
8231
 
8198
8232
  // src/frame/width.ts
8199
8233
  import stringWidthLib from "string-width";
@@ -8244,12 +8278,12 @@ function wrapToCells(s, maxCells) {
8244
8278
  }
8245
8279
 
8246
8280
  // src/cli/ui/primitives/CursorBlock.tsx
8247
- import { Text as Text34 } from "ink";
8248
- import React40 from "react";
8281
+ import { Text as Text35 } from "ink";
8282
+ import React41 from "react";
8249
8283
  function CursorBlock() {
8250
8284
  const tick = useTick();
8251
8285
  const on = Math.floor(tick / 4) % 2 === 0;
8252
- return /* @__PURE__ */ React40.createElement(Text34, { inverse: on, color: CARD.streaming.color }, " ");
8286
+ return /* @__PURE__ */ React41.createElement(Text35, { inverse: on, color: CARD.streaming.color }, " ");
8253
8287
  }
8254
8288
 
8255
8289
  // src/cli/ui/cards/ReasoningCard.tsx
@@ -8265,7 +8299,7 @@ function ReasoningCard({
8265
8299
  const allLines = card.text.length > 0 ? card.text.split("\n") : [];
8266
8300
  const showBody = expanded && (allLines.length > 0 || card.streaming);
8267
8301
  const tone = card.aborted ? TONE.err : card.streaming ? TONE_ACTIVE.accent : TONE.accent;
8268
- return /* @__PURE__ */ React41.createElement(Card, { tone }, /* @__PURE__ */ React41.createElement(ReasoningHeader, { card }), showBody && (card.streaming ? /* @__PURE__ */ React41.createElement(StreamingPreview, { card, allLines, lineCells }) : /* @__PURE__ */ React41.createElement(SettledPreview, { card, allLines, lineCells })));
8302
+ return /* @__PURE__ */ React42.createElement(Card, { tone }, /* @__PURE__ */ React42.createElement(ReasoningHeader, { card }), showBody && (card.streaming ? /* @__PURE__ */ React42.createElement(StreamingPreview, { card, allLines, lineCells }) : /* @__PURE__ */ React42.createElement(SettledPreview, { card, allLines, lineCells })));
8269
8303
  }
8270
8304
  function ReasoningHeader({ card }) {
8271
8305
  const streamingActive = card.streaming && !card.aborted;
@@ -8278,7 +8312,7 @@ function ReasoningHeader({ card }) {
8278
8312
  const duration = headerDuration(card);
8279
8313
  if (duration) meta.push(duration);
8280
8314
  const modelBadge = card.model ? modelBadgeFor(card.model) : null;
8281
- return /* @__PURE__ */ React41.createElement(
8315
+ return /* @__PURE__ */ React42.createElement(
8282
8316
  CardHeader,
8283
8317
  {
8284
8318
  glyph,
@@ -8287,7 +8321,7 @@ function ReasoningHeader({ card }) {
8287
8321
  titleColor: PILL_SECTION.reason.fg,
8288
8322
  titleBg: PILL_SECTION.reason.bg,
8289
8323
  meta: meta.length > 0 ? meta : void 0,
8290
- right: /* @__PURE__ */ React41.createElement(React41.Fragment, null, streamingActive ? /* @__PURE__ */ React41.createElement(Spinner, { kind: "braille", color: TONE_ACTIVE.accent }) : null, modelBadge ? /* @__PURE__ */ React41.createElement(Pill, { label: modelBadge.label, ...PILL_MODEL[modelBadge.kind], bold: false }) : null)
8324
+ right: /* @__PURE__ */ React42.createElement(React42.Fragment, null, streamingActive ? /* @__PURE__ */ React42.createElement(Spinner, { kind: "braille", color: TONE_ACTIVE.accent }) : null, modelBadge ? /* @__PURE__ */ React42.createElement(Pill, { label: modelBadge.label, ...PILL_MODEL[modelBadge.kind], bold: false }) : null)
8291
8325
  }
8292
8326
  );
8293
8327
  }
@@ -8308,13 +8342,13 @@ function headerDuration(card) {
8308
8342
  function StreamingPreview({ card, allLines, lineCells }) {
8309
8343
  const visualLines = allLines.flatMap((l) => wrapToCells(l, lineCells));
8310
8344
  const visible = visualLines.slice(-STREAMING_PREVIEW_LINES);
8311
- return /* @__PURE__ */ React41.createElement(BodyLines, { card, lines: visible, lineCells, cursorOnLast: true });
8345
+ return /* @__PURE__ */ React42.createElement(BodyLines, { card, lines: visible, lineCells, cursorOnLast: true });
8312
8346
  }
8313
8347
  function SettledPreview({ card, allLines, lineCells }) {
8314
8348
  const visualLines = allLines.flatMap((l) => wrapToCells(l, lineCells));
8315
8349
  const visible = visualLines.slice(-SETTLED_TAIL_LINES);
8316
8350
  const droppedLines = Math.max(0, visualLines.length - visible.length);
8317
- return /* @__PURE__ */ React41.createElement(React41.Fragment, null, droppedLines > 0 ? /* @__PURE__ */ React41.createElement(ElisionHint, { droppedLines, card }) : null, /* @__PURE__ */ React41.createElement(BodyLines, { card, lines: visible, lineCells, indexOffset: droppedLines }));
8351
+ return /* @__PURE__ */ React42.createElement(React42.Fragment, null, droppedLines > 0 ? /* @__PURE__ */ React42.createElement(ElisionHint, { droppedLines, card }) : null, /* @__PURE__ */ React42.createElement(BodyLines, { card, lines: visible, lineCells, indexOffset: droppedLines }));
8318
8352
  }
8319
8353
  function BodyLines({
8320
8354
  card,
@@ -8323,9 +8357,9 @@ function BodyLines({
8323
8357
  cursorOnLast = false,
8324
8358
  indexOffset = 0
8325
8359
  }) {
8326
- return /* @__PURE__ */ React41.createElement(React41.Fragment, null, lines.map((line, i) => {
8360
+ return /* @__PURE__ */ React42.createElement(React42.Fragment, null, lines.map((line, i) => {
8327
8361
  const isLast = i === lines.length - 1;
8328
- return /* @__PURE__ */ React41.createElement(Box34, { key: `${card.id}:b:${indexOffset + i}`, flexDirection: "row" }, /* @__PURE__ */ React41.createElement(Text35, { italic: true, color: FG.meta }, clipToCells(line, lineCells)), isLast && cursorOnLast && /* @__PURE__ */ React41.createElement(CursorBlock, null));
8362
+ return /* @__PURE__ */ React42.createElement(Box35, { key: `${card.id}:b:${indexOffset + i}`, flexDirection: "row" }, /* @__PURE__ */ React42.createElement(Text36, { italic: true, color: FG.meta }, clipToCells(line, lineCells)), isLast && cursorOnLast && /* @__PURE__ */ React42.createElement(CursorBlock, null));
8329
8363
  }));
8330
8364
  }
8331
8365
  function ElisionHint({
@@ -8339,12 +8373,12 @@ function ElisionHint({
8339
8373
  parts.push(`${droppedLines} line${droppedLines === 1 ? "" : "s"}`);
8340
8374
  }
8341
8375
  if (card.tokens > 0) parts.push(`${card.tokens.toLocaleString()} tok`);
8342
- return /* @__PURE__ */ React41.createElement(Text35, { color: FG.faint }, `\u22EF ${parts.join(" \xB7 ")} above \xB7 /reasoning last`);
8376
+ return /* @__PURE__ */ React42.createElement(Text36, { color: FG.faint }, `\u22EF ${parts.join(" \xB7 ")} above \xB7 /reasoning last`);
8343
8377
  }
8344
8378
 
8345
8379
  // src/cli/ui/cards/SearchCard.tsx
8346
- import { Box as Box35, Text as Text36 } from "ink";
8347
- import React42 from "react";
8380
+ import { Box as Box36, Text as Text37 } from "ink";
8381
+ import React43 from "react";
8348
8382
  function SearchCard({ card }) {
8349
8383
  const fileCount = new Set(card.hits.map((h) => h.file)).size;
8350
8384
  const elapsed = `${(card.elapsedMs / 1e3).toFixed(2)}s`;
@@ -8353,7 +8387,7 @@ function SearchCard({ card }) {
8353
8387
  files: fileCount
8354
8388
  });
8355
8389
  const grouped = groupByFile(card.hits.slice(0, 10));
8356
- return /* @__PURE__ */ React42.createElement(Card, { tone: TONE.info }, /* @__PURE__ */ React42.createElement(
8390
+ return /* @__PURE__ */ React43.createElement(Card, { tone: TONE.info }, /* @__PURE__ */ React43.createElement(
8357
8391
  CardHeader,
8358
8392
  {
8359
8393
  glyph: "\u2299",
@@ -8362,7 +8396,7 @@ function SearchCard({ card }) {
8362
8396
  subtitle: `"${card.query}"`,
8363
8397
  meta: [stats2, elapsed]
8364
8398
  }
8365
- ), grouped.map(([file, hits]) => /* @__PURE__ */ React42.createElement(Box35, { key: file, flexDirection: "column" }, /* @__PURE__ */ React42.createElement(Text36, { bold: true, color: FG.strong }, file), hits.map((h, i) => /* @__PURE__ */ React42.createElement(Box35, { key: `${file}:${h.line}:${i}`, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React42.createElement(Text36, { color: FG.faint }, `${h.line.toString().padStart(4)} \u2502`), /* @__PURE__ */ React42.createElement(HighlightedLine, { text: h.preview, start: h.matchStart, end: h.matchEnd }))))), card.hits.length > 10 ? /* @__PURE__ */ React42.createElement(Text36, { color: FG.faint }, t(
8399
+ ), grouped.map(([file, hits]) => /* @__PURE__ */ React43.createElement(Box36, { key: file, flexDirection: "column" }, /* @__PURE__ */ React43.createElement(Text37, { bold: true, color: FG.strong }, file), hits.map((h, i) => /* @__PURE__ */ React43.createElement(Box36, { key: `${file}:${h.line}:${i}`, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React43.createElement(Text37, { color: FG.faint }, `${h.line.toString().padStart(4)} \u2502`), /* @__PURE__ */ React43.createElement(HighlightedLine, { text: h.preview, start: h.matchStart, end: h.matchEnd }))))), card.hits.length > 10 ? /* @__PURE__ */ React43.createElement(Text37, { color: FG.faint }, t(
8366
8400
  card.hits.length - 10 === 1 ? "cardLabels.moreHitSingular" : "cardLabels.moreHitsPlural",
8367
8401
  { count: card.hits.length - 10 }
8368
8402
  )) : null);
@@ -8373,9 +8407,9 @@ function HighlightedLine({
8373
8407
  end
8374
8408
  }) {
8375
8409
  if (start < 0 || end <= start || end > text.length) {
8376
- return /* @__PURE__ */ React42.createElement(Text36, { color: FG.sub }, text);
8410
+ return /* @__PURE__ */ React43.createElement(Text37, { color: FG.sub }, text);
8377
8411
  }
8378
- return /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(Text36, { color: FG.sub }, text.slice(0, start)), /* @__PURE__ */ React42.createElement(Text36, { bold: true, inverse: true }, text.slice(start, end)), /* @__PURE__ */ React42.createElement(Text36, { color: FG.sub }, text.slice(end)));
8412
+ return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(Text37, { color: FG.sub }, text.slice(0, start)), /* @__PURE__ */ React43.createElement(Text37, { bold: true, inverse: true }, text.slice(start, end)), /* @__PURE__ */ React43.createElement(Text37, { color: FG.sub }, text.slice(end)));
8379
8413
  }
8380
8414
  function groupByFile(hits) {
8381
8415
  const map = /* @__PURE__ */ new Map();
@@ -8388,8 +8422,8 @@ function groupByFile(hits) {
8388
8422
  }
8389
8423
 
8390
8424
  // src/cli/ui/cards/StreamingCard.tsx
8391
- import { Box as Box37, Text as Text38, useStdout as useStdout11 } from "ink";
8392
- import React44, { useContext as useContext5 } from "react";
8425
+ import { Box as Box38, Text as Text39, useStdout as useStdout11 } from "ink";
8426
+ import React45, { useContext as useContext5 } from "react";
8393
8427
 
8394
8428
  // src/cli/ui/layout/LiveExpandContext.ts
8395
8429
  import { createContext as createContext3 } from "react";
@@ -8397,54 +8431,54 @@ var LiveExpandContext = createContext3(false);
8397
8431
 
8398
8432
  // src/cli/ui/markdown.tsx
8399
8433
  import { highlight, supportsLanguage } from "cli-highlight";
8400
- import { Box as Box36, Text as Text37, useStdout as useStdout10 } from "ink";
8401
- import React43 from "react";
8434
+ import { Box as Box37, Text as Text38, useStdout as useStdout10 } from "ink";
8435
+ import React44 from "react";
8402
8436
  import stringWidth from "string-width";
8403
8437
  var BODY_LEFT_CELLS = 7;
8404
- var MarkdownWidthCtx = React43.createContext(void 0);
8438
+ var MarkdownWidthCtx = React44.createContext(void 0);
8405
8439
  function useWidth() {
8406
- const ctx = React43.useContext(MarkdownWidthCtx);
8440
+ const ctx = React44.useContext(MarkdownWidthCtx);
8407
8441
  if (ctx !== void 0) return ctx;
8408
8442
  return (useStdout10()?.stdout?.columns ?? process.stdout.columns ?? 80) - BODY_LEFT_CELLS;
8409
8443
  }
8410
8444
  marked.setOptions({ gfm: true, breaks: false });
8411
8445
  function Markdown({ text, width }) {
8412
- const tokens = React43.useMemo(() => marked.lexer(text), [text]);
8446
+ const tokens = React44.useMemo(() => marked.lexer(text), [text]);
8413
8447
  const ctxWidth = width !== void 0 ? Math.max(1, width) : void 0;
8414
- return /* @__PURE__ */ React43.createElement(MarkdownWidthCtx.Provider, { value: ctxWidth }, /* @__PURE__ */ React43.createElement(Box36, { flexDirection: "column", gap: 1 }, tokens.map((token, i) => /* @__PURE__ */ React43.createElement(BlockToken, { key: `${i}-${token.type}`, token }))));
8448
+ return /* @__PURE__ */ React44.createElement(MarkdownWidthCtx.Provider, { value: ctxWidth }, /* @__PURE__ */ React44.createElement(Box37, { flexDirection: "column", gap: 1 }, tokens.map((token, i) => /* @__PURE__ */ React44.createElement(BlockToken, { key: `${i}-${token.type}`, token }))));
8415
8449
  }
8416
8450
  function BlockToken({ token }) {
8417
8451
  switch (token.type) {
8418
8452
  case "heading":
8419
- return /* @__PURE__ */ React43.createElement(Heading, { token });
8453
+ return /* @__PURE__ */ React44.createElement(Heading, { token });
8420
8454
  case "paragraph":
8421
- return /* @__PURE__ */ React43.createElement(Paragraph, { token });
8455
+ return /* @__PURE__ */ React44.createElement(Paragraph, { token });
8422
8456
  case "list":
8423
- return /* @__PURE__ */ React43.createElement(List, { token, depth: 0 });
8457
+ return /* @__PURE__ */ React44.createElement(List, { token, depth: 0 });
8424
8458
  case "code":
8425
- return /* @__PURE__ */ React43.createElement(CodeBlock2, { token });
8459
+ return /* @__PURE__ */ React44.createElement(CodeBlock2, { token });
8426
8460
  case "blockquote":
8427
- return /* @__PURE__ */ React43.createElement(Blockquote, { token });
8461
+ return /* @__PURE__ */ React44.createElement(Blockquote, { token });
8428
8462
  case "hr":
8429
- return /* @__PURE__ */ React43.createElement(HorizontalRule, null);
8463
+ return /* @__PURE__ */ React44.createElement(HorizontalRule, null);
8430
8464
  case "table":
8431
- return /* @__PURE__ */ React43.createElement(Table, { token });
8465
+ return /* @__PURE__ */ React44.createElement(Table, { token });
8432
8466
  case "html":
8433
- return /* @__PURE__ */ React43.createElement(Text37, { color: FG.body }, token.text);
8467
+ return /* @__PURE__ */ React44.createElement(Text38, { color: FG.body }, token.text);
8434
8468
  case "space":
8435
8469
  return null;
8436
8470
  default:
8437
- return /* @__PURE__ */ React43.createElement(Text37, { color: FG.body }, token.raw ?? "");
8471
+ return /* @__PURE__ */ React44.createElement(Text38, { color: FG.body }, token.raw ?? "");
8438
8472
  }
8439
8473
  }
8440
8474
  function Heading({ token }) {
8441
- return /* @__PURE__ */ React43.createElement(Box36, null, /* @__PURE__ */ React43.createElement(Text37, { bold: true, color: FG.strong, backgroundColor: SURFACE.bgElev }, ` ${plainText(token.tokens)} `));
8475
+ return /* @__PURE__ */ React44.createElement(Box37, null, /* @__PURE__ */ React44.createElement(Text38, { bold: true, color: FG.strong, backgroundColor: SURFACE.bgElev }, ` ${plainText(token.tokens)} `));
8442
8476
  }
8443
8477
  function Paragraph({ token }) {
8444
- return /* @__PURE__ */ React43.createElement(Text37, { color: FG.body }, /* @__PURE__ */ React43.createElement(Inline, { tokens: token.tokens ?? [] }));
8478
+ return /* @__PURE__ */ React44.createElement(Text38, { color: FG.body }, /* @__PURE__ */ React44.createElement(Inline, { tokens: token.tokens ?? [] }));
8445
8479
  }
8446
8480
  function List({ token, depth }) {
8447
- return /* @__PURE__ */ React43.createElement(Box36, { flexDirection: "column" }, token.items.map((item, i) => /* @__PURE__ */ React43.createElement(
8481
+ return /* @__PURE__ */ React44.createElement(Box37, { flexDirection: "column" }, token.items.map((item, i) => /* @__PURE__ */ React44.createElement(
8448
8482
  ListItem,
8449
8483
  {
8450
8484
  key: `${i}-${item.text.slice(0, 24)}`,
@@ -8465,27 +8499,27 @@ function ListItem({
8465
8499
  const markerColor = item.task ? item.checked ? TONE.ok : FG.faint : FG.meta;
8466
8500
  const dim = item.task && item.checked === true;
8467
8501
  const indent = " ".repeat(depth + 1);
8468
- return /* @__PURE__ */ React43.createElement(Box36, null, /* @__PURE__ */ React43.createElement(Text37, { color: markerColor }, `${indent}${marker} `), /* @__PURE__ */ React43.createElement(Box36, { flexDirection: "column" }, item.tokens.map((tok, i) => {
8502
+ return /* @__PURE__ */ React44.createElement(Box37, null, /* @__PURE__ */ React44.createElement(Text38, { color: markerColor }, `${indent}${marker} `), /* @__PURE__ */ React44.createElement(Box37, { flexDirection: "column" }, item.tokens.map((tok, i) => {
8469
8503
  if (tok.type === "text") {
8470
8504
  const inner = tok.tokens;
8471
8505
  return (
8472
8506
  // biome-ignore lint/suspicious/noArrayIndexKey: list-item children are positional and stable per render
8473
- /* @__PURE__ */ React43.createElement(Text37, { key: `t-${i}`, color: dim ? FG.faint : FG.body, strikethrough: dim }, inner ? /* @__PURE__ */ React43.createElement(Inline, { tokens: inner }) : tok.text)
8507
+ /* @__PURE__ */ React44.createElement(Text38, { key: `t-${i}`, color: dim ? FG.faint : FG.body, strikethrough: dim }, inner ? /* @__PURE__ */ React44.createElement(Inline, { tokens: inner }) : tok.text)
8474
8508
  );
8475
8509
  }
8476
8510
  if (tok.type === "list") {
8477
- return /* @__PURE__ */ React43.createElement(List, { key: `l-${i}`, token: tok, depth: depth + 1 });
8511
+ return /* @__PURE__ */ React44.createElement(List, { key: `l-${i}`, token: tok, depth: depth + 1 });
8478
8512
  }
8479
- return /* @__PURE__ */ React43.createElement(BlockToken, { key: `b-${i}-${tok.type}`, token: tok });
8513
+ return /* @__PURE__ */ React44.createElement(BlockToken, { key: `b-${i}-${tok.type}`, token: tok });
8480
8514
  })));
8481
8515
  }
8482
8516
  function CodeBlock2({ token }) {
8483
8517
  const lang = token.lang?.split(/\s+/)[0] ?? "";
8484
8518
  const colored = highlightCode(token.text, lang);
8485
8519
  const lines = colored.split("\n");
8486
- return /* @__PURE__ */ React43.createElement(Box36, { flexDirection: "column" }, lang ? /* @__PURE__ */ React43.createElement(Box36, null, /* @__PURE__ */ React43.createElement(Text37, { color: FG.meta }, ` ${lang}`)) : null, /* @__PURE__ */ React43.createElement(Box36, { flexDirection: "column" }, lines.map((line, i) => (
8520
+ return /* @__PURE__ */ React44.createElement(Box37, { flexDirection: "column" }, lang ? /* @__PURE__ */ React44.createElement(Box37, null, /* @__PURE__ */ React44.createElement(Text38, { color: FG.meta }, ` ${lang}`)) : null, /* @__PURE__ */ React44.createElement(Box37, { flexDirection: "column" }, lines.map((line, i) => (
8487
8521
  // biome-ignore lint/suspicious/noArrayIndexKey: code lines are positional and stable per render
8488
- /* @__PURE__ */ React43.createElement(Text37, { key: `code-${i}`, backgroundColor: SURFACE.bgElev }, ` ${line} `)
8522
+ /* @__PURE__ */ React44.createElement(Text38, { key: `code-${i}`, backgroundColor: SURFACE.bgElev }, ` ${line} `)
8489
8523
  ))));
8490
8524
  }
8491
8525
  function highlightCode(source, lang) {
@@ -8498,7 +8532,7 @@ function highlightCode(source, lang) {
8498
8532
  }
8499
8533
  }
8500
8534
  function Blockquote({ token }) {
8501
- return /* @__PURE__ */ React43.createElement(Box36, { flexDirection: "column" }, (token.tokens ?? []).map((child, i) => /* @__PURE__ */ React43.createElement(Box36, { key: `${i}-${child.type}`, flexDirection: "row" }, /* @__PURE__ */ React43.createElement(Text37, { color: TONE.brand }, " \u258E "), /* @__PURE__ */ React43.createElement(Box36, { flexDirection: "column", flexGrow: 1 }, child.type === "paragraph" ? /* @__PURE__ */ React43.createElement(Text37, { italic: true, color: FG.sub }, /* @__PURE__ */ React43.createElement(Inline, { tokens: child.tokens ?? [] })) : /* @__PURE__ */ React43.createElement(BlockToken, { token: child })))));
8535
+ return /* @__PURE__ */ React44.createElement(Box37, { flexDirection: "column" }, (token.tokens ?? []).map((child, i) => /* @__PURE__ */ React44.createElement(Box37, { key: `${i}-${child.type}`, flexDirection: "row" }, /* @__PURE__ */ React44.createElement(Text38, { color: TONE.brand }, " \u258E "), /* @__PURE__ */ React44.createElement(Box37, { flexDirection: "column", flexGrow: 1 }, child.type === "paragraph" ? /* @__PURE__ */ React44.createElement(Text38, { italic: true, color: FG.sub }, /* @__PURE__ */ React44.createElement(Inline, { tokens: child.tokens ?? [] })) : /* @__PURE__ */ React44.createElement(BlockToken, { token: child })))));
8502
8536
  }
8503
8537
  function padToCells(text, cells) {
8504
8538
  const w = stringWidth(text);
@@ -8508,7 +8542,7 @@ function padToCells(text, cells) {
8508
8542
  function HorizontalRule() {
8509
8543
  const width = useWidth();
8510
8544
  const rule = "\u2500".repeat(Math.max(width, 1));
8511
- return /* @__PURE__ */ React43.createElement(Text37, { color: FG.faint }, ` ${rule}`);
8545
+ return /* @__PURE__ */ React44.createElement(Text38, { color: FG.faint }, ` ${rule}`);
8512
8546
  }
8513
8547
  function tableLayout(headerCells, bodyCells, availableWidth) {
8514
8548
  const colCount = headerCells.length;
@@ -8536,7 +8570,7 @@ function Table({ token }) {
8536
8570
  const bodyCells = token.rows.map((row2) => row2.map((c) => plainText(c.tokens)));
8537
8571
  const layout = tableLayout(headerCells, bodyCells, width);
8538
8572
  if (!layout.fallback)
8539
- return /* @__PURE__ */ React43.createElement(
8573
+ return /* @__PURE__ */ React44.createElement(
8540
8574
  ColumnarTable,
8541
8575
  {
8542
8576
  headerCells,
@@ -8546,7 +8580,7 @@ function Table({ token }) {
8546
8580
  gap: layout.gap
8547
8581
  }
8548
8582
  );
8549
- return /* @__PURE__ */ React43.createElement(
8583
+ return /* @__PURE__ */ React44.createElement(
8550
8584
  FallbackTable,
8551
8585
  {
8552
8586
  headerCells,
@@ -8564,14 +8598,14 @@ function ColumnarTable({
8564
8598
  gap
8565
8599
  }) {
8566
8600
  const ruleRow = widths.map((w) => "\u2500".repeat(w)).join(gap);
8567
- return /* @__PURE__ */ React43.createElement(Box36, { flexDirection: "column" }, /* @__PURE__ */ React43.createElement(Box36, null, /* @__PURE__ */ React43.createElement(Text37, null, " "), headerCells.map((cell, i) => (
8601
+ return /* @__PURE__ */ React44.createElement(Box37, { flexDirection: "column" }, /* @__PURE__ */ React44.createElement(Box37, null, /* @__PURE__ */ React44.createElement(Text38, null, " "), headerCells.map((cell, i) => (
8568
8602
  // biome-ignore lint/suspicious/noArrayIndexKey: header cells positional
8569
- /* @__PURE__ */ React43.createElement(React43.Fragment, { key: `h-${i}` }, /* @__PURE__ */ React43.createElement(Text37, { bold: true, color: FG.sub }, padToCells(cell, widths[i])), i < colCount - 1 ? /* @__PURE__ */ React43.createElement(Text37, null, gap) : null)
8570
- ))), /* @__PURE__ */ React43.createElement(Box36, null, /* @__PURE__ */ React43.createElement(Text37, null, " "), /* @__PURE__ */ React43.createElement(Text37, { color: FG.faint }, ruleRow)), bodyCells.map((row2, ri) => (
8603
+ /* @__PURE__ */ React44.createElement(React44.Fragment, { key: `h-${i}` }, /* @__PURE__ */ React44.createElement(Text38, { bold: true, color: FG.sub }, padToCells(cell, widths[i])), i < colCount - 1 ? /* @__PURE__ */ React44.createElement(Text38, null, gap) : null)
8604
+ ))), /* @__PURE__ */ React44.createElement(Box37, null, /* @__PURE__ */ React44.createElement(Text38, null, " "), /* @__PURE__ */ React44.createElement(Text38, { color: FG.faint }, ruleRow)), bodyCells.map((row2, ri) => (
8571
8605
  // biome-ignore lint/suspicious/noArrayIndexKey: body rows positional
8572
- /* @__PURE__ */ React43.createElement(Box36, { key: `tr-${ri}` }, /* @__PURE__ */ React43.createElement(Text37, null, " "), row2.map((cell, i) => (
8606
+ /* @__PURE__ */ React44.createElement(Box37, { key: `tr-${ri}` }, /* @__PURE__ */ React44.createElement(Text38, null, " "), row2.map((cell, i) => (
8573
8607
  // biome-ignore lint/suspicious/noArrayIndexKey: cells positional
8574
- /* @__PURE__ */ React43.createElement(React43.Fragment, { key: `c-${ri}-${i}` }, /* @__PURE__ */ React43.createElement(Text37, { color: FG.body }, padToCells(cell ?? "", widths[i])), i < colCount - 1 ? /* @__PURE__ */ React43.createElement(Text37, null, gap) : null)
8608
+ /* @__PURE__ */ React44.createElement(React44.Fragment, { key: `c-${ri}-${i}` }, /* @__PURE__ */ React44.createElement(Text38, { color: FG.body }, padToCells(cell ?? "", widths[i])), i < colCount - 1 ? /* @__PURE__ */ React44.createElement(Text38, null, gap) : null)
8575
8609
  )))
8576
8610
  )));
8577
8611
  }
@@ -8581,20 +8615,20 @@ function FallbackTable({
8581
8615
  labelPad,
8582
8616
  valueCells
8583
8617
  }) {
8584
- return /* @__PURE__ */ React43.createElement(Box36, { flexDirection: "column" }, bodyCells.map((row2, ri) => (
8618
+ return /* @__PURE__ */ React44.createElement(Box37, { flexDirection: "column" }, bodyCells.map((row2, ri) => (
8585
8619
  // biome-ignore lint/suspicious/noArrayIndexKey: body rows positional
8586
- /* @__PURE__ */ React43.createElement(Box36, { key: `fr-${ri}`, flexDirection: "column" }, ri > 0 ? /* @__PURE__ */ React43.createElement(Text37, null, " ") : null, headerCells.map((h, ci) => {
8620
+ /* @__PURE__ */ React44.createElement(Box37, { key: `fr-${ri}`, flexDirection: "column" }, ri > 0 ? /* @__PURE__ */ React44.createElement(Text38, null, " ") : null, headerCells.map((h, ci) => {
8587
8621
  const label = `${padToCells(h, labelPad - 2)}: `;
8588
8622
  const lines = wrapToCells(row2[ci] ?? "", valueCells);
8589
8623
  return lines.map((line, li) => (
8590
8624
  // biome-ignore lint/suspicious/noArrayIndexKey: fallback table lines are positional
8591
- /* @__PURE__ */ React43.createElement(Box36, { key: `fc-${ri}-${ci}-${li}` }, li === 0 ? /* @__PURE__ */ React43.createElement(Text37, { bold: true, color: FG.sub }, label) : /* @__PURE__ */ React43.createElement(Text37, null, padToCells("", labelPad)), /* @__PURE__ */ React43.createElement(Text37, { color: FG.body }, line))
8625
+ /* @__PURE__ */ React44.createElement(Box37, { key: `fc-${ri}-${ci}-${li}` }, li === 0 ? /* @__PURE__ */ React44.createElement(Text38, { bold: true, color: FG.sub }, label) : /* @__PURE__ */ React44.createElement(Text38, null, padToCells("", labelPad)), /* @__PURE__ */ React44.createElement(Text38, { color: FG.body }, line))
8592
8626
  ));
8593
8627
  }))
8594
8628
  )));
8595
8629
  }
8596
8630
  function Inline({ tokens }) {
8597
- return /* @__PURE__ */ React43.createElement(React43.Fragment, null, tokens.map((tok, i) => /* @__PURE__ */ React43.createElement(InlineToken, { key: `${i}-${tok.type}`, token: tok })));
8631
+ return /* @__PURE__ */ React44.createElement(React44.Fragment, null, tokens.map((tok, i) => /* @__PURE__ */ React44.createElement(InlineToken, { key: `${i}-${tok.type}`, token: tok })));
8598
8632
  }
8599
8633
  var FILE_REF_RE2 = /\b([A-Za-z0-9_./@\-]+\.[A-Za-z0-9]{1,6})(?::(\d+)(?:-(\d+))?)?\b/g;
8600
8634
  var MENTION_RE = /(?<![A-Za-z0-9_])@([A-Za-z0-9_./\-]+\.[A-Za-z0-9]{1,6})/g;
@@ -8605,10 +8639,10 @@ function looksLikeFileRef(path, hasLine) {
8605
8639
  return ext.length >= 2;
8606
8640
  }
8607
8641
  function osc8(label, _target, color) {
8608
- return /* @__PURE__ */ React43.createElement(Text37, { color, underline: true }, label);
8642
+ return /* @__PURE__ */ React44.createElement(Text38, { color, underline: true }, label);
8609
8643
  }
8610
8644
  function renderInlineText(raw) {
8611
- if (!raw) return /* @__PURE__ */ React43.createElement(Text37, null, raw);
8645
+ if (!raw) return /* @__PURE__ */ React44.createElement(Text38, null, raw);
8612
8646
  const out = [];
8613
8647
  let cursor = 0;
8614
8648
  const hits = [];
@@ -8619,7 +8653,7 @@ function renderInlineText(raw) {
8619
8653
  hits.push({
8620
8654
  start,
8621
8655
  end,
8622
- node: /* @__PURE__ */ React43.createElement(Text37, { color: TONE.warn, underline: true }, `@${path}`)
8656
+ node: /* @__PURE__ */ React44.createElement(Text38, { color: TONE.warn, underline: true }, `@${path}`)
8623
8657
  });
8624
8658
  }
8625
8659
  for (const m of raw.matchAll(FILE_REF_RE2)) {
@@ -8636,44 +8670,44 @@ function renderInlineText(raw) {
8636
8670
  let key = 0;
8637
8671
  for (const h of hits) {
8638
8672
  if (h.start > cursor) {
8639
- out.push(/* @__PURE__ */ React43.createElement(Text37, { key: `t-${key++}` }, raw.slice(cursor, h.start)));
8673
+ out.push(/* @__PURE__ */ React44.createElement(Text38, { key: `t-${key++}` }, raw.slice(cursor, h.start)));
8640
8674
  }
8641
- out.push(/* @__PURE__ */ React43.createElement(React43.Fragment, { key: `r-${key++}` }, h.node));
8675
+ out.push(/* @__PURE__ */ React44.createElement(React44.Fragment, { key: `r-${key++}` }, h.node));
8642
8676
  cursor = h.end;
8643
8677
  }
8644
- if (cursor < raw.length) out.push(/* @__PURE__ */ React43.createElement(Text37, { key: `t-${key++}` }, raw.slice(cursor)));
8645
- return /* @__PURE__ */ React43.createElement(React43.Fragment, null, out);
8678
+ if (cursor < raw.length) out.push(/* @__PURE__ */ React44.createElement(Text38, { key: `t-${key++}` }, raw.slice(cursor)));
8679
+ return /* @__PURE__ */ React44.createElement(React44.Fragment, null, out);
8646
8680
  }
8647
8681
  function InlineToken({ token }) {
8648
8682
  switch (token.type) {
8649
8683
  case "text": {
8650
8684
  const t2 = token;
8651
- return t2.tokens ? /* @__PURE__ */ React43.createElement(Inline, { tokens: t2.tokens }) : renderInlineText(t2.text);
8685
+ return t2.tokens ? /* @__PURE__ */ React44.createElement(Inline, { tokens: t2.tokens }) : renderInlineText(t2.text);
8652
8686
  }
8653
8687
  case "strong":
8654
- return /* @__PURE__ */ React43.createElement(Text37, { bold: true, color: FG.strong }, /* @__PURE__ */ React43.createElement(Inline, { tokens: token.tokens }));
8688
+ return /* @__PURE__ */ React44.createElement(Text38, { bold: true, color: FG.strong }, /* @__PURE__ */ React44.createElement(Inline, { tokens: token.tokens }));
8655
8689
  case "em":
8656
- return /* @__PURE__ */ React43.createElement(Text37, { italic: true }, /* @__PURE__ */ React43.createElement(Inline, { tokens: token.tokens }));
8690
+ return /* @__PURE__ */ React44.createElement(Text38, { italic: true }, /* @__PURE__ */ React44.createElement(Inline, { tokens: token.tokens }));
8657
8691
  case "codespan":
8658
- return /* @__PURE__ */ React43.createElement(Text37, { color: FG.strong, backgroundColor: SURFACE.bgElev }, ` ${token.text} `);
8692
+ return /* @__PURE__ */ React44.createElement(Text38, { color: FG.strong, backgroundColor: SURFACE.bgElev }, ` ${token.text} `);
8659
8693
  case "del":
8660
- return /* @__PURE__ */ React43.createElement(Text37, { color: TONE.err, strikethrough: true }, /* @__PURE__ */ React43.createElement(Inline, { tokens: token.tokens }));
8694
+ return /* @__PURE__ */ React44.createElement(Text38, { color: TONE.err, strikethrough: true }, /* @__PURE__ */ React44.createElement(Inline, { tokens: token.tokens }));
8661
8695
  case "link": {
8662
8696
  const l = token;
8663
- return /* @__PURE__ */ React43.createElement(Text37, { color: TONE.brand, underline: true }, /* @__PURE__ */ React43.createElement(Inline, { tokens: l.tokens }));
8697
+ return /* @__PURE__ */ React44.createElement(Text38, { color: TONE.brand, underline: true }, /* @__PURE__ */ React44.createElement(Inline, { tokens: l.tokens }));
8664
8698
  }
8665
8699
  case "image": {
8666
8700
  const im = token;
8667
- return /* @__PURE__ */ React43.createElement(Text37, { color: TONE.brand }, `[image: ${im.text || im.href}]`);
8701
+ return /* @__PURE__ */ React44.createElement(Text38, { color: TONE.brand }, `[image: ${im.text || im.href}]`);
8668
8702
  }
8669
8703
  case "br":
8670
- return /* @__PURE__ */ React43.createElement(Text37, null, "\n");
8704
+ return /* @__PURE__ */ React44.createElement(Text38, null, "\n");
8671
8705
  case "escape":
8672
- return /* @__PURE__ */ React43.createElement(Text37, null, token.text);
8706
+ return /* @__PURE__ */ React44.createElement(Text38, null, token.text);
8673
8707
  case "html":
8674
- return /* @__PURE__ */ React43.createElement(Text37, null, token.text);
8708
+ return /* @__PURE__ */ React44.createElement(Text38, null, token.text);
8675
8709
  default:
8676
- return /* @__PURE__ */ React43.createElement(Text37, null, token.raw ?? "");
8710
+ return /* @__PURE__ */ React44.createElement(Text38, null, token.raw ?? "");
8677
8711
  }
8678
8712
  }
8679
8713
  function plainText(tokens) {
@@ -8736,19 +8770,19 @@ function StreamingCard({ card }) {
8736
8770
  });
8737
8771
  useSlowTick();
8738
8772
  const modelBadge = card.model ? modelBadgeFor(card.model) : null;
8739
- const modelPill = modelBadge ? /* @__PURE__ */ React44.createElement(Pill, { label: modelBadge.label, ...PILL_MODEL[modelBadge.kind], bold: false }) : null;
8773
+ const modelPill = modelBadge ? /* @__PURE__ */ React45.createElement(Pill, { label: modelBadge.label, ...PILL_MODEL[modelBadge.kind], bold: false }) : null;
8740
8774
  if (card.done && !card.aborted) {
8741
8775
  const { tokens, tps } = tokenRate(card.text, card.ts, card.endedAt ?? Date.now());
8742
- const ratePill = tokens >= MIN_TOKENS_FOR_RATE && tps !== null ? /* @__PURE__ */ React44.createElement(Pill, { label: `${formatTokenCount(tokens)} tok \xB7 ${tps} t/s`, ...PILL_RATE, bold: false }) : null;
8743
- return /* @__PURE__ */ React44.createElement(Card, { tone: TONE.ok }, /* @__PURE__ */ React44.createElement(
8776
+ const ratePill = tokens >= MIN_TOKENS_FOR_RATE && tps !== null ? /* @__PURE__ */ React45.createElement(Pill, { label: `${formatTokenCount(tokens)} tok \xB7 ${tps} t/s`, ...PILL_RATE, bold: false }) : null;
8777
+ return /* @__PURE__ */ React45.createElement(Card, { tone: TONE.ok }, /* @__PURE__ */ React45.createElement(
8744
8778
  CardHeader,
8745
8779
  {
8746
8780
  glyph: "\u2039",
8747
8781
  tone: TONE.ok,
8748
8782
  title: t("cardTitles.reply"),
8749
- right: /* @__PURE__ */ React44.createElement(React44.Fragment, null, ratePill, modelPill)
8783
+ right: /* @__PURE__ */ React45.createElement(React45.Fragment, null, ratePill, modelPill)
8750
8784
  }
8751
- ), /* @__PURE__ */ React44.createElement(Markdown, { text: card.text }));
8785
+ ), /* @__PURE__ */ React45.createElement(Markdown, { text: card.text }));
8752
8786
  }
8753
8787
  const lineCells = Math.max(20, cols - 4);
8754
8788
  const allLines = card.text.length > 0 ? card.text.split("\n") : [""];
@@ -8761,24 +8795,24 @@ function StreamingCard({ card }) {
8761
8795
  const glyph = aborted ? "\u2039" : "\u25C8";
8762
8796
  const headLabel = aborted ? t("cardLabels.aborted") : t("cardLabels.writing");
8763
8797
  const { tokens: liveTokens, tps: liveTps } = tokenRate(card.text, card.ts, Date.now());
8764
- const liveRatePill = !aborted && liveTokens >= MIN_TOKENS_FOR_RATE && liveTps !== null ? /* @__PURE__ */ React44.createElement(Pill, { label: `${liveTps} t/s`, ...PILL_RATE, bold: false }) : null;
8765
- const expandPill = !aborted ? /* @__PURE__ */ React44.createElement(Pill, { label: expanded ? "expanded \u2303o" : "preview \u2303o", ...PILL_RATE, bold: false }) : null;
8766
- return /* @__PURE__ */ React44.createElement(Card, { tone: headColor }, /* @__PURE__ */ React44.createElement(
8798
+ const liveRatePill = !aborted && liveTokens >= MIN_TOKENS_FOR_RATE && liveTps !== null ? /* @__PURE__ */ React45.createElement(Pill, { label: `${liveTps} t/s`, ...PILL_RATE, bold: false }) : null;
8799
+ const expandPill = !aborted ? /* @__PURE__ */ React45.createElement(Pill, { label: expanded ? "expanded \u2303o" : "preview \u2303o", ...PILL_RATE, bold: false }) : null;
8800
+ return /* @__PURE__ */ React45.createElement(Card, { tone: headColor }, /* @__PURE__ */ React45.createElement(
8767
8801
  CardHeader,
8768
8802
  {
8769
8803
  glyph,
8770
8804
  tone: headColor,
8771
8805
  title: headLabel,
8772
- right: /* @__PURE__ */ React44.createElement(React44.Fragment, null, liveRatePill, expandPill, aborted ? null : /* @__PURE__ */ React44.createElement(Spinner, { kind: "braille", color: TONE_ACTIVE.brand }), modelPill)
8806
+ right: /* @__PURE__ */ React45.createElement(React45.Fragment, null, liveRatePill, expandPill, aborted ? null : /* @__PURE__ */ React45.createElement(Spinner, { kind: "braille", color: TONE_ACTIVE.brand }), modelPill)
8773
8807
  }
8774
- ), expanded && droppedAbove > 0 ? /* @__PURE__ */ React44.createElement(Text38, { color: FG.faint }, t(droppedAbove === 1 ? "cardLabels.earlierLine" : "cardLabels.earlierLines", {
8808
+ ), expanded && droppedAbove > 0 ? /* @__PURE__ */ React45.createElement(Text39, { color: FG.faint }, t(droppedAbove === 1 ? "cardLabels.earlierLine" : "cardLabels.earlierLines", {
8775
8809
  count: droppedAbove
8776
- })) : null, visible.map((line, i) => /* @__PURE__ */ React44.createElement(Box37, { key: `${card.id}:${visualLines.length - visible.length + i}`, flexDirection: "row" }, /* @__PURE__ */ React44.createElement(Text38, { color: aborted ? FG.meta : FG.body }, clipToCells(line, lineCells)))), aborted ? /* @__PURE__ */ React44.createElement(Text38, { color: FG.faint }, t("cardLabels.truncatedByEsc")) : null);
8810
+ })) : null, visible.map((line, i) => /* @__PURE__ */ React45.createElement(Box38, { key: `${card.id}:${visualLines.length - visible.length + i}`, flexDirection: "row" }, /* @__PURE__ */ React45.createElement(Text39, { color: aborted ? FG.meta : FG.body }, clipToCells(line, lineCells)))), aborted ? /* @__PURE__ */ React45.createElement(Text39, { color: FG.faint }, t("cardLabels.truncatedByEsc")) : null);
8777
8811
  }
8778
8812
 
8779
8813
  // src/cli/ui/cards/SubAgentCard.tsx
8780
- import { Box as Box38, Text as Text39 } from "ink";
8781
- import React45, { useContext as useContext6 } from "react";
8814
+ import { Box as Box39, Text as Text40 } from "ink";
8815
+ import React46, { useContext as useContext6 } from "react";
8782
8816
  function SubAgentCard({ card }) {
8783
8817
  const { fg, tone, toneActive } = useThemeTokens();
8784
8818
  const statusColor = {
@@ -8792,7 +8826,7 @@ function SubAgentCard({ card }) {
8792
8826
  const isRunning = card.status === "running";
8793
8827
  const inLive = useContext6(ActiveCardContext);
8794
8828
  const headerMeta2 = isRunning ? runningChildren > 0 ? [`${runningChildren} ${t("cardLabels.runningLabel")}`] : [t("cardLabels.workingLabel")] : [{ text: card.status, color: headColor }];
8795
- return /* @__PURE__ */ React45.createElement(Card, { tone: headColor }, /* @__PURE__ */ React45.createElement(
8829
+ return /* @__PURE__ */ React46.createElement(Card, { tone: headColor }, /* @__PURE__ */ React46.createElement(
8796
8830
  CardHeader,
8797
8831
  {
8798
8832
  glyph: headGlyph,
@@ -8802,7 +8836,7 @@ function SubAgentCard({ card }) {
8802
8836
  subtitle: card.task,
8803
8837
  meta: headerMeta2
8804
8838
  }
8805
- ), card.name ? /* @__PURE__ */ React45.createElement(Text39, { color: fg.faint }, `${t("cardLabels.agent")} \xB7 ${card.name}`) : null, card.tools && card.tools.length > 0 && /* @__PURE__ */ React45.createElement(Text39, { color: fg.faint }, `${t("cardLabels.tools")} \xB7 ${card.tools.join(", ")}`), card.children.map((child) => /* @__PURE__ */ React45.createElement(Box38, { key: child.id, flexDirection: "row", gap: 1 }, inLive ? null : /* @__PURE__ */ React45.createElement(Text39, { color: tone.violet }, "\u258E"), /* @__PURE__ */ React45.createElement(ChildRow, { card: child }))));
8839
+ ), card.name ? /* @__PURE__ */ React46.createElement(Text40, { color: fg.faint }, `${t("cardLabels.agent")} \xB7 ${card.name}`) : null, card.tools && card.tools.length > 0 && /* @__PURE__ */ React46.createElement(Text40, { color: fg.faint }, `${t("cardLabels.tools")} \xB7 ${card.tools.join(", ")}`), card.children.map((child) => /* @__PURE__ */ React46.createElement(Box39, { key: child.id, flexDirection: "row", gap: 1 }, inLive ? null : /* @__PURE__ */ React46.createElement(Text40, { color: tone.violet }, "\u258E"), /* @__PURE__ */ React46.createElement(ChildRow, { card: child }))));
8806
8840
  }
8807
8841
  function isChildDone(card) {
8808
8842
  switch (card.kind) {
@@ -8819,16 +8853,16 @@ function ChildRow({ card }) {
8819
8853
  const { fg, tone } = useThemeTokens();
8820
8854
  const v = childVisual(card, tone.ok, tone.err, fg.faint);
8821
8855
  const isDone = isChildDone(card);
8822
- return /* @__PURE__ */ React45.createElement(React45.Fragment, null, v.statusGlyph, /* @__PURE__ */ React45.createElement(Text39, { color: v.kindColor }, v.kindGlyph), /* @__PURE__ */ React45.createElement(Text39, { dimColor: isDone, color: fg.body }, v.text));
8856
+ return /* @__PURE__ */ React46.createElement(React46.Fragment, null, v.statusGlyph, /* @__PURE__ */ React46.createElement(Text40, { color: v.kindColor }, v.kindGlyph), /* @__PURE__ */ React46.createElement(Text40, { dimColor: isDone, color: fg.body }, v.text));
8823
8857
  }
8824
8858
  function runningGlyph(color) {
8825
- return /* @__PURE__ */ React45.createElement(Spinner, { kind: "circle", color });
8859
+ return /* @__PURE__ */ React46.createElement(Spinner, { kind: "circle", color });
8826
8860
  }
8827
8861
  function doneGlyph(color) {
8828
- return /* @__PURE__ */ React45.createElement(Text39, { color }, "\u2713");
8862
+ return /* @__PURE__ */ React46.createElement(Text40, { color }, "\u2713");
8829
8863
  }
8830
8864
  function failedGlyph(color) {
8831
- return /* @__PURE__ */ React45.createElement(Text39, { color }, "\u2716");
8865
+ return /* @__PURE__ */ React46.createElement(Text40, { color }, "\u2716");
8832
8866
  }
8833
8867
  function childVisual(card, doneColor, failedColor, fallbackColor) {
8834
8868
  switch (card.kind) {
@@ -8873,7 +8907,7 @@ function childVisual(card, doneColor, failedColor, fallbackColor) {
8873
8907
  };
8874
8908
  default:
8875
8909
  return {
8876
- statusGlyph: /* @__PURE__ */ React45.createElement(Text39, { color: fallbackColor }, "\xB7"),
8910
+ statusGlyph: /* @__PURE__ */ React46.createElement(Text40, { color: fallbackColor }, "\xB7"),
8877
8911
  kindGlyph: "\xB7",
8878
8912
  kindColor: fallbackColor,
8879
8913
  text: card.kind
@@ -8882,8 +8916,8 @@ function childVisual(card, doneColor, failedColor, fallbackColor) {
8882
8916
  }
8883
8917
 
8884
8918
  // src/cli/ui/cards/TaskCard.tsx
8885
- import { Box as Box39, Text as Text40 } from "ink";
8886
- import React46 from "react";
8919
+ import { Box as Box40, Text as Text41 } from "ink";
8920
+ import React47 from "react";
8887
8921
  var STEP_GLYPH = {
8888
8922
  queued: "\u25CB",
8889
8923
  running: "\u25B6",
@@ -8909,7 +8943,7 @@ function TaskCard({ card }) {
8909
8943
  failed: tone.err
8910
8944
  };
8911
8945
  const elapsed = `${(card.elapsedMs / 1e3).toFixed(1)}s`;
8912
- return /* @__PURE__ */ React46.createElement(Card, { tone: taskColor[card.status] }, /* @__PURE__ */ React46.createElement(
8946
+ return /* @__PURE__ */ React47.createElement(Card, { tone: taskColor[card.status] }, /* @__PURE__ */ React47.createElement(
8913
8947
  CardHeader,
8914
8948
  {
8915
8949
  glyph: TASK_GLYPH[card.status],
@@ -8918,12 +8952,12 @@ function TaskCard({ card }) {
8918
8952
  subtitle: card.title,
8919
8953
  meta: [elapsed, card.status]
8920
8954
  }
8921
- ), card.steps.map((step) => /* @__PURE__ */ React46.createElement(Box39, { key: step.id, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React46.createElement(Text40, { color: stepColor[step.status] }, STEP_GLYPH[step.status]), /* @__PURE__ */ React46.createElement(Text40, { bold: true, color: fg.body }, (step.toolName ?? "step").padEnd(7)), /* @__PURE__ */ React46.createElement(Text40, { color: fg.sub }, step.title), step.detail ? /* @__PURE__ */ React46.createElement(Text40, { color: fg.faint }, step.detail) : null, step.elapsedMs !== void 0 ? /* @__PURE__ */ React46.createElement(Text40, { color: fg.faint }, `${(step.elapsedMs / 1e3).toFixed(2)}s`) : null)));
8955
+ ), card.steps.map((step) => /* @__PURE__ */ React47.createElement(Box40, { key: step.id, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React47.createElement(Text41, { color: stepColor[step.status] }, STEP_GLYPH[step.status]), /* @__PURE__ */ React47.createElement(Text41, { bold: true, color: fg.body }, (step.toolName ?? "step").padEnd(7)), /* @__PURE__ */ React47.createElement(Text41, { color: fg.sub }, step.title), step.detail ? /* @__PURE__ */ React47.createElement(Text41, { color: fg.faint }, step.detail) : null, step.elapsedMs !== void 0 ? /* @__PURE__ */ React47.createElement(Text41, { color: fg.faint }, `${(step.elapsedMs / 1e3).toFixed(2)}s`) : null)));
8922
8956
  }
8923
8957
 
8924
8958
  // src/cli/ui/cards/TipCard.tsx
8925
- import { Box as Box40, Text as Text41 } from "ink";
8926
- import React47 from "react";
8959
+ import { Box as Box41, Text as Text42 } from "ink";
8960
+ import React48 from "react";
8927
8961
  import stringWidth2 from "string-width";
8928
8962
  var KEY_GUTTER = 4;
8929
8963
  function TipCard({ card }) {
@@ -8931,7 +8965,7 @@ function TipCard({ card }) {
8931
8965
  (max, sec) => sec.rows.reduce((m, r) => Math.max(m, stringWidth2(r.key)), max),
8932
8966
  0
8933
8967
  );
8934
- return /* @__PURE__ */ React47.createElement(Box40, { flexDirection: "column", paddingLeft: 2, marginY: 1 }, /* @__PURE__ */ React47.createElement(Box40, { flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React47.createElement(Box40, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React47.createElement(Text41, { color: TONE.accent, bold: true }, "\u24D8"), /* @__PURE__ */ React47.createElement(Text41, { color: FG.body, bold: true }, card.topic)), card.oneTime ? /* @__PURE__ */ React47.createElement(Text41, { color: FG.faint }, t("ui.tipShownOnce")) : null), card.sections.map((section, i) => /* @__PURE__ */ React47.createElement(Box40, { key: section.title ?? `section-${i}`, flexDirection: "column", marginTop: 1 }, section.title ? /* @__PURE__ */ React47.createElement(Box40, { marginBottom: 0 }, /* @__PURE__ */ React47.createElement(Text41, { color: FG.sub }, section.title)) : null, section.rows.map((row2) => /* @__PURE__ */ React47.createElement(
8968
+ return /* @__PURE__ */ React48.createElement(Box41, { flexDirection: "column", paddingLeft: 2, marginY: 1 }, /* @__PURE__ */ React48.createElement(Box41, { flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React48.createElement(Box41, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React48.createElement(Text42, { color: TONE.accent, bold: true }, "\u24D8"), /* @__PURE__ */ React48.createElement(Text42, { color: FG.body, bold: true }, card.topic)), card.oneTime ? /* @__PURE__ */ React48.createElement(Text42, { color: FG.faint }, t("ui.tipShownOnce")) : null), card.sections.map((section, i) => /* @__PURE__ */ React48.createElement(Box41, { key: section.title ?? `section-${i}`, flexDirection: "column", marginTop: 1 }, section.title ? /* @__PURE__ */ React48.createElement(Box41, { marginBottom: 0 }, /* @__PURE__ */ React48.createElement(Text42, { color: FG.sub }, section.title)) : null, section.rows.map((row2) => /* @__PURE__ */ React48.createElement(
8935
8969
  TipRowRender,
8936
8970
  {
8937
8971
  key: row2.key,
@@ -8939,7 +8973,7 @@ function TipCard({ card }) {
8939
8973
  keyWidth,
8940
8974
  indent: section.title ? 2 : 0
8941
8975
  }
8942
- )))), card.footer ? /* @__PURE__ */ React47.createElement(Box40, { marginTop: 1 }, /* @__PURE__ */ React47.createElement(Text41, { color: FG.faint }, card.footer)) : null);
8976
+ )))), card.footer ? /* @__PURE__ */ React48.createElement(Box41, { marginTop: 1 }, /* @__PURE__ */ React48.createElement(Text42, { color: FG.faint }, card.footer)) : null);
8943
8977
  }
8944
8978
  function TipRowRender({
8945
8979
  row: row2,
@@ -8948,12 +8982,34 @@ function TipRowRender({
8948
8982
  }) {
8949
8983
  const pad = " ".repeat(Math.max(0, keyWidth - stringWidth2(row2.key) + KEY_GUTTER));
8950
8984
  const lead = indent > 0 ? " ".repeat(indent) : "";
8951
- return /* @__PURE__ */ React47.createElement(Box40, { flexDirection: "row" }, lead ? /* @__PURE__ */ React47.createElement(Text41, null, lead) : null, /* @__PURE__ */ React47.createElement(Text41, { color: TONE.accent }, row2.key), /* @__PURE__ */ React47.createElement(Text41, null, pad), /* @__PURE__ */ React47.createElement(Text41, { color: FG.body }, row2.text));
8985
+ return /* @__PURE__ */ React48.createElement(Box41, { flexDirection: "row" }, lead ? /* @__PURE__ */ React48.createElement(Text42, null, lead) : null, /* @__PURE__ */ React48.createElement(Text42, { color: TONE.accent }, row2.key), /* @__PURE__ */ React48.createElement(Text42, null, pad), /* @__PURE__ */ React48.createElement(Text42, { color: FG.body }, row2.text));
8952
8986
  }
8953
8987
 
8954
8988
  // src/cli/ui/cards/ToolCard.tsx
8955
- import { Text as Text42, useStdout as useStdout12 } from "ink";
8956
- import React48 from "react";
8989
+ import { Text as Text43, useStdout as useStdout12 } from "ink";
8990
+ import React50 from "react";
8991
+
8992
+ // src/cli/ui/state/inflight-context.tsx
8993
+ import React49, { createContext as createContext4, useContext as useContext7, useSyncExternalStore } from "react";
8994
+ var Ctx = createContext4(null);
8995
+ function InflightProvider({
8996
+ inflight,
8997
+ children
8998
+ }) {
8999
+ return /* @__PURE__ */ React49.createElement(Ctx.Provider, { value: inflight }, children);
9000
+ }
9001
+ function useIsInflight(id) {
9002
+ const inflight = useContext7(Ctx);
9003
+ return useSyncExternalStore(
9004
+ (cb) => inflight ? inflight.subscribe(cb) : noop,
9005
+ () => inflight ? inflight.has(id) : false,
9006
+ () => false
9007
+ );
9008
+ }
9009
+ var noop = () => {
9010
+ };
9011
+
9012
+ // src/cli/ui/cards/ToolCard.tsx
8957
9013
  var READ_TAIL = 2;
8958
9014
  var OTHER_TAIL = 5;
8959
9015
  function tailLinesFor(name) {
@@ -8971,7 +9027,8 @@ function ToolCard({ card }) {
8971
9027
  const truncated = allLines.length > tail;
8972
9028
  const visible = truncated ? allLines.slice(-tail) : allLines;
8973
9029
  const hidden = truncated ? allLines.length - visible.length : 0;
8974
- const status2 = toolStatus(card);
9030
+ const isInflight = useIsInflight(card.id);
9031
+ const status2 = toolStatus(card, isInflight);
8975
9032
  const headColor = headerColorFor(status2);
8976
9033
  const errColor = card.exitCode && card.exitCode !== 0 ? TONE.err : FG.sub;
8977
9034
  const showBody = !card.rejected && (subagentMarkdown !== null || visible.length > 0);
@@ -8983,7 +9040,7 @@ function ToolCard({ card }) {
8983
9040
  meta.push({ text: t("cardLabels.rejected"), color: TONE.err });
8984
9041
  }
8985
9042
  for (const part of metaTrail(card)) meta.push(part);
8986
- return /* @__PURE__ */ React48.createElement(Card, { tone: headColor }, /* @__PURE__ */ React48.createElement(
9043
+ return /* @__PURE__ */ React50.createElement(Card, { tone: headColor }, /* @__PURE__ */ React50.createElement(
8987
9044
  CardHeader,
8988
9045
  {
8989
9046
  glyph: statusGlyph2(status2),
@@ -8991,12 +9048,12 @@ function ToolCard({ card }) {
8991
9048
  title: card.name,
8992
9049
  subtitle: argsLabel || void 0,
8993
9050
  meta: meta.length > 0 ? meta : void 0,
8994
- right: status2 === "running" ? /* @__PURE__ */ React48.createElement(Spinner, { kind: "braille", color: TONE_ACTIVE.brand, bold: true }) : void 0
9051
+ right: status2 === "running" ? /* @__PURE__ */ React50.createElement(Spinner, { kind: "braille", color: TONE_ACTIVE.brand, bold: true }) : void 0
8995
9052
  }
8996
- ), showBody && (subagentMarkdown !== null ? /* @__PURE__ */ React48.createElement(Markdown, { text: subagentMarkdown, width: lineCells }) : /* @__PURE__ */ React48.createElement(React48.Fragment, null, hidden > 0 ? /* @__PURE__ */ React48.createElement(Text42, { color: FG.faint }, t(hidden === 1 ? "cardLabels.earlierLine" : "cardLabels.earlierLines", {
9053
+ ), showBody && (subagentMarkdown !== null ? /* @__PURE__ */ React50.createElement(Markdown, { text: subagentMarkdown, width: lineCells }) : /* @__PURE__ */ React50.createElement(React50.Fragment, null, hidden > 0 ? /* @__PURE__ */ React50.createElement(Text43, { color: FG.faint }, t(hidden === 1 ? "cardLabels.earlierLine" : "cardLabels.earlierLines", {
8997
9054
  count: hidden
8998
- })) : null, visible.map((line, i) => /* @__PURE__ */ React48.createElement(
8999
- Text42,
9055
+ })) : null, visible.map((line, i) => /* @__PURE__ */ React50.createElement(
9056
+ Text43,
9000
9057
  {
9001
9058
  key: `${card.id}:${hidden + i}`,
9002
9059
  color: errColor,
@@ -9019,10 +9076,10 @@ function unwrapSubagentMarkdown(card) {
9019
9076
  return null;
9020
9077
  }
9021
9078
  }
9022
- function toolStatus(card) {
9079
+ function toolStatus(card, isInflight) {
9080
+ if (isInflight) return "running";
9023
9081
  if (card.rejected) return "rejected";
9024
9082
  if (card.aborted) return "aborted";
9025
- if (!card.done) return "running";
9026
9083
  if (card.exitCode !== void 0 && card.exitCode !== 0) return "error";
9027
9084
  return "ok";
9028
9085
  }
@@ -9097,8 +9154,8 @@ function formatBytes(n) {
9097
9154
  }
9098
9155
 
9099
9156
  // src/cli/ui/cards/UsageCard.tsx
9100
- import { Box as Box42, Text as Text43 } from "ink";
9101
- import React49 from "react";
9157
+ import { Box as Box43, Text as Text44 } from "ink";
9158
+ import React51 from "react";
9102
9159
  var BAR_CELLS2 = 30;
9103
9160
  function compactNum(n) {
9104
9161
  if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
@@ -9108,10 +9165,10 @@ function compactNum(n) {
9108
9165
  function bar(ratio, color) {
9109
9166
  const filled = Math.max(0, Math.min(BAR_CELLS2, Math.round(ratio * BAR_CELLS2)));
9110
9167
  const empty = BAR_CELLS2 - filled;
9111
- return /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Text43, { color }, "\u2588".repeat(filled)), /* @__PURE__ */ React49.createElement(Text43, { color: FG.faint }, "\u2591".repeat(empty)));
9168
+ return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(Text44, { color }, "\u2588".repeat(filled)), /* @__PURE__ */ React51.createElement(Text44, { color: FG.faint }, "\u2591".repeat(empty)));
9112
9169
  }
9113
9170
  function UsageCard({ card }) {
9114
- if (card.compact) return /* @__PURE__ */ React49.createElement(CompactUsageRow, { card });
9171
+ if (card.compact) return /* @__PURE__ */ React51.createElement(CompactUsageRow, { card });
9115
9172
  const cap = Math.max(1, card.tokens.promptCap);
9116
9173
  const promptRatio = card.tokens.prompt / cap;
9117
9174
  const reasonRatio = card.tokens.reason / cap;
@@ -9121,15 +9178,15 @@ function UsageCard({ card }) {
9121
9178
  formatCost(card.cost, card.balanceCurrency)
9122
9179
  ];
9123
9180
  if (card.elapsedMs !== void 0) headerMeta2.push(`${(card.elapsedMs / 1e3).toFixed(1)}s`);
9124
- return /* @__PURE__ */ React49.createElement(Card, { tone: FG.meta }, /* @__PURE__ */ React49.createElement(CardHeader, { glyph: "\u03A3", tone: FG.meta, title: t("cardTitles.usage"), meta: headerMeta2 }), /* @__PURE__ */ React49.createElement(Box42, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React49.createElement(Text43, { color: FG.sub }, t("cardLabels.prompt")), bar(promptRatio, TONE.brand), /* @__PURE__ */ React49.createElement(Text43, { bold: true, color: FG.body }, card.tokens.prompt.toLocaleString()), /* @__PURE__ */ React49.createElement(Text43, { color: FG.faint }, `/ 1M \xB7 ${(promptRatio * 100).toFixed(1)}%`)), /* @__PURE__ */ React49.createElement(Box42, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React49.createElement(Text43, { color: FG.sub }, t("cardLabels.reason")), bar(reasonRatio, TONE.accent), /* @__PURE__ */ React49.createElement(Text43, { bold: true, color: FG.body }, card.tokens.reason.toLocaleString())), /* @__PURE__ */ React49.createElement(Box42, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React49.createElement(Text43, { color: FG.sub }, t("cardLabels.output")), bar(outputRatio, TONE.brand), /* @__PURE__ */ React49.createElement(Text43, { bold: true, color: FG.body }, card.tokens.output.toLocaleString())), /* @__PURE__ */ React49.createElement(Box42, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React49.createElement(Text43, { color: FG.sub }, t("cardLabels.cache"), " "), bar(card.cacheHit, TONE.ok), /* @__PURE__ */ React49.createElement(Text43, { bold: true, color: TONE.ok }, `${(card.cacheHit * 100).toFixed(1)}%`)), /* @__PURE__ */ React49.createElement(Box42, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React49.createElement(Text43, { color: FG.faint }, t("cardLabels.session")), /* @__PURE__ */ React49.createElement(Text43, { bold: true, color: FG.body }, `\u26C1 ${formatCost(card.sessionCost, card.balanceCurrency, 3)}`), card.balance !== void 0 ? /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Text43, { color: FG.faint }, `\xB7 ${t("cardLabels.balance")}`), /* @__PURE__ */ React49.createElement(Text43, { bold: true, color: TONE.brand }, formatBalance(card.balance, card.balanceCurrency))) : null));
9181
+ return /* @__PURE__ */ React51.createElement(Card, { tone: FG.meta }, /* @__PURE__ */ React51.createElement(CardHeader, { glyph: "\u03A3", tone: FG.meta, title: t("cardTitles.usage"), meta: headerMeta2 }), /* @__PURE__ */ React51.createElement(Box43, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React51.createElement(Text44, { color: FG.sub }, t("cardLabels.prompt")), bar(promptRatio, TONE.brand), /* @__PURE__ */ React51.createElement(Text44, { bold: true, color: FG.body }, card.tokens.prompt.toLocaleString()), /* @__PURE__ */ React51.createElement(Text44, { color: FG.faint }, `/ 1M \xB7 ${(promptRatio * 100).toFixed(1)}%`)), /* @__PURE__ */ React51.createElement(Box43, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React51.createElement(Text44, { color: FG.sub }, t("cardLabels.reason")), bar(reasonRatio, TONE.accent), /* @__PURE__ */ React51.createElement(Text44, { bold: true, color: FG.body }, card.tokens.reason.toLocaleString())), /* @__PURE__ */ React51.createElement(Box43, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React51.createElement(Text44, { color: FG.sub }, t("cardLabels.output")), bar(outputRatio, TONE.brand), /* @__PURE__ */ React51.createElement(Text44, { bold: true, color: FG.body }, card.tokens.output.toLocaleString())), /* @__PURE__ */ React51.createElement(Box43, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React51.createElement(Text44, { color: FG.sub }, t("cardLabels.cache"), " "), bar(card.cacheHit, TONE.ok), /* @__PURE__ */ React51.createElement(Text44, { bold: true, color: TONE.ok }, `${(card.cacheHit * 100).toFixed(1)}%`)), /* @__PURE__ */ React51.createElement(Box43, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React51.createElement(Text44, { color: FG.faint }, t("cardLabels.session")), /* @__PURE__ */ React51.createElement(Text44, { bold: true, color: FG.body }, `\u26C1 ${formatCost(card.sessionCost, card.balanceCurrency, 3)}`), card.balance !== void 0 ? /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(Text44, { color: FG.faint }, `\xB7 ${t("cardLabels.balance")}`), /* @__PURE__ */ React51.createElement(Text44, { bold: true, color: TONE.brand }, formatBalance(card.balance, card.balanceCurrency))) : null));
9125
9182
  }
9126
9183
  function CompactUsageRow({ card }) {
9127
9184
  const elapsed = card.elapsedMs !== void 0 ? ` \xB7 ${(card.elapsedMs / 1e3).toFixed(1)}s` : "";
9128
- return /* @__PURE__ */ React49.createElement(Box42, { flexDirection: "row", gap: 1, marginTop: 1 }, /* @__PURE__ */ React49.createElement(Text43, { color: FG.meta }, "\u03A3"), /* @__PURE__ */ React49.createElement(Text43, { color: FG.faint }, `${t("cardLabels.turn")} ${card.turn}`), /* @__PURE__ */ React49.createElement(Text43, { color: FG.meta }, `\xB7 ${compactNum(card.tokens.prompt)} ${t("cardLabels.prompt")} \xB7 ${compactNum(card.tokens.output)} ${t("cardLabels.output")}`), /* @__PURE__ */ React49.createElement(Text43, { color: FG.faint }, `\xB7 ${t("cardLabels.cache")}`), /* @__PURE__ */ React49.createElement(Text43, { color: TONE.ok }, `${(card.cacheHit * 100).toFixed(0)}%`), /* @__PURE__ */ React49.createElement(Text43, { color: FG.faint }, `\xB7 ${formatCost(card.cost, card.balanceCurrency)}${elapsed}`), card.balance !== void 0 ? /* @__PURE__ */ React49.createElement(Text43, { color: TONE.brand }, `\xB7 ${formatBalance(card.balance, card.balanceCurrency)}`) : null);
9185
+ return /* @__PURE__ */ React51.createElement(Box43, { flexDirection: "row", gap: 1, marginTop: 1 }, /* @__PURE__ */ React51.createElement(Text44, { color: FG.meta }, "\u03A3"), /* @__PURE__ */ React51.createElement(Text44, { color: FG.faint }, `${t("cardLabels.turn")} ${card.turn}`), /* @__PURE__ */ React51.createElement(Text44, { color: FG.meta }, `\xB7 ${compactNum(card.tokens.prompt)} ${t("cardLabels.prompt")} \xB7 ${compactNum(card.tokens.output)} ${t("cardLabels.output")}`), /* @__PURE__ */ React51.createElement(Text44, { color: FG.faint }, `\xB7 ${t("cardLabels.cache")}`), /* @__PURE__ */ React51.createElement(Text44, { color: TONE.ok }, `${(card.cacheHit * 100).toFixed(0)}%`), /* @__PURE__ */ React51.createElement(Text44, { color: FG.faint }, `\xB7 ${formatCost(card.cost, card.balanceCurrency)}${elapsed}`), card.balance !== void 0 ? /* @__PURE__ */ React51.createElement(Text44, { color: TONE.brand }, `\xB7 ${formatBalance(card.balance, card.balanceCurrency)}`) : null);
9129
9186
  }
9130
9187
 
9131
9188
  // src/cli/ui/cards/UserCard.tsx
9132
- import React50 from "react";
9189
+ import React52 from "react";
9133
9190
 
9134
9191
  // src/cli/ui/cards/time.ts
9135
9192
  function formatRelativeTime(ts, now = Date.now()) {
@@ -9146,7 +9203,7 @@ function formatRelativeTime(ts, now = Date.now()) {
9146
9203
 
9147
9204
  // src/cli/ui/cards/UserCard.tsx
9148
9205
  function UserCard({ card }) {
9149
- return /* @__PURE__ */ React50.createElement(Card, { tone: TONE.accent }, /* @__PURE__ */ React50.createElement(
9206
+ return /* @__PURE__ */ React52.createElement(Card, { tone: TONE.accent }, /* @__PURE__ */ React52.createElement(
9150
9207
  CardHeader,
9151
9208
  {
9152
9209
  glyph: "\u203A",
@@ -9155,15 +9212,15 @@ function UserCard({ card }) {
9155
9212
  titleColor: FG.sub,
9156
9213
  meta: [formatRelativeTime(card.ts)]
9157
9214
  }
9158
- ), /* @__PURE__ */ React50.createElement(Markdown, { text: card.text }));
9215
+ ), /* @__PURE__ */ React52.createElement(Markdown, { text: card.text }));
9159
9216
  }
9160
9217
 
9161
9218
  // src/cli/ui/cards/WarnCard.tsx
9162
- import { Text as Text44 } from "ink";
9163
- import React51 from "react";
9219
+ import { Text as Text45 } from "ink";
9220
+ import React53 from "react";
9164
9221
  function WarnCard({ card }) {
9165
9222
  const messageLines = card.message.length > 0 ? card.message.split("\n") : [];
9166
- return /* @__PURE__ */ React51.createElement(Card, { tone: TONE.warn }, /* @__PURE__ */ React51.createElement(
9223
+ return /* @__PURE__ */ React53.createElement(Card, { tone: TONE.warn }, /* @__PURE__ */ React53.createElement(
9167
9224
  CardHeader,
9168
9225
  {
9169
9226
  glyph: "\u26A0",
@@ -9171,57 +9228,57 @@ function WarnCard({ card }) {
9171
9228
  title: card.title,
9172
9229
  meta: card.detail ? [card.detail] : void 0
9173
9230
  }
9174
- ), messageLines.map((line, i) => /* @__PURE__ */ React51.createElement(Text44, { key: `${card.id}:${i}`, color: FG.body }, line || " ")));
9231
+ ), messageLines.map((line, i) => /* @__PURE__ */ React53.createElement(Text45, { key: `${card.id}:${i}`, color: FG.body }, line || " ")));
9175
9232
  }
9176
9233
 
9177
9234
  // src/cli/ui/cards/CardRenderer.tsx
9178
- var CardRenderer = React52.memo(function CardRenderer2({
9235
+ var CardRenderer = React54.memo(function CardRenderer2({
9179
9236
  card
9180
9237
  }) {
9181
- return /* @__PURE__ */ React52.createElement(Box43, { flexDirection: "column" }, renderCard(card));
9238
+ return /* @__PURE__ */ React54.createElement(Box44, { flexDirection: "column" }, renderCard(card));
9182
9239
  });
9183
9240
  function renderCard(card) {
9184
9241
  switch (card.kind) {
9185
9242
  case "user":
9186
- return /* @__PURE__ */ React52.createElement(UserCard, { card });
9243
+ return /* @__PURE__ */ React54.createElement(UserCard, { card });
9187
9244
  case "reasoning":
9188
- return /* @__PURE__ */ React52.createElement(ReasoningCard, { card, expanded: true });
9245
+ return /* @__PURE__ */ React54.createElement(ReasoningCard, { card, expanded: true });
9189
9246
  case "streaming":
9190
- return /* @__PURE__ */ React52.createElement(StreamingCard, { card });
9247
+ return /* @__PURE__ */ React54.createElement(StreamingCard, { card });
9191
9248
  case "tool":
9192
- return /* @__PURE__ */ React52.createElement(ToolCard, { card });
9249
+ return /* @__PURE__ */ React54.createElement(ToolCard, { card });
9193
9250
  case "task":
9194
- return /* @__PURE__ */ React52.createElement(TaskCard, { card });
9251
+ return /* @__PURE__ */ React54.createElement(TaskCard, { card });
9195
9252
  case "plan":
9196
- return /* @__PURE__ */ React52.createElement(PlanCard, { card });
9253
+ return /* @__PURE__ */ React54.createElement(PlanCard, { card });
9197
9254
  case "diff":
9198
- return /* @__PURE__ */ React52.createElement(DiffCard, { card });
9255
+ return /* @__PURE__ */ React54.createElement(DiffCard, { card });
9199
9256
  case "error":
9200
- return /* @__PURE__ */ React52.createElement(ErrorCard, { card });
9257
+ return /* @__PURE__ */ React54.createElement(ErrorCard, { card });
9201
9258
  case "warn":
9202
- return /* @__PURE__ */ React52.createElement(WarnCard, { card });
9259
+ return /* @__PURE__ */ React54.createElement(WarnCard, { card });
9203
9260
  case "usage":
9204
- return /* @__PURE__ */ React52.createElement(UsageCard, { card });
9261
+ return /* @__PURE__ */ React54.createElement(UsageCard, { card });
9205
9262
  case "memory":
9206
- return /* @__PURE__ */ React52.createElement(MemoryCard, { card });
9263
+ return /* @__PURE__ */ React54.createElement(MemoryCard, { card });
9207
9264
  case "subagent":
9208
- return /* @__PURE__ */ React52.createElement(SubAgentCard, { card });
9265
+ return /* @__PURE__ */ React54.createElement(SubAgentCard, { card });
9209
9266
  case "search":
9210
- return /* @__PURE__ */ React52.createElement(SearchCard, { card });
9267
+ return /* @__PURE__ */ React54.createElement(SearchCard, { card });
9211
9268
  case "live":
9212
- return /* @__PURE__ */ React52.createElement(LiveCard, { card });
9269
+ return /* @__PURE__ */ React54.createElement(LiveCard, { card });
9213
9270
  case "tip":
9214
- return /* @__PURE__ */ React52.createElement(TipCard, { card });
9271
+ return /* @__PURE__ */ React54.createElement(TipCard, { card });
9215
9272
  case "ctx":
9216
- return /* @__PURE__ */ React52.createElement(CtxCard, { card });
9273
+ return /* @__PURE__ */ React54.createElement(CtxCard, { card });
9217
9274
  case "doctor":
9218
- return /* @__PURE__ */ React52.createElement(DoctorCard, { card });
9275
+ return /* @__PURE__ */ React54.createElement(DoctorCard, { card });
9219
9276
  default:
9220
- return /* @__PURE__ */ React52.createElement(FallbackCard, { card });
9277
+ return /* @__PURE__ */ React54.createElement(FallbackCard, { card });
9221
9278
  }
9222
9279
  }
9223
9280
  function FallbackCard({ card }) {
9224
- return /* @__PURE__ */ React52.createElement(Box43, { flexDirection: "row" }, /* @__PURE__ */ React52.createElement(Text45, { color: FG.faint }, ` \xB7 ${card.kind} card \xB7 not yet migrated`));
9281
+ return /* @__PURE__ */ React54.createElement(Box44, { flexDirection: "row" }, /* @__PURE__ */ React54.createElement(Text46, { color: FG.faint }, ` \xB7 ${card.kind} card \xB7 not yet migrated`));
9225
9282
  }
9226
9283
 
9227
9284
  // src/cli/ui/layout/CardStream.tsx
@@ -9243,7 +9300,7 @@ function CardStream({
9243
9300
  if (suppressLive && cards.length > 0 && !isFullySettled(cards[cards.length - 1])) {
9244
9301
  visible = cards.slice(0, -1);
9245
9302
  }
9246
- return /* @__PURE__ */ React53.createElement(React53.Fragment, null, scrollRows > 0 ? /* @__PURE__ */ React53.createElement(Text46, { color: FG.faint }, " \u2191 earlier \u2014 PgUp / wheel / \u2191") : null, /* @__PURE__ */ React53.createElement(Box44, { ref: outerRef, flexDirection: "column", flexGrow: 1, overflow: "hidden" }, /* @__PURE__ */ React53.createElement(Box44, { ref: innerRef, flexDirection: "column", marginTop: -scrollRows, flexShrink: 0 }, visible.map((card) => /* @__PURE__ */ React53.createElement(CardRenderer, { key: card.id, card })))));
9303
+ return /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(Box45, { height: 1, flexShrink: 0 }, scrollRows > 0 ? /* @__PURE__ */ React55.createElement(Text47, { color: FG.faint }, " \u2191 earlier \u2014 PgUp / wheel / \u2191") : null), /* @__PURE__ */ React55.createElement(Box45, { ref: outerRef, flexDirection: "column", flexGrow: 1, overflow: "hidden" }, /* @__PURE__ */ React55.createElement(Box45, { ref: innerRef, flexDirection: "column", marginTop: -scrollRows, flexShrink: 0 }, visible.map((card) => /* @__PURE__ */ React55.createElement(CardRenderer, { key: card.id, card })))));
9247
9304
  }
9248
9305
  function isFullySettled(card) {
9249
9306
  switch (card.kind) {
@@ -9263,13 +9320,13 @@ function isFullySettled(card) {
9263
9320
  }
9264
9321
 
9265
9322
  // src/cli/ui/layout/LiveRows.tsx
9266
- import { Box as Box45, Text as Text47 } from "ink";
9267
- import React54 from "react";
9323
+ import { Box as Box46, Text as Text48 } from "ink";
9324
+ import React56 from "react";
9268
9325
  var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
9269
9326
  function ThinkingRow({ text }) {
9270
9327
  const elapsed = useElapsedSeconds();
9271
9328
  const { fg, tone } = useThemeTokens();
9272
- return /* @__PURE__ */ React54.createElement(Box45, { marginY: 1, paddingX: 1, gap: 1 }, /* @__PURE__ */ React54.createElement(Spinner, { kind: "circle", color: TONE.accent }), /* @__PURE__ */ React54.createElement(Text47, { italic: true, color: FG.sub }, text), /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, `${elapsed}s`));
9329
+ return /* @__PURE__ */ React56.createElement(Box46, { marginY: 1, paddingX: 1, gap: 1 }, /* @__PURE__ */ React56.createElement(Spinner, { kind: "circle", color: TONE.accent }), /* @__PURE__ */ React56.createElement(Text48, { italic: true, color: FG.sub }, text), /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, `${elapsed}s`));
9273
9330
  }
9274
9331
  function ModeStatusBar({
9275
9332
  editMode,
@@ -9281,24 +9338,24 @@ function ModeStatusBar({
9281
9338
  }) {
9282
9339
  useSlowTick();
9283
9340
  const running = jobs2?.runningCount() ?? 0;
9284
- const jobsTag = running > 0 ? /* @__PURE__ */ React54.createElement(Text47, { color: TONE.warn, bold: true }, ` \xB7 \u23F5 ${running} job${running === 1 ? "" : "s"}`) : null;
9341
+ const jobsTag = running > 0 ? /* @__PURE__ */ React56.createElement(Text48, { color: TONE.warn, bold: true }, ` \xB7 \u23F5 ${running} job${running === 1 ? "" : "s"}`) : null;
9285
9342
  if (planMode) {
9286
- return /* @__PURE__ */ React54.createElement(ModeBarFrame, null, /* @__PURE__ */ React54.createElement(ModePill, { label: "PLAN MODE", color: TONE.err, flash }), /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, " writes gated \xB7 /plan off to leave"), jobsTag);
9343
+ return /* @__PURE__ */ React56.createElement(ModeBarFrame, null, /* @__PURE__ */ React56.createElement(ModePill, { label: "PLAN MODE", color: TONE.err, flash }), /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, " writes gated \xB7 /plan off to leave"), jobsTag);
9287
9344
  }
9288
9345
  const label = editMode === "yolo" ? "YOLO" : editMode === "auto" ? "AUTO" : "REVIEW";
9289
9346
  const pillColor = editMode === "yolo" ? TONE.err : editMode === "auto" ? TONE.accent : TONE.brand;
9290
9347
  const mid = editMode === "yolo" ? "edits + shell auto \xB7 /undo to roll back" : editMode === "auto" ? "edits land now \xB7 u to undo" : pendingCount > 0 ? `${pendingCount} queued \xB7 y apply \xB7 n discard` : "edits queued \xB7 y apply \xB7 n discard";
9291
- return /* @__PURE__ */ React54.createElement(ModeBarFrame, null, /* @__PURE__ */ React54.createElement(ModePill, { label, color: pillColor, flash }), /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, ` ${mid} \xB7 Shift+Tab to flip`), jobsTag);
9348
+ return /* @__PURE__ */ React56.createElement(ModeBarFrame, null, /* @__PURE__ */ React56.createElement(ModePill, { label, color: pillColor, flash }), /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, ` ${mid} \xB7 Shift+Tab to flip`), jobsTag);
9292
9349
  }
9293
9350
  function ModeBarFrame({ children }) {
9294
- return /* @__PURE__ */ React54.createElement(Box45, { paddingX: 1 }, children);
9351
+ return /* @__PURE__ */ React56.createElement(Box46, { paddingX: 1 }, children);
9295
9352
  }
9296
9353
  function ModePill({
9297
9354
  label,
9298
9355
  color,
9299
9356
  flash
9300
9357
  }) {
9301
- return /* @__PURE__ */ React54.createElement(Text47, { color, bold: true, inverse: flash }, `[${label}]`);
9358
+ return /* @__PURE__ */ React56.createElement(Text48, { color, bold: true, inverse: flash }, `[${label}]`);
9302
9359
  }
9303
9360
  function UndoBanner({
9304
9361
  banner
@@ -9313,7 +9370,7 @@ function UndoBanner({
9313
9370
  const urgent = !paused && remainingSec <= 1;
9314
9371
  const pct = remainingMs / totalMs * 100;
9315
9372
  const tone = paused ? TONE.warn : urgent ? TONE.err : TONE.accent;
9316
- return /* @__PURE__ */ React54.createElement(Box45, { marginY: 1, paddingX: 1 }, /* @__PURE__ */ React54.createElement(Text47, { backgroundColor: TONE.accent, color: "black", bold: true }, ` \u2713 AUTO-APPLIED ${ok}/${total} `), /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, " press "), /* @__PURE__ */ React54.createElement(Text47, { backgroundColor: TONE.brand, color: "black", bold: true }, " u "), /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, paused ? " to undo \xB7 " : " to undo \xB7 "), /* @__PURE__ */ React54.createElement(Text47, { backgroundColor: paused ? TONE.warn : FG.faint, color: "black", bold: true }, " space "), /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, paused ? " to resume " : " to pause "), /* @__PURE__ */ React54.createElement(CharBar, { pct, width: 20, color: tone, showLabel: false }), /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, " "), /* @__PURE__ */ React54.createElement(Text47, { color: tone, bold: urgent || paused }, paused ? `${remainingSec}s \xB7 paused` : `${remainingSec}s`));
9373
+ return /* @__PURE__ */ React56.createElement(Box46, { marginY: 1, paddingX: 1 }, /* @__PURE__ */ React56.createElement(Text48, { backgroundColor: TONE.accent, color: "black", bold: true }, ` \u2713 AUTO-APPLIED ${ok}/${total} `), /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, " press "), /* @__PURE__ */ React56.createElement(Text48, { backgroundColor: TONE.brand, color: "black", bold: true }, " u "), /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, paused ? " to undo \xB7 " : " to undo \xB7 "), /* @__PURE__ */ React56.createElement(Text48, { backgroundColor: paused ? TONE.warn : FG.faint, color: "black", bold: true }, " space "), /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, paused ? " to resume " : " to pause "), /* @__PURE__ */ React56.createElement(CharBar, { pct, width: 20, color: tone, showLabel: false }), /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, " "), /* @__PURE__ */ React56.createElement(Text48, { color: tone, bold: urgent || paused }, paused ? `${remainingSec}s \xB7 paused` : `${remainingSec}s`));
9317
9374
  }
9318
9375
  function subagentPhaseLabel(phase, iter, elapsedMs) {
9319
9376
  if (phase === "summarising") return "summarising findings\u2026";
@@ -9328,7 +9385,7 @@ function SubagentRow({ activity }) {
9328
9385
  const last = activity.lastInner;
9329
9386
  const subtitle = activity.skillName ?? truncate2(activity.task, 48);
9330
9387
  const modelBadge = activity.model ? modelBadgeFor(activity.model) : null;
9331
- return /* @__PURE__ */ React54.createElement(Card, { tone: CARD.subagent.color }, /* @__PURE__ */ React54.createElement(
9388
+ return /* @__PURE__ */ React56.createElement(Card, { tone: CARD.subagent.color }, /* @__PURE__ */ React56.createElement(
9332
9389
  CardHeader,
9333
9390
  {
9334
9391
  glyph: "\u232C",
@@ -9338,9 +9395,9 @@ function SubagentRow({ activity }) {
9338
9395
  titleBg: PILL_SECTION.plan.bg,
9339
9396
  subtitle,
9340
9397
  meta: [`iter ${activity.iter}`, `${seconds}s`],
9341
- right: /* @__PURE__ */ React54.createElement(React54.Fragment, null, modelBadge ? /* @__PURE__ */ React54.createElement(Pill, { label: modelBadge.label, ...PILL_MODEL[modelBadge.kind], bold: false }) : null, /* @__PURE__ */ React54.createElement(Spinner, { kind: "braille", color: CARD.subagent.color }))
9398
+ right: /* @__PURE__ */ React56.createElement(React56.Fragment, null, modelBadge ? /* @__PURE__ */ React56.createElement(Pill, { label: modelBadge.label, ...PILL_MODEL[modelBadge.kind], bold: false }) : null, /* @__PURE__ */ React56.createElement(Spinner, { kind: "braille", color: CARD.subagent.color }))
9342
9399
  }
9343
- ), /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, "task ", /* @__PURE__ */ React54.createElement(Text47, { color: FG.sub }, activity.task)), /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, "last ", last ? /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Text47, { color: last.color }, `${last.glyph} `), /* @__PURE__ */ React54.createElement(Text47, { color: FG.body }, last.label), last.meta ? /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, ` ${last.meta}`) : null) : /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, "queued\u2026")), /* @__PURE__ */ React54.createElement(Text47, { color: TONE.brand }, "\u25B6 ", phase));
9400
+ ), /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, "task ", /* @__PURE__ */ React56.createElement(Text48, { color: FG.sub }, activity.task)), /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, "last ", last ? /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(Text48, { color: last.color }, `${last.glyph} `), /* @__PURE__ */ React56.createElement(Text48, { color: FG.body }, last.label), last.meta ? /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, ` ${last.meta}`) : null) : /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, "queued\u2026")), /* @__PURE__ */ React56.createElement(Text48, { color: TONE.brand }, "\u25B6 ", phase));
9344
9401
  }
9345
9402
  function SubagentLiveStack({
9346
9403
  activities,
@@ -9348,13 +9405,13 @@ function SubagentLiveStack({
9348
9405
  }) {
9349
9406
  const tick = useTick();
9350
9407
  if (activities.length === 0) return null;
9351
- if (activities.length === 1) return /* @__PURE__ */ React54.createElement(SubagentRow, { activity: activities[0] });
9408
+ if (activities.length === 1) return /* @__PURE__ */ React56.createElement(SubagentRow, { activity: activities[0] });
9352
9409
  const visible = activities.slice(0, max);
9353
9410
  const overflow = activities.length - visible.length;
9354
9411
  const summarising = activities.filter((a) => a.phase === "summarising").length;
9355
9412
  const metaParts = [`${activities.length} running`];
9356
9413
  if (summarising > 0) metaParts.push(`${summarising} summarising`);
9357
- return /* @__PURE__ */ React54.createElement(Card, { tone: CARD.subagent.color }, /* @__PURE__ */ React54.createElement(
9414
+ return /* @__PURE__ */ React56.createElement(Card, { tone: CARD.subagent.color }, /* @__PURE__ */ React56.createElement(
9358
9415
  CardHeader,
9359
9416
  {
9360
9417
  glyph: "\u232C",
@@ -9363,9 +9420,9 @@ function SubagentLiveStack({
9363
9420
  titleColor: PILL_SECTION.plan.fg,
9364
9421
  titleBg: PILL_SECTION.plan.bg,
9365
9422
  subtitle: metaParts.join(" \xB7 "),
9366
- right: /* @__PURE__ */ React54.createElement(Spinner, { kind: "braille", color: CARD.subagent.color })
9423
+ right: /* @__PURE__ */ React56.createElement(Spinner, { kind: "braille", color: CARD.subagent.color })
9367
9424
  }
9368
- ), visible.map((a, i) => /* @__PURE__ */ React54.createElement(CompactSubagentLine, { key: a.runId, activity: a, tick, index: i })), overflow > 0 ? /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, ` +${overflow} more running\u2026`) : null);
9425
+ ), visible.map((a, i) => /* @__PURE__ */ React56.createElement(CompactSubagentLine, { key: a.runId, activity: a, tick, index: i })), overflow > 0 ? /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, ` +${overflow} more running\u2026`) : null);
9369
9426
  }
9370
9427
  function CompactSubagentLine({
9371
9428
  activity,
@@ -9380,7 +9437,7 @@ function CompactSubagentLine({
9380
9437
  const title = activity.skillName ?? truncate2(activity.task, 28);
9381
9438
  const titlePadded = title.padEnd(28);
9382
9439
  const last = activity.lastInner;
9383
- return /* @__PURE__ */ React54.createElement(Box45, { flexDirection: "row" }, /* @__PURE__ */ React54.createElement(Text47, { color: glyphColor, bold: true }, ` ${glyph} `), /* @__PURE__ */ React54.createElement(Text47, { color: FG.body }, titlePadded), /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, ` iter ${String(activity.iter).padStart(2)} \xB7 ${seconds}s \xB7 `), last ? /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Text47, { color: last.color }, `${last.glyph} `), /* @__PURE__ */ React54.createElement(Text47, { color: FG.body }, truncate2(last.label, 18)), last.meta ? /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, ` ${last.meta}`) : null) : /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, "queued\u2026"));
9440
+ return /* @__PURE__ */ React56.createElement(Box46, { flexDirection: "row" }, /* @__PURE__ */ React56.createElement(Text48, { color: glyphColor, bold: true }, ` ${glyph} `), /* @__PURE__ */ React56.createElement(Text48, { color: FG.body }, titlePadded), /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, ` iter ${String(activity.iter).padStart(2)} \xB7 ${seconds}s \xB7 `), last ? /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(Text48, { color: last.color }, `${last.glyph} `), /* @__PURE__ */ React56.createElement(Text48, { color: FG.body }, truncate2(last.label, 18)), last.meta ? /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, ` ${last.meta}`) : null) : /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, "queued\u2026"));
9384
9441
  }
9385
9442
  function truncate2(text, max) {
9386
9443
  return text.length > max ? `${text.slice(0, max)}\u2026` : text;
@@ -9392,7 +9449,7 @@ function OngoingToolRow({
9392
9449
  const tick = useTick();
9393
9450
  const elapsed = useElapsedSeconds();
9394
9451
  const summary = summarizeToolArgs(tool.name, tool.args);
9395
- return /* @__PURE__ */ React54.createElement(Box45, { marginY: 1, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React54.createElement(Box45, null, /* @__PURE__ */ React54.createElement(Text47, { color: CARD.tool.color, bold: true }, SPINNER_FRAMES[tick % SPINNER_FRAMES.length]), /* @__PURE__ */ React54.createElement(Text47, null, " "), /* @__PURE__ */ React54.createElement(Text47, { color: CARD.tool.color, bold: true }, `\u25A3 ${tool.name}`), /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, ` running \xB7 ${elapsed}s`)), progress ? /* @__PURE__ */ React54.createElement(Box45, { paddingLeft: 3 }, /* @__PURE__ */ React54.createElement(Text47, { color: TONE.brand }, renderProgressLine(progress))) : null, summary ? /* @__PURE__ */ React54.createElement(Box45, { paddingLeft: 3 }, /* @__PURE__ */ React54.createElement(Text47, { color: FG.faint }, summary)) : null);
9452
+ return /* @__PURE__ */ React56.createElement(Box46, { marginY: 1, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React56.createElement(Box46, null, /* @__PURE__ */ React56.createElement(Text48, { color: CARD.tool.color, bold: true }, SPINNER_FRAMES[tick % SPINNER_FRAMES.length]), /* @__PURE__ */ React56.createElement(Text48, null, " "), /* @__PURE__ */ React56.createElement(Text48, { color: CARD.tool.color, bold: true }, `\u25A3 ${tool.name}`), /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, ` running \xB7 ${elapsed}s`)), progress ? /* @__PURE__ */ React56.createElement(Box46, { paddingLeft: 3 }, /* @__PURE__ */ React56.createElement(Text48, { color: TONE.brand }, renderProgressLine(progress))) : null, summary ? /* @__PURE__ */ React56.createElement(Box46, { paddingLeft: 3 }, /* @__PURE__ */ React56.createElement(Text48, { color: FG.faint }, summary)) : null);
9396
9453
  }
9397
9454
  function renderProgressLine(p) {
9398
9455
  const msg = p.message ? ` ${p.message}` : "";
@@ -9448,16 +9505,16 @@ function summarizeToolArgs(name, args) {
9448
9505
  }
9449
9506
 
9450
9507
  // src/cli/ui/layout/StatusRow.tsx
9451
- import { Box as Box46, Text as Text49, useStdout as useStdout13 } from "ink";
9452
- import React56 from "react";
9508
+ import { Box as Box47, Text as Text50, useStdout as useStdout13 } from "ink";
9509
+ import React58 from "react";
9453
9510
 
9454
9511
  // src/cli/ui/primitives/Countdown.tsx
9455
- import { Text as Text48 } from "ink";
9456
- import React55 from "react";
9512
+ import { Text as Text49 } from "ink";
9513
+ import React57 from "react";
9457
9514
  function Countdown({ endsAt, color = TONE.brand }) {
9458
9515
  useSlowTick();
9459
9516
  const remainingSec = Math.max(0, Math.ceil((endsAt - Date.now()) / 1e3));
9460
- return /* @__PURE__ */ React55.createElement(Text48, { bold: true, color }, String(remainingSec));
9517
+ return /* @__PURE__ */ React57.createElement(Text49, { bold: true, color }, String(remainingSec));
9461
9518
  }
9462
9519
 
9463
9520
  // src/cli/ui/layout/StatusRow.tsx
@@ -9476,21 +9533,21 @@ function StatusRow() {
9476
9533
  const hasSession = status2.sessionCost > 0;
9477
9534
  const hasBalance = typeof status2.balance === "number";
9478
9535
  const showWallet = cols >= WALLET_MIN_COLS && (hasSession || hasBalance);
9479
- return /* @__PURE__ */ React56.createElement(Box46, { flexDirection: "column", flexShrink: 0, flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Box46, { height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Text49, null, " "), /* @__PURE__ */ React56.createElement(Text49, { color: FG.faint, wrap: "truncate" }, "\u2500".repeat(ruleWidth))), /* @__PURE__ */ React56.createElement(Box46, { flexDirection: "row", height: 1, minHeight: 1, flexWrap: "nowrap", flexShrink: 0 }, /* @__PURE__ */ React56.createElement(Text49, { wrap: "truncate" }, " "), status2.recording ? /* @__PURE__ */ React56.createElement(RecordingPill, { rec: status2.recording }) : status2.countdownSeconds !== void 0 ? /* @__PURE__ */ React56.createElement(CountdownRow, { mode: status2.mode, secondsLeft: status2.countdownSeconds }) : /* @__PURE__ */ React56.createElement(ModePill2, { mode: status2.mode, network: status2.network, detail: status2.networkDetail }), /* @__PURE__ */ React56.createElement(Sep, null), /* @__PURE__ */ React56.createElement(Text49, { color: FG.sub, wrap: "truncate" }, `${session.id} \xB7 ${session.branch}`), hasTurn && /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(Sep, null), /* @__PURE__ */ React56.createElement(Text49, { bold: true, color: TONE.brand, wrap: "truncate" }, "\u25B8 "), /* @__PURE__ */ React56.createElement(Text49, { bold: true, color: FG.body, wrap: "truncate" }, `${formatCost(status2.cost, status2.balanceCurrency)} turn`)), /* @__PURE__ */ React56.createElement(Sep, null), /* @__PURE__ */ React56.createElement(
9480
- Text49,
9536
+ return /* @__PURE__ */ React58.createElement(Box47, { flexDirection: "column", flexShrink: 0, flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(Box47, { height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(Text50, null, " "), /* @__PURE__ */ React58.createElement(Text50, { color: FG.faint, wrap: "truncate" }, "\u2500".repeat(ruleWidth))), /* @__PURE__ */ React58.createElement(Box47, { flexDirection: "row", height: 1, minHeight: 1, flexWrap: "nowrap", flexShrink: 0 }, /* @__PURE__ */ React58.createElement(Text50, { wrap: "truncate" }, " "), status2.recording ? /* @__PURE__ */ React58.createElement(RecordingPill, { rec: status2.recording }) : status2.countdownSeconds !== void 0 ? /* @__PURE__ */ React58.createElement(CountdownRow, { mode: status2.mode, secondsLeft: status2.countdownSeconds }) : /* @__PURE__ */ React58.createElement(ModePill2, { mode: status2.mode, network: status2.network, detail: status2.networkDetail }), /* @__PURE__ */ React58.createElement(Sep, null), /* @__PURE__ */ React58.createElement(Text50, { color: FG.sub, wrap: "truncate" }, `${session.id} \xB7 ${session.branch}`), hasTurn && /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(Sep, null), /* @__PURE__ */ React58.createElement(Text50, { bold: true, color: TONE.brand, wrap: "truncate" }, "\u25B8 "), /* @__PURE__ */ React58.createElement(Text50, { bold: true, color: FG.body, wrap: "truncate" }, `${formatCost(status2.cost, status2.balanceCurrency)} turn`)), /* @__PURE__ */ React58.createElement(Sep, null), /* @__PURE__ */ React58.createElement(
9537
+ Text50,
9481
9538
  {
9482
9539
  color: TONE.accent,
9483
9540
  wrap: "truncate"
9484
9541
  },
9485
9542
  `cache ${Math.round(status2.cacheHit * 100)}%`
9486
- ), showWallet && /* @__PURE__ */ React56.createElement(
9543
+ ), showWallet && /* @__PURE__ */ React58.createElement(
9487
9544
  WalletPill,
9488
9545
  {
9489
9546
  sessionCostUsd: status2.sessionCost,
9490
9547
  balance: status2.balance,
9491
9548
  currency: status2.balanceCurrency
9492
9549
  }
9493
- ), cols >= VERSION_MIN_COLS && /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(Sep, null), /* @__PURE__ */ React56.createElement(Text49, { color: FG.faint, wrap: "truncate" }, `v${VERSION}`), cols >= FEEDBACK_HINT_MIN_COLS && /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(Text49, { color: FG.faint, wrap: "truncate" }, " \xB7 "), /* @__PURE__ */ React56.createElement(Text49, { color: FG.meta, wrap: "truncate" }, "\u2691 "), /* @__PURE__ */ React56.createElement(Text49, { color: FG.sub, wrap: "truncate" }, "/feedback")))));
9550
+ ), cols >= VERSION_MIN_COLS && /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(Sep, null), /* @__PURE__ */ React58.createElement(Text50, { color: FG.faint, wrap: "truncate" }, `v${VERSION}`), cols >= FEEDBACK_HINT_MIN_COLS && /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(Text50, { color: FG.faint, wrap: "truncate" }, " \xB7 "), /* @__PURE__ */ React58.createElement(Text50, { color: FG.meta, wrap: "truncate" }, "\u2691 "), /* @__PURE__ */ React58.createElement(Text50, { color: FG.sub, wrap: "truncate" }, "/feedback")))));
9494
9551
  }
9495
9552
  function WalletPill({
9496
9553
  sessionCostUsd,
@@ -9499,14 +9556,14 @@ function WalletPill({
9499
9556
  }) {
9500
9557
  const showSpent = sessionCostUsd > 0;
9501
9558
  const showBalance = typeof balance === "number";
9502
- return /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(Sep, null), /* @__PURE__ */ React56.createElement(Text49, { color: FG.meta, wrap: "truncate" }, "\u26C1 "), showSpent && /* @__PURE__ */ React56.createElement(
9503
- Text49,
9559
+ return /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(Sep, null), /* @__PURE__ */ React58.createElement(Text50, { color: FG.meta, wrap: "truncate" }, "\u26C1 "), showSpent && /* @__PURE__ */ React58.createElement(
9560
+ Text50,
9504
9561
  {
9505
9562
  color: FG.body,
9506
9563
  wrap: "truncate"
9507
9564
  },
9508
9565
  `${formatCost(sessionCostUsd, currency, 2)} spent`
9509
- ), showSpent && showBalance && /* @__PURE__ */ React56.createElement(Text49, { color: FG.meta, wrap: "truncate" }, " / "), showBalance && /* @__PURE__ */ React56.createElement(Text49, { bold: true, color: balanceColor(balance, currency), wrap: "truncate" }, formatBalance(balance, currency, { fractionDigits: 2 })), showBalance && /* @__PURE__ */ React56.createElement(Text49, { color: FG.faint, wrap: "truncate" }, " left"));
9566
+ ), showSpent && showBalance && /* @__PURE__ */ React58.createElement(Text50, { color: FG.meta, wrap: "truncate" }, " / "), showBalance && /* @__PURE__ */ React58.createElement(Text50, { bold: true, color: balanceColor(balance, currency), wrap: "truncate" }, formatBalance(balance, currency, { fractionDigits: 2 })), showBalance && /* @__PURE__ */ React58.createElement(Text50, { color: FG.faint, wrap: "truncate" }, " left"));
9510
9567
  }
9511
9568
  function ModePill2({
9512
9569
  mode: mode2,
@@ -9515,18 +9572,18 @@ function ModePill2({
9515
9572
  }) {
9516
9573
  if (network === "online") {
9517
9574
  const pill = modeGlyph(mode2);
9518
- return /* @__PURE__ */ React56.createElement(Box46, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Text49, { color: pill.color, wrap: "truncate" }, pill.glyph), /* @__PURE__ */ React56.createElement(Text49, { color: FG.sub, wrap: "truncate" }, ` ${mode2}`));
9575
+ return /* @__PURE__ */ React58.createElement(Box47, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(Text50, { color: pill.color, wrap: "truncate" }, pill.glyph), /* @__PURE__ */ React58.createElement(Text50, { color: FG.sub, wrap: "truncate" }, ` ${mode2}`));
9519
9576
  }
9520
9577
  const dot = networkDot(network);
9521
9578
  if (network === "slow") {
9522
9579
  const tail = detail ? ` \xB7 ${detail}` : "";
9523
- return /* @__PURE__ */ React56.createElement(Box46, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Text49, { color: dot.color, wrap: "truncate" }, dot.glyph), /* @__PURE__ */ React56.createElement(Text49, { color: dot.color, wrap: "truncate" }, ` ${mode2} \xB7 slow${tail}`));
9580
+ return /* @__PURE__ */ React58.createElement(Box47, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(Text50, { color: dot.color, wrap: "truncate" }, dot.glyph), /* @__PURE__ */ React58.createElement(Text50, { color: dot.color, wrap: "truncate" }, ` ${mode2} \xB7 slow${tail}`));
9524
9581
  }
9525
9582
  if (network === "disconnected") {
9526
9583
  const tail = detail ? ` \xB7 ${detail}` : "";
9527
- return /* @__PURE__ */ React56.createElement(Box46, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Text49, { color: dot.color, wrap: "truncate" }, dot.glyph), /* @__PURE__ */ React56.createElement(Text49, { color: dot.color, wrap: "truncate" }, ` disconnect${tail}`));
9584
+ return /* @__PURE__ */ React58.createElement(Box47, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(Text50, { color: dot.color, wrap: "truncate" }, dot.glyph), /* @__PURE__ */ React58.createElement(Text50, { color: dot.color, wrap: "truncate" }, ` disconnect${tail}`));
9528
9585
  }
9529
- return /* @__PURE__ */ React56.createElement(Box46, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Text49, { color: dot.color, wrap: "truncate" }, dot.glyph), /* @__PURE__ */ React56.createElement(Text49, { color: dot.color, wrap: "truncate" }, " reconnecting\u2026"));
9586
+ return /* @__PURE__ */ React58.createElement(Box47, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(Text50, { color: dot.color, wrap: "truncate" }, dot.glyph), /* @__PURE__ */ React58.createElement(Text50, { color: dot.color, wrap: "truncate" }, " reconnecting\u2026"));
9530
9587
  }
9531
9588
  function CountdownRow({
9532
9589
  mode: mode2,
@@ -9534,14 +9591,14 @@ function CountdownRow({
9534
9591
  }) {
9535
9592
  const pill = modeGlyph(mode2);
9536
9593
  const endsAt = Date.now() + secondsLeft * 1e3;
9537
- return /* @__PURE__ */ React56.createElement(Box46, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Text49, { color: pill.color, wrap: "truncate" }, pill.glyph), /* @__PURE__ */ React56.createElement(Text49, { color: FG.sub, wrap: "truncate" }, ` ${mode2} \xB7 `), /* @__PURE__ */ React56.createElement(Text49, { color: TONE.warn, wrap: "truncate" }, "approving in "), /* @__PURE__ */ React56.createElement(Countdown, { endsAt }), /* @__PURE__ */ React56.createElement(Text49, { color: TONE.warn, wrap: "truncate" }, "s \xB7 esc to interrupt"));
9594
+ return /* @__PURE__ */ React58.createElement(Box47, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(Text50, { color: pill.color, wrap: "truncate" }, pill.glyph), /* @__PURE__ */ React58.createElement(Text50, { color: FG.sub, wrap: "truncate" }, ` ${mode2} \xB7 `), /* @__PURE__ */ React58.createElement(Text50, { color: TONE.warn, wrap: "truncate" }, "approving in "), /* @__PURE__ */ React58.createElement(Countdown, { endsAt }), /* @__PURE__ */ React58.createElement(Text50, { color: TONE.warn, wrap: "truncate" }, "s \xB7 esc to interrupt"));
9538
9595
  }
9539
9596
  function RecordingPill({ rec }) {
9540
9597
  const sizeMb = (rec.sizeBytes / (1024 * 1024)).toFixed(1);
9541
- return /* @__PURE__ */ React56.createElement(Box46, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Text49, { bold: true, color: TONE.err, wrap: "truncate" }, "\u25CFREC"), /* @__PURE__ */ React56.createElement(Text49, { color: TONE.err, wrap: "truncate" }, ` ${sizeMb} MB \xB7 ${rec.events} evt`));
9598
+ return /* @__PURE__ */ React58.createElement(Box47, { flexDirection: "row", height: 1, flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(Text50, { bold: true, color: TONE.err, wrap: "truncate" }, "\u25CFREC"), /* @__PURE__ */ React58.createElement(Text50, { color: TONE.err, wrap: "truncate" }, ` ${sizeMb} MB \xB7 ${rec.events} evt`));
9542
9599
  }
9543
9600
  function Sep() {
9544
- return /* @__PURE__ */ React56.createElement(Text49, { color: FG.meta, wrap: "truncate" }, " \xB7 ");
9601
+ return /* @__PURE__ */ React58.createElement(Text50, { color: FG.meta, wrap: "truncate" }, " \xB7 ");
9545
9602
  }
9546
9603
  function modeGlyph(mode2) {
9547
9604
  switch (mode2) {
@@ -9569,8 +9626,8 @@ function networkDot(state) {
9569
9626
  }
9570
9627
 
9571
9628
  // src/cli/ui/layout/ToastRail.tsx
9572
- import { Box as Box47, Text as Text50, useStdout as useStdout14 } from "ink";
9573
- import React57, { useEffect as useEffect8 } from "react";
9629
+ import { Box as Box48, Text as Text51, useStdout as useStdout14 } from "ink";
9630
+ import React59, { useEffect as useEffect8 } from "react";
9574
9631
  var TONE_COLOR = {
9575
9632
  ok: TONE.ok,
9576
9633
  info: TONE.brand,
@@ -9608,17 +9665,17 @@ function ToastRail() {
9608
9665
  }, [toasts, dispatch]);
9609
9666
  const visible = toasts.filter((t2) => now - t2.bornAt < t2.ttlMs);
9610
9667
  if (visible.length === 0) return null;
9611
- return /* @__PURE__ */ React57.createElement(Box47, { flexDirection: "column" }, visible.map((t2) => {
9668
+ return /* @__PURE__ */ React59.createElement(Box48, { flexDirection: "column" }, visible.map((t2) => {
9612
9669
  const color = TONE_COLOR[t2.tone];
9613
9670
  const glyph = TONE_GLYPH[t2.tone];
9614
9671
  const body = bodyColor(t2, now);
9615
9672
  const remainingSec = Math.max(0, Math.ceil((t2.ttlMs - (now - t2.bornAt)) / 1e3));
9616
- return /* @__PURE__ */ React57.createElement(Box47, { key: t2.id, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React57.createElement(Text50, { color }, rule), /* @__PURE__ */ React57.createElement(Box47, { flexDirection: "row" }, /* @__PURE__ */ React57.createElement(Text50, { color }, glyph), /* @__PURE__ */ React57.createElement(Text50, { bold: true, color: body }, ` ${t2.title}`), t2.detail !== void 0 && /* @__PURE__ */ React57.createElement(Text50, { color: FG.sub }, ` \xB7 ${t2.detail}`), /* @__PURE__ */ React57.createElement(Box47, { flexGrow: 1 }), /* @__PURE__ */ React57.createElement(Text50, { color: FG.faint }, `${remainingSec}s`)));
9673
+ return /* @__PURE__ */ React59.createElement(Box48, { key: t2.id, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React59.createElement(Text51, { color }, rule), /* @__PURE__ */ React59.createElement(Box48, { flexDirection: "row" }, /* @__PURE__ */ React59.createElement(Text51, { color }, glyph), /* @__PURE__ */ React59.createElement(Text51, { bold: true, color: body }, ` ${t2.title}`), t2.detail !== void 0 && /* @__PURE__ */ React59.createElement(Text51, { color: FG.sub }, ` \xB7 ${t2.detail}`), /* @__PURE__ */ React59.createElement(Box48, { flexGrow: 1 }), /* @__PURE__ */ React59.createElement(Text51, { color: FG.faint }, `${remainingSec}s`)));
9617
9674
  }));
9618
9675
  }
9619
9676
 
9620
9677
  // src/cli/ui/layout/plan-live-row.tsx
9621
- import React58 from "react";
9678
+ import React60 from "react";
9622
9679
  function isActivePlanInFlight(card) {
9623
9680
  if (card.kind !== "plan") return false;
9624
9681
  if (card.variant !== "active") return false;
@@ -9633,7 +9690,7 @@ function PlanLiveRow() {
9633
9690
  return null;
9634
9691
  });
9635
9692
  if (!planCard) return null;
9636
- return /* @__PURE__ */ React58.createElement(PlanCard, { card: planCard });
9693
+ return /* @__PURE__ */ React60.createElement(PlanCard, { card: planCard });
9637
9694
  }
9638
9695
 
9639
9696
  // src/cli/ui/loop.ts
@@ -11122,8 +11179,8 @@ function writeClipboard(text) {
11122
11179
  }
11123
11180
 
11124
11181
  // src/cli/ui/ctx-breakdown.tsx
11125
- import { Box as Box48, Text as Text51 } from "ink";
11126
- import React59 from "react";
11182
+ import { Box as Box49, Text as Text52 } from "ink";
11183
+ import React61 from "react";
11127
11184
  function computeCtxBreakdown(loop2) {
11128
11185
  const systemTokens = countTokens(loop2.prefix.system);
11129
11186
  const toolsTokens = countTokens(JSON.stringify(loop2.prefix.toolSpecs));
@@ -11778,23 +11835,12 @@ var handlers15 = {
11778
11835
 
11779
11836
  // src/cli/ui/slash/handlers/theme.ts
11780
11837
  var themeChoices = ["auto", ...listThemeNames()];
11781
- function formatThemeStatus() {
11782
- const configured = loadTheme();
11783
- const active = resolveThemePreference(configured, process.env.REASONIX_THEME);
11784
- const source = configured && configured !== "auto" ? "config" : "env/default";
11785
- return [
11786
- `theme: ${active} (${source})`,
11787
- `configured: ${configured ?? "unset"}`,
11788
- `available: ${themeChoices.join(", ")}`,
11789
- "usage: /theme <name|auto>"
11790
- ].join("\n");
11791
- }
11792
11838
  function isThemeChoice(value) {
11793
11839
  return value === "auto" || isThemeName(value);
11794
11840
  }
11795
11841
  var theme = (args) => {
11796
11842
  const next = args[0];
11797
- if (!next) return { info: formatThemeStatus() };
11843
+ if (!next) return { openThemePicker: true };
11798
11844
  if (!isThemeChoice(next)) {
11799
11845
  return { info: `unknown theme: ${next}
11800
11846
  available: ${themeChoices.join(", ")}` };
@@ -11921,9 +11967,9 @@ var TurnTranslator = class {
11921
11967
  this.log.appendStreaming(this.streamingCardId, contentChunk);
11922
11968
  }
11923
11969
  }
11924
- toolStart(name, args) {
11970
+ toolStart(name, args, callId) {
11925
11971
  this.toolStartedAt = Date.now();
11926
- this.toolCardId = this.log.startTool(name, args);
11972
+ this.toolCardId = this.log.startTool(name, args, callId);
11927
11973
  }
11928
11974
  toolEnd(output) {
11929
11975
  if (this.toolCardId) {
@@ -12837,13 +12883,13 @@ var PLAIN_UI = process.env.REASONIX_UI === "plain";
12837
12883
  function LoopStatusRow({
12838
12884
  loop: loop2
12839
12885
  }) {
12840
- const [, setTick] = React60.useState(0);
12841
- React60.useEffect(() => {
12886
+ const [, setTick] = React62.useState(0);
12887
+ React62.useEffect(() => {
12842
12888
  const id = setInterval(() => setTick((t2) => t2 + 1), 1e3);
12843
12889
  return () => clearInterval(id);
12844
12890
  }, []);
12845
12891
  const nextFireMs = Math.max(0, loop2.nextFireAt - Date.now());
12846
- return /* @__PURE__ */ React60.createElement(Box49, null, /* @__PURE__ */ React60.createElement(Text52, { color: "cyan" }, `\u25B8 ${formatLoopStatus(loop2.prompt, nextFireMs, loop2.iter)} \xB7 /loop stop or type to cancel`));
12892
+ return /* @__PURE__ */ React62.createElement(Box50, null, /* @__PURE__ */ React62.createElement(Text53, { color: "cyan" }, `\u25B8 ${formatLoopStatus(loop2.prompt, nextFireMs, loop2.iter)} \xB7 /loop stop or type to cancel`));
12847
12893
  }
12848
12894
  function App(props) {
12849
12895
  markPhase("app_render_start");
@@ -12852,12 +12898,14 @@ function App(props) {
12852
12898
  model: props.model,
12853
12899
  workspace: props.codeMode?.rootDir ?? process.cwd()
12854
12900
  });
12855
- const initialCards = React60.useMemo(
12901
+ const initialCards = React62.useMemo(
12856
12902
  () => props.session ? hydrateCardsFromMessages(loadSessionMessages(props.session)) : [],
12857
12903
  [props.session]
12858
12904
  );
12859
- const themeName = resolveThemePreference(loadTheme(), process.env.REASONIX_THEME);
12860
- return /* @__PURE__ */ React60.createElement(ThemeProvider, { name: themeName }, /* @__PURE__ */ React60.createElement(AgentStoreProvider, { session, initialCards }, /* @__PURE__ */ React60.createElement(AppInner, { ...props })));
12905
+ const [themeName, setThemeName] = React62.useState(
12906
+ () => resolveThemePreference(loadTheme(), process.env.REASONIX_THEME)
12907
+ );
12908
+ return /* @__PURE__ */ React62.createElement(ThemeProvider, { name: themeName }, /* @__PURE__ */ React62.createElement(AgentStoreProvider, { session, initialCards }, /* @__PURE__ */ React62.createElement(AppInner, { ...props, themeName, setThemeName })));
12861
12909
  }
12862
12910
  function AppInner({
12863
12911
  model: model2,
@@ -12873,7 +12921,9 @@ function AppInner({
12873
12921
  codeMode,
12874
12922
  noDashboard,
12875
12923
  onSwitchSession,
12876
- mouse = true
12924
+ mouse = true,
12925
+ themeName,
12926
+ setThemeName
12877
12927
  }) {
12878
12928
  markPhase("app_inner_start");
12879
12929
  const log = useScrollback();
@@ -12989,13 +13039,14 @@ function AppInner({
12989
13039
  const [checkpointPickerList, setCheckpointPickerList] = useState20([]);
12990
13040
  const [pendingMcpHub, setPendingMcpHub] = useState20(null);
12991
13041
  const [pendingModelPicker, setPendingModelPicker] = useState20(false);
13042
+ const [pendingThemePicker, setPendingThemePicker] = useState20(false);
12992
13043
  const [stagedInput, setStagedInput] = useState20(null);
12993
13044
  const [pendingCheckpoint, setPendingCheckpoint] = useState20(null);
12994
13045
  const [stagedCheckpointRevise, setStagedCheckpointRevise] = useState20(null);
12995
13046
  const [pendingRevision, setPendingRevision] = useState20(null);
12996
13047
  const [pendingChoice, setPendingChoice] = useState20(null);
12997
13048
  const [stagedChoiceCustom, setStagedChoiceCustom] = useState20(null);
12998
- const modalOpen = !!pendingShell || !!pendingPlan || !!pendingReviseEditor || !!pendingSessionsPicker || !!pendingCheckpointPicker || !!pendingMcpHub || pendingModelPicker || !!stagedInput || !!pendingEditReview || walkthroughActive || !!pendingChoice || !!stagedChoiceCustom || !!pendingRevision || !!stagedCheckpointRevise || !!pendingCheckpoint;
13049
+ const modalOpen = !!pendingShell || !!pendingPlan || !!pendingReviseEditor || !!pendingSessionsPicker || !!pendingCheckpointPicker || !!pendingMcpHub || pendingModelPicker || pendingThemePicker || !!stagedInput || !!pendingEditReview || walkthroughActive || !!pendingChoice || !!stagedChoiceCustom || !!pendingRevision || !!stagedCheckpointRevise || !!pendingCheckpoint;
12999
13050
  const [planMode, setPlanMode] = useState20(false);
13000
13051
  const [proArmed, setProArmed] = useState20(false);
13001
13052
  const [turnOnPro, setTurnOnPro] = useState20(false);
@@ -13406,12 +13457,7 @@ function AppInner({
13406
13457
  if (key.escape && busy) {
13407
13458
  if (abortedThisTurn.current) return;
13408
13459
  abortedThisTurn.current = true;
13409
- const resolve3 = editReviewResolveRef.current;
13410
- if (resolve3) {
13411
- editReviewResolveRef.current = null;
13412
- setPendingEditReview(null);
13413
- resolve3({ choice: "reject" });
13414
- }
13460
+ resetPendingModals();
13415
13461
  if (isLoopActive()) stopLoop();
13416
13462
  loop2.abort();
13417
13463
  return;
@@ -13606,7 +13652,7 @@ function AppInner({
13606
13652
  if (dashboardRef.current) return dashboardRef.current.url;
13607
13653
  if (dashboardStartingRef.current) return dashboardStartingRef.current;
13608
13654
  const startup = (async () => {
13609
- const { startDashboardServer } = await import("./server-W4XJK4GX.js");
13655
+ const { startDashboardServer } = await import("./server-GNHR5K3N.js");
13610
13656
  const handle = await startDashboardServer({
13611
13657
  mode: "attached",
13612
13658
  configPath: defaultConfigPath(),
@@ -14127,6 +14173,11 @@ function AppInner({
14127
14173
  pushHistory(text);
14128
14174
  return;
14129
14175
  }
14176
+ if (result.openThemePicker) {
14177
+ setPendingThemePicker(true);
14178
+ pushHistory(text);
14179
+ return;
14180
+ }
14130
14181
  if (result.openArgPickerFor) {
14131
14182
  pushHistory(text);
14132
14183
  setInput(`/${result.openArgPickerFor} `);
@@ -14159,6 +14210,7 @@ function AppInner({
14159
14210
  stopLoop,
14160
14211
  quitProcess,
14161
14212
  pushHistory,
14213
+ resetPendingModals,
14162
14214
  text
14163
14215
  });
14164
14216
  if (outcome.kind === "resubmit") {
@@ -14500,6 +14552,24 @@ function AppInner({
14500
14552
  [pendingShell, codeMode, currentRootDir, log]
14501
14553
  );
14502
14554
  const pendingGateIdRef = useRef9(null);
14555
+ const resetPendingModals = useCallback11(() => {
14556
+ const editResolve = editReviewResolveRef.current;
14557
+ if (editResolve) {
14558
+ editReviewResolveRef.current = null;
14559
+ setPendingEditReview(null);
14560
+ editResolve({ choice: "reject" });
14561
+ }
14562
+ setPendingShell(null);
14563
+ setPendingPlan(null);
14564
+ setPendingCheckpoint(null);
14565
+ setPendingRevision(null);
14566
+ setPendingChoice(null);
14567
+ setStagedInput(null);
14568
+ setStagedChoiceCustom(null);
14569
+ setStagedCheckpointRevise(null);
14570
+ pendingGateIdRef.current = null;
14571
+ pauseGate.cancelAll();
14572
+ }, []);
14503
14573
  useEffect12(() => {
14504
14574
  if (!busy && queuedSubmit !== null) {
14505
14575
  const text = queuedSubmit;
@@ -14875,14 +14945,14 @@ function AppInner({
14875
14945
  []
14876
14946
  );
14877
14947
  const tickerSuspended = PLAIN_UI || modalOpen || !busy && !isStreaming;
14878
- return /* @__PURE__ */ React60.createElement(React60.Fragment, null, /* @__PURE__ */ React60.createElement(TickerProvider, { disabled: tickerSuspended }, /* @__PURE__ */ React60.createElement(ViewportBudgetProvider, null, /* @__PURE__ */ React60.createElement(Box49, { flexDirection: "row", height: stdout?.rows ?? 24 }, /* @__PURE__ */ React60.createElement(Box49, { flexDirection: "column", flexGrow: 1 }, /* @__PURE__ */ React60.createElement(Box49, { flexDirection: "column", flexGrow: 1 }, /* @__PURE__ */ React60.createElement(LiveExpandContext.Provider, { value: liveExpand }, /* @__PURE__ */ React60.createElement(
14948
+ return /* @__PURE__ */ React62.createElement(React62.Fragment, null, /* @__PURE__ */ React62.createElement(TickerProvider, { disabled: tickerSuspended }, /* @__PURE__ */ React62.createElement(ViewportBudgetProvider, null, /* @__PURE__ */ React62.createElement(InflightProvider, { inflight: loop2.inflight }, /* @__PURE__ */ React62.createElement(Box50, { flexDirection: "row", height: stdout?.rows ?? 24 }, /* @__PURE__ */ React62.createElement(Box50, { flexDirection: "column", flexGrow: 1 }, /* @__PURE__ */ React62.createElement(Box50, { flexDirection: "column", flexGrow: 1 }, /* @__PURE__ */ React62.createElement(LiveExpandContext.Provider, { value: liveExpand }, /* @__PURE__ */ React62.createElement(
14879
14949
  CardStream,
14880
14950
  {
14881
14951
  suppressLive: modalOpen,
14882
14952
  scrollRows: chatScroll.scrollRows,
14883
14953
  onMaxScrollChange: chatScroll.setMaxScroll
14884
14954
  }
14885
- )), !hasConversation && !busy && !isStreaming ? /* @__PURE__ */ React60.createElement(
14955
+ )), !hasConversation && !busy && !isStreaming ? /* @__PURE__ */ React62.createElement(
14886
14956
  WelcomeBanner,
14887
14957
  {
14888
14958
  inCodeMode: !!codeMode,
@@ -14890,7 +14960,7 @@ function AppInner({
14890
14960
  dashboardUrl,
14891
14961
  languageVersion
14892
14962
  }
14893
- ) : null, !PLAIN_UI && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && ongoingTool ? /* @__PURE__ */ React60.createElement(OngoingToolRow, { tool: ongoingTool, progress: toolProgress }) : null, !PLAIN_UI && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && subagentActivities.length > 0 ? /* @__PURE__ */ React60.createElement(SubagentLiveStack, { activities: subagentActivities, max: 3 }) : null, !PLAIN_UI && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && !ongoingTool && statusLine ? /* @__PURE__ */ React60.createElement(ThinkingRow, { text: statusLine }) : null, !PLAIN_UI && undoBanner && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && !pendingChoice && !stagedChoiceCustom && !pendingRevision && !stagedCheckpointRevise && !pendingCheckpoint ? /* @__PURE__ */ React60.createElement(UndoBanner, { banner: undoBanner }) : null, !PLAIN_UI && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && busy && !isStreaming && !ongoingTool && !statusLine ? /* @__PURE__ */ React60.createElement(ThinkingRow, { text: activityLabel }) : null, !PLAIN_UI && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview ? /* @__PURE__ */ React60.createElement(PlanLiveRow, null) : null, /* @__PURE__ */ React60.createElement(ToastRail, null)), stagedInput ? /* @__PURE__ */ React60.createElement(
14963
+ ) : null, !PLAIN_UI && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && ongoingTool ? /* @__PURE__ */ React62.createElement(OngoingToolRow, { tool: ongoingTool, progress: toolProgress }) : null, !PLAIN_UI && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && subagentActivities.length > 0 ? /* @__PURE__ */ React62.createElement(SubagentLiveStack, { activities: subagentActivities, max: 3 }) : null, !PLAIN_UI && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && !ongoingTool && statusLine ? /* @__PURE__ */ React62.createElement(ThinkingRow, { text: statusLine }) : null, !PLAIN_UI && undoBanner && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && !pendingChoice && !stagedChoiceCustom && !pendingRevision && !stagedCheckpointRevise && !pendingCheckpoint ? /* @__PURE__ */ React62.createElement(UndoBanner, { banner: undoBanner }) : null, !PLAIN_UI && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && busy && !isStreaming && !ongoingTool && !statusLine ? /* @__PURE__ */ React62.createElement(ThinkingRow, { text: activityLabel }) : null, !PLAIN_UI && !pendingShell && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview ? /* @__PURE__ */ React62.createElement(PlanLiveRow, null) : null, /* @__PURE__ */ React62.createElement(ToastRail, null)), stagedInput ? /* @__PURE__ */ React62.createElement(
14894
14964
  PlanRefineInput,
14895
14965
  {
14896
14966
  mode: stagedInput.mode,
@@ -14898,21 +14968,21 @@ function AppInner({
14898
14968
  onSubmit: handleStagedInputSubmit,
14899
14969
  onCancel: handleStagedInputCancel
14900
14970
  }
14901
- ) : stagedChoiceCustom ? /* @__PURE__ */ React60.createElement(
14971
+ ) : stagedChoiceCustom ? /* @__PURE__ */ React62.createElement(
14902
14972
  PlanRefineInput,
14903
14973
  {
14904
14974
  mode: "choice-custom",
14905
14975
  onSubmit: handleChoiceCustomSubmit,
14906
14976
  onCancel: handleChoiceCustomCancel
14907
14977
  }
14908
- ) : stagedCheckpointRevise ? /* @__PURE__ */ React60.createElement(
14978
+ ) : stagedCheckpointRevise ? /* @__PURE__ */ React62.createElement(
14909
14979
  PlanRefineInput,
14910
14980
  {
14911
14981
  mode: "checkpoint-revise",
14912
14982
  onSubmit: (text) => handleCheckpointReviseSubmit(text, stagedCheckpointRevise),
14913
14983
  onCancel: handleCheckpointReviseCancel
14914
14984
  }
14915
- ) : pendingChoice ? /* @__PURE__ */ React60.createElement(
14985
+ ) : pendingChoice ? /* @__PURE__ */ React62.createElement(
14916
14986
  ChoiceConfirm,
14917
14987
  {
14918
14988
  question: pendingChoice.question,
@@ -14920,7 +14990,7 @@ function AppInner({
14920
14990
  allowCustom: pendingChoice.allowCustom,
14921
14991
  onChoose: stableHandleChoiceConfirm
14922
14992
  }
14923
- ) : pendingRevision ? /* @__PURE__ */ React60.createElement(
14993
+ ) : pendingRevision ? /* @__PURE__ */ React62.createElement(
14924
14994
  PlanReviseConfirm,
14925
14995
  {
14926
14996
  reason: pendingRevision.reason,
@@ -14931,7 +15001,7 @@ function AppInner({
14931
15001
  summary: pendingRevision.summary,
14932
15002
  onChoose: stableHandleReviseConfirm
14933
15003
  }
14934
- ) : pendingCheckpoint ? /* @__PURE__ */ React60.createElement(
15004
+ ) : pendingCheckpoint ? /* @__PURE__ */ React62.createElement(
14935
15005
  PlanCheckpointConfirm,
14936
15006
  {
14937
15007
  stepId: pendingCheckpoint.stepId,
@@ -14942,7 +15012,7 @@ function AppInner({
14942
15012
  completedStepIds: completedStepIdsRef.current,
14943
15013
  onChoose: stableHandleCheckpointConfirm
14944
15014
  }
14945
- ) : pendingCheckpointPicker ? /* @__PURE__ */ React60.createElement(
15015
+ ) : pendingCheckpointPicker ? /* @__PURE__ */ React62.createElement(
14946
15016
  CheckpointPicker,
14947
15017
  {
14948
15018
  checkpoints: checkpointPickerList,
@@ -14987,7 +15057,7 @@ function AppInner({
14987
15057
  }
14988
15058
  }
14989
15059
  }
14990
- ) : pendingSessionsPicker ? /* @__PURE__ */ React60.createElement(
15060
+ ) : pendingSessionsPicker ? /* @__PURE__ */ React62.createElement(
14991
15061
  SessionPicker,
14992
15062
  {
14993
15063
  sessions: sessionsPickerList,
@@ -15032,7 +15102,25 @@ function AppInner({
15032
15102
  }
15033
15103
  }
15034
15104
  }
15035
- ) : pendingModelPicker ? /* @__PURE__ */ React60.createElement(
15105
+ ) : pendingThemePicker ? /* @__PURE__ */ React62.createElement(
15106
+ ThemePicker,
15107
+ {
15108
+ currentPreference: loadTheme() ?? "auto",
15109
+ activeTheme: themeName,
15110
+ onChoose: (outcome) => {
15111
+ setPendingThemePicker(false);
15112
+ if (outcome.kind === "quit") return;
15113
+ saveTheme(outcome.value);
15114
+ const active = resolveThemePreference(
15115
+ outcome.value,
15116
+ process.env.REASONIX_THEME
15117
+ );
15118
+ setThemeName(active);
15119
+ log.pushInfo(`\u25B8 theme saved: ${outcome.value}
15120
+ active now: ${active}`);
15121
+ }
15122
+ }
15123
+ ) : pendingModelPicker ? /* @__PURE__ */ React62.createElement(
15036
15124
  ModelPicker,
15037
15125
  {
15038
15126
  models,
@@ -15064,7 +15152,7 @@ function AppInner({
15064
15152
  }
15065
15153
  }
15066
15154
  }
15067
- ) : pendingMcpHub ? /* @__PURE__ */ React60.createElement(
15155
+ ) : pendingMcpHub ? /* @__PURE__ */ React62.createElement(
15068
15156
  McpHub,
15069
15157
  {
15070
15158
  initialTab: pendingMcpHub.tab,
@@ -15084,7 +15172,7 @@ function AppInner({
15084
15172
  return r;
15085
15173
  } : void 0
15086
15174
  }
15087
- ) : pendingPlan ? /* @__PURE__ */ React60.createElement(
15175
+ ) : pendingPlan ? /* @__PURE__ */ React62.createElement(
15088
15176
  PlanConfirm,
15089
15177
  {
15090
15178
  plan: pendingPlan,
@@ -15093,7 +15181,7 @@ function AppInner({
15093
15181
  onChoose: stableHandlePlanConfirm,
15094
15182
  projectRoot: currentRootDir
15095
15183
  }
15096
- ) : pendingReviseEditor ? /* @__PURE__ */ React60.createElement(
15184
+ ) : pendingReviseEditor ? /* @__PURE__ */ React62.createElement(
15097
15185
  PlanReviseEditor,
15098
15186
  {
15099
15187
  steps: planStepsRef.current ?? [],
@@ -15112,7 +15200,7 @@ function AppInner({
15112
15200
  setPendingPlan(planText);
15113
15201
  }
15114
15202
  }
15115
- ) : pendingShell ? /* @__PURE__ */ React60.createElement(
15203
+ ) : pendingShell ? /* @__PURE__ */ React62.createElement(
15116
15204
  ShellConfirm,
15117
15205
  {
15118
15206
  command: pendingShell.command,
@@ -15120,7 +15208,7 @@ function AppInner({
15120
15208
  kind: pendingShell.kind,
15121
15209
  onChoose: handleShellConfirm
15122
15210
  }
15123
- ) : pendingEditReview ? /* @__PURE__ */ React60.createElement(
15211
+ ) : pendingEditReview ? /* @__PURE__ */ React62.createElement(
15124
15212
  EditConfirm,
15125
15213
  {
15126
15214
  block: pendingEditReview,
@@ -15132,14 +15220,14 @@ function AppInner({
15132
15220
  }
15133
15221
  }
15134
15222
  }
15135
- ) : walkthroughActive && pendingEdits.current.length > 0 ? /* @__PURE__ */ React60.createElement(
15223
+ ) : walkthroughActive && pendingEdits.current.length > 0 ? /* @__PURE__ */ React62.createElement(
15136
15224
  EditConfirm,
15137
15225
  {
15138
15226
  key: `walk-${pendingTick}`,
15139
15227
  block: pendingEdits.current[0],
15140
15228
  onChoose: handleWalkChoice
15141
15229
  }
15142
- ) : !chatScroll.pinned ? /* @__PURE__ */ React60.createElement(Text52, { color: FG.faint }, " \u{1F4D6} reading history \u2014 End / PgDn to return \xB7 \u2193 to advance one line") : /* @__PURE__ */ React60.createElement(Box49, { flexDirection: "column", flexShrink: 0, flexWrap: "nowrap" }, /* @__PURE__ */ React60.createElement(Box49, { flexDirection: "column", flexShrink: 0, flexWrap: "nowrap" }, codeMode ? /* @__PURE__ */ React60.createElement(
15230
+ ) : !chatScroll.pinned ? /* @__PURE__ */ React62.createElement(Text53, { color: FG.faint }, " \u{1F4D6} reading history \u2014 End / PgDn to return \xB7 \u2193 to advance one line") : /* @__PURE__ */ React62.createElement(Box50, { flexDirection: "column", flexShrink: 0, flexWrap: "nowrap" }, /* @__PURE__ */ React62.createElement(Box50, { flexDirection: "column", flexShrink: 0, flexWrap: "nowrap" }, codeMode ? /* @__PURE__ */ React62.createElement(
15143
15231
  ModeStatusBar,
15144
15232
  {
15145
15233
  editMode,
@@ -15149,7 +15237,7 @@ function AppInner({
15149
15237
  undoArmed: !!undoBanner || hasUndoable(),
15150
15238
  jobs: codeMode.jobs
15151
15239
  }
15152
- ) : null, activeLoop ? /* @__PURE__ */ React60.createElement(LoopStatusRow, { loop: activeLoop }) : null, /* @__PURE__ */ React60.createElement(StatusRow, null), /* @__PURE__ */ React60.createElement(
15240
+ ) : null, activeLoop ? /* @__PURE__ */ React62.createElement(LoopStatusRow, { loop: activeLoop }) : null, /* @__PURE__ */ React62.createElement(StatusRow, null), /* @__PURE__ */ React62.createElement(
15153
15241
  PromptInput,
15154
15242
  {
15155
15243
  value: input,
@@ -15159,7 +15247,7 @@ function AppInner({
15159
15247
  onHistoryPrev: recallPrev,
15160
15248
  onHistoryNext: recallNext
15161
15249
  }
15162
- )), /* @__PURE__ */ React60.createElement(Box49, { flexDirection: "column", flexShrink: 0, flexWrap: "nowrap" }, slashMatches !== null ? /* @__PURE__ */ React60.createElement(
15250
+ )), /* @__PURE__ */ React62.createElement(Box50, { flexDirection: "column", flexShrink: 0, flexWrap: "nowrap" }, slashMatches !== null ? /* @__PURE__ */ React62.createElement(
15163
15251
  SlashSuggestions,
15164
15252
  {
15165
15253
  key: `slash-suggestions:${slashGroupMode ? "group" : "search"}`,
@@ -15168,7 +15256,7 @@ function AppInner({
15168
15256
  groupMode: slashGroupMode,
15169
15257
  advancedHidden: slashAdvancedHidden
15170
15258
  }
15171
- ) : null, atState !== null ? /* @__PURE__ */ React60.createElement(AtMentionSuggestions, { state: atState, selectedIndex: atSelected }) : null), slashArgContext ? /* @__PURE__ */ React60.createElement(
15259
+ ) : null, atState !== null ? /* @__PURE__ */ React62.createElement(AtMentionSuggestions, { state: atState, selectedIndex: atSelected }) : null), slashArgContext ? /* @__PURE__ */ React62.createElement(
15172
15260
  SlashArgPicker,
15173
15261
  {
15174
15262
  matches: slashArgMatches,
@@ -15177,16 +15265,16 @@ function AppInner({
15177
15265
  kind: slashArgContext.kind,
15178
15266
  partial: slashArgContext.partial
15179
15267
  }
15180
- ) : null))))));
15268
+ ) : null)))))));
15181
15269
  }
15182
15270
 
15183
15271
  // src/cli/ui/Setup.tsx
15184
- import { Box as Box50, Text as Text54, useApp } from "ink";
15185
- import React62, { useState as useState21 } from "react";
15272
+ import { Box as Box51, Text as Text55, useApp } from "ink";
15273
+ import React64, { useState as useState21 } from "react";
15186
15274
 
15187
15275
  // src/cli/ui/MaskedInput.tsx
15188
- import { Text as Text53, useInput } from "ink";
15189
- import React61, { useRef as useRef10 } from "react";
15276
+ import { Text as Text54, useInput } from "ink";
15277
+ import React63, { useRef as useRef10 } from "react";
15190
15278
  function stripPasteMarkers(s) {
15191
15279
  return s.replace(/\u001b?\[20[01]~/g, "").replace(/\u001b/g, "");
15192
15280
  }
@@ -15221,11 +15309,11 @@ function MaskedInput({
15221
15309
  });
15222
15310
  if (value.length === 0) {
15223
15311
  if (placeholder.length === 0) {
15224
- return /* @__PURE__ */ React61.createElement(Text53, { inverse: true }, " ");
15312
+ return /* @__PURE__ */ React63.createElement(Text54, { inverse: true }, " ");
15225
15313
  }
15226
- return /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(Text53, { inverse: true }, placeholder[0]), /* @__PURE__ */ React61.createElement(Text53, { color: FG.faint }, placeholder.slice(1)));
15314
+ return /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(Text54, { inverse: true }, placeholder[0]), /* @__PURE__ */ React63.createElement(Text54, { color: FG.faint }, placeholder.slice(1)));
15227
15315
  }
15228
- return /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(Text53, null, mask.repeat(value.length)), /* @__PURE__ */ React61.createElement(Text53, { inverse: true }, " "));
15316
+ return /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(Text54, null, mask.repeat(value.length)), /* @__PURE__ */ React63.createElement(Text54, { inverse: true }, " "));
15229
15317
  }
15230
15318
 
15231
15319
  // src/cli/ui/Setup.tsx
@@ -15252,7 +15340,7 @@ function Setup({ onReady }) {
15252
15340
  }
15253
15341
  onReady(trimmed);
15254
15342
  };
15255
- return /* @__PURE__ */ React62.createElement(Box50, { flexDirection: "column", paddingX: 1, marginY: 1 }, /* @__PURE__ */ React62.createElement(Box50, null, /* @__PURE__ */ React62.createElement(Text54, { bold: true, color: GRADIENT[0] }, GLYPH.brand), /* @__PURE__ */ React62.createElement(Text54, null, " "), /* @__PURE__ */ React62.createElement(Text54, { bold: true }, "Welcome to "), /* @__PURE__ */ React62.createElement(Text54, { bold: true, color: GRADIENT[2] }, "REASONIX")), /* @__PURE__ */ React62.createElement(Box50, { marginTop: 1 }, /* @__PURE__ */ React62.createElement(Text54, { color: COLOR.info }, "Paste your DeepSeek API key to get started.")), /* @__PURE__ */ React62.createElement(Box50, null, /* @__PURE__ */ React62.createElement(Text54, { dimColor: true }, " sign up at \xB7 "), /* @__PURE__ */ React62.createElement(Text54, { color: COLOR.primary }, "https://platform.deepseek.com/api_keys")), /* @__PURE__ */ React62.createElement(Box50, null, /* @__PURE__ */ React62.createElement(Text54, { dimColor: true }, " saved to "), /* @__PURE__ */ React62.createElement(Text54, { dimColor: true }, defaultConfigPath())), /* @__PURE__ */ React62.createElement(Box50, { marginTop: 1 }, /* @__PURE__ */ React62.createElement(Text54, { bold: true, color: COLOR.brand }, GLYPH.bar), /* @__PURE__ */ React62.createElement(Text54, { bold: true, color: COLOR.primary }, " \u203A "), /* @__PURE__ */ React62.createElement(
15343
+ return /* @__PURE__ */ React64.createElement(Box51, { flexDirection: "column", paddingX: 1, marginY: 1 }, /* @__PURE__ */ React64.createElement(Box51, null, /* @__PURE__ */ React64.createElement(Text55, { bold: true, color: GRADIENT[0] }, GLYPH.brand), /* @__PURE__ */ React64.createElement(Text55, null, " "), /* @__PURE__ */ React64.createElement(Text55, { bold: true }, "Welcome to "), /* @__PURE__ */ React64.createElement(Text55, { bold: true, color: GRADIENT[2] }, "REASONIX")), /* @__PURE__ */ React64.createElement(Box51, { marginTop: 1 }, /* @__PURE__ */ React64.createElement(Text55, { color: COLOR.info }, "Paste your DeepSeek API key to get started.")), /* @__PURE__ */ React64.createElement(Box51, null, /* @__PURE__ */ React64.createElement(Text55, { dimColor: true }, " sign up at \xB7 "), /* @__PURE__ */ React64.createElement(Text55, { color: COLOR.primary }, "https://platform.deepseek.com/api_keys")), /* @__PURE__ */ React64.createElement(Box51, null, /* @__PURE__ */ React64.createElement(Text55, { dimColor: true }, " saved to "), /* @__PURE__ */ React64.createElement(Text55, { dimColor: true }, defaultConfigPath())), /* @__PURE__ */ React64.createElement(Box51, { marginTop: 1 }, /* @__PURE__ */ React64.createElement(Text55, { bold: true, color: COLOR.brand }, GLYPH.bar), /* @__PURE__ */ React64.createElement(Text55, { bold: true, color: COLOR.primary }, " \u203A "), /* @__PURE__ */ React64.createElement(
15256
15344
  MaskedInput,
15257
15345
  {
15258
15346
  value,
@@ -15261,7 +15349,7 @@ function Setup({ onReady }) {
15261
15349
  mask: "\u2022",
15262
15350
  placeholder: "sk-..."
15263
15351
  }
15264
- )), error ? /* @__PURE__ */ React62.createElement(Box50, { marginTop: 1 }, /* @__PURE__ */ React62.createElement(Text54, { color: COLOR.err, bold: true }, GLYPH.err), /* @__PURE__ */ React62.createElement(Text54, { color: COLOR.err }, ` ${error}`)) : value ? /* @__PURE__ */ React62.createElement(Box50, { marginTop: 1 }, /* @__PURE__ */ React62.createElement(Text54, { dimColor: true }, ` preview \xB7 ${redactKey(value)}`)) : null, /* @__PURE__ */ React62.createElement(Box50, { marginTop: 1 }, /* @__PURE__ */ React62.createElement(Text54, { dimColor: true }, " /exit to abort")));
15352
+ )), error ? /* @__PURE__ */ React64.createElement(Box51, { marginTop: 1 }, /* @__PURE__ */ React64.createElement(Text55, { color: COLOR.err, bold: true }, GLYPH.err), /* @__PURE__ */ React64.createElement(Text55, { color: COLOR.err }, ` ${error}`)) : value ? /* @__PURE__ */ React64.createElement(Box51, { marginTop: 1 }, /* @__PURE__ */ React64.createElement(Text55, { dimColor: true }, ` preview \xB7 ${redactKey(value)}`)) : null, /* @__PURE__ */ React64.createElement(Box51, { marginTop: 1 }, /* @__PURE__ */ React64.createElement(Text55, { dimColor: true }, " /exit to abort")));
15265
15353
  }
15266
15354
 
15267
15355
  // src/cli/ui/drain-tty.ts
@@ -15472,7 +15560,7 @@ function Root({
15472
15560
  const workspaceRoot = appProps.codeMode?.rootDir ?? process.cwd();
15473
15561
  const [sessions2, setSessions] = useState22(() => listSessionsForWorkspace(workspaceRoot));
15474
15562
  if (!key) {
15475
- return /* @__PURE__ */ React63.createElement(
15563
+ return /* @__PURE__ */ React65.createElement(
15476
15564
  Setup,
15477
15565
  {
15478
15566
  onReady: (k) => {
@@ -15484,7 +15572,7 @@ function Root({
15484
15572
  }
15485
15573
  process.env.DEEPSEEK_API_KEY = key;
15486
15574
  if (pickerOpen) {
15487
- return /* @__PURE__ */ React63.createElement(KeystrokeProvider, null, /* @__PURE__ */ React63.createElement(
15575
+ return /* @__PURE__ */ React65.createElement(KeystrokeProvider, null, /* @__PURE__ */ React65.createElement(
15488
15576
  SessionPicker,
15489
15577
  {
15490
15578
  sessions: sessions2,
@@ -15517,7 +15605,7 @@ function Root({
15517
15605
  }
15518
15606
  ));
15519
15607
  }
15520
- return /* @__PURE__ */ React63.createElement(KeystrokeProvider, null, /* @__PURE__ */ React63.createElement(
15608
+ return /* @__PURE__ */ React65.createElement(KeystrokeProvider, null, /* @__PURE__ */ React65.createElement(
15521
15609
  App,
15522
15610
  {
15523
15611
  key: activeSession ?? "__new__",
@@ -15590,7 +15678,7 @@ async function chatCommand(opts) {
15590
15678
  const showPicker = !opts.session && !opts.forceResume && listSessionsForWorkspace(launchWorkspace).length > 0;
15591
15679
  markPhase("ink_render_call");
15592
15680
  const { waitUntilExit } = render(
15593
- /* @__PURE__ */ React63.createElement(
15681
+ /* @__PURE__ */ React65.createElement(
15594
15682
  Root,
15595
15683
  {
15596
15684
  initialKey,
@@ -15631,4 +15719,4 @@ async function chatCommand(opts) {
15631
15719
  export {
15632
15720
  chatCommand
15633
15721
  };
15634
- //# sourceMappingURL=chunk-3OBWN2NH.js.map
15722
+ //# sourceMappingURL=chunk-NHV5YGTB.js.map