nolo-cli 0.16.0-alpha.1 → 0.16.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 (97) hide show
  1. package/{_executeModel-QAUS6B7J.js → _executeModel-LGHYA5XS.js} +29 -28
  2. package/{action-GUOZYYGN.js → action-F5JACQBG.js} +4 -4
  3. package/{addContentAction-QDGHGUBH.js → addContentAction-AQXEYRBE.js} +3 -3
  4. package/{addDialogAgentAction-Z4YCYZIV.js → addDialogAgentAction-EJHHJZWW.js} +2 -2
  5. package/{agentDeleteCommand-365DMKHW.js → agentDeleteCommand-PBIUC4FT.js} +18 -17
  6. package/{agentEmailCommands-TQMXL36I.js → agentEmailCommands-KC2QCPQV.js} +35 -34
  7. package/{agentListCommands-6B5X4RC6.js → agentListCommands-N64PHBXM.js} +20 -19
  8. package/{agentMachineCommands-LOEARB6V.js → agentMachineCommands-P7S5WAVA.js} +18 -17
  9. package/{agentRecordCommands-DCH2WBL2.js → agentRecordCommands-JKZR2TZJ.js} +34 -33
  10. package/{agentRunCommand-SGMH67WT.js → agentRunCommand-2ELKCBWR.js} +34 -33
  11. package/{agentRuntimeLocal-YSYZ33ER.js → agentRuntimeLocal-T6YECTNF.js} +15 -16
  12. package/{agentSlice-IVE735EV.js → agentSlice-NXLMDKR7.js} +3 -3
  13. package/{appDeleteCommands-6QYOO3JB.js → appDeleteCommands-D6B6Z4ZQ.js} +19 -18
  14. package/{appDeployCommands-WTCT6XO6.js → appDeployCommands-YMO5FK4T.js} +19 -18
  15. package/{appDeployStatusCommands-CGWGZJKB.js → appDeployStatusCommands-EO5DWWPQ.js} +19 -18
  16. package/{appGetCommands-O4OCAMRW.js → appGetCommands-6SMZ3URQ.js} +19 -18
  17. package/{appListCommands-UENFP4XY.js → appListCommands-RZXSWR2G.js} +19 -18
  18. package/{authCommand-YFTR3347.js → authCommand-MSSBXCQ6.js} +8 -2
  19. package/{chunk-EMXI3N3Z.js → chunk-22NGXGN3.js} +2 -2
  20. package/{chunk-WPN6RMDF.js → chunk-2WXMU64E.js} +3 -3
  21. package/{chunk-SFXYKGK2.js → chunk-3S2VOMIF.js} +3 -3
  22. package/{chunk-WRN5EQT7.js → chunk-47QUPRHO.js} +3 -3
  23. package/{chunk-YNHQIXX5.js → chunk-4LXOVZ4W.js} +21 -21
  24. package/{chunk-O53CP2QR.js → chunk-6CRACQXW.js} +3 -3
  25. package/{chunk-E237VE6U.js → chunk-6KBBMW4D.js} +2 -2
  26. package/{chunk-U7LEGLEB.js → chunk-6N4KODMN.js} +1 -1
  27. package/{chunk-GRTFNYLR.js → chunk-A7O4KKLZ.js} +3 -3
  28. package/{chunk-WA6KZL5V.js → chunk-AAODAAUQ.js} +23 -20
  29. package/{chunk-Z24FGIU2.js → chunk-BXXECNBU.js} +3 -3
  30. package/{chunk-4NLUNENX.js → chunk-C4MMO7W4.js} +1 -1
  31. package/{chunk-JKWWVF2I.js → chunk-D3HVJJIA.js} +1 -1
  32. package/{chunk-VE6XMVKG.js → chunk-D4NCEGGR.js} +167 -53
  33. package/{chunk-TTGAVETO.js → chunk-EABWT43X.js} +2 -2
  34. package/{chunk-YYIRR6QC.js → chunk-EQTZPEID.js} +140 -175
  35. package/{chunk-RSYUDGGZ.js → chunk-F3UOACU4.js} +1 -1
  36. package/{chunk-RKM3K52F.js → chunk-GPELDE6I.js} +2 -2
  37. package/{chunk-OGGHETUE.js → chunk-HQPG2PIV.js} +62 -19
  38. package/{chunk-BFRVXJJJ.js → chunk-HSASSW4L.js} +27 -11
  39. package/{chunk-XVP3C2KY.js → chunk-IWLUTMYX.js} +1 -1
  40. package/{chunk-B4KT7RN2.js → chunk-JTMNCCWF.js} +2 -2
  41. package/chunk-KFEVY3ST.js +255 -0
  42. package/{chunk-WNLPAOIT.js → chunk-KFHN5NGJ.js} +1 -1
  43. package/{chunk-ISYE6GZB.js → chunk-L6NVTGI7.js} +1 -1
  44. package/{chunk-J55UHASN.js → chunk-MSA4JAOZ.js} +1 -1
  45. package/{chunk-HRQCKQA5.js → chunk-MUCU6ATG.js} +8 -257
  46. package/{chunk-524BDL33.js → chunk-O6W2O2DA.js} +1 -15
  47. package/{chunk-4QQFLN5C.js → chunk-OVBVEXZ7.js} +4 -4
  48. package/{chunk-QZVGMD5F.js → chunk-PU4LXVAC.js} +1 -1
  49. package/{chunk-4IJYA27C.js → chunk-RG2U2MTJ.js} +1 -1
  50. package/{chunk-6MHDWKOT.js → chunk-RIF3XLXK.js} +9 -5
  51. package/{chunk-IKXL2HZ3.js → chunk-RK5NYQEL.js} +1 -1
  52. package/{chunk-JS33TCQ3.js → chunk-RPDGJO4D.js} +2 -2
  53. package/{chunk-EHLHSX7R.js → chunk-UB4RYYNQ.js} +9 -2
  54. package/{chunk-YC3DJILJ.js → chunk-VHXXRWNL.js} +22 -8
  55. package/{chunk-G2MKOQCB.js → chunk-WBA6SIBB.js} +1 -1
  56. package/{chunk-6565R2TI.js → chunk-XEWUC53Z.js} +38 -20
  57. package/{chunk-OOIN7HSO.js → chunk-XJITGCTM.js} +10 -1
  58. package/{chunk-V2J635L5.js → chunk-XOIF2TNF.js} +2 -2
  59. package/{chunk-VPTJB4HM.js → chunk-XPC5C7BK.js} +0 -3
  60. package/{chunk-I66RU7P7.js → chunk-XRSPI6CP.js} +1 -1
  61. package/{chunk-N5424GSW.js → chunk-YJKXGHJ6.js} +1 -1
  62. package/{chunk-QLFCNUVQ.js → chunk-ZH62XNZE.js} +877 -172
  63. package/chunk-ZHXJ6M7T.js +27 -0
  64. package/{chunk-OQMPU2ML.js → chunk-ZXQ52OY2.js} +4 -4
  65. package/{createAgentAutomationAction-TS6NNZ4X.js → createAgentAutomationAction-RKWIMKHW.js} +13 -13
  66. package/{createDialogAction-5HVQ33EX.js → createDialogAction-VN7MEBS3.js} +14 -14
  67. package/{createPageAction-4F3ZGQJD.js → createPageAction-JBUWBHHC.js} +13 -13
  68. package/{dbSlice-OP6UPXKA.js → dbSlice-7KQH6GOU.js} +2 -2
  69. package/{dialogCommands-ZL6L24BS.js → dialogCommands-DFY5HJ6M.js} +19 -18
  70. package/{dialogSlice-FAWUQDJW.js → dialogSlice-NNYBU35K.js} +13 -13
  71. package/{docCreateCommands-LYROQTFH.js → docCreateCommands-5L76YTI2.js} +18 -17
  72. package/{docDeleteCommands-6TWGTZNR.js → docDeleteCommands-3GASP3VR.js} +19 -18
  73. package/{docReadCommands-PRULNF26.js → docReadCommands-ALA77AZM.js} +18 -17
  74. package/{docStore-2UHVWLTV.js → docStore-DR22GGF3.js} +14 -14
  75. package/{docUpdateCommands-NNYYWJBI.js → docUpdateCommands-6AZGXE5M.js} +18 -17
  76. package/{getPricing-UGDJHI7M.js → getPricing-RYY6OBA4.js} +4 -4
  77. package/{handleSendMessageAction-LJPUYNOH.js → handleSendMessageAction-FHITDM7H.js} +201 -15
  78. package/index.js +47 -47
  79. package/{machineCommands-JQPEQFSE.js → machineCommands-3B4IHHVK.js} +33 -32
  80. package/{machineWsRunDispatch-FFFNWVEW.js → machineWsRunDispatch-AXZ6OL3V.js} +33 -32
  81. package/{models-LSCRJJ6P.js → models-5K5G2CZI.js} +2 -2
  82. package/package.json +1 -1
  83. package/{read-HXHAZBKH.js → read-CN3TNXIP.js} +1 -1
  84. package/{readDocTool-VPBDTO4G.js → readDocTool-WF3675ED.js} +1 -1
  85. package/{readlineWorkspace-QSXHSBHA.js → readlineWorkspace-DBZCXS7Y.js} +145 -92
  86. package/{removeDialogAgentAction-HUFVN35S.js → removeDialogAgentAction-YDHBFEGI.js} +5 -5
  87. package/{runAgentClientLoop-A75BUU6D.js → runAgentClientLoop-AB7PQ3TB.js} +26 -25
  88. package/{setDialogExtraReferencesAction-2VLGWQKG.js → setDialogExtraReferencesAction-LR6MSIXO.js} +2 -2
  89. package/{setPrimaryDialogAgentAction-VB4UV2CC.js → setPrimaryDialogAgentAction-IIVDCY5C.js} +5 -5
  90. package/{settingSlice-7JYPQNAC.js → settingSlice-O23YDK2O.js} +3 -3
  91. package/{spaceCommands-4LE45GB7.js → spaceCommands-AB2D7A2R.js} +18 -17
  92. package/{spaceSlice-444MFUP6.js → spaceSlice-TEJDCU6A.js} +13 -13
  93. package/{streamAgentChatTurn-DJAE7USZ.js → streamAgentChatTurn-NZ3HLAXS.js} +30 -32
  94. package/{tools-YB6LXSVN.js → tools-M4USUF3R.js} +20 -20
  95. package/{tuiSummaryLlmCaller-QQL3JA5I.js → tuiSummaryLlmCaller-VUNVBRX3.js} +7 -6
  96. package/{updateDialogTitleAction-6HGFBM64.js → updateDialogTitleAction-SMPQVKWT.js} +13 -13
  97. package/chunk-BYXBJQAS.js +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  normalizeDialogRecord,
