nolo-cli 0.14.0 → 0.16.0-alpha.1

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 (100) hide show
  1. package/{_executeModel-TURRLTZ2.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-AZDVM4HQ.js → agentDeleteCommand-365DMKHW.js} +20 -20
  6. package/{agentEmailCommands-M4AHOEZ3.js → agentEmailCommands-TQMXL36I.js} +38 -38
  7. package/{agentGrantCommands-B4MB23VQ.js → agentGrantCommands-JNDE4RWR.js} +2 -2
  8. package/{agentListCommands-OJLOXSKL.js → agentListCommands-6B5X4RC6.js} +22 -22
  9. package/{agentMachineCommands-NPMM4Z53.js → agentMachineCommands-LOEARB6V.js} +20 -20
  10. package/{agentPullCommand-KRBRIFIY.js → agentPullCommand-6HWUT3SW.js} +2 -2
  11. package/{agentRecordCommands-RVUH7XLZ.js → agentRecordCommands-DCH2WBL2.js} +33 -33
  12. package/{agentRunCommand-F6W2WKKZ.js → agentRunCommand-SGMH67WT.js} +35 -35
  13. package/{agentRunControl-IX4F5W2C.js → agentRunControl-6ADXVYMR.js} +2 -2
  14. package/{agentRuntimeLocal-DSUBT77I.js → agentRuntimeLocal-YSYZ33ER.js} +11 -11
  15. package/{agentSlice-PCEL26Z7.js → agentSlice-IVE735EV.js} +3 -3
  16. package/appDeleteCommands-6QYOO3JB.js +124 -0
  17. package/appDeployCommands-WTCT6XO6.js +163 -0
  18. package/appDeployStatusCommands-CGWGZJKB.js +144 -0
  19. package/appGetCommands-O4OCAMRW.js +119 -0
  20. package/appListCommands-UENFP4XY.js +122 -0
  21. package/{authCommand-66ME4KZX.js → authCommand-YFTR3347.js} +5 -5
  22. package/{authCommands-GH5T6RYV.js → authCommands-YXGOXNBZ.js} +3 -3
  23. package/{chunk-3B2LFO6R.js → browser-image-compression-MFDTD7K6.js} +4 -518
  24. package/{chunk-5R73BS7Y.js → chunk-4NLUNENX.js} +5 -5
  25. package/chunk-4QQFLN5C.js +552 -0
  26. package/{chunk-LNSRTNH7.js → chunk-6565R2TI.js} +20 -16
  27. package/{chunk-VQFY3VXW.js → chunk-6MHDWKOT.js} +3 -2
  28. package/{chunk-5NBHQD4D.js → chunk-A7GB5UGH.js} +1 -1
  29. package/{chunk-MYE5X27Y.js → chunk-BFRVXJJJ.js} +43 -16
  30. package/{chunk-XIDYAII4.js → chunk-E237VE6U.js} +7 -140
  31. package/{chunk-IYGQF62W.js → chunk-EMXI3N3Z.js} +3 -3
  32. package/{chunk-PYAJ6ZSK.js → chunk-G2MKOQCB.js} +1 -1
  33. package/chunk-GFUIQ4RY.js +136 -0
  34. package/{chunk-RZALKBP4.js → chunk-GRTFNYLR.js} +2 -2
  35. package/{chunk-KTFJUPDW.js → chunk-HRQCKQA5.js} +31 -31
  36. package/chunk-I66RU7P7.js +107 -0
  37. package/{chunk-OIMX7MM4.js → chunk-ISYE6GZB.js} +1 -1
  38. package/{chunk-4UUJFFMK.js → chunk-J55UHASN.js} +1 -1
  39. package/{chunk-V6VXDXGY.js → chunk-JS33TCQ3.js} +2 -2
  40. package/{chunk-7JJCGV7N.js → chunk-K6EUAOW3.js} +1 -1
  41. package/{chunk-OHEKYYJF.js → chunk-KMQPSTMJ.js} +6 -6
  42. package/{chunk-3WGLLTK4.js → chunk-LSFAWXKC.js} +100 -3
  43. package/{chunk-4ON5AV72.js → chunk-MYMMNKYL.js} +1 -1
  44. package/{chunk-BHK5ZAW7.js → chunk-N5424GSW.js} +1 -1
  45. package/{chunk-7LAIOHOL.js → chunk-O53CP2QR.js} +3 -3
  46. package/{chunk-IMZ7AFIJ.js → chunk-OQMPU2ML.js} +4 -4
  47. package/{chunk-NZFWHBW5.js → chunk-QLFCNUVQ.js} +496 -442
  48. package/{chunk-TQCONXQ3.js → chunk-QZVGMD5F.js} +1 -1
  49. package/{chunk-UW3WOIWJ.js → chunk-RKM3K52F.js} +1 -1
  50. package/{chunk-TLNEQI2R.js → chunk-RSYUDGGZ.js} +9 -9
  51. package/{chunk-A5V7UEZJ.js → chunk-SFXYKGK2.js} +3 -3
  52. package/{chunk-S5UACFUP.js → chunk-TTGAVETO.js} +10 -2
  53. package/{chunk-BOJVWKNA.js → chunk-U7LEGLEB.js} +1 -1
  54. package/{chunk-R5AOLZZV.js → chunk-VE6XMVKG.js} +203 -45
  55. package/{chunk-NJVPXLRY.js → chunk-VPTJB4HM.js} +1 -1
  56. package/{chunk-PB2DHBEQ.js → chunk-WA6KZL5V.js} +25 -6
  57. package/{chunk-T3X232L6.js → chunk-WNLPAOIT.js} +1 -1
  58. package/{chunk-E6KIDMTW.js → chunk-WPN6RMDF.js} +9 -9
  59. package/{chunk-NFPO7274.js → chunk-WRN5EQT7.js} +1 -1
  60. package/{chunk-3FCSMQAC.js → chunk-XVP3C2KY.js} +1 -1
  61. package/{chunk-33K5FKRL.js → chunk-YC3DJILJ.js} +111 -40
  62. package/{chunk-TYRTLSGX.js → chunk-YNHQIXX5.js} +833 -5746
  63. package/{chunk-4F4FJPFM.js → chunk-YYIRR6QC.js} +98 -209
  64. package/{chunk-7TN6V43T.js → chunk-Z24FGIU2.js} +2 -2
  65. package/{cliEnvHelpers-VYC2OPTB.js → cliEnvHelpers-ZXNMX7VV.js} +1 -1
  66. package/{createAgentAutomationAction-VLNDOHSP.js → createAgentAutomationAction-TS6NNZ4X.js} +9 -9
  67. package/{createDialogAction-6WYTS62Z.js → createDialogAction-5HVQ33EX.js} +10 -10
  68. package/{createPageAction-YKHOC3LW.js → createPageAction-4F3ZGQJD.js} +9 -9
  69. package/{dbSlice-7Q23HSWH.js → dbSlice-OP6UPXKA.js} +2 -2
  70. package/{dialogCommands-BQDGLVMO.js → dialogCommands-ZL6L24BS.js} +16 -16
  71. package/{dialogSlice-2A2JOFZW.js → dialogSlice-FAWUQDJW.js} +9 -9
  72. package/{docCreateCommands-K2MPMXYF.js → docCreateCommands-LYROQTFH.js} +22 -20
  73. package/{docDeleteCommands-NBAARB77.js → docDeleteCommands-6TWGTZNR.js} +21 -19
  74. package/{docReadCommands-S3MO5RPS.js → docReadCommands-PRULNF26.js} +20 -18
  75. package/{docStore-JJP5PUR7.js → docStore-2UHVWLTV.js} +10 -10
  76. package/{docUpdateCommands-EHEI7FCE.js → docUpdateCommands-NNYYWJBI.js} +21 -19
  77. package/{handleSendMessageAction-UAXTF73I.js → handleSendMessageAction-LJPUYNOH.js} +15 -11
  78. package/index.js +109 -78
  79. package/{machineCommands-BQ46IS5M.js → machineCommands-JQPEQFSE.js} +36 -36
  80. package/{machineWsRunDispatch-R33NXNNI.js → machineWsRunDispatch-FFFNWVEW.js} +32 -32
  81. package/{memoryCommands-AFMES3LN.js → memoryCommands-EBMICQR6.js} +1 -1
  82. package/package.json +1 -1
  83. package/{read-SIWMJRHC.js → read-HXHAZBKH.js} +1 -1
  84. package/{readDocTool-TCYJY4PP.js → readDocTool-VPBDTO4G.js} +1 -1
  85. package/{readlineWorkspace-KBG4DKLX.js → readlineWorkspace-QSXHSBHA.js} +211 -105
  86. package/{removeDialogAgentAction-WKHZT6VJ.js → removeDialogAgentAction-HUFVN35S.js} +4 -4
  87. package/{runAgentClientLoop-MUV5YIRK.js → runAgentClientLoop-A75BUU6D.js} +19 -19
  88. package/{runtimeDoctorCommands-QNF3J3UV.js → runtimeDoctorCommands-THIHX2SY.js} +1 -1
  89. package/{setDialogExtraReferencesAction-GCI5QU6E.js → setDialogExtraReferencesAction-2VLGWQKG.js} +2 -2
  90. package/{setPrimaryDialogAgentAction-NRO57AS6.js → setPrimaryDialogAgentAction-VB4UV2CC.js} +4 -4
  91. package/{settingSlice-FTWZ5ZHT.js → settingSlice-7JYPQNAC.js} +3 -3
  92. package/{spaceCommands-4R63UST3.js → spaceCommands-4LE45GB7.js} +21 -21
  93. package/{spaceSlice-VTC3QXP3.js → spaceSlice-444MFUP6.js} +11 -9
  94. package/{streamAgentChatTurn-43N7BNV2.js → streamAgentChatTurn-DJAE7USZ.js} +42 -39
  95. package/{tableCommands-E4SQWDOX.js → tableCommands-3P7MJ3PF.js} +4 -4
  96. package/{tools-PX6PEJLE.js → tools-YB6LXSVN.js} +14 -14
  97. package/{tuiSummaryLlmCaller-2D65LKWM.js → tuiSummaryLlmCaller-QQL3JA5I.js} +3 -3
  98. package/{updateCommands-XZDOOYFH.js → updateCommands-XTW55TOT.js} +2 -2
  99. package/{updateDialogTitleAction-NPQZWAKG.js → updateDialogTitleAction-6HGFBM64.js} +9 -9
  100. package/{chunk-3QAF2LTL.js → chunk-DZ3XJVET.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-NZFWHBW5.js";
22
- import {
23
- CliProviderQuotaError
24
- } from "./chunk-CMKUBIGW.js";
21
+ } from "./chunk-QLFCNUVQ.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-5R73BS7Y.js";
28
+ } from "./chunk-4NLUNENX.js";
32
29
  import {
33
30
  normalizeAgentHandle
34
- } from "./chunk-TQCONXQ3.js";
31
+ } from "./chunk-QZVGMD5F.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-R5AOLZZV.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-7TN6V43T.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-TYRTLSGX.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-PB2DHBEQ.js";
73
+ } from "./chunk-WA6KZL5V.js";
77
74
  import {
78
75
  resolveAgentRuntimeConfigFromRecord
79
76
  } from "./chunk-OIQPORYI.js";
