@elvatis_com/openclaw-cli-bridge-elvatis 0.2.28 → 0.2.30

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.
@@ -0,0 +1,81 @@
1
+ # Headless Browser Bridge — Roadmap
2
+
3
+ ## Ziel
4
+ Alle Provider (Claude, Gemini, Codex/ChatGPT, Grok) über Playwright Browser-Sessions
5
+ betreiben — keine lokalen CLI-Binaries mehr nötig. Ein headless Chromium, ein Proxy.
6
+
7
+ ## Aktueller Stand (v0.2.28)
8
+ - ✅ Grok: DOM-Polling via grok.com (FERTIG, produktiv)
9
+ - ⏳ Claude: claude CLI binary → Ziel: claude.ai headless
10
+ - ⏳ Gemini: gemini CLI binary → Ziel: gemini.google.com headless
11
+ - ⏳ Codex: codex CLI binary → Ziel: chatgpt.com headless
12
+
13
+ ## Reihenfolge
14
+ 1. **Claude headless** (claude.ai) — höchste Priorität, meistgenutzt
15
+ 2. **Gemini headless** (gemini.google.com)
16
+ 3. **Codex/ChatGPT headless** (chatgpt.com)
17
+
18
+ ## Pro Provider: Was zu bauen ist
19
+ Für jeden Provider brauchen wir:
20
+ 1. `src/<provider>-browser.ts` — DOM-Automation (analog zu grok-client.ts)
21
+ - `sendAndWait(page, message, timeoutMs)` — message senden, auf stable DOM warten
22
+ - `getOrCreatePage(context)` — existierende Page reuse
23
+ 2. Persistent profile dir: `~/.openclaw/<provider>-profile/`
24
+ 3. Cookie-Expiry Tracking (analog zu grok-cookie-expiry.json)
25
+ 4. `/provider-login`, `/provider-status`, `/provider-logout` Commands
26
+ 5. `web-<provider>/*` Modell-Routing im Proxy
27
+ 6. Tests: DOM-Stub via DI-Override (analog zu grok-proxy.test.ts)
28
+
29
+ ## Pro Provider: DOM-Struktur zu ermitteln
30
+ (Muss live gecaptured werden — Browser offen lassen)
31
+
32
+ ### Claude (claude.ai)
33
+ - Login: Google OAuth oder Email
34
+ - Editor selector: TBD (ProseMirror ähnlich wie Grok?)
35
+ - Response selector: TBD
36
+ - Anti-bot: Cloudflare?
37
+
38
+ ### Gemini (gemini.google.com)
39
+ - Login: Google Account (gleicher wie Gemini CLI)
40
+ - Editor selector: TBD
41
+ - Response selector: TBD
42
+ - Anti-bot: Google reCAPTCHA?
43
+
44
+ ### ChatGPT (chatgpt.com)
45
+ - Login: OpenAI Account oder Google/Microsoft OAuth
46
+ - Editor selector: TBD (ProseMirror?)
47
+ - Response selector: TBD
48
+ - Anti-bot: Cloudflare?
49
+
50
+ ## Modell-IDs (nach Implementierung)
51
+ ```
52
+ web-claude/claude-sonnet → claude.ai (Sonnet)
53
+ web-claude/claude-opus → claude.ai (Opus, Pro plan)
54
+ web-gemini/gemini-2-5-pro → gemini.google.com (2.5 Pro)
55
+ web-gemini/gemini-flash → gemini.google.com (Flash)
56
+ web-chatgpt/gpt-4o → chatgpt.com (GPT-4o)
57
+ web-chatgpt/gpt-o3 → chatgpt.com (o3)
58
+ web-grok/grok-3 → grok.com (✅ bereits fertig)
59
+ ```
60
+
61
+ ## Version-Plan
62
+ - v0.2.x — Claude headless (+ Tests)
63
+ - v0.3.x — Gemini headless (+ Tests)
64
+ - v0.4.x — ChatGPT headless (+ Tests)
65
+ - **v1.0.0** — Alle 4 Provider headless, CLI-Dependencies optional,
66
+ vollständige Testabdeckung, CHANGELOG komplett
67
+
68
+ ## Voraussetzungen vor jedem Provider-Release
69
+ - [ ] Alle Tests grün (inkl. neuer Provider-Tests)
70
+ - [ ] DOM-Struktur gecaptured (echte Requests intercepted)
71
+ - [ ] Cookie-Expiry Tracking implementiert
72
+ - [ ] Persistent profile directory dokumentiert
73
+ - [ ] Manuelle End-to-End Test durchgeführt
74
+ - [ ] Alle 3 Plattformen published (GitHub, npm, ClawHub)
75
+
76
+ ## Notizen
77
+ - DOM-Polling interval: 500ms, stable after 3 consecutive identical reads
78
+ - Timeout default: 120s (konfigurierbar via pluginConfig.timeoutMs)
79
+ - Jeder Provider: eigenes Chromium-Profil → Cookies unabhängig
80
+ - Grok-Strategie: grok.com öffnen, ProseMirror füllen, Enter, .message-bubble pollen
81
+ - Cloudflare-Bypass: KEINE direkten fetch()-Calls — immer DOM-Automation
@@ -1,78 +1,54 @@
1
- # STATUS.md — openclaw-cli-bridge-elvatis
2
-
3
- <!-- SECTION: summary -->
4
- v0.2.25 built + tested (51/51). Staged model switching + token refresh stability. Ready to publish.
5
- <!-- /SECTION: summary -->
6
-
7
- <!-- SECTION: version -->
8
- ## Current Version: 0.2.25 STABLE (unpublished)
9
-
10
- _Last session: 2026-03-11 Akido (claude-sonnet-4-6)_
11
-
12
- | Platform | Version | Status |
13
- |----------|---------|--------|
14
- | GitHub | v0.2.25 | ✅ Tagged + Release |
15
- | npm | 0.2.25 | ✅ Published |
16
- | ClawHub | 0.2.25 | Published (direct API clawhub CLI v0.7.0 bug: missing acceptLicenseTerms) |
17
- | Local | 0.2.25 | ✅ Up to date |
18
- <!-- /SECTION: version -->
19
-
20
- <!-- SECTION: build_health -->
21
- ## Build Health
22
-
23
- | Check | Result | Notes |
24
- |-------|--------|-------|
25
- | `npm run build` | ✅ | TypeScript compiles clean, no errors |
26
- | `npm test` | ✅ 51/51 | All tests pass |
27
- | `npm run typecheck` | | Implied by build |
28
- | Plugin loads in gateway | | Verified at v0.2.21; no structural changes |
29
- <!-- /SECTION: build_health -->
30
-
31
- <!-- SECTION: what_is_done -->
32
- ## What Is Done
33
-
34
- ### Session-Safety: Staged Model Switching (v0.2.25)
35
- - **`/cli-*` stages by default** — switch saved to `~/.openclaw/cli-bridge-pending.json`, NOT applied. Shows warning + instructions.
36
- - **`/cli-* --now`** immediate switch (user's explicit choice; only use between sessions)
37
- - **`/cli-apply`** apply staged switch after finishing current task
38
- - **`/cli-pending`** show staged switch state
39
- - ✅ **`/cli-back`** — restore previous model + clear any staged switch
40
- - **`/cli-list`** — updated to show pending state + switching instructions
41
-
42
- ### Token Refresh Stability (v0.2.25merged from v0.2.24)
43
- - ✅ Sleep-resilient: `setInterval(10min)` polling instead of long `setTimeout`
44
- - ✅ No timer-leak: `stopTokenRefresh()` called at top of `scheduleTokenRefresh()`
45
- - `stopTokenRefresh()` exported; called via `server.on("close")`
46
-
47
- ### Previously Validated (v0.2.23 and below)
48
- - ✅ Phase 1: `openai-codex` provider via `~/.codex/auth.json`
49
- - Phase 2: Local proxy on `127.0.0.1:31337` (Gemini + Claude CLI)
50
- - Phase 3: 15 slash commands (all `/cli-*`)
51
- - Model allowlist, vllm prefix stripping, buildMinimalEnv XDG vars
52
- - End-to-end tested: claude-sonnet-4-6 claude-haiku-4-5 ✅ gemini-2.5-flash ✅ gemini-2.5-pro ✅ codex ✅
53
- <!-- /SECTION: what_is_done -->
54
-
55
- <!-- SECTION: what_is_missing -->
56
- ## What Is Missing / Open
57
-
58
- - ✅ **v0.2.25 published** — GitHub, npm, ClawHub alle auf 0.2.25
59
- - ℹ️ **Claude CLI auth expires ~90 days** — when `/cli-test` returns 401, run `claude auth login`
60
- - ℹ️ **Config patcher writes `openclaw.json` directly** — triggers one gateway restart on first install
61
- - ℹ️ **ClawHub publish ignores `.clawhubignore`** — use rsync workaround (see CONVENTIONS.md)
62
- <!-- /SECTION: what_is_missing -->
63
-
64
- <!-- SECTION: bugs_fixed -->
65
- ## Bug History
66
-
67
- | Version | Bug | Fix |
68
- |---------|-----|-----|
69
- | 0.2.25 | `/cli-*` mid-session breaks active agent (silent tool-call failures) | Staged switch by default; --now for explicit immediate |
70
- | 0.2.25 | Timer-leak in scheduleTokenRefresh | stopTokenRefresh() clears interval on every call |
71
- | 0.2.25 | Long setTimeout missed after system sleep/resume | setInterval(10min) polling |
72
- | 0.2.25 | Token refresh interval leaked on proxy close | server.on("close", stopTokenRefresh) |
73
- | 0.2.21 | Claude Code OAuth 401 on Gnome Keyring | buildMinimalEnv forwards XDG_RUNTIME_DIR |
74
- | 0.2.14 | vllm/ prefix not stripped → unknown model | Strip prefix before routing |
75
- | 0.2.13 | requireAuth:true blocked webchat commands | requireAuth:false |
76
- | 0.2.9 | fuser -k SIGKILL'd gateway process | Safe health probe |
77
- | 0.2.7–8 | EADDRINUSE on hot-reload | closeAllConnections() + registerService |
78
- <!-- /SECTION: bugs_fixed -->
1
+ # STATUS — openclaw-cli-bridge-elvatis
2
+
3
+ ## Current Version: 0.2.28 (npm + ClawHub + GitHub)
4
+
5
+ ## What's Done
6
+ - v0.2.25: Sleep-resilient token refresh (setInterval), staged /cli-* switch
7
+ - v0.2.26: Grok DOM-polling bridge (grok-client.ts, grok-session.ts)
8
+ - v0.2.27: Persistent Chromium profile (~/.openclaw/grok-profile/)
9
+ - v0.2.28: Cookie-expiry tracking (/grok-status shows ✅/⚠️/🚨)
10
+ - claude-browser.ts: DOM-automation for claude.ai (not yet in proxy — NEXT)
11
+ - 77/77 tests green
12
+
13
+ ## Next: v0.3.x → v1.0.0 — Full Headless Provider Bridge
14
+
15
+ ### Provider Status
16
+ | Provider | DOM confirmed | browser.ts | Proxy routed | Login cmd | Tests |
17
+ |---|---|---|---|---|---|
18
+ | Grok | ✅ | ✅ grok-client.ts | ✅ web-grok/* | ✅ /grok-login | ✅ |
19
+ | Claude | ✅ | ✅ claude-browser.ts | ❌ | ❌ | partial |
20
+ | Gemini | ❌ | ❌ | ❌ | ❌ | ❌ |
21
+ | ChatGPT | ❌ | ❌ | ❌ | ❌ | ❌ |
22
+
23
+ ### Claude DOM (confirmed 2026-03-11)
24
+ - URL: https://claude.ai/new
25
+ - Editor: .ProseMirror (tiptap)
26
+ - Messages: [data-test-render-count] divs
27
+ - Assistant msgs: child div class "group" (no "mb-1 mt-6")
28
+ - User msgs: child div class "mb-1 mt-6 group"
29
+ - CLOUDFLARE: persistent headless blocked — must use OpenClaw browser (CDP 18800)
30
+ - Tested working: CLAUDE_WORKS response confirmed via OpenClaw browser
31
+
32
+ ### Next Steps (in order)
33
+ 1. Add connectToOpenClawBrowser() to claude-browser.ts (same as grok-session.ts)
34
+ 2. Add web-claude/* routing to proxy-server.ts (same as web-grok/*)
35
+ 3. Add /claude-login, /claude-status, /claude-logout to index.ts
36
+ 4. Add claude-browser integration tests (DI-override, same as grok-proxy.test.ts)
37
+ 5. Repeat for Gemini (gemini.google.com) and ChatGPT (chatgpt.com)
38
+ 6. Bump to v1.0.0 when all 4 providers green + all tests pass
39
+
40
+ ## Key Files
41
+ - src/claude-browser.ts — Claude DOM automation (ready, not wired)
42
+ - src/grok-client.tsreference implementation
43
+ - src/grok-session.ts reference for login/session management
44
+ - src/proxy-server.ts add web-claude/* routing here
45
+ - index.ts add /claude-login here
46
+ - test/claude-browser.test.ts — unit tests (partial, needs proxy integration test)
47
+
48
+ ## Constraints
49
+ - OpenClaw browser (CDP 18800) required for Cloudflare bypass
50
+ - persistent profile approach fails (fingerprint mismatch)
51
+ - Each provider: own profile dir ~/.openclaw/<provider>-profile/
52
+ - All providers share same proxy port 31337
53
+ - Publish only after full test pass (77+ tests green)
54
+ - All 3 platforms on every release: GitHub + npm + ClawHub
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > OpenClaw plugin that bridges locally installed AI CLIs (Codex, Gemini, Claude Code) as model providers — with slash commands for instant model switching, restore, health testing, and model listing.
4
4
 
5
- **Current version:** `0.2.28`
5
+ **Current version:** `0.2.30`
6
6
 
7
7
  ---
8
8
 
@@ -287,6 +287,21 @@ npm test # vitest run (45 tests)
287
287
 
288
288
  ## Changelog
289
289
 
290
+ ### v0.2.30
291
+ - **feat:** `gemini-browser.ts` — gemini.google.com DOM-automation (Quill editor + message-content polling)
292
+ - **feat:** `web-gemini/*` models in proxy (gemini-2-5-pro, gemini-2-5-flash, gemini-3-pro, gemini-3-flash)
293
+ - **feat:** `/gemini-login`, `/gemini-status`, `/gemini-logout` commands + cookie-expiry tracking
294
+ - **fix:** Singleton CDP connection — no more zombie Chromium processes
295
+ - **fix:** `cleanupBrowsers()` called on plugin stop — all browser resources released
296
+ - **test:** 90/90 tests green (+6 gemini-proxy tests)
297
+
298
+ ### v0.2.29
299
+ - **feat:** `claude-browser.ts` — claude.ai DOM-automation (ProseMirror + `[data-test-render-count]` polling)
300
+ - **feat:** `web-claude/*` models in proxy (web-claude/claude-sonnet, claude-opus, claude-haiku)
301
+ - **feat:** `/claude-login`, `/claude-status`, `/claude-logout` commands
302
+ - **feat:** Claude cookie-expiry tracking (`~/.openclaw/claude-cookie-expiry.json`)
303
+ - **test:** 84/84 tests green (+7 claude-proxy tests, +8 claude-browser unit tests)
304
+
290
305
  ### v0.2.28
291
306
  - **feat:** `/grok-login` scans auth cookie expiry (sso cookie) and saves to `~/.openclaw/grok-cookie-expiry.json`
292
307
  - **feat:** `/grok-status` shows cookie expiry with color-coded warnings (🚨 <7d, ⚠️ <14d, ✅ otherwise)
package/SKILL.md CHANGED
@@ -53,4 +53,4 @@ Each command runs `openclaw models set <model>` atomically and replies with a co
53
53
 
54
54
  See `README.md` for full configuration reference and architecture diagram.
55
55
 
56
- **Version:** 0.2.28
56
+ **Version:** 0.2.30