nolo-cli 0.12.0-alpha.1 → 0.12.0-alpha.11

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 (82) hide show
  1. package/{_executeModel-MWAY74HA.js → _executeModel-4F7VZR5U.js} +24 -23
  2. package/{action-RAXNQQKC.js → action-OTOWUMPW.js} +3 -3
  3. package/{addContentAction-ZHI7TVV3.js → addContentAction-JGBUVR7K.js} +2 -2
  4. package/{addDialogAgentAction-JWXPKXNC.js → addDialogAgentAction-V6CL2UCF.js} +1 -1
  5. package/{agentDeleteCommand-LXR5A5FV.js → agentDeleteCommand-MMRSG6AB.js} +15 -14
  6. package/{agentEmailCommands-DXRAP7BB.js → agentEmailCommands-VW5FKADD.js} +28 -27
  7. package/{agentListCommands-ZFMS5ZLY.js → agentListCommands-2PZHIQ3I.js} +16 -15
  8. package/{agentMachineCommands-ZJLYVV52.js → agentMachineCommands-T2R7HVRV.js} +17 -16
  9. package/{agentRecordCommands-DFS626TB.js → agentRecordCommands-5DLPK3IV.js} +28 -27
  10. package/{agentRunCommand-GWBIE2TS.js → agentRunCommand-P6EH5DN7.js} +29 -28
  11. package/{agentRuntimeLocal-YNZSHMZC.js → agentRuntimeLocal-QDJCBXM2.js} +12 -11
  12. package/{agentSlice-T2PXOEPQ.js → agentSlice-6JAJOU3X.js} +2 -2
  13. package/{chunk-G3B356GF.js → chunk-2BVGERJ2.js} +67 -3
  14. package/{chunk-WWU275LU.js → chunk-3MI5LDDU.js} +2 -2
  15. package/{chunk-OPZYGHUC.js → chunk-3WGLLTK4.js} +59 -1
  16. package/chunk-5MMAK75Q.js +15 -0
  17. package/{chunk-ZR4VHQ5D.js → chunk-5S4SWV5G.js} +38 -26
  18. package/{chunk-JUN3HFMN.js → chunk-5V524MHX.js} +25 -15
  19. package/{chunk-5ITRDSHY.js → chunk-7HVCFCZK.js} +65 -18
  20. package/{chunk-JZDIW766.js → chunk-ARSC56DC.js} +1 -1
  21. package/{chunk-3QKO4EHV.js → chunk-AS3ZQ3O2.js} +16 -25
  22. package/{chunk-43UD5ZP7.js → chunk-B4KT7RN2.js} +4 -4
  23. package/{chunk-YTQLJYLB.js → chunk-C3BFP57W.js} +95 -2
  24. package/{chunk-QCA3EPYK.js → chunk-CGDQDXKZ.js} +1 -1
  25. package/{chunk-7MYHLZ3F.js → chunk-DPFWKRHG.js} +1 -1
  26. package/{chunk-LHSJMY5V.js → chunk-E2BT7DBP.js} +3 -3
  27. package/{chunk-AM53Q2SD.js → chunk-FSUZIGIG.js} +28 -39
  28. package/{chunk-4GBNEA5B.js → chunk-H5Y2H2N6.js} +1 -1
  29. package/{chunk-S73OEOHH.js → chunk-JFANOO7I.js} +3 -15
  30. package/{chunk-ZPFRLGIZ.js → chunk-JHYLX2QV.js} +70 -37
  31. package/{chunk-OCDEWRE2.js → chunk-JKWWVF2I.js} +1 -1
  32. package/{chunk-WTYKCU4W.js → chunk-JU7J7EAV.js} +37 -37
  33. package/{chunk-EBH7G34M.js → chunk-LIO7AK5S.js} +2 -2
  34. package/{chunk-6OVCRC72.js → chunk-LUKQQJFL.js} +39 -2
  35. package/{chunk-DRMGJFGQ.js → chunk-MG6BVV3T.js} +31 -17
  36. package/{chunk-RSEUHW6T.js → chunk-MQRZ5QUH.js} +1 -1
  37. package/{chunk-RZ735TLX.js → chunk-MZHSAPZP.js} +167 -20
  38. package/{chunk-OPKKB25T.js → chunk-O4FOPRCP.js} +1 -1
  39. package/{chunk-S3UTETIC.js → chunk-OGGHETUE.js} +19 -4
  40. package/{chunk-4EH7AR52.js → chunk-OPM2DE2J.js} +1 -1
  41. package/{chunk-UG3WOFU6.js → chunk-QJSTNKJY.js} +1 -1
  42. package/{chunk-DE5BA4O6.js → chunk-QUHUVG6Y.js} +2 -2
  43. package/{chunk-YDCZVUFP.js → chunk-RQSOAMPJ.js} +16 -0
  44. package/{chunk-6LMFFG3K.js → chunk-RWO5DGXI.js} +2 -2
  45. package/{chunk-4BTHUYMY.js → chunk-TA7VKOHU.js} +23 -9
  46. package/{chunk-MEVCDATU.js → chunk-TQYYGE6G.js} +3 -3
  47. package/{chunk-TSKWE74T.js → chunk-TYPHUVK5.js} +13 -1
  48. package/{chunk-RNQ5BLR2.js → chunk-VBSWHE5W.js} +1 -1
  49. package/{chunk-NITP2JDG.js → chunk-VKG4HXYV.js} +1 -1
  50. package/{chunk-3HHTVM6G.js → chunk-WVTBAALN.js} +1 -1
  51. package/{chunk-GPZM7QH6.js → chunk-Y5P3ZRGC.js} +4 -4
  52. package/{chunk-GDBCUWQ3.js → chunk-YUMYYXPI.js} +31 -167
  53. package/{createAgentAutomationAction-G32GKDGV.js → createAgentAutomationAction-4NY4JLOK.js} +9 -8
  54. package/{createDialogAction-TISANRZK.js → createDialogAction-I5WUWFJ6.js} +10 -9
  55. package/{createPageAction-O7KOYNV4.js → createPageAction-HFTIQ7TW.js} +9 -8
  56. package/{dbSlice-WDP2ZZHK.js → dbSlice-J4PUZ6Y5.js} +1 -1
  57. package/{dialogCommands-6JPB3YQY.js → dialogCommands-SVXRJFZS.js} +16 -15
  58. package/{dialogSlice-PRHHYSP5.js → dialogSlice-35LA3ZRG.js} +9 -8
  59. package/{docCreateCommands-75E6TZNN.js → docCreateCommands-Z7RIAYKQ.js} +15 -14
  60. package/{docDeleteCommands-EJHLN7LW.js → docDeleteCommands-NEYHUVZF.js} +16 -15
  61. package/{docReadCommands-RJYBC4FS.js → docReadCommands-I4US2SDE.js} +15 -14
  62. package/{docStore-H5VWKT5D.js → docStore-3CP2IO6M.js} +10 -9
  63. package/{docUpdateCommands-MG4CNISV.js → docUpdateCommands-UU5HQBRP.js} +15 -14
  64. package/{getPricing-6TOZXPAU.js → getPricing-UGDJHI7M.js} +2 -2
  65. package/{handleSendMessageAction-QTUGICSZ.js → handleSendMessageAction-FWTLQGOZ.js} +9 -8
  66. package/index.js +36 -36
  67. package/{machineCommands-MAV7M3TK.js → machineCommands-J5JWJQ6I.js} +28 -27
  68. package/{machineWsRunDispatch-ZOEGTKHC.js → machineWsRunDispatch-U476S4G2.js} +27 -26
  69. package/package.json +1 -1
  70. package/{readlineWorkspace-SWQKC7ZS.js → readlineWorkspace-AQCPSGS7.js} +260 -87
  71. package/{removeDialogAgentAction-GTX5AN54.js → removeDialogAgentAction-XUZYQBV4.js} +3 -3
  72. package/{runAgentClientLoop-P25HACXX.js → runAgentClientLoop-FP2K33ZO.js} +20 -19
  73. package/{setDialogExtraReferencesAction-WFQ63KYO.js → setDialogExtraReferencesAction-PTAIFKGM.js} +1 -1
  74. package/{setPrimaryDialogAgentAction-P57FXTSU.js → setPrimaryDialogAgentAction-HRFTDB44.js} +3 -3
  75. package/{settingSlice-CK5YZGNI.js → settingSlice-VGRJUSE5.js} +2 -2
  76. package/{skillDiscovery-ZYHSX7VD.js → skillDiscovery-6M2BZUFN.js} +1 -1
  77. package/{spaceCommands-6O5EFEM5.js → spaceCommands-GN73BCOB.js} +15 -14
  78. package/{spaceSlice-4EXTYXS4.js → spaceSlice-WTFNKOVA.js} +11 -8
  79. package/{streamAgentChatTurn-Q3FJAHG2.js → streamAgentChatTurn-HBAQQVNK.js} +244 -26
  80. package/{tools-AHNQE4GP.js → tools-TPQYTLQZ.js} +15 -14
  81. package/{tuiSummaryLlmCaller-TXLF4MEI.js → tuiSummaryLlmCaller-XDC7WG4K.js} +6 -4
  82. package/{updateDialogTitleAction-XZDVLKVX.js → updateDialogTitleAction-AWXNPUQJ.js} +9 -8
