@ricsam/browser-mcp 0.3.18 → 0.3.19

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 CHANGED
@@ -3,10 +3,10 @@
3
3
  Native Chrome companion. Requires Node >=22.14.0 and an installed
4
4
  Google Chrome. No browser download or startup occurs during npm installation.
5
5
 
6
- Release 0.3.18 uses one cross-platform Node package with matching server/chart 0.3.18, native protocol 3 and no database schema change. Every download in the dedicated browser stays in its private download folder, including after the window's first tab is closed, and is listed by `browser_list_downloads`: downloads survive tab close and handoff, and downloads from user tabs, or that no tab surfaced, are shared with every session. Concurrent or interrupted downloads no longer close the browser. Background screenshots and capture-only download retry from 0.3.17 remain. Verified readiness is still required before retrieving bytes. Keep administrative sign-ins outside automated profiles unless deliberately delegated: internal pages, local files and the Browser MCP dashboard are no longer blanket-blocked, subject to Chrome's interface limits. Older runtimes require an update for new capabilities. Stop the old CLI before upgrading, then restart the same named profile to preserve sign-ins and pairing; never replay uncertain actions automatically.
6
+ Release 0.3.19 uses one cross-platform Node package with matching server/chart 0.3.19, native protocol 3 and no database schema change. Upload and secret-export results carry their capability in ordinary tool text, transfer grants beyond a session's four outstanding ones are refused before anything is prepared, and unknown resource IDs passed to `browser_transfer_status`, `browser_cancel_transfer` or `browser_upload_files` are reported as not found. As since 0.3.18, every download in the dedicated browser stays in its private download folder and is listed by `browser_list_downloads`; background screenshots and capture-only download retry remain. Verified readiness is still required before retrieving bytes. Keep administrative sign-ins outside automated profiles unless deliberately delegated: internal pages, local files and the Browser MCP dashboard are no longer blanket-blocked, subject to Chrome's interface limits. Older runtimes require an update for new capabilities. Stop the old CLI before upgrading, then restart the same named profile to preserve sign-ins and pairing; never replay uncertain actions automatically.
7
7
 
