nolo-cli 0.34.0-alpha.1 → 0.35.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.
Files changed (57) hide show
  1. package/{_executeModel-BUYCXZCQ.js → _executeModel-RV52PPE3.js} +11 -11
  2. package/{agentDeleteCommand-WSS2IJVM.js → agentDeleteCommand-FBBW3IIM.js} +2 -2
  3. package/{agentEmailCommands-SHTPJTSX.js → agentEmailCommands-7F4PCABZ.js} +12 -12
  4. package/{agentListCommands-GV6UYVAF.js → agentListCommands-ZQXPSB6U.js} +2 -2
  5. package/{agentMachineCommands-FLD7TAFH.js → agentMachineCommands-E3NB67GM.js} +3 -3
  6. package/{agentRecordCommands-57W6R7QW.js → agentRecordCommands-7PXWHCQM.js} +12 -12
  7. package/{agentRunCommand-HJGXSMDN.js → agentRunCommand-Z4654ONK.js} +13 -13
  8. package/{agentRunControl-GXOB47YI.js → agentRunControl-7MUPSYDQ.js} +3 -1
  9. package/{agentRuntimeLocal-G7ZV55I6.js → agentRuntimeLocal-OBKWKEKW.js} +2 -2
  10. package/{agentSlice-HFR7SP3B.js → agentSlice-B2IMSPH5.js} +1 -1
  11. package/{agentSuperviseCommands-Q64S5SPG.js → agentSuperviseCommands-MKWW3ICX.js} +3 -3
  12. package/{appDeleteCommands-SHHE56Y2.js → appDeleteCommands-72BE7DSA.js} +2 -2
  13. package/{appDeployCommands-WUMSO2VS.js → appDeployCommands-XJBLKCYO.js} +2 -2
  14. package/{appDeployStatusCommands-VZSVN6SR.js → appDeployStatusCommands-EC4HWCBQ.js} +2 -2
  15. package/{appGetCommands-ZJ2C3A5Y.js → appGetCommands-62BAATPL.js} +2 -2
  16. package/{appListCommands-W33L6U5X.js → appListCommands-5EZCONM7.js} +2 -2
  17. package/{chatQueueReduxAdapter-SYIX4ODY.js → chatQueueReduxAdapter-SSF3DNBX.js} +2 -2
  18. package/{chunk-AUH2LTIY.js → chunk-55C3UZSC.js} +3 -3
  19. package/{chunk-6KYCG5GW.js → chunk-5Q4DXT47.js} +9 -9
  20. package/{chunk-DX6BP4K7.js → chunk-7KY6U7MW.js} +8 -8
  21. package/{chunk-VSA6QAGV.js → chunk-E2OQ5N2F.js} +40 -10
  22. package/{chunk-LQ6PUHW6.js → chunk-EFN2AFWF.js} +252 -64
  23. package/{chunk-4HOXB6SY.js → chunk-IMHO5LC6.js} +100 -27
  24. package/{chunk-VD2SO4RG.js → chunk-INXNBCEY.js} +2 -2
  25. package/{chunk-HDT2RB7T.js → chunk-KPJYUEPE.js} +1 -1
  26. package/{chunk-3LWZNEGQ.js → chunk-LFOILL6R.js} +1 -1
  27. package/{chunk-LAUUAYLK.js → chunk-OCJNJUR4.js} +2 -2
  28. package/{chunk-VBD7W4Q6.js → chunk-OGPQ3AMC.js} +14 -10
  29. package/{chunk-FDKEDU7R.js → chunk-P62APAXL.js} +2 -2
  30. package/{chunk-MI2J67UU.js → chunk-P66M7LSQ.js} +16 -1
  31. package/{chunk-KCBK4MDT.js → chunk-RUVWTAK7.js} +3 -3
  32. package/{chunk-3XZUNRYF.js → chunk-SDAPQUSO.js} +7 -7
  33. package/{chunk-74IQ5RRO.js → chunk-Z7D7MBWR.js} +1 -1
  34. package/{chunk-YRP7LG4R.js → chunk-ZOEE4OVX.js} +7 -16
  35. package/{chunk-7YDKVLAE.js → chunk-ZZDWMZFU.js} +3 -3
  36. package/{createAgentAutomationAction-BH3D2L2H.js → createAgentAutomationAction-IDIY6K45.js} +3 -3
  37. package/{createDialogAction-U4LDV2RW.js → createDialogAction-5LB4YBPS.js} +4 -4
  38. package/{createPageAction-Q2ANG535.js → createPageAction-TJWVDPZD.js} +3 -3
  39. package/{dialogCommands-C556D6WD.js → dialogCommands-44NGBPJJ.js} +2 -2
  40. package/{dialogSlice-P2VSKG2X.js → dialogSlice-62JC4ZMX.js} +2 -2
  41. package/{docCreateCommands-AAVGLQWE.js → docCreateCommands-IOGYJ7F7.js} +2 -2
  42. package/{docDeleteCommands-PKMKSQD2.js → docDeleteCommands-RO4BZWFP.js} +2 -2
  43. package/{docReadCommands-2WUH7UXC.js → docReadCommands-F2KNOJFW.js} +2 -2
  44. package/{docStore-J5UWRBB4.js → docStore-ZRNKZZXU.js} +4 -4
  45. package/{docUpdateCommands-B2N4E5HQ.js → docUpdateCommands-2VG4AYOC.js} +2 -2
  46. package/{handleSendMessageAction-RRZ53YYH.js → handleSendMessageAction-YB64A32O.js} +2 -2
  47. package/index.js +46 -46
  48. package/{machineCommands-CWKMJG33.js → machineCommands-6WPICTON.js} +12 -12
  49. package/{machineWsRunDispatch-UYNVNX4A.js → machineWsRunDispatch-4OGEZTYG.js} +12 -12
  50. package/package.json +1 -1
  51. package/{readlineWorkspace-VYELP22P.js → readlineWorkspace-BZAZ5YXM.js} +127 -78
  52. package/{runAgentClientLoop-35GKZDOZ.js → runAgentClientLoop-SOZS3YTQ.js} +8 -8
  53. package/{spaceCommands-AAKQM2PM.js → spaceCommands-WEASK3IV.js} +2 -2
  54. package/{spaceSlice-NSNGR4Y2.js → spaceSlice-2QNUKRN6.js} +3 -3
  55. package/{streamAgentChatTurn-D5IDHXMV.js → streamAgentChatTurn-BYI7UXAA.js} +10 -10
  56. package/{tools-JQOETZP5.js → tools-E6FEUNZY.js} +6 -6
  57. package/{updateDialogTitleAction-WOTSDSFQ.js → updateDialogTitleAction-2A3BEXSP.js} +3 -3
