nolo-cli 0.27.1 → 0.29.0

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 (90) hide show
  1. package/{_executeModel-M6KLIXW5.js → _executeModel-YQ57CFSN.js} +23 -23
  2. package/{action-5MNAXR5B.js → action-6BM26ZYM.js} +4 -4
  3. package/{addContentAction-UNSYTVTB.js → addContentAction-HLTFX56O.js} +3 -3
  4. package/{addDialogAgentAction-LJGNP2AO.js → addDialogAgentAction-Q2TYWDO6.js} +2 -2
  5. package/{agentDeleteCommand-VFHDZJG3.js → agentDeleteCommand-VP4VLCMG.js} +12 -12
  6. package/{agentEmailCommands-NQ3SJXZX.js → agentEmailCommands-PSLJLQRR.js} +28 -28
  7. package/{agentListCommands-BDDUYHLP.js → agentListCommands-MJJJG3OW.js} +13 -13
  8. package/{agentMachineCommands-5WU7B2UY.js → agentMachineCommands-IP2A26V7.js} +12 -12
  9. package/{agentRecordCommands-FFFARZTU.js → agentRecordCommands-3HK3AR3H.js} +27 -27
  10. package/{agentRunCommand-GZYQTIYF.js → agentRunCommand-2IX2ELJQ.js} +28 -28
  11. package/{agentRuntimeLocal-552R4CZA.js → agentRuntimeLocal-VI3NHLDU.js} +9 -9
  12. package/{agentSlice-N7E7SG25.js → agentSlice-RR6OT2BW.js} +3 -3
  13. package/{appDeleteCommands-IPJT6IYW.js → appDeleteCommands-SF2V6QYZ.js} +13 -13
  14. package/{appDeployCommands-24P4CADQ.js → appDeployCommands-3EPVR545.js} +13 -13
  15. package/{appDeployStatusCommands-3DRZOUAG.js → appDeployStatusCommands-O65Y747J.js} +13 -13
  16. package/{appGetCommands-JEOSBLUL.js → appGetCommands-AHDOF4SS.js} +13 -13
  17. package/{appListCommands-EIBM54WR.js → appListCommands-Y7YCXODU.js} +13 -13
  18. package/{authCommand-MKMYHD52.js → authCommand-XMQHBK5L.js} +470 -40
  19. package/chunk-2FX23RGA.js +162 -0
  20. package/{chunk-ESKT7YVG.js → chunk-2IN43Q72.js} +3 -3
  21. package/{chunk-6MBOZ4UP.js → chunk-2TYLTEAH.js} +1 -1
  22. package/{chunk-TTPVLL5F.js → chunk-33K2M3AU.js} +9 -9
  23. package/{chunk-54VHTARN.js → chunk-3LJ4RSSF.js} +1 -1
  24. package/{chunk-J2GZXLI7.js → chunk-4S7B6YC5.js} +9 -9
  25. package/{chunk-I6RJGORZ.js → chunk-BOPFLKHA.js} +1 -1
  26. package/{chunk-FL42U2NZ.js → chunk-BYHN2CP5.js} +1 -1
  27. package/{chunk-OXLLFZNF.js → chunk-DBUNOYLF.js} +1 -1
  28. package/{chunk-S6KVFOUG.js → chunk-ENUJPSZN.js} +2 -2
  29. package/{chunk-O5VFD7V6.js → chunk-FVY6KI5A.js} +1 -1
  30. package/{chunk-ZNFZGHKL.js → chunk-I5TJCJQP.js} +1 -1
  31. package/{chunk-ROJI6DRT.js → chunk-INWBJPQC.js} +2 -2
  32. package/{chunk-FON47ACC.js → chunk-JYSXE6LE.js} +3 -3
  33. package/{chunk-C4KV25UH.js → chunk-KJJ6EWVW.js} +28 -69
  34. package/{chunk-KXEWHQAW.js → chunk-MHHYH3JA.js} +1 -1
  35. package/{chunk-NCRWA6ZB.js → chunk-NV2VP27U.js} +2 -2
  36. package/{chunk-YZV4676I.js → chunk-P6TB7JIA.js} +160 -14
  37. package/{chunk-WCP5FDTF.js → chunk-PFTK5SEB.js} +21 -5
  38. package/{chunk-PPAJNYFB.js → chunk-PJI44RVC.js} +9 -9
  39. package/{chunk-AL2V7U3E.js → chunk-PJY5AH5A.js} +25 -8
  40. package/{chunk-JQ3LNEMS.js → chunk-PMSG3OGF.js} +51 -4
  41. package/{chunk-NWDOO373.js → chunk-POANOUUC.js} +3 -3
  42. package/chunk-PSK2RUHV.js +529 -0
  43. package/{chunk-BAKXXTAC.js → chunk-RLQXGHUQ.js} +2 -2
  44. package/{chunk-7ORW7XI4.js → chunk-SIZWJA7H.js} +4 -4
  45. package/{chunk-6V6MYXPV.js → chunk-SRFEVECQ.js} +1 -1
  46. package/{chunk-7WMLPRXP.js → chunk-STOUEEBU.js} +1 -1
  47. package/{chunk-4OHJCHIL.js → chunk-VEHCU5XV.js} +35 -105
  48. package/{chunk-AYQYOZYH.js → chunk-VNMOLPVO.js} +23 -23
  49. package/{chunk-MALVZUYL.js → chunk-WPRSBZYN.js} +1 -1
  50. package/{chunk-VV4TYWNV.js → chunk-WX3ZOSTL.js} +376 -656
  51. package/{chunk-PVWFM7JP.js → chunk-XISENOC2.js} +1 -1
  52. package/{chunk-X43U4JUJ.js → chunk-YRMUYZ5H.js} +2 -2
  53. package/{chunk-JMSCXQUG.js → chunk-Z3LLUGD5.js} +1 -1
  54. package/{chunk-7OBMZCRD.js → chunk-ZVZMT3EA.js} +7 -5
  55. package/{chunk-4RXTDRTJ.js → chunk-ZXXAMM3K.js} +2 -2
  56. package/{chunk-MAFUFDFV.js → chunk-ZZYNGFTB.js} +81 -48
  57. package/{createAgentAutomationAction-GU766YRL.js → createAgentAutomationAction-PIKVVL2R.js} +8 -8
  58. package/{createDialogAction-ADMDJITX.js → createDialogAction-DQCM7HHO.js} +9 -9
  59. package/{createPageAction-N7EZJVO5.js → createPageAction-W2DRG2J7.js} +8 -8
  60. package/{dbSlice-5BKDURDL.js → dbSlice-GOKRGQ47.js} +2 -2
  61. package/{dialogCommands-O4CJJRTQ.js → dialogCommands-N4XKI6ZU.js} +13 -13
  62. package/{dialogSlice-JB5YIV5K.js → dialogSlice-DZUQZISK.js} +8 -8
  63. package/{docCreateCommands-2U5AIF3O.js → docCreateCommands-DTDKANXX.js} +12 -12
  64. package/{docDeleteCommands-EDCAUQEF.js → docDeleteCommands-U4NB6OHK.js} +13 -13
  65. package/{docReadCommands-KFMBFGPY.js → docReadCommands-SDVQM3BH.js} +12 -12
  66. package/{docStore-EXPYXKAO.js → docStore-NXDBQRDQ.js} +9 -9
  67. package/{docUpdateCommands-57M4XOT7.js → docUpdateCommands-O2O644FV.js} +12 -12
  68. package/{handleSendMessageAction-5E3MBI4X.js → handleSendMessageAction-3MMYF664.js} +8 -8
  69. package/index.js +46 -46
  70. package/{machineCommands-UPDXXKGX.js → machineCommands-QFDT6G2Q.js} +26 -26
  71. package/{machineWsRunDispatch-M43IR6SD.js → machineWsRunDispatch-J6IBIDYG.js} +26 -26
  72. package/package.json +1 -1
  73. package/{read-F3L3T2WJ.js → read-A23NKT3O.js} +1 -1
  74. package/{readDocTool-FOHWVA4R.js → readDocTool-JAM5BI5Q.js} +1 -1
  75. package/{readlineWorkspace-NEADCABU.js → readlineWorkspace-FU7PWLJU.js} +52 -55
  76. package/{removeDialogAgentAction-QCFGIUIH.js → removeDialogAgentAction-K4HOWFHO.js} +4 -4
  77. package/{runAgentClientLoop-NYY3IGNZ.js → runAgentClientLoop-P6J4YSE4.js} +19 -19
  78. package/{setDialogExtraReferencesAction-DK4CKERU.js → setDialogExtraReferencesAction-JD7J7JM4.js} +3 -3
  79. package/{setPrimaryDialogAgentAction-SJSO6N27.js → setPrimaryDialogAgentAction-YWSA5XEU.js} +4 -4
  80. package/{settingSlice-XNM5AFPU.js → settingSlice-22GTX6CA.js} +3 -3
  81. package/{skillDiscovery-KJWT7JBU.js → skillDiscovery-ITA7BI7A.js} +4 -2
  82. package/{spaceCommands-XK46FRYG.js → spaceCommands-WM6W3WMQ.js} +12 -12
  83. package/{spaceSlice-S6HBDF4N.js → spaceSlice-SVEWO5JX.js} +8 -8
  84. package/{streamAgentChatTurn-2NP4RW7O.js → streamAgentChatTurn-XJRY424B.js} +79 -35
  85. package/{switchDialogAgentAction-4OAC6QRN.js → switchDialogAgentAction-6JKFBJVR.js} +2 -2
  86. package/{tools-2HPUZOTG.js → tools-ZN6GWGYP.js} +15 -15
  87. package/{updateDialogTitleAction-27EH4CEC.js → updateDialogTitleAction-ZJ2HF5AQ.js} +8 -8
  88. package/chunk-UTYJ47H2.js +0 -51
  89. package/chunk-ZJ7WLPDP.js +0 -553
  90. package/{chunk-ATWUOTJP.js → chunk-NWT2WUCY.js} +1 -1
