@xopcai/xopc 0.0.286 → 0.0.291
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/README.md +16 -0
- package/README.zh-CN.md +16 -0
- package/dist/browser-ext/dist/assets/{auth-BXCWrPlg.js → auth-B2CDTr_F.js} +2 -1
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +36 -10
- 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-xOhV8FHx.js → activity-store-6lmzUBEr.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BzQbYWEj.js → agent-avatar-dicebear-BCtrkF15.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D2eYNelh.js +1 -0
- package/dist/gateway/static/root/assets/agents-BedA5XwI.js +1 -0
- package/dist/gateway/static/root/assets/{api-CVJQLBv9.js → api-D6yepxBp.js} +1 -1
- package/dist/gateway/static/root/assets/api-Dnfnl1Gd.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CTyuXkNC.js → app-management-settings-panel-Md562Fo-.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Tk-GJtvF.js → appearance-settings-BiBFI4BM.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-BA-7OrhJ.js → apps-page-Corla83b.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-O49jeeXo.js → archive-plugin-A_Unp751.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-r9lBF2tW.js → attachment-load-D6idSUyP.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CFFLXYgS.js → automations-page-C6j71Lgs.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-DjZdhLQ5.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BpM43vsn.js → binary-plugins-BkKYh-8v.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DFrfEcGw.js → block-editor-CDcMvaku.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-CyHGQwxQ.js → browser-automation-inputs-Cq4sIJt2.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CPkOWfM9.js → browser-automations-page-C64k4TBH.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-settings-page-BOcseZxg.js → browser-settings-page-1k5rj_qR.js} +3 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B2NvoTYb.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-DExixzp4.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-BArPeImO.js → channels-status-swr-CVzEYBpX.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-D5Aka4S8.js → chat-terminal-dock-B9eKFkbg.js} +2 -2
- package/dist/gateway/static/root/assets/computer-model-settings-DW6j2lsn.js +1 -0
- package/dist/gateway/static/root/assets/computer-settings-page-C2Qyw63Q.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-C3ubZz7K.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-DNtRu6EB.js → date-picker-BdxjXVKL.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-Dng3dIQa.js → dependency-picker-CXOa4uh4.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BicYycxy.js → desktop-pet-CBWiAaSv.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BEse55eX.js → desktop-pet-settings-BX1aILDK.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-be30HuFI.js → device-pairing-wizard-bqm_Yf4i.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-YzhYyuay.js → extension-debug-page-B4MMerja.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CEXVIkDl.js → extension-page-B3ZtINak.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CrlbgK8g.js → extension-settings-page-8BkQVh0z.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BNuoHXiZ.js → gateway-config-swr-BBovMBQ1.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-ZyhacQX5.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-zMPfje0n.js → gateway-startup-retry-NXDtzZED.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BtxitqZ3.js → heartbeat-settings-Bllcxm2A.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Cv2e8XBR.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-B_Tyx74A.js → image-generation-api-D01ieqGC.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-eZciuLw_.js → imports-page-DJG1BJzd.js} +1 -1
- package/dist/gateway/static/root/assets/index-B7EieIE4.js +75 -0
- package/dist/gateway/static/root/assets/index-BD5uNzie.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B796W039.js → keyboard-shortcuts-settings-6A6JOHTI.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Cipj52Zq.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DXmY5jwM.js → local-apps-page-bD-m7YHJ.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-D0001I7p.js → locale-store-eliqUnBr.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-D5feO2yw.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-b1MG7s-3.js → management-settings-B7mz0_44.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-2txE_Blz.js → markdown-view-BIg7cei7.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CDEf3ksI.js → media-plugins-DQ2HfMeG.js} +1 -1
- package/dist/gateway/static/root/assets/messages-NYDOR8-j.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-DhYJigb3.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-Bg5NPUdf.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-Bi_-DA5J.js → page-tabs-DmG_Qjl8.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Dhfdf14p.js → preview-open-alternatives-Y9J1kjKC.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-BNouL7Tv.js → proactive-page-Duc_NQ8l.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BkbZBqBr.js → product-open-page-DtgWUAwT.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DVOiucVA.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Dr_kDoCJ.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-icwoEKYB.js → registry-api-Dpm3N2h0.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-hyJ2KKKK.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-bmgxwWpW.js → runtime-tools-settings-panel-DB7J9opJ.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DoZeepCg.js → schema-form-CMYuPOlE.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DGsnYcoh.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DuzZqQMn.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-sw2bbS2b.js → settings-form-section-BayJP08a.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BWF8uac0.js → settings-page-CWBqZtt6.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-C97S5g5c.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BIHYD6-O.js → share-preview-page-Wn5bQA-5.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-pfVzP8F7.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DDJ0ZKx3.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DbDpLjDW.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-dvue6Ish.js → skills-page.utils-DCHY_kou.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DCyxPWCl.js → system-settings-panel-DhgITgId.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-UqwtiHYu.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-CZwYGpbY.js → theme-store-DUHPzKzv.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-__auf8Ww.js → tunnel-api-DJ3gz2tM.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-Iq83UDt3.js → use-autosave-htvgT192.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-xOsXY_2W.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-D-QssKik.js → voice-api-key-field-BviJF3Oa.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-B0wNN_tE.js → voice-config-api-Bjy8EFqi.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-5NRYg1iI.js → work-discovery-overlay-BOBVNEYZ.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Ds2SZjLG.js → workflow-run-setup-panel-D1N9uUyM.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-2ylzlgkG.js +6 -0
- package/dist/gateway/static/root/index.html +10 -10
- package/dist/package.js +1 -1
- package/dist/packages/computer-control-contract/src/index.js +178 -0
- package/dist/packages/realtime-protocol/src/voice-audio.js +15 -10
- package/dist/packages/realtime-protocol/src/voice-catalog.js +61 -0
- package/dist/packages/realtime-protocol/src/voice.js +257 -248
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +5 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- 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/embedded/run-turn.js +9 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +4 -2
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/index.js +25 -15
- package/dist/src/agent/skills/parse-skill-metadata.d.ts +5 -1
- package/dist/src/agent/skills/parse-skill-metadata.js +21 -1
- package/dist/src/agent/skills/types.d.ts +7 -0
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -0
- package/dist/src/agent/tool-manuals/computer.js +19 -0
- package/dist/src/agent/tool-manuals/index.js +7 -0
- package/dist/src/agent/tools/computer-use-tool.d.ts +11 -0
- package/dist/src/agent/tools/computer-use-tool.js +86 -0
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +30 -0
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/resolver.js +5 -0
- package/dist/src/agent-config/schema.d.ts +32 -0
- package/dist/src/agent-config/schema.js +5 -2
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/readiness/from-config.js +14 -2
- package/dist/src/capabilities/readiness/planner.js +3 -2
- package/dist/src/capabilities/readiness/types.d.ts +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +3 -3
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/computer/broker.d.ts +97 -0
- package/dist/src/computer/broker.js +337 -0
- package/dist/src/computer/config.d.ts +9 -0
- package/dist/src/computer/config.js +16 -0
- package/dist/src/computer/control-guard.d.ts +4 -0
- package/dist/src/computer/control-guard.js +17 -0
- package/dist/src/computer/errors.d.ts +7 -0
- package/dist/src/computer/errors.js +30 -0
- package/dist/src/computer/model-adapter.d.ts +44 -0
- package/dist/src/computer/model-adapter.js +273 -0
- package/dist/src/computer/model-config.d.ts +3 -0
- package/dist/src/computer/model-config.js +27 -0
- package/dist/src/computer/model-policy.d.ts +3 -0
- package/dist/src/computer/model-policy.js +20 -0
- package/dist/src/computer/runtime.d.ts +128 -0
- package/dist/src/computer/runtime.js +388 -0
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.d.ts +36 -0
- package/dist/src/config/models-json.js +15 -1
- package/dist/src/config/schema.d.ts +37 -0
- package/dist/src/config/schema.js +11 -2
- package/dist/src/config/voice.js +2 -2
- package/dist/src/endpoint-tools/invocation-service.d.ts +1 -0
- package/dist/src/endpoint-tools/invocation-service.js +5 -2
- package/dist/src/endpoint-tools/policy.js +7 -0
- package/dist/src/endpoint-tools/runtime.js +1 -0
- package/dist/src/endpoint-tools/upload-service.d.ts +13 -1
- package/dist/src/endpoint-tools/upload-service.js +73 -8
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +7 -1
- package/dist/src/gateway/agent-builtin-tools.js +7 -0
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +16 -0
- package/dist/src/gateway/hono/lib/config-payload.d.ts +15 -0
- package/dist/src/gateway/hono/lib/config-payload.js +2 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +13 -2
- package/dist/src/gateway/hono/routes/endpoint-tools.js +3 -2
- package/dist/src/gateway/hono/routes/models.js +6 -3
- package/dist/src/gateway/hono/routes/voice.js +55 -1
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/security/gateway-scopes.d.ts +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +3 -0
- package/dist/src/gateway/service/config-coordinator.js +4 -1
- package/dist/src/gateway/service.js +12 -12
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +11 -2
- package/dist/src/providers/model-catalog-store.js +1 -0
- package/dist/src/providers/model-catalog-types.d.ts +7 -2
- package/dist/src/providers/model-reference-auditor.js +6 -3
- package/dist/src/providers/model-registry.js +4 -1
- package/dist/src/providers/model-supplements.js +18 -2
- package/dist/src/providers/presentation.js +4 -2
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/providers/xopc-cloud-model-source.js +10 -4
- package/dist/src/storage/sqlite/index.d.ts +1 -1
- package/dist/src/storage/sqlite/index.js +2 -2
- package/dist/src/storage/sqlite/migrations/conversation-backup.d.ts +8 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.js +17 -7
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.js +5 -2
- package/dist/src/storage/sqlite/migrations/discover.js +2 -2
- package/dist/src/storage/sqlite/migrations/errors.d.ts +5 -0
- package/dist/src/storage/sqlite/migrations/errors.js +12 -2
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -2
- package/dist/src/storage/sqlite/schema.js +2 -2
- package/dist/src/storage/sqlite/schema.sql +2641 -526
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +2 -2
- package/dist/src/voice/platform-catalog.d.ts +81 -0
- package/dist/src/voice/platform-catalog.js +16 -0
- package/dist/src/voice/platform-settings.d.ts +4 -0
- package/dist/src/voice/platform-settings.js +120 -0
- package/dist/src/voice/platform-streams.d.ts +12 -0
- package/dist/src/voice/platform-streams.js +250 -0
- package/dist/src/voice/realtime/omniEngine.js +8 -5
- package/dist/src/voice/realtime/omniRoute.d.ts +1 -0
- package/dist/src/voice/realtime/omniRoute.js +11 -1
- package/dist/src/voice/realtime/runtime.js +14 -6
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +15 -8
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +12 -19
- package/dist/src/work-discovery/service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +7 -4
- package/skills/creative/algorithmic-art/SKILL.md +7 -0
- package/skills/creative/frontend-design/SKILL.md +8 -0
- package/skills/creative/hatch-pet/SKILL.md +7 -0
- package/skills/creative/theme-factory/SKILL.md +8 -0
- package/skills/documents/doc-coauthoring/SKILL.md +7 -0
- package/skills/documents/docx/SKILL.md +7 -0
- package/skills/documents/pdf/SKILL.md +7 -0
- package/skills/documents/pptx/SKILL.md +7 -0
- package/skills/documents/xlsx/SKILL.md +9 -1
- package/skills/engineering/build-xopc-local-app/SKILL.md +7 -0
- package/skills/engineering/define-task/SKILL.md +7 -0
- package/skills/engineering/diagnose/SKILL.md +8 -0
- package/skills/engineering/tdd/SKILL.md +8 -0
- package/skills/tools/find-skills/SKILL.md +8 -0
- package/skills/tools/github/SKILL.md +7 -0
- package/skills/tools/summarize/SKILL.md +8 -0
- package/skills/tools/webapp-testing/SKILL.md +8 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BxR5eog4.js +0 -1
- package/dist/gateway/static/root/assets/agents-Dx1om1eN.js +0 -1
- package/dist/gateway/static/root/assets/api-q1kIMCLW.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-DUZE1NOH.js +0 -6
- package/dist/gateway/static/root/assets/capabilities-settings-panel-ohEV64hG.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-UOf9mgqt.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BEQR0NRq.js +0 -2
- package/dist/gateway/static/root/assets/gateway-settings-CDJY1AOW.js +0 -1
- package/dist/gateway/static/root/assets/home-page-_oqo0pNR.js +0 -1
- package/dist/gateway/static/root/assets/index--YC42LAz.css +0 -2
- package/dist/gateway/static/root/assets/index-fVtuw2o9.js +0 -75
- package/dist/gateway/static/root/assets/local-app-workbench-page-Z8mpau9d.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-BGOO8ouT.js +0 -2
- package/dist/gateway/static/root/assets/messages-BWANv-N-.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-Bm33_3xJ.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-C32-xssK.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-CZ7glGYw.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DP3ZINZz.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-xqJcPdOO.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BaxIfjpm.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cy3Ab3Vg.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BuYto2mT.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DKtWUneq.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Dn7ElMUk.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-D-7UtJIc.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-efmH43Pq.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-DByIJcQq.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-BJv3eoKR.js +0 -6
- package/dist/src/storage/sqlite/migrations/002_add_flush_columns.sql +0 -3
- package/dist/src/storage/sqlite/migrations/003_add_note_markdown_meta.sql +0 -4
- package/dist/src/storage/sqlite/migrations/004_add_session_type_metadata.sql +0 -15
- package/dist/src/storage/sqlite/migrations/005_add_note_agent_contexts.sql +0 -10
- package/dist/src/storage/sqlite/migrations/006_add_goals.sql +0 -108
- package/dist/src/storage/sqlite/migrations/007_goal_run_judge_schema.sql +0 -4
- package/dist/src/storage/sqlite/migrations/008_goal_queue_workflow_runs.sql +0 -53
- package/dist/src/storage/sqlite/migrations/009_cron_jobs.sql +0 -24
- package/dist/src/storage/sqlite/migrations/010_session_id_identity.sql +0 -30
- package/dist/src/storage/sqlite/migrations/011_goal_context_messages.sql +0 -8
- package/dist/src/storage/sqlite/migrations/012_memory_records.sql +0 -63
- package/dist/src/storage/sqlite/migrations/013_memory_trace_events.sql +0 -21
- package/dist/src/storage/sqlite/migrations/014_memory_record_governance.sql +0 -10
- package/dist/src/storage/sqlite/migrations/015_memory_trace_feedback.sql +0 -4
- package/dist/src/storage/sqlite/migrations/016_automations.sql +0 -47
- package/dist/src/storage/sqlite/migrations/017_automation_run_events.sql +0 -14
- package/dist/src/storage/sqlite/migrations/018_automation_safety.sql +0 -1
- package/dist/src/storage/sqlite/migrations/019_projects.sql +0 -40
- package/dist/src/storage/sqlite/migrations/020_project_default_agent.sql +0 -1
- package/dist/src/storage/sqlite/migrations/021_projects_fts.sql +0 -21
- package/dist/src/storage/sqlite/migrations/022_work_items.sql +0 -61
- package/dist/src/storage/sqlite/migrations/023_work_item_attachments.sql +0 -15
- package/dist/src/storage/sqlite/migrations/024_activity_events.sql +0 -62
- package/dist/src/storage/sqlite/migrations/025_project_pinned_at.sql +0 -5
- package/dist/src/storage/sqlite/migrations/026_goal_contracts.sql +0 -10
- package/dist/src/storage/sqlite/migrations/027_mobile_notifications.sql +0 -43
- package/dist/src/storage/sqlite/migrations/028_goal_evidence_requirements.sql +0 -47
- package/dist/src/storage/sqlite/migrations/029_user_understanding.sql +0 -133
- package/dist/src/storage/sqlite/migrations/030_connectors.sql +0 -94
- package/dist/src/storage/sqlite/migrations/031_connector_approvals.sql +0 -24
- package/dist/src/storage/sqlite/migrations/032_connector_webhook_deliveries.sql +0 -15
- package/dist/src/storage/sqlite/migrations/033_user_trust_policies.sql +0 -6
- package/dist/src/storage/sqlite/migrations/034_allow_global_auto_trust.sql +0 -14
- package/dist/src/storage/sqlite/migrations/035_user_profile_prompt_state.sql +0 -7
- package/dist/src/storage/sqlite/migrations/036_goal_outcome_metric.sql +0 -12
- package/dist/src/storage/sqlite/migrations/037_connected_knowledge_pipeline.sql +0 -47
- package/dist/src/storage/sqlite/migrations/038_user_owned_memory.sql +0 -68
- package/dist/src/storage/sqlite/migrations/039_memory_reference_consents.sql +0 -19
- package/dist/src/storage/sqlite/migrations/040_local_apps.sql +0 -32
- package/dist/src/storage/sqlite/migrations/041_local_app_release_lifecycle.sql +0 -17
- package/dist/src/storage/sqlite/migrations/042_work_discovery.sql +0 -41
- package/dist/src/storage/sqlite/migrations/043_local_app_acceptance_runs.sql +0 -16
- package/dist/src/storage/sqlite/migrations/044_repair_work_discovery_foreign_keys.sql +0 -75
- package/dist/src/storage/sqlite/migrations/045_extension_ui_grants.sql +0 -13
- package/dist/src/storage/sqlite/migrations/046_work_discovery_feedback.sql +0 -13
- package/dist/src/storage/sqlite/migrations/047_work_discovery_sources.sql +0 -16
- package/dist/src/storage/sqlite/migrations/048_work_understanding_investigations.sql +0 -40
- package/dist/src/storage/sqlite/migrations/049_work_understanding_threads.sql +0 -52
- package/dist/src/storage/sqlite/migrations/050_work_discovery_source_refreshes.sql +0 -15
- package/dist/src/storage/sqlite/migrations/051_focus_watches.sql +0 -26
- package/dist/src/storage/sqlite/migrations/052_proactive_insights.sql +0 -25
- package/dist/src/storage/sqlite/migrations/053_browser_recipes.sql +0 -45
- package/dist/src/storage/sqlite/migrations/054_task_outcomes.sql +0 -24
- package/dist/src/storage/sqlite/migrations/055_relationship_settings.sql +0 -14
- package/dist/src/storage/sqlite/migrations/056_task_verification.sql +0 -6
- package/dist/src/storage/sqlite/migrations/057_interaction_states.sql +0 -11
- package/dist/src/storage/sqlite/migrations/058_proactive_value.sql +0 -3
- package/dist/src/storage/sqlite/migrations/059_composer_input_history.sql +0 -8
- package/dist/src/storage/sqlite/migrations/060_remove_runtime_transcript_messages.sql +0 -45
- package/dist/src/storage/sqlite/migrations/061_drop_compaction_checkpoints.sql +0 -2
- package/dist/src/storage/sqlite/migrations/062_connector_learning_jobs.sql +0 -27
- package/dist/src/storage/sqlite/migrations/063_knowledge_collection_scopes.sql +0 -14
- package/dist/src/storage/sqlite/migrations/064_user_claims.sql +0 -60
- package/dist/src/storage/sqlite/migrations/065_knowledge_item_scope_identity.sql +0 -116
- package/dist/src/storage/sqlite/migrations/066_first_class_focuses.sql +0 -126
- package/dist/src/storage/sqlite/migrations/067_home_attention_acknowledgements.sql +0 -9
- package/dist/src/storage/sqlite/migrations/068_proactive_event_spine.sql +0 -71
- package/dist/src/storage/sqlite/migrations/069_proactive_scenario_control.sql +0 -69
- package/dist/src/storage/sqlite/migrations/070_proactive_execution.sql +0 -55
- package/dist/src/storage/sqlite/migrations/071_proactive_inbox.sql +0 -45
- package/dist/src/storage/sqlite/migrations/072_proactive_judgments.sql +0 -14
- package/dist/src/storage/sqlite/migrations/073_enable_default_proactive_scenarios.sql +0 -13
- package/dist/src/storage/sqlite/migrations/074_deduplicate_blocked_work_routing.sql +0 -5
- package/dist/src/storage/sqlite/migrations/075_connector_sync_policies.sql +0 -13
- package/dist/src/storage/sqlite/migrations/076_meeting_preparation_scenario.sql +0 -29
- package/dist/src/storage/sqlite/migrations/077_proactive_insight_fingerprints.sql +0 -4
- package/dist/src/storage/sqlite/migrations/078_discussion_captures.sql +0 -64
- package/dist/src/storage/sqlite/migrations/079_discussion_follow_up_scenario.sql +0 -29
- package/dist/src/storage/sqlite/migrations/080_task_outcome_context.sql +0 -15
- package/dist/src/storage/sqlite/migrations/081_project_monitoring_policies.sql +0 -10
- package/dist/src/storage/sqlite/migrations/082_one_click_live_discussions.sql +0 -100
- package/dist/src/storage/sqlite/migrations/083_session_task_plans.sql +0 -9
- package/dist/src/storage/sqlite/migrations/084_work_intake_lifecycle.sql +0 -26
- package/dist/src/storage/sqlite/migrations/085_task_outcome_projection.sql +0 -19
- package/dist/src/storage/sqlite/migrations/086_outcome_aggregates.sql +0 -168
- package/dist/src/storage/sqlite/migrations/087_context_snapshots.sql +0 -21
- package/dist/src/storage/sqlite/migrations/088_automation_execution_deadlines.sql +0 -5
- package/dist/src/storage/sqlite/migrations/089_automation_run_leases.sql +0 -8
- package/dist/src/storage/sqlite/migrations/090_outcome_contract_judgment.sql +0 -2
- package/dist/src/storage/sqlite/migrations/091_context_allocation.sql +0 -1
- package/dist/src/storage/sqlite/migrations/092_outcome_execution_runtime.sql +0 -88
- package/dist/src/storage/sqlite/migrations/093_remove_legacy_goals.sql +0 -174
- package/dist/src/storage/sqlite/migrations/094_outcome_judgment_and_authority.sql +0 -3
- package/dist/src/storage/sqlite/migrations/095_session_input_queue.sql +0 -35
- package/dist/src/storage/sqlite/migrations/096_drop_work_intakes.sql +0 -6
- package/dist/src/storage/sqlite/migrations/097_work_item_lifecycle.sql +0 -194
- package/dist/src/storage/sqlite/migrations/098_discussion_note_documents.sql +0 -99
- package/dist/src/storage/sqlite/migrations/099_task_model.sql +0 -500
- package/dist/src/storage/sqlite/migrations/100_project_task_taskrun.sql +0 -763
- package/dist/src/storage/sqlite/migrations/101_session_response_language.sql +0 -1
- package/dist/src/storage/sqlite/migrations/102_session_user_context_mode.sql +0 -2
- package/dist/src/storage/sqlite/migrations/103_finalize_structured_memory.sql +0 -3
- package/dist/src/storage/sqlite/migrations/104_turn_memory_feedback.sql +0 -77
- package/dist/src/storage/sqlite/migrations/105_dreaming_ledger.sql +0 -34
- package/dist/src/storage/sqlite/migrations/106_dreaming_run_reproducibility.sql +0 -2
- package/dist/src/storage/sqlite/migrations/107_connector_accounts.sql +0 -146
- package/dist/src/storage/sqlite/migrations/108_repair_user_memory_provider.sql +0 -18
- package/dist/src/storage/sqlite/migrations/109_endpoint_principals.sql +0 -14
- package/dist/src/storage/sqlite/migrations/110_session_input_origin.sql +0 -43
- package/dist/src/storage/sqlite/migrations/111_endpoint_tool_invocations.sql +0 -18
- package/dist/src/storage/sqlite/migrations/112_endpoint_instance_bindings.sql +0 -8
- package/dist/src/storage/sqlite/migrations/113_memory_evidence_single_source.sql +0 -76
- package/dist/src/storage/sqlite/migrations/114_user_context_domain.sql +0 -193
- package/dist/src/storage/sqlite/migrations/115_remove_legacy_user_context.sql +0 -6
- package/dist/src/storage/sqlite/migrations/116_structured_context_consolidation.sql +0 -38
- package/dist/src/storage/sqlite/migrations/117_unified_understanding_sources.sql +0 -110
- package/dist/src/storage/sqlite/migrations/118_task_board_rank.sql +0 -6
- package/dist/src/storage/sqlite/migrations/119_proactive_disposition.sql +0 -13
- package/dist/src/storage/sqlite/migrations/120_task_conversation.sql +0 -112
- package/dist/src/storage/sqlite/migrations/121_automation_inbox.sql +0 -24
- package/dist/src/storage/sqlite/migrations/122_automation_session_projects.sql +0 -18
- package/dist/src/storage/sqlite/migrations/123_remove_v2_compaction_boundaries.sql +0 -25
- package/dist/src/storage/sqlite/migrations/124_workflow_context_snapshots.sql +0 -15
- package/dist/src/storage/sqlite/migrations/125_project_workflow_presets.sql +0 -12
- package/dist/src/storage/sqlite/migrations/126_focus_context_governance.sql +0 -72
- package/dist/src/storage/sqlite/migrations/127_context_object_origin.sql +0 -36
- package/dist/src/storage/sqlite/migrations/128_context_extraction.sql +0 -73
- package/dist/src/storage/sqlite/migrations/129_focus_versions.sql +0 -51
- package/dist/src/storage/sqlite/migrations/130_context_evidence_provenance.sql +0 -18
- package/dist/src/storage/sqlite/migrations/131_session_input_contexts.sql +0 -2
- package/dist/src/storage/sqlite/migrations/132_transcript_source_context_metadata.sql +0 -34
- package/dist/src/storage/sqlite/migrations/133_archive_legacy_work_discovery_profile_facts.sql +0 -11
- package/dist/src/storage/sqlite/migrations/134_memory_provenance.sql +0 -18
- package/dist/src/storage/sqlite/migrations/135_user_people.sql +0 -59
- package/dist/src/storage/sqlite/migrations/136_product_notifications.sql +0 -79
- package/dist/src/storage/sqlite/migrations/137_understanding_status_audit.sql +0 -71
- package/dist/src/storage/sqlite/migrations/138_device_access.sql +0 -96
- package/dist/src/storage/sqlite/migrations/139_turn_outcome_artifact_backfill.sql +0 -231
- package/dist/src/storage/sqlite/migrations/140_endpoint_session_bindings.sql +0 -8
- package/dist/src/storage/sqlite/migrations/141_device_pairing_approval.sql +0 -17
- package/dist/src/storage/sqlite/migrations/142_session_input_instance.sql +0 -1
- package/dist/src/storage/sqlite/migrations/143_fixed_session_model.sql +0 -1
- package/dist/src/storage/sqlite/migrations/144_execution_environments.sql +0 -59
- package/dist/src/storage/sqlite/migrations/145_project_execution_mode.sql +0 -5
- package/dist/src/storage/sqlite/migrations/146_understanding_focus_exclusions.sql +0 -9
- package/dist/src/storage/sqlite/migrations/147_durable_application_state.sql +0 -39
- package/dist/src/storage/sqlite/migrations/148_user_model_foundation.sql +0 -554
- package/dist/src/storage/sqlite/migrations/149_separate_source_index_from_memory.sql +0 -18
- package/dist/src/storage/sqlite/migrations/150_session_connection_waits.sql +0 -47
- package/dist/src/storage/sqlite/migrations/151_proactive_scope_cleanup.sql +0 -6
- package/dist/src/storage/sqlite/migrations/152_proactive_scenario_contract.sql +0 -140
- package/dist/src/storage/sqlite/migrations/153_browser_control_v2.sql +0 -45
- package/dist/src/storage/sqlite/migrations/154_session_clarification_waits.sql +0 -60
- package/dist/src/storage/sqlite/migrations/155_browser_extension.sql +0 -120
- package/dist/src/storage/sqlite/migrations/156_browser_tab_bindings.sql +0 -14
- package/dist/src/storage/sqlite/migrations/157_browser_endpoint_principals.sql +0 -50
- package/dist/src/storage/sqlite/migrations/158_browser_native_enrollment.sql +0 -4
- package/dist/src/storage/sqlite/migrations/159_proactive_controls.sql +0 -68
- package/dist/src/storage/sqlite/migrations/160_proactive_web_push.sql +0 -27
- package/dist/src/storage/sqlite/migrations/161_proactive_delivery_and_lifecycle.sql +0 -51
- package/dist/src/storage/sqlite/migrations/162_proactive_product.sql +0 -7
- package/dist/src/storage/sqlite/migrations/163_proactive_follow_ups.sql +0 -29
- package/dist/src/storage/sqlite/migrations/164_browser_sessions.sql +0 -8
- package/dist/src/storage/sqlite/migrations/165_device_pairing_target.sql +0 -40
- package/dist/src/storage/sqlite/migrations/__tests__/mobile-discussion-source.test.ts +0 -20
- package/dist/src/storage/sqlite/migrations/conversation-backup.ts +0 -66
- package/dist/src/storage/sqlite/migrations/conversation-key-decoder.ts +0 -50
- package/dist/src/storage/sqlite/migrations/conversation-uuid.ts +0 -324
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.ts +0 -71
- package/dist/src/storage/sqlite/migrations/discover.ts +0 -52
- package/dist/src/storage/sqlite/migrations/errors.ts +0 -32
- package/dist/src/storage/sqlite/migrations/runner.ts +0 -204
- package/dist/src/storage/sqlite/migrations/types.ts +0 -15
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
DELETE FROM automations
|
|
2
|
-
WHERE automation_id LIKE 'system-user-context-dreaming:%'
|
|
3
|
-
OR automation_id IN ('system-dreaming-light', 'system-dreaming-deep', 'system-dreaming-rem');
|
|
4
|
-
|
|
5
|
-
DELETE FROM memory_records
|
|
6
|
-
WHERE tags_json LIKE '%"user-understanding"%';
|
|
7
|
-
|
|
8
|
-
DELETE FROM memory_trace_events
|
|
9
|
-
WHERE provider_id = 'user-understanding' OR phase = 'understanding';
|
|
10
|
-
|
|
11
|
-
DROP TABLE IF EXISTS dreaming_decisions;
|
|
12
|
-
DROP TABLE IF EXISTS dreaming_runs;
|
|
13
|
-
|
|
14
|
-
CREATE TABLE context_consolidation_runs (
|
|
15
|
-
run_id TEXT PRIMARY KEY,
|
|
16
|
-
trigger_kind TEXT NOT NULL CHECK (trigger_kind IN ('schedule', 'manual')),
|
|
17
|
-
status TEXT NOT NULL CHECK (status IN ('running', 'completed', 'failed')),
|
|
18
|
-
reason TEXT,
|
|
19
|
-
metrics_json TEXT NOT NULL DEFAULT '{}',
|
|
20
|
-
started_at INTEGER NOT NULL,
|
|
21
|
-
completed_at INTEGER
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
CREATE INDEX idx_context_consolidation_runs_started
|
|
25
|
-
ON context_consolidation_runs(started_at DESC);
|
|
26
|
-
|
|
27
|
-
CREATE TABLE context_consolidation_decisions (
|
|
28
|
-
decision_id TEXT PRIMARY KEY,
|
|
29
|
-
run_id TEXT NOT NULL REFERENCES context_consolidation_runs(run_id) ON DELETE CASCADE,
|
|
30
|
-
understanding_id TEXT REFERENCES user_understandings(understanding_id) ON DELETE SET NULL,
|
|
31
|
-
action TEXT NOT NULL CHECK (action IN ('needs_review', 'stale')),
|
|
32
|
-
reason_code TEXT NOT NULL,
|
|
33
|
-
evidence_count INTEGER NOT NULL DEFAULT 0,
|
|
34
|
-
created_at INTEGER NOT NULL
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
CREATE INDEX idx_context_consolidation_decisions_run
|
|
38
|
-
ON context_consolidation_decisions(run_id, created_at);
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
ALTER TABLE user_profiles ADD COLUMN role TEXT NOT NULL DEFAULT '';
|
|
2
|
-
ALTER TABLE user_profiles ADD COLUMN primary_goal TEXT NOT NULL DEFAULT '';
|
|
3
|
-
|
|
4
|
-
CREATE TABLE understanding_source_grants (
|
|
5
|
-
grant_id TEXT PRIMARY KEY,
|
|
6
|
-
source_key TEXT NOT NULL UNIQUE,
|
|
7
|
-
adapter_id TEXT NOT NULL,
|
|
8
|
-
category TEXT NOT NULL CHECK (category IN (
|
|
9
|
-
'files', 'recent_documents', 'calendar', 'tasks', 'notes',
|
|
10
|
-
'mail', 'messages', 'code_activity'
|
|
11
|
-
)),
|
|
12
|
-
platform TEXT NOT NULL CHECK (platform IN ('darwin', 'win32', 'linux', 'all')),
|
|
13
|
-
display_name TEXT NOT NULL,
|
|
14
|
-
status TEXT NOT NULL DEFAULT 'active' CHECK (status IN ('active', 'revoked')),
|
|
15
|
-
access_mode TEXT NOT NULL CHECK (access_mode IN ('once', 'continuous')),
|
|
16
|
-
retention_policy TEXT NOT NULL CHECK (retention_policy IN ('metadata_only', 'derived_only', 'bounded_raw')),
|
|
17
|
-
processing_policy TEXT NOT NULL CHECK (processing_policy IN ('local_only', 'remote_allowed')),
|
|
18
|
-
config_json TEXT NOT NULL DEFAULT '{}',
|
|
19
|
-
checkpoint_json TEXT NOT NULL DEFAULT '{}',
|
|
20
|
-
last_collected_at INTEGER,
|
|
21
|
-
created_at INTEGER NOT NULL,
|
|
22
|
-
updated_at INTEGER NOT NULL
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
CREATE INDEX idx_understanding_source_grants_status
|
|
26
|
-
ON understanding_source_grants(status, category, updated_at DESC);
|
|
27
|
-
|
|
28
|
-
CREATE TABLE understanding_source_runs (
|
|
29
|
-
run_id TEXT PRIMARY KEY,
|
|
30
|
-
grant_id TEXT NOT NULL,
|
|
31
|
-
kind TEXT NOT NULL CHECK (kind IN ('preview', 'bootstrap', 'incremental', 'fingerprint')),
|
|
32
|
-
status TEXT NOT NULL CHECK (status IN ('queued', 'running', 'completed', 'partial', 'failed', 'canceled')),
|
|
33
|
-
cursor_before TEXT,
|
|
34
|
-
cursor_after TEXT,
|
|
35
|
-
items_seen INTEGER NOT NULL DEFAULT 0,
|
|
36
|
-
metadata_json TEXT NOT NULL DEFAULT '{}',
|
|
37
|
-
error_message TEXT,
|
|
38
|
-
started_at INTEGER NOT NULL,
|
|
39
|
-
completed_at INTEGER,
|
|
40
|
-
FOREIGN KEY (grant_id) REFERENCES understanding_source_grants(grant_id) ON DELETE CASCADE
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
CREATE INDEX idx_understanding_source_runs_grant
|
|
44
|
-
ON understanding_source_runs(grant_id, started_at DESC);
|
|
45
|
-
CREATE INDEX idx_understanding_source_runs_status
|
|
46
|
-
ON understanding_source_runs(status, started_at ASC);
|
|
47
|
-
|
|
48
|
-
CREATE TABLE user_focuses (
|
|
49
|
-
focus_id TEXT PRIMARY KEY,
|
|
50
|
-
canonical_key TEXT NOT NULL UNIQUE,
|
|
51
|
-
title TEXT NOT NULL,
|
|
52
|
-
summary TEXT NOT NULL,
|
|
53
|
-
horizon TEXT NOT NULL CHECK (horizon IN ('current', 'ongoing', 'long_term')),
|
|
54
|
-
status TEXT NOT NULL CHECK (status IN ('candidate', 'active', 'paused', 'completed', 'rejected')),
|
|
55
|
-
confidence REAL NOT NULL CHECK (confidence >= 0 AND confidence <= 1),
|
|
56
|
-
project_id TEXT,
|
|
57
|
-
evidence_refs_json TEXT NOT NULL DEFAULT '[]',
|
|
58
|
-
source_run_id TEXT,
|
|
59
|
-
created_at INTEGER NOT NULL,
|
|
60
|
-
updated_at INTEGER NOT NULL,
|
|
61
|
-
FOREIGN KEY (project_id) REFERENCES projects(project_id) ON DELETE SET NULL,
|
|
62
|
-
FOREIGN KEY (source_run_id) REFERENCES understanding_source_runs(run_id) ON DELETE SET NULL
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
CREATE INDEX idx_user_focuses_status
|
|
66
|
-
ON user_focuses(status, horizon, updated_at DESC);
|
|
67
|
-
|
|
68
|
-
-- Replace the work-discovery-only grant foreign key with the unified grant model.
|
|
69
|
-
CREATE TABLE work_understanding_evidence_v117 (
|
|
70
|
-
evidence_id TEXT PRIMARY KEY,
|
|
71
|
-
investigation_id TEXT NOT NULL,
|
|
72
|
-
source_grant_id TEXT,
|
|
73
|
-
project_id TEXT,
|
|
74
|
-
source_type TEXT NOT NULL CHECK (source_type IN (
|
|
75
|
-
'file', 'git', 'project_metadata', 'understanding_source', 'session', 'user_statement'
|
|
76
|
-
)),
|
|
77
|
-
source_ref TEXT NOT NULL,
|
|
78
|
-
observation TEXT NOT NULL,
|
|
79
|
-
content_hash TEXT,
|
|
80
|
-
observed_at INTEGER,
|
|
81
|
-
collected_at INTEGER NOT NULL,
|
|
82
|
-
sensitivity TEXT NOT NULL DEFAULT 'normal' CHECK (sensitivity IN ('normal', 'restricted')),
|
|
83
|
-
FOREIGN KEY (investigation_id) REFERENCES work_understanding_investigations(investigation_id) ON DELETE CASCADE,
|
|
84
|
-
FOREIGN KEY (source_grant_id) REFERENCES understanding_source_grants(grant_id) ON DELETE SET NULL,
|
|
85
|
-
FOREIGN KEY (project_id) REFERENCES projects(project_id) ON DELETE SET NULL
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
INSERT INTO work_understanding_evidence_v117 (
|
|
89
|
-
evidence_id, investigation_id, source_grant_id, project_id, source_type,
|
|
90
|
-
source_ref, observation, content_hash, observed_at, collected_at, sensitivity
|
|
91
|
-
)
|
|
92
|
-
SELECT
|
|
93
|
-
evidence_id, investigation_id, NULL, project_id,
|
|
94
|
-
CASE source_type
|
|
95
|
-
WHEN 'personal_context' THEN 'understanding_source'
|
|
96
|
-
ELSE source_type
|
|
97
|
-
END,
|
|
98
|
-
source_ref, observation, content_hash, observed_at, collected_at, sensitivity
|
|
99
|
-
FROM work_understanding_evidence;
|
|
100
|
-
|
|
101
|
-
DROP TABLE work_understanding_evidence;
|
|
102
|
-
ALTER TABLE work_understanding_evidence_v117 RENAME TO work_understanding_evidence;
|
|
103
|
-
|
|
104
|
-
CREATE INDEX idx_work_understanding_evidence_investigation
|
|
105
|
-
ON work_understanding_evidence(investigation_id, collected_at ASC);
|
|
106
|
-
CREATE INDEX idx_work_understanding_evidence_source
|
|
107
|
-
ON work_understanding_evidence(source_grant_id, source_type, collected_at DESC);
|
|
108
|
-
|
|
109
|
-
DROP TABLE work_discovery_source_refreshes;
|
|
110
|
-
DROP TABLE work_discovery_sources;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
ALTER TABLE proactive_insights ADD COLUMN proposed_action_json TEXT;
|
|
2
|
-
ALTER TABLE proactive_insights ADD COLUMN disposition TEXT
|
|
3
|
-
CHECK (disposition IN ('record_silently', 'show_in_work', 'request_approval', 'auto_execute'));
|
|
4
|
-
ALTER TABLE proactive_insights ADD COLUMN disposition_reason TEXT;
|
|
5
|
-
ALTER TABLE proactive_insights ADD COLUMN action_status TEXT
|
|
6
|
-
CHECK (action_status IN ('not_authorized', 'approval_required', 'pending', 'executing', 'completed', 'rejected', 'failed'));
|
|
7
|
-
ALTER TABLE proactive_insights ADD COLUMN action_result_json TEXT;
|
|
8
|
-
ALTER TABLE proactive_insights ADD COLUMN action_error TEXT;
|
|
9
|
-
ALTER TABLE proactive_insights ADD COLUMN disposition_at TEXT;
|
|
10
|
-
ALTER TABLE proactive_insights ADD COLUMN action_updated_at TEXT;
|
|
11
|
-
|
|
12
|
-
CREATE INDEX idx_proactive_insights_action_status
|
|
13
|
-
ON proactive_insights(action_status, created_at);
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
ALTER TABLE task_sessions ADD COLUMN agent_id TEXT;
|
|
2
|
-
ALTER TABLE task_sessions ADD COLUMN run_id TEXT;
|
|
3
|
-
ALTER TABLE task_sessions ADD COLUMN assignment_epoch INTEGER NOT NULL DEFAULT 0;
|
|
4
|
-
ALTER TABLE task_sessions ADD COLUMN status TEXT NOT NULL DEFAULT 'completed'
|
|
5
|
-
CHECK (status IN ('active', 'completed', 'superseded', 'failed'));
|
|
6
|
-
ALTER TABLE task_sessions ADD COLUMN started_at INTEGER;
|
|
7
|
-
ALTER TABLE task_sessions ADD COLUMN ended_at INTEGER;
|
|
8
|
-
|
|
9
|
-
UPDATE task_sessions
|
|
10
|
-
SET agent_id = (
|
|
11
|
-
SELECT sessions.agent_id FROM sessions WHERE sessions.session_key = task_sessions.session_key
|
|
12
|
-
), started_at = created_at;
|
|
13
|
-
|
|
14
|
-
UPDATE task_sessions
|
|
15
|
-
SET run_id = (
|
|
16
|
-
SELECT task_runs.run_id
|
|
17
|
-
FROM task_runs
|
|
18
|
-
WHERE task_runs.task_id = task_sessions.task_id
|
|
19
|
-
AND task_runs.session_key = task_sessions.session_key
|
|
20
|
-
ORDER BY task_runs.queued_at DESC
|
|
21
|
-
LIMIT 1
|
|
22
|
-
)
|
|
23
|
-
WHERE role = 'execution';
|
|
24
|
-
|
|
25
|
-
UPDATE task_sessions
|
|
26
|
-
SET status = 'superseded', ended_at = created_at
|
|
27
|
-
WHERE role = 'execution';
|
|
28
|
-
|
|
29
|
-
DELETE FROM task_sessions
|
|
30
|
-
WHERE role = 'execution'
|
|
31
|
-
AND session_key IS NOT NULL
|
|
32
|
-
AND task_session_id NOT IN (
|
|
33
|
-
SELECT canonical.task_session_id
|
|
34
|
-
FROM task_sessions AS canonical
|
|
35
|
-
WHERE canonical.role = 'execution'
|
|
36
|
-
AND canonical.session_key IS NOT NULL
|
|
37
|
-
AND canonical.task_session_id = (
|
|
38
|
-
SELECT candidate.task_session_id
|
|
39
|
-
FROM task_sessions AS candidate
|
|
40
|
-
WHERE candidate.role = 'execution'
|
|
41
|
-
AND candidate.session_key = canonical.session_key
|
|
42
|
-
ORDER BY candidate.created_at DESC, candidate.task_session_id DESC
|
|
43
|
-
LIMIT 1
|
|
44
|
-
)
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
UPDATE task_sessions
|
|
48
|
-
SET status = 'active', ended_at = NULL, assignment_epoch = 1
|
|
49
|
-
WHERE task_session_id IN (
|
|
50
|
-
SELECT latest.task_session_id FROM task_sessions AS latest
|
|
51
|
-
WHERE latest.role = 'execution'
|
|
52
|
-
AND latest.task_session_id = (
|
|
53
|
-
SELECT candidate.task_session_id
|
|
54
|
-
FROM task_sessions AS candidate
|
|
55
|
-
WHERE candidate.task_id = latest.task_id AND candidate.role = 'execution'
|
|
56
|
-
ORDER BY candidate.created_at DESC, candidate.task_session_id DESC
|
|
57
|
-
LIMIT 1
|
|
58
|
-
)
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
CREATE UNIQUE INDEX idx_task_sessions_active_execution
|
|
62
|
-
ON task_sessions(task_id)
|
|
63
|
-
WHERE role = 'execution' AND status = 'active';
|
|
64
|
-
CREATE UNIQUE INDEX idx_task_sessions_execution_owner
|
|
65
|
-
ON task_sessions(session_key)
|
|
66
|
-
WHERE role = 'execution' AND session_key IS NOT NULL;
|
|
67
|
-
|
|
68
|
-
CREATE TABLE task_conversation_state (
|
|
69
|
-
task_id TEXT PRIMARY KEY,
|
|
70
|
-
active_session_key TEXT,
|
|
71
|
-
current_executor_agent_id TEXT,
|
|
72
|
-
assignment_epoch INTEGER NOT NULL DEFAULT 0,
|
|
73
|
-
status TEXT NOT NULL DEFAULT 'idle'
|
|
74
|
-
CHECK (status IN ('idle', 'active')),
|
|
75
|
-
updated_at INTEGER NOT NULL,
|
|
76
|
-
FOREIGN KEY (task_id) REFERENCES tasks(task_id) ON DELETE CASCADE,
|
|
77
|
-
FOREIGN KEY (active_session_key) REFERENCES sessions(session_key) ON DELETE SET NULL
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
INSERT INTO task_conversation_state (
|
|
81
|
-
task_id, active_session_key, current_executor_agent_id,
|
|
82
|
-
assignment_epoch, status, updated_at
|
|
83
|
-
)
|
|
84
|
-
SELECT
|
|
85
|
-
tasks.task_id,
|
|
86
|
-
active.session_key,
|
|
87
|
-
COALESCE(active.agent_id, tasks.delegate_agent_id, tasks.owner_id),
|
|
88
|
-
COALESCE(active.assignment_epoch, 0),
|
|
89
|
-
CASE WHEN active.session_key IS NULL THEN 'idle' ELSE 'active' END,
|
|
90
|
-
tasks.updated_at
|
|
91
|
-
FROM tasks
|
|
92
|
-
LEFT JOIN task_sessions AS active
|
|
93
|
-
ON active.task_id = tasks.task_id
|
|
94
|
-
AND active.role = 'execution'
|
|
95
|
-
AND active.status = 'active';
|
|
96
|
-
|
|
97
|
-
CREATE TABLE task_handoff_snapshots (
|
|
98
|
-
snapshot_id TEXT PRIMARY KEY,
|
|
99
|
-
task_id TEXT NOT NULL,
|
|
100
|
-
from_session_key TEXT,
|
|
101
|
-
to_session_key TEXT NOT NULL,
|
|
102
|
-
from_agent_id TEXT,
|
|
103
|
-
to_agent_id TEXT NOT NULL,
|
|
104
|
-
assignment_epoch INTEGER NOT NULL,
|
|
105
|
-
payload_json TEXT NOT NULL,
|
|
106
|
-
created_at INTEGER NOT NULL,
|
|
107
|
-
FOREIGN KEY (task_id) REFERENCES tasks(task_id) ON DELETE CASCADE,
|
|
108
|
-
FOREIGN KEY (from_session_key) REFERENCES sessions(session_key) ON DELETE SET NULL,
|
|
109
|
-
FOREIGN KEY (to_session_key) REFERENCES sessions(session_key) ON DELETE CASCADE
|
|
110
|
-
);
|
|
111
|
-
CREATE INDEX idx_task_handoffs_task
|
|
112
|
-
ON task_handoff_snapshots(task_id, assignment_epoch DESC);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
ALTER TABLE automations ADD COLUMN conversation_mode TEXT NOT NULL DEFAULT 'new_session'
|
|
2
|
-
CHECK (conversation_mode IN ('new_session', 'continuous'));
|
|
3
|
-
ALTER TABLE automations ADD COLUMN notification_policy TEXT NOT NULL DEFAULT 'attention'
|
|
4
|
-
CHECK (notification_policy IN ('attention', 'all', 'none'));
|
|
5
|
-
ALTER TABLE automations ADD COLUMN completion_webhook_url TEXT;
|
|
6
|
-
|
|
7
|
-
UPDATE automations
|
|
8
|
-
SET completion_webhook_url = json_extract(after_run_json, '$.url')
|
|
9
|
-
WHERE json_extract(after_run_json, '$.kind') = 'webhook';
|
|
10
|
-
|
|
11
|
-
ALTER TABLE automations DROP COLUMN after_run_json;
|
|
12
|
-
|
|
13
|
-
UPDATE automation_runs
|
|
14
|
-
SET current_phase = 'completion_hook'
|
|
15
|
-
WHERE current_phase = 'after_run';
|
|
16
|
-
|
|
17
|
-
UPDATE automation_run_events
|
|
18
|
-
SET type = replace(type, 'after_run.', 'completion_hook.'),
|
|
19
|
-
message = replace(message, 'After-run webhook', 'Completion webhook')
|
|
20
|
-
WHERE type LIKE 'after_run.%';
|
|
21
|
-
|
|
22
|
-
ALTER TABLE automation_runs ADD COLUMN read_at_ms INTEGER;
|
|
23
|
-
CREATE INDEX IF NOT EXISTS idx_automation_runs_unread_created
|
|
24
|
-
ON automation_runs(read_at_ms, created_at_ms DESC);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
UPDATE sessions
|
|
2
|
-
SET project_id = (
|
|
3
|
-
SELECT a.project_id
|
|
4
|
-
FROM automation_runs r
|
|
5
|
-
JOIN automations a ON a.automation_id = r.automation_id
|
|
6
|
-
WHERE r.session_key = sessions.session_key
|
|
7
|
-
AND a.project_id IS NOT NULL
|
|
8
|
-
ORDER BY r.created_at_ms DESC
|
|
9
|
-
LIMIT 1
|
|
10
|
-
)
|
|
11
|
-
WHERE project_id IS NULL
|
|
12
|
-
AND EXISTS (
|
|
13
|
-
SELECT 1
|
|
14
|
-
FROM automation_runs r
|
|
15
|
-
JOIN automations a ON a.automation_id = r.automation_id
|
|
16
|
-
WHERE r.session_key = sessions.session_key
|
|
17
|
-
AND a.project_id IS NOT NULL
|
|
18
|
-
);
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
DELETE FROM transcript_fts
|
|
2
|
-
WHERE entry_id IN (
|
|
3
|
-
SELECT entry_id
|
|
4
|
-
FROM transcript_entries
|
|
5
|
-
WHERE entry_kind = 'compaction'
|
|
6
|
-
);
|
|
7
|
-
|
|
8
|
-
DELETE FROM transcript_entries
|
|
9
|
-
WHERE entry_kind = 'compaction';
|
|
10
|
-
|
|
11
|
-
UPDATE sessions
|
|
12
|
-
SET
|
|
13
|
-
compacted_count = 0,
|
|
14
|
-
message_count = (
|
|
15
|
-
SELECT COUNT(*)
|
|
16
|
-
FROM transcript_entries e
|
|
17
|
-
WHERE e.session_id = sessions.session_id
|
|
18
|
-
AND e.entry_kind = 'message'
|
|
19
|
-
),
|
|
20
|
-
estimated_tokens = (
|
|
21
|
-
SELECT COALESCE(SUM((length(COALESCE(json_extract(e.payload_json, '$.content'), '')) + 3) / 4), 0)
|
|
22
|
-
FROM transcript_entries e
|
|
23
|
-
WHERE e.session_id = sessions.session_id
|
|
24
|
-
AND e.entry_kind = 'message'
|
|
25
|
-
);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
CREATE TABLE workflow_context_snapshots (
|
|
2
|
-
snapshot_id TEXT PRIMARY KEY,
|
|
3
|
-
trace_id TEXT NOT NULL UNIQUE,
|
|
4
|
-
run_id TEXT NOT NULL,
|
|
5
|
-
project_id TEXT,
|
|
6
|
-
selected_items_json TEXT NOT NULL,
|
|
7
|
-
estimated_tokens INTEGER NOT NULL DEFAULT 0,
|
|
8
|
-
content_hash TEXT NOT NULL,
|
|
9
|
-
created_at INTEGER NOT NULL
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
CREATE INDEX idx_workflow_context_snapshots_run
|
|
13
|
-
ON workflow_context_snapshots(run_id, created_at DESC);
|
|
14
|
-
CREATE INDEX idx_workflow_context_snapshots_project
|
|
15
|
-
ON workflow_context_snapshots(project_id, created_at DESC);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
CREATE TABLE project_workflow_presets (
|
|
2
|
-
project_id TEXT NOT NULL,
|
|
3
|
-
definition_id TEXT NOT NULL,
|
|
4
|
-
context_refs_json TEXT NOT NULL DEFAULT '[]',
|
|
5
|
-
created_at INTEGER NOT NULL,
|
|
6
|
-
updated_at INTEGER NOT NULL,
|
|
7
|
-
PRIMARY KEY (project_id, definition_id),
|
|
8
|
-
FOREIGN KEY (project_id) REFERENCES projects(project_id) ON DELETE CASCADE
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
CREATE INDEX idx_project_workflow_presets_updated
|
|
12
|
-
ON project_workflow_presets(project_id, updated_at DESC);
|
|
@@ -1,72 +0,0 @@
|
|
|
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;
|
|
@@ -1,36 +0,0 @@
|
|
|
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;
|
|
@@ -1,73 +0,0 @@
|
|
|
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);
|
|
@@ -1,51 +0,0 @@
|
|
|
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;
|
|
@@ -1,18 +0,0 @@
|
|
|
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);
|