@elvatis_com/openclaw-cli-bridge-elvatis 1.3.0 → 1.3.1
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 +6 -1
- package/SKILL.md +1 -1
- package/index.ts +68 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
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:** `1.3.
|
|
5
|
+
**Current version:** `1.3.1`
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -287,6 +287,11 @@ npm test # vitest run (45 tests)
|
|
|
287
287
|
|
|
288
288
|
## Changelog
|
|
289
289
|
|
|
290
|
+
### v1.3.1
|
|
291
|
+
- **fix:** /claude-login, /gemini-login, /chatgpt-login now bake cookies into persistent profile dirs
|
|
292
|
+
- **fix:** After gateway restart, providers auto-reconnect from saved profile (no browser tabs needed)
|
|
293
|
+
- **fix:** Better debug logging when persistent headless context fails (Cloudflare etc.)
|
|
294
|
+
|
|
290
295
|
### v1.3.0
|
|
291
296
|
- **fix:** Browser persistence after gateway restart — each provider launches its own persistent Chromium if OpenClaw browser is unavailable
|
|
292
297
|
- **feat:** `ensureAllProviderContexts()` — unified startup connect for all 4 providers
|
package/SKILL.md
CHANGED
package/index.ts
CHANGED
|
@@ -399,14 +399,16 @@ async function ensureAllProviderContexts(log: (msg: string) => void): Promise<vo
|
|
|
399
399
|
});
|
|
400
400
|
const page = await pCtx.newPage();
|
|
401
401
|
await page.goto(cfg.homeUrl, { waitUntil: "domcontentloaded", timeout: 15_000 });
|
|
402
|
-
await new Promise(r => setTimeout(r,
|
|
402
|
+
await new Promise(r => setTimeout(r, 4000));
|
|
403
403
|
const visible = await page.locator(cfg.verifySelector).isVisible().catch(() => false);
|
|
404
404
|
if (visible) {
|
|
405
405
|
ctx = pCtx;
|
|
406
406
|
log(`[cli-bridge:${cfg.name}] launched persistent context ✅`);
|
|
407
407
|
} else {
|
|
408
|
+
const title = await page.title().catch(() => "unknown");
|
|
409
|
+
const bodySnippet = await page.evaluate(() => document.body?.innerText?.substring(0, 100) ?? "").catch(() => "");
|
|
410
|
+
log(`[cli-bridge:${cfg.name}] persistent headless: editor not visible — title="${title}" body="${bodySnippet}"`);
|
|
408
411
|
await pCtx.close().catch(() => {});
|
|
409
|
-
log(`[cli-bridge:${cfg.name}] persistent context: editor not visible (not logged in?)`);
|
|
410
412
|
}
|
|
411
413
|
} catch (err) {
|
|
412
414
|
log(`[cli-bridge:${cfg.name}] could not launch browser: ${(err as Error).message}`);
|
|
@@ -708,7 +710,7 @@ function proxyTestRequest(
|
|
|
708
710
|
const plugin = {
|
|
709
711
|
id: "openclaw-cli-bridge-elvatis",
|
|
710
712
|
name: "OpenClaw CLI Bridge",
|
|
711
|
-
version: "1.3.
|
|
713
|
+
version: "1.3.1",
|
|
712
714
|
description:
|
|
713
715
|
"Phase 1: openai-codex auth bridge. " +
|
|
714
716
|
"Phase 2: HTTP proxy for gemini/claude CLIs. " +
|
|
@@ -1325,6 +1327,26 @@ const plugin = {
|
|
|
1325
1327
|
|
|
1326
1328
|
claudeContext = ctx;
|
|
1327
1329
|
|
|
1330
|
+
// Export + bake cookies into persistent profile
|
|
1331
|
+
const claudeProfileDir = join(homedir(), ".openclaw", "claude-profile");
|
|
1332
|
+
mkdirSync(claudeProfileDir, { recursive: true });
|
|
1333
|
+
try {
|
|
1334
|
+
const allCookies = await ctx.cookies([
|
|
1335
|
+
"https://claude.ai",
|
|
1336
|
+
"https://anthropic.com",
|
|
1337
|
+
]);
|
|
1338
|
+
const { chromium } = await import("playwright");
|
|
1339
|
+
const pCtx = await chromium.launchPersistentContext(claudeProfileDir, {
|
|
1340
|
+
headless: true,
|
|
1341
|
+
args: ["--no-sandbox", "--disable-setuid-sandbox"],
|
|
1342
|
+
});
|
|
1343
|
+
await pCtx.addCookies(allCookies);
|
|
1344
|
+
await pCtx.close();
|
|
1345
|
+
api.logger.info(`[cli-bridge:claude] cookies baked into ${claudeProfileDir}`);
|
|
1346
|
+
} catch (err) {
|
|
1347
|
+
api.logger.warn(`[cli-bridge:claude] cookie bake failed: ${(err as Error).message}`);
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1328
1350
|
// Scan cookie expiry
|
|
1329
1351
|
const expiry = await scanClaudeCookieExpiry(ctx);
|
|
1330
1352
|
if (expiry) {
|
|
@@ -1402,6 +1424,27 @@ const plugin = {
|
|
|
1402
1424
|
|
|
1403
1425
|
geminiContext = ctx;
|
|
1404
1426
|
|
|
1427
|
+
// Export + bake cookies into persistent profile
|
|
1428
|
+
const geminiProfileDir = join(homedir(), ".openclaw", "gemini-profile");
|
|
1429
|
+
mkdirSync(geminiProfileDir, { recursive: true });
|
|
1430
|
+
try {
|
|
1431
|
+
const allCookies = await ctx.cookies([
|
|
1432
|
+
"https://gemini.google.com",
|
|
1433
|
+
"https://accounts.google.com",
|
|
1434
|
+
"https://google.com",
|
|
1435
|
+
]);
|
|
1436
|
+
const { chromium } = await import("playwright");
|
|
1437
|
+
const pCtx = await chromium.launchPersistentContext(geminiProfileDir, {
|
|
1438
|
+
headless: true,
|
|
1439
|
+
args: ["--no-sandbox", "--disable-setuid-sandbox"],
|
|
1440
|
+
});
|
|
1441
|
+
await pCtx.addCookies(allCookies);
|
|
1442
|
+
await pCtx.close();
|
|
1443
|
+
api.logger.info(`[cli-bridge:gemini] cookies baked into ${geminiProfileDir}`);
|
|
1444
|
+
} catch (err) {
|
|
1445
|
+
api.logger.warn(`[cli-bridge:gemini] cookie bake failed: ${(err as Error).message}`);
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1405
1448
|
const expiry = await scanGeminiCookieExpiry(ctx);
|
|
1406
1449
|
if (expiry) {
|
|
1407
1450
|
saveGeminiExpiry(expiry);
|
|
@@ -1471,6 +1514,28 @@ const plugin = {
|
|
|
1471
1514
|
return { text: "❌ ChatGPT editor not visible — are you logged in?\nOpen chatgpt.com in your browser and try again." };
|
|
1472
1515
|
|
|
1473
1516
|
chatgptContext = ctx;
|
|
1517
|
+
|
|
1518
|
+
// Export + bake cookies into persistent profile
|
|
1519
|
+
const chatgptProfileDir = join(homedir(), ".openclaw", "chatgpt-profile");
|
|
1520
|
+
mkdirSync(chatgptProfileDir, { recursive: true });
|
|
1521
|
+
try {
|
|
1522
|
+
const allCookies = await ctx.cookies([
|
|
1523
|
+
"https://chatgpt.com",
|
|
1524
|
+
"https://openai.com",
|
|
1525
|
+
"https://auth.openai.com",
|
|
1526
|
+
]);
|
|
1527
|
+
const { chromium } = await import("playwright");
|
|
1528
|
+
const pCtx = await chromium.launchPersistentContext(chatgptProfileDir, {
|
|
1529
|
+
headless: true,
|
|
1530
|
+
args: ["--no-sandbox", "--disable-setuid-sandbox"],
|
|
1531
|
+
});
|
|
1532
|
+
await pCtx.addCookies(allCookies);
|
|
1533
|
+
await pCtx.close();
|
|
1534
|
+
api.logger.info(`[cli-bridge:chatgpt] cookies baked into ${chatgptProfileDir}`);
|
|
1535
|
+
} catch (err) {
|
|
1536
|
+
api.logger.warn(`[cli-bridge:chatgpt] cookie bake failed: ${(err as Error).message}`);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1474
1539
|
const expiry = await scanChatGPTCookieExpiry(ctx);
|
|
1475
1540
|
if (expiry) { saveChatGPTExpiry(expiry); api.logger.info(`[cli-bridge:chatgpt] cookie expiry: ${new Date(expiry.expiresAt).toISOString()}`); }
|
|
1476
1541
|
const expiryLine = expiry ? `\n\n🕐 Cookie expiry: ${formatChatGPTExpiry(expiry)}` : "";
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "openclaw-cli-bridge-elvatis",
|
|
3
3
|
"name": "OpenClaw CLI Bridge",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"description": "Phase 1: openai-codex auth bridge. Phase 2: local HTTP proxy routing model calls through gemini/claude CLIs (vllm provider).",
|
|
6
6
|
"providers": [
|
|
7
7
|
"openai-codex"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elvatis_com/openclaw-cli-bridge-elvatis",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Bridges gemini, claude, and codex CLI tools as OpenClaw model providers. Reads existing CLI auth without re-login.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"openclaw": {
|