@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
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { retrievalQueryAuditValue } from "../../retrieval/audit.js";
|
|
4
|
-
import { setKnowledgeSourceItemSynthesisStatus } from "../../storage/sqlite/knowledge-repository.js";
|
|
5
|
-
import { appendMemoryTraceEvent } from "../../storage/sqlite/memory-records-repository.js";
|
|
6
|
-
import "../../storage/sqlite/index.js";
|
|
7
|
-
import { UserUnderstandingService } from "./understanding/service.js";
|
|
8
4
|
//#region src/agent/memory/manager.ts
|
|
9
5
|
init_logger();
|
|
10
6
|
const log = createLogger("MemoryManager");
|
|
@@ -15,7 +11,6 @@ var MemoryManager = class {
|
|
|
15
11
|
loadProviders;
|
|
16
12
|
writePolicy;
|
|
17
13
|
pluginProvidersLoaded = false;
|
|
18
|
-
understanding;
|
|
19
14
|
memoryRuntime;
|
|
20
15
|
sessionContexts = /* @__PURE__ */ new Map();
|
|
21
16
|
constructor(options = {}) {
|
|
@@ -31,7 +26,6 @@ var MemoryManager = class {
|
|
|
31
26
|
allowedProviderIds: options.writePolicy?.allowedProviderIds,
|
|
32
27
|
autoWriteKinds: options.writePolicy?.autoWriteKinds
|
|
33
28
|
};
|
|
34
|
-
this.understanding = new UserUnderstandingService();
|
|
35
29
|
}
|
|
36
30
|
addProvider(provider) {
|
|
37
31
|
this.providers.push(provider);
|
|
@@ -119,21 +113,6 @@ var MemoryManager = class {
|
|
|
119
113
|
}
|
|
120
114
|
}
|
|
121
115
|
}
|
|
122
|
-
async applyUnderstandingCandidates(candidates, context = {}) {
|
|
123
|
-
const sessionContext = context.sessionKey ? this.sessionContexts.get(context.sessionKey) : void 0;
|
|
124
|
-
const sourceItemId = context.sourceItemId;
|
|
125
|
-
const result = await this.understanding.applyCandidates(candidates, {
|
|
126
|
-
...context,
|
|
127
|
-
workspaceId: context.workspaceId ?? sessionContext?.workspace ?? sessionContext?.agentWorkspace,
|
|
128
|
-
sourceItemId
|
|
129
|
-
});
|
|
130
|
-
const sourceItemIds = [...new Set([...sourceItemId ? [sourceItemId] : [], ...context.sourceItemIds ?? []])];
|
|
131
|
-
if (sourceItemIds.length) setKnowledgeSourceItemSynthesisStatus(sourceItemIds, "completed");
|
|
132
|
-
return {
|
|
133
|
-
...result,
|
|
134
|
-
...sourceItemId ? { sourceItemId } : {}
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
116
|
getExternalToolEntries() {
|
|
138
117
|
const out = [];
|
|
139
118
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -438,30 +417,22 @@ var MemoryManager = class {
|
|
|
438
417
|
return true;
|
|
439
418
|
}
|
|
440
419
|
trace(phase, providerId, request, meta = {}) {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
});
|
|
448
|
-
} catch (err) {
|
|
449
|
-
log.debug({
|
|
450
|
-
err,
|
|
451
|
-
providerId,
|
|
452
|
-
phase
|
|
453
|
-
}, "memory trace append failed");
|
|
454
|
-
}
|
|
420
|
+
log.debug({
|
|
421
|
+
phase,
|
|
422
|
+
providerId,
|
|
423
|
+
request: sanitizeTraceRequest(request),
|
|
424
|
+
...meta
|
|
425
|
+
}, "External memory provider operation");
|
|
455
426
|
}
|
|
456
427
|
};
|
|
457
428
|
function memorySourceForRecord(record) {
|
|
458
|
-
if (record.source.provider
|
|
429
|
+
if (record.source.provider !== "builtin") return "connector";
|
|
459
430
|
if (record.scope.sessionKey) return "session";
|
|
460
|
-
if (record.scope.
|
|
461
|
-
return "
|
|
431
|
+
if (record.scope.projectId) return "project";
|
|
432
|
+
return "workspace";
|
|
462
433
|
}
|
|
463
|
-
function writeTargetForRecord(
|
|
464
|
-
return
|
|
434
|
+
function writeTargetForRecord(_request) {
|
|
435
|
+
return "knowledge";
|
|
465
436
|
}
|
|
466
437
|
function sanitizeTraceRequest(request) {
|
|
467
438
|
if (!request || typeof request !== "object") return request;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** Whether generic workspace and provider-backed memory is available. */
|
|
3
3
|
function isMemorySubsystemEnabled(config) {
|
|
4
4
|
if (!config) return true;
|
|
5
|
-
return config.userContext.enabled && config.userContext.
|
|
5
|
+
return config.userContext.enabled && config.userContext.knowledgeMemory.enabled;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Whether to prefix the user message with prefetched external memory this turn.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UserContextConfig } from '../../user-context/config.js';
|
|
2
|
-
export type MemorySource = 'session' | '
|
|
3
|
-
export type MemoryWriteTarget = '
|
|
2
|
+
export type MemorySource = 'session' | 'workspace' | 'project' | 'connector';
|
|
3
|
+
export type MemoryWriteTarget = 'knowledge';
|
|
4
4
|
export type MemoryWriteDecision = 'allow' | 'confirm' | 'deny';
|
|
5
5
|
export interface MemoryCandidate {
|
|
6
6
|
target: MemoryWriteTarget;
|
|
@@ -4,20 +4,16 @@ function normalizeConfidence(value) {
|
|
|
4
4
|
return Math.max(0, Math.min(1, value));
|
|
5
5
|
}
|
|
6
6
|
function buildMemoryRuntime(userContext) {
|
|
7
|
-
const memory = userContext.
|
|
8
|
-
const readableSources = !userContext.enabled || memory.
|
|
7
|
+
const memory = userContext.knowledgeMemory;
|
|
8
|
+
const readableSources = !userContext.enabled || !memory.enabled ? [] : [...memory.sources];
|
|
9
9
|
const sourceSet = new Set(readableSources);
|
|
10
10
|
return {
|
|
11
11
|
readableSources,
|
|
12
12
|
canRead: (source) => sourceSet.has(source),
|
|
13
13
|
checkWrite: (candidate) => {
|
|
14
|
-
if (!userContext.enabled || memory.
|
|
14
|
+
if (!userContext.enabled || !memory.enabled) return {
|
|
15
15
|
decision: "deny",
|
|
16
|
-
reason: "memory is disabled"
|
|
17
|
-
};
|
|
18
|
-
if (memory.mode === "readOnly") return {
|
|
19
|
-
decision: "deny",
|
|
20
|
-
reason: "memory is read-only"
|
|
16
|
+
reason: "knowledge memory is disabled"
|
|
21
17
|
};
|
|
22
18
|
if (!candidate.content.trim()) return {
|
|
23
19
|
decision: "deny",
|
|
@@ -27,19 +23,13 @@ function buildMemoryRuntime(userContext) {
|
|
|
27
23
|
decision: "deny",
|
|
28
24
|
reason: "memory confidence is too low"
|
|
29
25
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
reason: "memory candidate is sensitive"
|
|
34
|
-
};
|
|
35
|
-
const targetPolicy = memory.writePolicy?.[candidate.target] ?? "deny";
|
|
36
|
-
if (memory.mode === "confirmWrite" && targetPolicy === "allow") return {
|
|
37
|
-
decision: "confirm",
|
|
38
|
-
reason: "agent memory mode requires confirmation"
|
|
26
|
+
if (candidate.sensitive && memory.writePolicy !== "allow") return {
|
|
27
|
+
decision: memory.writePolicy,
|
|
28
|
+
reason: "knowledge candidate is sensitive"
|
|
39
29
|
};
|
|
40
30
|
return {
|
|
41
|
-
decision:
|
|
42
|
-
reason: `
|
|
31
|
+
decision: memory.writePolicy,
|
|
32
|
+
reason: `knowledge write policy is ${memory.writePolicy}`
|
|
43
33
|
};
|
|
44
34
|
}
|
|
45
35
|
};
|
|
@@ -115,7 +115,7 @@ export interface MemoryWriteRequest {
|
|
|
115
115
|
/** Agent that produced this record. This is request data, never provider state. */
|
|
116
116
|
sourceAgentId?: string;
|
|
117
117
|
provenance?: Partial<Omit<MemoryProvenance, 'sourceAgentId'>>;
|
|
118
|
-
writeTarget?: '
|
|
118
|
+
writeTarget?: 'knowledge';
|
|
119
119
|
confirmed?: boolean;
|
|
120
120
|
tags?: string[];
|
|
121
121
|
source?: MemoryRecord['source'];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import {
|
|
3
|
+
import { parseMaintenanceInstruction } from "../../memory-maintenance/schedule.js";
|
|
4
|
+
import { runMemoryMaintenance } from "../../memory-maintenance/service.js";
|
|
5
|
+
import "../../memory-maintenance/index.js";
|
|
4
6
|
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
5
7
|
import { persistInboundAttachments } from "../../channels/attachments/inbound-persist.js";
|
|
6
8
|
import { buildTranscriptUserMessage, clearPendingTranscriptUserMessage, hydrateUserTurnForLlm, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
@@ -48,15 +50,19 @@ var AgentOrchestrator = class {
|
|
|
48
50
|
log.debug({ sessionKey }, "Processing message through agent orchestrator");
|
|
49
51
|
await this.sessionHydrator.workspace(sessionKey);
|
|
50
52
|
if (typeof msg.content === "string" && (sessionKey.startsWith("cron:") || sessionKey.includes(":cron:") || sessionKey.includes(":automation:") || context.channel === "cron" || context.channel === "automation")) {
|
|
51
|
-
|
|
53
|
+
const maintenanceJob = parseMaintenanceInstruction(msg.content);
|
|
54
|
+
if (maintenanceJob) {
|
|
52
55
|
const cfg = this.getConfig?.();
|
|
53
56
|
if (!cfg) {
|
|
54
|
-
log.warn({ sessionKey }, "
|
|
57
|
+
log.warn({ sessionKey }, "Memory maintenance skipped: config unavailable");
|
|
55
58
|
return;
|
|
56
59
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
const maintenance = cfg.userContext.userModel.maintenance;
|
|
61
|
+
runMemoryMaintenance({
|
|
62
|
+
jobType: maintenanceJob,
|
|
63
|
+
limit: maintenance.limit,
|
|
64
|
+
staleRetentionDays: maintenance.staleRetentionDays,
|
|
65
|
+
evidenceThreshold: maintenance.evidenceThreshold
|
|
60
66
|
});
|
|
61
67
|
return;
|
|
62
68
|
}
|
|
@@ -108,21 +114,7 @@ var AgentOrchestrator = class {
|
|
|
108
114
|
clearPendingTranscriptUserMessage(sessionKey, userMessage);
|
|
109
115
|
}
|
|
110
116
|
})();
|
|
111
|
-
|
|
112
|
-
if (understandingReview?.createdRecords.length) {
|
|
113
|
-
const captured = understandingReview.createdRecords.filter((record) => record.status === "active");
|
|
114
|
-
const candidates = understandingReview.createdRecords.filter((record) => record.status === "candidate");
|
|
115
|
-
if (captured.length) this.onEmbeddedStreamEvent?.(sessionKey, {
|
|
116
|
-
type: "memory_captured",
|
|
117
|
-
runId: turnId,
|
|
118
|
-
records: captured
|
|
119
|
-
});
|
|
120
|
-
if (candidates.length) this.onEmbeddedStreamEvent?.(sessionKey, {
|
|
121
|
-
type: "memory_candidate",
|
|
122
|
-
runId: turnId,
|
|
123
|
-
records: candidates
|
|
124
|
-
});
|
|
125
|
-
}
|
|
117
|
+
await this.agentManager.afterAgentTurn(sessionKey, userPlainForMemory, turnId);
|
|
126
118
|
this.agentManager.scheduleBackgroundReviewAfterUserTurn(sessionKey);
|
|
127
119
|
if (turnResult.ok) {
|
|
128
120
|
this.onEmbeddedTurnComplete?.(sessionKey, turnResult.lastAssistantText);
|
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
//#region src/agent/prompt/sections/memory-skills.ts
|
|
2
2
|
function buildMemorySection(params) {
|
|
3
3
|
if (params.includeMemorySection === false) return "";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"##
|
|
15
|
-
"",
|
|
16
|
-
|
|
17
|
-
""
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"- **Other sessions:** use `session_search` for cross-session history.",
|
|
27
|
-
"- **Workspace memory:** cite only record ids returned by `memory_search` / `memory_get`.",
|
|
28
|
-
"",
|
|
29
|
-
"### Writing to Memory",
|
|
30
|
-
"",
|
|
31
|
-
"- **Declarative vs procedural:** user preferences belong to structured user understanding; reusable task procedures belong to skills.",
|
|
32
|
-
"- Explicit \"remember this\" statements are captured as durable structured understanding after the turn.",
|
|
33
|
-
"- Do not invent, cite, or promise memory record ids that were not returned by a memory tool.",
|
|
34
|
-
"- **Text > Brain**"
|
|
35
|
-
].join("\n");
|
|
4
|
+
const names = params.availableTools;
|
|
5
|
+
if (![
|
|
6
|
+
"user_context_search",
|
|
7
|
+
"user_context_get",
|
|
8
|
+
"knowledge_search",
|
|
9
|
+
"knowledge_get",
|
|
10
|
+
"session_recall",
|
|
11
|
+
"session_search"
|
|
12
|
+
].some((name) => names.has(name)) && !params.hasProfileMemory) return "";
|
|
13
|
+
const lines = [
|
|
14
|
+
"## Context and memory",
|
|
15
|
+
"",
|
|
16
|
+
"Relevant user facts, goals, priorities, collaboration rules, and task knowledge are selected for each turn.",
|
|
17
|
+
"When exact or additional context is needed:"
|
|
18
|
+
];
|
|
19
|
+
if (names.has("user_context_search")) lines.push("- Use `user_context_search` for user identity, preferences, routines, and current state.");
|
|
20
|
+
if (names.has("knowledge_search")) lines.push("- Use `knowledge_search` for project facts, decisions, lessons, commitments, and open questions.");
|
|
21
|
+
if (names.has("session_recall")) lines.push("- Use `session_recall` for exact raw content from the current session.");
|
|
22
|
+
if (names.has("session_search")) lines.push("- Use `session_search` for other conversations.");
|
|
23
|
+
if (names.has("knowledge_write")) lines.push("- Use `knowledge_write` for reusable task knowledge; it is stored as a reviewable candidate with provenance.");
|
|
24
|
+
lines.push("", "User facts are declarative. Reusable procedures belong in skills.", "Do not infer importance from confidence: confidence measures truth likelihood; importance measures execution value.");
|
|
25
|
+
return lines.join("\n");
|
|
36
26
|
}
|
|
37
27
|
function buildExternalMemorySection(text) {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
return `## External memory provider\n\n${t}`;
|
|
28
|
+
const value = text?.trim();
|
|
29
|
+
return value ? `## External knowledge provider\n\n${value}` : "";
|
|
41
30
|
}
|
|
42
31
|
function buildSkillsSection(hasSkillTools) {
|
|
43
32
|
if (!hasSkillTools) return "";
|
|
@@ -50,7 +39,7 @@ function buildSkillsSection(hasSkillTools) {
|
|
|
50
39
|
"Constraints: never load more than one skill up front; only load after selecting.",
|
|
51
40
|
"- When a skill drives external API writes, assume rate limits: prefer fewer larger writes, avoid tight one-item loops, serialize bursts when possible, and respect 429/Retry-After.",
|
|
52
41
|
"",
|
|
53
|
-
"**Division of labor
|
|
42
|
+
"**Division of labor:** Skills contain procedures; user context and knowledge contain declarative facts."
|
|
54
43
|
].join("\n");
|
|
55
44
|
}
|
|
56
45
|
//#endregion
|
|
@@ -15,8 +15,11 @@ const CORE_TOOL_ORDER = [
|
|
|
15
15
|
"send_message",
|
|
16
16
|
"send_media",
|
|
17
17
|
"publish_artifacts",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
18
|
+
"user_context_search",
|
|
19
|
+
"user_context_get",
|
|
20
|
+
"knowledge_search",
|
|
21
|
+
"knowledge_get",
|
|
22
|
+
"knowledge_write",
|
|
20
23
|
"session_recall",
|
|
21
24
|
"session_search",
|
|
22
25
|
"session_status",
|
|
@@ -52,8 +55,11 @@ const CORE_TOOL_SUMMARIES = {
|
|
|
52
55
|
send_message: "Send messages to the current conversation or an explicit configured channel",
|
|
53
56
|
send_media: "Send media attachments to the current channel",
|
|
54
57
|
publish_artifacts: "Publish final generated files as durable chat deliverables",
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
user_context_search: "Search typed user facts, preferences, routines, and current state",
|
|
59
|
+
user_context_get: "Read one typed user assertion with its scope and authority",
|
|
60
|
+
knowledge_search: "Search scoped project, workspace, and session knowledge",
|
|
61
|
+
knowledge_get: "Read one knowledge item returned by search",
|
|
62
|
+
knowledge_write: "Store a scoped knowledge candidate with provenance",
|
|
57
63
|
session_recall: "Search exact raw turns in the current session, including compacted history",
|
|
58
64
|
session_search: "Search other chat sessions or list recent sessions",
|
|
59
65
|
session_status: "Show session usage/time/model state",
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
4
|
-
import { getUserProfile } from "../../storage/sqlite/user-context-repository.js";
|
|
5
4
|
import { buildInteractionStatePrompt } from "../../user-context/interaction-state.js";
|
|
6
5
|
import { getInteractionState } from "../../storage/sqlite/interaction-state-repository.js";
|
|
7
6
|
import { DEFAULT_USER_TRUST_LEVEL } from "../../user-context/trust-policy.js";
|
|
8
7
|
import { getUserTrustPolicy } from "../../storage/sqlite/user-trust-repository.js";
|
|
9
8
|
import "../../storage/sqlite/index.js";
|
|
10
9
|
import { appendStablePromptSection } from "./cache-boundary.js";
|
|
10
|
+
import { getUserTimezone } from "../../user-model/repository.js";
|
|
11
|
+
import "../../user-model/index.js";
|
|
11
12
|
import { resolveSystemPromptBuildParams } from "./system-prompt-params.js";
|
|
12
13
|
import { buildSystemPrompt } from "./system-prompt.js";
|
|
13
14
|
import { resolveResponseLanguageForSession } from "./response-language.js";
|
|
@@ -31,7 +32,7 @@ var SystemPromptBuilder = class {
|
|
|
31
32
|
const interactionState = isXopcDatabaseOpen() && options.sessionKey ? getInteractionState(options.sessionKey) : void 0;
|
|
32
33
|
const interactionPrompt = interactionState ? buildInteractionStatePrompt(interactionState) : "";
|
|
33
34
|
const heartbeatEnabled = this.config.gateway?.heartbeat?.includeSystemPromptSection ?? false;
|
|
34
|
-
const userTimezone = isXopcDatabaseOpen() ?
|
|
35
|
+
const userTimezone = isXopcDatabaseOpen() ? getUserTimezone() : void 0;
|
|
35
36
|
const ttsMerged = mergeTtsConfigFromAppConfig(this.config.messages?.tts);
|
|
36
37
|
const reg = options.registeredToolNames ?? [];
|
|
37
38
|
const ttsSystemHint = buildTtsSystemPromptHint({
|
|
@@ -110,7 +111,7 @@ var SystemPromptBuilder = class {
|
|
|
110
111
|
workspaceDir: ws,
|
|
111
112
|
sessionKey: options?.sessionKey,
|
|
112
113
|
toolNames: options?.registeredToolNames,
|
|
113
|
-
userTimezone: isXopcDatabaseOpen() ?
|
|
114
|
+
userTimezone: isXopcDatabaseOpen() ? getUserTimezone() : void 0,
|
|
114
115
|
externalMemoryInstructions: options?.externalMemoryInstructions,
|
|
115
116
|
heartbeatEnabled: this.config.gateway?.heartbeat?.includeSystemPromptSection ?? false
|
|
116
117
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { getConnectionResumeInput } from "../../storage/sqlite/connection-wait-repository.js";
|
|
1
2
|
import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
|
|
2
3
|
import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
|
|
3
4
|
import { buildTaskExecutionDirective } from "../../tasks/task-context-assembler.js";
|
|
4
|
-
import { prependAgentContext } from "
|
|
5
|
+
import { prependAgentContext } from "../context/prepend.js";
|
|
5
6
|
import { extractAgentUserPlainText } from "../memory/user-message-text.js";
|
|
6
7
|
import { shouldSkipResetOverlapCommand } from "../../session/reset-triggers.js";
|
|
7
8
|
import { parseSlashCommand } from "../../chat-commands/command-parse.js";
|
|
@@ -85,15 +86,11 @@ async function tryRunSlashCommand(deps, ctx, content, options) {
|
|
|
85
86
|
*/
|
|
86
87
|
async function runDirectAgentTurn(deps, input) {
|
|
87
88
|
const turnId = input.runId ?? crypto.randomUUID();
|
|
89
|
+
const isConnectionResume = Boolean(getConnectionResumeInput(input.sessionKey, turnId));
|
|
88
90
|
const userPlain = extractAgentUserPlainText(input.userMessage);
|
|
89
91
|
const userContext = await deps.agentManager.prepareUserTurnContext(input.userMessage, input.sessionKey, turnId);
|
|
90
92
|
const sourceContexts = input.sourceContexts ?? [];
|
|
91
93
|
const userMessageForModel = prependAgentContext(injectSourceContextsIntoUserMessage(userContext.modelMessage, sourceContexts), buildTaskExecutionDirective(input.sessionKey));
|
|
92
|
-
if (userContext.consentRequests.length > 0) input.onEvent?.({
|
|
93
|
-
type: "memory_consent_required",
|
|
94
|
-
runId: turnId,
|
|
95
|
-
requests: userContext.consentRequests
|
|
96
|
-
});
|
|
97
94
|
const modelRef = deps.modelManager.getModelForSession(input.sessionKey);
|
|
98
95
|
const llmTurn = await hydrateUserTurnForLlm({
|
|
99
96
|
message: input.userMessage,
|
|
@@ -114,25 +111,11 @@ async function runDirectAgentTurn(deps, input) {
|
|
|
114
111
|
getConfig: () => deps.config,
|
|
115
112
|
abortSignal: input.abortSignal,
|
|
116
113
|
deadlineAtMs: input.deadlineAtMs,
|
|
117
|
-
beforeTurn: () => deps.agentManager.beginBackgroundReviewUserTurn(input.sessionKey),
|
|
114
|
+
beforeTurn: isConnectionResume ? void 0 : () => deps.agentManager.beginBackgroundReviewUserTurn(input.sessionKey),
|
|
118
115
|
onEvent: input.onEvent
|
|
119
116
|
});
|
|
120
|
-
|
|
121
|
-
if (
|
|
122
|
-
const captured = understandingReview.createdRecords.filter((record) => record.status === "active");
|
|
123
|
-
const candidates = understandingReview.createdRecords.filter((record) => record.status === "candidate");
|
|
124
|
-
if (captured.length) input.onEvent?.({
|
|
125
|
-
type: "memory_captured",
|
|
126
|
-
runId: turnId,
|
|
127
|
-
records: captured
|
|
128
|
-
});
|
|
129
|
-
if (candidates.length) input.onEvent?.({
|
|
130
|
-
type: "memory_candidate",
|
|
131
|
-
runId: turnId,
|
|
132
|
-
records: candidates
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
deps.agentManager.scheduleBackgroundReviewAfterUserTurn(input.sessionKey);
|
|
117
|
+
if (!isConnectionResume) await deps.agentManager.afterAgentTurn(input.sessionKey, userPlain, turnId);
|
|
118
|
+
if (!isConnectionResume && result.stopReason !== "connection_required") deps.agentManager.scheduleBackgroundReviewAfterUserTurn(input.sessionKey);
|
|
136
119
|
return result;
|
|
137
120
|
}
|
|
138
121
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getConnectionResumeInput } from "../../storage/sqlite/connection-wait-repository.js";
|
|
1
2
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
2
3
|
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
3
4
|
import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
@@ -124,6 +125,7 @@ function pushAssistantReceipt(queue, text, runId, metadata) {
|
|
|
124
125
|
}
|
|
125
126
|
async function* runProcessDirectStreaming(deps, input) {
|
|
126
127
|
const sessionKey = input.sessionKey ?? "agent:main:main";
|
|
128
|
+
const isConnectionResume = Boolean(input.runId && getConnectionResumeInput(sessionKey, input.runId));
|
|
127
129
|
const { channel, chatId } = await deps.resolveSessionEndpoint(sessionKey);
|
|
128
130
|
const context = deps.initDirectStreamingSession(sessionKey, channel, chatId, input.origin);
|
|
129
131
|
const queue = new AsyncQueue({
|
|
@@ -275,7 +277,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
275
277
|
if (sourceContext && !sourceContexts.some((context) => context.kind === sourceContext.kind && context.sourceId === sourceContext.sourceId)) sourceContexts.push(sourceContext);
|
|
276
278
|
}
|
|
277
279
|
}
|
|
278
|
-
if (channel === "webchat") {
|
|
280
|
+
if (channel === "webchat" && !isConnectionResume) {
|
|
279
281
|
pushVisible({
|
|
280
282
|
type: "user_message",
|
|
281
283
|
timestamp: userMessage.timestamp ?? Date.now(),
|
|
@@ -286,7 +288,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
286
288
|
if (textForAgent.trim()) deps.enqueueProvisionalSessionTitle?.(sessionKey, textForAgent);
|
|
287
289
|
}
|
|
288
290
|
const pendingUserMessage = turnSourceContexts.length > 0 ? injectSourceContextsIntoUserMessage(userMessage, turnSourceContexts) : userMessage;
|
|
289
|
-
setPendingTranscriptUserMessage(sessionKey, pendingUserMessage);
|
|
291
|
+
if (!isConnectionResume) setPendingTranscriptUserMessage(sessionKey, pendingUserMessage);
|
|
290
292
|
try {
|
|
291
293
|
const result = await deps.agentManager.withSkillCapabilities(sessionKey, skillTurn.activatedCapabilityNames, () => runDirectAgentTurn({
|
|
292
294
|
sessionStore: deps.sessionStore,
|
|
@@ -313,7 +315,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
313
315
|
content: formatStreamError(result.errorMessage)
|
|
314
316
|
});
|
|
315
317
|
} finally {
|
|
316
|
-
clearPendingTranscriptUserMessage(sessionKey, pendingUserMessage);
|
|
318
|
+
if (!isConnectionResume) clearPendingTranscriptUserMessage(sessionKey, pendingUserMessage);
|
|
317
319
|
}
|
|
318
320
|
} catch (err) {
|
|
319
321
|
if (err instanceof AsyncQueueOverflowError) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { getUserProfile } from "../storage/sqlite/user-context-repository.js";
|
|
4
3
|
import { parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
5
4
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
6
5
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
@@ -10,10 +9,13 @@ import { init_providers, resolveModel } from "../providers/index.js";
|
|
|
10
9
|
import { extractTextContent } from "./context/workspace.js";
|
|
11
10
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
12
11
|
import { getProjectForSession } from "../projects/workspace.js";
|
|
12
|
+
import { runWithEmbeddedExecutionSession } from "./embedded/execution-context.js";
|
|
13
13
|
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
|
|
14
14
|
import { removeSkillsLockEntry } from "./skills/hub-lock.js";
|
|
15
15
|
import { installSkillFromZip } from "./skills/managed-store.js";
|
|
16
16
|
import { pullSkillFromSource } from "./skills/hub-pull.js";
|
|
17
|
+
import { getUserTimezone } from "../user-model/repository.js";
|
|
18
|
+
import "../user-model/index.js";
|
|
17
19
|
import { resolveAgentTurnTimeoutMs } from "./orchestration/run-agent-turn-with-timeout.js";
|
|
18
20
|
import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
19
21
|
import { persistInboundAttachments } from "../channels/attachments/inbound-persist.js";
|
|
@@ -43,7 +45,6 @@ import { ContextMiddleware } from "./middleware/context.js";
|
|
|
43
45
|
import "./middleware/index.js";
|
|
44
46
|
import { LifecycleManager } from "./lifecycle/manager.js";
|
|
45
47
|
import "./lifecycle/index.js";
|
|
46
|
-
import { runWithEmbeddedExecutionSession } from "./embedded/execution-context.js";
|
|
47
48
|
import { MessageRouter } from "./messaging/message-router.js";
|
|
48
49
|
import { CommandHandler } from "./messaging/command-handler.js";
|
|
49
50
|
import { StreamManager } from "./messaging/stream-manager.js";
|
|
@@ -801,7 +802,7 @@ var AgentService = class {
|
|
|
801
802
|
resolveUserTimezoneForSession(sessionKey) {
|
|
802
803
|
try {
|
|
803
804
|
if (!this.effectiveAppConfig()) return void 0;
|
|
804
|
-
return
|
|
805
|
+
return getUserTimezone();
|
|
805
806
|
} catch {
|
|
806
807
|
return;
|
|
807
808
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
3
4
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
4
5
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
6
|
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
6
7
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
7
8
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
8
|
-
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
9
9
|
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
10
10
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
11
11
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
@@ -26,8 +26,11 @@ const DELEGATE_BLOCKED_TOOLS = new Set([
|
|
|
26
26
|
"send_media",
|
|
27
27
|
"todo",
|
|
28
28
|
"session_search",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
29
|
+
"user_context_search",
|
|
30
|
+
"user_context_get",
|
|
31
|
+
"knowledge_search",
|
|
32
|
+
"knowledge_get",
|
|
33
|
+
"knowledge_write",
|
|
31
34
|
"automation",
|
|
32
35
|
"skills_list",
|
|
33
36
|
"skill_view",
|