@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,10 +1,10 @@
|
|
|
1
1
|
import { formatThinkingLevels, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel } from "../../agent/transcript/thinking-types.js";
|
|
2
2
|
import { commandRegistry } from "../registry.js";
|
|
3
3
|
//#region src/chat-commands/builtins/thinking.ts
|
|
4
|
-
async function setSessionAgentField(store,
|
|
4
|
+
async function setSessionAgentField(store, conversationId, field, value) {
|
|
5
5
|
if (!store) return;
|
|
6
|
-
const existing = await store.get(
|
|
7
|
-
await store.set(
|
|
6
|
+
const existing = await store.get(conversationId) ?? {};
|
|
7
|
+
await store.set(conversationId, {
|
|
8
8
|
...existing,
|
|
9
9
|
[field]: value
|
|
10
10
|
});
|
|
@@ -37,7 +37,7 @@ const thinkCommand = {
|
|
|
37
37
|
content: `❌ Invalid thinking level: ${args}\n\nAvailable levels: ${formatThinkingLevels()}\n\nUsage: /think <level>\nExample: /think high`,
|
|
38
38
|
success: false
|
|
39
39
|
};
|
|
40
|
-
await setSessionAgentField(ctx.getSessionConfigStore?.(), ctx.
|
|
40
|
+
await setSessionAgentField(ctx.getSessionConfigStore?.(), ctx.conversationId, "thinkingLevel", level);
|
|
41
41
|
ctx.syncAgentThinkingLevel?.(level);
|
|
42
42
|
return {
|
|
43
43
|
content: `🧠 *Thinking Level Set*\n\nLevel: *${level}*\n${{
|
|
@@ -82,7 +82,7 @@ const reasoningCommand = {
|
|
|
82
82
|
content: `❌ Invalid reasoning mode: ${args}\n\nAvailable modes: off, on, stream\n\nUsage: /reasoning <mode>\nExample: /reasoning stream`,
|
|
83
83
|
success: false
|
|
84
84
|
};
|
|
85
|
-
await setSessionAgentField(ctx.getSessionConfigStore?.(), ctx.
|
|
85
|
+
await setSessionAgentField(ctx.getSessionConfigStore?.(), ctx.conversationId, "reasoningLevel", level);
|
|
86
86
|
return {
|
|
87
87
|
content: `💭 *Reasoning Visibility Set*\n\nMode: *${level}*\n${{
|
|
88
88
|
off: "Hide reasoning from user",
|
|
@@ -114,7 +114,7 @@ const verboseCommand = {
|
|
|
114
114
|
await ctx.setTyping(true);
|
|
115
115
|
if (!args.trim()) {
|
|
116
116
|
const newLevel = await ctx.getVerboseLevel?.() === "on" ? "off" : "on";
|
|
117
|
-
await setSessionAgentField(ctx.getSessionConfigStore?.(), ctx.
|
|
117
|
+
await setSessionAgentField(ctx.getSessionConfigStore?.(), ctx.conversationId, "verboseLevel", newLevel);
|
|
118
118
|
return {
|
|
119
119
|
content: `📝 *Verbose Mode*\n\nMode: *${newLevel}*\n\n${newLevel === "on" ? "Verbose output enabled (process lifetime)." : "Verbose output disabled (process lifetime)."}`,
|
|
120
120
|
success: true
|
|
@@ -125,7 +125,7 @@ const verboseCommand = {
|
|
|
125
125
|
content: `❌ Invalid verbose mode: ${args}\n\nAvailable modes: off, on, full\n\nUsage: /verbose [mode]\nExample: /verbose on`,
|
|
126
126
|
success: false
|
|
127
127
|
};
|
|
128
|
-
await setSessionAgentField(ctx.getSessionConfigStore?.(), ctx.
|
|
128
|
+
await setSessionAgentField(ctx.getSessionConfigStore?.(), ctx.conversationId, "verboseLevel", level);
|
|
129
129
|
return {
|
|
130
130
|
content: `📝 *Verbose Mode Set*\n\nMode: *${level}*\n${{
|
|
131
131
|
off: "Minimal output",
|
|
@@ -23,7 +23,7 @@ const rememberCommand = {
|
|
|
23
23
|
acceptsArgs: true,
|
|
24
24
|
examples: ["/remember I prefer concise updates", "/remember --session This chat is about launch planning"],
|
|
25
25
|
handler: async (ctx, args) => {
|
|
26
|
-
if ((await ctx.getSessionConfigStore?.().get(ctx.
|
|
26
|
+
if ((await ctx.getSessionConfigStore?.().get(ctx.conversationId))?.userContextMode === "temporary") return {
|
|
27
27
|
content: "This conversation is temporary, so it cannot save user understanding.",
|
|
28
28
|
success: false
|
|
29
29
|
};
|
|
@@ -45,7 +45,7 @@ const rememberCommand = {
|
|
|
45
45
|
kind: "derived_insight",
|
|
46
46
|
scope: sessionOnly ? {
|
|
47
47
|
type: "session",
|
|
48
|
-
id: ctx.
|
|
48
|
+
id: ctx.conversationId
|
|
49
49
|
} : { type: "global" },
|
|
50
50
|
authority: "user_explicit",
|
|
51
51
|
confidence: 1,
|
|
@@ -96,9 +96,9 @@ const learningCommand = {
|
|
|
96
96
|
content: "Usage: /learning on | off | temporary | status",
|
|
97
97
|
success: false
|
|
98
98
|
};
|
|
99
|
-
if (action !== "status") await store.update(ctx.
|
|
99
|
+
if (action !== "status") await store.update(ctx.conversationId, { userContextMode: action === "on" ? "enabled" : action });
|
|
100
100
|
const globallyEnabled = ctx.config.userContext.enabled;
|
|
101
|
-
const mode = (await store.get(ctx.
|
|
101
|
+
const mode = (await store.get(ctx.conversationId))?.userContextMode ?? "enabled";
|
|
102
102
|
return {
|
|
103
103
|
content: globallyEnabled && mode === "enabled" ? "User understanding is enabled for this conversation." : globallyEnabled && mode === "temporary" ? "This is a temporary conversation. Stored user context is not read, and this conversation does not update user understanding." : globallyEnabled ? "User understanding is off for this conversation. Existing chat history is still stored; use /remember for anything you explicitly want saved." : "User understanding is disabled globally. Existing chat history is still stored.",
|
|
104
104
|
success: true
|
|
@@ -139,20 +139,20 @@ async function runWorkflowFromCommand(ctx, args) {
|
|
|
139
139
|
success: false
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
const agentId = extractProfileAgentId(ctx.
|
|
142
|
+
const agentId = extractProfileAgentId(ctx.conversationId, ctx.config);
|
|
143
143
|
const source = ctx.source === "webui" || ctx.channelId === "webchat" ? {
|
|
144
144
|
kind: "webui",
|
|
145
|
-
|
|
145
|
+
conversationId: ctx.conversationId
|
|
146
146
|
} : {
|
|
147
147
|
kind: "chat",
|
|
148
|
-
|
|
148
|
+
conversationId: ctx.conversationId
|
|
149
149
|
};
|
|
150
150
|
const result = await ctx.workflowRunApis.startWorkflowRun({
|
|
151
151
|
agentId,
|
|
152
152
|
definitionId: parsed.name,
|
|
153
153
|
goal: parsed.goal,
|
|
154
154
|
input: parsed.input,
|
|
155
|
-
|
|
155
|
+
parentConversationId: ctx.conversationId,
|
|
156
156
|
source
|
|
157
157
|
});
|
|
158
158
|
if (result.ok === false) return {
|
|
@@ -170,16 +170,16 @@ async function runWorkflowFromCommand(ctx, args) {
|
|
|
170
170
|
label: "runId",
|
|
171
171
|
detail: code(result.runId)
|
|
172
172
|
}, {
|
|
173
|
-
label: "
|
|
174
|
-
detail: code(result.
|
|
173
|
+
label: "conversationId",
|
|
174
|
+
detail: code(result.conversationId)
|
|
175
175
|
}])),
|
|
176
176
|
success: true,
|
|
177
177
|
metadata: { workflowRun: {
|
|
178
178
|
ok: true,
|
|
179
179
|
definitionId: parsed.name,
|
|
180
180
|
runId: result.runId,
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
conversationId: result.conversationId,
|
|
182
|
+
parentConversationId: ctx.conversationId
|
|
183
183
|
} }
|
|
184
184
|
};
|
|
185
185
|
}
|
|
@@ -13,7 +13,7 @@ import type { ThinkLevel, ReasoningLevel, VerboseLevel } from '../agent/transcri
|
|
|
13
13
|
import type { CompactionResult } from '../agent/memory/compaction.js';
|
|
14
14
|
import type { WorkflowRunServiceLike } from '../workflows/service/workflow-run-service.types.js';
|
|
15
15
|
export interface CommandContextDeps {
|
|
16
|
-
|
|
16
|
+
conversationId: string;
|
|
17
17
|
source: MessageSource;
|
|
18
18
|
channelId: string;
|
|
19
19
|
chatId: string;
|
|
@@ -26,15 +26,15 @@ export interface CommandContextDeps {
|
|
|
26
26
|
sessionStore: SessionStore;
|
|
27
27
|
sessionConfigStore?: SessionConfigStore;
|
|
28
28
|
/** After persisting session thinking, sync pi-agent in-memory state */
|
|
29
|
-
applySessionThinkingLevel?: (
|
|
29
|
+
applySessionThinkingLevel?: (conversationId: string, level: ThinkLevel) => void;
|
|
30
30
|
replyHandler: (text: string, options?: ReplyOptions) => Promise<void>;
|
|
31
31
|
componentHandler?: (component: UIComponent) => Promise<void>;
|
|
32
32
|
typingHandler?: (typing: boolean) => Promise<void>;
|
|
33
33
|
supportedFeatures: PlatformFeature[];
|
|
34
34
|
/** Called after session files are removed so in-memory agents match disk */
|
|
35
|
-
invalidateAgentSession?: (
|
|
35
|
+
invalidateAgentSession?: (conversationId: string) => void;
|
|
36
36
|
/** Reset session in place (archive + new session id); optional — falls back to clearSession */
|
|
37
|
-
resetSession?: (
|
|
37
|
+
resetSession?: (conversationId: string) => Promise<void>;
|
|
38
38
|
getCurrentModel?: () => string;
|
|
39
39
|
switchModel?: (modelId: string) => Promise<boolean>;
|
|
40
40
|
listModels?: () => Promise<ModelInfo[]>;
|
|
@@ -45,20 +45,20 @@ export interface CommandContextDeps {
|
|
|
45
45
|
reloadSkills?: () => Promise<void>;
|
|
46
46
|
/** Install a managed skill from an explicit source and refresh active agent prompts. */
|
|
47
47
|
installSkillFromSource?: CommandContext['installSkillFromSource'];
|
|
48
|
-
compactSession?: (
|
|
48
|
+
compactSession?: (conversationId: string, options?: {
|
|
49
49
|
instructions?: string;
|
|
50
50
|
force?: boolean;
|
|
51
51
|
}) => Promise<CompactionResult>;
|
|
52
|
-
btwQuery?: (
|
|
52
|
+
btwQuery?: (conversationId: string, question: string, options?: BtwQueryOptions) => Promise<{
|
|
53
53
|
text: string;
|
|
54
54
|
error?: string;
|
|
55
55
|
}>;
|
|
56
56
|
emitEvent?: (event: CommandStreamEvent) => void | Promise<void>;
|
|
57
|
-
getSessionContextReport?: (
|
|
57
|
+
getSessionContextReport?: (conversationId: string, mode: 'list' | 'detail' | 'json') => Promise<string>;
|
|
58
58
|
workflowRunService?: WorkflowRunServiceLike;
|
|
59
59
|
}
|
|
60
60
|
export declare class CommandContextImpl implements CommandContext {
|
|
61
|
-
readonly
|
|
61
|
+
readonly conversationId: string;
|
|
62
62
|
readonly source: MessageSource;
|
|
63
63
|
readonly channelId: string;
|
|
64
64
|
readonly chatId: string;
|
|
@@ -82,7 +82,7 @@ export declare class CommandContextImpl implements CommandContext {
|
|
|
82
82
|
clearSession(): Promise<void>;
|
|
83
83
|
archiveSession(): Promise<void>;
|
|
84
84
|
listSessions(): Promise<SessionInfo[]>;
|
|
85
|
-
switchSession(
|
|
85
|
+
switchSession(conversationId: string): Promise<void>;
|
|
86
86
|
getCurrentModel(): string;
|
|
87
87
|
listModels(): Promise<ModelInfo[]>;
|
|
88
88
|
switchModel(modelId: string): Promise<boolean>;
|
|
@@ -14,7 +14,7 @@ init_logger();
|
|
|
14
14
|
init_loader();
|
|
15
15
|
const log = createLogger("CommandContext");
|
|
16
16
|
var CommandContextImpl = class {
|
|
17
|
-
|
|
17
|
+
conversationId;
|
|
18
18
|
source;
|
|
19
19
|
channelId;
|
|
20
20
|
chatId;
|
|
@@ -29,7 +29,7 @@ var CommandContextImpl = class {
|
|
|
29
29
|
workflowRunApis;
|
|
30
30
|
deps;
|
|
31
31
|
constructor(deps) {
|
|
32
|
-
this.
|
|
32
|
+
this.conversationId = deps.conversationId;
|
|
33
33
|
this.source = deps.source;
|
|
34
34
|
this.channelId = deps.channelId;
|
|
35
35
|
this.chatId = deps.chatId;
|
|
@@ -75,13 +75,13 @@ var CommandContextImpl = class {
|
|
|
75
75
|
if (this.deps.typingHandler) await this.deps.typingHandler(typing);
|
|
76
76
|
}
|
|
77
77
|
async getSession() {
|
|
78
|
-
return this.deps.sessionStore.load(this.
|
|
78
|
+
return this.deps.sessionStore.load(this.conversationId);
|
|
79
79
|
}
|
|
80
80
|
async resetSession() {
|
|
81
|
-
if (this.deps.resetSession) await this.deps.resetSession(this.
|
|
81
|
+
if (this.deps.resetSession) await this.deps.resetSession(this.conversationId);
|
|
82
82
|
else if (typeof this.deps.sessionStore.reset === "function") {
|
|
83
|
-
if (!await this.deps.sessionStore.reset(this.
|
|
84
|
-
this.deps.invalidateAgentSession?.(this.
|
|
83
|
+
if (!await this.deps.sessionStore.reset(this.conversationId)) throw new Error("Session not found");
|
|
84
|
+
this.deps.invalidateAgentSession?.(this.conversationId);
|
|
85
85
|
} else {
|
|
86
86
|
await this.clearSession();
|
|
87
87
|
return;
|
|
@@ -93,19 +93,19 @@ var CommandContextImpl = class {
|
|
|
93
93
|
type: "message",
|
|
94
94
|
metadata: this.outboundMetadata()
|
|
95
95
|
});
|
|
96
|
-
log.info({
|
|
96
|
+
log.info({ conversationId: this.conversationId }, "Session reset");
|
|
97
97
|
}
|
|
98
98
|
async clearSession() {
|
|
99
99
|
const messages = await this.getSession();
|
|
100
100
|
if (messages.length > 0) {
|
|
101
|
-
await this.deps.sessionStore.archive(this.
|
|
101
|
+
await this.deps.sessionStore.archive(this.conversationId);
|
|
102
102
|
log.info({
|
|
103
|
-
|
|
103
|
+
conversationId: this.conversationId,
|
|
104
104
|
messageCount: messages.length
|
|
105
105
|
}, "Session archived");
|
|
106
106
|
}
|
|
107
|
-
await this.deps.sessionStore.deleteSession(this.
|
|
108
|
-
this.deps.invalidateAgentSession?.(this.
|
|
107
|
+
await this.deps.sessionStore.deleteSession(this.conversationId);
|
|
108
|
+
this.deps.invalidateAgentSession?.(this.conversationId);
|
|
109
109
|
await this.deps.bus.publishOutbound({
|
|
110
110
|
channel: this.source,
|
|
111
111
|
chat_id: this.chatId,
|
|
@@ -113,27 +113,27 @@ var CommandContextImpl = class {
|
|
|
113
113
|
type: "message",
|
|
114
114
|
metadata: this.outboundMetadata()
|
|
115
115
|
});
|
|
116
|
-
log.info({
|
|
116
|
+
log.info({ conversationId: this.conversationId }, "Session cleared");
|
|
117
117
|
}
|
|
118
118
|
async archiveSession() {
|
|
119
|
-
await this.deps.sessionStore.archive(this.
|
|
120
|
-
log.info({
|
|
119
|
+
await this.deps.sessionStore.archive(this.conversationId);
|
|
120
|
+
log.info({ conversationId: this.conversationId }, "Session archived");
|
|
121
121
|
}
|
|
122
122
|
async listSessions() {
|
|
123
123
|
const messages = await this.getSession();
|
|
124
124
|
return [{
|
|
125
|
-
key: this.
|
|
126
|
-
name: getSessionDisplayName(this.
|
|
125
|
+
key: this.conversationId,
|
|
126
|
+
name: getSessionDisplayName(this.conversationId),
|
|
127
127
|
messageCount: messages.length,
|
|
128
128
|
createdAt: /* @__PURE__ */ new Date(),
|
|
129
129
|
updatedAt: /* @__PURE__ */ new Date(),
|
|
130
130
|
isActive: true
|
|
131
131
|
}];
|
|
132
132
|
}
|
|
133
|
-
async switchSession(
|
|
133
|
+
async switchSession(conversationId) {
|
|
134
134
|
log.info({
|
|
135
|
-
from: this.
|
|
136
|
-
to:
|
|
135
|
+
from: this.conversationId,
|
|
136
|
+
to: conversationId
|
|
137
137
|
}, "Session switch requested");
|
|
138
138
|
}
|
|
139
139
|
getCurrentModel() {
|
|
@@ -208,7 +208,7 @@ var CommandContextImpl = class {
|
|
|
208
208
|
async getThinkingLevel() {
|
|
209
209
|
const configStore = this.deps.sessionConfigStore;
|
|
210
210
|
if (configStore) {
|
|
211
|
-
const sessionConfig = await configStore.get(this.
|
|
211
|
+
const sessionConfig = await configStore.get(this.conversationId);
|
|
212
212
|
if (sessionConfig?.thinkingLevel) return sessionConfig.thinkingLevel;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
@@ -217,15 +217,15 @@ var CommandContextImpl = class {
|
|
|
217
217
|
*/
|
|
218
218
|
async setThinkingLevel(level) {
|
|
219
219
|
const configStore = this.deps.sessionConfigStore;
|
|
220
|
-
if (configStore) await configStore.update(this.
|
|
221
|
-
this.deps.applySessionThinkingLevel?.(this.
|
|
220
|
+
if (configStore) await configStore.update(this.conversationId, { thinkingLevel: level });
|
|
221
|
+
this.deps.applySessionThinkingLevel?.(this.conversationId, level);
|
|
222
222
|
}
|
|
223
223
|
syncAgentThinkingLevel(level) {
|
|
224
|
-
this.deps.applySessionThinkingLevel?.(this.
|
|
224
|
+
this.deps.applySessionThinkingLevel?.(this.conversationId, level);
|
|
225
225
|
}
|
|
226
226
|
async compactSession(options) {
|
|
227
227
|
if (!this.deps.compactSession) return null;
|
|
228
|
-
const r = await this.deps.compactSession(this.
|
|
228
|
+
const r = await this.deps.compactSession(this.conversationId, options);
|
|
229
229
|
return {
|
|
230
230
|
compacted: r.compacted,
|
|
231
231
|
tokensBefore: r.tokensBefore,
|
|
@@ -238,19 +238,19 @@ var CommandContextImpl = class {
|
|
|
238
238
|
text: "",
|
|
239
239
|
error: "Side questions are not available in this environment."
|
|
240
240
|
};
|
|
241
|
-
return this.deps.btwQuery(this.
|
|
241
|
+
return this.deps.btwQuery(this.conversationId, question, options);
|
|
242
242
|
}
|
|
243
243
|
emitEvent(event) {
|
|
244
244
|
return this.deps.emitEvent?.(event);
|
|
245
245
|
}
|
|
246
246
|
async exportSessionToWorkspace(format) {
|
|
247
247
|
const exportFmt = format === "json" ? "json" : "markdown";
|
|
248
|
-
let body = await this.deps.sessionStore.exportSession(this.
|
|
249
|
-
if (format === "html") body = wrapMarkdownExportAsHtml(`Session ${this.
|
|
250
|
-
const sc = this.deps.sessionConfigStore ? await this.deps.sessionConfigStore.get(this.
|
|
251
|
-
const dir = join(effectiveWorkspacePathForSession(this.config, this.
|
|
248
|
+
let body = await this.deps.sessionStore.exportSession(this.conversationId, exportFmt);
|
|
249
|
+
if (format === "html") body = wrapMarkdownExportAsHtml(`Session ${this.conversationId}`, body);
|
|
250
|
+
const sc = this.deps.sessionConfigStore ? await this.deps.sessionConfigStore.get(this.conversationId) : null;
|
|
251
|
+
const dir = join(effectiveWorkspacePathForSession(this.config, this.conversationId, sc, getProjectForSession(this.conversationId)), "exports");
|
|
252
252
|
await mkdir(dir, { recursive: true });
|
|
253
|
-
const safe = this.
|
|
253
|
+
const safe = this.conversationId.replace(/[^a-zA-Z0-9._-]+/g, "_").slice(0, 96);
|
|
254
254
|
const ext = format === "json" ? "json" : format === "html" ? "html" : "md";
|
|
255
255
|
const outPath = join(dir, `session-${safe}-${Date.now()}.${ext}`);
|
|
256
256
|
await writeFile(outPath, body, "utf-8");
|
|
@@ -258,7 +258,7 @@ var CommandContextImpl = class {
|
|
|
258
258
|
}
|
|
259
259
|
async agentContextReport(mode = "list") {
|
|
260
260
|
if (!this.deps.getSessionContextReport) return "Context report is not available in this environment.";
|
|
261
|
-
return this.deps.getSessionContextReport(this.
|
|
261
|
+
return this.deps.getSessionContextReport(this.conversationId, mode);
|
|
262
262
|
}
|
|
263
263
|
/**
|
|
264
264
|
* Get current reasoning level (session override or default)
|
|
@@ -266,7 +266,7 @@ var CommandContextImpl = class {
|
|
|
266
266
|
async getReasoningLevel() {
|
|
267
267
|
const configStore = this.deps.sessionConfigStore;
|
|
268
268
|
if (configStore) {
|
|
269
|
-
const sessionConfig = await configStore.get(this.
|
|
269
|
+
const sessionConfig = await configStore.get(this.conversationId);
|
|
270
270
|
if (sessionConfig?.reasoningLevel) return sessionConfig.reasoningLevel;
|
|
271
271
|
}
|
|
272
272
|
}
|
|
@@ -275,7 +275,7 @@ var CommandContextImpl = class {
|
|
|
275
275
|
*/
|
|
276
276
|
async setReasoningLevel(level) {
|
|
277
277
|
const configStore = this.deps.sessionConfigStore;
|
|
278
|
-
if (configStore) await configStore.update(this.
|
|
278
|
+
if (configStore) await configStore.update(this.conversationId, { reasoningLevel: level });
|
|
279
279
|
}
|
|
280
280
|
/**
|
|
281
281
|
* Get current verbose level (session override or default)
|
|
@@ -283,7 +283,7 @@ var CommandContextImpl = class {
|
|
|
283
283
|
async getVerboseLevel() {
|
|
284
284
|
const configStore = this.deps.sessionConfigStore;
|
|
285
285
|
if (configStore) {
|
|
286
|
-
const sessionConfig = await configStore.get(this.
|
|
286
|
+
const sessionConfig = await configStore.get(this.conversationId);
|
|
287
287
|
if (sessionConfig?.verboseLevel) return sessionConfig.verboseLevel;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
@@ -292,7 +292,7 @@ var CommandContextImpl = class {
|
|
|
292
292
|
*/
|
|
293
293
|
async setVerboseLevel(level) {
|
|
294
294
|
const configStore = this.deps.sessionConfigStore;
|
|
295
|
-
if (configStore) await configStore.update(this.
|
|
295
|
+
if (configStore) await configStore.update(this.conversationId, { verboseLevel: level });
|
|
296
296
|
}
|
|
297
297
|
renderComponentAsText(component) {
|
|
298
298
|
switch (component.type) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Telegram, Feishu, Web UI, CLI, and other channel surfaces.
|
|
6
6
|
*/
|
|
7
7
|
export type { MessageSource, UnifiedMessage, PlatformMetadata, MessageAttachment, CommandDefinition, CommandCategory, CommandScope, CommandHandler, CommandResult, CommandStreamEvent, BtwQueryOptions, CommandContext, ReplyOptions, UIComponent, ButtonGroup, SelectMenu, ModelPicker, UsageDisplay, SessionList, TextInput, ProviderInfo, ModelInfo, UsageStats, SessionInfo, PlatformFeature, ChannelAdapter, ReplyPayload, } from './types.js';
|
|
8
|
-
export {
|
|
8
|
+
export { generateConversationId, getSessionDisplayName, type ConversationIdContext } from './session-key.js';
|
|
9
9
|
export { normalizeTelegramCommandName, parseSlashCommand } from './command-parse.js';
|
|
10
10
|
export { CommandRegistry, commandRegistry } from './registry.js';
|
|
11
11
|
export type { CommandRegistry as CommandRegistryType } from './types.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalizeTelegramCommandName, parseSlashCommand } from "./command-parse.js";
|
|
2
2
|
import { CommandRegistry, commandRegistry } from "./registry.js";
|
|
3
|
-
import {
|
|
3
|
+
import { generateConversationId, getSessionDisplayName } from "./session-key.js";
|
|
4
4
|
import { registerSessionCommands } from "./builtins/session.js";
|
|
5
5
|
import { registerModelCommands } from "./builtins/model.js";
|
|
6
6
|
import { registerSystemCommands } from "./builtins/system.js";
|
|
@@ -39,4 +39,4 @@ function initializeCommands() {
|
|
|
39
39
|
registerAgentEditCommand();
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
|
-
export { CommandContextImpl, CommandRegistry, commandRegistry, createCommandContext,
|
|
42
|
+
export { CommandContextImpl, CommandRegistry, commandRegistry, createCommandContext, generateConversationId, getSessionDisplayName, initializeCommands, normalizeTelegramCommandName, parseSlashCommand, registerAgentEditCommand, registerConfigCommand, registerContextCommands, registerModelCommands, registerReviewCommand, registerSessionCommands, registerSkillCommand, registerSystemCommands, registerTTSCommands, registerThinkingCommands, registerUnderstandingCommands, registerWorkflowCommands };
|
|
@@ -28,7 +28,7 @@ async function executeCommand(message, deps) {
|
|
|
28
28
|
if (!commandName) return false;
|
|
29
29
|
log.info({
|
|
30
30
|
command: commandName,
|
|
31
|
-
|
|
31
|
+
conversationId: message.conversationId
|
|
32
32
|
}, "Executing command");
|
|
33
33
|
const ctx = await createCommandContextFromMessage(message, deps);
|
|
34
34
|
const result = await commandRegistry.execute(commandName, ctx, commandArgs || "");
|
|
@@ -46,7 +46,7 @@ async function executeCommand(message, deps) {
|
|
|
46
46
|
*/
|
|
47
47
|
async function createCommandContextFromMessage(message, deps) {
|
|
48
48
|
return createCommandContext({
|
|
49
|
-
|
|
49
|
+
conversationId: message.conversationId,
|
|
50
50
|
source: message.source,
|
|
51
51
|
channelId: message.channelId,
|
|
52
52
|
chatId: message.chatId,
|
|
@@ -104,7 +104,7 @@ var CommandRegistry = class CommandRegistry {
|
|
|
104
104
|
};
|
|
105
105
|
log.info({
|
|
106
106
|
command: name,
|
|
107
|
-
|
|
107
|
+
conversationId: context.conversationId
|
|
108
108
|
}, "Executing command");
|
|
109
109
|
try {
|
|
110
110
|
const result = await command.handler(context, args);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Session routing is resolved from SessionMetadata, not by parsing session keys.
|
|
5
5
|
*/
|
|
6
6
|
import type { MessageSource } from './types.js';
|
|
7
|
-
export interface
|
|
7
|
+
export interface ConversationIdContext {
|
|
8
8
|
source: MessageSource;
|
|
9
9
|
channelId?: string;
|
|
10
10
|
chatId: string;
|
|
@@ -17,5 +17,5 @@ export interface SessionKeyContext {
|
|
|
17
17
|
dmScope?: 'main' | 'per-peer' | 'per-channel-peer' | 'per-account-channel-peer';
|
|
18
18
|
identityLinks?: Record<string, string[]>;
|
|
19
19
|
}
|
|
20
|
-
export declare function
|
|
21
|
-
export declare function getSessionDisplayName(
|
|
20
|
+
export declare function generateConversationId(ctx: ConversationIdContext): string;
|
|
21
|
+
export declare function getSessionDisplayName(conversationId: string): string;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveAgentMainConversationId, resolveAgentPeerConversationId } from "../routing/agent-session-key.js";
|
|
2
2
|
import { init_session_key } from "../routing/session-key.js";
|
|
3
3
|
//#region src/chat-commands/session-key.ts
|
|
4
4
|
init_session_key();
|
|
5
|
-
function
|
|
5
|
+
function generateConversationId(ctx) {
|
|
6
6
|
const effectiveAgentId = ctx.agentId ?? "main";
|
|
7
7
|
const effectiveAccountId = ctx.accountId ?? "default";
|
|
8
8
|
const channel = ctx.source === "webui" ? "webchat" : ctx.source;
|
|
9
9
|
if (ctx.source === "cli") {
|
|
10
|
-
if (ctx.chatId === "direct" || ctx.chatId === "main") return
|
|
10
|
+
if (ctx.chatId === "direct" || ctx.chatId === "main") return resolveAgentMainConversationId({
|
|
11
11
|
agentId: effectiveAgentId,
|
|
12
12
|
mainKey: ctx.mainKey
|
|
13
13
|
});
|
|
14
|
-
return
|
|
14
|
+
return resolveAgentPeerConversationId({
|
|
15
15
|
agentId: effectiveAgentId,
|
|
16
16
|
mainKey: ctx.mainKey,
|
|
17
17
|
channel: "cli",
|
|
@@ -21,34 +21,30 @@ function generateSessionKey(ctx) {
|
|
|
21
21
|
dmScope: "per-peer"
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
if (!ctx.isGroup) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return key;
|
|
37
|
-
}
|
|
38
|
-
let key = buildAgentPeerSessionKey({
|
|
24
|
+
if (!ctx.isGroup) return resolveAgentPeerConversationId({
|
|
25
|
+
agentId: effectiveAgentId,
|
|
26
|
+
mainKey: ctx.mainKey,
|
|
27
|
+
channel,
|
|
28
|
+
accountId: effectiveAccountId,
|
|
29
|
+
peerKind: "direct",
|
|
30
|
+
peerId: ctx.senderId,
|
|
31
|
+
identityLinks: ctx.identityLinks,
|
|
32
|
+
threadId: ctx.threadId,
|
|
33
|
+
dmScope: ctx.dmScope ?? "per-account-channel-peer"
|
|
34
|
+
});
|
|
35
|
+
return resolveAgentPeerConversationId({
|
|
39
36
|
agentId: effectiveAgentId,
|
|
40
37
|
mainKey: ctx.mainKey,
|
|
41
38
|
channel,
|
|
42
39
|
accountId: effectiveAccountId,
|
|
43
40
|
peerKind: "group",
|
|
41
|
+
threadId: ctx.threadId,
|
|
44
42
|
peerId: ctx.chatId,
|
|
45
43
|
identityLinks: ctx.identityLinks
|
|
46
44
|
});
|
|
47
|
-
if (ctx.threadId) key = `${key}:thread:${ctx.threadId.toLowerCase()}`;
|
|
48
|
-
return key;
|
|
49
45
|
}
|
|
50
|
-
function getSessionDisplayName(
|
|
51
|
-
return
|
|
46
|
+
function getSessionDisplayName(conversationId) {
|
|
47
|
+
return conversationId.trim() || "Session";
|
|
52
48
|
}
|
|
53
49
|
//#endregion
|
|
54
|
-
export {
|
|
50
|
+
export { generateConversationId, getSessionDisplayName };
|
|
@@ -31,7 +31,7 @@ export interface UnifiedMessage {
|
|
|
31
31
|
/** Command arguments */
|
|
32
32
|
commandArgs?: string;
|
|
33
33
|
/** Unified session key */
|
|
34
|
-
|
|
34
|
+
conversationId: string;
|
|
35
35
|
/** Platform-specific metadata */
|
|
36
36
|
platformData: PlatformMetadata;
|
|
37
37
|
/** Optional attachments */
|
|
@@ -121,7 +121,7 @@ export type BtwQueryOptions = {
|
|
|
121
121
|
};
|
|
122
122
|
export interface CommandContext {
|
|
123
123
|
/** Unified session key */
|
|
124
|
-
|
|
124
|
+
conversationId: string;
|
|
125
125
|
/** Message source platform */
|
|
126
126
|
source: MessageSource;
|
|
127
127
|
/** Channel ID */
|
|
@@ -156,7 +156,7 @@ export interface CommandContext {
|
|
|
156
156
|
/** List user's sessions */
|
|
157
157
|
listSessions(): Promise<SessionInfo[]>;
|
|
158
158
|
/** Switch to a different session */
|
|
159
|
-
switchSession(
|
|
159
|
+
switchSession(conversationId: string): Promise<void>;
|
|
160
160
|
/** Get current model ID */
|
|
161
161
|
getCurrentModel(): string;
|
|
162
162
|
/** List available models */
|
|
@@ -6,8 +6,8 @@ import { renderStreamToTerminal } from "./stream-renderer.js";
|
|
|
6
6
|
* Start interactive chat mode
|
|
7
7
|
*/
|
|
8
8
|
async function startInteractiveChat(agent, options) {
|
|
9
|
-
const {
|
|
10
|
-
let
|
|
9
|
+
const { conversationId: initialConversationId, continuingSession } = options;
|
|
10
|
+
let conversationId = initialConversationId;
|
|
11
11
|
if (continuingSession) console.log("🧠 Interactive chat mode - Continuing session\n");
|
|
12
12
|
else console.log("🧠 Interactive chat mode (Ctrl+C to exit)\n");
|
|
13
13
|
const rl = (await import("readline")).createInterface({
|
|
@@ -25,11 +25,11 @@ async function startInteractiveChat(agent, options) {
|
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
if (trimmed.startsWith(":session ")) {
|
|
28
|
-
const
|
|
29
|
-
if (await (await getSessionIndex()).getSessionMetadata(
|
|
30
|
-
|
|
31
|
-
console.log(`🔄 Switched to session: ${
|
|
32
|
-
} else console.log(`❌ Session not found: ${
|
|
28
|
+
const newConversationId = trimmed.slice(9).trim();
|
|
29
|
+
if (await (await getSessionIndex()).getSessionMetadata(newConversationId)) {
|
|
30
|
+
conversationId = newConversationId;
|
|
31
|
+
console.log(`🔄 Switched to session: ${conversationId}\n`);
|
|
32
|
+
} else console.log(`❌ Session not found: ${newConversationId}\n`);
|
|
33
33
|
rl.prompt();
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
@@ -43,7 +43,7 @@ async function startInteractiveChat(agent, options) {
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
rl.pause();
|
|
46
|
-
await renderStreamToTerminal(agent, input,
|
|
46
|
+
await renderStreamToTerminal(agent, input, conversationId);
|
|
47
47
|
rl.resume();
|
|
48
48
|
rl.prompt();
|
|
49
49
|
});
|
|
@@ -11,4 +11,4 @@ import type { AgentService } from '../../../agent/index.js';
|
|
|
11
11
|
*
|
|
12
12
|
* Returns the final aggregated response text.
|
|
13
13
|
*/
|
|
14
|
-
export declare function renderStreamToTerminal(agent: AgentService, message: string,
|
|
14
|
+
export declare function renderStreamToTerminal(agent: AgentService, message: string, conversationId: string): Promise<string>;
|
|
@@ -26,9 +26,9 @@ function formatToolArgs(args) {
|
|
|
26
26
|
*
|
|
27
27
|
* Returns the final aggregated response text.
|
|
28
28
|
*/
|
|
29
|
-
async function renderStreamToTerminal(agent, message,
|
|
29
|
+
async function renderStreamToTerminal(agent, message, conversationId) {
|
|
30
30
|
const stamped = message.trimStart().startsWith("/") ? message : prependEnvelopeTimestamp(message);
|
|
31
|
-
const stream = agent.turnDispatcher.processDirectStreaming(stamped,
|
|
31
|
+
const stream = agent.turnDispatcher.processDirectStreaming(stamped, conversationId, {
|
|
32
32
|
type: "system",
|
|
33
33
|
source: "cli"
|
|
34
34
|
});
|