dominds 1.25.13 → 1.25.15

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 (119) hide show
  1. package/dist/dialog-display-state.d.ts +4 -2
  2. package/dist/dialog-display-state.js +26 -6
  3. package/dist/llm/kernel-driver/drive.js +15 -0
  4. package/dist/llm/kernel-driver/flow.js +3 -0
  5. package/dist/llm/kernel-driver/sideDialog.js +1 -9
  6. package/dist/mcp/supervisor.js +2 -4
  7. package/dist/minds/system-prompt.js +4 -4
  8. package/dist/runtime/driver-messages.d.ts +5 -0
  9. package/dist/runtime/driver-messages.js +103 -59
  10. package/dist/server/api-routes.js +5 -8
  11. package/dist/server/dominds-self-update.js +584 -106
  12. package/dist/server/websocket-handler.js +5 -15
  13. package/dist/tools/app-reminders.js +6 -6
  14. package/dist/tools/cmd-runner-protocol.d.ts +1 -0
  15. package/dist/tools/cmd-runner-protocol.js +8 -1
  16. package/dist/tools/cmd-runner.js +33 -6
  17. package/dist/tools/mcp.js +2 -8
  18. package/dist/tools/os.js +27 -22
  19. package/dist/tools/pending-tellask-reminder.js +10 -10
  20. package/dist/tools/process-kill.d.ts +4 -0
  21. package/dist/tools/process-kill.js +48 -0
  22. package/dist/tools/prompts/os/en/tools.md +2 -2
  23. package/dist/tools/prompts/os/zh/tools.md +2 -2
  24. package/package.json +4 -4
  25. package/webapp/dist/assets/{_basePickBy-B1-brAPU.js → _basePickBy-bB-pfQPi.js} +3 -3
  26. package/webapp/dist/assets/{_basePickBy-B1-brAPU.js.map → _basePickBy-bB-pfQPi.js.map} +1 -1
  27. package/webapp/dist/assets/{_baseUniq-BuB0jmKD.js → _baseUniq-CGrWBZre.js} +2 -2
  28. package/webapp/dist/assets/{_baseUniq-BuB0jmKD.js.map → _baseUniq-CGrWBZre.js.map} +1 -1
  29. package/webapp/dist/assets/{arc-CvsBvjnB.js → arc-I9vbIaKk.js} +2 -2
  30. package/webapp/dist/assets/{arc-CvsBvjnB.js.map → arc-I9vbIaKk.js.map} +1 -1
  31. package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-B-xGuLbb.js → architectureDiagram-2XIMDMQ5-CrwjTxLz.js} +7 -7
  32. package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-B-xGuLbb.js.map → architectureDiagram-2XIMDMQ5-CrwjTxLz.js.map} +1 -1
  33. package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-Bu53fwsa.js → blockDiagram-WCTKOSBZ-DTm0qfvP.js} +7 -7
  34. package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-Bu53fwsa.js.map → blockDiagram-WCTKOSBZ-DTm0qfvP.js.map} +1 -1
  35. package/webapp/dist/assets/{c4Diagram-IC4MRINW-D9-FJ4LB.js → c4Diagram-IC4MRINW-DwRQtzZF.js} +3 -3
  36. package/webapp/dist/assets/{c4Diagram-IC4MRINW-D9-FJ4LB.js.map → c4Diagram-IC4MRINW-DwRQtzZF.js.map} +1 -1
  37. package/webapp/dist/assets/{channel-D1VPurpu.js → channel-BHLOwBnI.js} +2 -2
  38. package/webapp/dist/assets/{channel-D1VPurpu.js.map → channel-BHLOwBnI.js.map} +1 -1
  39. package/webapp/dist/assets/{chunk-4BX2VUAB-DB14wcWS.js → chunk-4BX2VUAB-C-uXnDVV.js} +2 -2
  40. package/webapp/dist/assets/{chunk-4BX2VUAB-DB14wcWS.js.map → chunk-4BX2VUAB-C-uXnDVV.js.map} +1 -1
  41. package/webapp/dist/assets/{chunk-55IACEB6-C5KCE85A.js → chunk-55IACEB6-Dq9BI2N6.js} +2 -2
  42. package/webapp/dist/assets/{chunk-55IACEB6-C5KCE85A.js.map → chunk-55IACEB6-Dq9BI2N6.js.map} +1 -1
  43. package/webapp/dist/assets/{chunk-FMBD7UC4-Bb6zm0iH.js → chunk-FMBD7UC4-DR9kFZOV.js} +2 -2
  44. package/webapp/dist/assets/{chunk-FMBD7UC4-Bb6zm0iH.js.map → chunk-FMBD7UC4-DR9kFZOV.js.map} +1 -1
  45. package/webapp/dist/assets/{chunk-JSJVCQXG-CJPrv6fM.js → chunk-JSJVCQXG-xnc6SVE5.js} +2 -2
  46. package/webapp/dist/assets/{chunk-JSJVCQXG-CJPrv6fM.js.map → chunk-JSJVCQXG-xnc6SVE5.js.map} +1 -1
  47. package/webapp/dist/assets/{chunk-KX2RTZJC-8J1Swk7E.js → chunk-KX2RTZJC-rUxlh4aS.js} +2 -2
  48. package/webapp/dist/assets/{chunk-KX2RTZJC-8J1Swk7E.js.map → chunk-KX2RTZJC-rUxlh4aS.js.map} +1 -1
  49. package/webapp/dist/assets/{chunk-NQ4KR5QH-DySHY4x9.js → chunk-NQ4KR5QH-BGU4PhTQ.js} +4 -4
  50. package/webapp/dist/assets/{chunk-NQ4KR5QH-DySHY4x9.js.map → chunk-NQ4KR5QH-BGU4PhTQ.js.map} +1 -1
  51. package/webapp/dist/assets/{chunk-QZHKN3VN-CTO5Z-4P.js → chunk-QZHKN3VN-CAlu4xE7.js} +2 -2
  52. package/webapp/dist/assets/{chunk-QZHKN3VN-CTO5Z-4P.js.map → chunk-QZHKN3VN-CAlu4xE7.js.map} +1 -1
  53. package/webapp/dist/assets/{chunk-WL4C6EOR-Ci_Ec8Ax.js → chunk-WL4C6EOR-zZXRkBBY.js} +6 -6
  54. package/webapp/dist/assets/{chunk-WL4C6EOR-Ci_Ec8Ax.js.map → chunk-WL4C6EOR-zZXRkBBY.js.map} +1 -1
  55. package/webapp/dist/assets/{classDiagram-VBA2DB6C-CxAxBvv7.js → classDiagram-VBA2DB6C-DI1CfOtL.js} +7 -7
  56. package/webapp/dist/assets/{classDiagram-VBA2DB6C-CxAxBvv7.js.map → classDiagram-VBA2DB6C-DI1CfOtL.js.map} +1 -1
  57. package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-CxAxBvv7.js → classDiagram-v2-RAHNMMFH-DI1CfOtL.js} +7 -7
  58. package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-CxAxBvv7.js.map → classDiagram-v2-RAHNMMFH-DI1CfOtL.js.map} +1 -1
  59. package/webapp/dist/assets/{clone-ePiNaiNY.js → clone-quTqCNPA.js} +2 -2
  60. package/webapp/dist/assets/{clone-ePiNaiNY.js.map → clone-quTqCNPA.js.map} +1 -1
  61. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-j-Ex-Sef.js → cose-bilkent-S5V4N54A-BY28yO7Y.js} +2 -2
  62. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-j-Ex-Sef.js.map → cose-bilkent-S5V4N54A-BY28yO7Y.js.map} +1 -1
  63. package/webapp/dist/assets/{dagre-KLK3FWXG-ihZ2wOCM.js → dagre-KLK3FWXG-DLyZ54D-.js} +7 -7
  64. package/webapp/dist/assets/{dagre-KLK3FWXG-ihZ2wOCM.js.map → dagre-KLK3FWXG-DLyZ54D-.js.map} +1 -1
  65. package/webapp/dist/assets/{diagram-E7M64L7V-Cp4GQGS7.js → diagram-E7M64L7V-CD-HWZAJ.js} +8 -8
  66. package/webapp/dist/assets/{diagram-E7M64L7V-Cp4GQGS7.js.map → diagram-E7M64L7V-CD-HWZAJ.js.map} +1 -1
  67. package/webapp/dist/assets/{diagram-IFDJBPK2-B70cgyS5.js → diagram-IFDJBPK2-BHOQ9HH2.js} +7 -7
  68. package/webapp/dist/assets/{diagram-IFDJBPK2-B70cgyS5.js.map → diagram-IFDJBPK2-BHOQ9HH2.js.map} +1 -1
  69. package/webapp/dist/assets/{diagram-P4PSJMXO-DMOv7eKE.js → diagram-P4PSJMXO-OEPgBDcD.js} +7 -7
  70. package/webapp/dist/assets/{diagram-P4PSJMXO-DMOv7eKE.js.map → diagram-P4PSJMXO-OEPgBDcD.js.map} +1 -1
  71. package/webapp/dist/assets/{erDiagram-INFDFZHY-BKpXWjIc.js → erDiagram-INFDFZHY-Dcgo204J.js} +5 -5
  72. package/webapp/dist/assets/{erDiagram-INFDFZHY-BKpXWjIc.js.map → erDiagram-INFDFZHY-Dcgo204J.js.map} +1 -1
  73. package/webapp/dist/assets/{flowDiagram-PKNHOUZH-DgrItj0h.js → flowDiagram-PKNHOUZH-CWLo3Lkf.js} +7 -7
  74. package/webapp/dist/assets/{flowDiagram-PKNHOUZH-DgrItj0h.js.map → flowDiagram-PKNHOUZH-CWLo3Lkf.js.map} +1 -1
  75. package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-7-8hlYsT.js → ganttDiagram-A5KZAMGK-DWXL4ZD6.js} +3 -3
  76. package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-7-8hlYsT.js.map → ganttDiagram-A5KZAMGK-DWXL4ZD6.js.map} +1 -1
  77. package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-cPSaCUUk.js → gitGraphDiagram-K3NZZRJ6-7iLQbTrH.js} +8 -8
  78. package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-cPSaCUUk.js.map → gitGraphDiagram-K3NZZRJ6-7iLQbTrH.js.map} +1 -1
  79. package/webapp/dist/assets/{graph-CAlg3tEk.js → graph-Bq1MLNWN.js} +3 -3
  80. package/webapp/dist/assets/{graph-CAlg3tEk.js.map → graph-Bq1MLNWN.js.map} +1 -1
  81. package/webapp/dist/assets/{index-DLTS_eOh.js → index-r4An5YoX.js} +245 -60
  82. package/webapp/dist/assets/{index-DLTS_eOh.js.map → index-r4An5YoX.js.map} +1 -1
  83. package/webapp/dist/assets/{infoDiagram-LFFYTUFH-CHJHvxMC.js → infoDiagram-LFFYTUFH-CoF5OE3_.js} +6 -6
  84. package/webapp/dist/assets/{infoDiagram-LFFYTUFH-CHJHvxMC.js.map → infoDiagram-LFFYTUFH-CoF5OE3_.js.map} +1 -1
  85. package/webapp/dist/assets/{ishikawaDiagram-PHBUUO56-S8N-XZ8E.js → ishikawaDiagram-PHBUUO56-iKggfQhA.js} +2 -2
  86. package/webapp/dist/assets/{ishikawaDiagram-PHBUUO56-S8N-XZ8E.js.map → ishikawaDiagram-PHBUUO56-iKggfQhA.js.map} +1 -1
  87. package/webapp/dist/assets/{journeyDiagram-4ABVD52K-ChHNpMtH.js → journeyDiagram-4ABVD52K-NYDQ7_xv.js} +5 -5
  88. package/webapp/dist/assets/{journeyDiagram-4ABVD52K-ChHNpMtH.js.map → journeyDiagram-4ABVD52K-NYDQ7_xv.js.map} +1 -1
  89. package/webapp/dist/assets/{kanban-definition-K7BYSVSG-Cqxd99wZ.js → kanban-definition-K7BYSVSG-YWCnJwk0.js} +3 -3
  90. package/webapp/dist/assets/{kanban-definition-K7BYSVSG-Cqxd99wZ.js.map → kanban-definition-K7BYSVSG-YWCnJwk0.js.map} +1 -1
  91. package/webapp/dist/assets/{layout-uOLcVthp.js → layout-CE6gccWy.js} +5 -5
  92. package/webapp/dist/assets/{layout-uOLcVthp.js.map → layout-CE6gccWy.js.map} +1 -1
  93. package/webapp/dist/assets/{linear-Ga_f4H_w.js → linear-12arIJK-.js} +2 -2
  94. package/webapp/dist/assets/{linear-Ga_f4H_w.js.map → linear-12arIJK-.js.map} +1 -1
  95. package/webapp/dist/assets/{mindmap-definition-YRQLILUH-TSH7wOlZ.js → mindmap-definition-YRQLILUH-D_5iNhfP.js} +4 -4
  96. package/webapp/dist/assets/{mindmap-definition-YRQLILUH-TSH7wOlZ.js.map → mindmap-definition-YRQLILUH-D_5iNhfP.js.map} +1 -1
  97. package/webapp/dist/assets/{pieDiagram-SKSYHLDU-DPXszqns.js → pieDiagram-SKSYHLDU-DCbLQaXM.js} +8 -8
  98. package/webapp/dist/assets/{pieDiagram-SKSYHLDU-DPXszqns.js.map → pieDiagram-SKSYHLDU-DCbLQaXM.js.map} +1 -1
  99. package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-BgA_GVhR.js → quadrantDiagram-337W2JSQ-CVRDOyty.js} +3 -3
  100. package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-BgA_GVhR.js.map → quadrantDiagram-337W2JSQ-CVRDOyty.js.map} +1 -1
  101. package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-CM-47daj.js → requirementDiagram-Z7DCOOCP-iBpmayOS.js} +4 -4
  102. package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-CM-47daj.js.map → requirementDiagram-Z7DCOOCP-iBpmayOS.js.map} +1 -1
  103. package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-CxDCwHAj.js → sankeyDiagram-WA2Y5GQK-DqzWCtib.js} +2 -2
  104. package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-CxDCwHAj.js.map → sankeyDiagram-WA2Y5GQK-DqzWCtib.js.map} +1 -1
  105. package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-1UJP6Fff.js → sequenceDiagram-2WXFIKYE-DHzt-u2j.js} +4 -4
  106. package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-1UJP6Fff.js.map → sequenceDiagram-2WXFIKYE-DHzt-u2j.js.map} +1 -1
  107. package/webapp/dist/assets/{stateDiagram-RAJIS63D-B2aqr0KQ.js → stateDiagram-RAJIS63D-D14FagfU.js} +9 -9
  108. package/webapp/dist/assets/{stateDiagram-RAJIS63D-B2aqr0KQ.js.map → stateDiagram-RAJIS63D-D14FagfU.js.map} +1 -1
  109. package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-DvmkevVb.js → stateDiagram-v2-FVOUBMTO-CZRolF-A.js} +5 -5
  110. package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-DvmkevVb.js.map → stateDiagram-v2-FVOUBMTO-CZRolF-A.js.map} +1 -1
  111. package/webapp/dist/assets/{timeline-definition-YZTLITO2-CaOrqzT1.js → timeline-definition-YZTLITO2-L4O4kc8p.js} +3 -3
  112. package/webapp/dist/assets/{timeline-definition-YZTLITO2-CaOrqzT1.js.map → timeline-definition-YZTLITO2-L4O4kc8p.js.map} +1 -1
  113. package/webapp/dist/assets/{treemap-KZPCXAKY-CWs_8GJm.js → treemap-KZPCXAKY-CvHKWhtl.js} +5 -5
  114. package/webapp/dist/assets/{treemap-KZPCXAKY-CWs_8GJm.js.map → treemap-KZPCXAKY-CvHKWhtl.js.map} +1 -1
  115. package/webapp/dist/assets/{vennDiagram-LZ73GAT5-BuBxFDz6.js → vennDiagram-LZ73GAT5-8sPBS5jq.js} +2 -2
  116. package/webapp/dist/assets/{vennDiagram-LZ73GAT5-BuBxFDz6.js.map → vennDiagram-LZ73GAT5-8sPBS5jq.js.map} +1 -1
  117. package/webapp/dist/assets/{xychartDiagram-JWTSCODW-ChjL-_2b.js → xychartDiagram-JWTSCODW-CqLmOgCw.js} +3 -3
  118. package/webapp/dist/assets/{xychartDiagram-JWTSCODW-ChjL-_2b.js.map → xychartDiagram-JWTSCODW-CqLmOgCw.js.map} +1 -1
  119. package/webapp/dist/index.html +1 -1
