nolo-cli 0.151.0-alpha.3 → 0.152.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/{_executeModel-T7ANHTUW.js → _executeModel-4KHFMQT4.js} +15 -15
  2. package/{agentDeleteCommand-4L5KCKFY.js → agentDeleteCommand-EKFV5FC7.js} +15 -15
  3. package/{agentEmailCommands-2IMMIRO2.js → agentEmailCommands-MNV3MUH5.js} +17 -17
  4. package/{agentListCommands-TWFLUYIZ.js → agentListCommands-E6FYKXC3.js} +6 -6
  5. package/{agentMachineCommands-KIWXWT6L.js → agentMachineCommands-2GFUU7GF.js} +7 -7
  6. package/{agentRecordCommands-727NPCRW.js → agentRecordCommands-LPHHTEPM.js} +16 -16
  7. package/{agentRunCommand-JASIG3FZ.js → agentRunCommand-JSPW7W32.js} +17 -17
  8. package/{agentRuntimeLocal-KKSQJMTE.js → agentRuntimeLocal-ARS4TV77.js} +6 -6
  9. package/{agentSlice-SLV57QGU.js → agentSlice-IP4DZNNV.js} +1 -1
  10. package/{appDeleteCommands-4PL4KYRN.js → appDeleteCommands-JHTLKQSX.js} +6 -6
  11. package/{appDeployCommands-EEEXCEB6.js → appDeployCommands-5V26M2KA.js} +6 -6
  12. package/{appDeployStatusCommands-35ZX7T66.js → appDeployStatusCommands-SBSPS627.js} +6 -6
  13. package/{appGetCommands-WFCHXJWF.js → appGetCommands-NKPD2L45.js} +6 -6
  14. package/{appListCommands-XY2U6DPF.js → appListCommands-ZOGRZFYY.js} +6 -6
  15. package/{chunk-BPMPOFWP.js → chunk-4PXHOOFA.js} +784 -3
  16. package/{chunk-PKZKOVA5.js → chunk-64PFYIAY.js} +19 -13
  17. package/{chunk-BJEZC5RA.js → chunk-6LIKQYG4.js} +3 -3
  18. package/{chunk-CYJWI3NH.js → chunk-AHYBQP3M.js} +3 -3
  19. package/{chunk-AUIJZACN.js → chunk-BNDETALN.js} +76 -38
  20. package/{chunk-6CCFTVBP.js → chunk-DTODXBHK.js} +103 -1
  21. package/{chunk-LGN377P3.js → chunk-DYYMIUN4.js} +2 -2
  22. package/{chunk-ROCUB2H2.js → chunk-EHFS4XZO.js} +2 -2
  23. package/{chunk-3SZA4U64.js → chunk-HL3O3PCQ.js} +1 -1
  24. package/{chunk-UOKFKFPO.js → chunk-HSJPKBLC.js} +1 -1
  25. package/{chunk-TTH4HOJD.js → chunk-I5V3V2H4.js} +13 -11
  26. package/{chunk-I2XLRXVX.js → chunk-JWTSWUPS.js} +3 -3
  27. package/{chunk-626KHJNX.js → chunk-KMM2X7LP.js} +2 -2
  28. package/{chunk-DFDXM2Y4.js → chunk-LC23WBCU.js} +3 -3
  29. package/{chunk-V4EE3D54.js → chunk-MZHOLWW5.js} +2 -2
  30. package/{chunk-AJ3G7X2K.js → chunk-OFVFQYIE.js} +1 -1
  31. package/{chunk-U5ICMAFV.js → chunk-PFBIXTFB.js} +24 -105
  32. package/{chunk-U5GPBQDG.js → chunk-PMYAE4OZ.js} +1 -1
  33. package/{chunk-3T4ZG6AC.js → chunk-PPU323UE.js} +27 -22
  34. package/{chunk-IK2TSJQA.js → chunk-RQ6E3G5L.js} +1 -1
  35. package/{chunk-RN2GPWN6.js → chunk-T5BHHWA5.js} +2 -2
  36. package/{chunk-PIDUNDFS.js → chunk-VNP54NZL.js} +9 -7
  37. package/{chunk-AG7MCDLR.js → chunk-XCA6HQGS.js} +2 -2
  38. package/{chunk-VWW6O2TL.js → chunk-XTWDF6RU.js} +10 -10
  39. package/{commandRegistry-NBLZEMCW.js → commandRegistry-VBALU4Q4.js} +40 -40
  40. package/{contentThunks-6AIWNSGO.js → contentThunks-HPY2QNWZ.js} +5 -5
  41. package/{createAgentAutomationAction-4BUS65DZ.js → createAgentAutomationAction-6ADGPGY6.js} +5 -5
  42. package/{createDialogAction-QAIKSCG4.js → createDialogAction-6ABMSEW2.js} +6 -6
  43. package/{createPageAction-DXCZ334C.js → createPageAction-OC4NNRPC.js} +5 -5
  44. package/{dialogCommands-YZLSJB6X.js → dialogCommands-EIGBRSQP.js} +6 -6
  45. package/{dialogSlice-PVUSMKFW.js → dialogSlice-SI45KJOH.js} +4 -4
  46. package/{docCreateCommands-JB2RRMRJ.js → docCreateCommands-3JDBBMU5.js} +6 -6
  47. package/{docDeleteCommands-AQENULNM.js → docDeleteCommands-5M6C7UUB.js} +6 -6
  48. package/{docReadCommands-DYD25YLQ.js → docReadCommands-DUB57F6V.js} +6 -6
  49. package/{docStore-CSEBEMKP.js → docStore-L43MDEK4.js} +1 -1
  50. package/{docUpdateCommands-3GVS23QL.js → docUpdateCommands-WF7MAMPK.js} +6 -6
  51. package/{handleSendMessageAction-G2TLYGC4.js → handleSendMessageAction-BSMU7SVS.js} +9 -9
  52. package/index.js +4 -4
  53. package/{localRuntimeAdapter-B4TAYYA7.js → localRuntimeAdapter-N5PDR26F.js} +15 -15
  54. package/{machineCommands-6OBFD3XF.js → machineCommands-TMXJKZCE.js} +16 -16
  55. package/{machineWsRunDispatch-OO7N3O3Y.js → machineWsRunDispatch-25H63KEH.js} +16 -16
  56. package/package.json +1 -1
  57. package/{readlineWorkspace-UIQN7JUR.js → readlineWorkspace-BS7WVCL2.js} +202 -57
  58. package/{runAgentClientLoop-GS3SGG37.js → runAgentClientLoop-BVKRI4SY.js} +13 -13
  59. package/{spaceCommands-ZR5BR3GX.js → spaceCommands-5EWREUWS.js} +6 -6
  60. package/{streamAgentChatTurn-4XYC33KE.js → streamAgentChatTurn-B4VFUV52.js} +16 -16
  61. package/{tools-P77EE7Q4.js → tools-5WYAUKMK.js} +9 -9
  62. package/{tuiSummaryLlmCaller-BM3VSTBU.js → tuiSummaryLlmCaller-PPU7YDBG.js} +45 -23
  63. package/{updateDialogTitleAction-CIANVPZC.js → updateDialogTitleAction-YJHDKHFX.js} +5 -5
