nolo-cli 0.66.0-alpha.4 → 0.67.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-UYF2UEIG.js → _executeModel-C5K4UL5I.js} +13 -13
- package/{agentDeleteCommand-7SWSSU4X.js → agentDeleteCommand-7RESZDRC.js} +6 -6
- package/{agentEmailCommands-UAF3YDG6.js → agentEmailCommands-KES5FG2E.js} +15 -15
- package/{agentListCommands-473D3OB3.js → agentListCommands-VFBLREFU.js} +8 -8
- package/{agentMachineCommands-NWHVKMP7.js → agentMachineCommands-UJ77TKWZ.js} +6 -6
- package/{agentRecordCommands-G5ZQQNEC.js → agentRecordCommands-MZBPYUGL.js} +15 -15
- package/{agentRunCommand-ZTRT252J.js → agentRunCommand-R3RWG53B.js} +15 -15
- package/{agentRuntimeLocal-3JLUMWN7.js → agentRuntimeLocal-BD7R3OJL.js} +3 -3
- package/{agentSlice-RPMDYBLC.js → agentSlice-UP66DIC2.js} +1 -1
- package/{appDeleteCommands-SCJZAMUA.js → appDeleteCommands-X3UF4ZHF.js} +7 -7
- package/{appDeployCommands-RVBQZJUT.js → appDeployCommands-MFHLJIYZ.js} +7 -7
- package/{appDeployStatusCommands-BUPLMNTO.js → appDeployStatusCommands-BGXSUHY6.js} +7 -7
- package/{appGetCommands-NQ34IZRG.js → appGetCommands-KEA6FZTF.js} +7 -7
- package/{appListCommands-KZHI5DQM.js → appListCommands-CZGMZW3L.js} +7 -7
- package/{chatQueueReduxAdapter-2Z6DYXAG.js → chatQueueReduxAdapter-VVXE2NXW.js} +2 -2
- package/{chunk-J2WQUFGG.js → chunk-5DUAG5G7.js} +40 -24
- package/{chunk-FHAGENAS.js → chunk-AUKZOZFG.js} +1 -1
- package/{chunk-76JYRUX4.js → chunk-AVJQ4TDL.js} +14 -1
- package/{chunk-UZPQSVM6.js → chunk-B62OSA77.js} +1 -1
- package/{chunk-XOPPOOTE.js → chunk-BG7ZGBKH.js} +5 -4
- package/{chunk-6AAQCFLQ.js → chunk-CLZYOOI3.js} +8 -8
- package/{chunk-4SCMOQRM.js → chunk-FPT2E44F.js} +2 -2
- package/{chunk-G2MPS44L.js → chunk-HPRMNGAM.js} +1 -1
- package/{chunk-YDNDUOB5.js → chunk-IF6UQNAK.js} +1 -1
- package/{chunk-RNYLWVME.js → chunk-IOZR6BLM.js} +3 -3
- package/{chunk-37XDGCY7.js → chunk-JWO3RQSH.js} +1 -1
- package/{chunk-BWHZ4H2Q.js → chunk-MN2XJEWL.js} +7 -7
- package/{chunk-HUZUAHZ6.js → chunk-NFTTUZ3L.js} +2 -2
- package/{chunk-UMIARYFE.js → chunk-OHJWIXXW.js} +3 -3
- package/{chunk-P7OOB7QP.js → chunk-Q4OT2DC7.js} +1 -1
- package/{chunk-CTCW7U7N.js → chunk-Q6FF2MCK.js} +1 -1
- package/{chunk-XCNSZUQA.js → chunk-QPXRNDI3.js} +2 -2
- package/{chunk-ZSR7L46Q.js → chunk-RCNQCXPM.js} +43 -27
- package/{chunk-PEZJEQAO.js → chunk-T7PQFKJU.js} +105 -35
- package/{chunk-6B2AUXKR.js → chunk-TTTW4DIT.js} +5 -5
- package/{chunk-5P6YOSF3.js → chunk-UBWLW3KY.js} +4 -4
- package/{chunk-6X5B2VF5.js → chunk-UFTOGLCE.js} +1 -1
- package/{chunk-GVYMHBG3.js → chunk-UNAVSDC5.js} +1 -1
- package/{chunk-RRY4U37C.js → chunk-UZXOOSHF.js} +7 -7
- package/{chunk-RJ2SAFB5.js → chunk-V3ZKNK5D.js} +550 -1
- package/{contentThunks-GMRDVLFD.js → contentThunks-BHML6O7K.js} +3 -3
- package/{createAgentAutomationAction-CH6Q7JMD.js → createAgentAutomationAction-K5YJO4IA.js} +3 -3
- package/{createDialogAction-ARYHXJ2V.js → createDialogAction-SFMZLPS4.js} +4 -4
- package/{createPageAction-RAPK4J4H.js → createPageAction-UD7BSFQS.js} +3 -3
- package/{dialogCommands-JAAYSIOE.js → dialogCommands-2ABSL4ND.js} +7 -7
- package/{dialogSlice-CJNADK2R.js → dialogSlice-DEC5GV6X.js} +2 -2
- package/{docCreateCommands-U5OCW42O.js → docCreateCommands-2QZCW4HZ.js} +6 -6
- package/{docDeleteCommands-6RAGSIKC.js → docDeleteCommands-WKZKQAKM.js} +7 -7
- package/{docReadCommands-ID6VUNQD.js → docReadCommands-WMKJCR4Q.js} +6 -6
- package/{docStore-6ZFYOHQT.js → docStore-IBPCRTTX.js} +1 -1
- package/{docUpdateCommands-UIC4LWFG.js → docUpdateCommands-KPLM63NK.js} +6 -6
- package/{handleSendMessageAction-36NZDUHT.js → handleSendMessageAction-C7CZNGMB.js} +2 -2
- package/index.js +40 -40
- package/{machineCommands-25QIEYZQ.js → machineCommands-6BG3AHT5.js} +14 -14
- package/{machineWsRunDispatch-HWYVWOIE.js → machineWsRunDispatch-G2KJ6NQF.js} +14 -14
- package/package.json +1 -1
- package/{readlineWorkspace-22XWLYEH.js → readlineWorkspace-5LZ3EDIQ.js} +18 -18
- package/{runAgentClientLoop-NYNYXB5C.js → runAgentClientLoop-CICP3O2T.js} +11 -11
- package/{spaceCommands-VWJ2BUYK.js → spaceCommands-NQOIERT6.js} +6 -6
- package/{streamAgentChatTurn-EK4UVC2Y.js → streamAgentChatTurn-QUD4FY5I.js} +12 -12
- package/{tools-U4GOB2KS.js → tools-MAP6O2YZ.js} +8 -8
- package/{updateDialogTitleAction-EXREKMC5.js → updateDialogTitleAction-L6CCRVUK.js} +3 -3
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
requiresBareImageUrl,
|
|
40
40
|
resolveToolGuidedSections,
|
|
41
41
|
toBareImageUrlMessages
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-AVJQ4TDL.js";
|
|
43
43
|
import {
|
|
44
44
|
convertMessagesToResponsesInput,
|
|
45
45
|
extractReasoningFromResponseOutput,
|
|
@@ -60,14 +60,19 @@ import {
|
|
|
60
60
|
buildProviderExecutionPlan
|
|
61
61
|
} from "./chunk-VLQRD7ZJ.js";
|
|
62
62
|
import {
|
|
63
|
+
BRIDGE_STREAM_MAX_CHARS,
|
|
64
|
+
DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
|
|
63
65
|
NOLO_WORKSPACE_TOOL_NAMES,
|
|
64
66
|
applyToolSurfaceConstraints,
|
|
67
|
+
buildDialogReadEnvelope,
|
|
65
68
|
buildNoloWorkspaceCommandArgs,
|
|
69
|
+
createStreamingDialogReadProjector,
|
|
66
70
|
noloPositiveIntegerString,
|
|
67
71
|
noloStringArg,
|
|
68
72
|
parseNoloWorkspaceToolArguments,
|
|
73
|
+
readTextStreamUpToChars,
|
|
69
74
|
resolveNoloDialogInput
|
|
70
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-V3ZKNK5D.js";
|
|
71
76
|
import {
|
|
72
77
|
buildDialogFallbackTitleFromUserInput
|
|
73
78
|
} from "./chunk-2MBTWINN.js";
|
|
@@ -13210,7 +13215,7 @@ ${metadataText}` : "";
|
|
|
13210
13215
|
content: contentForProjection,
|
|
13211
13216
|
toolName: args2.toolName
|
|
13212
13217
|
});
|
|
13213
|
-
spillNote = `; spillFile=${spill.displayPath}; totalLines=${spill.totalLines}`;
|
|
13218
|
+
spillNote = `; spillFile=${spill.displayPath}; totalLines=${spill.totalLines}; hint=read full output via readFile`;
|
|
13214
13219
|
} catch {
|
|
13215
13220
|
}
|
|
13216
13221
|
}
|
|
@@ -15675,6 +15680,7 @@ async function executeLocalToolWithPolicy(args2) {
|
|
|
15675
15680
|
import { existsSync as existsSync3 } from "node:fs";
|
|
15676
15681
|
import { createHash as createHash3 } from "node:crypto";
|
|
15677
15682
|
import { lstat, mkdir, readdir as readdir2, readFile as readFile3, realpath, stat as stat3, writeFile } from "node:fs/promises";
|
|
15683
|
+
import { homedir } from "node:os";
|
|
15678
15684
|
import { dirname, isAbsolute as isAbsolute2, relative as relative3, resolve as resolve4, sep } from "node:path";
|
|
15679
15685
|
import { spawn as spawnChildProcess3 } from "node:child_process";
|
|
15680
15686
|
|
|
@@ -17434,11 +17440,11 @@ function buildWorkspacePathProperty() {
|
|
|
17434
17440
|
return {
|
|
17435
17441
|
type: "string",
|
|
17436
17442
|
minLength: 1,
|
|
17437
|
-
description: "Path relative to the workspace root. Defaults to workspace root when omitted."
|
|
17443
|
+
description: "Path relative to the workspace root. Absolute paths and ~/ (home directory) are also accepted. Defaults to workspace root when omitted."
|
|
17438
17444
|
};
|
|
17439
17445
|
}
|
|
17440
17446
|
function buildReadWorkspaceDescription() {
|
|
17441
|
-
return "Read a UTF-8 text file inside the workspace. Use lines for focused range reads after search to save tokens. A range already delivered earlier for an unchanged file answers with a short notice instead of resending (force:true refetches).";
|
|
17447
|
+
return "Read a UTF-8 text file inside the workspace. Absolute paths and ~/ are also accepted (runtime spill files can be read directly). Use lines for focused range reads after search to save tokens. A range already delivered earlier for an unchanged file answers with a short notice instead of resending (force:true refetches).";
|
|
17442
17448
|
}
|
|
17443
17449
|
function buildReadWorkspaceParameters() {
|
|
17444
17450
|
const path = buildWorkspacePathProperty();
|
|
@@ -18259,9 +18265,14 @@ async function resolveRuntimeOwnedSpillPath(targetPath) {
|
|
|
18259
18265
|
return null;
|
|
18260
18266
|
}
|
|
18261
18267
|
}
|
|
18268
|
+
function expandHomePath(requestedPath) {
|
|
18269
|
+
if (requestedPath === "~") return homedir();
|
|
18270
|
+
if (requestedPath.startsWith("~/")) return resolve4(homedir(), requestedPath.slice(2));
|
|
18271
|
+
return requestedPath;
|
|
18272
|
+
}
|
|
18262
18273
|
async function resolveLocalWorkspaceToolPath(args2) {
|
|
18263
18274
|
const workspaceRoot = resolve4(args2.workspaceRoot);
|
|
18264
|
-
const targetPath = resolve4(workspaceRoot, args2.requestedPath);
|
|
18275
|
+
const targetPath = resolve4(workspaceRoot, expandHomePath(args2.requestedPath));
|
|
18265
18276
|
const insideWorkspace = isPathInsideWorkspace({ workspaceRoot, targetPath });
|
|
18266
18277
|
const trustedSpillPath = !insideWorkspace && args2.allowRuntimeOwnedSpill === true ? await resolveRuntimeOwnedSpillPath(targetPath) : null;
|
|
18267
18278
|
if (!insideWorkspace && trustedSpillPath === null) {
|
|
@@ -19102,8 +19113,7 @@ function buildLocalDialogWritePlan(args2) {
|
|
|
19102
19113
|
|
|
19103
19114
|
// packages/agent-runtime/noloWorkspaceTools.node.ts
|
|
19104
19115
|
async function readNoloProcessStream(readable) {
|
|
19105
|
-
|
|
19106
|
-
return new Response(readable).text();
|
|
19116
|
+
return readTextStreamUpToChars(readable, BRIDGE_STREAM_MAX_CHARS);
|
|
19107
19117
|
}
|
|
19108
19118
|
async function runNoloWorkspaceCliTool(call, args2) {
|
|
19109
19119
|
const cliArgs = buildNoloWorkspaceCommandArgs(call);
|
|
@@ -19123,16 +19133,18 @@ async function runNoloWorkspaceCliTool(call, args2) {
|
|
|
19123
19133
|
readNoloProcessStream(proc.stderr),
|
|
19124
19134
|
proc.exited
|
|
19125
19135
|
]);
|
|
19126
|
-
const content = `${stdout}${stderr}`;
|
|
19136
|
+
const content = `${stdout.text}${stderr.text}`;
|
|
19127
19137
|
if (exitCode !== 0) {
|
|
19128
19138
|
throw new Error(content.trim() || `nolo ${cliArgs.join(" ")} exited ${exitCode}`);
|
|
19129
19139
|
}
|
|
19140
|
+
const bridgedOutputTruncated = stdout.truncated || stderr.truncated;
|
|
19130
19141
|
return {
|
|
19131
19142
|
content,
|
|
19132
19143
|
metadata: {
|
|
19133
19144
|
[args2.metadataKind ?? "noloWorkspaceTool"]: true,
|
|
19134
19145
|
command: ["nolo", ...cliArgs].join(" "),
|
|
19135
|
-
exitCode
|
|
19146
|
+
exitCode,
|
|
19147
|
+
...bridgedOutputTruncated ? { bridgedOutputTruncated: true } : {}
|
|
19136
19148
|
}
|
|
19137
19149
|
};
|
|
19138
19150
|
}
|
|
@@ -19148,7 +19160,7 @@ async function readDialogInProcess(call, store, env) {
|
|
|
19148
19160
|
const { dbKey: dialogKey, dialogId } = resolveNoloDialogInput(dialogInput, userId);
|
|
19149
19161
|
const meta = await store.read(dialogKey, { remote: false });
|
|
19150
19162
|
if (mode === "status") {
|
|
19151
|
-
const
|
|
19163
|
+
const result4 = {
|
|
19152
19164
|
dialogId,
|
|
19153
19165
|
dialogKey,
|
|
19154
19166
|
meta,
|
|
@@ -19157,35 +19169,39 @@ async function readDialogInProcess(call, store, env) {
|
|
|
19157
19169
|
source: "in-process"
|
|
19158
19170
|
};
|
|
19159
19171
|
return {
|
|
19160
|
-
content: JSON.stringify(
|
|
19172
|
+
content: JSON.stringify(result4, null, 2),
|
|
19161
19173
|
metadata: { noloWorkspaceTool: true, readDialog: true, inProcess: true, mode: "status" }
|
|
19162
19174
|
};
|
|
19163
19175
|
}
|
|
19164
19176
|
const limitNum = noloPositiveIntegerString(args2.limit);
|
|
19165
19177
|
const limit = limitNum ? Number(limitNum) : void 0;
|
|
19166
|
-
const
|
|
19178
|
+
const projector = createStreamingDialogReadProjector({
|
|
19179
|
+
maxResponseChars: DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
|
|
19180
|
+
...limit !== void 0 ? { maxMessages: limit } : {}
|
|
19181
|
+
});
|
|
19167
19182
|
if (store.iterator) {
|
|
19168
19183
|
const { start, end: end3 } = dialogMessageRange(dialogId);
|
|
19169
19184
|
for await (const [, value] of store.iterator({ gte: start, lte: end3 })) {
|
|
19170
|
-
const message = localDialogMessageRecordToRuntimeMessage(value);
|
|
19185
|
+
const message = localDialogMessageRecordToRuntimeMessage(value) ?? value;
|
|
19171
19186
|
if (message) {
|
|
19172
|
-
|
|
19173
|
-
} else if (value) {
|
|
19174
|
-
rawMessages.push(value);
|
|
19187
|
+
projector.addMessage(message);
|
|
19175
19188
|
}
|
|
19176
19189
|
}
|
|
19177
19190
|
}
|
|
19178
|
-
const
|
|
19179
|
-
const
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
|
|
19183
|
-
|
|
19184
|
-
|
|
19185
|
-
|
|
19186
|
-
|
|
19191
|
+
const projected = projector.finish(meta);
|
|
19192
|
+
const built = buildDialogReadEnvelope({
|
|
19193
|
+
meta: projected.meta,
|
|
19194
|
+
messages: projected.messages,
|
|
19195
|
+
stats: projected.stats,
|
|
19196
|
+
envelope: {
|
|
19197
|
+
dialogId,
|
|
19198
|
+
dialogKey,
|
|
19199
|
+
messagesCount: projected.stats.messagesReturned,
|
|
19200
|
+
source: "in-process"
|
|
19201
|
+
}
|
|
19202
|
+
});
|
|
19187
19203
|
return {
|
|
19188
|
-
content:
|
|
19204
|
+
content: built.serialized,
|
|
19189
19205
|
metadata: { noloWorkspaceTool: true, readDialog: true, inProcess: true }
|
|
19190
19206
|
};
|
|
19191
19207
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
listUserRecordsFromServers,
|
|
8
8
|
readDbRecordFromServers,
|
|
9
9
|
readLiveDbRecordAfterTombstoneMerge
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Q4OT2DC7.js";
|
|
11
11
|
import {
|
|
12
12
|
fetchWithTransientRetry
|
|
13
13
|
} from "./chunk-5XTOKQLW.js";
|
|
@@ -26,6 +26,11 @@ import {
|
|
|
26
26
|
resolveLocalDialogDbCandidates,
|
|
27
27
|
resolveServerDbPath
|
|
28
28
|
} from "./chunk-GLKOYSRU.js";
|
|
29
|
+
import {
|
|
30
|
+
boundSummaryText,
|
|
31
|
+
buildDialogReadEnvelope,
|
|
32
|
+
projectDialogReadForAgent
|
|
33
|
+
} from "./chunk-V3ZKNK5D.js";
|
|
29
34
|
import {
|
|
30
35
|
toErrorMessage
|
|
31
36
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -204,7 +209,8 @@ var VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
|
204
209
|
"--subject-role",
|
|
205
210
|
"--token",
|
|
206
211
|
"--machine-key",
|
|
207
|
-
"--user"
|
|
212
|
+
"--user",
|
|
213
|
+
"--max-response-chars"
|
|
208
214
|
]);
|
|
209
215
|
function hasFlag(args, flag) {
|
|
210
216
|
return args.includes(flag);
|
|
@@ -416,6 +422,10 @@ Options:
|
|
|
416
422
|
--server <url> Prefer this server when reading by raw dialog id.
|
|
417
423
|
--token <jwt> Override AUTH_TOKEN.
|
|
418
424
|
--user <userId> Override dialog owner for raw dialog ids.
|
|
425
|
+
--max-response-chars <n>
|
|
426
|
+
Cap the serialized response for agent/automation callers
|
|
427
|
+
(shared budget projection; oversized fields are head-truncated
|
|
428
|
+
with projection stats). Omit for the default full human export.
|
|
419
429
|
|
|
420
430
|
Reads dialog metadata and messages as JSON.
|
|
421
431
|
`);
|
|
@@ -467,6 +477,12 @@ function readDialogLimitArg(args, fallback) {
|
|
|
467
477
|
if (!raw) return fallback;
|
|
468
478
|
return parsePositiveIntegerOrFallback(raw, fallback);
|
|
469
479
|
}
|
|
480
|
+
function readDialogMaxResponseCharsArg(args) {
|
|
481
|
+
const raw = readOption(args, "--max-response-chars");
|
|
482
|
+
if (!raw) return null;
|
|
483
|
+
const parsed = Number(raw);
|
|
484
|
+
return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : null;
|
|
485
|
+
}
|
|
470
486
|
function readDialogOwnerId(args, env, authToken) {
|
|
471
487
|
return readOption(args, "--user") ?? env.USER_ID ?? parseUserIdFromAuthToken(authToken) ?? "";
|
|
472
488
|
}
|
|
@@ -1247,12 +1263,66 @@ async function runDialogReadCommand(args, deps = {}) {
|
|
|
1247
1263
|
readLocalDialogAtDbPath: deps.readLocalDialogAtDbPath
|
|
1248
1264
|
});
|
|
1249
1265
|
const orderedMsgs = Array.isArray(read.msgs) ? [...read.msgs].reverse() : read.msgs;
|
|
1250
|
-
const
|
|
1251
|
-
const
|
|
1266
|
+
const agentMaxResponseChars = readDialogMaxResponseCharsArg(args);
|
|
1267
|
+
const agentProjection = agentMaxResponseChars && Array.isArray(orderedMsgs) ? projectDialogReadForAgent({
|
|
1268
|
+
meta: read.meta,
|
|
1269
|
+
messages: orderedMsgs,
|
|
1270
|
+
options: { maxResponseChars: agentMaxResponseChars }
|
|
1271
|
+
}) : null;
|
|
1272
|
+
const outputMeta = agentProjection ? agentProjection.meta : read.meta;
|
|
1273
|
+
const outputMsgs = agentProjection ? agentProjection.messages : orderedMsgs;
|
|
1274
|
+
const lastAssistantMessage = Array.isArray(outputMsgs) ? [...outputMsgs].reverse().find((message) => message?.role === "assistant" || message?.authorRole === "assistant") : null;
|
|
1275
|
+
const toolMessages = Array.isArray(outputMsgs) ? outputMsgs.filter((message) => message?.role === "tool" || message?.authorRole === "tool") : [];
|
|
1252
1276
|
const toolNamesFromMessages = toolMessages.map((message) => toToolName(message?.toolName ?? message?.name)).filter(Boolean);
|
|
1253
|
-
const toolsUsed = Array.isArray(
|
|
1254
|
-
const writtenFiles = Array.isArray(
|
|
1255
|
-
const toolErrors = Array.isArray(
|
|
1277
|
+
const toolsUsed = Array.isArray(outputMeta?.toolsUsed) && outputMeta.toolsUsed.length > 0 ? outputMeta.toolsUsed.map((tool) => toToolName(tool)).filter(Boolean) : uniq(toolNamesFromMessages);
|
|
1278
|
+
const writtenFiles = Array.isArray(outputMeta?.writtenFiles) && outputMeta.writtenFiles.length > 0 ? uniq(asTrimmedNonEmptyStringArray(outputMeta.writtenFiles)) : deriveWrittenFiles(toolMessages);
|
|
1279
|
+
const toolErrors = Array.isArray(outputMeta?.toolErrors) && outputMeta.toolErrors.length > 0 ? uniq(asTrimmedNonEmptyStringArray(outputMeta.toolErrors)) : deriveToolErrors(toolMessages);
|
|
1280
|
+
const toolSummary = {
|
|
1281
|
+
metaToolsCount: toolsUsed.length,
|
|
1282
|
+
metaToolsUnique: [...new Set(toolsUsed)],
|
|
1283
|
+
toolMessageCount: toolMessages.length,
|
|
1284
|
+
toolNamesFromMessages: [...new Set(toolNamesFromMessages)],
|
|
1285
|
+
toolMessageCountsByName: countByName(toolNamesFromMessages)
|
|
1286
|
+
};
|
|
1287
|
+
if (agentProjection && agentMaxResponseChars) {
|
|
1288
|
+
const newestAssistant = Array.isArray(outputMsgs) ? [...outputMsgs].reverse().find(
|
|
1289
|
+
(message) => message?.role === "assistant" || message?.authorRole === "assistant"
|
|
1290
|
+
) : null;
|
|
1291
|
+
const lastAssistantSummary = newestAssistant ? {
|
|
1292
|
+
role: newestAssistant?.role ?? newestAssistant?.authorRole ?? null,
|
|
1293
|
+
contentHead: boundSummaryText(
|
|
1294
|
+
typeof newestAssistant?.content === "string" ? newestAssistant.content : newestAssistant?.content ? JSON.stringify(newestAssistant.content) : "",
|
|
1295
|
+
200
|
|
1296
|
+
)
|
|
1297
|
+
} : null;
|
|
1298
|
+
const built = buildDialogReadEnvelope({
|
|
1299
|
+
meta: read.meta,
|
|
1300
|
+
messages: agentProjection.messages,
|
|
1301
|
+
stats: agentProjection.stats,
|
|
1302
|
+
envelope: {
|
|
1303
|
+
source: read.source,
|
|
1304
|
+
base: read.resolvedBase,
|
|
1305
|
+
triedBases: read.candidateBases,
|
|
1306
|
+
httpAttempts: read.attempts,
|
|
1307
|
+
spaceId: target.spaceId ?? null,
|
|
1308
|
+
dialogId: target.dialogId,
|
|
1309
|
+
dialogKey: target.dialogKey,
|
|
1310
|
+
userId: target.userId ?? null,
|
|
1311
|
+
messagesCount: agentProjection.stats.messagesReturned
|
|
1312
|
+
},
|
|
1313
|
+
summary: {
|
|
1314
|
+
writtenFiles,
|
|
1315
|
+
toolsUsed,
|
|
1316
|
+
toolErrors,
|
|
1317
|
+
toolSummary,
|
|
1318
|
+
lastAssistantMessage: lastAssistantSummary
|
|
1319
|
+
},
|
|
1320
|
+
options: { maxResponseChars: agentMaxResponseChars }
|
|
1321
|
+
});
|
|
1322
|
+
output.write(built.serialized);
|
|
1323
|
+
output.write("\n");
|
|
1324
|
+
return 0;
|
|
1325
|
+
}
|
|
1256
1326
|
output.write(JSON.stringify({
|
|
1257
1327
|
source: read.source,
|
|
1258
1328
|
base: read.resolvedBase,
|
|
@@ -1262,31 +1332,31 @@ async function runDialogReadCommand(args, deps = {}) {
|
|
|
1262
1332
|
dialogId: target.dialogId,
|
|
1263
1333
|
dialogKey: target.dialogKey,
|
|
1264
1334
|
userId: target.userId,
|
|
1265
|
-
title:
|
|
1266
|
-
cybots: Array.isArray(
|
|
1267
|
-
category:
|
|
1268
|
-
inheritedFromDialogKey:
|
|
1269
|
-
inheritedFromDialogTitle:
|
|
1270
|
-
parentDialogId:
|
|
1271
|
-
rootDialogId:
|
|
1272
|
-
triggerType:
|
|
1273
|
-
executionMode:
|
|
1274
|
-
threadKind:
|
|
1275
|
-
presentationIntent:
|
|
1276
|
-
parentThreadId:
|
|
1277
|
-
rootThreadId:
|
|
1278
|
-
runtimeBinding:
|
|
1279
|
-
runtimeContext:
|
|
1280
|
-
parentWake:
|
|
1281
|
-
subjectRefs: Array.isArray(
|
|
1282
|
-
status:
|
|
1283
|
-
errorMessage:
|
|
1284
|
-
runtimeCheckpoint:
|
|
1285
|
-
durationMs:
|
|
1286
|
-
finishedAt:
|
|
1287
|
-
createdAt:
|
|
1288
|
-
updatedAt:
|
|
1289
|
-
artifacts:
|
|
1335
|
+
title: outputMeta?.title ?? null,
|
|
1336
|
+
cybots: Array.isArray(outputMeta?.cybots) ? outputMeta.cybots : [],
|
|
1337
|
+
category: outputMeta?.category ?? null,
|
|
1338
|
+
inheritedFromDialogKey: outputMeta?.inheritedFromDialogKey ?? null,
|
|
1339
|
+
inheritedFromDialogTitle: outputMeta?.inheritedFromDialogTitle ?? null,
|
|
1340
|
+
parentDialogId: outputMeta?.parentDialogId ?? null,
|
|
1341
|
+
rootDialogId: outputMeta?.rootDialogId ?? null,
|
|
1342
|
+
triggerType: outputMeta?.triggerType ?? null,
|
|
1343
|
+
executionMode: outputMeta?.executionMode ?? null,
|
|
1344
|
+
threadKind: outputMeta?.threadKind ?? null,
|
|
1345
|
+
presentationIntent: outputMeta?.presentationIntent ?? null,
|
|
1346
|
+
parentThreadId: outputMeta?.parentThreadId ?? null,
|
|
1347
|
+
rootThreadId: outputMeta?.rootThreadId ?? null,
|
|
1348
|
+
runtimeBinding: outputMeta?.runtimeBinding ?? null,
|
|
1349
|
+
runtimeContext: outputMeta?.runtimeContext ?? null,
|
|
1350
|
+
parentWake: outputMeta?.parentWake ?? null,
|
|
1351
|
+
subjectRefs: Array.isArray(outputMeta?.subjectRefs) ? outputMeta.subjectRefs : [],
|
|
1352
|
+
status: outputMeta?.status,
|
|
1353
|
+
errorMessage: outputMeta?.errorMessage ?? null,
|
|
1354
|
+
runtimeCheckpoint: outputMeta?.runtimeCheckpoint ?? null,
|
|
1355
|
+
durationMs: outputMeta?.durationMs,
|
|
1356
|
+
finishedAt: outputMeta?.finishedAt,
|
|
1357
|
+
createdAt: outputMeta?.createdAt,
|
|
1358
|
+
updatedAt: outputMeta?.updatedAt,
|
|
1359
|
+
artifacts: outputMeta?.artifacts ?? null,
|
|
1290
1360
|
writtenFiles,
|
|
1291
1361
|
toolsUsed,
|
|
1292
1362
|
toolErrors,
|
|
@@ -1297,10 +1367,10 @@ async function runDialogReadCommand(args, deps = {}) {
|
|
|
1297
1367
|
toolNamesFromMessages: [...new Set(toolNamesFromMessages)],
|
|
1298
1368
|
toolMessageCountsByName: countByName(toolNamesFromMessages)
|
|
1299
1369
|
},
|
|
1300
|
-
agentReply:
|
|
1301
|
-
messagesCount: Array.isArray(
|
|
1370
|
+
agentReply: outputMeta?.agentReply ?? null,
|
|
1371
|
+
messagesCount: Array.isArray(outputMsgs) ? outputMsgs.length : 0,
|
|
1302
1372
|
lastAssistantMessage,
|
|
1303
|
-
messages:
|
|
1373
|
+
messages: outputMsgs
|
|
1304
1374
|
}, null, 2));
|
|
1305
1375
|
output.write("\n");
|
|
1306
1376
|
return 0;
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
inlineImageUrlsForCustomProvider,
|
|
6
6
|
prepareTools,
|
|
7
7
|
shouldInlineImageUrlsForAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UNAVSDC5.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-BG7ZGBKH.js";
|
|
16
16
|
import {
|
|
17
17
|
createSSEParser,
|
|
18
18
|
createToolRunId,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
toolRunSetPending,
|
|
24
24
|
toolRunStarted,
|
|
25
25
|
toolRunSucceeded
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5DUAG5G7.js";
|
|
27
27
|
import {
|
|
28
28
|
getPublicImageAgentMode
|
|
29
29
|
} from "./chunk-VIDPVFP3.js";
|
|
@@ -35,10 +35,10 @@ import {
|
|
|
35
35
|
messageStreamEnd,
|
|
36
36
|
messageStreaming,
|
|
37
37
|
updateToolMessage
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-CLZYOOI3.js";
|
|
39
39
|
import {
|
|
40
40
|
streamAgentChatTurn
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-OHJWIXXW.js";
|
|
42
42
|
import {
|
|
43
43
|
addActiveController,
|
|
44
44
|
removeActiveController,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MN2XJEWL.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5DUAG5G7.js";
|
|
8
8
|
import {
|
|
9
9
|
runLocalAgentTurn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RCNQCXPM.js";
|
|
11
11
|
import {
|
|
12
12
|
applyToolSurfaceConstraints
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-V3ZKNK5D.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveLocalRuntimeEnvFromPolicy
|
|
16
16
|
} from "./chunk-3JQ2NRYU.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
resolveLocalUserId,
|
|
28
28
|
t,
|
|
29
29
|
toolLabel
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-MN2XJEWL.js";
|
|
31
31
|
import {
|
|
32
32
|
createRunActivityTracker,
|
|
33
33
|
popSingleQueueMessage,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
readDbRecord,
|
|
49
49
|
resolveAgentRecordFromHybridStore
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-AUKZOZFG.js";
|
|
51
51
|
import {
|
|
52
52
|
isLocalCliAgentKey
|
|
53
53
|
} from "./chunk-SPAQ4PVV.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
} from "./chunk-LTRXGFMS.js";
|
|
64
64
|
import {
|
|
65
65
|
formatAgentListCard
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-5DUAG5G7.js";
|
|
67
67
|
import {
|
|
68
68
|
isTransientFetchError
|
|
69
69
|
} from "./chunk-5XTOKQLW.js";
|
|
@@ -84,12 +84,12 @@ import {
|
|
|
84
84
|
chooseMemoryOwners,
|
|
85
85
|
loadMemoryCandidatesFromDb,
|
|
86
86
|
resolveAgentMemoryPolicy
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-FPT2E44F.js";
|
|
88
88
|
import {
|
|
89
89
|
API_REPORTED_COST_MULTIPLIER,
|
|
90
90
|
normalizeUsage,
|
|
91
91
|
parseUiAskChoiceContent
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-CLZYOOI3.js";
|
|
93
93
|
import {
|
|
94
94
|
isOAuthApiKeyRef
|
|
95
95
|
} from "./chunk-YYLHWIW6.js";
|
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
LOCAL_AGENT_CONFIG_MISSING_CODE,
|
|
113
113
|
LOCAL_TURN_ABORTED_CODE,
|
|
114
114
|
readActionGate
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-RCNQCXPM.js";
|
|
116
116
|
import {
|
|
117
117
|
resolveAgentRuntimeConfigFromRecord
|
|
118
118
|
} from "./chunk-Y7PULBIA.js";
|
|
@@ -5176,7 +5176,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
|
|
|
5176
5176
|
// packages/cli/client/agentRun.ts
|
|
5177
5177
|
import { ulid } from "ulid";
|
|
5178
5178
|
async function loadRunLocalAgentTurn() {
|
|
5179
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
5179
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-BD7R3OJL.js");
|
|
5180
5180
|
return runLocalAgentTurn;
|
|
5181
5181
|
}
|
|
5182
5182
|
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();
|