@@ -1,11 +1,13 @@
1
1
  import {
2
+ resolveRunLogPath,
2
3
  resolveRunReportJsonPath,
3
4
  resolveRunReportPath,
4
5
  resolveRunsDir
5
- } from "./chunk-VSA6QAGV.js";
6
+ } from "./chunk-E2OQ5N2F.js";
6
7
 
7
8
  // packages/cli/agentRunReport.ts
8
9
  import { homedir as nodeHomedir } from "node:os";
10
+ import { join } from "node:path";
9
11
  import * as nodeFs from "node:fs";
10
12
  import {
11
13
  execFileSync as nodeExecFileSync,
@@ -186,6 +188,48 @@ function parseDoDResultsFromMarkdown(markdown) {
186
188
  const passed = dodResults.length > 0 && dodResults.every((r) => r.exitCode === 0);
187
189
  return { passed, dodResults };
188
190
  }
191
+ function extractChildAgentOutput(logPath, deps = {}) {
192
+ if (!logPath) return void 0;
193
+ const fs = deps.fs ?? nodeFs;
194
+ let raw;
195
+ try {
196
+ raw = fs.readFileSync(logPath, "utf8");
197
+ } catch {
198
+ return void 0;
199
+ }
200
+ const stripped = raw.replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g, "").replace(/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/g, "").replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "");
201
+ const lines = stripped.split(/\r?\n/);
202
+ let lastMarkerLineIdx = -1;
203
+ for (let i = lines.length - 1; i >= 0; i--) {
204
+ const line = lines[i];
205
+ if (/^(?:agent-[^\s>]+|[a-zA-Z0-9_@/.-]+)\s*>\s*/.test(line)) {
206
+ lastMarkerLineIdx = i;
207
+ break;
208
+ }
209
+ }
210
+ if (lastMarkerLineIdx === -1) return void 0;
211
+ const collectedLines = [];
212
+ const firstLine = lines[lastMarkerLineIdx];
213
+ const firstMarkerIdx = firstLine.indexOf(" > ");
214
+ collectedLines.push(firstLine.slice(firstMarkerIdx + 3));
215
+ for (let j = lastMarkerLineIdx + 1; j < lines.length; j++) {
216
+ const line = lines[j];
217
+ if (line.startsWith("[nolo] dialog") || line.startsWith("[nolo] background dialog")) {
218
+ break;
219
+ }
220
+ collectedLines.push(line);
221
+ }
222
+ const joined = collectedLines.join("\n").trim();
223
+ if (!joined) return void 0;
224
+ const MAX_CHARS = 2e3;
225
+ const chars = Array.from(joined);
226
+ if (chars.length > MAX_CHARS) {
227
+ return `${chars.slice(0, MAX_CHARS).join("")}
228
+
229
+ ...(\u622A\u65AD\uFF0C\u5B8C\u6574\u65E5\u5FD7\u8BF7\u67E5\u770B log)...`;
230
+ }
231
+ return joined;
232
+ }
189
233
  async function buildRunReportData(record, deps = {}) {
190
234
  const now = (deps.now ?? (() => /* @__PURE__ */ new Date()))();
191
235
  const duration = formatDuration(record.startedAt, record.endedAt, now);
@@ -196,6 +240,14 @@ async function buildRunReportData(record, deps = {}) {
196
240
  const exitCodeStr = typeof record.exitCode === "number" ? String(record.exitCode) : "-";
197
241
  const agentDisplay = record.agentName ? `${record.agentName} (${record.agentKey})` : record.agentKey;
198
242
  const dialogIdStr = record.dialogId || "-";
243
+ const resolvedLogPath = record.logPath || resolveRunLogPath(record.runId, deps.env, deps.homedir);
244
+ const runsDir = resolveRunsDir(deps.env, deps.homedir);
245
+ const reportPath = resolveRunReportPath(record.runId, deps.env, deps.homedir);
246
+ const reportJsonPath = resolveRunReportJsonPath(record.runId, deps.env, deps.homedir);
247
+ const msgPath = record.msgFile ?? join(runsDir, `${record.runId}.msg.md`);
248
+ const fs = deps.fs ?? nodeFs;
249
+ const msgPathExists = fs.existsSync(msgPath);
250
+ const childOutput = extractChildAgentOutput(resolvedLogPath, deps);
199
251
  const lines = [];
200
252
  lines.push(`# Run \u9A8C\u6536\u62A5\u544A: ${record.runId}`);
201
253
  lines.push("");
@@ -207,10 +259,36 @@ async function buildRunReportData(record, deps = {}) {
207
259
  lines.push(`| agent | ${agentDisplay} |`);
208
260
  lines.push(`| status | ${record.status} |`);
209
261
  lines.push(`| exitCode | ${exitCodeStr} |`);
262
+ lines.push(`| \u5F00\u59CB\u65F6\u95F4 | ${record.startedAt} |`);
263
+ lines.push(`| \u7ED3\u675F\u65F6\u95F4 | ${record.endedAt ?? "-"} |`);
210
264
  lines.push(`| \u8017\u65F6 | ${duration} |`);
211
265
  lines.push(`| activity | ${activityStr} |`);
212
266
  lines.push(`| dialogId | ${dialogIdStr} |`);
213
267
  lines.push("");
268
+ lines.push("## \u5B50 Agent \u4EA7\u51FA");
269
+ lines.push("");
270
+ if (childOutput) {
271
+ lines.push(childOutput);
272
+ } else {
273
+ lines.push(`\uFF08\u65E0\u6CD5\u4ECE log \u63D0\u53D6\u6700\u7EC8\u7B54\u590D\uFF0C\u5B8C\u6574\u65E5\u5FD7\uFF1A${resolvedLogPath}\uFF09`);
274
+ }
275
+ lines.push("");
276
+ lines.push("## \u7ED3\u679C\u53BB\u54EA\u53D6");
277
+ lines.push("");
278
+ if (record.dialogId) {
279
+ lines.push(
280
+ `- \u5BF9\u8BDD\u8BB0\u5F55: ${record.dialogId}\uFF08\u53EF\u7528 controlAgentRun(action:"status", runId:"${record.runId}") \u67E5\u770B\uFF0C\u6216\u7EC8\u7AEF\u8FD0\u884C nolo dialog read ${record.dialogId}\uFF09`
281
+ );
282
+ } else {
283
+ lines.push("- \u5BF9\u8BDD\u8BB0\u5F55: \u65E0\uFF08\u672A\u6301\u4E45\u5316\u6216 ephemeral run\uFF09");
284
+ }
285
+ lines.push(`- \u5B8C\u6574\u65E5\u5FD7: ${resolvedLogPath}`);
286
+ if (msgPathExists) {
287
+ lines.push(`- \u4EFB\u52A1\u8F93\u5165: ${msgPath}`);
288
+ }
289
+ lines.push(`- \u9A8C\u6536\u62A5\u544A (Markdown): ${reportPath}`);
290
+ lines.push(`- \u9A8C\u6536\u62A5\u544A (JSON): ${reportJsonPath}`);
291
+ lines.push("");
214
292
  let dodResults;
215
293
  if (record.dodCommands && record.dodCommands.length > 0) {
216
294
  dodResults = [];
@@ -229,29 +307,20 @@ async function buildRunReportData(record, deps = {}) {
229
307
  }
230
308
  lines.push("");
231
309
  }
232
- lines.push("## Git \u6458\u8981");
233
- lines.push("");
234
- const gitSummary = collectGitSummary(record.cwd, record.spawnHead, deps);
235
- if (!gitSummary.isGitRepo) {
236
- lines.push("\u975E Git \u4ED3\u5E93\u6216 Git \u4E0D\u53EF\u7528");
237
- } else if (gitSummary.error) {
238
- lines.push(`Git \u7EDF\u8BA1\u5F02\u5E38: ${gitSummary.error}`);
239
- } else {
240
- lines.push(`- \u53D8\u66F4\u7EDF\u8BA1: ${gitSummary.modifiedCount ?? 0} modified / ${gitSummary.untrackedCount ?? 0} untracked`);
241
- if (record.spawnHead) {
310
+ let gitSummary;
311
+ if (record.spawnHead) {
312
+ const summary = collectGitSummary(record.cwd, record.spawnHead, deps);
313
+ if (summary.isGitRepo && summary.commits && summary.commits.length > 0 && !summary.error && !summary.commits[0]?.startsWith("(")) {
314
+ gitSummary = summary;
315
+ lines.push("## Git \u6458\u8981");
316
+ lines.push("");
242
317
  lines.push(`- \u65B0\u589E Commit (${record.spawnHead}..HEAD):`);
243
- if (gitSummary.commits && gitSummary.commits.length > 0) {
244
- for (const c of gitSummary.commits) {
245
- lines.push(` - ${c}`);
246
- }
247
- } else {
248
- lines.push(" - (\u65E0\u65B0 commit)");
318
+ for (const c of summary.commits) {
319
+ lines.push(` - ${c}`);
249
320
  }
250
- } else {
251
- lines.push("- \u65B0\u589E Commit: \u672A\u8BB0\u5F55 spawnHead");
321
+ lines.push("");
252
322
  }
253
323
  }
254
- lines.push("");
255
324
  lines.push("---");
256
325
  lines.push(`_\u751F\u6210\u65F6\u95F4: ${now.toISOString()}_`);
257
326
  lines.push("");
@@ -267,8 +336,9 @@ async function buildRunReportData(record, deps = {}) {
267
336
  duration,
268
337
  activity: { fileEdits: edits, toolCalls: tools, llmCalls },
269
338
  ...record.dialogId ? { dialogId: record.dialogId } : {},
339
+ ...childOutput ? { childOutputTail: childOutput } : {},
270
340
  ...dodResults ? { dodResults } : {},
271
- gitSummary,
341
+ ...gitSummary ? { gitSummary } : {},
272
342
  generatedAt: now.toISOString()
273
343
  };
274
344
  return { markdown, report };
@@ -281,12 +351,15 @@ async function generateRunReport(record, deps = {}) {
281
351
  const reportPath = resolveRunReportPath(record.runId, env, homedir);
282
352
  const reportJsonPath = resolveRunReportJsonPath(record.runId, env, homedir);
283
353
  const { markdown, report } = await buildRunReportData(record, deps);
284
- try {
285
- fs.mkdirSync(runsDir, { recursive: true });
286
- fs.writeFileSync(reportPath, markdown, "utf8");
287
- fs.writeFileSync(reportJsonPath, JSON.stringify(report, null, 2), "utf8");
288
- } catch (err) {
289
- console.warn(`[nolo] failed to write run report file to ${reportPath}:`, err);
354
+ const shouldWrite = deps.forceReport === true || env.NOLO_RUN_REPORT === "1";
355
+ if (shouldWrite) {
356
+ try {
357
+ fs.mkdirSync(runsDir, { recursive: true });
358
+ fs.writeFileSync(reportPath, markdown, "utf8");
359
+ fs.writeFileSync(reportJsonPath, JSON.stringify(report, null, 2), "utf8");
360
+ } catch (err) {
361
+ console.warn(`[nolo] failed to write run report file to ${reportPath}:`, err);
362
+ }
290
363
  }
291
364
  return { reportPath, reportJsonPath, markdown, report };
292
365
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  updateContentTitle
3
- } from "./chunk-LAUUAYLK.js";
3
+ } from "./chunk-OCJNJUR4.js";
4
4
  import {
5
5
  require_date_fns
6
6
  } from "./chunk-M76ECQRD.js";
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
367
367
  }
368
368
  }
369
369
  async function createDocState(args, thunkApi) {
370
- const { createPageAction } = await import("./createPageAction-Q2ANG535.js");
370
+ const { createPageAction } = await import("./createPageAction-TJWVDPZD.js");
371
371
  return createPageAction(args, thunkApi);
372
372
  }
373
373
  function subscribe(listener) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  i18n_default,
3
3
  toolRegistry
4
- } from "./chunk-6KYCG5GW.js";
4
+ } from "./chunk-5Q4DXT47.js";
5
5
  import {
6
6
  canonicalizeToolNames
7
7
  } from "./chunk-O6OSWFZQ.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-KCBK4MDT.js";
4
+ } from "./chunk-RUVWTAK7.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  deleteDialog,
3
3
  toast
4
- } from "./chunk-DX6BP4K7.js";
4
+ } from "./chunk-7KY6U7MW.js";
5
5
  import {
6
6
  deleteServerSyncedCredential
7
- } from "./chunk-AUH2LTIY.js";
7
+ } from "./chunk-55C3UZSC.js";
8
8
  import {
9
9
  require_date_fns
10
10
  } from "./chunk-M76ECQRD.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  generateRunReport