@@ -7,7 +7,7 @@ import {
7
7
  listUserRecordsFromServers,
8
8
  readDbRecordFromServers,
9
9
  readLiveDbRecordAfterTombstoneMerge
10
- } from "./chunk-KXEWHQAW.js";
10
+ } from "./chunk-MHHYH3JA.js";
11
11
  import {
12
12
  buildDialogAttachmentPlan,
13
13
  extractFileContentIds
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readDbRecord,
3
3
  writeAgentRecord
4
- } from "./chunk-ZNFZGHKL.js";
4
+ } from "./chunk-I5TJCJQP.js";
5
5
  import {
6
6
  buildSkillSummaryMarker
7
7
  } from "./chunk-VF4K2QE6.js";
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-A7GB5UGH.js";
14
14
  import {
15
15
  createSpaceKey
16
- } from "./chunk-OXLLFZNF.js";
16
+ } from "./chunk-DBUNOYLF.js";
17
17
  import {
18
18
  asTrimmedLowercaseString
19
19
  } from "./chunk-QSJ3HFEF.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  selectCurrentServer,
3
3
  selectRemoteServers
4
- } from "./chunk-S6KVFOUG.js";
4
+ } from "./chunk-ENUJPSZN.js";
5
5
  import {
6
6
  createUserKey,
7
7
  extractAgentInfo,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-WZSRQNQG.js";
4
4
  import {
5
5
  buildSkillDiscoveryLayer
6
- } from "./chunk-AL2V7U3E.js";
6
+ } from "./chunk-PJY5AH5A.js";
7
7
 
