@xopcai/xopc 0.0.333 → 0.0.334
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/dist/assets/{auth-DocRzRlS.js → auth-Cjj5SuoT.js} +49 -39
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +240 -36
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DiI2O7lC.js → agent-avatar-dicebear-B73q7mlz.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-CVp3J969.js → agent-defaults-settings-panel-B9L2YIXz.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-CacyndrS.js → agent-plugin-dialog-COOjsvea.js} +1 -1
- package/dist/gateway/static/root/assets/agents-CCj1JnLu.js +70 -0
- package/dist/gateway/static/root/assets/agents-admin-api-Cuqi5xZn.js +2 -0
- package/dist/gateway/static/root/assets/{app-link-C6gA5Nck.js → app-link-DRL0YnPs.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BcszTlqr.js → app-management-settings-panel-CckioKud.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B1XPe8qz.js → appearance-settings-DDiPIr_Q.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-Azqy8vfo.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-MjUsJcNb.js → archive-plugin-Dtyr0RhX.js} +1 -1
- package/dist/gateway/static/root/assets/attachment-load-qjPpQzYY.js +1 -0
- package/dist/gateway/static/root/assets/attachment-utils-core-BIOUBrpT.js +1 -0
- package/dist/gateway/static/root/assets/{automations-page-Dsjivdxs.js → automations-page-g3SrFkTC.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-B0nW2nZD.js +7 -0
- package/dist/gateway/static/root/assets/binary-plugins-BwKQVxsU.js +2 -0
- package/dist/gateway/static/root/assets/{block-editor-Bx0uXbJP.js → block-editor-DD9d5pCt.js} +29 -29
- package/dist/gateway/static/root/assets/{browser-automation-inputs-1ZIPGDeq.js → browser-automation-inputs-D2gNdS3e.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CCjYipHc.js → browser-automations-page-BKqqJR7P.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-BZH9bZbk.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-CHk4RZl4.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-CfWaVH-6.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C5FcWsSe.js +8 -0
- package/dist/gateway/static/root/assets/capability-header-actions-Bd66yEOa.js +1 -0
- package/dist/gateway/static/root/assets/channels-DIU5Gq4o.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Fnum_IEm.js → chat-terminal-dock-B0nPDJyj.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-DI1zfCTA.js → computer-settings-page-D7PxxaoG.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-CiGDAubm.js → connector-service-page-BZH4SeQg.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-BC81R_fz.js +2 -0
- package/dist/gateway/static/root/assets/{turn-outcome-D0SnyZ3Z.js → constants-Co2_smKQ.js} +1 -1
- package/dist/gateway/static/root/assets/date-picker-CDEVYjXI.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-DpD3xaEB.js → dependency-picker-AInmpSwC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CCoDxKqh.js → desktop-pet-Sjgnlq8M.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-GxndKfCx.js → desktop-pet-settings-BWn0rrhr.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-B71w3ptm.js → device-pairing-wizard-BtW837_d.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CUzjJvjs.js → directory-picker-path-field-2CpmDx_D.js} +1 -1
- package/dist/gateway/static/root/assets/dist-CKkafhaS.js +1 -0
- package/dist/gateway/static/root/assets/dist-io9jFpN72.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BtDY8ntX.js → extension-debug-page-WWJFj9Z5.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D9_XF-XC.js → extension-page-DL00dFRr.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CjhUFAaC.js → extension-settings-page-CN-agjPk.js} +1 -1
- package/dist/gateway/static/root/assets/{files-BK6enEvD.js → files-Bw4SBGdM.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-Ciq4c7KT.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-BHeHN26R.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-4oD6fhAm.js +1 -0
- package/dist/gateway/static/root/assets/home-page-nEpyJUBY.js +1 -0
- package/dist/gateway/static/root/assets/{imports-page-BEtq5BRU.js → imports-page-BivdeiQ5.js} +1 -1
- package/dist/gateway/static/root/assets/index-BioG1pRD.js +106 -0
- package/dist/gateway/static/root/assets/index-DbLEkdNg.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-JUYY_18v.js → keyboard-shortcuts-settings-B_8AJTFr.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CRtZQrmz.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BlYESNqz.js → local-apps-page-DclxpoqR.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-Bpja8nC6.js → local-apps-yys1VChX.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-DkolHmyp.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-DX8TxkRl.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-c4krhYU7.js → management-settings-5WFufZ4g.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BEeXMfDw.js → markdown-view-DYJnwlDr.js} +1 -1
- package/dist/gateway/static/root/assets/media-plugins-DlJDvwLK.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-GF5Q9Fqy.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-E8o4_Ty9.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-CiCmfRTw.js +1 -0
- package/dist/gateway/static/root/assets/{page-tabs-BhYBCqls.js → page-tabs-Cwp3fGVM.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-0p9PIHRy.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CP8agNlc.js → preview-open-alternatives-DJ5xqGeu.js} +1 -1
- package/dist/gateway/static/root/assets/{product-delivery-bv3z8Xkh.js → product-delivery-BAks11S4.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CU7fRhfT.js → product-open-page-CcGwNePw.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-6hhRBkmC.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DUOzRaFI.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-BWpWUXiE.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Czvzsuj_.js → runtime-tools-settings-panel-C6eDCNHz.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-pF7Lmqnk.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-B9Ni5O93.js → schema-form-D8W8q_ez.js} +1 -1
- package/dist/gateway/static/root/assets/{schemas-88fK3zzl.js → schemas-CObaziC7.js} +3 -3
- package/dist/gateway/static/root/assets/session-api-BAyUr97V.js +1 -0
- package/dist/gateway/static/root/assets/session-manager-BAy2sR2Q.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-BDKDqqf9.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-C9cJWlAq.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-jquf1P7n.js → settings-form-section-B0cAj0nq.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DPomsvba.js → settings-page-DZVVTFxs.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DZCPVx9c.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-BkPNyV8c.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-Bqlv5JBi.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-Bu7-3w-L.js → skill-api-C0dufzQC.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-3JF2OTBz.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DB4lR4om.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-BwFR0Uci.js → system-settings-panel-xjrlhdUz.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CB6M7wSs.js +1 -0
- package/dist/gateway/static/root/assets/{tasks-CDR_RVbQ.js → tasks-QQJXsiER.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-PfucxMP3.js → tunnel-api--68MQEWM.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-t_zdQHcy.js → usage-page-OLZ00eqD.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DLyy2wHz.js → use-autosave-DsnHYpTv.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-CoePFpHD.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CQDY5EBK.js → voice-api-key-field-CvIXutQp.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CJzqJ47I.js → work-discovery-overlay-By5_7MLR.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-sCOk-esV.js → workflow-run-setup-panel-HSMDxDXV.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DElQ47Da.js +6 -0
- package/dist/gateway/static/root/index.html +24 -18
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/capabilities.js +14 -2
- package/dist/packages/gateway-contract/src/index.js +6 -2
- package/dist/packages/gateway-contract/src/session-command-rejection.js +19 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +109 -0
- package/dist/packages/gateway-contract/src/sessions.js +0 -6
- package/dist/src/agent/agent-manager.js +6 -6
- package/dist/src/agent/background-review/run-background-review.js +2 -2
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/gateway-tools.js +2 -1
- package/dist/src/agent/image/tool-model-config.js +2 -2
- package/dist/src/agent/service/process-direct-streaming.js +4 -2
- package/dist/src/agent/service.js +4 -4
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/xopc-use-tool.js +1 -1
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.d.ts +11 -11
- package/dist/src/automations/domain/validation.d.ts +11 -11
- package/dist/src/automations/draft/automation-draft-validator.d.ts +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.js +1 -1
- package/dist/src/connectors/cli/authorization.d.ts +1 -1
- package/dist/src/connectors/cli/store.d.ts +1 -1
- package/dist/src/connectors/connection-candidates.js +53 -15
- package/dist/src/connectors/connection-capabilities.js +5 -1
- package/dist/src/execution-environments/local-worktree-manager.js +10 -1
- package/dist/src/execution-environments/session-environment-service.d.ts +3 -0
- package/dist/src/execution-environments/session-environment-service.js +28 -4
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +6 -2
- package/dist/src/gateway/hono/routes/browser-session.js +4 -2
- package/dist/src/gateway/hono/routes/commands-skills.js +9 -2
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/files.js +3 -0
- package/dist/src/gateway/hono/routes/models.js +17 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -4
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-command-handler.d.ts +5 -0
- package/dist/src/gateway/hono/routes/session-command-handler.js +189 -0
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +14 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +2 -2
- package/dist/src/gateway/hono/routes/sessions.js +0 -168
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/tui.js +2 -1
- package/dist/src/gateway/hono/routes/voice.js +9 -0
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/resolve-webchat-session-key.d.ts +1 -1
- package/dist/src/gateway/resolve-webchat-session-key.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service/session-command-service.d.ts +34 -0
- package/dist/src/gateway/service/session-command-service.js +81 -0
- package/dist/src/gateway/service/session-input-coordinator.d.ts +21 -0
- package/dist/src/gateway/service/session-input-coordinator.js +41 -0
- package/dist/src/gateway/service/session-preparation-worker.d.ts +15 -0
- package/dist/src/gateway/service/session-preparation-worker.js +125 -0
- package/dist/src/gateway/service.d.ts +24 -0
- package/dist/src/gateway/service.js +27 -14
- package/dist/src/gateway/side-chat/promotion-service.js +0 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/generator.js +1 -1
- package/dist/src/home-intelligence/host.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/mcp/channel-bridge.js +12 -2
- package/dist/src/notes/capabilities/read.js +2 -2
- package/dist/src/notes/service.d.ts +4 -1
- package/dist/src/notes/service.js +11 -8
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/session/store.js +0 -1
- package/dist/src/storage/sqlite/migrations/223_session_creation_receipts.sql +59 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-creation-repository.d.ts +50 -0
- package/dist/src/storage/sqlite/session-creation-repository.js +166 -0
- package/dist/src/storage/sqlite/session-input-repository.d.ts +4 -2
- package/dist/src/storage/sqlite/session-input-repository.js +7 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tui/backends/embedded-backend.d.ts +5 -0
- package/dist/src/tui/backends/embedded-backend.js +266 -20
- package/dist/src/tui/backends/embedded-drafts.d.ts +22 -0
- package/dist/src/tui/backends/embedded-drafts.js +53 -0
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +10 -0
- package/dist/src/tui/backends/gateway-realtime-backend.js +214 -33
- package/dist/src/tui/tui-backend.d.ts +1 -1
- package/dist/src/tui/tui-chat-input-state.d.ts +1 -0
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-session-format.js +0 -1
- package/dist/src/tui/tui-startup-resources.d.ts +1 -0
- package/dist/src/tui/tui-startup-resources.js +2 -2
- package/dist/src/tui/tui-types.d.ts +0 -1
- package/dist/src/tui/tui.js +69 -29
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/work-discovery/service.js +3 -6
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agents-DXYZSuUV.js +0 -70
- package/dist/gateway/static/root/assets/apps-page-ZqANbUZv.js +0 -1
- package/dist/gateway/static/root/assets/attachment-load-DHa-BI9a.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-B37vs5tk.js +0 -7
- package/dist/gateway/static/root/assets/binary-plugins-DQYcuBHP.js +0 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CSv4rvmx.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-BnO9LV7U.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-BfvDvIY1.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CoW7-ESq.js +0 -8
- package/dist/gateway/static/root/assets/capability-header-actions-D_hbWRRF.js +0 -1
- package/dist/gateway/static/root/assets/channels-BhMaRh1x.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Ono0Pha1.js +0 -2
- package/dist/gateway/static/root/assets/conversation-identity-Cw0n9uzK.js +0 -1
- package/dist/gateway/static/root/assets/date-picker-D-JhzZyW.js +0 -1
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +0 -1
- package/dist/gateway/static/root/assets/dist-Che_jiQF.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BWaCnwT1.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BTjGLngn.js +0 -1
- package/dist/gateway/static/root/assets/index-DHL16aYZ.js +0 -121
- package/dist/gateway/static/root/assets/index-N1e6PDwx.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-uI7mtoVz.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-BbLQreeN.js +0 -2
- package/dist/gateway/static/root/assets/media-plugins-DEFN1I73.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel--09xGxyE.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-DsxcVBXF.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-D43aVpCj.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-DcsFzD_i.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-U-EdDfAW.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DUOKZLt7.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-fVPQe5YS.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-C0-WHOY3.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-DdXvW09N.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BtF83fBY.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BvVlqpHf.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-b9DI0N1J.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-R_qwc4DN.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CNJAQ_e-.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-D7XPEQu_.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-PFjGW2g1.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-OyfPVfB9.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-DYBGjN7C.js +0 -6
- package/dist/src/tui/tui-empty-session-cleanup.d.ts +0 -9
- package/dist/src/tui/tui-empty-session-cleanup.js +0 -19
- /package/dist/gateway/static/root/assets/{dist-CI_fqRk-.js → dist-CI_fqRk-2.js} +0 -0
|
@@ -5713,6 +5713,43 @@ class RealtimeClient {
|
|
|
5713
5713
|
}
|
|
5714
5714
|
}
|
|
5715
5715
|
|
|
5716
|
+
const MAX_BROWSER_CONTEXTS_PER_TURN = 2;
|
|
5717
|
+
const MAX_BROWSER_SELECTION_BYTES = 32 * 1024;
|
|
5718
|
+
const MAX_BROWSER_PAGE_TEXT_BYTES = 128 * 1024;
|
|
5719
|
+
const MAX_BROWSER_CONTEXT_BODY_BYTES = 256 * 1024;
|
|
5720
|
+
const utf8Bytes = (value) => new TextEncoder().encode(value).byteLength;
|
|
5721
|
+
const browserPageContextInputSchema = strictObject({
|
|
5722
|
+
kind: literal("browser_page"),
|
|
5723
|
+
sourceId: uuid(),
|
|
5724
|
+
version: string().regex(/^[a-f0-9]{64}$/),
|
|
5725
|
+
title: string().trim().min(1).max(512),
|
|
5726
|
+
url: url(),
|
|
5727
|
+
capturedAt: number().int().nonnegative(),
|
|
5728
|
+
documentId: string().trim().min(1).max(256),
|
|
5729
|
+
selection: string().optional(),
|
|
5730
|
+
text: string().optional(),
|
|
5731
|
+
truncated: boolean()
|
|
5732
|
+
}).superRefine((value, ctx) => {
|
|
5733
|
+
const url = new URL(value.url);
|
|
5734
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.hash) {
|
|
5735
|
+
ctx.addIssue({ code: "custom", path: ["url"], message: "URL must be a sanitized HTTP(S) URL" });
|
|
5736
|
+
}
|
|
5737
|
+
if (!value.selection?.trim() && !value.text?.trim()) {
|
|
5738
|
+
ctx.addIssue({ code: "custom", message: "A browser context must include selection or page text" });
|
|
5739
|
+
}
|
|
5740
|
+
if (value.selection && utf8Bytes(value.selection) > MAX_BROWSER_SELECTION_BYTES) {
|
|
5741
|
+
ctx.addIssue({ code: "custom", path: ["selection"], message: "Selection is too large" });
|
|
5742
|
+
}
|
|
5743
|
+
if (value.text && utf8Bytes(value.text) > MAX_BROWSER_PAGE_TEXT_BYTES) {
|
|
5744
|
+
ctx.addIssue({ code: "custom", path: ["text"], message: "Page text is too large" });
|
|
5745
|
+
}
|
|
5746
|
+
});
|
|
5747
|
+
const browserPageContextsInputSchema = array(browserPageContextInputSchema).max(MAX_BROWSER_CONTEXTS_PER_TURN).superRefine((value, ctx) => {
|
|
5748
|
+
if (utf8Bytes(JSON.stringify(value)) > MAX_BROWSER_CONTEXT_BODY_BYTES) {
|
|
5749
|
+
ctx.addIssue({ code: "custom", message: "Browser contexts are too large" });
|
|
5750
|
+
}
|
|
5751
|
+
});
|
|
5752
|
+
|
|
5716
5753
|
const DEVICE_PAIRING_VERSION = 3;
|
|
5717
5754
|
const MOBILE_PAIRING_INVITATION_VERSION = 4;
|
|
5718
5755
|
const BROWSER_PAIRING_INVITATION_VERSION = 1;
|
|
@@ -5819,43 +5856,6 @@ ${action}
|
|
|
5819
5856
|
${canonical(payload)}`;
|
|
5820
5857
|
}
|
|
5821
5858
|
|
|
5822
|
-
const MAX_BROWSER_CONTEXTS_PER_TURN = 2;
|
|
5823
|
-
const MAX_BROWSER_SELECTION_BYTES = 32 * 1024;
|
|
5824
|
-
const MAX_BROWSER_PAGE_TEXT_BYTES = 128 * 1024;
|
|
5825
|
-
const MAX_BROWSER_CONTEXT_BODY_BYTES = 256 * 1024;
|
|
5826
|
-
const utf8Bytes = (value) => new TextEncoder().encode(value).byteLength;
|
|
5827
|
-
const browserPageContextInputSchema = strictObject({
|
|
5828
|
-
kind: literal("browser_page"),
|
|
5829
|
-
sourceId: uuid(),
|
|
5830
|
-
version: string().regex(/^[a-f0-9]{64}$/),
|
|
5831
|
-
title: string().trim().min(1).max(512),
|
|
5832
|
-
url: url(),
|
|
5833
|
-
capturedAt: number().int().nonnegative(),
|
|
5834
|
-
documentId: string().trim().min(1).max(256),
|
|
5835
|
-
selection: string().optional(),
|
|
5836
|
-
text: string().optional(),
|
|
5837
|
-
truncated: boolean()
|
|
5838
|
-
}).superRefine((value, ctx) => {
|
|
5839
|
-
const url = new URL(value.url);
|
|
5840
|
-
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.hash) {
|
|
5841
|
-
ctx.addIssue({ code: "custom", path: ["url"], message: "URL must be a sanitized HTTP(S) URL" });
|
|
5842
|
-
}
|
|
5843
|
-
if (!value.selection?.trim() && !value.text?.trim()) {
|
|
5844
|
-
ctx.addIssue({ code: "custom", message: "A browser context must include selection or page text" });
|
|
5845
|
-
}
|
|
5846
|
-
if (value.selection && utf8Bytes(value.selection) > MAX_BROWSER_SELECTION_BYTES) {
|
|
5847
|
-
ctx.addIssue({ code: "custom", path: ["selection"], message: "Selection is too large" });
|
|
5848
|
-
}
|
|
5849
|
-
if (value.text && utf8Bytes(value.text) > MAX_BROWSER_PAGE_TEXT_BYTES) {
|
|
5850
|
-
ctx.addIssue({ code: "custom", path: ["text"], message: "Page text is too large" });
|
|
5851
|
-
}
|
|
5852
|
-
});
|
|
5853
|
-
const browserPageContextsInputSchema = array(browserPageContextInputSchema).max(MAX_BROWSER_CONTEXTS_PER_TURN).superRefine((value, ctx) => {
|
|
5854
|
-
if (utf8Bytes(JSON.stringify(value)) > MAX_BROWSER_CONTEXT_BODY_BYTES) {
|
|
5855
|
-
ctx.addIssue({ code: "custom", message: "Browser contexts are too large" });
|
|
5856
|
-
}
|
|
5857
|
-
});
|
|
5858
|
-
|
|
5859
5859
|
const LOCALE_STORAGE_KEY = "xopc.sidepanel.locale";
|
|
5860
5860
|
const LOCALE_PATHS = {
|
|
5861
5861
|
en: "_locales/en/messages.json",
|
|
@@ -6126,6 +6126,9 @@ const GATEWAY_REQUEST_TIMEOUT_MS = 8e3;
|
|
|
6126
6126
|
const ACCESS_TOKEN_EXPIRY_MARGIN_MS = 3e4;
|
|
6127
6127
|
const REFRESH_LOCK_NAME = "xopc.browser.auth-refresh";
|
|
6128
6128
|
let refreshTask;
|
|
6129
|
+
function assertProfileIdentity(profile, expected) {
|
|
6130
|
+
if (!profile || profile.gatewayId !== expected.gatewayId || profile.deviceId !== expected.deviceId || profile.gatewayPublicKey !== expected.gatewayPublicKey) throw new Error("Gateway identity changed");
|
|
6131
|
+
}
|
|
6129
6132
|
async function browserPublicKeyThumbprint(jwk) {
|
|
6130
6133
|
const canonical = JSON.stringify({ crv: jwk.crv, kty: jwk.kty, x: jwk.x, y: jwk.y });
|
|
6131
6134
|
return encodeBase64Url(new Uint8Array(await crypto.subtle.digest(
|
|
@@ -6628,6 +6631,7 @@ async function refreshStoredProfile(options) {
|
|
|
6628
6631
|
journal
|
|
6629
6632
|
);
|
|
6630
6633
|
const current = await readProfile();
|
|
6634
|
+
assertProfileIdentity(current, profile);
|
|
6631
6635
|
if (current && current.gatewayId === profile.gatewayId && current.refreshToken !== profile.refreshToken) {
|
|
6632
6636
|
return current;
|
|
6633
6637
|
}
|
|
@@ -6641,6 +6645,7 @@ async function refreshStoredProfile(options) {
|
|
|
6641
6645
|
return next;
|
|
6642
6646
|
} catch (cause) {
|
|
6643
6647
|
const current = await readProfile();
|
|
6648
|
+
assertProfileIdentity(current, profile);
|
|
6644
6649
|
if (current && current.gatewayId === profile.gatewayId && current.refreshToken !== profile.refreshToken && current.accessTokenExpiresAt > Date.now()) return current;
|
|
6645
6650
|
if (!isRefreshDenied(cause)) throw cause;
|
|
6646
6651
|
const recovered = await recoverLocalProfile(profile.gatewayId);
|
|
@@ -6665,17 +6670,22 @@ async function getAccessProfile(options) {
|
|
|
6665
6670
|
refreshTask = void 0;
|
|
6666
6671
|
}
|
|
6667
6672
|
}
|
|
6668
|
-
async function gatewayFetch(path, init = {}) {
|
|
6673
|
+
async function gatewayFetch(path, init = {}, expectedIdentity) {
|
|
6669
6674
|
let profile = await getAccessProfile();
|
|
6675
|
+
const identity = expectedIdentity ?? profile;
|
|
6676
|
+
assertProfileIdentity(profile, identity);
|
|
6670
6677
|
const request = () => {
|
|
6671
6678
|
const headers = new Headers(init.headers);
|
|
6672
6679
|
headers.set("Authorization", `Bearer ${profile.accessToken}`);
|
|
6673
6680
|
return fetch(`${profile.gatewayUrl}${path}`, { ...init, headers });
|
|
6674
6681
|
};
|
|
6675
6682
|
let response = await request();
|
|
6683
|
+
assertProfileIdentity(await readProfile(), identity);
|
|
6676
6684
|
if (response.status !== 401) return response;
|
|
6677
6685
|
profile = await getAccessProfile({ rejectedAccessToken: profile.accessToken });
|
|
6686
|
+
assertProfileIdentity(profile, identity);
|
|
6678
6687
|
response = await request();
|
|
6688
|
+
assertProfileIdentity(await readProfile(), identity);
|
|
6679
6689
|
return response;
|
|
6680
6690
|
}
|
|
6681
6691
|
async function registerBrowserEndpoint() {
|
|
@@ -6741,4 +6751,4 @@ async function revokeAndForgetProfile() {
|
|
|
6741
6751
|
}
|
|
6742
6752
|
}
|
|
6743
6753
|
|
|
6744
|
-
export { ENDPOINT_PROTOCOL_VERSION as E, MAX_BROWSER_CONTEXTS_PER_TURN as M, PENDING_CONTEXT_KEY as P, REALTIME_PROTOCOL_VERSION as R, TAB_BINDING_PREFIX as T, RealtimeClient as a, activeTabId as b,
|
|
6754
|
+
export { runWithTabSiteAccess as A, saveExtensionLocalePreference as B, setAutoConnectEnabled as C, strictObject as D, ENDPOINT_PROTOCOL_VERSION as E, string as F, t as G, MAX_BROWSER_CONTEXTS_PER_TURN as M, PENDING_CONTEXT_KEY as P, REALTIME_PROTOCOL_VERSION as R, TAB_BINDING_PREFIX as T, _enum as _, RealtimeClient as a, activeTabId as b, array as c, boolean as d, browserPageContextsInputSchema as e, cancelPendingBrowserPairing as f, canonicalJson as g, captureTabWithPermission as h, createBrowserEndpointHello as i, currentTabDescriptor as j, discoverLocalGateway as k, discriminatedUnion as l, endpointToolContentSchema as m, extensionLocale as n, gatewayFetch as o, getAccessProfile as p, literal as q, loadExtensionLocalePreference as r, number as s, object as t, openDatabase as u, pairGateway as v, readPendingBrowserPairing as w, readProfile as x, registerBrowserEndpoint as y, revokeAndForgetProfile as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as endpointToolContentSchema, E as ENDPOINT_PROTOCOL_VERSION, g as canonicalJson, T as TAB_BINDING_PREFIX, h as captureTabWithPermission, P as PENDING_CONTEXT_KEY, G as t, x as readProfile, y as registerBrowserEndpoint, p as getAccessProfile, a as RealtimeClient, i as createBrowserEndpointHello, o as gatewayFetch, R as REALTIME_PROTOCOL_VERSION } from './assets/auth-Cjj5SuoT.js';
|
|
2
2
|
|
|
3
3
|
const BROWSER_EXTENSION_PROTOCOL_VERSION = 5;
|
|
4
4
|
const BROWSER_CONTROL_ENDPOINT_TOOL_NAME = "browser.control";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>xopc</title>
|
|
7
7
|
<script type="module" crossorigin src="./sidepanel.js"></script>
|
|
8
|
-
<link rel="modulepreload" crossorigin href="./assets/auth-
|
|
8
|
+
<link rel="modulepreload" crossorigin href="./assets/auth-Cjj5SuoT.js">
|
|
9
9
|
<link rel="stylesheet" crossorigin href="./assets/sidepanel-DD6GEMvc.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
@@ -1,4 +1,101 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as strictObject, s as number, d as boolean, F as string, c as array, _ as _enum, q as literal, t as object, l as discriminatedUnion, e as browserPageContextsInputSchema, G as t, M as MAX_BROWSER_CONTEXTS_PER_TURN, o as gatewayFetch, n as extensionLocale, u as openDatabase, a as RealtimeClient, R as REALTIME_PROTOCOL_VERSION, b as activeTabId, j as currentTabDescriptor, T as TAB_BINDING_PREFIX, p as getAccessProfile, x as readProfile, A as runWithTabSiteAccess, P as PENDING_CONTEXT_KEY, h as captureTabWithPermission, v as pairGateway, C as setAutoConnectEnabled, w as readPendingBrowserPairing, k as discoverLocalGateway, B as saveExtensionLocalePreference, z as revokeAndForgetProfile, f as cancelPendingBrowserPairing, r as loadExtensionLocalePreference } from './assets/auth-Cjj5SuoT.js';
|
|
2
|
+
|
|
3
|
+
const AppContextResourceSchema = strictObject({
|
|
4
|
+
kind: _enum(["note", "task", "project", "scene", "local_app"]),
|
|
5
|
+
id: string().min(1).max(512),
|
|
6
|
+
revision: string().min(1).max(128)
|
|
7
|
+
});
|
|
8
|
+
const AppContextEnvelopeSchema = strictObject({
|
|
9
|
+
version: literal(1),
|
|
10
|
+
clientInstanceId: string().uuid(),
|
|
11
|
+
tabId: string().uuid(),
|
|
12
|
+
sequence: number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
13
|
+
surface: _enum(["web", "electron", "mobile"]),
|
|
14
|
+
resourceRefs: array(AppContextResourceSchema).max(20),
|
|
15
|
+
selection: strictObject({ text: string().max(16e3), draft: boolean().default(false) }).optional(),
|
|
16
|
+
capturedAt: number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)
|
|
17
|
+
});
|
|
18
|
+
object({
|
|
19
|
+
snapshot: AppContextEnvelopeSchema,
|
|
20
|
+
resources: array(object({
|
|
21
|
+
reference: AppContextResourceSchema,
|
|
22
|
+
title: string(),
|
|
23
|
+
text: string().max(16e3),
|
|
24
|
+
truncated: boolean()
|
|
25
|
+
})).max(20),
|
|
26
|
+
selectionTrust: literal("user-supplied")
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const sessionCreationSchema = strictObject({
|
|
30
|
+
agentId: string().trim().min(1),
|
|
31
|
+
projectId: string().trim().min(1).nullable(),
|
|
32
|
+
execution: strictObject({
|
|
33
|
+
mode: _enum(["local_checkout", "managed_worktree"]),
|
|
34
|
+
baseRef: string().trim().min(1).optional()
|
|
35
|
+
}).nullable(),
|
|
36
|
+
temporary: boolean(),
|
|
37
|
+
model: string().trim().min(1),
|
|
38
|
+
thinkingLevel: string().min(1)
|
|
39
|
+
}).refine((value) => value.projectId !== null || value.execution === null, {
|
|
40
|
+
message: "An execution environment requires a project",
|
|
41
|
+
path: ["execution"]
|
|
42
|
+
});
|
|
43
|
+
const attachmentSchema = strictObject({
|
|
44
|
+
id: string().optional(),
|
|
45
|
+
type: string().min(1),
|
|
46
|
+
mimeType: string().optional(),
|
|
47
|
+
data: string().optional(),
|
|
48
|
+
uri: string().optional(),
|
|
49
|
+
name: string().optional(),
|
|
50
|
+
size: number().nonnegative().optional(),
|
|
51
|
+
workspaceRelativePath: string().optional(),
|
|
52
|
+
durationSeconds: number().nonnegative().optional()
|
|
53
|
+
});
|
|
54
|
+
const sessionInputContentSchema = strictObject({
|
|
55
|
+
content: string(),
|
|
56
|
+
attachments: array(attachmentSchema).optional(),
|
|
57
|
+
contextRefs: array(strictObject({
|
|
58
|
+
kind: _enum(["note", "task", "file", "session", "browser_tab", "mcp_resource"]),
|
|
59
|
+
sourceId: string().trim().min(1),
|
|
60
|
+
refId: string().regex(/^[A-Za-z0-9_-]{1,64}$/).optional(),
|
|
61
|
+
expectedVersion: string().optional()
|
|
62
|
+
})).max(5).optional(),
|
|
63
|
+
browserContexts: browserPageContextsInputSchema.optional(),
|
|
64
|
+
appContext: AppContextEnvelopeSchema.optional()
|
|
65
|
+
});
|
|
66
|
+
const originSchema = discriminatedUnion("type", [
|
|
67
|
+
strictObject({ type: literal("endpoint"), endpointId: string().min(1), token: string().min(1) }),
|
|
68
|
+
strictObject({ type: literal("system"), source: literal("cli") })
|
|
69
|
+
]);
|
|
70
|
+
const sessionInputCommandSchema = discriminatedUnion("kind", [
|
|
71
|
+
strictObject({
|
|
72
|
+
kind: literal("start"),
|
|
73
|
+
clientMessageId: string().min(1).max(128),
|
|
74
|
+
creation: sessionCreationSchema,
|
|
75
|
+
input: sessionInputContentSchema,
|
|
76
|
+
origin: originSchema
|
|
77
|
+
}),
|
|
78
|
+
strictObject({
|
|
79
|
+
kind: literal("append"),
|
|
80
|
+
clientMessageId: string().min(1).max(128),
|
|
81
|
+
expectedTranscriptId: string().min(1).max(128),
|
|
82
|
+
configVersion: number().int().nonnegative(),
|
|
83
|
+
delivery: _enum(["next", "steer"]),
|
|
84
|
+
input: sessionInputContentSchema,
|
|
85
|
+
origin: originSchema
|
|
86
|
+
})
|
|
87
|
+
]);
|
|
88
|
+
strictObject({
|
|
89
|
+
commandId: string().min(1).max(128),
|
|
90
|
+
creation: sessionCreationSchema,
|
|
91
|
+
purpose: _enum(["voice", "session_resources"])
|
|
92
|
+
});
|
|
93
|
+
object({
|
|
94
|
+
operationId: string(),
|
|
95
|
+
revision: number().int(),
|
|
96
|
+
state: _enum(["preparing", "ready", "preparation_failed"]),
|
|
97
|
+
lastError: string().nullable()
|
|
98
|
+
});
|
|
2
99
|
|
|
3
100
|
const OTHER_ACTIVITY = {
|
|
4
101
|
category: "other",
|
|
@@ -18566,6 +18663,33 @@ class GatewayRequestError extends Error {
|
|
|
18566
18663
|
}
|
|
18567
18664
|
status;
|
|
18568
18665
|
}
|
|
18666
|
+
async function deliveryScope(conversationId, expected) {
|
|
18667
|
+
if (!expected) throw new Error(t("errorProfileNotLoaded"));
|
|
18668
|
+
const profile = await readProfile();
|
|
18669
|
+
if (!profile) throw new Error(t("errorEndpointNotReady"));
|
|
18670
|
+
if (profile.gatewayId !== expected.gatewayId || profile.deviceId !== expected.deviceId || profile.gatewayPublicKey !== expected.gatewayPublicKey) throw new Error(t("errorChatChanged"));
|
|
18671
|
+
const draftKey = `creation:${profile.gatewayId}:${profile.deviceId}:${conversationId}`;
|
|
18672
|
+
return {
|
|
18673
|
+
identity: profile,
|
|
18674
|
+
draftKey,
|
|
18675
|
+
inputKey: `input:${draftKey}`,
|
|
18676
|
+
async assertCurrent() {
|
|
18677
|
+
const current = await readProfile();
|
|
18678
|
+
if (!current || current.gatewayId !== profile.gatewayId || current.deviceId !== profile.deviceId || current.gatewayPublicKey !== profile.gatewayPublicKey) throw new Error(t("errorChatChanged"));
|
|
18679
|
+
}
|
|
18680
|
+
};
|
|
18681
|
+
}
|
|
18682
|
+
async function draftStorageKey(conversationId) {
|
|
18683
|
+
const profile = await readProfile();
|
|
18684
|
+
if (!profile) throw new Error(t("errorEndpointNotReady"));
|
|
18685
|
+
return `creation:${profile.gatewayId}:${profile.deviceId}:${conversationId}`;
|
|
18686
|
+
}
|
|
18687
|
+
async function readDraft$1(conversationId) {
|
|
18688
|
+
return readBrowserOutbox(await draftStorageKey(conversationId));
|
|
18689
|
+
}
|
|
18690
|
+
async function inputStorageKey(conversationId) {
|
|
18691
|
+
return `input:${await draftStorageKey(conversationId)}`;
|
|
18692
|
+
}
|
|
18569
18693
|
async function json(response) {
|
|
18570
18694
|
const raw = await response.text();
|
|
18571
18695
|
let body;
|
|
@@ -18587,7 +18711,7 @@ async function json(response) {
|
|
|
18587
18711
|
return body;
|
|
18588
18712
|
}
|
|
18589
18713
|
function isRetryableDeliveryError(cause) {
|
|
18590
|
-
return !(cause instanceof GatewayRequestError) || cause.status === 408 || cause.status === 429 || cause.status >= 500;
|
|
18714
|
+
return !(cause instanceof GatewayRequestError) || cause.status >= 200 && cause.status < 300 || cause.status === 408 || cause.status === 429 || cause.status >= 500;
|
|
18591
18715
|
}
|
|
18592
18716
|
function activityDetail(config, fallback = "on") {
|
|
18593
18717
|
const detail = config.activityDetail && typeof config.activityDetail === "object" ? config.activityDetail : void 0;
|
|
@@ -18626,6 +18750,7 @@ class BrowserChatClient {
|
|
|
18626
18750
|
sendingInput = false;
|
|
18627
18751
|
lastOutboxRecoveryAt = 0;
|
|
18628
18752
|
sessionsRequest = 0;
|
|
18753
|
+
defaultModelId;
|
|
18629
18754
|
inputsRequest = 0;
|
|
18630
18755
|
endpointBinding;
|
|
18631
18756
|
endpointBindingTask;
|
|
@@ -18761,6 +18886,7 @@ class BrowserChatClient {
|
|
|
18761
18886
|
const conversationId = this.snapshot.conversationId;
|
|
18762
18887
|
const endpointId = this.turnClaim?.endpointId;
|
|
18763
18888
|
if (!conversationId || !endpointId) return;
|
|
18889
|
+
if (await readDraft$1(conversationId)) return;
|
|
18764
18890
|
const desired = `${conversationId}
|
|
18765
18891
|
${endpointId}`;
|
|
18766
18892
|
if (this.endpointBinding === desired) return;
|
|
@@ -18806,13 +18932,20 @@ ${endpointId}`;
|
|
|
18806
18932
|
if (requestId === this.sessionsRequest) this.update({ sessions });
|
|
18807
18933
|
}
|
|
18808
18934
|
async createSession() {
|
|
18809
|
-
const
|
|
18810
|
-
|
|
18811
|
-
|
|
18812
|
-
|
|
18813
|
-
|
|
18814
|
-
|
|
18815
|
-
|
|
18935
|
+
const conversationId = crypto.randomUUID();
|
|
18936
|
+
const scope = await deliveryScope(conversationId, this.profileIdentity);
|
|
18937
|
+
const model = this.snapshot.models.find((candidate) => candidate.id === this.defaultModelId);
|
|
18938
|
+
const creation = {
|
|
18939
|
+
agentId: "main",
|
|
18940
|
+
projectId: null,
|
|
18941
|
+
execution: null,
|
|
18942
|
+
temporary: false,
|
|
18943
|
+
model: model?.id ?? "",
|
|
18944
|
+
thinkingLevel: model?.thinking?.initialValue ?? "off"
|
|
18945
|
+
};
|
|
18946
|
+
await writeBrowserOutbox(scope.draftKey, creation);
|
|
18947
|
+
await scope.assertCurrent();
|
|
18948
|
+
await this.openSession(conversationId);
|
|
18816
18949
|
}
|
|
18817
18950
|
async openSession(conversationId) {
|
|
18818
18951
|
if (this.runTopic) this.realtime?.unsubscribe(this.runTopic);
|
|
@@ -18839,6 +18972,13 @@ ${endpointId}`;
|
|
|
18839
18972
|
await chrome.storage.session.set({ [`${TAB_SESSION_PREFIX}${tabId}`]: conversationId });
|
|
18840
18973
|
}
|
|
18841
18974
|
try {
|
|
18975
|
+
const draft = await readDraft$1(conversationId);
|
|
18976
|
+
if (draft) {
|
|
18977
|
+
this.update({ modelConfig: { model: draft.model, thinkingLevel: draft.thinkingLevel, fixedModel: false, activityDetail: "on" } });
|
|
18978
|
+
this.update({ pendingDelivery: Boolean(await readBrowserOutbox(await inputStorageKey(conversationId))) });
|
|
18979
|
+
if (this.snapshot.endpointReady) await this.recoverOutbox();
|
|
18980
|
+
return;
|
|
18981
|
+
}
|
|
18842
18982
|
await Promise.all([
|
|
18843
18983
|
this.reloadMessages(),
|
|
18844
18984
|
this.reloadModelConfig(),
|
|
@@ -18855,7 +18995,7 @@ ${endpointId}`;
|
|
|
18855
18995
|
if (run.payload?.active && run.payload.runId) await this.followRun(run.payload.runId);
|
|
18856
18996
|
await this.reloadBrowserApproval();
|
|
18857
18997
|
if (this.snapshot.conversationId !== conversationId) return;
|
|
18858
|
-
this.update({ pendingDelivery: Boolean(await readBrowserOutbox(conversationId)) });
|
|
18998
|
+
this.update({ pendingDelivery: Boolean(await readBrowserOutbox(await inputStorageKey(conversationId))) });
|
|
18859
18999
|
if (this.snapshot.endpointReady) await this.recoverOutbox();
|
|
18860
19000
|
} catch (cause) {
|
|
18861
19001
|
if (this.snapshot.conversationId !== conversationId) return;
|
|
@@ -18870,6 +19010,18 @@ ${endpointId}`;
|
|
|
18870
19010
|
get currentConversationId() {
|
|
18871
19011
|
return this.snapshot.conversationId;
|
|
18872
19012
|
}
|
|
19013
|
+
async acceptReceipt(conversationId, clientMessageId, result, scope) {
|
|
19014
|
+
const payload = result.payload;
|
|
19015
|
+
if (payload.receipt.conversationId !== conversationId || payload.receipt.clientMessageId !== clientMessageId || payload.receipt.transcriptId !== payload.session.transcriptId) {
|
|
19016
|
+
throw new Error(t("errorChatChanged"));
|
|
19017
|
+
}
|
|
19018
|
+
await scope.assertCurrent();
|
|
19019
|
+
await deleteBrowserOutbox(scope.draftKey);
|
|
19020
|
+
await scope.assertCurrent();
|
|
19021
|
+
if (this.snapshot.conversationId === conversationId) {
|
|
19022
|
+
this.update({ transcriptId: payload.receipt.transcriptId, modelConfig: payload.agentConfig });
|
|
19023
|
+
}
|
|
19024
|
+
}
|
|
18873
19025
|
async send(content, browserContexts = [], attachments = []) {
|
|
18874
19026
|
if (this.sendingInput) throw new Error(t("errorWaitQueuedMessage"));
|
|
18875
19027
|
this.sendingInput = true;
|
|
@@ -18888,26 +19040,36 @@ ${endpointId}`;
|
|
|
18888
19040
|
}
|
|
18889
19041
|
if (!this.turnClaim) throw new Error(t("errorEndpointNotReady"));
|
|
18890
19042
|
const conversationId = this.snapshot.conversationId;
|
|
18891
|
-
await this.
|
|
19043
|
+
const scope = await deliveryScope(conversationId, this.profileIdentity);
|
|
19044
|
+
const draft = await readBrowserOutbox(scope.draftKey);
|
|
19045
|
+
if (!draft) await this.bindSessionEndpoint();
|
|
19046
|
+
await scope.assertCurrent();
|
|
18892
19047
|
if (this.snapshot.conversationId !== conversationId) throw new Error(t("errorChatChanged"));
|
|
18893
19048
|
const clientMessageId = crypto.randomUUID();
|
|
18894
|
-
const
|
|
19049
|
+
const input = {
|
|
18895
19050
|
content: text,
|
|
18896
|
-
clientMessageId,
|
|
18897
|
-
delivery: "next",
|
|
18898
|
-
expectedTranscriptId: this.snapshot.transcriptId,
|
|
18899
|
-
...this.snapshot.modelConfig?.fixedModel ? { configVersion: this.snapshot.modelConfig.configVersion } : {},
|
|
18900
|
-
origin: { type: "endpoint", endpointId: this.turnClaim.endpointId, token: this.turnClaim.token },
|
|
18901
19051
|
...browserContexts.length ? { browserContexts } : {},
|
|
18902
19052
|
...attachments.length ? { attachments } : {}
|
|
18903
19053
|
};
|
|
19054
|
+
const origin = { type: "endpoint", endpointId: this.turnClaim.endpointId, token: this.turnClaim.token };
|
|
19055
|
+
const request = sessionInputCommandSchema.parse(draft ? { kind: "start", clientMessageId, creation: draft, input, origin } : {
|
|
19056
|
+
kind: "append",
|
|
19057
|
+
clientMessageId,
|
|
19058
|
+
expectedTranscriptId: this.snapshot.transcriptId,
|
|
19059
|
+
configVersion: this.snapshot.modelConfig?.configVersion,
|
|
19060
|
+
delivery: "next",
|
|
19061
|
+
input,
|
|
19062
|
+
origin
|
|
19063
|
+
});
|
|
18904
19064
|
const previousMessages = this.snapshot.messages;
|
|
18905
19065
|
let outboxStored = false;
|
|
18906
19066
|
let deliveryAccepted = false;
|
|
18907
19067
|
this.update({ submitting: true, pendingDelivery: false });
|
|
18908
19068
|
try {
|
|
18909
|
-
|
|
19069
|
+
const { origin: _origin, ...durable } = request;
|
|
19070
|
+
await writeBrowserOutbox(scope.inputKey, durable);
|
|
18910
19071
|
outboxStored = true;
|
|
19072
|
+
await scope.assertCurrent();
|
|
18911
19073
|
this.update({
|
|
18912
19074
|
messages: this.snapshot.runId ? this.snapshot.messages : [...this.snapshot.messages, {
|
|
18913
19075
|
id: clientMessageId,
|
|
@@ -18930,18 +19092,26 @@ ${endpointId}`;
|
|
|
18930
19092
|
method: "POST",
|
|
18931
19093
|
headers: { "Content-Type": "application/json" },
|
|
18932
19094
|
body: JSON.stringify(request)
|
|
18933
|
-
})
|
|
19095
|
+
}, scope.identity)
|
|
18934
19096
|
);
|
|
19097
|
+
await this.acceptReceipt(conversationId, clientMessageId, response, scope);
|
|
18935
19098
|
deliveryAccepted = true;
|
|
18936
|
-
await deleteBrowserOutbox(
|
|
19099
|
+
await deleteBrowserOutbox(scope.inputKey);
|
|
18937
19100
|
outboxStored = false;
|
|
19101
|
+
await scope.assertCurrent();
|
|
18938
19102
|
if (this.snapshot.conversationId !== conversationId) return "sent";
|
|
18939
|
-
|
|
19103
|
+
if (draft) await this.bindSessionEndpoint();
|
|
19104
|
+
const runId = response.payload.inputState.inputs?.find((input2) => input2.clientMessageId === clientMessageId)?.runId ?? response.payload.inputState.activeRunId ?? await this.waitForRun(conversationId, clientMessageId);
|
|
18940
19105
|
if (this.snapshot.conversationId !== conversationId) return "sent";
|
|
18941
19106
|
if (runId) await this.followRun(runId);
|
|
18942
19107
|
else await this.reloadMessages();
|
|
18943
19108
|
return "sent";
|
|
18944
19109
|
} catch (cause) {
|
|
19110
|
+
try {
|
|
19111
|
+
await scope.assertCurrent();
|
|
19112
|
+
} catch {
|
|
19113
|
+
return deliveryAccepted ? "sent" : "queued";
|
|
19114
|
+
}
|
|
18945
19115
|
if (deliveryAccepted) {
|
|
18946
19116
|
if (this.snapshot.conversationId === conversationId) {
|
|
18947
19117
|
this.update({
|
|
@@ -18957,19 +19127,23 @@ ${endpointId}`;
|
|
|
18957
19127
|
}
|
|
18958
19128
|
return "queued";
|
|
18959
19129
|
}
|
|
18960
|
-
if (outboxStored) await deleteBrowserOutbox(
|
|
19130
|
+
if (outboxStored) await deleteBrowserOutbox(scope.inputKey);
|
|
18961
19131
|
if (this.snapshot.conversationId === conversationId) this.update({ messages: previousMessages });
|
|
18962
19132
|
throw cause;
|
|
18963
19133
|
} finally {
|
|
18964
|
-
|
|
19134
|
+
const current = await scope.assertCurrent().then(() => true, () => false);
|
|
19135
|
+
if (current && this.snapshot.conversationId === conversationId) this.update({ submitting: false });
|
|
18965
19136
|
}
|
|
18966
19137
|
}
|
|
18967
19138
|
async recoverOutbox() {
|
|
18968
19139
|
const conversationId = this.snapshot.conversationId;
|
|
18969
19140
|
if (!conversationId || !this.turnClaim || this.recoveringOutbox) return;
|
|
18970
19141
|
if (Date.now() - this.lastOutboxRecoveryAt < 3e3) return;
|
|
18971
|
-
const
|
|
18972
|
-
|
|
19142
|
+
const scope = await deliveryScope(conversationId, this.profileIdentity);
|
|
19143
|
+
const pending = await readBrowserOutbox(scope.inputKey);
|
|
19144
|
+
await scope.assertCurrent();
|
|
19145
|
+
if (this.snapshot.conversationId !== conversationId || !this.turnClaim) return;
|
|
19146
|
+
if (!pending?.clientMessageId || typeof pending.input.content !== "string") return;
|
|
18973
19147
|
this.recoveringOutbox = true;
|
|
18974
19148
|
this.lastOutboxRecoveryAt = Date.now();
|
|
18975
19149
|
this.update({ pendingDelivery: true });
|
|
@@ -18983,16 +19157,24 @@ ${endpointId}`;
|
|
|
18983
19157
|
method: "POST",
|
|
18984
19158
|
headers: { "Content-Type": "application/json" },
|
|
18985
19159
|
body: JSON.stringify(request)
|
|
18986
|
-
}));
|
|
19160
|
+
}, scope.identity));
|
|
19161
|
+
await this.acceptReceipt(conversationId, request.clientMessageId, response, scope);
|
|
18987
19162
|
deliveryAccepted = true;
|
|
18988
|
-
await deleteBrowserOutbox(
|
|
19163
|
+
await deleteBrowserOutbox(scope.inputKey);
|
|
19164
|
+
await scope.assertCurrent();
|
|
18989
19165
|
if (this.snapshot.conversationId !== conversationId) return;
|
|
19166
|
+
if (request.kind === "start") await this.bindSessionEndpoint();
|
|
18990
19167
|
this.update({ pendingDelivery: false, error: void 0 });
|
|
18991
|
-
const runId = response.payload.
|
|
19168
|
+
const runId = response.payload.inputState.inputs?.find((input) => input.clientMessageId === request.clientMessageId)?.runId ?? response.payload.inputState.activeRunId ?? await this.waitForRun(conversationId, request.clientMessageId);
|
|
18992
19169
|
if (this.snapshot.conversationId !== conversationId) return;
|
|
18993
19170
|
if (runId) await this.followRun(runId);
|
|
18994
19171
|
else await this.reloadMessages();
|
|
18995
19172
|
} catch (cause) {
|
|
19173
|
+
try {
|
|
19174
|
+
await scope.assertCurrent();
|
|
19175
|
+
} catch {
|
|
19176
|
+
return;
|
|
19177
|
+
}
|
|
18996
19178
|
if (this.snapshot.conversationId === conversationId) {
|
|
18997
19179
|
if (deliveryAccepted) {
|
|
18998
19180
|
this.update({
|
|
@@ -19002,7 +19184,7 @@ ${endpointId}`;
|
|
|
19002
19184
|
} else if (isRetryableDeliveryError(cause)) {
|
|
19003
19185
|
this.update({ pendingDelivery: true, error: void 0 });
|
|
19004
19186
|
} else {
|
|
19005
|
-
await deleteBrowserOutbox(
|
|
19187
|
+
await deleteBrowserOutbox(scope.inputKey);
|
|
19006
19188
|
this.update({
|
|
19007
19189
|
pendingDelivery: false,
|
|
19008
19190
|
messages: this.snapshot.messages.filter((message) => message.id !== pending.clientMessageId),
|
|
@@ -19078,7 +19260,7 @@ ${endpointId}`;
|
|
|
19078
19260
|
const current = this.snapshot.modelConfig;
|
|
19079
19261
|
if (!conversationId || !current) return;
|
|
19080
19262
|
const selected = this.snapshot.models.find((candidate) => candidate.id === model);
|
|
19081
|
-
const thinkingLevel = selected?.thinking?.options?.includes(current.thinkingLevel) ? current.thinkingLevel : selected?.thinking?.
|
|
19263
|
+
const thinkingLevel = selected?.thinking?.options?.includes(current.thinkingLevel) ? current.thinkingLevel : selected?.thinking?.initialValue;
|
|
19082
19264
|
await this.patchModelConfig({ model, thinkingLevel });
|
|
19083
19265
|
}
|
|
19084
19266
|
async updateThinking(thinkingLevel) {
|
|
@@ -19223,7 +19405,7 @@ ${endpointId}`;
|
|
|
19223
19405
|
this.update({ messages, transcriptId: session?.transcriptId });
|
|
19224
19406
|
}
|
|
19225
19407
|
async loadModels() {
|
|
19226
|
-
const result = await json(await gatewayFetch("/api/models"));
|
|
19408
|
+
const result = await json(await gatewayFetch("/api/models?agentId=main", {}, this.profileIdentity));
|
|
19227
19409
|
const models = (result.payload?.models ?? []).flatMap((value) => {
|
|
19228
19410
|
if (!value || typeof value !== "object") return [];
|
|
19229
19411
|
const model = value;
|
|
@@ -19236,16 +19418,22 @@ ${endpointId}`;
|
|
|
19236
19418
|
thinking: {
|
|
19237
19419
|
mode: thinking.mode,
|
|
19238
19420
|
...Array.isArray(thinking.options) ? { options: thinking.options.filter((option) => typeof option === "string") } : {},
|
|
19239
|
-
...typeof thinking.
|
|
19421
|
+
...typeof thinking.initialValue === "string" ? { initialValue: thinking.initialValue } : {}
|
|
19240
19422
|
}
|
|
19241
19423
|
} : {}
|
|
19242
19424
|
}];
|
|
19243
19425
|
});
|
|
19426
|
+
this.defaultModelId = result.payload?.defaultId;
|
|
19244
19427
|
this.update({ models });
|
|
19245
19428
|
}
|
|
19246
19429
|
async reloadModelConfig() {
|
|
19247
19430
|
const conversationId = this.snapshot.conversationId;
|
|
19248
19431
|
if (!conversationId) return;
|
|
19432
|
+
const draft = await readDraft$1(conversationId);
|
|
19433
|
+
if (draft) {
|
|
19434
|
+
this.update({ modelConfig: { model: draft.model, thinkingLevel: draft.thinkingLevel, fixedModel: false, activityDetail: "on" } });
|
|
19435
|
+
return;
|
|
19436
|
+
}
|
|
19249
19437
|
const result = await json(await gatewayFetch(
|
|
19250
19438
|
`/api/sessions/${encodeURIComponent(conversationId)}/agent-config`
|
|
19251
19439
|
));
|
|
@@ -19266,6 +19454,14 @@ ${endpointId}`;
|
|
|
19266
19454
|
const conversationId = this.snapshot.conversationId;
|
|
19267
19455
|
const current = this.snapshot.modelConfig;
|
|
19268
19456
|
if (!conversationId || !current) return;
|
|
19457
|
+
const draft = await readDraft$1(conversationId);
|
|
19458
|
+
if (draft) {
|
|
19459
|
+
if (await readBrowserOutbox(await inputStorageKey(conversationId))) throw new Error(t("errorWaitQueuedMessage"));
|
|
19460
|
+
const creation = { ...draft, ...patch };
|
|
19461
|
+
await writeBrowserOutbox(await draftStorageKey(conversationId), creation);
|
|
19462
|
+
this.update({ modelConfig: { ...current, model: creation.model, thinkingLevel: creation.thinkingLevel } });
|
|
19463
|
+
return;
|
|
19464
|
+
}
|
|
19269
19465
|
const result = await json(await gatewayFetch(
|
|
19270
19466
|
`/api/sessions/${encodeURIComponent(conversationId)}/agent-config`,
|
|
19271
19467
|
{
|
|
@@ -19290,6 +19486,7 @@ ${endpointId}`;
|
|
|
19290
19486
|
async reloadClarification() {
|
|
19291
19487
|
const conversationId = this.snapshot.conversationId;
|
|
19292
19488
|
if (!conversationId) return;
|
|
19489
|
+
if (await readDraft$1(conversationId)) return;
|
|
19293
19490
|
const result = await json(await gatewayFetch(
|
|
19294
19491
|
`/api/sessions/${encodeURIComponent(conversationId)}/clarification`
|
|
19295
19492
|
));
|
|
@@ -19354,8 +19551,15 @@ ${endpointId}`;
|
|
|
19354
19551
|
return profile;
|
|
19355
19552
|
}
|
|
19356
19553
|
profileUrl;
|
|
19554
|
+
profileIdentity;
|
|
19357
19555
|
async prepare() {
|
|
19358
|
-
|
|
19556
|
+
const profile = await getAccessProfile();
|
|
19557
|
+
this.profileUrl = profile.gatewayUrl;
|
|
19558
|
+
this.profileIdentity = {
|
|
19559
|
+
gatewayId: profile.gatewayId,
|
|
19560
|
+
deviceId: profile.deviceId,
|
|
19561
|
+
gatewayPublicKey: profile.gatewayPublicKey
|
|
19562
|
+
};
|
|
19359
19563
|
}
|
|
19360
19564
|
update(patch) {
|
|
19361
19565
|
this.snapshot = { ...this.snapshot, ...patch };
|
|
@@ -28120,10 +28324,10 @@ function formatFileSize(size) {
|
|
|
28120
28324
|
if (size < 1024 * 1024) return `${Math.round(size / 1024)} KB`;
|
|
28121
28325
|
return `${(size / (1024 * 1024)).toFixed(1)} MB`;
|
|
28122
28326
|
}
|
|
28123
|
-
function ChatPanel({ gatewayId }) {
|
|
28327
|
+
function ChatPanel({ gatewayId, deviceId }) {
|
|
28124
28328
|
const client = reactExports.useMemo(() => new BrowserChatClient(), []);
|
|
28125
28329
|
const [snapshot, setSnapshot] = reactExports.useState(EMPTY);
|
|
28126
|
-
const keyForSession = (conversationId) => JSON.stringify([gatewayId, conversationId ?? "new"]);
|
|
28330
|
+
const keyForSession = (conversationId) => JSON.stringify([gatewayId, deviceId, conversationId ?? "new"]);
|
|
28127
28331
|
const draftKey = keyForSession(snapshot.conversationId);
|
|
28128
28332
|
const { store: drafts, draft: composerDraft, ready: draftReady, update: updateDraft } = useComposerDrafts(draftKey, (cause) => setError(String(cause)));
|
|
28129
28333
|
const draft = composerDraft.text;
|
|
@@ -29320,7 +29524,7 @@ function SidePanelApp({ initialLocale, initialTheme }) {
|
|
|
29320
29524
|
invitation ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => void cancelPairing(), disabled: state === "pairing", children: t("cancelPairing") }) : null
|
|
29321
29525
|
] })
|
|
29322
29526
|
] }) : null
|
|
29323
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChatPanel, { gatewayId: profile.gatewayId },
|
|
29527
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChatPanel, { gatewayId: profile.gatewayId, deviceId: profile.deviceId }, JSON.stringify([profile.gatewayId, profile.gatewayUrl, profile.deviceId]))
|
|
29324
29528
|
] });
|
|
29325
29529
|
}
|
|
29326
29530
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"minimum_chrome_version": "120",
|
|
4
4
|
"default_locale": "en",
|
|
5
5
|
"name": "__MSG_appName__",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.334",
|
|
7
7
|
"description": "__MSG_appDescription__",
|
|
8
8
|
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqnpr4vpLC/nmvy+wiOWk3SWlp2nEZkFijfk8ivGw7StNZgCK90nOMvwhdEtlkk3GOWDvdVnq8HxCsM3UNQ8FnGUyerpH1FJXqXuradxeHf8ZxFjiQU/mIWfnKbUuONWQORon3/pigyoXoK/VUXgg0Wbm/rbVwsS0bv+25R6m+mZgBspOLeKuoH7ivhL+48WV6POtMBsFPZweY26477EM7ukh+56Ff5ENevB8ymxBBn7qK5ZoeZd2a23U8ioX5TsHfe6fnrjitPWjIxD8G0NoKQxcaa/Mo+xs+T6UiLKxP0wjz5bm7jB5H+CXtkRJqzBWUB0h+RSLJckzZfA8BAJrRwIDAQAB",
|
|
9
9
|
"permissions": [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "telegram",
|
|
3
3
|
"name": "Telegram Channel",
|
|
4
4
|
"description": "Bundled Telegram Bot channel (private workspace sources; ships inside @xopcai/xopc dist/)",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.334",
|
|
6
6
|
"kind": "channel",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"channels": [
|