@@ -17,19 +17,21 @@
17
17
  */
18
18
  import type { DialogDisplayState, DialogInterruptionReason } from '@longrun-ai/kernel/types/display-state';
19
19
  import type { DialogExecutionMarker, DialogLatestFile } from '@longrun-ai/kernel/types/storage';
20
- import type { WebSocketMessage } from '@longrun-ai/kernel/types/wire';
20
+ import type { RunControlCountsMessage, WebSocketMessage } from '@longrun-ai/kernel/types/wire';
21
21
  import { DialogID, type Dialog } from './dialog';
22
22
  type StopRequestedReason = 'user_stop' | 'emergency_stop';
23
23
  export type RunControlCountsSnapshot = {
24
24
  proceeding: number;
25
25
  resumable: number;
26
26
  };
27
- export declare function setDisplayStateBroadcaster(fn: (msg: WebSocketMessage) => void): void;
27
+ export declare function getRunControlCountsSnapshotEpoch(): string;
28
+ export declare function setDisplayStateBroadcaster(fn: ((msg: WebSocketMessage) => void) | null): void;
28
29
  export declare function isStoppedReasonResumable(reason: DialogInterruptionReason): boolean;
29
30
  export declare function isDisplayStateResumable(state: DialogDisplayState | undefined): boolean;
