dominds 1.26.2 → 1.26.3

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 (135) hide show
  1. package/README.md +2 -0
  2. package/README.zh.md +2 -0
  3. package/dist/docs/cli-usage.md +1 -1
  4. package/dist/docs/cli-usage.zh.md +1 -1
  5. package/dist/llm/gen/mock.js +11 -3
  6. package/dist/llm/kernel-driver/context-health.d.ts +1 -0
  7. package/dist/llm/kernel-driver/context-health.js +7 -0
  8. package/dist/llm/kernel-driver/drive.js +23 -30
  9. package/dist/llm/kernel-driver/idle-reminder-wake.js +6 -2
  10. package/dist/llm/kernel-driver/reminder-context.d.ts +25 -0
  11. package/dist/llm/kernel-driver/reminder-context.js +81 -0
  12. package/dist/llm/kernel-driver/reply-guidance.js +10 -4
  13. package/dist/llm/kernel-driver/tellask-special.js +50 -35
  14. package/dist/mcp/supervisor.js +2 -2
  15. package/dist/minds/system-prompt-parts.js +30 -30
  16. package/dist/minds/system-prompt.js +55 -40
  17. package/dist/persistence.js +15 -1
  18. package/dist/runtime/driver-messages.d.ts +32 -7
  19. package/dist/runtime/driver-messages.js +279 -118
  20. package/dist/runtime/inter-dialog-format.js +24 -12
  21. package/dist/runtime/reply-prompt-copy.d.ts +8 -8
  22. package/dist/runtime/reply-prompt-copy.js +69 -38
  23. package/dist/server/certificates.js +65 -25
  24. package/dist/tools/mcp.js +12 -12
  25. package/dist/tools/prompts/control/en/index.md +2 -2
  26. package/dist/tools/prompts/control/en/principles.md +12 -12
  27. package/dist/tools/prompts/control/en/scenarios.md +5 -5
  28. package/dist/tools/prompts/control/en/tools.md +10 -10
  29. package/dist/tools/prompts/control/zh/index.md +3 -3
  30. package/dist/tools/prompts/control/zh/principles.md +12 -12
  31. package/dist/tools/prompts/control/zh/scenarios.md +7 -7
  32. package/dist/tools/prompts/control/zh/tools.md +11 -11
  33. package/dist/tools/prompts/mcp_admin/en/principles.md +4 -4
  34. package/dist/tools/prompts/mcp_admin/en/scenarios.md +1 -1
  35. package/dist/tools/prompts/mcp_admin/en/tools.md +3 -3
  36. package/dist/tools/prompts/mcp_admin/zh/principles.md +4 -4
  37. package/dist/tools/prompts/mcp_admin/zh/scenarios.md +1 -1
  38. package/dist/tools/prompts/mcp_admin/zh/tools.md +3 -3
  39. package/dist/tools/team_mgmt-mcp-manual.js +12 -12
  40. package/package.json +4 -3
  41. package/webapp/dist/assets/{_basePickBy-DUivPKf7.js → _basePickBy-DTJFxmut.js} +3 -3
  42. package/webapp/dist/assets/{_basePickBy-DUivPKf7.js.map → _basePickBy-DTJFxmut.js.map} +1 -1
  43. package/webapp/dist/assets/{_baseUniq-hcs024vD.js → _baseUniq-CVu4lo4P.js} +2 -2
  44. package/webapp/dist/assets/{_baseUniq-hcs024vD.js.map → _baseUniq-CVu4lo4P.js.map} +1 -1
  45. package/webapp/dist/assets/{arc-Dr6-FXp5.js → arc-4mEKx1Qr.js} +2 -2
  46. package/webapp/dist/assets/{arc-Dr6-FXp5.js.map → arc-4mEKx1Qr.js.map} +1 -1
  47. package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-DXqcDq4R.js → architectureDiagram-2XIMDMQ5-CmUkdSiN.js} +7 -7
  48. package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-DXqcDq4R.js.map → architectureDiagram-2XIMDMQ5-CmUkdSiN.js.map} +1 -1
  49. package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-IIP6LGXS.js → blockDiagram-WCTKOSBZ-CijmZ89y.js} +7 -7
  50. package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-IIP6LGXS.js.map → blockDiagram-WCTKOSBZ-CijmZ89y.js.map} +1 -1
  51. package/webapp/dist/assets/{c4Diagram-IC4MRINW-D_d3F9XD.js → c4Diagram-IC4MRINW-D0GcQMKs.js} +3 -3
  52. package/webapp/dist/assets/{c4Diagram-IC4MRINW-D_d3F9XD.js.map → c4Diagram-IC4MRINW-D0GcQMKs.js.map} +1 -1
  53. package/webapp/dist/assets/{channel-CWWjsXtU.js → channel-6pgfGez4.js} +2 -2
  54. package/webapp/dist/assets/{channel-CWWjsXtU.js.map → channel-6pgfGez4.js.map} +1 -1
  55. package/webapp/dist/assets/{chunk-4BX2VUAB-BF4yph2W.js → chunk-4BX2VUAB-BQDAaqXK.js} +2 -2
  56. package/webapp/dist/assets/{chunk-4BX2VUAB-BF4yph2W.js.map → chunk-4BX2VUAB-BQDAaqXK.js.map} +1 -1
  57. package/webapp/dist/assets/{chunk-55IACEB6-Hn3CmDYz.js → chunk-55IACEB6-DGYbZ_6j.js} +2 -2
  58. package/webapp/dist/assets/{chunk-55IACEB6-Hn3CmDYz.js.map → chunk-55IACEB6-DGYbZ_6j.js.map} +1 -1
  59. package/webapp/dist/assets/{chunk-FMBD7UC4-C05pl9Ov.js → chunk-FMBD7UC4-EVNnQ_SU.js} +2 -2
  60. package/webapp/dist/assets/{chunk-FMBD7UC4-C05pl9Ov.js.map → chunk-FMBD7UC4-EVNnQ_SU.js.map} +1 -1
  61. package/webapp/dist/assets/{chunk-JSJVCQXG-BVlq_BAS.js → chunk-JSJVCQXG-BSQe2NHw.js} +2 -2
  62. package/webapp/dist/assets/{chunk-JSJVCQXG-BVlq_BAS.js.map → chunk-JSJVCQXG-BSQe2NHw.js.map} +1 -1
  63. package/webapp/dist/assets/{chunk-KX2RTZJC-BQoaRWif.js → chunk-KX2RTZJC-I1LMYfrr.js} +2 -2
  64. package/webapp/dist/assets/{chunk-KX2RTZJC-BQoaRWif.js.map → chunk-KX2RTZJC-I1LMYfrr.js.map} +1 -1
  65. package/webapp/dist/assets/{chunk-NQ4KR5QH-0okCAXtW.js → chunk-NQ4KR5QH-C9HmN9dA.js} +4 -4
  66. package/webapp/dist/assets/{chunk-NQ4KR5QH-0okCAXtW.js.map → chunk-NQ4KR5QH-C9HmN9dA.js.map} +1 -1
  67. package/webapp/dist/assets/{chunk-QZHKN3VN-DEiprgz-.js → chunk-QZHKN3VN-73ijGXNd.js} +2 -2
  68. package/webapp/dist/assets/{chunk-QZHKN3VN-DEiprgz-.js.map → chunk-QZHKN3VN-73ijGXNd.js.map} +1 -1
  69. package/webapp/dist/assets/{chunk-WL4C6EOR-B-Xkb3lo.js → chunk-WL4C6EOR-DeVu-9ac.js} +6 -6
  70. package/webapp/dist/assets/{chunk-WL4C6EOR-B-Xkb3lo.js.map → chunk-WL4C6EOR-DeVu-9ac.js.map} +1 -1
  71. package/webapp/dist/assets/{classDiagram-VBA2DB6C-DCCQrdwF.js → classDiagram-VBA2DB6C-2HURCFLk.js} +7 -7
  72. package/webapp/dist/assets/{classDiagram-VBA2DB6C-DCCQrdwF.js.map → classDiagram-VBA2DB6C-2HURCFLk.js.map} +1 -1
  73. package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-DCCQrdwF.js → classDiagram-v2-RAHNMMFH-2HURCFLk.js} +7 -7
  74. package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-DCCQrdwF.js.map → classDiagram-v2-RAHNMMFH-2HURCFLk.js.map} +1 -1
  75. package/webapp/dist/assets/{clone-Drtik9pk.js → clone-BNPlfGMh.js} +2 -2
  76. package/webapp/dist/assets/{clone-Drtik9pk.js.map → clone-BNPlfGMh.js.map} +1 -1
  77. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-BBWvHErL.js → cose-bilkent-S5V4N54A-BeoZCFA5.js} +2 -2
  78. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-BBWvHErL.js.map → cose-bilkent-S5V4N54A-BeoZCFA5.js.map} +1 -1
  79. package/webapp/dist/assets/{dagre-KLK3FWXG-2qk0ikdt.js → dagre-KLK3FWXG-DYxCt50h.js} +7 -7
  80. package/webapp/dist/assets/{dagre-KLK3FWXG-2qk0ikdt.js.map → dagre-KLK3FWXG-DYxCt50h.js.map} +1 -1
  81. package/webapp/dist/assets/{diagram-E7M64L7V-C1DbHDbf.js → diagram-E7M64L7V-BWxcTI3B.js} +8 -8
  82. package/webapp/dist/assets/{diagram-E7M64L7V-C1DbHDbf.js.map → diagram-E7M64L7V-BWxcTI3B.js.map} +1 -1
  83. package/webapp/dist/assets/{diagram-IFDJBPK2-DToz8zk9.js → diagram-IFDJBPK2-BAIPE4Rn.js} +7 -7
  84. package/webapp/dist/assets/{diagram-IFDJBPK2-DToz8zk9.js.map → diagram-IFDJBPK2-BAIPE4Rn.js.map} +1 -1
  85. package/webapp/dist/assets/{diagram-P4PSJMXO-B9V-tQMe.js → diagram-P4PSJMXO-CvcxPsVp.js} +7 -7
  86. package/webapp/dist/assets/{diagram-P4PSJMXO-B9V-tQMe.js.map → diagram-P4PSJMXO-CvcxPsVp.js.map} +1 -1
  87. package/webapp/dist/assets/{erDiagram-INFDFZHY-CV68FwGf.js → erDiagram-INFDFZHY-BDO90e-f.js} +5 -5
  88. package/webapp/dist/assets/{erDiagram-INFDFZHY-CV68FwGf.js.map → erDiagram-INFDFZHY-BDO90e-f.js.map} +1 -1
  89. package/webapp/dist/assets/{flowDiagram-PKNHOUZH-CW06almb.js → flowDiagram-PKNHOUZH-hd4TorKR.js} +7 -7
  90. package/webapp/dist/assets/{flowDiagram-PKNHOUZH-CW06almb.js.map → flowDiagram-PKNHOUZH-hd4TorKR.js.map} +1 -1
  91. package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-C96NncCU.js → ganttDiagram-A5KZAMGK-mID1sFSl.js} +3 -3
  92. package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-C96NncCU.js.map → ganttDiagram-A5KZAMGK-mID1sFSl.js.map} +1 -1
  93. package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-CAuIexWi.js → gitGraphDiagram-K3NZZRJ6-DaA7yodM.js} +8 -8
  94. package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-CAuIexWi.js.map → gitGraphDiagram-K3NZZRJ6-DaA7yodM.js.map} +1 -1
  95. package/webapp/dist/assets/{graph-CvhwAY6w.js → graph-B86JxOkQ.js} +3 -3
  96. package/webapp/dist/assets/{graph-CvhwAY6w.js.map → graph-B86JxOkQ.js.map} +1 -1
  97. package/webapp/dist/assets/{index-BOO_zFrI.js → index-DYO4ZL8y.js} +369 -389
  98. package/webapp/dist/assets/{index-BOO_zFrI.js.map → index-DYO4ZL8y.js.map} +1 -1
  99. package/webapp/dist/assets/{infoDiagram-LFFYTUFH-C16Sckpz.js → infoDiagram-LFFYTUFH-DxF36W9g.js} +6 -6
  100. package/webapp/dist/assets/{infoDiagram-LFFYTUFH-C16Sckpz.js.map → infoDiagram-LFFYTUFH-DxF36W9g.js.map} +1 -1
  101. package/webapp/dist/assets/{ishikawaDiagram-PHBUUO56-oNG6I0p3.js → ishikawaDiagram-PHBUUO56-wvAzRzSO.js} +2 -2
  102. package/webapp/dist/assets/{ishikawaDiagram-PHBUUO56-oNG6I0p3.js.map → ishikawaDiagram-PHBUUO56-wvAzRzSO.js.map} +1 -1
  103. package/webapp/dist/assets/{journeyDiagram-4ABVD52K-437hhFHC.js → journeyDiagram-4ABVD52K-CIBXsttK.js} +5 -5
  104. package/webapp/dist/assets/{journeyDiagram-4ABVD52K-437hhFHC.js.map → journeyDiagram-4ABVD52K-CIBXsttK.js.map} +1 -1
  105. package/webapp/dist/assets/{kanban-definition-K7BYSVSG-DsCV_Tpx.js → kanban-definition-K7BYSVSG-DQTPyM5m.js} +3 -3
  106. package/webapp/dist/assets/{kanban-definition-K7BYSVSG-DsCV_Tpx.js.map → kanban-definition-K7BYSVSG-DQTPyM5m.js.map} +1 -1
  107. package/webapp/dist/assets/{layout-BttZf7fQ.js → layout-BG7IzQAG.js} +5 -5
  108. package/webapp/dist/assets/{layout-BttZf7fQ.js.map → layout-BG7IzQAG.js.map} +1 -1
  109. package/webapp/dist/assets/{linear-B75vD4Ho.js → linear-5XR-mXYw.js} +2 -2
  110. package/webapp/dist/assets/{linear-B75vD4Ho.js.map → linear-5XR-mXYw.js.map} +1 -1
  111. package/webapp/dist/assets/{mindmap-definition-YRQLILUH-DA1-XaNi.js → mindmap-definition-YRQLILUH-BwTQE6uN.js} +4 -4
  112. package/webapp/dist/assets/{mindmap-definition-YRQLILUH-DA1-XaNi.js.map → mindmap-definition-YRQLILUH-BwTQE6uN.js.map} +1 -1
  113. package/webapp/dist/assets/{pieDiagram-SKSYHLDU-Bx6hUJ4Q.js → pieDiagram-SKSYHLDU-ZYB35zd5.js} +8 -8
  114. package/webapp/dist/assets/{pieDiagram-SKSYHLDU-Bx6hUJ4Q.js.map → pieDiagram-SKSYHLDU-ZYB35zd5.js.map} +1 -1
  115. package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-zyduIle0.js → quadrantDiagram-337W2JSQ-BM041Q-W.js} +3 -3
  116. package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-zyduIle0.js.map → quadrantDiagram-337W2JSQ-BM041Q-W.js.map} +1 -1
  117. package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-BgfjyEJM.js → requirementDiagram-Z7DCOOCP-r_xMoroM.js} +4 -4
  118. package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-BgfjyEJM.js.map → requirementDiagram-Z7DCOOCP-r_xMoroM.js.map} +1 -1
  119. package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-lmOWaczS.js → sankeyDiagram-WA2Y5GQK-Ju2-t24N.js} +2 -2
  120. package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-lmOWaczS.js.map → sankeyDiagram-WA2Y5GQK-Ju2-t24N.js.map} +1 -1
  121. package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-DqJz-iYI.js → sequenceDiagram-2WXFIKYE-D83Bocd1.js} +4 -4
  122. package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-DqJz-iYI.js.map → sequenceDiagram-2WXFIKYE-D83Bocd1.js.map} +1 -1
  123. package/webapp/dist/assets/{stateDiagram-RAJIS63D-CngWYuX-.js → stateDiagram-RAJIS63D-mTmpZzpU.js} +9 -9
  124. package/webapp/dist/assets/{stateDiagram-RAJIS63D-CngWYuX-.js.map → stateDiagram-RAJIS63D-mTmpZzpU.js.map} +1 -1
  125. package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-BxyHvrvU.js → stateDiagram-v2-FVOUBMTO-BCn7mFeH.js} +5 -5
  126. package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-BxyHvrvU.js.map → stateDiagram-v2-FVOUBMTO-BCn7mFeH.js.map} +1 -1
  127. package/webapp/dist/assets/{timeline-definition-YZTLITO2-C7t6WVS3.js → timeline-definition-YZTLITO2-C1QBcYz8.js} +3 -3
  128. package/webapp/dist/assets/{timeline-definition-YZTLITO2-C7t6WVS3.js.map → timeline-definition-YZTLITO2-C1QBcYz8.js.map} +1 -1
  129. package/webapp/dist/assets/{treemap-KZPCXAKY-BDZ3n5TC.js → treemap-KZPCXAKY-BEyfK-Fo.js} +5 -5
  130. package/webapp/dist/assets/{treemap-KZPCXAKY-BDZ3n5TC.js.map → treemap-KZPCXAKY-BEyfK-Fo.js.map} +1 -1
  131. package/webapp/dist/assets/{vennDiagram-LZ73GAT5-CEw7GPed.js → vennDiagram-LZ73GAT5-C6SZhLMq.js} +2 -2
  132. package/webapp/dist/assets/{vennDiagram-LZ73GAT5-CEw7GPed.js.map → vennDiagram-LZ73GAT5-C6SZhLMq.js.map} +1 -1
  133. package/webapp/dist/assets/{xychartDiagram-JWTSCODW-DmS8BiaA.js → xychartDiagram-JWTSCODW-BUlvexnm.js} +3 -3
  134. package/webapp/dist/assets/{xychartDiagram-JWTSCODW-DmS8BiaA.js.map → xychartDiagram-JWTSCODW-BUlvexnm.js.map} +1 -1
  135. 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,246 @@ 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(' ');