8
8
  // packages/agent-runtime/skillDiscovery.ts
9
9
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
@@ -85,19 +85,21 @@ function resolveSkillByName(cwd, name) {
85
85
  }
86
86
  return null;
87
87
  }
88
- function buildSkillDiscoveryContextBlock(cwd) {
88
+ function buildSkillDiscoveryContextLayer(cwd) {
89
89
  try {
90
- const discovered = discoverSkills(cwd);
91
- const layer = buildSkillDiscoveryLayer(discovered, cwd);
92
- return layer?.content ?? null;
90
+ return buildSkillDiscoveryLayer(discoverSkills(cwd), cwd);
93
91
  } catch {
94
92
  return null;
95
93
  }
96
94
  }
95
+ function buildSkillDiscoveryContextBlock(cwd) {
96
+ return buildSkillDiscoveryContextLayer(cwd)?.content ?? null;
97
+ }
97
98
 
98
99
  export {
99
100
  parseSkillFrontmatter,
100
101
  discoverSkills,
101
102
  resolveSkillByName,
103
+ buildSkillDiscoveryContextLayer,
102
104
  buildSkillDiscoveryContextBlock
103
105
  };
@@ -3,7 +3,7 @@ import {
3
3
  prepareAndPersistMessage,
4
4
  uiAskChoiceFunc,
5
5
  uiAskChoiceFunctionSchema
6
- } from "./chunk-4OHJCHIL.js";
6
+ } from "./chunk-VEHCU5XV.js";
7
7
  import {
8
8
  require_date_fns
9
9
  } from "./chunk-M76ECQRD.js";
@@ -24,7 +24,7 @@ import {
24
24
  removeCachedEntity,
25
25
  upsertSSREntity,
26
26
  write
27
- } from "./chunk-FON47ACC.js";
27
+ } from "./chunk-JYSXE6LE.js";
28
28
  import {
29
29
  createAgentKey,
30
30
  createDialogKey,
@@ -19,7 +19,7 @@ import {
19
19
  parseAgentRunEvent,
20
20
  t,
21
21
  toolLabel
22
- } from "./chunk-C4KV25UH.js";
22
+ } from "./chunk-KJJ6EWVW.js";
23
23
  import {
24
24
  getReadableCliDb
25
25
  } from "./chunk-WFHXMLHZ.js";
@@ -27,7 +27,7 @@ import {
27
27
  normalizeAgentHandle,
28
28
  readDbRecord,
29
29
  resolveAgentRecordFromHybridStore
30
- } from "./chunk-ZNFZGHKL.js";
30
+ } from "./chunk-I5TJCJQP.js";
31
31
  import {
32
32
  NOLO_PROJECT_MANAGER_AGENT_KEY,
33
33
  isLocalCliAgentKey
@@ -38,7 +38,7 @@ import {
38
38
  } from "./chunk-LTRXGFMS.js";
39
39
  import {
40
40
  formatAgentListCard
41
- } from "./chunk-AYQYOZYH.js";
41
+ } from "./chunk-VNMOLPVO.js";
42
42
  import {
43
43
  isGatewayHttpStatus
44
44
  } from "./chunk-RQSOAMPJ.js";
@@ -50,15 +50,15 @@ import {
50
50
  chooseMemoryOwners,
51
51
  loadMemoryCandidatesFromDb,
52
52
  resolveAgentMemoryPolicy
53
- } from "./chunk-4RXTDRTJ.js";
53
+ } from "./chunk-ZXXAMM3K.js";
54
54
  import {
55
55
  API_REPORTED_COST_MULTIPLIER,
56
56
  normalizeUsage,
57
57
  parseUiAskChoiceContent
58
- } from "./chunk-4OHJCHIL.js";
58
+ } from "./chunk-VEHCU5XV.js";
59
59
  import {
60
- buildSkillDiscoveryContextBlock
61
- } from "./chunk-7OBMZCRD.js";
60
+ buildSkillDiscoveryContextLayer
61
+ } from "./chunk-ZVZMT3EA.js";
62
62
  import {
63
63
  parseExternalSkillMarkdown,
64
64
  parseSkillDocProtocol
@@ -71,7 +71,7 @@ import {
71
71
  LOCAL_TURN_ABORTED_CODE,
72
72
  readActionGate,
73
73
  readCommandActionGatePayload
74
- } from "./chunk-YZV4676I.js";
74
+ } from "./chunk-P6TB7JIA.js";
75
75
  import {
76
76
  createThinkParserState,
77
77
  flushThinkParser,
@@ -83,7 +83,7 @@ import {
83
83
  import {
84
84
  DEFAULT_CONTEXT_WINDOW,
85
85
  getModelContextWindow
86
- } from "./chunk-JQ3LNEMS.js";
86
+ } from "./chunk-PMSG3OGF.js";
87
87
  import {
88
88
  clipCompactText
89
89
  } from "./chunk-5MMAK75Q.js";
@@ -91,9 +91,12 @@ import {
91
91
  findModelConfig
92
92
  } from "./chunk-GT3GG2H7.js";
93
93
  import {
94
+ buildAgentsMdLayer,
94
95
  buildMemoryOverlayLayer,
95
- buildMemoryUseGuidanceLayer
96
- } from "./chunk-AL2V7U3E.js";
96
+ buildMemoryUseGuidanceLayer,
97
+ partitionScopedBlocks,
98
+ renderTurnContextBlocksWithScope
99
+ } from "./chunk-PJY5AH5A.js";
97
100
  import {
98
101
  compactWhitespace
99
102
  } from "./chunk-DWLEOOGR.js";