@@ -3,7 +3,7 @@ import {
3
3
  normalizeDialogRecord,
4
4
  readDialogSnapshot,
5
5
  sortDialogs
6
- } from "./chunk-4EH7AR52.js";
6
+ } from "./chunk-OPM2DE2J.js";
7
7
  import {
8
8
  ANSI_ESCAPE_REGEX,
9
9
  CLI_AUTO_TIER_AGENT_KEYS,
@@ -57,7 +57,7 @@ import {
57
57
  visibleWidth,
58
58
  wrapTextToLines,
59
59
  wrapTranscriptLine
60
- } from "./chunk-ZPFRLGIZ.js";
60
+ } from "./chunk-JHYLX2QV.js";
61
61
  import "./chunk-3QAF2LTL.js";
62
62
  import "./chunk-6HYVJV7B.js";
63
63
  import {
@@ -65,18 +65,18 @@ import {
65
65
  listLocalCachedAgents,
66
66
  listRemoteAgents,
67
67
  listRemoteAgentsAcrossServers
68
- } from "./chunk-DE5BA4O6.js";
68
+ } from "./chunk-QUHUVG6Y.js";
69
69
  import "./chunk-ID4G2MAR.js";
70
70
  import {
71
71
  listUserRecordsFromServers
72
- } from "./chunk-OPKKB25T.js";
72
+ } from "./chunk-O4FOPRCP.js";
73
73
  import {
74
74
  createCliLocalRuntimeAdapter,
75
75
  initCliLocale,
76
76
  parseCliLocale,
77
77
  setCliLocale,
78
78
  t
79
- } from "./chunk-5ITRDSHY.js";
79
+ } from "./chunk-7HVCFCZK.js";
80
80
  import "./chunk-TOILAPLH.js";
81
81
  import "./chunk-CMKUBIGW.js";
82
82
  import "./chunk-JBTJAPUF.js";
@@ -86,23 +86,23 @@ import {
86
86
  import {
87
87
  queryUserRecords,
88
88
  readDbRecord
89
- } from "./chunk-QCA3EPYK.js";
90
- import "./chunk-RNQ5BLR2.js";
89
+ } from "./chunk-CGDQDXKZ.js";
90
+ import "./chunk-VBSWHE5W.js";
91
91
  import {
92
92
  resolveCliAgentKeyInput
93
93
  } from "./chunk-VHBWHNVT.js";
