nolo-cli 0.25.2 → 0.26.2

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 (81) hide show
  1. package/README.md +9 -18
  2. package/{_executeModel-LXNDVFT2.js → _executeModel-ZPNYAEFW.js} +18 -18
  3. package/{agentDeleteCommand-DMAYEVOP.js → agentDeleteCommand-5ZV4433K.js} +12 -12
  4. package/{agentEmailCommands-RVGRDAD6.js → agentEmailCommands-Z7KOYDVQ.js} +23 -23
  5. package/{agentListCommands-SMW3NENV.js → agentListCommands-UQUXJYUN.js} +14 -14
  6. package/{agentMachineCommands-VGE5A52U.js → agentMachineCommands-53O6P6L5.js} +12 -12
  7. package/{agentRecordCommands-UHFL5OLB.js → agentRecordCommands-ZRYNBSSS.js} +22 -22
  8. package/{agentRunCommand-GG4Z735K.js → agentRunCommand-B73MKVOG.js} +22 -22
  9. package/{agentRuntimeLocal-7N2SUWO2.js → agentRuntimeLocal-GVNERRKQ.js} +11 -9
  10. package/{agentSlice-WY7SEYXO.js → agentSlice-OJBHIL34.js} +1 -1
  11. package/{appDeleteCommands-AUC7KDHU.js → appDeleteCommands-23Z3Z6KE.js} +13 -13
  12. package/{appDeployCommands-OVYWXTNP.js → appDeployCommands-3MFAR4Z7.js} +13 -13
  13. package/{appDeployStatusCommands-DNUCH3KK.js → appDeployStatusCommands-JHU6GSN4.js} +13 -13
  14. package/{appGetCommands-4DLM2P37.js → appGetCommands-24J55H2Y.js} +13 -13
  15. package/{appListCommands-CL4VLCZW.js → appListCommands-HE5KP3PH.js} +13 -13
  16. package/{authCommand-W2BDNL4D.js → authCommand-KGRK6MNU.js} +8 -8
  17. package/{authCommands-NYZM2B2I.js → authCommands-JSOG2H4E.js} +2 -2
  18. package/{chunk-OBO5YB35.js → chunk-5DWZ46RJ.js} +1 -1
  19. package/{chunk-E2VQTGUO.js → chunk-5EDKWSQN.js} +8 -8
  20. package/{chunk-B6RCQ4BM.js → chunk-AAWJ5S3G.js} +1 -1
  21. package/{chunk-THN2YFSR.js → chunk-ADE6577S.js} +62 -17
  22. package/{chunk-SDDOGQ6M.js → chunk-AOPOTHFK.js} +1 -1
  23. package/{chunk-OTIS3VY6.js → chunk-AZW5AHMW.js} +1 -1
  24. package/{chunk-7HD7MCCZ.js → chunk-CV6BM7LU.js} +1 -1
  25. package/{chunk-ACBCDO2E.js → chunk-CWTT2NZ6.js} +2 -2
  26. package/{chunk-OHK3HE4G.js → chunk-CZHE6LLV.js} +74 -11
  27. package/{chunk-35RYGII3.js → chunk-FXFGNOT2.js} +67 -1
  28. package/{chunk-T3EOQH72.js → chunk-G36SUBHA.js} +14 -4
  29. package/{chunk-QJZJW65A.js → chunk-GD23ZX7Z.js} +3 -3
  30. package/{chunk-DXJS7VSG.js → chunk-GE6IWA5N.js} +9 -2
  31. package/{chunk-P5AVCQF3.js → chunk-GGB6MPHD.js} +19 -18
  32. package/{chunk-NZXRTSOY.js → chunk-GNGOZMU2.js} +2 -2
  33. package/{chunk-6NUG4BJE.js → chunk-J2WT5CEO.js} +1 -1
  34. package/{chunk-XJBAAOKS.js → chunk-JJ2WUBFN.js} +1 -1
  35. package/{chunk-ONGWRXVA.js → chunk-KURQBS7S.js} +1 -1
  36. package/{chunk-J6MEBHAT.js → chunk-LEHTC2FI.js} +1 -1
  37. package/{chunk-6OMNSBFW.js → chunk-LLDGWLML.js} +8 -8
  38. package/{chunk-MSBHAQVV.js → chunk-MCXQNEJ3.js} +1 -1
  39. package/{chunk-WV3WZRYZ.js → chunk-P3RZ6DHN.js} +74 -15
  40. package/{chunk-5IIJMMC3.js → chunk-PMCKFQYC.js} +1 -1
  41. package/{chunk-UTADKKM7.js → chunk-PTKI7TIN.js} +101 -23
  42. package/{chunk-5UI2CDQG.js → chunk-PXPISYEH.js} +14 -9
  43. package/{chunk-LWHK7TZR.js → chunk-PY7VGC5M.js} +24 -5
  44. package/{chunk-C4JWF4EX.js → chunk-RM464B7I.js} +2 -2
  45. package/{chunk-2KPE5HQM.js → chunk-S7AV3NCK.js} +47 -14
  46. package/{chunk-5TAM6OX3.js → chunk-SIUEKVK4.js} +136 -41
  47. package/{chunk-XR6PNQ3N.js → chunk-TLYHUIWF.js} +3 -3
  48. package/{chunk-RRJD2ZUV.js → chunk-TNM27YZ7.js} +3 -3
  49. package/{chunk-J3HWN4B5.js → chunk-TWA4L7J7.js} +1 -1
  50. package/{chunk-UZH44DWK.js → chunk-WCP5FDTF.js} +13 -20
  51. package/{chunk-4POUK2BV.js → chunk-WSQLK2KR.js} +1 -1
  52. package/{chunk-OMWJXZSZ.js → chunk-XNZJVYFS.js} +1 -1
  53. package/{chunk-KF3VWOQ6.js → chunk-YJY7HODU.js} +1 -1
  54. package/{chunk-DZNONG7L.js → chunk-ZFL3LTU7.js} +2 -2
  55. package/{createAgentAutomationAction-B5G57KMG.js → createAgentAutomationAction-PO62NUR7.js} +6 -6
  56. package/{createDialogAction-SYKO3ACQ.js → createDialogAction-ORFRYI3C.js} +7 -7
  57. package/{createPageAction-UBO6CXTT.js → createPageAction-XWVMNTYH.js} +6 -6
  58. package/{dialogCommands-FQPSK7QE.js → dialogCommands-XTJHROXM.js} +13 -13
  59. package/{dialogSlice-OFGPXYFS.js → dialogSlice-DJXC53YW.js} +6 -6
  60. package/{docCreateCommands-ELKBZBHI.js → docCreateCommands-T2XRVXYS.js} +12 -12
  61. package/{docDeleteCommands-R6X3FKHX.js → docDeleteCommands-L7RXFXY3.js} +13 -13
  62. package/{docReadCommands-QNVUXQNM.js → docReadCommands-M5PYNADQ.js} +12 -12
  63. package/{docStore-WFMCDOGV.js → docStore-6LKLLFDW.js} +7 -7
  64. package/{docUpdateCommands-OOR4CWYI.js → docUpdateCommands-OA5EGPLQ.js} +12 -12
  65. package/{getPricing-ZOASM7TQ.js → getPricing-6C3C47Y4.js} +3 -3
  66. package/{handleSendMessageAction-R3AP5MQY.js → handleSendMessageAction-ILFGZTN5.js} +6 -6
  67. package/index.js +68 -68
  68. package/{machineCommands-FPZ2UVCS.js → machineCommands-AKAQGPAO.js} +21 -21
  69. package/{machineWsRunDispatch-XAVKPZLL.js → machineWsRunDispatch-RSBERM64.js} +21 -21
  70. package/{models-DUNBMXRQ.js → models-ILWKIX2Y.js} +2 -2
  71. package/package.json +1 -1
  72. package/{readlineWorkspace-O3D2LRYG.js → readlineWorkspace-TUH3SFHO.js} +112 -62
  73. package/{runAgentClientLoop-UWNABHIZ.js → runAgentClientLoop-C3QB2EXV.js} +15 -15
  74. package/{spaceCommands-L6R7DD2L.js → spaceCommands-SXYOFGUJ.js} +12 -12
  75. package/{spaceSlice-2UQAI6GT.js → spaceSlice-6BHMRP5O.js} +6 -6
  76. package/{streamAgentChatTurn-SS62OWZZ.js → streamAgentChatTurn-GF5W5OIP.js} +18 -18
  77. package/{tableCommands-HEQYT2KP.js → tableCommands-QSZILI7I.js} +1 -1
  78. package/{tools-NVSLAOK4.js → tools-KBCLJ43G.js} +11 -11
  79. package/{tuiSummaryLlmCaller-A7OO23I4.js → tuiSummaryLlmCaller-ARIMGILF.js} +4 -4
  80. package/{updateCommands-HTCOBXCA.js → updateCommands-AK2RDOFR.js} +8 -2
  81. package/{updateDialogTitleAction-WMWZQ764.js → updateDialogTitleAction-LMHZUY4Q.js} +6 -6
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  sortSafeAgentSummaries,
17
17
  toSafeAgentSummary