@@ -138,7 +141,7 @@ import {
138
141
  BUILTIN_NOLO_AGENT_KEY,
139
142
  PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
140
143
  PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
141
- } from "./chunk-ATWUOTJP.js";
144
+ } from "./chunk-NWT2WUCY.js";
142
145
  import {
143
146
  asTrimmedString
144
147
  } from "./chunk-3EUW3WEO.js";
@@ -3480,7 +3483,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
3480
3483
  // packages/cli/client/agentRun.ts
3481
3484
  import { ulid } from "ulid";
3482
3485
  async function loadRunLocalAgentTurn() {
3483
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-552R4CZA.js");
3486
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-VI3NHLDU.js");
3484
3487
  return runLocalAgentTurn;
3485
3488
  }
3486
3489
  async function resolveCurrentMachineId(options) {
@@ -3647,16 +3650,28 @@ function isMissingLocalAgentConfigError(error, agentRef) {
3647
3650
  error && typeof error === "object" && "code" in error && error.code === LOCAL_AGENT_CONFIG_MISSING_CODE && error.agentRef === agentRef
3648
3651
  );
3649
3652
  }
3650
- var PLATFORM_PROVIDER_FAILED_RE = /platform provider failed:\s*HTTP\s+(\d+)\b/i;
3653
+ var PROVIDER_HTTP_FAILED_RE = /(.+?) provider failed:\s*HTTP\s+(\d+)\b/i;
3654
+ var PLATFORM_TRANSPORT_RE = /\bplatform provider failed\b/i;
3651
3655
  function classifyLocalRunError(message) {
3652
- const m = message.match(PLATFORM_PROVIDER_FAILED_RE);
3656
+ const m = message.match(PROVIDER_HTTP_FAILED_RE);
3653
3657
  if (!m) return { kind: "generic" };
3654
- const status = Number(m[1]);
3658
+ const status = Number(m[2]);
3659
+ const transport = PLATFORM_TRANSPORT_RE.test(message) ? "platform" : "local";
3660
+ if (status === 401 || status === 403) {
3661
+ return { kind: "auth", transport, status };
3662
+ }
3663
+ if (status === 400 || status === 422) {
3664
+ return { kind: "rejected-payload", transport, status };
3665
+ }
3666
+ if (status === 429) {
3667
+ return { kind: "rate-limit", transport, status };
3668
+ }
3655
3669
  if (status >= 500 && status <= 599) {
3656
- return { kind: "platform-proxy-transient", status };
3670
+ return { kind: "transient", transport, status };
3657
3671
  }
3658
- return { kind: "platform-proxy-upstream", status };
3672
+ return { kind: "upstream", transport, status };
3659
3673
  }
3674
+ var HISTORY_REPLAY_REJECTION_RE = /invalid_request_error|invalid\s+tool\s+call\s+arguments?/i;
3660
3675
  function describeLocalRunFailure(message) {
3661
3676
  if (/UPSTREAM_402|Insufficient Balance|余额不足|insufficient\s+balance/i.test(
3662
3677
  message
@@ -3665,16 +3680,36 @@ function describeLocalRunFailure(message) {
3665
3680
  `;
3666
3681
  }
3667
3682
  const cls = classifyLocalRunError(message);
3668
- if (cls.kind === "platform-proxy-transient") {
3669
- return `[nolo] auto runtime: local run unavailable (server chat proxy returned HTTP ${cls.status}; this is an upstream/gateway issue, not your local credential or config).${message ? ` Detail: ${message}` : ""} Not falling back to server. Retry shortly, or use --server to run on the server explicitly.
3683
+ if (cls.kind === "generic") {
3684
+ return `[nolo] auto runtime: local run unavailable (${message}). Not falling back to server. Fix the local credential/config and retry, or use --server to run on the server explicitly.
3670
3685
  `;
3671
3686
  }
3672
- if (cls.kind === "platform-proxy-upstream") {
3673
- return `[nolo] auto runtime: local run unavailable (server chat proxy returned HTTP ${cls.status}).${message ? ` Detail: ${message}` : ""} Not falling back to server. Check the agent's provider/api-key settings on nolo.chat, or use --server to run on the server explicitly.
3687
+ const where = cls.transport === "platform" ? "server chat proxy" : "local provider";
3688
+ const detail = message ? ` Detail: ${message}` : "";
3689
+ switch (cls.kind) {
3690
+ case "auth":
3691
+ return cls.transport === "platform" ? `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}, auth rejected).${detail} Not falling back to server. Check the agent's provider/api-key settings on nolo.chat, or use --server to run on the server explicitly.
3692
+ ` : `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}, auth rejected).${detail} Not falling back to server. Fix the local credential/config and retry, or use --server to run on the server explicitly.
3674
3693
  `;
3675
- }
3676
- return `[nolo] auto runtime: local run unavailable (${message}). Not falling back to server. Fix the local credential/config and retry, or use --server to run on the server explicitly.
3694
+ case "rejected-payload": {
3695
+ const looksLikeHistoryReplay = HISTORY_REPLAY_REJECTION_RE.test(message);
3696
+ const cause = looksLikeHistoryReplay ? ` This usually happens when the dialog history contains tool_calls or reasoning produced by a different model/provider (e.g. after /switch); the new provider rejects that history. Start a fresh dialog, or clean the offending history.` : "";
3697
+ return `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}, the provider rejected the request body \u2014 this is NOT a local credential/config issue).${detail}${cause} Not falling back to server. Use --server to run on the server explicitly, or start a fresh dialog.
3698
+ `;
3699
+ }
3700
+ case "rate-limit":
3701
+ return `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}, rate limited).${detail} Not falling back to server. Retry shortly, or use --server to run on the server explicitly.
3677
3702
  `;
3703
+ case "transient":
3704
+ return `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}; this is an upstream/gateway issue, not your local credential or config).${detail} Not falling back to server. Retry shortly, or use --server to run on the server explicitly.
3705
+ `;
3706
+ case "upstream":
3707
+ default: {
3708
+ return cls.transport === "platform" ? `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}).${detail} Not falling back to server. Check the agent's provider/api-key settings on nolo.chat, or use --server to run on the server explicitly.
3709
+ ` : `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}).${detail} Not falling back to server. Check the agent's endpoint/model settings, or use --server to run on the server explicitly.
3710
+ `;
3711
+ }
3712
+ }
3678
3713
  }
