nolo-cli 0.53.0-alpha.1 → 0.54.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 (72) hide show
  1. package/{_executeModel-36GKPAEZ.js → _executeModel-IVEOJ7L6.js} +20 -20
  2. package/{agentDeleteCommand-SBODEUPE.js → agentDeleteCommand-D7AFLKQN.js} +10 -10
  3. package/{agentEmailCommands-ME7BCY5S.js → agentEmailCommands-MXFZGF54.js} +24 -24
  4. package/{agentListCommands-QBWPKN5D.js → agentListCommands-MP732Q23.js} +12 -12
  5. package/{agentMachineCommands-KFFUPELZ.js → agentMachineCommands-352JFJX4.js} +11 -11
  6. package/{agentRecordCommands-4BF6JIHS.js → agentRecordCommands-G6EFHU3G.js} +23 -23
  7. package/{agentRunCommand-4MA7D6SV.js → agentRunCommand-UUWJMH7J.js} +23 -23
  8. package/{agentRuntimeLocal-RD52NPCG.js → agentRuntimeLocal-KWBPJ53H.js} +10 -10
  9. package/{agentSlice-AJABGQHU.js → agentSlice-V742SNKC.js} +1 -1
  10. package/{appDeleteCommands-I42NL3LP.js → appDeleteCommands-GV4TF52A.js} +10 -10
  11. package/{appDeployCommands-CZWHXVPU.js → appDeployCommands-EZMUPNSW.js} +10 -10
  12. package/{appDeployStatusCommands-PIQYXACM.js → appDeployStatusCommands-AAGELKAN.js} +10 -10
  13. package/{appGetCommands-CI2OWLT7.js → appGetCommands-W37KDAON.js} +10 -10
  14. package/{appListCommands-LWLSHPCP.js → appListCommands-IFDWBBNV.js} +10 -10
  15. package/{authCommand-WLWOEVYI.js → authCommand-5HM57KPL.js} +7 -7
  16. package/{chatQueueReduxAdapter-V37RK3A6.js → chatQueueReduxAdapter-ZXXP6E4O.js} +8 -8
  17. package/{chunk-VKSBVRGP.js → chunk-2T6XO4PK.js} +1 -1
  18. package/{chunk-3YVCM5PE.js → chunk-45E65JER.js} +1 -1
  19. package/{chunk-TZRB2I2M.js → chunk-5SXS7T5Q.js} +9 -9
  20. package/{chunk-JBL24PK6.js → chunk-5Y5G76BJ.js} +2 -2
  21. package/{chunk-BO3YFOZR.js → chunk-7UFH6THF.js} +1 -1
  22. package/{chunk-CY5KIIPU.js → chunk-ALMVQQPG.js} +8 -8
  23. package/{chunk-PGKZ2KGE.js → chunk-BKPUPZ6W.js} +12 -12
  24. package/{chunk-4ZL2KBI7.js → chunk-CULR4XB4.js} +1 -1
  25. package/{chunk-OZKJBDG4.js → chunk-DMCFF4KE.js} +1 -1
  26. package/{chunk-AV4Z57LV.js → chunk-ET7BXWAW.js} +2 -2
  27. package/{chunk-W3RZLXMA.js → chunk-FZMM2KZC.js} +2 -2
  28. package/{chunk-C2WF2OY7.js → chunk-GBXR3CSM.js} +1 -1
  29. package/{chunk-QTH72J3N.js → chunk-J4Z6UI4C.js} +106 -18
  30. package/{chunk-VFN256RI.js → chunk-J7KVJAUQ.js} +26 -0
  31. package/{chunk-KOZ2G3ZG.js → chunk-K7CNV7GI.js} +3 -3
  32. package/{chunk-EVBFYPDC.js → chunk-M2CGG6VJ.js} +1 -1
  33. package/{chunk-XPW6JLOB.js → chunk-MC66ASS6.js} +3 -3
  34. package/{chunk-IVKEJD7I.js → chunk-OU7NGN5Y.js} +1 -1
  35. package/{chunk-PJASTA2U.js → chunk-PEMGYJNS.js} +2 -2
  36. package/{chunk-F22JQTSX.js → chunk-PTHLNXGY.js} +2 -2
  37. package/{chunk-67Q6IHM5.js → chunk-R63FNYSI.js} +87 -45
  38. package/{chunk-QF27IZB3.js → chunk-RBJD33HM.js} +3 -3
  39. package/{chunk-DFY6O64O.js → chunk-RVHPY5PC.js} +2 -2
  40. package/{chunk-5SLTA66C.js → chunk-SUFDWBLV.js} +13 -13
  41. package/{chunk-H5QLIP6S.js → chunk-VM7K5EJL.js} +2 -2
  42. package/{chunk-POLE2QLO.js → chunk-W6N3GLUU.js} +80 -25
  43. package/{chunk-Y7TGWSUN.js → chunk-WJV3G7BM.js} +1 -1
  44. package/{chunk-XB7ACJFH.js → chunk-WUMYQ2FE.js} +2 -2
  45. package/{chunk-JVKFKKYN.js → chunk-XXZULHJ7.js} +1 -1
  46. package/{chunk-Z7A54NFZ.js → chunk-YFHUQLJF.js} +1 -1
  47. package/{chunk-AZ6DT2UD.js → chunk-ZMV5PCRS.js} +1 -1
  48. package/{createAgentAutomationAction-5OZIWOK4.js → createAgentAutomationAction-LE3ZYDT6.js} +9 -9
  49. package/{createDialogAction-334CHPJF.js → createDialogAction-2C6SR62D.js} +10 -10
  50. package/{createPageAction-LXY22WTA.js → createPageAction-X4C7K3OD.js} +9 -9
  51. package/{dialogCommands-4MGUHAJI.js → dialogCommands-CP2U44A7.js} +10 -10
  52. package/{dialogSlice-76W7S3C4.js → dialogSlice-2SH5636X.js} +8 -8
  53. package/{docCreateCommands-346W5443.js → docCreateCommands-A2KIJSF7.js} +10 -10
  54. package/{docDeleteCommands-FKEEPUUS.js → docDeleteCommands-NZ7XO4Z4.js} +10 -10
  55. package/{docReadCommands-AACI4DVO.js → docReadCommands-VWVK4ZAR.js} +10 -10
  56. package/{docStore-N7QTPHAX.js → docStore-J6GQYKHS.js} +10 -10
  57. package/{docUpdateCommands-WHWVZ2XE.js → docUpdateCommands-YTUEC6PN.js} +10 -10
  58. package/{getPricing-JNOCWYDH.js → getPricing-I53UFOPH.js} +3 -3
  59. package/{handleSendMessageAction-EAXEX5AX.js → handleSendMessageAction-MD325XZS.js} +8 -8
  60. package/index.js +47 -47
  61. package/{machineCommands-XNWLQVTN.js → machineCommands-TCNZV2DC.js} +23 -23
  62. package/{machineWsRunDispatch-56HWQ67L.js → machineWsRunDispatch-QSX5IWPH.js} +23 -23
  63. package/{models-N4NXQ44D.js → models-E2CYP4IB.js} +2 -2
  64. package/package.json +1 -1
  65. package/{readlineWorkspace-AXTB7DJC.js → readlineWorkspace-N3RGX7EK.js} +67 -31
  66. package/{runAgentClientLoop-PU3R3UXA.js → runAgentClientLoop-R3NTOERA.js} +18 -18
  67. package/{spaceCommands-JYI3X4N2.js → spaceCommands-RC7XMYQ7.js} +10 -10
  68. package/{spaceSlice-ERZ3RGWC.js → spaceSlice-KBVKKO3M.js} +9 -9
  69. package/{streamAgentChatTurn-2IH4MTQC.js → streamAgentChatTurn-WLWEBWSF.js} +21 -21
  70. package/{tools-DJUTQEMP.js → tools-LSLDSUWU.js} +13 -13
  71. package/{tuiSummaryLlmCaller-U4EGD2SX.js → tuiSummaryLlmCaller-TPBL4BV2.js} +6 -6
  72. package/{updateDialogTitleAction-OVOPGTC3.js → updateDialogTitleAction-4HJEARM7.js} +9 -9
