@xopcai/xopc 0.0.249 → 0.0.251
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-B759R_qf.js → activity-store-DfBjTSo9.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BUu7EnwM.js → agent-avatar-dicebear-Bo_dmLv8.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-kILWelNb.js +1 -0
- package/dist/gateway/static/root/assets/{agents-DK9HjHO0.js → agents-yuUn8n-f.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Cg0v7Lpn.js → api-zxpcJfgj.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C9DkCW_d.js → app-management-settings-panel-Cz56nrVF.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CFggS95Y.js → appearance-settings-DxSws5U4.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BnizTdgs.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BQrilVVv.js → archive-plugin-7k15-hqo.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BG0BliqV.js → attachment-load-B-SFpjd9.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Bo4RiTkh.js → automations-page-Qy36j19q.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CZRKqSqY.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BCnyNU0C.js → binary-plugins-CPOZQt8F.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Db8DlVvg.js → block-editor-DhvVlIp9.js} +4 -4
- package/dist/gateway/static/root/assets/browser-settings-page-pN5LbChY.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-C71vfl0b.js → browser-workflow-inputs-BX1-uM9L.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-vvmSYKsO.js → browser-workflows-page-C65MI57t.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CJw2e16J.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-CRgjb4Ck.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-CKyV3jY5.js → channels-status-swr-CX-yWwLD.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-B1Xd6OFB.js → chat-terminal-dock-1PJoxRuV.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-Dcpdy06y.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-D-F9vjtE.js → cron-expression-CBCc6zFA.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-B2OoYvic.js → date-picker-u8K5Kt_N.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BiGx9Sbj.js → dependency-picker-y_i_cnpz.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BNMRqipe.js → desktop-pet-DyL0JxLm.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DeYbIV7A.js → desktop-pet-settings-d2d_IsyP.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-COyn05ub.js → extension-debug-page-DqIBKJwl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-oH43chS2.js → extension-page-DUW1xxj2.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BMO59994.js → extension-settings-page-BHY9qaNw.js} +1 -1
- package/dist/gateway/static/root/assets/files-BArWTfr7.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-cimpViGk.js → gateway-config-api-e3BRcgDx.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BGdHwT4e.js → gateway-config-swr-CMNbl0FZ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BHJtnSic.js → gateway-settings-Cheo0Rkc.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CuaM3b4c.js → gateway-startup-retry-CR7Xg8As.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DNhrZHqx.js → heartbeat-settings-7CD9iPR7.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DVrTRqNc.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-D7duj7Uj.js → image-generation-api-C5mn73ca.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DGeGmj4k.css → index-B7CX4Qob.css} +1 -1
- package/dist/gateway/static/root/assets/index-BHrpyJ4t.js +72 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-D8Zw_lYd.js → keyboard-shortcuts-settings-BtlqMleF.js} +1 -1
- package/dist/gateway/static/root/assets/languages-5WaOu0Lf.js +2 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-BjxfkjxE.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-CvPDPRwb.js → local-apps-page-B7xqQe2s.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-zEL8bkwx.js → locale-store-CF4erhjB.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-kACaPZKL.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-D8moh99U.js → management-settings-A432siER.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-editor-BjMTIM-m.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DGRN-8wP.js → markdown-view-CQvzsE24.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BLaE5b1Y.js → media-plugins-CpvYiauZ.js} +1 -1
- package/dist/gateway/static/root/assets/messages-Cf5hpZE6.js +3 -0
- package/dist/gateway/static/root/assets/{mobile-pairing-wizard-DiVDuCxl.js → mobile-pairing-wizard-DyjVGngO.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-CUd8O4K7.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BLQwd39W.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-BFMGjA60.js → page-tabs-B3FKzjR6.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DNEWZN7H.js → preview-open-alternatives-DnjrwAHD.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Co5u7asH.js → product-open-page-COcr_NUJ.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-NttW338u.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BzH8pjEz.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-Cg92zSod.js → registry-api-BsRBlji7.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BxpjSDnL.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-C0ByNmlV.js → runtime-tools-settings-panel-LO4wZ_dO.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-Dq_VQpuY.js → schema-form-crcj4-Pm.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BLMaibOb.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BRvvKhoH.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CZu6FX4k.js → settings-form-section-Bl4MvTmq.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-S8ekeUZd.js → settings-page-DplrjZ6x.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BdVmwXMv.js → setup-status-panel-DTOsxQC1.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-D2fEidbn.js → share-preview-page-CJP1kURj.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-CemgzEi4.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BWYanBlQ.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-AYiPlgZE.js → skills-page-DsjcKg9Q.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DGzl-ib-.js → skills-page.utils-D6gWBbvy.js} +1 -1
- package/dist/gateway/static/root/assets/source-workspace-editor-CVWzt0oT.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-5Xd5mIiR.js → system-settings-panel-_eCXfqCo.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-BQAUaCDD.js → task-detail-page-D0Z_K5JT.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-ZVClZKQ0.js → theme-store-BOgkc_9D.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CdZN1Jin.js → tunnel-api-W5mktxl1.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-czRI0NBc.js → use-autosave-Na2DYzT3.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-B_-SNat-.js +2 -0
- package/dist/gateway/static/root/assets/{vendor-codemirror--gTq3YAI.js → vendor-codemirror-Qdcjid65.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-8YEvA3cU.js → voice-api-key-field-OXweUxS_.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-CopF64lY.js → voice-config-api-C-ryeIxj.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-keLtqYYJ.js → work-discovery-overlay-BqOsO47I.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Dy5WgYMO.js → workflow-run-setup-panel-B9S_lfT1.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CNOT2Coo.js +5 -0
- package/dist/gateway/static/root/index.html +11 -11
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/user-message-display.js +18 -0
- package/dist/src/agent/agent-instance-gateway.d.ts +1 -1
- package/dist/src/agent/agent-manager.d.ts +9 -9
- package/dist/src/agent/agent-manager.js +50 -32
- package/dist/src/agent/background-review/prompts.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.js +11 -2
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/context/audit.d.ts +3 -1
- package/dist/src/agent/context/audit.js +32 -6
- package/dist/src/agent/context/coordinator.d.ts +6 -1
- package/dist/src/agent/context/coordinator.js +14 -13
- package/dist/src/agent/context/execution-context.d.ts +6 -47
- package/dist/src/agent/context/execution-context.js +79 -15
- package/dist/src/agent/context/execution-context.types.d.ts +50 -0
- package/dist/src/agent/context/execution-context.types.js +1 -0
- package/dist/src/agent/context/execution-scope.d.ts +5 -1
- package/dist/src/agent/context/execution-scope.js +6 -2
- package/dist/src/agent/context/project-context.d.ts +3 -0
- package/dist/src/agent/context/project-context.js +5 -3
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/external-tools/index.d.ts +1 -0
- package/dist/src/agent/external-tools/index.js +1 -0
- package/dist/src/agent/external-tools/memory-provider.d.ts +1 -0
- package/dist/src/agent/external-tools/memory-provider.js +1 -0
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +5 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/memory/compaction-promotion.d.ts +1 -0
- package/dist/src/agent/memory/compaction-promotion.js +7 -2
- package/dist/src/agent/memory/index.d.ts +1 -1
- package/dist/src/agent/memory/index.js +3 -3
- package/dist/src/agent/memory/memory-config.d.ts +0 -5
- package/dist/src/agent/memory/memory-config.js +1 -8
- package/dist/src/agent/orchestration/context-overflow.js +1 -0
- package/dist/src/agent/service/direct-turn-helpers.d.ts +2 -2
- package/dist/src/agent/service/direct-turn-helpers.js +2 -2
- package/dist/src/agent/service/process-direct-streaming.js +3 -4
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/factory.d.ts +1 -0
- package/dist/src/agent/tools/factory.js +37 -7
- package/dist/src/agent/tools/knowledge-memory-tool.d.ts +6 -0
- package/dist/src/agent/tools/knowledge-memory-tool.js +81 -26
- package/dist/src/agent/tools/session-search-tool.d.ts +1 -0
- package/dist/src/agent/tools/session-search-tool.js +7 -0
- package/dist/src/agent/tools/user-context-tool.d.ts +2 -0
- package/dist/src/agent/tools/user-context-tool.js +21 -4
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/automations/service/automation-service.d.ts +2 -1
- package/dist/src/automations/service/automation-service.js +6 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/connectors/connection-recovery-service.d.ts +1 -0
- package/dist/src/connectors/connection-recovery-service.js +46 -22
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/files/file-service.js +142 -14
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +17 -3
- package/dist/src/gateway/hono/routes/files.js +23 -2
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +2 -0
- package/dist/src/gateway/service/agent-runner.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service/session-input-coordinator.js +1 -1
- package/dist/src/gateway/service.js +12 -8
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/knowledge-memory/domain.d.ts +1 -0
- package/dist/src/knowledge-memory/index.js +2 -2
- package/dist/src/knowledge-memory/repository.d.ts +4 -1
- package/dist/src/knowledge-memory/repository.js +16 -2
- package/dist/src/notifications/planner.js +7 -3
- package/dist/src/proactive/actions/service.d.ts +0 -1
- package/dist/src/proactive/actions/service.js +1 -10
- package/dist/src/proactive/execution/context.d.ts +6 -8
- package/dist/src/proactive/execution/context.js +78 -32
- package/dist/src/proactive/execution/insight.d.ts +4 -1
- package/dist/src/proactive/execution/insight.js +5 -2
- package/dist/src/proactive/execution/repository.d.ts +1 -0
- package/dist/src/proactive/execution/repository.js +9 -1
- package/dist/src/proactive/execution/types.d.ts +0 -1
- package/dist/src/proactive/execution/worker.js +7 -5
- package/dist/src/proactive/inbox/repository.js +8 -2
- package/dist/src/proactive/inbox/service.js +2 -2
- package/dist/src/proactive/inbox/types.d.ts +1 -0
- package/dist/src/proactive/inbox/worker.d.ts +1 -0
- package/dist/src/proactive/inbox/worker.js +7 -0
- package/dist/src/proactive/index.d.ts +1 -0
- package/dist/src/proactive/index.js +2 -1
- package/dist/src/proactive/maintenance.d.ts +4 -0
- package/dist/src/proactive/maintenance.js +21 -0
- package/dist/src/proactive/scenarios/repository.d.ts +1 -1
- package/dist/src/proactive/scenarios/repository.js +10 -3
- package/dist/src/proactive/scenarios/types.d.ts +7 -0
- package/dist/src/proactive/service.d.ts +7 -0
- package/dist/src/proactive/service.js +17 -1
- package/dist/src/projects/project-service.d.ts +2 -1
- package/dist/src/projects/project-service.js +3 -2
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/session/index.js +1 -1
- package/dist/src/session/store.js +5 -2
- package/dist/src/storage/sqlite/collaboration-rule-repository.d.ts +3 -1
- package/dist/src/storage/sqlite/collaboration-rule-repository.js +1 -1
- package/dist/src/storage/sqlite/config-repository.js +1 -1
- package/dist/src/storage/sqlite/connection-wait-repository.js +2 -2
- package/dist/src/storage/sqlite/index.js +2 -2
- package/dist/src/storage/sqlite/migrations/151_proactive_scope_cleanup.sql +6 -0
- package/dist/src/storage/sqlite/migrations/152_proactive_scenario_contract.sql +140 -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/row-mappers.js +2 -2
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.js +1 -1
- package/dist/src/storage/sqlite/session-instance-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/session-instance-repository.js +6 -0
- package/dist/src/storage/sqlite/session-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/session-repository.js +3 -5
- package/dist/src/storage/sqlite/transcript-repository.js +2 -1
- package/dist/src/tasks/home-query-service.js +35 -13
- package/dist/src/tasks/project-monitoring-service.d.ts +2 -0
- package/dist/src/tasks/project-monitoring-service.js +4 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/user-context/access-policy.d.ts +11 -0
- package/dist/src/user-context/access-policy.js +26 -0
- package/dist/src/user-model/capture/executor.d.ts +10 -0
- package/dist/src/user-model/capture/executor.js +99 -3
- package/dist/src/user-model/capture/semantic.d.ts +18 -0
- package/dist/src/user-model/capture/semantic.js +72 -6
- package/dist/src/user-model/goals.d.ts +4 -0
- package/dist/src/user-model/goals.js +4 -2
- package/dist/src/voice/realtime/agentEngine.js +0 -1
- package/dist/src/work-discovery/service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-C1rXNUAG.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-jOvT-fzU.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-BKjKTlW8.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-Dzq18pO1.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DW4SBQf4.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-57OGuewD.js +0 -1
- package/dist/gateway/static/root/assets/code-editor-D4_k-6QN.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CT_I3kbR.js +0 -2
- package/dist/gateway/static/root/assets/files-D6vf3S30.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BiHwiBnQ.js +0 -1
- package/dist/gateway/static/root/assets/html-workspace-editor-C3DKAkMc.js +0 -1
- package/dist/gateway/static/root/assets/index-aBs0EfQB.js +0 -72
- package/dist/gateway/static/root/assets/local-app-workbench-page-eBFVWmtH.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-ClvcWlL6.js +0 -2
- package/dist/gateway/static/root/assets/markdown-editor-nDLmA_LF.js +0 -2
- package/dist/gateway/static/root/assets/markdown-split-D7V3j0vE.js +0 -1
- package/dist/gateway/static/root/assets/messages-W5P19VTF.js +0 -11
- package/dist/gateway/static/root/assets/note-detail-panel-CEEvR-fV.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BLqgXNCx.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-CIiFJ5tk.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B3UF-Pfm.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BUtpkJPG.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-UgJmG-V4.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DDCzpdkl.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BdsqnCYj.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-ghzAQKna.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-W3GTm6nA.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-BbAV3h7n.js +0 -5
|
@@ -2,6 +2,7 @@ import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
4
|
import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
5
|
+
import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
5
6
|
import { getSessionTaskPlan, setSessionTaskPlan } from "../../storage/sqlite/session-task-plan-repository.js";
|
|
6
7
|
import "../../storage/sqlite/index.js";
|
|
7
8
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
@@ -55,6 +56,7 @@ import { createManagedJobTool } from "./managed-job-tool.js";
|
|
|
55
56
|
import { createImageTool } from "./image-tool.js";
|
|
56
57
|
import { createImageGenerateTool } from "./image-generate-tool.js";
|
|
57
58
|
import "./index.js";
|
|
59
|
+
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
58
60
|
import { createBrowserUseTool } from "./browser/tool/browser-use-tool.js";
|
|
59
61
|
import { createReviewWorkspaceTool } from "./review-workspace.js";
|
|
60
62
|
import { createLanguageDiagnosticsTool } from "./language-diagnostics.js";
|
|
@@ -199,6 +201,13 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
199
201
|
});
|
|
200
202
|
const agentId = options?.agentId;
|
|
201
203
|
const resolvedAgentId = agentId ?? (cfg ? resolveDefaultAgentId(cfg) : "main");
|
|
204
|
+
const currentSessionKey = () => options?.sessionKey ?? this.deps.getCurrentContext?.()?.sessionKey;
|
|
205
|
+
const currentAccess = () => resolveUserContextSessionAccess(this.deps.getConfig?.(), currentSessionKey());
|
|
206
|
+
const knowledgeWritePolicy = () => this.deps.getConfig?.()?.userContext.knowledgeMemory.writePolicy ?? "deny";
|
|
207
|
+
const currentProjectId = () => {
|
|
208
|
+
const key = currentSessionKey();
|
|
209
|
+
return key ? getSessionMetadata(key)?.projectId : void 0;
|
|
210
|
+
};
|
|
202
211
|
const getCommandIsolation = () => {
|
|
203
212
|
const config = this.deps.getConfig?.();
|
|
204
213
|
return config ? resolveEffectiveAgentConfigForSession(config, this.deps.getCurrentContext()?.sessionKey ?? `agent:${agentId ?? "main"}:internal`).config.runtime.commandIsolation : void 0;
|
|
@@ -213,7 +222,8 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
213
222
|
disabledTools: disabled,
|
|
214
223
|
hookRunner: this.deps.hookRunner,
|
|
215
224
|
toolExecutorConfig: this.deps.toolExecutorConfig,
|
|
216
|
-
getMemoryManager: getMemMgr
|
|
225
|
+
getMemoryManager: getMemMgr,
|
|
226
|
+
canAccessMemory: () => currentAccess().knowledge
|
|
217
227
|
});
|
|
218
228
|
const optionalTools = [imageTool, imageGenerateTool].filter((t) => t != null);
|
|
219
229
|
const readTool = createReadFileTool(workspace, { profileMarkdownRoot: options?.profileMarkdownRoot });
|
|
@@ -314,27 +324,46 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
314
324
|
createUserContextSearchTool({
|
|
315
325
|
agentId: resolvedAgentId,
|
|
316
326
|
workspaceId: workspace,
|
|
317
|
-
getSessionId:
|
|
327
|
+
getSessionId: currentSessionKey,
|
|
328
|
+
getProjectId: currentProjectId,
|
|
329
|
+
canRead: () => currentAccess().userModel
|
|
318
330
|
}),
|
|
319
331
|
createUserContextGetTool({
|
|
320
332
|
agentId: resolvedAgentId,
|
|
321
333
|
workspaceId: workspace,
|
|
322
|
-
getSessionId:
|
|
334
|
+
getSessionId: currentSessionKey,
|
|
335
|
+
getProjectId: currentProjectId,
|
|
336
|
+
canRead: () => currentAccess().userModel
|
|
323
337
|
}),
|
|
324
338
|
createKnowledgeSearchTool({
|
|
325
339
|
agentId: resolvedAgentId,
|
|
326
340
|
workspaceId: workspace,
|
|
327
|
-
getSessionId:
|
|
341
|
+
getSessionId: currentSessionKey,
|
|
342
|
+
getProjectId: currentProjectId,
|
|
343
|
+
canRead: () => currentAccess().knowledge,
|
|
344
|
+
canWrite: () => currentAccess().knowledge,
|
|
345
|
+
getWritePolicy: knowledgeWritePolicy,
|
|
346
|
+
getSources: () => currentAccess().knowledgeSources
|
|
328
347
|
}),
|
|
329
348
|
createKnowledgeGetTool({
|
|
330
349
|
agentId: resolvedAgentId,
|
|
331
350
|
workspaceId: workspace,
|
|
332
|
-
getSessionId:
|
|
351
|
+
getSessionId: currentSessionKey,
|
|
352
|
+
getProjectId: currentProjectId,
|
|
353
|
+
canRead: () => currentAccess().knowledge,
|
|
354
|
+
canWrite: () => currentAccess().knowledge,
|
|
355
|
+
getWritePolicy: knowledgeWritePolicy,
|
|
356
|
+
getSources: () => currentAccess().knowledgeSources
|
|
333
357
|
}),
|
|
334
358
|
createKnowledgeWriteTool({
|
|
335
359
|
agentId: resolvedAgentId,
|
|
336
360
|
workspaceId: workspace,
|
|
337
|
-
getSessionId:
|
|
361
|
+
getSessionId: currentSessionKey,
|
|
362
|
+
getProjectId: currentProjectId,
|
|
363
|
+
canRead: () => currentAccess().knowledge,
|
|
364
|
+
canWrite: () => currentAccess().knowledge,
|
|
365
|
+
getWritePolicy: knowledgeWritePolicy,
|
|
366
|
+
getSources: () => currentAccess().knowledgeSources
|
|
338
367
|
}),
|
|
339
368
|
...this.deps.getSessionStore ? [createSessionRecallTool({
|
|
340
369
|
getSessionStore: this.deps.getSessionStore,
|
|
@@ -343,7 +372,8 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
343
372
|
...this.deps.getSessionStore && getPrimary ? [createSessionSearchTool({
|
|
344
373
|
getSessionStore: this.deps.getSessionStore,
|
|
345
374
|
getPrimaryModel: getPrimary,
|
|
346
|
-
getCurrentSessionKey: () => this.deps.getCurrentContext()?.sessionKey
|
|
375
|
+
getCurrentSessionKey: () => this.deps.getCurrentContext()?.sessionKey,
|
|
376
|
+
canAccess: () => currentAccess().crossSessionHistory
|
|
347
377
|
})] : [],
|
|
348
378
|
...this.deps.getAutomationService ? [createAutomationTool({ getAutomationService: this.deps.getAutomationService })] : [],
|
|
349
379
|
...browserEnabled && this.deps.getBrowserRecipeService ? [createBrowserRecipeTool({ getBrowserRecipeService: this.deps.getBrowserRecipeService })] : [],
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
import { type KnowledgeSource } from '../../knowledge-memory/index.js';
|
|
2
3
|
export interface KnowledgeToolOptions {
|
|
3
4
|
agentId: string;
|
|
4
5
|
workspaceId: string;
|
|
5
6
|
getSessionId: () => string | undefined;
|
|
7
|
+
getProjectId?: () => string | undefined;
|
|
8
|
+
canRead: () => boolean;
|
|
9
|
+
canWrite: () => boolean;
|
|
10
|
+
getWritePolicy: () => 'deny' | 'confirm' | 'allow';
|
|
11
|
+
getSources: () => readonly KnowledgeSource[];
|
|
6
12
|
}
|
|
7
13
|
export declare function createKnowledgeSearchTool(options: KnowledgeToolOptions): AgentTool;
|
|
8
14
|
export declare function createKnowledgeGetTool(options: KnowledgeToolOptions): AgentTool;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getKnowledgeItem, searchKnowledgeItems, writeKnowledgeItem } from "../../knowledge-memory/repository.js";
|
|
1
|
+
import { getKnowledgeItem, knowledgeSourceAllowed, searchKnowledgeItems, writeKnowledgeItem } from "../../knowledge-memory/repository.js";
|
|
2
2
|
import "../../knowledge-memory/index.js";
|
|
3
3
|
import { Type } from "@sinclair/typebox";
|
|
4
4
|
//#region src/agent/tools/knowledge-memory-tool.ts
|
|
@@ -23,17 +23,23 @@ const WriteSchema = Type.Object({
|
|
|
23
23
|
]),
|
|
24
24
|
content: Type.String(),
|
|
25
25
|
canonicalKey: Type.String(),
|
|
26
|
-
scope: Type.Union([
|
|
26
|
+
scope: Type.Union([
|
|
27
|
+
Type.Literal("workspace"),
|
|
28
|
+
Type.Literal("project"),
|
|
29
|
+
Type.Literal("session")
|
|
30
|
+
]),
|
|
27
31
|
importance: Type.Optional(Type.Number({
|
|
28
32
|
minimum: 0,
|
|
29
33
|
maximum: 1
|
|
30
34
|
}))
|
|
31
35
|
});
|
|
32
36
|
function visibility(options) {
|
|
37
|
+
const projectId = options.getProjectId?.();
|
|
33
38
|
return {
|
|
34
39
|
agentId: options.agentId,
|
|
35
40
|
workspaceId: options.workspaceId,
|
|
36
|
-
sessionId: options.getSessionId() ?? ""
|
|
41
|
+
sessionId: options.getSessionId() ?? "",
|
|
42
|
+
...projectId ? { projectId } : {}
|
|
37
43
|
};
|
|
38
44
|
}
|
|
39
45
|
function createKnowledgeSearchTool(options) {
|
|
@@ -43,10 +49,18 @@ function createKnowledgeSearchTool(options) {
|
|
|
43
49
|
description: "Search project, workspace, and session knowledge for prior decisions, facts, lessons, and commitments.",
|
|
44
50
|
parameters: SearchSchema,
|
|
45
51
|
async execute(_toolCallId, raw) {
|
|
52
|
+
if (!options.canRead()) return {
|
|
53
|
+
content: [{
|
|
54
|
+
type: "text",
|
|
55
|
+
text: "Knowledge memory is disabled for this session."
|
|
56
|
+
}],
|
|
57
|
+
details: { error: "knowledge_memory_disabled" }
|
|
58
|
+
};
|
|
46
59
|
const input = raw;
|
|
47
60
|
const results = searchKnowledgeItems({
|
|
48
61
|
query: input.query,
|
|
49
62
|
context: visibility(options),
|
|
63
|
+
sources: options.getSources(),
|
|
50
64
|
limit: input.maxResults ?? 12
|
|
51
65
|
});
|
|
52
66
|
return {
|
|
@@ -60,7 +74,7 @@ function createKnowledgeSearchTool(options) {
|
|
|
60
74
|
};
|
|
61
75
|
}
|
|
62
76
|
function visibleItem(options, item) {
|
|
63
|
-
return item.scope.type === "global" || item.scope.type === "agent" && item.scope.id === options.agentId || item.scope.type === "workspace" && item.scope.id === options.workspaceId || item.scope.type === "session" && item.scope.id === options.getSessionId();
|
|
77
|
+
return item.scope.type === "global" || item.scope.type === "agent" && item.scope.id === options.agentId || item.scope.type === "workspace" && item.scope.id === options.workspaceId || item.scope.type === "project" && item.scope.id === options.getProjectId?.() || item.scope.type === "session" && item.scope.id === options.getSessionId();
|
|
64
78
|
}
|
|
65
79
|
function createKnowledgeGetTool(options) {
|
|
66
80
|
return {
|
|
@@ -69,9 +83,16 @@ function createKnowledgeGetTool(options) {
|
|
|
69
83
|
description: "Read one knowledge item returned by knowledge_search.",
|
|
70
84
|
parameters: GetSchema,
|
|
71
85
|
async execute(_toolCallId, raw) {
|
|
86
|
+
if (!options.canRead()) return {
|
|
87
|
+
content: [{
|
|
88
|
+
type: "text",
|
|
89
|
+
text: "Knowledge memory is disabled for this session."
|
|
90
|
+
}],
|
|
91
|
+
details: { error: "knowledge_memory_disabled" }
|
|
92
|
+
};
|
|
72
93
|
const id = raw.id;
|
|
73
94
|
const item = getKnowledgeItem(id);
|
|
74
|
-
return item && visibleItem(options, item) ? {
|
|
95
|
+
return item && visibleItem(options, item) && knowledgeSourceAllowed(item, options.getSources()) ? {
|
|
75
96
|
content: [{
|
|
76
97
|
type: "text",
|
|
77
98
|
text: JSON.stringify(item, null, 2)
|
|
@@ -91,36 +112,70 @@ function createKnowledgeWriteTool(options) {
|
|
|
91
112
|
return {
|
|
92
113
|
name: "knowledge_write",
|
|
93
114
|
label: "Knowledge Write",
|
|
94
|
-
description: "Store
|
|
115
|
+
description: "Store scoped knowledge with provenance, subject to the configured write policy.",
|
|
95
116
|
parameters: WriteSchema,
|
|
96
117
|
async execute(_toolCallId, raw) {
|
|
118
|
+
if (!options.canWrite()) return {
|
|
119
|
+
content: [{
|
|
120
|
+
type: "text",
|
|
121
|
+
text: "Knowledge memory writes are disabled for this session."
|
|
122
|
+
}],
|
|
123
|
+
details: { error: "knowledge_memory_disabled" }
|
|
124
|
+
};
|
|
125
|
+
const writePolicy = options.getWritePolicy();
|
|
126
|
+
if (writePolicy === "deny") return {
|
|
127
|
+
content: [{
|
|
128
|
+
type: "text",
|
|
129
|
+
text: "Knowledge memory writes are denied by policy."
|
|
130
|
+
}],
|
|
131
|
+
details: { error: "knowledge_write_denied" }
|
|
132
|
+
};
|
|
97
133
|
const input = raw;
|
|
134
|
+
if (!options.getSources().includes(input.scope)) return {
|
|
135
|
+
content: [{
|
|
136
|
+
type: "text",
|
|
137
|
+
text: `Knowledge source is disabled: ${input.scope}`
|
|
138
|
+
}],
|
|
139
|
+
details: {
|
|
140
|
+
error: "knowledge_source_disabled",
|
|
141
|
+
source: input.scope
|
|
142
|
+
}
|
|
143
|
+
};
|
|
98
144
|
const sessionId = options.getSessionId();
|
|
99
145
|
if (input.scope === "session" && !sessionId) throw new Error("A current session is required for session knowledge.");
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
146
|
+
const projectId = options.getProjectId?.();
|
|
147
|
+
if (input.scope === "project" && !projectId) throw new Error("A current project is required for project knowledge.");
|
|
148
|
+
const details = {
|
|
149
|
+
...writeKnowledgeItem({
|
|
150
|
+
kind: input.kind,
|
|
151
|
+
scope: input.scope === "workspace" ? {
|
|
152
|
+
type: "workspace",
|
|
153
|
+
id: options.workspaceId
|
|
154
|
+
} : input.scope === "project" ? {
|
|
155
|
+
type: "project",
|
|
156
|
+
id: projectId
|
|
157
|
+
} : {
|
|
158
|
+
type: "session",
|
|
159
|
+
id: sessionId
|
|
160
|
+
},
|
|
161
|
+
content: input.content,
|
|
162
|
+
canonicalKey: input.canonicalKey,
|
|
163
|
+
status: writePolicy === "allow" ? "active" : "candidate",
|
|
164
|
+
confidence: .7,
|
|
165
|
+
importance: input.importance ?? .5,
|
|
166
|
+
originClass: "agent",
|
|
167
|
+
sourceAgentId: options.agentId,
|
|
168
|
+
...sessionId ? { sourceSessionId: sessionId } : {},
|
|
169
|
+
source: { tool: "knowledge_write" }
|
|
170
|
+
}),
|
|
171
|
+
writePolicy
|
|
172
|
+
};
|
|
118
173
|
return {
|
|
119
174
|
content: [{
|
|
120
175
|
type: "text",
|
|
121
|
-
text: JSON.stringify(
|
|
176
|
+
text: JSON.stringify(details, null, 2)
|
|
122
177
|
}],
|
|
123
|
-
details
|
|
178
|
+
details
|
|
124
179
|
};
|
|
125
180
|
}
|
|
126
181
|
};
|
|
@@ -5,5 +5,6 @@ export interface SessionSearchToolDeps {
|
|
|
5
5
|
getSessionStore: () => SessionStore;
|
|
6
6
|
getPrimaryModel: () => Model<Api>;
|
|
7
7
|
getCurrentSessionKey?: () => string | undefined;
|
|
8
|
+
canAccess?: () => boolean;
|
|
8
9
|
}
|
|
9
10
|
export declare function createSessionSearchTool(deps: SessionSearchToolDeps): AgentTool;
|
|
@@ -94,6 +94,13 @@ function createSessionSearchTool(deps) {
|
|
|
94
94
|
description: "Search other chat sessions by keywords and get short summaries, or omit `query` to list recent sessions (no LLM cost). Uses the same session store as the gateway. Narrow with roleFilter if needed.",
|
|
95
95
|
parameters: SessionSearchSchema,
|
|
96
96
|
async execute(_toolCallId, params, signal) {
|
|
97
|
+
if (deps.canAccess && !deps.canAccess()) return {
|
|
98
|
+
content: [{
|
|
99
|
+
type: "text",
|
|
100
|
+
text: "Cross-session history is disabled for this session."
|
|
101
|
+
}],
|
|
102
|
+
details: { error: "cross_session_history_disabled" }
|
|
103
|
+
};
|
|
97
104
|
const p = params;
|
|
98
105
|
const store = deps.getSessionStore();
|
|
99
106
|
const limit = Math.min(15, Math.max(1, p.limit ?? 5));
|
|
@@ -3,6 +3,8 @@ export interface UserContextToolOptions {
|
|
|
3
3
|
agentId: string;
|
|
4
4
|
workspaceId: string;
|
|
5
5
|
getSessionId: () => string | undefined;
|
|
6
|
+
getProjectId?: () => string | undefined;
|
|
7
|
+
canRead: () => boolean;
|
|
6
8
|
}
|
|
7
9
|
export declare function createUserContextSearchTool(options: UserContextToolOptions): AgentTool;
|
|
8
10
|
export declare function createUserContextGetTool(options: UserContextToolOptions): AgentTool;
|
|
@@ -13,7 +13,10 @@ const SearchSchema = Type.Object({
|
|
|
13
13
|
const GetSchema = Type.Object({ id: Type.String() });
|
|
14
14
|
function visible(options, slotId) {
|
|
15
15
|
const scope = getAssertionSlot(slotId)?.scope;
|
|
16
|
-
return scope?.type === "global" || scope?.type === "agent" && scope.id === options.agentId || scope?.type === "workspace" && scope.id === options.workspaceId || scope?.type === "session" && scope.id === options.getSessionId();
|
|
16
|
+
return scope?.type === "global" || scope?.type === "agent" && scope.id === options.agentId || scope?.type === "workspace" && scope.id === options.workspaceId || scope?.type === "project" && scope.id === options.getProjectId?.() || scope?.type === "session" && scope.id === options.getSessionId();
|
|
17
|
+
}
|
|
18
|
+
function referenceable(assertion) {
|
|
19
|
+
return assertion.status === "active" && assertion.authority !== "external_untrusted" && assertion.sensitivity !== "secret" && assertion.sensitivity !== "regulated" && assertion.disclosurePolicy !== "ask_before_reference";
|
|
17
20
|
}
|
|
18
21
|
function createUserContextSearchTool(options) {
|
|
19
22
|
return {
|
|
@@ -22,11 +25,18 @@ function createUserContextSearchTool(options) {
|
|
|
22
25
|
description: "Search typed user assertions such as identity, preferences, routines, and current state.",
|
|
23
26
|
parameters: SearchSchema,
|
|
24
27
|
async execute(_toolCallId, raw) {
|
|
28
|
+
if (!options.canRead()) return {
|
|
29
|
+
content: [{
|
|
30
|
+
type: "text",
|
|
31
|
+
text: "User context is disabled for this session."
|
|
32
|
+
}],
|
|
33
|
+
details: { error: "user_context_disabled" }
|
|
34
|
+
};
|
|
25
35
|
const input = raw;
|
|
26
36
|
const results = listUserAssertions({
|
|
27
|
-
statuses: ["active"
|
|
37
|
+
statuses: ["active"],
|
|
28
38
|
limit: 1e3
|
|
29
|
-
}).filter((assertion) => visible(options, assertion.slotId)).map((assertion) => ({
|
|
39
|
+
}).filter((assertion) => visible(options, assertion.slotId)).filter(referenceable).map((assertion) => ({
|
|
30
40
|
assertion,
|
|
31
41
|
score: retrievalLexicalSimilarity(input.query, `${assertion.statement} ${assertion.normalizedValue}`)
|
|
32
42
|
})).filter((item) => item.score > 0).sort((left, right) => right.score - left.score).slice(0, input.maxResults ?? 12).map(({ assertion, score }) => ({
|
|
@@ -54,9 +64,16 @@ function createUserContextGetTool(options) {
|
|
|
54
64
|
description: "Read one typed user assertion and its subject, predicate, and scope.",
|
|
55
65
|
parameters: GetSchema,
|
|
56
66
|
async execute(_toolCallId, raw) {
|
|
67
|
+
if (!options.canRead()) return {
|
|
68
|
+
content: [{
|
|
69
|
+
type: "text",
|
|
70
|
+
text: "User context is disabled for this session."
|
|
71
|
+
}],
|
|
72
|
+
details: { error: "user_context_disabled" }
|
|
73
|
+
};
|
|
57
74
|
const id = raw.id;
|
|
58
75
|
const assertion = getUserAssertion(id);
|
|
59
|
-
if (!assertion || !visible(options, assertion.slotId)) return {
|
|
76
|
+
if (!assertion || !visible(options, assertion.slotId) || !referenceable(assertion)) return {
|
|
60
77
|
content: [{
|
|
61
78
|
type: "text",
|
|
62
79
|
text: `User assertion not found: ${id}`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { getAssistantMessageErrorReason, stripCodeFences } from "../providers/model-response.js";
|
|
3
4
|
import { getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
4
5
|
import { createExtensionAwareStreamFn } from "../providers/extension-stream-bridge.js";
|
|
5
6
|
import { isLocalModelBaseUrl, resolveModelCallApiKey, resolveModelCallOptions } from "../providers/model-call.js";
|
|
6
|
-
import { getAssistantMessageErrorReason, stripCodeFences } from "../providers/model-response.js";
|
|
7
7
|
//#region src/ai-assist/text-assist.ts
|
|
8
8
|
init_providers();
|
|
9
9
|
init_logger();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
5
4
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
6
|
-
import {
|
|
5
|
+
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
7
6
|
import { getApiKeyFromEnv, init_env_keys } from "../providers/env-keys.js";
|
|
7
|
+
import { getOAuthProviderDefinition, init_registry } from "./oauth/registry.js";
|
|
8
8
|
import { init_oauth_provider_lock, withOAuthProviderLock } from "./oauth-provider-lock.js";
|
|
9
9
|
import { dirname, join } from "path";
|
|
10
10
|
import { mkdir, readFile, readdir, rm } from "fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveCredentialsDir } from "../../config/paths.js";
|
|
2
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { init_paths, resolveCredentialsDir } from "../../config/paths.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { chmodSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
5
5
|
//#region src/auth/profiles/store.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
3
2
|
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveOAuthPath } from "../config/paths.js";
|
|
4
|
-
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
3
|
import { init_registry, isOAuthOnlyProvider } from "./oauth/registry.js";
|
|
4
|
+
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
7
|
//#region src/auth/sync-provider-auth.ts
|
|
8
8
|
/**
|
|
@@ -8,6 +8,7 @@ export declare class AutomationAlreadyRunningError extends Error {
|
|
|
8
8
|
}
|
|
9
9
|
export declare class AutomationService {
|
|
10
10
|
private readonly signals?;
|
|
11
|
+
private readonly workspaceId;
|
|
11
12
|
private readonly executor;
|
|
12
13
|
private timer;
|
|
13
14
|
private stopped;
|
|
@@ -17,7 +18,7 @@ export declare class AutomationService {
|
|
|
17
18
|
private readonly activeRuns;
|
|
18
19
|
private readonly heartbeatTimers;
|
|
19
20
|
private readonly leaseOwner;
|
|
20
|
-
constructor(signals?: ProactiveSignalPublisher);
|
|
21
|
+
constructor(signals?: ProactiveSignalPublisher, workspaceId?: string);
|
|
21
22
|
setDeps(deps: AutomationDeps): void;
|
|
22
23
|
initialize(options?: {
|
|
23
24
|
maxConcurrentRuns?: number;
|
|
@@ -34,8 +34,9 @@ var AutomationService = class {
|
|
|
34
34
|
activeRuns = /* @__PURE__ */ new Map();
|
|
35
35
|
heartbeatTimers = /* @__PURE__ */ new Map();
|
|
36
36
|
leaseOwner = `automation-service:${process.pid}:${randomUUID()}`;
|
|
37
|
-
constructor(signals) {
|
|
37
|
+
constructor(signals, workspaceId = "default") {
|
|
38
38
|
this.signals = signals;
|
|
39
|
+
this.workspaceId = workspaceId;
|
|
39
40
|
}
|
|
40
41
|
setDeps(deps) {
|
|
41
42
|
this.deps = {
|
|
@@ -462,7 +463,10 @@ var AutomationService = class {
|
|
|
462
463
|
id: run.id
|
|
463
464
|
},
|
|
464
465
|
actor: { kind: "system" },
|
|
465
|
-
scope: {
|
|
466
|
+
scope: {
|
|
467
|
+
workspaceId: this.workspaceId,
|
|
468
|
+
...automation.projectId ? { projectId: automation.projectId } : {}
|
|
469
|
+
},
|
|
466
470
|
occurredAt: new Date(endedAtMs).toISOString(),
|
|
467
471
|
dedupeKey: `automation_run:${run.id}:failed`,
|
|
468
472
|
sensitivity: "personal",
|
|
@@ -2,8 +2,8 @@ import { PACKAGE_VERSION, init_package_version } from "../../package-version.js"
|
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
4
|
import { assertCacheDir, init_cache_dir_policy } from "../cache-dir-policy.js";
|
|
5
|
-
import { init_paths, resolveBinDir } from "../../config/paths.js";
|
|
6
5
|
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
6
|
+
import { init_paths, resolveBinDir } from "../../config/paths.js";
|
|
7
7
|
import { shouldRunExtensionBridgeServer } from "../backend-from-config.js";
|
|
8
8
|
import { resolvePackageRoot } from "../../infra/update-check.js";
|
|
9
9
|
import { dirname, join } from "node:path";
|
|
@@ -52,7 +52,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
52
52
|
id: "database-schema",
|
|
53
53
|
label: "Database schema",
|
|
54
54
|
status: "pass",
|
|
55
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
55
|
+
message: `SQLite schema v${status.dbVersion} (current release v152).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAgentDefaultModelRef, init_schema, parseModelRef } from "../../../../config/schema.js";
|
|
2
|
-
import { init_loader, loadConfig } from "../../../../config/loader.js";
|
|
3
2
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "../../../../providers/env-keys.js";
|
|
3
|
+
import { init_loader, loadConfig } from "../../../../config/loader.js";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
//#region src/cli/commands/doctor/checks/provider-auth.ts
|
|
6
6
|
init_loader();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
2
|
-
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
3
2
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
|
+
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
4
|
import { getAllModels, getAvailableModels, getConfiguredProviders, getProviderAuthState, getProviderDisplayName, init_providers, isProviderConfigured, providerSupportsApiKey, providerSupportsOAuth, resolveModel } from "../../providers/index.js";
|
|
5
5
|
import { formatExamples, register } from "../registry.js";
|
|
6
6
|
import { getContextWithOpts } from "../context.js";
|
package/dist/src/config/index.js
CHANGED
|
@@ -2,15 +2,15 @@ import { ENV_VARS, XOPC_DB_FILENAME, resolveHomeDir, resolveStateDir, resolveXop
|
|
|
2
2
|
import { TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema } from "../../extensions/telegram/src/config-schema.js";
|
|
3
3
|
import { WeixinAccountConfigSchema, WeixinConfigSchema } from "../../extensions/weixin/src/config-schema.js";
|
|
4
4
|
import { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpOAuthConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, RuntimeToolsConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "./schema.js";
|
|
5
|
-
import {
|
|
5
|
+
import { clearConfigValueCache, getAllowedCommands, getCacheStats, init_resolve_config_value, resolveConfigValue, resolveHeaders, testApiKeyResolution } from "./resolve-config-value.js";
|
|
6
6
|
import { expandWorkspacePathString, init_workspace_path, normalizeWorkspaceDir, resolveWorkspaceRoot } from "./workspace-path.js";
|
|
7
7
|
import { resolveDefaultAgentWorkspaceDir } from "./workspace-defaults.js";
|
|
8
8
|
import { resolveAgentDir as resolveAgentDir$1, resolveAgentHomeDir as resolveAgentHomeDir$1, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
9
|
-
import { extractProfileAgentId, resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "./agent-profile.js";
|
|
10
9
|
import { FILENAMES, WORKSPACE_FILES, existsSync, hasBundledExtensionManifest, init_paths, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentHomeDir, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveCredentialsDir, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveMcpOAuthPath, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStatusPath, resolveToolsDir, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath } from "./paths.js";
|
|
11
|
-
import { init_loader, loadConfig, saveConfig } from "./loader.js";
|
|
12
|
-
import { clearConfigValueCache, getAllowedCommands, getCacheStats, init_resolve_config_value, resolveConfigValue, resolveHeaders, testApiKeyResolution } from "./resolve-config-value.js";
|
|
13
10
|
import { CustomModelSchema, ImageGenerationCapabilitiesSchema, ImageGenerationModelSchema, ImageGenerationProviderSchema, ModelOverrideSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProviderConfigSchema, VercelGatewayRoutingSchema, getDefaultModelValues, init_models_json, loadModelsJson, modelsJsonExists, saveModelsJson, validateModelsConfig } from "./models-json.js";
|
|
11
|
+
import { init_loader, loadConfig, saveConfig } from "./loader.js";
|
|
12
|
+
import { applyConfigOverrides, getConfigOverrides, resetConfigOverrides, setConfigOverride, unsetConfigOverride } from "./runtime-overrides.js";
|
|
13
|
+
import { extractProfileAgentId, resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "./agent-profile.js";
|
|
14
14
|
import { canonicalizeConfiguredMcpServer, isKnownCliMcpTypeAlias, normalizeConfiguredMcpServers, resolveXopcMcpTransportAlias } from "./mcp-config-normalize.js";
|
|
15
15
|
import { formatThinkingLevels, listThinkingLevels, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, thinkLevelToNumber } from "../agent/transcript/thinking-types.js";
|
|
16
16
|
import { getWorkspacePath } from "./workspace-path-helpers.js";
|
|
@@ -2,8 +2,8 @@ import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
4
|
import { ConfigSchema, init_schema } from "./schema.js";
|
|
5
|
-
import { init_paths, resolveConfigPath } from "./paths.js";
|
|
6
5
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
6
|
+
import { init_paths, resolveConfigPath } from "./paths.js";
|
|
7
7
|
import { assertChannelPluginConfigs, init_validate_channel_configs } from "./validate-channel-configs.js";
|
|
8
8
|
import { dirname } from "path";
|
|
9
9
|
import { existsSync, mkdirSync, promises, readFileSync } from "fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { init_paths, resolveModelsJsonPath } from "./paths.js";
|
|
3
2
|
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
3
|
+
import { init_paths, resolveModelsJsonPath } from "./paths.js";
|
|
4
4
|
import { existsSync, readFileSync } from "fs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/config/models-json.ts
|
|
@@ -33,6 +33,7 @@ export declare class ConnectionRecoveryService {
|
|
|
33
33
|
private get adapter();
|
|
34
34
|
snapshot(sessionKey: string): ConnectionWaitSnapshot;
|
|
35
35
|
private view;
|
|
36
|
+
private ensureInstallation;
|
|
36
37
|
private checkCapabilities;
|
|
37
38
|
preflight(input: SessionInput): Promise<boolean>;
|
|
38
39
|
act(sessionKey: string, action: ConnectionAction): Promise<{
|