nolo-cli 0.14.0-alpha.9 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/{_executeModel-OQ6KPFSB.js → _executeModel-QAUS6B7J.js} +24 -24
  2. package/{action-N3KXFO5V.js → action-GUOZYYGN.js} +4 -4
  3. package/{addContentAction-4Z762DMR.js → addContentAction-QDGHGUBH.js} +3 -3
  4. package/{addDialogAgentAction-FALLEKPR.js → addDialogAgentAction-Z4YCYZIV.js} +2 -2
  5. package/{agentDeleteCommand-UBXH2FDO.js → agentDeleteCommand-QDO62EZA.js} +20 -20
  6. package/{agentEmailCommands-ZI2FIUBV.js → agentEmailCommands-UZ5BKX3P.js} +37 -37
  7. package/{agentListCommands-7M6FHCSH.js → agentListCommands-ZC33UDWT.js} +22 -22
  8. package/{agentMachineCommands-R3FW62QH.js → agentMachineCommands-RZGZEZRL.js} +20 -20
  9. package/{agentRecordCommands-WUY3C3HZ.js → agentRecordCommands-DGDXE2VH.js} +32 -32
  10. package/{agentRunCommand-CWXYVYPZ.js → agentRunCommand-SRZWFOPH.js} +34 -34
  11. package/{agentRuntimeLocal-BONMVACL.js → agentRuntimeLocal-4YCF6IRF.js} +11 -11
  12. package/{agentSlice-IHOSTSWC.js → agentSlice-IVE735EV.js} +3 -3
  13. package/appDeleteCommands-7I26L64I.js +124 -0
  14. package/appDeployCommands-TZLZNTJN.js +163 -0
  15. package/appDeployStatusCommands-OPPTLHRW.js +144 -0
  16. package/appGetCommands-N2S4HYKY.js +119 -0
  17. package/appListCommands-OBTPPKUM.js +122 -0
  18. package/{authCommand-IKIU4FZY.js → authCommand-YFTR3347.js} +5 -5
  19. package/{authCommands-QP43ADV3.js → authCommands-YXGOXNBZ.js} +3 -3
  20. package/{chunk-3B2LFO6R.js → browser-image-compression-MFDTD7K6.js} +4 -518
  21. package/{chunk-YQAG2J2T.js → chunk-472E5RMQ.js} +1 -1
  22. package/chunk-4QQFLN5C.js +552 -0
  23. package/{chunk-SZ7RUWAQ.js → chunk-5VMYGIIL.js} +97 -38
  24. package/{chunk-P6DRYHVM.js → chunk-6565R2TI.js} +16 -14
  25. package/{chunk-2ROIXEDX.js → chunk-6MHDWKOT.js} +2 -2
  26. package/{chunk-GGHFCK3X.js → chunk-AWDOJBHW.js} +426 -430
  27. package/{chunk-DUE6E46E.js → chunk-BFRVXJJJ.js} +43 -16
  28. package/{chunk-UONU6Q4P.js → chunk-G2MKOQCB.js} +1 -1
  29. package/chunk-GFUIQ4RY.js +136 -0
  30. package/{chunk-SRKNB2WB.js → chunk-HRQCKQA5.js} +4 -4
  31. package/{chunk-CDQ2ICPR.js → chunk-IOQ7IBPU.js} +1 -1
  32. package/{chunk-QLO2G5HP.js → chunk-ISYE6GZB.js} +1 -1
  33. package/{chunk-CXLGUR7M.js → chunk-IZ2QRVEU.js} +2 -2
  34. package/{chunk-U4J6ZZFY.js → chunk-JBKVPAYK.js} +7 -140
  35. package/{chunk-V6VXDXGY.js → chunk-JS33TCQ3.js} +2 -2
  36. package/{chunk-YG3CCS7C.js → chunk-K53477EY.js} +4 -4
  37. package/{chunk-3WGLLTK4.js → chunk-LSFAWXKC.js} +100 -3
  38. package/{chunk-BHK5ZAW7.js → chunk-N5424GSW.js} +1 -1
  39. package/chunk-NTC6I2FN.js +107 -0
  40. package/{chunk-QNXEDF7V.js → chunk-O53CP2QR.js} +3 -3
  41. package/{chunk-CY4TAX6S.js → chunk-OKSYPTDZ.js} +9 -9
  42. package/{chunk-NFHGY5T5.js → chunk-OQMPU2ML.js} +4 -4
  43. package/{chunk-NSZB7BYV.js → chunk-P4MJQWWF.js} +2 -2
  44. package/{chunk-JHFMRUGX.js → chunk-RKM3K52F.js} +1 -1
  45. package/{chunk-A5V7UEZJ.js → chunk-SFXYKGK2.js} +3 -3
  46. package/{chunk-S5UACFUP.js → chunk-TTGAVETO.js} +10 -2
  47. package/{chunk-BOJVWKNA.js → chunk-U7LEGLEB.js} +1 -1
  48. package/{chunk-YDOTMXTK.js → chunk-UXKQQ2MR.js} +9 -9
  49. package/{chunk-KUDUXBNE.js → chunk-VE6XMVKG.js} +189 -41
  50. package/{chunk-NJVPXLRY.js → chunk-VPTJB4HM.js} +1 -1
  51. package/{chunk-3AE4NQ5O.js → chunk-WA6KZL5V.js} +25 -6
  52. package/{chunk-T3X232L6.js → chunk-WNLPAOIT.js} +1 -1
  53. package/{chunk-MEXNTURY.js → chunk-WRN5EQT7.js} +1 -1
  54. package/{chunk-FVGJNXPJ.js → chunk-XGQZFBO5.js} +83 -206
  55. package/{chunk-3FCSMQAC.js → chunk-XVP3C2KY.js} +1 -1
  56. package/{chunk-SW3Q2OV5.js → chunk-YNHQIXX5.js} +774 -5735
  57. package/{chunk-7VKJDLPO.js → chunk-Z24FGIU2.js} +2 -2
  58. package/{createAgentAutomationAction-W4OZQ63I.js → createAgentAutomationAction-TS6NNZ4X.js} +9 -9
  59. package/{createDialogAction-G6XQLPAN.js → createDialogAction-5HVQ33EX.js} +10 -10
  60. package/{createPageAction-RNT4LCAX.js → createPageAction-4F3ZGQJD.js} +9 -9
  61. package/{dbSlice-7Q23HSWH.js → dbSlice-OP6UPXKA.js} +2 -2
  62. package/{dialogCommands-YUTOCICO.js → dialogCommands-3GEPXHFB.js} +16 -16
  63. package/{dialogSlice-QZZF4JXD.js → dialogSlice-FAWUQDJW.js} +9 -9
  64. package/{docCreateCommands-LQYOVE7D.js → docCreateCommands-ZE3S6BCP.js} +22 -20
  65. package/{docDeleteCommands-LNS5V76K.js → docDeleteCommands-TW6PGTRT.js} +21 -19
  66. package/{docReadCommands-IRCP66BG.js → docReadCommands-LDXL3B6J.js} +20 -18
  67. package/{docStore-66Q4JTTG.js → docStore-2UHVWLTV.js} +10 -10
  68. package/{docUpdateCommands-4VUX3Q7W.js → docUpdateCommands-GYD6XI5O.js} +21 -19
  69. package/{handleSendMessageAction-CB5UKK2X.js → handleSendMessageAction-LJPUYNOH.js} +9 -9
  70. package/index.js +92 -61
  71. package/{machineCommands-PX2BADIB.js → machineCommands-OKNDYS3M.js} +35 -35
  72. package/{machineWsRunDispatch-IBNCRCEQ.js → machineWsRunDispatch-ZX5AJ6FJ.js} +31 -31
  73. package/package.json +1 -1
  74. package/{read-SIWMJRHC.js → read-HXHAZBKH.js} +1 -1
  75. package/{readDocTool-TCYJY4PP.js → readDocTool-VPBDTO4G.js} +1 -1
  76. package/{readlineWorkspace-YIXJ2OOO.js → readlineWorkspace-MB3ANKHM.js} +92 -92
  77. package/{removeDialogAgentAction-WKHZT6VJ.js → removeDialogAgentAction-HUFVN35S.js} +4 -4
  78. package/{runAgentClientLoop-BXMDAQB2.js → runAgentClientLoop-A75BUU6D.js} +19 -19
  79. package/{setDialogExtraReferencesAction-GCI5QU6E.js → setDialogExtraReferencesAction-2VLGWQKG.js} +2 -2
  80. package/{setPrimaryDialogAgentAction-NRO57AS6.js → setPrimaryDialogAgentAction-VB4UV2CC.js} +4 -4
  81. package/{settingSlice-FTWZ5ZHT.js → settingSlice-7JYPQNAC.js} +3 -3
  82. package/{spaceCommands-7Z6DZFEE.js → spaceCommands-O3KJNCON.js} +21 -21
  83. package/{spaceSlice-3GLIRD3Q.js → spaceSlice-444MFUP6.js} +9 -9
  84. package/{streamAgentChatTurn-SN7YS2VV.js → streamAgentChatTurn-DJAE7USZ.js} +42 -39
  85. package/{tools-4JSNWHIK.js → tools-YB6LXSVN.js} +14 -14
  86. package/{tuiSummaryLlmCaller-PS5BDLHV.js → tuiSummaryLlmCaller-QQL3JA5I.js} +3 -3
  87. package/{updateDialogTitleAction-DUJ2JZXX.js → updateDialogTitleAction-6HGFBM64.js} +9 -9
  88. package/{agentGrantCommands-JMTM6U4B.js → agentGrantCommands-JNDE4RWR.js} +1 -1
  89. package/{agentPullCommand-UXANSFU3.js → agentPullCommand-6HWUT3SW.js} +1 -1
  90. package/{chunk-3QAF2LTL.js → chunk-DZ3XJVET.js} +3 -3
  91. package/{chunk-HBRZXXP5.js → chunk-KMQPSTMJ.js} +6 -6
  92. package/{tableCommands-V5O7QMXY.js → tableCommands-3P7MJ3PF.js} +3 -3
