nolo-cli 0.228.0-alpha.1 → 0.228.0-alpha.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/{_executeModel-WZKT6XEU.js → _executeModel-VYCHHZVT.js} +18 -16
  2. package/{agentDeleteCommand-PZWRHNXY.js → agentDeleteCommand-QWQKT54A.js} +24 -22
  3. package/{agentEmailCommands-QTKMEICX.js → agentEmailCommands-EISMBIRE.js} +24 -22
  4. package/{agentListCommands-GUGMORTK.js → agentListCommands-4WLG32IW.js} +23 -415
  5. package/{agentMachineCommands-7QGICJLM.js → agentMachineCommands-DC6NKWTU.js} +12 -11
  6. package/{agentRecordCommands-SLLADS5C.js → agentRecordCommands-IZYUVHME.js} +24 -22
  7. package/{agentRunCommand-OFQLOF5Y.js → agentRunCommand-QM7ETUTX.js} +25 -23
  8. package/{agentRuntimeLocal-TU4LA353.js → agentRuntimeLocal-HOXKWCYO.js} +9 -8
  9. package/{agentSlice-L4SBGWTB.js → agentSlice-UG76KEBH.js} +1 -1
  10. package/{appDeleteCommands-JWP3XPUA.js → appDeleteCommands-WWCC6WA5.js} +13 -12
  11. package/{appDeployCommands-6E4TQCWI.js → appDeployCommands-AU4IUN33.js} +13 -12
  12. package/{appDeployStatusCommands-ALU4SADG.js → appDeployStatusCommands-STUW7WXL.js} +13 -12
  13. package/{appGetCommands-JEY4L6L4.js → appGetCommands-BGTLIQ4K.js} +13 -12
  14. package/{appListCommands-PCAVHU7M.js → appListCommands-CUCPRUXW.js} +13 -12
  15. package/{authCommand-CGRIIOOV.js → authCommand-OZ2KTP4Z.js} +2 -2
  16. package/{chunk-JUSHVFNF.js → chunk-3QIYD3VM.js} +414 -342
  17. package/{chunk-H6L2NFHY.js → chunk-3VZLEKV2.js} +2 -2
  18. package/{chunk-3P54D2E4.js → chunk-42OKN2LI.js} +1 -1
  19. package/{chunk-EXJK7TQO.js → chunk-45CAVC35.js} +43 -288
  20. package/{chunk-SMJEXX2S.js → chunk-4QYJPWHH.js} +2 -2
  21. package/{chunk-Q3IVPFVO.js → chunk-5YMA6DDZ.js} +1 -1
  22. package/{chunk-R3NEQZ53.js → chunk-7BCG67EI.js} +8 -8
  23. package/{chunk-CYWNWA77.js → chunk-7FEP5USX.js} +6 -3
  24. package/{chunk-GACR7H6T.js → chunk-CNMY2XM6.js} +2 -2
  25. package/{chunk-STJ6LSQE.js → chunk-DLXMMTGM.js} +82 -21
  26. package/{chunk-MDZWUD3R.js → chunk-EGHP7KOY.js} +3 -3
  27. package/{chunk-AGYPUBFW.js → chunk-FPBJM2BW.js} +4 -1
  28. package/{chunk-IXG6YXQM.js → chunk-GAYNXB6T.js} +51 -40
  29. package/{chunk-XJPLSAPJ.js → chunk-HF7BLF3F.js} +2 -2
  30. package/{chunk-GYS5FUYR.js → chunk-HXB4VDGK.js} +1 -1
  31. package/{chunk-BNMPUQW6.js → chunk-JQZRSXS5.js} +23 -23
  32. package/{chunk-VSYTM22R.js → chunk-LYD6C7OU.js} +2 -2
  33. package/{chunk-QBZCGP34.js → chunk-M3OZRQNH.js} +1 -1
  34. package/{chunk-DDC6P6EH.js → chunk-MJI3UAXN.js} +34 -10
  35. package/{chunk-RYOLWYBK.js → chunk-MNEZUL5S.js} +16 -1
  36. package/{chunk-GOCSSER3.js → chunk-MZG5CETE.js} +2 -2
  37. package/{chunk-QCB42576.js → chunk-OJ45MEEI.js} +1 -1
  38. package/{chunk-UE2EVEYS.js → chunk-OTKSESZR.js} +2 -2
  39. package/{chunk-NHY322ZU.js → chunk-RRDRQOEC.js} +508 -2
  40. package/{chunk-2MCB7CD7.js → chunk-TCZ2VJZQ.js} +3 -3
  41. package/{chunk-D6YNCNM6.js → chunk-TQEKUOTI.js} +2 -2
  42. package/{chunk-2NPD3FTX.js → chunk-U2HBB7RS.js} +14 -14
  43. package/{chunk-AUAJTAFM.js → chunk-VQ5N5GSV.js} +1 -1
  44. package/{chunk-K67C2JUC.js → chunk-WCFFRBL5.js} +3 -3
  45. package/{chunk-GPOV42YM.js → chunk-WFDNADFX.js} +1 -1
  46. package/chunk-WFGNWWJI.js +326 -0
  47. package/{chunk-OYU2MA5S.js → chunk-X3E6EHJW.js} +9 -8
  48. package/{chunk-GUXZK7SE.js → chunk-XAG3FWBE.js} +11 -0
  49. package/{chunk-OG6MQOQG.js → chunk-XFXFPUO7.js} +2 -2
  50. package/{chunk-UWAIJOF2.js → chunk-XTJKU3Z4.js} +4 -4
  51. package/{chunk-IAAIUH64.js → chunk-YVFH2MFB.js} +3 -3
  52. package/{chunk-TGNIKIHR.js → chunk-ZEVQHCLM.js} +1 -1
  53. package/{cliLocalAgentRecordReader-M3F76NIP.js → cliLocalAgentRecordReader-H3HYQRRR.js} +11 -10
  54. package/{commandRegistry-ZLWHQVAI.js → commandRegistry-FVYPE2IN.js} +47 -47
  55. package/{contentThunks-4ZX2TO7C.js → contentThunks-GNFPG32S.js} +3 -3
  56. package/{createAgentAutomationAction-L4CYUZJG.js → createAgentAutomationAction-PB4QIFQ4.js} +3 -3
  57. package/{createDialogAction-QTU2R2Q3.js → createDialogAction-EVTOPY7A.js} +4 -4
  58. package/{createPageAction-F3GJTHW2.js → createPageAction-2UYF2IDZ.js} +4 -4
  59. package/{dialogCommands-NRLCOPJR.js → dialogCommands-6SZD4TYP.js} +13 -12
  60. package/{dialogSlice-P2S4LXQD.js → dialogSlice-5EQ2A6LY.js} +2 -2
  61. package/{docCreateCommands-YJRDA3RX.js → docCreateCommands-25E6PGN3.js} +12 -11
  62. package/{docDeleteCommands-A5QIHZNF.js → docDeleteCommands-F7ZVGEHW.js} +13 -12
  63. package/{docReadCommands-CF2LTMYH.js → docReadCommands-JY2E5XEN.js} +12 -11
  64. package/{docStore-6O7NYL6A.js → docStore-OKKIKLT3.js} +1 -1
  65. package/{docUpdateCommands-QRKV4ZXE.js → docUpdateCommands-OZ4CUSIQ.js} +12 -11
  66. package/{handleSendMessageAction-7IHLR37A.js → handleSendMessageAction-LNT7SZND.js} +12 -11
  67. package/{hostCredentialCreate-VNCQUAFT.js → hostCredentialCreate-XUU2CSHI.js} +24 -22
  68. package/index.js +3 -3
  69. package/{localRuntimeAdapter-FOWVNMIK.js → localRuntimeAdapter-IBSTMSX7.js} +23 -21
  70. package/{machineCommands-ZGC3J4JB.js → machineCommands-HSQHDHOT.js} +41 -24
  71. package/{machineWsRunDispatch-KK5U4M3G.js → machineWsRunDispatch-L6H7J66T.js} +24 -22
  72. package/package.json +1 -1
  73. package/{projectArchive-7ZDYBXAX.js → projectArchive-FQO654Z3.js} +4 -4
  74. package/{readlineWorkspace-YHT4SX2C.js → readlineWorkspace-7U272DSA.js} +36 -33
  75. package/{runAgentClientLoop-H4ED5V3K.js → runAgentClientLoop-AF4JQIJ7.js} +16 -14
  76. package/{skillDiscovery-I37M5KJC.js → skillDiscovery-BHHPCUHZ.js} +3 -3
  77. package/{spaceCommands-MEH3HJBC.js → spaceCommands-5VNWMDBE.js} +12 -11
  78. package/{streamAgentChatTurn-ZXPOXU33.js → streamAgentChatTurn-YSPEFY4K.js} +24 -21
  79. package/{tools-2MRWA2PP.js → tools-M35PTIFB.js} +11 -9
  80. package/{updateDialogTitleAction-RZ3KZSGQ.js → updateDialogTitleAction-IMIRJRQQ.js} +3 -3
  81. package/chunk-2WZXXAQD.js +0 -57