@@ -44,6 +44,7 @@ import {
44
44
  fitAnsiLine,
45
45
  formatAssistantDisplay,
46
46
  formatCreditsChip,
47
+ formatTokenCount,
47
48
  getActiveThemeMode,
48
49
  getActiveThemeName,
49
50
  historyTokensBeforeLatestAssistant,
@@ -65,6 +66,7 @@ import {
65
66
  resolveAuthorityTurnCount,
66
67
  resolveCliColorEnabled,
67
68
  resolveCliMemory,
69
+ resolveContextUsage,
68
70
  resolveSkillReference,
69
71
  resolveTerminalProgramStatusState,
70
72
  resolveTuiBrightnessSignal,
@@ -89,9 +91,9 @@ import {
89
91
  wrapTextToLines,
90
92
  wrapTranscriptLine,
91
93
  wrapTranscriptLineWithLayout
92
- } from "./chunk-TTH4HOJD.js";
94
+ } from "./chunk-I5V3V2H4.js";
93
95
  import "./chunk-6QDYSCPW.js";
94
- import "./chunk-IK2TSJQA.js";
96
+ import "./chunk-RQ6E3G5L.js";
95
97
  import {
96
98
  getReadableCliDb
97
99
  } from "./chunk-P5QACQDK.js";
@@ -101,7 +103,7 @@ import {
101
103
  createCliLocalRuntimeAdapter,
102
104
  createOriginShellGrant,
103
105
  readTimestamp
104
- } from "./chunk-PKZKOVA5.js";
106
+ } from "./chunk-64PFYIAY.js";
105
107
  import "./chunk-XS47QOFV.js";
106
108
  import "./chunk-6MXDOUMH.js";
107
109
  import {
@@ -152,16 +154,16 @@ import "./chunk-KFHQQ3NO.js";
152
154
  import "./chunk-JEXVIMYZ.js";
153
155
  import {
154
156
  prepareTools
155
- } from "./chunk-V4EE3D54.js";
157
+ } from "./chunk-MZHOLWW5.js";
156
158
  import {
157
159
  buildResponseGuidelines
158
160
  } from "./chunk-W4S6OTSC.js";
159
161
  import "./chunk-HS7MLR74.js";
160
- import "./chunk-3T4ZG6AC.js";
162
+ import "./chunk-PPU323UE.js";
161
163
  import "./chunk-JKMLSTZK.js";
162
164
  import "./chunk-I2ZMGXXF.js";
163
165
  import "./chunk-OXME3PEE.js";
164
- import "./chunk-ROCUB2H2.js";
166
+ import "./chunk-EHFS4XZO.js";
165
167
  import "./chunk-NF64D32W.js";
166
168
  import "./chunk-XPWGOTBQ.js";
167
169
  import "./chunk-ZIWPQEFU.js";
@@ -174,20 +176,18 @@ import "./chunk-IA7TRNNR.js";
174
176
  import "./chunk-AGIM7IMJ.js";
175
177
  import "./chunk-63W5N6P3.js";
176
178
  import "./chunk-VF4K2QE6.js";
177
- import "./chunk-626KHJNX.js";
179
+ import "./chunk-KMM2X7LP.js";
178
180
  import "./chunk-ILU2NPWY.js";
179
- import "./chunk-AG7MCDLR.js";
181
+ import "./chunk-XCA6HQGS.js";
180
182
  import "./chunk-F32Z66T4.js";
181
183
  import "./chunk-EYWJT7A2.js";
182
- import "./chunk-AJ3G7X2K.js";
183
- import {
184
- extractReferenceKeysFromMessage
185
- } from "./chunk-U5ICMAFV.js";
184
+ import "./chunk-OFVFQYIE.js";
185
+ import "./chunk-PFBIXTFB.js";
186
186
  import "./chunk-523DITKR.js";
187
187
  import "./chunk-UKZX3NHN.js";
188
188
  import "./chunk-OFFL4DCR.js";
189
189
  import "./chunk-QYPE3TS3.js";
