@chatcode/chatcode-cli 3.0.2-rc.3 → 3.0.2-rc.5

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 (46) hide show
  1. package/README.i18n.yaml +4 -4
  2. package/README.md +10 -0
  3. package/README.zh.md +10 -0
  4. package/lib/bin.js +11 -67
  5. package/lib/{command-errors-CIYn1nnW.js → command-errors-B-jCwfLt.js} +12 -12
  6. package/lib/{command-trees-8o99Bws7.js → command-trees-CdgUsoW4.js} +2 -2
  7. package/lib/{component-identity-CnmIKHEF.js → component-identity-ax93NpoH.js} +3 -3
  8. package/lib/{dump-config-BSTrhTT_.js → dump-config-CauO75nE.js} +1 -1
  9. package/lib/dump-config-CijLv_kn.js +2 -0
  10. package/lib/{dump-config-schema-Cz4A13GB.js → dump-config-schema-CObLWWaW.js} +2 -2
  11. package/lib/{extension-events-DciGPKJa.js → extension-events-DJTP1cCG.js} +20 -20
  12. package/lib/{home-migration-DLaSvmfn.js → home-migration-BjDmRwBB.js} +23 -4
  13. package/lib/{host-access-CmD27uhQ.js → host-access-D3lpiaUY.js} +1 -1
  14. package/lib/{keymap-CFChEJ2W.js → keymap-DAr6MX8m.js} +2 -2
  15. package/lib/{plugin-ChwScT9e.js → plugin-BGw2QmPK.js} +1357 -680
  16. package/lib/{plugin-DYHtreEd.js → plugin-Cn-hyYY8.js} +1 -1
  17. package/lib/{profile-boot-Blq7uqhx.js → profile-boot-SJGbpLgN.js} +13 -1
  18. package/lib/profile-boot.js +1 -1
  19. package/lib/{scenes-ai_8sHDs.js → scenes-BeuL5ow2.js} +3 -3
  20. package/lib/{settings-sections-QQ1-2lhL.js → settings-sections-dGk8gNU7.js} +3 -3
  21. package/lib/startup-diagnostics-C_hRCp-q.js +91 -0
  22. package/lib/{themes-DTzG_9I_.js → themes-O-UQAfC7.js} +12 -12
  23. package/lib/tui-compat-command-trees.js +1 -1
  24. package/lib/tui-compat-extensions.js +3 -3
  25. package/lib/tui-compat-plugin-host.js +5 -5
  26. package/lib/tui-compat-scenes.js +1 -1
  27. package/lib/tui-compat-settings-sections.js +1 -1
  28. package/lib/tui-compat-working-activity.js +1 -1
  29. package/lib/tui-compat-workspaces.js +1 -1
  30. package/lib/tui-compat.js +41 -9
  31. package/lib/{tuiDisplayPrefs-BCHRRcfe.js → tuiDisplayPrefs-DdU4O_sF.js} +44 -2
  32. package/lib/types/home-migration.d.ts +8 -0
  33. package/lib/types/startup-diagnostics.d.ts +13 -0
  34. package/lib/types/tui-compat.d.ts +2 -0
  35. package/lib/{workspaces-CznCgVHv.js → workspaces-CE18wA21.js} +2 -2
  36. package/package.json +29 -29
  37. package/runtime/manifest.json +1 -1
  38. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
  39. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
  40. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  41. package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/index.js +84 -8
  42. package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/types/region.d.ts +9 -0
  43. package/runtime/node_modules/@deepseek-ai/dsh-compaction-basic/lib/types/summarizer.d.ts +7 -0
  44. package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +3 -4
  45. package/runtime/node_modules/@deepseek-ai/dsh-session-log-export/lib/types/client/HeaderAction.d.ts +1 -1
  46. package/lib/dump-config-DBW7YLx-.js +0 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chatcode/chatcode-cli",
3
3
  "description": "ChatCode CLI: TUI-first coding agent, Web launcher, profiles, and legacy DSH-compatible plugins",
4
- "version": "3.0.2-rc.3",
4
+ "version": "3.0.2-rc.5",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -30,12 +30,12 @@
30
30
  "@babel/code-frame": "^7.29.0",