4
4
  readDialogSnapshot,
5
5
  sortDialogs
6
- } from "./chunk-RSYUDGGZ.js";
6
+ } from "./chunk-F3UOACU4.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-YYIRR6QC.js";
60
+ } from "./chunk-EQTZPEID.js";
61
61
  import "./chunk-DZ3XJVET.js";
62
62
  import "./chunk-6HYVJV7B.js";
63
63
  import {
@@ -65,19 +65,19 @@ import {
65
65
  listLocalCachedAgents,
66
66
  listRemoteAgents,
67
67
  listRemoteAgentsAcrossServers
68
- } from "./chunk-GRTFNYLR.js";
68
+ } from "./chunk-A7O4KKLZ.js";
69
69
  import "./chunk-ID4G2MAR.js";
70
70
  import {
71
71
  listUserRecordsFromServers
72
- } from "./chunk-J55UHASN.js";
72
+ } from "./chunk-MSA4JAOZ.js";
73
73
  import {
74
74
  createCliLocalRuntimeAdapter,
75
75
  initCliLocale,
76
76
  parseCliLocale,
77
77
  setCliLocale,
78
78
  t
79
- } from "./chunk-QLFCNUVQ.js";
80
- import "./chunk-EHLHSX7R.js";
79
+ } from "./chunk-ZH62XNZE.js";
80
+ import "./chunk-UB4RYYNQ.js";
81
81
  import {
82
82
  getReadableCliDb
83
83
  } from "./chunk-W4NVOSFF.js";
