nolo-cli 0.48.0-alpha.1 → 0.48.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-LFBAN2KT.js → _executeModel-36GKPAEZ.js} +14 -14
- package/{agentDeleteCommand-CNN5LBAO.js → agentDeleteCommand-SBODEUPE.js} +5 -5
- package/{agentEmailCommands-HGNTOOF3.js → agentEmailCommands-ME7BCY5S.js} +17 -17
- package/{agentListCommands-TJAGNI7U.js → agentListCommands-QBWPKN5D.js} +5 -5
- package/{agentMachineCommands-LX7LYP5C.js → agentMachineCommands-KFFUPELZ.js} +6 -6
- package/{agentRecordCommands-BTNT2CID.js → agentRecordCommands-4BF6JIHS.js} +16 -16
- package/{agentRunCommand-AWTIQN4B.js → agentRunCommand-4MA7D6SV.js} +16 -16
- package/{agentRuntimeLocal-IWHECAEG.js → agentRuntimeLocal-RD52NPCG.js} +5 -5
- package/{agentSlice-X2QCV4WW.js → agentSlice-AJABGQHU.js} +1 -1
- package/{appDeleteCommands-5V5XNCOC.js → appDeleteCommands-I42NL3LP.js} +5 -5
- package/{appDeployCommands-VXOHBAQ5.js → appDeployCommands-CZWHXVPU.js} +5 -5
- package/{appDeployStatusCommands-OH45XPZT.js → appDeployStatusCommands-PIQYXACM.js} +5 -5
- package/{appGetCommands-L4IAC6AP.js → appGetCommands-CI2OWLT7.js} +5 -5
- package/{appListCommands-LS4YZVY5.js → appListCommands-LWLSHPCP.js} +5 -5
- package/{authCommand-E2KFUS4J.js → authCommand-WLWOEVYI.js} +5 -5
- package/{chatQueueReduxAdapter-U7XNAUPH.js → chatQueueReduxAdapter-V37RK3A6.js} +3 -3
- package/{chunk-ZU2H6WIX.js → chunk-3YVCM5PE.js} +1 -1
- package/{chunk-4YL2BXS7.js → chunk-4ZL2KBI7.js} +1 -1
- package/{chunk-5WYNOWDN.js → chunk-5SLTA66C.js} +9 -9
- package/{chunk-KHP6MASA.js → chunk-67Q6IHM5.js} +179 -45
- package/{chunk-VOXLJGEG.js → chunk-AV4Z57LV.js} +2 -0
- package/{chunk-CNPQJ6Z5.js → chunk-AZ6DT2UD.js} +1 -1
- package/{chunk-P4Q2EYHT.js → chunk-CY5KIIPU.js} +6 -6
- package/{chunk-A25TOOMK.js → chunk-DFY6O64O.js} +2 -2
- package/{chunk-6O2AU6RJ.js → chunk-H5QLIP6S.js} +1 -1
- package/{chunk-2DO42AEN.js → chunk-IVKEJD7I.js} +1 -1
- package/{chunk-SH2CND5A.js → chunk-JBL24PK6.js} +1 -1
- package/{chunk-A5C6BSLO.js → chunk-JVKFKKYN.js} +1 -1
- package/{chunk-PZFSINTN.js → chunk-KOZ2G3ZG.js} +3 -3
- package/{chunk-HMMOAG2I.js → chunk-OZKJBDG4.js} +6 -3
- package/{chunk-QTXG62UK.js → chunk-PGKZ2KGE.js} +8 -8
- package/{chunk-AGOQMUIT.js → chunk-PJASTA2U.js} +2 -2
- package/{chunk-6AWD37OI.js → chunk-POLE2QLO.js} +21 -16
- package/{chunk-IQUYI3QB.js → chunk-QF27IZB3.js} +3 -3
- package/{chunk-BBMYBLCJ.js → chunk-QTH72J3N.js} +3 -3
- package/{chunk-MJHHVH7D.js → chunk-TZRB2I2M.js} +9 -8
- package/{chunk-I2UBTFAP.js → chunk-XB7ACJFH.js} +1 -1
- package/{chunk-7AIGZTJ4.js → chunk-XPW6JLOB.js} +2 -2
- package/{createAgentAutomationAction-JCB6QE35.js → createAgentAutomationAction-5OZIWOK4.js} +4 -4
- package/{createDialogAction-KUTVRAVR.js → createDialogAction-334CHPJF.js} +5 -5
- package/{createPageAction-FGECIUOW.js → createPageAction-LXY22WTA.js} +4 -4
- package/{dialogCommands-CMOEOOSH.js → dialogCommands-4MGUHAJI.js} +5 -5
- package/{dialogSlice-QOK4QUSI.js → dialogSlice-76W7S3C4.js} +3 -3
- package/{docCreateCommands-GEQXMOLF.js → docCreateCommands-346W5443.js} +5 -5
- package/{docDeleteCommands-4U3XHYYC.js → docDeleteCommands-FKEEPUUS.js} +5 -5
- package/{docReadCommands-D33RAMDE.js → docReadCommands-AACI4DVO.js} +5 -5
- package/{docStore-3Q2U743R.js → docStore-N7QTPHAX.js} +5 -5
- package/{docUpdateCommands-TFG3WL6F.js → docUpdateCommands-WHWVZ2XE.js} +5 -5
- package/{handleSendMessageAction-N47LDTXU.js → handleSendMessageAction-EAXEX5AX.js} +3 -3
- package/index.js +47 -47
- package/{machineCommands-BKPQVPFD.js → machineCommands-XNWLQVTN.js} +16 -16
- package/{machineWsRunDispatch-OJEKYCXU.js → machineWsRunDispatch-56HWQ67L.js} +16 -16
- package/package.json +1 -1
- package/{readlineWorkspace-3I7S45CJ.js → readlineWorkspace-AXTB7DJC.js} +129 -80
- package/{runAgentClientLoop-U2UQ4OO6.js → runAgentClientLoop-PU3R3UXA.js} +12 -12
- package/{spaceCommands-XQY2URWJ.js → spaceCommands-JYI3X4N2.js} +5 -5
- package/{spaceSlice-DCSYGLQY.js → spaceSlice-ERZ3RGWC.js} +4 -4
- package/{streamAgentChatTurn-MDSNFOAK.js → streamAgentChatTurn-2IH4MTQC.js} +13 -13
- package/{tools-TH3CM2BJ.js → tools-DJUTQEMP.js} +7 -7
- package/{tuiSummaryLlmCaller-5CSCW5HP.js → tuiSummaryLlmCaller-U4EGD2SX.js} +3 -3
- package/{updateDialogTitleAction-WGRL752X.js → updateDialogTitleAction-OVOPGTC3.js} +4 -4
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
} from "./chunk-YPREESF4.js";
|
|
5
5
|
import {
|
|
6
6
|
handleSendMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PGKZ2KGE.js";
|
|
8
8
|
import "./chunk-EVBFYPDC.js";
|
|
9
9
|
import "./chunk-H2G6JXTR.js";
|
|
10
10
|
import "./chunk-YYLHWIW6.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-KOZ2G3ZG.js";
|
|
12
12
|
import "./chunk-AGGIDPCZ.js";
|
|
13
13
|
import "./chunk-SG65C33A.js";
|
|
14
14
|
import "./chunk-5RGU3J7P.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-MRWGHF56.js";
|
|
23
23
|
import "./chunk-F22JQTSX.js";
|
|
24
24
|
import "./chunk-HR5XDXYM.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-AV4Z57LV.js";
|
|
26
26
|
import "./chunk-NQ4N4IGO.js";
|
|
27
27
|
import "./chunk-FD36SCCD.js";
|
|
28
28
|
import "./chunk-BO3YFOZR.js";
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
} from "./chunk-INZZJSQF.js";
|
|
44
44
|
import {
|
|
45
45
|
createDocState
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-PJASTA2U.js";
|
|
47
47
|
import {
|
|
48
48
|
ToolApiError,
|
|
49
49
|
buildToolRequestHeaders,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
buildBuiltinObjectSkillDbKey,
|
|
71
71
|
buildBuiltinObjectSkillPageContent,
|
|
72
72
|
createDialogAction
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-XPW6JLOB.js";
|
|
74
74
|
import {
|
|
75
75
|
addCategory,
|
|
76
76
|
addContentToSpace,
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
loadTableRows,
|
|
91
91
|
updateContentCategory,
|
|
92
92
|
updateContentTitle
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-DFY6O64O.js";
|
|
94
94
|
import {
|
|
95
95
|
normalizeAppRouteId,
|
|
96
96
|
resolveDialogRuntimeAgentKey,
|
|
@@ -100,13 +100,13 @@ import {
|
|
|
100
100
|
selectMsgById,
|
|
101
101
|
uiAskChoiceFunc,
|
|
102
102
|
uiAskChoiceFunctionSchema
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-PGKZ2KGE.js";
|
|
104
104
|
import {
|
|
105
105
|
createAgent,
|
|
106
106
|
runLlm,
|
|
107
107
|
streamAgentChatTurn,
|
|
108
108
|
updateAgent
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-KOZ2G3ZG.js";
|
|
110
110
|
import {
|
|
111
111
|
getActiveDialogKey,
|
|
112
112
|
require_react,
|
|
@@ -15385,7 +15385,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
15385
15385
|
const deletedDialogIds = [];
|
|
15386
15386
|
const deletedDialogKeys = [];
|
|
15387
15387
|
const failures = [];
|
|
15388
|
-
const { deleteDialog } = await import("./dialogSlice-
|
|
15388
|
+
const { deleteDialog } = await import("./dialogSlice-76W7S3C4.js");
|
|
15389
15389
|
for (const target of targets) {
|
|
15390
15390
|
try {
|
|
15391
15391
|
await thunkApi.dispatch(deleteDialog(target.dbKey)).unwrap();
|
|
@@ -24957,7 +24957,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
24957
24957
|
if (!executionInput) {
|
|
24958
24958
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
24959
24959
|
}
|
|
24960
|
-
const { findToolExecutor: findToolExecutor2 } = await import("./tools-
|
|
24960
|
+
const { findToolExecutor: findToolExecutor2 } = await import("./tools-DJUTQEMP.js");
|
|
24961
24961
|
const { executor } = findToolExecutor2(run.toolName);
|
|
24962
24962
|
toolRunStarted({
|
|
24963
24963
|
id: run.id,
|
|
@@ -24981,7 +24981,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
24981
24981
|
const latestState = thunkApi.getState();
|
|
24982
24982
|
const userId = latestState.auth?.currentUser?.userId;
|
|
24983
24983
|
if (userId) {
|
|
24984
|
-
const { fetchUserSpaceMemberships } = await import("./spaceSlice-
|
|
24984
|
+
const { fetchUserSpaceMemberships } = await import("./spaceSlice-ERZ3RGWC.js");
|
|
24985
24985
|
await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
|
|
24986
24986
|
}
|
|
24987
24987
|
}
|
|
@@ -27464,7 +27464,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
27464
27464
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
27465
27465
|
};
|
|
27466
27466
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
27467
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
27467
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-N7QTPHAX.js");
|
|
27468
27468
|
if (getDocState().pageKey === id) {
|
|
27469
27469
|
applyExternalDocUpdate({
|
|
27470
27470
|
slateData: finalSlateData,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
parseAgentRunEvent,
|
|
20
20
|
t,
|
|
21
21
|
toolLabel
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-POLE2QLO.js";
|
|
23
23
|
import {
|
|
24
24
|
getReadableCliDb
|
|
25
25
|
} from "./chunk-43CXXVJD.js";
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
} from "./chunk-LTRXGFMS.js";
|
|
53
53
|
import {
|
|
54
54
|
formatAgentListCard
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-5SLTA66C.js";
|
|
56
56
|
import {
|
|
57
57
|
isTransientFetchError
|
|
58
58
|
} from "./chunk-5XTOKQLW.js";
|
|
@@ -74,12 +74,12 @@ import {
|
|
|
74
74
|
chooseMemoryOwners,
|
|
75
75
|
loadMemoryCandidatesFromDb,
|
|
76
76
|
resolveAgentMemoryPolicy
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-XPW6JLOB.js";
|
|
78
78
|
import {
|
|
79
79
|
API_REPORTED_COST_MULTIPLIER,
|
|
80
80
|
normalizeUsage,
|
|
81
81
|
parseUiAskChoiceContent
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-PGKZ2KGE.js";
|
|
83
83
|
import {
|
|
84
84
|
getDefaultCliLocalRuntimeDb
|
|
85
85
|
} from "./chunk-IA3A5373.js";
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
LOCAL_TURN_ABORTED_CODE,
|
|
96
96
|
readActionGate,
|
|
97
97
|
readCommandActionGatePayload
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-QTH72J3N.js";
|
|
99
99
|
import {
|
|
100
100
|
resolveAgentRuntimeConfigFromRecord
|
|
101
101
|
} from "./chunk-VKSBVRGP.js";
|
|
@@ -107,7 +107,7 @@ import {
|
|
|
107
107
|
import {
|
|
108
108
|
resolveClientVersion,
|
|
109
109
|
resolvePlatformAuthToken
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-JBL24PK6.js";
|
|
111
111
|
import {
|
|
112
112
|
isQuotaExhaustedError
|
|
113
113
|
} from "./chunk-IWUMSAQF.js";
|
|
@@ -3717,7 +3717,7 @@ function tokenize(value, options) {
|
|
|
3717
3717
|
}
|
|
3718
3718
|
|
|
3719
3719
|
// packages/cli/client/toolOutput.ts
|
|
3720
|
-
function normalizeToolDisplayMode(raw, fallback = "
|
|
3720
|
+
function normalizeToolDisplayMode(raw, fallback = "normal") {
|
|
3721
3721
|
const normalized = asTrimmedLowercaseString(raw);
|
|
3722
3722
|
if (normalized === "hide" || normalized === "off" || normalized === "false" || normalized === "0") {
|
|
3723
3723
|
return "hide";
|
|
@@ -3725,8 +3725,11 @@ function normalizeToolDisplayMode(raw, fallback = "compact") {
|
|
|
3725
3725
|
if (normalized === "verbose" || normalized === "debug" || normalized === "trace" || normalized === "full") {
|
|
3726
3726
|
return "verbose";
|
|
3727
3727
|
}
|
|
3728
|
-
if (normalized === "
|
|
3729
|
-
return "
|
|
3728
|
+
if (normalized === "normal" || normalized === "summary" || normalized === "on") {
|
|
3729
|
+
return "normal";
|
|
3730
|
+
}
|
|
3731
|
+
if (normalized === "pro" || normalized === "compact" || normalized === "minimal" || normalized === "short") {
|
|
3732
|
+
return "pro";
|
|
3730
3733
|
}
|
|
3731
3734
|
return fallback;
|
|
3732
3735
|
}
|
|
@@ -3738,7 +3741,7 @@ function resolveToolDisplayMode(env = process.env) {
|
|
|
3738
3741
|
if (legacyTrace === "verbose" || legacyTrace === "full") {
|
|
3739
3742
|
return "verbose";
|
|
3740
3743
|
}
|
|
3741
|
-
return normalizeToolDisplayMode(env.NOLO_CLI_TOOLS ?? env.NOLO_TOOLS, "
|
|
3744
|
+
return normalizeToolDisplayMode(env.NOLO_CLI_TOOLS ?? env.NOLO_TOOLS, "normal");
|
|
3742
3745
|
}
|
|
3743
3746
|
function shouldEmitToolEvents(mode) {
|
|
3744
3747
|
return mode !== "hide";
|
|
@@ -3752,6 +3755,9 @@ function formatActiveToolLabel(event) {
|
|
|
3752
3755
|
const label = toolLabel(toolName);
|
|
3753
3756
|
return args ? `${label} ${args}` : label;
|
|
3754
3757
|
}
|
|
3758
|
+
function formatConservativeActiveToolLabel(event) {
|
|
3759
|
+
return toolLabel(event.toolName || "tool");
|
|
3760
|
+
}
|
|
3755
3761
|
function compactResultHint(event) {
|
|
3756
3762
|
const gate = readActionGate(event.metadata?.actionGate);
|
|
3757
3763
|
if (gate) {
|
|
@@ -4160,6 +4166,36 @@ function formatVerboseToolEvent(event, colorEnabled) {
|
|
|
4160
4166
|
colorEnabled
|
|
4161
4167
|
);
|
|
4162
4168
|
}
|
|
4169
|
+
function formatNormalToolLine(event, pending, colorEnabled) {
|
|
4170
|
+
if (event.type === "tool-call") return "";
|
|
4171
|
+
const toolName = event.toolName || pending?.toolName || "tool";
|
|
4172
|
+
const todoBlock = formatTodoListForCli(event, colorEnabled);
|
|
4173
|
+
if (todoBlock) return todoBlock;
|
|
4174
|
+
if (event.type === "tool-result" && (event.toolName === "ask_user" || event.metadata?.uiAskChoice)) {
|
|
4175
|
+
const block = formatUiAskChoiceBlock(event, colorEnabled);
|
|
4176
|
+
if (block) return block;
|
|
4177
|
+
}
|
|
4178
|
+
if (event.type === "tool-result" && (toolName === "listAgents" || toolName === "startAgentRun" || toolName === "controlAgentRun")) {
|
|
4179
|
+
return formatOrchestrationCardBlock(event, toolName, colorEnabled);
|
|
4180
|
+
}
|
|
4181
|
+
if (event.type === "tool-result" && toolName === "loadSkill") {
|
|
4182
|
+
return formatLoadSkillBlock(event, colorEnabled) ?? "";
|
|
4183
|
+
}
|
|
4184
|
+
const label = toolLabel(toolName);
|
|
4185
|
+
if (readActionGate(event.metadata?.actionGate)) {
|
|
4186
|
+
return formatToolTraceLine(`\u25B8 ${label} ! ${t("toolNeedsAction")}`, colorEnabled, "error");
|
|
4187
|
+
}
|
|
4188
|
+
if (event.type === "tool-error") {
|
|
4189
|
+
return formatToolTraceLine(`\u25B8 ${label} \u2717 ${t("toolFailed")}`, colorEnabled, "error");
|
|
4190
|
+
}
|
|
4191
|
+
if (event.metadata?.timedOut) {
|
|
4192
|
+
return formatToolTraceLine(`\u25B8 ${label} \u2717 ${t("toolTimedOut")}`, colorEnabled, "error");
|
|
4193
|
+
}
|
|
4194
|
+
if (isFailedToolResult(event)) {
|
|
4195
|
+
return formatToolTraceLine(`\u25B8 ${label} \u2717 ${t("toolFailed")}`, colorEnabled, "error");
|
|
4196
|
+
}
|
|
4197
|
+
return formatToolTraceLine(`\u25B8 ${label} \u2713`, colorEnabled);
|
|
4198
|
+
}
|
|
4163
4199
|
function isReadToolName(name) {
|
|
4164
4200
|
if (!name) return false;
|
|
4165
4201
|
return name === "read" || name === "readFile" || name === "read_file" || name === "readWorkspaceFile";
|
|
@@ -4346,6 +4382,26 @@ function formatTodoListForCli(event, colorEnabled) {
|
|
|
4346
4382
|
const text = [`\u2611 Todo (${todos.length})`, ...lines].join("\n") + "\n";
|
|
4347
4383
|
return colorEnabled ? themeText(text, "chrome") : text;
|
|
4348
4384
|
}
|
|
4385
|
+
function formatLoadSkillBlock(event, colorEnabled) {
|
|
4386
|
+
if (event.type !== "tool-result" || event.toolName !== "loadSkill") return null;
|
|
4387
|
+
const skillName = resolveLoadSkillName(event);
|
|
4388
|
+
const content = typeof event.content === "string" ? event.content : "";
|
|
4389
|
+
const failed = /^Skill\s+"[^"]*"\s+not found/.test(content) || isFailedToolResult(event);
|
|
4390
|
+
const labelText = t("usedSkillLabel");
|
|
4391
|
+
if (failed) {
|
|
4392
|
+
const message = clip(content.split("\n")[0] || t("toolFailed"), 96);
|
|
4393
|
+
return formatToolTraceLine(`\u25B8 ${labelText} (${skillName}) \u2717 ${message}`, colorEnabled, "error");
|
|
4394
|
+
}
|
|
4395
|
+
if (!colorEnabled) {
|
|
4396
|
+
return `\u2726 ${labelText}: ${skillName}
|
|
4397
|
+
`;
|
|
4398
|
+
}
|
|
4399
|
+
const star = themeText("\u2726", "success", true);
|
|
4400
|
+
const labelPart = themeText(labelText, "muted", true);
|
|
4401
|
+
const namePart = themeText(skillName, "chrome", true);
|
|
4402
|
+
return `${star} ${labelPart}: ${namePart}
|
|
4403
|
+
`;
|
|
4404
|
+
}
|
|
4349
4405
|
function formatCompactToolLine(event, pending, colorEnabled) {
|
|
4350
4406
|
const toolName = event.toolName || pending?.toolName || "tool";
|
|
4351
4407
|
const todoBlock = formatTodoListForCli(event, colorEnabled);
|
|
@@ -4376,25 +4432,8 @@ function formatCompactToolLine(event, pending, colorEnabled) {
|
|
|
4376
4432
|
const message = clip(event.message ?? t("toolFailed"), 96);
|
|
4377
4433
|
return formatToolTraceLine(`\u25B8 ${label} \u2717 ${message}`, colorEnabled, "error");
|
|
4378
4434
|
}
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
const content = typeof event.content === "string" ? event.content : "";
|
|
4382
|
-
const failed2 = /^Skill\s+"[^"]*"\s+not found/.test(content) || isFailedToolResult(event);
|
|
4383
|
-
const labelText = t("usedSkillLabel");
|
|
4384
|
-
if (failed2) {
|
|
4385
|
-
const message = clip(content.split("\n")[0] || t("toolFailed"), 96);
|
|
4386
|
-
return formatToolTraceLine(`\u25B8 ${labelText} (${skillName}) \u2717 ${message}`, colorEnabled, "error");
|
|
4387
|
-
}
|
|
4388
|
-
if (!colorEnabled) {
|
|
4389
|
-
return `\u2726 ${labelText}: ${skillName}
|
|
4390
|
-
`;
|
|
4391
|
-
}
|
|
4392
|
-
const star = themeText("\u2726", "success", true);
|
|
4393
|
-
const labelPart = themeText(labelText, "muted", true);
|
|
4394
|
-
const namePart = themeText(skillName, "chrome", true);
|
|
4395
|
-
return `${star} ${labelPart}: ${namePart}
|
|
4396
|
-
`;
|
|
4397
|
-
}
|
|
4435
|
+
const loadSkillBlock = formatLoadSkillBlock(event, colorEnabled);
|
|
4436
|
+
if (loadSkillBlock) return loadSkillBlock;
|
|
4398
4437
|
if (event.type === "tool-result" && (toolName === "listAgents" || toolName === "startAgentRun" || toolName === "controlAgentRun")) {
|
|
4399
4438
|
return formatOrchestrationCardBlock(event, toolName, colorEnabled);
|
|
4400
4439
|
}
|
|
@@ -4561,6 +4600,18 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled(),
|
|
|
4561
4600
|
const formatter = (event) => {
|
|
4562
4601
|
if (mode === "hide") return "";
|
|
4563
4602
|
if (mode === "verbose") return formatVerboseToolEvent(event, colorEnabled);
|
|
4603
|
+
if (mode === "normal") {
|
|
4604
|
+
if (event.type === "tool-call") {
|
|
4605
|
+
pending.set(event.toolCallId, {
|
|
4606
|
+
toolName: event.toolName,
|
|
4607
|
+
argumentsPreview: event.argumentsPreview
|
|
4608
|
+
});
|
|
4609
|
+
return "";
|
|
4610
|
+
}
|
|
4611
|
+
const call2 = pending.get(event.toolCallId);
|
|
4612
|
+
pending.delete(event.toolCallId);
|
|
4613
|
+
return formatNormalToolLine(event, call2, colorEnabled);
|
|
4614
|
+
}
|
|
4564
4615
|
if (event.toolName === "controlAgentRun") {
|
|
4565
4616
|
if (event.type === "tool-call") {
|
|
4566
4617
|
pending.set(event.toolCallId, {
|
|
@@ -4837,6 +4888,7 @@ ${this.text}
|
|
|
4837
4888
|
};
|
|
4838
4889
|
|
|
4839
4890
|
// packages/cli/client/agentRunOutput.ts
|
|
4891
|
+
var IDENTITY_LABEL_SEPARATOR = " > ";
|
|
4840
4892
|
function formatCompactionSummaryLine(event) {
|
|
4841
4893
|
if (!event) return "";
|
|
4842
4894
|
const action = event.reason === "tool_stub" ? "stub \u5DE5\u5177\u8F93\u51FA" : "\u751F\u6210\u5386\u53F2\u6458\u8981";
|
|
@@ -4899,6 +4951,15 @@ function createCliTurnOutput(params) {
|
|
|
4899
4951
|
let printedAssistantLabel = false;
|
|
4900
4952
|
let thinkState = createThinkParserState();
|
|
4901
4953
|
let compactionEvent = null;
|
|
4954
|
+
const assistantLabelManaged = options.output.assistantLabelManaged === true;
|
|
4955
|
+
const writeToolOutput = (chunk) => {
|
|
4956
|
+
if (!chunk) return;
|
|
4957
|
+
if (typeof options.output.writeToolBlock === "function") {
|
|
4958
|
+
options.output.writeToolBlock(chunk);
|
|
4959
|
+
} else {
|
|
4960
|
+
options.output.write(chunk);
|
|
4961
|
+
}
|
|
4962
|
+
};
|
|
4902
4963
|
const renderWriter = createRenderAwareStreamWriter({
|
|
4903
4964
|
write: (chunk) => options.output.write(chunk)
|
|
4904
4965
|
});
|
|
@@ -4914,8 +4975,10 @@ function createCliTurnOutput(params) {
|
|
|
4914
4975
|
spinner.stop();
|
|
4915
4976
|
options.activityReporter?.(null);
|
|
4916
4977
|
if (!printedAssistantLabel) {
|
|
4917
|
-
|
|
4918
|
-
|
|
4978
|
+
if (!assistantLabelManaged) {
|
|
4979
|
+
options.output.write(`
|
|
4980
|
+
${options.agentName}${IDENTITY_LABEL_SEPARATOR}`);
|
|
4981
|
+
}
|
|
4919
4982
|
printedAssistantLabel = true;
|
|
4920
4983
|
}
|
|
4921
4984
|
streamedAssistantText = true;
|
|
@@ -4939,10 +5002,10 @@ ${options.agentName} > `);
|
|
|
4939
5002
|
streamedAssistantText = false;
|
|
4940
5003
|
}
|
|
4941
5004
|
if (chunk) {
|
|
4942
|
-
|
|
5005
|
+
writeToolOutput(chunk);
|
|
4943
5006
|
}
|
|
4944
|
-
if (toolDisplayMode === "compact" && event.type === "tool-call") {
|
|
4945
|
-
const activeLabel = formatActiveToolLabel(event);
|
|
5007
|
+
if ((toolDisplayMode === "compact" || toolDisplayMode === "pro" || toolDisplayMode === "normal") && event.type === "tool-call") {
|
|
5008
|
+
const activeLabel = toolDisplayMode === "normal" ? formatConservativeActiveToolLabel(event) : formatActiveToolLabel(event);
|
|
4946
5009
|
spinner.show(activeLabel);
|
|
4947
5010
|
options.activityReporter?.(activeLabel);
|
|
4948
5011
|
}
|
|
@@ -4962,7 +5025,7 @@ ${options.agentName} > `);
|
|
|
4962
5025
|
if (eventMode !== "jsonl" && formatToolEvent.flush) {
|
|
4963
5026
|
const pendingToolOutput = formatToolEvent.flush();
|
|
4964
5027
|
if (pendingToolOutput) {
|
|
4965
|
-
|
|
5028
|
+
writeToolOutput(pendingToolOutput);
|
|
4966
5029
|
}
|
|
4967
5030
|
}
|
|
4968
5031
|
writeVisibleAssistantChunk(chunk);
|
|
@@ -4990,7 +5053,7 @@ ${options.agentName} > `);
|
|
|
4990
5053
|
}
|
|
4991
5054
|
const pendingToolOutput = formatToolEvent.flush ? formatToolEvent.flush() : "";
|
|
4992
5055
|
if (pendingToolOutput) {
|
|
4993
|
-
|
|
5056
|
+
writeToolOutput(pendingToolOutput);
|
|
4994
5057
|
}
|
|
4995
5058
|
if (streamedAssistantText) {
|
|
4996
5059
|
renderWriter.flush();
|
|
@@ -5000,13 +5063,18 @@ ${options.agentName} > `);
|
|
|
5000
5063
|
} else {
|
|
5001
5064
|
const content = fallbackContent ? formatAssistantResponseForCli(fallbackContent.trim()) : "";
|
|
5002
5065
|
if (content) {
|
|
5003
|
-
options.output.write(
|
|
5004
|
-
|
|
5005
|
-
`
|
|
5066
|
+
options.output.write(
|
|
5067
|
+
assistantLabelManaged ? `${content}
|
|
5068
|
+
` : `
|
|
5069
|
+
${options.agentName}${IDENTITY_LABEL_SEPARATOR}${content}
|
|
5070
|
+
`
|
|
5071
|
+
);
|
|
5006
5072
|
} else {
|
|
5007
|
-
options.output.write(
|
|
5008
|
-
|
|
5009
|
-
|
|
5073
|
+
options.output.write(
|
|
5074
|
+
assistantLabelManaged ? "(no text response)\n" : `
|
|
5075
|
+
${options.agentName}${IDENTITY_LABEL_SEPARATOR}(no text response)
|
|
5076
|
+
`
|
|
5077
|
+
);
|
|
5010
5078
|
}
|
|
5011
5079
|
}
|
|
5012
5080
|
const compactionLine = formatCompactionSummaryLine(compactionEvent);
|
|
@@ -5444,9 +5512,65 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
|
|
|
5444
5512
|
// packages/cli/client/agentRun.ts
|
|
5445
5513
|
import { ulid } from "ulid";
|
|
5446
5514
|
async function loadRunLocalAgentTurn() {
|
|
5447
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
5515
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-RD52NPCG.js");
|
|
5448
5516
|
return runLocalAgentTurn;
|
|
5449
5517
|
}
|
|
5518
|
+
var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
|
|
5519
|
+
function extractEmbeddedErrorMessage(message) {
|
|
5520
|
+
const match = /"message"\s*:\s*"((?:[^"\\]|\\.)*)"/.exec(message);
|
|
5521
|
+
if (!match) return void 0;
|
|
5522
|
+
try {
|
|
5523
|
+
const decoded = JSON.parse(`"${match[1]}"`);
|
|
5524
|
+
if (typeof decoded !== "string" || !decoded.trim()) return void 0;
|
|
5525
|
+
const cleaned = decoded.replace(/[\u0000-\u001f\u007f]/g, "");
|
|
5526
|
+
return cleaned.trim() ? cleaned : void 0;
|
|
5527
|
+
} catch {
|
|
5528
|
+
return void 0;
|
|
5529
|
+
}
|
|
5530
|
+
}
|
|
5531
|
+
function parseEmbeddedBalanceDetails(message) {
|
|
5532
|
+
const jsonStart = message.indexOf('{"error"');
|
|
5533
|
+
if (jsonStart < 0) return void 0;
|
|
5534
|
+
try {
|
|
5535
|
+
let depth = 0;
|
|
5536
|
+
let inString = false;
|
|
5537
|
+
let escaped = false;
|
|
5538
|
+
let jsonEnd = -1;
|
|
5539
|
+
for (let i = jsonStart; i < message.length; i += 1) {
|
|
5540
|
+
const char = message[i];
|
|
5541
|
+
if (inString) {
|
|
5542
|
+
if (escaped) escaped = false;
|
|
5543
|
+
else if (char === "\\") escaped = true;
|
|
5544
|
+
else if (char === '"') inString = false;
|
|
5545
|
+
} else if (char === '"') {
|
|
5546
|
+
inString = true;
|
|
5547
|
+
} else if (char === "{") {
|
|
5548
|
+
depth += 1;
|
|
5549
|
+
} else if (char === "}" && --depth === 0) {
|
|
5550
|
+
jsonEnd = i + 1;
|
|
5551
|
+
break;
|
|
5552
|
+
}
|
|
5553
|
+
}
|
|
5554
|
+
if (jsonEnd < 0) return void 0;
|
|
5555
|
+
const parsed = JSON.parse(message.slice(jsonStart, jsonEnd));
|
|
5556
|
+
if (!parsed || typeof parsed !== "object") return void 0;
|
|
5557
|
+
const error = parsed.error;
|
|
5558
|
+
if (!error || typeof error !== "object") return void 0;
|
|
5559
|
+
const details = error.details;
|
|
5560
|
+
if (!details || typeof details !== "object") return void 0;
|
|
5561
|
+
const requiredBalance = details.requiredBalance;
|
|
5562
|
+
const currentBalance = details.currentBalance;
|
|
5563
|
+
if (typeof requiredBalance !== "number" || typeof currentBalance !== "number") {
|
|
5564
|
+
return void 0;
|
|
5565
|
+
}
|
|
5566
|
+
if (!Number.isFinite(requiredBalance) || !Number.isFinite(currentBalance) || requiredBalance <= 0) {
|
|
5567
|
+
return void 0;
|
|
5568
|
+
}
|
|
5569
|
+
return { required: String(requiredBalance), current: String(currentBalance) };
|
|
5570
|
+
} catch {
|
|
5571
|
+
return void 0;
|
|
5572
|
+
}
|
|
5573
|
+
}
|
|
5450
5574
|
async function resolveCurrentMachineId(options) {
|
|
5451
5575
|
return options.currentMachineIdResolver ? options.currentMachineIdResolver(options.env) : detectCurrentMachineId(options.env);
|
|
5452
5576
|
}
|
|
@@ -5677,7 +5801,6 @@ function describeLocalRunFailure(message, rawError) {
|
|
|
5677
5801
|
busyDetail = rawError.detail.trim();
|
|
5678
5802
|
}
|
|
5679
5803
|
if (/PLATFORM_LLM_BUSY|服务器紧张/.test(message)) {
|
|
5680
|
-
const stripDebugNoise = (s) => s.replace(/\s*raw=".*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
|
|
5681
5804
|
const shown = stripDebugNoise(
|
|
5682
5805
|
message.replace(/\s*\(PLATFORM_LLM_BUSY\)\s*$/, "")
|
|
5683
5806
|
);
|
|
@@ -5688,7 +5811,18 @@ function describeLocalRunFailure(message, rawError) {
|
|
|
5688
5811
|
if (/UPSTREAM_402|Insufficient Balance|余额不足|insufficient\s+balance/i.test(
|
|
5689
5812
|
message
|
|
5690
5813
|
)) {
|
|
5691
|
-
|
|
5814
|
+
const cleanedMessage = stripDebugNoise(message);
|
|
5815
|
+
const fallback = cleanedMessage.replace(
|
|
5816
|
+
/^[^:]*provider failed: HTTP \d{3}\s*/,
|
|
5817
|
+
""
|
|
5818
|
+
);
|
|
5819
|
+
const balanceDetails = parseEmbeddedBalanceDetails(cleanedMessage);
|
|
5820
|
+
const shownMessage = balanceDetails ? t(
|
|
5821
|
+
"balanceInsufficientReason",
|
|
5822
|
+
balanceDetails.required,
|
|
5823
|
+
balanceDetails.current
|
|
5824
|
+
) : extractEmbeddedErrorMessage(cleanedMessage) ?? fallback;
|
|
5825
|
+
return `[nolo] ${shownMessage}
|
|
5692
5826
|
`;
|
|
5693
5827
|
}
|
|
5694
5828
|
const cls = classifyLocalRunError(message);
|
|
@@ -18,6 +18,8 @@ var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
|
|
|
18
18
|
fireworks: "https://api.fireworks.ai/inference/v1/chat/completions",
|
|
19
19
|
google: "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions",
|
|
20
20
|
openai: "https://api.openai.com/v1/chat/completions",
|
|
21
|
+
// xAI 官方 OpenAI 兼容模式(平台托管 Grok)
|
|
22
|
+
xai: "https://api.x.ai/v1/chat/completions",
|
|
21
23
|
openrouter: "https://openrouter.ai/api/v1/chat/completions",
|
|
22
24
|
// 千问 AI 平台 OpenAI 兼容模式
|
|
23
25
|
qwen: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions",
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
inlineImageUrlsForCustomProvider,
|
|
6
6
|
prepareTools,
|
|
7
7
|
shouldInlineImageUrlsForAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-H5QLIP6S.js";
|
|
9
9
|
import {
|
|
10
10
|
INVALID_TOOL_ARGS_REPLACEMENT,
|
|
11
11
|
buildInvalidToolCallSelfHealResult,
|
|
12
12
|
parseToolCallArguments,
|
|
13
13
|
performFetchRequest,
|
|
14
14
|
sanitizeOutboundMessages
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-TZRB2I2M.js";
|
|
16
16
|
import {
|
|
17
17
|
createSSEParser,
|
|
18
18
|
createToolRunId,
|
|
@@ -23,22 +23,22 @@ import {
|
|
|
23
23
|
toolRunSetPending,
|
|
24
24
|
toolRunStarted,
|
|
25
25
|
toolRunSucceeded
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5SLTA66C.js";
|
|
27
27
|
import {
|
|
28
28
|
getPublicImageAgentMode
|
|
29
29
|
} from "./chunk-VIDPVFP3.js";
|
|
30
30
|
import {
|
|
31
31
|
getCurrentSpaceId
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-DFY6O64O.js";
|
|
33
33
|
import {
|
|
34
34
|
addToolMessage,
|
|
35
35
|
messageStreamEnd,
|
|
36
36
|
messageStreaming,
|
|
37
37
|
updateToolMessage
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-PGKZ2KGE.js";
|
|
39
39
|
import {
|
|
40
40
|
streamAgentChatTurn
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-KOZ2G3ZG.js";
|
|
42
42
|
import {
|
|
43
43
|
addActiveController,
|
|
44
44
|
removeActiveController,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deleteDialog,
|
|
3
3
|
toast
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PGKZ2KGE.js";
|
|
5
5
|
import {
|
|
6
6
|
deleteServerSyncedCredential
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KOZ2G3ZG.js";
|
|
8
8
|
import {
|
|
9
9
|
require_date_fns
|
|
10
10
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
resolvePlatformChatCompletionsEndpoint,
|
|
4
4
|
resolvePlatformHostedCredentialProvider,
|
|
5
5
|
resolvePlatformResponsesEndpoint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AV4Z57LV.js";
|
|
7
7
|
import {
|
|
8
8
|
CLIENT_VERSION_TOO_OLD_CODE,
|
|
9
9
|
buildClientVersionGateErrorDetail,
|
|
@@ -304,7 +304,7 @@ var slice = createSliceWithThunks({
|
|
|
304
304
|
const overrides = {};
|
|
305
305
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
306
306
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
307
|
-
const { _executeModel } = await import("./_executeModel-
|
|
307
|
+
const { _executeModel } = await import("./_executeModel-36GKPAEZ.js");
|
|
308
308
|
return _executeModel(
|
|
309
309
|
{
|
|
310
310
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -325,7 +325,7 @@ var slice = createSliceWithThunks({
|
|
|
325
325
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
326
326
|
*/
|
|
327
327
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
328
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
328
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-PU3R3UXA.js");
|
|
329
329
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
330
330
|
{
|
|
331
331
|
agentKey: args.agentKey,
|
|
@@ -341,7 +341,7 @@ var slice = createSliceWithThunks({
|
|
|
341
341
|
* 聊天轮次流式 Agent 调用
|
|
342
342
|
*/
|
|
343
343
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
344
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
344
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-2IH4MTQC.js");
|
|
345
345
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
346
346
|
}),
|
|
347
347
|
/**
|