dominds 1.8.9 → 1.8.11

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 (208) hide show
  1. package/README.md +17 -0
  2. package/README.zh.md +17 -0
  3. package/dist/access-control.d.ts +9 -1
  4. package/dist/access-control.js +0 -8
  5. package/dist/apps/assigned-port.d.ts +1 -1
  6. package/dist/apps/dialog-run-controls.d.ts +1 -1
  7. package/dist/apps/resolution-file.d.ts +1 -1
  8. package/dist/apps/resolution-file.js +1 -1
  9. package/dist/apps/run-app-json.d.ts +1 -1
  10. package/dist/apps/run-app-json.js +1 -1
  11. package/dist/apps/run-control.d.ts +2 -1
  12. package/dist/apps/run-control.js +45 -1
  13. package/dist/apps-host/client.d.ts +2 -2
  14. package/dist/apps-host/client.js +16 -0
  15. package/dist/apps-host/host.js +90 -2
  16. package/dist/apps-host/ipc-types.d.ts +4 -8
  17. package/dist/course-transition.d.ts +1 -1
  18. package/dist/dialog-display-state.d.ts +3 -3
  19. package/dist/dialog-fork.d.ts +1 -1
  20. package/dist/dialog-fork.js +1 -1
  21. package/dist/dialog.d.ts +25 -7
  22. package/dist/dialog.js +7 -55
  23. package/dist/docs/app-constitution.md +43 -0
  24. package/dist/docs/app-constitution.zh.md +43 -0
  25. package/dist/docs/dialog-system.md +7 -7
  26. package/dist/docs/dialog-system.zh.md +16 -19
  27. package/dist/docs/fbr.zh.md +1 -1
  28. package/dist/docs/tellask-collab.md +1 -0
  29. package/dist/docs/tellask-collab.zh.md +3 -3
  30. package/dist/evt-registry.d.ts +1 -1
  31. package/dist/llm/client.d.ts +1 -81
  32. package/dist/llm/defaults.yaml +45 -3
  33. package/dist/llm/gen/anthropic.d.ts +1 -1
  34. package/dist/llm/gen.d.ts +2 -2
  35. package/dist/llm/kernel-driver/context-health.d.ts +1 -1
  36. package/dist/llm/kernel-driver/drive.js +6 -3
  37. package/dist/llm/kernel-driver/events.d.ts +1 -1
  38. package/dist/llm/kernel-driver/flow.js +3 -0
  39. package/dist/llm/kernel-driver/guardrails.d.ts +1 -1
  40. package/dist/llm/kernel-driver/runtime.js +2 -2
  41. package/dist/llm/kernel-driver/subdialog.js +1 -1
  42. package/dist/llm/kernel-driver/tellask-special.js +1 -1
  43. package/dist/llm/kernel-driver/types.d.ts +2 -2
  44. package/dist/llm/tools-projection.d.ts +1 -1
  45. package/dist/minds/minds-i18n.d.ts +1 -1
  46. package/dist/minds/system-prompt-parts.d.ts +1 -1
  47. package/dist/minds/system-prompt.d.ts +1 -1
  48. package/dist/minds/system-prompt.js +74 -66
  49. package/dist/persistence.d.ts +4 -4
  50. package/dist/persistence.js +2 -2
  51. package/dist/priming.d.ts +3 -3
  52. package/dist/priming.js +1 -1
  53. package/dist/problems.d.ts +2 -2
  54. package/dist/server/api-routes.js +3 -7
  55. package/dist/server/create-dialog-contract.d.ts +1 -1
  56. package/dist/server/setup-routes.d.ts +1 -1
  57. package/dist/server/snippets-routes.d.ts +1 -1
  58. package/dist/server/websocket-handler.d.ts +2 -2
  59. package/dist/server/websocket-handler.js +1 -1
  60. package/dist/shared/diligence.d.ts +1 -1
  61. package/dist/shared/i18n/driver-messages.d.ts +2 -1
  62. package/dist/shared/i18n/driver-messages.js +46 -5
  63. package/dist/shared/i18n/text.d.ts +2 -2
  64. package/dist/shared/i18n/tool-result-messages.d.ts +1 -1
  65. package/dist/shared/runtime-language.d.ts +1 -1
  66. package/dist/shared/runtime-language.js +1 -1
  67. package/dist/shared/utils/fbr.d.ts +1 -1
  68. package/dist/shared/utils/inter-dialog-format.d.ts +1 -1
  69. package/dist/skills/load.d.ts +1 -1
  70. package/dist/team-config-updates.d.ts +1 -1
  71. package/dist/tool.d.ts +10 -19
  72. package/dist/tools/app-reminders.d.ts +1 -1
  73. package/dist/tools/manual/render.d.ts +1 -1
  74. package/dist/tools/manual/schema.d.ts +1 -1
  75. package/dist/tools/manual/spec.d.ts +1 -1
  76. package/dist/tools/mem.js +0 -6
  77. package/dist/tools/registry-snapshot.d.ts +1 -1
  78. package/dist/tools/registry.d.ts +7 -2
  79. package/dist/tools/registry.js +0 -5
  80. package/dist/tools/toolset-manual.d.ts +1 -1
  81. package/dist/tools/txt.js +0 -6
  82. package/dist/utils/task-package.d.ts +1 -1
  83. package/package.json +5 -4
  84. package/webapp/dist/assets/{_basePickBy-BCETjyvF.js → _basePickBy-DG1QTE8n.js} +3 -3
  85. package/webapp/dist/assets/{_basePickBy-BCETjyvF.js.map → _basePickBy-DG1QTE8n.js.map} +1 -1
  86. package/webapp/dist/assets/{_baseUniq-fLqPJO5i.js → _baseUniq-D2LbmGtl.js} +2 -2
  87. package/webapp/dist/assets/{_baseUniq-fLqPJO5i.js.map → _baseUniq-D2LbmGtl.js.map} +1 -1
  88. package/webapp/dist/assets/{arc-BzFkK7IZ.js → arc-C9t8aGIF.js} +2 -2
  89. package/webapp/dist/assets/{arc-BzFkK7IZ.js.map → arc-C9t8aGIF.js.map} +1 -1
  90. package/webapp/dist/assets/{architectureDiagram-VXUJARFQ-D_hKK43_.js → architectureDiagram-VXUJARFQ-JbonIB12.js} +7 -7
  91. package/webapp/dist/assets/{architectureDiagram-VXUJARFQ-D_hKK43_.js.map → architectureDiagram-VXUJARFQ-JbonIB12.js.map} +1 -1
  92. package/webapp/dist/assets/{blockDiagram-VD42YOAC-CgWXic7v.js → blockDiagram-VD42YOAC-CcipRrJd.js} +7 -7
  93. package/webapp/dist/assets/{blockDiagram-VD42YOAC-CgWXic7v.js.map → blockDiagram-VD42YOAC-CcipRrJd.js.map} +1 -1
  94. package/webapp/dist/assets/{c4Diagram-YG6GDRKO-COqGeM2S.js → c4Diagram-YG6GDRKO-yqrIM2R1.js} +3 -3
  95. package/webapp/dist/assets/{c4Diagram-YG6GDRKO-COqGeM2S.js.map → c4Diagram-YG6GDRKO-yqrIM2R1.js.map} +1 -1
  96. package/webapp/dist/assets/{channel-8XkSzwJl.js → channel-DIBQDm_A.js} +2 -2
  97. package/webapp/dist/assets/{channel-8XkSzwJl.js.map → channel-DIBQDm_A.js.map} +1 -1
  98. package/webapp/dist/assets/{chunk-4BX2VUAB-B_R1ldB5.js → chunk-4BX2VUAB-DZXxZ8yl.js} +2 -2
  99. package/webapp/dist/assets/{chunk-4BX2VUAB-B_R1ldB5.js.map → chunk-4BX2VUAB-DZXxZ8yl.js.map} +1 -1
  100. package/webapp/dist/assets/{chunk-55IACEB6-DosUiRle.js → chunk-55IACEB6-BUyghx2N.js} +2 -2
  101. package/webapp/dist/assets/{chunk-55IACEB6-DosUiRle.js.map → chunk-55IACEB6-BUyghx2N.js.map} +1 -1
  102. package/webapp/dist/assets/{chunk-B4BG7PRW-CPvx_wxK.js → chunk-B4BG7PRW-wDPTThCF.js} +5 -5
  103. package/webapp/dist/assets/{chunk-B4BG7PRW-CPvx_wxK.js.map → chunk-B4BG7PRW-wDPTThCF.js.map} +1 -1
  104. package/webapp/dist/assets/{chunk-DI55MBZ5-CtfFQBra.js → chunk-DI55MBZ5-WXYYUPwz.js} +4 -4
  105. package/webapp/dist/assets/{chunk-DI55MBZ5-CtfFQBra.js.map → chunk-DI55MBZ5-WXYYUPwz.js.map} +1 -1
  106. package/webapp/dist/assets/{chunk-FMBD7UC4-BZJDYQUQ.js → chunk-FMBD7UC4-B4jkxTOS.js} +2 -2
  107. package/webapp/dist/assets/{chunk-FMBD7UC4-BZJDYQUQ.js.map → chunk-FMBD7UC4-B4jkxTOS.js.map} +1 -1
  108. package/webapp/dist/assets/{chunk-QN33PNHL-CazyQzCZ.js → chunk-QN33PNHL-Da7wDGy5.js} +2 -2
  109. package/webapp/dist/assets/{chunk-QN33PNHL-CazyQzCZ.js.map → chunk-QN33PNHL-Da7wDGy5.js.map} +1 -1
  110. package/webapp/dist/assets/{chunk-QZHKN3VN-H39jWkGz.js → chunk-QZHKN3VN-tIIrQvRJ.js} +2 -2
  111. package/webapp/dist/assets/{chunk-QZHKN3VN-H39jWkGz.js.map → chunk-QZHKN3VN-tIIrQvRJ.js.map} +1 -1
  112. package/webapp/dist/assets/{chunk-TZMSLE5B-T3mACKEk.js → chunk-TZMSLE5B-CQ77jWEa.js} +2 -2
  113. package/webapp/dist/assets/{chunk-TZMSLE5B-T3mACKEk.js.map → chunk-TZMSLE5B-CQ77jWEa.js.map} +1 -1
  114. package/webapp/dist/assets/{classDiagram-2ON5EDUG-BzJbZNmh.js → classDiagram-2ON5EDUG-C7QbOVXO.js} +6 -6
  115. package/webapp/dist/assets/{classDiagram-2ON5EDUG-BzJbZNmh.js.map → classDiagram-2ON5EDUG-C7QbOVXO.js.map} +1 -1
  116. package/webapp/dist/assets/{classDiagram-v2-WZHVMYZB-BzJbZNmh.js → classDiagram-v2-WZHVMYZB-C7QbOVXO.js} +6 -6
  117. package/webapp/dist/assets/{classDiagram-v2-WZHVMYZB-BzJbZNmh.js.map → classDiagram-v2-WZHVMYZB-C7QbOVXO.js.map} +1 -1
  118. package/webapp/dist/assets/{clone-Big4mBmE.js → clone-CfEeXMBD.js} +2 -2
  119. package/webapp/dist/assets/{clone-Big4mBmE.js.map → clone-CfEeXMBD.js.map} +1 -1
  120. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-jAw41QnJ.js → cose-bilkent-S5V4N54A-DYUD07XC.js} +2 -2
  121. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-jAw41QnJ.js.map → cose-bilkent-S5V4N54A-DYUD07XC.js.map} +1 -1
  122. package/webapp/dist/assets/{dagre-6UL2VRFP-D3MEMYv5.js → dagre-6UL2VRFP-ByP6tuKY.js} +7 -7
  123. package/webapp/dist/assets/{dagre-6UL2VRFP-D3MEMYv5.js.map → dagre-6UL2VRFP-ByP6tuKY.js.map} +1 -1
  124. package/webapp/dist/assets/{diagram-PSM6KHXK-CWyVYAZu.js → diagram-PSM6KHXK-Cy8Pv31D.js} +8 -8
  125. package/webapp/dist/assets/{diagram-PSM6KHXK-CWyVYAZu.js.map → diagram-PSM6KHXK-Cy8Pv31D.js.map} +1 -1
  126. package/webapp/dist/assets/{diagram-QEK2KX5R-CUYJiFCE.js → diagram-QEK2KX5R-DSIBvajB.js} +7 -7
  127. package/webapp/dist/assets/{diagram-QEK2KX5R-CUYJiFCE.js.map → diagram-QEK2KX5R-DSIBvajB.js.map} +1 -1
  128. package/webapp/dist/assets/{diagram-S2PKOQOG-BGfyTOuE.js → diagram-S2PKOQOG-BWeoKMM5.js} +7 -7
  129. package/webapp/dist/assets/{diagram-S2PKOQOG-BGfyTOuE.js.map → diagram-S2PKOQOG-BWeoKMM5.js.map} +1 -1
  130. package/webapp/dist/assets/{erDiagram-Q2GNP2WA-T0nE1xLf.js → erDiagram-Q2GNP2WA-WyM4XxG5.js} +5 -5
  131. package/webapp/dist/assets/{erDiagram-Q2GNP2WA-T0nE1xLf.js.map → erDiagram-Q2GNP2WA-WyM4XxG5.js.map} +1 -1
  132. package/webapp/dist/assets/{flowDiagram-NV44I4VS-BOtJbmb2.js → flowDiagram-NV44I4VS-BPcojI0F.js} +6 -6
  133. package/webapp/dist/assets/{flowDiagram-NV44I4VS-BOtJbmb2.js.map → flowDiagram-NV44I4VS-BPcojI0F.js.map} +1 -1
  134. package/webapp/dist/assets/{ganttDiagram-JELNMOA3-BKHc1SN2.js → ganttDiagram-JELNMOA3-BZ_OjxIx.js} +3 -3
  135. package/webapp/dist/assets/{ganttDiagram-JELNMOA3-BKHc1SN2.js.map → ganttDiagram-JELNMOA3-BZ_OjxIx.js.map} +1 -1
  136. package/webapp/dist/assets/{gitGraphDiagram-V2S2FVAM-DEs6Jd7A.js → gitGraphDiagram-V2S2FVAM-9EhnjL-y.js} +8 -8
  137. package/webapp/dist/assets/{gitGraphDiagram-V2S2FVAM-DEs6Jd7A.js.map → gitGraphDiagram-V2S2FVAM-9EhnjL-y.js.map} +1 -1
  138. package/webapp/dist/assets/{graph-B8rBjt0j.js → graph-DGSAVvxQ.js} +3 -3
  139. package/webapp/dist/assets/{graph-B8rBjt0j.js.map → graph-DGSAVvxQ.js.map} +1 -1
  140. package/webapp/dist/assets/{index-BBpM4Vs4.js → index-BRgQnAkx.js} +87 -33
  141. package/webapp/dist/assets/{index-BBpM4Vs4.js.map → index-BRgQnAkx.js.map} +1 -1
  142. package/webapp/dist/assets/{infoDiagram-HS3SLOUP-BGHKQMyS.js → infoDiagram-HS3SLOUP-ENDcix2A.js} +6 -6
  143. package/webapp/dist/assets/{infoDiagram-HS3SLOUP-BGHKQMyS.js.map → infoDiagram-HS3SLOUP-ENDcix2A.js.map} +1 -1
  144. package/webapp/dist/assets/{journeyDiagram-XKPGCS4Q-C5zIhegj.js → journeyDiagram-XKPGCS4Q-DadnPokT.js} +5 -5
  145. package/webapp/dist/assets/{journeyDiagram-XKPGCS4Q-C5zIhegj.js.map → journeyDiagram-XKPGCS4Q-DadnPokT.js.map} +1 -1
  146. package/webapp/dist/assets/{kanban-definition-3W4ZIXB7-714VVE1e.js → kanban-definition-3W4ZIXB7-BXzaQjPo.js} +3 -3
  147. package/webapp/dist/assets/{kanban-definition-3W4ZIXB7-714VVE1e.js.map → kanban-definition-3W4ZIXB7-BXzaQjPo.js.map} +1 -1
  148. package/webapp/dist/assets/{layout-DprNh9sN.js → layout-CRhyA_vK.js} +5 -5
  149. package/webapp/dist/assets/{layout-DprNh9sN.js.map → layout-CRhyA_vK.js.map} +1 -1
  150. package/webapp/dist/assets/{linear-BWG2T2oB.js → linear-BeMCt_k6.js} +2 -2
  151. package/webapp/dist/assets/{linear-BWG2T2oB.js.map → linear-BeMCt_k6.js.map} +1 -1
  152. package/webapp/dist/assets/{mindmap-definition-VGOIOE7T-DQb2l3T_.js → mindmap-definition-VGOIOE7T-DTyAPUbU.js} +4 -4
  153. package/webapp/dist/assets/{mindmap-definition-VGOIOE7T-DQb2l3T_.js.map → mindmap-definition-VGOIOE7T-DTyAPUbU.js.map} +1 -1
  154. package/webapp/dist/assets/{pieDiagram-ADFJNKIX-Do6Tc-Qs.js → pieDiagram-ADFJNKIX-yEqBgoUh.js} +8 -8
  155. package/webapp/dist/assets/{pieDiagram-ADFJNKIX-Do6Tc-Qs.js.map → pieDiagram-ADFJNKIX-yEqBgoUh.js.map} +1 -1
  156. package/webapp/dist/assets/{quadrantDiagram-AYHSOK5B-lfpxvyP1.js → quadrantDiagram-AYHSOK5B-DCIfL1qA.js} +3 -3
  157. package/webapp/dist/assets/{quadrantDiagram-AYHSOK5B-lfpxvyP1.js.map → quadrantDiagram-AYHSOK5B-DCIfL1qA.js.map} +1 -1
  158. package/webapp/dist/assets/{requirementDiagram-UZGBJVZJ-Dn4Cnusj.js → requirementDiagram-UZGBJVZJ-BpGpyEPo.js} +4 -4
  159. package/webapp/dist/assets/{requirementDiagram-UZGBJVZJ-Dn4Cnusj.js.map → requirementDiagram-UZGBJVZJ-BpGpyEPo.js.map} +1 -1
  160. package/webapp/dist/assets/{sankeyDiagram-TZEHDZUN-CcpDMXKi.js → sankeyDiagram-TZEHDZUN-BnLvkpsc.js} +2 -2
  161. package/webapp/dist/assets/{sankeyDiagram-TZEHDZUN-CcpDMXKi.js.map → sankeyDiagram-TZEHDZUN-BnLvkpsc.js.map} +1 -1
  162. package/webapp/dist/assets/{sequenceDiagram-WL72ISMW-TfHPlNvp.js → sequenceDiagram-WL72ISMW-BIRSMXkN.js} +4 -4
  163. package/webapp/dist/assets/{sequenceDiagram-WL72ISMW-TfHPlNvp.js.map → sequenceDiagram-WL72ISMW-BIRSMXkN.js.map} +1 -1
  164. package/webapp/dist/assets/{stateDiagram-FKZM4ZOC-CrqtuS-o.js → stateDiagram-FKZM4ZOC-BHl5d1jD.js} +9 -9
  165. package/webapp/dist/assets/{stateDiagram-FKZM4ZOC-CrqtuS-o.js.map → stateDiagram-FKZM4ZOC-BHl5d1jD.js.map} +1 -1
  166. package/webapp/dist/assets/{stateDiagram-v2-4FDKWEC3-CwYGywpf.js → stateDiagram-v2-4FDKWEC3-CBk1peEJ.js} +5 -5
  167. package/webapp/dist/assets/{stateDiagram-v2-4FDKWEC3-CwYGywpf.js.map → stateDiagram-v2-4FDKWEC3-CBk1peEJ.js.map} +1 -1
  168. package/webapp/dist/assets/{timeline-definition-IT6M3QCI-DoP5HyAE.js → timeline-definition-IT6M3QCI-DByp3MyR.js} +3 -3
  169. package/webapp/dist/assets/{timeline-definition-IT6M3QCI-DoP5HyAE.js.map → timeline-definition-IT6M3QCI-DByp3MyR.js.map} +1 -1
  170. package/webapp/dist/assets/{treemap-GDKQZRPO-3rSE1o-R.js → treemap-GDKQZRPO-BiX6BP5A.js} +5 -5
  171. package/webapp/dist/assets/{treemap-GDKQZRPO-3rSE1o-R.js.map → treemap-GDKQZRPO-BiX6BP5A.js.map} +1 -1
  172. package/webapp/dist/assets/{xychartDiagram-PRI3JC2R-DFTw6wXn.js → xychartDiagram-PRI3JC2R-DOgxhO-R.js} +3 -3
  173. package/webapp/dist/assets/{xychartDiagram-PRI3JC2R-DFTw6wXn.js.map → xychartDiagram-PRI3JC2R-DOgxhO-R.js.map} +1 -1
  174. package/webapp/dist/index.html +1 -1
  175. package/dist/apps/app-json.d.ts +0 -127
  176. package/dist/apps/app-json.js +0 -241
  177. package/dist/apps-host/app-host-contract.d.ts +0 -87
  178. package/dist/apps-host/app-host-contract.js +0 -2
  179. package/dist/shared/types/context-health.d.ts +0 -33
  180. package/dist/shared/types/context-health.js +0 -2
  181. package/dist/shared/types/dialog.d.ts +0 -403
  182. package/dist/shared/types/dialog.js +0 -11
  183. package/dist/shared/types/display-state.d.ts +0 -56
  184. package/dist/shared/types/display-state.js +0 -15
  185. package/dist/shared/types/drive-intent.d.ts +0 -36
  186. package/dist/shared/types/drive-intent.js +0 -2
  187. package/dist/shared/types/i18n.d.ts +0 -2
  188. package/dist/shared/types/i18n.js +0 -2
  189. package/dist/shared/types/index.d.ts +0 -109
  190. package/dist/shared/types/index.js +0 -27
  191. package/dist/shared/types/language.d.ts +0 -10
  192. package/dist/shared/types/language.js +0 -40
  193. package/dist/shared/types/priming.d.ts +0 -55
  194. package/dist/shared/types/priming.js +0 -2
  195. package/dist/shared/types/problems.d.ts +0 -128
  196. package/dist/shared/types/problems.js +0 -2
  197. package/dist/shared/types/q4h.d.ts +0 -14
  198. package/dist/shared/types/q4h.js +0 -7
  199. package/dist/shared/types/setup.d.ts +0 -170
  200. package/dist/shared/types/setup.js +0 -2
  201. package/dist/shared/types/snippets.d.ts +0 -68
  202. package/dist/shared/types/snippets.js +0 -2
  203. package/dist/shared/types/storage.d.ts +0 -677
  204. package/dist/shared/types/storage.js +0 -87
  205. package/dist/shared/types/tools-registry.d.ts +0 -19
  206. package/dist/shared/types/tools-registry.js +0 -2
  207. package/dist/shared/types/wire.d.ts +0 -227
  208. package/dist/shared/types/wire.js +0 -18
