@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
|
@@ -9,7 +9,7 @@ export interface TranscriptSourceEntry {
|
|
|
9
9
|
row: TranscriptStoredRow;
|
|
10
10
|
}
|
|
11
11
|
export interface CompactionSourceSnapshot {
|
|
12
|
-
|
|
12
|
+
transcriptId: string;
|
|
13
13
|
lastSeq: number;
|
|
14
14
|
entries: TranscriptSourceEntry[];
|
|
15
15
|
}
|
|
@@ -20,22 +20,22 @@ export interface SessionTranscriptRecallMatch {
|
|
|
20
20
|
createdAt: number;
|
|
21
21
|
content: string;
|
|
22
22
|
}
|
|
23
|
-
export declare function appendTranscriptEntry(
|
|
24
|
-
|
|
23
|
+
export declare function appendTranscriptEntry(conversationId: string, row: TranscriptStoredRow, opts?: {
|
|
24
|
+
transcriptId?: string;
|
|
25
25
|
tokenDelta?: number;
|
|
26
26
|
}): TranscriptEntryRow;
|
|
27
|
-
export declare function appendCompactionBoundaryIfUnchanged(
|
|
28
|
-
export declare function loadCompactionSourceSnapshot(
|
|
29
|
-
export declare function searchSessionTranscript(
|
|
27
|
+
export declare function appendCompactionBoundaryIfUnchanged(conversationId: string, expected: Pick<CompactionSourceSnapshot, 'transcriptId' | 'lastSeq'>, row: Omit<XopcTranscriptCompactionEntry, 'baseSeq'>): TranscriptEntryRow | null;
|
|
28
|
+
export declare function loadCompactionSourceSnapshot(conversationId: string): CompactionSourceSnapshot | null;
|
|
29
|
+
export declare function searchSessionTranscript(conversationId: string, query: string, options?: {
|
|
30
30
|
limit?: number;
|
|
31
31
|
beforeSeq?: number;
|
|
32
32
|
}): SessionTranscriptRecallMatch[];
|
|
33
|
-
export declare function loadTranscriptRowsForSession(
|
|
34
|
-
export declare function loadTranscriptHistoryRowsForSession(
|
|
35
|
-
export declare function loadTranscriptRows(
|
|
36
|
-
export declare function loadLlmMessagesForSession(
|
|
37
|
-
export declare function replaceTranscriptRows(
|
|
38
|
-
export declare function paginateTranscriptMessages(
|
|
33
|
+
export declare function loadTranscriptRowsForSession(conversationId: string): TranscriptStoredRow[];
|
|
34
|
+
export declare function loadTranscriptHistoryRowsForSession(conversationId: string): TranscriptStoredRow[];
|
|
35
|
+
export declare function loadTranscriptRows(transcriptId: string): TranscriptStoredRow[];
|
|
36
|
+
export declare function loadLlmMessagesForSession(conversationId: string): AgentMessage[];
|
|
37
|
+
export declare function replaceTranscriptRows(conversationId: string, rows: TranscriptStoredRow[]): void;
|
|
38
|
+
export declare function paginateTranscriptMessages(conversationId: string, options?: {
|
|
39
39
|
offset?: number;
|
|
40
40
|
limit?: number;
|
|
41
41
|
beforeIndex?: number;
|
|
@@ -49,5 +49,5 @@ export declare function paginateTranscriptMessages(sessionKey: string, options?:
|
|
|
49
49
|
startSeq: number;
|
|
50
50
|
endSeq: number;
|
|
51
51
|
};
|
|
52
|
-
export declare function listCompactionBoundaries(
|
|
53
|
-
export declare function restoreBeforeCompactionBoundary(
|
|
52
|
+
export declare function listCompactionBoundaries(conversationId: string): CompactionBoundarySummary[];
|
|
53
|
+
export declare function restoreBeforeCompactionBoundary(conversationId: string, compactionId: string): void;
|
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
-
import {
|
|
3
|
-
import { buildSessionContextForLlm, isRuntimeOnlyTranscriptMessage } from "../../session/session-context-for-llm.js";
|
|
4
|
-
import { classifyStoredRow, estimateTokensFromMessages, extractFtsContent, transcriptEntryRowToStoredRow } from "./row-mappers.js";
|
|
5
|
-
import { escapeFts5Query } from "./fts.js";
|
|
6
|
-
import {
|
|
1
|
+
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
+
import { readCurrentTranscriptId } from "./session-instance-repository.js";
|
|
3
|
+
import { buildSessionContextForLlm, init_session_context_for_llm, isRuntimeOnlyTranscriptMessage } from "../../session/session-context-for-llm.js";
|
|
4
|
+
import { classifyStoredRow, estimateTokensFromMessages, extractFtsContent, init_row_mappers, transcriptEntryRowToStoredRow } from "./row-mappers.js";
|
|
5
|
+
import { escapeFts5Query, init_fts } from "./fts.js";
|
|
6
|
+
import { getCurrentTranscriptId, init_session_repository } from "./session-repository.js";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
//#region src/storage/sqlite/transcript-repository.ts
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
init_session_context_for_llm();
|
|
10
|
+
init_row_mappers();
|
|
11
|
+
init_session_repository();
|
|
12
|
+
init_fts();
|
|
13
|
+
init_transaction();
|
|
14
|
+
function nextSeq(db, transcriptId) {
|
|
15
|
+
return (db.prepare(`SELECT COALESCE(MAX(seq), 0) AS max_seq FROM transcript_entries WHERE transcript_id = ?`).get(transcriptId).max_seq ?? 0) + 1;
|
|
11
16
|
}
|
|
12
17
|
function insertEntry(db, params) {
|
|
13
18
|
const { entryKind, role } = classifyStoredRow(params.row);
|
|
14
19
|
const entryId = params.entryId ?? randomUUID();
|
|
15
|
-
const seq = nextSeq(db, params.
|
|
20
|
+
const seq = nextSeq(db, params.transcriptId);
|
|
16
21
|
const createdAt = params.createdAt ?? Date.now();
|
|
17
22
|
const payloadJson = JSON.stringify(params.row);
|
|
18
|
-
db.prepare(`INSERT INTO transcript_entries (entry_id,
|
|
19
|
-
VALUES (?, ?, ?, ?, ?, ?, ?)`).run(entryId, params.
|
|
23
|
+
db.prepare(`INSERT INTO transcript_entries (entry_id, transcript_id, seq, entry_kind, role, payload_json, created_at)
|
|
24
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)`).run(entryId, params.transcriptId, seq, entryKind, role, payloadJson, createdAt);
|
|
20
25
|
const content = extractFtsContent(params.row);
|
|
21
|
-
if (content.trim()) db.prepare(`INSERT INTO transcript_fts (content,
|
|
22
|
-
VALUES (?, ?, ?, ?)`).run(content, params.
|
|
26
|
+
if (content.trim()) db.prepare(`INSERT INTO transcript_fts (content, conversation_id, transcript_id, entry_id)
|
|
27
|
+
VALUES (?, ?, ?, ?)`).run(content, params.conversationId, params.transcriptId, entryId);
|
|
23
28
|
return {
|
|
24
29
|
entry_id: entryId,
|
|
25
|
-
|
|
30
|
+
transcript_id: params.transcriptId,
|
|
26
31
|
seq,
|
|
27
32
|
entry_kind: entryKind,
|
|
28
33
|
role,
|
|
@@ -34,7 +39,7 @@ function isUserMessageRow(row) {
|
|
|
34
39
|
const classified = classifyStoredRow(row);
|
|
35
40
|
return classified.entryKind === "message" && classified.role === "user";
|
|
36
41
|
}
|
|
37
|
-
function withSessionInputContextMetadata(db,
|
|
42
|
+
function withSessionInputContextMetadata(db, conversationId, row) {
|
|
38
43
|
if (!isUserMessageRow(row)) return row;
|
|
39
44
|
const message = row;
|
|
40
45
|
const turnId = typeof message.turnId === "string" ? message.turnId.trim() : "";
|
|
@@ -42,8 +47,8 @@ function withSessionInputContextMetadata(db, sessionKey, row) {
|
|
|
42
47
|
const metadata = message.metadata && typeof message.metadata === "object" && !Array.isArray(message.metadata) ? message.metadata : {};
|
|
43
48
|
if (Array.isArray(metadata.sourceContexts) && metadata.sourceContexts.length > 0) return row;
|
|
44
49
|
const input = db.prepare(`SELECT context_refs_json FROM session_inputs
|
|
45
|
-
WHERE
|
|
46
|
-
LIMIT 1`).get(
|
|
50
|
+
WHERE conversation_id = ? AND run_id = ? AND context_refs_json IS NOT NULL
|
|
51
|
+
LIMIT 1`).get(conversationId, turnId);
|
|
47
52
|
if (!input) return row;
|
|
48
53
|
try {
|
|
49
54
|
const sourceContexts = JSON.parse(input.context_refs_json);
|
|
@@ -59,15 +64,15 @@ function withSessionInputContextMetadata(db, sessionKey, row) {
|
|
|
59
64
|
return row;
|
|
60
65
|
}
|
|
61
66
|
}
|
|
62
|
-
function appendTranscriptEntry(
|
|
67
|
+
function appendTranscriptEntry(conversationId, row, opts) {
|
|
63
68
|
if (isRuntimeOnlyTranscriptMessage(row)) throw new Error("Runtime-only messages cannot be persisted in a session transcript");
|
|
64
69
|
return runSqliteWriteTransaction((db) => {
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
67
|
-
const persistedRow = withSessionInputContextMetadata(db,
|
|
70
|
+
const transcriptId = opts?.transcriptId ?? readCurrentTranscriptId(db, conversationId);
|
|
71
|
+
if (!transcriptId) throw new Error(`Session not found: ${conversationId}`);
|
|
72
|
+
const persistedRow = withSessionInputContextMetadata(db, conversationId, row);
|
|
68
73
|
const inserted = insertEntry(db, {
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
transcriptId,
|
|
75
|
+
conversationId,
|
|
71
76
|
row: persistedRow
|
|
72
77
|
});
|
|
73
78
|
if (classifyStoredRow(persistedRow).entryKind === "message") {
|
|
@@ -81,24 +86,24 @@ function appendTranscriptEntry(sessionKey, row, opts) {
|
|
|
81
86
|
updated_at = ?,
|
|
82
87
|
last_accessed_at = ?,
|
|
83
88
|
last_interaction_at = ?
|
|
84
|
-
WHERE
|
|
89
|
+
WHERE conversation_id = ?`).run(tokenDelta, now, now, now, conversationId);
|
|
85
90
|
}
|
|
86
91
|
return inserted;
|
|
87
92
|
});
|
|
88
93
|
}
|
|
89
|
-
function appendCompactionBoundaryIfUnchanged(
|
|
94
|
+
function appendCompactionBoundaryIfUnchanged(conversationId, expected, row) {
|
|
90
95
|
return runSqliteWriteTransaction((db) => {
|
|
91
|
-
const
|
|
92
|
-
if (!
|
|
93
|
-
if (
|
|
94
|
-
if (nextSeq(db,
|
|
96
|
+
const transcriptId = readCurrentTranscriptId(db, conversationId);
|
|
97
|
+
if (!transcriptId) throw new Error(`Session not found: ${conversationId}`);
|
|
98
|
+
if (transcriptId !== expected.transcriptId) return null;
|
|
99
|
+
if (nextSeq(db, transcriptId) - 1 !== expected.lastSeq) return null;
|
|
95
100
|
const boundary = {
|
|
96
101
|
...row,
|
|
97
102
|
baseSeq: expected.lastSeq
|
|
98
103
|
};
|
|
99
104
|
const inserted = insertEntry(db, {
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
transcriptId,
|
|
106
|
+
conversationId,
|
|
102
107
|
row: boundary
|
|
103
108
|
});
|
|
104
109
|
const now = Date.now();
|
|
@@ -109,20 +114,20 @@ function appendCompactionBoundaryIfUnchanged(sessionKey, expected, row) {
|
|
|
109
114
|
updated_at = ?,
|
|
110
115
|
last_accessed_at = ?,
|
|
111
116
|
last_interaction_at = ?
|
|
112
|
-
WHERE
|
|
117
|
+
WHERE conversation_id = ?`).run(boundary.messages.length, boundary.tokensAfter, now, now, now, conversationId);
|
|
113
118
|
return inserted;
|
|
114
119
|
});
|
|
115
120
|
}
|
|
116
|
-
function loadCompactionSourceSnapshot(
|
|
121
|
+
function loadCompactionSourceSnapshot(conversationId) {
|
|
117
122
|
const db = getSqliteDatabase();
|
|
118
|
-
const
|
|
119
|
-
if (!
|
|
120
|
-
const rows = db.prepare(`SELECT entry_id,
|
|
123
|
+
const transcriptId = getCurrentTranscriptId(conversationId);
|
|
124
|
+
if (!transcriptId) return null;
|
|
125
|
+
const rows = db.prepare(`SELECT entry_id, transcript_id, seq, entry_kind, role, payload_json, created_at
|
|
121
126
|
FROM transcript_entries
|
|
122
|
-
WHERE
|
|
123
|
-
ORDER BY seq ASC`).all(
|
|
127
|
+
WHERE transcript_id = ?
|
|
128
|
+
ORDER BY seq ASC`).all(transcriptId);
|
|
124
129
|
return {
|
|
125
|
-
|
|
130
|
+
transcriptId,
|
|
126
131
|
lastSeq: rows.at(-1)?.seq ?? 0,
|
|
127
132
|
entries: rows.map((entry) => ({
|
|
128
133
|
entryId: entry.entry_id,
|
|
@@ -132,32 +137,32 @@ function loadCompactionSourceSnapshot(sessionKey) {
|
|
|
132
137
|
}))
|
|
133
138
|
};
|
|
134
139
|
}
|
|
135
|
-
function searchSessionTranscript(
|
|
136
|
-
const
|
|
140
|
+
function searchSessionTranscript(conversationId, query, options = {}) {
|
|
141
|
+
const transcriptId = getCurrentTranscriptId(conversationId);
|
|
137
142
|
const normalized = query.trim();
|
|
138
|
-
if (!
|
|
143
|
+
if (!transcriptId || !normalized) return [];
|
|
139
144
|
const limit = Math.min(20, Math.max(1, options.limit ?? 8));
|
|
140
145
|
const beforeSeq = options.beforeSeq ?? Number.MAX_SAFE_INTEGER;
|
|
141
146
|
const db = getSqliteDatabase();
|
|
142
147
|
const ftsRows = db.prepare(`SELECT e.entry_id, e.seq, e.role, e.created_at, f.content
|
|
143
148
|
FROM transcript_fts f
|
|
144
149
|
JOIN transcript_entries e
|
|
145
|
-
ON e.
|
|
150
|
+
ON e.transcript_id = f.transcript_id AND e.entry_id = f.entry_id
|
|
146
151
|
WHERE transcript_fts MATCH ?
|
|
147
|
-
AND f.
|
|
152
|
+
AND f.transcript_id = ?
|
|
148
153
|
AND e.entry_kind <> 'compaction'
|
|
149
154
|
AND e.seq < ?
|
|
150
155
|
ORDER BY bm25(transcript_fts), e.seq DESC
|
|
151
|
-
LIMIT ?`).all(escapeFts5Query(normalized),
|
|
156
|
+
LIMIT ?`).all(escapeFts5Query(normalized), transcriptId, beforeSeq, limit);
|
|
152
157
|
const escapedLike = normalized.replaceAll("\\", "\\\\").replaceAll("%", "\\%").replaceAll("_", "\\_");
|
|
153
158
|
const literalRows = db.prepare(`SELECT entry_id, seq, role, created_at, payload_json AS content
|
|
154
159
|
FROM transcript_entries
|
|
155
|
-
WHERE
|
|
160
|
+
WHERE transcript_id = ?
|
|
156
161
|
AND entry_kind <> 'compaction'
|
|
157
162
|
AND seq < ?
|
|
158
163
|
AND payload_json LIKE ? ESCAPE '\\'
|
|
159
164
|
ORDER BY seq DESC
|
|
160
|
-
LIMIT ?`).all(
|
|
165
|
+
LIMIT ?`).all(transcriptId, beforeSeq, `%${escapedLike}%`, limit);
|
|
161
166
|
const seen = /* @__PURE__ */ new Set();
|
|
162
167
|
return [...ftsRows, ...literalRows].flatMap((row) => {
|
|
163
168
|
const result = row;
|
|
@@ -172,48 +177,48 @@ function searchSessionTranscript(sessionKey, query, options = {}) {
|
|
|
172
177
|
}];
|
|
173
178
|
}).slice(0, limit);
|
|
174
179
|
}
|
|
175
|
-
function loadTranscriptRowsForSession(
|
|
176
|
-
const
|
|
177
|
-
if (!
|
|
178
|
-
return loadTranscriptRows(
|
|
180
|
+
function loadTranscriptRowsForSession(conversationId) {
|
|
181
|
+
const transcriptId = getCurrentTranscriptId(conversationId);
|
|
182
|
+
if (!transcriptId) return [];
|
|
183
|
+
return loadTranscriptRows(transcriptId);
|
|
179
184
|
}
|
|
180
|
-
function loadTranscriptHistoryRowsForSession(
|
|
181
|
-
if (!
|
|
182
|
-
return getSqliteDatabase().prepare(`SELECT e.entry_id, e.
|
|
185
|
+
function loadTranscriptHistoryRowsForSession(conversationId) {
|
|
186
|
+
if (!getCurrentTranscriptId(conversationId)) return [];
|
|
187
|
+
return getSqliteDatabase().prepare(`SELECT e.entry_id, e.transcript_id, e.seq, e.entry_kind, e.role, e.payload_json, e.created_at
|
|
183
188
|
FROM transcript_entries e
|
|
184
|
-
JOIN transcripts t ON t.
|
|
185
|
-
WHERE t.
|
|
189
|
+
JOIN transcripts t ON t.transcript_id = e.transcript_id
|
|
190
|
+
WHERE t.conversation_id = ?
|
|
186
191
|
AND (t.status = 'active' OR t.archive_reason IN ('reset', 'stale'))
|
|
187
|
-
ORDER BY t.created_at ASC, t.rowid ASC, e.seq ASC`).all(
|
|
192
|
+
ORDER BY t.created_at ASC, t.rowid ASC, e.seq ASC`).all(conversationId).map(transcriptEntryRowToStoredRow);
|
|
188
193
|
}
|
|
189
|
-
function loadTranscriptRows(
|
|
190
|
-
return getSqliteDatabase().prepare(`SELECT entry_id,
|
|
194
|
+
function loadTranscriptRows(transcriptId) {
|
|
195
|
+
return getSqliteDatabase().prepare(`SELECT entry_id, transcript_id, seq, entry_kind, role, payload_json, created_at
|
|
191
196
|
FROM transcript_entries
|
|
192
|
-
WHERE
|
|
193
|
-
ORDER BY seq ASC`).all(
|
|
197
|
+
WHERE transcript_id = ?
|
|
198
|
+
ORDER BY seq ASC`).all(transcriptId).map(transcriptEntryRowToStoredRow);
|
|
194
199
|
}
|
|
195
|
-
function loadLlmMessagesForSession(
|
|
196
|
-
const
|
|
197
|
-
if (!
|
|
198
|
-
return buildSessionContextForLlm(getSqliteDatabase().prepare(`SELECT entry_id,
|
|
200
|
+
function loadLlmMessagesForSession(conversationId) {
|
|
201
|
+
const transcriptId = getCurrentTranscriptId(conversationId);
|
|
202
|
+
if (!transcriptId) return [];
|
|
203
|
+
return buildSessionContextForLlm(getSqliteDatabase().prepare(`SELECT entry_id, transcript_id, seq, entry_kind, role, payload_json, created_at
|
|
199
204
|
FROM transcript_entries
|
|
200
|
-
WHERE
|
|
205
|
+
WHERE transcript_id = ?
|
|
201
206
|
AND seq >= COALESCE(
|
|
202
|
-
(SELECT MAX(seq) FROM transcript_entries WHERE
|
|
207
|
+
(SELECT MAX(seq) FROM transcript_entries WHERE transcript_id = ? AND entry_kind = 'compaction'),
|
|
203
208
|
1
|
|
204
209
|
)
|
|
205
|
-
ORDER BY seq ASC`).all(
|
|
210
|
+
ORDER BY seq ASC`).all(transcriptId, transcriptId).map(transcriptEntryRowToStoredRow));
|
|
206
211
|
}
|
|
207
|
-
function replaceTranscriptRows(
|
|
212
|
+
function replaceTranscriptRows(conversationId, rows) {
|
|
208
213
|
if (rows.some(isRuntimeOnlyTranscriptMessage)) throw new Error("Runtime-only messages cannot be persisted in a session transcript");
|
|
209
214
|
runSqliteWriteTransaction((db) => {
|
|
210
|
-
const
|
|
211
|
-
if (!
|
|
212
|
-
db.prepare(`DELETE FROM transcript_fts WHERE
|
|
213
|
-
db.prepare(`DELETE FROM transcript_entries WHERE
|
|
215
|
+
const transcriptId = readCurrentTranscriptId(db, conversationId);
|
|
216
|
+
if (!transcriptId) throw new Error(`Session not found: ${conversationId}`);
|
|
217
|
+
db.prepare(`DELETE FROM transcript_fts WHERE transcript_id = ?`).run(transcriptId);
|
|
218
|
+
db.prepare(`DELETE FROM transcript_entries WHERE transcript_id = ?`).run(transcriptId);
|
|
214
219
|
for (const row of rows) insertEntry(db, {
|
|
215
|
-
|
|
216
|
-
|
|
220
|
+
transcriptId,
|
|
221
|
+
conversationId,
|
|
217
222
|
row
|
|
218
223
|
});
|
|
219
224
|
const llm = buildSessionContextForLlm(rows);
|
|
@@ -226,12 +231,12 @@ function replaceTranscriptRows(sessionKey, rows) {
|
|
|
226
231
|
updated_at = ?,
|
|
227
232
|
last_accessed_at = ?,
|
|
228
233
|
last_interaction_at = ?
|
|
229
|
-
WHERE
|
|
234
|
+
WHERE conversation_id = ?`).run(llm.length, estimateTokensFromMessages(llm), now, now, now, conversationId);
|
|
230
235
|
});
|
|
231
236
|
}
|
|
232
|
-
function paginateTranscriptMessages(
|
|
233
|
-
const
|
|
234
|
-
if (!
|
|
237
|
+
function paginateTranscriptMessages(conversationId, options = {}) {
|
|
238
|
+
const transcriptId = getCurrentTranscriptId(conversationId);
|
|
239
|
+
if (!transcriptId) return {
|
|
235
240
|
rows: [],
|
|
236
241
|
messages: [],
|
|
237
242
|
total: 0,
|
|
@@ -242,11 +247,11 @@ function paginateTranscriptMessages(sessionKey, options = {}) {
|
|
|
242
247
|
const kinds = options.includeContext ? ["message", "context"] : ["message"];
|
|
243
248
|
const kindPlaceholders = kinds.map(() => "?").join(", ");
|
|
244
249
|
const includeArchived = options.includeArchived === true;
|
|
245
|
-
const transcriptWhere = includeArchived ? `t.
|
|
246
|
-
const transcriptArg = includeArchived ?
|
|
250
|
+
const transcriptWhere = includeArchived ? `t.conversation_id = ? AND (t.status = 'active' OR t.archive_reason IN ('reset', 'stale'))` : "e.transcript_id = ?";
|
|
251
|
+
const transcriptArg = includeArchived ? conversationId : transcriptId;
|
|
247
252
|
const total = db.prepare(`SELECT COUNT(*) AS total
|
|
248
253
|
FROM transcript_entries e
|
|
249
|
-
JOIN transcripts t ON t.
|
|
254
|
+
JOIN transcripts t ON t.transcript_id = e.transcript_id
|
|
250
255
|
WHERE ${transcriptWhere} AND e.entry_kind IN (${kindPlaceholders})`).get(transcriptArg, ...kinds).total;
|
|
251
256
|
const limit = Math.min(200, Math.max(1, Math.trunc(options.limit ?? 50)));
|
|
252
257
|
const offset = Math.max(0, Math.trunc(options.offset ?? 0));
|
|
@@ -254,20 +259,20 @@ function paginateTranscriptMessages(sessionKey, options = {}) {
|
|
|
254
259
|
if (options.beforeIndex !== void 0 && Number.isFinite(options.beforeIndex)) {
|
|
255
260
|
const endExclusive = Math.min(total, Math.max(0, Math.trunc(options.beforeIndex)));
|
|
256
261
|
const startInclusive = Math.max(0, endExclusive - limit);
|
|
257
|
-
rows = db.prepare(`SELECT entry_id,
|
|
262
|
+
rows = db.prepare(`SELECT entry_id, transcript_id, seq, entry_kind, role, payload_json, created_at
|
|
258
263
|
FROM (
|
|
259
|
-
SELECT e.entry_id, e.
|
|
264
|
+
SELECT e.entry_id, e.transcript_id, e.seq, e.entry_kind, e.role, e.payload_json, e.created_at,
|
|
260
265
|
ROW_NUMBER() OVER (ORDER BY t.created_at ASC, t.rowid ASC, e.seq ASC) - 1 AS idx
|
|
261
266
|
FROM transcript_entries e
|
|
262
|
-
JOIN transcripts t ON t.
|
|
267
|
+
JOIN transcripts t ON t.transcript_id = e.transcript_id
|
|
263
268
|
WHERE ${transcriptWhere} AND e.entry_kind IN (${kindPlaceholders})
|
|
264
269
|
)
|
|
265
270
|
WHERE idx >= ? AND idx < ?
|
|
266
271
|
ORDER BY idx ASC`).all(transcriptArg, ...kinds, startInclusive, endExclusive);
|
|
267
272
|
} else {
|
|
268
|
-
rows = db.prepare(`SELECT e.entry_id, e.
|
|
273
|
+
rows = db.prepare(`SELECT e.entry_id, e.transcript_id, e.seq, e.entry_kind, e.role, e.payload_json, e.created_at
|
|
269
274
|
FROM transcript_entries e
|
|
270
|
-
JOIN transcripts t ON t.
|
|
275
|
+
JOIN transcripts t ON t.transcript_id = e.transcript_id
|
|
271
276
|
WHERE ${transcriptWhere} AND e.entry_kind IN (${kindPlaceholders})
|
|
272
277
|
ORDER BY t.created_at DESC, t.rowid DESC, e.seq DESC
|
|
273
278
|
LIMIT ? OFFSET ?`).all(transcriptArg, ...kinds, limit, offset);
|
|
@@ -282,14 +287,14 @@ function paginateTranscriptMessages(sessionKey, options = {}) {
|
|
|
282
287
|
endSeq: rows[rows.length - 1]?.seq ?? 0
|
|
283
288
|
};
|
|
284
289
|
}
|
|
285
|
-
function listCompactionBoundaries(
|
|
290
|
+
function listCompactionBoundaries(conversationId) {
|
|
286
291
|
const db = getSqliteDatabase();
|
|
287
|
-
const
|
|
288
|
-
if (!
|
|
292
|
+
const transcriptId = getCurrentTranscriptId(conversationId);
|
|
293
|
+
if (!transcriptId) return [];
|
|
289
294
|
return db.prepare(`SELECT entry_id, seq, payload_json, created_at
|
|
290
295
|
FROM transcript_entries
|
|
291
|
-
WHERE
|
|
292
|
-
ORDER BY seq DESC`).all(
|
|
296
|
+
WHERE transcript_id = ? AND entry_kind = 'compaction'
|
|
297
|
+
ORDER BY seq DESC`).all(transcriptId).map((row) => {
|
|
293
298
|
const payload = JSON.parse(row.payload_json);
|
|
294
299
|
return {
|
|
295
300
|
id: row.entry_id,
|
|
@@ -303,22 +308,22 @@ function listCompactionBoundaries(sessionKey) {
|
|
|
303
308
|
};
|
|
304
309
|
});
|
|
305
310
|
}
|
|
306
|
-
function restoreBeforeCompactionBoundary(
|
|
311
|
+
function restoreBeforeCompactionBoundary(conversationId, compactionId) {
|
|
307
312
|
runSqliteWriteTransaction((db) => {
|
|
308
|
-
const
|
|
309
|
-
if (!
|
|
313
|
+
const transcriptId = readCurrentTranscriptId(db, conversationId);
|
|
314
|
+
if (!transcriptId) throw new Error(`Session not found: ${conversationId}`);
|
|
310
315
|
const boundary = db.prepare(`SELECT seq FROM transcript_entries
|
|
311
|
-
WHERE
|
|
316
|
+
WHERE transcript_id = ? AND entry_id = ? AND entry_kind = 'compaction'`).get(transcriptId, compactionId);
|
|
312
317
|
if (!boundary) throw new Error(`Compaction boundary not found: ${compactionId}`);
|
|
313
318
|
const removedEntryIds = db.prepare(`SELECT entry_id
|
|
314
319
|
FROM transcript_entries
|
|
315
|
-
WHERE
|
|
320
|
+
WHERE transcript_id = ? AND seq >= ?`).all(transcriptId, boundary.seq);
|
|
316
321
|
for (const entry of removedEntryIds) db.prepare(`DELETE FROM transcript_fts WHERE entry_id = ?`).run(entry.entry_id);
|
|
317
|
-
db.prepare(`DELETE FROM transcript_entries WHERE
|
|
318
|
-
const remainingEntries = db.prepare(`SELECT entry_id,
|
|
322
|
+
db.prepare(`DELETE FROM transcript_entries WHERE transcript_id = ? AND seq >= ?`).run(transcriptId, boundary.seq);
|
|
323
|
+
const remainingEntries = db.prepare(`SELECT entry_id, transcript_id, seq, entry_kind, role, payload_json, created_at
|
|
319
324
|
FROM transcript_entries
|
|
320
|
-
WHERE
|
|
321
|
-
ORDER BY seq ASC`).all(
|
|
325
|
+
WHERE transcript_id = ?
|
|
326
|
+
ORDER BY seq ASC`).all(transcriptId);
|
|
322
327
|
const restoredMessages = buildSessionContextForLlm(remainingEntries.map(transcriptEntryRowToStoredRow));
|
|
323
328
|
if (restoredMessages.length === 0) throw new Error(`No restorable context exists before compaction boundary: ${compactionId}`);
|
|
324
329
|
const tokensAfter = estimateTokensFromMessages(restoredMessages);
|
|
@@ -331,7 +336,7 @@ function restoreBeforeCompactionBoundary(sessionKey, compactionId) {
|
|
|
331
336
|
updated_at = ?,
|
|
332
337
|
last_accessed_at = ?,
|
|
333
338
|
last_interaction_at = ?
|
|
334
|
-
WHERE
|
|
339
|
+
WHERE conversation_id = ?`).run(restoredMessages.length, tokensAfter, compactedCount, now, now, now, conversationId);
|
|
335
340
|
});
|
|
336
341
|
}
|
|
337
342
|
//#endregion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
1
|
+
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
2
|
import { USER_CONTEXT_PRINCIPAL_ID } from "../../user-context/domain.js";
|
|
3
3
|
//#region src/storage/sqlite/user-people-repository.ts
|
|
4
|
+
init_transaction();
|
|
4
5
|
function sourceMetadata(sourceInstanceId) {
|
|
5
6
|
if (!sourceInstanceId.startsWith("composio:")) return {};
|
|
6
7
|
const connectorId = sourceInstanceId.split(":")[1];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
1
|
+
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
2
|
import { DEFAULT_USER_TRUST_LEVEL, isUserTrustLevel } from "../../user-context/trust-policy.js";
|
|
3
3
|
//#region src/storage/sqlite/user-trust-repository.ts
|
|
4
|
+
init_transaction();
|
|
4
5
|
function fromRow(row) {
|
|
5
6
|
return {
|
|
6
7
|
principalId: row.principal_id,
|
|
@@ -32,8 +32,8 @@ function sanitizeDoctorCheck(check, redactor) {
|
|
|
32
32
|
}
|
|
33
33
|
function sanitizeLogEntry(entry, redactor) {
|
|
34
34
|
redactor.addIdentifier(entry.requestId, "request");
|
|
35
|
-
redactor.addIdentifier(entry.
|
|
36
|
-
redactor.addIdentifier(entry.
|
|
35
|
+
redactor.addIdentifier(entry.conversationId, "session");
|
|
36
|
+
redactor.addIdentifier(entry.transcriptId, "session");
|
|
37
37
|
const meta = asRecord(entry.meta);
|
|
38
38
|
const error = asRecord(entry.err) ?? asRecord(meta?.err);
|
|
39
39
|
const phase = typeof entry.phase === "string" ? entry.phase : typeof meta?.phase === "string" ? meta.phase : void 0;
|
|
@@ -49,7 +49,7 @@ function sanitizeLogEntry(entry, redactor) {
|
|
|
49
49
|
module: redactor.text(entry.module, 300),
|
|
50
50
|
phase: redactor.text(phase, 300),
|
|
51
51
|
requestId: redactor.identifier(entry.requestId, "request"),
|
|
52
|
-
|
|
52
|
+
transcriptId: redactor.identifier(entry.transcriptId, "session"),
|
|
53
53
|
...sanitizedError && Object.values(sanitizedError).some(Boolean) ? { error: sanitizedError } : {}
|
|
54
54
|
};
|
|
55
55
|
}
|
|
@@ -72,14 +72,14 @@ async function collectRelevantLogs(params) {
|
|
|
72
72
|
});
|
|
73
73
|
if (logs.length > 0) return logs;
|
|
74
74
|
}
|
|
75
|
-
if (params.input.
|
|
75
|
+
if (params.input.conversationId) {
|
|
76
76
|
const logs = await params.query({
|
|
77
77
|
...base,
|
|
78
|
-
|
|
78
|
+
conversationId: params.input.conversationId
|
|
79
79
|
});
|
|
80
80
|
if (logs.length > 0) return logs;
|
|
81
81
|
}
|
|
82
|
-
if (params.input.requestId || params.input.
|
|
82
|
+
if (params.input.requestId || params.input.conversationId) return [];
|
|
83
83
|
return params.query(base);
|
|
84
84
|
}
|
|
85
85
|
function codeBlock(value) {
|
|
@@ -146,7 +146,7 @@ async function collectSupportReport(input, deps = {}) {
|
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
148
|
redactor.addIdentifier(input.requestId, "request");
|
|
149
|
-
redactor.addIdentifier(input.
|
|
149
|
+
redactor.addIdentifier(input.conversationId, "session");
|
|
150
150
|
let rawLogs = [];
|
|
151
151
|
let logCollectionError;
|
|
152
152
|
try {
|
|
@@ -4,7 +4,7 @@ export declare const SupportReportInputSchema: z.ZodObject<{
|
|
|
4
4
|
expected: z.ZodOptional<z.ZodString>;
|
|
5
5
|
reproduction: z.ZodOptional<z.ZodString>;
|
|
6
6
|
occurredAt: z.ZodOptional<z.ZodString>;
|
|
7
|
-
|
|
7
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
8
8
|
requestId: z.ZodOptional<z.ZodString>;
|
|
9
9
|
clientContext: z.ZodOptional<z.ZodObject<{
|
|
10
10
|
currentPage: z.ZodOptional<z.ZodString>;
|
|
@@ -31,7 +31,7 @@ export type SupportLogEntry = {
|
|
|
31
31
|
module?: string;
|
|
32
32
|
phase?: string;
|
|
33
33
|
requestId?: string;
|
|
34
|
-
|
|
34
|
+
transcriptId?: string;
|
|
35
35
|
error?: {
|
|
36
36
|
name?: string;
|
|
37
37
|
message?: string;
|
|
@@ -5,7 +5,7 @@ const SupportReportInputSchema = z.object({
|
|
|
5
5
|
expected: z.string().trim().max(5e3).optional(),
|
|
6
6
|
reproduction: z.string().trim().max(1e4).optional(),
|
|
7
7
|
occurredAt: z.string().datetime().optional(),
|
|
8
|
-
|
|
8
|
+
conversationId: z.string().trim().max(1e3).optional(),
|
|
9
9
|
requestId: z.string().trim().max(1e3).optional(),
|
|
10
10
|
clientContext: z.object({
|
|
11
11
|
currentPage: z.string().trim().max(2e3).optional(),
|
|
@@ -4,7 +4,7 @@ export type ExecutionOrigin = 'chat' | 'task' | 'workflow' | 'automation' | 'bro
|
|
|
4
4
|
export type ExecutionTrigger = 'user' | 'schedule' | 'webhook' | 'proactive' | 'retry';
|
|
5
5
|
export interface ExecutionContext {
|
|
6
6
|
runId: string;
|
|
7
|
-
|
|
7
|
+
conversationId: string;
|
|
8
8
|
channel: string;
|
|
9
9
|
agentId?: string;
|
|
10
10
|
executionEnvironmentId?: string;
|
|
@@ -18,7 +18,7 @@ export interface ExecutionContext {
|
|
|
18
18
|
}
|
|
19
19
|
export declare function resolveExecutionContext(input: {
|
|
20
20
|
runId: string;
|
|
21
|
-
|
|
21
|
+
conversationId: string;
|
|
22
22
|
channel: string;
|
|
23
23
|
metadata: SessionMetadata;
|
|
24
24
|
agentId?: string;
|
|
@@ -39,11 +39,11 @@ function metadataTrigger(metadata) {
|
|
|
39
39
|
return "user";
|
|
40
40
|
}
|
|
41
41
|
function resolveExecutionContext(input) {
|
|
42
|
-
const taskId = isXopcDatabaseOpen() ? new TaskConversationRepository().resolveActiveExecutionSession(input.
|
|
43
|
-
const environment = getExecutionEnvironmentForSession(input.
|
|
42
|
+
const taskId = isXopcDatabaseOpen() ? new TaskConversationRepository().resolveActiveExecutionSession(input.conversationId)?.taskId : void 0;
|
|
43
|
+
const environment = getExecutionEnvironmentForSession(input.conversationId);
|
|
44
44
|
return {
|
|
45
45
|
runId: input.runId,
|
|
46
|
-
|
|
46
|
+
conversationId: input.conversationId,
|
|
47
47
|
channel: input.channel,
|
|
48
48
|
agentId: input.agentId,
|
|
49
49
|
...environment ? {
|
|
@@ -12,7 +12,7 @@ type HomeWorkflowRun = {
|
|
|
12
12
|
definitionId: string;
|
|
13
13
|
title: string;
|
|
14
14
|
status: WorkflowRunSummary['status'];
|
|
15
|
-
|
|
15
|
+
conversationId?: string;
|
|
16
16
|
createdAtMs: number;
|
|
17
17
|
startedAtMs?: number;
|
|
18
18
|
completedAtMs?: number;
|
|
@@ -32,7 +32,7 @@ interface HomeGatewayPort {
|
|
|
32
32
|
readonly proactiveInbox: ProactiveInboxService;
|
|
33
33
|
readonly sessions: {
|
|
34
34
|
listActiveRuns(): Array<{
|
|
35
|
-
|
|
35
|
+
conversationId: string;
|
|
36
36
|
runId: string;
|
|
37
37
|
}>;
|
|
38
38
|
getSession(key: string): Promise<{
|
|
@@ -15,7 +15,7 @@ function toHomeWorkflowRun(run) {
|
|
|
15
15
|
definitionId: run.definitionId,
|
|
16
16
|
title: run.title,
|
|
17
17
|
status: run.status,
|
|
18
|
-
|
|
18
|
+
conversationId: run.metadata?.conversationId,
|
|
19
19
|
createdAtMs: run.createdAtMs,
|
|
20
20
|
startedAtMs: run.startedAtMs,
|
|
21
21
|
completedAtMs: run.completedAtMs,
|
|
@@ -221,7 +221,7 @@ function buildHomeWorkbench(input) {
|
|
|
221
221
|
const openAction = {
|
|
222
222
|
type: "open",
|
|
223
223
|
label: copy.viewProgress,
|
|
224
|
-
href: run.
|
|
224
|
+
href: run.conversationId ? `/chat/${encodeURIComponent(run.conversationId)}` : `/workflows?runId=${encodeURIComponent(run.id)}`
|
|
225
225
|
};
|
|
226
226
|
return {
|
|
227
227
|
id: `workflow:${run.id}`,
|
|
@@ -308,14 +308,14 @@ var HomeQueryService = class {
|
|
|
308
308
|
})),
|
|
309
309
|
Promise.all(activeRuns.map(async (run) => ({
|
|
310
310
|
...run,
|
|
311
|
-
session: await this.service.sessions.getSession(run.
|
|
311
|
+
session: await this.service.sessions.getSession(run.conversationId)
|
|
312
312
|
})))
|
|
313
313
|
]);
|
|
314
314
|
const runningConversations = activeRunSessions.filter((item) => Boolean(item.session)).map((item) => {
|
|
315
315
|
const session = item.session;
|
|
316
316
|
const updatedAt = Date.parse(session.lastInteractionAt ?? session.updatedAt);
|
|
317
317
|
return {
|
|
318
|
-
|
|
318
|
+
conversationId: item.conversationId,
|
|
319
319
|
runId: item.runId,
|
|
320
320
|
...session.name?.trim() ? { title: session.name.trim() } : {},
|
|
321
321
|
...session.routing?.agentId ? { agentId: session.routing.agentId } : {},
|
|
@@ -382,7 +382,7 @@ var HomeQueryService = class {
|
|
|
382
382
|
reason: run.status === "timeout" ? "run_timeout" : "run_failed",
|
|
383
383
|
href: `/workflows?runId=${encodeURIComponent(run.id)}`,
|
|
384
384
|
updatedAt: run.completedAtMs ?? run.startedAtMs ?? run.createdAtMs,
|
|
385
|
-
|
|
385
|
+
conversationId: run.conversationId
|
|
386
386
|
})), ...latestAutomationRuns.filter((run) => run.status === "failed" || run.status === "timeout").filter((run) => automationsById.get(run.automationId)?.notificationPolicy !== "none").filter((run) => !isHomeAttentionAcknowledged("automation_run", run.id)).map((run) => ({
|
|
387
387
|
id: `automation_run:${run.id}`,
|
|
388
388
|
kind: "automation_run",
|
|
@@ -392,7 +392,7 @@ var HomeQueryService = class {
|
|
|
392
392
|
reason: run.status === "timeout" ? "run_timeout" : "run_failed",
|
|
393
393
|
href: `/automations?run=${encodeURIComponent(run.id)}`,
|
|
394
394
|
updatedAt: run.endedAtMs ?? run.startedAtMs ?? run.createdAtMs,
|
|
395
|
-
|
|
395
|
+
conversationId: run.conversationId
|
|
396
396
|
}))].sort((left, right) => right.updatedAt - left.updatedAt);
|
|
397
397
|
const governed = this.#attentionGovernor.project({
|
|
398
398
|
decisions: decisionCandidates,
|