@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,47 @@
|
|
|
1
|
+
CREATE TABLE session_inputs_v150 (
|
|
2
|
+
id TEXT PRIMARY KEY,
|
|
3
|
+
session_key TEXT NOT NULL,
|
|
4
|
+
client_message_id TEXT NOT NULL,
|
|
5
|
+
requested_delivery TEXT NOT NULL CHECK (requested_delivery IN ('next', 'steer')),
|
|
6
|
+
effective_delivery TEXT NOT NULL CHECK (effective_delivery IN ('next', 'steer')),
|
|
7
|
+
status TEXT NOT NULL CHECK (status IN (
|
|
8
|
+
'queued', 'running', 'injecting',
|
|
9
|
+
'completed', 'cancelled', 'failed', 'interrupted', 'suspended'
|
|
10
|
+
)),
|
|
11
|
+
content TEXT NOT NULL,
|
|
12
|
+
attachments_json TEXT,
|
|
13
|
+
thinking TEXT,
|
|
14
|
+
origin_json TEXT NOT NULL,
|
|
15
|
+
position INTEGER NOT NULL,
|
|
16
|
+
target_run_id TEXT,
|
|
17
|
+
run_id TEXT,
|
|
18
|
+
version INTEGER NOT NULL DEFAULT 1,
|
|
19
|
+
error TEXT,
|
|
20
|
+
created_at_ms INTEGER NOT NULL,
|
|
21
|
+
updated_at_ms INTEGER NOT NULL,
|
|
22
|
+
expected_session_id TEXT,
|
|
23
|
+
context_refs_json TEXT,
|
|
24
|
+
context_snapshots_json TEXT,
|
|
25
|
+
kind TEXT NOT NULL DEFAULT 'message' CHECK (kind IN ('message', 'connection_resume')),
|
|
26
|
+
payload_json TEXT,
|
|
27
|
+
task_run_id TEXT,
|
|
28
|
+
UNIQUE(session_key, client_message_id)
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
INSERT INTO session_inputs_v150 (id,session_key,client_message_id,requested_delivery,effective_delivery,status,content,attachments_json,thinking,origin_json,position,target_run_id,run_id,version,error,created_at_ms,updated_at_ms,expected_session_id,context_refs_json,context_snapshots_json) SELECT id,session_key,client_message_id,requested_delivery,effective_delivery,status,content,attachments_json,thinking,origin_json,position,target_run_id,run_id,version,error,created_at_ms,updated_at_ms,expected_session_id,context_refs_json,context_snapshots_json FROM session_inputs;
|
|
32
|
+
DROP TABLE session_inputs;
|
|
33
|
+
ALTER TABLE session_inputs_v150 RENAME TO session_inputs;
|
|
34
|
+
CREATE INDEX idx_session_inputs_pending ON session_inputs(session_key,status,position,created_at_ms);
|
|
35
|
+
|
|
36
|
+
CREATE TABLE session_connection_waits (
|
|
37
|
+
id TEXT PRIMARY KEY,
|
|
38
|
+
principal_id TEXT NOT NULL,
|
|
39
|
+
session_key TEXT NOT NULL,
|
|
40
|
+
session_id TEXT NOT NULL,
|
|
41
|
+
status TEXT NOT NULL CHECK (status IN ('open','queued','closed')),
|
|
42
|
+
version INTEGER NOT NULL,
|
|
43
|
+
data_json TEXT NOT NULL
|
|
44
|
+
);
|
|
45
|
+
CREATE UNIQUE INDEX idx_connection_wait_active ON session_connection_waits(principal_id,session_id)
|
|
46
|
+
WHERE status IN ('open','queued');
|
|
47
|
+
CREATE INDEX idx_connection_wait_session ON session_connection_waits(session_key);
|
|
@@ -3,7 +3,7 @@ import type { ApplyMigrationsOptions } from './types.js';
|
|
|
3
3
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
4
4
|
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
5
5
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
6
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
6
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 150;
|
|
7
7
|
export declare function resolveMigrationsDir(override?: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Apply sequential SQL migrations from (currentVersion + 1) through targetVersion.
|
|
@@ -12,7 +12,7 @@ const log = createLogger("Sqlite:Migrations");
|
|
|
12
12
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
13
13
|
const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
14
14
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
15
|
-
const XOPC_DB_SCHEMA_VERSION =
|
|
15
|
+
const XOPC_DB_SCHEMA_VERSION = 150;
|
|
16
16
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
17
17
|
function backupBeforeTaskCutover(db, databasePath) {
|
|
18
18
|
db.exec("PRAGMA wal_checkpoint(FULL)");
|
|
@@ -57,7 +57,7 @@ function applySingleMigration(db, migration) {
|
|
|
57
57
|
* Each step runs in its own transaction and updates schema_meta on success.
|
|
58
58
|
*/
|
|
59
59
|
function applyPendingMigrations(db, options = {}) {
|
|
60
|
-
const targetVersion = options.targetVersion ??
|
|
60
|
+
const targetVersion = options.targetVersion ?? 150;
|
|
61
61
|
let currentVersion = readSchemaVersion(db);
|
|
62
62
|
if (currentVersion > targetVersion) throw new DatabaseSchemaTooNewError(currentVersion, targetVersion);
|
|
63
63
|
if (currentVersion >= targetVersion) return currentVersion;
|
|
@@ -94,7 +94,7 @@ function applyPendingMigrations(db, options = {}) {
|
|
|
94
94
|
}
|
|
95
95
|
/** Inspect schema version without mutating the database. */
|
|
96
96
|
function inspectSchemaMigrationStatus(db, options = {}) {
|
|
97
|
-
const appVersion = options.targetVersion ??
|
|
97
|
+
const appVersion = options.targetVersion ?? 150;
|
|
98
98
|
const dbVersion = readSchemaVersion(db);
|
|
99
99
|
if (dbVersion > appVersion) return {
|
|
100
100
|
dbVersion,
|
|
@@ -19,7 +19,7 @@ const log = createLogger('Sqlite:Migrations');
|
|
|
19
19
|
export const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
20
20
|
|
|
21
21
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
22
|
-
export const XOPC_DB_SCHEMA_VERSION =
|
|
22
|
+
export const XOPC_DB_SCHEMA_VERSION = 150;
|
|
23
23
|
|
|
24
24
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
25
25
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Note, NoteIndexEntry, NotesListQuery } from '../../notes/types.js';
|
|
1
|
+
import type { Note, NoteIndexEntry, NoteProjectSummary, NotesListQuery } from '../../notes/types.js';
|
|
2
2
|
export declare function upsertNoteRecord(note: Note): void;
|
|
3
3
|
export declare function getNoteRecord(noteId: string): Note | null;
|
|
4
4
|
export declare function deleteNoteRecord(noteId: string): boolean;
|
|
@@ -9,3 +9,4 @@ export declare function listNoteRecords(query?: NotesListQuery): {
|
|
|
9
9
|
offset: number;
|
|
10
10
|
hasMore: boolean;
|
|
11
11
|
};
|
|
12
|
+
export declare function listNoteProjectSummaries(): NoteProjectSummary[];
|
|
@@ -41,7 +41,9 @@ function rowToIndexEntry(row) {
|
|
|
41
41
|
headingCount: row.heading_count ?? void 0,
|
|
42
42
|
taskCount: row.task_count ?? void 0,
|
|
43
43
|
uncheckedTaskCount: row.unchecked_task_count ?? void 0,
|
|
44
|
-
linkCount: row.link_count ?? void 0
|
|
44
|
+
linkCount: row.link_count ?? void 0,
|
|
45
|
+
projects: row.projects_json ? JSON.parse(row.projects_json) : [],
|
|
46
|
+
lastEditTrigger: row.last_edit_trigger ?? void 0
|
|
45
47
|
};
|
|
46
48
|
}
|
|
47
49
|
function noteSearchContent(note) {
|
|
@@ -186,11 +188,25 @@ function listNoteRecords(query = {}) {
|
|
|
186
188
|
)`);
|
|
187
189
|
params.push(query.projectId);
|
|
188
190
|
}
|
|
191
|
+
if (query.unassigned) conditions.push(`NOT EXISTS (
|
|
192
|
+
SELECT 1 FROM object_links l JOIN projects p ON p.project_id = l.to_id
|
|
193
|
+
WHERE l.relation = 'belongs_to' AND l.from_kind = 'note'
|
|
194
|
+
AND l.from_id = notes.note_id AND l.to_kind = 'project'
|
|
195
|
+
)`);
|
|
196
|
+
if (query.agentEdited) conditions.push(`json_extract(payload_json, '$.lastEditTrigger') = 'ai_edit'`);
|
|
189
197
|
const where = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
190
198
|
const rows = db.prepare(`SELECT note_id, title, kind, status, payload_json, created_at, updated_at,
|
|
191
199
|
pinned, tags_json, snippet, cover_attachment_id, voice_attachment_id,
|
|
192
200
|
voice_duration_sec, attachment_names_json, group_id, last_opened_at,
|
|
193
|
-
task_done, task_due_at, heading_count, task_count, unchecked_task_count, link_count
|
|
201
|
+
task_done, task_due_at, heading_count, task_count, unchecked_task_count, link_count,
|
|
202
|
+
json_extract(payload_json, '$.lastEditTrigger') AS last_edit_trigger,
|
|
203
|
+
(SELECT json_group_array(json_object('id', project_id, 'name', name)) FROM (
|
|
204
|
+
SELECT DISTINCT p.project_id, p.name FROM object_links l
|
|
205
|
+
JOIN projects p ON p.project_id = l.to_id
|
|
206
|
+
WHERE l.from_kind = 'note' AND l.from_id = notes.note_id
|
|
207
|
+
AND l.to_kind = 'project' AND l.relation = 'belongs_to'
|
|
208
|
+
ORDER BY p.name, p.project_id
|
|
209
|
+
)) AS projects_json
|
|
194
210
|
FROM notes ${where}`).all(...params);
|
|
195
211
|
let entries = rows.map(rowToIndexEntry);
|
|
196
212
|
if (query.tag) entries = entries.filter((entry) => entry.tags?.includes(query.tag));
|
|
@@ -222,5 +238,23 @@ function listNoteRecords(query = {}) {
|
|
|
222
238
|
hasMore: offset + items.length < total
|
|
223
239
|
};
|
|
224
240
|
}
|
|
241
|
+
function listNoteProjectSummaries() {
|
|
242
|
+
return getSqliteDatabase().prepare(`
|
|
243
|
+
SELECT p.project_id, p.name, p.description,
|
|
244
|
+
COUNT(DISTINCT n.note_id) AS note_count, MAX(n.updated_at) AS note_updated_at
|
|
245
|
+
FROM projects p
|
|
246
|
+
LEFT JOIN object_links l ON l.to_kind = 'project' AND l.to_id = p.project_id
|
|
247
|
+
AND l.from_kind = 'note' AND l.relation = 'belongs_to'
|
|
248
|
+
LEFT JOIN notes n ON n.note_id = l.from_id AND n.status != 'trashed'
|
|
249
|
+
GROUP BY p.project_id
|
|
250
|
+
ORDER BY (p.pinned_at IS NOT NULL) DESC, MAX(n.updated_at) DESC, p.updated_at DESC, p.project_id
|
|
251
|
+
`).all().map((row) => ({
|
|
252
|
+
id: row.project_id,
|
|
253
|
+
name: row.name,
|
|
254
|
+
description: row.description ?? void 0,
|
|
255
|
+
noteCount: row.note_count,
|
|
256
|
+
updatedAt: row.note_updated_at ?? void 0
|
|
257
|
+
}));
|
|
258
|
+
}
|
|
225
259
|
//#endregion
|
|
226
|
-
export { deleteNoteRecord, getNoteRecord, listNoteRecords, upsertNoteRecord };
|
|
260
|
+
export { deleteNoteRecord, getNoteRecord, listNoteProjectSummaries, listNoteRecords, upsertNoteRecord };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { getSqliteDatabase } from './transaction.js';
|
|
1
2
|
import { type TurnOrigin } from '@xopcai/endpoint-tools-protocol';
|
|
2
3
|
import type { AgentSourceContext, SourceContextRefSummary } from '../../agent/source-context/types.js';
|
|
3
4
|
export type SessionInputDelivery = 'next' | 'steer';
|
|
4
|
-
export type SessionInputStatus = 'queued' | 'running' | 'injecting' | 'completed' | 'cancelled' | 'failed' | 'interrupted';
|
|
5
|
+
export type SessionInputStatus = 'queued' | 'running' | 'injecting' | 'completed' | 'cancelled' | 'failed' | 'interrupted' | 'suspended';
|
|
5
6
|
export type SessionInput = {
|
|
6
7
|
id: string;
|
|
7
8
|
sessionKey: string;
|
|
@@ -11,6 +12,13 @@ export type SessionInput = {
|
|
|
11
12
|
effectiveDelivery: SessionInputDelivery;
|
|
12
13
|
status: SessionInputStatus;
|
|
13
14
|
content: string;
|
|
15
|
+
taskRunId?: string;
|
|
16
|
+
kind: 'message' | 'connection_resume';
|
|
17
|
+
payload?: {
|
|
18
|
+
waitId: string;
|
|
19
|
+
objectiveRevision: number;
|
|
20
|
+
resolution: 'continued' | 'skipped';
|
|
21
|
+
};
|
|
14
22
|
attachments?: unknown[];
|
|
15
23
|
contextRefs?: SourceContextRefSummary[];
|
|
16
24
|
contextSnapshots?: AgentSourceContext[];
|
|
@@ -31,6 +39,7 @@ export type SessionInputState = {
|
|
|
31
39
|
activeInputId?: string;
|
|
32
40
|
inputs: SessionInput[];
|
|
33
41
|
};
|
|
42
|
+
export declare function bumpSessionInputRevision(db: ReturnType<typeof getSqliteDatabase>, sessionKey: string): number;
|
|
34
43
|
export declare function getSessionInputState(sessionKey: string): SessionInputState;
|
|
35
44
|
/** Durable active webchat runs claimed by the session-input coordinator. */
|
|
36
45
|
export declare function listActiveSessionInputRuns(): Array<{
|
|
@@ -52,6 +61,9 @@ export declare function insertSessionInput(input: {
|
|
|
52
61
|
status: 'queued' | 'injecting';
|
|
53
62
|
content: string;
|
|
54
63
|
attachments?: unknown[];
|
|
64
|
+
taskRunId?: string;
|
|
65
|
+
kind?: SessionInput['kind'];
|
|
66
|
+
payload?: SessionInput['payload'];
|
|
55
67
|
contextRefs?: SourceContextRefSummary[];
|
|
56
68
|
contextSnapshots?: AgentSourceContext[];
|
|
57
69
|
thinking?: string;
|
|
@@ -59,7 +71,7 @@ export declare function insertSessionInput(input: {
|
|
|
59
71
|
targetRunId?: string;
|
|
60
72
|
}): SessionInput;
|
|
61
73
|
export declare function claimNextSessionInput(sessionKey: string, runId: string): SessionInput | undefined;
|
|
62
|
-
export declare function finishSessionInputRun(sessionKey: string, runId: string, status: 'completed' | 'failed' | 'cancelled', error?: string): boolean;
|
|
74
|
+
export declare function finishSessionInputRun(sessionKey: string, runId: string, status: 'completed' | 'failed' | 'cancelled' | 'suspended', error?: string): boolean;
|
|
63
75
|
export declare function setSessionInputStatus(id: string, status: SessionInputStatus, patch?: {
|
|
64
76
|
effectiveDelivery?: SessionInputDelivery;
|
|
65
77
|
targetRunId?: string | null;
|
|
@@ -12,6 +12,9 @@ function mapInput(row) {
|
|
|
12
12
|
effectiveDelivery: row.effective_delivery,
|
|
13
13
|
status: row.status,
|
|
14
14
|
content: row.content,
|
|
15
|
+
kind: row.kind,
|
|
16
|
+
taskRunId: row.task_run_id ?? void 0,
|
|
17
|
+
payload: row.payload_json ? JSON.parse(row.payload_json) : void 0,
|
|
15
18
|
attachments: row.attachments_json ? JSON.parse(row.attachments_json) : void 0,
|
|
16
19
|
contextRefs: row.context_refs_json ? JSON.parse(row.context_refs_json) : void 0,
|
|
17
20
|
contextSnapshots: row.context_snapshots_json ? JSON.parse(row.context_snapshots_json) : void 0,
|
|
@@ -28,14 +31,14 @@ function mapInput(row) {
|
|
|
28
31
|
}
|
|
29
32
|
const SELECT_INPUTS = `SELECT id, session_key, client_message_id, expected_session_id, requested_delivery,
|
|
30
33
|
effective_delivery, status, content, attachments_json, context_refs_json, context_snapshots_json,
|
|
31
|
-
thinking, origin_json, position,
|
|
34
|
+
thinking, origin_json, position, kind, payload_json, task_run_id,
|
|
32
35
|
target_run_id, run_id, version, error, created_at_ms, updated_at_ms
|
|
33
36
|
FROM session_inputs`;
|
|
34
37
|
function ensureRuntime(db, sessionKey) {
|
|
35
38
|
db.prepare(`INSERT INTO session_input_runtime(session_key, revision, updated_at_ms)
|
|
36
39
|
VALUES (?, 0, ?) ON CONFLICT(session_key) DO NOTHING`).run(sessionKey, Date.now());
|
|
37
40
|
}
|
|
38
|
-
function
|
|
41
|
+
function bumpSessionInputRevision(db, sessionKey) {
|
|
39
42
|
ensureRuntime(db, sessionKey);
|
|
40
43
|
db.prepare(`UPDATE session_input_runtime SET revision = revision + 1, updated_at_ms = ?
|
|
41
44
|
WHERE session_key = ?`).run(Date.now(), sessionKey);
|
|
@@ -52,7 +55,7 @@ function getSessionInputState(sessionKey) {
|
|
|
52
55
|
revision: runtime?.revision ?? 0,
|
|
53
56
|
activeRunId: runtime?.active_run_id ?? void 0,
|
|
54
57
|
activeInputId: runtime?.active_input_id ?? void 0,
|
|
55
|
-
inputs: rows.map((row) => {
|
|
58
|
+
inputs: rows.filter((row) => row.kind === "message").map((row) => {
|
|
56
59
|
const { contextSnapshots: _contextSnapshots, ...input } = mapInput(row);
|
|
57
60
|
return input;
|
|
58
61
|
})
|
|
@@ -90,9 +93,9 @@ function insertSessionInput(input) {
|
|
|
90
93
|
db.prepare(`INSERT INTO session_inputs(id, session_key, client_message_id, expected_session_id,
|
|
91
94
|
requested_delivery, effective_delivery, status, content, attachments_json,
|
|
92
95
|
context_refs_json, context_snapshots_json, thinking, origin_json, position,
|
|
93
|
-
target_run_id, version, created_at_ms, updated_at_ms)
|
|
94
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?)`).run(input.id, input.sessionKey, input.clientMessageId, input.expectedSessionId ?? null, input.requestedDelivery, input.effectiveDelivery, input.status, input.content, input.attachments ? JSON.stringify(input.attachments) : null, input.contextRefs ? JSON.stringify(input.contextRefs) : null, input.contextSnapshots ? JSON.stringify(input.contextSnapshots) : null, input.thinking ?? null, JSON.stringify(input.origin), max.value + 1, input.targetRunId ?? null, now, now);
|
|
95
|
-
|
|
96
|
+
target_run_id, version, created_at_ms, updated_at_ms, kind, payload_json, task_run_id)
|
|
97
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?)`).run(input.id, input.sessionKey, input.clientMessageId, input.expectedSessionId ?? null, input.requestedDelivery, input.effectiveDelivery, input.status, input.content, input.attachments ? JSON.stringify(input.attachments) : null, input.contextRefs ? JSON.stringify(input.contextRefs) : null, input.contextSnapshots ? JSON.stringify(input.contextSnapshots) : null, input.thinking ?? null, JSON.stringify(input.origin), max.value + 1, input.targetRunId ?? null, now, now, input.kind ?? "message", input.payload ? JSON.stringify(input.payload) : null, input.taskRunId ?? null);
|
|
98
|
+
bumpSessionInputRevision(db, input.sessionKey);
|
|
96
99
|
return mapInput(db.prepare(`${SELECT_INPUTS} WHERE id = ?`).get(input.id));
|
|
97
100
|
});
|
|
98
101
|
}
|
|
@@ -102,7 +105,7 @@ function claimNextSessionInput(sessionKey, runId) {
|
|
|
102
105
|
if (db.prepare(`SELECT active_run_id FROM session_input_runtime WHERE session_key = ?`).get(sessionKey).active_run_id) return void 0;
|
|
103
106
|
if (db.prepare(`UPDATE session_inputs SET status = 'interrupted', error = 'Session changed before delivery',
|
|
104
107
|
version = version + 1, updated_at_ms = ? WHERE session_key = ? AND status = 'queued'
|
|
105
|
-
AND expected_session_id IS NOT NULL AND expected_session_id IS NOT ?`).run(Date.now(), sessionKey, readCurrentSessionId(db, sessionKey)).changes)
|
|
108
|
+
AND expected_session_id IS NOT NULL AND expected_session_id IS NOT ?`).run(Date.now(), sessionKey, readCurrentSessionId(db, sessionKey)).changes) bumpSessionInputRevision(db, sessionKey);
|
|
106
109
|
const row = db.prepare(`${SELECT_INPUTS} WHERE session_key = ? AND effective_delivery = 'next'
|
|
107
110
|
AND status = 'queued' ORDER BY position, created_at_ms, id LIMIT 1`).get(sessionKey);
|
|
108
111
|
if (!row) return void 0;
|
|
@@ -135,14 +138,14 @@ function setSessionInputStatus(id, status, patch) {
|
|
|
135
138
|
if (!row) return false;
|
|
136
139
|
db.prepare(`UPDATE session_inputs SET status = ?, effective_delivery = ?, target_run_id = ?,
|
|
137
140
|
error = ?, version = version + 1, updated_at_ms = ? WHERE id = ?`).run(status, patch?.effectiveDelivery ?? row.effective_delivery, patch?.targetRunId !== void 0 ? patch.targetRunId : row.target_run_id, patch?.error ?? row.error, Date.now(), id);
|
|
138
|
-
|
|
141
|
+
bumpSessionInputRevision(db, row.session_key);
|
|
139
142
|
return true;
|
|
140
143
|
});
|
|
141
144
|
}
|
|
142
145
|
function mutateQueuedSessionInput(input) {
|
|
143
146
|
return runSqliteWriteTransaction((db) => {
|
|
144
147
|
const row = db.prepare(`${SELECT_INPUTS} WHERE id = ? AND session_key = ?`).get(input.id, input.sessionKey);
|
|
145
|
-
if (!row || row.status !== "queued" || row.version !== input.version) return false;
|
|
148
|
+
if (!row || row.kind !== "message" || row.status !== "queued" || row.version !== input.version) return false;
|
|
146
149
|
const now = Date.now();
|
|
147
150
|
if (input.position !== void 0) {
|
|
148
151
|
const ordered = db.prepare(`${SELECT_INPUTS} WHERE session_key = ? AND status = 'queued' ORDER BY position, created_at_ms, id`).all(input.sessionKey).filter((item) => item.id !== input.id);
|
|
@@ -152,16 +155,16 @@ function mutateQueuedSessionInput(input) {
|
|
|
152
155
|
} else db.prepare(`UPDATE session_inputs SET content = ?, attachments_json = ?, context_refs_json = ?,
|
|
153
156
|
context_snapshots_json = ?, thinking = ?, version = version + 1,
|
|
154
157
|
updated_at_ms = ? WHERE id = ?`).run(input.content ?? row.content, input.attachments ? JSON.stringify(input.attachments) : row.attachments_json, input.contextRefs ? JSON.stringify(input.contextRefs) : row.context_refs_json, input.contextSnapshots ? JSON.stringify(input.contextSnapshots) : row.context_snapshots_json, input.thinking ?? row.thinking, now, input.id);
|
|
155
|
-
|
|
158
|
+
bumpSessionInputRevision(db, input.sessionKey);
|
|
156
159
|
return true;
|
|
157
160
|
});
|
|
158
161
|
}
|
|
159
162
|
function cancelQueuedSessionInput(sessionKey, id, version) {
|
|
160
163
|
return runSqliteWriteTransaction((db) => {
|
|
161
164
|
const result = db.prepare(`UPDATE session_inputs SET status = 'cancelled', version = version + 1,
|
|
162
|
-
updated_at_ms = ? WHERE id = ? AND session_key = ? AND version = ? AND status IN ('queued','interrupted')`).run(Date.now(), id, sessionKey, version);
|
|
165
|
+
updated_at_ms = ? WHERE id = ? AND session_key = ? AND version = ? AND kind = 'message' AND status IN ('queued','interrupted')`).run(Date.now(), id, sessionKey, version);
|
|
163
166
|
if (Number(result.changes) === 0) return false;
|
|
164
|
-
|
|
167
|
+
bumpSessionInputRevision(db, sessionKey);
|
|
165
168
|
return true;
|
|
166
169
|
});
|
|
167
170
|
}
|
|
@@ -177,4 +180,4 @@ function recoverSessionInputState() {
|
|
|
177
180
|
});
|
|
178
181
|
}
|
|
179
182
|
//#endregion
|
|
180
|
-
export { SessionInstanceChangedError, cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, finishSessionInputRun, getSessionInputById, getSessionInputState, insertSessionInput, listActiveSessionInputRuns, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus };
|
|
183
|
+
export { SessionInstanceChangedError, bumpSessionInputRevision, cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, finishSessionInputRun, getSessionInputById, getSessionInputState, insertSessionInput, listActiveSessionInputRuns, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
+
import { cancelConnectionObjective } from "./connection-wait-repository.js";
|
|
2
3
|
import { notifyUserContextChange } from "../../user-context/changes.js";
|
|
3
|
-
import { buildFts5SearchQuery } from "./fts.js";
|
|
4
4
|
import { validateSessionId } from "../../session/session-id.js";
|
|
5
5
|
import { buildDefaultSessionMetadata } from "./session-metadata.js";
|
|
6
6
|
import { buildGlobalSessionStats, metadataToSessionInsert, sessionRowToMetadata } from "./row-mappers.js";
|
|
7
|
+
import { buildFts5SearchQuery } from "./fts.js";
|
|
7
8
|
import { randomUUID } from "node:crypto";
|
|
8
9
|
//#region src/storage/sqlite/session-repository.ts
|
|
9
10
|
const SESSION_COLUMNS = `
|
|
@@ -254,6 +255,7 @@ function resetSessionRecord(sessionKey, cwd) {
|
|
|
254
255
|
return runSqliteWriteTransaction((db) => {
|
|
255
256
|
const existing = readSessionRow(db, sessionKey);
|
|
256
257
|
if (!existing) return null;
|
|
258
|
+
cancelConnectionObjective(sessionKey);
|
|
257
259
|
const previousSessionId = existing.session_id;
|
|
258
260
|
const now = Date.now();
|
|
259
261
|
db.prepare(`UPDATE transcripts SET status = 'archived', archive_reason = 'reset', archived_at = ?
|
|
@@ -286,6 +288,7 @@ function deleteSessionRecord(sessionKey) {
|
|
|
286
288
|
const now = Date.now();
|
|
287
289
|
db.prepare(`UPDATE transcripts SET status = 'archived', archive_reason = 'delete', archived_at = ?
|
|
288
290
|
WHERE session_id = ?`).run(now, existing.session_id);
|
|
291
|
+
cancelConnectionObjective(sessionKey);
|
|
289
292
|
db.prepare(`DELETE FROM sessions WHERE session_key = ?`).run(sessionKey);
|
|
290
293
|
return true;
|
|
291
294
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
-
import { escapeFts5Query } from "./fts.js";
|
|
3
2
|
import { buildSessionContextForLlm, isRuntimeOnlyTranscriptMessage } from "../../session/session-context-for-llm.js";
|
|
4
3
|
import { classifyStoredRow, estimateTokensFromMessages, extractFtsContent, transcriptEntryRowToStoredRow } from "./row-mappers.js";
|
|
4
|
+
import { escapeFts5Query } from "./fts.js";
|
|
5
5
|
import { getCurrentSessionId, readCurrentSessionId } from "./session-repository.js";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
//#region src/storage/sqlite/transcript-repository.ts
|
package/dist/src/tasks/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TaskRepository } from "./task-repository.js";
|
|
2
|
-
import { TaskConversationConflictError, TaskConversationRepository } from "./task-conversation-repository.js";
|
|
3
1
|
import { enqueueTaskAttentionRequiredEvent, enqueueTaskChanged, enqueueTaskChangedEvent } from "./task-change-events.js";
|
|
4
2
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
3
|
+
import { TaskRepository } from "./task-repository.js";
|
|
4
|
+
import { TaskConversationConflictError, TaskConversationRepository } from "./task-conversation-repository.js";
|
|
5
5
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
6
6
|
import { resolveExecutionContext } from "./execution-context.js";
|
|
7
7
|
import { AttentionGovernor } from "./attention-governor.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TaskRepository } from "./task-repository.js";
|
|
2
1
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
2
|
+
import { TaskRepository } from "./task-repository.js";
|
|
3
3
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
4
4
|
import { TaskDependencyService } from "./task-dependency-service.js";
|
|
5
5
|
import { ProjectMonitoringService } from "./project-monitoring-service.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
-
import { TaskRepository } from "./task-repository.js";
|
|
3
2
|
import { enqueueTaskAttentionRequiredEvent, enqueueTaskChangedEvent } from "./task-change-events.js";
|
|
4
3
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
4
|
+
import { TaskRepository } from "./task-repository.js";
|
|
5
5
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
6
6
|
import { TaskContextRepository } from "./task-context-repository.js";
|
|
7
7
|
import { TaskDependencyService } from "./task-dependency-service.js";
|
|
@@ -252,6 +252,11 @@ var TaskApplicationService = class {
|
|
|
252
252
|
reason: "not_found",
|
|
253
253
|
model
|
|
254
254
|
};
|
|
255
|
+
else if (wait.condition.type === "connection") result = {
|
|
256
|
+
ok: false,
|
|
257
|
+
reason: "invalid_transition",
|
|
258
|
+
model
|
|
259
|
+
};
|
|
255
260
|
else {
|
|
256
261
|
this.#runs.resolveWait({
|
|
257
262
|
waitId: wait.id,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
2
|
+
import { TaskRunRepository } from "./task-run-repository.js";
|
|
2
3
|
import "../storage/sqlite/index.js";
|
|
3
4
|
import { TaskRepository } from "./task-repository.js";
|
|
4
5
|
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
5
|
-
import { TaskRunRepository } from "./task-run-repository.js";
|
|
6
6
|
import { TaskContextRepository } from "./task-context-repository.js";
|
|
7
7
|
//#region src/tasks/task-context-assembler.ts
|
|
8
8
|
const STANDARD = {
|
|
@@ -6,7 +6,6 @@ export declare class TaskContextRepository {
|
|
|
6
6
|
query: string;
|
|
7
7
|
selectedItems?: unknown[];
|
|
8
8
|
rejectedItems?: unknown[];
|
|
9
|
-
consentRequests?: unknown[];
|
|
10
9
|
relationshipPolicy?: Record<string, unknown>;
|
|
11
10
|
authorizationSnapshot?: Record<string, unknown>;
|
|
12
11
|
sessionKey?: string;
|
|
@@ -38,7 +38,7 @@ var TaskContextRepository = class {
|
|
|
38
38
|
selected_items_json, rejected_items_json, consent_requests_json,
|
|
39
39
|
relationship_policy_json, estimated_tokens, allocation_json,
|
|
40
40
|
authorization_snapshot_json, content_hash, created_at
|
|
41
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(id, traceId, input.ownerKind, input.ownerId, input.sessionKey ?? null, input.query, JSON.stringify(input.selectedItems ?? []), JSON.stringify(input.rejectedItems ?? []),
|
|
41
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(id, traceId, input.ownerKind, input.ownerId, input.sessionKey ?? null, input.query, JSON.stringify(input.selectedItems ?? []), JSON.stringify(input.rejectedItems ?? []), "[]", JSON.stringify(input.relationshipPolicy ?? {}), input.estimatedTokens ?? 0, input.allocation ? JSON.stringify(input.allocation) : null, JSON.stringify(input.authorizationSnapshot ?? {}), input.contentHash ?? null, input.now ?? Date.now());
|
|
42
42
|
return {
|
|
43
43
|
id,
|
|
44
44
|
traceId
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TaskRepository } from "./task-repository.js";
|
|
2
1
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
2
|
+
import { TaskRepository } from "./task-repository.js";
|
|
3
3
|
//#region src/tasks/task-deletion-service.ts
|
|
4
4
|
var TaskDeletionService = class {
|
|
5
5
|
constructor(tasks = new TaskRepository(), runs = new TaskRunRepository()) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { TaskRunRepository } from "./task-run-repository.js";
|
|
3
4
|
import { init_agent_scope, listAgentEntries, normalizeAgentId } from "../agent/agent-scope.js";
|
|
4
5
|
import { buildSessionKey, init_session_key, sanitizeSegment } from "../routing/session-key.js";
|
|
5
6
|
import { TaskRepository } from "./task-repository.js";
|
|
6
7
|
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
7
|
-
import { TaskRunRepository } from "./task-run-repository.js";
|
|
8
8
|
import { TaskContextRepository } from "./task-context-repository.js";
|
|
9
9
|
//#region src/tasks/task-handoff-service.ts
|
|
10
10
|
init_agent_scope();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSqliteDatabase } from "../storage/sqlite/transaction.js";
|
|
2
|
-
import { TaskRepository } from "./task-repository.js";
|
|
3
2
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
3
|
+
import { TaskRepository } from "./task-repository.js";
|
|
4
4
|
//#region src/tasks/task-read-model-projector.ts
|
|
5
5
|
var TaskReadModelProjector = class {
|
|
6
6
|
#tasks = new TaskRepository();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TaskRepository } from "./task-repository.js";
|
|
2
1
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
2
|
+
import { TaskRepository } from "./task-repository.js";
|
|
3
3
|
import { TaskContextRepository } from "./task-context-repository.js";
|
|
4
4
|
import { TaskApplicationService } from "./task-application-service.js";
|
|
5
5
|
//#region src/tasks/task-run-coordinator.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { TaskRepository } from "./task-repository.js";
|
|
4
3
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
4
|
+
import { TaskRepository } from "./task-repository.js";
|
|
5
5
|
import { TaskApplicationService } from "./task-application-service.js";
|
|
6
6
|
//#region src/tasks/task-run-dispatcher.ts
|
|
7
7
|
init_logger();
|
|
@@ -137,6 +137,7 @@ var TaskRunRepository = class {
|
|
|
137
137
|
WHERE wait.task_run_id = task_runs.run_id AND wait.status = 'active'
|
|
138
138
|
))
|
|
139
139
|
)
|
|
140
|
+
AND NOT EXISTS (SELECT 1 FROM session_inputs input WHERE input.task_run_id = task_runs.run_id AND input.status IN ('queued','running'))
|
|
140
141
|
AND (? IS NULL OR executor_kind = ?)
|
|
141
142
|
AND COALESCE(scheduled_at, 0) <= ?
|
|
142
143
|
AND (lease_expires_at IS NULL OR lease_expires_at <= ?)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getSqliteDatabase } from "../storage/sqlite/transaction.js";
|
|
2
2
|
import { TaskExecutorSelectionSchema } from "../../packages/gateway-contract/src/tasks.js";
|
|
3
|
-
import { TaskRepository } from "./task-repository.js";
|
|
4
3
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
4
|
+
import { TaskRepository } from "./task-repository.js";
|
|
5
5
|
import { TaskApplicationService } from "./task-application-service.js";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
//#region src/tasks/task-signal-service.ts
|
|
@@ -5,9 +5,9 @@ import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js
|
|
|
5
5
|
import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
|
|
6
6
|
import { loadSkills } from "../agent/skills/index.js";
|
|
7
7
|
import { createWorkflowCatalog } from "../agent/workflow/catalog.js";
|
|
8
|
+
import { listConnectorInstances } from "../connectors/instances.js";
|
|
8
9
|
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
9
10
|
import "../config/index.js";
|
|
10
|
-
import { listConnectorInstances } from "../connectors/instances.js";
|
|
11
11
|
import { basename } from "node:path";
|
|
12
12
|
//#region src/tui/tui-startup-resources.ts
|
|
13
13
|
init_paths();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface UserContextChange {
|
|
2
|
-
kind: '
|
|
2
|
+
kind: 'policy' | 'session' | 'session-reset';
|
|
3
3
|
id?: string;
|
|
4
4
|
}
|
|
5
5
|
export declare function onUserContextChange(listener: (change: UserContextChange) => void): () => void;
|