@@ -85,44 +85,49 @@ import {
85
85
  deleteDbRecord,
86
86
  queryUserRecords,
87
87
  readDbRecord
88
- } from "./chunk-4NLUNENX.js";
89
- import "./chunk-QZVGMD5F.js";
88
+ } from "./chunk-C4MMO7W4.js";
89
+ import "./chunk-PU4LXVAC.js";
90
90
  import {
91
91
  resolveCliAgentKeyInput
92
92
  } from "./chunk-VHBWHNVT.js";
93
93
  import "./chunk-LTRXGFMS.js";
94
- import "./chunk-WNLPAOIT.js";
94
+ import "./chunk-KFHN5NGJ.js";
95
95
  import "./chunk-JEXVIMYZ.js";
96
96
  import {
97
97
  prepareTools
98
- } from "./chunk-WRN5EQT7.js";
99
- import "./chunk-ISYE6GZB.js";
98
+ } from "./chunk-47QUPRHO.js";
99
+ import "./chunk-L6NVTGI7.js";
100
100
  import {
101
- expandEnabledPacks
102
- } from "./chunk-VE6XMVKG.js";
101
+ expandEnabledPacks,
102
+ formatRunAge,
103
+ getAgentRunStatusIcon,
104
+ isAgentRunTerminalStatus,
105
+ runShowsLogTail,
106
+ shortRunId
107
+ } from "./chunk-D4NCEGGR.js";
103
108
  import "./chunk-RQSOAMPJ.js";
104
- import "./chunk-OOIN7HSO.js";
109
+ import "./chunk-XJITGCTM.js";
105
110
  import "./chunk-KQHGZWSV.js";
106
- import "./chunk-O53CP2QR.js";
107
- import "./chunk-U7LEGLEB.js";
111
+ import "./chunk-6CRACQXW.js";
112
+ import "./chunk-6N4KODMN.js";
108
113
  import "./chunk-3LY4F7SV.js";
109
114
  import "./chunk-VP4WJWKW.js";
110
115
  import "./chunk-63W5N6P3.js";
111
116
  import "./chunk-VF4K2QE6.js";
112
- import "./chunk-Z24FGIU2.js";
117
+ import "./chunk-BXXECNBU.js";
113
118
  import "./chunk-VC6OZXO5.js";
114
119
  import "./chunk-OWOHNGCN.js";
115
120
  import {
116
121
  extractReferenceKeysFromMessage
117
- } from "./chunk-YNHQIXX5.js";
122
+ } from "./chunk-4LXOVZ4W.js";
118
123
  import {
119
124
  buildBuiltinSummaryContent
120
- } from "./chunk-V2J635L5.js";
125
+ } from "./chunk-XOIF2TNF.js";
121
126
  import "./chunk-MRC4Q34M.js";
122
127
  import "./chunk-MTU75CZ2.js";
123
128
  import "./chunk-CWMSB67P.js";
124
- import "./chunk-OQMPU2ML.js";
125
- import "./chunk-JS33TCQ3.js";
129
+ import "./chunk-ZXQ52OY2.js";
130
+ import "./chunk-RPDGJO4D.js";
126
131
  import "./chunk-SOTZ6RDN.js";
127
132
  import "./chunk-Z4NR32XR.js";
128
133
  import "./chunk-M76ECQRD.js";
@@ -134,40 +139,41 @@ import {
134
139
  buildLocalWorkspaceOpenAiTools,
135
140
  buildLocalWorkspaceToolset,
136
141
  getProcessRegistry
137
- } from "./chunk-YC3DJILJ.js";
138
- import "./chunk-WA6KZL5V.js";
142
+ } from "./chunk-VHXXRWNL.js";
143
+ import "./chunk-AAODAAUQ.js";
139
144
  import "./chunk-ZNFJWEN4.js";
140
145
  import "./chunk-OIQPORYI.js";
141
146
  import {
142
147
  readCommandActionGatePayload,
143
148
  resolveAgentImageInputSupport
144
- } from "./chunk-6MHDWKOT.js";
149
+ } from "./chunk-RIF3XLXK.js";
145
150
  import "./chunk-LSFAWXKC.js";