@@ -1,6 +1,3 @@
1
- import {
2
- resolveMachineId
3
- } from "./chunk-6HYVJV7B.js";
4
1
  import {
5
2
  buildLocalRunEnv,
6
3
  isFullstackCodingAgentRef,
@@ -9,7 +6,10 @@ import {
9
6
  resolveRawAgentInput,
10
7
  resolveServerUrl,
11
8
  writeUsage
12
- } from "./chunk-3QAF2LTL.js";
9
+ } from "./chunk-DZ3XJVET.js";
10
+ import {
11
+ resolveMachineId
12
+ } from "./chunk-6HYVJV7B.js";
13
13
  import {
14
14
  agentRunCardLabels,
15
15
  createCliCallAgentToolExecutor,
@@ -18,20 +18,17 @@ import {
18
18
  isBuiltinNoloAgentRef,
19
19
  t,
20
20
  toolLabel
21
- } from "./chunk-GGHFCK3X.js";
22
- import {
23
- CliProviderQuotaError
24
- } from "./chunk-CMKUBIGW.js";
21
+ } from "./chunk-AWDOJBHW.js";
25
22
  import {
26
23
  getReadableCliDb
27
24
  } from "./chunk-W4NVOSFF.js";
28
25
  import {
29
26
  readDbRecord,
30
27
  resolveAgentRecordFromHybridStore
31
- } from "./chunk-YG3CCS7C.js";
28
+ } from "./chunk-K53477EY.js";
32
29
  import {
33
30
  normalizeAgentHandle
34
- } from "./chunk-CDQ2ICPR.js";
31
+ } from "./chunk-IOQ7IBPU.js";
35
32
  import {
36
33
  NOLO_PROJECT_MANAGER_AGENT_KEY,
37
34
  isLocalCliAgentKey
@@ -48,7 +45,7 @@ import {
48
45
  formatStatusRunCard,
49
46
  formatStopRunCard,
50
47
  isAgentRunTerminalStatus
51
- } from "./chunk-KUDUXBNE.js";
48
+ } from "./chunk-VE6XMVKG.js";
52
49
  import {
53
50
  isGatewayHttpStatus
54
51
  } from "./chunk-RQSOAMPJ.js";
