glidercli 0.4.14 → 0.4.16

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
@@ -1,40 +1,56 @@
1
1
  <div align="center">
2
2
 
3
- <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/glider.webp" alt="glider" width="80" height="80" />
4
- <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/chrome.webp" alt="chrome" width="80" height="80" />
5
- <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/claude.webp" alt="claude" width="80" height="80" />
6
- <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/ralph-wiggum.webp" alt="ralph" width="80" height="80" />
3
+ <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/glider.webp?v=1791987543" alt="glider" width="80" height="80" />
4
+ <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/chrome.webp?v=1791987543" alt="chrome" width="80" height="80" />
5
+ <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/claude.webp?v=1791987543" alt="claude" width="80" height="80" />
6
+ <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/ralph-wiggum.webp?v=1791987543" alt="ralph" width="80" height="80" />
7
7
 
8
8
  <h1 align="center">glider CLI</h1>
9
- <p align="center"><i><b>Browser automation CLI with autonomous loop execution</b></i></p>
9
+ <p align="center"><i>Attach to the logged-in Chromium tab. Keep the page out of the agent context window.</i></p>
10
10
 
11
- <a href="https://github.com/vdutts7/glidercli"><img src="./assets/badges/github.badge.svg" alt="GitHub" height="40" /></a>
12
- <a href="https://www.npmjs.com/package/glidercli"><img src="./assets/badges/npm.badge.svg" alt="glidercli on npm" height="40" /></a>
11
+ <a href="https://github.com/vdutts7/glidercli"><img src="./assets/badges/github.badge.svg?v=1791987543" alt="GitHub" height="40" /></a>
12
+ <a href="https://www.npmjs.com/package/glidercli"><img src="./assets/badges/npm.badge.svg?v=1791987543" alt="glidercli on npm" height="40" /></a>
13
13
 
14
14
  </div>
15
15
 
16
16
  <br/>
17
17
 
18
- ---
18
+ ## Table of Contents
19
+
20
+ <ol>
21
+ <a href="#problem">Problem</a><br/>
22
+ <a href="#approach">Approach</a><br/>
23
+ <a href="#setup">Setup</a><br/>
24
+ <a href="#browsers">Browsers</a><br/>
25
+ <a href="#commands">Commands</a><br/>
26
+ <a href="#contact">Contact</a>
27
+ </ol>
19
28
 
20
- | | headless CDP | extension relay (glider) |
21
- |---|--------------|---------------------------|
22
- | logged-in tab / SSO | ❌ cold profile | ✅ attach to open tab |
23
- | corp / MFA sessions | ❌ re-auth wall | ✅ reuse browser cookies |
24
- | loop until done | manual glue | ✅ `glider loop` + markers |
29
+ <br/>
25
30
 
