@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,37 @@
|
|
|
1
|
+
//#region src/connectors/connection-capabilities.ts
|
|
2
|
+
/** Supported actions for the task capabilities offered by connection candidates. */
|
|
3
|
+
const CAPABILITY_ACTIONS = {
|
|
4
|
+
"composio-slack": { "messages.search": ["SLACK_SEARCH_ALL", "SLACK_SEARCH_MESSAGES"] },
|
|
5
|
+
"composio-gmail": {
|
|
6
|
+
"email.search": ["GMAIL_FETCH_EMAILS"],
|
|
7
|
+
"email.read": ["GMAIL_FETCH_EMAILS", "GMAIL_GET_EMAIL"]
|
|
8
|
+
},
|
|
9
|
+
"composio-outlook": {
|
|
10
|
+
"email.search": ["OUTLOOK_LIST_MESSAGES"],
|
|
11
|
+
"email.read": ["OUTLOOK_LIST_MESSAGES", "OUTLOOK_GET_MESSAGE"]
|
|
12
|
+
},
|
|
13
|
+
"composio-googlecalendar": { "calendar.read": ["GOOGLECALENDAR_EVENTS_LIST", "GOOGLECALENDAR_FIND_EVENT"] },
|
|
14
|
+
"composio-googledrive": {
|
|
15
|
+
"files.search": ["GOOGLEDRIVE_FIND_FILE", "GOOGLEDRIVE_LIST_FILES"],
|
|
16
|
+
"files.read": [
|
|
17
|
+
"GOOGLEDRIVE_DOWNLOAD_FILE",
|
|
18
|
+
"GOOGLEDRIVE_GET_FILE",
|
|
19
|
+
"GOOGLEDRIVE_GET_FILE_METADATA"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"composio-notion": {
|
|
23
|
+
"pages.search": ["NOTION_SEARCH"],
|
|
24
|
+
"pages.read": ["NOTION_FETCH_PAGE"]
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
function isToolInputSchema(value) {
|
|
28
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value) && value.type === "object");
|
|
29
|
+
}
|
|
30
|
+
function capabilityActions(need) {
|
|
31
|
+
return need.capabilities.map((capability) => /^[A-Z]+_/.test(capability) ? [capability] : CAPABILITY_ACTIONS[need.connectorId]?.[capability] ?? []);
|
|
32
|
+
}
|
|
33
|
+
function missingConnectionCapabilities(need, actions) {
|
|
34
|
+
return capabilityActions(need).flatMap((alternatives, index) => alternatives.some((action) => actions.has(action)) ? [] : [need.capabilities[index]]);
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { capabilityActions, isToolInputSchema, missingConnectionCapabilities };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Config } from '../config/schema.js';
|
|
2
|
+
import type { SessionInput } from '../storage/sqlite/session-input-repository.js';
|
|
3
|
+
import { ComposioSessionsAdapter } from './composio-sessions.js';
|
|
4
|
+
import type { ConnectionWaitSnapshot } from '@xopcai/gateway-contract';
|
|
5
|
+
export type ConnectionAction = {
|
|
6
|
+
waitId: string;
|
|
7
|
+
expectedSessionId: string;
|
|
8
|
+
expectedVersion: number;
|
|
9
|
+
idempotencyKey: string;
|
|
10
|
+
action: 'connect' | 'check' | 'continue' | 'skip' | 'cancel' | 'select_account' | 'confirm_scope' | 'replace_source';
|
|
11
|
+
needKey?: string;
|
|
12
|
+
accountId?: string;
|
|
13
|
+
candidateRef?: string;
|
|
14
|
+
};
|
|
15
|
+
/** Authorization lives at click time. Chat history contains only immutable explanations. */
|
|
16
|
+
export declare class ConnectionRecoveryService {
|
|
17
|
+
private readonly deps;
|
|
18
|
+
private readonly busy;
|
|
19
|
+
private timer?;
|
|
20
|
+
private polling;
|
|
21
|
+
start(): void;
|
|
22
|
+
stop(): void;
|
|
23
|
+
poll(): Promise<void>;
|
|
24
|
+
constructor(deps: {
|
|
25
|
+
getConfig: () => Config;
|
|
26
|
+
saveConfig: (config: Config) => Promise<{
|
|
27
|
+
saved: boolean;
|
|
28
|
+
error?: string;
|
|
29
|
+
}>;
|
|
30
|
+
drain: (sessionKey: string) => void;
|
|
31
|
+
adapter?: ComposioSessionsAdapter;
|
|
32
|
+
});
|
|
33
|
+
private get adapter();
|
|
34
|
+
snapshot(sessionKey: string): ConnectionWaitSnapshot;
|
|
35
|
+
private view;
|
|
36
|
+
private checkCapabilities;
|
|
37
|
+
preflight(input: SessionInput): Promise<boolean>;
|
|
38
|
+
act(sessionKey: string, action: ConnectionAction): Promise<{
|
|
39
|
+
snapshot: ConnectionWaitSnapshot;
|
|
40
|
+
authorizationUrl?: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { createLogger } from "../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { getSqliteDatabase } from "../storage/sqlite/transaction.js";
|
|
4
|
+
import { cancelConnectionObjective, getActiveConnectionWait, getConnectionWait, listConnectionWaitsToCheck, publishConnectionWait, queueConnectionResolution, updateConnectionWait } from "../storage/sqlite/connection-wait-repository.js";
|
|
5
|
+
import { readCurrentSessionId } from "../storage/sqlite/session-repository.js";
|
|
6
|
+
import { getSessionInputState } from "../storage/sqlite/session-input-repository.js";
|
|
7
|
+
import { getConnectorInstallation, listConnectorConnections, upsertConnectorInstallation } from "../storage/sqlite/connector-repository.js";
|
|
8
|
+
import { ComposioSessionsAdapter } from "./composio-sessions.js";
|
|
9
|
+
import { getConfiguredComposioAuthConfigs, isComposioActionAllowedByCatalog, scopeForComposioAction } from "./composio.js";
|
|
10
|
+
import { getConnectorDefinition } from "./catalog.js";
|
|
11
|
+
import { capabilityActions, isToolInputSchema, missingConnectionCapabilities } from "./connection-capabilities.js";
|
|
12
|
+
import { connectorPrincipalForSession } from "./principal.js";
|
|
13
|
+
import { resolveConnectionCandidate } from "./connection-candidates.js";
|
|
14
|
+
import { getConnectorInstance } from "./instances.js";
|
|
15
|
+
import { installConnector } from "./install.js";
|
|
16
|
+
import { persistConfigMutation } from "../config/config-mutation.js";
|
|
17
|
+
import { randomUUID } from "node:crypto";
|
|
18
|
+
//#region src/connectors/connection-recovery-service.ts
|
|
19
|
+
init_logger();
|
|
20
|
+
const log = createLogger("Connectors:Recovery");
|
|
21
|
+
const SCOPE_ORDER = {
|
|
22
|
+
read: 1,
|
|
23
|
+
write: 2,
|
|
24
|
+
admin: 3
|
|
25
|
+
};
|
|
26
|
+
const INTENT_TTL = 30 * 6e4;
|
|
27
|
+
const ATTEMPT_TTL = 10 * 6e4;
|
|
28
|
+
/** Authorization lives at click time. Chat history contains only immutable explanations. */
|
|
29
|
+
var ConnectionRecoveryService = class {
|
|
30
|
+
busy = /* @__PURE__ */ new Set();
|
|
31
|
+
timer;
|
|
32
|
+
polling = false;
|
|
33
|
+
start() {
|
|
34
|
+
if (this.timer) return;
|
|
35
|
+
this.timer = setInterval(() => {
|
|
36
|
+
this.poll();
|
|
37
|
+
}, 5e3);
|
|
38
|
+
this.timer.unref();
|
|
39
|
+
this.poll();
|
|
40
|
+
}
|
|
41
|
+
stop() {
|
|
42
|
+
clearInterval(this.timer);
|
|
43
|
+
this.timer = void 0;
|
|
44
|
+
}
|
|
45
|
+
async poll() {
|
|
46
|
+
if (this.polling) return;
|
|
47
|
+
this.polling = true;
|
|
48
|
+
try {
|
|
49
|
+
for (const wait of listConnectionWaitsToCheck()) {
|
|
50
|
+
if (this.busy.has(wait.sessionKey)) continue;
|
|
51
|
+
await this.act(wait.sessionKey, {
|
|
52
|
+
waitId: wait.id,
|
|
53
|
+
expectedSessionId: wait.sessionId,
|
|
54
|
+
expectedVersion: wait.version,
|
|
55
|
+
idempotencyKey: randomUUID(),
|
|
56
|
+
action: "check"
|
|
57
|
+
}).catch(() => {});
|
|
58
|
+
}
|
|
59
|
+
} finally {
|
|
60
|
+
this.polling = false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
constructor(deps) {
|
|
64
|
+
this.deps = deps;
|
|
65
|
+
}
|
|
66
|
+
get adapter() {
|
|
67
|
+
return this.deps.adapter ?? new ComposioSessionsAdapter();
|
|
68
|
+
}
|
|
69
|
+
snapshot(sessionKey) {
|
|
70
|
+
if (!connectorPrincipalForSession(sessionKey).isLocalOwner) throw new Error("This connection belongs to another principal.");
|
|
71
|
+
const sessionId = readCurrentSessionId(getSqliteDatabase(), sessionKey);
|
|
72
|
+
if (!sessionId) throw new Error("SESSION_CHANGED");
|
|
73
|
+
const wait = getActiveConnectionWait(sessionKey);
|
|
74
|
+
return {
|
|
75
|
+
sessionId,
|
|
76
|
+
revision: getSessionInputState(sessionKey).revision,
|
|
77
|
+
wait: wait ? this.view(wait) : null
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
view(wait, verifiedIds) {
|
|
81
|
+
const needs = wait.needs.map((need) => {
|
|
82
|
+
const instance = getConnectorInstance(this.deps.getConfig(), need.connectorId);
|
|
83
|
+
const installation = getConnectorInstallation(`${need.connectorId}-${wait.principalId}`);
|
|
84
|
+
const scopeBlocked = Math.max(1, ...need.capabilities.filter((capability) => /^[A-Z]+_/.test(capability)).map((capability) => SCOPE_ORDER[scopeForComposioAction(capability).scope])) > SCOPE_ORDER[installation?.maxScope ?? "read"];
|
|
85
|
+
const blocked = scopeBlocked || instance?.enabled === false || installation?.enabled === false || Boolean(installation?.allowedAgentIds.length && !installation.allowedAgentIds.includes(wait.agentId));
|
|
86
|
+
const all = listConnectorConnections({
|
|
87
|
+
principalId: wait.principalId,
|
|
88
|
+
connectorId: need.connectorId
|
|
89
|
+
});
|
|
90
|
+
const active = all.filter((connection) => connection.status === "active" && (!verifiedIds || verifiedIds.has(connection.id)) && (!need.accountId || connection.accountId === need.accountId) && (!installation?.selectedConnectionIds.length || installation.selectedConnectionIds.includes(connection.id)));
|
|
91
|
+
const selected = !verifiedIds && need.unavailable ? void 0 : need.attempt ? active.find((connection) => connection.providerConnectionId === need.attempt?.connectionId) : need.connectionId ? active.find((connection) => connection.id === need.connectionId) : active.length === 1 && !need.accountSelector ? active[0] : void 0;
|
|
92
|
+
const phase = blocked || selected && need.capabilityError ? "blocked" : selected && instance ? "ready" : active.length > 1 || need.accountSelector && active.length > 0 && !need.connectionId ? "choose_account" : need.attempt && need.attempt.expiresAt > Date.now() ? "authorizing" : need.unavailable || all.some((connection) => [
|
|
93
|
+
"expired",
|
|
94
|
+
"revoked",
|
|
95
|
+
"failed"
|
|
96
|
+
].includes(connection.status)) ? "reconnect" : "connect";
|
|
97
|
+
const alternatives = ["composio-gmail", "composio-outlook"].includes(need.connectorId) ? ["composio-gmail", "composio-outlook"].filter((id) => id !== need.connectorId).map((id) => ({
|
|
98
|
+
candidateRef: id,
|
|
99
|
+
label: getConnectorDefinition(id)?.displayName ?? id
|
|
100
|
+
})) : [];
|
|
101
|
+
return {
|
|
102
|
+
...need,
|
|
103
|
+
alternatives,
|
|
104
|
+
connectionId: selected?.id ?? need.connectionId,
|
|
105
|
+
phase,
|
|
106
|
+
accounts: active.map((connection) => ({
|
|
107
|
+
id: connection.id,
|
|
108
|
+
label: connection.alias ?? String(connection.identity.email ?? connection.identity.name ?? connection.id)
|
|
109
|
+
})),
|
|
110
|
+
...need.capabilityError && selected ? { reason: need.capabilityError } : {},
|
|
111
|
+
...blocked ? { reason: scopeBlocked ? "This action needs broader permissions. Review connector permissions in settings." : "This app is disabled or unavailable to the current agent. Review connector settings." } : {}
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
const ready = needs.every((need) => need.phase === "ready");
|
|
115
|
+
const review = wait.reviewRequired || Date.now() - wait.createdAt > INTENT_TTL && !wait.scopeConfirmedAt;
|
|
116
|
+
const { intent: _intent, checkpoint: _checkpoint, ...visible } = wait;
|
|
117
|
+
return {
|
|
118
|
+
...visible,
|
|
119
|
+
needs,
|
|
120
|
+
timeRange: wait.checkpoint.timeRange,
|
|
121
|
+
phase: wait.status === "queued" ? "queued" : ready ? review ? "review_scope" : "ready" : "needs_connection"
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
async checkCapabilities(wait, verified) {
|
|
125
|
+
const views = this.view({
|
|
126
|
+
...wait,
|
|
127
|
+
needs: wait.needs.map((need) => ({
|
|
128
|
+
...need,
|
|
129
|
+
capabilityError: void 0
|
|
130
|
+
}))
|
|
131
|
+
}, verified).needs;
|
|
132
|
+
return Promise.all(wait.needs.map(async (need) => {
|
|
133
|
+
if (views.find((view) => view.key === need.key)?.phase !== "ready") return {
|
|
134
|
+
...need,
|
|
135
|
+
capabilityError: void 0
|
|
136
|
+
};
|
|
137
|
+
try {
|
|
138
|
+
const definition = getConnectorDefinition(need.connectorId);
|
|
139
|
+
if (definition?.runtime.type !== "composio" || definition.runtime.role !== "toolkit") throw new Error("Unsupported connector");
|
|
140
|
+
const toolkit = definition.runtime.toolkit;
|
|
141
|
+
const result = await (await this.adapter.createSession({
|
|
142
|
+
principalId: wait.principalId,
|
|
143
|
+
toolkits: [toolkit],
|
|
144
|
+
authConfigs: getConfiguredComposioAuthConfigs(this.deps.getConfig(), [toolkit])
|
|
145
|
+
})).search({
|
|
146
|
+
query: `${toolkit} ${need.capabilities.join(" ")} ${capabilityActions(need).flat().join(" ")}`,
|
|
147
|
+
toolkits: [toolkit]
|
|
148
|
+
});
|
|
149
|
+
const schemas = result && typeof result === "object" ? result.toolSchemas : void 0;
|
|
150
|
+
const missing = missingConnectionCapabilities(need, new Set(Object.entries(schemas && typeof schemas === "object" ? schemas : {}).filter(([action, value]) => value && typeof value === "object" && isToolInputSchema(value.inputSchema) && isComposioActionAllowedByCatalog(action)).map(([action]) => action)));
|
|
151
|
+
if (missing.length) log.warn({
|
|
152
|
+
sessionKey: wait.sessionKey,
|
|
153
|
+
connectorId: need.connectorId,
|
|
154
|
+
missingCapabilities: missing
|
|
155
|
+
}, "Connected app lacks required tool contracts");
|
|
156
|
+
return {
|
|
157
|
+
...need,
|
|
158
|
+
capabilityError: missing.length ? `${need.label} is connected, but the required tools are unavailable. Retry the tool check; reconnecting will not fix this.` : void 0
|
|
159
|
+
};
|
|
160
|
+
} catch (err) {
|
|
161
|
+
log.warn({
|
|
162
|
+
err,
|
|
163
|
+
sessionKey: wait.sessionKey,
|
|
164
|
+
connectorId: need.connectorId
|
|
165
|
+
}, "Connected app capability check failed");
|
|
166
|
+
return {
|
|
167
|
+
...need,
|
|
168
|
+
capabilityError: `${need.label} is connected, but its tools could not be checked. Retry the tool check.`
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
172
|
+
}
|
|
173
|
+
async preflight(input) {
|
|
174
|
+
if (input.kind !== "connection_resume") return true;
|
|
175
|
+
const wait = input.payload ? getConnectionWait(input.payload.waitId) : void 0;
|
|
176
|
+
if (!wait || wait.status !== "queued" || wait.queuedInputId !== input.id || wait.sessionId !== readCurrentSessionId(getSqliteDatabase(), input.sessionKey)) return false;
|
|
177
|
+
if (wait.resolution === "skipped") return true;
|
|
178
|
+
try {
|
|
179
|
+
const fresh = await this.adapter.syncConnections({ principalId: wait.principalId });
|
|
180
|
+
const verified = new Set(fresh.filter((item) => item.status === "active").map((item) => item.id));
|
|
181
|
+
wait.needs = await this.checkCapabilities(wait, verified);
|
|
182
|
+
const ready = this.view(wait, verified).needs.every((need) => need.phase === "ready");
|
|
183
|
+
wait.needs = wait.needs.map((need) => ({
|
|
184
|
+
...need,
|
|
185
|
+
unavailable: !fresh.some((item) => item.id === need.connectionId && item.status === "active")
|
|
186
|
+
}));
|
|
187
|
+
if (getConnectionWait(wait.id)?.version !== wait.version) return false;
|
|
188
|
+
if (ready && wait.intent && wait.intent.validUntil > Date.now() && wait.intent.objectiveRevision === wait.objectiveRevision) return true;
|
|
189
|
+
} catch {}
|
|
190
|
+
if (getConnectionWait(wait.id)?.version === wait.version) {
|
|
191
|
+
updateConnectionWait({
|
|
192
|
+
...wait,
|
|
193
|
+
status: "open",
|
|
194
|
+
intent: void 0,
|
|
195
|
+
queuedInputId: void 0,
|
|
196
|
+
objectiveRevision: wait.objectiveRevision + 1
|
|
197
|
+
}, wait.version);
|
|
198
|
+
publishConnectionWait(input.sessionKey);
|
|
199
|
+
}
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
async act(sessionKey, action) {
|
|
203
|
+
const ownsLock = !this.busy.has(sessionKey);
|
|
204
|
+
if (!ownsLock && ![
|
|
205
|
+
"cancel",
|
|
206
|
+
"skip",
|
|
207
|
+
"replace_source"
|
|
208
|
+
].includes(action.action)) throw new Error("WAIT_CHANGED");
|
|
209
|
+
if (ownsLock) this.busy.add(sessionKey);
|
|
210
|
+
try {
|
|
211
|
+
const snapshot = this.snapshot(sessionKey);
|
|
212
|
+
let wait = getConnectionWait(action.waitId);
|
|
213
|
+
if (!wait || wait.sessionKey !== sessionKey || wait.principalId !== "local-owner" || wait.sessionId !== action.expectedSessionId || snapshot.sessionId !== action.expectedSessionId) throw new Error("SESSION_CHANGED");
|
|
214
|
+
if (wait.lastAction?.key === action.idempotencyKey && wait.lastAction.action === action.action) return { snapshot };
|
|
215
|
+
if (wait.status !== "open" || wait.version !== action.expectedVersion) throw new Error("WAIT_CHANGED");
|
|
216
|
+
wait = {
|
|
217
|
+
...wait,
|
|
218
|
+
lastAction: {
|
|
219
|
+
key: action.idempotencyKey,
|
|
220
|
+
action: action.action
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
if (action.action === "cancel") cancelConnectionObjective(sessionKey);
|
|
224
|
+
else if (action.action === "replace_source") {
|
|
225
|
+
const need = wait.needs.find((need) => need.key === action.needKey);
|
|
226
|
+
if (!need || !this.view(wait).needs.find((item) => item.key === need.key)?.alternatives?.some((item) => item.candidateRef === action.candidateRef)) throw new Error("Unsupported replacement.");
|
|
227
|
+
const replacement = resolveConnectionCandidate(action.candidateRef);
|
|
228
|
+
updateConnectionWait({
|
|
229
|
+
...wait,
|
|
230
|
+
summary: `${wait.summary}\nUse ${replacement.label} instead of ${need.label}, as confirmed by the user.`,
|
|
231
|
+
needs: wait.needs.map((item) => item.key === need.key ? replacement : item),
|
|
232
|
+
objectiveRevision: wait.objectiveRevision + 1,
|
|
233
|
+
intent: void 0
|
|
234
|
+
}, wait.version);
|
|
235
|
+
} else if (action.action === "skip") {
|
|
236
|
+
queueConnectionResolution({
|
|
237
|
+
...wait,
|
|
238
|
+
intent: void 0
|
|
239
|
+
}, "skipped");
|
|
240
|
+
this.deps.drain(sessionKey);
|
|
241
|
+
} else if (action.action === "connect") {
|
|
242
|
+
const need = wait.needs.find((need) => need.key === action.needKey);
|
|
243
|
+
if (!need) throw new Error("Unknown connection requirement.");
|
|
244
|
+
if (this.view(wait).needs.find((item) => item.key === need.key)?.phase === "blocked") throw new Error("Connector policy blocks this connection.");
|
|
245
|
+
const definition = getConnectorDefinition(need.connectorId);
|
|
246
|
+
if (definition?.runtime.type !== "composio" || definition.runtime.role !== "toolkit") throw new Error("Unsupported connector.");
|
|
247
|
+
const attemptId = randomUUID();
|
|
248
|
+
wait = updateConnectionWait({
|
|
249
|
+
...wait,
|
|
250
|
+
intent: {
|
|
251
|
+
objectiveRevision: wait.objectiveRevision,
|
|
252
|
+
validUntil: Date.now() + INTENT_TTL
|
|
253
|
+
},
|
|
254
|
+
needs: wait.needs.map((item) => item.key === need.key ? {
|
|
255
|
+
...item,
|
|
256
|
+
attempt: {
|
|
257
|
+
id: attemptId,
|
|
258
|
+
expiresAt: Date.now() + ATTEMPT_TTL
|
|
259
|
+
}
|
|
260
|
+
} : item)
|
|
261
|
+
}, wait.version);
|
|
262
|
+
publishConnectionWait(sessionKey);
|
|
263
|
+
const config = this.deps.getConfig();
|
|
264
|
+
if (!getConnectorInstance(config, need.connectorId)) await persistConfigMutation({
|
|
265
|
+
config,
|
|
266
|
+
mutate: () => installConnector(config, need.connectorId, {}),
|
|
267
|
+
save: () => this.deps.saveConfig(config)
|
|
268
|
+
});
|
|
269
|
+
const installationId = `${need.connectorId}-${wait.principalId}`;
|
|
270
|
+
if (!getConnectorInstallation(installationId)) upsertConnectorInstallation({
|
|
271
|
+
id: installationId,
|
|
272
|
+
connectorId: need.connectorId,
|
|
273
|
+
principalId: wait.principalId,
|
|
274
|
+
enabled: true,
|
|
275
|
+
allowedAgentIds: [],
|
|
276
|
+
maxScope: "read",
|
|
277
|
+
confirmationPolicy: "writes",
|
|
278
|
+
selectedConnectionIds: []
|
|
279
|
+
});
|
|
280
|
+
const auth = await this.adapter.authorize({
|
|
281
|
+
principalId: wait.principalId,
|
|
282
|
+
toolkit: definition.runtime.toolkit,
|
|
283
|
+
installationId,
|
|
284
|
+
authConfigId: getConfiguredComposioAuthConfigs(config, [definition.runtime.toolkit])?.[definition.runtime.toolkit]
|
|
285
|
+
});
|
|
286
|
+
const latest = getConnectionWait(wait.id);
|
|
287
|
+
if (!latest || latest.version !== wait.version || latest.status !== "open") throw new Error("WAIT_CHANGED");
|
|
288
|
+
updateConnectionWait({
|
|
289
|
+
...wait,
|
|
290
|
+
needs: wait.needs.map((item) => item.key === need.key ? {
|
|
291
|
+
...item,
|
|
292
|
+
attempt: {
|
|
293
|
+
id: attemptId,
|
|
294
|
+
connectionId: auth.connectionId,
|
|
295
|
+
expiresAt: Date.now() + ATTEMPT_TTL
|
|
296
|
+
}
|
|
297
|
+
} : item)
|
|
298
|
+
}, wait.version);
|
|
299
|
+
publishConnectionWait(sessionKey);
|
|
300
|
+
log.info({
|
|
301
|
+
sessionKey,
|
|
302
|
+
waitId: wait.id,
|
|
303
|
+
objectiveRevision: wait.objectiveRevision,
|
|
304
|
+
phase: "authorization_started"
|
|
305
|
+
}, "Connection authorization started");
|
|
306
|
+
return {
|
|
307
|
+
snapshot: this.snapshot(sessionKey),
|
|
308
|
+
authorizationUrl: auth.connectUrl
|
|
309
|
+
};
|
|
310
|
+
} else {
|
|
311
|
+
const fresh = await this.adapter.syncConnections({ principalId: wait.principalId });
|
|
312
|
+
const verified = new Set(fresh.filter((item) => item.status === "active").map((item) => item.id));
|
|
313
|
+
const latest = getConnectionWait(wait.id);
|
|
314
|
+
if (!latest || latest.version !== wait.version || latest.status !== "open") throw new Error("WAIT_CHANGED");
|
|
315
|
+
let needs = wait.needs.map((need) => {
|
|
316
|
+
const authorized = fresh.find((item) => item.providerConnectionId === need.attempt?.connectionId && item.status === "active");
|
|
317
|
+
return authorized ? {
|
|
318
|
+
...need,
|
|
319
|
+
unavailable: false,
|
|
320
|
+
...need.accountSelector && !need.accountId ? {} : {
|
|
321
|
+
connectionId: authorized.id,
|
|
322
|
+
accountId: authorized.accountId
|
|
323
|
+
},
|
|
324
|
+
attempt: void 0
|
|
325
|
+
} : {
|
|
326
|
+
...need,
|
|
327
|
+
unavailable: !fresh.some((item) => item.connectorId === need.connectorId && item.status === "active" && (!need.connectionId || item.id === need.connectionId) && (!need.accountId || item.accountId === need.accountId))
|
|
328
|
+
};
|
|
329
|
+
});
|
|
330
|
+
if (action.action === "select_account") {
|
|
331
|
+
const need = needs.find((item) => item.key === action.needKey);
|
|
332
|
+
const connection = fresh.find((item) => item.id === action.accountId && item.connectorId === need?.connectorId && item.status === "active");
|
|
333
|
+
if (!need || !connection || !this.view(wait, verified).needs.find((item) => item.key === need.key)?.accounts.some((item) => item.id === connection.id)) throw new Error("Account is unavailable.");
|
|
334
|
+
needs = needs.map((item) => item.key === need.key ? {
|
|
335
|
+
...item,
|
|
336
|
+
connectionId: connection.id,
|
|
337
|
+
accountId: connection.accountId,
|
|
338
|
+
unavailable: false
|
|
339
|
+
} : item);
|
|
340
|
+
}
|
|
341
|
+
needs = await this.checkCapabilities({
|
|
342
|
+
...wait,
|
|
343
|
+
needs
|
|
344
|
+
}, verified);
|
|
345
|
+
if (getConnectionWait(wait.id)?.version !== wait.version) throw new Error("WAIT_CHANGED");
|
|
346
|
+
const explicitContinue = action.action === "continue" || action.action === "confirm_scope";
|
|
347
|
+
wait = updateConnectionWait({
|
|
348
|
+
...wait,
|
|
349
|
+
needs,
|
|
350
|
+
...action.action === "confirm_scope" ? {
|
|
351
|
+
scopeConfirmedAt: Date.now(),
|
|
352
|
+
reviewRequired: false
|
|
353
|
+
} : {},
|
|
354
|
+
...needs.some((need) => need.capabilityError) ? { intent: void 0 } : explicitContinue ? { intent: {
|
|
355
|
+
objectiveRevision: wait.objectiveRevision,
|
|
356
|
+
validUntil: Date.now() + INTENT_TTL
|
|
357
|
+
} } : {}
|
|
358
|
+
}, wait.version);
|
|
359
|
+
const view = this.view(wait, verified);
|
|
360
|
+
if (view.phase === "ready" && wait.intent?.objectiveRevision === wait.objectiveRevision && wait.intent.validUntil > Date.now()) {
|
|
361
|
+
wait = queueConnectionResolution({
|
|
362
|
+
...wait,
|
|
363
|
+
needs: view.needs.map(({ phase: _phase, accounts: _accounts, reason: _reason, alternatives: _alternatives, ...need }) => need)
|
|
364
|
+
}, "continued");
|
|
365
|
+
log.info({
|
|
366
|
+
sessionKey,
|
|
367
|
+
waitId: wait.id,
|
|
368
|
+
objectiveRevision: wait.objectiveRevision,
|
|
369
|
+
phase: "resume_queued"
|
|
370
|
+
}, "Connection continuation queued");
|
|
371
|
+
this.deps.drain(sessionKey);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
publishConnectionWait(sessionKey);
|
|
375
|
+
return { snapshot: this.snapshot(sessionKey) };
|
|
376
|
+
} catch (error) {
|
|
377
|
+
const wait = getActiveConnectionWait(sessionKey);
|
|
378
|
+
if (action.action === "connect" && wait?.status === "open" && wait.lastAction?.key === action.idempotencyKey) {
|
|
379
|
+
updateConnectionWait({
|
|
380
|
+
...wait,
|
|
381
|
+
intent: void 0,
|
|
382
|
+
needs: wait.needs.map((need) => need.key === action.needKey ? {
|
|
383
|
+
...need,
|
|
384
|
+
attempt: void 0
|
|
385
|
+
} : need)
|
|
386
|
+
}, wait.version);
|
|
387
|
+
publishConnectionWait(sessionKey);
|
|
388
|
+
}
|
|
389
|
+
throw error;
|
|
390
|
+
} finally {
|
|
391
|
+
if (ownsLock) this.busy.delete(sessionKey);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
//#endregion
|
|
396
|
+
export { ConnectionRecoveryService };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
2
1
|
import { materializeConnectorMcpServer } from "./materialize.js";
|
|
3
2
|
import { getConnectorInstance } from "./instances.js";
|
|
3
|
+
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
4
4
|
import { listBundleMcpServerCapabilitiesForGateway } from "../agent/mcp/bundle-mcp-gateway.js";
|
|
5
5
|
//#region src/connectors/health.ts
|
|
6
6
|
function classifyConnectorHealthError(error) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Config } from '../config/schema.js';
|
|
2
|
-
import type { MemoryManager } from '../agent/memory/manager.js';
|
|
3
2
|
import { type ConnectorLearningJob } from '../storage/sqlite/index.js';
|
|
4
3
|
import { ComposioSessionsAdapter } from './composio-sessions.js';
|
|
5
4
|
export type ConnectorLearningCoordinator = {
|
|
@@ -17,7 +16,6 @@ export type ConnectorLearningCoordinator = {
|
|
|
17
16
|
export declare function startConnectorLearningCoordinator(options: {
|
|
18
17
|
getConfig: () => Config;
|
|
19
18
|
resolveAgentId: () => string;
|
|
20
|
-
getMemoryManager: () => MemoryManager;
|
|
21
19
|
emit?: (type: string, payload: unknown) => void;
|
|
22
20
|
intervalMs?: number;
|
|
23
21
|
initialDelayMs?: number;
|
|
@@ -9,13 +9,13 @@ import { connectorIdentityKey, normalizeConnectorIdentity } from "./connector-id
|
|
|
9
9
|
import { ComposioSessionsAdapter } from "./composio-sessions.js";
|
|
10
10
|
import { buildConnectorLearningArguments, getConnectorLearningPlan } from "./learning-recipes.js";
|
|
11
11
|
import { getConnectorDefinition } from "./catalog.js";
|
|
12
|
-
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, listUnderstandingSourceRuns, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
13
12
|
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
14
13
|
import { ConnectedKnowledgePipeline } from "../knowledge/connected-knowledge-pipeline.js";
|
|
15
14
|
import "../knowledge/index.js";
|
|
16
15
|
import { ingestComposioConnectedSource } from "./connected-source-ingestion.js";
|
|
17
16
|
import { deriveConnectedSourceUnderstanding } from "./connected-source-understanding.js";
|
|
18
17
|
import { listConnectedContentCandidates, readConnectedContent } from "./content-enrichment.js";
|
|
18
|
+
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, listUnderstandingSourceRuns, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
19
19
|
//#region src/connectors/learning-coordinator.ts
|
|
20
20
|
init_logger();
|
|
21
21
|
const log = createLogger("ConnectorLearning");
|
|
@@ -59,7 +59,7 @@ function ensureUnderstandingSourceRun(job, toolkit, displayName) {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
function learningEnabled(config) {
|
|
62
|
-
return config.userContext.enabled && config.userContext.
|
|
62
|
+
return config.userContext.enabled && config.userContext.userModel.enabled;
|
|
63
63
|
}
|
|
64
64
|
function startConnectorLearningCoordinator(options) {
|
|
65
65
|
const intervalMs = Math.max(2e3, Math.min(options.intervalMs ?? 1e4, 6e4));
|
|
@@ -209,7 +209,7 @@ function startConnectorLearningCoordinator(options) {
|
|
|
209
209
|
publish(updateConnectorLearningJob(job.id, { phase: "deriving" }));
|
|
210
210
|
let semantic = {
|
|
211
211
|
created: 0,
|
|
212
|
-
|
|
212
|
+
knowledgeCount: 0,
|
|
213
213
|
status: "completed"
|
|
214
214
|
};
|
|
215
215
|
try {
|
|
@@ -218,14 +218,13 @@ function startConnectorLearningCoordinator(options) {
|
|
|
218
218
|
agentId: job.agentId,
|
|
219
219
|
sourceInstanceId: job.sourceInstanceId,
|
|
220
220
|
sourceRunId: sourceRun.id,
|
|
221
|
-
processingPolicy: getUnderstandingSourceGrant(sourceRun.grantId)?.processingPolicy ?? "local_only"
|
|
222
|
-
memoryManager: options.getMemoryManager()
|
|
221
|
+
processingPolicy: getUnderstandingSourceGrant(sourceRun.grantId)?.processingPolicy ?? "local_only"
|
|
223
222
|
});
|
|
224
223
|
} catch (error) {
|
|
225
224
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
226
225
|
semantic = {
|
|
227
226
|
created: 0,
|
|
228
|
-
|
|
227
|
+
knowledgeCount: 0,
|
|
229
228
|
status: "failed",
|
|
230
229
|
error: CONNECTED_SOURCE_ANALYSIS_FAILED
|
|
231
230
|
};
|
|
@@ -235,7 +234,7 @@ function startConnectorLearningCoordinator(options) {
|
|
|
235
234
|
connectorId: job.connectorId
|
|
236
235
|
}, `Connected source semantic analysis failed: ${errorMessage}`);
|
|
237
236
|
}
|
|
238
|
-
const candidatesCreated = semantic.created + semantic.
|
|
237
|
+
const candidatesCreated = semantic.created + semantic.knowledgeCount;
|
|
239
238
|
const incomplete = enrichmentErrors.length > 0 || semantic.status !== "completed";
|
|
240
239
|
const completed = updateConnectorLearningJob(job.id, {
|
|
241
240
|
status: "completed",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
2
|
+
//#region src/connectors/principal.ts
|
|
3
|
+
init_session_key();
|
|
4
|
+
function connectorPrincipalForSession(sessionKey) {
|
|
5
|
+
const parsed = parseSessionKey(sessionKey);
|
|
6
|
+
if (!parsed || parsed.source === "cli" || parsed.source === "webchat") return {
|
|
7
|
+
principalId: "local-owner",
|
|
8
|
+
agentId: parsed?.agentId,
|
|
9
|
+
isLocalOwner: true
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
principalId: `channel:${parsed.source}:${parsed.accountId}:${parsed.peerKind}:${parsed.peerId}`,
|
|
13
|
+
agentId: parsed.agentId,
|
|
14
|
+
isLocalOwner: false
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { connectorPrincipalForSession };
|
|
@@ -61,10 +61,10 @@ export declare const GATEWAY_BUILTIN_TOOLS: readonly [{
|
|
|
61
61
|
readonly zh: "查看当前会话状态和用量。";
|
|
62
62
|
};
|
|
63
63
|
}, {
|
|
64
|
-
readonly id: "
|
|
64
|
+
readonly id: "memory_maintenance";
|
|
65
65
|
readonly description: {
|
|
66
|
-
readonly en: "
|
|
67
|
-
readonly zh: "
|
|
66
|
+
readonly en: "Inspect deterministic memory maintenance.";
|
|
67
|
+
readonly zh: "查看确定性的记忆整理任务。";
|
|
68
68
|
};
|
|
69
69
|
}, {
|
|
70
70
|
readonly id: "tool_manual";
|
|
@@ -163,16 +163,34 @@ export declare const GATEWAY_BUILTIN_TOOLS: readonly [{
|
|
|
163
163
|
readonly zh: "将文本转换为语音音频。";
|
|
164
164
|
};
|
|
165
165
|
}, {
|
|
166
|
-
readonly id: "
|
|
166
|
+
readonly id: "user_context_search";
|
|
167
167
|
readonly description: {
|
|
168
|
-
readonly en: "Search
|
|
169
|
-
readonly zh: "
|
|
168
|
+
readonly en: "Search typed user facts and preferences.";
|
|
169
|
+
readonly zh: "搜索结构化的用户事实与偏好。";
|
|
170
170
|
};
|
|
171
171
|
}, {
|
|
172
|
-
readonly id: "
|
|
172
|
+
readonly id: "user_context_get";
|
|
173
173
|
readonly description: {
|
|
174
|
-
readonly en: "Read a
|
|
175
|
-
readonly zh: "
|
|
174
|
+
readonly en: "Read a typed user assertion.";
|
|
175
|
+
readonly zh: "读取一条结构化用户事实。";
|
|
176
|
+
};
|
|
177
|
+
}, {
|
|
178
|
+
readonly id: "knowledge_search";
|
|
179
|
+
readonly description: {
|
|
180
|
+
readonly en: "Search scoped project and workspace knowledge.";
|
|
181
|
+
readonly zh: "搜索有作用域的项目与工作区知识。";
|
|
182
|
+
};
|
|
183
|
+
}, {
|
|
184
|
+
readonly id: "knowledge_get";
|
|
185
|
+
readonly description: {
|
|
186
|
+
readonly en: "Read a scoped knowledge item.";
|
|
187
|
+
readonly zh: "读取一条有作用域的知识。";
|
|
188
|
+
};
|
|
189
|
+
}, {
|
|
190
|
+
readonly id: "knowledge_write";
|
|
191
|
+
readonly description: {
|
|
192
|
+
readonly en: "Store a reviewable knowledge candidate.";
|
|
193
|
+
readonly zh: "保存一条可审查的知识候选。";
|
|
176
194
|
};
|
|
177
195
|
}, {
|
|
178
196
|
readonly id: "session_search";
|
|
@@ -247,4 +265,4 @@ export declare const GATEWAY_BUILTIN_TOOLS: readonly [{
|
|
|
247
265
|
readonly zh: "使用已验证的参数执行选定的外部工具。";
|
|
248
266
|
};
|
|
249
267
|
}];
|
|
250
|
-
export declare const GATEWAY_BUILTIN_TOOL_IDS: ("automation" | "workflow" | "find" | "image" | "
|
|
268
|
+
export declare const GATEWAY_BUILTIN_TOOL_IDS: ("automation" | "workflow" | "find" | "image" | "web_search" | "web_fetch" | "browser_use" | "grep" | "session_search" | "read_file" | "list_dir" | "write_file" | "apply_patch" | "exec_command" | "update_plan" | "todo" | "clarify" | "web_extract" | "image_generate" | "skills_list" | "skill_view" | "skill_manage" | "skills_marketplace_search" | "xopc_tool_search" | "xopc_tool_describe" | "xopc_tool_execute" | "user_context_search" | "user_context_get" | "knowledge_search" | "knowledge_get" | "knowledge_write" | "send_message" | "send_media" | "read_media" | "create_share" | "session_status" | "memory_maintenance" | "tool_manual" | "delegate_task" | "skill_install" | "text_to_speech" | "execute_code" | "create_desktop_pet")[];
|