dominds 1.26.2 → 1.26.4

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 (140) hide show
  1. package/README.md +2 -0
  2. package/README.zh.md +2 -0
  3. package/dist/cli.js +10 -8
  4. package/dist/docs/cli-usage.md +1 -1
  5. package/dist/docs/cli-usage.zh.md +1 -1
  6. package/dist/llm/gen/mock.js +11 -3
  7. package/dist/llm/kernel-driver/context-health.d.ts +1 -0
  8. package/dist/llm/kernel-driver/context-health.js +7 -0
  9. package/dist/llm/kernel-driver/drive.js +25 -30
  10. package/dist/llm/kernel-driver/idle-reminder-wake.js +6 -2
  11. package/dist/llm/kernel-driver/reminder-context.d.ts +26 -0
  12. package/dist/llm/kernel-driver/reminder-context.js +82 -0
  13. package/dist/llm/kernel-driver/reply-guidance.js +10 -4
  14. package/dist/llm/kernel-driver/tellask-special.js +50 -35
  15. package/dist/mcp/supervisor.js +2 -2
  16. package/dist/minds/system-prompt-parts.js +30 -30
  17. package/dist/minds/system-prompt.js +63 -40
  18. package/dist/persistence.js +15 -1
  19. package/dist/runtime/driver-messages.d.ts +38 -7
  20. package/dist/runtime/driver-messages.js +320 -119
  21. package/dist/runtime/inter-dialog-format.js +24 -12
  22. package/dist/runtime/reply-prompt-copy.d.ts +8 -8
  23. package/dist/runtime/reply-prompt-copy.js +69 -38
  24. package/dist/server/api-routes.js +7 -2
  25. package/dist/server/certificates.js +65 -25
  26. package/dist/server/dominds-self-update.d.ts +1 -0
  27. package/dist/server/dominds-self-update.js +113 -56
  28. package/dist/supervisor-protocol.d.ts +2 -3
  29. package/dist/tools/mcp.js +12 -12
  30. package/dist/tools/prompts/control/en/index.md +2 -2
  31. package/dist/tools/prompts/control/en/principles.md +12 -12
  32. package/dist/tools/prompts/control/en/scenarios.md +5 -5
  33. package/dist/tools/prompts/control/en/tools.md +10 -10
  34. package/dist/tools/prompts/control/zh/index.md +3 -3
  35. package/dist/tools/prompts/control/zh/principles.md +12 -12
  36. package/dist/tools/prompts/control/zh/scenarios.md +7 -7
  37. package/dist/tools/prompts/control/zh/tools.md +11 -11
  38. package/dist/tools/prompts/mcp_admin/en/principles.md +4 -4
  39. package/dist/tools/prompts/mcp_admin/en/scenarios.md +1 -1
  40. package/dist/tools/prompts/mcp_admin/en/tools.md +3 -3
  41. package/dist/tools/prompts/mcp_admin/zh/principles.md +4 -4
  42. package/dist/tools/prompts/mcp_admin/zh/scenarios.md +1 -1
  43. package/dist/tools/prompts/mcp_admin/zh/tools.md +3 -3
  44. package/dist/tools/team_mgmt-mcp-manual.js +12 -12
  45. package/package.json +2 -1
  46. package/webapp/dist/assets/{_basePickBy-DUivPKf7.js → _basePickBy-mFK6EVZU.js} +3 -3
  47. package/webapp/dist/assets/{_basePickBy-DUivPKf7.js.map → _basePickBy-mFK6EVZU.js.map} +1 -1
  48. package/webapp/dist/assets/{_baseUniq-hcs024vD.js → _baseUniq-C8zyOqn7.js} +2 -2
  49. package/webapp/dist/assets/{_baseUniq-hcs024vD.js.map → _baseUniq-C8zyOqn7.js.map} +1 -1
  50. package/webapp/dist/assets/{arc-Dr6-FXp5.js → arc-Vdl3uhV8.js} +2 -2
  51. package/webapp/dist/assets/{arc-Dr6-FXp5.js.map → arc-Vdl3uhV8.js.map} +1 -1
  52. package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-DXqcDq4R.js → architectureDiagram-2XIMDMQ5-D3Xtb8u_.js} +7 -7
  53. package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-DXqcDq4R.js.map → architectureDiagram-2XIMDMQ5-D3Xtb8u_.js.map} +1 -1
  54. package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-IIP6LGXS.js → blockDiagram-WCTKOSBZ-Bozcnodw.js} +7 -7
  55. package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-IIP6LGXS.js.map → blockDiagram-WCTKOSBZ-Bozcnodw.js.map} +1 -1
  56. package/webapp/dist/assets/{c4Diagram-IC4MRINW-D_d3F9XD.js → c4Diagram-IC4MRINW-CLkxlY6N.js} +3 -3
  57. package/webapp/dist/assets/{c4Diagram-IC4MRINW-D_d3F9XD.js.map → c4Diagram-IC4MRINW-CLkxlY6N.js.map} +1 -1
  58. package/webapp/dist/assets/{channel-CWWjsXtU.js → channel-CqGyLCM_.js} +2 -2
  59. package/webapp/dist/assets/{channel-CWWjsXtU.js.map → channel-CqGyLCM_.js.map} +1 -1
  60. package/webapp/dist/assets/{chunk-4BX2VUAB-BF4yph2W.js → chunk-4BX2VUAB-BNsJpMh4.js} +2 -2
  61. package/webapp/dist/assets/{chunk-4BX2VUAB-BF4yph2W.js.map → chunk-4BX2VUAB-BNsJpMh4.js.map} +1 -1
  62. package/webapp/dist/assets/{chunk-55IACEB6-Hn3CmDYz.js → chunk-55IACEB6-B59p6vzX.js} +2 -2
  63. package/webapp/dist/assets/{chunk-55IACEB6-Hn3CmDYz.js.map → chunk-55IACEB6-B59p6vzX.js.map} +1 -1
  64. package/webapp/dist/assets/{chunk-FMBD7UC4-C05pl9Ov.js → chunk-FMBD7UC4-CB17a_Ki.js} +2 -2
  65. package/webapp/dist/assets/{chunk-FMBD7UC4-C05pl9Ov.js.map → chunk-FMBD7UC4-CB17a_Ki.js.map} +1 -1
  66. package/webapp/dist/assets/{chunk-JSJVCQXG-BVlq_BAS.js → chunk-JSJVCQXG-DVnVflN-.js} +2 -2
  67. package/webapp/dist/assets/{chunk-JSJVCQXG-BVlq_BAS.js.map → chunk-JSJVCQXG-DVnVflN-.js.map} +1 -1
  68. package/webapp/dist/assets/{chunk-KX2RTZJC-BQoaRWif.js → chunk-KX2RTZJC-D9_5LvIO.js} +2 -2
  69. package/webapp/dist/assets/{chunk-KX2RTZJC-BQoaRWif.js.map → chunk-KX2RTZJC-D9_5LvIO.js.map} +1 -1
  70. package/webapp/dist/assets/{chunk-NQ4KR5QH-0okCAXtW.js → chunk-NQ4KR5QH-CZWI2G2c.js} +4 -4
  71. package/webapp/dist/assets/{chunk-NQ4KR5QH-0okCAXtW.js.map → chunk-NQ4KR5QH-CZWI2G2c.js.map} +1 -1
  72. package/webapp/dist/assets/{chunk-QZHKN3VN-DEiprgz-.js → chunk-QZHKN3VN-WCLg8cNX.js} +2 -2
  73. package/webapp/dist/assets/{chunk-QZHKN3VN-DEiprgz-.js.map → chunk-QZHKN3VN-WCLg8cNX.js.map} +1 -1
  74. package/webapp/dist/assets/{chunk-WL4C6EOR-B-Xkb3lo.js → chunk-WL4C6EOR-BFkz_P__.js} +6 -6
  75. package/webapp/dist/assets/{chunk-WL4C6EOR-B-Xkb3lo.js.map → chunk-WL4C6EOR-BFkz_P__.js.map} +1 -1
  76. package/webapp/dist/assets/{classDiagram-VBA2DB6C-DCCQrdwF.js → classDiagram-VBA2DB6C-DWQ1VnaI.js} +7 -7
  77. package/webapp/dist/assets/{classDiagram-VBA2DB6C-DCCQrdwF.js.map → classDiagram-VBA2DB6C-DWQ1VnaI.js.map} +1 -1
  78. package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-DCCQrdwF.js → classDiagram-v2-RAHNMMFH-DWQ1VnaI.js} +7 -7
  79. package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-DCCQrdwF.js.map → classDiagram-v2-RAHNMMFH-DWQ1VnaI.js.map} +1 -1
  80. package/webapp/dist/assets/{clone-Drtik9pk.js → clone-D3QHqx6z.js} +2 -2
  81. package/webapp/dist/assets/{clone-Drtik9pk.js.map → clone-D3QHqx6z.js.map} +1 -1
  82. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-BBWvHErL.js → cose-bilkent-S5V4N54A-D2dZHRG3.js} +2 -2
  83. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-BBWvHErL.js.map → cose-bilkent-S5V4N54A-D2dZHRG3.js.map} +1 -1
  84. package/webapp/dist/assets/{dagre-KLK3FWXG-2qk0ikdt.js → dagre-KLK3FWXG-Cwz7pFDo.js} +7 -7
  85. package/webapp/dist/assets/{dagre-KLK3FWXG-2qk0ikdt.js.map → dagre-KLK3FWXG-Cwz7pFDo.js.map} +1 -1
  86. package/webapp/dist/assets/{diagram-E7M64L7V-C1DbHDbf.js → diagram-E7M64L7V-C6z0VVoW.js} +8 -8
  87. package/webapp/dist/assets/{diagram-E7M64L7V-C1DbHDbf.js.map → diagram-E7M64L7V-C6z0VVoW.js.map} +1 -1
  88. package/webapp/dist/assets/{diagram-IFDJBPK2-DToz8zk9.js → diagram-IFDJBPK2-CZ1KR1hO.js} +7 -7
  89. package/webapp/dist/assets/{diagram-IFDJBPK2-DToz8zk9.js.map → diagram-IFDJBPK2-CZ1KR1hO.js.map} +1 -1
  90. package/webapp/dist/assets/{diagram-P4PSJMXO-B9V-tQMe.js → diagram-P4PSJMXO-ChwZDZYa.js} +7 -7
  91. package/webapp/dist/assets/{diagram-P4PSJMXO-B9V-tQMe.js.map → diagram-P4PSJMXO-ChwZDZYa.js.map} +1 -1
  92. package/webapp/dist/assets/{erDiagram-INFDFZHY-CV68FwGf.js → erDiagram-INFDFZHY-DCnHsk_Z.js} +5 -5
  93. package/webapp/dist/assets/{erDiagram-INFDFZHY-CV68FwGf.js.map → erDiagram-INFDFZHY-DCnHsk_Z.js.map} +1 -1
  94. package/webapp/dist/assets/{flowDiagram-PKNHOUZH-CW06almb.js → flowDiagram-PKNHOUZH-C5Hi85ST.js} +7 -7
  95. package/webapp/dist/assets/{flowDiagram-PKNHOUZH-CW06almb.js.map → flowDiagram-PKNHOUZH-C5Hi85ST.js.map} +1 -1
  96. package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-C96NncCU.js → ganttDiagram-A5KZAMGK-vT15RP6A.js} +3 -3
  97. package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-C96NncCU.js.map → ganttDiagram-A5KZAMGK-vT15RP6A.js.map} +1 -1
  98. package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-CAuIexWi.js → gitGraphDiagram-K3NZZRJ6-Ct5XDpFu.js} +8 -8
  99. package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-CAuIexWi.js.map → gitGraphDiagram-K3NZZRJ6-Ct5XDpFu.js.map} +1 -1
  100. package/webapp/dist/assets/{graph-CvhwAY6w.js → graph-CqFTrHii.js} +3 -3
  101. package/webapp/dist/assets/{graph-CvhwAY6w.js.map → graph-CqFTrHii.js.map} +1 -1
  102. package/webapp/dist/assets/{index-BOO_zFrI.js → index-C_PzQ5W5.js} +600 -400
  103. package/webapp/dist/assets/{index-BOO_zFrI.js.map → index-C_PzQ5W5.js.map} +1 -1
  104. package/webapp/dist/assets/{infoDiagram-LFFYTUFH-C16Sckpz.js → infoDiagram-LFFYTUFH-DlyOw8IT.js} +6 -6
  105. package/webapp/dist/assets/{infoDiagram-LFFYTUFH-C16Sckpz.js.map → infoDiagram-LFFYTUFH-DlyOw8IT.js.map} +1 -1
  106. package/webapp/dist/assets/{ishikawaDiagram-PHBUUO56-oNG6I0p3.js → ishikawaDiagram-PHBUUO56-iZCVn19K.js} +2 -2
  107. package/webapp/dist/assets/{ishikawaDiagram-PHBUUO56-oNG6I0p3.js.map → ishikawaDiagram-PHBUUO56-iZCVn19K.js.map} +1 -1
  108. package/webapp/dist/assets/{journeyDiagram-4ABVD52K-437hhFHC.js → journeyDiagram-4ABVD52K-B95gnBKj.js} +5 -5
  109. package/webapp/dist/assets/{journeyDiagram-4ABVD52K-437hhFHC.js.map → journeyDiagram-4ABVD52K-B95gnBKj.js.map} +1 -1
  110. package/webapp/dist/assets/{kanban-definition-K7BYSVSG-DsCV_Tpx.js → kanban-definition-K7BYSVSG-DQ2gfPUK.js} +3 -3
  111. package/webapp/dist/assets/{kanban-definition-K7BYSVSG-DsCV_Tpx.js.map → kanban-definition-K7BYSVSG-DQ2gfPUK.js.map} +1 -1
  112. package/webapp/dist/assets/{layout-BttZf7fQ.js → layout-VOBFudHV.js} +5 -5
  113. package/webapp/dist/assets/{layout-BttZf7fQ.js.map → layout-VOBFudHV.js.map} +1 -1
  114. package/webapp/dist/assets/{linear-B75vD4Ho.js → linear-BtBp93s2.js} +2 -2
  115. package/webapp/dist/assets/{linear-B75vD4Ho.js.map → linear-BtBp93s2.js.map} +1 -1
  116. package/webapp/dist/assets/{mindmap-definition-YRQLILUH-DA1-XaNi.js → mindmap-definition-YRQLILUH-m2w1nBbY.js} +4 -4
  117. package/webapp/dist/assets/{mindmap-definition-YRQLILUH-DA1-XaNi.js.map → mindmap-definition-YRQLILUH-m2w1nBbY.js.map} +1 -1
  118. package/webapp/dist/assets/{pieDiagram-SKSYHLDU-Bx6hUJ4Q.js → pieDiagram-SKSYHLDU-ByoyS2as.js} +8 -8
  119. package/webapp/dist/assets/{pieDiagram-SKSYHLDU-Bx6hUJ4Q.js.map → pieDiagram-SKSYHLDU-ByoyS2as.js.map} +1 -1
  120. package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-zyduIle0.js → quadrantDiagram-337W2JSQ-BnKSsLfA.js} +3 -3
  121. package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-zyduIle0.js.map → quadrantDiagram-337W2JSQ-BnKSsLfA.js.map} +1 -1
  122. package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-BgfjyEJM.js → requirementDiagram-Z7DCOOCP-jU2C7qJN.js} +4 -4
  123. package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-BgfjyEJM.js.map → requirementDiagram-Z7DCOOCP-jU2C7qJN.js.map} +1 -1
  124. package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-lmOWaczS.js → sankeyDiagram-WA2Y5GQK-R175tX8b.js} +2 -2
  125. package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-lmOWaczS.js.map → sankeyDiagram-WA2Y5GQK-R175tX8b.js.map} +1 -1
  126. package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-DqJz-iYI.js → sequenceDiagram-2WXFIKYE-CBhN4j2Q.js} +4 -4
  127. package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-DqJz-iYI.js.map → sequenceDiagram-2WXFIKYE-CBhN4j2Q.js.map} +1 -1
  128. package/webapp/dist/assets/{stateDiagram-RAJIS63D-CngWYuX-.js → stateDiagram-RAJIS63D-DZSAyRfJ.js} +9 -9
  129. package/webapp/dist/assets/{stateDiagram-RAJIS63D-CngWYuX-.js.map → stateDiagram-RAJIS63D-DZSAyRfJ.js.map} +1 -1
  130. package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-BxyHvrvU.js → stateDiagram-v2-FVOUBMTO-x29lKJpl.js} +5 -5
  131. package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-BxyHvrvU.js.map → stateDiagram-v2-FVOUBMTO-x29lKJpl.js.map} +1 -1
  132. package/webapp/dist/assets/{timeline-definition-YZTLITO2-C7t6WVS3.js → timeline-definition-YZTLITO2-BQR2qEXt.js} +3 -3
  133. package/webapp/dist/assets/{timeline-definition-YZTLITO2-C7t6WVS3.js.map → timeline-definition-YZTLITO2-BQR2qEXt.js.map} +1 -1
  134. package/webapp/dist/assets/{treemap-KZPCXAKY-BDZ3n5TC.js → treemap-KZPCXAKY-b823qTE1.js} +5 -5
  135. package/webapp/dist/assets/{treemap-KZPCXAKY-BDZ3n5TC.js.map → treemap-KZPCXAKY-b823qTE1.js.map} +1 -1
  136. package/webapp/dist/assets/{vennDiagram-LZ73GAT5-CEw7GPed.js → vennDiagram-LZ73GAT5-BrxPNUYz.js} +2 -2
  137. package/webapp/dist/assets/{vennDiagram-LZ73GAT5-CEw7GPed.js.map → vennDiagram-LZ73GAT5-BrxPNUYz.js.map} +1 -1
  138. package/webapp/dist/assets/{xychartDiagram-JWTSCODW-DmS8BiaA.js → xychartDiagram-JWTSCODW-BgOzlz6Z.js} +3 -3
  139. package/webapp/dist/assets/{xychartDiagram-JWTSCODW-DmS8BiaA.js.map → xychartDiagram-JWTSCODW-BgOzlz6Z.js.map} +1 -1
  140. package/webapp/dist/index.html +1 -1
