@xopcai/xopc 0.0.368 → 0.0.370
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -174
- package/README.zh-CN.md +59 -174
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js +131 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js +30 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js +252 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js +16 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js +66 -0
- package/dist/browser-ext/_locales/en/messages.json +30 -1
- package/dist/browser-ext/_locales/zh_CN/messages.json +30 -1
- package/dist/browser-ext/dist/assets/{auth-beGtbLPS.js → page-context-BeworyNB.js} +1331 -1355
- package/dist/browser-ext/dist/assets/{sidepanel-BT0ojEzG.css → sidepanel-Ccl0eSa1.css} +43 -0
- package/dist/browser-ext/dist/background.js +680 -182
- package/dist/browser-ext/dist/sidepanel.html +2 -2
- package/dist/browser-ext/dist/sidepanel.js +393 -194
- package/dist/browser-ext/manifest.json +2 -8
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-D9ZMh5ZR.js → activity-store-BQ3PMp2q.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Bj3rvcTm.js → agent-avatar-dicebear-C61i1QbX.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-0fCR1DHx.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-Di99mUTT.js +1 -0
- package/dist/gateway/static/root/assets/agents-BRZZmYH_.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-B5QDepbW.js → agents-admin-api-HBZvVyzF.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-2rTEtB_X.js → app-management-settings-panel-noqqxkds.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BPVBS80k.js → appearance-settings-DG8QN0gR.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-1FuKlZYP.js → apps-page-CgiyzFYo.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BbT1O7oK.js → archive-plugin-BO3I9zRP.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DjwP_h8h.js → automations-page-CgAcRFDS.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BIkxIpab.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-gS7Wg68v.js → binary-plugins-gFD7vH9R.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DbwMaivP.js → block-editor-B1VE-jAe.js} +2 -2
- package/dist/gateway/static/root/assets/browser-automation-inputs-DxRoKFun.js +1 -0
- package/dist/gateway/static/root/assets/browser-automations-page-CIjyMS6f.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-BMAivBfp.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-Lswa0hv8.js → capabilities-CY4SiHcP.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-Dd1PZRQw.js → capabilities-gjQtMhKu.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-DRdcfo68.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-DTHR1DrJ.js → capabilities-settings-panel-ZuL6pWjM.js} +4 -4
- package/dist/gateway/static/root/assets/{capability-header-actions-494dnJsj.js → capability-header-actions-D0GC1FEv.js} +1 -1
- package/dist/gateway/static/root/assets/channels-CgE22Pzd.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Bl7-Zk-x.js → chat-terminal-dock-CEjh1utz.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-ByExKr_6.js → computer-settings-page-vFHJAmQr.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BK_5aFxO.js → connector-service-page-DTrwZ4kV.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DRcMiTWu.js +1 -0
- package/dist/gateway/static/root/assets/copy-text-row-C1gaJwlZ.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-BXJv6472.js → date-picker-NfGIPSYY.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-CqguveUi.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-DWNEC3mk.js → desktop-pet-CTx1zkJm.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BYwlxGiN.js → desktop-pet-settings-BRDS3EGc.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-BAc4F35b.js → device-pairing-wizard-Du4Ciuyw.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-D26tSY8Z.js → directory-picker-path-field-CjstlxFl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-xYIGNegB.js → extension-debug-page-BfAtjhoK.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BoQ1-3AW.js → extension-page-BJmudejr.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-Cw_JU6RR.js → extension-provider-Br6LXyIj.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BH5TFGPe.js → extension-settings-page-UvmHniyz.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-04Wqmw14.js → fallback-models-euw9MGdt.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CNf0ZeRw.js → gateway-config-swr-7RKqgU_U.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-F6D4A7N5.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-BheKaO6d.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-BqvCJVUC.js → gateway-settings-C7roPHh1.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DIxHacUw.js → gateway-startup-retry-jiV5sbEX.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BGNCTtM3.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-CS0q0Kto.js → image-generation-api-DO4mXb6I.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-n_rSLo6b.js → imports-page-DxCoT0VV.js} +1 -1
- package/dist/gateway/static/root/assets/index-BGBkIIzM.css +1 -0
- package/dist/gateway/static/root/assets/index-FCEE325-.js +106 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-tVkrHbYF.js → keyboard-shortcuts-settings-CnLln9Ds.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-L8tYuas0.js → local-app-workbench-page-yXRkSrEj.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-SSJ9B1bH.js → local-apps-page-D46buzTk.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-pox8evDV.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-D6_rF-qT.js → locale-store-COVscAqC.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DmcCHnH0.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-khN1ThNL.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-_xwUuKce.js → markdown-view-B_qnAcW2.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-C631CDu4.js → media-plugins-C0Pc-wSY.js} +1 -1
- package/dist/gateway/static/root/assets/messages-Bb2GK-Nj.js +3 -0
- package/dist/gateway/static/root/assets/models-hub-cache-DyPPksMP.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-C_t58yha.js +5 -0
- package/dist/gateway/static/root/assets/{notes-api-vIZWQ9Yt.js → notes-api-sBgBcyLW.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-BJ0QS6xx.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-BlPDM7GM.js → page-context-capture-button-DfRODHv1.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-CiiXwwQE.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-BJjWvoER.js → product-open-page-_Bp6HRmm.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-CEd4E7Gf.js → product-preview-content-BUdiO0Ct.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Clb-fXYk.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-lszV8HuS.js → projects-page-D9JEEqhh.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-uJnjqTcn.js → registry-api-Bh9UBb-f.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CmyTq3_l.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CjnNQYW8.js → runtime-tools-settings-panel-B1_inj8L.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-B3T3dDOR.js → scenes-page-CUNAZN2_.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DT3c4Vd_.js → schema-form-CfT-9UVw.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-CICkGwn-.js → send-session-input-BW40VHiL.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-BcQodoAu.js → session-api-yjpEz4pP.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-BqlvrjPE.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-CXZKScvu.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-B2vKXmzg.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-D-PZjcss.js → settings-page-1h3vyueg.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Cqc7UlZy.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-CWS8EkJS.js → share-link-dialog-HCHM8qnf.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-23NJAKiq.js → share-preview-page-Ce6FNWt1.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-iKhHbvBD.js → shares-api-c0dfWz6h.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Dh5jisCK.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-C-MWdQwl.js → skill-api-deDZeQS8.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-iy02aB13.js → skill-reload-api-Ge5XymHa.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-DZozl9U_.js +2 -0
- package/dist/gateway/static/root/assets/system-settings-panel-CtzyMxqq.js +1 -0
- package/dist/gateway/static/root/assets/{task-detail-page-B2SIEyhZ.js → task-detail-page-5f_V0h-p.js} +2 -2
- package/dist/gateway/static/root/assets/{task-expandable-content-D2LRR4BC.js → task-expandable-content-hYcgCEE3.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BJfhz-Zq.js → theme-store-BOfCKgl6.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-aHD56iaS.js → tracing-settings-page-DDWFXcST.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BCf8CfTC.js → tunnel-api-vMtlbJ-m.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-B4XUkuJd.js → usage-page-B1-BCW8U.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BnnTw9RE.js → use-autosave-CSckcjFx.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-Itczg0y1.js → use-composer-attachments-DJya1hIL.js} +1 -1
- package/dist/gateway/static/root/assets/use-file-preview-expanded-C5ONO7sF.js +2 -0
- package/dist/gateway/static/root/assets/user-model-page-D4BSq9HJ.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BphJku8x.js → voice-api-key-field-GEw5x2fU.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-B4u4coFj.js → voice-config-api-3yyVwXln.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-jgOEP1xw.js → work-discovery-overlay-CjiNYJV5.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-N69crzRu.js → workflow-run-setup-panel-DJOetXvm.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CcAPFh2R.js +6 -0
- package/dist/gateway/static/root/assets/{workspace-api-Lzv6GDO8.js → workspace-api-WhbMvdBE.js} +2 -2
- package/dist/gateway/static/root/index.html +32 -34
- package/dist/package.js +1 -1
- package/dist/packages/browser-control-contract/src/automation.js +213 -0
- package/dist/packages/browser-control-contract/src/index.js +43 -12
- package/dist/packages/endpoint-tools-client/src/index.js +189 -0
- package/dist/packages/endpoint-tools-protocol/src/bridge.js +105 -0
- package/dist/packages/endpoint-tools-protocol/src/index.js +93 -2
- package/dist/packages/endpoint-tools-protocol/src/location.js +109 -0
- package/dist/packages/gateway-contract/src/gateway-scopes.js +3 -1
- package/dist/packages/gateway-contract/src/notifications.js +1 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +30 -5
- package/dist/packages/realtime-protocol/src/voice.js +9 -3
- package/dist/src/agent/agent-manager.js +22 -26
- package/dist/src/agent/coding/repository-instructions.js +8 -1
- package/dist/src/agent/embedded/codemode-extension.d.ts +7 -0
- package/dist/src/agent/embedded/codemode-extension.js +232 -0
- package/dist/src/agent/embedded/codemode-output.d.ts +2 -0
- package/dist/src/agent/embedded/codemode-output.js +34 -0
- package/dist/src/agent/embedded/external-tool-discovery.d.ts +6 -0
- package/dist/src/agent/embedded/external-tool-discovery.js +60 -0
- package/dist/src/agent/embedded/model-runtime.js +5 -2
- package/dist/src/agent/embedded/run-for-session.js +10 -1
- package/dist/src/agent/embedded/run-turn.js +10 -3
- package/dist/src/agent/embedded/session-runner.d.ts +9 -1
- package/dist/src/agent/embedded/session-runner.js +111 -23
- package/dist/src/agent/embedded/session-tool-result-guard.d.ts +2 -0
- package/dist/src/agent/embedded/session-tool-result-guard.js +17 -0
- package/dist/src/agent/embedded/subscribe-session.js +14 -4
- package/dist/src/agent/embedded/tool-metadata.d.ts +15 -0
- package/dist/src/agent/embedded/tool-metadata.js +38 -0
- package/dist/src/agent/embedded/tool-search-extension.d.ts +5 -0
- package/dist/src/agent/embedded/tool-search-extension.js +31 -0
- package/dist/src/agent/embedded/types.d.ts +7 -0
- package/dist/src/agent/embedded/xopc-tools-bridge.js +6 -0
- package/dist/src/agent/external-tools/endpoint-provider.d.ts +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +148 -56
- package/dist/src/agent/external-tools/extension-provider.js +8 -1
- package/dist/src/agent/external-tools/gateway-tools.d.ts +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +45 -22
- package/dist/src/agent/external-tools/index.js +46 -14
- package/dist/src/agent/external-tools/memory-provider.js +8 -1
- package/dist/src/agent/external-tools/read-policy.js +2 -1
- package/dist/src/agent/external-tools/service.d.ts +2 -0
- package/dist/src/agent/external-tools/service.js +25 -3
- package/dist/src/agent/external-tools/tool-registry.d.ts +14 -0
- package/dist/src/agent/external-tools/tool-registry.js +14 -0
- package/dist/src/agent/external-tools/types.d.ts +8 -1
- package/dist/src/agent/external-tools/types.js +0 -1
- package/dist/src/agent/mcp/config.d.ts +18 -0
- package/dist/src/agent/mcp/{bundle-mcp-config.js → config.js} +8 -25
- package/dist/src/agent/mcp/native-mcp.d.ts +6 -0
- package/dist/src/agent/mcp/native-mcp.js +73 -0
- package/dist/src/agent/service.js +2 -5
- package/dist/src/agent/skills/installer.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +1 -1
- package/dist/src/agent/source-context/index.d.ts +0 -1
- package/dist/src/agent/source-context/index.js +1 -2
- package/dist/src/agent/source-context/injector.js +1 -0
- package/dist/src/agent/source-context/types.d.ts +2 -2
- package/dist/src/agent/source-context/types.js +1 -1
- package/dist/src/agent/tool-manuals/browser.d.ts +1 -1
- package/dist/src/agent/tool-manuals/browser.js +3 -3
- package/dist/src/agent/tools/browser/tool/browser-use-tool.js +1 -1
- package/dist/src/agent/tools/browser/tool/schemas.d.ts +0 -13
- package/dist/src/agent/tools/browser/tool/schemas.js +0 -4
- package/dist/src/agent/tools/browser-automation-tool.d.ts +74 -1
- package/dist/src/agent/tools/browser-automation-tool.js +52 -6
- package/dist/src/agent/tools/cli-clarify.js +1 -1
- package/dist/src/agent/tools/codemode-permissions.d.ts +4 -0
- package/dist/src/agent/tools/codemode-permissions.js +23 -0
- package/dist/src/agent/tools/dataBatch.js +3 -1
- package/dist/src/agent/tools/delegation-parent-policy.js +1 -4
- package/dist/src/agent/tools/factory.js +4 -3
- package/dist/src/agent/transcript/provider-capabilities.js +0 -1
- package/dist/src/agent/transcript/transcript-policy.js +1 -2
- package/dist/src/agent-config/schema.d.ts +28 -0
- package/dist/src/agent-config/schema.js +7 -0
- package/dist/src/auth/credentials.js +7 -20
- package/dist/src/auth/model-credential-store.js +11 -4
- package/dist/src/auth/oauth/index.d.ts +1 -1
- package/dist/src/auth/oauth/index.js +3 -3
- package/dist/src/auth/oauth/openai.d.ts +2 -0
- package/dist/src/auth/oauth/openai.js +90 -0
- package/dist/src/auth/oauth/registry.js +3 -3
- package/dist/src/auth/oauth/types.d.ts +1 -0
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +5 -0
- package/dist/src/automations/capabilities/write.d.ts +2 -0
- package/dist/src/automations/domain/types.d.ts +11 -0
- package/dist/src/automations/domain/validation.d.ts +4 -0
- package/dist/src/automations/domain/validation.js +1 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +1 -0
- package/dist/src/automations/service/action-executor.js +11 -3
- package/dist/src/automations/service/automation-service.d.ts +1 -0
- package/dist/src/automations/service/automation-service.js +13 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/browser/automations/repository.d.ts +4 -0
- package/dist/src/browser/automations/repository.js +27 -6
- package/dist/src/browser/automations/runner.js +101 -9
- package/dist/src/browser/automations/runtime-service.js +4 -3
- package/dist/src/browser/automations/schema.d.ts +84 -1
- package/dist/src/browser/automations/schema.js +68 -2
- package/dist/src/browser/automations/service.d.ts +78 -1
- package/dist/src/browser/automations/service.js +36 -4
- package/dist/src/browser/automations/types.d.ts +19 -4
- package/dist/src/browser/drivers/extension-driver.d.ts +5 -5
- package/dist/src/browser/drivers/extension-driver.js +10 -10
- package/dist/src/browser/drivers/playwright-driver.js +46 -0
- package/dist/src/browser/index.d.ts +1 -2
- package/dist/src/browser/index.js +2 -3
- package/dist/src/browser/policy/browser-policy.d.ts +0 -1
- package/dist/src/browser/policy/browser-policy.js +1 -4
- package/dist/src/browser/providers/index.d.ts +1 -1
- package/dist/src/browser/providers/index.js +2 -2
- package/dist/src/browser/providers/realtime-extension.d.ts +1 -1
- package/dist/src/browser/providers/realtime-extension.js +5 -1
- package/dist/src/browser/recordings/service.d.ts +22 -0
- package/dist/src/browser/recordings/service.js +160 -0
- package/dist/src/browser/runtime/browser-runtime.d.ts +1 -1
- package/dist/src/browser/runtime/browser-runtime.js +19 -56
- package/dist/src/chat-commands/builtins/model.js +2 -2
- package/dist/src/cli/command-manifest.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +0 -19
- package/dist/src/cli/commands/mcp.js +36 -2
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/utils/oauth-login.js +2 -2
- package/dist/src/computer/runtime.js +2 -2
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/mcp-config-normalize.d.ts +0 -3
- package/dist/src/config/mcp-config-normalize.js +2 -22
- package/dist/src/config/models-json.d.ts +0 -5
- package/dist/src/config/models-json.js +13 -4
- package/dist/src/config/paths.d.ts +0 -1
- package/dist/src/config/paths.js +1 -4
- package/dist/src/config/schema.d.ts +142 -48
- package/dist/src/config/schema.js +64 -47
- package/dist/src/connectors/auth-provider-registry.d.ts +1 -1
- package/dist/src/connectors/auth-provider-registry.js +1 -21
- package/dist/src/connectors/china-catalog.js +5 -5
- package/dist/src/connectors/connection-recovery-service.d.ts +1 -6
- package/dist/src/connectors/connection-recovery-service.js +3 -105
- package/dist/src/connectors/health.d.ts +1 -2
- package/dist/src/connectors/health.js +2 -101
- package/dist/src/connectors/types.d.ts +1 -1
- package/dist/src/endpoint-tools/binding-service.d.ts +2 -0
- package/dist/src/endpoint-tools/binding-service.js +14 -2
- package/dist/src/endpoint-tools/bridge-host.d.ts +15 -0
- package/dist/src/endpoint-tools/bridge-host.js +166 -0
- package/dist/src/endpoint-tools/bridge.d.ts +27 -0
- package/dist/src/endpoint-tools/bridge.js +88 -0
- package/dist/src/endpoint-tools/capability-catalog.d.ts +2 -0
- package/dist/src/endpoint-tools/capability-catalog.js +8 -0
- package/dist/src/endpoint-tools/grant-service.d.ts +69 -0
- package/dist/src/endpoint-tools/grant-service.js +113 -0
- package/dist/src/endpoint-tools/index.js +1 -1
- package/dist/src/endpoint-tools/invocation-service.js +6 -2
- package/dist/src/endpoint-tools/location-task.d.ts +22 -0
- package/dist/src/endpoint-tools/location-task.js +114 -0
- package/dist/src/endpoint-tools/policy.js +20 -4
- package/dist/src/endpoint-tools/registry.d.ts +2 -0
- package/dist/src/endpoint-tools/registry.js +9 -0
- package/dist/src/endpoint-tools/result-projector.d.ts +15 -0
- package/dist/src/endpoint-tools/result-projector.js +31 -0
- package/dist/src/endpoint-tools/runtime.d.ts +2 -0
- package/dist/src/endpoint-tools/runtime.js +15 -2
- package/dist/src/endpoint-tools/target-resolver.d.ts +12 -0
- package/dist/src/endpoint-tools/target-resolver.js +27 -0
- package/dist/src/endpoint-tools/turn-context.d.ts +6 -0
- package/dist/src/endpoint-tools/turn-context.js +29 -0
- package/dist/src/extensions/agent-plugins/auth.d.ts +0 -2
- package/dist/src/extensions/agent-plugins/auth.js +2 -19
- package/dist/src/extensions/agent-plugins/credentials.js +3 -19
- package/dist/src/extensions/agent-plugins/inventory.d.ts +2 -2
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +1 -5
- package/dist/src/extensions/agent-plugins/source-http-fetch.d.ts +2 -0
- package/dist/src/{agent/mcp/plugin-http-fetch.js → extensions/agent-plugins/source-http-fetch.js} +7 -7
- package/dist/src/extensions/agent-plugins/sources.js +2 -2
- package/dist/src/extensions/agent-plugins/store.js +1 -3
- package/dist/src/extensions/agent-plugins/validation.d.ts +0 -4
- package/dist/src/extensions/agent-plugins/validation.js +13 -20
- package/dist/src/gateway/agents-admin.d.ts +5 -0
- package/dist/src/gateway/agents-admin.js +56 -1
- package/dist/src/gateway/chat-stream/mapper.js +9 -0
- package/dist/src/gateway/chat-stream/protocol.d.ts +4 -4
- package/dist/src/gateway/hono/lib/config-payload.d.ts +9 -4
- package/dist/src/gateway/hono/lib/config-payload.js +2 -5
- package/dist/src/gateway/hono/oauth-async.js +9 -2
- package/dist/src/gateway/hono/routes/agent-plugins.js +4 -9
- package/dist/src/gateway/hono/routes/agents.js +4 -3
- package/dist/src/gateway/hono/routes/browser-automations.js +23 -7
- package/dist/src/gateway/hono/routes/browser-recordings.d.ts +3 -0
- package/dist/src/gateway/hono/routes/browser-recordings.js +78 -0
- package/dist/src/gateway/hono/routes/browser.js +1 -34
- package/dist/src/gateway/hono/routes/connection-waits.js +2 -5
- package/dist/src/gateway/hono/routes/connectors.js +5 -60
- package/dist/src/gateway/hono/routes/device-authorizations.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-authorizations.js +74 -0
- package/dist/src/gateway/hono/routes/device-push.js +1 -0
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +7 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.d.ts +1 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.js +53 -3
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +25 -1
- package/dist/src/gateway/hono/routes/mcp.d.ts +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +11 -237
- package/dist/src/gateway/hono/routes/personal-agent.js +35 -0
- package/dist/src/gateway/hono/routes/session-command-handler.js +11 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +8 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +25 -1
- package/dist/src/gateway/hono/routes/voice.js +5 -2
- package/dist/src/gateway/security/gateway-scopes.js +3 -1
- package/dist/src/gateway/service/agent-runner.js +1 -0
- package/dist/src/gateway/service/config-coordinator.js +2 -5
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +13 -5
- package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/session-input-coordinator.js +29 -9
- package/dist/src/gateway/service/sessions-api.js +0 -6
- package/dist/src/gateway/service.js +3 -12
- package/dist/src/gateway/session-reset-service.js +0 -6
- package/dist/src/home-intelligence/generator.d.ts +2 -0
- package/dist/src/home-intelligence/generator.js +53 -4
- package/dist/src/home-intelligence/host.d.ts +2 -1
- package/dist/src/home-intelligence/host.js +23 -3
- package/dist/src/imports/compatibility.js +12 -10
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/migrations/cloud-public-models.js +1 -0
- package/dist/src/notifications/clarification.d.ts +5 -0
- package/dist/src/notifications/clarification.js +66 -0
- package/dist/src/notifications/device-store.js +1 -0
- package/dist/src/notifications/harmony-push.d.ts +1 -0
- package/dist/src/notifications/harmony-push.js +3 -1
- package/dist/src/notifications/planner.d.ts +1 -0
- package/dist/src/notifications/service.d.ts +2 -2
- package/dist/src/notifications/service.js +20 -4
- package/dist/src/notifications/store.d.ts +2 -0
- package/dist/src/notifications/store.js +7 -1
- package/dist/src/notifications/types.d.ts +1 -0
- package/dist/src/notifications/types.js +1 -0
- package/dist/src/providers/env-keys.js +1 -1
- package/dist/src/providers/index.js +26 -24
- package/dist/src/providers/model-call.d.ts +0 -2
- package/dist/src/providers/model-call.js +2 -6
- package/dist/src/providers/model-registry.js +4 -2
- package/dist/src/providers/model-supplements.d.ts +3 -3
- package/dist/src/providers/model-supplements.js +6 -27
- package/dist/src/providers/presentation.js +3 -8
- package/dist/src/providers/prompt-cache-plan.js +1 -1
- package/dist/src/providers/provider-auth-service.d.ts +1 -1
- package/dist/src/providers/provider-auth-service.js +7 -2
- package/dist/src/providers/provider-policy.d.ts +3 -0
- package/dist/src/providers/provider-policy.js +14 -0
- package/dist/src/providers/register-runtime-providers.js +6 -1
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/session/store.js +7 -1
- package/dist/src/session/transcript-events.d.ts +5 -0
- package/dist/src/session/transcript-events.js +1 -0
- package/dist/src/session/types.d.ts +2 -0
- package/dist/src/storage/sqlite/clarification-wait-repository.js +1 -0
- package/dist/src/storage/sqlite/device-grant-audit-repository.d.ts +11 -0
- package/dist/src/storage/sqlite/device-grant-audit-repository.js +10 -0
- package/dist/src/storage/sqlite/endpoint-device-settings-repository.d.ts +7 -0
- package/dist/src/storage/sqlite/endpoint-device-settings-repository.js +17 -0
- package/dist/src/storage/sqlite/migrations/238_browser_record_replay.sql +45 -0
- package/dist/src/storage/sqlite/migrations/239_clarification_notifications.sql +26 -0
- package/dist/src/storage/sqlite/migrations/240_device_settings.sql +5 -0
- package/dist/src/storage/sqlite/migrations/241_device_grant_audit.sql +13 -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-input-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/session-input-repository.js +5 -1
- package/dist/src/tasks/home-query-service.d.ts +1 -1
- package/dist/src/tasks/home-query-service.js +6 -2
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/xopc-tui-keybindings.d.ts +4 -4
- package/dist/src/voice/dashscope/streaming-tts-stream.d.ts +2 -1
- package/dist/src/voice/dashscope/streaming-tts-stream.js +135 -79
- package/dist/src/voice/realtime/agentEngine.js +78 -1
- package/dist/src/voice/realtime/speakable-segmenter.d.ts +2 -0
- package/dist/src/voice/realtime/speakable-segmenter.js +30 -0
- package/dist/src/voice/tts/providers/alibaba-speech.js +17 -1
- package/dist/src/voice/tts/speak-core.d.ts +3 -0
- package/dist/src/voice/tts/speak-core.js +21 -1
- package/dist/src/voice/tts/speech-provider-types.d.ts +8 -0
- package/package.json +18 -7
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D0tD3kCe.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BjdgKCnk.js +0 -1
- package/dist/gateway/static/root/assets/agents-CWXKzX5L.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-C9ZT6TAU.js +0 -6
- package/dist/gateway/static/root/assets/browser-automation-inputs-CXG_JveC.js +0 -1
- package/dist/gateway/static/root/assets/browser-automations-page-CJc7OKR3.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-BjaTEUR8.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-djBsC_tG.js +0 -2
- package/dist/gateway/static/root/assets/channels-BaYRJtz3.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DyqRwSH2.js +0 -2
- package/dist/gateway/static/root/assets/copy-text-row-BHDs3cBa.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-CWbbhKZa.js +0 -1
- package/dist/gateway/static/root/assets/dist-Che_jiQF.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-C4KtwMY3.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-ChZUzVbe.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DhPPLbdD.js +0 -2
- package/dist/gateway/static/root/assets/index-CK4O2xMa.css +0 -1
- package/dist/gateway/static/root/assets/index-DpLD-7Hc.js +0 -106
- package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +0 -1
- package/dist/gateway/static/root/assets/local-session-drafts-B_McurIj.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-BWD63eg1.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-aKSibklM.js +0 -1
- package/dist/gateway/static/root/assets/messages-Bnx3GMDB.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-Di83uIPw.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-B_fve3_2.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-DnChyp8S.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-BM2qAgg_.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DM4_VLNX.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-O6j9CWX0.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-B0tOE4qz.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-BIixHXlQ.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-49SUEWPh.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Ce3gTbT3.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-CNEZjF66.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BndNdYsJ.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-EpZeMlvp.js +0 -1
- package/dist/gateway/static/root/assets/use-file-preview-expanded-DJ5vyrvM.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-Bz5lkFG9.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-CPCgOfHh.js +0 -6
- package/dist/src/agent/embedded/system-prompt-override.d.ts +0 -2
- package/dist/src/agent/embedded/system-prompt-override.js +0 -21
- package/dist/src/agent/external-tools/mcp-provider.d.ts +0 -32
- package/dist/src/agent/external-tools/mcp-provider.js +0 -208
- package/dist/src/agent/mcp/bundle-mcp-config.d.ts +0 -20
- package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +0 -79
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +0 -93
- package/dist/src/agent/mcp/bundle-mcp-names.d.ts +0 -1
- package/dist/src/agent/mcp/bundle-mcp-names.js +0 -25
- package/dist/src/agent/mcp/bundle-mcp-policy.d.ts +0 -1
- package/dist/src/agent/mcp/bundle-mcp-policy.js +0 -6
- package/dist/src/agent/mcp/bundle-mcp-runtime.d.ts +0 -46
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +0 -571
- package/dist/src/agent/mcp/bundle-mcp-tools.d.ts +0 -2
- package/dist/src/agent/mcp/bundle-mcp-tools.js +0 -2
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +0 -76
- package/dist/src/agent/mcp/bundle-mcp-types.js +0 -1
- package/dist/src/agent/mcp/embedded-mcp.d.ts +0 -10
- package/dist/src/agent/mcp/embedded-mcp.js +0 -14
- package/dist/src/agent/mcp/index.d.ts +0 -5
- package/dist/src/agent/mcp/index.js +0 -12
- package/dist/src/agent/mcp/mcp-config-shared.d.ts +0 -8
- package/dist/src/agent/mcp/mcp-config-shared.js +0 -39
- package/dist/src/agent/mcp/mcp-http.d.ts +0 -23
- package/dist/src/agent/mcp/mcp-http.js +0 -67
- package/dist/src/agent/mcp/mcp-resource-id.d.ts +0 -6
- package/dist/src/agent/mcp/mcp-resource-id.js +0 -19
- package/dist/src/agent/mcp/mcp-stdio-transport.d.ts +0 -26
- package/dist/src/agent/mcp/mcp-stdio-transport.js +0 -120
- package/dist/src/agent/mcp/mcp-stdio.d.ts +0 -18
- package/dist/src/agent/mcp/mcp-stdio.js +0 -35
- package/dist/src/agent/mcp/mcp-transport-config.d.ts +0 -28
- package/dist/src/agent/mcp/mcp-transport-config.js +0 -91
- package/dist/src/agent/mcp/mcp-transport.d.ts +0 -17
- package/dist/src/agent/mcp/mcp-transport.js +0 -141
- package/dist/src/agent/mcp/oauth/index.d.ts +0 -6
- package/dist/src/agent/mcp/oauth/index.js +0 -6
- package/dist/src/agent/mcp/oauth/mcp-oauth-errors.d.ts +0 -5
- package/dist/src/agent/mcp/oauth/mcp-oauth-errors.js +0 -14
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.d.ts +0 -30
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +0 -276
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.d.ts +0 -33
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +0 -103
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.d.ts +0 -31
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.js +0 -181
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.d.ts +0 -12
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +0 -91
- package/dist/src/agent/mcp/oauth/mcp-oauth-types.d.ts +0 -22
- package/dist/src/agent/mcp/oauth/mcp-oauth-types.js +0 -1
- package/dist/src/agent/mcp/plugin-http-fetch.d.ts +0 -2
- package/dist/src/agent/source-context/mcp-resource-context.d.ts +0 -8
- package/dist/src/agent/source-context/mcp-resource-context.js +0 -30
- package/dist/src/auth/oauth/openai-codex.d.ts +0 -9
- package/dist/src/auth/oauth/openai-codex.js +0 -414
- package/dist/src/browser/policy/approval-store.d.ts +0 -17
- package/dist/src/browser/policy/approval-store.js +0 -62
- package/dist/src/browser/providers/extension-ws-acquire.d.ts +0 -19
- package/dist/src/browser/providers/extension-ws-acquire.js +0 -78
- package/dist/src/browser/providers/extension.d.ts +0 -61
- package/dist/src/browser/providers/extension.js +0 -378
- package/dist/src/connectors/plugin-mcp-recovery.d.ts +0 -28
- package/dist/src/connectors/plugin-mcp-recovery.js +0 -90
- package/dist/src/extensions/agent-plugins/connection.d.ts +0 -8
- package/dist/src/extensions/agent-plugins/connection.js +0 -41
- package/dist/src/extensions/agent-plugins/health.d.ts +0 -4
- package/dist/src/extensions/agent-plugins/health.js +0 -48
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.d.ts +0 -1
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as strictObject, t as number, d as boolean, G as string, c as array, _ as _enum, r as literal, u as object, m as discriminatedUnion, e as browserPageContextsInputSchema, H as t,
|
|
1
|
+
import { F as strictObject, t as number, d as boolean, G as string, c as array, _ as _enum, r as literal, u as object, m as discriminatedUnion, e as browserPageContextsInputSchema, H as t, p as gatewayFetch, M as MAX_BROWSER_CONTEXTS_PER_TURN, o as extensionLocale, v as openDatabase, a as RealtimeClient, R as REALTIME_PROTOCOL_VERSION, b as activeTabId, k as currentTabDescriptor, T as TAB_BINDING_PREFIX, q as getAccessProfile, y as readProfile, B as runWithTabSiteAccess, P as PENDING_CONTEXT_KEY, i as captureTabWithPermission, w as pairGateway, D as setAutoConnectEnabled, x as readPendingBrowserPairing, l as discoverLocalGateway, C as saveExtensionLocalePreference, A as revokeAndForgetProfile, f as cancelPendingBrowserPairing, s as loadExtensionLocalePreference } from './assets/page-context-BeworyNB.js';
|
|
2
2
|
|
|
3
3
|
const AppContextResourceSchema = strictObject({
|
|
4
4
|
kind: _enum(["note", "task", "project", "scene", "local_app"]),
|
|
@@ -51,11 +51,31 @@ const attachmentSchema = strictObject({
|
|
|
51
51
|
workspaceRelativePath: string().optional(),
|
|
52
52
|
durationSeconds: number().nonnegative().optional()
|
|
53
53
|
});
|
|
54
|
+
const endpointContextSchema = strictObject({
|
|
55
|
+
version: literal(1),
|
|
56
|
+
capturedAt: number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
57
|
+
timezone: string().min(1).max(80).refine((value) => {
|
|
58
|
+
try {
|
|
59
|
+
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
60
|
+
return true;
|
|
61
|
+
} catch {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}, "Invalid timezone"),
|
|
65
|
+
locale: string().min(1).max(80).refine((value) => {
|
|
66
|
+
try {
|
|
67
|
+
return Intl.getCanonicalLocales(value).length === 1;
|
|
68
|
+
} catch {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}, "Invalid locale")
|
|
72
|
+
});
|
|
54
73
|
const sessionInputContentSchema = strictObject({
|
|
55
74
|
content: string(),
|
|
75
|
+
endpointContext: endpointContextSchema.optional(),
|
|
56
76
|
attachments: array(attachmentSchema).optional(),
|
|
57
77
|
contextRefs: array(strictObject({
|
|
58
|
-
kind: _enum(["note", "task", "file", "session", "browser_tab", "
|
|
78
|
+
kind: _enum(["note", "task", "file", "session", "browser_tab", "user_assertion"]),
|
|
59
79
|
sourceId: string().trim().min(1),
|
|
60
80
|
refId: string().regex(/^[A-Za-z0-9_-]{1,64}$/).optional(),
|
|
61
81
|
expectedVersion: string().optional()
|
|
@@ -17573,7 +17593,7 @@ var clientExports = requireClient();
|
|
|
17573
17593
|
function MicrophonePermission() {
|
|
17574
17594
|
const requesting = reactExports.useRef(false);
|
|
17575
17595
|
const [state, setState] = reactExports.useState("idle");
|
|
17576
|
-
|
|
17596
|
+
const authorize = reactExports.useCallback(async () => {
|
|
17577
17597
|
if (requesting.current) return;
|
|
17578
17598
|
requesting.current = true;
|
|
17579
17599
|
setState("pending");
|
|
@@ -17586,11 +17606,328 @@ function MicrophonePermission() {
|
|
|
17586
17606
|
} finally {
|
|
17587
17607
|
requesting.current = false;
|
|
17588
17608
|
}
|
|
17589
|
-
}
|
|
17609
|
+
}, []);
|
|
17610
|
+
reactExports.useEffect(() => {
|
|
17611
|
+
void authorize();
|
|
17612
|
+
}, [authorize]);
|
|
17590
17613
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "microphone-permission", children: [
|
|
17591
17614
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: t("voicePermissionOpen") }),
|
|
17592
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { role: "status", children: t(state === "granted" ? "voicePermissionGranted" : state === "denied" ? "voicePermissionFailed" : "
|
|
17593
|
-
state
|
|
17615
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { role: "status", children: t(state === "granted" ? "voicePermissionGranted" : state === "denied" ? "voicePermissionFailed" : "voiceStarting") }),
|
|
17616
|
+
state === "denied" ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => void authorize(), children: t("voicePermissionOpen") }) : null
|
|
17617
|
+
] });
|
|
17618
|
+
}
|
|
17619
|
+
|
|
17620
|
+
function IconBase({ children, ...props }) {
|
|
17621
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", ...props, children });
|
|
17622
|
+
}
|
|
17623
|
+
function ChevronDownIcon(props) {
|
|
17624
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m7 10 5 5 5-5" }) });
|
|
17625
|
+
}
|
|
17626
|
+
function ArrowDownIcon(props) {
|
|
17627
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 5v14M6 13l6 6 6-6" }) });
|
|
17628
|
+
}
|
|
17629
|
+
function PlusIcon(props) {
|
|
17630
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 5v14M5 12h14" }) });
|
|
17631
|
+
}
|
|
17632
|
+
function SearchIcon(props) {
|
|
17633
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17634
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "11", cy: "11", r: "7" }),
|
|
17635
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m20 20-4-4" })
|
|
17636
|
+
] });
|
|
17637
|
+
}
|
|
17638
|
+
function PaperclipIcon(props) {
|
|
17639
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m20.5 11.5-8.9 8.9a6 6 0 0 1-8.5-8.5l9.5-9.5a4 4 0 0 1 5.7 5.7l-9.5 9.5A2 2 0 0 1 6 14.8l8.8-8.8" }) });
|
|
17640
|
+
}
|
|
17641
|
+
function PageIcon(props) {
|
|
17642
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17643
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z" }),
|
|
17644
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14 2v6h6M8 13h8M8 17h5" })
|
|
17645
|
+
] });
|
|
17646
|
+
}
|
|
17647
|
+
function SelectionIcon(props) {
|
|
17648
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M8 4H5a1 1 0 0 0-1 1v3M16 4h3a1 1 0 0 1 1 1v3M20 16v3a1 1 0 0 1-1 1h-3M8 20H5a1 1 0 0 1-1-1v-3M8 9h8M8 13h6" }) });
|
|
17649
|
+
}
|
|
17650
|
+
function CameraIcon(props) {
|
|
17651
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17652
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14.5 4 16 7h3a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h3l1.5-3Z" }),
|
|
17653
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "13", r: "3" })
|
|
17654
|
+
] });
|
|
17655
|
+
}
|
|
17656
|
+
function FileIcon(props) {
|
|
17657
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17658
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z" }),
|
|
17659
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14 2v6h6" })
|
|
17660
|
+
] });
|
|
17661
|
+
}
|
|
17662
|
+
function EyeIcon(props) {
|
|
17663
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17664
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z" }),
|
|
17665
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "2.5" })
|
|
17666
|
+
] });
|
|
17667
|
+
}
|
|
17668
|
+
function CursorIcon(props) {
|
|
17669
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m5 3 14 9-6 2-3 6Z" }) });
|
|
17670
|
+
}
|
|
17671
|
+
function SendIcon(props) {
|
|
17672
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m5 12 7-7 7 7M12 19V5" }) });
|
|
17673
|
+
}
|
|
17674
|
+
function StopIcon(props) {
|
|
17675
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { x: "7", y: "7", width: "10", height: "10", rx: "1.5", fill: "currentColor", stroke: "none" }) });
|
|
17676
|
+
}
|
|
17677
|
+
function CopyIcon(props) {
|
|
17678
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17679
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("rect", { x: "9", y: "9", width: "11", height: "11", rx: "2" }),
|
|
17680
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3" })
|
|
17681
|
+
] });
|
|
17682
|
+
}
|
|
17683
|
+
function CheckIcon(props) {
|
|
17684
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m5 12 4 4L19 6" }) });
|
|
17685
|
+
}
|
|
17686
|
+
function CloseIcon(props) {
|
|
17687
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m6 6 12 12M18 6 6 18" }) });
|
|
17688
|
+
}
|
|
17689
|
+
function SparkleIcon(props) {
|
|
17690
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 3c.7 4.4 3.6 7.3 8 8-4.4.7-7.3 3.6-8 8-.7-4.4-3.6-7.3-8-8 4.4-.7 7.3-3.6 8-8Z" }) });
|
|
17691
|
+
}
|
|
17692
|
+
function AlertIcon(props) {
|
|
17693
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17694
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
17695
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 8v5M12 16.5h.01" })
|
|
17696
|
+
] });
|
|
17697
|
+
}
|
|
17698
|
+
function SettingsIcon(props) {
|
|
17699
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17700
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "3" }),
|
|
17701
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.86 2.86-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6 1.7 1.7 0 0 0-.4 1.1V21H9.55v-.1A1.7 1.7 0 0 0 8.5 19.4a1.7 1.7 0 0 0-1.88.34l-.06.06-2.86-2.86.06-.06A1.7 1.7 0 0 0 4.1 15a1.7 1.7 0 0 0-.6-1 1.7 1.7 0 0 0-1.1-.4H2V9.55h.4A1.7 1.7 0 0 0 4.1 8.5a1.7 1.7 0 0 0-.34-1.88l-.06-.06L6.56 3.7l.06.06A1.7 1.7 0 0 0 8.5 4.1a1.7 1.7 0 0 0 1-.6 1.7 1.7 0 0 0 .4-1.1V2h4.05v.4A1.7 1.7 0 0 0 15 4.1a1.7 1.7 0 0 0 1.88-.34l.06-.06 2.86 2.86-.06.06A1.7 1.7 0 0 0 19.4 8.5a1.7 1.7 0 0 0 .6 1 1.7 1.7 0 0 0 1.1.4h.4v4.05h-.4A1.7 1.7 0 0 0 19.4 15Z" })
|
|
17702
|
+
] });
|
|
17703
|
+
}
|
|
17704
|
+
function SunIcon(props) {
|
|
17705
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17706
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "4" }),
|
|
17707
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.42-1.42M17.66 6.34l1.41-1.41" })
|
|
17708
|
+
] });
|
|
17709
|
+
}
|
|
17710
|
+
function GlobeIcon(props) {
|
|
17711
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17712
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
17713
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M3 12h18M12 3a15 15 0 0 1 0 18M12 3a15 15 0 0 0 0 18" })
|
|
17714
|
+
] });
|
|
17715
|
+
}
|
|
17716
|
+
function MicrophoneIcon(props) {
|
|
17717
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17718
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("rect", { x: "9", y: "2", width: "6", height: "12", rx: "3" }),
|
|
17719
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M5 10v2a7 7 0 0 0 14 0v-2M12 19v3M8 22h8" })
|
|
17720
|
+
] });
|
|
17721
|
+
}
|
|
17722
|
+
|
|
17723
|
+
function recordingErrorMessage(cause) {
|
|
17724
|
+
const message = (cause instanceof Error ? cause.message : String(cause)).replace(/^(?:Error:\s*)+/, "");
|
|
17725
|
+
if (message === "RECORDING_PAGE_UNAVAILABLE") return t("recordingChooseWebsite");
|
|
17726
|
+
return message;
|
|
17727
|
+
}
|
|
17728
|
+
function RecordingPanel() {
|
|
17729
|
+
const [session, setSession] = reactExports.useState();
|
|
17730
|
+
const [pages, setPages] = reactExports.useState([]);
|
|
17731
|
+
const [selectedTab, setSelectedTab] = reactExports.useState();
|
|
17732
|
+
const [pagesLoading, setPagesLoading] = reactExports.useState(true);
|
|
17733
|
+
const [busy, setBusy] = reactExports.useState(false);
|
|
17734
|
+
const [error, setError] = reactExports.useState("");
|
|
17735
|
+
const [automation, setAutomation] = reactExports.useState();
|
|
17736
|
+
const [inputs, setInputs] = reactExports.useState({});
|
|
17737
|
+
const [run, setRun] = reactExports.useState();
|
|
17738
|
+
const api = async (path, init) => {
|
|
17739
|
+
const response = await gatewayFetch(path, init);
|
|
17740
|
+
const data = await response.json();
|
|
17741
|
+
if (!response.ok) throw new Error(typeof data.error === "string" ? data.error : data.error?.message || t("recordingRequestFailed"));
|
|
17742
|
+
return data;
|
|
17743
|
+
};
|
|
17744
|
+
const command = async (operation, tabId) => {
|
|
17745
|
+
const response = await chrome.runtime.sendMessage({ type: "browser/recording-command", operation, ...tabId !== void 0 ? { tabId } : {} });
|
|
17746
|
+
if (!response.ok) throw new Error(response.error);
|
|
17747
|
+
return response.value;
|
|
17748
|
+
};
|
|
17749
|
+
reactExports.useEffect(() => {
|
|
17750
|
+
let disposed = false;
|
|
17751
|
+
const refresh = async (followActive = false) => {
|
|
17752
|
+
try {
|
|
17753
|
+
const tabs = (await chrome.tabs.query({ currentWindow: true })).filter((tab) => tab.id !== void 0 && /^https?:\/\//.test(tab.url ?? ""));
|
|
17754
|
+
if (disposed) return;
|
|
17755
|
+
setPages(tabs);
|
|
17756
|
+
setSelectedTab((current) => followActive && tabs.find((tab) => tab.active)?.id || tabs.find((tab) => tab.id === current)?.id || tabs.find((tab) => tab.active)?.id || (tabs.length === 1 ? tabs[0].id : void 0));
|
|
17757
|
+
} catch (cause) {
|
|
17758
|
+
if (!disposed) setError(recordingErrorMessage(cause));
|
|
17759
|
+
} finally {
|
|
17760
|
+
if (!disposed) setPagesLoading(false);
|
|
17761
|
+
}
|
|
17762
|
+
};
|
|
17763
|
+
const activated = () => {
|
|
17764
|
+
void refresh(true);
|
|
17765
|
+
};
|
|
17766
|
+
const changed = () => {
|
|
17767
|
+
void refresh();
|
|
17768
|
+
};
|
|
17769
|
+
void refresh(true);
|
|
17770
|
+
chrome.tabs.onActivated.addListener(activated);
|
|
17771
|
+
chrome.tabs.onUpdated.addListener(changed);
|
|
17772
|
+
chrome.tabs.onRemoved.addListener(changed);
|
|
17773
|
+
chrome.tabs.onCreated.addListener(changed);
|
|
17774
|
+
return () => {
|
|
17775
|
+
disposed = true;
|
|
17776
|
+
chrome.tabs.onActivated.removeListener(activated);
|
|
17777
|
+
chrome.tabs.onUpdated.removeListener(changed);
|
|
17778
|
+
chrome.tabs.onRemoved.removeListener(changed);
|
|
17779
|
+
chrome.tabs.onCreated.removeListener(changed);
|
|
17780
|
+
};
|
|
17781
|
+
}, []);
|
|
17782
|
+
reactExports.useEffect(() => {
|
|
17783
|
+
let disposed = false;
|
|
17784
|
+
const refresh = () => void command("status").then((sessions) => {
|
|
17785
|
+
if (!disposed) setSession(sessions.find((item) => ["recording", "paused"].includes(item.state)) ?? sessions.at(-1));
|
|
17786
|
+
}).catch((cause) => {
|
|
17787
|
+
if (!disposed) setError(recordingErrorMessage(cause));
|
|
17788
|
+
});
|
|
17789
|
+
refresh();
|
|
17790
|
+
const timer = window.setInterval(refresh, 1500);
|
|
17791
|
+
return () => {
|
|
17792
|
+
disposed = true;
|
|
17793
|
+
window.clearInterval(timer);
|
|
17794
|
+
};
|
|
17795
|
+
}, []);
|
|
17796
|
+
reactExports.useEffect(() => {
|
|
17797
|
+
if (!session?.automationId) {
|
|
17798
|
+
setAutomation(void 0);
|
|
17799
|
+
return;
|
|
17800
|
+
}
|
|
17801
|
+
let disposed = false;
|
|
17802
|
+
void api(`/api/browser/automations/${encodeURIComponent(session.automationId)}`).then((data) => {
|
|
17803
|
+
if (disposed) return;
|
|
17804
|
+
const saved2 = data.automation;
|
|
17805
|
+
setAutomation(saved2);
|
|
17806
|
+
setInputs(Object.fromEntries(Object.entries(saved2.definition.inputs).map(([key, spec]) => [key, spec.default ?? ""])));
|
|
17807
|
+
}).catch((cause) => {
|
|
17808
|
+
if (!disposed) setError(recordingErrorMessage(cause));
|
|
17809
|
+
});
|
|
17810
|
+
return () => {
|
|
17811
|
+
disposed = true;
|
|
17812
|
+
};
|
|
17813
|
+
}, [session?.automationId]);
|
|
17814
|
+
reactExports.useEffect(() => {
|
|
17815
|
+
if (!run || !["queued", "running"].includes(run.status)) return;
|
|
17816
|
+
let disposed = false;
|
|
17817
|
+
const timer = window.setInterval(() => {
|
|
17818
|
+
void api(`/api/browser/automation-runs/${run.id}`).then((data) => {
|
|
17819
|
+
if (!disposed) setRun(data.run);
|
|
17820
|
+
}).catch((cause) => {
|
|
17821
|
+
if (!disposed) setError(recordingErrorMessage(cause));
|
|
17822
|
+
});
|
|
17823
|
+
}, 1e3);
|
|
17824
|
+
return () => {
|
|
17825
|
+
disposed = true;
|
|
17826
|
+
window.clearInterval(timer);
|
|
17827
|
+
};
|
|
17828
|
+
}, [run]);
|
|
17829
|
+
const runSaved = async () => {
|
|
17830
|
+
if (!automation) return;
|
|
17831
|
+
setBusy(true);
|
|
17832
|
+
setError("");
|
|
17833
|
+
try {
|
|
17834
|
+
const data = await api(`/api/browser/automations/${automation.id}/run`, {
|
|
17835
|
+
method: "POST",
|
|
17836
|
+
headers: { "Content-Type": "application/json" },
|
|
17837
|
+
body: JSON.stringify({ inputs, revision: automation.revision, clientRequestId: crypto.randomUUID() })
|
|
17838
|
+
});
|
|
17839
|
+
setRun(data.run);
|
|
17840
|
+
} catch (cause) {
|
|
17841
|
+
setError(recordingErrorMessage(cause));
|
|
17842
|
+
} finally {
|
|
17843
|
+
setBusy(false);
|
|
17844
|
+
}
|
|
17845
|
+
};
|
|
17846
|
+
const act = async (operation) => {
|
|
17847
|
+
setBusy(true);
|
|
17848
|
+
setError("");
|
|
17849
|
+
try {
|
|
17850
|
+
if (operation === "start") {
|
|
17851
|
+
if (selectedTab === void 0) return;
|
|
17852
|
+
await chrome.tabs.update(selectedTab, { active: true });
|
|
17853
|
+
setRun(void 0);
|
|
17854
|
+
}
|
|
17855
|
+
setSession(await command(operation, operation === "start" ? selectedTab : void 0));
|
|
17856
|
+
} catch (cause) {
|
|
17857
|
+
setError(recordingErrorMessage(cause));
|
|
17858
|
+
} finally {
|
|
17859
|
+
setBusy(false);
|
|
17860
|
+
}
|
|
17861
|
+
};
|
|
17862
|
+
const active = !!session && ["recording", "paused"].includes(session.state);
|
|
17863
|
+
const saved = !!session?.automationId;
|
|
17864
|
+
const syncing = session?.state === "stopped" && !saved;
|
|
17865
|
+
const page = pages.find((tab) => tab.id === (active || syncing ? session.tabId : selectedTab));
|
|
17866
|
+
const status = active ? session.state === "paused" ? "recordingPaused" : "recordingActive" : saved ? "recordingSavedShort" : session?.state === "stopped" ? "recordingSaving" : session?.state === "interrupted" ? "recordingInterrupted" : "recordingReady";
|
|
17867
|
+
const runStatus = run?.businessOutcome === "unknown" ? t("recordingUnknown") : run?.status === "succeeded" ? t("recordingCompleted") : run?.status === "cancelled" ? t("recordingStopped") : run?.status === "failed" ? recordingErrorMessage(run.error || t("recordingRequestFailed")) : t("recordingRunning");
|
|
17868
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "recording-panel", "data-state": active ? session.state : syncing ? "syncing" : saved ? "saved" : "ready", "aria-label": t("recordingTitle"), "aria-busy": busy, children: [
|
|
17869
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: "recording-heading", children: [
|
|
17870
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "recording-icon", children: saved ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckIcon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(PageIcon, {}) }),
|
|
17871
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recording-heading-text", children: [
|
|
17872
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: saved && automation ? automation.definition.name : t("recordingTitle") }),
|
|
17873
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: active ? t("recordingActiveHelp") : saved ? t("recordingSaved") : t("recordingDescription") })
|
|
17874
|
+
] }),
|
|
17875
|
+
(active || saved || session?.state === "stopped" || session?.state === "interrupted" || selectedTab !== void 0) && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: `recording-status ${active && session.state === "recording" ? "is-recording" : saved ? "is-saved" : ""}`, role: "status", children: [
|
|
17876
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("i", {}),
|
|
17877
|
+
t(status)
|
|
17878
|
+
] })
|
|
17879
|
+
] }),
|
|
17880
|
+
!active && !syncing && (!saved || selectedTab === void 0) && (pagesLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "recording-skeleton" }) : pages.length ? /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "recording-target-label", children: [
|
|
17881
|
+
t("recordingTarget"),
|
|
17882
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("select", { className: "recording-page-select", value: selectedTab ?? "", disabled: busy, onChange: (event) => {
|
|
17883
|
+
setSelectedTab(Number(event.target.value));
|
|
17884
|
+
setError("");
|
|
17885
|
+
}, children: [
|
|
17886
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", disabled: true, children: t("recordingChoosePage") }),
|
|
17887
|
+
pages.map((tab) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: tab.id, children: tab.title || new URL(tab.url).hostname }, tab.id))
|
|
17888
|
+
] })
|
|
17889
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "recording-hint", children: t("recordingChooseWebsite") })),
|
|
17890
|
+
page && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recording-page", children: [
|
|
17891
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(GlobeIcon, {}),
|
|
17892
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: new URL(page.url).hostname }),
|
|
17893
|
+
active && /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: page.title })
|
|
17894
|
+
] }),
|
|
17895
|
+
syncing && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "recording-sync", role: "status", children: [
|
|
17896
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "recording-spinner", "aria-hidden": "true" }),
|
|
17897
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t("recordingSyncing") })
|
|
17898
|
+
] }),
|
|
17899
|
+
session?.state === "interrupted" && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "recording-hint", children: t("recordingInterruptedHelp") }),
|
|
17900
|
+
automation && Object.keys(automation.definition.inputs).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("details", { className: "recording-parameters", children: [
|
|
17901
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("summary", { children: t("recordingParameters") }),
|
|
17902
|
+
Object.entries(automation.definition.inputs).map(([key, spec]) => /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: `recording-input ${spec.type === "boolean" ? "is-checkbox" : ""}`, children: [
|
|
17903
|
+
spec.description || key,
|
|
17904
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17905
|
+
"input",
|
|
17906
|
+
{
|
|
17907
|
+
type: spec.type === "boolean" ? "checkbox" : spec.type === "number" ? "number" : "text",
|
|
17908
|
+
checked: spec.type === "boolean" ? !!inputs[key] : void 0,
|
|
17909
|
+
value: spec.type === "boolean" ? void 0 : String(inputs[key] ?? ""),
|
|
17910
|
+
onChange: (event) => setInputs((current) => ({ ...current, [key]: spec.type === "boolean" ? event.target.checked : spec.type === "number" ? Number(event.target.value) : event.target.value }))
|
|
17911
|
+
}
|
|
17912
|
+
)
|
|
17913
|
+
] }, key))
|
|
17914
|
+
] }),
|
|
17915
|
+
!syncing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "recording-actions", children: active ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
17916
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "recording-button", disabled: busy, onClick: () => void act(session.state === "paused" ? "resume" : "pause"), children: t(session.state === "paused" ? "recordingResume" : "recordingPause") }),
|
|
17917
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "recording-button is-primary", disabled: busy, onClick: () => void act("finish"), children: [
|
|
17918
|
+
busy ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "recording-spinner", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(StopIcon, {}),
|
|
17919
|
+
t("recordingFinish")
|
|
17920
|
+
] })
|
|
17921
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
17922
|
+
automation && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "recording-button is-primary", disabled: busy || !!run && ["queued", "running"].includes(run.status), onClick: () => void runSaved(), children: t("recordingRun") }),
|
|
17923
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: `recording-button ${saved ? "" : "is-primary"}`, disabled: busy || pagesLoading || selectedTab === void 0, onClick: () => void act("start"), children: [
|
|
17924
|
+
busy ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "recording-spinner", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "recording-button-dot" }),
|
|
17925
|
+
t(saved ? "recordingNew" : "recordingStart")
|
|
17926
|
+
] })
|
|
17927
|
+
] }) }),
|
|
17928
|
+
run && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "recording-run-status", role: "status", children: runStatus }),
|
|
17929
|
+
run?.status === "succeeded" && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "recording-result", children: typeof run.result === "object" && run.result !== null ? Object.entries(run.result).map(([key, value]) => `${key}: ${typeof value === "string" ? value : JSON.stringify(value)}`).join("\n") : String(run.result ?? "") }),
|
|
17930
|
+
(error || session?.error) && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "recording-error", role: "alert", children: recordingErrorMessage(error || session.error) })
|
|
17594
17931
|
] });
|
|
17595
17932
|
}
|
|
17596
17933
|
|
|
@@ -17908,109 +18245,6 @@ class PcmWavRecorder {
|
|
|
17908
18245
|
}
|
|
17909
18246
|
}
|
|
17910
18247
|
|
|
17911
|
-
function IconBase({ children, ...props }) {
|
|
17912
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", ...props, children });
|
|
17913
|
-
}
|
|
17914
|
-
function ChevronDownIcon(props) {
|
|
17915
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m7 10 5 5 5-5" }) });
|
|
17916
|
-
}
|
|
17917
|
-
function ArrowDownIcon(props) {
|
|
17918
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 5v14M6 13l6 6 6-6" }) });
|
|
17919
|
-
}
|
|
17920
|
-
function PlusIcon(props) {
|
|
17921
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 5v14M5 12h14" }) });
|
|
17922
|
-
}
|
|
17923
|
-
function SearchIcon(props) {
|
|
17924
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17925
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "11", cy: "11", r: "7" }),
|
|
17926
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m20 20-4-4" })
|
|
17927
|
-
] });
|
|
17928
|
-
}
|
|
17929
|
-
function PaperclipIcon(props) {
|
|
17930
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m20.5 11.5-8.9 8.9a6 6 0 0 1-8.5-8.5l9.5-9.5a4 4 0 0 1 5.7 5.7l-9.5 9.5A2 2 0 0 1 6 14.8l8.8-8.8" }) });
|
|
17931
|
-
}
|
|
17932
|
-
function PageIcon(props) {
|
|
17933
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17934
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z" }),
|
|
17935
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14 2v6h6M8 13h8M8 17h5" })
|
|
17936
|
-
] });
|
|
17937
|
-
}
|
|
17938
|
-
function SelectionIcon(props) {
|
|
17939
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M8 4H5a1 1 0 0 0-1 1v3M16 4h3a1 1 0 0 1 1 1v3M20 16v3a1 1 0 0 1-1 1h-3M8 20H5a1 1 0 0 1-1-1v-3M8 9h8M8 13h6" }) });
|
|
17940
|
-
}
|
|
17941
|
-
function CameraIcon(props) {
|
|
17942
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17943
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14.5 4 16 7h3a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h3l1.5-3Z" }),
|
|
17944
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "13", r: "3" })
|
|
17945
|
-
] });
|
|
17946
|
-
}
|
|
17947
|
-
function FileIcon(props) {
|
|
17948
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17949
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z" }),
|
|
17950
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14 2v6h6" })
|
|
17951
|
-
] });
|
|
17952
|
-
}
|
|
17953
|
-
function EyeIcon(props) {
|
|
17954
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17955
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z" }),
|
|
17956
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "2.5" })
|
|
17957
|
-
] });
|
|
17958
|
-
}
|
|
17959
|
-
function CursorIcon(props) {
|
|
17960
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m5 3 14 9-6 2-3 6Z" }) });
|
|
17961
|
-
}
|
|
17962
|
-
function SendIcon(props) {
|
|
17963
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m5 12 7-7 7 7M12 19V5" }) });
|
|
17964
|
-
}
|
|
17965
|
-
function StopIcon(props) {
|
|
17966
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { x: "7", y: "7", width: "10", height: "10", rx: "1.5", fill: "currentColor", stroke: "none" }) });
|
|
17967
|
-
}
|
|
17968
|
-
function CopyIcon(props) {
|
|
17969
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17970
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("rect", { x: "9", y: "9", width: "11", height: "11", rx: "2" }),
|
|
17971
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3" })
|
|
17972
|
-
] });
|
|
17973
|
-
}
|
|
17974
|
-
function CheckIcon(props) {
|
|
17975
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m5 12 4 4L19 6" }) });
|
|
17976
|
-
}
|
|
17977
|
-
function CloseIcon(props) {
|
|
17978
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m6 6 12 12M18 6 6 18" }) });
|
|
17979
|
-
}
|
|
17980
|
-
function SparkleIcon(props) {
|
|
17981
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconBase, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 3c.7 4.4 3.6 7.3 8 8-4.4.7-7.3 3.6-8 8-.7-4.4-3.6-7.3-8-8 4.4-.7 7.3-3.6 8-8Z" }) });
|
|
17982
|
-
}
|
|
17983
|
-
function AlertIcon(props) {
|
|
17984
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17985
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
17986
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 8v5M12 16.5h.01" })
|
|
17987
|
-
] });
|
|
17988
|
-
}
|
|
17989
|
-
function SettingsIcon(props) {
|
|
17990
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17991
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "3" }),
|
|
17992
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.86 2.86-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6 1.7 1.7 0 0 0-.4 1.1V21H9.55v-.1A1.7 1.7 0 0 0 8.5 19.4a1.7 1.7 0 0 0-1.88.34l-.06.06-2.86-2.86.06-.06A1.7 1.7 0 0 0 4.1 15a1.7 1.7 0 0 0-.6-1 1.7 1.7 0 0 0-1.1-.4H2V9.55h.4A1.7 1.7 0 0 0 4.1 8.5a1.7 1.7 0 0 0-.34-1.88l-.06-.06L6.56 3.7l.06.06A1.7 1.7 0 0 0 8.5 4.1a1.7 1.7 0 0 0 1-.6 1.7 1.7 0 0 0 .4-1.1V2h4.05v.4A1.7 1.7 0 0 0 15 4.1a1.7 1.7 0 0 0 1.88-.34l.06-.06 2.86 2.86-.06.06A1.7 1.7 0 0 0 19.4 8.5a1.7 1.7 0 0 0 .6 1 1.7 1.7 0 0 0 1.1.4h.4v4.05h-.4A1.7 1.7 0 0 0 19.4 15Z" })
|
|
17993
|
-
] });
|
|
17994
|
-
}
|
|
17995
|
-
function SunIcon(props) {
|
|
17996
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
17997
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "4" }),
|
|
17998
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.42-1.42M17.66 6.34l1.41-1.41" })
|
|
17999
|
-
] });
|
|
18000
|
-
}
|
|
18001
|
-
function GlobeIcon(props) {
|
|
18002
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
18003
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
18004
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M3 12h18M12 3a15 15 0 0 1 0 18M12 3a15 15 0 0 0 0 18" })
|
|
18005
|
-
] });
|
|
18006
|
-
}
|
|
18007
|
-
function MicrophoneIcon(props) {
|
|
18008
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconBase, { ...props, children: [
|
|
18009
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("rect", { x: "9", y: "2", width: "6", height: "12", rx: "3" }),
|
|
18010
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M5 10v2a7 7 0 0 0 14 0v-2M12 19v3M8 22h8" })
|
|
18011
|
-
] });
|
|
18012
|
-
}
|
|
18013
|
-
|
|
18014
18248
|
function VoiceInput({ disabled, onTranscript, onBusy }) {
|
|
18015
18249
|
const [state, setState] = reactExports.useState("idle");
|
|
18016
18250
|
const [error, setError] = reactExports.useState("");
|
|
@@ -18760,6 +18994,7 @@ class BrowserChatClient {
|
|
|
18760
18994
|
runTopic;
|
|
18761
18995
|
recoveringOutbox = false;
|
|
18762
18996
|
sendingInput = false;
|
|
18997
|
+
approvalResponses = /* @__PURE__ */ new Set();
|
|
18763
18998
|
lastOutboxRecoveryAt = 0;
|
|
18764
18999
|
sessionsRequest = 0;
|
|
18765
19000
|
defaultModelId;
|
|
@@ -18974,7 +19209,6 @@ ${endpointId}`;
|
|
|
18974
19209
|
queuedInputs: [],
|
|
18975
19210
|
clarification: void 0,
|
|
18976
19211
|
tabBinding: void 0,
|
|
18977
|
-
browserApproval: void 0,
|
|
18978
19212
|
modelConfig: void 0,
|
|
18979
19213
|
error: void 0
|
|
18980
19214
|
});
|
|
@@ -19005,7 +19239,6 @@ ${endpointId}`;
|
|
|
19005
19239
|
));
|
|
19006
19240
|
if (this.snapshot.conversationId !== conversationId) return;
|
|
19007
19241
|
if (run.payload?.active && run.payload.runId) await this.followRun(run.payload.runId);
|
|
19008
|
-
await this.reloadBrowserApproval();
|
|
19009
19242
|
if (this.snapshot.conversationId !== conversationId) return;
|
|
19010
19243
|
this.update({ pendingDelivery: Boolean(await readBrowserOutbox(await inputStorageKey(conversationId))) });
|
|
19011
19244
|
if (this.snapshot.endpointReady) await this.recoverOutbox();
|
|
@@ -19327,16 +19560,6 @@ ${endpointId}`;
|
|
|
19327
19560
|
if (binding) await chrome.storage.session.remove(`${TAB_BINDING_PREFIX}${binding.id}`);
|
|
19328
19561
|
this.update({ tabBinding: void 0 });
|
|
19329
19562
|
}
|
|
19330
|
-
async respondToBrowserApproval(decision) {
|
|
19331
|
-
const approval = this.snapshot.browserApproval;
|
|
19332
|
-
if (!approval) return;
|
|
19333
|
-
await json(await gatewayFetch("/api/browser/approvals/respond", {
|
|
19334
|
-
method: "POST",
|
|
19335
|
-
headers: { "Content-Type": "application/json" },
|
|
19336
|
-
body: JSON.stringify({ id: approval.id, decision })
|
|
19337
|
-
}));
|
|
19338
|
-
await this.reloadBrowserApproval();
|
|
19339
|
-
}
|
|
19340
19563
|
async waitForRun(conversationId, clientMessageId) {
|
|
19341
19564
|
for (let attempt = 0; attempt < 20; attempt += 1) {
|
|
19342
19565
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
@@ -19366,10 +19589,9 @@ ${endpointId}`;
|
|
|
19366
19589
|
if (event === "clarification.updated") {
|
|
19367
19590
|
const conversationId = this.snapshot.conversationId;
|
|
19368
19591
|
if (conversationId && data && typeof data === "object" && data.conversationId === conversationId) {
|
|
19369
|
-
this.
|
|
19592
|
+
await this.applyClarification(data, conversationId);
|
|
19370
19593
|
}
|
|
19371
19594
|
}
|
|
19372
|
-
if (event === "browser.approval.required") await this.reloadBrowserApproval();
|
|
19373
19595
|
return;
|
|
19374
19596
|
}
|
|
19375
19597
|
if (topic === "sessions") {
|
|
@@ -19495,6 +19717,35 @@ ${endpointId}`;
|
|
|
19495
19717
|
fixedModel: config.fixedModel === true
|
|
19496
19718
|
} });
|
|
19497
19719
|
}
|
|
19720
|
+
async applyClarification(value, conversationId) {
|
|
19721
|
+
if (this.snapshot.conversationId !== conversationId) return;
|
|
19722
|
+
const clarification = mapClarification(value, conversationId);
|
|
19723
|
+
if (clarification?.kind !== "approval") {
|
|
19724
|
+
this.update({ clarification });
|
|
19725
|
+
return;
|
|
19726
|
+
}
|
|
19727
|
+
this.update({ clarification: void 0 });
|
|
19728
|
+
const key = `browser-approval:${clarification.id}:${clarification.version}`;
|
|
19729
|
+
if (this.approvalResponses.has(key)) return;
|
|
19730
|
+
this.approvalResponses.add(key);
|
|
19731
|
+
try {
|
|
19732
|
+
await json(await gatewayFetch(`/api/clarifications/${encodeURIComponent(clarification.id)}/responses`, {
|
|
19733
|
+
method: "POST",
|
|
19734
|
+
headers: { "Content-Type": "application/json" },
|
|
19735
|
+
body: JSON.stringify({
|
|
19736
|
+
action: "answer",
|
|
19737
|
+
answer: "Approved. Continue with the requested operation.",
|
|
19738
|
+
expectedVersion: clarification.version,
|
|
19739
|
+
idempotencyKey: key
|
|
19740
|
+
})
|
|
19741
|
+
}, this.profileIdentity));
|
|
19742
|
+
} catch (cause) {
|
|
19743
|
+
this.approvalResponses.delete(key);
|
|
19744
|
+
if (this.snapshot.conversationId === conversationId) {
|
|
19745
|
+
this.update({ error: cause instanceof Error ? cause.message : String(cause) });
|
|
19746
|
+
}
|
|
19747
|
+
}
|
|
19748
|
+
}
|
|
19498
19749
|
async reloadClarification() {
|
|
19499
19750
|
const conversationId = this.snapshot.conversationId;
|
|
19500
19751
|
if (!conversationId) return;
|
|
@@ -19503,7 +19754,7 @@ ${endpointId}`;
|
|
|
19503
19754
|
`/api/sessions/${encodeURIComponent(conversationId)}/clarification`
|
|
19504
19755
|
));
|
|
19505
19756
|
if (this.snapshot.conversationId === conversationId) {
|
|
19506
|
-
this.
|
|
19757
|
+
await this.applyClarification(result.payload, conversationId);
|
|
19507
19758
|
}
|
|
19508
19759
|
}
|
|
19509
19760
|
async reloadTabBinding() {
|
|
@@ -19519,19 +19770,6 @@ ${endpointId}`;
|
|
|
19519
19770
|
await chrome.storage.session.set({ [`${TAB_BINDING_PREFIX}${result.payload.id}`]: result.payload });
|
|
19520
19771
|
this.update({ tabBinding: result.payload });
|
|
19521
19772
|
}
|
|
19522
|
-
async reloadBrowserApproval() {
|
|
19523
|
-
const conversationId = this.snapshot.conversationId;
|
|
19524
|
-
if (!conversationId || !this.snapshot.tabBinding) {
|
|
19525
|
-
this.update({ browserApproval: void 0 });
|
|
19526
|
-
return;
|
|
19527
|
-
}
|
|
19528
|
-
const result = await json(await gatewayFetch(
|
|
19529
|
-
`/api/browser/approvals?conversationId=${encodeURIComponent(conversationId)}`
|
|
19530
|
-
));
|
|
19531
|
-
if (this.snapshot.conversationId === conversationId) {
|
|
19532
|
-
this.update({ browserApproval: result.approvals.find((approval) => approval.status === "pending") });
|
|
19533
|
-
}
|
|
19534
|
-
}
|
|
19535
19773
|
async reconcileAbortedRun(runId) {
|
|
19536
19774
|
const conversationId = this.snapshot.conversationId;
|
|
19537
19775
|
if (!conversationId) return;
|
|
@@ -19645,12 +19883,7 @@ async function fileToBrowserAttachment(file) {
|
|
|
19645
19883
|
};
|
|
19646
19884
|
}
|
|
19647
19885
|
async function captureVisibleScreenshot() {
|
|
19648
|
-
const
|
|
19649
|
-
const [granted, [activeTab]] = await Promise.all([
|
|
19650
|
-
chrome.permissions.request({ origins: ["<all_urls>"] }),
|
|
19651
|
-
tabPromise
|
|
19652
|
-
]);
|
|
19653
|
-
if (!granted) throw new Error(t("errorScreenshotPermissionRequired"));
|
|
19886
|
+
const [activeTab] = await chrome.tabs.query({ active: true, currentWindow: true });
|
|
19654
19887
|
if (activeTab?.id === void 0) throw new Error(t("errorNoActivePage"));
|
|
19655
19888
|
const dataUrl = await runWithTabSiteAccess(activeTab.id, async (accessibleTab) => {
|
|
19656
19889
|
const [currentTab] = await chrome.tabs.query({ active: true, currentWindow: true });
|
|
@@ -28323,13 +28556,6 @@ function formatSessionDate(timestamp) {
|
|
|
28323
28556
|
if (date.toDateString() === now.toDateString()) return formatMessageTime(date.getTime());
|
|
28324
28557
|
return new Intl.DateTimeFormat(extensionLocale(), { month: "short", day: "numeric" }).format(date);
|
|
28325
28558
|
}
|
|
28326
|
-
const RISK_MESSAGE_KEYS = {
|
|
28327
|
-
external_effect: "riskExternalEffect",
|
|
28328
|
-
destructive: "riskDestructive",
|
|
28329
|
-
sensitive: "riskSensitive",
|
|
28330
|
-
draft: "riskDraft",
|
|
28331
|
-
read: "riskRead"
|
|
28332
|
-
};
|
|
28333
28559
|
function formatFileSize(size) {
|
|
28334
28560
|
if (typeof size !== "number" || !Number.isFinite(size) || size < 0) return "";
|
|
28335
28561
|
if (size < 1024) return `${size} B`;
|
|
@@ -28937,25 +29163,10 @@ function ChatPanel({ gatewayId, deviceId }) {
|
|
|
28937
29163
|
/* @__PURE__ */ jsxRuntimeExports.jsx(PaperclipIcon, {}),
|
|
28938
29164
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t("dropFiles") })
|
|
28939
29165
|
] }) : null,
|
|
28940
|
-
snapshot.
|
|
28941
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "request-card-title", children: [
|
|
28942
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertIcon, {}),
|
|
28943
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("strong", { children: [
|
|
28944
|
-
t("browserApproval"),
|
|
28945
|
-
" · ",
|
|
28946
|
-
t(RISK_MESSAGE_KEYS[snapshot.browserApproval.risk])
|
|
28947
|
-
] })
|
|
28948
|
-
] }),
|
|
28949
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: snapshot.browserApproval.summary }),
|
|
28950
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "request-actions", children: [
|
|
28951
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "request-primary", type: "button", onClick: () => void runControlAction(() => client.respondToBrowserApproval("approved")), children: t("allowOnce") }),
|
|
28952
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => void runControlAction(() => client.respondToBrowserApproval("denied")), children: t("deny") })
|
|
28953
|
-
] })
|
|
28954
|
-
] }) : null,
|
|
28955
|
-
snapshot.clarification ? /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "request-card", "aria-label": t("agentQuestion"), children: [
|
|
29166
|
+
snapshot.clarification?.kind === "input" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "request-card", "aria-label": t("agentQuestion"), children: [
|
|
28956
29167
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "request-card-title", children: [
|
|
28957
29168
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SparkleIcon, {}),
|
|
28958
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children:
|
|
29169
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: t("xopcNeedsInput") })
|
|
28959
29170
|
] }),
|
|
28960
29171
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: snapshot.clarification.question }),
|
|
28961
29172
|
snapshot.clarification.choices?.length ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "choice-list", children: snapshot.clarification.choices.map((choice) => /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", disabled: clarificationSubmitting, onClick: () => void respondToClarification("answer", choice), children: choice }, choice)) }) : null,
|
|
@@ -29227,36 +29438,24 @@ ${pageContext.context.selection ?? pageContext.context.text ?? ""}` }), children
|
|
|
29227
29438
|
] }),
|
|
29228
29439
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "tools-menu-section tab-access-section", children: [
|
|
29229
29440
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "tools-menu-label", children: t("liveTabAccess") }),
|
|
29230
|
-
snapshot.tabBinding ? /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "active-access", onClick: () => {
|
|
29441
|
+
snapshot.tabBinding?.mode === "act" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "active-access", onClick: () => {
|
|
29231
29442
|
setToolsOpen(false);
|
|
29232
29443
|
void runControlAction(() => client.unbindActiveTab());
|
|
29233
29444
|
}, children: [
|
|
29234
|
-
|
|
29445
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CursorIcon, {}),
|
|
29235
29446
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
29236
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children:
|
|
29447
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: t("controlEnabled") }),
|
|
29237
29448
|
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: t("stopAccess") })
|
|
29238
29449
|
] }),
|
|
29239
29450
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CloseIcon, {})
|
|
29240
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
29241
|
-
|
|
29242
|
-
|
|
29243
|
-
|
|
29244
|
-
},
|
|
29245
|
-
|
|
29246
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
29247
|
-
|
|
29248
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: t("keepPageAvailable") })
|
|
29249
|
-
] })
|
|
29250
|
-
] }),
|
|
29251
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", onClick: () => {
|
|
29252
|
-
setToolsOpen(false);
|
|
29253
|
-
void runControlAction(() => client.bindActiveTab("act"));
|
|
29254
|
-
}, children: [
|
|
29255
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(CursorIcon, {}),
|
|
29256
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
29257
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: t("controlThisTab") }),
|
|
29258
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: t("controlSafeguards") })
|
|
29259
|
-
] })
|
|
29451
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", onClick: () => {
|
|
29452
|
+
setToolsOpen(false);
|
|
29453
|
+
void runControlAction(() => client.bindActiveTab("act"));
|
|
29454
|
+
}, children: [
|
|
29455
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CursorIcon, {}),
|
|
29456
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
29457
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: t("useThisTab") }),
|
|
29458
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: t("useThisTabHelp") })
|
|
29260
29459
|
] })
|
|
29261
29460
|
] })
|
|
29262
29461
|
] })
|
|
@@ -29317,9 +29516,6 @@ async function reconnectBrowserBridge() {
|
|
|
29317
29516
|
}
|
|
29318
29517
|
function pairingErrorMessage(cause) {
|
|
29319
29518
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
29320
|
-
if (message === "Gateway site permission was not granted") {
|
|
29321
|
-
return t("errorGatewayPermissionHelp");
|
|
29322
|
-
}
|
|
29323
29519
|
if (message === "PAIRING_EXPIRED" || message === "Pairing expired" || message === "Pairing invitation has expired") {
|
|
29324
29520
|
return t("errorInvitationExpiredHelp");
|
|
29325
29521
|
}
|
|
@@ -29560,7 +29756,10 @@ function SidePanelApp({ initialLocale, initialTheme }) {
|
|
|
29560
29756
|
invitation ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => void cancelPairing(), disabled: state === "pairing", children: t("cancelPairing") }) : null
|
|
29561
29757
|
] })
|
|
29562
29758
|
] }) : null
|
|
29563
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.
|
|
29759
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
29760
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RecordingPanel, {}),
|
|
29761
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ChatPanel, { gatewayId: profile.gatewayId, deviceId: profile.deviceId }, JSON.stringify([profile.gatewayId, profile.gatewayUrl, profile.deviceId]))
|
|
29762
|
+
] })
|
|
29564
29763
|
] });
|
|
29565
29764
|
}
|
|
29566
29765
|
|