@@ -82,14 +79,20 @@ import {
82
79
  LOCAL_TURN_ABORTED_CODE,
83
80
  readActionGate,
84
81
  readCommandActionGatePayload
85
- } from "./chunk-VQFY3VXW.js";
82
+ } from "./chunk-6MHDWKOT.js";
86
83
  import {
84
+ createThinkParserState,
85
+ flushThinkParser,
86
+ processThinkChunk
87
+ } from "./chunk-LSFAWXKC.js";
88
+ import {
89
+ resolvePlatformAuthToken,
87
90
  resolvePlatformChatCompletionsEndpoint
88
- } from "./chunk-KTFJUPDW.js";
91
+ } from "./chunk-HRQCKQA5.js";
89
92
  import {
90
93
  DEFAULT_CONTEXT_WINDOW,
91
94
  getModelContextWindow
92
- } from "./chunk-3B2LFO6R.js";
95
+ } from "./chunk-4QQFLN5C.js";
93
96
  import {
94
97
  clipCompactText
95
98
  } from "./chunk-5MMAK75Q.js";
@@ -107,7 +110,10 @@ import {
107
110
  createRunActivityTracker,
108
111
  finalizeRunRecord,
109
112
  spawnLocalBackgroundRun
110
- } from "./chunk-4ON5AV72.js";
113
+ } from "./chunk-MYMMNKYL.js";
114
+ import {
115
+ CliProviderQuotaError
116
+ } from "./chunk-CMKUBIGW.js";
111
117
  import {
112
118
  toErrorMessage
113
119
  } from "./chunk-HNMXYYJR.js";