@@ -57,7 +54,7 @@ import {
57
54
  chooseMemoryOwners,
58
55
  loadMemoryCandidatesFromDb,
59
56
  resolveAgentMemoryPolicy
60
- } from "./chunk-7VKJDLPO.js";
57
+ } from "./chunk-Z24FGIU2.js";
61
58
  import {
62
59
  parseExternalSkillMarkdown,
63
60
  parseSkillDocProtocol
@@ -66,14 +63,14 @@ import {
66
63
  API_REPORTED_COST_MULTIPLIER,
67
64
  normalizeUsage,
68
65
  parseUiAskChoiceContent
69
- } from "./chunk-SW3Q2OV5.js";
66
+ } from "./chunk-YNHQIXX5.js";
70
67
  import {
71
68
  buildSkillDiscoveryContextBlock
72
69
  } from "./chunk-AS3ZQ3O2.js";
73
70
  import {
74
71
  buildPlatformChatCompletionRequest,
75
72
  parsePlatformChatCompletionData
76
- } from "./chunk-3AE4NQ5O.js";
73
+ } from "./chunk-WA6KZL5V.js";
77
74
  import {
78
75
  resolveAgentRuntimeConfigFromRecord
79
76
  } from "./chunk-OIQPORYI.js";
@@ -82,15 +79,20 @@ import {
82
79
  LOCAL_TURN_ABORTED_CODE,
83
80
  readActionGate,
84
81
  readCommandActionGatePayload
85
- } from "./chunk-2ROIXEDX.js";
82
+ } from "./chunk-6MHDWKOT.js";
83
+ import {
84
+ createThinkParserState,
85
+ flushThinkParser,
86
+ processThinkChunk
87
+ } from "./chunk-LSFAWXKC.js";
86
88
  import {
87
89
  resolvePlatformAuthToken,
88
90
  resolvePlatformChatCompletionsEndpoint
89
- } from "./chunk-SRKNB2WB.js";
91
+ } from "./chunk-HRQCKQA5.js";
90
92
  import {
91
93
  DEFAULT_CONTEXT_WINDOW,
92
94
  getModelContextWindow
93
- } from "./chunk-3B2LFO6R.js";
95
+ } from "./chunk-4QQFLN5C.js";
94
96
  import {
95
97
  clipCompactText
96
98
  } from "./chunk-5MMAK75Q.js";
