webhelm 1.0.58 → 1.0.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webhelm",
3
- "version": "1.0.58",
3
+ "version": "1.0.59",
4
4
  "description": "Agent browser automation in a visible managed Chrome with persistent JavaScript sessions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -275,7 +275,8 @@ Options:
275
275
  Lists tools registered in the selected main frame of an existing CLI-owned
276
276
  Session. Does not navigate or invoke tools. Output: JSON with session_id,
277
277
  target_id and tools (names, descriptions, input schemas and annotations).
278
- An empty tools array means no tools were discovered. Unavailable discovery
278
+ An empty tools array means no tools were discovered or Chrome does not
279
+ support WebMCP. Other unavailable discovery
279
280
  exits nonzero.
280
281
 
281
282
  Example:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "WebHelm",
4
- "version": "1.0.58",
4
+ "version": "1.0.59",
5
5
  "description": "Own named Chrome tab-group workspaces and lazy reusable tab pools for browser agents.",
6
6
  "permissions": [
7
7
  "storage",
@@ -91,7 +91,18 @@ async function withWebMCP(browser, sessionId, {name,input,discovery_ms,timeout_m
91
91
  });
92
92
  // Subscribe before enabling: Chrome sends existing registrations as events.
93
93
  enabled=true;
94
- await browser.send('WebMCP.enable',{},sessionId);
94
+ try {
95
+ await browser.send('WebMCP.enable',{},sessionId);
96
+ } catch(error) {
97
+ // Older Chrome reports an absent CDP domain as method not found.
98
+ // Do not disguise transport failures or revoked ownership as no tools.
99
+ const unsupported=/unknown (?:domain|method|command)|(?:method|command).*not found|(?:WebMCP\.enable).*wasn't found|not supported/i.test(error?.message||'');
100
+ if(unsupported){
101
+ enabled=false;
102
+ return name===undefined&&active()&&!invalidated?[]:null;
103
+ }
104
+ throw error;
105
+ }
95
106
  async function waitUntil(condition,ms){
96
107
  const end=Date.now()+ms;
97
108
  while(active()&&!invalidated&&!condition()&&Date.now()<end){