@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
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ConnectionCheckpoint, ConnectionNeed, ConnectionWait } from '@xopcai/gateway-contract';
|
|
2
|
+
import { type SessionInput } from './session-input-repository.js';
|
|
3
|
+
export declare function onConnectionWaitChanged(listener: (sessionKey: string) => void): () => void;
|
|
4
|
+
export declare function publishConnectionWait(sessionKey: string): void;
|
|
5
|
+
export declare function getConnectionWait(id: string): ConnectionWait | undefined;
|
|
6
|
+
export declare function getActiveConnectionWait(sessionKey: string): ConnectionWait | undefined;
|
|
7
|
+
export declare function isConnectionSuspended(sessionKey: string, runId: string): boolean;
|
|
8
|
+
export declare function updateConnectionWait(wait: ConnectionWait, expectedVersion: number): ConnectionWait;
|
|
9
|
+
export declare function requireSessionConnection(input: {
|
|
10
|
+
sessionKey: string;
|
|
11
|
+
principalId: string;
|
|
12
|
+
agentId: string;
|
|
13
|
+
summary: string;
|
|
14
|
+
needs: ConnectionNeed[];
|
|
15
|
+
checkpoint?: Omit<ConnectionCheckpoint, 'entryId'>;
|
|
16
|
+
}): {
|
|
17
|
+
status: 'connection_required' | 'skipped' | 'objective_conflict';
|
|
18
|
+
waitId?: string;
|
|
19
|
+
};
|
|
20
|
+
/** The input and the wait transition commit together, using the existing queue's unique key. */
|
|
21
|
+
export declare function queueConnectionResolution(wait: ConnectionWait, resolution: 'continued' | 'skipped'): ConnectionWait;
|
|
22
|
+
export declare function consumeConnectionResume(input: SessionInput): boolean;
|
|
23
|
+
export declare function connectionBindings(sessionKey: string): ConnectionNeed[];
|
|
24
|
+
export declare function connectionBinding(sessionKey: string, connectorId: string): string | undefined;
|
|
25
|
+
/** New input wins over an outstanding auto-resume intent, including an already queued resume. */
|
|
26
|
+
export declare function invalidateConnectionResumeIntent(sessionKey: string): void;
|
|
27
|
+
export declare function reviseCurrentConnectionObjective(sessionKey: string, summary: string | undefined): void;
|
|
28
|
+
export declare function cancelConnectionObjective(sessionKey: string): void;
|
|
29
|
+
export declare function getConnectionResumeInput(sessionKey: string, runId: string): SessionInput | undefined;
|
|
30
|
+
export declare function listConnectionWaitsToCheck(): ConnectionWait[];
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { createLogger } from "../../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { isXopcDatabaseOpen } from "./connection.js";
|
|
4
|
+
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
5
|
+
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
6
|
+
import { readCurrentSessionId } from "./session-repository.js";
|
|
7
|
+
import { bumpSessionInputRevision, getSessionInputById, getSessionInputState, insertSessionInput, setSessionInputStatus } from "./session-input-repository.js";
|
|
8
|
+
import { randomUUID } from "node:crypto";
|
|
9
|
+
import { EventEmitter } from "node:events";
|
|
10
|
+
//#region src/storage/sqlite/connection-wait-repository.ts
|
|
11
|
+
init_logger();
|
|
12
|
+
const log = createLogger("Connectors:Wait");
|
|
13
|
+
const events = new EventEmitter();
|
|
14
|
+
function onConnectionWaitChanged(listener) {
|
|
15
|
+
events.on("changed", listener);
|
|
16
|
+
return () => {
|
|
17
|
+
events.off("changed", listener);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function publishConnectionWait(sessionKey) {
|
|
21
|
+
events.emit("changed", sessionKey);
|
|
22
|
+
}
|
|
23
|
+
function getConnectionWait(id) {
|
|
24
|
+
if (!isXopcDatabaseOpen()) return void 0;
|
|
25
|
+
const row = getSqliteDatabase().prepare("SELECT data_json FROM session_connection_waits WHERE id = ?").get(id);
|
|
26
|
+
return row ? JSON.parse(row.data_json) : void 0;
|
|
27
|
+
}
|
|
28
|
+
function getActiveConnectionWait(sessionKey) {
|
|
29
|
+
if (!isXopcDatabaseOpen()) return void 0;
|
|
30
|
+
const db = getSqliteDatabase();
|
|
31
|
+
const row = db.prepare(`SELECT data_json FROM session_connection_waits WHERE session_key = ? AND session_id = ?
|
|
32
|
+
AND status IN ('open','queued')`).get(sessionKey, readCurrentSessionId(db, sessionKey) ?? "");
|
|
33
|
+
return row ? JSON.parse(row.data_json) : void 0;
|
|
34
|
+
}
|
|
35
|
+
function isConnectionSuspended(sessionKey, runId) {
|
|
36
|
+
const wait = getActiveConnectionWait(sessionKey);
|
|
37
|
+
return Boolean(wait && wait.originRunId === runId);
|
|
38
|
+
}
|
|
39
|
+
function updateConnectionWait(wait, expectedVersion) {
|
|
40
|
+
return runSqliteWriteTransaction((db) => {
|
|
41
|
+
if (readCurrentSessionId(db, wait.sessionKey) !== wait.sessionId) throw new Error("SESSION_CHANGED");
|
|
42
|
+
const next = {
|
|
43
|
+
...wait,
|
|
44
|
+
version: expectedVersion + 1,
|
|
45
|
+
updatedAt: Date.now()
|
|
46
|
+
};
|
|
47
|
+
if (!db.prepare(`UPDATE session_connection_waits SET status = ?, version = ?, data_json = ? WHERE id = ? AND version = ?`).run(next.status, next.version, JSON.stringify(next), next.id, expectedVersion).changes) throw new Error("WAIT_CHANGED");
|
|
48
|
+
bumpSessionInputRevision(db, wait.sessionKey);
|
|
49
|
+
return next;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function requireSessionConnection(input) {
|
|
53
|
+
return runSqliteWriteTransaction((db) => {
|
|
54
|
+
const sessionId = readCurrentSessionId(db, input.sessionKey);
|
|
55
|
+
const runtime = getSessionInputState(input.sessionKey);
|
|
56
|
+
const origin = runtime.activeInputId ? getSessionInputById(input.sessionKey, runtime.activeInputId) : void 0;
|
|
57
|
+
if (!sessionId || !origin || !runtime.activeRunId) throw new Error("Connection recovery requires a queued chat execution.");
|
|
58
|
+
const resumed = origin.payload ? getConnectionWait(origin.payload.waitId) : void 0;
|
|
59
|
+
if (resumed?.resolution === "skipped") return { status: "skipped" };
|
|
60
|
+
const active = getActiveConnectionWait(input.sessionKey);
|
|
61
|
+
if (active) {
|
|
62
|
+
if (active.originInputId !== origin.id && active.objectiveId !== resumed?.objectiveId) return {
|
|
63
|
+
status: "objective_conflict",
|
|
64
|
+
waitId: active.id
|
|
65
|
+
};
|
|
66
|
+
const needs = new Map(active.needs.map((need) => [need.key, need]));
|
|
67
|
+
for (const need of input.needs) {
|
|
68
|
+
const previous = needs.get(need.key);
|
|
69
|
+
needs.set(need.key, previous ? {
|
|
70
|
+
...previous,
|
|
71
|
+
capabilities: [...new Set([...previous.capabilities, ...need.capabilities])]
|
|
72
|
+
} : need);
|
|
73
|
+
}
|
|
74
|
+
if (JSON.stringify([...needs.values()]) !== JSON.stringify(active.needs)) updateConnectionWait({
|
|
75
|
+
...active,
|
|
76
|
+
needs: [...needs.values()]
|
|
77
|
+
}, active.version);
|
|
78
|
+
return {
|
|
79
|
+
status: "connection_required",
|
|
80
|
+
waitId: active.id
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const lastEntry = db.prepare("SELECT entry_id FROM transcript_entries WHERE session_id = ? ORDER BY seq DESC LIMIT 1").get(sessionId);
|
|
84
|
+
const wait = {
|
|
85
|
+
...input,
|
|
86
|
+
needs: [...new Map(input.needs.map((need) => [need.key, need])).values()],
|
|
87
|
+
id: randomUUID(),
|
|
88
|
+
sessionId,
|
|
89
|
+
objectiveId: resumed?.objectiveId ?? origin.id,
|
|
90
|
+
objectiveRevision: (resumed?.objectiveRevision ?? 0) + 1,
|
|
91
|
+
objectiveUpdatedAt: resumed?.objectiveUpdatedAt ?? origin.createdAtMs,
|
|
92
|
+
originInputId: origin.id,
|
|
93
|
+
originRunId: runtime.activeRunId,
|
|
94
|
+
taskRunId: origin.taskRunId,
|
|
95
|
+
checkpoint: {
|
|
96
|
+
entryId: lastEntry?.entry_id,
|
|
97
|
+
completedSteps: input.checkpoint?.completedSteps ?? [],
|
|
98
|
+
pendingSteps: input.checkpoint?.pendingSteps ?? [input.summary],
|
|
99
|
+
timeRange: input.checkpoint?.timeRange ?? resumed?.checkpoint.timeRange
|
|
100
|
+
},
|
|
101
|
+
summary: resumed?.summary ?? origin.content,
|
|
102
|
+
status: "open",
|
|
103
|
+
version: 1,
|
|
104
|
+
createdAt: Date.now(),
|
|
105
|
+
updatedAt: Date.now()
|
|
106
|
+
};
|
|
107
|
+
db.prepare(`INSERT INTO session_connection_waits(id,principal_id,session_key,session_id,status,version,data_json) VALUES (?,?,?,?,?,?,?)`).run(wait.id, wait.principalId, wait.sessionKey, wait.sessionId, wait.status, wait.version, JSON.stringify(wait));
|
|
108
|
+
if (wait.taskRunId) {
|
|
109
|
+
const runs = new TaskRunRepository();
|
|
110
|
+
const run = runs.get(wait.taskRunId);
|
|
111
|
+
if (run) {
|
|
112
|
+
runs.createWait({
|
|
113
|
+
taskId: run.taskId,
|
|
114
|
+
taskRunId: run.id,
|
|
115
|
+
kind: "user_input",
|
|
116
|
+
reason: input.summary,
|
|
117
|
+
condition: {
|
|
118
|
+
type: "connection",
|
|
119
|
+
connectionWaitId: wait.id
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
runs.setStatus({
|
|
123
|
+
runId: run.id,
|
|
124
|
+
expectedVersion: run.version,
|
|
125
|
+
from: [run.status],
|
|
126
|
+
to: "waiting",
|
|
127
|
+
actor: { kind: "system" }
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
bumpSessionInputRevision(db, wait.sessionKey);
|
|
132
|
+
log.info({
|
|
133
|
+
sessionKey: wait.sessionKey,
|
|
134
|
+
waitId: wait.id,
|
|
135
|
+
objectiveRevision: wait.objectiveRevision,
|
|
136
|
+
runId: wait.originRunId,
|
|
137
|
+
phase: "waiting"
|
|
138
|
+
}, "Connection requirement saved");
|
|
139
|
+
return {
|
|
140
|
+
status: "connection_required",
|
|
141
|
+
waitId: wait.id
|
|
142
|
+
};
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/** The input and the wait transition commit together, using the existing queue's unique key. */
|
|
146
|
+
function queueConnectionResolution(wait, resolution) {
|
|
147
|
+
return runSqliteWriteTransaction(() => {
|
|
148
|
+
const current = getConnectionWait(wait.id);
|
|
149
|
+
if (!current || current.version !== wait.version || current.status !== "open") throw new Error("WAIT_CHANGED");
|
|
150
|
+
const origin = getSessionInputById(wait.sessionKey, wait.originInputId);
|
|
151
|
+
if (!origin) throw new Error("Original input is unavailable.");
|
|
152
|
+
const input = insertSessionInput({
|
|
153
|
+
id: randomUUID(),
|
|
154
|
+
sessionKey: wait.sessionKey,
|
|
155
|
+
expectedSessionId: wait.sessionId,
|
|
156
|
+
clientMessageId: `connection:${wait.id}:${wait.objectiveRevision}:${resolution}`,
|
|
157
|
+
requestedDelivery: "next",
|
|
158
|
+
effectiveDelivery: "next",
|
|
159
|
+
status: "queued",
|
|
160
|
+
content: resolution === "skipped" ? `The user skipped the requested connection. Continue this objective using only available information: ${wait.summary}. Do not request these connections again or claim to have read their data.` : `Recovery checkpoint: ${JSON.stringify(wait.checkpoint)}. The user chose to continue the request originally made at ${new Date(wait.objectiveUpdatedAt).toISOString()}: ${wait.summary}. Interpret relative dates against that original request time, unless the user explicitly changed them. The connection requirement has been checked. Search and describe tools again before using them. Use the explicitly selected account. Do not repeat already completed actions.`,
|
|
161
|
+
origin: {
|
|
162
|
+
type: "system",
|
|
163
|
+
source: "internal"
|
|
164
|
+
},
|
|
165
|
+
thinking: origin.thinking,
|
|
166
|
+
contextRefs: origin.contextRefs,
|
|
167
|
+
contextSnapshots: origin.contextSnapshots,
|
|
168
|
+
kind: "connection_resume",
|
|
169
|
+
taskRunId: wait.taskRunId,
|
|
170
|
+
payload: {
|
|
171
|
+
waitId: wait.id,
|
|
172
|
+
objectiveRevision: wait.objectiveRevision,
|
|
173
|
+
resolution
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
return updateConnectionWait({
|
|
177
|
+
...wait,
|
|
178
|
+
status: "queued",
|
|
179
|
+
resolution,
|
|
180
|
+
queuedInputId: input.id
|
|
181
|
+
}, wait.version);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function consumeConnectionResume(input) {
|
|
185
|
+
if (input.kind !== "connection_resume") return true;
|
|
186
|
+
return runSqliteWriteTransaction(() => {
|
|
187
|
+
const wait = input.payload ? getConnectionWait(input.payload.waitId) : void 0;
|
|
188
|
+
if (!wait || wait.status !== "queued" || wait.queuedInputId !== input.id || wait.objectiveRevision !== input.payload?.objectiveRevision) return false;
|
|
189
|
+
if (readCurrentSessionId(getSqliteDatabase(), input.sessionKey) !== wait.sessionId) return false;
|
|
190
|
+
if (wait.taskRunId) {
|
|
191
|
+
const runs = new TaskRunRepository();
|
|
192
|
+
const run = runs.get(wait.taskRunId);
|
|
193
|
+
if (!run || run.status !== "waiting") return false;
|
|
194
|
+
const taskWaits = runs.listActiveWaits(run.taskId);
|
|
195
|
+
if (taskWaits.some((item) => item.taskRunId === run.id && item.condition.connectionWaitId !== wait.id)) {
|
|
196
|
+
updateConnectionWait({
|
|
197
|
+
...wait,
|
|
198
|
+
status: "open",
|
|
199
|
+
intent: void 0,
|
|
200
|
+
queuedInputId: void 0,
|
|
201
|
+
objectiveRevision: wait.objectiveRevision + 1
|
|
202
|
+
}, wait.version);
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
for (const taskWait of taskWaits) if (taskWait.condition.connectionWaitId === wait.id) runs.resolveWait({
|
|
206
|
+
waitId: taskWait.id,
|
|
207
|
+
actor: { kind: "system" },
|
|
208
|
+
resolution: { connectionWaitId: wait.id }
|
|
209
|
+
});
|
|
210
|
+
runs.setStatus({
|
|
211
|
+
runId: run.id,
|
|
212
|
+
expectedVersion: run.version,
|
|
213
|
+
from: ["waiting"],
|
|
214
|
+
to: "running",
|
|
215
|
+
actor: { kind: "system" }
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
updateConnectionWait({
|
|
219
|
+
...wait,
|
|
220
|
+
status: "closed"
|
|
221
|
+
}, wait.version);
|
|
222
|
+
return true;
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
function connectionBindings(sessionKey) {
|
|
226
|
+
if (!isXopcDatabaseOpen()) return [];
|
|
227
|
+
const state = getSessionInputState(sessionKey);
|
|
228
|
+
const input = state.activeInputId ? getSessionInputById(sessionKey, state.activeInputId) : void 0;
|
|
229
|
+
return input?.payload ? getConnectionWait(input.payload.waitId)?.needs ?? [] : [];
|
|
230
|
+
}
|
|
231
|
+
function connectionBinding(sessionKey, connectorId) {
|
|
232
|
+
const matches = connectionBindings(sessionKey).filter((need) => need.connectorId === connectorId);
|
|
233
|
+
return matches.length === 1 ? matches[0].connectionId : void 0;
|
|
234
|
+
}
|
|
235
|
+
/** New input wins over an outstanding auto-resume intent, including an already queued resume. */
|
|
236
|
+
function invalidateConnectionResumeIntent(sessionKey) {
|
|
237
|
+
const wait = getActiveConnectionWait(sessionKey);
|
|
238
|
+
if (!wait) return;
|
|
239
|
+
runSqliteWriteTransaction(() => {
|
|
240
|
+
if (wait.queuedInputId) setSessionInputStatus(wait.queuedInputId, "cancelled");
|
|
241
|
+
updateConnectionWait({
|
|
242
|
+
...wait,
|
|
243
|
+
status: "open",
|
|
244
|
+
intent: void 0,
|
|
245
|
+
queuedInputId: void 0,
|
|
246
|
+
objectiveRevision: wait.objectiveRevision + 1,
|
|
247
|
+
scopeConfirmedAt: void 0,
|
|
248
|
+
reviewRequired: true
|
|
249
|
+
}, wait.version);
|
|
250
|
+
});
|
|
251
|
+
publishConnectionWait(sessionKey);
|
|
252
|
+
}
|
|
253
|
+
function reviseCurrentConnectionObjective(sessionKey, summary) {
|
|
254
|
+
const wait = getActiveConnectionWait(sessionKey);
|
|
255
|
+
if (!wait) throw new Error("No connection objective is waiting.");
|
|
256
|
+
if (!summary) {
|
|
257
|
+
cancelConnectionObjective(sessionKey);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
runSqliteWriteTransaction(() => {
|
|
261
|
+
if (wait.queuedInputId) setSessionInputStatus(wait.queuedInputId, "cancelled");
|
|
262
|
+
updateConnectionWait({
|
|
263
|
+
...wait,
|
|
264
|
+
summary,
|
|
265
|
+
objectiveUpdatedAt: Date.now(),
|
|
266
|
+
checkpoint: {
|
|
267
|
+
...wait.checkpoint,
|
|
268
|
+
pendingSteps: [summary],
|
|
269
|
+
timeRange: void 0
|
|
270
|
+
},
|
|
271
|
+
status: "open",
|
|
272
|
+
resolution: void 0,
|
|
273
|
+
intent: void 0,
|
|
274
|
+
queuedInputId: void 0,
|
|
275
|
+
scopeConfirmedAt: void 0,
|
|
276
|
+
reviewRequired: true,
|
|
277
|
+
objectiveRevision: wait.objectiveRevision + 1
|
|
278
|
+
}, wait.version);
|
|
279
|
+
});
|
|
280
|
+
publishConnectionWait(sessionKey);
|
|
281
|
+
}
|
|
282
|
+
function cancelConnectionObjective(sessionKey) {
|
|
283
|
+
const wait = getActiveConnectionWait(sessionKey);
|
|
284
|
+
if (!wait) return;
|
|
285
|
+
runSqliteWriteTransaction(() => {
|
|
286
|
+
if (wait.queuedInputId) setSessionInputStatus(wait.queuedInputId, "cancelled");
|
|
287
|
+
if (wait.taskRunId) {
|
|
288
|
+
const runs = new TaskRunRepository();
|
|
289
|
+
const run = runs.get(wait.taskRunId);
|
|
290
|
+
if (run?.status === "waiting") {
|
|
291
|
+
for (const taskWait of runs.listActiveWaits(run.taskId)) if (taskWait.condition.connectionWaitId === wait.id) runs.resolveWait({
|
|
292
|
+
waitId: taskWait.id,
|
|
293
|
+
actor: { kind: "system" },
|
|
294
|
+
resolution: { cancelled: true }
|
|
295
|
+
});
|
|
296
|
+
runs.finalize({
|
|
297
|
+
runId: run.id,
|
|
298
|
+
expectedVersion: run.version,
|
|
299
|
+
receipt: {
|
|
300
|
+
status: "cancelled",
|
|
301
|
+
summary: "Connection objective cancelled",
|
|
302
|
+
changes: [],
|
|
303
|
+
evidence: [],
|
|
304
|
+
verification: {
|
|
305
|
+
status: "unverified",
|
|
306
|
+
checks: []
|
|
307
|
+
},
|
|
308
|
+
remainingWork: [],
|
|
309
|
+
needsUser: false,
|
|
310
|
+
completionVerdict: "not_achieved"
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
updateConnectionWait({
|
|
316
|
+
...wait,
|
|
317
|
+
status: "closed",
|
|
318
|
+
resolution: "cancelled",
|
|
319
|
+
intent: void 0
|
|
320
|
+
}, wait.version);
|
|
321
|
+
});
|
|
322
|
+
publishConnectionWait(sessionKey);
|
|
323
|
+
}
|
|
324
|
+
function getConnectionResumeInput(sessionKey, runId) {
|
|
325
|
+
if (!isXopcDatabaseOpen()) return void 0;
|
|
326
|
+
const state = getSessionInputState(sessionKey);
|
|
327
|
+
if (state.activeRunId !== runId || !state.activeInputId) return void 0;
|
|
328
|
+
const input = getSessionInputById(sessionKey, state.activeInputId);
|
|
329
|
+
return input?.kind === "connection_resume" ? input : void 0;
|
|
330
|
+
}
|
|
331
|
+
function listConnectionWaitsToCheck() {
|
|
332
|
+
if (!isXopcDatabaseOpen()) return [];
|
|
333
|
+
return getSqliteDatabase().prepare(`SELECT wait.data_json FROM session_connection_waits wait
|
|
334
|
+
JOIN sessions session ON session.session_id = wait.session_id
|
|
335
|
+
WHERE wait.status = 'open'`).all().map((row) => JSON.parse(row.data_json)).filter((wait) => wait.principalId === "local-owner" && wait.intent && wait.intent.validUntil > Date.now());
|
|
336
|
+
}
|
|
337
|
+
//#endregion
|
|
338
|
+
export { cancelConnectionObjective, connectionBinding, connectionBindings, consumeConnectionResume, getActiveConnectionWait, getConnectionResumeInput, getConnectionWait, invalidateConnectionResumeIntent, isConnectionSuspended, listConnectionWaitsToCheck, onConnectionWaitChanged, publishConnectionWait, queueConnectionResolution, requireSessionConnection, reviseCurrentConnectionObjective, updateConnectionWait };
|
|
@@ -59,7 +59,7 @@ function mergeAccountSourceData(db, connectorId, sourceAccountId, targetAccountI
|
|
|
59
59
|
`).run(targetId, sourceId);
|
|
60
60
|
db.prepare("DELETE FROM knowledge_consumer_watermarks WHERE source_instance_id = ?").run(sourceId);
|
|
61
61
|
db.prepare(`
|
|
62
|
-
UPDATE
|
|
62
|
+
UPDATE knowledge_items
|
|
63
63
|
SET source_json = json_set(source_json, '$.sourceInstanceId', ?)
|
|
64
64
|
WHERE json_extract(source_json, '$.sourceInstanceId') = ?
|
|
65
65
|
`).run(targetId, sourceId);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ContextEvidence {
|
|
2
|
+
id: string;
|
|
3
|
+
sourceType: 'conversation' | 'connector' | 'user' | 'runtime';
|
|
4
|
+
sourceInstanceId?: string;
|
|
5
|
+
sourceRef: string;
|
|
6
|
+
sourceRunId?: string;
|
|
7
|
+
sourceItemId?: string;
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
turnId?: string;
|
|
10
|
+
messageId?: string;
|
|
11
|
+
contentHash?: string;
|
|
12
|
+
retentionPolicy?: string;
|
|
13
|
+
processingPolicy?: 'local_only' | 'remote_allowed';
|
|
14
|
+
extractorId?: string;
|
|
15
|
+
extractorVersion?: string;
|
|
16
|
+
redactedExcerpt?: string;
|
|
17
|
+
trustLevel: 'owner' | 'trusted' | 'untrusted';
|
|
18
|
+
observedAt: number;
|
|
19
|
+
ingestedAt: number;
|
|
20
|
+
createdAt: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function createContextEvidence(input: Omit<ContextEvidence, 'id' | 'ingestedAt' | 'createdAt'> & {
|
|
23
|
+
ingestedAt?: number;
|
|
24
|
+
}, principalId?: string): ContextEvidence;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { getSqliteDatabase } from "./transaction.js";
|
|
2
|
+
import { USER_MODEL_PRINCIPAL_ID } from "../../user-model/domain.js";
|
|
3
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
4
|
+
//#region src/storage/sqlite/context-evidence-repository.ts
|
|
5
|
+
function fromRow(row) {
|
|
6
|
+
return {
|
|
7
|
+
id: row.evidence_id,
|
|
8
|
+
sourceType: row.source_type,
|
|
9
|
+
...row.source_instance_id ? { sourceInstanceId: row.source_instance_id } : {},
|
|
10
|
+
sourceRef: row.source_ref,
|
|
11
|
+
...row.source_run_id ? { sourceRunId: row.source_run_id } : {},
|
|
12
|
+
...row.source_item_id ? { sourceItemId: row.source_item_id } : {},
|
|
13
|
+
...row.session_id ? { sessionId: row.session_id } : {},
|
|
14
|
+
...row.turn_id ? { turnId: row.turn_id } : {},
|
|
15
|
+
...row.message_id ? { messageId: row.message_id } : {},
|
|
16
|
+
...row.content_hash ? { contentHash: row.content_hash } : {},
|
|
17
|
+
...row.retention_policy ? { retentionPolicy: row.retention_policy } : {},
|
|
18
|
+
...row.processing_policy ? { processingPolicy: row.processing_policy } : {},
|
|
19
|
+
...row.extractor_id ? { extractorId: row.extractor_id } : {},
|
|
20
|
+
...row.extractor_version ? { extractorVersion: row.extractor_version } : {},
|
|
21
|
+
...row.redacted_excerpt ? { redactedExcerpt: row.redacted_excerpt } : {},
|
|
22
|
+
trustLevel: row.trust_level,
|
|
23
|
+
observedAt: row.observed_at,
|
|
24
|
+
ingestedAt: row.ingested_at ?? row.created_at,
|
|
25
|
+
createdAt: row.created_at
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function createContextEvidence(input, principalId = USER_MODEL_PRINCIPAL_ID) {
|
|
29
|
+
const db = getSqliteDatabase();
|
|
30
|
+
const existing = db.prepare(`SELECT * FROM context_evidence WHERE principal_id = ?
|
|
31
|
+
AND source_type = ? AND COALESCE(source_instance_id, '') = COALESCE(?, '') AND source_ref = ?`).get(principalId, input.sourceType, input.sourceInstanceId ?? null, input.sourceRef);
|
|
32
|
+
const contentHash = input.contentHash ?? (input.redactedExcerpt ? createHash("sha256").update(input.redactedExcerpt).digest("hex") : void 0);
|
|
33
|
+
if (existing) {
|
|
34
|
+
db.prepare(`UPDATE context_evidence SET
|
|
35
|
+
source_run_id = ?, source_item_id = ?, session_id = ?, turn_id = ?, message_id = ?,
|
|
36
|
+
content_hash = ?, retention_policy = ?, processing_policy = ?, extractor_id = ?,
|
|
37
|
+
extractor_version = ?, redacted_excerpt = ?, trust_level = ?, observed_at = ?, ingested_at = ?
|
|
38
|
+
WHERE evidence_id = ?`).run(input.sourceRunId ?? null, input.sourceItemId ?? null, input.sessionId ?? null, input.turnId ?? null, input.messageId ?? null, contentHash ?? null, input.retentionPolicy ?? null, input.processingPolicy ?? null, input.extractorId ?? null, input.extractorVersion ?? null, input.redactedExcerpt ?? null, input.trustLevel, input.observedAt, input.ingestedAt ?? Date.now(), existing.evidence_id);
|
|
39
|
+
return fromRow(db.prepare("SELECT * FROM context_evidence WHERE evidence_id = ?").get(existing.evidence_id));
|
|
40
|
+
}
|
|
41
|
+
const createdAt = Date.now();
|
|
42
|
+
const id = randomUUID();
|
|
43
|
+
db.prepare(`INSERT INTO context_evidence (
|
|
44
|
+
evidence_id, principal_id, source_type, source_instance_id, source_ref, source_run_id,
|
|
45
|
+
source_item_id, session_id, turn_id, message_id, content_hash, retention_policy,
|
|
46
|
+
processing_policy, extractor_id, extractor_version, redacted_excerpt, trust_level,
|
|
47
|
+
observed_at, ingested_at, created_at
|
|
48
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(id, principalId, input.sourceType, input.sourceInstanceId ?? null, input.sourceRef, input.sourceRunId ?? null, input.sourceItemId ?? null, input.sessionId ?? null, input.turnId ?? null, input.messageId ?? null, contentHash ?? null, input.retentionPolicy ?? null, input.processingPolicy ?? null, input.extractorId ?? null, input.extractorVersion ?? null, input.redactedExcerpt ?? null, input.trustLevel, input.observedAt, input.ingestedAt ?? createdAt, createdAt);
|
|
49
|
+
return fromRow(db.prepare("SELECT * FROM context_evidence WHERE evidence_id = ?").get(id));
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { createContextEvidence };
|
|
@@ -11,9 +11,8 @@ export { clearGatewayIdentityForTest, getOrCreateGatewayIdentity, signGatewayPay
|
|
|
11
11
|
export { consumeDevicePairingToken, createDevicePairingSetup, isDevicePairingSetupActive, type DevicePairingSetup, type DeviceRoute, type PairingConsumeResult, } from './device-pairing-repository.js';
|
|
12
12
|
export { claimContextExtractionRun, finishContextExtractionRun, getContextExtractionRun, hasIndependentExtractionOutput, listContextExtractionOutputs, listContextExtractionRuns, type ContextExtractionOutput, type ContextExtractionRun, type ContextExtractionStatus, type ContextObjectType, } from './context-extraction-repository.js';
|
|
13
13
|
export { closeTemporalAssertions, createTemporalAssertion, linkContextObjects, listContextObjectRelations, listTemporalAssertions, type ContextObjectRelation, type ContextTemporalAssertion, } from './context-relation-repository.js';
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export { createCollaborationRule, createContextEvidence, createUnderstanding, closeUnderstandingValidity, consumeContextConsent, deleteCollaborationRule, deleteUnderstanding, decideContextConsent, ensureContextConsent, getCollaborationRule, getTurnPersonalization, getUnderstanding, getUserProfile, hasContextConsent, isUnderstandingSuppressed, listCollaborationRules, listUnderstandingEvidence, listUnderstandingStatusEvents, listUnderstandings, linkUnderstandingEvidence, recordContextFeedback, recordContextRun, rejectUnderstanding, reviseCollaborationRule, reviseUnderstanding, searchActiveUnderstandings, setCollaborationRuleStatus, setUnderstandingStatus, updateUserProfile, type CreateUnderstandingInput, type UnderstandingStatusEvent, } from './user-context-repository.js';
|
|
14
|
+
export { createCollaborationRule, getCollaborationRule, listCollaborationRules, setCollaborationRuleStatus, type CollaborationRule, } from './collaboration-rule-repository.js';
|
|
15
|
+
export { createContextEvidence, type ContextEvidence } from './context-evidence-repository.js';
|
|
17
16
|
export { getUserPerson, getUserPeopleIndexState, listUserPeople, mergeUserPeople, replaceUserPeopleIndex, summarizeUserPeople, updateUserPerson, } from './user-people-repository.js';
|
|
18
17
|
export { cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, finishSessionInputRun, getSessionInputState, getSessionInputById, insertSessionInput, listActiveSessionInputRuns, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus, type SessionInput, type SessionInputDelivery, type SessionInputState, type SessionInputStatus, } from './session-input-repository.js';
|
|
19
18
|
export { replaceLatestSessionTurnAndQueueInput, validateLatestSessionTurnTarget, type ReplaceLatestSessionTurnInput, type ReplaceLatestSessionTurnResult, } from './session-turn-replace-repository.js';
|
|
@@ -31,8 +30,7 @@ export { deleteSessionRecord, ensureSessionRecord, getCurrentSessionId, getGloba
|
|
|
31
30
|
export { appendCompactionBoundaryIfUnchanged, appendTranscriptEntry, listCompactionBoundaries, loadLlmMessagesForSession, loadTranscriptHistoryRowsForSession, loadTranscriptRows, loadTranscriptRowsForSession, loadCompactionSourceSnapshot, paginateTranscriptMessages, replaceTranscriptRows, restoreBeforeCompactionBoundary, searchSessionTranscript, type CompactionSourceSnapshot, type SessionTranscriptRecallMatch, type TranscriptSourceEntry, } from './transcript-repository.js';
|
|
32
31
|
export { deleteNoteRecord, getNoteRecord, listNoteRecords, upsertNoteRecord, } from './notes-repository.js';
|
|
33
32
|
export { deleteNoteAgentContextRecord, getNoteAgentContextRecord, upsertNoteAgentContextRecord, type NoteAgentContextRecord, } from './note-agent-context-repository.js';
|
|
34
|
-
export {
|
|
35
|
-
export { attachMemoryEvidence, claimKnowledgeSourceItems, countKnowledgeSourceItems, completeKnowledgeSourceItemSynthesis, deleteMemoryEvidenceForRecord, deleteKnowledgeSourceItems, finishKnowledgeSyncRun, getKnowledgeConsumerWatermark, getKnowledgeSourceCursor, getKnowledgeSourceItem, listKnowledgeSourceItems, listKnowledgeSourceChanges, listKnowledgeSyncRuns, listMemoryEvidence, pruneBoundedKnowledgeSourceItems, setKnowledgeSourceItemSynthesisStatus, setKnowledgeConsumerWatermark, setKnowledgeSourceCursor, startKnowledgeSyncRun, upsertKnowledgeSourceItems, } from './knowledge-repository.js';
|
|
33
|
+
export { claimKnowledgeSourceItems, countKnowledgeSourceItems, completeKnowledgeSourceItemSynthesis, deleteKnowledgeSourceItems, finishKnowledgeSyncRun, getKnowledgeConsumerWatermark, getKnowledgeSourceCursor, getKnowledgeSourceItem, listKnowledgeSourceItems, listKnowledgeSourceChanges, listKnowledgeSyncRuns, pruneBoundedKnowledgeSourceItems, setKnowledgeSourceItemSynthesisStatus, setKnowledgeConsumerWatermark, setKnowledgeSourceCursor, startKnowledgeSyncRun, upsertKnowledgeSourceItems, } from './knowledge-repository.js';
|
|
36
34
|
export { deleteSessionConfig, getSessionConfig, hasSessionConfig, setSessionConfig, updateSessionConfig, } from './config-repository.js';
|
|
37
35
|
export { createObjectLinkRecord, deleteObjectLinkRecord, getActivityEventRecord, listActivityRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, recordActivityEvent, } from './activity-repository.js';
|
|
38
36
|
export { appendConnectorExecutionAudit, claimConnectorWebhookDelivery, completeConnectorWebhookDelivery, consumeConnectorApproval, createConnectorApproval, decideConnectorApproval, deleteConnectorConnection, deleteConnectorInstallation, getConnectorConnection, getConnectorApproval, getConnectorInstallation, getCachedConnectorCatalogEntry, listCachedConnectorCatalogEntries, listConnectorActionMetadata, listConnectorApprovals, listConnectorConnections, listConnectorExecutionAudit, listConnectorInstallations, releaseConnectorWebhookDelivery, replaceConnectorCatalogEntries, upsertConnectorActionMetadata, upsertConnectorCatalogEntry, upsertConnectorConnection, upsertConnectorInstallation, type CachedConnectorCatalogEntry, } from './connector-repository.js';
|
|
@@ -12,9 +12,8 @@ import { clearGatewayIdentityForTest, getOrCreateGatewayIdentity, signGatewayPay
|
|
|
12
12
|
import { consumeDevicePairingToken, createDevicePairingSetup, isDevicePairingSetupActive } from "./device-pairing-repository.js";
|
|
13
13
|
import { claimContextExtractionRun, finishContextExtractionRun, getContextExtractionRun, hasIndependentExtractionOutput, listContextExtractionOutputs, listContextExtractionRuns } from "./context-extraction-repository.js";
|
|
14
14
|
import { closeTemporalAssertions, createTemporalAssertion, linkContextObjects, listContextObjectRelations, listTemporalAssertions } from "./context-relation-repository.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { closeUnderstandingValidity, consumeContextConsent, createCollaborationRule, createContextEvidence, createUnderstanding, decideContextConsent, deleteCollaborationRule, deleteUnderstanding, ensureContextConsent, getCollaborationRule, getTurnPersonalization, getUnderstanding, getUserProfile, hasContextConsent, isUnderstandingSuppressed, linkUnderstandingEvidence, listCollaborationRules, listUnderstandingEvidence, listUnderstandingStatusEvents, listUnderstandings, recordContextFeedback, recordContextRun, rejectUnderstanding, reviseCollaborationRule, reviseUnderstanding, searchActiveUnderstandings, setCollaborationRuleStatus, setUnderstandingStatus, updateUserProfile } from "./user-context-repository.js";
|
|
15
|
+
import { createCollaborationRule, getCollaborationRule, listCollaborationRules, setCollaborationRuleStatus } from "./collaboration-rule-repository.js";
|
|
16
|
+
import { createContextEvidence } from "./context-evidence-repository.js";
|
|
18
17
|
import { getUserPeopleIndexState, getUserPerson, listUserPeople, mergeUserPeople, replaceUserPeopleIndex, summarizeUserPeople, updateUserPerson } from "./user-people-repository.js";
|
|
19
18
|
import { buildDefaultSessionMetadata } from "./session-metadata.js";
|
|
20
19
|
import { buildGlobalSessionStats, classifyStoredRow, estimateTokensFromMessages, extractFtsContent, metadataToSessionInsert, sessionConfigRowToConfig, sessionRowToMetadata, transcriptEntryRowToStoredRow } from "./row-mappers.js";
|
|
@@ -32,12 +31,11 @@ import { buildRelationshipPrompt, getRelationshipSettings, isProactiveSupportAll
|
|
|
32
31
|
import { appendCompactionBoundaryIfUnchanged, appendTranscriptEntry, listCompactionBoundaries, loadCompactionSourceSnapshot, loadLlmMessagesForSession, loadTranscriptHistoryRowsForSession, loadTranscriptRows, loadTranscriptRowsForSession, paginateTranscriptMessages, replaceTranscriptRows, restoreBeforeCompactionBoundary, searchSessionTranscript } from "./transcript-repository.js";
|
|
33
32
|
import { deleteNoteRecord, getNoteRecord, listNoteRecords, upsertNoteRecord } from "./notes-repository.js";
|
|
34
33
|
import { deleteNoteAgentContextRecord, getNoteAgentContextRecord, upsertNoteAgentContextRecord } from "./note-agent-context-repository.js";
|
|
35
|
-
import {
|
|
36
|
-
import { appendMemorySignal, appendMemoryTraceEvent, countMemoryRecordsBySourceInstanceId, deleteMemoryRecord, deleteMemoryRecordsBySourceInstanceId, getMemoryProviderState, getMemoryRecord, getMemoryTurnFeedback, hasUnresolvedMemoryConflict, listMemoryRecords, listMemorySignals, listMemoryTraceEvents, markMemoryRecordsConflicted, searchMemoryRecords, setMemoryProviderState, setMemoryRecordStatus, setMemoryTurnFeedback, summarizeMemoryRecallFeedback, upsertMemoryRecord } from "./memory-records-repository.js";
|
|
34
|
+
import { claimKnowledgeSourceItems, completeKnowledgeSourceItemSynthesis, countKnowledgeSourceItems, deleteKnowledgeSourceItems, finishKnowledgeSyncRun, getKnowledgeConsumerWatermark, getKnowledgeSourceCursor, getKnowledgeSourceItem, listKnowledgeSourceChanges, listKnowledgeSourceItems, listKnowledgeSyncRuns, pruneBoundedKnowledgeSourceItems, setKnowledgeConsumerWatermark, setKnowledgeSourceCursor, setKnowledgeSourceItemSynthesisStatus, startKnowledgeSyncRun, upsertKnowledgeSourceItems } from "./knowledge-repository.js";
|
|
37
35
|
import { deleteSessionConfig, getSessionConfig, hasSessionConfig, setSessionConfig, updateSessionConfig } from "./config-repository.js";
|
|
38
36
|
import { createObjectLinkRecord, deleteObjectLinkRecord, getActivityEventRecord, listActivityRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, recordActivityEvent } from "./activity-repository.js";
|
|
39
37
|
import { appendConnectorExecutionAudit, claimConnectorWebhookDelivery, completeConnectorWebhookDelivery, consumeConnectorApproval, createConnectorApproval, decideConnectorApproval, deleteConnectorConnection, deleteConnectorInstallation, getCachedConnectorCatalogEntry, getConnectorApproval, getConnectorConnection, getConnectorInstallation, listCachedConnectorCatalogEntries, listConnectorActionMetadata, listConnectorApprovals, listConnectorConnections, listConnectorExecutionAudit, listConnectorInstallations, releaseConnectorWebhookDelivery, replaceConnectorCatalogEntries, upsertConnectorActionMetadata, upsertConnectorCatalogEntry, upsertConnectorConnection, upsertConnectorInstallation } from "./connector-repository.js";
|
|
40
38
|
import { getConnectorAccount, listConnectorAccounts, reconcileConnectorAccount, refreshConnectorAccountCurrent } from "./connector-account-repository.js";
|
|
41
39
|
import { getConnectorSyncPolicy, getConnectorSyncPolicyForConnection, listConnectorSyncPolicies, upsertConnectorSyncPolicy } from "./connector-sync-policy-repository.js";
|
|
42
40
|
import { getUserTrustPolicy, setUserTrustPolicy } from "./user-trust-repository.js";
|
|
43
|
-
export { COMPOSER_INPUT_HISTORY_LIMIT, DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, SCHEMA_META_SCHEMA_VERSION_KEY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_FILENAME, XOPC_DB_SCHEMA_VERSION, acknowledgeHomeAttention, appendCompactionBoundaryIfUnchanged, appendComposerInputHistory, appendConnectorExecutionAudit,
|
|
41
|
+
export { COMPOSER_INPUT_HISTORY_LIMIT, DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, SCHEMA_META_SCHEMA_VERSION_KEY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_FILENAME, XOPC_DB_SCHEMA_VERSION, acknowledgeHomeAttention, appendCompactionBoundaryIfUnchanged, appendComposerInputHistory, appendConnectorExecutionAudit, appendTranscriptEntry, applyPendingMigrations, authenticateDeviceAccessToken, bindEndpointPrincipal, buildDefaultSessionMetadata, buildGlobalSessionStats, buildRefreshProofMessage, buildRelationshipPrompt, cancelQueuedSessionInput, claimConnectorWebhookDelivery, claimContextExtractionRun, claimKnowledgeSourceItems, claimNextConnectorLearningJob, claimNextSessionInput, classifyStoredRow, clearComposerInputHistory, clearGatewayIdentityForTest, closeTemporalAssertions, closeXopcDatabase, completeConnectorWebhookDelivery, completeKnowledgeSourceItemSynthesis, consumeConnectorApproval, consumeDevicePairingToken, countKnowledgeSourceItems, createCollaborationRule, createConnectorApproval, createContextEvidence, createDevice, createDevicePairingSetup, createEndpointPrincipal, createObjectLinkRecord, createTemporalAssertion, decideConnectorApproval, deleteConnectorConnection, deleteConnectorInstallation, deleteEndpointSessionBinding, deleteKnowledgeSourceItems, deleteNoteAgentContextRecord, deleteNoteRecord, deleteObjectLinkRecord, deleteSessionConfig, deleteSessionRecord, discoverSqlMigrations, enqueueConnectorLearningJob, ensureSessionRecord, ensureXopcDatabaseSchema, estimateTokensFromMessages, extractFtsContent, findSessionInput, findSessionKeyBySessionId, finishContextExtractionRun, finishEndpointToolInvocationAudit, finishKnowledgeSyncRun, finishSessionInputRun, getActivityEventRecord, getCachedConnectorCatalogEntry, getCollaborationRule, getConnectorAccount, getConnectorApproval, getConnectorConnection, getConnectorInstallation, getConnectorSyncPolicy, getConnectorSyncPolicyForConnection, getContextExtractionRun, getCurrentSessionId, getDevice, getEndpointPrincipal, getEndpointSessionBinding, getGlobalSessionStats, getInteractionState, getKnowledgeConsumerWatermark, getKnowledgeSourceCursor, getKnowledgeSourceItem, getNoteAgentContextRecord, getNoteRecord, getOrCreateGatewayIdentity, getRelationshipSettings, getSessionConfig, getSessionInputById, getSessionInputState, getSessionMetadata, getSessionPersistedLevels, getSessionTaskPlan, getSqliteDatabase, getUserPeopleIndexState, getUserPerson, getUserTrustPolicy, getXopcDatabase, hasIndependentExtractionOutput, hasSessionConfig, incrementSessionStatsOnAppend, insertSessionInput, inspectSchemaMigrationStatus, isDevicePairingSetupActive, isHomeAttentionAcknowledged, isProactiveSupportAllowed, isXopcDatabaseOpen, issueDeviceTokenPair, linkContextObjects, listActiveSessionInputRuns, listActivityRecords, listCachedConnectorCatalogEntries, listCollaborationRules, listCompactionBoundaries, listComposerInputHistory, listConnectorAccounts, listConnectorActionMetadata, listConnectorApprovals, listConnectorConnections, listConnectorExecutionAudit, listConnectorInstallations, listConnectorLearningJobs, listConnectorSyncPolicies, listContextExtractionOutputs, listContextExtractionRuns, listContextObjectRelations, listDevices, listEndpointPrincipals, listEndpointToolInvocationAudits, listKnowledgeSourceChanges, listKnowledgeSourceItems, listKnowledgeSyncRuns, listNoteRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, listRegisteredMigrationTargets, listSessionMetadata, listSessionsByAgent, listTemporalAssertions, listUserPeople, loadCompactionSourceSnapshot, loadLlmMessagesForSession, loadTranscriptHistoryRowsForSession, loadTranscriptRows, loadTranscriptRowsForSession, mergeUserPeople, metadataToSessionInsert, mutateQueuedSessionInput, openXopcDatabase, paginateTranscriptMessages, patchSessionMetadata, pruneBoundedKnowledgeSourceItems, readSchemaVersion, readSchemaVersionForTest, reconcileConnectorAccount, recordActivityEvent, recoverSessionInputState, recoverStaleConnectorLearningJobs, refreshConnectorAccountCurrent, releaseConnectorWebhookDelivery, replaceConnectorCatalogEntries, replaceLatestSessionTurnAndQueueInput, replaceTranscriptRows, replaceUserPeopleIndex, requireXopcDatabase, resetSessionRecord, resetXopcDatabaseSingletonForTest, resolveMigrationsDir, resolveSessionAgentId, resolveXopcDatabasePath, restoreBeforeCompactionBoundary, revokeDevice, revokeEndpointPrincipal, rotateDeviceRefreshToken, runSqliteWriteTransaction, searchSessionTranscript, sessionConfigRowToConfig, sessionRowToMetadata, setCollaborationRuleStatus, setConnectorLearningPaused, setEndpointSessionBinding, setInteractionState, setKnowledgeConsumerWatermark, setKnowledgeSourceCursor, setKnowledgeSourceItemSynthesisStatus, setSessionConfig, setSessionInputStatus, setSessionTaskPlan, setUserTrustPolicy, signGatewayPayload, startEndpointToolInvocationAudit, startKnowledgeSyncRun, summarizeUserPeople, touchEndpointPrincipal, transcriptEntryRowToStoredRow, updateConnectorLearningJob, updateInteractionStateFromMessage, updateRelationshipSettings, updateSessionConfig, updateSessionStats, updateUserPerson, upsertConnectorActionMetadata, upsertConnectorCatalogEntry, upsertConnectorConnection, upsertConnectorInstallation, upsertConnectorSyncPolicy, upsertKnowledgeSourceItems, upsertNoteAgentContextRecord, upsertNoteRecord, validateLatestSessionTurnTarget };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type { DatabaseSync } from 'node:sqlite';
|
|
2
1
|
import type { KnowledgeSourceChange, KnowledgeSourceItem, KnowledgeSourceItemInput, KnowledgeSyncRun, KnowledgeSyncRunStatus, KnowledgeSynthesisPipeline, KnowledgeSynthesisStatus, KnowledgeRetentionClass } from '../../knowledge/types.js';
|
|
3
|
-
import type { MemoryEvidence, MemoryEvidenceRelation } from '../../agent/memory/types.js';
|
|
4
2
|
export declare function startKnowledgeSyncRun(input: {
|
|
5
3
|
sourceInstanceId: string;
|
|
6
4
|
cursorBefore?: string;
|
|
@@ -74,20 +72,3 @@ export declare function completeKnowledgeSourceItemSynthesis(input: {
|
|
|
74
72
|
error?: string;
|
|
75
73
|
nowMs?: number;
|
|
76
74
|
}): boolean;
|
|
77
|
-
export interface AttachMemoryEvidenceInput {
|
|
78
|
-
recordId: string;
|
|
79
|
-
sourceItemId?: string;
|
|
80
|
-
relation?: MemoryEvidenceRelation;
|
|
81
|
-
excerpt?: string;
|
|
82
|
-
confidence?: number;
|
|
83
|
-
observedAt?: string;
|
|
84
|
-
sessionKey?: string;
|
|
85
|
-
turnId?: string;
|
|
86
|
-
toolCallId?: string;
|
|
87
|
-
nowMs?: number;
|
|
88
|
-
}
|
|
89
|
-
export declare function attachMemoryEvidence(input: AttachMemoryEvidenceInput): MemoryEvidence;
|
|
90
|
-
export declare function replaceMemoryEvidenceForRecord(db: DatabaseSync, recordId: string, evidence: MemoryEvidence[], nowMs?: number): void;
|
|
91
|
-
export declare function deleteMemoryEvidenceForRecord(recordId: string, relation?: MemoryEvidenceRelation): number;
|
|
92
|
-
export declare function listMemoryEvidence(recordId: string): MemoryEvidence[];
|
|
93
|
-
export declare function listMemoryEvidenceForRecords(recordIds: string[]): Map<string, MemoryEvidence[]>;
|