@@ -14,13 +14,13 @@ import {
14
14
  import {
15
15
  addContentToSpace,
16
16
  resolveCreationSpaceId
17
- } from "./chunk-GYS5FUYR.js";
17
+ } from "./chunk-HXB4VDGK.js";
18
18
  import {
19
19
  getCurrentSpaceId
20
20
  } from "./chunk-547ENH5T.js";
21
21
  import {
22
22
  runtime_default
23
- } from "./chunk-R3NEQZ53.js";
23
+ } from "./chunk-7BCG67EI.js";
24
24
  import {
25
25
  write
26
26
  } from "./chunk-CMMI3DAT.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MEMORY_USE_GUIDANCE,
3
3
  wrapHistoricalSummaryWithReplayGuard
4
- } from "./chunk-BNMPUQW6.js";
4
+ } from "./chunk-JQZRSXS5.js";
5
5
 
6
6
  // packages/agent-runtime/skillCatalog.ts
7
7
  var SKILL_CATALOG_PRIORITY = Object.freeze([
@@ -35,7 +35,7 @@ import {
35
35
  resolveServerUrl,
36
36
  validateInstaboxWorkspaceSelection,
37
37
  writeUsage
38
- } from "./chunk-STJ6LSQE.js";
38
+ } from "./chunk-DLXMMTGM.js";
39
39
  import {
40
40
  boxGlyphs,
41
41
  displayWidth,
@@ -82,11 +82,11 @@ import {
82
82
  } from "./chunk-BMQ2MJUK.js";
83
83
  import {
84
84
  resolveCliLocalRuntimeKeyCapability
85
- } from "./chunk-IXG6YXQM.js";
85
+ } from "./chunk-GAYNXB6T.js";
86
86
  import {
87
87
  parseUiCard,
88
88
  uiCardFallback
89
- } from "./chunk-XJPLSAPJ.js";
89
+ } from "./chunk-HF7BLF3F.js";
90
90
  import {
91
91
  isGatewayHttpStatus
92
92
  } from "./chunk-NF64D32W.js";