3
- } from "./chunk-4HOXB6SY.js";
3
+ } from "./chunk-IMHO5LC6.js";
4
4
  import {
5
5
  buildLocalRunEnv,
6
6
  isFullstackCodingAgentRef,
@@ -20,7 +20,7 @@ import {
20
20
  parseAgentRunEvent,
21
21
  t,
22
22
  toolLabel
23
- } from "./chunk-YRP7LG4R.js";
23
+ } from "./chunk-ZOEE4OVX.js";
24
24
  import {
25
25
  getReadableCliDb
26
26
  } from "./chunk-UNHKVD2N.js";
@@ -41,7 +41,7 @@ import {
41
41
  finalizeRunRecord,
42
42
  readRunRecord,
43
43
  spawnLocalBackgroundRun
44
- } from "./chunk-VSA6QAGV.js";
44
+ } from "./chunk-E2OQ5N2F.js";
45
45
  import {
46
46
  resolveMachineId
47
47
  } from "./chunk-ESHYE7WU.js";
@@ -51,7 +51,7 @@ import {
51
51
  } from "./chunk-LTRXGFMS.js";
52
52
  import {
53
53
  formatAgentListCard
54
- } from "./chunk-6KYCG5GW.js";
54
+ } from "./chunk-5Q4DXT47.js";
55
55
  import {
56
56
  isGatewayHttpStatus
57
57
  } from "./chunk-RQSOAMPJ.js";