package/README.md CHANGED
@@ -225,6 +225,23 @@ dominds
225
225
  3. In the app, create a new dialog with **shadow member** `@fuxi` (Fuxi is hidden by default; use the “Shadow members” picker in the dialog creation modal). Until you add visible members, you’ll mostly work through shadow members.
226
226
  4. Tell `@fuxi` your product idea and ask it to propose and apply a suitable agentic team configuration by updating `.minds/team.yaml` (Fuxi has the `team_mgmt` toolset scoped to `.minds/**`).
227
227
 
228
+ ## Build from source
229
+
230
+ When developing Dominds itself, use the integrated build entry from the repo root:
231
+
232
+ ```bash
233
+ pnpm run clean
234
+ pnpm run build
235
+ pnpm run lint:types
236
+ ```
237
+
238
+ Notes:
239
+
240
+ - `pnpm run build` is the canonical full build. It runs backend first, then frontend.
241
+ - `pnpm run build:backend` and `pnpm run build:frontend` are sub-steps for focused debugging. They are not the recommended "full rebuild" command.
242
+ - Do not manually run multiple top-level build commands in parallel. They share `dist/` outputs, so concurrent runs can create racey, misleading results.
243
+ - The backend build may still let pnpm build independent workspace packages concurrently according to the workspace dependency graph. That scheduler-controlled concurrency is expected.
244
+
228
245
  ## Core Philosophy
