dominds 1.20.2 → 1.20.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 (154) hide show
  1. package/README.md +4 -4
  2. package/README.zh.md +2 -2
  3. package/dist/access-control.js +2 -2
  4. package/dist/cli/webui.d.ts +1 -1
  5. package/dist/cli/webui.js +29 -9
  6. package/dist/docs/OEC-philosophy.md +1 -1
  7. package/dist/docs/cli-usage.md +2 -1
  8. package/dist/docs/cli-usage.zh.md +6 -3
  9. package/dist/docs/context-health.md +2 -2
  10. package/dist/docs/context-health.zh.md +2 -2
  11. package/dist/docs/design.md +3 -3
  12. package/dist/docs/design.zh.md +3 -3
  13. package/dist/docs/dialog-system.md +18 -10
  14. package/dist/docs/dialog-system.zh.md +18 -10
  15. package/dist/docs/dominds-terminology.md +4 -4
  16. package/dist/docs/encapsulated-taskdoc.md +17 -10
  17. package/dist/docs/encapsulated-taskdoc.zh.md +18 -11
  18. package/dist/minds/load.js +15 -4
  19. package/dist/minds/minds-i18n.js +2 -2
  20. package/dist/minds/system-prompt-parts.js +11 -11
  21. package/dist/runtime/driver-messages.js +8 -4
  22. package/dist/server/api-routes.js +65 -0
  23. package/dist/server/port-selection.d.ts +19 -0
  24. package/dist/server/port-selection.js +57 -0
  25. package/dist/server/server-core.d.ts +2 -2
  26. package/dist/server/server-core.js +21 -7
  27. package/dist/server/static-server.js +1 -0
  28. package/dist/server.d.ts +3 -0
  29. package/dist/server.js +109 -44
  30. package/dist/team.d.ts +2 -3
  31. package/dist/team.js +17 -4
  32. package/dist/tools/builtins.js +5 -0
  33. package/dist/tools/ctrl.d.ts +11 -7
  34. package/dist/tools/ctrl.js +248 -34
  35. package/dist/tools/prompts/control/en/errors.md +2 -2
  36. package/dist/tools/prompts/control/en/index.md +1 -1
  37. package/dist/tools/prompts/control/en/principles.md +14 -12
  38. package/dist/tools/prompts/control/en/tools.md +40 -6
  39. package/dist/tools/prompts/control/zh/errors.md +2 -2
  40. package/dist/tools/prompts/control/zh/index.md +1 -1
  41. package/dist/tools/prompts/control/zh/principles.md +14 -12
  42. package/dist/tools/prompts/control/zh/tools.md +40 -6
  43. package/dist/tools/prompts/personal_memory/en/principles.md +1 -1
  44. package/dist/tools/prompts/personal_memory/zh/principles.md +1 -1
  45. package/dist/tools/prompts/team_memory/en/principles.md +1 -1
  46. package/dist/tools/prompts/team_memory/zh/principles.md +1 -1
  47. package/dist/tools/registry.d.ts +6 -0
  48. package/dist/tools/team_mgmt.js +5 -5
  49. package/dist/utils/task-package.d.ts +24 -1
  50. package/dist/utils/task-package.js +80 -5
  51. package/dist/utils/taskdoc-search-worker-client.d.ts +12 -0
  52. package/dist/utils/taskdoc-search-worker-client.js +320 -0
  53. package/dist/utils/taskdoc-search-worker.d.ts +1 -0
  54. package/dist/utils/taskdoc-search-worker.js +42 -0
  55. package/dist/utils/taskdoc-search.d.ts +28 -7
  56. package/dist/utils/taskdoc-search.js +62 -15
  57. package/dist/utils/taskdoc.js +60 -22
  58. package/package.json +3 -3
  59. package/webapp/dist/assets/{_basePickBy-B7M9Q0Fa.js → _basePickBy-BrC49DPW.js} +3 -3
  60. package/webapp/dist/assets/{_basePickBy-B7M9Q0Fa.js.map → _basePickBy-BrC49DPW.js.map} +1 -1
  61. package/webapp/dist/assets/{_baseUniq-DAeYoL6j.js → _baseUniq-C_Wcx-_S.js} +2 -2
  62. package/webapp/dist/assets/{_baseUniq-DAeYoL6j.js.map → _baseUniq-C_Wcx-_S.js.map} +1 -1
  63. package/webapp/dist/assets/{arc-Bh4nDbNR.js → arc-X5iIdpx0.js} +2 -2
  64. package/webapp/dist/assets/{arc-Bh4nDbNR.js.map → arc-X5iIdpx0.js.map} +1 -1
  65. package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-CxqmdsIm.js → architectureDiagram-2XIMDMQ5-DFfhMGkT.js} +7 -7
  66. package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-CxqmdsIm.js.map → architectureDiagram-2XIMDMQ5-DFfhMGkT.js.map} +1 -1
  67. package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-CxIWLtpt.js → blockDiagram-WCTKOSBZ-BAt4BaxZ.js} +7 -7
  68. package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-CxIWLtpt.js.map → blockDiagram-WCTKOSBZ-BAt4BaxZ.js.map} +1 -1
  69. package/webapp/dist/assets/{c4Diagram-IC4MRINW-1qErOIgG.js → c4Diagram-IC4MRINW-BYxKH5AA.js} +3 -3
  70. package/webapp/dist/assets/{c4Diagram-IC4MRINW-1qErOIgG.js.map → c4Diagram-IC4MRINW-BYxKH5AA.js.map} +1 -1
  71. package/webapp/dist/assets/{channel-DkgZHNUe.js → channel-CuYhL59H.js} +2 -2
  72. package/webapp/dist/assets/{channel-DkgZHNUe.js.map → channel-CuYhL59H.js.map} +1 -1
  73. package/webapp/dist/assets/{chunk-4BX2VUAB-BmdMbU9v.js → chunk-4BX2VUAB-Ch1PfLiD.js} +2 -2
  74. package/webapp/dist/assets/{chunk-4BX2VUAB-BmdMbU9v.js.map → chunk-4BX2VUAB-Ch1PfLiD.js.map} +1 -1
  75. package/webapp/dist/assets/{chunk-55IACEB6-D6LDTDBy.js → chunk-55IACEB6-B3rzakPd.js} +2 -2
  76. package/webapp/dist/assets/{chunk-55IACEB6-D6LDTDBy.js.map → chunk-55IACEB6-B3rzakPd.js.map} +1 -1
  77. package/webapp/dist/assets/{chunk-FMBD7UC4-C-BdCe4C.js → chunk-FMBD7UC4-CCZWJRJ5.js} +2 -2
  78. package/webapp/dist/assets/{chunk-FMBD7UC4-C-BdCe4C.js.map → chunk-FMBD7UC4-CCZWJRJ5.js.map} +1 -1
  79. package/webapp/dist/assets/{chunk-JSJVCQXG-WA_BLIm9.js → chunk-JSJVCQXG-Dqd_MOPD.js} +2 -2
  80. package/webapp/dist/assets/{chunk-JSJVCQXG-WA_BLIm9.js.map → chunk-JSJVCQXG-Dqd_MOPD.js.map} +1 -1
  81. package/webapp/dist/assets/{chunk-KX2RTZJC-CA7sDJO5.js → chunk-KX2RTZJC-DOpPZD_q.js} +2 -2
  82. package/webapp/dist/assets/{chunk-KX2RTZJC-CA7sDJO5.js.map → chunk-KX2RTZJC-DOpPZD_q.js.map} +1 -1
  83. package/webapp/dist/assets/{chunk-NQ4KR5QH-wlvxalE3.js → chunk-NQ4KR5QH-CUj2LNV0.js} +4 -4
  84. package/webapp/dist/assets/{chunk-NQ4KR5QH-wlvxalE3.js.map → chunk-NQ4KR5QH-CUj2LNV0.js.map} +1 -1
  85. package/webapp/dist/assets/{chunk-QZHKN3VN-Bo1VMcph.js → chunk-QZHKN3VN-DXeWDyzh.js} +2 -2
  86. package/webapp/dist/assets/{chunk-QZHKN3VN-Bo1VMcph.js.map → chunk-QZHKN3VN-DXeWDyzh.js.map} +1 -1
  87. package/webapp/dist/assets/{chunk-WL4C6EOR-B-Pk44be.js → chunk-WL4C6EOR-CqTowzs6.js} +6 -6
  88. package/webapp/dist/assets/{chunk-WL4C6EOR-B-Pk44be.js.map → chunk-WL4C6EOR-CqTowzs6.js.map} +1 -1
  89. package/webapp/dist/assets/{classDiagram-VBA2DB6C-BqKuyb49.js → classDiagram-VBA2DB6C-CvsxEN3D.js} +7 -7
  90. package/webapp/dist/assets/{classDiagram-VBA2DB6C-BqKuyb49.js.map → classDiagram-VBA2DB6C-CvsxEN3D.js.map} +1 -1
  91. package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-BqKuyb49.js → classDiagram-v2-RAHNMMFH-CvsxEN3D.js} +7 -7
  92. package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-BqKuyb49.js.map → classDiagram-v2-RAHNMMFH-CvsxEN3D.js.map} +1 -1
  93. package/webapp/dist/assets/{clone-BX5z8WVZ.js → clone-PGWIYNYc.js} +2 -2
  94. package/webapp/dist/assets/{clone-BX5z8WVZ.js.map → clone-PGWIYNYc.js.map} +1 -1
  95. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-B-s11SgN.js → cose-bilkent-S5V4N54A-Cf8RR_8j.js} +2 -2
  96. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-B-s11SgN.js.map → cose-bilkent-S5V4N54A-Cf8RR_8j.js.map} +1 -1
  97. package/webapp/dist/assets/{dagre-KLK3FWXG-DmQFV2qK.js → dagre-KLK3FWXG-C1yQDg-6.js} +7 -7
  98. package/webapp/dist/assets/{dagre-KLK3FWXG-DmQFV2qK.js.map → dagre-KLK3FWXG-C1yQDg-6.js.map} +1 -1
  99. package/webapp/dist/assets/{diagram-E7M64L7V-QRaBfST8.js → diagram-E7M64L7V-CrT4qBJh.js} +8 -8
  100. package/webapp/dist/assets/{diagram-E7M64L7V-QRaBfST8.js.map → diagram-E7M64L7V-CrT4qBJh.js.map} +1 -1
  101. package/webapp/dist/assets/{diagram-IFDJBPK2-lrWn1Obo.js → diagram-IFDJBPK2-B8WaCOcr.js} +7 -7
  102. package/webapp/dist/assets/{diagram-IFDJBPK2-lrWn1Obo.js.map → diagram-IFDJBPK2-B8WaCOcr.js.map} +1 -1
  103. package/webapp/dist/assets/{diagram-P4PSJMXO-sTU7Hh-Y.js → diagram-P4PSJMXO-BCZeNfu_.js} +7 -7
  104. package/webapp/dist/assets/{diagram-P4PSJMXO-sTU7Hh-Y.js.map → diagram-P4PSJMXO-BCZeNfu_.js.map} +1 -1
  105. package/webapp/dist/assets/{erDiagram-INFDFZHY-Cx6jc9Wq.js → erDiagram-INFDFZHY-BrYt0-mW.js} +5 -5
  106. package/webapp/dist/assets/{erDiagram-INFDFZHY-Cx6jc9Wq.js.map → erDiagram-INFDFZHY-BrYt0-mW.js.map} +1 -1
  107. package/webapp/dist/assets/{flowDiagram-PKNHOUZH-DfGI49Dz.js → flowDiagram-PKNHOUZH-8lZ5d5y-.js} +7 -7
  108. package/webapp/dist/assets/{flowDiagram-PKNHOUZH-DfGI49Dz.js.map → flowDiagram-PKNHOUZH-8lZ5d5y-.js.map} +1 -1
  109. package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-nrcHWWaM.js → ganttDiagram-A5KZAMGK-CQ8pOLf-.js} +3 -3
  110. package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-nrcHWWaM.js.map → ganttDiagram-A5KZAMGK-CQ8pOLf-.js.map} +1 -1
  111. package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-D8ivAqd6.js → gitGraphDiagram-K3NZZRJ6-aOTOe0HP.js} +8 -8
  112. package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-D8ivAqd6.js.map → gitGraphDiagram-K3NZZRJ6-aOTOe0HP.js.map} +1 -1
  113. package/webapp/dist/assets/{graph-R5G-y8tB.js → graph-CyMR1egR.js} +3 -3
  114. package/webapp/dist/assets/{graph-R5G-y8tB.js.map → graph-CyMR1egR.js.map} +1 -1
  115. package/webapp/dist/assets/{index--fy89xGh.js → index-B9TTmMv-.js} +550 -134
  116. package/webapp/dist/assets/index-B9TTmMv-.js.map +1 -0
  117. package/webapp/dist/assets/{infoDiagram-LFFYTUFH-PIoZHr7s.js → infoDiagram-LFFYTUFH-CXR9XjRe.js} +6 -6
  118. package/webapp/dist/assets/{infoDiagram-LFFYTUFH-PIoZHr7s.js.map → infoDiagram-LFFYTUFH-CXR9XjRe.js.map} +1 -1
  119. package/webapp/dist/assets/{ishikawaDiagram-PHBUUO56-oCM-LYk1.js → ishikawaDiagram-PHBUUO56-zwe-cqRW.js} +2 -2
  120. package/webapp/dist/assets/{ishikawaDiagram-PHBUUO56-oCM-LYk1.js.map → ishikawaDiagram-PHBUUO56-zwe-cqRW.js.map} +1 -1
  121. package/webapp/dist/assets/{journeyDiagram-4ABVD52K-C2qidjQ5.js → journeyDiagram-4ABVD52K-BV-8X5hz.js} +5 -5
  122. package/webapp/dist/assets/{journeyDiagram-4ABVD52K-C2qidjQ5.js.map → journeyDiagram-4ABVD52K-BV-8X5hz.js.map} +1 -1
  123. package/webapp/dist/assets/{kanban-definition-K7BYSVSG-Du0TC8WS.js → kanban-definition-K7BYSVSG-E3W-szUv.js} +3 -3
  124. package/webapp/dist/assets/{kanban-definition-K7BYSVSG-Du0TC8WS.js.map → kanban-definition-K7BYSVSG-E3W-szUv.js.map} +1 -1
  125. package/webapp/dist/assets/{layout-VmEo1OEB.js → layout-DvIjuV8I.js} +5 -5
  126. package/webapp/dist/assets/{layout-VmEo1OEB.js.map → layout-DvIjuV8I.js.map} +1 -1
  127. package/webapp/dist/assets/{linear-B662YHAc.js → linear-C-SIS0ki.js} +2 -2
  128. package/webapp/dist/assets/{linear-B662YHAc.js.map → linear-C-SIS0ki.js.map} +1 -1
  129. package/webapp/dist/assets/{mindmap-definition-YRQLILUH-D7arZj95.js → mindmap-definition-YRQLILUH-wigkPJ2B.js} +4 -4
  130. package/webapp/dist/assets/{mindmap-definition-YRQLILUH-D7arZj95.js.map → mindmap-definition-YRQLILUH-wigkPJ2B.js.map} +1 -1
  131. package/webapp/dist/assets/{pieDiagram-SKSYHLDU-DvjPP4PA.js → pieDiagram-SKSYHLDU-BKrYJ0LE.js} +8 -8
  132. package/webapp/dist/assets/{pieDiagram-SKSYHLDU-DvjPP4PA.js.map → pieDiagram-SKSYHLDU-BKrYJ0LE.js.map} +1 -1
  133. package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-B_JUGMj_.js → quadrantDiagram-337W2JSQ-fjwd0gVY.js} +3 -3
  134. package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-B_JUGMj_.js.map → quadrantDiagram-337W2JSQ-fjwd0gVY.js.map} +1 -1
  135. package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-DF0mpvE3.js → requirementDiagram-Z7DCOOCP-vgTMObSA.js} +4 -4
  136. package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-DF0mpvE3.js.map → requirementDiagram-Z7DCOOCP-vgTMObSA.js.map} +1 -1
  137. package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-CoXlxv00.js → sankeyDiagram-WA2Y5GQK-B-ZV3LF7.js} +2 -2
  138. package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-CoXlxv00.js.map → sankeyDiagram-WA2Y5GQK-B-ZV3LF7.js.map} +1 -1
  139. package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-DYqT5Pg7.js → sequenceDiagram-2WXFIKYE-DPhZYHhW.js} +4 -4
  140. package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-DYqT5Pg7.js.map → sequenceDiagram-2WXFIKYE-DPhZYHhW.js.map} +1 -1
  141. package/webapp/dist/assets/{stateDiagram-RAJIS63D-D9b1mN8-.js → stateDiagram-RAJIS63D-DLsw3SC8.js} +9 -9
  142. package/webapp/dist/assets/{stateDiagram-RAJIS63D-D9b1mN8-.js.map → stateDiagram-RAJIS63D-DLsw3SC8.js.map} +1 -1
  143. package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-DNzgudL_.js → stateDiagram-v2-FVOUBMTO-DqXB3dNs.js} +5 -5
  144. package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-DNzgudL_.js.map → stateDiagram-v2-FVOUBMTO-DqXB3dNs.js.map} +1 -1
  145. package/webapp/dist/assets/{timeline-definition-YZTLITO2-CkyKUY7A.js → timeline-definition-YZTLITO2-BFSqlDfo.js} +3 -3
  146. package/webapp/dist/assets/{timeline-definition-YZTLITO2-CkyKUY7A.js.map → timeline-definition-YZTLITO2-BFSqlDfo.js.map} +1 -1
  147. package/webapp/dist/assets/{treemap-KZPCXAKY-CZd09kF-.js → treemap-KZPCXAKY-sdfq6mHG.js} +5 -5
  148. package/webapp/dist/assets/{treemap-KZPCXAKY-CZd09kF-.js.map → treemap-KZPCXAKY-sdfq6mHG.js.map} +1 -1
  149. package/webapp/dist/assets/{vennDiagram-LZ73GAT5-BxVF5Olo.js → vennDiagram-LZ73GAT5-D7Cioksz.js} +2 -2
  150. package/webapp/dist/assets/{vennDiagram-LZ73GAT5-BxVF5Olo.js.map → vennDiagram-LZ73GAT5-D7Cioksz.js.map} +1 -1
  151. package/webapp/dist/assets/{xychartDiagram-JWTSCODW-BRwRloPc.js → xychartDiagram-JWTSCODW-No65aXqH.js} +3 -3
  152. package/webapp/dist/assets/{xychartDiagram-JWTSCODW-BRwRloPc.js.map → xychartDiagram-JWTSCODW-No65aXqH.js.map} +1 -1
  153. package/webapp/dist/index.html +1 -1
  154. package/webapp/dist/assets/index--fy89xGh.js.map +0 -1