146
151
  import {
147
152
  buildCurrentTimeBlock,
148
153
  buildIdentityBlock,
149
154
  buildRuntimeGuidanceBlocks
150
- } from "./chunk-RKM3K52F.js";
155
+ } from "./chunk-GPELDE6I.js";
156
+ import "./chunk-KFEVY3ST.js";
151
157
  import {
152
158
  resolvePlatformAuthToken
153
- } from "./chunk-HRQCKQA5.js";
159
+ } from "./chunk-MUCU6ATG.js";
154
160
  import {
155
161
  canonicalizeToolNames
156
- } from "./chunk-B4KT7RN2.js";
162
+ } from "./chunk-JTMNCCWF.js";
157
163
  import {
158
164
  DEFAULT_CONTEXT_WINDOW,
159
165
  estimateTokenCount,
160
166
  getModelContextWindow,
161
167
  planCompression,
162
168
  serializeMessageContent
163
- } from "./chunk-4QQFLN5C.js";
169
+ } from "./chunk-OVBVEXZ7.js";
164
170
  import {
165
171
  clipCompactText
166
172
  } from "./chunk-5MMAK75Q.js";
167
- import "./chunk-OGGHETUE.js";
173
+ import "./chunk-HQPG2PIV.js";
168
174
  import "./chunk-5CS33IBL.js";
169
175
  import "./chunk-JZPBVBIY.js";
170
- import "./chunk-BYXBJQAS.js";
176
+ import "./chunk-ZHXJ6M7T.js";
171
177
  import "./chunk-QLUFR47U.js";
172
178
  import "./chunk-KKY4B2Q2.js";
173
179
  import "./chunk-5MIDPSSK.js";