30
31
  export declare function isExecutionMarkerResumable(executionMarker: DialogExecutionMarker | undefined): boolean;
31
32
  export declare function isDialogLatestResumable(latest: DialogLatestFile | null | undefined): boolean;
32
33
  export declare function getRunControlCountsSnapshot(): Promise<RunControlCountsSnapshot>;
34
+ export declare function createRunControlCountsMessage(): Promise<RunControlCountsMessage>;
33
35
  export declare function broadcastRunControlCountsSnapshot(): Promise<void>;
34
36
  export declare function hasActiveRun(dialogId: DialogID): boolean;
35
37
  export declare function getActiveRunSignal(dialogId: DialogID): AbortSignal | undefined;
@@ -17,12 +17,14 @@
17
17
  * so multi-tab views converge without polling.
18
18
  */
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.getRunControlCountsSnapshotEpoch = getRunControlCountsSnapshotEpoch;
20
21
  exports.setDisplayStateBroadcaster = setDisplayStateBroadcaster;
21
22
  exports.isStoppedReasonResumable = isStoppedReasonResumable;
22
23
  exports.isDisplayStateResumable = isDisplayStateResumable;
23
24
  exports.isExecutionMarkerResumable = isExecutionMarkerResumable;
24
25
  exports.isDialogLatestResumable = isDialogLatestResumable;
25
26
  exports.getRunControlCountsSnapshot = getRunControlCountsSnapshot;
27
+ exports.createRunControlCountsMessage = createRunControlCountsMessage;
26
28
  exports.broadcastRunControlCountsSnapshot = broadcastRunControlCountsSnapshot;
27
29
  exports.hasActiveRun = hasActiveRun;
28
30
  exports.getActiveRunSignal = getActiveRunSignal;
@@ -44,6 +46,7 @@ exports.reconcileDisplayStatesAfterRestart = reconcileDisplayStatesAfterRestart;
44
46
  exports.requestInterruptDialog = requestInterruptDialog;
45
47
  exports.requestEmergencyStopAll = requestEmergencyStopAll;
