nolo-cli 0.34.0-alpha.1 → 0.34.0-alpha.3

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 (65) hide show
  1. package/{_executeModel-BUYCXZCQ.js → _executeModel-TMUXL7J5.js} +13 -14
  2. package/{agentDeleteCommand-WSS2IJVM.js → agentDeleteCommand-KA2IQAPG.js} +2 -2
  3. package/{agentEmailCommands-SHTPJTSX.js → agentEmailCommands-UIYBGCZW.js} +14 -15
  4. package/{agentListCommands-GV6UYVAF.js → agentListCommands-L6JNUOLH.js} +2 -2
  5. package/{agentMachineCommands-FLD7TAFH.js → agentMachineCommands-5CQW5NZR.js} +3 -3
  6. package/{agentRecordCommands-57W6R7QW.js → agentRecordCommands-VUDJQIZH.js} +14 -15
  7. package/{agentRunCommand-HJGXSMDN.js → agentRunCommand-EJWYF3BL.js} +16 -17
  8. package/{agentRunControl-GXOB47YI.js → agentRunControl-7MUPSYDQ.js} +3 -1
  9. package/{agentRuntimeLocal-G7ZV55I6.js → agentRuntimeLocal-XXBMDMBU.js} +2 -2
  10. package/{agentSlice-HFR7SP3B.js → agentSlice-HTIEYKIU.js} +1 -1
  11. package/{agentSuperviseCommands-Q64S5SPG.js → agentSuperviseCommands-MKWW3ICX.js} +3 -3
  12. package/{appDeleteCommands-SHHE56Y2.js → appDeleteCommands-OUBL6VHB.js} +2 -2
  13. package/{appDeployCommands-WUMSO2VS.js → appDeployCommands-BZSS2MX4.js} +2 -2
  14. package/{appDeployStatusCommands-VZSVN6SR.js → appDeployStatusCommands-P2ZQOY5X.js} +2 -2
  15. package/{appGetCommands-ZJ2C3A5Y.js → appGetCommands-WCFWQZZM.js} +2 -2
  16. package/{appListCommands-W33L6U5X.js → appListCommands-FVJ3QNL7.js} +2 -2
  17. package/{chatQueueReduxAdapter-SYIX4ODY.js → chatQueueReduxAdapter-ZP2ZS63U.js} +2 -2
  18. package/chunk-2BWU4ORW.js +2574 -0
  19. package/{chunk-6KYCG5GW.js → chunk-5GQ6XCJY.js} +11 -11
  20. package/{chunk-74IQ5RRO.js → chunk-5LDKQUOT.js} +1 -1
  21. package/{chunk-6XIE5ZGI.js → chunk-6HIGYUBQ.js} +1 -1
  22. package/{chunk-MI2J67UU.js → chunk-AA2YUJNV.js} +12 -1
  23. package/{chunk-KCBK4MDT.js → chunk-AE5GVFMG.js} +4 -4
  24. package/{chunk-VSA6QAGV.js → chunk-E2OQ5N2F.js} +40 -10
  25. package/{chunk-KHCLMKZZ.js → chunk-EY7V7REW.js} +280 -6
  26. package/{chunk-3XZUNRYF.js → chunk-FT4XBCK4.js} +7 -7
  27. package/{chunk-LQ6PUHW6.js → chunk-I7VDDN45.js} +26 -67
  28. package/{chunk-7YDKVLAE.js → chunk-IEEEWIVO.js} +3 -3
  29. package/{chunk-VBD7W4Q6.js → chunk-ILZY5B4U.js} +16 -12
  30. package/{chunk-4HOXB6SY.js → chunk-IMHO5LC6.js} +100 -27
  31. package/{chunk-2KO5QQFV.js → chunk-P2I7ELDC.js} +1 -1
  32. package/{chunk-DX6BP4K7.js → chunk-PILJX4DH.js} +8 -8
  33. package/{chunk-LAUUAYLK.js → chunk-QI3CHZUT.js} +2 -2
  34. package/{chunk-YRP7LG4R.js → chunk-RKRXAL3V.js} +7 -16
  35. package/{chunk-AUH2LTIY.js → chunk-TLBZMLLJ.js} +3 -3
  36. package/{chunk-3LWZNEGQ.js → chunk-WBZE7C6S.js} +1 -1
  37. package/{chunk-HDT2RB7T.js → chunk-XMFDQYWA.js} +1 -1
  38. package/{chunk-FDKEDU7R.js → chunk-Y5W623XU.js} +3 -3
  39. package/{chunk-VD2SO4RG.js → chunk-Z7COG62J.js} +2 -2
  40. package/{codingSkills-H6N5EKSX.js → codingSkills-6F4EQFCM.js} +2 -3
  41. package/{createAgentAutomationAction-BH3D2L2H.js → createAgentAutomationAction-TGUXUZCY.js} +3 -3
  42. package/{createDialogAction-U4LDV2RW.js → createDialogAction-FD5AEOUF.js} +5 -6
  43. package/{createPageAction-Q2ANG535.js → createPageAction-NPC3LYNK.js} +4 -5
  44. package/{dialogCommands-C556D6WD.js → dialogCommands-ZF2RSNCG.js} +2 -2
  45. package/{dialogSlice-P2VSKG2X.js → dialogSlice-6BINHWQT.js} +2 -2
  46. package/{docCreateCommands-AAVGLQWE.js → docCreateCommands-4VQ5MOHP.js} +4 -5
  47. package/{docDeleteCommands-PKMKSQD2.js → docDeleteCommands-M7WLNVPB.js} +4 -5
  48. package/{docReadCommands-2WUH7UXC.js → docReadCommands-6LU6P2WT.js} +4 -5
  49. package/{docStore-J5UWRBB4.js → docStore-SIUFLABN.js} +4 -4
  50. package/{docUpdateCommands-B2N4E5HQ.js → docUpdateCommands-S2LX4ENL.js} +4 -5
  51. package/{handleSendMessageAction-RRZ53YYH.js → handleSendMessageAction-QVG5YNZY.js} +2 -2
  52. package/index.js +46 -46
  53. package/{machineCommands-CWKMJG33.js → machineCommands-OSEBN7BZ.js} +14 -15
  54. package/{machineWsRunDispatch-UYNVNX4A.js → machineWsRunDispatch-NTJQCIIF.js} +14 -15
  55. package/package.json +1 -1
  56. package/{readlineWorkspace-VYELP22P.js → readlineWorkspace-JPME5S7A.js} +130 -82
  57. package/{runAgentClientLoop-35GKZDOZ.js → runAgentClientLoop-SOKEXCUF.js} +10 -11
  58. package/{skillDiscovery-COX56OBO.js → skillDiscovery-GPUDHDTZ.js} +1 -2
  59. package/{spaceCommands-AAKQM2PM.js → spaceCommands-Z5JLMFFJ.js} +2 -2
  60. package/{spaceSlice-NSNGR4Y2.js → spaceSlice-Z3BGCLGX.js} +3 -3
  61. package/{streamAgentChatTurn-D5IDHXMV.js → streamAgentChatTurn-INF5RGK4.js} +12 -13
  62. package/{tools-JQOETZP5.js → tools-ZELMSJZ3.js} +8 -9
  63. package/{updateDialogTitleAction-WOTSDSFQ.js → updateDialogTitleAction-EDUCIB7G.js} +3 -3
  64. package/chunk-AETZ7AD6.js +0 -274
  65. package/chunk-OFZPJ3NT.js +0 -114
