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
package/dist/dialog.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DialogStore = exports.
|
|
3
|
+
exports.DialogStore = exports.MainDialog = exports.SideDialog = exports.Dialog = exports.DialogID = void 0;
|
|
4
|
+
exports.buildSideDialogAskerStack = buildSideDialogAskerStack;
|
|
4
5
|
const id_1 = require("@longrun-ai/kernel/utils/id");
|
|
5
6
|
const time_1 = require("@longrun-ai/kernel/utils/time");
|
|
6
7
|
const util_1 = require("util");
|
|
@@ -67,18 +68,53 @@ function getGlobalDialogMutex(dialogId) {
|
|
|
67
68
|
function compareVisibleReminderTargetOrder(a, b) {
|
|
68
69
|
return (0, tool_1.compareReminderDisplayOrder)(a.reminder, b.reminder);
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
71
|
+
function buildSideDialogAskerStack(args) {
|
|
72
|
+
const expectedReplyCallName = args.assignment.callName === 'tellask' ? 'replyTellask' : 'replyTellaskSessionless';
|
|
73
|
+
return {
|
|
74
|
+
askerStack: [
|
|
75
|
+
{
|
|
76
|
+
kind: 'asker_dialog_stack_frame',
|
|
77
|
+
askerDialogId: args.askerDialogId,
|
|
78
|
+
assignmentFromAsker: args.assignment,
|
|
79
|
+
tellaskReplyObligation: {
|
|
80
|
+
expectedReplyCallName,
|
|
81
|
+
targetDialogId: args.assignment.askerDialogId,
|
|
82
|
+
targetCallId: args.assignment.callId,
|
|
83
|
+
tellaskContent: args.assignment.tellaskContent,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function getSideDialogAskerStackTop(askerStack) {
|
|
90
|
+
const top = askerStack.askerStack[askerStack.askerStack.length - 1];
|
|
91
|
+
if (!top) {
|
|
92
|
+
throw new Error('SideDialog askerStack invariant violation: empty reply obligation stack');
|
|
93
|
+
}
|
|
94
|
+
return top;
|
|
95
|
+
}
|
|
96
|
+
function getSideDialogAskerStackCurrentAssignment(askerStack) {
|
|
97
|
+
for (let index = askerStack.askerStack.length - 1; index >= 0; index -= 1) {
|
|
98
|
+
const frame = askerStack.askerStack[index];
|
|
99
|
+
if (frame?.assignmentFromAsker !== undefined) {
|
|
100
|
+
return frame.assignmentFromAsker;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
throw new Error('SideDialog askerStack invariant violation: missing assignment frame');
|
|
104
|
+
}
|
|
105
|
+
function buildSideDialogAssignmentPromptMeta(sideDialog) {
|
|
106
|
+
const assignment = sideDialog.assignmentFromAsker;
|
|
72
107
|
switch (assignment.callName) {
|
|
73
108
|
case 'tellask':
|
|
74
109
|
return {
|
|
75
110
|
tellaskReplyDirective: {
|
|
76
111
|
expectedReplyCallName: 'replyTellask',
|
|
112
|
+
targetDialogId: assignment.askerDialogId,
|
|
77
113
|
targetCallId: assignment.callId,
|
|
78
114
|
tellaskContent: assignment.tellaskContent,
|
|
79
115
|
},
|
|
80
|
-
|
|
81
|
-
ownerDialogId: assignment.
|
|
116
|
+
sideDialogReplyTarget: {
|
|
117
|
+
ownerDialogId: assignment.askerDialogId,
|
|
82
118
|
callType: 'B',
|
|
83
119
|
callId: assignment.callId,
|
|
84
120
|
},
|
|
@@ -88,11 +124,12 @@ function buildSubdialogAssignmentPromptMeta(subdialog) {
|
|
|
88
124
|
return {
|
|
89
125
|
tellaskReplyDirective: {
|
|
90
126
|
expectedReplyCallName: 'replyTellaskSessionless',
|
|
127
|
+
targetDialogId: assignment.askerDialogId,
|
|
91
128
|
targetCallId: assignment.callId,
|
|
92
129
|
tellaskContent: assignment.tellaskContent,
|
|
93
130
|
},
|
|
94
|
-
|
|
95
|
-
ownerDialogId: assignment.
|
|
131
|
+
sideDialogReplyTarget: {
|
|
132
|
+
ownerDialogId: assignment.askerDialogId,
|
|
96
133
|
callType: 'C',
|
|
97
134
|
callId: assignment.callId,
|
|
98
135
|
},
|
|
@@ -101,7 +138,7 @@ function buildSubdialogAssignmentPromptMeta(subdialog) {
|
|
|
101
138
|
}
|
|
102
139
|
/**
|
|
103
140
|
* Abstract base class for all dialog types.
|
|
104
|
-
* Contains common properties and methods shared between
|
|
141
|
+
* Contains common properties and methods shared between MainDialog and SideDialog.
|
|
105
142
|
*/
|
|
106
143
|
class Dialog {
|
|
107
144
|
constructor(dlgStore, taskDocPath, id, agentId, initialState) {
|
|
@@ -118,18 +155,18 @@ class Dialog {
|
|
|
118
155
|
this._coursePrefixMsgs = [];
|
|
119
156
|
this._courseRuntimeNoticeMsgs = [];
|
|
120
157
|
// Track whether the current course's initial events (user_text, generating_start)
|
|
121
|
-
// have been fully processed. Used to ensure
|
|
158
|
+
// have been fully processed. Used to ensure sideDialog_final_response_evt arrives
|
|
122
159
|
// only after parent events are emitted.
|
|
123
160
|
this._generationStarted = false;
|
|
124
161
|
// Track the generation sequence when _generationStarted was set
|
|
125
162
|
// Used to ensure proper ordering when multiple generations occur
|
|
126
163
|
this._generationStartedGenseq = 0;
|
|
127
|
-
// Pending
|
|
128
|
-
this.
|
|
129
|
-
// Phase 11: Suspension state for Type A
|
|
164
|
+
// Pending sideDialog IDs (for auto-revive tracking)
|
|
165
|
+
this._pendingSideDialogIds = [];
|
|
166
|
+
// Phase 11: Suspension state for Type A sideDialog mechanism
|
|
130
167
|
// Tracks whether this dialog is in normal state, suspended, or resuming from suspension
|
|
131
168
|
this._suspensionState = 'active';
|
|
132
|
-
// Diligence Push (diligence auto-continue) budget counter (
|
|
169
|
+
// Diligence Push (diligence auto-continue) budget counter (main-dialog state).
|
|
133
170
|
// Persisted via latest.yaml so restarts and UI navigation can restore correct remaining budget.
|
|
134
171
|
this.diligencePushRemainingBudget = 0;
|
|
135
172
|
// Diligence Push disable switch (persisted via latest.yaml; default = false).
|
|
@@ -138,7 +175,7 @@ class Dialog {
|
|
|
138
175
|
// - Set when tellask-special call results are finalized
|
|
139
176
|
// - Retrieved during inline call-result emission (for receiveTellaskCallResult callId parameter)
|
|
140
177
|
// - Enables frontend to attach result INLINE to the calling section
|
|
141
|
-
// - NOT used for
|
|
178
|
+
// - NOT used for Side Dialog-response bubbles (which use calleeDialogId instead)
|
|
142
179
|
this._currentCallId = null;
|
|
143
180
|
// Validate required parameters
|
|
144
181
|
if (!taskDocPath || taskDocPath.trim() === '') {
|
|
@@ -189,7 +226,7 @@ class Dialog {
|
|
|
189
226
|
this._updatedAt = (0, time_1.formatUnifiedTimestamp)(new Date());
|
|
190
227
|
this._remindersVer++;
|
|
191
228
|
}
|
|
192
|
-
get
|
|
229
|
+
get askerDialog() {
|
|
193
230
|
return undefined;
|
|
194
231
|
}
|
|
195
232
|
getUiLanguage() {
|
|
@@ -227,7 +264,7 @@ class Dialog {
|
|
|
227
264
|
*
|
|
228
265
|
* Call Types:
|
|
229
266
|
* - tellask-special function call: callId is set when call results are finalized and used for inline result correlation
|
|
230
|
-
* -
|
|
267
|
+
* - SideDialog response bubbles: use calleeDialogId instead of callId
|
|
231
268
|
*
|
|
232
269
|
* @returns The current callId for call correlation, or null if no active call
|
|
233
270
|
*/
|
|
@@ -292,15 +329,15 @@ class Dialog {
|
|
|
292
329
|
}
|
|
293
330
|
}
|
|
294
331
|
/**
|
|
295
|
-
* Check if dialog has pending
|
|
332
|
+
* Check if dialog has pending sideDialogs.
|
|
296
333
|
*/
|
|
297
|
-
async
|
|
334
|
+
async hasPendingSideDialogs() {
|
|
298
335
|
try {
|
|
299
|
-
const pending = await this.dlgStore.
|
|
336
|
+
const pending = await this.dlgStore.loadPendingSideDialogs(this.id, this.status);
|
|
300
337
|
return pending.length > 0;
|
|
301
338
|
}
|
|
302
339
|
catch (err) {
|
|
303
|
-
log_1.log.warn('Failed to load pending
|
|
340
|
+
log_1.log.warn('Failed to load pending sideDialogs for pending check', undefined, {
|
|
304
341
|
dialogId: this.id.selfId,
|
|
305
342
|
error: err,
|
|
306
343
|
});
|
|
@@ -308,7 +345,7 @@ class Dialog {
|
|
|
308
345
|
}
|
|
309
346
|
}
|
|
310
347
|
/**
|
|
311
|
-
* Check if dialog can be driven (not suspended for Q4H or
|
|
348
|
+
* Check if dialog can be driven (not suspended for Q4H or sideDialogs).
|
|
312
349
|
*/
|
|
313
350
|
async canDrive(options) {
|
|
314
351
|
const suspension = await this.getSuspensionStatus(options);
|
|
@@ -319,39 +356,39 @@ class Dialog {
|
|
|
319
356
|
*/
|
|
320
357
|
async getSuspensionStatus(options) {
|
|
321
358
|
const hasQ4H = await this.hasPendingQ4H();
|
|
322
|
-
const
|
|
323
|
-
const
|
|
359
|
+
const hasSideDialogs = await this.hasPendingSideDialogs();
|
|
360
|
+
const blockingSideDialogs = hasSideDialogs && options?.allowPendingSideDialogs !== true;
|
|
324
361
|
return {
|
|
325
362
|
q4h: hasQ4H,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
canDrive: !hasQ4H && !
|
|
363
|
+
sideDialogs: hasSideDialogs,
|
|
364
|
+
blockingSideDialogs,
|
|
365
|
+
canDrive: !hasQ4H && !blockingSideDialogs,
|
|
329
366
|
};
|
|
330
367
|
}
|
|
331
|
-
get
|
|
332
|
-
return this.
|
|
368
|
+
get pendingSideDialogIds() {
|
|
369
|
+
return this._pendingSideDialogIds;
|
|
333
370
|
}
|
|
334
|
-
|
|
335
|
-
this.
|
|
371
|
+
addPendingSideDialogs(ids) {
|
|
372
|
+
this._pendingSideDialogIds.push(...ids);
|
|
336
373
|
}
|
|
337
|
-
|
|
338
|
-
this.
|
|
374
|
+
removePendingSideDialog(id) {
|
|
375
|
+
this._pendingSideDialogIds = this._pendingSideDialogIds.filter((pending) => pending.selfId !== id.selfId);
|
|
339
376
|
}
|
|
340
|
-
|
|
341
|
-
this.
|
|
377
|
+
clearPendingSideDialogs() {
|
|
378
|
+
this._pendingSideDialogIds = [];
|
|
342
379
|
}
|
|
343
380
|
/**
|
|
344
|
-
* Load pending
|
|
381
|
+
* Load pending sideDialogs from persistence into memory.
|
|
345
382
|
* Used during crash recovery to restore suspension state.
|
|
346
383
|
*/
|
|
347
|
-
async
|
|
384
|
+
async loadPendingSideDialogsFromPersistence() {
|
|
348
385
|
try {
|
|
349
|
-
const pending = await this.dlgStore.
|
|
350
|
-
this.
|
|
351
|
-
this.
|
|
386
|
+
const pending = await this.dlgStore.loadPendingSideDialogs(this.id, this.status);
|
|
387
|
+
this.clearPendingSideDialogs();
|
|
388
|
+
this.addPendingSideDialogs(pending.map((record) => record.sideDialogId));
|
|
352
389
|
}
|
|
353
390
|
catch (err) {
|
|
354
|
-
log_1.log.warn('Failed to load pending
|
|
391
|
+
log_1.log.warn('Failed to load pending sideDialogs from persistence', undefined, {
|
|
355
392
|
dialogId: this.id.selfId,
|
|
356
393
|
error: err,
|
|
357
394
|
});
|
|
@@ -591,14 +628,14 @@ class Dialog {
|
|
|
591
628
|
}
|
|
592
629
|
/**
|
|
593
630
|
* Check if generation has started for the current course.
|
|
594
|
-
* Used to ensure
|
|
631
|
+
* Used to ensure sideDialog_final_response_evt arrives after parent events.
|
|
595
632
|
*/
|
|
596
633
|
get generationStarted() {
|
|
597
634
|
return this._generationStarted;
|
|
598
635
|
}
|
|
599
636
|
/**
|
|
600
637
|
* Mark generation as started (after user_text event has been emitted).
|
|
601
|
-
* This ensures
|
|
638
|
+
* This ensures sideDialog_final_response_evt waits for this signal.
|
|
602
639
|
* @param genseq The generation sequence number when this flag is set
|
|
603
640
|
*/
|
|
604
641
|
markGenerationStarted(genseq) {
|
|
@@ -665,7 +702,7 @@ class Dialog {
|
|
|
665
702
|
return prompt;
|
|
666
703
|
}
|
|
667
704
|
case 'registered_assignment_update':
|
|
668
|
-
case '
|
|
705
|
+
case 'new_course_runtime_sideDialog': {
|
|
669
706
|
const prompt = {
|
|
670
707
|
...promptCommon,
|
|
671
708
|
origin: 'runtime',
|
|
@@ -673,7 +710,7 @@ class Dialog {
|
|
|
673
710
|
? {}
|
|
674
711
|
: { skipTaskdoc: nextPrompt.skipTaskdoc }),
|
|
675
712
|
tellaskReplyDirective: nextPrompt.tellaskReplyDirective,
|
|
676
|
-
|
|
713
|
+
sideDialogReplyTarget: nextPrompt.sideDialogReplyTarget,
|
|
677
714
|
};
|
|
678
715
|
return prompt;
|
|
679
716
|
}
|
|
@@ -732,12 +769,12 @@ class Dialog {
|
|
|
732
769
|
origin: 'runtime',
|
|
733
770
|
...(prepared.skipTaskdoc === undefined ? {} : { skipTaskdoc: prepared.skipTaskdoc }),
|
|
734
771
|
};
|
|
735
|
-
const normalized = prepared.
|
|
772
|
+
const normalized = prepared.sideDialogReplyTarget !== undefined
|
|
736
773
|
? (() => {
|
|
737
774
|
const prompt = {
|
|
738
775
|
...runtimeCommon,
|
|
739
776
|
tellaskReplyDirective: prepared.tellaskReplyDirective,
|
|
740
|
-
|
|
777
|
+
sideDialogReplyTarget: prepared.sideDialogReplyTarget,
|
|
741
778
|
};
|
|
742
779
|
return prompt;
|
|
743
780
|
})()
|
|
@@ -754,9 +791,9 @@ class Dialog {
|
|
|
754
791
|
return prompt;
|
|
755
792
|
})();
|
|
756
793
|
this._upNextQueue = [
|
|
757
|
-
normalized.
|
|
794
|
+
normalized.sideDialogReplyTarget !== undefined
|
|
758
795
|
? {
|
|
759
|
-
kind: '
|
|
796
|
+
kind: 'new_course_runtime_sideDialog',
|
|
760
797
|
prompt: normalized.content,
|
|
761
798
|
msgId: normalized.msgId,
|
|
762
799
|
grammar: normalized.grammar,
|
|
@@ -764,7 +801,7 @@ class Dialog {
|
|
|
764
801
|
origin: 'runtime',
|
|
765
802
|
tellaskReplyDirective: normalized.tellaskReplyDirective,
|
|
766
803
|
skipTaskdoc: normalized.skipTaskdoc,
|
|
767
|
-
|
|
804
|
+
sideDialogReplyTarget: normalized.sideDialogReplyTarget,
|
|
768
805
|
}
|
|
769
806
|
: normalized.tellaskReplyDirective !== undefined
|
|
770
807
|
? {
|
|
@@ -829,13 +866,13 @@ class Dialog {
|
|
|
829
866
|
return prompt;
|
|
830
867
|
}
|
|
831
868
|
case 'registered_assignment_update':
|
|
832
|
-
case '
|
|
869
|
+
case 'new_course_runtime_sideDialog': {
|
|
833
870
|
const prompt = {
|
|
834
871
|
...promptCommon,
|
|
835
872
|
origin: 'runtime',
|
|
836
873
|
...(state.skipTaskdoc === undefined ? {} : { skipTaskdoc: state.skipTaskdoc }),
|
|
837
874
|
tellaskReplyDirective: state.tellaskReplyDirective,
|
|
838
|
-
|
|
875
|
+
sideDialogReplyTarget: state.sideDialogReplyTarget,
|
|
839
876
|
};
|
|
840
877
|
return prompt;
|
|
841
878
|
}
|
|
@@ -943,7 +980,7 @@ class Dialog {
|
|
|
943
980
|
origin: 'runtime',
|
|
944
981
|
tellaskReplyDirective: options.tellaskReplyDirective,
|
|
945
982
|
skipTaskdoc: options.skipTaskdoc,
|
|
946
|
-
|
|
983
|
+
sideDialogReplyTarget: options.sideDialogReplyTarget,
|
|
947
984
|
runControl: undefined,
|
|
948
985
|
};
|
|
949
986
|
this.enqueueQueuedPromptState(created);
|
|
@@ -957,7 +994,7 @@ class Dialog {
|
|
|
957
994
|
userLanguageCode: options.userLanguageCode ?? existing.userLanguageCode ?? this._lastUserLanguageCode,
|
|
958
995
|
tellaskReplyDirective: options.tellaskReplyDirective,
|
|
959
996
|
skipTaskdoc: options.skipTaskdoc ?? existing.skipTaskdoc,
|
|
960
|
-
|
|
997
|
+
sideDialogReplyTarget: options.sideDialogReplyTarget,
|
|
961
998
|
runControl: undefined,
|
|
962
999
|
};
|
|
963
1000
|
this.replaceQueuedPromptState(existing.msgId, merged);
|
|
@@ -1005,25 +1042,25 @@ class Dialog {
|
|
|
1005
1042
|
if (!trimmedPrompt) {
|
|
1006
1043
|
throw new Error('newCoursePrompt is required to start a new course');
|
|
1007
1044
|
}
|
|
1008
|
-
const combinedPrompt = this instanceof
|
|
1009
|
-
? `${(0, inter_dialog_format_1.
|
|
1010
|
-
fromAgentId: this.
|
|
1045
|
+
const combinedPrompt = this instanceof SideDialog
|
|
1046
|
+
? `${(0, inter_dialog_format_1.formatAssignmentFromAskerDialog)({
|
|
1047
|
+
fromAgentId: this.assignmentFromAsker.originMemberId,
|
|
1011
1048
|
toAgentId: this.agentId,
|
|
1012
|
-
callName: this.
|
|
1013
|
-
mentionList: this.
|
|
1014
|
-
tellaskContent: this.
|
|
1049
|
+
callName: this.assignmentFromAsker.callName,
|
|
1050
|
+
mentionList: this.assignmentFromAsker.mentionList,
|
|
1051
|
+
tellaskContent: this.assignmentFromAsker.tellaskContent,
|
|
1015
1052
|
language: (0, work_language_1.getWorkLanguage)(),
|
|
1016
|
-
collectiveTargets: this.
|
|
1053
|
+
collectiveTargets: this.assignmentFromAsker.collectiveTargets ?? [this.agentId],
|
|
1017
1054
|
})}\n---\n${trimmedPrompt}`
|
|
1018
1055
|
: trimmedPrompt;
|
|
1019
|
-
const basePrompt = this instanceof
|
|
1056
|
+
const basePrompt = this instanceof SideDialog
|
|
1020
1057
|
? {
|
|
1021
1058
|
content: combinedPrompt,
|
|
1022
1059
|
msgId: (0, id_1.generateShortId)(),
|
|
1023
1060
|
grammar: 'markdown',
|
|
1024
1061
|
userLanguageCode: this._lastUserLanguageCode,
|
|
1025
1062
|
origin: 'runtime',
|
|
1026
|
-
...
|
|
1063
|
+
...buildSideDialogAssignmentPromptMeta(this),
|
|
1027
1064
|
}
|
|
1028
1065
|
: {
|
|
1029
1066
|
content: combinedPrompt,
|
|
@@ -1088,9 +1125,11 @@ class Dialog {
|
|
|
1088
1125
|
callName,
|
|
1089
1126
|
status,
|
|
1090
1127
|
content: result,
|
|
1091
|
-
...(options?.
|
|
1092
|
-
|
|
1093
|
-
|
|
1128
|
+
...(options?.callSiteCourse !== undefined
|
|
1129
|
+
? { callSiteCourse: options.callSiteCourse }
|
|
1130
|
+
: {}),
|
|
1131
|
+
...(options?.callSiteGenseq !== undefined
|
|
1132
|
+
? { callSiteGenseq: options.callSiteGenseq }
|
|
1094
1133
|
: {}),
|
|
1095
1134
|
call: {
|
|
1096
1135
|
tellaskContent,
|
|
@@ -1108,11 +1147,11 @@ class Dialog {
|
|
|
1108
1147
|
callName,
|
|
1109
1148
|
status,
|
|
1110
1149
|
content: result,
|
|
1111
|
-
...(options?.
|
|
1112
|
-
? {
|
|
1150
|
+
...(options?.callSiteCourse !== undefined
|
|
1151
|
+
? { callSiteCourse: options.callSiteCourse }
|
|
1113
1152
|
: {}),
|
|
1114
|
-
...(options?.
|
|
1115
|
-
? {
|
|
1153
|
+
...(options?.callSiteGenseq !== undefined
|
|
1154
|
+
? { callSiteGenseq: options.callSiteGenseq }
|
|
1116
1155
|
: {}),
|
|
1117
1156
|
call: {
|
|
1118
1157
|
tellaskContent,
|
|
@@ -1129,11 +1168,11 @@ class Dialog {
|
|
|
1129
1168
|
callName,
|
|
1130
1169
|
status,
|
|
1131
1170
|
content: result,
|
|
1132
|
-
...(options?.
|
|
1133
|
-
? {
|
|
1171
|
+
...(options?.callSiteCourse !== undefined
|
|
1172
|
+
? { callSiteCourse: options.callSiteCourse }
|
|
1134
1173
|
: {}),
|
|
1135
|
-
...(options?.
|
|
1136
|
-
? {
|
|
1174
|
+
...(options?.callSiteGenseq !== undefined
|
|
1175
|
+
? { callSiteGenseq: options.callSiteGenseq }
|
|
1137
1176
|
: {}),
|
|
1138
1177
|
call: {
|
|
1139
1178
|
tellaskContent,
|
|
@@ -1144,22 +1183,22 @@ class Dialog {
|
|
|
1144
1183
|
};
|
|
1145
1184
|
await this.receiveTellaskResult(tellaskResult);
|
|
1146
1185
|
}
|
|
1147
|
-
async receiveTellaskResponse(responderId, callName, mentionList, tellaskContent, status,
|
|
1186
|
+
async receiveTellaskResponse(responderId, callName, mentionList, tellaskContent, status, sideDialogId, options) {
|
|
1148
1187
|
const currentCourse = this.activeGenCourseOrUndefined ?? this.currentCourse;
|
|
1149
1188
|
const resultRoute = {
|
|
1150
|
-
...(
|
|
1189
|
+
...(sideDialogId ? { calleeDialogId: sideDialogId.selfId } : {}),
|
|
1151
1190
|
...(typeof options.calleeCourse === 'number' ? { calleeCourse: options.calleeCourse } : {}),
|
|
1152
1191
|
...(typeof options.calleeGenseq === 'number' ? { calleeGenseq: options.calleeGenseq } : {}),
|
|
1153
1192
|
};
|
|
1154
|
-
const
|
|
1155
|
-
const isCrossCourseResponse =
|
|
1193
|
+
const carryoverCallSiteCourse = options.callSiteCourse;
|
|
1194
|
+
const isCrossCourseResponse = carryoverCallSiteCourse !== undefined && carryoverCallSiteCourse !== currentCourse;
|
|
1156
1195
|
if (isCrossCourseResponse) {
|
|
1157
1196
|
// Cross-course completion is not represented as a tool-result pair in the latest course.
|
|
1158
1197
|
// Instead we write a canonical current-course carryover message that restates the older
|
|
1159
1198
|
// tellask plus its resolution so the latest-course LLM context can read it directly.
|
|
1160
1199
|
if (typeof options.carryoverContent !== 'string') {
|
|
1161
1200
|
throw new Error(`receiveTellaskResponse invariant violation: missing carryover content for cross-course response ` +
|
|
1162
|
-
`(callId=${options.callId}, callName=${callName},
|
|
1201
|
+
`(callId=${options.callId}, callName=${callName}, callSiteCourse=${options.callSiteCourse}, currentCourse=${currentCourse})`);
|
|
1163
1202
|
}
|
|
1164
1203
|
if (options.carryoverContent.trim() === '') {
|
|
1165
1204
|
throw new Error(`receiveTellaskResponse invariant violation: empty carryover content ` +
|
|
@@ -1178,7 +1217,7 @@ class Dialog {
|
|
|
1178
1217
|
genseq: this.activeGenSeqOrUndefined ?? 1,
|
|
1179
1218
|
content: options.carryoverContent,
|
|
1180
1219
|
...(options.contentItems === undefined ? {} : { contentItems: options.contentItems }),
|
|
1181
|
-
|
|
1220
|
+
callSiteCourse: carryoverCallSiteCourse,
|
|
1182
1221
|
carryoverCourse: currentCourse,
|
|
1183
1222
|
responderId,
|
|
1184
1223
|
callName,
|
|
@@ -1212,9 +1251,11 @@ class Dialog {
|
|
|
1212
1251
|
status,
|
|
1213
1252
|
content: options.response,
|
|
1214
1253
|
...(options.contentItems === undefined ? {} : { contentItems: options.contentItems }),
|
|
1215
|
-
...(options.
|
|
1216
|
-
|
|
1217
|
-
|
|
1254
|
+
...(options.callSiteCourse !== undefined
|
|
1255
|
+
? { callSiteCourse: options.callSiteCourse }
|
|
1256
|
+
: {}),
|
|
1257
|
+
...(options.callSiteGenseq !== undefined
|
|
1258
|
+
? { callSiteGenseq: options.callSiteGenseq }
|
|
1218
1259
|
: {}),
|
|
1219
1260
|
call: {
|
|
1220
1261
|
tellaskContent,
|
|
@@ -1237,9 +1278,11 @@ class Dialog {
|
|
|
1237
1278
|
status,
|
|
1238
1279
|
content: options.response,
|
|
1239
1280
|
...(options.contentItems === undefined ? {} : { contentItems: options.contentItems }),
|
|
1240
|
-
...(options.
|
|
1241
|
-
|
|
1242
|
-
|
|
1281
|
+
...(options.callSiteCourse !== undefined
|
|
1282
|
+
? { callSiteCourse: options.callSiteCourse }
|
|
1283
|
+
: {}),
|
|
1284
|
+
...(options.callSiteGenseq !== undefined
|
|
1285
|
+
? { callSiteGenseq: options.callSiteGenseq }
|
|
1243
1286
|
: {}),
|
|
1244
1287
|
call: {
|
|
1245
1288
|
tellaskContent,
|
|
@@ -1260,9 +1303,11 @@ class Dialog {
|
|
|
1260
1303
|
status,
|
|
1261
1304
|
content: options.response,
|
|
1262
1305
|
...(options.contentItems === undefined ? {} : { contentItems: options.contentItems }),
|
|
1263
|
-
...(options.
|
|
1264
|
-
|
|
1265
|
-
|
|
1306
|
+
...(options.callSiteCourse !== undefined
|
|
1307
|
+
? { callSiteCourse: options.callSiteCourse }
|
|
1308
|
+
: {}),
|
|
1309
|
+
...(options.callSiteGenseq !== undefined
|
|
1310
|
+
? { callSiteGenseq: options.callSiteGenseq }
|
|
1266
1311
|
: {}),
|
|
1267
1312
|
call: {
|
|
1268
1313
|
tellaskContent,
|
|
@@ -1291,7 +1336,7 @@ class Dialog {
|
|
|
1291
1336
|
this._activeGenSeq = genseq;
|
|
1292
1337
|
}
|
|
1293
1338
|
// Mark generation as started with the actual genseq
|
|
1294
|
-
// This ensures
|
|
1339
|
+
// This ensures sideDialog_final_response_evt waits for both user_text and generating_start_evt
|
|
1295
1340
|
this.markGenerationStarted();
|
|
1296
1341
|
await this.dlgStore.notifyGeneratingStart(this, msgId);
|
|
1297
1342
|
}
|
|
@@ -1347,10 +1392,6 @@ class Dialog {
|
|
|
1347
1392
|
async sayingFinish() {
|
|
1348
1393
|
await this.dlgStore.sayingFinish(this);
|
|
1349
1394
|
}
|
|
1350
|
-
// Function call events (non-streaming mode - single event captures entire call)
|
|
1351
|
-
async funcCallRequested(funcId, funcName, argumentsStr) {
|
|
1352
|
-
await this.dlgStore.funcCallRequested(this, funcId, funcName, argumentsStr);
|
|
1353
|
-
}
|
|
1354
1395
|
async webSearchCall(payload) {
|
|
1355
1396
|
await this.dlgStore.webSearchCall(this, payload);
|
|
1356
1397
|
}
|
|
@@ -1404,65 +1445,40 @@ class Dialog {
|
|
|
1404
1445
|
async persistTellaskCall(id, name, rawArgumentsText, genseq, options) {
|
|
1405
1446
|
return await this.dlgStore.persistTellaskCall(this, id, name, rawArgumentsText, genseq, options);
|
|
1406
1447
|
}
|
|
1407
|
-
async persistFunctionCallResultPair(id, name, rawArgumentsText, genseq, result) {
|
|
1408
|
-
return await this.dlgStore.persistFunctionCallResultPair(this, id, name, rawArgumentsText, genseq, result);
|
|
1409
|
-
}
|
|
1410
|
-
async persistTellaskCallResultPair(args) {
|
|
1411
|
-
return await this.dlgStore.persistTellaskCallResultPair(this, args);
|
|
1412
|
-
}
|
|
1413
1448
|
/**
|
|
1414
|
-
* Post
|
|
1415
|
-
* Phase 14: No wait - emit immediately with virtual gen markers for Type C
|
|
1449
|
+
* Post sideDialog completion response to this dialog.
|
|
1450
|
+
* Phase 14: No wait - emit immediately with virtual gen markers for Type C sideDialogs
|
|
1416
1451
|
*/
|
|
1417
|
-
async
|
|
1452
|
+
async postSideDialogResponse(sideDialogId, response) {
|
|
1418
1453
|
try {
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
let mentionList;
|
|
1423
|
-
let tellaskContent = response;
|
|
1424
|
-
let originMemberId = responderId;
|
|
1425
|
-
let callId = '';
|
|
1426
|
-
let sessionSlug;
|
|
1427
|
-
try {
|
|
1428
|
-
const metadata = await this.dlgStore.loadDialogMetadata(subdialogId, 'running');
|
|
1429
|
-
if (metadata) {
|
|
1430
|
-
if (metadata.agentId) {
|
|
1431
|
-
responderId = metadata.agentId;
|
|
1432
|
-
responderAgentId = metadata.agentId;
|
|
1433
|
-
originMemberId = metadata.agentId;
|
|
1434
|
-
}
|
|
1435
|
-
if (metadata.assignmentFromSup) {
|
|
1436
|
-
callName = metadata.assignmentFromSup.callName;
|
|
1437
|
-
mentionList = metadata.assignmentFromSup.mentionList;
|
|
1438
|
-
tellaskContent = metadata.assignmentFromSup.tellaskContent;
|
|
1439
|
-
originMemberId = metadata.assignmentFromSup.originMemberId;
|
|
1440
|
-
callId = metadata.assignmentFromSup.callId;
|
|
1441
|
-
}
|
|
1442
|
-
if (typeof metadata.sessionSlug === 'string' && metadata.sessionSlug.trim() !== '') {
|
|
1443
|
-
sessionSlug = metadata.sessionSlug.trim();
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1454
|
+
const metadata = await this.dlgStore.loadDialogMetadata(sideDialogId, 'running');
|
|
1455
|
+
if (!metadata) {
|
|
1456
|
+
throw new Error(`Missing sideDialog metadata for ${sideDialogId.valueOf()}`);
|
|
1446
1457
|
}
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
subdialogId: subdialogId.selfId,
|
|
1451
|
-
error: err,
|
|
1452
|
-
});
|
|
1458
|
+
const assignmentFromAsker = await this.dlgStore.loadSideDialogAssignmentFromAsker(sideDialogId, 'running');
|
|
1459
|
+
if (!assignmentFromAsker) {
|
|
1460
|
+
throw new Error(`Missing sideDialog assignment for ${sideDialogId.valueOf()}`);
|
|
1453
1461
|
}
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1462
|
+
let responderId = sideDialogId.rootId;
|
|
1463
|
+
let responderAgentId;
|
|
1464
|
+
if (metadata.agentId.trim() !== '') {
|
|
1465
|
+
responderId = metadata.agentId;
|
|
1466
|
+
responderAgentId = metadata.agentId;
|
|
1459
1467
|
}
|
|
1468
|
+
const callName = assignmentFromAsker.callName;
|
|
1469
|
+
let mentionList = assignmentFromAsker.mentionList;
|
|
1470
|
+
const tellaskContent = assignmentFromAsker.tellaskContent;
|
|
1471
|
+
const originMemberId = assignmentFromAsker.originMemberId;
|
|
1472
|
+
const callId = assignmentFromAsker.callId;
|
|
1473
|
+
const sessionSlug = typeof metadata.sessionSlug === 'string' && metadata.sessionSlug.trim() !== ''
|
|
1474
|
+
? metadata.sessionSlug.trim()
|
|
1475
|
+
: undefined;
|
|
1460
1476
|
if ((callName === 'tellask' || callName === 'tellaskSessionless') &&
|
|
1461
1477
|
(!Array.isArray(mentionList) || mentionList.length < 1)) {
|
|
1462
1478
|
mentionList = [`@${responderId}`];
|
|
1463
1479
|
}
|
|
1464
1480
|
// NO WAIT - emit immediately with virtual gen markers
|
|
1465
|
-
// Emit virtual generating_start_evt for
|
|
1481
|
+
// Emit virtual generating_start_evt for sideDialog response bubble
|
|
1466
1482
|
await this.notifyGeneratingStart();
|
|
1467
1483
|
const rawResponse = response;
|
|
1468
1484
|
// Emit TellaskResultEvent
|
|
@@ -1470,8 +1486,8 @@ class Dialog {
|
|
|
1470
1486
|
switch (callName) {
|
|
1471
1487
|
case 'tellask':
|
|
1472
1488
|
if (!sessionSlug) {
|
|
1473
|
-
throw new Error(`
|
|
1474
|
-
`(dialogId=${this.id.selfId},
|
|
1489
|
+
throw new Error(`postSideDialogResponse invariant violation: missing sessionSlug for tellask ` +
|
|
1490
|
+
`(dialogId=${this.id.selfId}, sideDialogId=${sideDialogId.selfId}, callId=${callId})`);
|
|
1475
1491
|
}
|
|
1476
1492
|
return {
|
|
1477
1493
|
type: 'tellask_result_evt',
|
|
@@ -1491,7 +1507,7 @@ class Dialog {
|
|
|
1491
1507
|
originMemberId,
|
|
1492
1508
|
},
|
|
1493
1509
|
route: {
|
|
1494
|
-
calleeDialogId:
|
|
1510
|
+
calleeDialogId: sideDialogId.selfId,
|
|
1495
1511
|
},
|
|
1496
1512
|
};
|
|
1497
1513
|
case 'tellaskSessionless':
|
|
@@ -1512,7 +1528,7 @@ class Dialog {
|
|
|
1512
1528
|
originMemberId,
|
|
1513
1529
|
},
|
|
1514
1530
|
route: {
|
|
1515
|
-
calleeDialogId:
|
|
1531
|
+
calleeDialogId: sideDialogId.selfId,
|
|
1516
1532
|
},
|
|
1517
1533
|
};
|
|
1518
1534
|
case 'freshBootsReasoning':
|
|
@@ -1532,7 +1548,7 @@ class Dialog {
|
|
|
1532
1548
|
originMemberId,
|
|
1533
1549
|
},
|
|
1534
1550
|
route: {
|
|
1535
|
-
calleeDialogId:
|
|
1551
|
+
calleeDialogId: sideDialogId.selfId,
|
|
1536
1552
|
},
|
|
1537
1553
|
};
|
|
1538
1554
|
}
|
|
@@ -1542,44 +1558,70 @@ class Dialog {
|
|
|
1542
1558
|
await this.notifyGeneratingFinish();
|
|
1543
1559
|
}
|
|
1544
1560
|
catch (err) {
|
|
1545
|
-
log_1.log.
|
|
1561
|
+
log_1.log.error('Failed to post tellask_result_evt event', err, {
|
|
1546
1562
|
error: err,
|
|
1547
1563
|
message: err instanceof Error ? err.message : String(err),
|
|
1548
1564
|
});
|
|
1565
|
+
throw err;
|
|
1549
1566
|
}
|
|
1550
1567
|
}
|
|
1551
1568
|
}
|
|
1552
1569
|
exports.Dialog = Dialog;
|
|
1553
1570
|
/**
|
|
1554
|
-
*
|
|
1555
|
-
* Stores the
|
|
1571
|
+
* SideDialog - A sideDialog created by a MainDialog for autonomous tellask Side Dialog work.
|
|
1572
|
+
* Stores the main dialog for registry and lookup, and resolves its effective askerDialog dynamically.
|
|
1556
1573
|
*/
|
|
1557
|
-
class
|
|
1558
|
-
constructor(dlgStore,
|
|
1574
|
+
class SideDialog extends Dialog {
|
|
1575
|
+
constructor(dlgStore, mainDialog, taskDocPath, id, agentId, askerStack, sessionSlug, initialState) {
|
|
1559
1576
|
super(dlgStore, taskDocPath, id, agentId, initialState);
|
|
1560
1577
|
this._fbrConclusionToolsEnabled = false;
|
|
1561
|
-
this.
|
|
1578
|
+
this.mainDialog = mainDialog;
|
|
1562
1579
|
this.sessionSlug = sessionSlug;
|
|
1563
|
-
this.
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1580
|
+
this.askerStack = askerStack;
|
|
1581
|
+
const top = getSideDialogAskerStackTop(askerStack);
|
|
1582
|
+
const assignmentFromAsker = getSideDialogAskerStackCurrentAssignment(askerStack);
|
|
1583
|
+
if (top.assignmentFromAsker !== undefined &&
|
|
1584
|
+
top.askerDialogId !== assignmentFromAsker.askerDialogId) {
|
|
1585
|
+
throw new Error(`SideDialog askerStack invariant violation: askerDialogId must match assignment askerDialogId ` +
|
|
1586
|
+
`(rootId=${mainDialog.id.rootId}, selfId=${this.id.selfId}, frameAskerDialogId=${top.askerDialogId}, assignmentAskerDialogId=${assignmentFromAsker.askerDialogId})`);
|
|
1568
1587
|
}
|
|
1569
|
-
|
|
1570
|
-
|
|
1588
|
+
const resolvedAskerDialog = mainDialog.lookupDialog(top.askerDialogId);
|
|
1589
|
+
if (resolvedAskerDialog && resolvedAskerDialog.id.selfId === this.id.selfId) {
|
|
1590
|
+
throw new Error(`SideDialog askerDialog invariant violation: asker resolved to self ` +
|
|
1591
|
+
`(rootId=${mainDialog.id.rootId}, selfId=${this.id.selfId}, askerDialogId=${top.askerDialogId})`);
|
|
1571
1592
|
}
|
|
1572
|
-
else {
|
|
1573
|
-
throw new Error(`
|
|
1574
|
-
`(rootId=${
|
|
1593
|
+
else if (!resolvedAskerDialog) {
|
|
1594
|
+
throw new Error(`SideDialog askerDialog invariant violation: asker missing from root registry ` +
|
|
1595
|
+
`(rootId=${mainDialog.id.rootId}, selfId=${this.id.selfId}, askerDialogId=${top.askerDialogId})`);
|
|
1596
|
+
}
|
|
1597
|
+
this.mainDialog.registerDialog(this);
|
|
1598
|
+
}
|
|
1599
|
+
get assignmentFromAsker() {
|
|
1600
|
+
return getSideDialogAskerStackCurrentAssignment(this.askerStack);
|
|
1601
|
+
}
|
|
1602
|
+
set assignmentFromAsker(assignment) {
|
|
1603
|
+
const nextFrame = buildSideDialogAskerStack({
|
|
1604
|
+
askerDialogId: assignment.askerDialogId,
|
|
1605
|
+
assignment,
|
|
1606
|
+
}).askerStack[0];
|
|
1607
|
+
if (!nextFrame) {
|
|
1608
|
+
throw new Error(`SideDialog assignment stack invariant violation: empty generated frame`);
|
|
1575
1609
|
}
|
|
1576
|
-
this.
|
|
1610
|
+
this.askerStack = {
|
|
1611
|
+
askerStack: [...this.askerStack.askerStack, nextFrame],
|
|
1612
|
+
};
|
|
1577
1613
|
}
|
|
1578
|
-
get
|
|
1579
|
-
|
|
1614
|
+
get askerDialog() {
|
|
1615
|
+
const askerDialogId = getSideDialogAskerStackTop(this.askerStack).askerDialogId;
|
|
1616
|
+
const resolved = this.mainDialog.lookupDialog(askerDialogId);
|
|
1617
|
+
if (!resolved || resolved.id.selfId === this.id.selfId) {
|
|
1618
|
+
throw new Error(`SideDialog askerDialog invariant violation: asker missing or self ` +
|
|
1619
|
+
`(rootId=${this.mainDialog.id.rootId}, selfId=${this.id.selfId}, askerDialogId=${askerDialogId})`);
|
|
1620
|
+
}
|
|
1621
|
+
return resolved;
|
|
1580
1622
|
}
|
|
1581
1623
|
get status() {
|
|
1582
|
-
return this.
|
|
1624
|
+
return this.mainDialog.status;
|
|
1583
1625
|
}
|
|
1584
1626
|
setFbrConclusionToolsEnabled(enabled) {
|
|
1585
1627
|
this._fbrConclusionToolsEnabled = enabled;
|
|
@@ -1588,26 +1630,26 @@ class SubDialog extends Dialog {
|
|
|
1588
1630
|
return this._fbrConclusionToolsEnabled;
|
|
1589
1631
|
}
|
|
1590
1632
|
/**
|
|
1591
|
-
* Create a
|
|
1592
|
-
* The new
|
|
1633
|
+
* Create a sideDialog under the same main dialog tree.
|
|
1634
|
+
* The new sideDialog's effective askerDialog is resolved via AssignmentFromAsker.askerDialogId.
|
|
1593
1635
|
*/
|
|
1594
|
-
async
|
|
1595
|
-
return await this.dlgStore.
|
|
1636
|
+
async createSideDialog(targetAgentId, mentionList, tellaskContent, options) {
|
|
1637
|
+
return await this.dlgStore.createSideDialog(this, targetAgentId, mentionList, tellaskContent, options);
|
|
1596
1638
|
}
|
|
1597
1639
|
}
|
|
1598
|
-
exports.
|
|
1640
|
+
exports.SideDialog = SideDialog;
|
|
1599
1641
|
/**
|
|
1600
|
-
*
|
|
1642
|
+
* MainDialog - The main/main dialog that can create and manage sideDialogs.
|
|
1601
1643
|
* Uses in-memory registries for O(1) dialog and Type B lookup.
|
|
1602
1644
|
*/
|
|
1603
|
-
class
|
|
1645
|
+
class MainDialog extends Dialog {
|
|
1604
1646
|
constructor(dlgStore, taskDocPath, id, agentId, initialState) {
|
|
1605
1647
|
super(dlgStore, taskDocPath, id, agentId, initialState);
|
|
1606
1648
|
this._status = 'running';
|
|
1607
1649
|
// Tracks all dialogs in this dialog tree for O(1) lookup
|
|
1608
1650
|
this._localRegistry = new Map();
|
|
1609
|
-
// Tracks Type-B registered
|
|
1610
|
-
this.
|
|
1651
|
+
// Tracks Type-B registered sideDialogs by agentId!sessionSlug
|
|
1652
|
+
this._sideDialogRegistry = new Map();
|
|
1611
1653
|
this.registerDialog(this);
|
|
1612
1654
|
}
|
|
1613
1655
|
get status() {
|
|
@@ -1617,7 +1659,7 @@ class RootDialog extends Dialog {
|
|
|
1617
1659
|
this._status = status;
|
|
1618
1660
|
}
|
|
1619
1661
|
/**
|
|
1620
|
-
* Register a dialog (self or
|
|
1662
|
+
* Register a dialog (self or sideDialog) in the local registry.
|
|
1621
1663
|
*/
|
|
1622
1664
|
registerDialog(dialog) {
|
|
1623
1665
|
this._localRegistry.set(dialog.id.selfId, dialog);
|
|
@@ -1643,71 +1685,71 @@ class RootDialog extends Dialog {
|
|
|
1643
1685
|
/**
|
|
1644
1686
|
* Generate a registry key from agentId and sessionSlug.
|
|
1645
1687
|
*/
|
|
1646
|
-
static
|
|
1688
|
+
static makeSideDialogKey(agentId, sessionSlug) {
|
|
1647
1689
|
return `${agentId}!${sessionSlug}`;
|
|
1648
1690
|
}
|
|
1649
1691
|
/**
|
|
1650
|
-
* Register a Type-B
|
|
1692
|
+
* Register a Type-B sideDialog for resumption.
|
|
1651
1693
|
*/
|
|
1652
|
-
|
|
1653
|
-
if (!
|
|
1694
|
+
registerSideDialog(sideDialog) {
|
|
1695
|
+
if (!sideDialog.sessionSlug) {
|
|
1654
1696
|
return;
|
|
1655
1697
|
}
|
|
1656
|
-
const key =
|
|
1657
|
-
this.
|
|
1658
|
-
this.registerDialog(
|
|
1698
|
+
const key = MainDialog.makeSideDialogKey(sideDialog.agentId, sideDialog.sessionSlug);
|
|
1699
|
+
this._sideDialogRegistry.set(key, sideDialog);
|
|
1700
|
+
this.registerDialog(sideDialog);
|
|
1659
1701
|
}
|
|
1660
1702
|
/**
|
|
1661
|
-
* Lookup a Type-B
|
|
1703
|
+
* Lookup a Type-B sideDialog by agentId and sessionSlug.
|
|
1662
1704
|
*/
|
|
1663
|
-
|
|
1664
|
-
const key =
|
|
1665
|
-
return this.
|
|
1705
|
+
lookupSideDialog(agentId, sessionSlug) {
|
|
1706
|
+
const key = MainDialog.makeSideDialogKey(agentId, sessionSlug);
|
|
1707
|
+
return this._sideDialogRegistry.get(key);
|
|
1666
1708
|
}
|
|
1667
1709
|
/**
|
|
1668
|
-
* Remove a Type-B
|
|
1710
|
+
* Remove a Type-B sideDialog from registry.
|
|
1669
1711
|
*/
|
|
1670
|
-
|
|
1671
|
-
const key =
|
|
1672
|
-
const
|
|
1673
|
-
if (
|
|
1674
|
-
this._localRegistry.delete(
|
|
1675
|
-
return this.
|
|
1712
|
+
unregisterSideDialog(agentId, sessionSlug) {
|
|
1713
|
+
const key = MainDialog.makeSideDialogKey(agentId, sessionSlug);
|
|
1714
|
+
const sideDialog = this._sideDialogRegistry.get(key);
|
|
1715
|
+
if (sideDialog) {
|
|
1716
|
+
this._localRegistry.delete(sideDialog.id.selfId);
|
|
1717
|
+
return this._sideDialogRegistry.delete(key);
|
|
1676
1718
|
}
|
|
1677
1719
|
return false;
|
|
1678
1720
|
}
|
|
1679
1721
|
/**
|
|
1680
|
-
* Get all registered
|
|
1722
|
+
* Get all registered sideDialogs.
|
|
1681
1723
|
*/
|
|
1682
|
-
|
|
1683
|
-
return Array.from(this.
|
|
1724
|
+
getRegisteredSideDialogs() {
|
|
1725
|
+
return Array.from(this._sideDialogRegistry.values());
|
|
1684
1726
|
}
|
|
1685
1727
|
/**
|
|
1686
|
-
* Create a new
|
|
1728
|
+
* Create a new sideDialog for autonomous tellask Side Dialog work.
|
|
1687
1729
|
*/
|
|
1688
|
-
async
|
|
1689
|
-
return await this.dlgStore.
|
|
1730
|
+
async createSideDialog(targetAgentId, mentionList, tellaskContent, options) {
|
|
1731
|
+
return await this.dlgStore.createSideDialog(this, targetAgentId, mentionList, tellaskContent, options);
|
|
1690
1732
|
}
|
|
1691
1733
|
/**
|
|
1692
|
-
* Save
|
|
1734
|
+
* Save sideDialog registry to disk (registry.yaml).
|
|
1693
1735
|
*/
|
|
1694
|
-
async
|
|
1695
|
-
const entries = Array.from(this.
|
|
1736
|
+
async saveSideDialogRegistry() {
|
|
1737
|
+
const entries = Array.from(this._sideDialogRegistry.entries()).map(([key, sideDialog]) => ({
|
|
1696
1738
|
key,
|
|
1697
|
-
|
|
1698
|
-
agentId:
|
|
1699
|
-
sessionSlug:
|
|
1739
|
+
sideDialogId: sideDialog.id,
|
|
1740
|
+
agentId: sideDialog.agentId,
|
|
1741
|
+
sessionSlug: sideDialog.sessionSlug,
|
|
1700
1742
|
}));
|
|
1701
|
-
await this.dlgStore.
|
|
1743
|
+
await this.dlgStore.saveSideDialogRegistry(this, this.id, entries, this.status);
|
|
1702
1744
|
}
|
|
1703
1745
|
/**
|
|
1704
|
-
* Load
|
|
1746
|
+
* Load sideDialog registry from disk (registry.yaml).
|
|
1705
1747
|
*/
|
|
1706
|
-
async
|
|
1707
|
-
await this.dlgStore.
|
|
1748
|
+
async loadSideDialogRegistry() {
|
|
1749
|
+
await this.dlgStore.loadSideDialogRegistry(this, this.status);
|
|
1708
1750
|
}
|
|
1709
1751
|
}
|
|
1710
|
-
exports.
|
|
1752
|
+
exports.MainDialog = MainDialog;
|
|
1711
1753
|
/**
|
|
1712
1754
|
* The UI showing a dialog in realtime
|
|
1713
1755
|
*/
|
|
@@ -1717,32 +1759,36 @@ class DialogStore {
|
|
|
1717
1759
|
*
|
|
1718
1760
|
* impl here serves for demo purpose only
|
|
1719
1761
|
*
|
|
1720
|
-
* @param
|
|
1762
|
+
* @param askerDialog
|
|
1721
1763
|
* @param targetAgentId
|
|
1722
1764
|
* @param mentionList
|
|
1723
1765
|
* @param tellaskContent
|
|
1724
1766
|
* @returns
|
|
1725
1767
|
*/
|
|
1726
|
-
async
|
|
1768
|
+
async createSideDialog(askerDialog, targetAgentId, mentionList, tellaskContent, options) {
|
|
1727
1769
|
const generatedId = (0, id_2.generateDialogID)();
|
|
1728
|
-
const
|
|
1729
|
-
?
|
|
1730
|
-
:
|
|
1731
|
-
?
|
|
1770
|
+
const mainDialog = askerDialog instanceof MainDialog
|
|
1771
|
+
? askerDialog
|
|
1772
|
+
: askerDialog instanceof SideDialog
|
|
1773
|
+
? askerDialog.mainDialog
|
|
1732
1774
|
: (() => {
|
|
1733
|
-
throw new Error(`
|
|
1775
|
+
throw new Error(`createSideDialog invariant violation: unsupported asker type (${askerDialog.constructor.name})`);
|
|
1734
1776
|
})();
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1777
|
+
const sideDialogId = new DialogID(generatedId, mainDialog.id.rootId);
|
|
1778
|
+
const assignment = {
|
|
1737
1779
|
callName: options.callName,
|
|
1738
1780
|
mentionList,
|
|
1739
1781
|
tellaskContent,
|
|
1740
1782
|
originMemberId: options.originMemberId,
|
|
1741
|
-
|
|
1783
|
+
askerDialogId: options.askerDialogId,
|
|
1742
1784
|
callId: options.callId,
|
|
1743
1785
|
collectiveTargets: options.collectiveTargets,
|
|
1744
1786
|
effectiveFbrEffort: options.effectiveFbrEffort,
|
|
1745
|
-
}
|
|
1787
|
+
};
|
|
1788
|
+
return new SideDialog(this, mainDialog, askerDialog.taskDocPath, sideDialogId, targetAgentId, buildSideDialogAskerStack({
|
|
1789
|
+
askerDialogId: options.askerDialogId,
|
|
1790
|
+
assignment,
|
|
1791
|
+
}), options.sessionSlug);
|
|
1746
1792
|
}
|
|
1747
1793
|
/**
|
|
1748
1794
|
* Receive and handle LLM generation streams (Markdown stream + tellask call stream)
|
|
@@ -1779,19 +1825,20 @@ class DialogStore {
|
|
|
1779
1825
|
async loadDialogMetadata(_dialogId, _status) {
|
|
1780
1826
|
return null;
|
|
1781
1827
|
}
|
|
1782
|
-
async
|
|
1828
|
+
async loadSideDialogAssignmentFromAsker(_dialogId, _status) {
|
|
1829
|
+
return null;
|
|
1830
|
+
}
|
|
1831
|
+
async loadPendingSideDialogs(_dialogId, _status) {
|
|
1783
1832
|
return [];
|
|
1784
1833
|
}
|
|
1785
|
-
async
|
|
1786
|
-
async
|
|
1834
|
+
async saveSideDialogRegistry(_dialog, _mainDialogId, _entries, _status) { }
|
|
1835
|
+
async loadSideDialogRegistry(_mainDialog, _status) { }
|
|
1787
1836
|
/**
|
|
1788
1837
|
* Clear Questions for Human state in storage
|
|
1789
1838
|
*/
|
|
1790
1839
|
async clearQuestions4Human(_dialog) { }
|
|
1791
1840
|
// Tellask-special call lifecycle methods
|
|
1792
1841
|
async callingStart(_dialog, _payload) { }
|
|
1793
|
-
// Function call event (non-streaming mode - single event)
|
|
1794
|
-
async funcCallRequested(_dialog, _funcId, _funcName, _argumentsStr) { }
|
|
1795
1842
|
async webSearchCall(_dialog, _payload) { }
|
|
1796
1843
|
async nativeToolCall(_dialog, _payload) { }
|
|
1797
1844
|
async toolResultImageIngest(_dialog, _payload) { }
|
|
@@ -1835,8 +1882,6 @@ class DialogStore {
|
|
|
1835
1882
|
*/
|
|
1836
1883
|
async persistFunctionCall(_dialog, _id, _name, _rawArgumentsText, _genseq) { }
|
|
1837
1884
|
async persistTellaskCall(_dialog, _id, _name, _rawArgumentsText, _genseq, _options) { }
|
|
1838
|
-
async persistFunctionCallResultPair(_dialog, _id, _name, _rawArgumentsText, _genseq, _result) { }
|
|
1839
|
-
async persistTellaskCallResultPair(_dialog, _args) { }
|
|
1840
1885
|
/**
|
|
1841
1886
|
* Start a new course in storage
|
|
1842
1887
|
*/
|