190
- import "./chunk-DFDXM2Y4.js";
190
+ import "./chunk-LC23WBCU.js";
191
191
  import "./chunk-4JH2UMJR.js";
192
192
  import "./chunk-ZJ7UHBJS.js";
193
193
  import "./chunk-BYXBJQAS.js";
@@ -226,14 +226,14 @@ import {
226
226
  formatToolOverflowMarker,
227
227
  getProcessRegistry,
228
228
  readCommandActionGatePayload
229
- } from "./chunk-AUIJZACN.js";
229
+ } from "./chunk-BNDETALN.js";
230
230
  import "./chunk-GQV5KHJU.js";
231
231
  import "./chunk-ZNFJWEN4.js";
232
- import "./chunk-LGN377P3.js";
232
+ import "./chunk-DYYMIUN4.js";
233
233
  import "./chunk-HNUWUO75.js";
234
234
  import "./chunk-CHOZJMJS.js";
235
235
  import "./chunk-PWTNI4N7.js";
236
- import "./chunk-UOKFKFPO.js";
236
+ import "./chunk-HSJPKBLC.js";
237
237
  import "./chunk-5ZUL4CUO.js";
238
238
  import "./chunk-GCKHQECX.js";
239
239
  import "./chunk-G6OOUQWJ.js";
@@ -247,26 +247,28 @@ import {
247
247
  buildRuntimeGuidanceBlocks,
248
248
  resolveToolGuidedSections
249
249
  } from "./chunk-WD4XYDYC.js";
250
- import "./chunk-3SZA4U64.js";
250
+ import "./chunk-HL3O3PCQ.js";
251
251
  import "./chunk-QLQ573SU.js";
252
252
  import {
253
253
  isQuotaExhaustedError
254
254
  } from "./chunk-3MZAGMYY.js";
255
255
  import "./chunk-2MBTWINN.js";
256
256
  import {
257
+ extractReferenceKeysFromMessage,
257
258
  normalizeUsage
258
- } from "./chunk-6CCFTVBP.js";
259
+ } from "./chunk-DTODXBHK.js";
259
260
  import {
260
261
  DEFAULT_CONTEXT_WINDOW,
261
262
  buildCompactionMetricsFromPlan,
262
263
  buildCompactionUserContent,
264
+ computeSummarySourceMetadata,
263
265
  formatCompactionMetricsLog,
264
266
  formatFileOperationsFromMessages,
265
267
  formatMessagesForSummaryWithTruncation,
266
268
  getModelContextWindow,
267
269
  planCompression,
268
270
  serializeMessageContent
269
- } from "./chunk-BPMPOFWP.js";
271
+ } from "./chunk-4PXHOOFA.js";
270
272
  import {
271
273
  clipCompactText
272
274
  } from "./chunk-5MMAK75Q.js";
@@ -7833,6 +7835,16 @@ function formatCwd(cwd) {
7833
7835
  const parts = cwd.split(/[/\\]/);
7834
7836
  return parts.pop() || cwd;
7835
7837
  }