187
330
  }
188
331
  function formatReminderContextFooter(language, state) {
332
+ const contextHealthIsNormal = state.contextHealth.kind === 'normal';
189
333
  if (language === 'zh') {
190
334
  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}`);
335
+ const contextHealthTail = formatZhReminderContextHealthTail(state.contextHealth);
336
+ const businessTail = formatZhReminderBusinessTail(state.business);
337
+ const statusTail = joinReminderFooterTails(language, [contextHealthTail, businessTail]);
338
+ switch (state.followingMessage.kind) {
339
+ case 'user_message':
340
+ // The reminder block is inserted immediately before the real user message. This
341
+ // branch prevents the reminder wrapper from lowering or re-labeling that message.
342
+ return (`${base}本轮提醒项块之后会紧接一条本轮真实的新用户消息;后续消息是用户的新诉求/指令,不是提醒项投影。` +
343
+ '提醒项块说明到此为止,不得外溢到那条消息:不要把后续用户消息称为“系统提示/没有新消息”,也不要因为本块说明而降低它的指令优先级。' +
344
+ `请按那条用户消息的原始语义继续处理;若它要求更新你的职责、偏好或心智资产,应照常落实;若系统提示上下文吃紧或告急,先按那条系统要求处理,再做普通任务动作。${statusTail}`);
345
+ case 'human_answer':
346
+ // This is a human answer to an askHuman question, not a fresh open-ended request. The
347
+ // model should use the answer to resume the waiting work without reclassifying it as a
348
+ // new user instruction.
349
+ return (`${base}本轮提醒项块之后会接着出现用户对一个提问的回答;那是用来继续等待中的工作,不是新的普通用户诉求/指令。` +
350
+ `请用那条回答继续原本等待答案的任务,不要把提醒项块说明外溢到那条回答上。${statusTail}`);
351
+ case 'runtime_notice':
352
+ // Dominds notices are deliberate driver instructions. Keep them distinct from user
353
+ // requests while allowing their own wording to drive the next action.
354
+ return `${base}本轮提醒项块之后会接着出现一条 Dominds 提示;它不是用户的新诉求/指令,请按其中的要求继续推进。${statusTail}`;
355
+ case 'none':
356
+ if (!contextHealthIsNormal) {
357
+ // When context is tight/critical, the context-preservation notice owns the turn. Do not add
358
+ // ordinary continuation wording that could encourage more work from old reminders.
359
+ return (`${base}本轮没有新的用户消息或 Dominds 提示;这是工具调用后的自动续推。` +
360
+ `不要把“没有新消息”理解为空系统提示。${statusTail}`);
361
+ }
362
+ // Normal tool-followup rounds may continue real business work, but reminder maintenance
363
+ // paths are merely references. This is the guard against loops that only add/delete/merge
364
+ // reminders after a task is otherwise done.
365
+ return (`${base}本轮没有新的用户消息或 Dominds 提示;这是工具调用后的自动续推。` +
366
+ '请基于提醒项之外的已有任务状态判断下一步:若已有明确、相关且有价值的任务动作,就继续执行;若唯一看似可做的动作只是新增、更新、删除、压缩或整理提醒项,则不要单独为提醒项维护继续调用工具。若当前确实只能等待外部结果或用户输入,不要为了避免“等待”而寻找无关小事。' +
367
+ `不要把“没有新消息”理解为空系统提示。${businessTail}`);
368
+ default: {
369
+ const _exhaustive = state.followingMessage;
370
+ throw new Error(`Unhandled zh reminder following-message state: ${String(_exhaustive)}`);
371
+ }
219
372
  }
220
- return (`${base}本轮没有新的用户消息或运行时提示;这是工具调用后的自动续推。` +
221
- '请基于已有任务状态判断下一步:若已有明确、相关且有价值的动作,就继续执行;若当前确实只能等待外部结果或用户输入,不要为了避免“等待”而寻找无关小事。' +
222
- `不要把“没有新消息”理解为空系统提示。${businessTail}`);
223
373
  }
224
374
  const base = `${formatSystemNoticePrefix(language)} Reminder context block ends. The reminder items between ` +
225
375
  '"Reminder context block begins" and "Reminder context block ends" are system reminders, ' +
226
376
  '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}`);
