@xopcai/xopc 0.0.332 → 0.0.334
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/dist/assets/{auth-DocRzRlS.js → auth-Cjj5SuoT.js} +49 -39
- 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 +240 -36
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-C2wg3xC_.js → agent-avatar-dicebear-B73q7mlz.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-B9L2YIXz.js +1 -0
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-BeNnu1Ts.js → agent-plugin-dialog-COOjsvea.js} +1 -1
- package/dist/gateway/static/root/assets/agents-CCj1JnLu.js +70 -0
- package/dist/gateway/static/root/assets/agents-admin-api-Cuqi5xZn.js +2 -0
- package/dist/gateway/static/root/assets/{app-link-C6gA5Nck.js → app-link-DRL0YnPs.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-etFSkfzl.js → app-management-settings-panel-CckioKud.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DKmU2VAP.js → appearance-settings-DDiPIr_Q.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-Azqy8vfo.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-D0z_Fr2G.js → archive-plugin-Dtyr0RhX.js} +1 -1
- package/dist/gateway/static/root/assets/attachment-load-qjPpQzYY.js +1 -0
- package/dist/gateway/static/root/assets/attachment-utils-core-BIOUBrpT.js +1 -0
- package/dist/gateway/static/root/assets/{automations-page-B7_C-p66.js → automations-page-g3SrFkTC.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-B0nW2nZD.js +7 -0
- package/dist/gateway/static/root/assets/binary-plugins-BwKQVxsU.js +2 -0
- package/dist/gateway/static/root/assets/{block-editor-ChWW8Z9L.js → block-editor-DD9d5pCt.js} +29 -29
- package/dist/gateway/static/root/assets/{browser-automation-inputs-C5s1yHOu.js → browser-automation-inputs-D2gNdS3e.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BV00BXRb.js → browser-automations-page-BKqqJR7P.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-settings-page-xwTmuZjS.js → browser-settings-page-BZH9bZbk.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-CHk4RZl4.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-CfWaVH-6.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C5FcWsSe.js +8 -0
- package/dist/gateway/static/root/assets/capability-header-actions-Bd66yEOa.js +1 -0
- package/dist/gateway/static/root/assets/channels-DIU5Gq4o.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-C41mXCAi.js → chat-terminal-dock-B0nPDJyj.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-BJkqok2G.js → computer-settings-page-D7PxxaoG.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BKCZMmwm.js → connector-service-page-BZH4SeQg.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-BC81R_fz.js +2 -0
- package/dist/gateway/static/root/assets/{turn-outcome-D0SnyZ3Z.js → constants-Co2_smKQ.js} +1 -1
- package/dist/gateway/static/root/assets/date-picker-CDEVYjXI.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-CqADAHZp.js → dependency-picker-AInmpSwC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Bab-iWED.js → desktop-pet-Sjgnlq8M.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BqgzLOdi.js → desktop-pet-settings-BWn0rrhr.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DFg7FDPf.js → device-pairing-wizard-BtW837_d.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-hqJ9sFCR.js → directory-picker-path-field-2CpmDx_D.js} +1 -1
- package/dist/gateway/static/root/assets/dist-CKkafhaS.js +1 -0
- package/dist/gateway/static/root/assets/dist-io9jFpN72.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DX3PFhRE.js → extension-debug-page-WWJFj9Z5.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DkREdHLs.js → extension-page-DL00dFRr.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-wF-HNTM-.js → extension-settings-page-CN-agjPk.js} +1 -1
- package/dist/gateway/static/root/assets/{files-BK6enEvD.js → files-Bw4SBGdM.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-cR-tz7-Q.js → gateway-config-swr-CgIjCxM8.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-Ciq4c7KT.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-BHeHN26R.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-4oD6fhAm.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-6jLRcQsu.js → gateway-startup-retry-i-1lTrwY.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-nEpyJUBY.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-CSSkwsyC.js → image-generation-api-gilc-u7M.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-B80Cv043.js → imports-page-BivdeiQ5.js} +1 -1
- package/dist/gateway/static/root/assets/index-BioG1pRD.js +106 -0
- package/dist/gateway/static/root/assets/index-DbLEkdNg.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BgoFaTwv.js → keyboard-shortcuts-settings-B_8AJTFr.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CRtZQrmz.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-HO6OQlQT.js → local-apps-page-DclxpoqR.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-Bpja8nC6.js → local-apps-yys1VChX.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-DkolHmyp.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-wNXWkWu5.js → locale-store-BY30D6tg.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DX8TxkRl.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-5WFufZ4g.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DlT9KqwF.js → markdown-view-DYJnwlDr.js} +1 -1
- package/dist/gateway/static/root/assets/media-plugins-DlJDvwLK.js +1 -0
- package/dist/gateway/static/root/assets/messages-_6IXbP2u.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-GF5Q9Fqy.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-E8o4_Ty9.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-CiCmfRTw.js +1 -0
- package/dist/gateway/static/root/assets/{page-tabs-vqI30Yrg.js → page-tabs-Cwp3fGVM.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-0p9PIHRy.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-B-mwPBJW.js → preview-open-alternatives-DJ5xqGeu.js} +1 -1
- package/dist/gateway/static/root/assets/{product-delivery-bv3z8Xkh.js → product-delivery-BAks11S4.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-D--sj_uN.js → product-open-page-CcGwNePw.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-6hhRBkmC.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DUOzRaFI.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BIpltJ47.js → registry-api-BvVx0G1o.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BWpWUXiE.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CAnb0PNY.js → runtime-tools-settings-panel-C6eDCNHz.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-pF7Lmqnk.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-BKj6wIMb.js → schema-form-D8W8q_ez.js} +1 -1
- package/dist/gateway/static/root/assets/{schemas-88fK3zzl.js → schemas-CObaziC7.js} +3 -3
- package/dist/gateway/static/root/assets/session-api-BAyUr97V.js +1 -0
- package/dist/gateway/static/root/assets/session-manager-BAy2sR2Q.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-BDKDqqf9.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-C9cJWlAq.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-78ycUHfv.js → settings-form-section-B0cAj0nq.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BOdxIVzo.js → settings-page-DZVVTFxs.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DZCPVx9c.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-BkPNyV8c.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-Bqlv5JBi.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-CiBGQ0Jg.js → skill-api-C0dufzQC.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-3JF2OTBz.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DB4lR4om.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-CyJUeREH.js → system-settings-panel-xjrlhdUz.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CB6M7wSs.js +1 -0
- package/dist/gateway/static/root/assets/{tasks-CDR_RVbQ.js → tasks-QQJXsiER.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-Day9zhKi.js → tunnel-api--68MQEWM.js} +1 -1
- package/dist/gateway/static/root/assets/usage-page-OLZ00eqD.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-Bj9hC6ML.js → use-autosave-DsnHYpTv.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-CoePFpHD.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-fWRD6B8r.js → voice-api-key-field-CvIXutQp.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-ujEySjyc.js → voice-config-api-Bwy3Al3J.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CnxdvIk8.js → work-discovery-overlay-By5_7MLR.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DlWNN1VA.js → workflow-run-setup-panel-HSMDxDXV.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DElQ47Da.js +6 -0
- package/dist/gateway/static/root/index.html +27 -21
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +44 -14
- package/dist/packages/gateway-contract/src/capabilities.js +120 -10
- package/dist/packages/gateway-contract/src/index.js +8 -2
- package/dist/packages/gateway-contract/src/scenes.js +7 -6
- package/dist/packages/gateway-contract/src/session-command-rejection.js +19 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +109 -0
- package/dist/packages/gateway-contract/src/sessions.js +2 -7
- package/dist/packages/gateway-contract/src/usage.js +6 -0
- package/dist/src/agent/agent-manager.js +15 -9
- package/dist/src/agent/background-review/run-background-review.js +8 -3
- package/dist/src/agent/bootstrap/filter-bootstrap-files.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 +7 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/gateway-tools.d.ts +2 -1
- package/dist/src/agent/external-tools/gateway-tools.js +45 -11
- package/dist/src/agent/external-tools/index.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +2 -2
- package/dist/src/agent/image/understanding/pi-ai-provider.js +1 -1
- package/dist/src/agent/memory/compaction.js +4 -0
- package/dist/src/agent/service/btw-query.js +8 -2
- package/dist/src/agent/service/process-direct-streaming.js +4 -2
- package/dist/src/agent/service.js +5 -5
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +2 -2
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +7 -3
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +5 -4
- package/dist/src/agent/tools/automation-tool.d.ts +4 -1
- package/dist/src/agent/tools/automation-tool.js +42 -4
- package/dist/src/agent/tools/session-search-tool.js +1 -1
- package/dist/src/agent/tools/web-extract.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +50 -9
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/ai-assist/text-assist.js +6 -2
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/api/routes.js +65 -0
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/read.js +24 -0
- package/dist/src/automations/capabilities/write.d.ts +52 -14
- package/dist/src/automations/capabilities/write.js +52 -3
- package/dist/src/automations/delivery/delivery-router.d.ts +50 -0
- package/dist/src/automations/delivery/delivery-router.js +318 -0
- package/dist/src/automations/delivery/index.d.ts +1 -0
- package/dist/src/automations/delivery/index.js +2 -0
- package/dist/src/automations/domain/defaults.d.ts +0 -1
- package/dist/src/automations/domain/defaults.js +1 -1
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/domain/types.d.ts +158 -7
- package/dist/src/automations/domain/validation.d.ts +104 -22
- package/dist/src/automations/domain/validation.js +66 -13
- package/dist/src/automations/draft/automation-draft-prompt.js +3 -4
- package/dist/src/automations/draft/automation-draft-service.js +6 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +22 -3
- package/dist/src/automations/draft/automation-draft-validator.js +4 -4
- package/dist/src/automations/events/event-catalog.d.ts +14 -0
- package/dist/src/automations/events/event-catalog.js +117 -0
- package/dist/src/automations/events/event-dispatcher.d.ts +27 -0
- package/dist/src/automations/events/event-dispatcher.js +140 -0
- package/dist/src/automations/events/event-repository.d.ts +59 -0
- package/dist/src/automations/events/event-repository.js +361 -0
- package/dist/src/automations/events/index.d.ts +3 -0
- package/dist/src/automations/events/index.js +4 -0
- package/dist/src/automations/index.d.ts +3 -1
- package/dist/src/automations/index.js +9 -3
- package/dist/src/automations/service/action-executor.d.ts +20 -1
- package/dist/src/automations/service/action-executor.js +80 -40
- package/dist/src/automations/service/automation-service.d.ts +21 -4
- package/dist/src/automations/service/automation-service.js +150 -100
- package/dist/src/automations/storage/automation-repository.js +4 -5
- package/dist/src/automations/storage/automation-run-repository.d.ts +1 -0
- package/dist/src/automations/storage/automation-run-repository.js +26 -1
- package/dist/src/automations/storage/index.js +2 -2
- package/dist/src/automations/webhook-secrets.d.ts +1 -0
- package/dist/src/automations/webhook-secrets.js +16 -0
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/capabilities/store-connector.d.ts +17 -1
- package/dist/src/capabilities/store-connector.js +69 -3
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/connectors.js +4 -3
- package/dist/src/cli/commands/doctor/checks/automation-integrity.d.ts +2 -0
- package/dist/src/cli/commands/doctor/checks/automation-integrity.js +55 -0
- package/dist/src/cli/commands/doctor/checks/database-relations.d.ts +2 -0
- package/dist/src/cli/commands/doctor/checks/database-relations.js +81 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
- package/dist/src/cli/commands/doctor/flow.js +5 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/commands/skills.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.js +1 -1
- package/dist/src/connectors/approval-resume.js +1 -1
- package/dist/src/connectors/cli/authorization.d.ts +1 -1
- package/dist/src/connectors/cli/store.d.ts +1 -1
- package/dist/src/connectors/cli/store.js +1 -1
- package/dist/src/connectors/composio-backends.js +14 -4
- package/dist/src/connectors/composio-managed-events.d.ts +5 -2
- package/dist/src/connectors/composio-managed-events.js +4 -1
- package/dist/src/connectors/connection-candidates.js +53 -15
- package/dist/src/connectors/connection-capabilities.js +5 -1
- package/dist/src/connectors/connection-recovery-service.d.ts +2 -1
- package/dist/src/connectors/connection-recovery-service.js +89 -4
- package/dist/src/discussions/analyzer.js +4 -4
- package/dist/src/execution-environments/local-worktree-manager.js +10 -1
- package/dist/src/execution-environments/session-environment-service.d.ts +3 -0
- package/dist/src/execution-environments/session-environment-service.js +28 -4
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/home-intelligence-automation-reconciler.js +4 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +6 -2
- package/dist/src/gateway/hono/routes/browser-session.js +4 -2
- package/dist/src/gateway/hono/routes/capabilities.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +9 -2
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/connection-waits.js +3 -2
- package/dist/src/gateway/hono/routes/files.js +3 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +14 -1
- package/dist/src/gateway/hono/routes/models.js +17 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -4
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/public-gateway.js +93 -3
- package/dist/src/gateway/hono/routes/scenes.js +57 -41
- package/dist/src/gateway/hono/routes/session-command-handler.d.ts +5 -0
- package/dist/src/gateway/hono/routes/session-command-handler.js +189 -0
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +14 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +2 -2
- package/dist/src/gateway/hono/routes/sessions.js +15 -168
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/tui.js +2 -1
- package/dist/src/gateway/hono/routes/usage.d.ts +3 -0
- package/dist/src/gateway/hono/routes/usage.js +61 -0
- package/dist/src/gateway/hono/routes/voice.js +10 -1
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/memory-maintenance-automation-reconciler.js +5 -2
- package/dist/src/gateway/resolve-webchat-session-key.d.ts +1 -1
- package/dist/src/gateway/resolve-webchat-session-key.js +2 -2
- package/dist/src/gateway/scenes/host.js +27 -14
- package/dist/src/gateway/scenes/slackThreadSource.d.ts +2 -2
- package/dist/src/gateway/security/gateway-scopes.js +1 -0
- package/dist/src/gateway/service/active-execution.d.ts +19 -0
- package/dist/src/gateway/service/active-execution.js +16 -0
- package/dist/src/gateway/service/agent-runner.d.ts +4 -0
- package/dist/src/gateway/service/agent-runner.js +19 -1
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.d.ts +2 -0
- package/dist/src/gateway/service/run-gateway-agent.js +10 -2
- package/dist/src/gateway/service/session-command-service.d.ts +34 -0
- package/dist/src/gateway/service/session-command-service.js +81 -0
- package/dist/src/gateway/service/session-input-coordinator.d.ts +21 -0
- package/dist/src/gateway/service/session-input-coordinator.js +41 -0
- package/dist/src/gateway/service/session-preparation-worker.d.ts +15 -0
- package/dist/src/gateway/service/session-preparation-worker.js +125 -0
- package/dist/src/gateway/service/sessions-api.d.ts +13 -0
- package/dist/src/gateway/service/sessions-api.js +23 -0
- package/dist/src/gateway/service.d.ts +30 -3
- package/dist/src/gateway/service.js +89 -79
- package/dist/src/gateway/side-chat/promotion-service.js +0 -1
- package/dist/src/gateway/side-chat/run-service.js +10 -7
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/generator.js +5 -2
- package/dist/src/infra/domain-outbox-dispatcher.d.ts +0 -3
- package/dist/src/infra/domain-outbox-dispatcher.js +15 -7
- package/dist/src/local-apps/service.js +2 -2
- package/dist/src/mcp/channel-bridge.js +12 -2
- package/dist/src/notes/capabilities/read.js +2 -2
- package/dist/src/notes/service.d.ts +4 -1
- package/dist/src/notes/service.js +13 -11
- package/dist/src/projects/project-service.js +1 -2
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-call.d.ts +3 -2
- package/dist/src/providers/model-call.js +30 -5
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/scenes/activationAdapter.d.ts +19 -0
- package/dist/src/scenes/activationAdapter.js +1 -0
- package/dist/src/scenes/agentExecutor.js +3 -10
- package/dist/src/scenes/contracts.d.ts +3 -9
- package/dist/src/scenes/contracts.js +1 -0
- package/dist/src/scenes/execution.d.ts +9 -3
- package/dist/src/scenes/execution.js +12 -11
- package/dist/src/scenes/httpServices.d.ts +5 -2
- package/dist/src/scenes/mailContext.d.ts +4 -0
- package/dist/src/scenes/mailContext.js +9 -0
- package/dist/src/scenes/maintenance.js +1 -5
- package/dist/src/scenes/metrics.d.ts +0 -6
- package/dist/src/scenes/metrics.js +0 -11
- package/dist/src/scenes/registry.d.ts +11 -0
- package/dist/src/scenes/registry.js +28 -0
- package/dist/src/scenes/repository.d.ts +6 -3
- package/dist/src/scenes/repository.js +43 -5
- package/dist/src/scenes/service.d.ts +2 -1
- package/dist/src/scenes/service.js +9 -7
- package/dist/src/scenes/taskFollowUp/contracts.d.ts +37 -7
- package/dist/src/scenes/taskFollowUp/contracts.js +36 -17
- package/dist/src/scenes/taskFollowUp/service.d.ts +35 -7
- package/dist/src/scenes/taskFollowUp/service.js +86 -28
- package/dist/src/scenes/templates.d.ts +2 -2
- package/dist/src/scenes/userNotes.d.ts +3 -0
- package/dist/src/scenes/userNotes.js +6 -0
- package/dist/src/session/client-history.d.ts +3 -0
- package/dist/src/session/client-history.js +10 -5
- package/dist/src/session/manager.d.ts +1 -0
- package/dist/src/session/resolve-session.js +4 -3
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.d.ts +1 -0
- package/dist/src/session/store.js +3 -3
- package/dist/src/storage/sqlite/ai-usage-repository.d.ts +137 -0
- package/dist/src/storage/sqlite/ai-usage-repository.js +175 -0
- package/dist/src/storage/sqlite/connector-account-repository.js +7 -5
- package/dist/src/storage/sqlite/connector-repository.js +36 -34
- package/dist/src/storage/sqlite/index.d.ts +2 -2
- package/dist/src/storage/sqlite/index.js +3 -3
- package/dist/src/storage/sqlite/migrations/209_automation_event_hub.sql +48 -0
- package/dist/src/storage/sqlite/migrations/210_remove_legacy_automation_timeout.sql +14 -0
- package/dist/src/storage/sqlite/migrations/211_automation_result_deliveries.sql +16 -0
- package/dist/src/storage/sqlite/migrations/212_automation_delivery_policy.sql +30 -0
- package/dist/src/storage/sqlite/migrations/213_automation_reliability_contract.sql +188 -0
- package/dist/src/storage/sqlite/migrations/214_ai_usage_ledger.sql +41 -0
- package/dist/src/storage/sqlite/migrations/215_scene_execution_adapters.sql +6 -0
- package/dist/src/storage/sqlite/migrations/216_remove_scene_model_usage.sql +1 -0
- package/dist/src/storage/sqlite/migrations/217_remove_legacy_memory_tables.sql +4 -0
- package/dist/src/storage/sqlite/migrations/218_core_relation_indexes.sql +26 -0
- package/dist/src/storage/sqlite/migrations/219_json_contracts.sql +123 -0
- package/dist/src/storage/sqlite/migrations/220_normalize_timestamps.sql +339 -0
- package/dist/src/storage/sqlite/migrations/221_ai_usage_retention_index.sql +2 -0
- package/dist/src/storage/sqlite/migrations/222_session_config_authority.sql +13 -0
- package/dist/src/storage/sqlite/migrations/223_session_creation_receipts.sql +59 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +4 -4
- package/dist/src/storage/sqlite/row-mappers.d.ts +3 -7
- package/dist/src/storage/sqlite/row-mappers.js +6 -6
- package/dist/src/storage/sqlite/scenes-schema.d.ts +1 -1
- package/dist/src/storage/sqlite/scenes-schema.js +0 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +0 -52
- package/dist/src/storage/sqlite/schemas/scenes.sql +0 -7
- package/dist/src/storage/sqlite/session-creation-repository.d.ts +50 -0
- package/dist/src/storage/sqlite/session-creation-repository.js +166 -0
- package/dist/src/storage/sqlite/session-input-repository.d.ts +12 -2
- package/dist/src/storage/sqlite/session-input-repository.js +25 -2
- package/dist/src/storage/sqlite/session-read-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/session-read-repository.js +0 -1
- package/dist/src/storage/sqlite/session-repository.d.ts +0 -4
- package/dist/src/storage/sqlite/session-repository.js +8 -18
- package/dist/src/storage/sqlite/timestamps.d.ts +4 -0
- package/dist/src/storage/sqlite/timestamps.js +20 -0
- package/dist/src/storage/sqlite/transcript-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/transcript-repository.js +23 -15
- package/dist/src/storage/sqlite/user-trust-repository.js +4 -2
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.d.ts +1 -1
- package/dist/src/tasks/home-query-service.js +3 -3
- package/dist/src/tasks/task-contract-planner.js +1 -1
- package/dist/src/tui/backends/embedded-backend.d.ts +5 -0
- package/dist/src/tui/backends/embedded-backend.js +266 -20
- package/dist/src/tui/backends/embedded-drafts.d.ts +22 -0
- package/dist/src/tui/backends/embedded-drafts.js +53 -0
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +10 -0
- package/dist/src/tui/backends/gateway-realtime-backend.js +214 -33
- package/dist/src/tui/tui-backend.d.ts +1 -1
- package/dist/src/tui/tui-chat-input-state.d.ts +1 -0
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-session-format.js +0 -1
- package/dist/src/tui/tui-startup-resources.d.ts +1 -0
- package/dist/src/tui/tui-startup-resources.js +2 -2
- package/dist/src/tui/tui-types.d.ts +0 -1
- package/dist/src/tui/tui.js +69 -29
- package/dist/src/usage/cost.d.ts +4 -0
- package/dist/src/usage/cost.js +28 -0
- package/dist/src/usage/recorder.d.ts +13 -0
- package/dist/src/usage/recorder.js +117 -0
- package/dist/src/usage/scenario-registry.d.ts +8 -0
- package/dist/src/usage/scenario-registry.js +117 -0
- package/dist/src/usage/types.d.ts +55 -0
- package/dist/src/usage/types.js +1 -0
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/tts/summarize.js +1 -1
- package/dist/src/work-discovery/analyzer.js +2 -2
- package/dist/src/work-discovery/investigator.js +1 -1
- package/dist/src/work-discovery/service.js +3 -6
- package/dist/src/workflows/service/workflow-run-service.js +16 -3
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Se1Z72VG.js +0 -1
- package/dist/gateway/static/root/assets/agents-udIitwV8.js +0 -70
- package/dist/gateway/static/root/assets/apps-page-DVNySL58.js +0 -1
- package/dist/gateway/static/root/assets/attachment-load-DNCDbeOX.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-BMgJvdcv.js +0 -7
- package/dist/gateway/static/root/assets/binary-plugins-BYn2hScX.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-CHA-sTAZ.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-v0WkhV5o.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DefBGjhV.js +0 -8
- package/dist/gateway/static/root/assets/capability-header-actions-vmx35sbu.js +0 -1
- package/dist/gateway/static/root/assets/channels-Eo4ONF5X.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DZYgogQw.js +0 -2
- package/dist/gateway/static/root/assets/conversation-identity-Cw0n9uzK.js +0 -1
- package/dist/gateway/static/root/assets/date-picker-CrOV4Ynd.js +0 -1
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +0 -1
- package/dist/gateway/static/root/assets/dist-Che_jiQF.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-Du-Dos9O.js +0 -1
- package/dist/gateway/static/root/assets/home-page-D7YoMHq4.js +0 -1
- package/dist/gateway/static/root/assets/index-BEw0xrde.css +0 -1
- package/dist/gateway/static/root/assets/index-DalslRUx.js +0 -121
- package/dist/gateway/static/root/assets/local-app-workbench-page-BKL5UZAj.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-CjzR9Rpj.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-Dk_gTJb9.js +0 -1
- package/dist/gateway/static/root/assets/media-plugins-Dlj6TD3M.js +0 -1
- package/dist/gateway/static/root/assets/messages-fmf0dnr4.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-BebJPjjk.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CmS_hvz8.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-BArPtqp5.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-DcsFzD_i.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-BFUdtWXF.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DBsBwAQ6.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BurdDY0m.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-Cj8xtr5t.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-BCsjgkCs.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BLL7csOJ.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CbKHBjrU.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-DyLfktib.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-BzvSNouj.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BHnru0F5.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-C35VKjhb.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-Bd1_Fguk.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-DuYzuR1T.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-B45YDiEw.js +0 -6
- package/dist/src/automations/product-events.d.ts +0 -5
- package/dist/src/automations/product-events.js +0 -19
- package/dist/src/tui/tui-empty-session-cleanup.d.ts +0 -9
- package/dist/src/tui/tui-empty-session-cleanup.js +0 -19
- /package/dist/gateway/static/root/assets/{dist-CI_fqRk-.js → dist-CI_fqRk-2.js} +0 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
CREATE TABLE sessions_next (
|
|
2
|
+
conversation_id TEXT PRIMARY KEY,
|
|
3
|
+
agent_id TEXT NOT NULL,
|
|
4
|
+
active_transcript_id TEXT NOT NULL UNIQUE,
|
|
5
|
+
status TEXT NOT NULL DEFAULT 'active',
|
|
6
|
+
name TEXT,
|
|
7
|
+
tags_json TEXT NOT NULL DEFAULT '[]',
|
|
8
|
+
created_at INTEGER NOT NULL,
|
|
9
|
+
updated_at INTEGER NOT NULL,
|
|
10
|
+
last_accessed_at INTEGER NOT NULL,
|
|
11
|
+
session_started_at INTEGER,
|
|
12
|
+
last_interaction_at INTEGER,
|
|
13
|
+
source_channel TEXT NOT NULL DEFAULT '',
|
|
14
|
+
source_chat_id TEXT NOT NULL DEFAULT '',
|
|
15
|
+
session_type TEXT,
|
|
16
|
+
hidden_from_session_list INTEGER NOT NULL DEFAULT 0,
|
|
17
|
+
parent_conversation_id TEXT,
|
|
18
|
+
workflow_run_id TEXT,
|
|
19
|
+
workflow_definition_id TEXT,
|
|
20
|
+
workflow_agent_id TEXT,
|
|
21
|
+
workflow_agent_label TEXT,
|
|
22
|
+
routing_json TEXT,
|
|
23
|
+
custom_data_json TEXT,
|
|
24
|
+
message_count INTEGER NOT NULL DEFAULT 0,
|
|
25
|
+
estimated_tokens INTEGER NOT NULL DEFAULT 0,
|
|
26
|
+
compacted_count INTEGER NOT NULL DEFAULT 0,
|
|
27
|
+
last_flushed_at INTEGER,
|
|
28
|
+
flush_count INTEGER NOT NULL DEFAULT 0,
|
|
29
|
+
thinking_level TEXT,
|
|
30
|
+
verbose_level TEXT,
|
|
31
|
+
project_id TEXT
|
|
32
|
+
);
|
|
33
|
+
INSERT INTO sessions_next SELECT
|
|
34
|
+
conversation_id, agent_id, active_transcript_id, status, name, tags_json, created_at,
|
|
35
|
+
updated_at, last_accessed_at, session_started_at, last_interaction_at, source_channel,
|
|
36
|
+
source_chat_id, session_type, hidden_from_session_list, parent_conversation_id,
|
|
37
|
+
workflow_run_id, workflow_definition_id, workflow_agent_id, workflow_agent_label,
|
|
38
|
+
routing_json, custom_data_json, message_count, estimated_tokens, compacted_count,
|
|
39
|
+
CASE WHEN last_flushed_at IS NULL THEN NULL
|
|
40
|
+
WHEN typeof(last_flushed_at) IN ('integer', 'real') THEN CAST(last_flushed_at AS INTEGER)
|
|
41
|
+
ELSE CAST(ROUND((julianday(last_flushed_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
42
|
+
flush_count, thinking_level, verbose_level, project_id
|
|
43
|
+
FROM sessions;
|
|
44
|
+
DROP TABLE sessions;
|
|
45
|
+
ALTER TABLE sessions_next RENAME TO sessions;
|
|
46
|
+
CREATE INDEX idx_sessions_agent_updated ON sessions(agent_id, updated_at DESC);
|
|
47
|
+
CREATE INDEX idx_sessions_last_interaction ON sessions(last_interaction_at DESC);
|
|
48
|
+
CREATE INDEX idx_sessions_parent ON sessions(parent_conversation_id);
|
|
49
|
+
CREATE INDEX idx_sessions_project ON sessions(project_id, updated_at DESC);
|
|
50
|
+
CREATE INDEX idx_sessions_source_channel ON sessions(source_channel);
|
|
51
|
+
CREATE INDEX idx_sessions_status ON sessions(status);
|
|
52
|
+
CREATE INDEX idx_sessions_type ON sessions(session_type);
|
|
53
|
+
CREATE INDEX idx_sessions_workflow_run ON sessions(workflow_run_id);
|
|
54
|
+
|
|
55
|
+
CREATE TABLE connector_catalog_entries_next (
|
|
56
|
+
connector_id TEXT PRIMARY KEY,
|
|
57
|
+
provider TEXT NOT NULL,
|
|
58
|
+
definition_json TEXT NOT NULL,
|
|
59
|
+
fetched_at INTEGER NOT NULL,
|
|
60
|
+
expires_at INTEGER
|
|
61
|
+
);
|
|
62
|
+
INSERT INTO connector_catalog_entries_next SELECT
|
|
63
|
+
connector_id, provider, definition_json,
|
|
64
|
+
CASE WHEN typeof(fetched_at) IN ('integer', 'real') THEN CAST(fetched_at AS INTEGER)
|
|
65
|
+
ELSE CAST(ROUND((julianday(fetched_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
66
|
+
CASE WHEN expires_at IS NULL THEN NULL
|
|
67
|
+
WHEN typeof(expires_at) IN ('integer', 'real') THEN CAST(expires_at AS INTEGER)
|
|
68
|
+
ELSE CAST(ROUND((julianday(expires_at) - 2440587.5) * 86400000) AS INTEGER) END
|
|
69
|
+
FROM connector_catalog_entries;
|
|
70
|
+
DROP TABLE connector_catalog_entries;
|
|
71
|
+
ALTER TABLE connector_catalog_entries_next RENAME TO connector_catalog_entries;
|
|
72
|
+
CREATE INDEX idx_connector_catalog_provider ON connector_catalog_entries(provider, fetched_at DESC);
|
|
73
|
+
|
|
74
|
+
CREATE TABLE connector_installations_next (
|
|
75
|
+
id TEXT PRIMARY KEY,
|
|
76
|
+
connector_id TEXT NOT NULL,
|
|
77
|
+
principal_id TEXT NOT NULL,
|
|
78
|
+
enabled INTEGER NOT NULL DEFAULT 1 CHECK(enabled IN (0, 1)),
|
|
79
|
+
allowed_agent_ids_json TEXT NOT NULL DEFAULT '[]',
|
|
80
|
+
max_scope TEXT NOT NULL DEFAULT 'read' CHECK(max_scope IN ('read', 'write', 'admin')),
|
|
81
|
+
confirmation_policy TEXT NOT NULL DEFAULT 'writes'
|
|
82
|
+
CHECK(confirmation_policy IN ('always', 'writes', 'admin', 'never')),
|
|
83
|
+
selected_account_ids_json TEXT NOT NULL DEFAULT '[]',
|
|
84
|
+
created_at INTEGER NOT NULL,
|
|
85
|
+
updated_at INTEGER NOT NULL,
|
|
86
|
+
UNIQUE(connector_id, principal_id)
|
|
87
|
+
);
|
|
88
|
+
INSERT INTO connector_installations_next SELECT
|
|
89
|
+
id, connector_id, principal_id, enabled, allowed_agent_ids_json, max_scope,
|
|
90
|
+
confirmation_policy, selected_account_ids_json,
|
|
91
|
+
CASE WHEN typeof(created_at) IN ('integer', 'real') THEN CAST(created_at AS INTEGER)
|
|
92
|
+
ELSE CAST(ROUND((julianday(created_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
93
|
+
CASE WHEN typeof(updated_at) IN ('integer', 'real') THEN CAST(updated_at AS INTEGER)
|
|
94
|
+
ELSE CAST(ROUND((julianday(updated_at) - 2440587.5) * 86400000) AS INTEGER) END
|
|
95
|
+
FROM connector_installations;
|
|
96
|
+
DROP TABLE connector_installations;
|
|
97
|
+
ALTER TABLE connector_installations_next RENAME TO connector_installations;
|
|
98
|
+
CREATE INDEX idx_connector_installations_principal
|
|
99
|
+
ON connector_installations(principal_id, enabled, connector_id);
|
|
100
|
+
|
|
101
|
+
CREATE TABLE connector_accounts_next (
|
|
102
|
+
id TEXT PRIMARY KEY,
|
|
103
|
+
connector_id TEXT NOT NULL,
|
|
104
|
+
principal_id TEXT NOT NULL,
|
|
105
|
+
identity_key TEXT,
|
|
106
|
+
identity_json TEXT NOT NULL DEFAULT '{}',
|
|
107
|
+
current_connection_id TEXT,
|
|
108
|
+
created_at INTEGER NOT NULL,
|
|
109
|
+
updated_at INTEGER NOT NULL,
|
|
110
|
+
label TEXT,
|
|
111
|
+
enabled INTEGER NOT NULL DEFAULT 1,
|
|
112
|
+
allowed_agent_ids_json TEXT,
|
|
113
|
+
backend_id TEXT,
|
|
114
|
+
runtime_instance_id TEXT
|
|
115
|
+
);
|
|
116
|
+
INSERT INTO connector_accounts_next SELECT
|
|
117
|
+
id, connector_id, principal_id, identity_key, identity_json, current_connection_id,
|
|
118
|
+
CASE WHEN typeof(created_at) IN ('integer', 'real') THEN CAST(created_at AS INTEGER)
|
|
119
|
+
ELSE CAST(ROUND((julianday(created_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
120
|
+
CASE WHEN typeof(updated_at) IN ('integer', 'real') THEN CAST(updated_at AS INTEGER)
|
|
121
|
+
ELSE CAST(ROUND((julianday(updated_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
122
|
+
label, enabled, allowed_agent_ids_json, backend_id, runtime_instance_id
|
|
123
|
+
FROM connector_accounts;
|
|
124
|
+
DROP TABLE connector_accounts;
|
|
125
|
+
ALTER TABLE connector_accounts_next RENAME TO connector_accounts;
|
|
126
|
+
CREATE UNIQUE INDEX idx_cli_account_identity
|
|
127
|
+
ON connector_accounts(principal_id, runtime_instance_id, identity_key)
|
|
128
|
+
WHERE runtime_instance_id IS NOT NULL AND identity_key IS NOT NULL;
|
|
129
|
+
CREATE UNIQUE INDEX idx_connector_accounts_identity
|
|
130
|
+
ON connector_accounts(principal_id, backend_id, connector_id, identity_key)
|
|
131
|
+
WHERE identity_key IS NOT NULL;
|
|
132
|
+
|
|
133
|
+
CREATE TABLE connector_connections_next (
|
|
134
|
+
id TEXT PRIMARY KEY,
|
|
135
|
+
installation_id TEXT REFERENCES connector_installations(id) ON DELETE SET NULL,
|
|
136
|
+
connector_id TEXT NOT NULL,
|
|
137
|
+
provider TEXT NOT NULL,
|
|
138
|
+
principal_id TEXT NOT NULL,
|
|
139
|
+
provider_connection_id TEXT NOT NULL,
|
|
140
|
+
alias TEXT,
|
|
141
|
+
identity_json TEXT NOT NULL DEFAULT '{}',
|
|
142
|
+
status TEXT NOT NULL DEFAULT 'unknown'
|
|
143
|
+
CHECK(status IN ('pending', 'active', 'expired', 'failed', 'revoked', 'disabled', 'unknown')),
|
|
144
|
+
is_default INTEGER NOT NULL DEFAULT 0 CHECK(is_default IN (0, 1)),
|
|
145
|
+
connected_at INTEGER,
|
|
146
|
+
expires_at INTEGER,
|
|
147
|
+
last_error TEXT,
|
|
148
|
+
metadata_json TEXT NOT NULL DEFAULT '{}',
|
|
149
|
+
created_at INTEGER NOT NULL,
|
|
150
|
+
updated_at INTEGER NOT NULL,
|
|
151
|
+
account_id TEXT REFERENCES connector_accounts(id) ON DELETE CASCADE
|
|
152
|
+
);
|
|
153
|
+
INSERT INTO connector_connections_next SELECT
|
|
154
|
+
id, installation_id, connector_id, provider, principal_id, provider_connection_id,
|
|
155
|
+
alias, identity_json, status, is_default,
|
|
156
|
+
CASE WHEN connected_at IS NULL THEN NULL
|
|
157
|
+
WHEN typeof(connected_at) IN ('integer', 'real') THEN CAST(connected_at AS INTEGER)
|
|
158
|
+
ELSE CAST(ROUND((julianday(connected_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
159
|
+
CASE WHEN expires_at IS NULL THEN NULL
|
|
160
|
+
WHEN typeof(expires_at) IN ('integer', 'real') THEN CAST(expires_at AS INTEGER)
|
|
161
|
+
ELSE CAST(ROUND((julianday(expires_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
162
|
+
last_error, metadata_json,
|
|
163
|
+
CASE WHEN typeof(created_at) IN ('integer', 'real') THEN CAST(created_at AS INTEGER)
|
|
164
|
+
ELSE CAST(ROUND((julianday(created_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
165
|
+
CASE WHEN typeof(updated_at) IN ('integer', 'real') THEN CAST(updated_at AS INTEGER)
|
|
166
|
+
ELSE CAST(ROUND((julianday(updated_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
167
|
+
account_id
|
|
168
|
+
FROM connector_connections;
|
|
169
|
+
DROP TABLE connector_connections;
|
|
170
|
+
ALTER TABLE connector_connections_next RENAME TO connector_connections;
|
|
171
|
+
CREATE INDEX idx_connector_connections_account ON connector_connections(account_id);
|
|
172
|
+
CREATE INDEX idx_connector_connections_principal
|
|
173
|
+
ON connector_connections(principal_id, connector_id, status);
|
|
174
|
+
CREATE UNIQUE INDEX idx_connector_connections_provider_backend
|
|
175
|
+
ON connector_connections(provider, COALESCE(json_extract(metadata_json, '$.backendId'), ''), provider_connection_id);
|
|
176
|
+
|
|
177
|
+
CREATE TABLE connector_action_metadata_next (
|
|
178
|
+
connector_id TEXT NOT NULL,
|
|
179
|
+
action_id TEXT NOT NULL,
|
|
180
|
+
toolkit TEXT,
|
|
181
|
+
scope TEXT NOT NULL DEFAULT 'write' CHECK(scope IN ('read', 'write', 'admin')),
|
|
182
|
+
curated INTEGER NOT NULL DEFAULT 0 CHECK(curated IN (0, 1)),
|
|
183
|
+
input_schema_json TEXT,
|
|
184
|
+
schema_version TEXT,
|
|
185
|
+
cached_at INTEGER NOT NULL,
|
|
186
|
+
PRIMARY KEY(connector_id, action_id)
|
|
187
|
+
);
|
|
188
|
+
INSERT INTO connector_action_metadata_next SELECT
|
|
189
|
+
connector_id, action_id, toolkit, scope, curated, input_schema_json, schema_version,
|
|
190
|
+
CASE WHEN typeof(cached_at) IN ('integer', 'real') THEN CAST(cached_at AS INTEGER)
|
|
191
|
+
ELSE CAST(ROUND((julianday(cached_at) - 2440587.5) * 86400000) AS INTEGER) END
|
|
192
|
+
FROM connector_action_metadata;
|
|
193
|
+
DROP TABLE connector_action_metadata;
|
|
194
|
+
ALTER TABLE connector_action_metadata_next RENAME TO connector_action_metadata;
|
|
195
|
+
CREATE INDEX idx_connector_action_scope
|
|
196
|
+
ON connector_action_metadata(connector_id, scope, curated);
|
|
197
|
+
|
|
198
|
+
CREATE TABLE connector_execution_audit_next (
|
|
199
|
+
id TEXT PRIMARY KEY,
|
|
200
|
+
installation_id TEXT REFERENCES connector_installations(id) ON DELETE SET NULL,
|
|
201
|
+
connection_id TEXT REFERENCES connector_connections(id) ON DELETE SET NULL,
|
|
202
|
+
connector_id TEXT NOT NULL,
|
|
203
|
+
principal_id TEXT NOT NULL,
|
|
204
|
+
agent_id TEXT,
|
|
205
|
+
conversation_id TEXT,
|
|
206
|
+
action_id TEXT NOT NULL,
|
|
207
|
+
scope TEXT NOT NULL CHECK(scope IN ('read', 'write', 'admin')),
|
|
208
|
+
decision TEXT NOT NULL CHECK(decision IN ('allowed', 'denied', 'confirmation_required')),
|
|
209
|
+
result_status TEXT NOT NULL CHECK(result_status IN ('success', 'error', 'not_executed')),
|
|
210
|
+
duration_ms INTEGER,
|
|
211
|
+
error_code TEXT,
|
|
212
|
+
created_at INTEGER NOT NULL
|
|
213
|
+
);
|
|
214
|
+
INSERT INTO connector_execution_audit_next SELECT
|
|
215
|
+
id, installation_id, connection_id, connector_id, principal_id, agent_id,
|
|
216
|
+
conversation_id, action_id, scope, decision, result_status, duration_ms, error_code,
|
|
217
|
+
CASE WHEN typeof(created_at) IN ('integer', 'real') THEN CAST(created_at AS INTEGER)
|
|
218
|
+
ELSE CAST(ROUND((julianday(created_at) - 2440587.5) * 86400000) AS INTEGER) END
|
|
219
|
+
FROM connector_execution_audit;
|
|
220
|
+
DROP TABLE connector_execution_audit;
|
|
221
|
+
ALTER TABLE connector_execution_audit_next RENAME TO connector_execution_audit;
|
|
222
|
+
CREATE INDEX idx_connector_audit_connector_time
|
|
223
|
+
ON connector_execution_audit(connector_id, created_at DESC);
|
|
224
|
+
CREATE INDEX idx_connector_audit_principal_time
|
|
225
|
+
ON connector_execution_audit(principal_id, created_at DESC);
|
|
226
|
+
CREATE INDEX idx_connector_execution_audit_connection
|
|
227
|
+
ON connector_execution_audit(connection_id);
|
|
228
|
+
CREATE INDEX idx_connector_execution_audit_installation
|
|
229
|
+
ON connector_execution_audit(installation_id);
|
|
230
|
+
|
|
231
|
+
CREATE TABLE connector_approvals_next (
|
|
232
|
+
id TEXT PRIMARY KEY,
|
|
233
|
+
principal_id TEXT NOT NULL,
|
|
234
|
+
connector_id TEXT NOT NULL,
|
|
235
|
+
connection_id TEXT REFERENCES connector_connections(id) ON DELETE SET NULL,
|
|
236
|
+
agent_id TEXT,
|
|
237
|
+
conversation_id TEXT,
|
|
238
|
+
action_id TEXT NOT NULL,
|
|
239
|
+
scope TEXT NOT NULL CHECK(scope IN ('read', 'write', 'admin')),
|
|
240
|
+
arguments_hash TEXT NOT NULL,
|
|
241
|
+
arguments_preview_json TEXT NOT NULL DEFAULT '{}',
|
|
242
|
+
status TEXT NOT NULL DEFAULT 'pending'
|
|
243
|
+
CHECK(status IN ('pending', 'approved', 'denied', 'expired', 'consumed')),
|
|
244
|
+
expires_at INTEGER NOT NULL,
|
|
245
|
+
created_at INTEGER NOT NULL,
|
|
246
|
+
decided_at INTEGER,
|
|
247
|
+
consumed_at INTEGER,
|
|
248
|
+
wait_id TEXT
|
|
249
|
+
);
|
|
250
|
+
INSERT INTO connector_approvals_next SELECT
|
|
251
|
+
id, principal_id, connector_id, connection_id, agent_id, conversation_id, action_id,
|
|
252
|
+
scope, arguments_hash, arguments_preview_json, status,
|
|
253
|
+
CASE WHEN typeof(expires_at) IN ('integer', 'real') THEN CAST(expires_at AS INTEGER)
|
|
254
|
+
ELSE CAST(ROUND((julianday(expires_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
255
|
+
CASE WHEN typeof(created_at) IN ('integer', 'real') THEN CAST(created_at AS INTEGER)
|
|
256
|
+
ELSE CAST(ROUND((julianday(created_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
257
|
+
CASE WHEN decided_at IS NULL THEN NULL
|
|
258
|
+
WHEN typeof(decided_at) IN ('integer', 'real') THEN CAST(decided_at AS INTEGER)
|
|
259
|
+
ELSE CAST(ROUND((julianday(decided_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
260
|
+
CASE WHEN consumed_at IS NULL THEN NULL
|
|
261
|
+
WHEN typeof(consumed_at) IN ('integer', 'real') THEN CAST(consumed_at AS INTEGER)
|
|
262
|
+
ELSE CAST(ROUND((julianday(consumed_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
263
|
+
wait_id
|
|
264
|
+
FROM connector_approvals;
|
|
265
|
+
DROP TABLE connector_approvals;
|
|
266
|
+
ALTER TABLE connector_approvals_next RENAME TO connector_approvals;
|
|
267
|
+
CREATE INDEX idx_connector_approvals_connection ON connector_approvals(connection_id);
|
|
268
|
+
CREATE INDEX idx_connector_approvals_pending
|
|
269
|
+
ON connector_approvals(principal_id, status, expires_at, created_at DESC);
|
|
270
|
+
CREATE INDEX idx_connector_approvals_session
|
|
271
|
+
ON connector_approvals(conversation_id, status, created_at DESC);
|
|
272
|
+
|
|
273
|
+
CREATE TABLE connector_webhook_deliveries_next (
|
|
274
|
+
id TEXT PRIMARY KEY,
|
|
275
|
+
provider TEXT NOT NULL,
|
|
276
|
+
payload_hash TEXT NOT NULL,
|
|
277
|
+
status TEXT NOT NULL DEFAULT 'processing'
|
|
278
|
+
CHECK(status IN ('pending', 'processing', 'processed')),
|
|
279
|
+
attempts INTEGER NOT NULL DEFAULT 1,
|
|
280
|
+
received_at INTEGER NOT NULL,
|
|
281
|
+
processing_at INTEGER,
|
|
282
|
+
processed_at INTEGER,
|
|
283
|
+
last_error TEXT
|
|
284
|
+
);
|
|
285
|
+
INSERT INTO connector_webhook_deliveries_next SELECT
|
|
286
|
+
id, provider, payload_hash, status, attempts,
|
|
287
|
+
CASE WHEN typeof(received_at) IN ('integer', 'real') THEN CAST(received_at AS INTEGER)
|
|
288
|
+
ELSE CAST(ROUND((julianday(received_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
289
|
+
CASE WHEN processing_at IS NULL THEN NULL
|
|
290
|
+
WHEN typeof(processing_at) IN ('integer', 'real') THEN CAST(processing_at AS INTEGER)
|
|
291
|
+
ELSE CAST(ROUND((julianday(processing_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
292
|
+
CASE WHEN processed_at IS NULL THEN NULL
|
|
293
|
+
WHEN typeof(processed_at) IN ('integer', 'real') THEN CAST(processed_at AS INTEGER)
|
|
294
|
+
ELSE CAST(ROUND((julianday(processed_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
295
|
+
last_error
|
|
296
|
+
FROM connector_webhook_deliveries;
|
|
297
|
+
DROP TABLE connector_webhook_deliveries;
|
|
298
|
+
ALTER TABLE connector_webhook_deliveries_next RENAME TO connector_webhook_deliveries;
|
|
299
|
+
CREATE INDEX idx_connector_webhook_deliveries_status
|
|
300
|
+
ON connector_webhook_deliveries(provider, status, received_at DESC);
|
|
301
|
+
|
|
302
|
+
CREATE TABLE user_trust_policies_next (
|
|
303
|
+
principal_id TEXT PRIMARY KEY,
|
|
304
|
+
default_action_level TEXT NOT NULL DEFAULT 'confirm'
|
|
305
|
+
CHECK(default_action_level IN ('observe', 'suggest', 'confirm', 'auto')),
|
|
306
|
+
updated_at INTEGER NOT NULL
|
|
307
|
+
);
|
|
308
|
+
INSERT INTO user_trust_policies_next SELECT
|
|
309
|
+
principal_id, default_action_level,
|
|
310
|
+
CASE WHEN typeof(updated_at) IN ('integer', 'real') THEN CAST(updated_at AS INTEGER)
|
|
311
|
+
ELSE CAST(ROUND((julianday(updated_at) - 2440587.5) * 86400000) AS INTEGER) END
|
|
312
|
+
FROM user_trust_policies;
|
|
313
|
+
DROP TABLE user_trust_policies;
|
|
314
|
+
ALTER TABLE user_trust_policies_next RENAME TO user_trust_policies;
|
|
315
|
+
|
|
316
|
+
CREATE TABLE connector_backends_next (
|
|
317
|
+
id TEXT PRIMARY KEY,
|
|
318
|
+
mode TEXT NOT NULL CHECK(mode IN ('managed', 'byok')),
|
|
319
|
+
label TEXT NOT NULL,
|
|
320
|
+
credential_ref TEXT,
|
|
321
|
+
credential_source TEXT NOT NULL DEFAULT 'stored'
|
|
322
|
+
CHECK(credential_source IN ('stored', 'environment')),
|
|
323
|
+
verified_at INTEGER,
|
|
324
|
+
active INTEGER NOT NULL DEFAULT 0,
|
|
325
|
+
created_at INTEGER NOT NULL
|
|
326
|
+
);
|
|
327
|
+
INSERT INTO connector_backends_next SELECT
|
|
328
|
+
id, mode, label, credential_ref, credential_source,
|
|
329
|
+
CASE WHEN verified_at IS NULL THEN NULL
|
|
330
|
+
WHEN typeof(verified_at) IN ('integer', 'real') THEN CAST(verified_at AS INTEGER)
|
|
331
|
+
ELSE CAST(ROUND((julianday(verified_at) - 2440587.5) * 86400000) AS INTEGER) END,
|
|
332
|
+
active,
|
|
333
|
+
CASE WHEN typeof(created_at) IN ('integer', 'real') THEN CAST(created_at AS INTEGER)
|
|
334
|
+
ELSE CAST(ROUND((julianday(created_at) - 2440587.5) * 86400000) AS INTEGER) END
|
|
335
|
+
FROM connector_backends;
|
|
336
|
+
DROP TABLE connector_backends;
|
|
337
|
+
ALTER TABLE connector_backends_next RENAME TO connector_backends;
|
|
338
|
+
CREATE UNIQUE INDEX idx_connector_backend_active
|
|
339
|
+
ON connector_backends(active) WHERE active = 1;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
INSERT INTO session_config (
|
|
2
|
+
conversation_id, thinking_level, verbose_level, updated_at
|
|
3
|
+
)
|
|
4
|
+
SELECT conversation_id, thinking_level, verbose_level, updated_at
|
|
5
|
+
FROM sessions
|
|
6
|
+
WHERE thinking_level IS NOT NULL OR verbose_level IS NOT NULL
|
|
7
|
+
ON CONFLICT(conversation_id) DO UPDATE SET
|
|
8
|
+
thinking_level = COALESCE(session_config.thinking_level, excluded.thinking_level),
|
|
9
|
+
verbose_level = COALESCE(session_config.verbose_level, excluded.verbose_level),
|
|
10
|
+
updated_at = MAX(session_config.updated_at, excluded.updated_at);
|
|
11
|
+
|
|
12
|
+
ALTER TABLE sessions DROP COLUMN thinking_level;
|
|
13
|
+
ALTER TABLE sessions DROP COLUMN verbose_level;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
UPDATE sessions SET custom_data_json=json_remove(custom_data_json, '$.genericNewChatShell')
|
|
2
|
+
WHERE json_type(custom_data_json, '$.genericNewChatShell') IS NOT NULL;
|
|
3
|
+
|
|
4
|
+
CREATE TABLE session_input_receipts (
|
|
5
|
+
conversation_id TEXT NOT NULL,
|
|
6
|
+
client_message_id TEXT NOT NULL,
|
|
7
|
+
principal_id TEXT NOT NULL,
|
|
8
|
+
request_hash TEXT NOT NULL,
|
|
9
|
+
input_id TEXT,
|
|
10
|
+
transcript_id TEXT NOT NULL,
|
|
11
|
+
accepted_at INTEGER NOT NULL,
|
|
12
|
+
PRIMARY KEY (conversation_id, client_message_id)
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
CREATE TABLE session_tombstones (
|
|
16
|
+
conversation_id TEXT PRIMARY KEY,
|
|
17
|
+
deleted_at INTEGER NOT NULL
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
CREATE TABLE session_preparation_retries (
|
|
21
|
+
conversation_id TEXT NOT NULL,
|
|
22
|
+
idempotency_key TEXT NOT NULL,
|
|
23
|
+
operation_id TEXT NOT NULL,
|
|
24
|
+
expected_revision INTEGER NOT NULL,
|
|
25
|
+
principal_id TEXT NOT NULL,
|
|
26
|
+
PRIMARY KEY (conversation_id, idempotency_key)
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
CREATE TABLE session_preparations (
|
|
30
|
+
conversation_id TEXT PRIMARY KEY REFERENCES sessions(conversation_id) ON DELETE CASCADE,
|
|
31
|
+
operation_id TEXT NOT NULL UNIQUE,
|
|
32
|
+
creation_json TEXT NOT NULL CHECK(json_valid(creation_json)),
|
|
33
|
+
state TEXT NOT NULL CHECK(state IN ('preparing', 'ready', 'preparation_failed')),
|
|
34
|
+
environment_id TEXT NOT NULL,
|
|
35
|
+
base_commit TEXT,
|
|
36
|
+
revision INTEGER NOT NULL DEFAULT 1,
|
|
37
|
+
lease_until INTEGER NOT NULL DEFAULT 0,
|
|
38
|
+
last_error TEXT,
|
|
39
|
+
created_at INTEGER NOT NULL,
|
|
40
|
+
updated_at INTEGER NOT NULL
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
CREATE TABLE session_preparation_cleanup (
|
|
44
|
+
environment_id TEXT PRIMARY KEY,
|
|
45
|
+
conversation_id TEXT NOT NULL,
|
|
46
|
+
not_before INTEGER NOT NULL,
|
|
47
|
+
last_error TEXT
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
CREATE TRIGGER session_creation_tombstone BEFORE DELETE ON sessions BEGIN
|
|
51
|
+
INSERT INTO session_tombstones(conversation_id, deleted_at)
|
|
52
|
+
VALUES (OLD.conversation_id, CAST(unixepoch('subsec') * 1000 AS INTEGER))
|
|
53
|
+
ON CONFLICT(conversation_id) DO NOTHING;
|
|
54
|
+
INSERT INTO session_preparation_cleanup(environment_id, conversation_id, not_before)
|
|
55
|
+
SELECT environment_id, conversation_id, max(lease_until, CAST(unixepoch('subsec') * 1000 AS INTEGER)) + 5000
|
|
56
|
+
FROM session_preparations WHERE conversation_id=OLD.conversation_id
|
|
57
|
+
AND json_extract(creation_json, '$.execution.mode')='managed_worktree'
|
|
58
|
+
ON CONFLICT(environment_id) DO NOTHING;
|
|
59
|
+
END;
|
|
@@ -3,7 +3,7 @@ import type { ApplyMigrationsOptions } from './types.js';
|
|
|
3
3
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
4
4
|
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 165;
|
|
5
5
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
6
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
6
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 223;
|
|
7
7
|
export declare function resolveMigrationsDir(override?: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Apply sequential SQL migrations from (currentVersion + 1) through targetVersion.
|
|
@@ -26,7 +26,7 @@ function applySingleMigration(db, migration, discardOldScenes = false) {
|
|
|
26
26
|
targetVersion: migration.targetVersion,
|
|
27
27
|
file: migration.filename
|
|
28
28
|
}, "Applying SQLite migration");
|
|
29
|
-
const requiresForeignKeyPause = discardOldScenes || migration.targetVersion === 179 || migration.targetVersion === 182 || migration.targetVersion === 188 || migration.targetVersion === 200 || migration.targetVersion === 201 || migration.targetVersion === 203;
|
|
29
|
+
const requiresForeignKeyPause = discardOldScenes || migration.targetVersion === 179 || migration.targetVersion === 182 || migration.targetVersion === 188 || migration.targetVersion === 200 || migration.targetVersion === 201 || migration.targetVersion === 203 || migration.targetVersion === 219 || migration.targetVersion === 220;
|
|
30
30
|
const foreignKeysEnabled = Number(db.prepare("PRAGMA foreign_keys").get()?.foreign_keys) === 1;
|
|
31
31
|
if (requiresForeignKeyPause) db.exec("PRAGMA foreign_keys = OFF");
|
|
32
32
|
let transactionStarted = false;
|
|
@@ -57,7 +57,7 @@ function applySingleMigration(db, migration, discardOldScenes = false) {
|
|
|
57
57
|
*/
|
|
58
58
|
function applyPendingMigrations(db, options = {}) {
|
|
59
59
|
db.function("xopc_operation_id", () => currentOperationId() ?? null);
|
|
60
|
-
const targetVersion = options.targetVersion ??
|
|
60
|
+
const targetVersion = options.targetVersion ?? 223;
|
|
61
61
|
let currentVersion = readSchemaVersion(db);
|
|
62
62
|
if (currentVersion > targetVersion) throw new DatabaseSchemaTooNewError(currentVersion, targetVersion);
|
|
63
63
|
if (!options.migrationsDir && currentVersion < 165) throw new DatabaseSchemaTooOldError(currentVersion, 165);
|
|
@@ -95,7 +95,7 @@ function applyPendingMigrations(db, options = {}) {
|
|
|
95
95
|
}
|
|
96
96
|
/** Inspect schema version without mutating the database. */
|
|
97
97
|
function inspectSchemaMigrationStatus(db, options = {}) {
|
|
98
|
-
const appVersion = options.targetVersion ??
|
|
98
|
+
const appVersion = options.targetVersion ?? 223;
|
|
99
99
|
const dbVersion = readSchemaVersion(db);
|
|
100
100
|
if (dbVersion > appVersion) return {
|
|
101
101
|
dbVersion,
|
|
@@ -137,7 +137,7 @@ var init_runner = __esmMin((() => {
|
|
|
137
137
|
init_errors();
|
|
138
138
|
log = createLogger("Sqlite:Migrations");
|
|
139
139
|
XOPC_DB_BASELINE_SCHEMA_VERSION = 165;
|
|
140
|
-
XOPC_DB_SCHEMA_VERSION =
|
|
140
|
+
XOPC_DB_SCHEMA_VERSION = 223;
|
|
141
141
|
}));
|
|
142
142
|
//#endregion
|
|
143
143
|
init_runner();
|
|
@@ -29,10 +29,8 @@ export type SessionRow = {
|
|
|
29
29
|
message_count: number;
|
|
30
30
|
estimated_tokens: number;
|
|
31
31
|
compacted_count: number;
|
|
32
|
-
last_flushed_at:
|
|
32
|
+
last_flushed_at: number | null;
|
|
33
33
|
flush_count: number;
|
|
34
|
-
thinking_level: string | null;
|
|
35
|
-
verbose_level: string | null;
|
|
36
34
|
cwd?: string | null;
|
|
37
35
|
};
|
|
38
36
|
export type TranscriptEntryRow = {
|
|
@@ -59,7 +57,7 @@ export type SessionConfigRow = {
|
|
|
59
57
|
updated_at: number;
|
|
60
58
|
};
|
|
61
59
|
export declare function sessionRowToMetadata(conversationId: string, row: SessionRow): SessionMetadata;
|
|
62
|
-
export declare function metadataToSessionInsert(conversationId: string, transcriptId: string, metadata: SessionMetadata
|
|
60
|
+
export declare function metadataToSessionInsert(conversationId: string, transcriptId: string, metadata: SessionMetadata): {
|
|
63
61
|
conversationId: string;
|
|
64
62
|
agentId: string;
|
|
65
63
|
transcriptId: string;
|
|
@@ -86,10 +84,8 @@ export declare function metadataToSessionInsert(conversationId: string, transcri
|
|
|
86
84
|
messageCount: number;
|
|
87
85
|
estimatedTokens: number;
|
|
88
86
|
compactedCount: number;
|
|
89
|
-
lastFlushedAt:
|
|
87
|
+
lastFlushedAt: number | null;
|
|
90
88
|
flushCount: number;
|
|
91
|
-
thinkingLevel: string | null;
|
|
92
|
-
verboseLevel: string | null;
|
|
93
89
|
};
|
|
94
90
|
export declare function sessionConfigRowToConfig(row: SessionConfigRow): SessionAgentConfig;
|
|
95
91
|
export declare function transcriptEntryRowToStoredRow(row: TranscriptEntryRow): TranscriptStoredRow;
|
|
@@ -2,6 +2,7 @@ import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { init_session_context_for_llm, isTranscriptContextEntry, isTranscriptSideChatOriginEntry } from "../../session/session-context-for-llm.js";
|
|
3
3
|
import "../../session/types.js";
|
|
4
4
|
import { buildDefaultSessionMetadata, init_session_metadata } from "./session-metadata.js";
|
|
5
|
+
import { init_timestamps, optionalTimestampToIso, optionalTimestampToMs } from "./timestamps.js";
|
|
5
6
|
//#region src/storage/sqlite/row-mappers.ts
|
|
6
7
|
function parseJson(raw) {
|
|
7
8
|
if (!raw?.trim()) return;
|
|
@@ -50,7 +51,7 @@ function sessionRowToMetadata(conversationId, row) {
|
|
|
50
51
|
messageCount: row.message_count,
|
|
51
52
|
estimatedTokens: row.estimated_tokens,
|
|
52
53
|
compactedCount: row.compacted_count,
|
|
53
|
-
lastFlushedAt: row.last_flushed_at
|
|
54
|
+
lastFlushedAt: optionalTimestampToIso(row.last_flushed_at),
|
|
54
55
|
flushCount: row.flush_count,
|
|
55
56
|
transcriptId: row.active_transcript_id,
|
|
56
57
|
cwd: row.cwd ?? void 0,
|
|
@@ -61,7 +62,7 @@ function sessionRowToMetadata(conversationId, row) {
|
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
|
-
function metadataToSessionInsert(conversationId, transcriptId, metadata
|
|
65
|
+
function metadataToSessionInsert(conversationId, transcriptId, metadata) {
|
|
65
66
|
const now = Date.now();
|
|
66
67
|
const agentId = (metadata.agentId || metadata.routing?.agentId)?.trim().toLowerCase();
|
|
67
68
|
if (!agentId) throw new Error("Creating a conversation requires an explicit agent ID");
|
|
@@ -92,10 +93,8 @@ function metadataToSessionInsert(conversationId, transcriptId, metadata, thinkin
|
|
|
92
93
|
messageCount: metadata.messageCount,
|
|
93
94
|
estimatedTokens: metadata.estimatedTokens,
|
|
94
95
|
compactedCount: metadata.compactedCount,
|
|
95
|
-
lastFlushedAt: metadata.lastFlushedAt
|
|
96
|
-
flushCount: metadata.flushCount ?? 0
|
|
97
|
-
thinkingLevel: thinkingLevel ?? null,
|
|
98
|
-
verboseLevel: verboseLevel ?? null
|
|
96
|
+
lastFlushedAt: optionalTimestampToMs(metadata.lastFlushedAt),
|
|
97
|
+
flushCount: metadata.flushCount ?? 0
|
|
99
98
|
};
|
|
100
99
|
}
|
|
101
100
|
function sessionConfigRowToConfig(row) {
|
|
@@ -187,6 +186,7 @@ function buildGlobalSessionStats(sessions) {
|
|
|
187
186
|
var init_row_mappers = __esmMin((() => {
|
|
188
187
|
init_session_context_for_llm();
|
|
189
188
|
init_session_metadata();
|
|
189
|
+
init_timestamps();
|
|
190
190
|
}));
|
|
191
191
|
//#endregion
|
|
192
192
|
init_row_mappers();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DatabaseSync } from 'node:sqlite';
|
|
2
2
|
export declare const NOTIFICATION_LEDGER_TABLES: readonly ["notification_browser_keys", "notification_browser_subscriptions", "notification_dispatches", "notification_result_outbox", "notification_attention_budget", "notification_digest_queue", "notification_digests", "notification_digest_members", "notification_dispatch_decisions", "notification_browser_probes", "notification_presence"];
|
|
3
|
-
export declare const SCENE_TABLES: readonly ["scene_source_health", "scene_activation_requests", "scene_activations", "scene_context_snapshots", "scene_events", "scene_feedback", "scene_feedback_history", "scene_intent_events", "scene_model_reservations", "scene_notes", "scene_outcomes", "scene_preferences", "scene_presentations", "scene_runs", "scene_schedule_cursors", "scene_template_versions", "scene_trigger_intents", "scene_work_items", "scene_mail_sources", "
|
|
3
|
+
export declare const SCENE_TABLES: readonly ["scene_source_health", "scene_activation_requests", "scene_activations", "scene_context_snapshots", "scene_events", "scene_feedback", "scene_feedback_history", "scene_intent_events", "scene_model_reservations", "scene_notes", "scene_outcomes", "scene_preferences", "scene_presentations", "scene_runs", "scene_schedule_cursors", "scene_template_versions", "scene_trigger_intents", "scene_work_items", "scene_mail_sources", "scene_connector_usage"];
|
|
4
4
|
/** Installs fresh tables; the normal versioned upgrade owns existing databases. */
|
|
5
5
|
export declare function installSceneSchema(db: DatabaseSync): void;
|
|
6
6
|
export declare function installNotificationLedgerSchema(db: DatabaseSync): void;
|
|
@@ -215,27 +215,6 @@ CREATE TABLE note_agent_contexts (
|
|
|
215
215
|
CREATE INDEX idx_note_agent_contexts_generated
|
|
216
216
|
ON note_agent_contexts(generated_at DESC);
|
|
217
217
|
|
|
218
|
-
CREATE TABLE memory_files (
|
|
219
|
-
file_id TEXT PRIMARY KEY,
|
|
220
|
-
user_id TEXT NOT NULL,
|
|
221
|
-
path TEXT NOT NULL,
|
|
222
|
-
mtime_ms INTEGER NOT NULL,
|
|
223
|
-
content_hash TEXT NOT NULL,
|
|
224
|
-
UNIQUE(user_id, path)
|
|
225
|
-
);
|
|
226
|
-
|
|
227
|
-
CREATE TABLE memory_chunks (
|
|
228
|
-
chunk_id TEXT PRIMARY KEY,
|
|
229
|
-
file_id TEXT NOT NULL,
|
|
230
|
-
start_line INTEGER NOT NULL,
|
|
231
|
-
end_line INTEGER NOT NULL,
|
|
232
|
-
content TEXT NOT NULL,
|
|
233
|
-
FOREIGN KEY (file_id) REFERENCES memory_files(file_id) ON DELETE CASCADE
|
|
234
|
-
);
|
|
235
|
-
|
|
236
|
-
CREATE INDEX idx_memory_chunks_file
|
|
237
|
-
ON memory_chunks(file_id, start_line);
|
|
238
|
-
|
|
239
218
|
CREATE VIRTUAL TABLE notes_fts USING fts5(
|
|
240
219
|
content,
|
|
241
220
|
note_id UNINDEXED,
|
|
@@ -409,27 +388,6 @@ CREATE INDEX idx_knowledge_sync_runs_source_started
|
|
|
409
388
|
CREATE INDEX idx_knowledge_sync_runs_status_started
|
|
410
389
|
ON knowledge_sync_runs(status, started_at DESC);
|
|
411
390
|
|
|
412
|
-
CREATE TABLE memory_relations (
|
|
413
|
-
relation_id TEXT PRIMARY KEY,
|
|
414
|
-
from_record_id TEXT NOT NULL,
|
|
415
|
-
relation_type TEXT NOT NULL,
|
|
416
|
-
to_record_id TEXT NOT NULL,
|
|
417
|
-
confidence REAL NOT NULL,
|
|
418
|
-
valid_from INTEGER,
|
|
419
|
-
valid_to INTEGER,
|
|
420
|
-
created_at INTEGER NOT NULL,
|
|
421
|
-
updated_at INTEGER NOT NULL,
|
|
422
|
-
UNIQUE(from_record_id, relation_type, to_record_id),
|
|
423
|
-
FOREIGN KEY(from_record_id) REFERENCES memory_records(record_id) ON DELETE CASCADE,
|
|
424
|
-
FOREIGN KEY(to_record_id) REFERENCES memory_records(record_id) ON DELETE CASCADE
|
|
425
|
-
);
|
|
426
|
-
|
|
427
|
-
CREATE INDEX idx_memory_relations_from
|
|
428
|
-
ON memory_relations(from_record_id, relation_type);
|
|
429
|
-
|
|
430
|
-
CREATE INDEX idx_memory_relations_to
|
|
431
|
-
ON memory_relations(to_record_id, relation_type);
|
|
432
|
-
|
|
433
391
|
CREATE TABLE connector_catalog_entries (
|
|
434
392
|
connector_id TEXT PRIMARY KEY,
|
|
435
393
|
provider TEXT NOT NULL,
|
|
@@ -581,16 +539,6 @@ CREATE TABLE knowledge_consumer_watermarks (
|
|
|
581
539
|
PRIMARY KEY(consumer_id, source_instance_id)
|
|
582
540
|
);
|
|
583
541
|
|
|
584
|
-
CREATE VIRTUAL TABLE memory_fts USING fts5(
|
|
585
|
-
content,
|
|
586
|
-
chunk_id UNINDEXED,
|
|
587
|
-
user_id UNINDEXED,
|
|
588
|
-
path UNINDEXED,
|
|
589
|
-
start_line UNINDEXED,
|
|
590
|
-
end_line UNINDEXED,
|
|
591
|
-
tokenize='unicode61'
|
|
592
|
-
);
|
|
593
|
-
|
|
594
542
|
CREATE TABLE local_apps (
|
|
595
543
|
app_id TEXT PRIMARY KEY,
|
|
596
544
|
extension_id TEXT NOT NULL UNIQUE,
|
|
@@ -190,13 +190,6 @@ CREATE TABLE scene_mail_sources (
|
|
|
190
190
|
UNIQUE(owner_id, workspace_id, account_id, thread_id)
|
|
191
191
|
);
|
|
192
192
|
|
|
193
|
-
CREATE TABLE scene_model_usage (
|
|
194
|
-
run_id TEXT NOT NULL REFERENCES scene_runs(id), lease_epoch INTEGER NOT NULL,
|
|
195
|
-
provider TEXT NOT NULL, model TEXT NOT NULL, input_tokens INTEGER NOT NULL,
|
|
196
|
-
output_tokens INTEGER NOT NULL, total_tokens INTEGER NOT NULL, estimated_cost REAL NOT NULL,
|
|
197
|
-
recorded_at INTEGER NOT NULL, PRIMARY KEY(run_id, lease_epoch)
|
|
198
|
-
);
|
|
199
|
-
|
|
200
193
|
CREATE TABLE scene_connector_usage (
|
|
201
194
|
owner_id TEXT NOT NULL, workspace_id TEXT NOT NULL, account_id TEXT NOT NULL,
|
|
202
195
|
utc_day INTEGER NOT NULL, request_count INTEGER NOT NULL,
|