dominds 0.9.2 → 0.10.0

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 (142) hide show
  1. package/dist/dialog-instance-registry.js +0 -6
  2. package/dist/dialog.js +0 -8
  3. package/dist/docs/agent-priming.md +148 -0
  4. package/dist/docs/agent-priming.zh.md +145 -0
  5. package/dist/docs/dialog-system.md +1 -1
  6. package/dist/docs/dialog-system.zh.md +1 -1
  7. package/dist/docs/dominds-agent-priming.md +17 -208
  8. package/dist/docs/dominds-agent-priming.zh.md +16 -185
  9. package/dist/docs/fbr-implementation.md +0 -1
  10. package/dist/docs/fbr-implementation.zh.md +0 -1
  11. package/dist/docs/fbr.md +26 -19
  12. package/dist/docs/fbr.zh.md +24 -18
  13. package/dist/docs/team-mgmt-toolset.md +12 -12
  14. package/dist/docs/team-mgmt-toolset.zh.md +12 -12
  15. package/dist/docs/team_mgmt-toolset.md +27 -0
  16. package/dist/docs/team_mgmt-toolset.zh.md +26 -0
  17. package/dist/docs/tellask-collab.md +3 -2
  18. package/dist/docs/tellask-collab.zh.md +3 -2
  19. package/dist/llm/driver-v2/context.js +0 -3
  20. package/dist/llm/driver-v2/core.js +46 -64
  21. package/dist/llm/driver-v2/runtime-utils.js +0 -2
  22. package/dist/llm/driver-v2/supdialog-response.js +45 -3
  23. package/dist/llm/driver-v2/tellask-bridge.js +92 -245
  24. package/dist/minds/builtin/cmdr/persona.md +3 -0
  25. package/dist/minds/builtin/dijiang/knowledge.md +287 -0
  26. package/dist/minds/builtin/dijiang/persona.md +7 -0
  27. package/dist/minds/system-prompt.js +16 -8
  28. package/dist/persistence.js +22 -9
  29. package/dist/priming.js +1718 -0
  30. package/dist/server/api-routes.js +222 -19
  31. package/dist/server/create-dialog-contract.js +15 -4
  32. package/dist/server/static-server.js +3 -1
  33. package/dist/server/websocket-handler.js +14 -7
  34. package/dist/shared/team_mgmt-manual.js +9 -0
  35. package/dist/shared/types/index.js +1 -0
  36. package/dist/shared/types/priming.js +2 -0
  37. package/dist/shared/utils/fbr.js +38 -0
  38. package/dist/shared/utils/inter-dialog-format.js +17 -11
  39. package/dist/showing-by-doing.js +31 -34
  40. package/dist/static/assets/{_baseUniq-yVhEFITr.js → _baseUniq--Gw9ugRv.js} +2 -2
  41. package/dist/static/assets/{_baseUniq-yVhEFITr.js.map → _baseUniq--Gw9ugRv.js.map} +1 -1
  42. package/dist/static/assets/{arc-Buo-Z5vX.js → arc-C5WzkZ_d.js} +2 -2
  43. package/dist/static/assets/{arc-Buo-Z5vX.js.map → arc-C5WzkZ_d.js.map} +1 -1
  44. package/dist/static/assets/{architectureDiagram-VXUJARFQ-CFzWyC5l.js → architectureDiagram-VXUJARFQ-DGr4J4BR.js} +6 -6
  45. package/dist/static/assets/{architectureDiagram-VXUJARFQ-CFzWyC5l.js.map → architectureDiagram-VXUJARFQ-DGr4J4BR.js.map} +1 -1
  46. package/dist/static/assets/{blockDiagram-VD42YOAC-DZr3jTjY.js → blockDiagram-VD42YOAC-BmMRzWST.js} +7 -7
  47. package/dist/static/assets/{blockDiagram-VD42YOAC-DZr3jTjY.js.map → blockDiagram-VD42YOAC-BmMRzWST.js.map} +1 -1
  48. package/dist/static/assets/{c4Diagram-YG6GDRKO-B0fMMEbY.js → c4Diagram-YG6GDRKO-C-JWcEyU.js} +3 -3
  49. package/dist/static/assets/{c4Diagram-YG6GDRKO-B0fMMEbY.js.map → c4Diagram-YG6GDRKO-C-JWcEyU.js.map} +1 -1
  50. package/dist/static/assets/{channel-Dx_4w8Od.js → channel-mHG4jmwg.js} +2 -2
  51. package/dist/static/assets/{channel-Dx_4w8Od.js.map → channel-mHG4jmwg.js.map} +1 -1
  52. package/dist/static/assets/{chunk-4BX2VUAB-D6Vsm_4V.js → chunk-4BX2VUAB-BqarT97Z.js} +2 -2
  53. package/dist/static/assets/{chunk-4BX2VUAB-D6Vsm_4V.js.map → chunk-4BX2VUAB-BqarT97Z.js.map} +1 -1
  54. package/dist/static/assets/{chunk-55IACEB6-DyjobdoE.js → chunk-55IACEB6--MV9TNsd.js} +2 -2
  55. package/dist/static/assets/{chunk-55IACEB6-DyjobdoE.js.map → chunk-55IACEB6--MV9TNsd.js.map} +1 -1
  56. package/dist/static/assets/{chunk-B4BG7PRW-CiTT1gze.js → chunk-B4BG7PRW-BSKsASWW.js} +5 -5
  57. package/dist/static/assets/{chunk-B4BG7PRW-CiTT1gze.js.map → chunk-B4BG7PRW-BSKsASWW.js.map} +1 -1
  58. package/dist/static/assets/{chunk-DI55MBZ5-DmS3Qu9w.js → chunk-DI55MBZ5-Cvyz4k1Y.js} +4 -4
  59. package/dist/static/assets/{chunk-DI55MBZ5-DmS3Qu9w.js.map → chunk-DI55MBZ5-Cvyz4k1Y.js.map} +1 -1
  60. package/dist/static/assets/{chunk-FMBD7UC4-k4uK2G8t.js → chunk-FMBD7UC4-CyiHNpew.js} +2 -2
  61. package/dist/static/assets/{chunk-FMBD7UC4-k4uK2G8t.js.map → chunk-FMBD7UC4-CyiHNpew.js.map} +1 -1
  62. package/dist/static/assets/{chunk-QN33PNHL-Ds40b6qm.js → chunk-QN33PNHL-DqdKmz_S.js} +2 -2
  63. package/dist/static/assets/{chunk-QN33PNHL-Ds40b6qm.js.map → chunk-QN33PNHL-DqdKmz_S.js.map} +1 -1
  64. package/dist/static/assets/{chunk-QZHKN3VN-B2Bw3EH7.js → chunk-QZHKN3VN-CM9RsOb9.js} +2 -2
  65. package/dist/static/assets/{chunk-QZHKN3VN-B2Bw3EH7.js.map → chunk-QZHKN3VN-CM9RsOb9.js.map} +1 -1
  66. package/dist/static/assets/{chunk-TZMSLE5B-CehctPfm.js → chunk-TZMSLE5B-BH2ckxtZ.js} +2 -2
  67. package/dist/static/assets/{chunk-TZMSLE5B-CehctPfm.js.map → chunk-TZMSLE5B-BH2ckxtZ.js.map} +1 -1
  68. package/dist/static/assets/{classDiagram-2ON5EDUG-BqXw6Omx.js → classDiagram-2ON5EDUG-DCA4aYeE.js} +6 -6
  69. package/dist/static/assets/{classDiagram-2ON5EDUG-BqXw6Omx.js.map → classDiagram-2ON5EDUG-DCA4aYeE.js.map} +1 -1
  70. package/dist/static/assets/{classDiagram-v2-WZHVMYZB-BqXw6Omx.js → classDiagram-v2-WZHVMYZB-DCA4aYeE.js} +6 -6
  71. package/dist/static/assets/{classDiagram-v2-WZHVMYZB-BqXw6Omx.js.map → classDiagram-v2-WZHVMYZB-DCA4aYeE.js.map} +1 -1
  72. package/dist/static/assets/{clone-oYVOR_4R.js → clone-BvCpnni-.js} +2 -2
  73. package/dist/static/assets/{clone-oYVOR_4R.js.map → clone-BvCpnni-.js.map} +1 -1
  74. package/dist/static/assets/{cose-bilkent-S5V4N54A-Bqq83f0f.js → cose-bilkent-S5V4N54A-BqzSizh3.js} +2 -2
  75. package/dist/static/assets/{cose-bilkent-S5V4N54A-Bqq83f0f.js.map → cose-bilkent-S5V4N54A-BqzSizh3.js.map} +1 -1
  76. package/dist/static/assets/{dagre-6UL2VRFP-BkOS4vBF.js → dagre-6UL2VRFP-DGdXN-v2.js} +7 -7
  77. package/dist/static/assets/{dagre-6UL2VRFP-BkOS4vBF.js.map → dagre-6UL2VRFP-DGdXN-v2.js.map} +1 -1
  78. package/dist/static/assets/{diagram-PSM6KHXK-C_7bZw50.js → diagram-PSM6KHXK-BsdFzkKY.js} +7 -7
  79. package/dist/static/assets/{diagram-PSM6KHXK-C_7bZw50.js.map → diagram-PSM6KHXK-BsdFzkKY.js.map} +1 -1
  80. package/dist/static/assets/{diagram-QEK2KX5R-35Xrtz1F.js → diagram-QEK2KX5R-D0hk4qNP.js} +6 -6
  81. package/dist/static/assets/{diagram-QEK2KX5R-35Xrtz1F.js.map → diagram-QEK2KX5R-D0hk4qNP.js.map} +1 -1
  82. package/dist/static/assets/{diagram-S2PKOQOG-DXggXCVc.js → diagram-S2PKOQOG-BsgW_sk_.js} +6 -6
  83. package/dist/static/assets/{diagram-S2PKOQOG-DXggXCVc.js.map → diagram-S2PKOQOG-BsgW_sk_.js.map} +1 -1
  84. package/dist/static/assets/{erDiagram-Q2GNP2WA-DN23msL7.js → erDiagram-Q2GNP2WA-C01we6W8.js} +5 -5
  85. package/dist/static/assets/{erDiagram-Q2GNP2WA-DN23msL7.js.map → erDiagram-Q2GNP2WA-C01we6W8.js.map} +1 -1
  86. package/dist/static/assets/{flowDiagram-NV44I4VS-DdCZ32fT.js → flowDiagram-NV44I4VS-ko8PS0rp.js} +6 -6
  87. package/dist/static/assets/{flowDiagram-NV44I4VS-DdCZ32fT.js.map → flowDiagram-NV44I4VS-ko8PS0rp.js.map} +1 -1
  88. package/dist/static/assets/{ganttDiagram-JELNMOA3-i4C2Jb9s.js → ganttDiagram-JELNMOA3-9PeZ-Kch.js} +3 -3
  89. package/dist/static/assets/{ganttDiagram-JELNMOA3-i4C2Jb9s.js.map → ganttDiagram-JELNMOA3-9PeZ-Kch.js.map} +1 -1
  90. package/dist/static/assets/{gitGraphDiagram-NY62KEGX-B-pz2yGv.js → gitGraphDiagram-NY62KEGX-B0wAxWVb.js} +7 -7
  91. package/dist/static/assets/{gitGraphDiagram-NY62KEGX-B-pz2yGv.js.map → gitGraphDiagram-NY62KEGX-B0wAxWVb.js.map} +1 -1
  92. package/dist/static/assets/{graph-Dt0ICYC4.js → graph-DdalHsij.js} +3 -3
  93. package/dist/static/assets/{graph-Dt0ICYC4.js.map → graph-DdalHsij.js.map} +1 -1
  94. package/dist/static/assets/{index-CFSjKmjb.js → index-BOk92_ZR.js} +874 -200
  95. package/dist/static/assets/index-BOk92_ZR.js.map +1 -0
  96. package/dist/static/assets/{infoDiagram-WHAUD3N6-B83tboBX.js → infoDiagram-WHAUD3N6-B8RtIw8L.js} +5 -5
  97. package/dist/static/assets/{infoDiagram-WHAUD3N6-B83tboBX.js.map → infoDiagram-WHAUD3N6-B8RtIw8L.js.map} +1 -1
  98. package/dist/static/assets/{journeyDiagram-XKPGCS4Q-ByUNASkI.js → journeyDiagram-XKPGCS4Q-wzJDLy6P.js} +5 -5
  99. package/dist/static/assets/{journeyDiagram-XKPGCS4Q-ByUNASkI.js.map → journeyDiagram-XKPGCS4Q-wzJDLy6P.js.map} +1 -1
  100. package/dist/static/assets/{kanban-definition-3W4ZIXB7-DoV-Fpix.js → kanban-definition-3W4ZIXB7-CWFSfRDX.js} +3 -3
  101. package/dist/static/assets/{kanban-definition-3W4ZIXB7-DoV-Fpix.js.map → kanban-definition-3W4ZIXB7-CWFSfRDX.js.map} +1 -1
  102. package/dist/static/assets/{layout-W5BPV8_t.js → layout-DO2PANy1.js} +5 -5
  103. package/dist/static/assets/{layout-W5BPV8_t.js.map → layout-DO2PANy1.js.map} +1 -1
  104. package/dist/static/assets/{linear-CHvuvVAs.js → linear-BlMtygce.js} +2 -2
  105. package/dist/static/assets/{linear-CHvuvVAs.js.map → linear-BlMtygce.js.map} +1 -1
  106. package/dist/static/assets/{min-B310j0Qx.js → min-Dh4owwbR.js} +3 -3
  107. package/dist/static/assets/{min-B310j0Qx.js.map → min-Dh4owwbR.js.map} +1 -1
  108. package/dist/static/assets/{mindmap-definition-VGOIOE7T-BqOBARwH.js → mindmap-definition-VGOIOE7T-BHpn9WwC.js} +4 -4
  109. package/dist/static/assets/{mindmap-definition-VGOIOE7T-BqOBARwH.js.map → mindmap-definition-VGOIOE7T-BHpn9WwC.js.map} +1 -1
  110. package/dist/static/assets/{pieDiagram-ADFJNKIX-24-wPJjd.js → pieDiagram-ADFJNKIX-bLFyE_aV.js} +7 -7
  111. package/dist/static/assets/{pieDiagram-ADFJNKIX-24-wPJjd.js.map → pieDiagram-ADFJNKIX-bLFyE_aV.js.map} +1 -1
  112. package/dist/static/assets/{quadrantDiagram-AYHSOK5B-C7Wx-AmK.js → quadrantDiagram-AYHSOK5B-DBJK-oxa.js} +3 -3
  113. package/dist/static/assets/{quadrantDiagram-AYHSOK5B-C7Wx-AmK.js.map → quadrantDiagram-AYHSOK5B-DBJK-oxa.js.map} +1 -1
  114. package/dist/static/assets/{requirementDiagram-UZGBJVZJ-BW0tZfAm.js → requirementDiagram-UZGBJVZJ-BeTIvPxT.js} +4 -4
  115. package/dist/static/assets/{requirementDiagram-UZGBJVZJ-BW0tZfAm.js.map → requirementDiagram-UZGBJVZJ-BeTIvPxT.js.map} +1 -1
  116. package/dist/static/assets/{sankeyDiagram-TZEHDZUN-DZl5Dn6u.js → sankeyDiagram-TZEHDZUN-G0fxFg6p.js} +2 -2
  117. package/dist/static/assets/{sankeyDiagram-TZEHDZUN-DZl5Dn6u.js.map → sankeyDiagram-TZEHDZUN-G0fxFg6p.js.map} +1 -1
  118. package/dist/static/assets/{sequenceDiagram-WL72ISMW-BQdfWJzw.js → sequenceDiagram-WL72ISMW-Bdu3q1HK.js} +4 -4
  119. package/dist/static/assets/{sequenceDiagram-WL72ISMW-BQdfWJzw.js.map → sequenceDiagram-WL72ISMW-Bdu3q1HK.js.map} +1 -1
  120. package/dist/static/assets/{stateDiagram-FKZM4ZOC-CcSySFVm.js → stateDiagram-FKZM4ZOC-DIuxjFDd.js} +9 -9
  121. package/dist/static/assets/{stateDiagram-FKZM4ZOC-CcSySFVm.js.map → stateDiagram-FKZM4ZOC-DIuxjFDd.js.map} +1 -1
  122. package/dist/static/assets/{stateDiagram-v2-4FDKWEC3-DCrGc6-D.js → stateDiagram-v2-4FDKWEC3-BUVTuna8.js} +5 -5
  123. package/dist/static/assets/{stateDiagram-v2-4FDKWEC3-DCrGc6-D.js.map → stateDiagram-v2-4FDKWEC3-BUVTuna8.js.map} +1 -1
  124. package/dist/static/assets/{timeline-definition-IT6M3QCI-Ltw_zbSJ.js → timeline-definition-IT6M3QCI-BVji7HFU.js} +3 -3
  125. package/dist/static/assets/{timeline-definition-IT6M3QCI-Ltw_zbSJ.js.map → timeline-definition-IT6M3QCI-BVji7HFU.js.map} +1 -1
  126. package/dist/static/assets/{treemap-KMMF4GRG-BFyGamhb.js → treemap-KMMF4GRG-DDS0hoTK.js} +4 -4
  127. package/dist/static/assets/{treemap-KMMF4GRG-BFyGamhb.js.map → treemap-KMMF4GRG-DDS0hoTK.js.map} +1 -1
  128. package/dist/static/assets/{xychartDiagram-PRI3JC2R-DJFdQWtf.js → xychartDiagram-PRI3JC2R-yAArIjGY.js} +3 -3
  129. package/dist/static/assets/{xychartDiagram-PRI3JC2R-DJFdQWtf.js.map → xychartDiagram-PRI3JC2R-yAArIjGY.js.map} +1 -1
  130. package/dist/static/index.html +1 -1
  131. package/dist/tools/apply-patch.js +4 -0
  132. package/dist/tools/builtins.js +3 -3
  133. package/dist/tools/context-health.js +7 -7
  134. package/dist/tools/team_mgmt.js +182 -1
  135. package/dist/utils/task-doc.js +16 -16
  136. package/package.json +1 -1
  137. package/dist/docs/keep-going.zh.md +0 -162
  138. package/dist/docs/showing-by-doing.md +0 -208
  139. package/dist/docs/showing-by-doing.zh.md +0 -177
  140. package/dist/minds/promptdocs.js +0 -263
  141. package/dist/snippets/README.en.md +0 -3
  142. package/dist/static/assets/index-CFSjKmjb.js.map +0 -1