@@ -23,10 +23,11 @@ import {
23
23
  } from "./chunk-T27IEBNQ.js";
24
24
  import {
25
25
  EMPTY_ASSISTANT_REPAIR_PROMPT,
26
+ formatLengthTruncatedReasoningTail,
26
27
  hasAssistantVisibleOutput,
27
28
  resolveEmptyAssistantFallbackMessage,
28
29
  resolveEmptyAssistantOutcome
29
- } from "./chunk-MI2J67UU.js";
30
+ } from "./chunk-AA2YUJNV.js";
30
31
  import {
31
32
  createThinkParserState,
32
33
  createToolCallAccumulator,
@@ -1567,9 +1568,21 @@ async function runLocalAgentTurn(input) {
1567
1568
  continue;
1568
1569
  }
1569
1570
  if (outcome.kind === "fallback") {
1571
+ if (outcome.reason === "length_truncated" && result.reasoning_content) {
1572
+ const reasoningTailLog = formatLengthTruncatedReasoningTail(result.reasoning_content);
1573
+ if (reasoningTailLog) {
1574
+ console.warn(`
1575
+ ${reasoningTailLog}
1576
+ `);
1577
+ }
1578
+ }
1570
1579
  result = {
1571
1580
  ...result,
1572
- content: resolveEmptyAssistantFallbackMessage(outcome.reason)
1581
+ content: resolveEmptyAssistantFallbackMessage(outcome.reason),
1582
+ // 只打标记不抛错:交互侧仍照常显示诊断文案(零行为变化)。
1583
+ // 上层(后台 run 编排者)据 emptyAssistantFallbackReason 判断
1584
+ // 是否把本轮结算为 failed。见 LocalAgentTurnResult 注释。
1585
+ emptyAssistantFallbackReason: outcome.reason
1573
1586
  };
1574
1587
  break;
1575
1588
  }
@@ -3044,14 +3057,6 @@ var NEVER_LOCAL_TOOLS = /* @__PURE__ */ new Set([
3044
3057
  "updateSelf",
3045
3058
  "createAgent"
3046
3059
  ]);
3047
- var REMOVED_LOCAL_TOOLS = /* @__PURE__ */ new Set([
3048
- "gitStatus",
3049
- "gitDiff",
3050
- "gitCreateBranch",
3051
- "gitAdd",
3052
- "gitCommit",
3053
- "commitWorkspace"
3054
- ]);
3055
3060
  var DEFAULT_LOCAL_TOOLS = /* @__PURE__ */ new Set([
3056
3061
  "readFile",
3057
3062
  "writeFile",
@@ -3099,13 +3104,6 @@ function resolveLocalToolPolicy(args) {
3099
3104
  reason: `${toolName} is blocked by the local runtime safety policy.`
3100
3105
  };
3101
3106
  }
3102
- if (REMOVED_LOCAL_TOOLS.has(toolName)) {
3103
- return {
3104
- allowed: false,
3105
- toolName,
3106
- reason: `${toolName} has been removed from the local runtime tool surface. Use execShell in shell-enabled workspace runs when shell is needed.`
3107
- };
3108
- }
3109
3107
  const allowedByEnv = new Set(parseToolAllowlist(args.env.NOLO_LOCAL_ALLOWED_TOOLS));
3110
3108
  const agentTools = new Set(
3111
3109
  (args.agentToolNames ?? []).flatMap((item) => {
@@ -4076,14 +4074,6 @@ var WORKSPACE_TOOL_NAMES = [
4076
4074
  ];
4077
4075
  var SHELL_TOOL_NAMES = ["execShell", "launchProcess", "listProcesses"];
4078
4076
  var WORKSPACE_TOOL_NAME_SET = new Set(WORKSPACE_TOOL_NAMES);
4079
- var REMOVED_WORKSPACE_TOOL_NAMES = /* @__PURE__ */ new Set([
4080
- "gitStatus",
4081
- "gitDiff",
4082
- "gitCreateBranch",
4083
- "gitAdd",
4084
- "gitCommit",
4085
- "commitWorkspace"
4086
- ]);
4087
4077
  function buildWorkspacePathProperty() {
4088
4078
  return {
4089
4079
  type: "string",
@@ -4327,7 +4317,7 @@ function buildWorkspaceToolDefinition(toolName) {
4327
4317
  }
4328
4318
  function filterDeclaredWorkspaceToolNames(args) {
4329
4319
  return (args.toolNames ?? []).filter(
4330
- (toolName) => WORKSPACE_TOOL_NAME_SET.has(toolName) && !REMOVED_WORKSPACE_TOOL_NAMES.has(toolName) && (args.exposeShellTools || !SHELL_TOOL_NAMES.includes(toolName))
4320
+ (toolName) => WORKSPACE_TOOL_NAME_SET.has(toolName) && (args.exposeShellTools || !SHELL_TOOL_NAMES.includes(toolName))
4331
4321
  );
4332
4322
  }
4333
4323
 
@@ -4418,7 +4408,7 @@ function buildLocalWorkspacePolicyToolNames(args) {
4418
4408
  toolNames: args.declaredToolNames,
4419
4409
  exposeShellTools: args.exposeShellTools === true
4420
4410
  })
4421
- ])].filter((toolName) => !REMOVED_WORKSPACE_TOOL_NAMES.has(toolName));
4411
+ ])];
4422
4412
  }
