dominds 0.8.7 → 0.8.8

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 (108) hide show
  1. package/dist/docs/dialog-system.md +74 -36
  2. package/dist/docs/dialog-system.zh.md +71 -36
  3. package/dist/docs/dominds-terminology.md +30 -15
  4. package/dist/docs/fbr.md +12 -15
  5. package/dist/docs/fbr.zh.md +14 -17
  6. package/dist/docs/q4h.md +5 -5
  7. package/dist/docs/q4h.zh.md +5 -5
  8. package/dist/docs/tellask-collab.md +39 -13
  9. package/dist/docs/tellask-collab.zh.md +38 -12
  10. package/dist/llm/defaults.yaml +7 -0
  11. package/dist/llm/driver-v2/core.js +16 -4
  12. package/dist/llm/driver-v2/tellask-bridge.js +9 -6
  13. package/dist/minds/system-prompt.js +28 -0
  14. package/dist/shared/i18n/driver-messages.js +0 -10
  15. package/dist/shared/utils/inter-dialog-format.js +25 -9
  16. package/dist/static/assets/{_baseUniq-BD4L1En6.js → _baseUniq-D14YtKr6.js} +2 -2
  17. package/dist/static/assets/{_baseUniq-BD4L1En6.js.map → _baseUniq-D14YtKr6.js.map} +1 -1
  18. package/dist/static/assets/{arc-CiT0QyKL.js → arc-BogWhQin.js} +2 -2
  19. package/dist/static/assets/{arc-CiT0QyKL.js.map → arc-BogWhQin.js.map} +1 -1
  20. package/dist/static/assets/{architectureDiagram-VXUJARFQ-CVmn9WWl.js → architectureDiagram-VXUJARFQ-CXcFF-FS.js} +6 -6
  21. package/dist/static/assets/{architectureDiagram-VXUJARFQ-CVmn9WWl.js.map → architectureDiagram-VXUJARFQ-CXcFF-FS.js.map} +1 -1
  22. package/dist/static/assets/{blockDiagram-VD42YOAC-D-lDhhYK.js → blockDiagram-VD42YOAC-C8CkYBvD.js} +7 -7
  23. package/dist/static/assets/{blockDiagram-VD42YOAC-D-lDhhYK.js.map → blockDiagram-VD42YOAC-C8CkYBvD.js.map} +1 -1
  24. package/dist/static/assets/{c4Diagram-YG6GDRKO-DqB2vQg0.js → c4Diagram-YG6GDRKO-CEkjLhJE.js} +3 -3
  25. package/dist/static/assets/{c4Diagram-YG6GDRKO-DqB2vQg0.js.map → c4Diagram-YG6GDRKO-CEkjLhJE.js.map} +1 -1
  26. package/dist/static/assets/{channel-DK0lTvYw.js → channel-mScKmP53.js} +2 -2
  27. package/dist/static/assets/{channel-DK0lTvYw.js.map → channel-mScKmP53.js.map} +1 -1
  28. package/dist/static/assets/{chunk-4BX2VUAB-BKIaLua2.js → chunk-4BX2VUAB-DRCehITY.js} +2 -2
  29. package/dist/static/assets/{chunk-4BX2VUAB-BKIaLua2.js.map → chunk-4BX2VUAB-DRCehITY.js.map} +1 -1
  30. package/dist/static/assets/{chunk-55IACEB6-DJzjYAfG.js → chunk-55IACEB6-BDFuTtkR.js} +2 -2
  31. package/dist/static/assets/{chunk-55IACEB6-DJzjYAfG.js.map → chunk-55IACEB6-BDFuTtkR.js.map} +1 -1
  32. package/dist/static/assets/{chunk-B4BG7PRW-BKrZorXR.js → chunk-B4BG7PRW-BZe-vFwf.js} +5 -5
  33. package/dist/static/assets/{chunk-B4BG7PRW-BKrZorXR.js.map → chunk-B4BG7PRW-BZe-vFwf.js.map} +1 -1
  34. package/dist/static/assets/{chunk-DI55MBZ5-T8vlHFzX.js → chunk-DI55MBZ5-TF02rYZe.js} +4 -4
  35. package/dist/static/assets/{chunk-DI55MBZ5-T8vlHFzX.js.map → chunk-DI55MBZ5-TF02rYZe.js.map} +1 -1
  36. package/dist/static/assets/{chunk-FMBD7UC4-Ck-wGXOH.js → chunk-FMBD7UC4-BwTcGAxy.js} +2 -2
  37. package/dist/static/assets/{chunk-FMBD7UC4-Ck-wGXOH.js.map → chunk-FMBD7UC4-BwTcGAxy.js.map} +1 -1
  38. package/dist/static/assets/{chunk-QN33PNHL-DXEmgZy1.js → chunk-QN33PNHL-D7bryks7.js} +2 -2
  39. package/dist/static/assets/{chunk-QN33PNHL-DXEmgZy1.js.map → chunk-QN33PNHL-D7bryks7.js.map} +1 -1
  40. package/dist/static/assets/{chunk-QZHKN3VN-skp0d7Z5.js → chunk-QZHKN3VN-e-lJgN6U.js} +2 -2
  41. package/dist/static/assets/{chunk-QZHKN3VN-skp0d7Z5.js.map → chunk-QZHKN3VN-e-lJgN6U.js.map} +1 -1
  42. package/dist/static/assets/{chunk-TZMSLE5B-BLPqXWiC.js → chunk-TZMSLE5B-DaEE37qC.js} +2 -2
  43. package/dist/static/assets/{chunk-TZMSLE5B-BLPqXWiC.js.map → chunk-TZMSLE5B-DaEE37qC.js.map} +1 -1
  44. package/dist/static/assets/{classDiagram-2ON5EDUG-BnL38CfP.js → classDiagram-2ON5EDUG-BOUhAJ3a.js} +6 -6
  45. package/dist/static/assets/{classDiagram-2ON5EDUG-BnL38CfP.js.map → classDiagram-2ON5EDUG-BOUhAJ3a.js.map} +1 -1
  46. package/dist/static/assets/{classDiagram-v2-WZHVMYZB-BnL38CfP.js → classDiagram-v2-WZHVMYZB-BOUhAJ3a.js} +6 -6
  47. package/dist/static/assets/{classDiagram-v2-WZHVMYZB-BnL38CfP.js.map → classDiagram-v2-WZHVMYZB-BOUhAJ3a.js.map} +1 -1
  48. package/dist/static/assets/{clone-BizhJUyY.js → clone-WEoHCv1v.js} +2 -2
  49. package/dist/static/assets/{clone-BizhJUyY.js.map → clone-WEoHCv1v.js.map} +1 -1
  50. package/dist/static/assets/{cose-bilkent-S5V4N54A-BYkdVEyo.js → cose-bilkent-S5V4N54A-BypHhSR3.js} +2 -2
  51. package/dist/static/assets/{cose-bilkent-S5V4N54A-BYkdVEyo.js.map → cose-bilkent-S5V4N54A-BypHhSR3.js.map} +1 -1
  52. package/dist/static/assets/{dagre-6UL2VRFP-Dx3MF6Vf.js → dagre-6UL2VRFP-DFBCJAGs.js} +7 -7
  53. package/dist/static/assets/{dagre-6UL2VRFP-Dx3MF6Vf.js.map → dagre-6UL2VRFP-DFBCJAGs.js.map} +1 -1
  54. package/dist/static/assets/{diagram-PSM6KHXK-D72iHgGT.js → diagram-PSM6KHXK-BP1Ej_-e.js} +7 -7
  55. package/dist/static/assets/{diagram-PSM6KHXK-D72iHgGT.js.map → diagram-PSM6KHXK-BP1Ej_-e.js.map} +1 -1
  56. package/dist/static/assets/{diagram-QEK2KX5R-TAdaDXCD.js → diagram-QEK2KX5R-CHO4B5dl.js} +6 -6
  57. package/dist/static/assets/{diagram-QEK2KX5R-TAdaDXCD.js.map → diagram-QEK2KX5R-CHO4B5dl.js.map} +1 -1
  58. package/dist/static/assets/{diagram-S2PKOQOG-CIHCjso7.js → diagram-S2PKOQOG-feY4jjjY.js} +6 -6
  59. package/dist/static/assets/{diagram-S2PKOQOG-CIHCjso7.js.map → diagram-S2PKOQOG-feY4jjjY.js.map} +1 -1
  60. package/dist/static/assets/{erDiagram-Q2GNP2WA-UwmxzLFe.js → erDiagram-Q2GNP2WA-KA_SlHEz.js} +5 -5
  61. package/dist/static/assets/{erDiagram-Q2GNP2WA-UwmxzLFe.js.map → erDiagram-Q2GNP2WA-KA_SlHEz.js.map} +1 -1
  62. package/dist/static/assets/{flowDiagram-NV44I4VS-BHMfjtLb.js → flowDiagram-NV44I4VS-CsxMHjrE.js} +6 -6
  63. package/dist/static/assets/{flowDiagram-NV44I4VS-BHMfjtLb.js.map → flowDiagram-NV44I4VS-CsxMHjrE.js.map} +1 -1
  64. package/dist/static/assets/{ganttDiagram-JELNMOA3-DgFZ2Tss.js → ganttDiagram-JELNMOA3-BJ3PDO7l.js} +3 -3
  65. package/dist/static/assets/{ganttDiagram-JELNMOA3-DgFZ2Tss.js.map → ganttDiagram-JELNMOA3-BJ3PDO7l.js.map} +1 -1
  66. package/dist/static/assets/{gitGraphDiagram-NY62KEGX-Bx70pens.js → gitGraphDiagram-NY62KEGX-F7Jx8FgF.js} +7 -7
  67. package/dist/static/assets/{gitGraphDiagram-NY62KEGX-Bx70pens.js.map → gitGraphDiagram-NY62KEGX-F7Jx8FgF.js.map} +1 -1
  68. package/dist/static/assets/{graph-CTeLR7V9.js → graph-BlmDCWvL.js} +3 -3
  69. package/dist/static/assets/{graph-CTeLR7V9.js.map → graph-BlmDCWvL.js.map} +1 -1
  70. package/dist/static/assets/{index-Dk3Y5xFN.js → index-CUGcPcXL.js} +34 -32
  71. package/dist/static/assets/index-CUGcPcXL.js.map +1 -0
  72. package/dist/static/assets/{infoDiagram-WHAUD3N6-BXuamYlp.js → infoDiagram-WHAUD3N6-BIpdDPrb.js} +5 -5
  73. package/dist/static/assets/{infoDiagram-WHAUD3N6-BXuamYlp.js.map → infoDiagram-WHAUD3N6-BIpdDPrb.js.map} +1 -1
  74. package/dist/static/assets/{journeyDiagram-XKPGCS4Q-DlHDnf1C.js → journeyDiagram-XKPGCS4Q-BF1STnaT.js} +5 -5
  75. package/dist/static/assets/{journeyDiagram-XKPGCS4Q-DlHDnf1C.js.map → journeyDiagram-XKPGCS4Q-BF1STnaT.js.map} +1 -1
  76. package/dist/static/assets/{kanban-definition-3W4ZIXB7-CE78kpjk.js → kanban-definition-3W4ZIXB7-cyFqqvhg.js} +3 -3
  77. package/dist/static/assets/{kanban-definition-3W4ZIXB7-CE78kpjk.js.map → kanban-definition-3W4ZIXB7-cyFqqvhg.js.map} +1 -1
  78. package/dist/static/assets/{layout-CwEDdoLZ.js → layout-DMgcIorQ.js} +5 -5
  79. package/dist/static/assets/{layout-CwEDdoLZ.js.map → layout-DMgcIorQ.js.map} +1 -1
  80. package/dist/static/assets/{linear-DySzt0_b.js → linear-Coji9s5a.js} +2 -2
  81. package/dist/static/assets/{linear-DySzt0_b.js.map → linear-Coji9s5a.js.map} +1 -1
  82. package/dist/static/assets/{min-BobJ0IGS.js → min-B1_8WNcy.js} +3 -3
  83. package/dist/static/assets/{min-BobJ0IGS.js.map → min-B1_8WNcy.js.map} +1 -1
  84. package/dist/static/assets/{mindmap-definition-VGOIOE7T-C6YHQOYr.js → mindmap-definition-VGOIOE7T-CeKoOV-c.js} +4 -4
  85. package/dist/static/assets/{mindmap-definition-VGOIOE7T-C6YHQOYr.js.map → mindmap-definition-VGOIOE7T-CeKoOV-c.js.map} +1 -1
  86. package/dist/static/assets/{pieDiagram-ADFJNKIX-CS3bw7nO.js → pieDiagram-ADFJNKIX-BGa8BmFH.js} +7 -7
  87. package/dist/static/assets/{pieDiagram-ADFJNKIX-CS3bw7nO.js.map → pieDiagram-ADFJNKIX-BGa8BmFH.js.map} +1 -1
  88. package/dist/static/assets/{quadrantDiagram-AYHSOK5B-DA8KltS6.js → quadrantDiagram-AYHSOK5B-Cr_hh2B6.js} +3 -3
  89. package/dist/static/assets/{quadrantDiagram-AYHSOK5B-DA8KltS6.js.map → quadrantDiagram-AYHSOK5B-Cr_hh2B6.js.map} +1 -1
  90. package/dist/static/assets/{requirementDiagram-UZGBJVZJ-gpRhELLx.js → requirementDiagram-UZGBJVZJ-7tZ14LaJ.js} +4 -4
  91. package/dist/static/assets/{requirementDiagram-UZGBJVZJ-gpRhELLx.js.map → requirementDiagram-UZGBJVZJ-7tZ14LaJ.js.map} +1 -1
  92. package/dist/static/assets/{sankeyDiagram-TZEHDZUN-D4V6BNsU.js → sankeyDiagram-TZEHDZUN-PPE9oDbG.js} +2 -2
  93. package/dist/static/assets/{sankeyDiagram-TZEHDZUN-D4V6BNsU.js.map → sankeyDiagram-TZEHDZUN-PPE9oDbG.js.map} +1 -1
  94. package/dist/static/assets/{sequenceDiagram-WL72ISMW-D9FBgXQP.js → sequenceDiagram-WL72ISMW-DzHE1j4P.js} +4 -4
  95. package/dist/static/assets/{sequenceDiagram-WL72ISMW-D9FBgXQP.js.map → sequenceDiagram-WL72ISMW-DzHE1j4P.js.map} +1 -1
  96. package/dist/static/assets/{stateDiagram-FKZM4ZOC-D2ubI3pq.js → stateDiagram-FKZM4ZOC-ByVF3RFY.js} +9 -9
  97. package/dist/static/assets/{stateDiagram-FKZM4ZOC-D2ubI3pq.js.map → stateDiagram-FKZM4ZOC-ByVF3RFY.js.map} +1 -1
  98. package/dist/static/assets/{stateDiagram-v2-4FDKWEC3-rc_6AuIv.js → stateDiagram-v2-4FDKWEC3-DYxiq1fR.js} +5 -5
  99. package/dist/static/assets/{stateDiagram-v2-4FDKWEC3-rc_6AuIv.js.map → stateDiagram-v2-4FDKWEC3-DYxiq1fR.js.map} +1 -1
  100. package/dist/static/assets/{timeline-definition-IT6M3QCI-CwSj73ze.js → timeline-definition-IT6M3QCI-Cs4HgZ6x.js} +3 -3
  101. package/dist/static/assets/{timeline-definition-IT6M3QCI-CwSj73ze.js.map → timeline-definition-IT6M3QCI-Cs4HgZ6x.js.map} +1 -1
  102. package/dist/static/assets/{treemap-KMMF4GRG-D0n0ynwO.js → treemap-KMMF4GRG-PozDEtNJ.js} +4 -4
  103. package/dist/static/assets/{treemap-KMMF4GRG-D0n0ynwO.js.map → treemap-KMMF4GRG-PozDEtNJ.js.map} +1 -1
  104. package/dist/static/assets/{xychartDiagram-PRI3JC2R-DMTyj-VZ.js → xychartDiagram-PRI3JC2R-BwYnuA29.js} +3 -3
  105. package/dist/static/assets/{xychartDiagram-PRI3JC2R-DMTyj-VZ.js.map → xychartDiagram-PRI3JC2R-BwYnuA29.js.map} +1 -1
  106. package/dist/static/index.html +1 -1
  107. package/package.json +1 -1
  108. package/dist/static/assets/index-Dk3Y5xFN.js.map +0 -1
