@xopcai/xopc 0.0.248 → 0.0.249
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/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-etpmyV7S.js → activity-store-B759R_qf.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BmKxSM1k.js → agent-avatar-dicebear-BUu7EnwM.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-C1rXNUAG.js +1 -0
- package/dist/gateway/static/root/assets/agents-DK9HjHO0.js +1 -0
- package/dist/gateway/static/root/assets/{api-B0-hLuZ1.js → api-Cg0v7Lpn.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-C9DkCW_d.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-CFggS95Y.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-jOvT-fzU.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BnMSgZvR.js → archive-plugin-BQrilVVv.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CejsQMev.js → attachment-load-BG0BliqV.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-RC8EyoAf.js → automations-page-Bo4RiTkh.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BKjKTlW8.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DGjppLSG.js → binary-plugins-BCnyNU0C.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CWdP4bUc.js → block-editor-Db8DlVvg.js} +50 -50
- package/dist/gateway/static/root/assets/browser-settings-page-Dzq18pO1.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BQ1Ilw_o.js → browser-workflow-inputs-C71vfl0b.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CJh4NyxT.js → browser-workflows-page-vvmSYKsO.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DW4SBQf4.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-57OGuewD.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-Ohhee4vm.js → channels-status-swr-CKyV3jY5.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BOtoKTK3.js → chat-terminal-dock-B1Xd6OFB.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-CT_I3kbR.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-DTj1V3Sw.js → cron-expression-D-F9vjtE.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-Yr6OCvGL.js → date-picker-B2OoYvic.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-BiGx9Sbj.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-DbGzggPF.js → desktop-pet-BNMRqipe.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DeYbIV7A.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DgTtk4KC.js → extension-debug-page-COyn05ub.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DtQeiP6f.js → extension-page-oH43chS2.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BMO59994.js +1 -0
- package/dist/gateway/static/root/assets/gateway-config-api-cimpViGk.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-DXuXtU1w.js → gateway-config-swr-BGdHwT4e.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BHJtnSic.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CzBzglzQ.js → gateway-startup-retry-CuaM3b4c.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DNhrZHqx.js +1 -0
- package/dist/gateway/static/root/assets/home-page-BiHwiBnQ.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-TIgsn04n.js → image-generation-api-D7duj7Uj.js} +1 -1
- package/dist/gateway/static/root/assets/index-DGeGmj4k.css +2 -0
- package/dist/gateway/static/root/assets/index-aBs0EfQB.js +72 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-wsWuoa8p.js → keyboard-shortcuts-settings-D8Zw_lYd.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CpyvYyrb.js → local-app-workbench-page-eBFVWmtH.js} +2 -2
- package/dist/gateway/static/root/assets/{local-apps-page-CXrbrGo8.js → local-apps-page-CvPDPRwb.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BJFLQY8O.js → locale-store-zEL8bkwx.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-ClvcWlL6.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-BdJZFR7U.js → management-settings-D8moh99U.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-NK3ACVG2.js → markdown-split-D7V3j0vE.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DTF9v1gg.js → markdown-view-DGRN-8wP.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-F0jcUxyl.js → media-plugins-BLaE5b1Y.js} +1 -1
- package/dist/gateway/static/root/assets/messages-W5P19VTF.js +11 -0
- package/dist/gateway/static/root/assets/mobile-pairing-wizard-DiVDuCxl.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-CEEvR-fV.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BLqgXNCx.js +8 -0
- package/dist/gateway/static/root/assets/page-tabs-BFMGjA60.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-DNEWZN7H.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-CxGGlWA8.js → product-open-page-Co5u7asH.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CIiFJ5tk.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-B3UF-Pfm.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-CIsNlSBi.js → registry-api-Cg92zSod.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BUtpkJPG.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-YkjhiQfA.js → runtime-tools-settings-panel-C0ByNmlV.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-oFGf3G3s.js → schema-form-Dq_VQpuY.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-UgJmG-V4.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DDCzpdkl.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-CZu6FX4k.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-C7VWs0IT.js → settings-page-S8ekeUZd.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BdVmwXMv.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-t5oz18rh.js → share-preview-page-D2fEidbn.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BdsqnCYj.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-ghzAQKna.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-AYiPlgZE.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-DEDTYs2W.js → skills-page.utils-DGzl-ib-.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-5Xd5mIiR.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-BQAUaCDD.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-O597U8q_.js → theme-store-ZVClZKQ0.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-CdZN1Jin.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-B5eUJ6Zq.js → use-autosave-czRI0NBc.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-W3GTm6nA.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CMKSwz4C.js → voice-api-key-field-8YEvA3cU.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-q7B6fOFB.js → voice-config-api-CopF64lY.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-keLtqYYJ.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DZmvLZjb.js → workflow-run-setup-panel-Dy5WgYMO.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BbAV3h7n.js +5 -0
- package/dist/gateway/static/root/index.html +10 -26
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-instance-gateway.d.ts +2 -2
- package/dist/src/agent/agent-manager.d.ts +4 -4
- package/dist/src/agent/agent-manager.js +31 -15
- package/dist/src/agent/background-review/coordinator.d.ts +2 -4
- package/dist/src/agent/background-review/coordinator.js +5 -30
- package/dist/src/agent/background-review/prompts.d.ts +4 -2
- package/dist/src/agent/background-review/prompts.js +24 -19
- package/dist/src/agent/background-review/run-background-review.d.ts +6 -7
- package/dist/src/agent/background-review/run-background-review.js +47 -41
- package/dist/src/agent/background-review/settings.d.ts +0 -1
- package/dist/src/agent/background-review/settings.js +6 -7
- package/dist/src/agent/context/audit.d.ts +36 -0
- package/dist/src/agent/context/audit.js +97 -0
- package/dist/src/agent/context/coordinator.d.ts +26 -0
- package/dist/src/agent/context/coordinator.js +72 -0
- package/dist/src/agent/context/execution-context.d.ts +54 -0
- package/dist/src/agent/context/execution-context.js +147 -0
- package/dist/src/agent/context/execution-scope.js +1 -1
- package/dist/src/agent/context/prepend.d.ts +2 -0
- package/dist/src/agent/context/prepend.js +28 -0
- package/dist/src/agent/context/project-context.d.ts +3 -3
- package/dist/src/agent/context/project-context.js +26 -23
- package/dist/src/agent/embedded/index.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -0
- package/dist/src/agent/embedded/run-turn.js +22 -2
- package/dist/src/agent/embedded/types.d.ts +1 -25
- package/dist/src/agent/external-tools/composio-provider.js +87 -92
- package/dist/src/agent/external-tools/gateway-tools.d.ts +4 -1
- package/dist/src/agent/external-tools/gateway-tools.js +153 -41
- package/dist/src/agent/external-tools/index.js +1 -1
- package/dist/src/agent/external-tools/search-error.d.ts +12 -0
- package/dist/src/agent/external-tools/search-error.js +29 -0
- package/dist/src/agent/external-tools/service.d.ts +4 -0
- package/dist/src/agent/external-tools/service.js +22 -2
- package/dist/src/agent/memory/compaction-policy.js +1 -1
- package/dist/src/agent/memory/compaction-promotion.js +45 -77
- package/dist/src/agent/memory/create-memory-manager.js +1 -3
- package/dist/src/agent/memory/index.d.ts +0 -5
- package/dist/src/agent/memory/index.js +2 -5
- package/dist/src/agent/memory/manager.d.ts +0 -16
- package/dist/src/agent/memory/manager.js +11 -40
- package/dist/src/agent/memory/memory-config.js +1 -1
- package/dist/src/agent/memory/runtime.d.ts +2 -2
- package/dist/src/agent/memory/runtime.js +9 -19
- package/dist/src/agent/memory/types.d.ts +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +13 -21
- package/dist/src/agent/prompt/sections/memory-skills.js +25 -36
- package/dist/src/agent/prompt/sections/tooling.js +10 -4
- package/dist/src/agent/prompt/service-prompt-builder.js +4 -3
- package/dist/src/agent/service/direct-turn-helpers.js +6 -23
- package/dist/src/agent/service/process-direct-streaming.js +5 -3
- package/dist/src/agent/service.js +4 -3
- package/dist/src/agent/tasks/task-judge-service.js +1 -1
- package/dist/src/agent/tools/clarify-tool.d.ts +1 -0
- package/dist/src/agent/tools/delegate-tool.js +5 -2
- package/dist/src/agent/tools/factory.js +36 -19
- package/dist/src/agent/tools/index.d.ts +3 -2
- package/dist/src/agent/tools/index.js +4 -3
- package/dist/src/agent/tools/knowledge-memory-tool.d.ts +9 -0
- package/dist/src/agent/tools/knowledge-memory-tool.js +129 -0
- package/dist/src/agent/tools/{dreaming-tool.d.ts → memory-maintenance-tool.d.ts} +2 -2
- package/dist/src/agent/tools/memory-maintenance-tool.js +31 -0
- package/dist/src/agent/tools/user-context-tool.d.ts +8 -0
- package/dist/src/agent/tools/user-context-tool.js +81 -0
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/chat-commands/builtins/understanding.js +24 -6
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/schema.d.ts +68 -75
- package/dist/src/config/schema.js +29 -18
- package/dist/src/config/web-patch.d.ts +1 -1
- package/dist/src/connectors/auth-provider-registry.js +1 -1
- package/dist/src/connectors/composio-managed-client.js +6 -2
- package/dist/src/connectors/connected-source-ingestion.js +1 -1
- package/dist/src/connectors/connected-source-understanding.d.ts +1 -3
- package/dist/src/connectors/connected-source-understanding.js +86 -99
- package/dist/src/connectors/connection-candidates.d.ts +11 -0
- package/dist/src/connectors/connection-candidates.js +58 -0
- package/dist/src/connectors/connection-capabilities.d.ts +4 -0
- package/dist/src/connectors/connection-capabilities.js +37 -0
- package/dist/src/connectors/connection-recovery-service.d.ts +42 -0
- package/dist/src/connectors/connection-recovery-service.js +396 -0
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/learning-coordinator.d.ts +0 -2
- package/dist/src/connectors/learning-coordinator.js +6 -7
- package/dist/src/connectors/principal.d.ts +5 -0
- package/dist/src/connectors/principal.js +18 -0
- package/dist/src/gateway/agent-builtin-tools.d.ts +28 -10
- package/dist/src/gateway/agent-builtin-tools.js +30 -9
- package/dist/src/gateway/chat-stream/mapper.js +1 -28
- package/dist/src/gateway/chat-stream/protocol.d.ts +2 -24
- package/dist/src/gateway/clarify-bridge.d.ts +4 -0
- package/dist/src/gateway/clarify-bridge.js +9 -4
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +52 -30
- package/dist/src/gateway/hono/lib/config-payload.js +4 -4
- package/dist/src/gateway/hono/middleware/auth.js +1 -2
- package/dist/src/gateway/hono/routes/capabilities.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.d.ts +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +72 -28
- package/dist/src/gateway/hono/routes/connection-waits.d.ts +3 -0
- package/dist/src/gateway/hono/routes/connection-waits.js +58 -0
- package/dist/src/gateway/hono/routes/connectors.js +7 -15
- package/dist/src/gateway/hono/routes/context-sources.d.ts +4 -0
- package/dist/src/gateway/hono/routes/context-sources.js +159 -0
- package/dist/src/gateway/hono/routes/index.js +4 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +9 -4
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +22 -7
- package/dist/src/gateway/hono/routes/projects.js +36 -44
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +15 -1
- package/dist/src/gateway/hono/routes/side-chats.js +13 -2
- package/dist/src/gateway/hono/routes/tasks.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.d.ts +3 -0
- package/dist/src/gateway/hono/routes/user-model.js +480 -0
- package/dist/src/gateway/memory-maintenance-automation-reconciler.d.ts +11 -0
- package/dist/src/gateway/memory-maintenance-automation-reconciler.js +72 -0
- package/dist/src/gateway/service/agent-runner.d.ts +9 -1
- package/dist/src/gateway/service/agent-runner.js +25 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +2 -2
- package/dist/src/gateway/service/config-coordinator.js +4 -4
- package/dist/src/gateway/service/run-gateway-agent.d.ts +1 -0
- package/dist/src/gateway/service/run-gateway-agent.js +18 -14
- package/dist/src/gateway/service/session-input-coordinator.d.ts +3 -0
- package/dist/src/gateway/service/session-input-coordinator.js +12 -2
- package/dist/src/gateway/service.d.ts +3 -1
- package/dist/src/gateway/service.js +45 -14
- package/dist/src/gateway/side-chat/manager.d.ts +16 -3
- package/dist/src/gateway/side-chat/manager.js +117 -28
- package/dist/src/gateway/side-chat/run-service.d.ts +2 -0
- package/dist/src/gateway/side-chat/run-service.js +28 -5
- package/dist/src/gateway/side-chat/types.d.ts +9 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/knowledge/connected-knowledge-pipeline.d.ts +0 -2
- package/dist/src/knowledge/connected-knowledge-pipeline.js +46 -217
- package/dist/src/knowledge-memory/domain.d.ts +35 -0
- package/dist/src/knowledge-memory/index.d.ts +2 -0
- package/dist/src/knowledge-memory/index.js +2 -0
- package/dist/src/knowledge-memory/repository.d.ts +45 -0
- package/dist/src/knowledge-memory/repository.js +154 -0
- package/dist/src/memory-maintenance/index.d.ts +2 -0
- package/dist/src/memory-maintenance/index.js +3 -0
- package/dist/src/memory-maintenance/schedule.d.ts +13 -0
- package/dist/src/memory-maintenance/schedule.js +51 -0
- package/dist/src/memory-maintenance/service.d.ts +28 -0
- package/dist/src/memory-maintenance/service.js +216 -0
- package/dist/src/notes/service.d.ts +1 -0
- package/dist/src/notes/service.js +7 -1
- package/dist/src/notes/types.d.ts +16 -0
- package/dist/src/proactive/execution/context.d.ts +2 -2
- package/dist/src/proactive/execution/context.js +16 -11
- package/dist/src/proactive/index.d.ts +1 -1
- package/dist/src/proactive/index.js +2 -2
- package/dist/src/projects/index.d.ts +1 -1
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/knowledge-bind.d.ts +1 -0
- package/dist/src/projects/knowledge-bind.js +15 -0
- package/dist/src/projects/project-loop.d.ts +3 -3
- package/dist/src/projects/project-loop.js +4 -4
- package/dist/src/projects/project-store.js +2 -1
- package/dist/src/realtime/runtime.js +1 -0
- package/dist/src/runtime-tools/manager.js +1 -1
- package/dist/src/storage/sqlite/collaboration-rule-repository.d.ts +17 -0
- package/dist/src/storage/sqlite/collaboration-rule-repository.js +54 -0
- package/dist/src/storage/sqlite/connection-wait-repository.d.ts +30 -0
- package/dist/src/storage/sqlite/connection-wait-repository.js +338 -0
- package/dist/src/storage/sqlite/connector-account-repository.js +1 -1
- package/dist/src/storage/sqlite/context-evidence-repository.d.ts +24 -0
- package/dist/src/storage/sqlite/context-evidence-repository.js +52 -0
- package/dist/src/storage/sqlite/index.d.ts +3 -5
- package/dist/src/storage/sqlite/index.js +4 -6
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +0 -19
- package/dist/src/storage/sqlite/knowledge-repository.js +1 -90
- package/dist/src/storage/sqlite/migrations/148_user_model_foundation.sql +554 -0
- package/dist/src/storage/sqlite/migrations/149_separate_source_index_from_memory.sql +18 -0
- package/dist/src/storage/sqlite/migrations/150_session_connection_waits.sql +47 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/notes-repository.d.ts +2 -1
- package/dist/src/storage/sqlite/notes-repository.js +37 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +14 -2
- package/dist/src/storage/sqlite/session-input-repository.js +16 -13
- package/dist/src/storage/sqlite/session-repository.js +4 -1
- package/dist/src/storage/sqlite/transcript-repository.js +1 -1
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/project-operating-view-service.js +1 -1
- package/dist/src/tasks/task-application-service.js +6 -1
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-context-repository.d.ts +0 -1
- package/dist/src/tasks/task-context-repository.js +1 -1
- package/dist/src/tasks/task-deletion-service.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-read-model-projector.js +1 -1
- package/dist/src/tasks/task-run-coordinator.js +1 -1
- package/dist/src/tasks/task-run-dispatcher.js +1 -1
- package/dist/src/tasks/task-run-repository.js +1 -0
- package/dist/src/tasks/task-signal-service.js +1 -1
- package/dist/src/tui/tool-summary.js +2 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/user-context/changes.d.ts +1 -1
- package/dist/src/user-context/config.d.ts +135 -153
- package/dist/src/user-context/config.js +94 -99
- package/dist/src/user-context/relationship-continuity.d.ts +2 -2
- package/dist/src/user-context/relationship-continuity.js +34 -24
- package/dist/src/user-context/sources/activity-clustering.d.ts +9 -3
- package/dist/src/user-context/sources/index.js +2 -2
- package/dist/src/user-context/sources/repository.d.ts +1 -21
- package/dist/src/user-context/sources/repository.js +1 -183
- package/dist/src/user-context/sources/types.d.ts +0 -23
- package/dist/src/user-model/capture/executor.d.ts +40 -0
- package/dist/src/user-model/capture/executor.js +134 -0
- package/dist/src/user-model/capture/index.d.ts +2 -0
- package/dist/src/user-model/capture/index.js +3 -0
- package/dist/src/user-model/capture/semantic.d.ts +21 -0
- package/dist/src/user-model/capture/semantic.js +197 -0
- package/dist/src/user-model/domain.d.ts +93 -0
- package/dist/src/user-model/domain.js +33 -0
- package/dist/src/user-model/goals.d.ts +58 -0
- package/dist/src/user-model/goals.js +89 -0
- package/dist/src/user-model/importance.d.ts +11 -0
- package/dist/src/user-model/importance.js +17 -0
- package/dist/src/user-model/index.d.ts +5 -0
- package/dist/src/user-model/index.js +6 -0
- package/dist/src/user-model/repository.d.ts +23 -0
- package/dist/src/user-model/repository.js +268 -0
- package/dist/src/user-model/temporal.d.ts +10 -0
- package/dist/src/user-model/temporal.js +44 -0
- package/dist/src/voice/realtime/memory-context.d.ts +7 -2
- package/dist/src/voice/realtime/memory-context.js +39 -51
- package/dist/src/work-discovery/service.d.ts +3 -14
- package/dist/src/work-discovery/service.js +138 -99
- package/dist/src/work-discovery/types.d.ts +3 -3
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/dist/src/workflows/service/workflow-session-bridge.js +12 -20
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CUXApfcE.js +0 -1
- package/dist/gateway/static/root/assets/agents-DNq_GKuc.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-qfwAgyhQ.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-DqQVUpCC.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-dwIqYmXk.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-SkdcSZ0i.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CKCa6TvG.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DSp--zIZ.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-CMd2dDrI.js +0 -1
- package/dist/gateway/static/root/assets/cloud-C4-yfnnk.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-udWs5Kdm.js +0 -2
- package/dist/gateway/static/root/assets/dependency-picker-DpN3XZg9.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DinCToZh.js +0 -1
- package/dist/gateway/static/root/assets/ellipsis-0k4rZLoy.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-DcguCgsH.js +0 -1
- package/dist/gateway/static/root/assets/eye-CABVeTq0.js +0 -1
- package/dist/gateway/static/root/assets/eye-off-DEAzt3g1.js +0 -1
- package/dist/gateway/static/root/assets/folder-open-CyzJ19I9.js +0 -1
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-api-Br7lSf6H.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CdPoDMuj.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DHk1hawP.js +0 -1
- package/dist/gateway/static/root/assets/home-page-YGipe_W6.js +0 -1
- package/dist/gateway/static/root/assets/index-D5TQQpeb.js +0 -71
- package/dist/gateway/static/root/assets/index-DReBaaTX.css +0 -2
- package/dist/gateway/static/root/assets/interaction-BmQogeqz.js +0 -1
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +0 -1
- package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +0 -1
- package/dist/gateway/static/root/assets/local-context-graph-BjUf7fQ9.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-CXKy6E_l.js +0 -2
- package/dist/gateway/static/root/assets/message-square-plus-XP0tGdlV.js +0 -1
- package/dist/gateway/static/root/assets/messages-CHNYp8EQ.js +0 -3
- package/dist/gateway/static/root/assets/minimize-2-DtOGrlpo.js +0 -1
- package/dist/gateway/static/root/assets/mobile-pairing-wizard-3NKCniSp.js +0 -1
- package/dist/gateway/static/root/assets/models-hub-cache-nCfkBN8M.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-DuqLahi6.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-C7j9EdQk.js +0 -5
- package/dist/gateway/static/root/assets/oauth-api-8lP_qJpq.js +0 -1
- package/dist/gateway/static/root/assets/oauth-authorization-window-Cdolr2wE.js +0 -1
- package/dist/gateway/static/root/assets/page-tabs-BaEQMYm_.js +0 -1
- package/dist/gateway/static/root/assets/pencil-DmIY3Oa-.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-CsNVTKC0.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CfebYVX0.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-48GvzSVa.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-64xj_s2m.js +0 -1
- package/dist/gateway/static/root/assets/rotate-cw-LIg3Am9S.js +0 -1
- package/dist/gateway/static/root/assets/search-DA7gz22f.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CcwcdRN8.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BaN84CyW.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-DjWzRk4z.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DVVOCNbr.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DUYbYLi7.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BGyD0gB9.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CjF8DTsN.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-BSYuRgFI.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-YZYSTJH7.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-FKUi9wDL.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-BCyiduKd.js +0 -2
- package/dist/gateway/static/root/assets/work-discovery-overlay-jhT2EzeH.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-DQC0TpMa.js +0 -5
- package/dist/src/agent/memory/builtin-provider.d.ts +0 -37
- package/dist/src/agent/memory/builtin-provider.js +0 -225
- package/dist/src/agent/memory/context/types.d.ts +0 -40
- package/dist/src/agent/memory/understanding/quality.d.ts +0 -8
- package/dist/src/agent/memory/understanding/quality.js +0 -18
- package/dist/src/agent/memory/understanding/service.d.ts +0 -19
- package/dist/src/agent/memory/understanding/service.js +0 -209
- package/dist/src/agent/memory/understanding/types.d.ts +0 -34
- package/dist/src/agent/memory/understanding/types.js +0 -1
- package/dist/src/agent/memory/user-context-coordinator.d.ts +0 -23
- package/dist/src/agent/memory/user-context-coordinator.js +0 -113
- package/dist/src/agent/tools/dreaming-tool.js +0 -37
- package/dist/src/agent/tools/memory-tool.d.ts +0 -9
- package/dist/src/agent/tools/memory-tool.js +0 -119
- package/dist/src/gateway/dreaming-automation-reconciler.d.ts +0 -11
- package/dist/src/gateway/dreaming-automation-reconciler.js +0 -63
- package/dist/src/gateway/hono/routes/understanding-sources.d.ts +0 -21
- package/dist/src/gateway/hono/routes/understanding-sources.js +0 -387
- package/dist/src/gateway/hono/routes/you.d.ts +0 -3
- package/dist/src/gateway/hono/routes/you.js +0 -457
- package/dist/src/projects/memory-bind.d.ts +0 -1
- package/dist/src/projects/memory-bind.js +0 -14
- package/dist/src/storage/sqlite/context-consolidation-repository.d.ts +0 -37
- package/dist/src/storage/sqlite/context-consolidation-repository.js +0 -64
- package/dist/src/storage/sqlite/memory-records-repository.d.ts +0 -217
- package/dist/src/storage/sqlite/memory-records-repository.js +0 -715
- package/dist/src/storage/sqlite/remote-context-repository.d.ts +0 -3
- package/dist/src/storage/sqlite/remote-context-repository.js +0 -40
- package/dist/src/storage/sqlite/understanding-focus-exclusions.d.ts +0 -2
- package/dist/src/storage/sqlite/understanding-focus-exclusions.js +0 -24
- package/dist/src/storage/sqlite/user-context-quality-repository.d.ts +0 -49
- package/dist/src/storage/sqlite/user-context-quality-repository.js +0 -118
- package/dist/src/storage/sqlite/user-context-repository.d.ts +0 -85
- package/dist/src/storage/sqlite/user-context-repository.js +0 -535
- package/dist/src/user-context/automatic-context.d.ts +0 -17
- package/dist/src/user-context/automatic-context.js +0 -85
- package/dist/src/user-context/consolidation.d.ts +0 -27
- package/dist/src/user-context/consolidation.js +0 -187
- package/dist/src/user-context/context-objects.d.ts +0 -17
- package/dist/src/user-context/context-objects.js +0 -99
- package/dist/src/user-context/evaluation/harness.d.ts +0 -13
- package/dist/src/user-context/evaluation/harness.js +0 -31
- package/dist/src/user-context/extraction/executor.d.ts +0 -22
- package/dist/src/user-context/extraction/executor.js +0 -142
- package/dist/src/user-context/extraction/repair.d.ts +0 -19
- package/dist/src/user-context/extraction/repair.js +0 -71
- package/dist/src/user-context/extraction/semantic.d.ts +0 -18
- package/dist/src/user-context/extraction/semantic.js +0 -148
- package/dist/src/user-context/focus-lifecycle.d.ts +0 -2
- package/dist/src/user-context/focus-lifecycle.js +0 -26
- package/dist/src/user-context/manual-understanding.d.ts +0 -12
- package/dist/src/user-context/manual-understanding.js +0 -37
- package/dist/src/user-context/planner.d.ts +0 -17
- package/dist/src/user-context/planner.js +0 -465
- package/dist/src/user-context/relationships/indexer.d.ts +0 -13
- package/dist/src/user-context/relationships/indexer.js +0 -185
- package/dist/src/user-context/relationships/service.d.ts +0 -22
- package/dist/src/user-context/relationships/service.js +0 -50
- package/dist/src/user-context/retriever.d.ts +0 -15
- package/dist/src/user-context/retriever.js +0 -124
- package/dist/src/user-context/scope.d.ts +0 -7
- package/dist/src/user-context/scope.js +0 -9
- package/dist/src/user-context/selection-policy.d.ts +0 -20
- package/dist/src/user-context/selection-policy.js +0 -33
- package/dist/src/user-context/understanding.d.ts +0 -15
- package/dist/src/user-context/understanding.js +0 -24
- package/dist/src/user-context/understandingQuality.d.ts +0 -5
- package/dist/src/user-context/understandingQuality.js +0 -48
- /package/dist/src/{agent/memory/context/types.js → knowledge-memory/domain.js} +0 -0
|
@@ -224,12 +224,12 @@ var GatewayConfigCoordinator = class {
|
|
|
224
224
|
this.opts.setConfig(newConfig);
|
|
225
225
|
this.opts.getAgentService().applyAgentDefaultsFromConfig(newConfig);
|
|
226
226
|
this.opts.reconcileBrowserExtensionServer();
|
|
227
|
-
this.opts.
|
|
227
|
+
this.opts.reconcileMemoryMaintenanceAutomations().catch((err) => {
|
|
228
228
|
const em = err instanceof Error ? err.message : String(err);
|
|
229
229
|
log.warn({
|
|
230
230
|
err,
|
|
231
231
|
errorMessage: em
|
|
232
|
-
}, `
|
|
232
|
+
}, `Memory maintenance automation refresh failed: ${em}`);
|
|
233
233
|
});
|
|
234
234
|
this.opts.emit("config.reload", { section: "agents" });
|
|
235
235
|
log.debug("Agent defaults reloaded");
|
|
@@ -351,12 +351,12 @@ var GatewayConfigCoordinator = class {
|
|
|
351
351
|
if (sanitizeTunnelConfig(reloaded)) await saveConfig(reloaded, this.opts.configPath);
|
|
352
352
|
this.opts.getAgentService().applyAgentDefaultsFromConfig(reloaded);
|
|
353
353
|
await this.opts.reconcileBrowserExtensionServer();
|
|
354
|
-
await this.opts.
|
|
354
|
+
await this.opts.reconcileMemoryMaintenanceAutomations().catch((err) => {
|
|
355
355
|
const em = err instanceof Error ? err.message : String(err);
|
|
356
356
|
log.warn({
|
|
357
357
|
err,
|
|
358
358
|
errorMessage: em
|
|
359
|
-
}, `
|
|
359
|
+
}, `Memory maintenance automation refresh after save failed: ${em}`);
|
|
360
360
|
});
|
|
361
361
|
this.configReloader?.syncCurrentConfig(reloaded);
|
|
362
362
|
}
|
|
@@ -24,6 +24,7 @@ export type RunGatewayAgentDeps = {
|
|
|
24
24
|
export declare function runGatewayAgent(deps: RunGatewayAgentDeps, message: string, channel: string, chatId: string, origin: TurnOrigin, attachments?: UserTurnAttachment[], thinking?: string, runOptions?: {
|
|
25
25
|
signal?: AbortSignal;
|
|
26
26
|
runId?: string;
|
|
27
|
+
taskRunId?: string;
|
|
27
28
|
sourceContexts?: AgentSourceContext[];
|
|
28
29
|
presentation?: 'voice';
|
|
29
30
|
}): AsyncGenerator<RunGatewayAgentYield, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { inboundCorrelationMetadataFromAsyncLogContext, updateAsyncLogContext } from "../../utils/logger/context.js";
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
|
+
import { getConnectionResumeInput, isConnectionSuspended } from "../../storage/sqlite/connection-wait-repository.js";
|
|
4
5
|
import { updateInteractionStateFromMessage } from "../../storage/sqlite/interaction-state-repository.js";
|
|
5
6
|
import "../../storage/sqlite/index.js";
|
|
6
7
|
import { init_session_key, parseSessionKey } from "../../routing/session-key.js";
|
|
@@ -52,14 +53,16 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
52
53
|
if (webchatSessionKey) {
|
|
53
54
|
if (!webchatMetadata) throw new Error("Session metadata is unavailable");
|
|
54
55
|
if (!parseSessionKey(webchatSessionKey)) throw new Error("Resolved webchat session key is invalid");
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
if (!getConnectionResumeInput(webchatSessionKey, runId)) {
|
|
57
|
+
updateInteractionStateFromMessage({
|
|
58
|
+
sessionKey: webchatSessionKey,
|
|
59
|
+
message
|
|
60
|
+
});
|
|
61
|
+
recordExplicitRelationshipFollowUp({
|
|
62
|
+
sessionKey: webchatSessionKey,
|
|
63
|
+
message
|
|
64
|
+
});
|
|
65
|
+
}
|
|
63
66
|
const executionContext = resolveExecutionContext({
|
|
64
67
|
runId,
|
|
65
68
|
sessionKey: webchatSessionKey,
|
|
@@ -67,7 +70,7 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
67
70
|
metadata: webchatMetadata
|
|
68
71
|
});
|
|
69
72
|
taskRun = TaskRunCoordinator.start({
|
|
70
|
-
runId,
|
|
73
|
+
runId: runOptions?.taskRunId ?? runId,
|
|
71
74
|
context: executionContext,
|
|
72
75
|
fallbackObjective: message
|
|
73
76
|
});
|
|
@@ -141,8 +144,9 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
141
144
|
for await (const event of eventStream) yield* mapper.map(event);
|
|
142
145
|
})();
|
|
143
146
|
for await (const event of coalesceThinkingDeltas(mappedEvents)) yield* emitAndYield([event]);
|
|
144
|
-
const
|
|
145
|
-
const
|
|
147
|
+
const suspended = isConnectionSuspended(sessionKey, runId);
|
|
148
|
+
const endStatus = mergedSignal.aborted ? "cancelled" : suspended ? "suspended" : "success";
|
|
149
|
+
const endSummary = mergedSignal.aborted ? "Interrupted" : suspended ? "Waiting for connection" : "Message processed successfully";
|
|
146
150
|
taskRunStatus = mergedSignal.aborted ? "cancelled" : "succeeded";
|
|
147
151
|
terminalStatus = endStatus;
|
|
148
152
|
taskRunSummary = endSummary;
|
|
@@ -150,8 +154,8 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
150
154
|
completeRealtimeTopic(`run:${runId}`);
|
|
151
155
|
runTopicCompleted = true;
|
|
152
156
|
return {
|
|
153
|
-
status: mergedSignal.aborted ? "aborted" : "ok",
|
|
154
|
-
summary:
|
|
157
|
+
status: mergedSignal.aborted ? "aborted" : suspended ? "suspended" : "ok",
|
|
158
|
+
summary: endSummary
|
|
155
159
|
};
|
|
156
160
|
} catch (error) {
|
|
157
161
|
if (mergedSignal.aborted) {
|
|
@@ -214,7 +218,7 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
214
218
|
assistantPlainText,
|
|
215
219
|
aborted: mergedSignal.aborted,
|
|
216
220
|
...streamError !== void 0 ? { streamError } : {},
|
|
217
|
-
skipTaskReview: reviewHint?.skipTaskReview ?? false,
|
|
221
|
+
skipTaskReview: terminalStatus === "suspended" || (reviewHint?.skipTaskReview ?? false),
|
|
218
222
|
outboundMetadata: {}
|
|
219
223
|
});
|
|
220
224
|
} catch (completionErr) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TurnOrigin } from '@xopcai/endpoint-tools-protocol';
|
|
2
|
+
import type { SessionInput } from '../../storage/sqlite/session-input-repository.js';
|
|
2
3
|
import type { UserTurnAttachment } from '../user-turn-input.js';
|
|
3
4
|
import { type AgentSourceContext, type TurnContextRef } from '../../agent/source-context/types.js';
|
|
4
5
|
import { type SessionInputDelivery, type SessionInputState } from '../../storage/sqlite/index.js';
|
|
@@ -21,9 +22,11 @@ export declare class SessionInputCoordinator {
|
|
|
21
22
|
private readonly draining;
|
|
22
23
|
private readonly submissionTails;
|
|
23
24
|
constructor(deps: {
|
|
25
|
+
beforeExecute?: (input: SessionInput) => Promise<boolean>;
|
|
24
26
|
sessionExists: (sessionKey: string) => Promise<boolean>;
|
|
25
27
|
execute: (input: {
|
|
26
28
|
runId: string;
|
|
29
|
+
taskRunId?: string;
|
|
27
30
|
sessionKey: string;
|
|
28
31
|
content: string;
|
|
29
32
|
attachments?: UserTurnAttachment[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { cancelConnectionObjective, consumeConnectionResume, invalidateConnectionResumeIntent, publishConnectionWait } from "../../storage/sqlite/connection-wait-repository.js";
|
|
3
4
|
import { SessionInstanceChangedError, cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, finishSessionInputRun, getSessionInputById, getSessionInputState, insertSessionInput, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus } from "../../storage/sqlite/session-input-repository.js";
|
|
4
5
|
import { replaceLatestSessionTurnAndQueueInput, validateLatestSessionTurnTarget } from "../../storage/sqlite/session-turn-replace-repository.js";
|
|
5
6
|
import "../../storage/sqlite/index.js";
|
|
@@ -111,6 +112,7 @@ var SessionInputCoordinator = class {
|
|
|
111
112
|
});
|
|
112
113
|
if (result.ok === false) return result;
|
|
113
114
|
if (!result.idempotent) {
|
|
115
|
+
cancelConnectionObjective(sessionKey);
|
|
114
116
|
const replacement = {
|
|
115
117
|
role: "user",
|
|
116
118
|
content,
|
|
@@ -184,6 +186,7 @@ var SessionInputCoordinator = class {
|
|
|
184
186
|
origin: input.origin,
|
|
185
187
|
targetRunId: canSteer ? runtime.activeRunId : void 0
|
|
186
188
|
});
|
|
189
|
+
invalidateConnectionResumeIntent(sessionKey);
|
|
187
190
|
if (canSteer) {
|
|
188
191
|
if (!await this.deps.steer(sessionKey, content)) {
|
|
189
192
|
setSessionInputStatus(row.id, "queued", {
|
|
@@ -218,11 +221,18 @@ var SessionInputCoordinator = class {
|
|
|
218
221
|
const runId = crypto.randomUUID();
|
|
219
222
|
const input = claimNextSessionInput(sessionKey, runId);
|
|
220
223
|
if (!input) return;
|
|
224
|
+
if (this.deps.beforeExecute && !await this.deps.beforeExecute(input) || !consumeConnectionResume(input)) {
|
|
225
|
+
finishSessionInputRun(sessionKey, runId, "cancelled");
|
|
226
|
+
this.publish(sessionKey);
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
if (input.kind === "connection_resume") publishConnectionWait(sessionKey);
|
|
221
230
|
this.publish(sessionKey);
|
|
222
231
|
let result;
|
|
223
232
|
try {
|
|
224
233
|
result = await this.deps.execute({
|
|
225
234
|
runId,
|
|
235
|
+
taskRunId: input.taskRunId,
|
|
226
236
|
sessionKey,
|
|
227
237
|
content: input.content,
|
|
228
238
|
attachments: input.attachments,
|
|
@@ -242,7 +252,7 @@ var SessionInputCoordinator = class {
|
|
|
242
252
|
inputId: input.id
|
|
243
253
|
}, "Session input execution failed");
|
|
244
254
|
}
|
|
245
|
-
const terminal = result.status === "ok" ? "completed" : result.status === "aborted" ? "cancelled" : "failed";
|
|
255
|
+
const terminal = result.status === "suspended" ? "suspended" : result.status === "ok" ? "completed" : result.status === "aborted" ? "cancelled" : "failed";
|
|
246
256
|
finishSessionInputRun(sessionKey, runId, terminal, terminal === "failed" ? result.summary : void 0);
|
|
247
257
|
this.publish(sessionKey);
|
|
248
258
|
}
|
|
@@ -294,7 +304,7 @@ var SessionInputCoordinator = class {
|
|
|
294
304
|
while (true) {
|
|
295
305
|
const row = findSessionInput(sessionKey, clientMessageId);
|
|
296
306
|
if (!row) throw new Error("Session input disappeared before completion");
|
|
297
|
-
if (row.status === "completed") return;
|
|
307
|
+
if (row.status === "completed" || row.status === "suspended") return;
|
|
298
308
|
if (row.status === "failed" || row.status === "cancelled" || row.status === "interrupted") throw new Error(row.error ?? `Session input ended with status ${row.status}`);
|
|
299
309
|
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
300
310
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConnectionRecoveryService } from '../connectors/connection-recovery-service.js';
|
|
1
2
|
import { AgentService } from '../agent/service.js';
|
|
2
3
|
import { MessageBus } from '../infra/bus/index.js';
|
|
3
4
|
import { AutomationService } from '../automations/index.js';
|
|
@@ -135,6 +136,7 @@ export declare class GatewayService {
|
|
|
135
136
|
}>;
|
|
136
137
|
dispatchTaskEvents(): void;
|
|
137
138
|
runAgent(...args: Parameters<GatewayAgentRunner['runAgent']>): ReturnType<GatewayAgentRunner['runAgent']>;
|
|
139
|
+
readonly connectionRecovery: ConnectionRecoveryService;
|
|
138
140
|
submitSessionInput(...args: Parameters<GatewayAgentRunner['submitSessionInput']>): Promise<{
|
|
139
141
|
ok: true;
|
|
140
142
|
effectiveDelivery: import("../storage/sqlite/session-input-repository.js").SessionInputDelivery;
|
|
@@ -325,7 +327,7 @@ export declare class GatewayService {
|
|
|
325
327
|
/** Effective HTTP listen port (CLI `--port` override or config default). */
|
|
326
328
|
getEffectiveListenPort(): number;
|
|
327
329
|
get automationServiceInstance(): AutomationService;
|
|
328
|
-
private
|
|
330
|
+
private reconcileMemoryMaintenanceAutomations;
|
|
329
331
|
get notesServiceInstance(): NotesService;
|
|
330
332
|
get sessionIndexInstance(): SessionIndex;
|
|
331
333
|
/** Shared workflow run orchestrator + session bridge (one instance per gateway). */
|
|
@@ -7,6 +7,7 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
7
7
|
import { init_logger } from "../utils/logger.js";
|
|
8
8
|
import { closeXopcDatabase, openXopcDatabase } from "../storage/sqlite/connection.js";
|
|
9
9
|
import { notifyUserContextChange } from "../user-context/changes.js";
|
|
10
|
+
import { insertSessionInput } from "../storage/sqlite/session-input-repository.js";
|
|
10
11
|
import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
11
12
|
import "../storage/sqlite/index.js";
|
|
12
13
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
@@ -23,6 +24,7 @@ import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
|
23
24
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
24
25
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
25
26
|
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
27
|
+
import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
|
|
26
28
|
import { disposeAllSessionMcpRuntimes } from "../agent/mcp/bundle-mcp-runtime.js";
|
|
27
29
|
import { ProjectService } from "../projects/project-service.js";
|
|
28
30
|
import { resolveProjectAgentId } from "../projects/project-agent.js";
|
|
@@ -43,7 +45,6 @@ import { SessionIndex } from "../session/manager.js";
|
|
|
43
45
|
import "../session/index.js";
|
|
44
46
|
import { ExtensionLoader } from "../extensions/loader.js";
|
|
45
47
|
import "../extensions/index.js";
|
|
46
|
-
import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
|
|
47
48
|
import { MessageBus, MessageBusShutdownError } from "../infra/bus/queue.js";
|
|
48
49
|
import "../infra/bus/index.js";
|
|
49
50
|
import { AgentService } from "../agent/service.js";
|
|
@@ -56,6 +57,7 @@ import "../config/index.js";
|
|
|
56
57
|
import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
|
|
57
58
|
import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
|
|
58
59
|
import "../knowledge/index.js";
|
|
60
|
+
import { ConnectionRecoveryService } from "../connectors/connection-recovery-service.js";
|
|
59
61
|
import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
|
|
60
62
|
import { ConnectedSourceChangePublisher } from "../connectors/source-change-publisher.js";
|
|
61
63
|
import { startConnectorSupervisor } from "../connectors/supervisor.js";
|
|
@@ -70,7 +72,6 @@ import "../endpoint-tools/index.js";
|
|
|
70
72
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
71
73
|
import { prepareAutomationAgentSession } from "./automation-agent-session.js";
|
|
72
74
|
import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
|
|
73
|
-
import { reconcileDreamingAutomations } from "./dreaming-automation-reconciler.js";
|
|
74
75
|
import { buildVoiceMemoryContext } from "../voice/realtime/memory-context.js";
|
|
75
76
|
import { voiceMemoryBudget } from "../voice/realtime/conversation-context.js";
|
|
76
77
|
import { NotesStore } from "../notes/store.js";
|
|
@@ -120,10 +121,11 @@ import { GatewayConfigCoordinator } from "./service/config-coordinator.js";
|
|
|
120
121
|
import { GatewayAgentRunner } from "./service/agent-runner.js";
|
|
121
122
|
import { RealtimeRuntime } from "../realtime/runtime.js";
|
|
122
123
|
import { VoiceRealtimeRuntime } from "../voice/realtime/runtime.js";
|
|
124
|
+
import { reconcileMemoryMaintenanceAutomations } from "./memory-maintenance-automation-reconciler.js";
|
|
123
125
|
import { GatewayReadiness } from "./startup-readiness.js";
|
|
124
126
|
import { createGatewayStartupTrace } from "./startup-trace.js";
|
|
125
127
|
import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
|
|
126
|
-
import crypto from "crypto";
|
|
128
|
+
import crypto from "node:crypto";
|
|
127
129
|
//#region src/gateway/service.ts
|
|
128
130
|
init_agent_scope();
|
|
129
131
|
init_channel_catalog_service();
|
|
@@ -434,6 +436,7 @@ var GatewayService = class {
|
|
|
434
436
|
emit: (type, payload) => this.emit(type, payload)
|
|
435
437
|
});
|
|
436
438
|
this.agentRunner = new GatewayAgentRunner({
|
|
439
|
+
validateConnectionResume: (input) => this.connectionRecovery.preflight(input),
|
|
437
440
|
bus: this.bus,
|
|
438
441
|
sessionIndex: this.sessionIndex,
|
|
439
442
|
getAgentService: () => this.ensureAgentService(),
|
|
@@ -463,7 +466,12 @@ var GatewayService = class {
|
|
|
463
466
|
loadParentMessages: (sessionKey) => this.sessionIndex.getStore().load(sessionKey),
|
|
464
467
|
getDefaultModelRef: (sessionKey) => this.ensureAgentService().getModelForSession(sessionKey),
|
|
465
468
|
getWorkspacePath: (metadata) => metadata.cwd || this.currentWorkspacePath,
|
|
466
|
-
onBeforeDispose: (sideChatId, clientInstanceId) => sideChatRuns?.
|
|
469
|
+
onBeforeDispose: (sideChatId, clientInstanceId) => sideChatRuns?.cancelRun(sideChatId, clientInstanceId).then(() => void 0),
|
|
470
|
+
onExpired: (sideChatId, clientInstanceId, reason) => {
|
|
471
|
+
const topic = `side-chat:${clientInstanceId}:${sideChatId}`;
|
|
472
|
+
this.realtime.broker.publish(topic, "expired", { reason });
|
|
473
|
+
this.realtime.completeTopic(topic);
|
|
474
|
+
}
|
|
467
475
|
});
|
|
468
476
|
this.sideChatRuns = sideChatRuns = new SideChatRunService({
|
|
469
477
|
manager: this.sideChats,
|
|
@@ -500,7 +508,7 @@ var GatewayService = class {
|
|
|
500
508
|
getHeartbeatService: () => this.heartbeatService,
|
|
501
509
|
getExtensionLoader: () => this.extensionLoader,
|
|
502
510
|
reconcileBrowserExtensionServer: () => this.reconcileBrowserExtensionServer(),
|
|
503
|
-
|
|
511
|
+
reconcileMemoryMaintenanceAutomations: () => this.reconcileMemoryMaintenanceAutomations(),
|
|
504
512
|
getChannelsStatus: () => this.getChannelsStatus(),
|
|
505
513
|
emit: (type, payload) => this.emit(type, payload)
|
|
506
514
|
});
|
|
@@ -635,11 +643,26 @@ var GatewayService = class {
|
|
|
635
643
|
})).sessionKey;
|
|
636
644
|
},
|
|
637
645
|
runAgent: async (runId, sessionKey, message) => {
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
646
|
+
const clientMessageId = `task:${runId}`;
|
|
647
|
+
const session = await this.sessionIndex.getSessionMetadata(sessionKey);
|
|
648
|
+
if (!session) throw new Error("Task session is unavailable");
|
|
649
|
+
insertSessionInput({
|
|
650
|
+
id: crypto.randomUUID(),
|
|
651
|
+
sessionKey,
|
|
652
|
+
clientMessageId,
|
|
653
|
+
expectedSessionId: session.sessionId,
|
|
654
|
+
requestedDelivery: "next",
|
|
655
|
+
effectiveDelivery: "next",
|
|
656
|
+
status: "queued",
|
|
657
|
+
content: message,
|
|
658
|
+
origin: {
|
|
659
|
+
type: "system",
|
|
660
|
+
source: "workflow"
|
|
661
|
+
},
|
|
662
|
+
taskRunId: runId
|
|
663
|
+
});
|
|
664
|
+
this.agentRunner.inputs.drain(sessionKey);
|
|
665
|
+
await this.agentRunner.inputs.waitForCompletion(sessionKey, clientMessageId);
|
|
643
666
|
}
|
|
644
667
|
});
|
|
645
668
|
return this.taskRunDispatcher;
|
|
@@ -724,6 +747,13 @@ var GatewayService = class {
|
|
|
724
747
|
runAgent(...args) {
|
|
725
748
|
return this.agentRunner.runAgent(...args);
|
|
726
749
|
}
|
|
750
|
+
connectionRecovery = new ConnectionRecoveryService({
|
|
751
|
+
getConfig: () => this.config,
|
|
752
|
+
saveConfig: (config) => this.saveConfig(config),
|
|
753
|
+
drain: (sessionKey) => {
|
|
754
|
+
this.agentRunner.inputs.drain(sessionKey);
|
|
755
|
+
}
|
|
756
|
+
});
|
|
727
757
|
submitSessionInput(...args) {
|
|
728
758
|
return this.agentRunner.submitSessionInput(...args);
|
|
729
759
|
}
|
|
@@ -897,6 +927,7 @@ var GatewayService = class {
|
|
|
897
927
|
registerClarifyBridge(this.agentRunner.getClarifyBridge());
|
|
898
928
|
this.ensureAgentService();
|
|
899
929
|
this.agentRunner.recoverSessionInputs();
|
|
930
|
+
this.connectionRecovery.start();
|
|
900
931
|
this.channelManager.setOutboundHooks({
|
|
901
932
|
runMessageSending: (to, content, channel) => this.agentService.outboundCoordinator.invokeOutboundMessageSending(to, content, channel),
|
|
902
933
|
runMessageSent: (to, content, success, error, channel) => this.agentService.outboundCoordinator.invokeOutboundMessageSent(to, content, success, error, channel)
|
|
@@ -1010,7 +1041,7 @@ var GatewayService = class {
|
|
|
1010
1041
|
});
|
|
1011
1042
|
});
|
|
1012
1043
|
await trace.measure("automations.initialize", () => this.automationService.initialize());
|
|
1013
|
-
await trace.measure("
|
|
1044
|
+
await trace.measure("memoryMaintenance.reconcile", () => this.reconcileMemoryMaintenanceAutomations());
|
|
1014
1045
|
await this.notesService.initialize();
|
|
1015
1046
|
this.discussionLiveWorker.start();
|
|
1016
1047
|
this.discussionSealer.start();
|
|
@@ -1023,7 +1054,6 @@ var GatewayService = class {
|
|
|
1023
1054
|
this.connectorLearningCoordinator = startConnectorLearningCoordinator({
|
|
1024
1055
|
getConfig: () => this.config,
|
|
1025
1056
|
resolveAgentId: () => resolveDefaultAgentId(this.config),
|
|
1026
|
-
getMemoryManager: () => this.agentService.getMemoryManager(),
|
|
1027
1057
|
emit: (type, payload) => this.emit(type, payload)
|
|
1028
1058
|
});
|
|
1029
1059
|
this.managedComposioEventPoller = new ManagedComposioEventPoller({
|
|
@@ -1208,6 +1238,7 @@ var GatewayService = class {
|
|
|
1208
1238
|
this.browserExtensionProvider = null;
|
|
1209
1239
|
this.browserExtensionBindKey = null;
|
|
1210
1240
|
registerClarifyBridge(null);
|
|
1241
|
+
this.connectionRecovery.stop();
|
|
1211
1242
|
this.agentRunner.disposeClarifyBridge();
|
|
1212
1243
|
await disposeAllSessionMcpRuntimes().catch((err) => {
|
|
1213
1244
|
log.warn({ err }, "MCP runtime shutdown failed");
|
|
@@ -1554,8 +1585,8 @@ var GatewayService = class {
|
|
|
1554
1585
|
get automationServiceInstance() {
|
|
1555
1586
|
return this.automationService;
|
|
1556
1587
|
}
|
|
1557
|
-
async
|
|
1558
|
-
await
|
|
1588
|
+
async reconcileMemoryMaintenanceAutomations() {
|
|
1589
|
+
await reconcileMemoryMaintenanceAutomations({
|
|
1559
1590
|
config: this.config,
|
|
1560
1591
|
automationService: this.automationService
|
|
1561
1592
|
});
|
|
@@ -3,8 +3,9 @@ import { InMemoryTranscriptRuntime } from '../../agent/embedded/transcript-runti
|
|
|
3
3
|
import type { SessionMetadata } from '../../session/types.js';
|
|
4
4
|
import type { CreateSideChatInput, SideChatConfig, SideChatStatus, SideChatView } from './types.js';
|
|
5
5
|
export declare class SideChatError extends Error {
|
|
6
|
-
readonly code: 'INVALID_REQUEST' | 'NOT_FOUND' | 'LIMIT_REACHED' | 'CONFLICT';
|
|
7
|
-
|
|
6
|
+
readonly code: 'INVALID_REQUEST' | 'NOT_FOUND' | 'PARENT_NOT_FOUND' | 'LIMIT_REACHED' | 'CAPACITY_REACHED' | 'CONFLICT' | 'EXPIRED';
|
|
7
|
+
readonly reason?: 'idle' | 'waiting';
|
|
8
|
+
constructor(message: string, code: 'INVALID_REQUEST' | 'NOT_FOUND' | 'PARENT_NOT_FOUND' | 'LIMIT_REACHED' | 'CAPACITY_REACHED' | 'CONFLICT' | 'EXPIRED', reason?: 'idle' | 'waiting');
|
|
8
9
|
}
|
|
9
10
|
export interface EphemeralSideChatManagerOptions {
|
|
10
11
|
getParentMetadata: (sessionKey: string) => Promise<SessionMetadata | null>;
|
|
@@ -17,10 +18,15 @@ export interface EphemeralSideChatManagerOptions {
|
|
|
17
18
|
now?: () => number;
|
|
18
19
|
startSweepTimer?: boolean;
|
|
19
20
|
onBeforeDispose?: (sideChatId: string, clientInstanceId: string) => void | Promise<void>;
|
|
21
|
+
onExpired?: (sideChatId: string, clientInstanceId: string, reason: 'idle' | 'waiting') => void;
|
|
20
22
|
}
|
|
21
23
|
export declare class EphemeralSideChatManager {
|
|
22
24
|
private readonly options;
|
|
23
25
|
private readonly entries;
|
|
26
|
+
private readonly reservations;
|
|
27
|
+
private readonly expired;
|
|
28
|
+
private readonly disposals;
|
|
29
|
+
private stopped;
|
|
24
30
|
private readonly now;
|
|
25
31
|
private readonly idleTtlMs;
|
|
26
32
|
private readonly maxPerClient;
|
|
@@ -28,17 +34,24 @@ export declare class EphemeralSideChatManager {
|
|
|
28
34
|
private readonly sweepTimer;
|
|
29
35
|
constructor(options: EphemeralSideChatManagerOptions);
|
|
30
36
|
create(input: CreateSideChatInput): Promise<SideChatView>;
|
|
37
|
+
private createEntry;
|
|
31
38
|
get(id: string, clientInstanceId: string): SideChatView;
|
|
32
39
|
getRuntime(id: string, clientInstanceId: string): InMemoryTranscriptRuntime;
|
|
33
40
|
getMessages(id: string, clientInstanceId: string): AgentMessage[];
|
|
34
41
|
updateConfig(id: string, clientInstanceId: string, patch: Partial<SideChatConfig>): SideChatView;
|
|
35
42
|
heartbeat(id: string, clientInstanceId: string): SideChatView;
|
|
36
|
-
|
|
43
|
+
extend(id: string, clientInstanceId: string): SideChatView;
|
|
44
|
+
setStatus(id: string, clientInstanceId: string, status: SideChatStatus, runId?: string): SideChatView;
|
|
45
|
+
waitForInput(id: string, clientInstanceId: string, clarification: NonNullable<SideChatView['clarification']>, status?: 'waiting-input' | 'waiting-approval'): void;
|
|
37
46
|
dispose(id: string, clientInstanceId: string): Promise<boolean>;
|
|
38
47
|
disposeClient(clientInstanceId: string): Promise<number>;
|
|
39
48
|
sweepExpired(at?: number): Promise<number>;
|
|
40
49
|
disposeAll(): Promise<void>;
|
|
41
50
|
private requireEntry;
|
|
51
|
+
private isExpired;
|
|
52
|
+
private expireEntry;
|
|
53
|
+
private pruneExpiredRecords;
|
|
54
|
+
private toView;
|
|
42
55
|
private touchEntry;
|
|
43
56
|
private runBeforeDispose;
|
|
44
57
|
}
|