@@ -70,12 +70,12 @@ import {
70
70
  chooseMemoryOwners,
71
71
  loadMemoryCandidatesFromDb,
72
72
  resolveAgentMemoryPolicy
73
- } from "./chunk-FDKEDU7R.js";
73
+ } from "./chunk-P62APAXL.js";
74
74
  import {
75
75
  API_REPORTED_COST_MULTIPLIER,
76
76
  normalizeUsage,
77
77
  parseUiAskChoiceContent
78
- } from "./chunk-DX6BP4K7.js";
78
+ } from "./chunk-7KY6U7MW.js";
79
79
  import {
80
80
  getDefaultCliLocalRuntimeDb
81
81
  } from "./chunk-N4XRDM26.js";
@@ -91,7 +91,7 @@ import {
91
91
  LOCAL_TURN_ABORTED_CODE,
92
92
  readActionGate,
93
93
  readCommandActionGatePayload
94
- } from "./chunk-LQ6PUHW6.js";
94
+ } from "./chunk-EFN2AFWF.js";
95
95
  import {
96
96
  resolveAgentRuntimeConfigFromRecord
97
97
  } from "./chunk-64KIQZA2.js";
@@ -5359,7 +5359,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
5359
5359
  // packages/cli/client/agentRun.ts
5360
5360
  import { ulid } from "ulid";
