nolo-cli 0.16.0 → 0.18.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.
- package/{_executeModel-AVCA2NAV.js → _executeModel-X5PCIZN6.js} +50 -44
- package/{action-F5JACQBG.js → action-LT7BRFLK.js} +10 -9
- package/{addContentAction-AQXEYRBE.js → addContentAction-PL3KKBDH.js} +9 -8
- package/{addDialogAgentAction-EJHHJZWW.js → addDialogAgentAction-FCMSKYAF.js} +8 -7
- package/{agentDeleteCommand-QW5PUMDQ.js → agentDeleteCommand-2BZDQV36.js} +32 -29
- package/{agentEmailCommands-4ORVLGVQ.js → agentEmailCommands-2QJDGRMB.js} +62 -56
- package/{agentListCommands-YWBYRTYC.js → agentListCommands-6VEPTKBI.js} +31 -28
- package/{agentMachineCommands-JSQW4FOA.js → agentMachineCommands-NVVHNWYI.js} +30 -27
- package/{agentPullCommand-6HWUT3SW.js → agentPullCommand-ZZGU5KOY.js} +4 -4
- package/{agentRecordCommands-AASIWOBT.js → agentRecordCommands-4GGRDMD4.js} +57 -51
- package/{agentRunCommand-TB5BHXUH.js → agentRunCommand-XOLQNKBZ.js} +63 -54
- package/{agentRunControl-6ADXVYMR.js → agentRunControl-Y5AFH5PQ.js} +24 -1
- package/{agentRuntimeLocal-QNPNJRVH.js → agentRuntimeLocal-7WYWCGL4.js} +25 -22
- package/{agentSlice-RUNXC62Y.js → agentSlice-EAXPGEYV.js} +9 -8
- package/appDeleteCommands-77KR2RJ4.js +127 -0
- package/appDeployCommands-K7CAHGBI.js +166 -0
- package/appDeployStatusCommands-4OEKLTBT.js +147 -0
- package/appGetCommands-VM2WDLAZ.js +122 -0
- package/appListCommands-GX6BBA6U.js +125 -0
- package/{authCommand-YFTR3347.js → authCommand-DY6UUL6O.js} +16 -9
- package/{authCommands-YXGOXNBZ.js → authCommands-XTBV7OFZ.js} +6 -5
- package/{chunk-DPAB4FQ7.js → chunk-23FZYPLC.js} +1608 -212
- package/{chunk-LPEUV5RE.js → chunk-34WPV75U.js} +23 -2
- package/{chunk-XPC5C7BK.js → chunk-3ND52WIL.js} +2 -2
- package/{chunk-SOTZ6RDN.js → chunk-3Q7WHGCB.js} +1 -1
- package/{chunk-3OIRVWXA.js → chunk-3ZX7PERL.js} +10 -1
- package/{chunk-KKY4B2Q2.js → chunk-4PWB7JRR.js} +4 -1
- package/{chunk-6N4KODMN.js → chunk-4T5F7YZQ.js} +1 -1
- package/chunk-7BUYEZ6U.js +671 -0
- package/{chunk-AS3ZQ3O2.js → chunk-7OBMZCRD.js} +1 -1
- package/{chunk-IGXREZW2.js → chunk-AHCY2S2I.js} +1 -1
- package/{chunk-QLUFR47U.js → chunk-AL2V7U3E.js} +1 -1
- package/{chunk-MTU75CZ2.js → chunk-B5TOXZAK.js} +1 -1
- package/{chunk-AUURUT6L.js → chunk-BV4VEE3W.js} +264 -424
- package/{chunk-FRV6A633.js → chunk-CZ6NYQTV.js} +13 -4
- package/{chunk-PCTUYVUM.js → chunk-DFCFMCY6.js} +10 -3
- package/{chunk-JTMNCCWF.js → chunk-DKZFOK24.js} +16 -87
- package/chunk-DL6EPNIK.js +50 -0
- package/{chunk-ZQBL7LIC.js → chunk-EDV7EBOI.js} +317 -216
- package/{chunk-IWLUTMYX.js → chunk-ELT65PZW.js} +2 -2
- package/chunk-FQZZLA3C.js +223 -0
- package/{chunk-55NSNCFM.js → chunk-FXUSIQC2.js} +1 -1
- package/{chunk-MR6ISAGB.js → chunk-G5U6LDLG.js} +6 -6
- package/chunk-GFUIQ4RY.js +136 -0
- package/{chunk-NVEWUJVX.js → chunk-HEGV7BH3.js} +1 -1
- package/{chunk-BEBNFWDU.js → chunk-HWW2M4SN.js} +3 -3
- package/{chunk-4L2OJPCU.js → chunk-I2ZJKTG5.js} +58 -8
- package/{chunk-Z5JQNBNY.js → chunk-IYEXFJPC.js} +34 -15
- package/{setDialogExtraReferencesAction-LR6MSIXO.js → chunk-JLA4FXYC.js} +2 -17
- package/chunk-KFEVY3ST.js +255 -0
- package/{chunk-4FX6NVDW.js → chunk-L4F3I4SR.js} +3 -136
- package/{chunk-XBS2WYJ2.js → chunk-LLWKHDG4.js} +1 -1
- package/{chunk-3WGLLTK4.js → chunk-LSFAWXKC.js} +100 -3
- package/{chunk-6EVITP2G.js → chunk-MHSGJW4Z.js} +2 -251
- package/{chunk-O6W2O2DA.js → chunk-MKA6QE5E.js} +6 -2
- package/{chunk-DGEYDWEZ.js → chunk-MPVYDS7I.js} +3 -3
- package/{chunk-KFHN5NGJ.js → chunk-MVQ4TBSD.js} +1 -1
- package/{chunk-AVVZUXXC.js → chunk-N54HIJVJ.js} +34 -13
- package/{chunk-EHLHSX7R.js → chunk-OK6YSWLH.js} +9 -2
- package/{chunk-33BJUVK4.js → chunk-PIZYJVHQ.js} +5 -5
- package/{chunk-RLCXU7A5.js → chunk-PJSV3IZ5.js} +1 -1
- package/{chunk-7UKFVQ5W.js → chunk-R35XMF6F.js} +126 -41
- package/{chunk-OOSFSFMA.js → chunk-R5V5G73M.js} +2 -0
- package/{chunk-S2LXHNHG.js → chunk-REA4JLBH.js} +6 -6
- package/chunk-RQN4SEKL.js +107 -0
- package/{chunk-EABWT43X.js → chunk-RVOUXDFU.js} +5 -5
- package/{chunk-NSCHQQPU.js → chunk-SCTYAHYK.js} +470 -325
- package/{chunk-JTINRTBT.js → chunk-SKDNBYZK.js} +2 -2
- package/{chunk-M43KDE25.js → chunk-SWDPIPOY.js} +2 -8
- package/{chunk-KMQPSTMJ.js → chunk-TRT4I4UD.js} +2 -2
- package/{chunk-66X4VSRC.js → chunk-UAIVG4J6.js} +42 -2
- package/{chunk-3663CXZN.js → chunk-UBHAWFQ6.js} +143 -31
- package/{chunk-YJKXGHJ6.js → chunk-UGUW3FHG.js} +4 -4
- package/{chunk-P3RIAYGG.js → chunk-V3ED5AWK.js} +3 -3
- package/chunk-V5R4NZP2.js +78 -0
- package/{chunk-4IJYA27C.js → chunk-VDXCXCXH.js} +1 -1
- package/{chunk-MYMMNKYL.js → chunk-VNAEBGDK.js} +156 -6
- package/{chunk-FY233ZFU.js → chunk-VYHDJEQD.js} +110 -192
- package/{chunk-W4NVOSFF.js → chunk-WFHXMLHZ.js} +1 -1
- package/{chunk-H33743XH.js → chunk-WJRJDX2W.js} +1 -1
- package/chunk-X4Q4UZEY.js +26 -0
- package/{chunk-RPDGJO4D.js → chunk-XHG22OEX.js} +4 -4
- package/{chunk-DVRHHFEA.js → chunk-XMLRJUU5.js} +1 -1
- package/{chunk-3S2VOMIF.js → chunk-XRZJGPFI.js} +7 -7
- package/{chunk-GSINCD4P.js → chunk-YGW4G5W5.js} +25 -12
- package/chunk-ZZ2MH7LE.js +84 -0
- package/{cliExecutor-K3F7DMRO.js → cliExecutor-DNE7TCC4.js} +2 -2
- package/codingSkills-36KN5NQT.js +48 -0
- package/{createAgentAutomationAction-FNHPSKKO.js → createAgentAutomationAction-GNFF524X.js} +20 -19
- package/{createDialogAction-TZCVQ3NU.js → createDialogAction-RB55KCLO.js} +22 -21
- package/{createPageAction-EIGZ3BKT.js → createPageAction-Y7343GLU.js} +26 -25
- package/{db-HCJ5PRB5.js → db-W3O47YGF.js} +38 -12
- package/{dbSlice-7KQH6GOU.js → dbSlice-CGSRFJN3.js} +8 -7
- package/{deleteFile-WPWVZE4B.js → deleteFile-WDZ3VM7B.js} +3 -3
- package/{dialogCommands-FO77J5DQ.js → dialogCommands-IAZK6YHQ.js} +30 -27
- package/{dialogSlice-MM5U4KE2.js → dialogSlice-UQAXF23P.js} +20 -19
- package/{docCreateCommands-I3BS3AZI.js → docCreateCommands-I2EWZGCI.js} +33 -28
- package/{docDeleteCommands-Q2OPV52P.js → docDeleteCommands-IZ45UZKG.js} +32 -27
- package/{docReadCommands-YOOFACYZ.js → docReadCommands-R6Z4QJYU.js} +31 -26
- package/{docStore-NGYQ2JTR.js → docStore-5HOJ4D7D.js} +21 -20
- package/{docUpdateCommands-2B32ITHN.js → docUpdateCommands-2LRBKQPY.js} +32 -27
- package/{fetchMessages-KTNM7QAR.js → fetchMessages-BMGVZVSE.js} +4 -3
- package/{getPricing-P4XRJRZB.js → getPricing-G7DLAST6.js} +3 -3
- package/{handleSendMessageAction-JRZWWBKP.js → handleSendMessageAction-Q4HY35WX.js} +21 -20
- package/index.js +95 -64
- package/{localDialogRead-2VRI24F4.js → localDialogRead-4H3QJFLW.js} +2 -2
- package/{localRuntimeDb-LGDF6FQP.js → localRuntimeDb-THJZGAOJ.js} +1 -1
- package/{machineCommands-WRWF2ICZ.js → machineCommands-PKBPQKTY.js} +63 -57
- package/{machineWsRunDispatch-ZX7Q3TWZ.js → machineWsRunDispatch-UZAW4OXJ.js} +55 -49
- package/{models-WQ5N4OJM.js → models-DJFSJ7SW.js} +2 -2
- package/package.json +1 -1
- package/queryRunOverlay-O4LOMMPO.js +161 -0
- package/{read-CN3TNXIP.js → read-3FMPZPER.js} +3 -3
- package/{readDocTool-WF3675ED.js → readDocTool-VSYHKK3V.js} +1 -1
- package/{readlineWorkspace-ZTGRGW46.js → readlineWorkspace-Y2RDOFZG.js} +762 -218
- package/{removeDialogAgentAction-YDHBFEGI.js → removeDialogAgentAction-OAGA2G3U.js} +10 -9
- package/{runAgentClientLoop-JZCOP7LG.js → runAgentClientLoop-NBPIKJ6J.js} +44 -38
- package/runOverlayPresentation-ZO4VCWEU.js +11 -0
- package/{runtimeDoctorCommands-THIHX2SY.js → runtimeDoctorCommands-E2OUORHK.js} +6 -6
- package/setDialogExtraReferencesAction-JZEXA5SL.js +27 -0
- package/{setPrimaryDialogAgentAction-IIVDCY5C.js → setPrimaryDialogAgentAction-4ZUQQKDG.js} +26 -17
- package/{settingSlice-O23YDK2O.js → settingSlice-7MNKHZ6R.js} +9 -8
- package/{skillDiscovery-6M2BZUFN.js → skillDiscovery-KJWT7JBU.js} +3 -3
- package/{spaceCommands-VV4GTPQK.js → spaceCommands-DHCZ7J5I.js} +31 -28
- package/{spaceSlice-DRWWZJP7.js → spaceSlice-ZXLLG3CR.js} +20 -19
- package/{streamAgentChatTurn-Y6WGATQR.js → streamAgentChatTurn-L3YW6LSB.js} +98 -57
- package/{tableCommands-3P7MJ3PF.js → tableCommands-BEQAGE4I.js} +1 -1
- package/{tools-PUNBY3AH.js → tools-ECGXR5QF.js} +33 -28
- package/{tuiSummaryLlmCaller-F64WLSAF.js → tuiSummaryLlmCaller-OMSCNHXA.js} +6 -5
- package/types-ZSTJ7MPR.js +7 -0
- package/{updateDialogTitleAction-YSR4TCMB.js → updateDialogTitleAction-HQ2EUDFT.js} +23 -22
- package/{chunk-O4BU24WZ.js → chunk-6Y7A3OQQ.js} +3 -3
- package/{chunk-CMKUBIGW.js → chunk-X7W4TNB4.js} +3 -3
- package/{localRuntimeAuthority-TEGCOWX4.js → localRuntimeAuthority-4IXJCHZ7.js} +3 -3
|
@@ -8,27 +8,24 @@ import {
|
|
|
8
8
|
writeUsage
|
|
9
9
|
} from "./chunk-DZ3XJVET.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
getReadableCliDb
|
|
12
|
+
} from "./chunk-WFHXMLHZ.js";
|
|
13
|
+
import {
|
|
14
|
+
normalizeAgentHandle,
|
|
15
|
+
readDbRecord,
|
|
16
|
+
resolveAgentRecordFromHybridStore
|
|
17
|
+
} from "./chunk-DFCFMCY6.js";
|
|
13
18
|
import {
|
|
14
19
|
agentRunCardLabels,
|
|
15
20
|
createCliCallAgentToolExecutor,
|
|
16
21
|
createCliLocalRuntimeAdapter,
|
|
17
22
|
getCliLocale,
|
|
18
23
|
isBuiltinNoloAgentRef,
|
|
24
|
+
isQuotaExhaustedError,
|
|
25
|
+
parseAgentRunEvent,
|
|
19
26
|
t,
|
|
20
27
|
toolLabel
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import {
|
|
23
|
-
getReadableCliDb
|
|
24
|
-
} from "./chunk-W4NVOSFF.js";
|
|
25
|
-
import {
|
|
26
|
-
readDbRecord,
|
|
27
|
-
resolveAgentRecordFromHybridStore
|
|
28
|
-
} from "./chunk-PCTUYVUM.js";
|
|
29
|
-
import {
|
|
30
|
-
normalizeAgentHandle
|
|
31
|
-
} from "./chunk-M43KDE25.js";
|
|
28
|
+
} from "./chunk-23FZYPLC.js";
|
|
32
29
|
import {
|
|
33
30
|
NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
34
31
|
isLocalCliAgentKey
|
|
@@ -38,41 +35,39 @@ import {
|
|
|
38
35
|
buildModelLayerOverride
|
|
39
36
|
} from "./chunk-LTRXGFMS.js";
|
|
40
37
|
import {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
formatStopRunCard,
|
|
47
|
-
isAgentNameFallback,
|
|
48
|
-
isAgentRunTerminalStatus,
|
|
49
|
-
resolveRunLabel
|
|
50
|
-
} from "./chunk-ZQBL7LIC.js";
|
|
38
|
+
resolveMachineId
|
|
39
|
+
} from "./chunk-6HYVJV7B.js";
|
|
40
|
+
import {
|
|
41
|
+
formatAgentListCard
|
|
42
|
+
} from "./chunk-EDV7EBOI.js";
|
|
51
43
|
import {
|
|
52
44
|
isGatewayHttpStatus
|
|
53
45
|
} from "./chunk-RQSOAMPJ.js";
|
|
46
|
+
import {
|
|
47
|
+
getDefaultCliLocalRuntimeDb
|
|
48
|
+
} from "./chunk-WJRJDX2W.js";
|
|
54
49
|
import {
|
|
55
50
|
buildMemorySubjectsForAgent,
|
|
56
51
|
chooseMemoryOwners,
|
|
57
52
|
loadMemoryCandidatesFromDb,
|
|
58
53
|
resolveAgentMemoryPolicy
|
|
59
|
-
} from "./chunk-
|
|
60
|
-
import {
|
|
61
|
-
parseExternalSkillMarkdown,
|
|
62
|
-
parseSkillDocProtocol
|
|
63
|
-
} from "./chunk-VC6OZXO5.js";
|
|
54
|
+
} from "./chunk-IYEXFJPC.js";
|
|
64
55
|
import {
|
|
65
56
|
API_REPORTED_COST_MULTIPLIER,
|
|
66
57
|
normalizeUsage,
|
|
67
58
|
parseUiAskChoiceContent
|
|
68
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-SCTYAHYK.js";
|
|
69
60
|
import {
|
|
70
61
|
buildSkillDiscoveryContextBlock
|
|
71
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-7OBMZCRD.js";
|
|
63
|
+
import {
|
|
64
|
+
parseExternalSkillMarkdown,
|
|
65
|
+
parseSkillDocProtocol
|
|
66
|
+
} from "./chunk-VC6OZXO5.js";
|
|
72
67
|
import {
|
|
73
68
|
buildPlatformChatCompletionRequest,
|
|
74
69
|
parsePlatformChatCompletionData
|
|
75
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-N54HIJVJ.js";
|
|
76
71
|
import {
|
|
77
72
|
resolveAgentRuntimeConfigFromRecord
|
|
78
73
|
} from "./chunk-OIQPORYI.js";
|
|
@@ -81,25 +76,33 @@ import {
|
|
|
81
76
|
LOCAL_TURN_ABORTED_CODE,
|
|
82
77
|
readActionGate,
|
|
83
78
|
readCommandActionGatePayload
|
|
84
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-YGW4G5W5.js";
|
|
80
|
+
import {
|
|
81
|
+
createThinkParserState,
|
|
82
|
+
flushThinkParser,
|
|
83
|
+
processThinkChunk
|
|
84
|
+
} from "./chunk-LSFAWXKC.js";
|
|
85
85
|
import {
|
|
86
86
|
resolvePlatformAuthToken,
|
|
87
87
|
resolvePlatformChatCompletionsEndpoint
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-MHSGJW4Z.js";
|
|
89
89
|
import {
|
|
90
90
|
DEFAULT_CONTEXT_WINDOW,
|
|
91
91
|
getModelContextWindow
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-I2ZJKTG5.js";
|
|
93
93
|
import {
|
|
94
94
|
clipCompactText
|
|
95
95
|
} from "./chunk-5MMAK75Q.js";
|
|
96
96
|
import {
|
|
97
97
|
findModelConfig
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-UAIVG4J6.js";
|
|
99
|
+
import {
|
|
100
|
+
toErrorMessage
|
|
101
|
+
} from "./chunk-HNMXYYJR.js";
|
|
99
102
|
import {
|
|
100
103
|
buildMemoryOverlayLayer,
|
|
101
104
|
buildMemoryUseGuidanceLayer
|
|
102
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-AL2V7U3E.js";
|
|
103
106
|
import {
|
|
104
107
|
compactWhitespace
|
|
105
108
|
} from "./chunk-DWLEOOGR.js";
|
|
@@ -107,16 +110,20 @@ import {
|
|
|
107
110
|
createRunActivityTracker,
|
|
108
111
|
finalizeRunRecord,
|
|
109
112
|
spawnLocalBackgroundRun
|
|
110
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-VNAEBGDK.js";
|
|
111
114
|
import {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
formatFinishedRunCard,
|
|
116
|
+
formatListRunsCard,
|
|
117
|
+
formatNotFoundRunCard,
|
|
118
|
+
formatStartRunCard,
|
|
119
|
+
formatStatusRunCard,
|
|
120
|
+
formatStopRunCard,
|
|
121
|
+
isAgentRunTerminalStatus,
|
|
122
|
+
runShowsLogTail
|
|
123
|
+
} from "./chunk-FQZZLA3C.js";
|
|
117
124
|
import {
|
|
118
|
-
|
|
119
|
-
} from "./chunk-
|
|
125
|
+
CliProviderQuotaError
|
|
126
|
+
} from "./chunk-X7W4TNB4.js";
|
|
120
127
|
import {
|
|
121
128
|
readPipeText,
|
|
122
129
|
spawnProcess
|
|
@@ -129,7 +136,7 @@ import {
|
|
|
129
136
|
} from "./chunk-Y5GCAMGP.js";
|
|
130
137
|
import {
|
|
131
138
|
createMemoryKey
|
|
132
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-6Y7A3OQQ.js";
|
|
133
140
|
import {
|
|
134
141
|
asTrimmedLowercaseString
|
|
135
142
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -137,7 +144,7 @@ import {
|
|
|
137
144
|
BUILTIN_NOLO_AGENT_KEY,
|
|
138
145
|
PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
|
|
139
146
|
PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
|
|
140
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-3ND52WIL.js";
|
|
141
148
|
import {
|
|
142
149
|
asTrimmedString
|
|
143
150
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -191,23 +198,18 @@ function buildQuickChatIntentSystemPrompt(tierAgents) {
|
|
|
191
198
|
\u53EF\u9009 agent \u5217\u8868\uFF08agentKey \u4E0E\u63CF\u8FF0\uFF09\uFF1A
|
|
192
199
|
${agentList}
|
|
193
200
|
|
|
194
|
-
\u5224\u65AD\u539F\u5219\uFF08\u9ED8\u8BA4\u504F\u5411\u901A\u7528\u6863\u4F4D\uFF1B\u4E13\u804C agent \u5728\u660E\u786E\u5339\u914D\u65F6\u4F7F\u7528\uFF1B**\u7F16\u7801/\u672C\u5730\u4ED3\u5E93\u4EFB\u52A1\u8D70\u901A\u7528\u6863
|
|
201
|
+
\u5224\u65AD\u539F\u5219\uFF08\u9ED8\u8BA4\u504F\u5411\u901A\u7528\u6863\u4F4D\uFF1B\u4E13\u804C agent \u5728\u660E\u786E\u5339\u914D\u65F6\u4F7F\u7528\uFF1B**\u7F16\u7801/\u672C\u5730\u4ED3\u5E93\u4EFB\u52A1\u8D70\u901A\u7528\u6863 balanced/quality**\uFF09\uFF1A
|
|
195
202
|
- \u9ED8\u8BA4\u60C5\u51B5\u4E0B\uFF0C**\u9664\u975E\u7528\u6237\u660E\u786E\u8868\u8FBE\u8981\u5EFA\u5E94\u7528/\u5EFA Agent/\u63D0\u4EA4\u53CD\u9988/\u591A Agent \u7F16\u6392**\uFF0C\u5426\u5219\u9009\u901A\u7528\u6863\u4F4D\uFF08flash/balanced/quality\uFF09\uFF1A
|
|
196
203
|
- \u7B80\u5355\u95EE\u5019\u3001\u95F2\u804A\u3001\u5FEB\u901F\u95EE\u7B54\u3001\u7FFB\u8BD1\u3001\u77ED\u6587 \u2192 \u9009 flash \u6863
|
|
197
204
|
- \u9700\u8981\u63A8\u7406\u3001\u5206\u6790\u3001\u4E2D\u7B49\u957F\u5EA6\u5199\u4F5C\u3001\u666E\u901A\u4EE3\u7801\u89E3\u91CA/\u67B6\u6784\u95EE\u7B54 \u2192 \u9009 balanced \u6863
|
|
198
205
|
- \u590D\u6742\u63A8\u7406\u3001\u957F\u6587\u3001\u67B6\u6784\u8BBE\u8BA1\u3001\u6DF1\u5EA6\u5206\u6790 \u2192 \u9009 quality \u6863
|
|
199
|
-
- **\u660E\u786E\u7F16\u7801\u4EFB\u52A1\uFF08\u5B9E\u73B0\u529F\u80FD\u3001\u4FEE bug\u3001refactor\u3001\u5199/\u8865\u6D4B\u8BD5\u3001\u8DD1 build/tests/ci\uFF09\u6216\u67E5\u770B\u672C\u673A\u4ED3\u5E93/\u4EE3\u7801\u72B6\u6001\uFF08git/\u5206\u652F/commit/\u672C\u5730\u4E0E\u8FDC\u7A0B\u5DEE\u8DDD/\u672A\u63D0\u4EA4\u6539\u52A8\u7B49\uFF09** \u2192 \u9009 balanced \u6216 quality \u6863\uFF08\u6309\u590D\u6742\u5EA6\uFF1B**\u4E0D\u8981\u9009 flash**\uFF09
|
|
206
|
+
- **\u660E\u786E\u7F16\u7801\u4EFB\u52A1\uFF08\u5B9E\u73B0\u529F\u80FD\u3001\u4FEE bug\u3001refactor\u3001\u5199/\u8865\u6D4B\u8BD5\u3001\u8DD1 build/tests/ci\uFF09\u6216\u67E5\u770B\u672C\u673A\u4ED3\u5E93/\u4EE3\u7801\u72B6\u6001\uFF08git/\u5206\u652F/commit/\u672C\u5730\u4E0E\u8FDC\u7A0B\u5DEE\u8DDD/\u672A\u63D0\u4EA4\u6539\u52A8\u7B49\uFF09** \u2192 \u9009 balanced \u6216 quality \u6863\uFF08\u6309\u590D\u6742\u5EA6\uFF1B**\u4E0D\u8981\u9009 flash**\uFF09
|
|
200
207
|
- \u4E13\u804C agent \u8DEF\u7531\u89C4\u5219\uFF08\u6709\u660E\u786E\u5339\u914D\u65F6\u4F7F\u7528\uFF09\uFF1A
|
|
201
208
|
- \u8981\u63D0\u4EA4/\u8BB0\u5F55 bug\u3001\u4F53\u9A8C\u95EE\u9898\u3001\u6570\u636E\u5F02\u5E38\u3001\u4EA7\u54C1\u5EFA\u8BAE\uFF0C\u6216\u53E3\u8BED\u5982\u300C\u60F3\u53CD\u9988\u4E00\u4E9B\u95EE\u9898\u300D\u300C\u53CD\u9988\u4E00\u4E0B\u300D\u2192 \u9009\u610F\u89C1\u53CD\u9988\u4E13\u804C agent
|
|
202
209
|
- \u8981\u65B0\u5EFA\u6216\u5B9A\u5236 AI/Agent/\u667A\u80FD\u4F53\u52A9\u624B\uFF08\u542B\u914D\u7F6E\u5DE5\u5177\u3001\u77E5\u8BC6\u3001\u786E\u8BA4\u521B\u5EFA\uFF09\u2192 \u9009\u521B\u5EFA Agent \u4E13\u804C agent
|
|
203
210
|
- \u8981\u505A/\u6539/\u53D1\u5E03\u7F51\u7AD9\u3001\u7F51\u9875\u3001\u5C0F\u5E94\u7528\u3001\u9884\u7EA6\u9875\u3001\u535A\u5BA2\u3001\u770B\u677F \u2192 \u9009\u5E94\u7528\u6784\u5EFA\u4E13\u804C agent
|
|
204
211
|
- \u8981\u6D3E\u591A\u4E2A agent\u3001\u591A agent \u5E76\u884C\u3001\u62C6\u6210\u4EFB\u52A1\u540E\u53F0\u6267\u884C\u3001\u591A\u4E2A agent review\u3001\u8BA9\u4E0D\u540C agent \u8BA8\u8BBA/\u4F1A\u5546 \u2192 \u9009\u591A Agent \u7F16\u6392\u4E13\u804C agent\uFF08\u663E\u5F0F multi-agent \u4F18\u5148\uFF09
|
|
205
|
-
- **\u62FF\u4E0D\u51C6\u65F6**\uFF1A\u7EAF\u95F2\u804A\u9009 flash\uFF1B**\u82E5\u6CBE\u8FB9\u672C\u5730\u4ED3\u5E93/\u5F53\u524D\u4EE3\u7801\u72B6\u6001\uFF0C\u9009 balanced/quality
|
|
206
|
-
|
|
207
|
-
\u540C\u65F6\u5224\u65AD\u672C\u8F6E\u662F\u5426\u9700\u8981\u6CE8\u5165\u300C\u5DE5\u4F5C\u533A\u53EA\u8BFB\u5DE5\u5177\u300D\uFF08listFiles/globFiles/searchFiles/readFile/execShell \u7B49\uFF09\uFF1A
|
|
208
|
-
- needsWorkspace=true \u7684\u573A\u666F\uFF1A\u7528\u6237\u8981\u8BFB/\u6539/\u5206\u6790\u6587\u4EF6\u6216\u4EE3\u7801\u3001\u63D0\u5230\u4E86\u6587\u4EF6\u8DEF\u5F84/\u6269\u5C55\u540D\uFF08.md/.csv/.ts \u7B49\uFF09\u3001\u63D0\u5230\u5DE5\u4F5C\u533A/\u4EE3\u7801\u5E93/\u4ED3\u5E93/\u76EE\u5F55/git/\u5206\u652F\u3001\u8981\u770B\u5F53\u524D\u4EE3\u7801\u6216\u4ED3\u5E93\u72B6\u6001\u3001\u672C\u5730\u641C\u7D22/\u67E5\u770B\u4EE3\u7801\u3002
|
|
209
|
-
- needsWorkspace=false \u7684\u573A\u666F\uFF1A\u901A\u7528\u77E5\u8BC6\u95EE\u7B54\uFF08\u5982\u300C\u5E7F\u4E1C\u7ECF\u6D4E\u6570\u636E\u300D\u300C\u5199\u4E00\u9996\u8BD7\u300D\uFF09\u3001\u7EAF\u95F2\u804A\u95EE\u5019\u3001\u7FFB\u8BD1\u3001\u4E0D\u6D89\u53CA\u672C\u5730\u6587\u4EF6/\u4ED3\u5E93\u3002
|
|
210
|
-
- \u6F0F\u5224\uFF08\u7528\u6237\u8981\u6587\u4EF6\u800C\u6CA1\u5E26\u5DE5\u5177\uFF09\u6BD4\u8BEF\u5224\uFF08\u767D\u641C\u51E0\u8F6E\uFF09\u4EE3\u4EF7\u66F4\u9AD8\uFF0C\u5B81\u53EF\u504F\u5BBD\u5224 true\u3002
|
|
212
|
+
- **\u62FF\u4E0D\u51C6\u65F6**\uFF1A\u7EAF\u95F2\u804A\u9009 flash\uFF1B**\u82E5\u6CBE\u8FB9\u672C\u5730\u4ED3\u5E93/\u5F53\u524D\u4EE3\u7801\u72B6\u6001\uFF0C\u9009 balanced/quality**\u3002
|
|
211
213
|
|
|
212
214
|
\u5728\u7ED9\u51FA agentKey \u4E4B\u524D\uFF0C\u5148\u5728\u5FC3\u91CC\u533A\u5206\u5019\u9009\u6863\u4F4D\u7684\u8FB9\u754C\u518D\u7ED9\u7F6E\u4FE1\u5EA6\uFF1Abalanced \u4E0E quality \u7684\u8FB9\u754C\u5728\u4E8E\u590D\u6742\u5EA6/\u7BC7\u5E45/\u662F\u5426\u9700\u8981\u6DF1\u5EA6\u5206\u6790\uFF0C\u62FF\u4E0D\u51C6\u5C31\u7ED9\u4F4E confidence\u3002
|
|
213
215
|
|
|
@@ -219,7 +221,7 @@ ${agentList}
|
|
|
219
221
|
- \u666E\u901A\u95EE\u7B54/\u7EAF\u95F2\u804A/\u5EFA\u5E94\u7528 \u2192 skills \u4E3A []
|
|
220
222
|
|
|
221
223
|
\u53EA\u8F93\u51FA JSON\uFF0C\u4E0D\u8981\u8F93\u51FA\u5176\u4ED6\u5185\u5BB9\uFF1A
|
|
222
|
-
{"confidence": <0\u52301\u4E4B\u95F4\u7684\u5C0F\u6570\uFF0C\u8868\u793A\u4F60\u5BF9\u8FD9\u4E2A\u5206\u7C7B\u5224\u65AD\u7684\u628A\u63E1\u7A0B\u5EA6>, "agentKey": "<\u4ECE\u5217\u8868\u4E2D\u9009\u62E9\u7684 agentKey>", "
|
|
224
|
+
{"confidence": <0\u52301\u4E4B\u95F4\u7684\u5C0F\u6570\uFF0C\u8868\u793A\u4F60\u5BF9\u8FD9\u4E2A\u5206\u7C7B\u5224\u65AD\u7684\u628A\u63E1\u7A0B\u5EA6>, "agentKey": "<\u4ECE\u5217\u8868\u4E2D\u9009\u62E9\u7684 agentKey>", "skills": <\u5B57\u7B26\u4E32\u6570\u7EC4\uFF0C\u5143\u7D20\u53EA\u80FD\u662F ${[...VALID_QUICK_CHAT_SKILLS].map((s) => `"${s}"`).join(" | ")}\uFF0C\u672A\u547D\u4E2D\u7ED9 []>}`;
|
|
223
225
|
}
|
|
224
226
|
function parseQuickChatIntentResult(content, tierAgents) {
|
|
225
227
|
try {
|
|
@@ -228,8 +230,6 @@ function parseQuickChatIntentResult(content, tierAgents) {
|
|
|
228
230
|
const key = parsed.agentKey;
|
|
229
231
|
if (typeof key !== "string") return null;
|
|
230
232
|
if (!tierAgents.some((t2) => t2.agentKey === key)) return null;
|
|
231
|
-
const rawNeedsWorkspace = parsed.needsWorkspace;
|
|
232
|
-
const needsWorkspace = rawNeedsWorkspace === true;
|
|
233
233
|
const rawConfidence = parsed.confidence;
|
|
234
234
|
const confidence = typeof rawConfidence === "number" && Number.isFinite(rawConfidence) && rawConfidence >= 0 && rawConfidence <= 1 ? rawConfidence : void 0;
|
|
235
235
|
const rawSkills = parsed.skills;
|
|
@@ -240,7 +240,7 @@ function parseQuickChatIntentResult(content, tierAgents) {
|
|
|
240
240
|
);
|
|
241
241
|
if (filtered.length > 0) skills = filtered;
|
|
242
242
|
}
|
|
243
|
-
return { agentKey: key,
|
|
243
|
+
return { agentKey: key, confidence, skills };
|
|
244
244
|
} catch {
|
|
245
245
|
return null;
|
|
246
246
|
}
|
|
@@ -352,7 +352,6 @@ async function classifyCliAutoRoute(text, options) {
|
|
|
352
352
|
tier,
|
|
353
353
|
classified: true,
|
|
354
354
|
confidence: parsed.confidence,
|
|
355
|
-
needsWorkspace: parsed.needsWorkspace,
|
|
356
355
|
skills: parsed.skills
|
|
357
356
|
};
|
|
358
357
|
} catch {
|
|
@@ -759,6 +758,19 @@ function wrapTranscriptLine(line, columns, hangingIndent = "") {
|
|
|
759
758
|
}
|
|
760
759
|
return result.length > 0 ? result : [""];
|
|
761
760
|
}
|
|
761
|
+
function buildWindowTitle(title) {
|
|
762
|
+
const plain = stripAnsi(title).replace(/[\x00-\x1f\x7f]+/g, " ");
|
|
763
|
+
let truncated = "";
|
|
764
|
+
let width = 0;
|
|
765
|
+
const maxCols = 80;
|
|
766
|
+
for (const char of plain) {
|
|
767
|
+
const charWidth = displayWidth(char);
|
|
768
|
+
if (width + charWidth > maxCols) break;
|
|
769
|
+
truncated += char;
|
|
770
|
+
width += charWidth;
|
|
771
|
+
}
|
|
772
|
+
return `\x1B]0;${truncated}\x07\x1B]2;${truncated}\x07`;
|
|
773
|
+
}
|
|
762
774
|
function wrapTextToLines(text, columns) {
|
|
763
775
|
const result = [];
|
|
764
776
|
for (const logicalLine of text.split("\n")) {
|
|
@@ -955,6 +967,17 @@ function supportsTruecolor(env = process.env) {
|
|
|
955
967
|
const program = (env.TERM_PROGRAM ?? "").toLowerCase();
|
|
956
968
|
return TRUECOLOR_TERM_PROGRAMS.has(program);
|
|
957
969
|
}
|
|
970
|
+
function detectSystemBrightnessFromEnv(env = process.env) {
|
|
971
|
+
const appleStyle = (env.AppleInterfaceStyle ?? "").trim().toLowerCase();
|
|
972
|
+
if (appleStyle === "dark") return "dark";
|
|
973
|
+
const colorScheme = (env.COLOR_SCHEME ?? env.COLORSCHEME ?? env.SYSTEM_COLOR_SCHEME ?? "").trim().toLowerCase();
|
|
974
|
+
if (/(?:^|[\s\-_:])dark(?:$|[\s\-_:])/i.test(colorScheme)) return "dark";
|
|
975
|
+
if (/(?:^|[\s\-_:])light(?:$|[\s\-_:])/i.test(colorScheme)) return "light";
|
|
976
|
+
const gtkTheme = (env.GTK_THEME ?? env.QT_STYLE_OVERRIDE ?? "").trim().toLowerCase();
|
|
977
|
+
if (/(?:^|[\s\-_:])dark(?:$|[\s\-_:])/i.test(gtkTheme)) return "dark";
|
|
978
|
+
if (/(?:^|[\s\-_:])light(?:$|[\s\-_:])/i.test(gtkTheme)) return "light";
|
|
979
|
+
return null;
|
|
980
|
+
}
|
|
958
981
|
function resolveTuiBrightness(env = process.env) {
|
|
959
982
|
const explicit = (env.NOLO_TUI_THEME ?? "").trim().toLowerCase();
|
|
960
983
|
if (explicit === "light") return "light";
|
|
@@ -967,6 +990,8 @@ function resolveTuiBrightness(env = process.env) {
|
|
|
967
990
|
if (!Number.isNaN(bg) && bg >= 0 && bg <= 6) return "dark";
|
|
968
991
|
if (!Number.isNaN(bg) && bg >= 7 && bg <= 15) return "light";
|
|
969
992
|
}
|
|
993
|
+
const sys = detectSystemBrightnessFromEnv(env);
|
|
994
|
+
if (sys) return sys;
|
|
970
995
|
return "dark";
|
|
971
996
|
}
|
|
972
997
|
function hexToSgr(hex) {
|
|
@@ -997,7 +1022,8 @@ function setActiveTerminalBaseHex(hex) {
|
|
|
997
1022
|
}
|
|
998
1023
|
function applyDetectedBackground(detected) {
|
|
999
1024
|
const normalizedHex = detected.hex.replace(/^#/, "").toUpperCase();
|
|
1000
|
-
const
|
|
1025
|
+
const hexChanged = normalizedHex !== "" && normalizedHex !== activeTerminalBaseHex;
|
|
1026
|
+
const changed = detected.brightness !== activeBrightness || hexChanged;
|
|
1001
1027
|
setActiveBrightness(detected.brightness);
|
|
1002
1028
|
setActiveTerminalBaseHex(detected.hex);
|
|
1003
1029
|
return changed;
|
|
@@ -1606,161 +1632,8 @@ function createRenderAwareStreamWriter(args) {
|
|
|
1606
1632
|
}
|
|
1607
1633
|
};
|
|
1608
1634
|
}
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
var THINK_OPEN = /<think>/i;
|
|
1612
|
-
var THINK_CLOSE = /<\/think>/i;
|
|
1613
|
-
var COLLAPSED_MARKER = /^\s*▸ 思考已折叠\s*$/;
|
|
1614
|
-
function normalizeThinkingDisplayMode(raw, fallback = "hide") {
|
|
1615
|
-
const normalized = asTrimmedLowercaseString(raw);
|
|
1616
|
-
if (normalized === "hide" || normalized === "off" || normalized === "false" || normalized === "0") {
|
|
1617
|
-
return "hide";
|
|
1618
|
-
}
|
|
1619
|
-
if (normalized === "marker" || normalized === "collapsed" || normalized === "fold") {
|
|
1620
|
-
return "marker";
|
|
1621
|
-
}
|
|
1622
|
-
if (normalized === "show" || normalized === "on" || normalized === "true" || normalized === "1") {
|
|
1623
|
-
return "show";
|
|
1624
|
-
}
|
|
1625
|
-
return fallback;
|
|
1626
|
-
}
|
|
1627
|
-
function resolveThinkingDisplayMode(env = process.env) {
|
|
1628
|
-
return normalizeThinkingDisplayMode(env.NOLO_CLI_THINKING ?? env.NOLO_THINKING, "hide");
|
|
1629
|
-
}
|
|
1630
|
-
function collapseThinkingBlocks(text, mode = "hide") {
|
|
1631
|
-
if (mode === "show") return text;
|
|
1632
|
-
const replacement = mode === "marker" ? "\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n" : "";
|
|
1633
|
-
return text.replace(/<think>[\s\S]*?<\/think>\s*/gi, replacement).replace(/\n{3,}/g, "\n\n").trim();
|
|
1634
|
-
}
|
|
1635
|
-
function stripCollapsedThinkingMarkers(text) {
|
|
1636
|
-
return text.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n").replace(/\n{2,}/g, "\n").trim();
|
|
1637
|
-
}
|
|
1638
|
-
function formatAssistantTextForCli(text, mode = "hide") {
|
|
1639
|
-
const collapsed = collapseThinkingBlocks(text, mode);
|
|
1640
|
-
return mode === "hide" ? stripCollapsedThinkingMarkers(collapsed) : collapsed;
|
|
1641
|
-
}
|
|
1642
|
-
function createThinkingEventSink(arg1, arg2) {
|
|
1643
|
-
let mode = "hide";
|
|
1644
|
-
let write = () => {
|
|
1645
|
-
};
|
|
1646
|
-
if (typeof arg1 === "function") {
|
|
1647
|
-
write = arg1;
|
|
1648
|
-
if (typeof arg2 === "string") {
|
|
1649
|
-
mode = arg2;
|
|
1650
|
-
}
|
|
1651
|
-
} else {
|
|
1652
|
-
mode = arg1;
|
|
1653
|
-
if (typeof arg2 === "function") {
|
|
1654
|
-
write = arg2;
|
|
1655
|
-
}
|
|
1656
|
-
}
|
|
1657
|
-
if (mode === "hide") {
|
|
1658
|
-
return {
|
|
1659
|
-
push(_chunk) {
|
|
1660
|
-
}
|
|
1661
|
-
};
|
|
1662
|
-
}
|
|
1663
|
-
if (mode === "show") {
|
|
1664
|
-
return {
|
|
1665
|
-
push(chunk) {
|
|
1666
|
-
if (chunk) write(chunk);
|
|
1667
|
-
}
|
|
1668
|
-
};
|
|
1669
|
-
}
|
|
1670
|
-
let markerEmitted = false;
|
|
1671
|
-
return {
|
|
1672
|
-
push(chunk) {
|
|
1673
|
-
if (!chunk || markerEmitted) return;
|
|
1674
|
-
write("\n\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n");
|
|
1675
|
-
markerEmitted = true;
|
|
1676
|
-
}
|
|
1677
|
-
};
|
|
1678
|
-
}
|
|
1679
|
-
function createThinkingAwareStreamFilter(write, mode = "hide") {
|
|
1680
|
-
if (mode === "show") {
|
|
1681
|
-
return {
|
|
1682
|
-
push(chunk) {
|
|
1683
|
-
write(chunk);
|
|
1684
|
-
},
|
|
1685
|
-
flush() {
|
|
1686
|
-
}
|
|
1687
|
-
};
|
|
1688
|
-
}
|
|
1689
|
-
let pending = "";
|
|
1690
|
-
let insideThink = false;
|
|
1691
|
-
let markerEmitted = false;
|
|
1692
|
-
const emit = (chunk) => {
|
|
1693
|
-
if (chunk) write(chunk);
|
|
1694
|
-
};
|
|
1695
|
-
const emitMarker = () => {
|
|
1696
|
-
if (mode !== "marker" || markerEmitted) return;
|
|
1697
|
-
emit("\n\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n");
|
|
1698
|
-
markerEmitted = true;
|
|
1699
|
-
};
|
|
1700
|
-
const consume = (input) => {
|
|
1701
|
-
pending += input;
|
|
1702
|
-
while (pending.length > 0) {
|
|
1703
|
-
if (insideThink) {
|
|
1704
|
-
const closeMatch = pending.match(THINK_CLOSE);
|
|
1705
|
-
if (!closeMatch || closeMatch.index == null) {
|
|
1706
|
-
emitMarker();
|
|
1707
|
-
pending = "";
|
|
1708
|
-
return;
|
|
1709
|
-
}
|
|
1710
|
-
emitMarker();
|
|
1711
|
-
pending = pending.slice(closeMatch.index + closeMatch[0].length);
|
|
1712
|
-
insideThink = false;
|
|
1713
|
-
markerEmitted = false;
|
|
1714
|
-
continue;
|
|
1715
|
-
}
|
|
1716
|
-
const openMatch = pending.match(THINK_OPEN);
|
|
1717
|
-
if (!openMatch || openMatch.index == null) {
|
|
1718
|
-
const nextMarker = pending.indexOf("<");
|
|
1719
|
-
if (nextMarker === -1) {
|
|
1720
|
-
const cleaned = mode === "hide" ? pending.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : pending;
|
|
1721
|
-
emit(cleaned);
|
|
1722
|
-
pending = "";
|
|
1723
|
-
return;
|
|
1724
|
-
}
|
|
1725
|
-
if (nextMarker > 0) {
|
|
1726
|
-
const head = pending.slice(0, nextMarker);
|
|
1727
|
-
const cleaned = mode === "hide" ? head.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : head;
|
|
1728
|
-
emit(cleaned);
|
|
1729
|
-
pending = pending.slice(nextMarker);
|
|
1730
|
-
continue;
|
|
1731
|
-
}
|
|
1732
|
-
if (pending.length < 7) return;
|
|
1733
|
-
emit(pending[0]);
|
|
1734
|
-
pending = pending.slice(1);
|
|
1735
|
-
continue;
|
|
1736
|
-
}
|
|
1737
|
-
if (openMatch.index > 0) {
|
|
1738
|
-
const head = pending.slice(0, openMatch.index);
|
|
1739
|
-
const cleaned = mode === "hide" ? head.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : head;
|
|
1740
|
-
emit(cleaned);
|
|
1741
|
-
pending = pending.slice(openMatch.index);
|
|
1742
|
-
continue;
|
|
1743
|
-
}
|
|
1744
|
-
pending = pending.slice(openMatch[0].length);
|
|
1745
|
-
insideThink = true;
|
|
1746
|
-
markerEmitted = false;
|
|
1747
|
-
}
|
|
1748
|
-
};
|
|
1749
|
-
return {
|
|
1750
|
-
push(chunk) {
|
|
1751
|
-
consume(chunk);
|
|
1752
|
-
},
|
|
1753
|
-
flush() {
|
|
1754
|
-
if (insideThink) emitMarker();
|
|
1755
|
-
if (pending) {
|
|
1756
|
-
const cleaned = mode === "hide" ? pending.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : pending;
|
|
1757
|
-
emit(cleaned);
|
|
1758
|
-
}
|
|
1759
|
-
pending = "";
|
|
1760
|
-
insideThink = false;
|
|
1761
|
-
markerEmitted = false;
|
|
1762
|
-
}
|
|
1763
|
-
};
|
|
1635
|
+
function formatAssistantTextForCli(text) {
|
|
1636
|
+
return text.replace(/\u003cthink\u003e[\s\S]*?\u003c\/think\u003e\s*/gi, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
1764
1637
|
}
|
|
1765
1638
|
|
|
1766
1639
|
// packages/cli/client/formatReadPathTree.ts
|
|
@@ -2278,18 +2151,8 @@ function isFailedToolResult(event) {
|
|
|
2278
2151
|
function isNeedsActionToolResult(event) {
|
|
2279
2152
|
return Boolean(event.metadata?.actionGate);
|
|
2280
2153
|
}
|
|
2281
|
-
function readRunLogLines(parsed) {
|
|
2282
|
-
if (Array.isArray(parsed.logLines)) return parsed.logLines;
|
|
2283
|
-
if (typeof parsed.logTail === "string" && parsed.logTail.trim()) {
|
|
2284
|
-
return parsed.logTail.split("\n");
|
|
2285
|
-
}
|
|
2286
|
-
return void 0;
|
|
2287
|
-
}
|
|
2288
|
-
function readRunErrorMessage(parsed) {
|
|
2289
|
-
return typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
|
|
2290
|
-
}
|
|
2291
2154
|
function parseUiAskChoiceForCli(event) {
|
|
2292
|
-
if (event.toolName !== "
|
|
2155
|
+
if (event.toolName !== "ask_user" && !event.metadata?.uiAskChoice) {
|
|
2293
2156
|
return null;
|
|
2294
2157
|
}
|
|
2295
2158
|
const parsed = parseUiAskChoiceContent(event.content);
|
|
@@ -2390,70 +2253,84 @@ function formatToolTraceLine(text, colorEnabled, accent = "none") {
|
|
|
2390
2253
|
return `${dimCliText(text, true)}
|
|
2391
2254
|
`;
|
|
2392
2255
|
}
|
|
2393
|
-
function
|
|
2256
|
+
function renderRunCard(snapshot, opts) {
|
|
2257
|
+
const labels = agentRunCardLabels();
|
|
2258
|
+
const timing = { startedAt: snapshot.startedAt, finishedAt: snapshot.finishedAt };
|
|
2259
|
+
const name = snapshot.agentName ?? "agent";
|
|
2260
|
+
if (isAgentRunTerminalStatus(snapshot.status)) {
|
|
2261
|
+
return formatFinishedRunCard(name, snapshot.status, {
|
|
2262
|
+
runId: snapshot.runId,
|
|
2263
|
+
toolCallCount: snapshot.toolCallCount,
|
|
2264
|
+
lastToolNames: snapshot.lastToolNames,
|
|
2265
|
+
lastAssistantText: snapshot.lastAssistantText,
|
|
2266
|
+
errorMessage: snapshot.errorMessage,
|
|
2267
|
+
logLines: snapshot.logLines,
|
|
2268
|
+
timing,
|
|
2269
|
+
...opts?.includeLogTail !== void 0 ? { includeLogTail: opts.includeLogTail } : {},
|
|
2270
|
+
labels
|
|
2271
|
+
});
|
|
2272
|
+
}
|
|
2273
|
+
return formatStatusRunCard(name, snapshot.status, {
|
|
2274
|
+
runId: snapshot.runId,
|
|
2275
|
+
toolCallCount: snapshot.toolCallCount,
|
|
2276
|
+
lastToolNames: snapshot.lastToolNames,
|
|
2277
|
+
lastAssistantText: snapshot.lastAssistantText,
|
|
2278
|
+
errorMessage: snapshot.errorMessage,
|
|
2279
|
+
logLines: snapshot.logLines,
|
|
2280
|
+
timing,
|
|
2281
|
+
...opts?.includeLogTail !== void 0 ? { includeLogTail: opts.includeLogTail } : {},
|
|
2282
|
+
labels
|
|
2283
|
+
});
|
|
2284
|
+
}
|
|
2285
|
+
function recoverOrchestrationCard(event, toolName) {
|
|
2286
|
+
const content = typeof event.content === "string" ? event.content : "";
|
|
2394
2287
|
const trimmed = content.trim();
|
|
2395
|
-
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return
|
|
2288
|
+
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return null;
|
|
2396
2289
|
const labels = agentRunCardLabels();
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2290
|
+
if (toolName === "listAgents") {
|
|
2291
|
+
try {
|
|
2292
|
+
const parsed = JSON.parse(trimmed);
|
|
2400
2293
|
const agents = Array.isArray(parsed.agents) ? parsed.agents : [];
|
|
2401
2294
|
return formatAgentListCard(agents);
|
|
2295
|
+
} catch {
|
|
2296
|
+
return null;
|
|
2402
2297
|
}
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
}
|
|
2408
|
-
if (toolName === "controlAgentRun") {
|
|
2298
|
+
}
|
|
2299
|
+
if (toolName === "controlAgentRun") {
|
|
2300
|
+
try {
|
|
2301
|
+
const parsed = JSON.parse(trimmed);
|
|
2409
2302
|
if (Array.isArray(parsed.runs)) {
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
if (parsed.found === false || status === "not_found") {
|
|
2415
|
-
return formatNotFoundRunCard(labels);
|
|
2416
|
-
}
|
|
2417
|
-
if (status === "killed" || status === "cancelled" || status === "cancelling") {
|
|
2418
|
-
return formatStopRunCard(status, labels);
|
|
2303
|
+
return formatListRunsCard(
|
|
2304
|
+
parsed.runs,
|
|
2305
|
+
labels
|
|
2306
|
+
);
|
|
2419
2307
|
}
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
logLines: readRunLogLines(parsed),
|
|
2423
|
-
labels
|
|
2424
|
-
});
|
|
2308
|
+
} catch {
|
|
2309
|
+
return null;
|
|
2425
2310
|
}
|
|
2426
|
-
} catch {
|
|
2427
2311
|
}
|
|
2428
|
-
|
|
2312
|
+
const parsedEvent = parseAgentRunEvent(event);
|
|
2313
|
+
if (!parsedEvent) return null;
|
|
2314
|
+
const { kind, snapshot } = parsedEvent;
|
|
2315
|
+
if (kind === "start") {
|
|
2316
|
+
return formatStartRunCard(snapshot.agentName ?? "agent", snapshot.status, {
|
|
2317
|
+
task: snapshot.taskPreview,
|
|
2318
|
+
runId: snapshot.runId,
|
|
2319
|
+
labels
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
if (kind === "gone") return formatNotFoundRunCard(labels);
|
|
2323
|
+
if (kind === "stop") return formatStopRunCard(snapshot.status, labels);
|
|
2324
|
+
return renderRunCard(snapshot);
|
|
2429
2325
|
}
|
|
2430
2326
|
function parseControlAgentRunStatusEvent(event) {
|
|
2431
|
-
const
|
|
2432
|
-
|
|
2433
|
-
try {
|
|
2434
|
-
const parsed = JSON.parse(raw);
|
|
2435
|
-
if (Array.isArray(parsed.runs)) return null;
|
|
2436
|
-
const status = typeof parsed.status === "string" ? parsed.status : void 0;
|
|
2437
|
-
if (parsed.found === false || status === "not_found") return null;
|
|
2438
|
-
if (status === "killed" || status === "cancelled" || status === "cancelling") return null;
|
|
2439
|
-
if (!status) return null;
|
|
2440
|
-
const runId = typeof parsed.runId === "string" && parsed.runId.trim() ? parsed.runId.trim() : typeof event.metadata?.runId === "string" ? event.metadata.runId : "";
|
|
2441
|
-
if (!runId) return null;
|
|
2442
|
-
const agentName = resolveRunLabel(parsed);
|
|
2443
|
-
const errorMessage = readRunErrorMessage(parsed);
|
|
2444
|
-
const logLines = readRunLogLines(parsed);
|
|
2445
|
-
const logKey = logLines && logLines.length > 0 ? logLines.join("\n") : "";
|
|
2446
|
-
return { runId, status, agentName, errorMessage, logLines, logKey };
|
|
2447
|
-
} catch {
|
|
2448
|
-
return null;
|
|
2449
|
-
}
|
|
2327
|
+
const parsed = parseAgentRunEvent(event);
|
|
2328
|
+
return parsed?.kind === "status" ? parsed.snapshot : null;
|
|
2450
2329
|
}
|
|
2451
2330
|
function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
|
|
2452
2331
|
const rawLabel = toolLabel(toolName);
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
rawDataStr = recoverOrchestrationDisplayFromContent(toolName, event.content);
|
|
2456
|
-
}
|
|
2332
|
+
const bakedCard = typeof event.metadata?.displayData === "string" && event.metadata.displayData.trim() ? event.metadata.displayData : "";
|
|
2333
|
+
const rawDataStr = recoverOrchestrationCard(event, toolName) || bakedCard || (typeof event.content === "string" ? event.content : "");
|
|
2457
2334
|
const failed = event.type === "tool-error" || isFailedToolResult(event) || Boolean(event.metadata?.failed) || /^Error:/i.test(rawDataStr.trim());
|
|
2458
2335
|
if (failed) {
|
|
2459
2336
|
const firstLine = rawDataStr.trim().split("\n")[0] || event.summary || event.message || t("toolFailed");
|
|
@@ -2489,16 +2366,22 @@ function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
|
|
|
2489
2366
|
}
|
|
2490
2367
|
return out;
|
|
2491
2368
|
}
|
|
2369
|
+
function mergeRunSnapshot(previous, next) {
|
|
2370
|
+
return {
|
|
2371
|
+
...previous,
|
|
2372
|
+
...next,
|
|
2373
|
+
errorMessage: next.errorMessage ?? previous.errorMessage,
|
|
2374
|
+
logLines: next.logLines ?? previous.logLines,
|
|
2375
|
+
logKey: next.logKey || previous.logKey,
|
|
2376
|
+
toolCallCount: next.toolCallCount ?? previous.toolCallCount,
|
|
2377
|
+
lastToolNames: next.lastToolNames ?? previous.lastToolNames,
|
|
2378
|
+
lastAssistantText: next.lastAssistantText ?? previous.lastAssistantText,
|
|
2379
|
+
startedAt: next.startedAt ?? previous.startedAt,
|
|
2380
|
+
finishedAt: next.finishedAt ?? previous.finishedAt
|
|
2381
|
+
};
|
|
2382
|
+
}
|
|
2492
2383
|
function formatFoldedControlStatusCard(snapshot, colorEnabled) {
|
|
2493
|
-
const
|
|
2494
|
-
const body = formatStatusRunCard(snapshot.agentName, snapshot.status, {
|
|
2495
|
-
errorMessage: snapshot.errorMessage,
|
|
2496
|
-
logLines: snapshot.logLines,
|
|
2497
|
-
pollCount: snapshot.pollCount,
|
|
2498
|
-
elapsedMs: snapshot.elapsedMs,
|
|
2499
|
-
includeLogTail: snapshot.includeLogTail,
|
|
2500
|
-
labels
|
|
2501
|
-
});
|
|
2384
|
+
const body = renderRunCard(snapshot, { includeLogTail: snapshot.includeLogTail });
|
|
2502
2385
|
return formatOrchestrationCardBlock(
|
|
2503
2386
|
{
|
|
2504
2387
|
type: "tool-result",
|
|
@@ -2506,8 +2389,7 @@ function formatFoldedControlStatusCard(snapshot, colorEnabled) {
|
|
|
2506
2389
|
toolCallId: `fold-${snapshot.runId}`,
|
|
2507
2390
|
toolName: "controlAgentRun",
|
|
2508
2391
|
content: "",
|
|
2509
|
-
metadata: { displayData: body }
|
|
2510
|
-
elapsedMs: snapshot.elapsedMs
|
|
2392
|
+
metadata: { displayData: body }
|
|
2511
2393
|
},
|
|
2512
2394
|
"controlAgentRun",
|
|
2513
2395
|
colorEnabled
|
|
@@ -2528,7 +2410,7 @@ function formatVerboseToolEvent(event, colorEnabled) {
|
|
|
2528
2410
|
);
|
|
2529
2411
|
}
|
|
2530
2412
|
const elapsed = typeof event.elapsedMs === "number" ? ` ${event.elapsedMs}ms` : "";
|
|
2531
|
-
if (event.type === "tool-result" && (event.toolName === "
|
|
2413
|
+
if (event.type === "tool-result" && (event.toolName === "ask_user" || event.metadata?.uiAskChoice)) {
|
|
2532
2414
|
const block = formatUiAskChoiceBlock(event, colorEnabled);
|
|
2533
2415
|
if (block) return `${formatToolTraceLine(`[nolo:tool] #${round} <- ${event.toolName}${elapsed}`, colorEnabled)}${block}`;
|
|
2534
2416
|
}
|
|
@@ -2741,7 +2623,7 @@ function formatCompactToolLine(event, pending, colorEnabled) {
|
|
|
2741
2623
|
if (event.type === "tool-result" && (toolName === "listAgents" || toolName === "startAgentRun" || toolName === "controlAgentRun")) {
|
|
2742
2624
|
return formatOrchestrationCardBlock(event, toolName, colorEnabled);
|
|
2743
2625
|
}
|
|
2744
|
-
if (event.type === "tool-result" && (event.toolName === "
|
|
2626
|
+
if (event.type === "tool-result" && (event.toolName === "ask_user" || event.metadata?.uiAskChoice)) {
|
|
2745
2627
|
const block = formatUiAskChoiceBlock(event, colorEnabled);
|
|
2746
2628
|
if (block) return block;
|
|
2747
2629
|
}
|
|
@@ -2783,31 +2665,31 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2783
2665
|
let webSearchBuffer = [];
|
|
2784
2666
|
let statusFold = null;
|
|
2785
2667
|
const lastEmittedLogByRunId = /* @__PURE__ */ new Map();
|
|
2668
|
+
const lastPrintedCardByRunId = /* @__PURE__ */ new Map();
|
|
2669
|
+
const cardSubstance = (snapshot) => JSON.stringify([
|
|
2670
|
+
snapshot.status,
|
|
2671
|
+
snapshot.toolCallCount ?? -1,
|
|
2672
|
+
snapshot.lastToolNames ?? [],
|
|
2673
|
+
snapshot.lastAssistantText ?? "",
|
|
2674
|
+
snapshot.errorMessage ?? "",
|
|
2675
|
+
snapshot.logKey
|
|
2676
|
+
]);
|
|
2786
2677
|
const flushStatusFold = () => {
|
|
2787
2678
|
if (!statusFold) return "";
|
|
2788
2679
|
const fold = statusFold;
|
|
2789
2680
|
statusFold = null;
|
|
2681
|
+
const substance = cardSubstance(fold);
|
|
2682
|
+
if (lastPrintedCardByRunId.get(fold.runId) === substance) return "";
|
|
2683
|
+
lastPrintedCardByRunId.set(fold.runId, substance);
|
|
2790
2684
|
const prevLog = lastEmittedLogByRunId.get(fold.runId);
|
|
2791
|
-
const
|
|
2792
|
-
if (fold.
|
|
2685
|
+
const changed = Boolean(fold.logKey) && fold.logKey !== prevLog;
|
|
2686
|
+
if (changed && runShowsLogTail(fold.status)) {
|
|
2793
2687
|
lastEmittedLogByRunId.set(fold.runId, fold.logKey);
|
|
2794
2688
|
}
|
|
2795
|
-
return formatFoldedControlStatusCard(
|
|
2796
|
-
{
|
|
2797
|
-
runId: fold.runId,
|
|
2798
|
-
status: fold.status,
|
|
2799
|
-
agentName: fold.agentName,
|
|
2800
|
-
errorMessage: fold.errorMessage,
|
|
2801
|
-
logLines: fold.logLines,
|
|
2802
|
-
pollCount: fold.pollCount,
|
|
2803
|
-
elapsedMs: fold.elapsedMs,
|
|
2804
|
-
includeLogTail
|
|
2805
|
-
},
|
|
2806
|
-
colorEnabled
|
|
2807
|
-
);
|
|
2689
|
+
return formatFoldedControlStatusCard({ ...fold, includeLogTail: changed }, colorEnabled);
|
|
2808
2690
|
};
|
|
2809
|
-
const
|
|
2810
|
-
let out =
|
|
2691
|
+
const flushToolBuffers = () => {
|
|
2692
|
+
let out = "";
|
|
2811
2693
|
if (readBuffer.length > 0) {
|
|
2812
2694
|
const items = readBuffer.map((evt) => {
|
|
2813
2695
|
const call = pending.get(evt.toolCallId);
|
|
@@ -2863,6 +2745,12 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2863
2745
|
}
|
|
2864
2746
|
return out;
|
|
2865
2747
|
};
|
|
2748
|
+
const flushBuffers = () => `${flushStatusFold()}${flushToolBuffers()}`;
|
|
2749
|
+
const bufferToolResult = (buffer, event) => {
|
|
2750
|
+
const flushed = flushStatusFold();
|
|
2751
|
+
buffer.push(event);
|
|
2752
|
+
return flushed;
|
|
2753
|
+
};
|
|
2866
2754
|
const formatter = (event) => {
|
|
2867
2755
|
if (mode === "hide") return "";
|
|
2868
2756
|
if (mode === "verbose") return formatVerboseToolEvent(event, colorEnabled);
|
|
@@ -2877,28 +2765,13 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2877
2765
|
if (event.type === "tool-result") {
|
|
2878
2766
|
const snapshot = parseControlAgentRunStatusEvent(event);
|
|
2879
2767
|
if (snapshot) {
|
|
2880
|
-
let out =
|
|
2881
|
-
|
|
2768
|
+
let out = flushToolBuffers();
|
|
2769
|
+
const open = statusFold;
|
|
2770
|
+
const sameRun = open?.runId === snapshot.runId;
|
|
2771
|
+
if (open && (!sameRun || open.status !== snapshot.status)) {
|
|
2882
2772
|
out += flushStatusFold();
|
|
2883
2773
|
}
|
|
2884
|
-
|
|
2885
|
-
statusFold = {
|
|
2886
|
-
...snapshot,
|
|
2887
|
-
pollCount: 1,
|
|
2888
|
-
elapsedMs: event.elapsedMs
|
|
2889
|
-
};
|
|
2890
|
-
} else {
|
|
2891
|
-
statusFold = {
|
|
2892
|
-
runId: snapshot.runId,
|
|
2893
|
-
status: snapshot.status,
|
|
2894
|
-
agentName: snapshot.agentName,
|
|
2895
|
-
errorMessage: snapshot.errorMessage ?? statusFold.errorMessage,
|
|
2896
|
-
logLines: snapshot.logLines ?? statusFold.logLines,
|
|
2897
|
-
logKey: snapshot.logKey || statusFold.logKey,
|
|
2898
|
-
pollCount: statusFold.pollCount + 1,
|
|
2899
|
-
elapsedMs: event.elapsedMs
|
|
2900
|
-
};
|
|
2901
|
-
}
|
|
2774
|
+
statusFold = open && sameRun ? mergeRunSnapshot(open, snapshot) : snapshot;
|
|
2902
2775
|
pending.delete(event.toolCallId);
|
|
2903
2776
|
if (isAgentRunTerminalStatus(snapshot.status)) {
|
|
2904
2777
|
out += flushBuffers();
|
|
@@ -2920,8 +2793,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2920
2793
|
return "";
|
|
2921
2794
|
}
|
|
2922
2795
|
if (event.type === "tool-result") {
|
|
2923
|
-
readBuffer
|
|
2924
|
-
return "";
|
|
2796
|
+
return bufferToolResult(readBuffer, event);
|
|
2925
2797
|
}
|
|
2926
2798
|
}
|
|
2927
2799
|
if (isSearchToolName(event.toolName)) {
|
|
@@ -2933,8 +2805,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2933
2805
|
return "";
|
|
2934
2806
|
}
|
|
2935
2807
|
if (event.type === "tool-result") {
|
|
2936
|
-
searchBuffer
|
|
2937
|
-
return "";
|
|
2808
|
+
return bufferToolResult(searchBuffer, event);
|
|
2938
2809
|
}
|
|
2939
2810
|
}
|
|
2940
2811
|
if (isRunToolName(event.toolName)) {
|
|
@@ -2952,8 +2823,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2952
2823
|
return "";
|
|
2953
2824
|
}
|
|
2954
2825
|
if (event.type === "tool-result") {
|
|
2955
|
-
runBuffer
|
|
2956
|
-
return "";
|
|
2826
|
+
return bufferToolResult(runBuffer, event);
|
|
2957
2827
|
}
|
|
2958
2828
|
}
|
|
2959
2829
|
if (isFetchToolName(event.toolName)) {
|
|
@@ -2965,8 +2835,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2965
2835
|
return "";
|
|
2966
2836
|
}
|
|
2967
2837
|
if (event.type === "tool-result") {
|
|
2968
|
-
fetchBuffer
|
|
2969
|
-
return "";
|
|
2838
|
+
return bufferToolResult(fetchBuffer, event);
|
|
2970
2839
|
}
|
|
2971
2840
|
}
|
|
2972
2841
|
if (isWebSearchToolName(event.toolName)) {
|
|
@@ -2978,8 +2847,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2978
2847
|
return "";
|
|
2979
2848
|
}
|
|
2980
2849
|
if (event.type === "tool-result") {
|
|
2981
|
-
webSearchBuffer
|
|
2982
|
-
return "";
|
|
2850
|
+
return bufferToolResult(webSearchBuffer, event);
|
|
2983
2851
|
}
|
|
2984
2852
|
}
|
|
2985
2853
|
const flushed = flushBuffers();
|
|
@@ -3038,6 +2906,12 @@ function createSseToolEventAdapter(onEvent) {
|
|
|
3038
2906
|
type: "tool-result",
|
|
3039
2907
|
toolCallId,
|
|
3040
2908
|
toolName,
|
|
2909
|
+
// The full payload, not just the clipped summary. Consumers that parse
|
|
2910
|
+
// structured results — the agent-run snapshot parser feeding the dock
|
|
2911
|
+
// panel, the orchestration card renderer, ask_user — all read
|
|
2912
|
+
// `content`; dropping it here made every one of them silently inert on
|
|
2913
|
+
// the HTTP/SSE path while working on the local path.
|
|
2914
|
+
...rawContent ? { content: rawContent } : {},
|
|
3041
2915
|
summary,
|
|
3042
2916
|
metadata: payload.metadata,
|
|
3043
2917
|
round
|
|
@@ -3061,6 +2935,11 @@ function formatElapsed(totalSeconds) {
|
|
|
3061
2935
|
const mins = minutes % 60;
|
|
3062
2936
|
return `${hours}h ${mins}m`;
|
|
3063
2937
|
}
|
|
2938
|
+
function truncateThinkingHint(text, maxLen) {
|
|
2939
|
+
const cleaned = text.replace(/\n/g, " ").trim();
|
|
2940
|
+
if (cleaned.length <= maxLen) return cleaned;
|
|
2941
|
+
return "\u2026" + cleaned.slice(cleaned.length - maxLen + 1);
|
|
2942
|
+
}
|
|
3064
2943
|
var Spinner = class {
|
|
3065
2944
|
constructor(output, text, silent = false) {
|
|
3066
2945
|
this.output = output;
|
|
@@ -3074,6 +2953,7 @@ var Spinner = class {
|
|
|
3074
2953
|
frameIndex = 0;
|
|
3075
2954
|
frames = ["\xB7", "~", "\u2248", "\u223F", "\u2248", "~"];
|
|
3076
2955
|
isTTY;
|
|
2956
|
+
thinkingHint = "";
|
|
3077
2957
|
start() {
|
|
3078
2958
|
if (this.silent) {
|
|
3079
2959
|
this.startTime = Date.now();
|
|
@@ -3109,9 +2989,11 @@ ${this.text}
|
|
|
3109
2989
|
this.output.write("\r\x1B[K");
|
|
3110
2990
|
this.output.write("\x1B[?25h");
|
|
3111
2991
|
}
|
|
2992
|
+
this.thinkingHint = "";
|
|
3112
2993
|
}
|
|
3113
2994
|
show(text) {
|
|
3114
2995
|
this.text = text;
|
|
2996
|
+
this.thinkingHint = "";
|
|
3115
2997
|
if (this.silent) {
|
|
3116
2998
|
if (!this.startTime) {
|
|
3117
2999
|
this.startTime = Date.now();
|
|
@@ -3127,20 +3009,30 @@ ${this.text}
|
|
|
3127
3009
|
this.startTime = Date.now();
|
|
3128
3010
|
this.output.write(`\r${this.renderLine(this.frames[0])}`);
|
|
3129
3011
|
}
|
|
3012
|
+
/**
|
|
3013
|
+
* Update the thinking hint displayed on the spinner line. The hint is
|
|
3014
|
+
* truncated to a reasonable length and shown as part of the spinner text.
|
|
3015
|
+
* Only meaningful while the spinner is active (TTY mode).
|
|
3016
|
+
*/
|
|
3017
|
+
setThinkingHint(text) {
|
|
3018
|
+
this.thinkingHint = text;
|
|
3019
|
+
if (this.silent || !this.isTTY || !this.timer) return;
|
|
3020
|
+
this.output.write(`\r${this.renderLine(this.frames[this.frameIndex])}`);
|
|
3021
|
+
}
|
|
3130
3022
|
renderLine(frame) {
|
|
3131
3023
|
const elapsedSeconds = Math.max(
|
|
3132
3024
|
0,
|
|
3133
3025
|
Math.floor((Date.now() - this.startTime) / 1e3)
|
|
3134
3026
|
);
|
|
3135
|
-
|
|
3027
|
+
const thinkingPart = this.thinkingHint ? `: ${truncateThinkingHint(this.thinkingHint, 60)}` : "";
|
|
3028
|
+
return `${themeColorSequence("accent")}${frame}\x1B[39m ${this.text}${thinkingPart} (${formatElapsed(elapsedSeconds)})`;
|
|
3136
3029
|
}
|
|
3137
3030
|
};
|
|
3138
3031
|
|
|
3139
3032
|
// packages/cli/client/agentRunOutput.ts
|
|
3140
|
-
function formatAssistantResponseForCli(text
|
|
3141
|
-
const thinkingMode = resolveThinkingDisplayMode(options.env);
|
|
3033
|
+
function formatAssistantResponseForCli(text) {
|
|
3142
3034
|
return formatAssistantDisplay(
|
|
3143
|
-
formatAssistantTextForCli(text
|
|
3035
|
+
formatAssistantTextForCli(text)
|
|
3144
3036
|
);
|
|
3145
3037
|
}
|
|
3146
3038
|
function resolveAgentEventMode(options) {
|
|
@@ -3173,12 +3065,19 @@ function createCliTurnOutput(params) {
|
|
|
3173
3065
|
let streamedAssistantText = false;
|
|
3174
3066
|
let everStreamedAnyText = false;
|
|
3175
3067
|
let printedAssistantLabel = false;
|
|
3176
|
-
|
|
3068
|
+
let thinkState = createThinkParserState();
|
|
3177
3069
|
const renderWriter = createRenderAwareStreamWriter({
|
|
3178
3070
|
write: (chunk) => options.output.write(chunk)
|
|
3179
3071
|
});
|
|
3180
3072
|
const writeVisibleAssistantChunk = (chunk) => {
|
|
3181
3073
|
if (!chunk) return;
|
|
3074
|
+
const parsed = processThinkChunk(chunk, thinkState);
|
|
3075
|
+
thinkState = parsed.state;
|
|
3076
|
+
if (!parsed.content && !parsed.reasoning) return;
|
|
3077
|
+
if (parsed.reasoning) {
|
|
3078
|
+
spinner.setThinkingHint(parsed.reasoning);
|
|
3079
|
+
}
|
|
3080
|
+
if (!parsed.content) return;
|
|
3182
3081
|
spinner.stop();
|
|
3183
3082
|
options.activityReporter?.(null);
|
|
3184
3083
|
if (!printedAssistantLabel) {
|
|
@@ -3188,17 +3087,8 @@ ${options.agentName} > `);
|
|
|
3188
3087
|
}
|
|
3189
3088
|
streamedAssistantText = true;
|
|
3190
3089
|
everStreamedAnyText = true;
|
|
3191
|
-
renderWriter.push(
|
|
3090
|
+
renderWriter.push(parsed.content);
|
|
3192
3091
|
};
|
|
3193
|
-
const thinkingFilter = createThinkingAwareStreamFilter(
|
|
3194
|
-
writeVisibleAssistantChunk,
|
|
3195
|
-
thinkingMode
|
|
3196
|
-
);
|
|
3197
|
-
const thinkingSink = createThinkingEventSink((chunk) => {
|
|
3198
|
-
spinner.stop();
|
|
3199
|
-
options.activityReporter?.(null);
|
|
3200
|
-
options.output.write(chunk);
|
|
3201
|
-
}, thinkingMode);
|
|
3202
3092
|
const handleToolEvent = (event) => {
|
|
3203
3093
|
if (!traceLocalTools) return;
|
|
3204
3094
|
const chunk = eventMode === "jsonl" ? formatToolJsonEvent(event) : formatToolEvent(event);
|
|
@@ -3207,7 +3097,6 @@ ${options.agentName} > `);
|
|
|
3207
3097
|
return;
|
|
3208
3098
|
}
|
|
3209
3099
|
if (event.type === "tool-call") {
|
|
3210
|
-
thinkingFilter.flush();
|
|
3211
3100
|
renderWriter.flush();
|
|
3212
3101
|
}
|
|
3213
3102
|
spinner.stop();
|
|
@@ -3224,16 +3113,15 @@ ${options.agentName} > `);
|
|
|
3224
3113
|
spinner.show(activeLabel);
|
|
3225
3114
|
options.activityReporter?.(activeLabel);
|
|
3226
3115
|
}
|
|
3227
|
-
if (
|
|
3228
|
-
const
|
|
3229
|
-
if (
|
|
3230
|
-
options.onAgentRunStatus(snapshot);
|
|
3116
|
+
if (options.onAgentRunStatus) {
|
|
3117
|
+
const parsed = parseAgentRunEvent(event);
|
|
3118
|
+
if (parsed) {
|
|
3119
|
+
options.onAgentRunStatus(parsed.snapshot);
|
|
3231
3120
|
}
|
|
3232
3121
|
}
|
|
3233
3122
|
};
|
|
3234
3123
|
return {
|
|
3235
3124
|
spinner,
|
|
3236
|
-
thinkingMode,
|
|
3237
3125
|
toolDisplayMode,
|
|
3238
3126
|
traceLocalTools,
|
|
3239
3127
|
eventMode,
|
|
@@ -3244,10 +3132,10 @@ ${options.agentName} > `);
|
|
|
3244
3132
|
options.output.write(pendingToolOutput);
|
|
3245
3133
|
}
|
|
3246
3134
|
}
|
|
3247
|
-
|
|
3135
|
+
writeVisibleAssistantChunk(chunk);
|
|
3248
3136
|
},
|
|
3249
3137
|
pushThinking(chunk) {
|
|
3250
|
-
|
|
3138
|
+
spinner.setThinkingHint(chunk);
|
|
3251
3139
|
},
|
|
3252
3140
|
handleToolEvent,
|
|
3253
3141
|
showWorking(label) {
|
|
@@ -3258,19 +3146,22 @@ ${options.agentName} > `);
|
|
|
3258
3146
|
finish(fallbackContent) {
|
|
3259
3147
|
spinner.stop();
|
|
3260
3148
|
options.activityReporter?.(null);
|
|
3149
|
+
const flushedThink = flushThinkParser(thinkState);
|
|
3150
|
+
thinkState = flushedThink.state;
|
|
3151
|
+
if (flushedThink.content) {
|
|
3152
|
+
writeVisibleAssistantChunk(flushedThink.content);
|
|
3153
|
+
}
|
|
3261
3154
|
const pendingToolOutput = formatToolEvent.flush ? formatToolEvent.flush() : "";
|
|
3262
3155
|
if (pendingToolOutput) {
|
|
3263
3156
|
options.output.write(pendingToolOutput);
|
|
3264
3157
|
}
|
|
3265
3158
|
if (streamedAssistantText) {
|
|
3266
|
-
thinkingFilter.flush();
|
|
3267
3159
|
renderWriter.flush();
|
|
3268
3160
|
options.output.write("\n");
|
|
3269
3161
|
} else if (everStreamedAnyText) {
|
|
3270
|
-
thinkingFilter.flush();
|
|
3271
3162
|
options.output.write("\n");
|
|
3272
3163
|
} else {
|
|
3273
|
-
const content = fallbackContent ? formatAssistantResponseForCli(fallbackContent.trim()
|
|
3164
|
+
const content = fallbackContent ? formatAssistantResponseForCli(fallbackContent.trim()) : "";
|
|
3274
3165
|
if (content) {
|
|
3275
3166
|
options.output.write(`
|
|
3276
3167
|
${options.agentName} > ${content}
|
|
@@ -3284,35 +3175,6 @@ ${options.agentName} > (no text response)
|
|
|
3284
3175
|
}
|
|
3285
3176
|
};
|
|
3286
3177
|
}
|
|
3287
|
-
function extractAgentRunStatusSnapshot(event) {
|
|
3288
|
-
if (event.type !== "tool-result") return null;
|
|
3289
|
-
const content = typeof event.content === "string" ? event.content.trim() : "";
|
|
3290
|
-
if (!content.startsWith("{")) return null;
|
|
3291
|
-
try {
|
|
3292
|
-
const parsed = JSON.parse(content);
|
|
3293
|
-
const runId = typeof parsed.runId === "string" ? parsed.runId : "";
|
|
3294
|
-
const status = typeof parsed.status === "string" ? parsed.status : "running";
|
|
3295
|
-
const label = resolveRunLabel({
|
|
3296
|
-
agentName: parsed.agentName,
|
|
3297
|
-
name: parsed.name,
|
|
3298
|
-
agentKey: parsed.agentKey
|
|
3299
|
-
});
|
|
3300
|
-
const agentName = isAgentNameFallback(label) ? void 0 : label;
|
|
3301
|
-
const logTail = typeof parsed.logTail === "string" ? parsed.logTail : void 0;
|
|
3302
|
-
const logLines = Array.isArray(parsed.logLines) ? parsed.logLines : void 0;
|
|
3303
|
-
const errorMessage = typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
|
|
3304
|
-
return {
|
|
3305
|
-
runId,
|
|
3306
|
-
agentName,
|
|
3307
|
-
status,
|
|
3308
|
-
logTail,
|
|
3309
|
-
logLines,
|
|
3310
|
-
errorMessage
|
|
3311
|
-
};
|
|
3312
|
-
} catch {
|
|
3313
|
-
return null;
|
|
3314
|
-
}
|
|
3315
|
-
}
|
|
3316
3178
|
|
|
3317
3179
|
// packages/cli/client/agentRunStream.ts
|
|
3318
3180
|
async function readStreamingAgentRun(options, res, existingSpinner) {
|
|
@@ -3695,7 +3557,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
|
|
|
3695
3557
|
// packages/cli/client/agentRun.ts
|
|
3696
3558
|
import { ulid } from "ulid";
|
|
3697
3559
|
async function loadRunLocalAgentTurn() {
|
|
3698
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
3560
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-7WYWCGL4.js");
|
|
3699
3561
|
return runLocalAgentTurn;
|
|
3700
3562
|
}
|
|
3701
3563
|
async function resolveCurrentMachineId(options) {
|
|
@@ -3722,7 +3584,8 @@ function buildDefaultLocalRuntimeAdapter(options) {
|
|
|
3722
3584
|
output: options.output,
|
|
3723
3585
|
...options.confirmDestructiveAction ? { confirmDestructiveAction: options.confirmDestructiveAction } : {},
|
|
3724
3586
|
...options.requestUserChoice ? { requestUserChoice: options.requestUserChoice } : {},
|
|
3725
|
-
...options.pastedTextStore?.items.size ? { pastedTextStore: options.pastedTextStore } : {}
|
|
3587
|
+
...options.pastedTextStore?.items.size ? { pastedTextStore: options.pastedTextStore } : {},
|
|
3588
|
+
...options.activityReporter ? { activityReporter: options.activityReporter } : {}
|
|
3726
3589
|
});
|
|
3727
3590
|
}
|
|
3728
3591
|
function resolveLocalRuntimeAdapter(options) {
|
|
@@ -3961,6 +3824,7 @@ async function runHttpAgentTurn(options, authToken) {
|
|
|
3961
3824
|
runtime: "bun",
|
|
3962
3825
|
entrypoint: "nolo-cli",
|
|
3963
3826
|
capabilities: ["text-io", "streaming", "slash-commands"],
|
|
3827
|
+
...options.dialogAgentMode ? { dialogAgentMode: options.dialogAgentMode } : {},
|
|
3964
3828
|
...subjectRefs ? { subjectRefs } : {},
|
|
3965
3829
|
...allowedChildAgentKeys?.length ? { allowedChildAgentKeys } : {},
|
|
3966
3830
|
...blockedToolNames?.length ? { blockedToolNames } : {},
|
|
@@ -4063,8 +3927,7 @@ async function runHttpAgentTurn(options, authToken) {
|
|
|
4063
3927
|
return dialogIdText ? { exitCode: 1, dialogId: dialogIdText } : { exitCode: 1 };
|
|
4064
3928
|
}
|
|
4065
3929
|
const content = formatAssistantResponseForCli(
|
|
4066
|
-
String(data?.content ?? data?.message ?? "")
|
|
4067
|
-
options
|
|
3930
|
+
String(data?.content ?? data?.message ?? "")
|
|
4068
3931
|
);
|
|
4069
3932
|
if (content) {
|
|
4070
3933
|
options.output.write(`
|
|
@@ -4123,8 +3986,9 @@ async function runLocalAgentTurnForCli(options, settings) {
|
|
|
4123
3986
|
const blockedToolNames = options.blockedToolNames?.filter(
|
|
4124
3987
|
(name) => name.trim()
|
|
4125
3988
|
);
|
|
4126
|
-
const runtimeContext = subjectRefs || allowedChildAgentKeys?.length || allowedToolNames?.length || blockedToolNames?.length || options.parentWakeOnTerminal ? {
|
|
3989
|
+
const runtimeContext = subjectRefs || allowedChildAgentKeys?.length || allowedToolNames?.length || blockedToolNames?.length || options.parentWakeOnTerminal || options.dialogAgentMode ? {
|
|
4127
3990
|
...subjectRefs ? { subjectRefs } : {},
|
|
3991
|
+
...options.dialogAgentMode ? { dialogAgentMode: options.dialogAgentMode } : {},
|
|
4128
3992
|
...allowedChildAgentKeys?.length ? { allowedChildAgentKeys } : {},
|
|
4129
3993
|
...allowedToolNames?.length ? { allowedToolNames } : {},
|
|
4130
3994
|
...blockedToolNames?.length ? { blockedToolNames } : {},
|
|
@@ -4133,7 +3997,7 @@ async function runLocalAgentTurnForCli(options, settings) {
|
|
|
4133
3997
|
} : void 0;
|
|
4134
3998
|
const currentDialogId = options.continueDialogId ?? ulid();
|
|
4135
3999
|
const runChildTurn = async (input) => {
|
|
4136
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
4000
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-7WYWCGL4.js");
|
|
4137
4001
|
return runLocalAgentTurn(input);
|
|
4138
4002
|
};
|
|
4139
4003
|
const createFreshChildBaseAdapter = () => {
|
|
@@ -4905,6 +4769,7 @@ var resolveMemoryRuntime = async (input) => {
|
|
|
4905
4769
|
userId: input.userId,
|
|
4906
4770
|
spaceId: input.spaceId,
|
|
4907
4771
|
agentKey: input.agentKey,
|
|
4772
|
+
memorySubjectId: input.memorySubjectId,
|
|
4908
4773
|
policy
|
|
4909
4774
|
}),
|
|
4910
4775
|
kinds: ["episodic", "semantic", "procedural"],
|
|
@@ -5409,31 +5274,6 @@ ${mdContent}`);
|
|
|
5409
5274
|
}
|
|
5410
5275
|
return result.exitCode;
|
|
5411
5276
|
}
|
|
5412
|
-
var QUOTA_ERROR_PATTERNS = [
|
|
5413
|
-
/429/,
|
|
5414
|
-
/quota/i,
|
|
5415
|
-
/rate\s*limit/i,
|
|
5416
|
-
/too\s*many\s*requests/i,
|
|
5417
|
-
/额度/,
|
|
5418
|
-
/上限/,
|
|
5419
|
-
/用尽/,
|
|
5420
|
-
/CliProviderQuotaError/i
|
|
5421
|
-
];
|
|
5422
|
-
function isQuotaExhaustedError(error) {
|
|
5423
|
-
if (!error) return false;
|
|
5424
|
-
if (error instanceof CliProviderQuotaError) return true;
|
|
5425
|
-
if (error instanceof Error) {
|
|
5426
|
-
return QUOTA_ERROR_PATTERNS.some((pattern) => pattern.test(error.message));
|
|
5427
|
-
}
|
|
5428
|
-
if (typeof error === "string") {
|
|
5429
|
-
return QUOTA_ERROR_PATTERNS.some((pattern) => pattern.test(error));
|
|
5430
|
-
}
|
|
5431
|
-
const maybeStatus = error.status;
|
|
5432
|
-
if (typeof maybeStatus === "number" && maybeStatus === 429) return true;
|
|
5433
|
-
const maybeStatusCode = error.statusCode;
|
|
5434
|
-
if (typeof maybeStatusCode === "number" && maybeStatusCode === 429) return true;
|
|
5435
|
-
return false;
|
|
5436
|
-
}
|
|
5437
5277
|
var BALANCE_ERROR_PATTERNS = [
|
|
5438
5278
|
/UPSTREAM_402/i,
|
|
5439
5279
|
/Insufficient Balance/i,
|
|
@@ -5468,6 +5308,7 @@ export {
|
|
|
5468
5308
|
takeDisplayWidth,
|
|
5469
5309
|
padOrTruncateToWidth,
|
|
5470
5310
|
wrapTranscriptLine,
|
|
5311
|
+
buildWindowTitle,
|
|
5471
5312
|
wrapTextToLines,
|
|
5472
5313
|
THEME_PALETTES,
|
|
5473
5314
|
getActiveThemeName,
|
|
@@ -5476,6 +5317,7 @@ export {
|
|
|
5476
5317
|
setActiveBrightness,
|
|
5477
5318
|
getActiveDensity,
|
|
5478
5319
|
setActiveDensity,
|
|
5320
|
+
detectSystemBrightnessFromEnv,
|
|
5479
5321
|
resolveTuiBrightness,
|
|
5480
5322
|
setActiveTerminalBaseHex,
|
|
5481
5323
|
applyDetectedBackground,
|
|
@@ -5483,7 +5325,6 @@ export {
|
|
|
5483
5325
|
themeColorSequence,
|
|
5484
5326
|
themeText,
|
|
5485
5327
|
formatAssistantDisplay,
|
|
5486
|
-
normalizeThinkingDisplayMode,
|
|
5487
5328
|
normalizeToolDisplayMode,
|
|
5488
5329
|
COLLAPSED_PASTE_PLACEHOLDER_RE,
|
|
5489
5330
|
shouldCollapsePaste,
|
|
@@ -5503,6 +5344,5 @@ export {
|
|
|
5503
5344
|
normalizeCliImageInput,
|
|
5504
5345
|
inspectLocalRunWorkspace,
|
|
5505
5346
|
runAgentRunCommand,
|
|
5506
|
-
isQuotaExhaustedError,
|
|
5507
5347
|
isBalanceExhaustedError
|
|
5508
5348
|
};
|