@@ -27,20 +27,30 @@ This document provides detailed implementation specifications for the Dominds di
27
27
  ## Terminology
28
28
 
29
29
  This chapter defines the implementation-facing terms used throughout this document.
30
- For bilingual / user-facing naming conventions (mainline dialog / sideline dialog; tellasker / tellaskee), see [`dominds-terminology.md`](./dominds-terminology.md).
30
+ For bilingual / user-facing naming conventions (mainline dialog / sideline dialog; tellasker dialog / tellaskee dialog), see [`dominds-terminology.md`](./dominds-terminology.md).
31
31
  For Taskdoc package structure and encapsulation rules, see [`encapsulated-taskdoc.md`](./encapsulated-taskdoc.md).
32
32
 
33
33
  ### Supdialog
34
34
 
35
35
  A **supdialog** (short for "super dialog") is the supdialog in a hierarchical dialog relationship. It orchestrates and manages subdialogs, providing context, objectives, and guidance while receiving results, questions, and escalations from its subdialogs. The supdialog maintains the overall task context and determines when subdialogs are no longer needed.
36
36
 
37
+ Note: **supdialog** is a structural parent in the dialog hierarchy. It is not the same as the **tellasker dialog** (the caller for the current Tellask). For TYPE A (`tellaskBack`), the tellasker dialog is the direct supdialog; for TYPE B/C, the tellasker dialog may be a different dialog.
38
+
37
39
  A supdialog may receive **TellaskBack** from its subdialogs during their task execution. When a subdialog needs guidance or additional context, it can Tellask back via `tellaskBack({ tellaskContent: "..." })` (TYPE A / `TellaskBack` / 回问诉请), which provides responses that feed back into the subdialog's context.
