@xopcai/xopc 0.0.218 → 0.0.219
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-DF2dYXG1.js → activity-store-slG02hSm.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Dw9rF5o1.js → agent-avatar-dicebear-DZ6ETNIk.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DxaIH0Ep.js +68 -0
- package/dist/gateway/static/root/assets/{api-_H0Bam-t.js → api-Tz57QxiN.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-DdR1L4LR.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-wYbwqmee.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-CyWr6KyO.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DZCOhXch.js → archive-plugin-DKXa160O.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Bjb0FH2B.js → attachment-load-CzwA9g2y.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-D4N3ZDhu.js → automations-page-DwAXyWAY.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CL7ieYIt.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-uXPt0s47.js → binary-plugins-DoQ_DnT7.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-gukkIEro.js → block-editor-Bj_Uxxng.js} +47 -47
- package/dist/gateway/static/root/assets/browser-settings-page-BYa_FNC1.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-DAhdS-XZ.js → browser-workflow-inputs-D4roXE6r.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-LKjYzXS_.js → browser-workflows-page-CleKTAKD.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DYG37N0k.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-BBUkH833.js → capability-presets-api-wtEN6Ss6.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-C0Q4dFq-.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-E5mo8M3a.js → channel-recipient-api-DhuS2RJ3.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CpO6Xg0n.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-CXhPeiNj.js +1 -0
- package/dist/gateway/static/root/assets/chat-terminal-dock-ClQMDe2n.js +36 -0
- package/dist/gateway/static/root/assets/connectors-page-BvyiPdKU.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-BGNuaqvI.js → cron-expression-4DvCFs-v.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-k7mkklMU.js → date-picker-B6FSjt4Z.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-Za18eMp1.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-p9EZyGzV.js → desktop-pet-DUUf3yyJ.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Dwx3GfB8.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-C6dfTCsl.js +1 -0
- package/dist/gateway/static/root/assets/ellipsis-0k4rZLoy.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-Cd4BMKm_.js → extension-debug-page-Cordpg4X.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CzEGCkOa.js → extension-page-Dw0dGyMl.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-B2pUMaXm.js +1 -0
- package/dist/gateway/static/root/assets/eye-CABVeTq0.js +1 -0
- package/dist/gateway/static/root/assets/eye-off-DEAzt3g1.js +1 -0
- package/dist/gateway/static/root/assets/file-code-corner-byQA1VfD.js +1 -0
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +1 -0
- package/dist/gateway/static/root/assets/gateway-config-api-DAZUOEQh.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-DNrttVr2.js → gateway-config-swr-BIqRg-zo.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-ik2f-pmV.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B1vD3vRb.js → gateway-startup-retry-BFjWYOCS.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-BE81XJ8F.js +1 -0
- package/dist/gateway/static/root/assets/home-page-BTWXJu_m.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BTR0Wk_k.js → image-generation-api-HXAWlgm6.js} +1 -1
- package/dist/gateway/static/root/assets/index-B6gWYy08.js +108 -0
- package/dist/gateway/static/root/assets/index-CDkuz_YC.css +2 -0
- package/dist/gateway/static/root/assets/interaction-BmQogeqz.js +1 -0
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CYlS4RGA.js → keyboard-shortcuts-settings-ROqQ_Xlo.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Dcaf190G.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-CNppYVew.js → local-apps-page-Be79cyMG.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-gf9Bg2gb.js → locale-store-DfK-Hofd.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-C2pjbXno.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-IYk9xLgt.js → management-settings-CRspx0oY.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-D8e6pRMH.js → markdown-split-G3PTpGw3.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-D0fiJjBQ.js → markdown-view-D4FPJZ91.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CCq6TtEf.js → media-plugins-DT0P7j7u.js} +1 -1
- package/dist/gateway/static/root/assets/messages-B701TEZ5.js +3 -0
- package/dist/gateway/static/root/assets/{notes-api-BBtWnlUU.js → notes-api-q7HjYO07.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BKe1xa3U.js → notes-page-Cgl2h7AR.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DFMQYyGJ.js +4 -0
- package/dist/gateway/static/root/assets/page-tabs-BaEQMYm_.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-CsNVTKC0.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-DXe5iWI6.js → product-open-page-ComKLO4D.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DUFmQscH.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-CTWxt3dv.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-xj5gOva_.js → registry-api-BBoJ7khF.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-qmG-3qjj.js +1 -0
- package/dist/gateway/static/root/assets/rotate-cw-LIg3Am9S.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BJTvmBCA.js → runtime-tools-settings-panel-CXHQc53b.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DvGBa_7R.js → schema-form-3jTDF2lJ.js} +1 -1
- package/dist/gateway/static/root/assets/search-DA7gz22f.js +1 -0
- package/dist/gateway/static/root/assets/sessions-page-D_We4_MV.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-B_QhPgU0.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-CUDozALU.js +1 -0
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-sbef7GTm.js → settings-loading-skeleton-H3ZH6a6l.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BNGxxXZe.js → settings-page-tx29z21o.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-VunfXpTX.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-C1523ij3.js → share-preview-page-MyThymEx.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DkZvY1cr.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DVDOh1iY.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BOOyMnno.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-Ditgz7Vo.js → skills-page.utils-Bl5Yv3Cx.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-DwQ3O1ta.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-BwOyrADL.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-DgSjes3O.js → theme-store-Br4BtK4x.js} +1 -1
- package/dist/gateway/static/root/assets/typed-models-lib-q5-Vfqd8.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-Bp_qFZkl.js → use-autosave-DRS3RwS9.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-ClV2r3Cr.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-hbzDfErG.js → voice-api-key-field-CGTE5156.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DZVib-04.js → work-discovery-overlay-CW-HKD7h.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-C2RKay1p.js → workflow-run-setup-panel-Dtr9fDC8.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CDOyNgZf.js +5 -0
- package/dist/gateway/static/root/index.html +20 -11
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/new-session.js +99 -0
- package/dist/packages/gateway-contract/src/tasks.js +5 -0
- package/dist/packages/gateway-contract/src/user-message-display.js +55 -0
- package/dist/src/agent/agent-manager.js +5 -4
- package/dist/src/agent/background-review/prompts.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.js +2 -2
- package/dist/src/agent/background-review/run-background-review.js +144 -16
- 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/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +3 -1
- package/dist/src/agent/inbound/turn-dispatcher.js +2 -1
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/memory/context/types.d.ts +1 -1
- package/dist/src/agent/memory/manager.d.ts +2 -1
- package/dist/src/agent/memory/manager.js +2 -6
- package/dist/src/agent/memory/understanding/service.d.ts +1 -0
- package/dist/src/agent/memory/understanding/service.js +179 -36
- package/dist/src/agent/memory/understanding/types.d.ts +6 -0
- package/dist/src/agent/messaging/command-handler.d.ts +2 -0
- package/dist/src/agent/messaging/command-handler.js +3 -1
- package/dist/src/agent/service/direct-turn-helpers.d.ts +3 -0
- package/dist/src/agent/service/direct-turn-helpers.js +13 -3
- package/dist/src/agent/service/process-direct-streaming.d.ts +2 -1
- package/dist/src/agent/service/process-direct-streaming.js +12 -11
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-config-service.d.ts +1 -0
- package/dist/src/agent/session/session-config-service.js +11 -0
- package/dist/src/agent/session/session-inspector.d.ts +1 -0
- package/dist/src/agent/session/session-inspector.js +2 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/source-context/budget.d.ts +3 -0
- package/dist/src/agent/source-context/budget.js +21 -0
- package/dist/src/agent/source-context/index.js +3 -3
- package/dist/src/agent/source-context/injector.d.ts +2 -2
- package/dist/src/agent/source-context/injector.js +19 -9
- package/dist/src/agent/source-context/types.d.ts +16 -0
- package/dist/src/agent/source-context/types.js +25 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +19 -2
- package/dist/src/agent/tools/xopc-use-tool.js +62 -2
- 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/browser/backend-from-config.d.ts +8 -0
- package/dist/src/browser/backend-from-config.js +16 -1
- package/dist/src/browser/providers/browser-ext-install.d.ts +3 -2
- package/dist/src/browser/providers/browser-ext-install.js +5 -3
- package/dist/src/chat-commands/builtins/review.js +11 -2
- package/dist/src/chat-commands/builtins/understanding.js +11 -4
- package/dist/src/chat-commands/types.d.ts +4 -0
- 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/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/extension.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.d.ts +20 -20
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/connectors/connected-source-understanding.d.ts +1 -0
- package/dist/src/connectors/connected-source-understanding.js +82 -34
- package/dist/src/connectors/learning-coordinator.js +57 -11
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +18 -0
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +12 -2
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +1 -0
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +46 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +23 -3
- package/dist/src/gateway/hono/routes/sessions.js +17 -20
- package/dist/src/gateway/hono/routes/tasks.js +25 -0
- package/dist/src/gateway/hono/routes/understanding-sources.d.ts +9 -0
- package/dist/src/gateway/hono/routes/understanding-sources.js +127 -31
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/hono/routes/you.js +71 -4
- package/dist/src/gateway/service/agent-runner.d.ts +7 -2
- package/dist/src/gateway/service/agent-runner.js +21 -1
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.d.ts +2 -0
- package/dist/src/gateway/service/run-gateway-agent.js +2 -1
- package/dist/src/gateway/service/session-input-coordinator.d.ts +8 -2
- package/dist/src/gateway/service/session-input-coordinator.js +62 -3
- package/dist/src/gateway/service/sessions-api.d.ts +1 -0
- package/dist/src/gateway/service.d.ts +3 -2
- package/dist/src/gateway/service.js +25 -15
- package/dist/src/gateway/user-turn-input.d.ts +2 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +3 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.js +16 -3
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/knowledge/connected-understanding-pipeline.d.ts +1 -1
- package/dist/src/knowledge/connected-understanding-pipeline.js +4 -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/retrieval/queryProfile.d.ts +1 -0
- package/dist/src/retrieval/queryProfile.js +9 -1
- package/dist/src/session/client-history.d.ts +11 -0
- package/dist/src/session/client-history.js +24 -2
- package/dist/src/session/config-types.d.ts +1 -1
- package/dist/src/session/session-title.js +2 -3
- package/dist/src/session/store.js +1 -0
- package/dist/src/session/transcript-outline.js +5 -2
- package/dist/src/session/types.d.ts +1 -0
- package/dist/src/session/user-message-display.d.ts +4 -0
- package/dist/src/session/user-message-display.js +22 -0
- package/dist/src/storage/sqlite/context-extraction-repository.d.ts +57 -0
- package/dist/src/storage/sqlite/context-extraction-repository.js +119 -0
- package/dist/src/storage/sqlite/context-relation-repository.d.ts +50 -0
- package/dist/src/storage/sqlite/context-relation-repository.js +97 -0
- package/dist/src/storage/sqlite/index.d.ts +4 -2
- package/dist/src/storage/sqlite/index.js +5 -3
- package/dist/src/storage/sqlite/migrations/126_focus_context_governance.sql +72 -0
- package/dist/src/storage/sqlite/migrations/127_context_object_origin.sql +36 -0
- package/dist/src/storage/sqlite/migrations/128_context_extraction.sql +73 -0
- package/dist/src/storage/sqlite/migrations/129_focus_versions.sql +51 -0
- package/dist/src/storage/sqlite/migrations/130_context_evidence_provenance.sql +18 -0
- package/dist/src/storage/sqlite/migrations/131_session_input_contexts.sql +2 -0
- package/dist/src/storage/sqlite/migrations/132_transcript_source_context_metadata.sql +34 -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/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +8 -0
- package/dist/src/storage/sqlite/session-input-repository.js +19 -7
- package/dist/src/storage/sqlite/session-turn-replace-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/session-turn-replace-repository.js +3 -2
- package/dist/src/storage/sqlite/transcript-repository.js +29 -3
- package/dist/src/storage/sqlite/user-context-repository.d.ts +4 -1
- package/dist/src/storage/sqlite/user-context-repository.js +65 -29
- package/dist/src/tasks/index.d.ts +1 -0
- package/dist/src/tasks/index.js +2 -1
- package/dist/src/tasks/task-deletion-service.d.ts +21 -0
- package/dist/src/tasks/task-deletion-service.js +35 -0
- package/dist/src/tasks/task-repository.js +22 -1
- package/dist/src/tui/backends/embedded-backend.js +5 -3
- package/dist/src/tui/backends/gateway-realtime-backend.js +5 -3
- package/dist/src/tui/chat-history.js +2 -1
- package/dist/src/tui/tui-agent-events.js +4 -2
- package/dist/src/tui/tui-commands.d.ts +1 -0
- package/dist/src/tui/tui-commands.js +8 -3
- package/dist/src/tui/tui-empty-session-cleanup.d.ts +0 -1
- package/dist/src/tui/tui-empty-session-cleanup.js +1 -11
- package/dist/src/tui/tui-new-session-preferences.d.ts +10 -0
- package/dist/src/tui/tui-new-session-preferences.js +32 -0
- package/dist/src/tui/tui-session-actions.d.ts +1 -0
- package/dist/src/tui/tui-session-actions.js +2 -1
- package/dist/src/tui/tui-settings.d.ts +2 -0
- package/dist/src/tui/tui-settings.js +4 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui-types.d.ts +1 -0
- package/dist/src/tui/tui.js +58 -5
- package/dist/src/tunnel/frpc-process.js +3 -0
- package/dist/src/tunnel/tunnel-service.d.ts +2 -0
- package/dist/src/tunnel/tunnel-service.js +40 -28
- package/dist/src/user-context/context-objects.d.ts +17 -0
- package/dist/src/user-context/context-objects.js +99 -0
- package/dist/src/user-context/domain.d.ts +13 -1
- package/dist/src/user-context/evaluation/harness.d.ts +13 -0
- package/dist/src/user-context/evaluation/harness.js +31 -0
- package/dist/src/user-context/extraction/registry.d.ts +26 -0
- package/dist/src/user-context/extraction/registry.js +113 -0
- package/dist/src/user-context/extraction/repair.d.ts +19 -0
- package/dist/src/user-context/extraction/repair.js +68 -0
- package/dist/src/user-context/planner.js +214 -57
- package/dist/src/user-context/retriever.js +69 -9
- package/dist/src/user-context/sources/index.js +2 -2
- package/dist/src/user-context/sources/processing-policy.d.ts +2 -0
- package/dist/src/user-context/sources/processing-policy.js +7 -0
- package/dist/src/user-context/sources/repository.d.ts +23 -4
- package/dist/src/user-context/sources/repository.js +122 -12
- package/dist/src/user-context/sources/types.d.ts +10 -1
- package/dist/src/user-context/understanding.js +1 -1
- package/dist/src/work-discovery/service.js +21 -5
- package/dist/src/work-discovery/source-repository.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agents-Dj86bHkl.js +0 -68
- package/dist/gateway/static/root/assets/app-management-settings-panel-D-M6GN-8.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-XDhmzdIc.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-sfO835uz.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-PptuZgoo.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-BoCmzMFV.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DhkJsU8Z.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Dm7T61fE.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-dG6UFVqt.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DgJxfNyK.js +0 -1
- package/dist/gateway/static/root/assets/chat-terminal-dock-CT5yoSMD.js +0 -36
- package/dist/gateway/static/root/assets/connectors-page-BC6Ft9SU.js +0 -2
- package/dist/gateway/static/root/assets/dependency-picker-DZVSgLXH.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Bw4cCFzI.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-Cbst7IXR.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-C1PAKSy2.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-api-Bch9vO6t.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-DkDxZFGG.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DXNMxy5b.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CYcpVFNT.js +0 -1
- package/dist/gateway/static/root/assets/index-Dgb1R07E.css +0 -2
- package/dist/gateway/static/root/assets/index-DlOYwVFK.js +0 -108
- package/dist/gateway/static/root/assets/local-app-workbench-page-BFrgPwGE.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-CPweLw3k.js +0 -2
- package/dist/gateway/static/root/assets/messages-B9WQcZ1V.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-wieRAd1y.js +0 -4
- package/dist/gateway/static/root/assets/page-tabs-Bsluqyfb.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-BrpTWv44.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-Cww6V7HJ.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D0LKhCCw.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Sf4Pde6Z.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-S5gvgfu5.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-B3XvdEy8.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-CiGFtdD8.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CGU_Mxjr.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-k0UQ8WxO.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DQ1GvL1w.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-OuHd9GcN.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-CERqCsz2.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-BnRNL2sn.js +0 -1
- package/dist/gateway/static/root/assets/typed-models-lib-abEJNkCO.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Cnkaiky5.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-B_VlcKiK.js +0 -5
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
UPDATE understanding_source_grants
|
|
2
|
+
SET processing_policy = 'local_only'
|
|
3
|
+
WHERE adapter_id = 'local-work-folders'
|
|
4
|
+
OR source_key LIKE 'understanding-source:%';
|
|
5
|
+
|
|
6
|
+
CREATE TABLE user_focuses_v126 (
|
|
7
|
+
focus_id TEXT PRIMARY KEY,
|
|
8
|
+
principal_id TEXT NOT NULL DEFAULT 'local-owner',
|
|
9
|
+
canonical_key TEXT NOT NULL UNIQUE,
|
|
10
|
+
title TEXT NOT NULL,
|
|
11
|
+
summary TEXT NOT NULL,
|
|
12
|
+
horizon TEXT NOT NULL CHECK (horizon IN ('current', 'ongoing', 'long_term')),
|
|
13
|
+
status TEXT NOT NULL CHECK (status IN ('candidate', 'active', 'paused', 'completed', 'rejected')),
|
|
14
|
+
confidence REAL NOT NULL CHECK (confidence >= 0 AND confidence <= 1),
|
|
15
|
+
scope_type TEXT NOT NULL CHECK (scope_type IN ('global', 'workspace', 'project', 'session')),
|
|
16
|
+
scope_id TEXT,
|
|
17
|
+
explicitness TEXT NOT NULL CHECK (explicitness IN ('explicit', 'observed', 'inferred')),
|
|
18
|
+
sensitivity TEXT NOT NULL CHECK (sensitivity IN ('normal', 'personal', 'secret', 'regulated')),
|
|
19
|
+
disclosure_policy TEXT NOT NULL CHECK (disclosure_policy IN ('silent', 'referenceable', 'ask_before_reference')),
|
|
20
|
+
valid_from INTEGER,
|
|
21
|
+
valid_to INTEGER,
|
|
22
|
+
review_at INTEGER,
|
|
23
|
+
evidence_refs_json TEXT NOT NULL DEFAULT '[]',
|
|
24
|
+
source_run_id TEXT,
|
|
25
|
+
created_at INTEGER NOT NULL,
|
|
26
|
+
updated_at INTEGER NOT NULL,
|
|
27
|
+
FOREIGN KEY (source_run_id) REFERENCES understanding_source_runs(run_id) ON DELETE SET NULL,
|
|
28
|
+
CHECK ((scope_type = 'global' AND scope_id IS NULL) OR (scope_type <> 'global' AND scope_id IS NOT NULL))
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
INSERT INTO user_focuses_v126 (
|
|
32
|
+
focus_id, principal_id, canonical_key, title, summary, horizon, status, confidence,
|
|
33
|
+
scope_type, scope_id, explicitness, sensitivity, disclosure_policy,
|
|
34
|
+
evidence_refs_json, source_run_id, created_at, updated_at
|
|
35
|
+
)
|
|
36
|
+
SELECT
|
|
37
|
+
focus_id, 'local-owner', canonical_key, title, summary, horizon, status, confidence,
|
|
38
|
+
CASE WHEN project_id IS NULL THEN 'global' ELSE 'project' END,
|
|
39
|
+
project_id,
|
|
40
|
+
CASE WHEN status = 'candidate' THEN 'inferred' ELSE 'explicit' END,
|
|
41
|
+
'normal', 'referenceable', evidence_refs_json, source_run_id, created_at, updated_at
|
|
42
|
+
FROM user_focuses;
|
|
43
|
+
|
|
44
|
+
DROP TABLE user_focuses;
|
|
45
|
+
ALTER TABLE user_focuses_v126 RENAME TO user_focuses;
|
|
46
|
+
|
|
47
|
+
CREATE INDEX idx_user_focuses_status
|
|
48
|
+
ON user_focuses(principal_id, status, horizon, updated_at DESC);
|
|
49
|
+
CREATE INDEX idx_user_focuses_scope
|
|
50
|
+
ON user_focuses(principal_id, scope_type, scope_id, status);
|
|
51
|
+
|
|
52
|
+
CREATE TABLE context_run_items_v126 (
|
|
53
|
+
context_run_id TEXT NOT NULL REFERENCES context_runs(context_run_id) ON DELETE CASCADE,
|
|
54
|
+
object_type TEXT NOT NULL CHECK (object_type IN ('profile', 'rule', 'focus', 'understanding')),
|
|
55
|
+
object_id TEXT NOT NULL,
|
|
56
|
+
version_id TEXT,
|
|
57
|
+
decision TEXT NOT NULL CHECK (decision IN (
|
|
58
|
+
'selected', 'irrelevant', 'expired', 'scope_mismatch', 'sensitive',
|
|
59
|
+
'needs_consent', 'budget_exceeded', 'conflicted', 'disabled'
|
|
60
|
+
)),
|
|
61
|
+
reason TEXT NOT NULL,
|
|
62
|
+
content_snapshot TEXT NOT NULL,
|
|
63
|
+
source_label TEXT NOT NULL,
|
|
64
|
+
rank INTEGER,
|
|
65
|
+
score REAL,
|
|
66
|
+
injected_chars INTEGER NOT NULL DEFAULT 0,
|
|
67
|
+
PRIMARY KEY (context_run_id, object_type, object_id)
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
INSERT INTO context_run_items_v126 SELECT * FROM context_run_items;
|
|
71
|
+
DROP TABLE context_run_items;
|
|
72
|
+
ALTER TABLE context_run_items_v126 RENAME TO context_run_items;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
ALTER TABLE context_run_items ADD COLUMN origin TEXT NOT NULL DEFAULT 'inferred'
|
|
2
|
+
CHECK (origin IN ('told_by_user', 'observed', 'inferred', 'connected_source'));
|
|
3
|
+
|
|
4
|
+
UPDATE context_run_items SET origin = 'told_by_user' WHERE object_type IN ('profile', 'rule');
|
|
5
|
+
UPDATE context_run_items SET origin = 'told_by_user'
|
|
6
|
+
WHERE object_type = 'understanding' AND source_label = 'You told xopc';
|
|
7
|
+
UPDATE context_run_items SET origin = 'observed'
|
|
8
|
+
WHERE object_type = 'understanding' AND source_label = 'Observed across prior work';
|
|
9
|
+
|
|
10
|
+
CREATE TABLE session_config_next (
|
|
11
|
+
session_key TEXT PRIMARY KEY,
|
|
12
|
+
thinking_level TEXT,
|
|
13
|
+
reasoning_level TEXT,
|
|
14
|
+
verbose_level TEXT,
|
|
15
|
+
elevated_mode TEXT,
|
|
16
|
+
model_override TEXT,
|
|
17
|
+
provider_override TEXT,
|
|
18
|
+
working_directory_override TEXT,
|
|
19
|
+
response_language TEXT,
|
|
20
|
+
user_context_mode TEXT CHECK (user_context_mode IN ('enabled', 'off', 'temporary')),
|
|
21
|
+
updated_at INTEGER NOT NULL,
|
|
22
|
+
FOREIGN KEY (session_key) REFERENCES sessions(session_key) ON DELETE CASCADE
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
INSERT INTO session_config_next (
|
|
26
|
+
session_key, thinking_level, reasoning_level, verbose_level, elevated_mode,
|
|
27
|
+
model_override, provider_override, working_directory_override, response_language,
|
|
28
|
+
user_context_mode, updated_at
|
|
29
|
+
)
|
|
30
|
+
SELECT session_key, thinking_level, reasoning_level, verbose_level, elevated_mode,
|
|
31
|
+
model_override, provider_override, working_directory_override, response_language,
|
|
32
|
+
user_context_mode, updated_at
|
|
33
|
+
FROM session_config;
|
|
34
|
+
|
|
35
|
+
DROP TABLE session_config;
|
|
36
|
+
ALTER TABLE session_config_next RENAME TO session_config;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
CREATE TABLE context_extraction_runs (
|
|
2
|
+
extraction_run_id TEXT PRIMARY KEY,
|
|
3
|
+
principal_id TEXT NOT NULL,
|
|
4
|
+
source_ref TEXT NOT NULL,
|
|
5
|
+
extractor_id TEXT NOT NULL,
|
|
6
|
+
extractor_version TEXT NOT NULL,
|
|
7
|
+
processing_policy TEXT NOT NULL CHECK (processing_policy IN ('local_only', 'remote_allowed')),
|
|
8
|
+
destination TEXT NOT NULL CHECK (destination IN ('deterministic', 'local_model', 'remote_model')),
|
|
9
|
+
input_hash TEXT NOT NULL,
|
|
10
|
+
status TEXT NOT NULL CHECK (status IN ('running', 'completed', 'skipped', 'failed')),
|
|
11
|
+
error_code TEXT,
|
|
12
|
+
started_at INTEGER NOT NULL,
|
|
13
|
+
completed_at INTEGER,
|
|
14
|
+
UNIQUE (principal_id, source_ref, extractor_id, extractor_version)
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
CREATE INDEX idx_context_extraction_runs_lookup
|
|
18
|
+
ON context_extraction_runs(extractor_id, status, started_at DESC);
|
|
19
|
+
|
|
20
|
+
CREATE TABLE context_extraction_outputs (
|
|
21
|
+
output_id TEXT PRIMARY KEY,
|
|
22
|
+
extraction_run_id TEXT NOT NULL REFERENCES context_extraction_runs(extraction_run_id) ON DELETE CASCADE,
|
|
23
|
+
ordinal INTEGER NOT NULL,
|
|
24
|
+
candidate_key TEXT NOT NULL,
|
|
25
|
+
object_type TEXT CHECK (object_type IN ('profile', 'rule', 'focus', 'understanding')),
|
|
26
|
+
object_id TEXT,
|
|
27
|
+
version_id TEXT,
|
|
28
|
+
outcome TEXT NOT NULL CHECK (outcome IN ('created', 'deduplicated', 'rejected')),
|
|
29
|
+
created_at INTEGER NOT NULL,
|
|
30
|
+
UNIQUE (extraction_run_id, ordinal)
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
CREATE INDEX idx_context_extraction_outputs_object
|
|
34
|
+
ON context_extraction_outputs(object_type, object_id);
|
|
35
|
+
|
|
36
|
+
CREATE TABLE context_object_relations (
|
|
37
|
+
relation_id TEXT PRIMARY KEY,
|
|
38
|
+
subject_type TEXT NOT NULL CHECK (subject_type IN ('profile', 'rule', 'focus', 'understanding')),
|
|
39
|
+
subject_id TEXT NOT NULL,
|
|
40
|
+
subject_version_id TEXT,
|
|
41
|
+
predicate TEXT NOT NULL CHECK (predicate IN ('supersedes', 'supports', 'contradicts', 'related_to')),
|
|
42
|
+
object_type TEXT NOT NULL CHECK (object_type IN ('profile', 'rule', 'focus', 'understanding')),
|
|
43
|
+
object_id TEXT NOT NULL,
|
|
44
|
+
object_version_id TEXT,
|
|
45
|
+
factual INTEGER NOT NULL DEFAULT 1 CHECK (factual IN (0, 1)),
|
|
46
|
+
extraction_run_id TEXT REFERENCES context_extraction_runs(extraction_run_id) ON DELETE SET NULL,
|
|
47
|
+
created_at INTEGER NOT NULL
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
CREATE UNIQUE INDEX idx_context_object_relations_unique
|
|
51
|
+
ON context_object_relations(
|
|
52
|
+
subject_type, subject_id, COALESCE(subject_version_id, ''), predicate,
|
|
53
|
+
object_type, object_id, COALESCE(object_version_id, '')
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
CREATE TABLE context_temporal_assertions (
|
|
57
|
+
assertion_id TEXT PRIMARY KEY,
|
|
58
|
+
object_type TEXT NOT NULL CHECK (object_type IN ('focus', 'understanding')),
|
|
59
|
+
object_id TEXT NOT NULL,
|
|
60
|
+
object_version_id TEXT,
|
|
61
|
+
assertion_type TEXT NOT NULL CHECK (assertion_type IN ('current_state', 'routine', 'relationship', 'project_status')),
|
|
62
|
+
value_json TEXT NOT NULL,
|
|
63
|
+
confidence REAL NOT NULL CHECK (confidence >= 0 AND confidence <= 1),
|
|
64
|
+
valid_from INTEGER,
|
|
65
|
+
valid_to INTEGER,
|
|
66
|
+
status TEXT NOT NULL CHECK (status IN ('candidate', 'active', 'closed', 'rejected')),
|
|
67
|
+
extraction_run_id TEXT REFERENCES context_extraction_runs(extraction_run_id) ON DELETE SET NULL,
|
|
68
|
+
created_at INTEGER NOT NULL,
|
|
69
|
+
updated_at INTEGER NOT NULL
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
CREATE INDEX idx_context_temporal_assertions_active
|
|
73
|
+
ON context_temporal_assertions(object_type, object_id, assertion_type, status);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
ALTER TABLE user_focuses ADD COLUMN current_version_id TEXT;
|
|
2
|
+
|
|
3
|
+
CREATE TABLE user_focus_versions (
|
|
4
|
+
version_id TEXT PRIMARY KEY,
|
|
5
|
+
focus_id TEXT NOT NULL REFERENCES user_focuses(focus_id) ON DELETE CASCADE,
|
|
6
|
+
title TEXT NOT NULL,
|
|
7
|
+
summary TEXT NOT NULL,
|
|
8
|
+
snapshot_json TEXT NOT NULL,
|
|
9
|
+
created_by TEXT NOT NULL CHECK (created_by IN ('user', 'runtime', 'connector')),
|
|
10
|
+
change_reason TEXT NOT NULL,
|
|
11
|
+
created_at INTEGER NOT NULL
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
INSERT INTO user_focus_versions (
|
|
15
|
+
version_id, focus_id, title, summary, snapshot_json, created_by, change_reason, created_at
|
|
16
|
+
)
|
|
17
|
+
SELECT
|
|
18
|
+
lower(hex(randomblob(16))), focus_id, title, summary,
|
|
19
|
+
json_object(
|
|
20
|
+
'horizon', horizon, 'status', status, 'confidence', confidence,
|
|
21
|
+
'scopeType', scope_type, 'scopeId', scope_id, 'explicitness', explicitness,
|
|
22
|
+
'sensitivity', sensitivity, 'disclosurePolicy', disclosure_policy,
|
|
23
|
+
'validFrom', valid_from, 'validTo', valid_to, 'reviewAt', review_at,
|
|
24
|
+
'evidenceRefs', json(evidence_refs_json)
|
|
25
|
+
),
|
|
26
|
+
CASE WHEN explicitness = 'explicit' THEN 'user' ELSE 'runtime' END,
|
|
27
|
+
'Migrated existing focus', created_at
|
|
28
|
+
FROM user_focuses;
|
|
29
|
+
|
|
30
|
+
UPDATE user_focuses
|
|
31
|
+
SET current_version_id = (
|
|
32
|
+
SELECT version_id FROM user_focus_versions v WHERE v.focus_id = user_focuses.focus_id LIMIT 1
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
CREATE INDEX idx_user_focus_versions_focus
|
|
36
|
+
ON user_focus_versions(focus_id, created_at DESC);
|
|
37
|
+
|
|
38
|
+
CREATE TABLE user_focus_evidence_links (
|
|
39
|
+
version_id TEXT NOT NULL REFERENCES user_focus_versions(version_id) ON DELETE CASCADE,
|
|
40
|
+
evidence_id TEXT NOT NULL REFERENCES context_evidence(evidence_id) ON DELETE CASCADE,
|
|
41
|
+
relation TEXT NOT NULL CHECK (relation IN ('supports', 'contradicts', 'supersedes')),
|
|
42
|
+
confidence REAL NOT NULL CHECK (confidence >= 0 AND confidence <= 1),
|
|
43
|
+
PRIMARY KEY (version_id, evidence_id, relation)
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
INSERT OR IGNORE INTO user_focus_evidence_links (version_id, evidence_id, relation, confidence)
|
|
47
|
+
SELECT f.current_version_id, e.evidence_id, 'supports', f.confidence
|
|
48
|
+
FROM user_focuses f
|
|
49
|
+
JOIN json_each(f.evidence_refs_json) refs
|
|
50
|
+
JOIN context_evidence e ON e.source_ref = refs.value
|
|
51
|
+
WHERE f.current_version_id IS NOT NULL;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
ALTER TABLE context_evidence ADD COLUMN source_run_id TEXT;
|
|
2
|
+
ALTER TABLE context_evidence ADD COLUMN source_item_id TEXT;
|
|
3
|
+
ALTER TABLE context_evidence ADD COLUMN session_id TEXT;
|
|
4
|
+
ALTER TABLE context_evidence ADD COLUMN turn_id TEXT;
|
|
5
|
+
ALTER TABLE context_evidence ADD COLUMN message_id TEXT;
|
|
6
|
+
ALTER TABLE context_evidence ADD COLUMN content_hash TEXT;
|
|
7
|
+
ALTER TABLE context_evidence ADD COLUMN retention_policy TEXT;
|
|
8
|
+
ALTER TABLE context_evidence ADD COLUMN processing_policy TEXT;
|
|
9
|
+
ALTER TABLE context_evidence ADD COLUMN extractor_id TEXT;
|
|
10
|
+
ALTER TABLE context_evidence ADD COLUMN extractor_version TEXT;
|
|
11
|
+
ALTER TABLE context_evidence ADD COLUMN ingested_at INTEGER;
|
|
12
|
+
|
|
13
|
+
UPDATE context_evidence SET ingested_at = created_at WHERE ingested_at IS NULL;
|
|
14
|
+
|
|
15
|
+
CREATE INDEX idx_context_evidence_run
|
|
16
|
+
ON context_evidence(source_run_id, observed_at DESC);
|
|
17
|
+
CREATE INDEX idx_context_evidence_message
|
|
18
|
+
ON context_evidence(session_id, turn_id, message_id);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
UPDATE transcript_entries AS entry
|
|
2
|
+
SET payload_json = json_set(
|
|
3
|
+
entry.payload_json,
|
|
4
|
+
'$.metadata.sourceContexts',
|
|
5
|
+
json((
|
|
6
|
+
SELECT input.context_refs_json
|
|
7
|
+
FROM session_inputs AS input
|
|
8
|
+
JOIN transcripts AS transcript
|
|
9
|
+
ON transcript.session_id = entry.session_id
|
|
10
|
+
AND transcript.session_key = input.session_key
|
|
11
|
+
WHERE input.run_id = json_extract(entry.payload_json, '$.turnId')
|
|
12
|
+
AND input.context_refs_json IS NOT NULL
|
|
13
|
+
AND json_valid(input.context_refs_json)
|
|
14
|
+
AND json_type(input.context_refs_json) = 'array'
|
|
15
|
+
LIMIT 1
|
|
16
|
+
))
|
|
17
|
+
)
|
|
18
|
+
WHERE entry.role = 'user'
|
|
19
|
+
AND json_type(entry.payload_json, '$.metadata.sourceContexts') IS NULL
|
|
20
|
+
AND (
|
|
21
|
+
json_type(entry.payload_json, '$.metadata') IS NULL
|
|
22
|
+
OR json_type(entry.payload_json, '$.metadata') = 'object'
|
|
23
|
+
)
|
|
24
|
+
AND EXISTS (
|
|
25
|
+
SELECT 1
|
|
26
|
+
FROM session_inputs AS input
|
|
27
|
+
JOIN transcripts AS transcript
|
|
28
|
+
ON transcript.session_id = entry.session_id
|
|
29
|
+
AND transcript.session_key = input.session_key
|
|
30
|
+
WHERE input.run_id = json_extract(entry.payload_json, '$.turnId')
|
|
31
|
+
AND input.context_refs_json IS NOT NULL
|
|
32
|
+
AND json_valid(input.context_refs_json)
|
|
33
|
+
AND json_type(input.context_refs_json) = 'array'
|
|
34
|
+
);
|
|
@@ -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 = 132;
|
|
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 = 132;
|
|
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 ?? 132;
|
|
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 ?? 132;
|
|
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 = 132;
|
|
23
23
|
|
|
24
24
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
25
25
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type TurnOrigin } from '@xopcai/endpoint-tools-protocol';
|
|
2
|
+
import type { AgentSourceContext, SourceContextRefSummary } from '../../agent/source-context/types.js';
|
|
2
3
|
export type SessionInputDelivery = 'next' | 'steer';
|
|
3
4
|
export type SessionInputStatus = 'queued' | 'running' | 'injecting' | 'completed' | 'cancelled' | 'failed' | 'interrupted';
|
|
4
5
|
export type SessionInput = {
|
|
@@ -10,6 +11,8 @@ export type SessionInput = {
|
|
|
10
11
|
status: SessionInputStatus;
|
|
11
12
|
content: string;
|
|
12
13
|
attachments?: unknown[];
|
|
14
|
+
contextRefs?: SourceContextRefSummary[];
|
|
15
|
+
contextSnapshots?: AgentSourceContext[];
|
|
13
16
|
thinking?: string;
|
|
14
17
|
origin: TurnOrigin;
|
|
15
18
|
position: number;
|
|
@@ -29,6 +32,7 @@ export type SessionInputState = {
|
|
|
29
32
|
};
|
|
30
33
|
export declare function getSessionInputState(sessionKey: string): SessionInputState;
|
|
31
34
|
export declare function findSessionInput(sessionKey: string, clientMessageId: string): SessionInput | undefined;
|
|
35
|
+
export declare function getSessionInputById(sessionKey: string, id: string): SessionInput | undefined;
|
|
32
36
|
export declare function insertSessionInput(input: {
|
|
33
37
|
id: string;
|
|
34
38
|
sessionKey: string;
|
|
@@ -38,6 +42,8 @@ export declare function insertSessionInput(input: {
|
|
|
38
42
|
status: 'queued' | 'injecting';
|
|
39
43
|
content: string;
|
|
40
44
|
attachments?: unknown[];
|
|
45
|
+
contextRefs?: SourceContextRefSummary[];
|
|
46
|
+
contextSnapshots?: AgentSourceContext[];
|
|
41
47
|
thinking?: string;
|
|
42
48
|
origin: TurnOrigin;
|
|
43
49
|
targetRunId?: string;
|
|
@@ -55,6 +61,8 @@ export declare function mutateQueuedSessionInput(input: {
|
|
|
55
61
|
version: number;
|
|
56
62
|
content?: string;
|
|
57
63
|
attachments?: unknown[];
|
|
64
|
+
contextRefs?: SourceContextRefSummary[];
|
|
65
|
+
contextSnapshots?: AgentSourceContext[];
|
|
58
66
|
thinking?: string;
|
|
59
67
|
position?: number;
|
|
60
68
|
}): boolean;
|
|
@@ -11,6 +11,8 @@ function mapInput(row) {
|
|
|
11
11
|
status: row.status,
|
|
12
12
|
content: row.content,
|
|
13
13
|
attachments: row.attachments_json ? JSON.parse(row.attachments_json) : void 0,
|
|
14
|
+
contextRefs: row.context_refs_json ? JSON.parse(row.context_refs_json) : void 0,
|
|
15
|
+
contextSnapshots: row.context_snapshots_json ? JSON.parse(row.context_snapshots_json) : void 0,
|
|
14
16
|
thinking: row.thinking ?? void 0,
|
|
15
17
|
position: row.position,
|
|
16
18
|
origin: turnOriginSchema.parse(JSON.parse(row.origin_json)),
|
|
@@ -23,7 +25,8 @@ function mapInput(row) {
|
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
27
|
const SELECT_INPUTS = `SELECT id, session_key, client_message_id, requested_delivery,
|
|
26
|
-
effective_delivery, status, content, attachments_json,
|
|
28
|
+
effective_delivery, status, content, attachments_json, context_refs_json, context_snapshots_json,
|
|
29
|
+
thinking, origin_json, position,
|
|
27
30
|
target_run_id, run_id, version, error, created_at_ms, updated_at_ms
|
|
28
31
|
FROM session_inputs`;
|
|
29
32
|
function ensureRuntime(db, sessionKey) {
|
|
@@ -47,13 +50,20 @@ function getSessionInputState(sessionKey) {
|
|
|
47
50
|
revision: runtime?.revision ?? 0,
|
|
48
51
|
activeRunId: runtime?.active_run_id ?? void 0,
|
|
49
52
|
activeInputId: runtime?.active_input_id ?? void 0,
|
|
50
|
-
inputs: rows.map(
|
|
53
|
+
inputs: rows.map((row) => {
|
|
54
|
+
const { contextSnapshots: _contextSnapshots, ...input } = mapInput(row);
|
|
55
|
+
return input;
|
|
56
|
+
})
|
|
51
57
|
};
|
|
52
58
|
}
|
|
53
59
|
function findSessionInput(sessionKey, clientMessageId) {
|
|
54
60
|
const row = getSqliteDatabase().prepare(`${SELECT_INPUTS} WHERE session_key = ? AND client_message_id = ?`).get(sessionKey, clientMessageId);
|
|
55
61
|
return row ? mapInput(row) : void 0;
|
|
56
62
|
}
|
|
63
|
+
function getSessionInputById(sessionKey, id) {
|
|
64
|
+
const row = getSqliteDatabase().prepare(`${SELECT_INPUTS} WHERE session_key = ? AND id = ?`).get(sessionKey, id);
|
|
65
|
+
return row ? mapInput(row) : void 0;
|
|
66
|
+
}
|
|
57
67
|
function insertSessionInput(input) {
|
|
58
68
|
return runSqliteWriteTransaction((db) => {
|
|
59
69
|
const existing = db.prepare(`${SELECT_INPUTS} WHERE session_key = ? AND client_message_id = ?`).get(input.sessionKey, input.clientMessageId);
|
|
@@ -63,8 +73,9 @@ function insertSessionInput(input) {
|
|
|
63
73
|
WHERE session_key = ? AND status IN ('queued','running','injecting','interrupted')`).get(input.sessionKey);
|
|
64
74
|
db.prepare(`INSERT INTO session_inputs(id, session_key, client_message_id,
|
|
65
75
|
requested_delivery, effective_delivery, status, content, attachments_json,
|
|
66
|
-
|
|
67
|
-
|
|
76
|
+
context_refs_json, context_snapshots_json, thinking, origin_json, position,
|
|
77
|
+
target_run_id, version, created_at_ms, updated_at_ms)
|
|
78
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?)`).run(input.id, input.sessionKey, input.clientMessageId, 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);
|
|
68
79
|
bumpRevision(db, input.sessionKey);
|
|
69
80
|
return mapInput(db.prepare(`${SELECT_INPUTS} WHERE id = ?`).get(input.id));
|
|
70
81
|
});
|
|
@@ -119,8 +130,9 @@ function mutateQueuedSessionInput(input) {
|
|
|
119
130
|
ordered.splice(Math.max(0, Math.min(input.position, ordered.length)), 0, row);
|
|
120
131
|
const stmt = db.prepare(`UPDATE session_inputs SET position = ?, version = version + 1, updated_at_ms = ? WHERE id = ?`);
|
|
121
132
|
ordered.forEach((item, index) => stmt.run(index + 1, now, item.id));
|
|
122
|
-
} else db.prepare(`UPDATE session_inputs SET content = ?, attachments_json = ?,
|
|
123
|
-
|
|
133
|
+
} else db.prepare(`UPDATE session_inputs SET content = ?, attachments_json = ?, context_refs_json = ?,
|
|
134
|
+
context_snapshots_json = ?, thinking = ?, version = version + 1,
|
|
135
|
+
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);
|
|
124
136
|
bumpRevision(db, input.sessionKey);
|
|
125
137
|
return true;
|
|
126
138
|
});
|
|
@@ -146,4 +158,4 @@ function recoverSessionInputState() {
|
|
|
146
158
|
});
|
|
147
159
|
}
|
|
148
160
|
//#endregion
|
|
149
|
-
export { cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, finishSessionInputRun, getSessionInputState, insertSessionInput, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus };
|
|
161
|
+
export { cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, finishSessionInputRun, getSessionInputById, getSessionInputState, insertSessionInput, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { AgentMessage } from '@earendil-works/pi-agent-core';
|
|
2
2
|
import type { TurnOrigin } from '@xopcai/endpoint-tools-protocol';
|
|
3
|
+
import type { AgentSourceContext, SourceContextRefSummary } from '../../agent/source-context/types.js';
|
|
3
4
|
export type ReplaceLatestSessionTurnInput = {
|
|
4
5
|
sessionKey: string;
|
|
5
6
|
targetTurnId: string;
|
|
6
7
|
clientMessageId: string;
|
|
7
8
|
content: string;
|
|
8
9
|
attachments?: unknown[];
|
|
10
|
+
contextRefs?: SourceContextRefSummary[];
|
|
11
|
+
contextSnapshots?: AgentSourceContext[];
|
|
9
12
|
thinking?: string;
|
|
10
13
|
origin: TurnOrigin;
|
|
11
14
|
};
|
|
@@ -93,8 +93,9 @@ function replaceLatestSessionTurnAndQueueInput(input) {
|
|
|
93
93
|
const inputId = randomUUID();
|
|
94
94
|
db.prepare(`INSERT INTO session_inputs(id, session_key, client_message_id,
|
|
95
95
|
requested_delivery, effective_delivery, status, content, attachments_json,
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
context_refs_json, context_snapshots_json, thinking, origin_json, position,
|
|
97
|
+
target_run_id, version, created_at_ms, updated_at_ms)
|
|
98
|
+
VALUES (?, ?, ?, 'next', 'next', 'queued', ?, ?, ?, ?, ?, ?, ?, NULL, 1, ?, ?)`).run(inputId, input.sessionKey, input.clientMessageId, 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), maxPosition.value + 1, now, now);
|
|
98
99
|
db.prepare(`UPDATE session_input_runtime SET revision = revision + 1, updated_at_ms = ?
|
|
99
100
|
WHERE session_key = ?`).run(now, input.sessionKey);
|
|
100
101
|
return {
|
|
@@ -33,20 +33,46 @@ function isUserMessageRow(row) {
|
|
|
33
33
|
const classified = classifyStoredRow(row);
|
|
34
34
|
return classified.entryKind === "message" && classified.role === "user";
|
|
35
35
|
}
|
|
36
|
+
function withSessionInputContextMetadata(db, sessionKey, row) {
|
|
37
|
+
if (!isUserMessageRow(row)) return row;
|
|
38
|
+
const message = row;
|
|
39
|
+
const turnId = typeof message.turnId === "string" ? message.turnId.trim() : "";
|
|
40
|
+
if (!turnId) return row;
|
|
41
|
+
const metadata = message.metadata && typeof message.metadata === "object" && !Array.isArray(message.metadata) ? message.metadata : {};
|
|
42
|
+
if (Array.isArray(metadata.sourceContexts) && metadata.sourceContexts.length > 0) return row;
|
|
43
|
+
const input = db.prepare(`SELECT context_refs_json FROM session_inputs
|
|
44
|
+
WHERE session_key = ? AND run_id = ? AND context_refs_json IS NOT NULL
|
|
45
|
+
LIMIT 1`).get(sessionKey, turnId);
|
|
46
|
+
if (!input) return row;
|
|
47
|
+
try {
|
|
48
|
+
const sourceContexts = JSON.parse(input.context_refs_json);
|
|
49
|
+
if (!Array.isArray(sourceContexts) || sourceContexts.length === 0) return row;
|
|
50
|
+
return {
|
|
51
|
+
...message,
|
|
52
|
+
metadata: {
|
|
53
|
+
...metadata,
|
|
54
|
+
sourceContexts
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
} catch {
|
|
58
|
+
return row;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
36
61
|
function appendTranscriptEntry(sessionKey, row, opts) {
|
|
37
62
|
if (isRuntimeOnlyTranscriptMessage(row)) throw new Error("Runtime-only messages cannot be persisted in a session transcript");
|
|
38
63
|
return runSqliteWriteTransaction((db) => {
|
|
39
64
|
const sessionId = opts?.sessionId ?? readCurrentSessionId(db, sessionKey);
|
|
40
65
|
if (!sessionId) throw new Error(`Session not found: ${sessionKey}`);
|
|
66
|
+
const persistedRow = withSessionInputContextMetadata(db, sessionKey, row);
|
|
41
67
|
const inserted = insertEntry(db, {
|
|
42
68
|
sessionId,
|
|
43
69
|
sessionKey,
|
|
44
|
-
row
|
|
70
|
+
row: persistedRow
|
|
45
71
|
});
|
|
46
|
-
if (classifyStoredRow(
|
|
72
|
+
if (classifyStoredRow(persistedRow).entryKind === "message") {
|
|
47
73
|
const tokenDelta = opts?.tokenDelta ?? 0;
|
|
48
74
|
const now = Date.now();
|
|
49
|
-
const hiddenUpdate = isUserMessageRow(
|
|
75
|
+
const hiddenUpdate = isUserMessageRow(persistedRow) ? `hidden_from_session_list = 0,` : "";
|
|
50
76
|
db.prepare(`UPDATE sessions SET
|
|
51
77
|
message_count = message_count + 1,
|
|
52
78
|
estimated_tokens = estimated_tokens + ?,
|
|
@@ -25,6 +25,7 @@ export declare function setUnderstandingStatus(id: string, status: Understanding
|
|
|
25
25
|
explicitness: UserUnderstanding['explicitness'];
|
|
26
26
|
confidence: number;
|
|
27
27
|
}): UserUnderstanding;
|
|
28
|
+
export declare function closeUnderstandingValidity(id: string, validTo?: number): UserUnderstanding;
|
|
28
29
|
export declare function rejectUnderstanding(id: string, reason: string): UserUnderstanding;
|
|
29
30
|
export declare function deleteUnderstanding(id: string): boolean;
|
|
30
31
|
export declare function isUnderstandingSuppressed(canonicalKey: string, scope: UserContextScope, principalId?: string): boolean;
|
|
@@ -34,7 +35,9 @@ export declare function listCollaborationRules(principalId?: string): Collaborat
|
|
|
34
35
|
export declare function reviseCollaborationRule(id: string, statement: string): CollaborationRule;
|
|
35
36
|
export declare function setCollaborationRuleStatus(id: string, status: CollaborationRule['status']): CollaborationRule;
|
|
36
37
|
export declare function deleteCollaborationRule(id: string): boolean;
|
|
37
|
-
export declare function createContextEvidence(input: Omit<ContextEvidence, 'id' | 'createdAt'
|
|
38
|
+
export declare function createContextEvidence(input: Omit<ContextEvidence, 'id' | 'ingestedAt' | 'createdAt'> & {
|
|
39
|
+
ingestedAt?: number;
|
|
40
|
+
}, principalId?: string): ContextEvidence;
|
|
38
41
|
export declare function linkUnderstandingEvidence(versionId: string, evidenceId: string, relation: 'supports' | 'contradicts' | 'supersedes', confidence: number): void;
|
|
39
42
|
export declare function listUnderstandingEvidence(understandingId: string, relation?: 'supports' | 'contradicts' | 'supersedes'): ContextEvidence[];
|
|
40
43
|
export declare function recordContextRun(input: {
|