glidercli 0.3.17 → 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/bin/glider.js CHANGED
@@ -721,8 +721,7 @@ async function cmdRestart() {
721
721
  await cmdStart();
722
722
  }
723
723
 
724
- // reload-ext: automate extension reload + tab re-attachment so operators
725
- ***REMOVED***
724
+ // reload-ext: automate extension reload + tab re-attachment
726
725
  async function cmdReloadExt() {
727
726
  try {
728
727
  const r = await postExtension({ method: 'reloadSelf', params: {} });
package/lib/bexplore.js CHANGED
@@ -822,7 +822,22 @@ class SiteExplorer {
822
822
  console.error(`[explore] HAR saved: ${this.harFile}`);
823
823
  }
824
824
 
825
- close() {
825
+ async close() {
826
+ // F1: detach the CDP session before closing WS so the extension's chrome.debugger
827
+ // registry doesn't leak an attached target. Without this, every explore run leaves
828
+ // a phantom attach subscription that eventually saturates the relay and causes
829
+ // future Target.setAutoAttach calls to time out for ALL subsequent runs.
830
+ try {
831
+ if (this.ws && this.ws.readyState === 1 && this.sessionId) {
832
+ await Promise.race([
833
+ this.send('Target.detachFromTarget', { sessionId: this.sessionId }, { noWait: false })
834
+ .catch(() => {}),
835
+ new Promise((r) => setTimeout(r, 1500)),
836
+ ]);
837
+ }
838
+ } catch (_e) {
839
+ // best-effort; never let cleanup itself throw
840
+ }
826
841
  if (this.ws) this.ws.close();
827
842
  }
828
843
  }
@@ -939,7 +954,7 @@ Examples:
939
954
  }
940
955
  process.exit(1);
941
956
  } finally {
942
- explorer.close();
957
+ await explorer.close();
943
958
  }
944
959
  }
945
960
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glidercli",
3
- "version": "0.3.17",
3
+ "version": "0.3.19",
4
4
  "description": "Browser automation CLI. Control Chrome from terminal via CDP, run YAML task files, autonomous loops until completion.",
5
5
  "main": "index.js",
6
6
  "bin": {