38
40
 
39
41
  ### Subdialog
40
42
 
41
43
  A **subdialog** is a specialized dialog spawned by a supdialog to handle specific subtasks. Subdialogs operate with fresh context, focusing on targeted objectives while maintaining a communication link back to their supdialog.
42
44
 
43
- **TellaskBack**: A subdialog can Tellask its supdialog (tellasker) to request clarification during task execution. This allows the subdialog to ask questions and receive guidance while maintaining its own context and progress.
45
+ **TellaskBack**: A subdialog can Tellask its **tellasker dialog** to request clarification during task execution. In TYPE A, the tellasker dialog is the direct supdialog. This allows the subdialog to ask questions and receive guidance while maintaining its own context and progress.
46
+
47
+ ### Tellasker dialog / Tellaskee dialog (caller roles)
48
+
49
+ A **tellasker dialog** is the dialog that issued the current Tellask (the caller). A **tellaskee dialog** is the dialog handling that Tellask (this dialog). These are **call roles**, not hierarchy:
50
+
51
+ - For TYPE A (`tellaskBack`), the tellasker dialog is the direct supdialog.
52
+ - For TYPE B/C, the tellasker dialog may be a different dialog (root dialog or another sideline dialog).
53
+ - Responses route to the **current tellasker dialog** recorded in `assignmentFromSup`.
44
54
 
45
55
  ### Main Dialog (Root Dialog)
46
56
 
@@ -48,7 +58,7 @@ The **main dialog** (also called **root dialog**) is the top-level dialog in a d
48
58
 
49
59
  ### Q4H (Questions for Human)
50
60
 
51
- A **Q4H** is a pending question raised by a dialog (main or subdialog) that requires human input to proceed. Q4Hs are indexed in the dialog's `q4h.yaml` file (an index, not source of truth) and are **cleared by `clear_mind` operations**. The actual question content is stored in the dialog's messages where the `!?askHuman()` Tellask was recorded.
61
+ A **Q4H** is a pending question raised by a dialog (main or subdialog) that requires human input to proceed. Q4Hs are indexed in the dialog's `q4h.yaml` file (an index, not source of truth) and are **cleared by `clear_mind` operations**. The actual question content is stored in the dialog's messages where the `askHuman({ tellaskContent: "..." })` Tellask was recorded.
52
62
 
53
63
  ### Subdialog Index (subdlg.yaml)
54
64
 
@@ -141,14 +151,14 @@ This section documents the three distinct types of teammate Tellasks in the Domi
141
151
 
142
152
  ```mermaid
143
153
  flowchart TD
144
- M[LLM emits tellaskSessionless({ targetAgentId: "mention", tellaskContent: "..." })] --> Q{Is this a subdialog telling its direct supdialog?}
154
+ M[LLM emits tellaskSessionless({ targetAgentId: "mention", tellaskContent: "..." })] --> Q{Is this a subdialog Tellasking its direct supdialog (tellasker dialog for TYPE A)?}
145
155
  Q -- yes --> A[TYPE A: TellaskBack<br/>(`TellaskBack` / 回问诉请)<br/>Primary: tellaskBack({ tellaskContent: "..." }) (NO sessionSlug)]
146
156
  Q -- no --> T{Is sessionSlug present?}
147
157
  T -- yes --> B[TYPE B: Registered subdialog Tellask<br/>(`Tellask Session` / 长线诉请)<br/>tellask({ targetAgentId: "agentId", sessionSlug: "tellaskSession", tellaskContent: "..." })]
148
158
  T -- no --> C[TYPE C: Transient subdialog Tellask<br/>(`Fresh Tellask` / 一次性诉请)<br/>tellaskSessionless({ targetAgentId: "agentId", tellaskContent: "..." })]
149
159
  ```
150
160
 
151
- ### TYPE A: Supdialog Tellask (Type A / `TellaskBack` / 回问诉请)
161
+ ### TYPE A: TellaskBack (Type A / `TellaskBack` / 回问诉请)
152
162
 
153
163
  **Primary syntax**: `tellaskBack({ tellaskContent: "..." })` (NO `sessionSlug`) — `tellaskBack({ tellaskContent: "..." }) sessionSlug ...` is a **syntax error**
154
164
 
@@ -157,21 +167,35 @@ flowchart TD
157
167
  **Behavior**:
158
168
 
159
169
  1. Current subdialog **suspends**
160
- 2. Driver switches to drive the **supdialog** (using `subdialog.supdialog` reference)
161
- 3. Supdialog response flows back to the subdialog
162
- 4. Subdialog **resumes** with supdialog's response in context
170
+ 2. Driver switches to drive the **tellasker dialog** (direct supdialog for TYPE A; uses `subdialog.supdialog` reference)
171
+ 3. Tellasker dialog response flows back to the subdialog
172
+ 4. Subdialog **resumes** with tellasker dialog's response in context
163
173
 
164
174
  **Key Characteristics**:
165
175
 
166
176
  - Uses `subdialog.supdialog` reference (no registry lookup)
167
177
  - No registration - supdialog relationship is inherent
168
- - Supdialog is always the direct parent in the hierarchy
178
+ - Supdialog is always the direct parent in the hierarchy (the tellasker dialog for TYPE A)
169
179
  - `tellaskBack({ tellaskContent: "..." })` is the canonical Type A syntax: it always routes to the tellasker (the dialog that issued the current Tellask).
