@xopcai/xopc 0.0.284 → 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-CwbIMGLY.js → activity-store-xOhV8FHx.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DjiOld-S.js → agent-avatar-dicebear-BzQbYWEj.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BxR5eog4.js +1 -0
- package/dist/gateway/static/root/assets/agents-Dx1om1eN.js +1 -0
- package/dist/gateway/static/root/assets/{api-3lphBVuY.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-B2nwCXxE.js → app-management-settings-panel-CTyuXkNC.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BXO4Ej88.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-6ZRqNjla.js → archive-plugin-O49jeeXo.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CmPZalcW.js → attachment-load-r9lBF2tW.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Bc3WbK5n.js → automations-page-CFFLXYgS.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-DUZE1NOH.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-OWR6cxpc.js → binary-plugins-BpM43vsn.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Ca-tDQXm.js → block-editor-DFrfEcGw.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-Dxy2_p3U.js → browser-automation-inputs-CyHGQwxQ.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CibQIxpi.js → browser-automations-page-CPkOWfM9.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-BOcseZxg.js +8 -0
- 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-Bh-G9mdZ.js → channels-status-swr-BArPeImO.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-lbzbSpV3.js → chat-terminal-dock-D5Aka4S8.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-BEQR0NRq.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-CjrWuy2m.js → cron-expression-GDPX4NxC.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-tYvbTfZT.js → date-picker-DNtRu6EB.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-B8yo7-7V.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-DNeVGZNp.js → desktop-pet-settings-BEse55eX.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-be30HuFI.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CiK0QI2p.js → extension-debug-page-YzhYyuay.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CirPNHJd.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-Co4hHe0i.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-DBPNJG-e.js → gateway-startup-retry-zMPfje0n.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-BtxitqZ3.js +1 -0
- package/dist/gateway/static/root/assets/home-page-_oqo0pNR.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-D0rMTumD.js → image-generation-api-B_Tyx74A.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-eZciuLw_.js +1 -0
- 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-CMUaF61L.js → keyboard-shortcuts-settings-B796W039.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Z8mpau9d.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-CHxyT09t.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-jXbA2S54.js → management-settings-b1MG7s-3.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CKInRsDh.js → markdown-view-2txE_Blz.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BaPkSvW7.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-Bm33_3xJ.js +5 -0
- 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-DzgF1yYO.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-iQ-eW6Aj.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-DMNudT60.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-u_wVepf7.js → runtime-tools-settings-panel-bmgxwWpW.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-YdZj2xdI.js → schema-form-DoZeepCg.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BaxIfjpm.js +1 -0
- 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-CV8kVdnE.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-BuYto2mT.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BHwjHlrV.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-DRKdb6O5.js → skills-page-D-7UtJIc.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DYfaLtts.js → skills-page.utils-dvue6Ish.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CWrWpKV-.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-CDc7Wqy5.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-D-FRib85.js → use-autosave-Iq83UDt3.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-DByIJcQq.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-iQ7EBzII.js → voice-api-key-field-D-QssKik.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DNMWA2tx.js → voice-config-api-B0wNN_tE.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BesuhDlH.js → work-discovery-overlay-5NRYg1iI.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Du81FoCy.js → workflow-run-setup-panel-Ds2SZjLG.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BJv3eoKR.js +6 -0
- 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 -119
- 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/repository-instructions.js +1 -1
- package/dist/src/agent/coding/workspace-revision.js +1 -1
- package/dist/src/agent/commands/command-isolation.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 +42 -38
- 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/review-workspace.js +1 -1
- 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/browser-ext-install.js +10 -2
- 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 +3 -3
- 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 +12 -8
- 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 +4 -0
- package/dist/src/cli/commands/import.js +56 -7
- package/dist/src/cli/commands/logs.js +3 -3
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/platform.js +1 -1
- package/dist/src/cli/commands/profile.js +1 -1
- 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 +3 -2
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/config/agent-profile.d.ts +3 -3
- package/dist/src/config/agent-profile.js +12 -12
- package/dist/src/config/index.js +1 -1
- 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 +4 -1
- package/dist/src/discussions/analyzer.js +2 -1
- package/dist/src/discussions/edits.js +3 -1
- package/dist/src/discussions/organizer.js +2 -1
- package/dist/src/discussions/recording.js +4 -1
- 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/service.js +4 -1
- 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.d.ts +2 -0
- package/dist/src/endpoint-tools/invocation-service.js +50 -20
- 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.d.ts +18 -0
- package/dist/src/gateway/heartbeat/check-store.js +74 -0
- package/dist/src/gateway/heartbeat/service.d.ts +12 -3
- package/dist/src/gateway/heartbeat/service.js +82 -51
- 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/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/imports.js +18 -6
- 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/proactive-control.js +2 -1
- 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/run-loop.js +1 -1
- 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 +11 -4
- package/dist/src/gateway/service.js +92 -71
- 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/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/importService.d.ts +17 -12
- package/dist/src/imports/importService.js +67 -70
- package/dist/src/imports/inventory.d.ts +11 -0
- package/dist/src/imports/inventory.js +202 -0
- package/dist/src/imports/productImport.d.ts +4 -4
- package/dist/src/imports/productImport.js +202 -108
- package/dist/src/imports/runtime.js +7 -2
- package/dist/src/imports/scanner.d.ts +1 -1
- package/dist/src/imports/scanner.js +4 -4
- package/dist/src/imports/types.d.ts +53 -0
- package/dist/src/infra/background-task.d.ts +2 -0
- package/dist/src/infra/background-task.js +25 -0
- package/dist/src/infra/node-sqlite.js +9 -3
- package/dist/src/infra/process-diagnostics.d.ts +5 -0
- package/dist/src/infra/process-diagnostics.js +101 -0
- package/dist/src/infra/sqlite-errors.js +25 -20
- package/dist/src/infra/unhandled-rejections.js +20 -9
- package/dist/src/infra/warning-filter.js +9 -3
- package/dist/src/knowledge/ingestion-service.js +1 -0
- 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/media-shared/http/ssrf-guard.js +1 -1
- 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 +9 -6
- 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.d.ts +2 -0
- package/dist/src/proactive/execution/authorization.js +12 -2
- package/dist/src/proactive/execution/context.js +3 -1
- package/dist/src/proactive/execution/insight.js +2 -0
- package/dist/src/proactive/execution/repository.d.ts +2 -0
- package/dist/src/proactive/execution/repository.js +21 -3
- package/dist/src/proactive/execution/worker.js +15 -4
- package/dist/src/proactive/experience.d.ts +5 -2
- package/dist/src/proactive/experience.js +7 -3
- package/dist/src/proactive/follow-ups.d.ts +12 -7
- package/dist/src/proactive/follow-ups.js +23 -11
- package/dist/src/proactive/inbox/cards.js +7 -3
- package/dist/src/proactive/inbox/delivery.js +8 -8
- package/dist/src/proactive/inbox/digest.d.ts +1 -1
- package/dist/src/proactive/inbox/digest.js +25 -14
- package/dist/src/proactive/inbox/lifecycle.js +2 -1
- package/dist/src/proactive/inbox/notification-policy.d.ts +1 -1
- package/dist/src/proactive/inbox/notification-policy.js +9 -6
- package/dist/src/proactive/inbox/repository.js +5 -3
- package/dist/src/proactive/inbox/service.d.ts +6 -0
- package/dist/src/proactive/inbox/service.js +19 -0
- package/dist/src/proactive/inbox/types.d.ts +1 -0
- 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.d.ts +1 -1
- package/dist/src/proactive/policy/presence.js +9 -6
- package/dist/src/proactive/policy/service.d.ts +8 -5
- package/dist/src/proactive/policy/service.js +16 -13
- package/dist/src/proactive/routing/batch-repository.js +2 -1
- package/dist/src/proactive/scenarios/control.d.ts +3 -3
- package/dist/src/proactive/scenarios/control.js +16 -3
- package/dist/src/proactive/scenarios/repository.js +2 -1
- package/dist/src/proactive/service.js +2 -1
- package/dist/src/proactive/source-freshness.d.ts +8 -0
- package/dist/src/proactive/source-freshness.js +28 -0
- package/dist/src/proactive/status.d.ts +2 -0
- package/dist/src/proactive/status.js +22 -0
- package/dist/src/proactive/temporal/schedule.js +2 -1
- package/dist/src/proactive/temporal/worker.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 +32 -6
- package/dist/src/realtime/writer.js +16 -9
- 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.d.ts +2 -3
- package/dist/src/storage/sqlite/import-repository.js +5 -4
- package/dist/src/storage/sqlite/import-selection-repository.d.ts +15 -0
- package/dist/src/storage/sqlite/import-selection-repository.js +29 -0
- 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.d.ts +1 -0
- package/dist/src/storage/sqlite/knowledge-repository.js +4 -3
- package/dist/src/storage/sqlite/migrations/175_import_selections.sql +8 -0
- package/dist/src/storage/sqlite/migrations/176_proactive_quality.sql +5 -0
- package/dist/src/storage/sqlite/migrations/177_proactive_check_controls.sql +25 -0
- 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/candidate-discovery.js +1 -1
- 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 +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D9qP10BK.js +0 -1
- package/dist/gateway/static/root/assets/agents-D-bkOuAl.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BKwBBwJN.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-B2-f9qZu.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-Dtn4rMeq.js +0 -8
- package/dist/gateway/static/root/assets/button-BA45yciM.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DiwtR9MD.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-pTdR1q1K.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BSQ7Hs2w.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-BUGkGB4-.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CYkT7ecp.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-Baua1_Le.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CzpSYWex.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DTM_kYpE.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CSSJvdd6.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-XqVVYbAp.js +0 -1
- package/dist/gateway/static/root/assets/index-B_Sg5BKz.css +0 -2
- package/dist/gateway/static/root/assets/index-C9aQA4Dr.js +0 -74
- package/dist/gateway/static/root/assets/local-app-workbench-page-CZSgTYuI.js +0 -2
- package/dist/gateway/static/root/assets/locale-store-DO6JJ1l2.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-z5ktnEzX.js +0 -2
- package/dist/gateway/static/root/assets/messages-BgZRsCkG.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-DSaZfkna.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CePEyv_C.js +0 -8
- package/dist/gateway/static/root/assets/page-tabs-CdYemUOu.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-DGmMQt4t.js +0 -1
- package/dist/gateway/static/root/assets/proactive-page-Cy2Gm2f8.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-BliwYpns.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-Dm-BqnQn.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C_XuQ9XR.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-Drt1aS2G.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BAUd06_9.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-Bw6xKOX5.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-layout-DYelDcMV.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BHI9e5Tw.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DOAOjZBQ.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DU0VQpHj.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DiPgMmBM.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-Bmsy-5Fs.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-DxRaRdA0.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-CZikdgNw.js +0 -6
- 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,9 @@
|
|
|
1
1
|
import { deleteBrowserTabBinding } from "../../../storage/sqlite/browser-tab-binding-repository.js";
|
|
2
|
+
import { conversationIdSchema } from "../../../../packages/gateway-contract/src/conversation-identity.js";
|
|
2
3
|
import { SessionDiscoveryQuerySchema } from "../../../../packages/gateway-contract/src/session-identity.js";
|
|
3
|
-
import {
|
|
4
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
5
|
+
import { deleteSessionRecord, init_session_repository } from "../../../storage/sqlite/session-repository.js";
|
|
6
|
+
import { ConversationAlreadyExistsError, createConversation, init_conversation_repository } from "../../../storage/sqlite/conversation-repository.js";
|
|
4
7
|
import { resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
5
8
|
import "../../../projects/index.js";
|
|
6
9
|
import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
@@ -14,7 +17,9 @@ import { getSessionContextSummary } from "../../session-context-summary.js";
|
|
|
14
17
|
import { respondStartupUnavailable } from "../lib/startup-unavailable.js";
|
|
15
18
|
import { randomUUID } from "node:crypto";
|
|
16
19
|
//#region src/gateway/hono/routes/sessions.ts
|
|
17
|
-
|
|
20
|
+
init_src();
|
|
21
|
+
init_conversation_repository();
|
|
22
|
+
init_session_repository();
|
|
18
23
|
const log = createGatewayRouteLogger("Sessions");
|
|
19
24
|
const SESSION_TYPES = new Set([
|
|
20
25
|
"chat",
|
|
@@ -95,14 +100,14 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
95
100
|
const inboxOffset = parseOffset(c.req.query("inboxOffset"));
|
|
96
101
|
const staleDays = parsePositiveInt(c.req.query("staleDays"), DEFAULT_SIDEBAR_STALE_DAYS, 3650);
|
|
97
102
|
const updatedAfter = Date.now() - staleDays * 24 * 60 * 60 * 1e3;
|
|
98
|
-
const
|
|
103
|
+
const includeConversationId = c.req.query("includeConversationId")?.trim() || void 0;
|
|
99
104
|
const projects = service.projects.listWithSidebarSessions({
|
|
100
105
|
status: "active",
|
|
101
106
|
limit: projectLimit,
|
|
102
107
|
offset: projectOffset,
|
|
103
108
|
updatedAfter,
|
|
104
109
|
includePinned: true,
|
|
105
|
-
|
|
110
|
+
includeConversationId
|
|
106
111
|
});
|
|
107
112
|
const projectItems = await Promise.all(projects.items.map(async (project) => {
|
|
108
113
|
const sessions = await service.sessions.listSessions({
|
|
@@ -111,7 +116,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
111
116
|
offset: 0,
|
|
112
117
|
updatedAfter,
|
|
113
118
|
includePinned: true,
|
|
114
|
-
|
|
119
|
+
includeConversationId,
|
|
115
120
|
sortBy: "updatedAt",
|
|
116
121
|
sortOrder: "desc"
|
|
117
122
|
});
|
|
@@ -128,7 +133,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
128
133
|
offset: inboxOffset,
|
|
129
134
|
updatedAfter,
|
|
130
135
|
includePinned: true,
|
|
131
|
-
|
|
136
|
+
includeConversationId,
|
|
132
137
|
sortBy: "updatedAt",
|
|
133
138
|
sortOrder: "desc"
|
|
134
139
|
});
|
|
@@ -146,6 +151,10 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
146
151
|
});
|
|
147
152
|
authenticated.post("/api/sessions", async (c) => {
|
|
148
153
|
const body = await c.req.json().catch(() => ({}));
|
|
154
|
+
if (body.conversationId !== void 0 && !conversationIdSchema.safeParse(body.conversationId).success) return c.json({
|
|
155
|
+
ok: false,
|
|
156
|
+
error: "conversationId must be a UUID"
|
|
157
|
+
}, 400);
|
|
149
158
|
const channel = typeof body.channel === "string" && body.channel.trim() ? body.channel.trim() : "webchat";
|
|
150
159
|
const projectId = typeof body.projectId === "string" && body.projectId.trim() ? body.projectId.trim() : void 0;
|
|
151
160
|
const routingCfg = service.currentConfig;
|
|
@@ -163,29 +172,54 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
163
172
|
ok: false,
|
|
164
173
|
error: "An execution mode requires a project"
|
|
165
174
|
}, 400);
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
175
|
+
let agentId;
|
|
176
|
+
try {
|
|
177
|
+
agentId = resolveProjectAgentId({
|
|
178
|
+
config: routingCfg,
|
|
179
|
+
projects: service.projects,
|
|
180
|
+
explicitAgentId: typeof body.agentId === "string" ? body.agentId : void 0,
|
|
181
|
+
projectId
|
|
182
|
+
});
|
|
183
|
+
} catch (error) {
|
|
184
|
+
return c.json({
|
|
185
|
+
ok: false,
|
|
186
|
+
error: error instanceof Error ? error.message : String(error)
|
|
187
|
+
}, 400);
|
|
188
|
+
}
|
|
172
189
|
const chatId = (typeof body.chat_id === "string" && body.chat_id.trim() ? body.chat_id.trim() : void 0) ?? `chat_${randomUUID()}`;
|
|
173
|
-
const
|
|
190
|
+
const metadata = {
|
|
174
191
|
agentId,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
192
|
+
...buildDirectSessionMetadata({
|
|
193
|
+
agentId,
|
|
194
|
+
source: channel,
|
|
195
|
+
accountId: "default",
|
|
196
|
+
peerId: chatId
|
|
197
|
+
}),
|
|
198
|
+
...channel === "tui" ? {
|
|
199
|
+
hiddenFromSessionList: true,
|
|
200
|
+
customData: { genericNewChatShell: true }
|
|
201
|
+
} : {}
|
|
202
|
+
};
|
|
203
|
+
let conversationId;
|
|
204
|
+
try {
|
|
205
|
+
conversationId = createConversation(metadata, "", body.conversationId).key;
|
|
206
|
+
} catch (error) {
|
|
207
|
+
if (error instanceof ConversationAlreadyExistsError) return c.json({
|
|
208
|
+
ok: false,
|
|
209
|
+
error: error.message
|
|
210
|
+
}, 409);
|
|
211
|
+
throw error;
|
|
212
|
+
}
|
|
180
213
|
let environment;
|
|
181
214
|
if (project && (project.workspaceRoot?.trim() || requestedExecutionMode)) try {
|
|
182
215
|
environment = await environments.attach({
|
|
183
|
-
|
|
216
|
+
conversationId,
|
|
184
217
|
project,
|
|
185
218
|
mode: requestedExecutionMode,
|
|
186
219
|
baseRef: typeof body.baseRef === "string" ? body.baseRef : void 0
|
|
187
220
|
});
|
|
188
221
|
} catch (error) {
|
|
222
|
+
deleteSessionRecord(conversationId);
|
|
189
223
|
return c.json({
|
|
190
224
|
ok: false,
|
|
191
225
|
code: "execution_environment_unavailable",
|
|
@@ -193,16 +227,11 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
193
227
|
}, 409);
|
|
194
228
|
}
|
|
195
229
|
try {
|
|
196
|
-
await service.sessionIndexInstance.saveMessages(
|
|
197
|
-
|
|
198
|
-
source: channel,
|
|
199
|
-
accountId: "default",
|
|
200
|
-
peerId: chatId
|
|
201
|
-
}) });
|
|
202
|
-
if (projectId) service.projects.attachSession(sessionKey, projectId);
|
|
230
|
+
await service.sessionIndexInstance.saveMessages(conversationId, [], { metadata });
|
|
231
|
+
if (projectId) service.projects.attachSession(conversationId, projectId);
|
|
203
232
|
} catch (error) {
|
|
204
|
-
await service.sessions.delete(
|
|
205
|
-
await environments.release(
|
|
233
|
+
await service.sessions.delete(conversationId).catch(() => void 0);
|
|
234
|
+
await environments.release(conversationId).catch(() => void 0);
|
|
206
235
|
throw error;
|
|
207
236
|
}
|
|
208
237
|
const rawInitialConfig = body.initialAgentConfig && typeof body.initialAgentConfig === "object" ? body.initialAgentConfig : {};
|
|
@@ -214,13 +243,13 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
214
243
|
...body.temporary === true ? { userContextMode: "temporary" } : {}
|
|
215
244
|
};
|
|
216
245
|
if (channel === "webchat" && model) {
|
|
217
|
-
const result = await service.sessions.initializeChatModel(
|
|
246
|
+
const result = await service.sessions.initializeChatModel(conversationId, model, thinkingLevel);
|
|
218
247
|
if (!result.ok) {
|
|
219
|
-
await service.sessions.delete(
|
|
220
|
-
await environments.release(
|
|
248
|
+
await service.sessions.delete(conversationId).catch(() => void 0);
|
|
249
|
+
await environments.release(conversationId).catch((error) => {
|
|
221
250
|
log.warn({
|
|
222
251
|
err: error,
|
|
223
|
-
|
|
252
|
+
conversationId
|
|
224
253
|
}, "Invalid new session model and execution environment cleanup failed");
|
|
225
254
|
});
|
|
226
255
|
return c.json({
|
|
@@ -232,13 +261,13 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
232
261
|
delete initialAgentConfig.thinkingLevel;
|
|
233
262
|
}
|
|
234
263
|
if (Object.keys(initialAgentConfig).length > 0) {
|
|
235
|
-
const result = await service.sessions.patchAgentConfig(
|
|
264
|
+
const result = await service.sessions.patchAgentConfig(conversationId, initialAgentConfig);
|
|
236
265
|
if (!result.ok) {
|
|
237
|
-
await service.sessions.delete(
|
|
238
|
-
await environments.release(
|
|
266
|
+
await service.sessions.delete(conversationId).catch(() => void 0);
|
|
267
|
+
await environments.release(conversationId).catch((error) => {
|
|
239
268
|
log.warn({
|
|
240
269
|
err: error,
|
|
241
|
-
|
|
270
|
+
conversationId
|
|
242
271
|
}, "Invalid new session config and execution environment cleanup failed");
|
|
243
272
|
});
|
|
244
273
|
return c.json({
|
|
@@ -247,10 +276,11 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
247
276
|
}, 400);
|
|
248
277
|
}
|
|
249
278
|
}
|
|
250
|
-
if (body.createdSurface === "browser_extension") await service.sessions.patch(
|
|
251
|
-
const session = await service.sessions.getSession(
|
|
252
|
-
const agentConfig = channel === "webchat" ? await service.sessions.getFixedAgentConfig(
|
|
279
|
+
if (body.createdSurface === "browser_extension") await service.sessions.patch(conversationId, { customData: { createdSurface: "browser_extension" } });
|
|
280
|
+
const session = await service.sessions.getSession(conversationId);
|
|
281
|
+
const agentConfig = channel === "webchat" ? await service.sessions.getFixedAgentConfig(conversationId) : void 0;
|
|
253
282
|
return c.json({
|
|
283
|
+
conversationId,
|
|
254
284
|
session,
|
|
255
285
|
agentConfig,
|
|
256
286
|
...environment ? { environment } : {}
|
|
@@ -281,7 +311,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
281
311
|
unassigned: query.unassigned === "true",
|
|
282
312
|
updatedAfter: query.updatedAfter ? parseInt(query.updatedAfter) : void 0,
|
|
283
313
|
includePinned: query.includePinned === "true",
|
|
284
|
-
|
|
314
|
+
includeConversationId: query.includeConversationId,
|
|
285
315
|
limit: query.limit ? parseInt(query.limit) : void 0,
|
|
286
316
|
offset: query.offset ? parseInt(query.offset) : void 0
|
|
287
317
|
});
|
|
@@ -301,8 +331,8 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
301
331
|
});
|
|
302
332
|
authenticated.get("/api/sessions/resolve", async (c) => {
|
|
303
333
|
const result = await service.sessions.resolveSession({
|
|
304
|
-
|
|
305
|
-
|
|
334
|
+
transcriptId: c.req.query("transcriptId"),
|
|
335
|
+
conversationId: c.req.query("conversationId")
|
|
306
336
|
});
|
|
307
337
|
if (!result) return c.json({
|
|
308
338
|
ok: false,
|
|
@@ -316,9 +346,8 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
316
346
|
authenticated.post("/api/sessions/resolve", async (c) => {
|
|
317
347
|
const body = await c.req.json().catch(() => ({}));
|
|
318
348
|
const result = await service.sessions.resolveSession({
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
key: typeof body.key === "string" ? body.key : void 0
|
|
349
|
+
transcriptId: typeof body.transcriptId === "string" ? body.transcriptId : void 0,
|
|
350
|
+
conversationId: typeof body.conversationId === "string" ? body.conversationId : void 0
|
|
322
351
|
});
|
|
323
352
|
if (!result) return c.json({
|
|
324
353
|
ok: false,
|
|
@@ -572,7 +601,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
572
601
|
} catch (err) {
|
|
573
602
|
logRouteError(log, c, err, "gateway.route.sessions", {
|
|
574
603
|
operation: "restoreCompactionBoundary",
|
|
575
|
-
|
|
604
|
+
conversationId: key
|
|
576
605
|
});
|
|
577
606
|
const msg = err instanceof Error ? err.message : String(err);
|
|
578
607
|
if (msg.includes("not found")) return c.json({
|
|
@@ -833,8 +862,8 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
833
862
|
return c.json({
|
|
834
863
|
ok: true,
|
|
835
864
|
reset: true,
|
|
836
|
-
|
|
837
|
-
|
|
865
|
+
transcriptId: result.transcriptId,
|
|
866
|
+
previousTranscriptId: result.previousTranscriptId,
|
|
838
867
|
session
|
|
839
868
|
});
|
|
840
869
|
});
|
|
@@ -851,7 +880,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
851
880
|
await environments.release(key).catch((error) => {
|
|
852
881
|
log.warn({
|
|
853
882
|
err: error,
|
|
854
|
-
|
|
883
|
+
conversationId: key
|
|
855
884
|
}, "Session deleted but execution environment cleanup failed");
|
|
856
885
|
});
|
|
857
886
|
}
|
|
@@ -893,7 +922,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
893
922
|
});
|
|
894
923
|
authenticated.get("/api/subagents/:key", async (c) => {
|
|
895
924
|
const key = c.req.param("key");
|
|
896
|
-
if (
|
|
925
|
+
if ((await service.sessions.getSession(key))?.sessionType !== "workflow-subagent") return c.json({ error: "Not a subagent session" }, 400);
|
|
897
926
|
const includeRaw = c.req.query("include") ?? "";
|
|
898
927
|
const includeSet = new Set(includeRaw.split(",").map((s) => s.trim()).filter(Boolean));
|
|
899
928
|
const session = await service.sessions.getSession(key, {
|
|
@@ -217,7 +217,7 @@ function registerSharePublicRoutes(app, service) {
|
|
|
217
217
|
}, 410);
|
|
218
218
|
logShareAudit("share.access", {
|
|
219
219
|
shareId: record.id,
|
|
220
|
-
|
|
220
|
+
sourceTranscriptId: record.sourceTranscriptId,
|
|
221
221
|
tokenPrefix: token.slice(0, 8),
|
|
222
222
|
clientIp,
|
|
223
223
|
snapshotRevision: record.snapshotRevision
|
|
@@ -272,7 +272,7 @@ function registerSharePublicRoutes(app, service) {
|
|
|
272
272
|
} catch {
|
|
273
273
|
logShareAudit("share.access_denied", {
|
|
274
274
|
shareId: record.id,
|
|
275
|
-
...record.kind === "note" ? { noteId: record.sourceNoteId } : {
|
|
275
|
+
...record.kind === "note" ? { noteId: record.sourceNoteId } : { sourceTranscriptId: record.sourceTranscriptId },
|
|
276
276
|
tokenPrefix: token.slice(0, 8),
|
|
277
277
|
clientIp,
|
|
278
278
|
reason: "artifact_missing"
|
|
@@ -557,13 +557,13 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
557
557
|
});
|
|
558
558
|
authenticated.get("/api/sessions/:key/shares", async (c) => {
|
|
559
559
|
const metadata = await service.sessionIndexInstance.getSessionMetadata(c.req.param("key"));
|
|
560
|
-
if (!metadata?.
|
|
560
|
+
if (!metadata?.transcriptId) return c.json({
|
|
561
561
|
ok: false,
|
|
562
562
|
error: { message: "Session not found" }
|
|
563
563
|
}, 404);
|
|
564
564
|
const urlCtx = getShareUrlContext(service);
|
|
565
565
|
const now = Date.now();
|
|
566
|
-
const items = sessionShares.list(metadata.
|
|
566
|
+
const items = sessionShares.list(metadata.transcriptId).map((record) => {
|
|
567
567
|
const resolved = resolveShareUrl(record.token, urlCtx);
|
|
568
568
|
return {
|
|
569
569
|
id: record.id,
|
|
@@ -596,13 +596,13 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
596
596
|
authenticated.post("/api/sessions/:key/shares", async (c) => {
|
|
597
597
|
const principalId = getGatewayPrincipal(c).principalId;
|
|
598
598
|
const body = await c.req.json().catch(() => ({}));
|
|
599
|
-
if (typeof body.
|
|
599
|
+
if (typeof body.expectedTranscriptId !== "string" || typeof body.expectedCutoffSeq !== "number" || typeof body.expectedMetadataUpdatedAt !== "string") return c.json({
|
|
600
600
|
ok: false,
|
|
601
601
|
error: { message: "Share preview fingerprint is required" }
|
|
602
602
|
}, 400);
|
|
603
603
|
try {
|
|
604
604
|
const record = await sessionShares.create(c.req.param("key"), {
|
|
605
|
-
|
|
605
|
+
expectedTranscriptId: body.expectedTranscriptId,
|
|
606
606
|
expectedCutoffSeq: body.expectedCutoffSeq,
|
|
607
607
|
expectedMetadataUpdatedAt: body.expectedMetadataUpdatedAt,
|
|
608
608
|
ttlMs: typeof body.ttlMs === "number" ? body.ttlMs : void 0,
|
|
@@ -646,13 +646,13 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
646
646
|
});
|
|
647
647
|
authenticated.post("/api/sessions/:key/shares/:shareId/refresh", async (c) => {
|
|
648
648
|
const body = await c.req.json().catch(() => ({}));
|
|
649
|
-
if (typeof body.
|
|
649
|
+
if (typeof body.expectedTranscriptId !== "string" || typeof body.expectedCutoffSeq !== "number" || typeof body.expectedMetadataUpdatedAt !== "string") return c.json({
|
|
650
650
|
ok: false,
|
|
651
651
|
error: { message: "Share preview fingerprint is required" }
|
|
652
652
|
}, 400);
|
|
653
653
|
try {
|
|
654
654
|
const record = await sessionShares.refresh(c.req.param("key"), c.req.param("shareId"), {
|
|
655
|
-
|
|
655
|
+
expectedTranscriptId: body.expectedTranscriptId,
|
|
656
656
|
expectedCutoffSeq: body.expectedCutoffSeq,
|
|
657
657
|
expectedMetadataUpdatedAt: body.expectedMetadataUpdatedAt,
|
|
658
658
|
includeToolActivities: typeof body.includeToolActivities === "boolean" ? body.includeToolActivities : void 0,
|
|
@@ -692,7 +692,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
692
692
|
});
|
|
693
693
|
authenticated.get("/api/sessions/:key/hosted-shares", async (c) => {
|
|
694
694
|
const metadata = await service.sessionIndexInstance.getSessionMetadata(c.req.param("key"));
|
|
695
|
-
if (!metadata?.
|
|
695
|
+
if (!metadata?.transcriptId) return c.json({
|
|
696
696
|
ok: false,
|
|
697
697
|
error: { message: "Session not found" }
|
|
698
698
|
}, 404);
|
|
@@ -700,7 +700,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
700
700
|
await hostedBindings.reconcile(await hostedPublisher.listPublications());
|
|
701
701
|
return c.json({
|
|
702
702
|
ok: true,
|
|
703
|
-
payload: { shares: (await hostedBindings.list(metadata.
|
|
703
|
+
payload: { shares: (await hostedBindings.list(metadata.transcriptId)).map(hostedBindingResponse) }
|
|
704
704
|
});
|
|
705
705
|
} catch (err) {
|
|
706
706
|
return hostedShareErrorResponse(c, err);
|
|
@@ -708,7 +708,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
708
708
|
});
|
|
709
709
|
authenticated.post("/api/sessions/:key/hosted-shares", async (c) => {
|
|
710
710
|
const body = await c.req.json().catch(() => ({}));
|
|
711
|
-
if (typeof body.
|
|
711
|
+
if (typeof body.expectedTranscriptId !== "string" || typeof body.expectedCutoffSeq !== "number" || typeof body.expectedMetadataUpdatedAt !== "string") return c.json({
|
|
712
712
|
ok: false,
|
|
713
713
|
error: { message: "Share preview fingerprint is required" }
|
|
714
714
|
}, 400);
|
|
@@ -724,15 +724,15 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
724
724
|
kind: "session_document",
|
|
725
725
|
source: {
|
|
726
726
|
kind: "session",
|
|
727
|
-
id: snapshot.
|
|
727
|
+
id: snapshot.transcriptId,
|
|
728
728
|
version: String(snapshot.cutoffSeq)
|
|
729
729
|
},
|
|
730
730
|
revisionSources: { [String(result.snapshotRevision)]: {
|
|
731
731
|
kind: "session",
|
|
732
|
-
id: snapshot.
|
|
732
|
+
id: snapshot.transcriptId,
|
|
733
733
|
version: String(snapshot.cutoffSeq)
|
|
734
734
|
} },
|
|
735
|
-
|
|
735
|
+
transcriptId: snapshot.transcriptId,
|
|
736
736
|
cutoffSeq: snapshot.cutoffSeq,
|
|
737
737
|
title: snapshot.manifest.title,
|
|
738
738
|
description: snapshot.manifest.description ?? null,
|
|
@@ -755,11 +755,11 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
755
755
|
});
|
|
756
756
|
authenticated.post("/api/sessions/:key/hosted-shares/:shareId/refresh", async (c) => {
|
|
757
757
|
const body = await c.req.json().catch(() => ({}));
|
|
758
|
-
if (typeof body.
|
|
758
|
+
if (typeof body.expectedTranscriptId !== "string" || typeof body.expectedCutoffSeq !== "number" || typeof body.expectedMetadataUpdatedAt !== "string") return c.json({
|
|
759
759
|
ok: false,
|
|
760
760
|
error: { message: "Share preview fingerprint is required" }
|
|
761
761
|
}, 400);
|
|
762
|
-
const previous = (await hostedBindings.list(body.
|
|
762
|
+
const previous = (await hostedBindings.list(body.expectedTranscriptId)).find((binding) => binding.id === c.req.param("shareId") && !binding.revoked);
|
|
763
763
|
if (!previous) return c.json({
|
|
764
764
|
ok: false,
|
|
765
765
|
error: { message: "Hosted share not found" }
|
|
@@ -778,14 +778,14 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
778
778
|
kind: "session_document",
|
|
779
779
|
source: {
|
|
780
780
|
kind: "session",
|
|
781
|
-
id: snapshot.
|
|
781
|
+
id: snapshot.transcriptId,
|
|
782
782
|
version: String(snapshot.cutoffSeq)
|
|
783
783
|
},
|
|
784
784
|
revisionSources: {
|
|
785
785
|
...previous.revisionSources,
|
|
786
786
|
[String(result.snapshotRevision)]: {
|
|
787
787
|
kind: "session",
|
|
788
|
-
id: snapshot.
|
|
788
|
+
id: snapshot.transcriptId,
|
|
789
789
|
version: String(snapshot.cutoffSeq)
|
|
790
790
|
}
|
|
791
791
|
},
|
|
@@ -808,11 +808,11 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
808
808
|
});
|
|
809
809
|
authenticated.delete("/api/sessions/:key/hosted-shares/:shareId", async (c) => {
|
|
810
810
|
const metadata = await service.sessionIndexInstance.getSessionMetadata(c.req.param("key"));
|
|
811
|
-
if (!metadata?.
|
|
811
|
+
if (!metadata?.transcriptId) return c.json({
|
|
812
812
|
ok: false,
|
|
813
813
|
error: { message: "Session not found" }
|
|
814
814
|
}, 404);
|
|
815
|
-
const binding = (await hostedBindings.list(metadata.
|
|
815
|
+
const binding = (await hostedBindings.list(metadata.transcriptId)).find((item) => item.id === c.req.param("shareId"));
|
|
816
816
|
if (!binding) return c.json({
|
|
817
817
|
ok: false,
|
|
818
818
|
error: { message: "Hosted share not found" }
|
|
@@ -947,7 +947,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
947
947
|
error: { message: "Static site path is required" }
|
|
948
948
|
}, 400);
|
|
949
949
|
try {
|
|
950
|
-
const workspaceRoot = await resolveWorkspaceRootForShare(service, typeof body.
|
|
950
|
+
const workspaceRoot = await resolveWorkspaceRootForShare(service, typeof body.conversationId === "string" ? body.conversationId : void 0, typeof body.agentId === "string" ? body.agentId : void 0);
|
|
951
951
|
if (!workspaceRoot) return c.json({
|
|
952
952
|
ok: false,
|
|
953
953
|
error: { message: "Workspace not configured" }
|
|
@@ -960,7 +960,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
960
960
|
spaFallback: typeof body.spaFallback === "boolean" ? body.spaFallback : void 0,
|
|
961
961
|
ttlMs: typeof body.ttlMs === "number" ? body.ttlMs : 864e5,
|
|
962
962
|
maxViews: body.maxViews === null ? null : typeof body.maxViews === "number" ? body.maxViews : null,
|
|
963
|
-
|
|
963
|
+
conversationId: typeof body.conversationId === "string" ? body.conversationId : void 0,
|
|
964
964
|
agentId: typeof body.agentId === "string" ? body.agentId : void 0
|
|
965
965
|
}, {
|
|
966
966
|
builder: hostedSiteBuilder,
|
|
@@ -986,7 +986,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
986
986
|
error: { message: "Hosted publication not found" }
|
|
987
987
|
}, 404);
|
|
988
988
|
try {
|
|
989
|
-
const workspaceRoot = previous.workspaceContext?.workspaceRoot ?? await resolveWorkspaceRootForShare(service, previous.workspaceContext?.
|
|
989
|
+
const workspaceRoot = previous.workspaceContext?.workspaceRoot ?? await resolveWorkspaceRootForShare(service, previous.workspaceContext?.conversationId, previous.workspaceContext?.agentId);
|
|
990
990
|
if (!workspaceRoot) return c.json({
|
|
991
991
|
ok: false,
|
|
992
992
|
error: { message: "Workspace not configured" }
|
|
@@ -1147,7 +1147,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
1147
1147
|
ok: false,
|
|
1148
1148
|
error: { message: "Provide exactly one of path, fileId or uri" }
|
|
1149
1149
|
}, 400);
|
|
1150
|
-
const
|
|
1150
|
+
const conversationId = typeof body.conversationId === "string" ? body.conversationId.trim() : void 0;
|
|
1151
1151
|
const agentId = typeof body.agentId === "string" ? body.agentId.trim() : void 0;
|
|
1152
1152
|
const taskId = typeof body.taskId === "string" ? body.taskId.trim() : void 0;
|
|
1153
1153
|
const fileName = typeof body.fileName === "string" ? basename(body.fileName.trim().replace(/\\/g, "/")) : void 0;
|
|
@@ -1159,12 +1159,12 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
1159
1159
|
path = target.resource.relativePath || ".";
|
|
1160
1160
|
} else if (uri) {
|
|
1161
1161
|
const media = await resolveScopedMediaReference(service, uri, {
|
|
1162
|
-
|
|
1162
|
+
conversationId,
|
|
1163
1163
|
taskId
|
|
1164
1164
|
});
|
|
1165
1165
|
workspaceRoot = dirname(media.path);
|
|
1166
1166
|
path = basename(media.path);
|
|
1167
|
-
} else workspaceRoot = await resolveWorkspaceRootForShare(service,
|
|
1167
|
+
} else workspaceRoot = await resolveWorkspaceRootForShare(service, conversationId, agentId);
|
|
1168
1168
|
if (!workspaceRoot) throw new Error("Workspace not configured");
|
|
1169
1169
|
} catch (err) {
|
|
1170
1170
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -1190,7 +1190,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
1190
1190
|
ttlMs,
|
|
1191
1191
|
maxViews,
|
|
1192
1192
|
description,
|
|
1193
|
-
|
|
1193
|
+
conversationId,
|
|
1194
1194
|
agentId,
|
|
1195
1195
|
workspaceRoot,
|
|
1196
1196
|
gatewayTokenHash: hashPrincipal(principalId),
|
|
@@ -1250,7 +1250,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
1250
1250
|
ok: false,
|
|
1251
1251
|
error: { message: "Missing path or fileId" }
|
|
1252
1252
|
}, 400);
|
|
1253
|
-
const
|
|
1253
|
+
const conversationId = typeof body.conversationId === "string" ? body.conversationId.trim() : void 0;
|
|
1254
1254
|
const agentId = typeof body.agentId === "string" ? body.agentId.trim() : void 0;
|
|
1255
1255
|
const mode = typeof body.mode === "string" && [
|
|
1256
1256
|
"auto",
|
|
@@ -1271,7 +1271,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
1271
1271
|
const target = await getGatewayFileSpaceService(service).resource(fileId);
|
|
1272
1272
|
workspaceRoot = target.space.root;
|
|
1273
1273
|
path = target.resource.relativePath || ".";
|
|
1274
|
-
} else workspaceRoot = await resolveWorkspaceRootForShare(service,
|
|
1274
|
+
} else workspaceRoot = await resolveWorkspaceRootForShare(service, conversationId, agentId);
|
|
1275
1275
|
if (!workspaceRoot) return c.json({
|
|
1276
1276
|
ok: false,
|
|
1277
1277
|
error: { message: "Workspace not configured" }
|
|
@@ -1319,7 +1319,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
1319
1319
|
spaFallback: true,
|
|
1320
1320
|
ttlMs,
|
|
1321
1321
|
maxViews: maxViews ?? null,
|
|
1322
|
-
|
|
1322
|
+
conversationId,
|
|
1323
1323
|
agentId
|
|
1324
1324
|
}, {
|
|
1325
1325
|
builder: hostedSiteBuilder,
|
|
@@ -1372,7 +1372,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
1372
1372
|
subdomain: typeof body.subdomain === "string" ? body.subdomain : void 0,
|
|
1373
1373
|
spaFallback: true,
|
|
1374
1374
|
rewriteMode: "html-css",
|
|
1375
|
-
|
|
1375
|
+
conversationId,
|
|
1376
1376
|
agentId,
|
|
1377
1377
|
workspaceRoot,
|
|
1378
1378
|
gatewayTokenHash: tokenHash
|
|
@@ -1482,7 +1482,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
1482
1482
|
snapshotRevision: r.snapshotRevision,
|
|
1483
1483
|
attachmentCount: r.attachmentCount
|
|
1484
1484
|
} : r.kind === "session" ? {
|
|
1485
|
-
|
|
1485
|
+
sourceTranscriptId: r.sourceTranscriptId,
|
|
1486
1486
|
cutoffSeq: r.cutoffSeq,
|
|
1487
1487
|
snapshotRevision: r.snapshotRevision,
|
|
1488
1488
|
messageCount: r.messageCount,
|
|
@@ -1615,13 +1615,13 @@ function createSessionShareService(service, store) {
|
|
|
1615
1615
|
}
|
|
1616
1616
|
function createSessionShareSource(service) {
|
|
1617
1617
|
return {
|
|
1618
|
-
getMetadata: (
|
|
1619
|
-
getSnapshot: async (
|
|
1618
|
+
getMetadata: (conversationId) => service.sessionIndexInstance.getSessionMetadata(conversationId),
|
|
1619
|
+
getSnapshot: async (conversationId) => loadCompactionSourceSnapshot(conversationId)
|
|
1620
1620
|
};
|
|
1621
1621
|
}
|
|
1622
1622
|
function hostedBuildInput(body) {
|
|
1623
1623
|
return {
|
|
1624
|
-
|
|
1624
|
+
expectedTranscriptId: String(body.expectedTranscriptId),
|
|
1625
1625
|
expectedCutoffSeq: Number(body.expectedCutoffSeq),
|
|
1626
1626
|
expectedMetadataUpdatedAt: String(body.expectedMetadataUpdatedAt),
|
|
1627
1627
|
description: typeof body.description === "string" ? body.description.trim() || void 0 : void 0,
|
|
@@ -1887,10 +1887,10 @@ function relPathFromAbs(workspaceRoot, abs) {
|
|
|
1887
1887
|
if (abs.startsWith(`${root}\\`)) return abs.slice(root.length + 1).replace(/\\/g, "/");
|
|
1888
1888
|
return abs.split(/[\\/]/).pop() ?? abs;
|
|
1889
1889
|
}
|
|
1890
|
-
async function resolveWorkspaceRootForShare(service,
|
|
1890
|
+
async function resolveWorkspaceRootForShare(service, conversationId, agentId) {
|
|
1891
1891
|
const cfg = service.currentConfig;
|
|
1892
|
-
if (
|
|
1893
|
-
return await service.sessions.getEffectiveWorkspacePath(
|
|
1892
|
+
if (conversationId) try {
|
|
1893
|
+
return await service.sessions.getEffectiveWorkspacePath(conversationId);
|
|
1894
1894
|
} catch {}
|
|
1895
1895
|
const { getWorkspacePath } = await import("../../../config/workspace-path-helpers.js");
|
|
1896
1896
|
const { resolveAgentWorkspaceDir, normalizeAgentId, resolveDefaultAgentId } = await import("../../../agent/agent-scope.js");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { chooseModelThinking } from "../../../../packages/gateway-contract/src/model-selection.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
2
3
|
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
3
4
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
4
5
|
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
@@ -7,12 +8,13 @@ import { SideChatError, parseThinkingLevel } from "../../side-chat/manager.js";
|
|
|
7
8
|
import "../../side-chat/index.js";
|
|
8
9
|
import { createGatewayRouteLogger, logRouteError } from "../lib/route-logger.js";
|
|
9
10
|
//#region src/gateway/hono/routes/side-chats.ts
|
|
11
|
+
init_src();
|
|
10
12
|
init_providers();
|
|
11
13
|
const CLIENT_HEADER = "x-xopc-client-instance-id";
|
|
12
14
|
const log = createGatewayRouteLogger("SideChats");
|
|
13
15
|
function registerSideChatRoutes(authenticated, deps) {
|
|
14
16
|
const { service } = deps;
|
|
15
|
-
authenticated.post("/api/sessions/:
|
|
17
|
+
authenticated.post("/api/sessions/:parentConversationId/side-chats", deps.chatRateLimitMiddleware, async (c) => {
|
|
16
18
|
try {
|
|
17
19
|
const body = await c.req.json().catch(() => ({}));
|
|
18
20
|
const clientInstanceId = readClientInstanceId(c, body.clientInstanceId);
|
|
@@ -25,7 +27,7 @@ function registerSideChatRoutes(authenticated, deps) {
|
|
|
25
27
|
throw new SideChatError(error instanceof Error ? error.message : "Invalid selections", "INVALID_REQUEST");
|
|
26
28
|
}
|
|
27
29
|
const sideChat = await service.sideChats.create({
|
|
28
|
-
|
|
30
|
+
parentConversationId: c.req.param("parentConversationId"),
|
|
29
31
|
clientInstanceId,
|
|
30
32
|
selections,
|
|
31
33
|
config: {
|
|
@@ -29,10 +29,10 @@ function buildShareUrls(record, publicHostSuffix, service) {
|
|
|
29
29
|
function registerSiteShareRoutes(authenticated, deps) {
|
|
30
30
|
const { service } = deps;
|
|
31
31
|
const store = getSiteShareStore(resolveSiteShareConfig(service));
|
|
32
|
-
async function resolveWorkspaceRoot(
|
|
32
|
+
async function resolveWorkspaceRoot(conversationId, agentId) {
|
|
33
33
|
const cfg = service.currentConfig;
|
|
34
|
-
if (
|
|
35
|
-
return await service.sessions.getEffectiveWorkspacePath(
|
|
34
|
+
if (conversationId) try {
|
|
35
|
+
return await service.sessions.getEffectiveWorkspacePath(conversationId);
|
|
36
36
|
} catch {}
|
|
37
37
|
const { getWorkspacePath } = await import("../../../config/workspace-path-helpers.js");
|
|
38
38
|
const { resolveAgentWorkspaceDir, normalizeAgentId, resolveDefaultAgentId } = await import("../../../agent/agent-scope.js");
|
|
@@ -57,7 +57,7 @@ function registerSiteShareRoutes(authenticated, deps) {
|
|
|
57
57
|
ok: false,
|
|
58
58
|
error: { message: "kind must be 'static' or 'proxy'" }
|
|
59
59
|
}, 400);
|
|
60
|
-
const
|
|
60
|
+
const conversationId = typeof body.conversationId === "string" ? body.conversationId.trim() : void 0;
|
|
61
61
|
const agentId = typeof body.agentId === "string" ? body.agentId.trim() : void 0;
|
|
62
62
|
const path = typeof body.path === "string" ? body.path.trim() : void 0;
|
|
63
63
|
const upstreamUrl = typeof body.upstreamUrl === "string" ? body.upstreamUrl.trim() : void 0;
|
|
@@ -70,7 +70,7 @@ function registerSiteShareRoutes(authenticated, deps) {
|
|
|
70
70
|
const forwardWebSocket = typeof body.forwardWebSocket === "boolean" ? body.forwardWebSocket : void 0;
|
|
71
71
|
let workspaceRoot = null;
|
|
72
72
|
if (kind === "static") {
|
|
73
|
-
workspaceRoot = await resolveWorkspaceRoot(
|
|
73
|
+
workspaceRoot = await resolveWorkspaceRoot(conversationId, agentId);
|
|
74
74
|
if (!workspaceRoot) return c.json({
|
|
75
75
|
ok: false,
|
|
76
76
|
error: { message: "Workspace not configured" }
|
|
@@ -89,7 +89,7 @@ function registerSiteShareRoutes(authenticated, deps) {
|
|
|
89
89
|
spaFallback,
|
|
90
90
|
rewriteMode,
|
|
91
91
|
forwardWebSocket,
|
|
92
|
-
|
|
92
|
+
conversationId,
|
|
93
93
|
agentId,
|
|
94
94
|
workspaceRoot,
|
|
95
95
|
gatewayTokenHash: hashPrincipal(principalId)
|