@@ -109,6 +111,9 @@ import {
109
111
  finalizeRunRecord,
110
112
  spawnLocalBackgroundRun
111
113
  } from "./chunk-MYMMNKYL.js";
114
+ import {
115
+ CliProviderQuotaError
116
+ } from "./chunk-CMKUBIGW.js";
112
117
  import {
113
118
  toErrorMessage
114
119
  } from "./chunk-HNMXYYJR.js";
@@ -119,6 +124,9 @@ import {
119
124
  readPipeText,
120
125
  spawnProcess
121
126
  } from "./chunk-IDZTNRP2.js";
127
+ import {
128
+ resolveAuthToken
129
+ } from "./chunk-A7GB5UGH.js";
122
130
  import {
123
131
  parsePositiveFiniteNumberOrFallback
124
132
  } from "./chunk-Y5GCAMGP.js";
@@ -132,13 +140,10 @@ import {
132
140
  BUILTIN_NOLO_AGENT_KEY,
133
141
  PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
134
142
  PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
135
- } from "./chunk-NJVPXLRY.js";
143
+ } from "./chunk-VPTJB4HM.js";
136
144
  import {
137
145
  asTrimmedString
138
146
  } from "./chunk-3EUW3WEO.js";
139
- import {
140
- resolveAuthToken
141
- } from "./chunk-A7GB5UGH.js";
142
147
  import {
143
148
  isLoopbackUrl
144
149
  } from "./chunk-4SN6J65J.js";
@@ -1597,165 +1602,25 @@ function createRenderAwareStreamWriter(args) {
1597
1602
  }
1598
1603
  };
1599
1604
  }