31
31
  "@chatcode/cco-better-sidebar": "0.18.0-rc.3",
32
32
  "@chatcode/cco-builtin-browser": "0.1.21",
33
- "@chatcode/cco-chat-import": "0.14.1",
34
- "@chatcode/cco-llm-chatcode-config": "0.1.4-rc.2",
33
+ "@chatcode/cco-chat-import": "0.15.0",
34
+ "@chatcode/cco-llm-chatcode-config": "0.1.4-rc.4",
35
35
  "@chatcode/cco-market": "1.45.2-rc.3",
36
- "@chatcode/cco-tui": "0.10.0-rc.9",
36
+ "@chatcode/cco-tui": "0.10.0-rc.14",
37
37
  "@deepseek-ai/libreoffice-kit": "^0.1.1",
38
- "@deepseek-harness-tui/dsh-tui": "npm:@chatcode/cco-tui@0.10.0-rc.9",
38
+ "@deepseek-harness-tui/dsh-tui": "npm:@chatcode/cco-tui@0.10.0-rc.14",
39
39
  "@earendil-works/pi-ai": "^0.85.1",
40
40
  "@eslint-community/regexpp": "^4.12.2",
41
41
  "@joplin/turndown-plugin-gfm": "^1.0.67",
@@ -59,8 +59,8 @@
59
59
  "diff": "^9.0.0",
60
60
  "dsh-better-sidebar": "npm:@chatcode/cco-better-sidebar@0.18.0-rc.3",
61
61
  "dsh-builtin-browser": "npm:@chatcode/cco-builtin-browser@0.1.21",
62
- "dsh-chat-import": "npm:@chatcode/cco-chat-import@0.14.1",
63
- "dsh-llm-chatcode-config": "npm:@chatcode/cco-llm-chatcode-config@0.1.4-rc.2",
62
+ "dsh-chat-import": "npm:@chatcode/cco-chat-import@0.15.0",
63
+ "dsh-llm-chatcode-config": "npm:@chatcode/cco-llm-chatcode-config@0.1.4-rc.4",
64
64
  "dshmarket": "npm:@chatcode/cco-market@1.45.2-rc.3",
65
65
  "eventsource-parser": "^3.1.0",
66
66
  "execa": "^10.0.0",
@@ -93,47 +93,47 @@
93
93
  "ajv": "^8.20.0",
94
94
  "execa": "^10.0.0",
95
95
  "ws": "8.21.0",
96
+ "@deepseek-ai/dsh-attachment-local": "0.1.7-rc.2",
96
97
  "@deepseek-ai/dsh-acp": "0.1.7-rc.2",
97
98
  "@deepseek-ai/dsh-agent": "0.1.7-rc.2",
98
- "@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-rc.2",
99
- "@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.1.7-rc.2",
99
+ "@deepseek-ai/dsh-agent-loop": "0.1.7-rc.2",
100
100
  "@deepseek-ai/dsh-bash-local": "0.1.7-rc.2",
101
- "@deepseek-ai/dsh-attachment-local": "0.1.7-rc.2",
101
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-rc.2",
102
102
  "@deepseek-ai/dsh-experimental-agent-team": "0.1.7-rc.2",
103
- "@deepseek-ai/dsh-experimental-tool-agent-team": "0.1.7-rc.2",
104
- "@deepseek-ai/dsh-agent-loop": "0.1.7-rc.2",
103
+ "@deepseek-ai/dsh-credentials-local": "0.1.7-rc.2",
104
+ "@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.1.7-rc.2",
105
105
  "@deepseek-ai/dsh-experimental-ptc-runtime-python": "0.1.7-rc.2",
106
+ "@deepseek-ai/dsh-experimental-tool-agent-team": "0.1.7-rc.2",
106
107
  "@deepseek-ai/dsh-fs-observation-policy": "0.1.7-rc.2",
108
+ "@deepseek-ai/dsh-llm": "0.1.7-rc.2",
107
109
  "@deepseek-ai/dsh-fs-sandbox": "0.1.7-rc.2",