@@ -96,7 +96,7 @@ import {
96
96
  loadMemoryCandidatesFromDb,
97
97
  loadOwnerItemsFromDb,
98
98
  resolveAgentMemoryPolicy
99
- } from "./chunk-SMJEXX2S.js";
99
+ } from "./chunk-4QYJPWHH.js";
100
100
  import {
101
101
  API_REPORTED_COST_MULTIPLIER,
102
102
  estimateMessagesTokens,
@@ -106,14 +106,14 @@ import {
106
106
  resolveAgentContextWindow,
107
107
  resolveOccupancy,
108
108
  resolveOccupancyWindow
109
- } from "./chunk-R3NEQZ53.js";
109
+ } from "./chunk-7BCG67EI.js";
110
110
  import {
111
111
  parsePositiveFiniteNumberOrFallback
112
112
  } from "./chunk-Y5GCAMGP.js";
113
113
  import {
114
114
  readDbRecord,
115
115
  resolveAgentRecordFromHybridStore
116
- } from "./chunk-D6YNCNM6.js";
116
+ } from "./chunk-TQEKUOTI.js";
117
117
  import {
118
118
  isTransientFetchError
119
119
  } from "./chunk-DXWGFL2Z.js";
@@ -161,16 +161,17 @@ import {
161
161
  } from "./chunk-BR3GT6MR.js";
162
162
  import {
163
163
  buildSkillDiscoveryContextLayer
164
- } from "./chunk-Q3IVPFVO.js";
164
+ } from "./chunk-5YMA6DDZ.js";
165
165
  import {
166
166
  LOCAL_AGENT_CONFIG_MISSING_CODE,
167
167
  LOCAL_TURN_ABORTED_CODE,
168
168
  markCliUserBatchPhase,
169
- readActionGate
170
- } from "./chunk-JUSHVFNF.js";
169
+ readActionGate,
170
+ readAgentsMdLayerFromDisk
171
+ } from "./chunk-3QIYD3VM.js";
171
172
  import {
172
173
  resolveAgentRuntimeConfigFromRecord
173
- } from "./chunk-GUXZK7SE.js";
174
+ } from "./chunk-XAG3FWBE.js";
174
175
  import {
175
176
  resolveAgentImageInputSupport
176
177
  } from "./chunk-DUUDXSLX.js";
@@ -234,13 +235,11 @@ import {
234
235
  ulid
235
236
  } from "./chunk-OJKUU3LP.js";