5361
5361
  async function loadRunLocalAgentTurn() {
5362
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-G7ZV55I6.js");
5362
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-OBKWKEKW.js");
5363
5363
  return runLocalAgentTurn;
5364
5364
  }
5365
5365
  async function resolveCurrentMachineId(options) {
@@ -5922,6 +5922,7 @@ async function runLocalAgentTurnForCli(options, settings) {
5922
5922
  dialogId: result.dialogId,
5923
5923
  title: result.title,
5924
5924
  ...result.titlePatchPromise ? { titlePatchPromise: result.titlePatchPromise } : {},
5925
+ ...result.emptyAssistantFallbackReason ? { emptyAssistantFallbackReason: result.emptyAssistantFallbackReason } : {},
5925
5926
  turnTokens: buildTurnTokenUsage(result.usage, result.model)
5926
5927
  };
5927
5928
  } catch (error) {
@@ -7148,13 +7149,16 @@ async function runAgentRunCommand(args, deps) {
7148
7149
  }
7149
7150
  }
7150
7151
  if (typeof childRunId === "string" && childRunId.length > 0) {
7151
- const finalStatus = result.exitCode === 0 ? "done" : "failed";
7152
+ const isStalledOrTruncated = result.emptyAssistantFallbackReason === "length_truncated" || result.emptyAssistantFallbackReason === "stream_truncated" || result.emptyAssistantFallbackReason === "repetition_loop" || result.emptyAssistantFallbackReason === "stagnant_tool_calls";
7153
+ const truncationNote = isStalledOrTruncated ? { note: `empty assistant output: ${result.emptyAssistantFallbackReason}` } : {};
7154
+ const finalStatus = isStalledOrTruncated || result.exitCode !== 0 ? "failed" : "done";
7152
7155
  await (deps.finalizeRunRecord ?? finalizeRunRecord)(
7153
7156
  childRunId,
7154
7157
  {
7155
7158
  status: finalStatus,
7156
7159
  exitCode: result.exitCode,
7157
- dialogId: result.dialogId
7160
+ dialogId: result.dialogId,
7161
+ ...truncationNote
7158
7162
  },
7159
7163
  {
7160
7164
  env,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-LAUUAYLK.js";
3
+ } from "./chunk-OCJNJUR4.js";
4
4
  import {
5
5
  prepareAndPersistMessage,
6
6
  uiAskChoiceFunc,
7
7
  uiAskChoiceFunctionSchema
8
- } from "./chunk-DX6BP4K7.js";
8
+ } from "./chunk-7KY6U7MW.js";
9
9
  import {
10
10
  require_date_fns
11
11
  } from "./chunk-M76ECQRD.js";
@@ -3,6 +3,8 @@ var EMPTY_ASSISTANT_REPAIR_PROMPT = "\u8BF7\u7ED9\u51FA\u660E\u786E\u7684\u6587\
3
3
  var EMPTY_ASSISTANT_FALLBACK_MESSAGE = "\u6A21\u578B\u8FDE\u7EED\u8FD4\u56DE\u7A7A\u6D88\u606F\uFF0C\u5F53\u524D\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u5F53\u524D\u6B65\u9AA4\uFF0C\u6216\u7ED9\u51FA\u66F4\u5177\u4F53\u7684\u4FEE\u6539\u8303\u56F4\u3002";
4
4
  var LENGTH_TRUNCATED_FALLBACK_MESSAGE = "\u8F93\u51FA\u8FBE\u5230\u957F\u5EA6\u4E0A\u9650\u88AB\u622A\u65AD\uFF0C\u5EFA\u8BAE\u7F29\u77ED\u4EFB\u52A1\u6216\u63D0\u9AD8\u8F93\u51FA\u4E0A\u9650\u3002";
5
5
  var STREAM_TRUNCATED_FALLBACK_MESSAGE = "\u4E0A\u6E38\u54CD\u5E94\u6D41\u5728\u6536\u5C3E\u524D\u88AB\u4E2D\u65AD\uFF08\u672A\u6536\u5230\u7ED3\u675F\u6807\u8BB0\uFF09\uFF0C\u672C\u8F6E\u8F93\u51FA\u4E0D\u5B8C\u6574\u3002\u8BF7\u91CD\u8BD5\u5F53\u524D\u6B65\u9AA4\u3002";
6
+ var REPETITION_LOOP_FALLBACK_MESSAGE = "\u68C0\u6D4B\u5230\u6A21\u578B\u9677\u5165\u91CD\u590D\u8F93\u51FA\u6B7B\u5FAA\u73AF\uFF0C\u5DF2\u81EA\u52A8\u7194\u65AD\u7EC8\u6B62\u5F53\u524D\u4EFB\u52A1\u3002";
7
+ var STAGNANT_TOOL_CALLS_FALLBACK_MESSAGE = "\u68C0\u6D4B\u5230\u8FDE\u7EED\u591A\u6B21\u76F8\u540C\u5DE5\u5177\u8C03\u7528\u4E14\u65E0\u5B9E\u8D28\u8FDB\u5C55\uFF0C\u5DF2\u81EA\u52A8\u7194\u65AD\u7EC8\u6B62\u5F53\u524D\u4EFB\u52A1\u3002";
6
8
  var MAX_REASONING_ONLY_REPAIRS = 2;
7
9
  function resolveEmptyAssistantOutcome(args) {
8
10
  if (args.hasToolCalls || args.hasVisibleOutput) return { kind: "ok" };
@@ -20,6 +22,8 @@ function resolveEmptyAssistantOutcome(args) {
20
22
  function resolveEmptyAssistantFallbackMessage(reason) {
21
23
  if (reason === "length_truncated") return LENGTH_TRUNCATED_FALLBACK_MESSAGE;
22
24
  if (reason === "stream_truncated") return STREAM_TRUNCATED_FALLBACK_MESSAGE;
25
+ if (reason === "repetition_loop") return REPETITION_LOOP_FALLBACK_MESSAGE;
26
+ if (reason === "stagnant_tool_calls") return STAGNANT_TOOL_CALLS_FALLBACK_MESSAGE;
23
27
  return EMPTY_ASSISTANT_FALLBACK_MESSAGE;
24
28
  }
25
29
  function hasAssistantVisibleOutput(content) {
@@ -34,10 +38,21 @@ function hasAssistantVisibleOutput(content) {
34
38
  return false;
35
39
  });
36
40
  }
41
+ var LENGTH_TRUNCATED_REASONING_MARKER = "[length_truncated_reasoning_tail]";
42
+ var MAX_TRUNCATED_REASONING_CHARS = 2e3;
43
+ function formatLengthTruncatedReasoningTail(reasoning_content, maxChars = MAX_TRUNCATED_REASONING_CHARS) {
44
+ if (typeof reasoning_content !== "string") return null;
45
+ const trimmed = reasoning_content.trim();
46
+ if (trimmed.length === 0) return null;
47
+ const tail = trimmed.length > maxChars ? trimmed.slice(-maxChars) : trimmed;
48
+ return `[nolo] ${LENGTH_TRUNCATED_REASONING_MARKER}
49
+ ${tail}`;
50
+ }
37
51
 
38
52
  export {
39
53
  EMPTY_ASSISTANT_REPAIR_PROMPT,
40
54
  resolveEmptyAssistantOutcome,
41
55
  resolveEmptyAssistantFallbackMessage,
42
- hasAssistantVisibleOutput
56
+ hasAssistantVisibleOutput,
57
+ formatLengthTruncatedReasoningTail
43
58
  };
@@ -10,7 +10,7 @@ import {
10
10
  fetchAndSerializeTable,
11
11
  resolveBuiltinSkillPage,
12
12
  waitForAbortableDelay
13
- } from "./chunk-6KYCG5GW.js";
13
+ } from "./chunk-5Q4DXT47.js";
14
14
  import {
15
15
  createDrainExhaustedResponse,
16
16
  isCoreDrainingBody,
@@ -26,13 +26,13 @@ import {
26
26
  } from "./chunk-MEYIRKDN.js";
27
27
  import {
28
28
  fetchAndCacheMessages
29
- } from "./chunk-DX6BP4K7.js";
29
+ } from "./chunk-7KY6U7MW.js";
30
30
  import {
31
31
  shouldUseServerProxy
32
32
  } from "./chunk-YYLHWIW6.js";
33
33
  import {
34
34
  fetchServerSyncedCredential
35
- } from "./chunk-AUH2LTIY.js";
35
+ } from "./chunk-55C3UZSC.js";
36
36
  import {
37
37
  buildSkillGuidancePromptBlock,
38
38
  extractRuntimePageCapabilities,
@@ -5,14 +5,14 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-HDT2RB7T.js";
8
+ } from "./chunk-KPJYUEPE.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-KCBK4MDT.js";
15
+ } from "./chunk-RUVWTAK7.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-6KYCG5GW.js";
26
+ } from "./chunk-5Q4DXT47.js";
27
27
  import {
28
28
  getPublicImageAgentMode
29
29
  } from "./chunk-VIDPVFP3.js";
