@ddwang/magnitude-core 0.3.1-ddwang.2 → 0.3.1-ddwang.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +2 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.mjs +1 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.cjs +2704 -1522
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +188 -50
- package/dist/index.d.ts +1147 -23
- package/dist/index.mjs +2527 -1362
- package/dist/index.mjs.map +1 -0
- package/node_modules/patchright-core/README.md +3 -0
- package/node_modules/patchright-core/ThirdPartyNotices.txt +13 -0
- package/node_modules/patchright-core/bin/install_media_pack.ps1 +5 -0
- package/node_modules/patchright-core/bin/install_webkit_wsl.ps1 +33 -0
- package/node_modules/patchright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/node_modules/patchright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/node_modules/patchright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/node_modules/patchright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/node_modules/patchright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/node_modules/patchright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/node_modules/patchright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/node_modules/patchright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/node_modules/patchright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/node_modules/patchright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/node_modules/patchright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/node_modules/patchright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/node_modules/patchright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/node_modules/patchright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/node_modules/patchright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/node_modules/patchright-core/browsers.json +52 -0
- package/node_modules/patchright-core/cli.js +22 -0
- package/node_modules/patchright-core/index.d.ts +17 -0
- package/node_modules/patchright-core/index.js +17 -0
- package/node_modules/patchright-core/index.mjs +28 -0
- package/node_modules/patchright-core/lib/bootstrap.js +149 -0
- package/node_modules/patchright-core/lib/coreBundle.js +80653 -0
- package/node_modules/patchright-core/lib/entry/cliDaemon.js +5 -0
- package/node_modules/patchright-core/lib/entry/dashboardApp.js +3 -0
- package/node_modules/patchright-core/lib/entry/mcp.js +10 -0
- package/node_modules/patchright-core/lib/entry/oopBrowserDownload.js +3 -0
- package/node_modules/patchright-core/lib/package.js +50 -0
- package/node_modules/patchright-core/lib/server/chromium/appIcon.png +0 -0
- package/node_modules/patchright-core/lib/server/electron/loader.js +112 -0
- package/node_modules/patchright-core/lib/serverRegistry.js +1939 -0
- package/node_modules/patchright-core/lib/serverRegistry.js.LICENSE +65 -0
- package/node_modules/patchright-core/lib/tools/cli-client/channelSessions.js +141 -0
- package/node_modules/patchright-core/lib/tools/cli-client/cli.js +7 -0
- package/node_modules/patchright-core/lib/tools/cli-client/help.json +808 -0
- package/node_modules/patchright-core/lib/tools/cli-client/minimist.js +128 -0
- package/node_modules/patchright-core/lib/tools/cli-client/output.js +352 -0
- package/node_modules/patchright-core/lib/tools/cli-client/program.js +422 -0
- package/node_modules/patchright-core/lib/tools/cli-client/registry.js +180 -0
- package/node_modules/patchright-core/lib/tools/cli-client/session.js +261 -0
- package/node_modules/patchright-core/lib/tools/dashboard/appIcon.png +0 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-cli/SKILL.md +493 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/element-attributes.md +23 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/pr-attachments.md +60 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/request-mocking.md +87 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/running-code.md +245 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/session-management.md +227 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/storage-state.md +275 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/test-generation.md +433 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/tracing.md +139 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/video-recording.md +216 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/SKILL.md +136 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +144 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/migration.md +89 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/react.md +69 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/vue.md +77 -0
- package/node_modules/patchright-core/lib/tools/skills/playwright-trace/SKILL.md +174 -0
- package/node_modules/patchright-core/lib/tools/utils/extension.js +112 -0
- package/node_modules/patchright-core/lib/tools/utils/socketConnection.js +108 -0
- package/node_modules/patchright-core/lib/utilsBundle.js +86225 -0
- package/node_modules/patchright-core/lib/utilsBundle.js.LICENSE +1890 -0
- package/node_modules/patchright-core/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
- package/node_modules/patchright-core/lib/vite/dashboard/assets/codeMirrorModule-CQ8RZGBm.js +32 -0
- package/node_modules/patchright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
- package/node_modules/patchright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
- package/node_modules/patchright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
- package/node_modules/patchright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
- package/node_modules/patchright-core/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
- package/node_modules/patchright-core/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
- package/node_modules/patchright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
- package/node_modules/patchright-core/lib/vite/dashboard/index.html +29 -0
- package/node_modules/patchright-core/lib/vite/dashboard/playwright-logo.svg +24 -0
- package/node_modules/patchright-core/lib/vite/htmlReport/index.html +16 -0
- package/node_modules/patchright-core/lib/vite/htmlReport/report.css +2 -0
- package/node_modules/patchright-core/lib/vite/htmlReport/report.js +32 -0
- package/node_modules/patchright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
- package/node_modules/patchright-core/lib/vite/recorder/assets/codeMirrorModule-GBnsXk4c.js +32 -0
- package/node_modules/patchright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/node_modules/patchright-core/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
- package/node_modules/patchright-core/lib/vite/recorder/assets/index-CVDOfo-j.js +129 -0
- package/node_modules/patchright-core/lib/vite/recorder/index.html +29 -0
- package/node_modules/patchright-core/lib/vite/recorder/playwright-logo.svg +9 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/assets/codeMirrorModule-G79327TW.js +32 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/assets/defaultSettingsView-D9EV0iaS.js +184 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/assets/xtermModule-Al_u-Nk5.js +7 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/defaultSettingsView.C8BeHuxd.css +1 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/index.CMB2-c8e.js +1 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/index.html +44 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/snapshot.html +10 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/sw.bundle.js +4 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/uiMode.C3yLoy2G.js +5 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/uiMode.CyMfwkXJ.css +1 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/uiMode.html +18 -0
- package/node_modules/patchright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
- package/node_modules/patchright-core/lib/webp_codec.LICENSE +173 -0
- package/node_modules/patchright-core/lib/webp_codec.wasm +0 -0
- package/node_modules/patchright-core/lib/xdg-open +1267 -0
- package/node_modules/patchright-core/package.json +34 -0
- package/node_modules/patchright-core/types/protocol.d.ts +24776 -0
- package/node_modules/patchright-core/types/structs.d.ts +52 -0
- package/node_modules/patchright-core/types/types.d.ts +27167 -0
- package/node_modules/playwright/.bun-tag-91d746a6045e143f +0 -0
- package/node_modules/playwright/README.md +300 -0
- package/node_modules/playwright/ThirdPartyNotices.txt +14 -0
- package/node_modules/playwright/cli.js +19 -0
- package/node_modules/playwright/index.d.ts +17 -0
- package/node_modules/playwright/index.js +17 -0
- package/node_modules/playwright/index.mjs +18 -0
- package/node_modules/playwright/lib/agents/agentParser.js +89 -0
- package/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
- package/node_modules/playwright/lib/agents/generateAgents.js +395 -0
- package/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
- package/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
- package/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
- package/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
- package/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +56 -0
- package/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
- package/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +74 -0
- package/node_modules/playwright/lib/cli/reportActions.js +78 -0
- package/node_modules/playwright/lib/cli/testActions.js +217 -0
- package/node_modules/playwright/lib/common/index.js +2937 -0
- package/node_modules/playwright/lib/common/index.js.txt +33 -0
- package/node_modules/playwright/lib/errorContext.js +129 -0
- package/node_modules/playwright/lib/globals.js +58 -0
- package/node_modules/playwright/lib/index.js +827 -0
- package/node_modules/playwright/lib/isomorphic.js +260 -0
- package/node_modules/playwright/lib/isomorphic.js.txt +9 -0
- package/node_modules/playwright/lib/loader/loaderProcessEntry.js +34 -0
- package/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt +9 -0
- package/node_modules/playwright/lib/matchers/expect.js +13496 -0
- package/node_modules/playwright/lib/matchers/expect.js.LICENSE +640 -0
- package/node_modules/playwright/lib/matchers/expect.js.txt +67 -0
- package/node_modules/playwright/lib/mcp/test/browserBackend.js +135 -0
- package/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
- package/node_modules/playwright/lib/mcp/test/plannerTools.js +150 -0
- package/node_modules/playwright/lib/mcp/test/seed.js +82 -0
- package/node_modules/playwright/lib/mcp/test/streams.js +44 -0
- package/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
- package/node_modules/playwright/lib/mcp/test/testContext.js +306 -0
- package/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
- package/node_modules/playwright/lib/mcp/test/testTools.js +98 -0
- package/node_modules/playwright/lib/package.js +47 -0
- package/node_modules/playwright/lib/program.js +242 -0
- package/node_modules/playwright/lib/runner/index.js +8721 -0
- package/node_modules/playwright/lib/runner/index.js.txt +62 -0
- package/node_modules/playwright/lib/transform/babelBundle.js +72490 -0
- package/node_modules/playwright/lib/transform/babelBundle.js.LICENSE +2384 -0
- package/node_modules/playwright/lib/transform/babelBundle.js.txt +328 -0
- package/node_modules/playwright/lib/transform/esmLoader.js +8213 -0
- package/node_modules/playwright/lib/transform/esmLoader.js.LICENSE +355 -0
- package/node_modules/playwright/lib/transform/esmLoader.js.txt +60 -0
- package/node_modules/playwright/lib/util.js +373 -0
- package/node_modules/playwright/lib/worker/workerProcessEntry.js +1860 -0
- package/node_modules/playwright/lib/worker/workerProcessEntry.js.txt +19 -0
- package/node_modules/playwright/package.json +50 -0
- package/node_modules/playwright/test.d.ts +18 -0
- package/node_modules/playwright/test.js +24 -0
- package/node_modules/playwright/test.mjs +35 -0
- package/node_modules/playwright/types/test.d.ts +11191 -0
- package/node_modules/playwright/types/testReporter.d.ts +950 -0
- package/package.json +21 -12
- package/dist/actions/desktopActions.d.ts +0 -58
- package/dist/actions/desktopActions.js +0 -155
- package/dist/actions/index.d.ts +0 -27
- package/dist/actions/index.js +0 -11
- package/dist/actions/memoryActions.d.ts +0 -9
- package/dist/actions/memoryActions.js +0 -34
- package/dist/actions/taskActions.d.ts +0 -8
- package/dist/actions/taskActions.js +0 -27
- package/dist/actions/types.d.ts +0 -35
- package/dist/actions/types.js +0 -5
- package/dist/actions/util.d.ts +0 -21
- package/dist/actions/util.js +0 -280
- package/dist/actions/webActions.d.ts +0 -87
- package/dist/actions/webActions.js +0 -214
- package/dist/actions/webActions.test.d.ts +0 -1
- package/dist/actions/webActions.test.js +0 -43
- package/dist/agent/browserAgent.d.ts +0 -31
- package/dist/agent/browserAgent.js +0 -136
- package/dist/agent/errors.d.ts +0 -22
- package/dist/agent/errors.js +0 -97
- package/dist/agent/index.d.ts +0 -64
- package/dist/agent/index.js +0 -505
- package/dist/agent/narrator.d.ts +0 -4
- package/dist/agent/narrator.js +0 -63
- package/dist/agent/pause.test.d.ts +0 -1
- package/dist/agent/pause.test.js +0 -194
- package/dist/ai/baml_client/async_client.d.ts +0 -64
- package/dist/ai/baml_client/async_client.js +0 -284
- package/dist/ai/baml_client/async_request.d.ts +0 -39
- package/dist/ai/baml_client/async_request.js +0 -134
- package/dist/ai/baml_client/config.d.ts +0 -11
- package/dist/ai/baml_client/config.js +0 -20
- package/dist/ai/baml_client/globals.d.ts +0 -16
- package/dist/ai/baml_client/globals.js +0 -37
- package/dist/ai/baml_client/index.d.ts +0 -17
- package/dist/ai/baml_client/index.js +0 -42
- package/dist/ai/baml_client/inlinedbaml.d.ts +0 -19
- package/dist/ai/baml_client/inlinedbaml.js +0 -31
- package/dist/ai/baml_client/parser.d.ts +0 -53
- package/dist/ai/baml_client/parser.js +0 -86
- package/dist/ai/baml_client/partial_types.d.ts +0 -61
- package/dist/ai/baml_client/partial_types.js +0 -10
- package/dist/ai/baml_client/sync_client.d.ts +0 -57
- package/dist/ai/baml_client/sync_client.js +0 -142
- package/dist/ai/baml_client/sync_request.d.ts +0 -37
- package/dist/ai/baml_client/sync_request.js +0 -134
- package/dist/ai/baml_client/tracing.d.ts +0 -16
- package/dist/ai/baml_client/tracing.js +0 -18
- package/dist/ai/baml_client/type_builder.d.ts +0 -40
- package/dist/ai/baml_client/type_builder.js +0 -120
- package/dist/ai/baml_client/types.d.ts +0 -69
- package/dist/ai/baml_client/types.js +0 -15
- package/dist/ai/baml_client/watchers.d.ts +0 -32
- package/dist/ai/baml_client/watchers.js +0 -50
- package/dist/ai/baseten.d.ts +0 -4
- package/dist/ai/baseten.js +0 -10
- package/dist/ai/claudeCode.d.ts +0 -1
- package/dist/ai/claudeCode.js +0 -186
- package/dist/ai/modelHarness.d.ts +0 -39
- package/dist/ai/modelHarness.js +0 -324
- package/dist/ai/modelResponseError.d.ts +0 -4
- package/dist/ai/modelResponseError.js +0 -8
- package/dist/ai/multiModelHarness.d.ts +0 -24
- package/dist/ai/multiModelHarness.js +0 -52
- package/dist/ai/plannerResponse.d.ts +0 -34
- package/dist/ai/plannerResponse.js +0 -96
- package/dist/ai/plannerResponse.test.d.ts +0 -1
- package/dist/ai/plannerResponse.test.js +0 -112
- package/dist/ai/structuredOutput.d.ts +0 -11
- package/dist/ai/structuredOutput.js +0 -94
- package/dist/ai/structuredOutput.test.d.ts +0 -1
- package/dist/ai/structuredOutput.test.js +0 -91
- package/dist/ai/types.d.ts +0 -119
- package/dist/ai/types.js +0 -5
- package/dist/ai/util.d.ts +0 -13
- package/dist/ai/util.js +0 -200
- package/dist/ai/util.test.d.ts +0 -1
- package/dist/ai/util.test.js +0 -95
- package/dist/cli.js +0 -3
- package/dist/common/actions.js +0 -14
- package/dist/common/events.d.ts +0 -17
- package/dist/common/events.js +0 -3
- package/dist/common/failure.d.ts +0 -68
- package/dist/common/failure.js +0 -1
- package/dist/common/index.d.ts +0 -3
- package/dist/common/index.js +0 -3
- package/dist/common/operation.d.ts +0 -31
- package/dist/common/operation.js +0 -102
- package/dist/common/operation.test.d.ts +0 -1
- package/dist/common/operation.test.js +0 -53
- package/dist/common/retry.d.ts +0 -16
- package/dist/common/retry.js +0 -35
- package/dist/common/util.d.ts +0 -23
- package/dist/common/util.js +0 -139
- package/dist/connectors/browserConnector.d.ts +0 -53
- package/dist/connectors/browserConnector.js +0 -290
- package/dist/connectors/desktopConnector.d.ts +0 -58
- package/dist/connectors/desktopConnector.js +0 -68
- package/dist/connectors/index.d.ts +0 -14
- package/dist/connectors/index.js +0 -2
- package/dist/index.js +0 -28
- package/dist/logger.d.ts +0 -3
- package/dist/logger.js +0 -15
- package/dist/memory/agentMemory.d.ts +0 -47
- package/dist/memory/agentMemory.js +0 -167
- package/dist/memory/agentMemory.test.d.ts +0 -1
- package/dist/memory/agentMemory.test.js +0 -150
- package/dist/memory/image.d.ts +0 -28
- package/dist/memory/image.js +0 -95
- package/dist/memory/image.test.d.ts +0 -1
- package/dist/memory/image.test.js +0 -46
- package/dist/memory/index.d.ts +0 -3
- package/dist/memory/index.js +0 -3
- package/dist/memory/masking.d.ts +0 -7
- package/dist/memory/masking.js +0 -141
- package/dist/memory/masking.test.d.ts +0 -1
- package/dist/memory/masking.test.js +0 -117
- package/dist/memory/notebook.d.ts +0 -58
- package/dist/memory/notebook.js +0 -75
- package/dist/memory/notebook.test.d.ts +0 -1
- package/dist/memory/notebook.test.js +0 -99
- package/dist/memory/observation.d.ts +0 -38
- package/dist/memory/observation.js +0 -79
- package/dist/memory/rendering/index.d.ts +0 -10
- package/dist/memory/rendering/index.js +0 -13
- package/dist/memory/rendering/renderJsonParts.d.ts +0 -3
- package/dist/memory/rendering/renderJsonParts.js +0 -115
- package/dist/memory/rendering/renderJsonParts.test.d.ts +0 -1
- package/dist/memory/rendering/renderJsonParts.test.js +0 -217
- package/dist/memory/rendering/renderXmlParts.d.ts +0 -7
- package/dist/memory/rendering/renderXmlParts.js +0 -127
- package/dist/memory/serde.d.ts +0 -20
- package/dist/memory/serde.js +0 -67
- package/dist/memory/serde.test.d.ts +0 -1
- package/dist/memory/serde.test.js +0 -64
- package/dist/memory/util.d.ts +0 -2
- package/dist/memory/util.js +0 -17
- package/dist/telemetry/events.d.ts +0 -9
- package/dist/telemetry/events.js +0 -80
- package/dist/telemetry/index.d.ts +0 -6
- package/dist/telemetry/index.js +0 -91
- package/dist/types.d.ts +0 -30
- package/dist/types.js +0 -1
- package/dist/util.d.ts +0 -1
- package/dist/util.js +0 -12
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -3
- package/dist/web/browserProvider.d.ts +0 -24
- package/dist/web/browserProvider.js +0 -164
- package/dist/web/browserProvider.test.d.ts +0 -1
- package/dist/web/browserProvider.test.js +0 -44
- package/dist/web/harness.d.ts +0 -109
- package/dist/web/harness.js +0 -401
- package/dist/web/recovery.d.ts +0 -46
- package/dist/web/recovery.js +0 -137
- package/dist/web/recovery.test.d.ts +0 -1
- package/dist/web/recovery.test.js +0 -182
- package/dist/web/stability.d.ts +0 -57
- package/dist/web/stability.js +0 -323
- package/dist/web/tabs.d.ts +0 -58
- package/dist/web/tabs.js +0 -293
- package/dist/web/transformer.d.ts +0 -7
- package/dist/web/transformer.js +0 -41
- package/dist/web/types.d.ts +0 -37
- package/dist/web/types.js +0 -2
- package/dist/web/util.d.ts +0 -3
- package/dist/web/util.js +0 -81
- package/dist/web/visualizer/cursor.d.ts +0 -16
- package/dist/web/visualizer/cursor.js +0 -153
- package/dist/web/visualizer/index.d.ts +0 -22
- package/dist/web/visualizer/index.js +0 -47
- package/dist/web/visualizer/mouseEffects.d.ts +0 -18
- package/dist/web/visualizer/mouseEffects.js +0 -287
- package/dist/web/visualizer/typeEffects.d.ts +0 -10
- package/dist/web/visualizer/typeEffects.js +0 -190
- package/dist/web/zodReexport.test.d.ts +0 -1
- package/dist/web/zodReexport.test.js +0 -14
- /package/{dist/common/actions.d.ts → node_modules/patchright-core/.bun-tag-19f23bd68c84ec1f} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,1148 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { BrowserAgent, startBrowserAgent } from '@/agent/browserAgent';
|
|
4
|
-
export * from "@/agent";
|
|
5
|
-
export * from "@/memory";
|
|
6
|
-
export * from "@/web/harness";
|
|
7
|
-
export * from "@/actions";
|
|
8
|
-
export * from "@/connectors";
|
|
9
|
-
export * from "@/web/browserProvider";
|
|
10
|
-
export * from "@/connectors/browserConnector";
|
|
11
|
-
export * from "@/connectors/desktopConnector";
|
|
12
|
-
export * from "@/agent/errors";
|
|
13
|
-
export * from "@/types";
|
|
14
|
-
export * from "@/ai/types";
|
|
15
|
-
export * from "@/web/types";
|
|
16
|
-
export { BrowserBlockedError } from '@/web/recovery';
|
|
17
|
-
export type { BrowserBlock, BlockReason, RecoveryOptions, HttpDiagnostic } from '@/web/recovery';
|
|
18
|
-
export * from "@/actions/types";
|
|
19
|
-
export * from '@/common';
|
|
20
|
-
export type { OperationOptions } from '@/common/operation';
|
|
21
|
-
export * from "@/telemetry";
|
|
22
|
-
export { buildDefaultBrowserAgentOptions } from "@/ai/util";
|
|
23
|
-
export { logger } from './logger';
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
2
|
+
import z$1, { z, Schema, ZodSchema } from 'zod';
|
|
24
3
|
export { z } from 'zod';
|
|
4
|
+
import { Image as Image$1 } from '@boundaryml/baml';
|
|
5
|
+
import { Sharp, FormatEnum } from 'sharp';
|
|
6
|
+
import { BrowserContext, Page, PageScreenshotOptions, Browser, BrowserContextOptions, LaunchOptions } from 'playwright';
|
|
7
|
+
import { PostHog } from 'posthog-node';
|
|
8
|
+
import pino from 'pino';
|
|
9
|
+
|
|
10
|
+
type Base64Image = `data:image/${'jpeg' | 'png' | 'gif'};base64,${string}`;
|
|
11
|
+
type WebAction = NavigateWebAction | ClickWebAction | HoverWebAction | TypeWebAction | ScrollWebAction | SwitchTabWebAction;
|
|
12
|
+
interface NavigateWebAction {
|
|
13
|
+
variant: 'load';
|
|
14
|
+
url: string;
|
|
15
|
+
}
|
|
16
|
+
interface ClickWebAction {
|
|
17
|
+
variant: 'click';
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
}
|
|
21
|
+
interface HoverWebAction {
|
|
22
|
+
variant: 'hover';
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
}
|
|
26
|
+
interface TypeWebAction {
|
|
27
|
+
variant: 'type';
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
content: string;
|
|
31
|
+
}
|
|
32
|
+
interface ScrollWebAction {
|
|
33
|
+
variant: 'scroll';
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
deltaX: number;
|
|
37
|
+
deltaY: number;
|
|
38
|
+
}
|
|
39
|
+
type SwitchTabWebAction = {
|
|
40
|
+
variant: 'tab';
|
|
41
|
+
index: number;
|
|
42
|
+
};
|
|
43
|
+
interface PixelCoordinate {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* "Intents" are natural language descriptors that align 1:1 with executable web actions.
|
|
50
|
+
* Micro converts intents into web actions.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
interface Action {
|
|
54
|
+
variant: string;
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
}
|
|
57
|
+
type ActionIntent = ClickIntent | HoverIntent | TypeIntent | ScrollIntent | SwitchTabIntent;
|
|
58
|
+
type Intent = ActionIntent | CheckIntent;
|
|
59
|
+
interface ClickIntent {
|
|
60
|
+
variant: 'click';
|
|
61
|
+
target: string;
|
|
62
|
+
}
|
|
63
|
+
interface HoverIntent {
|
|
64
|
+
variant: 'hover';
|
|
65
|
+
target: string;
|
|
66
|
+
}
|
|
67
|
+
interface TypeIntent {
|
|
68
|
+
variant: 'type';
|
|
69
|
+
target: string;
|
|
70
|
+
content: string;
|
|
71
|
+
}
|
|
72
|
+
interface ScrollIntent {
|
|
73
|
+
variant: 'scroll';
|
|
74
|
+
target: string;
|
|
75
|
+
deltaX: number;
|
|
76
|
+
deltaY: number;
|
|
77
|
+
}
|
|
78
|
+
type SwitchTabIntent = SwitchTabWebAction;
|
|
79
|
+
interface CheckIntent {
|
|
80
|
+
variant: 'check';
|
|
81
|
+
checks: string[];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
type BrowserAgentRole = 'act' | 'extract' | 'query';
|
|
85
|
+
declare const allBrowserAgentRoles: BrowserAgentRole[];
|
|
86
|
+
/** Optional request budget for one model call, used for act() planning and for extract(). */
|
|
87
|
+
interface TimeoutPolicy {
|
|
88
|
+
/** Includes transport retries and format correction within one invocation. */
|
|
89
|
+
timeoutMs: number;
|
|
90
|
+
/** Retries after timeout, once the previous invocation settles. Default: 1. */
|
|
91
|
+
maxRetries?: number;
|
|
92
|
+
}
|
|
93
|
+
/** The published name for the planner's policy, kept for existing imports. */
|
|
94
|
+
type PlannerOptions = TimeoutPolicy;
|
|
95
|
+
type LLMClient = (AnthropicClient | ClaudeCodeClient | BedrockClient | GoogleAIClient | GoogleVertexClient | OpenAIClient | BasetenClient | OpenAIGenericClient | AzureOpenAIClient) & {
|
|
96
|
+
roles?: BrowserAgentRole[];
|
|
97
|
+
};
|
|
98
|
+
interface AnthropicClient {
|
|
99
|
+
provider: 'anthropic';
|
|
100
|
+
options: {
|
|
101
|
+
model: string;
|
|
102
|
+
apiKey?: string;
|
|
103
|
+
temperature?: number;
|
|
104
|
+
promptCaching?: boolean;
|
|
105
|
+
/** Maximum output tokens, including thinking. Omitted uses the transport default. */
|
|
106
|
+
maxTokens?: number;
|
|
107
|
+
/** Default: enabled for known supporting models. False retains prompt-only JSON. */
|
|
108
|
+
structuredOutputs?: boolean;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
interface ClaudeCodeClient {
|
|
112
|
+
provider: 'claude-code';
|
|
113
|
+
options: {
|
|
114
|
+
model: string;
|
|
115
|
+
temperature?: number;
|
|
116
|
+
promptCaching?: boolean;
|
|
117
|
+
/** Maximum output tokens, including thinking. Omitted uses the transport default. */
|
|
118
|
+
maxTokens?: number;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
interface BedrockClient {
|
|
122
|
+
provider: 'aws-bedrock';
|
|
123
|
+
options: {
|
|
124
|
+
model: string;
|
|
125
|
+
temperature?: number;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
interface GoogleAIClient {
|
|
129
|
+
provider: 'google-ai';
|
|
130
|
+
options: {
|
|
131
|
+
model: string;
|
|
132
|
+
apiKey?: string;
|
|
133
|
+
temperature?: number;
|
|
134
|
+
baseUrl?: string;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
interface GoogleVertexClient {
|
|
138
|
+
provider: 'vertex-ai';
|
|
139
|
+
options: {
|
|
140
|
+
model: string;
|
|
141
|
+
location?: string;
|
|
142
|
+
baseUrl?: string;
|
|
143
|
+
projectId?: string;
|
|
144
|
+
credentials?: string | object;
|
|
145
|
+
anthropicVersion?: string;
|
|
146
|
+
temperature?: number;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
interface OpenAIClient {
|
|
150
|
+
provider: 'openai';
|
|
151
|
+
options: {
|
|
152
|
+
model: string;
|
|
153
|
+
apiKey?: string;
|
|
154
|
+
baseUrl?: string;
|
|
155
|
+
/** Omitted by default: reasoning models may reject sampling parameters. */
|
|
156
|
+
temperature?: number;
|
|
157
|
+
reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
158
|
+
/** Includes both visible output and reasoning tokens. */
|
|
159
|
+
maxCompletionTokens?: number;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
interface BasetenClient {
|
|
163
|
+
provider: 'baseten';
|
|
164
|
+
options: {
|
|
165
|
+
model: string;
|
|
166
|
+
/** Defaults to BASETEN_API_KEY; never falls back to OPENAI_API_KEY. */
|
|
167
|
+
apiKey?: string;
|
|
168
|
+
/** Defaults to https://inference.baseten.co/v1. */
|
|
169
|
+
baseUrl?: string;
|
|
170
|
+
/** Omitted by default to preserve model-specific sampling defaults. */
|
|
171
|
+
temperature?: number;
|
|
172
|
+
/** Model-dependent. DeepSeek V4.1 Flash accepts none, low, high, or max. */
|
|
173
|
+
reasoningEffort?: OpenAIClient['options']['reasoningEffort'];
|
|
174
|
+
/** Baseten max_tokens: includes both visible output and reasoning tokens. */
|
|
175
|
+
maxTokens?: number;
|
|
176
|
+
/** Default: enabled on the hosted Model API; custom base URLs require opt-in. */
|
|
177
|
+
structuredOutputs?: boolean;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
interface AzureOpenAIClient {
|
|
181
|
+
provider: 'azure-openai';
|
|
182
|
+
options: {
|
|
183
|
+
resourceName: string;
|
|
184
|
+
deploymentId: string;
|
|
185
|
+
apiVersion: string;
|
|
186
|
+
apiKey: string;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
interface OpenAIGenericClient {
|
|
190
|
+
provider: 'openai-generic';
|
|
191
|
+
options: {
|
|
192
|
+
model: string;
|
|
193
|
+
baseUrl: string;
|
|
194
|
+
apiKey?: string;
|
|
195
|
+
temperature?: number;
|
|
196
|
+
headers?: Record<string, string>;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
interface LLMClientIdentifier {
|
|
200
|
+
provider: string;
|
|
201
|
+
model: string;
|
|
202
|
+
}
|
|
203
|
+
interface ModelUsage {
|
|
204
|
+
llm: LLMClientIdentifier;
|
|
205
|
+
inputTokens: number;
|
|
206
|
+
outputTokens: number;
|
|
207
|
+
cacheWriteInputTokens?: number;
|
|
208
|
+
cacheReadInputTokens?: number;
|
|
209
|
+
inputCost?: number;
|
|
210
|
+
outputCost?: number;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
interface OperationOptions {
|
|
214
|
+
signal?: AbortSignal;
|
|
215
|
+
/** Absolute Unix time in milliseconds, shared by every step, retry, and wait. */
|
|
216
|
+
deadline?: number;
|
|
217
|
+
}
|
|
218
|
+
type OperationKind = 'act' | 'query' | 'extract' | 'nav' | 'exec';
|
|
219
|
+
type OperationPhase = 'preparing' | 'context' | 'observations' | 'model' | 'action' | 'screenshot' | 'stability' | 'cooldown' | 'retry' | 'paused' | 'cursor';
|
|
220
|
+
interface OperationTiming {
|
|
221
|
+
count: number;
|
|
222
|
+
totalMs: number;
|
|
223
|
+
}
|
|
224
|
+
interface ProviderAttemptDiagnostics {
|
|
225
|
+
operationId: string;
|
|
226
|
+
attempt: number;
|
|
227
|
+
provider: string;
|
|
228
|
+
model: string;
|
|
229
|
+
startedAt: number;
|
|
230
|
+
elapsedMs: number | null;
|
|
231
|
+
httpStatus: number | null;
|
|
232
|
+
requestId: string | null;
|
|
233
|
+
/** Local planner invocation, when this HTTP attempt belongs to act() planning. */
|
|
234
|
+
plannerCallId?: string;
|
|
235
|
+
/** HTTP outcome, not successful parsing or completion of the agent's task. */
|
|
236
|
+
outcome: 'succeeded' | 'failed' | 'unknown';
|
|
237
|
+
/** Reported input tokens, including cached input, or null when the response has no usage. */
|
|
238
|
+
promptTokens: number | null;
|
|
239
|
+
/** Reported input tokens read from the provider's cache, or null when the response has no usage. */
|
|
240
|
+
cachedPromptTokens: number | null;
|
|
241
|
+
/** Reported output tokens, including reasoning, or null when the response has no usage. */
|
|
242
|
+
outputTokens: number | null;
|
|
243
|
+
}
|
|
244
|
+
interface PlannerCallDiagnostics {
|
|
245
|
+
id: string;
|
|
246
|
+
/** One-based timeout attempt within a planning step. */
|
|
247
|
+
attempt: number;
|
|
248
|
+
provider: string;
|
|
249
|
+
model: string;
|
|
250
|
+
startedAt: number;
|
|
251
|
+
endedAt?: number;
|
|
252
|
+
elapsedMs: number;
|
|
253
|
+
timeoutMs?: number;
|
|
254
|
+
status: 'running' | 'draining' | 'finished';
|
|
255
|
+
outcome?: 'succeeded' | 'failed' | 'timeout' | 'cancelled' | 'deadline';
|
|
256
|
+
}
|
|
257
|
+
interface BrowserClickDiagnostics {
|
|
258
|
+
operationId: string;
|
|
259
|
+
actionIndex: number | null;
|
|
260
|
+
x: number;
|
|
261
|
+
y: number;
|
|
262
|
+
button: 'left' | 'right' | 'middle';
|
|
263
|
+
clickCount: number;
|
|
264
|
+
screenshot: {
|
|
265
|
+
width: number;
|
|
266
|
+
height: number;
|
|
267
|
+
} | null;
|
|
268
|
+
viewport: {
|
|
269
|
+
width: number;
|
|
270
|
+
height: number;
|
|
271
|
+
} | null;
|
|
272
|
+
hit: {
|
|
273
|
+
tag: string | null;
|
|
274
|
+
role: string | null;
|
|
275
|
+
} | null;
|
|
276
|
+
}
|
|
277
|
+
interface OperationDiagnostics {
|
|
278
|
+
id: string;
|
|
279
|
+
kind: OperationKind;
|
|
280
|
+
status: 'running' | 'draining' | 'finished';
|
|
281
|
+
outcome?: 'succeeded' | 'failed' | 'cancelled' | 'deadline';
|
|
282
|
+
phase: OperationPhase;
|
|
283
|
+
startedAt: number;
|
|
284
|
+
elapsedMs: number;
|
|
285
|
+
cancellationToDrainMs?: number;
|
|
286
|
+
cancellationToIdleMs?: number;
|
|
287
|
+
lastAction?: {
|
|
288
|
+
index: number;
|
|
289
|
+
name: string;
|
|
290
|
+
state: 'pending' | 'started' | 'completed' | 'failed';
|
|
291
|
+
};
|
|
292
|
+
/** Inclusive totals: nested and concurrent phases overlap and must not be summed. */
|
|
293
|
+
timings: Partial<Record<OperationPhase, OperationTiming>>;
|
|
294
|
+
/** Latest 100 SDK attempts, available after each model invocation settles. */
|
|
295
|
+
providerAttempts?: ProviderAttemptDiagnostics[];
|
|
296
|
+
providerAttemptsTruncated?: boolean;
|
|
297
|
+
/** Latest 100 planner invocations, including the currently running request. */
|
|
298
|
+
plannerCalls?: PlannerCallDiagnostics[];
|
|
299
|
+
plannerCallsTruncated?: boolean;
|
|
300
|
+
/** Pre-dispatch hit evidence for the latest submitted click, not proof of success. */
|
|
301
|
+
lastClick?: BrowserClickDiagnostics;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
interface AgentEvents {
|
|
305
|
+
/** Payload-free snapshots. Existing action/thought events retain their original payloads. */
|
|
306
|
+
'operation': (diagnostics: OperationDiagnostics) => void;
|
|
307
|
+
'start': () => void;
|
|
308
|
+
'stop': () => void;
|
|
309
|
+
'thought': (thought: string) => void;
|
|
310
|
+
'actStarted': (task: string, options: ActOptions) => void;
|
|
311
|
+
'actDone': (task: string, options: ActOptions) => void;
|
|
312
|
+
'actionStarted': (action: Action) => void;
|
|
313
|
+
'actionDone': (action: Action) => void;
|
|
314
|
+
'observationsRecorded': () => void;
|
|
315
|
+
'planningStarted': () => void;
|
|
316
|
+
'pause': () => void;
|
|
317
|
+
'resume': () => void;
|
|
318
|
+
'tokensUsed': (usage: ModelUsage) => void;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/*************************************************************************************************
|
|
322
|
+
|
|
323
|
+
Welcome to Baml! To use this generated code, please run one of the following:
|
|
324
|
+
|
|
325
|
+
$ npm install @boundaryml/baml
|
|
326
|
+
$ yarn add @boundaryml/baml
|
|
327
|
+
$ pnpm add @boundaryml/baml
|
|
328
|
+
|
|
329
|
+
*************************************************************************************************/
|
|
330
|
+
|
|
331
|
+
interface AgentContext {
|
|
332
|
+
instructions?: string | null;
|
|
333
|
+
observationContent: MultiMediaMessage[];
|
|
334
|
+
connectorInstructions: ConnectorInstructions[];
|
|
335
|
+
}
|
|
336
|
+
interface ConnectorInstructions {
|
|
337
|
+
connectorId: string;
|
|
338
|
+
instructions: string;
|
|
339
|
+
}
|
|
340
|
+
interface MultiMediaMessage {
|
|
341
|
+
role: "user" | "assistant";
|
|
342
|
+
cacheControl: boolean;
|
|
343
|
+
content: (Image$1 | string)[];
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
type StoredMedia = {
|
|
347
|
+
type: 'media';
|
|
348
|
+
format: string;
|
|
349
|
+
storage: 'base64';
|
|
350
|
+
base64: string;
|
|
351
|
+
};
|
|
352
|
+
interface StoredPrimitive {
|
|
353
|
+
type: 'primitive';
|
|
354
|
+
content: string | boolean | number;
|
|
355
|
+
}
|
|
356
|
+
type MultiMediaPrimitive = StoredMedia | StoredPrimitive | undefined | null;
|
|
357
|
+
type MultiMediaArray = Array<MultiMediaJson>;
|
|
358
|
+
type MultiMediaObject = {
|
|
359
|
+
[key: string]: MultiMediaJson;
|
|
360
|
+
};
|
|
361
|
+
type MultiMediaJson = MultiMediaPrimitive | MultiMediaArray | MultiMediaObject;
|
|
362
|
+
|
|
363
|
+
declare class Image {
|
|
364
|
+
/**
|
|
365
|
+
* Wrapper for a Sharp image with conveniences to go to/from base64, convert to BAML, or serialize as JSON
|
|
366
|
+
*/
|
|
367
|
+
private img;
|
|
368
|
+
private encoded?;
|
|
369
|
+
constructor(img: Sharp);
|
|
370
|
+
static fromBase64(base64: string): Image;
|
|
371
|
+
getFormat(): Promise<keyof FormatEnum>;
|
|
372
|
+
private encode;
|
|
373
|
+
/**
|
|
374
|
+
* Convert the image to a JSON representation
|
|
375
|
+
*/
|
|
376
|
+
toJson(): Promise<StoredMedia>;
|
|
377
|
+
toBase64(): Promise<string>;
|
|
378
|
+
toBaml(): Promise<Image$1>;
|
|
379
|
+
saveToFile(filepath: string): Promise<void>;
|
|
380
|
+
getDimensions(): Promise<{
|
|
381
|
+
width: number;
|
|
382
|
+
height: number;
|
|
383
|
+
}>;
|
|
384
|
+
resize(width: number, height: number): Promise<Image>;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
type MultiMediaContentPart = Image$1 | string;
|
|
388
|
+
|
|
389
|
+
type ObservableDataPrimitive = Image | string | number | boolean | null | undefined;
|
|
390
|
+
type ObservableDataArray = Array<RenderableContent>;
|
|
391
|
+
type ObservableDataObject = {
|
|
392
|
+
[key: string]: RenderableContent;
|
|
393
|
+
};
|
|
394
|
+
type RenderableContent = ObservableDataPrimitive | ObservableDataArray | ObservableDataObject;
|
|
395
|
+
type ObservationRole = 'user' | 'assistant';
|
|
396
|
+
interface ObservationRetentionOptions {
|
|
397
|
+
type: string;
|
|
398
|
+
limit?: number;
|
|
399
|
+
dedupe?: boolean;
|
|
400
|
+
/** Render only the latest of this type after cached history; overrides limit and dedupe. Full audit retains every entry. */
|
|
401
|
+
current?: boolean;
|
|
402
|
+
}
|
|
403
|
+
type ObservationSource = `connector:${string}` | `action:taken:${string}` | `action:result:${string}` | `thought`;
|
|
404
|
+
declare class Observation {
|
|
405
|
+
readonly source: ObservationSource;
|
|
406
|
+
readonly role: ObservationRole;
|
|
407
|
+
readonly timestamp: number;
|
|
408
|
+
readonly content: RenderableContent;
|
|
409
|
+
readonly retention?: ObservationRetentionOptions;
|
|
410
|
+
constructor(source: ObservationSource, role: ObservationRole, content: RenderableContent, retention?: ObservationRetentionOptions, timestamp?: number);
|
|
411
|
+
static fromConnector(connectorId: string, content: RenderableContent, options?: ObservationRetentionOptions): Observation;
|
|
412
|
+
static fromActionTaken(actionId: string, content: RenderableContent, options?: ObservationRetentionOptions): Observation;
|
|
413
|
+
static fromActionResult(actionId: string, content: RenderableContent, options?: ObservationRetentionOptions): Observation;
|
|
414
|
+
static fromThought(content: RenderableContent, options?: ObservationRetentionOptions): Observation;
|
|
415
|
+
toString(): string;
|
|
416
|
+
toJson(): Promise<MultiMediaJson>;
|
|
417
|
+
render(options?: {
|
|
418
|
+
prefix?: MultiMediaContentPart[];
|
|
419
|
+
postfix?: MultiMediaContentPart[];
|
|
420
|
+
cacheControl?: boolean;
|
|
421
|
+
}): Promise<MultiMediaMessage>;
|
|
422
|
+
hash(): Promise<string>;
|
|
423
|
+
equals(obs: Observation): Promise<boolean>;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
declare const noteSchema: z.ZodObject<{
|
|
427
|
+
key: z.ZodString;
|
|
428
|
+
text: z.ZodString;
|
|
429
|
+
sources: z.ZodArray<z.ZodNumber>;
|
|
430
|
+
}, z.core.$strict>;
|
|
431
|
+
type NoteInput = z.infer<typeof noteSchema>;
|
|
432
|
+
declare const noteUpdateSchema: z.ZodObject<{
|
|
433
|
+
key: z.ZodString;
|
|
434
|
+
text: z.ZodString;
|
|
435
|
+
sources: z.ZodArray<z.ZodNumber>;
|
|
436
|
+
operation: z.ZodEnum<{
|
|
437
|
+
add: "add";
|
|
438
|
+
correct: "correct";
|
|
439
|
+
}>;
|
|
440
|
+
expected_text: z.ZodNullable<z.ZodString>;
|
|
441
|
+
}, z.core.$strict>;
|
|
442
|
+
type NoteUpdate = z.infer<typeof noteUpdateSchema>;
|
|
443
|
+
|
|
444
|
+
interface SerializedAgentMemory {
|
|
445
|
+
instructions?: string;
|
|
446
|
+
notes?: NoteInput[];
|
|
447
|
+
observations: {
|
|
448
|
+
source: ObservationSource;
|
|
449
|
+
role: ObservationRole;
|
|
450
|
+
timestamp: number;
|
|
451
|
+
data: MultiMediaJson;
|
|
452
|
+
options?: ObservationRetentionOptions;
|
|
453
|
+
}[];
|
|
454
|
+
}
|
|
455
|
+
interface AgentMemoryOptions {
|
|
456
|
+
instructions?: string | null;
|
|
457
|
+
promptCaching?: boolean;
|
|
458
|
+
thoughtLimit?: number;
|
|
459
|
+
}
|
|
460
|
+
interface MemoryRenderOptions {
|
|
461
|
+
/** Full audit history bypasses actor retention without changing actor visibility or cache state. */
|
|
462
|
+
history?: 'retained' | 'full';
|
|
463
|
+
}
|
|
464
|
+
declare class AgentMemory {
|
|
465
|
+
private options;
|
|
466
|
+
private observations;
|
|
467
|
+
private notebook;
|
|
468
|
+
private visibleSourceIds;
|
|
469
|
+
private freezeMask?;
|
|
470
|
+
private cacheControlIndices;
|
|
471
|
+
constructor(options?: AgentMemoryOptions);
|
|
472
|
+
get instructions(): string | null;
|
|
473
|
+
/** Apply current instructions and provider caching policy without replacing task evidence. */
|
|
474
|
+
configure(options: Pick<AgentMemoryOptions, 'instructions' | 'promptCaching'>): void;
|
|
475
|
+
render(options?: MemoryRenderOptions): Promise<MultiMediaMessage[]>;
|
|
476
|
+
simpleRender(): Promise<(Image$1 | string)[]>;
|
|
477
|
+
private observationPrefix;
|
|
478
|
+
private resolveNoteSource;
|
|
479
|
+
remember(note: NoteInput, expectedText?: string): void;
|
|
480
|
+
forget(key: string): void;
|
|
481
|
+
isEmpty(): boolean;
|
|
482
|
+
recordThought(content: string): void;
|
|
483
|
+
recordObservation(obs: Observation): void;
|
|
484
|
+
getLastThoughtMessage(): string | null;
|
|
485
|
+
toJSON(): Promise<SerializedAgentMemory>;
|
|
486
|
+
/** Replace saved state atomically; runtime caching and thought limits stay with this instance. */
|
|
487
|
+
loadJSON(data: SerializedAgentMemory): Promise<void>;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
type ActionContext<T> = {
|
|
491
|
+
input: T;
|
|
492
|
+
agent: Agent;
|
|
493
|
+
memory?: AgentMemory;
|
|
494
|
+
} & OperationOptions;
|
|
495
|
+
interface ActionDefinition<T> {
|
|
496
|
+
name: string;
|
|
497
|
+
description?: string;
|
|
498
|
+
schema: Schema<T>;
|
|
499
|
+
resolver: (context: ActionContext<T>) => Promise<void | RenderableContent>;
|
|
500
|
+
render: (action: T) => string;
|
|
501
|
+
}
|
|
502
|
+
type ActionOptions<T> = Omit<ActionDefinition<T>, 'render'> & {
|
|
503
|
+
render?: ActionDefinition<T>['render'];
|
|
504
|
+
};
|
|
505
|
+
type EmptyActionOptions = Omit<ActionOptions<Record<string, never>>, 'schema'> & {
|
|
506
|
+
schema?: undefined;
|
|
507
|
+
};
|
|
508
|
+
declare function createAction<T>(action: ActionOptions<T>): ActionDefinition<T>;
|
|
509
|
+
declare function createAction(action: EmptyActionOptions): ActionDefinition<Record<string, never>>;
|
|
510
|
+
type ActionPayload<A extends ActionDefinition<any>> = {
|
|
511
|
+
name: A['name'];
|
|
512
|
+
} & z.infer<A['schema']>;
|
|
513
|
+
|
|
514
|
+
interface AgentConnector {
|
|
515
|
+
id: string;
|
|
516
|
+
onStart?(): Promise<void>;
|
|
517
|
+
onStop?(): Promise<void>;
|
|
518
|
+
beforeAction?(action: Action, options?: OperationOptions): Promise<void>;
|
|
519
|
+
onTaskStart?(options?: OperationOptions): void;
|
|
520
|
+
/** Called before each planner request, after the observations it will see are recorded. */
|
|
521
|
+
beforePlan?(options?: OperationOptions): Promise<void>;
|
|
522
|
+
getActionSpace?(): ActionDefinition<any>[];
|
|
523
|
+
collectObservations?(options?: OperationOptions): Promise<Observation[]>;
|
|
524
|
+
getInstructions?(options?: OperationOptions): Promise<void | string>;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
declare function mergeMessages(messages: MultiMediaMessage[]): MultiMediaMessage[];
|
|
528
|
+
|
|
529
|
+
interface PlannerResponse {
|
|
530
|
+
reasoning: string;
|
|
531
|
+
memory_updates: NoteUpdate[];
|
|
532
|
+
actions: Action[];
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
interface ModelHarnessEvents {
|
|
536
|
+
'tokensUsed': (usage: ModelUsage) => {};
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
declare class MultiModelHarness {
|
|
540
|
+
/**
|
|
541
|
+
* Delegates model responsibilites to different LLMs and consolidates their usage
|
|
542
|
+
*/
|
|
543
|
+
private roles;
|
|
544
|
+
private uniqueModels;
|
|
545
|
+
readonly events: EventEmitter<ModelHarnessEvents>;
|
|
546
|
+
constructor(clients: LLMClient[], policies?: {
|
|
547
|
+
planner?: TimeoutPolicy;
|
|
548
|
+
extract?: TimeoutPolicy;
|
|
549
|
+
});
|
|
550
|
+
setup(): Promise<void>;
|
|
551
|
+
describe(): string;
|
|
552
|
+
partialAct<T>(context: AgentContext, task: string, data: MultiMediaContentPart[], actionVocabulary: ActionDefinition<T>[]): Promise<PlannerResponse>;
|
|
553
|
+
extract<T extends z$1.Schema>(instructions: string, schema: T, screenshot: Image, domContent: string): Promise<z$1.infer<T>>;
|
|
554
|
+
query<T extends z$1.Schema>(context: AgentContext, query: string, schema: T): Promise<z$1.infer<T>>;
|
|
555
|
+
get numUniqueModels(): number;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
interface AgentOptions {
|
|
559
|
+
llm?: LLMClient | LLMClient[];
|
|
560
|
+
connectors?: AgentConnector[];
|
|
561
|
+
actions?: ActionDefinition<any>[];
|
|
562
|
+
prompt?: string | null;
|
|
563
|
+
telemetry?: boolean;
|
|
564
|
+
maxActions?: number;
|
|
565
|
+
/** Omitted preserves existing planner retry behavior without a per-call timeout. */
|
|
566
|
+
planner?: TimeoutPolicy;
|
|
567
|
+
/** Omitted runs extract() without a per-call timeout. */
|
|
568
|
+
extract?: TimeoutPolicy;
|
|
569
|
+
}
|
|
570
|
+
interface ActOptions extends OperationOptions {
|
|
571
|
+
prompt?: string;
|
|
572
|
+
data?: RenderableContent;
|
|
573
|
+
memory?: AgentMemory;
|
|
574
|
+
}
|
|
575
|
+
declare class Agent {
|
|
576
|
+
private options;
|
|
577
|
+
private connectors;
|
|
578
|
+
private actions;
|
|
579
|
+
private memoryOptions;
|
|
580
|
+
readonly models: MultiModelHarness;
|
|
581
|
+
readonly events: EventEmitter<AgentEvents>;
|
|
582
|
+
private doneActing;
|
|
583
|
+
private _paused;
|
|
584
|
+
private _pauseResolve;
|
|
585
|
+
private activeOperation?;
|
|
586
|
+
private latestOperation?;
|
|
587
|
+
private idle;
|
|
588
|
+
private resolveIdle?;
|
|
589
|
+
private pendingWork;
|
|
590
|
+
private lifecycleTail;
|
|
591
|
+
private lifecycleRequest?;
|
|
592
|
+
private lifecycleState;
|
|
593
|
+
private telemetryStarted;
|
|
594
|
+
protected latestTaskMemory: AgentMemory;
|
|
595
|
+
constructor(baseConfig?: Partial<AgentOptions>);
|
|
596
|
+
getConnector<C extends AgentConnector>(connectorClass: new (...args: any[]) => C): C | undefined;
|
|
597
|
+
require<C extends AgentConnector>(connectorClass: new (...args: any[]) => C): C;
|
|
598
|
+
start(): Promise<void>;
|
|
599
|
+
get lifecycle(): 'new' | 'starting' | 'ready' | 'stopping' | 'stopped';
|
|
600
|
+
private beginWork;
|
|
601
|
+
private endWork;
|
|
602
|
+
private scheduleLifecycle;
|
|
603
|
+
identifyAction(action: Action): ActionDefinition<any>;
|
|
604
|
+
/** True until underlying work settles, including after a cancelled caller returns. */
|
|
605
|
+
get busy(): boolean;
|
|
606
|
+
whenIdle(): Promise<void>;
|
|
607
|
+
/** A payload-free snapshot of the active or most recent operation. */
|
|
608
|
+
get operation(): OperationDiagnostics | undefined;
|
|
609
|
+
protected runOperation<T>(options: OperationOptions, fn: () => Promise<T>, kind?: OperationKind): Promise<T>;
|
|
610
|
+
exec(action: Action, memory?: AgentMemory, options?: OperationOptions): Promise<unknown>;
|
|
611
|
+
private _exec;
|
|
612
|
+
protected _recordConnectorObservations(memory: AgentMemory): Promise<void>;
|
|
613
|
+
get memory(): AgentMemory;
|
|
614
|
+
act(taskOrSteps: string | string[], options?: ActOptions): Promise<void>;
|
|
615
|
+
private _runAct;
|
|
616
|
+
private _traceAct;
|
|
617
|
+
private _buildContext;
|
|
618
|
+
private _act;
|
|
619
|
+
query<T extends z$1.Schema>(query: string, schema: T, options?: MemoryRenderOptions & OperationOptions): Promise<z$1.infer<T>>;
|
|
620
|
+
queueDone(): Promise<void>;
|
|
621
|
+
private _waitIfPaused;
|
|
622
|
+
pause(): void;
|
|
623
|
+
resume(): void;
|
|
624
|
+
get paused(): boolean;
|
|
625
|
+
stop(): Promise<void>;
|
|
626
|
+
private stopConnectors;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
interface ActionVisualizerOptions {
|
|
630
|
+
showCursor?: boolean;
|
|
631
|
+
/** Set false to skip the 300 ms movement animation. Defaults to true. */
|
|
632
|
+
animateCursor?: boolean;
|
|
633
|
+
showHoverCircle?: boolean;
|
|
634
|
+
showClickRipple?: boolean;
|
|
635
|
+
showDragLine?: boolean;
|
|
636
|
+
showTypeEffects?: boolean;
|
|
637
|
+
}
|
|
638
|
+
declare class ActionVisualizer {
|
|
639
|
+
private options;
|
|
640
|
+
private context;
|
|
641
|
+
private page;
|
|
642
|
+
private cursor;
|
|
643
|
+
private mouseEffects;
|
|
644
|
+
private typeEffects;
|
|
645
|
+
constructor(context: BrowserContext, options: ActionVisualizerOptions);
|
|
646
|
+
setup(): Promise<void>;
|
|
647
|
+
setActivePage(page: Page): Promise<void>;
|
|
648
|
+
moveVirtualCursor(x: number, y: number): Promise<void>;
|
|
649
|
+
hideAll(): Promise<void>;
|
|
650
|
+
showAll(): Promise<void>;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
interface TabState {
|
|
654
|
+
activeTab: number;
|
|
655
|
+
tabs: {
|
|
656
|
+
title: string;
|
|
657
|
+
url: string;
|
|
658
|
+
}[];
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
interface WebHarnessOptions {
|
|
662
|
+
virtualScreenDimensions?: {
|
|
663
|
+
width: number;
|
|
664
|
+
height: number;
|
|
665
|
+
};
|
|
666
|
+
visuals?: ActionVisualizerOptions;
|
|
667
|
+
switchTabsOnActivity?: boolean;
|
|
668
|
+
/** Refuse to type into password and one-time-code fields; the host owns authentication. */
|
|
669
|
+
hostOnlyAuthentication?: boolean;
|
|
670
|
+
}
|
|
671
|
+
interface WebHarnessEvents {
|
|
672
|
+
'activePageChanged': (page: Page) => Promise<void>;
|
|
673
|
+
}
|
|
674
|
+
declare class WebHarness {
|
|
675
|
+
/**
|
|
676
|
+
* Executes web actions on a page
|
|
677
|
+
* Not responsible for browser lifecycle
|
|
678
|
+
*/
|
|
679
|
+
readonly context: BrowserContext;
|
|
680
|
+
private options;
|
|
681
|
+
private stability;
|
|
682
|
+
readonly visualizer: ActionVisualizer;
|
|
683
|
+
private transformer;
|
|
684
|
+
private tabs;
|
|
685
|
+
private lastScreenshot?;
|
|
686
|
+
readonly events: EventEmitter<WebHarnessEvents>;
|
|
687
|
+
constructor(context: BrowserContext, options?: WebHarnessOptions);
|
|
688
|
+
setActivePage(page: Page): Promise<void>;
|
|
689
|
+
retrieveTabState(): Promise<TabState>;
|
|
690
|
+
start(): Promise<void>;
|
|
691
|
+
stop(): Promise<void>;
|
|
692
|
+
get page(): Page;
|
|
693
|
+
screenshot(options?: PageScreenshotOptions): Promise<Image>;
|
|
694
|
+
_type(content: string): Promise<void>;
|
|
695
|
+
transformCoordinates({ x, y }: {
|
|
696
|
+
x: number;
|
|
697
|
+
y: number;
|
|
698
|
+
}): Promise<{
|
|
699
|
+
x: number;
|
|
700
|
+
y: number;
|
|
701
|
+
}>;
|
|
702
|
+
click({ x, y }: {
|
|
703
|
+
x: number;
|
|
704
|
+
y: number;
|
|
705
|
+
}, options?: {
|
|
706
|
+
transform: boolean;
|
|
707
|
+
}): Promise<void>;
|
|
708
|
+
/** Recheck an observed target after hover effects, before submitting any click. */
|
|
709
|
+
clickGrounded(resolve: () => Promise<{
|
|
710
|
+
x: number;
|
|
711
|
+
y: number;
|
|
712
|
+
} | null>): Promise<boolean>;
|
|
713
|
+
private _click;
|
|
714
|
+
private dispatchClick;
|
|
715
|
+
hover({ x, y }: {
|
|
716
|
+
x: number;
|
|
717
|
+
y: number;
|
|
718
|
+
}, options?: {
|
|
719
|
+
transform: boolean;
|
|
720
|
+
}): Promise<void>;
|
|
721
|
+
rightClick({ x, y }: {
|
|
722
|
+
x: number;
|
|
723
|
+
y: number;
|
|
724
|
+
}, options?: {
|
|
725
|
+
transform: boolean;
|
|
726
|
+
}): Promise<void>;
|
|
727
|
+
doubleClick({ x, y }: {
|
|
728
|
+
x: number;
|
|
729
|
+
y: number;
|
|
730
|
+
}, options?: {
|
|
731
|
+
transform: boolean;
|
|
732
|
+
}): Promise<void>;
|
|
733
|
+
drag({ x1, y1, x2, y2 }: {
|
|
734
|
+
x1: number;
|
|
735
|
+
y1: number;
|
|
736
|
+
x2: number;
|
|
737
|
+
y2: number;
|
|
738
|
+
}, options?: {
|
|
739
|
+
transform: boolean;
|
|
740
|
+
}): Promise<void>;
|
|
741
|
+
/** Stops the operation when the focused field, in any frame, takes a password or one-time code. */
|
|
742
|
+
private refuseCredentialField;
|
|
743
|
+
type({ content }: {
|
|
744
|
+
content: string;
|
|
745
|
+
}): Promise<void>;
|
|
746
|
+
clickAndType({ x, y, content }: {
|
|
747
|
+
x: number;
|
|
748
|
+
y: number;
|
|
749
|
+
content: string;
|
|
750
|
+
}, options?: {
|
|
751
|
+
transform: boolean;
|
|
752
|
+
}): Promise<void>;
|
|
753
|
+
scroll({ x, y, deltaX, deltaY }: {
|
|
754
|
+
x: number;
|
|
755
|
+
y: number;
|
|
756
|
+
deltaX: number;
|
|
757
|
+
deltaY: number;
|
|
758
|
+
}, options?: {
|
|
759
|
+
transform: boolean;
|
|
760
|
+
}): Promise<void>;
|
|
761
|
+
switchTab({ index }: {
|
|
762
|
+
index: number;
|
|
763
|
+
}): Promise<void>;
|
|
764
|
+
newTab(): Promise<void>;
|
|
765
|
+
navigate(url: string): Promise<void>;
|
|
766
|
+
selectAll(): Promise<void>;
|
|
767
|
+
enter(): Promise<void>;
|
|
768
|
+
backspace(): Promise<void>;
|
|
769
|
+
tab(): Promise<void>;
|
|
770
|
+
goBack(): Promise<void>;
|
|
771
|
+
escape(): Promise<void>;
|
|
772
|
+
executeAction(action: WebAction): Promise<void>;
|
|
773
|
+
waitForStability(timeout?: number): Promise<void>;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
type BrowserOptions = {
|
|
777
|
+
instance: Browser;
|
|
778
|
+
contextOptions?: BrowserContextOptions;
|
|
779
|
+
} | {
|
|
780
|
+
cdp: string;
|
|
781
|
+
contextOptions?: BrowserContextOptions;
|
|
782
|
+
} | {
|
|
783
|
+
launchOptions?: LaunchOptions;
|
|
784
|
+
contextOptions?: BrowserContextOptions;
|
|
785
|
+
} | {
|
|
786
|
+
context: BrowserContext;
|
|
787
|
+
};
|
|
788
|
+
declare class BrowserProvider {
|
|
789
|
+
private activeBrowsers;
|
|
790
|
+
private logger;
|
|
791
|
+
private constructor();
|
|
792
|
+
static getInstance(): BrowserProvider;
|
|
793
|
+
static reset(): Promise<void>;
|
|
794
|
+
private _launchOrReuseBrowser;
|
|
795
|
+
_createAndTrackContext(options: BrowserOptions): Promise<BrowserContext>;
|
|
796
|
+
newContext(options?: BrowserOptions): Promise<BrowserContext>;
|
|
797
|
+
private _applyEmulationSettings;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
type BlockReason = 'rate_limit' | 'subscription' | 'authentication' | 'no_progress';
|
|
801
|
+
interface BrowserBlock {
|
|
802
|
+
reason: BlockReason;
|
|
803
|
+
evidence: string;
|
|
804
|
+
retryAt?: number;
|
|
805
|
+
}
|
|
806
|
+
declare class BrowserBlockedError extends Error {
|
|
807
|
+
readonly block: BrowserBlock;
|
|
808
|
+
readonly operation?: OperationDiagnostics;
|
|
809
|
+
constructor(block: BrowserBlock);
|
|
810
|
+
}
|
|
811
|
+
interface HttpDiagnostic {
|
|
812
|
+
timestamp: number;
|
|
813
|
+
url: string;
|
|
814
|
+
status: number;
|
|
815
|
+
retryAt?: number;
|
|
816
|
+
navigation?: boolean;
|
|
817
|
+
}
|
|
818
|
+
interface RecoveryOptions {
|
|
819
|
+
maxRateLimitWaitMs?: number;
|
|
820
|
+
/** Unchanged attempts before stopping; known-state cycles allow twice this many attempts. Default: 6. */
|
|
821
|
+
repeatedActionLimit?: number;
|
|
822
|
+
/** Opt in to heuristic loop warnings and automatic no-progress termination. */
|
|
823
|
+
noProgress?: boolean;
|
|
824
|
+
}
|
|
825
|
+
declare class BrowserRecovery {
|
|
826
|
+
block?: BrowserBlock;
|
|
827
|
+
warning?: string;
|
|
828
|
+
waitUntil?: number;
|
|
829
|
+
private rateWaitMs;
|
|
830
|
+
private blockedActions;
|
|
831
|
+
private recentStates;
|
|
832
|
+
private repetitions;
|
|
833
|
+
private knownStateAttempts;
|
|
834
|
+
private lastFingerprint?;
|
|
835
|
+
readonly maxRateLimitWaitMs: number;
|
|
836
|
+
readonly repeatedActionLimit: number;
|
|
837
|
+
readonly noProgress: boolean;
|
|
838
|
+
constructor(options?: RecoveryOptions);
|
|
839
|
+
reset(): void;
|
|
840
|
+
/** New non-page evidence, such as a browser download lifecycle transition. */
|
|
841
|
+
recordProgress(): void;
|
|
842
|
+
observe(fingerprint: string | null, action: Action | undefined, block: BrowserBlock | undefined, now?: number): void;
|
|
843
|
+
check(): void;
|
|
844
|
+
waitDuration(requestedMs: number, now?: number, deadline?: number): number;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
interface BrowserConnectorOptions {
|
|
848
|
+
browser?: BrowserOptions;
|
|
849
|
+
url?: string;
|
|
850
|
+
virtualScreenDimensions?: {
|
|
851
|
+
width: number;
|
|
852
|
+
height: number;
|
|
853
|
+
};
|
|
854
|
+
minScreenshots?: number;
|
|
855
|
+
visuals?: ActionVisualizerOptions;
|
|
856
|
+
recovery?: RecoveryOptions | false;
|
|
857
|
+
/** Opt in to current-viewport link, button, and native field observations with browser:click, browser:select, and browser:fill references. */
|
|
858
|
+
groundedControls?: boolean;
|
|
859
|
+
/** The host owns sign-in: typing into a password or one-time-code field stops the task as blocked by authentication. */
|
|
860
|
+
hostOnlyAuthentication?: boolean;
|
|
861
|
+
}
|
|
862
|
+
interface BrowserConnectorStateData {
|
|
863
|
+
screenshot: Image;
|
|
864
|
+
tabs: TabState;
|
|
865
|
+
}
|
|
866
|
+
declare class BrowserConnector implements AgentConnector {
|
|
867
|
+
readonly id: string;
|
|
868
|
+
private harness;
|
|
869
|
+
private options;
|
|
870
|
+
private browser?;
|
|
871
|
+
private context;
|
|
872
|
+
private logger;
|
|
873
|
+
readonly recovery: BrowserRecovery;
|
|
874
|
+
readonly network: HttpDiagnostic[];
|
|
875
|
+
private responses;
|
|
876
|
+
private pendingAction?;
|
|
877
|
+
private cancelWait?;
|
|
878
|
+
private downloads?;
|
|
879
|
+
private controls?;
|
|
880
|
+
constructor(options?: BrowserConnectorOptions);
|
|
881
|
+
onStart(): Promise<void>;
|
|
882
|
+
onStop(): Promise<void>;
|
|
883
|
+
getActionSpace(): ActionDefinition<any>[];
|
|
884
|
+
private onResponse;
|
|
885
|
+
beforeAction(action: Action): Promise<void>;
|
|
886
|
+
beforePlan(): Promise<void>;
|
|
887
|
+
onTaskStart(): void;
|
|
888
|
+
wait(requestedMs: number): Promise<void>;
|
|
889
|
+
getHarness(): WebHarness;
|
|
890
|
+
private captureCurrentState;
|
|
891
|
+
transformScreenshot(screenshot: Image): Promise<Image>;
|
|
892
|
+
getLastScreenshot(): Promise<Image>;
|
|
893
|
+
collectObservations(): Promise<Observation[]>;
|
|
894
|
+
private collectCurrentObservations;
|
|
895
|
+
getInstructions(): Promise<void | string>;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
declare function startBrowserAgent(options?: AgentOptions & BrowserConnectorOptions & {
|
|
899
|
+
narrate?: boolean;
|
|
900
|
+
}): Promise<BrowserAgent>;
|
|
901
|
+
type ExtractedOutput = string | number | boolean | bigint | Date | null | undefined | {
|
|
902
|
+
[key: string]: ExtractedOutput;
|
|
903
|
+
} | ExtractedOutput[];
|
|
904
|
+
interface BrowserAgentEvents {
|
|
905
|
+
'nav': (url: string) => void;
|
|
906
|
+
'extractStarted': (instructions: string, schema: ZodSchema) => void;
|
|
907
|
+
'extractDone': (instructions: string, data: ExtractedOutput) => void;
|
|
908
|
+
}
|
|
909
|
+
declare class BrowserAgent extends Agent {
|
|
910
|
+
readonly browserAgentEvents: EventEmitter<BrowserAgentEvents>;
|
|
911
|
+
constructor({ agentOptions, browserOptions }: {
|
|
912
|
+
agentOptions?: Partial<AgentOptions>;
|
|
913
|
+
browserOptions?: BrowserConnectorOptions;
|
|
914
|
+
});
|
|
915
|
+
get page(): Page;
|
|
916
|
+
get context(): BrowserContext;
|
|
917
|
+
nav(url: string, options?: OperationOptions): Promise<void>;
|
|
918
|
+
extract<T extends Schema<ExtractedOutput>>(instructions: string, schema: T, options?: OperationOptions): Promise<z$1.infer<T>>;
|
|
919
|
+
private _extract;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Generic desktop automation interface.
|
|
924
|
+
* Implementations can use any desktop automation technology
|
|
925
|
+
* (Lume, PyAutoGUI, Windows UI Automation, etc.)
|
|
926
|
+
*/
|
|
927
|
+
interface DesktopInterface {
|
|
928
|
+
click(x: number, y: number): Promise<void>;
|
|
929
|
+
rightClick(x: number, y: number): Promise<void>;
|
|
930
|
+
doubleClick(x: number, y: number): Promise<void>;
|
|
931
|
+
moveCursor(x: number, y: number): Promise<void>;
|
|
932
|
+
drag(fromX: number, fromY: number, toX: number, toY: number): Promise<void>;
|
|
933
|
+
scroll(x: number, y: number, deltaX: number, deltaY: number): Promise<void>;
|
|
934
|
+
type(text: string): Promise<void>;
|
|
935
|
+
key(key: string): Promise<void>;
|
|
936
|
+
hotkey(keys: string[]): Promise<void>;
|
|
937
|
+
screenshot(): Promise<Buffer>;
|
|
938
|
+
getScreenSize(): Promise<{
|
|
939
|
+
width: number;
|
|
940
|
+
height: number;
|
|
941
|
+
}>;
|
|
942
|
+
navigate?(url: string): Promise<void>;
|
|
943
|
+
getActiveWindow?(): Promise<{
|
|
944
|
+
title: string;
|
|
945
|
+
app: string;
|
|
946
|
+
}>;
|
|
947
|
+
getOpenWindows?(): Promise<Array<{
|
|
948
|
+
title: string;
|
|
949
|
+
app: string;
|
|
950
|
+
isActive: boolean;
|
|
951
|
+
}>>;
|
|
952
|
+
focusWindow?(title: string): Promise<void>;
|
|
953
|
+
openApplication?(name: string): Promise<void>;
|
|
954
|
+
closeApplication?(name: string): Promise<void>;
|
|
955
|
+
}
|
|
956
|
+
interface DesktopConnectorOptions {
|
|
957
|
+
desktopInterface: DesktopInterface;
|
|
958
|
+
virtualScreenDimensions?: {
|
|
959
|
+
width: number;
|
|
960
|
+
height: number;
|
|
961
|
+
};
|
|
962
|
+
minScreenshots?: number;
|
|
963
|
+
}
|
|
964
|
+
declare class DesktopConnector implements AgentConnector {
|
|
965
|
+
readonly id: string;
|
|
966
|
+
private desktopInterface;
|
|
967
|
+
private options;
|
|
968
|
+
private logger;
|
|
969
|
+
constructor(options: DesktopConnectorOptions);
|
|
970
|
+
onStart(): Promise<void>;
|
|
971
|
+
onStop(): Promise<void>;
|
|
972
|
+
getActionSpace(): ActionDefinition<any>[];
|
|
973
|
+
collectObservations(): Promise<Observation[]>;
|
|
974
|
+
private formatWindowInfo;
|
|
975
|
+
getInterface(): DesktopInterface;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
interface AgentErrorOptions {
|
|
979
|
+
variant?: string;
|
|
980
|
+
adaptable?: boolean;
|
|
981
|
+
}
|
|
982
|
+
declare class AgentError extends Error {
|
|
983
|
+
readonly operation?: OperationDiagnostics;
|
|
984
|
+
readonly options: Required<AgentErrorOptions>;
|
|
985
|
+
constructor(message: string, options?: AgentErrorOptions);
|
|
986
|
+
}
|
|
987
|
+
declare class ActionLimitError extends AgentError {
|
|
988
|
+
readonly limit: number;
|
|
989
|
+
constructor(limit: number);
|
|
990
|
+
}
|
|
991
|
+
declare class OperationCancelledError extends AgentError {
|
|
992
|
+
constructor(reason?: unknown);
|
|
993
|
+
}
|
|
994
|
+
declare class OperationDeadlineError extends AgentError {
|
|
995
|
+
readonly deadline: number;
|
|
996
|
+
constructor(deadline: number);
|
|
997
|
+
}
|
|
998
|
+
declare class AgentBusyError extends AgentError {
|
|
999
|
+
constructor();
|
|
1000
|
+
}
|
|
1001
|
+
declare class PlannerTimeoutError extends AgentError {
|
|
1002
|
+
readonly timeoutMs: number;
|
|
1003
|
+
constructor(timeoutMs: number);
|
|
1004
|
+
}
|
|
1005
|
+
declare class ExtractTimeoutError extends AgentError {
|
|
1006
|
+
readonly timeoutMs: number;
|
|
1007
|
+
constructor(timeoutMs: number);
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* Represents any reason why a test case could have failed, for example:
|
|
1012
|
+
* - Step could not be completed
|
|
1013
|
+
* - Check did not pass
|
|
1014
|
+
* - Could not navigate to starting URL
|
|
1015
|
+
* - Time or action based timeout
|
|
1016
|
+
* - Operation cancelled by signal
|
|
1017
|
+
* - ...
|
|
1018
|
+
*/
|
|
1019
|
+
type FailureDescriptor = BugDetectedFailure | MisalignmentFailure | NetworkFailure | BrowserFailure | RateLimitFailure | ApiKeyFailure | UnknownFailure | CancelledFailure;
|
|
1020
|
+
type BugSeverity = 'critical' | 'high' | 'medium' | 'low';
|
|
1021
|
+
/**
|
|
1022
|
+
* Step and check failures are classified into one of:
|
|
1023
|
+
* BugDetectedFailure: seems to be something wrong with the application itself
|
|
1024
|
+
* MisalignmentFailure: seems to be a discrepency between the test case and the interface
|
|
1025
|
+
* OR the agent did not properly recognize the relationship between test case and interface
|
|
1026
|
+
*/
|
|
1027
|
+
interface BugDetectedFailure {
|
|
1028
|
+
variant: 'bug';
|
|
1029
|
+
title: string;
|
|
1030
|
+
expectedResult: string;
|
|
1031
|
+
actualResult: string;
|
|
1032
|
+
severity: BugSeverity;
|
|
1033
|
+
}
|
|
1034
|
+
interface MisalignmentFailure {
|
|
1035
|
+
/**
|
|
1036
|
+
* Major misalignment: when a step/check fails due to:
|
|
1037
|
+
* 1. Poorly written step/check that is completely unrelated to the interface
|
|
1038
|
+
* 2. Or interface has changed so much that step/check no longer applicable
|
|
1039
|
+
* 3. Planner did not do good enough job adjusting recipe for minor misalignment
|
|
1040
|
+
* Misalignment could be due to a poorly written test case OR bad agent behavior.
|
|
1041
|
+
*/
|
|
1042
|
+
variant: 'misalignment';
|
|
1043
|
+
message: string;
|
|
1044
|
+
}
|
|
1045
|
+
interface NetworkFailure {
|
|
1046
|
+
/**
|
|
1047
|
+
* For example, failure to connect to starting URL, or any other network errors
|
|
1048
|
+
* that would completely prevent the test from executing.
|
|
1049
|
+
*/
|
|
1050
|
+
variant: 'network';
|
|
1051
|
+
message: string;
|
|
1052
|
+
}
|
|
1053
|
+
interface BrowserFailure {
|
|
1054
|
+
/**
|
|
1055
|
+
* E.g. something goes wrong with playwright interactions, any DOM manipulation, etc.
|
|
1056
|
+
*/
|
|
1057
|
+
variant: 'browser';
|
|
1058
|
+
message: string;
|
|
1059
|
+
}
|
|
1060
|
+
interface RateLimitFailure {
|
|
1061
|
+
variant: 'rate_limit';
|
|
1062
|
+
message: string;
|
|
1063
|
+
}
|
|
1064
|
+
interface ApiKeyFailure {
|
|
1065
|
+
variant: 'api_key';
|
|
1066
|
+
message: string;
|
|
1067
|
+
}
|
|
1068
|
+
interface UnknownFailure {
|
|
1069
|
+
variant: 'unknown';
|
|
1070
|
+
message: string;
|
|
1071
|
+
}
|
|
1072
|
+
interface CancelledFailure {
|
|
1073
|
+
/**
|
|
1074
|
+
* Operation was cancelled, typically by an AbortSignal from a controlling process (e.g., test runner pool).
|
|
1075
|
+
*/
|
|
1076
|
+
variant: 'cancelled';
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
type RetryMode = {
|
|
1080
|
+
mode: 'retry_on_partial_message';
|
|
1081
|
+
errorSubstrings: string[];
|
|
1082
|
+
} | {
|
|
1083
|
+
mode: 'retry_all';
|
|
1084
|
+
};
|
|
1085
|
+
type RetryParams = {
|
|
1086
|
+
retryLimit: number;
|
|
1087
|
+
delayMs: number;
|
|
1088
|
+
showWarnOnRetry: boolean;
|
|
1089
|
+
};
|
|
1090
|
+
type RetryOptions = RetryMode & RetryParams;
|
|
1091
|
+
declare function retryOnErrorIsSuccess<T>(fnToRetry: () => Promise<T>, retryOptions: RetryMode & Partial<RetryParams>): Promise<boolean>;
|
|
1092
|
+
declare function retryOnError<T>(fnToRetry: () => Promise<T>, retryOptions: RetryMode & Partial<RetryParams>): Promise<T>;
|
|
1093
|
+
/**
|
|
1094
|
+
* Performs a deep comparison between two values to determine if they are equivalent.
|
|
1095
|
+
*
|
|
1096
|
+
* @param a The first value to compare.
|
|
1097
|
+
* @param b The second value to compare.
|
|
1098
|
+
* @param cache A WeakMap to handle circular references. Should not be provided by the caller.
|
|
1099
|
+
* @returns `true` if the values are deeply equal, `false` otherwise.
|
|
1100
|
+
*/
|
|
1101
|
+
declare function deepEquals(a: any, b: any, cache?: WeakMap<object, WeakSet<object>>): boolean;
|
|
1102
|
+
|
|
1103
|
+
interface TestDataEntry {
|
|
1104
|
+
key: string;
|
|
1105
|
+
value: string;
|
|
1106
|
+
sensitive: boolean;
|
|
1107
|
+
}
|
|
1108
|
+
interface TestData {
|
|
1109
|
+
data?: TestDataEntry[];
|
|
1110
|
+
other?: string;
|
|
1111
|
+
}
|
|
1112
|
+
interface TestStepDefinition {
|
|
1113
|
+
description: string;
|
|
1114
|
+
checks: string[];
|
|
1115
|
+
testData: TestData;
|
|
1116
|
+
}
|
|
1117
|
+
interface TestCaseDefinition {
|
|
1118
|
+
url: string;
|
|
1119
|
+
steps: TestStepDefinition[];
|
|
1120
|
+
recipe?: Intent[];
|
|
1121
|
+
}
|
|
1122
|
+
type TestCaseResult = SuccessfulTestCaseResult | FailedTestCaseResult;
|
|
1123
|
+
interface SuccessfulTestCaseResult {
|
|
1124
|
+
passed: true;
|
|
1125
|
+
recipe: Intent[];
|
|
1126
|
+
}
|
|
1127
|
+
interface FailedTestCaseResult {
|
|
1128
|
+
passed: false;
|
|
1129
|
+
failure: FailureDescriptor;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
declare const createId: () => string;
|
|
1133
|
+
declare const posthog: PostHog;
|
|
1134
|
+
declare function getMachineId(): string;
|
|
1135
|
+
declare function getCodebaseId(): string | undefined;
|
|
1136
|
+
declare function sendTelemetry(eventName: string, properties: Record<string, any>): Promise<void>;
|
|
1137
|
+
|
|
1138
|
+
declare function buildDefaultBrowserAgentOptions({ agentOptions, browserOptions }: {
|
|
1139
|
+
agentOptions: AgentOptions;
|
|
1140
|
+
browserOptions: BrowserConnectorOptions;
|
|
1141
|
+
}): {
|
|
1142
|
+
agentOptions: AgentOptions;
|
|
1143
|
+
browserOptions: BrowserConnectorOptions;
|
|
1144
|
+
};
|
|
1145
|
+
|
|
1146
|
+
declare const logger: pino.Logger<never, boolean>;
|
|
1147
|
+
|
|
1148
|
+
export { type ActOptions, type Action, type ActionContext, type ActionDefinition, type ActionIntent, ActionLimitError, type ActionPayload, Agent, AgentBusyError, type AgentConnector, AgentError, type AgentErrorOptions, type AgentEvents, AgentMemory, type AgentMemoryOptions, type AgentOptions, type AnthropicClient, type ApiKeyFailure, type AzureOpenAIClient, type Base64Image, type BasetenClient, type BedrockClient, type BlockReason, BrowserAgent, type BrowserAgentRole, type BrowserBlock, BrowserBlockedError, type BrowserClickDiagnostics, BrowserConnector, type BrowserConnectorOptions, type BrowserConnectorStateData, type BrowserFailure, type BrowserOptions, BrowserProvider, type BugDetectedFailure, type BugSeverity, type CancelledFailure, type CheckIntent, type ClaudeCodeClient, type ClickIntent, type ClickWebAction, DesktopConnector, type DesktopConnectorOptions, type DesktopInterface, ExtractTimeoutError, type FailedTestCaseResult, type FailureDescriptor, type GoogleAIClient, type GoogleVertexClient, type HoverIntent, type HoverWebAction, type HttpDiagnostic, type Intent, type LLMClient, type LLMClientIdentifier, type MemoryRenderOptions, type MisalignmentFailure, type ModelUsage, type NavigateWebAction, type NetworkFailure, type ObservableDataArray, type ObservableDataObject, type ObservableDataPrimitive, Observation, type ObservationRetentionOptions, type ObservationRole, type ObservationSource, type OpenAIClient, type OpenAIGenericClient, OperationCancelledError, OperationDeadlineError, type OperationDiagnostics, type OperationKind, type OperationOptions, type OperationPhase, type OperationTiming, type PixelCoordinate, type PlannerCallDiagnostics, type PlannerOptions, PlannerTimeoutError, type ProviderAttemptDiagnostics, type RateLimitFailure, type RecoveryOptions, type RenderableContent, type RetryMode, type RetryOptions, type RetryParams, type ScrollIntent, type ScrollWebAction, type SerializedAgentMemory, type SuccessfulTestCaseResult, type SwitchTabIntent, type SwitchTabWebAction, type TestCaseDefinition, type TestCaseResult, type TestData, type TestDataEntry, type TestStepDefinition, type TimeoutPolicy, type TypeIntent, type TypeWebAction, type UnknownFailure, type WebAction, WebHarness, type WebHarnessEvents, type WebHarnessOptions, allBrowserAgentRoles, buildDefaultBrowserAgentOptions, createAction, createId, deepEquals, getCodebaseId, getMachineId, logger, mergeMessages, posthog, retryOnError, retryOnErrorIsSuccess, sendTelemetry, startBrowserAgent };
|