nolo-cli 0.146.0-alpha.4 → 0.147.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-KCOBSFWR.js → _executeModel-MQFQCXIE.js} +12 -12
- package/{agentEmailCommands-JWAAVWK5.js → agentEmailCommands-SV276XHA.js} +10 -10
- package/{agentMachineCommands-GL4TIGRD.js → agentMachineCommands-IB2WMF3X.js} +1 -1
- package/{agentRecordCommands-ZPVDMPWS.js → agentRecordCommands-D5FUBTKU.js} +10 -10
- package/{agentRunCommand-UF3OUWWS.js → agentRunCommand-TNW4RJ6W.js} +10 -10
- package/{agentSlice-VWIBQKC5.js → agentSlice-L6ILXYZ3.js} +1 -1
- package/{chatQueueReduxAdapter-MBIUZKDL.js → chatQueueReduxAdapter-OUCL4GQF.js} +2 -2
- package/{chunk-I2NACKOX.js → chunk-5ROO623H.js} +2 -2
- package/{chunk-MTS4CSGW.js → chunk-67QZSNVD.js} +2 -2
- package/{chunk-YFIEJTJP.js → chunk-6HWONTC6.js} +1 -1
- package/{chunk-RS4EE3CY.js → chunk-6RO37MST.js} +4 -4
- package/{chunk-LL75KBOF.js → chunk-7V2HN64K.js} +7 -5
- package/{chunk-2Q7IUN6P.js → chunk-A7WFQXNK.js} +4 -4
- package/{chunk-GOMR6S5Z.js → chunk-BJ3KD73I.js} +72 -0
- package/{chunk-ARJISZLY.js → chunk-C4YCNZFV.js} +8 -8
- package/{chunk-XCMPF226.js → chunk-DSY37Y5Z.js} +1 -1
- package/{chunk-45RDJCWY.js → chunk-GP4TSLAB.js} +11 -75
- package/{chunk-6OTOA5MH.js → chunk-JK5XW3NO.js} +1 -1
- package/{chunk-LSEP3JEV.js → chunk-NLBUI6IU.js} +3 -3
- package/{chunk-NAQIJEFD.js → chunk-QWYHDF4G.js} +2 -2
- package/{chunk-3KYLP2QO.js → chunk-WSGZ4I7M.js} +1 -1
- package/{chunk-S4DLQ5OR.js → chunk-XA4RT4LC.js} +6 -6
- package/{chunk-C22W3XQ5.js → chunk-YAE5DQ5C.js} +2 -2
- package/{chunk-PWOXYPE6.js → chunk-YYKMFBK7.js} +112 -0
- package/{commandRegistry-VKPZIDKP.js → commandRegistry-OIUSLAJG.js} +14 -14
- package/{contentThunks-XVHPJRVX.js → contentThunks-5QTQNUD2.js} +3 -3
- package/{createAgentAutomationAction-QY3TENYN.js → createAgentAutomationAction-YQKECXJV.js} +3 -3
- package/{createDialogAction-ETRYMHLA.js → createDialogAction-3NGUXFB7.js} +4 -4
- package/{createPageAction-5VX64XOW.js → createPageAction-6MIKNYUH.js} +3 -3
- package/{dialogSlice-Z7CEY2WY.js → dialogSlice-UGWF2KW6.js} +2 -2
- package/{docStore-IZ6XRQCW.js → docStore-MOM2DHF5.js} +1 -1
- package/{handleSendMessageAction-6XVOLKPH.js → handleSendMessageAction-QD6DK7XX.js} +142 -80
- package/index.js +2 -2
- package/{machineCommands-VVSQOM5V.js → machineCommands-42EQE5E2.js} +10 -10
- package/{machineWsRunDispatch-LKBI7AMM.js → machineWsRunDispatch-QTUFQTZ5.js} +10 -10
- package/package.json +1 -1
- package/{readlineWorkspace-A6I3TDOI.js → readlineWorkspace-2QJL7CU4.js} +10 -10
- package/{runAgentClientLoop-SU23IDMY.js → runAgentClientLoop-2EFDJHKS.js} +10 -10
- package/{streamAgentChatTurn-KJMIQEDI.js → streamAgentChatTurn-IUFYM3LS.js} +18 -121
- package/{tools-M2HTAI6K.js → tools-G7AM5SXM.js} +7 -7
- package/{updateDialogTitleAction-KZZ26EZU.js → updateDialogTitleAction-56P5NFOI.js} +3 -3
|
@@ -11,8 +11,9 @@ import {
|
|
|
11
11
|
} from "./chunk-KQHGZWSV.js";
|
|
12
12
|
import {
|
|
13
13
|
createSSEParser,
|
|
14
|
+
isAgentSkillDisabled,
|
|
14
15
|
waitForAbortableDelay
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BJ3KD73I.js";
|
|
16
17
|
import {
|
|
17
18
|
isGatewayHttpStatus
|
|
18
19
|
} from "./chunk-NF64D32W.js";
|
|
@@ -38,7 +39,7 @@ import {
|
|
|
38
39
|
} from "./chunk-4JMDLJAD.js";
|
|
39
40
|
import {
|
|
40
41
|
createDialogAction
|
|
41
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-5ROO623H.js";
|
|
42
43
|
import {
|
|
43
44
|
addMemberSpace,
|
|
44
45
|
fetchAuthoritativeRemoteSpace,
|
|
@@ -62,7 +63,7 @@ import {
|
|
|
62
63
|
} from "./chunk-VF4K2QE6.js";
|
|
63
64
|
import {
|
|
64
65
|
createDocState
|
|
65
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-67QZSNVD.js";
|
|
66
67
|
import {
|
|
67
68
|
setDialogExtraReferencesAction
|
|
68
69
|
} from "./chunk-Z7IZQF56.js";
|
|
@@ -101,7 +102,7 @@ import {
|
|
|
101
102
|
updateContentCategory,
|
|
102
103
|
updateContentTitle,
|
|
103
104
|
writeStoredCollapsedCategories
|
|
104
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-6HWONTC6.js";
|
|
105
106
|
import {
|
|
106
107
|
getCurrentSpaceId,
|
|
107
108
|
getCurrentSpaceIdRaw,
|
|
@@ -123,14 +124,14 @@ import {
|
|
|
123
124
|
selectMsgById,
|
|
124
125
|
uiAskChoiceFunc,
|
|
125
126
|
uiAskChoiceFunctionSchema
|
|
126
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-C4YCNZFV.js";
|
|
127
128
|
import {
|
|
128
129
|
createAgent,
|
|
129
130
|
deleteServerSyncedCredential,
|
|
130
131
|
runLlm,
|
|
131
132
|
streamAgentChatTurn,
|
|
132
133
|
updateAgent
|
|
133
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-NLBUI6IU.js";
|
|
134
135
|
import {
|
|
135
136
|
getActiveDialogKey,
|
|
136
137
|
selectCurrentDialogKey,
|
|
@@ -144,9 +145,7 @@ import {
|
|
|
144
145
|
} from "./chunk-GMVELWJG.js";
|
|
145
146
|
import {
|
|
146
147
|
listBuiltinSkills,
|
|
147
|
-
|
|
148
|
-
resolveBuiltinSkillByName,
|
|
149
|
-
resolveBuiltinSkillEntry
|
|
148
|
+
resolveBuiltinSkillByName
|
|
150
149
|
} from "./chunk-B2XUQXQX.js";
|
|
151
150
|
import {
|
|
152
151
|
CAPABILITY_PACKS
|
|
@@ -2225,67 +2224,6 @@ Imported from: ${url}` : ""
|
|
|
2225
2224
|
});
|
|
2226
2225
|
}
|
|
2227
2226
|
|
|
2228
|
-
// packages/ai/tools/agentSkillConfig.ts
|
|
2229
|
-
var MODES = [
|
|
2230
|
-
"required",
|
|
2231
|
-
"recommended",
|
|
2232
|
-
"disabled"
|
|
2233
|
-
];
|
|
2234
|
-
var DEFAULT_RECOMMENDED_SKILL_SLUGS = [
|
|
2235
|
-
"worktree-isolation",
|
|
2236
|
-
"systematic-investigation",
|
|
2237
|
-
"show-me"
|
|
2238
|
-
];
|
|
2239
|
-
var asMode = (value) => typeof value === "string" && MODES.includes(value) ? value : null;
|
|
2240
|
-
var resolveAgentSkillConfig = (source) => {
|
|
2241
|
-
const out = {};
|
|
2242
|
-
const skills = source?.skills;
|
|
2243
|
-
if (skills && typeof skills === "object" && !Array.isArray(skills)) {
|
|
2244
|
-
for (const [rawSlug, rawMode] of Object.entries(skills)) {
|
|
2245
|
-
const slug = typeof rawSlug === "string" ? rawSlug.trim() : "";
|
|
2246
|
-
const mode = asMode(rawMode);
|
|
2247
|
-
if (slug && mode) out[slug] = mode;
|
|
2248
|
-
}
|
|
2249
|
-
return out;
|
|
2250
|
-
}
|
|
2251
|
-
for (const slug of asTrimmedNonEmptyStringArray(source?.enabledPacks) ?? []) {
|
|
2252
|
-
out[slug] = "required";
|
|
2253
|
-
}
|
|
2254
|
-
return out;
|
|
2255
|
-
};
|
|
2256
|
-
var resolveAgentRequiredPackIds = (source) => {
|
|
2257
|
-
const config = resolveAgentSkillConfig(source);
|
|
2258
|
-
return Object.keys(config).filter((slug) => config[slug] === "required");
|
|
2259
|
-
};
|
|
2260
|
-
var resolveAgentRecommendedSkillNames = (source, lookup) => {
|
|
2261
|
-
const config = resolveAgentSkillConfig(source);
|
|
2262
|
-
const resolve = lookup ?? defaultSkillTitleLookup;
|
|
2263
|
-
const seen = /* @__PURE__ */ new Set();
|
|
2264
|
-
const out = [];
|
|
2265
|
-
const push = (slug) => {
|
|
2266
|
-
const title = resolve(slug)?.title || slug;
|
|
2267
|
-
if (seen.has(title)) return;
|
|
2268
|
-
seen.add(title);
|
|
2269
|
-
out.push(title);
|
|
2270
|
-
};
|
|
2271
|
-
for (const slug of Object.keys(config)) {
|
|
2272
|
-
if (config[slug] !== "recommended") continue;
|
|
2273
|
-
push(slug);
|
|
2274
|
-
}
|
|
2275
|
-
for (const slug of DEFAULT_RECOMMENDED_SKILL_SLUGS) {
|
|
2276
|
-
if (Object.hasOwn(config, slug)) continue;
|
|
2277
|
-
push(slug);
|
|
2278
|
-
}
|
|
2279
|
-
return out;
|
|
2280
|
-
};
|
|
2281
|
-
var defaultSkillTitleLookup = (slug) => {
|
|
2282
|
-
const cap = resolveBuiltinCapability(slug);
|
|
2283
|
-
if (cap) return { title: cap.title };
|
|
2284
|
-
const skill = resolveBuiltinSkillEntry(slug);
|
|
2285
|
-
return skill ? { title: skill.title } : null;
|
|
2286
|
-
};
|
|
2287
|
-
var isAgentSkillDisabled = (source, slug) => resolveAgentSkillConfig(source)[slug] === "disabled";
|
|
2288
|
-
|
|
2289
2227
|
// packages/ai/tools/loadSkillTool.ts
|
|
2290
2228
|
var loadSkillFunctionSchema = {
|
|
2291
2229
|
name: "loadSkill",
|
|
@@ -3985,7 +3923,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
3985
3923
|
const deletedDialogIds = [];
|
|
3986
3924
|
const deletedDialogKeys = [];
|
|
3987
3925
|
const failures = [];
|
|
3988
|
-
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-
|
|
3926
|
+
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-UGWF2KW6.js");
|
|
3989
3927
|
for (const target of targets) {
|
|
3990
3928
|
try {
|
|
3991
3929
|
await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
|
|
@@ -14842,7 +14780,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
14842
14780
|
if (!executionInput) {
|
|
14843
14781
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
14844
14782
|
}
|
|
14845
|
-
const { findToolExecutor: findToolExecutor2 } = await import("./tools-
|
|
14783
|
+
const { findToolExecutor: findToolExecutor2 } = await import("./tools-G7AM5SXM.js");
|
|
14846
14784
|
const { executor } = findToolExecutor2(run.toolName);
|
|
14847
14785
|
toolRunStarted({
|
|
14848
14786
|
id: run.id,
|
|
@@ -17349,7 +17287,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
17349
17287
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
17350
17288
|
};
|
|
17351
17289
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
17352
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
17290
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-MOM2DHF5.js");
|
|
17353
17291
|
if (getDocState().pageKey === id) {
|
|
17354
17292
|
applyExternalDocUpdate({
|
|
17355
17293
|
slateData: finalSlateData,
|
|
@@ -19669,8 +19607,6 @@ export {
|
|
|
19669
19607
|
clipMultilineText,
|
|
19670
19608
|
fetchAndSerializeTable,
|
|
19671
19609
|
getToolResultErrorData,
|
|
19672
|
-
resolveAgentRequiredPackIds,
|
|
19673
|
-
resolveAgentRecommendedSkillNames,
|
|
19674
19610
|
readXPostFunctionSchema,
|
|
19675
19611
|
readXPostFunc,
|
|
19676
19612
|
readXhsProfileFunctionSchema,
|
|
@@ -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-MQFQCXIE.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-2EFDJHKS.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-IUFYM3LS.js");
|
|
345
345
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
346
346
|
}),
|
|
347
347
|
/**
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
inlineImageUrlsForCustomProvider,
|
|
6
6
|
prepareTools,
|
|
7
7
|
shouldInlineImageUrlsForAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QWYHDF4G.js";
|
|
9
9
|
import {
|
|
10
10
|
parseApiError
|
|
11
11
|
} from "./chunk-OCZKATRC.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
parseToolCallArguments,
|
|
16
16
|
performFetchRequest,
|
|
17
17
|
sanitizeOutboundMessages
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-A7WFQXNK.js";
|
|
19
19
|
import {
|
|
20
20
|
createToolRunId,
|
|
21
21
|
findToolExecutor,
|
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
toolRunSetPending,
|
|
26
26
|
toolRunStarted,
|
|
27
27
|
toolRunSucceeded
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-GP4TSLAB.js";
|
|
29
29
|
import {
|
|
30
30
|
createSSEParser
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-BJ3KD73I.js";
|
|
32
32
|
import {
|
|
33
33
|
getCurrentSpaceId
|
|
34
34
|
} from "./chunk-ZJ7UHBJS.js";
|
|
@@ -37,10 +37,10 @@ import {
|
|
|
37
37
|
messageStreamEnd,
|
|
38
38
|
messageStreaming,
|
|
39
39
|
updateToolMessage
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-C4YCNZFV.js";
|
|
41
41
|
import {
|
|
42
42
|
streamAgentChatTurn
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-NLBUI6IU.js";
|
|
44
44
|
import {
|
|
45
45
|
addActiveController,
|
|
46
46
|
removeActiveController,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7V2HN64K.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GP4TSLAB.js";
|
|
8
8
|
import {
|
|
9
9
|
runLocalAgentTurn
|
|
10
10
|
} from "./chunk-O7WXJIUI.js";
|
|
@@ -1,6 +1,117 @@
|
|
|
1
|
+
import {
|
|
2
|
+
asOptionalFiniteNumber
|
|
3
|
+
} from "./chunk-WWC7I6TA.js";
|
|
1
4
|
import {
|
|
2
5
|
isAbortError
|
|
3
6
|
} from "./chunk-QOKAKDPE.js";
|
|
7
|
+
import {
|
|
8
|
+
isRecord
|
|
9
|
+
} from "./chunk-KUG52IAP.js";
|
|
10
|
+
import {
|
|
11
|
+
asOptionalTrimmedString
|
|
12
|
+
} from "./chunk-G3SUCT4W.js";
|
|
13
|
+
|
|
14
|
+
// packages/ai/agent/projectDesktopToolUiContent.ts
|
|
15
|
+
var DESKTOP_TOOL_UI_CONTENT_MAX_CHARS = 48e3;
|
|
16
|
+
function clipUiText(value, max = DESKTOP_TOOL_UI_CONTENT_MAX_CHARS) {
|
|
17
|
+
if (value.length <= max) return value;
|
|
18
|
+
return `${value.slice(0, Math.max(0, max - 20))}
|
|
19
|
+
\u2026[truncated for UI]`;
|
|
20
|
+
}
|
|
21
|
+
function tryParseJsonRecord(text) {
|
|
22
|
+
const trimmed2 = text.trim();
|
|
23
|
+
if (!trimmed2.startsWith("{") && !trimmed2.startsWith("[")) return null;
|
|
24
|
+
try {
|
|
25
|
+
const parsed = JSON.parse(trimmed2);
|
|
26
|
+
return isRecord(parsed) ? parsed : null;
|
|
27
|
+
} catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function parseShellToolTextContent(content) {
|
|
32
|
+
const text = content ?? "";
|
|
33
|
+
if (!text.trim()) return { stdout: "", stderr: "" };
|
|
34
|
+
const exitMatch = text.match(/(?:^|\n)exitCode:\s*(-?\d+)\s*$/);
|
|
35
|
+
const exitCode = exitMatch ? Number(exitMatch[1]) : void 0;
|
|
36
|
+
const body = (exitMatch ? text.slice(0, exitMatch.index) : text).replace(
|
|
37
|
+
/\s+$/,
|
|
38
|
+
""
|
|
39
|
+
);
|
|
40
|
+
let stdout = "";
|
|
41
|
+
let stderr = "";
|
|
42
|
+
if (body.startsWith("stdout:\n") || body.includes("\nstdout:\n")) {
|
|
43
|
+
const afterStdout = body.replace(/^[\s\S]*?stdout:\n/, "");
|
|
44
|
+
if (afterStdout.includes("\n\nstderr:\n")) {
|
|
45
|
+
const [out, err] = afterStdout.split("\n\nstderr:\n");
|
|
46
|
+
stdout = out ?? "";
|
|
47
|
+
stderr = err ?? "";
|
|
48
|
+
} else if (afterStdout.startsWith("stderr:\n")) {
|
|
49
|
+
stderr = afterStdout.slice("stderr:\n".length);
|
|
50
|
+
} else {
|
|
51
|
+
stdout = afterStdout;
|
|
52
|
+
}
|
|
53
|
+
} else if (body.startsWith("stderr:\n") || body.includes("\nstderr:\n")) {
|
|
54
|
+
stderr = body.replace(/^[\s\S]*?stderr:\n/, "");
|
|
55
|
+
} else {
|
|
56
|
+
stdout = body;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
stdout,
|
|
60
|
+
stderr,
|
|
61
|
+
...typeof exitCode === "number" && Number.isFinite(exitCode) ? { exitCode } : {}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function resolveShellCommand(metadata, argumentsPreview) {
|
|
65
|
+
return asOptionalTrimmedString(metadata.command) || asOptionalTrimmedString(metadata.cmd) || asOptionalTrimmedString(argumentsPreview) || "";
|
|
66
|
+
}
|
|
67
|
+
function projectDesktopToolUiContent(args) {
|
|
68
|
+
const toolName = asOptionalTrimmedString(args.toolName) || "tool";
|
|
69
|
+
const metadata = isRecord(args.metadata) ? args.metadata : {};
|
|
70
|
+
const rawContent = typeof args.content === "string" ? args.content : typeof args.summary === "string" ? args.summary : typeof args.message === "string" ? args.message : "";
|
|
71
|
+
if (toolName === "setTodoList") {
|
|
72
|
+
const existing = tryParseJsonRecord(rawContent);
|
|
73
|
+
if (existing && Array.isArray(existing.todos)) {
|
|
74
|
+
return clipUiText(JSON.stringify({ todos: existing.todos }));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (toolName === "execShell") {
|
|
78
|
+
const existing = tryParseJsonRecord(rawContent);
|
|
79
|
+
if (existing && (typeof existing.stdout === "string" || typeof existing.command === "string" || typeof existing.stderr === "string")) {
|
|
80
|
+
const command2 = asOptionalTrimmedString(existing.command) || resolveShellCommand(metadata, args.argumentsPreview);
|
|
81
|
+
return JSON.stringify({
|
|
82
|
+
...existing,
|
|
83
|
+
command: command2,
|
|
84
|
+
cwd: asOptionalTrimmedString(existing.cwd) || asOptionalTrimmedString(metadata.cwd) || null,
|
|
85
|
+
exitCode: asOptionalFiniteNumber(existing.exitCode) ?? asOptionalFiniteNumber(metadata.exitCode)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const parsed = parseShellToolTextContent(rawContent);
|
|
89
|
+
const command = resolveShellCommand(metadata, args.argumentsPreview);
|
|
90
|
+
return JSON.stringify({
|
|
91
|
+
command,
|
|
92
|
+
cwd: asOptionalTrimmedString(metadata.cwd) || null,
|
|
93
|
+
stdout: clipUiText(parsed.stdout),
|
|
94
|
+
stderr: clipUiText(parsed.stderr),
|
|
95
|
+
exitCode: asOptionalFiniteNumber(metadata.exitCode) ?? parsed.exitCode,
|
|
96
|
+
timedOut: metadata.timedOut === true,
|
|
97
|
+
blocked: metadata.blocked === true
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (toolName === "readFile" || toolName === "read_file") {
|
|
101
|
+
const filePath = asOptionalTrimmedString(metadata.path) || asOptionalTrimmedString(metadata.filePath) || asOptionalTrimmedString(metadata.file_path) || asOptionalTrimmedString(args.argumentsPreview) || "";
|
|
102
|
+
const body = typeof args.content === "string" && args.content || typeof args.summary === "string" && args.summary || typeof args.message === "string" && args.message || "";
|
|
103
|
+
return JSON.stringify({
|
|
104
|
+
filePath,
|
|
105
|
+
content: clipUiText(body),
|
|
106
|
+
...asOptionalFiniteNumber(metadata.startLine) != null ? { startLine: asOptionalFiniteNumber(metadata.startLine) } : {},
|
|
107
|
+
...asOptionalFiniteNumber(metadata.endLine) != null ? { endLine: asOptionalFiniteNumber(metadata.endLine) } : {},
|
|
108
|
+
...asOptionalFiniteNumber(metadata.totalLines) != null ? { totalLines: asOptionalFiniteNumber(metadata.totalLines) } : {},
|
|
109
|
+
...metadata.truncated === true ? { truncated: true } : {}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
const preferred = typeof args.content === "string" && args.content || typeof args.summary === "string" && args.summary || typeof args.message === "string" && args.message || "";
|
|
113
|
+
return clipUiText(preferred);
|
|
114
|
+
}
|
|
4
115
|
|
|
5
116
|
// packages/ai/agent/foregroundTurnAdmissionFetch.ts
|
|
6
117
|
var FOREGROUND_TURN_KEEPALIVE_MAX_BODY_BYTES = 60 * 1024;
|
|
@@ -189,6 +300,7 @@ async function consumeAgentRunStream(handlers) {
|
|
|
189
300
|
}
|
|
190
301
|
|
|
191
302
|
export {
|
|
303
|
+
projectDesktopToolUiContent,
|
|
192
304
|
buildForegroundTurnAdmissionFetchInit,
|
|
193
305
|
consumeAgentRunStream
|
|
194
306
|
};
|
|
@@ -103,7 +103,7 @@ function createDaemonShortcutCommand(path, description, command) {
|
|
|
103
103
|
// packages/cli/agentInternalCommandEntries.ts
|
|
104
104
|
function getAgentInternalCommandEntries() {
|
|
105
105
|
const createAgentRunCommand = (path, description) => createContextCommand(path, description, async (args, ctx) => {
|
|
106
|
-
const { runAgentRunCommand } = await import("./agentRunCommand-
|
|
106
|
+
const { runAgentRunCommand } = await import("./agentRunCommand-TNW4RJ6W.js");
|
|
107
107
|
return runAgentRunCommand(args, {
|
|
108
108
|
env: ctx.env,
|
|
109
109
|
scriptDir: ctx.scriptDir,
|
|
@@ -119,7 +119,7 @@ function getAgentInternalCommandEntries() {
|
|
|
119
119
|
return runAgentListCommand(args, deps);
|
|
120
120
|
}),
|
|
121
121
|
createEnvCommand(["agent", "create"], "Create a new agent", async (args, deps) => {
|
|
122
|
-
const { runAgentCreateCommand } = await import("./agentRecordCommands-
|
|
122
|
+
const { runAgentCreateCommand } = await import("./agentRecordCommands-D5FUBTKU.js");
|
|
123
123
|
return runAgentCreateCommand(args, deps);
|
|
124
124
|
}),
|
|
125
125
|
createEnvCommand(["agent", "models"], "List models available on an OpenAI-compatible provider", async (args, deps) => {
|
|
@@ -135,7 +135,7 @@ function getAgentInternalCommandEntries() {
|
|
|
135
135
|
return runAgentPullCommand(args, deps);
|
|
136
136
|
}),
|
|
137
137
|
createEnvCommand(["agent", "read"], "Read a single agent", async (args, deps) => {
|
|
138
|
-
const { runAgentReadCommand } = await import("./agentRecordCommands-
|
|
138
|
+
const { runAgentReadCommand } = await import("./agentRecordCommands-D5FUBTKU.js");
|
|
139
139
|
return runAgentReadCommand(args, deps);
|
|
140
140
|
}),
|
|
141
141
|
createAgentRunCommand(["agent", "run"], "Run an agent"),
|
|
@@ -164,26 +164,26 @@ function getAgentInternalCommandEntries() {
|
|
|
164
164
|
return runSetupOfflineMarxistsAgentCommand(args, deps);
|
|
165
165
|
}),
|
|
166
166
|
createEnvCommand(["agent", "update"], "Update agent fields", async (args, deps) => {
|
|
167
|
-
const { runAgentUpdateCommand } = await import("./agentRecordCommands-
|
|
167
|
+
const { runAgentUpdateCommand } = await import("./agentRecordCommands-D5FUBTKU.js");
|
|
168
168
|
return runAgentUpdateCommand(args, deps);
|
|
169
169
|
}),
|
|
170
170
|
createEnvCommand(["agent", "email", "provision"], "Provision a controlled inbox for an agent", async (args, deps) => {
|
|
171
|
-
const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-
|
|
171
|
+
const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-SV276XHA.js");
|
|
172
172
|
return runAgentEmailProvisionCommand(args, deps);
|
|
173
173
|
}),
|
|
174
174
|
createEnvCommand(["agent", "email", "bind"], "Bind an existing email address to an agent", async (args, deps) => {
|
|
175
|
-
const { runAgentEmailBindCommand } = await import("./agentEmailCommands-
|
|
175
|
+
const { runAgentEmailBindCommand } = await import("./agentEmailCommands-SV276XHA.js");
|
|
176
176
|
return runAgentEmailBindCommand(args, deps);
|
|
177
177
|
}),
|
|
178
178
|
createEnvCommand(["agent", "email", "transfer"], "Transfer an email identity from one agent to another (cross-account)", async (args, deps) => {
|
|
179
|
-
const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-
|
|
179
|
+
const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-SV276XHA.js");
|
|
180
180
|
return runAgentEmailTransferCommand(args, deps);
|
|
181
181
|
}),
|
|
182
182
|
createEnvCommand(
|
|
183
183
|
["agent", "email", "create-and-provision"],
|
|
184
184
|
"Create an agent and provision its controlled inbox",
|
|
185
185
|
async (args, deps) => {
|
|
186
|
-
const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-
|
|
186
|
+
const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-SV276XHA.js");
|
|
187
187
|
return runAgentEmailCreateAndProvisionCommand(args, deps);
|
|
188
188
|
}
|
|
189
189
|
),
|
|
@@ -204,15 +204,15 @@ function getAgentInternalCommandEntries() {
|
|
|
204
204
|
return runAgentRevokeGrantCommand(args, deps);
|
|
205
205
|
}),
|
|
206
206
|
createEnvCommand(["agent", "bind-current"], "Bind an agent to this machine", async (args, deps) => {
|
|
207
|
-
const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-
|
|
207
|
+
const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-IB2WMF3X.js");
|
|
208
208
|
return runAgentBindCurrentCommand(args, deps);
|
|
209
209
|
}),
|
|
210
210
|
createEnvCommand(["agent", "smoke-current"], "Smoke test a bound agent through this machine", async (args, deps) => {
|
|
211
|
-
const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-
|
|
211
|
+
const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-IB2WMF3X.js");
|
|
212
212
|
return runAgentSmokeCurrentCommand(args, deps);
|
|
213
213
|
}),
|
|
214
214
|
createEnvCommand(["agent", "runtime-doctor"], "Diagnose current machine runtime compatibility", async (args, deps) => {
|
|
215
|
-
const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-
|
|
215
|
+
const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-IB2WMF3X.js");
|
|
216
216
|
return runAgentRuntimeDoctorCommand(args, deps);
|
|
217
217
|
}),
|
|
218
218
|
createAgentRunCommand(["agent", "chat"], "Chat with an agent")
|
|
@@ -473,15 +473,15 @@ function getSystemInternalCommandEntries(renderHelpText2) {
|
|
|
473
473
|
return runWhoamiCommand({ args, env: ctx.env });
|
|
474
474
|
}),
|
|
475
475
|
createEntrypointEnvCommand(["connect"], "Send machine heartbeats or hold a connector websocket", async (args, deps) => {
|
|
476
|
-
const { runMachineConnectCommand } = await import("./machineCommands-
|
|
476
|
+
const { runMachineConnectCommand } = await import("./machineCommands-42EQE5E2.js");
|
|
477
477
|
return runMachineConnectCommand(args, deps);
|
|
478
478
|
}),
|
|
479
479
|
createDaemonShortcutCommand(["daemon"], "Run the connector daemon shortcut", async (args, deps) => {
|
|
480
|
-
const { runMachineConnectCommand } = await import("./machineCommands-
|
|
480
|
+
const { runMachineConnectCommand } = await import("./machineCommands-42EQE5E2.js");
|
|
481
481
|
return runMachineConnectCommand(args, deps);
|
|
482
482
|
}),
|
|
483
483
|
createEnvCommand(["machine", "status"], "List machines registered to the current profile", async (args, deps) => {
|
|
484
|
-
const { runMachineStatusCommand } = await import("./machineCommands-
|
|
484
|
+
const { runMachineStatusCommand } = await import("./machineCommands-42EQE5E2.js");
|
|
485
485
|
return runMachineStatusCommand(args, deps);
|
|
486
486
|
}),
|
|
487
487
|
createEnvCommand(["doctor", "runtime"], "Diagnose local-first agent runtime selection", async (args, deps) => {
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
updateContentPinned,
|
|
8
8
|
updateContentTitle,
|
|
9
9
|
uploadAndAddFileToSpace
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6HWONTC6.js";
|
|
11
11
|
import "./chunk-ZJ7UHBJS.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-C4YCNZFV.js";
|
|
13
13
|
import "./chunk-523DITKR.js";
|
|
14
14
|
import "./chunk-YYLHWIW6.js";
|
|
15
15
|
import "./chunk-6O4IK4V2.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-NLBUI6IU.js";
|
|
17
17
|
import "./chunk-D76D3RTR.js";
|
|
18
18
|
import "./chunk-5RGU3J7P.js";
|
|
19
19
|
import "./chunk-M76ECQRD.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6HWONTC6.js";
|
|
4
4
|
import "./chunk-ZJ7UHBJS.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-C4YCNZFV.js";
|
|
6
6
|
import "./chunk-523DITKR.js";
|
|
7
7
|
import "./chunk-YYLHWIW6.js";
|
|
8
8
|
import "./chunk-6O4IK4V2.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-NLBUI6IU.js";
|
|
10
10
|
import "./chunk-D76D3RTR.js";
|
|
11
11
|
import "./chunk-5RGU3J7P.js";
|
|
12
12
|
import "./chunk-M76ECQRD.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDialogAction,
|
|
3
3
|
isLocalOwnerDialogAgents
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5ROO623H.js";
|
|
5
|
+
import "./chunk-6HWONTC6.js";
|
|
6
6
|
import "./chunk-ZJ7UHBJS.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-C4YCNZFV.js";
|
|
8
8
|
import "./chunk-523DITKR.js";
|
|
9
9
|
import "./chunk-YYLHWIW6.js";
|
|
10
10
|
import "./chunk-6O4IK4V2.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-NLBUI6IU.js";
|
|
12
12
|
import "./chunk-D76D3RTR.js";
|
|
13
13
|
import "./chunk-5RGU3J7P.js";
|
|
14
14
|
import "./chunk-M76ECQRD.js";
|
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
addContentToSpace,
|
|
16
16
|
client_default
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6HWONTC6.js";
|
|
18
18
|
import {
|
|
19
19
|
getCurrentSpaceId
|
|
20
20
|
} from "./chunk-ZJ7UHBJS.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-C4YCNZFV.js";
|
|
22
22
|
import "./chunk-523DITKR.js";
|
|
23
23
|
import "./chunk-YYLHWIW6.js";
|
|
24
24
|
import "./chunk-6O4IK4V2.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-NLBUI6IU.js";
|
|
26
26
|
import "./chunk-D76D3RTR.js";
|
|
27
27
|
import "./chunk-5RGU3J7P.js";
|
|
28
28
|
import "./chunk-M76ECQRD.js";
|
|
@@ -20,11 +20,11 @@ import {
|
|
|
20
20
|
switchDialogAgent,
|
|
21
21
|
updateDialogTitle,
|
|
22
22
|
updateTokens
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-C4YCNZFV.js";
|
|
24
24
|
import "./chunk-523DITKR.js";
|
|
25
25
|
import "./chunk-YYLHWIW6.js";
|
|
26
26
|
import "./chunk-6O4IK4V2.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-NLBUI6IU.js";
|
|
28
28
|
import "./chunk-D76D3RTR.js";
|
|
29
29
|
import {
|
|
30
30
|
getActiveDialogAgentId
|