94
94
  import "./chunk-LTRXGFMS.js";
95
- import "./chunk-UG3WOFU6.js";
95
+ import "./chunk-QJSTNKJY.js";
96
96
  import "./chunk-ATNTHIZI.js";
97
97
  import "./chunk-JEXVIMYZ.js";
98
98
  import {
99
99
  prepareTools
100
- } from "./chunk-YTQLJYLB.js";
101
- import "./chunk-4GBNEA5B.js";
100
+ } from "./chunk-C3BFP57W.js";
101
+ import "./chunk-H5Y2H2N6.js";
102
102
  import {
103
103
  expandEnabledPacks
104
- } from "./chunk-RZ735TLX.js";
105
- import "./chunk-YDCZVUFP.js";
104
+ } from "./chunk-MZHSAPZP.js";
105
+ import "./chunk-RQSOAMPJ.js";
106
106
  import "./chunk-OOIN7HSO.js";
107
107
  import "./chunk-KQHGZWSV.js";
108
108
  import "./chunk-IVAOVLM7.js";
@@ -110,58 +110,60 @@ import "./chunk-3LY4F7SV.js";
110
110
  import "./chunk-VP4WJWKW.js";
111
111
  import "./chunk-63W5N6P3.js";
112
112
  import "./chunk-VF4K2QE6.js";
113
- import "./chunk-MEVCDATU.js";
114
- import "./chunk-G3B356GF.js";
113
+ import "./chunk-TQYYGE6G.js";
114
+ import "./chunk-2BVGERJ2.js";
115
115
  import "./chunk-VC6OZXO5.js";
116
116
  import "./chunk-OWOHNGCN.js";
117
117
  import {
118
118
  extractReferenceKeysFromMessage
119
- } from "./chunk-AM53Q2SD.js";
119
+ } from "./chunk-FSUZIGIG.js";
120
120
  import {
121
121
  buildBuiltinSummaryContent
122
122
  } from "./chunk-V2J635L5.js";
123
123
  import "./chunk-MRC4Q34M.js";
124
124
  import "./chunk-MTU75CZ2.js";
125
125
  import "./chunk-CWMSB67P.js";
126
- import "./chunk-GPZM7QH6.js";
127
- import "./chunk-6LMFFG3K.js";
126
+ import "./chunk-Y5P3ZRGC.js";
127
+ import "./chunk-RWO5DGXI.js";
128
128
  import "./chunk-Z4NR32XR.js";
129
129
  import "./chunk-M76ECQRD.js";
130
130
  import {
131
131
  buildSkillDiscoveryContextBlock
132
- } from "./chunk-3QKO4EHV.js";
132
+ } from "./chunk-AS3ZQ3O2.js";
133
133
  import "./chunk-WZSRQNQG.js";
134
134
  import {
135
135
  buildLocalWorkspaceOpenAiTools,
136
136
  buildLocalWorkspaceToolset,
137
137
  getProcessRegistry
138
- } from "./chunk-DRMGJFGQ.js";
138
+ } from "./chunk-MG6BVV3T.js";
139
139
  import "./chunk-ZNFJWEN4.js";
140
- import "./chunk-ZR4VHQ5D.js";
140
+ import "./chunk-5S4SWV5G.js";
141
141
  import "./chunk-NCGFB7NN.js";
142
142
  import {
143
143
  readCommandActionGatePayload,
144
144
  resolveAgentImageInputSupport
145
- } from "./chunk-4BTHUYMY.js";
146
- import "./chunk-OPZYGHUC.js";
145
+ } from "./chunk-TA7VKOHU.js";
146
+ import "./chunk-3WGLLTK4.js";
147
147
  import {
148
148
  buildCurrentTimeBlock,
149
149
  buildIdentityBlock,
150
150
  buildRuntimeGuidanceBlocks
151
- } from "./chunk-6OVCRC72.js";
152
- import "./chunk-TSKWE74T.js";
151
+ } from "./chunk-LUKQQJFL.js";
152
+ import "./chunk-TYPHUVK5.js";
153
153
  import {
154
154
  canonicalizeToolNames
155
- } from "./chunk-43UD5ZP7.js";
155
+ } from "./chunk-B4KT7RN2.js";
156
156
  import {
157
157
  DEFAULT_CONTEXT_WINDOW,
158
- clipCompactText,
159
158
  estimateTokenCount,
160
159
  getModelContextWindow,
161
160
  planCompression,
162
161
  serializeMessageContent
163
- } from "./chunk-S73OEOHH.js";
164
- import "./chunk-S3UTETIC.js";
162
+ } from "./chunk-JFANOO7I.js";
163
+ import {
164
+ clipCompactText
165
+ } from "./chunk-5MMAK75Q.js";
166
+ import "./chunk-OGGHETUE.js";
165
167
  import "./chunk-PDL2AV3E.js";
166
168
  import "./chunk-JZPBVBIY.js";
167
169
  import "./chunk-BYXBJQAS.js";
@@ -197,12 +199,12 @@ import {
197
199
  } from "./chunk-IDZTNRP2.js";
198
200
  import "./chunk-IKXL2HZ3.js";
199
201
  import "./chunk-524BDL33.js";
200
- import "./chunk-7MYHLZ3F.js";
201
- import "./chunk-WTYKCU4W.js";
202
+ import "./chunk-DPFWKRHG.js";
203
+ import "./chunk-JU7J7EAV.js";
202
204
  import "./chunk-Y5GCAMGP.js";
203
205
  import "./chunk-KX6YBIHG.js";
204
- import "./chunk-3HHTVM6G.js";
205
- import "./chunk-NITP2JDG.js";
206
+ import "./chunk-WVTBAALN.js";
207
+ import "./chunk-VKG4HXYV.js";
206
208
  import "./chunk-WPHL6ALY.js";