@@ -57,12 +57,6 @@ async function getOrRestoreRootDialog(rootId, status) {
57
57
  currentCourse: rootState.currentCourse,
58
58
  contextHealth: rootState.contextHealth,
59
59
  });
60
- const persistedSubdialogAgentPrimingMode = rootMetadata.subdialogAgentPrimingMode === 'do' ||
61
- rootMetadata.subdialogAgentPrimingMode === 'reuse' ||
62
- rootMetadata.subdialogAgentPrimingMode === 'skip'
63
- ? rootMetadata.subdialogAgentPrimingMode
64
- : 'reuse';
65
- rootDialog.setSubdialogAgentPrimingMode(persistedSubdialogAgentPrimingMode);
66
60
  const persistedDisableDiligencePush = latest && typeof latest.disableDiligencePush === 'boolean'
67
61
  ? latest.disableDiligencePush
68
62
  : defaultDisableDiligencePush;
package/dist/dialog.js CHANGED
@@ -829,8 +829,6 @@ class RootDialog extends Dialog {
829
829
  constructor(dlgStore, taskDocPath, id, agentId, initialState) {
830
830
  super(dlgStore, taskDocPath, id, agentId, initialState);
831
831
  this._status = 'running';
832
- // Root-level inheritance policy for newly created subdialogs.
833
- this._subdialogAgentPrimingMode = 'reuse';
834
832
  // Tracks all dialogs in this dialog tree for O(1) lookup
835
833
  this._localRegistry = new Map();
836
834
  // Tracks Type-B registered subdialogs by agentId!sessionSlug
@@ -843,12 +841,6 @@ class RootDialog extends Dialog {
843
841
  setPersistenceStatus(status) {
844
842
  this._status = status;
845
843
  }
846
- get subdialogAgentPrimingMode() {
847
- return this._subdialogAgentPrimingMode;
848
- }
849
- setSubdialogAgentPrimingMode(mode) {
850
- this._subdialogAgentPrimingMode = mode;
851
- }
852
844
  /**
853
845
  * Register a dialog (self or subdialog) in the local registry.
854
846
  */
@@ -0,0 +1,148 @@
1
+ # Agent Priming (Startup Scripts) Design
2
+
3
+ Chinese version: [中文](./agent-priming.zh.md)
4
+
5
+ ## Goal
6
+
7
+ Priming is unified as an editable, versionable, replayable Markdown startup-script mechanism.
8
+
9
+ - Script-as-history: startup scripts are preloaded dialog history.
10
+ - Faithful replay: scripts preserve and replay technical details (including tool records and `callId` links).
11
+ - Explicit selection: users choose scripts at dialog creation time.
12
+ - Visibility control: script-origin bubbles can be shown or hidden in UI.
13
+
14
+ ## Storage Layout
15
+
16
+ All scripts live under `.minds/priming/` in rtws:
17
+
18
+ - Individual: `.minds/priming/individual/<team-member-id>/<slug>.md`
19
+ - Team shared: `.minds/priming/team_shared/<slug>.md`
20
+
21
+ Constraints:
22
+
23
+ - `slug` uses `[A-Za-z0-9._-]` path segments and may be nested.
24
+ - Path escape is forbidden (absolute path, `..`, NUL, illegal chars).
25
+ - Canonical refs:
26
+ - `individual/<team-member-id>/<slug>`
27
+ - `team_shared/<slug>`
28
+
29
+ ## Script Format (Strict)
30
+
31
+ Each file uses `frontmatter + record blocks`.
32
+
33
+ ### Top-level frontmatter (optional)
34
+
35
+ ```yaml
36
+ ---
37
+ kind: agent_priming_script
38
+ version: 3
39
+ title: Environment Probe Startup
40
+ applicableMemberIds:
41
+ - ux
42
+ ---
43
+ ```
44
+
45
+ ### Record blocks (required)
46
+
47
+ Each section must be `### record <record-type>`.
48
+
49
+ Strict rules:
50
+
51
+ - No legacy format: `### user` / `### assistant` is no longer supported.
52
+ - `func_call_record`: use triple-backtick `json` with a full JSON object.
53
+ - All other record types: use markdown blocks; six backticks (``````markdown) are recommended to avoid collisions with inner triple-backtick content.
54
+ - For non-`func_call_record` blocks, block frontmatter stores metadata and the markdown body maps to the record’s main text field (`content` / `response` / `result`).
55
+
56
+ Example:
57
+
58
+ ````markdown
59
+ ### record human_text_record
60
+
61
+ ```markdown
62
+ ---
63
+ genseq: 1
64
+ msgId: priming-1
65
+ grammar: markdown
66
+ ---
67
+
68
+ Run an environment probe first.
69
+ ```
70
+ ````
71
+
72
+ ### record func_call_record
73
+
74
+ ```json
75
+ {
76
+ "type": "func_call_record",
77
+ "genseq": 1,
78
+ "id": "call_probe_1",
79
+ "name": "exec_command",
80
+ "arguments": {
81
+ "cmd": "uname -a"
82
+ }
83
+ }
84
+ ```
85
+
86
+ ### record func_result_record
87
+
88
+ ```markdown
89
+ ---
90
+ genseq: 1
91
+ id: call_probe_1
92
+ name: exec_command
93
+ ---
94
+
95
+ Darwin ...
96
+ ```
97
+
98
+ ```
99
+
100
+ ## About `~~~markdown`
101
+
102
+ `~~~markdown` originally helped avoid fence collisions when content already included triple-backtick blocks.
103
+
104
+ Now the canonical export is six-backtick markdown blocks for non-`func_call_record`, and triple-backtick JSON for `func_call_record`. The parser still accepts `~~~` and varying backtick fence lengths.
105
+
106
+ ## Create Dialog Flow (WebUI)
107
+
108
+ Priming area in create-dialog modal:
109
+
110
+ - Dropdown: recent scripts (backend-managed per agent, max 20).
111
+ - `<None> startup script`: no priming injection.
112
+ - `More…`: live backend disk scan on query; selecting a result writes it back to dropdown and selects it.
113
+ - `UI display` checkbox: controls whether priming-origin bubbles are rendered.
114
+
115
+ Request contract:
116
+
117
+ - `create_dialog` may include `priming`:
118
+ - `scriptRefs: string[]` (UI currently single-select: 0 or 1 item)
119
+ - `showInUi: boolean`
120
+
121
+ Runtime behavior:
122
+
123
+ - On root dialog creation, selected scripts are replayed into `course-1`.
124
+ - Replayed events are tagged with `sourceTag: priming_script`.
125
+ - Replay is injected into `dialog.msgs` for downstream model context.
126
+ - `showInUi=false` only affects rendering; persistence/context remain unchanged.
127
+
128
+ ## Save Startup Script (WebUI)
129
+
130
+ - Toolbar uses an icon save button.
131
+ - Prompt shows concrete path:
132
+ `.minds/priming/individual/<current-agent-id>/<slug>.md`
133
+ - Existing target requires explicit overwrite confirmation.
134
+
135
+ Export rules:
136
+
137
+ - Export full course record history.
138
+ - Empty course export is rejected.
139
+ - Frontmatter stores source dialog metadata (`rootId/selfId/course/status`).
140
+
141
+ ## Recent Usage Storage
142
+
143
+ - Backend per-agent file:
144
+ `<rtws>/.dialogs/recent-priming/<agent-id>.json`
145
+ - Max 20 entries (trimmed on write).
146
+ - Recent dropdown is fetched from backend each time.
147
+ - Usage is recorded only when dialog creation succeeds.
148
+ ```
@@ -0,0 +1,145 @@
1
+ # Agent Priming(启动脚本)设计
2
+
3
+ 英文版:[English](./agent-priming.md)
4
+
5
+ ## 目标
6
+
7
+ 将 priming 统一为“可编辑、可版本化、可回放”的 Markdown 启动脚本能力。
8
+
9
+ - 脚本即历史:启动脚本本质上是预置对话历史。
10
+ - 忠实复原:脚本默认记录并复原完整技术细节(含 `role=tool` 相关记录、`callId` 等关联字段)。
11
+ - 显式选择:创建对话时由用户明确选择,不做隐式注入。
12
+ - 可见性可控:可选择是否在 UI 展示由脚本注入的历史气泡。
13
+
14
+ ## 存储布局
15
+
16
+ 脚本统一放在 rtws 的 `.minds/priming/` 下:
17
+
18
+ - 个人脚本:`.minds/priming/individual/<team-member-id>/<slug>.md`
19
+ - 团队共享脚本:`.minds/priming/team_shared/<slug>.md`
20
+
21
+ 约束:
22
+
23
+ - `slug` 由 `[A-Za-z0-9._-]` 路径段组成,可多级。
24
+ - 严禁越界路径(绝对路径、`..`、NUL、非法字符)。
25
+ - `scriptRef` 统一形如:
26
+ - `individual/<team-member-id>/<slug>`
27
+ - `team_shared/<slug>`
28
+
29
+ ## 脚本格式(严格)
30
+
31
+ 脚本文件采用 `frontmatter + record 块`。
32
+
33
+ ### 顶层 frontmatter(可选)
34
+
35
+ ```yaml
36
+ ---
37
+ kind: agent_priming_script
38
+ version: 3
39
+ title: 环境探针启动
40
+ applicableMemberIds:
41
+ - ux
42
+ ---
43
+ ```
44
+
45
+ ### record 块(必填)
46
+
47
+ 每段必须是:`### record <record-type>`。
48
+
49
+ 严格规则:
50
+
51
+ - 不存在旧写法,不再支持 `### user` / `### assistant`。
52
+ - `func_call_record`:使用三重反引号 `json`,内容是完整 JSON 对象。
53
+ - 其它 record:使用 markdown block,建议 6 重反引号(``````markdown)避免和正文里的三反引号冲突。
54
+ - 非 `func_call_record` 的 markdown block 可在块内使用 frontmatter 记录元字段;正文映射该 record 的主文本字段(如 `content` / `response` / `result`)。
55
+
56
+ 示例:
57
+
58
+ ````markdown
59
+ ### record human_text_record
60
+
61
+ ```markdown
62
+ ---
63
+ genseq: 1
64
+ msgId: priming-1
65
+ grammar: markdown
66
+ ---
67
+
68
+ 先做环境探针。
69
+ ```
70
+ ````
71
+
72
+ ### record func_call_record
73
+
74
+ ```json
75
+ {
76
+ "type": "func_call_record",
77
+ "genseq": 1,
78
+ "id": "call_probe_1",
79
+ "name": "exec_command",
80
+ "arguments": {
81
+ "cmd": "uname -a"
82
+ }
83
+ }
84
+ ```
85
+
86
+ ### record func_result_record
87
+
88
+ ```markdown
89
+ ---
90
+ genseq: 1
91
+ id: call_probe_1
92
+ name: exec_command
93
+ ---
94
+
95
+ Darwin ...
96
+ ```
97
+
98
+ ```
99
+
100
+ ## 关于 `~~~markdown`
101
+
102
+ `~~~markdown` 的历史动机是避免外层 fenced block 与正文三反引号冲突。当前推荐是 6 重反引号 markdown block;解析器仍接受 `~~~` 与不同长度反引号 fenced 风格,但标准导出采用 6 重反引号(`func_call_record` 除外)。
103
+
104
+ ## 创建对话流程(WebUI)
105
+
106
+ 创建对话 modal 的 priming 区域:
107
+
108
+ - 下拉列表:展示 recent 脚本(后端按 agent 维护,最多 20 条)。
109
+ - `<无> 启动脚本`:不注入启动脚本。
110
+ - `更多……`:按输入文本实时后端扫描磁盘匹配;确认后回填下拉并选中。
111
+ - `UI 展示` 勾选框:控制是否展示脚本注入的历史气泡。
112
+
113
+ 请求结构:
114
+
115
+ - `create_dialog` 可带 `priming`:
116
+ - `scriptRefs: string[]`(当前 UI 单选,传 0 或 1 项)
117
+ - `showInUi: boolean`
118
+
119
+ 运行时行为:
120
+
121
+ - 创建 root dialog 后,按 `scriptRefs` 回放脚本。
122
+ - 回放事件写入 `course-1`,并统一标记 `sourceTag: priming_script`。
123
+ - 同步注入 `dialog.msgs`,确保后续 LLM 上下文可见。
124
+ - `showInUi=false` 时仅隐藏展示,不影响持久化与上下文。
125
+
126
+ ## 保存启动脚本(WebUI)
127
+
128
+ - toolbar 使用图标按钮“保存启动脚本”。
129
+ - 提示输入 `slug`,并显示路径:
130
+ `.minds/priming/individual/<当前-agent-id>/<slug>.md`
131
+ - 若目标文件存在,必须确认覆盖。
132
+
133
+ 导出规则:
134
+
135
+ - 从当前 course 导出完整 record 历史。
136
+ - 空历史禁止导出。
137
+ - frontmatter 记录来源对话(rootId/selfId/course/status)。
138
+
139
+ ## recent 使用记录
140
+
141
+ - 后端按 agent 保存:`<rtws>/.dialogs/recent-priming/<agent-id>.json`
142
+ - 最多 20 条(写入时裁剪)。
143
+ - recent 列表每次从后端读取。
144
+ - 仅在“创建对话成功”时记录 recent。
145
+ ```
@@ -962,7 +962,7 @@ At the start of every subdialog course, the runtime must prepend a role header t
962
962
  - EN (example): `This is an FBR sideline dialog; the tellasker dialog is @xxx (may be the same agent).`
963
963
  - ZH(示例): `这是一次 FBR 支线对话;诉请者对话为 @xxx(可能与当前对话同一 agent)。`
964
964
 
965
- **Insertion point**: prefer a single insertion point by updating `formatAssignmentFromSupdialog()` (covers `dialog.ts`, `tellask-bridge`, and `agent-priming`).
965
+ **Insertion point**: prefer a single insertion point by updating `formatAssignmentFromSupdialog()` (covers `dialog.ts`, `tellask-bridge`).
966
966
  Frontend twin must stay in sync: `dominds/webapp/src/shared/utils/inter-dialog-format.ts`.
967
967
 
968
968
  **Storage**: All subdialogs are stored flat under the main dialog's (root dialog's) `subdialogs/` directory, regardless of nesting depth.
@@ -953,7 +953,7 @@ interface RegistryMethods {
953
953
  - ZH:`这是一次 FBR 支线对话;诉请者对话为 @xxx(可能与当前对话同一 agent)。`
954
954
  - EN:`This is an FBR sideline dialog; the tellasker dialog is @xxx (may be the same agent).`
955
955
 
956
- **插入点**:优先通过 `formatAssignmentFromSupdialog()` 单点注入(覆盖 `dialog.ts` / `tellask-bridge` / `agent-priming`),前端 twin 同步:`dominds/webapp/src/shared/utils/inter-dialog-format.ts`。
956
+ **插入点**:优先通过 `formatAssignmentFromSupdialog()` 单点注入(覆盖 `dialog.ts` / `tellask-bridge`),前端 twin 同步:`dominds/webapp/src/shared/utils/inter-dialog-format.ts`。
957
957
 
958
958
  ### 生命周期管理
959
959
 
@@ -1,218 +1,27 @@
1
- # Dominds Agent Priming: Guide the Agent to Show It to Itself
1
+ # Dominds Agent Priming (Deprecated in this branch)
2
2
 
3
- Chinese version: [中文版](./dominds-agent-priming.zh.md)
3
+ English version: [中文](./dominds-agent-priming.zh.md)
4
4
 
5
- ## Summary
5
+ ## Status
6
6
 
7
- Dominds has a real, runtime-enforced Tellask mechanism (`tellask* function call`) and a real, runtime-enforced Fresh Boots Reasoning
8
- (FBR) mechanism (`freshBootsReasoning`). Even if system prompts explain these mechanisms in detail, most foundation models were not
9
- trained in a world where “asking a teammate to run a shell command” is actually possible, so they often treat such text
10
- as aspirational or hypothetical.
7
+ In this branch, the legacy hardcoded Agent Priming implementation has been fully removed from runtime behavior.
11
8
 
12
- **Agent Priming** is a tiny, highly realistic “first impression” procedure executed at dialog creation time. It runs a
13
- short, real Tellask + real return + real FBR + real distillation so the model gains _felt-sense_ that:
9
+ - No automatic dialog-creation priming flow runs.
10
+ - No priming cache/reuse modes are executed at startup.
11
+ - No dedicated priming API behavior is enforced by the runtime.
14
12
 
15
- - teammate Tellasks are real and will be executed
16
- - tool outputs are real and will be returned and persisted
17
- - `freshBootsReasoning` FBR is real and will report back
18
- - distillation is expected (extract the best, dedupe, reconcile), not “repeat each draft”
13
+ ## What this means for current behavior
19
14
 
20
- More precisely: it **guides the agent to show it to itself** letting it personally walk through
21
- (Tellask → return → FBR distillation), moving from “I’ve heard this exists” to “I just used it”.
15
+ - The runtime does **not** auto-run startup tellasks, environment probes, or distillation-only priming notes.
16
+ - FBR is still available only through normal runtime contracts, including `freshBootsReasoning`.
17
+ - `fbr_effort` still controls how many serial FBR sideline dialogs are spawned for a single `freshBootsReasoning` call (see [`fbr.md`](./fbr.md)).
22
18
 
23
- This is structurally related to the psychology notion of a **priming effect**: an early, concrete stimulus can
24
- significantly shape subsequent expectations and behaviors. In Dominds we anchor this “priming” in **verifiable runtime
25
- interactions**, instead of relying on longer, declarative system-prompt text.
19
+ ## Planned replacement
26
20
 
27
- As a consequence, we can **dramatically simplify system prompts**: keep only short, accurate statements of the
28
- Tellask/FBR contracts, and rely on a real priming run to establish “this works here”.
21
+ Priming is being reimplemented from scratch as **startup-script replay**:
29
22
 
30
- Related docs:
23
+ 1. Persist normal dialog history as a deterministic startup script artifact.
24
+ 2. Replay that script through a dedicated interface when startup priming is required.
25
+ 3. Keep behavior explicit, observable, and easy to version by script artifact and replay contract.
31
26
 
32
- - Tellask runtime: [`dialog-system.md`](./dialog-system.md)
33
- - Terminology (Mainline/Sideline): [`dominds-terminology.md`](./dominds-terminology.md)
34
- - FBR (`freshBootsReasoning`): [`fbr.md`](./fbr.md)
35
- - Work language vs UI language: [`i18n.md`](./i18n.md)
36
-
37
- ---
38
-
39
- ## Goals
40
-
41
- - Establish immediate trust that Tellask/return/persistence are real.
42
- - Run a real `freshBootsReasoning` FBR loop at dialog creation.
43
- - Build muscle memory for the timing contract: initiate FBR, wait for feedback, then synthesize/decide.
44
- - Make distillation itself part of the “felt” experience (dedupe/reconcile/extract-the-best).
45
- - Keep the procedure safe, small, and deterministic (default command: `uname -a`).
46
- - Persist and display the interaction so it is credible from multiple angles (backend record + frontend transcript).
47
-
48
- ## Non-goals
49
-
50
- - Running arbitrary user-provided commands as part of dialog creation.
51
- - Collecting sensitive system information (beyond minimal OS/kernel identification).
52
- - Replacing proper documentation: this is an experiential supplement, not the main spec.
53
-
54
- ---
55
-
56
- ## Definitions (user-facing)
57
-
58
- - **Mainline dialog**: the primary thread where the user and the main agent interact.
59
- - **Sideline dialog**: a temporary work thread created by Tellask / FBR, reporting results back to the mainline.
60
- - **Tellask**: a structured request (`tellask({ targetAgentId: "<memberId>", sessionSlug: "<slug>", tellaskContent: "..." })`) from a tellasker to a tellaskee.
61
- - **Shell specialist**: a teammate designated to run shell commands safely (configured via `shell_specialists`).
62
- - **FBR**: Fresh Boots Reasoning, implemented as `freshBootsReasoning` (a tool-less sideline dialog). See [`fbr.md`](./fbr.md).
63
-
64
- ---
65
-
66
- ## Runtime flow (at dialog creation)
67
-
68
- Agent Priming runs **before** the first user message is processed, unless the user opts out.
69
-
70
- ### 1) Choose the shell execution path
71
-
72
- 1. If the team config includes at least one `shell_specialists` member, pick one deterministically (e.g. the first).
73
- 2. Otherwise, let the **Dominds runtime** execute the baseline command directly (not via agent tools).
74
-
75
- Baseline command:
76
-
77
- - `uname -a`
78
-
79
- If `uname -a` fails (e.g. non-POSIX host), the runtime may fall back to a platform-appropriate equivalent, but the
80
- default “muscle memory” path is intentionally `uname -a` because it is common, low-risk, and quick.
81
-
82
- ### 2) Real teammate Tellask: ask for `uname -a`
83
-
84
- If a shell specialist member exists, the main agent (tellasker) issues **a real Tellask** to the shell specialist member
85
- (tellaskee), in the server-wide work language.
86
-
87
- The Tellask body should be short and operational:
88
-
89
- - run exactly `uname -a`
90
- - return raw output verbatim
91
- - if `uname` fails: include error + one safe alternative command
92
-
93
- ### 3) Real FBR: reflect on what the environment implies
94
-
95
- After obtaining the environment snapshot, the main agent issues a real `freshBootsReasoning` Tellask to trigger FBR.
96
-
97
- The FBR body should include:
98
-
99
- - the exact `uname -a` output (explicitly name the command; it may change in the future)
100
- - the tool constraint (FBR has no tools; mainline tool availability is separate)
101
- - the question: “What should I be careful about in this environment? Which CLI tools should I prioritize, and why?”
102
-
103
- Optional parallel drafts:
104
-
105
- - If the team member config enables `fbr_effort` (default `3`), the runtime creates multiple `freshBootsReasoning` FBR sideline
106
- dialogs concurrently so the agent produces multiple independent “fresh boots” drafts for the mainline dialog to
107
- distill.
108
- - These drafts have **no stable identity mapping**, and there is no meaningful ordering requirement; the mainline dialog
109
- should treat them as anonymous drafts rather than fixed personas.
110
- - If `fbr_effort` is `0`, skip FBR.
111
- - If `fbr_effort` is greater than `100`, the runtime errors out and stops priming (invalid config).
112
-
113
- Phase boundary (critical):
114
-
115
- - `freshBootsReasoning` is the **initiation action**, not completed decision-making.
116
- - Mainline must enter a wait phase until feedback from that FBR run returns.
117
- - If `fbr_effort = N`, mainline must wait for all N drafts before distillation; do not finalize from partial drafts.
118
-
119
- ### 4) Distill into an “Agent Priming” note
120
-
121
- After confirming feedback from that FBR run has been collected, the main agent writes a short, user-visible **Agent Priming** note via a **normal generation** in the mainline
122
- dialog. It should be explicitly distilled (dedupe/reconcile/extract-the-best) rather than repeating each draft.
123
-
124
- Implementation constraint (matches runtime behavior):
125
-
126
- - Do not introduce a separate system-prompt assembly path for distillation.
127
- - The runtime may use a non-persisted **internal prompt** to anchor “this generation is distillation”.
128
- - The runtime may also include the shell snapshot and FBR drafts as “evidence” inside that internal prompt (for this
129
- drive only, not persisted), so distillation does not depend on any queue timing/concurrency details.
130
- - During the Agent Priming lifecycle (from prelude start until the priming note is produced), runtime must suppress
131
- diligence-push injections; restore normal diligence behavior only after priming completes.
132
-
133
- Implementation note (internal prompt):
134
-
135
- - The runtime may provide the driver with a non-persisted, non-rendered **internal prompt** (used only in the LLM
136
- context for this drive) to explicitly anchor the generation as “distillation”.
137
- - The internal prompt must not be written into dialog history or persisted storage (to avoid transcript pollution
138
- across courses).
139
- - The internal prompt is a per-drive task directive; it must not replace the system prompt or introduce a separate
140
- system-prompt assembly path.
141
-
142
- Implementation note (avoid Taskdoc bias):
143
-
144
- - Distillation must be Taskdoc-agnostic: the same Agent Priming prefix can be reused across dialogs with different
145
- Taskdocs.
146
- - Therefore, the runtime may choose to **skip injecting Taskdoc** for the one distillation drive, so Taskdoc progress
147
- or implementation details do not bias environment conclusions.
148
-
149
- ---
150
-
151
- ## Persistence, caching, and reuse (in-process only)
152
-
153
- ### 1) Persist as real dialog records (backend + frontend)
154
-
155
- All priming steps must be persisted as standard dialog artifacts (messages + events) and visible in the WebUI.
156
-
157
- ### 2) Process-wide cache (per agent)
158
-
159
- To avoid repeating `uname -a` + FBR + distillation on every new dialog, the backend process may maintain an in-process cache
160
- (lost on restart) keyed by the mainline agent id.
161
-
162
- Reuse policy:
163
-
164
- - If a valid cache entry exists, a new dialog may reuse the cached transcript and Agent Priming note.
165
- - Reused entries should still be visible in the new dialog transcript, labeled as “reused from cache”.
166
-
167
- ### 2.5) Mainline choice must propagate to sideline dialogs
168
-
169
- The priming choice selected at mainline dialog creation must propagate to all sideline dialogs under that root dialog.
170
-
171
- Propagation semantics:
172
-
173
- - Mainline chooses **Skip** (`skip`): all sideline dialogs must also **Skip** (`skip`).
174
- - Mainline chooses **Do Again** (`do`) while cache exists: all sideline dialogs must also run fresh (`do`).
175
- - Mainline chooses **Show it now** (`do`) when cache does not exist, or chooses **Reuse** (`reuse`):
176
- sideline dialogs use **reuse-or-do** (`reuse`): reuse cache when available for that sideline agent;
177
- otherwise run a fresh priming.
178
-
179
- Notes:
180
-
181
- - Different sideline agents may have different cache states; `reuse` is evaluated per sideline agent.
182
- - Priming must not run invisibly in the background; it must be persisted and user-visible as standard dialog artifacts.
183
-
184
- ### 3) Carry across `clear_mind`
185
-
186
- After each `clear_mind` (entering the next course), do not rely on reminders.
187
-
188
- Instead, inject a small, stable **course prefix** into model context at the start of each course: a condensed transcript
189
- (shell snapshot + FBR highlights + Priming note).
190
-
191
- ---
192
-
193
- ## UX requirements (WebUI)
194
-
195
- ### Display
196
-
197
- - Render Agent Priming as a realistic transcript the user can inspect.
198
- - Prefer a collapsible top section with clear labels:
199
- - “Teammate Tellask (shell)”
200
- - “FBR (`freshBootsReasoning`)"
201
- - “Agent Priming”
202
-
203
- ### Opt-out
204
-
205
- Dialog creation should provide an explicit opt-out to skip priming.
206
-
207
- Additional UX constraints:
208
-
209
- - If the dialog owner is a hidden shadow member, the default priming preference should be **Skip**.
210
- - Shadow-member priming preferences should be stored separately from visible-member preferences (they should not affect each other).
211
-
212
- ---
213
-
214
- ## Safety notes
215
-
216
- - Default to a single, low-risk command (`uname -a`).
217
- - Do not run anything that modifies the filesystem or network as part of priming.
218
- - Treat the priming transcript as user-visible by default; avoid including secrets or personally identifying details.
27
+ Until the new interface is fully landed, this document should be treated as a migration note, not an active runtime contract.