@@ -7,7 +7,7 @@ import {
7
7
  providerHttpFailure,
8
8
  readSseFrames,
9
9
  throwIfChatCompletionStreamFailed
10
- } from "./chunk-XB7ACJFH.js";
10
+ } from "./chunk-WUMYQ2FE.js";
11
11
  import {
12
12
  FRESH_TOOL_OUTPUT_MAX_CHARS,
13
13
  MAX_HISTORICAL_TOOL_CONTENT_CHARS,
@@ -17,7 +17,7 @@ import {
17
17
  resolveHistoricalToolContentCap,
18
18
  resolveToolOutputProfile,
19
19
  stripImagePartsFromMessages
20
- } from "./chunk-VKSBVRGP.js";
20
+ } from "./chunk-2T6XO4PK.js";
21
21
  import {
22
22
  sanitizeForOutbound
23
23
  } from "./chunk-T27IEBNQ.js";
@@ -36,7 +36,7 @@ import {
36
36
  requiresBareImageUrl,
37
37
  resolveToolGuidedSections,
38
38
  toBareImageUrlMessages
39
- } from "./chunk-OZKJBDG4.js";
39
+ } from "./chunk-DMCFF4KE.js";
40
40
  import {
41
41
  convertMessagesToResponsesInput,
42
42
  extractReasoningFromResponseOutput,
@@ -50,7 +50,7 @@ import {
50
50
  import {
51
51
  buildProviderAuthHeaders,
52
52
  buildProviderExecutionPlan
53
- } from "./chunk-JBL24PK6.js";
53
+ } from "./chunk-5Y5G76BJ.js";
54
54
  import {
55
55
  NOLO_WORKSPACE_TOOL_NAMES,
56
56
  buildNoloWorkspaceCommandArgs,
@@ -69,7 +69,7 @@ import {
69
69
  resolveEmptyAssistantFallbackMessage,
70
70
  resolveEmptyAssistantOutcome,
71
71
  resolveTruncatedReasoningTailLog
72
- } from "./chunk-F22JQTSX.js";
72
+ } from "./chunk-PTHLNXGY.js";
73
73
  import {
74
74
  COMPACTION_SUMMARY_SCHEMA_VERSION,
75
75
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
@@ -174,6 +174,26 @@ function readTitleParams(value) {
174
174
  return Object.fromEntries(entries);
175
175
  }
176
176
 
177
+ // packages/agent-runtime/fileWritePolicy.ts
178
+ function evaluateFileWritePolicy(args) {
179
+ if (args.sessionApproved) return { permissionDecision: "allow" };
180
+ return {
181
+ permissionDecision: "ask",
182
+ permissionRequest: {
183
+ id: "permission-file-write-session",
184
+ tool: args.tool,
185
+ action: "file_write",
186
+ title: "\u786E\u8BA4\u5199\u5165\u6587\u4EF6",
187
+ body: `\u672C\u4F1A\u8BDD\u9996\u6B21\u5199\u5165\u6587\u4EF6\uFF1A${args.path}\u3002\u6279\u51C6\u540E\u672C\u4F1A\u8BDD\u540E\u7EED\u5199\u5165\u4E0D\u518D\u9010\u6B21\u786E\u8BA4\u3002`,
188
+ command: args.path,
189
+ suggestedRule: {
190
+ scope: "session",
191
+ pattern: { capability: "file_write", target: "session" }
192
+ }
193
+ }
194
+ };
195
+ }
196
+
177
197
  // packages/agent-runtime/toolCallPairing.ts
178
198
  function readToolCallId(message) {
179
199
  if (typeof message.tool_call_id === "string" && message.tool_call_id) {
@@ -1540,6 +1560,41 @@ function applyPersistedTurnInput(messages, persistedInput, persistedInputReferen
1540
1560
  };
1541
1561
  });
1542
1562
  }
1563
+ var fileWriteSessionApproval = /* @__PURE__ */ new WeakMap();
1564
+ var fileWriteSessionKeys = /* @__PURE__ */ new Map();
1565
+ function getFileWriteSessionApproval(input) {
1566
+ if (input.fileWriteSessionId) {
1567
+ let key2 = fileWriteSessionKeys.get(input.fileWriteSessionId);
1568
+ if (!key2) {
1569
+ key2 = {};
1570
+ fileWriteSessionKeys.set(input.fileWriteSessionId, key2);
1571
+ }
1572
+ const existing2 = fileWriteSessionApproval.get(key2);
1573
+ if (existing2) return existing2;
1574
+ const created2 = { approved: false };
1575
+ fileWriteSessionApproval.set(key2, created2);
1576
+ return created2;
1577
+ }
1578
+ const key = input.adapter;
1579
+ const existing = fileWriteSessionApproval.get(key);
1580
+ if (existing) return existing;
1581
+ const created = { approved: false };
1582
+ fileWriteSessionApproval.set(key, created);
1583
+ return created;
1584
+ }
1585
+ function readToolPathForWriteGate(argumentsValue) {
1586
+ try {
1587
+ const parsed = JSON.parse(argumentsValue);
1588
+ return typeof parsed.path === "string" && parsed.path.trim() ? parsed.path.trim() : "the requested file";
1589
+ } catch {
1590
+ return "the requested file";
1591
+ }
1592
+ }
1593
+ function isCompletedActionGateResult(value) {
1594
+ return Boolean(
1595
+ value && typeof value === "object" && value.status === "completed"
1596
+ );
1597
+ }
1543
1598
  async function runLocalAgentTurn(input) {
1544
1599
  const agentConfig = await input.adapter.loadAgentConfig(input.agentRef);
1545
1600
  if (!agentConfig) {
@@ -1865,25 +1920,58 @@ ${reasoningTailLog}
1865
1920
  }
1866
1921
  );
1867
1922
  try {
1868
- const executePromise = input.adapter.executeTool({
1869
- id: toolCall.id,
1870
- name: toolName,
1871
- arguments: toolCall.function.arguments,
1872
- ...userInputText ? { userInput: userInputText } : {},
1873
- ...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {},
1874
- ...input.abortSignal ? { abortSignal: input.abortSignal } : {}
1875
- }, {
1876
- ...input.abortSignal ? { abortSignal: input.abortSignal } : {},
1877
- ...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {}
1878
- });
1879
- toolResult = await raceWithAbort(input, executePromise, toolName);
1923
+ const writeTool = toolName === "writeFile" || toolName === "editFile";
1924
+ if (writeTool && input.onActionGate) {
1925
+ const writeSession = getFileWriteSessionApproval(input);
1926
+ const policy = evaluateFileWritePolicy({
1927
+ tool: toolName,
1928
+ path: readToolPathForWriteGate(toolCall.function.arguments),
1929
+ sessionApproved: writeSession.approved
1930
+ });
1931
+ if (policy.permissionDecision === "ask") {
1932
+ const gate = {
1933
+ ...policy.permissionRequest,
1934
+ id: `${policy.permissionRequest.id}-${toolCall.id}`,
1935
+ kind: "confirm",
1936
+ toolName,
1937
+ toolCallId: toolCall.id
1938
+ };
1939
+ const replacement = await raceWithAbort(
1940
+ input,
1941
+ input.onActionGate(gate),
1942
+ `${toolName} confirmation`
1943
+ );
1944
+ const gateResult = replacement?.metadata?.actionGateResult;
1945
+ if (replacement === void 0 || isCompletedActionGateResult(gateResult)) {
1946
+ writeSession.approved = true;
1947
+ } else if (gateResult && typeof gateResult === "object" && (gateResult.status === "cancelled" || gateResult.status === "failed")) {
1948
+ toolResult = replacement;
1949
+ } else {
1950
+ writeSession.approved = true;
1951
+ }
1952
+ }
1953
+ }
1954
+ if (!toolResult) {
1955
+ const executePromise = input.adapter.executeTool({
1956
+ id: toolCall.id,
1957
+ name: toolName,
1958
+ arguments: toolCall.function.arguments,
1959
+ ...userInputText ? { userInput: userInputText } : {},
1960
+ ...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {},
1961
+ ...input.abortSignal ? { abortSignal: input.abortSignal } : {}
1962
+ }, {
1963
+ ...input.abortSignal ? { abortSignal: input.abortSignal } : {},
1964
+ ...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {}
1965
+ });
1966
+ toolResult = await raceWithAbort(input, executePromise, toolName);
1967
+ }
1880
1968
  const actionGate = buildActionGate({
1881
1969
  toolName,
1882
1970
  toolCallId: toolCall.id,
1883
1971
  metadata: toolResult.metadata
1884
1972
  });
1885
1973
  if (actionGate && input.onActionGate) {
1886
- const replacement = await input.onActionGate(actionGate);
1974
+ const replacement = await raceWithAbort(input, input.onActionGate(actionGate), `${toolName} action gate`);
1887
1975
  if (replacement) {
1888
1976
  toolResult = replacement;
1889
1977
  }
@@ -45,6 +45,7 @@ var PLATFORM_HOSTED_OPENAI_IMAGE_MODEL = "gpt-image-2";
45
45
  var PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL = "deepseek-v4-flash";
46
46
  var PLATFORM_HOSTED_DEEPSEEK_FLASH_VISION_EXP_MODEL = "deepseek-v4-flash-vision-exp";
47
47
  var PLATFORM_HOSTED_DEEPSEEK_PRO_MODEL = "deepseek-v4-pro";
48
+ var PLATFORM_HOSTED_NEMOTRON_35_LIGHTNING_MODEL = "nemotron-3-5-lightning-30b";
48
49
  var PLATFORM_HOSTED_KIMI_K3_MIN_CLIENT_VERSION = "0.38.0-alpha.4";
49
50
  var PLATFORM_HOSTED_GLM_53_FLASH_MIN_CLIENT_VERSION = "0.33.0-alpha.1";
50
51
  var PLATFORM_HOSTED_ROUTING_TABLE = {
@@ -165,6 +166,15 @@ var PLATFORM_HOSTED_ROUTING_TABLE = {
165
166
  wire: "responses",
166
167
  agentRunHosted: true
167
168
  },
169
+ // Nemotron 标题 LLM 内部专用,走 chatProxy;agentRun 不分流。
170
+ [PLATFORM_HOSTED_NEMOTRON_35_LIGHTNING_MODEL]: {
171
+ endpoint: "https://api.runinfra.ai/v1/chat/completions",
172
+ usageProvider: "runinfra",
173
+ keyName: "runinfra",
174
+ upstreamModelId: "nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16",
175
+ wire: "chat.completions",
176
+ agentRunHosted: false
177
+ },
168
178
  // DeepSeek Flash / Vision -> DeepSeek Responses API(agentRun 走专用 responses 编排)
169
179
  [PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL]: {
170
180
  endpoint: "https://api.deepseek.com/responses",
@@ -492,6 +502,11 @@ var PLATFORM_HOSTED_DEEPSEEK_FLASH_OFF_PEAK_PRICE = {
492
502
  output: toCnyCredits(4.5)
493
503
  // ¥4.5
494
504
  };
505
+ var PLATFORM_HOSTED_NEMOTRON_35_LIGHTNING_PRICE = {
506
+ input: toPlatformCredits(0.05),
507
+ inputCacheHit: toPlatformCredits(0.01),
508
+ output: toPlatformCredits(0.15)
509
+ };
495
510
  var PLATFORM_HOSTED_DEEPSEEK_PRO_PRICE = {
496
511
  input: 3.36,
497
512
  // 4.8 credits
@@ -515,6 +530,16 @@ var getPlatformHostedDeepSeekV4Price = (_model, nowMs = Date.now()) => {
515
530
  var isPlatformHostedDeepSeekV4Model = (model) => model === PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL || model === PLATFORM_HOSTED_DEEPSEEK_FLASH_VISION_EXP_MODEL;
516
531
  var isPlatformHostedDeepseekModel = (model) => model === PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL || model === PLATFORM_HOSTED_DEEPSEEK_FLASH_VISION_EXP_MODEL;
517
532
  var platformHostedModels = [
533
+ {
534
+ name: PLATFORM_HOSTED_NEMOTRON_35_LIGHTNING_MODEL,
535
+ displayName: "Nemotron 3.5 Lightning 30B",
536
+ hasVision: false,
537
+ price: { ...PLATFORM_HOSTED_NEMOTRON_35_LIGHTNING_PRICE },
538
+ maxOutputTokens: 32768,
539
+ contextWindow: 262144,
540
+ supportsTool: true,
541
+ supportsReasoningEffort: true
542
+ },
518
543
  {
519
544
  name: PLATFORM_HOSTED_KIMI_K3_MODEL,
520
545
  displayName: "Kimi K3",
@@ -800,6 +825,7 @@ export {
800
825
  resolveFireworksKimiModel,
801
826
  PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
802
827
  PLATFORM_HOSTED_DEEPSEEK_FLASH_VISION_EXP_MODEL,
828
+ PLATFORM_HOSTED_NEMOTRON_35_LIGHTNING_MODEL,
803
829
  resolvePlatformHostedRouting,
804
830
  NOLO_CLIENT_VERSION_HEADER,
805
831
  CLIENT_VERSION_TOO_OLD_CODE,
@@ -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-36GKPAEZ.js");
307
+ const { _executeModel } = await import("./_executeModel-IVEOJ7L6.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-PU3R3UXA.js");
328
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-R3NTOERA.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-2IH4MTQC.js");
344
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-WLWEBWSF.js");
345
345
  return streamAgentChatTurnHandler(args, thunkApi);
346
346
  }),
347
347
  /**
@@ -8,7 +8,7 @@ var BUILTIN_TITLE_LLM_CONFIG = {
8
8
  provider: "nolo",
9
9
  id: "builtin-dialog-title-llm",
10
10
  name: "Builtin Dialog Title LLM",
11
- model: "glm-5-3-flash",
11
+ model: "nemotron-3-5-lightning-30b",
12
12
  prompt: "You are a title generator for chat history. \u4F60\u53EA\u505A\u4E00\u4EF6\u4E8B\uFF1A\u6839\u636E\u5BF9\u8BDD\u5185\u5BB9\u8F93\u51FA\u6700\u7EC8\u6807\u9898\u3002\u786C\u6027\u89C4\u5219\uFF1A1) \u53EA\u8F93\u51FA\u6807\u9898\u8FD9\u4E00\u884C\uFF1B\u4E25\u7981\u8F93\u51FA\u63A8\u7406\u3001\u5206\u6790\u3001\u6B65\u9AA4\u3001\u89E3\u91CA\u3001\u524D\u8A00\u3001\u540E\u8BB0\u3001\u7FFB\u8BD1\u3001\u81F4\u6B49\u6216\u4EFB\u4F55\u989D\u5916\u8BF4\u660E\u30022) \u4E0D\u8981\u56DE\u7B54\u7528\u6237\u8BF7\u6C42\uFF0C\u4E0D\u8981\u5199\u6458\u8981\uFF0C\u53EA\u7ED9\u6807\u9898\u7ED3\u679C\u30023) \u6807\u9898\u5C3D\u91CF\u77ED\uFF1A\u901A\u5E38 2-5 \u4E2A\u8BCD\uFF0C\u82F1\u6587\u4E0D\u8D85\u8FC7 6 \u4E2A\u8BCD\u30024) \u4F7F\u7528\u5BF9\u8BDD\u4E3B\u8BED\u8A00\uFF1B\u6DF7\u5408\u8BED\u8A00\u65F6\u4F18\u5148\u7528\u6237\u4E3B\u8981\u8BED\u8A00\u30025) \u4F18\u5148\u590D\u7528\u5BF9\u8BDD\u4E2D\u7684\u5177\u4F53\u4E3B\u9898\u8BCD\uFF0C\u907F\u514D issue\u3001help\u3001discussion\u3001analysis\u3001update \u8FD9\u7C7B\u7A7A\u6CDB\u8BCD\u30026) \u5FFD\u7565 tool JSON\u3001\u51FD\u6570\u540D\u3001branch label\u3001agent \u540D\u3001\u7CFB\u7EDF\u6307\u4EE4\u548C\u7F16\u6392\u75D5\u8FF9\uFF08\u5982 GPT\u3001Claude\u3001Gemini\uFF09\uFF1B\u6807\u9898\u8981\u843D\u5728\u7528\u6237\u771F\u6B63\u8BA8\u8BBA\u7684\u5BF9\u8C61\u6216\u51B3\u7B56\u4E0A\u30027) \u66F4\u504F\u597D\u201C\u5BF9\u8C61 + \u52A8\u4F5C/\u5224\u65AD\u201D\u7684\u77ED\u6807\u9898\uFF0C\u4F8B\u5982\u201CAI \u90AE\u4EF6\u52A9\u624B\u53D6\u820D\u201D\u201C\u4E1C\u4EAC\u56DB\u65E5\u6162\u65C5\u884C\u201D\u201C\u91CD\u590D\u6263\u8D39\u9000\u6B3E\u201D\u30028) \u7EAF\u6587\u672C\uFF0C\u4E0D\u8981\u9879\u76EE\u7B26\u53F7\u3001\u7F16\u53F7\u3001markdown\u3001emoji\u3002\u6700\u7EC8\u53EA\u8FD4\u56DE\u6807\u9898\u6587\u672C\u3002 Output only the title text."
13
13
  };
14
14
  var BUILTIN_SUMMARY_LLM_CONFIG = {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-DFY6O64O.js";
3
+ } from "./chunk-RVHPY5PC.js";
4
4
  import {
5
5
  prepareAndPersistMessage,
6
6
  uiAskChoiceFunc,
7
7
  uiAskChoiceFunctionSchema
8
- } from "./chunk-PGKZ2KGE.js";
8
+ } from "./chunk-BKPUPZ6W.js";
9
9
  import {
10
10
  require_date_fns
11
11
  } from "./chunk-M76ECQRD.js";
@@ -18,7 +18,7 @@ import {
18
18
  import {
19
19
  PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
20
20
  PLATFORM_HOSTED_KIMI_PROVIDER
21
- } from "./chunk-VFN256RI.js";
21
+ } from "./chunk-J7KVJAUQ.js";
22
22
  import {
23
23
  read,
24
24
  readAndWait,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-POLE2QLO.js";
3
+ } from "./chunk-W6N3GLUU.js";
4
4
  import {
5
5
  getReadableCliDb
6
6
  } from "./chunk-43CXXVJD.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  updateContentTitle
3
- } from "./chunk-DFY6O64O.js";
3
+ } from "./chunk-RVHPY5PC.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-LXY22WTA.js");
370
+ const { createPageAction } = await import("./createPageAction-X4C7K3OD.js");
371
371
  return createPageAction(args, thunkApi);
372
372
  }
373
373
  function subscribe(listener) {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  MODEL_LOOKUP_MAP
3
- } from "./chunk-BO3YFOZR.js";
3
+ } from "./chunk-7UFH6THF.js";
4
4
  import {
5
5
  ALL_MODELS
6
- } from "./chunk-Y7TGWSUN.js";
6
+ } from "./chunk-WJV3G7BM.js";
7
7
  import {
8
8
  PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY
9
9
  } from "./chunk-2JYSSXLY.js";
@@ -19,7 +19,7 @@ import {
19
19
  parseAgentRunEvent,
20
20
  t,
21
21
  toolLabel
22
- } from "./chunk-POLE2QLO.js";
22
+ } from "./chunk-W6N3GLUU.js";
23
23
  import {
24
24
  getReadableCliDb
25
25
  } from "./chunk-43CXXVJD.js";
@@ -52,7 +52,7 @@ import {
52
52
  } from "./chunk-LTRXGFMS.js";
53
53
  import {
54
54
  formatAgentListCard
55
- } from "./chunk-5SLTA66C.js";
55
+ } from "./chunk-SUFDWBLV.js";
56
56
  import {
57
57
  isTransientFetchError
58
58
  } from "./chunk-5XTOKQLW.js";
@@ -74,12 +74,12 @@ import {
74
74
  chooseMemoryOwners,
75
75
  loadMemoryCandidatesFromDb,
76
76
  resolveAgentMemoryPolicy
77
- } from "./chunk-XPW6JLOB.js";
77
+ } from "./chunk-MC66ASS6.js";
78
78
  import {
79
79
  API_REPORTED_COST_MULTIPLIER,
80
80
  normalizeUsage,
81
81
  parseUiAskChoiceContent
82
- } from "./chunk-PGKZ2KGE.js";
82
+ } from "./chunk-BKPUPZ6W.js";
83
83
  import {
84
84
  getDefaultCliLocalRuntimeDb
85
85
  } from "./chunk-IA3A5373.js";
@@ -95,10 +95,10 @@ import {
95
95
  LOCAL_TURN_ABORTED_CODE,
96
96
  readActionGate,
97
97
  readCommandActionGatePayload
98
- } from "./chunk-QTH72J3N.js";
98
+ } from "./chunk-J4Z6UI4C.js";
99
99
  import {
100
100
  resolveAgentRuntimeConfigFromRecord
101
- } from "./chunk-VKSBVRGP.js";
101
+ } from "./chunk-2T6XO4PK.js";
102
102
  import {
103
103
  createThinkParserState,
104
104
  flushThinkParser,
@@ -107,20 +107,20 @@ import {
107
107
  import {
108
108
  resolveClientVersion,
109
109
  resolvePlatformAuthToken
110
- } from "./chunk-JBL24PK6.js";
110
+ } from "./chunk-5Y5G76BJ.js";
111
111
  import {
112
112
  isQuotaExhaustedError
113
113
  } from "./chunk-IWUMSAQF.js";
114
114
  import {
115
115
  DEFAULT_CONTEXT_WINDOW,
116
116
  getModelContextWindow
117
- } from "./chunk-F22JQTSX.js";
117
+ } from "./chunk-PTHLNXGY.js";
118
118
  import {
119
119
  clipCompactText
120
120
  } from "./chunk-HR5XDXYM.js";
121
121
  import {
122
122
  findModelConfig
123
- } from "./chunk-BO3YFOZR.js";
123
+ } from "./chunk-7UFH6THF.js";
124
124
  import {
125
125
  compactWhitespace
126
126
  } from "./chunk-DWLEOOGR.js";
@@ -145,7 +145,7 @@ import {
145
145
  CLIENT_VERSION_TOO_OLD_CODE,
146
146
  NOLO_CLIENT_VERSION_HEADER,
147
147
  buildClientVersionUpgradeMessage
148
- } from "./chunk-VFN256RI.js";
148
+ } from "./chunk-J7KVJAUQ.js";
149
149
  import {
150
150
  parsePositiveFiniteNumberOrFallback
151
151
  } from "./chunk-Y5GCAMGP.js";
@@ -3999,36 +3999,45 @@ function formatToolTraceLine(text, colorEnabled, accent = "none") {
3999
3999
  return `${dimCliText(text, true)}
4000
4000
  `;
4001
4001
  }
4002
+ var cleanUserText = (value) => stripAnsi2(value).replace(/[\r\n]+/g, " ").replace(/\s+/g, " ").trim();
4002
4003
  function renderRunCard(snapshot, opts) {
4003
4004
  const labels = agentRunCardLabels();
4004
4005
  const timing = { startedAt: snapshot.startedAt, finishedAt: snapshot.finishedAt };
4005
- const name = snapshot.agentName ?? "agent";
4006
- if (isAgentRunTerminalStatus(snapshot.status)) {
4007
- return formatFinishedRunCard(name, snapshot.status, {
4008
- runId: snapshot.runId,
4009
- toolCallCount: snapshot.toolCallCount,
4010
- lastToolNames: snapshot.lastToolNames,
4011
- lastAssistantText: snapshot.lastAssistantText,
4012
- errorMessage: snapshot.errorMessage,
4013
- logLines: snapshot.logLines,
4014
- timing,
4015
- ...opts?.includeLogTail !== void 0 ? { includeLogTail: opts.includeLogTail } : {},
4016
- labels
4017
- });
4018
- }
4019
- return formatStatusRunCard(name, snapshot.status, {
4006
+ const safe = opts?.safe === true;
4007
+ const name = safe ? cleanUserText(snapshot.agentName ?? "agent") : snapshot.agentName ?? "agent";
4008
+ const source = safe ? {
4009
+ ...snapshot,
4010
+ agentName: snapshot.agentName ? cleanUserText(snapshot.agentName) : snapshot.agentName,
4011
+ taskPreview: snapshot.taskPreview ? cleanUserText(snapshot.taskPreview) : snapshot.taskPreview,
4012
+ lastAssistantText: snapshot.lastAssistantText ? cleanUserText(snapshot.lastAssistantText) : snapshot.lastAssistantText,
4013
+ lastToolNames: snapshot.lastToolNames?.map(cleanUserText)
4014
+ } : snapshot;
4015
+ const hadError = safe && Boolean(source.errorMessage?.trim());
4016
+ const errorFields = safe ? { errorMessage: void 0, logLines: void 0 } : { errorMessage: source.errorMessage, logLines: source.logLines };
4017
+ const body = isAgentRunTerminalStatus(snapshot.status) ? formatFinishedRunCard(name, snapshot.status, {
4020
4018
  runId: snapshot.runId,
4021
- toolCallCount: snapshot.toolCallCount,
4022
- lastToolNames: snapshot.lastToolNames,
4023
- lastAssistantText: snapshot.lastAssistantText,
4024
- errorMessage: snapshot.errorMessage,
4025
- logLines: snapshot.logLines,
4019
+ toolCallCount: source.toolCallCount,
4020
+ lastToolNames: source.lastToolNames,
4021
+ lastAssistantText: source.lastAssistantText,
4022
+ ...errorFields,
4023
+ timing,
4024
+ ...opts?.includeLogTail !== void 0 ? { includeLogTail: opts.includeLogTail } : {},
4025
+ labels
4026
+ }) : formatStatusRunCard(name, snapshot.status, {
4027
+ runId: snapshot.runId,
4028
+ toolCallCount: source.toolCallCount,
4029
+ lastToolNames: source.lastToolNames,
4030
+ lastAssistantText: source.lastAssistantText,
4031
+ ...errorFields,
4026
4032
  timing,
4027
4033
  ...opts?.includeLogTail !== void 0 ? { includeLogTail: opts.includeLogTail } : {},
4028
4034
  labels
4029
4035
  });
4036
+ return hadError ? `${body}
4037
+ error ${t("runDiagnosticsHidden")}` : body;
4030
4038
  }
4031
- function recoverOrchestrationCard(event, toolName) {
4039
+ function recoverOrchestrationCard(event, toolName, opts) {
4040
+ const safe = opts?.safe === true;
4032
4041
  const content = typeof event.content === "string" ? event.content : "";
4033
4042
  const trimmed = content.trim();
4034
4043
  if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return null;
@@ -4059,27 +4068,30 @@ function recoverOrchestrationCard(event, toolName) {
4059
4068
  if (!parsedEvent) return null;
4060
4069
  const { kind, snapshot } = parsedEvent;
4061
4070
  if (kind === "start") {
4062
- return formatStartRunCard(snapshot.agentName ?? "agent", snapshot.status, {
4063
- task: snapshot.taskPreview,
4071
+ const name = safe ? cleanUserText(snapshot.agentName ?? "agent") : snapshot.agentName ?? "agent";
4072
+ const task = snapshot.taskPreview ? safe ? cleanUserText(snapshot.taskPreview) : snapshot.taskPreview : snapshot.taskPreview;
4073
+ return formatStartRunCard(name, snapshot.status, {
4074
+ task,
4064
4075
  runId: snapshot.runId,
4065
4076
  labels
4066
4077
  });
4067
4078
  }
4068
4079
  if (kind === "gone") return formatNotFoundRunCard(labels);
4069
4080
  if (kind === "stop") return formatStopRunCard(snapshot.status, labels);
4070
- return renderRunCard(snapshot);
4081
+ return renderRunCard(snapshot, opts);
4071
4082
  }
4072
4083
  function parseControlAgentRunStatusEvent(event) {
4073
4084
  const parsed = parseAgentRunEvent(event);
4074
4085
  return parsed?.kind === "status" ? parsed.snapshot : null;
4075
4086
  }
4076
- function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
4087
+ function formatOrchestrationCardBlock(event, toolName, colorEnabled, opts) {
4088
+ const safe = opts?.safe === true;
4077
4089
  const rawLabel = toolLabel(toolName);
4078
4090
  const bakedCard = typeof event.metadata?.displayData === "string" && event.metadata.displayData.trim() ? event.metadata.displayData : "";
4079
- const rawDataStr = recoverOrchestrationCard(event, toolName) || bakedCard || (typeof event.content === "string" ? event.content : "");
4091
+ const rawDataStr = recoverOrchestrationCard(event, toolName, { safe }) || bakedCard || (typeof event.content === "string" ? event.content : "");
4080
4092
  const failed = event.type === "tool-error" || isFailedToolResult(event) || Boolean(event.metadata?.failed) || /^Error:/i.test(rawDataStr.trim());
4081
4093
  if (failed) {
4082
- const firstLine = rawDataStr.trim().split("\n")[0] || event.summary || event.message || t("toolFailed");
4094
+ const firstLine = safe ? t("toolFailed") : rawDataStr.trim().split("\n")[0] || event.summary || event.message || t("toolFailed");
4083
4095
  const message = clip(firstLine, 96);
4084
4096
  if (!colorEnabled) {
4085
4097
  return `\u2717 ${rawLabel} ${message}
@@ -4092,11 +4104,12 @@ function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
4092
4104
  `;
4093
4105
  }
4094
4106
  const displayData = rawDataStr.trim();
4095
- const lines = displayData ? displayData.split("\n").filter((line) => !/^\s*agent\s+agent\s*$/.test(line)) : [];
4107
+ const lines = displayData ? displayData.split("\n") : [];
4108
+ const projected = safe ? sanitizeRunCardForNormal(lines) : lines;
4096
4109
  if (!colorEnabled) {
4097
4110
  let out2 = `\u25CF ${rawLabel}
4098
4111
  `;
4099
- for (const line of lines) {
4112
+ for (const line of projected) {
4100
4113
  out2 += ` ${line}
4101
4114
  `;
4102
4115
  }
@@ -4106,12 +4119,40 @@ function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
4106
4119
  const labelPart = themeText(rawLabel, "muted", true);
4107
4120
  let out = `${bullet} ${labelPart}
4108
4121
  `;
4109
- for (const line of lines) {
4122
+ for (const line of projected) {
4110
4123
  out += ` ${themeText(line, "muted", true)}
4111
4124
  `;
4112
4125
  }
4113
4126
  return out;
4114
4127
  }
4128
+ function sanitizeRunCardForNormal(lines) {
4129
+ const out = [];
4130
+ let errorIndent = null;
4131
+ for (const line of lines) {
4132
+ if (/^(log tail:?|日志尾部:?)$/i.test(line.trim())) {
4133
+ if (out.length > 0 && out[out.length - 1].trim() === "") out.pop();
4134
+ break;
4135
+ }
4136
+ if (/^\s*error\b/i.test(line)) {
4137
+ out.push(` error ${t("runDiagnosticsHidden")}`);
4138
+ errorIndent = line.length - line.trimStart().length;
4139
+ continue;
4140
+ }
4141
+ if (errorIndent !== null) {
4142
+ if (line.trim() === "") {
4143
+ errorIndent = null;
4144
+ out.push(line);
4145
+ continue;
4146
+ }
4147
+ const indent = line.length - line.trimStart().length;
4148
+ const isLabelRow = /^\s{2}[a-z][a-zA-Z0-9]*\s{2,}/.test(line);
4149
+ if (indent > errorIndent && !isLabelRow) continue;
4150
+ errorIndent = null;
4151
+ }
4152
+ out.push(line);
4153
+ }
4154
+ return out;
4155
+ }
4115
4156
  function mergeRunSnapshot(previous, next) {
4116
4157
  return {
4117
4158
  ...previous,
@@ -4176,10 +4217,10 @@ function formatNormalToolLine(event, pending, colorEnabled) {
4176
4217
  if (block) return block;
4177
4218
  }
4178
4219
  if (event.type === "tool-result" && (toolName === "listAgents" || toolName === "startAgentRun" || toolName === "controlAgentRun")) {
4179
- return formatOrchestrationCardBlock(event, toolName, colorEnabled);
4220
+ return formatOrchestrationCardBlock(event, toolName, colorEnabled, { safe: true });
4180
4221
  }
4181
4222
  if (event.type === "tool-result" && toolName === "loadSkill") {
4182
- return formatLoadSkillBlock(event, colorEnabled) ?? "";
4223
+ return formatLoadSkillBlock(event, colorEnabled, { safe: true }) ?? "";
4183
4224
  }
4184
4225
  const label = toolLabel(toolName);
4185
4226
  if (readActionGate(event.metadata?.actionGate)) {
@@ -4382,14 +4423,14 @@ function formatTodoListForCli(event, colorEnabled) {
4382
4423
  const text = [`\u2611 Todo (${todos.length})`, ...lines].join("\n") + "\n";
4383
4424
  return colorEnabled ? themeText(text, "chrome") : text;
4384
4425
  }
4385
- function formatLoadSkillBlock(event, colorEnabled) {
4426
+ function formatLoadSkillBlock(event, colorEnabled, opts) {
4386
4427
  if (event.type !== "tool-result" || event.toolName !== "loadSkill") return null;
4387
4428
  const skillName = resolveLoadSkillName(event);
4388
4429
  const content = typeof event.content === "string" ? event.content : "";
4389
4430
  const failed = /^Skill\s+"[^"]*"\s+not found/.test(content) || isFailedToolResult(event);
4390
4431
  const labelText = t("usedSkillLabel");
4391
4432
  if (failed) {
4392
- const message = clip(content.split("\n")[0] || t("toolFailed"), 96);
4433
+ const message = opts?.safe === true ? t("toolFailed") : clip(content.split("\n")[0] || t("toolFailed"), 96);
4393
4434
  return formatToolTraceLine(`\u25B8 ${labelText} (${skillName}) \u2717 ${message}`, colorEnabled, "error");
4394
4435
  }
4395
4436
  if (!colorEnabled) {
@@ -5512,7 +5553,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
5512
5553
  // packages/cli/client/agentRun.ts
5513
5554
  import { ulid } from "ulid";
5514
5555
  async function loadRunLocalAgentTurn() {
5515
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-RD52NPCG.js");
5556
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-KWBPJ53H.js");
5516
5557
  return runLocalAgentTurn;
5517
5558
  }
5518
5559
  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();
@@ -6137,6 +6178,7 @@ async function runLocalAgentTurnForCli(options, settings) {
6137
6178
  contextReferenceResolver: (reference) => canResolveCollapsedPasteReference(options.pastedTextStore, reference)
6138
6179
  } : {},
6139
6180
  continueDialogId: currentDialogId,
6181
+ fileWriteSessionId: currentDialogId,
6140
6182
  spaceId: options.spaceId,
6141
6183
  category: options.category,
6142
6184
  inheritedFromDialogKey: options.inheritedFromDialogKey,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-POLE2QLO.js";
4
+ } from "./chunk-W6N3GLUU.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-5SLTA66C.js";
7
+ } from "./chunk-SUFDWBLV.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-QTH72J3N.js";
10
+ } from "./chunk-J4Z6UI4C.js";
11
11
  import {
12
12
  resolveLocalRuntimeEnvFromPolicy
13
13
  } from "./chunk-NQ4N4IGO.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  deleteDialog,
3
3
  toast
4
- } from "./chunk-PGKZ2KGE.js";
4
+ } from "./chunk-BKPUPZ6W.js";
5
5
  import {
6
6
  deleteServerSyncedCredential
7
- } from "./chunk-KOZ2G3ZG.js";
7
+ } from "./chunk-K7CNV7GI.js";
8
8
  import {
9
9
  require_date_fns
10
10
  } from "./chunk-M76ECQRD.js";