207
209
  import "./chunk-O4BU24WZ.js";
208
210
  import "./chunk-I42VC5KR.js";
@@ -1070,6 +1072,27 @@ function createInitialAskChoiceState(questions) {
1070
1072
  };
1071
1073
  }
1072
1074
  function askChoiceReducer(state, action) {
1075
+ if (action.type === "HYDRATE_QUESTIONS") {
1076
+ if (state.phase !== "active") return state;
1077
+ const newQuestions = action.questions;
1078
+ if (newQuestions.length <= state.questionStates.length) {
1079
+ if (newQuestions.length === state.questions.length) return state;
1080
+ return { ...state, questions: newQuestions };
1081
+ }
1082
+ const appended = newQuestions.slice(state.questionStates.length).map(() => ({
1083
+ cursorIndex: 0,
1084
+ selectedIds: [],
1085
+ pickedId: null,
1086
+ otherText: "",
1087
+ otherFocused: false
1088
+ }));
1089
+ return {
1090
+ ...state,
1091
+ questions: newQuestions,
1092
+ questionStates: [...state.questionStates, ...appended],
1093
+ activeIndex: Math.min(state.activeIndex, newQuestions.length - 1)
1094
+ };
1095
+ }
1073
1096
  if (state.phase !== "active") return state;
1074
1097
  switch (action.type) {
1075
1098
  case "CANCEL":
@@ -1343,6 +1366,7 @@ async function runAskChoiceDialog(args) {
1343
1366
  typeof args.bottomRow === "function" ? args.bottomRow() : args.bottomRow ?? 0
1344
1367
  );
1345
1368
  let lastBottomRow = 0;
1369
+ let scrolledHeadroom = false;
1346
1370
  let unanchoredCursorLift = 0;
1347
1371
  const restoreUnanchoredCursor = () => {
1348
1372
  if (unanchoredCursorLift <= 0) return;
@@ -1356,6 +1380,14 @@ async function runAskChoiceDialog(args) {
1356
1380
  const canPosition = outputIsTty(output) && typeof output.write === "function";
1357
1381
  if (bottomAnchored && canPosition) {
1358
1382
  const anchorRow = resolveBottomRow();
1383
+ if (!scrolledHeadroom) {
1384
+ const ttyRows = typeof output === "object" && output !== null && "rows" in output && typeof output.rows === "number" ? output.rows : 24;
1385
+ const scrollN = Math.min(lineCount, Math.max(0, ttyRows - 1));
1386
+ if (scrollN > 0) {
1387
+ output.write(`\x1B[${scrollN}S`);
1388
+ }
1389
+ scrolledHeadroom = true;
1390
+ }
1359
1391
  clearAnchoredLines(
1360
1392
  output,
1361
1393
  lastBottomRow > 0 ? lastBottomRow : anchorRow,
@@ -1651,6 +1683,36 @@ function createActivityIndicator(deps) {
1651
1683
  }
1652
1684
  return null;
1653
1685
  };
1686
+ let agentRunSnapshot = null;
1687
+ const updateAgentRun = (snapshot) => {
1688
+ agentRunSnapshot = snapshot;
1689
+ deps.onRepaint();
1690
+ };
1691
+ const clearAgentRun = () => {
1692
+ agentRunSnapshot = null;
1693
+ deps.onRepaint();
1694
+ };
1695
+ const getAgentRun = () => agentRunSnapshot;
1696
+ const getActivityLines = (colorEnabled = resolveCliColorEnabled()) => {
1697
+ const lines = [];
1698
+ const baseView = getView();
1699
+ if (baseView) {
1700
+ const elapsed = Math.max(0, baseView.elapsedSec);
1701
+ const elapsedStr = `${elapsed}s`;
1702
+ const stopHint = t("stopHint");
1703
+ if (!colorEnabled) {
1704
+ lines.push(`${baseView.frame} ${baseView.label} (${elapsedStr}) \xB7 ${stopHint}`);
1705
+ } else {
1706
+ lines.push(
1707
+ themeText(baseView.frame, "accent") + " " + themeText(baseView.label, "muted") + themeText(` (${elapsedStr})`, "chrome") + themeText(` \xB7 ${stopHint}`, "chrome")
1708
+ );
1709
+ }
1710
+ }
1711
+ if (agentRunSnapshot) {
1712
+ lines.push(...formatAgentRunPanelLines(agentRunSnapshot, colorEnabled));
1713
+ }
1714
+ return lines.length > 0 ? lines : null;
1715
+ };
1654
1716
  const stop = () => {
1655
1717
  if (timer !== null) {
1656
1718
  clearIntervalFn(timer);
@@ -1662,8 +1724,69 @@ function createActivityIndicator(deps) {
1662
1724
  fallbackStartedAt = 0;
1663
1725
  lastActivityAt = 0;
1664
1726
  stopping = false;
1727
+ agentRunSnapshot = null;
1728
+ };
1729
+ return {
1730
+ report,
1731
+ updateAgentRun,
1732
+ clearAgentRun,
1733
+ getAgentRun,
1734
+ getView,
1735
+ getActivityLines,
1736
+ markStopping,
1737
+ isStopping,
1738
+ stop
1665
1739
  };
1666
- return { report, getView, markStopping, isStopping, stop };
1740
+ }
1741
+ function formatAgentRunPanelLines(snapshot, colorEnabled) {
1742
+ const lines = [];
1743
+ const name = snapshot.agentName || "sub-agent";
1744
+ const runId = snapshot.runId ? ` (${snapshot.runId.slice(0, 8)})` : "";
1745
+ const status = snapshot.status || "running";
1746
+ let statusSymbol = "\u231B";
1747
+ let statusColor = "warning";
1748
+ if (status === "completed" || status === "finished" || status === "success") {
1749
+ statusSymbol = "\u2713";
1750
+ statusColor = "success";
1751
+ } else if (status === "killed" || status === "cancelled" || status === "failed" || status === "stopped") {
1752
+ statusSymbol = "\u{1F534}";
1753
+ statusColor = "danger";
1754
+ }
1755
+ const pollPart = snapshot.polls !== void 0 ? ` (polls: ${snapshot.polls})` : "";
1756
+ const errPart = snapshot.errorMessage ? ` \xB7 ${snapshot.errorMessage}` : "";
1757
+ if (!colorEnabled) {
1758
+ lines.push(`\u{1F916} Sub-Agent: ${name}${runId} \xB7 ${statusSymbol} ${status}${pollPart}${errPart}`);
1759
+ } else {
1760
+ const botIcon = themeText("\u{1F916}", "accent", true);
1761
+ const labelText = themeText(" Sub-Agent: ", "muted", true);
1762
+ const nameText = themeText(`${name}${runId}`, "chrome", true);
1763
+ const statusText = themeText(` \xB7 ${statusSymbol} ${status}`, statusColor, true);
1764
+ const pollsText = pollPart ? themeText(pollPart, "chrome") : "";
1765
+ const errorText = errPart ? themeText(errPart, "danger") : "";
1766
+ lines.push(`${botIcon}${labelText}${nameText}${statusText}${pollsText}${errorText}`);
1767
+ }
1768
+ let logLine;
1769
+ if (snapshot.logTail) {
1770
+ const trimmed = snapshot.logTail.trim();
1771
+ if (trimmed) {
1772
+ const parts = trimmed.split(/\r?\n/);
1773
+ logLine = parts[parts.length - 1];
1774
+ }
1775
+ } else if (snapshot.logLines && snapshot.logLines.length > 0) {
1776
+ logLine = snapshot.logLines[snapshot.logLines.length - 1];
1777
+ }
1778
+ if (logLine && logLine.trim()) {
1779
+ const cleanLog = logLine.trim();
1780
+ if (!colorEnabled) {
1781
+ lines.push(` \u2514 Log: ${cleanLog}`);
1782
+ } else {
1783
+ const branchChar = themeText(" \u2514 ", "muted");
1784
+ const logTag = themeText("Log: ", "muted");
1785
+ const logContent = themeText(cleanLog, "chrome");
1786
+ lines.push(`${branchChar}${logTag}${logContent}`);
1787
+ }
1788
+ }
1789
+ return lines;
1667
1790
  }
1668
1791
 
1669
1792
  // packages/ai/agent/utils/sortUtils.ts
@@ -3725,11 +3848,18 @@ function createChatQueueTuiBinding(runTurn) {
3725
3848
  runtime.send({ type: "turn-start" });
3726
3849
  };
3727
3850
  const notifyTurnEnd = async (outcome) => {
3728
- const preempt = preemptArmed;
3729
- preemptArmed = null;
3730
- const effectiveOutcome = preempt !== null && outcome.aborted ? preempt === "drain" ? { ok: true, aborted: false } : { ok: false, aborted: false } : outcome;
3851
+ const consumePreempt = (raw) => {
3852
+ const mode = preemptArmed;
3853
+ preemptArmed = null;
3854
+ if (mode === null || !raw.aborted) return { outcome: raw, mode: null };
3855
+ return {
3856
+ outcome: mode === "drain" ? { ok: true, aborted: false } : { ok: false, aborted: false },
3857
+ mode
3858
+ };
3859
+ };
3860
+ const { outcome: effectiveOutcome, mode: consumedMode } = consumePreempt(outcome);
3731
3861
  runtime.send({ type: "turn-end", ...effectiveOutcome });
3732
- if (preempt === "stop" && outcome.aborted) {
3862
+ if (consumedMode === "stop") {
3733
3863
  runtime.send({ type: "drain-error", message: "" });
3734
3864
  }
3735
3865
  let lastOk = effectiveOutcome.ok && !effectiveOutcome.aborted;
@@ -3745,9 +3875,13 @@ function createChatQueueTuiBinding(runTurn) {
3745
3875
  } catch {
3746
3876
  turnOutcome = { ok: false, aborted: false };
3747
3877
  }
3748
- runtime.send({ type: "turn-end", ...turnOutcome });
3749
- lastOk = turnOutcome.ok && !turnOutcome.aborted;
3750
- if (turnOutcome.aborted) break;
3878
+ const { outcome: cascadeOutcome, mode: cascadeMode } = consumePreempt(turnOutcome);
3879
+ runtime.send({ type: "turn-end", ...cascadeOutcome });
3880
+ if (cascadeMode === "stop") {
3881
+ runtime.send({ type: "drain-error", message: "" });
3882
+ }
3883
+ lastOk = cascadeOutcome.ok && !cascadeOutcome.aborted;
3884
+ if (cascadeOutcome.aborted) break;
3751
3885
  if (!lastOk) break;
3752
3886
  } else {
3753
3887
  break;
@@ -3774,6 +3908,13 @@ function createChatQueueTuiBinding(runTurn) {
3774
3908
  preemptArmed = "stop";
3775
3909
  return true;
3776
3910
  };
3911
+ const snapshotAndClearQueue = () => {
3912
+ const status = runtime.getState();
3913
+ if (status.queue.length === 0) return null;
3914
+ const merged = status.queue.join("\n");
3915
+ runtime.send({ type: "clear" });
3916
+ return merged;
3917
+ };
3777
3918
  const clear = () => {
3778
3919
  runtime.send({ type: "clear" });
3779
3920
  };
@@ -3790,6 +3931,7 @@ function createChatQueueTuiBinding(runTurn) {
3790
3931
  drainHeadForManualTurn,
3791
3932
  preemptForDrain,
3792
3933
  preemptForStop,
3934
+ snapshotAndClearQueue,
3793
3935
  clear,
3794
3936
  getStatus,
3795
3937
  queueLength,
@@ -4100,9 +4242,10 @@ function createFixedInput(output, config) {
4100
4242
  if (completions.length > 0) {
4101
4243
  sections.push(fitAnsiLine(dimCliText(completions.join(" "), colorEnabled), cols));
4102
4244
  }
4103
- const activityLine = config.getActivityLine?.() ?? null;
4104
- if (activityLine) {
4105
- sections.push(fitAnsiLine(activityLine.replace(/\r?\n/g, " "), cols));
4245
+ const rawActivity = config.getActivityLines ? config.getActivityLines() : config.getActivityLine ? config.getActivityLine() : null;
4246
+ const activityLines = Array.isArray(rawActivity) ? rawActivity.filter((line) => line !== null && line !== void 0) : typeof rawActivity === "string" && rawActivity.length > 0 ? [rawActivity] : [];
4247
+ for (const actLine of activityLines) {
4248
+ sections.push(fitAnsiLine(actLine.replace(/\r?\n/g, " "), cols));
4106
4249
  }
4107
4250
  const rule = colorEnabled ? `\x1B[2m${themeColorSequence("chrome")}${"\u2500".repeat(cols)}\x1B[0m` : "\u2500".repeat(cols);
4108
4251
  sections.push(rule);
@@ -4160,7 +4303,7 @@ function createFixedInput(output, config) {
4160
4303
  }
4161
4304
  const text = sections.join("\n");
4162
4305
  const lines = sections.length;
4163
- const headerRows = (completions.length > 0 ? 1 : 0) + 2 + (activityLine ? 1 : 0) + queueLines.length;
4306
+ const headerRows = (completions.length > 0 ? 1 : 0) + 2 + activityLines.length + queueLines.length;
4164
4307
  return { text, lines, cursorCol, cursorRow: headerRows + cursorRow };
4165
4308
  };
4166
4309
  const repaintAt = (buffer, cursorPos) => {
@@ -4474,6 +4617,7 @@ function createRawInputDecoder(onToken, options) {
4474
4617
  }
4475
4618
 
4476
4619
  // packages/cli/tui/readlineWorkspace.ts
4620
+ var CTRL_S = "";
4477
4621
  var AGENTS_MD_MAX_BYTES = 8192;
4478
4622
  var altScreenRestoreOutput = null;
4479
4623
  var altScreenHandlersInstalled = false;
@@ -4958,7 +5102,7 @@ async function startTuiWorkspace(options) {
4958
5102
  if (fixedInput.active && !fixedInput.isPaused()) {
4959
5103
  output.write("\x1B[?2026h\x1B[?25l");
4960
5104
  try {
4961
- fixedInput.repaint(buffer);
5105
+ fixedInput.repaint(buffer, cursorPos);
4962
5106
  } finally {
4963
5107
  output.write("\x1B[?25h\x1B[?2026l");
4964
5108
  }
@@ -4976,7 +5120,7 @@ async function startTuiWorkspace(options) {
4976
5120
  fixedInput.resumeFromDialog();
4977
5121
  flushPendingRender();
4978
5122
  renderHistoryToOutput();
4979
- fixedInput.repaint(buffer);
5123
+ fixedInput.repaint(buffer, cursorPos);
4980
5124
  },
4981
5125
  getInputLines: () => fixedInput.getInputLines(),
4982
5126
  isPaused: () => fixedInput.isPaused()
@@ -5001,7 +5145,7 @@ async function startTuiWorkspace(options) {
5001
5145
  output.write("\x1B[?2026h\x1B[?25l");
5002
5146
  try {
5003
5147
  renderHistory(output, history, fixedInput.getInputLines());
5004
- if (fixedInput.active) fixedInput.repaint(buffer);
5148
+ if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
5005
5149
  } finally {
5006
5150
  output.write("\x1B[?25h\x1B[?2026l");
5007
5151
  }
@@ -5065,7 +5209,7 @@ ${t("copyViewHint")}
5065
5209
  fixedInput.resumeFromDialog();
5066
5210
  flushPendingRender();
5067
5211
  renderHistoryToOutput();
5068
- fixedInput.repaint(buffer);
5212
+ fixedInput.repaint(buffer, cursorPos);
5069
5213
  }
5070
5214
  return true;
5071
5215
  };
@@ -5080,7 +5224,7 @@ ${t("copyViewHint")}
5080
5224
  appendToCurrentTurn(history, message);
5081
5225
  finalizeCurrentTurn(history);
5082
5226
  renderHistoryToOutput();
5083
- if (fixedInput.active) fixedInput.repaint(buffer);
5227
+ if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
5084
5228
  startTurn(history, "assistant");
5085
5229
  const agentOutput = isInteractiveInput(input) ? createHistoryOutputStream(history, () => {
5086
5230
  scheduleRender();
@@ -5120,7 +5264,14 @@ ${t("copyViewHint")}
5120
5264
  abortSignal: activeTurnAbort.signal,
5121
5265
  pastedTextStore: pasteStore,
5122
5266
  explicitAgentSwitch,
5123
- activityReporter
5267
+ activityReporter,
5268
+ onAgentRunStatus: (snapshot) => {
5269
+ if (snapshot) {
5270
+ activityIndicator.updateAgentRun(snapshot);
5271
+ } else {
5272
+ activityIndicator.clearAgentRun();
5273
+ }
5274
+ }
5124
5275
  }
5125
5276
  );
5126
5277
  const wasForceStopped = forcedStopEpoch === myEpoch;
@@ -5146,7 +5297,7 @@ ${t("copyViewHint")}
5146
5297
  finalizeCurrentTurn(history);
5147
5298
  flushPendingRender();
5148
5299
  renderHistoryToOutput();
5149
- if (fixedInput.active) fixedInput.repaint(buffer);
5300
+ if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
5150
5301
  }
5151
5302
  if (wasAborted) {
5152
5303
  if (runResult.pendingToolName) {
@@ -5194,6 +5345,11 @@ ${t("copyViewHint")}
5194
5345
  });
5195
5346
  return chatQueueBinding;
5196
5347
  };
5348
+ const preemptAndAbortForDrain = (binding) => {
5349
+ if (binding.preemptForDrain() && activeTurnAbort) {
5350
+ activeTurnAbort.abort();
5351
+ }
5352
+ };
5197
5353
  const emitCommandOutput = (text) => {
5198
5354
  if (!text) return;
5199
5355
  if (!isInteractiveInput(input)) {
@@ -5206,7 +5362,7 @@ ${t("copyViewHint")}
5206
5362
  appendToCurrentTurn(history, text);
5207
5363
  finalizeCurrentTurn(history);
5208
5364
  renderHistoryToOutput();
5209
- if (fixedInput.active) fixedInput.repaint(buffer);
5365
+ if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
5210
5366
  };
5211
5367
  const runSubmittedLine = async (line, actionGateHandler, confirmDestructiveAction) => {
5212
5368
  if (!line.trim()) return false;
@@ -5220,7 +5376,7 @@ ${t("copyViewHint")}
5220
5376
  appendToCurrentTurn(history, line.trim());
5221
5377
  finalizeCurrentTurn(history);
5222
5378
  renderHistoryToOutput();
5223
- if (fixedInput.active) fixedInput.repaint(buffer);
5379
+ if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
5224
5380
  }
5225
5381
  if (result.output) {
5226
5382
  emitCommandOutput(result.output);
@@ -5263,6 +5419,14 @@ ${t("copyViewHint")}
5263
5419
  dialogKey: compactResult.dialogKey,
5264
5420
  dialogLabel: compactResult.dialogId
5265
5421
  };
5422
+ output.write(
5423
+ `${t(
5424
+ compactResult.summaryGenerated ? "compactDone" : "compactDoneNoSummary",
5425
+ result.action.dialogId,
5426
+ compactResult.dialogId
5427
+ )}
5428
+ `
5429
+ );
5266
5430
  } catch (error) {
5267
5431
  output.write(
5268
5432
  `[nolo] Compact failed: ${toErrorMessage(error)}
@@ -5355,7 +5519,7 @@ ${t("copyViewHint")}
5355
5519
  leaveAltScreen(output);
5356
5520
  }
5357
5521
  renderHistoryToOutput();
5358
- fixedInput.repaint(buffer);
5522
+ fixedInput.repaint(buffer, cursorPos);
5359
5523
  }
5360
5524
  if (result.action?.type === "copy-view") {
5361
5525
  const opened = await openCopyView();
@@ -5529,7 +5693,7 @@ ${stderrText.trim()}
5529
5693
  ${err.message}` : ""}`
5530
5694
  );
5531
5695
  }
5532
- if (fixedInput.active) fixedInput.repaint(buffer);
5696
+ if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
5533
5697
  }
5534
5698
  return false;
5535
5699
  };
@@ -5539,7 +5703,6 @@ ${err.message}` : ""}`
5539
5703
  let busy = false;
5540
5704
  let done = false;
5541
5705
  let resolveDone = null;
5542
- let cursorPos2 = 0;
5543
5706
  fixedInput = createFixedInput(output, {
5544
5707
  getStatusLine: () => {
5545
5708
  let base = renderStatusLine(state);
@@ -5557,17 +5720,7 @@ ${err.message}` : ""}`
5557
5720
  }
5558
5721
  return base;
5559
5722
  },
5560
- getActivityLine: () => {
5561
- const view = activityIndicator.getView();
5562
- if (view === null) return null;
5563
- const colorEnabled = resolveCliColorEnabled();
5564
- const elapsed = formatElapsedSeconds(view.elapsedSec);
5565
- const stopHint = t("stopHint");
5566
- if (!colorEnabled) {
5567
- return `${view.frame} ${view.label} (${elapsed}) \xB7 ${stopHint}`;
5568
- }
5569
- return themeText(view.frame, "accent") + " " + themeText(view.label, "muted") + themeText(` (${elapsed})`, "chrome") + themeText(` \xB7 ${stopHint}`, "chrome");
5570
- },
5723
+ getActivityLines: () => activityIndicator.getActivityLines(resolveCliColorEnabled()),
5571
5724
  getQueueLines: () => {
5572
5725
  if (!chatQueueBinding || chatQueueBinding.queueLength() === 0) return [];
5573
5726
  const colorEnabled = resolveCliColorEnabled();
@@ -5583,13 +5736,13 @@ ${err.message}` : ""}`
5583
5736
  fixedInput.init();
5584
5737
  const paintFrame = (draft) => {
5585
5738
  renderHistoryToOutput();
5586
- fixedInput.repaint(draft, cursorPos2);
5739
+ fixedInput.repaint(draft, cursorPos);
5587
5740
  };
5588
5741
  const onResize = () => {
5589
5742
  if (done || copyViewExitResolver) return;
5590
5743
  if (fixedInput.isPaused()) {
5591
5744
  renderHistory(output, history, fixedInput.getInputLines());
5592
- fixedInput.repaint(buffer, cursorPos2);
5745
+ fixedInput.repaint(buffer, cursorPos);
5593
5746
  return;
5594
5747
  }
5595
5748
  flushPendingRender();
@@ -5624,6 +5777,30 @@ ${err.message}` : ""}`
5624
5777
  rawActionGateTokenHandler?.(sequence);
5625
5778
  return;
5626
5779
  }
5780
+ if (sequence === CTRL_S) {
5781
+ if (!chatQueueBinding || chatQueueBinding.queueLength() === 0) {
5782
+ return;
5783
+ }
5784
+ const flushCount = chatQueueBinding.queueLength();
5785
+ const merged = chatQueueBinding.snapshotAndClearQueue();
5786
+ if (!merged) return;
5787
+ const draftIncluded = !busy && buffer.trim() !== "";
5788
+ const fullText = draftIncluded ? `${buffer}
5789
+ ${merged}` : merged;
5790
+ chatQueueBinding.enqueue(fullText);
5791
+ const totalCount = flushCount + (draftIncluded ? 1 : 0);
5792
+ emitCommandOutput(
5793
+ t(busy ? "flushQueuedBusyHint" : "flushQueuedIdleHint", String(totalCount))
5794
+ );
5795
+ if (busy) {
5796
+ preemptAndAbortForDrain(chatQueueBinding);
5797
+ return;
5798
+ }
5799
+ buffer = "";
5800
+ cursorPos = 0;
5801
+ if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
5802
+ return handleInputToken("\r");
5803
+ }
5627
5804
  const busyLock = busy;
5628
5805
  const scrollAction = parseScrollAction(sequence);
5629
5806
  if (scrollAction) {
@@ -5644,7 +5821,7 @@ ${err.message}` : ""}`
5644
5821
  emitCommandOutput(t("forceStopped"));
5645
5822
  flushPendingRender();
5646
5823
  renderHistoryToOutput();
5647
- if (fixedInput.active) fixedInput.repaint(buffer);
5824
+ if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
5648
5825
  return;
5649
5826
  }
5650
5827
  const stopBinding = chatQueueBinding;
@@ -5655,7 +5832,7 @@ ${err.message}` : ""}`
5655
5832
  activeTurnAbort.abort();
5656
5833
  return;
5657
5834
  }
5658
- const result = applyTuiInputKey(buffer, sequence, {}, cursorPos2, {
5835
+ const result = applyTuiInputKey(buffer, sequence, {}, cursorPos, {
5659
5836
  pasteStore
5660
5837
  });
5661
5838
  if (result.copyView) {
@@ -5707,8 +5884,8 @@ ${hint}` : hint;
5707
5884
  }
5708
5885
  releaseCollapsedPasteReferences(submittedText, pasteStore);
5709
5886
  buffer = "";
5710
- cursorPos2 = 0;
5711
- if (fixedInput.active) fixedInput.repaint(buffer, cursorPos2);
5887
+ cursorPos = 0;
5888
+ if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
5712
5889
  return;
5713
5890
  }
5714
5891
  const binding = ensureChatQueueBinding(
@@ -5749,15 +5926,11 @@ ${hint}` : hint;
5749
5926
  if (decision.kind === "queue-text") {
5750
5927
  binding.enqueue(decision.text);
5751
5928
  buffer = "";
5752
- cursorPos2 = 0;
5753
- fixedInput.repaint(buffer, cursorPos2);
5929
+ cursorPos = 0;
5930
+ fixedInput.repaint(buffer, cursorPos);
5754
5931
  } else if (decision.kind === "queue-blocked") {
5755
5932
  } else if (decision.kind === "noop" && !submittedText.trim() && binding.queueLength() > 0) {
5756
- if (binding.preemptForDrain()) {
5757
- if (activeTurnAbort) {
5758
- activeTurnAbort.abort();
5759
- }
5760
- }
5933
+ preemptAndAbortForDrain(binding);
5761
5934
  }
5762
5935
  return;
5763
5936
  }
@@ -5796,7 +5969,7 @@ ${hint}` : hint;
5796
5969
  if (drainedText !== null) {
5797
5970
  busy = true;
5798
5971
  buffer = "";
5799
- cursorPos2 = 0;
5972
+ cursorPos = 0;
5800
5973
  fixedInput.enterOutputMode(drainedText);
5801
5974
  try {
5802
5975
  const outcome = await runOneAgentTurn(
@@ -5817,13 +5990,13 @@ ${err.message}` : ""}`
5817
5990
  }
5818
5991
  refreshGitStatus();
5819
5992
  flushPendingRender();
5820
- fixedInput.exitOutputMode(buffer, cursorPos2);
5993
+ fixedInput.exitOutputMode(buffer, cursorPos);
5821
5994
  return;
5822
5995
  }
5823
5996
  }
5824
5997
  busy = startsChatTurn;
5825
5998
  buffer = "";
5826
- cursorPos2 = 0;
5999
+ cursorPos = 0;
5827
6000
  fixedInput.enterOutputMode(submittedText);
5828
6001
  let shouldExit = false;
5829
6002
  try {
@@ -5869,19 +6042,19 @@ ${err.message}` : ""}`
5869
6042
  }
5870
6043
  refreshGitStatus();
5871
6044
  flushPendingRender();
5872
- fixedInput.exitOutputMode(buffer, cursorPos2);
6045
+ fixedInput.exitOutputMode(buffer, cursorPos);
5873
6046
  return;
5874
6047
  }
5875
6048
  buffer = result.buffer;
5876
- cursorPos2 = result.cursorPos ?? buffer.length;
5877
- fixedInput.repaint(buffer, cursorPos2);
6049
+ cursorPos = result.cursorPos ?? buffer.length;
6050
+ fixedInput.repaint(buffer, cursorPos);
5878
6051
  };
5879
6052
  const onData = createRawInputDecoder((token) => {
5880
6053
  void handleInputToken(token);
5881
6054
  });
5882
6055
  try {
5883
6056
  input.on("data", onData);
5884
- fixedInput.repaint(buffer, cursorPos2);
6057
+ fixedInput.repaint(buffer, cursorPos);
5885
6058
  refreshGitStatus();
5886
6059
  await new Promise((resolve2) => {
5887
6060
  resolveDone = resolve2;