@@ -207,14 +213,14 @@ import {
207
213
  import {
208
214
  DEFAULT_NOLO_SERVER_URL
209
215
  } from "./chunk-OLZBQWZU.js";
210
- import "./chunk-IKXL2HZ3.js";
211
- import "./chunk-524BDL33.js";
212
- import "./chunk-N5424GSW.js";
213
- import "./chunk-TTGAVETO.js";
216
+ import "./chunk-RK5NYQEL.js";
217
+ import "./chunk-O6W2O2DA.js";
218
+ import "./chunk-YJKXGHJ6.js";
219
+ import "./chunk-EABWT43X.js";
214
220
  import "./chunk-Y5GCAMGP.js";
215
221
  import "./chunk-KX6YBIHG.js";
216
- import "./chunk-XVP3C2KY.js";
217
- import "./chunk-SFXYKGK2.js";
222
+ import "./chunk-IWLUTMYX.js";
223
+ import "./chunk-3S2VOMIF.js";
218
224
  import "./chunk-O4BU24WZ.js";
219
225
  import "./chunk-I42VC5KR.js";
220
226
  import "./chunk-WWC7I6TA.js";
@@ -222,7 +228,7 @@ import "./chunk-JTINRTBT.js";
222
228
  import {
223
229
  asTrimmedLowercaseString
224
230
  } from "./chunk-QSJ3HFEF.js";
225
- import "./chunk-VPTJB4HM.js";
231
+ import "./chunk-XPC5C7BK.js";
226
232
  import "./chunk-DVRHHFEA.js";
227
233
  import "./chunk-OOSFSFMA.js";
228
234
  import "./chunk-GBRG75BQ.js";
@@ -756,7 +762,7 @@ function createRawKeyReader(input) {
756
762
  let buffer = "";
757
763
  const tryParseSequence = () => {
758
764
  if (!buffer) return null;
759
- if (isSubmit(buffer) || isCancel(buffer)) {
765
+ if (isSubmit(buffer)) {
760
766
  const sequence2 = buffer;
761
767
  buffer = "";
762
768
  return sequence2;
@@ -779,6 +785,7 @@ function createRawKeyReader(input) {
779
785
  return candidate;
780
786
  }
781
787
  }
788
+ if (buffer === "\x1B") return void 0;
782
789
  if (buffer.length >= 8) {
783
790
  buffer = "";
784
791
  return null;
@@ -790,16 +797,38 @@ function createRawKeyReader(input) {
790
797
  return sequence;
791
798
  };
792
799
  let waiter = null;
800
+ let escTimer = null;
793
801
  const tryDeliver = () => {
794
802
  if (!waiter || !buffer) return;
795
803
  const parsed = tryParseSequence();
796
- if (parsed === void 0) return;
804
+ if (parsed === void 0) {
805
+ if (buffer === "\x1B" && !escTimer) {
806
+ escTimer = setTimeout(() => {
807
+ escTimer = null;
808
+ if (waiter && buffer === "\x1B") {
809
+ const resolve3 = waiter;
810
+ waiter = null;
811
+ buffer = "";
812
+ resolve3("\x1B");
813
+ }
814
+ }, 30);
815
+ }
816
+ return;
817
+ }
818
+ if (escTimer) {
819
+ clearTimeout(escTimer);
820
+ escTimer = null;
821
+ }
797
822
  const resolve2 = waiter;
798
823
  waiter = null;
799
824
  resolve2(parsed);
800
825
  };
801
826
  const onData = (chunk) => {
802
827
  buffer += typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
828
+ if (escTimer) {
829
+ clearTimeout(escTimer);
830
+ escTimer = null;
831
+ }
803
832
  tryDeliver();
804
833
  };
805
834
  input.on("data", onData);
@@ -809,6 +838,10 @@ function createRawKeyReader(input) {
809
838
  tryDeliver();
810
839
  });
811
840
  reader.dispose = () => {
841
+ if (escTimer) {
842
+ clearTimeout(escTimer);
843
+ escTimer = null;
844
+ }
812
845
  waiter = null;
813
846
  input.off("data", onData);
814
847
  };
@@ -831,7 +864,6 @@ async function runSelectDialog(args) {
831
864
  const output = args.output ?? process.stdout;
832
865
  const input = args.input ?? process.stdin;
833
866
  const readKey = args.readKey ?? createRawKeyReader(input);
834
- output.write("\x1B[?1006h\x1B[?1000h");
835
867
  const wasRaw = Boolean(input.isTTY && input.isRaw);
836
868
  let renderedLineCount = 0;
837
869
  const bottomAnchored = Boolean(args.bottomAnchored && args.bottomRow);
@@ -882,14 +914,15 @@ async function runSelectDialog(args) {
882
914
  };
883
915
  const resizeTarget = output;
884
916
  const onOutputResize = () => paint();
885
- if (input.isTTY && !wasRaw) {
886
- input.setRawMode?.(true);
887
- }
888
- if (bottomAnchored && outputIsTty(output)) {
889
- resizeTarget.on?.("resize", onOutputResize);
890
- }
891
- paint();
892
917
  try {
918
+ output.write("\x1B[?1006h\x1B[?1000h");
919
+ if (input.isTTY && !wasRaw) {
920
+ input.setRawMode?.(true);
921
+ }
922
+ if (bottomAnchored && outputIsTty(output)) {
923
+ resizeTarget.on?.("resize", onOutputResize);
924
+ }
925
+ paint();
893
926
  while (true) {
894
927
  const sequence = await readKey();
895
928
  if (sequence == null) {
@@ -897,6 +930,9 @@ async function runSelectDialog(args) {
897
930
  }
898
931
  const scrollAction = parseScrollAction(sequence);
899
932
  if (scrollAction === "wheel-up" || scrollAction === "wheel-down") {
933
+ if (args.wheelPolicy === "ignore") {
934
+ continue;
935
+ }
900
936
  selectedIndex = Math.min(
901
937
  Math.max(
902
938
  selectedIndex + (scrollAction === "wheel-up" ? -1 : 1),
@@ -1012,6 +1048,11 @@ async function runConfirmDialog(args) {
1012
1048
  titleLines,
1013
1049
  input,
1014
1050
  output,
1051
+ // confirm is a non-list modal: a wheel scroll must do nothing at all — no
1052
+ // highlight move, no repaint, no cancel (spec). Without this it would
1053
+ // inherit runSelectDialog's default "move" and let the wheel flip
1054
+ // Allow/Deny, which is the opposite of the intended silent-swallow.
1055
+ wheelPolicy: "ignore",
1015
1056
  ...args.readKey ? { readKey: args.readKey } : {},
1016
1057
  ...args.bottomAnchored ? { bottomAnchored: args.bottomAnchored } : {},
1017
1058
  ...args.bottomRow ? { bottomRow: args.bottomRow } : {}
@@ -1365,7 +1406,6 @@ async function runAskChoiceDialog(args) {
1365
1406
  const output = args.output ?? process.stdout;
1366
1407
  const input = args.input ?? process.stdin;
1367
1408
  const readKey = args.readKey ?? createRawKeyReader(input);
1368
- output.write("\x1B[?1006h\x1B[?1000h");
1369
1409
  const wasRaw = Boolean(input.isTTY && input.isRaw);
1370
1410
  let renderedLineCount = 0;
1371
1411
  const bottomAnchored = Boolean(args.bottomAnchored && args.bottomRow);
@@ -1442,14 +1482,15 @@ async function runAskChoiceDialog(args) {
1442
1482
  };
1443
1483
  const resizeTarget = output;
1444
1484
  const onOutputResize = () => paint();
1445
- if (input.isTTY && !wasRaw) {
1446
- input.setRawMode?.(true);
1447
- }
1448
- if (bottomAnchored && outputIsTty(output)) {
1449
- resizeTarget.on?.("resize", onOutputResize);
1450
- }
1451
- paint();
1452
1485
  try {
1486
+ output.write("\x1B[?1006h\x1B[?1000h");
1487
+ if (input.isTTY && !wasRaw) {
1488
+ input.setRawMode?.(true);
1489
+ }
1490
+ if (bottomAnchored && outputIsTty(output)) {
1491
+ resizeTarget.on?.("resize", onOutputResize);
1492
+ }
1493
+ paint();
1453
1494
  while (state.phase === "active") {
1454
1495
  const sequence = await readKey();
1455
1496
  if (sequence == null) {
@@ -1465,6 +1506,9 @@ async function runAskChoiceDialog(args) {
1465
1506
  paint();
1466
1507
  continue;
1467
1508
  }
1509
+ if (SGR_MOUSE_REGEX.test(sequence)) {
1510
+ continue;
1511
+ }
1468
1512
  let action = null;
1469
1513
  const qs = state.questionStates[state.activeIndex];
1470
1514
  const q = state.questions[state.activeIndex];
@@ -1717,7 +1761,7 @@ function createActivityIndicator(deps) {
1717
1761
  }
1718
1762
  }
1719
1763
  if (agentRunSnapshot) {
1720
- lines.push(...formatAgentRunPanelLines(agentRunSnapshot, colorEnabled));
1764
+ lines.push(...formatAgentRunPanelLines(agentRunSnapshot, colorEnabled, now()));
1721
1765
  }
1722
1766
  return lines.length > 0 ? lines : null;
1723
1767
  };
@@ -1746,52 +1790,56 @@ function createActivityIndicator(deps) {
1746
1790
  stop
1747
1791
  };
1748
1792
  }
1749
- function formatAgentRunPanelLines(snapshot, colorEnabled) {
1793
+ function formatPanelProgress(snapshot) {
1794
+ const parts = [];
1795
+ if (typeof snapshot.toolCallCount === "number" && Number.isFinite(snapshot.toolCallCount)) {
1796
+ parts.push(`${snapshot.toolCallCount} tools`);
1797
+ }
1798
+ if (snapshot.lastToolNames && snapshot.lastToolNames.length > 0) {
1799
+ parts.push(snapshot.lastToolNames.join(", "));
1800
+ }
1801
+ return parts.length > 0 ? ` \xB7 ${parts.join(" \xB7 ")}` : "";
1802
+ }
1803
+ function formatPanelDetail(snapshot) {
1804
+ const note = snapshot.lastAssistantText?.trim();
1805
+ if (note) return note;
1806
+ if (!runShowsLogTail(snapshot.status)) return "";
1807
+ const lines = snapshot.logLines;
1808
+ if (!lines || lines.length === 0) return "";
1809
+ return lines[lines.length - 1]?.trim() ?? "";
1810
+ }
1811
+ function formatAgentRunPanelLines(snapshot, colorEnabled, now = Date.now()) {
1750
1812
  const lines = [];
1751
1813
  const name = snapshot.agentName || "sub-agent";
1752
- const runId = snapshot.runId ? ` (${snapshot.runId.slice(0, 8)})` : "";
1814
+ const short = shortRunId(snapshot.runId);
1815
+ const runId = short ? ` (${short})` : "";
1753
1816
  const status = snapshot.status || "running";
1754
- let statusSymbol = "\u231B";
1755
- let statusColor = "warning";
1756
- if (status === "completed" || status === "finished" || status === "success") {
1757
- statusSymbol = "\u2713";
1758
- statusColor = "success";
1759
- } else if (status === "killed" || status === "cancelled" || status === "failed" || status === "stopped") {
1760
- statusSymbol = "\u{1F534}";
1761
- statusColor = "danger";
1762
- }
1763
- const pollPart = snapshot.polls !== void 0 ? ` (polls: ${snapshot.polls})` : "";
1817
+ const statusSymbol = getAgentRunStatusIcon(status);
1818
+ const statusColor = !isAgentRunTerminalStatus(status) ? "warning" : status === "done" ? "success" : "danger";
1764
1819
  const errPart = snapshot.errorMessage ? ` \xB7 ${snapshot.errorMessage}` : "";
1820
+ const progressPart = formatPanelProgress(snapshot);
1821
+ const age = formatRunAge(snapshot, now);
1822
+ const agePart = age ? ` \xB7 ${age}` : "";
1765
1823
  if (!colorEnabled) {
1766
- lines.push(`\u{1F916} Sub-Agent: ${name}${runId} \xB7 ${statusSymbol} ${status}${pollPart}${errPart}`);
1824
+ lines.push(
1825
+ `\u{1F916} Sub-Agent: ${name}${runId} \xB7 ${statusSymbol} ${status}${agePart}${progressPart}${errPart}`
1826
+ );
1767
1827
  } else {
1768
1828
  const botIcon = themeText("\u{1F916}", "accent", true);
1769
1829
  const labelText = themeText(" Sub-Agent: ", "muted", true);
1770
1830
  const nameText = themeText(`${name}${runId}`, "chrome", true);
1771
1831
  const statusText = themeText(` \xB7 ${statusSymbol} ${status}`, statusColor, true);
1772
- const pollsText = pollPart ? themeText(pollPart, "chrome") : "";
1832
+ const ageText = agePart ? themeText(agePart, "chrome") : "";
1833
+ const progressText = progressPart ? themeText(progressPart, "chrome") : "";
1773
1834
  const errorText = errPart ? themeText(errPart, "danger") : "";
1774
- lines.push(`${botIcon}${labelText}${nameText}${statusText}${pollsText}${errorText}`);
1835
+ lines.push(`${botIcon}${labelText}${nameText}${statusText}${ageText}${progressText}${errorText}`);
1775
1836
  }
1776
- let logLine;
1777
- if (snapshot.logTail) {
1778
- const trimmed = snapshot.logTail.trim();
1779
- if (trimmed) {
1780
- const parts = trimmed.split(/\r?\n/);
1781
- logLine = parts[parts.length - 1];
1782
- }
1783
- } else if (snapshot.logLines && snapshot.logLines.length > 0) {
1784
- logLine = snapshot.logLines[snapshot.logLines.length - 1];
1785
- }
1786
- if (logLine && logLine.trim()) {
1787
- const cleanLog = logLine.trim();
1837
+ const detail = formatPanelDetail(snapshot);
1838
+ if (detail) {
1788
1839
  if (!colorEnabled) {
1789
- lines.push(` \u2514 Log: ${cleanLog}`);
1840
+ lines.push(` \u2514 ${detail}`);
1790
1841
  } else {
1791
- const branchChar = themeText(" \u2514 ", "muted");
1792
- const logTag = themeText("Log: ", "muted");
1793
- const logContent = themeText(cleanLog, "chrome");
1794
- lines.push(`${branchChar}${logTag}${logContent}`);
1842
+ lines.push(`${themeText(" \u2514 ", "muted")}${themeText(detail, "chrome")}`);
1795
1843
  }
1796
1844
  }
1797
1845
  return lines;
@@ -4032,8 +4080,8 @@ function renderTurnBlock(role, content, contentWidth, colorEnabled) {
4032
4080
  const line = logicalLines[i];
4033
4081
  let styledLine;
4034
4082
  if (colorEnabled) {
4035
- const prefix = i === 0 ? `${accentSeq}\u276F\x1B[39m ` : `${chromeSeq}\u2502\x1B[39m `;
4036
- styledLine = `${prefix}${line}`;
4083
+ const prefix = i === 0 ? `${accentSeq}\u276F ` : `${chromeSeq}\u2502 `;
4084
+ styledLine = `${prefix}\x1B[1m${accentSeq}${line}`;
4037
4085
  } else {
4038
4086
  const prefix = i === 0 ? "\u276F " : " ";
4039
4087
  styledLine = `${prefix}${line}`;
@@ -4907,7 +4955,8 @@ async function runAgentChat(scriptDir, state, message, env, output, agentRunner
4907
4955
  localRuntimeAdapterFactory: (factoryEnv, factoryOptions) => createCliLocalRuntimeAdapter({
4908
4956
  env: factoryEnv,
4909
4957
  cwd: factoryOptions?.cwd ?? state.cwd,
4910
- pastedTextStore: options.pastedTextStore
4958
+ pastedTextStore: options.pastedTextStore,
4959
+ ...options.activityReporter ? { activityReporter: options.activityReporter } : {}
4911
4960
  })
4912
4961
  } : {},
4913
4962
  ...options.activityReporter ? { activityReporter: options.activityReporter } : {},
@@ -5445,7 +5494,11 @@ async function startTuiWorkspace(options) {
5445
5494
  dialogLabel: runResult.title || runResult.dialogId
5446
5495
  } : {},
5447
5496
  ...runResult.turnTokens ? { turnTokens: runResult.turnTokens } : {},
5448
- ...runResult.contextWindow ? { contextWindow: runResult.contextWindow } : {}
5497
+ ...runResult.contextWindow ? { contextWindow: runResult.contextWindow } : {},
5498
+ // input_tokens 是累计上下文输入(含历史消息),把它持久化到
5499
+ // estimatedContextTokens:下一轮若 provider 不返回 usage,context
5500
+ // chip 仍显示真实累计占用而不是回退到启动时的静态估算。
5501
+ ...runResult.turnTokens && runResult.turnTokens.input > 0 ? { estimatedContextTokens: runResult.turnTokens.input } : {}
5449
5502
  };
5450
5503
  }
5451
5504
  if (!wasAborted && runResult.exitCode !== 0) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cleanupCliSessionForDialog
3
- } from "./chunk-JS33TCQ3.js";
3
+ } from "./chunk-RPDGJO4D.js";
4
4
  import {
5
5
  getPrimaryDialogAgentId,
6
6
  removeDialogAgentId
@@ -8,23 +8,23 @@ import {
8
8
  import {
9
9
  require_date_fns
10
10
  } from "./chunk-M76ECQRD.js";
11
- import "./chunk-BYXBJQAS.js";
11
+ import "./chunk-ZHXJ6M7T.js";
12
12
  import {
13
13
  getActiveDialogKey
14
14
  } from "./chunk-3ASDTTEI.js";
15
- import "./chunk-TTGAVETO.js";
15
+ import "./chunk-EABWT43X.js";
16
16
  import "./chunk-Y5GCAMGP.js";
17
17
  import "./chunk-KX6YBIHG.js";
18
18
  import {
19
19
  patch,
20
20
  selectById
21
- } from "./chunk-SFXYKGK2.js";
21
+ } from "./chunk-3S2VOMIF.js";
22
22
  import "./chunk-O4BU24WZ.js";
23
23
  import "./chunk-I42VC5KR.js";
24
24
  import "./chunk-WWC7I6TA.js";
25
25
  import "./chunk-JTINRTBT.js";
26
26
  import "./chunk-QSJ3HFEF.js";
27
- import "./chunk-VPTJB4HM.js";
27
+ import "./chunk-XPC5C7BK.js";
28
28
  import "./chunk-DVRHHFEA.js";
29
29
  import "./chunk-OOSFSFMA.js";
30
30
  import "./chunk-GBRG75BQ.js";
@@ -1,53 +1,54 @@
1
1
  import {
2
2
  fetchAgentContexts
3
- } from "./chunk-G2MKOQCB.js";
3
+ } from "./chunk-WBA6SIBB.js";
4
4
  import {
5
5
  generateRequestBody,
6
6
  mergeReferences,
7
7
  performFetchRequest
8
- } from "./chunk-6565R2TI.js";
9
- import "./chunk-ISYE6GZB.js";
8
+ } from "./chunk-XEWUC53Z.js";
9
+ import "./chunk-L6NVTGI7.js";
10
10
  import {
11
11
  findToolExecutor,
12
12
  getToolResultErrorData
13
- } from "./chunk-VE6XMVKG.js";
13
+ } from "./chunk-D4NCEGGR.js";
14
14
  import "./chunk-RQSOAMPJ.js";
15
- import "./chunk-OOIN7HSO.js";
15
+ import "./chunk-XJITGCTM.js";
16
16
  import "./chunk-KQHGZWSV.js";
17
- import "./chunk-O53CP2QR.js";
18
- import "./chunk-U7LEGLEB.js";
17
+ import "./chunk-6CRACQXW.js";
18
+ import "./chunk-6N4KODMN.js";
19
19
  import "./chunk-3LY4F7SV.js";
20
20
  import "./chunk-VP4WJWKW.js";
21
21
  import "./chunk-63W5N6P3.js";
22
22
  import "./chunk-VF4K2QE6.js";
23
- import "./chunk-Z24FGIU2.js";
23
+ import "./chunk-BXXECNBU.js";
24
24
  import "./chunk-VC6OZXO5.js";
25
25
  import {
26
26
  updateTokensAction
27
- } from "./chunk-YNHQIXX5.js";
28
- import "./chunk-V2J635L5.js";
27
+ } from "./chunk-4LXOVZ4W.js";
28
+ import "./chunk-XOIF2TNF.js";
29
29
  import "./chunk-MRC4Q34M.js";
30
30
  import "./chunk-MTU75CZ2.js";
31
31
  import "./chunk-CWMSB67P.js";
32
- import "./chunk-OQMPU2ML.js";
33
- import "./chunk-JS33TCQ3.js";
32
+ import "./chunk-ZXQ52OY2.js";
33
+ import "./chunk-RPDGJO4D.js";
34
34
  import "./chunk-SOTZ6RDN.js";
35
35
  import "./chunk-Z4NR32XR.js";
36
36
  import "./chunk-M76ECQRD.js";
37
37
  import "./chunk-WZSRQNQG.js";
38
- import "./chunk-RKM3K52F.js";
39
- import "./chunk-HRQCKQA5.js";
38
+ import "./chunk-GPELDE6I.js";
39
+ import "./chunk-KFEVY3ST.js";
40
+ import "./chunk-MUCU6ATG.js";
40
41
  import {
41
42
  canonicalizeToolName
42
- } from "./chunk-B4KT7RN2.js";
43
- import "./chunk-4QQFLN5C.js";
43
+ } from "./chunk-JTMNCCWF.js";
44
+ import "./chunk-OVBVEXZ7.js";
44
45
  import "./chunk-5MMAK75Q.js";
45
46
  import {
46
47
  getApiEndpoint
47
- } from "./chunk-OGGHETUE.js";
48
+ } from "./chunk-HQPG2PIV.js";
48
49
  import "./chunk-5CS33IBL.js";
49
50
  import "./chunk-JZPBVBIY.js";
50
- import "./chunk-BYXBJQAS.js";
51
+ import "./chunk-ZHXJ6M7T.js";
51
52
  import "./chunk-KKY4B2Q2.js";
52
53
  import "./chunk-5MIDPSSK.js";
53
54
  import {
@@ -56,24 +57,24 @@ import {
56
57
  import "./chunk-3ASDTTEI.js";
57
58
  import "./chunk-DWLEOOGR.js";
58
59
  import "./chunk-HNMXYYJR.js";
59
- import "./chunk-IKXL2HZ3.js";
60
- import "./chunk-524BDL33.js";
61
- import "./chunk-N5424GSW.js";
60
+ import "./chunk-RK5NYQEL.js";
61
+ import "./chunk-O6W2O2DA.js";
62
+ import "./chunk-YJKXGHJ6.js";
62
63
  import {
63
64
  selectCurrentServer
64
- } from "./chunk-TTGAVETO.js";
65
+ } from "./chunk-EABWT43X.js";
65
66
  import "./chunk-Y5GCAMGP.js";
66
67
  import "./chunk-KX6YBIHG.js";
67
- import "./chunk-XVP3C2KY.js";
68
+ import "./chunk-IWLUTMYX.js";
68
69
  import {
69
70
  read
70
- } from "./chunk-SFXYKGK2.js";
71
+ } from "./chunk-3S2VOMIF.js";
71
72
  import "./chunk-O4BU24WZ.js";
72
73
  import "./chunk-I42VC5KR.js";
73
74
  import "./chunk-WWC7I6TA.js";
74
75
  import "./chunk-JTINRTBT.js";
75
76
  import "./chunk-QSJ3HFEF.js";
76
- import "./chunk-VPTJB4HM.js";
77
+ import "./chunk-XPC5C7BK.js";
77
78
  import {
78
79
  selectIdentityToken
79
80
  } from "./chunk-DVRHHFEA.js";
@@ -7,13 +7,13 @@ import {
7
7
  import {
8
8
  patch,
9
9
  selectById
10
- } from "./chunk-SFXYKGK2.js";
10
+ } from "./chunk-3S2VOMIF.js";
11
11
  import "./chunk-O4BU24WZ.js";
12
12
  import "./chunk-I42VC5KR.js";
13
13
  import "./chunk-WWC7I6TA.js";
14
14
  import "./chunk-JTINRTBT.js";
15
15
  import "./chunk-QSJ3HFEF.js";
16
- import "./chunk-VPTJB4HM.js";
16
+ import "./chunk-XPC5C7BK.js";
17
17
  import "./chunk-DVRHHFEA.js";
18
18
  import "./chunk-OOSFSFMA.js";
19
19
  import "./chunk-GBRG75BQ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cleanupCliSessionForDialog
3
- } from "./chunk-JS33TCQ3.js";
3
+ } from "./chunk-RPDGJO4D.js";
4
4
  import {
5
5
  getPrimaryDialogAgentId,
6
6
  replacePrimaryDialogAgentId
@@ -8,23 +8,23 @@ import {
8
8
  import {
9
9
  require_date_fns
10
10
  } from "./chunk-M76ECQRD.js";
11
- import "./chunk-BYXBJQAS.js";
11
+ import "./chunk-ZHXJ6M7T.js";
12
12
  import {
13
13
  getActiveDialogKey
14
14
  } from "./chunk-3ASDTTEI.js";
15
- import "./chunk-TTGAVETO.js";
15
+ import "./chunk-EABWT43X.js";
16
16
  import "./chunk-Y5GCAMGP.js";
17
17
  import "./chunk-KX6YBIHG.js";
18
18
  import {
19
19
  patch,
20
20
  selectById
21
- } from "./chunk-SFXYKGK2.js";
21
+ } from "./chunk-3S2VOMIF.js";
22
22
  import "./chunk-O4BU24WZ.js";
23
23
  import "./chunk-I42VC5KR.js";
24
24
  import "./chunk-WWC7I6TA.js";
25
25
  import "./chunk-JTINRTBT.js";
26
26
  import "./chunk-QSJ3HFEF.js";
27
- import "./chunk-VPTJB4HM.js";
27
+ import "./chunk-XPC5C7BK.js";
28
28
  import "./chunk-DVRHHFEA.js";
29
29
  import "./chunk-OOSFSFMA.js";
30
30
  import "./chunk-GBRG75BQ.js";