dominds 1.3.1 → 1.4.2
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.
- package/README.md +9 -2
- package/README.zh.md +9 -2
- package/dist/apps/app-lock-file.js +33 -57
- package/dist/apps/configuration-file.js +267 -0
- package/dist/apps/enabled-apps.js +217 -252
- package/dist/apps/manifest.js +132 -0
- package/dist/apps/resolution-file.js +80 -192
- package/dist/apps/workspace-app-state.js +8 -0
- package/dist/cli/disable.js +18 -22
- package/dist/cli/enable.js +20 -58
- package/dist/cli/install.js +74 -80
- package/dist/cli/uninstall.js +48 -25
- package/dist/cli/update.js +36 -80
- package/dist/docs/app-constitution.md +12 -7
- package/dist/docs/app-constitution.zh.md +13 -8
- package/dist/llm/kernel-driver/engine.js +10 -4
- package/dist/llm/kernel-driver/flow.js +93 -0
- package/dist/llm/kernel-driver/loop.js +4 -1
- package/dist/llm/kernel-driver/subdialog.js +5 -1
- package/dist/llm/kernel-driver/tellask-special.js +48 -6
- package/dist/server/server-core.js +19 -4
- package/dist/server/websocket-handler.js +26 -6
- package/dist/static/assets/{_basePickBy-CmziIRM9.js → _basePickBy-B2o4z1Hf.js} +3 -3
- package/dist/static/assets/{_basePickBy-CmziIRM9.js.map → _basePickBy-B2o4z1Hf.js.map} +1 -1
- package/dist/static/assets/{_baseUniq-CgDZxcD0.js → _baseUniq-CLmcxjdl.js} +2 -2
- package/dist/static/assets/{_baseUniq-CgDZxcD0.js.map → _baseUniq-CLmcxjdl.js.map} +1 -1
- package/dist/static/assets/{arc-Df9rjNNk.js → arc-CymD_KN7.js} +2 -2
- package/dist/static/assets/{arc-Df9rjNNk.js.map → arc-CymD_KN7.js.map} +1 -1
- package/dist/static/assets/{architectureDiagram-VXUJARFQ-Bif8topC.js → architectureDiagram-VXUJARFQ-DJQfSJUH.js} +7 -7
- package/dist/static/assets/{architectureDiagram-VXUJARFQ-Bif8topC.js.map → architectureDiagram-VXUJARFQ-DJQfSJUH.js.map} +1 -1
- package/dist/static/assets/{blockDiagram-VD42YOAC-D9Egoflr.js → blockDiagram-VD42YOAC-pHVz60D0.js} +7 -7
- package/dist/static/assets/{blockDiagram-VD42YOAC-D9Egoflr.js.map → blockDiagram-VD42YOAC-pHVz60D0.js.map} +1 -1
- package/dist/static/assets/{c4Diagram-YG6GDRKO-DBf1NeBf.js → c4Diagram-YG6GDRKO-B0WnCfAT.js} +3 -3
- package/dist/static/assets/{c4Diagram-YG6GDRKO-DBf1NeBf.js.map → c4Diagram-YG6GDRKO-B0WnCfAT.js.map} +1 -1
- package/dist/static/assets/{channel-Dc34yAJl.js → channel-CX9BlKil.js} +2 -2
- package/dist/static/assets/{channel-Dc34yAJl.js.map → channel-CX9BlKil.js.map} +1 -1
- package/dist/static/assets/{chunk-4BX2VUAB-B65G1dJI.js → chunk-4BX2VUAB-lXArRj3o.js} +2 -2
- package/dist/static/assets/{chunk-4BX2VUAB-B65G1dJI.js.map → chunk-4BX2VUAB-lXArRj3o.js.map} +1 -1
- package/dist/static/assets/{chunk-55IACEB6-CSDEOGl2.js → chunk-55IACEB6-CdqwynH9.js} +2 -2
- package/dist/static/assets/{chunk-55IACEB6-CSDEOGl2.js.map → chunk-55IACEB6-CdqwynH9.js.map} +1 -1
- package/dist/static/assets/{chunk-B4BG7PRW-Cb6W3QWJ.js → chunk-B4BG7PRW-Y-uXcJst.js} +5 -5
- package/dist/static/assets/{chunk-B4BG7PRW-Cb6W3QWJ.js.map → chunk-B4BG7PRW-Y-uXcJst.js.map} +1 -1
- package/dist/static/assets/{chunk-DI55MBZ5-ZAJWeVWH.js → chunk-DI55MBZ5-C5xSbRST.js} +4 -4
- package/dist/static/assets/{chunk-DI55MBZ5-ZAJWeVWH.js.map → chunk-DI55MBZ5-C5xSbRST.js.map} +1 -1
- package/dist/static/assets/{chunk-FMBD7UC4-DiwRlImb.js → chunk-FMBD7UC4-5uefwCjI.js} +2 -2
- package/dist/static/assets/{chunk-FMBD7UC4-DiwRlImb.js.map → chunk-FMBD7UC4-5uefwCjI.js.map} +1 -1
- package/dist/static/assets/{chunk-QN33PNHL-wilj7fb5.js → chunk-QN33PNHL-DzWVcvpI.js} +2 -2
- package/dist/static/assets/{chunk-QN33PNHL-wilj7fb5.js.map → chunk-QN33PNHL-DzWVcvpI.js.map} +1 -1
- package/dist/static/assets/{chunk-QZHKN3VN-DGmviJfR.js → chunk-QZHKN3VN-BrrvAZdP.js} +2 -2
- package/dist/static/assets/{chunk-QZHKN3VN-DGmviJfR.js.map → chunk-QZHKN3VN-BrrvAZdP.js.map} +1 -1
- package/dist/static/assets/{chunk-TZMSLE5B-Nm5wTXa_.js → chunk-TZMSLE5B-DyKOlPTY.js} +2 -2
- package/dist/static/assets/{chunk-TZMSLE5B-Nm5wTXa_.js.map → chunk-TZMSLE5B-DyKOlPTY.js.map} +1 -1
- package/dist/static/assets/{classDiagram-2ON5EDUG-BvUbXD6H.js → classDiagram-2ON5EDUG-FCrnlCWC.js} +6 -6
- package/dist/static/assets/{classDiagram-2ON5EDUG-BvUbXD6H.js.map → classDiagram-2ON5EDUG-FCrnlCWC.js.map} +1 -1
- package/dist/static/assets/{classDiagram-v2-WZHVMYZB-BvUbXD6H.js → classDiagram-v2-WZHVMYZB-FCrnlCWC.js} +6 -6
- package/dist/static/assets/{classDiagram-v2-WZHVMYZB-BvUbXD6H.js.map → classDiagram-v2-WZHVMYZB-FCrnlCWC.js.map} +1 -1
- package/dist/static/assets/{clone-0VLS7GaA.js → clone-BlI81KqZ.js} +2 -2
- package/dist/static/assets/{clone-0VLS7GaA.js.map → clone-BlI81KqZ.js.map} +1 -1
- package/dist/static/assets/{cose-bilkent-S5V4N54A-anaPs-75.js → cose-bilkent-S5V4N54A-yM7S2atz.js} +2 -2
- package/dist/static/assets/{cose-bilkent-S5V4N54A-anaPs-75.js.map → cose-bilkent-S5V4N54A-yM7S2atz.js.map} +1 -1
- package/dist/static/assets/{dagre-6UL2VRFP-YwdsZ11r.js → dagre-6UL2VRFP-BcweuZHt.js} +7 -7
- package/dist/static/assets/{dagre-6UL2VRFP-YwdsZ11r.js.map → dagre-6UL2VRFP-BcweuZHt.js.map} +1 -1
- package/dist/static/assets/{diagram-PSM6KHXK-5KQCf3h2.js → diagram-PSM6KHXK-D4-QwLW1.js} +8 -8
- package/dist/static/assets/{diagram-PSM6KHXK-5KQCf3h2.js.map → diagram-PSM6KHXK-D4-QwLW1.js.map} +1 -1
- package/dist/static/assets/{diagram-QEK2KX5R-Mf24XxZL.js → diagram-QEK2KX5R-BVbuejJn.js} +7 -7
- package/dist/static/assets/{diagram-QEK2KX5R-Mf24XxZL.js.map → diagram-QEK2KX5R-BVbuejJn.js.map} +1 -1
- package/dist/static/assets/{diagram-S2PKOQOG-DyQjD4D5.js → diagram-S2PKOQOG-pB6N6Tq_.js} +7 -7
- package/dist/static/assets/{diagram-S2PKOQOG-DyQjD4D5.js.map → diagram-S2PKOQOG-pB6N6Tq_.js.map} +1 -1
- package/dist/static/assets/{erDiagram-Q2GNP2WA-CEzTKw1u.js → erDiagram-Q2GNP2WA-DLKmthuw.js} +5 -5
- package/dist/static/assets/{erDiagram-Q2GNP2WA-CEzTKw1u.js.map → erDiagram-Q2GNP2WA-DLKmthuw.js.map} +1 -1
- package/dist/static/assets/{flowDiagram-NV44I4VS-DT821XSz.js → flowDiagram-NV44I4VS-BsBhWukh.js} +6 -6
- package/dist/static/assets/{flowDiagram-NV44I4VS-DT821XSz.js.map → flowDiagram-NV44I4VS-BsBhWukh.js.map} +1 -1
- package/dist/static/assets/{ganttDiagram-JELNMOA3-DlmeVsGg.js → ganttDiagram-JELNMOA3-Debz-J-C.js} +3 -3
- package/dist/static/assets/{ganttDiagram-JELNMOA3-DlmeVsGg.js.map → ganttDiagram-JELNMOA3-Debz-J-C.js.map} +1 -1
- package/dist/static/assets/{gitGraphDiagram-V2S2FVAM-yAfyBG_d.js → gitGraphDiagram-V2S2FVAM-BnAPFBGR.js} +8 -8
- package/dist/static/assets/{gitGraphDiagram-V2S2FVAM-yAfyBG_d.js.map → gitGraphDiagram-V2S2FVAM-BnAPFBGR.js.map} +1 -1
- package/dist/static/assets/{graph-BYv8vyWe.js → graph-DbzWiBNK.js} +3 -3
- package/dist/static/assets/{graph-BYv8vyWe.js.map → graph-DbzWiBNK.js.map} +1 -1
- package/dist/static/assets/{index-DMbwqOm6.js → index-B-8J28g7.js} +987 -1049
- package/dist/static/assets/index-B-8J28g7.js.map +1 -0
- package/dist/static/assets/{index-BiNcBn_U.css → index-CD5wtC_i.css} +1 -1
- package/dist/static/assets/{infoDiagram-HS3SLOUP-DaadramQ.js → infoDiagram-HS3SLOUP-CZ5hWoxV.js} +6 -6
- package/dist/static/assets/{infoDiagram-HS3SLOUP-DaadramQ.js.map → infoDiagram-HS3SLOUP-CZ5hWoxV.js.map} +1 -1
- package/dist/static/assets/{journeyDiagram-XKPGCS4Q-ftN8hxu3.js → journeyDiagram-XKPGCS4Q-CKN3oSxk.js} +5 -5
- package/dist/static/assets/{journeyDiagram-XKPGCS4Q-ftN8hxu3.js.map → journeyDiagram-XKPGCS4Q-CKN3oSxk.js.map} +1 -1
- package/dist/static/assets/{kanban-definition-3W4ZIXB7-BIXETQ-C.js → kanban-definition-3W4ZIXB7-BQCMklfJ.js} +3 -3
- package/dist/static/assets/{kanban-definition-3W4ZIXB7-BIXETQ-C.js.map → kanban-definition-3W4ZIXB7-BQCMklfJ.js.map} +1 -1
- package/dist/static/assets/{layout-OTbrj0Ye.js → layout-C5B58szc.js} +5 -5
- package/dist/static/assets/{layout-OTbrj0Ye.js.map → layout-C5B58szc.js.map} +1 -1
- package/dist/static/assets/{linear-CVfOC669.js → linear-_32fut6G.js} +2 -2
- package/dist/static/assets/{linear-CVfOC669.js.map → linear-_32fut6G.js.map} +1 -1
- package/dist/static/assets/{mindmap-definition-VGOIOE7T-D2zv5uI9.js → mindmap-definition-VGOIOE7T-C_goMzjx.js} +4 -4
- package/dist/static/assets/{mindmap-definition-VGOIOE7T-D2zv5uI9.js.map → mindmap-definition-VGOIOE7T-C_goMzjx.js.map} +1 -1
- package/dist/static/assets/{pieDiagram-ADFJNKIX-DaUXTsv7.js → pieDiagram-ADFJNKIX-BQ2n0cOB.js} +8 -8
- package/dist/static/assets/{pieDiagram-ADFJNKIX-DaUXTsv7.js.map → pieDiagram-ADFJNKIX-BQ2n0cOB.js.map} +1 -1
- package/dist/static/assets/{quadrantDiagram-AYHSOK5B-B7O2wPX9.js → quadrantDiagram-AYHSOK5B-BLg7_neg.js} +3 -3
- package/dist/static/assets/{quadrantDiagram-AYHSOK5B-B7O2wPX9.js.map → quadrantDiagram-AYHSOK5B-BLg7_neg.js.map} +1 -1
- package/dist/static/assets/{requirementDiagram-UZGBJVZJ-DpauVPY1.js → requirementDiagram-UZGBJVZJ-DwkJt0zi.js} +4 -4
- package/dist/static/assets/{requirementDiagram-UZGBJVZJ-DpauVPY1.js.map → requirementDiagram-UZGBJVZJ-DwkJt0zi.js.map} +1 -1
- package/dist/static/assets/{sankeyDiagram-TZEHDZUN-B3Hbfvad.js → sankeyDiagram-TZEHDZUN-DmxmatUB.js} +2 -2
- package/dist/static/assets/{sankeyDiagram-TZEHDZUN-B3Hbfvad.js.map → sankeyDiagram-TZEHDZUN-DmxmatUB.js.map} +1 -1
- package/dist/static/assets/{sequenceDiagram-WL72ISMW-KdbWByWT.js → sequenceDiagram-WL72ISMW-KHU_eApU.js} +4 -4
- package/dist/static/assets/{sequenceDiagram-WL72ISMW-KdbWByWT.js.map → sequenceDiagram-WL72ISMW-KHU_eApU.js.map} +1 -1
- package/dist/static/assets/{stateDiagram-FKZM4ZOC-yDOCVezC.js → stateDiagram-FKZM4ZOC-B3DBCxAL.js} +9 -9
- package/dist/static/assets/{stateDiagram-FKZM4ZOC-yDOCVezC.js.map → stateDiagram-FKZM4ZOC-B3DBCxAL.js.map} +1 -1
- package/dist/static/assets/{stateDiagram-v2-4FDKWEC3-CpCJhvQO.js → stateDiagram-v2-4FDKWEC3-C-uIk7gh.js} +5 -5
- package/dist/static/assets/{stateDiagram-v2-4FDKWEC3-CpCJhvQO.js.map → stateDiagram-v2-4FDKWEC3-C-uIk7gh.js.map} +1 -1
- package/dist/static/assets/{timeline-definition-IT6M3QCI-CHxuEjhV.js → timeline-definition-IT6M3QCI-SysEcQCC.js} +3 -3
- package/dist/static/assets/{timeline-definition-IT6M3QCI-CHxuEjhV.js.map → timeline-definition-IT6M3QCI-SysEcQCC.js.map} +1 -1
- package/dist/static/assets/{treemap-GDKQZRPO-Bsqu3wIy.js → treemap-GDKQZRPO-d0AbKEc4.js} +5 -5
- package/dist/static/assets/{treemap-GDKQZRPO-Bsqu3wIy.js.map → treemap-GDKQZRPO-d0AbKEc4.js.map} +1 -1
- package/dist/static/assets/{xychartDiagram-PRI3JC2R-RZy33lFF.js → xychartDiagram-PRI3JC2R-CmSQMxUh.js} +3 -3
- package/dist/static/assets/{xychartDiagram-PRI3JC2R-RZy33lFF.js.map → xychartDiagram-PRI3JC2R-CmSQMxUh.js.map} +1 -1
- package/dist/static/index.html +2 -2
- package/dist/tools/fs.js +1 -1
- package/package.json +9 -7
- package/dist/agent-priming.js +0 -2051
- package/dist/apps/installed-file.js +0 -207
- package/dist/apps/runtime-port.js +0 -91
- package/dist/docs/dominds-agent-priming.md +0 -218
- package/dist/docs/dominds-agent-priming.zh.md +0 -196
- package/dist/docs/drive-logic-context-refactor-plan.zh.md +0 -338
- package/dist/docs/keep-going.md +0 -176
- package/dist/docs/keep-going.zh.md +0 -162
- package/dist/docs/kernel-app-architecture.md +0 -286
- package/dist/docs/kernel-app-architecture.zh.md +0 -285
- package/dist/docs/showing-by-doing.md +0 -208
- package/dist/docs/showing-by-doing.zh.md +0 -177
- package/dist/docs/team-mgmt-toolset.md +0 -482
- package/dist/docs/team-mgmt-toolset.zh.md +0 -426
- package/dist/llm/driver-entry.js +0 -28
- package/dist/llm/driver-v2/context-health.js +0 -121
- package/dist/llm/driver-v2/context.js +0 -56
- package/dist/llm/driver-v2/core.js +0 -1545
- package/dist/llm/driver-v2/index.js +0 -26
- package/dist/llm/driver-v2/orchestrator.js +0 -158
- package/dist/llm/driver-v2/policy.js +0 -129
- package/dist/llm/driver-v2/restore-dialog-hierarchy.js +0 -73
- package/dist/llm/driver-v2/round.js +0 -366
- package/dist/llm/driver-v2/runtime-utils.js +0 -365
- package/dist/llm/driver-v2/saying-events.js +0 -20
- package/dist/llm/driver-v2/subdialog-txn.js +0 -42
- package/dist/llm/driver-v2/supdialog-response.js +0 -400
- package/dist/llm/driver-v2/tellask-bridge.js +0 -1148
- package/dist/llm/driver-v2/types.js +0 -10
- package/dist/llm/driver-v2-ref-only/context-health.js +0 -121
- package/dist/llm/driver-v2-ref-only/context.js +0 -17
- package/dist/llm/driver-v2-ref-only/core.js +0 -1710
- package/dist/llm/driver-v2-ref-only/index.js +0 -26
- package/dist/llm/driver-v2-ref-only/orchestrator.js +0 -158
- package/dist/llm/driver-v2-ref-only/policy.js +0 -129
- package/dist/llm/driver-v2-ref-only/restore-dialog-hierarchy.js +0 -73
- package/dist/llm/driver-v2-ref-only/round.js +0 -366
- package/dist/llm/driver-v2-ref-only/runtime-utils.js +0 -473
- package/dist/llm/driver-v2-ref-only/saying-events.js +0 -18
- package/dist/llm/driver-v2-ref-only/subdialog-txn.js +0 -42
- package/dist/llm/driver-v2-ref-only/supdialog-response.js +0 -453
- package/dist/llm/driver-v2-ref-only/tellask-bridge.js +0 -1178
- package/dist/llm/driver-v2-ref-only/types.js +0 -10
- package/dist/llm/driver.js +0 -4093
- package/dist/minds/promptdocs.js +0 -263
- package/dist/server/prompts-routes.js +0 -545
- package/dist/shared/team-mgmt-manual.js +0 -120
- package/dist/shared/types/prompts.js +0 -2
- package/dist/shared/types/tellask.js +0 -8
- package/dist/showing-by-doing.js +0 -1091
- package/dist/snippets/README.en.md +0 -3
- package/dist/snippets/README.md +0 -4
- package/dist/static/assets/index-DMbwqOm6.js.map +0 -1
- package/dist/tellask.js +0 -439
- package/dist/tools/context-health.js +0 -177
- package/dist/tools/diag.js +0 -583
- package/dist/tools/prompts/memory/en/errors.md +0 -155
- package/dist/tools/prompts/memory/en/index.md +0 -47
- package/dist/tools/prompts/memory/en/principles.md +0 -87
- package/dist/tools/prompts/memory/en/scenarios.md +0 -174
- package/dist/tools/prompts/memory/en/tools.md +0 -129
- package/dist/tools/prompts/memory/zh/errors.md +0 -155
- package/dist/tools/prompts/memory/zh/index.md +0 -47
- package/dist/tools/prompts/memory/zh/principles.md +0 -89
- package/dist/tools/prompts/memory/zh/scenarios.md +0 -174
- package/dist/tools/prompts/memory/zh/tools.md +0 -129
- package/dist/tools/team-mgmt.js +0 -3487
- package/dist/utils/task-doc.js +0 -236
package/dist/docs/keep-going.md
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
# Keep-Going (Diligence Auto-Continue) — Design Doc
|
|
2
|
-
|
|
3
|
-
## Summary
|
|
4
|
-
|
|
5
|
-
Dominds root dialogs are intended for long-run operation. A root dialog “stopping” (becoming idle)
|
|
6
|
-
is often not what operators want: they want the agent to keep pushing forward until it either:
|
|
7
|
-
|
|
8
|
-
- legitimately suspends for a human decision (Q4H), or
|
|
9
|
-
- legitimately suspends waiting for subdialogs (tellask/backfill).
|
|
10
|
-
|
|
11
|
-
This document specifies a runtime mechanism (“keep-going”) that, for **root/main dialogs only**,
|
|
12
|
-
prevents the dialog from stopping: whenever the driver would otherwise stop, it auto-sends a short
|
|
13
|
-
diligence prompt (rendered as a normal user bubble) and continues generation, except when the dialog
|
|
14
|
-
is legitimately suspended (Q4H or pending subdialogs).
|
|
15
|
-
|
|
16
|
-
## Goals
|
|
17
|
-
|
|
18
|
-
- Prevent root dialogs from stopping except for legitimate suspension states (Q4H / subdialogs).
|
|
19
|
-
- Keep behavior predictable and bounded (no infinite loops).
|
|
20
|
-
- Make the nudge text configurable per workspace (rtws) and language.
|
|
21
|
-
- Provide a clear, user-controlled “disable” mechanism.
|
|
22
|
-
|
|
23
|
-
## Non-goals
|
|
24
|
-
|
|
25
|
-
- Auto-completing / auto-marking a dialog as done.
|
|
26
|
-
- Applying this behavior to subdialogs (subdialogs remain scoped and should report back to their caller).
|
|
27
|
-
|
|
28
|
-
## Definitions
|
|
29
|
-
|
|
30
|
-
- **Root/main dialog**: a `RootDialog` (`dlg.id.rootId === dlg.id.selfId`), the primary conversation thread.
|
|
31
|
-
- **Subdialog**: a `SubDialog`, created for tellask / scoped work.
|
|
32
|
-
- **Q4H**: “Questions for Human”, initiated via `!?@human`, which suspends dialog progression until the human responds.
|
|
33
|
-
|
|
34
|
-
## Expected “normal” completion path (recommended)
|
|
35
|
-
|
|
36
|
-
When the agent needs a human decision to conclude (e.g., confirm a choice or decide whether to mark the dialog done), the correct path is:
|
|
37
|
-
|
|
38
|
-
1. The agent issues a Q4H (`!?@human`) with the necessary context and explicit decision request.
|
|
39
|
-
2. The WebUI surfaces the Q4H clearly.
|
|
40
|
-
3. The human decides and either:
|
|
41
|
-
- marks the root dialog “done” manually, or
|
|
42
|
-
- provides the requested info so the dialog can proceed.
|
|
43
|
-
|
|
44
|
-
This is the “controlled convergence” path. The keep-going mechanism should **not** override legitimate suspension states.
|
|
45
|
-
|
|
46
|
-
## Keep-going behavior (“auto-continue” fallback)
|
|
47
|
-
|
|
48
|
-
### Trigger conditions (must all hold)
|
|
49
|
-
|
|
50
|
-
- Dialog is the **root/main dialog** (never for subdialogs).
|
|
51
|
-
- Dialog is **not suspended**:
|
|
52
|
-
- no pending Q4H, and
|
|
53
|
-
- no pending subdialogs (waiting for backfill).
|
|
54
|
-
- The driver would otherwise stop the generation loop (i.e., no tool/function outputs require another iteration).
|
|
55
|
-
|
|
56
|
-
### Action
|
|
57
|
-
|
|
58
|
-
The runtime auto-sends a diligence prompt (rendered as a normal user bubble) and runs another
|
|
59
|
-
generation iteration.
|
|
60
|
-
|
|
61
|
-
### Boundedness
|
|
62
|
-
|
|
63
|
-
To avoid infinite loops, keep-going has a per-dialog budget (per-member `diligence-push-max`) that controls
|
|
64
|
-
how many auto-continued diligence prompts can be injected for a given dialog before the runtime forces a
|
|
65
|
-
Q4H suspension.
|
|
66
|
-
|
|
67
|
-
- Default: **3**
|
|
68
|
-
- If `< 1`, keep-going is effectively disabled for that member
|
|
69
|
-
- Configurable per-member via `diligence-push-max` in `.minds/team.yaml`
|
|
70
|
-
|
|
71
|
-
### Reset on Q4H
|
|
72
|
-
|
|
73
|
-
When a dialog becomes suspended due to a pending Q4H (Questions for Human), the keep-going injection
|
|
74
|
-
counter is reset. This ensures that after the human answers the Q4H and the dialog is resumed, the
|
|
75
|
-
dialog gets a fresh keep-going budget again.
|
|
76
|
-
|
|
77
|
-
### Budget exhausted → force Q4H
|
|
78
|
-
|
|
79
|
-
When the keep-going budget is exhausted, the runtime creates a Q4H entry that asks the human whether
|
|
80
|
-
to continue or stop. This converts “boundedness” into a legitimate suspension point and avoids
|
|
81
|
-
infinite auto-continue loops.
|
|
82
|
-
|
|
83
|
-
### Disable switch
|
|
84
|
-
|
|
85
|
-
Keep-going can be disabled per-rtws in either of these ways:
|
|
86
|
-
|
|
87
|
-
- If the selected diligence file exists but its content is empty/whitespace, keep-going is disabled (no injection).
|
|
88
|
-
|
|
89
|
-
Keep-going can be disabled per-member in either of these ways:
|
|
90
|
-
|
|
91
|
-
- If `diligence-push-max < 1`, keep-going is disabled for that member (no injection).
|
|
92
|
-
|
|
93
|
-
## Diligence prompt resolution
|
|
94
|
-
|
|
95
|
-
Let `<rtws>` be the current runtime workspace (i.e., `process.cwd()`).
|
|
96
|
-
|
|
97
|
-
Resolution order:
|
|
98
|
-
|
|
99
|
-
1. `<rtws>/.minds/diligence.<work-lang-id>.md` (e.g., `diligence.zh.md`)
|
|
100
|
-
2. `<rtws>/.minds/diligence.md` (language-agnostic fallback)
|
|
101
|
-
3. Built-in fallback text (hardcoded i18n; `zh` is canonical and embedded in source)
|
|
102
|
-
|
|
103
|
-
If the first existing file in the above order has empty/whitespace content, **disable** keep-going.
|
|
104
|
-
|
|
105
|
-
Note: YAML frontmatter in diligence files is **ignored** by the runtime. If present, it is treated as
|
|
106
|
-
non-content metadata and stripped from the prompt body.
|
|
107
|
-
|
|
108
|
-
### Team member cap: `diligence-push-max`
|
|
109
|
-
|
|
110
|
-
Each team member can optionally cap keep-going via `.minds/team.yaml`:
|
|
111
|
-
|
|
112
|
-
```yaml
|
|
113
|
-
members:
|
|
114
|
-
alice:
|
|
115
|
-
diligence-push-max: 10
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Rules:
|
|
119
|
-
|
|
120
|
-
- If missing, `diligence-push-max` defaults to **3** for that member.
|
|
121
|
-
- If `diligence-push-max < 1`, keep-going is disabled for that member (no injection), even if the diligence file exists.
|
|
122
|
-
- Built-in shadow members `fuxi` and `pangu` default to `diligence-push-max: 0` unless explicitly overridden in team.yaml.
|
|
123
|
-
|
|
124
|
-
## UX notes
|
|
125
|
-
|
|
126
|
-
- Keep-going is a runtime-only nudge, but it should be **visible**: the diligence prompt is rendered
|
|
127
|
-
as a normal user message bubble (auto-sent by the runtime) so operators can understand why an
|
|
128
|
-
extra iteration occurred.
|
|
129
|
-
- Users should observe that the agent continues with a brief follow-up after tool-only operations.
|
|
130
|
-
- When the agent truly needs user intervention, it should use Q4H. Keep-going should not try to “fake” completion.
|
|
131
|
-
|
|
132
|
-
## Implementation (backend)
|
|
133
|
-
|
|
134
|
-
### Where
|
|
135
|
-
|
|
136
|
-
Implemented in the LLM driver loop (`dominds/main/llm/driver.ts`) as a small post-iteration check:
|
|
137
|
-
|
|
138
|
-
1. If `suspendForHuman` is true, stop (Q4H / subdialog pending).
|
|
139
|
-
2. If there is any tool feedback, continue normally.
|
|
140
|
-
3. Otherwise (root only), attempt keep-going auto-continue:
|
|
141
|
-
- If disabled → stop normally.
|
|
142
|
-
- If budget exhausted → create Q4H and stop.
|
|
143
|
-
- Else → auto-send diligence prompt and continue.
|
|
144
|
-
|
|
145
|
-
### Message type
|
|
146
|
-
|
|
147
|
-
We inject the diligence prompt as an auto-sent user message:
|
|
148
|
-
|
|
149
|
-
- `ChatMessage` of type `prompting_msg` with `role: 'user'`
|
|
150
|
-
|
|
151
|
-
This ensures:
|
|
152
|
-
|
|
153
|
-
- It is present in the model context
|
|
154
|
-
- It is persisted as a human message record
|
|
155
|
-
- It renders in the chat timeline as a normal user bubble (like any other user message)
|
|
156
|
-
|
|
157
|
-
## Observability
|
|
158
|
-
|
|
159
|
-
Recommended follow-ups (not required for initial implementation):
|
|
160
|
-
|
|
161
|
-
- Add a structured log line when keep-going is triggered, including:
|
|
162
|
-
- dialog id
|
|
163
|
-
- language
|
|
164
|
-
- which diligence source was used (lang-specific / generic / built-in / disabled)
|
|
165
|
-
- Optional metrics counter for “keep-going triggered” and “keep-going disabled by empty file”.
|
|
166
|
-
|
|
167
|
-
## Testing
|
|
168
|
-
|
|
169
|
-
Regression tests should cover:
|
|
170
|
-
|
|
171
|
-
- Root dialog: tool-only output → diligence injection → continued response
|
|
172
|
-
- Root dialog: empty assistant output → diligence injection → continued response
|
|
173
|
-
- Subdialog: no diligence injection
|
|
174
|
-
- Workspace config:
|
|
175
|
-
- `.minds/diligence.md` is honored when lang-specific file is absent
|
|
176
|
-
- empty diligence file disables keep-going
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
# Keep-Going(鞭策)— 设计文档
|
|
2
|
-
|
|
3
|
-
## 概述
|
|
4
|
-
|
|
5
|
-
Dominds 根对话旨在长期运行。根对话"停止"(变为空闲)通常不是操作员想要的:他们希望智能体持续推进,直到:
|
|
6
|
-
|
|
7
|
-
- 合法地暂停等待人类决策(Q4H),或
|
|
8
|
-
- 合法地暂停等待子对话(tellask/backfill)。
|
|
9
|
-
|
|
10
|
-
本文档指定了一个运行时机制("keep-going"),仅针对**根/主对话**,防止对话停止:每当驱动程序即将停止时,它会自动发送一个简短的鞭策语(渲染为正常的用户气泡)并继续生成,除非对话处于合法暂停状态(Q4H 或待处理的子对话)。
|
|
11
|
-
|
|
12
|
-
## 目标
|
|
13
|
-
|
|
14
|
-
- 防止根对话停止,除非处于合法暂停状态(Q4H / 子对话)。
|
|
15
|
-
- 保持行为可预测和有界(无无限循环)。
|
|
16
|
-
- 使鞭策语文本可按工作区(rtws)和语言配置。
|
|
17
|
-
- 提供清晰的用户控制的"禁用"机制。
|
|
18
|
-
|
|
19
|
-
## 非目标
|
|
20
|
-
|
|
21
|
-
- 自动完成/自动将对话标记为完成。
|
|
22
|
-
- 将此行为应用于子对话(子对话保持范围,应向其调用者报告)。
|
|
23
|
-
|
|
24
|
-
## 定义
|
|
25
|
-
|
|
26
|
-
- **根/主对话**:`RootDialog`(`dlg.id.rootId === dlg.id.selfId`),主要对话线程。
|
|
27
|
-
- **子对话**:`SubDialog`,为 tellask / 作用域工作创建。
|
|
28
|
-
- **Q4H**:"Questions for Human",通过 `!?@human` 发起,暂停对话进度直到人类响应。
|
|
29
|
-
|
|
30
|
-
## 预期的"正常"完成路径(推荐)
|
|
31
|
-
|
|
32
|
-
当智能体需要人类决策来结束时(例如,确认选择或决定是否将对话标记为完成),正确的路径是:
|
|
33
|
-
|
|
34
|
-
1. 智能体发出 Q4H(`!?@human`)并提供必要的上下文和明确的决策请求。
|
|
35
|
-
2. WebUI 清楚地呈现 Q4H。
|
|
36
|
-
3. 人类决定并:
|
|
37
|
-
- 手动将根对话标记为"完成",或
|
|
38
|
-
- 提供请求的信息以便对话继续。
|
|
39
|
-
|
|
40
|
-
这是"受控收敛"路径。keep-going 机制不应覆盖合法的暂停状态。
|
|
41
|
-
|
|
42
|
-
## Keep-Going 行为("自动继续"回退)
|
|
43
|
-
|
|
44
|
-
### 触发条件(必须全部满足)
|
|
45
|
-
|
|
46
|
-
- 对话是**根/主对话**(绝不会是子对话)。
|
|
47
|
-
- 对话**未暂停**:
|
|
48
|
-
- 没有待处理的 Q4H,并且
|
|
49
|
-
- 没有待处理的子对话(等待回填)。
|
|
50
|
-
- 驱动程序即将停止生成循环(即没有工具/函数输出需要另一次迭代)。
|
|
51
|
-
|
|
52
|
-
### 操作
|
|
53
|
-
|
|
54
|
-
运行时自动发送一个鞭策语(渲染为正常的用户气泡)并运行另一次生成迭代。
|
|
55
|
-
|
|
56
|
-
### 有界性
|
|
57
|
-
|
|
58
|
-
为避免无限循环,keep-going 有一个按对话的预算(每个成员的 `diligence-push-max`),控制对于给定对话在运行时强制 Q4H 暂停之前可以注入多少个自动继续的鞭策语。
|
|
59
|
-
|
|
60
|
-
- 默认值:**3**
|
|
61
|
-
- 如果 `< 1`,则该成员的 keep-going 有效禁用
|
|
62
|
-
- 可通过 `.minds/team.yaml` 中的 `diligence-push-max` 按成员配置
|
|
63
|
-
|
|
64
|
-
### Q4H 时重置
|
|
65
|
-
|
|
66
|
-
当对话因待处理的 Q4H(Questions for Human)而暂停时,keep-going 注入计数器会被重置。这确保在人类回答 Q4H 并恢复对话后,对话会获得新的 keep-going 预算。
|
|
67
|
-
|
|
68
|
-
### 预算耗尽 → 强制 Q4H
|
|
69
|
-
|
|
70
|
-
当 keep-going 预算耗尽时,运行时会创建一个 Q4H 条目,询问人类是否继续或停止。这将"有界性"转换为合法的暂停点,并避免无限自动继续循环。
|
|
71
|
-
|
|
72
|
-
### 禁用开关
|
|
73
|
-
|
|
74
|
-
可以通过以下任一方式按 rtws 禁用 keep-going:
|
|
75
|
-
|
|
76
|
-
- 如果选中的鞭策语文件存在但其内容为空/仅空白,则禁用 keep-going(不注入)。
|
|
77
|
-
|
|
78
|
-
可以通过以下任一方式按成员禁用 keep-going:
|
|
79
|
-
|
|
80
|
-
- 如果 `diligence-push-max < 1`,则该成员的 keep-going 被禁用(不注入)。
|
|
81
|
-
|
|
82
|
-
## 鞭策语解析
|
|
83
|
-
|
|
84
|
-
让 `<rtws>` 为当前运行时工作区(即 `process.cwd()`)。
|
|
85
|
-
|
|
86
|
-
解析顺序:
|
|
87
|
-
|
|
88
|
-
1. `<rtws>/.minds/diligence.<work-lang-id>.md`(例如,`diligence.zh.md`)
|
|
89
|
-
2. `<rtws>/.minds/diligence.md`(语言无关的回退)
|
|
90
|
-
3. 内置回退文本(硬编码的 i18n;`zh` 是规范的并嵌入在源代码中)
|
|
91
|
-
|
|
92
|
-
如果上述顺序中第一个存在的文件具有空/空白内容,则**禁用** keep-going。
|
|
93
|
-
|
|
94
|
-
注意:鞭策语文件中的 YAML frontmatter 会被运行时忽略。如果存在,它被视为非内容元数据并从提示正文中剥离。
|
|
95
|
-
|
|
96
|
-
### 团队成员上限:`diligence-push-max`
|
|
97
|
-
|
|
98
|
-
每个团队成员可以选择通过 `.minds/team.yaml` 限制 keep-going:
|
|
99
|
-
|
|
100
|
-
```yaml
|
|
101
|
-
members:
|
|
102
|
-
alice:
|
|
103
|
-
diligence-push-max: 10
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
规则:
|
|
107
|
-
|
|
108
|
-
- 如果缺失,`diligence-push-max` 对于该成员默认为 **3**。
|
|
109
|
-
- 如果 `diligence-push-max < 1`,则该成员的 keep-going 被禁用(不注入),即使鞭策语文件存在。
|
|
110
|
-
- 内置影子成员 `fuxi` 和 `pangu` 默认为 `diligence-push-max: 0`,除非在 team.yaml 中显式覆盖。
|
|
111
|
-
|
|
112
|
-
## UX 备注
|
|
113
|
-
|
|
114
|
-
- Keep-going 是一个仅运行时的提示,但它应该是**可见的**:鞭策语渲染为正常的用户消息气泡(由运行时自动发送),以便操作员理解为什么会出现额外的迭代。
|
|
115
|
-
- 用户应该观察到智能体在仅工具操作后继续简短的跟进。
|
|
116
|
-
- 当智能体真正需要用户干预时,它应该使用 Q4H。Keep-going 不应试图"假装"完成。
|
|
117
|
-
|
|
118
|
-
## 实现(后端)
|
|
119
|
-
|
|
120
|
-
### 位置
|
|
121
|
-
|
|
122
|
-
在 LLM 驱动程序循环中实现(`dominds/main/llm/driver.ts`),作为迭代后的小检查:
|
|
123
|
-
|
|
124
|
-
1. 如果 `suspendForHuman` 为 true,则停止(Q4H / 子对话待处理)。
|
|
125
|
-
2. 如果有任何工具反馈,则正常继续。
|
|
126
|
-
3. 否则(仅限根),尝试 keep-going 自动继续:
|
|
127
|
-
- 如果禁用 → 正常停止。
|
|
128
|
-
- 如果预算耗尽 → 创建 Q4H 并停止。
|
|
129
|
-
- 否则 → 自动发送鞭策语并继续。
|
|
130
|
-
|
|
131
|
-
### 消息类型
|
|
132
|
-
|
|
133
|
-
我们将鞭策语作为自动发送的用户消息注入:
|
|
134
|
-
|
|
135
|
-
- 类型为 `prompting_msg`、角色为 `'user'` 的 `ChatMessage`
|
|
136
|
-
|
|
137
|
-
这确保了:
|
|
138
|
-
|
|
139
|
-
- 它存在于模型上下文中
|
|
140
|
-
- 它作为人类消息记录持久化
|
|
141
|
-
- 它在聊天时间线中渲染为正常的用户气泡(像任何其他用户消息一样)
|
|
142
|
-
|
|
143
|
-
## 可观察性
|
|
144
|
-
|
|
145
|
-
建议的后续步骤(初始实现不需要):
|
|
146
|
-
|
|
147
|
-
- 当触发 keep-going 时添加结构化日志行,包括:
|
|
148
|
-
- 对话 id
|
|
149
|
-
- 语言
|
|
150
|
-
- 使用的鞭策语来源(语言特定/通用/内置/禁用)
|
|
151
|
-
- 为"keep-going 触发"和"keep-going 因空文件禁用"添加可选的指标计数器。
|
|
152
|
-
|
|
153
|
-
## 测试
|
|
154
|
-
|
|
155
|
-
回归测试应覆盖:
|
|
156
|
-
|
|
157
|
-
- 根对话:仅工具输出 → 鞭策语注入 → 继续响应
|
|
158
|
-
- 根对话:空助手输出 → 鞭策语注入 → 继续响应
|
|
159
|
-
- 子对话:无鞭策语注入
|
|
160
|
-
- 工作区配置:
|
|
161
|
-
- 当语言特定文件缺失时,`.minds/diligence.md` 被遵守
|
|
162
|
-
- 空的鞭策语文件禁用 keep-going
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
# Kernel–App Architecture (Prototype v0.1)
|
|
2
|
-
|
|
3
|
-
Chinese version: [中文版](./kernel-app-architecture.zh.md)
|
|
4
|
-
|
|
5
|
-
## Scope and Goals
|
|
6
|
-
|
|
7
|
-
This document describes the Kernel–App separation prototype in Dominds, covering:
|
|
8
|
-
|
|
9
|
-
- Two-level namespace (kernel outer / app inner) and resolution rules
|
|
10
|
-
- App install json (`app --json`) extensions
|
|
11
|
-
- Export/import semantics and conflict handling
|
|
12
|
-
- App defunc semantics
|
|
13
|
-
- App integration manual (`app_integration_manual`)
|
|
14
|
-
- App language policy (work/ui language and i18n)
|
|
15
|
-
- Incremental override DSL for `<rtws>/.apps/<app-id>/team.yaml`
|
|
16
|
-
|
|
17
|
-
The prototype code is used for **concept and functional validation**. This document is the main artifact for “driving the integrated plan forward” (stable reference for implementation/migration/review).
|
|
18
|
-
|
|
19
|
-
## Non-goals
|
|
20
|
-
|
|
21
|
-
- No protocol/schema versioning or compatibility strategy before 2.x
|
|
22
|
-
- No sandbox isolation before 2.x
|
|
23
|
-
- Run-control expansion is out of scope (will be specified in a dedicated doc)
|
|
24
|
-
|
|
25
|
-
## Core Concepts
|
|
26
|
-
|
|
27
|
-
- Kernel registry stays in the current Dominds state; built-in capabilities will gradually move out to apps.
|
|
28
|
-
- Each app owns its own registry, **local-first, same-name override allowed**.
|
|
29
|
-
- Apps do not register objects into the kernel registry.
|
|
30
|
-
- Apps are isolated from each other; exchange only via explicit export/import.
|
|
31
|
-
|
|
32
|
-
## Identity and Resolution
|
|
33
|
-
|
|
34
|
-
### Namespaces
|
|
35
|
-
|
|
36
|
-
- Two-level scope: `kernel` and `app`.
|
|
37
|
-
- For runtime resolution, short IDs (e.g. `toolsetId`, `memberId`, `toolName`) follow current kernel conventions.
|
|
38
|
-
- For logs/diagnostics/Problems/docs, we need a stable, source-qualified identifier, so we introduce **Qualified Id** (display/diagnostics only; not forced into the wire protocol):
|
|
39
|
-
- `kernel:<name>`
|
|
40
|
-
- `app:<appId>:<name>`
|
|
41
|
-
|
|
42
|
-
### Resolution order (inside an app)
|
|
43
|
-
|
|
44
|
-
For any resolution request (tool/toolset/member), the order is fixed:
|
|
45
|
-
|
|
46
|
-
1. `local(app)` (app self-registered + imported objects)
|
|
47
|
-
2. `kernel`
|
|
48
|
-
|
|
49
|
-
Notes:
|
|
50
|
-
|
|
51
|
-
- “Same-name override allowed” only applies when `local(app)` overrides `kernel`.
|
|
52
|
-
- Apps never override each other; if imports create same-name conflicts inside `local(app)`, the app becomes defunc.
|
|
53
|
-
|
|
54
|
-
## App install json (`app --json`)
|
|
55
|
-
|
|
56
|
-
Add fields to `DomindsAppInstallJsonV1`:
|
|
57
|
-
|
|
58
|
-
- `depends?: [{ appId: string; versionRange: string }]`
|
|
59
|
-
- `exports?: { members?: string[]; toolsets?: string[] }`
|
|
60
|
-
|
|
61
|
-
Rules:
|
|
62
|
-
|
|
63
|
-
- Empty `exports` means nothing is importable.
|
|
64
|
-
- `exports` only lists **single member / single toolset** IDs (fixed granularity).
|
|
65
|
-
- `exports` may list multiple objects, but the minimal import unit is fixed to **a single member / a single toolset** (each import points to exactly one ID).
|
|
66
|
-
- Exported members must come from `contributes.teammatesYamlRelPath`.
|
|
67
|
-
- Exported toolsets must come from `contributes.toolsets`.
|
|
68
|
-
|
|
69
|
-
## Registry and Resolution
|
|
70
|
-
|
|
71
|
-
- App resolution order: **local(app) → kernel**.
|
|
72
|
-
- Apps do not override each other; import conflicts put the app into defunc.
|
|
73
|
-
- Kernel registry never receives app objects, so there is no removal from kernel registry.
|
|
74
|
-
- A defunc app does not participate in resolution (but its objects are not “removed”, since they never entered the kernel registry).
|
|
75
|
-
|
|
76
|
-
## Export / Import Semantics
|
|
77
|
-
|
|
78
|
-
### Export
|
|
79
|
-
|
|
80
|
-
- Declared by `exports` in app install json.
|
|
81
|
-
- Kernel exposes app exports (API shape can be decided during implementation).
|
|
82
|
-
|
|
83
|
-
### Import
|
|
84
|
-
|
|
85
|
-
- **Members**: declared in app `team.yaml`.
|
|
86
|
-
- **Toolsets**: declared in app `team.yaml`; loaded via dominds API and registered into the app registry.
|
|
87
|
-
|
|
88
|
-
Suggested structure (example):
|
|
89
|
-
|
|
90
|
-
```yaml
|
|
91
|
-
imports:
|
|
92
|
-
members:
|
|
93
|
-
- app: foo_app
|
|
94
|
-
id: npc_foo
|
|
95
|
-
toolsets:
|
|
96
|
-
- app: bar_app
|
|
97
|
-
id: bar_toolset
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Conflicts and Dependency Failures
|
|
101
|
-
|
|
102
|
-
- Import conflicts or dependency failures → app defunc.
|
|
103
|
-
|
|
104
|
-
#### Conflict matrix (minimal rules)
|
|
105
|
-
|
|
106
|
-
| Case | Result |
|
|
107
|
-
| ----------------------------------------------------- | ------------------------------ |
|
|
108
|
-
| Same name in `local(app)` vs `kernel` | Allowed (local shadows kernel) |
|
|
109
|
-
| Imported member/toolset conflicts with app-local name | defunc |
|
|
110
|
-
| Imported member/toolset conflicts with another import | defunc |
|
|
111
|
-
| Import points to a non-exported object | defunc |
|
|
112
|
-
| depends not satisfied (missing/version mismatch) | defunc |
|
|
113
|
-
|
|
114
|
-
## Defunc Semantics
|
|
115
|
-
|
|
116
|
-
- Defunc means the app is unusable.
|
|
117
|
-
- No registry removal is needed (app registry is no longer used; kernel has no app objects).
|
|
118
|
-
- Defunc reason should be recorded for diagnosis.
|
|
119
|
-
|
|
120
|
-
### Defunc triggers (suggested enumeration)
|
|
121
|
-
|
|
122
|
-
- `MANIFEST_INVALID`: missing/invalid install json fields.
|
|
123
|
-
- `DEPENDENCY_MISSING` / `DEPENDENCY_VERSION_MISMATCH`: depends missing or not satisfied.
|
|
124
|
-
- `EXPORTS_INVALID`: exports references missing member/toolset.
|
|
125
|
-
- `IMPORT_NOT_EXPORTED`: import points to an object not declared in exports.
|
|
126
|
-
- `IMPORT_CONFLICT`: same-name conflicts introduced by imports.
|
|
127
|
-
- `TEAM_OVERRIDE_INVALID`: override DSL parse/validation failed for `<rtws>/.apps/<app-id>/team.yaml`.
|
|
128
|
-
- `IMPORT_FETCH_FAILED`: fetching toolset metadata via API failed or returned invalid data.
|
|
129
|
-
|
|
130
|
-
### Retry semantics (suggested)
|
|
131
|
-
|
|
132
|
-
- Defunc is **retryable by default**: once dependencies/config are fixed, kernel retries loading the app on the next refresh cycle.
|
|
133
|
-
- Retry does not mutate existing dialogs/history; it only affects future resolution/new calls.
|
|
134
|
-
|
|
135
|
-
### Observability (suggested)
|
|
136
|
-
|
|
137
|
-
- Defunc must surface in Problems (or equivalent), including at least: `appId`, `reasonKind`, `detail`, `firstSeenAt`, `lastSeenAt`, `retryable`, `suggestedAction`.
|
|
138
|
-
- `app_integration_manual` call failures **must not trigger defunc** (they should be observable but not make the app unusable).
|
|
139
|
-
|
|
140
|
-
## App Integration Manual (`app_integration_manual`)
|
|
141
|
-
|
|
142
|
-
- Kernel-fixed tool: `app_integration_manual`
|
|
143
|
-
- Params: `{ appId: string, language?: string }`
|
|
144
|
-
- If `language` is omitted, default to **work language**.
|
|
145
|
-
- Kernel routes the call to the app host via IPC.
|
|
146
|
-
- App can return static markdown or runtime-generated content.
|
|
147
|
-
- Apps must provide zh/en content.
|
|
148
|
-
- Failure does not trigger defunc (return an error is enough).
|
|
149
|
-
|
|
150
|
-
## Language Policy
|
|
151
|
-
|
|
152
|
-
- **Work language** comes from the `LANG` environment variable; kernel and app host inherit and it is immutable at runtime.
|
|
153
|
-
- Apps must follow kernel work language for reasoning/logic content.
|
|
154
|
-
- Apps may provide their own UI with a user-configurable UI language.
|
|
155
|
-
- All apps must support at least zh/en.
|
|
156
|
-
|
|
157
|
-
## Incremental Override DSL for `team.yaml`
|
|
158
|
-
|
|
159
|
-
Override file: `<rtws>/.apps/<app-id>/team.yaml`
|
|
160
|
-
|
|
161
|
-
- No `actions:` top level.
|
|
162
|
-
- Domain-specific DSL with **add/replace/modify/delete**.
|
|
163
|
-
- Each load applies actions; failures put the app into defunc.
|
|
164
|
-
|
|
165
|
-
Example:
|
|
166
|
-
|
|
167
|
-
```yaml
|
|
168
|
-
version: 1
|
|
169
|
-
|
|
170
|
-
add:
|
|
171
|
-
members:
|
|
172
|
-
- id: npc_new
|
|
173
|
-
value:
|
|
174
|
-
name: New NPC
|
|
175
|
-
toolsets: [trae_toolset]
|
|
176
|
-
|
|
177
|
-
replace:
|
|
178
|
-
members:
|
|
179
|
-
- id: npc_old
|
|
180
|
-
value:
|
|
181
|
-
name: Old NPC
|
|
182
|
-
hidden: true
|
|
183
|
-
|
|
184
|
-
modify:
|
|
185
|
-
members:
|
|
186
|
-
- id: npc_village_head
|
|
187
|
-
set:
|
|
188
|
-
toolsets: [trae_toolset, extra_toolset]
|
|
189
|
-
streaming: true
|
|
190
|
-
unset: [tools]
|
|
191
|
-
merge:
|
|
192
|
-
model_params:
|
|
193
|
-
codex:
|
|
194
|
-
temperature: 0.2
|
|
195
|
-
member_defaults:
|
|
196
|
-
set:
|
|
197
|
-
provider: codex
|
|
198
|
-
|
|
199
|
-
delete:
|
|
200
|
-
members:
|
|
201
|
-
- id: npc_removed
|
|
202
|
-
|
|
203
|
-
set_default_responder: npc_village_head
|
|
204
|
-
|
|
205
|
-
add_shell_specialist:
|
|
206
|
-
- npc_village_head
|
|
207
|
-
|
|
208
|
-
remove_shell_specialist:
|
|
209
|
-
- npc_foo
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
Rules:
|
|
213
|
-
|
|
214
|
-
- `modify_member` supports `set`/`unset`/`merge`; `merge` is a deep merge on objects.
|
|
215
|
-
- All changes must pass existing team.yaml validation.
|
|
216
|
-
- Conflicts or parse failures → app defunc.
|
|
217
|
-
|
|
218
|
-
## Suggested Load Flow
|
|
219
|
-
|
|
220
|
-
1. Resolve and register toolsets first (local toolsets + imports.toolsets), **including their tools**
|
|
221
|
-
2. Read app built-in team.yaml
|
|
222
|
-
3. Resolve imports.members
|
|
223
|
-
4. Apply `<rtws>/.apps/<app-id>/team.yaml` overrides
|
|
224
|
-
5. Validate (toolsets/tools are now resolvable)
|
|
225
|
-
6. Success → register members into app registry
|
|
226
|
-
7. Failure → app defunc
|
|
227
|
-
|
|
228
|
-
## Review Packet
|
|
229
|
-
|
|
230
|
-
This section is meant to let a reviewer validate and continue in ~30 minutes (without putting implementation details into Taskdoc progress).
|
|
231
|
-
|
|
232
|
-
### Artifacts
|
|
233
|
-
|
|
234
|
-
- Architecture (semantic source): `dominds/docs/kernel-app-architecture.zh.md`
|
|
235
|
-
- English alignment: `dominds/docs/kernel-app-architecture.md`
|
|
236
|
-
|
|
237
|
-
### Delta (recent changes)
|
|
238
|
-
|
|
239
|
-
- WebSocket driving no longer accepts `runControlId/runControlInput` (run-control expansion is intentionally split into a dedicated doc).
|
|
240
|
-
- apps-host run control result no longer supports `systemPromptPatch/prompt` (collapsed to a minimal continue/reject shape).
|
|
241
|
-
- kernel-driver context-health driving logic is aligned with driver-v2 style (prototype-stage cleanup).
|
|
242
|
-
|
|
243
|
-
### Minimal smoke (suggested)
|
|
244
|
-
|
|
245
|
-
Given this is a prototype for concept/functional validation, this smoke list focuses on ensuring recent cleanups do not break existing paths:
|
|
246
|
-
|
|
247
|
-
1. `pnpm -C dominds run lint:types` passes.
|
|
248
|
-
2. If the current rtws has enabled apps: startup initializes apps-host and registers proxy tools for each app’s `contributes.toolsets` (no name collisions).
|
|
249
|
-
3. WebUI dialog driving + Q4H answering no longer requires/sends `runControlId/runControlInput`.
|
|
250
|
-
|
|
251
|
-
## Prototype Status and Gap List
|
|
252
|
-
|
|
253
|
-
What is already present as a verifiable skeleton (facts only, not a completeness claim):
|
|
254
|
-
|
|
255
|
-
- Apps runtime + apps-host IPC infrastructure exists (forks apps-host and forwards tool calls).
|
|
256
|
-
- Proxy registration for app-declared `contributes.toolsets` exists (concept/functional validation).
|
|
257
|
-
- App-declared dialog run controls can be registered (run-control semantic expansion is out of scope here).
|
|
258
|
-
|
|
259
|
-
What is not yet closed / needs implementation-level landing points (the “status & issues” deliverable):
|
|
260
|
-
|
|
261
|
-
- `depends/exports/imports` loading/validation/conflict handling is currently mostly at the spec level; needs implementation + end-to-end verification.
|
|
262
|
-
- Defunc lifecycle state machine, Problems surfacing, retry/reload entrypoints need an implementation-closed loop (including logging/error taxonomy).
|
|
263
|
-
- `<rtws>/.apps/<app-id>/team.yaml` override DSL: read/apply/validate landing points + regression.
|
|
264
|
-
- Kernel-fixed `app_integration_manual(appId, language?)` tool + IPC routing needs implementation + regression.
|
|
265
|
-
- Migration playbook (which built-ins to migrate first, rollback strategy, dogfooding gates) should be produced in the implementation phase.
|
|
266
|
-
|
|
267
|
-
## Completion Criteria (Acceptance)
|
|
268
|
-
|
|
269
|
-
This prototype-stage “integrated plan” document can be considered complete when:
|
|
270
|
-
|
|
271
|
-
- It explicitly specifies: Identity/Resolution, defunc triggers + retry, imports/exports granularity + conflict matrix, team.yaml override DSL, and the `app_integration_manual` contract.
|
|
272
|
-
- Key rules are written as “when X happens → the system does Y”, without requiring readers to infer behavior from source.
|
|
273
|
-
- `kernel-app-architecture.zh.md` and this English version are kept consistent (zh is the semantic source of truth).
|
|
274
|
-
|
|
275
|
-
## Key Anchors (existing code)
|
|
276
|
-
|
|
277
|
-
- install json parsing: `dominds/main/apps/app-json.ts`
|
|
278
|
-
- apps runtime: `dominds/main/apps/runtime.ts`
|
|
279
|
-
- apps host contract: `dominds/main/apps-host/app-host-contract.ts`
|
|
280
|
-
- apps host IPC: `dominds/main/apps-host/ipc-types.ts`
|
|
281
|
-
- team.yaml parsing: `dominds/main/team.ts`
|
|
282
|
-
- app teammates loader: `dominds/main/apps/teammates.ts`
|
|
283
|
-
|
|
284
|
-
---
|
|
285
|
-
|
|
286
|
-
This document is a prototype-stage design draft; details may evolve during implementation.
|