30
30
  import {
31
31
  getCurrentSpaceId
32
- } from "./chunk-LAUUAYLK.js";
32
+ } from "./chunk-OCJNJUR4.js";
33
33
  import {
34
34
  addToolMessage,
35
35
  messageStreamEnd,
36
36
  messageStreaming,
37
37
  updateToolMessage
38
- } from "./chunk-DX6BP4K7.js";
38
+ } from "./chunk-7KY6U7MW.js";
39
39
  import {
40
40
  streamAgentChatTurn
41
- } from "./chunk-AUH2LTIY.js";
41
+ } from "./chunk-55C3UZSC.js";
42
42
  import {
43
43
  addActiveController,
44
44
  removeActiveController,
@@ -46,7 +46,7 @@ import {
46
46
  } from "./chunk-MRWGHF56.js";
47
47
  import {
48
48
  EMPTY_ASSISTANT_REPAIR_PROMPT
49
- } from "./chunk-MI2J67UU.js";
49
+ } from "./chunk-P66M7LSQ.js";
50
50
  import {
51
51
  accumulateToolCallDelta,
52
52
  createThinkParserState,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-YRP7LG4R.js";
3
+ } from "./chunk-ZOEE4OVX.js";
4
4
  import {
5
5
  getReadableCliDb
6
6
  } from "./chunk-UNHKVD2N.js";
