dominds 1.18.2 → 1.19.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/dist/access-control.js +6 -6
- package/dist/apps/runtime.d.ts +2 -2
- package/dist/apps/runtime.js +28 -28
- package/dist/apps-host/client.d.ts +1 -1
- package/dist/apps-host/host.js +7 -7
- package/dist/apps-host/ipc-types.d.ts +2 -2
- package/dist/apps-host/ipc-types.js +10 -10
- package/dist/cli/read.d.ts +0 -1
- package/dist/cli/read.js +1 -6
- package/dist/dialog-display-state.d.ts +6 -6
- package/dist/dialog-display-state.js +46 -46
- package/dist/dialog-factory.d.ts +12 -12
- package/dist/dialog-factory.js +33 -30
- package/dist/dialog-fork.d.ts +2 -2
- package/dist/dialog-fork.js +140 -115
- package/dist/dialog-global-registry.d.ts +5 -5
- package/dist/dialog-global-registry.js +11 -11
- package/dist/dialog-instance-registry.d.ts +3 -3
- package/dist/dialog-instance-registry.js +52 -41
- package/dist/dialog.d.ts +100 -113
- package/dist/dialog.js +274 -229
- package/dist/docs/agent-priming.md +5 -5
- package/dist/docs/agent-priming.zh.md +5 -5
- package/dist/docs/app-constitution.md +1 -1
- package/dist/docs/app-constitution.zh.md +1 -1
- package/dist/docs/cli-usage.md +1 -1
- package/dist/docs/cli-usage.zh.md +1 -1
- package/dist/docs/design.md +14 -14
- package/dist/docs/design.zh.md +14 -14
- package/dist/docs/dialog-persistence.md +58 -58
- package/dist/docs/dialog-persistence.zh.md +61 -61
- package/dist/docs/dialog-system.md +363 -367
- package/dist/docs/dialog-system.zh.md +355 -357
- package/dist/docs/diligence-push.md +18 -18
- package/dist/docs/diligence-push.zh.md +17 -17
- package/dist/docs/dominds-agent-collaboration.zh.md +3 -3
- package/dist/docs/dominds-terminology.md +46 -47
- package/dist/docs/encapsulated-taskdoc.md +4 -4
- package/dist/docs/encapsulated-taskdoc.zh.md +3 -3
- package/dist/docs/fbr.md +30 -30
- package/dist/docs/fbr.zh.md +15 -15
- package/dist/docs/i18n.md +2 -2
- package/dist/docs/i18n.zh.md +2 -2
- package/dist/docs/mcp-support.md +5 -4
- package/dist/docs/mcp-support.zh.md +3 -2
- package/dist/docs/memory-system.md +4 -4
- package/dist/docs/memory-system.zh.md +1 -1
- package/dist/docs/mottos.md +1 -1
- package/dist/docs/mottos.zh.md +1 -1
- package/dist/docs/q4h.md +3 -3
- package/dist/docs/q4h.zh.md +1 -1
- package/dist/docs/roadmap.md +2 -2
- package/dist/docs/team_mgmt-toolset.md +11 -3
- package/dist/docs/team_mgmt-toolset.zh.md +9 -2
- package/dist/docs/tellask-collab.md +18 -18
- package/dist/docs/tellask-collab.zh.md +8 -8
- package/dist/docs/tellask-revive-context-refactor.zh.md +591 -0
- package/dist/evt-registry.d.ts +1 -2
- package/dist/evt-registry.js +2 -7
- package/dist/llm/gen/mock.js +9 -0
- package/dist/llm/kernel-driver/context.d.ts +1 -2
- package/dist/llm/kernel-driver/context.js +12 -26
- package/dist/llm/kernel-driver/drive.js +99 -75
- package/dist/llm/kernel-driver/engine.d.ts +2 -2
- package/dist/llm/kernel-driver/engine.js +10 -10
- package/dist/llm/kernel-driver/fbr.js +6 -6
- package/dist/llm/kernel-driver/flow.d.ts +1 -1
- package/dist/llm/kernel-driver/flow.js +129 -93
- package/dist/llm/kernel-driver/guardrails.js +4 -4
- package/dist/llm/kernel-driver/index.d.ts +1 -1
- package/dist/llm/kernel-driver/index.js +2 -2
- package/dist/llm/kernel-driver/loop.js +30 -30
- package/dist/llm/kernel-driver/reply-guidance.js +47 -52
- package/dist/llm/kernel-driver/restore.d.ts +3 -3
- package/dist/llm/kernel-driver/restore.js +23 -28
- package/dist/llm/kernel-driver/runtime.d.ts +1 -1
- package/dist/llm/kernel-driver/runtime.js +1 -1
- package/dist/llm/kernel-driver/sideDialog-txn.d.ts +8 -0
- package/dist/llm/kernel-driver/{subdialog-txn.js → sideDialog-txn.js} +13 -13
- package/dist/llm/kernel-driver/{subdialog.d.ts → sideDialog.d.ts} +13 -13
- package/dist/llm/kernel-driver/{subdialog.js → sideDialog.js} +203 -170
- package/dist/llm/kernel-driver/tellask-special.d.ts +7 -3
- package/dist/llm/kernel-driver/tellask-special.js +474 -497
- package/dist/llm/kernel-driver/types.d.ts +25 -9
- package/dist/mcp/config.d.ts +1 -0
- package/dist/mcp/config.js +7 -2
- package/dist/mcp/supervisor.d.ts +2 -0
- package/dist/mcp/supervisor.js +2 -1
- package/dist/minds/builtin/pangu/persona.en.md +4 -4
- package/dist/minds/load.js +6 -6
- package/dist/minds/system-prompt-parts.d.ts +1 -1
- package/dist/minds/system-prompt-parts.js +12 -12
- package/dist/minds/system-prompt.d.ts +1 -1
- package/dist/minds/system-prompt.js +56 -56
- package/dist/persistence-errors.d.ts +1 -1
- package/dist/persistence.d.ts +126 -121
- package/dist/persistence.js +1190 -786
- package/dist/priming.d.ts +3 -3
- package/dist/priming.js +62 -61
- package/dist/recovery/reply-special.js +5 -5
- package/dist/runtime/driver-messages.d.ts +3 -2
- package/dist/runtime/driver-messages.js +68 -57
- package/dist/runtime/inter-dialog-format.d.ts +12 -10
- package/dist/runtime/inter-dialog-format.js +80 -35
- package/dist/runtime/interjection-pause-stop.js +1 -1
- package/dist/runtime/reply-prompt-copy.d.ts +7 -3
- package/dist/runtime/reply-prompt-copy.js +39 -14
- package/dist/server/api-routes.js +87 -83
- package/dist/server/static-server.js +1 -1
- package/dist/server/websocket-handler.js +163 -153
- package/dist/tool-availability.js +1 -1
- package/dist/tools/app-reminders.js +17 -4
- package/dist/tools/ctrl.js +5 -5
- package/dist/tools/os.js +16 -16
- package/dist/tools/pending-tellask-reminder.js +20 -14
- package/dist/tools/prompts/control/en/index.md +1 -1
- package/dist/tools/prompts/control/en/principles.md +8 -8
- package/dist/tools/prompts/control/en/scenarios.md +7 -7
- package/dist/tools/prompts/control/en/tools.md +7 -7
- package/dist/tools/prompts/control/zh/principles.md +4 -4
- package/dist/tools/prompts/control/zh/scenarios.md +5 -5
- package/dist/tools/prompts/control/zh/tools.md +3 -3
- package/dist/tools/prompts/team_memory/en/scenarios.md +1 -1
- package/dist/tools/prompts/team_memory/zh/scenarios.md +1 -1
- package/dist/tools/team_mgmt-manual.js +2 -2
- package/dist/tools/team_mgmt-mcp-manual.js +10 -0
- package/dist/tools/team_mgmt.js +4 -4
- package/dist/utils/taskdoc.js +12 -12
- package/package.json +3 -3
- package/webapp/dist/assets/{_basePickBy-BPJaiZdW.js → _basePickBy-B7M9Q0Fa.js} +3 -3
- package/webapp/dist/assets/_basePickBy-B7M9Q0Fa.js.map +1 -0
- package/webapp/dist/assets/{_baseUniq-BEetT15i.js → _baseUniq-DAeYoL6j.js} +2 -2
- package/webapp/dist/assets/_baseUniq-DAeYoL6j.js.map +1 -0
- package/webapp/dist/assets/{arc-Dm7Zf36f.js → arc-Bh4nDbNR.js} +2 -2
- package/webapp/dist/assets/arc-Bh4nDbNR.js.map +1 -0
- package/webapp/dist/assets/{architectureDiagram-VXUJARFQ-BpTPtkuo.js → architectureDiagram-2XIMDMQ5-CxqmdsIm.js} +26 -8
- package/webapp/dist/assets/architectureDiagram-2XIMDMQ5-CxqmdsIm.js.map +1 -0
- package/webapp/dist/assets/{blockDiagram-VD42YOAC-C8fLN0iu.js → blockDiagram-WCTKOSBZ-CxIWLtpt.js} +187 -170
- package/webapp/dist/assets/blockDiagram-WCTKOSBZ-CxIWLtpt.js.map +1 -0
- package/webapp/dist/assets/{c4Diagram-YG6GDRKO-BpPr62CH.js → c4Diagram-IC4MRINW-1qErOIgG.js} +4 -4
- package/webapp/dist/assets/c4Diagram-IC4MRINW-1qErOIgG.js.map +1 -0
- package/webapp/dist/assets/{channel-EMYoPjW3.js → channel-DkgZHNUe.js} +2 -2
- package/webapp/dist/assets/channel-DkgZHNUe.js.map +1 -0
- package/webapp/dist/assets/{chunk-4BX2VUAB-CefNtjWG.js → chunk-4BX2VUAB-BmdMbU9v.js} +2 -2
- package/webapp/dist/assets/chunk-4BX2VUAB-BmdMbU9v.js.map +1 -0
- package/webapp/dist/assets/{chunk-55IACEB6-C_X7T43V.js → chunk-55IACEB6-D6LDTDBy.js} +2 -2
- package/webapp/dist/assets/chunk-55IACEB6-D6LDTDBy.js.map +1 -0
- package/webapp/dist/assets/{chunk-FMBD7UC4-ORmtkrtS.js → chunk-FMBD7UC4-C-BdCe4C.js} +2 -2
- package/webapp/dist/assets/chunk-FMBD7UC4-C-BdCe4C.js.map +1 -0
- package/webapp/dist/assets/{chunk-TZMSLE5B-Gao4qrq7.js → chunk-JSJVCQXG-WA_BLIm9.js} +14 -6
- package/webapp/dist/assets/chunk-JSJVCQXG-WA_BLIm9.js.map +1 -0
- package/webapp/dist/assets/{chunk-QN33PNHL-LTAOVhWu.js → chunk-KX2RTZJC-CA7sDJO5.js} +2 -2
- package/webapp/dist/assets/chunk-KX2RTZJC-CA7sDJO5.js.map +1 -0
- package/webapp/dist/assets/{chunk-DI55MBZ5-CbvrsI_w.js → chunk-NQ4KR5QH-wlvxalE3.js} +9 -7
- package/webapp/dist/assets/chunk-NQ4KR5QH-wlvxalE3.js.map +1 -0
- package/webapp/dist/assets/{chunk-QZHKN3VN-ZoUM_4u5.js → chunk-QZHKN3VN-Bo1VMcph.js} +2 -2
- package/webapp/dist/assets/chunk-QZHKN3VN-Bo1VMcph.js.map +1 -0
- package/webapp/dist/assets/{chunk-B4BG7PRW-BRe3_2oA.js → chunk-WL4C6EOR-B-Pk44be.js} +171 -121
- package/webapp/dist/assets/chunk-WL4C6EOR-B-Pk44be.js.map +1 -0
- package/webapp/dist/assets/{classDiagram-2ON5EDUG-uha1vIGN.js → classDiagram-VBA2DB6C-BqKuyb49.js} +7 -6
- package/webapp/dist/assets/classDiagram-VBA2DB6C-BqKuyb49.js.map +1 -0
- package/webapp/dist/assets/{classDiagram-v2-WZHVMYZB-uha1vIGN.js → classDiagram-v2-RAHNMMFH-BqKuyb49.js} +7 -6
- package/webapp/dist/assets/classDiagram-v2-RAHNMMFH-BqKuyb49.js.map +1 -0
- package/webapp/dist/assets/{clone-_9Ayb1Gp.js → clone-BX5z8WVZ.js} +2 -2
- package/webapp/dist/assets/clone-BX5z8WVZ.js.map +1 -0
- package/webapp/dist/assets/{cose-bilkent-S5V4N54A-C8wDw3NY.js → cose-bilkent-S5V4N54A-B-s11SgN.js} +2 -2
- package/webapp/dist/assets/cose-bilkent-S5V4N54A-B-s11SgN.js.map +1 -0
- package/webapp/dist/assets/cytoscape.esm-Bm8DJGmZ.js.map +1 -1
- package/webapp/dist/assets/{dagre-6UL2VRFP-BUSeNot0.js → dagre-KLK3FWXG-DmQFV2qK.js} +7 -7
- package/webapp/dist/assets/dagre-KLK3FWXG-DmQFV2qK.js.map +1 -0
- package/webapp/dist/assets/defaultLocale-B2RvLBDe.js.map +1 -1
- package/webapp/dist/assets/{diagram-PSM6KHXK-CMZAksVC.js → diagram-E7M64L7V-QRaBfST8.js} +10 -10
- package/webapp/dist/assets/diagram-E7M64L7V-QRaBfST8.js.map +1 -0
- package/webapp/dist/assets/{diagram-QEK2KX5R-BQKoRtwy.js → diagram-IFDJBPK2-lrWn1Obo.js} +9 -8
- package/webapp/dist/assets/diagram-IFDJBPK2-lrWn1Obo.js.map +1 -0
- package/webapp/dist/assets/{diagram-S2PKOQOG-DjMG97kd.js → diagram-P4PSJMXO-sTU7Hh-Y.js} +8 -8
- package/webapp/dist/assets/diagram-P4PSJMXO-sTU7Hh-Y.js.map +1 -0
- package/webapp/dist/assets/{erDiagram-Q2GNP2WA-BujwA137.js → erDiagram-INFDFZHY-Cx6jc9Wq.js} +96 -75
- package/webapp/dist/assets/erDiagram-INFDFZHY-Cx6jc9Wq.js.map +1 -0
- package/webapp/dist/assets/{flowDiagram-NV44I4VS-DgwPjg4y.js → flowDiagram-PKNHOUZH-DfGI49Dz.js} +98 -81
- package/webapp/dist/assets/flowDiagram-PKNHOUZH-DfGI49Dz.js.map +1 -0
- package/webapp/dist/assets/{ganttDiagram-JELNMOA3-Db2ykf3E.js → ganttDiagram-A5KZAMGK-nrcHWWaM.js} +28 -3
- package/webapp/dist/assets/ganttDiagram-A5KZAMGK-nrcHWWaM.js.map +1 -0
- package/webapp/dist/assets/{gitGraphDiagram-V2S2FVAM-D_gSifkv.js → gitGraphDiagram-K3NZZRJ6-D8ivAqd6.js} +38 -46
- package/webapp/dist/assets/gitGraphDiagram-K3NZZRJ6-D8ivAqd6.js.map +1 -0
- package/webapp/dist/assets/graph-R5G-y8tB.js +782 -0
- package/webapp/dist/assets/graph-R5G-y8tB.js.map +1 -0
- package/webapp/dist/assets/{index-DLajsIDJ.js → index--fy89xGh.js} +2214 -2023
- package/webapp/dist/assets/index--fy89xGh.js.map +1 -0
- package/webapp/dist/assets/{index-xvYYeHuy.css → index-DZFkLLVz.css} +18 -10
- package/webapp/dist/assets/{infoDiagram-HS3SLOUP-BDba5pKs.js → infoDiagram-LFFYTUFH-PIoZHr7s.js} +7 -7
- package/webapp/dist/assets/infoDiagram-LFFYTUFH-PIoZHr7s.js.map +1 -0
- package/webapp/dist/assets/init-ZxktEp_H.js.map +1 -1
- package/webapp/dist/assets/ishikawaDiagram-PHBUUO56-oCM-LYk1.js +966 -0
- package/webapp/dist/assets/ishikawaDiagram-PHBUUO56-oCM-LYk1.js.map +1 -0
- package/webapp/dist/assets/{journeyDiagram-XKPGCS4Q-CmJAbmlm.js → journeyDiagram-4ABVD52K-C2qidjQ5.js} +5 -5
- package/webapp/dist/assets/journeyDiagram-4ABVD52K-C2qidjQ5.js.map +1 -0
- package/webapp/dist/assets/{kanban-definition-3W4ZIXB7-DxQeBTDk.js → kanban-definition-K7BYSVSG-Du0TC8WS.js} +5 -3
- package/webapp/dist/assets/kanban-definition-K7BYSVSG-Du0TC8WS.js.map +1 -0
- package/webapp/dist/assets/{layout-DteV_yE8.js → layout-VmEo1OEB.js} +5 -5
- package/webapp/dist/assets/layout-VmEo1OEB.js.map +1 -0
- package/webapp/dist/assets/{linear-zItbPrND.js → linear-B662YHAc.js} +2 -2
- package/webapp/dist/assets/linear-B662YHAc.js.map +1 -0
- package/webapp/dist/assets/{mindmap-definition-VGOIOE7T-BJXI7UqO.js → mindmap-definition-YRQLILUH-D7arZj95.js} +7 -5
- package/webapp/dist/assets/mindmap-definition-YRQLILUH-D7arZj95.js.map +1 -0
- package/webapp/dist/assets/ordinal-CxptdPJm.js.map +1 -1
- package/webapp/dist/assets/{pieDiagram-ADFJNKIX-BpM-aH2p.js → pieDiagram-SKSYHLDU-DvjPP4PA.js} +8 -8
- package/webapp/dist/assets/pieDiagram-SKSYHLDU-DvjPP4PA.js.map +1 -0
- package/webapp/dist/assets/{quadrantDiagram-AYHSOK5B-NXdIpA15.js → quadrantDiagram-337W2JSQ-B_JUGMj_.js} +3 -3
- package/webapp/dist/assets/quadrantDiagram-337W2JSQ-B_JUGMj_.js.map +1 -0
- package/webapp/dist/assets/{requirementDiagram-UZGBJVZJ-D1AICAA0.js → requirementDiagram-Z7DCOOCP-DF0mpvE3.js} +16 -6
- package/webapp/dist/assets/requirementDiagram-Z7DCOOCP-DF0mpvE3.js.map +1 -0
- package/webapp/dist/assets/{sankeyDiagram-TZEHDZUN-WiReDPfo.js → sankeyDiagram-WA2Y5GQK-CoXlxv00.js} +2 -2
- package/webapp/dist/assets/sankeyDiagram-WA2Y5GQK-CoXlxv00.js.map +1 -0
- package/webapp/dist/assets/{sequenceDiagram-WL72ISMW-Cw76oP8t.js → sequenceDiagram-2WXFIKYE-DYqT5Pg7.js} +601 -201
- package/webapp/dist/assets/sequenceDiagram-2WXFIKYE-DYqT5Pg7.js.map +1 -0
- package/webapp/dist/assets/{stateDiagram-FKZM4ZOC-QjCeRczs.js → stateDiagram-RAJIS63D-D9b1mN8-.js} +9 -9
- package/webapp/dist/assets/stateDiagram-RAJIS63D-D9b1mN8-.js.map +1 -0
- package/webapp/dist/assets/{stateDiagram-v2-4FDKWEC3-IClqxQ4s.js → stateDiagram-v2-FVOUBMTO-DNzgudL_.js} +5 -5
- package/webapp/dist/assets/stateDiagram-v2-FVOUBMTO-DNzgudL_.js.map +1 -0
- package/webapp/dist/assets/{timeline-definition-IT6M3QCI-BfyfTY7m.js → timeline-definition-YZTLITO2-CkyKUY7A.js} +3 -3
- package/webapp/dist/assets/timeline-definition-YZTLITO2-CkyKUY7A.js.map +1 -0
- package/webapp/dist/assets/{treemap-GDKQZRPO-C5MiL6--.js → treemap-KZPCXAKY-CZd09kF-.js} +37 -24
- package/webapp/dist/assets/treemap-KZPCXAKY-CZd09kF-.js.map +1 -0
- package/webapp/dist/assets/vennDiagram-LZ73GAT5-BxVF5Olo.js +2487 -0
- package/webapp/dist/assets/vennDiagram-LZ73GAT5-BxVF5Olo.js.map +1 -0
- package/webapp/dist/assets/{xychartDiagram-PRI3JC2R-ybaJrSry.js → xychartDiagram-JWTSCODW-BRwRloPc.js} +4 -4
- package/webapp/dist/assets/xychartDiagram-JWTSCODW-BRwRloPc.js.map +1 -0
- package/webapp/dist/index.html +2 -2
- package/dist/docs/issues/global-dialog-event-broadcaster-missing.md +0 -128
- package/dist/llm/kernel-driver/subdialog-txn.d.ts +0 -8
- package/webapp/dist/assets/_basePickBy-BPJaiZdW.js.map +0 -1
- package/webapp/dist/assets/_baseUniq-BEetT15i.js.map +0 -1
- package/webapp/dist/assets/arc-Dm7Zf36f.js.map +0 -1
- package/webapp/dist/assets/architectureDiagram-VXUJARFQ-BpTPtkuo.js.map +0 -1
- package/webapp/dist/assets/blockDiagram-VD42YOAC-C8fLN0iu.js.map +0 -1
- package/webapp/dist/assets/c4Diagram-YG6GDRKO-BpPr62CH.js.map +0 -1
- package/webapp/dist/assets/channel-EMYoPjW3.js.map +0 -1
- package/webapp/dist/assets/chunk-4BX2VUAB-CefNtjWG.js.map +0 -1
- package/webapp/dist/assets/chunk-55IACEB6-C_X7T43V.js.map +0 -1
- package/webapp/dist/assets/chunk-B4BG7PRW-BRe3_2oA.js.map +0 -1
- package/webapp/dist/assets/chunk-DI55MBZ5-CbvrsI_w.js.map +0 -1
- package/webapp/dist/assets/chunk-FMBD7UC4-ORmtkrtS.js.map +0 -1
- package/webapp/dist/assets/chunk-QN33PNHL-LTAOVhWu.js.map +0 -1
- package/webapp/dist/assets/chunk-QZHKN3VN-ZoUM_4u5.js.map +0 -1
- package/webapp/dist/assets/chunk-TZMSLE5B-Gao4qrq7.js.map +0 -1
- package/webapp/dist/assets/classDiagram-2ON5EDUG-uha1vIGN.js.map +0 -1
- package/webapp/dist/assets/classDiagram-v2-WZHVMYZB-uha1vIGN.js.map +0 -1
- package/webapp/dist/assets/clone-_9Ayb1Gp.js.map +0 -1
- package/webapp/dist/assets/cose-bilkent-S5V4N54A-C8wDw3NY.js.map +0 -1
- package/webapp/dist/assets/dagre-6UL2VRFP-BUSeNot0.js.map +0 -1
- package/webapp/dist/assets/diagram-PSM6KHXK-CMZAksVC.js.map +0 -1
- package/webapp/dist/assets/diagram-QEK2KX5R-BQKoRtwy.js.map +0 -1
- package/webapp/dist/assets/diagram-S2PKOQOG-DjMG97kd.js.map +0 -1
- package/webapp/dist/assets/erDiagram-Q2GNP2WA-BujwA137.js.map +0 -1
- package/webapp/dist/assets/flowDiagram-NV44I4VS-DgwPjg4y.js.map +0 -1
- package/webapp/dist/assets/ganttDiagram-JELNMOA3-Db2ykf3E.js.map +0 -1
- package/webapp/dist/assets/gitGraphDiagram-V2S2FVAM-D_gSifkv.js.map +0 -1
- package/webapp/dist/assets/graph-BHjCU5xP.js +0 -425
- package/webapp/dist/assets/graph-BHjCU5xP.js.map +0 -1
- package/webapp/dist/assets/index-DLajsIDJ.js.map +0 -1
- package/webapp/dist/assets/infoDiagram-HS3SLOUP-BDba5pKs.js.map +0 -1
- package/webapp/dist/assets/journeyDiagram-XKPGCS4Q-CmJAbmlm.js.map +0 -1
- package/webapp/dist/assets/kanban-definition-3W4ZIXB7-DxQeBTDk.js.map +0 -1
- package/webapp/dist/assets/layout-DteV_yE8.js.map +0 -1
- package/webapp/dist/assets/linear-zItbPrND.js.map +0 -1
- package/webapp/dist/assets/mindmap-definition-VGOIOE7T-BJXI7UqO.js.map +0 -1
- package/webapp/dist/assets/pieDiagram-ADFJNKIX-BpM-aH2p.js.map +0 -1
- package/webapp/dist/assets/quadrantDiagram-AYHSOK5B-NXdIpA15.js.map +0 -1
- package/webapp/dist/assets/requirementDiagram-UZGBJVZJ-D1AICAA0.js.map +0 -1
- package/webapp/dist/assets/sankeyDiagram-TZEHDZUN-WiReDPfo.js.map +0 -1
- package/webapp/dist/assets/sequenceDiagram-WL72ISMW-Cw76oP8t.js.map +0 -1
- package/webapp/dist/assets/stateDiagram-FKZM4ZOC-QjCeRczs.js.map +0 -1
- package/webapp/dist/assets/stateDiagram-v2-4FDKWEC3-IClqxQ4s.js.map +0 -1
- package/webapp/dist/assets/timeline-definition-IT6M3QCI-BfyfTY7m.js.map +0 -1
- package/webapp/dist/assets/treemap-GDKQZRPO-C5MiL6--.js.map +0 -1
- package/webapp/dist/assets/xychartDiagram-PRI3JC2R-ybaJrSry.js.map +0 -1
|
@@ -183,7 +183,7 @@ function readOptionalPersistableDialogStatus(raw) {
|
|
|
183
183
|
}
|
|
184
184
|
return { kind: 'value', status };
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function formatDeclaredDeadSideDialogNotice(language, dialogId, callName) {
|
|
187
187
|
if (language === 'zh') {
|
|
188
188
|
switch (callName) {
|
|
189
189
|
case 'tellask':
|
|
@@ -196,11 +196,11 @@ function formatDeclaredDeadSubdialogNotice(language, dialogId, callName) {
|
|
|
196
196
|
}
|
|
197
197
|
switch (callName) {
|
|
198
198
|
case 'tellask':
|
|
199
|
-
return `${(0, driver_messages_1.formatSystemNoticePrefix)('en')}
|
|
199
|
+
return `${(0, driver_messages_1.formatSystemNoticePrefix)('en')} Side Dialog ${dialogId} has been declared dead by the user (irreversible). You may reuse the same slug to start a brand-new Side Dialog, but previous context is no longer retained; include the latest complete context in the new tellask body.`;
|
|
200
200
|
case 'tellaskSessionless':
|
|
201
|
-
return `${(0, driver_messages_1.formatSystemNoticePrefix)('en')}
|
|
201
|
+
return `${(0, driver_messages_1.formatSystemNoticePrefix)('en')} Side Dialog ${dialogId} has been declared dead by the user (irreversible). This was a one-shot Side Dialog; if you still need the work, start a new Side Dialog. Previous context will not carry over, so include the latest complete context in the new tellask body.`;
|
|
202
202
|
case 'freshBootsReasoning':
|
|
203
|
-
return `${(0, driver_messages_1.formatSystemNoticePrefix)('en')}
|
|
203
|
+
return `${(0, driver_messages_1.formatSystemNoticePrefix)('en')} Side Dialog ${dialogId} has been declared dead by the user (irreversible). This was an FBR Side Dialog; if you still need the work, start a new FBR Side Dialog. Previous context will not carry over, so include the latest complete context in the new tellask body.`;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
const log = (0, log_1.createLogger)('websocket-handler');
|
|
@@ -236,20 +236,20 @@ function buildResumeIneligibleMessage(latest) {
|
|
|
236
236
|
switch (state.kind) {
|
|
237
237
|
case 'blocked':
|
|
238
238
|
switch (state.reason.kind) {
|
|
239
|
-
case '
|
|
239
|
+
case 'needs_human_input_and_sideDialogs':
|
|
240
240
|
return {
|
|
241
|
-
reason: '
|
|
242
|
-
message: 'Fresh state scan shows this dialog is waiting for both human input and
|
|
241
|
+
reason: 'needs_human_input_and_sideDialogs',
|
|
242
|
+
message: 'Fresh state scan shows this dialog is waiting for both human input and Side Dialogs, so it cannot resume yet.',
|
|
243
243
|
};
|
|
244
244
|
case 'needs_human_input':
|
|
245
245
|
return {
|
|
246
246
|
reason: 'needs_human_input',
|
|
247
247
|
message: 'Fresh state scan shows this dialog is waiting for human input, so it cannot resume yet.',
|
|
248
248
|
};
|
|
249
|
-
case '
|
|
249
|
+
case 'waiting_for_sideDialogs':
|
|
250
250
|
return {
|
|
251
|
-
reason: '
|
|
252
|
-
message: 'Fresh state scan shows this dialog is waiting for
|
|
251
|
+
reason: 'waiting_for_sideDialogs',
|
|
252
|
+
message: 'Fresh state scan shows this dialog is waiting for Side Dialogs, so it cannot resume yet.',
|
|
253
253
|
};
|
|
254
254
|
default: {
|
|
255
255
|
const _exhaustive = state.reason;
|
|
@@ -493,8 +493,8 @@ async function handleWebSocketMessage(ws, packet) {
|
|
|
493
493
|
case 'resume_all':
|
|
494
494
|
await handleResumeAll(ws, packet);
|
|
495
495
|
break;
|
|
496
|
-
case '
|
|
497
|
-
await
|
|
496
|
+
case 'declare_sideDialog_dead':
|
|
497
|
+
await handleDeclareSideDialogDead(ws, packet);
|
|
498
498
|
break;
|
|
499
499
|
default:
|
|
500
500
|
log.warn('Unknown WebSocket packet type:', undefined, packet.type);
|
|
@@ -512,21 +512,21 @@ async function handleWebSocketMessage(ws, packet) {
|
|
|
512
512
|
}));
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
async function
|
|
515
|
+
async function handleDeclareSideDialogDead(ws, packet) {
|
|
516
516
|
const dialog = packet.dialog;
|
|
517
517
|
const noteRaw = typeof packet.note === 'string' ? packet.note : '';
|
|
518
518
|
const note = noteRaw.trim();
|
|
519
519
|
if (!dialog || typeof dialog.selfId !== 'string' || typeof dialog.rootId !== 'string') {
|
|
520
520
|
ws.send(JSON.stringify({
|
|
521
521
|
type: 'error',
|
|
522
|
-
message: '
|
|
522
|
+
message: 'declare_sideDialog_dead requires dialog.selfId/rootId',
|
|
523
523
|
}));
|
|
524
524
|
return;
|
|
525
525
|
}
|
|
526
526
|
if (dialog.selfId === dialog.rootId) {
|
|
527
527
|
ws.send(JSON.stringify({
|
|
528
528
|
type: 'error',
|
|
529
|
-
message: '
|
|
529
|
+
message: 'declare_sideDialog_dead is allowed only for sideDialogs (selfId must differ)',
|
|
530
530
|
}));
|
|
531
531
|
return;
|
|
532
532
|
}
|
|
@@ -535,7 +535,7 @@ async function handleDeclareSubdialogDead(ws, packet) {
|
|
|
535
535
|
if (requestedStatusInput.kind === 'invalid') {
|
|
536
536
|
ws.send(JSON.stringify({
|
|
537
537
|
type: 'error',
|
|
538
|
-
message: '
|
|
538
|
+
message: 'declare_sideDialog_dead requires status running, completed, or archived',
|
|
539
539
|
}));
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
@@ -543,7 +543,7 @@ async function handleDeclareSubdialogDead(ws, packet) {
|
|
|
543
543
|
if (requestedStatus !== 'running') {
|
|
544
544
|
ws.send(JSON.stringify({
|
|
545
545
|
type: 'error',
|
|
546
|
-
message: '
|
|
546
|
+
message: 'declare_sideDialog_dead is available only for running dialogs',
|
|
547
547
|
}));
|
|
548
548
|
return;
|
|
549
549
|
}
|
|
@@ -566,43 +566,40 @@ async function handleDeclareSubdialogDead(ws, packet) {
|
|
|
566
566
|
reason: { kind: 'declared_by_user' },
|
|
567
567
|
});
|
|
568
568
|
await (0, dialog_display_state_1.setDialogDisplayState)(dialogIdObj, { kind: 'dead', reason: { kind: 'declared_by_user' } });
|
|
569
|
-
// If
|
|
570
|
-
// response so the
|
|
569
|
+
// If an askerDialog is waiting on this sideDialog (pending-sideDialogs.json), supply a system-style
|
|
570
|
+
// response so the askerDialog can unblock and the model sees the failure reason.
|
|
571
571
|
const metadata = await persistence_1.DialogPersistence.loadDialogMetadata(dialogIdObj, requestedStatus);
|
|
572
572
|
if (!metadata)
|
|
573
573
|
return;
|
|
574
574
|
if (typeof metadata.sessionSlug === 'string' && metadata.sessionSlug.trim() !== '') {
|
|
575
575
|
const rootRestored = await restoreDialogForDrive(new dialog_1.DialogID(dialogIdObj.rootId), 'running');
|
|
576
|
-
if (!(rootRestored instanceof dialog_1.
|
|
577
|
-
throw new Error(`Expected
|
|
576
|
+
if (!(rootRestored instanceof dialog_1.MainDialog)) {
|
|
577
|
+
throw new Error(`Expected main dialog instance for ${dialogIdObj.rootId}`);
|
|
578
578
|
}
|
|
579
|
-
const removed = rootRestored.
|
|
579
|
+
const removed = rootRestored.unregisterSideDialog(metadata.agentId, metadata.sessionSlug);
|
|
580
580
|
if (removed) {
|
|
581
|
-
await rootRestored.
|
|
581
|
+
await rootRestored.saveSideDialogRegistry();
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
|
|
584
|
+
const assignmentFromAsker = await persistence_1.DialogPersistence.loadSideDialogAssignmentFromAsker(dialogIdObj, requestedStatus);
|
|
585
|
+
const askerDialogId = assignmentFromAsker.askerDialogId;
|
|
586
|
+
if (typeof askerDialogId !== 'string' || askerDialogId.trim() === '')
|
|
585
587
|
return;
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
const
|
|
589
|
-
if (typeof callerDialogId !== 'string' || callerDialogId.trim() === '')
|
|
590
|
-
return;
|
|
591
|
-
const callerDialogIdObj = new dialog_1.DialogID(callerDialogId, dialogIdObj.rootId);
|
|
592
|
-
const pending = await persistence_1.DialogPersistence.loadPendingSubdialogs(callerDialogIdObj, requestedStatus);
|
|
593
|
-
const pendingRecord = pending.find((p) => p.subdialogId === dialogIdObj.selfId);
|
|
588
|
+
const askerDialogIdObj = new dialog_1.DialogID(askerDialogId, dialogIdObj.rootId);
|
|
589
|
+
const pending = await persistence_1.DialogPersistence.loadPendingSideDialogs(askerDialogIdObj, requestedStatus);
|
|
590
|
+
const pendingRecord = pending.find((p) => p.sideDialogId === dialogIdObj.selfId);
|
|
594
591
|
if (!pendingRecord) {
|
|
595
|
-
//
|
|
592
|
+
// Asker is not waiting on this sideDialog anymore; do not auto-revive.
|
|
596
593
|
return;
|
|
597
594
|
}
|
|
598
|
-
const parentDialog = await restoreDialogForDrive(
|
|
599
|
-
const responseText =
|
|
595
|
+
const parentDialog = await restoreDialogForDrive(askerDialogIdObj, 'running');
|
|
596
|
+
const responseText = formatDeclaredDeadSideDialogNotice((0, work_language_1.getWorkLanguage)(), dialogIdObj.valueOf(), assignmentFromAsker.callName);
|
|
600
597
|
const responseTextWithNote = note === ''
|
|
601
598
|
? responseText
|
|
602
599
|
: (0, work_language_1.getWorkLanguage)() === 'zh'
|
|
603
600
|
? `${responseText}\n\n使用者补充(来自输入框):\n${note}`
|
|
604
601
|
: `${responseText}\n\nUser note (from the input box):\n${note}`;
|
|
605
|
-
await (0, kernel_driver_1.
|
|
602
|
+
await (0, kernel_driver_1.supplyResponseToAskerDialog)(parentDialog, dialogIdObj, responseTextWithNote, pendingRecord.callType, assignmentFromAsker.callId, 'failed');
|
|
606
603
|
}
|
|
607
604
|
async function handleSetDiligencePush(ws, packet) {
|
|
608
605
|
try {
|
|
@@ -624,7 +621,7 @@ async function handleSetDiligencePush(ws, packet) {
|
|
|
624
621
|
ws.send(JSON.stringify({ type: 'error', message: 'disableDiligencePush must be a boolean' }));
|
|
625
622
|
return;
|
|
626
623
|
}
|
|
627
|
-
// Diligence Push is
|
|
624
|
+
// Diligence Push is main-dialog state. Even if a sideDialog is displayed, always mutate the root.
|
|
628
625
|
const dialogIdObj = new dialog_1.DialogID(rootId);
|
|
629
626
|
const requestedStatusInput = readOptionalPersistableDialogStatus(dialog.status);
|
|
630
627
|
if (requestedStatusInput.kind === 'invalid') {
|
|
@@ -652,9 +649,9 @@ async function handleSetDiligencePush(ws, packet) {
|
|
|
652
649
|
patch: { disableDiligencePush },
|
|
653
650
|
}), requestedStatus);
|
|
654
651
|
// Update live in-memory instance if it's loaded.
|
|
655
|
-
const
|
|
656
|
-
if (
|
|
657
|
-
|
|
652
|
+
const mainDialog = await (0, dialog_instance_registry_1.getOrRestoreMainDialog)(dialogIdObj.rootId, requestedStatus);
|
|
653
|
+
if (mainDialog) {
|
|
654
|
+
mainDialog.disableDiligencePush = disableDiligencePush;
|
|
658
655
|
}
|
|
659
656
|
const msg = {
|
|
660
657
|
type: 'diligence_push_updated',
|
|
@@ -666,9 +663,9 @@ async function handleSetDiligencePush(ws, packet) {
|
|
|
666
663
|
const shouldTriggerImmediateDiligence = requestedStatus === 'running' &&
|
|
667
664
|
prevDisableDiligencePush &&
|
|
668
665
|
!disableDiligencePush &&
|
|
669
|
-
|
|
666
|
+
mainDialog instanceof dialog_1.MainDialog;
|
|
670
667
|
if (shouldTriggerImmediateDiligence) {
|
|
671
|
-
void maybeTriggerImmediateDiligencePrompt(
|
|
668
|
+
void maybeTriggerImmediateDiligencePrompt(mainDialog);
|
|
672
669
|
}
|
|
673
670
|
}
|
|
674
671
|
catch (error) {
|
|
@@ -684,48 +681,48 @@ function clampNonNegativeFiniteInt(value, fallback) {
|
|
|
684
681
|
return fallback;
|
|
685
682
|
return Math.max(0, Math.floor(value));
|
|
686
683
|
}
|
|
687
|
-
async function maybeTriggerImmediateDiligencePrompt(
|
|
684
|
+
async function maybeTriggerImmediateDiligencePrompt(mainDialog) {
|
|
688
685
|
try {
|
|
689
|
-
if (
|
|
686
|
+
if (mainDialog.disableDiligencePush) {
|
|
690
687
|
return;
|
|
691
688
|
}
|
|
692
|
-
if ((0, dialog_display_state_1.hasActiveRun)(
|
|
689
|
+
if ((0, dialog_display_state_1.hasActiveRun)(mainDialog.id)) {
|
|
693
690
|
return;
|
|
694
691
|
}
|
|
695
|
-
if ((0, dialog_display_state_1.getStopRequestedReason)(
|
|
692
|
+
if ((0, dialog_display_state_1.getStopRequestedReason)(mainDialog.id) !== undefined) {
|
|
696
693
|
return;
|
|
697
694
|
}
|
|
698
|
-
const executionMarker = await (0, dialog_display_state_1.loadDialogExecutionMarker)(
|
|
695
|
+
const executionMarker = await (0, dialog_display_state_1.loadDialogExecutionMarker)(mainDialog.id, 'running');
|
|
699
696
|
if (executionMarker?.kind === 'interrupted' || executionMarker?.kind === 'dead') {
|
|
700
697
|
return;
|
|
701
698
|
}
|
|
702
|
-
const suspension = await
|
|
699
|
+
const suspension = await mainDialog.getSuspensionStatus();
|
|
703
700
|
if (!suspension.canDrive) {
|
|
704
701
|
return;
|
|
705
702
|
}
|
|
706
703
|
const team = await team_1.Team.load();
|
|
707
704
|
const prepared = await (0, runtime_2.maybePrepareDiligenceAutoContinuePrompt)({
|
|
708
|
-
dlg:
|
|
709
|
-
|
|
710
|
-
remainingBudget:
|
|
711
|
-
diligencePushMax: resolveMemberDiligencePushMax(team,
|
|
705
|
+
dlg: mainDialog,
|
|
706
|
+
isMainDialog: true,
|
|
707
|
+
remainingBudget: mainDialog.diligencePushRemainingBudget,
|
|
708
|
+
diligencePushMax: resolveMemberDiligencePushMax(team, mainDialog.agentId),
|
|
712
709
|
});
|
|
713
|
-
|
|
714
|
-
await persistence_1.DialogPersistence.mutateDialogLatest(
|
|
710
|
+
mainDialog.diligencePushRemainingBudget = prepared.nextRemainingBudget;
|
|
711
|
+
await persistence_1.DialogPersistence.mutateDialogLatest(mainDialog.id, () => ({
|
|
715
712
|
kind: 'patch',
|
|
716
|
-
patch: { diligencePushRemainingBudget:
|
|
713
|
+
patch: { diligencePushRemainingBudget: mainDialog.diligencePushRemainingBudget },
|
|
717
714
|
}));
|
|
718
715
|
if (prepared.kind !== 'disabled') {
|
|
719
|
-
(0, evt_registry_1.postDialogEvent)(
|
|
716
|
+
(0, evt_registry_1.postDialogEvent)(mainDialog, {
|
|
720
717
|
type: 'diligence_budget_evt',
|
|
721
718
|
maxInjectCount: prepared.maxInjectCount,
|
|
722
719
|
injectedCount: Math.max(0, prepared.maxInjectCount - prepared.nextRemainingBudget),
|
|
723
720
|
remainingCount: Math.max(0, prepared.nextRemainingBudget),
|
|
724
|
-
disableDiligencePush:
|
|
721
|
+
disableDiligencePush: mainDialog.disableDiligencePush,
|
|
725
722
|
});
|
|
726
723
|
}
|
|
727
724
|
if (prepared.kind === 'prompt') {
|
|
728
|
-
await (0, kernel_driver_1.driveDialogStream)(
|
|
725
|
+
await (0, kernel_driver_1.driveDialogStream)(mainDialog, prepared.prompt, true, {
|
|
729
726
|
source: 'ws_diligence_push',
|
|
730
727
|
reason: 'enable_keep_going_immediate_prompt',
|
|
731
728
|
});
|
|
@@ -733,7 +730,7 @@ async function maybeTriggerImmediateDiligencePrompt(rootDialog) {
|
|
|
733
730
|
}
|
|
734
731
|
catch (error) {
|
|
735
732
|
log.warn('Failed to trigger immediate diligence prompt after enabling keep-going', error, {
|
|
736
|
-
dialogId:
|
|
733
|
+
dialogId: mainDialog.id.valueOf(),
|
|
737
734
|
});
|
|
738
735
|
}
|
|
739
736
|
}
|
|
@@ -751,7 +748,7 @@ async function handleRefillDiligencePushBudget(ws, packet) {
|
|
|
751
748
|
}));
|
|
752
749
|
return;
|
|
753
750
|
}
|
|
754
|
-
const
|
|
751
|
+
const mainDialogId = new dialog_1.DialogID(rootId);
|
|
755
752
|
const requestedStatusInput = readOptionalPersistableDialogStatus(dialog.status);
|
|
756
753
|
if (requestedStatusInput.kind === 'invalid') {
|
|
757
754
|
ws.send(JSON.stringify({
|
|
@@ -761,41 +758,41 @@ async function handleRefillDiligencePushBudget(ws, packet) {
|
|
|
761
758
|
return;
|
|
762
759
|
}
|
|
763
760
|
const requestedStatus = requestedStatusInput.kind === 'missing' ? 'running' : requestedStatusInput.status;
|
|
764
|
-
const rootMeta = await persistence_1.DialogPersistence.loadDialogMetadata(
|
|
761
|
+
const rootMeta = await persistence_1.DialogPersistence.loadDialogMetadata(mainDialogId, requestedStatus);
|
|
765
762
|
if (!rootMeta) {
|
|
766
763
|
ws.send(JSON.stringify({
|
|
767
764
|
type: 'error',
|
|
768
|
-
message: `Dialog ${
|
|
765
|
+
message: `Dialog ${mainDialogId.valueOf()} not found in ${requestedStatus}; dialog context is stale`,
|
|
769
766
|
}));
|
|
770
767
|
return;
|
|
771
768
|
}
|
|
772
|
-
const
|
|
773
|
-
if (!
|
|
769
|
+
const mainDialog = await (0, dialog_instance_registry_1.getOrRestoreMainDialog)(mainDialogId.rootId, requestedStatus);
|
|
770
|
+
if (!mainDialog) {
|
|
774
771
|
ws.send(JSON.stringify({
|
|
775
772
|
type: 'error',
|
|
776
|
-
message: `
|
|
773
|
+
message: `Main dialog ${mainDialogId.rootId} is not available for refill`,
|
|
777
774
|
}));
|
|
778
775
|
return;
|
|
779
776
|
}
|
|
780
777
|
const team = await team_1.Team.load();
|
|
781
|
-
const configuredMax = normalizeDiligencePushMax(resolveMemberDiligencePushMax(team,
|
|
778
|
+
const configuredMax = normalizeDiligencePushMax(resolveMemberDiligencePushMax(team, mainDialog.agentId));
|
|
782
779
|
if (configuredMax > 0) {
|
|
783
|
-
|
|
780
|
+
mainDialog.diligencePushRemainingBudget = configuredMax;
|
|
784
781
|
}
|
|
785
782
|
else {
|
|
786
|
-
|
|
787
|
-
clampNonNegativeFiniteInt(
|
|
783
|
+
mainDialog.diligencePushRemainingBudget =
|
|
784
|
+
clampNonNegativeFiniteInt(mainDialog.diligencePushRemainingBudget, 0) + 3;
|
|
788
785
|
}
|
|
789
|
-
await persistence_1.DialogPersistence.mutateDialogLatest(
|
|
786
|
+
await persistence_1.DialogPersistence.mutateDialogLatest(mainDialogId, () => ({
|
|
790
787
|
kind: 'patch',
|
|
791
|
-
patch: { diligencePushRemainingBudget:
|
|
788
|
+
patch: { diligencePushRemainingBudget: mainDialog.diligencePushRemainingBudget },
|
|
792
789
|
}), requestedStatus);
|
|
793
|
-
(0, evt_registry_1.postDialogEvent)(
|
|
790
|
+
(0, evt_registry_1.postDialogEvent)(mainDialog, {
|
|
794
791
|
type: 'diligence_budget_evt',
|
|
795
792
|
maxInjectCount: configuredMax > 0 ? configuredMax : 0,
|
|
796
793
|
injectedCount: 0,
|
|
797
|
-
remainingCount:
|
|
798
|
-
disableDiligencePush:
|
|
794
|
+
remainingCount: mainDialog.diligencePushRemainingBudget,
|
|
795
|
+
disableDiligencePush: mainDialog.disableDiligencePush,
|
|
799
796
|
});
|
|
800
797
|
}
|
|
801
798
|
async function handleGetProblems(ws, packet) {
|
|
@@ -853,13 +850,13 @@ async function handleCreateDialog(ws, packet) {
|
|
|
853
850
|
try {
|
|
854
851
|
const { requestId, agentId, taskDocPath, priming } = parsed;
|
|
855
852
|
const generatedId = (0, id_1.generateDialogID)();
|
|
856
|
-
// For
|
|
853
|
+
// For main dialogs, self and root are the same
|
|
857
854
|
const dialogId = new dialog_1.DialogID(generatedId);
|
|
858
855
|
// Import Dialog and DiskFileDialogStore
|
|
859
856
|
// Create DiskFileDialogStore for file-based persistence
|
|
860
857
|
const dialogUI = new persistence_1.DiskFileDialogStore(dialogId);
|
|
861
|
-
// Create
|
|
862
|
-
const dialog = new dialog_1.
|
|
858
|
+
// Create MainDialog instance with the new store
|
|
859
|
+
const dialog = new dialog_1.MainDialog(dialogUI, taskDocPath, dialogId, agentId);
|
|
863
860
|
// display_dialog is intentionally read-only. Do not trigger replyTellask* recovery here:
|
|
864
861
|
// merely opening a dialog must not deliver persisted replies or kick off follow-up drives.
|
|
865
862
|
syncDialogLanguagePreference(dialog, resolveUserLanguageCode(ws, undefined, dialog));
|
|
@@ -872,7 +869,7 @@ async function handleCreateDialog(ws, packet) {
|
|
|
872
869
|
agentId,
|
|
873
870
|
taskDocPath: taskDocPath,
|
|
874
871
|
createdAt: (0, time_1.formatUnifiedTimestamp)(new Date()),
|
|
875
|
-
priming: (0, priming_1.
|
|
872
|
+
priming: (0, priming_1.buildMainDialogPrimingMetadata)(priming),
|
|
876
873
|
};
|
|
877
874
|
await persistence_1.DialogPersistence.saveDialogMetadata(new dialog_1.DialogID(dialogId.selfId), metadata);
|
|
878
875
|
const team = await team_1.Team.load();
|
|
@@ -889,7 +886,7 @@ async function handleCreateDialog(ws, packet) {
|
|
|
889
886
|
status: 'active',
|
|
890
887
|
messageCount: 0,
|
|
891
888
|
functionCallCount: 0,
|
|
892
|
-
|
|
889
|
+
sideDialogCount: 0,
|
|
893
890
|
displayState: { kind: 'idle_waiting_user' },
|
|
894
891
|
disableDiligencePush: defaultDisableDiligencePush,
|
|
895
892
|
diligencePushRemainingBudget: dialog.diligencePushRemainingBudget,
|
|
@@ -951,9 +948,9 @@ async function handleDisplayDialog(ws, packet) {
|
|
|
951
948
|
}
|
|
952
949
|
// Extract dialog ID from DialogIdent
|
|
953
950
|
let dialogId = dialogIdent.selfId;
|
|
954
|
-
let
|
|
951
|
+
let mainDialogId = dialogIdent.rootId;
|
|
955
952
|
// Handle case where dialogIdent properties might be objects instead of strings
|
|
956
|
-
if (typeof dialogId !== 'string' || typeof
|
|
953
|
+
if (typeof dialogId !== 'string' || typeof mainDialogId !== 'string') {
|
|
957
954
|
ws.send(JSON.stringify({
|
|
958
955
|
type: 'error',
|
|
959
956
|
message: 'Invalid dialog identifiers for display_dialog: selfId/rootId must be strings',
|
|
@@ -966,19 +963,19 @@ async function handleDisplayDialog(ws, packet) {
|
|
|
966
963
|
const existing = wsLiveDlg.get(ws);
|
|
967
964
|
if (existing) {
|
|
968
965
|
const existingId = existing.id;
|
|
969
|
-
const isSameDialog = existingId.selfId === dialogId && existingId.rootId ===
|
|
966
|
+
const isSameDialog = existingId.selfId === dialogId && existingId.rootId === mainDialogId;
|
|
970
967
|
if (isSameDialog) {
|
|
971
|
-
log.debug('display_dialog: refreshing the same dialog; cancelling existing subscription to prevent duplicate stream events', undefined, { dialogId,
|
|
968
|
+
log.debug('display_dialog: refreshing the same dialog; cancelling existing subscription to prevent duplicate stream events', undefined, { dialogId, mainDialogId });
|
|
972
969
|
}
|
|
973
970
|
else {
|
|
974
971
|
log.debug('display_dialog: switching dialogs; cancelling previous subscription', undefined, {
|
|
975
972
|
previousDialogId: existingId.valueOf(),
|
|
976
|
-
nextDialogId: new dialog_1.DialogID(dialogId,
|
|
973
|
+
nextDialogId: new dialog_1.DialogID(dialogId, mainDialogId).valueOf(),
|
|
977
974
|
});
|
|
978
975
|
}
|
|
979
976
|
cleanupWsClient(ws);
|
|
980
977
|
}
|
|
981
|
-
const dialogIdObj = new dialog_1.DialogID(dialogId,
|
|
978
|
+
const dialogIdObj = new dialog_1.DialogID(dialogId, mainDialogId);
|
|
982
979
|
const requestedStatusInput = readOptionalPersistableDialogStatus(dialogIdent.status);
|
|
983
980
|
if (requestedStatusInput.kind === 'invalid') {
|
|
984
981
|
ws.send(JSON.stringify({
|
|
@@ -993,24 +990,24 @@ async function handleDisplayDialog(ws, packet) {
|
|
|
993
990
|
if (!dialogState || !metadata) {
|
|
994
991
|
throw new Error(`Dialog ${dialogIdObj.valueOf()} not found in ${requestedStatus}; dialog context is stale`);
|
|
995
992
|
}
|
|
996
|
-
const rootPrimingConfig = dialogIdObj.selfId === dialogIdObj.rootId ? (0, priming_1.
|
|
993
|
+
const rootPrimingConfig = dialogIdObj.selfId === dialogIdObj.rootId ? (0, priming_1.getMainDialogPrimingConfig)(metadata) : undefined;
|
|
997
994
|
const showPrimingEventsInUi = rootPrimingConfig?.showInUi !== false;
|
|
998
995
|
const decidedCourse = (await persistence_1.DialogPersistence.getCurrentCourseNumber(dialogIdObj, requestedStatus)) ||
|
|
999
996
|
(dialogState.currentCourse ?? 1);
|
|
1000
997
|
const enableLive = requestedStatus === 'running';
|
|
1001
|
-
const
|
|
1002
|
-
if (!
|
|
1003
|
-
throw new Error('
|
|
998
|
+
const mainDialog = await (0, dialog_instance_registry_1.getOrRestoreMainDialog)(dialogIdObj.rootId, requestedStatus);
|
|
999
|
+
if (!mainDialog) {
|
|
1000
|
+
throw new Error('Main dialog not found');
|
|
1004
1001
|
}
|
|
1005
1002
|
if (enableLive) {
|
|
1006
|
-
dialog_global_registry_1.globalDialogRegistry.register(
|
|
1003
|
+
dialog_global_registry_1.globalDialogRegistry.register(mainDialog);
|
|
1007
1004
|
}
|
|
1008
1005
|
let dialog;
|
|
1009
1006
|
if (dialogIdObj.selfId === dialogIdObj.rootId) {
|
|
1010
|
-
dialog =
|
|
1007
|
+
dialog = mainDialog;
|
|
1011
1008
|
}
|
|
1012
1009
|
else {
|
|
1013
|
-
const loaded = await (0, dialog_instance_registry_1.ensureDialogLoaded)(
|
|
1010
|
+
const loaded = await (0, dialog_instance_registry_1.ensureDialogLoaded)(mainDialog, dialogIdObj, requestedStatus);
|
|
1014
1011
|
if (!loaded) {
|
|
1015
1012
|
throw new Error('Dialog not found');
|
|
1016
1013
|
}
|
|
@@ -1046,26 +1043,38 @@ async function handleDisplayDialog(ws, packet) {
|
|
|
1046
1043
|
? rootLatest.disableDiligencePush
|
|
1047
1044
|
: defaultDisableDiligencePush;
|
|
1048
1045
|
const effectiveDisableDiligencePush = persistedDisableDiligencePush;
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1046
|
+
mainDialog.disableDiligencePush = effectiveDisableDiligencePush;
|
|
1047
|
+
let derivedAskerDialogId;
|
|
1048
|
+
let assignmentFromAsker;
|
|
1049
|
+
if (dialogIdObj.selfId !== dialogIdObj.rootId) {
|
|
1050
|
+
assignmentFromAsker = await persistence_1.DialogPersistence.loadSideDialogAssignmentFromAsker(dialogIdObj, requestedStatus);
|
|
1051
|
+
derivedAskerDialogId = assignmentFromAsker ? assignmentFromAsker.askerDialogId.trim() : '';
|
|
1052
|
+
}
|
|
1053
|
+
if (dialogIdObj.selfId !== dialogIdObj.rootId && !derivedAskerDialogId) {
|
|
1054
|
+
const error = new Error(`dialog_ready invariant violation: missing assignmentFromAsker.askerDialogId ` +
|
|
1055
|
+
`(rootId=${dialogIdObj.rootId}, selfId=${dialogIdObj.selfId}, status=${requestedStatus})`);
|
|
1056
|
+
log.error('dialog_ready invariant violation: missing assignmentFromAsker.askerDialogId', error, {
|
|
1057
|
+
rootId: dialogIdObj.rootId,
|
|
1058
|
+
selfId: dialogIdObj.selfId,
|
|
1059
|
+
status: requestedStatus,
|
|
1060
|
+
});
|
|
1061
|
+
throw error;
|
|
1062
|
+
}
|
|
1054
1063
|
const dialogReadyResponse = {
|
|
1055
1064
|
type: 'dialog_ready',
|
|
1056
1065
|
dialog: {
|
|
1057
1066
|
selfId: dialogId,
|
|
1058
|
-
rootId:
|
|
1067
|
+
rootId: mainDialogId,
|
|
1059
1068
|
status: requestedStatus,
|
|
1060
1069
|
},
|
|
1061
1070
|
agentId: metadata.agentId,
|
|
1062
1071
|
taskDocPath: metadata.taskDocPath,
|
|
1063
|
-
|
|
1072
|
+
askerDialogId: derivedAskerDialogId,
|
|
1064
1073
|
sessionSlug: metadata.sessionSlug,
|
|
1065
|
-
|
|
1074
|
+
assignmentFromAsker,
|
|
1066
1075
|
disableDiligencePush: effectiveDisableDiligencePush,
|
|
1067
1076
|
diligencePushMax,
|
|
1068
|
-
diligencePushRemainingBudget: clampNonNegativeFiniteInt(
|
|
1077
|
+
diligencePushRemainingBudget: clampNonNegativeFiniteInt(mainDialog.diligencePushRemainingBudget, diligencePushMax > 0 ? diligencePushMax : 0),
|
|
1069
1078
|
};
|
|
1070
1079
|
ws.send(JSON.stringify(dialogReadyResponse));
|
|
1071
1080
|
// Running dialogs expose a persisted display-state snapshot for viewport controls.
|
|
@@ -1138,7 +1147,7 @@ async function handleGetQ4HState(ws, _packet) {
|
|
|
1138
1147
|
// Load Q4H from all running dialogs
|
|
1139
1148
|
const allQuestions = await persistence_1.DialogPersistence.loadAllQ4HState();
|
|
1140
1149
|
// Transform to wire `Q4HStateResponse` question entries.
|
|
1141
|
-
// `selfId` + `rootId` uniquely identify the originating dialog (including
|
|
1150
|
+
// `selfId` + `rootId` uniquely identify the originating dialog (including sideDialogs).
|
|
1142
1151
|
const questions = allQuestions.map((q) => ({
|
|
1143
1152
|
id: q.id,
|
|
1144
1153
|
selfId: q.selfId,
|
|
@@ -1191,16 +1200,16 @@ async function handleDisplayCourse(ws, packet) {
|
|
|
1191
1200
|
}
|
|
1192
1201
|
// Extract dialog ID from DialogIdent
|
|
1193
1202
|
let dialogIdStr = dialog.selfId;
|
|
1194
|
-
let
|
|
1203
|
+
let mainDialogIdStr = dialog.rootId;
|
|
1195
1204
|
// Handle case where dialog properties might be objects instead of strings
|
|
1196
|
-
if (typeof dialogIdStr !== 'string' || typeof
|
|
1205
|
+
if (typeof dialogIdStr !== 'string' || typeof mainDialogIdStr !== 'string') {
|
|
1197
1206
|
ws.send(JSON.stringify({
|
|
1198
1207
|
type: 'error',
|
|
1199
1208
|
message: 'Invalid dialog identifiers for display_course: selfId/rootId must be strings',
|
|
1200
1209
|
}));
|
|
1201
1210
|
return;
|
|
1202
1211
|
}
|
|
1203
|
-
const dialogId = new dialog_1.DialogID(dialogIdStr,
|
|
1212
|
+
const dialogId = new dialog_1.DialogID(dialogIdStr, mainDialogIdStr);
|
|
1204
1213
|
try {
|
|
1205
1214
|
const requestedStatusInput = readOptionalPersistableDialogStatus(dialog.status);
|
|
1206
1215
|
if (requestedStatusInput.kind === 'invalid') {
|
|
@@ -1220,12 +1229,12 @@ async function handleDisplayCourse(ws, packet) {
|
|
|
1220
1229
|
return;
|
|
1221
1230
|
}
|
|
1222
1231
|
const totalCourses = (await persistence_1.DialogPersistence.getCurrentCourseNumber(dialogId, requestedStatus)) || course;
|
|
1223
|
-
const
|
|
1224
|
-
if (!
|
|
1232
|
+
const mainDialog = await (0, dialog_instance_registry_1.getOrRestoreMainDialog)(dialogId.rootId, requestedStatus);
|
|
1233
|
+
if (!mainDialog)
|
|
1225
1234
|
return;
|
|
1226
1235
|
const restoredDialog = dialogId.selfId === dialogId.rootId
|
|
1227
|
-
?
|
|
1228
|
-
: await (0, dialog_instance_registry_1.ensureDialogLoaded)(
|
|
1236
|
+
? mainDialog
|
|
1237
|
+
: await (0, dialog_instance_registry_1.ensureDialogLoaded)(mainDialog, dialogId, requestedStatus);
|
|
1229
1238
|
if (!restoredDialog)
|
|
1230
1239
|
return;
|
|
1231
1240
|
const store = restoredDialog.dlgStore;
|
|
@@ -1262,16 +1271,16 @@ async function handleUserMsg2Dlg(ws, packet) {
|
|
|
1262
1271
|
}
|
|
1263
1272
|
// Extract dialog ID from DialogIdent
|
|
1264
1273
|
const dialogId = dialogIdent.selfId;
|
|
1265
|
-
const
|
|
1274
|
+
const mainDialogId = dialogIdent.rootId;
|
|
1266
1275
|
// Validate dialog identifiers
|
|
1267
|
-
if (typeof dialogId !== 'string' || typeof
|
|
1276
|
+
if (typeof dialogId !== 'string' || typeof mainDialogId !== 'string') {
|
|
1268
1277
|
ws.send(JSON.stringify({
|
|
1269
1278
|
type: 'error',
|
|
1270
1279
|
message: 'Invalid dialog identifiers for drive_dlg_by_user_msg: selfId/rootId must be strings',
|
|
1271
1280
|
}));
|
|
1272
1281
|
return;
|
|
1273
1282
|
}
|
|
1274
|
-
const dialogIdObj = new dialog_1.DialogID(dialogId,
|
|
1283
|
+
const dialogIdObj = new dialog_1.DialogID(dialogId, mainDialogId);
|
|
1275
1284
|
const latest = await persistence_1.DialogPersistence.loadDialogLatest(dialogIdObj, 'running');
|
|
1276
1285
|
if (latest?.executionMarker?.kind === 'dead') {
|
|
1277
1286
|
ws.send(JSON.stringify({
|
|
@@ -1289,7 +1298,7 @@ async function handleUserMsg2Dlg(ws, packet) {
|
|
|
1289
1298
|
const preparedAttachments = prepareUserImageAttachments(attachments);
|
|
1290
1299
|
// If the dialog is already active for this WebSocket, runnable (status === 'running'),
|
|
1291
1300
|
// and has an event forwarder (subChan),
|
|
1292
|
-
// drive it directly to preserve in-memory state (pending
|
|
1301
|
+
// drive it directly to preserve in-memory state (pending sideDialogs, teammate tellask tracking, etc).
|
|
1293
1302
|
//
|
|
1294
1303
|
// IMPORTANT: do not drive a view-only dialog instance here. When users browse a completed/archived
|
|
1295
1304
|
// dialog, handleDisplayDialog restores it with dialog.status set to completed/archived. If that
|
|
@@ -1300,7 +1309,7 @@ async function handleUserMsg2Dlg(ws, packet) {
|
|
|
1300
1309
|
const existingSub = wsSub.get(ws);
|
|
1301
1310
|
if (existingDialog &&
|
|
1302
1311
|
existingDialog.id.selfId === dialogId &&
|
|
1303
|
-
existingDialog.id.rootId ===
|
|
1312
|
+
existingDialog.id.rootId === mainDialogId &&
|
|
1304
1313
|
existingDialog.status === 'running' &&
|
|
1305
1314
|
existingSub &&
|
|
1306
1315
|
existingSub.dialogKey === existingDialog.id.valueOf()) {
|
|
@@ -1329,18 +1338,18 @@ async function handleUserMsg2Dlg(ws, packet) {
|
|
|
1329
1338
|
});
|
|
1330
1339
|
return;
|
|
1331
1340
|
}
|
|
1332
|
-
// Dialog not found in wsLiveDlg - drive using the canonical root/
|
|
1333
|
-
// This supports driving
|
|
1341
|
+
// Dialog not found in wsLiveDlg - drive using the canonical root/sideDialog instances.
|
|
1342
|
+
// This supports driving sideDialogs and cross-client revival without creating duplicate dialog objects.
|
|
1334
1343
|
try {
|
|
1335
|
-
const
|
|
1336
|
-
if (!
|
|
1344
|
+
const mainDialog = await (0, dialog_instance_registry_1.getOrRestoreMainDialog)(dialogIdObj.rootId, 'running');
|
|
1345
|
+
if (!mainDialog) {
|
|
1337
1346
|
ws.send(JSON.stringify({ type: 'error', message: `Dialog ${dialogId} not found` }));
|
|
1338
1347
|
return;
|
|
1339
1348
|
}
|
|
1340
|
-
dialog_global_registry_1.globalDialogRegistry.register(
|
|
1349
|
+
dialog_global_registry_1.globalDialogRegistry.register(mainDialog);
|
|
1341
1350
|
const dialog = dialogIdObj.selfId === dialogIdObj.rootId
|
|
1342
|
-
?
|
|
1343
|
-
: await (0, dialog_instance_registry_1.ensureDialogLoaded)(
|
|
1351
|
+
? mainDialog
|
|
1352
|
+
: await (0, dialog_instance_registry_1.ensureDialogLoaded)(mainDialog, dialogIdObj, 'running');
|
|
1344
1353
|
if (!dialog) {
|
|
1345
1354
|
ws.send(JSON.stringify({ type: 'error', message: `Dialog ${dialogId} not found` }));
|
|
1346
1355
|
return;
|
|
@@ -1391,20 +1400,20 @@ async function handleUserMsg2Dlg(ws, packet) {
|
|
|
1391
1400
|
}
|
|
1392
1401
|
}
|
|
1393
1402
|
async function restoreDialogForDrive(dialogIdObj, status) {
|
|
1394
|
-
const
|
|
1395
|
-
if (!
|
|
1403
|
+
const mainDialog = await (0, dialog_instance_registry_1.getOrRestoreMainDialog)(dialogIdObj.rootId, status);
|
|
1404
|
+
if (!mainDialog) {
|
|
1396
1405
|
throw new Error(`Dialog ${dialogIdObj.valueOf()} not found`);
|
|
1397
1406
|
}
|
|
1398
|
-
dialog_global_registry_1.globalDialogRegistry.register(
|
|
1407
|
+
dialog_global_registry_1.globalDialogRegistry.register(mainDialog);
|
|
1399
1408
|
// This helper is intentionally for business operations that will mutate or continue execution
|
|
1400
|
-
// immediately after restore (for example resume_dialog, resume_all, or dead-
|
|
1409
|
+
// immediately after restore (for example resume_dialog, resume_all, or dead-sideDialog recovery).
|
|
1401
1410
|
// Because those operations are execution-oriented, we repair pending replyTellask* delivery
|
|
1402
|
-
// before handing the dialog back to the
|
|
1411
|
+
// before handing the dialog back to the tellasker.
|
|
1403
1412
|
if (dialogIdObj.selfId === dialogIdObj.rootId) {
|
|
1404
|
-
await (0, reply_special_1.recoverPendingReplyTellaskCallsForDialog)(
|
|
1405
|
-
return
|
|
1413
|
+
await (0, reply_special_1.recoverPendingReplyTellaskCallsForDialog)(mainDialog);
|
|
1414
|
+
return mainDialog;
|
|
1406
1415
|
}
|
|
1407
|
-
const sub = await (0, dialog_instance_registry_1.ensureDialogLoaded)(
|
|
1416
|
+
const sub = await (0, dialog_instance_registry_1.ensureDialogLoaded)(mainDialog, dialogIdObj, status);
|
|
1408
1417
|
if (!sub) {
|
|
1409
1418
|
throw new Error(`Dialog ${dialogIdObj.valueOf()} not found`);
|
|
1410
1419
|
}
|
|
@@ -1548,16 +1557,16 @@ async function handleReceiveHumanReply(ws, packet) {
|
|
|
1548
1557
|
}
|
|
1549
1558
|
// Extract dialog ID from DialogIdent
|
|
1550
1559
|
const dialogId = dialogIdent.selfId;
|
|
1551
|
-
const
|
|
1560
|
+
const mainDialogId = dialogIdent.rootId;
|
|
1552
1561
|
// Validate dialog identifiers
|
|
1553
|
-
if (typeof dialogId !== 'string' || typeof
|
|
1562
|
+
if (typeof dialogId !== 'string' || typeof mainDialogId !== 'string') {
|
|
1554
1563
|
ws.send(JSON.stringify({
|
|
1555
1564
|
type: 'error',
|
|
1556
1565
|
message: 'Invalid dialog identifiers for receiveHumanReply: selfId/rootId must be strings',
|
|
1557
1566
|
}));
|
|
1558
1567
|
return;
|
|
1559
1568
|
}
|
|
1560
|
-
const dialogIdObj = new dialog_1.DialogID(dialogId,
|
|
1569
|
+
const dialogIdObj = new dialog_1.DialogID(dialogId, mainDialogId);
|
|
1561
1570
|
const latest = await persistence_1.DialogPersistence.loadDialogLatest(dialogIdObj, 'running');
|
|
1562
1571
|
if (latest?.executionMarker?.kind === 'dead') {
|
|
1563
1572
|
ws.send(JSON.stringify({
|
|
@@ -1573,16 +1582,16 @@ async function handleReceiveHumanReply(ws, packet) {
|
|
|
1573
1582
|
userLanguageCode,
|
|
1574
1583
|
};
|
|
1575
1584
|
const preparedAttachments = prepareUserImageAttachments(attachments);
|
|
1576
|
-
// Restore the canonical dialog instances (
|
|
1577
|
-
const
|
|
1578
|
-
if (!
|
|
1585
|
+
// Restore the canonical dialog instances (main dialog + sideDialogs) to avoid duplicates.
|
|
1586
|
+
const mainDialog = await (0, dialog_instance_registry_1.getOrRestoreMainDialog)(dialogIdObj.rootId, 'running');
|
|
1587
|
+
if (!mainDialog) {
|
|
1579
1588
|
ws.send(JSON.stringify({ type: 'error', message: `Dialog ${dialogId} not found` }));
|
|
1580
1589
|
return;
|
|
1581
1590
|
}
|
|
1582
|
-
dialog_global_registry_1.globalDialogRegistry.register(
|
|
1591
|
+
dialog_global_registry_1.globalDialogRegistry.register(mainDialog);
|
|
1583
1592
|
const dialog = dialogIdObj.selfId === dialogIdObj.rootId
|
|
1584
|
-
?
|
|
1585
|
-
: await (0, dialog_instance_registry_1.ensureDialogLoaded)(
|
|
1593
|
+
? mainDialog
|
|
1594
|
+
: await (0, dialog_instance_registry_1.ensureDialogLoaded)(mainDialog, dialogIdObj, 'running');
|
|
1586
1595
|
if (!dialog) {
|
|
1587
1596
|
ws.send(JSON.stringify({ type: 'error', message: `Dialog ${dialogId} not found` }));
|
|
1588
1597
|
return;
|
|
@@ -1611,10 +1620,11 @@ async function handleReceiveHumanReply(ws, packet) {
|
|
|
1611
1620
|
msgId: effectivePrompt.msgId,
|
|
1612
1621
|
attachments: preparedAttachments,
|
|
1613
1622
|
});
|
|
1614
|
-
const
|
|
1623
|
+
const askHumanCallSiteCourse = removedQuestion.callSiteRef.course;
|
|
1615
1624
|
const askHumanCarryoverContent = (0, inter_dialog_format_1.formatTellaskCarryoverResultContent)({
|
|
1616
|
-
|
|
1625
|
+
callSiteCourse: askHumanCallSiteCourse,
|
|
1617
1626
|
callName: 'askHuman',
|
|
1627
|
+
callId: removedQuestion.callId,
|
|
1618
1628
|
responderId: 'human',
|
|
1619
1629
|
tellaskContent: removedQuestion.tellaskContent,
|
|
1620
1630
|
responseBody: effectivePrompt.content,
|
|
@@ -1626,8 +1636,8 @@ async function handleReceiveHumanReply(ws, packet) {
|
|
|
1626
1636
|
agentId: 'human',
|
|
1627
1637
|
callId: askHumanCallId,
|
|
1628
1638
|
originMemberId: dialog.agentId,
|
|
1629
|
-
|
|
1630
|
-
|
|
1639
|
+
callSiteCourse: (0, storage_1.toCallSiteCourseNo)(askHumanCallSiteCourse),
|
|
1640
|
+
callSiteGenseq: removedQuestion.callSiteRef.callSiteGenseq,
|
|
1631
1641
|
carryoverContent: askHumanCarryoverContent,
|
|
1632
1642
|
contentItems,
|
|
1633
1643
|
});
|
|
@@ -1639,10 +1649,10 @@ async function handleReceiveHumanReply(ws, packet) {
|
|
|
1639
1649
|
selfId: dialogId,
|
|
1640
1650
|
};
|
|
1641
1651
|
(0, evt_registry_1.postDialogEvent)(dialog, answeredEvent);
|
|
1642
|
-
const
|
|
1643
|
-
if (
|
|
1652
|
+
const hasPendingSideDialogs = await dialog.hasPendingSideDialogs();
|
|
1653
|
+
if (hasPendingSideDialogs) {
|
|
1644
1654
|
// This queued item is only the post-answer continuation input that resumes the suspended
|
|
1645
|
-
// round after
|
|
1655
|
+
// round after sideDialogs settle. The human answer fact has already been persisted above as
|
|
1646
1656
|
// askHuman tellask result/carryover and must not be reinterpreted as a new user prompt.
|
|
1647
1657
|
dialog.queueDeferredQ4HAnswerPrompt({
|
|
1648
1658
|
prompt: effectivePrompt.content,
|
|
@@ -1652,7 +1662,7 @@ async function handleReceiveHumanReply(ws, packet) {
|
|
|
1652
1662
|
userLanguageCode: effectivePrompt.userLanguageCode,
|
|
1653
1663
|
q4hAnswerCallId: askHumanCallId,
|
|
1654
1664
|
});
|
|
1655
|
-
log.debug('Deferred post-Q4H continuation input until pending
|
|
1665
|
+
log.debug('Deferred post-Q4H continuation input until pending sideDialogs resolve', undefined, {
|
|
1656
1666
|
rootId: dialog.id.rootId,
|
|
1657
1667
|
selfId: dialog.id.selfId,
|
|
1658
1668
|
questionId,
|
|
@@ -1701,7 +1711,7 @@ function setupWebSocketServer(httpServer, clients, auth, serverWorkLanguage, mod
|
|
|
1701
1711
|
(0, dialog_display_state_1.setDisplayStateBroadcaster)(broadcastToClients);
|
|
1702
1712
|
// Broadcast global dialog events to all connected clients:
|
|
1703
1713
|
// - Q4H updates are rtws-global state in WebUI
|
|
1704
|
-
// -
|
|
1714
|
+
// - sideDialog creation must refresh hierarchy/list even when current subscription is elsewhere
|
|
1705
1715
|
// - dlg_touched_evt keeps dialog list timestamps/reordering in sync across clients
|
|
1706
1716
|
(0, global_dialog_event_broadcaster_1.installGlobalDialogEventBroadcaster)({
|
|
1707
1717
|
label: 'websocket-server',
|
|
@@ -1714,22 +1724,22 @@ function setupWebSocketServer(httpServer, clients, auth, serverWorkLanguage, mod
|
|
|
1714
1724
|
broadcastDialogsIndexMessage = (msg) => {
|
|
1715
1725
|
broadcastToClients(msg);
|
|
1716
1726
|
};
|
|
1717
|
-
(0, persistence_1.setPrepareDialogQuarantineHook)(async ({
|
|
1727
|
+
(0, persistence_1.setPrepareDialogQuarantineHook)(async ({ mainDialogId, status }) => {
|
|
1718
1728
|
if (status !== 'running') {
|
|
1719
1729
|
return;
|
|
1720
1730
|
}
|
|
1721
|
-
(0, dialog_display_state_1.
|
|
1722
|
-
await (0, dialog_display_state_1.
|
|
1731
|
+
(0, dialog_display_state_1.markMainDialogQuarantining)(mainDialogId);
|
|
1732
|
+
await (0, dialog_display_state_1.forceStopActiveRunsForMainDialog)(mainDialogId);
|
|
1723
1733
|
});
|
|
1724
|
-
(0, persistence_1.setFinalizeDialogQuarantineHook)(({
|
|
1734
|
+
(0, persistence_1.setFinalizeDialogQuarantineHook)(({ mainDialogId, status, quarantined }) => {
|
|
1725
1735
|
if (status !== 'running') {
|
|
1726
1736
|
return;
|
|
1727
1737
|
}
|
|
1728
1738
|
if (quarantined) {
|
|
1729
|
-
(0, dialog_display_state_1.
|
|
1739
|
+
(0, dialog_display_state_1.clearMainDialogQuarantiningIfIdle)(mainDialogId);
|
|
1730
1740
|
return;
|
|
1731
1741
|
}
|
|
1732
|
-
(0, dialog_display_state_1.
|
|
1742
|
+
(0, dialog_display_state_1.clearMainDialogQuarantining)(mainDialogId);
|
|
1733
1743
|
});
|
|
1734
1744
|
(0, persistence_1.setDialogsQuarantinedBroadcaster)((msg) => {
|
|
1735
1745
|
broadcastToClients(msg);
|