@xopcai/xopc 0.0.285 → 0.0.286
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/browser-ext/dist/assets/{auth-DB30ywek.js → auth-BXCWrPlg.js} +1 -1
- package/dist/browser-ext/dist/background.js +2 -2
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +136 -136
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/adapters/gateway-setup.js +14 -14
- package/dist/extensions/feishu/src/state/message-bindings.d.ts +1 -1
- package/dist/extensions/feishu/src/state/thread-bindings.d.ts +4 -4
- package/dist/extensions/feishu/src/state/thread-bindings.js +6 -6
- package/dist/extensions/feishu/src/subagent-hooks.d.ts +1 -1
- package/dist/extensions/feishu/src/subagent-hooks.js +5 -5
- package/dist/extensions/feishu/src/transport/socket-mode/monitor.js +9 -9
- package/dist/extensions/feishu/src/transport/webhook/monitor.js +4 -4
- package/dist/extensions/feishu/src/workflow-progress.d.ts +1 -1
- package/dist/extensions/feishu/src/workflow-progress.js +8 -7
- package/dist/extensions/telegram/src/approval-store.d.ts +2 -2
- package/dist/extensions/telegram/src/approval-store.js +1 -1
- package/dist/extensions/telegram/src/command-handler.d.ts +2 -2
- package/dist/extensions/telegram/src/command-handler.js +8 -8
- package/dist/extensions/telegram/src/delivery-chat-id.d.ts +1 -1
- package/dist/extensions/telegram/src/delivery-chat-id.js +7 -3
- package/dist/extensions/telegram/src/exec-approval-handler.js +1 -1
- package/dist/extensions/telegram/src/focus-handler.d.ts +2 -2
- package/dist/extensions/telegram/src/focus-handler.js +10 -10
- package/dist/extensions/telegram/src/inbound-processor.d.ts +3 -3
- package/dist/extensions/telegram/src/inbound-processor.js +11 -11
- package/dist/extensions/telegram/src/plugin.js +5 -5
- package/dist/extensions/telegram/src/routing-integration.d.ts +1 -1
- package/dist/extensions/telegram/src/routing-integration.js +19 -21
- package/dist/extensions/telegram/src/thread-bindings.d.ts +1 -1
- package/dist/extensions/telegram/src/workflow-progress.js +8 -7
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/auth/login-qr.d.ts +4 -4
- package/dist/extensions/weixin/src/auth/login-qr.js +21 -21
- package/dist/extensions/weixin/src/auth/weixin-account-id.d.ts +1 -1
- package/dist/extensions/weixin/src/auth/weixin-account-id.js +1 -1
- package/dist/extensions/weixin/src/cli/gateway-qr-login.d.ts +2 -2
- package/dist/extensions/weixin/src/cli/gateway-qr-login.js +13 -13
- package/dist/extensions/weixin/src/cli/qr-login.js +1 -1
- package/dist/extensions/weixin/src/delivery-to.js +6 -2
- package/dist/extensions/weixin/src/messaging/inbound.d.ts +1 -1
- package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
- package/dist/extensions/weixin/src/messaging/process-message.js +3 -3
- package/dist/extensions/weixin/src/plugin.js +5 -5
- package/dist/extensions/weixin/src/routing-integration.d.ts +1 -1
- package/dist/extensions/weixin/src/routing-integration.js +3 -3
- package/dist/extensions/weixin/src/workflow-progress.d.ts +1 -1
- package/dist/extensions/weixin/src/workflow-progress.js +7 -6
- package/dist/gateway/static/root/assets/{activity-store-B0BTIk9j.js → activity-store-xOhV8FHx.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Dc-0QZTQ.js → agent-avatar-dicebear-BzQbYWEj.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-CcmqK1Sc.js → agent-defaults-settings-panel-BxR5eog4.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-B_7PVt7S.js → agents-Dx1om1eN.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Coly9ab6.js → api-CVJQLBv9.js} +1 -1
- package/dist/gateway/static/root/assets/api-q1kIMCLW.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-TWBO-msg.js → app-management-settings-panel-CTyuXkNC.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CpTZ2KuT.js → appearance-settings-Tk-GJtvF.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BA-7OrhJ.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-z_u6alob.js → archive-plugin-O49jeeXo.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-C2nS04TC.js → attachment-load-r9lBF2tW.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-aIBsw9zR.js → automations-page-CFFLXYgS.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-BRQlU4qk.js → automations-workspace-DUZE1NOH.js} +3 -3
- package/dist/gateway/static/root/assets/{binary-plugins-CGmXoZnl.js → binary-plugins-BpM43vsn.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CtvzCZhC.js → block-editor-DFrfEcGw.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BOTU1isH.js → browser-automation-inputs-CyHGQwxQ.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BwU5V8J0.js → browser-automations-page-CPkOWfM9.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DDjbDeHQ.js → browser-settings-page-BOcseZxg.js} +2 -2
- package/dist/gateway/static/root/assets/button-CGlRPNzi.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-ohEV64hG.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-UOf9mgqt.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-Dfi0Desh.js → channels-status-swr-BArPeImO.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-B0MvcO6j.js → chat-terminal-dock-D5Aka4S8.js} +2 -2
- package/dist/gateway/static/root/assets/{connectors-page-L8JehrxF.js → connectors-page-BEQR0NRq.js} +2 -2
- package/dist/gateway/static/root/assets/{cron-expression-CjrWuy2m.js → cron-expression-GDPX4NxC.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DXOvbHCr.js → date-picker-DNtRu6EB.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BEnC-eS0.js → dependency-picker-Dng3dIQa.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-BicYycxy.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CYyjcSn6.js → desktop-pet-settings-BEse55eX.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-BPMGvAKE.js → device-pairing-wizard-be30HuFI.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-H_aPMGXW.js → extension-debug-page-YzhYyuay.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C1JnpeMt.js → extension-page-CEXVIkDl.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-CrlbgK8g.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-G2lQt7Ak.js → gateway-config-swr-BNuoHXiZ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-CDJY1AOW.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-GP31PUrG.js → gateway-startup-retry-zMPfje0n.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-C7fjiowt.js → heartbeat-settings-BtxitqZ3.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-DZXeXdUL.js → home-page-_oqo0pNR.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-CKFhfHSw.js → image-generation-api-B_Tyx74A.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-GROumhj8.js → imports-page-eZciuLw_.js} +1 -1
- package/dist/gateway/static/root/assets/index--YC42LAz.css +2 -0
- package/dist/gateway/static/root/assets/index-fVtuw2o9.js +75 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-zcI822m_.js → keyboard-shortcuts-settings-B796W039.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CAEKGTAg.js → local-app-workbench-page-Z8mpau9d.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BtgDJ92Q.js → local-apps-page-DXmY5jwM.js} +1 -1
- package/dist/gateway/static/root/assets/locale-store-D0001I7p.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-BGOO8ouT.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-DasZxCyD.js → management-settings-b1MG7s-3.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-6oYdBahT.js → markdown-view-2txE_Blz.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CxthbBvk.js → media-plugins-CDEf3ksI.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BWANv-N-.js +3 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-BcWq3ddw.js → note-detail-panel-Bm33_3xJ.js} +3 -3
- package/dist/gateway/static/root/assets/notes-page-C32-xssK.js +8 -0
- package/dist/gateway/static/root/assets/page-tabs-Bi_-DA5J.js +1 -0
- package/dist/gateway/static/root/assets/popover-select-DldSX8GX.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Bevpbq9f.js → preview-open-alternatives-Dhfdf14p.js} +1 -1
- package/dist/gateway/static/root/assets/proactive-page-BNouL7Tv.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-Bi1seZpM.js → product-open-page-BkbZBqBr.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CZ7glGYw.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DP3ZINZz.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-D0ddwBFj.js → registry-api-icwoEKYB.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-xqJcPdOO.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Wkru8_My.js → runtime-tools-settings-panel-bmgxwWpW.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-CSMRzj9Y.js → schema-form-DoZeepCg.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-Hj9uFcIO.js → sessions-page-BaxIfjpm.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cy3Ab3Vg.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-sw2bbS2b.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-BcQGAnCs.js → settings-page-BWF8uac0.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-layout-CsUQKRq0.js +1 -0
- package/dist/gateway/static/root/assets/{setup-status-panel-DzxmsaQG.js → setup-status-panel-BuYto2mT.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DQocUl-1.js → share-preview-page-BIHYD6-O.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DKtWUneq.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Dn7ElMUk.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-AmqtBJo7.js → skills-page-D-7UtJIc.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DtlfCgJp.js → skills-page.utils-dvue6Ish.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Ct698Nf-.js → system-settings-panel-DCyxPWCl.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-efmH43Pq.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-ng8KJsAT.js → theme-store-CZwYGpbY.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-__auf8Ww.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-BSyxRHt2.js → use-autosave-Iq83UDt3.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-DIEHnAER.js → user-model-page-DByIJcQq.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-SE3OQI1s.js → voice-api-key-field-D-QssKik.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-VNuCmdFe.js → voice-config-api-B0wNN_tE.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Dn1vy2oq.js → work-discovery-overlay-5NRYg1iI.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BJEfGY-k.js → workflow-run-setup-panel-Ds2SZjLG.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-DgRNIyr7.js → workflows-page-BJv3eoKR.js} +2 -2
- package/dist/gateway/static/root/index.html +12 -12
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-protocol/src/index.js +312 -305
- package/dist/packages/gateway-contract/src/agent-stream.js +6 -0
- package/dist/packages/gateway-contract/src/automations.js +215 -0
- package/dist/packages/gateway-contract/src/browser-page-context.js +48 -39
- package/dist/packages/gateway-contract/src/browser-tab-binding.js +30 -25
- package/dist/packages/gateway-contract/src/clarifications.js +6 -0
- package/dist/packages/gateway-contract/src/connection-waits.js +6 -0
- package/dist/packages/gateway-contract/src/conversation-identity.js +17 -0
- package/dist/packages/gateway-contract/src/device-pairing.js +84 -78
- package/dist/packages/gateway-contract/src/discussions.js +19 -15
- package/dist/packages/gateway-contract/src/files.js +55 -0
- package/dist/packages/gateway-contract/src/home.js +188 -0
- package/dist/packages/gateway-contract/src/index.js +65 -0
- package/dist/packages/gateway-contract/src/mobile-privacy.js +26 -0
- package/dist/packages/gateway-contract/src/model-selection.js +4 -1
- package/dist/packages/gateway-contract/src/new-session.js +5 -1
- package/dist/packages/gateway-contract/src/notifications.js +64 -59
- package/dist/packages/gateway-contract/src/proactive.js +133 -128
- package/dist/packages/gateway-contract/src/product-delivery.js +56 -50
- package/dist/packages/gateway-contract/src/project-monitoring.js +33 -28
- package/dist/packages/gateway-contract/src/project-operating.js +100 -0
- package/dist/packages/gateway-contract/src/session-identity.js +38 -34
- package/dist/packages/gateway-contract/src/session-input-reliability.js +6 -0
- package/dist/packages/gateway-contract/src/sessions.js +145 -0
- package/dist/packages/gateway-contract/src/task-lifecycle.js +69 -64
- package/dist/packages/gateway-contract/src/task-runs.js +80 -75
- package/dist/packages/gateway-contract/src/tasks.js +445 -438
- package/dist/packages/gateway-contract/src/tool-activity.js +154 -149
- package/dist/packages/gateway-contract/src/turn-outcome.js +118 -112
- package/dist/packages/gateway-contract/src/user-message-display.js +13 -8
- package/dist/packages/gateway-contract/src/welcome-suggestions.js +6 -0
- package/dist/packages/realtime-client/src/index.js +1 -1
- package/dist/packages/realtime-protocol/src/index.js +4 -2
- package/dist/packages/realtime-protocol/src/voice.js +4 -4
- package/dist/src/activity/types.d.ts +1 -1
- package/dist/src/agent/agent-instance-gateway.d.ts +18 -18
- package/dist/src/agent/agent-manager.d.ts +27 -27
- package/dist/src/agent/agent-manager.js +180 -179
- package/dist/src/agent/background-review/coordinator.d.ts +3 -3
- package/dist/src/agent/background-review/coordinator.js +10 -10
- package/dist/src/agent/background-review/run-background-review.d.ts +1 -1
- package/dist/src/agent/background-review/run-background-review.js +14 -14
- package/dist/src/agent/bootstrap/bootstrap-cache.d.ts +4 -4
- package/dist/src/agent/bootstrap/bootstrap-cache.js +9 -9
- package/dist/src/agent/bootstrap/bootstrap-files.d.ts +4 -4
- package/dist/src/agent/bootstrap/bootstrap-files.js +9 -9
- package/dist/src/agent/bootstrap/filter-bootstrap-files.d.ts +1 -1
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +3 -3
- package/dist/src/agent/child-agent-factory.d.ts +3 -3
- package/dist/src/agent/child-agent-factory.js +5 -5
- package/dist/src/agent/coding/workspace-revision.js +1 -1
- package/dist/src/agent/commands/command-registry.js +2 -1
- package/dist/src/agent/context/audit.d.ts +2 -2
- package/dist/src/agent/context/audit.js +5 -4
- package/dist/src/agent/context/coordinator.d.ts +6 -6
- package/dist/src/agent/context/coordinator.js +13 -13
- package/dist/src/agent/context/execution-context.js +4 -3
- package/dist/src/agent/context/execution-scope.d.ts +3 -3
- package/dist/src/agent/context/execution-scope.js +13 -13
- package/dist/src/agent/context/project-context.d.ts +1 -1
- package/dist/src/agent/context/project-context.js +4 -4
- package/dist/src/agent/embedded/execution-context.d.ts +1 -1
- package/dist/src/agent/embedded/execution-context.js +3 -3
- package/dist/src/agent/embedded/index.d.ts +1 -1
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/run-for-session.d.ts +1 -1
- package/dist/src/agent/embedded/run-for-session.js +78 -104
- package/dist/src/agent/embedded/run-turn.js +77 -33
- package/dist/src/agent/embedded/runs.d.ts +11 -11
- package/dist/src/agent/embedded/runs.js +22 -22
- package/dist/src/agent/embedded/session-runner.d.ts +2 -2
- package/dist/src/agent/embedded/session-runner.js +5 -5
- package/dist/src/agent/embedded/session-tool-result-guard.d.ts +2 -2
- package/dist/src/agent/embedded/session-tool-result-guard.js +8 -8
- package/dist/src/agent/embedded/sqlite-hydrating-session-manager.d.ts +2 -2
- package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js +4 -4
- package/dist/src/agent/embedded/transcript-runtime.d.ts +4 -3
- package/dist/src/agent/embedded/transcript-runtime.js +33 -20
- package/dist/src/agent/embedded/types.d.ts +2 -1
- package/dist/src/agent/external-tools/composio-provider.d.ts +1 -1
- package/dist/src/agent/external-tools/composio-provider.js +12 -11
- package/dist/src/agent/external-tools/endpoint-provider.js +1 -1
- package/dist/src/agent/external-tools/extension-provider.d.ts +1 -1
- package/dist/src/agent/external-tools/extension-provider.js +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +9 -8
- package/dist/src/agent/external-tools/index.js +3 -3
- package/dist/src/agent/external-tools/mcp-provider.d.ts +2 -2
- package/dist/src/agent/external-tools/mcp-provider.js +8 -8
- package/dist/src/agent/external-tools/memory-provider.d.ts +1 -1
- package/dist/src/agent/external-tools/memory-provider.js +1 -1
- package/dist/src/agent/external-tools/types.d.ts +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.d.ts +7 -7
- package/dist/src/agent/inbound/attachment-pipeline.js +22 -21
- package/dist/src/agent/inbound/inbound-loop.d.ts +6 -6
- package/dist/src/agent/inbound/inbound-loop.js +23 -23
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +14 -14
- package/dist/src/agent/inbound/turn-dispatcher.js +16 -16
- package/dist/src/agent/ipc/bus.d.ts +1 -1
- package/dist/src/agent/ipc/types.d.ts +3 -3
- package/dist/src/agent/ipc/types.js +1 -1
- package/dist/src/agent/lifecycle/hook-handler.d.ts +2 -2
- package/dist/src/agent/lifecycle/hook-handler.js +6 -6
- package/dist/src/agent/lifecycle/manager.d.ts +1 -1
- package/dist/src/agent/lifecycle/manager.js +4 -4
- package/dist/src/agent/lifecycle/types.d.ts +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.d.ts +4 -4
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +21 -20
- package/dist/src/agent/mcp/bundle-mcp-tools.d.ts +1 -1
- package/dist/src/agent/mcp/bundle-mcp-tools.js +2 -2
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +4 -4
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +9 -8
- package/dist/src/agent/memory/compaction-ledger.js +9 -2
- package/dist/src/agent/memory/compaction-promotion.d.ts +2 -2
- package/dist/src/agent/memory/compaction-promotion.js +6 -6
- package/dist/src/agent/memory/compaction-source-planner.d.ts +2 -0
- package/dist/src/agent/memory/compaction-source-planner.js +9 -1
- package/dist/src/agent/memory/compaction.d.ts +6 -1
- package/dist/src/agent/memory/compaction.js +22 -11
- package/dist/src/agent/memory/context-recovery.d.ts +44 -0
- package/dist/src/agent/memory/context-recovery.js +96 -0
- package/dist/src/agent/memory/manager.js +11 -11
- package/dist/src/agent/memory/turn-provenance.d.ts +5 -5
- package/dist/src/agent/memory/turn-provenance.js +21 -17
- package/dist/src/agent/memory/types.d.ts +2 -2
- package/dist/src/agent/messaging/command-handler.d.ts +11 -11
- package/dist/src/agent/messaging/command-handler.js +7 -7
- package/dist/src/agent/messaging/message-router.d.ts +1 -1
- package/dist/src/agent/messaging/message-router.js +4 -4
- package/dist/src/agent/messaging/outbound-coordinator.d.ts +2 -2
- package/dist/src/agent/messaging/outbound-coordinator.js +4 -4
- package/dist/src/agent/middleware/context.d.ts +1 -2
- package/dist/src/agent/middleware/context.js +2 -5
- package/dist/src/agent/models/manager.d.ts +10 -10
- package/dist/src/agent/models/manager.js +34 -34
- package/dist/src/agent/orchestration/agent-event-handler.js +14 -14
- package/dist/src/agent/orchestration/agent-orchestrator.d.ts +7 -7
- package/dist/src/agent/orchestration/agent-orchestrator.js +29 -29
- package/dist/src/agent/orchestration/context-overflow.js +2 -0
- package/dist/src/agent/orchestration/llm-turn-retry.d.ts +1 -1
- package/dist/src/agent/orchestration/llm-turn-retry.js +2 -2
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.d.ts +1 -1
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +2 -2
- package/dist/src/agent/prompt/response-language.d.ts +1 -1
- package/dist/src/agent/prompt/response-language.js +2 -2
- package/dist/src/agent/prompt/service-prompt-builder.d.ts +2 -2
- package/dist/src/agent/prompt/service-prompt-builder.js +4 -4
- package/dist/src/agent/prompt/subagent-context.d.ts +4 -4
- package/dist/src/agent/prompt/subagent-context.js +1 -1
- package/dist/src/agent/prompt/system-prompt-params.d.ts +4 -4
- package/dist/src/agent/prompt/system-prompt-params.js +13 -12
- package/dist/src/agent/reply/apply-turn-user-enrichment.d.ts +1 -1
- package/dist/src/agent/reply/apply-turn-user-enrichment.js +3 -3
- package/dist/src/agent/reply/post-compaction-context.d.ts +1 -1
- package/dist/src/agent/reply/post-compaction-context.js +2 -2
- package/dist/src/agent/service/btw-query.d.ts +1 -1
- package/dist/src/agent/service/btw-query.js +4 -4
- package/dist/src/agent/service/build-direct-message-content.d.ts +1 -1
- package/dist/src/agent/service/build-direct-message-content.js +2 -2
- package/dist/src/agent/service/direct-turn-helpers.d.ts +6 -6
- package/dist/src/agent/service/direct-turn-helpers.js +17 -16
- package/dist/src/agent/service/parse-outbound-session-key.d.ts +1 -1
- package/dist/src/agent/service/parse-outbound-session-key.js +8 -9
- package/dist/src/agent/service/process-direct-one-shot.d.ts +11 -11
- package/dist/src/agent/service/process-direct-one-shot.js +16 -16
- package/dist/src/agent/service/process-direct-streaming.d.ts +18 -18
- package/dist/src/agent/service/process-direct-streaming.js +45 -40
- package/dist/src/agent/service/session-context-report.d.ts +1 -1
- package/dist/src/agent/service/session-context-report.js +3 -3
- package/dist/src/agent/service/webchat-tts.d.ts +3 -3
- package/dist/src/agent/service/webchat-tts.js +7 -7
- package/dist/src/agent/service.d.ts +23 -23
- package/dist/src/agent/service.js +111 -108
- package/dist/src/agent/service.types.d.ts +3 -3
- package/dist/src/agent/session/session-config-service.d.ts +5 -5
- package/dist/src/agent/session/session-config-service.js +53 -66
- package/dist/src/agent/session/session-context.d.ts +2 -2
- package/dist/src/agent/session/session-context.js +2 -2
- package/dist/src/agent/session/session-hydrator.d.ts +3 -3
- package/dist/src/agent/session/session-hydrator.js +19 -19
- package/dist/src/agent/session/session-inspector.d.ts +7 -7
- package/dist/src/agent/session/session-inspector.js +45 -45
- package/dist/src/agent/session/session-lifecycle.d.ts +2 -2
- package/dist/src/agent/session/session-lifecycle.js +17 -17
- package/dist/src/agent/session/session-state-bag.d.ts +18 -18
- package/dist/src/agent/session/session-state-bag.js +46 -46
- package/dist/src/agent/session/tracker.d.ts +7 -7
- package/dist/src/agent/session/tracker.js +27 -27
- package/dist/src/agent/source-context/types.d.ts +1 -1
- package/dist/src/agent/tasks/task-judge-service.d.ts +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +11 -10
- package/dist/src/agent/tools/automation-tool.js +2 -0
- package/dist/src/agent/tools/chain-tracker.d.ts +10 -10
- package/dist/src/agent/tools/chain-tracker.js +31 -31
- package/dist/src/agent/tools/clarify-tool.d.ts +1 -1
- package/dist/src/agent/tools/create-share-tool.js +2 -0
- package/dist/src/agent/tools/delegate-tool.d.ts +1 -1
- package/dist/src/agent/tools/delegate-tool.js +4 -4
- package/dist/src/agent/tools/exec-command.d.ts +1 -1
- package/dist/src/agent/tools/exec-command.js +1 -1
- package/dist/src/agent/tools/factory.d.ts +3 -3
- package/dist/src/agent/tools/factory.js +36 -36
- package/dist/src/agent/tools/knowledge-memory-tool.js +2 -2
- package/dist/src/agent/tools/managed-job-tool.d.ts +1 -1
- package/dist/src/agent/tools/managed-job-tool.js +2 -2
- package/dist/src/agent/tools/publish-artifacts.js +2 -0
- package/dist/src/agent/tools/send-media.js +2 -0
- package/dist/src/agent/tools/session-recall-tool.d.ts +1 -1
- package/dist/src/agent/tools/session-recall-tool.js +3 -3
- package/dist/src/agent/tools/session-search-tool.d.ts +1 -1
- package/dist/src/agent/tools/session-search-tool.js +6 -6
- package/dist/src/agent/tools/skill-install-tool.d.ts +3 -3
- package/dist/src/agent/tools/skill-install-tool.js +3 -3
- package/dist/src/agent/tools/todo-tool.d.ts +3 -3
- package/dist/src/agent/tools/todo-tool.js +4 -4
- package/dist/src/agent/tools/workflow-tool.d.ts +1 -1
- package/dist/src/agent/tools/workflow-tool.js +15 -13
- package/dist/src/agent/tools/write.js +2 -0
- package/dist/src/agent/tools/xopc-use-tool.d.ts +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +16 -13
- package/dist/src/agent/types.d.ts +1 -1
- package/dist/src/agent/workflow/catalog.js +4 -2
- package/dist/src/agent/workflow/channel-capability.d.ts +2 -2
- package/dist/src/agent/workflow/progress-broker.d.ts +4 -4
- package/dist/src/agent/workflow/progress-broker.js +17 -17
- package/dist/src/agent/workflow/subagent-runner.js +10 -10
- package/dist/src/agent/workflow/types.d.ts +2 -2
- package/dist/src/agent/workflow/workflow-child-tools.js +1 -1
- package/dist/src/agent/workspace-runtime/registry.js +1 -1
- package/dist/src/automations/domain/types.d.ts +7 -7
- package/dist/src/automations/domain/validation.js +2 -0
- package/dist/src/automations/service/action-executor.js +15 -15
- package/dist/src/automations/service/automation-service.js +4 -3
- package/dist/src/automations/storage/automation-repository.js +2 -1
- package/dist/src/automations/storage/automation-run-repository.js +9 -8
- package/dist/src/browser/native-messaging-host.js +4 -1
- package/dist/src/browser/policy/approval-store.d.ts +4 -4
- package/dist/src/browser/policy/approval-store.js +8 -8
- package/dist/src/browser/providers/extension.js +6 -6
- package/dist/src/browser/providers/realtime-extension.js +2 -2
- package/dist/src/browser/runtime/browser-runtime.js +3 -3
- package/dist/src/channels/exec-approval-runtime.d.ts +1 -1
- package/dist/src/channels/manager.js +1 -1
- package/dist/src/channels/pipeline.js +2 -2
- package/dist/src/channels/plugin-types.d.ts +2 -2
- package/dist/src/channels/plugins/types.adapters.d.ts +1 -1
- package/dist/src/channels/telegram/index.d.ts +1 -1
- package/dist/src/channels/telegram/index.js +2 -2
- package/dist/src/chat-commands/agent-edit.js +2 -2
- package/dist/src/chat-commands/builtins/review.js +4 -4
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/system.js +2 -2
- package/dist/src/chat-commands/builtins/thinking.js +7 -7
- package/dist/src/chat-commands/builtins/understanding.js +4 -4
- package/dist/src/chat-commands/builtins/workflow.js +8 -8
- package/dist/src/chat-commands/context.d.ts +9 -9
- package/dist/src/chat-commands/context.js +35 -35
- package/dist/src/chat-commands/index.d.ts +1 -1
- package/dist/src/chat-commands/index.js +2 -2
- package/dist/src/chat-commands/processor.js +2 -2
- package/dist/src/chat-commands/registry.js +1 -1
- package/dist/src/chat-commands/session-key.d.ts +3 -3
- package/dist/src/chat-commands/session-key.js +20 -24
- package/dist/src/chat-commands/types.d.ts +3 -3
- package/dist/src/cli/command-manifest.js +1 -1
- package/dist/src/cli/commands/agent/interactive.d.ts +1 -1
- package/dist/src/cli/commands/agent/interactive.js +8 -8
- package/dist/src/cli/commands/agent/stream-renderer.d.ts +1 -1
- package/dist/src/cli/commands/agent/stream-renderer.js +2 -2
- package/dist/src/cli/commands/agent.js +10 -6
- package/dist/src/cli/commands/doctor/checks/database-schema.js +3 -2
- package/dist/src/cli/commands/doctor/checks/session-integrity.js +9 -9
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/gateway/run-foreground.js +2 -1
- package/dist/src/cli/commands/import.js +2 -1
- package/dist/src/cli/commands/logs.js +3 -3
- package/dist/src/cli/commands/project.js +5 -5
- package/dist/src/cli/commands/resume.js +4 -4
- package/dist/src/cli/commands/tunnel.js +2 -1
- package/dist/src/config/agent-profile.d.ts +3 -3
- package/dist/src/config/agent-profile.js +12 -12
- package/dist/src/config/models-json.d.ts +6 -6
- package/dist/src/config/schema.d.ts +1 -1
- package/dist/src/connectors/catalog.js +2 -1
- package/dist/src/connectors/composio-sessions.d.ts +1 -1
- package/dist/src/connectors/composio-sessions.js +3 -3
- package/dist/src/connectors/connection-recovery-service.d.ts +4 -4
- package/dist/src/connectors/connection-recovery-service.js +41 -37
- package/dist/src/connectors/principal.d.ts +1 -1
- package/dist/src/connectors/principal.js +4 -3
- package/dist/src/connectors/types.d.ts +2 -2
- package/dist/src/discussions/action-tasks.js +5 -2
- package/dist/src/discussions/analyzer.js +2 -1
- package/dist/src/discussions/edits.js +4 -2
- package/dist/src/discussions/index.js +1 -1
- package/dist/src/discussions/organizer.js +3 -2
- package/dist/src/discussions/recording.js +5 -2
- package/dist/src/discussions/recordingJobs.js +2 -1
- package/dist/src/discussions/repository.js +2 -1
- package/dist/src/discussions/revisions.js +2 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/discussions/service.js +6 -3
- package/dist/src/discussions/types.js +4 -0
- package/dist/src/endpoint-tools/auth.js +2 -1
- package/dist/src/endpoint-tools/binding-service.d.ts +8 -8
- package/dist/src/endpoint-tools/binding-service.js +14 -14
- package/dist/src/endpoint-tools/invocation-service.js +2 -1
- package/dist/src/endpoint-tools/policy.js +2 -1
- package/dist/src/endpoint-tools/registry.js +2 -1
- package/dist/src/endpoint-tools/upload-service.js +2 -1
- package/dist/src/execution-environments/local-worktree-manager.d.ts +1 -1
- package/dist/src/execution-environments/local-worktree-manager.js +2 -2
- package/dist/src/execution-environments/session-environment-service.d.ts +3 -3
- package/dist/src/execution-environments/session-environment-service.js +10 -10
- package/dist/src/execution-environments/store.d.ts +2 -2
- package/dist/src/execution-environments/store.js +15 -14
- package/dist/src/execution-environments/subject.d.ts +1 -1
- package/dist/src/execution-environments/subject.js +2 -2
- package/dist/src/execution-environments/types.d.ts +2 -2
- package/dist/src/extensions/api.js +1 -1
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.d.ts +1 -1
- package/dist/src/extensions/types/core.d.ts +2 -2
- package/dist/src/extensions/types/hooks.d.ts +12 -12
- package/dist/src/extensions/types/tools.d.ts +3 -3
- package/dist/src/extensions/types/tui.d.ts +3 -3
- package/dist/src/files/file-service.d.ts +3 -3
- package/dist/src/files/file-service.js +3 -3
- package/dist/src/gateway/automation-agent-session.js +5 -5
- package/dist/src/gateway/chat-stream/mapper.d.ts +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +4 -2
- package/dist/src/gateway/chat-stream/protocol.d.ts +1 -1
- package/dist/src/gateway/chat-stream/thinking-delta-coalescer.js +1 -1
- package/dist/src/gateway/clarify-runtime.d.ts +2 -2
- package/dist/src/gateway/clarify-runtime.js +2 -2
- package/dist/src/gateway/file-path-classifier.d.ts +2 -2
- package/dist/src/gateway/file-path-classifier.js +4 -4
- package/dist/src/gateway/file-reference-registry.d.ts +2 -2
- package/dist/src/gateway/file-reference-registry.js +1 -1
- package/dist/src/gateway/file-space-service.js +3 -3
- package/dist/src/gateway/gateway-workflow-host.types.d.ts +1 -1
- package/dist/src/gateway/heartbeat/check-store.js +2 -1
- package/dist/src/gateway/heartbeat/service.js +23 -9
- package/dist/src/gateway/hono/middleware/log-context.d.ts +1 -1
- package/dist/src/gateway/hono/middleware/log-context.js +3 -3
- package/dist/src/gateway/hono/routes/agent-stream.js +20 -20
- package/dist/src/gateway/hono/routes/browser-session.js +2 -2
- package/dist/src/gateway/hono/routes/browser.js +22 -20
- package/dist/src/gateway/hono/routes/chat-model-config.d.ts +1 -1
- package/dist/src/gateway/hono/routes/chat-model-config.js +6 -6
- package/dist/src/gateway/hono/routes/commands-skills.js +13 -13
- package/dist/src/gateway/hono/routes/connection-waits.js +5 -5
- package/dist/src/gateway/hono/routes/connectors.js +5 -5
- package/dist/src/gateway/hono/routes/context-sources.js +2 -1
- package/dist/src/gateway/hono/routes/device-pairing-approval.js +2 -0
- package/dist/src/gateway/hono/routes/devices.js +2 -0
- package/dist/src/gateway/hono/routes/discussions.js +2 -2
- package/dist/src/gateway/hono/routes/endpoint-tools.js +8 -7
- package/dist/src/gateway/hono/routes/execution-environments.js +11 -11
- package/dist/src/gateway/hono/routes/file-references.js +5 -5
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/interaction-state.js +6 -6
- package/dist/src/gateway/hono/routes/logs.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +3 -3
- package/dist/src/gateway/hono/routes/notes.js +11 -11
- package/dist/src/gateway/hono/routes/projects.js +26 -26
- package/dist/src/gateway/hono/routes/public-gateway.js +3 -3
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +10 -10
- package/dist/src/gateway/hono/routes/session-input-handler.js +20 -17
- package/dist/src/gateway/hono/routes/sessions.js +79 -50
- package/dist/src/gateway/hono/routes/shares.js +38 -38
- package/dist/src/gateway/hono/routes/side-chats.js +4 -2
- package/dist/src/gateway/hono/routes/site-shares.js +6 -6
- package/dist/src/gateway/hono/routes/tasks.js +18 -13
- package/dist/src/gateway/hono/routes/tui.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.js +1 -1
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +9 -9
- package/dist/src/gateway/media-access.d.ts +1 -1
- package/dist/src/gateway/media-access.js +3 -3
- package/dist/src/gateway/resolve-webchat-session-key.d.ts +5 -5
- package/dist/src/gateway/resolve-webchat-session-key.js +5 -5
- package/dist/src/gateway/service/agent-runner.d.ts +15 -15
- package/dist/src/gateway/service/agent-runner.js +63 -62
- package/dist/src/gateway/service/marketplace-service.d.ts +3 -3
- package/dist/src/gateway/service/marketplace-service.js +6 -6
- package/dist/src/gateway/service/run-gateway-agent.js +51 -49
- package/dist/src/gateway/service/session-input-coordinator.d.ts +11 -11
- package/dist/src/gateway/service/session-input-coordinator.js +76 -74
- package/dist/src/gateway/service/sessions-api.d.ts +19 -20
- package/dist/src/gateway/service/sessions-api.js +30 -38
- package/dist/src/gateway/service/task-conversation-query-service.d.ts +3 -2
- package/dist/src/gateway/service/task-conversation-query-service.js +3 -3
- package/dist/src/gateway/service.d.ts +4 -4
- package/dist/src/gateway/service.js +75 -69
- package/dist/src/gateway/session-context-summary.d.ts +1 -1
- package/dist/src/gateway/session-context-summary.js +13 -11
- package/dist/src/gateway/session-reset-service.d.ts +4 -4
- package/dist/src/gateway/session-reset-service.js +12 -12
- package/dist/src/gateway/side-chat/context-snapshot.d.ts +2 -2
- package/dist/src/gateway/side-chat/context-snapshot.js +2 -2
- package/dist/src/gateway/side-chat/manager.d.ts +4 -4
- package/dist/src/gateway/side-chat/manager.js +13 -13
- package/dist/src/gateway/side-chat/run-service.js +8 -8
- package/dist/src/gateway/side-chat/types.d.ts +4 -4
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/heartbeat/wake.d.ts +1 -1
- package/dist/src/history/ctx/exporter.js +11 -11
- package/dist/src/history/ctx/format.d.ts +1 -1
- package/dist/src/history/ctx/format.js +7 -7
- package/dist/src/imports/contextImport.js +2 -1
- package/dist/src/imports/productImport.js +2 -1
- package/dist/src/infra/node-sqlite.js +9 -3
- package/dist/src/infra/process-diagnostics.js +9 -5
- package/dist/src/infra/sqlite-errors.js +25 -20
- package/dist/src/infra/unhandled-rejections.js +15 -7
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/warning-filter.js +9 -3
- package/dist/src/knowledge-memory/domain.d.ts +2 -2
- package/dist/src/knowledge-memory/repository.d.ts +1 -1
- package/dist/src/knowledge-memory/repository.js +10 -8
- package/dist/src/mcp/channel-bridge.d.ts +3 -3
- package/dist/src/mcp/channel-bridge.js +7 -7
- package/dist/src/mcp/channel-shared.d.ts +4 -4
- package/dist/src/mcp/channel-shared.js +3 -3
- package/dist/src/mcp/channel-tools.js +19 -19
- package/dist/src/media/session-references.js +2 -2
- package/dist/src/memory-maintenance/service.js +2 -1
- package/dist/src/migrations/conversation-routing-config.d.ts +2 -0
- package/dist/src/migrations/conversation-routing-config.js +42 -0
- package/dist/src/migrations/runner.js +6 -5
- package/dist/src/notes/service.d.ts +2 -2
- package/dist/src/notes/service.js +6 -6
- package/dist/src/notes/store.js +2 -1
- package/dist/src/notes/types.d.ts +3 -3
- package/dist/src/notifications/device-store.js +2 -1
- package/dist/src/notifications/planner.js +5 -3
- package/dist/src/notifications/proactive-channel.js +4 -1
- package/dist/src/notifications/proactive-policy.js +2 -1
- package/dist/src/notifications/service.d.ts +4 -4
- package/dist/src/notifications/service.js +4 -1
- package/dist/src/notifications/store.js +4 -1
- package/dist/src/notifications/web-push.js +4 -1
- package/dist/src/platform/contracts.d.ts +3 -3
- package/dist/src/proactive/actions/service.js +2 -1
- package/dist/src/proactive/events/product-event-bridge.js +1 -1
- package/dist/src/proactive/events/repository.js +2 -1
- package/dist/src/proactive/execution/authorization.js +2 -1
- package/dist/src/proactive/execution/context.js +2 -1
- package/dist/src/proactive/execution/insight.js +2 -0
- package/dist/src/proactive/execution/repository.js +2 -1
- package/dist/src/proactive/execution/worker.js +3 -2
- package/dist/src/proactive/experience.d.ts +1 -1
- package/dist/src/proactive/experience.js +4 -3
- package/dist/src/proactive/follow-ups.d.ts +7 -7
- package/dist/src/proactive/follow-ups.js +5 -4
- package/dist/src/proactive/inbox/cards.js +5 -2
- package/dist/src/proactive/inbox/delivery.js +2 -1
- package/dist/src/proactive/inbox/digest.js +2 -1
- package/dist/src/proactive/inbox/lifecycle.js +2 -1
- package/dist/src/proactive/inbox/repository.js +2 -1
- package/dist/src/proactive/inbox/service.js +2 -1
- package/dist/src/proactive/mail-thread.js +2 -1
- package/dist/src/proactive/maintenance.js +2 -1
- package/dist/src/proactive/metrics.js +2 -1
- package/dist/src/proactive/policy/presence.js +2 -1
- package/dist/src/proactive/policy/service.js +4 -1
- package/dist/src/proactive/routing/batch-repository.js +2 -1
- package/dist/src/proactive/scenarios/control.js +4 -1
- package/dist/src/proactive/scenarios/repository.js +2 -1
- package/dist/src/proactive/service.js +2 -1
- package/dist/src/proactive/source-freshness.js +2 -1
- package/dist/src/proactive/status.js +2 -1
- package/dist/src/proactive/temporal/schedule.js +2 -1
- package/dist/src/projects/automation-bind.js +2 -1
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/knowledge-bind.js +2 -1
- package/dist/src/projects/project-agent.js +4 -1
- package/dist/src/projects/project-service.d.ts +4 -4
- package/dist/src/projects/project-service.js +11 -10
- package/dist/src/projects/project-store.js +11 -9
- package/dist/src/projects/session-bind.d.ts +5 -5
- package/dist/src/projects/session-bind.js +18 -17
- package/dist/src/projects/types.d.ts +1 -1
- package/dist/src/projects/workflow-bind.js +2 -1
- package/dist/src/projects/workspace.d.ts +3 -3
- package/dist/src/projects/workspace.js +6 -6
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/prompt-cache-lifecycle.d.ts +2 -2
- package/dist/src/providers/prompt-cache-lifecycle.js +6 -6
- package/dist/src/realtime/broker.js +3 -3
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/retrieval/queryProfile.d.ts +1 -1
- package/dist/src/routing/agent-session-key.d.ts +12 -41
- package/dist/src/routing/agent-session-key.js +39 -120
- package/dist/src/routing/conversation-route.d.ts +28 -0
- package/dist/src/routing/conversation-route.js +50 -0
- package/dist/src/routing/index.d.ts +2 -2
- package/dist/src/routing/index.js +5 -5
- package/dist/src/routing/resolve-route.d.ts +4 -9
- package/dist/src/routing/resolve-route.js +20 -60
- package/dist/src/routing/resolve-tui-session-key.d.ts +5 -13
- package/dist/src/routing/resolve-tui-session-key.js +11 -36
- package/dist/src/routing/session-key.d.ts +6 -39
- package/dist/src/routing/session-key.js +13 -161
- package/dist/src/session/client-history.js +2 -0
- package/dist/src/session/compaction-types.js +18 -13
- package/dist/src/session/config-store.d.ts +8 -8
- package/dist/src/session/config-store.js +19 -19
- package/dist/src/session/index.d.ts +2 -2
- package/dist/src/session/index.js +9 -5
- package/dist/src/session/init-session-turn.d.ts +7 -7
- package/dist/src/session/init-session-turn.js +18 -18
- package/dist/src/session/manager.d.ts +7 -7
- package/dist/src/session/manager.js +6 -6
- package/dist/src/session/model-config-lock.d.ts +1 -1
- package/dist/src/session/model-config-lock.js +4 -4
- package/dist/src/session/resolve-session.d.ts +10 -10
- package/dist/src/session/resolve-session.js +20 -20
- package/dist/src/session/session-context-for-llm.js +17 -10
- package/dist/src/session/session-title.d.ts +5 -5
- package/dist/src/session/session-title.js +28 -28
- package/dist/src/session/session-workspace.d.ts +1 -1
- package/dist/src/session/session-workspace.js +3 -3
- package/dist/src/session/store.d.ts +14 -14
- package/dist/src/session/store.js +70 -50
- package/dist/src/session/stored-rows-to-file-entries.d.ts +1 -1
- package/dist/src/session/stored-rows-to-file-entries.js +5 -3
- package/dist/src/session/thinking-resolve.d.ts +2 -2
- package/dist/src/session/thinking-resolve.js +4 -4
- package/dist/src/session/transcript-events.d.ts +1 -1
- package/dist/src/session/transcript-events.js +3 -3
- package/dist/src/session/transcript-outline.js +2 -1
- package/dist/src/session/turn-outcome-projector.js +2 -0
- package/dist/src/session/types.d.ts +5 -4
- package/dist/src/session/types.js +13 -9
- package/dist/src/session/user-message-display.js +2 -0
- package/dist/src/session/user-round-delete.js +2 -1
- package/dist/src/session/voice-transcript.js +8 -3
- package/dist/src/share/hosted-session-share.d.ts +6 -6
- package/dist/src/share/hosted-session-share.js +13 -11
- package/dist/src/share/hosted-static-site-publish.d.ts +1 -1
- package/dist/src/share/hosted-static-site-publish.js +1 -1
- package/dist/src/share/session-share-service.d.ts +9 -9
- package/dist/src/share/session-share-service.js +19 -19
- package/dist/src/share/share-store.d.ts +2 -2
- package/dist/src/share/share-store.js +9 -7
- package/dist/src/share/share-types.d.ts +2 -2
- package/dist/src/share/site-share-router.d.ts +2 -2
- package/dist/src/share/site-share-store.js +4 -2
- package/dist/src/share/site-share-types.d.ts +1 -1
- package/dist/src/storage/sqlite/activity-repository.js +2 -1
- package/dist/src/storage/sqlite/browser-session-repository.js +2 -1
- package/dist/src/storage/sqlite/browser-tab-binding-repository.d.ts +2 -2
- package/dist/src/storage/sqlite/browser-tab-binding-repository.js +10 -9
- package/dist/src/storage/sqlite/clarification-wait-repository.d.ts +7 -7
- package/dist/src/storage/sqlite/clarification-wait-repository.js +58 -53
- package/dist/src/storage/sqlite/collaboration-rule-repository.js +2 -1
- package/dist/src/storage/sqlite/composer-input-history-repository.js +2 -1
- package/dist/src/storage/sqlite/config-repository.d.ts +6 -6
- package/dist/src/storage/sqlite/config-repository.js +29 -25
- package/dist/src/storage/sqlite/connection-wait-repository.d.ts +11 -11
- package/dist/src/storage/sqlite/connection-wait-repository.js +61 -51
- package/dist/src/storage/sqlite/connection.js +28 -18
- package/dist/src/storage/sqlite/connector-account-repository.js +2 -1
- package/dist/src/storage/sqlite/connector-learning-repository.js +2 -1
- package/dist/src/storage/sqlite/connector-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/connector-repository.js +11 -10
- package/dist/src/storage/sqlite/connector-sync-policy-repository.js +2 -1
- package/dist/src/storage/sqlite/context-evidence-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/context-evidence-repository.js +7 -6
- package/dist/src/storage/sqlite/context-extraction-repository.js +2 -1
- package/dist/src/storage/sqlite/context-relation-repository.js +2 -1
- package/dist/src/storage/sqlite/conversation-repository.d.ts +12 -0
- package/dist/src/storage/sqlite/conversation-repository.js +76 -0
- package/dist/src/storage/sqlite/device-access-repository.js +4 -1
- package/dist/src/storage/sqlite/device-pairing-approval.js +4 -1
- package/dist/src/storage/sqlite/device-pairing-repository.js +2 -1
- package/dist/src/storage/sqlite/durable-queue.js +4 -2
- package/dist/src/storage/sqlite/durable-state.js +4 -2
- package/dist/src/storage/sqlite/endpoint-principal-repository.js +2 -1
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.d.ts +3 -3
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.js +12 -11
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +2 -1
- package/dist/src/storage/sqlite/fts.js +39 -34
- package/dist/src/storage/sqlite/gateway-identity-repository.js +2 -1
- package/dist/src/storage/sqlite/home-attention-repository.js +2 -1
- package/dist/src/storage/sqlite/import-repository.js +2 -1
- package/dist/src/storage/sqlite/import-selection-repository.js +2 -1
- package/dist/src/storage/sqlite/index.d.ts +1 -1
- package/dist/src/storage/sqlite/index.js +25 -11
- package/dist/src/storage/sqlite/interaction-state-repository.d.ts +4 -4
- package/dist/src/storage/sqlite/interaction-state-repository.js +12 -11
- package/dist/src/storage/sqlite/knowledge-repository.js +2 -1
- package/dist/src/storage/sqlite/migrations/178_conversation_uuid.sql +2 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.d.ts +3 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.js +88 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.ts +66 -0
- package/dist/src/storage/sqlite/migrations/conversation-key-decoder.d.ts +8 -0
- package/dist/src/storage/sqlite/migrations/conversation-key-decoder.js +87 -0
- package/dist/src/storage/sqlite/migrations/conversation-key-decoder.ts +50 -0
- package/dist/src/storage/sqlite/migrations/conversation-uuid.d.ts +8 -0
- package/dist/src/storage/sqlite/migrations/conversation-uuid.js +366 -0
- package/dist/src/storage/sqlite/migrations/conversation-uuid.ts +324 -0
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.d.ts +1 -0
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.js +92 -0
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.ts +71 -0
- package/dist/src/storage/sqlite/migrations/discover.js +7 -3
- package/dist/src/storage/sqlite/migrations/errors.js +28 -23
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +43 -14
- package/dist/src/storage/sqlite/migrations/runner.ts +13 -3
- package/dist/src/storage/sqlite/migrations/types.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/types.ts +1 -1
- package/dist/src/storage/sqlite/note-agent-context-repository.js +2 -1
- package/dist/src/storage/sqlite/notes-repository.js +4 -2
- package/dist/src/storage/sqlite/paths.js +6 -2
- package/dist/src/storage/sqlite/relationship-settings-repository.js +2 -1
- package/dist/src/storage/sqlite/row-mappers.d.ts +10 -10
- package/dist/src/storage/sqlite/row-mappers.js +22 -15
- package/dist/src/storage/sqlite/schema-version.js +7 -2
- package/dist/src/storage/sqlite/schema.js +14 -6
- package/dist/src/storage/sqlite/session-identity-sql.js +12 -5
- package/dist/src/storage/sqlite/session-input-repository.d.ts +14 -14
- package/dist/src/storage/sqlite/session-input-repository.js +69 -61
- package/dist/src/storage/sqlite/session-instance-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/session-instance-repository.js +6 -3
- package/dist/src/storage/sqlite/session-metadata.d.ts +2 -2
- package/dist/src/storage/sqlite/session-metadata.js +7 -3
- package/dist/src/storage/sqlite/session-repository.d.ts +15 -15
- package/dist/src/storage/sqlite/session-repository.js +126 -102
- package/dist/src/storage/sqlite/session-task-plan-repository.d.ts +3 -3
- package/dist/src/storage/sqlite/session-task-plan-repository.js +21 -19
- package/dist/src/storage/sqlite/session-turn-replace-repository.d.ts +2 -2
- package/dist/src/storage/sqlite/session-turn-replace-repository.js +26 -22
- package/dist/src/storage/sqlite/transaction.js +12 -6
- package/dist/src/storage/sqlite/transcript-repository.d.ts +14 -14
- package/dist/src/storage/sqlite/transcript-repository.js +107 -102
- package/dist/src/storage/sqlite/user-people-repository.js +2 -1
- package/dist/src/storage/sqlite/user-trust-repository.js +2 -1
- package/dist/src/support/collect-support-report.js +7 -7
- package/dist/src/support/types.d.ts +2 -2
- package/dist/src/support/types.js +1 -1
- package/dist/src/tasks/execution-context.d.ts +2 -2
- package/dist/src/tasks/execution-context.js +3 -3
- package/dist/src/tasks/home-query-service.d.ts +2 -2
- package/dist/src/tasks/home-query-service.js +6 -6
- package/dist/src/tasks/index.js +6 -2
- package/dist/src/tasks/project-monitoring-service.js +2 -1
- package/dist/src/tasks/project-operating-view-service.js +2 -1
- package/dist/src/tasks/task-application-service.js +9 -4
- package/dist/src/tasks/task-change-events.js +7 -2
- package/dist/src/tasks/task-context-assembler.d.ts +2 -2
- package/dist/src/tasks/task-context-assembler.js +12 -9
- package/dist/src/tasks/task-context-repository.d.ts +1 -1
- package/dist/src/tasks/task-context-repository.js +4 -3
- package/dist/src/tasks/task-conversation-repository.d.ts +7 -7
- package/dist/src/tasks/task-conversation-repository.js +27 -26
- package/dist/src/tasks/task-deletion-service.js +2 -1
- package/dist/src/tasks/task-dependency-service.js +2 -1
- package/dist/src/tasks/task-handoff-service.d.ts +2 -2
- package/dist/src/tasks/task-handoff-service.js +16 -15
- package/dist/src/tasks/task-outbox-dispatcher.js +2 -1
- package/dist/src/tasks/task-read-model-projector.js +4 -2
- package/dist/src/tasks/task-repository.js +2 -1
- package/dist/src/tasks/task-run-coordinator.js +6 -5
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -1
- package/dist/src/tasks/task-run-dispatcher.js +4 -3
- package/dist/src/tasks/task-run-repository.d.ts +2 -2
- package/dist/src/tasks/task-run-repository.js +219 -212
- package/dist/src/tasks/task-signal-service.js +6 -2
- package/dist/src/tasks/task-workflow-coordinator.js +2 -1
- package/dist/src/tui/backends/embedded-backend.d.ts +33 -32
- package/dist/src/tui/backends/embedded-backend.js +95 -83
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +34 -33
- package/dist/src/tui/backends/gateway-realtime-backend.js +95 -78
- package/dist/src/tui/components/branch-summary.js +3 -3
- package/dist/src/tui/components/session-selector.d.ts +5 -5
- package/dist/src/tui/components/session-selector.js +7 -7
- package/dist/src/tui/components/tui-bottom-bar.js +1 -1
- package/dist/src/tui/components/tui-header.d.ts +1 -1
- package/dist/src/tui/components/tui-header.js +2 -2
- package/dist/src/tui/extension-host/autocomplete.d.ts +2 -2
- package/dist/src/tui/extension-host/autocomplete.js +4 -4
- package/dist/src/tui/extension-host/host.d.ts +1 -1
- package/dist/src/tui/extension-host/runtime-context.d.ts +1 -1
- package/dist/src/tui/extension-host/runtime-context.js +2 -2
- package/dist/src/tui/extension-host/runtime.d.ts +1 -1
- package/dist/src/tui/extension-host/runtime.js +6 -6
- package/dist/src/tui/tui-backend.d.ts +43 -39
- package/dist/src/tui/tui-command-formatters.d.ts +2 -2
- package/dist/src/tui/tui-command-formatters.js +10 -18
- package/dist/src/tui/tui-commands.d.ts +3 -3
- package/dist/src/tui/tui-commands.js +31 -33
- package/dist/src/tui/tui-empty-session-cleanup.d.ts +2 -3
- package/dist/src/tui/tui-empty-session-cleanup.js +7 -15
- package/dist/src/tui/tui-file-autocomplete.d.ts +1 -1
- package/dist/src/tui/tui-file-autocomplete.js +2 -2
- package/dist/src/tui/tui-new-session-preferences.js +2 -0
- package/dist/src/tui/tui-picker-overlay.d.ts +1 -1
- package/dist/src/tui/tui-picker-overlay.js +41 -53
- package/dist/src/tui/tui-picker-services.d.ts +3 -3
- package/dist/src/tui/tui-session-actions.d.ts +1 -1
- package/dist/src/tui/tui-session-actions.js +8 -17
- package/dist/src/tui/tui-session-format.js +4 -1
- package/dist/src/tui/tui-session-snapshot.d.ts +2 -2
- package/dist/src/tui/tui-session-snapshot.js +4 -4
- package/dist/src/tui/tui-settings.js +2 -0
- package/dist/src/tui/tui-startup-resources.d.ts +1 -1
- package/dist/src/tui/tui-startup-resources.js +3 -3
- package/dist/src/tui/tui-startup-text.js +1 -1
- package/dist/src/tui/tui-transcript-tree-picker.d.ts +1 -1
- package/dist/src/tui/tui-transcript-tree-picker.js +2 -2
- package/dist/src/tui/tui-types.d.ts +4 -2
- package/dist/src/tui/tui-types.js +2 -2
- package/dist/src/tui/tui.js +114 -112
- package/dist/src/user-context/access-policy.d.ts +1 -1
- package/dist/src/user-context/access-policy.js +6 -5
- package/dist/src/user-context/changes.js +9 -4
- package/dist/src/user-context/domain.d.ts +1 -1
- package/dist/src/user-context/relationship-continuity.d.ts +1 -1
- package/dist/src/user-context/relationship-continuity.js +1 -1
- package/dist/src/user-context/sources/repository.js +4 -2
- package/dist/src/user-model/capture/executor.d.ts +1 -1
- package/dist/src/user-model/capture/executor.js +3 -3
- package/dist/src/user-model/goals.js +2 -1
- package/dist/src/user-model/repository.js +2 -1
- package/dist/src/utils/global-singleton.js +4 -1
- package/dist/src/utils/logger/context.d.ts +1 -1
- package/dist/src/utils/logger/context.js +2 -2
- package/dist/src/utils/logger/log-store.js +2 -2
- package/dist/src/utils/logger/pino-record.js +6 -6
- package/dist/src/utils/logger/types.d.ts +6 -6
- package/dist/src/voice/realtime/agentBroker.d.ts +6 -6
- package/dist/src/voice/realtime/agentBroker.js +6 -6
- package/dist/src/voice/realtime/agentEngine.js +6 -6
- package/dist/src/voice/realtime/memory-context.d.ts +2 -2
- package/dist/src/voice/realtime/memory-context.js +15 -15
- package/dist/src/voice/realtime/persona-context.d.ts +1 -1
- package/dist/src/voice/realtime/persona-context.js +6 -6
- package/dist/src/voice/realtime/runtime.d.ts +1 -1
- package/dist/src/voice/realtime/runtime.js +14 -13
- package/dist/src/voice/realtime/runtime.types.d.ts +6 -6
- package/dist/src/work-discovery/investigation-repository.js +4 -2
- package/dist/src/work-discovery/probe.js +1 -1
- package/dist/src/work-discovery/repository.js +7 -5
- package/dist/src/work-discovery/service.js +33 -29
- package/dist/src/work-discovery/types.d.ts +1 -1
- package/dist/src/workflows/context/workflow-context-snapshot-repository.js +2 -1
- package/dist/src/workflows/domain/event.d.ts +1 -1
- package/dist/src/workflows/domain/run.d.ts +5 -5
- package/dist/src/workflows/engine/projector.js +1 -1
- package/dist/src/workflows/engine/workflow-engine.d.ts +2 -2
- package/dist/src/workflows/engine/workflow-engine.js +15 -18
- package/dist/src/workflows/index.js +3 -3
- package/dist/src/workflows/project-presets/project-workflow-preset-repository.js +2 -1
- package/dist/src/workflows/service/run-view-to-snapshot.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.d.ts +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +53 -42
- package/dist/src/workflows/service/workflow-run-service.types.d.ts +2 -2
- package/dist/src/workflows/service/workflow-session-bridge.d.ts +2 -2
- package/dist/src/workflows/service/workflow-session-bridge.js +31 -31
- package/dist/src/workflows/service/workflow-session-key.d.ts +1 -1
- package/dist/src/workflows/service/workflow-session-key.js +4 -4
- package/dist/src/workflows/service/workflow-writeback-service.js +2 -1
- package/dist/src/workflows/store/event-store.js +4 -2
- package/dist/src/workflows/store/run-index-store.js +9 -8
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/api-COG_Tzpv.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-6qxxKFsK.js +0 -1
- package/dist/gateway/static/root/assets/button-BA45yciM.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DM1Bcf1x.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-Bq36CUxL.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-DtPNvznL.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-C75kCOqe.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BCF732TU.js +0 -1
- package/dist/gateway/static/root/assets/index-ChIrvv3t.js +0 -74
- package/dist/gateway/static/root/assets/index-R1VNlHjj.css +0 -2
- package/dist/gateway/static/root/assets/locale-store-DlOv7896.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-DHZ4BEkG.js +0 -2
- package/dist/gateway/static/root/assets/messages-Ls1Aaiqd.js +0 -3
- package/dist/gateway/static/root/assets/notes-page-DfZ8QWyv.js +0 -8
- package/dist/gateway/static/root/assets/page-tabs-BG39KidE.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-DGmMQt4t.js +0 -1
- package/dist/gateway/static/root/assets/proactive-page-D2U_xQaS.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CzlGTW4F.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-mQsM-TsP.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Cb56JcO1.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CV4-_EVA.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-wcAdCkK8.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-layout-DYelDcMV.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-xlJh1ccG.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-wSXJRSxX.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-sQpwq5-c.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-Boajol0M.js +0 -1
- package/dist/src/routing/session-key-utils.d.ts +0 -23
- package/dist/src/routing/session-key-utils.js +0 -85
- package/dist/src/session/session-id.d.ts +0 -3
- package/dist/src/session/session-id.js +0 -10
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
1
|
+
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
2
|
+
import { init_conversation_repository, resolveRoutedConversation } from "../../storage/sqlite/conversation-repository.js";
|
|
2
3
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
3
|
-
import { extractProfileAgentId, resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
4
|
+
import { extractProfileAgentId, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
4
5
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
6
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
6
7
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
@@ -23,6 +24,8 @@ import { WorkflowRunStore } from "../store/run-store.js";
|
|
|
23
24
|
import { WorkflowWritebackService, resolveWorkflowWritebackPolicy } from "./workflow-writeback-service.js";
|
|
24
25
|
import { randomUUID } from "node:crypto";
|
|
25
26
|
//#region src/workflows/service/workflow-run-service.ts
|
|
27
|
+
init_conversation_repository();
|
|
28
|
+
init_task_run_repository();
|
|
26
29
|
init_resolve_route();
|
|
27
30
|
init_providers();
|
|
28
31
|
var WorkflowRunService = class {
|
|
@@ -90,7 +93,7 @@ var WorkflowRunService = class {
|
|
|
90
93
|
}
|
|
91
94
|
async startWorkflowRun(params) {
|
|
92
95
|
const config = this.options.service.currentConfig;
|
|
93
|
-
const workflowPolicy = config.agents?.list ?
|
|
96
|
+
const workflowPolicy = config.agents?.list ? resolveEffectiveAgentProfile(config, params.agentId).config.workflows : void 0;
|
|
94
97
|
if (workflowPolicy?.allowed && !workflowPolicy.allowed.includes(params.definitionId)) return {
|
|
95
98
|
ok: false,
|
|
96
99
|
code: "policy_denied",
|
|
@@ -129,12 +132,12 @@ var WorkflowRunService = class {
|
|
|
129
132
|
if (existingRun) return {
|
|
130
133
|
ok: true,
|
|
131
134
|
runId: existingRun.run.id,
|
|
132
|
-
|
|
135
|
+
conversationId: existingRun.run.metadata?.conversationId ?? ""
|
|
133
136
|
};
|
|
134
137
|
const runId = randomUUID();
|
|
135
138
|
const goal = params.goal ?? "";
|
|
136
139
|
const linkedTaskRun = params.taskRunId ? new TaskRunRepository().get(params.taskRunId) : void 0;
|
|
137
|
-
const inheritedProjectId = params.projectId?.trim() || (linkedTaskRun ? new TaskRepository().get(linkedTaskRun.taskId)?.projectId : void 0) || (params.
|
|
140
|
+
const inheritedProjectId = params.projectId?.trim() || (linkedTaskRun ? new TaskRepository().get(linkedTaskRun.taskId)?.projectId : void 0) || (params.parentConversationId?.trim() ? (await this.options.service.sessionIndexInstance.getStore().getMetadata(params.parentConversationId.trim()))?.projectId : void 0);
|
|
138
141
|
const taskId = linkedTaskRun?.taskId;
|
|
139
142
|
const requestedContextRefs = params.contextRefs ? [...inheritedProjectId && !params.contextRefs.some((ref) => ref.kind === "project" && ref.id === inheritedProjectId) ? [{
|
|
140
143
|
kind: "project",
|
|
@@ -187,14 +190,14 @@ var WorkflowRunService = class {
|
|
|
187
190
|
httpStatus: 400
|
|
188
191
|
};
|
|
189
192
|
}
|
|
190
|
-
const {
|
|
193
|
+
const { conversationId } = await this.options.sessionBridge.prepareRunSession({
|
|
191
194
|
runId,
|
|
192
195
|
agentId: params.agentId,
|
|
193
196
|
definitionId: params.definitionId,
|
|
194
197
|
definitionTitle: definition.title,
|
|
195
198
|
triggerSource: params.source.kind,
|
|
196
199
|
goal,
|
|
197
|
-
|
|
200
|
+
parentConversationId: params.parentConversationId,
|
|
198
201
|
projectId
|
|
199
202
|
});
|
|
200
203
|
if (linkedTaskRun?.status === "queued") {
|
|
@@ -203,7 +206,7 @@ var WorkflowRunService = class {
|
|
|
203
206
|
const snapshot = context.captureSnapshot({
|
|
204
207
|
ownerKind: "task_run",
|
|
205
208
|
ownerId: linkedTaskRun.id,
|
|
206
|
-
|
|
209
|
+
conversationId,
|
|
207
210
|
query: task.contract?.objective ?? task.title,
|
|
208
211
|
selectedItems: context.list(task.id),
|
|
209
212
|
authorizationSnapshot: { grants: context.listActiveGrants(task.id) }
|
|
@@ -216,23 +219,23 @@ var WorkflowRunService = class {
|
|
|
216
219
|
executorKind: "workflow",
|
|
217
220
|
definitionId: params.definitionId
|
|
218
221
|
},
|
|
219
|
-
|
|
222
|
+
conversationId
|
|
220
223
|
})) throw new Error("TaskRun changed before workflow execution started");
|
|
221
224
|
new TaskConversationRepository().activateExecutionSession({
|
|
222
225
|
taskId: task.id,
|
|
223
|
-
|
|
226
|
+
conversationId,
|
|
224
227
|
agentId: params.agentId,
|
|
225
228
|
runId: linkedTaskRun.id
|
|
226
229
|
});
|
|
227
230
|
}
|
|
228
|
-
const source = normalizeWorkflowRunSourceForSession(params.source,
|
|
231
|
+
const source = normalizeWorkflowRunSourceForSession(params.source, conversationId, params.parentConversationId);
|
|
229
232
|
const abortController = new AbortController();
|
|
230
233
|
const eventStore = new WorkflowEventStore(this.options.service.currentConfig, params.agentId);
|
|
231
234
|
const runStore = new WorkflowRunStore(this.options.service.currentConfig, params.agentId, eventStore);
|
|
232
235
|
const engine = this.createWorkflowEngine({
|
|
233
236
|
eventStore,
|
|
234
237
|
runStore,
|
|
235
|
-
|
|
238
|
+
conversationId,
|
|
236
239
|
projectId,
|
|
237
240
|
contextInstructions: resolvedContext?.instructions
|
|
238
241
|
});
|
|
@@ -261,7 +264,7 @@ var WorkflowRunService = class {
|
|
|
261
264
|
contextRefs,
|
|
262
265
|
contextSnapshot: resolvedContext?.snapshot,
|
|
263
266
|
writebackPolicy,
|
|
264
|
-
|
|
267
|
+
conversationId,
|
|
265
268
|
source,
|
|
266
269
|
input: inputEnvelope,
|
|
267
270
|
retryOfRunId: params.retryOfRunId,
|
|
@@ -286,7 +289,7 @@ var WorkflowRunService = class {
|
|
|
286
289
|
return {
|
|
287
290
|
ok: true,
|
|
288
291
|
runId,
|
|
289
|
-
|
|
292
|
+
conversationId
|
|
290
293
|
};
|
|
291
294
|
}
|
|
292
295
|
async retryWorkflowRun(params) {
|
|
@@ -297,7 +300,7 @@ var WorkflowRunService = class {
|
|
|
297
300
|
message: "Workflow run not found",
|
|
298
301
|
httpStatus: 404
|
|
299
302
|
};
|
|
300
|
-
const
|
|
303
|
+
const parentConversationId = existing.run.source.kind === "chat" ? existing.run.source.conversationId : void 0;
|
|
301
304
|
const projectId = params.projectId?.trim() || existing.run.metadata?.projectId;
|
|
302
305
|
return this.startWorkflowRun({
|
|
303
306
|
agentId: params.agentId,
|
|
@@ -312,7 +315,7 @@ var WorkflowRunService = class {
|
|
|
312
315
|
inputEnvelope: existing.run.metadata?.input,
|
|
313
316
|
goal: existing.run.goal,
|
|
314
317
|
source: existing.run.source,
|
|
315
|
-
|
|
318
|
+
parentConversationId,
|
|
316
319
|
retryOfRunId: existing.run.id
|
|
317
320
|
});
|
|
318
321
|
}
|
|
@@ -344,7 +347,7 @@ var WorkflowRunService = class {
|
|
|
344
347
|
};
|
|
345
348
|
const replayRunId = randomUUID();
|
|
346
349
|
const goal = buildReplayGoal(existing, params.scope, targets.targets.length);
|
|
347
|
-
const
|
|
350
|
+
const parentConversationId = existing.run.source.kind === "chat" ? existing.run.source.conversationId : void 0;
|
|
348
351
|
const projectId = existing.run.metadata?.projectId;
|
|
349
352
|
const taskRunId = existing.run.metadata?.taskRunId;
|
|
350
353
|
const taskId = taskRunId ? new TaskRunRepository().get(taskRunId)?.taskId : void 0;
|
|
@@ -383,24 +386,24 @@ var WorkflowRunService = class {
|
|
|
383
386
|
httpStatus: 400
|
|
384
387
|
};
|
|
385
388
|
}
|
|
386
|
-
const {
|
|
389
|
+
const { conversationId } = await this.options.sessionBridge.prepareRunSession({
|
|
387
390
|
runId: replayRunId,
|
|
388
391
|
agentId: params.agentId,
|
|
389
392
|
definitionId: existing.run.definitionId,
|
|
390
393
|
definitionTitle: `${definition.title} replay`,
|
|
391
394
|
triggerSource: existing.run.source.kind,
|
|
392
395
|
goal,
|
|
393
|
-
|
|
396
|
+
parentConversationId,
|
|
394
397
|
projectId
|
|
395
398
|
});
|
|
396
|
-
const source = normalizeWorkflowRunSourceForSession(existing.run.source,
|
|
399
|
+
const source = normalizeWorkflowRunSourceForSession(existing.run.source, conversationId, parentConversationId);
|
|
397
400
|
const abortController = new AbortController();
|
|
398
401
|
const eventStore = new WorkflowEventStore(this.options.service.currentConfig, params.agentId);
|
|
399
402
|
const replayRunStore = new WorkflowRunStore(this.options.service.currentConfig, params.agentId, eventStore);
|
|
400
403
|
const engine = this.createWorkflowEngine({
|
|
401
404
|
eventStore,
|
|
402
405
|
runStore: replayRunStore,
|
|
403
|
-
|
|
406
|
+
conversationId,
|
|
404
407
|
projectId,
|
|
405
408
|
contextInstructions: resolvedContext?.instructions
|
|
406
409
|
});
|
|
@@ -428,7 +431,7 @@ var WorkflowRunService = class {
|
|
|
428
431
|
contextRefs: existing.run.metadata?.contextRefs,
|
|
429
432
|
contextSnapshot: resolvedContext?.snapshot,
|
|
430
433
|
writebackPolicy,
|
|
431
|
-
|
|
434
|
+
conversationId,
|
|
432
435
|
source,
|
|
433
436
|
input: inputEnvelope,
|
|
434
437
|
retryOfRunId: existing.run.id,
|
|
@@ -462,7 +465,7 @@ var WorkflowRunService = class {
|
|
|
462
465
|
return {
|
|
463
466
|
ok: true,
|
|
464
467
|
runId: replayRunId,
|
|
465
|
-
|
|
468
|
+
conversationId
|
|
466
469
|
};
|
|
467
470
|
}
|
|
468
471
|
async cancelWorkflowRun(params) {
|
|
@@ -557,14 +560,14 @@ var WorkflowRunService = class {
|
|
|
557
560
|
}
|
|
558
561
|
createWorkflowEngine(params) {
|
|
559
562
|
const gatewayService = this.options.service;
|
|
560
|
-
const profileAgentId = extractProfileAgentId(params.
|
|
561
|
-
const agentWorkspace = gatewayService.currentConfig.agents?.list ? resolveEffectiveAgentProfileForSession(gatewayService.currentConfig, params.
|
|
562
|
-
const workspace = getProjectWorkspacePathForSession(params.
|
|
563
|
+
const profileAgentId = extractProfileAgentId(params.conversationId, gatewayService.currentConfig);
|
|
564
|
+
const agentWorkspace = gatewayService.currentConfig.agents?.list ? resolveEffectiveAgentProfileForSession(gatewayService.currentConfig, params.conversationId).resolvedWorkspacePath : gatewayService.currentWorkspacePath;
|
|
565
|
+
const workspace = getProjectWorkspacePathForSession(params.conversationId) ?? agentWorkspace;
|
|
563
566
|
const runner = new DelegateSubagentRunner({
|
|
564
567
|
workspace,
|
|
565
568
|
bus: gatewayService.messageBusInstance,
|
|
566
569
|
agentId: profileAgentId,
|
|
567
|
-
getDefaultModel: () => resolveModel(gatewayService.agentService.getModelForSession(params.
|
|
570
|
+
getDefaultModel: () => resolveModel(gatewayService.agentService.getModelForSession(params.conversationId)),
|
|
568
571
|
getConfig: () => gatewayService.currentConfig,
|
|
569
572
|
sessionStore: gatewayService.sessionIndexInstance.getStore(),
|
|
570
573
|
buildChildTools: (childOptions) => this.options.buildChildTools({
|
|
@@ -583,9 +586,17 @@ var WorkflowRunService = class {
|
|
|
583
586
|
resolveModelId: (modelId) => {
|
|
584
587
|
return resolveModel(resolveModelSelector(gatewayService.currentConfig, profileAgentId, modelId));
|
|
585
588
|
},
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
return
|
|
589
|
+
parentConversationId: params.conversationId,
|
|
590
|
+
subagentConversationIdFactory: ({ runId, agentId }) => {
|
|
591
|
+
return resolveRoutedConversation({
|
|
592
|
+
agentId: profileAgentId,
|
|
593
|
+
source: "workflow",
|
|
594
|
+
peerKind: "direct",
|
|
595
|
+
peerId: `${runId}/${agentId}`
|
|
596
|
+
}, {
|
|
597
|
+
sessionType: "workflow-subagent",
|
|
598
|
+
parentConversationId: params.conversationId
|
|
599
|
+
});
|
|
589
600
|
},
|
|
590
601
|
onEventAppended: (event) => {
|
|
591
602
|
gatewayService.emit("workflow.event.appended", {
|
|
@@ -615,21 +626,21 @@ var WorkflowRunService = class {
|
|
|
615
626
|
status: view.run.status,
|
|
616
627
|
definitionId: view.run.definitionId,
|
|
617
628
|
title: view.run.title,
|
|
618
|
-
|
|
629
|
+
conversationId: view.run.metadata?.conversationId,
|
|
619
630
|
sourceKind: view.run.source.kind
|
|
620
631
|
},
|
|
621
632
|
occurredAtMs: view.run.completedAtMs ?? Date.now()
|
|
622
633
|
});
|
|
623
634
|
}
|
|
624
635
|
};
|
|
625
|
-
function normalizeWorkflowRunSourceForSession(source,
|
|
626
|
-
if (
|
|
636
|
+
function normalizeWorkflowRunSourceForSession(source, workflowConversationId, parentConversationId) {
|
|
637
|
+
if (parentConversationId?.trim()) return {
|
|
627
638
|
kind: "chat",
|
|
628
|
-
|
|
639
|
+
conversationId: parentConversationId.trim()
|
|
629
640
|
};
|
|
630
641
|
if (source.kind === "webui") return {
|
|
631
642
|
...source,
|
|
632
|
-
|
|
643
|
+
conversationId: workflowConversationId
|
|
633
644
|
};
|
|
634
645
|
if (source.kind === "chat") return source;
|
|
635
646
|
return source;
|
|
@@ -655,7 +666,7 @@ function buildWorkflowRunMetadata(params) {
|
|
|
655
666
|
taskId
|
|
656
667
|
});
|
|
657
668
|
return {
|
|
658
|
-
|
|
669
|
+
conversationId: params.conversationId,
|
|
659
670
|
...params.preparationOnly ? { preparationOnly: true } : {},
|
|
660
671
|
triggerSource: params.source.kind,
|
|
661
672
|
agentId: params.agentId,
|
|
@@ -691,7 +702,7 @@ function buildDefaultWorkflowContextRefs(params) {
|
|
|
691
702
|
});
|
|
692
703
|
if (params.source.kind === "chat") refs.push({
|
|
693
704
|
kind: "session",
|
|
694
|
-
id: params.source.
|
|
705
|
+
id: params.source.conversationId,
|
|
695
706
|
role: "parent_session"
|
|
696
707
|
});
|
|
697
708
|
return refs;
|
|
@@ -770,20 +781,20 @@ function normalizePositiveInt(value, fallback) {
|
|
|
770
781
|
function buildReplayGoal(view, scope, targetCount) {
|
|
771
782
|
return `Replay ${targetCount} ${scope === "failed_phases" ? "failed phase" : "failed agent"}${targetCount === 1 ? "" : "s"} from workflow run ${view.run.id}: ${view.run.goal}`;
|
|
772
783
|
}
|
|
773
|
-
function
|
|
774
|
-
if ("
|
|
784
|
+
function extractWorkflowRunConversationId(source) {
|
|
785
|
+
if ("conversationId" in source && typeof source.conversationId === "string" && source.conversationId.trim()) return source.conversationId.trim();
|
|
775
786
|
return null;
|
|
776
787
|
}
|
|
777
788
|
function buildWorkflowRunOrigin(source) {
|
|
778
789
|
switch (source.kind) {
|
|
779
790
|
case "chat": return {
|
|
780
791
|
channel: "chat",
|
|
781
|
-
|
|
792
|
+
conversationId: source.conversationId,
|
|
782
793
|
messageId: source.messageId
|
|
783
794
|
};
|
|
784
795
|
case "webui": return {
|
|
785
796
|
channel: "webui",
|
|
786
|
-
|
|
797
|
+
conversationId: source.conversationId
|
|
787
798
|
};
|
|
788
799
|
case "automation": return {
|
|
789
800
|
channel: "automation",
|
|
@@ -818,4 +829,4 @@ function preparationDefinition(original) {
|
|
|
818
829
|
return definition;
|
|
819
830
|
}
|
|
820
831
|
//#endregion
|
|
821
|
-
export { WorkflowRunService, buildWorkflowRunDefinitionSnapshot, buildWorkflowRunInputEnvelope, buildWorkflowRunMetadata,
|
|
832
|
+
export { WorkflowRunService, buildWorkflowRunDefinitionSnapshot, buildWorkflowRunInputEnvelope, buildWorkflowRunMetadata, extractWorkflowRunConversationId, preparationDefinition, resolveWorkflowReplayTargets };
|
|
@@ -4,7 +4,7 @@ export interface StartWorkflowRunServiceParams {
|
|
|
4
4
|
agentId: string;
|
|
5
5
|
definitionId: string;
|
|
6
6
|
taskRunId?: string;
|
|
7
|
-
|
|
7
|
+
parentConversationId?: string;
|
|
8
8
|
projectId?: string;
|
|
9
9
|
contextRefs?: WorkflowRunContextRef[];
|
|
10
10
|
contextSnapshotId?: string;
|
|
@@ -22,7 +22,7 @@ export interface StartWorkflowRunServiceParams {
|
|
|
22
22
|
export interface StartWorkflowRunServiceResult {
|
|
23
23
|
ok: true;
|
|
24
24
|
runId: string;
|
|
25
|
-
|
|
25
|
+
conversationId: string;
|
|
26
26
|
}
|
|
27
27
|
export type WorkflowRunServiceErrorCode = 'definition_not_found' | 'run_not_found' | 'invalid_input' | 'policy_denied' | 'connector_preflight_failed' | 'invalid_state';
|
|
28
28
|
export interface WorkflowRunServiceErrorResult {
|
|
@@ -8,12 +8,12 @@ export interface PrepareWorkflowRunSessionParams {
|
|
|
8
8
|
definitionId: string;
|
|
9
9
|
definitionTitle: string;
|
|
10
10
|
goal: string;
|
|
11
|
-
|
|
11
|
+
parentConversationId?: string;
|
|
12
12
|
projectId?: string;
|
|
13
13
|
triggerSource?: string;
|
|
14
14
|
}
|
|
15
15
|
export interface PrepareWorkflowRunSessionResult {
|
|
16
|
-
|
|
16
|
+
conversationId: string;
|
|
17
17
|
}
|
|
18
18
|
export declare class WorkflowSessionBridge {
|
|
19
19
|
private readonly gateway;
|
|
@@ -6,7 +6,7 @@ import { renderWorkflowText } from "../../agent/workflow/snapshot.js";
|
|
|
6
6
|
import { isTerminalWorkflowRunStatus } from "../domain/run.js";
|
|
7
7
|
import "../domain/index.js";
|
|
8
8
|
import { runViewToSnapshot } from "./run-view-to-snapshot.js";
|
|
9
|
-
import {
|
|
9
|
+
import { buildWorkflowRunConversationId } from "./workflow-session-key.js";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
11
|
//#region src/workflows/service/workflow-session-bridge.ts
|
|
12
12
|
const WORKFLOW_SESSION_TYPE = "workflow-run";
|
|
@@ -17,12 +17,12 @@ var WorkflowSessionBridge = class {
|
|
|
17
17
|
this.gateway = gateway;
|
|
18
18
|
}
|
|
19
19
|
async prepareRunSession(params) {
|
|
20
|
-
const
|
|
20
|
+
const conversationId = buildWorkflowRunConversationId(params.agentId, params.runId);
|
|
21
21
|
const goalText = formatWorkflowGoalUserMessage(params.definitionId, params.goal);
|
|
22
22
|
const sessionName = truncateSessionName(params.goal.trim() || params.definitionTitle || params.definitionId);
|
|
23
23
|
const store = this.gateway.sessionIndexInstance.getStore();
|
|
24
|
-
const projectId = params.projectId?.trim() || (params.
|
|
25
|
-
await store.resolveTranscriptPath(
|
|
24
|
+
const projectId = params.projectId?.trim() || (params.parentConversationId?.trim() ? (await store.getMetadata(params.parentConversationId.trim()))?.projectId : void 0);
|
|
25
|
+
await store.resolveTranscriptPath(conversationId, { metadata: {
|
|
26
26
|
sessionType: WORKFLOW_SESSION_TYPE,
|
|
27
27
|
projectId,
|
|
28
28
|
hiddenFromSessionList: true,
|
|
@@ -36,7 +36,7 @@ var WorkflowSessionBridge = class {
|
|
|
36
36
|
peerId: params.runId
|
|
37
37
|
}
|
|
38
38
|
} });
|
|
39
|
-
await store.updateMetadata(
|
|
39
|
+
await store.updateMetadata(conversationId, {
|
|
40
40
|
sessionType: WORKFLOW_SESSION_TYPE,
|
|
41
41
|
hiddenFromSessionList: true,
|
|
42
42
|
workflowRunId: params.runId,
|
|
@@ -49,10 +49,10 @@ var WorkflowSessionBridge = class {
|
|
|
49
49
|
workflowDefinitionId: params.definitionId,
|
|
50
50
|
workflowGoal: params.goal,
|
|
51
51
|
...params.triggerSource ? { triggerSource: params.triggerSource } : {},
|
|
52
|
-
...params.
|
|
52
|
+
...params.parentConversationId ? { parentConversationId: params.parentConversationId } : {}
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
await store.appendTranscriptMessage(
|
|
55
|
+
await store.appendTranscriptMessage(conversationId, {
|
|
56
56
|
role: "user",
|
|
57
57
|
content: [{
|
|
58
58
|
type: "text",
|
|
@@ -60,42 +60,42 @@ var WorkflowSessionBridge = class {
|
|
|
60
60
|
}],
|
|
61
61
|
timestamp: Date.now()
|
|
62
62
|
});
|
|
63
|
-
if (params.
|
|
64
|
-
|
|
63
|
+
if (params.parentConversationId?.trim()) await this.writeParentRunLink({
|
|
64
|
+
parentConversationId: params.parentConversationId.trim(),
|
|
65
65
|
runId: params.runId,
|
|
66
66
|
ownerAgentId: params.agentId,
|
|
67
|
-
|
|
67
|
+
workflowConversationId: conversationId,
|
|
68
68
|
definitionId: params.definitionId,
|
|
69
69
|
goal: params.goal,
|
|
70
70
|
status: "running"
|
|
71
71
|
});
|
|
72
72
|
this.gateway.emit("session.updated", {
|
|
73
|
-
key:
|
|
73
|
+
key: conversationId,
|
|
74
74
|
name: sessionName
|
|
75
75
|
});
|
|
76
|
-
return {
|
|
76
|
+
return { conversationId };
|
|
77
77
|
}
|
|
78
78
|
async handleRunViewUpdated(view) {
|
|
79
79
|
const runId = view.run.id;
|
|
80
|
-
const
|
|
81
|
-
if (!
|
|
80
|
+
const conversationId = view.run.metadata?.conversationId?.trim();
|
|
81
|
+
if (!conversationId || !isTerminalWorkflowRunStatus(view.run.status)) return;
|
|
82
82
|
if (this.terminalPersistedRunIds.has(runId)) return;
|
|
83
83
|
this.terminalPersistedRunIds.add(runId);
|
|
84
|
-
await this.persistTerminalTranscript(
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
|
|
84
|
+
await this.persistTerminalTranscript(conversationId, view);
|
|
85
|
+
const parentConversationId = readParentConversationId(view);
|
|
86
|
+
if (parentConversationId) await this.writeParentRunLink({
|
|
87
|
+
parentConversationId,
|
|
88
88
|
runId,
|
|
89
89
|
ownerAgentId: view.run.metadata?.agentId ?? "",
|
|
90
|
-
|
|
90
|
+
workflowConversationId: conversationId,
|
|
91
91
|
definitionId: view.run.definitionId,
|
|
92
92
|
goal: view.run.goal,
|
|
93
93
|
status: view.run.status
|
|
94
94
|
});
|
|
95
|
-
this.recordProjectWorkflowMemory(
|
|
95
|
+
this.recordProjectWorkflowMemory(conversationId, view);
|
|
96
96
|
new TaskWorkflowCoordinator().handleTerminalRun(view);
|
|
97
97
|
}
|
|
98
|
-
async persistTerminalTranscript(
|
|
98
|
+
async persistTerminalTranscript(conversationId, view) {
|
|
99
99
|
const store = this.gateway.sessionIndexInstance.getStore();
|
|
100
100
|
const snapshot = runViewToSnapshot(view);
|
|
101
101
|
const toolCallId = randomUUID();
|
|
@@ -107,7 +107,7 @@ var WorkflowSessionBridge = class {
|
|
|
107
107
|
details: snapshot
|
|
108
108
|
};
|
|
109
109
|
const isError = view.run.status === "failed" || view.run.status === "timeout";
|
|
110
|
-
await store.appendTranscriptMessage(
|
|
110
|
+
await store.appendTranscriptMessage(conversationId, {
|
|
111
111
|
role: "assistant",
|
|
112
112
|
content: [{
|
|
113
113
|
type: "toolCall",
|
|
@@ -117,7 +117,7 @@ var WorkflowSessionBridge = class {
|
|
|
117
117
|
}],
|
|
118
118
|
timestamp: Date.now()
|
|
119
119
|
});
|
|
120
|
-
await store.appendTranscriptMessage(
|
|
120
|
+
await store.appendTranscriptMessage(conversationId, {
|
|
121
121
|
role: "toolResult",
|
|
122
122
|
toolCallId,
|
|
123
123
|
content: [{
|
|
@@ -128,12 +128,12 @@ var WorkflowSessionBridge = class {
|
|
|
128
128
|
isError,
|
|
129
129
|
timestamp: Date.now()
|
|
130
130
|
});
|
|
131
|
-
await store.updateMetadata(
|
|
131
|
+
await store.updateMetadata(conversationId, { status: "active" });
|
|
132
132
|
}
|
|
133
133
|
async writeParentRunLink(params) {
|
|
134
134
|
const store = this.gateway.sessionIndexInstance.getStore();
|
|
135
135
|
const text = formatParentRunLinkText(params);
|
|
136
|
-
await store.appendTranscriptContextEntry(params.
|
|
136
|
+
await store.appendTranscriptContextEntry(params.parentConversationId, {
|
|
137
137
|
kind: "context",
|
|
138
138
|
id: `workflow-run-link:${params.runId}`,
|
|
139
139
|
text,
|
|
@@ -141,7 +141,7 @@ var WorkflowSessionBridge = class {
|
|
|
141
141
|
kind: WORKFLOW_RUN_LINK_CONTEXT_KIND,
|
|
142
142
|
runId: params.runId,
|
|
143
143
|
...params.ownerAgentId ? { ownerAgentId: params.ownerAgentId } : {},
|
|
144
|
-
|
|
144
|
+
workflowConversationId: params.workflowConversationId,
|
|
145
145
|
definitionId: params.definitionId,
|
|
146
146
|
goal: params.goal,
|
|
147
147
|
status: params.status
|
|
@@ -149,7 +149,7 @@ var WorkflowSessionBridge = class {
|
|
|
149
149
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
recordProjectWorkflowMemory(
|
|
152
|
+
recordProjectWorkflowMemory(conversationId, view) {
|
|
153
153
|
const projectId = view.run.metadata?.projectId?.trim();
|
|
154
154
|
const agentId = view.run.metadata?.agentId?.trim();
|
|
155
155
|
if (!projectId || !agentId) return;
|
|
@@ -161,7 +161,7 @@ var WorkflowSessionBridge = class {
|
|
|
161
161
|
id: projectId
|
|
162
162
|
},
|
|
163
163
|
sourceAgentId: agentId,
|
|
164
|
-
|
|
164
|
+
sourceConversationId: conversationId,
|
|
165
165
|
content: [
|
|
166
166
|
`Workflow ${view.run.definitionId} finished with status ${view.run.status}.`,
|
|
167
167
|
view.run.goal ? `Goal: ${view.run.goal}` : void 0,
|
|
@@ -192,12 +192,12 @@ function truncateSessionName(name) {
|
|
|
192
192
|
if (trimmed.length <= 80) return trimmed;
|
|
193
193
|
return `${trimmed.slice(0, 77)}…`;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function readParentConversationId(view) {
|
|
196
196
|
if (view.run.source.kind === "chat") {
|
|
197
|
-
const originKey = view.run.source.
|
|
197
|
+
const originKey = view.run.source.conversationId?.trim();
|
|
198
198
|
if (originKey) return originKey;
|
|
199
199
|
}
|
|
200
|
-
const customParent = view.run.metadata?.origin?.
|
|
200
|
+
const customParent = view.run.metadata?.origin?.conversationId?.trim();
|
|
201
201
|
if (customParent && view.run.metadata?.triggerSource === "chat") return customParent;
|
|
202
202
|
return null;
|
|
203
203
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Stable webchat session key for one workflow run (`agent:{id}:webchat:…:direct:wf_{runId}`). */
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function buildWorkflowRunConversationId(agentId: string, runId: string): string;
|
|
3
3
|
export declare function readWorkflowRunIdFromSessionCustomData(customData: Record<string, unknown> | undefined): string | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { init_session_key, resolveConversationId } from "../../routing/session-key.js";
|
|
2
2
|
//#region src/workflows/service/workflow-session-key.ts
|
|
3
3
|
init_session_key();
|
|
4
4
|
/** Stable webchat session key for one workflow run (`agent:{id}:webchat:…:direct:wf_{runId}`). */
|
|
5
|
-
function
|
|
6
|
-
return
|
|
5
|
+
function buildWorkflowRunConversationId(agentId, runId) {
|
|
6
|
+
return resolveConversationId({
|
|
7
7
|
agentId,
|
|
8
8
|
source: "webchat",
|
|
9
9
|
accountId: "default",
|
|
@@ -16,4 +16,4 @@ function readWorkflowRunIdFromSessionCustomData(customData) {
|
|
|
16
16
|
return typeof raw === "string" && raw.trim() ? raw.trim() : null;
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
export {
|
|
19
|
+
export { buildWorkflowRunConversationId, readWorkflowRunIdFromSessionCustomData };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
3
|
+
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
4
4
|
import { ProjectService } from "../../projects/project-service.js";
|
|
5
5
|
//#region src/workflows/service/workflow-writeback-service.ts
|
|
6
|
+
init_task_run_repository();
|
|
6
7
|
init_logger();
|
|
7
8
|
const log = createLogger("WorkflowWriteback");
|
|
8
9
|
var WorkflowWritebackService = class {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { requireXopcDatabase } from "../../storage/sqlite/connection.js";
|
|
2
|
-
import { runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
1
|
+
import { init_connection, requireXopcDatabase } from "../../storage/sqlite/connection.js";
|
|
2
|
+
import { init_transaction, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
//#region src/workflows/store/event-store.ts
|
|
5
|
+
init_connection();
|
|
6
|
+
init_transaction();
|
|
5
7
|
var WorkflowEventStore = class {
|
|
6
8
|
constructor(_config, agentId) {
|
|
7
9
|
this.agentId = agentId;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { getSqliteDatabase, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
1
|
+
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
2
2
|
//#region src/workflows/store/run-index-store.ts
|
|
3
|
+
init_transaction();
|
|
3
4
|
function rowToSummary(row) {
|
|
4
5
|
const source = JSON.parse(row.source_json);
|
|
5
6
|
const metadata = row.metadata_json ? JSON.parse(row.metadata_json) : void 0;
|
|
@@ -21,24 +22,24 @@ function resultPreview(view) {
|
|
|
21
22
|
if (result == null) return null;
|
|
22
23
|
return result.summary.slice(0, 500);
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
if (view.run.source.kind === "chat") return view.run.source.
|
|
26
|
-
return (view.run.metadata?.origin?.
|
|
25
|
+
function parentConversationId(view) {
|
|
26
|
+
if (view.run.source.kind === "chat") return view.run.source.conversationId;
|
|
27
|
+
return (view.run.metadata?.origin?.conversationId)?.trim() || null;
|
|
27
28
|
}
|
|
28
29
|
var WorkflowRunIndexStore = class {
|
|
29
30
|
upsert(agentId, view) {
|
|
30
31
|
const run = view.run;
|
|
31
32
|
const metadata = run.metadata;
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
33
|
+
const conversationId = metadata?.conversationId;
|
|
34
|
+
if (!conversationId) return;
|
|
34
35
|
runSqliteWriteTransaction((db) => {
|
|
35
36
|
db.prepare(`INSERT OR REPLACE INTO workflow_runs (
|
|
36
37
|
run_id, agent_id, definition_id, definition_version, task_run_id,
|
|
37
|
-
project_id,
|
|
38
|
+
project_id, conversation_id, parent_conversation_id, status, source_kind, source_json,
|
|
38
39
|
metadata_json, title,
|
|
39
40
|
created_at_ms, started_at_ms, completed_at_ms, metrics_json,
|
|
40
41
|
result_preview, error_message
|
|
41
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(run.id, agentId, run.definitionId, run.definitionVersion, metadata?.taskRunId ?? null, metadata?.projectId ?? null,
|
|
42
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(run.id, agentId, run.definitionId, run.definitionVersion, metadata?.taskRunId ?? null, metadata?.projectId ?? null, conversationId, parentConversationId(view), run.status, run.source.kind, JSON.stringify(run.source), metadata ? JSON.stringify(metadata) : null, run.title, run.createdAtMs, run.startedAtMs ?? null, run.completedAtMs ?? null, JSON.stringify(run.metrics), resultPreview(view), run.error?.message ?? null);
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
list(agentId, options = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.286",
|
|
4
4
|
"description": "Local-first personal AI assistant with reviewable user understanding, durable tasks, workflows, automations, and local or cloud models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -167,10 +167,10 @@
|
|
|
167
167
|
"vitest": "4.1.5",
|
|
168
168
|
"vue": "^3.5.35",
|
|
169
169
|
"@xopcai/browser-control-contract": "0.1.0",
|
|
170
|
-
"@xopcai/gateway-contract": "0.0.0",
|
|
171
|
-
"@xopcai/realtime-client": "0.0.0",
|
|
172
170
|
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
173
|
-
"@xopcai/
|
|
171
|
+
"@xopcai/gateway-contract": "0.0.0",
|
|
172
|
+
"@xopcai/realtime-protocol": "0.0.0",
|
|
173
|
+
"@xopcai/realtime-client": "0.0.0"
|
|
174
174
|
},
|
|
175
175
|
"scripts": {
|
|
176
176
|
"assets:brand": "node scripts/generate-brand-assets.mjs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,r as t}from"./locale-store-DlOv7896.js";var n=n=>e(t(n)),r=(n,r,i)=>e(t(n),{method:r,headers:{"content-type":`application/json`},body:JSON.stringify(i)});export{r as n,n as t};
|