4423
4413
  function buildLocalWorkspaceOpenAiTools(args) {
4424
4414
  const declaredTools = new Set(args.toolNames ?? []);
@@ -4489,7 +4479,6 @@ function readExpectedReplacementCount(args) {
4489
4479
  return value;
4490
4480
  }
4491
4481
  var READ_FILE_SLICE_FALLBACK_LINES = 200;
4492
- var LEGACY_SLICE_ARG_NAMES = ["startLine", "endLine", "maxLines", "tailLines"];
4493
4482
  function isAbsentArg(value) {
4494
4483
  return value === void 0 || value === null;
4495
4484
  }
@@ -4559,46 +4548,16 @@ function parseLinesArg(value) {
4559
4548
  }
4560
4549
  function readFileSliceArgs(args) {
4561
4550
  const warnings = [];
4562
- const legacyUsed = LEGACY_SLICE_ARG_NAMES.filter((name) => !isAbsentArg(args[name]));
4563
- const withFallback = (slice) => {
4551
+ const withFallback = (slice2) => {
4564
4552
  warnings.push(
4565
4553
  `No usable line range remained; returned the first ${READ_FILE_SLICE_FALLBACK_LINES} lines instead of the whole file.`
4566
4554
  );
4567
- return { ...slice, maxLines: READ_FILE_SLICE_FALLBACK_LINES, warnings };
4555
+ return { ...slice2, maxLines: READ_FILE_SLICE_FALLBACK_LINES, warnings };
4568
4556
  };
4569
- if (!isAbsentArg(args.lines)) {
4570
- if (legacyUsed.length > 0) {
4571
- warnings.push(`Ignored ${legacyUsed.join(", ")}: superseded by lines.`);
4572
- }
4573
- const { slice, warning } = parseLinesArg(args.lines);
4574
- if (warning) warnings.push(warning);
4575
- return slice ? { ...slice, warnings } : withFallback({});
4576
- }
4577
- if (legacyUsed.length === 0) return { warnings };
4578
- warnings.push(
4579
- `${legacyUsed.join(", ")} ${legacyUsed.length > 1 ? "are" : "is"} deprecated; use lines instead (${LINES_ARG_SYNTAX}).`
4580
- );
4581
- const take = (name, max) => collectIntegerArg({ value: args[name], name, max, warnings });
4582
- const resolved = {
4583
- startLine: take("startLine"),
4584
- endLine: take("endLine"),
4585
- maxLines: take("maxLines", 2e3),
4586
- tailLines: take("tailLines", 2e3)
4587
- };
4588
- if (resolved.endLine !== void 0 && resolved.startLine !== void 0 && resolved.endLine < resolved.startLine) {
4589
- warnings.push(
4590
- `Ignored endLine (${resolved.endLine}): endLine must be greater than or equal to startLine (${resolved.startLine}).`
4591
- );
4592
- resolved.endLine = void 0;
4593
- }
4594
- if (resolved.tailLines !== void 0 && (resolved.startLine !== void 0 || resolved.endLine !== void 0)) {
4595
- warnings.push(
4596
- `Ignored tailLines (${resolved.tailLines}): tailLines cannot be combined with startLine or endLine.`
4597
- );
4598
- resolved.tailLines = void 0;
4599
- }
4600
- const nothingUsable = LEGACY_SLICE_ARG_NAMES.every((name) => resolved[name] === void 0);
4601
- return nothingUsable ? withFallback(resolved) : { ...resolved, warnings };
4557
+ if (isAbsentArg(args.lines)) return { warnings };
4558
+ const { slice, warning } = parseLinesArg(args.lines);
4559
+ if (warning) warnings.push(warning);
4560
+ return slice ? { ...slice, warnings } : withFallback({});
4602
4561
  }
4603
4562
  function buildReadFileSliceHint(totalLines) {
4604
4563
  return `File has ${totalLines} lines. Use lines: ${LINES_ARG_SYNTAX}, or omit it for the whole file.`;
@@ -5944,10 +5903,10 @@ function buildLoadSkillExecutor(args) {
5944
5903
  metadata: { loadSkill: true, resolved: false }
5945
5904
  };
5946
5905
  }
5947
- const { resolveSkillByName } = await import("./skillDiscovery-COX56OBO.js");
5906
+ const { resolveSkillByName } = await import("./skillDiscovery-GPUDHDTZ.js");
5948
5907
  const resolved = resolveSkillByName(args.cwd, name);
5949
5908
  if (!resolved) {
5950
- const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-H6N5EKSX.js");
5909
+ const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-6F4EQFCM.js");
5951
5910
  const builtinSlug = resolveCodingBuiltinSlug(name);
5952
5911
  if (builtinSlug) {
5953
5912
  const body = buildCodingSkillContentBySlug(builtinSlug);
@@ -5982,7 +5941,7 @@ ${body}`,
5982
5941
  };
5983
5942
  }
5984
5943
  async function formatUnknownSkillMessage(cwd, requestedName) {
5985
- const { discoverSkills } = await import("./skillDiscovery-COX56OBO.js");
5944
+ const { discoverSkills } = await import("./skillDiscovery-GPUDHDTZ.js");
5986
5945
  let available = [];
5987
5946
  try {
5988
5947
  available = discoverSkills(cwd).map((s) => s.name);
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-YRP7LG4R.js";
4
+ } from "./chunk-RKRXAL3V.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-6KYCG5GW.js";
7
+ } from "./chunk-5GQ6XCJY.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-LQ6PUHW6.js";
10
+ } from "./chunk-I7VDDN45.js";
11
11
  import {
12
12
  resolveLocalRuntimeEnvFromPolicy
13
13
  } from "./chunk-NQ4N4IGO.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-RKRXAL3V.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-5GQ6XCJY.js";
55
55
  import {
56
56
  isGatewayHttpStatus
57
57
  } from "./chunk-RQSOAMPJ.js";
@@ -70,28 +70,28 @@ import {
70
70
  chooseMemoryOwners,
71
71
  loadMemoryCandidatesFromDb,
72
72
  resolveAgentMemoryPolicy
73
- } from "./chunk-FDKEDU7R.js";
73
+ } from "./chunk-Y5W623XU.js";
74
74
  import {
75
75
  API_REPORTED_COST_MULTIPLIER,
76
76
  normalizeUsage,
77
77
  parseUiAskChoiceContent
78
- } from "./chunk-DX6BP4K7.js";
78
+ } from "./chunk-PILJX4DH.js";
79
79
  import {
80
80
  getDefaultCliLocalRuntimeDb
81
81
  } from "./chunk-N4XRDM26.js";
82
82
  import {
83
83
  buildSkillDiscoveryContextLayer
84
- } from "./chunk-OFZPJ3NT.js";
84
+ } from "./chunk-2BWU4ORW.js";
85
85
  import {
86
86
  parseExternalSkillMarkdown,
87
87
  parseSkillDocProtocol
88
- } from "./chunk-AETZ7AD6.js";
88
+ } from "./chunk-EY7V7REW.js";
89
89
  import {
90
90
  LOCAL_AGENT_CONFIG_MISSING_CODE,
91
91
  LOCAL_TURN_ABORTED_CODE,
92
92
  readActionGate,
93
93
  readCommandActionGatePayload
94
- } from "./chunk-LQ6PUHW6.js";
94
+ } from "./chunk-I7VDDN45.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-XXBMDMBU.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 isTruncated = result.emptyAssistantFallbackReason === "length_truncated" || result.emptyAssistantFallbackReason === "stream_truncated";
7153
+ const truncationNote = isTruncated ? { note: `empty assistant output: ${result.emptyAssistantFallbackReason}` } : {};
7154
+ const finalStatus = isTruncated || 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,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
  }
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  buildSkillDocMarkdown,
7
7
  resolvePageSkillMetadata
8
- } from "./chunk-AETZ7AD6.js";
8
+ } from "./chunk-EY7V7REW.js";
9
9
  import {
10
10
  canonicalizeToolNames
11
11
  } from "./chunk-O6OSWFZQ.js";
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-AGGIDPCZ.js";
14
14
  import {
15
15
  runLlm
16
- } from "./chunk-AUH2LTIY.js";
16
+ } from "./chunk-TLBZMLLJ.js";
17
17
  import {
18
18
  cleanupCliSessionForDialog
19
19
  } from "./chunk-MGIHZ5CJ.js";
@@ -3519,7 +3519,7 @@ var messageSlice = createSliceWithThunks({
3519
3519
  runtimeOptions: args.runtimeOptions
3520
3520
  });
3521
3521
  if (agentKeyToUse) {
3522
- const { streamAgentChatTurn } = await import("./agentSlice-HFR7SP3B.js");
3522
+ const { streamAgentChatTurn } = await import("./agentSlice-HTIEYKIU.js");
3523
3523
  await dispatch(
3524
3524
  streamAgentChatTurn({
3525
3525
  agentKey: agentKeyToUse,
@@ -4742,7 +4742,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
4742
4742
  }
4743
4743
  if (isCurrentDialog) {
4744
4744
  await thunkApi.dispatch(resetMsgs());
4745
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-P2VSKG2X.js");
4745
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-6BINHWQT.js");
4746
4746
  dispatch(clearPendingAttachments2());
4747
4747
  }
4748
4748
  return { dialogKey, isCurrentDialog, attachmentPlan };
@@ -4750,15 +4750,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
4750
4750
 
4751
4751
  // packages/chat/dialog/dialogSlice.ts
4752
4752
  var runCreateDialogAction = async (args, thunkApi) => {
4753
- const { createDialogAction } = await import("./createDialogAction-U4LDV2RW.js");
4753
+ const { createDialogAction } = await import("./createDialogAction-FD5AEOUF.js");
4754
4754
  return createDialogAction(args, thunkApi);
4755
4755
  };
4756
4756
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
4757
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-BH3D2L2H.js");
4757
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-TGUXUZCY.js");
4758
4758
  return createAgentAutomationAction(args, thunkApi);
4759
4759
  };
4760
4760
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
4761
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-WOTSDSFQ.js");
4761
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-EDUCIB7G.js");
4762
4762
  return updateDialogTitleAction(args, thunkApi);
4763
4763
  };
4764
4764
  var runAddDialogAgentAction = async (args, thunkApi) => {
@@ -4782,7 +4782,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
4782
4782
  return setDialogExtraReferencesAction(args, thunkApi);
4783
4783
  };
4784
4784
  var runHandleSendMessageAction = async (args, thunkApi) => {
4785
- const { handleSendMessageAction } = await import("./handleSendMessageAction-RRZ53YYH.js");
4785
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-QVG5YNZY.js");
4786
4786
  return handleSendMessageAction(args, thunkApi);
4787
4787
  };
4788
4788
  function clearDialogState() {
@@ -4795,7 +4795,7 @@ var createPageAndAddReference = createAsyncThunk(
4795
4795
  async (payload, { dispatch, getState, rejectWithValue }) => {
4796
4796
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
4797
4797
  try {
4798
- const { createDocState } = await import("./docStore-J5UWRBB4.js");
4798
+ const { createDocState } = await import("./docStore-SIUFLABN.js");
4799
4799
  const pageKey = await createDocState(
4800
4800
  { slateData, title },
4801
4801
  { dispatch, getState }
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  deleteDialog,
3
3
  toast
4
- } from "./chunk-DX6BP4K7.js";
4
+ } from "./chunk-PILJX4DH.js";
5
5
  import {
6
6
  deleteServerSyncedCredential
7
- } from "./chunk-AUH2LTIY.js";
7
+ } from "./chunk-TLBZMLLJ.js";
8
8
  import {
9
9
  require_date_fns
10
10
  } from "./chunk-M76ECQRD.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-XMFDQYWA.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-5GQ6XCJY.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-PILJX4DH.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-TLBZMLLJ.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-I7VDDN45.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) {
@@ -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-BUYCXZCQ.js");
307
+ const { _executeModel } = await import("./_executeModel-TMUXL7J5.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-35GKZDOZ.js");
328
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-SOKEXCUF.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-D5IDHXMV.js");
344
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-INF5RGK4.js");
345
345
  return streamAgentChatTurnHandler(args, thunkApi);
346
346
  }),
347
347
  /**