377
+ const contextHealthTail = formatEnReminderContextHealthTail(state.contextHealth);
378
+ const businessTail = formatEnReminderBusinessTail(state.business);
379
+ const statusTail = joinReminderFooterTails(language, [contextHealthTail, businessTail]);
380
+ switch (state.followingMessage.kind) {
381
+ case 'user_message':
382
+ // The reminder block is inserted immediately before the real user message. This branch
383
+ // prevents the reminder wrapper from lowering or re-labeling that message.
384
+ 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. ` +
385
+ '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. ' +
386
+ `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}`);
387
+ case 'human_answer':
388
+ // This is a human answer to an askHuman question, not a fresh open-ended request. The
389
+ // model should use the answer to resume the waiting work without reclassifying it as a
390
+ // new user instruction.
391
+ 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. ` +
392
+ `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}`);
393
+ case 'runtime_notice':
394
+ // Dominds notices are deliberate driver instructions. Keep them distinct from user requests
395
+ // while allowing their own wording to drive the next action.
396
+ 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}`;
397
+ case 'none':
398
+ if (!contextHealthIsNormal) {
399
+ // When context is tight/critical, the context-preservation notice owns the turn. Do not add
400
+ // ordinary continuation wording that could encourage more work from old reminders.
401
+ return (`${base}There is no new user message or Dominds notice in this round; this is an automatic continuation after a tool call. ` +
402
+ `Do not interpret the absence of a new message as an empty system notice. ${statusTail}`);
403
+ }
404
+ // Normal tool-followup rounds may continue real business work, but reminder maintenance
405
+ // paths are merely references. This is the guard against loops that only add/delete/merge
406
+ // reminders after a task is otherwise done.
407
+ return (`${base}There is no new user message or Dominds notice in this round; this is an automatic continuation after a tool call. ` +
408
+ '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 keep calling tools solely for reminder maintenance. If the work genuinely can only wait for an external result or user input, do not invent unrelated work just to avoid "waiting". ' +
409
+ `Do not interpret the absence of a new message as an empty system notice. ${businessTail}`);
410
+ default: {
411
+ const _exhaustive = state.followingMessage;
412
+ throw new Error(`Unhandled en reminder following-message state: ${String(_exhaustive)}`);
413
+ }
255
414
  }
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}`);
259
415
  }
