@1outres/dsh-bot-connector-browser 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/lib/index.js +507 -41
- package/package.json +3 -3
- package/src/host/connector.ts +15 -7
- package/src/host/preparation.ts +68 -8
- package/src/host/session.ts +20 -5
- package/src/host/tools.ts +19 -10
- package/src/host/vault/failures.ts +31 -0
- package/src/host/vault/helper.ts +97 -0
- package/src/host/vault/marks.ts +22 -0
- package/src/host/vault/passkeys.ts +124 -0
- package/src/host/vault/protocol.ts +143 -0
- package/src/host/vault/tools.ts +218 -0
- package/src/host/vm/layout.ts +7 -1
- package/src/index.ts +22 -8
- package/vm/helper/bytes.mjs +74 -0
- package/vm/helper/cdp.mjs +259 -0
- package/vm/helper/channel.mjs +99 -0
- package/vm/helper/dsh-browser-fill.mjs +154 -0
- package/vm/helper/dsh-browser-passkey.mjs +192 -0
- package/vm/helper/page.mjs +135 -0
- package/vm/install-helper.sh +12 -0
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Everything the server answers is untrusted (the bot is root in the VM): lines ar
|
|
|
22
22
|
|
|
23
23
|
## Preparation
|
|
24
24
|
|
|
25
|
-
One idempotent path (`src/host/preparation.ts`): read the account → compare `/opt/dsh-browser/mcp/npm-shrinkwrap.json` with `vm/mcp/npm-shrinkwrap.json` and, if it differs (a VM installed with an earlier `package-lock.json` has none), run `vm/install-mcp.sh` (`npm ci --omit=dev --ignore-scripts`, then swap the directory in) → ask `http://127.0.0.1:9222/json/version` and require `Chrome/<version>` → start the server and require its `tools/list` to equal the generated tools exactly (names, descriptions, schemas, annotations). There is nothing to stop when it is turned off: bot-core closes the server; Chrome stays the desktop's.
|
|
25
|
+
One idempotent path (`src/host/preparation.ts`): read the account → compare `/opt/dsh-browser/mcp/npm-shrinkwrap.json` with `vm/mcp/npm-shrinkwrap.json` and, if it differs (a VM installed with an earlier `package-lock.json` has none), run `vm/install-mcp.sh` (`npm ci --omit=dev --ignore-scripts`, then swap the directory in) → compare each installed login helper in `/opt/dsh-browser/helper` with `vm/helper/` and, if one differs, run `vm/install-helper.sh` → ask `http://127.0.0.1:9222/json/version` and require `Chrome/<version>` → start the server and require its `tools/list` to equal the generated tools exactly (names, descriptions, schemas, annotations). There is nothing to stop when it is turned off: bot-core closes the server; Chrome stays the desktop's.
|
|
26
26
|
|
|
27
27
|
The bot base image runs the same `vm/install-mcp.sh` with the same shrinkwrap (`infra/vm/build-base-image.sh`), so a new VM installs nothing; `test/base-image.test.ts` checks that.
|
|
28
28
|
|
|
@@ -49,6 +49,17 @@ Action results carry the page's snapshot as a file link (`~/.cache/dsh-browser/o
|
|
|
49
49
|
|
|
50
50
|
Do not sign the bot's Chrome in to anyone's personal accounts: it would hand the account to the bot without any approval.
|
|
51
51
|
|
|
52
|
+
## Logins (password manager)
|
|
53
|
+
|
|
54
|
+
Two tools fill the bot's logins (docs/specs/bot-vaults.md §8) without the model, Playwright MCP or any log seeing a value. Both are `vault: true`, allow by default and exclusive on `page`:
|
|
55
|
+
|
|
56
|
+
| Tool | What it does |
|
|
57
|
+
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
58
|
+
| browser_fill_credential `{ credential, field, ref, submit? }` | Types the username, password or current one-time code of a login into the element of `ref`. Playwright MCP only marks the element; the helper `dsh-browser-fill` finds the mark over DevTools in every frame, takes the frame's origin as Chrome reports it, bot-core checks that origin against the login's sites, and the value goes on the helper's stdin as bytes, then `Input.insertText` after the origin is checked again. A password goes only into a password field. The result says only what was filled where. |
|
|
59
|
+
| browser_use_passkey `{ credential }` | Offers the login's passkey to the current tab for 60 seconds through a WebAuthn virtual authenticator of the helper `dsh-browser-passkey` (kept with the connector's resident resource); it goes away once used, when the tab leaves the origin or at the next call. A login without a passkey (1Password) fails plainly. |
|
|
60
|
+
|
|
61
|
+
The helpers are `vm/helper/*.mjs` (no dependencies, their own WebSocket so that a value is never a JS string), installed as root into `/opt/dsh-browser/helper` by the preparation and the base image (`vm/install-helper.sh`). They print closed codes only. Chrome's saving and filling of passwords is turned off by the desktop connector's managed policy.
|
|
62
|
+
|
|
52
63
|
## Development
|
|
53
64
|
|
|
54
65
|
Tests run without a VM (`pnpm test`): a fake MCP server answers from the generated file.
|