@xopcai/xopc 0.0.251 → 0.0.253
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 +8 -5
- package/README.zh-CN.md +8 -5
- package/dist/browser-ext/dist/background.js +358 -768
- package/dist/browser-ext/manifest.json +1 -2
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/plugin.js +3 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-DfBjTSo9.js → activity-store-CeS1bgXP.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Bo_dmLv8.js → agent-avatar-dicebear-BdF3HhCW.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Bs34Kp0K.js +1 -0
- package/dist/gateway/static/root/assets/{agents-yuUn8n-f.js → agents-DARlgjTm.js} +1 -1
- package/dist/gateway/static/root/assets/{api-zxpcJfgj.js → api-zMPeC0yU.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Cz56nrVF.js → app-management-settings-panel-BaAFln8W.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DxSws5U4.js → appearance-settings-CXvsoBlw.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BhgvfBJT.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-7k15-hqo.js → archive-plugin-C0o_mVQI.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-B-SFpjd9.js → attachment-load-B5Ry3tGL.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Qy36j19q.js → automations-page-DY5QAEQd.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BzX4lILP.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CPOZQt8F.js → binary-plugins-BydpEgBA.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DhvVlIp9.js → block-editor-D0CpUOMo.js} +3 -3
- package/dist/gateway/static/root/assets/browser-automation-inputs-DzbTsGI6.js +1 -0
- package/dist/gateway/static/root/assets/browser-automations-page-D7fZYjni.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-BBdMqxl0.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-D_WfftDW.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-bdRLT9KA.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-CX-yWwLD.js → channels-status-swr-BGGRTkn6.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-1PJoxRuV.js → chat-terminal-dock-_CP4nvlg.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-CPDjU5wU.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-CBCc6zFA.js → cron-expression-g2U8Rllf.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-u8K5Kt_N.js → date-picker-SmVlhtj_.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-y_i_cnpz.js → dependency-picker-D-0gcbbM.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DyL0JxLm.js → desktop-pet-Cl3JRIu6.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-d2d_IsyP.js → desktop-pet-settings-D7kvWQ9H.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DqIBKJwl.js → extension-debug-page-DtP2tJHY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DUW1xxj2.js → extension-page-CphZDdoT.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BHY9qaNw.js → extension-settings-page-CsxVLV4-.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CMNbl0FZ.js → gateway-config-swr-BW3Bx-aV.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-DxBZ05dX.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CR7Xg8As.js → gateway-startup-retry-DAq74TZe.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-7CD9iPR7.js → heartbeat-settings-DWcKsIoZ.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BdvLZKQZ.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-C5mn73ca.js → image-generation-api-MPuaXDRs.js} +1 -1
- package/dist/gateway/static/root/assets/index-C7RDs6S-.js +74 -0
- package/dist/gateway/static/root/assets/index-Cu8xqZQ9.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BtlqMleF.js → keyboard-shortcuts-settings-CfhaTqgE.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-BjxfkjxE.js → local-app-workbench-page-CR6asX7L.js} +2 -2
- package/dist/gateway/static/root/assets/{local-apps-page-B7xqQe2s.js → local-apps-page-g01W3kEK.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CF4erhjB.js → locale-store-BkeaPZpn.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-kACaPZKL.js → logs-page-ZP4QTWoC.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-A432siER.js → management-settings-DeGxJF_Z.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-Ca7BRBLL.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-CpvYiauZ.js → media-plugins-FmOhmzlD.js} +1 -1
- package/dist/gateway/static/root/assets/messages-C72stReU.js +3 -0
- package/dist/gateway/static/root/assets/{mobile-pairing-wizard-DyjVGngO.js → mobile-pairing-wizard-BXNbn05L.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-EeVeF4II.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-D7bMff96.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-B3FKzjR6.js → page-tabs-pyukZ1PJ.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DnjrwAHD.js → preview-open-alternatives-slFHoMUe.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-COcr_NUJ.js → product-open-page-CXa3FNNk.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BDF88VdN.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DeTD6pu1.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BsRBlji7.js → registry-api-CviQoUBf.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CxKrdQ6a.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-LO4wZ_dO.js → runtime-tools-settings-panel-O9D9o7-O.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-crcj4-Pm.js → schema-form-8FesicnL.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DUFJN-2t.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CcSYDjaH.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-Bl4MvTmq.js → settings-form-section-CBic9TFH.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DplrjZ6x.js → settings-page-Xz66_Mjg.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-C6DuwrP5.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-CJP1kURj.js → share-preview-page--JpjwB58.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-CemgzEi4.js → shares-settings-CovcdHSC.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CrHagTsE.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DsjcKg9Q.js → skills-page-fVKExKv5.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-D6gWBbvy.js → skills-page.utils-Yv9u3uJp.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-_eCXfqCo.js → system-settings-panel-CCWjVdc2.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-D0Z_K5JT.js → task-detail-page-I8hueJnG.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BOgkc_9D.js → theme-store-BtkaVpMm.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-W5mktxl1.js → tunnel-api-C__W9BaN.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-Na2DYzT3.js → use-autosave-Dow9RRcq.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-CU6nxmoM.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-OXweUxS_.js → voice-api-key-field-CvF3lEyx.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-C-ryeIxj.js → voice-config-api-BEUVAyM6.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BqOsO47I.js → work-discovery-overlay-B9PDfReq.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-B9S_lfT1.js → workflow-run-setup-panel-kWGFkhjz.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-B4Is5E42.js +5 -0
- package/dist/gateway/static/root/index.html +10 -10
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/new-session.js +9 -0
- package/dist/packages/realtime-protocol/src/voice.js +6 -1
- package/dist/src/agent/agent-manager.d.ts +2 -1
- package/dist/src/agent/agent-manager.js +26 -8
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/coding/repository-instructions.js +2 -2
- package/dist/src/agent/coding/workspace-revision.js +2 -2
- package/dist/src/agent/commands/command-isolation.js +2 -2
- package/dist/src/agent/embedded/execution-context.d.ts +2 -1
- package/dist/src/agent/embedded/execution-context.js +10 -4
- package/dist/src/agent/embedded/index.d.ts +1 -1
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +5 -4
- package/dist/src/agent/embedded/run-turn.js +22 -3
- package/dist/src/agent/embedded/types.d.ts +1 -1
- package/dist/src/agent/external-tools/composio-provider.d.ts +1 -0
- package/dist/src/agent/external-tools/composio-provider.js +64 -34
- package/dist/src/agent/external-tools/search-error.js +5 -3
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +6 -3
- package/dist/src/agent/service/process-direct-streaming.js +6 -3
- package/dist/src/agent/service.d.ts +2 -0
- package/dist/src/agent/service.js +25 -10
- package/dist/src/agent/service.types.d.ts +2 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +4 -0
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tool-manuals/browser.d.ts +1 -1
- package/dist/src/agent/tool-manuals/browser.js +15 -226
- package/dist/src/agent/tools/browser/tool/browser-use-tool.d.ts +4 -21
- package/dist/src/agent/tools/browser/tool/browser-use-tool.js +48 -165
- package/dist/src/agent/tools/browser/tool/schemas.d.ts +203 -16
- package/dist/src/agent/tools/browser/tool/schemas.js +146 -16
- package/dist/src/agent/tools/browser-automation-tool.d.ts +121 -0
- package/dist/src/agent/tools/browser-automation-tool.js +197 -0
- package/dist/src/agent/tools/clarify-tool.d.ts +17 -3
- package/dist/src/agent/tools/clarify-tool.js +27 -32
- package/dist/src/agent/tools/cli-clarify.js +23 -8
- package/dist/src/agent/tools/factory.d.ts +6 -9
- package/dist/src/agent/tools/factory.js +42 -59
- package/dist/src/agent/tools/index.d.ts +2 -2
- package/dist/src/agent/tools/index.js +3 -3
- package/dist/src/agent/tools/review-workspace.js +2 -2
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +3 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/automations/domain/defaults.js +1 -1
- package/dist/src/automations/domain/types.d.ts +5 -5
- package/dist/src/automations/domain/validation.d.ts +16 -16
- package/dist/src/automations/domain/validation.js +3 -3
- package/dist/src/automations/draft/automation-draft-validator.d.ts +4 -4
- package/dist/src/automations/draft/automation-draft-validator.js +1 -1
- package/dist/src/automations/service/action-executor.d.ts +1 -1
- package/dist/src/automations/service/action-executor.js +7 -7
- package/dist/src/browser/{recipes → automations}/index.d.ts +1 -0
- package/dist/src/browser/automations/index.js +4 -0
- package/dist/src/browser/automations/repository.d.ts +13 -0
- package/dist/src/browser/automations/repository.js +60 -0
- package/dist/src/browser/automations/runner.d.ts +17 -0
- package/dist/src/browser/automations/runner.js +173 -0
- package/dist/src/browser/automations/runtime-service.d.ts +6 -0
- package/dist/src/browser/automations/runtime-service.js +37 -0
- package/dist/src/browser/automations/schema.d.ts +144 -0
- package/dist/src/browser/automations/schema.js +135 -0
- package/dist/src/browser/automations/service.d.ts +146 -0
- package/dist/src/browser/automations/service.js +168 -0
- package/dist/src/browser/automations/types.d.ts +90 -0
- package/dist/src/browser/cache-dir-policy.d.ts +1 -1
- package/dist/src/browser/cache-dir-policy.js +1 -4
- package/dist/src/browser/drivers/browser-driver.d.ts +17 -0
- package/dist/src/browser/drivers/create-driver.d.ts +3 -0
- package/dist/src/browser/drivers/create-driver.js +84 -0
- package/dist/src/browser/drivers/extension-driver.d.ts +20 -0
- package/dist/src/browser/drivers/extension-driver.js +47 -0
- package/dist/src/browser/drivers/playwright-driver.d.ts +38 -0
- package/dist/src/browser/drivers/playwright-driver.js +406 -0
- package/dist/src/browser/index.d.ts +10 -15
- package/dist/src/browser/index.js +10 -15
- package/dist/src/browser/install-lock.d.ts +1 -2
- package/dist/src/browser/install-lock.js +3 -9
- package/dist/src/browser/install-progress.d.ts +1 -1
- package/dist/src/browser/observation/format.d.ts +2 -0
- package/dist/src/browser/observation/format.js +26 -0
- package/dist/src/browser/policy/approval-store.d.ts +17 -0
- package/dist/src/browser/policy/approval-store.js +62 -0
- package/dist/src/browser/policy/browser-policy.d.ts +3 -0
- package/dist/src/browser/policy/browser-policy.js +27 -0
- package/dist/src/browser/providers/browser-ext-install.d.ts +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +4 -6
- package/dist/src/browser/providers/browser-use.js +1 -1
- package/dist/src/browser/providers/browserbase.js +1 -1
- package/dist/src/browser/providers/extension-ws-acquire.d.ts +1 -4
- package/dist/src/browser/providers/extension-ws-acquire.js +1 -13
- package/dist/src/browser/providers/extension.d.ts +3 -22
- package/dist/src/browser/providers/extension.js +7 -15
- package/dist/src/browser/providers/index.d.ts +2 -2
- package/dist/src/browser/providers/index.js +3 -3
- package/dist/src/browser/providers/types.d.ts +0 -94
- package/dist/src/browser/readiness.d.ts +4 -22
- package/dist/src/browser/readiness.js +55 -118
- package/dist/src/browser/runtime/browser-runtime.d.ts +30 -0
- package/dist/src/browser/runtime/browser-runtime.js +362 -0
- package/dist/src/browser/url-policy.d.ts +3 -3
- package/dist/src/browser/url-policy.js +7 -6
- package/dist/src/browser/verification/expectation.d.ts +2 -0
- package/dist/src/browser/verification/expectation.js +17 -0
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +5 -1
- package/dist/src/cli/commands/browser-cli-helpers.d.ts +0 -6
- package/dist/src/cli/commands/browser-cli-helpers.js +11 -144
- package/dist/src/cli/commands/browser.d.ts +0 -5
- package/dist/src/cli/commands/browser.js +11 -152
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/node-version.js +25 -9
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/platform.d.ts +1 -0
- package/dist/src/cli/commands/platform.js +111 -0
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +10 -4
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +131 -84
- package/dist/src/config/schema.js +112 -59
- package/dist/src/connectors/composio-sessions.js +1 -3
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/marketplace.js +4 -0
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +5 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +5 -1
- package/dist/src/gateway/clarify-runtime.d.ts +7 -5
- package/dist/src/gateway/clarify-runtime.js +8 -11
- package/dist/src/gateway/ephemeral-clarification-waiter.d.ts +17 -0
- package/dist/src/gateway/ephemeral-clarification-waiter.js +46 -0
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +12 -26
- package/dist/src/gateway/hono/lib/config-payload.js +11 -40
- package/dist/src/gateway/hono/routes/agent-stream.js +44 -18
- package/dist/src/gateway/hono/routes/browser-automations.d.ts +3 -0
- package/dist/src/gateway/hono/routes/browser-automations.js +77 -0
- package/dist/src/gateway/hono/routes/browser-install.js +0 -32
- package/dist/src/gateway/hono/routes/browser.d.ts +0 -17
- package/dist/src/gateway/hono/routes/browser.js +46 -568
- package/dist/src/gateway/hono/routes/config-patch/misc.js +8 -1
- package/dist/src/gateway/hono/routes/config.js +0 -11
- package/dist/src/gateway/hono/routes/lazy-bundles.js +5 -5
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +10 -2
- package/dist/src/gateway/hono/routes/side-chats.js +24 -4
- package/dist/src/gateway/security/gateway-scopes.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +25 -36
- package/dist/src/gateway/service/agent-runner.js +103 -32
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +5 -2
- package/dist/src/gateway/service/session-input-coordinator.js +4 -1
- package/dist/src/gateway/service/sessions-api.js +1 -1
- package/dist/src/gateway/service.d.ts +8 -8
- package/dist/src/gateway/service.js +50 -37
- package/dist/src/gateway/side-chat/manager.d.ts +2 -1
- package/dist/src/gateway/side-chat/manager.js +5 -4
- package/dist/src/gateway/side-chat/run-service.d.ts +5 -1
- package/dist/src/gateway/side-chat/run-service.js +24 -23
- package/dist/src/gateway/side-chat/types.d.ts +3 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/platform/client.d.ts +121 -0
- package/dist/src/platform/client.js +108 -0
- package/dist/src/platform/contracts.d.ts +194 -0
- package/dist/src/platform/contracts.js +150 -0
- package/dist/src/platform/index.d.ts +4 -0
- package/dist/src/platform/index.js +9 -0
- package/dist/src/platform/resolution.d.ts +4 -0
- package/dist/src/platform/resolution.js +16 -0
- package/dist/src/platform/worker.d.ts +6 -0
- package/dist/src/platform/worker.js +75 -0
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/providers/xopc-cloud-config.js +3 -1
- package/dist/src/session/session-context-for-llm.js +41 -1
- package/dist/src/share/hosted-session-share.js +3 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.d.ts +41 -0
- package/dist/src/storage/sqlite/clarification-wait-repository.js +418 -0
- package/dist/src/storage/sqlite/index.d.ts +2 -1
- package/dist/src/storage/sqlite/index.js +2 -1
- package/dist/src/storage/sqlite/migrations/153_browser_control_v2.sql +45 -0
- package/dist/src/storage/sqlite/migrations/154_session_clarification_waits.sql +60 -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/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +16 -20
- package/dist/src/storage/sqlite/session-input-repository.d.ts +11 -6
- package/dist/src/tasks/home-query-service.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/tunnel/env.js +3 -1
- package/dist/src/voice/realtime/agentEngine.js +7 -2
- package/dist/src/voice/realtime/runtime.types.d.ts +5 -0
- package/dist/src/work-discovery/service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +7 -7
- package/skills/creative/hatch-pet/SKILL.md +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-kILWelNb.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BnizTdgs.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CZRKqSqY.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-pN5LbChY.js +0 -8
- package/dist/gateway/static/root/assets/browser-workflow-inputs-BX1-uM9L.js +0 -1
- package/dist/gateway/static/root/assets/browser-workflows-page-C65MI57t.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CJw2e16J.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-CRgjb4Ck.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Dcpdy06y.js +0 -2
- package/dist/gateway/static/root/assets/gateway-config-api-e3BRcgDx.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-Cheo0Rkc.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DVrTRqNc.js +0 -1
- package/dist/gateway/static/root/assets/index-B7CX4Qob.css +0 -2
- package/dist/gateway/static/root/assets/index-BHrpyJ4t.js +0 -72
- package/dist/gateway/static/root/assets/markdown-view-CQvzsE24.js +0 -201
- package/dist/gateway/static/root/assets/messages-Cf5hpZE6.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-CUd8O4K7.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BLQwd39W.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-NttW338u.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BzH8pjEz.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BxpjSDnL.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BLMaibOb.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BRvvKhoH.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DTOsxQC1.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BWYanBlQ.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-B_-SNat-.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-CNOT2Coo.js +0 -5
- package/dist/src/agent/tools/browser-recipe-tool.d.ts +0 -12
- package/dist/src/agent/tools/browser-recipe-tool.js +0 -113
- package/dist/src/browser/actions/extension-registry-bridge.d.ts +0 -5
- package/dist/src/browser/actions/extension-registry-bridge.js +0 -312
- package/dist/src/browser/actions/registry.d.ts +0 -5
- package/dist/src/browser/actions/registry.js +0 -741
- package/dist/src/browser/actions/types.d.ts +0 -65
- package/dist/src/browser/backend-from-config.d.ts +0 -22
- package/dist/src/browser/backend-from-config.js +0 -99
- package/dist/src/browser/browser-command-timeout.d.ts +0 -2
- package/dist/src/browser/browser-command-timeout.js +0 -11
- package/dist/src/browser/cdp-local-launcher.d.ts +0 -35
- package/dist/src/browser/cdp-local-launcher.js +0 -154
- package/dist/src/browser/cdp-supervisor.d.ts +0 -58
- package/dist/src/browser/cdp-supervisor.js +0 -133
- package/dist/src/browser/humanize.d.ts +0 -80
- package/dist/src/browser/humanize.js +0 -363
- package/dist/src/browser/manager.d.ts +0 -50
- package/dist/src/browser/manager.js +0 -251
- package/dist/src/browser/pipeline/output.d.ts +0 -35
- package/dist/src/browser/pipeline/output.js +0 -74
- package/dist/src/browser/pipeline/runner.d.ts +0 -27
- package/dist/src/browser/pipeline/runner.js +0 -453
- package/dist/src/browser/pipeline/schema.d.ts +0 -42
- package/dist/src/browser/pipeline/schema.js +0 -116
- package/dist/src/browser/pipeline/template.d.ts +0 -30
- package/dist/src/browser/pipeline/template.js +0 -112
- package/dist/src/browser/providers/cloakbrowser.d.ts +0 -83
- package/dist/src/browser/providers/cloakbrowser.js +0 -612
- package/dist/src/browser/recipes/index.js +0 -3
- package/dist/src/browser/recipes/repository.d.ts +0 -13
- package/dist/src/browser/recipes/repository.js +0 -81
- package/dist/src/browser/recipes/runtime-service.d.ts +0 -6
- package/dist/src/browser/recipes/runtime-service.js +0 -30
- package/dist/src/browser/recipes/service.d.ts +0 -36
- package/dist/src/browser/recipes/service.js +0 -186
- package/dist/src/browser/recipes/types.d.ts +0 -36
- package/dist/src/browser/schemas.d.ts +0 -53
- package/dist/src/browser/schemas.js +0 -68
- package/dist/src/browser/session-lifecycle.d.ts +0 -40
- package/dist/src/browser/session-lifecycle.js +0 -136
- package/dist/src/browser/snapshot-helpers.d.ts +0 -24
- package/dist/src/browser/snapshot-helpers.js +0 -70
- package/dist/src/browser/stealth.d.ts +0 -46
- package/dist/src/browser/stealth.js +0 -163
- package/dist/src/gateway/clarify-bridge.d.ts +0 -46
- package/dist/src/gateway/clarify-bridge.js +0 -111
- package/dist/src/gateway/hono/routes/browser-workflows.d.ts +0 -3
- package/dist/src/gateway/hono/routes/browser-workflows.js +0 -78
- /package/dist/src/browser/{actions → automations}/types.js +0 -0
- /package/dist/src/browser/{recipes/types.js → drivers/browser-driver.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_write_file_atomic, writeTextAtomic } from "../../../infra/write-file-atomic.js";
|
|
2
1
|
import { init_paths, resolveMcpOAuthPath } from "../../../config/paths.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomic } from "../../../infra/write-file-atomic.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { readFile, rm } from "node:fs/promises";
|
|
5
5
|
//#region src/agent/mcp/oauth/mcp-oauth-store.ts
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getClarificationResumeInput } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
1
2
|
import { getConnectionResumeInput } from "../../storage/sqlite/connection-wait-repository.js";
|
|
2
3
|
import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
|
|
3
4
|
import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
|
|
@@ -87,6 +88,8 @@ async function tryRunSlashCommand(deps, ctx, content, options) {
|
|
|
87
88
|
async function runDirectAgentTurn(deps, input) {
|
|
88
89
|
const turnId = input.runId ?? crypto.randomUUID();
|
|
89
90
|
const isConnectionResume = Boolean(getConnectionResumeInput(input.sessionKey, turnId));
|
|
91
|
+
const isClarificationResume = Boolean(getClarificationResumeInput(input.sessionKey, turnId));
|
|
92
|
+
const isResume = isConnectionResume || isClarificationResume;
|
|
90
93
|
const userPlain = extractAgentUserPlainText(input.userMessage);
|
|
91
94
|
const userContext = await deps.agentManager.prepareUserTurnContext(input.userMessage, input.sessionKey, turnId);
|
|
92
95
|
const sourceContexts = input.sourceContexts ?? [];
|
|
@@ -111,11 +114,11 @@ async function runDirectAgentTurn(deps, input) {
|
|
|
111
114
|
getConfig: () => deps.config,
|
|
112
115
|
abortSignal: input.abortSignal,
|
|
113
116
|
deadlineAtMs: input.deadlineAtMs,
|
|
114
|
-
beforeTurn:
|
|
117
|
+
beforeTurn: isResume ? void 0 : () => deps.agentManager.beginBackgroundReviewUserTurn(input.sessionKey),
|
|
115
118
|
onEvent: input.onEvent
|
|
116
119
|
});
|
|
117
|
-
if (!
|
|
118
|
-
if (!
|
|
120
|
+
if (!isResume) await deps.agentManager.afterAgentTurn(input.sessionKey, userPlain, turnId);
|
|
121
|
+
if (!isResume && result.stopReason !== "connection_required" && result.stopReason !== "clarification_required") deps.agentManager.scheduleBackgroundReviewAfterUserTurn(input.sessionKey);
|
|
119
122
|
return result;
|
|
120
123
|
}
|
|
121
124
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getClarificationResumeInput } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
1
2
|
import { getConnectionResumeInput } from "../../storage/sqlite/connection-wait-repository.js";
|
|
2
3
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
3
4
|
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
@@ -126,6 +127,8 @@ function pushAssistantReceipt(queue, text, runId, metadata) {
|
|
|
126
127
|
async function* runProcessDirectStreaming(deps, input) {
|
|
127
128
|
const sessionKey = input.sessionKey ?? "agent:main:main";
|
|
128
129
|
const isConnectionResume = Boolean(input.runId && getConnectionResumeInput(sessionKey, input.runId));
|
|
130
|
+
const isClarificationResume = Boolean(input.runId && getClarificationResumeInput(sessionKey, input.runId));
|
|
131
|
+
const isInternalResume = isConnectionResume || isClarificationResume;
|
|
129
132
|
const { channel, chatId } = await deps.resolveSessionEndpoint(sessionKey);
|
|
130
133
|
const context = deps.initDirectStreamingSession(sessionKey, channel, chatId, input.origin);
|
|
131
134
|
const queue = new AsyncQueue({
|
|
@@ -276,7 +279,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
276
279
|
if (sourceContext && !sourceContexts.some((context) => context.kind === sourceContext.kind && context.sourceId === sourceContext.sourceId)) sourceContexts.push(sourceContext);
|
|
277
280
|
}
|
|
278
281
|
}
|
|
279
|
-
if (channel === "webchat" && !
|
|
282
|
+
if (channel === "webchat" && !isInternalResume) {
|
|
280
283
|
pushVisible({
|
|
281
284
|
type: "user_message",
|
|
282
285
|
timestamp: userMessage.timestamp ?? Date.now(),
|
|
@@ -287,7 +290,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
287
290
|
if (textForAgent.trim()) deps.enqueueProvisionalSessionTitle?.(sessionKey, textForAgent);
|
|
288
291
|
}
|
|
289
292
|
const pendingUserMessage = sourceContexts.length > 0 ? injectSourceContextsIntoUserMessage(userMessage, sourceContexts) : userMessage;
|
|
290
|
-
if (!
|
|
293
|
+
if (!isInternalResume) setPendingTranscriptUserMessage(sessionKey, pendingUserMessage);
|
|
291
294
|
try {
|
|
292
295
|
const result = await deps.agentManager.withSkillCapabilities(sessionKey, skillTurn.activatedCapabilityNames, () => runDirectAgentTurn({
|
|
293
296
|
sessionStore: deps.sessionStore,
|
|
@@ -314,7 +317,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
314
317
|
content: formatStreamError(result.errorMessage)
|
|
315
318
|
});
|
|
316
319
|
} finally {
|
|
317
|
-
if (!
|
|
320
|
+
if (!isInternalResume) clearPendingTranscriptUserMessage(sessionKey, pendingUserMessage);
|
|
318
321
|
}
|
|
319
322
|
} catch (err) {
|
|
320
323
|
if (err instanceof AsyncQueueOverflowError) {
|
|
@@ -121,12 +121,14 @@ export declare class AgentService {
|
|
|
121
121
|
refreshUserProfileContext(): void;
|
|
122
122
|
getMemoryManager(): import("./memory/manager.js").MemoryManager;
|
|
123
123
|
getModelForSession(sessionKey: string): string;
|
|
124
|
+
getThinkingLevelForSession(sessionKey: string): ThinkingLevel;
|
|
124
125
|
/** Run a full tool-capable turn against a caller-owned, non-persistent transcript. */
|
|
125
126
|
runEphemeralTurn(params: {
|
|
126
127
|
executionSessionKey: string;
|
|
127
128
|
parentSessionKey: string;
|
|
128
129
|
runId: string;
|
|
129
130
|
content: string;
|
|
131
|
+
attachments?: InboundAttachmentInput[];
|
|
130
132
|
modelRef: string;
|
|
131
133
|
thinkingLevel?: ThinkingLevel;
|
|
132
134
|
transcriptRuntime: EmbeddedTranscriptRuntime;
|
|
@@ -2,10 +2,10 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
4
4
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
5
|
-
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
6
|
-
import { init_providers, resolveModel } from "../providers/index.js";
|
|
7
5
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
6
|
+
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
8
7
|
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
8
|
+
import { init_providers, resolveModel } from "../providers/index.js";
|
|
9
9
|
import { extractTextContent } from "./context/workspace.js";
|
|
10
10
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
11
11
|
import { getProjectForSession } from "../projects/workspace.js";
|
|
@@ -19,6 +19,7 @@ import "../user-model/index.js";
|
|
|
19
19
|
import { resolveAgentTurnTimeoutMs } from "./orchestration/run-agent-turn-with-timeout.js";
|
|
20
20
|
import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
21
21
|
import { persistInboundAttachments } from "../channels/attachments/inbound-persist.js";
|
|
22
|
+
import { buildTranscriptUserMessage, hydrateUserTurnForLlm } from "./inbound/attachment-pipeline.js";
|
|
22
23
|
import { runXopcEmbeddedTurn } from "./embedded/run-turn.js";
|
|
23
24
|
import { resolveResponseLanguageForSession } from "./prompt/response-language.js";
|
|
24
25
|
import { normalizeSkillInstallTarget } from "./skills/install-target.js";
|
|
@@ -229,7 +230,8 @@ var AgentService = class {
|
|
|
229
230
|
verboseLevel: config.verboseLevel,
|
|
230
231
|
gatewayClarify: config.gatewayClarify,
|
|
231
232
|
getAutomationService: config.getAutomationService,
|
|
232
|
-
|
|
233
|
+
getBrowserAutomationService: config.getBrowserAutomationService,
|
|
234
|
+
emitBrowserEvent: config.emitBrowserEvent,
|
|
233
235
|
getNotesService: config.getNotesService,
|
|
234
236
|
getProjectService: config.getProjectService,
|
|
235
237
|
getLocalAppService: config.getLocalAppService,
|
|
@@ -576,19 +578,31 @@ var AgentService = class {
|
|
|
576
578
|
getModelForSession(sessionKey) {
|
|
577
579
|
return this.modelManager.getModelForSession(sessionKey);
|
|
578
580
|
}
|
|
581
|
+
getThinkingLevelForSession(sessionKey) {
|
|
582
|
+
return this.agentManager.getOrCreateAgent(sessionKey).state.thinkingLevel ?? "medium";
|
|
583
|
+
}
|
|
579
584
|
/** Run a full tool-capable turn against a caller-owned, non-persistent transcript. */
|
|
580
585
|
async runEphemeralTurn(params) {
|
|
581
586
|
const agent = this.agentManager.getOrCreateAgent(params.parentSessionKey);
|
|
582
587
|
const workspaceDir = this.agentManager.getResolvedWorkspaceForSession(params.parentSessionKey);
|
|
583
588
|
const model = resolveModel(params.modelRef);
|
|
589
|
+
const prepared = await this.prepareInboundAttachments(params.executionSessionKey, params.attachments);
|
|
590
|
+
const userMessage = await buildTranscriptUserMessage({
|
|
591
|
+
text: params.content,
|
|
592
|
+
prepared,
|
|
593
|
+
sessionKey: params.parentSessionKey,
|
|
594
|
+
modelRef: params.modelRef,
|
|
595
|
+
config: this.effectiveAppConfig(),
|
|
596
|
+
agentManager: this.agentManager
|
|
597
|
+
});
|
|
598
|
+
const llmTurn = await hydrateUserTurnForLlm({
|
|
599
|
+
message: userMessage,
|
|
600
|
+
modelRef: params.modelRef
|
|
601
|
+
});
|
|
584
602
|
return runWithEmbeddedExecutionSession(params.executionSessionKey, () => runXopcEmbeddedTurn({
|
|
585
603
|
sessionKey: params.executionSessionKey,
|
|
586
604
|
runId: params.runId,
|
|
587
|
-
userMessage
|
|
588
|
-
role: "user",
|
|
589
|
-
content: params.content,
|
|
590
|
-
timestamp: Date.now()
|
|
591
|
-
},
|
|
605
|
+
userMessage,
|
|
592
606
|
model,
|
|
593
607
|
modelRef: params.modelRef,
|
|
594
608
|
tools: agent.state.tools,
|
|
@@ -599,8 +613,9 @@ var AgentService = class {
|
|
|
599
613
|
timeoutMs: resolveAgentTurnTimeoutMs(this.effectiveAppConfig(), params.parentSessionKey),
|
|
600
614
|
turnPolicy: this.agentManager.createAgentTurnPolicy(params.parentSessionKey),
|
|
601
615
|
abortSignal: params.abortSignal,
|
|
602
|
-
onEvent: params.onEvent
|
|
603
|
-
|
|
616
|
+
onEvent: params.onEvent,
|
|
617
|
+
images: llmTurn.images
|
|
618
|
+
}), params.runId);
|
|
604
619
|
}
|
|
605
620
|
async switchModelForSession(sessionKey, modelId) {
|
|
606
621
|
if (!await this.modelManager.switchModelForSession(sessionKey, modelId)) return false;
|
|
@@ -28,7 +28,8 @@ export interface AgentServiceConfig {
|
|
|
28
28
|
requestClarification: GatewayClarifyRequestFn;
|
|
29
29
|
};
|
|
30
30
|
getAutomationService?: () => AutomationService | undefined;
|
|
31
|
-
|
|
31
|
+
getBrowserAutomationService?: () => import('../browser/automations/index.js').BrowserAutomationService | undefined;
|
|
32
|
+
emitBrowserEvent?: (type: string, payload: unknown) => void;
|
|
32
33
|
/** Gateway: exposes first-class xopc product objects for the `xopc_use` tool. */
|
|
33
34
|
getNotesService?: () => NotesService | undefined;
|
|
34
35
|
getProjectService?: () => ProjectService | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { init_workspace_defaults, resolveDefaultAgentWorkspaceDir } from "../../config/workspace-defaults.js";
|
|
4
|
-
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
4
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
|
+
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
6
6
|
import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
|
|
7
7
|
import { effectiveWorkspacePathForSession, projectWorkspacePath } from "../../session/session-workspace.js";
|
|
8
8
|
import { getProjectForSession } from "../../projects/workspace.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
1
|
import { init_paths, resolveSkillsLockPath } from "../../config/paths.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
//#region src/agent/skills/hub-lock.ts
|
|
5
5
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { init_resolution, resolveConnectedPlatformEndpoint } from "../../../../../platform/resolution.js";
|
|
1
2
|
import { MAX_SKILL_ZIP_BYTES, isValidSkillId } from "../../../managed-store.js";
|
|
2
3
|
import { MAX_EXTENSION_STORE_ZIP_BYTES } from "../../../../../extensions/store-zip-limits.js";
|
|
3
4
|
import { createHash } from "node:crypto";
|
|
@@ -8,12 +9,15 @@ import { createHash } from "node:crypto";
|
|
|
8
9
|
*
|
|
9
10
|
* Facade: {@link ../../../skills-marketplace.js}.
|
|
10
11
|
*/
|
|
12
|
+
init_resolution();
|
|
11
13
|
const DEFAULT_STORE_BASE = "https://store.xopc.ai";
|
|
12
14
|
function resolveSkillsStoreBaseUrl(config) {
|
|
13
15
|
const env = process.env.XOPC_SKILLS_STORE_URL?.trim();
|
|
14
16
|
if (env) try {
|
|
15
17
|
return normalizeBaseUrl(new URL(env).toString());
|
|
16
18
|
} catch {}
|
|
19
|
+
const fromPlatform = resolveConnectedPlatformEndpoint("storeApi");
|
|
20
|
+
if (fromPlatform) return normalizeBaseUrl(fromPlatform);
|
|
17
21
|
const fromConfig = config.gateway?.skillsStoreBaseUrl?.trim();
|
|
18
22
|
if (fromConfig) try {
|
|
19
23
|
return normalizeBaseUrl(new URL(fromConfig).toString());
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
4
|
-
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
5
4
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
6
|
-
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
7
|
-
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
8
5
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
|
+
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
9
7
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
10
8
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
11
9
|
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
10
|
+
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
12
11
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
12
|
+
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
13
13
|
//#region src/agent/tasks/task-judge-service.ts
|
|
14
14
|
init_schema();
|
|
15
15
|
init_providers();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const browserUseManual = "# Browser Tool Manual\n\n##
|
|
1
|
+
export declare const browserUseManual = "# Browser Tool Manual\n\n## browser_use\n\nUse one typed action per call. Start with `observe` or `navigate`. Every observation returns a `sessionId`, `revision`, and semantic element refs. Element actions must use refs from the newest revision; never invent refs.\n\nAvailable actions:\n\n- `observe`: return URL, title, interactive semantic nodes, and changes. Set `visual` to `always` only when visual evidence is needed.\n- `navigate`: open an HTTP(S) URL and optionally verify an expectation.\n- `click`, `fill`, `select`: act on a semantic ref with its observation revision.\n- `press`, `scroll`: act on an optional ref or the active page.\n- `wait`: wait for page idle, text, or a ref visibility state.\n- `upload`: attach workspace files to a file input. Local approval may be required.\n- `tabs`: list, create, activate, or close task-owned tabs.\n- `sequence`: run a short list of same-document ref actions.\n- `close`: close the task-owned browser session.\n\nThe tool does not accept CSS, XPath, JavaScript, cookie, storage, or network-inspection commands. Re-observe after navigation or a stale-observation response. Cross-domain, upload, destructive, and external-effect actions follow the configured local-owner approval policy. Sensitive fields expose only their semantic identity; their values are redacted and filling them requires approval.\n\n## browser_automation\n\nReusable browser automations are strict JSON. They use semantic `role` plus `name` or `nameIncludes` targets and an exact `allowedDomains` list. Input templates use `${input.name}`. Save only a flow that has been run and verified; never store passwords, one-time codes, recovery codes, or payment details.\n";
|
|
@@ -1,238 +1,27 @@
|
|
|
1
1
|
//#region src/agent/tool-manuals/browser.ts
|
|
2
2
|
const browserUseManual = `# Browser Tool Manual
|
|
3
3
|
|
|
4
|
-
##
|
|
4
|
+
## browser_use
|
|
5
5
|
|
|
6
|
-
\`
|
|
6
|
+
Use one typed action per call. Start with \`observe\` or \`navigate\`. Every observation returns a \`sessionId\`, \`revision\`, and semantic element refs. Element actions must use refs from the newest revision; never invent refs.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|------|---------|
|
|
10
|
-
| \`command\` | Run a single browser action |
|
|
11
|
-
| \`pipeline\` | Run a multi-step YAML flow |
|
|
12
|
-
| \`inspect\` | Read current page state |
|
|
13
|
-
| \`close\` | Close the browser session |
|
|
8
|
+
Available actions:
|
|
14
9
|
|
|
15
|
-
|
|
10
|
+
- \`observe\`: return URL, title, interactive semantic nodes, and changes. Set \`visual\` to \`always\` only when visual evidence is needed.
|
|
11
|
+
- \`navigate\`: open an HTTP(S) URL and optionally verify an expectation.
|
|
12
|
+
- \`click\`, \`fill\`, \`select\`: act on a semantic ref with its observation revision.
|
|
13
|
+
- \`press\`, \`scroll\`: act on an optional ref or the active page.
|
|
14
|
+
- \`wait\`: wait for page idle, text, or a ref visibility state.
|
|
15
|
+
- \`upload\`: attach workspace files to a file input. Local approval may be required.
|
|
16
|
+
- \`tabs\`: list, create, activate, or close task-owned tabs.
|
|
17
|
+
- \`sequence\`: run a short list of same-document ref actions.
|
|
18
|
+
- \`close\`: close the task-owned browser session.
|
|
16
19
|
|
|
17
|
-
-
|
|
18
|
-
- Capture screenshots or page content
|
|
19
|
-
- Run multi-step automation flows
|
|
20
|
-
- Extract data from pages
|
|
20
|
+
The tool does not accept CSS, XPath, JavaScript, cookie, storage, or network-inspection commands. Re-observe after navigation or a stale-observation response. Cross-domain, upload, destructive, and external-effect actions follow the configured local-owner approval policy. Sensitive fields expose only their semantic identity; their values are redacted and filling them requires approval.
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## browser_automation
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
\`\`\`json
|
|
27
|
-
{
|
|
28
|
-
"mode": "command",
|
|
29
|
-
"command": "<action>",
|
|
30
|
-
"args": { ... }
|
|
31
|
-
}
|
|
32
|
-
\`\`\`
|
|
33
|
-
|
|
34
|
-
### Available commands
|
|
35
|
-
|
|
36
|
-
| Command | Description | Key arguments |
|
|
37
|
-
|---------|-------------|---------------|
|
|
38
|
-
| \`open\` / \`navigate\` | Open a URL | \`url\`, \`wait_until\` |
|
|
39
|
-
| \`state\` / \`snapshot\` | ARIA snapshot of the page | \`selector\`, \`maxLength\` |
|
|
40
|
-
| \`click\` | Click an element | \`selector\` / \`text\` / \`role\` |
|
|
41
|
-
| \`type\` / \`input\` | Type text | \`selector\` / \`label\`, \`text\`, \`pressEnter\` |
|
|
42
|
-
| \`scroll\` | Scroll the page | \`direction\`, \`amount\` |
|
|
43
|
-
| \`screenshot\` | Screenshot | \`selector\`, \`full_page\`, \`path\` |
|
|
44
|
-
| \`back\` | Go back | \`waitFor\` |
|
|
45
|
-
| \`keys\` / \`press\` | Keyboard input | \`key\` |
|
|
46
|
-
| \`console\` / \`eval\` | Run JavaScript | \`javascript\` |
|
|
47
|
-
| \`images\` | Collect images on the page | \`selector\`, \`maxImages\` |
|
|
48
|
-
| \`wait\` | Wait for element/text/function/time | \`selector\` / \`text\` / \`function\` / \`ms\`, \`state\`, \`timeout_ms\` |
|
|
49
|
-
| \`wait_for_navigation\` | Wait for page load state | \`wait_until\`, \`timeout_ms\` |
|
|
50
|
-
| \`wait_for_network_idle\` | Wait until network is idle | \`timeout_ms\` |
|
|
51
|
-
| \`element_text\` | Read element text | \`selector\` |
|
|
52
|
-
| \`element_attribute\` | Read element attribute | \`selector\`, \`attribute\` |
|
|
53
|
-
| \`bounding_box\` | Read element box | \`selector\` |
|
|
54
|
-
| \`network_start\` / \`network_events\` / \`network_stop\` | Capture network events | \`url_pattern\`, \`include_body\` |
|
|
55
|
-
| \`dialog\` | Handle dialogs | \`action\` (accept/dismiss) |
|
|
56
|
-
| \`close\` | Close the current page | — |
|
|
57
|
-
|
|
58
|
-
### Element targeting
|
|
59
|
-
|
|
60
|
-
Prefer, in order:
|
|
61
|
-
|
|
62
|
-
1. **ARIA role**: most stable, e.g. \`"role": "button:Submit"\`
|
|
63
|
-
2. **Visible text**, e.g. \`"text": "Sign In"\`
|
|
64
|
-
3. **CSS selector**, e.g. \`"selector": "#login-btn"\`
|
|
65
|
-
|
|
66
|
-
Guidelines:
|
|
67
|
-
|
|
68
|
-
- Use \`inspect\` or \`state\` first to get a snapshot
|
|
69
|
-
- Pick locators from ARIA info in the snapshot
|
|
70
|
-
- Avoid dynamic class names when possible
|
|
71
|
-
|
|
72
|
-
## Inspect mode
|
|
73
|
-
|
|
74
|
-
Before acting, understand the current page:
|
|
75
|
-
|
|
76
|
-
\`\`\`json
|
|
77
|
-
{ "mode": "inspect" }
|
|
78
|
-
\`\`\`
|
|
79
|
-
|
|
80
|
-
Returns: current URL, title, ARIA snapshot.
|
|
81
|
-
|
|
82
|
-
**Best practice**: after each navigation, inspect, then choose the next step.
|
|
83
|
-
|
|
84
|
-
## Pipeline mode
|
|
85
|
-
|
|
86
|
-
For multi-step, reusable flows. Uses a brocli-style YAML DSL.
|
|
87
|
-
|
|
88
|
-
### Run from file
|
|
89
|
-
|
|
90
|
-
\`\`\`json
|
|
91
|
-
{
|
|
92
|
-
"mode": "pipeline",
|
|
93
|
-
"pipeline": {
|
|
94
|
-
"path": "./browser-flow.yaml",
|
|
95
|
-
"args": { "url": "https://example.com" }
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
\`\`\`
|
|
99
|
-
|
|
100
|
-
### Run inline YAML
|
|
101
|
-
|
|
102
|
-
\`\`\`json
|
|
103
|
-
{
|
|
104
|
-
"mode": "pipeline",
|
|
105
|
-
"pipeline": {
|
|
106
|
-
"yaml": "name: quick-check\\npipeline:\\n - navigate:\\n url: https://example.com\\n - screenshot:\\n full_page: true",
|
|
107
|
-
"dryRun": false
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
\`\`\`
|
|
111
|
-
|
|
112
|
-
### YAML layout
|
|
113
|
-
|
|
114
|
-
\`\`\`yaml
|
|
115
|
-
name: pipeline-name
|
|
116
|
-
description: What this flow does
|
|
117
|
-
timeoutSeconds: 60
|
|
118
|
-
include:
|
|
119
|
-
- ./shared-login.yaml
|
|
120
|
-
args:
|
|
121
|
-
url:
|
|
122
|
-
type: string
|
|
123
|
-
required: true
|
|
124
|
-
query:
|
|
125
|
-
type: string
|
|
126
|
-
default: "hello"
|
|
127
|
-
pipeline:
|
|
128
|
-
- navigate:
|
|
129
|
-
url: \${{ args.url }}
|
|
130
|
-
wait_until: domcontentloaded
|
|
131
|
-
- wait:
|
|
132
|
-
selector: input[name="q"]
|
|
133
|
-
- type:
|
|
134
|
-
selector: input[name="q"]
|
|
135
|
-
text: \${{ args.query }}
|
|
136
|
-
- press:
|
|
137
|
-
key: Enter
|
|
138
|
-
- wait:
|
|
139
|
-
selector: body
|
|
140
|
-
timeout_ms: 10000
|
|
141
|
-
- element_text:
|
|
142
|
-
selector: h1
|
|
143
|
-
- assert:
|
|
144
|
-
contains: Results
|
|
145
|
-
- screenshot:
|
|
146
|
-
path: ./artifacts/result.png
|
|
147
|
-
full_page: true
|
|
148
|
-
- output:
|
|
149
|
-
value:
|
|
150
|
-
screenshot: ./artifacts/result.png
|
|
151
|
-
on_error:
|
|
152
|
-
- screenshot:
|
|
153
|
-
path: ./artifacts/error.png
|
|
154
|
-
full_page: true
|
|
155
|
-
\`\`\`
|
|
156
|
-
|
|
157
|
-
### Authoring rules
|
|
158
|
-
|
|
159
|
-
1. One action per step
|
|
160
|
-
2. Use \`\${{ args.xxx }}\` for parameters
|
|
161
|
-
3. Use \`\${{ last }}\` or \`\${{ last | json }}\` for the previous step result
|
|
162
|
-
4. Use \`\${{ outputs.0 }}\` for prior \`output\` values and \`\${{ vars.name }}\` for values from \`set_var\`
|
|
163
|
-
5. Use \`include\` for shared YAML fragments; relative includes resolve from the current pipeline file
|
|
164
|
-
6. Use \`on_error\` to collect diagnostics after failure
|
|
165
|
-
|
|
166
|
-
### Stable pipeline actions
|
|
167
|
-
|
|
168
|
-
\`\`\`yaml
|
|
169
|
-
pipeline:
|
|
170
|
-
- network_start:
|
|
171
|
-
url_pattern: /api/search
|
|
172
|
-
include_body: true
|
|
173
|
-
- click:
|
|
174
|
-
text: Search
|
|
175
|
-
- wait_for_network_idle:
|
|
176
|
-
timeout_ms: 10000
|
|
177
|
-
- collect: {}
|
|
178
|
-
- filter:
|
|
179
|
-
path: type
|
|
180
|
-
equals: response
|
|
181
|
-
- limit:
|
|
182
|
-
count: 3
|
|
183
|
-
- output:
|
|
184
|
-
value: \${{ last }}
|
|
185
|
-
\`\`\`
|
|
186
|
-
|
|
187
|
-
Control flow:
|
|
188
|
-
|
|
189
|
-
\`\`\`yaml
|
|
190
|
-
pipeline:
|
|
191
|
-
- retry:
|
|
192
|
-
times: 3
|
|
193
|
-
delay_ms: 500
|
|
194
|
-
pipeline:
|
|
195
|
-
- wait:
|
|
196
|
-
selector: button.submit
|
|
197
|
-
timeout_ms: 3000
|
|
198
|
-
- click:
|
|
199
|
-
selector: button.submit
|
|
200
|
-
- if:
|
|
201
|
-
condition: \${{ last }}
|
|
202
|
-
then:
|
|
203
|
-
- output:
|
|
204
|
-
value: clicked
|
|
205
|
-
else:
|
|
206
|
-
- output:
|
|
207
|
-
value: missing
|
|
208
|
-
\`\`\`
|
|
209
|
-
|
|
210
|
-
### Validate without running
|
|
211
|
-
|
|
212
|
-
\`\`\`json
|
|
213
|
-
{
|
|
214
|
-
"mode": "pipeline",
|
|
215
|
-
"pipeline": {
|
|
216
|
-
"yaml": "...",
|
|
217
|
-
"dryRun": true
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
\`\`\`
|
|
221
|
-
|
|
222
|
-
## Recovery when something fails
|
|
223
|
-
|
|
224
|
-
1. \`inspect\` to see current state
|
|
225
|
-
2. Confirm the URL (redirects may have changed it)
|
|
226
|
-
3. Use the snapshot to see if the page finished loading
|
|
227
|
-
4. \`screenshot\` for visual debugging
|
|
228
|
-
5. \`wait\` for elements, then retry
|
|
229
|
-
|
|
230
|
-
## Safety
|
|
231
|
-
|
|
232
|
-
- Do not put API keys or tokens in URLs
|
|
233
|
-
- Do not target private IPs / localhost unless configuration allows it
|
|
234
|
-
- Cloud metadata endpoints are always blocked
|
|
235
|
-
- For destructive actions (submit forms, delete data), confirm intent with the user first
|
|
24
|
+
Reusable browser automations are strict JSON. They use semantic \`role\` plus \`name\` or \`nameIncludes\` targets and an exact \`allowedDomains\` list. Input templates use \`\${input.name}\`. Save only a flow that has been run and verified; never store passwords, one-time codes, recovery codes, or payment details.
|
|
236
25
|
`;
|
|
237
26
|
//#endregion
|
|
238
27
|
export { browserUseManual };
|
|
@@ -1,27 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* browser_use — unified browser AgentTool.
|
|
3
|
-
*
|
|
4
|
-
* Modes: command | inspect | close.
|
|
5
|
-
* Replaces the 14 fine-grained browser_* tools with a single entry point.
|
|
6
|
-
*/
|
|
7
1
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
8
|
-
import type { Config } from '../../../../config/schema.js';
|
|
9
|
-
import type { BrowserManager } from '../../../../browser/manager.js';
|
|
10
|
-
import type { CdpSupervisor } from '../../../../browser/cdp-supervisor.js';
|
|
11
|
-
import type { Page } from 'playwright-core';
|
|
12
2
|
import type { BrowserNotReadyError } from '../../../../browser/readiness.js';
|
|
3
|
+
import type { BrowserRuntime } from '../../../../browser/runtime/browser-runtime.js';
|
|
4
|
+
import { BrowserUseSchema } from './schemas.js';
|
|
13
5
|
export interface CreateBrowserUseToolDeps {
|
|
14
|
-
|
|
15
|
-
getPageForTask: () => Promise<Page>;
|
|
6
|
+
getRuntime: () => BrowserRuntime;
|
|
16
7
|
getTaskId: () => string;
|
|
17
|
-
getConfig: () => Config | undefined;
|
|
18
|
-
getSupervisor?: () => CdpSupervisor | undefined;
|
|
19
|
-
notifyBrowserPageClosed?: (taskId: string) => void;
|
|
20
|
-
/**
|
|
21
|
-
* Preflight readiness check. Returns `null` when the configured backend is
|
|
22
|
-
* usable, otherwise a structured hint the chat surface renders as a setup
|
|
23
|
-
* card. Cache the result upstream (~30s) so back-to-back calls don't reprobe.
|
|
24
|
-
*/
|
|
25
8
|
getReadiness?: () => Promise<BrowserNotReadyError | null>;
|
|
26
9
|
}
|
|
27
|
-
export declare function createBrowserUseTool(deps: CreateBrowserUseToolDeps): AgentTool<
|
|
10
|
+
export declare function createBrowserUseTool(deps: CreateBrowserUseToolDeps): AgentTool<typeof BrowserUseSchema, Record<string, unknown>>;
|