260
416
  function isReminderGuideMetaRecord(value) {
261
417
  return typeof value === 'object' && value !== null && !Array.isArray(value);
@@ -301,7 +457,7 @@ function getReminderMaintenanceInstructions(language, reminderId, meta) {
301
457
  : deleteAltInstruction
302
458
  ? `删除通道:我不用 delete_reminder;我执行:${deleteAltInstruction}`
303
459
  : metaKind === 'mcp_lease'
304
- ? `删除通道:我不用 delete_reminder 释放资源;确认当前对话近期不再需要该 MCP runtime 时,我执行:${mcpReleaseInstruction}`
460
+ ? `删除通道:我不用 delete_reminder 释放资源;确认当前对话近期不再需要这个 MCP 连接时,我执行:${mcpReleaseInstruction}`
305
461
  : daemonCompleted
306
462
  ? `删除通道:确认已知悉 daemon 终态后,可清理:delete_reminder({ "reminder_id": "${reminderId}" })`
307
463
  : isPendingTellaskReminder && pendingTellaskCount === 0
@@ -312,7 +468,7 @@ function getReminderMaintenanceInstructions(language, reminderId, meta) {
312
468
  : deleteAltInstruction
313
469
  ? `Delete path: I do not use delete_reminder; I run: ${deleteAltInstruction}`
314
470
  : 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}`
471
+ ? `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
472
  : daemonCompleted
317
473
  ? `Delete path: after I have acknowledged the daemon terminal state, I may clean up: delete_reminder({ "reminder_id": "${reminderId}" })`
318
474
  : isPendingTellaskReminder && pendingTellaskCount === 0
@@ -347,13 +503,13 @@ function formatReminderMaintenanceReference(language, reminders) {
347
503
  return undefined;
348
504
  if (language === 'zh') {
349
505
  return [
350
- `${formatSystemNoticePrefix(language)} 我把下面的提醒项维护通道仅作为操作参考;如果我需要维护某条 reminder,我会按对应 reminder_id 选择工具。我不会把这些参考当成当前轮必须立即执行的动作,也不会因此延迟回应后续真实用户消息。`,
506
+ `${formatSystemNoticePrefix(language)} 我把下面的提醒项维护通道仅作为操作参考;如果我在处理真实用户消息、Dominds 提示或当前任务动作时确实需要维护某条 reminder,我会按对应 reminder_id 选择工具。我不会把这些参考当成当前轮必须立即执行的动作;没有新的用户消息、Dominds 提示或提醒项之外的任务动作时,我不会只为了清理/整理提醒项而继续调用提醒项工具,也不会因此延迟回应后续真实用户消息。`,
351
507
  '',
352
508
  ...lines,
353
509
  ].join('\n');
354
510
  }
355
511
  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.`,
512
+ `${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
513
  '',
358
514
  ...lines,
359
515
  ].join('\n');
@@ -401,7 +557,7 @@ function formatReminderItemGuide(language, reminderId, content, options) {
401
557
  return [
402
558
  `${systemPrefix} 提醒项 [${reminderId}](换程接续信息)`,
403
559
  '',
404
- `${projectionNote}你设置了换程接续提醒项,让运行时系统在新一程提醒你恢复工作。请把它当作快速恢复工作的接续包,不要自动当成当前必须立刻执行的新指令。`,
560
+ `${projectionNote}你设置了换程接续提醒项,Dominds 会在新一程提醒你恢复工作。请把它当作快速恢复工作的接续包,不要自动当成当前必须立刻执行的新指令。`,
405
561
  '',
406
562
  '你应优先保留下一步行动、关键定位、运行/验证信息、容易丢的临时细节;不要重复差遣牒已覆盖的内容。进入新一程后,你的第一步是以清醒头脑重新审视并整理更新:删除冗余、纠正偏激/失真思路、压缩成高质量提醒项。若目前只是粗略过桥笔记,进入新一程后必须尽快收敛。',
407
563
  '',
@@ -411,10 +567,10 @@ function formatReminderItemGuide(language, reminderId, content, options) {
411
567
  }
412
568
  const scopeLabel = scope === 'task' ? '(任务范围)' : scope === 'agent' ? '(智能体范围)' : '';
413
569
  const scopeGuide = scope === 'task'
414
- ? `${projectionNote}你设置了任务范围提醒项,让运行时系统在当前差遣牒任务内、所有由你主理的对话里提醒你。请把它当作当前任务的手头工作提示,不要自动当成系统下发的下一步动作。`
570
+ ? `${projectionNote}你设置了任务范围提醒项,Dominds 会在当前差遣牒任务内、所有由你主理的对话里提醒你。请把它当作当前任务的手头工作提示,不要自动当成系统下发的下一步动作。`
415
571
  : scope === 'agent'
416
- ? `${projectionNote}你设置了智能体范围提醒项,让运行时系统在所有由你主理的对话里提醒你。它只适合紧急、短期、全局刺眼提醒;不要用来记录普通任务状态,也不要自动当成系统下发的下一步动作。`
417
- : `${projectionNote}你设置了提醒项,让运行时系统提醒你。请把它当作用来保留当前对话里容易丢的手头工作信息的提示,不要自动当成系统下发的下一步动作。`;
572
+ ? `${projectionNote}你设置了智能体范围提醒项,Dominds 会在所有由你主理的对话里提醒你。它只适合紧急、短期、全局刺眼提醒;不要用来记录普通任务状态,也不要自动当成系统下发的下一步动作。`
573
+ : `${projectionNote}你设置了提醒项,Dominds 会在需要时提醒你。请把它当作用来保留当前对话里容易丢的手头工作信息的提示,不要自动当成系统下发的下一步动作。`;
418
574
  const scopeMaintenance = scope === 'task'
419
575
  ? '你应保持简洁、及时更新;不再需要时就删除。若它只对当前对话有效,应改写成 dialog 范围提醒;若需要全队同步当前任务状态,应写入差遣牒 progress,而不是扩大提醒范围。'
420
576
  : scope === 'agent'
@@ -434,7 +590,7 @@ function formatReminderItemGuide(language, reminderId, content, options) {
434
590
  if (managementTool) {
435
591
  return `${systemPrefix} REMINDER [${reminderId}] (TOOL STATE)
436
592
 
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.
593
+ ${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
594
 
439
595
  ${formatAutoMaintainedReminderManualMirrorBan(language)}
440
596
 
@@ -446,7 +602,7 @@ ${content}`;
446
602
  if (updateInstruction) {
447
603
  return `${systemPrefix} REMINDER [${reminderId}]
448
604
 
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.
605
+ ${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
606
 
451
607
  ${formatAutoMaintainedReminderManualMirrorBan(language)}
452
608
 
@@ -456,7 +612,7 @@ ${content}`;
456
612
  if (isContinuationPackageReminder) {
457
613
  return `${systemPrefix} REMINDER [${reminderId}] (CONTINUATION PACKAGE)
458
614
 
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.
615
+ ${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
616
 
461
617
  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
618
 
@@ -465,10 +621,10 @@ ${content}`;
465
621
  }
466
622
  const scopeLabel = scope === 'task' ? ' (TASK SCOPE)' : scope === 'agent' ? ' (AGENT SCOPE)' : '';
467
623
  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.`
624
+ ? `${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
625
  : 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.`;
626
+ ? `${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.`
627
+ : `${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
628
  const scopeMaintenance = scope === 'task'
473
629
  ? '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
630
  : scope === 'agent'
@@ -520,21 +676,26 @@ function formatDomindsNoteQ4HRegisterFailed(language, args) {
520
676
  }
521
677
  function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
522
678
  const isSideDialog = args.dialogScope === 'sideDialog';
679
+ // Business scenario: context-health prompts are inserted because the current course is close
680
+ // to losing useful state. The model should treat them as an immediate preservation workflow,
681
+ // but the old wording ("runtime remediation instruction") was unnecessarily technical and
682
+ // encouraged shallow acknowledgements. Say the business reason plainly: Dominds is protecting
683
+ // context, this is not a new user request, and the listed steps should be performed directly.
523
684
  if (language === 'zh') {
524
685
  if (args.kind === 'caution' && args.mode === 'soft') {
525
686
  if (isSideDialog) {
526
687
  return [
527
688
  `${formatSystemNoticePrefix(language)} 上下文状态:🟡 吃紧`,
528
689
  '',
529
- '这是一条运行时处置指令,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的处置动作。',
690
+ '这是 Dominds 为防止上下文丢失插入的保全提示,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的保全动作。',
530
691
  '',
531
692
  '影响:对话历史中的工具调用/结果信息很多已经过时,成为你的思考负担。',
532
693
  '',
533
694
  '行动:你当前处于支线对话。本程不要维护差遣牒,也不要整理差遣牒更新提案;当前目标是维护足够详尽的接续包提醒项,然后主动 clear_mind 开启新一程继续工作。',
534
695
  '',
535
- '提醒项应覆盖:当前对话历史中下一程需要知道的讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项长度没有技术限制,宁可完整一些;允许写成多条粗略提醒项,不必在当前程强行压成单条。',
696
+ '提醒项应覆盖:当前对话历史中下一程需要知道的讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项没有固定长度限制,宁可完整一些;允许写成多条粗略提醒项,不必在当前程强行压成单条。',
536
697
  '',
537
- '当前已处于吃紧处置阶段:不要继续扩张上下文,也不要提前进入“按接续包做清醒复核”的模式;真正清理冗余、合并提醒项,放到系统开启新一程后再做。',
698
+ 'Dominds 已提醒当前上下文吃紧:不要继续扩张上下文,也不要提前进入“按接续包做清醒复核”的模式;真正清理冗余、合并提醒项,放到 Dominds 开启新一程后再做。',
538
699
  '',
539
700
  '操作:',
540
701
  '- 优先新增详尽接续包提醒项:add_reminder({ "content": "..." })',
@@ -544,13 +705,13 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
544
705
  return [
545
706
  `${formatSystemNoticePrefix(language)} 上下文状态:🟡 吃紧`,
546
707
  '',
547
- '这是一条运行时处置指令,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的处置动作。',
708
+ '这是 Dominds 为防止上下文丢失插入的保全提示,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的保全动作。',
548
709
  '',
549
710
  '影响:对话历史中的工具调用/结果信息很多已经过时,成为你的思考负担。',
550
711
  '',
551
712
  '行动:你当前处于主线对话。先把当前对话历史中尚未落实到文档、且下一程需要知会的讨论细节落到差遣牒合适章节。然后再把差遣牒仍未覆盖、但恢复工作会丢的信息记进新提醒项过桥(下一步行动 + 关键定位信息 + 运行/验证信息 + 容易丢的临时细节);允许先带着一定冗余,也允许先写成多条粗略提醒项,不必在当前程强行压成单条。',
552
713
  '',
553
- '当前已处于吃紧处置阶段:不要继续扩张上下文,也不要提前进入“按接续包做清醒复核”的模式;那是系统真正开启新一程后的第一步。当前程的目标是先把未落文档的讨论细节补进差遣牒,再把差遣牒仍未覆盖、但恢复工作会丢的信息带过桥;真正清理冗余、合并提醒项,放到新一程再做。然后主动 clear_mind,开启新一程对话继续工作。',
714
+ 'Dominds 已提醒当前上下文吃紧:不要继续扩张上下文,也不要提前进入“按接续包做清醒复核”的模式;那是 Dominds 真正开启新一程后的第一步。当前程的目标是先把未落文档的讨论细节补进差遣牒,再把差遣牒仍未覆盖、但恢复工作会丢的信息带过桥;真正清理冗余、合并提醒项,放到新一程再做。然后主动 clear_mind,开启新一程对话继续工作。',
554
715
  '',
555
716
  '操作:',
556
717
  '- 优先新增差遣牒章节保存讨论细节:do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
@@ -563,30 +724,30 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
563
724
  return [
564
725
  `${formatSystemNoticePrefix(language)} 上下文状态:🔴 告急`,
565
726
  '',
566
- '这是一条运行时处置指令,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的处置动作。',
727
+ '这是 Dominds 为防止上下文丢失插入的保全提示,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的保全动作。',
567
728
  '',
568
- `系统最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
729
+ `Dominds 最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
569
730
  '',
570
731
  '行动:你当前处于支线对话。本程不要维护差遣牒,也不要整理差遣牒更新提案;当前目标是尽快维护足够详尽的接续包提醒项,然后 clear_mind。',
571
732
  '',
572
- '提醒项应覆盖:当前对话历史中下一程需要知道的讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项长度没有技术限制,宁可完整一些;允许写成多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
733
+ '提醒项应覆盖:当前对话历史中下一程需要知道的讨论细节、下一步行动、关键定位信息、运行/验证信息、临时路径/ID/样例输入,以及任何恢复工作容易丢的判断依据。提醒项没有固定长度限制,宁可完整一些;允许写成多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
573
734
  '',
574
735
  '操作:',
575
736
  '- 优先新增详尽接续包提醒项:add_reminder({ "content": "..." })',
576
737
  '- 只有在确实能就地复用现有提醒项、且不会额外增加当前程认知负担时,才更新:update_reminder({ "reminder_id": "<现有 reminder_id>", "content": "..." })',
577
738
  '- clear_mind({})',
578
739
  '',
579
- '当前处于告急处置阶段时,不要提前做“新一程清醒复核”;系统真正开启新一程后,第一步才是重新审视并整理:删除冗余、纠正偏激/失真思路、合并并压缩成高质量提醒项。',
740
+ 'Dominds 已提醒当前上下文告急:不要提前做“新一程清醒复核”;Dominds 真正开启新一程后,第一步才是重新审视并整理:删除冗余、纠正偏激/失真思路、合并并压缩成高质量提醒项。',
580
741
  ].join('\n');
581
742
  }
582
743
  return [
583
744
  `${formatSystemNoticePrefix(language)} 上下文状态:🔴 告急`,
584
745
  '',
585
- '这是一条运行时处置指令,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的处置动作。',
746
+ '这是 Dominds 为防止上下文丢失插入的保全提示,不是新的用户诉求;不要只回复“收到/好的/我先整理提醒项”,而要直接执行下面的保全动作。',
586
747
  '',
587
- `系统最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
748
+ `Dominds 最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
588
749
  '',
589
- '行动:你当前处于主线对话。尽快保住易丢信息,然后 clear_mind。当前处于告急处置阶段时,先把当前对话历史中尚未落实到文档、且下一程需要知会的讨论细节落到差遣牒合适章节。然后再把差遣牒仍未覆盖、但恢复工作会丢的信息新增提醒项带过桥;允许先保留多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
750
+ '行动:你当前处于主线对话。尽快保住易丢信息,然后 clear_mind。Dominds 已提醒当前上下文告急:先把当前对话历史中尚未落实到文档、且下一程需要知会的讨论细节落到差遣牒合适章节。然后再把差遣牒仍未覆盖、但恢复工作会丢的信息新增提醒项带过桥;允许先保留多条粗略提醒项,甚至带一定冗余也可以,不必在当前程强行整理干净。',
590
751
  '',
591
752
  '操作:',
592
753
  '- 优先新增差遣牒章节保存讨论细节:do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
@@ -595,7 +756,7 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
595
756
  '- 只有在确实能就地复用现有提醒项、且不会额外增加当前程认知负担时,才更新:update_reminder({ "reminder_id": "<现有 reminder_id>", "content": "..." })',
596
757
  '- clear_mind({})',
597
758
  '',
598
- '接续包要点:下一步行动 + 关键定位信息 + 运行验证方式 + 容易丢的临时细节;不要重复差遣牒已有内容,本程刚落入差遣牒的讨论细节只需提示下一程先查差遣牒。当前处于告急处置阶段时,不要提前做“新一程清醒复核”;系统真正开启新一程后,第一步才是重新审视并整理:删除冗余、纠正偏激/失真思路、合并并压缩成高质量提醒项。',
759
+ '接续包要点:下一步行动 + 关键定位信息 + 运行验证方式 + 容易丢的临时细节;不要重复差遣牒已有内容,本程刚落入差遣牒的讨论细节只需提示下一程先查差遣牒。Dominds 已提醒当前上下文告急:不要提前做“新一程清醒复核”;Dominds 真正开启新一程后,第一步才是重新审视并整理:删除冗余、纠正偏激/失真思路、合并并压缩成高质量提醒项。',
599
760
  ].join('\n');
600
761
  }
601
762
  if (args.kind === 'caution' && args.mode === 'soft') {
@@ -603,15 +764,15 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
603
764
  return [
604
765
  `${formatSystemNoticePrefix(language)} Context state: 🟡 caution`,
605
766
  '',
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.',
767
+ '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
768
  '',
608
769
  'Impact: stale call/results in dialog history are creating cognitive noise.',
609
770
  '',
610
771
  '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
772
  '',
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.',
773
+ '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
774
  '',
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.',
775
+ '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
776
  '',
616
777
  'Operations:',
617
778
  '- Prefer adding a detailed continuation-package reminder first: add_reminder({ "content": "..." })',
@@ -621,13 +782,13 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
621
782
  return [
622
783
  `${formatSystemNoticePrefix(language)} Context state: 🟡 caution`,
623
784
  '',
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.',
785
+ '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
786
  '',
626
787
  'Impact: stale call/results in dialog history are creating cognitive noise.',
627
788
  '',
628
789
  '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
790
  '',
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.',
791
+ '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
792
  '',
632
793
  'Operations:',
633
794
  '- Prefer creating a new Taskdoc section for discussion details: do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
@@ -640,30 +801,30 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
640
801
  return [
641
802
  `${formatSystemNoticePrefix(language)} Context state: 🔴 critical`,
642
803
  '',
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.',
804
+ '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
805
  '',
645
- `System will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
806
+ `Dominds will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
646
807
  '',
647
808
  '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
809
  '',
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.',
810
+ '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
811
  '',
651
812
  'Operations:',
652
813
  '- Prefer adding a detailed continuation-package reminder first: add_reminder({ "content": "..." })',
653
814
  '- 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
815
  '- clear_mind({})',
655
816
  '',
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.',
817
+ '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
818
  ].join('\n');
658
819
  }
659
820
  return [
660
821
  `${formatSystemNoticePrefix(language)} Context state: 🔴 critical`,
661
822
  '',
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.',
823
+ '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
824
  '',
664
- `System will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
825
+ `Dominds will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
665
826
  '',
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.',
827
+ '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
828
  '',
668
829
  'Operations:',
669
830
  '- Prefer creating a new Taskdoc section for discussion details: do_mind({ "category": "<category>", "selector": "<selector>", "content": "..." })',
@@ -672,7 +833,7 @@ function formatAgentFacingContextHealthV3RemediationGuide(language, args) {
672
833
  '- 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
834
  '- clear_mind({})',
674
835
  '',
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.',
836
+ '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
837
  ].join('\n');
677
838
  }
678
839
  function formatAgentFacingCriticalUserInterjectionRemediationGuide(language, args) {
@@ -681,23 +842,23 @@ function formatAgentFacingCriticalUserInterjectionRemediationGuide(language, arg
681
842
  return [
682
843
  `${formatSystemNoticePrefix(language)} 上下文状态:🔴 告急;收到用户插话`,
683
844
  '',
684
- '本轮刚收到的用户消息是真实用户插话,不是普通运行时处置提示;必须把它当作有效用户轮次处理,让用户看到你已经接住了这次插话。',
845
+ '本轮刚收到的用户消息是真实用户插话,不是普通的上下文保全提示;必须把它当作有效用户轮次处理,让用户看到你已经接住了这次插话。',
685
846
  '',
686
- `这次用户轮次已计入告急处置倒计数。系统最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
847
+ `这次用户轮次已计入上下文告急倒计数。Dominds 最多再提醒你 ${args.promptsRemainingAfterThis} 次,之后将自动清理头脑开启新一程对话。`,
687
848
  '',
688
849
  isSideDialog
689
850
  ? '行动:先直接回应用户这条插话;不要继续扩张上下文,不要维护差遣牒,也不要整理差遣牒更新提案。若还需要保留接续信息,只维护足够详尽的接续包提醒项,然后尽快 clear_mind。'
690
851
  : '行动:先直接回应用户这条插话;不要继续扩张上下文。若仍有当前对话中尚未落实到文档、且下一程需要知会的讨论细节,先落到差遣牒合适章节;再把差遣牒仍未覆盖、但恢复工作会丢的信息新增提醒项带过桥,然后尽快 clear_mind。',
691
852
  '',
692
- '要求:不要因为 critical 状态沉默、挂起或只回复“收到/好的”。若必须调用工具才能回答用户,工具结果回来后继续给出用户可见回复;保持回答聚焦,并把清理/换程作为紧随其后的处置动作。',
853
+ '要求:不要因为告急状态沉默、挂起或只回复“收到/好的”。若必须调用工具才能回答用户,工具结果回来后继续给出用户可见回复;保持回答聚焦,并把清理/换程作为紧随其后的保全动作。',
693
854
  ].join('\n');
694
855
  }
695
856
  return [
696
857
  `${formatSystemNoticePrefix(language)} Context state: 🔴 critical; user interjection received`,
697
858
  '',
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.',
859
+ '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
860
  '',
700
- `This user turn has been counted toward critical remediation. System will remind you ${args.promptsRemainingAfterThis} more time(s), then automatically clear mind.`,
861
+ `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
862
  '',
702
863
  isSideDialog
703
864
  ? '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.'