236
237
  import {
237
- buildAgentsMdLayer,
238
- buildAgentsMdLayerHeader,
239
238
  buildMemoryOverlayLayer,
240
239
  buildMemoryUseGuidanceLayer,
241
240
  partitionScopedBlocks,
242
241
  renderTurnContextBlocksWithScope
243
- } from "./chunk-3P54D2E4.js";
242
+ } from "./chunk-42OKN2LI.js";
244
243
  import {
245
244
  exitCliFromWatchdog,
246
245
  getLogger,
@@ -426,10 +425,10 @@ async function captureLocalRunBase(cwd, options = {}) {
426
425
  return head;
427
426
  };
428
427
  try {
429
- return await Promise.race([work(), new Promise((resolve5) => {
430
- onAbort = () => resolve5(null);
428
+ return await Promise.race([work(), new Promise((resolve4) => {
429
+ onAbort = () => resolve4(null);
431
430
  controller.signal.addEventListener("abort", onAbort, { once: true });
432
- if (controller.signal.aborted) resolve5(null);
431
+ if (controller.signal.aborted) resolve4(null);
433
432
  })]);
434
433
  } catch {
435
434
  return null;
@@ -605,10 +604,10 @@ async function captureBoundedWorkspace(cwd, options = {}) {
605
604
  const pending = work().finally(() => {
606
605
  activeCommandWorkspaceSamples--;
607
606
  });
608
- return await Promise.race([pending, new Promise((resolve5) => {
609
- onAbort = () => resolve5(null);
607
+ return await Promise.race([pending, new Promise((resolve4) => {
608
+ onAbort = () => resolve4(null);
610
609
  controller.signal.addEventListener("abort", onAbort, { once: true });
611
- if (controller.signal.aborted) resolve5(null);
610
+ if (controller.signal.aborted) resolve4(null);
612
611
  })]);
613
612
  } catch {
614
613
  return null;
@@ -12279,7 +12278,7 @@ function isBalanceExhaustedError(error) {
12279
12278
 
12280
12279
  // packages/cli/client/agentRun.ts
12281
12280
  async function loadRunLocalAgentTurn() {
12282
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-TU4LA353.js");
12281
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-HOXKWCYO.js");
12283
12282
  return runLocalAgentTurn;
12284
12283
  }
12285
12284
  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();
@@ -14159,249 +14158,6 @@ function buildHostEnvironmentLayer(options) {
14159
14158
  return layer;
14160
14159
  }
14161
14160
 
14162
- // packages/agent-runtime/agentsMd.ts
14163
- import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
14164
- import { resolve as resolve3 } from "node:path";
14165
- var AGENTS_MD_MAX_BYTES = 8192;
14166
- var AGENTS_MD_MARKER_RESERVE_BYTES = 512;
14167
- var AGENTS_MD_CANDIDATES = ["AGENTS.md", "CLAUDE.md"];
14168
- function truncateAgentsMdContent(content, maxBytes = AGENTS_MD_MAX_BYTES) {
14169
- const buf = Buffer.from(content, "utf8");
14170
- if (buf.byteLength <= maxBytes) {
14171
- return content;
14172
- }
14173
- let boundary = Math.min(maxBytes, buf.byteLength);
14174
- while (boundary > 0 && boundary < buf.byteLength && (buf[boundary] & 192) === 128) {
14175
- boundary--;
14176
- }
14177
- const boundarySlice = buf.subarray(0, boundary).toString("utf8");
14178
- const slice = buf.subarray(0, maxBytes);
14179
- const lastNewline = slice.lastIndexOf(10);
14180
- if (lastNewline > 0) {
14181
- const lineCandidate = slice.subarray(0, lastNewline).toString("utf8");
14182
- const lineBytes = Buffer.byteLength(lineCandidate, "utf8");
14183
- const boundaryBytes = Buffer.byteLength(boundarySlice, "utf8");
14184
- if (lineCandidate.trim().length > 0 && lineBytes * 2 >= boundaryBytes) {
14185
- return lineCandidate.replace(/\r$/, "");
14186
- }
14187
- }
14188
- return boundarySlice.replace(/\r$/, "");
14189
- }
14190
- var AGENTS_MD_SUMMARY_MAX_BYTES = 3072;
14191
- var AGENTS_MD_SUMMARY_ITEM_MAX_CHARS = 120;
14192
- var AGENTS_MD_SUMMARY_PRIORITY_KEYWORDS = [
14193
- "review",
14194
- "\u8BC4\u5BA1",
14195
- "commit",
14196
- "\u63D0\u4EA4",
14197
- "worktree",
14198
- "\u6D4B\u8BD5",
14199
- "typecheck",
14200
- "\u7C7B\u578B\u68C0\u67E5",
14201
- "push",
14202
- "\u53D1\u5E03",
14203
- "\u6587\u6863\u843D\u4F4D",
14204
- "\u5220\u9664",
14205
- "\u6D3E\u53D1"
14206
- ];
14207
- var AGENTS_MD_SUMMARY_POINTER_INSTRUCTION = "\u7528 readFile \u8BFB\u5168\u6587\uFF1A%REL%\uFF08cwd\uFF09/ %PATH%\n\u4EC5\u7D22\u5F15\uFF1A\u63D0\u4EA4/\u8BC4\u5BA1\u95E8\u7981\u3001worktree \u9694\u79BB\u3001\u6D4B\u8BD5/typecheck\u3001\u6587\u6863\u843D\u4F4D\u3001\u5220\u9664\u3001push/\u53D1\u5E03\u524D\uFF0C**\u5FC5\u987B\u5148 readFile \u8BFB\u5168\u6587\u518D\u6267\u884C**\u3002\n\u8DEF\u5F84\uFF1A%REL% \u76F8\u5BF9 cwd\uFF1Bmachine:<id>/\u6C99\u76D2\u6267\u884C\u9762 cwd \u7531\u5176\u51B3\u5B9A\uFF0C\u8BFB\u4E0D\u5230\u8BA9\u5BBF\u4E3B\u6CE8\u5165\u6216\u7528\u7EDD\u5BF9\u8DEF\u5F84\u3002";
14208
- var AGENTS_MD_SUMMARY_DELETE_REFERENCE = "- \u5220\u9664/\u4E0D\u53EF\u9006\u64CD\u4F5C\uFF1A\u9075\u5B88\u7CFB\u7EDF\u63D0\u793A\u7684\u5220\u9664\u7EA2\u7EBF\uFF08\u5148\u5448\u73B0\u5B8C\u6574\u5F85\u5220\u6E05\u5355\u5E76\u83B7\u7528\u6237\u660E\u786E\u786E\u8BA4\uFF0C\u7981\u6B62\u5148\u5220\u540E\u62A5\u3001\u7981\u6B62\u6A21\u7CCA\u5B9A\u4F4D\uFF09\uFF0C\u4ED3\u5E93\u82E5\u6709\u9644\u52A0\u5220\u9664\u89C4\u5219\u89C1\u5B8C\u6574\u6587\u4EF6\u3002";
14209
- var clipToChars = (text, maxChars) => text.length <= maxChars ? text : `${text.slice(0, maxChars).trimEnd()}\u2026`;
14210
- var parseAgentsMdItem = (body) => {
14211
- const bold = /^\*\*(.+?)\*\*/.exec(body);
14212
- if (bold) {
14213
- return {
14214
- label: bold[1].trim().replace(/[::]$/, ""),
14215
- rest: body.slice(bold[0].length).replace(/^[::\s]+/, "")
14216
- };
14217
- }
14218
- const firstClause = body.split(/[::]/)[0];
14219
- return {
14220
- label: clipToChars(firstClause.trim(), 40),
14221
- rest: body.slice(firstClause.length).replace(/^[::\s]+/, "")
14222
- };
14223
- };
14224
- var AGENTS_MD_COMMAND_TOKEN_PREFIX = /^(bunx?|npx|node|npm|pnpm|yarn|git|gh|tsc|deno)\b\s/;
14225
- var extractAgentsMdCommandTokens = (body) => {
14226
- const tokens2 = [];
14227
- const seen = /* @__PURE__ */ new Set();
14228
- for (const match of body.matchAll(/`([^`\n]+)`/g)) {
14229
- const raw = match[1];
14230
- if (!AGENTS_MD_COMMAND_TOKEN_PREFIX.test(raw)) continue;
14231
- if (seen.has(raw)) continue;
14232
- seen.add(raw);
14233
- tokens2.push(raw);
14234
- }
14235
- return tokens2;
14236
- };
14237
- var buildAgentsMdItemGist = (firstSentence, bulletBody) => {
14238
- const max = AGENTS_MD_SUMMARY_ITEM_MAX_CHARS;
14239
- const clipped = clipToChars(firstSentence, max);
14240
- const missing = extractAgentsMdCommandTokens(bulletBody).filter(
14241
- (token) => !clipped.includes(token)
14242
- );
14243
- if (missing.length === 0) return clipped;
14244
- let tail = "";
14245
- for (const token of missing) {
14246
- const candidate = tail ? `${tail} \`${token}\`` : `\`${token}\``;
14247
- if (candidate.length > max) continue;
14248
- tail = candidate;
14249
- }
14250
- if (!tail) return clipped;
14251
- const room = max - tail.length - 2;
14252
- const head = room > 0 ? clipToChars(firstSentence, room) : "";
14253
- return head ? `${head} ${tail}` : tail;
14254
- };
14255
- var priorityOf = (label) => {
14256
- const lowered = label.toLowerCase();
14257
- for (let i = 0; i < AGENTS_MD_SUMMARY_PRIORITY_KEYWORDS.length; i += 1) {
14258
- if (lowered.includes(AGENTS_MD_SUMMARY_PRIORITY_KEYWORDS[i].toLowerCase())) {
14259
- return i;
14260
- }
14261
- }
14262
- return -1;
14263
- };
14264
- var collectAgentsMdSummaryItems = (content) => {
14265
- const items = [];
14266
- const seen = /* @__PURE__ */ new Set();
14267
- let section = null;
14268
- for (const rawLine of content.split(/\r?\n/)) {
14269
- const line = rawLine.trim();
14270
- if (!line) continue;
14271
- const heading = /^#{2,3}\s+(.+)$/.exec(line);
14272
- if (heading) {
14273
- section = heading[1].trim();
14274
- continue;
14275
- }
14276
- if (line.startsWith("#") || line.startsWith("<") || line.startsWith("<!--")) {
14277
- continue;
14278
- }
14279
- const bullet = /^[-*]\s+(.+)$/.exec(line);
14280
- if (!bullet) continue;
14281
- const { label, rest } = parseAgentsMdItem(bullet[1]);
14282
- if (!label || seen.has(label)) continue;
14283
- seen.add(label);
14284
- const firstSentence = rest.split("\u3002")[0].trim();
14285
- items.push({
14286
- section,
14287
- label,
14288
- gist: buildAgentsMdItemGist(firstSentence, bullet[1]),
14289
- priority: priorityOf(label)
14290
- });
14291
- }
14292
- return items;
14293
- };
14294
- function buildAgentsMdSummaryBody(content, filePath, options = {}) {
14295
- const budgetBytes = options.budgetBytes ?? AGENTS_MD_SUMMARY_MAX_BYTES;
14296
- const items = collectAgentsMdSummaryItems(content);
14297
- if (items.length === 0) return null;
14298
- const relativePath2 = options.fileName ?? "AGENTS.md";
14299
- const pointer = AGENTS_MD_SUMMARY_POINTER_INSTRUCTION.replaceAll(
14300
- "%REL%",
14301
- relativePath2
14302
- ).replaceAll("%PATH%", filePath);
14303
- const head = `${pointer}
14304
- ${AGENTS_MD_SUMMARY_DELETE_REFERENCE}
14305
- `;
14306
- if (Buffer.byteLength(head, "utf8") > budgetBytes) return null;
14307
- const candidates = [
14308
- ...items.filter((item) => item.priority >= 0).sort((a, b) => a.priority - b.priority),
14309
- ...items.filter((item) => item.priority < 0)
14310
- ];
14311
- const noteBlock = `
14312
- \u2026\uFF08\u7D22\u5F15\u5DF2\u622A\u65AD\uFF0C\u5176\u4F59\u951A\u70B9\u89C1\u5B8C\u6574\u6587\u4EF6\uFF09`;
14313
- const noteBytes = Buffer.byteLength(noteBlock, "utf8");
14314
- let used = Buffer.byteLength(head, "utf8");
14315
- const admitted = [];
14316
- const seenSections = /* @__PURE__ */ new Set();
14317
- let truncated = false;
14318
- for (const item of candidates) {
14319
- const line = item.gist ? `- ${item.label}\uFF1A${item.gist}` : `- ${item.label}`;
14320
- const headingCost = item.section && !seenSections.has(item.section) ? Buffer.byteLength(`
14321
- ## ${item.section}`, "utf8") : 0;
14322
- const cost = headingCost + Buffer.byteLength(`
14323
- ${line}`, "utf8");
14324
- if (used + cost + noteBytes > budgetBytes) {
14325
- truncated = true;
14326
- continue;
14327
- }
14328
- used += cost;
14329
- if (item.section) seenSections.add(item.section);
14330
- admitted.push(item);
14331
- }
14332
- const groupOrder = [];
14333
- for (const item of admitted) {
14334
- if (!groupOrder.includes(item.section)) groupOrder.push(item.section);
14335
- }
14336
- const frozen = [];
14337
- for (const section of groupOrder) {
14338
- for (const item of admitted) {
14339
- if (item.section !== section) continue;
14340
- frozen.push({
14341
- section,
14342
- line: item.gist ? `- ${item.label}\uFF1A${item.gist}` : `- ${item.label}`
14343
- });
14344
- }
14345
- }
14346
- if (admitted.length === 0) return null;
14347
- return `${head}${renderSummarySections(frozen)}${truncated ? noteBlock : ""}`;
14348
- }
14349
- var renderSummarySections = (entries) => {
14350
- let rendered = "";
14351
- let currentSection = null;
14352
- for (const entry of entries) {
14353
- if (entry.section && entry.section !== currentSection) {
14354
- rendered += `
14355
- ## ${entry.section}`;
14356
- currentSection = entry.section;
14357
- }
14358
- rendered += `
14359
- ${entry.line}`;
14360
- }
14361
- return rendered;
14362
- };
14363
- function readAgentsMdLayerFromDisk(cwd) {
14364
- for (const name of AGENTS_MD_CANDIDATES) {
14365
- const filePath = resolve3(cwd, name);
14366
- if (!existsSync2(filePath)) continue;
14367
- try {
14368
- const raw = readFileSync3(filePath, "utf8");
14369
- const content = raw.trim();
14370
- if (!content) continue;
14371
- const totalBytes = Buffer.byteLength(raw, "utf8");
14372
- const trimmedBytes = Buffer.byteLength(content, "utf8");
14373
- const headerBytes = Buffer.byteLength(buildAgentsMdLayerHeader(name), "utf8");
14374
- if (headerBytes + trimmedBytes <= AGENTS_MD_MAX_BYTES) {
14375
- return buildAgentsMdLayer(content, name);
14376
- }
14377
- const summaryBody = buildAgentsMdSummaryBody(content, filePath, {
14378
- // 正文预算 = 摘要上限 − 块头部:buildAgentsMdLayer 会再拼一次头部,
14379
- // 因此「头部 + 正文」才等于最终注入字节,不得超过摘要上限。
14380
- budgetBytes: AGENTS_MD_SUMMARY_MAX_BYTES - headerBytes,
14381
- fileName: name
14382
- });
14383
- if (summaryBody) return buildAgentsMdLayer(summaryBody, name);
14384
- const buildMarker = (omitted2, withPath) => {
14385
- const pathPart = withPath ? `\u5B8C\u6574\u6587\u4EF6\uFF1A${filePath}` : `\u5B8C\u6574\u6587\u4EF6\uFF1A\u5DE5\u4F5C\u533A\u6839\u76EE\u5F55\u7684 ${name}`;
14386
- return `<!-- AGENTS.md truncated: \u539F\u6587\u4EF6 ${totalBytes} \u5B57\u8282\uFF0C\u6CE8\u5165\u9884\u7B97 ${AGENTS_MD_MAX_BYTES} \u5B57\u8282\uFF0C\u5DF2\u7701\u7565 ${omitted2} \u5B57\u8282\uFF08\u4E0A\u6587\u53EF\u80FD\u7F3A\u5C11\u6587\u4EF6\u672B\u5C3E\u7684 commit/review \u95E8\u7981\u7EC6\u5219\uFF0C\u63D0\u4EA4/\u8BC4\u5BA1\u524D\u8BF7\u8BFB\u5B8C\u6574\u6587\u4EF6\uFF09\u3002${pathPart} -->`;
14387
- };
14388
- const bodyBudget = AGENTS_MD_MAX_BYTES - AGENTS_MD_MARKER_RESERVE_BYTES - 2 - headerBytes;
14389
- const body = truncateAgentsMdContent(content, bodyBudget);
14390
- const bodyBytes = Buffer.byteLength(body, "utf8");
14391
- const omitted = Math.max(0, totalBytes - bodyBytes);
14392
- let marker = buildMarker(omitted, true);
14393
- if (Buffer.byteLength(marker, "utf8") > AGENTS_MD_MARKER_RESERVE_BYTES) {
14394
- marker = buildMarker(omitted, false);
14395
- }
14396
- return buildAgentsMdLayer(`${body}
14397
-
14398
- ${marker}`, name);
14399
- } catch {
14400
- }
14401
- }
14402
- return null;
14403
- }
14404
-
14405
14161
  // packages/ai/token/cacheRunSummary.ts
14406
14162
  var finiteCount = (value) => typeof value === "number" && Number.isFinite(value) ? Math.max(0, Math.floor(value)) : void 0;
14407
14163
  var isUsageObject = (usage) => Boolean(usage) && typeof usage === "object";
@@ -14503,17 +14259,17 @@ function runDoDCommands(commands, cwd, deps = {}) {
14503
14259
  }
14504
14260
 
14505
14261
  // packages/cli/agentRunPrompts.ts
14506
- import { existsSync as existsSync3, readFileSync as readFileSync4, readdirSync, statSync as statSync2 } from "node:fs";
14507
- import { dirname, extname, isAbsolute as isAbsolute2, join as join2, relative as relativePath, resolve as resolve4, sep } from "node:path";
14262
+ import { existsSync as existsSync2, readFileSync as readFileSync3, readdirSync, statSync as statSync2 } from "node:fs";
14263
+ import { dirname, extname, isAbsolute as isAbsolute2, join as join2, relative as relativePath, resolve as resolve3, sep } from "node:path";
14508
14264
  function workflowRefToCandidatePath(cwd, ref) {
14509
14265
  const normalized = ref.trim();
14510
14266
  if (!normalized) return "";
14511
14267
  if (normalized.endsWith(".md") || normalized.includes("/") || normalized.includes("\\")) {
14512
- const directPath = resolve4(cwd, normalized);
14513
- if (existsSync3(directPath)) return directPath;
14268
+ const directPath = resolve3(cwd, normalized);
14269
+ if (existsSync2(directPath)) return directPath;
14514
14270
  }
14515
14271
  const fileName = normalized.replace(/[^a-zA-Z0-9一-鿿]+/g, "-").replace(/^-+|-+$/g, "");
14516
- return resolve4(cwd, "docs", "workflows", `${fileName}.md`);
14272
+ return resolve3(cwd, "docs", "workflows", `${fileName}.md`);
14517
14273
  }
14518
14274
  var SKILL_SEARCH_DIRS = [
14519
14275
  ".agents/skills"
@@ -14522,22 +14278,22 @@ function skillRefToCandidatePath(cwd, ref) {
14522
14278
  const normalized = ref.trim();
14523
14279
  if (!normalized) return "";
14524
14280
  if (normalized.endsWith(".md") || normalized.includes("/") || normalized.includes("\\")) {
14525
- const directPath = resolve4(cwd, normalized);
14526
- if (existsSync3(directPath)) return directPath;
14281
+ const directPath = resolve3(cwd, normalized);
14282
+ if (existsSync2(directPath)) return directPath;
14527
14283
  }
14528
14284
  const fileName = normalized.replace(/[^a-zA-Z0-9一-鿿]+/g, "-").replace(/^-+|-+$/g, "");
14529
14285
  for (const dir of SKILL_SEARCH_DIRS) {
14530
- const skillMdPath = resolve4(cwd, dir, fileName, "SKILL.md");
14531
- if (existsSync3(skillMdPath)) return skillMdPath;
14286
+ const skillMdPath = resolve3(cwd, dir, fileName, "SKILL.md");
14287
+ if (existsSync2(skillMdPath)) return skillMdPath;
14532
14288
  }
14533
- return resolve4(cwd, ".agents", "skills", fileName, "SKILL.md");
14289
+ return resolve3(cwd, ".agents", "skills", fileName, "SKILL.md");
14534
14290
  }
14535
14291
  async function resolveWorkflowReference(ref, cwd = process.cwd()) {
14536
14292
  const path2 = workflowRefToCandidatePath(cwd, ref);
14537
- if (!path2 || !existsSync3(path2)) {
14293
+ if (!path2 || !existsSync2(path2)) {
14538
14294
  throw new Error(`Workflow reference not found: ${ref}`);
14539
14295
  }
14540
- const markdown = readFileSync4(path2, "utf8");
14296
+ const markdown = readFileSync3(path2, "utf8");
14541
14297
  const parsed = parseSkillDocProtocol(markdown);
14542
14298
  return {
14543
14299
  ref,
@@ -14547,15 +14303,15 @@ async function resolveWorkflowReference(ref, cwd = process.cwd()) {
14547
14303
  }
14548
14304
  function inlineRelativeRefs(body, skillDir) {
14549
14305
  const refPattern = /\[([^\]]+)\]\((\.\/[^)]+|[^)]+\/[^)]+)\)/g;
14550
- const normalizedSkillDir = resolve4(skillDir) + sep;
14306
+ const normalizedSkillDir = resolve3(skillDir) + sep;
14551
14307
  return body.replace(refPattern, (match, label, relPath) => {
14552
14308
  const cleaned = relPath.trim();
14553
14309
  if (!cleaned.startsWith("./") && !cleaned.startsWith("../")) return match;
14554
- const absPath = resolve4(skillDir, cleaned);
14310
+ const absPath = resolve3(skillDir, cleaned);
14555
14311
  const relative = relativePath(normalizedSkillDir, absPath);
14556
14312
  if (relative.startsWith("..") || isAbsolute2(relative)) return match;
14557
- if (!existsSync3(absPath) || !absPath.endsWith(".md")) return match;
14558
- const refContent = readFileSync4(absPath, "utf8");
14313
+ if (!existsSync2(absPath) || !absPath.endsWith(".md")) return match;
14314
+ const refContent = readFileSync3(absPath, "utf8");
14559
14315
  return `
14560
14316
 
14561
14317
  ### ${label}
@@ -14567,7 +14323,7 @@ ${refContent}
14567
14323
  }
14568
14324
  function listSkillScripts(skillDir) {
14569
14325
  const scriptsDir = join2(skillDir, "scripts");
14570
- if (!existsSync3(scriptsDir) || !statSync2(scriptsDir).isDirectory()) return null;
14326
+ if (!existsSync2(scriptsDir) || !statSync2(scriptsDir).isDirectory()) return null;
14571
14327
  const entries = readdirSync(scriptsDir).filter((e) => !e.startsWith("."));
14572
14328
  if (entries.length === 0) return null;
14573
14329
  return [
@@ -14594,10 +14350,10 @@ async function resolveSkillReference(ref, options = {}) {
14594
14350
  } else {
14595
14351
  const cwd = options.cwd ?? process.cwd();
14596
14352
  const path2 = skillRefToCandidatePath(cwd, ref);
14597
- if (!path2 || !existsSync3(path2)) {
14353
+ if (!path2 || !existsSync2(path2)) {
14598
14354
  throw new Error(`Skill reference not found: ${ref}`);
14599
14355
  }
14600
- markdown = readFileSync4(path2, "utf8");
14356
+ markdown = readFileSync3(path2, "utf8");
14601
14357
  filePath = path2;
14602
14358
  skillDir = dirname(path2);
14603
14359
  }
@@ -14701,9 +14457,9 @@ function prependSubjectDialogMarker(message, subjectDialogKey) {
14701
14457
  }
14702
14458
  function normalizeCliImageInput(input) {
14703
14459
  if (/^(https?:|data:|file:)/i.test(input)) return input;
14704
- const absolutePath = resolve4(input);
14705
- if (!existsSync3(absolutePath)) return input;
14706
- const base64 = readFileSync4(absolutePath).toString("base64");
14460
+ const absolutePath = resolve3(input);
14461
+ if (!existsSync2(absolutePath)) return input;
14462
+ const base64 = readFileSync3(absolutePath).toString("base64");
14707
14463
  return `data:${imageMimeTypeForPath(absolutePath)};base64,${base64}`;
14708
14464
  }
14709
14465
  function imageMimeTypeForPath(path2) {
@@ -16463,8 +16219,8 @@ async function runAgentRunCommandImpl(args, deps) {
16463
16219
  try {
16464
16220
  return await Promise.race([
16465
16221
  activeRunner.then(() => true, () => true),
16466
- new Promise((resolve5) => {
16467
- timer = setTimeout(() => resolve5(false), 100);
16222
+ new Promise((resolve4) => {
16223
+ timer = setTimeout(() => resolve4(false), 100);
16468
16224
  })
16469
16225
  ]);
16470
16226
  } finally {
@@ -17253,7 +17009,6 @@ export {
17253
17009
  releaseCollapsedPasteReferences,
17254
17010
  expandRangeToCollapsedPasteChips,
17255
17011
  findCollapsedPasteSpanAt,
17256
- readAgentsMdLayerFromDisk,
17257
17012
  emitTerminalProgramStatus,
17258
17013
  contextRefusalDiagnostics,
17259
17014
  describeContextRefusal,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-GYS5FUYR.js";
3
+ } from "./chunk-HXB4VDGK.js";
4
4
  import {
5
5
  prepareAndPersistMessage,
6
6
  uiAskChoiceFunc,
7
7
  uiAskChoiceFunctionSchema
8
- } from "./chunk-R3NEQZ53.js";
8
+ } from "./chunk-7BCG67EI.js";
9
9
  import {
10
10
  require_format
11
11
  } from "./chunk-BUDVRYES.js";
@@ -5,7 +5,7 @@ import {
5
5
  mapDiscoveredSkillsToCatalogEntries,
6
6
  resolveSkillCatalog,
7
7
  resolveSkillCatalogSync
8
- } from "./chunk-3P54D2E4.js";
8
+ } from "./chunk-42OKN2LI.js";
9
9
  import {
10
10
  load
11
11
  } from "./chunk-KHCLMKZZ.js";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-523DITKR.js";
11
11
  import {
12
12
  runLlm
13
- } from "./chunk-K67C2JUC.js";
13
+ } from "./chunk-WCFFRBL5.js";
14
14
  import {
15
15
  isMediaToolConfirmation
16
16
  } from "./chunk-QYPE3TS3.js";
@@ -14619,7 +14619,7 @@ var messageSlice = createSliceWithThunks({
14619
14619
  runtimeOptions: args.runtimeOptions
14620
14620
  });
14621
14621
  if (agentKeyToUse) {
14622
- const { streamAgentChatTurn } = await import("./agentSlice-L4SBGWTB.js");
14622
+ const { streamAgentChatTurn } = await import("./agentSlice-UG76KEBH.js");
14623
14623
  await dispatch(
14624
14624
  streamAgentChatTurn({
14625
14625
  agentKey: agentKeyToUse,
@@ -15752,7 +15752,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
15752
15752
  }
15753
15753
  if (isCurrentDialog) {
15754
15754
  await thunkApi.dispatch(resetMsgs());
15755
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-P2S4LXQD.js");
15755
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-5EQ2A6LY.js");
15756
15756
  dispatch(clearPendingAttachments2());
15757
15757
  }
15758
15758
  return { dialogKey, isCurrentDialog, attachmentPlan };
@@ -15760,15 +15760,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
15760
15760
 
15761
15761
  // packages/chat/dialog/dialogSlice.ts
15762
15762
  var runCreateDialogAction = async (args, thunkApi) => {
15763
- const { createDialogAction } = await import("./createDialogAction-QTU2R2Q3.js");
15763
+ const { createDialogAction } = await import("./createDialogAction-EVTOPY7A.js");
15764
15764
  return createDialogAction(args, thunkApi);
15765
15765
  };
15766
15766
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
15767
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-L4CYUZJG.js");
15767
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-PB4QIFQ4.js");
15768
15768
  return createAgentAutomationAction(args, thunkApi);
15769
15769
  };
15770
15770
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
15771
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-RZ3KZSGQ.js");
15771
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-IMIRJRQQ.js");
15772
15772
  return updateDialogTitleAction(args, thunkApi);
15773
15773
  };
15774
15774
  var runAddDialogAgentAction = async (args, thunkApi) => {
@@ -15792,7 +15792,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
15792
15792
  return setDialogExtraReferencesAction(args, thunkApi);
15793
15793
  };
15794
15794
  var runHandleSendMessageAction = async (args, thunkApi) => {
15795
- const { handleSendMessageAction } = await import("./handleSendMessageAction-7IHLR37A.js");
15795
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-LNT7SZND.js");
15796
15796
  return handleSendMessageAction(args, thunkApi);
15797
15797
  };
15798
15798
  function clearDialogState() {
@@ -15805,7 +15805,7 @@ var createPageAndAddReference = createAsyncThunk(
15805
15805
  async (payload, { dispatch, getState, rejectWithValue }) => {
15806
15806
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
15807
15807
  try {
15808
- const { createDocState } = await import("./docStore-6O7NYL6A.js");
15808
+ const { createDocState } = await import("./docStore-OKKIKLT3.js");
15809
15809
  const pageKey = await createDocState(
15810
15810
  { slateData, title },
15811
15811
  { dispatch, getState }
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  deriveCredentialGroup
3
- } from "./chunk-NHY322ZU.js";
3
+ } from "./chunk-RRDRQOEC.js";
4
4
  import {
5
5
  listUserRecordsFromServers,
6
6
  readLiveDbRecordAfterTombstoneMerge
7
- } from "./chunk-QBZCGP34.js";
7
+ } from "./chunk-M3OZRQNH.js";
8
8
  import {
9
9
  agentRecordHasConfiguredCredential
10
- } from "./chunk-D6YNCNM6.js";
10
+ } from "./chunk-TQEKUOTI.js";
11
11
  import {
12
12
  isTombstoneRecord
13
13
  } from "./chunk-BV3FLP2L.js";
@@ -110,6 +110,9 @@ function parseAgentListArgs(args) {
110
110
  // --verbose 拿回完整字段集排障。
111
111
  verbose: args.includes("--verbose"),
112
112
  compact: args.includes("--compact"),
113
+ fragmentOffset: readArgValue(args, "--fragment-offset"),
114
+ fragmentAgentKey: readArgValue(args, "--fragment-agent-key"),
115
+ fragmentDigest: readArgValue(args, "--fragment-digest"),
113
116
  limit: readArgValue(args, "--limit") ?? void 0,
114
117
  offset: readArgValue(args, "--offset") ?? void 0
115
118
  };
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-YFLVRVYK.js";
7
7
  import {
8
8
  clearCliLocalRuntimePreparedAgentCache
9
- } from "./chunk-STJ6LSQE.js";
9
+ } from "./chunk-DLXMMTGM.js";
10
10
  import {
11
11
  readCredentialAvailability
12
12
  } from "./chunk-WWTSEBDF.js";
@@ -25,7 +25,7 @@ import {
25
25
  resolveAgentRecordFromHybridStore,
26
26
  sanitizeAgentRecordForCliOutput,
27
27
  writeAgentRecord
28
- } from "./chunk-D6YNCNM6.js";
28
+ } from "./chunk-TQEKUOTI.js";
29
29
  import {
30
30
  resolveCliAgentKeyInput
31
31
  } from "./chunk-BR3GT6MR.js";