nolo-cli 0.16.0-alpha.1 → 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-365DMKHW.js → agentDeleteCommand-PBIUC4FT.js} +18 -17
- package/{agentEmailCommands-TQMXL36I.js → agentEmailCommands-KNZY4HXV.js} +35 -34
- package/{agentListCommands-6B5X4RC6.js → agentListCommands-N64PHBXM.js} +20 -19
- package/{agentMachineCommands-LOEARB6V.js → agentMachineCommands-2AIPJKFM.js} +18 -17
- package/{agentRecordCommands-DCH2WBL2.js → agentRecordCommands-TB4N7YSB.js} +34 -33
- package/{agentRunCommand-SGMH67WT.js → agentRunCommand-UVW2ZLKT.js} +34 -33
- package/{agentRuntimeLocal-YSYZ33ER.js → agentRuntimeLocal-T6YECTNF.js} +15 -16
- package/{agentSlice-IVE735EV.js → agentSlice-533PEM4O.js} +3 -3
- package/{appDeleteCommands-6QYOO3JB.js → appDeleteCommands-D6B6Z4ZQ.js} +19 -18
- package/{appDeployCommands-WTCT6XO6.js → appDeployCommands-YMO5FK4T.js} +19 -18
- package/{appDeployStatusCommands-CGWGZJKB.js → appDeployStatusCommands-EO5DWWPQ.js} +19 -18
- package/{appGetCommands-O4OCAMRW.js → appGetCommands-6SMZ3URQ.js} +19 -18
- package/{appListCommands-UENFP4XY.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-E237VE6U.js → chunk-6KBBMW4D.js} +2 -2
- package/{chunk-U7LEGLEB.js → chunk-6N4KODMN.js} +1 -1
- package/{chunk-GRTFNYLR.js → chunk-A7O4KKLZ.js} +3 -3
- package/{chunk-WA6KZL5V.js → chunk-AAODAAUQ.js} +23 -20
- package/{chunk-4NLUNENX.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-YYIRR6QC.js → chunk-DBLHEQH7.js} +140 -175
- package/{chunk-TTGAVETO.js → chunk-EABWT43X.js} +2 -2
- package/{chunk-RSYUDGGZ.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-EMXI3N3Z.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-WPN6RMDF.js → chunk-LO6JNGCT.js} +3 -3
- package/{chunk-J55UHASN.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-QZVGMD5F.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-YC3DJILJ.js → chunk-VHXXRWNL.js} +22 -8
- package/{chunk-OOIN7HSO.js → chunk-XJITGCTM.js} +10 -1
- package/{chunk-QLFCNUVQ.js → chunk-XJYXSTBK.js} +873 -172
- package/{chunk-V2J635L5.js → chunk-XOIF2TNF.js} +2 -2
- package/{chunk-VPTJB4HM.js → chunk-XPC5C7BK.js} +0 -3
- package/{chunk-I66RU7P7.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-ZL6L24BS.js → dialogCommands-DFY5HJ6M.js} +19 -18
- package/{dialogSlice-FAWUQDJW.js → dialogSlice-MS7OYWHW.js} +13 -13
- package/{docCreateCommands-LYROQTFH.js → docCreateCommands-5L76YTI2.js} +18 -17
- package/{docDeleteCommands-6TWGTZNR.js → docDeleteCommands-3GASP3VR.js} +19 -18
- package/{docReadCommands-PRULNF26.js → docReadCommands-ALA77AZM.js} +18 -17
- package/{docStore-2UHVWLTV.js → docStore-KYTKNGMU.js} +14 -14
- package/{docUpdateCommands-NNYYWJBI.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-JQPEQFSE.js → machineCommands-RDQQBA72.js} +33 -32
- package/{machineWsRunDispatch-FFFNWVEW.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-QSXHSBHA.js → readlineWorkspace-BTONC7NW.js} +89 -74
- 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-4LE45GB7.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",
|
|
@@ -2128,22 +2131,6 @@ function isFailedToolResult(event) {
|
|
|
2128
2131
|
function isNeedsActionToolResult(event) {
|
|
2129
2132
|
return Boolean(event.metadata?.actionGate);
|
|
2130
2133
|
}
|
|
2131
|
-
function readRunAgentName(parsed) {
|
|
2132
|
-
const agentName = typeof parsed.agentName === "string" ? parsed.agentName.trim() : "";
|
|
2133
|
-
if (agentName) return agentName;
|
|
2134
|
-
const name = typeof parsed.name === "string" ? parsed.name.trim() : "";
|
|
2135
|
-
return name || "agent";
|
|
2136
|
-
}
|
|
2137
|
-
function readRunLogLines(parsed) {
|
|
2138
|
-
if (Array.isArray(parsed.logLines)) return parsed.logLines;
|
|
2139
|
-
if (typeof parsed.logTail === "string" && parsed.logTail.trim()) {
|
|
2140
|
-
return parsed.logTail.split("\n");
|
|
2141
|
-
}
|
|
2142
|
-
return void 0;
|
|
2143
|
-
}
|
|
2144
|
-
function readRunErrorMessage(parsed) {
|
|
2145
|
-
return typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
|
|
2146
|
-
}
|
|
2147
2134
|
function parseUiAskChoiceForCli(event) {
|
|
2148
2135
|
if (event.toolName !== "ui_ask_choice" && !event.metadata?.uiAskChoice) {
|
|
2149
2136
|
return null;
|
|
@@ -2246,70 +2233,84 @@ function formatToolTraceLine(text, colorEnabled, accent = "none") {
|
|
|
2246
2233
|
return `${dimCliText(text, true)}
|
|
2247
2234
|
`;
|
|
2248
2235
|
}
|
|
2249
|
-
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 : "";
|
|
2250
2267
|
const trimmed = content.trim();
|
|
2251
|
-
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return
|
|
2268
|
+
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return null;
|
|
2252
2269
|
const labels = agentRunCardLabels();
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2270
|
+
if (toolName === "listAgents") {
|
|
2271
|
+
try {
|
|
2272
|
+
const parsed = JSON.parse(trimmed);
|
|
2256
2273
|
const agents = Array.isArray(parsed.agents) ? parsed.agents : [];
|
|
2257
2274
|
return formatAgentListCard(agents);
|
|
2275
|
+
} catch {
|
|
2276
|
+
return null;
|
|
2258
2277
|
}
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
}
|
|
2264
|
-
if (toolName === "controlAgentRun") {
|
|
2278
|
+
}
|
|
2279
|
+
if (toolName === "controlAgentRun") {
|
|
2280
|
+
try {
|
|
2281
|
+
const parsed = JSON.parse(trimmed);
|
|
2265
2282
|
if (Array.isArray(parsed.runs)) {
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
if (parsed.found === false || status === "not_found") {
|
|
2271
|
-
return formatNotFoundRunCard(labels);
|
|
2272
|
-
}
|
|
2273
|
-
if (status === "killed" || status === "cancelled" || status === "cancelling") {
|
|
2274
|
-
return formatStopRunCard(status, labels);
|
|
2283
|
+
return formatListRunsCard(
|
|
2284
|
+
parsed.runs,
|
|
2285
|
+
labels
|
|
2286
|
+
);
|
|
2275
2287
|
}
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
logLines: readRunLogLines(parsed),
|
|
2279
|
-
labels
|
|
2280
|
-
});
|
|
2288
|
+
} catch {
|
|
2289
|
+
return null;
|
|
2281
2290
|
}
|
|
2282
|
-
} catch {
|
|
2283
2291
|
}
|
|
2284
|
-
|
|
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);
|
|
2285
2305
|
}
|
|
2286
2306
|
function parseControlAgentRunStatusEvent(event) {
|
|
2287
|
-
const
|
|
2288
|
-
|
|
2289
|
-
try {
|
|
2290
|
-
const parsed = JSON.parse(raw);
|
|
2291
|
-
if (Array.isArray(parsed.runs)) return null;
|
|
2292
|
-
const status = typeof parsed.status === "string" ? parsed.status : void 0;
|
|
2293
|
-
if (parsed.found === false || status === "not_found") return null;
|
|
2294
|
-
if (status === "killed" || status === "cancelled" || status === "cancelling") return null;
|
|
2295
|
-
if (!status) return null;
|
|
2296
|
-
const runId = typeof parsed.runId === "string" && parsed.runId.trim() ? parsed.runId.trim() : typeof event.metadata?.runId === "string" ? event.metadata.runId : "";
|
|
2297
|
-
if (!runId) return null;
|
|
2298
|
-
const agentName = readRunAgentName(parsed);
|
|
2299
|
-
const errorMessage = readRunErrorMessage(parsed);
|
|
2300
|
-
const logLines = readRunLogLines(parsed);
|
|
2301
|
-
const logKey = logLines && logLines.length > 0 ? logLines.join("\n") : "";
|
|
2302
|
-
return { runId, status, agentName, errorMessage, logLines, logKey };
|
|
2303
|
-
} catch {
|
|
2304
|
-
return null;
|
|
2305
|
-
}
|
|
2307
|
+
const parsed = parseAgentRunEvent(event);
|
|
2308
|
+
return parsed?.kind === "status" ? parsed.snapshot : null;
|
|
2306
2309
|
}
|
|
2307
2310
|
function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
|
|
2308
2311
|
const rawLabel = toolLabel(toolName);
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
rawDataStr = recoverOrchestrationDisplayFromContent(toolName, event.content);
|
|
2312
|
-
}
|
|
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 : "");
|
|
2313
2314
|
const failed = event.type === "tool-error" || isFailedToolResult(event) || Boolean(event.metadata?.failed) || /^Error:/i.test(rawDataStr.trim());
|
|
2314
2315
|
if (failed) {
|
|
2315
2316
|
const firstLine = rawDataStr.trim().split("\n")[0] || event.summary || event.message || t("toolFailed");
|
|
@@ -2345,16 +2346,22 @@ function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
|
|
|
2345
2346
|
}
|
|
2346
2347
|
return out;
|
|
2347
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
|
+
}
|
|
2348
2363
|
function formatFoldedControlStatusCard(snapshot, colorEnabled) {
|
|
2349
|
-
const
|
|
2350
|
-
const body = formatStatusRunCard(snapshot.agentName, snapshot.status, {
|
|
2351
|
-
errorMessage: snapshot.errorMessage,
|
|
2352
|
-
logLines: snapshot.logLines,
|
|
2353
|
-
pollCount: snapshot.pollCount,
|
|
2354
|
-
elapsedMs: snapshot.elapsedMs,
|
|
2355
|
-
includeLogTail: snapshot.includeLogTail,
|
|
2356
|
-
labels
|
|
2357
|
-
});
|
|
2364
|
+
const body = renderRunCard(snapshot, { includeLogTail: snapshot.includeLogTail });
|
|
2358
2365
|
return formatOrchestrationCardBlock(
|
|
2359
2366
|
{
|
|
2360
2367
|
type: "tool-result",
|
|
@@ -2362,8 +2369,7 @@ function formatFoldedControlStatusCard(snapshot, colorEnabled) {
|
|
|
2362
2369
|
toolCallId: `fold-${snapshot.runId}`,
|
|
2363
2370
|
toolName: "controlAgentRun",
|
|
2364
2371
|
content: "",
|
|
2365
|
-
metadata: { displayData: body }
|
|
2366
|
-
elapsedMs: snapshot.elapsedMs
|
|
2372
|
+
metadata: { displayData: body }
|
|
2367
2373
|
},
|
|
2368
2374
|
"controlAgentRun",
|
|
2369
2375
|
colorEnabled
|
|
@@ -2644,26 +2650,14 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2644
2650
|
const fold = statusFold;
|
|
2645
2651
|
statusFold = null;
|
|
2646
2652
|
const prevLog = lastEmittedLogByRunId.get(fold.runId);
|
|
2647
|
-
const
|
|
2648
|
-
if (fold.
|
|
2653
|
+
const changed = Boolean(fold.logKey) && fold.logKey !== prevLog;
|
|
2654
|
+
if (changed && runShowsLogTail(fold.status)) {
|
|
2649
2655
|
lastEmittedLogByRunId.set(fold.runId, fold.logKey);
|
|
2650
2656
|
}
|
|
2651
|
-
return formatFoldedControlStatusCard(
|
|
2652
|
-
{
|
|
2653
|
-
runId: fold.runId,
|
|
2654
|
-
status: fold.status,
|
|
2655
|
-
agentName: fold.agentName,
|
|
2656
|
-
errorMessage: fold.errorMessage,
|
|
2657
|
-
logLines: fold.logLines,
|
|
2658
|
-
pollCount: fold.pollCount,
|
|
2659
|
-
elapsedMs: fold.elapsedMs,
|
|
2660
|
-
includeLogTail
|
|
2661
|
-
},
|
|
2662
|
-
colorEnabled
|
|
2663
|
-
);
|
|
2657
|
+
return formatFoldedControlStatusCard({ ...fold, includeLogTail: changed }, colorEnabled);
|
|
2664
2658
|
};
|
|
2665
|
-
const
|
|
2666
|
-
let out =
|
|
2659
|
+
const flushToolBuffers = () => {
|
|
2660
|
+
let out = "";
|
|
2667
2661
|
if (readBuffer.length > 0) {
|
|
2668
2662
|
const items = readBuffer.map((evt) => {
|
|
2669
2663
|
const call = pending.get(evt.toolCallId);
|
|
@@ -2719,6 +2713,12 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2719
2713
|
}
|
|
2720
2714
|
return out;
|
|
2721
2715
|
};
|
|
2716
|
+
const flushBuffers = () => `${flushStatusFold()}${flushToolBuffers()}`;
|
|
2717
|
+
const bufferToolResult = (buffer, event) => {
|
|
2718
|
+
const flushed = flushStatusFold();
|
|
2719
|
+
buffer.push(event);
|
|
2720
|
+
return flushed;
|
|
2721
|
+
};
|
|
2722
2722
|
const formatter = (event) => {
|
|
2723
2723
|
if (mode === "hide") return "";
|
|
2724
2724
|
if (mode === "verbose") return formatVerboseToolEvent(event, colorEnabled);
|
|
@@ -2733,28 +2733,13 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2733
2733
|
if (event.type === "tool-result") {
|
|
2734
2734
|
const snapshot = parseControlAgentRunStatusEvent(event);
|
|
2735
2735
|
if (snapshot) {
|
|
2736
|
-
let out =
|
|
2737
|
-
|
|
2736
|
+
let out = flushToolBuffers();
|
|
2737
|
+
const open = statusFold;
|
|
2738
|
+
const sameRun = open?.runId === snapshot.runId;
|
|
2739
|
+
if (open && (!sameRun || open.status !== snapshot.status)) {
|
|
2738
2740
|
out += flushStatusFold();
|
|
2739
2741
|
}
|
|
2740
|
-
|
|
2741
|
-
statusFold = {
|
|
2742
|
-
...snapshot,
|
|
2743
|
-
pollCount: 1,
|
|
2744
|
-
elapsedMs: event.elapsedMs
|
|
2745
|
-
};
|
|
2746
|
-
} else {
|
|
2747
|
-
statusFold = {
|
|
2748
|
-
runId: snapshot.runId,
|
|
2749
|
-
status: snapshot.status,
|
|
2750
|
-
agentName: snapshot.agentName,
|
|
2751
|
-
errorMessage: snapshot.errorMessage ?? statusFold.errorMessage,
|
|
2752
|
-
logLines: snapshot.logLines ?? statusFold.logLines,
|
|
2753
|
-
logKey: snapshot.logKey || statusFold.logKey,
|
|
2754
|
-
pollCount: statusFold.pollCount + 1,
|
|
2755
|
-
elapsedMs: event.elapsedMs
|
|
2756
|
-
};
|
|
2757
|
-
}
|
|
2742
|
+
statusFold = open && sameRun ? mergeRunSnapshot(open, snapshot) : snapshot;
|
|
2758
2743
|
pending.delete(event.toolCallId);
|
|
2759
2744
|
if (isAgentRunTerminalStatus(snapshot.status)) {
|
|
2760
2745
|
out += flushBuffers();
|
|
@@ -2776,8 +2761,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2776
2761
|
return "";
|
|
2777
2762
|
}
|
|
2778
2763
|
if (event.type === "tool-result") {
|
|
2779
|
-
readBuffer
|
|
2780
|
-
return "";
|
|
2764
|
+
return bufferToolResult(readBuffer, event);
|
|
2781
2765
|
}
|
|
2782
2766
|
}
|
|
2783
2767
|
if (isSearchToolName(event.toolName)) {
|
|
@@ -2789,8 +2773,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2789
2773
|
return "";
|
|
2790
2774
|
}
|
|
2791
2775
|
if (event.type === "tool-result") {
|
|
2792
|
-
searchBuffer
|
|
2793
|
-
return "";
|
|
2776
|
+
return bufferToolResult(searchBuffer, event);
|
|
2794
2777
|
}
|
|
2795
2778
|
}
|
|
2796
2779
|
if (isRunToolName(event.toolName)) {
|
|
@@ -2808,8 +2791,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2808
2791
|
return "";
|
|
2809
2792
|
}
|
|
2810
2793
|
if (event.type === "tool-result") {
|
|
2811
|
-
runBuffer
|
|
2812
|
-
return "";
|
|
2794
|
+
return bufferToolResult(runBuffer, event);
|
|
2813
2795
|
}
|
|
2814
2796
|
}
|
|
2815
2797
|
if (isFetchToolName(event.toolName)) {
|
|
@@ -2821,8 +2803,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2821
2803
|
return "";
|
|
2822
2804
|
}
|
|
2823
2805
|
if (event.type === "tool-result") {
|
|
2824
|
-
fetchBuffer
|
|
2825
|
-
return "";
|
|
2806
|
+
return bufferToolResult(fetchBuffer, event);
|
|
2826
2807
|
}
|
|
2827
2808
|
}
|
|
2828
2809
|
if (isWebSearchToolName(event.toolName)) {
|
|
@@ -2834,8 +2815,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
|
|
|
2834
2815
|
return "";
|
|
2835
2816
|
}
|
|
2836
2817
|
if (event.type === "tool-result") {
|
|
2837
|
-
webSearchBuffer
|
|
2838
|
-
return "";
|
|
2818
|
+
return bufferToolResult(webSearchBuffer, event);
|
|
2839
2819
|
}
|
|
2840
2820
|
}
|
|
2841
2821
|
const flushed = flushBuffers();
|
|
@@ -2894,6 +2874,12 @@ function createSseToolEventAdapter(onEvent) {
|
|
|
2894
2874
|
type: "tool-result",
|
|
2895
2875
|
toolCallId,
|
|
2896
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 } : {},
|
|
2897
2883
|
summary,
|
|
2898
2884
|
metadata: payload.metadata,
|
|
2899
2885
|
round
|
|
@@ -3095,10 +3081,10 @@ ${options.agentName} > `);
|
|
|
3095
3081
|
spinner.show(activeLabel);
|
|
3096
3082
|
options.activityReporter?.(activeLabel);
|
|
3097
3083
|
}
|
|
3098
|
-
if (
|
|
3099
|
-
const
|
|
3100
|
-
if (
|
|
3101
|
-
options.onAgentRunStatus(snapshot);
|
|
3084
|
+
if (options.onAgentRunStatus) {
|
|
3085
|
+
const parsed = parseAgentRunEvent(event);
|
|
3086
|
+
if (parsed) {
|
|
3087
|
+
options.onAgentRunStatus(parsed.kind === "gone" ? null : parsed.snapshot);
|
|
3102
3088
|
}
|
|
3103
3089
|
}
|
|
3104
3090
|
};
|
|
@@ -3108,6 +3094,12 @@ ${options.agentName} > `);
|
|
|
3108
3094
|
traceLocalTools,
|
|
3109
3095
|
eventMode,
|
|
3110
3096
|
pushText(chunk) {
|
|
3097
|
+
if (eventMode !== "jsonl" && formatToolEvent.flush) {
|
|
3098
|
+
const pendingToolOutput = formatToolEvent.flush();
|
|
3099
|
+
if (pendingToolOutput) {
|
|
3100
|
+
options.output.write(pendingToolOutput);
|
|
3101
|
+
}
|
|
3102
|
+
}
|
|
3111
3103
|
writeVisibleAssistantChunk(chunk);
|
|
3112
3104
|
},
|
|
3113
3105
|
pushThinking(chunk) {
|
|
@@ -3151,30 +3143,6 @@ ${options.agentName} > (no text response)
|
|
|
3151
3143
|
}
|
|
3152
3144
|
};
|
|
3153
3145
|
}
|
|
3154
|
-
function extractAgentRunStatusSnapshot(event) {
|
|
3155
|
-
if (event.type !== "tool-result") return null;
|
|
3156
|
-
const content = typeof event.content === "string" ? event.content.trim() : "";
|
|
3157
|
-
if (!content.startsWith("{")) return null;
|
|
3158
|
-
try {
|
|
3159
|
-
const parsed = JSON.parse(content);
|
|
3160
|
-
const runId = typeof parsed.runId === "string" ? parsed.runId : "";
|
|
3161
|
-
const status = typeof parsed.status === "string" ? parsed.status : "running";
|
|
3162
|
-
const agentName = typeof parsed.agentName === "string" ? parsed.agentName : typeof parsed.name === "string" ? parsed.name : void 0;
|
|
3163
|
-
const logTail = typeof parsed.logTail === "string" ? parsed.logTail : void 0;
|
|
3164
|
-
const logLines = Array.isArray(parsed.logLines) ? parsed.logLines : void 0;
|
|
3165
|
-
const errorMessage = typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
|
|
3166
|
-
return {
|
|
3167
|
-
runId,
|
|
3168
|
-
agentName,
|
|
3169
|
-
status,
|
|
3170
|
-
logTail,
|
|
3171
|
-
logLines,
|
|
3172
|
-
errorMessage
|
|
3173
|
-
};
|
|
3174
|
-
} catch {
|
|
3175
|
-
return null;
|
|
3176
|
-
}
|
|
3177
|
-
}
|
|
3178
3146
|
|
|
3179
3147
|
// packages/cli/client/agentRunStream.ts
|
|
3180
3148
|
async function readStreamingAgentRun(options, res, existingSpinner) {
|
|
@@ -3557,7 +3525,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
|
|
|
3557
3525
|
// packages/cli/client/agentRun.ts
|
|
3558
3526
|
import { ulid } from "ulid";
|
|
3559
3527
|
async function loadRunLocalAgentTurn() {
|
|
3560
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
3528
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-T6YECTNF.js");
|
|
3561
3529
|
return runLocalAgentTurn;
|
|
3562
3530
|
}
|
|
3563
3531
|
async function resolveCurrentMachineId(options) {
|
|
@@ -3584,7 +3552,8 @@ function buildDefaultLocalRuntimeAdapter(options) {
|
|
|
3584
3552
|
output: options.output,
|
|
3585
3553
|
...options.confirmDestructiveAction ? { confirmDestructiveAction: options.confirmDestructiveAction } : {},
|
|
3586
3554
|
...options.requestUserChoice ? { requestUserChoice: options.requestUserChoice } : {},
|
|
3587
|
-
...options.pastedTextStore?.items.size ? { pastedTextStore: options.pastedTextStore } : {}
|
|
3555
|
+
...options.pastedTextStore?.items.size ? { pastedTextStore: options.pastedTextStore } : {},
|
|
3556
|
+
...options.activityReporter ? { activityReporter: options.activityReporter } : {}
|
|
3588
3557
|
});
|
|
3589
3558
|
}
|
|
3590
3559
|
function resolveLocalRuntimeAdapter(options) {
|
|
@@ -3834,6 +3803,7 @@ async function runHttpAgentTurn(options, authToken) {
|
|
|
3834
3803
|
...options.inheritedFromDialogKey ? { inheritedFromDialogKey: options.inheritedFromDialogKey } : {},
|
|
3835
3804
|
...options.parentDialogId ? { parentDialogId: options.parentDialogId } : {},
|
|
3836
3805
|
...options.background ? { background: true } : {},
|
|
3806
|
+
...options.ephemeral ? { ephemeral: true } : {},
|
|
3837
3807
|
...typeof options.timeoutMs === "number" ? { timeoutMs: options.timeoutMs } : {},
|
|
3838
3808
|
...options.modelOverride ? { runtimeOptions: { quickChatModelOverride: options.modelOverride } } : {},
|
|
3839
3809
|
...serverContextBlockScopes ? { contextBlockScopes: serverContextBlockScopes } : {},
|
|
@@ -3993,7 +3963,7 @@ async function runLocalAgentTurnForCli(options, settings) {
|
|
|
3993
3963
|
} : void 0;
|
|
3994
3964
|
const currentDialogId = options.continueDialogId ?? ulid();
|
|
3995
3965
|
const runChildTurn = async (input) => {
|
|
3996
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
3966
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-T6YECTNF.js");
|
|
3997
3967
|
return runLocalAgentTurn(input);
|
|
3998
3968
|
};
|
|
3999
3969
|
const createFreshChildBaseAdapter = () => {
|
|
@@ -4195,11 +4165,6 @@ async function runAgentTurn(options) {
|
|
|
4195
4165
|
);
|
|
4196
4166
|
return { exitCode: 1 };
|
|
4197
4167
|
}
|
|
4198
|
-
if (options.ephemeral) {
|
|
4199
|
-
options.output.write(
|
|
4200
|
-
"[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"
|
|
4201
|
-
);
|
|
4202
|
-
}
|
|
4203
4168
|
return runHttpAgentTurn(options, authToken);
|
|
4204
4169
|
}
|
|
4205
4170
|
|
|
@@ -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,
|