@@ -39,7 +39,7 @@ import {
39
39
  resolveRunReportPath,
40
40
  spawnLocalBackgroundRun,
41
41
  terminateRunProcess
42
- } from "./chunk-VSA6QAGV.js";
42
+ } from "./chunk-E2OQ5N2F.js";
43
43
  import {
44
44
  inferCaptureIntent
45
45
  } from "./chunk-JI2TIPLP.js";
@@ -49,7 +49,7 @@ import {
49
49
  import {
50
50
  inlineImageUrlsForCustomProvider,
51
51
  prepareTools
52
- } from "./chunk-HDT2RB7T.js";
52
+ } from "./chunk-KPJYUEPE.js";
53
53
  import {
54
54
  getServerProviderSecret
55
55
  } from "./chunk-HS7MLR74.js";
@@ -68,7 +68,7 @@ import {
68
68
  rememberMemoryFunctionSchema,
69
69
  resolveAgentRequiredPackIds,
70
70
  setTodoListFunc
71
- } from "./chunk-6KYCG5GW.js";
71
+ } from "./chunk-5Q4DXT47.js";
72
72
  import {
73
73
  createDrainExhaustedResponse,
74
74
  isCoreDrainingBody,
@@ -93,13 +93,13 @@ import {
93
93
  prepareTokenUsageData,
94
94
  resolveBuiltinPlatformAgentConfig,
95
95
  runKeyed
96
- } from "./chunk-DX6BP4K7.js";
96
+ } from "./chunk-7KY6U7MW.js";
97
97
  import {
98
98
  BUILTIN_TITLE_LLM_CONFIG
99
99
  } from "./chunk-RCFIB45Q.js";
100
100
  import {
101
101
  fetchServerSyncedCredential
102
- } from "./chunk-AUH2LTIY.js";
102
+ } from "./chunk-55C3UZSC.js";
103
103
  import {
104
104
  require_date_fns
105
105
  } from "./chunk-M76ECQRD.js";