26
31
  `glidercli` → relay at `ws://127.0.0.1:19988` → [`Glider extension`](https://chromewebstore.google.com/detail/glider/njbidokkffhgpofcejgcfcgcinmeoalj) → CDP on your tab.
27
32
 
28
- ---
33
+ ## Problem
34
+
35
+ | | | [Playwright MCP](https://playwright.dev/docs/getting-started-mcp) | glider |
36
+ |:---:|---|---|---|
37
+ | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/chrome.webp?v=1791987543" width="40" height="40" alt=""> | access | cold profile. no SSO/MFA/cookies | [`Glider` extension](https://chromewebstore.google.com/detail/glider/njbidokkffhgpofcejgcfcgcinmeoalj) on the tab you already logged into |
38
+ | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/playwright.webp?v=1791987543" width="40" height="40" alt=""> | tokens | a11y tree on every navigate/click/type ([quote](https://playwright.dev/docs/getting-started-mcp)) | `glider snapshot` when asked. 200-node cap ([`bsnapshot.js`](lib/bsnapshot.js)) |
29
39
 
30
- ## Issue
40
+ | | 1 snapshot | 9 calls | 200K window ([quote](https://platform.claude.com/docs/en/build-with-claude/context-windows)) | 1M window ([quote](https://claude.com/blog/1m-context-ga)) |
41
+ |---|---|---|---|---|
42
+ | Playwright MCP | ~13.8K tok | 124.3K tok ([quote](https://dev.to/ji_ai/playwright-mcp-token-usage-9-tool-calls-62-of-my-context-4on2)) | 62% | 12% |
43
+ | glider (cap) | ~4.0K tok (16,142 chars/4) | ~36.3K tok | 18% | 4% |
31
44
 
32
- | failure mode | symptom |
33
- |--------------|---------|
34
- | ❌ cold profile launch | SSO/MFA breaks on internal sites; no logged-in tab to drive |
35
- | ❌ raw CDP without bridge | extension must relay debugger traffic from real Chromium profile |
36
- | ❌ cookie-only terminal fetch | cross-origin API hosts often 401 without in-tab bearer |
37
- | ❌ one-shot scripts only | no first-class loop with iteration cap, timeout, completion marker |
45
+ - large-page MCP snapshots: 50KB-540KB; 2-3 visits overflow ([quote](https://github.com/microsoft/playwright-mcp/issues/1233))
46
+ - 2 of 9 Playwright snapshots in that signup flow were byte-identical ([quote](https://dev.to/ji_ai/playwright-mcp-token-usage-9-tool-calls-62-of-my-context-4on2))
47
+
48
+ ## Approach
49
+
50
+ | | Step | What |
51
+ |:---:|------|------|
52
+ | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/chrome.webp?v=1791987543" width="40" height="40" alt=""> | 1 | extension in the live profile |
53
+ | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/glider.webp?v=1791987543" width="40" height="40" alt=""> | 2 | CLI -> relay `ws://127.0.0.1:19988`. `glider eval`, `glider snapshot`, `glider loop` |
38
54
 
39
55
  ---
40
56
 
@@ -62,49 +78,28 @@ Node 18+. Chromium-based browser with the extension enabled (see Browsers).
62
78
  Extension + relay model uses Chromium + Glider extension from Chrome Web Store in the same profile as `glider connect`.
63
79
 
64
80
  | | Browser | Config |
65
- |---|--------|--------|
66
- | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/chrome.webp" width="40" height="40" alt=""> | Google Chrome | default for `glider connect` |
67
- | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/arc.webp" width="40" height="40" alt=""> | Arc | [`config/browser.json.example`](config/browser.json.example) |
68
- | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/microsoft/microsoft-edge.webp" width="40" height="40" alt=""> | Microsoft Edge | registry key `edge` |
69
- | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/brave.webp" width="40" height="40" alt=""> | Brave | registry key `brave` |
70
- | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/vivaldi.webp" width="40" height="40" alt=""> | Vivaldi | registry key `vivaldi` |
81
+ |:---:|--------|--------|
82
+ | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/chrome.webp?v=1791987543" width="40" height="40" alt=""> | Google Chrome | `glider config browser chrome` |
83
+ | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/microsoft-edge.webp?v=1791987543" width="40" height="40" alt=""> | Microsoft Edge | `glider config browser edge` |
84
+ | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/brave.webp?v=1791987543" width="40" height="40" alt=""> | Brave | `glider config browser brave` |
85
+ | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/opera-gx.webp?v=1791987543" width="40" height="40" alt=""> | Opera | `glider config browser opera` |
86
+ | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/vivaldi.webp?v=1791987543" width="40" height="40" alt=""> | Vivaldi | `glider config browser vivaldi` |
87
+ | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/helium.webp?v=1791987543" width="40" height="40" alt=""> | Helium | `glider config browser helium` |
88
+ | <img src="https://raw.githubusercontent.com/vdutts7/squircle/main/webp/arc.webp?v=1791987543" width="40" height="40" alt=""> | Arc | `glider config browser arc` |
71
89
 
72
90
  Not supported today: Firefox/Safari/WebKit/Gecko, DuckDuckGo, browsers without Chrome Web Store extension path.
73
91
 
74
92
  ### Browser config
75
93
 
76
- Priority: `$GLIDER_HOME/config/browser.json` → `$GLIDER_HOME/browser.json` → default Google Chrome.
77
-
78
- Registry key (recommended):
79
-
80
- ```json
81
- { "use": "arc" }
82
- ```
83
-
84
- Registry file: `$GLIDER_HOME/config/browsers-registry.json`
94
+ CLI or the file. One shape.
85
95
 
86
96
  ```bash
87
- glider use arc
88
- glider browser
97
+ glider config browser chrome
89
98
  ```
90
99
 
91
- Explicit name/path:
92
-
93
- ```json
94
- {
95
- "name": "Arc",
96
- "path": "/Applications/Arc.app",
97
- "processName": "Arc"
98
- }
99
- ```
100
+ writes `{ "use": "chrome" }` to `$GLIDER/config/browser.json`. Chrome is the default. `glider config browser` lists the same commands.
100
101
 
101
- | Command | Effect |
102
- |---------|--------|
103
- | `glider use arc` | write `{ "use": "arc" }` to `browser.json` |
104
- | `glider use` | list registry keys |
105
- | `glider browser` | show resolved name, path, process |
106
-
107
- macOS: `open -a` / AppleScript. Linux/Windows: partial, on roadmap.
102
+ macOS launch. Linux/Windows: planned.
108
103
 
109
104
  ---
110
105
 
@@ -124,17 +119,11 @@ steps:
124
119
  ## Usage
125
120
 
126
121
  ```bash
122
+ glider config browser chrome
123
+ glider install
127
124
  glider connect
128
- glider status
129
125
  glider goto "https://news.ycombinator.com"
130
- glider eval "document.title"
131
- glider run `hn-scrape.yaml`
132
- glider loop `hn-scrape.yaml` -n 50 -m hn_scrape_done
133
- ```
134
-
135
- ```bash
136
- # per-host capture hints (optional)
137
- glider resolve https://news.ycombinator.com --json
126
+ glider loop hn-scrape.yaml
138
127
  ```
139
128
 
140
129
  | Output | Path |
@@ -146,18 +135,7 @@ glider resolve https://news.ycombinator.com --json
146
135
 
147
136
  | Env | Default | Role |
148
137
  |-----|---------|------|
149
- | `GLIDER_HOME` | `~/.glider` | config, cache, warch tree |
150
- | `GLIDER_PORT` | `19988` | relay port for CLI + helpers; non-default values require matching extension configuration |
151
- | `GLIDER_NODE_BIN` | auto-detected | Node.js 18+ executable for background relay supervisor |
152
- | `GLIDER_RELOAD_TIMEOUT_MS` | `15000` | extension reload/reconnect deadline |
153
- | `GLIDER_CDP_TIMEOUT_MS` | `30000` | per-request CDP/extension timeout |
154
- | `GLIDER_RELAY_RECONNECT_GRACE_MS` | `10000` | keep cached targets while extension WS flaps |
155
- | `GLIDER_RELAY_COMMAND_RECONNECT_WAIT_MS` | `3000` | wait for extension before failing a command |
156
- | `GLIDER_RELAY_MAX_PENDING` | `256` | max in-flight extension requests |
157
- | `GLIDER_TIMING` | unset | set `1` to always attach `timing` on `--json` output |
158
- | `GLIDER_BROWSER_UI` | unset (off) | set `1` to allow AppleScript launch/tabs/activate (steals focus). Default refuses browser UI mutation. |
159
- | `GLIDER_HEAL_NO_WAKE` | unset | set `1` to force-skip heal tab-wake even if `GLIDER_BROWSER_UI=1` |
160
- | `AGREGISTRY` | unset | optional registry root → warch at `AGREGISTRY/warch/HOST/` |
138
+ | `GLIDER` | `~/.glider` | home: config, cache, warch |
161
139
 
162
140
  Copy `config/domains.template.json` into `~/.glider/config/domains.json` to seed the host index.
163
141
 
@@ -168,12 +146,12 @@ Copy `config/domains.template.json` into `~/.glider/config/domains.json` to seed
168
146
  | problem | fix | stability | why |
169
147
  |---------|-----|-----------|-----|
170
148
  | extension not connected | install/enable [`Glider` on Chrome Web Store](https://chromewebstore.google.com/detail/glider/njbidokkffhgpofcejgcfcgcinmeoalj) in selected browser profile; click Glider icon, then run `glider connect` | per browser launch | relay waits on extension WS |
171
- | extension socket up but worker dead | click Glider icon or `glider reload-ext`; `glider heal` does **not** open tabs by default (`GLIDER_BROWSER_UI` off); set `GLIDER_BROWSER_UI=1` only if you want AppleScript wake | MV3 worker | status refuses healthy until pong |
172
- | CLI steals browser focus / opens tabs | leave `GLIDER_BROWSER_UI` unset (default); never set it unless you explicitly want launch/tabs/activate | session-stable | AppleScript UI gated off by default |
173
- | custom relay port has no extension | use `19988` with Chrome Web Store build | install-stable | published extension connects to `ws://localhost:19988/extension` |
149
+ | extension socket up but worker dead | click Glider icon or `glider reload` | MV3 worker | status refuses healthy until pong |
150
+ | daemon / `glider start` refuses after a killed supervisor | run `glider start` or `glider install` again (0.4.15+ reaps dead claim tombstones when nothing listens) | session-stable | crash/SIGKILL left `daemon-*.claim` without a live owner |
151
+ | custom relay port has no extension | stay on `19988` with Chrome Web Store build | install-stable | published extension connects to `ws://localhost:19988/extension` |
174
152
  | wrong tab targeted | `glider targets` → `glider use-session session-6` | session-stable | multi-tab needs explicit session |
175
153
  | explore HAR empty bodies | replay in-tab with auth hook on XHR/fetch | site-specific | some SPAs never expose bearer in storage |
176
- | `resolve` misses host | add `~/.glider/warch/HOST/glider.json` or set `AGREGISTRY` | file-stable | optional per-host capture hints |
154
+ | `resolve` misses host | add `~/.glider/warch/HOST/glider.json` | file-stable | per-host capture hints |
177
155
 
178
156
  ---
179
157
 
@@ -181,29 +159,34 @@ Copy `config/domains.template.json` into `~/.glider/config/domains.json` to seed
181
159
 
182
160
  | Command | Description |
183
161
  |---------|-------------|
184
- | `glider install` / `uninstall` | background relay supervisor |
162
+ | `glider install` | background relay supervisor |
163
+ | `glider uninstall` | remove supervisor |
164
+ | `glider config browser chrome` | set browser |
185
165
  | `glider connect` | attach relay to browser |
186
- | `glider status` | server + extension + tabs; nonzero unless full stack is healthy |
187
- | `glider doctor` | relay + SW + targets + one next action (`--json`) |
188
- | `glider heal` | ensure relay, best-effort SW wake, optional `--clear-pin` |
189
- | `glider test` | relay + extension + target + live CDP `1+1` diagnostic |
190
- | `glider goto` / `eval` / `click` / `type` | page ops |
191
- | `glider frozen` / `thaw` | detect / un-throttle a hidden (macrotask-frozen) tab in place |
192
- | `glider screenshot` | PNG capture |
166
+ | `glider status` | server + extension + tabs |
167
+ | `glider doctor` | relay + SW + targets |
168
+ | `glider heal` | wake SW, reattach |
169
+ | `glider reload` | pin extension |
170
+ | `glider goto` | navigate |
171
+ | `glider eval` | run JS |
172
+ | `glider click` | click |
173
+ | `glider type` | type |
174
+ | `glider screenshot` | PNG |
175
+ | `glider frozen` | detect frozen tab |
176
+ | `glider thaw` | unfreeze tab |
193
177
  | `glider explore` | crawl + HAR |
194
- | `glider resolve` | host → local warch intel (`--json`) |
195
- | `glider run` / `loop` | YAML task / Ralph loop |
196
-
197
- Full surface: `glider --help`
178
+ | `glider resolve` | host warch |
179
+ | `glider run` | YAML task |
180
+ | `glider loop` | loop until marker |
198
181
 
199
182
  ---
200
183
 
201
184
  ## Verification
202
185
 
203
186
  ```bash
204
- npm test # unit, CLI regression, relay integration, tarball boundary
205
- npm run test:live # isolated live-browser fixture against the connected extension
206
- npm run test:syntax # package JavaScript syntax gate
187
+ node --check bin/glider.js && node --check lib/bserve.js
188
+ node --test tests/*.test.js
189
+ node tests/live-browser.smoke.js # isolated live-browser fixture
207
190
  ```
208
191
 
209
192
  Live smoke creates + closes its own browser window.
@@ -225,4 +208,4 @@ Incomplete event-stream features fail closed: `wait --network-idle`, console str
225
208
 
226
209
  ## Contact
227
210
 
228
- <a href="https://vd7.io"><img src="https://res.cloudinary.com/ddyc1es5v/image/upload/v1773910810/readme-badges/readme-badge-vd7.png" alt="vd7.io" height="40" /></a> &nbsp; <a href="https://x.com/vdutts7"><img src="https://res.cloudinary.com/ddyc1es5v/image/upload/v1773910817/readme-badges/readme-badge-x.png" alt="/vdutts7" height="40" /></a>
211
+ <a href="https://vd7.io"><img src="https://res.cloudinary.com/ddyc1es5v/image/upload/v1773910810/readme-badges/readme-badge-vd7.png?v=1791987543" alt="vd7.io" height="40" /></a> &nbsp; <a href="https://x.com/vdutts7"><img src="https://res.cloudinary.com/ddyc1es5v/image/upload/v1773910817/readme-badges/readme-badge-x.png?v=1791987543" alt="/vdutts7" height="40" /></a>