@amalgm/browser 0.1.2-preview.35541635545 → 0.1.2-preview.37254096068
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/PURPOSE.md +119 -97
- package/README.md +51 -56
- package/SECURITY.md +10 -8
- package/dist/bin/amalgm-browser-mcp.js +2 -3
- package/dist/bin/amalgm-browser-mcp.js.map +1 -1
- package/dist/bin/amalgm-browser-rest.js +8 -18
- package/dist/bin/amalgm-browser-rest.js.map +1 -1
- package/dist/src/account.d.ts +8 -0
- package/dist/src/account.js +42 -0
- package/dist/src/account.js.map +1 -0
- package/dist/src/action.d.ts +1 -2
- package/dist/src/action.js +3 -7
- package/dist/src/action.js.map +1 -1
- package/dist/src/adapters/cli/actions.d.ts +0 -1
- package/dist/src/adapters/cli/actions.js +0 -7
- package/dist/src/adapters/cli/actions.js.map +1 -1
- package/dist/src/adapters/cli/help.d.ts +1 -1
- package/dist/src/adapters/cli/help.js +1 -4
- package/dist/src/adapters/cli/help.js.map +1 -1
- package/dist/src/adapters/cli/resources.js +0 -22
- package/dist/src/adapters/cli/resources.js.map +1 -1
- package/dist/src/adapters/cli/run.js +25 -19
- package/dist/src/adapters/cli/run.js.map +1 -1
- package/dist/src/adapters/execute.js +2 -2
- package/dist/src/adapters/execute.js.map +1 -1
- package/dist/src/adapters/http/events.d.ts +5 -2
- package/dist/src/adapters/http/events.js +18 -2
- package/dist/src/adapters/http/events.js.map +1 -1
- package/dist/src/adapters/http/internal-routes.js +9 -4
- package/dist/src/adapters/http/internal-routes.js.map +1 -1
- package/dist/src/adapters/http/navigation-stream.d.ts +4 -0
- package/dist/src/adapters/http/navigation-stream.js +17 -0
- package/dist/src/adapters/http/navigation-stream.js.map +1 -0
- package/dist/src/adapters/http/openapi.js +2 -8
- package/dist/src/adapters/http/openapi.js.map +1 -1
- package/dist/src/adapters/http/server.js +54 -14
- package/dist/src/adapters/http/server.js.map +1 -1
- package/dist/src/adapters/http/session-routes.js +0 -1
- package/dist/src/adapters/http/session-routes.js.map +1 -1
- package/dist/src/adapters/http/stream.d.ts +6 -0
- package/dist/src/adapters/http/stream.js +89 -0
- package/dist/src/adapters/http/stream.js.map +1 -0
- package/dist/src/adapters/mcp/server.js +2 -2
- package/dist/src/adapters/mcp/server.js.map +1 -1
- package/dist/src/adapters/mcp/tools.js +2 -4
- package/dist/src/adapters/mcp/tools.js.map +1 -1
- package/dist/src/adapters/mcp/types.d.ts +3 -2
- package/dist/src/adapters/toolbox/manifest.js +1 -1
- package/dist/src/adapters/toolbox/manifest.js.map +1 -1
- package/dist/src/auth/login.d.ts +3 -1
- package/dist/src/auth/login.js +48 -33
- package/dist/src/auth/login.js.map +1 -1
- package/dist/src/auth/service.js +56 -67
- package/dist/src/auth/service.js.map +1 -1
- package/dist/src/{drivers/cdp → cdp}/capture.d.ts +1 -1
- package/dist/src/{drivers/cdp → cdp}/capture.js +1 -1
- package/dist/src/cdp/capture.js.map +1 -0
- package/dist/src/{drivers/cdp → cdp}/client.d.ts +3 -1
- package/dist/src/{drivers/cdp → cdp}/client.js +51 -14
- package/dist/src/cdp/client.js.map +1 -0
- package/dist/src/cdp/input.js.map +1 -0
- package/dist/src/cdp/navigation.d.ts +5 -0
- package/dist/src/cdp/navigation.js +47 -0
- package/dist/src/cdp/navigation.js.map +1 -0
- package/dist/src/{drivers/cdp → cdp}/screencast.js +1 -1
- package/dist/src/cdp/screencast.js.map +1 -0
- package/dist/src/chrome/cookie-adapter.d.ts +23 -0
- package/dist/src/chrome/cookie-adapter.js +74 -0
- package/dist/src/chrome/cookie-adapter.js.map +1 -0
- package/dist/src/chrome/cookie-changes.d.ts +12 -0
- package/dist/src/chrome/cookie-changes.js +100 -0
- package/dist/src/chrome/cookie-changes.js.map +1 -0
- package/dist/src/chrome/cookie-observer.d.ts +20 -0
- package/dist/src/chrome/cookie-observer.js +44 -0
- package/dist/src/chrome/cookie-observer.js.map +1 -0
- package/dist/src/chrome/executable.d.ts +1 -0
- package/dist/src/chrome/executable.js +55 -0
- package/dist/src/chrome/executable.js.map +1 -0
- package/dist/src/chrome/flags.d.ts +7 -0
- package/dist/src/chrome/flags.js +59 -0
- package/dist/src/chrome/flags.js.map +1 -0
- package/dist/src/chrome/host.d.ts +25 -0
- package/dist/src/chrome/host.js +137 -0
- package/dist/src/chrome/host.js.map +1 -0
- package/dist/src/chrome/launch.d.ts +11 -0
- package/dist/src/chrome/launch.js +105 -0
- package/dist/src/chrome/launch.js.map +1 -0
- package/dist/src/chrome/relay/editing.d.ts +2 -0
- package/dist/src/chrome/relay/editing.js +14 -0
- package/dist/src/chrome/relay/editing.js.map +1 -0
- package/dist/src/chrome/relay/server.d.ts +18 -0
- package/dist/src/chrome/relay/server.js +120 -0
- package/dist/src/chrome/relay/server.js.map +1 -0
- package/dist/src/chrome/relay/targets.d.ts +11 -0
- package/dist/src/chrome/relay/targets.js +59 -0
- package/dist/src/chrome/relay/targets.js.map +1 -0
- package/dist/src/chrome/relay/view.d.ts +34 -0
- package/dist/src/chrome/relay/view.js +185 -0
- package/dist/src/chrome/relay/view.js.map +1 -0
- package/dist/src/cookies/adapter-credential.d.ts +6 -0
- package/dist/src/cookies/adapter-credential.js +33 -0
- package/dist/src/cookies/adapter-credential.js.map +1 -0
- package/dist/src/cookies/coordinator.d.ts +14 -13
- package/dist/src/cookies/coordinator.js +157 -75
- package/dist/src/cookies/coordinator.js.map +1 -1
- package/dist/src/cookies/database.d.ts +29 -0
- package/dist/src/cookies/database.js +113 -0
- package/dist/src/cookies/database.js.map +1 -0
- package/dist/src/cookies/diff.d.ts +6 -0
- package/dist/src/cookies/diff.js +19 -0
- package/dist/src/cookies/diff.js.map +1 -0
- package/dist/src/cookies/http-store.d.ts +7 -0
- package/dist/src/cookies/http-store.js +105 -0
- package/dist/src/cookies/http-store.js.map +1 -0
- package/dist/src/cookies/jar.d.ts +12 -11
- package/dist/src/cookies/jar.js +128 -120
- package/dist/src/cookies/jar.js.map +1 -1
- package/dist/src/cookies/policy.js +10 -4
- package/dist/src/cookies/policy.js.map +1 -1
- package/dist/src/cookies/secret-file.d.ts +4 -0
- package/dist/src/cookies/secret-file.js +47 -9
- package/dist/src/cookies/secret-file.js.map +1 -1
- package/dist/src/cookies/types.d.ts +34 -2
- package/dist/src/cookies.d.ts +2 -0
- package/dist/src/cookies.js +2 -0
- package/dist/src/cookies.js.map +1 -1
- package/dist/src/defaults.d.ts +1 -5
- package/dist/src/defaults.js +49 -58
- package/dist/src/defaults.js.map +1 -1
- package/dist/src/driver/cli-policy.d.ts +1 -0
- package/dist/src/driver/cli-policy.js +17 -0
- package/dist/src/driver/cli-policy.js.map +1 -0
- package/dist/src/{drivers/headless → driver}/command.d.ts +3 -7
- package/dist/src/{drivers/headless → driver}/command.js +29 -29
- package/dist/src/driver/command.js.map +1 -0
- package/dist/src/{drivers/headless → driver}/driver.d.ts +13 -10
- package/dist/src/{drivers/headless → driver}/driver.js +67 -82
- package/dist/src/driver/driver.js.map +1 -0
- package/dist/src/{interaction/delta.d.ts → driver/evidence.d.ts} +3 -2
- package/dist/src/{interaction/delta.js → driver/evidence.js} +6 -3
- package/dist/src/driver/evidence.js.map +1 -0
- package/dist/src/driver/executable.js.map +1 -0
- package/dist/src/driver/stream.d.ts +1 -0
- package/dist/src/driver/stream.js +22 -0
- package/dist/src/driver/stream.js.map +1 -0
- package/dist/src/driver/wait.d.ts +6 -0
- package/dist/src/driver/wait.js +28 -0
- package/dist/src/driver/wait.js.map +1 -0
- package/dist/src/electron/adblock/cache.js.map +1 -0
- package/dist/src/electron/adblock/cosmetics.js.map +1 -0
- package/dist/src/{drivers/electron/native → electron}/adblock/index.d.ts +0 -1
- package/dist/src/{drivers/electron/native → electron}/adblock/index.js +0 -1
- package/dist/src/{drivers/electron/native → electron}/adblock/index.js.map +1 -1
- package/dist/src/electron/adblock/policy.js.map +1 -0
- package/dist/src/electron/adblock/preload.js.map +1 -0
- package/dist/src/electron/adblock/settings.js.map +1 -0
- package/dist/src/{drivers/electron/native → electron}/contracts.d.ts +0 -14
- package/dist/src/{drivers/electron/native → electron}/contracts.js +0 -1
- package/dist/src/electron/contracts.js.map +1 -0
- package/dist/src/{drivers/electron → electron}/cookie-adapter.d.ts +4 -4
- package/dist/src/{drivers/electron → electron}/cookie-adapter.js +9 -6
- package/dist/src/electron/cookie-adapter.js.map +1 -0
- package/dist/src/electron/cookie-sync.d.ts +6 -0
- package/dist/src/electron/cookie-sync.js +18 -0
- package/dist/src/electron/cookie-sync.js.map +1 -0
- package/dist/src/electron/policy.js.map +1 -0
- package/dist/src/electron/session.d.ts +2 -0
- package/dist/src/electron/session.js +9 -0
- package/dist/src/electron/session.js.map +1 -0
- package/dist/src/electron/shell/adblock-ipc.js.map +1 -0
- package/dist/src/electron/shell/context-menu.js.map +1 -0
- package/dist/src/electron/shell/downloads.js.map +1 -0
- package/dist/src/electron/shell/helpers.js.map +1 -0
- package/dist/src/electron/shell/permissions.js.map +1 -0
- package/dist/src/{drivers/electron/native → electron}/shell/sites.d.ts +1 -3
- package/dist/src/{drivers/electron/native → electron}/shell/sites.js +2 -34
- package/dist/src/electron/shell/sites.js.map +1 -0
- package/dist/src/{drivers/electron/native → electron}/shell/types.d.ts +0 -1
- package/dist/src/electron/shell/types.js.map +1 -0
- package/dist/src/electron/shell.d.ts +13 -0
- package/dist/src/electron/shell.js +73 -0
- package/dist/src/electron/shell.js.map +1 -0
- package/dist/src/electron/surface/commands.js.map +1 -0
- package/dist/src/{drivers/electron/native → electron}/surface/create.js +0 -6
- package/dist/src/electron/surface/create.js.map +1 -0
- package/dist/src/{drivers/electron/native → electron}/surface/events.js +1 -13
- package/dist/src/electron/surface/events.js.map +1 -0
- package/dist/src/{drivers/electron/native → electron}/surface/presentation.d.ts +2 -9
- package/dist/src/electron/surface/presentation.js +29 -0
- package/dist/src/electron/surface/presentation.js.map +1 -0
- package/dist/src/{drivers/electron/native → electron}/surface/state.d.ts +5 -0
- package/dist/src/{drivers/electron/native → electron}/surface/state.js +10 -4
- package/dist/src/electron/surface/state.js.map +1 -0
- package/dist/src/{drivers/electron/native → electron}/surface/types.d.ts +2 -8
- package/dist/src/electron/surface/types.js.map +1 -0
- package/dist/src/{drivers/electron/native → electron}/surface-controller.js +9 -12
- package/dist/src/electron/surface-controller.js.map +1 -0
- package/dist/src/electron-preload.cjs +1 -1
- package/dist/src/electron.cjs +587 -820
- package/dist/src/electron.d.cts +4 -14
- package/dist/src/electron.d.ts +4 -14
- package/dist/src/electron.js +4 -14
- package/dist/src/electron.js.map +1 -1
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +2 -3
- package/dist/src/index.js +0 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/migration/legacy-migration.d.ts +0 -1
- package/dist/src/migration/legacy-migration.js +3 -9
- package/dist/src/migration/legacy-migration.js.map +1 -1
- package/dist/src/migration/legacy-rows.d.ts +1 -2
- package/dist/src/migration/legacy-rows.js +0 -14
- package/dist/src/migration/legacy-rows.js.map +1 -1
- package/dist/src/ports.d.ts +12 -15
- package/dist/src/ports.js.map +1 -1
- package/dist/src/process.d.ts +1 -0
- package/dist/src/process.js +11 -0
- package/dist/src/process.js.map +1 -1
- package/dist/src/product-service.d.ts +4 -6
- package/dist/src/product-service.js +21 -15
- package/dist/src/product-service.js.map +1 -1
- package/dist/src/recording/encoder.js +1 -1
- package/dist/src/recording/encoder.js.map +1 -1
- package/dist/src/recording/service.d.ts +4 -0
- package/dist/src/recording/service.js +72 -62
- package/dist/src/recording/service.js.map +1 -1
- package/dist/src/recording/source.js +1 -1
- package/dist/src/recording/source.js.map +1 -1
- package/dist/src/registry.d.ts +4 -0
- package/dist/src/registry.js +17 -0
- package/dist/src/registry.js.map +1 -1
- package/dist/src/service-options.d.ts +5 -7
- package/dist/src/service.d.ts +16 -18
- package/dist/src/service.js +108 -108
- package/dist/src/service.js.map +1 -1
- package/dist/src/sessions/operations.d.ts +12 -0
- package/dist/src/sessions/operations.js +56 -0
- package/dist/src/sessions/operations.js.map +1 -0
- package/dist/src/testing.d.ts +8 -4
- package/dist/src/testing.js +7 -5
- package/dist/src/testing.js.map +1 -1
- package/dist/src/types.d.ts +0 -39
- package/docs/ACTIONS.md +0 -4
- package/docs/ARCHITECTURE.md +51 -55
- package/docs/AUTHENTICATION.md +41 -36
- package/docs/AXIOMS.md +13 -11
- package/docs/CHROME.md +143 -0
- package/docs/CLI.md +63 -31
- package/docs/COMPATIBILITY.md +14 -23
- package/docs/COOKIES.md +95 -52
- package/docs/ELECTRON_INTEGRATION.md +84 -77
- package/docs/EVENTS.md +5 -9
- package/docs/MCP.md +10 -6
- package/docs/MIGRATION.md +43 -36
- package/docs/OPERATIONS.md +48 -40
- package/docs/README.md +5 -5
- package/docs/REALTIME_BOUNDARY.md +3 -3
- package/docs/RECORDING.md +16 -15
- package/docs/REST.md +57 -26
- package/docs/SDK.md +65 -55
- package/docs/SHELL_INTEGRATION.md +78 -36
- package/docs/TESTING.md +58 -42
- package/docs/TOOLBOX_INTEGRATION.md +9 -4
- package/docs/TROUBLESHOOTING.md +68 -40
- package/examples/basic.ts +1 -0
- package/package.json +8 -15
- package/skills/use-amalgm-browser/SKILL.md +16 -29
- package/skills/use-amalgm-browser/references/actions.md +2 -2
- package/dist/src/adapters/http/profile-routes.d.ts +0 -2
- package/dist/src/adapters/http/profile-routes.js +0 -42
- package/dist/src/adapters/http/profile-routes.js.map +0 -1
- package/dist/src/auth/transport.d.ts +0 -8
- package/dist/src/auth/transport.js +0 -45
- package/dist/src/auth/transport.js.map +0 -1
- package/dist/src/drivers/cdp/capture.js.map +0 -1
- package/dist/src/drivers/cdp/client.js.map +0 -1
- package/dist/src/drivers/cdp/input.js.map +0 -1
- package/dist/src/drivers/cdp/screencast.js.map +0 -1
- package/dist/src/drivers/cdp/target.d.ts +0 -4
- package/dist/src/drivers/cdp/target.js +0 -34
- package/dist/src/drivers/cdp/target.js.map +0 -1
- package/dist/src/drivers/electron/advertisement.d.ts +0 -12
- package/dist/src/drivers/electron/advertisement.js +0 -57
- package/dist/src/drivers/electron/advertisement.js.map +0 -1
- package/dist/src/drivers/electron/contracts.d.ts +0 -45
- package/dist/src/drivers/electron/contracts.js +0 -10
- package/dist/src/drivers/electron/contracts.js.map +0 -1
- package/dist/src/drivers/electron/cookie-adapter.js.map +0 -1
- package/dist/src/drivers/electron/driver.d.ts +0 -19
- package/dist/src/drivers/electron/driver.js +0 -115
- package/dist/src/drivers/electron/driver.js.map +0 -1
- package/dist/src/drivers/electron/native/adblock/cache.js.map +0 -1
- package/dist/src/drivers/electron/native/adblock/cosmetics.js.map +0 -1
- package/dist/src/drivers/electron/native/adblock/policy.js.map +0 -1
- package/dist/src/drivers/electron/native/adblock/preload.js.map +0 -1
- package/dist/src/drivers/electron/native/adblock/settings.js.map +0 -1
- package/dist/src/drivers/electron/native/config.d.ts +0 -4
- package/dist/src/drivers/electron/native/config.js +0 -9
- package/dist/src/drivers/electron/native/config.js.map +0 -1
- package/dist/src/drivers/electron/native/contracts.js.map +0 -1
- package/dist/src/drivers/electron/native/policy.js.map +0 -1
- package/dist/src/drivers/electron/native/session.d.ts +0 -4
- package/dist/src/drivers/electron/native/session.js +0 -11
- package/dist/src/drivers/electron/native/session.js.map +0 -1
- package/dist/src/drivers/electron/native/shell/adblock-ipc.js.map +0 -1
- package/dist/src/drivers/electron/native/shell/context-menu.js.map +0 -1
- package/dist/src/drivers/electron/native/shell/downloads.js.map +0 -1
- package/dist/src/drivers/electron/native/shell/helpers.js.map +0 -1
- package/dist/src/drivers/electron/native/shell/permissions.js.map +0 -1
- package/dist/src/drivers/electron/native/shell/sites.js.map +0 -1
- package/dist/src/drivers/electron/native/shell/types.js.map +0 -1
- package/dist/src/drivers/electron/native/shell.d.ts +0 -14
- package/dist/src/drivers/electron/native/shell.js +0 -115
- package/dist/src/drivers/electron/native/shell.js.map +0 -1
- package/dist/src/drivers/electron/native/surface/commands.js.map +0 -1
- package/dist/src/drivers/electron/native/surface/create.js.map +0 -1
- package/dist/src/drivers/electron/native/surface/events.js.map +0 -1
- package/dist/src/drivers/electron/native/surface/presentation.js +0 -87
- package/dist/src/drivers/electron/native/surface/presentation.js.map +0 -1
- package/dist/src/drivers/electron/native/surface/state.js.map +0 -1
- package/dist/src/drivers/electron/native/surface/types.js.map +0 -1
- package/dist/src/drivers/electron/native/surface-controller.js.map +0 -1
- package/dist/src/drivers/electron/policy.d.ts +0 -4
- package/dist/src/drivers/electron/policy.js +0 -39
- package/dist/src/drivers/electron/policy.js.map +0 -1
- package/dist/src/drivers/electron/session.d.ts +0 -4
- package/dist/src/drivers/electron/session.js +0 -5
- package/dist/src/drivers/electron/session.js.map +0 -1
- package/dist/src/drivers/headless/command.js.map +0 -1
- package/dist/src/drivers/headless/cookie-adapter.d.ts +0 -16
- package/dist/src/drivers/headless/cookie-adapter.js +0 -59
- package/dist/src/drivers/headless/cookie-adapter.js.map +0 -1
- package/dist/src/drivers/headless/driver.js.map +0 -1
- package/dist/src/drivers/headless/executable.js.map +0 -1
- package/dist/src/drivers/headless/screencast.d.ts +0 -3
- package/dist/src/drivers/headless/screencast.js +0 -21
- package/dist/src/drivers/headless/screencast.js.map +0 -1
- package/dist/src/headless.d.ts +0 -3
- package/dist/src/headless.js +0 -4
- package/dist/src/headless.js.map +0 -1
- package/dist/src/interaction/delta.js.map +0 -1
- package/dist/src/interaction/typing.d.ts +0 -39
- package/dist/src/interaction/typing.js +0 -189
- package/dist/src/interaction/typing.js.map +0 -1
- package/dist/src/profiles/directories.d.ts +0 -9
- package/dist/src/profiles/directories.js +0 -57
- package/dist/src/profiles/directories.js.map +0 -1
- package/dist/src/profiles/service.d.ts +0 -30
- package/dist/src/profiles/service.js +0 -89
- package/dist/src/profiles/service.js.map +0 -1
- package/dist/src/runtime-selector.d.ts +0 -12
- package/dist/src/runtime-selector.js +0 -72
- package/dist/src/runtime-selector.js.map +0 -1
- package/docs/HEADLESS_RUNTIME.md +0 -58
- package/examples/custom-driver.ts +0 -45
- /package/dist/src/{drivers/cdp → cdp}/input.d.ts +0 -0
- /package/dist/src/{drivers/cdp → cdp}/input.js +0 -0
- /package/dist/src/{drivers/cdp → cdp}/screencast.d.ts +0 -0
- /package/dist/src/{drivers/headless → driver}/executable.d.ts +0 -0
- /package/dist/src/{drivers/headless → driver}/executable.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/adblock/cache.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/adblock/cache.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/adblock/cosmetics.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/adblock/cosmetics.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/adblock/policy.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/adblock/policy.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/adblock/preload.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/adblock/preload.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/adblock/settings.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/adblock/settings.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/policy.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/policy.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/shell/adblock-ipc.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/shell/adblock-ipc.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/shell/context-menu.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/shell/context-menu.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/shell/downloads.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/shell/downloads.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/shell/helpers.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/shell/helpers.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/shell/permissions.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/shell/permissions.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/shell/types.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/surface/commands.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/surface/commands.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/surface/create.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/surface/events.d.ts +0 -0
- /package/dist/src/{drivers/electron/native → electron}/surface/types.js +0 -0
- /package/dist/src/{drivers/electron/native → electron}/surface-controller.d.ts +0 -0
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -1,71 +1,67 @@
|
|
|
1
1
|
# Architecture
|
|
2
2
|
|
|
3
|
-
`BrowserProductService` is the product boundary. It
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
policy.
|
|
3
|
+
`BrowserProductService` is the product boundary. It holds session policy, the
|
|
4
|
+
account, auth bundles, login handoffs, recordings, and the account's cookie
|
|
5
|
+
jar. The driver operates the runtime's one Chrome. Transport adapters turn
|
|
6
|
+
their inputs into service calls and own no browser policy.
|
|
8
7
|
|
|
9
|
-
##
|
|
8
|
+
## Flow of one action
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
1. An adapter picks the session (an explicit `session`, else the caller's
|
|
11
|
+
`callerId`, else `default`) and calls `createSession`, which creates it or,
|
|
12
|
+
after a restart, reopens it.
|
|
13
|
+
2. `BrowserService.execute` checks the session is ready and idle, authorizes
|
|
14
|
+
the action, and takes the session lease.
|
|
15
|
+
3. The driver runs the action through the session's agent-browser daemon, or
|
|
16
|
+
over CDP for capture and some input, and then syncs cookies.
|
|
17
|
+
4. The service stores the result and emits a sanitized event.
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
acquires the session lease.
|
|
17
|
-
3. The session's immutable backend selects exactly one driver.
|
|
18
|
-
4. The driver acts on the session's exact page or verified visible surface.
|
|
19
|
-
5. The service persists the transition and emits a sanitized event.
|
|
20
|
-
|
|
21
|
-
CLI, MCP, REST, and Toolbox all dispatch through the same canonical action
|
|
22
|
-
descriptor array. The generated reachability test calls all 22 actions through
|
|
23
|
-
all five surfaces.
|
|
19
|
+
CLI, MCP, REST, and Toolbox dispatch through one action descriptor array. The
|
|
20
|
+
parity test calls all 22 actions through all five surfaces.
|
|
24
21
|
|
|
25
22
|
## Ownership map
|
|
26
23
|
|
|
27
|
-
- `service.ts`, `product-service.ts`
|
|
28
|
-
|
|
29
|
-
- `
|
|
30
|
-
- `
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- `
|
|
35
|
-
- `
|
|
36
|
-
|
|
37
|
-
- `
|
|
38
|
-
|
|
24
|
+
- `service.ts`, `product-service.ts`, `account.ts`: the mutation boundary,
|
|
25
|
+
product services, and the one browsing identity
|
|
26
|
+
- `sessions/`: leases and pruning
|
|
27
|
+
- `chrome/`: finding, launching, owning, and restarting Chrome; the per-session
|
|
28
|
+
CDP relay; the Chrome cookie adapter
|
|
29
|
+
- `driver/`: the agent-browser driver, command runner, waits, action evidence,
|
|
30
|
+
and live-view stream
|
|
31
|
+
- `cdp/`: page capture, screencast, input, and a cancellable protocol client
|
|
32
|
+
- `cookies/`: the encrypted jar, cookie policy, and the coordinator that syncs
|
|
33
|
+
each browser with the jar
|
|
34
|
+
- `electron/`: the Electron shell (native tabs, policy, downloads,
|
|
35
|
+
permissions, context menus, ad blocking) and a cookie adapter for its
|
|
36
|
+
partition
|
|
37
|
+
- `auth/`: named bundles and TTL-bound human login
|
|
38
|
+
- `recording/`: screencast sampling and the bounded WebM encoder
|
|
39
|
+
- `persistence/`, `migration/`: SQLite state and the one-time legacy import
|
|
40
|
+
- `adapters/`: CLI, MCP, REST with SSE and the live-view WebSocket, and Toolbox
|
|
39
41
|
|
|
40
|
-
##
|
|
42
|
+
## One Chrome, many sessions
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
A runtime has one `ChromeHost`. Each session reaches it through its own relay
|
|
45
|
+
endpoint, which shows the session only its own tabs and places new tabs in the
|
|
46
|
+
account's browser context. All sessions therefore share one set of cookies.
|
|
47
|
+
See [Chrome runtime](./CHROME.md).
|
|
46
48
|
|
|
47
49
|
## Persistence and concurrency
|
|
48
50
|
|
|
49
|
-
SQLite stores each metadata entity
|
|
50
|
-
and holds cross-process session leases. Encrypted cookie
|
|
51
|
-
atomic private files
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
The Electron host creates native `WebContentsView` pages in the isolated
|
|
59
|
-
Browser partition. Protocol-6 identity combines a session stamp, surface ID,
|
|
60
|
-
marker URL, and declared target type. The driver verifies that identity before
|
|
61
|
-
every action. It may reattach once only when the original surface is genuinely
|
|
62
|
-
gone; ambiguity or mismatch fails before page input.
|
|
51
|
+
SQLite stores each metadata entity separately, uses WAL and a busy timeout,
|
|
52
|
+
and holds cross-process session leases. Encrypted cookie, login, and auth
|
|
53
|
+
payloads live in atomic private files. Registry and migration writes are
|
|
54
|
+
transactional. Sessions are durable: after a restart, a ready session reopens
|
|
55
|
+
when `createSession` names it again. Chrome itself has one owning process per
|
|
56
|
+
root, enforced by the OS-held `<root>/chrome.lease.sqlite` lease.
|
|
57
|
+
`browser.close()` stops admission, cancels and drains admitted work, then stops
|
|
58
|
+
recordings, detaches every session, stops Chrome, and closes the registry.
|
|
63
59
|
|
|
64
60
|
## Data movement
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
only.
|
|
62
|
+
The account's encrypted jar is the store of record for cookies. The
|
|
63
|
+
coordinator keeps each registered browser store in two-way sync with it; the
|
|
64
|
+
runtime registers Chrome's account context. Deletions are tombstones, and
|
|
65
|
+
ordering by timestamp then source makes merges deterministic. Named auth
|
|
66
|
+
bundles are explicit filtered snapshots and can also carry origin storage.
|
|
67
|
+
Events and ordinary resource projections contain metadata only.
|
package/docs/AUTHENTICATION.md
CHANGED
|
@@ -1,56 +1,61 @@
|
|
|
1
1
|
# Authentication and login handoff
|
|
2
2
|
|
|
3
|
-
Browser
|
|
4
|
-
and human login sessions.
|
|
3
|
+
Browser keeps three things apart: the account's automatic cookies (see
|
|
4
|
+
[cookies](./COOKIES.md)), named auth bundles, and human login sessions.
|
|
5
5
|
|
|
6
6
|
## Named auth bundles
|
|
7
7
|
|
|
8
|
-
`browser.auth.save`
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
`browser.auth.save` takes the session's state through agent-browser
|
|
9
|
+
`state save`, filters it to explicit domains (or the page's domain), encrypts
|
|
10
|
+
the payload under `auth-bundles/`, and stores only metadata in SQLite. A
|
|
11
|
+
payload can hold cookies, localStorage, and sessionStorage. List and get
|
|
12
|
+
return ID, name, account (`profileId`), domains, storage kinds, and
|
|
13
|
+
timestamps, never values.
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
`browser.auth.load` writes a bundle into a session through `state load`. All
|
|
16
|
+
sessions share the account's browser context, so loaded cookies are visible to
|
|
17
|
+
every session at once and reach the cookie jar at the next sync. Deleting
|
|
18
|
+
removes both the encrypted payload and the metadata.
|
|
16
19
|
|
|
17
|
-
Portable export
|
|
18
|
-
32-byte portable key and
|
|
19
|
-
resource is still ciphertext
|
|
20
|
+
Portable export and import re-encrypt a bundle with an explicitly authorized
|
|
21
|
+
32-byte portable key and verify metadata integrity on import. The portable
|
|
22
|
+
resource is still ciphertext; handle it as a credential.
|
|
20
23
|
|
|
21
24
|
## Human login
|
|
22
25
|
|
|
23
|
-
`browser.login.create` returns a session
|
|
24
|
-
|
|
25
|
-
result. Browser stores
|
|
26
|
-
|
|
26
|
+
`browser.login.create` returns a login session, one random token, and a
|
|
27
|
+
handoff URL (`/browser-auth/<id>?token=<token>`). The token appears only in
|
|
28
|
+
that result. Browser stores its SHA-256 hash and compares in constant time;
|
|
29
|
+
list and get never return it.
|
|
27
30
|
|
|
28
|
-
TTL defaults to 15 minutes and is clamped
|
|
29
|
-
uses a durable profile while pending or active:
|
|
31
|
+
TTL defaults to 15 minutes and is clamped to between one minute and one hour.
|
|
30
32
|
|
|
31
|
-
1. Create the handoff for a target URL and
|
|
32
|
-
2. Activate it
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
1. Create the handoff for a target URL and its domains.
|
|
34
|
+
2. Activate it with the token. Browser opens browser session `login-<id>` on
|
|
35
|
+
the target URL.
|
|
36
|
+
3. Forward screenshots and input (`input` takes a `cua` operation) while the
|
|
37
|
+
human signs in.
|
|
38
|
+
4. Complete to save a named bundle and close the session, or cancel to close
|
|
39
|
+
it without saving.
|
|
36
40
|
|
|
37
|
-
|
|
38
|
-
cannot be reused.
|
|
41
|
+
An expired active login's session is closed. Completed, cancelled, and expired
|
|
42
|
+
tokens cannot be reused. Each change publishes `login.updated`.
|
|
43
|
+
Transitions for one handoff are serialized. Repeating activation returns the
|
|
44
|
+
same active page without restarting navigation or interrupting the person's
|
|
45
|
+
input; cancellation and completion cannot be undone by an earlier activation.
|
|
39
46
|
|
|
40
|
-
##
|
|
47
|
+
## Presentation
|
|
41
48
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Transport selection is presentation; the auth lifecycle and profile ownership
|
|
48
|
-
remain Browser rules.
|
|
49
|
+
Every login uses its runtime session's ordinary live view in the canonical
|
|
50
|
+
browser component, including on Electron. New metadata uses `external` and
|
|
51
|
+
`ready`. Legacy `transport` and `liveUrl` inputs remain accepted for tool and
|
|
52
|
+
SDK compatibility, but do not select another browser or transport. Historical
|
|
53
|
+
metadata remains readable; there is no VNC implementation or configuration.
|
|
49
54
|
|
|
50
55
|
## Security boundary
|
|
51
56
|
|
|
52
57
|
Device-local AES-GCM encryption protects against accidental plaintext
|
|
53
|
-
exposure, not an attacker who can read both encrypted files and
|
|
54
|
-
Treat
|
|
58
|
+
exposure, not against an attacker who can read both the encrypted files and
|
|
59
|
+
the local key. Treat handoff URLs, portable resources, captures, and origin
|
|
55
60
|
storage as credentials. They must not enter logs, events, chat history, or
|
|
56
|
-
ordinary resource
|
|
61
|
+
ordinary resource output.
|
package/docs/AXIOMS.md
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
# Axiom map
|
|
2
2
|
|
|
3
|
-
[PURPOSE.md](../PURPOSE.md) is the authoritative list of primitives and
|
|
4
|
-
product axioms. This
|
|
3
|
+
[PURPOSE.md](../PURPOSE.md) is the authoritative list of primitives and 21
|
|
4
|
+
numbered product axioms. This map ties them to the tests that show them.
|
|
5
5
|
|
|
6
6
|
| Axioms | Consequence | Evidence |
|
|
7
7
|
| --- | --- | --- |
|
|
8
|
-
| 1–3 | Browser owns state;
|
|
9
|
-
| 4
|
|
10
|
-
| 6
|
|
11
|
-
| 9
|
|
12
|
-
| 14 |
|
|
13
|
-
| 15 |
|
|
14
|
-
| 16 |
|
|
15
|
-
| 17
|
|
16
|
-
| 19 |
|
|
8
|
+
| 1–3 | Browser owns state; every session browses as the one account | `service.test.ts` account tests |
|
|
9
|
+
| 4 | One owned Chrome, restarted on next use | `real-browser.test.ts` crash recovery and competing-owner tests |
|
|
10
|
+
| 5–6 | Sessions see only their own tabs, reopen after restarts, and stream only themselves | real-browser side-by-side and live-view tests; real-lifecycle CDP and CLI isolation; `service.test.ts` restart reopen |
|
|
11
|
+
| 7–9 | Page identity, cancellation, and bounded output | real-browser duplicate-URL capture; real-lifecycle operation drain; `service`, `process` and `parity` tests |
|
|
12
|
+
| 10–14 | Cookies sync through the encrypted jar without idle scans; secrets stay out of output | `cookies`, `cookie-coordinator`, `cookie-notifications`, `auth`, `adapters` tests; real-browser idle and loopback tests |
|
|
13
|
+
| 15 | Recording proves capture and stays bounded | `recording.test.ts`; real-lifecycle records and decodes page imagery |
|
|
14
|
+
| 16 | Context enters through ports; events are sanitized | `events.test.ts`, `adapters.test.ts` |
|
|
15
|
+
| 17 | Existing state is imported safely | `persistence.test.ts` legacy upgrade |
|
|
16
|
+
| 18–19 | One TypeScript implementation works without Shell, Engine, or Electron | `parity.test.ts`, `surfaces.test.ts`, `verify:pack` |
|
|
17
|
+
| 20 | Shell composes one service; Electron keeps each account in its own partition | `electron-cookies`, `electron-policy` tests; UI's `test:browser` drives real Electron cookie sharing and sign-out through Shell |
|
|
18
|
+
| 21 | agent-browser IPC fits the socket limit | source only (`driver/command.ts`) |
|
|
17
19
|
|
|
18
20
|
When behavior fails, classify it against this map. If code drifted, restore the
|
|
19
21
|
axiom everywhere it applies. If the axiom is incomplete, update
|
package/docs/CHROME.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Chrome runtime
|
|
2
|
+
|
|
3
|
+
Each runtime runs one headless Chrome. Every session drives its own tabs in
|
|
4
|
+
that Chrome, and every tab browses as the runtime's account. `ChromeHost`
|
|
5
|
+
(`src/chrome/`) owns the Chrome process. `AgentBrowserDriver` (`src/driver/`)
|
|
6
|
+
runs each session's actions through its own agent-browser daemon.
|
|
7
|
+
|
|
8
|
+
## Finding Chrome
|
|
9
|
+
|
|
10
|
+
Browser uses the first match:
|
|
11
|
+
|
|
12
|
+
1. `AMALGM_BROWSER_EXECUTABLE_PATH` (or `AGENT_BROWSER_EXECUTABLE_PATH`). If
|
|
13
|
+
the path does not exist, launch fails.
|
|
14
|
+
2. An installed Google Chrome, Chrome Canary, Chromium, or Brave in the
|
|
15
|
+
platform's usual install locations.
|
|
16
|
+
3. Chrome for Testing downloaded by `npx agent-browser install` into
|
|
17
|
+
`~/.agent-browser/browsers`, newest first.
|
|
18
|
+
|
|
19
|
+
If nothing is found, the first action fails with `PROCESS_FAILED` and a hint
|
|
20
|
+
to install Chrome.
|
|
21
|
+
|
|
22
|
+
## Launch
|
|
23
|
+
|
|
24
|
+
Chrome starts on the first action, not when the service is created. It runs
|
|
25
|
+
`--headless=new` with remote debugging on a random loopback port and its user
|
|
26
|
+
data in `<root>/chrome`. It presents a desktop user agent built from the
|
|
27
|
+
installed Chrome's version and turns off the `AutomationControlled` blink
|
|
28
|
+
feature, so sign-in pages see an ordinary desktop Chrome. Sync, first-run,
|
|
29
|
+
translate, and component-update behavior are off, and the window is 1280×800.
|
|
30
|
+
On Linux, `--no-sandbox` is added only when running as root.
|
|
31
|
+
|
|
32
|
+
Chrome's native debugging-listening event admits the process, within a
|
|
33
|
+
20-second deadline. Browser attaches its private cookie extension to the
|
|
34
|
+
account's default profile and reconciles it with the encrypted jar
|
|
35
|
+
(see [cookies](./COOKIES.md)). The extension uses one session on the existing
|
|
36
|
+
control connection, independently of the number of pages. Chrome reports a
|
|
37
|
+
worker's context before it runs the worker script, so Browser's bindings can
|
|
38
|
+
arrive before or after that script. Both sides ask to start delivery, and
|
|
39
|
+
whichever comes second starts it; the worker then announces that it is
|
|
40
|
+
observing. Chrome stops an idle extension worker and restarts it for the next
|
|
41
|
+
cookie change; the new worker announces itself again, and that second
|
|
42
|
+
announcement brings one snapshot to cover the stop. Chrome keeps its
|
|
43
|
+
normal platform credential storage; Browser does not request the basic password
|
|
44
|
+
store or mock keychain.
|
|
45
|
+
|
|
46
|
+
## One owner per root
|
|
47
|
+
|
|
48
|
+
Only one process may run a root's Chrome. An exclusive SQLite transaction in
|
|
49
|
+
`<root>/chrome.lease.sqlite` holds an OS lease for the process lifetime; another
|
|
50
|
+
owner gets `CONFLICT`. The file is never removed. After a dead owner releases
|
|
51
|
+
the lease, Browser retires its exact Chrome through the random browser endpoint
|
|
52
|
+
in that profile's `DevToolsActivePort`, then starts the replacement. No PID or
|
|
53
|
+
command-line match can authorize killing a process.
|
|
54
|
+
|
|
55
|
+
## Restart on next use
|
|
56
|
+
|
|
57
|
+
If Chrome exits, Browser logs a warning and forgets it. The next action starts
|
|
58
|
+
a new Chrome and loads the account's cookies into it. Tabs that were open are
|
|
59
|
+
gone. An action caught by the crash can fail; retry it and it runs in the new
|
|
60
|
+
Chrome.
|
|
61
|
+
|
|
62
|
+
## Sessions and the relay
|
|
63
|
+
|
|
64
|
+
Each session is one agent-browser daemon attached with `--cdp` to the session's
|
|
65
|
+
own relay endpoint, `ws://127.0.0.1:<port>/session/<id>`. The relay gives that
|
|
66
|
+
connection a filtered view of the shared Chrome:
|
|
67
|
+
|
|
68
|
+
- it lists and controls only the session's own tabs;
|
|
69
|
+
- every tab it opens is placed in a new window in the account's browser context;
|
|
70
|
+
- browser-wide methods (`Browser.close`, `Browser.crash`,
|
|
71
|
+
`Target.createBrowserContext`, `Target.disposeBrowserContext`,
|
|
72
|
+
`Target.attachToBrowserTarget`, `Target.setAutoAttach`) are refused.
|
|
73
|
+
|
|
74
|
+
The first time a process uses a session, Browser closes any daemon left by an
|
|
75
|
+
earlier process, then attaches a new one, which opens the session's first tab.
|
|
76
|
+
Closing a session detaches its daemon and closes its tabs in Chrome.
|
|
77
|
+
|
|
78
|
+
agent-browser's IPC sockets live in a private per-user directory under `/tmp`
|
|
79
|
+
(the OS temporary directory on Windows). Each daemon's name is a digest of the
|
|
80
|
+
real Browser root and the session ID, so long roots and IDs fit the socket
|
|
81
|
+
path limit.
|
|
82
|
+
The daemon uses Browser's own empty configuration and explicit launch inputs;
|
|
83
|
+
ambient agent-browser profiles, sessions and providers cannot alter this
|
|
84
|
+
identity. Page-operation argv travels through the CLI's JSON batch input,
|
|
85
|
+
separate from its global flag parser.
|
|
86
|
+
|
|
87
|
+
## Capture and input
|
|
88
|
+
|
|
89
|
+
Snapshots give stable `@eN` references for ordinary DOM actions. Screenshots,
|
|
90
|
+
the `cua` double click, and recording connect straight to the session's page
|
|
91
|
+
over CDP. The relay records the selected target's identity; repeated URLs do
|
|
92
|
+
not make different tabs interchangeable. Without an owned selected target,
|
|
93
|
+
the operation fails with `SURFACE_IDENTITY_FAILED`.
|
|
94
|
+
|
|
95
|
+
Viewport screenshots are in CSS pixels at any device pixel ratio, and
|
|
96
|
+
full-page capture is capped at 8192×16384. Computer use supports screenshot,
|
|
97
|
+
click, double click, move, scroll, type, keypress, and drag. Use it for canvas,
|
|
98
|
+
WebGL, image-only, or hostile custom controls; prefer snapshot references
|
|
99
|
+
elsewhere.
|
|
100
|
+
|
|
101
|
+
## Live view
|
|
102
|
+
|
|
103
|
+
`browser.streamUrl(sessionId)` returns agent-browser's stream for that session,
|
|
104
|
+
`ws://127.0.0.1:<port>`, and turns the stream on if needed. The stream sends
|
|
105
|
+
`status`, `tabs`, and `frame` messages and accepts `input_mouse`,
|
|
106
|
+
`input_keyboard`, and `input_touch`. It shows and drives only that session's
|
|
107
|
+
tabs. Viewers outside the process use the REST route
|
|
108
|
+
`/v1/sessions/<id>/stream` (see [REST](./REST.md)), which also reports the
|
|
109
|
+
selected page's actual Back/Forward availability. Editor shortcuts carry CDP
|
|
110
|
+
editor commands, so they behave consistently in a streamed headless page.
|
|
111
|
+
Navigation observation follows selected-tab and page events; an idle viewer
|
|
112
|
+
does not poll history, and closing it releases its observation connection.
|
|
113
|
+
|
|
114
|
+
## Shutdown
|
|
115
|
+
|
|
116
|
+
`browser.close()` stops admission, cancels and drains in-flight operations,
|
|
117
|
+
then stops recordings, detaches every daemon, drains queued cookie changes,
|
|
118
|
+
stops Chrome (SIGTERM, then SIGKILL after 3 seconds), and closes the
|
|
119
|
+
registry. Chrome is also killed if the Node process exits.
|
|
120
|
+
|
|
121
|
+
## Configuration
|
|
122
|
+
|
|
123
|
+
- `AMALGM_BROWSER_EXECUTABLE_PATH`: the Chrome executable
|
|
124
|
+
- `AMALGM_AGENT_BROWSER_BIN`: the agent-browser executable. Without it,
|
|
125
|
+
Browser uses the platform binary shipped with the `agent-browser` package
|
|
126
|
+
(from `app.asar.unpacked` in packaged Electron apps), then the package's
|
|
127
|
+
JavaScript wrapper, then `agent-browser` on `PATH`.
|
|
128
|
+
- `AMALGM_FFMPEG`: the ffmpeg executable for recording
|
|
129
|
+
|
|
130
|
+
## Real verification
|
|
131
|
+
|
|
132
|
+
`npm run test:real` drives real Chrome and agent-browser against a real site. It
|
|
133
|
+
checks that chats browse side by side as one account, that a viewer can watch
|
|
134
|
+
and drive one chat's live view only with the runtime token, that sign-ins
|
|
135
|
+
survive restarts and follow sign-outs, that a chat keeps browsing after Chrome
|
|
136
|
+
is killed, and that loopback cookies never enter the account. It also measures
|
|
137
|
+
zero cookie scans and history reads while idle, including with a live viewer,
|
|
138
|
+
and verifies background cookie writes and tab-switch history updates. The busy
|
|
139
|
+
page examination starts with 1000 cookies and requires 60 edits to cause zero
|
|
140
|
+
full-store scans, exactly 60 encrypted row writes, and under 120 KB of encoded
|
|
141
|
+
state. Observer reload, worker restart, HttpOnly and partitioned events are exercised in real
|
|
142
|
+
Chrome. Timing/CPU observations describe this local workload, not a universal
|
|
143
|
+
website latency guarantee.
|
package/docs/CLI.md
CHANGED
|
@@ -1,51 +1,87 @@
|
|
|
1
1
|
# CLI
|
|
2
2
|
|
|
3
|
-
`amalgm-browser` prints
|
|
4
|
-
|
|
3
|
+
`amalgm-browser` prints JSON to stdout and sanitized diagnostics to stderr. It
|
|
4
|
+
never constructs a shell command.
|
|
5
|
+
|
|
6
|
+
## One-shot commands
|
|
7
|
+
|
|
8
|
+
Each action or resource command is one process. It starts the runtime's
|
|
9
|
+
Chrome, runs, and stops Chrome before exiting. The session record and the
|
|
10
|
+
account's cookies carry over to the next command; the open page does not. A
|
|
11
|
+
follow-up command in the same session starts on a new blank tab.
|
|
12
|
+
|
|
13
|
+
For multi-step browsing, keep one process running:
|
|
14
|
+
|
|
15
|
+
- `amalgm-browser mcp` for an MCP client
|
|
16
|
+
- `amalgm-browser serve` for REST
|
|
17
|
+
|
|
18
|
+
Only one process can run a root's Chrome at a time. While `mcp` or `serve` is
|
|
19
|
+
running, a one-shot command on the same root that needs Chrome fails with
|
|
20
|
+
`CONFLICT`.
|
|
5
21
|
|
|
6
22
|
## Actions
|
|
7
23
|
|
|
8
24
|
```text
|
|
9
25
|
open <url> snapshot
|
|
10
|
-
screenshot [--full-page]
|
|
11
|
-
fill <target> <text>
|
|
12
|
-
select <target> <value>
|
|
13
|
-
wait [--selector|--url|--ms]
|
|
14
|
-
|
|
26
|
+
screenshot [--full-page] click <target>
|
|
27
|
+
fill <target> <text> [--submit]
|
|
28
|
+
press <key> select <target> <value>
|
|
29
|
+
eval <script> wait [--selector css|--url value|--ms n]
|
|
30
|
+
cli <agent-browser args...> close
|
|
31
|
+
dialog|tab|console|cua --input <json>
|
|
32
|
+
action <name> --input <json>
|
|
15
33
|
```
|
|
16
34
|
|
|
17
|
-
|
|
18
|
-
|
|
35
|
+
The generic `action` form reaches all 22 actions, including recording and
|
|
36
|
+
auth actions.
|
|
37
|
+
|
|
38
|
+
Advanced `cli` argv runs page operations in the current session. Browser owns
|
|
39
|
+
process, connection, account, recording and authentication lifecycle; raw CLI
|
|
40
|
+
management commands cannot replace those owners. Operation argv is sent as
|
|
41
|
+
JSON data, so literal text resembling launch flags stays page text.
|
|
19
42
|
|
|
20
43
|
## Resources
|
|
21
44
|
|
|
22
45
|
```text
|
|
23
|
-
sessions list|get|close|cancel|prune [id]
|
|
24
|
-
|
|
25
|
-
auth
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
sessions list|get|close|cancel|prune [id] [--max-age-ms n]
|
|
47
|
+
auth list
|
|
48
|
+
auth link --url <url> [--domains a,b] [--ttl-ms n] [--transport t] [--live-url u]
|
|
49
|
+
auth save [name] [--domains a,b]
|
|
50
|
+
auth load <bundleId>
|
|
51
|
+
auth delete <bundleId>
|
|
52
|
+
recordings start [--name n] [--fps n] [--duration-ms n]
|
|
53
|
+
recordings stop|cancel|list|get [id]
|
|
28
54
|
doctor
|
|
29
|
-
serve
|
|
55
|
+
serve [--port 0] [--host 127.0.0.1] [--token t] [--allow-remote]
|
|
30
56
|
mcp
|
|
31
57
|
```
|
|
32
58
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
59
|
+
`recordings start` records until `--duration-ms` passes or the process gets
|
|
60
|
+
SIGINT or SIGTERM. In a one-shot command the recorded page is a new blank tab,
|
|
61
|
+
so record through MCP, REST, or the SDK.
|
|
36
62
|
|
|
37
|
-
|
|
38
|
-
stays headless. `--cdp` attaches to an operator-provided endpoint.
|
|
63
|
+
## Global options
|
|
39
64
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```sh
|
|
43
|
-
amalgm-browser mcp
|
|
44
|
-
amalgm-browser serve --token "$AMALGM_BROWSER_TOKEN" --port 8787
|
|
65
|
+
```text
|
|
66
|
+
--session <id> --root <path> --cwd <project> --json --timeout <ms>
|
|
45
67
|
```
|
|
46
68
|
|
|
47
|
-
|
|
48
|
-
|
|
69
|
+
- `--session` names the session; the default is `default`.
|
|
70
|
+
- `--root` sets the state root.
|
|
71
|
+
- `--cwd` supplies opaque cwd context and a local artifact destination. It
|
|
72
|
+
does not create a Browser workspace model.
|
|
73
|
+
- `--json` is accepted; output is always JSON.
|
|
74
|
+
- `--timeout` aborts the command after that many milliseconds and is passed
|
|
75
|
+
to actions that take `timeoutMs`.
|
|
76
|
+
|
|
77
|
+
## serve
|
|
78
|
+
|
|
79
|
+
`serve` binds `127.0.0.1` on a random port unless `--host` or `--port` is
|
|
80
|
+
given, and prints the address to stderr. The bearer token comes from
|
|
81
|
+
`--token` or `AMALGM_BROWSER_TOKEN`. A non-loopback host also requires
|
|
82
|
+
`--allow-remote`. Set `AMALGM_BROWSER_ADAPTER_TOKEN` to enable the internal
|
|
83
|
+
cookie routes. `mcp` and `serve` run until SIGINT or SIGTERM (`mcp` also stops
|
|
84
|
+
when stdin ends), then stop Chrome.
|
|
49
85
|
|
|
50
86
|
## Exit codes
|
|
51
87
|
|
|
@@ -55,7 +91,3 @@ requires `--allow-remote`; bearer authentication remains mandatory.
|
|
|
55
91
|
- `4` resource not found
|
|
56
92
|
- `5` timeout or cancellation
|
|
57
93
|
- `1` other typed failure
|
|
58
|
-
|
|
59
|
-
Use `--timeout <ms>` to abort a blocking operation. Recording start without a
|
|
60
|
-
duration remains active until SIGINT or SIGTERM, then stops and flushes within
|
|
61
|
-
the encoder deadline.
|
package/docs/COMPATIBILITY.md
CHANGED
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
- modules: ESM core imports; ESM and generated CommonJS for
|
|
7
7
|
`@amalgm/browser/electron`
|
|
8
8
|
- Electron: optional peer, version 33 or newer
|
|
9
|
-
-
|
|
10
|
-
|
|
9
|
+
- browser: an installed Chrome, Chrome Canary, Chromium, or Brave, or Chrome
|
|
10
|
+
for Testing (see [Chrome runtime](./CHROME.md))
|
|
11
|
+
- Electron browser partition: `persist:amalgm-browser-<SHA-256 account ID>`;
|
|
12
|
+
application authentication stays in Electron's default partition
|
|
11
13
|
|
|
12
|
-
Core
|
|
13
|
-
|
|
14
|
+
Core imports do not load Electron. The Electron code is available only from
|
|
15
|
+
`@amalgm/browser/electron`.
|
|
14
16
|
|
|
15
17
|
## Action identities
|
|
16
18
|
|
|
@@ -22,25 +24,14 @@ Historical aggregate Browser grants, older prefixed IDs, and individual
|
|
|
22
24
|
`cua_*` names are normalized in the Toolbox compatibility adapter. They are
|
|
23
25
|
not core action aliases and never create doubled Browser prefixes.
|
|
24
26
|
|
|
25
|
-
##
|
|
27
|
+
## Legacy data
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
The versioned importer brings in legacy Engine auth bundles, the saved
|
|
30
|
+
cookie-source bundle with its tombstones, and login sessions, all under the
|
|
31
|
+
runtime's account (see [migration](./MIGRATION.md)).
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
tombstones, and login sessions are supported by the versioned importer. Paths
|
|
33
|
-
and the Electron partition are reused to avoid forced sign-in.
|
|
33
|
+
## agent-browser output
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
live-login, and ad-blocking behavior. Headless advertises full-page capture and
|
|
39
|
-
does not claim native Electron ad blocking. Unsupported operations return
|
|
40
|
-
`CAPABILITY_UNSUPPORTED`; adapters must not synthesize a substitute.
|
|
41
|
-
|
|
42
|
-
## Agent-browser envelopes
|
|
43
|
-
|
|
44
|
-
The headless adapter accepts supported historical JSON result envelopes and
|
|
45
|
-
normalizes them at its boundary. The SDK result union is stable and does not
|
|
46
|
-
expose agent-browser's transport format.
|
|
35
|
+
The driver accepts agent-browser's JSON result envelopes and unwraps them at
|
|
36
|
+
its boundary. The SDK result union is stable and does not expose
|
|
37
|
+
agent-browser's output format.
|