46
48
  const time_1 = require("@longrun-ai/kernel/utils/time");
49
+ const crypto_1 = require("crypto");
47
50
  const dialog_1 = require("./dialog");
48
51
  const dialog_generation_run_1 = require("./dialog-generation-run");
49
52
  const dialog_global_registry_1 = require("./dialog-global-registry");
@@ -58,8 +61,14 @@ const log = (0, log_1.createLogger)('dialog-display-state');
58
61
  let broadcastToClients;
59
62
  const activeRunsByDialogKey = new Map();
60
63
  const quarantiningMainDialogIds = new Set();
64
+ const runControlCountsSnapshotEpoch = (0, crypto_1.randomUUID)();
65
+ let runControlCountsSnapshotSeq = 0;
66
+ let runControlCountsSnapshotQueue = Promise.resolve();
67
+ function getRunControlCountsSnapshotEpoch() {
68
+ return runControlCountsSnapshotEpoch;
69
+ }
61
70
  function setDisplayStateBroadcaster(fn) {
62
- broadcastToClients = fn;
71
+ broadcastToClients = fn ?? undefined;
63
72
  }
64
73
  function syncRunControlCountsAfterActiveRunChange(trigger, dialogId) {
65
74
  void (async () => {
@@ -259,16 +268,27 @@ async function getRunControlCountsSnapshot() {
259
268
  }
260
269
  return { proceeding, resumable };
261
270
  }
262
- async function broadcastRunControlCountsSnapshot() {
263
- if (!broadcastToClients)
264
- return;
271
+ async function createRunControlCountsMessageUnqueued() {
265
272
  const counts = await getRunControlCountsSnapshot();
266
- broadcastToClients({
273
+ const snapshotSeq = ++runControlCountsSnapshotSeq;
274
+ return {
267
275
  type: 'run_control_counts_evt',
268
276
  proceeding: counts.proceeding,
269
277
  resumable: counts.resumable,
278
+ snapshotEpoch: runControlCountsSnapshotEpoch,
279
+ snapshotSeq,
270
280
  timestamp: (0, time_1.formatUnifiedTimestamp)(new Date()),
271
- });
281
+ };
282
+ }
283
+ function createRunControlCountsMessage() {
284
+ const nextSnapshot = runControlCountsSnapshotQueue.then(() => createRunControlCountsMessageUnqueued());
285
+ runControlCountsSnapshotQueue = nextSnapshot.then(() => undefined, () => undefined);
286
+ return nextSnapshot;
287
+ }
288
+ async function broadcastRunControlCountsSnapshot() {
289
+ if (!broadcastToClients)
290
+ return;
291
+ broadcastToClients(await createRunControlCountsMessage());
272
292
  }
273
293
  function hasActiveRun(dialogId) {
274
294
  return activeRunsByDialogKey.has(dialogId.key());
@@ -804,10 +804,15 @@ async function renderRemindersForContext(dlg) {
804
804
  return [];
805
805
  const language = (0, work_language_1.getWorkLanguage)();
806
806
  const renderedItems = [];
807
+ const maintenanceReferenceItems = [];
807
808
  for (const reminder of reminders) {
808
809
  if (!reminder || !(0, tool_1.reminderEchoBackEnabled)(reminder)) {
809
810
  continue;
810
811
  }
812
+ maintenanceReferenceItems.push({
813
+ id: reminder.id,
814
+ meta: reminder.meta,
815
+ });
811
816
  if (reminder.owner) {
812
817
  renderedItems.push(await reminder.owner.renderReminder(dlg, reminder));
813
818
  continue;
@@ -823,12 +828,22 @@ async function renderRemindersForContext(dlg) {
823
828
  }
824
829
  if (renderedItems.length === 0)
825
830
  return [];
831
+ const maintenanceReference = (0, driver_messages_1.formatReminderMaintenanceReference)(language, maintenanceReferenceItems);
826
832
  return [
827
833
  {
828
834
  type: 'environment_msg',
829
835
  role: 'user',
830
836
  content: (0, driver_messages_1.formatReminderContextGuide)(language),
831
837
  },
838
+ ...(maintenanceReference === undefined
839
+ ? []
840
+ : [
841
+ {
842
+ type: 'transient_guide_msg',
843
+ role: 'assistant',
844
+ content: maintenanceReference,
845
+ },
846
+ ]),
832
847
  ...renderedItems,
833
848
  ];
834
849
  }
@@ -1676,6 +1676,9 @@ async function executeDriveRound(args) {
1676
1676
  replyContinuationScope.target() ??
1677
1677
  calleeDialogReplyTarget;
1678
1678
  activeTellaskReplyDirective = activeTellaskReplyDirective ?? replyContinuationScope.directive();
1679
+ if (driveResult.lastFunctionCallGenseq !== null) {
1680
+ activePromptWasReplyToolReminder = false;
1681
+ }
1679
1682
  interruptedBySignal = (0, dialog_display_state_1.getActiveRunSignal)(dialog.id)?.aborted === true;
1680
1683
  if (!interruptedBySignal) {
1681
1684
  const queuedFollowUp = dialog.peekQueuedPrompt();
@@ -381,15 +381,7 @@ async function supplyResponseToAskerDialog(args) {
381
381
  }), callerDialog.status);
382
382
  if (maybeSideDialog) {
383
383
  const displayState = await (0, dialog_display_state_1.computeIdleDisplayState)(maybeSideDialog);
384
- await persistence_1.DialogPersistence.mutateDialogLatest(sideDialogId, () => ({
385
- kind: 'patch',
386
- patch: {
387
- displayState,
388
- executionMarker: displayState.kind === 'stopped'
389
- ? { kind: 'interrupted', reason: displayState.reason }
390
- : undefined,
391
- },
392
- }), callerDialog.status);
384
+ await (0, dialog_display_state_1.setDialogDisplayState)(sideDialogId, displayState, callerDialog.status);
393
385
  }
394
386
  }
395
387
  await syncPendingTellaskReminderBestEffort(callerDialog, 'kernel-driver:supplyResponseToAskerDialog');
@@ -101,14 +101,12 @@ function ensureLeaseReminder(dlg, serverId) {
101
101
  ? [
102
102
  `已租用 MCP 工具集:${serverId}`,
103
103
  '',
104
- '该 MCP server 被视为非“真正无状态”。当你确认短期内不再需要它时,请释放以回收底层进程/连接:',
105
- `mcp_release({"serverId":"${serverId}"})`,
104
+ '该 MCP server 被视为非“真正无状态”;当前对话持有一个需要显式生命周期管理的底层进程/连接。',
106
105
  ].join('\n')
107
106
  : [
108
107
  `MCP toolset leased: ${serverId}`,
109
108
  '',
110
- `This MCP server is treated as non-stateless. When you are confident you won't need it again soon, release it:`,
111
- `mcp_release({"serverId":"${serverId}"})`,
109
+ `This MCP server is treated as non-stateless; the current dialog holds an underlying process/connection with explicit lifecycle management.`,
112
110
  ].join('\n');
113
111
  dlg.addReminder(content, owner, makeLeaseReminderMeta(serverId));
114
112
  }
@@ -99,8 +99,8 @@ function buildTeammateTellaskPhaseContract(language) {
99
99
  '- 队友诉请必须遵循“发起 → 等待 → 判定 → 续推”四段协议:若目标未达成,立即发出下一轮诉请推进。',
100
100
  '- 对队友诉请而言,收到回贴即表示该轮调用已结束;不存在“回贴已送达后,对方仍在后台继续执行同一诉请”的默认语义。要继续必须显式再发一轮诉请函数(通常 `tellask` 复用同一 `sessionSlug`)。',
101
101
  '- 若被诉请者在回贴送达前因 `clear_mind` 开启新一程,同一进行中诉请默认继续有效;新一程会自然承接,直到产生回贴或明确失败。不要仅因对方换程就把该轮诉请当作失效重发。',
102
- '- 只有在存在明确进行中诉请时,才可声明“等待回贴/等待结果”(通常应可在“⏳ 进行中诉请(共 N 路,自动维护;仅 0 路时可手动删除)”这类提醒项中观测到);若该提醒项不存在,或提醒项已明确“当前没有执行中的诉请”,则“等待”是错误动作,必须执行下一动作(直接诉请或本地执行)。',
103
- '- “⏳ 进行中诉请”提醒项只是系统状态窗,不是控制面:内容不可手改;当存在非 0 路进行中诉请时,不可删除,误删会被拒绝并返回引导文案。若某一路诉请需要改要求、提前收口或纠偏,只能更新那一路诉请的“任务安排”(对长线诉请通常复用同一 `sessionSlug` 再发 `tellask`),让对应主理人按最新安排自行最终回复并自然结束。',
102
+ '- 只有在存在明确进行中诉请时,才可声明“等待回贴/等待结果”(通常应可在“⏳ 进行中诉请(共 N 路,自动维护)”这类提醒项中观测到);若该提醒项不存在,或提醒项已明确“当前没有执行中的诉请”,则“等待”是错误动作,必须执行下一动作(直接诉请或本地执行)。',
103
+ '- “⏳ 进行中诉请”提醒项只是系统状态窗,不是控制面;用它判断是否确实存在仍在执行的诉请。若某一路诉请需要改要求、提前收口或纠偏,更新那一路诉请的“任务安排”(对长线诉请通常复用同一 `sessionSlug` 再发 `tellask`),让对应主理人按最新安排自行最终回复并自然结束。',
104
104
  '- 只有长线诉请(`tellask` + `sessionSlug`)能接着同一件事说、更新同一件正在做的事;一次性诉请(`tellaskSessionless`)做不到。再次发起 `tellaskSessionless` 只是另一件独立任务,不会更新、更不会要求旧任务停止;若你后来发现可能需要改要求/提前收口,一开始就不该选择 `tellaskSessionless`。',
105
105
  '- 不要把智能体队友当成真人同事:祂不会因为你又发一条诉请而被打扰。同一个队友可以同时做多件独立任务,系统会分开处理。记住这个简单规则:同一个队友 + 同一个 `sessionSlug` = 接着同一件事说,并更新那件正在做的事;`tellaskSessionless` 或不同 `sessionSlug` = 另一件独立任务。只要任务独立、目标清楚,就直接并行诉请。',
106
106
  '- 能由队友诉请完成的执行性工作,禁止转交 `askHuman` 做“转发员”;当你写“让 @X 执行 Y”时,必须在同一回复内直接发出 `tellask` 或 `tellaskSessionless`。',
@@ -112,8 +112,8 @@ function buildTeammateTellaskPhaseContract(language) {
112
112
  '- Teammate Tellasks MUST follow four phases: “initiate -> wait -> judge -> continue”. If the objective is not met, immediately send the next Tellask round.',
113
113
  '- For teammate Tellasks, a delivered response closes that call round; there is no default “still running in background after the reply is already delivered” state for the same Tellask. To continue, emit a new Tellask function call explicitly (usually `tellask` with the same `sessionSlug`).',
114
114
  '- If the tellaskee starts a new course via `clear_mind` before delivering the reply, the same in-flight Tellask stays live by default; the new course naturally continues it until a reply is delivered or an explicit failure is returned. Do not re-tellask solely because the tellaskee changed course.',
115
- '- You may claim “waiting for reply/result” only when a concrete pending Tellask exists (normally observable in a “⏳ In-flight Tellasks (N total, auto-maintained; manually deletable only at zero in-flight)” reminder). If that reminder is absent, or it explicitly states there are no in-flight Tellasks, waiting is a wrong action; execute the next action now (direct Tellask or local action).',
116
- '- The “⏳ In-flight Tellasks” reminder is only a system status window, not a control surface: its content is not hand-editable; while any Tellask is still active, it is not deletable, and mistaken deletion will be rejected with guidance. If one Tellask needs a changed scope, earlier closure, or correction, update that Tellask’s assignment instead (for a sessioned Tellask, usually send another `tellask` with the same `sessionSlug`) so the tellaskee can deliver a final reply naturally under the latest assignment.',
115
+ '- You may claim “waiting for reply/result” only when a concrete pending Tellask exists (normally observable in a “⏳ In-flight Tellasks (N total, auto-maintained)” reminder). If that reminder is absent, or it explicitly states there are no in-flight Tellasks, waiting is a wrong action; execute the next action now (direct Tellask or local action).',
116
+ '- The “⏳ In-flight Tellasks” reminder is only a system status window, not a control surface; use it to determine whether any Tellask is truly still in flight. If one Tellask needs a changed scope, earlier closure, or correction, update that Tellask’s assignment (for a sessioned Tellask, usually send another `tellask` with the same `sessionSlug`) so the tellaskee can deliver a final reply naturally under the latest assignment.',
117
117
  '- Only a sessioned Tellask (`tellask` + `sessionSlug`) can continue the same task and update that task. A one-shot Tellask (`tellaskSessionless`) cannot: another `tellaskSessionless` is a separate task and does not update, stop, or instruct the earlier task to stop. If you may need later correction or earlier wrap-up, do not choose `tellaskSessionless` in the first place.',
118
118
  '- Do not treat an agent teammate like a human coworker who can only handle one conversation at a time. The same teammate can work on several independent tasks at once, and the system keeps them separate. Simple rule: same teammate + same `sessionSlug` = continue the same task and update that task; `tellaskSessionless` or a different `sessionSlug` = another independent task. When tasks are independent and clear, tellask in parallel.',
119
119
  '- Do not use `askHuman` as a relay for executable teammate work. If you write “ask @X to do Y”, emit `tellask` or `tellaskSessionless` in the same response.',
@@ -20,6 +20,11 @@ export type ReminderContextFooterState = Readonly<{
20
20
  interDialogReplyObligation: ReminderContextReplyObligationState;
21
21
  }>;
22
22
  export declare function formatReminderContextFooter(language: LanguageCode, state: ReminderContextFooterState): string;
23
+ export type ReminderMaintenanceReferenceItem = Readonly<{
24
+ id: string;
25
+ meta?: unknown;
26
+ }>;
27
+ export declare function formatReminderMaintenanceReference(language: LanguageCode, reminders: readonly ReminderMaintenanceReferenceItem[]): string | undefined;
23
28
  export declare function formatReminderItemGuide(language: LanguageCode, reminderId: string, content: string, options?: {
24
29
  meta?: unknown;
25
30
  scope?: 'dialog' | 'task' | 'agent' | 'runtime';
@@ -11,6 +11,7 @@ exports.formatNewCourseStartPrompt = formatNewCourseStartPrompt;
11
11
  exports.formatDiligenceAutoContinuePrompt = formatDiligenceAutoContinuePrompt;
12
12
  exports.formatReminderContextGuide = formatReminderContextGuide;
13
13
  exports.formatReminderContextFooter = formatReminderContextFooter;
14
+ exports.formatReminderMaintenanceReference = formatReminderMaintenanceReference;
14
15
  exports.formatReminderItemGuide = formatReminderItemGuide;
15
16
  exports.formatQ4HDiligencePushBudgetExhausted = formatQ4HDiligencePushBudgetExhausted;
16
17
  exports.formatDomindsNoteTellaskForTeammatesOnly = formatDomindsNoteTellaskForTeammatesOnly;
@@ -236,53 +237,121 @@ function formatReminderContextFooter(language, state) {
236
237
  'Judge the next step from the existing task state: if there is a clear, relevant, valuable action, continue with it; if the work genuinely can only wait for an external result or user input, do not invent unrelated work just to avoid "waiting". ' +
237
238
  `Do not interpret the absence of a new message as an empty system notice. ${businessTail}`);
238
239
  }
239
- function formatReminderItemGuide(language, reminderId, content, options) {
240
- function isRecord(value) {
241
- return typeof value === 'object' && value !== null && !Array.isArray(value);
242
- }
243
- // `options.meta` is persisted JSON coming from tools. Runtime shape checks are unavoidable here
244
- // to keep reminder ownership/management loosely coupled and extensible.
245
- const metaValue = options && 'meta' in options ? options.meta : undefined;
246
- const scope = options?.scope;
247
- const isContinuationPackageReminder = isRecord(metaValue) && metaValue['kind'] === 'continuation_package';
248
- const isPendingTellaskReminder = isRecord(metaValue) && metaValue['kind'] === 'pending_tellask';
240
+ function isReminderGuideMetaRecord(value) {
241
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
242
+ }
243
+ function getReminderMaintenanceInstructions(language, reminderId, meta) {
244
+ const metaValue = meta;
245
+ const isPendingTellaskReminder = isReminderGuideMetaRecord(metaValue) && metaValue['kind'] === 'pending_tellask';
249
246
  const pendingTellaskCount = isPendingTellaskReminder && typeof metaValue['pendingCount'] === 'number'
250
247
  ? metaValue['pendingCount']
251
248
  : undefined;
252
- const managerValue = isRecord(metaValue) ? metaValue['manager'] : undefined;
253
- const managementTool = isRecord(managerValue) && typeof managerValue['tool'] === 'string'
249
+ const managerValue = isReminderGuideMetaRecord(metaValue) ? metaValue['manager'] : undefined;
250
+ const managementTool = isReminderGuideMetaRecord(managerValue) && typeof managerValue['tool'] === 'string'
254
251
  ? managerValue['tool'].trim()
255
252
  : undefined;
256
- const updateValue = isRecord(metaValue) ? metaValue['update'] : undefined;
257
- const updateAltInstruction = isRecord(updateValue) && typeof updateValue['altInstruction'] === 'string'
253
+ const updateValue = isReminderGuideMetaRecord(metaValue) ? metaValue['update'] : undefined;
254
+ const updateAltInstruction = isReminderGuideMetaRecord(updateValue) && typeof updateValue['altInstruction'] === 'string'
258
255
  ? updateValue['altInstruction'].trim()
259
256
  : undefined;
260
- const updateInstruction = updateAltInstruction && updateAltInstruction.length > 0
261
- ? updateAltInstruction
262
- : managementTool
263
- ? `${managementTool}({ ... })`
264
- : undefined;
265
- const deleteValue = isRecord(metaValue) ? metaValue['delete'] : undefined;
266
- const deleteAltInstruction = isRecord(deleteValue) && typeof deleteValue['altInstruction'] === 'string'
257
+ const metaKind = isReminderGuideMetaRecord(metaValue) ? metaValue['kind'] : undefined;
258
+ const serverIdValue = isReminderGuideMetaRecord(metaValue) ? metaValue['serverId'] : undefined;
259
+ const mcpReleaseInstruction = typeof serverIdValue === 'string' && serverIdValue.trim() !== ''
260
+ ? `mcp_release({"serverId":"${serverIdValue.trim()}"})`
261
+ : 'mcp_release({"serverId":"<serverId>"})';
262
+ const updateInstruction = metaKind === 'mcp_lease'
263
+ ? language === 'zh'
264
+ ? 'MCP lease 状态由系统维护,不用 update_reminder 修改'
265
+ : 'MCP lease state is system-maintained; I do not edit it with update_reminder'
266
+ : updateAltInstruction && updateAltInstruction.length > 0
267
+ ? updateAltInstruction
268
+ : managementTool
269
+ ? `${managementTool}({ ... })`
270
+ : undefined;
271
+ const deleteValue = isReminderGuideMetaRecord(metaValue) ? metaValue['delete'] : undefined;
272
+ const deleteAltInstruction = isReminderGuideMetaRecord(deleteValue) && typeof deleteValue['altInstruction'] === 'string'
267
273
  ? deleteValue['altInstruction'].trim()
268
274
  : undefined;
275
+ const daemonCompleted = metaKind === 'daemon' && isReminderGuideMetaRecord(metaValue) && metaValue['completed'] === true;
269
276
  const deleteInstruction = language === 'zh'
270
- ? deleteAltInstruction
271
- ? `删除通道:不要用 delete_reminder;请执行:${deleteAltInstruction}`
272
- : isPendingTellaskReminder && pendingTellaskCount === 0
273
- ? `清理噪音时可删除:delete_reminder({ "reminder_id": "${reminderId}" })`
274
- : `删除通道:delete_reminder({ "reminder_id": "${reminderId}" })`
275
- : deleteAltInstruction
276
- ? `Delete path: do not use delete_reminder; run: ${deleteAltInstruction}`
277
- : isPendingTellaskReminder && pendingTellaskCount === 0
278
- ? `Noise cleanup delete path: delete_reminder({ "reminder_id": "${reminderId}" })`
279
- : `Delete path: delete_reminder({ "reminder_id": "${reminderId}" })`;
277
+ ? isPendingTellaskReminder && pendingTellaskCount !== undefined && pendingTellaskCount > 0
278
+ ? '删除通道:当前仍有进行中诉请;我不能用 delete_reminder 删除。要改变某一路长线诉请时,我复用同一 sessionSlug 再发 tellask;tellaskSessionless 不能修改或停止旧任务。'
279
+ : deleteAltInstruction
280
+ ? `删除通道:我不用 delete_reminder;我执行:${deleteAltInstruction}`
281
+ : metaKind === 'mcp_lease'
282
+ ? `删除通道:我不用 delete_reminder 释放资源;确认当前对话近期不再需要该 MCP runtime 时,我执行:${mcpReleaseInstruction}`
283
+ : daemonCompleted
284
+ ? `删除通道:确认已知悉 daemon 终态后,可清理:delete_reminder({ "reminder_id": "${reminderId}" })`
285
+ : isPendingTellaskReminder && pendingTellaskCount === 0
286
+ ? `清理噪音时我可删除:delete_reminder({ "reminder_id": "${reminderId}" })`
287
+ : `删除通道:delete_reminder({ "reminder_id": "${reminderId}" })`
288
+ : isPendingTellaskReminder && pendingTellaskCount !== undefined && pendingTellaskCount > 0
289
+ ? 'Delete path: there are still in-flight Tellasks; I cannot delete this reminder with delete_reminder. To change a sessioned tellask, I send another tellask with the same sessionSlug; tellaskSessionless cannot modify or stop an earlier task.'
290
+ : deleteAltInstruction
291
+ ? `Delete path: I do not use delete_reminder; I run: ${deleteAltInstruction}`
292
+ : metaKind === 'mcp_lease'
293
+ ? `Delete path: I do not release resources by deleting the reminder; when this dialog will not need the MCP runtime soon, I run: ${mcpReleaseInstruction}`
294
+ : daemonCompleted
295
+ ? `Delete path: after I have acknowledged the daemon terminal state, I may clean up: delete_reminder({ "reminder_id": "${reminderId}" })`
296
+ : isPendingTellaskReminder && pendingTellaskCount === 0
297
+ ? `Noise cleanup delete path: I may run delete_reminder({ "reminder_id": "${reminderId}" })`
298
+ : `Delete path: delete_reminder({ "reminder_id": "${reminderId}" })`;
299
+ return { updateInstruction, deleteInstruction };
300
+ }
301
+ function formatReminderMaintenanceReference(language, reminders) {
302
+ const lines = [];
303
+ for (const reminder of reminders) {
304
+ const { updateInstruction, deleteInstruction } = getReminderMaintenanceInstructions(language, reminder.id, reminder.meta);
305
+ if (language === 'zh') {
306
+ if (updateInstruction) {
307
+ lines.push(`- reminder_id=${reminder.id}:我若要更新/调整这条提醒项,参考:${updateInstruction}`);
308
+ }
309
+ else {
310
+ lines.push(`- reminder_id=${reminder.id}:我若要更新/调整这条提醒项,参考:update_reminder({ "reminder_id": "${reminder.id}", "content": "..." })`);
311
+ }
312
+ lines.push(`- reminder_id=${reminder.id}:我若要删除/清理这条提醒项,参考:${deleteInstruction}`);
313
+ }
314
+ else {
315
+ if (updateInstruction) {
316
+ lines.push(`- reminder_id=${reminder.id}: if I update/change this reminder, I follow: ${updateInstruction}`);
317
+ }
318
+ else {
319
+ lines.push(`- reminder_id=${reminder.id}: if I update/change this reminder, I follow: update_reminder({ "reminder_id": "${reminder.id}", "content": "..." })`);
320
+ }
321
+ lines.push(`- reminder_id=${reminder.id}: if I delete/clean up this reminder, I follow: ${deleteInstruction}`);
322
+ }
323
+ }
324
+ if (lines.length === 0)
325
+ return undefined;
326
+ if (language === 'zh') {
327
+ return [
328
+ `${formatSystemNoticePrefix(language)} 我把下面的提醒项维护通道仅作为操作参考;如果我需要维护某条 reminder,我会按对应 reminder_id 选择工具。我不会把这些参考当成当前轮必须立即执行的动作,也不会因此延迟回应后续真实用户消息。`,
329
+ '',
330
+ ...lines,
331
+ ].join('\n');
332
+ }
333
+ return [
334
+ `${formatSystemNoticePrefix(language)} I treat the following reminder-maintenance channels as an operational reference only. If I need to maintain a reminder, I match the corresponding reminder_id and choose the tool from there. I do not treat these references as actions I must perform immediately in this turn, and I do not let them delay my response to any following real user message.`,
335
+ '',
336
+ ...lines,
337
+ ].join('\n');
338
+ }
339
+ function formatReminderItemGuide(language, reminderId, content, options) {
340
+ // `options.meta` is persisted JSON coming from tools. Runtime shape checks are unavoidable here
341
+ // to keep reminder ownership/management loosely coupled and extensible.
342
+ const metaValue = options && 'meta' in options ? options.meta : undefined;
343
+ const scope = options?.scope;
344
+ const isContinuationPackageReminder = isReminderGuideMetaRecord(metaValue) && metaValue['kind'] === 'continuation_package';
345
+ const managerValue = isReminderGuideMetaRecord(metaValue) ? metaValue['manager'] : undefined;
346
+ const managementTool = isReminderGuideMetaRecord(managerValue) && typeof managerValue['tool'] === 'string'
347
+ ? managerValue['tool'].trim()
348
+ : undefined;
349
+ const { updateInstruction } = getReminderMaintenanceInstructions(language, reminderId, metaValue);
280
350
  const projectionNote = formatReminderItemProjectionNote(language);
281
351
  const enProjectionPrefix = `${projectionNote} `;
282
352
  const systemPrefix = formatSystemNoticePrefix(language);
283
353
  if (language === 'zh') {
284
354
  if (managementTool) {
285
- const updateInstructionSafe = updateInstruction ?? `${managementTool}({ ... })`;
286
355
  return [
287
356
  `${systemPrefix} 提醒项 [${reminderId}](工具状态)`,
288
357
  '',
@@ -291,11 +360,6 @@ function formatReminderItemGuide(language, reminderId, content, options) {
291
360
  '',
292
361
  '默认不要在对外回复里专门确认、复述或总结它;只有它实际改变你的判断、计划或风险时,才提炼真正相关的部分。',
293
362
  '',
294
- `调整通道:使用 ${managementTool};不要用 update_reminder。`,
295
- '',
296
- `更新通道:${updateInstructionSafe}`,
297
- deleteInstruction,
298
- '',
299
363
  '---',
300
364
  content,
301
365
  ].join('\n');
@@ -304,12 +368,9 @@ function formatReminderItemGuide(language, reminderId, content, options) {
304
368
  return [
305
369
  `${systemPrefix} 提醒项 [${reminderId}]`,
306
370
  '',
307
- `${projectionNote}当前运行环境中有一条带有 meta 控制更新规则的提醒项。请把它当作状态参考,不要用 update_reminder 直接改写内容。`,
371
+ `${projectionNote}当前运行环境中有一条带有 meta 控制更新规则的提醒项。请把它当作状态参考,具体维护通道以前置维护参考为准。`,
308
372
  formatAutoMaintainedReminderManualMirrorBan(language),
309
373
  '',
310
- `更新通道:不要用 update_reminder;请按此处理:${updateInstruction}`,
311
- deleteInstruction,
312
- '',
313
374
  '---',
314
375
  content,
315
376
  ].join('\n');
@@ -322,9 +383,6 @@ function formatReminderItemGuide(language, reminderId, content, options) {
322
383
  '',
323
384
  '你应优先保留下一步行动、关键定位、运行/验证信息、容易丢的临时细节;不要重复差遣牒已覆盖的内容。进入新一程后,你的第一步是以清醒头脑重新审视并整理更新:删除冗余、纠正偏激/失真思路、压缩成高质量提醒项。若目前只是粗略过桥笔记,进入新一程后必须尽快收敛。',
324
385
  '',
325
- `如果你要更新这份接续包,可执行:update_reminder({ "reminder_id": "${reminderId}", "content": "..." })`,
326
- deleteInstruction,
327
- '',
328
386
  '---',
329
387
  content,
330
388
  ].join('\n');
@@ -347,15 +405,11 @@ function formatReminderItemGuide(language, reminderId, content, options) {
347
405
  '',
348
406
  scopeMaintenance,
349
407
  '',
350
- `如果你要更新这条提醒项,可执行:update_reminder({ "reminder_id": "${reminderId}", "content": "..." })`,
351
- deleteInstruction,
352
- '',
353
408
  '---',
354
409
  content,
355
410
  ].join('\n');
356
411
  }
357
412
  if (managementTool) {
358
- const updateInstructionSafe = updateInstruction ?? `${managementTool}({ ... })`;
359
413
  return `${systemPrefix} REMINDER [${reminderId}] (TOOL STATE)
360
414
 
361
415
  ${enProjectionPrefix}The current runtime environment has a tool-managed state reminder from ${managementTool}. Treat it as environment/tool state, not as your self-authored work note.
@@ -364,22 +418,16 @@ ${formatAutoMaintainedReminderManualMirrorBan(language)}
364
418
 
365
419
  By default, do not explicitly acknowledge, restate, or summarize it in your outward reply; only extract the parts that materially change your current judgment, plan, or risk.
366
420
 
367
- Change path: use ${managementTool}; do not use update_reminder.
368
-
369
- Update path: ${updateInstructionSafe}
370
- ${deleteInstruction}
371
421
  ---
372
422
  ${content}`;
373
423
  }
374
424
  if (updateInstruction) {
375
425
  return `${systemPrefix} REMINDER [${reminderId}]
376
426
 
377
- ${enProjectionPrefix}The current runtime environment has a reminder with a meta-controlled update path. Treat it as state/reference, and do not rewrite it directly with update_reminder.
427
+ ${enProjectionPrefix}The current runtime environment has a reminder with a meta-controlled update path. Treat it as state/reference; use the preceding maintenance reference for its maintenance channel.
378
428
 
379
429
  ${formatAutoMaintainedReminderManualMirrorBan(language)}
380
430
 
381
- Update path: do not use update_reminder; follow instead: ${updateInstruction}
382
- ${deleteInstruction}
383
431
  ---
384
432
  ${content}`;
385
433
  }
@@ -390,8 +438,6 @@ ${enProjectionPrefix}You set a continuation reminder so the runtime system can r
390
438
 
391
439
  Keep the next step, key pointers, run/verify info, and easy-to-lose volatile details here. Do not duplicate Taskdoc content. In the new course, your first step is to review and rewrite this with a clear head: remove redundancy, correct biased or distorted bridge notes, and compress it into a high-quality reminder. If this is only a rough bridge note, reconcile it early in the new course.
392
440
 
393
- Update path: update_reminder({ "reminder_id": "${reminderId}", "content": "..." })
394
- ${deleteInstruction}
395
441
  ---
396
442
  ${content}`;
397
443
  }
@@ -412,8 +458,6 @@ ${scopeGuide}
412
458
 
413
459
  ${scopeMaintenance}
414
460
 
415
- Update path: update_reminder({ "reminder_id": "${reminderId}", "content": "..." })
416
- ${deleteInstruction}
417
461
  ---
418
462
  ${content}`;
419
463
  }
@@ -2282,12 +2282,15 @@ async function handleGetDialogs(res, status) {
2282
2282
  }
2283
2283
  async function handleGetRunControlCounts(res) {
2284
2284
  try {
2285
- const counts = await (0, dialog_display_state_1.getRunControlCountsSnapshot)();
2285
+ const counts = await (0, dialog_display_state_1.createRunControlCountsMessage)();
2286
2286
  respondJson(res, 200, {
2287
2287
  success: true,
2288
2288
  counts: {
2289
2289
  proceeding: counts.proceeding,
2290
2290
  resumable: counts.resumable,
2291
+ snapshotEpoch: counts.snapshotEpoch,
2292
+ snapshotSeq: counts.snapshotSeq,
2293
+ timestamp: counts.timestamp,
2291
2294
  },
2292
2295
  });
2293
2296
  return true;
@@ -2771,13 +2774,7 @@ function broadcastDialogDeletes(clients, message) {
2771
2774
  async function broadcastRunControlCounts(clients) {
2772
2775
  if (!clients)
2773
2776
  return;
2774
- const counts = await (0, dialog_display_state_1.getRunControlCountsSnapshot)();
2775
- const data = JSON.stringify({
2776
- type: 'run_control_counts_evt',
2777
- proceeding: counts.proceeding,
2778
- resumable: counts.resumable,
2779
- timestamp: (0, time_1.formatUnifiedTimestamp)(new Date()),
2780
- });
2777
+ const data = JSON.stringify(await (0, dialog_display_state_1.createRunControlCountsMessage)());
2781
2778
  for (const ws of clients) {
2782
2779
  if (ws.readyState === 1) {
2783
2780
  ws.send(data);