@@ -93,13 +93,13 @@ function formatRegisteredTellaskTellaskerUpdateNotice(language) {
93
93
  if (language === 'zh') {
94
94
  return [
95
95
  prefix,
96
- '刚才那轮诉请已被你后续发出的新要求取代;运行时已登记这次更新。',
96
+ '刚才那轮诉请已被你后续发出的新要求取代;Dominds 已登记这次更新。',
97
97
  '如果目标支线正忙,更新会在下一次安全推进边界进入目标支线;请把目标支线里的更新气泡作为可见确认点。',
98
98
  ].join('\n');
99
99
  }
100
100
  return [
101
101
  prefix,
102
- 'That earlier request has been superseded by your later updated request; runtime has registered the update.',
102
+ 'That earlier request has been superseded by your later updated request; Dominds has registered the update.',
103
103
  'If the target Side Dialog is busy, the update will enter it at the next safe drive boundary. Use the target Side Dialog update bubble as the visible confirmation point.',
104
104
  ].join('\n');
105
105
  }
@@ -122,20 +122,25 @@ function formatRegisteredTellaskTellaskeeUpdateNotice(language) {
122
122
  }
123
123
  function formatNewCourseStartPrompt(language, args) {
124
124
  const noticePrefix = formatSystemNoticePrefix(language);
125
+ // Business scenario: after clear_mind or critical auto-clear, the model is in a fresh course
126
+ // but still sees a Dominds-inserted notice as the latest "user" message. If the copy sounds
127
+ // like an implementation command ("runtime instruction"), models tend to acknowledge it or churn
128
+ // reminders as a task. Say the user-visible business state instead: Dominds started a new course,
129
+ // this is not a user request, first reconcile bridge reminders only if needed, then resume work.
125
130
  if (language === 'zh') {
126
131
  const prefix = args.source === 'clear_mind'
127
132
  ? `你刚清理头脑,开启了第 ${args.nextCourse} 程对话。`
128
- : `系统因上下文已告急(critical)而自动开启了第 ${args.nextCourse} 程对话。`;
133
+ : `Dominds 因上下文已告急而自动开启了第 ${args.nextCourse} 程对话。`;
129
134
  return (`${noticePrefix} ${prefix} ` +
130
- '这是一条运行时换程指令,不是新的用户诉求;不要把这条提示当成新的待办,也不要只回复“收到/好的/我会先整理提醒项”。' +
135
+ '这是 Dominds 的换程提示,不是新的用户诉求;不要把这条提示当成新的待办,也不要只回复“收到/好的/我会先整理提醒项”。' +
131
136
  '现在已经进入新一程:上下文已经不再吃紧,告急状况已改观。第一步先复核并在必要时整理接续包提醒项,以清醒头脑删除冗余、纠正偏激或失真的过桥思路、压缩成高质量提醒项;若提醒项已经足够清晰,就不要为了整理而整理。' +
132
137
  '完成这一步后,直接继续推进原任务本身;除非任务自然需要对用户交付结果,否则不要为这条提示单独回复。');
133
138
  }
134
139
  const prefix = args.source === 'clear_mind'
135
140
  ? `This is dialog course #${args.nextCourse}. You just cleared your mind.`
136
- : `System auto-started dialog course #${args.nextCourse} because context health is critical.`;
141
+ : `Dominds auto-started dialog course #${args.nextCourse} because context was critical.`;
137
142
  return (`${noticePrefix} ${prefix} ` +
138
- 'This is a runtime course-transition instruction, not a new user request; do not treat it as a new to-do, and do not reply with a standalone "acknowledged/ok/I will reorganize the reminders first". ' +
143
+ 'This is a Dominds course-transition notice, not a new user request; do not treat it as a new to-do, and do not reply with a standalone "acknowledged/ok/I will reorganize the reminders first". ' +
139
144
  'You are now in a new course: your first step is to review and, if needed, rewrite any continuation-package reminders with a clear head, remove redundancy, correct biased or distorted bridge notes, and compress them into high-quality reminders; if the reminders are already clear enough, do not churn on them. ' +
140
145
  'After that, continue the underlying task itself directly; unless the task naturally calls for a user-facing delivery, do not send a standalone reply just for this notice.');
141
146
  }