229
246
 
230
247
  Dominds is designed for long-running product development and operations, with a “division of labor” constitution:
package/README.zh.md CHANGED
@@ -106,6 +106,23 @@ https://github.com/longrun-ai/dominds-feat-dev
106
106
  - `--shared-rtws` 仅用于调试,会直接使用 `tests/script-rtws`,禁止并发运行多个用例。
107
107
  - 需要保留失败现场时,设置 `DOMINDS_TEST_RTWS_KEEP_TMP=1`,测试 CLI 会保留临时 rtws 路径。
108
108
 
109
+ ### 本仓库源码构建
110
+
111
+ 开发 Dominds 本体时,推荐把仓库根目录下的完整构建入口当成唯一标准用法:
112
+
113
+ ```bash
114
+ pnpm run clean
115
+ pnpm run build
116
+ pnpm run lint:types
117
+ ```
118
+
119
+ 说明:
120
+
121
+ - `pnpm run build` 才是标准的一体构建入口;它会先构建 backend,再构建 frontend。
122
+ - `pnpm run build:backend` / `pnpm run build:frontend` 只是便于聚焦排障的子步骤,不应被当成“完整重建”的推荐命令。
123
+ - 不要手工并行执行多个顶层构建命令,例如同时跑两个 `pnpm run build`,或把 `pnpm run build` 与 `pnpm run build:backend` 并行跑。它们会共享 `dist/` 产物目录,容易制造竞态与误导性结果。
124
+ - `build:backend` 内部的 `pnpm -r ... run build` 仍可能按依赖图并发构建彼此独立的 workspace package;这是 pnpm 调度器控制的正常行为,与“手工并行多个顶层 build”不是一回事。
125
+
109
126
  ## 快速上手(推荐:通过模板创建运行时工作区)