@@ -118,6 +124,9 @@ import {
118
124
  readPipeText,
119
125
  spawnProcess
120
126
  } from "./chunk-IDZTNRP2.js";
127
+ import {
128
+ resolveAuthToken
129
+ } from "./chunk-A7GB5UGH.js";
121
130
  import {
122
131
  parsePositiveFiniteNumberOrFallback
123
132
  } from "./chunk-Y5GCAMGP.js";
@@ -131,13 +140,10 @@ import {
131
140
  BUILTIN_NOLO_AGENT_KEY,
132
141
  PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
133
142
  PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
134
- } from "./chunk-NJVPXLRY.js";
143
+ } from "./chunk-VPTJB4HM.js";
135
144
  import {
136
145
  asTrimmedString
137
146
  } from "./chunk-3EUW3WEO.js";
138
- import {
139
- resolveAuthToken
140
- } from "./chunk-5NBHQD4D.js";
141
147
  import {
142
148
  isLoopbackUrl
143
149
  } from "./chunk-4SN6J65J.js";
@@ -992,6 +998,13 @@ function setActiveTerminalBaseHex(hex) {
992
998
  }
993
999
  activeTerminalBaseHex = readHexChannels(hex.replace(/^#/, "").toUpperCase()) ? hex.replace(/^#/, "").toUpperCase() : null;
994
1000
  }
1001
+ function applyDetectedBackground(detected) {
1002
+ const normalizedHex = detected.hex.replace(/^#/, "").toUpperCase();
1003
+ const changed = detected.brightness !== activeBrightness || normalizedHex !== activeTerminalBaseHex;
1004
+ setActiveBrightness(detected.brightness);
1005
+ setActiveTerminalBaseHex(detected.hex);
1006
+ return changed;
1007
+ }
995
1008
  function resolveTerminalBaseHex(brightness) {
996
1009
  return activeTerminalBaseHex ?? TERMINAL_BASE[brightness];
997
1010
  }
@@ -1596,165 +1609,25 @@ function createRenderAwareStreamWriter(args) {
1596
1609
  }
1597
1610
  };
1598
1611
  }