@@ -147,7 +152,7 @@ function formatDiligenceAutoContinuePrompt(language, diligenceText) {
147
152
  }
148
153
  if (language === 'zh') {
149
154
  return [
150
- `${noticePrefix} 这是一条运行时自动续推指令,不是新的用户诉求。`,
155
+ `${noticePrefix} 这是 Dominds 的自动续推提示,不是新的用户诉求。`,
151
156
  '不要把这条提示当成新的待办,也不要只回复“收到/好的/我先想想/我会先整理一下”。',
152
157
  '请直接按下面的引导继续推进任务;若形成结论,必须尽快落地为实际动作,不要停在“只汇报决定/只确认收到”。',
153
158
  '',
@@ -157,7 +162,7 @@ function formatDiligenceAutoContinuePrompt(language, diligenceText) {
157
162
  ].join('\n');
158
163
  }
159
164
  return [
160
- `${noticePrefix} This is a runtime auto-continue instruction, not a new user request.`,
165
+ `${noticePrefix} This is a Dominds auto-continue notice, not a new user request.`,
161
166
  'Do not treat this notice as a new to-do, and do not reply with a standalone "acknowledged/ok/I will think first/I will organize things first".',
162
167
  'Follow the guidance below and continue the task directly; if you reach a conclusion, turn it into concrete action promptly instead of stopping at a decision report or acknowledgement.',
163
168
  '',
@@ -167,95 +172,286 @@ function formatDiligenceAutoContinuePrompt(language, diligenceText) {
167
172
  ].join('\n');
168
173
  }
169
174
  function formatReminderContextGuide(language) {
175
+ // Business scenario: reminder records are injected near ordinary dialog messages so the model
176
+ // can keep useful state, but the UI shows them outside the chat transcript. The copy must make
177
+ // that product fact plain without exposing provider/role plumbing: reminders are current-work
178
+ // references, not new user requests, and they should not trigger standalone acknowledgements.
170
179
  if (language === 'zh') {
171
180
  return [
172
181
  `${formatSystemNoticePrefix(language)} 提醒项上下文块开始`,
173
- '以下是当前可见提醒项的运行时上下文投影。由于当前 LLM Provider 通常不支持 role=environment,Dominds 默认把系统运行时提醒包装投影为 role=user;个别提醒项可由其 owner 按自身契约选择 role。无论最终 role 如何,它们都不是用户的新诉求/指令,也不是聊天正文。',
182
+ '以下是 Dominds 为你放到当前上下文里的可见提醒项。它们不是用户的新诉求/指令,也不是聊天正文。',
174
183
  '在 WebUI 中,用户通过独立的 Reminder 小组件/面板项看到这些提醒,并能把它们和聊天正文区分开。',
175
184
  '请把提醒项作为手头工作/状态参考;只有实际改变你的判断、计划或风险的信息,才需要提炼进后续有实质内容的对外回复。不要为了提醒项单独回复“收到/已了解/静默吸收”。',
176
185
  ].join('\n');
177
186
  }
178
187
  return [
179
188
  `${formatSystemNoticePrefix(language)} Reminder context block begins`,
180
- 'The following visible reminders are runtime-added context projections. Because current LLM providers usually do not support role=environment, Dominds projects default system-runtime reminder wrappers as role=user; individual reminder owners may choose the role required by their own contract. Regardless of their final role, these reminders are not new user requests/instructions, and not chat transcript text.',
189
+ 'The following visible reminders were added to the current context by Dominds. They are not new user requests/instructions, and not chat transcript text.',
181
190
  'In the WebUI, the user sees these reminders through a separate Reminder widget/panel item and can distinguish them from the chat transcript.',
182
191
  'Use reminders as current-work/state references; only carry information into a later substantive outward reply when it materially changes your current judgment, plan, or risk. Do not send a standalone "acknowledged/noted/silently absorbed" reply for reminder items.',
183
192
  ].join('\n');
184
193
  }
185
194
  function formatReminderItemProjectionNote(language) {
186
- return language === 'zh' ? '运行时提醒项投影:' : 'Runtime reminder projection:';
195
+ return language === 'zh' ? 'Dominds 提醒项说明:' : 'Dominds reminder note:';
196
+ }
197
+ function formatZhReminderBusinessTail(business) {
198
+ switch (business.kind) {
199
+ case 'none':
200
+ return '';
201
+ case 'user_followup_after_completed_handoff':
202
+ // Runtime has already identified a real user message after the earlier handoff was
203
+ // reported back as complete. This is not an active reply-obligation state anymore: the
204
+ // model should simply communicate with the user according to the current message.
205
+ //
206
+ // Business reason for this exact footer: a completed Sideline Dialog often still carries
207
+ // reminder/status text from the long-line handoff. When a user later asks "what happened?"
208
+ // or gives a new instruction in that same dialog, the model may see those reminders and
209
+ // keep advancing the old handoff instead of answering the visible user. Runtime can tell
210
+ // from durable state that the handoff was already delivered, so the footer must say the
211
+ // business state directly: old handoff done, current message belongs to the user.
212
+ //
213
+ // Keep the wording deliberately neutral about reminders and tools. A user may explicitly
214
+ // ask the agent to reorganize reminders so a later long-running handoff can resume from a
215
+ // corrected state. If this footer said "do not organize reminders" or "only answer", it
216
+ // would block a valid user request and recreate the same kind of over-specific guidance
217
+ // bug in the opposite direction.
218
+ return '现在是用户在追问你。前面那件转交任务已经回报完成了,不需要再推进;请按用户这条消息正常交流和处理。';
219
+ case 'pending_user_interjection_with_parked_reply':
220
+ // A real user message interrupted an unfinished handoff. The old handoff is parked,
221
+ // so the model must not rush back to reply closure before the user sees an answer.
222
+ return '当前仍有真实用户插话尚未得到可见回复,且原有回贴任务已暂存;先完成对用户插话的回应,不要抢先切回原来的回贴收口。';
223
+ case 'pending_user_interjection':
224
+ // No special handoff state is competing with the user; the shortest useful instruction
225
+ // is simply to answer the still-unanswered user interjection.
226
+ return '当前仍有真实用户插话尚未得到可见回复;先完成对用户插话的回应。';
227
+ case 'pending_user_interjection_with_active_reply':
228
+ // A user interjection is pending while a handoff is still active. The user still gets the
229
+ // next visible answer; reply closure only happens if answering that user message naturally
230
+ // becomes the final handoff delivery.
231
+ return '当前仍有真实用户插话尚未得到可见回复,同时还有回贴任务未完成;先完成对用户插话的回应,只有在这条用户插话本身已经自然到达最终交付时,才进入回贴收口。';
232
+ case 'active_reply_obligation':
233
+ // There is still an unfinished handoff, but no user interjection is pending. Say this is
234
+ // a final-delivery constraint, not a command to abandon necessary current work.
235
+ return '当前仍有回贴任务未完成;它是最终交付要求,不是要求你立刻停止当前必要工作,但到达最终交付时必须按 Dominds 指定方式收口。';
236
+ default: {
237
+ const _exhaustive = business;
238
+ throw new Error(`Unhandled zh reminder business state: ${String(_exhaustive)}`);
239
+ }
240
+ }
241
+ }
242
+ function formatEnReminderBusinessTail(business) {
243
+ switch (business.kind) {
244
+ case 'none':
245
+ return '';
246
+ case 'user_followup_after_completed_handoff':
247
+ // Runtime has already identified a real user message after the earlier handoff was
248
+ // reported back as complete. This is not an active reply-obligation state anymore: the
249
+ // model should simply communicate with the user according to the current message.
250
+ //
251
+ // Business reason for this exact footer: a completed Sideline Dialog often still carries
252
+ // reminder/status text from the long-line handoff. When a user later asks "what happened?"
253
+ // or gives a new instruction in that same dialog, the model may see those reminders and
254
+ // keep advancing the old handoff instead of answering the visible user. Runtime can tell
255
+ // from durable state that the handoff was already delivered, so the footer must say the
256
+ // business state directly: old handoff done, current message belongs to the user.
257
+ //
258
+ // Keep the wording deliberately neutral about reminders and tools. A user may explicitly
259
+ // ask the agent to reorganize reminders so a later long-running handoff can resume from a
260
+ // corrected state. If this footer said "do not organize reminders" or "only answer", it
261
+ // would block a valid user request and recreate the same kind of over-specific guidance
262
+ // bug in the opposite direction.
263
+ return 'The user is asking you a follow-up now. The earlier handed-off task has already been reported back as complete, so there is nothing more to advance there. Talk with the user normally and handle this current message.';
264
+ case 'pending_user_interjection_with_parked_reply':
265
+ // A real user message interrupted an unfinished handoff. The old handoff is parked,
266
+ // so the model must not rush back to reply closure before the user sees an answer.
267
+ return "There is still a real user interjection without a visible reply, and the earlier handoff is parked; finish answering the user's interjection first, and do not switch back to closing the earlier reply yet.";
268
+ case 'pending_user_interjection':
269
+ // No special handoff state is competing with the user; the shortest useful instruction
270
+ // is simply to answer the still-unanswered user interjection.
271
+ return "There is still a real user interjection without a visible reply; finish answering the user's interjection first.";
272
+ case 'pending_user_interjection_with_active_reply':
273
+ // A user interjection is pending while a handoff is still active. The user still gets the
274
+ // next visible answer; reply closure only happens if answering that user message naturally
275
+ // becomes the final handoff delivery.
276
+ return "There is still a real user interjection without a visible reply, while a reply task is also unfinished; finish answering the user's interjection first, and enter reply closure only if this user interjection itself naturally reaches final delivery.";
277
+ case 'active_reply_obligation':
278
+ // There is still an unfinished handoff, but no user interjection is pending. Say this is
279
+ // a final-delivery constraint, not a command to abandon necessary current work.
280
+ return 'A reply task is still unfinished; it is a final-delivery requirement, not a demand to stop necessary current work immediately, but final delivery must close through the path Dominds names.';
281
+ default: {
282
+ const _exhaustive = business;
283
+ throw new Error(`Unhandled en reminder business state: ${String(_exhaustive)}`);
284
+ }
285
+ }
286
+ }
287
+ function formatZhReminderContextHealthTail(contextHealth) {
288
+ switch (contextHealth.kind) {
289
+ case 'normal':
290
+ return '';
291
+ case 'caution':
292
+ // In tight context, reminders may contain stale next steps that were meant as bridge
293
+ // notes. The model should preserve/prepare course transition instead of expanding the
294
+ // same course by following old reminder content.
295
+ return '当前上下文已吃紧:提醒项正文里的“下一步/接续动作/任务安排”默认都是给下一程以清醒头脑复核后执行的,不是让你在本程继续跑。不要为了执行提醒项里的旧下一步继续扩张上下文;本程最高优先级是按上下文吃紧处置要求保全接续信息,并尽快 `clear_mind`。';
296
+ case 'critical':
297
+ // Critical context is stricter than caution: do not do ordinary work from reminders;
298
+ // preserve what matters and clear the course immediately.
299
+ return '当前上下文已告急:提醒项正文里的“下一步/接续动作/任务安排”默认都是给下一程以清醒头脑复核后执行的,不是让你在本程继续跑。不要执行提醒项里的旧下一步、旧诉请或旧工具重试;本程最高优先级是按上下文告急处置要求保全接续信息,并立即 `clear_mind`。';
300
+ default: {
301
+ const _exhaustive = contextHealth;
302
+ throw new Error(`Unhandled zh reminder context health state: ${String(_exhaustive)}`);
303
+ }
304
+ }
305
+ }
306
+ function formatEnReminderContextHealthTail(contextHealth) {
307
+ switch (contextHealth.kind) {
308
+ case 'normal':
309
+ return '';
310
+ case 'caution':
311
+ // In tight context, reminders may contain stale next steps that were meant as bridge
312
+ // notes. The model should preserve/prepare course transition instead of expanding the
313
+ // same course by following old reminder content.
314
+ return 'Context is tight: any "next step", continuation action, or task plan inside reminders is meant for the next course to review and run with a clear head, not for this course to keep executing. Do not expand context by performing old next steps from reminders; this course must first preserve the continuation details required by the tight-context guidance, then call `clear_mind` soon.';
315
+ case 'critical':
316
+ // Critical context is stricter than caution: do not do ordinary work from reminders;
317
+ // preserve what matters and clear the course immediately.
318
+ return 'Context is critical: any "next step", continuation action, or task plan inside reminders is meant for the next course to review and run with a clear head, not for this course to keep executing. Do not perform old next steps, old handed-off requests, or old tool retries from reminders; this course must first preserve the continuation details required by the critical-context guidance, then call `clear_mind` immediately.';
319
+ default: {
320
+ const _exhaustive = contextHealth;
321
+ throw new Error(`Unhandled en reminder context health state: ${String(_exhaustive)}`);
322
+ }
323
+ }
324
+ }
325
+ function joinReminderFooterTails(language, tails) {
326
+ const nonEmptyTails = tails.filter((tail) => tail !== '');
327
+ if (nonEmptyTails.length === 0)
328
+ return '';
329
+ return language === 'zh' ? nonEmptyTails.join('') : nonEmptyTails.join(' ');
330
+ }
331
+ function formatZhNormalAutoContinueByDialogScope(scope) {
332
+ switch (scope.kind) {
333
+ case 'main_dialog':
334
+ // Main Dialogs own the broad task and do not have a requester to tellaskBack. When the only
335
+ // apparent action is reminder maintenance, ask the human only for genuinely missing human
336
+ // input/authorization; otherwise hand control back to the Main Dialog keep-alive setting
337
+ // instead of making up work.
338
+ return '当前是主线对话。请基于提醒项之外的已有任务状态判断下一步:若已有明确、相关且有价值的任务动作,就继续执行;若唯一看似可做的只是新增、更新、删除、压缩或整理提醒项,不要把提醒项维护当成续推动作。若确实缺少人类本人澄清、裁决、验收口径、授权或输入,才用 `askHuman({ tellaskContent })` 提出一个最小且可回答的问题。若不缺这些信息、也没有真实任务动作,不要为了避免停顿而寻找无关小事;让主线按 Dominds 的主线机制处理,鞭策开启时会继续续推,鞭策关闭且没有真实动作时可以自然收住。';
339
+ case 'side_dialog':
340
+ // Side Dialogs are answering a requester. If blocked on requirement clarification, a business
341
+ // decision, acceptance criteria, or requester-held input, tellaskBack is the local loop and
342
+ // askHuman is only for information that truly must come from the human.
343
+ return '当前是支线对话。请基于提醒项之外的已有任务状态判断下一步:若已有明确、相关且有价值的任务动作,就继续执行;若唯一看似可做的只是新增、更新、删除、压缩或整理提醒项,不要把提醒项维护当成续推动作。若缺少需求澄清、业务裁决、验收口径、授权或输入,先判断缺的东西该由谁补:如果诉请者能补需求澄清/业务裁决/验收口径/缺失输入,先按当前工具规则考虑 `tellaskBack({ tellaskContent })` 回问诉请者;只有确实需要人类本人澄清、决策、授权或输入时,才用 `askHuman({ tellaskContent })` 提出一个最小且可回答的问题。若不缺这些信息、也没有真实任务动作,不要为了避免停顿而寻找无关小事;让支线按 Dominds 的支线机制处理:需要回贴时会收到回贴提醒,已完成且无新诉求时可以自然收住。';
344
+ default: {
345
+ const _exhaustive = scope;
346
+ throw new Error(`Unhandled zh reminder dialog scope: ${String(_exhaustive)}`);
347
+ }
348
+ }
349
+ }
350
+ function formatEnNormalAutoContinueByDialogScope(scope) {
351
+ switch (scope.kind) {
352
+ case 'main_dialog':
353
+ // Main Dialogs own the broad task and do not have a requester to tellaskBack. When the only
354
+ // apparent action is reminder maintenance, ask the human only for genuinely missing human
355
+ // input/authorization; otherwise hand control back to the Main Dialog keep-alive setting
356
+ // instead of making up work.
357
+ return "This is a Main Dialog. Judge the next step from existing task state outside the reminder items: if there is a clear, relevant, valuable actual task action, continue with it; if the only apparent action is to add, update, delete, compress, or organize reminders, do not treat reminder maintenance as task progress. Use `askHuman({ tellaskContent })` only when you truly need clarification, a decision, acceptance criteria, authorization, or input from the human; ask one minimal, answerable question. If you do not need any of that and there is no real task action, do not invent unrelated work just to avoid a pause; let the Main Dialog follow Dominds' mainline mechanism: diligence can continue it when enabled, and when diligence is disabled with no real action, it may naturally settle.";
358
+ case 'side_dialog':
359
+ // Side Dialogs are answering a requester. If blocked on requirement clarification, a business
360
+ // decision, acceptance criteria, or requester-held input, tellaskBack is the local loop and
361
+ // askHuman is only for information that truly must come from the human.
362
+ return "This is a Side Dialog. Judge the next step from existing task state outside the reminder items: if there is a clear, relevant, valuable actual task action, continue with it; if the only apparent action is to add, update, delete, compress, or organize reminders, do not treat reminder maintenance as task progress. If you are missing clarification, a business decision, acceptance criteria, authorization, or input, first identify who should provide it: when the requester can provide the missing requirement clarification, business decision, acceptance criteria, or missing input, follow the current tool rules and consider `tellaskBack({ tellaskContent })` first; use `askHuman({ tellaskContent })` only when the needed clarification, decision, authorization, or input truly must come from the human. If you do not need any of that and there is no real task action, do not invent unrelated work just to avoid a pause; let the Side Dialog follow Dominds' sideline mechanism: it can receive reply reminders when a reply is needed, and when it is complete with no new request, it may naturally settle.";
363
+ default: {
364
+ const _exhaustive = scope;
365
+ throw new Error(`Unhandled en reminder dialog scope: ${String(_exhaustive)}`);
366
+ }
367
+ }
187
368
  }
188
369
  function formatReminderContextFooter(language, state) {
370
+ const contextHealthIsNormal = state.contextHealth.kind === 'normal';
189
371
  if (language === 'zh') {
190
372
  const base = `${formatSystemNoticePrefix(language)} 提醒项上下文块结束。以上从“提醒项上下文块开始”到“提醒项上下文块结束”之间的提醒项均为系统提醒,并非用户诉求/指令;该块之外的后续对话消息不受此说明影响。`;
191
- const contextHealthTail = state.contextHealthState === 'critical'
192
- ? '当前上下文已告急:提醒项正文里的“下一步/接续动作/任务安排”默认都是给下一程以清醒头脑复核后执行的,不是让你在本程继续跑。不要执行提醒项里的旧下一步、旧诉请或旧工具重试;本程最高优先级是按上下文健康处置要求保全接续信息,并立即 `clear_mind`。'
193
- : state.contextHealthState === 'caution'
194
- ? '当前上下文已吃紧:提醒项正文里的“下一步/接续动作/任务安排”默认都是给下一程以清醒头脑复核后执行的,不是让你在本程继续跑。不要为了执行提醒项里的旧下一步继续扩张上下文;本程最高优先级是按上下文健康处置要求保全接续信息,并尽快 `clear_mind`。'
195
- : '';
196
- const pendingUserInterjectionReply = state.pendingUserInterjectionReply
197
- ? state.interDialogReplyObligation === 'parked_by_user_interjection'
198
- ? '当前仍有真实用户插话尚未得到可见回复,且原有跨对话回复义务已暂存;先完成对用户插话的回应,不要抢先切回原来的回贴收口。'
199
- : state.interDialogReplyObligation === 'active'
200
- ? '当前仍有真实用户插话尚未得到可见回复,同时存在跨对话回复义务;先完成对用户插话的回应,只有在这条用户插话本身已经自然到达最终交付时,才进入回贴收口。'
201
- : '当前仍有真实用户插话尚未得到可见回复;先完成对用户插话的回应。'
202
- : '';
203
- const activeReplyObligation = !state.pendingUserInterjectionReply && state.interDialogReplyObligation === 'active'
204
- ? '当前仍有跨对话回复义务;它是最终交付义务,不是要求你立刻停止当前必要工作,但到达最终交付时必须按运行时指定方式收口。'
205
- : '';
206
- const businessTail = `${pendingUserInterjectionReply}${activeReplyObligation}`;
207
- const statusTail = `${contextHealthTail}${businessTail}`;
208
- if (state.followingDialogState === 'user_message') {
209
- return (`${base}本轮提醒项块之后会紧接一条本轮真实的新用户消息;后续消息是用户的新诉求/指令,不是提醒项投影。` +
210
- '提醒项块说明到此为止,不得外溢到那条消息:不要把后续用户消息称为“系统提示/没有新消息”,也不要因为本块说明而降低它的指令优先级。' +
211
- `请按那条用户消息的原始语义继续处理;若它要求更新你的职责、偏好或心智资产,应照常落实;上下文健康处置要求仍按系统提示优先于普通任务动作。${statusTail}`);
212
- }
213
- if (state.followingDialogState === 'runtime_notice') {
214
- return `${base}本轮提醒项块之后会接着出现一条运行时提示;它不是用户的新诉求/指令,请按其中的运行时要求继续推进。${statusTail}`;
215
- }
216
- if (state.contextHealthState !== 'normal') {
217
- return (`${base}本轮没有新的用户消息或运行时提示;这是工具调用后的自动续推。` +
218
- `不要把“没有新消息”理解为空系统提示。${statusTail}`);
373
+ const contextHealthTail = formatZhReminderContextHealthTail(state.contextHealth);
374
+ const businessTail = formatZhReminderBusinessTail(state.business);
375
+ const statusTail = joinReminderFooterTails(language, [contextHealthTail, businessTail]);
376
+ switch (state.followingMessage.kind) {
377
+ case 'user_message':
378
+ // The reminder block is inserted immediately before the real user message. This
379
+ // branch prevents the reminder wrapper from lowering or re-labeling that message.
380
+ return (`${base}本轮提醒项块之后会紧接一条本轮真实的新用户消息;后续消息是用户的新诉求/指令,不是提醒项投影。` +
381
+ '提醒项块说明到此为止,不得外溢到那条消息:不要把后续用户消息称为“系统提示/没有新消息”,也不要因为本块说明而降低它的指令优先级。' +
382
+ `请按那条用户消息的原始语义继续处理;若它要求更新你的职责、偏好或心智资产,应照常落实;若系统提示上下文吃紧或告急,先按那条系统要求处理,再做普通任务动作。${statusTail}`);
383
+ case 'human_answer':
384
+ // This is a human answer to an askHuman question, not a fresh open-ended request. The
385
+ // model should use the answer to resume the waiting work without reclassifying it as a
386
+ // new user instruction.
387
+ return (`${base}本轮提醒项块之后会接着出现用户对一个提问的回答;那是用来继续等待中的工作,不是新的普通用户诉求/指令。` +
388
+ `请用那条回答继续原本等待答案的任务,不要把提醒项块说明外溢到那条回答上。${statusTail}`);
389
+ case 'runtime_notice':
390
+ // Dominds notices are deliberate driver instructions. Keep them distinct from user
391
+ // requests while allowing their own wording to drive the next action.
392
+ return `${base}本轮提醒项块之后会接着出现一条 Dominds 提示;它不是用户的新诉求/指令,请按其中的要求继续推进。${statusTail}`;
393
+ case 'none':
394
+ if (!contextHealthIsNormal) {
395
+ // When context is tight/critical, the context-preservation notice owns the turn. Do not add
396
+ // ordinary continuation wording that could encourage more work from old reminders.
397
+ return (`${base}本轮没有新的用户消息或 Dominds 提示;这是工具调用后的自动续推。` +
398
+ `不要把“没有新消息”理解为空系统提示。${statusTail}`);
399
+ }
400
+ // Normal tool-followup rounds may continue real business work, but reminder maintenance
401
+ // paths are merely references. Runtime already knows whether this is a Main Dialog or Side
402
+ // Dialog, so do not ask the model to self-classify before choosing askHuman vs tellaskBack.
403
+ const scopeTail = formatZhNormalAutoContinueByDialogScope(state.dialogScope);
404
+ return (`${base}本轮没有新的用户消息或 Dominds 提示;这是工具调用后的自动续推。` +
405
+ scopeTail +
406
+ `不要把“没有新消息”理解为空系统提示。${businessTail}`);
407
+ default: {
408
+ const _exhaustive = state.followingMessage;
409
+ throw new Error(`Unhandled zh reminder following-message state: ${String(_exhaustive)}`);
410
+ }
219
411
  }
220
- return (`${base}本轮没有新的用户消息或运行时提示;这是工具调用后的自动续推。` +
221
- '请基于已有任务状态判断下一步:若已有明确、相关且有价值的动作,就继续执行;若当前确实只能等待外部结果或用户输入,不要为了避免“等待”而寻找无关小事。' +
222
- `不要把“没有新消息”理解为空系统提示。${businessTail}`);
223
412
  }
224
413
  const base = `${formatSystemNoticePrefix(language)} Reminder context block ends. The reminder items between ` +
225
414
  '"Reminder context block begins" and "Reminder context block ends" are system reminders, ' +
226
415
  'not user requests/instructions; this reminder-block guidance does not apply to subsequent dialog messages outside this block. ';
227
- const contextHealthTail = state.contextHealthState === 'critical'
228
- ? 'Context health is critical: any "next step", continuation action, or task plan inside reminders is meant for the next course to review and run with a clear head, not for this course to keep executing. Do not perform old next steps, old inter-dialog requests, or old tool retries from reminders; this course must first preserve the continuation details required by the context-health guidance, then call `clear_mind` immediately. '
229
- : state.contextHealthState === 'caution'
230
- ? 'Context health is tight: any "next step", continuation action, or task plan inside reminders is meant for the next course to review and run with a clear head, not for this course to keep executing. Do not expand context by performing old next steps from reminders; this course must first preserve the continuation details required by the context-health guidance, then call `clear_mind` soon. '
231
- : '';
232
- const pendingUserInterjectionReply = state.pendingUserInterjectionReply
233
- ? state.interDialogReplyObligation === 'parked_by_user_interjection'
234
- ? "There is still a real user interjection without a visible reply, and the earlier inter-dialog reply obligation is parked; finish answering the user's interjection first, and do not switch back to closing the earlier reply yet. "
235
- : state.interDialogReplyObligation === 'active'
236
- ? "There is still a real user interjection without a visible reply, while an inter-dialog reply obligation also exists; finish answering the user's interjection first, and enter reply closure only if this user interjection itself naturally reaches final delivery. "
237
- : "There is still a real user interjection without a visible reply; finish answering the user's interjection first. "
238
- : '';
239
- const activeReplyObligation = !state.pendingUserInterjectionReply && state.interDialogReplyObligation === 'active'
240
- ? 'An inter-dialog reply obligation is still active; it is a final delivery obligation, not a demand to stop necessary current work immediately, but final delivery must close through the runtime-specified path. '
241
- : '';
242
- const businessTail = `${pendingUserInterjectionReply}${activeReplyObligation}`;
243
- const statusTail = `${contextHealthTail}${businessTail}`;
244
- if (state.followingDialogState === 'user_message') {
245
- return (`${base}A real new user message for this round immediately follows this reminder block; the following message is a new user request/instruction, not a reminder projection. ` +
246
- 'The reminder-block guidance ends here and must not spill over onto that message: do not label the following user message as a "system notice" or "no new message", and do not lower its instruction priority because of this block. ' +
247
- `Handle that user message according to its original meaning; if it asks you to update your responsibilities, preferences, or mind assets, carry that out normally. Context-health remediation still takes system-guided priority over ordinary task actions. ${statusTail}`);
248
- }
249
- if (state.followingDialogState === 'runtime_notice') {
250
- return `${base}A runtime notice follows this reminder block in this round; it is not a new user request/instruction, so follow that runtime guidance and continue the work. ${statusTail}`;
251
- }
252
- if (state.contextHealthState !== 'normal') {
253
- return (`${base}There is no new user message or runtime notice in this round; this is an automatic continuation after a tool call. ` +
254
- `Do not interpret the absence of a new message as an empty system notice. ${statusTail}`);
255
- }
256
- return (`${base}There is no new user message or runtime notice in this round; this is an automatic continuation after a tool call. ` +
257
- '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". ' +
258
- `Do not interpret the absence of a new message as an empty system notice. ${businessTail}`);
416
+ const contextHealthTail = formatEnReminderContextHealthTail(state.contextHealth);
417
+ const businessTail = formatEnReminderBusinessTail(state.business);
418
+ const statusTail = joinReminderFooterTails(language, [contextHealthTail, businessTail]);
419
+ switch (state.followingMessage.kind) {
420
+ case 'user_message':
421
+ // The reminder block is inserted immediately before the real user message. This branch
422
+ // prevents the reminder wrapper from lowering or re-labeling that message.
423
+ return (`${base}A real new user message for this round immediately follows this reminder block; the following message is a new user request/instruction, not a reminder projection. ` +
424
+ 'The reminder-block guidance ends here and must not spill over onto that message: do not label the following user message as a "system notice" or "no new message", and do not lower its instruction priority because of this block. ' +
425
+ `Handle that user message according to its original meaning; if it asks you to update your responsibilities, preferences, or mind assets, carry that out normally. If the system says context is tight or critical, follow that system guidance before ordinary task actions. ${statusTail}`);
426
+ case 'human_answer':
427
+ // This is a human answer to an askHuman question, not a fresh open-ended request. The
428
+ // model should use the answer to resume the waiting work without reclassifying it as a
429
+ // new user instruction.
430
+ return (`${base}A human answer to one of your questions follows this reminder block; it is for resuming the waiting work, not a new ordinary user request/instruction. ` +
431
+ `Use that answer to continue the task that was waiting for it, and do not let the reminder-block guidance spill over onto that answer. ${statusTail}`);
432
+ case 'runtime_notice':
433
+ // Dominds notices are deliberate driver instructions. Keep them distinct from user requests
434
+ // while allowing their own wording to drive the next action.
435
+ return `${base}A Dominds notice follows this reminder block in this round; it is not a new user request/instruction, so follow that guidance and continue the work. ${statusTail}`;
436
+ case 'none':
437
+ if (!contextHealthIsNormal) {
438
+ // When context is tight/critical, the context-preservation notice owns the turn. Do not add
439
+ // ordinary continuation wording that could encourage more work from old reminders.
440
+ return (`${base}There is no new user message or Dominds notice in this round; this is an automatic continuation after a tool call. ` +
441
+ `Do not interpret the absence of a new message as an empty system notice. ${statusTail}`);
442
+ }
443
+ // Normal tool-followup rounds may continue real business work, but reminder maintenance
444
+ // paths are merely references. Runtime already knows whether this is a Main Dialog or Side
445
+ // Dialog, so do not ask the model to self-classify before choosing askHuman vs tellaskBack.
446
+ const scopeTail = formatEnNormalAutoContinueByDialogScope(state.dialogScope);
447
+ return (`${base}There is no new user message or Dominds notice in this round; this is an automatic continuation after a tool call. ` +
448
+ `${scopeTail} ` +
449
+ `Do not interpret the absence of a new message as an empty system notice. ${businessTail}`);
450
+ default: {
451
+ const _exhaustive = state.followingMessage;
452
+ throw new Error(`Unhandled en reminder following-message state: ${String(_exhaustive)}`);
453
+ }
454
+ }
259
455
  }
260
456
  function isReminderGuideMetaRecord(value) {
261
457
  return typeof value === 'object' && value !== null && !Array.isArray(value);
@@ -301,7 +497,7 @@ function getReminderMaintenanceInstructions(language, reminderId, meta) {
301
497
  : deleteAltInstruction
302
498
  ? `删除通道:我不用 delete_reminder;我执行:${deleteAltInstruction}`
303
499
  : metaKind === 'mcp_lease'
304
- ? `删除通道:我不用 delete_reminder 释放资源;确认当前对话近期不再需要该 MCP runtime 时,我执行:${mcpReleaseInstruction}`
500
+ ? `删除通道:我不用 delete_reminder 释放资源;确认当前对话近期不再需要这个 MCP 连接时,我执行:${mcpReleaseInstruction}`
305
501
  : daemonCompleted
306
502
  ? `删除通道:确认已知悉 daemon 终态后,可清理:delete_reminder({ "reminder_id": "${reminderId}" })`
307
503
  : isPendingTellaskReminder && pendingTellaskCount === 0
@@ -312,7 +508,7 @@ function getReminderMaintenanceInstructions(language, reminderId, meta) {
312
508
  : deleteAltInstruction
313
509
  ? `Delete path: I do not use delete_reminder; I run: ${deleteAltInstruction}`
314
510
  : metaKind === 'mcp_lease'
315
- ? `Delete path: I do not release resources by deleting the reminder; when this dialog will not need the MCP runtime soon, I run: ${mcpReleaseInstruction}`
511
+ ? `Delete path: I do not release resources by deleting the reminder; when this dialog will not need this MCP connection soon, I run: ${mcpReleaseInstruction}`
316
512
  : daemonCompleted
317
513
  ? `Delete path: after I have acknowledged the daemon terminal state, I may clean up: delete_reminder({ "reminder_id": "${reminderId}" })`
318
514
  : isPendingTellaskReminder && pendingTellaskCount === 0
@@ -347,13 +543,13 @@ function formatReminderMaintenanceReference(language, reminders) {
347
543
  return undefined;
348
544
  if (language === 'zh') {
349
545
  return [
350
- `${formatSystemNoticePrefix(language)} 我把下面的提醒项维护通道仅作为操作参考;如果我需要维护某条 reminder,我会按对应 reminder_id 选择工具。我不会把这些参考当成当前轮必须立即执行的动作,也不会因此延迟回应后续真实用户消息。`,
546
+ `${formatSystemNoticePrefix(language)} 我把下面的提醒项维护通道仅作为操作参考;如果我在处理真实用户消息、Dominds 提示或当前任务动作时确实需要维护某条 reminder,我会按对应 reminder_id 选择工具。我不会把这些参考当成当前轮必须立即执行的动作;没有新的用户消息、Dominds 提示或提醒项之外的任务动作时,我不会只为了清理/整理提醒项而继续调用提醒项工具,也不会因此延迟回应后续真实用户消息。`,
351
547
  '',
352
548
  ...lines,
353
549
  ].join('\n');
354
550
  }
355
551
  return [
356
- `${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.`,
552
+ `${formatSystemNoticePrefix(language)} I treat the following reminder-maintenance channels as an operational reference only. If I truly need to maintain a reminder while handling a real user message, Dominds notice, or current task action, 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; when there is no new user message, no Dominds notice, and no task action outside reminders, I do not keep calling reminder tools solely to clean up or organize reminders, and I do not let them delay my response to any following real user message.`,
357
553
  '',
358
554
  ...lines,
359
555
  ].join('\n');
@@ -401,7 +597,7 @@ function formatReminderItemGuide(language, reminderId, content, options) {
401
597
  return [
402
598
  `${systemPrefix} 提醒项 [${reminderId}](换程接续信息)`,
403
599
  '',
404
- `${projectionNote}你设置了换程接续提醒项,让运行时系统在新一程提醒你恢复工作。请把它当作快速恢复工作的接续包,不要自动当成当前必须立刻执行的新指令。`,
600
+ `${projectionNote}你设置了换程接续提醒项,Dominds 会在新一程提醒你恢复工作。请把它当作快速恢复工作的接续包,不要自动当成当前必须立刻执行的新指令。`,
405
601
  '',
406
602
  '你应优先保留下一步行动、关键定位、运行/验证信息、容易丢的临时细节;不要重复差遣牒已覆盖的内容。进入新一程后,你的第一步是以清醒头脑重新审视并整理更新:删除冗余、纠正偏激/失真思路、压缩成高质量提醒项。若目前只是粗略过桥笔记,进入新一程后必须尽快收敛。',
407
603
  '',
@@ -411,10 +607,10 @@ function formatReminderItemGuide(language, reminderId, content, options) {
411
607
  }
412
608
  const scopeLabel = scope === 'task' ? '(任务范围)' : scope === 'agent' ? '(智能体范围)' : '';
413
609
  const scopeGuide = scope === 'task'
414
- ? `${projectionNote}你设置了任务范围提醒项,让运行时系统在当前差遣牒任务内、所有由你主理的对话里提醒你。请把它当作当前任务的手头工作提示,不要自动当成系统下发的下一步动作。`
610
+ ? `${projectionNote}你设置了任务范围提醒项,Dominds 会在当前差遣牒任务内、所有由你主理的对话里提醒你。请把它当作当前任务的手头工作提示,不要自动当成系统下发的下一步动作。`
415
611
  : scope === 'agent'
416
- ? `${projectionNote}你设置了智能体范围提醒项,让运行时系统在所有由你主理的对话里提醒你。它只适合紧急、短期、全局刺眼提醒;不要用来记录普通任务状态,也不要自动当成系统下发的下一步动作。`
417
- : `${projectionNote}你设置了提醒项,让运行时系统提醒你。请把它当作用来保留当前对话里容易丢的手头工作信息的提示,不要自动当成系统下发的下一步动作。`;
612
+ ? `${projectionNote}你设置了智能体范围提醒项,Dominds 会在所有由你主理的对话里提醒你。它只适合紧急、短期、全局刺眼提醒;不要用来记录普通任务状态,也不要自动当成系统下发的下一步动作。`
613
+ : `${projectionNote}你设置了提醒项,Dominds 会在需要时提醒你。请把它当作用来保留当前对话里容易丢的手头工作信息的提示,不要自动当成系统下发的下一步动作。`;
418
614
  const scopeMaintenance = scope === 'task'
419
615
  ? '你应保持简洁、及时更新;不再需要时就删除。若它只对当前对话有效,应改写成 dialog 范围提醒;若需要全队同步当前任务状态,应写入差遣牒 progress,而不是扩大提醒范围。'
420
616
  : scope === 'agent'
@@ -434,7 +630,7 @@ function formatReminderItemGuide(language, reminderId, content, options) {
434
630
  if (managementTool) {
435
631
  return `${systemPrefix} REMINDER [${reminderId}] (TOOL STATE)
436
632
 
437
- ${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.
633
+ ${enProjectionPrefix}Dominds currently has a tool-managed state reminder from ${managementTool}. Treat it as environment/tool state, not as your self-authored work note.
438
634
 
439
635
  ${formatAutoMaintainedReminderManualMirrorBan(language)}
440
636
 
@@ -446,7 +642,7 @@ ${content}`;
446
642
  if (updateInstruction) {
447
643
  return `${systemPrefix} REMINDER [${reminderId}]
448
644
 
449
- ${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.
645
+ ${enProjectionPrefix}Dominds currently has a reminder with a managed update path. Treat it as state/reference; use the preceding maintenance reference for its maintenance channel.
450
646
 
451
647
  ${formatAutoMaintainedReminderManualMirrorBan(language)}
452
648
 
@@ -456,7 +652,7 @@ ${content}`;
456
652
  if (isContinuationPackageReminder) {
457
653
  return `${systemPrefix} REMINDER [${reminderId}] (CONTINUATION PACKAGE)
458
654
 
459
- ${enProjectionPrefix}You set a continuation reminder so the runtime system can remind you when work resumes in a new course. Treat it as resume information for the next course, not as an automatic must-do command.
655
+ ${enProjectionPrefix}You set a continuation reminder so Dominds can remind you when work resumes in a new course. Treat it as resume information for the next course, not as an automatic must-do command.
460
656
 
461
657
  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.
462
658
 
@@ -465,10 +661,10 @@ ${content}`;
465
661
  }
466
662
  const scopeLabel = scope === 'task' ? ' (TASK SCOPE)' : scope === 'agent' ? ' (AGENT SCOPE)' : '';
467
663
  const scopeGuide = scope === 'task'
468
- ? `${enProjectionPrefix}You set a task-scope reminder so the runtime system can remind you in every dialog you lead for the current Taskdoc. Treat it as a current-work reference for this task, not as an automatically assigned next action.`
664
+ ? `${enProjectionPrefix}You set a task-scope reminder so Dominds can remind you in every dialog you lead for the current Taskdoc. Treat it as a current-work reference for this task, not as an automatically assigned next action.`
469
665
  : scope === 'agent'
470
- ? `${enProjectionPrefix}You set an agent-scope reminder so the runtime system can remind you in every dialog you lead. This is only for urgent, short-lived, globally visible cues; do not use it for ordinary task state, and do not treat it as an automatically assigned next action.`
471
- : `${enProjectionPrefix}You set a reminder so the runtime system can remind you. Treat it as a current-work reference for easy-to-lose details in the current dialog, not as an automatically assigned next action.`;
666
+ ? `${enProjectionPrefix}You set an agent-scope reminder so Dominds can remind you in every dialog you lead. This is only for urgent, short-lived, globally visible cues; do not use it for ordinary task state, and do not treat it as an automatically assigned next action.`
667
+ : `${enProjectionPrefix}You set a reminder so Dominds can remind you when needed. Treat it as a current-work reference for easy-to-lose details in the current dialog, not as an automatically assigned next action.`;
472
668
  const scopeMaintenance = scope === 'task'
473
669
  ? 'Keep it concise, refresh it when needed, and delete it when obsolete. If it is only useful for the current dialog, rewrite it into dialog scope; if the team must synchronize current task state, update Taskdoc progress instead of broadening reminder scope.'
474
670
  : scope === 'agent'
@@ -520,21 +716,26 @@ function formatDomindsNoteQ4HRegisterFailed(language, args) {
520
716
  }
521
717
  function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
522
718
  const isSideDialog = args.dialogScope === 'sideDialog';
719
+ // Business scenario: context-health prompts are inserted because the current course is close
720
+ // to losing useful state. The model should treat them as an immediate preservation workflow,
721
+ // but the old wording ("runtime remediation instruction") was unnecessarily technical and
722
+ // encouraged shallow acknowledgements. Say the business reason plainly: Dominds is protecting
723
+ // context, this is not a new user request, and the listed steps should be performed directly.
523
724
  if (language === 'zh') {
524
725
  if (args.kind === 'caution' && args.mode === 'soft') {
525
726
  if (isSideDialog) {
526
727
  return [
527
728
  `${formatSystemNoticePrefix(language)} 上下文状态:🟡 吃紧`,
528
729
  '',
529
- '这是一条运行时处置指令,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的处置动作。',
730
+ '这是 Dominds 为防止上下文丢失插入的保全提示,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的保全动作。',
530
731
  '',
531
732
  '影响:对话历史中的工具调用/结果信息很多已经过时,成为你的思考负担。',
532
733
  '',
533
734
  '行动:你当前处于支线对话。本程不要维护差遣牒,也不要整理差遣牒更新提案;当前目标是维护足够详尽的接续包提醒项,然后主动 clear_mind 开启新一程继续工作。',
534
735
  '',
535
- '提醒项应覆盖:当前对话历史中下一程需要知道的讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项长度没有技术限制,宁可完整一些;允许写成多条粗略提醒项,不必在当前程强行压成单条。',
736
+ '提醒项应覆盖:当前对话历史中下一程需要知道的讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项没有固定长度限制,宁可完整一些;允许写成多条粗略提醒项,不必在当前程强行压成单条。',
536
737
  '',
537
- '当前已处于吃紧处置阶段:不要继续扩张上下文,也不要提前进入“按接续包做清醒复核”的模式;真正清理冗余、合并提醒项,放到系统开启新一程后再做。',
738
+ 'Dominds 已提醒当前上下文吃紧:不要继续扩张上下文,也不要提前进入“按接续包做清醒复核”的模式;真正清理冗余、合并提醒项,放到 Dominds 开启新一程后再做。',
538
739
  '',
539
740
  '操作:',
540
741
  '- 优先新增详尽接续包提醒项:add_reminder({ "content": "..." })',
@@ -544,13 +745,13 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
544
745
  return [
545
746
  `${formatSystemNoticePrefix(language)} 上下文状态:🟡 吃紧`,
546
747
  '',
547
- '这是一条运行时处置指令,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的处置动作。',
748
+ '这是 Dominds 为防止上下文丢失插入的保全提示,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的保全动作。',
548
749
  '',
549
750
  '影响:对话历史中的工具调用/结果信息很多已经过时,成为你的思考负担。',
550
751
  '',
551
752
  '行动:你当前处于主线对话。先把当前对话历史中尚未落实到文档、且下一程需要知会的讨论细节落到差遣牒合适章节。然后再把差遣牒仍未覆盖、但恢复工作会丢的信息记进新提醒项过桥(下一步行动 + 关键定位信息 + 运行/验证信息 + 容易丢的临时细节);允许先带着一定冗余,也允许先写成多条粗略提醒项,不必在当前程强行压成单条。',
552
753
  '',
553
- '当前已处于吃紧处置阶段:不要继续扩张上下文,也不要提前进入“按接续包做清醒复核”的模式;那是系统真正开启新一程后的第一步。当前程的目标是先把未落文档的讨论细节补进差遣牒,再把差遣牒仍未覆盖、但恢复工作会丢的信息带过桥;真正清理冗余、合并提醒项,放到新一程再做。然后主动 clear_mind,开启新一程对话继续工作。',
754
+ 'Dominds 已提醒当前上下文吃紧:不要继续扩张上下文,也不要提前进入“按接续包做清醒复核”的模式;那是 Dominds 真正开启新一程后的第一步。当前程的目标是先把未落文档的讨论细节补进差遣牒,再把差遣牒仍未覆盖、但恢复工作会丢的信息带过桥;真正清理冗余、合并提醒项,放到新一程再做。然后主动 clear_mind,开启新一程对话继续工作。',
554
755
  '',
555
756
  '操作:',
556
757
  '- 优先新增差遣牒章节保存讨论细节:do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
@@ -563,30 +764,30 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
563
764
  return [
564
765
  `${formatSystemNoticePrefix(language)} 上下文状态:🔴 告急`,
565
766
  '',
566
- '这是一条运行时处置指令,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的处置动作。',
767
+ '这是 Dominds 为防止上下文丢失插入的保全提示,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的保全动作。',
567
768
  '',
568
- `系统最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
769
+ `Dominds 最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
569
770
  '',
570
771
  '行动:你当前处于支线对话。本程不要维护差遣牒,也不要整理差遣牒更新提案;当前目标是尽快维护足够详尽的接续包提醒项,然后 clear_mind。',
571
772
  '',
572
- '提醒项应覆盖:当前对话历史中下一程需要知道的讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项长度没有技术限制,宁可完整一些;允许写成多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
773
+ '提醒项应覆盖:当前对话历史中下一程需要知道的讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项没有固定长度限制,宁可完整一些;允许写成多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
573
774
  '',
574
775
  '操作:',
575
776
  '- 优先新增详尽接续包提醒项:add_reminder({ "content": "..." })',
576
777
  '- 只有在确实能就地复用现有提醒项、且不会额外增加当前程认知负担时,才更新:update_reminder({ "reminder_id": "<现有 reminder_id>", "content": "..." })',
577
778
  '- clear_mind({})',
578
779
  '',
579
- '当前处于告急处置阶段时,不要提前做“新一程清醒复核”;系统真正开启新一程后,第一步才是重新审视并整理:删除冗余、纠正偏激/失真思路、合并并压缩成高质量提醒项。',
780
+ 'Dominds 已提醒当前上下文告急:不要提前做“新一程清醒复核”;Dominds 真正开启新一程后,第一步才是重新审视并整理:删除冗余、纠正偏激/失真思路、合并并压缩成高质量提醒项。',
580
781
  ].join('\n');
581
782
  }
582
783
  return [
583
784
  `${formatSystemNoticePrefix(language)} 上下文状态:🔴 告急`,
584
785
  '',
585
- '这是一条运行时处置指令,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的处置动作。',
786
+ '这是 Dominds 为防止上下文丢失插入的保全提示,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的保全动作。',
586
787
  '',
587
- `系统最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
788
+ `Dominds 最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
588
789
  '',
589
- '行动:你当前处于主线对话。尽快保住易丢信息,然后 clear_mind。当前处于告急处置阶段时,先把当前对话历史中尚未落实到文档、且下一程需要知会的讨论细节落到差遣牒合适章节。然后再把差遣牒仍未覆盖、但恢复工作会丢的信息新增提醒项带过桥;允许先保留多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
790
+ '行动:你当前处于主线对话。尽快保住易丢信息,然后 clear_mind。Dominds 已提醒当前上下文告急:先把当前对话历史中尚未落实到文档、且下一程需要知会的讨论细节落到差遣牒合适章节。然后再把差遣牒仍未覆盖、但恢复工作会丢的信息新增提醒项带过桥;允许先保留多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
590
791
  '',
591
792
  '操作:',
592
793
  '- 优先新增差遣牒章节保存讨论细节:do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
@@ -595,7 +796,7 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
595
796
  '- 只有在确实能就地复用现有提醒项、且不会额外增加当前程认知负担时,才更新:update_reminder({ "reminder_id": "<现有 reminder_id>", "content": "..." })',
596
797
  '- clear_mind({})',
597
798
  '',
598
- '接续包要点:下一步行动 + 关键定位信息 + 运行验证方式 + 容易丢的临时细节;不要重复差遣牒已有内容,本程刚落入差遣牒的讨论细节只需提示下一程先查差遣牒。当前处于告急处置阶段时,不要提前做“新一程清醒复核”;系统真正开启新一程后,第一步才是重新审视并整理:删除冗余、纠正偏激/失真思路、合并并压缩成高质量提醒项。',
799
+ '接续包要点:下一步行动 + 关键定位信息 + 运行验证方式 + 容易丢的临时细节;不要重复差遣牒已有内容,本程刚落入差遣牒的讨论细节只需提示下一程先查差遣牒。Dominds 已提醒当前上下文告急:不要提前做“新一程清醒复核”;Dominds 真正开启新一程后,第一步才是重新审视并整理:删除冗余、纠正偏激/失真思路、合并并压缩成高质量提醒项。',
599
800
  ].join('\n');
600
801
  }
601
802
  if (args.kind === 'caution' && args.mode === 'soft') {
@@ -603,15 +804,15 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
603
804
  return [
604
805
  `${formatSystemNoticePrefix(language)} Context state: 🟡 caution`,
605
806
  '',
606
- 'This is a runtime remediation instruction, not a new user request; do not reply with a standalone "acknowledged/ok/I will organize reminders first", and instead perform the remediation actions directly.',
807
+ 'This is a Dominds notice to prevent context loss, not a new user request. Do the steps below directly; do not answer only with "acknowledged/ok/I will organize reminders first".',
607
808
  '',
608
809
  'Impact: stale call/results in dialog history are creating cognitive noise.',
609
810
  '',
610
811
  'Action: you are in a Side Dialog. Do not maintain Taskdoc in this course, and do not draft Taskdoc update proposals. The current goal is to maintain sufficiently detailed continuation-package reminders, then proactively clear_mind to start a new dialog course.',
611
812
  '',
612
- 'Reminders should cover: discussion details from current dialog history that the next course needs to know, next actions, key pointers, run/verify info, volatile paths/IDs/sample inputs, and any reasoning needed to resume safely. Reminder length has no technical limit, so prefer being complete; rough multi-reminder carry-over is acceptable, and you do not need to force everything into one clean reminder in the current course.',
813
+ 'Reminders should cover: discussion details from current dialog history that the next course needs to know, next actions, key pointers, run/verify info, volatile paths/IDs/sample inputs, and any reasoning needed to resume safely. Reminders have no fixed length limit, so prefer being complete; rough multi-reminder carry-over is acceptable, and you do not need to force everything into one clean reminder in the current course.',
613
814
  '',
614
- 'You are already in caution remediation for the current course, so do not keep expanding context and do not switch early into “clear-headed continuation-package review” mode; reminder cleanup and dedup belong to the new course.',
815
+ 'Dominds has already warned that context is tight for the current course, so do not keep expanding context and do not switch early into “clear-headed continuation-package review” mode; reminder cleanup and dedup belong to the new course.',
615
816
  '',
616
817
  'Operations:',
617
818
  '- Prefer adding a detailed continuation-package reminder first: add_reminder({ "content": "..." })',
@@ -621,13 +822,13 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
621
822
  return [
622
823
  `${formatSystemNoticePrefix(language)} Context state: 🟡 caution`,
623
824
  '',
624
- 'This is a runtime remediation instruction, not a new user request; do not reply with a standalone "acknowledged/ok/I will organize reminders first", and instead perform the remediation actions directly.',
825
+ 'This is a Dominds notice to prevent context loss, not a new user request. Do the steps below directly; do not answer only with "acknowledged/ok/I will organize reminders first".',
625
826
  '',
626
827
  'Impact: stale call/results in dialog history are creating cognitive noise.',
627
828
  '',
628
829
  'Action: you are in the Main Dialog. First record current-dialog discussion details that are not yet documented but the next course needs to know into the appropriate Taskdoc sections. Then write information still not covered by Taskdoc but easy to lose into new bridge reminders (next step + key pointers + run/verify info + easy-to-lose volatile details). Some redundancy is acceptable, and rough multi-reminder carry-over is acceptable too; do not force everything into one clean reminder in the current course.',
629
830
  '',
630
- 'You are already in caution remediation for the current course, so do not keep expanding context and do not switch early into “clear-headed continuation-package review” mode; that is the first step only after the system actually starts the new course. In the current course, the goal is to first fill Taskdoc with undocumented discussion details, then carry forward details still not covered by Taskdoc; reminder cleanup and dedup belong to the new course. Then proactively clear_mind to start a new dialog course.',
831
+ 'Dominds has already warned that context is tight for the current course, so do not keep expanding context and do not switch early into “clear-headed continuation-package review” mode; that is the first step only after Dominds actually starts the new course. In the current course, the goal is to first fill Taskdoc with undocumented discussion details, then carry forward details still not covered by Taskdoc; reminder cleanup and dedup belong to the new course. Then proactively clear_mind to start a new dialog course.',
631
832
  '',
632
833
  'Operations:',
633
834
  '- Prefer creating a new Taskdoc section for discussion details: do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
@@ -640,30 +841,30 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
640
841
  return [
641
842
  `${formatSystemNoticePrefix(language)} Context state: 🔴 critical`,
642
843
  '',
643
- 'This is a runtime remediation instruction, not a new user request; do not reply with a standalone "acknowledged/ok/I will organize reminders first", and instead perform the remediation actions directly.',
844
+ 'This is a Dominds notice to prevent context loss, not a new user request. Do the steps below directly; do not answer only with "acknowledged/ok/I will organize reminders first".',
644
845
  '',
645
- `System will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
846
+ `Dominds will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
646
847
  '',
647
848
  'Action: you are in a Side Dialog. Do not maintain Taskdoc in this course, and do not draft Taskdoc update proposals. The current goal is to maintain sufficiently detailed continuation-package reminders as soon as possible, then clear_mind.',
648
849
  '',
649
- 'Reminders should cover: discussion details from current dialog history that the next course needs to know, next actions, key pointers, run/verify info, volatile paths/IDs/sample inputs, and any reasoning needed to resume safely. Reminder length has no technical limit, so prefer being complete; multiple rough reminders, including some redundancy, are acceptable as a bridge.',
850
+ 'Reminders should cover: discussion details from current dialog history that the next course needs to know, next actions, key pointers, run/verify info, volatile paths/IDs/sample inputs, and any reasoning needed to resume safely. Reminders have no fixed length limit, so prefer being complete; multiple rough reminders, including some redundancy, are acceptable as a bridge.',
650
851
  '',
651
852
  'Operations:',
652
853
  '- Prefer adding a detailed continuation-package reminder first: add_reminder({ "content": "..." })',
653
854
  '- Only if an existing reminder is clearly the right place, and updating it would not add extra cognitive load in the current course: update_reminder({ "reminder_id": "<existing reminder_id>", "content": "..." })',
654
855
  '- clear_mind({})',
655
856
  '',
656
- 'During critical remediation in the current course, do not start the new-course cleanup early; once the system actually starts the new course, the first step is to reconcile rough bridge reminders by removing redundancy, correcting biased or distorted bridge notes, and merging/compressing them into high-quality reminders.',
857
+ 'Because Dominds has warned that context is critical in the current course, do not start the new-course cleanup early; once Dominds actually starts the new course, the first step is to reconcile rough bridge reminders by removing redundancy, correcting biased or distorted bridge notes, and merging/compressing them into high-quality reminders.',
657
858
  ].join('\n');
658
859
  }
659
860
  return [
660
861
  `${formatSystemNoticePrefix(language)} Context state: 🔴 critical`,
661
862
  '',
662
- 'This is a runtime remediation instruction, not a new user request; do not reply with a standalone "acknowledged/ok/I will organize reminders first", and instead perform the remediation actions directly.',
863
+ 'This is a Dominds notice to prevent context loss, not a new user request. Do the steps below directly; do not answer only with "acknowledged/ok/I will organize reminders first".',
663
864
  '',
664
- `System will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
865
+ `Dominds will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
665
866
  '',
666
- 'Action: you are in the Main Dialog. Preserve easy-to-lose information, then clear_mind. In critical remediation, first record current-dialog discussion details that are not yet documented but the next course needs to know into the appropriate Taskdoc sections. Then add bridge reminders for information still not covered by Taskdoc but easy to lose. Multiple rough reminders, including some redundancy, are acceptable as a bridge; do not spend the current course forcing them into a clean final package.',
867
+ 'Action: you are in the Main Dialog. Preserve easy-to-lose information, then clear_mind. Because Dominds has warned that context is critical, first record current-dialog discussion details that are not yet documented but the next course needs to know into the appropriate Taskdoc sections. Then add bridge reminders for information still not covered by Taskdoc but easy to lose. Multiple rough reminders, including some redundancy, are acceptable as a bridge; do not spend the current course forcing them into a clean final package.',
667
868
  '',
668
869
  'Operations:',
669
870
  '- Prefer creating a new Taskdoc section for discussion details: do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
@@ -672,7 +873,7 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
672
873
  '- Only if an existing reminder is clearly the right place, and updating it would not add extra cognitive load in the current course: update_reminder({ "reminder_id": "<existing reminder_id>", "content": "..." })',
673
874
  '- clear_mind({})',
674
875
  '',
675
- 'Continuation package: next step + key pointers + run/verify info + easy-to-lose volatile details. Do not duplicate Taskdoc content; for discussion details just written into Taskdoc in this course, only remind the next course to review Taskdoc first. During critical remediation in the current course, do not start the new-course cleanup early; once the system actually starts the new course, the first step is to reconcile rough bridge reminders by removing redundancy, correcting biased or distorted bridge notes, and merging/compressing them into high-quality reminders.',
876
+ 'Continuation package: next step + key pointers + run/verify info + easy-to-lose volatile details. Do not duplicate Taskdoc content; for discussion details just written into Taskdoc in this course, only remind the next course to review Taskdoc first. Because Dominds has warned that context is critical in the current course, do not start the new-course cleanup early; once Dominds actually starts the new course, the first step is to reconcile rough bridge reminders by removing redundancy, correcting biased or distorted bridge notes, and merging/compressing them into high-quality reminders.',
676
877
  ].join('\n');
677
878
  }
678
879
  function formatAgentFacingCriticalUserInterjectionRemediationGuide(language, args) {
@@ -681,23 +882,23 @@ function formatAgentFacingCriticalUserInterjectionRemediationGuide(language, arg
681
882
  return [
682
883
  `${formatSystemNoticePrefix(language)} 上下文状态:🔴 告急;收到用户插话`,
683
884
  '',
684
- '本轮刚收到的用户消息是真实用户插话,不是普通运行时处置提示;必须把它当作有效用户轮次处理,让用户看到你已经接住了这次插话。',
885
+ '本轮刚收到的用户消息是真实用户插话,不是普通的上下文保全提示;必须把它当作有效用户轮次处理,让用户看到你已经接住了这次插话。',
685
886
  '',
686
- `这次用户轮次已计入告急处置倒计数。系统最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
887
+ `这次用户轮次已计入上下文告急倒计数。Dominds 最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
687
888
  '',
688
889
  isSideDialog
689
890
  ? '行动:先直接回应用户这条插话;不要继续扩张上下文,不要维护差遣牒,也不要整理差遣牒更新提案。若还需要保留接续信息,只维护足够详尽的接续包提醒项,然后尽快 clear_mind。'
690
891
  : '行动:先直接回应用户这条插话;不要继续扩张上下文。若仍有当前对话中尚未落实到文档、且下一程需要知会的讨论细节,先落到差遣牒合适章节;再把差遣牒仍未覆盖、但恢复工作会丢的信息新增提醒项带过桥,然后尽快 clear_mind。',
691
892
  '',
692
- '要求:不要因为 critical 状态沉默、挂起或只回复“收到/好的”。若必须调用工具才能回答用户,工具结果回来后继续给出用户可见回复;保持回答聚焦,并把清理/换程作为紧随其后的处置动作。',
893
+ '要求:不要因为告急状态沉默、挂起或只回复“收到/好的”。若必须调用工具才能回答用户,工具结果回来后继续给出用户可见回复;保持回答聚焦,并把清理/换程作为紧随其后的保全动作。',
693
894
  ].join('\n');
694
895
  }
695
896
  return [
696
897
  `${formatSystemNoticePrefix(language)} Context state: 🔴 critical; user interjection received`,
697
898
  '',
698
- 'The user message just received in this turn is a real user interjection, not an ordinary runtime remediation notice. Treat it as an effective user turn and make the system reaction visible to the user.',
899
+ 'The user message just received in this turn is a real user interjection, not an ordinary context-preservation notice. Treat it as an effective user turn and make the system reaction visible to the user.',
699
900
  '',
700
- `This user turn has been counted toward critical remediation. System will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
901
+ `This user turn has been counted toward the critical context-preservation countdown. Dominds will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
701
902
  '',
702
903
  isSideDialog
703
904
  ? 'Action: answer this user interjection directly first. Do not expand context, do not maintain Taskdoc, and do not draft Taskdoc update proposals. If continuation info still needs preserving, maintain sufficiently detailed continuation-package reminders only, then clear_mind as soon as possible.'