@@ -138,7 +138,7 @@ import {
138
138
  parseSyncServersEnv,
139
139
  resolveOpenAiCompatibleProviderConfig,
140
140
  summarizeToolArguments
141
- } from "./chunk-LQ6PUHW6.js";
141
+ } from "./chunk-EFN2AFWF.js";
142
142
  import {
143
143
  buildPlatformChatCompletionRequest,
144
144
  canUsePlatformChatProvider,
@@ -288,22 +288,13 @@ var ORCHESTRATION_TOOL_NAMES = /* @__PURE__ */ new Set([
288
288
  "controlAgentRun",
289
289
  "listAgents",
290
290
  "readAgent",
291
- "startAgentDialog",
292
- "runStreamingAgent",
293
- "streamParallelAgents"
294
- ]);
295
- var SUBTASK_REMOVED_GIT_TOOL_NAMES = /* @__PURE__ */ new Set([
296
- "gitAdd",
297
- "gitCommit",
298
- "gitCreateBranch",
299
- "commitWorkspace"
291
+ "runStreamingAgent"
300
292
  ]);
301
293
  var INTERACTION_REQUIRED_TOOL_NAMES = /* @__PURE__ */ new Set([
302
294
  "ask_user"
303
295
  ]);
304
296
  var SUBTASK_REMOVED_TOOL_NAMES = /* @__PURE__ */ new Set([
305
297
  ...ORCHESTRATION_TOOL_NAMES,
306
- ...SUBTASK_REMOVED_GIT_TOOL_NAMES,
307
298
  ...INTERACTION_REQUIRED_TOOL_NAMES
308
299
  ]);
309
300
  function isSubtaskRun(env) {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-YRP7LG4R.js";
4
+ } from "./chunk-ZOEE4OVX.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-6KYCG5GW.js";
7
+ } from "./chunk-5Q4DXT47.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-LQ6PUHW6.js";
10
+ } from "./chunk-EFN2AFWF.js";
11
11
  import {
12
12
  resolveLocalRuntimeEnvFromPolicy
13
13
  } from "./chunk-NQ4N4IGO.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-LAUUAYLK.js";
4
- import "./chunk-DX6BP4K7.js";
3
+ } from "./chunk-OCJNJUR4.js";
4
+ import "./chunk-7KY6U7MW.js";
5
5
  import "./chunk-RCFIB45Q.js";
6
6
  import "./chunk-JIADXJYU.js";
7
7
  import "./chunk-YYLHWIW6.js";
8
8
  import "./chunk-AGGIDPCZ.js";
9
- import "./chunk-AUH2LTIY.js";
9
+ import "./chunk-55C3UZSC.js";
10
10
  import "./chunk-MGIHZ5CJ.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-FDKEDU7R.js";
5
- import "./chunk-LAUUAYLK.js";
6
- import "./chunk-DX6BP4K7.js";
4
+ } from "./chunk-P62APAXL.js";
5
+ import "./chunk-OCJNJUR4.js";
6
+ import "./chunk-7KY6U7MW.js";
7
7
  import "./chunk-RCFIB45Q.js";
8
8
  import "./chunk-JIADXJYU.js";
9
9
  import "./chunk-YYLHWIW6.js";
10
10
  import "./chunk-AGGIDPCZ.js";
11
- import "./chunk-AUH2LTIY.js";
11
+ import "./chunk-55C3UZSC.js";
12
12
  import "./chunk-MGIHZ5CJ.js";
13
13
  import "./chunk-5RGU3J7P.js";
14
14
  import "./chunk-M76ECQRD.js";
@@ -15,13 +15,13 @@ import {
15
15
  addContentToSpace,
16
16
  client_default,
17
17
  getCurrentSpaceId
18
- } from "./chunk-LAUUAYLK.js";
19
- import "./chunk-DX6BP4K7.js";
18
+ } from "./chunk-OCJNJUR4.js";
19
+ import "./chunk-7KY6U7MW.js";
20
20
  import "./chunk-RCFIB45Q.js";
21
21
  import "./chunk-JIADXJYU.js";
22
22
  import "./chunk-YYLHWIW6.js";
23
23
  import "./chunk-AGGIDPCZ.js";
24
- import "./chunk-AUH2LTIY.js";
24
+ import "./chunk-55C3UZSC.js";
25
25
  import "./chunk-MGIHZ5CJ.js";
26
26
  import "./chunk-5RGU3J7P.js";
27
27
  import "./chunk-M76ECQRD.js";
@@ -17,12 +17,12 @@ import "./chunk-EKLRRZIN.js";
17
17
  import "./chunk-KQHGZWSV.js";
18
18
  import "./chunk-JIADXJYU.js";
19
19
  import "./chunk-URMS4XY2.js";
20
- import "./chunk-LQ6PUHW6.js";
20
+ import "./chunk-EFN2AFWF.js";
21
21
  import "./chunk-OSCSEJJR.js";
22
22
  import "./chunk-ZNFJWEN4.js";
23
23
  import "./chunk-64KIQZA2.js";
24
24
  import "./chunk-T27IEBNQ.js";
25
- import "./chunk-MI2J67UU.js";
25
+ import "./chunk-P66M7LSQ.js";
26
26
  import "./chunk-N7J63Q6C.js";
27
27
  import "./chunk-M3JQWYBC.js";
28
28
  import "./chunk-BMB563Y6.js";
@@ -20,12 +20,12 @@ import {
20
20
  switchDialogAgent,
21
21
  updateDialogTitle,
22
22
  updateTokens
23
- } from "./chunk-DX6BP4K7.js";
23
+ } from "./chunk-7KY6U7MW.js";
24
24
  import "./chunk-RCFIB45Q.js";
25
25
  import "./chunk-JIADXJYU.js";
26
26
  import "./chunk-YYLHWIW6.js";
27
27
  import "./chunk-AGGIDPCZ.js";
28
- import "./chunk-AUH2LTIY.js";
28
+ import "./chunk-55C3UZSC.js";
29
29
  import "./chunk-MGIHZ5CJ.js";
30
30
  import {
31
31
  getActiveDialogAgentId