@jackwener/opencli 0.4.4 → 0.4.5

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/browser.js CHANGED
@@ -584,9 +584,9 @@ export class PlaywrightMCP {
584
584
  const initializedMsg = JSON.stringify({ jsonrpc: '2.0', method: 'notifications/initialized' }) + '\n';
585
585
  debugLog(`SEND: ${initializedMsg.trim()}`);
586
586
  this._proc?.stdin?.write(initializedMsg);
587
- // Get initial tab count for cleanup
587
+ // Get initial tab count for cleanup (with timeout — CDP mode may hang on browser_tabs)
588
588
  debugLog('Fetching initial tabs count...');
589
- page.tabs().then((tabs) => {
589
+ withTimeout(page.tabs(), 5000, 'Timed out fetching initial tabs').then((tabs) => {
590
590
  debugLog(`Tabs response: ${typeof tabs === 'string' ? tabs : JSON.stringify(tabs)}`);
591
591
  this._initialTabIdentities = extractTabIdentities(tabs);
592
592
  settleSuccess(page);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackwener/opencli",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/browser.ts CHANGED
@@ -636,9 +636,9 @@ export class PlaywrightMCP {
636
636
  debugLog(`SEND: ${initializedMsg.trim()}`);
637
637
  this._proc?.stdin?.write(initializedMsg);
638
638
 
639
- // Get initial tab count for cleanup
639
+ // Get initial tab count for cleanup (with timeout — CDP mode may hang on browser_tabs)
640
640
  debugLog('Fetching initial tabs count...');
641
- page.tabs().then((tabs: any) => {
641
+ withTimeout(page.tabs(), 5000, 'Timed out fetching initial tabs').then((tabs: any) => {
642
642
  debugLog(`Tabs response: ${typeof tabs === 'string' ? tabs : JSON.stringify(tabs)}`);
643
643
  this._initialTabIdentities = extractTabIdentities(tabs);
644
644
  settleSuccess(page);