108
- "@deepseek-ai/dsh-host-frontend-static": "0.1.7-rc.2",
110
+ "@deepseek-ai/dsh-llm-deepseek": "0.1.7-rc.2",
109
111
  "@deepseek-ai/dsh-host-webserver": "0.1.7-rc.2",
110
- "@deepseek-ai/dsh-llm": "0.1.7-rc.2",
111
- "@deepseek-ai/dsh-credentials-local": "0.1.7-rc.2",
112
- "@deepseek-ai/dsh-llm-pi-ai": "0.1.7-rc.2",
112
+ "@deepseek-ai/dsh-host-frontend-static": "0.1.7-rc.2",
113
113
  "@deepseek-ai/dsh-llm-deepseek-api-key": "0.1.7-rc.2",
114
- "@deepseek-ai/dsh-llm-deepseek": "0.1.7-rc.2",
115
- "@deepseek-ai/dsh-llm-mock-server": "0.1.7-rc.2",
116
114
  "@deepseek-ai/dsh-llm-deepseek-account": "0.1.7-rc.2",
117
- "@deepseek-ai/dsh-loader-smoke": "0.1.7-rc.2",
115
+ "@deepseek-ai/dsh-llm-mock-server": "0.1.7-rc.2",
118
116
  "@deepseek-ai/dsh-llm-replay": "0.1.7-rc.2",
119
- "@deepseek-ai/dsh-plugin-package-inventory-deepseek": "0.1.7-rc.2",
120
- "@deepseek-ai/dsh-sandbox-local": "0.1.7-rc.2",
121
- "@deepseek-ai/dsh-session": "0.1.7-rc.2",
117
+ "@deepseek-ai/dsh-loader-smoke": "0.1.7-rc.2",
122
118
  "@deepseek-ai/dsh-sandbox-policy": "0.1.7-rc.2",
123
- "@deepseek-ai/dsh-session-log-deepseek": "0.1.7-rc.2",
119
+ "@deepseek-ai/dsh-plugin-package-inventory-deepseek": "0.1.7-rc.2",
120
+ "@deepseek-ai/dsh-llm-pi-ai": "0.1.7-rc.2",
124
121
  "@deepseek-ai/dsh-sdk-client": "0.1.7-rc.2",
125
- "@deepseek-ai/dsh-session-checkpoint-policy": "0.1.7-rc.2",
122
+ "@deepseek-ai/dsh-session": "0.1.7-rc.2",
123
+ "@deepseek-ai/dsh-sandbox-local": "0.1.7-rc.2",
124
+ "@deepseek-ai/dsh-session-query": "0.1.7-rc.2",
126
125
  "@deepseek-ai/dsh-session-persistence-jsonl": "0.1.7-rc.2",
126
+ "@deepseek-ai/dsh-session-checkpoint-policy": "0.1.7-rc.2",
127
+ "@deepseek-ai/dsh-shell-env": "0.1.7-rc.2",
127
128
  "@deepseek-ai/dsh-subagent": "0.1.7-rc.2",
128
- "@deepseek-ai/dsh-session-query": "0.1.7-rc.2",
129
129
  "@deepseek-ai/dsh-settings": "0.1.7-rc.2",
130
- "@deepseek-ai/dsh-subagent-fork-in-process": "0.1.7-rc.2",
130
+ "@deepseek-ai/dsh-session-log-deepseek": "0.1.7-rc.2",
131
131
  "@deepseek-ai/dsh-subagent-spawn-in-process": "0.1.7-rc.2",
132
- "@deepseek-ai/dsh-subprocess-local": "0.1.7-rc.2",
133
132
  "@deepseek-ai/dsh-system-prompt": "0.1.7-rc.2",
133
+ "@deepseek-ai/dsh-subprocess-local": "0.1.7-rc.2",
134
134
  "@deepseek-ai/dsh-user-approval": "0.1.7-rc.2",
135
- "@deepseek-ai/dsh-shell-env": "0.1.7-rc.2",
136
- "@deepseek-ai/dsh-tools": "0.1.7-rc.2"
135
+ "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
136
+ "@deepseek-ai/dsh-subagent-fork-in-process": "0.1.7-rc.2"
137
137
  },