@@ -2,20 +2,22 @@
2
2
  /**
3
3
  * Module: tools/ctrl
4
4
  *
5
- * Intrinsic dialog control tools - ALWAYS AVAILABLE TO ALL AGENTS
5
+ * Intrinsic dialog control tools.
6
6
  *
7
- * These tools are automatically included for every agent without needing to be
8
- * explicitly listed in team.yaml toolsets or tools configuration. They provide
9
- * core functionality for reminder management and mind control that should be
10
- * universally accessible.
7
+ * These tools are injected by runtime according to dialog scope without needing
8
+ * to be explicitly listed in team.yaml toolsets or tools configuration. Reminder
9
+ * and course-control tools are available in all dialog scopes; Taskdoc mutation
10
+ * tools are only exposed in Main Dialogs.
11
11
  *
12
12
  * INTRINSIC TOOLS:
13
13
  * - add_reminder: Add a reminder
14
14
  * - delete_reminder: Delete a reminder by id
15
15
  * - update_reminder: Update reminder content
16
16
  * - clear_mind: Start a new course, optionally add a reminder
17
- * - change_mind: Update a `.tsk/` Taskdoc section without starting a new course
18
- * - mind_more: Append entries to a `.tsk/` Taskdoc section without starting a new course
17
+ * - do_mind: Main Dialog only; create a new `.tsk/` Taskdoc section without starting a new course
18
+ * - change_mind: Main Dialog only; update a `.tsk/` Taskdoc section without starting a new course
19
+ * - mind_more: Main Dialog only; append entries to a `.tsk/` Taskdoc section without starting a new course
20
+ * - never_mind: Main Dialog only; delete a `.tsk/` Taskdoc section file without starting a new course
19
21
  * - recall_taskdoc: Read a Taskdoc section from `*.tsk/` by (category, selector)
20
22
  *
21
23
  * USAGE CONTEXT:
@@ -61,7 +63,7 @@ var __importStar = (this && this.__importStar) || (function () {
61
63
  };
62
64
  })();
63
65
  Object.defineProperty(exports, "__esModule", { value: true });
64
- exports.recallTaskdocTool = exports.mindMoreTool = exports.changeMindTool = exports.clearMindTool = exports.updateReminderTool = exports.addReminderTool = exports.deleteReminderTool = void 0;
66
+ exports.recallTaskdocTool = exports.mindMoreTool = exports.neverMindTool = exports.doMindTool = exports.changeMindTool = exports.clearMindTool = exports.updateReminderTool = exports.addReminderTool = exports.deleteReminderTool = void 0;
65
67
  const fs = __importStar(require("fs"));
66
68
  const path = __importStar(require("path"));
67
69
  const dialog_1 = require("../dialog");
@@ -367,9 +369,11 @@ function getCtrlMessages(language) {
367
369
  reminderContentEmpty: '提醒内容不能为空',
368
370
  invalidReminderPosition: (positionHuman, totalPlusOne) => `位置 ${positionHuman} 无效。有效范围:1-${totalPlusOne}`,
369
371
  invalidFormatUpdate: '参数格式不对。用法:update_reminder({ reminder_id: string, content: string })',
372
+ invalidFormatDoMind: '参数格式不对。用法:do_mind({ selector: string, category?: string, content: string })',
370
373
  invalidFormatChangeMind: '参数格式不对。用法:change_mind({ selector: string, category?: string, content: string })',
371
374
  tooManyArgsChangeMind: '参数格式不对。用法:change_mind({ selector: string, category?: string, content: string })',
372
375
  invalidFormatMindMore: '参数格式不对。用法:mind_more({ items: string[], sep?: string, selector?: string, category?: string })(selector 默认 progress)',
376
+ invalidFormatNeverMind: '参数格式不对。用法:never_mind({ selector: string, category?: string })',
373
377
  mindMoreItemsRequired: '需要提供要追加的条目(items),且每一项都必须是非空字符串。\n' +
374
378
  '示例:mind_more({"items":["- 下一步:复核验证结果(详见 <文档路径>#<章节>)","- 阻塞:等待 API 验收口径确认"]})',
375
379
  invalidFormatRecallTaskdoc: '参数格式不对。用法:recall_taskdoc({ category: string, selector: string })',
@@ -391,7 +395,10 @@ function getCtrlMessages(language) {
391
395
  invalidCategorySelector: (selector) => `选择器 '${selector}' 无效。需匹配 ^[a-zA-Z][a-zA-Z0-9_-]*(\\.[a-zA-Z0-9_-]*)*$。`,
392
396
  topLevelSelectorRequiresNoCategory: (category, selector) => `选择器 '${selector}' 是顶层保留分段(goals/constraints/progress),不能与 category='${category}' 一起用。`,
393
397
  bearInMindSelectorRequiresBearInMindCategory: (category, selector) => `选择器 '${selector}' 只能在 category='bearinmind' 下用(当前 category='${category}')。`,
394
- taskDocSectionMissing: (relativePath) => `未找到:${relativePath}。\n\n少量追加/创建可用 mind_more;整章创建/替换用 change_mind:\n- mind_more({"category":"<category>","selector":"<selector>","items":["..."]})\n- change_mind({"category":"<category>","selector":"<selector>","content":"..."})`,
398
+ taskDocSectionAlreadyExists: (relativePath) => `无法新增:${relativePath} 已存在。若确有把握要改写已有章节,请使用 change_mind({ ... })。`,
399
+ taskDocSectionChangeMissing: (relativePath) => `无法修改:${relativePath} 不存在。若要新增章节,请使用 do_mind({ ... })。`,
400
+ taskDocSectionMissing: (relativePath) => `未找到:${relativePath}。\n\n新增章节请使用 do_mind;已有章节追加小条目用 mind_more;改写已有章节用 change_mind:\n- do_mind({"category":"<category>","selector":"<selector>","content":"..."})\n- mind_more({"category":"<category>","selector":"<selector>","items":["..."]})\n- change_mind({"category":"<category>","selector":"<selector>","content":"..."})`,
401
+ taskDocSectionDeleteMissing: (relativePath) => `无法删除:${relativePath} 不存在。请先确认要删除的差遣牒章节。`,
395
402
  clearedCoursePrompt: (nextCourse) => (0, driver_messages_1.formatNewCourseStartPrompt)('zh', { nextCourse, source: 'clear_mind' }),
396
403
  };
397
404
  }
@@ -404,9 +411,11 @@ function getCtrlMessages(language) {
404
411
  reminderContentEmpty: 'Error: Reminder content cannot be empty',
405
412
  invalidReminderPosition: (positionHuman, totalPlusOne) => `Error: Invalid reminder position ${positionHuman}. Valid range: 1-${totalPlusOne}`,
406
413
  invalidFormatUpdate: 'Error: Invalid args. Use: update_reminder({ reminder_id: string, content: string })',
414
+ invalidFormatDoMind: 'Error: Invalid args. Use: do_mind({ selector: string, category?: string, content: string })',
407
415
  invalidFormatChangeMind: 'Error: Invalid args. Use: change_mind({ selector: string, category?: string, content: string })',
408
416
  tooManyArgsChangeMind: 'Error: Invalid args. Use: change_mind({ selector: string, category?: string, content: string })',
409
417
  invalidFormatMindMore: 'Error: Invalid args. Use: mind_more({ items: string[], sep?: string, selector?: string, category?: string }) (selector defaults to progress).',
418
+ invalidFormatNeverMind: 'Error: Invalid args. Use: never_mind({ selector: string, category?: string })',
410
419
  mindMoreItemsRequired: 'Error: items are required, and every item must be a non-empty string.\n' +
411
420
  'Example: mind_more({"items":["- Next: review verification results (details: <doc-path>#<section>)","- Blocker: API acceptance criteria pending"]})',
412
421
  invalidFormatRecallTaskdoc: 'Error: Invalid args. Use: recall_taskdoc({ category: string, selector: string })',
@@ -428,7 +437,10 @@ function getCtrlMessages(language) {
428
437
  invalidCategorySelector: (selector) => `Error: Invalid category selector '${selector}'. Must match \`^[a-zA-Z][a-zA-Z0-9_-]*(\\.[a-zA-Z0-9_-]+)*$\`.`,
429
438
  topLevelSelectorRequiresNoCategory: (category, selector) => `Error: Selector '${selector}' is reserved for top-level sections (goals/constraints/progress) and must not be used with category='${category}'.`,
430
439
  bearInMindSelectorRequiresBearInMindCategory: (category, selector) => `Error: Selector '${selector}' is only valid under category='bearinmind' (got category='${category}').`,
431
- taskDocSectionMissing: (relativePath) => `Not found: \`${relativePath}\`.\n\nUse \`mind_more\` for small append/create updates, or \`change_mind\` for full-section create/replace:\n- \`mind_more({\"category\":\"<category>\",\"selector\":\"<selector>\",\"items\":[\"...\"]})\`\n- \`change_mind({\"category\":\"<category>\",\"selector\":\"<selector>\",\"content\":\"...\"})\``,
440
+ taskDocSectionAlreadyExists: (relativePath) => `Cannot add: \`${relativePath}\` already exists. If you are sure you need to rewrite an existing section, use \`change_mind({ ... })\`.`,
441
+ taskDocSectionChangeMissing: (relativePath) => `Cannot change: \`${relativePath}\` does not exist. To create a new section, use \`do_mind({ ... })\`.`,
442
+ taskDocSectionMissing: (relativePath) => `Not found: \`${relativePath}\`.\n\nUse \`do_mind\` to create a section, \`mind_more\` for small append-only updates to existing sections, and \`change_mind\` to rewrite existing sections:\n- \`do_mind({\"category\":\"<category>\",\"selector\":\"<selector>\",\"content\":\"...\"})\`\n- \`mind_more({\"category\":\"<category>\",\"selector\":\"<selector>\",\"items\":[\"...\"]})\`\n- \`change_mind({\"category\":\"<category>\",\"selector\":\"<selector>\",\"content\":\"...\"})\``,
443
+ taskDocSectionDeleteMissing: (relativePath) => `Cannot delete: \`${relativePath}\` does not exist. Check the Taskdoc section target first.`,
432
444
  clearedCoursePrompt: (nextCourse) => (0, driver_messages_1.formatNewCourseStartPrompt)('en', { nextCourse, source: 'clear_mind' }),
433
445
  };
434
446
  }
@@ -701,10 +713,10 @@ exports.clearMindTool = {
701
713
  exports.changeMindTool = {
702
714
  type: 'func',
703
715
  name: 'change_mind',
704
- description: 'Replace one shared Taskdoc section in the Main Dialog.',
716
+ description: 'Replace one existing shared Taskdoc section in the Main Dialog.',
705
717
  descriptionI18n: {
706
- en: 'Replace one shared Taskdoc section in the Main Dialog.',
707
- zh: '在主线对话中替换一段共享差遣牒章节。',
718
+ en: 'Replace one existing shared Taskdoc section in the Main Dialog.',
719
+ zh: '在主线对话中替换一段已存在的共享差遣牒章节。',
708
720
  },
709
721
  parameters: {
710
722
  type: 'object',
@@ -730,16 +742,19 @@ exports.changeMindTool = {
730
742
  const maintainerId = dlg instanceof dialog_1.SideDialog ? dlg.mainDialog.agentId : dlg.agentId;
731
743
  if (language === 'zh') {
732
744
  return (0, tool_1.toolFailure)(`错误:\`change_mind\` 仅允许在主线对话中使用(支线对话中不可用)。\n` +
733
- `请诉请差遣牒维护人 @${maintainerId} 在其对话中执行 \`mind_more\` \`change_mind\`,并提供要追加的条目或已合并好的“分段全文替换稿”(禁止覆盖/抹掉他人条目)。`);
745
+ `请诉请差遣牒维护人 @${maintainerId} 在其对话中执行 \`do_mind\` / \`mind_more\` / \`change_mind\` / \`never_mind\`,并提供要新增的章节、要追加的条目、已合并好的“分段全文替换稿”或要删除的章节(禁止覆盖/抹掉他人条目)。`);
734
746
  }
735
747
  return (0, tool_1.toolFailure)(`Error: \`change_mind\` is only available in the Main Dialog (not in Side Dialogs).\n` +
736
- `Ask the Taskdoc maintainer @${maintainerId} to run \`mind_more\` or \`change_mind\` with entries to append or a fully merged full-section replacement draft (do not overwrite/delete other contributors).`);
748
+ `Ask the Taskdoc maintainer @${maintainerId} to run \`do_mind\` / \`mind_more\` / \`change_mind\` / \`never_mind\` with the new section to create, entries to append, a fully merged full-section replacement draft, or the section to delete (do not overwrite/delete other contributors).`);
737
749
  }
738
750
  const selectorValue = args['selector'];
739
751
  const selector = typeof selectorValue === 'string' ? selectorValue.trim() : '';
740
752
  if (!selector)
741
753
  return (0, tool_1.toolFailure)(t.selectorRequired);
742
754
  const categoryValue = args['category'];
755
+ if (categoryValue !== undefined && typeof categoryValue !== 'string') {
756
+ return (0, tool_1.toolFailure)(t.invalidFormatChangeMind);
757
+ }
743
758
  const category = typeof categoryValue === 'string' ? categoryValue.trim() : undefined;
744
759
  const contentValue = args['content'];
745
760
  const newTaskDocContent = typeof contentValue === 'string' ? contentValue.trim() : '';
@@ -780,13 +795,222 @@ exports.changeMindTool = {
780
795
  }
781
796
  }
782
797
  }
783
- await (0, task_package_1.updateTaskPackageByChangeMindTarget)({
798
+ const result = await (0, task_package_1.updateTaskPackageByChangeMindTarget)({
784
799
  taskPackageDirFullPath: fullPath,
785
800
  target: parsed.target,
786
801
  content: newTaskDocContent,
787
802
  updatedBy: caller.id,
788
803
  });
789
- return (0, tool_result_messages_1.formatToolActionResult)(language, 'mindChanged');
804
+ switch (result.kind) {
805
+ case 'updated':
806
+ return (0, tool_result_messages_1.formatToolActionResult)(language, 'mindChanged');
807
+ case 'missing':
808
+ return (0, tool_1.toolFailure)(t.taskDocSectionChangeMissing((0, task_package_1.taskPackageRelativePathForChangeMindTarget)(parsed.target)));
809
+ default: {
810
+ const _exhaustive = result;
811
+ return _exhaustive;
812
+ }
813
+ }
814
+ },
815
+ };
816
+ exports.doMindTool = {
817
+ type: 'func',
818
+ name: 'do_mind',
819
+ description: 'Create one new shared Taskdoc section in the Main Dialog.',
820
+ descriptionI18n: {
821
+ en: 'Create one new shared Taskdoc section in the Main Dialog.',
822
+ zh: '在主线对话中新增一段共享差遣牒章节。',
823
+ },
824
+ parameters: {
825
+ type: 'object',
826
+ additionalProperties: false,
827
+ required: ['selector', 'content'],
828
+ properties: {
829
+ selector: {
830
+ type: 'string',
831
+ description: 'Target section selector. Top-level: goals|constraints|progress. Under category="bearinmind": contracts|acceptance|grants|runbook|decisions|risks. For other categories: any identifier.',
832
+ },
833
+ category: {
834
+ type: 'string',
835
+ description: 'Optional category directory within the Taskdoc package. When present, selector targets <category>/<selector>.md.',
836
+ },
837
+ content: { type: 'string', description: 'New section content.' },
838
+ },
839
+ },
840
+ argsValidation: 'dominds',
841
+ async call(dlg, caller, args) {
842
+ const language = (0, work_language_1.getWorkLanguage)();
843
+ const t = getCtrlMessages(language);
844
+ if (dlg.askerDialog !== undefined) {
845
+ const maintainerId = dlg instanceof dialog_1.SideDialog ? dlg.mainDialog.agentId : dlg.agentId;
846
+ if (language === 'zh') {
847
+ return (0, tool_1.toolFailure)(`错误:\`do_mind\` 仅允许在主线对话中使用(支线对话中不可用)。\n` +
848
+ `请诉请差遣牒维护人 @${maintainerId} 在其对话中执行 \`do_mind\` / \`mind_more\` / \`change_mind\` / \`never_mind\`,并提供要新增的章节、要追加的条目、已合并好的“分段全文替换稿”或要删除的章节(禁止覆盖/抹掉他人条目)。`);
849
+ }
850
+ return (0, tool_1.toolFailure)(`Error: \`do_mind\` is only available in the Main Dialog (not in Side Dialogs).\n` +
851
+ `Ask the Taskdoc maintainer @${maintainerId} to run \`do_mind\` / \`mind_more\` / \`change_mind\` / \`never_mind\` with the new section to create, entries to append, a fully merged full-section replacement draft, or the section to delete (do not overwrite/delete other contributors).`);
852
+ }
853
+ const selectorValue = args['selector'];
854
+ const selector = typeof selectorValue === 'string' ? selectorValue.trim() : '';
855
+ if (!selector)
856
+ return (0, tool_1.toolFailure)(t.selectorRequired);
857
+ const categoryValue = args['category'];
858
+ if (categoryValue !== undefined && typeof categoryValue !== 'string') {
859
+ return (0, tool_1.toolFailure)(t.invalidFormatDoMind);
860
+ }
861
+ const category = typeof categoryValue === 'string' ? categoryValue.trim() : undefined;
862
+ const contentValue = args['content'];
863
+ const newTaskDocContent = typeof contentValue === 'string' ? contentValue.trim() : '';
864
+ if (!newTaskDocContent)
865
+ return (0, tool_1.toolFailure)(t.taskDocContentRequired);
866
+ // Taskdoc path is immutable for the dialog lifecycle.
867
+ const taskDocPath = dlg.taskDocPath;
868
+ if (!taskDocPath)
869
+ return (0, tool_1.toolFailure)(t.noTaskDocPathConfigured);
870
+ const workspaceRoot = path.resolve(process.cwd());
871
+ const fullPath = path.resolve(workspaceRoot, taskDocPath);
872
+ if (!isPathWithinDirectory(fullPath, workspaceRoot)) {
873
+ return (0, tool_1.toolFailure)(t.pathMustBeWithinWorkspace);
874
+ }
875
+ if (!(0, task_package_1.isTaskPackagePath)(taskDocPath))
876
+ return (0, tool_1.toolFailure)(t.invalidTaskDocPath(taskDocPath));
877
+ const parsed = (0, task_package_1.parseTaskPackageChangeMindTarget)({ selector, category });
878
+ if (parsed.kind !== 'ok') {
879
+ const e = parsed.error;
880
+ switch (e.kind) {
881
+ case 'selector_required':
882
+ return (0, tool_1.toolFailure)(t.selectorRequired);
883
+ case 'invalid_category_name':
884
+ return (0, tool_1.toolFailure)(t.invalidCategory(e.category));
885
+ case 'invalid_category_selector':
886
+ return (0, tool_1.toolFailure)(t.invalidCategorySelector(e.selector));
887
+ case 'invalid_top_level_selector':
888
+ return (0, tool_1.toolFailure)(t.invalidSelector(e.selector));
889
+ case 'invalid_bearinmind_selector':
890
+ return (0, tool_1.toolFailure)(t.invalidSelector(e.selector));
891
+ case 'top_level_selector_requires_no_category':
892
+ return (0, tool_1.toolFailure)(t.topLevelSelectorRequiresNoCategory(e.category, e.selector));
893
+ case 'bearinmind_selector_requires_bearinmind_category':
894
+ return (0, tool_1.toolFailure)(t.bearInMindSelectorRequiresBearInMindCategory(e.category, e.selector));
895
+ default: {
896
+ const _exhaustive = e;
897
+ return (0, tool_1.toolFailure)(String(_exhaustive));
898
+ }
899
+ }
900
+ }
901
+ const result = await (0, task_package_1.createTaskPackageByChangeMindTarget)({
902
+ taskPackageDirFullPath: fullPath,
903
+ target: parsed.target,
904
+ content: newTaskDocContent,
905
+ updatedBy: caller.id,
906
+ });
907
+ switch (result.kind) {
908
+ case 'created':
909
+ return (0, tool_result_messages_1.formatToolActionResult)(language, 'mindChanged');
910
+ case 'exists':
911
+ return (0, tool_1.toolFailure)(t.taskDocSectionAlreadyExists((0, task_package_1.taskPackageRelativePathForChangeMindTarget)(parsed.target)));
912
+ default: {
913
+ const _exhaustive = result;
914
+ return _exhaustive;
915
+ }
916
+ }
917
+ },
918
+ };
919
+ exports.neverMindTool = {
920
+ type: 'func',
921
+ name: 'never_mind',
922
+ description: 'Delete one shared Taskdoc section file in the Main Dialog.',
923
+ descriptionI18n: {
924
+ en: 'Delete one shared Taskdoc section file in the Main Dialog.',
925
+ zh: '在主线对话中删除一段共享差遣牒章节文件。',
926
+ },
927
+ parameters: {
928
+ type: 'object',
929
+ additionalProperties: false,
930
+ required: ['selector'],
931
+ properties: {
932
+ selector: {
933
+ type: 'string',
934
+ description: 'Target section selector. Top-level: goals|constraints|progress. Under category="bearinmind": contracts|acceptance|grants|runbook|decisions|risks. For other categories: any identifier.',
935
+ },
936
+ category: {
937
+ type: 'string',
938
+ description: 'Optional category directory within the Taskdoc package. When present, selector targets <category>/<selector>.md.',
939
+ },
940
+ },
941
+ },
942
+ argsValidation: 'dominds',
943
+ async call(dlg, _caller, args) {
944
+ const language = (0, work_language_1.getWorkLanguage)();
945
+ const t = getCtrlMessages(language);
946
+ if (dlg.askerDialog !== undefined) {
947
+ const maintainerId = dlg instanceof dialog_1.SideDialog ? dlg.mainDialog.agentId : dlg.agentId;
948
+ if (language === 'zh') {
949
+ return (0, tool_1.toolFailure)(`错误:\`never_mind\` 仅允许在主线对话中使用(支线对话中不可用)。\n` +
950
+ `请诉请差遣牒维护人 @${maintainerId} 在其对话中执行 \`do_mind\` / \`mind_more\` / \`change_mind\` / \`never_mind\`,并提供要新增的章节、要追加的条目、已合并好的“分段全文替换稿”或要删除的章节(禁止覆盖/抹掉他人条目)。`);
951
+ }
952
+ return (0, tool_1.toolFailure)(`Error: \`never_mind\` is only available in the Main Dialog (not in Side Dialogs).\n` +
953
+ `Ask the Taskdoc maintainer @${maintainerId} to run \`do_mind\` / \`mind_more\` / \`change_mind\` / \`never_mind\` with the new section to create, entries to append, a fully merged full-section replacement draft, or the section to delete (do not overwrite/delete other contributors).`);
954
+ }
955
+ const selectorValue = args['selector'];
956
+ const selector = typeof selectorValue === 'string' ? selectorValue.trim() : '';
957
+ if (!selector)
958
+ return (0, tool_1.toolFailure)(t.selectorRequired);
959
+ const categoryValue = args['category'];
960
+ if (categoryValue !== undefined && typeof categoryValue !== 'string') {
961
+ return (0, tool_1.toolFailure)(t.invalidFormatNeverMind);
962
+ }
963
+ const category = typeof categoryValue === 'string' ? categoryValue.trim() : undefined;
964
+ // Taskdoc path is immutable for the dialog lifecycle.
965
+ const taskDocPath = dlg.taskDocPath;
966
+ if (!taskDocPath)
967
+ return (0, tool_1.toolFailure)(t.noTaskDocPathConfigured);
968
+ const workspaceRoot = path.resolve(process.cwd());
969
+ const fullPath = path.resolve(workspaceRoot, taskDocPath);
970
+ if (!isPathWithinDirectory(fullPath, workspaceRoot)) {
971
+ return (0, tool_1.toolFailure)(t.pathMustBeWithinWorkspace);
972
+ }
973
+ if (!(0, task_package_1.isTaskPackagePath)(taskDocPath))
974
+ return (0, tool_1.toolFailure)(t.invalidTaskDocPath(taskDocPath));
975
+ const parsed = (0, task_package_1.parseTaskPackageChangeMindTarget)({ selector, category });
976
+ if (parsed.kind !== 'ok') {
977
+ const e = parsed.error;
978
+ switch (e.kind) {
979
+ case 'selector_required':
980
+ return (0, tool_1.toolFailure)(t.selectorRequired);
981
+ case 'invalid_category_name':
982
+ return (0, tool_1.toolFailure)(t.invalidCategory(e.category));
983
+ case 'invalid_category_selector':
984
+ return (0, tool_1.toolFailure)(t.invalidCategorySelector(e.selector));
985
+ case 'invalid_top_level_selector':
986
+ return (0, tool_1.toolFailure)(t.invalidSelector(e.selector));
987
+ case 'invalid_bearinmind_selector':
988
+ return (0, tool_1.toolFailure)(t.invalidSelector(e.selector));
989
+ case 'top_level_selector_requires_no_category':
990
+ return (0, tool_1.toolFailure)(t.topLevelSelectorRequiresNoCategory(e.category, e.selector));
991
+ case 'bearinmind_selector_requires_bearinmind_category':
992
+ return (0, tool_1.toolFailure)(t.bearInMindSelectorRequiresBearInMindCategory(e.category, e.selector));
993
+ default: {
994
+ const _exhaustive = e;
995
+ return (0, tool_1.toolFailure)(String(_exhaustive));
996
+ }
997
+ }
998
+ }
999
+ const result = await (0, task_package_1.deleteTaskPackageByChangeMindTarget)({
1000
+ taskPackageDirFullPath: fullPath,
1001
+ target: parsed.target,
1002
+ });
1003
+ switch (result.kind) {
1004
+ case 'deleted':
1005
+ return (0, tool_result_messages_1.formatToolActionResult)(language, 'deleted');
1006
+ case 'missing': {
1007
+ return (0, tool_1.toolFailure)(t.taskDocSectionDeleteMissing((0, task_package_1.taskPackageRelativePathForChangeMindTarget)(parsed.target)));
1008
+ }
1009
+ default: {
1010
+ const _exhaustive = result;
1011
+ return _exhaustive;
1012
+ }
1013
+ }
790
1014
  },
791
1015
  };
792
1016
  exports.mindMoreTool = {
@@ -829,10 +1053,10 @@ exports.mindMoreTool = {
829
1053
  const maintainerId = dlg instanceof dialog_1.SideDialog ? dlg.mainDialog.agentId : dlg.agentId;
830
1054
  if (language === 'zh') {
831
1055
  return (0, tool_1.toolFailure)(`错误:\`mind_more\` 仅允许在主线对话中使用(支线对话中不可用)。\n` +
832
- `请诉请差遣牒维护人 @${maintainerId} 在其对话中执行 \`mind_more\` \`change_mind\`,并提供要追加或已合并好的内容(禁止覆盖/抹掉他人条目)。`);
1056
+ `请诉请差遣牒维护人 @${maintainerId} 在其对话中执行 \`do_mind\` / \`mind_more\` / \`change_mind\` / \`never_mind\`,并提供要新增的章节、要追加的条目、已合并好的“分段全文替换稿”或要删除的章节(禁止覆盖/抹掉他人条目)。`);
833
1057
  }
834
1058
  return (0, tool_1.toolFailure)(`Error: \`mind_more\` is only available in the Main Dialog (not in Side Dialogs).\n` +
835
- `Ask the Taskdoc maintainer @${maintainerId} to run \`mind_more\` or \`change_mind\` with the entries to append or a merged draft (do not overwrite/delete other contributors).`);
1059
+ `Ask the Taskdoc maintainer @${maintainerId} to run \`do_mind\` / \`mind_more\` / \`change_mind\` / \`never_mind\` with the new section to create, entries to append, a merged full-section replacement draft, or the section to delete (do not overwrite/delete other contributors).`);
836
1060
  }
837
1061
  const rawItems = args['items'];
838
1062
  if (!Array.isArray(rawItems) || rawItems.length === 0) {
@@ -860,6 +1084,9 @@ exports.mindMoreTool = {
860
1084
  if (!selector)
861
1085
  return (0, tool_1.toolFailure)(t.selectorRequired);
862
1086
  const categoryValue = args['category'];
1087
+ if (categoryValue !== undefined && typeof categoryValue !== 'string') {
1088
+ return (0, tool_1.toolFailure)(t.invalidFormatMindMore);
1089
+ }
863
1090
  const category = typeof categoryValue === 'string' ? categoryValue.trim() : undefined;
864
1091
  // Taskdoc path is immutable for the dialog lifecycle.
865
1092
  const taskDocPath = dlg.taskDocPath;
@@ -971,23 +1198,10 @@ exports.recallTaskdocTool = {
971
1198
  }
972
1199
  }
973
1200
  const target = parsed.target;
974
- const relPath = (() => {
975
- switch (target.kind) {
976
- case 'bearinmind':
977
- return path.join('bearinmind', (0, task_package_1.bearInMindFilenameForSection)(target.section));
978
- case 'category':
979
- return path.join(target.category, `${target.selector}.md`);
980
- case 'top_level':
981
- return null;
982
- default: {
983
- const _exhaustive = target;
984
- return _exhaustive;
985
- }
986
- }
987
- })();
988
- if (relPath === null) {
1201
+ if (target.kind === 'top_level') {
989
1202
  return (0, tool_1.toolFailure)(t.invalidFormatRecallTaskdoc);
990
1203
  }
1204
+ const relPath = (0, task_package_1.taskPackageRelativePathForChangeMindTarget)(target);
991
1205
  const sectionPath = path.resolve(fullPath, relPath);
992
1206
  if (!isPathWithinDirectory(sectionPath, fullPath)) {
993
1207
  return (0, tool_1.toolFailure)(t.pathMustBeWithinWorkspace);
@@ -93,9 +93,9 @@ A: `dialog` reminders are only for the current dialog's working set. `personal`
93
93
 
94
94
  A: Use `personal` only for responsibility-related reminders that you should keep seeing in all later dialogs you lead. Everything else should default to `dialog`.
95
95
 
96
- ### Q: Do mind_more / change_mind reset dialog rounds?
96
+ ### Q: Do do_mind / mind_more / change_mind / never_mind start a new course?
97
97
 
98
- A: No. `mind_more` / `change_mind` only update Taskdoc content; they do not reset dialog rounds.
98
+ A: No. `do_mind` / `mind_more` / `change_mind` / `never_mind` only update Taskdoc content; they do not start a new course.
99
99
 
100
100
  ### Q: Are taskdoc updates immediately visible to all teammates?
101
101
 
@@ -27,7 +27,7 @@
27
27
  control is Dominds' **dialog control toolset** for managing dialog state, reminders, taskdocs, and inter-dialog reply closure semantics:
28
28
 
29
29
  - **Reminder management**: Two reminder scopes. Default to dialog-local working set; use `personal` only for responsibility-linked notes that you should keep seeing in all later dialogs you lead
30
- - **Taskdoc operations**: Append to or replace task contract sections (goals/constraints/progress); within Taskdoc, `progress` is the team-shared, quasi-real-time, scannable task bulletin board
30
+ - **Taskdoc operations**: Append to, replace, or delete task contract sections (goals/constraints/progress); within Taskdoc, `progress` is the team-shared, quasi-real-time, scannable task bulletin board
31
31
  - **Context maintenance**: Reduce cognitive load without losing key resume state
32
32
  - **Reply routing**: Separate `tellaskBack`, `replyTellask*`, and plain text by responsibility in Side Dialog / ask-back flows
33
33
 
@@ -73,8 +73,8 @@ Taskdoc is a **task contract** and the task's **team-shared source of current tr
73
73
 
74
74
  **Update Rules:**
75
75
 
76
- - `mind_more` appends small entries; `change_mind` replaces a full section
77
- - Does not reset dialog rounds
76
+ - `do_mind` creates a new section; `mind_more` appends small entries; `change_mind` replaces an existing full section; `never_mind` deletes a whole section file
77
+ - Does not start a new course
78
78
  - Changes visible to all teammates
79
79
  - When writing `progress`, assume teammates will skim it to synchronize on the current task truth rather than read your private process log
80
80
  - Do not keep blindly calling `mind_more` until `progress` becomes a chronology; when the bulletin board starts accumulating duplicates, stale entries, or noisy history, use `change_mind` to condense it around facts that are still effective now
@@ -82,14 +82,16 @@ Taskdoc is a **task contract** and the task's **team-shared source of current tr
82
82
 
83
83
  ## Tool Overview
84
84
 
85
- | Tool | Function |
86
- | --------------- | ---------------------------------------------------- |
87
- | add_reminder | Add reminder |
88
- | delete_reminder | Delete reminder |
89
- | update_reminder | Update reminder content |
90
- | mind_more | Append entries to Taskdoc (defaults to progress) |
91
- | change_mind | Replace Taskdoc section (goals/constraints/progress) |
92
- | recall_taskdoc | Read taskdoc chapter |
85
+ | Tool | Function |
86
+ | --------------- | ------------------------------------------------ |
87
+ | add_reminder | Add reminder |
88
+ | delete_reminder | Delete reminder |
89
+ | update_reminder | Update reminder content |
90
+ | do_mind | Create new Taskdoc section |
91
+ | mind_more | Append entries to Taskdoc (defaults to progress) |
92
+ | change_mind | Replace existing Taskdoc section |
93
+ | never_mind | Delete Taskdoc section file |
94
+ | recall_taskdoc | Read taskdoc chapter |
93
95
 
94
96
  ## Inter-dialog Reply Routing
95
97
 
@@ -154,7 +156,7 @@ Taskdoc is a **task contract** and the task's **team-shared source of current tr
154
156
  ## Limitations and Notes
155
157
 
156
158
  1. `dialog` reminders end with the dialog; `personal` reminders stay visible in all later dialogs you lead
157
- 2. Use `mind_more` for small Taskdoc additions; use `change_mind` for full-section replacement and merge existing content first. Do not treat `mind_more` as a chronology tool; when cleanup, stale-entry removal, or same-topic consolidation is needed, use `change_mind`
158
- 3. `mind_more` / `change_mind` do not reset dialog rounds
159
+ 2. Use `do_mind` to create missing Taskdoc sections; use `mind_more` for small Taskdoc additions; use `change_mind` for full-section replacement of existing sections and merge existing content first; use `never_mind` when a whole section file should be deleted. Do not treat `mind_more` as a chronology tool; when cleanup, stale-entry removal, or same-topic consolidation is needed, use `change_mind`
160
+ 3. `do_mind` / `mind_more` / `change_mind` / `never_mind` do not start a new course
159
161
  4. A continuation-package reminder should keep only details still not covered by Taskdoc but easy to lose during resume; in the Main Dialog, undocumented discussion details from current dialog history that the next course needs to know should be written to the appropriate Taskdoc sections first; in a Side Dialog under caution/critical remediation, maintain sufficiently detailed continuation-package reminders only
160
162
  5. Do not turn `personal` reminders into a long-term fact dump; move durable knowledge into `personal_memory`
@@ -136,13 +136,32 @@ status: ok|error
136
136
  - If you just finished writing the same continuation info via `add_reminder` / `update_reminder`, prefer `clear_mind({})`
137
137
  - If you are not sure whether it duplicates something, a small amount of redundancy is acceptable; do not risk losing information just to force perfect dedupe
138
138
 
139
- ### 5. change_mind
139
+ ### 5. do_mind
140
+
141
+ Create a new Taskdoc section. It fails if the target section already exists.
142
+
143
+ **Parameters:**
144
+
145
+ - `selector` (required): Chapter selector (goals/constraints/progress)
146
+ - `category` (optional): Extra section directory; with `selector`, targets `<category>/<selector>.md`
147
+ - `content` (required): New section content
148
+
149
+ **Characteristics:**
150
+
151
+ - Create-only: it does not overwrite existing content
152
+ - Use this for missing resident sections or new extra sections that preserve details without touching existing Taskdoc text
153
+ - If the target already exists and only needs small additions, use `mind_more`; if it needs a full rewrite/merge, use `change_mind`
154
+ - Does not start a new course
155
+ - Changes visible to all teammates
156
+
157
+ ### 6. change_mind
140
158
 
141
159
  Update taskdoc chapter.
142
160
 
143
161
  **Parameters:**
144
162
 
145
163
  - `selector` (required): Chapter selector (goals/constraints/progress)
164
+ - `category` (optional): Extra section directory; with `selector`, targets `<category>/<selector>.md`
146
165
  - `content` (required): New content (full section replacement)
147
166
 
148
167
  **Returns:**
@@ -155,12 +174,12 @@ updated_at: <update timestamp>
155
174
 
156
175
  **Characteristics:**
157
176
 
158
- - Each call replaces entire chapter
159
- - Does not reset dialog rounds
177
+ - Each call replaces an existing entire chapter; it does not create missing sections
178
+ - Does not start a new course
160
179
  - Changes visible to all teammates
161
180
  - Constraint rule: `constraints` must include only task-specific hard requirements; do not repeat global rules. If a duplicate is found, delete it and inform the user
162
181
 
163
- ### 6. mind_more
182
+ ### 7. mind_more
164
183
 
165
184
  Append entries to a Taskdoc section; defaults to `progress`, reducing full-section replacement pressure.
166
185
 
@@ -187,10 +206,25 @@ mind_more({
187
206
  - Append-only: it does not deduplicate, rewrite, or compress old content
188
207
  - Good for adding one or two still-effective states, decisions, next steps, or blockers to `progress`
189
208
  - Not for appending every investigation step, long log, full plan, or acceptance record as a chronology; those details belong in formal rtws documentation, while Taskdoc keeps the summary and document pointer
190
- - If stale entries must be removed, reordered, or compressed, use `change_mind` for a full-section replacement
209
+ - If stale entries must be removed, reordered, or compressed, use `change_mind` for a full-section replacement; if a whole section file should be deleted, use `never_mind`
191
210
  - When one topic already has several phase notes, prefer `change_mind` to merge them into a concise current announcement instead of continuing to call `mind_more`
192
211
 
193
- ### 7. recall_taskdoc
212
+ ### 8. never_mind
213
+
214
+ Delete a Taskdoc section file.
215
+
216
+ **Parameters:**
217
+
218
+ - `selector` (required): Chapter selector. Top-level sections use `goals` / `constraints` / `progress`
219
+ - `category` (optional): Extra section directory; with `selector`, targets `<category>/<selector>.md`
220
+
221
+ **Characteristics:**
222
+
223
+ - Deletes only the whole section file; it does not edit content
224
+ - Use it only when the whole section is no longer valid. If you only need to remove stale entries or compress structure, prefer `change_mind` with the cleaned full section
225
+ - Does not start a new course
226
+
227
+ ### 9. recall_taskdoc
194
228
 
195
229
  Read taskdoc chapter.
196
230
 
@@ -93,9 +93,9 @@ A: `dialog` 提醒只用于当前对话的工作集。`personal` 提醒会在所
93
93
 
94
94
  A: 只有当这条提醒与你的持续职责相关,且在所有由你主理的后续对话里也应该继续被看到时,才用 `personal`。其它情况默认都用 `dialog`。
95
95
 
96
- ### Q: mind_more / change_mind 会重置对话轮次吗?
96
+ ### Q: do_mind / mind_more / change_mind / never_mind 会开启新 course 吗?
97
97
 
98
- A: 不会。`mind_more` / `change_mind` 仅更新差遣牒内容,不重置对话轮次。
98
+ A: 不会。`do_mind` / `mind_more` / `change_mind` / `never_mind` 仅更新差遣牒内容,不开启新 course。
99
99
 
100
100
  ### Q: 差遣牒更新后立即对所有队友可见吗?
101
101
 
@@ -27,7 +27,7 @@
27
27
  control 是 Dominds 的**对话控制工具集**,用于管理对话状态、提醒、差遣牒,以及跨对话回复收口语义:
28
28
 
29
29
  - **提醒管理**:提醒分 `dialog` / `personal` 两个 scope;默认保持对话内工作集,只有职责相关且在所有由你主理的后续对话里也应继续看到的提醒才用 `personal`
30
- - **差遣牒操作**:追加或替换任务契约章节(goals/constraints/progress);其中 `progress` 是全队共享、准实时、可扫读的任务公告牌
30
+ - **差遣牒操作**:追加、替换或删除任务契约章节(goals/constraints/progress);其中 `progress` 是全队共享、准实时、可扫读的任务公告牌
31
31
  - **上下文维护**:在不丢关键恢复线索的前提下降低认知负载
32
32
  - **回复路由**:在支线/回问语境下,区分 `tellaskBack`、`replyTellask*` 与普通文本的职责边界
33
33
 
@@ -73,8 +73,8 @@
73
73
 
74
74
  **更新规则:**
75
75
 
76
- - `mind_more` 用于少量追加条目;`change_mind` 用于整章替换
77
- - 不重置对话轮次
76
+ - `do_mind` 用于创建新章节;`mind_more` 用于少量追加条目;`change_mind` 用于替换已有整章;`never_mind` 用于删除整章文件
77
+ - 不开启新 course
78
78
  - 变更对所有队友可见
79
79
  - 写入 `progress` 时,应默认假设全队成员会用它快速同步“当前任务真相”,而不是阅读你的个人过程记录
80
80
  - 不要无脑连续使用 `mind_more` 把 `progress` 写成流水账;当公告牌开始堆积、重复或含过期信息时,用 `change_mind` 按当前仍有效的事实压缩整理
@@ -82,14 +82,16 @@
82
82
 
83
83
  ## 工具概览
84
84
 
85
- | 工具 | 功能 |
86
- | --------------- | -------------------------------------------- |
87
- | add_reminder | 添加提醒 |
88
- | delete_reminder | 删除提醒 |
89
- | update_reminder | 更新提醒内容 |
90
- | mind_more | 向差遣牒追加条目(默认 progress) |
91
- | change_mind | 整章替换差遣牒(goals/constraints/progress) |
92
- | recall_taskdoc | 读取差遣牒章节 |
85
+ | 工具 | 功能 |
86
+ | --------------- | --------------------------------- |
87
+ | add_reminder | 添加提醒 |
88
+ | delete_reminder | 删除提醒 |
89
+ | update_reminder | 更新提醒内容 |
90
+ | do_mind | 创建新差遣牒章节 |
91
+ | mind_more | 向差遣牒追加条目(默认 progress) |
92
+ | change_mind | 整章替换已有差遣牒章节 |
93
+ | never_mind | 删除差遣牒章节文件 |
94
+ | recall_taskdoc | 读取差遣牒章节 |
93
95
 
94
96
  ## 跨对话回复路由
95
97
 
@@ -154,7 +156,7 @@
154
156
  ## 限制与注意事项
155
157
 
156
158
  1. `dialog` 提醒会随对话结束而结束;`personal` 提醒会在所有由你主理的后续对话里继续可见
157
- 2. 差遣牒少量新增可用 `mind_more` 追加;整段替换用 `change_mind`,请确保合并已有内容。不要把 `mind_more` 当流水账工具;需要整理、去旧、合并同主题记录时直接 `change_mind`
158
- 3. `mind_more` / `change_mind` 不重置对话轮次
159
+ 2. 缺失差遣牒章节用 `do_mind` 创建;差遣牒少量新增可用 `mind_more` 追加;已有章节整段替换用 `change_mind`,请确保合并已有内容;确需删除整章文件时用 `never_mind`。不要把 `mind_more` 当流水账工具;需要整理、去旧、合并同主题记录时直接 `change_mind`
160
+ 3. `do_mind` / `mind_more` / `change_mind` / `never_mind` 不开启新 course
159
161
  4. 接续包提醒项只保留差遣牒仍未覆盖、但恢复工作容易丢的细节;主线对话应先把当前对话历史中应由下一程知会的未落文档讨论细节写入差遣牒合适章节;支线对话在吃紧/告急时只维护足够详尽的接续包提醒项
160
162
  5. 不要把 `personal` 提醒堆成长期事实仓库;耐久知识应迁到 `personal_memory`