@xopcai/xopc 0.0.161 → 0.0.163
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 +4 -2
- package/README.zh-CN.md +4 -2
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-o7GRljfD.js → activity-store-Xj95LzTv.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-9R3szLMc.js → agent-avatar-dicebear-C-QeUFwU.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DVKlWKJE.js +2 -0
- package/dist/gateway/static/root/assets/{api-jSTqFMq9.js → api-BTLmAm1_.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-D81cyE76.js → app-management-settings-panel-zc6Gf-S5.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Ct6bZQCV.js → appearance-settings-0fMLnOWn.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BZXEJDIV.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-CfD7AZKn.js → archive-plugin-DOiR_E21.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CP_Gaxt3.js → attachment-load-BxmYl1D1.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-BGKM_NDZ.js → automation-suggestion-card-BhZOirad.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-B8CnkoXv.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-IPr2EVnS.js → binary-plugins-DTTKsvgk.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B6aHEGA6.js → block-editor-C7se7iqg.js} +46 -46
- package/dist/gateway/static/root/assets/browser-settings-page-BCPWKI9V.js +8 -0
- package/dist/gateway/static/root/assets/browser-workflow-inputs-kxmStCcv.js +1 -0
- package/dist/gateway/static/root/assets/browser-workflows-page-CwYf9OM_.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C7lr_mX2.js +2 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-CCX9-LjU.js → capability-presets-api-BZKh2cWX.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Ble9kHRu.js +2 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-MmLMLDWf.js → channel-recipient-api-r7tdbnJE.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CtQQQHrv.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-_VirfMKW.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-BbjzIs87.js → connector-logo-BpnQYAxA.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-BXWJSJeY.js +2 -0
- package/dist/gateway/static/root/assets/{desktop-pet-CYH5ZSXy.js → desktop-pet-B86W4a5c.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DQLqGLc0.js → desktop-pet-settings-uv8Grtgk.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-ClsiXhmz.js → directory-picker-path-field-C4TTvf7p.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-CjMPPdzg.js → dreaming-settings-CzJAUPvM.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-57eizjhB.js → extension-debug-page-Ci2mOYUt.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CsbSb3u1.js → extension-page-DeXdmhXQ.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-C93vaOsU.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-DIPJuzBZ.js → gateway-config-api-C31Hlblp.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CDLqAQY7.js → gateway-settings-D3zS6RZh.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DrfSJtvT.js → gateway-startup-retry-CSRvCqxh.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-CWp2b7__.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-Dtm29FxD.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-lGC10UkU.js → goals-config-api-D4wYNRrf.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-jMzBJs6e.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-BWq0pdrA.js → goals-settings-Bx2jVvhQ.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-D4o8BJVv.js → heartbeat-settings-BEIF1eXy.js} +1 -1
- package/dist/gateway/static/root/assets/index-BXtJvaQl.css +1 -0
- package/dist/gateway/static/root/assets/index-HZdBKfk_.js +199 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-6T2QYehS.js → keyboard-shortcuts-settings-DOEDpvTM.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CseW9jD3.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DCjg2K9f.js → local-apps-page-B0OpGpxv.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Dar-xqQr.js → locale-store-Ys6RP7Be.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DVqPbth5.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-rt1XO43g.js → markdown-split-CEZwysCH.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Bwo8CJuh.js → media-plugins-CpGKE7B0.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BzI9Wx30.js +5 -0
- package/dist/gateway/static/root/assets/{notes-page-Dp-pkX7d.js → notes-page-CdiuDZ5a.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-mrc3xtpn.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-CzZ4iKOb.js → page-tabs-BkH5AVV2.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-3E_Qa-58.js → preview-open-alternatives-CQai8f9D.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-B2T48Sbt.js → product-open-page-B2kSdB2b.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CfhPJLkH.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BfMoKjdm.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-CrDtcsZ9.js +1 -0
- package/dist/gateway/static/root/assets/save-bar-controls-NGYnO7n7.js +1 -0
- package/dist/gateway/static/root/assets/schedule-field-nLOphnv3.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-DC-iU5IG.js → schema-form-D0e90ndE.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-D3DbF3dV.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BZp0O2dH.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CNqF6IwY.js → settings-form-section-X2Sl-EAk.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DkvwitK_.js → settings-loading-skeleton-DOnUabm7.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-C4UUNi1n.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-layout-DWvNgISx.js → settings-page-layout-C1yYqbT6.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-84iao4DZ.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DGpSPW-n.js → share-preview-page-Cfy_pH7V.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DtcwQvRG.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-L7j5Gc8Z.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-1Ps8PjsP.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-8TxxSbUw.js → system-settings-panel-Da81RJ6G.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-B5FzMWOx.js → theme-store-DflSp9o4.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-BIkOW-2L.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-DEGtSA5h.js → typed-models-lib--HptwFcD.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-BDU6FneG.js → use-channel-catalog-CMHY4ZfW.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-BYAAs2iW.js +1 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-nvIZerol.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-J35JkJ7_.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-C4wYDYqV.js +1 -0
- package/dist/gateway/static/root/assets/work-page-DMvitV6c.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Cwi8Pz7n.js → workflow-run-setup-panel-D96MHABy.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-JMN0nMbM.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +1 -0
- package/dist/src/agent/client-error-format.d.ts +1 -1
- package/dist/src/agent/client-error-format.js +9 -5
- package/dist/src/agent/embedded/run-for-session.js +38 -31
- package/dist/src/agent/embedded/session-runner.d.ts +1 -0
- package/dist/src/agent/embedded/session-runner.js +12 -4
- package/dist/src/agent/failover-error.d.ts +1 -1
- package/dist/src/agent/image/generation/openai-compatible-image-provider.d.ts +2 -6
- package/dist/src/agent/image/generation/openai-compatible-image-provider.js +1 -3
- package/dist/src/agent/image/generation/provider-registry.d.ts +5 -46
- package/dist/src/agent/image/generation/provider-registry.js +24 -73
- package/dist/{extensions/dashscope/src/image-generation-provider.d.ts → src/agent/image/generation/providers/dashscope.d.ts} +3 -6
- package/dist/{extensions/dashscope/src/image-generation-provider.js → src/agent/image/generation/providers/dashscope.js} +36 -59
- package/dist/{extensions/fal/src/image-generation-provider.d.ts → src/agent/image/generation/providers/fal.d.ts} +1 -1
- package/dist/{extensions/fal/src/image-generation-provider.js → src/agent/image/generation/providers/fal.js} +19 -29
- package/dist/{extensions/google/src/image-generation-provider.d.ts → src/agent/image/generation/providers/google.d.ts} +2 -2
- package/dist/{extensions/google/src/image-generation-provider.js → src/agent/image/generation/providers/google.js} +23 -30
- package/dist/{extensions/minimax/src/image-generation-provider.d.ts → src/agent/image/generation/providers/minimax.d.ts} +2 -5
- package/dist/{extensions/minimax/src/image-generation-provider.js → src/agent/image/generation/providers/minimax.js} +35 -51
- package/dist/{extensions/openai/src/image-generation-provider.d.ts → src/agent/image/generation/providers/openai.d.ts} +2 -2
- package/dist/{extensions/openai/src/image-generation-provider.js → src/agent/image/generation/providers/openai.js} +13 -38
- package/dist/src/agent/image/generation/runtime-types.d.ts +1 -0
- package/dist/src/agent/image/generation/runtime.d.ts +1 -3
- package/dist/src/agent/image/generation/runtime.js +6 -6
- package/dist/src/agent/image/generation/types.d.ts +23 -3
- package/dist/src/agent/image/index.d.ts +1 -1
- package/dist/src/agent/image/index.js +2 -2
- package/dist/src/agent/media-generation/runtime-shared.d.ts +2 -0
- package/dist/src/agent/media-generation/runtime-shared.js +1 -0
- package/dist/src/agent/outcomes/task-evaluation.d.ts +20 -0
- package/dist/src/agent/outcomes/task-evaluation.js +48 -0
- package/dist/src/agent/outcomes/task-verifier.d.ts +29 -0
- package/dist/src/agent/outcomes/task-verifier.js +71 -0
- package/dist/src/agent/prompt/memory/index.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +32 -1
- package/dist/src/agent/service.js +1 -0
- package/dist/src/agent/service.types.d.ts +1 -0
- package/dist/src/agent/tools/browser/tool/browser-use-tool.d.ts +1 -7
- package/dist/src/agent/tools/browser/tool/browser-use-tool.js +2 -73
- package/dist/src/agent/tools/browser/tool/schemas.d.ts +1 -13
- package/dist/src/agent/tools/browser/tool/schemas.js +1 -9
- package/dist/src/agent/tools/browser-recipe-tool.d.ts +12 -0
- package/dist/src/agent/tools/browser-recipe-tool.js +113 -0
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +6 -1
- package/dist/src/agent/tools/image-generate-tool.d.ts +2 -0
- package/dist/src/agent/tools/image-generate-tool.js +14 -7
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/auth/sync-provider-auth.d.ts +3 -0
- package/dist/src/auth/sync-provider-auth.js +12 -1
- package/dist/src/automations/domain/types.d.ts +13 -0
- package/dist/src/automations/domain/validation.d.ts +44 -24
- package/dist/src/automations/domain/validation.js +27 -18
- package/dist/src/automations/draft/automation-draft-validator.d.ts +6 -1
- package/dist/src/automations/draft/automation-draft-validator.js +1 -0
- package/dist/src/automations/service/action-executor.d.ts +1 -0
- package/dist/src/automations/service/action-executor.js +22 -0
- package/dist/src/browser/index.d.ts +0 -1
- package/dist/src/browser/index.js +1 -2
- package/dist/src/browser/pipeline/runner.d.ts +9 -2
- package/dist/src/browser/pipeline/runner.js +151 -105
- package/dist/src/browser/pipeline/schema.d.ts +21 -15
- package/dist/src/browser/pipeline/schema.js +93 -99
- package/dist/src/browser/recipes/index.d.ts +3 -0
- package/dist/src/browser/recipes/index.js +3 -0
- package/dist/src/browser/recipes/repository.d.ts +13 -0
- package/dist/src/browser/recipes/repository.js +81 -0
- package/dist/src/browser/recipes/runtime-service.d.ts +6 -0
- package/dist/src/browser/recipes/runtime-service.js +30 -0
- package/dist/src/browser/recipes/service.d.ts +36 -0
- package/dist/src/browser/recipes/service.js +186 -0
- package/dist/src/browser/recipes/types.d.ts +36 -0
- package/dist/src/cli/commands/browser-cli-helpers.js +6 -12
- package/dist/src/cli/commands/browser.js +4 -3
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/models.js +2 -5
- package/dist/src/cli/commands/onboard/model.js +3 -2
- package/dist/src/cli/commands/setup-shared/types.d.ts +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/models-json.d.ts +6 -0
- package/dist/src/config/models-json.js +2 -6
- package/dist/src/config/schema.d.ts +29 -18
- package/dist/src/config/schema.js +44 -33
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +12 -6
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -1
- package/dist/src/gateway/hono/lib/safe-providers-config.d.ts +0 -3
- package/dist/src/gateway/hono/lib/safe-providers-config.js +1 -3
- package/dist/src/gateway/hono/middleware/strict-rate-limit.d.ts +4 -0
- package/dist/src/gateway/hono/middleware/strict-rate-limit.js +8 -1
- package/dist/src/gateway/hono/routes/browser-workflows.d.ts +3 -0
- package/dist/src/gateway/hono/routes/browser-workflows.js +78 -0
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -11
- package/dist/src/gateway/hono/routes/deps.d.ts +1 -0
- package/dist/src/gateway/hono/routes/home.js +1 -0
- package/dist/src/gateway/hono/routes/index.js +4 -0
- package/dist/src/gateway/hono/routes/interaction-state.d.ts +3 -0
- package/dist/src/gateway/hono/routes/interaction-state.js +45 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +17 -2
- package/dist/src/gateway/hono/routes/memory.js +33 -4
- package/dist/src/gateway/hono/routes/models.js +151 -129
- package/dist/src/gateway/hono/routes/task-outcomes.d.ts +3 -0
- package/dist/src/gateway/hono/routes/task-outcomes.js +109 -0
- package/dist/src/gateway/hono/routes/you.d.ts +10 -2
- package/dist/src/gateway/hono/routes/you.js +184 -28
- package/dist/src/gateway/image-generation-setup.d.ts +40 -0
- package/dist/src/gateway/image-generation-setup.js +130 -0
- package/dist/src/gateway/rate-limit/buckets.d.ts +3 -0
- package/dist/src/gateway/rate-limit/buckets.js +12 -0
- package/dist/src/gateway/service/run-gateway-agent.js +84 -0
- package/dist/src/gateway/service.d.ts +6 -0
- package/dist/src/gateway/service.js +24 -0
- package/dist/src/media-shared/http/private-network.d.ts +1 -1
- package/dist/src/media-shared/http/private-network.js +1 -1
- package/dist/src/proactive/insight-repository.d.ts +2 -0
- package/dist/src/proactive/insight-repository.js +5 -2
- package/dist/src/proactive/run-processor.js +22 -1
- package/dist/src/proactive/types.d.ts +2 -0
- package/dist/src/proactive/value-score.d.ts +13 -0
- package/dist/src/proactive/value-score.js +30 -0
- package/dist/src/providers/auth-runtime/resolve-api-key.d.ts +2 -4
- package/dist/src/providers/auth-runtime/resolve-api-key.js +2 -4
- package/dist/src/providers/auth-runtime/resolve-auth.d.ts +3 -4
- package/dist/src/providers/auth-runtime/resolve-auth.js +18 -18
- package/dist/src/providers/domestic-presets.d.ts +22 -0
- package/dist/src/providers/domestic-presets.js +25 -0
- package/dist/src/providers/model-catalog-store.d.ts +71 -0
- package/dist/src/providers/model-catalog-store.js +102 -0
- package/dist/src/providers/model-catalog-sync-service.d.ts +41 -0
- package/dist/src/providers/model-catalog-sync-service.js +142 -0
- package/dist/src/providers/model-reference-auditor.d.ts +14 -0
- package/dist/src/providers/model-reference-auditor.js +71 -0
- package/dist/src/providers/model-registry.d.ts +4 -1
- package/dist/src/providers/model-registry.js +35 -2
- package/dist/src/providers/presentation.js +2 -0
- package/dist/src/providers/xopc-cloud-connection.d.ts +51 -0
- package/dist/src/providers/xopc-cloud-connection.js +196 -0
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/session-title.d.ts +2 -0
- package/dist/src/session/session-title.js +24 -3
- package/dist/src/share/share-types.js +5 -5
- package/dist/src/share/site-share-types.d.ts +1 -1
- package/dist/src/share/site-share-types.js +5 -5
- package/dist/src/storage/sqlite/index.d.ts +3 -0
- package/dist/src/storage/sqlite/index.js +4 -1
- package/dist/src/storage/sqlite/interaction-state-repository.d.ts +17 -0
- package/dist/src/storage/sqlite/interaction-state-repository.js +60 -0
- package/dist/src/storage/sqlite/memory-records-repository.js +1 -1
- package/dist/src/storage/sqlite/migrations/053_browser_recipes.sql +45 -0
- package/dist/src/storage/sqlite/migrations/054_task_outcomes.sql +24 -0
- package/dist/src/storage/sqlite/migrations/055_relationship_settings.sql +14 -0
- package/dist/src/storage/sqlite/migrations/056_task_verification.sql +6 -0
- package/dist/src/storage/sqlite/migrations/057_interaction_states.sql +11 -0
- package/dist/src/storage/sqlite/migrations/058_proactive_value.sql +3 -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/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/relationship-settings-repository.d.ts +17 -0
- package/dist/src/storage/sqlite/relationship-settings-repository.js +64 -0
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +46 -0
- package/dist/src/storage/sqlite/task-outcome-repository.d.ts +90 -0
- package/dist/src/storage/sqlite/task-outcome-repository.js +138 -0
- package/dist/src/user-context/interaction-state.d.ts +13 -0
- package/dist/src/user-context/interaction-state.js +69 -0
- package/dist/src/user-context/memory-use-audit.d.ts +10 -0
- package/dist/src/user-context/memory-use-audit.js +25 -0
- package/dist/src/user-context/personal-playbook.d.ts +11 -0
- package/dist/src/user-context/personal-playbook.js +41 -0
- package/dist/src/user-context/projection.d.ts +4 -0
- package/dist/src/user-context/projection.js +5 -1
- package/dist/src/user-context/relationship-continuity.d.ts +14 -0
- package/dist/src/user-context/relationship-continuity.js +51 -0
- package/package.json +5 -7
- package/dist/extensions/dashscope/src/index.d.ts +0 -4
- package/dist/extensions/dashscope/src/index.js +0 -2
- package/dist/extensions/dashscope/xopc.extension.json +0 -15
- package/dist/extensions/fal/src/index.d.ts +0 -4
- package/dist/extensions/fal/src/index.js +0 -2
- package/dist/extensions/fal/xopc.extension.json +0 -14
- package/dist/extensions/google/src/index.d.ts +0 -4
- package/dist/extensions/google/src/index.js +0 -2
- package/dist/extensions/google/xopc.extension.json +0 -14
- package/dist/extensions/minimax/src/index.d.ts +0 -4
- package/dist/extensions/minimax/src/index.js +0 -2
- package/dist/extensions/minimax/xopc.extension.json +0 -15
- package/dist/extensions/openai/src/index.d.ts +0 -4
- package/dist/extensions/openai/src/index.js +0 -2
- package/dist/extensions/openai/xopc.extension.json +0 -14
- package/dist/gateway/static/root/assets/action-boundary-settings-panel-BIVBUiNT.js +0 -1
- package/dist/gateway/static/root/assets/agents-_qbUaYbs.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-0sPqD0FK.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-BxWBuBsE.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-C499b9AH.js +0 -8
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Dva9SiPK.js +0 -2
- package/dist/gateway/static/root/assets/channels-settings-DNAU7u9o.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-CIOH7tgn.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-TwiBp8vY.js +0 -2
- package/dist/gateway/static/root/assets/extension-settings-page-DKA9-lyP.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-Q3B0E-0s.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-C5VAK04G.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-BJb-5IYw.js +0 -2
- package/dist/gateway/static/root/assets/index-CkUHH170.css +0 -1
- package/dist/gateway/static/root/assets/index-vq_cJZJC.js +0 -199
- package/dist/gateway/static/root/assets/local-app-workbench-page-euH17Kvb.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-CyYCBqym.js +0 -7
- package/dist/gateway/static/root/assets/messages-CxySDn9d.js +0 -5
- package/dist/gateway/static/root/assets/models-hub-panel-DObxxjc9.js +0 -2
- package/dist/gateway/static/root/assets/notes-workbench-CCb4RXcZ.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-BvEcriRC.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B_e79MRJ.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DGcqnYfR.js +0 -1
- package/dist/gateway/static/root/assets/save-bar-controls-CkeKasGm.js +0 -1
- package/dist/gateway/static/root/assets/schedule-field-TkqUL3wm.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DQZhrDJ8.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BkdeN99Y.js +0 -1
- package/dist/gateway/static/root/assets/settings-collapsible-section-Dpqth3oA.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-qPG7I2zd.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-lwRAh9aw.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BGj9IVUr.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-B2UBAs5U.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-DdjzFZ8I.js +0 -2
- package/dist/gateway/static/root/assets/user-context-page-BTTZpAGV.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-DuDQd-WU.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BUVkVCsW.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-DeEPPu4n.js +0 -1
- package/dist/gateway/static/root/assets/work-page-DQNUyTUq.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-BIy4wrzO.js +0 -11
- package/dist/src/agent/image/generation/bundled-registry.d.ts +0 -18
- package/dist/src/agent/image/generation/bundled-registry.js +0 -35
- package/dist/src/agent/image/generation/bundled.d.ts +0 -10
- package/dist/src/agent/image/generation/bundled.js +0 -15
- package/dist/src/agent/image/generation/image-provider-ui.d.ts +0 -20
- package/dist/src/browser/pipeline/source.d.ts +0 -9
- package/dist/src/browser/pipeline/source.js +0 -77
- package/dist/src/gateway/image-capabilities.d.ts +0 -28
- package/dist/src/gateway/image-capabilities.js +0 -78
- package/dist/src/generated/bundled-image-generation-providers.d.ts +0 -14
- package/dist/src/generated/bundled-image-generation-providers.js +0 -17
- /package/dist/src/{agent/image/generation/image-provider-ui.js → browser/recipes/types.js} +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
//#region src/agent/tools/browser-recipe-tool.ts
|
|
3
|
+
const BrowserRecipeToolSchema = Type.Object({
|
|
4
|
+
action: Type.Union([
|
|
5
|
+
Type.Literal("list"),
|
|
6
|
+
Type.Literal("get"),
|
|
7
|
+
Type.Literal("save"),
|
|
8
|
+
Type.Literal("enable"),
|
|
9
|
+
Type.Literal("disable"),
|
|
10
|
+
Type.Literal("delete"),
|
|
11
|
+
Type.Literal("run")
|
|
12
|
+
]),
|
|
13
|
+
recipeId: Type.Optional(Type.String({ description: "Workflow id for get, enable, disable, delete, or run." })),
|
|
14
|
+
yaml: Type.Optional(Type.String({ description: "Canonical Browser Recipe v1 YAML generated internally when saving." })),
|
|
15
|
+
args: Type.Optional(Type.Record(Type.String(), Type.Unknown(), { description: "Typed workflow inputs for a run." }))
|
|
16
|
+
});
|
|
17
|
+
function result(text, details) {
|
|
18
|
+
return {
|
|
19
|
+
content: [{
|
|
20
|
+
type: "text",
|
|
21
|
+
text
|
|
22
|
+
}],
|
|
23
|
+
details
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function presentWorkflow(recipe) {
|
|
27
|
+
if (!recipe) return void 0;
|
|
28
|
+
return {
|
|
29
|
+
id: recipe.id,
|
|
30
|
+
name: recipe.name,
|
|
31
|
+
description: recipe.description,
|
|
32
|
+
enabled: recipe.status === "published",
|
|
33
|
+
risk: recipe.risk,
|
|
34
|
+
domains: recipe.domains
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function createBrowserRecipeTool(deps) {
|
|
38
|
+
return {
|
|
39
|
+
name: "browser_recipe",
|
|
40
|
+
label: "Browser Automation",
|
|
41
|
+
description: "Create and manage reusable browser automations for the user. Use save after a successful browser_use sequence when the user asks to save or repeat it. The yaml field is an internal Browser Recipe document: apiVersion must be xopc.ai/browser-recipe/v1; include kebab-case id, user-facing name and description, risk, exact domains, typed args, and pipeline. Every pipeline step has exactly one action with an object value. Use ${{ args.name }} for variable inputs. New saves are enabled immediately. Only delete on an explicit user request. Users should never need to write or see this YAML.",
|
|
42
|
+
parameters: BrowserRecipeToolSchema,
|
|
43
|
+
async execute(_toolCallId, params, signal) {
|
|
44
|
+
const service = deps.getBrowserRecipeService();
|
|
45
|
+
if (!service) return result("Browser automation is not available.", { ok: false });
|
|
46
|
+
if (params.action === "list") {
|
|
47
|
+
const recipes = service.list();
|
|
48
|
+
return result(recipes.length === 0 ? "No browser automations." : recipes.map((recipe) => `- ${recipe.id}: ${recipe.name} (${recipe.status === "published" ? "enabled" : "paused"}, ${recipe.risk})`).join("\n"), { workflows: recipes.map(presentWorkflow) });
|
|
49
|
+
}
|
|
50
|
+
const recipeId = params.recipeId?.trim();
|
|
51
|
+
if (params.action === "save") {
|
|
52
|
+
if (!params.yaml?.trim()) return result("The internal definition is required to save a browser automation.", { ok: false });
|
|
53
|
+
try {
|
|
54
|
+
const recipe = service.save({ yaml: params.yaml });
|
|
55
|
+
return result(`Saved and enabled browser automation: ${recipe.name}`, {
|
|
56
|
+
ok: true,
|
|
57
|
+
workflow: presentWorkflow(recipe)
|
|
58
|
+
});
|
|
59
|
+
} catch (error) {
|
|
60
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
61
|
+
return result(`Could not save browser automation: ${message}`, {
|
|
62
|
+
ok: false,
|
|
63
|
+
error: message
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (!recipeId) return result("recipeId is required.", { ok: false });
|
|
68
|
+
if (params.action === "get") {
|
|
69
|
+
const recipe = service.get(recipeId);
|
|
70
|
+
if (!recipe) return result(`Browser automation not found: ${recipeId}`, { ok: false });
|
|
71
|
+
return result(`${recipe.name}\nEnabled: ${recipe.status === "published" ? "yes" : "no"}\nRisk: ${recipe.risk}\nDomains: ${recipe.domains.join(", ")}`, { workflow: presentWorkflow(recipe) });
|
|
72
|
+
}
|
|
73
|
+
if (params.action === "enable" || params.action === "disable") {
|
|
74
|
+
const recipe = service.get(recipeId);
|
|
75
|
+
if (!recipe) return result(`Browser automation not found: ${recipeId}`, { ok: false });
|
|
76
|
+
const saved = service.save({
|
|
77
|
+
yaml: recipe.yaml,
|
|
78
|
+
status: params.action === "enable" ? "published" : "disabled",
|
|
79
|
+
expectedId: recipe.id
|
|
80
|
+
});
|
|
81
|
+
return result(`${saved.name} is now ${params.action === "enable" ? "enabled" : "disabled"}.`, {
|
|
82
|
+
ok: true,
|
|
83
|
+
workflow: presentWorkflow(saved)
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (params.action === "delete") try {
|
|
87
|
+
const removed = service.remove(recipeId);
|
|
88
|
+
return result(removed ? `Deleted browser automation: ${recipeId}` : `Browser automation not found: ${recipeId}`, { ok: removed });
|
|
89
|
+
} catch (error) {
|
|
90
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
91
|
+
return result(`Could not delete browser automation: ${message}`, {
|
|
92
|
+
ok: false,
|
|
93
|
+
error: message
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
const run = await service.runAndWait(recipeId, params.args ?? {}, signal);
|
|
98
|
+
return result(run.status === "succeeded" ? `Browser automation ${recipeId} completed.` : `Browser automation ${recipeId} ${run.status}: ${run.error ?? "No error details"}`, {
|
|
99
|
+
ok: run.status === "succeeded",
|
|
100
|
+
run
|
|
101
|
+
});
|
|
102
|
+
} catch (error) {
|
|
103
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
104
|
+
return result(`Browser automation failed: ${message}`, {
|
|
105
|
+
ok: false,
|
|
106
|
+
error: message
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { createBrowserRecipeTool };
|
|
@@ -15,6 +15,7 @@ import type { MemoryManager } from '../memory/manager.js';
|
|
|
15
15
|
import type { SessionStore } from '../../session/store.js';
|
|
16
16
|
import type { GatewayClarifyRequestFn } from './clarify-tool.js';
|
|
17
17
|
import type { AutomationService } from '../../automations/index.js';
|
|
18
|
+
import type { BrowserRecipeService } from '../../browser/recipes/index.js';
|
|
18
19
|
import type { NotesService } from '../../notes/index.js';
|
|
19
20
|
import type { ProjectService } from '../../projects/index.js';
|
|
20
21
|
import type { WorkItemService } from '../../work-items/index.js';
|
|
@@ -48,6 +49,7 @@ export interface ToolFactoryDeps {
|
|
|
48
49
|
};
|
|
49
50
|
/** Gateway: enables the `automation` tool. */
|
|
50
51
|
getAutomationService?: () => AutomationService | undefined;
|
|
52
|
+
getBrowserRecipeService?: () => BrowserRecipeService | undefined;
|
|
51
53
|
/** Gateway: enables the `xopc_use` product-object tool. */
|
|
52
54
|
getNotesService?: () => NotesService | undefined;
|
|
53
55
|
getProjectService?: () => ProjectService | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
3
4
|
import { createReadFileTool } from "./read.js";
|
|
4
5
|
import { createWriteFileTool } from "./write.js";
|
|
5
6
|
import { createListDirTool } from "./list-dir.js";
|
|
@@ -32,6 +33,7 @@ import "./delegate-tool.js";
|
|
|
32
33
|
import { createWorkflowTool } from "./workflow-tool.js";
|
|
33
34
|
import "./execute-code-tool.js";
|
|
34
35
|
import { createAutomationTool } from "./automation-tool.js";
|
|
36
|
+
import { createBrowserRecipeTool } from "./browser-recipe-tool.js";
|
|
35
37
|
import { createGoalTool } from "./goal-tool.js";
|
|
36
38
|
import { createXopcUseTool } from "./xopc-use-tool.js";
|
|
37
39
|
import { createSkillViewTool, createSkillsListTool } from "./skills-tools.js";
|
|
@@ -55,6 +57,7 @@ import { getAgentCapabilityToolNames } from "../capabilities/registry.js";
|
|
|
55
57
|
import "../capabilities/index.js";
|
|
56
58
|
import { isCodeIntelligenceEnabledForAgent } from "../code-intelligence/tool-gating.js";
|
|
57
59
|
//#region src/agent/tools/factory.ts
|
|
60
|
+
init_agent_scope();
|
|
58
61
|
init_logger();
|
|
59
62
|
const log = createLogger("AgentToolsFactory");
|
|
60
63
|
/** Channels where `clarify` can block for a user answer (web UI, Telegram, CLI readline). */
|
|
@@ -172,7 +175,8 @@ var AgentToolsFactory = class {
|
|
|
172
175
|
});
|
|
173
176
|
const imageGenerateTool = createImageGenerateTool({
|
|
174
177
|
config: cfg,
|
|
175
|
-
workspace
|
|
178
|
+
workspace,
|
|
179
|
+
agentId: options?.agentId ?? (cfg ? resolveDefaultAgentId(cfg) : "main")
|
|
176
180
|
});
|
|
177
181
|
const codeIntelligenceConfig = cfg?.codeIntelligence;
|
|
178
182
|
const agentId = options?.agentId;
|
|
@@ -284,6 +288,7 @@ var AgentToolsFactory = class {
|
|
|
284
288
|
getCurrentSessionKey: () => this.deps.getCurrentContext()?.sessionKey
|
|
285
289
|
})] : [],
|
|
286
290
|
...this.deps.getAutomationService ? [createAutomationTool({ getAutomationService: this.deps.getAutomationService })] : [],
|
|
291
|
+
...browserEnabled && this.deps.getBrowserRecipeService ? [createBrowserRecipeTool({ getBrowserRecipeService: this.deps.getBrowserRecipeService })] : [],
|
|
287
292
|
...this.deps.getProjectService || this.deps.getNotesService || this.deps.getWorkItemService || this.deps.getLocalAppService ? [createXopcUseTool({
|
|
288
293
|
getConfig: () => this.deps.getConfig?.(),
|
|
289
294
|
getCurrentAgentId: () => options.agentId,
|
|
@@ -5,8 +5,10 @@ import type { ToolModelConfig } from '../image/tool-model-config.js';
|
|
|
5
5
|
export { parseImageDataUrl };
|
|
6
6
|
export declare function resolveImageGenerationModelConfigForTool(params: {
|
|
7
7
|
cfg?: Config;
|
|
8
|
+
agentId: string;
|
|
8
9
|
}): ToolModelConfig | null;
|
|
9
10
|
export declare function createImageGenerateTool(options: {
|
|
10
11
|
config?: Config;
|
|
11
12
|
workspace: string;
|
|
13
|
+
agentId: string;
|
|
12
14
|
}): AgentTool<any, Record<string, unknown>> | null;
|
|
@@ -37,7 +37,7 @@ const ALLOWED_RESOLUTIONS = [
|
|
|
37
37
|
const ImageGenerateToolSchema = Type.Object({
|
|
38
38
|
action: Type.Optional(Type.String({ description: "Optional: \"generate\" (default) or \"list\" available image-generation providers." })),
|
|
39
39
|
prompt: Type.Optional(Type.String({ description: "Image generation prompt." })),
|
|
40
|
-
model: Type.Optional(Type.String({ description: "Optional provider/model override, e.g. openai/gpt-image-
|
|
40
|
+
model: Type.Optional(Type.String({ description: "Optional provider/model override, e.g. openai/gpt-image-2 / dashscope/wan2.7-image-pro / minimax/image-01." })),
|
|
41
41
|
filename: Type.Optional(Type.String({ description: "Optional basename hint for saved files." })),
|
|
42
42
|
size: Type.Optional(Type.String({ description: "Optional pixel size, e.g. 1024x1024." })),
|
|
43
43
|
aspectRatio: Type.Optional(Type.String({ description: "Optional aspect ratio, e.g. 16:9 / 9:16 / 1:1." })),
|
|
@@ -126,20 +126,23 @@ async function loadInputImages(params) {
|
|
|
126
126
|
return out;
|
|
127
127
|
}
|
|
128
128
|
function resolveImageGenerationModelConfigForTool(params) {
|
|
129
|
-
const explicit = params.cfg ? getAgentDefaultImageGenerationModelConfig(params.cfg) : void 0;
|
|
129
|
+
const explicit = params.cfg ? getAgentDefaultImageGenerationModelConfig(params.cfg, params.agentId) : void 0;
|
|
130
130
|
if (explicit?.primary?.trim()) return {
|
|
131
131
|
primary: explicit.primary.trim(),
|
|
132
132
|
...explicit.fallbacks?.length ? { fallbacks: explicit.fallbacks } : {},
|
|
133
133
|
...explicit.timeoutMs ? { timeoutMs: explicit.timeoutMs } : {},
|
|
134
134
|
...explicit.autoProviderFallback ? { autoProviderFallback: true } : {}
|
|
135
135
|
};
|
|
136
|
-
const providers = listImageGenerationProvidersSummary(
|
|
136
|
+
const providers = listImageGenerationProvidersSummary();
|
|
137
137
|
const candidates = [];
|
|
138
138
|
for (const providerSummary of providers) {
|
|
139
|
-
const provider = getImageGenerationProvider(providerSummary.id
|
|
139
|
+
const provider = getImageGenerationProvider(providerSummary.id);
|
|
140
140
|
let configured = false;
|
|
141
141
|
try {
|
|
142
|
-
configured = provider?.isConfigured?.({
|
|
142
|
+
configured = provider?.isConfigured?.({
|
|
143
|
+
cfg: params.cfg,
|
|
144
|
+
agentId: params.agentId
|
|
145
|
+
}) ?? false;
|
|
143
146
|
} catch {
|
|
144
147
|
configured = false;
|
|
145
148
|
}
|
|
@@ -169,7 +172,10 @@ async function saveGeneratedImages(params) {
|
|
|
169
172
|
return out;
|
|
170
173
|
}
|
|
171
174
|
function createImageGenerateTool(options) {
|
|
172
|
-
const imageGenerationModelConfig = resolveImageGenerationModelConfigForTool({
|
|
175
|
+
const imageGenerationModelConfig = resolveImageGenerationModelConfigForTool({
|
|
176
|
+
cfg: options.config,
|
|
177
|
+
agentId: options.agentId
|
|
178
|
+
});
|
|
173
179
|
if (!imageGenerationModelConfig) return null;
|
|
174
180
|
const effectiveCfg = applyImageGenerationModelConfigDefaults(options.config, imageGenerationModelConfig) ?? options.config;
|
|
175
181
|
return {
|
|
@@ -181,7 +187,7 @@ function createImageGenerateTool(options) {
|
|
|
181
187
|
const params = args;
|
|
182
188
|
const action = (readStringParam(params, "action") || "generate").toLowerCase();
|
|
183
189
|
if (action === "list") {
|
|
184
|
-
const providers = listImageGenerationProvidersSummary(
|
|
190
|
+
const providers = listImageGenerationProvidersSummary();
|
|
185
191
|
return {
|
|
186
192
|
content: [{
|
|
187
193
|
type: "text",
|
|
@@ -234,6 +240,7 @@ function createImageGenerateTool(options) {
|
|
|
234
240
|
try {
|
|
235
241
|
const result = await generateImage({
|
|
236
242
|
cfg: effectiveCfg,
|
|
243
|
+
agentId: options.agentId,
|
|
237
244
|
modelConfig: imageGenerationModelConfig,
|
|
238
245
|
prompt,
|
|
239
246
|
...modelOverride ? { modelOverride } : {},
|
|
@@ -27,6 +27,7 @@ export { createDelegateTool, DEFAULT_DELEGATE_TOOLS, DELEGATE_BLOCKED_TOOLS, } f
|
|
|
27
27
|
export { createWorkflowTool, type WorkflowToolDeps, type WorkflowToolInput } from './workflow-tool.js';
|
|
28
28
|
export { createExecuteCodeTool, buildSandboxToolMap, SANDBOX_ALLOWED_TOOLS, } from './execute-code-tool.js';
|
|
29
29
|
export { createAutomationTool, type AutomationToolDeps } from './automation-tool.js';
|
|
30
|
+
export { createBrowserRecipeTool } from './browser-recipe-tool.js';
|
|
30
31
|
export { createGoalTool, type GoalToolOptions } from './goal-tool.js';
|
|
31
32
|
export { createXopcUseTool, type XopcUseToolDeps, type XopcUseToolInput } from './xopc-use-tool.js';
|
|
32
33
|
export { createSkillsListTool, createSkillViewTool, type SkillsToolsDeps } from './skills-tools.js';
|
|
@@ -31,6 +31,7 @@ import { DEFAULT_DELEGATE_TOOLS, DELEGATE_BLOCKED_TOOLS, createDelegateTool } fr
|
|
|
31
31
|
import { createWorkflowTool } from "./workflow-tool.js";
|
|
32
32
|
import { SANDBOX_ALLOWED_TOOLS, buildSandboxToolMap, createExecuteCodeTool } from "./execute-code-tool.js";
|
|
33
33
|
import { createAutomationTool } from "./automation-tool.js";
|
|
34
|
+
import { createBrowserRecipeTool } from "./browser-recipe-tool.js";
|
|
34
35
|
import { createGoalTool } from "./goal-tool.js";
|
|
35
36
|
import { createXopcUseTool } from "./xopc-use-tool.js";
|
|
36
37
|
import { createSkillViewTool, createSkillsListTool } from "./skills-tools.js";
|
|
@@ -42,4 +43,4 @@ import { createCodeIntelligenceTools } from "../code-intelligence/tools.js";
|
|
|
42
43
|
import { resolveImageModelConfigForTool } from "../image/tool-model-config.js";
|
|
43
44
|
import { createImageTool } from "./image-tool.js";
|
|
44
45
|
import { createImageGenerateTool, resolveImageGenerationModelConfigForTool } from "./image-generate-tool.js";
|
|
45
|
-
export { BrowserManager, DEFAULT_DELEGATE_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_TOOL_METADATA, DEFAULT_WEB_EXTRACT_MAX_LENGTH, DELEGATE_BLOCKED_TOOLS, GREP_MAX_LINE_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, SANDBOX_ALLOWED_TOOLS, TodoStore, ToolConcurrencyController, assertBrowserUrlAllowed, buildSandboxToolMap, createApplyPatchTool, createAutomationTool, createClarifyTool, createCodeIntelligenceTools, createComposioTools, createCreateShareTool, createCuratedMemoryTool, createDelegateTool, createDesktopPetTool, createDreamingTool, createExecCommandTool, createExecuteCodeTool, createFindTool, createGoalTool, createGrepTool, createImageGenerateTool, createImageTool, createListDirTool, createMemoryGetTool, createMemorySearchTool, createMessageTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
|
|
46
|
+
export { BrowserManager, DEFAULT_DELEGATE_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_TOOL_METADATA, DEFAULT_WEB_EXTRACT_MAX_LENGTH, DELEGATE_BLOCKED_TOOLS, GREP_MAX_LINE_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, SANDBOX_ALLOWED_TOOLS, TodoStore, ToolConcurrencyController, assertBrowserUrlAllowed, buildSandboxToolMap, createApplyPatchTool, createAutomationTool, createBrowserRecipeTool, createClarifyTool, createCodeIntelligenceTools, createComposioTools, createCreateShareTool, createCuratedMemoryTool, createDelegateTool, createDesktopPetTool, createDreamingTool, createExecCommandTool, createExecuteCodeTool, createFindTool, createGoalTool, createGrepTool, createImageGenerateTool, createImageTool, createListDirTool, createMemoryGetTool, createMemorySearchTool, createMessageTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
* Synchronous checks that mirror CredentialResolver.resolveApiKey sources
|
|
3
3
|
* used by isProviderConfiguredSync (fallback candidate filtering).
|
|
4
4
|
*/
|
|
5
|
+
import type { Config } from '../config/schema.js';
|
|
5
6
|
/**
|
|
6
7
|
* Synchronous API key / OAuth access for {@link Agent} `getApiKey` (pi-agent requires sync).
|
|
7
8
|
* Order: default agent auth-profiles → global auth-profiles → OAuth token file.
|
|
8
9
|
* Does not read standard env vars or models.json registry — callers chain `getApiKeySync` after this.
|
|
9
10
|
*/
|
|
10
11
|
export declare function resolveProviderApiKeySync(provider: string): string | undefined;
|
|
12
|
+
/** Resolve one agent's private credential, then the shared credential and OAuth token. */
|
|
13
|
+
export declare function resolveProviderApiKeyForAgentSync(provider: string, agentId?: string, config?: Config): string | undefined;
|
|
11
14
|
/**
|
|
12
15
|
* True if credentials exist in auth profiles (global or agent) or OAuth store,
|
|
13
16
|
* matching async CredentialResolver resolution (excluding env — callers check env separately).
|
|
@@ -88,6 +88,17 @@ function resolveProviderApiKeySync(provider) {
|
|
|
88
88
|
if (fromGlobal) return fromGlobal;
|
|
89
89
|
return readOAuthAccessTokenSync(normalized);
|
|
90
90
|
}
|
|
91
|
+
/** Resolve one agent's private credential, then the shared credential and OAuth token. */
|
|
92
|
+
function resolveProviderApiKeyForAgentSync(provider, agentId, config) {
|
|
93
|
+
const normalized = provider.toLowerCase();
|
|
94
|
+
if (agentId?.trim()) {
|
|
95
|
+
const fromAgent = readApiKeyFromProfilesFile(resolveAgentAuthProfilesPath(config ?? loadConfig(), agentId.trim()), normalized);
|
|
96
|
+
if (fromAgent) return fromAgent;
|
|
97
|
+
}
|
|
98
|
+
const fromGlobal = readApiKeyFromProfilesFile(resolveAuthProfilesPath(), normalized);
|
|
99
|
+
if (fromGlobal) return fromGlobal;
|
|
100
|
+
return readOAuthAccessTokenSync(normalized);
|
|
101
|
+
}
|
|
91
102
|
/**
|
|
92
103
|
* True if credentials exist in auth profiles (global or agent) or OAuth store,
|
|
93
104
|
* matching async CredentialResolver resolution (excluding env — callers check env separately).
|
|
@@ -106,4 +117,4 @@ var init_sync_provider_auth = __esmMin((() => {
|
|
|
106
117
|
}));
|
|
107
118
|
//#endregion
|
|
108
119
|
init_sync_provider_auth();
|
|
109
|
-
export { hasProviderAuthOnDiskSync, init_sync_provider_auth, resolveProviderApiKeySync };
|
|
120
|
+
export { hasProviderAuthOnDiskSync, init_sync_provider_auth, resolveProviderApiKeyForAgentSync, resolveProviderApiKeySync };
|
|
@@ -43,6 +43,11 @@ export type AutomationAction = {
|
|
|
43
43
|
concurrency?: number;
|
|
44
44
|
maxSubagents?: number;
|
|
45
45
|
timeoutSeconds?: number;
|
|
46
|
+
} | {
|
|
47
|
+
kind: 'browser_recipe';
|
|
48
|
+
recipeId: string;
|
|
49
|
+
args?: Record<string, unknown>;
|
|
50
|
+
timeoutSeconds?: number;
|
|
46
51
|
};
|
|
47
52
|
export type AutomationAfterRun = {
|
|
48
53
|
kind: 'none';
|
|
@@ -151,6 +156,14 @@ export interface AutomationDeps {
|
|
|
151
156
|
workflowRunService?: {
|
|
152
157
|
startWorkflowRun(params: StartWorkflowRunServiceParams): Promise<WorkflowRunServiceResult>;
|
|
153
158
|
};
|
|
159
|
+
browserRecipeService?: {
|
|
160
|
+
runAndWait(recipeId: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<{
|
|
161
|
+
id: string;
|
|
162
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
163
|
+
result?: unknown;
|
|
164
|
+
error?: string;
|
|
165
|
+
}>;
|
|
166
|
+
};
|
|
154
167
|
onRunCompleted?: (run: AutomationRun) => void;
|
|
155
168
|
}
|
|
156
169
|
export interface AutomationActionOutcome {
|
|
@@ -58,6 +58,11 @@ export declare const AutomationActionSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
58
58
|
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
59
59
|
maxSubagents: z.ZodOptional<z.ZodNumber>;
|
|
60
60
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
62
|
+
kind: z.ZodLiteral<"browser_recipe">;
|
|
63
|
+
recipeId: z.ZodString;
|
|
64
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
65
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
61
66
|
}, z.core.$strict>], "kind">;
|
|
62
67
|
export declare const AutomationAfterRunSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
63
68
|
kind: z.ZodLiteral<"none">;
|
|
@@ -85,12 +90,12 @@ export declare const AutomationStateSchema: z.ZodObject<{
|
|
|
85
90
|
runningRunId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
86
91
|
lastRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
87
92
|
lastRunStatus: z.ZodOptional<z.ZodEnum<{
|
|
88
|
-
queued: "queued";
|
|
89
|
-
running: "running";
|
|
90
|
-
succeeded: "succeeded";
|
|
91
93
|
failed: "failed";
|
|
92
94
|
cancelled: "cancelled";
|
|
93
95
|
timeout: "timeout";
|
|
96
|
+
succeeded: "succeeded";
|
|
97
|
+
running: "running";
|
|
98
|
+
queued: "queued";
|
|
94
99
|
}>>;
|
|
95
100
|
lastError: z.ZodOptional<z.ZodString>;
|
|
96
101
|
consecutiveFailures: z.ZodOptional<z.ZodNumber>;
|
|
@@ -148,6 +153,11 @@ export declare const AutomationSchema: z.ZodObject<{
|
|
|
148
153
|
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
149
154
|
maxSubagents: z.ZodOptional<z.ZodNumber>;
|
|
150
155
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
157
|
+
kind: z.ZodLiteral<"browser_recipe">;
|
|
158
|
+
recipeId: z.ZodString;
|
|
159
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
160
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
151
161
|
}, z.core.$strict>], "kind">;
|
|
152
162
|
safety: z.ZodOptional<z.ZodObject<{
|
|
153
163
|
mode: z.ZodEnum<{
|
|
@@ -175,12 +185,12 @@ export declare const AutomationSchema: z.ZodObject<{
|
|
|
175
185
|
runningRunId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
176
186
|
lastRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
177
187
|
lastRunStatus: z.ZodOptional<z.ZodEnum<{
|
|
178
|
-
queued: "queued";
|
|
179
|
-
running: "running";
|
|
180
|
-
succeeded: "succeeded";
|
|
181
188
|
failed: "failed";
|
|
182
189
|
cancelled: "cancelled";
|
|
183
190
|
timeout: "timeout";
|
|
191
|
+
succeeded: "succeeded";
|
|
192
|
+
running: "running";
|
|
193
|
+
queued: "queued";
|
|
184
194
|
}>>;
|
|
185
195
|
lastError: z.ZodOptional<z.ZodString>;
|
|
186
196
|
consecutiveFailures: z.ZodOptional<z.ZodNumber>;
|
|
@@ -213,6 +223,11 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
213
223
|
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
214
224
|
maxSubagents: z.ZodOptional<z.ZodNumber>;
|
|
215
225
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
226
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
227
|
+
kind: z.ZodLiteral<"browser_recipe">;
|
|
228
|
+
recipeId: z.ZodString;
|
|
229
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
230
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
216
231
|
}, z.core.$strict>], "kind">;
|
|
217
232
|
description: z.ZodOptional<z.ZodString>;
|
|
218
233
|
trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -268,12 +283,12 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
268
283
|
runningRunId: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodString>>>;
|
|
269
284
|
lastRunAtMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
270
285
|
lastRunStatus: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
|
|
271
|
-
queued: "queued";
|
|
272
|
-
running: "running";
|
|
273
|
-
succeeded: "succeeded";
|
|
274
286
|
failed: "failed";
|
|
275
287
|
cancelled: "cancelled";
|
|
276
288
|
timeout: "timeout";
|
|
289
|
+
succeeded: "succeeded";
|
|
290
|
+
running: "running";
|
|
291
|
+
queued: "queued";
|
|
277
292
|
}>>>;
|
|
278
293
|
lastError: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
279
294
|
consecutiveFailures: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -305,7 +320,27 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
|
|
|
305
320
|
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
306
321
|
maxSubagents: z.ZodOptional<z.ZodNumber>;
|
|
307
322
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
323
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
324
|
+
kind: z.ZodLiteral<"browser_recipe">;
|
|
325
|
+
recipeId: z.ZodString;
|
|
326
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
327
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
308
328
|
}, z.core.$strict>], "kind">>;
|
|
329
|
+
state: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
330
|
+
nextRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
331
|
+
runningRunId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
332
|
+
lastRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
333
|
+
lastRunStatus: z.ZodOptional<z.ZodEnum<{
|
|
334
|
+
failed: "failed";
|
|
335
|
+
cancelled: "cancelled";
|
|
336
|
+
timeout: "timeout";
|
|
337
|
+
succeeded: "succeeded";
|
|
338
|
+
running: "running";
|
|
339
|
+
queued: "queued";
|
|
340
|
+
}>>;
|
|
341
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
342
|
+
consecutiveFailures: z.ZodOptional<z.ZodNumber>;
|
|
343
|
+
}, z.core.$strict>>>;
|
|
309
344
|
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
310
345
|
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
311
346
|
kind: z.ZodLiteral<"manual">;
|
|
@@ -332,21 +367,6 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
|
|
|
332
367
|
source: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
333
368
|
payloadMatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
334
369
|
}, z.core.$strict>], "kind">>;
|
|
335
|
-
state: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
336
|
-
nextRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
337
|
-
runningRunId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
338
|
-
lastRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
339
|
-
lastRunStatus: z.ZodOptional<z.ZodEnum<{
|
|
340
|
-
queued: "queued";
|
|
341
|
-
running: "running";
|
|
342
|
-
succeeded: "succeeded";
|
|
343
|
-
failed: "failed";
|
|
344
|
-
cancelled: "cancelled";
|
|
345
|
-
timeout: "timeout";
|
|
346
|
-
}>>;
|
|
347
|
-
lastError: z.ZodOptional<z.ZodString>;
|
|
348
|
-
consecutiveFailures: z.ZodOptional<z.ZodNumber>;
|
|
349
|
-
}, z.core.$strict>>>;
|
|
350
370
|
safety: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
351
371
|
mode: z.ZodEnum<{
|
|
352
372
|
suggest_only: "suggest_only";
|
|
@@ -61,24 +61,33 @@ const WorkflowRunInputEnvelopeSchema = z.object({
|
|
|
61
61
|
variables: z.record(z.string(), z.unknown()).optional(),
|
|
62
62
|
context: z.record(z.string(), z.unknown()).optional()
|
|
63
63
|
}).strict();
|
|
64
|
-
const AutomationActionSchema = z.discriminatedUnion("kind", [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
64
|
+
const AutomationActionSchema = z.discriminatedUnion("kind", [
|
|
65
|
+
z.object({
|
|
66
|
+
kind: z.literal("agent"),
|
|
67
|
+
agentId: optionalTrimmedString(64),
|
|
68
|
+
instruction: nonEmptyString.max(5e4),
|
|
69
|
+
workingDirectory: optionalTrimmedString(4096),
|
|
70
|
+
model: optionalTrimmedString(100),
|
|
71
|
+
timeoutSeconds: z.number().int().min(1).max(86400).optional()
|
|
72
|
+
}).strict(),
|
|
73
|
+
z.object({
|
|
74
|
+
kind: z.literal("workflow"),
|
|
75
|
+
workflowId: nonEmptyString.max(200),
|
|
76
|
+
agentId: optionalTrimmedString(64),
|
|
77
|
+
input: z.unknown().optional(),
|
|
78
|
+
inputEnvelope: WorkflowRunInputEnvelopeSchema.optional(),
|
|
79
|
+
goal: optionalTrimmedString(5e3),
|
|
80
|
+
concurrency: z.number().int().min(1).max(50).optional(),
|
|
81
|
+
maxSubagents: z.number().int().min(1).max(100).optional(),
|
|
82
|
+
timeoutSeconds: z.number().int().min(1).max(86400).optional()
|
|
83
|
+
}).strict(),
|
|
84
|
+
z.object({
|
|
85
|
+
kind: z.literal("browser_recipe"),
|
|
86
|
+
recipeId: nonEmptyString.max(100),
|
|
87
|
+
args: z.record(z.string(), z.unknown()).optional(),
|
|
88
|
+
timeoutSeconds: z.number().int().min(1).max(86400).optional()
|
|
89
|
+
}).strict()
|
|
90
|
+
]);
|
|
82
91
|
const AutomationAfterRunSchema = z.discriminatedUnion("kind", [
|
|
83
92
|
z.object({ kind: z.literal("none") }).strict(),
|
|
84
93
|
z.object({ kind: z.literal("saveToSession") }).strict(),
|
|
@@ -34,6 +34,11 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
|
|
|
34
34
|
concurrency?: number;
|
|
35
35
|
maxSubagents?: number;
|
|
36
36
|
timeoutSeconds?: number;
|
|
37
|
+
} | {
|
|
38
|
+
kind: "browser_recipe";
|
|
39
|
+
recipeId: string;
|
|
40
|
+
args?: Record<string, unknown>;
|
|
41
|
+
timeoutSeconds?: number;
|
|
37
42
|
};
|
|
38
43
|
description?: string;
|
|
39
44
|
trigger?: {
|
|
@@ -84,7 +89,7 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
|
|
|
84
89
|
nextRunAtMs?: number;
|
|
85
90
|
runningRunId?: string;
|
|
86
91
|
lastRunAtMs?: number;
|
|
87
|
-
lastRunStatus?: "
|
|
92
|
+
lastRunStatus?: "failed" | "cancelled" | "timeout" | "succeeded" | "running" | "queued";
|
|
88
93
|
lastError?: string;
|
|
89
94
|
consecutiveFailures?: number;
|
|
90
95
|
};
|
|
@@ -90,6 +90,7 @@ function summarizeTrigger(trigger) {
|
|
|
90
90
|
}
|
|
91
91
|
function summarizeAction(action) {
|
|
92
92
|
if (action.kind === "workflow") return `Starts workflow ${action.workflowId}.`;
|
|
93
|
+
if (action.kind === "browser_recipe") return `Runs browser automation ${action.recipeId}.`;
|
|
93
94
|
return action.agentId ? `Runs agent ${action.agentId}.` : "Runs the default agent.";
|
|
94
95
|
}
|
|
95
96
|
function repairPatchNeedsApproval(patch) {
|
|
@@ -4,6 +4,7 @@ export declare class AutomationActionExecutor {
|
|
|
4
4
|
setDeps(deps: AutomationDeps): void;
|
|
5
5
|
execute(automation: Automation, run: AutomationRun, signal: AbortSignal): Promise<AutomationActionOutcome>;
|
|
6
6
|
private executeWithoutTimeout;
|
|
7
|
+
private executeBrowserRecipe;
|
|
7
8
|
private executeAgent;
|
|
8
9
|
private executeWorkflow;
|
|
9
10
|
}
|
|
@@ -56,8 +56,30 @@ var AutomationActionExecutor = class {
|
|
|
56
56
|
error: "Automation run was cancelled"
|
|
57
57
|
};
|
|
58
58
|
if (automation.action.kind === "workflow") return this.executeWorkflow(automation, automation.action, run);
|
|
59
|
+
if (automation.action.kind === "browser_recipe") return this.executeBrowserRecipe(automation, automation.action, signal);
|
|
59
60
|
return this.executeAgent(automation, automation.action);
|
|
60
61
|
}
|
|
62
|
+
async executeBrowserRecipe(automation, action, signal) {
|
|
63
|
+
const safetyMode = automation.safety?.mode ?? "auto_apply";
|
|
64
|
+
if (safetyMode !== "auto_apply") return {
|
|
65
|
+
status: "succeeded",
|
|
66
|
+
summary: `${safetyMode === "suggest_only" ? "Suggest only" : "Ask before applying"}: Browser automation ${action.recipeId} was not run.`
|
|
67
|
+
};
|
|
68
|
+
const service = this.deps.browserRecipeService;
|
|
69
|
+
if (!service) return {
|
|
70
|
+
status: "failed",
|
|
71
|
+
error: "Browser automation is not available"
|
|
72
|
+
};
|
|
73
|
+
const run = await service.runAndWait(action.recipeId, action.args ?? {}, signal);
|
|
74
|
+
if (run.status === "succeeded") return {
|
|
75
|
+
status: "succeeded",
|
|
76
|
+
summary: `Browser automation ${action.recipeId} completed: ${JSON.stringify(run.result ?? null).slice(0, 3500)}`
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
status: run.status === "cancelled" ? "cancelled" : "failed",
|
|
80
|
+
error: run.error ?? `Browser automation ${action.recipeId} ${run.status}`
|
|
81
|
+
};
|
|
82
|
+
}
|
|
61
83
|
async executeAgent(automation, action) {
|
|
62
84
|
const agentService = this.deps.agentService;
|
|
63
85
|
if (!agentService?.turnDispatcher?.processDirect) return {
|
|
@@ -13,5 +13,4 @@ export { createBrowserActionRegistry } from './actions/registry.js';
|
|
|
13
13
|
export type { BrowserActionName, BrowserActionContext, BrowserActionHandler, BrowserActionRegistry as BrowserActionRegistryType, BrowserActionResult, BrowserArtifact, BrowserDiagnostics, } from './actions/types.js';
|
|
14
14
|
export { parseBrowserPipeline, type PipelineDocument, type PipelineStep } from './pipeline/schema.js';
|
|
15
15
|
export { runBrowserPipeline, validateBrowserPipeline } from './pipeline/runner.js';
|
|
16
|
-
export { loadBrowserPipelineSource } from './pipeline/source.js';
|
|
17
16
|
export { resolveTemplate, resolveTemplateDeep } from './pipeline/template.js';
|
|
@@ -12,6 +12,5 @@ import { WEBDRIVER_OVERRIDE_SCRIPT, buildLocalStealthArgs, buildStealthArgs, gen
|
|
|
12
12
|
import { resolveTemplate, resolveTemplateDeep } from "./pipeline/template.js";
|
|
13
13
|
import { createBrowserActionRegistry } from "./actions/registry.js";
|
|
14
14
|
import { parseBrowserPipeline } from "./pipeline/schema.js";
|
|
15
|
-
import { loadBrowserPipelineSource } from "./pipeline/source.js";
|
|
16
15
|
import { runBrowserPipeline, validateBrowserPipeline } from "./pipeline/runner.js";
|
|
17
|
-
export { BrowserBackSchema, BrowserCdpSchema, BrowserClickSchema, BrowserCloseSchema, BrowserConsoleSchema, BrowserDialogSchema, BrowserGetImagesSchema, BrowserManager, BrowserNavigateSchema, BrowserNotReadyError, BrowserPressSchema, BrowserScreenshotSchema, BrowserScrollSchema, BrowserSnapshotSchema, BrowserTypeSchema, BrowserVisionSchema, CdpSupervisor, WEBDRIVER_OVERRIDE_SCRIPT, assertBrowserUrlAllowed, buildBrowserSetupDeepLink, buildLocalStealthArgs, buildStealthArgs, checkBotDetection, checkBrowserReadiness, checkPostRedirectUrl, cleanupOrphanProcesses, containsApiKeyPattern, createBrowserActionRegistry, generateFingerprintSeed, generateMousePath, generateScrollPlan, generateTypingPlan, humanizedClick, humanizedFill, humanizedPress, humanizedScroll, isAlwaysBlockedUrl,
|
|
16
|
+
export { BrowserBackSchema, BrowserCdpSchema, BrowserClickSchema, BrowserCloseSchema, BrowserConsoleSchema, BrowserDialogSchema, BrowserGetImagesSchema, BrowserManager, BrowserNavigateSchema, BrowserNotReadyError, BrowserPressSchema, BrowserScreenshotSchema, BrowserScrollSchema, BrowserSnapshotSchema, BrowserTypeSchema, BrowserVisionSchema, CdpSupervisor, WEBDRIVER_OVERRIDE_SCRIPT, assertBrowserUrlAllowed, buildBrowserSetupDeepLink, buildLocalStealthArgs, buildStealthArgs, checkBotDetection, checkBrowserReadiness, checkPostRedirectUrl, cleanupOrphanProcesses, containsApiKeyPattern, createBrowserActionRegistry, generateFingerprintSeed, generateMousePath, generateScrollPlan, generateTypingPlan, humanizedClick, humanizedFill, humanizedPress, humanizedScroll, isAlwaysBlockedUrl, makeExecutable, parseBrowserPipeline, removeQuarantineAttr, resolveBrowserBackendFromConfig, resolveBrowserCommandTimeoutMs, resolveHumanConfig, resolveTemplate, resolveTemplateDeep, runBrowserPipeline, snapshotSummaryHeader, startTracing, stopTracing, truncateSnapshotAtBoundary, validateBrowserPipeline };
|
|
@@ -13,8 +13,15 @@ export interface ValidateResult {
|
|
|
13
13
|
}
|
|
14
14
|
export interface RunBrowserPipelineOptions {
|
|
15
15
|
dryRun?: boolean;
|
|
16
|
-
|
|
16
|
+
onStep?: (event: BrowserRecipeStepEvent) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface BrowserRecipeStepEvent {
|
|
19
|
+
index: number;
|
|
20
|
+
scope: string;
|
|
21
|
+
action: string;
|
|
22
|
+
status: 'started' | 'completed' | 'failed';
|
|
23
|
+
elapsedMs?: number;
|
|
24
|
+
error?: string;
|
|
17
25
|
}
|
|
18
26
|
export declare function validateBrowserPipeline(yamlSource: string, registry?: BrowserActionRegistry): ValidateResult;
|
|
19
|
-
export declare function validateBrowserPipelineSource(yamlSource: string, registry?: BrowserActionRegistry, sourceLocation?: string): Promise<ValidateResult>;
|
|
20
27
|
export declare function runBrowserPipeline(yamlSource: string, argOverrides: Record<string, unknown>, ctx: BrowserActionContext, registry: BrowserActionRegistry, options?: RunBrowserPipelineOptions): Promise<BrowserActionResult>;
|