@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
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { getSessionMetadata, init_session_read_repository } from "../../../storage/sqlite/session-read-repository.js";
|
|
2
|
+
import { readBrowserSetup } from "../../../browser/setup/repository.js";
|
|
3
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
4
|
+
import { isLocalOwnerRequest } from "./browser.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
//#region src/gateway/hono/routes/browser-setup.ts
|
|
7
|
+
init_session_read_repository();
|
|
8
|
+
const requestSchema = z.strictObject({
|
|
9
|
+
conversationId: z.string().uuid(),
|
|
10
|
+
setupId: z.string().uuid().optional(),
|
|
11
|
+
action: z.enum([
|
|
12
|
+
"inspect",
|
|
13
|
+
"start",
|
|
14
|
+
"get",
|
|
15
|
+
"approve",
|
|
16
|
+
"prepare",
|
|
17
|
+
"recheck",
|
|
18
|
+
"open",
|
|
19
|
+
"begin_verification",
|
|
20
|
+
"cancel",
|
|
21
|
+
"release"
|
|
22
|
+
]),
|
|
23
|
+
expectedRevision: z.number().int().positive().optional(),
|
|
24
|
+
endpointId: z.string().min(1).max(500).optional(),
|
|
25
|
+
open: z.enum([
|
|
26
|
+
"chrome",
|
|
27
|
+
"folder",
|
|
28
|
+
"both"
|
|
29
|
+
]).optional()
|
|
30
|
+
});
|
|
31
|
+
function registerBrowserSetupRoutes(app, deps) {
|
|
32
|
+
app.post("/api/browser/setup", deps.strictRateLimitMiddleware, async (c) => {
|
|
33
|
+
if (!isLocalOwnerRequest(c, deps.service)) return c.json({
|
|
34
|
+
ok: false,
|
|
35
|
+
error: "LOCAL_OWNER_REQUIRED: Open setup on the Gateway computer. Remote pairing is available in Device access."
|
|
36
|
+
}, 403);
|
|
37
|
+
const parsed = requestSchema.safeParse(await c.req.json().catch(() => null));
|
|
38
|
+
if (!parsed.success) return c.json({
|
|
39
|
+
ok: false,
|
|
40
|
+
error: "Invalid setup request"
|
|
41
|
+
}, 400);
|
|
42
|
+
const body = parsed.data;
|
|
43
|
+
const metadata = getSessionMetadata(body.conversationId);
|
|
44
|
+
if (!metadata) return c.json({
|
|
45
|
+
ok: false,
|
|
46
|
+
error: "Conversation not found"
|
|
47
|
+
}, 404);
|
|
48
|
+
const service = deps.service.browserSetup;
|
|
49
|
+
const context = {
|
|
50
|
+
conversationId: body.conversationId,
|
|
51
|
+
agentId: metadata.agentId
|
|
52
|
+
};
|
|
53
|
+
try {
|
|
54
|
+
if (body.action === "inspect" || body.action === "start") return c.json({
|
|
55
|
+
ok: true,
|
|
56
|
+
payload: await service.command(body.action, {}, context)
|
|
57
|
+
});
|
|
58
|
+
if (!body.setupId) return c.json({
|
|
59
|
+
ok: false,
|
|
60
|
+
error: "setupId is required"
|
|
61
|
+
}, 400);
|
|
62
|
+
const setup = service.owned(body.setupId, context.conversationId, context.agentId);
|
|
63
|
+
if (body.action === "get" || body.action === "recheck" || body.action === "cancel") return c.json({
|
|
64
|
+
ok: true,
|
|
65
|
+
payload: await service.command(body.action, { setupId: setup.id }, context)
|
|
66
|
+
});
|
|
67
|
+
const principalId = getGatewayPrincipal(c).principalId;
|
|
68
|
+
if (body.action === "approve") {
|
|
69
|
+
if (!body.expectedRevision) throw new Error("expectedRevision is required");
|
|
70
|
+
return c.json({
|
|
71
|
+
ok: true,
|
|
72
|
+
payload: service.view(service.approve(setup, principalId, body.expectedRevision))
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (body.action === "release") return c.json({
|
|
76
|
+
ok: true,
|
|
77
|
+
payload: service.view(await service.release(setup))
|
|
78
|
+
});
|
|
79
|
+
if (setup.approvedBy !== principalId) return c.json({
|
|
80
|
+
ok: false,
|
|
81
|
+
error: "Plan must be approved by this owner"
|
|
82
|
+
}, 403);
|
|
83
|
+
if (body.action === "prepare") return c.json({
|
|
84
|
+
ok: true,
|
|
85
|
+
payload: service.view(await service.prepare(setup))
|
|
86
|
+
});
|
|
87
|
+
if (body.action === "open") {
|
|
88
|
+
await service.open(setup, body.open ?? "both");
|
|
89
|
+
return c.json({
|
|
90
|
+
ok: true,
|
|
91
|
+
payload: service.view(readBrowserSetup(setup.id))
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
if (body.action === "begin_verification") {
|
|
95
|
+
if (!body.endpointId || !body.expectedRevision) throw new Error("Select an endpoint and provide expectedRevision");
|
|
96
|
+
return c.json({
|
|
97
|
+
ok: true,
|
|
98
|
+
payload: service.view(service.begin(setup, body.endpointId, new URL(c.req.url).origin, body.expectedRevision))
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return c.json({
|
|
102
|
+
ok: false,
|
|
103
|
+
error: "Unsupported action"
|
|
104
|
+
}, 400);
|
|
105
|
+
} catch (error) {
|
|
106
|
+
return c.json({
|
|
107
|
+
ok: false,
|
|
108
|
+
error: error instanceof Error ? error.message : "Browser setup failed"
|
|
109
|
+
}, 409);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { registerBrowserSetupRoutes };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { Hono } from 'hono';
|
|
1
|
+
import type { Context, Hono } from 'hono';
|
|
2
2
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
3
|
+
export declare function isLocalOwnerRequest(c: Context, service: AuthenticatedRouteDeps['service']): boolean;
|
|
3
4
|
export declare function registerBrowserRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|
|
@@ -163,6 +163,14 @@ const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
|
163
163
|
return { register: registerBrowserAutomationRoutes };
|
|
164
164
|
}
|
|
165
165
|
},
|
|
166
|
+
{
|
|
167
|
+
id: "browser-setup",
|
|
168
|
+
match: (path) => path === "/api/browser/setup",
|
|
169
|
+
load: async () => {
|
|
170
|
+
const { registerBrowserSetupRoutes } = await import("./browser-setup.js");
|
|
171
|
+
return { register: registerBrowserSetupRoutes };
|
|
172
|
+
}
|
|
173
|
+
},
|
|
166
174
|
{
|
|
167
175
|
id: "browser",
|
|
168
176
|
match: (path) => startsWithAny(path, ["/api/browser"]),
|
|
@@ -2,8 +2,8 @@ import { init_paths_state, resolveStateDir } from "../../../config/paths-state.j
|
|
|
2
2
|
import { resolveAdbPath } from "../../../phone/adb-driver.js";
|
|
3
3
|
import { getPhoneRuntime } from "../../../phone/runtime.js";
|
|
4
4
|
import { RuntimeError } from "../../../runtime-tools/errors.js";
|
|
5
|
-
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
6
5
|
import { PhoneDependencyManager, probePhoneAdb } from "../../../runtime-tools/phone-dependencies.js";
|
|
6
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { Hono } from "hono";
|
|
9
9
|
import { bodyLimit } from "hono/body-limit";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Hono } from 'hono';
|
|
2
|
+
import { PhoneSetupService } from '../../../phone/setup/service.js';
|
|
3
|
+
import type { GatewayService } from '../../service.js';
|
|
4
|
+
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
5
|
+
export declare function createPhoneSetupService(service: GatewayService): PhoneSetupService;
|
|
6
|
+
/** Registered inside the existing Phone admin route group. */
|
|
7
|
+
export declare function registerPhoneSetupRoutes(app: Hono, deps: AuthenticatedRouteDeps): void;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { resolveStateDir } from "../../../config/paths-state.js";
|
|
2
|
+
import { getSessionMetadata, init_session_read_repository } from "../../../storage/sqlite/session-read-repository.js";
|
|
3
|
+
import { init_paths } from "../../../config/paths.js";
|
|
4
|
+
import { resolveEffectiveAgentConfigForAgent } from "../../../config/agent-profile.js";
|
|
5
|
+
import { getModelRegistry, init_model_registry } from "../../../providers/model-registry.js";
|
|
6
|
+
import { init_providers, isProviderConfiguredSync } from "../../../providers/index.js";
|
|
7
|
+
import { phoneAllowsApp } from "../../../phone/app-access.js";
|
|
8
|
+
import { phoneModelProfile } from "../../../phone/model-adapter.js";
|
|
9
|
+
import { getPhoneRuntime } from "../../../phone/runtime.js";
|
|
10
|
+
import { PhoneSetupService } from "../../../phone/setup/service.js";
|
|
11
|
+
import { PhoneDependencyManager } from "../../../runtime-tools/phone-dependencies.js";
|
|
12
|
+
import { createHash } from "node:crypto";
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
//#region src/gateway/hono/routes/phone-setup.ts
|
|
15
|
+
init_paths();
|
|
16
|
+
init_model_registry();
|
|
17
|
+
init_providers();
|
|
18
|
+
init_session_read_repository();
|
|
19
|
+
function createPhoneSetupService(service) {
|
|
20
|
+
const runtime = getPhoneRuntime();
|
|
21
|
+
return new PhoneSetupService({
|
|
22
|
+
runtime,
|
|
23
|
+
revision: (context, deviceId) => {
|
|
24
|
+
const agent = resolveEffectiveAgentConfigForAgent(context.agentId).config;
|
|
25
|
+
const device = runtime.repository.list().find((device) => device.id === deviceId);
|
|
26
|
+
const model = agent.models.phoneUse?.primary ? getModelRegistry().resolve(agent.models.phoneUse.primary) : void 0;
|
|
27
|
+
return createHash("sha256").update(JSON.stringify([
|
|
28
|
+
service.currentConfig.phone,
|
|
29
|
+
agent.models.phoneUse,
|
|
30
|
+
agent.tools.phone_use,
|
|
31
|
+
agent.toolAllowlist,
|
|
32
|
+
device,
|
|
33
|
+
model && [
|
|
34
|
+
model.api,
|
|
35
|
+
model.baseUrl,
|
|
36
|
+
model.input,
|
|
37
|
+
phoneModelProfile(model)
|
|
38
|
+
]
|
|
39
|
+
])).digest("hex");
|
|
40
|
+
},
|
|
41
|
+
leaseActive: (deviceId) => {
|
|
42
|
+
const device = runtime.repository.list().find((device) => device.id === deviceId);
|
|
43
|
+
return device ? runtime.repository.leaseActive(device.serial) : false;
|
|
44
|
+
},
|
|
45
|
+
connected: async (deviceId, signal) => {
|
|
46
|
+
const device = runtime.repository.get(deviceId);
|
|
47
|
+
return (await (await runtime.driverFor(device, service.currentConfig)).discover(signal)).some((found) => found.serial === device.serial && found.state === "device");
|
|
48
|
+
},
|
|
49
|
+
inspect: async (context, source) => {
|
|
50
|
+
const config = service.currentConfig;
|
|
51
|
+
const resolved = resolveEffectiveAgentConfigForAgent(context.agentId);
|
|
52
|
+
const agent = resolved.config;
|
|
53
|
+
const ref = agent.models.phoneUse?.primary;
|
|
54
|
+
const model = ref ? getModelRegistry().resolve(ref) : void 0;
|
|
55
|
+
const dependencies = await new PhoneDependencyManager({
|
|
56
|
+
stateDir: resolveStateDir(),
|
|
57
|
+
config: config.runtimeTools,
|
|
58
|
+
adbPath: config.phone.adbPath
|
|
59
|
+
}).status();
|
|
60
|
+
let localDiscovery = [];
|
|
61
|
+
let diagnostic;
|
|
62
|
+
if (source === "local" && dependencies.some((item) => item.kind === "adb" && item.state === "ready")) try {
|
|
63
|
+
localDiscovery = (await runtime.discover(config)).map(({ name, state, emulator }) => ({
|
|
64
|
+
name,
|
|
65
|
+
state,
|
|
66
|
+
emulator
|
|
67
|
+
}));
|
|
68
|
+
} catch {
|
|
69
|
+
diagnostic = "PHONE_SETUP_DISCOVERY_FAILED";
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
enabled: config.phone.enabled,
|
|
73
|
+
toolAllowed: agent.tools.phone_use?.mode !== "deny" && (!agent.toolAllowlist || agent.toolAllowlist.includes("phone_use")),
|
|
74
|
+
model: {
|
|
75
|
+
ref,
|
|
76
|
+
source: resolved.sources["models.phoneUse.primary"],
|
|
77
|
+
chatRef: agent.models.chat?.primary,
|
|
78
|
+
supported: Boolean(model && phoneModelProfile(model)),
|
|
79
|
+
configured: Boolean(model && isProviderConfiguredSync(model.provider))
|
|
80
|
+
},
|
|
81
|
+
dependencies: dependencies.map(({ kind, state, version, canInstall }) => ({
|
|
82
|
+
kind,
|
|
83
|
+
state,
|
|
84
|
+
version,
|
|
85
|
+
canInstall
|
|
86
|
+
})),
|
|
87
|
+
devices: runtime.repository.list().map((device) => ({
|
|
88
|
+
id: device.id,
|
|
89
|
+
name: device.name,
|
|
90
|
+
source: device.connection ? "aliyun" : "local",
|
|
91
|
+
enabled: device.enabled,
|
|
92
|
+
settingsAllowed: phoneAllowsApp(device, "com.android.settings")
|
|
93
|
+
})),
|
|
94
|
+
localDiscovery,
|
|
95
|
+
diagnostic
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/** Registered inside the existing Phone admin route group. */
|
|
101
|
+
function registerPhoneSetupRoutes(app, deps) {
|
|
102
|
+
const schema = z.strictObject({
|
|
103
|
+
conversationId: z.string().uuid(),
|
|
104
|
+
setupId: z.string().uuid().optional(),
|
|
105
|
+
action: z.enum([
|
|
106
|
+
"inspect",
|
|
107
|
+
"start",
|
|
108
|
+
"get",
|
|
109
|
+
"recheck",
|
|
110
|
+
"source",
|
|
111
|
+
"begin_verification",
|
|
112
|
+
"release",
|
|
113
|
+
"cancel"
|
|
114
|
+
]),
|
|
115
|
+
source: z.enum(["local", "aliyun"]).optional(),
|
|
116
|
+
deviceId: z.string().uuid().optional(),
|
|
117
|
+
expectedRevision: z.number().int().positive().optional()
|
|
118
|
+
});
|
|
119
|
+
app.post("/api/phone/setup", deps.strictRateLimitMiddleware, async (c) => {
|
|
120
|
+
const parsed = schema.safeParse(await c.req.json().catch(() => null));
|
|
121
|
+
if (!parsed.success) return c.json({
|
|
122
|
+
ok: false,
|
|
123
|
+
error: "Invalid phone setup request"
|
|
124
|
+
}, 400);
|
|
125
|
+
const body = parsed.data;
|
|
126
|
+
const metadata = getSessionMetadata(body.conversationId);
|
|
127
|
+
if (!metadata) return c.json({
|
|
128
|
+
ok: false,
|
|
129
|
+
error: "Conversation not found"
|
|
130
|
+
}, 404);
|
|
131
|
+
const context = {
|
|
132
|
+
conversationId: body.conversationId,
|
|
133
|
+
agentId: metadata.agentId
|
|
134
|
+
};
|
|
135
|
+
const setup = deps.service.phoneSetup;
|
|
136
|
+
try {
|
|
137
|
+
let payload;
|
|
138
|
+
if (body.action === "source") {
|
|
139
|
+
if (!body.setupId || !body.source || !body.expectedRevision) throw new Error("Choose a source and refresh current progress");
|
|
140
|
+
payload = await setup.source(context, body.setupId, body.source, body.expectedRevision);
|
|
141
|
+
} else if (body.action === "begin_verification") {
|
|
142
|
+
if (!body.setupId || !body.deviceId || !body.expectedRevision) throw new Error("Select a phone and approve the current test");
|
|
143
|
+
payload = await setup.begin(context, body.setupId, body.deviceId, body.expectedRevision, c.req.raw.signal);
|
|
144
|
+
} else if (body.action === "release") {
|
|
145
|
+
if (!body.setupId) throw new Error("setupId is required");
|
|
146
|
+
payload = await setup.release(context, body.setupId);
|
|
147
|
+
} else payload = await setup.command(body.action, { setupId: body.setupId }, context);
|
|
148
|
+
c.header("Cache-Control", "no-store");
|
|
149
|
+
return c.json({
|
|
150
|
+
ok: true,
|
|
151
|
+
payload
|
|
152
|
+
});
|
|
153
|
+
} catch (error) {
|
|
154
|
+
return c.json({
|
|
155
|
+
ok: false,
|
|
156
|
+
error: error instanceof Error ? error.message : "Phone setup failed"
|
|
157
|
+
}, 409);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
export { createPhoneSetupService, registerPhoneSetupRoutes };
|
|
@@ -7,6 +7,7 @@ import { init_providers, isProviderConfiguredSync } from "../../../providers/ind
|
|
|
7
7
|
import { normalizePhoneAppAccess, phoneAppAccess } from "../../../phone/app-access.js";
|
|
8
8
|
import { createPhoneModel, phoneModelProfile } from "../../../phone/model-adapter.js";
|
|
9
9
|
import { getPhoneRuntime, phoneExecutionContext } from "../../../phone/runtime.js";
|
|
10
|
+
import { registerPhoneSetupRoutes } from "./phone-setup.js";
|
|
10
11
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
11
12
|
import { randomUUID } from "node:crypto";
|
|
12
13
|
import { z } from "zod";
|
|
@@ -53,6 +54,7 @@ function registerPhoneRoutes(parent, deps, runtime = getPhoneRuntime()) {
|
|
|
53
54
|
}, 403);
|
|
54
55
|
return next();
|
|
55
56
|
});
|
|
57
|
+
registerPhoneSetupRoutes(app, deps);
|
|
56
58
|
app.use("/api/phone/cloud/aliyun/*", bodyLimit({
|
|
57
59
|
maxSize: 24 * 1024,
|
|
58
60
|
onError: (c) => c.json({
|
|
@@ -147,6 +149,14 @@ function registerPhoneRoutes(parent, deps, runtime = getPhoneRuntime()) {
|
|
|
147
149
|
payload: { applications }
|
|
148
150
|
});
|
|
149
151
|
});
|
|
152
|
+
app.get("/api/phone/devices/:id/input-status", async (c) => {
|
|
153
|
+
const payload = await runtime.textInputStatus(c.req.param("id"), service.currentConfig, c.req.raw.signal);
|
|
154
|
+
c.header("Cache-Control", "no-store");
|
|
155
|
+
return c.json({
|
|
156
|
+
ok: true,
|
|
157
|
+
payload
|
|
158
|
+
});
|
|
159
|
+
});
|
|
150
160
|
app.post("/api/phone/devices", strictRateLimitMiddleware, async (c) => {
|
|
151
161
|
const input = deviceInput.parse(await c.req.json());
|
|
152
162
|
if (!(await runtime.discover(service.currentConfig, c.req.raw.signal)).some((device) => device.serial === input.serial && device.state === "device")) throw new PhoneError("PHONE_DEVICE_OFFLINE", "Choose a connected and authorized ADB device");
|
|
@@ -209,13 +219,7 @@ function registerPhoneRoutes(parent, deps, runtime = getPhoneRuntime()) {
|
|
|
209
219
|
});
|
|
210
220
|
app.get("/api/phone/models", (c) => c.json({
|
|
211
221
|
ok: true,
|
|
212
|
-
payload: { models: [{
|
|
213
|
-
id: MOCK_PHONE_MODEL,
|
|
214
|
-
name: "Mock · Android Settings test",
|
|
215
|
-
profile: "mock-settings-about",
|
|
216
|
-
mock: true,
|
|
217
|
-
configured: true
|
|
218
|
-
}, ...getModelRegistry().getAll().flatMap((model) => {
|
|
222
|
+
payload: { models: [...getModelRegistry().getAll().flatMap((model) => {
|
|
219
223
|
const profile = phoneModelProfile(model);
|
|
220
224
|
return profile ? [{
|
|
221
225
|
id: `${model.provider}/${model.id}`,
|
|
@@ -10,6 +10,8 @@ import { createHash, timingSafeEqual } from "node:crypto";
|
|
|
10
10
|
init_package_version();
|
|
11
11
|
init_sqlite();
|
|
12
12
|
const PUBLIC_UI_ROOT_ASSETS = [
|
|
13
|
+
"browser-setup-test.html",
|
|
14
|
+
"browser-setup-test.js",
|
|
13
15
|
"apple-touch-icon.png",
|
|
14
16
|
"favicon-16x16.png",
|
|
15
17
|
"favicon-32x32.png",
|
|
@@ -19,7 +19,7 @@ async function loadProviderSetupSnapshot(provider, config) {
|
|
|
19
19
|
}
|
|
20
20
|
function readProviderSetupSnapshot(provider, configured, config) {
|
|
21
21
|
const languageProvider = getAllProviders().includes(provider);
|
|
22
|
-
const models = (languageProvider ? getModelsByProvider(provider) : []).filter((model) => !("computerUse" in model && model.computerUse));
|
|
22
|
+
const models = (languageProvider ? getModelsByProvider(provider) : []).filter((model) => !("computerUse" in model && model.computerUse) && !("phoneUse" in model && model.phoneUse));
|
|
23
23
|
const recommended = new Set((languageProvider ? getRecommendedModelsForProvider(provider) : []).map((model) => model.ref));
|
|
24
24
|
const source = getModelCatalogStore().getSource(provider);
|
|
25
25
|
const image = getImageGenerationProvider(provider);
|
|
@@ -325,6 +325,8 @@ export declare class GatewayConfigCoordinator {
|
|
|
325
325
|
};
|
|
326
326
|
phone: {
|
|
327
327
|
enabled: boolean;
|
|
328
|
+
semanticControls: boolean;
|
|
329
|
+
hierarchicalPlanning: boolean;
|
|
328
330
|
maxActionsPerSession: number;
|
|
329
331
|
maxModelRequests: number;
|
|
330
332
|
maxOperationDurationMs: number;
|
|
@@ -8,8 +8,8 @@ import { reloadImageGenerationProviders } from "../../agent/image/generation/pro
|
|
|
8
8
|
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
9
9
|
import { ConfigHotReloader } from "../../config/reload.js";
|
|
10
10
|
import "../../config/index.js";
|
|
11
|
-
import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
|
|
12
11
|
import { computeExtensionActivationPatch } from "../../extensions/bundled-extension-activation.js";
|
|
12
|
+
import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
|
|
13
13
|
import { isDeepStrictEqual } from "node:util";
|
|
14
14
|
//#region src/gateway/service/config-coordinator.ts
|
|
15
15
|
/**
|
|
@@ -15,8 +15,8 @@ import { TaskApplicationService } from "../../tasks/task-application-service.js"
|
|
|
15
15
|
import { injectSourceContextsIntoUserMessage } from "../../agent/source-context/injector.js";
|
|
16
16
|
import { deleteMediaUrisNoLongerReferenced } from "../../media/session-references.js";
|
|
17
17
|
import { fitSourceContextsToBudget } from "../../agent/source-context/budget.js";
|
|
18
|
-
import { isDeepStrictEqual } from "node:util";
|
|
19
18
|
import crypto from "node:crypto";
|
|
19
|
+
import { isDeepStrictEqual } from "node:util";
|
|
20
20
|
//#region src/gateway/service/session-input-coordinator.ts
|
|
21
21
|
init_session_input_repository();
|
|
22
22
|
init_connection_wait_repository();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BrowserSetupService } from '../browser/setup/service.js';
|
|
1
2
|
import type { ClarificationSubmission } from '@xopcai/gateway-contract';
|
|
2
3
|
import { PhoneStreamGateway } from '../phone/stream-gateway.js';
|
|
3
4
|
import { WorkDiscoveryService } from '../work-discovery/service.js';
|
|
@@ -60,6 +61,10 @@ export declare class GatewayService {
|
|
|
60
61
|
readonly voiceRealtime: VoiceRealtimeRuntime;
|
|
61
62
|
getConfig(): Config;
|
|
62
63
|
getModelCatalogSync(): ModelCatalogSyncService;
|
|
64
|
+
private _phoneSetup?;
|
|
65
|
+
get phoneSetup(): import("../phone/setup/service.js").PhoneSetupService;
|
|
66
|
+
private _browserSetup?;
|
|
67
|
+
get browserSetup(): BrowserSetupService;
|
|
63
68
|
get browserAutomations(): BrowserAutomationService;
|
|
64
69
|
private stopGatewayUpdateCheck;
|
|
65
70
|
/** When set (e.g. by `GatewayServer`), `triggerGatewayProcessRestart` can stop HTTP then exit. */
|
|
@@ -29,7 +29,7 @@ import { init_session_key, resolveConversationId, sanitizeSegment } from "../rou
|
|
|
29
29
|
import { listKnowledgeItems } from "../knowledge-memory/repository.js";
|
|
30
30
|
import "../knowledge-memory/index.js";
|
|
31
31
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
32
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
32
|
+
import { resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
33
33
|
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
34
34
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
35
35
|
import { AI_USAGE_RETENTION_MS, markStaleAiUsageEventsUnknown, pruneAiUsageEvents } from "../storage/sqlite/ai-usage-repository.js";
|
|
@@ -93,6 +93,8 @@ import { DiscussionLiveWorker } from "../discussions/live-worker.js";
|
|
|
93
93
|
import { DiscussionOrganizerWorker } from "../discussions/organizer-worker.js";
|
|
94
94
|
import { DiscussionSealer } from "../discussions/sealer.js";
|
|
95
95
|
import "../discussions/index.js";
|
|
96
|
+
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
97
|
+
import "../endpoint-tools/index.js";
|
|
96
98
|
import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
|
|
97
99
|
import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
|
|
98
100
|
import "../knowledge/index.js";
|
|
@@ -100,17 +102,13 @@ import { PersonalReplyComposer } from "../personal-agent/reply-composer.js";
|
|
|
100
102
|
import { ConnectionRecoveryService } from "../connectors/connection-recovery-service.js";
|
|
101
103
|
import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
|
|
102
104
|
import { startConnectorSupervisor } from "../connectors/supervisor.js";
|
|
103
|
-
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
104
|
-
import "../endpoint-tools/index.js";
|
|
105
|
-
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
106
|
-
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
107
|
-
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
108
|
-
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
109
105
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
110
106
|
import { prepareAutomationAgentSession } from "./automation-agent-session.js";
|
|
111
107
|
import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
|
|
112
108
|
import { getGatewayFileSpaceService } from "./file-space-service.js";
|
|
113
109
|
import { reconcileHomeIntelligenceAutomation } from "./home-intelligence-automation-reconciler.js";
|
|
110
|
+
import { createPhoneSetupService } from "./hono/routes/phone-setup.js";
|
|
111
|
+
import { BrowserSetupService } from "../browser/setup/service.js";
|
|
114
112
|
import { PhoneStreamGateway } from "../phone/stream-gateway.js";
|
|
115
113
|
import { PersonalProactivityService } from "../personal-agent/proactivity/service.js";
|
|
116
114
|
import { reconcilePersonalProactivityAutomation } from "../personal-agent/proactivity/automation.js";
|
|
@@ -164,6 +162,10 @@ import { TaskMainUpdateDecisionService } from "../tasks/task-main-update-decisio
|
|
|
164
162
|
import { selectTaskMainUpdateAttempt, submitAndConfirmTaskMainUpdate } from "../tasks/task-main-update-input.js";
|
|
165
163
|
import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
|
|
166
164
|
import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
|
|
165
|
+
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
166
|
+
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
167
|
+
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
168
|
+
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
167
169
|
import crypto from "node:crypto";
|
|
168
170
|
//#region src/gateway/service.ts
|
|
169
171
|
init_session_repository();
|
|
@@ -303,6 +305,47 @@ var GatewayService = class {
|
|
|
303
305
|
getModelCatalogSync() {
|
|
304
306
|
return this.modelCatalogSync;
|
|
305
307
|
}
|
|
308
|
+
_phoneSetup;
|
|
309
|
+
get phoneSetup() {
|
|
310
|
+
return this._phoneSetup ??= createPhoneSetupService(this);
|
|
311
|
+
}
|
|
312
|
+
_browserSetup;
|
|
313
|
+
get browserSetup() {
|
|
314
|
+
return this._browserSetup ??= new BrowserSetupService({
|
|
315
|
+
getConfig: () => this.currentConfig,
|
|
316
|
+
saveConfig: (next, expected) => this.saveConfig(next, expected),
|
|
317
|
+
endpoints: this.endpointTools,
|
|
318
|
+
canSwitchDriver: (conversationId) => !this._agentService?.hasBrowserSessions() && !this.agentRunner.listActiveRuns().some((run) => run.conversationId !== conversationId),
|
|
319
|
+
policyRevision: (agentId) => {
|
|
320
|
+
const effective = resolveEffectiveAgentConfigForAgent(agentId).config;
|
|
321
|
+
return crypto.createHash("sha256").update(JSON.stringify({
|
|
322
|
+
policy: effective.tools.browser_use,
|
|
323
|
+
allowlist: effective.toolAllowlist
|
|
324
|
+
})).digest("hex");
|
|
325
|
+
},
|
|
326
|
+
canUseBrowser: (agentId) => {
|
|
327
|
+
const effective = resolveEffectiveAgentConfigForAgent(agentId).config;
|
|
328
|
+
return effective.tools.browser_use?.mode !== "deny" && (!effective.toolAllowlist || effective.toolAllowlist.includes("browser_use"));
|
|
329
|
+
},
|
|
330
|
+
release: async (endpointId, sessionId) => (await new RealtimeExtensionBrowserProvider(this.endpointTools).send({
|
|
331
|
+
action: "close",
|
|
332
|
+
sessionId,
|
|
333
|
+
target: {
|
|
334
|
+
kind: "endpoint",
|
|
335
|
+
endpointId
|
|
336
|
+
}
|
|
337
|
+
})).result,
|
|
338
|
+
doctor: async () => (await import("../browser/providers/browser-ext-install.js")).browserExtDoctor(),
|
|
339
|
+
prepare: async () => {
|
|
340
|
+
const installer = await import("../browser/providers/browser-ext-install.js");
|
|
341
|
+
return {
|
|
342
|
+
files: await installer.ensureBrowserExtensionArtifacts(),
|
|
343
|
+
nativeHost: await installer.installBrowserNativeMessagingHost({ configPath: this.getHealth().configPath })
|
|
344
|
+
};
|
|
345
|
+
},
|
|
346
|
+
open: async (action) => (await import("../browser/providers/browser-ext-install.js")).openBrowserExtensionInstallUi({ action })
|
|
347
|
+
});
|
|
348
|
+
}
|
|
306
349
|
get browserAutomations() {
|
|
307
350
|
if (!this.browserAutomationService) this.browserAutomationService = createRuntimeBrowserAutomationService({
|
|
308
351
|
getConfig: () => this.config,
|
|
@@ -682,6 +725,8 @@ var GatewayService = class {
|
|
|
682
725
|
endpointTools: this.endpointTools,
|
|
683
726
|
getAutomationService: () => this.automationService,
|
|
684
727
|
getBrowserAutomationService: () => this.browserAutomations,
|
|
728
|
+
getBrowserSetupService: () => this.browserSetup,
|
|
729
|
+
getPhoneSetupService: () => this.phoneSetup,
|
|
685
730
|
emitBrowserEvent: (type, payload) => this.emit(type, payload),
|
|
686
731
|
getNotesService: () => this.notesService,
|
|
687
732
|
getProjectService: () => this.projects,
|
|
@@ -7,6 +7,7 @@ import { init_model_policy, isComputerModel, isDedicatedComputerProfile } from "
|
|
|
7
7
|
import { voiceSupportsMode } from "../../packages/realtime-protocol/src/voice-catalog.js";
|
|
8
8
|
import { init_voice } from "../../packages/realtime-protocol/src/voice.js";
|
|
9
9
|
import { getModelCatalogStore, init_model_catalog_store } from "../providers/model-catalog-store.js";
|
|
10
|
+
import { phoneModelProfile } from "../phone/model-adapter.js";
|
|
10
11
|
import { compareCatalogModels } from "../providers/model-catalog-ranking.js";
|
|
11
12
|
import { prepareUpdateGlobalDefaults } from "./global-defaults-admin.js";
|
|
12
13
|
//#region src/gateway/xopc-cloud-capability-setup.ts
|
|
@@ -17,7 +18,7 @@ init_agent_config();
|
|
|
17
18
|
init_repository();
|
|
18
19
|
init_model_catalog_store();
|
|
19
20
|
function supportsCapability(model, capability) {
|
|
20
|
-
if (model.availability !== "available" || isDedicatedComputerProfile(model.computerUse?.profile)) return false;
|
|
21
|
+
if (model.availability !== "available" || model.phoneUse || isDedicatedComputerProfile(model.computerUse?.profile)) return false;
|
|
21
22
|
if (capability === "chat") return model.kind === "language" && (model.operations.includes("chat.completions") || model.operations.includes("responses"));
|
|
22
23
|
if (capability === "vision") return model.kind === "language" && model.input.includes("image");
|
|
23
24
|
if (capability === "image-generation") return model.kind === "image" && model.operations.includes("images.generate");
|
|
@@ -100,6 +101,11 @@ function completeXopcCloudModelRoutes(models, source) {
|
|
|
100
101
|
api: source.api
|
|
101
102
|
})).sort((left, right) => compareCatalogModels(left, right))[0];
|
|
102
103
|
if (computer) next.computerUse ??= route(computer);
|
|
104
|
+
const phone = source.models.filter((model) => model.availability === "available" && phoneModelProfile({
|
|
105
|
+
...model,
|
|
106
|
+
api: source.api
|
|
107
|
+
})).sort((left, right) => compareCatalogModels(left, right, "phone"))[0];
|
|
108
|
+
if (phone) next.phoneUse ??= route(phone);
|
|
103
109
|
return next;
|
|
104
110
|
}
|
|
105
111
|
/** Build one atomic config update for the managed XOPC Cloud chat and media capabilities. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
3
4
|
import { homePatternKey } from "./strategy.js";
|
|
5
|
+
import { HomeAdvicePolicy } from "./policy.js";
|
|
4
6
|
import { HomeIntelligenceRepository } from "./repository.js";
|
|
5
7
|
import { HomeOpportunityApplicationService } from "./application-service.js";
|
|
6
|
-
import { HomeAdvicePolicy } from "./policy.js";
|
|
7
|
-
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
8
8
|
import { buildHomeOpportunityNotification } from "./notification.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
//#region src/home-intelligence/host.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { init_global_singleton, resolveGlobalSingleton } from "../utils/global-singleton.js";
|
|
3
|
-
import { init_process_diagnostics, recordProcessDiagnostic } from "./process-diagnostics.js";
|
|
4
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
5
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
+
import { init_global_singleton, resolveGlobalSingleton } from "../utils/global-singleton.js";
|
|
5
|
+
import { init_process_diagnostics, recordProcessDiagnostic } from "./process-diagnostics.js";
|
|
6
6
|
import { init_sqlite_errors, isTransientSqliteError } from "./sqlite-errors.js";
|
|
7
7
|
//#region src/infra/unhandled-rejections.ts
|
|
8
8
|
function installSqliteTransientRejectionHandler() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../package-version.js";
|
|
2
|
+
import { runPostUpdateExtensionSync } from "../extensions/update.js";
|
|
2
3
|
import "./update-channels.js";
|
|
3
4
|
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
4
5
|
import { readPackageName, readPackageVersion } from "./package-json.js";
|
|
@@ -8,7 +9,6 @@ import { runGlobalPackageUpdateSteps } from "./package-update-steps.js";
|
|
|
8
9
|
import { resolveStableNodePath } from "./stable-node-path.js";
|
|
9
10
|
import { trimLogTail } from "./update-log.js";
|
|
10
11
|
import { maybeRestartGatewayAfterUpdate, prepareGatewayRestart } from "./update-restart.js";
|
|
11
|
-
import { runPostUpdateExtensionSync } from "../extensions/update.js";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import fs from "node:fs/promises";
|
|
14
14
|
//#region src/infra/update-runner.ts
|
|
@@ -5,7 +5,7 @@ import { PERSONAL_REPLY_EXAMPLES, PERSONAL_REPLY_STYLE_RULES } from "./reply-sty
|
|
|
5
5
|
//#region src/personal-agent/prompts.ts
|
|
6
6
|
const DELEGATION_RULES = [
|
|
7
7
|
"Answer directly when your capabilities suffice. Otherwise call personal_task(command=\"submit\") with a short objective. For a self-contained current request send {command:\"submit\", objective:\"short outcome\", useOriginalRequest:true}; command is required. With this mode, the host copies its entire stored text, including exact constraints. Preserve sourceRefs and explicitly requested Agent/Skills. Use a concise complete description instead when earlier conversation must be synthesized. Submit before reading materials. The background Task Router selects and starts the executor. After the tool succeeds, reply only with a short confirmation such as \"Submitted; I will report the result here.\" in the conversation language, then finish. Do not restate any task details, files, requirements or acceptance criteria, and do not wait for the worker. Remain available for conversation.",
|
|
8
|
-
"Reuse the existing Task. Inspect get/list only when status is needed; updates and results arrive automatically. Read full questions with get/entry (follow nextBodyOffset); use collaboration/afterSequence for older messages.
|
|
8
|
+
"Reuse the existing Task. Inspect get/list only when status is needed; updates and results arrive automatically. Read full questions with get/entry (follow nextBodyOffset); use collaboration/afterSequence for older messages. For running work send {command:\"instruct\", taskId, instruction} directly for new direction; no baseline lookup is needed. Use revise only after completion with an actual returned result baseline; a missing baseline means use instruct, never fabricate baselineResultId/baselineVersion. Use answer with the exact questionId for a worker question, resolving it from the brief or conversation first. If you asked the user a worker question, deliver their next answer to that question on this same Task. Do not just acknowledge it in chat. Report saved, delivered and executor-confirmed separately; do not wait or poll for acknowledgement. The final result must reflect the latest direction and disclose anything unconfirmed or unmet. retry_allocation retries selection before execution; inspect previous effects before retrying an execution.",
|
|
9
9
|
"For current news or other live facts, require dated sources in the brief. For recurring work, specify the required automation capability. Report actual allocation, execution and verification states; do not treat submission as execution or a successful run as accepted completion."
|
|
10
10
|
];
|
|
11
11
|
const TASK_BRIEF_RULE = "When useOriginalRequest=true, keep objective to one short outcome (not a list of files or requirements), and omit description and redundant structured fields; the host copies the complete current input, so do not rewrite or summarize away its constraints. For a context-dependent request, prepare the Task brief by preserving the user request, not by planning the execution. For a straightforward request, use one short paragraph or a few bullets, usually no longer than the user request. Preserve all requested inputs, outputs, permissions and verification. Do not invent extra analyses, edge cases, steps, files or constraints; the worker plans and inspects the data. Default submit fields are objective and description, plus a short title when useful. Omit requirements, expectedOutputs, acceptanceCriteria and constraints when they only repeat the description; use requiredSkills or requirements.requestedAgentId only for an explicit user instruction. Preserve long or exact user specifications completely.";
|