170
180
  - This matters especially when the supdialog’s `agentId` is identical to the subdialog’s `agentId` (common when a sideline
171
181
  is created via `freshBootsReasoning({ tellaskContent: "..." })`), where an explicit `tellaskBack({ tellaskContent: "..." })` is easier to get wrong by accident.
172
182
  - The explicit `tellaskBack({ tellaskContent: "..." })` form is accepted as a semantic fallback for backwards compatibility, but is more
173
183
  error-prone in FBR/self-subdialog cases.
174
184
 
185
+ **Sideline delivery rule (normative)**:
186
+
187
+ - A sideline dialog may reply directly to the tellasker dialog **only when all assigned goals are complete**.
188
+ - If any goal is incomplete or critical context is missing, it MUST issue `tellaskBack({ tellaskContent: "..." })` to request clarification or next-step confirmation before proceeding.
189
+ - **FBR exception**: FBR sideline dialogs are tellask-free (no `tellaskBack`); they must list missing context and return.
190
+
191
+ **Content markers (first line required)**:
192
+
193
+ - `【tellaskBack】` — required when asking the tellasker dialog for clarification / next-step confirmation.
194
+ - `【最终完成】` — required for final delivery when all goals are complete.
195
+ - FBR-only: `【FBR-直接回复】` or `【FBR-仅推理】` for FBR sideline responses.
196
+
197
+ Note: no extra "Status: ..." line is required; the first-line marker is the stage reminder.
198
+
175
199
  **Example**:
176
200
 
177
201
  ```
@@ -214,7 +238,7 @@ headline text is ignored for tellaskSession parsing.
214
238
 
215
239
  **Current Caller Tracking (important for reuse):**
216
240
 
217
- When a registered subdialog is Tellasked again (same `agentId!sessionSlug`), the caller can be a **different dialog** (mainline or another sideline). On every Type B Tellask, the subdialog’s metadata is updated with:
241
+ When a registered subdialog is Tellasked again (same `agentId!sessionSlug`), the caller can be a **different dialog** (root dialog or another sideline dialog). On every Type B Tellask, the subdialog’s metadata is updated with:
218
242
 
219
243
  - The **current caller dialog ID** (so responses route back to the _latest_ caller)
220
244
  - The **Tellask info** (headline/body, origin role, origin member, callId)
@@ -279,7 +303,7 @@ Result (second call):
279
303
  2. Create **NEW subdialog** with the specified agentId
280
304
  3. Drive the new subdialog:
281
305
  - For general Type C, the subdialog is full-fledged (supcalls, teammate Tellasks, tools per config).
282
- - For `freshBootsReasoning({ tellaskContent: "..." })`, runtime applies the FBR tool-less policy (no tools; restricted Tellasks).
306
+ - For `freshBootsReasoning({ tellaskContent: "..." })`, runtime applies the FBR tool-less policy (no tools; no Tellasks).
283
307
  4. Subdialog response flows back to parent
284
308
  5. Parent **resumes** with subdialog's response
285
309
 
@@ -287,7 +311,7 @@ Result (second call):
287
311
 
288
312
  - **No registry lookup** - always creates a new subdialog
289
313
  - **Not registered** - no persistence across Tellasks
290
- - The subdialog itself is fully capable **except** for `freshBootsReasoning({ tellaskContent: "..." })` FBR, which is tool-less and Tellask-restricted (see `fbr.md`).
314
+ - The subdialog itself is fully capable **except** for `freshBootsReasoning({ tellaskContent: "..." })` FBR, which is tool-less and tellask-free (see `fbr.md`).
291
315
  - Only difference from TYPE B: no registry lookup/resume capability
292
316
  - Used for one-off, independent tasks
293
317
 
@@ -336,7 +360,7 @@ The Dominds dialog system is built on four interconnected core mechanisms that w
336
360
  ```mermaid
337
361
  flowchart TD
338
362
  H[Dialog hierarchy<br/>(root ↔ subdialogs)] <--> S[Subdialog supply<br/>(responses, pending list, registry)]
339
- H --> Q[Q4H (!?askHuman())<br/>(q4h.yaml index)]
363
+ H --> Q[Q4H (askHuman({ tellaskContent: "..." }))<br/>(q4h.yaml index)]
340
364
  S --> Q
341
365
 
342
366
  Q --> UI[Frontend Q4H panel<br/>(questions_count_update)]
@@ -350,7 +374,7 @@ flowchart TD
350
374
 
351
375
  ### Key Design Principles
352
376
 
353
- 1. **Q4H Index in `q4h.yaml`**: Q4H questions are indexed in `q4h.yaml` (as an index, not source of truth) and cleared by mental clarity operations. The actual question content is in the dialog's messages where the `!?askHuman()` Tellask was recorded. They do not survive `clear_mind`.
377
+ 1. **Q4H Index in `q4h.yaml`**: Q4H questions are indexed in `q4h.yaml` (as an index, not source of truth) and cleared by mental clarity operations. The actual question content is in the dialog's messages where the `askHuman({ tellaskContent: "..." })` Tellask was recorded. They do not survive `clear_mind`.
354
378
 
355
379
  2. **Hierarchical Q4H**: Any dialog in the hierarchy can raise Q4H on its own right (root dialog or subdialog). Questions are indexed in the dialog that asked them, not passed upward.
356
380
 
@@ -364,7 +388,7 @@ flowchart TD
364
388
 
365
389
  7. **State Preservation Contract**:
366
390
  - `clear_mind`: Clears messages, clears Q4H index, preserves reminders, preserves registry
367
- - Subdialog completion: Writes response to supdialog, removes from pending list (registry unchanged)
391
+ - Subdialog completion: Writes response to the current tellasker dialog, removes from pending list (registry unchanged)
368
392
  - Subdialog declared dead: marks runState dead and removes its Type B registry entry; same slug can be reused as a fresh sideline dialog
369
393
  - Q4H answer: Clears the answered question from index, continues the dialog
370
394
 
@@ -383,7 +407,7 @@ Q4H (Questions for Human) is the mechanism by which dialogs can suspend executio
383
407
  * HumanQuestion - index entry persisted in q4h.yaml per dialog
384
408
  * NOTE: This is an INDEX, not the source of truth. The actual question
385
409
  * content is in the dialog's messages where the askHuman() Tellask was recorded
386
- * (invoked via !?askHuman()).
410
+ * (invoked via askHuman({ tellaskContent: "..." })).
387
411
  */