1599
-
1600
- // packages/cli/client/thinkingOutput.ts
1601
- var THINK_OPEN = /<think>/i;
1602
- var THINK_CLOSE = /<\/think>/i;
1603
- var COLLAPSED_MARKER = /^\s*▸ 思考已折叠\s*$/;
1604
- function normalizeThinkingDisplayMode(raw, fallback = "hide") {
1605
- const normalized = asTrimmedLowercaseString(raw);
1606
- if (normalized === "hide" || normalized === "off" || normalized === "false" || normalized === "0") {
1607
- return "hide";
1608
- }
1609
- if (normalized === "marker" || normalized === "collapsed" || normalized === "fold") {
1610
- return "marker";
1611
- }
1612
- if (normalized === "show" || normalized === "on" || normalized === "true" || normalized === "1") {
1613
- return "show";
1614
- }
1615
- return fallback;
1616
- }
1617
- function resolveThinkingDisplayMode(env = process.env) {
1618
- return normalizeThinkingDisplayMode(env.NOLO_CLI_THINKING ?? env.NOLO_THINKING, "hide");
1619
- }
1620
- function collapseThinkingBlocks(text, mode = "hide") {
1621
- if (mode === "show") return text;
1622
- const replacement = mode === "marker" ? "\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n" : "";
1623
- return text.replace(/<think>[\s\S]*?<\/think>\s*/gi, replacement).replace(/\n{3,}/g, "\n\n").trim();
1624
- }
1625
- function stripCollapsedThinkingMarkers(text) {
1626
- return text.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n").replace(/\n{2,}/g, "\n").trim();
1627
- }
1628
- function formatAssistantTextForCli(text, mode = "hide") {
1629
- const collapsed = collapseThinkingBlocks(text, mode);
1630
- return mode === "hide" ? stripCollapsedThinkingMarkers(collapsed) : collapsed;
1631
- }
1632
- function createThinkingEventSink(arg1, arg2) {
1633
- let mode = "hide";
1634
- let write = () => {
1635
- };
1636
- if (typeof arg1 === "function") {
1637
- write = arg1;
1638
- if (typeof arg2 === "string") {
1639
- mode = arg2;
1640
- }
1641
- } else {
1642
- mode = arg1;
1643
- if (typeof arg2 === "function") {
1644
- write = arg2;
1645
- }
1646
- }
1647
- if (mode === "hide") {
1648
- return {
1649
- push(_chunk) {
1650
- }
1651
- };
1652
- }
1653
- if (mode === "show") {
1654
- return {
1655
- push(chunk) {
1656
- if (chunk) write(chunk);
1657
- }
1658
- };
1659
- }
1660
- let markerEmitted = false;
1661
- return {
1662
- push(chunk) {
1663
- if (!chunk || markerEmitted) return;
1664
- write("\n\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n");
1665
- markerEmitted = true;
1666
- }
1667
- };
1612
+ function formatAssistantTextForCli(text) {
1613
+ return text.replace(/\u003cthink\u003e[\s\S]*?\u003c\/think\u003e\s*/gi, "").replace(/\n{3,}/g, "\n\n").trim();
1668
1614
  }
1669
- function createThinkingAwareStreamFilter(write, mode = "hide") {
1670
- if (mode === "show") {
1671
- return {
1672
- push(chunk) {
1673
- write(chunk);
1674
- },
1675
- flush() {
1676
- }
1677
- };
1615
+
1616
+ // packages/cli/client/formatReadPathTree.ts
1617
+ import { homedir as osHomedir } from "node:os";
1618
+
1619
+ // packages/core/foldHomePath.ts
1620
+ function foldHomePath(path, home) {
1621
+ if (!path) return path;
1622
+ if (home) {
1623
+ const cleanHome = home.endsWith("/") ? home.slice(0, -1) : home;
1624
+ if (path === cleanHome) return "~";
1625
+ if (path.startsWith(cleanHome + "/")) return `~${path.slice(cleanHome.length)}`;
1678
1626
  }
1679
- let pending = "";
1680
- let insideThink = false;
1681
- let markerEmitted = false;
1682
- const emit = (chunk) => {
1683
- if (chunk) write(chunk);
1684
- };
1685
- const emitMarker = () => {
1686
- if (mode !== "marker" || markerEmitted) return;
1687
- emit("\n\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n");
1688
- markerEmitted = true;
1689
- };
1690
- const consume = (input) => {
1691
- pending += input;
1692
- while (pending.length > 0) {
1693
- if (insideThink) {
1694
- const closeMatch = pending.match(THINK_CLOSE);
1695
- if (!closeMatch || closeMatch.index == null) {
1696
- emitMarker();
1697
- pending = "";
1698
- return;
1699
- }
1700
- emitMarker();
1701
- pending = pending.slice(closeMatch.index + closeMatch[0].length);
1702
- insideThink = false;
1703
- markerEmitted = false;
1704
- continue;
1705
- }
1706
- const openMatch = pending.match(THINK_OPEN);
1707
- if (!openMatch || openMatch.index == null) {
1708
- const nextMarker = pending.indexOf("<");
1709
- if (nextMarker === -1) {
1710
- const cleaned = mode === "hide" ? pending.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : pending;
1711
- emit(cleaned);
1712
- pending = "";
1713
- return;
1714
- }
1715
- if (nextMarker > 0) {
1716
- const head = pending.slice(0, nextMarker);
1717
- const cleaned = mode === "hide" ? head.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : head;
1718
- emit(cleaned);
1719
- pending = pending.slice(nextMarker);
1720
- continue;
1721
- }
1722
- if (pending.length < 7) return;
1723
- emit(pending[0]);
1724
- pending = pending.slice(1);
1725
- continue;
1726
- }
1727
- if (openMatch.index > 0) {
1728
- const head = pending.slice(0, openMatch.index);
1729
- const cleaned = mode === "hide" ? head.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : head;
1730
- emit(cleaned);
1731
- pending = pending.slice(openMatch.index);
1732
- continue;
1733
- }
1734
- pending = pending.slice(openMatch[0].length);
1735
- insideThink = true;
1736
- markerEmitted = false;
1737
- }
1738
- };
1739
- return {
1740
- push(chunk) {
1741
- consume(chunk);
1742
- },
1743
- flush() {
1744
- if (insideThink) emitMarker();
1745
- if (pending) {
1746
- const cleaned = mode === "hide" ? pending.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : pending;
1747
- emit(cleaned);
1748
- }
1749
- pending = "";
1750
- insideThink = false;
1751
- markerEmitted = false;
1752
- }
1753
- };
1627
+ return path.replace(/^(\/Users\/[^/]+|\/home\/[^/]+)(\/|$)/, "~$2");
1754
1628
  }
1755
1629
 
1756
1630
  // packages/cli/client/formatReadPathTree.ts
1757
- import { homedir as osHomedir } from "node:os";
1758
1631
  function clipPathAware(value, max = 72) {
1759
1632
  const compact = compactWhitespace(value);
1760
1633
  if (compact.length <= max) return compact;
@@ -1781,10 +1654,7 @@ function clipPathAware(value, max = 72) {
1781
1654
  function formatHomePath(path, customHomedir) {
1782
1655
  if (!path) return "";
1783
1656
  const home = customHomedir || (typeof process !== "undefined" ? process.env?.HOME : void 0) || (typeof osHomedir === "function" ? osHomedir() : "");
1784
- if (home && path.startsWith(home)) {
1785
- return `~${path.slice(home.length)}`;
1786
- }
1787
- return path.replace(/^(\/Users\/[^\/]+\/|\/home\/[^\/]+\/)/, "~/");
1657
+ return foldHomePath(path, home);
1788
1658
  }
1789
1659
  function formatReadItemPath(rawPath, metadata, customHomedir) {
1790
1660
  const inputPath = rawPath || (typeof metadata?.path === "string" ? metadata.path : void 0) || (typeof metadata?.filePath === "string" ? metadata.filePath : void 0) || "file";
@@ -3047,6 +2917,11 @@ function formatElapsed(totalSeconds) {
3047
2917
  const mins = minutes % 60;
3048
2918
  return `${hours}h ${mins}m`;
3049
2919
  }
2920
+ function truncateThinkingHint(text, maxLen) {
2921
+ const cleaned = text.replace(/\n/g, " ").trim();
2922
+ if (cleaned.length <= maxLen) return cleaned;
2923
+ return "\u2026" + cleaned.slice(cleaned.length - maxLen + 1);
2924
+ }
3050
2925
  var Spinner = class {
3051
2926
  constructor(output, text, silent = false) {
3052
2927
  this.output = output;
@@ -3060,6 +2935,7 @@ var Spinner = class {
3060
2935
  frameIndex = 0;
3061
2936
  frames = ["\xB7", "~", "\u2248", "\u223F", "\u2248", "~"];
3062
2937
  isTTY;
2938
+ thinkingHint = "";
3063
2939
  start() {
3064
2940
  if (this.silent) {
3065
2941
  this.startTime = Date.now();
@@ -3095,9 +2971,11 @@ ${this.text}
3095
2971
  this.output.write("\r\x1B[K");
3096
2972
  this.output.write("\x1B[?25h");
3097
2973
  }
2974
+ this.thinkingHint = "";
3098
2975
  }
3099
2976
  show(text) {
3100
2977
  this.text = text;
2978
+ this.thinkingHint = "";
3101
2979
  if (this.silent) {
3102
2980
  if (!this.startTime) {
3103
2981
  this.startTime = Date.now();
@@ -3113,20 +2991,30 @@ ${this.text}
3113
2991
  this.startTime = Date.now();
3114
2992
  this.output.write(`\r${this.renderLine(this.frames[0])}`);
3115
2993
  }
2994
+ /**
2995
+ * Update the thinking hint displayed on the spinner line. The hint is
2996
+ * truncated to a reasonable length and shown as part of the spinner text.
2997
+ * Only meaningful while the spinner is active (TTY mode).
2998
+ */
2999
+ setThinkingHint(text) {
3000
+ this.thinkingHint = text;
3001
+ if (this.silent || !this.isTTY || !this.timer) return;
3002
+ this.output.write(`\r${this.renderLine(this.frames[this.frameIndex])}`);
3003
+ }
3116
3004
  renderLine(frame) {
3117
3005
  const elapsedSeconds = Math.max(
3118
3006
  0,
3119
3007
  Math.floor((Date.now() - this.startTime) / 1e3)
3120
3008
  );
3121
- return `${themeColorSequence("accent")}${frame}\x1B[39m ${this.text} (${formatElapsed(elapsedSeconds)})`;
3009
+ const thinkingPart = this.thinkingHint ? `: ${truncateThinkingHint(this.thinkingHint, 60)}` : "";
3010
+ return `${themeColorSequence("accent")}${frame}\x1B[39m ${this.text}${thinkingPart} (${formatElapsed(elapsedSeconds)})`;
3122
3011
  }
3123
3012
  };
3124
3013
 
3125
3014
  // packages/cli/client/agentRunOutput.ts
3126
- function formatAssistantResponseForCli(text, options) {
3127
- const thinkingMode = resolveThinkingDisplayMode(options.env);
3015
+ function formatAssistantResponseForCli(text) {
3128
3016
  return formatAssistantDisplay(
3129
- formatAssistantTextForCli(text, thinkingMode)
3017
+ formatAssistantTextForCli(text)
3130
3018
  );
3131
3019
  }
3132
3020
  function resolveAgentEventMode(options) {
@@ -3159,12 +3047,19 @@ function createCliTurnOutput(params) {
3159
3047
  let streamedAssistantText = false;
3160
3048
  let everStreamedAnyText = false;
3161
3049
  let printedAssistantLabel = false;
3162
- const thinkingMode = resolveThinkingDisplayMode(options.env);
3050
+ let thinkState = createThinkParserState();
3163
3051
  const renderWriter = createRenderAwareStreamWriter({
3164
3052
  write: (chunk) => options.output.write(chunk)
3165
3053
  });
3166
3054
  const writeVisibleAssistantChunk = (chunk) => {
3167
3055
  if (!chunk) return;
3056
+ const parsed = processThinkChunk(chunk, thinkState);
3057
+ thinkState = parsed.state;
3058
+ if (!parsed.content && !parsed.reasoning) return;
3059
+ if (parsed.reasoning) {
3060
+ spinner.setThinkingHint(parsed.reasoning);
3061
+ }
3062
+ if (!parsed.content) return;
3168
3063
  spinner.stop();
3169
3064
  options.activityReporter?.(null);
3170
3065
  if (!printedAssistantLabel) {
@@ -3174,17 +3069,8 @@ ${options.agentName} > `);
3174
3069
  }
3175
3070
  streamedAssistantText = true;
3176
3071
  everStreamedAnyText = true;
3177
- renderWriter.push(chunk);
3072
+ renderWriter.push(parsed.content);
3178
3073
  };
3179
- const thinkingFilter = createThinkingAwareStreamFilter(
3180
- writeVisibleAssistantChunk,
3181
- thinkingMode
3182
- );
3183
- const thinkingSink = createThinkingEventSink((chunk) => {
3184
- spinner.stop();
3185
- options.activityReporter?.(null);
3186
- options.output.write(chunk);
3187
- }, thinkingMode);
3188
3074
  const handleToolEvent = (event) => {
3189
3075
  if (!traceLocalTools) return;
3190
3076
  const chunk = eventMode === "jsonl" ? formatToolJsonEvent(event) : formatToolEvent(event);
@@ -3193,7 +3079,6 @@ ${options.agentName} > `);
3193
3079
  return;
3194
3080
  }
3195
3081
  if (event.type === "tool-call") {
3196
- thinkingFilter.flush();
3197
3082
  renderWriter.flush();
3198
3083
  }
3199
3084
  spinner.stop();
@@ -3210,7 +3095,7 @@ ${options.agentName} > `);
3210
3095
  spinner.show(activeLabel);
3211
3096
  options.activityReporter?.(activeLabel);
3212
3097
  }
3213
- if (event.type === "tool-result" && options.onAgentRunStatus && (event.toolName === "startAgentRun" || event.toolName === "controlAgentRun")) {
3098
+ if (event.type === "tool-result" && options.onAgentRunStatus && event.toolName === "startAgentRun") {
3214
3099
  const snapshot = extractAgentRunStatusSnapshot(event);
3215
3100
  if (snapshot) {
3216
3101
  options.onAgentRunStatus(snapshot);
@@ -3219,15 +3104,14 @@ ${options.agentName} > `);
3219
3104
  };
3220
3105
  return {
3221
3106
  spinner,
3222
- thinkingMode,
3223
3107
  toolDisplayMode,
3224
3108
  traceLocalTools,
3225
3109
  eventMode,
3226
3110
  pushText(chunk) {
3227
- thinkingFilter.push(chunk);
3111
+ writeVisibleAssistantChunk(chunk);
3228
3112
  },
3229
3113
  pushThinking(chunk) {
3230
- thinkingSink.push(chunk);
3114
+ spinner.setThinkingHint(chunk);
3231
3115
  },
3232
3116
  handleToolEvent,
3233
3117
  showWorking(label) {
@@ -3238,19 +3122,22 @@ ${options.agentName} > `);
3238
3122
  finish(fallbackContent) {
3239
3123
  spinner.stop();
3240
3124
  options.activityReporter?.(null);
3125
+ const flushedThink = flushThinkParser(thinkState);
3126
+ thinkState = flushedThink.state;
3127
+ if (flushedThink.content) {
3128
+ writeVisibleAssistantChunk(flushedThink.content);
3129
+ }
3241
3130
  const pendingToolOutput = formatToolEvent.flush ? formatToolEvent.flush() : "";
3242
3131
  if (pendingToolOutput) {
3243
3132
  options.output.write(pendingToolOutput);
3244
3133
  }
3245
3134
  if (streamedAssistantText) {
3246
- thinkingFilter.flush();
3247
3135
  renderWriter.flush();
3248
3136
  options.output.write("\n");
3249
3137
  } else if (everStreamedAnyText) {
3250
- thinkingFilter.flush();
3251
3138
  options.output.write("\n");
3252
3139
  } else {
3253
- const content = fallbackContent ? formatAssistantResponseForCli(fallbackContent.trim(), options) : "";
3140
+ const content = fallbackContent ? formatAssistantResponseForCli(fallbackContent.trim()) : "";
3254
3141
  if (content) {
3255
3142
  options.output.write(`
3256
3143
  ${options.agentName} > ${content}
@@ -3422,7 +3309,7 @@ async function readStreamingAgentRun(options, res, existingSpinner) {
3422
3309
 
3423
3310
  // packages/cli/client/agentRunTypes.ts
3424
3311
  function resolveAuthToken2(env) {
3425
- return env.AUTH_TOKEN || env.AUTH || env.BENCHMARK_AUTH_TOKEN || "";
3312
+ return resolvePlatformAuthToken(env);
3426
3313
  }
3427
3314
  function isMachineBoundLocalhostCustomProvider(agentConfig) {
3428
3315
  const machineId = agentConfig?.runtimeBinding && typeof agentConfig.runtimeBinding === "object" ? String(agentConfig.runtimeBinding.machineId ?? "").trim() : "";
@@ -3670,7 +3557,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
3670
3557
  // packages/cli/client/agentRun.ts
3671
3558
  import { ulid } from "ulid";
3672
3559
  async function loadRunLocalAgentTurn() {
3673
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-DSUBT77I.js");
3560
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-YSYZ33ER.js");
3674
3561
  return runLocalAgentTurn;
3675
3562
  }
3676
3563
  async function resolveCurrentMachineId(options) {
@@ -4037,8 +3924,7 @@ async function runHttpAgentTurn(options, authToken) {
4037
3924
  return dialogIdText ? { exitCode: 1, dialogId: dialogIdText } : { exitCode: 1 };
4038
3925
  }
4039
3926
  const content = formatAssistantResponseForCli(
4040
- String(data?.content ?? data?.message ?? ""),
4041
- options
3927
+ String(data?.content ?? data?.message ?? "")
4042
3928
  );
4043
3929
  if (content) {
4044
3930
  options.output.write(`
@@ -4107,7 +3993,7 @@ async function runLocalAgentTurnForCli(options, settings) {
4107
3993
  } : void 0;
4108
3994
  const currentDialogId = options.continueDialogId ?? ulid();
4109
3995
  const runChildTurn = async (input) => {
4110
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-DSUBT77I.js");
3996
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-YSYZ33ER.js");
4111
3997
  return runLocalAgentTurn(input);
4112
3998
  };
4113
3999
  const createFreshChildBaseAdapter = () => {
@@ -4219,6 +4105,7 @@ async function runLocalAgentTurnForCli(options, settings) {
4219
4105
  return {
4220
4106
  exitCode: 0,
4221
4107
  dialogId: result.dialogId,
4108
+ title: result.title,
4222
4109
  turnTokens: buildTurnTokenUsage(result.usage, result.model)
4223
4110
  };
4224
4111
  } catch (error) {
@@ -4262,6 +4149,7 @@ async function runAgentTurn(options) {
4262
4149
  return {
4263
4150
  exitCode: localResult.exitCode,
4264
4151
  ...localResult.dialogId ? { dialogId: localResult.dialogId } : {},
4152
+ title: localResult.title,
4265
4153
  ...localResult.turnTokens ? { turnTokens: localResult.turnTokens } : {},
4266
4154
  ...localResult.streamInterrupted ? { streamInterrupted: localResult.streamInterrupted } : {},
4267
4155
  ...localResult.pendingToolName ? { pendingToolName: localResult.pendingToolName } : {}
@@ -4282,6 +4170,7 @@ async function runAgentTurn(options) {
4282
4170
  return {
4283
4171
  exitCode: retriedLocalResult.exitCode,
4284
4172
  ...retriedLocalResult.dialogId ? { dialogId: retriedLocalResult.dialogId } : {},
4173
+ title: retriedLocalResult.title,
4285
4174
  ...retriedLocalResult.turnTokens ? { turnTokens: retriedLocalResult.turnTokens } : {}
4286
4175
  };
4287
4176
  }
@@ -5454,11 +5343,11 @@ export {
5454
5343
  setActiveDensity,
5455
5344
  resolveTuiBrightness,
5456
5345
  setActiveTerminalBaseHex,
5346
+ applyDetectedBackground,
5457
5347
  surfaceBackgroundSequence,
5458
5348
  themeColorSequence,
5459
5349
  themeText,
5460
5350
  formatAssistantDisplay,
5461
- normalizeThinkingDisplayMode,
5462
5351
  normalizeToolDisplayMode,
5463
5352
  COLLAPSED_PASTE_PLACEHOLDER_RE,
5464
5353
  shouldCollapsePaste,
@@ -3,7 +3,7 @@ import {
3
3
  prepareAndPersistMessage,
4
4
  uiAskChoiceFunc,
5
5
  uiAskChoiceFunctionSchema
6
- } from "./chunk-TYRTLSGX.js";
6
+ } from "./chunk-YNHQIXX5.js";
7
7
  import {
8
8
  require_date_fns
9
9
  } from "./chunk-M76ECQRD.js";
@@ -21,7 +21,7 @@ import {
21
21
  removeCachedEntity,
22
22
  upsertSSREntity,
23
23
  write
24
- } from "./chunk-A5V7UEZJ.js";
24
+ } from "./chunk-SFXYKGK2.js";
25
25
  import {
26
26
  createAgentKey,
27
27
  createDialogKey,
@@ -9,7 +9,7 @@ import {
9
9
  resolveServerCandidates,
10
10
  resolveServerUrl,
11
11
  resolveServerUrlFromEnv
12
- } from "./chunk-5NBHQD4D.js";
12
+ } from "./chunk-A7GB5UGH.js";
13
13
  import "./chunk-OLZBQWZU.js";
14
14
  import "./chunk-LCBAMY2M.js";
15
15
  import "./chunk-4SN6J65J.js";
@@ -1,15 +1,16 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-TYRTLSGX.js";
3
+ } from "./chunk-YNHQIXX5.js";
4
4
  import "./chunk-V2J635L5.js";
5
5
  import "./chunk-MRC4Q34M.js";
6
6
  import "./chunk-MTU75CZ2.js";
7
7
  import "./chunk-CWMSB67P.js";
8
- import "./chunk-IMZ7AFIJ.js";
9
- import "./chunk-V6VXDXGY.js";
8
+ import "./chunk-OQMPU2ML.js";
9
+ import "./chunk-JS33TCQ3.js";
10
+ import "./chunk-SOTZ6RDN.js";
10
11
  import "./chunk-Z4NR32XR.js";
11
12
  import "./chunk-M76ECQRD.js";
12
- import "./chunk-3B2LFO6R.js";
13
+ import "./chunk-4QQFLN5C.js";
13
14
  import "./chunk-5MMAK75Q.js";
14
15
  import "./chunk-OGGHETUE.js";
15
16
  import "./chunk-5CS33IBL.js";
@@ -19,16 +20,15 @@ import "./chunk-DFFIZ25G.js";
19
20
  import "./chunk-3ASDTTEI.js";
20
21
  import "./chunk-DWLEOOGR.js";
21
22
  import "./chunk-HNMXYYJR.js";
22
- import "./chunk-SOTZ6RDN.js";
23
23
  import "./chunk-IKXL2HZ3.js";
24
24
  import "./chunk-524BDL33.js";
25
- import "./chunk-S5UACFUP.js";
25
+ import "./chunk-TTGAVETO.js";
26
26
  import "./chunk-Y5GCAMGP.js";
27
27
  import "./chunk-KX6YBIHG.js";
28
- import "./chunk-3FCSMQAC.js";
28
+ import "./chunk-XVP3C2KY.js";
29
29
  import {
30
30
  write
31
- } from "./chunk-A5V7UEZJ.js";
31
+ } from "./chunk-SFXYKGK2.js";
32
32
  import {
33
33
  buildAgentAutomationOwnerIndexValue,
34
34
  createAgentAutomationKey,
@@ -38,7 +38,7 @@ import "./chunk-I42VC5KR.js";
38
38
  import "./chunk-WWC7I6TA.js";
39
39
  import "./chunk-JTINRTBT.js";
40
40
  import "./chunk-QSJ3HFEF.js";
41
- import "./chunk-NJVPXLRY.js";
41
+ import "./chunk-VPTJB4HM.js";
42
42
  import {
43
43
  selectIdentityUserId
44
44
  } from "./chunk-DVRHHFEA.js";