3679
3714
  function shouldAttemptAutoLocal(options) {
3680
3715
  if (options.localRuntimeAdapter || options.localRuntimeAdapterFactory)
@@ -3966,6 +4001,12 @@ async function runLocalAgentTurnForCli(options, settings) {
3966
4001
  "[nolo] \u5F53\u524D agent \u4E0D\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C\u5DF2\u7528\u5360\u4F4D\u6587\u672C\u66FF\u4EE3\u3002\u8981\u5B8C\u6574\u56FE\u7247\u7406\u89E3\u53EF /switch \u5230 Kimi K2.6\u3002\n"
3967
4002
  );
3968
4003
  }
4004
+ if (event.kind === "image-preprocessed") {
4005
+ options.output.write(
4006
+ `[nolo] \u5DF2\u7528\u89C6\u89C9\u6A21\u578B\u89E3\u6790 ${event.imageCount} \u5F20\u56FE\u7247\u4E3A\u6587\u5B57\u63CF\u8FF0\uFF0C\u4F9B\u5F53\u524D agent \u4F7F\u7528\u3002
4007
+ `
4008
+ );
4009
+ }
3969
4010
  options.onLoopEvent?.(event);
3970
4011
  },
3971
4012
  ...options.abortSignal ? { abortSignal: options.abortSignal } : {},
@@ -4966,6 +5007,8 @@ async function runAgentRunCommand(args, deps) {
4966
5007
  }
4967
5008
  const cliCwd = parsed.cwd ?? process.cwd();
4968
5009
  const isSubtask = isSubtaskRun(env);
5010
+ const scopedLayers = [];
5011
+ const skillContentBlocks = [];
4969
5012
  const extraContextBlocks = [];
4970
5013
  const contextBlockScopes = [];
4971
5014
  let memoryPromptBlock = null;
@@ -4982,18 +5025,14 @@ async function runAgentRunCommand(args, deps) {
4982
5025
  if (Buffer.byteLength(mdContent, "utf8") > AGENTS_MD_MAX) {
4983
5026
  mdContent = Buffer.from(mdContent, "utf8").subarray(0, AGENTS_MD_MAX).toString("utf8") + "\n\n<!-- AGENTS.md truncated -->";
4984
5027
  }
4985
- extraContextBlocks.push(`--- \u9879\u76EE\u6307\u4EE4\uFF08${name}\uFF09---
4986
- ${mdContent}`);
5028
+ scopedLayers.push(buildAgentsMdLayer(mdContent, name));
4987
5029
  break;
4988
5030
  } catch {
4989
5031
  }
4990
5032
  }
4991
5033
  }