388
412
  interface HumanQuestion {
389
413
  readonly id: string; // Unique identifier (UUID) - matches message ID
@@ -395,7 +419,7 @@ interface HumanQuestion {
395
419
 
396
420
  **Storage Location**: `<dialog-path>/q4h.yaml` - serves as an index for quick lookup
397
421
 
398
- **Source of Truth**: The actual `!?askHuman()` Tellask is stored in the dialog's messages (course JSONL files), where the question was asked.
422
+ **Source of Truth**: The actual `askHuman({ tellaskContent: "..." })` Tellask is stored in the dialog's messages (course JSONL files), where the question was asked.
399
423
 
400
424
  ### Q4H Mechanism Flow
401
425
 
@@ -419,24 +443,23 @@ sequenceDiagram
419
443
 
420
444
  ### When Does a Dialog Raise Q4H?
421
445
 
422
- Q4H is raised when the `!?askHuman()` teammate Tellask is invoked by ANY dialog (root or subdialog) on its own right:
446
+ Q4H is raised when the `askHuman({ tellaskContent: "..." })` tellask function is invoked by ANY dialog (root or subdialog) on its own right:
423
447
 
424
448
  ```typescript
425
- // From main/llm/driver.ts, executeTellaskCall function
426
- const isQ4H = callKind === 'askHuman';
449
+ // From main/llm/driver-v2/tellask-bridge.ts
450
+ const isQ4H = callName === 'askHuman';
427
451
  ```
428
452
 
429
453
  **Invocation Pattern**:
430
454
 
431
- ```
432
- !?askHuman() <question headline>
433
- !?<question body content>
455
+ ```typescript
456
+ askHuman({ tellaskContent: "<question headline>\n<question body content>" });
434
457
  ```
435
458
 
436
459
  ### Q4H Recording Process
437
460
 
438
461
  ```typescript
439
- // When !?askHuman() is detected as a teammate Tellask
462
+ // When askHuman({ tellaskContent: "..." }) is detected as a teammate Tellask
440
463
  async function recordQuestionForHuman(
441
464
  dlg: Dialog,
442
465
  mentionList: string,
@@ -554,7 +577,7 @@ sequenceDiagram
554
577
  Sup->>Sub: creates subdialog (Type B or C)
555
578
  Note over Sup: Supdialog is blocked on pending subdialogs
556
579
 
557
- Sub->>WS: emits !?askHuman() question
580
+ Sub->>WS: emits askHuman({ tellaskContent: "..." }) question
558
581
  WS-->>UI: questions_count_update
559
582
  Note over Sub: Subdialog cannot proceed until answered
560
583
 
@@ -607,11 +630,11 @@ flowchart TD
607
630
 
608
631
  ### Subdialog Response Supply Mechanism
609
632
 
610
- **Core Principle**: Subdialogs supply responses to supdialog's context via persistence, not callbacks.
633
+ **Core Principle**: Subdialogs supply responses to the **current tellasker dialog's** context via persistence, not callbacks (the tellasker is the direct supdialog for TYPE A; for TYPE B/C it may be a different dialog).
611
634
 
612
635
  ```mermaid
613
636
  sequenceDiagram
614
- participant Sup as Supdialog
637
+ participant Sup as Tellasker dialog
615
638
  participant Driver as Backend driver
616
639
  participant Sub as Subdialog
617
640
  participant Store as Persistence
@@ -923,10 +946,25 @@ interface RegistryMethods {
923
946
  **Context Inheritance**: New subdialogs automatically receive:
924
947
 
925
948
  - Reference to the same rtws (runtime workspace) Taskdoc (recommended: `tasks/feature-auth.tsk/`); `dlg.taskDocPath` is fixed at dialog creation and never reassigned
926
- - Supdialog Tellask context (mentionList + tellaskContent) explaining their purpose
949
+ - Tellasker dialog Tellask context (mentionList + tellaskContent) explaining their purpose
927
950
  - Access to shared team memories
928
951
  - Access to their agent's individual memories
929
952
 
953
+ ### Subdialog course header (required)
954
+
955
+ At the start of every subdialog course, the runtime must prepend a role header to the assignment prompt:
956
+
957
+ - EN: `You are the responder (tellaskee dialog) for this dialog; the tellasker dialog is @xxx (the current caller).`
958
+ - ZH: `你是当前被诉请者对话(tellaskee dialog)的主理人;诉请者对话(tellasker dialog)为 @xxx(当前发起本次诉请)。`
959
+
960
+ **FBR special handling**: FBR is a self-subdialog and must keep a dedicated header to avoid confusion:
961
+
962
+ - EN (example): `This is an FBR sideline dialog; the tellasker dialog is @xxx (may be the same agent).`
963
+ - ZH(示例): `这是一次 FBR 支线对话;诉请者对话为 @xxx(可能与当前对话同一 agent)。`
964
+
965
+ **Insertion point**: prefer a single insertion point by updating `formatAssignmentFromSupdialog()` (covers `dialog.ts`, `tellask-bridge`, and `agent-priming`).
966
+ Frontend twin must stay in sync: `dominds/webapp/src/shared/utils/inter-dialog-format.ts`.
967
+
930
968
  **Storage**: All subdialogs are stored flat under the main dialog's (root dialog's) `subdialogs/` directory, regardless of nesting depth.
931
969
 
932
970
  **Navigation**: Each subdialog maintains a reference to its parent, enabling upward traversal to the main dialog.
@@ -950,9 +988,9 @@ interface RegistryMethods {
950
988
 
951
989
  ### Communication Patterns
952
990
 
953
- **Upward Communication**: Subdialogs communicate results, questions, and escalations to their supdialogs.
991
+ **Upward Communication**: Subdialogs communicate results, questions, and escalations to their **tellasker dialog** (the caller).
954
992
 
955
- - **Clarification Requests (TYPE A / `TellaskBack`)**: A subdialog may Tellask its supdialog to request clarification while working on its subtask. The supdialog provides guidance, and the subdialog continues with updated context.
993
+ - **Clarification Requests (TYPE A / `TellaskBack`)**: A subdialog may Tellask its tellasker dialog to request clarification while working on its subtask. For TYPE A, the tellasker dialog is the direct supdialog. The tellasker dialog provides guidance, and the subdialog continues with updated context.
956
994
  - **Subtask Response**: When a subdialog produces a final "saying" content block (no pending Q4H), that message is treated as the response to the **current caller** recorded in `assignmentFromSup` (root or another subdialog). This keeps responses aligned with the most recent Tellask site.
957
995
  - **Q4H Escalation**: If a subdialog has Q4H, it suspends. The user can answer via the UI, which triggers continuation of the subdialog only.
958
996
  - **Registered Subdialogs (TYPE B / `Tellask Session`)**: A parent can resume a previously created registered subdialog, enabling ongoing task continuation.
@@ -1045,7 +1083,7 @@ To make the UI **faithfully reflect the original generation order**, and to ensu
1045
1083
 
1046
1084
  **Teammate Tellask Capability**: Agents can invoke all three types of teammate Tellasks:
1047
1085
 
1048
- - TYPE A / `TellaskBack`: Tellask supdialog for clarification
1086
+ - TYPE A / `TellaskBack`: Tellask the tellasker dialog for clarification (direct supdialog for TYPE A)
1049
1087
  - TYPE B / `Tellask Session`: Tellask/resume registered subdialogs
1050
1088
  - TYPE C / `Fresh Tellask`: Spawn transient subdialogs
1051
1089
 
@@ -1096,10 +1134,10 @@ rendered in different markdown viewers.
1096
1134
  sequenceDiagram
1097
1135
  participant Sub as Subdialog
1098
1136
  participant Driver as Backend driver
1099
- participant Sup as Supdialog (direct parent)
1137
+ participant Sup as Tellasker dialog (direct supdialog)
1100
1138
 
1101
1139
  Sub->>Driver: emits `tellaskBack({ tellaskContent: "..." })` + question
1102
- Driver->>Sup: drive supdialog to answer
1140
+ Driver->>Sup: drive tellasker dialog to answer
1103
1141
  Sup-->>Driver: response text
1104
1142
  Driver-->>Sub: resume subdialog with response in context
1105
1143
  ```
@@ -1148,7 +1186,7 @@ sequenceDiagram
1148
1186
 
1149
1187
  ```mermaid
1150
1188
  flowchart TD
1151
- A[!?askHuman() Tellask emitted] --> B[Append HumanQuestion entry to q4h.yaml]
1189
+ A[askHuman({ tellaskContent: "..." }) Tellask emitted] --> B[Append HumanQuestion entry to q4h.yaml]
1152
1190
  B --> C[Emit questions_count_update]
1153
1191
  C --> D[UI shows Q4H badge / list]
1154
1192
  D --> E{How is it cleared?}
@@ -1173,7 +1211,7 @@ sequenceDiagram
1173
1211
 
1174
1212
  Sup->>Sub: create subdialog (Type B or C)
1175
1213
  Note over Sup,Sub: Supdialog becomes blocked on pending subdialogs
1176
- Sub->>WS: emits !?askHuman() question (Q4H)
1214
+ Sub->>WS: emits askHuman({ tellaskContent: "..." }) question (Q4H)
1177
1215
  WS-->>UI: questions_count_update (global)
1178
1216
 
1179
1217
  Note over Sub: Subdialog cannot proceed until answered
@@ -1202,7 +1240,7 @@ sequenceDiagram
1202
1240
  participant Store as Persistence (q4h.yaml)
1203
1241
  participant UI as Frontend
1204
1242
 
1205
- User->>Main: !?askHuman() question
1243
+ User->>Main: askHuman({ tellaskContent: "..." }) question
1206
1244
  Main->>Store: recordQuestionForHuman()
1207
1245
  Main-->>UI: questions_count_update
1208
1246
  Main-->>Main: suspend root drive loop
@@ -27,20 +27,30 @@
27
27
  ## 术语
28
28
 
29
29
  本章定义本文档中使用的面向实现的术语。
30
- 关于双语/面向用户的命名约定,请参阅 [`dominds-terminology.md`](./dominds-terminology.md)。
30
+ 关于双语/面向用户的命名约定(主线对话/支线对话;诉请者对话/被诉请者对话),请参阅 [`dominds-terminology.md`](./dominds-terminology.md)。
31
31
  关于 Taskdoc 包结构和封装规则,请参阅 [`encapsulated-taskdoc.zh.md`](./encapsulated-taskdoc.zh.md)。
32
32
 
33
33
  ### 上位对话 (Supdialog)
34
34
 
35
35
  **上位对话** (supdialog,全称 "super dialog") 是层级对话关系中的上位对话。它编排和管理子对话,提供上下文、目标和指导,同时接收来自子对话的结果、问题和升级。上位对话维护整体任务上下文,并决定何时不再需要子对话。
36
36
 
37
- 上位对话可以在子对话执行期间接收**上位 Tellask**。当子对话需要指导或额外上下文时,它可以向上位对话 Tellask(TYPE A / `TellaskBack` / 回问诉请),提供反馈到子对话上下文的响应。
37
+ 注意:**上位对话**是层级结构里的父对话,并不等同于**诉请者对话**(本次诉请的发起者)。TYPE A(`tellaskBack`)时,诉请者对话就是直接上位对话;TYPE B/C 时,诉请者对话可能是不同的对话。
38
+
39
+ 上位对话可以在子对话执行期间接收来自子对话的 **TellaskBack(回问诉请)**。当子对话需要指导或额外上下文时,它可以用 `tellaskBack({ tellaskContent: "..." })` 回问(TYPE A / `TellaskBack` / 回问诉请),并将响应反馈到子对话上下文。
38
40
 
39
41
  ### 子对话 (Subdialog)
40
42
 
41
43
  **子对话** 是由上位对话生成的专门对话,用于处理特定子任务。子对话使用新的上下文操作,专注于定向目标,同时保持与上位对话的通信链接。
42
44
 
43
- **上位 Tellask**:子对话可以在任务执行期间向上位对话 Tellask 以请求澄清。这允许子对话在保持自身上下文和进度的同时提问并接收指导。
45
+ **TellaskBack(回问诉请)**:子对话可以在任务执行期间向**诉请者对话**回问澄清。TYPE A 中诉请者对话就是直接上位对话。此机制允许子对话在保持自身上下文和进度的同时提问并接收指导。
46
+
47
+ ### 诉请者对话 / 被诉请者对话(调用角色)
48
+
49
+ **诉请者对话**是发起本次诉请的对话(caller),**被诉请者对话**是处理本次诉请的对话(当前对话)。这是**调用角色**,不是层级关系:
50
+
51
+ - TYPE A(`tellaskBack`)时,诉请者对话是直接上位对话。
52
+ - TYPE B/C 时,诉请者对话可能是主线对话,也可能是其他支线对话。
53
+ - 回贴会路由到 `assignmentFromSup` 中记录的**当前诉请者对话**。
44
54
 
45
55
  ### 主对话 (Root Dialog)
46
56
 
@@ -48,7 +58,7 @@
48
58
 
49
59
  ### Q4H (向人类提问)
50
60
 
51
- **Q4H** 是由对话(主对话或子对话)提出的待处理问题,需要人工输入才能继续。Q4H 被索引在对话的 `q4h.yaml` 文件中(一个索引,不是真理之源),并由 `clear_mind` 操作清除。实际的问题内容存储在对话的对话消息中,其中记录了 `!?askHuman()` Tellask。
61
+ **Q4H** 是由对话(主对话或子对话)提出的待处理问题,需要人工输入才能继续。Q4H 被索引在对话的 `q4h.yaml` 文件中(一个索引,不是真理之源),并由 `clear_mind` 操作清除。实际的问题内容存储在对话的对话消息中,其中记录了 `askHuman({ tellaskContent: "..." })` Tellask。
52
62
 
53
63
  ### 子对话索引 (subdlg.yaml)
54
64
 
@@ -140,14 +150,14 @@
140
150
 
141
151
  ```mermaid
142
152
  flowchart TD
143
- M[LLM 发出 tellaskSessionless({ targetAgentId: "mention", tellaskContent: "..." })] --> Q{这是子对话在告诉其直接上位对话吗?}
153
+ M[LLM 发出 tellaskSessionless({ targetAgentId: "mention", tellaskContent: "..." })] --> Q{这是子对话回问其直接上位对话(TYPE A 的诉请者对话)吗?}
144
154
  Q -- 是 --> A[TYPE A:回问诉请<br/>(`TellaskBack` / 回问诉请)<br/>主要:`tellaskBack({ tellaskContent: "..." })`(无 sessionSlug)]
145
155
  Q -- 否 --> T{是否存在 sessionSlug?}
146
156
  T -- 是 --> B[TYPE B:已注册子对话 Tellask<br/>(`Tellask Session` / 长线诉请)<br/>tellask({ targetAgentId: "agentId", sessionSlug: "tellaskSession", tellaskContent: "..." })]
147
157
  T -- 否 --> C[TYPE C:瞬态子对话 Tellask<br/>(`Fresh Tellask` / 一次性诉请)<br/>tellaskSessionless({ targetAgentId: "agentId", tellaskContent: "..." })]
148
158
  ```
149
159
 
150
- ### TYPE A:上位 Tellask(Type A / `TellaskBack` / 回问诉请)
160
+ ### TYPE A:回问诉请(Type A / `TellaskBack` / 回问诉请)
151
161
 
152
162
  **主要语法**:`tellaskBack({ tellaskContent: "..." })`(无 `sessionSlug`)— `tellaskBack({ tellaskContent: "..." }) sessionSlug ...` 是**语法错误**
153
163
 
@@ -156,17 +166,29 @@ flowchart TD
156
166
  **行为**:
157
167
 
158
168
  1. 当前子对话**挂起**
159
- 2. 驱动程序切换到驱动**上位对话**(使用 `subdialog.supdialog` 引用)
160
- 3. 上位对话的响应流回子对话
161
- 4. 子对话**恢复**,上位对话的响应在上下文中
169
+ 2. 驱动程序切换到驱动**诉请者对话**(TYPE A 中为直接上位对话;使用 `subdialog.supdialog` 引用)
170
+ 3. 诉请者对话的响应流回子对话
171
+ 4. 子对话**恢复**,诉请者对话的响应在上下文中
162
172
 
163
173
  **关键特征**:
164
174
 
165
175
  - 使用 `subdialog.supdialog` 引用(无注册表查找)
166
176
  - 无需注册 — 上位对话关系是固有的
167
- - 上位对话始终是层级中的直接父级
177
+ - 上位对话始终是层级中的直接父级(TYPE A 的诉请者对话)
168
178
  - `tellaskBack({ tellaskContent: "..." })` 是**规范**的 TYPE A 语法:它始终路由到“诉请者”(发起本次诉请的对话),避免自行猜测。
169
179
 
180
+ **支线交付规则(规范)**:
181
+
182
+ - 只有当所有目标完成时,支线对话才可直接回贴诉请者对话。
183
+ - 若任何目标未完成或关键信息缺失,必须先用 `tellaskBack({ tellaskContent: "..." })` 回问诉请者对话再继续。
184
+ - **FBR 例外**:FBR 支线对话禁止任何诉请(包括 `tellaskBack`),只能列出缺口与阻塞原因并直接回贴。
185
+
186
+ **首行标记(强制)**:
187
+
188
+ - `【tellaskBack】` — 回问诉请者对话时必须使用(首行)。
189
+ - `【最终完成】` — 完成全部目标后的最终交付(首行)。
190
+ - FBR 专用:`【FBR-直接回复】` 或 `【FBR-仅推理】`(首行)。
191
+
170
192
  **示例**:
171
193
 
172
194
  ```
@@ -207,7 +229,7 @@ LLM 发出:tellaskSessionless({ targetAgentId: "orchestrator", tellaskContent:
207
229
 
208
230
  **当前调用者跟踪(对复用很重要):**
209
231
 
210
- 当已注册的子对话被再次 Tellask(相同的 `agentId!sessionSlug`)时,调用者可能是**不同的对话**(主线对话或其他支线对话)。在每次 TYPE B Tellask 时,子对话的元数据都会更新为:
232
+ 当已注册的子对话被再次 Tellask(相同的 `agentId!sessionSlug`)时,调用者可能是**不同的对话**(根对话或其他支线对话)。在每次 TYPE B Tellask 时,子对话的元数据都会更新为:
211
233
 
212
234
  - **当前调用者对话 ID**(这样响应就会路由回*最新*的调用者)
213
235
  - **Tellask 信息**(标题/正文、来源角色、来源成员、callId)
@@ -272,7 +294,7 @@ LLM 再次发出:tellask({ targetAgentId: "researcher", sessionSlug: "market-a
272
294
  2. 使用指定的 agentId 创建**新的子对话**
273
295
  3. 驱动新的子对话:
274
296
  - 一般 TYPE C 子对话是“完整能力”的(可上位调用、队友诉请、按配置使用工具)。
275
- - `freshBootsReasoning({ tellaskContent: "..." })` 属于 FBR 特例:无工具、诉请受限(见 `fbr.zh.md`)。
297
+ - `freshBootsReasoning({ tellaskContent: "..." })` 属于 FBR 特例:无工具、禁止任何诉请(见 `fbr.zh.md`)。
276
298
  4. 子对话的响应流回父级
277
299
  5. 父级**恢复**,子对话的响应在上下文中
278
300
 
@@ -280,7 +302,7 @@ LLM 再次发出:tellask({ targetAgentId: "researcher", sessionSlug: "market-a
280
302
 
281
303
  - **无注册表查找** - 总是创建新的子对话
282
304
  - **不注册** - 在 Tellask 之间不持久化
283
- - 子对话本身一般是“完整能力”的;但 `freshBootsReasoning({ tellaskContent: "..." })` FBR 是特例:无工具且诉请受限(见 `fbr.zh.md`)。
305
+ - 子对话本身一般是“完整能力”的;但 `freshBootsReasoning({ tellaskContent: "..." })` FBR 是特例:无工具且禁止任何诉请(见 `fbr.zh.md`)。
284
306
  - 与 TYPE B 的唯一区别:无注册表查找/恢复能力
285
307
  - 用于一次性的、独立的任务
286
308
 
@@ -309,7 +331,7 @@ LLM 再次发出:@code-reviewer 审查这个其他 PR
309
331
 
310
332
  ### 对比总结
311
333
 
312
- | 方面 | TYPE A:上位 Tellask (`TellaskBack`) | TYPE B:已注册子对话 Tellask (`Tellask Session`) | TYPE C:瞬态子对话 Tellask (`Fresh Tellask`) |
334
+ | 方面 | TYPE A:回问诉请 (`TellaskBack`) | TYPE B:已注册子对话 Tellask (`Tellask Session`) | TYPE C:瞬态子对话 Tellask (`Fresh Tellask`) |
313
335
  | --------------- | ---------------------------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
314
336
  | **语法** | `tellaskBack({ tellaskContent: "..." })` | `tellask({ targetAgentId: "<anyAgentId>", sessionSlug: "<id>", tellaskContent: "..." })` | `tellaskSessionless({ targetAgentId: "<nonSupdialogAgentId>", tellaskContent: "..." })` |
315
337
  | **sessionSlug** | 不允许 | 必须 | 不允许 |
@@ -329,7 +351,7 @@ Dominds 对话系统建立在四个相互关联的核心机制之上,这些机
329
351
  ```mermaid
330
352
  flowchart TD
331
353
  H[对话层级<br/>(root ↔ 子对话)] <--> S[子对话供应<br/>(响应、待处理列表、注册表)]
332
- H --> Q[Q4H (!?askHuman())<br/>(q4h.yaml 索引)]
354
+ H --> Q[Q4H (askHuman({ tellaskContent: "..." }))<br/>(q4h.yaml 索引)]
333
355
  S --> Q
334
356
 
335
357
  Q --> UI[前端 Q4H 面板<br/>(questions_count_update)]
@@ -343,7 +365,7 @@ flowchart TD
343
365
 
344
366
  ### 关键设计原则
345
367
 
346
- 1. **Q4H 索引在 `q4h.yaml` 中**:Q4H 问题被索引在 `q4h.yaml` 中(作为索引,不是真理之源),并由思维清晰操作清除。实际的问题内容在对话的对话消息中,其中记录了 `!?askHuman()` Tellask。它们不会在 `clear_mind` 中存活。
368
+ 1. **Q4H 索引在 `q4h.yaml` 中**:Q4H 问题被索引在 `q4h.yaml` 中(作为索引,不是真理之源),并由思维清晰操作清除。实际的问题内容在对话的对话消息中,其中记录了 `askHuman({ tellaskContent: "..." })` Tellask。它们不会在 `clear_mind` 中存活。
347
369
 
348
370
  2. **层级 Q4H**:层级中的任何对话都可以自行提出 Q4H(根对话或子对话)。问题被索引在提出问题的对话中,而不是向上传递。
349
371
 
@@ -357,7 +379,7 @@ flowchart TD
357
379
 
358
380
  7. **状态保留契约**:
359
381
  - `clear_mind`:清除消息,清除 Q4H 索引,保留提醒,保留注册表
360
- - 子对话完成:向父对话写入响应,从待处理列表中删除(注册表不变)
382
+ - 子对话完成:向当前诉请者对话写入响应,从待处理列表中删除(注册表不变)
361
383
  - 子对话宣布卡死:将 runState 标记为 dead,并移除对应 TYPE B 注册表条目;同一 slug 可作为全新支线重新发起
362
384
  - Q4H 回答:从索引中清除已回答的问题,继续对话
363
385
 
@@ -376,7 +398,7 @@ Q4H(向人类提问)是对话可以暂停执行并请求人工输入的机
376
398
  * HumanQuestion - 索引条目持久化在每个对话的 q4h.yaml 中
377
399
  * 注意:这是索引,不是真理之源。实际的 question
378
400
  * 内容在对话的对话消息中,其中记录了 askHuman() Tellask
379
- *(通过 !?askHuman() 调用)。
401
+ *(通过 askHuman({ tellaskContent: "..." }) 调用)。
380
402
  */
381
403
  interface HumanQuestion {
382
404
  readonly id: string; // 唯一标识符(UUID)- 匹配消息 ID
@@ -388,7 +410,7 @@ interface HumanQuestion {
388
410
 
389
411
  **存储位置**:`<dialog-path>/q4h.yaml` - 作为快速查找的索引
390
412
 
391
- **真理之源**:实际的 `!?askHuman()` Tellask 存储在对话的对话消息中(course JSONL 文件),即提出问题的地方。
413
+ **真理之源**:实际的 `askHuman({ tellaskContent: "..." })` Tellask 存储在对话的对话消息中(course JSONL 文件),即提出问题的地方。
392
414
 
393
415
  ### Q4H 机制流程
394
416
 
@@ -412,24 +434,23 @@ sequenceDiagram
412
434
 
413
435
  ### 对话何时提出 Q4H?
414
436
 
415
- `!?askHuman()` 队友 Tellask 被任何对话(根或子对话)自行调用时,会提出 Q4H:
437
+ `askHuman({ tellaskContent: "..." })` tellask 函数被任何对话(根或子对话)自行调用时,会提出 Q4H:
416
438
 
417
439
  ```typescript
418
- // 来自 main/llm/driver.ts,executeTellaskCall 函数
419
- const isQ4H = callKind === 'askHuman';
440
+ // 来自 main/llm/driver-v2/tellask-bridge.ts
441
+ const isQ4H = callName === 'askHuman';
420
442
  ```
421
443
 
422
444
  **调用模式**:
423
445
 
424
- ```
425
- !?askHuman() <问题标题>
426
- !?<问题正文内容>
446
+ ```typescript
447
+ askHuman({ tellaskContent: "<问题标题>\n<问题正文内容>" });
427
448
  ```
428
449
 
429
450
  ### Q4H 记录过程
430
451
 
431
452
  ```typescript
432
- // 当检测到 !?askHuman() 作为队友 Tellask 时
453
+ // 当检测到 askHuman({ tellaskContent: "..." }) 作为队友 Tellask 时
433
454
  async function recordQuestionForHuman(
434
455
  dlg: Dialog,
435
456
  mentionList: string,
@@ -547,7 +568,7 @@ sequenceDiagram
547
568
  Sup->>Sub: 创建子对话(TYPE B 或 C)
548
569
  Note over Sup: 上位对话因待处理子对话而阻塞
549
570
 
550
- Sub->>WS: 发出 !?askHuman() 问题
571
+ Sub->>WS: 发出 askHuman({ tellaskContent: "..." }) 问题
551
572
  WS-->>UI: questions_count_update
552
573
  Note over Sub: 子对话在回答之前无法继续
553
574
 
@@ -600,11 +621,11 @@ flowchart TD
600
621
 
601
622
  ### 子对话响应供应机制
602
623
 
603
- **核心原则**:子对话通过持久化向上位对话的上下文供应响应,而不是通过回调。
624
+ **核心原则**:子对话通过持久化向**当前诉请者对话**的上下文供应响应,而不是通过回调(TYPE A 时诉请者对话为直接上位对话)。
604
625
 
605
626
  ```mermaid
606
627
  sequenceDiagram
607
- participant Sup as 上位对话
628
+ participant Sup as 诉请者对话
608
629
  participant Driver as 后端驱动程序
609
630
  participant Sub as 子对话
610
631
  participant Store as 持久化
@@ -613,7 +634,7 @@ sequenceDiagram
613
634
  Driver->>Sub: 驱动子对话(分离执行)
614
635
  Sub-->>Store: 持久化最终响应
615
636
  Driver-->>Sup: 供应响应 + 清除待处理子对话
616
- opt 上位对话是根且现在已解除阻塞
637
+ opt 诉请者对话是根且现在已解除阻塞
617
638
  Driver-->>Sup: 设置 needsDrive=true(自动重启)
618
639
  end
619
640
  ```
@@ -910,7 +931,7 @@ interface RegistryMethods {
910
931
  **上下文继承**:新的子对话自动接收:
911
932
 
912
933
  - 对相同 rtws(运行时工作区)Taskdoc 的引用(推荐:`tasks/feature-auth.tsk/`);`dlg.taskDocPath` 在对话创建时固定,永不重新分配
913
- - 上位 Tellask 上下文(mentionList + tellaskContent)解释其目的
934
+ - 诉请者对话 Tellask 上下文(mentionList + tellaskContent)解释其目的
914
935
  - 访问共享团队内存
915
936
  - 访问其智能体的个人内存
916
937
 
@@ -920,6 +941,20 @@ interface RegistryMethods {
920
941
 
921
942
  **注册表**:已注册的子对话(TYPE B Tellask)在根对话的注册表中跟踪,并在重启后持久化;若子对话被宣布卡死,其条目会被裁剪,不再参与后续同 slug 复用。
922
943
 
944
+ ### 子对话课程头(强制)
945
+
946
+ 每次子对话 course 开始时,运行时必须在 assignment prompt 前插入角色头:
947
+
948
+ - ZH:`你是当前被诉请者对话(tellaskee dialog)的主理人;诉请者对话(tellasker dialog)为 @xxx(当前发起本次诉请)。`
949
+ - EN:`You are the responder (tellaskee dialog) for this dialog; the tellasker dialog is @xxx (the current caller).`
950
+
951
+ **FBR 特例**(示例):
952
+
953
+ - ZH:`这是一次 FBR 支线对话;诉请者对话为 @xxx(可能与当前对话同一 agent)。`
954
+ - EN:`This is an FBR sideline dialog; the tellasker dialog is @xxx (may be the same agent).`
955
+
956
+ **插入点**:优先通过 `formatAssignmentFromSupdialog()` 单点注入(覆盖 `dialog.ts` / `tellask-bridge` / `agent-priming`),前端 twin 同步:`dominds/webapp/src/shared/utils/inter-dialog-format.ts`。
957
+
923
958
  ### 生命周期管理
924
959
 
925
960
  **活动状态**:智能体正在工作时,对话保持活动状态。
@@ -937,9 +972,9 @@ interface RegistryMethods {
937
972
 
938
973
  ### 通信模式
939
974
 
940
- **向上通信**:子对话向上位对话通信结果、问题和升级。
975
+ **向上通信**:子对话向诉请者对话通信结果、问题和升级。
941
976
 
942
- - **澄清请求(TYPE A / `TellaskBack`)**:子对话在处理其子任务时可能向上位对话 Tellask 以请求澄清。上位对话提供指导,子对话在新上下文中继续。
977
+ - **澄清请求(TYPE A / `TellaskBack`)**:子对话在处理其子任务时可能向诉请者对话 Tellask 以请求澄清。TYPE A 中诉请者对话为直接上位对话。诉请者对话提供指导,子对话在新上下文中继续。
943
978
  - **子任务响应**:当子对话产生最终的 "saying" 内容块(没有待处理的 Q4H)时,该消息被视为对**当前调用者**的响应,记录在 `assignmentFromSup` 中(根或另一个子对话)。这使响应与最新的 Tellask 站点保持一致。
944
979
  - **Q4H 升级**:如果子对话有 Q4H,它会暂停。用户可以通过 UI 回答,这只会触发子对话的继续。
945
980
  - **已注册的子对话(TYPE B / `Tellask Session`)**:父级可以恢复先前创建的已注册子对话,实现持续的任务继续。
@@ -1136,7 +1171,7 @@ sequenceDiagram
1136
1171
 
1137
1172
  ```mermaid
1138
1173
  flowchart TD
1139
- A[!?askHuman() Tellask 发出] --> B[将 HumanQuestion 条目追加到 q4h.yaml]
1174
+ A[askHuman({ tellaskContent: "..." }) Tellask 发出] --> B[将 HumanQuestion 条目追加到 q4h.yaml]
1140
1175
  B --> C[发出 questions_count_update]
1141
1176
  C --> D[UI 显示 Q4H 徽章/列表]
1142
1177
  D --> E{如何清除?}
@@ -1160,7 +1195,7 @@ sequenceDiagram
1160
1195
 
1161
1196
  Sup->>Sub: 创建子对话(TYPE B 或 C)
1162
1197
  Note over Sup,Sub: 上位对话因待处理子对话而阻塞
1163
- Sub->>WS: 发出 !?askHuman() 问题(Q4H)
1198
+ Sub->>WS: 发出 askHuman({ tellaskContent: "..." }) 问题(Q4H)
1164
1199
  WS-->>UI: questions_count_update(全局)
1165
1200
 
1166
1201
  Note over Sub: 子对话在回答之前无法继续
@@ -1189,7 +1224,7 @@ sequenceDiagram
1189
1224
  participant Store as 持久化(q4h.yaml)
1190
1225
  participant UI as 前端
1191
1226
 
1192
- User->>Main: !?askHuman() 问题
1227
+ User->>Main: askHuman({ tellaskContent: "..." }) 问题
1193
1228
  Main->>Store: recordQuestionForHuman()
1194
1229
  Main-->>UI: questions_count_update
1195
1230
  Main-->>Main: 暂停根驱动循环