@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,100 +0,0 @@
|
|
|
1
|
-
DROP TABLE IF EXISTS discussion_action_conversions;
|
|
2
|
-
DROP TABLE IF EXISTS discussion_transcript_segments;
|
|
3
|
-
DROP TABLE IF EXISTS discussion_capture_settings;
|
|
4
|
-
DROP TABLE IF EXISTS discussion_captures;
|
|
5
|
-
|
|
6
|
-
CREATE TABLE discussion_captures (
|
|
7
|
-
id TEXT PRIMARY KEY,
|
|
8
|
-
client_request_id TEXT NOT NULL UNIQUE,
|
|
9
|
-
note_id TEXT NOT NULL UNIQUE,
|
|
10
|
-
project_id TEXT,
|
|
11
|
-
audio_attachment_id TEXT,
|
|
12
|
-
source TEXT NOT NULL CHECK (source IN ('web', 'electron')),
|
|
13
|
-
status TEXT NOT NULL CHECK (status IN (
|
|
14
|
-
'recording',
|
|
15
|
-
'finalizing',
|
|
16
|
-
'completed',
|
|
17
|
-
'failed',
|
|
18
|
-
'cancelled'
|
|
19
|
-
)),
|
|
20
|
-
processing_stage TEXT CHECK (processing_stage IN (
|
|
21
|
-
'original_upload',
|
|
22
|
-
'final_transcription',
|
|
23
|
-
'analysis',
|
|
24
|
-
'note_write'
|
|
25
|
-
)),
|
|
26
|
-
duration_ms INTEGER,
|
|
27
|
-
expected_last_sequence INTEGER,
|
|
28
|
-
mime_type TEXT,
|
|
29
|
-
audio_size_bytes INTEGER,
|
|
30
|
-
audio_sha256 TEXT,
|
|
31
|
-
transcript_raw TEXT,
|
|
32
|
-
transcript_sha256 TEXT,
|
|
33
|
-
transcript_language TEXT,
|
|
34
|
-
stt_provider TEXT,
|
|
35
|
-
analysis_json TEXT,
|
|
36
|
-
analysis_input_hash TEXT,
|
|
37
|
-
analyzer_model_ref TEXT,
|
|
38
|
-
generated_title TEXT,
|
|
39
|
-
project_inference_score REAL,
|
|
40
|
-
project_inference_source TEXT,
|
|
41
|
-
finalization_revision INTEGER NOT NULL DEFAULT 0,
|
|
42
|
-
attempt_count INTEGER NOT NULL DEFAULT 0,
|
|
43
|
-
next_attempt_at INTEGER,
|
|
44
|
-
lease_owner TEXT,
|
|
45
|
-
lease_expires_at INTEGER,
|
|
46
|
-
last_error_code TEXT,
|
|
47
|
-
last_error_message TEXT,
|
|
48
|
-
recording_started_at INTEGER NOT NULL,
|
|
49
|
-
recording_finished_at INTEGER,
|
|
50
|
-
created_at INTEGER NOT NULL,
|
|
51
|
-
updated_at INTEGER NOT NULL,
|
|
52
|
-
completed_at INTEGER,
|
|
53
|
-
audio_deleted_at INTEGER,
|
|
54
|
-
FOREIGN KEY (note_id) REFERENCES notes(note_id) ON DELETE CASCADE,
|
|
55
|
-
FOREIGN KEY (project_id) REFERENCES projects(project_id) ON DELETE SET NULL
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
CREATE INDEX idx_discussion_captures_queue
|
|
59
|
-
ON discussion_captures(status, next_attempt_at, created_at);
|
|
60
|
-
|
|
61
|
-
CREATE INDEX idx_discussion_captures_project
|
|
62
|
-
ON discussion_captures(project_id, updated_at DESC);
|
|
63
|
-
|
|
64
|
-
CREATE TABLE discussion_transcript_segments (
|
|
65
|
-
discussion_id TEXT NOT NULL,
|
|
66
|
-
sequence INTEGER NOT NULL,
|
|
67
|
-
audio_sha256 TEXT NOT NULL,
|
|
68
|
-
audio_blob BLOB,
|
|
69
|
-
started_at_ms INTEGER NOT NULL,
|
|
70
|
-
ended_at_ms INTEGER NOT NULL,
|
|
71
|
-
status TEXT NOT NULL CHECK (status IN ('uploaded', 'transcribing', 'completed', 'failed')),
|
|
72
|
-
transcript TEXT,
|
|
73
|
-
provider TEXT,
|
|
74
|
-
attempt_count INTEGER NOT NULL DEFAULT 0,
|
|
75
|
-
next_attempt_at INTEGER,
|
|
76
|
-
lease_owner TEXT,
|
|
77
|
-
lease_expires_at INTEGER,
|
|
78
|
-
last_error TEXT,
|
|
79
|
-
created_at INTEGER NOT NULL,
|
|
80
|
-
updated_at INTEGER NOT NULL,
|
|
81
|
-
PRIMARY KEY (discussion_id, sequence),
|
|
82
|
-
FOREIGN KEY (discussion_id) REFERENCES discussion_captures(id) ON DELETE CASCADE
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
CREATE INDEX idx_discussion_segments_queue
|
|
86
|
-
ON discussion_transcript_segments(status, next_attempt_at, created_at);
|
|
87
|
-
|
|
88
|
-
CREATE TABLE discussion_capture_settings (
|
|
89
|
-
workspace_id TEXT PRIMARY KEY,
|
|
90
|
-
consent_policy_version INTEGER NOT NULL,
|
|
91
|
-
consent_acknowledged_at INTEGER,
|
|
92
|
-
updated_at INTEGER NOT NULL
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
INSERT INTO discussion_capture_settings (
|
|
96
|
-
workspace_id,
|
|
97
|
-
consent_policy_version,
|
|
98
|
-
consent_acknowledged_at,
|
|
99
|
-
updated_at
|
|
100
|
-
) VALUES ('default', 1, NULL, CAST(unixepoch('subsec') * 1000 AS INTEGER));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
CREATE TABLE session_task_plans (
|
|
2
|
-
session_id TEXT NOT NULL,
|
|
3
|
-
plan_id TEXT NOT NULL,
|
|
4
|
-
items_json TEXT NOT NULL,
|
|
5
|
-
revision INTEGER NOT NULL DEFAULT 1,
|
|
6
|
-
updated_at INTEGER NOT NULL,
|
|
7
|
-
PRIMARY KEY (session_id, plan_id),
|
|
8
|
-
FOREIGN KEY (session_id) REFERENCES transcripts(session_id) ON DELETE CASCADE
|
|
9
|
-
);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
CREATE TABLE work_intakes (
|
|
2
|
-
intake_id TEXT PRIMARY KEY,
|
|
3
|
-
idempotency_key TEXT NOT NULL UNIQUE,
|
|
4
|
-
request_fingerprint TEXT NOT NULL,
|
|
5
|
-
objective TEXT NOT NULL,
|
|
6
|
-
proposal_json TEXT NOT NULL,
|
|
7
|
-
session_key TEXT,
|
|
8
|
-
agent_id TEXT,
|
|
9
|
-
status TEXT NOT NULL CHECK (status IN ('proposed', 'confirmed', 'expired', 'cancelled')),
|
|
10
|
-
execution_mode TEXT NOT NULL DEFAULT 'run_now' CHECK (execution_mode IN ('create_only', 'run_now')),
|
|
11
|
-
project_id TEXT,
|
|
12
|
-
goal_id TEXT,
|
|
13
|
-
queue_id TEXT,
|
|
14
|
-
expires_at INTEGER NOT NULL,
|
|
15
|
-
created_at INTEGER NOT NULL,
|
|
16
|
-
confirmed_at INTEGER,
|
|
17
|
-
updated_at INTEGER NOT NULL,
|
|
18
|
-
FOREIGN KEY (project_id) REFERENCES projects(project_id) ON DELETE SET NULL,
|
|
19
|
-
FOREIGN KEY (goal_id) REFERENCES goals(goal_id) ON DELETE SET NULL
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
CREATE INDEX idx_work_intakes_status_updated
|
|
23
|
-
ON work_intakes(status, updated_at DESC);
|
|
24
|
-
|
|
25
|
-
CREATE INDEX idx_work_intakes_expires
|
|
26
|
-
ON work_intakes(status, expires_at);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
ALTER TABLE task_outcomes ADD COLUMN completion_verdict TEXT
|
|
2
|
-
CHECK (completion_verdict IN ('achieved', 'partial', 'not_achieved'));
|
|
3
|
-
ALTER TABLE task_outcomes ADD COLUMN completion_verdict_source TEXT
|
|
4
|
-
CHECK (completion_verdict_source IN ('system', 'user'));
|
|
5
|
-
ALTER TABLE task_outcomes ADD COLUMN correction_text TEXT;
|
|
6
|
-
ALTER TABLE task_outcomes ADD COLUMN projection_version INTEGER NOT NULL DEFAULT 0;
|
|
7
|
-
ALTER TABLE task_outcomes ADD COLUMN projected_at INTEGER;
|
|
8
|
-
|
|
9
|
-
CREATE INDEX idx_task_outcomes_projection
|
|
10
|
-
ON task_outcomes(status, projection_version, completed_at);
|
|
11
|
-
|
|
12
|
-
UPDATE task_outcomes
|
|
13
|
-
SET completion_verdict = CASE
|
|
14
|
-
WHEN status = 'succeeded' AND verification_status = 'passed' THEN 'achieved'
|
|
15
|
-
WHEN status = 'succeeded' THEN 'partial'
|
|
16
|
-
ELSE 'not_achieved'
|
|
17
|
-
END,
|
|
18
|
-
completion_verdict_source = 'system'
|
|
19
|
-
WHERE status != 'running';
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
CREATE TABLE outcomes (
|
|
2
|
-
outcome_id TEXT PRIMARY KEY,
|
|
3
|
-
objective TEXT NOT NULL,
|
|
4
|
-
user_status TEXT NOT NULL DEFAULT 'running'
|
|
5
|
-
CHECK (user_status IN ('running', 'needs_user', 'completed')),
|
|
6
|
-
internal_status TEXT NOT NULL DEFAULT 'captured'
|
|
7
|
-
CHECK (internal_status IN (
|
|
8
|
-
'captured', 'planning', 'running', 'verifying', 'continuing',
|
|
9
|
-
'needs_user', 'blocked', 'paused', 'completed', 'cancelled'
|
|
10
|
-
)),
|
|
11
|
-
importance TEXT NOT NULL DEFAULT 'normal'
|
|
12
|
-
CHECK (importance IN ('low', 'normal', 'high', 'critical')),
|
|
13
|
-
due_at INTEGER,
|
|
14
|
-
latest_contract_version INTEGER NOT NULL DEFAULT 1,
|
|
15
|
-
latest_receipt_run_id TEXT,
|
|
16
|
-
created_at INTEGER NOT NULL,
|
|
17
|
-
updated_at INTEGER NOT NULL
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
CREATE INDEX idx_outcomes_status_updated
|
|
21
|
-
ON outcomes(user_status, updated_at DESC);
|
|
22
|
-
|
|
23
|
-
CREATE TABLE outcome_contracts (
|
|
24
|
-
outcome_id TEXT NOT NULL,
|
|
25
|
-
version INTEGER NOT NULL,
|
|
26
|
-
objective TEXT NOT NULL,
|
|
27
|
-
deliverables_json TEXT NOT NULL DEFAULT '[]',
|
|
28
|
-
acceptance_criteria_json TEXT NOT NULL DEFAULT '[]',
|
|
29
|
-
constraints_json TEXT NOT NULL DEFAULT '[]',
|
|
30
|
-
approval_required_json TEXT NOT NULL DEFAULT '[]',
|
|
31
|
-
context_snapshot_id TEXT,
|
|
32
|
-
created_by TEXT NOT NULL DEFAULT 'system'
|
|
33
|
-
CHECK (created_by IN ('user', 'system')),
|
|
34
|
-
created_at INTEGER NOT NULL,
|
|
35
|
-
PRIMARY KEY (outcome_id, version),
|
|
36
|
-
FOREIGN KEY (outcome_id) REFERENCES outcomes(outcome_id) ON DELETE CASCADE
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
CREATE TABLE outcome_links (
|
|
40
|
-
outcome_id TEXT NOT NULL,
|
|
41
|
-
subject_kind TEXT NOT NULL
|
|
42
|
-
CHECK (subject_kind IN (
|
|
43
|
-
'project', 'goal', 'work_item', 'session', 'workflow',
|
|
44
|
-
'automation', 'artifact', 'source'
|
|
45
|
-
)),
|
|
46
|
-
subject_id TEXT NOT NULL,
|
|
47
|
-
relation TEXT NOT NULL DEFAULT 'supports',
|
|
48
|
-
created_at INTEGER NOT NULL,
|
|
49
|
-
PRIMARY KEY (outcome_id, subject_kind, subject_id),
|
|
50
|
-
FOREIGN KEY (outcome_id) REFERENCES outcomes(outcome_id) ON DELETE CASCADE
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
CREATE INDEX idx_outcome_links_subject
|
|
54
|
-
ON outcome_links(subject_kind, subject_id);
|
|
55
|
-
|
|
56
|
-
ALTER TABLE task_outcomes RENAME TO execution_receipts;
|
|
57
|
-
|
|
58
|
-
DROP INDEX IF EXISTS idx_task_outcomes_session_started;
|
|
59
|
-
DROP INDEX IF EXISTS idx_task_outcomes_status_started;
|
|
60
|
-
DROP INDEX IF EXISTS idx_task_outcomes_project_updated;
|
|
61
|
-
DROP INDEX IF EXISTS idx_task_outcomes_work_item_updated;
|
|
62
|
-
DROP INDEX IF EXISTS idx_task_outcomes_unprojected;
|
|
63
|
-
|
|
64
|
-
CREATE INDEX idx_execution_receipts_session_started
|
|
65
|
-
ON execution_receipts(session_key, started_at DESC);
|
|
66
|
-
CREATE INDEX idx_execution_receipts_status_started
|
|
67
|
-
ON execution_receipts(status, started_at DESC);
|
|
68
|
-
CREATE INDEX idx_execution_receipts_project_updated
|
|
69
|
-
ON execution_receipts(project_id, updated_at DESC);
|
|
70
|
-
CREATE INDEX idx_execution_receipts_work_item_updated
|
|
71
|
-
ON execution_receipts(work_item_id, updated_at DESC);
|
|
72
|
-
CREATE INDEX idx_execution_receipts_unprojected
|
|
73
|
-
ON execution_receipts(projection_version, completed_at DESC);
|
|
74
|
-
|
|
75
|
-
ALTER TABLE work_intakes ADD COLUMN outcome_id TEXT;
|
|
76
|
-
ALTER TABLE goals ADD COLUMN outcome_id TEXT;
|
|
77
|
-
ALTER TABLE goals ADD COLUMN outcome_contract_version INTEGER NOT NULL DEFAULT 1;
|
|
78
|
-
ALTER TABLE execution_receipts ADD COLUMN outcome_id TEXT;
|
|
79
|
-
ALTER TABLE execution_receipts ADD COLUMN contract_version INTEGER;
|
|
80
|
-
ALTER TABLE execution_receipts ADD COLUMN attempt INTEGER NOT NULL DEFAULT 1;
|
|
81
|
-
ALTER TABLE execution_receipts ADD COLUMN strategy TEXT;
|
|
82
|
-
|
|
83
|
-
CREATE INDEX idx_execution_receipts_outcome_started
|
|
84
|
-
ON execution_receipts(outcome_id, started_at DESC);
|
|
85
|
-
|
|
86
|
-
CREATE UNIQUE INDEX idx_goals_outcome
|
|
87
|
-
ON goals(outcome_id)
|
|
88
|
-
WHERE outcome_id IS NOT NULL;
|
|
89
|
-
|
|
90
|
-
INSERT INTO outcomes (
|
|
91
|
-
outcome_id, objective, user_status, internal_status, importance,
|
|
92
|
-
latest_contract_version, created_at, updated_at
|
|
93
|
-
)
|
|
94
|
-
SELECT
|
|
95
|
-
'outcome-goal-' || goals.goal_id,
|
|
96
|
-
COALESCE(goal_contracts.objective, goals.title),
|
|
97
|
-
CASE
|
|
98
|
-
WHEN goals.status IN ('done', 'archived') THEN 'completed'
|
|
99
|
-
WHEN goals.status IN ('blocked', 'needs_input') THEN 'needs_user'
|
|
100
|
-
ELSE 'running'
|
|
101
|
-
END,
|
|
102
|
-
CASE
|
|
103
|
-
WHEN goals.status IN ('done', 'archived') THEN 'completed'
|
|
104
|
-
WHEN goals.status = 'blocked' THEN 'blocked'
|
|
105
|
-
WHEN goals.status = 'needs_input' THEN 'needs_user'
|
|
106
|
-
WHEN goals.status = 'paused' THEN 'paused'
|
|
107
|
-
ELSE 'running'
|
|
108
|
-
END,
|
|
109
|
-
'normal',
|
|
110
|
-
COALESCE(goal_contracts.version, 1),
|
|
111
|
-
goals.created_at,
|
|
112
|
-
goals.updated_at
|
|
113
|
-
FROM goals
|
|
114
|
-
LEFT JOIN goal_contracts ON goal_contracts.goal_id = goals.goal_id;
|
|
115
|
-
|
|
116
|
-
INSERT INTO outcome_contracts (
|
|
117
|
-
outcome_id, version, objective, deliverables_json, acceptance_criteria_json,
|
|
118
|
-
constraints_json, approval_required_json, created_by, created_at
|
|
119
|
-
)
|
|
120
|
-
SELECT
|
|
121
|
-
'outcome-goal-' || goals.goal_id,
|
|
122
|
-
COALESCE(goal_contracts.version, 1),
|
|
123
|
-
COALESCE(goal_contracts.objective, goals.title),
|
|
124
|
-
json_array(COALESCE(goal_contracts.objective, goals.title)),
|
|
125
|
-
COALESCE((
|
|
126
|
-
SELECT json_group_array(goal_checklist_items.text)
|
|
127
|
-
FROM goal_checklist_items
|
|
128
|
-
WHERE goal_checklist_items.goal_id = goals.goal_id
|
|
129
|
-
), '[]'),
|
|
130
|
-
CASE
|
|
131
|
-
WHEN goal_contracts.scope_boundary IS NULL THEN '[]'
|
|
132
|
-
ELSE json_array(goal_contracts.scope_boundary)
|
|
133
|
-
END,
|
|
134
|
-
'[]',
|
|
135
|
-
'system',
|
|
136
|
-
goals.created_at
|
|
137
|
-
FROM goals
|
|
138
|
-
LEFT JOIN goal_contracts ON goal_contracts.goal_id = goals.goal_id;
|
|
139
|
-
|
|
140
|
-
UPDATE goals
|
|
141
|
-
SET outcome_id = 'outcome-goal-' || goal_id,
|
|
142
|
-
outcome_contract_version = COALESCE((
|
|
143
|
-
SELECT version FROM goal_contracts WHERE goal_contracts.goal_id = goals.goal_id
|
|
144
|
-
), 1);
|
|
145
|
-
|
|
146
|
-
INSERT INTO outcome_links (outcome_id, subject_kind, subject_id, relation, created_at)
|
|
147
|
-
SELECT outcome_id, 'project', project_id, 'contains', created_at
|
|
148
|
-
FROM goals WHERE project_id IS NOT NULL;
|
|
149
|
-
|
|
150
|
-
INSERT INTO outcome_links (outcome_id, subject_kind, subject_id, relation, created_at)
|
|
151
|
-
SELECT outcome_id, 'goal', goal_id, 'drives', created_at
|
|
152
|
-
FROM goals;
|
|
153
|
-
|
|
154
|
-
UPDATE work_intakes
|
|
155
|
-
SET outcome_id = (
|
|
156
|
-
SELECT goals.outcome_id FROM goals WHERE goals.goal_id = work_intakes.goal_id
|
|
157
|
-
)
|
|
158
|
-
WHERE goal_id IS NOT NULL;
|
|
159
|
-
|
|
160
|
-
UPDATE execution_receipts
|
|
161
|
-
SET outcome_id = (
|
|
162
|
-
SELECT goals.outcome_id FROM goals WHERE goals.goal_id = execution_receipts.goal_id
|
|
163
|
-
)
|
|
164
|
-
WHERE goal_id IS NOT NULL;
|
|
165
|
-
|
|
166
|
-
DROP TABLE goal_evidence_requirement_links;
|
|
167
|
-
DROP TABLE goal_evidence_requirements;
|
|
168
|
-
DROP TABLE goal_contracts;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
CREATE TABLE context_snapshots (
|
|
2
|
-
snapshot_id TEXT PRIMARY KEY,
|
|
3
|
-
trace_id TEXT NOT NULL UNIQUE,
|
|
4
|
-
session_key TEXT NOT NULL,
|
|
5
|
-
query TEXT NOT NULL,
|
|
6
|
-
selected_items_json TEXT NOT NULL DEFAULT '[]',
|
|
7
|
-
rejected_items_json TEXT NOT NULL DEFAULT '[]',
|
|
8
|
-
consent_requests_json TEXT NOT NULL DEFAULT '[]',
|
|
9
|
-
relationship_policy_json TEXT NOT NULL DEFAULT '{}',
|
|
10
|
-
estimated_tokens INTEGER NOT NULL DEFAULT 0,
|
|
11
|
-
outcome_id TEXT,
|
|
12
|
-
run_id TEXT,
|
|
13
|
-
created_at INTEGER NOT NULL,
|
|
14
|
-
FOREIGN KEY (outcome_id) REFERENCES outcomes(outcome_id) ON DELETE SET NULL,
|
|
15
|
-
FOREIGN KEY (run_id) REFERENCES execution_receipts(run_id) ON DELETE SET NULL
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
CREATE INDEX idx_context_snapshots_session_created
|
|
19
|
-
ON context_snapshots(session_key, created_at DESC);
|
|
20
|
-
CREATE INDEX idx_context_snapshots_outcome
|
|
21
|
-
ON context_snapshots(outcome_id, created_at DESC);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
ALTER TABLE automation_runs ADD COLUMN deadline_at_ms INTEGER;
|
|
2
|
-
ALTER TABLE automation_runs ADD COLUMN current_phase TEXT;
|
|
3
|
-
ALTER TABLE automation_runs ADD COLUMN cancel_requested_at_ms INTEGER;
|
|
4
|
-
ALTER TABLE automation_runs ADD COLUMN cancel_confirmed_at_ms INTEGER;
|
|
5
|
-
ALTER TABLE automation_runs ADD COLUMN termination_json TEXT;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
ALTER TABLE automation_runs ADD COLUMN heartbeat_at_ms INTEGER;
|
|
2
|
-
ALTER TABLE automation_runs ADD COLUMN lease_owner TEXT;
|
|
3
|
-
ALTER TABLE automation_runs ADD COLUMN lease_expires_at_ms INTEGER;
|
|
4
|
-
ALTER TABLE automation_runs ADD COLUMN attempt_number INTEGER NOT NULL DEFAULT 1;
|
|
5
|
-
ALTER TABLE automation_runs ADD COLUMN root_run_id TEXT;
|
|
6
|
-
|
|
7
|
-
CREATE INDEX IF NOT EXISTS idx_automation_runs_lease
|
|
8
|
-
ON automation_runs(status, lease_expires_at_ms);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ALTER TABLE context_snapshots ADD COLUMN allocation_json TEXT;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
CREATE TABLE outcome_execution_state (
|
|
2
|
-
outcome_id TEXT PRIMARY KEY,
|
|
3
|
-
description TEXT,
|
|
4
|
-
agent_id TEXT NOT NULL DEFAULT 'main',
|
|
5
|
-
priority TEXT NOT NULL DEFAULT 'normal'
|
|
6
|
-
CHECK (priority IN ('low', 'normal', 'high')),
|
|
7
|
-
active_session_key TEXT,
|
|
8
|
-
next_action TEXT,
|
|
9
|
-
blocked_reason TEXT,
|
|
10
|
-
ui_locale TEXT CHECK (ui_locale IS NULL OR ui_locale IN ('en', 'zh')),
|
|
11
|
-
source TEXT NOT NULL DEFAULT 'chat',
|
|
12
|
-
project_id TEXT,
|
|
13
|
-
context_text TEXT,
|
|
14
|
-
context_attachments_json TEXT NOT NULL DEFAULT '[]',
|
|
15
|
-
created_at INTEGER NOT NULL,
|
|
16
|
-
updated_at INTEGER NOT NULL,
|
|
17
|
-
FOREIGN KEY (outcome_id) REFERENCES outcomes(outcome_id) ON DELETE CASCADE,
|
|
18
|
-
FOREIGN KEY (project_id) REFERENCES projects(project_id) ON DELETE SET NULL
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
CREATE INDEX idx_outcome_execution_session
|
|
22
|
-
ON outcome_execution_state(active_session_key);
|
|
23
|
-
CREATE INDEX idx_outcome_execution_project
|
|
24
|
-
ON outcome_execution_state(project_id, updated_at DESC);
|
|
25
|
-
|
|
26
|
-
INSERT INTO outcome_execution_state (
|
|
27
|
-
outcome_id, description, agent_id, priority, active_session_key,
|
|
28
|
-
next_action, blocked_reason, ui_locale, source, project_id,
|
|
29
|
-
context_text, context_attachments_json, created_at, updated_at
|
|
30
|
-
)
|
|
31
|
-
SELECT
|
|
32
|
-
goals.outcome_id, goals.description, goals.agent_id, goals.priority,
|
|
33
|
-
goals.active_session_key, goals.next_action, goals.blocked_reason,
|
|
34
|
-
goals.ui_locale, goals.source, goals.project_id,
|
|
35
|
-
goal_context_messages.text,
|
|
36
|
-
COALESCE(goal_context_messages.attachments_json, '[]'),
|
|
37
|
-
goals.created_at, goals.updated_at
|
|
38
|
-
FROM goals
|
|
39
|
-
LEFT JOIN goal_context_messages ON goal_context_messages.goal_id = goals.goal_id
|
|
40
|
-
WHERE goals.outcome_id IS NOT NULL;
|
|
41
|
-
|
|
42
|
-
CREATE TABLE outcome_queue (
|
|
43
|
-
queue_id TEXT PRIMARY KEY,
|
|
44
|
-
outcome_id TEXT NOT NULL,
|
|
45
|
-
status TEXT NOT NULL,
|
|
46
|
-
payload_json TEXT NOT NULL,
|
|
47
|
-
attempts INTEGER NOT NULL,
|
|
48
|
-
max_retries INTEGER NOT NULL,
|
|
49
|
-
enqueued_at INTEGER NOT NULL,
|
|
50
|
-
started_at INTEGER,
|
|
51
|
-
finished_at INTEGER,
|
|
52
|
-
next_run_at INTEGER,
|
|
53
|
-
session_key TEXT,
|
|
54
|
-
last_error TEXT,
|
|
55
|
-
source TEXT NOT NULL,
|
|
56
|
-
FOREIGN KEY (outcome_id) REFERENCES outcomes(outcome_id) ON DELETE CASCADE
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
CREATE INDEX idx_outcome_queue_status_next
|
|
60
|
-
ON outcome_queue(status, next_run_at, enqueued_at);
|
|
61
|
-
CREATE INDEX idx_outcome_queue_outcome_status
|
|
62
|
-
ON outcome_queue(outcome_id, status);
|
|
63
|
-
CREATE INDEX idx_outcome_queue_enqueued
|
|
64
|
-
ON outcome_queue(enqueued_at DESC);
|
|
65
|
-
|
|
66
|
-
INSERT INTO outcome_queue (
|
|
67
|
-
queue_id, outcome_id, status, payload_json, attempts, max_retries,
|
|
68
|
-
enqueued_at, started_at, finished_at, next_run_at, session_key,
|
|
69
|
-
last_error, source
|
|
70
|
-
)
|
|
71
|
-
SELECT
|
|
72
|
-
goal_queue.queue_id, goals.outcome_id, goal_queue.status,
|
|
73
|
-
goal_queue.payload_json, goal_queue.attempts, goal_queue.max_retries,
|
|
74
|
-
goal_queue.enqueued_at, goal_queue.started_at, goal_queue.finished_at,
|
|
75
|
-
goal_queue.next_run_at, goal_queue.session_key, goal_queue.last_error,
|
|
76
|
-
goal_queue.source
|
|
77
|
-
FROM goal_queue
|
|
78
|
-
JOIN goals ON goals.goal_id = goal_queue.goal_id
|
|
79
|
-
WHERE goals.outcome_id IS NOT NULL;
|
|
80
|
-
|
|
81
|
-
ALTER TABLE workflow_runs ADD COLUMN outcome_id TEXT;
|
|
82
|
-
UPDATE workflow_runs
|
|
83
|
-
SET outcome_id = (
|
|
84
|
-
SELECT goals.outcome_id FROM goals WHERE goals.goal_id = workflow_runs.goal_id
|
|
85
|
-
)
|
|
86
|
-
WHERE goal_id IS NOT NULL;
|
|
87
|
-
CREATE INDEX idx_workflow_runs_outcome_created
|
|
88
|
-
ON workflow_runs(outcome_id, created_at_ms DESC);
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
CREATE TABLE outcome_links_next (
|
|
2
|
-
outcome_id TEXT NOT NULL,
|
|
3
|
-
subject_kind TEXT NOT NULL CHECK (subject_kind IN (
|
|
4
|
-
'project', 'work_item', 'session', 'workflow',
|
|
5
|
-
'automation', 'artifact', 'source'
|
|
6
|
-
)),
|
|
7
|
-
subject_id TEXT NOT NULL,
|
|
8
|
-
relation TEXT NOT NULL DEFAULT 'supports',
|
|
9
|
-
created_at INTEGER NOT NULL,
|
|
10
|
-
PRIMARY KEY (outcome_id, subject_kind, subject_id),
|
|
11
|
-
FOREIGN KEY (outcome_id) REFERENCES outcomes(outcome_id) ON DELETE CASCADE
|
|
12
|
-
);
|
|
13
|
-
INSERT INTO outcome_links_next
|
|
14
|
-
SELECT outcome_id, subject_kind, subject_id, relation, created_at
|
|
15
|
-
FROM outcome_links WHERE subject_kind <> 'goal';
|
|
16
|
-
DROP TABLE outcome_links;
|
|
17
|
-
ALTER TABLE outcome_links_next RENAME TO outcome_links;
|
|
18
|
-
CREATE INDEX idx_outcome_links_subject ON outcome_links(subject_kind, subject_id);
|
|
19
|
-
|
|
20
|
-
CREATE TABLE execution_receipts_next (
|
|
21
|
-
run_id TEXT PRIMARY KEY,
|
|
22
|
-
session_key TEXT NOT NULL,
|
|
23
|
-
channel TEXT NOT NULL,
|
|
24
|
-
objective TEXT NOT NULL,
|
|
25
|
-
status TEXT NOT NULL CHECK (status IN ('running', 'succeeded', 'failed', 'cancelled')),
|
|
26
|
-
summary TEXT,
|
|
27
|
-
contract_json TEXT,
|
|
28
|
-
evidence_json TEXT NOT NULL DEFAULT '[]',
|
|
29
|
-
feedback_outcome TEXT CHECK (feedback_outcome IN ('helpful', 'not_helpful')),
|
|
30
|
-
feedback_reason TEXT,
|
|
31
|
-
needs_correction INTEGER CHECK (needs_correction IN (0, 1)),
|
|
32
|
-
support_fit INTEGER CHECK (support_fit IN (0, 1)),
|
|
33
|
-
started_at INTEGER NOT NULL,
|
|
34
|
-
completed_at INTEGER,
|
|
35
|
-
updated_at INTEGER NOT NULL,
|
|
36
|
-
verification_status TEXT NOT NULL DEFAULT 'unverified'
|
|
37
|
-
CHECK (verification_status IN ('passed', 'failed', 'unverified')),
|
|
38
|
-
verification_json TEXT NOT NULL DEFAULT '{"checks":[]}',
|
|
39
|
-
failure_code TEXT,
|
|
40
|
-
failure_phase TEXT,
|
|
41
|
-
recovery_action TEXT,
|
|
42
|
-
project_id TEXT,
|
|
43
|
-
work_item_id TEXT,
|
|
44
|
-
origin TEXT,
|
|
45
|
-
trigger_kind TEXT,
|
|
46
|
-
parent_run_id TEXT,
|
|
47
|
-
next_action TEXT,
|
|
48
|
-
needs_user INTEGER NOT NULL DEFAULT 0,
|
|
49
|
-
context_trace_id TEXT,
|
|
50
|
-
completion_verdict TEXT CHECK (completion_verdict IN ('achieved', 'partial', 'not_achieved')),
|
|
51
|
-
completion_verdict_source TEXT CHECK (completion_verdict_source IN ('system', 'user')),
|
|
52
|
-
correction_text TEXT,
|
|
53
|
-
projection_version INTEGER NOT NULL DEFAULT 0,
|
|
54
|
-
projected_at INTEGER,
|
|
55
|
-
outcome_id TEXT,
|
|
56
|
-
contract_version INTEGER,
|
|
57
|
-
attempt INTEGER NOT NULL DEFAULT 1,
|
|
58
|
-
strategy TEXT,
|
|
59
|
-
FOREIGN KEY (session_key) REFERENCES sessions(session_key) ON DELETE CASCADE
|
|
60
|
-
);
|
|
61
|
-
INSERT INTO execution_receipts_next (
|
|
62
|
-
run_id, session_key, channel, objective, status, summary, contract_json,
|
|
63
|
-
evidence_json, feedback_outcome, feedback_reason, needs_correction, support_fit,
|
|
64
|
-
started_at, completed_at, updated_at, verification_status, verification_json,
|
|
65
|
-
failure_code, failure_phase, recovery_action, project_id, work_item_id, origin,
|
|
66
|
-
trigger_kind, parent_run_id, next_action, needs_user, context_trace_id,
|
|
67
|
-
completion_verdict, completion_verdict_source, correction_text, projection_version,
|
|
68
|
-
projected_at, outcome_id, contract_version, attempt, strategy
|
|
69
|
-
)
|
|
70
|
-
SELECT
|
|
71
|
-
run_id, session_key, channel, objective, status, summary, contract_json,
|
|
72
|
-
evidence_json, feedback_outcome, feedback_reason, needs_correction, support_fit,
|
|
73
|
-
started_at, completed_at, updated_at, verification_status, verification_json,
|
|
74
|
-
failure_code, failure_phase, recovery_action, project_id, work_item_id,
|
|
75
|
-
CASE WHEN origin = 'goal' THEN 'outcome' ELSE origin END,
|
|
76
|
-
trigger_kind, parent_run_id, next_action, needs_user, context_trace_id,
|
|
77
|
-
completion_verdict, completion_verdict_source, correction_text, projection_version,
|
|
78
|
-
projected_at, outcome_id, contract_version, attempt, strategy
|
|
79
|
-
FROM execution_receipts;
|
|
80
|
-
DROP TABLE execution_receipts;
|
|
81
|
-
ALTER TABLE execution_receipts_next RENAME TO execution_receipts;
|
|
82
|
-
CREATE INDEX idx_execution_receipts_session_started ON execution_receipts(session_key, started_at DESC);
|
|
83
|
-
CREATE INDEX idx_execution_receipts_status_started ON execution_receipts(status, started_at DESC);
|
|
84
|
-
CREATE INDEX idx_execution_receipts_project_updated ON execution_receipts(project_id, updated_at DESC);
|
|
85
|
-
CREATE INDEX idx_execution_receipts_work_item_updated ON execution_receipts(work_item_id, updated_at DESC);
|
|
86
|
-
CREATE INDEX idx_execution_receipts_unprojected ON execution_receipts(projection_version, completed_at DESC);
|
|
87
|
-
CREATE INDEX idx_execution_receipts_outcome_started ON execution_receipts(outcome_id, started_at DESC);
|
|
88
|
-
|
|
89
|
-
CREATE TABLE work_intakes_next (
|
|
90
|
-
intake_id TEXT PRIMARY KEY,
|
|
91
|
-
idempotency_key TEXT NOT NULL UNIQUE,
|
|
92
|
-
request_fingerprint TEXT NOT NULL,
|
|
93
|
-
objective TEXT NOT NULL,
|
|
94
|
-
proposal_json TEXT NOT NULL,
|
|
95
|
-
session_key TEXT,
|
|
96
|
-
agent_id TEXT,
|
|
97
|
-
status TEXT NOT NULL CHECK (status IN ('proposed', 'confirmed', 'expired', 'cancelled')),
|
|
98
|
-
execution_mode TEXT NOT NULL DEFAULT 'run_now' CHECK (execution_mode IN ('create_only', 'run_now')),
|
|
99
|
-
project_id TEXT,
|
|
100
|
-
queue_id TEXT,
|
|
101
|
-
expires_at INTEGER NOT NULL,
|
|
102
|
-
created_at INTEGER NOT NULL,
|
|
103
|
-
confirmed_at INTEGER,
|
|
104
|
-
updated_at INTEGER NOT NULL,
|
|
105
|
-
outcome_id TEXT,
|
|
106
|
-
FOREIGN KEY (project_id) REFERENCES projects(project_id) ON DELETE SET NULL,
|
|
107
|
-
FOREIGN KEY (outcome_id) REFERENCES outcomes(outcome_id) ON DELETE SET NULL
|
|
108
|
-
);
|
|
109
|
-
INSERT INTO work_intakes_next (
|
|
110
|
-
intake_id, idempotency_key, request_fingerprint, objective, proposal_json,
|
|
111
|
-
session_key, agent_id, status, execution_mode, project_id, queue_id,
|
|
112
|
-
expires_at, created_at, confirmed_at, updated_at, outcome_id
|
|
113
|
-
)
|
|
114
|
-
SELECT intake_id, idempotency_key, request_fingerprint, objective, proposal_json,
|
|
115
|
-
session_key, agent_id, status, execution_mode, project_id, queue_id,
|
|
116
|
-
expires_at, created_at, confirmed_at, updated_at, outcome_id
|
|
117
|
-
FROM work_intakes;
|
|
118
|
-
DROP TABLE work_intakes;
|
|
119
|
-
ALTER TABLE work_intakes_next RENAME TO work_intakes;
|
|
120
|
-
CREATE INDEX idx_work_intakes_status_updated ON work_intakes(status, updated_at DESC);
|
|
121
|
-
CREATE INDEX idx_work_intakes_expires ON work_intakes(status, expires_at);
|
|
122
|
-
|
|
123
|
-
CREATE TABLE workflow_runs_next (
|
|
124
|
-
run_id TEXT PRIMARY KEY,
|
|
125
|
-
agent_id TEXT NOT NULL,
|
|
126
|
-
definition_id TEXT NOT NULL,
|
|
127
|
-
definition_version TEXT NOT NULL,
|
|
128
|
-
outcome_id TEXT,
|
|
129
|
-
session_key TEXT NOT NULL,
|
|
130
|
-
parent_session_key TEXT,
|
|
131
|
-
status TEXT NOT NULL,
|
|
132
|
-
source_kind TEXT NOT NULL,
|
|
133
|
-
source_json TEXT NOT NULL,
|
|
134
|
-
metadata_json TEXT,
|
|
135
|
-
title TEXT NOT NULL,
|
|
136
|
-
created_at_ms INTEGER NOT NULL,
|
|
137
|
-
started_at_ms INTEGER,
|
|
138
|
-
completed_at_ms INTEGER,
|
|
139
|
-
metrics_json TEXT NOT NULL,
|
|
140
|
-
result_preview TEXT,
|
|
141
|
-
error_message TEXT,
|
|
142
|
-
project_id TEXT
|
|
143
|
-
);
|
|
144
|
-
INSERT INTO workflow_runs_next (
|
|
145
|
-
run_id, agent_id, definition_id, definition_version, outcome_id, session_key,
|
|
146
|
-
parent_session_key, status, source_kind, source_json, metadata_json, title,
|
|
147
|
-
created_at_ms, started_at_ms, completed_at_ms, metrics_json, result_preview,
|
|
148
|
-
error_message, project_id
|
|
149
|
-
)
|
|
150
|
-
SELECT run_id, agent_id, definition_id, definition_version, outcome_id, session_key,
|
|
151
|
-
parent_session_key, status, source_kind, source_json, metadata_json, title,
|
|
152
|
-
created_at_ms, started_at_ms, completed_at_ms, metrics_json, result_preview,
|
|
153
|
-
error_message, project_id
|
|
154
|
-
FROM workflow_runs;
|
|
155
|
-
DROP TABLE workflow_runs;
|
|
156
|
-
ALTER TABLE workflow_runs_next RENAME TO workflow_runs;
|
|
157
|
-
CREATE INDEX idx_workflow_runs_created ON workflow_runs(agent_id, created_at_ms DESC);
|
|
158
|
-
CREATE INDEX idx_workflow_runs_status_created ON workflow_runs(agent_id, status, created_at_ms DESC);
|
|
159
|
-
CREATE INDEX idx_workflow_runs_definition_created ON workflow_runs(definition_id, created_at_ms DESC);
|
|
160
|
-
CREATE INDEX idx_workflow_runs_project ON workflow_runs(project_id, created_at_ms DESC);
|
|
161
|
-
CREATE INDEX idx_workflow_runs_outcome_created ON workflow_runs(outcome_id, created_at_ms DESC);
|
|
162
|
-
|
|
163
|
-
DELETE FROM work_item_links WHERE kind = 'goal';
|
|
164
|
-
DELETE FROM work_item_update_suggestions WHERE source_kind = 'goal';
|
|
165
|
-
DELETE FROM work_item_events WHERE type = 'goal_created';
|
|
166
|
-
|
|
167
|
-
DROP TABLE goal_context_messages;
|
|
168
|
-
DROP TABLE goal_queue;
|
|
169
|
-
DROP TABLE goal_checklist_items;
|
|
170
|
-
DROP TABLE goal_runs;
|
|
171
|
-
DROP TABLE goal_events;
|
|
172
|
-
DROP TABLE goal_evidence;
|
|
173
|
-
DROP TABLE goal_session_links;
|
|
174
|
-
DROP TABLE goals;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
CREATE TABLE session_inputs (
|
|
2
|
-
id TEXT PRIMARY KEY,
|
|
3
|
-
session_key TEXT NOT NULL,
|
|
4
|
-
client_message_id TEXT NOT NULL,
|
|
5
|
-
requested_delivery TEXT NOT NULL CHECK (requested_delivery IN ('next', 'steer')),
|
|
6
|
-
effective_delivery TEXT NOT NULL CHECK (effective_delivery IN ('next', 'steer')),
|
|
7
|
-
status TEXT NOT NULL CHECK (status IN (
|
|
8
|
-
'queued', 'running', 'injecting',
|
|
9
|
-
'completed', 'cancelled', 'failed', 'interrupted'
|
|
10
|
-
)),
|
|
11
|
-
content TEXT NOT NULL,
|
|
12
|
-
attachments_json TEXT,
|
|
13
|
-
thinking TEXT,
|
|
14
|
-
position INTEGER NOT NULL,
|
|
15
|
-
target_run_id TEXT,
|
|
16
|
-
run_id TEXT,
|
|
17
|
-
version INTEGER NOT NULL DEFAULT 1,
|
|
18
|
-
error TEXT,
|
|
19
|
-
created_at_ms INTEGER NOT NULL,
|
|
20
|
-
updated_at_ms INTEGER NOT NULL,
|
|
21
|
-
UNIQUE(session_key, client_message_id)
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
CREATE INDEX idx_session_inputs_pending
|
|
25
|
-
ON session_inputs(session_key, status, position, created_at_ms);
|
|
26
|
-
|
|
27
|
-
CREATE TABLE session_input_runtime (
|
|
28
|
-
session_key TEXT PRIMARY KEY,
|
|
29
|
-
active_run_id TEXT,
|
|
30
|
-
active_input_id TEXT,
|
|
31
|
-
revision INTEGER NOT NULL DEFAULT 0,
|
|
32
|
-
updated_at_ms INTEGER NOT NULL
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
ALTER TABLE sessions DROP COLUMN abort_cutoff_timestamp;
|