110
127
 
111
128
  ```bash
@@ -1,4 +1,12 @@
1
- import type { LanguageCode } from './shared/types/language';
1
+ /**
2
+ * Module: access-control
3
+ *
4
+ * Directory/file-extension based access control helpers:
5
+ * - `matchesPattern` for glob-like directory scope matching (supports `*` and `**`)
6
+ * - `hasReadAccess`/`hasWriteAccess` to evaluate member permissions
7
+ * - `getAccessDeniedMessage` to format denial responses
8
+ */
9
+ import type { LanguageCode } from '@longrun-ai/kernel/types/language';
2
10
  import { Team } from './team';
3
11
  /**
4
12
  * Directory-specific pattern matching for access control.
@@ -7,14 +7,6 @@ exports.matchesPattern = matchesPattern;
7
7
  exports.hasReadAccess = hasReadAccess;
8
8
  exports.hasWriteAccess = hasWriteAccess;
9
9
  exports.getAccessDeniedMessage = getAccessDeniedMessage;
10
- /**
11
- * Module: access-control
12
- *
13
- * Directory/file-extension based access control helpers:
14
- * - `matchesPattern` for glob-like directory scope matching (supports `*` and `**`)
15
- * - `hasReadAccess`/`hasWriteAccess` to evaluate member permissions
16
- * - `getAccessDeniedMessage` to format denial responses
17
- */
18
10
  const path_1 = __importDefault(require("path"));
19
11
  const log_1 = require("./log");
20
12
  function isEncapsulatedTaskPath(targetPath) {
@@ -1,4 +1,4 @@
1
- import type { DomindsAppInstallJsonV1 } from './app-json';
1
+ import type { DomindsAppInstallJsonV1 } from '@longrun-ai/kernel/app-json';
2
2
  import type { AppsResolutionEntry } from './resolution-file';
3
3
  export type AssignedPortResolutionReason = 'no_frontend' | 'kept_existing' | 'selected_default' | 'allocated_stable_range' | 'reassigned_from_existing_conflict' | 'reassigned_from_existing_unbindable';
4
4
  export type AssignedPortResolution = Readonly<{
@@ -1,4 +1,4 @@
1
- import type { I18nText } from '../shared/types/i18n';
1
+ import type { I18nText } from '@longrun-ai/kernel/types/i18n';
2
2
  export type AppDialogRunControlMeta = Readonly<{
3
3
  appId: string;
4
4
  descriptionI18n?: I18nText;
@@ -1,4 +1,4 @@
1
- import type { DomindsAppInstallJsonV1 } from './app-json';
1
+ import { type DomindsAppInstallJsonV1 } from '@longrun-ai/kernel/app-json';
2
2
  export type AppsResolutionSchemaVersion = 1;
3
3
  export type AppsResolutionSource = Readonly<{
4
4
  kind: 'npx';
@@ -15,7 +15,7 @@ exports.setResolvedAppAssignedPort = setResolvedAppAssignedPort;
15
15
  const promises_1 = __importDefault(require("node:fs/promises"));
16
16
  const node_path_1 = __importDefault(require("node:path"));
17
17
  const yaml_1 = __importDefault(require("yaml"));
18
- const app_json_1 = require("./app-json");
18
+ const app_json_1 = require("@longrun-ai/kernel/app-json");
19
19
  exports.APPS_RESOLUTION_REL_PATH = node_path_1.default.join('.apps', 'resolution.yaml');
20
20
  function isRecord(v) {
21
21
  return typeof v === 'object' && v !== null && !Array.isArray(v);
@@ -1,4 +1,4 @@
1
- import { type DomindsAppInstallJsonV1 } from './app-json';
1
+ import { type DomindsAppInstallJsonV1 } from '@longrun-ai/kernel/app-json';
2
2
  export declare function runDomindsAppJsonViaNpx(params: {
3
3
  spec: string;
4
4
  cwdAbs: string;
@@ -9,7 +9,7 @@ const child_process_1 = require("child_process");
9
9
  const promises_1 = __importDefault(require("fs/promises"));
10
10
  const path_1 = __importDefault(require("path"));
11
11
  const util_1 = require("util");
12
- const app_json_1 = require("./app-json");
12
+ const app_json_1 = require("@longrun-ai/kernel/app-json");
13
13
  const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
14
14
  function isRecord(v) {
15
15
  return typeof v === 'object' && v !== null && !Array.isArray(v);
@@ -1,4 +1,5 @@
1
- import type { DomindsAppRunControlContext, DomindsAppRunControlResult } from '../apps-host/app-host-contract';
1
+ import type { DomindsAppRunControlBlock, DomindsAppRunControlContext, DomindsAppRunControlResult } from '@longrun-ai/kernel/app-host-contract';
2
+ export declare function renderAppRunControlBlockForPreDrive(block: DomindsAppRunControlBlock): string;
2
3
  export declare function applyAppDialogRunControl(params: {
3
4
  controlId: string;
4
5
  payload: DomindsAppRunControlContext;
@@ -1,11 +1,48 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renderAppRunControlBlockForPreDrive = renderAppRunControlBlockForPreDrive;
3
4
  exports.applyAppDialogRunControl = applyAppDialogRunControl;
4
5
  exports.applyRegisteredAppDialogRunControls = applyRegisteredAppDialogRunControls;
5
6
  const log_1 = require("../log");
6
7
  const dialog_run_controls_1 = require("./dialog-run-controls");
7
8
  const runtime_1 = require("./runtime");
8
9
  const log = (0, log_1.createLogger)('apps-run-control');
10
+ function formatOwnerRef(block) {
11
+ const owner = block.owner;
12
+ if (owner.kind === 'human')
13
+ return 'the human approver';
14
+ return owner.memberId;
15
+ }
16
+ function formatTargetRef(block) {
17
+ return block.targetRef.title ?? block.targetRef.id;
18
+ }
19
+ function canProjectAwaitAppAction(block) {
20
+ if (block.actionClass === 'select') {
21
+ return Array.isArray(block.optionsSummary) && block.optionsSummary.length > 0;
22
+ }
23
+ return true;
24
+ }
25
+ function projectAppActionLabel(block) {
26
+ if (block.actionClass === 'input')
27
+ return 'Provide information';
28
+ if (block.actionClass === 'confirm')
29
+ return 'Confirm and continue';
30
+ return 'Choose an option';
31
+ }
32
+ function renderAppRunControlBlockForPreDrive(block) {
33
+ if (block.blockKind === 'await_members') {
34
+ const waitingList = block.waitingFor.map((entry) => entry.memberId).join(', ');
35
+ return `Blocked while waiting for ${waitingList} on ${formatTargetRef(block)}. ${block.promptSummary}`;
36
+ }
37
+ if (block.blockKind === 'await_human') {
38
+ const suffix = block.question ?? block.promptSummary;
39
+ return `Blocked: human input is required for ${formatTargetRef(block)}. ${suffix}`;
40
+ }
41
+ if (!canProjectAwaitAppAction(block)) {
42
+ return `View problem details. ${block.title}: ${block.promptSummary}`;
43
+ }
44
+ return `${projectAppActionLabel(block)} via ${formatOwnerRef(block)} for ${formatTargetRef(block)}. ${block.promptSummary}`;
45
+ }
9
46
  async function applyAppDialogRunControl(params) {
10
47
  const controlId = params.controlId.trim();
11
48
  if (controlId === '') {
@@ -19,6 +56,7 @@ async function applyAppDialogRunControl(params) {
19
56
  return await hostClient.applyRunControl(controlId, params.payload);
20
57
  }
21
58
  async function applyRegisteredAppDialogRunControls(payload) {
59
+ let recoveryAction;
22
60
  for (const control of (0, dialog_run_controls_1.listAppDialogRunControls)()) {
23
61
  let result;
24
62
  try {
@@ -42,6 +80,12 @@ async function applyRegisteredAppDialogRunControls(payload) {
42
80
  if (result.kind === 'reject') {
43
81
  return result;
44
82
  }
83
+ if (result.kind === 'block') {
84
+ return result;
85
+ }
86
+ if (recoveryAction === undefined && result.recoveryAction !== undefined) {
87
+ recoveryAction = result.recoveryAction;
88
+ }
45
89
  }
46
- return { kind: 'continue' };
90
+ return recoveryAction ? { kind: 'allow', recoveryAction } : { kind: 'allow' };
47
91
  }
@@ -1,7 +1,7 @@
1
- import type { DomindsAppHostReminderUpdateResult, DomindsAppHostToolResult, DomindsAppInstallJsonV1, DomindsAppReminderApplyRequest, DomindsAppReminderApplyResult } from '../apps/app-json';
1
+ import type { DomindsAppDynamicToolsetsContext, DomindsAppReminderOwnerApplyContext, DomindsAppReminderOwnerRenderContext, DomindsAppReminderOwnerUpdateContext, DomindsAppRunControlContext, DomindsAppRunControlResult } from '@longrun-ai/kernel/app-host-contract';
2
+ import type { DomindsAppHostReminderUpdateResult, DomindsAppHostToolResult, DomindsAppInstallJsonV1, DomindsAppReminderApplyRequest, DomindsAppReminderApplyResult } from '@longrun-ai/kernel/app-json';
2
3
  import type { ChatMessage } from '../llm/client';
3
4
  import type { ToolArguments } from '../tool';
4
- import type { DomindsAppDynamicToolsetsContext, DomindsAppReminderOwnerApplyContext, DomindsAppReminderOwnerRenderContext, DomindsAppReminderOwnerUpdateContext, DomindsAppRunControlContext, DomindsAppRunControlResult } from './app-host-contract';
5
5
  import type { AppsHostMessageToKernel } from './ipc-types';
6
6
  export type EnabledAppForHost = Readonly<{
7
7
  appId: string;
@@ -100,6 +100,22 @@ function parseMessageToKernel(v) {
100
100
  const callId = asString(v['callId']);
101
101
  if (!callId)
102
102
  throw new Error('Invalid run_control_result message: callId required');
103
+ const ok = v['ok'];
104
+ if (ok === true) {
105
+ return {
106
+ type,
107
+ callId,
108
+ ok: true,
109
+ result: v['result'],
110
+ };
111
+ }
112
+ if (ok === false) {
113
+ const errorText = asString(v['errorText']);
114
+ if (!errorText) {
115
+ throw new Error('Invalid run_control_result message: errorText required when ok=false');
116
+ }
117
+ return { type, callId, ok: false, errorText };
118
+ }
103
119
  return v;
104
120
  }
105
121
  throw new Error(`Invalid IPC message from apps-host: unknown type '${type}'`);
@@ -298,12 +298,100 @@ function validateHostInstance(host, appId) {
298
298
  function isValidRunControlResult(result) {
299
299
  if (!isRecord(result))
300
300
  return false;
301
+ if (result['kind'] === 'allow') {
302
+ const recoveryAction = result['recoveryAction'];
303
+ if (recoveryAction === undefined)
304
+ return true;
305
+ if (!isRecord(recoveryAction))
306
+ return false;
307
+ return (recoveryAction['actionId'] === 'continue' &&
308
+ typeof recoveryAction['promptSummary'] === 'string' &&
309
+ recoveryAction['promptSummary'].trim() !== '');
310
+ }
301
311
  if (result['kind'] === 'reject') {
302
312
  return typeof result['errorText'] === 'string' && result['errorText'].trim() !== '';
303
313
  }
304
- if (result['kind'] !== 'continue')
314
+ if (result['kind'] !== 'block')
305
315
  return false;
306
- return true;
316
+ return isValidRunControlBlock(result['block']);
317
+ }
318
+ function isValidRunControlBlock(block) {
319
+ if (!isRecord(block))
320
+ return false;
321
+ if (!isValidRunControlOwner(block['owner']))
322
+ return false;
323
+ if (!isValidRunControlTargetRef(block['targetRef']))
324
+ return false;
325
+ if (typeof block['title'] !== 'string' || block['title'].trim() === '')
326
+ return false;
327
+ if (typeof block['promptSummary'] !== 'string' || block['promptSummary'].trim() === '') {
328
+ return false;
329
+ }
330
+ if (block['blockKind'] === 'await_members') {
331
+ return isValidRunControlMemberRefs(block['waitingFor']) && block['waitingFor'].length > 0;
332
+ }
333
+ if (block['blockKind'] === 'await_human') {
334
+ const question = block['question'];
335
+ const optionsSummary = block['optionsSummary'];
336
+ if (question !== undefined && (typeof question !== 'string' || question.trim() === ''))
337
+ return false;
338
+ return optionsSummary === undefined || isStringArray(optionsSummary);
339
+ }
340
+ if (block['blockKind'] === 'await_app_action') {
341
+ if (block['actionClass'] !== 'input' &&
342
+ block['actionClass'] !== 'select' &&
343
+ block['actionClass'] !== 'confirm') {
344
+ return false;
345
+ }
346
+ if (typeof block['actionId'] !== 'string' || block['actionId'].trim() === '')
347
+ return false;
348
+ if (block['resolutionMode'] !== 'explicit_continue' &&
349
+ block['resolutionMode'] !== 'auto_resume') {
350
+ return false;
351
+ }
352
+ return block['optionsSummary'] === undefined || isStringArray(block['optionsSummary']);
353
+ }
354
+ return false;
355
+ }
356
+ function isValidRunControlOwner(owner) {
357
+ if (!isRecord(owner))
358
+ return false;
359
+ if (owner['kind'] === 'human')
360
+ return true;
361
+ if (owner['kind'] !== 'member')
362
+ return false;
363
+ if (typeof owner['memberId'] !== 'string' || owner['memberId'].trim() === '')
364
+ return false;
365
+ return owner['roleIds'] === undefined || isStringArray(owner['roleIds']);
366
+ }
367
+ function isValidRunControlTargetRef(targetRef) {
368
+ if (!isRecord(targetRef))
369
+ return false;
370
+ const kind = targetRef['kind'];
371
+ if (kind !== 'taskdoc' &&
372
+ kind !== 'phase' &&
373
+ kind !== 'gate' &&
374
+ kind !== 'change' &&
375
+ kind !== 'role' &&
376
+ kind !== 'member') {
377
+ return false;
378
+ }
379
+ if (typeof targetRef['id'] !== 'string' || targetRef['id'].trim() === '')
380
+ return false;
381
+ if (targetRef['title'] === undefined)
382
+ return true;
383
+ return typeof targetRef['title'] === 'string' && targetRef['title'].trim() !== '';
384
+ }
385
+ function isValidRunControlMemberRefs(value) {
386
+ if (!Array.isArray(value))
387
+ return false;
388
+ return value.every((entry) => {
389
+ if (!isRecord(entry))
390
+ return false;
391
+ if (typeof entry['memberId'] !== 'string' || entry['memberId'].trim() === '')
392
+ return false;
393
+ return entry['roleIds'] === undefined || isStringArray(entry['roleIds']);
394
+ });
307
395
  }
308
396
  async function initOnce(msg) {
309
397
  for (const app of msg.apps) {
@@ -1,6 +1,7 @@
1
- import type { DomindsAppDialogReminderRequestBatch, DomindsAppHostReminderUpdateResult, DomindsAppInstallJsonV1, DomindsAppReminderApplyRequest, DomindsAppReminderApplyResult, DomindsAppReminderState } from '../apps/app-json';
1
+ import type { DomindsAppRunControlResult } from '@longrun-ai/kernel/app-host-contract';
2
+ import type { DomindsAppDialogReminderRequestBatch, DomindsAppHostReminderUpdateResult, DomindsAppInstallJsonV1, DomindsAppReminderApplyRequest, DomindsAppReminderApplyResult, DomindsAppReminderState } from '@longrun-ai/kernel/app-json';
3
+ import type { LanguageCode } from '@longrun-ai/kernel/types/language';
2
4
  import type { ChatMessage } from '../llm/client';
3
- import type { LanguageCode } from '../shared/types/language';
4
5
  import type { ToolArguments, ToolCallOutput } from '../tool';
5
6
  export type AppsHostKernelInitMessage = Readonly<{
6
7
  type: 'init';
@@ -180,12 +181,7 @@ export type AppsHostRunControlResultMessage = Readonly<{
180
181
  callId: string;
181
182
  } & (Readonly<{
182
183
  ok: true;
183
- result: Readonly<{
184
- kind: 'continue';
185
- }> | Readonly<{
186
- kind: 'reject';
187
- errorText: string;
188
- }>;
184
+ result: DomindsAppRunControlResult;
189
185
  }> | Readonly<{
190
186
  ok: false;
191
187
  errorText: string;
@@ -1,4 +1,4 @@
1
+ import type { LanguageCode } from '@longrun-ai/kernel/types/language';
1
2
  import type { Dialog } from './dialog';
2
- import type { LanguageCode } from './shared/types/language';
3
3
  export declare function buildClearedMindInvalidationNotice(language: LanguageCode): string;
4
4
  export declare function notifyWaitingDialogsOfClearedMind(dialog: Dialog): Promise<number>;
@@ -15,10 +15,10 @@
15
15
  * - Broadcasting is optional: when configured, display-state updates are pushed to all WS clients
16
16
  * so multi-tab views converge without polling.
17
17
  */
18
+ import type { DialogDisplayState, DialogInterruptionReason } from '@longrun-ai/kernel/types/display-state';
19
+ import type { DialogExecutionMarker } from '@longrun-ai/kernel/types/storage';
20
+ import type { WebSocketMessage } from '@longrun-ai/kernel/types/wire';
18
21
  import { DialogID, type Dialog } from './dialog';
19
- import type { DialogDisplayState, DialogInterruptionReason } from './shared/types/display-state';
20
- import type { DialogExecutionMarker } from './shared/types/storage';
21
- import type { WebSocketMessage } from './shared/types/wire';
22
22
  type StopRequestedReason = 'user_stop' | 'emergency_stop';
23
23
  export type RunControlCountsSnapshot = {
24
24
  proceeding: number;
@@ -1,4 +1,4 @@
1
- import type { DialogStatusKind } from './shared/types/wire';
1
+ import type { DialogStatusKind } from '@longrun-ai/kernel/types/wire';
2
2
  type ForkDialogAction = Readonly<{
3
3
  kind: 'draft_user_text';
4
4
  userText: string;
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.forkRootDialogTreeAtGeneration = forkRootDialogTreeAtGeneration;
7
7
  const promises_1 = __importDefault(require("node:fs/promises"));
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
+ const storage_1 = require("@longrun-ai/kernel/types/storage");
9
10
  const dialog_1 = require("./dialog");
10
11
  const persistence_1 = require("./persistence");
11
- const storage_1 = require("./shared/types/storage");
12
12
  const time_1 = require("./shared/utils/time");
13
13
  const id_1 = require("./utils/id");
14
14
  const FORK_BASELINE_ANCHOR = (0, storage_1.toRootGenerationAnchor)({
package/dist/dialog.d.ts CHANGED
@@ -1,9 +1,23 @@
1
+ /**
2
+ * Module: dialog
3
+ *
4
+ * Provides the `Dialog` object for orchestrating conversations:
5
+ * - Tracks messages, agent identity, optional supdialog/subdialog relationships
6
+ * - Receivers for streaming LLM output and tool results
7
+ * - Helpers for spawning subdialogs and prompting human input
8
+ * - Persistence support for dialog state and message history
9
+ *
10
+ * Architecture (Phase 2):
11
+ * - `Dialog` - Abstract base class for all dialogs
12
+ * - `RootDialog` - Root dialog with subdialog registry
13
+ * - `SubDialog` - Subdialog with root dialog reference and dynamic supdialog resolution
14
+ */
15
+ import type { ContextHealthSnapshot } from '@longrun-ai/kernel/types/context-health';
16
+ import type { DialogEvent, ReminderContent, WebSearchCallAction } from '@longrun-ai/kernel/types/dialog';
17
+ import type { DialogPrompt, DialogRunControlSpec, DialogSubdialogReplyTarget, DriveIntent } from '@longrun-ai/kernel/types/drive-intent';
18
+ import type { LanguageCode } from '@longrun-ai/kernel/types/language';
19
+ import type { CalleeCourseNumber, CalleeGenerationSeqNumber, CallingCourseNumber, DialogMetadataFile, HumanQuestion, ProviderData, ReasoningPayload, ToolArguments as StoredToolArguments } from '@longrun-ai/kernel/types/storage';
1
20
  import { ChatMessage, FuncResultMsg } from './llm/client';
2
- import type { ContextHealthSnapshot } from './shared/types/context-health';
3
- import type { DialogEvent, ReminderContent, WebSearchCallAction } from './shared/types/dialog';
4
- import type { DialogPrompt, DialogRunControlSpec, DialogSubdialogReplyTarget, DriveIntent } from './shared/types/drive-intent';
5
- import type { LanguageCode } from './shared/types/language';
6
- import type { CalleeCourseNumber, CalleeGenerationSeqNumber, CallingCourseNumber, DialogMetadataFile, HumanQuestion, ProviderData, ReasoningPayload, ToolArguments as StoredToolArguments } from './shared/types/storage';
7
21
  import type { JsonValue } from './tool';
8
22
  import { Reminder, ReminderOptions, ReminderOwner } from './tool';
9
23
  type NewCourseHookResult = {
@@ -30,6 +44,9 @@ type NewCourseHook = (args: {
30
44
  prompt: DialogPrompt;
31
45
  runControl?: DialogRunControlSpec;
32
46
  }) => Promise<NewCourseHookResult>;
47
+ export type DialogSuspensionStatusOptions = Readonly<{
48
+ allowPendingSubdialogs?: boolean;
49
+ }>;
33
50
  export declare class DialogID {
34
51
  readonly selfId: string;
35
52
  readonly rootId: string;
@@ -196,13 +213,14 @@ export declare abstract class Dialog {
196
213
  /**
197
214
  * Check if dialog can be driven (not suspended for Q4H or subdialogs).
198
215
  */
199
- canDrive(): Promise<boolean>;
216
+ canDrive(options?: DialogSuspensionStatusOptions): Promise<boolean>;
200
217
  /**
201
218
  * Get suspension status for logging/debugging.
202
219
  */
203
- getSuspensionStatus(): Promise<{
220
+ getSuspensionStatus(options?: DialogSuspensionStatusOptions): Promise<{
204
221
  q4h: boolean;
205
222
  subdialogs: boolean;
223
+ blockingSubdialogs: boolean;
206
224
  canDrive: boolean;
207
225
  }>;
208
226
  get pendingSubdialogIds(): ReadonlyArray<DialogID>;
package/dist/dialog.js CHANGED
@@ -1,53 +1,6 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.DialogStore = exports.RootDialog = exports.SubDialog = exports.Dialog = exports.DialogID = void 0;
37
- /**
38
- * Module: dialog
39
- *
40
- * Provides the `Dialog` object for orchestrating conversations:
41
- * - Tracks messages, agent identity, optional supdialog/subdialog relationships
42
- * - Receivers for streaming LLM output and tool results
43
- * - Helpers for spawning subdialogs and prompting human input
44
- * - Persistence support for dialog state and message history
45
- *
46
- * Architecture (Phase 2):
47
- * - `Dialog` - Abstract base class for all dialogs
48
- * - `RootDialog` - Root dialog with subdialog registry
49
- * - `SubDialog` - Subdialog with root dialog reference and dynamic supdialog resolution
50
- */
51
4
  const util_1 = require("util");
52
5
  const evt_registry_1 = require("./evt-registry");
53
6
  const log_1 = require("./log");
@@ -314,21 +267,22 @@ class Dialog {
314
267
  /**
315
268
  * Check if dialog can be driven (not suspended for Q4H or subdialogs).
316
269
  */
317
- async canDrive() {
318
- const hasQ4H = await this.hasPendingQ4H();
319
- const hasSubdialogs = await this.hasPendingSubdialogs();
320
- return !hasQ4H && !hasSubdialogs;
270
+ async canDrive(options) {
271
+ const suspension = await this.getSuspensionStatus(options);
272
+ return suspension.canDrive;
321
273
  }
322
274
  /**
323
275
  * Get suspension status for logging/debugging.
324
276
  */
325
- async getSuspensionStatus() {
277
+ async getSuspensionStatus(options) {
326
278
  const hasQ4H = await this.hasPendingQ4H();
327
279
  const hasSubdialogs = await this.hasPendingSubdialogs();
280
+ const blockingSubdialogs = hasSubdialogs && options?.allowPendingSubdialogs !== true;
328
281
  return {
329
282
  q4h: hasQ4H,
330
283
  subdialogs: hasSubdialogs,
331
- canDrive: !hasQ4H && !hasSubdialogs,
284
+ blockingSubdialogs,
285
+ canDrive: !hasQ4H && !blockingSubdialogs,
332
286
  };
333
287
  }
334
288
  get pendingSubdialogIds() {
@@ -851,8 +805,6 @@ class Dialog {
851
805
  runControl: runControlSpec,
852
806
  });
853
807
  }
854
- const { notifyWaitingDialogsOfClearedMind } = await Promise.resolve().then(() => __importStar(require('./course-transition')));
855
- await notifyWaitingDialogsOfClearedMind(this);
856
808
  }
857
809
  // Proxy methods for DialogStore - route calls through dialog object instead of direct dlgStore access
858
810
  async receiveFuncResult(result) {
@@ -248,6 +248,49 @@ If the root manifest / team config uses the wrong app id (for example, still dec
248
248
 
249
249
  So even without `<rtws>/.apps/configuration.yaml` or `<rtws>/.apps/resolution.yaml`, as long as `.minds/app.yaml` declares dependencies, the kernel still resolves local apps via the default strategy; if the root manifest has no dependencies, the effective enabled apps set is empty.
250
250
 
251
+ ### `phase-gate` first slice: frozen decisions
252
+
253
+ The following frozen decisions exist to let `phase-gate` become the first recommended TypeScript app without prematurely turning the whole change-governance space into a generic engine. The goal here is to freeze the smallest set of boundaries that would otherwise keep churning kernel contracts, host projection, product recovery actions, and user-facing copy.
254
+
255
+ This first slice only covers a single change moving through `intake -> routing -> advancement`, plus the two high-value product states `blocked` and `exception in progress`. The only loops included for the first slice are `blocking follow-up`, `exception handling`, and `rollback/recovery`. The first-slice object model stays limited to `change dossier`, `governance decision`, `recovery action`, and `route context`.
256
+
257
+ #### `Routing` must produce required governance semantics
258
+
259
+ - `Routing` is not merely “record that the change entered the flow”. It must produce the minimum business truth needed for later governance.
260
+ - For the first slice, that truth must include at least:
261
+ - the current governance intensity (for example large/medium/small, or an equivalent tiering),
262
+ - the responsibility boundary (who may continue by default, and who has blocking/approval authority),
263
+ - whether the default advancement path is allowed.
264
+ - These semantics should live inside the existing `route context + governance decision` surface. Do not introduce a fifth first-slice object just to carry them.
265
+ - Once the flow enters `exception in progress`, the decision must also carry scope, time limit, approving responsibility, and compensating action(s); otherwise a constrained exception degrades into an ungoverned bypass.
266
+
267
+ #### Minimal formal input contract for `pre-drive decision -> host projection`
268
+
269
+ - The key first-slice contract is not “push app-private vocabulary into kernel”. It is to freeze how an app expresses whether the host may continue driving.
270
+ - The target direction should widen the current `continue | reject` shape into a formal surface that can express `allow / reject / block`; and for now `block` should carry only mechanism-level orchestration primitives such as `await_members`, `await_human`, and `await_app_action`.
271
+ - For `await_app_action`, the app must provide at least the following stable fields before the host may project it into a product-level recovery action:
272
+ - `actionClass`
273
+ - `actionId`
274
+ - `owner`
275
+ - `resolutionMode`
276
+ - `targetRef`
277
+ - enough target/summary material such as `title`, `promptSummary`, and, for `select`, `optionsSummary`
278
+ - Admission responsibility belongs to host projection: the app provides structured material; the host decides whether the material is sufficient for a concrete recovery action or must be uniformly downgraded to the fallback diagnostic path.
279
+ - This contract should be frozen before implementation starts. `dominds/packages/kernel/src/app-host-contract.ts` still exposes `DomindsAppRunControlResult` as only `continue | reject`, while existing `phase-gate` contract tests already depend on richer blocked / primary-action structures. That gap is the current hard blocker.
280
+
281
+ #### `Resume advancement` is a product action, not an implicit state jump
282
+
283
+ - The first slice must expose one explicit, product-level recovery action: `resume advancement`.
284
+ - The reason is simple: `blocking follow-up`, `exception handling`, and `rollback/recovery` only cover “handle the abnormal condition first”. They do not answer “how does the user clearly re-enter the main path once the abnormal condition is resolved?”
285
+ - So after follow-up is completed, an exception is granted/closed, or recovery finishes, host projection must be able to surface a clear “you may now resume advancement” action, instead of hiding that step inside a silent state transition or an implementation detail.
286
+
287
+ #### Unified fallback label: `View problem details`
288
+
289
+ - When the app does not provide enough structured material to form a concrete recovery action, the product layer must not surface hollow action classes or implementation placeholders. It should uniformly downgrade to the `inspect_problem` path.
290
+ - The default external label for that path is now fixed as: `View problem details`.
291
+ - Internal identifiers such as `inspect_problem`, `select`, `confirm`, `input`, `driver`, `wiring`, and `host adapter` should not appear in user-facing primary sentences by default.
292
+ - If implementation keeps internal names such as `input`, the projected user copy should still say something like “Provide information” or “Fill in information”, not the raw internal identifier.
293
+
251
294
  ## App-provided `.minds/**` assets
252
295
 
253
296
  ### Asset types and goals