8
8
  ```sh
9
- npm install -g @ricsam/browser-mcp@0.3.18
9
+ npm install -g @ricsam/browser-mcp@0.3.19
10
10
  browser-mcp browser start --server https://browser-mcp.click --profile work
11
11
  browser-mcp browser status --profile work
12
12
  browser-mcp browser pause --profile work
@@ -54,7 +54,7 @@ function onceAsync(action) {
54
54
  // cli/src/browser/owned-chrome.ts
55
55
  import { randomUUID as randomUUID2 } from "node:crypto";
56
56
  // cli/package.json
57
- var version = "0.3.18";
57
+ var version = "0.3.19";
58
58
 
59
59
  // cli/src/browser/chrome-diagnostics.ts
60
60
  import { constants } from "node:fs";
@@ -3708,6 +3708,8 @@ var messages = {
3708
3708
  script_exception: "The script threw an exception. Page exception text and stack are suppressed.",
3709
3709
  transfer_failed: "The file transfer failed or its completion could not be confirmed.",
3710
3710
  resource_unavailable: "The requested resource is unavailable. No download link was created.",
3711
+ resource_not_found: "No resource with this ID is visible to this session.",
3712
+ upload_not_ready: "A staged upload is not ready to attach.",
3711
3713
  scope_rejected: "Runtime scope or tab ownership was rejected.",
3712
3714
  runtime_operation_failed: "The browser operation failed; page-derived details are suppressed."
3713
3715
  };
@@ -5857,7 +5859,7 @@ class Relay {
5857
5859
  if (this.paused || this.stopping || socket !== this.socket || socket.readyState !== WebSocket2.OPEN)
5858
5860
  return;
5859
5861
  this.state = "authenticating";
5860
- socket.send(JSON.stringify({ type: "auth", token: this.token, client: { protocol: 3, version: "0.3.18", instanceId: this.runtime.instanceId, operations: [...BROWSER_OPERATIONS, ...this.runtime.plugins.flatMap((p) => p.operations), "session_end", "release_tab", "runtime_health", "runtime_recover"], capabilities: ["runtime-queue.v1", "runtime-quarantine.v1", "binary-artifacts.v1", "browser-controls.v1", "screenshot-ids.v1", "webmcp.page-context.v1", "clipboard.native.v1", "native-transfers.v1", "secrets.v1", "forwarding.v1", "live-view.v1"], liveView: { enabled: this.liveEnabled } } }));
5862
+ socket.send(JSON.stringify({ type: "auth", token: this.token, client: { protocol: 3, version: "0.3.19", instanceId: this.runtime.instanceId, operations: [...BROWSER_OPERATIONS, ...this.runtime.plugins.flatMap((p) => p.operations), "session_end", "release_tab", "runtime_health", "runtime_recover"], capabilities: ["runtime-queue.v1", "runtime-quarantine.v1", "binary-artifacts.v1", "browser-controls.v1", "screenshot-ids.v1", "webmcp.page-context.v1", "clipboard.native.v1", "native-transfers.v1", "secrets.v1", "forwarding.v1", "live-view.v1"], liveView: { enabled: this.liveEnabled } } }));
5861
5863
  });
5862
5864
  socket.on("message", (bytes, binary) => {
5863
5865
  if (binary || Buffer.byteLength(bytes.toString()) > LIMIT) {
@@ -6559,6 +6561,7 @@ var safeName = (s) => {
6559
6561
  var USER_SCOPE = { browserId: "", tokenId: "", sessionKey: "", instanceId: "" };
6560
6562
  var visible = (r, scope) => !!r.shared || sameScope(r.scope, scope);
6561
6563
  var OUTSIDE_SPOOL_RECOVERY = "Chrome saved this download outside Browser MCP's private download folder (in its own download location on the browser host), so no bytes are available here and capture retry cannot recover them. Browser MCP never reads other folders and has re-pinned downloads to its private folder. Ask before repeating the website action.";
6564
+ var NOT_FOUND_RECOVERY = "Nothing was changed. Use the resourceId from the result that created the resource, or a downloadId from browser_list_downloads; file names are not IDs. Resources expire, and cancellation or session end removes them.";
6562
6565
  async function createDataPlugin(access, options) {
6563
6566
  if (!secureDataUrl(new URL(options.serverOrigin), options.allowInsecureLoopback))
6564
6567
  throw new Error("HTTPS data server required");
@@ -6585,7 +6588,7 @@ async function createDataPlugin(access, options) {
6585
6588
  const t = terminal.get(String(id));
6586
6589
  if (t && t.until >= Date.now() && visible(t, scope))
6587
6590
  return t.meta;
6588
- return meta(get(scope, id));
6591
+ return meta(lookup(scope, id));
6589
6592
  }
6590
6593
  function meta(r) {
6591
6594
  const failed = r.state === "capture-failed", outside = r.capture?.diagnostic?.reason === "outside-spool";
@@ -6607,6 +6610,13 @@ async function createDataPlugin(access, options) {
6607
6610
  throw new Error("Unknown resource");
6608
6611
  return r;
6609
6612
  }
6613
+ function lookup(scope, id) {
6614
+ try {
6615
+ return get(scope, id);
6616
+ } catch {
6617
+ throw new RuntimeFault("resource_not_found", NOT_FOUND_RECOVERY, true);
6618
+ }
6619
+ }
6610
6620
  const reserved = (r) => {
6611
6621
  if (r.purpose !== "download")
6612
6622
  return r.size;
@@ -6956,7 +6966,7 @@ async function createDataPlugin(access, options) {
6956
6966
  return status(scope, args.resourceId ?? args.transferId);
6957
6967
  }
6958
6968
  if (op === "cancel_transfer") {
6959
- const r = get(scope, args.resourceId ?? args.transferId);
6969
+ const r = lookup(scope, args.resourceId ?? args.transferId);
6960
6970
  if (r.state === "attached")
6961
6971
  throw new Error("Attached files retained until document ends");
6962
6972
  r.terminalCode = "download_cancelled";
@@ -6981,9 +6991,9 @@ async function createDataPlugin(access, options) {
6981
6991
  const ids = args.fileIds;
6982
6992
  if (!Array.isArray(ids) || !ids.length || ids.length > 100 || new Set(ids).size !== ids.length)
6983
6993
  throw new Error("Invalid staged files");
6984
- const files = ids.map((id) => get(scope, id));
6994
+ const files = ids.map((id) => lookup(scope, id));
6985
6995
  if (files.some((r) => r.purpose !== "upload" || r.state !== "ready" || !r.path))
6986
- throw new Error("Files not ready");
6996
+ throw new RuntimeFault("upload_not_ready", "Nothing was attached. Wait until browser_transfer_status reports state ready for every fileId (a staged upload whose bytes were sent), then attach again.", true);
6987
6997
  const target2 = await access.resolveUploadTarget(String(args.tabId), args, scope);
6988
6998
  try {
6989
6999
  target2.assertCurrent();
@@ -7345,7 +7355,7 @@ async function startProfile(root, server, profile, options, groupSignal) {
7345
7355
  return;
7346
7356
  } else if (cmd !== "status")
7347
7357
  throw new Error("Invalid command");
7348
- socket.end(JSON.stringify({ ...relay.health(), instanceId: session.instanceId, profile, version: "0.3.18", protocol: 3 }) + `
7358
+ socket.end(JSON.stringify({ ...relay.health(), instanceId: session.instanceId, profile, version: "0.3.19", protocol: 3 }) + `
7349
7359
  `);
7350
7360
  })().catch(() => socket.destroy());
7351
7361
  });
package/dist/main.js CHANGED
@@ -8,7 +8,7 @@ var args = process.argv.slice(2);
8
8
  var command = args.shift();
9
9
  async function main() {
10
10
  if (!command || command === "--help" || command === "help") {
11
- console.log(`@ricsam/browser-mcp 0.3.18
11
+ console.log(`@ricsam/browser-mcp 0.3.19
12
12
  Usage: browser-mcp browser start|status|pause|resume|stop|recover [options]
13
13
  browser-mcp files upload|download [options]
14
14
  browser-mcp secrets export|exec [options]
@@ -18,11 +18,11 @@ Browser dependencies load only for browser commands. No automatic Chrome downloa
18
18
  return;
19
19
  }
20
20
  if (command === "--version") {
21
- console.log("0.3.18");
21
+ console.log("0.3.19");
22
22
  return;
23
23
  }
24
24
  if (command === "browser")
25
- return (await import("./chunk-cqqkfzmg.js")).runBrowser(args);
25
+ return (await import("./chunk-8d06b7q4.js")).runBrowser(args);
26
26
  if (command === "files")
27
27
  return (await import("./chunk-zv1900tw.js")).runFilesCommand(args);
28
28
  if (command === "secrets")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/browser-mcp",
3
- "version": "0.3.18",
3
+ "version": "0.3.19",
4
4
  "description": "Dedicated native Chrome companion for Browser MCP",
5
5
  "type": "module",
6
6
  "bin": { "browser-mcp": "dist/main.js" },