4992
- extraContextBlocks.push(...buildSkillContextBlocks(skillReferences));
4993
- const skillDiscoveryBlock = buildSkillDiscoveryContextBlock(cliCwd);
4994
- if (skillDiscoveryBlock) {
4995
- extraContextBlocks.push(skillDiscoveryBlock);
4996
- }
5034
+ skillContentBlocks.push(...buildSkillContextBlocks(skillReferences));
5035
+ scopedLayers.push(buildSkillDiscoveryContextLayer(cliCwd));
4997
5036
  if (!deps.memoryRecallDisabled) {
4998
5037
  const memoryServerUrl = resolveServerUrl(env);
4999
5038
  const memoryAuthToken = resolveAuthToken(args, env);
@@ -5041,23 +5080,17 @@ ${mdContent}`);
5041
5080
  }
5042
5081
  memoryOverlayLayer = buildMemoryOverlayLayer({ promptBlock: memoryPromptBlock });
5043
5082
  memoryUseGuidanceLayer = buildMemoryUseGuidanceLayer({ promptBlock: memoryPromptBlock });
5044
- const agentsMdMarker = "--- \u9879\u76EE\u6307\u4EE4\uFF08";
5045
- for (const block of extraContextBlocks) {
5046
- if (block.startsWith(agentsMdMarker)) {
5047
- contextBlockScopes.push({ content: block, cacheScope: "session" });
5048
- }
5049
- }
5050
- if (memoryUseGuidanceLayer?.content?.trim()) {
5051
- contextBlockScopes.push({ content: memoryUseGuidanceLayer.content, cacheScope: "session" });
5052
- }
5053
- for (const block of extraContextBlocks) {
5054
- if (!block.startsWith(agentsMdMarker)) {
5055
- contextBlockScopes.push({ content: block, cacheScope: "turn" });
5056
- }
5057
- }
5058
- if (memoryOverlayLayer?.content?.trim()) {
5059
- contextBlockScopes.push({ content: memoryOverlayLayer.content, cacheScope: "turn" });
5060
- }
5083
+ contextBlockScopes.push(
5084
+ ...partitionScopedBlocks([
5085
+ ...renderTurnContextBlocksWithScope([
5086
+ ...scopedLayers,
5087
+ memoryUseGuidanceLayer
5088
+ ]),
5089
+ ...skillContentBlocks.map((content) => content.trim()).filter((content) => content.length > 0).map((content) => ({ content, cacheScope: "turn" })),
5090
+ ...renderTurnContextBlocksWithScope([memoryOverlayLayer])
5091
+ ])
5092
+ );
5093
+ extraContextBlocks.push(...contextBlockScopes.map((block) => block.content));
5061
5094
  }
5062
5095
  const buildRunOptions = (targetAgentKey) => ({
5063
5096
  agentName: targetAgentKey,
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-4OHJCHIL.js";
3
+ } from "./chunk-VEHCU5XV.js";
4
4
  import "./chunk-XOIF2TNF.js";
5
5
  import "./chunk-MRC4Q34M.js";
6
6
  import "./chunk-SIZQB7BD.js";
7
- import "./chunk-7ORW7XI4.js";
7
+ import "./chunk-SIZWJA7H.js";
8
8
  import "./chunk-YYLHWIW6.js";
9
9
  import "./chunk-CWMSB67P.js";
10
- import "./chunk-ROJI6DRT.js";
10
+ import "./chunk-INWBJPQC.js";
11
11
  import "./chunk-5RGU3J7P.js";
12
12
  import "./chunk-M76ECQRD.js";
13
13
  import "./chunk-L65QKSVJ.js";
14
- import "./chunk-JQ3LNEMS.js";
14
+ import "./chunk-PMSG3OGF.js";
15
15
  import "./chunk-5MMAK75Q.js";
16
16
  import "./chunk-5CS33IBL.js";
17
17
  import "./chunk-JZPBVBIY.js";
@@ -22,14 +22,14 @@ import "./chunk-DWLEOOGR.js";
22
22
  import "./chunk-HNMXYYJR.js";
23
23
  import "./chunk-L3QFIBZG.js";
24
24
  import "./chunk-YTA2QOEE.js";
25
- import "./chunk-S6KVFOUG.js";
25
+ import "./chunk-ENUJPSZN.js";
26
26
  import "./chunk-Y5GCAMGP.js";
27
27
  import "./chunk-UZ6XXCVR.js";
28
28
  import "./chunk-KX6YBIHG.js";
29
- import "./chunk-OXLLFZNF.js";
29
+ import "./chunk-DBUNOYLF.js";
30
30
  import {
31
31
  write
32
- } from "./chunk-FON47ACC.js";
32
+ } from "./chunk-JYSXE6LE.js";
33
33
  import {
34
34
  buildAgentAutomationOwnerIndexValue,
35
35
  createAgentAutomationKey,
@@ -39,7 +39,7 @@ import "./chunk-WWC7I6TA.js";
39
39
  import "./chunk-SKDNBYZK.js";
40
40
  import "./chunk-I42VC5KR.js";
41
41
  import "./chunk-QSJ3HFEF.js";
42
- import "./chunk-ATWUOTJP.js";
42
+ import "./chunk-NWT2WUCY.js";
43
43
  import {
44
44
  selectIdentityUserId
45
45
  } from "./chunk-XMLRJUU5.js";
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  createDialogAction,
3
3
  isLocalOwnerDialogAgents
4
- } from "./chunk-4RXTDRTJ.js";
5
- import "./chunk-4OHJCHIL.js";
4
+ } from "./chunk-ZXXAMM3K.js";
5
+ import "./chunk-VEHCU5XV.js";
6
6
  import "./chunk-XOIF2TNF.js";
7
7
  import "./chunk-MRC4Q34M.js";
8
8
  import "./chunk-SIZQB7BD.js";
9
- import "./chunk-7ORW7XI4.js";
9
+ import "./chunk-SIZWJA7H.js";
10
10
  import "./chunk-YYLHWIW6.js";
11
11
  import "./chunk-CWMSB67P.js";
12
- import "./chunk-ROJI6DRT.js";
12
+ import "./chunk-INWBJPQC.js";
13
13
  import "./chunk-5RGU3J7P.js";
14
14
  import "./chunk-M76ECQRD.js";
15
15
  import "./chunk-L65QKSVJ.js";
16
16
  import "./chunk-CF7S2RYZ.js";
17
17
  import "./chunk-ZWJOGMKH.js";
18
18
  import "./chunk-WZSRQNQG.js";
19
- import "./chunk-JQ3LNEMS.js";
19
+ import "./chunk-PMSG3OGF.js";
20
20
  import "./chunk-5MMAK75Q.js";
21
21
  import "./chunk-5CS33IBL.js";
22
22
  import "./chunk-JZPBVBIY.js";
@@ -27,18 +27,18 @@ import "./chunk-DWLEOOGR.js";
27
27
  import "./chunk-HNMXYYJR.js";
28
28
  import "./chunk-L3QFIBZG.js";
29
29
  import "./chunk-YTA2QOEE.js";
30
- import "./chunk-S6KVFOUG.js";
30
+ import "./chunk-ENUJPSZN.js";
31
31
  import "./chunk-Y5GCAMGP.js";
32
32
  import "./chunk-UZ6XXCVR.js";
33
33
  import "./chunk-KX6YBIHG.js";
34
- import "./chunk-OXLLFZNF.js";
35
- import "./chunk-FON47ACC.js";
34
+ import "./chunk-DBUNOYLF.js";
35
+ import "./chunk-JYSXE6LE.js";
36
36
  import "./chunk-NRY4GCKJ.js";
37
37
  import "./chunk-WWC7I6TA.js";
38
38
  import "./chunk-SKDNBYZK.js";
39
39
  import "./chunk-I42VC5KR.js";
40
40
  import "./chunk-QSJ3HFEF.js";
41
- import "./chunk-ATWUOTJP.js";
41
+ import "./chunk-NWT2WUCY.js";
42
42
  import "./chunk-XMLRJUU5.js";
43
43
  import "./chunk-R5V5G73M.js";
44
44
  import "./chunk-GBRG75BQ.js";
@@ -15,14 +15,14 @@ import {
15
15
  addContentToSpace,
16
16
  client_default,
17
17
  selectCurrentSpaceId
18
- } from "./chunk-4OHJCHIL.js";
18
+ } from "./chunk-VEHCU5XV.js";
19
19
  import "./chunk-XOIF2TNF.js";
20
20
  import "./chunk-MRC4Q34M.js";
21
21
  import "./chunk-SIZQB7BD.js";
22
- import "./chunk-7ORW7XI4.js";
22
+ import "./chunk-SIZWJA7H.js";
23
23
  import "./chunk-YYLHWIW6.js";
24
24
  import "./chunk-CWMSB67P.js";
25
- import "./chunk-ROJI6DRT.js";
25
+ import "./chunk-INWBJPQC.js";
26
26
  import "./chunk-5RGU3J7P.js";
27
27
  import "./chunk-M76ECQRD.js";
28
28
  import "./chunk-L65QKSVJ.js";
@@ -30,7 +30,7 @@ import {
30
30
  parseSkillDocProtocol
31
31
  } from "./chunk-ZWJOGMKH.js";
32
32
  import "./chunk-WZSRQNQG.js";
33
- import "./chunk-JQ3LNEMS.js";
33
+ import "./chunk-PMSG3OGF.js";
34
34
  import "./chunk-5MMAK75Q.js";
35
35
  import "./chunk-5CS33IBL.js";
36
36
  import "./chunk-JZPBVBIY.js";
@@ -41,14 +41,14 @@ import "./chunk-DWLEOOGR.js";
41
41
  import "./chunk-HNMXYYJR.js";
42
42
  import "./chunk-L3QFIBZG.js";
43
43
  import "./chunk-YTA2QOEE.js";
44
- import "./chunk-S6KVFOUG.js";
44
+ import "./chunk-ENUJPSZN.js";
45
45
  import "./chunk-Y5GCAMGP.js";
46
46
  import "./chunk-UZ6XXCVR.js";
47
47
  import "./chunk-KX6YBIHG.js";
48
- import "./chunk-OXLLFZNF.js";
48
+ import "./chunk-DBUNOYLF.js";
49
49
  import {
50
50
  write
51
- } from "./chunk-FON47ACC.js";
51
+ } from "./chunk-JYSXE6LE.js";
52
52
  import {
53
53
  createPageKey
54
54
  } from "./chunk-NRY4GCKJ.js";
@@ -56,7 +56,7 @@ import "./chunk-WWC7I6TA.js";
56
56
  import "./chunk-SKDNBYZK.js";
57
57
  import "./chunk-I42VC5KR.js";
58
58
  import "./chunk-QSJ3HFEF.js";
59
- import "./chunk-ATWUOTJP.js";
59
+ import "./chunk-NWT2WUCY.js";
60
60
  import {
61
61
  selectIdentityUserId
62
62
  } from "./chunk-XMLRJUU5.js";
@@ -18,13 +18,13 @@ import {
18
18
  upsert,
19
19
  upsertSSREntity,
20
20
  write
21
- } from "./chunk-FON47ACC.js";
21
+ } from "./chunk-JYSXE6LE.js";
22
22
  import "./chunk-NRY4GCKJ.js";
23
23
  import "./chunk-WWC7I6TA.js";
24
24
  import "./chunk-SKDNBYZK.js";
25
25
  import "./chunk-I42VC5KR.js";
26
26
  import "./chunk-QSJ3HFEF.js";
27
- import "./chunk-ATWUOTJP.js";
27
+ import "./chunk-NWT2WUCY.js";
28
28
  import "./chunk-XMLRJUU5.js";
29
29
  import "./chunk-R5V5G73M.js";
30
30
  import "./chunk-GBRG75BQ.js";
@@ -8,32 +8,32 @@ import {
8
8
  runDialogReadCommand,
9
9
  runDialogStatusCommand,
10
10
  sortDialogs
11
- } from "./chunk-PVWFM7JP.js";
11
+ } from "./chunk-XISENOC2.js";
12
12
  import "./chunk-ID4G2MAR.js";
13
- import "./chunk-KXEWHQAW.js";
14
- import "./chunk-ZNFZGHKL.js";
15
- import "./chunk-7WMLPRXP.js";
13
+ import "./chunk-MHHYH3JA.js";
14
+ import "./chunk-I5TJCJQP.js";
15
+ import "./chunk-STOUEEBU.js";
16
16
  import "./chunk-VHBWHNVT.js";
17
17
  import "./chunk-KQHGZWSV.js";
18
18
  import "./chunk-SIZQB7BD.js";
19
- import "./chunk-TTPVLL5F.js";
19
+ import "./chunk-33K2M3AU.js";
20
20
  import "./chunk-ZNFJWEN4.js";
21
21
  import "./chunk-HALKDXKP.js";
22
22
  import "./chunk-OIQPORYI.js";
23
- import "./chunk-YZV4676I.js";
23
+ import "./chunk-P6TB7JIA.js";
24
24
  import "./chunk-N7J63Q6C.js";
25
- import "./chunk-ZJ7WLPDP.js";
25
+ import "./chunk-PSK2RUHV.js";
26
26
  import "./chunk-D34RI6NI.js";
27
27
  import "./chunk-XS7UPVR7.js";
28
- import "./chunk-WCP5FDTF.js";
28
+ import "./chunk-PFTK5SEB.js";
29
29
  import "./chunk-2MBTWINN.js";
30
- import "./chunk-JQ3LNEMS.js";
30
+ import "./chunk-PMSG3OGF.js";
31
31
  import "./chunk-5MMAK75Q.js";
32
32
  import "./chunk-5CS33IBL.js";
33
33
  import "./chunk-JZPBVBIY.js";
34
34
  import "./chunk-GT3GG2H7.js";
35
35
  import "./chunk-ZHXJ6M7T.js";
36
- import "./chunk-AL2V7U3E.js";
36
+ import "./chunk-PJY5AH5A.js";
37
37
  import "./chunk-4PWB7JRR.js";
38
38
  import "./chunk-ZZ2MH7LE.js";
39
39
  import "./chunk-DWLEOOGR.js";
@@ -45,14 +45,14 @@ import "./chunk-L3QFIBZG.js";
45
45
  import "./chunk-YTA2QOEE.js";
46
46
  import "./chunk-Y5GCAMGP.js";
47
47
  import "./chunk-KX6YBIHG.js";
48
- import "./chunk-OXLLFZNF.js";
49
- import "./chunk-FON47ACC.js";
48
+ import "./chunk-DBUNOYLF.js";
49
+ import "./chunk-JYSXE6LE.js";
50
50
  import "./chunk-NRY4GCKJ.js";
51
51
  import "./chunk-WWC7I6TA.js";
52
52
  import "./chunk-SKDNBYZK.js";
53
53
  import "./chunk-I42VC5KR.js";
54
54
  import "./chunk-QSJ3HFEF.js";
55
- import "./chunk-ATWUOTJP.js";
55
+ import "./chunk-NWT2WUCY.js";
56
56
  import "./chunk-XMLRJUU5.js";
57
57
  import "./chunk-R5V5G73M.js";
58
58
  import "./chunk-GBRG75BQ.js";
@@ -20,20 +20,20 @@ import {
20
20
  switchDialogAgent,
21
21
  updateDialogTitle,
22
22
  updateTokens
23
- } from "./chunk-4OHJCHIL.js";
23
+ } from "./chunk-VEHCU5XV.js";
24
24
  import "./chunk-XOIF2TNF.js";
25
25
  import "./chunk-MRC4Q34M.js";
26
26
  import "./chunk-SIZQB7BD.js";
27
- import "./chunk-7ORW7XI4.js";
27
+ import "./chunk-SIZWJA7H.js";
28
28
  import "./chunk-YYLHWIW6.js";
29
29
  import "./chunk-CWMSB67P.js";
30
- import "./chunk-ROJI6DRT.js";
30
+ import "./chunk-INWBJPQC.js";
31
31
  import {
32
32
  getActiveDialogAgentId
33
33
  } from "./chunk-5RGU3J7P.js";
34
34
  import "./chunk-M76ECQRD.js";
35
35
  import "./chunk-L65QKSVJ.js";
36
- import "./chunk-JQ3LNEMS.js";
36
+ import "./chunk-PMSG3OGF.js";
37
37
  import "./chunk-5MMAK75Q.js";
38
38
  import "./chunk-5CS33IBL.js";
39
39
  import "./chunk-JZPBVBIY.js";
@@ -75,18 +75,18 @@ import "./chunk-DWLEOOGR.js";
75
75
  import "./chunk-HNMXYYJR.js";
76
76
  import "./chunk-L3QFIBZG.js";
77
77
  import "./chunk-YTA2QOEE.js";
78
- import "./chunk-S6KVFOUG.js";
78
+ import "./chunk-ENUJPSZN.js";
79
79
  import "./chunk-Y5GCAMGP.js";
80
80
  import "./chunk-UZ6XXCVR.js";
81
81
  import "./chunk-KX6YBIHG.js";
82
- import "./chunk-OXLLFZNF.js";
83
- import "./chunk-FON47ACC.js";
82
+ import "./chunk-DBUNOYLF.js";
83
+ import "./chunk-JYSXE6LE.js";
84
84
  import "./chunk-NRY4GCKJ.js";
85
85
  import "./chunk-WWC7I6TA.js";
86
86
  import "./chunk-SKDNBYZK.js";
87
87
  import "./chunk-I42VC5KR.js";
88
88
  import "./chunk-QSJ3HFEF.js";
89
- import "./chunk-ATWUOTJP.js";
89
+ import "./chunk-NWT2WUCY.js";
90
90
  import "./chunk-XMLRJUU5.js";
91
91
  import "./chunk-R5V5G73M.js";
92
92
  import "./chunk-GBRG75BQ.js";