138
138
  "exports": {
139
139
  "./headless-compat": {
@@ -281,5 +281,5 @@
281
281
  "@deepseek-ai/schemastery"
282
282
  ],
283
283
  "fileCount": 3555,
284
- "byteCount": 66576975
284
+ "byteCount": 66580738
285
285
  }
@@ -4125,7 +4125,7 @@ window.__ModuleLoader__.load({
4125
4125
  for (const listener of listeners) listener();
4126
4126
  };
4127
4127
  /** @returns the client identity for one account call, read at call time so it carries the language and zone in effect then. */
4128
- const client = () => accountClientMetadata(ctx.locale.getSnapshot().active, "3.0.2-rc.3");
4128
+ const client = () => accountClientMetadata(ctx.locale.getSnapshot().active, "3.0.2-rc.5");
4129
4129
  const notices = createBonusNoticeController({
4130
4130
  ackRetryDelayMs: config.bonusAckRetryDelayMs,
4131
4131
  ackRetryMaxDelayMs: config.bonusAckRetryMaxDelayMs,
@@ -4256,7 +4256,7 @@ window.__ModuleLoader__.load({
4256
4256
  refreshAccount,
4257
4257
  contactUs() {
4258
4258
  const url = contactUrl(config, {
4259
- version: "3.0.2-rc.3",
4259
+ version: "3.0.2-rc.5",
4260
4260
  locale: ctx.locale.getSnapshot().active === "zh" ? "zh-CN" : "en",
4261
4261
  width: window.screen.width,
4262
4262
  height: window.screen.height,
@@ -657,7 +657,7 @@ window.__ModuleLoader__.load({
657
657
  function CurrentVersionRow({ t }) {
658
658
  return (0, react_jsx_runtime.jsx)("div", {
659
659
  className: CurrentVersionRow_module_css_default.row,
660
- children: t("general.currentVersion", { version: "3.0.2-rc.3" })
660
+ children: t("general.currentVersion", { version: "3.0.2-rc.5" })
661
661
  });
662
662
  }
663
663
  //#endregion
@@ -167,7 +167,7 @@ window.__ModuleLoader__.load({
167
167
  const SCROLLBAR_LINGER_MS = 2e3;
168
168
  /** Format complete-build metadata for the local brand badge. */
169
169
  function localBuildVersion() {
170
- return `3.0.2-rc.3-8377529-dirty`;
170
+ return `3.0.2-rc.5-359d1b4-dirty`;
171
171
  }
172
172
  /** Each panel row subscribes only to its own selection state. */
173
173
  function PanelRow({ id, label, wide, usePanelInfo, selectPanel, renderSlot }) {
@@ -233,6 +233,32 @@ function assertRatio(name, value) {
233
233
  /** Tags wrapping the structured summary inside the landed checkpoint node. */
234
234
  const SUMMARY_OPEN_TAG = "<compacted-summary>";
235
235
  const SUMMARY_CLOSE_TAG = "</compacted-summary>";
236
+ /** Smallest checkpoint body that satisfies the summarizer's required section structure. */
237
+ const MINIMUM_SUMMARY_TEXT = [
238
+ "## Primary Request and Intent",
239
+ "- (none)",
240
+ "",
241
+ "## Key Technical Concepts",
242
+ "- (none)",
243
+ "",
244
+ "## Files and Code",
245
+ "- (none)",
246
+ "",
247
+ "## Errors and Fixes",
248
+ "- (none)",
249
+ "",
250
+ "## Pending Jobs",
251
+ "- (none)",
252
+ "",
253
+ "## Current Work",
254
+ "- (none)",
255
+ "",
256
+ "## Next Step",
257
+ "- (none)",
258
+ "",
259
+ "## Critical Context",
260
+ "- (none)"
261
+ ].join("\n");
236
262
  /**
237
263
  * The summarization directive, delivered as the FINAL user message after the
238
264
  * replayed conversation rather than as a distinct summarizer system prompt.
@@ -301,12 +327,14 @@ async function summarizeWithLlm(ctx, config, input, agent, signal) {
301
327
  } : void 0;
302
328
  const target = configured ?? latest ?? agentTarget;
303
329
  if (target === void 0) throw new Error("no provider/model available for summarization: set both BasicCompactionConfig summarization fields, route one request, or set both AgentOptions fields");
330
+ const modelInfo = await ctx.llm.resolveModelInfo(target.provider, target.model, signal);
331
+ const maxTokens = modelInfo.defaultMaxTokens === void 0 ? config.maxTokens : Math.min(config.maxTokens, modelInfo.defaultMaxTokens);
304
332
  const assembler = new BlockAssembler();
305
333
  const messages = [...input.messages, deepFreeze({
306
334
  role: "user",
307
335
  content: [{
308
336
  type: "text",
309
- text: COMPACTION_INSTRUCTION
337
+ text: compactionInstruction(input.summaryTokenBudget)
310
338
  }]
311
339
  })];
312
340
  const options = {
@@ -315,7 +343,7 @@ async function summarizeWithLlm(ctx, config, input, agent, signal) {
315
343
  messages,
316
344
  toolHistory: agent.session.toolHistory(),
317
345
  ...input.tools === void 0 ? {} : { tools: [...input.tools] },
318
- maxTokens: config.maxTokens,
346
+ maxTokens,
319
347
  sessionId: agent.session.id,
320
348
  purpose: "compaction",
321
349
  ...signal === void 0 ? {} : { signal }
@@ -332,7 +360,7 @@ async function summarizeWithLlm(ctx, config, input, agent, signal) {
332
360
  llmStreamCall: true,
333
361
  provider: options.provider,
334
362
  model: options.model,
335
- maxTokens: config.maxTokens,
363
+ maxTokens,
336
364
  ...assembler.usage === void 0 ? {} : { usage: assembler.usage }
337
365
  };
338
366
  }
@@ -354,6 +382,21 @@ function frameSummary(summary) {
354
382
  }
355
383
  ];
356
384
  }
385
+ /**
386
+ * Return the smallest body allowed by the structured-summary instruction.
387
+ * @returns one fresh text block containing every required section.
388
+ */
389
+ function minimumSummaryContent() {
390
+ return [{
391
+ type: "text",
392
+ text: MINIMUM_SUMMARY_TEXT
393
+ }];
394
+ }
395
+ /** Add the selected region's strict shrink budget to the model instruction. */
396
+ function compactionInstruction(summaryTokenBudget) {
397
+ if (summaryTokenBudget === void 0) return COMPACTION_INSTRUCTION;
398
+ return `${COMPACTION_INSTRUCTION}\n- Keep the complete checkpoint body under ${summaryTokenBudget} estimated tokens. When space is tight, prioritize current work, the next step, constraints, and exact identifiers.`;
399
+ }
357
400
  /** Map a terminal summarization finish to its fail-closed error. */
358
401
  function finishError(finish) {
359
402
  switch (finish.kind) {
@@ -475,7 +518,7 @@ async function compactSurfaceRegion(dependencies, session, start, end, agent, op
475
518
  let closing = false;
476
519
  let stage = "summary";
477
520
  try {
478
- const summarized = await summarizeCompaction(dependencies, prepareCompaction(dependencies, session, selection), agent, compactionId, options.sourceCommandId, assertStable, signal);
521
+ const summarized = await summarizeCompaction(dependencies, prepareCompaction(dependencies.meter, session, selection), agent, compactionId, options.sourceCommandId, assertStable, signal);
479
522
  if (options.owner === null) signal?.throwIfAborted();
480
523
  assertStable(dependencies, session, summarized);
481
524
  stage = "commit";
@@ -565,8 +608,8 @@ function validateSurfaceRegion(session, start, end) {
565
608
  };
566
609
  }
567
610
  /** Snapshot pricing and replay input for a validated surface range. */
568
- function prepareCompaction(dependencies, session, selection) {
569
- const measurement = dependencies.meter.measure(session);
611
+ function prepareCompaction(meter, session, selection) {
612
+ const measurement = meter.measure(session);
570
613
  const selectedNodes = measurement.nodes.slice(selection.startIdx, selection.endIdx + 1);
571
614
  if (selectedNodes.length !== selection.shadowedSeqs.length || selectedNodes.some((node, index) => node.seq !== selection.shadowedSeqs[index])) throw new SurfaceChangedError("compaction: selected surface changed before summarization began");
572
615
  return {
@@ -578,19 +621,50 @@ function prepareCompaction(dependencies, session, selection) {
578
621
  input: buildSummarizationInput(session, selection.shadowedSeqs)
579
622
  };
580
623
  }
624
+ /** Price a framed checkpoint carrying the supplied summary body. */
625
+ function framedSummaryTokenCount(meter, summary) {
626
+ return meter.estimateMessage(createUserMessage({
627
+ content: frameSummary(summary),
628
+ source: { kind: "user" }
629
+ }));
630
+ }
631
+ /** Maximum summary-body tokens that keep the framed checkpoint strictly smaller than the selected source. */
632
+ function summaryTokenBudget(meter, shadowedRouteTokenCount) {
633
+ return shadowedRouteTokenCount - framedSummaryTokenCount(meter, [{
634
+ type: "text",
635
+ text: ""
636
+ }]) - 1;
637
+ }
638
+ /**
639
+ * Determine whether the selected source can fit the minimum structured checkpoint with a strict token reduction.
640
+ * @param meter - token meter that priced the selected conversation route.
641
+ * @param session - session supplying the current surface.
642
+ * @param start - inclusive first surface-node seq.
643
+ * @param end - inclusive last surface-node seq.
644
+ * @returns `true` when the minimum valid framed checkpoint is smaller than the selected source.
645
+ */
646
+ function canCompactSurfaceRegion(meter, session, start, end) {
647
+ const prepared = prepareCompaction(meter, session, validateSurfaceRegion(session, start, end));
648
+ return framedSummaryTokenCount(meter, minimumSummaryContent()) < prepared.shadowedRouteTokenCount;
649
+ }
581
650
  /** Run the summarizer and frame its replacement checkpoint. */
582
651
  async function summarizeCompaction(dependencies, prepared, agent, compactionId, sourceCommandId, assertStable, signal) {
583
652
  let summaryResult;
584
653
  for (;;) {
585
654
  signal?.throwIfAborted();
586
655
  try {
587
- summaryResult = await dependencies.summarize(prepared.input, agent, signal);
656
+ const budget = summaryTokenBudget(dependencies.meter, prepared.shadowedRouteTokenCount);
657
+ if (budget < 1) throw new Error("selected content is too small to fit a smaller framed summary");
658
+ summaryResult = await dependencies.summarize({
659
+ ...prepared.input,
660
+ summaryTokenBudget: budget
661
+ }, agent, signal);
588
662
  break;
589
663
  } catch (error) {
590
664
  if (signal?.aborted === true) throw error;
591
665
  assertStable(dependencies, agent.session, prepared);
592
666
  if (!dependencies.recover(error, agent, prepared.shadowedSeqs, signal)) throw error;
593
- prepared = prepareCompaction(dependencies, agent.session, validateSurfaceRegion(agent.session, prepared.start, prepared.end));
667
+ prepared = prepareCompaction(dependencies.meter, agent.session, validateSurfaceRegion(agent.session, prepared.start, prepared.end));
594
668
  }
595
669
  }
596
670
  const checkpointMessage = createUserMessage({
@@ -989,8 +1063,10 @@ var BasicCompactionEngine = class extends CompactionEngine {
989
1063
  const operationSignal = AbortSignal.any([agentSignal, signal]);
990
1064
  try {
991
1065
  operationSignal.throwIfAborted();
1066
+ assertNoActiveCompaction(agent.session, "manual compaction");
992
1067
  const range = selectCompactableRange(agent.session, this.ctx.tokenMeter.measure(agent.session), 0);
993
1068
  if (range === null) return null;
1069
+ if (!canCompactSurfaceRegion(this.ctx.tokenMeter, agent.session, range.start, range.end)) return null;
994
1070
  return await compactSurfaceRegion(this.regionDependencies(), agent.session, range.start, range.end, agent, {
995
1071
  owner: null,
996
1072
  stability: "selected-span",
@@ -62,5 +62,14 @@ export declare function compactSurfaceRegion(dependencies: RegionDependencies, s
62
62
  * @param stage - operation label included in the busy diagnostic.
63
63
  */
64
64
  export declare function assertNoActiveCompaction(session: Session, stage: string): void;
65
+ /**
66
+ * Determine whether the selected source can fit the minimum structured checkpoint with a strict token reduction.
67
+ * @param meter - token meter that priced the selected conversation route.
68
+ * @param session - session supplying the current surface.
69
+ * @param start - inclusive first surface-node seq.
70
+ * @param end - inclusive last surface-node seq.
71
+ * @returns `true` when the minimum valid framed checkpoint is smaller than the selected source.
72
+ */
73
+ export declare function canCompactSurfaceRegion(meter: TokenMeter, session: Session, start: SessionSeq, end: SessionSeq): boolean;
65
74
  export {};
66
75
  //# sourceMappingURL=region.d.ts.map
@@ -22,6 +22,8 @@ export interface SummarizationInput {
22
22
  readonly tools?: readonly ToolSchema[];
23
23
  /** The derived system head, when present, followed by the shadowed region in surface order. */
24
24
  readonly messages: readonly Message[];
25
+ /** Maximum estimated tokens available to the returned summary text while keeping the framed checkpoint smaller than its source. */
26
+ readonly summaryTokenBudget?: number;
25
27
  }
26
28
  /** Safe summary content plus the exact auxiliary call envelope recorded with it. */
27
29
  export type SummaryResult = {
@@ -60,5 +62,10 @@ export declare function summarizeWithLlm(ctx: Context, config: SummaryConfig, in
60
62
  * @returns content for the synthesized replacement user message.
61
63
  */
62
64
  export declare function frameSummary(summary: readonly ContentBlock[]): ContentBlock[];
65
+ /**
66
+ * Return the smallest body allowed by the structured-summary instruction.
67
+ * @returns one fresh text block containing every required section.
68
+ */
69
+ export declare function minimumSummaryContent(): ContentBlock[];
63
70
  export {};
64
71
  //# sourceMappingURL=summarizer.d.ts.map
@@ -183,13 +183,12 @@ window.__ModuleLoader__.load({
183
183
  //#endregion
184
184
  //#region lib/types/client/HeaderAction.js
185
185
  /**
186
- * Render the Session Header menu with download and optional feedback actions.
186
+ * Render the Session Header download menu.
187
187
  * @param props - Session runtime, download controller, and localized copy.
188
188
  * @returns the persistent Header action and Session-scoped dialog.
189
189
  */
190
190
  function SessionLogDownloadHeaderAction(props) {
191
- const { sessionId, useSessionLogDownload, useFeedbackAvailable, request, openFeedback, t } = props;
192
- const feedbackAvailable = useFeedbackAvailable((value) => value);
191
+ const { sessionId, useSessionLogDownload, request, openFeedback, t } = props;
193
192
  const busy = useSessionLogDownload((state) => state.bySession[String(sessionId)])?.status === "downloading";
194
193
  const [open, setOpen] = (0, react.useState)(false);
195
194
  return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
@@ -204,7 +203,7 @@ window.__ModuleLoader__.load({
204
203
  label: t("menu.download"),
205
204
  icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDownloadOutlineRegular, {}),
206
205
  disabled: busy
207
- }, ...feedbackAvailable ? [] : []],
206
+ }],
208
207
  onSelect: (id) => {
209
208
  setOpen(false);
210
209
  if (id === "feedback") openFeedback(sessionId);
@@ -18,7 +18,7 @@ export interface SessionLogDownloadHeaderInjected extends SessionLogDownloadDial
18
18
  /** Session download props plus the optional feedback action. */
19
19
  export type SessionLogDownloadHeaderProps = SessionLogDownloadDialogProps & InjectFace<SessionLogDownloadHeaderInjected>;
20
20
  /**
21
- * Render the Session Header menu with download and optional feedback actions.
21
+ * Render the Session Header download menu.
22
22
  * @param props - Session runtime, download controller, and localized copy.
23
23
  * @returns the persistent Header action and Session-scoped dialog.
24
24
  */
@@ -1,2 +0,0 @@
1
- import { n as runDumpConfig } from "./dump-config-BSTrhTT_.js";
2
- export { runDumpConfig };