18
- } from "./chunk-B6RCQ4BM.js";
18
+ } from "./chunk-AAWJ5S3G.js";
19
19
  import {
20
20
  getUserDataItemTimestamp,
21
21
  mergeAndDedupUserData
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-VF4K2QE6.js";
29
29
  import {
30
30
  createDocState
31
- } from "./chunk-ACBCDO2E.js";
31
+ } from "./chunk-CWTT2NZ6.js";
32
32
  import {
33
33
  setDialogExtraReferencesAction
34
34
  } from "./chunk-MALVZUYL.js";
@@ -44,7 +44,7 @@ import {
44
44
  buildBuiltinObjectSkillDbKey,
45
45
  buildBuiltinObjectSkillPageContent,
46
46
  createDialogAction
47
- } from "./chunk-NZXRTSOY.js";
47
+ } from "./chunk-GNGOZMU2.js";
48
48
  import {
49
49
  addCategory,
50
50
  addContentToSpace,
@@ -75,13 +75,13 @@ import {
75
75
  updateContentCategory,
76
76
  updateContentTitle,
77
77
  updateStep
78
- } from "./chunk-THN2YFSR.js";
78
+ } from "./chunk-ADE6577S.js";
79
79
  import {
80
80
  createAgent,
81
81
  runLlm,
82
82
  streamAgentChatTurn,
83
83
  updateAgent
84
- } from "./chunk-QJZJW65A.js";
84
+ } from "./chunk-GD23ZX7Z.js";
85
85
  import {
86
86
  CODING_SKILL_SLUGS,
87
87
  buildCodingSkillConfig,
@@ -113,13 +113,13 @@ import {
113
113
  redactAgentRecordForWorkspaceTool,
114
114
  resolveNoloDialogInput,
115
115
  verifyNoloDialogSubjectRefQuery
116
- } from "./chunk-UZH44DWK.js";
116
+ } from "./chunk-WCP5FDTF.js";
117
117
  import {
118
118
  buildDatabaseFileContentUrl
119
- } from "./chunk-LWHK7TZR.js";
119
+ } from "./chunk-PY7VGC5M.js";
120
120
  import {
121
121
  DEFAULT_MODEL
122
- } from "./chunk-J6MEBHAT.js";
122
+ } from "./chunk-LEHTC2FI.js";
123
123
  import {
124
124
  canonicalizeToolName,
125
125
  canonicalizeToolNames
@@ -11247,7 +11247,7 @@ var HOSTED_EXEC_RUNTIME_TOOL_POLICY = {
11247
11247
  workspace: { mode: "lease" }
11248
11248
  };
11249
11249
  var findModelConfig = async (modelName, provider) => {
11250
- const { ALL_MODELS } = await import("./models-DUNBMXRQ.js");
11250
+ const { ALL_MODELS } = await import("./models-ILWKIX2Y.js");
11251
11251
  const name = toTrimmedString(modelName);
11252
11252
  const prov = toTrimmedString(provider ?? "");
11253
11253
  if (!name) return null;
@@ -11488,7 +11488,7 @@ var buildFormDataFromArgs = async (args) => {
11488
11488
  const trimmedModel = toTrimmedString(model);
11489
11489
  const trimmedProvider = toTrimmedString(provider);
11490
11490
  const modelConfig = await findModelConfig(trimmedModel, trimmedProvider);
11491
- const { getModelPricing } = await import("./getPricing-ZOASM7TQ.js");
11491
+ const { getModelPricing } = await import("./getPricing-6C3C47Y4.js");
11492
11492
  const normalizedTools = tools ?? [];
11493
11493
  const resolvedRuntimeToolPolicy = runtimeToolPolicy ?? (normalizedTools.includes("execShell") ? HOSTED_EXEC_RUNTIME_TOOL_POLICY : void 0);
11494
11494
  const formData = {
@@ -14773,7 +14773,7 @@ async function deleteDialogsFunc(args, thunkApi) {
14773
14773
  const deletedDialogIds = [];
14774
14774
  const deletedDialogKeys = [];
14775
14775
  const failures = [];
14776
- const { deleteDialog } = await import("./dialogSlice-OFGPXYFS.js");
14776
+ const { deleteDialog } = await import("./dialogSlice-DJXC53YW.js");
14777
14777
  for (const target of targets) {
14778
14778
  try {
14779
14779
  await thunkApi.dispatch(deleteDialog(target.dbKey)).unwrap();
@@ -14843,7 +14843,8 @@ function formatAgentListCard(agents, maxDisplay = 8) {
14843
14843
  const name = agent.name || "(unnamed)";
14844
14844
  const model = agent.model || "\u2014";
14845
14845
  const source = agent.apiSource || agent.provider || agent.cliProvider || "\u2014";
14846
- lines.push(`${star}${own} ${name} ${model} ${source}`);
14846
+ const key = agent.agentKey || "(agentKey unavailable)";
14847
+ lines.push(`${star}${own} ${name} ${model} ${source} ${key}`);
14847
14848
  }
14848
14849
  if (total > maxDisplay) {
14849
14850
  lines.push(`\u2026 +${total - maxDisplay} more`);
@@ -14901,13 +14902,13 @@ async function listAgentsFunc(args, thunkApi) {
14901
14902
  }
14902
14903
  var readAgentFunctionSchema = {
14903
14904
  name: "readAgent",
14904
- description: "Read one agent's full config from the Nolo workspace. Accepts an agent dbKey (agent-xxx), plain id, alias, or agent URL; resolves it (including public agents via agent-pub-<id>; the server runtime also falls back to handle lookup) and returns the runnable agentKey plus a redacted record with fields such as model, provider, apiSource, tools, prompt, inputPrice, outputPrice, and isPublic. Use it to inspect an agent's full capabilities/credential status before delegation. Note: startAgentRun takes the exact agentKey from listAgents/readAgent; readAgent is not required before every dispatch when listAgents already gave you the key.",
14905
+ description: "Read one agent's full config from the Nolo workspace. Pass the exact agentKey from listAgents (agent-<userId>-<id> for owned agents or agent-pub-<id> for public agents); do not pass the display name shown in the compact list. A plain id or agent URL is also accepted when needed. Returns the resolved runnable agentKey and a redacted record with model, provider, apiSource, tools, prompt, prices, and isPublic.",
14905
14906
  parameters: {
14906
14907
  type: "object",
14907
14908
  properties: {
14908
14909
  agent: {
14909
14910
  type: "string",
14910
- description: "Agent dbKey (e.g. agent-xxx), agent id, alias, or agent URL."
14911
+ description: "Exact agentKey from listAgents (preferred; copy verbatim), agent id, or agent URL. Do not use the display name."
14911
14912
  }
14912
14913
  },
14913
14914
  required: ["agent"]
@@ -24174,7 +24175,7 @@ var executeToolRun = createAsyncThunk(
24174
24175
  if (!executionInput) {
24175
24176
  throw new Error(`ToolRun ${id} has no input to execute with.`);
24176
24177
  }
24177
- const { findToolExecutor: findToolExecutor2 } = await import("./tools-NVSLAOK4.js");
24178
+ const { findToolExecutor: findToolExecutor2 } = await import("./tools-KBCLJ43G.js");
24178
24179
  const { executor } = findToolExecutor2(run.toolName);
24179
24180
  toolRunStarted({
24180
24181
  id: run.id,
@@ -24198,7 +24199,7 @@ var executeToolRun = createAsyncThunk(
24198
24199
  const latestState = thunkApi.getState();
24199
24200
  const userId = latestState.auth?.currentUser?.userId;
24200
24201
  if (userId) {
24201
- const { fetchUserSpaceMemberships } = await import("./spaceSlice-2UQAI6GT.js");
24202
+ const { fetchUserSpaceMemberships } = await import("./spaceSlice-6BHMRP5O.js");
24202
24203
  await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
24203
24204
  }
24204
24205
  }
@@ -26681,7 +26682,7 @@ async function updateDocFunc(args, thunkApi) {
26681
26682
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
26682
26683
  };
26683
26684
  await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
26684
- const { getDocState, applyExternalDocUpdate } = await import("./docStore-WFMCDOGV.js");
26685
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-6LKLLFDW.js");
26685
26686
  if (getDocState().pageKey === id) {
26686
26687
  applyExternalDocUpdate({
26687
26688
  slateData: finalSlateData,
@@ -28119,7 +28120,7 @@ var baseToolDefinitions = [
28119
28120
  executor: listAgentsFunc,
28120
28121
  description: {
28121
28122
  name: "listAgents",
28122
- description: "List the current user's Nolo agents as safe summaries; use readAgent to resolve the runnable agentKey before delegation.",
28123
+ description: "List the current user's Nolo agents as safe summaries containing each agent's runnable agentKey for delegation. Copy the agentKey verbatim; do not infer it from the display name.",
28123
28124
  category: "Nolo workspace"
28124
28125
  },
28125
28126
  behavior: "data",
@@ -3,7 +3,7 @@ import {
3
3
  prepareAndPersistMessage,
4
4
  uiAskChoiceFunc,
5
5
  uiAskChoiceFunctionSchema
6
- } from "./chunk-THN2YFSR.js";
6
+ } from "./chunk-ADE6577S.js";
7
7
  import {
8
8
  require_date_fns
9
9
  } from "./chunk-M76ECQRD.js";
@@ -17,7 +17,7 @@ import {
17
17
  PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
18
18
  PLATFORM_HOSTED_DEEPSEEK_FLASH_PRICE,
19
19
  PLATFORM_HOSTED_KIMI_PROVIDER
20
- } from "./chunk-OHK3HE4G.js";
20
+ } from "./chunk-CZHE6LLV.js";
21
21
  import {
22
22
  read,
23
23
  readAndWait,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildLocalAgentLookupKeys,
3
3
  shouldReadAgentKeyRemotely
4
- } from "./chunk-OTIS3VY6.js";
4
+ } from "./chunk-AZW5AHMW.js";
5
5
  import {
6
6
  resolveCliAgentKeyInput
7
7
  } from "./chunk-VHBWHNVT.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-E2VQTGUO.js";
4
+ } from "./chunk-5EDKWSQN.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generatePkcePair,
3
3
  startCallbackServer
4
- } from "./chunk-J3HWN4B5.js";
4
+ } from "./chunk-TWA4L7J7.js";
5
5
  import {
6
6
  toErrorMessage
7
7
  } from "./chunk-HNMXYYJR.js";
@@ -14,7 +14,7 @@ import {
14
14
  platformHostedModels,
15
15
  xaiModels,
16
16
  zaiModels
17
- } from "./chunk-OHK3HE4G.js";
17
+ } from "./chunk-CZHE6LLV.js";
18
18
  import {
19
19
  __export
20
20
  } from "./chunk-4VNS5WPM.js";
@@ -5,10 +5,10 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-DZNONG7L.js";
8
+ } from "./chunk-ZFL3LTU7.js";
9
9
  import {
10
10
  performFetchRequest
11
- } from "./chunk-E2VQTGUO.js";
11
+ } from "./chunk-5EDKWSQN.js";
12
12
  import {
13
13
  createSSEParser,
14
14
  createToolRunId,
@@ -19,7 +19,7 @@ import {
19
19
  toolRunSetPending,
20
20
  toolRunStarted,
21
21
  toolRunSucceeded
22
- } from "./chunk-P5AVCQF3.js";
22
+ } from "./chunk-GGB6MPHD.js";
23
23
  import {
24
24
  getPublicImageAgentMode
25
25
  } from "./chunk-VIDPVFP3.js";
@@ -29,13 +29,13 @@ import {
29
29
  messageStreaming,
30
30
  selectCurrentSpaceId,
31
31
  updateToolMessage
32
- } from "./chunk-THN2YFSR.js";
32
+ } from "./chunk-ADE6577S.js";
33
33
  import {
34
34
  streamAgentChatTurn
35
- } from "./chunk-QJZJW65A.js";
35
+ } from "./chunk-GD23ZX7Z.js";
36
36
  import {
37
37
  EMPTY_ASSISTANT_REPAIR_PROMPT
38
- } from "./chunk-WV3WZRYZ.js";
38
+ } from "./chunk-P3RZ6DHN.js";
39
39
  import {
40
40
  accumulateToolCallDelta,
41
41
  createThinkParserState,
@@ -47,10 +47,10 @@ import {
47
47
  } from "./chunk-N7J63Q6C.js";
48
48
  import {
49
49
  getModelInfo
50
- } from "./chunk-LWHK7TZR.js";
50
+ } from "./chunk-PY7VGC5M.js";
51
51
  import {
52
52
  getApiEndpoint
53
- } from "./chunk-J6MEBHAT.js";
53
+ } from "./chunk-LEHTC2FI.js";
54
54
  import {
55
55
  addActiveController,
56
56
  removeActiveController,
@@ -24,7 +24,7 @@ import {
24
24
  resolvePlatformAuthToken,
25
25
  resolvePlatformServerUrl,
26
26
  resolveProviderTransportDecision
27
- } from "./chunk-5UI2CDQG.js";
27
+ } from "./chunk-PXPISYEH.js";
28
28
  import {
29
29
  clipCompactText
30
30
  } from "./chunk-5MMAK75Q.js";
@@ -10,18 +10,19 @@ import {
10
10
  planCompression,
11
11
  planContextUsage,
12
12
  serializeMessageContent
13
- } from "./chunk-LWHK7TZR.js";
13
+ } from "./chunk-PY7VGC5M.js";
14
14
  import {
15
15
  clipCompactText
16
16
  } from "./chunk-5MMAK75Q.js";
17
17
  import {
18
18
  findModelConfig,
19
19
  getProviderByModelName
20
- } from "./chunk-J6MEBHAT.js";
20
+ } from "./chunk-LEHTC2FI.js";
21
21
  import {
22
22
  buildDialogSummaryLayer
23
23
  } from "./chunk-AL2V7U3E.js";
24
24
  import {
25
+ canonicalizeToolName,
25
26
  canonicalizeToolNames
26
27
  } from "./chunk-ZZ2MH7LE.js";
27
28
  import {
@@ -372,24 +373,81 @@ function clipToolText(content, maxChars, headRatio, marker = "\n\n[... tool outp
372
373
  // packages/agent-runtime/localAutoCompaction.ts
373
374
  var LOCAL_AUTO_COMPACTION_SYSTEM_PROMPT = `\u4F60\u662F\u5BF9\u8BDD\u4E0A\u4E0B\u6587\u538B\u7F29\u5668\u3002\u6839\u636E\u3010\u73B0\u6709\u8BB0\u5FC6\u3011\u548C\u3010\u65B0\u589E\u5BF9\u8BDD\u3011\uFF0C\u8F93\u51FA\u53EF\u66FF\u4EE3\u539F\u59CB\u6D88\u606F\u7684\u4E8B\u5B9E\u6027\u8981\u70B9\uFF0C\u4F9B\u540E\u7EED\u5BF9\u8BDD\u76F4\u63A5\u4F7F\u7528\u3002
374
375
 
375
- \u4E25\u683C\u53EA\u8F93\u51FA\u4E0B\u9762\u4E24\u90E8\u5206\uFF0C\u6807\u9898\u5FC5\u987B\u5B8C\u5168\u4E00\u81F4\uFF1A
376
+ \u4E25\u683C\u53EA\u8F93\u51FA\u4E0B\u9762\u4E09\u90E8\u5206\uFF0C\u6807\u9898\u5FC5\u987B\u5B8C\u5168\u4E00\u81F4\uFF1A
376
377
  \u5173\u952E\u4E8B\u5B9E\u6863\u6848
377
378
  - ...
378
379
  \u5BF9\u8BDD\u8FDB\u5C55\u4E0E\u5F85\u529E
379
380
  - ...
381
+ \u6587\u4EF6\u64CD\u4F5C\u6E05\u5355
382
+ - ...
380
383
 
381
384
  \u8981\u6C42\uFF1A
382
385
  1) \u4F7F\u7528\u5BF9\u8BDD\u4E3B\u8BED\u8A00\uFF1B\u6DF7\u5408\u8BED\u8A00\u65F6\u4F18\u5148\u7528\u6237\u4E3B\u8981\u8BED\u8A00\uFF1B\u4E13\u6709\u540D\u8BCD\u3001\u6587\u4EF6\u8DEF\u5F84\u3001\u6807\u8BC6\u7B26\u3001\u547D\u4EE4\u4FDD\u7559\u539F\u6587\u3002
383
386
  2) \u5173\u952E\u4E8B\u5B9E\u6863\u6848\u53EA\u4FDD\u7559\u4E4B\u540E\u7EE7\u7EED\u5BF9\u8BDD\u4ECD\u6709\u4EF7\u503C\u7684\u4FE1\u606F\uFF1A\u7528\u6237\u76EE\u6807/\u504F\u597D\u3001\u7EA6\u675F\u3001\u6280\u672F\u6808\u3001\u786E\u5B9A\u7684\u6587\u4EF6\u8DEF\u5F84\u3001\u6838\u5FC3\u51B3\u7B56\u3001\u672A\u5B8C\u6210\u5F85\u529E\u3002
384
387
  3) \u5BF9\u8BDD\u8FDB\u5C55\u4E0E\u5F85\u529E\uFF1A\u5148\u6781\u7B80\u6982\u62EC\u65E7\u4E0A\u4E0B\u6587\uFF0C\u518D\u66F4\u8BE6\u7EC6\u8BB0\u5F55\u6700\u8FD1\u8FDB\u5C55\u3001\u7ED3\u8BBA\u3001\u5206\u6B67\u4E0E\u4E0B\u4E00\u6B65\u3002
385
- 4) \u5FFD\u7565\u5BD2\u6684\u3001\u91CD\u590D\u5C1D\u8BD5\u3001\u5DF2\u653E\u5F03\u65B9\u6848\u548C\u65E0\u4EF7\u503C\u5E9F\u8BDD\u3002
386
- 5) \u4E0D\u8981\u7F16\u9020\u672A\u51FA\u73B0\u7684\u4FE1\u606F\uFF1B\u4E0D\u8981\u5F00\u573A\u767D\u3001\u7ED3\u675F\u8BED\u3001markdown \u4EE3\u7801\u5757\u6216\u989D\u5916\u7AE0\u8282\uFF1B\u4E0D\u8981\u8C03\u7528\u4EFB\u4F55\u5DE5\u5177\u3002`;
387
- function buildLocalAutoCompactionUserContent(previousSummary, messagesText) {
388
- return `\u3010\u73B0\u6709\u8BB0\u5FC6\u3011\uFF1A
389
- ${previousSummary || "(\u65E0)"}
390
-
391
- \u3010\u65B0\u589E\u5BF9\u8BDD\u3011\uFF1A
392
- ${messagesText}`.trim();
388
+ 4) \u6587\u4EF6\u64CD\u4F5C\u6E05\u5355\uFF1A\u5217\u51FA\u672C\u6B21\u538B\u7F29\u8303\u56F4\u5185\u8BFB\u53D6\u3001\u5199\u5165\u3001\u7F16\u8F91\u8FC7\u7684\u6587\u4EF6\u8DEF\u5F84\u53CA\u64CD\u4F5C\u7C7B\u578B\uFF08\u5982: - \u8BFB\u53D6: path/to/file\uFF1B\u82E5\u672A\u6D89\u53CA\u6587\u4EF6\u64CD\u4F5C\u5199"\u65E0"\uFF09\u3002
389
+ 5) \u5FFD\u7565\u5BD2\u6684\u3001\u91CD\u590D\u5C1D\u8BD5\u3001\u5DF2\u653E\u5F03\u65B9\u6848\u548C\u65E0\u4EF7\u503C\u5E9F\u8BDD\u3002
390
+ 6) \u4E0D\u8981\u7F16\u9020\u672A\u51FA\u73B0\u7684\u4FE1\u606F\uFF1B\u4E0D\u8981\u5F00\u573A\u767D\u3001\u7ED3\u675F\u8BED\u3001markdown \u4EE3\u7801\u5757\u6216\u989D\u5916\u7AE0\u8282\uFF1B\u4E0D\u8981\u8C03\u7528\u4EFB\u4F55\u5DE5\u5177\u3002`;
391
+ function extractFileOperations(msgs) {
392
+ const result = [];
393
+ const seen = /* @__PURE__ */ new Set();
394
+ for (const msg of msgs) {
395
+ if (!Array.isArray(msg.tool_calls)) continue;
396
+ for (const call of msg.tool_calls) {
397
+ const name = call.function?.name || call.name || "";
398
+ if (!name) continue;
399
+ const canonicalName = canonicalizeToolName(name);
400
+ const fileOperationByTool = {
401
+ readFile: "read",
402
+ writeFile: "write",
403
+ editFile: "edit"
404
+ };
405
+ const opType = fileOperationByTool[canonicalName];
406
+ if (!opType) continue;
407
+ let rawArgs = call.function?.arguments ?? call.arguments;
408
+ let parsedArgs = null;
409
+ if (typeof rawArgs === "string") {
410
+ try {
411
+ parsedArgs = JSON.parse(rawArgs);
412
+ } catch {
413
+ }
414
+ } else if (typeof rawArgs === "object" && rawArgs !== null) {
415
+ parsedArgs = rawArgs;
416
+ }
417
+ const path = parsedArgs?.path ?? parsedArgs?.filePath ?? parsedArgs?.file;
418
+ if (typeof path === "string" && path.trim()) {
419
+ const key = `${opType}:${path.trim()}`;
420
+ if (!seen.has(key)) {
421
+ seen.add(key);
422
+ result.push({ type: opType, path: path.trim() });
423
+ }
424
+ }
425
+ }
426
+ }
427
+ return result;
428
+ }
429
+ function formatFileOperations(msgs) {
430
+ const ops = extractFileOperations(msgs);
431
+ if (ops.length === 0) {
432
+ return "\u65E0";
433
+ }
434
+ const typeLabelMap = {
435
+ read: "\u8BFB\u53D6",
436
+ write: "\u5199\u5165",
437
+ edit: "\u7F16\u8F91"
438
+ };
439
+ return ops.map((op) => `- ${typeLabelMap[op.type]}: ${op.path}`).join("\n");
440
+ }
441
+ function buildLocalAutoCompactionUserContent(previousSummary, messagesText, fileOpsText) {
442
+ const parts = [`\u3010\u73B0\u6709\u8BB0\u5FC6\u3011\uFF1A
443
+ ${previousSummary || "(\u65E0)"}`];
444
+ if (fileOpsText !== void 0) {
445
+ parts.push(`\u3010\u6587\u4EF6\u64CD\u4F5C\u6E05\u5355\u3011\uFF1A
446
+ ${fileOpsText || "\u65E0"}`);
447
+ }
448
+ parts.push(`\u3010\u65B0\u589E\u5BF9\u8BDD\u3011\uFF1A
449
+ ${messagesText}`);
450
+ return parts.join("\n\n").trim();
393
451
  }
394
452
  function toPlanCompressionMessages(history) {
395
453
  return history.map((message, index) => {
@@ -485,12 +543,13 @@ async function maybeAutoCompactLocalHistory(args) {
485
543
  }
486
544
  try {
487
545
  const provider = await args.resolveProvider();
488
- const messagesText = formatMessagesForLocalSummary(
489
- plan.msgsToCompress
490
- );
546
+ const msgsToCompress = plan.msgsToCompress;
547
+ const messagesText = formatMessagesForLocalSummary(msgsToCompress);
548
+ const fileOpsText = formatFileOperations(msgsToCompress);
491
549
  const promptContent = buildLocalAutoCompactionUserContent(
492
550
  existingSummary,
493
- messagesText
551
+ messagesText,
552
+ fileOpsText
494
553
  );
495
554
  const result = await provider.complete([
496
555
  { role: "system", content: LOCAL_AUTO_COMPACTION_SYSTEM_PROMPT },
@@ -2,7 +2,7 @@ import {
2
2
  deleteDbRecord,
3
3
  queryUserRecords,
4
4
  readDbRecord
5
- } from "./chunk-6NUG4BJE.js";
5
+ } from "./chunk-J2WT5CEO.js";
6
6
  import {
7
7
  mergeAndDedupUserData
8
8
  } from "./chunk-KQHGZWSV.js";