7838
+ function truncateToWidth(text, maxWidth) {
7839
+ if (displayWidth(text) <= maxWidth) return text;
7840
+ if (maxWidth < 2) return "";
7841
+ let out = "";
7842
+ for (const ch of text) {
7843
+ if (displayWidth(`${out}${ch}\u2026`) > maxWidth) break;
7844
+ out += ch;
7845
+ }
7846
+ return out ? `${out}\u2026` : "";
7847
+ }
7836
7848
  function formatElapsedSeconds(totalSeconds) {
7837
7849
  if (totalSeconds < 60) return `${totalSeconds}s`;
7838
7850
  const minutes = Math.floor(totalSeconds / 60);
@@ -7842,6 +7854,21 @@ function formatElapsedSeconds(totalSeconds) {
7842
7854
  const mins = minutes % 60;
7843
7855
  return `${hours}h ${mins}m`;
7844
7856
  }
7857
+ function renderStatusContextSegment(state, compact) {
7858
+ const usage = resolveContextUsage({
7859
+ tokens: state.turnTokens,
7860
+ fallbackContextWindow: state.contextWindow,
7861
+ estimatedContextTokens: state.estimatedContextTokens,
7862
+ turnEstimatedTokens: state.liveTurnEstimatedTokens
7863
+ });
7864
+ if (usage.used === void 0 || usage.contextWindow === void 0) {
7865
+ return "ctx \u2014";
7866
+ }
7867
+ const pct = Math.min(100, usage.pct ?? 0);
7868
+ const pctText = pct > 0 && pct < 10 ? pct.toFixed(1) : Math.round(pct).toString();
7869
+ if (compact) return `ctx ${pctText}%`;
7870
+ return `ctx ${pctText}% \xB7 ${formatTokenCount(usage.used)}/${formatTokenCount(usage.contextWindow)}`;
7871
+ }
7845
7872
  function resolveStatusLineCredits(state) {
7846
7873
  const base = state.dialogCreditsBase;
7847
7874
  const session = state.sessionCredits;
@@ -7867,57 +7894,141 @@ function renderStatusLine(state, maxWidth) {
7867
7894
  const untrackedText = untracked > 0 ? ` ${themeText(`?${untracked}`, "muted", colorEnabled)}` : "";
7868
7895
  parts.push(`${branchText}${modifiedText}${untrackedText}`);
7869
7896
  }
7897
+ const contextFull = renderStatusContextSegment(state, false);
7898
+ const contextCompact = renderStatusContextSegment(state, true);
7899
+ let contextPart = themeText(contextFull, "muted", colorEnabled);
7900
+ parts.push(contextPart);
7870
7901
  const credits = resolveStatusLineCredits(state);
7871
7902
  const creditsSegment = credits !== void 0 && credits > 0 ? themeText(formatCreditsChip(credits), "muted", colorEnabled) : "";
7872
7903
  if (creditsSegment) parts.push(creditsSegment);
7873
7904
  const pendingProcessCount = state.pendingProcessNotices?.length ?? 0;
7874
7905
  if (pendingProcessCount > 0) {
7875
- parts.push(themeText(`\u2699 ${pendingProcessCount} finished`, "info", colorEnabled));
7906
+ parts.push(themeText(`\u21AA ${pendingProcessCount} pending`, "info", colorEnabled));
7876
7907
  }
7877
7908
  if (state.autoConfirm === true) {
7878
7909
  parts.push(themeText("\u23F5 auto", "warning", colorEnabled));
7879
7910
  }
7911
+ let surface = colorEnabled ? surfaceBackgroundSequence() : "";
7912
+ let padWidth = surface ? 2 : 0;
7913
+ if (maxWidth && maxWidth > 0 && maxWidth <= padWidth) {
7914
+ surface = "";
7915
+ padWidth = 0;
7916
+ }
7917
+ let agentPart = agentSegment;
7918
+ let creditsPart = creditsSegment;
7880
7919
  let visibleParts = parts;
7881
7920
  if (maxWidth && maxWidth > 0) {
7882
- const widthOf = (segments) => displayWidth(stripAnsi(segments.join(" \xB7 "))) + 2;
7883
- for (const optional of [cwdSegment, agentSegment, creditsSegment]) {
7884
- if (!optional) continue;
7885
- if (widthOf(visibleParts) <= maxWidth) break;
7886
- visibleParts = visibleParts.filter((part) => part !== optional);
7921
+ const widthOf = (segments) => displayWidth(stripAnsi(segments.join(" \xB7 "))) + padWidth;
7922
+ if (contextFull !== contextCompact && widthOf(visibleParts) > maxWidth) {
7923
+ const contextIndex = visibleParts.indexOf(contextPart);
7924
+ if (contextIndex >= 0) {
7925
+ contextPart = themeText(contextCompact, "muted", colorEnabled);
7926
+ visibleParts = visibleParts.with(contextIndex, contextPart);
7927
+ }
7928
+ }
7929
+ if (widthOf(visibleParts) > maxWidth) {
7930
+ visibleParts = visibleParts.filter((part) => part !== cwdSegment);
7931
+ }
7932
+ if (widthOf(visibleParts) > maxWidth) {
7933
+ const agentIndex = visibleParts.indexOf(agentPart);
7934
+ if (agentIndex >= 0) {
7935
+ const othersWidth = widthOf(visibleParts.filter((part) => part !== agentPart));
7936
+ const nameBudget = maxWidth - othersWidth - 3 - displayWidth("\u2726 ") - displayWidth(modeSuffix);
7937
+ const shortName = truncateToWidth(state.agentName, nameBudget);
7938
+ if (shortName) {
7939
+ agentPart = themeText(`\u2726 ${shortName}${modeSuffix}`, "accent", colorEnabled);
7940
+ visibleParts = visibleParts.with(agentIndex, agentPart);
7941
+ }
7942
+ }
7943
+ }
7944
+ if (widthOf(visibleParts) > maxWidth) {
7945
+ visibleParts = visibleParts.filter((part) => part !== agentPart);
7946
+ }
7947
+ if (widthOf(visibleParts) > maxWidth) {
7948
+ visibleParts = visibleParts.filter((part) => part !== contextPart);
7949
+ }
7950
+ if (widthOf(visibleParts) > maxWidth && creditsPart) {
7951
+ const creditsIndex = visibleParts.indexOf(creditsPart);
7952
+ if (creditsIndex >= 0) {
7953
+ creditsPart = themeText(
7954
+ formatCreditsChip(credits ?? 0, { compact: true }),
7955
+ "muted",
7956
+ colorEnabled
7957
+ );
7958
+ visibleParts = visibleParts.with(creditsIndex, creditsPart);
7959
+ }
7887
7960
  }
7888
7961
  if (widthOf(visibleParts) > maxWidth && state.gitStatus) {
7889
7962
  const gitIndex = visibleParts.findIndex((part) => stripAnsi(part).startsWith("\u2442 "));
7890
7963
  if (gitIndex >= 0) {
7891
- const { modified, untracked } = state.gitStatus;
7892
- const compactDirty = themeText(
7893
- `\u2442${modified > 0 ? ` *${modified}` : ""}${untracked > 0 ? ` ?${untracked}` : ""}`,
7894
- "warning",
7895
- colorEnabled
7964
+ const { branch, modified, untracked } = state.gitStatus;
7965
+ const dirtyText = `${modified > 0 ? ` *${modified}` : ""}${untracked > 0 ? ` ?${untracked}` : ""}`;
7966
+ const othersWidth = widthOf(
7967
+ visibleParts.filter((part) => part !== visibleParts[gitIndex])
7896
7968
  );
7897
- visibleParts = visibleParts.with(gitIndex, compactDirty);
7969
+ const branchBudget = maxWidth - othersWidth - 3 - displayWidth("\u2442 ") - displayWidth(dirtyText);
7970
+ const shortBranch = truncateToWidth(branch, branchBudget);
7971
+ if (shortBranch) {
7972
+ const branchText = themeText(`\u2442 ${shortBranch}`, "warning", colorEnabled);
7973
+ const modifiedText = modified > 0 ? ` ${themeText(`*${modified}`, "danger", colorEnabled)}` : "";
7974
+ const untrackedText = untracked > 0 ? ` ${themeText(`?${untracked}`, "muted", colorEnabled)}` : "";
7975
+ visibleParts = visibleParts.with(
7976
+ gitIndex,
7977
+ `${branchText}${modifiedText}${untrackedText}`
7978
+ );
7979
+ } else {
7980
+ const compactDirty = themeText(`\u2442${dirtyText}`, "warning", colorEnabled);
7981
+ visibleParts = visibleParts.with(gitIndex, compactDirty);
7982
+ }
7898
7983
  }
7899
7984
  }
7900
7985
  if (widthOf(visibleParts) > maxWidth) {
7901
- const emergency = [];
7902
- if (state.autoConfirm === true) {
7903
- emergency.push(themeText("\u23F5", "warning", colorEnabled));
7904
- }
7905
- if (state.gitStatus) {
7906
- const { modified, untracked } = state.gitStatus;
7907
- emergency.push(themeText(
7908
- `\u2442${modified > 0 ? `*${modified}` : ""}${untracked > 0 ? `?${untracked}` : ""}`,
7909
- "warning",
7910
- colorEnabled
7911
- ));
7912
- }
7913
- if (creditsSegment) {
7914
- emergency.push(themeText(formatCreditsChip(credits ?? 0, { compact: true }), "muted", colorEnabled));
7915
- }
7916
- visibleParts = [emergency.join(" ")];
7986
+ const budget = maxWidth - padWidth;
7987
+ const autoMark = state.autoConfirm === true ? themeText("\u23F5", "warning", colorEnabled) : "";
7988
+ const gitCounts = state.gitStatus ? themeText(
7989
+ `\u2442${state.gitStatus.modified > 0 ? `*${state.gitStatus.modified}` : ""}${state.gitStatus.untracked > 0 ? `?${state.gitStatus.untracked}` : ""}`,
7990
+ "warning",
7991
+ colorEnabled
7992
+ ) : "";
7993
+ const gitMark = state.gitStatus ? themeText(
7994
+ `\u2442${state.gitStatus.modified > 0 ? "*" : ""}${state.gitStatus.untracked > 0 ? "?" : ""}`,
7995
+ "warning",
7996
+ colorEnabled
7997
+ ) : "";
7998
+ const noticeFull = pendingProcessCount > 0 ? themeText(`\u21AA${pendingProcessCount}`, "info", colorEnabled) : "";
7999
+ const noticeMark = pendingProcessCount > 0 ? themeText("\u21AA", "info", colorEnabled) : "";
8000
+ const creditsFull = creditsSegment ? themeText(
8001
+ formatCreditsChip(credits ?? 0, { compact: true }),
8002
+ "muted",
8003
+ colorEnabled
8004
+ ) : "";
8005
+ const creditsMark = creditsSegment ? themeText("\u26A1\u2026", "muted", colorEnabled) : "";
8006
+ const stages = [
8007
+ [autoMark, gitCounts, noticeFull, creditsFull],
8008
+ [autoMark, gitMark, noticeFull, creditsFull],
8009
+ [autoMark, gitMark, noticeMark, creditsFull],
8010
+ [autoMark, noticeMark, creditsFull],
8011
+ [autoMark, creditsFull],
8012
+ [autoMark, creditsMark],
8013
+ // `autoMark` alone is only an honest projection when nothing was omitted.
8014
+ // With a fee on the line, dropping it silently would claim "no cost".
8015
+ ...creditsSegment ? [] : [[autoMark]]
8016
+ ].map((stage) => stage.filter(Boolean)).filter((stage) => stage.length > 0);
8017
+ const fitted = stages.find(
8018
+ (stage) => displayWidth(stripAnsi(stage.join(" "))) <= budget
8019
+ );
8020
+ const autoWidth = displayWidth(stripAnsi(autoMark));
8021
+ const overflowMark = autoMark && autoWidth + displayWidth("\u2026") <= budget ? `${autoMark}\u2026` : budget >= 1 ? "\u2026" : "";
8022
+ visibleParts = fitted ? [fitted.join(" ")] : [overflowMark];
8023
+ }
8024
+ }
8025
+ let body = visibleParts.join(sep);
8026
+ if (maxWidth && maxWidth > 0) {
8027
+ const budget = Math.max(0, maxWidth - padWidth);
8028
+ if (displayWidth(stripAnsi(body)) > budget) {
8029
+ body = budget >= 2 ? truncateToWidth(stripAnsi(body), budget) : budget >= 1 ? "\u2026" : "";
7917
8030
  }
7918
8031
  }
7919
- const body = visibleParts.join(sep);
7920
- const surface = colorEnabled ? surfaceBackgroundSequence() : "";
7921
8032
  if (!surface) return body;
7922
8033
  return `${surface} ${body} \x1B[49m`;
7923
8034
  }
@@ -9316,15 +9427,21 @@ function buildProcessTaskCompletedTurnEvent(notice) {
9316
9427
  };
9317
9428
  }
9318
9429
  var PENDING_NOTICE_PREFIX = "process-notice-v1:";
9319
- function serializePendingProcessNotice(notice) {
9320
- return notice.resultCapsule ? `${PENDING_NOTICE_PREFIX}${JSON.stringify(notice)}` : formatProcessTerminalWakeLine(notice);
9430
+ function serializePendingProcessNotice(notice, ownerDialogId) {
9431
+ const withOwner = { ...notice, ownerDialogId: ownerDialogId ?? null };
9432
+ return `${PENDING_NOTICE_PREFIX}${JSON.stringify(withOwner)}`;
9321
9433
  }
9322
9434
  function parsePendingProcessNoticeLine(line) {
9323
9435
  if (line.startsWith(PENDING_NOTICE_PREFIX)) {
9324
9436
  try {
9325
9437
  const parsed = JSON.parse(line.slice(PENDING_NOTICE_PREFIX.length));
9326
- if (parsed && typeof parsed.taskId === "string" && parsed.resultCapsule) {
9327
- return parsed;
9438
+ if (parsed && typeof parsed.taskId === "string") {
9439
+ const { ownerDialogId, ...rest } = parsed;
9440
+ return {
9441
+ ...rest,
9442
+ // 类型校验:只有非空字符串才是可信归属,其他形状一律降级为未知。
9443
+ ownerDialogId: typeof ownerDialogId === "string" && ownerDialogId.length > 0 ? ownerDialogId : null
9444
+ };
9328
9445
  }
9329
9446
  } catch {
9330
9447
  }
@@ -9338,7 +9455,8 @@ function parsePendingProcessNoticeLine(line) {
9338
9455
  pid: 0,
9339
9456
  label: "",
9340
9457
  command: line,
9341
- status: "failed"
9458
+ status: "failed",
9459
+ ownerDialogId: null
9342
9460
  };
9343
9461
  }
9344
9462
  const [, taskId, rawLabel, status, rawExit] = taskMatch;
@@ -9349,9 +9467,19 @@ function parsePendingProcessNoticeLine(line) {
9349
9467
  label,
9350
9468
  command: "",
9351
9469
  status: normalizeStatus(status),
9470
+ ownerDialogId: null,
9352
9471
  ...rawExit !== void 0 ? { exitCode: Number(rawExit) } : {}
9353
9472
  };
9354
9473
  }
9474
+ function annotatePendingProcessNoticeOrigin(notice, currentDialogId) {
9475
+ const withOrigin = (origin) => ({
9476
+ ...notice,
9477
+ label: notice.label.trim() ? `${origin} ${notice.label}` : origin
9478
+ });
9479
+ if (notice.ownerDialogId == null) return withOrigin("[\u5F52\u5C5E\u672A\u77E5]");
9480
+ if (notice.ownerDialogId === currentDialogId) return notice;
9481
+ return withOrigin(`[\u6765\u81EA\u53E6\u4E00\u5BF9\u8BDD ${notice.ownerDialogId}\uFF0C\u4E0D\u4EE3\u8868\u5F53\u524D\u4EFB\u52A1]`);
9482
+ }
9355
9483
  function unescapeLabel(raw) {
9356
9484
  return raw.replace(/\\(["\\])/g, "$1");
9357
9485
  }
@@ -11629,7 +11757,14 @@ async function runAgentChat(scriptDir, state, message, env, output, agentRunner
11629
11757
  const injectedProcessNoticeLines = state.pendingProcessNotices ? [...state.pendingProcessNotices] : [];
11630
11758
  const processNoticeBlocks = injectedProcessNoticeLines.length > 0 ? [{
11631
11759
  content: buildProcessTerminalTurnMessage(
11632
- injectedProcessNoticeLines.map(parsePendingProcessNoticeLine)
11760
+ injectedProcessNoticeLines.map(
11761
+ (line) => annotatePendingProcessNoticeOrigin(
11762
+ parsePendingProcessNoticeLine(line),
11763
+ // 本函数的 state 即当前 session 状态;首轮尚未回填 dialogId
11764
+ // 时为 undefined(标注侧按「不冒充当前任务」处理)。
11765
+ state.dialogId
11766
+ )
11767
+ )
11633
11768
  ),
11634
11769
  cacheScope: "turn"
11635
11770
  }] : [];
@@ -13569,11 +13704,20 @@ async function compactDialog(options) {
13569
13704
  extractedKeys.add(key);
13570
13705
  }
13571
13706
  }
13707
+ const sourceMeta = await computeSummarySourceMetadata(
13708
+ allMsgs,
13709
+ plan.newSummarizedBeforeId
13710
+ );
13572
13711
  await patchDialog(fetchImpl, options.serverUrl, options.authToken, dialogKey, {
13573
13712
  summary: newSummary.trim(),
13574
13713
  summarizedBeforeId: plan.newSummarizedBeforeId,
13575
13714
  compressionCount: compressionCount + 1,
13576
- referenceKeys: Array.from(extractedKeys)
13715
+ referenceKeys: Array.from(extractedKeys),
13716
+ ...sourceMeta ? {
13717
+ sourceHash: sourceMeta.sourceHash,
13718
+ sourceCount: sourceMeta.sourceCount,
13719
+ schemaVersion: sourceMeta.schemaVersion
13720
+ } : {}
13577
13721
  });
13578
13722
  current.referenceKeys = Array.from(extractedKeys);
13579
13723
  summaryGenerated = true;
@@ -14873,7 +15017,8 @@ async function runTuiWorkspace(options) {
14873
15017
  const deployWakeLifecycle = { dispose: null };
14874
15018
  const pushPendingProcessNotice = (notice) => {
14875
15019
  if (sessionEnded) return;
14876
- const line = serializePendingProcessNotice(notice);
15020
+ const ownerDialogId = getProcessRegistry().getByTaskId(notice.taskId)?.owner?.dialogId ?? null;
15021
+ const line = serializePendingProcessNotice(notice, ownerDialogId);
14877
15022
  state = {
14878
15023
  ...state,
14879
15024
  pendingProcessNotices: [...state.pendingProcessNotices ?? [], line]
@@ -2,7 +2,7 @@ import {
2
2
  fetchAgentContexts,
3
3
  responsesJsonToChatCompletions,
4
4
  updateAgentTokens
5
- } from "./chunk-CYJWI3NH.js";
5
+ } from "./chunk-AHYBQP3M.js";
6
6
  import {
7
7
  generateRequestBody,
8
8
  performFetchRequest,
@@ -10,21 +10,21 @@ import {
10
10
  resolveClientWire,
11
11
  sanitizeOutboundBody,
12
12
  stripModelToolArgs
13
- } from "./chunk-BJEZC5RA.js";
13
+ } from "./chunk-6LIKQYG4.js";
14
14
  import "./chunk-W4S6OTSC.js";
15
15
  import "./chunk-HS7MLR74.js";
16
16
  import {
17
17
  findToolExecutor
18
- } from "./chunk-3T4ZG6AC.js";
18
+ } from "./chunk-PPU323UE.js";
19
19
  import "./chunk-JKMLSTZK.js";
20
20
  import "./chunk-I2ZMGXXF.js";
21
21
  import "./chunk-OXME3PEE.js";
22
22
  import {
23
23
  mergeReferences
24
- } from "./chunk-RN2GPWN6.js";
24
+ } from "./chunk-T5BHHWA5.js";
25
25
  import {
26
26
  getToolResultErrorData
27
- } from "./chunk-ROCUB2H2.js";
27
+ } from "./chunk-EHFS4XZO.js";
28
28
  import "./chunk-NF64D32W.js";
29
29
  import "./chunk-XPWGOTBQ.js";
30
30
  import "./chunk-ZIWPQEFU.js";
@@ -35,18 +35,18 @@ import "./chunk-IA7TRNNR.js";
35
35
  import "./chunk-AGIM7IMJ.js";
36
36
  import "./chunk-63W5N6P3.js";
37
37
  import "./chunk-VF4K2QE6.js";
38
- import "./chunk-626KHJNX.js";
38
+ import "./chunk-KMM2X7LP.js";
39
39
  import "./chunk-ILU2NPWY.js";
40
- import "./chunk-AG7MCDLR.js";
40
+ import "./chunk-XCA6HQGS.js";
41
41
  import "./chunk-F32Z66T4.js";
42
42
  import "./chunk-EYWJT7A2.js";
43
- import "./chunk-AJ3G7X2K.js";
44
- import "./chunk-U5ICMAFV.js";
43
+ import "./chunk-OFVFQYIE.js";
44
+ import "./chunk-PFBIXTFB.js";
45
45
  import "./chunk-523DITKR.js";
46
46
  import "./chunk-UKZX3NHN.js";
47
47
  import "./chunk-OFFL4DCR.js";
48
48
  import "./chunk-QYPE3TS3.js";
49
- import "./chunk-DFDXM2Y4.js";
49
+ import "./chunk-LC23WBCU.js";
50
50
  import "./chunk-4JH2UMJR.js";
51
51
  import "./chunk-ZJ7UHBJS.js";
52
52
  import "./chunk-BYXBJQAS.js";
@@ -86,11 +86,11 @@ import "./chunk-GKXCHNTE.js";
86
86
  import "./chunk-WD4XYDYC.js";
87
87
  import {
88
88
  convertMessagesToResponsesInput
89
- } from "./chunk-3SZA4U64.js";
89
+ } from "./chunk-HL3O3PCQ.js";
90
90
  import "./chunk-QLQ573SU.js";
91
91
  import "./chunk-3MZAGMYY.js";
92
- import "./chunk-6CCFTVBP.js";
93
- import "./chunk-BPMPOFWP.js";
92
+ import "./chunk-DTODXBHK.js";
93
+ import "./chunk-4PXHOOFA.js";
94
94
  import "./chunk-5MMAK75Q.js";
95
95
  import "./chunk-DWLEOOGR.js";
96
96
  import "./chunk-LIQJTQRN.js";
@@ -20,26 +20,26 @@ import {
20
20
  resolveFileCategory
21
21
  } from "./chunk-3PVYUPXK.js";
22
22
  import "./chunk-D2MDMY2M.js";
23
- import "./chunk-AUIJZACN.js";
23
+ import "./chunk-BNDETALN.js";
24
24
  import "./chunk-GQV5KHJU.js";
25
25
  import "./chunk-ZNFJWEN4.js";
26
- import "./chunk-LGN377P3.js";
26
+ import "./chunk-DYYMIUN4.js";
27
27
  import "./chunk-HNUWUO75.js";
28
28
  import "./chunk-CHOZJMJS.js";
29
29
  import "./chunk-PWTNI4N7.js";
30
- import "./chunk-UOKFKFPO.js";
30
+ import "./chunk-HSJPKBLC.js";
31
31
  import "./chunk-5ZUL4CUO.js";
32
32
  import "./chunk-GCKHQECX.js";
33
33
  import "./chunk-G6OOUQWJ.js";
34
34
  import "./chunk-56GBUMO5.js";
35
35
  import "./chunk-WJZOQR2J.js";
36
36
  import "./chunk-WD4XYDYC.js";
37
- import "./chunk-3SZA4U64.js";
37
+ import "./chunk-HL3O3PCQ.js";
38
38
  import "./chunk-QLQ573SU.js";
39
39
  import "./chunk-3MZAGMYY.js";
40
40
  import "./chunk-2MBTWINN.js";
41
- import "./chunk-6CCFTVBP.js";
42
- import "./chunk-BPMPOFWP.js";
41
+ import "./chunk-DTODXBHK.js";
42
+ import "./chunk-4PXHOOFA.js";
43
43
  import "./chunk-5MMAK75Q.js";
44
44
  import "./chunk-DWLEOOGR.js";
45
45
  import "./chunk-LIQJTQRN.js";
@@ -18,7 +18,7 @@ import {
18
18
  resolveTurnToolContext,
19
19
  trimMessagesWithSummary,
20
20
  validateAccessAndBalance
21
- } from "./chunk-PIDUNDFS.js";
21
+ } from "./chunk-VNP54NZL.js";
22
22
  import "./chunk-KFHQQ3NO.js";
23
23
  import {
24
24
  filterAndCleanMessages,
@@ -27,11 +27,11 @@ import {
27
27
  readStreamChunk,
28
28
  sendOpenAICompletionsRequest,
29
29
  updateTotalUsage
30
- } from "./chunk-VWW6O2TL.js";
30
+ } from "./chunk-XTWDF6RU.js";
31
31
  import "./chunk-JEXVIMYZ.js";
32
32
  import {
33
33
  prepareTools
34
- } from "./chunk-V4EE3D54.js";
34
+ } from "./chunk-MZHOLWW5.js";
35
35
  import {
36
36
  INVALID_TOOL_ARGS_REPLACEMENT,
37
37
  buildInvalidToolCallSelfHealResult,
@@ -44,10 +44,10 @@ import {
44
44
  sanitizeOutboundResponsesInput,
45
45
  selectResponsesConversationState,
46
46
  updateResponsesConversationState
47
- } from "./chunk-BJEZC5RA.js";
47
+ } from "./chunk-6LIKQYG4.js";
48
48
  import "./chunk-W4S6OTSC.js";
49
49
  import "./chunk-HS7MLR74.js";
50
- import "./chunk-3T4ZG6AC.js";
50
+ import "./chunk-PPU323UE.js";
51
51
  import {
52
52
  isOwnedAgentRecord,
53
53
  resolveBillingSource
@@ -58,12 +58,12 @@ import {
58
58
  isContextOverflowText,
59
59
  parseApiError,
60
60
  performServerProxyFetchWithRetry
61
- } from "./chunk-RN2GPWN6.js";
61
+ } from "./chunk-T5BHHWA5.js";
62
62
  import {
63
63
  createSSEParser,
64
64
  selectMaxExecutionTime,
65
65
  waitForAbortableDelay
66
- } from "./chunk-ROCUB2H2.js";
66
+ } from "./chunk-EHFS4XZO.js";
67
67
  import "./chunk-NF64D32W.js";
68
68
  import "./chunk-XPWGOTBQ.js";
69
69
  import "./chunk-ZIWPQEFU.js";
@@ -79,12 +79,12 @@ import "./chunk-IA7TRNNR.js";
79
79
  import "./chunk-AGIM7IMJ.js";
80
80
  import "./chunk-63W5N6P3.js";
81
81
  import "./chunk-VF4K2QE6.js";
82
- import "./chunk-626KHJNX.js";
82
+ import "./chunk-KMM2X7LP.js";
83
83
  import "./chunk-ILU2NPWY.js";
84
- import "./chunk-AG7MCDLR.js";
84
+ import "./chunk-XCA6HQGS.js";
85
85
  import "./chunk-F32Z66T4.js";
86
86
  import "./chunk-EYWJT7A2.js";
87
- import "./chunk-AJ3G7X2K.js";
87
+ import "./chunk-OFVFQYIE.js";
88
88
  import {
89
89
  addToolMessage,
90
90
  addUserMessage,
@@ -101,14 +101,14 @@ import {
101
101
  selectDialogConfigByKey,
102
102
  updateTokens,
103
103
  updateToolMessage
104
- } from "./chunk-U5ICMAFV.js";
104
+ } from "./chunk-PFBIXTFB.js";
105
105
  import "./chunk-523DITKR.js";
106
106
  import {
107
107
  isOAuthApiKeyRef
108
108
  } from "./chunk-UKZX3NHN.js";
109
109
  import "./chunk-OFFL4DCR.js";
110
110
  import "./chunk-QYPE3TS3.js";
111
- import "./chunk-DFDXM2Y4.js";
111
+ import "./chunk-LC23WBCU.js";
112
112
  import "./chunk-4JH2UMJR.js";
113
113
  import {
114
114
  getCurrentSpaceId
@@ -177,7 +177,7 @@ import {
177
177
  buildDesktopAgentRuntimeDialogHistorySnapshot,
178
178
  resolveAgentContextWindow,
179
179
  stripImagePartsForTextOnlyAgent
180
- } from "./chunk-UOKFKFPO.js";
180
+ } from "./chunk-HSJPKBLC.js";
181
181
  import "./chunk-5ZUL4CUO.js";
182
182
  import "./chunk-GCKHQECX.js";
183
183
  import {
@@ -190,15 +190,15 @@ import {
190
190
  extractImagePartsFromResponseOutput,
191
191
  extractTextFromResponseOutput,
192
192
  toResponsesTools
193
- } from "./chunk-3SZA4U64.js";
193
+ } from "./chunk-HL3O3PCQ.js";
194
194
  import {
195
195
  resolveRuntimeToolSurfaceForAgent
196
196
  } from "./chunk-QLQ573SU.js";
197
197
  import "./chunk-3MZAGMYY.js";
198
- import "./chunk-6CCFTVBP.js";
198
+ import "./chunk-DTODXBHK.js";
199
199
  import {
200
200
  getModelInfo
201
- } from "./chunk-BPMPOFWP.js";
201
+ } from "./chunk-4PXHOOFA.js";
202
202
  import "./chunk-5MMAK75Q.js";
203
203
  import "./chunk-DWLEOOGR.js";
204
204
  import "./chunk-LIQJTQRN.js";