@xopcai/xopc 0.0.414 → 0.0.416
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/_locales/en/messages.json +4 -1
- package/dist/browser-ext/_locales/zh_CN/messages.json +4 -1
- package/dist/browser-ext/dist/assets/{page-context-MuzjMBlJ.js → page-context-CVvmTWZb.js} +33 -9
- package/dist/browser-ext/dist/background.js +39 -10
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +22 -3
- 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-ClobpdW3.js → agent-avatar-dicebear-CufU7cqe.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DHDAcss8.js +1 -0
- package/dist/gateway/static/root/assets/agents-BV3dAoa0.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-CeBkHnl8.js → agents-admin-api-B1p-ghg9.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CLunLNGp.js → app-management-settings-panel-D4-n1uBg.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DBEgoE9g.js → appearance-settings-Cgn4eNsX.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BOYzD7Zz.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-JElK4Goq.js → archive-plugin-B4btCsiV.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CZ0UqwyU.js → automations-page-yb1EL_3N.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-J7LJ4RuV.js +8 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CXFawow6.js → binary-plugins-DQT9e258.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BoduwSYI.js → block-editor-B50rU9tL.js} +30 -30
- package/dist/gateway/static/root/assets/{browser-automation-inputs-D1pDgMJu.js → browser-automation-inputs-D6AccXaA.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-BiQz6lJA.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-W9kuxBbE.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-Bpeh6E22.js → capabilities-BlxF36t-.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-iXe87MdG.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CRLSXe7Z.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-BasrAWA0.js → capability-header-actions-BMnbzHms.js} +1 -1
- package/dist/gateway/static/root/assets/channels-CrRJkOKX.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CwQbzcZ_.js → chat-terminal-dock-Bd3af4gL.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-DNWeJKfF.js → computer-settings-page-DXfqy7xh.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-CxHgC5RM.js → connector-service-page-B-cw0CPU.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DbFxc0Fd.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-CXxLbLJb.js → date-picker-CqzXevH6.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DVuWMrSj.js → dependency-picker-pgT4Gyaf.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BDlg9g4s.js → desktop-pet-settings-Dy_-i2L8.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-KbVLtAlO.js → desktop-pet-zICeqw9c.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-ByGbxqkg.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-a7xEodzo.js → directory-picker-path-field-C-aQ7qoM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CHelH5u_.js → extension-debug-page-2NwpYkS5.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CrVHmS9-.js → extension-page-y9J0z7_Q.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CiMybi0r.js → extension-settings-page-BtowusUh.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DF_HV6NP.js → gateway-config-swr-fQKBHBi1.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-C52ghnBK.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bx9KCID-.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-BYSKzUMR.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B91CBTzO.js → gateway-startup-retry-Cfwxof4k.js} +1 -1
- package/dist/gateway/static/root/assets/highlight-code-Cz6eeDH5.js +1 -0
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-8ACAVktj.js → highlighted-body-KQOG7T2V-BiAa8HKC.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Cd1BjYHj.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-CVBaWmrV.js → image-generation-api-gBFro48x.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-C5IP3e6d.js → imports-page-BZQpXgjj.js} +1 -1
- package/dist/gateway/static/root/assets/index-Cy16gQST.css +1 -0
- package/dist/gateway/static/root/assets/index-DRyGCING.js +710 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BhU6VYvd.js → keyboard-shortcuts-settings-CYunR34k.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-B_Ac1lly.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DcP1Bdlk.js → local-apps-page-w-J5bY02.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-DvmwiLUx.js → local-session-drafts-iGX_6O0O.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-JogcXC4J.js → locale-store-B7s2Hb35.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-Dnjvvx2i.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-w1EDwgLW.js +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-BnPpcJ2J.js → media-plugins-CIx1koXw.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-DISkHmEC.js +1 -0
- package/dist/gateway/static/root/assets/{messages-RzwPiQNL.js → messages-BYq0cPbn.js} +2 -2
- package/dist/gateway/static/root/assets/note-detail-panel-CNkxMTFU.js +5 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-D5GH2wuC.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-DZgKqFBG.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-DusR2Itk.js +1 -0
- package/dist/gateway/static/root/assets/personal-page-CR5JFkQ9.js +1 -0
- package/dist/gateway/static/root/assets/personal-settings-panel-B7undvlr.js +1 -0
- package/dist/gateway/static/root/assets/phone-model-picker-fWDltRUJ.js +1 -0
- package/dist/gateway/static/root/assets/phone-settings-page-CsOirAiy.js +1 -0
- package/dist/gateway/static/root/assets/plugin-details-dialog-BOBVIB3j.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-FGqN-mQx.js → preview-open-alternatives-CMxjsKSw.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CwnHLfdL.js → product-open-page-CrlyJx5M.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-BD6k5hF9.js → product-preview-content-B-Jhzi7W.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DoYUbtcI.js +7 -0
- package/dist/gateway/static/root/assets/projects-page-xGQd9oAZ.js +1 -0
- package/dist/gateway/static/root/assets/refresh-cw-BRlGaq2w.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BGqSwITi.js → registry-api-BcfoLEna.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Gs0Xkws9.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-CSm5SpnR.js → runtime-tools-api-DesqGCnE.js} +1 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Bwg7U7TR.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-DoVn5jJK.js → schema-form-ByzTNR_C.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DTxZyMta.js → session-api-DdQnMwkl.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-B2HDomj4.js → session-manager-B_h0jlLb.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-XzK1ftbR.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-D_8Mvnog.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-Ce8vVv-9.js → settings-form-section-Brgd8IOV.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DP2w3ejC.js → settings-page-B6Mv02eg.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-header-BWyxJKOG.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-layout-B20AfmFG.js → settings-page-layout-DLHcS-0T.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DSCj5yis.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DV4dKrmG.js → share-preview-page-DF8Of0aZ.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DXNPe4Tl.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-DTdejInH.js → skill-api-CKCDCHLq.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BH0WF6Br.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DFWMVRW4.js +2 -0
- package/dist/gateway/static/root/assets/system-settings-panel-DB-ttubV.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-BJY7c8wb.js +2 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-DIGSC4qF.js → task-result-evidence-B-vt1BgK.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-BaU8frtc.js → tracing-settings-page-Dt51Z_ws.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BCcOUsqu.js → tunnel-api-Dok3t7Qe.js} +1 -1
- package/dist/gateway/static/root/assets/usage-page-lJym5G7F.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-C1X47WVb.js → use-autosave-D4EMIB-V.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-BXdNkITp.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Bk4DQMTw.js → voice-api-key-field-CO3KuanA.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-D7xsWrdh.js → voice-config-api-BkUlN7GH.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-B7_NmTB5.js → work-discovery-overlay-BJRtgQM3.js} +1 -1
- package/dist/gateway/static/root/assets/wrench-DFb4r8bH.js +1 -0
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-CS-_GxHV.js +1 -0
- package/dist/gateway/static/root/browser-setup-test.html +5 -0
- package/dist/gateway/static/root/browser-setup-test.js +7 -0
- package/dist/gateway/static/root/index.html +17 -14
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/browser-setup.js +6 -0
- package/dist/packages/gateway-contract/src/index.js +4 -0
- package/dist/packages/gateway-contract/src/phone-setup.js +6 -0
- package/dist/packages/realtime-client/src/index.js +1 -0
- package/dist/packages/realtime-protocol/src/index.js +1 -0
- package/dist/src/agent/agent-manager.d.ts +4 -0
- package/dist/src/agent/agent-manager.js +12 -1
- package/dist/src/agent/coding/workspace-revision.js +1 -1
- package/dist/src/agent/commands/command-registry.js +1 -1
- package/dist/src/agent/embedded/tool-search-extension.js +14 -1
- package/dist/src/agent/memory/context-recovery.d.ts +1 -1
- package/dist/src/agent/service.d.ts +1 -0
- package/dist/src/agent/service.js +5 -0
- package/dist/src/agent/service.types.d.ts +2 -0
- package/dist/src/agent/skills/installer.js +3 -3
- package/dist/src/agent/tool-manuals/phone.d.ts +1 -1
- package/dist/src/agent/tool-manuals/phone.js +4 -2
- package/dist/src/agent/tool-manuals/xopc-configuration.d.ts +2 -0
- package/dist/src/agent/tool-manuals/xopc-configuration.js +25 -0
- package/dist/src/agent/tools/browser/tool/browser-use-tool.d.ts +2 -0
- package/dist/src/agent/tools/browser/tool/browser-use-tool.js +6 -2
- package/dist/src/agent/tools/factory.d.ts +3 -0
- package/dist/src/agent/tools/factory.js +11 -1
- package/dist/src/agent/tools/personal-task-tool.d.ts +1 -1
- package/dist/src/agent/tools/personal-task-tool.js +23 -21
- package/dist/src/agent/tools/phone-use-tool.d.ts +1 -0
- package/dist/src/agent/tools/phone-use-tool.js +29 -1
- package/dist/src/agent/tools/tool-manual-tool.d.ts +1 -1
- package/dist/src/agent/tools/tool-manual-tool.js +3 -1
- package/dist/src/agent/tools/toolExposure.js +3 -0
- package/dist/src/agent/tools/xopc-use-tool.d.ts +4 -2
- package/dist/src/agent/tools/xopc-use-tool.js +40 -2
- package/dist/src/backup/archive.js +2 -1
- package/dist/src/browser/drivers/browser-driver.d.ts +2 -2
- package/dist/src/browser/drivers/extension-driver.d.ts +2 -2
- package/dist/src/browser/drivers/extension-driver.js +6 -3
- package/dist/src/browser/providers/browser-ext-install.js +3 -2
- package/dist/src/browser/runtime/browser-runtime.d.ts +4 -1
- package/dist/src/browser/runtime/browser-runtime.js +29 -17
- package/dist/src/browser/setup/repository.d.ts +5 -0
- package/dist/src/browser/setup/repository.js +42 -0
- package/dist/src/browser/setup/service.d.ts +152 -0
- package/dist/src/browser/setup/service.js +404 -0
- package/dist/src/browser/setup/types.d.ts +38 -0
- package/dist/src/browser/setup/types.js +1 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +3 -3
- package/dist/src/cli/commands/extension-pack.js +1 -1
- package/dist/src/cli/commands/extension.js +2 -2
- package/dist/src/config/schema.d.ts +2 -0
- package/dist/src/extensions/install.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/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/browser-setup.d.ts +3 -0
- package/dist/src/gateway/hono/routes/browser-setup.js +114 -0
- package/dist/src/gateway/hono/routes/browser.d.ts +2 -1
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/phone-dependencies.js +1 -1
- package/dist/src/gateway/hono/routes/phone-setup.d.ts +7 -0
- package/dist/src/gateway/hono/routes/phone-setup.js +162 -0
- package/dist/src/gateway/hono/routes/phone.js +11 -7
- package/dist/src/gateway/hono/routes/public-gateway.js +2 -0
- package/dist/src/gateway/provider-model-setup.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +2 -0
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/session-input-coordinator.js +1 -1
- package/dist/src/gateway/service.d.ts +5 -0
- package/dist/src/gateway/service.js +52 -7
- package/dist/src/gateway/xopc-cloud-capability-setup.js +7 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/infra/unhandled-rejections.js +2 -2
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/personal-agent/prompts.js +1 -1
- package/dist/src/phone/adb-driver.d.ts +8 -2
- package/dist/src/phone/adb-driver.js +124 -54
- package/dist/src/phone/cloud-adb.js +8 -0
- package/dist/src/phone/cloud-scrcpy.d.ts +3 -1
- package/dist/src/phone/cloud-scrcpy.js +17 -3
- package/dist/src/phone/contracts.d.ts +85 -0
- package/dist/src/phone/contracts.js +31 -5
- package/dist/src/phone/model-adapter.d.ts +141 -2
- package/dist/src/phone/model-adapter.js +176 -24
- package/dist/src/phone/numeric-entry.d.ts +31 -0
- package/dist/src/phone/numeric-entry.js +126 -0
- package/dist/src/phone/planning.d.ts +27 -0
- package/dist/src/phone/planning.js +79 -0
- package/dist/src/phone/recovery.d.ts +37 -0
- package/dist/src/phone/recovery.js +81 -0
- package/dist/src/phone/reliability.d.ts +7 -0
- package/dist/src/phone/reliability.js +66 -0
- package/dist/src/phone/repository.d.ts +1 -0
- package/dist/src/phone/repository.js +3 -0
- package/dist/src/phone/runtime.d.ts +8 -0
- package/dist/src/phone/runtime.js +387 -41
- package/dist/src/phone/scrcpy-text.d.ts +11 -0
- package/dist/src/phone/scrcpy-text.js +72 -0
- package/dist/src/phone/scrcpy.d.ts +5 -1
- package/dist/src/phone/scrcpy.js +48 -3
- package/dist/src/phone/semantic-controls.d.ts +13 -0
- package/dist/src/phone/semantic-controls.js +76 -0
- package/dist/src/phone/setup/service.d.ts +148 -0
- package/dist/src/phone/setup/service.js +251 -0
- package/dist/src/providers/presentation.js +2 -2
- package/dist/src/providers/xopc-cloud-model-source.js +6 -2
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/storage/sqlite/connection.js +2 -2
- package/dist/src/storage/sqlite/offline-access.js +13 -7
- package/dist/src/storage/sqlite/schema-errors.d.ts +12 -0
- package/dist/src/storage/sqlite/schema-errors.js +21 -3
- package/dist/src/storage/sqlite/schema-upgrade.d.ts +4 -0
- package/dist/src/storage/sqlite/schema-upgrade.js +78 -0
- package/dist/src/storage/sqlite/schema.d.ts +4 -3
- package/dist/src/storage/sqlite/schema.js +14 -8
- package/dist/src/storage/sqlite/schema.sql +10 -0
- package/dist/src/storage/sqlite/upgrades/203_remove_retired_proactive_contracts.sql +70 -0
- package/dist/src/storage/sqlite/upgrades/204_home_intelligence.sql +78 -0
- package/dist/src/storage/sqlite/upgrades/205_agent_catalog.sql +66 -0
- package/dist/src/storage/sqlite/upgrades/206_home_advice_strategy_version.sql +2 -0
- package/dist/src/storage/sqlite/upgrades/207_user_model_policy_contract.sql +121 -0
- package/dist/src/storage/sqlite/upgrades/208_automation_management.sql +2 -0
- package/dist/src/storage/sqlite/upgrades/209_automation_event_hub.sql +48 -0
- package/dist/src/storage/sqlite/upgrades/210_remove_legacy_automation_timeout.sql +14 -0
- package/dist/src/storage/sqlite/upgrades/211_automation_result_deliveries.sql +16 -0
- package/dist/src/storage/sqlite/upgrades/212_automation_delivery_policy.sql +30 -0
- package/dist/src/storage/sqlite/upgrades/213_automation_reliability_contract.sql +188 -0
- package/dist/src/storage/sqlite/upgrades/214_ai_usage_ledger.sql +41 -0
- package/dist/src/storage/sqlite/upgrades/215_scene_execution_adapters.sql +6 -0
- package/dist/src/storage/sqlite/upgrades/216_remove_scene_model_usage.sql +1 -0
- package/dist/src/storage/sqlite/upgrades/217_remove_legacy_memory_tables.sql +4 -0
- package/dist/src/storage/sqlite/upgrades/218_core_relation_indexes.sql +26 -0
- package/dist/src/storage/sqlite/upgrades/219_json_contracts.sql +123 -0
- package/dist/src/storage/sqlite/upgrades/220_normalize_timestamps.sql +339 -0
- package/dist/src/storage/sqlite/upgrades/221_ai_usage_retention_index.sql +2 -0
- package/dist/src/storage/sqlite/upgrades/222_session_config_authority.sql +13 -0
- package/dist/src/storage/sqlite/upgrades/223_session_creation_receipts.sql +59 -0
- package/dist/src/storage/sqlite/upgrades/224_task_origin_links.sql +8 -0
- package/dist/src/storage/sqlite/upgrades/225_task_collaboration.sql +32 -0
- package/dist/src/storage/sqlite/upgrades/226_task_main_updates.sql +9 -0
- package/dist/src/storage/sqlite/upgrades/227_task_main_update_decisions.sql +8 -0
- package/dist/src/storage/sqlite/upgrades/228_task_main_agent_links.sql +14 -0
- package/dist/src/storage/sqlite/upgrades/229_task_criterion_reviews.sql +12 -0
- package/dist/src/storage/sqlite/upgrades/230_personal_agent_onboarding.sql +8 -0
- package/dist/src/storage/sqlite/upgrades/231_task_result_deliveries.sql +32 -0
- package/dist/src/storage/sqlite/upgrades/232_personal_requests.sql +28 -0
- package/dist/src/storage/sqlite/upgrades/233_observability_usage_links.sql +3 -0
- package/dist/src/storage/sqlite/upgrades/234_task_result_reply.sql +14 -0
- package/dist/src/storage/sqlite/upgrades/235_personal_conversation_priority.sql +3 -0
- package/dist/src/storage/sqlite/upgrades/236_personal_proactivity.sql +53 -0
- package/dist/src/storage/sqlite/upgrades/237_personal_strategy_versions.sql +18 -0
- package/dist/src/storage/sqlite/upgrades/238_browser_record_replay.sql +45 -0
- package/dist/src/storage/sqlite/upgrades/239_clarification_notifications.sql +26 -0
- package/dist/src/storage/sqlite/upgrades/240_device_settings.sql +5 -0
- package/dist/src/storage/sqlite/upgrades/241_device_grant_audit.sql +13 -0
- package/dist/src/storage/sqlite/upgrades/242_cloud_usage_receipts.sql +5 -0
- package/dist/src/storage/sqlite/upgrades/243_voice_opening_greetings.sql +12 -0
- package/dist/src/storage/sqlite/upgrades/244_device_request_proofs.sql +8 -0
- package/dist/src/storage/sqlite/upgrades/245_memory_learning.sql +125 -0
- package/dist/src/storage/sqlite/upgrades/246_personal_session_thinking.sql +22 -0
- package/dist/src/storage/sqlite/upgrades/247_agent_selection_records.sql +32 -0
- package/dist/src/storage/sqlite/upgrades/248_next_turn_suggestions.sql +20 -0
- package/dist/src/storage/sqlite/upgrades/249_task_allocations.sql +17 -0
- package/dist/src/storage/sqlite/upgrades/250_research_checkpoints.sql +15 -0
- package/dist/src/storage/sqlite/upgrades/251_personal_result_reads.sql +40 -0
- package/dist/src/storage/sqlite/upgrades/252_task_work_revisions.sql +15 -0
- package/dist/src/storage/sqlite/upgrades/253_discussion_processing_recovery.sql +20 -0
- package/dist/src/storage/sqlite/upgrades/254_discussion_annotations.sql +17 -0
- package/dist/src/storage/sqlite/upgrades/255_discussion_chapter_progress.sql +10 -0
- package/dist/src/storage/sqlite/upgrades/256_task_main_update_retries.sql +21 -0
- package/dist/src/storage/sqlite/upgrades/257_session_composer_history.sql +11 -0
- package/dist/src/storage/sqlite/upgrades/258_task_phase_changes.sql +20 -0
- package/dist/src/storage/sqlite/upgrades/259_personal_default_style.sql +10 -0
- package/dist/src/storage/sqlite/upgrades/260_browser_setup.sql +9 -0
- package/dist/src/storage/sqlite/windows-database-owners.js +33 -28
- package/dist/src/tasks/capabilities/relations.d.ts +2 -2
- package/dist/src/tui/clipboard-image.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/logger/index.js +1 -1
- package/dist/src/utils/logger.js +1 -1
- package/dist/src/work-discovery/probe.js +1 -1
- package/package.json +3 -3
- package/skills/tools/configure-xopc/SKILL.md +47 -0
- package/skills/tools/configure-xopc/references/browser/acceptance.md +31 -0
- package/skills/tools/configure-xopc/references/browser/chrome-extension.md +19 -0
- package/skills/tools/configure-xopc/references/browser/overview.md +22 -0
- package/skills/tools/configure-xopc/references/browser/permissions.md +25 -0
- package/skills/tools/configure-xopc/references/browser/troubleshooting.md +24 -0
- package/skills/tools/configure-xopc/references/phone/acceptance.md +25 -0
- package/skills/tools/configure-xopc/references/phone/aliyun.md +29 -0
- package/skills/tools/configure-xopc/references/phone/dependencies.md +18 -0
- package/skills/tools/configure-xopc/references/phone/local.md +19 -0
- package/skills/tools/configure-xopc/references/phone/models.md +18 -0
- package/skills/tools/configure-xopc/references/phone/overview.md +30 -0
- package/skills/tools/configure-xopc/references/phone/troubleshooting.md +24 -0
- package/skills/tools/configure-xopc/references/scene-index.md +12 -0
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-mf0jgEPE.js +0 -1
- package/dist/gateway/static/root/assets/agents-CKhZ4UYQ.js +0 -77
- package/dist/gateway/static/root/assets/apps-page-BZ_MaQJf.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CHUDHNVL.js +0 -8
- package/dist/gateway/static/root/assets/browser-automations-page-DStDm9y1.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-6I4oetKt.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-C-EecWbS.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BQoCPk3x.js +0 -8
- package/dist/gateway/static/root/assets/channels-BKf_-Mdt.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CUBg8spT.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-PmP_vGem.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-DMAzNlm-.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CoIgC1Al.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-DnrQ28E2.js +0 -1
- package/dist/gateway/static/root/assets/highlight-code-AMjU04kR.js +0 -1
- package/dist/gateway/static/root/assets/home-page-pTwVME-g.js +0 -2
- package/dist/gateway/static/root/assets/index-BLL0wKRZ.css +0 -1
- package/dist/gateway/static/root/assets/index-ygkHNYyo.js +0 -710
- package/dist/gateway/static/root/assets/local-app-workbench-page-Cwl6EvuX.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-CS3hcTOq.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-DC-Y_-GP.js +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-vckgHpON.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-C7u4dxEk.js +0 -5
- package/dist/gateway/static/root/assets/note-image-lightbox-jvqYtySx.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-Bs7F5Hpf.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-DO_yhXS1.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-BexL2-PQ.js +0 -1
- package/dist/gateway/static/root/assets/personal-settings-panel-BKA4fbYH.js +0 -1
- package/dist/gateway/static/root/assets/phone-dependencies-card-ChFtdFhA.js +0 -1
- package/dist/gateway/static/root/assets/phone-model-picker-CZoIAQ1j.js +0 -1
- package/dist/gateway/static/root/assets/phone-settings-page-DRyK0nHH.js +0 -1
- package/dist/gateway/static/root/assets/plugin-details-dialog-B-N61jJH.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DtKmFBml.js +0 -7
- package/dist/gateway/static/root/assets/projects-page-CFZIz9mc.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CWEc7W0m.js +0 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-q_oswAdV.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BuPqNxpd.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-QTVDCGJG.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-header-CYpuTXUW.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-ZmlE8jIE.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-CtNxWqW-.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Egaf8PqZ.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-C6FKxf4J.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-Baxkhov7.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-C77-rpkt.js +0 -2
- package/dist/gateway/static/root/assets/usage-page-BFeIbpbi.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-u8zY5jea.js +0 -2
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-CJ_akAvc.js +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PhoneModelMetadataSchema, init_contracts } from "../phone/contracts.js";
|
|
1
2
|
import { init_model_policy, isDedicatedComputerProfile } from "../computer/model-policy.js";
|
|
2
3
|
import { ImageGenerationCapabilitiesSchema, init_models_json } from "../config/models-json.js";
|
|
3
4
|
import { voiceManifestSchema } from "../../packages/realtime-protocol/src/voice-catalog.js";
|
|
@@ -5,6 +6,7 @@ import { init_voice } from "../../packages/realtime-protocol/src/voice.js";
|
|
|
5
6
|
import { init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
6
7
|
import { getProviderAuthService, init_provider_auth_service } from "./provider-auth-service.js";
|
|
7
8
|
//#region src/providers/xopc-cloud-model-source.ts
|
|
9
|
+
init_contracts();
|
|
8
10
|
init_models_json();
|
|
9
11
|
init_voice();
|
|
10
12
|
init_model_policy();
|
|
@@ -58,7 +60,9 @@ var XopcCloudModelSource = class {
|
|
|
58
60
|
const stt = kind === "stt" ? parseSttCapabilities(model.xopc?.capabilities) : void 0;
|
|
59
61
|
const tts = kind === "tts" ? parseTtsCapabilities(model.xopc?.capabilities, model.xopc?.defaultVoice) : void 0;
|
|
60
62
|
const voice = voiceManifestSchema.safeParse(model.xopc?.voice);
|
|
63
|
+
const phone = PhoneModelMetadataSchema.safeParse(model.xopc?.capabilities?.phoneUse);
|
|
61
64
|
const catalogModel = {
|
|
65
|
+
...phone.success ? { phoneUse: phone.data } : {},
|
|
62
66
|
...voice.success ? { voice: voice.data } : {},
|
|
63
67
|
...["gui-plus-2026-02-26", "structured-tools-v1"].includes(String(model.xopc?.capabilities?.computerUse?.profile)) ? { computerUse: { profile: model.xopc.capabilities.computerUse.profile } } : {},
|
|
64
68
|
id: model.id,
|
|
@@ -90,7 +94,7 @@ var XopcCloudModelSource = class {
|
|
|
90
94
|
baseUrl: this.routerUrl,
|
|
91
95
|
api: "openai-completions",
|
|
92
96
|
etag: response.headers.get("x-xopc-model-catalog-version"),
|
|
93
|
-
recommendedModel: models.find((model) => model.id === "auto")?.id ?? models.find((model) => !isDedicatedComputerProfile(model.computerUse?.profile))?.id ?? null,
|
|
97
|
+
recommendedModel: models.find((model) => model.id === "auto")?.id ?? models.find((model) => !model.phoneUse && !isDedicatedComputerProfile(model.computerUse?.profile))?.id ?? null,
|
|
94
98
|
...Object.keys(recommended).length > 0 ? { recommended } : {},
|
|
95
99
|
...search ? { search } : {},
|
|
96
100
|
lastSuccessAt: Date.now()
|
|
@@ -144,7 +148,7 @@ function parseRecommendations(value, models) {
|
|
|
144
148
|
}
|
|
145
149
|
function modelMatchesRecommendation(model, capability) {
|
|
146
150
|
switch (capability) {
|
|
147
|
-
case "vision": return model.kind === "language" && model.input.includes("image") && !isDedicatedComputerProfile(model.computerUse?.profile);
|
|
151
|
+
case "vision": return model.kind === "language" && model.input.includes("image") && !model.phoneUse && !isDedicatedComputerProfile(model.computerUse?.profile);
|
|
148
152
|
case "image-generation": return model.kind === "image" && model.operations.includes("images.generate");
|
|
149
153
|
case "stt": return model.kind === "stt" && model.operations.includes("audio.transcription");
|
|
150
154
|
case "tts": return model.kind === "tts" && model.operations.includes("audio.speech");
|
|
@@ -222,7 +222,7 @@ var RealtimeRuntime = class {
|
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
224
|
const pendingClaim = this.tickets.peek(message.payload.ticket);
|
|
225
|
-
if (!pendingClaim || pendingClaim.deviceId && !verifyDeviceConnectionProof(pendingClaim.deviceId, message.payload.ticket, new URL(request.url, "http://localhost").pathname + new URL(request.url, "http://localhost").search, typeof request.headers["x-xopc-proof"] === "string" ? request.headers["x-xopc-proof"] :
|
|
225
|
+
if (!pendingClaim || pendingClaim.deviceId && !verifyDeviceConnectionProof(pendingClaim.deviceId, message.payload.ticket, new URL(request.url, "http://localhost").pathname + new URL(request.url, "http://localhost").search, typeof request.headers["x-xopc-proof"] === "string" ? request.headers["x-xopc-proof"] : message.payload.connectionProof)) {
|
|
226
226
|
socket.close(4401, "Realtime authentication failed");
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { resolveXopcDatabasePath } from "../../config/paths-state.js";
|
|
3
3
|
import { init_paths } from "./paths.js";
|
|
4
|
-
import { ensureXopcDatabaseSchema, init_schema } from "./schema.js";
|
|
5
|
-
import { init_node_sqlite, requireNodeSqlite } from "../../infra/node-sqlite.js";
|
|
6
4
|
import { createLogger } from "../../utils/logger/index.js";
|
|
7
5
|
import { init_logger } from "../../utils/logger.js";
|
|
6
|
+
import { ensureXopcDatabaseSchema, init_schema } from "./schema.js";
|
|
7
|
+
import { init_node_sqlite, requireNodeSqlite } from "../../infra/node-sqlite.js";
|
|
8
8
|
import { init_unhandled_rejections, installSqliteTransientRejectionHandler } from "../../infra/unhandled-rejections.js";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import fs from "node:fs";
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { init_windows_database_owners, windowsDatabaseOwners } from "./windows-database-owners.js";
|
|
2
3
|
import { resolve } from "node:path";
|
|
3
4
|
import { closeSync, fsyncSync, openSync, readdirSync, readlinkSync, statSync } from "node:fs";
|
|
4
5
|
import { execFileSync } from "node:child_process";
|
|
5
6
|
//#region src/storage/sqlite/offline-access.ts
|
|
6
|
-
const backupFileSyncOperations = {
|
|
7
|
-
open: openSync,
|
|
8
|
-
fsync: fsyncSync,
|
|
9
|
-
close: closeSync
|
|
10
|
-
};
|
|
11
7
|
/** Windows requires write access on a file handle before FlushFileBuffers/fsync. */
|
|
12
8
|
function flushBackupFile(backupPath, operations = backupFileSyncOperations) {
|
|
13
9
|
const fd = operations.open(backupPath, "r+");
|
|
@@ -73,5 +69,15 @@ function assertDatabaseOffline(databasePath) {
|
|
|
73
69
|
const otherOwners = databaseOwners(databasePath);
|
|
74
70
|
if (otherOwners.length) throw new Error(`Stop other xopc database processes before backing up: ${otherOwners.join(", ")}`);
|
|
75
71
|
}
|
|
72
|
+
var backupFileSyncOperations;
|
|
73
|
+
var init_offline_access = __esmMin((() => {
|
|
74
|
+
init_windows_database_owners();
|
|
75
|
+
backupFileSyncOperations = {
|
|
76
|
+
open: openSync,
|
|
77
|
+
fsync: fsyncSync,
|
|
78
|
+
close: closeSync
|
|
79
|
+
};
|
|
80
|
+
}));
|
|
76
81
|
//#endregion
|
|
77
|
-
|
|
82
|
+
init_offline_access();
|
|
83
|
+
export { assertDatabaseOffline, flushBackupFile, init_offline_access };
|
|
@@ -8,3 +8,15 @@ export declare class DatabaseSchemaTooOldError extends Error {
|
|
|
8
8
|
readonly minimumVersion: number;
|
|
9
9
|
constructor(dbVersion: number, minimumVersion: number);
|
|
10
10
|
}
|
|
11
|
+
export declare class DatabaseSchemaMigrationGapError extends Error {
|
|
12
|
+
readonly dbVersion: number;
|
|
13
|
+
readonly appVersion: number;
|
|
14
|
+
readonly missingVersion: number;
|
|
15
|
+
constructor(dbVersion: number, appVersion: number, missingVersion: number);
|
|
16
|
+
}
|
|
17
|
+
export declare class DatabaseSchemaMigrationFailedError extends Error {
|
|
18
|
+
readonly dbVersion: number;
|
|
19
|
+
readonly appVersion: number;
|
|
20
|
+
readonly backupPath: string | undefined;
|
|
21
|
+
constructor(dbVersion: number, appVersion: number, backupPath: string | undefined, cause: unknown);
|
|
22
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
//#region src/storage/sqlite/schema-errors.ts
|
|
3
|
-
var DatabaseSchemaTooNewError, DatabaseSchemaTooOldError;
|
|
3
|
+
var DatabaseSchemaTooNewError, DatabaseSchemaTooOldError, DatabaseSchemaMigrationGapError, DatabaseSchemaMigrationFailedError;
|
|
4
4
|
var init_schema_errors = __esmMin((() => {
|
|
5
5
|
DatabaseSchemaTooNewError = class extends Error {
|
|
6
6
|
dbVersion;
|
|
@@ -16,13 +16,31 @@ var init_schema_errors = __esmMin((() => {
|
|
|
16
16
|
dbVersion;
|
|
17
17
|
minimumVersion;
|
|
18
18
|
constructor(dbVersion, minimumVersion) {
|
|
19
|
-
super(`xopc database schema version ${dbVersion} is older than the minimum supported version (${minimumVersion}).
|
|
19
|
+
super(`xopc database schema version ${dbVersion} is older than the minimum supported version (${minimumVersion}). Keep xopc.db and its WAL/SHM files; use a release with an upgrade path for this database or contact support.`);
|
|
20
20
|
this.name = "DatabaseSchemaTooOldError";
|
|
21
21
|
this.dbVersion = dbVersion;
|
|
22
22
|
this.minimumVersion = minimumVersion;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
+
DatabaseSchemaMigrationGapError = class extends Error {
|
|
26
|
+
constructor(dbVersion, appVersion, missingVersion) {
|
|
27
|
+
super(`xopc database schema version ${dbVersion} requires migration to v${missingVersion}, but that migration is not bundled.`);
|
|
28
|
+
this.dbVersion = dbVersion;
|
|
29
|
+
this.appVersion = appVersion;
|
|
30
|
+
this.missingVersion = missingVersion;
|
|
31
|
+
this.name = "DatabaseSchemaMigrationGapError";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
DatabaseSchemaMigrationFailedError = class extends Error {
|
|
35
|
+
constructor(dbVersion, appVersion, backupPath, cause) {
|
|
36
|
+
super(`SQLite database upgrade from v${dbVersion} to v${appVersion} failed; the upgrade was rolled back. ${cause instanceof Error ? cause.message : String(cause)}`, { cause });
|
|
37
|
+
this.dbVersion = dbVersion;
|
|
38
|
+
this.appVersion = appVersion;
|
|
39
|
+
this.backupPath = backupPath;
|
|
40
|
+
this.name = "DatabaseSchemaMigrationFailedError";
|
|
41
|
+
}
|
|
42
|
+
};
|
|
25
43
|
}));
|
|
26
44
|
//#endregion
|
|
27
45
|
init_schema_errors();
|
|
28
|
-
export { DatabaseSchemaTooNewError, DatabaseSchemaTooOldError, init_schema_errors };
|
|
46
|
+
export { DatabaseSchemaMigrationFailedError, DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, DatabaseSchemaTooOldError, init_schema_errors };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DatabaseSync } from 'node:sqlite';
|
|
2
|
+
export declare const XOPC_DB_MINIMUM_SCHEMA_VERSION = 202;
|
|
3
|
+
/** Keep the complete historical schema and data; retired features are never reactivated. */
|
|
4
|
+
export declare function upgradeXopcDatabase(db: DatabaseSync, fromVersion: number, targetVersion: number): void;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { init_sql_assets, readSqliteAsset, resolveSqliteAssetPath } from "./sql-assets.js";
|
|
3
|
+
import { init_schema_version, readSchemaVersion, setSchemaVersion } from "./schema-version.js";
|
|
4
|
+
import { DatabaseSchemaMigrationFailedError, DatabaseSchemaMigrationGapError, init_schema_errors } from "./schema-errors.js";
|
|
5
|
+
import { createLogger } from "../../utils/logger/index.js";
|
|
6
|
+
import { init_logger } from "../../utils/logger.js";
|
|
7
|
+
import { assertDatabaseOffline, flushBackupFile, init_offline_access } from "./offline-access.js";
|
|
8
|
+
import { chmodSync, readdirSync } from "node:fs";
|
|
9
|
+
import { randomUUID } from "node:crypto";
|
|
10
|
+
//#region src/storage/sqlite/schema-upgrade.ts
|
|
11
|
+
/** Keep the complete historical schema and data; retired features are never reactivated. */
|
|
12
|
+
function upgradeXopcDatabase(db, fromVersion, targetVersion) {
|
|
13
|
+
let files;
|
|
14
|
+
try {
|
|
15
|
+
files = readdirSync(resolveSqliteAssetPath("upgrades"));
|
|
16
|
+
} catch (error) {
|
|
17
|
+
if (error.code !== "ENOENT") throw error;
|
|
18
|
+
throw new DatabaseSchemaMigrationGapError(fromVersion, targetVersion, fromVersion + 1);
|
|
19
|
+
}
|
|
20
|
+
const migrations = [];
|
|
21
|
+
for (let version = fromVersion + 1; version <= targetVersion; version++) {
|
|
22
|
+
const matches = files.filter((file) => file.startsWith(`${version}_`) && file.endsWith(".sql"));
|
|
23
|
+
if (matches.length !== 1) throw new DatabaseSchemaMigrationGapError(fromVersion, targetVersion, version);
|
|
24
|
+
migrations.push(readSqliteAsset(`upgrades/${matches[0]}`));
|
|
25
|
+
}
|
|
26
|
+
const databasePath = db.prepare("PRAGMA database_list").all().find((row) => row.name === "main")?.file;
|
|
27
|
+
let backupPath;
|
|
28
|
+
if (databasePath) {
|
|
29
|
+
assertDatabaseOffline(databasePath);
|
|
30
|
+
backupPath = `${databasePath}.pre-upgrade-v${fromVersion}-${randomUUID()}.bak`;
|
|
31
|
+
db.prepare("VACUUM main INTO ?").run(backupPath);
|
|
32
|
+
chmodSync(backupPath, 384);
|
|
33
|
+
flushBackupFile(backupPath);
|
|
34
|
+
log.info({
|
|
35
|
+
path: databasePath,
|
|
36
|
+
backupPath,
|
|
37
|
+
fromVersion,
|
|
38
|
+
targetVersion
|
|
39
|
+
}, "Created pre-upgrade SQLite backup");
|
|
40
|
+
}
|
|
41
|
+
const foreignKeysEnabled = Number(db.prepare("PRAGMA foreign_keys").get()?.foreign_keys) === 1;
|
|
42
|
+
db.exec("PRAGMA foreign_keys = OFF");
|
|
43
|
+
let transactionStarted = false;
|
|
44
|
+
try {
|
|
45
|
+
db.exec("BEGIN IMMEDIATE");
|
|
46
|
+
transactionStarted = true;
|
|
47
|
+
if (readSchemaVersion(db) !== fromVersion) throw new Error("Database version changed during upgrade; retry startup");
|
|
48
|
+
for (const sql of migrations) db.exec(sql);
|
|
49
|
+
if (db.prepare("PRAGMA foreign_key_check").all().length) throw new Error("Database upgrade would violate foreign key integrity");
|
|
50
|
+
if (db.prepare("PRAGMA integrity_check").get()?.integrity_check !== "ok") throw new Error("Database upgrade failed integrity validation");
|
|
51
|
+
setSchemaVersion(db, targetVersion);
|
|
52
|
+
db.exec("COMMIT");
|
|
53
|
+
transactionStarted = false;
|
|
54
|
+
log.info({
|
|
55
|
+
fromVersion,
|
|
56
|
+
targetVersion,
|
|
57
|
+
backupPath
|
|
58
|
+
}, "Upgraded xopc SQLite database");
|
|
59
|
+
} catch (error) {
|
|
60
|
+
if (transactionStarted) db.exec("ROLLBACK");
|
|
61
|
+
throw new DatabaseSchemaMigrationFailedError(fromVersion, targetVersion, backupPath, error);
|
|
62
|
+
} finally {
|
|
63
|
+
if (foreignKeysEnabled) db.exec("PRAGMA foreign_keys = ON");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
var XOPC_DB_MINIMUM_SCHEMA_VERSION, log;
|
|
67
|
+
var init_schema_upgrade = __esmMin((() => {
|
|
68
|
+
init_logger();
|
|
69
|
+
init_offline_access();
|
|
70
|
+
init_schema_errors();
|
|
71
|
+
init_schema_version();
|
|
72
|
+
init_sql_assets();
|
|
73
|
+
XOPC_DB_MINIMUM_SCHEMA_VERSION = 202;
|
|
74
|
+
log = createLogger("Sqlite:Upgrade");
|
|
75
|
+
}));
|
|
76
|
+
//#endregion
|
|
77
|
+
init_schema_upgrade();
|
|
78
|
+
export { XOPC_DB_MINIMUM_SCHEMA_VERSION, init_schema_upgrade, upgradeXopcDatabase };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DatabaseSync } from 'node:sqlite';
|
|
2
2
|
export { SCHEMA_META_SCHEMA_VERSION_KEY, readSchemaVersionForTest, readSchemaVersion, setSchemaVersion, ensureSchemaMetaTable } from './schema-version.js';
|
|
3
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
4
|
-
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION =
|
|
5
|
-
|
|
3
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 260;
|
|
4
|
+
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 260;
|
|
5
|
+
export { XOPC_DB_MINIMUM_SCHEMA_VERSION } from './schema-upgrade.js';
|
|
6
|
+
/** Initialize fresh databases directly; upgrade supported installed databases transactionally. */
|
|
6
7
|
export declare function ensureXopcDatabaseSchema(db: DatabaseSync): void;
|
|
@@ -4,8 +4,9 @@ import { currentOperationId, init_operation_context } from "../../infra/operatio
|
|
|
4
4
|
import { init_sql_assets, readSqliteAsset } from "./sql-assets.js";
|
|
5
5
|
import { SCHEMA_META_SCHEMA_VERSION_KEY, ensureSchemaMetaTable, init_schema_version, readSchemaVersion, readSchemaVersionForTest, setSchemaVersion } from "./schema-version.js";
|
|
6
6
|
import { DatabaseSchemaTooNewError, DatabaseSchemaTooOldError, init_schema_errors } from "./schema-errors.js";
|
|
7
|
+
import { XOPC_DB_MINIMUM_SCHEMA_VERSION, init_schema_upgrade, upgradeXopcDatabase } from "./schema-upgrade.js";
|
|
7
8
|
//#region src/storage/sqlite/schema.ts
|
|
8
|
-
/**
|
|
9
|
+
/** Initialize fresh databases directly; upgrade supported installed databases transactionally. */
|
|
9
10
|
function ensureXopcDatabaseSchema(db) {
|
|
10
11
|
db.function("xopc_memory_search_text", { deterministic: true }, (value) => memorySearchText(String(value ?? "")));
|
|
11
12
|
db.function("xopc_operation_id", () => currentOperationId() ?? null);
|
|
@@ -13,14 +14,18 @@ function ensureXopcDatabaseSchema(db) {
|
|
|
13
14
|
const hasMetadata = tables.some((row) => row.name === "schema_meta");
|
|
14
15
|
if (!hasMetadata && tables.length) throw new Error("An unversioned database cannot be initialized");
|
|
15
16
|
const version = hasMetadata ? readSchemaVersion(db) : 0;
|
|
16
|
-
if (version >
|
|
17
|
-
if (version > 0 && version <
|
|
18
|
-
if (version
|
|
17
|
+
if (version > 260) throw new DatabaseSchemaTooNewError(version, 260);
|
|
18
|
+
if (version > 0 && version < 202) throw new DatabaseSchemaTooOldError(version, 202);
|
|
19
|
+
if (version >= 202 && version < 260) {
|
|
20
|
+
upgradeXopcDatabase(db, version, 260);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (version === 260) return;
|
|
19
24
|
if (db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name != 'schema_meta' AND name NOT LIKE 'sqlite_%' LIMIT 1").get()) throw new Error("An unversioned database cannot be initialized");
|
|
20
25
|
db.exec("BEGIN IMMEDIATE");
|
|
21
26
|
try {
|
|
22
27
|
db.exec(readSqliteAsset("schema.sql"));
|
|
23
|
-
setSchemaVersion(db,
|
|
28
|
+
setSchemaVersion(db, 260);
|
|
24
29
|
db.exec("COMMIT");
|
|
25
30
|
} catch (error) {
|
|
26
31
|
db.exec("ROLLBACK");
|
|
@@ -34,9 +39,10 @@ var init_schema = __esmMin((() => {
|
|
|
34
39
|
init_sql_assets();
|
|
35
40
|
init_schema_version();
|
|
36
41
|
init_schema_errors();
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
init_schema_upgrade();
|
|
43
|
+
XOPC_DB_SCHEMA_VERSION = 260;
|
|
44
|
+
XOPC_DB_BASELINE_SCHEMA_VERSION = 260;
|
|
39
45
|
}));
|
|
40
46
|
//#endregion
|
|
41
47
|
init_schema();
|
|
42
|
-
export { SCHEMA_META_SCHEMA_VERSION_KEY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_SCHEMA_VERSION, ensureSchemaMetaTable, ensureXopcDatabaseSchema, init_schema, readSchemaVersion, readSchemaVersionForTest, setSchemaVersion };
|
|
48
|
+
export { SCHEMA_META_SCHEMA_VERSION_KEY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_MINIMUM_SCHEMA_VERSION, XOPC_DB_SCHEMA_VERSION, ensureSchemaMetaTable, ensureXopcDatabaseSchema, init_schema, readSchemaVersion, readSchemaVersionForTest, setSchemaVersion };
|
|
@@ -3632,3 +3632,13 @@ END;
|
|
|
3632
3632
|
INSERT INTO work_discovery_onboarding VALUES (1,'not_started',NULL,NULL,NULL,0);
|
|
3633
3633
|
INSERT INTO discussion_capture_settings VALUES ('default',1,NULL,CAST(unixepoch('subsec') * 1000 AS INTEGER));
|
|
3634
3634
|
INSERT INTO connector_runtime_identity VALUES (1,lower(hex(randomblob(16))));
|
|
3635
|
+
|
|
3636
|
+
CREATE TABLE browser_setup_runs (
|
|
3637
|
+
id TEXT PRIMARY KEY,
|
|
3638
|
+
conversation_id TEXT NOT NULL,
|
|
3639
|
+
agent_id TEXT NOT NULL,
|
|
3640
|
+
revision INTEGER NOT NULL,
|
|
3641
|
+
updated_at INTEGER NOT NULL,
|
|
3642
|
+
payload_json TEXT NOT NULL
|
|
3643
|
+
);
|
|
3644
|
+
CREATE INDEX browser_setup_conversation ON browser_setup_runs(conversation_id, agent_id, updated_at);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
DROP TABLE IF EXISTS relationship_settings;
|
|
2
|
+
|
|
3
|
+
CREATE TABLE context_snapshots_v203 (
|
|
4
|
+
snapshot_id TEXT PRIMARY KEY,
|
|
5
|
+
trace_id TEXT NOT NULL UNIQUE,
|
|
6
|
+
owner_kind TEXT NOT NULL CHECK (owner_kind IN ('task_run', 'task', 'session')),
|
|
7
|
+
owner_id TEXT NOT NULL,
|
|
8
|
+
conversation_id TEXT,
|
|
9
|
+
query TEXT NOT NULL,
|
|
10
|
+
selected_items_json TEXT NOT NULL DEFAULT '[]',
|
|
11
|
+
rejected_items_json TEXT NOT NULL DEFAULT '[]',
|
|
12
|
+
consent_requests_json TEXT NOT NULL DEFAULT '[]',
|
|
13
|
+
relationship_policy_json TEXT NOT NULL DEFAULT '{}',
|
|
14
|
+
estimated_tokens INTEGER NOT NULL DEFAULT 0,
|
|
15
|
+
allocation_json TEXT,
|
|
16
|
+
authorization_snapshot_json TEXT NOT NULL DEFAULT '{}',
|
|
17
|
+
content_hash TEXT,
|
|
18
|
+
created_at INTEGER NOT NULL,
|
|
19
|
+
FOREIGN KEY (conversation_id) REFERENCES sessions(conversation_id) ON DELETE SET NULL
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
INSERT INTO context_snapshots_v203
|
|
23
|
+
SELECT * FROM context_snapshots WHERE owner_kind <> 'proactive_run';
|
|
24
|
+
|
|
25
|
+
DROP TABLE context_snapshots;
|
|
26
|
+
ALTER TABLE context_snapshots_v203 RENAME TO context_snapshots;
|
|
27
|
+
|
|
28
|
+
CREATE INDEX idx_context_snapshots_owner
|
|
29
|
+
ON context_snapshots(owner_kind, owner_id, created_at DESC);
|
|
30
|
+
CREATE INDEX idx_context_snapshots_session
|
|
31
|
+
ON context_snapshots(conversation_id, created_at DESC);
|
|
32
|
+
|
|
33
|
+
CREATE TABLE collaboration_rules_v203 (
|
|
34
|
+
rule_id TEXT PRIMARY KEY,
|
|
35
|
+
principal_id TEXT NOT NULL,
|
|
36
|
+
category TEXT NOT NULL CHECK (category IN ('communication', 'execution', 'boundary', 'routine', 'initiative')),
|
|
37
|
+
status TEXT NOT NULL CHECK (status IN ('active', 'disabled', 'archived')),
|
|
38
|
+
priority INTEGER NOT NULL DEFAULT 100,
|
|
39
|
+
scope_type TEXT NOT NULL CHECK (scope_type IN ('global', 'workspace', 'project', 'session')),
|
|
40
|
+
scope_id TEXT,
|
|
41
|
+
conditions_json TEXT NOT NULL DEFAULT '{}',
|
|
42
|
+
current_revision_id TEXT NOT NULL REFERENCES collaboration_rule_revisions(revision_id)
|
|
43
|
+
DEFERRABLE INITIALLY DEFERRED,
|
|
44
|
+
created_at INTEGER NOT NULL,
|
|
45
|
+
updated_at INTEGER NOT NULL
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
INSERT INTO collaboration_rules_v203 (
|
|
49
|
+
rule_id, principal_id, category, status, priority, scope_type, scope_id,
|
|
50
|
+
conditions_json, current_revision_id, created_at, updated_at
|
|
51
|
+
)
|
|
52
|
+
SELECT
|
|
53
|
+
rule_id,
|
|
54
|
+
principal_id,
|
|
55
|
+
CASE category WHEN 'proactive' THEN 'initiative' ELSE category END,
|
|
56
|
+
status,
|
|
57
|
+
priority,
|
|
58
|
+
scope_type,
|
|
59
|
+
scope_id,
|
|
60
|
+
conditions_json,
|
|
61
|
+
current_revision_id,
|
|
62
|
+
created_at,
|
|
63
|
+
updated_at
|
|
64
|
+
FROM collaboration_rules;
|
|
65
|
+
|
|
66
|
+
DROP TABLE collaboration_rules;
|
|
67
|
+
ALTER TABLE collaboration_rules_v203 RENAME TO collaboration_rules;
|
|
68
|
+
|
|
69
|
+
CREATE INDEX idx_collaboration_rules_principal_status
|
|
70
|
+
ON collaboration_rules(principal_id, status, priority, updated_at DESC);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
CREATE TABLE home_advice_generations (
|
|
2
|
+
generation_id TEXT PRIMARY KEY,
|
|
3
|
+
owner_id TEXT NOT NULL,
|
|
4
|
+
workspace_id TEXT NOT NULL,
|
|
5
|
+
idempotency_key TEXT NOT NULL,
|
|
6
|
+
status TEXT NOT NULL CHECK(status IN ('queued', 'running', 'succeeded', 'skipped', 'retry_wait', 'failed', 'cancelled')),
|
|
7
|
+
reasons_json TEXT NOT NULL DEFAULT '[]' CHECK(json_valid(reasons_json)),
|
|
8
|
+
requested_at INTEGER NOT NULL,
|
|
9
|
+
started_at INTEGER,
|
|
10
|
+
completed_at INTEGER,
|
|
11
|
+
retry_at INTEGER,
|
|
12
|
+
lease_owner TEXT,
|
|
13
|
+
lease_until INTEGER,
|
|
14
|
+
lease_epoch INTEGER NOT NULL DEFAULT 0,
|
|
15
|
+
attempt INTEGER NOT NULL DEFAULT 0,
|
|
16
|
+
dirty_after_start INTEGER NOT NULL DEFAULT 0 CHECK(dirty_after_start IN (0, 1)),
|
|
17
|
+
snapshot_hash TEXT,
|
|
18
|
+
evidence_ids_json TEXT NOT NULL DEFAULT '[]' CHECK(json_valid(evidence_ids_json)),
|
|
19
|
+
result_json TEXT CHECK(result_json IS NULL OR json_valid(result_json)),
|
|
20
|
+
model_ref TEXT,
|
|
21
|
+
input_tokens INTEGER,
|
|
22
|
+
output_tokens INTEGER,
|
|
23
|
+
estimated_cost_usd REAL,
|
|
24
|
+
outcome_reason TEXT,
|
|
25
|
+
error_code TEXT
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
CREATE UNIQUE INDEX idx_home_advice_generation_idempotency
|
|
29
|
+
ON home_advice_generations(owner_id, workspace_id, idempotency_key);
|
|
30
|
+
CREATE UNIQUE INDEX idx_home_advice_generation_active
|
|
31
|
+
ON home_advice_generations(owner_id, workspace_id)
|
|
32
|
+
WHERE status IN ('queued', 'running', 'retry_wait');
|
|
33
|
+
CREATE INDEX idx_home_advice_generation_claim
|
|
34
|
+
ON home_advice_generations(status, retry_at, requested_at);
|
|
35
|
+
CREATE INDEX idx_home_advice_generation_latest
|
|
36
|
+
ON home_advice_generations(owner_id, workspace_id, completed_at DESC);
|
|
37
|
+
|
|
38
|
+
CREATE TABLE home_opportunity_projections (
|
|
39
|
+
opportunity_id TEXT PRIMARY KEY,
|
|
40
|
+
generation_id TEXT NOT NULL REFERENCES home_advice_generations(generation_id) ON DELETE CASCADE,
|
|
41
|
+
owner_id TEXT NOT NULL,
|
|
42
|
+
workspace_id TEXT NOT NULL,
|
|
43
|
+
rank INTEGER NOT NULL CHECK(rank BETWEEN 0 AND 2),
|
|
44
|
+
kind TEXT NOT NULL CHECK(kind IN ('project_next_step', 'delivery_risk', 'meeting_prep', 'commitment_follow_up', 'automation_candidate')),
|
|
45
|
+
project_id TEXT,
|
|
46
|
+
dedupe_key TEXT NOT NULL,
|
|
47
|
+
content_json TEXT NOT NULL CHECK(json_valid(content_json)),
|
|
48
|
+
evidence_refs_json TEXT NOT NULL DEFAULT '[]' CHECK(json_valid(evidence_refs_json)),
|
|
49
|
+
snapshot_hash TEXT NOT NULL,
|
|
50
|
+
state TEXT NOT NULL CHECK(state IN ('active', 'snoozed', 'accepted', 'discussing', 'dismissed', 'expired', 'superseded')),
|
|
51
|
+
revision INTEGER NOT NULL DEFAULT 1 CHECK(revision > 0),
|
|
52
|
+
created_at INTEGER NOT NULL,
|
|
53
|
+
updated_at INTEGER NOT NULL,
|
|
54
|
+
expires_at INTEGER NOT NULL,
|
|
55
|
+
snoozed_until INTEGER,
|
|
56
|
+
resolution_kind TEXT CHECK(resolution_kind IS NULL OR resolution_kind IN ('session', 'task', 'scene')),
|
|
57
|
+
resolution_ref TEXT
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
CREATE UNIQUE INDEX idx_home_opportunity_active_dedupe
|
|
61
|
+
ON home_opportunity_projections(owner_id, workspace_id, dedupe_key)
|
|
62
|
+
WHERE state IN ('active', 'snoozed');
|
|
63
|
+
CREATE INDEX idx_home_opportunity_visible
|
|
64
|
+
ON home_opportunity_projections(owner_id, workspace_id, state, rank, expires_at);
|
|
65
|
+
|
|
66
|
+
CREATE TABLE home_opportunity_feedback (
|
|
67
|
+
feedback_id TEXT PRIMARY KEY,
|
|
68
|
+
opportunity_id TEXT NOT NULL REFERENCES home_opportunity_projections(opportunity_id) ON DELETE CASCADE,
|
|
69
|
+
idempotency_key TEXT NOT NULL UNIQUE,
|
|
70
|
+
kind TEXT NOT NULL CHECK(kind IN ('started', 'discussed', 'already_done', 'irrelevant', 'too_early', 'source_incorrect', 'less_like_this', 'snoozed')),
|
|
71
|
+
reason_code TEXT,
|
|
72
|
+
note TEXT,
|
|
73
|
+
scope_json TEXT NOT NULL DEFAULT '{}' CHECK(json_valid(scope_json)),
|
|
74
|
+
created_at INTEGER NOT NULL
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
CREATE INDEX idx_home_opportunity_feedback_item
|
|
78
|
+
ON home_opportunity_feedback(opportunity_id, created_at DESC);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
CREATE TABLE agent_catalog_settings (
|
|
2
|
+
singleton_id INTEGER PRIMARY KEY CHECK(singleton_id = 1),
|
|
3
|
+
default_agent_id TEXT NOT NULL REFERENCES agents(id),
|
|
4
|
+
defaults_json TEXT NOT NULL CHECK(json_valid(defaults_json)),
|
|
5
|
+
revision INTEGER NOT NULL CHECK(revision > 0),
|
|
6
|
+
created_at INTEGER NOT NULL,
|
|
7
|
+
updated_at INTEGER NOT NULL
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
CREATE TABLE agents (
|
|
11
|
+
id TEXT PRIMARY KEY,
|
|
12
|
+
enabled INTEGER NOT NULL CHECK(enabled IN (0, 1)),
|
|
13
|
+
workspace_override TEXT,
|
|
14
|
+
profile_json TEXT CHECK(profile_json IS NULL OR json_valid(profile_json)),
|
|
15
|
+
overrides_json TEXT NOT NULL CHECK(json_valid(overrides_json)),
|
|
16
|
+
provisioning_state TEXT NOT NULL CHECK(provisioning_state IN ('pending', 'ready', 'error')),
|
|
17
|
+
provisioning_error TEXT,
|
|
18
|
+
revision INTEGER NOT NULL CHECK(revision > 0),
|
|
19
|
+
created_at INTEGER NOT NULL,
|
|
20
|
+
updated_at INTEGER NOT NULL,
|
|
21
|
+
deleted_at INTEGER
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
CREATE INDEX idx_agents_available ON agents(enabled, provisioning_state, deleted_at, id);
|
|
25
|
+
|
|
26
|
+
CREATE TABLE agent_bindings (
|
|
27
|
+
id TEXT PRIMARY KEY,
|
|
28
|
+
agent_id TEXT NOT NULL REFERENCES agents(id),
|
|
29
|
+
position INTEGER NOT NULL CHECK(position >= 0),
|
|
30
|
+
rule_json TEXT NOT NULL CHECK(json_valid(rule_json)),
|
|
31
|
+
revision INTEGER NOT NULL CHECK(revision > 0),
|
|
32
|
+
created_at INTEGER NOT NULL,
|
|
33
|
+
updated_at INTEGER NOT NULL,
|
|
34
|
+
UNIQUE(position)
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
CREATE INDEX idx_agent_bindings_agent ON agent_bindings(agent_id, position);
|
|
38
|
+
|
|
39
|
+
CREATE TABLE agent_surface_defaults (
|
|
40
|
+
surface TEXT PRIMARY KEY,
|
|
41
|
+
agent_id TEXT NOT NULL REFERENCES agents(id),
|
|
42
|
+
revision INTEGER NOT NULL CHECK(revision > 0),
|
|
43
|
+
updated_at INTEGER NOT NULL
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
CREATE TABLE agent_provisioning_jobs (
|
|
47
|
+
agent_id TEXT PRIMARY KEY REFERENCES agents(id) ON DELETE CASCADE,
|
|
48
|
+
operation TEXT NOT NULL CHECK(operation IN ('provision', 'purge')),
|
|
49
|
+
state TEXT NOT NULL CHECK(state IN ('pending', 'running', 'failed')),
|
|
50
|
+
attempts INTEGER NOT NULL DEFAULT 0 CHECK(attempts >= 0),
|
|
51
|
+
last_error TEXT,
|
|
52
|
+
created_at INTEGER NOT NULL,
|
|
53
|
+
updated_at INTEGER NOT NULL
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
CREATE TABLE application_migrations (
|
|
57
|
+
id TEXT PRIMARY KEY,
|
|
58
|
+
state TEXT NOT NULL,
|
|
59
|
+
source_digest TEXT,
|
|
60
|
+
source_backup_path TEXT,
|
|
61
|
+
database_backup_path TEXT,
|
|
62
|
+
error_json TEXT CHECK(error_json IS NULL OR json_valid(error_json)),
|
|
63
|
+
started_at INTEGER NOT NULL,
|
|
64
|
+
completed_at INTEGER,
|
|
65
|
+
updated_at INTEGER NOT NULL
|
|
66
|
+
);
|