1600
-
1601
- // packages/cli/client/thinkingOutput.ts
1602
- var THINK_OPEN = /<think>/i;
1603
- var THINK_CLOSE = /<\/think>/i;
1604
- var COLLAPSED_MARKER = /^\s*▸ 思考已折叠\s*$/;
1605
- function normalizeThinkingDisplayMode(raw, fallback = "hide") {
1606
- const normalized = asTrimmedLowercaseString(raw);
1607
- if (normalized === "hide" || normalized === "off" || normalized === "false" || normalized === "0") {
1608
- return "hide";
1609
- }
1610
- if (normalized === "marker" || normalized === "collapsed" || normalized === "fold") {
1611
- return "marker";
1612
- }
1613
- if (normalized === "show" || normalized === "on" || normalized === "true" || normalized === "1") {
1614
- return "show";
1615
- }
1616
- return fallback;
1617
- }
1618
- function resolveThinkingDisplayMode(env = process.env) {
1619
- return normalizeThinkingDisplayMode(env.NOLO_CLI_THINKING ?? env.NOLO_THINKING, "hide");
1605
+ function formatAssistantTextForCli(text) {
1606
+ return text.replace(/\u003cthink\u003e[\s\S]*?\u003c\/think\u003e\s*/gi, "").replace(/\n{3,}/g, "\n\n").trim();
1620
1607
  }
1621
- function collapseThinkingBlocks(text, mode = "hide") {
1622
- if (mode === "show") return text;
1623
- const replacement = mode === "marker" ? "\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n" : "";
1624
- return text.replace(/<think>[\s\S]*?<\/think>\s*/gi, replacement).replace(/\n{3,}/g, "\n\n").trim();
1625
- }
1626
- function stripCollapsedThinkingMarkers(text) {
1627
- return text.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n").replace(/\n{2,}/g, "\n").trim();
1628
- }
1629
- function formatAssistantTextForCli(text, mode = "hide") {
1630
- const collapsed = collapseThinkingBlocks(text, mode);
1631
- return mode === "hide" ? stripCollapsedThinkingMarkers(collapsed) : collapsed;
1632
- }
1633
- function createThinkingEventSink(arg1, arg2) {
1634
- let mode = "hide";
1635
- let write = () => {
1636
- };
1637
- if (typeof arg1 === "function") {
1638
- write = arg1;
1639
- if (typeof arg2 === "string") {
1640
- mode = arg2;
1641
- }
1642
- } else {
1643
- mode = arg1;
1644
- if (typeof arg2 === "function") {
1645
- write = arg2;
1646
- }
1647
- }
1648
- if (mode === "hide") {
1649
- return {
1650
- push(_chunk) {
1651
- }
1652
- };
1653
- }
1654
- if (mode === "show") {
1655
- return {
1656
- push(chunk) {
1657
- if (chunk) write(chunk);
1658
- }
1659
- };
1660
- }
1661
- let markerEmitted = false;
1662
- return {
1663
- push(chunk) {
1664
- if (!chunk || markerEmitted) return;
1665
- write("\n\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n");
1666
- markerEmitted = true;
1667
- }
1668
- };
1669
- }
1670
- function createThinkingAwareStreamFilter(write, mode = "hide") {
1671
- if (mode === "show") {
1672
- return {
1673
- push(chunk) {
1674
- write(chunk);
1675
- },
1676
- flush() {
1677
- }
1678
- };
1608
+
1609
+ // packages/cli/client/formatReadPathTree.ts
1610
+ import { homedir as osHomedir } from "node:os";
1611
+
1612
+ // packages/core/foldHomePath.ts
1613
+ function foldHomePath(path, home) {
1614
+ if (!path) return path;
1615
+ if (home) {
1616
+ const cleanHome = home.endsWith("/") ? home.slice(0, -1) : home;
1617
+ if (path === cleanHome) return "~";
1618
+ if (path.startsWith(cleanHome + "/")) return `~${path.slice(cleanHome.length)}`;
1679
1619
  }
1680
- let pending = "";
1681
- let insideThink = false;
1682
- let markerEmitted = false;
1683
- const emit = (chunk) => {
1684
- if (chunk) write(chunk);
1685
- };
1686
- const emitMarker = () => {
1687
- if (mode !== "marker" || markerEmitted) return;
1688
- emit("\n\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n");
1689
- markerEmitted = true;
1690
- };
1691
- const consume = (input) => {
1692
- pending += input;
1693
- while (pending.length > 0) {
1694
- if (insideThink) {
1695
- const closeMatch = pending.match(THINK_CLOSE);
1696
- if (!closeMatch || closeMatch.index == null) {
1697
- emitMarker();
1698
- pending = "";
1699
- return;
1700
- }
1701
- emitMarker();
1702
- pending = pending.slice(closeMatch.index + closeMatch[0].length);
1703
- insideThink = false;
1704
- markerEmitted = false;
1705
- continue;
1706
- }
1707
- const openMatch = pending.match(THINK_OPEN);
1708
- if (!openMatch || openMatch.index == null) {
1709
- const nextMarker = pending.indexOf("<");
1710
- if (nextMarker === -1) {
1711
- const cleaned = mode === "hide" ? pending.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : pending;
1712
- emit(cleaned);
1713
- pending = "";
1714
- return;
1715
- }
1716
- if (nextMarker > 0) {
1717
- const head = pending.slice(0, nextMarker);
1718
- const cleaned = mode === "hide" ? head.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : head;
1719
- emit(cleaned);
1720
- pending = pending.slice(nextMarker);
1721
- continue;
1722
- }
1723
- if (pending.length < 7) return;
1724
- emit(pending[0]);
1725
- pending = pending.slice(1);
1726
- continue;
1727
- }
1728
- if (openMatch.index > 0) {
1729
- const head = pending.slice(0, openMatch.index);
1730
- const cleaned = mode === "hide" ? head.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : head;
1731
- emit(cleaned);
1732
- pending = pending.slice(openMatch.index);
1733
- continue;
1734
- }
1735
- pending = pending.slice(openMatch[0].length);
1736
- insideThink = true;
1737
- markerEmitted = false;
1738
- }
1739
- };
1740
- return {
1741
- push(chunk) {
1742
- consume(chunk);
1743
- },
1744
- flush() {
1745
- if (insideThink) emitMarker();
1746
- if (pending) {
1747
- const cleaned = mode === "hide" ? pending.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : pending;
1748
- emit(cleaned);
1749
- }
1750
- pending = "";
1751
- insideThink = false;
1752
- markerEmitted = false;
1753
- }
1754
- };
1620
+ return path.replace(/^(\/Users\/[^/]+|\/home\/[^/]+)(\/|$)/, "~$2");
1755
1621
  }
1756
1622
 
1757
1623
  // packages/cli/client/formatReadPathTree.ts
1758
- import { homedir as osHomedir } from "node:os";
1759
1624
  function clipPathAware(value, max = 72) {
1760
1625
  const compact = compactWhitespace(value);
1761
1626
  if (compact.length <= max) return compact;
@@ -1782,10 +1647,7 @@ function clipPathAware(value, max = 72) {
1782
1647
  function formatHomePath(path, customHomedir) {
1783
1648
  if (!path) return "";
1784
1649
  const home = customHomedir || (typeof process !== "undefined" ? process.env?.HOME : void 0) || (typeof osHomedir === "function" ? osHomedir() : "");
1785
- if (home && path.startsWith(home)) {
1786
- return `~${path.slice(home.length)}`;
1787
- }
1788
- return path.replace(/^(\/Users\/[^\/]+\/|\/home\/[^\/]+\/)/, "~/");
1650
+ return foldHomePath(path, home);
1789
1651
  }
1790
1652
  function formatReadItemPath(rawPath, metadata, customHomedir) {
1791
1653
  const inputPath = rawPath || (typeof metadata?.path === "string" ? metadata.path : void 0) || (typeof metadata?.filePath === "string" ? metadata.filePath : void 0) || "file";
@@ -3048,6 +2910,11 @@ function formatElapsed(totalSeconds) {
3048
2910
  const mins = minutes % 60;
3049
2911
  return `${hours}h ${mins}m`;
3050
2912
  }
2913
+ function truncateThinkingHint(text, maxLen) {
2914
+ const cleaned = text.replace(/\n/g, " ").trim();
2915
+ if (cleaned.length <= maxLen) return cleaned;
2916
+ return "\u2026" + cleaned.slice(cleaned.length - maxLen + 1);
2917
+ }
3051
2918
  var Spinner = class {
3052
2919
  constructor(output, text, silent = false) {
3053
2920
  this.output = output;
@@ -3061,6 +2928,7 @@ var Spinner = class {
3061
2928
  frameIndex = 0;
3062
2929
  frames = ["\xB7", "~", "\u2248", "\u223F", "\u2248", "~"];
3063
2930
  isTTY;
2931
+ thinkingHint = "";
3064
2932
  start() {
3065
2933
  if (this.silent) {
3066
2934
  this.startTime = Date.now();
@@ -3096,9 +2964,11 @@ ${this.text}
3096
2964
  this.output.write("\r\x1B[K");
3097
2965
  this.output.write("\x1B[?25h");
3098
2966
  }
2967
+ this.thinkingHint = "";
3099
2968
  }
3100
2969
  show(text) {
3101
2970
  this.text = text;
2971
+ this.thinkingHint = "";
3102
2972
  if (this.silent) {
3103
2973
  if (!this.startTime) {
3104
2974
  this.startTime = Date.now();
@@ -3114,20 +2984,30 @@ ${this.text}
3114
2984
  this.startTime = Date.now();
3115
2985
  this.output.write(`\r${this.renderLine(this.frames[0])}`);
3116
2986
  }
2987
+ /**
2988
+ * Update the thinking hint displayed on the spinner line. The hint is
2989
+ * truncated to a reasonable length and shown as part of the spinner text.
2990
+ * Only meaningful while the spinner is active (TTY mode).
2991
+ */
2992
+ setThinkingHint(text) {
2993
+ this.thinkingHint = text;
2994
+ if (this.silent || !this.isTTY || !this.timer) return;
2995
+ this.output.write(`\r${this.renderLine(this.frames[this.frameIndex])}`);
2996
+ }
3117
2997
  renderLine(frame) {
3118
2998
  const elapsedSeconds = Math.max(
3119
2999
  0,
3120
3000
  Math.floor((Date.now() - this.startTime) / 1e3)
3121
3001
  );
3122
- return `${themeColorSequence("accent")}${frame}\x1B[39m ${this.text} (${formatElapsed(elapsedSeconds)})`;
3002
+ const thinkingPart = this.thinkingHint ? `: ${truncateThinkingHint(this.thinkingHint, 60)}` : "";
3003
+ return `${themeColorSequence("accent")}${frame}\x1B[39m ${this.text}${thinkingPart} (${formatElapsed(elapsedSeconds)})`;
3123
3004
  }
3124
3005
  };
3125
3006
 
3126
3007
  // packages/cli/client/agentRunOutput.ts
3127
- function formatAssistantResponseForCli(text, options) {
3128
- const thinkingMode = resolveThinkingDisplayMode(options.env);
3008
+ function formatAssistantResponseForCli(text) {
3129
3009
  return formatAssistantDisplay(
3130
- formatAssistantTextForCli(text, thinkingMode)
3010
+ formatAssistantTextForCli(text)
3131
3011
  );
3132
3012
  }
3133
3013
  function resolveAgentEventMode(options) {
@@ -3160,12 +3040,19 @@ function createCliTurnOutput(params) {
3160
3040
  let streamedAssistantText = false;
3161
3041
  let everStreamedAnyText = false;
3162
3042
  let printedAssistantLabel = false;
3163
- const thinkingMode = resolveThinkingDisplayMode(options.env);
3043
+ let thinkState = createThinkParserState();
3164
3044
  const renderWriter = createRenderAwareStreamWriter({
3165
3045
  write: (chunk) => options.output.write(chunk)
3166
3046
  });
3167
3047
  const writeVisibleAssistantChunk = (chunk) => {
3168
3048
  if (!chunk) return;
3049
+ const parsed = processThinkChunk(chunk, thinkState);
3050
+ thinkState = parsed.state;
3051
+ if (!parsed.content && !parsed.reasoning) return;
3052
+ if (parsed.reasoning) {
3053
+ spinner.setThinkingHint(parsed.reasoning);
3054
+ }
3055
+ if (!parsed.content) return;
3169
3056
  spinner.stop();
3170
3057
  options.activityReporter?.(null);
3171
3058
  if (!printedAssistantLabel) {
@@ -3175,17 +3062,8 @@ ${options.agentName} > `);
3175
3062
  }
3176
3063
  streamedAssistantText = true;
3177
3064
  everStreamedAnyText = true;
3178
- renderWriter.push(chunk);
3065
+ renderWriter.push(parsed.content);
3179
3066
  };
3180
- const thinkingFilter = createThinkingAwareStreamFilter(
3181
- writeVisibleAssistantChunk,
3182
- thinkingMode
3183
- );
3184
- const thinkingSink = createThinkingEventSink((chunk) => {
3185
- spinner.stop();
3186
- options.activityReporter?.(null);
3187
- options.output.write(chunk);
3188
- }, thinkingMode);
3189
3067
  const handleToolEvent = (event) => {
3190
3068
  if (!traceLocalTools) return;
3191
3069
  const chunk = eventMode === "jsonl" ? formatToolJsonEvent(event) : formatToolEvent(event);
@@ -3194,7 +3072,6 @@ ${options.agentName} > `);
3194
3072
  return;
3195
3073
  }
3196
3074
  if (event.type === "tool-call") {
3197
- thinkingFilter.flush();
3198
3075
  renderWriter.flush();
3199
3076
  }
3200
3077
  spinner.stop();
@@ -3220,15 +3097,14 @@ ${options.agentName} > `);
3220
3097
  };
3221
3098
  return {
3222
3099
  spinner,
3223
- thinkingMode,
3224
3100
  toolDisplayMode,
3225
3101
  traceLocalTools,
3226
3102
  eventMode,
3227
3103
  pushText(chunk) {
3228
- thinkingFilter.push(chunk);
3104
+ writeVisibleAssistantChunk(chunk);
3229
3105
  },
3230
3106
  pushThinking(chunk) {
3231
- thinkingSink.push(chunk);
3107
+ spinner.setThinkingHint(chunk);
3232
3108
  },
3233
3109
  handleToolEvent,
3234
3110
  showWorking(label) {
@@ -3239,19 +3115,22 @@ ${options.agentName} > `);
3239
3115
  finish(fallbackContent) {
3240
3116
  spinner.stop();
3241
3117
  options.activityReporter?.(null);
3118
+ const flushedThink = flushThinkParser(thinkState);
3119
+ thinkState = flushedThink.state;
3120
+ if (flushedThink.content) {
3121
+ writeVisibleAssistantChunk(flushedThink.content);
3122
+ }
3242
3123
  const pendingToolOutput = formatToolEvent.flush ? formatToolEvent.flush() : "";
3243
3124
  if (pendingToolOutput) {
3244
3125
  options.output.write(pendingToolOutput);
3245
3126
  }
3246
3127
  if (streamedAssistantText) {
3247
- thinkingFilter.flush();
3248
3128
  renderWriter.flush();
3249
3129
  options.output.write("\n");
3250
3130
  } else if (everStreamedAnyText) {
3251
- thinkingFilter.flush();
3252
3131
  options.output.write("\n");
3253
3132
  } else {
3254
- const content = fallbackContent ? formatAssistantResponseForCli(fallbackContent.trim(), options) : "";
3133
+ const content = fallbackContent ? formatAssistantResponseForCli(fallbackContent.trim()) : "";
3255
3134
  if (content) {
3256
3135
  options.output.write(`
3257
3136
  ${options.agentName} > ${content}
@@ -3671,7 +3550,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
3671
3550
  // packages/cli/client/agentRun.ts
3672
3551
  import { ulid } from "ulid";
3673
3552
  async function loadRunLocalAgentTurn() {
3674
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-BONMVACL.js");
3553
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-4YCF6IRF.js");
3675
3554
  return runLocalAgentTurn;
3676
3555
  }
3677
3556
  async function resolveCurrentMachineId(options) {
@@ -4038,8 +3917,7 @@ async function runHttpAgentTurn(options, authToken) {
4038
3917
  return dialogIdText ? { exitCode: 1, dialogId: dialogIdText } : { exitCode: 1 };
4039
3918
  }
4040
3919
  const content = formatAssistantResponseForCli(
4041
- String(data?.content ?? data?.message ?? ""),
4042
- options
3920
+ String(data?.content ?? data?.message ?? "")
4043
3921
  );
4044
3922
  if (content) {
4045
3923
  options.output.write(`
@@ -4108,7 +3986,7 @@ async function runLocalAgentTurnForCli(options, settings) {
4108
3986
  } : void 0;
4109
3987
  const currentDialogId = options.continueDialogId ?? ulid();
4110
3988
  const runChildTurn = async (input) => {
4111
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-BONMVACL.js");
3989
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-4YCF6IRF.js");
4112
3990
  return runLocalAgentTurn(input);
4113
3991
  };
4114
3992
  const createFreshChildBaseAdapter = () => {
@@ -5462,7 +5340,6 @@ export {
5462
5340
  themeColorSequence,
5463
5341
  themeText,
5464
5342
  formatAssistantDisplay,
5465
- normalizeThinkingDisplayMode,
5466
5343
  normalizeToolDisplayMode,
5467
5344
  COLLAPSED_PASTE_PLACEHOLDER_RE,
5468
5345
  shouldCollapsePaste,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  patch,
3
3
  read
4
- } from "./chunk-A5V7UEZJ.js";
4
+ } from "./chunk-SFXYKGK2.js";
5
5
  import {
6
6
  DEVICE_LOCAL_OWNER_ID,
7
7
  isDeviceLocalSpaceBody,