nolo-cli 0.15.0 → 0.16.0-alpha.10
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-QAUS6B7J.js → _executeModel-6BR65FSI.js} +29 -28
- package/{action-GUOZYYGN.js → action-F5JACQBG.js} +4 -4
- package/{addContentAction-QDGHGUBH.js → addContentAction-AQXEYRBE.js} +3 -3
- package/{addDialogAgentAction-Z4YCYZIV.js → addDialogAgentAction-EJHHJZWW.js} +2 -2
- package/{agentDeleteCommand-QDO62EZA.js → agentDeleteCommand-PBIUC4FT.js} +18 -17
- package/{agentEmailCommands-UZ5BKX3P.js → agentEmailCommands-KNZY4HXV.js} +35 -34
- package/{agentListCommands-ZC33UDWT.js → agentListCommands-N64PHBXM.js} +20 -19
- package/{agentMachineCommands-RZGZEZRL.js → agentMachineCommands-2AIPJKFM.js} +18 -17
- package/{agentRecordCommands-DGDXE2VH.js → agentRecordCommands-TB4N7YSB.js} +34 -33
- package/{agentRunCommand-SRZWFOPH.js → agentRunCommand-UVW2ZLKT.js} +34 -33
- package/{agentRuntimeLocal-4YCF6IRF.js → agentRuntimeLocal-T6YECTNF.js} +15 -16
- package/{agentSlice-IVE735EV.js → agentSlice-533PEM4O.js} +3 -3
- package/{appDeleteCommands-7I26L64I.js → appDeleteCommands-D6B6Z4ZQ.js} +19 -18
- package/{appDeployCommands-TZLZNTJN.js → appDeployCommands-YMO5FK4T.js} +19 -18
- package/{appDeployStatusCommands-OPPTLHRW.js → appDeployStatusCommands-EO5DWWPQ.js} +19 -18
- package/{appGetCommands-N2S4HYKY.js → appGetCommands-6SMZ3URQ.js} +19 -18
- package/{appListCommands-OBTPPKUM.js → appListCommands-RZXSWR2G.js} +19 -18
- package/{authCommand-YFTR3347.js → authCommand-MSSBXCQ6.js} +8 -2
- package/{chunk-OQMPU2ML.js → chunk-2OUI4TLC.js} +4 -4
- package/{chunk-SFXYKGK2.js → chunk-3S2VOMIF.js} +3 -3
- package/{chunk-JBKVPAYK.js → chunk-6KBBMW4D.js} +2 -2
- package/{chunk-U7LEGLEB.js → chunk-6N4KODMN.js} +1 -1
- package/{chunk-IZ2QRVEU.js → chunk-A7O4KKLZ.js} +3 -3
- package/{chunk-WA6KZL5V.js → chunk-AAODAAUQ.js} +23 -20
- package/{chunk-K53477EY.js → chunk-C4MMO7W4.js} +1 -1
- package/{chunk-YNHQIXX5.js → chunk-CXM4IIUF.js} +21 -21
- package/{chunk-JKWWVF2I.js → chunk-D3HVJJIA.js} +1 -1
- package/{chunk-XGQZFBO5.js → chunk-DBLHEQH7.js} +148 -175
- package/{chunk-TTGAVETO.js → chunk-EABWT43X.js} +2 -2
- package/{chunk-OKSYPTDZ.js → chunk-F3UOACU4.js} +1 -1
- package/{chunk-VE6XMVKG.js → chunk-G2IQGDQZ.js} +163 -53
- package/{chunk-RKM3K52F.js → chunk-GPELDE6I.js} +2 -2
- package/{chunk-OGGHETUE.js → chunk-HQPG2PIV.js} +62 -19
- package/{chunk-XVP3C2KY.js → chunk-IWLUTMYX.js} +1 -1
- package/{chunk-B4KT7RN2.js → chunk-JTMNCCWF.js} +2 -2
- package/chunk-KFEVY3ST.js +255 -0
- package/{chunk-WNLPAOIT.js → chunk-KFHN5NGJ.js} +1 -1
- package/{chunk-P4MJQWWF.js → chunk-KPD4CEQD.js} +2 -2
- package/{chunk-G2MKOQCB.js → chunk-KPJWHHG4.js} +1 -1
- package/{chunk-ISYE6GZB.js → chunk-L6NVTGI7.js} +1 -1
- package/{chunk-O53CP2QR.js → chunk-LCMAJFAD.js} +3 -3
- package/{chunk-UXKQQ2MR.js → chunk-LO6JNGCT.js} +3 -3
- package/{chunk-472E5RMQ.js → chunk-MSA4JAOZ.js} +1 -1
- package/{chunk-HRQCKQA5.js → chunk-MUCU6ATG.js} +8 -257
- package/{chunk-524BDL33.js → chunk-O6W2O2DA.js} +1 -15
- package/{chunk-4QQFLN5C.js → chunk-OVBVEXZ7.js} +4 -4
- package/{chunk-IOQ7IBPU.js → chunk-PU4LXVAC.js} +1 -1
- package/{chunk-Z24FGIU2.js → chunk-R4L524UB.js} +3 -3
- package/{chunk-4IJYA27C.js → chunk-RG2U2MTJ.js} +1 -1
- package/{chunk-6MHDWKOT.js → chunk-RIF3XLXK.js} +9 -5
- package/{chunk-IKXL2HZ3.js → chunk-RK5NYQEL.js} +1 -1
- package/{chunk-JS33TCQ3.js → chunk-RPDGJO4D.js} +2 -2
- package/{chunk-BFRVXJJJ.js → chunk-SI73WO7P.js} +10 -10
- package/{chunk-WRN5EQT7.js → chunk-T26DWCH5.js} +3 -3
- package/{chunk-EHLHSX7R.js → chunk-UB4RYYNQ.js} +9 -2
- package/{chunk-5VMYGIIL.js → chunk-VHXXRWNL.js} +23 -9
- package/{chunk-OOIN7HSO.js → chunk-XJITGCTM.js} +10 -1
- package/{chunk-AWDOJBHW.js → chunk-XJYXSTBK.js} +883 -174
- package/{chunk-V2J635L5.js → chunk-XOIF2TNF.js} +2 -2
- package/{chunk-VPTJB4HM.js → chunk-XPC5C7BK.js} +0 -3
- package/{chunk-NTC6I2FN.js → chunk-XRSPI6CP.js} +1 -1
- package/{chunk-N5424GSW.js → chunk-YJKXGHJ6.js} +1 -1
- package/chunk-ZHXJ6M7T.js +27 -0
- package/{chunk-6565R2TI.js → chunk-ZOQNJXMS.js} +23 -18
- package/{createAgentAutomationAction-TS6NNZ4X.js → createAgentAutomationAction-OARFMDWU.js} +13 -13
- package/{createDialogAction-5HVQ33EX.js → createDialogAction-4E6ALCDK.js} +14 -14
- package/{createPageAction-4F3ZGQJD.js → createPageAction-RS65DDRX.js} +13 -13
- package/{dbSlice-OP6UPXKA.js → dbSlice-7KQH6GOU.js} +2 -2
- package/{dialogCommands-3GEPXHFB.js → dialogCommands-DFY5HJ6M.js} +19 -18
- package/{dialogSlice-FAWUQDJW.js → dialogSlice-MS7OYWHW.js} +13 -13
- package/{docCreateCommands-ZE3S6BCP.js → docCreateCommands-5L76YTI2.js} +18 -17
- package/{docDeleteCommands-TW6PGTRT.js → docDeleteCommands-3GASP3VR.js} +19 -18
- package/{docReadCommands-LDXL3B6J.js → docReadCommands-ALA77AZM.js} +18 -17
- package/{docStore-2UHVWLTV.js → docStore-KYTKNGMU.js} +14 -14
- package/{docUpdateCommands-GYD6XI5O.js → docUpdateCommands-6AZGXE5M.js} +18 -17
- package/{getPricing-UGDJHI7M.js → getPricing-RYY6OBA4.js} +4 -4
- package/{handleSendMessageAction-LJPUYNOH.js → handleSendMessageAction-LHTGYRMN.js} +201 -15
- package/index.js +47 -47
- package/{machineCommands-OKNDYS3M.js → machineCommands-RDQQBA72.js} +33 -32
- package/{machineWsRunDispatch-ZX5AJ6FJ.js → machineWsRunDispatch-27RCTQQF.js} +33 -32
- package/{models-LSCRJJ6P.js → models-5K5G2CZI.js} +2 -2
- package/package.json +1 -1
- package/{read-HXHAZBKH.js → read-CN3TNXIP.js} +1 -1
- package/{readDocTool-VPBDTO4G.js → readDocTool-WF3675ED.js} +1 -1
- package/{readlineWorkspace-MB3ANKHM.js → readlineWorkspace-BTONC7NW.js} +177 -76
- package/{removeDialogAgentAction-HUFVN35S.js → removeDialogAgentAction-YDHBFEGI.js} +5 -5
- package/{runAgentClientLoop-A75BUU6D.js → runAgentClientLoop-Q4CL22BP.js} +26 -25
- package/{setDialogExtraReferencesAction-2VLGWQKG.js → setDialogExtraReferencesAction-LR6MSIXO.js} +2 -2
- package/{setPrimaryDialogAgentAction-VB4UV2CC.js → setPrimaryDialogAgentAction-IIVDCY5C.js} +5 -5
- package/{settingSlice-7JYPQNAC.js → settingSlice-O23YDK2O.js} +3 -3
- package/{spaceCommands-O3KJNCON.js → spaceCommands-AB2D7A2R.js} +18 -17
- package/{spaceSlice-444MFUP6.js → spaceSlice-XLJ4DRG6.js} +13 -13
- package/{streamAgentChatTurn-DJAE7USZ.js → streamAgentChatTurn-YYAAGLZL.js} +30 -32
- package/{tools-YB6LXSVN.js → tools-5UKY65R3.js} +20 -20
- package/{tuiSummaryLlmCaller-QQL3JA5I.js → tuiSummaryLlmCaller-VUNVBRX3.js} +7 -6
- package/{updateDialogTitleAction-6HGFBM64.js → updateDialogTitleAction-VNSUVPUZ.js} +13 -13
- package/chunk-BYXBJQAS.js +0 -0
|
@@ -16,19 +16,20 @@ import {
|
|
|
16
16
|
createCliLocalRuntimeAdapter,
|
|
17
17
|
getCliLocale,
|
|
18
18
|
isBuiltinNoloAgentRef,
|
|
19
|
+
parseAgentRunEvent,
|
|
19
20
|
t,
|
|
20
21
|
toolLabel
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-XJYXSTBK.js";
|
|
22
23
|
import {
|
|
23
24
|
getReadableCliDb
|
|
24
25
|
} from "./chunk-W4NVOSFF.js";
|
|
25
26
|
import {
|
|
26
27
|
readDbRecord,
|
|
27
28
|
resolveAgentRecordFromHybridStore
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-C4MMO7W4.js";
|
|
29
30
|
import {
|
|
30
31
|
normalizeAgentHandle
|
|
31
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-PU4LXVAC.js";
|
|
32
33
|
import {
|
|
33
34
|
NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
34
35
|
isLocalCliAgentKey
|
|
@@ -39,13 +40,15 @@ import {
|
|
|
39
40
|
} from "./chunk-LTRXGFMS.js";
|
|
40
41
|
import {
|
|
41
42
|
formatAgentListCard,
|
|
43
|
+
formatFinishedRunCard,
|
|
42
44
|
formatListRunsCard,
|
|
43
45
|
formatNotFoundRunCard,
|
|
44
46
|
formatStartRunCard,
|
|
45
47
|
formatStatusRunCard,
|
|
46
48
|
formatStopRunCard,
|
|
47
|
-
isAgentRunTerminalStatus
|
|
48
|
-
|
|
49
|
+
isAgentRunTerminalStatus,
|
|
50
|
+
runShowsLogTail
|
|
51
|
+
} from "./chunk-G2IQGDQZ.js";
|
|
49
52
|
import {
|
|
50
53
|
isGatewayHttpStatus
|
|
51
54
|
} from "./chunk-RQSOAMPJ.js";
|
|
@@ -54,7 +57,7 @@ import {
|
|
|
54
57
|
chooseMemoryOwners,
|
|
55
58
|
loadMemoryCandidatesFromDb,
|
|
56
59
|
resolveAgentMemoryPolicy
|
|
57
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-R4L524UB.js";
|
|
58
61
|
import {
|
|
59
62
|
parseExternalSkillMarkdown,
|
|
60
63
|
parseSkillDocProtocol
|
|
@@ -63,14 +66,14 @@ import {
|
|
|
63
66
|
API_REPORTED_COST_MULTIPLIER,
|
|
64
67
|
normalizeUsage,
|
|
65
68
|
parseUiAskChoiceContent
|
|
66
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-CXM4IIUF.js";
|
|
67
70
|
import {
|
|
68
71
|
buildSkillDiscoveryContextBlock
|
|
69
72
|
} from "./chunk-AS3ZQ3O2.js";
|
|
70
73
|
import {
|
|
71
74
|
buildPlatformChatCompletionRequest,
|
|
72
75
|
parsePlatformChatCompletionData
|
|
73
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-AAODAAUQ.js";
|
|
74
77
|
import {
|
|
75
78
|
resolveAgentRuntimeConfigFromRecord
|
|
76
79
|
} from "./chunk-OIQPORYI.js";
|
|
@@ -79,7 +82,7 @@ import {
|
|
|
79
82
|
LOCAL_TURN_ABORTED_CODE,
|
|
80
83
|
readActionGate,
|
|
81
84
|
readCommandActionGatePayload
|
|
82
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-RIF3XLXK.js";
|
|
83
86
|
import {
|
|
84
87
|
createThinkParserState,
|
|
85
88
|
flushThinkParser,
|
|
@@ -88,17 +91,17 @@ import {
|
|
|
88
91
|
import {
|
|
89
92
|
resolvePlatformAuthToken,
|
|
90
93
|
resolvePlatformChatCompletionsEndpoint
|
|
91
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-MUCU6ATG.js";
|
|
92
95
|
import {
|
|
93
96
|
DEFAULT_CONTEXT_WINDOW,
|
|
94
97
|
getModelContextWindow
|
|
95
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-OVBVEXZ7.js";
|
|
96
99
|
import {
|
|
97
100
|
clipCompactText
|
|
98
101
|
} from "./chunk-5MMAK75Q.js";
|
|
99
102
|
import {
|
|
100
103
|
findModelConfig
|
|
101
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-HQPG2PIV.js";
|
|
102
105
|
import {
|
|
103
106
|
buildMemoryOverlayLayer,
|
|
104
107
|
buildMemoryUseGuidanceLayer
|
|
@@ -140,7 +143,7 @@ import {
|
|
|
140
143
|
BUILTIN_NOLO_AGENT_KEY,
|
|
141
144
|
PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
|
|
142
145
|
PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
|
|
143
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-XPC5C7BK.js";
|
|
144
147
|
import {
|
|
145
148
|
asTrimmedString
|
|
146
149
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -153,7 +156,7 @@ import {
|
|
|
153
156
|
|
|
154
157
|
// packages/agent-runtime/quickChatIntentCore.ts
|
|
155
158
|
var INTENT_MODEL = "deepseek-v4-flash";
|
|
156
|
-
var INTENT_PROVIDER = "
|
|
159
|
+
var INTENT_PROVIDER = "nolo";
|
|
157
160
|
var QUICK_CHAT_INTENT_TIMEOUT_MS = 4e3;
|
|
158
161
|
var SHORT_GREETING_MAX_LENGTH = 20;
|
|
159
162
|
var SHORT_GREETING_PATTERN = /^(?:hi|hello|hey|hiya|yo|sup|howdy|嗨|哈喽|哈囉|你好|您好|在吗|在嘛|喂|早上好|中午好|下午好|晚上好|拜拜|再见|谢谢|thanks|thx|ok|好的|收到|了解)[!.。,、~~]?$/iu;
|
|
@@ -394,7 +397,7 @@ var PROVIDER_LOOKUP_ORDER = [
|
|
|
394
397
|
"mimo",
|
|
395
398
|
"gmi",
|
|
396
399
|
"google",
|
|
397
|
-
"
|
|
400
|
+
"nolo",
|
|
398
401
|
"mistral",
|
|
399
402
|
"vultr",
|
|
400
403
|
"deepinfra",
|
|
@@ -998,6 +1001,13 @@ function setActiveTerminalBaseHex(hex) {
|
|
|
998
1001
|
}
|
|
999
1002
|
activeTerminalBaseHex = readHexChannels(hex.replace(/^#/, "").toUpperCase()) ? hex.replace(/^#/, "").toUpperCase() : null;
|
|
1000
1003
|
}
|
|
1004
|
+
function applyDetectedBackground(detected) {
|
|
1005
|
+
const normalizedHex = detected.hex.replace(/^#/, "").toUpperCase();
|
|
1006
|
+
const changed = detected.brightness !== activeBrightness || normalizedHex !== activeTerminalBaseHex;
|
|
1007
|
+
setActiveBrightness(detected.brightness);
|
|
1008
|
+
setActiveTerminalBaseHex(detected.hex);
|
|
1009
|
+
return changed;
|
|
1010
|
+
}
|
|
1001
1011
|
function resolveTerminalBaseHex(brightness) {
|
|
1002
1012
|
return activeTerminalBaseHex ?? TERMINAL_BASE[brightness];
|
|
1003
1013
|
}
|
|
@@ -2121,22 +2131,6 @@ function isFailedToolResult(event) {
|
|
|
2121
2131
|
function isNeedsActionToolResult(event) {
|
|
2122
2132
|
return Boolean(event.metadata?.actionGate);
|
|
2123
2133
|
}
|
|
2124
|
-
function readRunAgentName(parsed) {
|
|
2125
|
-
const agentName = typeof parsed.agentName === "string" ? parsed.agentName.trim() : "";
|
|
2126
|
-
if (agentName) return agentName;
|
|
2127
|
-
const name = typeof parsed.name === "string" ? parsed.name.trim() : "";
|
|
2128
|
-
return name || "agent";
|
|
2129
|
-
}
|
|
2130
|
-
function readRunLogLines(parsed) {
|
|
2131
|
-
if (Array.isArray(parsed.logLines)) return parsed.logLines;
|
|
2132
|
-
if (typeof parsed.logTail === "string" && parsed.logTail.trim()) {
|
|
2133
|
-
return parsed.logTail.split("\n");
|
|
2134
|
-
}
|
|
2135
|
-
return void 0;
|
|
2136
|
-
}
|
|
2137
|
-
function readRunErrorMessage(parsed) {
|
|
2138
|
-
return typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
|
|
2139
|
-
}
|
|
2140
2134
|
function parseUiAskChoiceForCli(event) {
|
|
2141
2135
|
if (event.toolName !== "ui_ask_choice" && !event.metadata?.uiAskChoice) {
|
|
2142
2136
|
return null;
|
|
@@ -2239,70 +2233,84 @@ function formatToolTraceLine(text, colorEnabled, accent = "none") {
|
|
|
2239
2233
|
return `${dimCliText(text, true)}
|
|
2240
2234
|
`;
|
|
2241
2235
|
}
|
|
2242
|
-
function
|
|
2236
|
+
function renderRunCard(snapshot, opts) {
|
|
2237
|
+
const labels = agentRunCardLabels();
|
|
2238
|
+
const timing = { startedAt: snapshot.startedAt, finishedAt: snapshot.finishedAt };
|
|
2239
|
+
const name = snapshot.agentName ?? "agent";
|
|
2240
|
+
if (isAgentRunTerminalStatus(snapshot.status)) {
|
|
2241
|
+
return formatFinishedRunCard(name, snapshot.status, {
|
|
2242
|
+
runId: snapshot.runId,
|
|
2243
|
+
toolCallCount: snapshot.toolCallCount,
|
|
2244
|
+
lastToolNames: snapshot.lastToolNames,
|
|
2245
|
+
lastAssistantText: snapshot.lastAssistantText,
|
|
2246
|
+
errorMessage: snapshot.errorMessage,
|
|
2247
|
+
logLines: snapshot.logLines,
|
|
2248
|
+
timing,
|
|
2249
|
+
...opts?.includeLogTail !== void 0 ? { includeLogTail: opts.includeLogTail } : {},
|
|
2250
|
+
labels
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
return formatStatusRunCard(name, snapshot.status, {
|
|
2254
|
+
runId: snapshot.runId,
|
|
2255
|
+
toolCallCount: snapshot.toolCallCount,
|
|
2256
|
+
lastToolNames: snapshot.lastToolNames,
|
|
2257
|
+
lastAssistantText: snapshot.lastAssistantText,
|
|
2258
|
+
errorMessage: snapshot.errorMessage,
|
|
2259
|
+
logLines: snapshot.logLines,
|
|
2260
|
+
timing,
|
|
2261
|
+
...opts?.includeLogTail !== void 0 ? { includeLogTail: opts.includeLogTail } : {},
|
|
2262
|
+
labels
|
|
2263
|
+
});
|
|
2264
|
+
}
|
|
2265
|
+
function recoverOrchestrationCard(event, toolName) {
|
|
2266
|
+
const content = typeof event.content === "string" ? event.content : "";
|
|
2243
2267
|
const trimmed = content.trim();
|
|
2244
|
-
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return
|
|
2268
|
+
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return null;
|
|
2245
2269
|
const labels = agentRunCardLabels();
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2270
|
+
if (toolName === "listAgents") {
|
|
2271
|
+
try {
|
|
2272
|
+
const parsed = JSON.parse(trimmed);
|
|
2249
2273
|
const agents = Array.isArray(parsed.agents) ? parsed.agents : [];
|
|
2250
2274
|
return formatAgentListCard(agents);
|
|
2275
|
+
} catch {
|
|
2276
|
+
return null;
|
|
2251
2277
|
}
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
}
|
|
2257
|
-
if (toolName === "controlAgentRun") {
|
|
2278
|
+
}
|
|
2279
|
+
if (toolName === "controlAgentRun") {
|
|
2280
|
+
try {
|
|
2281
|
+
const parsed = JSON.parse(trimmed);
|
|
2258
2282
|
if (Array.isArray(parsed.runs)) {
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
if (parsed.found === false || status === "not_found") {
|
|
2264
|
-
return formatNotFoundRunCard(labels);
|
|
2265
|
-
}
|
|
2266
|
-
if (status === "killed" || status === "cancelled" || status === "cancelling") {
|
|
2267
|
-
return formatStopRunCard(status, labels);
|
|
2283
|
+
return formatListRunsCard(
|
|
2284
|
+
parsed.runs,
|
|
2285
|
+
labels
|
|
2286
|
+
);
|
|
2268
2287
|
}
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
logLines: readRunLogLines(parsed),
|
|
2272
|
-
labels
|
|
2273
|
-
});
|
|
2288
|
+
} catch {
|
|
2289
|
+
return null;
|
|
2274
2290
|
}
|
|
2275
|
-
} catch {
|
|
2276
2291
|
}
|
|
2277
|
-
|
|
2292
|
+
const parsedEvent = parseAgentRunEvent(event);
|
|
2293
|
+
if (!parsedEvent) return null;
|
|
2294
|
+
const { kind, snapshot } = parsedEvent;
|
|
2295
|
+
if (kind === "start") {
|
|
2296
|
+
return formatStartRunCard(snapshot.agentName ?? "agent", snapshot.status, {
|
|
2297
|
+
task: snapshot.taskPreview,
|
|
2298
|
+
runId: snapshot.runId,
|
|
2299
|
+
labels
|
|
2300
|
+
});
|
|
2301
|
+
}
|
|
2302
|
+
if (kind === "gone") return formatNotFoundRunCard(labels);
|
|
2303
|
+
if (kind === "stop") return formatStopRunCard(snapshot.status, labels);
|
|
2304
|
+
return renderRunCard(snapshot);
|
|
2278
2305
|
}
|
|
2279
2306
|
function parseControlAgentRunStatusEvent(event) {
|
|
2280
|
-
const
|
|
2281
|
-
|
|
2282
|
-
try {
|
|
2283
|
-
const parsed = JSON.parse(raw);
|
|
2284
|
-
if (Array.isArray(parsed.runs)) return null;
|
|
2285
|
-
const status = typeof parsed.status === "string" ? parsed.status : void 0;
|
|
2286
|
-
if (parsed.found === false || status === "not_found") return null;
|
|
2287
|
-
if (status === "killed" || status === "cancelled" || status === "cancelling") return null;
|
|
2288
|
-
if (!status) return null;
|
|
2289
|
-
const runId = typeof parsed.runId === "string" && parsed.runId.trim() ? parsed.runId.trim() : typeof event.metadata?.runId === "string" ? event.metadata.runId : "";
|
|
2290
|
-
if (!runId) return null;
|
|
2291
|
-
const agentName = readRunAgentName(parsed);
|
|
2292
|
-
const errorMessage = readRunErrorMessage(parsed);
|
|
2293
|
-
const logLines = readRunLogLines(parsed);
|
|
2294
|
-
const logKey = logLines && logLines.length > 0 ? logLines.join("\n") : "";
|
|
2295
|
-
return { runId, status, agentName, errorMessage, logLines, logKey };
|
|
2296
|
-
} catch {
|
|
2297
|
-
return null;
|
|
2298
|
-
}
|
|
2307
|
+
const parsed = parseAgentRunEvent(event);
|
|
2308
|
+
return parsed?.kind === "status" ? parsed.snapshot : null;
|
|
2299
2309
|
}
|
|
2300
2310
|
function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
|
|
2301
2311
|
const rawLabel = toolLabel(toolName);
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
rawDataStr = recoverOrchestrationDisplayFromContent(toolName, event.content);
|
|
2305
|
-
}
|
|
2312
|
+
const bakedCard = typeof event.metadata?.displayData === "string" && event.metadata.displayData.trim() ? event.metadata.displayData : "";
|
|
2313
|
+
const rawDataStr = recoverOrchestrationCard(event, toolName) || bakedCard || (typeof event.content === "string" ? event.content : "");
|
|
2306
2314
|
const failed = event.type === "tool-error" || isFailedToolResult(event) || Boolean(event.metadata?.failed) || /^Error:/i.test(rawDataStr.trim());
|
|
2307
2315
|
if (failed) {
|
|
2308
2316
|
const firstLine = rawDataStr.trim().split("\n")[0] || event.summary || event.message || t("toolFailed");
|
|
@@ -2338,16 +2346,22 @@ function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
|
|
|
2338
2346
|
}
|
|
2339
2347
|
return out;
|
|
2340
2348
|
}
|
|
2349
|
+
function mergeRunSnapshot(previous, next) {
|
|
2350
|
+
return {
|
|
2351
|
+
...previous,
|
|
2352
|
+
...next,
|
|
2353
|
+
errorMessage: next.errorMessage ?? previous.errorMessage,
|
|
2354
|
+
logLines: next.logLines ?? previous.logLines,
|
|
2355
|
+
logKey: next.logKey || previous.logKey,
|
|
2356
|
+
toolCallCount: next.toolCallCount ?? previous.toolCallCount,
|
|
2357
|
+
lastToolNames: next.lastToolNames ?? previous.lastToolNames,
|
|
2358
|
+
lastAssistantText: next.lastAssistantText ?? previous.lastAssistantText,
|
|
2359
|
+
startedAt: next.startedAt ?? previous.startedAt,
|
|
2360
|
+
finishedAt: next.finishedAt ?? previous.finishedAt
|
|
2361
|
+
};
|
|
2362
|
+
}
|
|
2341
2363
|
function formatFoldedControlStatusCard(snapshot, colorEnabled) {
|
|
2342
|
-
const
|
|
2343
|
-
const body = formatStatusRunCard(snapshot.agentName, snapshot.status, {
|
|
2344
|
-
errorMessage: snapshot.errorMessage,
|
|
2345
|
-
logLines: snapshot.logLines,
|
|
2346
|
-
pollCount: snapshot.pollCount,
|
|
2347
|
-
elapsedMs: snapshot.elapsedMs,
|
|
2348
|
-
includeLogTail: snapshot.includeLogTail,
|
|
2349
|
-
labels
|
|
2350
|
-
});
|
|
2364
|
+
const body = renderRunCard(snapshot, { includeLogTail: snapshot.includeLogTail });
|
|
2351
2365
|
return formatOrchestrationCardBlock(
|
|
2352
2366
|
{
|
|
2353
2367
|
type: "tool-result",
|
|
@@ -2355,8 +2369,7 @@ function formatFoldedControlStatusCard(snapshot, colorEnabled) {
|
|
|
2355
2369
|
toolCallId: `fold-${snapshot.runId}`,
|
|
2356
2370
|
toolName: "controlAgentRun",
|
|
2357
2371
|
content: "",
|
|
2358
|
-
metadata: { displayData: body }
|
|
2359
|
-
elapsedMs: snapshot.elapsedMs
|
|
2372
|
+
metadata: { displayData: body }
|
|
2360
2373
|
},
|
|
2361
2374
|
"controlAgentRun",
|
|
2362
2375
|
colorEnabled
|
|
@@ -2637,26 +2650,14 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2637
2650
|
const fold = statusFold;
|
|
2638
2651
|
statusFold = null;
|
|
2639
2652
|
const prevLog = lastEmittedLogByRunId.get(fold.runId);
|
|
2640
|
-
const
|
|
2641
|
-
if (fold.
|
|
2653
|
+
const changed = Boolean(fold.logKey) && fold.logKey !== prevLog;
|
|
2654
|
+
if (changed && runShowsLogTail(fold.status)) {
|
|
2642
2655
|
lastEmittedLogByRunId.set(fold.runId, fold.logKey);
|
|
2643
2656
|
}
|
|
2644
|
-
return formatFoldedControlStatusCard(
|
|
2645
|
-
{
|
|
2646
|
-
runId: fold.runId,
|
|
2647
|
-
status: fold.status,
|
|
2648
|
-
agentName: fold.agentName,
|
|
2649
|
-
errorMessage: fold.errorMessage,
|
|
2650
|
-
logLines: fold.logLines,
|
|
2651
|
-
pollCount: fold.pollCount,
|
|
2652
|
-
elapsedMs: fold.elapsedMs,
|
|
2653
|
-
includeLogTail
|
|
2654
|
-
},
|
|
2655
|
-
colorEnabled
|
|
2656
|
-
);
|
|
2657
|
+
return formatFoldedControlStatusCard({ ...fold, includeLogTail: changed }, colorEnabled);
|
|
2657
2658
|
};
|
|
2658
|
-
const
|
|
2659
|
-
let out =
|
|
2659
|
+
const flushToolBuffers = () => {
|
|
2660
|
+
let out = "";
|
|
2660
2661
|
if (readBuffer.length > 0) {
|
|
2661
2662
|
const items = readBuffer.map((evt) => {
|
|
2662
2663
|
const call = pending.get(evt.toolCallId);
|
|
@@ -2712,6 +2713,12 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2712
2713
|
}
|
|
2713
2714
|
return out;
|
|
2714
2715
|
};
|
|
2716
|
+
const flushBuffers = () => `${flushStatusFold()}${flushToolBuffers()}`;
|
|
2717
|
+
const bufferToolResult = (buffer, event) => {
|
|
2718
|
+
const flushed = flushStatusFold();
|
|
2719
|
+
buffer.push(event);
|
|
2720
|
+
return flushed;
|
|
2721
|
+
};
|
|
2715
2722
|
const formatter = (event) => {
|
|
2716
2723
|
if (mode === "hide") return "";
|
|
2717
2724
|
if (mode === "verbose") return formatVerboseToolEvent(event, colorEnabled);
|
|
@@ -2726,28 +2733,13 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2726
2733
|
if (event.type === "tool-result") {
|
|
2727
2734
|
const snapshot = parseControlAgentRunStatusEvent(event);
|
|
2728
2735
|
if (snapshot) {
|
|
2729
|
-
let out =
|
|
2730
|
-
|
|
2736
|
+
let out = flushToolBuffers();
|
|
2737
|
+
const open = statusFold;
|
|
2738
|
+
const sameRun = open?.runId === snapshot.runId;
|
|
2739
|
+
if (open && (!sameRun || open.status !== snapshot.status)) {
|
|
2731
2740
|
out += flushStatusFold();
|
|
2732
2741
|
}
|
|
2733
|
-
|
|
2734
|
-
statusFold = {
|
|
2735
|
-
...snapshot,
|
|
2736
|
-
pollCount: 1,
|
|
2737
|
-
elapsedMs: event.elapsedMs
|
|
2738
|
-
};
|
|
2739
|
-
} else {
|
|
2740
|
-
statusFold = {
|
|
2741
|
-
runId: snapshot.runId,
|
|
2742
|
-
status: snapshot.status,
|
|
2743
|
-
agentName: snapshot.agentName,
|
|
2744
|
-
errorMessage: snapshot.errorMessage ?? statusFold.errorMessage,
|
|
2745
|
-
logLines: snapshot.logLines ?? statusFold.logLines,
|
|
2746
|
-
logKey: snapshot.logKey || statusFold.logKey,
|
|
2747
|
-
pollCount: statusFold.pollCount + 1,
|
|
2748
|
-
elapsedMs: event.elapsedMs
|
|
2749
|
-
};
|
|
2750
|
-
}
|
|
2742
|
+
statusFold = open && sameRun ? mergeRunSnapshot(open, snapshot) : snapshot;
|
|
2751
2743
|
pending.delete(event.toolCallId);
|
|
2752
2744
|
if (isAgentRunTerminalStatus(snapshot.status)) {
|
|
2753
2745
|
out += flushBuffers();
|
|
@@ -2769,8 +2761,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2769
2761
|
return "";
|
|
2770
2762
|
}
|
|
2771
2763
|
if (event.type === "tool-result") {
|
|
2772
|
-
readBuffer
|
|
2773
|
-
return "";
|
|
2764
|
+
return bufferToolResult(readBuffer, event);
|
|
2774
2765
|
}
|
|
2775
2766
|
}
|
|
2776
2767
|
if (isSearchToolName(event.toolName)) {
|
|
@@ -2782,8 +2773,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2782
2773
|
return "";
|
|
2783
2774
|
}
|
|
2784
2775
|
if (event.type === "tool-result") {
|
|
2785
|
-
searchBuffer
|
|
2786
|
-
return "";
|
|
2776
|
+
return bufferToolResult(searchBuffer, event);
|
|
2787
2777
|
}
|
|
2788
2778
|
}
|
|
2789
2779
|
if (isRunToolName(event.toolName)) {
|
|
@@ -2801,8 +2791,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2801
2791
|
return "";
|
|
2802
2792
|
}
|
|
2803
2793
|
if (event.type === "tool-result") {
|
|
2804
|
-
runBuffer
|
|
2805
|
-
return "";
|
|
2794
|
+
return bufferToolResult(runBuffer, event);
|
|
2806
2795
|
}
|
|
2807
2796
|
}
|
|
2808
2797
|
if (isFetchToolName(event.toolName)) {
|
|
@@ -2814,8 +2803,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2814
2803
|
return "";
|
|
2815
2804
|
}
|
|
2816
2805
|
if (event.type === "tool-result") {
|
|
2817
|
-
fetchBuffer
|
|
2818
|
-
return "";
|
|
2806
|
+
return bufferToolResult(fetchBuffer, event);
|
|
2819
2807
|
}
|
|
2820
2808
|
}
|
|
2821
2809
|
if (isWebSearchToolName(event.toolName)) {
|
|
@@ -2827,8 +2815,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2827
2815
|
return "";
|
|
2828
2816
|
}
|
|
2829
2817
|
if (event.type === "tool-result") {
|
|
2830
|
-
webSearchBuffer
|
|
2831
|
-
return "";
|
|
2818
|
+
return bufferToolResult(webSearchBuffer, event);
|
|
2832
2819
|
}
|
|
2833
2820
|
}
|
|
2834
2821
|
const flushed = flushBuffers();
|
|
@@ -2887,6 +2874,12 @@ function createSseToolEventAdapter(onEvent) {
|
|
|
2887
2874
|
type: "tool-result",
|
|
2888
2875
|
toolCallId,
|
|
2889
2876
|
toolName,
|
|
2877
|
+
// The full payload, not just the clipped summary. Consumers that parse
|
|
2878
|
+
// structured results — the agent-run snapshot parser feeding the dock
|
|
2879
|
+
// panel, the orchestration card renderer, ui_ask_choice — all read
|
|
2880
|
+
// `content`; dropping it here made every one of them silently inert on
|
|
2881
|
+
// the HTTP/SSE path while working on the local path.
|
|
2882
|
+
...rawContent ? { content: rawContent } : {},
|
|
2890
2883
|
summary,
|
|
2891
2884
|
metadata: payload.metadata,
|
|
2892
2885
|
round
|
|
@@ -3088,10 +3081,10 @@ ${options.agentName} > `);
|
|
|
3088
3081
|
spinner.show(activeLabel);
|
|
3089
3082
|
options.activityReporter?.(activeLabel);
|
|
3090
3083
|
}
|
|
3091
|
-
if (
|
|
3092
|
-
const
|
|
3093
|
-
if (
|
|
3094
|
-
options.onAgentRunStatus(snapshot);
|
|
3084
|
+
if (options.onAgentRunStatus) {
|
|
3085
|
+
const parsed = parseAgentRunEvent(event);
|
|
3086
|
+
if (parsed) {
|
|
3087
|
+
options.onAgentRunStatus(parsed.kind === "gone" ? null : parsed.snapshot);
|
|
3095
3088
|
}
|
|
3096
3089
|
}
|
|
3097
3090
|
};
|
|
@@ -3101,6 +3094,12 @@ ${options.agentName} > `);
|
|
|
3101
3094
|
traceLocalTools,
|
|
3102
3095
|
eventMode,
|
|
3103
3096
|
pushText(chunk) {
|
|
3097
|
+
if (eventMode !== "jsonl" && formatToolEvent.flush) {
|
|
3098
|
+
const pendingToolOutput = formatToolEvent.flush();
|
|
3099
|
+
if (pendingToolOutput) {
|
|
3100
|
+
options.output.write(pendingToolOutput);
|
|
3101
|
+
}
|
|
3102
|
+
}
|
|
3104
3103
|
writeVisibleAssistantChunk(chunk);
|
|
3105
3104
|
},
|
|
3106
3105
|
pushThinking(chunk) {
|
|
@@ -3144,30 +3143,6 @@ ${options.agentName} > (no text response)
|
|
|
3144
3143
|
}
|
|
3145
3144
|
};
|
|
3146
3145
|
}
|
|
3147
|
-
function extractAgentRunStatusSnapshot(event) {
|
|
3148
|
-
if (event.type !== "tool-result") return null;
|
|
3149
|
-
const content = typeof event.content === "string" ? event.content.trim() : "";
|
|
3150
|
-
if (!content.startsWith("{")) return null;
|
|
3151
|
-
try {
|
|
3152
|
-
const parsed = JSON.parse(content);
|
|
3153
|
-
const runId = typeof parsed.runId === "string" ? parsed.runId : "";
|
|
3154
|
-
const status = typeof parsed.status === "string" ? parsed.status : "running";
|
|
3155
|
-
const agentName = typeof parsed.agentName === "string" ? parsed.agentName : typeof parsed.name === "string" ? parsed.name : void 0;
|
|
3156
|
-
const logTail = typeof parsed.logTail === "string" ? parsed.logTail : void 0;
|
|
3157
|
-
const logLines = Array.isArray(parsed.logLines) ? parsed.logLines : void 0;
|
|
3158
|
-
const errorMessage = typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
|
|
3159
|
-
return {
|
|
3160
|
-
runId,
|
|
3161
|
-
agentName,
|
|
3162
|
-
status,
|
|
3163
|
-
logTail,
|
|
3164
|
-
logLines,
|
|
3165
|
-
errorMessage
|
|
3166
|
-
};
|
|
3167
|
-
} catch {
|
|
3168
|
-
return null;
|
|
3169
|
-
}
|
|
3170
|
-
}
|
|
3171
3146
|
|
|
3172
3147
|
// packages/cli/client/agentRunStream.ts
|
|
3173
3148
|
async function readStreamingAgentRun(options, res, existingSpinner) {
|
|
@@ -3550,7 +3525,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
|
|
|
3550
3525
|
// packages/cli/client/agentRun.ts
|
|
3551
3526
|
import { ulid } from "ulid";
|
|
3552
3527
|
async function loadRunLocalAgentTurn() {
|
|
3553
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
3528
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-T6YECTNF.js");
|
|
3554
3529
|
return runLocalAgentTurn;
|
|
3555
3530
|
}
|
|
3556
3531
|
async function resolveCurrentMachineId(options) {
|
|
@@ -3577,7 +3552,8 @@ function buildDefaultLocalRuntimeAdapter(options) {
|
|
|
3577
3552
|
output: options.output,
|
|
3578
3553
|
...options.confirmDestructiveAction ? { confirmDestructiveAction: options.confirmDestructiveAction } : {},
|
|
3579
3554
|
...options.requestUserChoice ? { requestUserChoice: options.requestUserChoice } : {},
|
|
3580
|
-
...options.pastedTextStore?.items.size ? { pastedTextStore: options.pastedTextStore } : {}
|
|
3555
|
+
...options.pastedTextStore?.items.size ? { pastedTextStore: options.pastedTextStore } : {},
|
|
3556
|
+
...options.activityReporter ? { activityReporter: options.activityReporter } : {}
|
|
3581
3557
|
});
|
|
3582
3558
|
}
|
|
3583
3559
|
function resolveLocalRuntimeAdapter(options) {
|
|
@@ -3827,6 +3803,7 @@ async function runHttpAgentTurn(options, authToken) {
|
|
|
3827
3803
|
...options.inheritedFromDialogKey ? { inheritedFromDialogKey: options.inheritedFromDialogKey } : {},
|
|
3828
3804
|
...options.parentDialogId ? { parentDialogId: options.parentDialogId } : {},
|
|
3829
3805
|
...options.background ? { background: true } : {},
|
|
3806
|
+
...options.ephemeral ? { ephemeral: true } : {},
|
|
3830
3807
|
...typeof options.timeoutMs === "number" ? { timeoutMs: options.timeoutMs } : {},
|
|
3831
3808
|
...options.modelOverride ? { runtimeOptions: { quickChatModelOverride: options.modelOverride } } : {},
|
|
3832
3809
|
...serverContextBlockScopes ? { contextBlockScopes: serverContextBlockScopes } : {},
|
|
@@ -3986,7 +3963,7 @@ async function runLocalAgentTurnForCli(options, settings) {
|
|
|
3986
3963
|
} : void 0;
|
|
3987
3964
|
const currentDialogId = options.continueDialogId ?? ulid();
|
|
3988
3965
|
const runChildTurn = async (input) => {
|
|
3989
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
3966
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-T6YECTNF.js");
|
|
3990
3967
|
return runLocalAgentTurn(input);
|
|
3991
3968
|
};
|
|
3992
3969
|
const createFreshChildBaseAdapter = () => {
|
|
@@ -4188,11 +4165,6 @@ async function runAgentTurn(options) {
|
|
|
4188
4165
|
);
|
|
4189
4166
|
return { exitCode: 1 };
|
|
4190
4167
|
}
|
|
4191
|
-
if (options.ephemeral) {
|
|
4192
|
-
options.output.write(
|
|
4193
|
-
"[nolo] --ephemeral/--memory-only is only effective with the local runtime (--local); the server stores dialogs on its own and cannot run memory-only.\n"
|
|
4194
|
-
);
|
|
4195
|
-
}
|
|
4196
4168
|
return runHttpAgentTurn(options, authToken);
|
|
4197
4169
|
}
|
|
4198
4170
|
|
|
@@ -5336,6 +5308,7 @@ export {
|
|
|
5336
5308
|
setActiveDensity,
|
|
5337
5309
|
resolveTuiBrightness,
|
|
5338
5310
|
setActiveTerminalBaseHex,
|
|
5311
|
+
applyDetectedBackground,
|
|
5339
5312
|
surfaceBackgroundSequence,
|
|
5340
5313
|
themeColorSequence,
|
|
5341
5314
|
themeText,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
toTimestampMs,
|
|
11
11
|
upsert,
|
|
12
12
|
write
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3S2VOMIF.js";
|
|
14
14
|
import {
|
|
15
15
|
createUserKey,
|
|
16
16
|
createUserPreferenceKey,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-QSJ3HFEF.js";
|
|
22
22
|
import {
|
|
23
23
|
BUILTIN_NOLO_AGENT_KEY
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-XPC5C7BK.js";
|
|
25
25
|
import {
|
|
26
26
|
asyncThunkCreator,
|
|
27
27
|
buildCreateSlice,
|