@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
|
@@ -8,8 +8,8 @@ export declare const BrowserAutomationDefinitionSchema: z.ZodObject<{
|
|
|
8
8
|
read: "read";
|
|
9
9
|
draft: "draft";
|
|
10
10
|
destructive: "destructive";
|
|
11
|
-
external_effect: "external_effect";
|
|
12
11
|
sensitive: "sensitive";
|
|
12
|
+
external_effect: "external_effect";
|
|
13
13
|
}>;
|
|
14
14
|
inputs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
15
15
|
type: z.ZodEnum<{
|
|
@@ -41,6 +41,11 @@ export declare const BrowserAutomationDefinitionSchema: z.ZodObject<{
|
|
|
41
41
|
role: z.ZodString;
|
|
42
42
|
name: z.ZodOptional<z.ZodString>;
|
|
43
43
|
nameIncludes: z.ZodOptional<z.ZodString>;
|
|
44
|
+
testId: z.ZodOptional<z.ZodString>;
|
|
45
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
role: z.ZodString;
|
|
47
|
+
name: z.ZodString;
|
|
48
|
+
}, z.core.$strict>>;
|
|
44
49
|
}, z.core.$strict>;
|
|
45
50
|
expect: z.ZodOptional<z.ZodObject<{
|
|
46
51
|
urlIncludes: z.ZodOptional<z.ZodString>;
|
|
@@ -58,6 +63,11 @@ export declare const BrowserAutomationDefinitionSchema: z.ZodObject<{
|
|
|
58
63
|
role: z.ZodString;
|
|
59
64
|
name: z.ZodOptional<z.ZodString>;
|
|
60
65
|
nameIncludes: z.ZodOptional<z.ZodString>;
|
|
66
|
+
testId: z.ZodOptional<z.ZodString>;
|
|
67
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
role: z.ZodString;
|
|
69
|
+
name: z.ZodString;
|
|
70
|
+
}, z.core.$strict>>;
|
|
61
71
|
}, z.core.$strict>;
|
|
62
72
|
value: z.ZodString;
|
|
63
73
|
submit: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -77,6 +87,11 @@ export declare const BrowserAutomationDefinitionSchema: z.ZodObject<{
|
|
|
77
87
|
role: z.ZodString;
|
|
78
88
|
name: z.ZodOptional<z.ZodString>;
|
|
79
89
|
nameIncludes: z.ZodOptional<z.ZodString>;
|
|
90
|
+
testId: z.ZodOptional<z.ZodString>;
|
|
91
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
92
|
+
role: z.ZodString;
|
|
93
|
+
name: z.ZodString;
|
|
94
|
+
}, z.core.$strict>>;
|
|
80
95
|
}, z.core.$strict>;
|
|
81
96
|
value: z.ZodString;
|
|
82
97
|
expect: z.ZodOptional<z.ZodObject<{
|
|
@@ -89,12 +104,30 @@ export declare const BrowserAutomationDefinitionSchema: z.ZodObject<{
|
|
|
89
104
|
visible: "visible";
|
|
90
105
|
}>>;
|
|
91
106
|
}, z.core.$strict>>;
|
|
107
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
108
|
+
action: z.ZodLiteral<"check">;
|
|
109
|
+
target: z.ZodObject<{
|
|
110
|
+
role: z.ZodString;
|
|
111
|
+
name: z.ZodOptional<z.ZodString>;
|
|
112
|
+
nameIncludes: z.ZodOptional<z.ZodString>;
|
|
113
|
+
testId: z.ZodOptional<z.ZodString>;
|
|
114
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
role: z.ZodString;
|
|
116
|
+
name: z.ZodString;
|
|
117
|
+
}, z.core.$strict>>;
|
|
118
|
+
}, z.core.$strict>;
|
|
119
|
+
checked: z.ZodBoolean;
|
|
92
120
|
}, z.core.$strict>, z.ZodObject<{
|
|
93
121
|
action: z.ZodLiteral<"press">;
|
|
94
122
|
target: z.ZodOptional<z.ZodObject<{
|
|
95
123
|
role: z.ZodString;
|
|
96
124
|
name: z.ZodOptional<z.ZodString>;
|
|
97
125
|
nameIncludes: z.ZodOptional<z.ZodString>;
|
|
126
|
+
testId: z.ZodOptional<z.ZodString>;
|
|
127
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
128
|
+
role: z.ZodString;
|
|
129
|
+
name: z.ZodString;
|
|
130
|
+
}, z.core.$strict>>;
|
|
98
131
|
}, z.core.$strict>>;
|
|
99
132
|
key: z.ZodString;
|
|
100
133
|
expect: z.ZodOptional<z.ZodObject<{
|
|
@@ -113,6 +146,11 @@ export declare const BrowserAutomationDefinitionSchema: z.ZodObject<{
|
|
|
113
146
|
role: z.ZodString;
|
|
114
147
|
name: z.ZodOptional<z.ZodString>;
|
|
115
148
|
nameIncludes: z.ZodOptional<z.ZodString>;
|
|
149
|
+
testId: z.ZodOptional<z.ZodString>;
|
|
150
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
role: z.ZodString;
|
|
152
|
+
name: z.ZodString;
|
|
153
|
+
}, z.core.$strict>>;
|
|
116
154
|
}, z.core.$strict>>;
|
|
117
155
|
deltaY: z.ZodNumber;
|
|
118
156
|
expect: z.ZodOptional<z.ZodObject<{
|
|
@@ -138,7 +176,52 @@ export declare const BrowserAutomationDefinitionSchema: z.ZodObject<{
|
|
|
138
176
|
role: z.ZodString;
|
|
139
177
|
name: z.ZodOptional<z.ZodString>;
|
|
140
178
|
nameIncludes: z.ZodOptional<z.ZodString>;
|
|
179
|
+
testId: z.ZodOptional<z.ZodString>;
|
|
180
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
role: z.ZodString;
|
|
182
|
+
name: z.ZodString;
|
|
183
|
+
}, z.core.$strict>>;
|
|
141
184
|
}, z.core.$strict>>;
|
|
142
185
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
143
186
|
}, z.core.$strict>], "action">>;
|
|
187
|
+
successCriteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
188
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
role: z.ZodString;
|
|
190
|
+
name: z.ZodOptional<z.ZodString>;
|
|
191
|
+
nameIncludes: z.ZodOptional<z.ZodString>;
|
|
192
|
+
testId: z.ZodOptional<z.ZodString>;
|
|
193
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
role: z.ZodString;
|
|
195
|
+
name: z.ZodString;
|
|
196
|
+
}, z.core.$strict>>;
|
|
197
|
+
}, z.core.$strict>>;
|
|
198
|
+
field: z.ZodEnum<{
|
|
199
|
+
value: "value";
|
|
200
|
+
text: "text";
|
|
201
|
+
title: "title";
|
|
202
|
+
url: "url";
|
|
203
|
+
checked: "checked";
|
|
204
|
+
}>;
|
|
205
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
206
|
+
includes: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, z.core.$strict>>>;
|
|
208
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
209
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
210
|
+
role: z.ZodString;
|
|
211
|
+
name: z.ZodOptional<z.ZodString>;
|
|
212
|
+
nameIncludes: z.ZodOptional<z.ZodString>;
|
|
213
|
+
testId: z.ZodOptional<z.ZodString>;
|
|
214
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
215
|
+
role: z.ZodString;
|
|
216
|
+
name: z.ZodString;
|
|
217
|
+
}, z.core.$strict>>;
|
|
218
|
+
}, z.core.$strict>>;
|
|
219
|
+
field: z.ZodEnum<{
|
|
220
|
+
value: "value";
|
|
221
|
+
text: "text";
|
|
222
|
+
title: "title";
|
|
223
|
+
url: "url";
|
|
224
|
+
href: "href";
|
|
225
|
+
}>;
|
|
226
|
+
}, z.core.$strict>>>;
|
|
144
227
|
}, z.core.$strict>;
|
|
@@ -10,7 +10,12 @@ const ExpectationSchema = z.object({
|
|
|
10
10
|
const TargetSchema = z.object({
|
|
11
11
|
role: z.string().min(1),
|
|
12
12
|
name: z.string().min(1).optional(),
|
|
13
|
-
nameIncludes: z.string().min(1).optional()
|
|
13
|
+
nameIncludes: z.string().min(1).optional(),
|
|
14
|
+
testId: z.string().min(1).optional(),
|
|
15
|
+
scope: z.object({
|
|
16
|
+
role: z.string().min(1),
|
|
17
|
+
name: z.string().min(1)
|
|
18
|
+
}).strict().optional()
|
|
14
19
|
}).strict().superRefine((target, ctx) => {
|
|
15
20
|
if (target.name && target.nameIncludes) ctx.addIssue({
|
|
16
21
|
code: "custom",
|
|
@@ -41,6 +46,11 @@ const StepSchema = z.discriminatedUnion("action", [
|
|
|
41
46
|
value: z.string(),
|
|
42
47
|
expect: ExpectationSchema.optional()
|
|
43
48
|
}).strict(),
|
|
49
|
+
z.object({
|
|
50
|
+
action: z.literal("check"),
|
|
51
|
+
target: TargetSchema,
|
|
52
|
+
checked: z.boolean()
|
|
53
|
+
}).strict(),
|
|
44
54
|
z.object({
|
|
45
55
|
action: z.literal("press"),
|
|
46
56
|
target: TargetSchema.optional(),
|
|
@@ -115,13 +125,61 @@ const BrowserAutomationDefinitionSchema = z.object({
|
|
|
115
125
|
"sensitive"
|
|
116
126
|
]),
|
|
117
127
|
inputs: z.record(z.string(), InputSchema).default({}),
|
|
118
|
-
steps: z.array(StepSchema).min(1).max(100)
|
|
128
|
+
steps: z.array(StepSchema).min(1).max(100),
|
|
129
|
+
successCriteria: z.array(z.object({
|
|
130
|
+
target: TargetSchema.optional(),
|
|
131
|
+
field: z.enum([
|
|
132
|
+
"text",
|
|
133
|
+
"value",
|
|
134
|
+
"url",
|
|
135
|
+
"title",
|
|
136
|
+
"checked"
|
|
137
|
+
]),
|
|
138
|
+
equals: z.union([z.string(), z.boolean()]).optional(),
|
|
139
|
+
includes: z.string().optional()
|
|
140
|
+
}).strict().superRefine((assertion, ctx) => {
|
|
141
|
+
if (assertion.equals === void 0 === (assertion.includes === void 0)) ctx.addIssue({
|
|
142
|
+
code: "custom",
|
|
143
|
+
message: "Specify exactly one comparison."
|
|
144
|
+
});
|
|
145
|
+
if (assertion.field === "checked" && typeof assertion.equals !== "boolean") ctx.addIssue({
|
|
146
|
+
code: "custom",
|
|
147
|
+
message: "Checked assertions require a boolean comparison."
|
|
148
|
+
});
|
|
149
|
+
if (assertion.field !== "checked" && typeof assertion.equals === "boolean") ctx.addIssue({
|
|
150
|
+
code: "custom",
|
|
151
|
+
message: "Text assertions require a string comparison."
|
|
152
|
+
});
|
|
153
|
+
if (!["url", "title"].includes(assertion.field) && !assertion.target) ctx.addIssue({
|
|
154
|
+
code: "custom",
|
|
155
|
+
message: "Element assertions require a target."
|
|
156
|
+
});
|
|
157
|
+
})).max(20).optional(),
|
|
158
|
+
outputs: z.record(z.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/), z.object({
|
|
159
|
+
target: TargetSchema.optional(),
|
|
160
|
+
field: z.enum([
|
|
161
|
+
"text",
|
|
162
|
+
"value",
|
|
163
|
+
"url",
|
|
164
|
+
"title",
|
|
165
|
+
"href"
|
|
166
|
+
])
|
|
167
|
+
}).strict().superRefine((output, ctx) => {
|
|
168
|
+
if (!["url", "title"].includes(output.field) && !output.target) ctx.addIssue({
|
|
169
|
+
code: "custom",
|
|
170
|
+
message: "Element outputs require a target."
|
|
171
|
+
});
|
|
172
|
+
})).optional()
|
|
119
173
|
}).strict().superRefine((definition, ctx) => {
|
|
120
174
|
if (new Set(definition.allowedDomains).size !== definition.allowedDomains.length) ctx.addIssue({
|
|
121
175
|
code: "custom",
|
|
122
176
|
path: ["allowedDomains"],
|
|
123
177
|
message: "Domains must be unique."
|
|
124
178
|
});
|
|
179
|
+
for (const spec of Object.values(definition.inputs)) if (spec.default !== void 0 && spec.choices && !spec.choices.includes(spec.default)) ctx.addIssue({
|
|
180
|
+
code: "custom",
|
|
181
|
+
message: "Default must be an allowed choice."
|
|
182
|
+
});
|
|
125
183
|
for (const [index, step] of definition.steps.entries()) {
|
|
126
184
|
const values = step.action === "navigate" ? [step.url] : step.action === "fill" || step.action === "select" ? [step.value] : step.action === "press" ? [step.key] : step.action === "wait" && step.value ? [step.value] : [];
|
|
127
185
|
for (const value of values) for (const match of value.matchAll(/\$\{input\.([a-zA-Z][a-zA-Z0-9_]*)\}/g)) if (!definition.inputs[match[1]]) ctx.addIssue({
|
|
@@ -130,6 +188,14 @@ const BrowserAutomationDefinitionSchema = z.object({
|
|
|
130
188
|
message: `Unknown input template: ${match[1]}.`
|
|
131
189
|
});
|
|
132
190
|
}
|
|
191
|
+
for (const [index, assertion] of (definition.successCriteria ?? []).entries()) for (const value of [assertion.equals, assertion.includes]) {
|
|
192
|
+
if (typeof value !== "string") continue;
|
|
193
|
+
for (const match of value.matchAll(/\$\{input\.([a-zA-Z][a-zA-Z0-9_]*)\}/g)) if (!definition.inputs[match[1]]) ctx.addIssue({
|
|
194
|
+
code: "custom",
|
|
195
|
+
path: ["successCriteria", index],
|
|
196
|
+
message: `Unknown input template: ${match[1]}.`
|
|
197
|
+
});
|
|
198
|
+
}
|
|
133
199
|
});
|
|
134
200
|
//#endregion
|
|
135
201
|
export { BrowserAutomationDefinitionSchema };
|
|
@@ -4,10 +4,12 @@ export type BrowserAutomationExecutor = (input: {
|
|
|
4
4
|
inputs: Record<string, unknown>;
|
|
5
5
|
signal: AbortSignal;
|
|
6
6
|
onStep: (event: unknown) => void;
|
|
7
|
+
runId: string;
|
|
7
8
|
}) => Promise<{
|
|
8
9
|
ok: boolean;
|
|
9
10
|
result?: unknown;
|
|
10
11
|
error?: string;
|
|
12
|
+
businessOutcome?: BrowserAutomationRun['businessOutcome'];
|
|
11
13
|
}>;
|
|
12
14
|
export declare class BrowserAutomationService {
|
|
13
15
|
private readonly executor;
|
|
@@ -18,6 +20,7 @@ export declare class BrowserAutomationService {
|
|
|
18
20
|
constructor(executor: BrowserAutomationExecutor, emit?: (type: string, payload: unknown) => void);
|
|
19
21
|
list(): BrowserAutomation[];
|
|
20
22
|
get(id: string): BrowserAutomation;
|
|
23
|
+
versions(id: string): BrowserAutomation[];
|
|
21
24
|
listRuns(automationId?: string): BrowserAutomationRun[];
|
|
22
25
|
getRun(id: string): BrowserAutomationRun;
|
|
23
26
|
listRunEvents(id: string): import("./types.js").BrowserAutomationRunEvent[];
|
|
@@ -25,7 +28,7 @@ export declare class BrowserAutomationService {
|
|
|
25
28
|
id: string;
|
|
26
29
|
name: string;
|
|
27
30
|
allowedDomains: string[];
|
|
28
|
-
risk: "read" | "draft" | "destructive" | "
|
|
31
|
+
risk: "read" | "draft" | "destructive" | "sensitive" | "external_effect";
|
|
29
32
|
inputs: Record<string, {
|
|
30
33
|
type: "string" | "number" | "boolean";
|
|
31
34
|
required?: boolean;
|
|
@@ -49,6 +52,11 @@ export declare class BrowserAutomationService {
|
|
|
49
52
|
role: string;
|
|
50
53
|
name?: string;
|
|
51
54
|
nameIncludes?: string;
|
|
55
|
+
testId?: string;
|
|
56
|
+
scope?: {
|
|
57
|
+
role: string;
|
|
58
|
+
name: string;
|
|
59
|
+
};
|
|
52
60
|
};
|
|
53
61
|
expect?: {
|
|
54
62
|
urlIncludes?: string;
|
|
@@ -63,6 +71,11 @@ export declare class BrowserAutomationService {
|
|
|
63
71
|
role: string;
|
|
64
72
|
name?: string;
|
|
65
73
|
nameIncludes?: string;
|
|
74
|
+
testId?: string;
|
|
75
|
+
scope?: {
|
|
76
|
+
role: string;
|
|
77
|
+
name: string;
|
|
78
|
+
};
|
|
66
79
|
};
|
|
67
80
|
value: string;
|
|
68
81
|
submit?: boolean;
|
|
@@ -79,6 +92,11 @@ export declare class BrowserAutomationService {
|
|
|
79
92
|
role: string;
|
|
80
93
|
name?: string;
|
|
81
94
|
nameIncludes?: string;
|
|
95
|
+
testId?: string;
|
|
96
|
+
scope?: {
|
|
97
|
+
role: string;
|
|
98
|
+
name: string;
|
|
99
|
+
};
|
|
82
100
|
};
|
|
83
101
|
value: string;
|
|
84
102
|
expect?: {
|
|
@@ -88,6 +106,19 @@ export declare class BrowserAutomationService {
|
|
|
88
106
|
ref?: string;
|
|
89
107
|
state?: "hidden" | "visible";
|
|
90
108
|
};
|
|
109
|
+
} | {
|
|
110
|
+
action: "check";
|
|
111
|
+
target: {
|
|
112
|
+
role: string;
|
|
113
|
+
name?: string;
|
|
114
|
+
nameIncludes?: string;
|
|
115
|
+
testId?: string;
|
|
116
|
+
scope?: {
|
|
117
|
+
role: string;
|
|
118
|
+
name: string;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
checked: boolean;
|
|
91
122
|
} | {
|
|
92
123
|
action: "press";
|
|
93
124
|
key: string;
|
|
@@ -95,6 +126,11 @@ export declare class BrowserAutomationService {
|
|
|
95
126
|
role: string;
|
|
96
127
|
name?: string;
|
|
97
128
|
nameIncludes?: string;
|
|
129
|
+
testId?: string;
|
|
130
|
+
scope?: {
|
|
131
|
+
role: string;
|
|
132
|
+
name: string;
|
|
133
|
+
};
|
|
98
134
|
};
|
|
99
135
|
expect?: {
|
|
100
136
|
urlIncludes?: string;
|
|
@@ -110,6 +146,11 @@ export declare class BrowserAutomationService {
|
|
|
110
146
|
role: string;
|
|
111
147
|
name?: string;
|
|
112
148
|
nameIncludes?: string;
|
|
149
|
+
testId?: string;
|
|
150
|
+
scope?: {
|
|
151
|
+
role: string;
|
|
152
|
+
name: string;
|
|
153
|
+
};
|
|
113
154
|
};
|
|
114
155
|
expect?: {
|
|
115
156
|
urlIncludes?: string;
|
|
@@ -126,15 +167,49 @@ export declare class BrowserAutomationService {
|
|
|
126
167
|
role: string;
|
|
127
168
|
name?: string;
|
|
128
169
|
nameIncludes?: string;
|
|
170
|
+
testId?: string;
|
|
171
|
+
scope?: {
|
|
172
|
+
role: string;
|
|
173
|
+
name: string;
|
|
174
|
+
};
|
|
129
175
|
};
|
|
130
176
|
timeoutMs?: number;
|
|
131
177
|
})[];
|
|
132
178
|
description?: string;
|
|
179
|
+
successCriteria?: {
|
|
180
|
+
field: "value" | "text" | "title" | "url" | "checked";
|
|
181
|
+
target?: {
|
|
182
|
+
role: string;
|
|
183
|
+
name?: string;
|
|
184
|
+
nameIncludes?: string;
|
|
185
|
+
testId?: string;
|
|
186
|
+
scope?: {
|
|
187
|
+
role: string;
|
|
188
|
+
name: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
equals?: string | boolean;
|
|
192
|
+
includes?: string;
|
|
193
|
+
}[];
|
|
194
|
+
outputs?: Record<string, {
|
|
195
|
+
field: "value" | "text" | "title" | "url" | "href";
|
|
196
|
+
target?: {
|
|
197
|
+
role: string;
|
|
198
|
+
name?: string;
|
|
199
|
+
nameIncludes?: string;
|
|
200
|
+
testId?: string;
|
|
201
|
+
scope?: {
|
|
202
|
+
role: string;
|
|
203
|
+
name: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
}>;
|
|
133
207
|
}>;
|
|
134
208
|
save(input: {
|
|
135
209
|
definition: unknown;
|
|
136
210
|
status?: BrowserAutomationStatus;
|
|
137
211
|
expectedId?: string;
|
|
212
|
+
expectedRevision?: number;
|
|
138
213
|
}): BrowserAutomation;
|
|
139
214
|
remove(id: string): boolean;
|
|
140
215
|
startRun(automationId: string, inputs: Record<string, unknown>, context?: BrowserAutomationExecutionContext): BrowserAutomationRun;
|
|
@@ -145,6 +220,8 @@ export declare class BrowserAutomationService {
|
|
|
145
220
|
private execute;
|
|
146
221
|
}
|
|
147
222
|
export interface BrowserAutomationExecutionContext {
|
|
223
|
+
revision?: number;
|
|
224
|
+
clientRequestId?: string;
|
|
148
225
|
triggerEvent?: {
|
|
149
226
|
type: string;
|
|
150
227
|
source?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BrowserAutomationDefinitionSchema } from "./schema.js";
|
|
2
2
|
import { resolveBrowserAutomationInputs } from "./runner.js";
|
|
3
|
-
import { appendBrowserAutomationRunEvent, deleteBrowserAutomation, getBrowserAutomation, getBrowserAutomationRun, hasActiveBrowserAutomationRuns, listActiveBrowserAutomationRuns, listBrowserAutomationRunEvents, listBrowserAutomationRuns, listBrowserAutomations, nextBrowserAutomationRunEventSeq, saveBrowserAutomation, saveBrowserAutomationRun } from "./repository.js";
|
|
3
|
+
import { appendBrowserAutomationRunEvent, deleteBrowserAutomation, findBrowserAutomationRunByRequest, getBrowserAutomation, getBrowserAutomationRun, getBrowserAutomationVersion, hasActiveBrowserAutomationRuns, listActiveBrowserAutomationRuns, listBrowserAutomationRunEvents, listBrowserAutomationRuns, listBrowserAutomationVersions, listBrowserAutomations, nextBrowserAutomationRunEventSeq, saveBrowserAutomation, saveBrowserAutomationRun, verifyBrowserAutomationRun } from "./repository.js";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
//#region src/browser/automations/service.ts
|
|
6
6
|
var BrowserAutomationService = class {
|
|
@@ -15,7 +15,8 @@ var BrowserAutomationService = class {
|
|
|
15
15
|
saveBrowserAutomationRun({
|
|
16
16
|
...run,
|
|
17
17
|
status: "failed",
|
|
18
|
-
|
|
18
|
+
businessOutcome: "unknown",
|
|
19
|
+
error: "Gateway stopped before the run completed. Check the business result before running again.",
|
|
19
20
|
endedAtMs,
|
|
20
21
|
durationMs: run.startedAtMs ? endedAtMs - run.startedAtMs : void 0
|
|
21
22
|
});
|
|
@@ -27,6 +28,9 @@ var BrowserAutomationService = class {
|
|
|
27
28
|
get(id) {
|
|
28
29
|
return getBrowserAutomation(id);
|
|
29
30
|
}
|
|
31
|
+
versions(id) {
|
|
32
|
+
return listBrowserAutomationVersions(id);
|
|
33
|
+
}
|
|
30
34
|
listRuns(automationId) {
|
|
31
35
|
return listBrowserAutomationRuns(automationId);
|
|
32
36
|
}
|
|
@@ -43,10 +47,13 @@ var BrowserAutomationService = class {
|
|
|
43
47
|
const parsed = BrowserAutomationDefinitionSchema.parse(input.definition);
|
|
44
48
|
if (input.expectedId && parsed.id !== input.expectedId) throw new Error("Browser automation id cannot change.");
|
|
45
49
|
const existing = getBrowserAutomation(parsed.id);
|
|
50
|
+
if (input.expectedRevision !== void 0 && existing?.revision !== input.expectedRevision) throw new Error("Browser automation revision changed. Reload before saving.");
|
|
51
|
+
const changed = !existing || canonical(existing.definition) !== canonical(parsed);
|
|
46
52
|
const now = Date.now();
|
|
47
53
|
const automation = {
|
|
48
54
|
id: parsed.id,
|
|
49
|
-
|
|
55
|
+
verified: !changed && !!existing?.verified,
|
|
56
|
+
revision: (existing?.revision ?? 0) + (changed ? 1 : 0),
|
|
50
57
|
status: input.status ?? existing?.status ?? "enabled",
|
|
51
58
|
definition: parsed,
|
|
52
59
|
createdAtMs: existing?.createdAtMs ?? now,
|
|
@@ -60,12 +67,22 @@ var BrowserAutomationService = class {
|
|
|
60
67
|
return deleteBrowserAutomation(id);
|
|
61
68
|
}
|
|
62
69
|
startRun(automationId, inputs, context) {
|
|
63
|
-
const
|
|
70
|
+
const requestId = context?.clientRequestId;
|
|
71
|
+
if (requestId) {
|
|
72
|
+
const previous = findBrowserAutomationRunByRequest(requestId);
|
|
73
|
+
if (previous) {
|
|
74
|
+
const contextualInputs = mergeBrowserAutomationTriggerInputs(previous.definition, inputs, context);
|
|
75
|
+
if (previous.automationId !== automationId || context?.revision !== void 0 && context.revision !== previous.automationRevision || canonical(previous.inputs) !== canonical(resolveBrowserAutomationInputs(previous.definition, contextualInputs))) throw new Error("Run request id was reused with a different automation, revision or inputs.");
|
|
76
|
+
return previous;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const automation = context?.revision !== void 0 ? getBrowserAutomationVersion(automationId, context.revision) : getBrowserAutomation(automationId);
|
|
64
80
|
if (!automation) throw new Error("Browser automation not found.");
|
|
65
81
|
if (automation.status !== "enabled") throw new Error("Browser automation is disabled.");
|
|
66
82
|
const contextualInputs = mergeBrowserAutomationTriggerInputs(automation.definition, inputs, context);
|
|
67
83
|
const resolvedInputs = resolveBrowserAutomationInputs(automation.definition, contextualInputs);
|
|
68
84
|
const run = {
|
|
85
|
+
clientRequestId: requestId,
|
|
69
86
|
id: randomUUID(),
|
|
70
87
|
automationId,
|
|
71
88
|
automationRevision: automation.revision,
|
|
@@ -93,6 +110,8 @@ var BrowserAutomationService = class {
|
|
|
93
110
|
}
|
|
94
111
|
async runAndWait(automationId, inputs, signal, context) {
|
|
95
112
|
const run = this.startRun(automationId, inputs, context);
|
|
113
|
+
const terminal = this.getRun(run.id);
|
|
114
|
+
if (terminal && !["queued", "running"].includes(terminal.status)) return terminal;
|
|
96
115
|
return new Promise((resolve) => {
|
|
97
116
|
const complete = (value) => {
|
|
98
117
|
signal?.removeEventListener("abort", onAbort);
|
|
@@ -131,6 +150,7 @@ var BrowserAutomationService = class {
|
|
|
131
150
|
this.addEvent(run.id, "run.started");
|
|
132
151
|
try {
|
|
133
152
|
const outcome = await this.executor({
|
|
153
|
+
runId: run.id,
|
|
134
154
|
definition: run.definition,
|
|
135
155
|
inputs: run.inputs,
|
|
136
156
|
signal: controller.signal,
|
|
@@ -142,6 +162,13 @@ var BrowserAutomationService = class {
|
|
|
142
162
|
status: controller.signal.aborted ? "cancelled" : outcome.ok ? "succeeded" : "failed",
|
|
143
163
|
result: outcome.result,
|
|
144
164
|
error: outcome.error,
|
|
165
|
+
businessOutcome: outcome.businessOutcome ?? (!outcome.ok && run.definition.steps.some((step) => [
|
|
166
|
+
"click",
|
|
167
|
+
"press",
|
|
168
|
+
"fill",
|
|
169
|
+
"select",
|
|
170
|
+
"check"
|
|
171
|
+
].includes(step.action)) ? "unknown" : "completed"),
|
|
145
172
|
endedAtMs,
|
|
146
173
|
durationMs: endedAtMs - startedAtMs
|
|
147
174
|
};
|
|
@@ -150,12 +177,14 @@ var BrowserAutomationService = class {
|
|
|
150
177
|
current = {
|
|
151
178
|
...current,
|
|
152
179
|
status: controller.signal.aborted ? "cancelled" : "failed",
|
|
180
|
+
businessOutcome: "unknown",
|
|
153
181
|
error: error instanceof Error ? error.message : String(error),
|
|
154
182
|
endedAtMs,
|
|
155
183
|
durationMs: endedAtMs - startedAtMs
|
|
156
184
|
};
|
|
157
185
|
}
|
|
158
186
|
saveBrowserAutomationRun(current);
|
|
187
|
+
verifyBrowserAutomationRun(current);
|
|
159
188
|
this.addEvent(run.id, "run.completed", {
|
|
160
189
|
status: current.status,
|
|
161
190
|
error: current.error
|
|
@@ -178,5 +207,8 @@ function mergeBrowserAutomationTriggerInputs(definition, inputs, context) {
|
|
|
178
207
|
for (const name of Object.keys(definition.inputs)) if (merged[name] === void 0 && candidates[name] !== void 0) merged[name] = candidates[name];
|
|
179
208
|
return merged;
|
|
180
209
|
}
|
|
210
|
+
function canonical(value) {
|
|
211
|
+
return JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).sort(([a], [b]) => a.localeCompare(b))) : item);
|
|
212
|
+
}
|
|
181
213
|
//#endregion
|
|
182
214
|
export { BrowserAutomationService, mergeBrowserAutomationTriggerInputs };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { BrowserExpectation, BrowserRiskLevel } from '@xopcai/browser-control-contract';
|
|
2
|
+
import type { BrowserSemanticTarget } from '@xopcai/browser-control-contract';
|
|
3
|
+
export type { BrowserSemanticTarget } from '@xopcai/browser-control-contract';
|
|
2
4
|
export type BrowserAutomationStatus = 'enabled' | 'disabled';
|
|
3
5
|
export type BrowserAutomationRunStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
4
6
|
export interface BrowserAutomationInputDefinition {
|
|
@@ -8,10 +10,11 @@ export interface BrowserAutomationInputDefinition {
|
|
|
8
10
|
description?: string;
|
|
9
11
|
choices?: Array<string | number | boolean>;
|
|
10
12
|
}
|
|
11
|
-
export interface
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
export interface BrowserAutomationAssertion {
|
|
14
|
+
target?: BrowserSemanticTarget;
|
|
15
|
+
field: 'text' | 'value' | 'url' | 'title' | 'checked';
|
|
16
|
+
equals?: string | boolean;
|
|
17
|
+
includes?: string;
|
|
15
18
|
}
|
|
16
19
|
export type BrowserAutomationStep = {
|
|
17
20
|
action: 'navigate';
|
|
@@ -32,6 +35,10 @@ export type BrowserAutomationStep = {
|
|
|
32
35
|
target: BrowserSemanticTarget;
|
|
33
36
|
value: string;
|
|
34
37
|
expect?: BrowserExpectation;
|
|
38
|
+
} | {
|
|
39
|
+
action: 'check';
|
|
40
|
+
target: BrowserSemanticTarget;
|
|
41
|
+
checked: boolean;
|
|
35
42
|
} | {
|
|
36
43
|
action: 'press';
|
|
37
44
|
target?: BrowserSemanticTarget;
|
|
@@ -57,10 +64,16 @@ export interface BrowserAutomationDefinition {
|
|
|
57
64
|
risk: BrowserRiskLevel;
|
|
58
65
|
inputs: Record<string, BrowserAutomationInputDefinition>;
|
|
59
66
|
steps: BrowserAutomationStep[];
|
|
67
|
+
successCriteria?: BrowserAutomationAssertion[];
|
|
68
|
+
outputs?: Record<string, {
|
|
69
|
+
target?: BrowserSemanticTarget;
|
|
70
|
+
field: 'text' | 'value' | 'url' | 'title' | 'href';
|
|
71
|
+
}>;
|
|
60
72
|
}
|
|
61
73
|
export interface BrowserAutomation {
|
|
62
74
|
id: string;
|
|
63
75
|
revision: number;
|
|
76
|
+
verified: boolean;
|
|
64
77
|
status: BrowserAutomationStatus;
|
|
65
78
|
definition: BrowserAutomationDefinition;
|
|
66
79
|
createdAtMs: number;
|
|
@@ -70,6 +83,8 @@ export interface BrowserAutomationRun {
|
|
|
70
83
|
id: string;
|
|
71
84
|
automationId: string;
|
|
72
85
|
automationRevision: number;
|
|
86
|
+
clientRequestId?: string;
|
|
87
|
+
businessOutcome?: 'completed' | 'verified' | 'unknown';
|
|
73
88
|
definition: BrowserAutomationDefinition;
|
|
74
89
|
status: BrowserAutomationRunStatus;
|
|
75
90
|
inputs: Record<string, unknown>;
|
|
@@ -3,7 +3,7 @@ import type { BrowserDriver, BrowserPrimitiveInput } from './browser-driver.js';
|
|
|
3
3
|
type ExtensionProvider = {
|
|
4
4
|
start(): Promise<void>;
|
|
5
5
|
waitForConnection(timeoutMs?: number): Promise<void>;
|
|
6
|
-
send(input: import('@xopcai/browser-control-contract').BrowserActionInput, timeoutMs?: number, visualFallback?: boolean): Promise<import('@xopcai/browser-control-contract').BrowserWireResult>;
|
|
6
|
+
send(input: import('@xopcai/browser-control-contract').BrowserActionInput, timeoutMs?: number, visualFallback?: boolean, signal?: AbortSignal): Promise<import('@xopcai/browser-control-contract').BrowserWireResult>;
|
|
7
7
|
};
|
|
8
8
|
export declare class ExtensionDriver implements BrowserDriver {
|
|
9
9
|
private readonly provider;
|
|
@@ -16,10 +16,10 @@ export declare class ExtensionDriver implements BrowserDriver {
|
|
|
16
16
|
disconnect(): Promise<void>;
|
|
17
17
|
createSession(_sessionId: string): Promise<void>;
|
|
18
18
|
closeSession(sessionId: string): Promise<void>;
|
|
19
|
-
navigate(sessionId: string, input: BrowserNavigateInput): Promise<BrowserControlResult>;
|
|
20
|
-
observe(sessionId: string, input: BrowserObserveInput): Promise<BrowserObservation>;
|
|
21
|
-
perform(sessionId: string, input: BrowserPrimitiveInput): Promise<BrowserControlResult>;
|
|
22
|
-
tabs(sessionId: string, input: BrowserTabsInput): Promise<BrowserControlResult>;
|
|
19
|
+
navigate(sessionId: string, input: BrowserNavigateInput, signal?: AbortSignal): Promise<BrowserControlResult>;
|
|
20
|
+
observe(sessionId: string, input: BrowserObserveInput, signal?: AbortSignal): Promise<BrowserObservation>;
|
|
21
|
+
perform(sessionId: string, input: BrowserPrimitiveInput, signal?: AbortSignal): Promise<BrowserControlResult>;
|
|
22
|
+
tabs(sessionId: string, input: BrowserTabsInput, signal?: AbortSignal): Promise<BrowserControlResult>;
|
|
23
23
|
private send;
|
|
24
24
|
}
|
|
25
25
|
export {};
|
|
@@ -23,36 +23,36 @@ var ExtensionDriver = class {
|
|
|
23
23
|
sessionId
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
navigate(sessionId, input) {
|
|
26
|
+
navigate(sessionId, input, signal) {
|
|
27
27
|
return this.send({
|
|
28
28
|
...input,
|
|
29
29
|
sessionId
|
|
30
|
-
});
|
|
30
|
+
}, signal);
|
|
31
31
|
}
|
|
32
|
-
async observe(sessionId, input) {
|
|
32
|
+
async observe(sessionId, input, signal) {
|
|
33
33
|
const result = await this.send({
|
|
34
34
|
...input,
|
|
35
35
|
sessionId
|
|
36
|
-
});
|
|
36
|
+
}, signal);
|
|
37
37
|
if ("error" in result) throw new Error(result.error.message);
|
|
38
38
|
const observation = result.receipt.observation;
|
|
39
39
|
if (!observation) throw new Error("Extension returned no browser observation");
|
|
40
40
|
return observation;
|
|
41
41
|
}
|
|
42
|
-
perform(sessionId, input) {
|
|
42
|
+
perform(sessionId, input, signal) {
|
|
43
43
|
return this.send({
|
|
44
44
|
...input,
|
|
45
45
|
sessionId
|
|
46
|
-
});
|
|
46
|
+
}, signal);
|
|
47
47
|
}
|
|
48
|
-
tabs(sessionId, input) {
|
|
48
|
+
tabs(sessionId, input, signal) {
|
|
49
49
|
return this.send({
|
|
50
50
|
...input,
|
|
51
51
|
sessionId
|
|
52
|
-
});
|
|
52
|
+
}, signal);
|
|
53
53
|
}
|
|
54
|
-
async send(input) {
|
|
55
|
-
return (await this.provider.send(input, this.timeoutMs, this.visualFallback)).result;
|
|
54
|
+
async send(input, signal) {
|
|
55
|
+
return (await this.provider.send(input, this.timeoutMs, this.visualFallback, signal)).result;
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
//#endregion
|