ai-browser-bridge 0.2.0 → 0.4.0
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.es.md +38 -25
- package/README.he.md +42 -25
- package/README.md +36 -14
- package/README.zh.md +38 -25
- package/dist/bridge.js +7114 -6884
- package/dist/bridge.js.map +1 -1
- package/package.json +8 -13
package/README.es.md
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="assets/hero.png" alt="
|
|
2
|
+
<img src="assets/hero.png" alt="ai-browser-bridge — controla ChatGPT, Gemini, Claude, DeepSeek, Grok, Perplexity y Flow desde tu terminal mediante Chrome" width="640" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# ai-browser-bridge
|
|
6
6
|
|
|
7
7
|
[English](README.md) · [עברית](README.he.md) · **Español** · [中文](README.zh.md)
|
|
8
8
|
|
|
9
9
|

|
|
10
|
-

|
|
11
11
|

|
|
12
12
|

|
|
13
13
|

|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
> Controla
|
|
17
|
+
> Controla conversaciones reales de ChatGPT o Gemini desde tu terminal y ofrece a ChatGPT un conjunto reducido de herramientas locales del repositorio vía MCP — sin entregarle nunca una shell.
|
|
18
18
|
|
|
19
19
|
## Por qué existe
|
|
20
20
|
|
|
21
21
|
ChatGPT rinde mejor en el navegador: el estado real de la cuenta, el selector de modelos, la edición de mensajes, la regeneración y el historial de conversación se mantienen intactos. Programar rinde mejor en la terminal, donde archivos, pruebas, diffs y parches se inspeccionan y modifican directamente.
|
|
22
22
|
|
|
23
|
-
`
|
|
23
|
+
`ai-browser-bridge` conecta esas dos superficies. Un prompt en la terminal controla tu sesión existente del proveedor en el navegador, y ChatGPT puede acceder al repositorio actual mediante un pequeño conjunto de **herramientas MCP validadas** — `grep`, `read`, `apply_patch`, `run_tests`, `git_diff` — en lugar de acceso directo a la shell. Tú permaneces en un único flujo de terminal; el proveedor conserva su interfaz real.
|
|
24
24
|
|
|
25
25
|
## Características
|
|
26
26
|
|
|
27
|
-
- **
|
|
27
|
+
- **Nueve proveedores, un comando** — ChatGPT, Gemini, Claude, DeepSeek, Grok, Perplexity, Duck.ai, Arena y Google Flow. Selecciona uno con `--provider` o consulta varios en paralelo.
|
|
28
|
+
- **Diseñado para agentes** — `bridge ask … --json` ofrece una interfaz no interactiva estable, y `bridge serve` expone herramientas MCP salientes.
|
|
28
29
|
- **Herramientas locales en sandbox vía MCP** — cada operación de archivo se valida contra la raíz del repositorio seleccionado; sin shell arbitraria, solo comandos de prueba en lista blanca.
|
|
29
30
|
- **Acciones del navegador como comandos** — `/resume`, `/new`, `/model`, `/rewind`, `/stop`, `/context`, `/diff`, `/compact` y más.
|
|
30
|
-
- **Sesiones y
|
|
31
|
+
- **Sesiones, transcripciones y descargas en la raíz del repositorio** — las ejecuciones persistentes usan siempre `<repo>/.bridge/`, incluso cuando se inician desde un subdirectorio.
|
|
31
32
|
- **Controles de seguridad** — modos de permiso (`read-only` / `ask` / `auto`) y checkpoints automáticos de archivos alrededor de cada parche.
|
|
32
33
|
- **Convenciones del proyecto** — comandos personalizados además de `AGENTS.md` / `CLAUDE.md` se envían a ChatGPT en las ejecuciones de `/task`.
|
|
33
34
|
- **Un editor real** — historial de prompts, búsqueda inversa, cola de prompts y autocompletado de menciones `@file`.
|
|
@@ -54,8 +55,8 @@ Cuatro capas, cada una con un solo trabajo:
|
|
|
54
55
|
| Capa | Tecnología | Responsabilidad |
|
|
55
56
|
|------|------------|-----------------|
|
|
56
57
|
| **CLI** | Ink / React | Interfaz de terminal: panel de mensajes, barra de estado, menciones `@file`, comandos `/`. |
|
|
57
|
-
| **Navegador** | Playwright + Chrome DevTools Protocol |
|
|
58
|
-
| **Servidor MCP** | MCP SDK +
|
|
58
|
+
| **Navegador** | Playwright + Chrome DevTools Protocol | Se conecta a Chrome mediante el puerto de depuración y reutiliza un único perfil compartido. Los adaptadores viven en `src/features/providers/`. |
|
|
59
|
+
| **Servidor MCP** | MCP SDK + Effect Schema | Expone herramientas locales validadas y aisladas a ChatGPT, Claude y Grok. |
|
|
59
60
|
| **Túnel** | Cloudflare Tunnel (`cloudflared`) | Da al servidor MCP local una URL HTTPS pública temporal que el conector de ChatGPT puede alcanzar — sin despliegue. |
|
|
60
61
|
|
|
61
62
|
**¿Por qué un túnel?** El conector MCP de ChatGPT llama a las herramientas por HTTPS, pero el servidor de herramientas se ejecuta en tu máquina. En lugar de desplegar nada, el bridge levanta un túnel efímero de Cloudflare (`*.trycloudflare.com`) frente al puerto local y sincroniza esa URL `…/mcp` con la app de ChatGPT al iniciar. (ngrok resolvería el mismo problema de alcance; se usa `cloudflared` de Cloudflare porque sus túneles rápidos no requieren cuenta ni token.)
|
|
@@ -65,36 +66,48 @@ Cuatro capas, cada una con un solo trabajo:
|
|
|
65
66
|
**Requisitos previos**
|
|
66
67
|
|
|
67
68
|
- **macOS** — Chrome se inicia desde `/Applications/Google Chrome.app`, y los ayudantes de portapapeles/procesos usan `pbcopy`/`lsof`.
|
|
68
|
-
- **Node.js ≥
|
|
69
|
-
- **Google Chrome** — el bridge
|
|
70
|
-
- **`cloudflared`** *(opcional)* —
|
|
69
|
+
- **Node.js ≥ 22** y **pnpm** (el repo fija `pnpm@10.14.0`).
|
|
70
|
+
- **Google Chrome o Chrome for Testing** — el bridge reutiliza un perfil global compartido en `~/.ai-browser-bridge/chrome-profile`.
|
|
71
|
+
- **`cloudflared`** *(opcional)* — necesario para que ChatGPT, Claude o Grok llamen a herramientas locales. Sin él la TUI sigue funcionando. Instala con `brew install cloudflared`.
|
|
71
72
|
|
|
72
73
|
**Instalar y construir**
|
|
73
74
|
|
|
74
75
|
```bash
|
|
75
|
-
git clone https://github.com/YosefHayim/
|
|
76
|
-
cd
|
|
76
|
+
git clone https://github.com/YosefHayim/ai-browser-bridge.git
|
|
77
|
+
cd ai-browser-bridge
|
|
77
78
|
pnpm install
|
|
78
79
|
pnpm build
|
|
79
80
|
```
|
|
80
81
|
|
|
81
|
-
**Inicia
|
|
82
|
+
**Inicia Chrome una vez y luego ejecuta**
|
|
82
83
|
|
|
83
84
|
```bash
|
|
84
|
-
# Abre el perfil
|
|
85
|
-
node dist/bridge.js
|
|
85
|
+
# Abre el perfil compartido de Chrome del bridge; inicia sesión si hace falta
|
|
86
|
+
node dist/bridge.js chrome start
|
|
86
87
|
|
|
87
88
|
# Lanza la interfaz de terminal sobre el repositorio donde ChatGPT trabajará
|
|
88
89
|
node dist/bridge.js --repo /path/to/your/project
|
|
89
90
|
```
|
|
90
91
|
|
|
91
|
-
¿Prefieres un comando `bridge` global? Ejecuta `pnpm link --global` tras construir, y usa `bridge`, `bridge
|
|
92
|
+
¿Prefieres un comando `bridge` global? Ejecuta `pnpm link --global` tras construir, y usa `bridge`, `bridge chrome start`, `bridge ask "…"`, etc.
|
|
93
|
+
|
|
94
|
+
## Agentes y proveedores
|
|
95
|
+
|
|
96
|
+
`bridge ask` puede consultar un proveedor o distribuir la misma pregunta entre varios. Las respuestas se devuelven por proveedor y los fallos parciales no descartan los resultados correctos.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
bridge ask --provider claude --json "resume este repositorio"
|
|
100
|
+
bridge ask --provider claude,deepseek,grok --json "compara estos enfoques"
|
|
101
|
+
bridge serve
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`bridge serve` ofrece `ask` y `search_conversations` por MCP stdio. ChatGPT, Claude y Grok pueden usar el conector MCP entrante; Gemini, DeepSeek, Perplexity, Duck.ai y Arena funcionan como chats web, y Flow funciona como superficie de generación de vídeo.
|
|
92
105
|
|
|
93
106
|
## Dónde se guarda el estado
|
|
94
107
|
|
|
95
|
-
Todo el estado del bridge para un proyecto se escribe
|
|
108
|
+
Todo el estado del bridge para un proyecto se escribe bajo `<repo>/.bridge/` en la raíz canónica del árbol de trabajo Git. Iniciar el bridge desde un subdirectorio sigue usando esa única raíz; un directorio explícito que no pertenece a Git sigue siendo su propia raíz. El bridge no crea ni administra `.bridge/.gitignore`; esa política pertenece al repositorio de destino.
|
|
96
109
|
|
|
97
|
-
> La configuración escrita por el usuario y destinada a aplicarse a **todos** los repositorios
|
|
110
|
+
> La configuración escrita por el usuario y destinada a aplicarse a **todos** los repositorios vive en tu directorio home: comandos personalizados en `~/.ai-browser-bridge/commands/*.md` y hooks de usuario en `~/.ai-browser-bridge/hooks.json`.
|
|
98
111
|
|
|
99
112
|
## Permisos y checkpoints
|
|
100
113
|
|
|
@@ -111,10 +124,10 @@ Todo el estado del bridge para un proyecto se escribe **dentro de ese proyecto**
|
|
|
111
124
|
```bash
|
|
112
125
|
pnpm test # vitest run
|
|
113
126
|
pnpm typecheck # tsc --noEmit
|
|
114
|
-
pnpm verify:push # typecheck +
|
|
127
|
+
pnpm verify:push # Biome + typecheck + tests + build + controles estructurales
|
|
115
128
|
```
|
|
116
129
|
|
|
117
|
-
La cobertura se centra en las rutas sensibles a la seguridad — validación de sandbox, resolución de
|
|
130
|
+
La cobertura se centra en las rutas sensibles a la seguridad — validación de sandbox, resolución de la raíz canónica del repositorio, los almacenes de sesiones/checkpoints, permisos y conteo de contexto.
|
|
118
131
|
|
|
119
132
|
## Soporte de Google Flow
|
|
120
133
|
|
|
@@ -130,7 +143,7 @@ Más allá de generar, el bridge controla el **ciclo de vida de recursos** compl
|
|
|
130
143
|
|
|
131
144
|
```bash
|
|
132
145
|
bridge flow clips # lista los clips del proyecto actual (id + URL descargable)
|
|
133
|
-
bridge flow download # descarga
|
|
146
|
+
bridge flow download # descarga los mp4 en <repo>/.bridge/downloads/flow
|
|
134
147
|
bridge flow reuse --id <clipId> # vuelve a añadir un clip al prompt como entrada ("Add to prompt")
|
|
135
148
|
bridge flow extend --id <clipId> # añade un clip a una escena ("Add to scene" de Flow)
|
|
136
149
|
bridge flow rename --id <clipId> --name "hero shot"
|
|
@@ -162,12 +175,12 @@ Los agentes sin acceso a shell obtienen el mismo ciclo de vida como **herramient
|
|
|
162
175
|
|
|
163
176
|
Flow requiere un plan **Google AI Pro/Ultra**. Como los renders de Veo tardan minutos, `--provider flow` espera una respuesta mucho más tiempo que los proveedores de chat.
|
|
164
177
|
|
|
165
|
-
**Mantenimiento de selectores:** los selectores de Flow fueron **verificados en vivo (LIVE-VERIFIED)** contra un editor de proyecto con sesión iniciada. Si Google cambia la UI, vuelve a capturarlos con `node
|
|
178
|
+
**Mantenimiento de selectores:** los selectores de Flow fueron **verificados en vivo (LIVE-VERIFIED)** contra un editor de proyecto con sesión iniciada. Si Google cambia la UI, vuelve a capturarlos con `node scripts/dev/captureProviderSelectors.mjs`, luego actualiza [`src/config.ts`](src/config.ts); la generación vive en [`src/features/providers/flow/flowPage.ts`](src/features/providers/flow/flowPage.ts) y el CRUD de recursos en [`src/features/providers/flow/flowAssets.ts`](src/features/providers/flow/flowAssets.ts).
|
|
166
179
|
|
|
167
180
|
## Limitaciones
|
|
168
181
|
|
|
169
182
|
- **Solo macOS** por ahora (ruta de Chrome fija y ayudantes `pbcopy`/`lsof`).
|
|
170
|
-
- Los selectores
|
|
183
|
+
- Los selectores de los proveedores pueden romperse cuando cambian sus interfaces web; los arreglos están localizados en sus adaptadores.
|
|
171
184
|
- El uso de contexto es una **estimación** — el navegador no expone el conteo exacto de tokens del servidor.
|
|
172
185
|
- El túnel de Cloudflare requiere `cloudflared` instalado.
|
|
173
186
|
- Local-first por diseño; no es un servicio multiusuario alojado.
|
package/README.he.md
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="assets/hero.png" alt="
|
|
2
|
+
<img src="assets/hero.png" alt="ai-browser-bridge — drive ChatGPT, Gemini, Claude, DeepSeek, Grok, Perplexity, and Flow from your terminal through Chrome" width="640" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# ai-browser-bridge
|
|
6
6
|
|
|
7
7
|
[English](README.md) · **עברית** · [Español](README.es.md) · [中文](README.zh.md)
|
|
8
8
|
|
|
9
9
|

|
|
10
|
-

|
|
11
11
|

|
|
12
12
|

|
|
13
13
|

|
|
14
14
|
|
|
15
15
|
<div dir="rtl">
|
|
16
16
|
|
|
17
|
-
> הפעילו
|
|
17
|
+
> הפעילו שיחות ChatGPT או Gemini אמיתיות מהדפדפן ישירות מהטרמינל, ותנו ל-ChatGPT גישה מצומצמת ומבוקרת לכלי הריפו המקומי דרך MCP — בלי למסור לו גישת shell.
|
|
18
18
|
|
|
19
19
|
## למה זה קיים
|
|
20
20
|
|
|
21
21
|
ChatGPT נמצא בשיאו בדפדפן — מצב החשבון האמיתי, בורר המודלים, עריכת הודעות, רגנרציה והיסטוריית השיחה נשמרים במלואם. פיתוח קוד נמצא בשיאו בטרמינל, שם בודקים ומשנים קבצים, טסטים, diffs ו-patches ישירות.
|
|
22
22
|
|
|
23
|
-
`
|
|
23
|
+
`ai-browser-bridge` מחבר בין שני המשטחים האלה. שורת פקודה בטרמינל מפעילה את שיחת הספק הקיימת בדפדפן, ו-ChatGPT יכול לגשת לריפו הנוכחי דרך מספר מצומצם של **כלי MCP מאומתים** — `grep`, `read`, `apply_patch`, `run_tests`, `git_diff` — במקום גישת shell חופשית. אתם נשארים בתהליך עבודה אחד בטרמינל; לספק נשאר ה-UI האמיתי שלו.
|
|
24
24
|
|
|
25
25
|
## יכולות
|
|
26
26
|
|
|
27
|
-
-
|
|
27
|
+
- **תשעה ספקים, פקודה אחת** — ChatGPT, Gemini, Claude, DeepSeek, Grok, Perplexity, Duck.ai, Arena ו-Google Flow. בוחרים ספק עם `--provider` או שולחים לכמה ספקים במקביל.
|
|
28
|
+
- **בנוי לסוכנים** — `bridge ask … --json` מספק ממשק לא-אינטראקטיבי יציב, ו-`bridge serve` חושף כלי MCP יוצאים.
|
|
28
29
|
- **כלים מקומיים ב-sandbox דרך MCP** — כל פעולת קובץ מאומתת מול שורש הריפו הנבחר; אין shell חופשי, רק פקודות טסט מאושרות מראש.
|
|
29
30
|
- **פעולות דפדפן כפקודות** — `/resume`, `/new`, `/model`, `/rewind`, `/stop`, `/context`, `/diff`, `/compact` ועוד.
|
|
30
|
-
-
|
|
31
|
+
- **סשנים, תמלולים והורדות בשורש הריפו** — הרצות מתמשכות משתמשות תמיד ב-`<repo>/.bridge/`, גם כשהן מופעלות מתיקיית משנה.
|
|
31
32
|
- **בקרות בטיחות** — מצבי הרשאה (`read-only` / `ask` / `auto`) ו-checkpoints אוטומטיים של קבצים סביב כל patch.
|
|
32
33
|
- **מוסכמות פרויקט** — פקודות מותאמות אישית וגם `AGENTS.md` / `CLAUDE.md` מוזנים ל-ChatGPT בהרצות `/task`.
|
|
33
34
|
- **קומפוזר אמיתי** — היסטוריית פרומפטים, חיפוש לאחור, תור פרומפטים, והשלמה אוטומטית לאזכורי `@file`.
|
|
@@ -58,8 +59,8 @@
|
|
|
58
59
|
| שכבה | טכנולוגיה | אחריות |
|
|
59
60
|
|------|-----------|--------|
|
|
60
61
|
| **CLI** | Ink / React | ממשק טרמינל: חלונית הודעות, שורת סטטוס, אזכורי `@file`, פקודות `/`. |
|
|
61
|
-
| **דפדפן** | Playwright + Chrome DevTools Protocol |
|
|
62
|
-
| **שרת MCP** | MCP SDK +
|
|
62
|
+
| **דפדפן** | Playwright + Chrome DevTools Protocol | מתחבר ל-Chrome דרך פורט הדיבוג ומשתמש בפרופיל bridge משותף יחיד. מתאמי הספקים נמצאים ב-`src/features/providers/`. |
|
|
63
|
+
| **שרת MCP** | MCP SDK + Effect Schema | חושף כלים מקומיים מאומתים ומוגני-sandbox ל-ChatGPT, Claude ו-Grok. |
|
|
63
64
|
| **מנהרה** | Cloudflare Tunnel (`cloudflared`) | מעניק לשרת ה-MCP המקומי כתובת HTTPS ציבורית זמנית שה-connector של ChatGPT יכול להגיע אליה — ללא פריסה. |
|
|
64
65
|
|
|
65
66
|
**למה בכלל מנהרה?** ה-connector של ChatGPT קורא לכלים דרך HTTPS, אבל שרת הכלים רץ על המחשב שלכם. במקום לפרוס משהו, ה-bridge מקים מנהרת Cloudflare זמנית (`*.trycloudflare.com`) מול הפורט המקומי ומסנכרן את כתובת ה-`…/mcp` הזו אל אפליקציית ChatGPT בעת ההפעלה. (ngrok היה פותר את אותה בעיית נגישות; נבחר `cloudflared` של Cloudflare מכיוון שמנהרות ה-quick שלו אינן דורשות חשבון או טוקן.)
|
|
@@ -69,30 +70,30 @@
|
|
|
69
70
|
**דרישות מקדימות**
|
|
70
71
|
|
|
71
72
|
- **macOS** — Chrome מופעל מ-`/Applications/Google Chrome.app`, ועוזרי הלוח/תהליכים משתמשים ב-`pbcopy`/`lsof`.
|
|
72
|
-
- **Node.js ≥
|
|
73
|
-
- **Google Chrome** — ה-bridge
|
|
74
|
-
- **`cloudflared`** *(אופציונלי)* — נדרש
|
|
73
|
+
- **Node.js ≥ 22** ו-**pnpm** (הריפו מקבע `pnpm@10.14.0`).
|
|
74
|
+
- **Google Chrome או Chrome for Testing** — ה-bridge משתמש בפרופיל גלובלי משותף ב-`~/.ai-browser-bridge/chrome-profile`.
|
|
75
|
+
- **`cloudflared`** *(אופציונלי)* — נדרש כדי ש-ChatGPT, Claude או Grok יקראו לכלים מקומיים. בלעדיו ה-TUI עדיין רץ. התקנה: `brew install cloudflared`.
|
|
75
76
|
|
|
76
77
|
**התקנה ובנייה**
|
|
77
78
|
|
|
78
79
|
</div>
|
|
79
80
|
|
|
80
81
|
```bash
|
|
81
|
-
git clone https://github.com/YosefHayim/
|
|
82
|
-
cd
|
|
82
|
+
git clone https://github.com/YosefHayim/ai-browser-bridge.git
|
|
83
|
+
cd ai-browser-bridge
|
|
83
84
|
pnpm install
|
|
84
85
|
pnpm build
|
|
85
86
|
```
|
|
86
87
|
|
|
87
88
|
<div dir="rtl">
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
**הפעילו את Chrome פעם אחת, ואז הריצו**
|
|
90
91
|
|
|
91
92
|
</div>
|
|
92
93
|
|
|
93
94
|
```bash
|
|
94
|
-
# פתיחת פרופיל ה-Chrome
|
|
95
|
-
node dist/bridge.js
|
|
95
|
+
# פתיחת פרופיל ה-Chrome המשותף של ה-bridge; התחברו אם צריך
|
|
96
|
+
node dist/bridge.js chrome start
|
|
96
97
|
|
|
97
98
|
# הפעלת ממשק הטרמינל מול הריפו שבו ChatGPT יעבוד
|
|
98
99
|
node dist/bridge.js --repo /path/to/your/project
|
|
@@ -100,13 +101,29 @@ node dist/bridge.js --repo /path/to/your/project
|
|
|
100
101
|
|
|
101
102
|
<div dir="rtl">
|
|
102
103
|
|
|
103
|
-
מעדיפים פקודת `bridge` גלובלית? הריצו `pnpm link --global` אחרי הבנייה, ואז השתמשו ב-`bridge`, `bridge
|
|
104
|
+
מעדיפים פקודת `bridge` גלובלית? הריצו `pnpm link --global` אחרי הבנייה, ואז השתמשו ב-`bridge`, `bridge chrome start`, `bridge ask "…"` וכו'.
|
|
105
|
+
|
|
106
|
+
## סוכנים וספקים
|
|
107
|
+
|
|
108
|
+
`bridge ask` יכול לפנות לספק יחיד או לשלוח את אותה שאלה לכמה ספקים. התשובות מוחזרות לפי ספק, וכשל חלקי אינו מוחק תוצאות תקינות.
|
|
109
|
+
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
bridge ask --provider claude --json "summarize this repo"
|
|
114
|
+
bridge ask --provider claude,deepseek,grok --json "compare these approaches"
|
|
115
|
+
bridge serve
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
<div dir="rtl">
|
|
119
|
+
|
|
120
|
+
`bridge serve` חושף את `ask` ואת `search_conversations` דרך MCP stdio. ChatGPT, Claude ו-Grok יכולים להשתמש ב-connector נכנס; Gemini, DeepSeek, Perplexity, Duck.ai ו-Arena פועלים כשיחות web, ו-Flow פועל כממשק יצירת וידאו.
|
|
104
121
|
|
|
105
122
|
## איפה נשמר המצב (state)
|
|
106
123
|
|
|
107
|
-
כל מצב ה-bridge של פרויקט נכתב
|
|
124
|
+
כל מצב ה-bridge של פרויקט נכתב תחת `<repo>/.bridge/` בשורש הקנוני של עץ העבודה של Git. גם הפעלה מתיקיית משנה משתמשת באותו שורש יחיד; תיקייה מפורשת שאינה חלק מ-Git נשארת השורש של עצמה. ה-bridge אינו יוצר או מנהל `.bridge/.gitignore`; מדיניות ההתעלמות שייכת לריפו היעד.
|
|
108
125
|
|
|
109
|
-
> תצורה שנכתבת על ידי המשתמש ומיועדת לחול על **כל** הריפואים נשמרת
|
|
126
|
+
> תצורה שנכתבת על ידי המשתמש ומיועדת לחול על **כל** הריפואים נשמרת בתיקיית הבית: פקודות מותאמות ב-`~/.ai-browser-bridge/commands/*.md` ו-hooks ברמת המשתמש ב-`~/.ai-browser-bridge/hooks.json`.
|
|
110
127
|
|
|
111
128
|
## הרשאות ו-checkpoints
|
|
112
129
|
|
|
@@ -129,12 +146,12 @@ node dist/bridge.js --repo /path/to/your/project
|
|
|
129
146
|
```bash
|
|
130
147
|
pnpm test # vitest run
|
|
131
148
|
pnpm typecheck # tsc --noEmit
|
|
132
|
-
pnpm verify:push # typecheck +
|
|
149
|
+
pnpm verify:push # Biome + typecheck + tests + build + בדיקות מבנה
|
|
133
150
|
```
|
|
134
151
|
|
|
135
152
|
<div dir="rtl">
|
|
136
153
|
|
|
137
|
-
הכיסוי מתמקד בנתיבים רגישי-בטיחות — אימות sandbox,
|
|
154
|
+
הכיסוי מתמקד בנתיבים רגישי-בטיחות — אימות sandbox, זיהוי השורש הקנוני של הריפו, מאגרי הסשנים/checkpoints, הרשאות וספירת הקשר.
|
|
138
155
|
|
|
139
156
|
## תמיכה ב-Google Flow
|
|
140
157
|
|
|
@@ -156,7 +173,7 @@ bridge ask --provider flow "same scene, dawn light" --attach ref1.png ref2.png
|
|
|
156
173
|
|
|
157
174
|
```bash
|
|
158
175
|
bridge flow clips # הצגת הקליפים בפרויקט הנוכחי (id + כתובת ניתנת-להורדה)
|
|
159
|
-
bridge flow download # הורדת
|
|
176
|
+
bridge flow download # הורדת הקליפים אל <repo>/.bridge/downloads/flow
|
|
160
177
|
bridge flow reuse --id <clipId> # הוספת קליפ בחזרה לפרומפט כקלט ("Add to prompt")
|
|
161
178
|
bridge flow extend --id <clipId> # הוספת קליפ לסצנה ("Add to scene" של Flow)
|
|
162
179
|
bridge flow rename --id <clipId> --name "hero shot"
|
|
@@ -190,12 +207,12 @@ bridge flow project-delete --yes # מחיקה לצמיתות של הפר
|
|
|
190
207
|
|
|
191
208
|
Flow דורש תוכנית **Google AI Pro/Ultra**. מכיוון שרינדור ב-Veo אורך דקות, `--provider flow` ממתין לתשובה הרבה יותר זמן מספקי הצ'אט.
|
|
192
209
|
|
|
193
|
-
**תחזוקת סלקטורים:** הסלקטורים של Flow **אומתו בזמן אמת (LIVE-VERIFIED)** מול עורך פרויקט מחובר. אם Google משנה את ה-UI, בצעו לכידה מחדש עם `node
|
|
210
|
+
**תחזוקת סלקטורים:** הסלקטורים של Flow **אומתו בזמן אמת (LIVE-VERIFIED)** מול עורך פרויקט מחובר. אם Google משנה את ה-UI, בצעו לכידה מחדש עם `node scripts/dev/captureProviderSelectors.mjs`, ואז עדכנו את [`src/config.ts`](src/config.ts); היצירה נמצאת ב-[`src/features/providers/flow/flowPage.ts`](src/features/providers/flow/flowPage.ts) וה-CRUD של הנכסים ב-[`src/features/providers/flow/flowAssets.ts`](src/features/providers/flow/flowAssets.ts).
|
|
194
211
|
|
|
195
212
|
## מגבלות
|
|
196
213
|
|
|
197
214
|
- **macOS בלבד** כיום (נתיב Chrome קשיח ועוזרי `pbcopy`/`lsof`).
|
|
198
|
-
- סלקטורים של
|
|
215
|
+
- סלקטורים של ספקים עלולים להישבר כשממשקי הווב משתנים; התיקונים ממוקדים במתאמים שלהם.
|
|
199
216
|
- ניצול ההקשר הוא **הערכה** — הדפדפן אינו חושף ספירת טוקנים מדויקת מצד השרת.
|
|
200
217
|
- מנהרת Cloudflare דורשת `cloudflared` מותקן.
|
|
201
218
|
- מקומי-תחילה מעיצובו; אינו שירות רב-משתמשים מאוחסן.
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
**English** · [עברית](README.he.md) · [Español](README.es.md) · [中文](README.zh.md)
|
|
10
10
|
|
|
11
11
|

|
|
12
|
-

|
|
13
13
|

|
|
14
14
|

|
|
15
15
|

|
|
@@ -25,11 +25,11 @@ ChatGPT is at its best in the browser — real account state, the model picker,
|
|
|
25
25
|
## Features
|
|
26
26
|
|
|
27
27
|
- **Terminal-driven ChatGPT** — send prompts and stream replies without leaving the shell; the real browser conversation stays the source of truth.
|
|
28
|
-
- **
|
|
28
|
+
- **Nine providers, one command** — `chatgpt`, `gemini`, `claude`, `deepseek`, `grok`, `perplexity`, `duck` ([Duck.ai](https://duck.ai/chat)), `arena` ([Arena](https://arena.ai/code/direct) — Direct/Battle/Agent/Side-by-Side + model picker), plus `flow` (Google's Veo video studio — a generation surface, not a chat). Pick one with `--provider`, or **fan out** across several (`--provider claude,deepseek,duck`) and get every reply keyed by provider in one call.
|
|
29
29
|
- **Built for agents** — a stable non-interactive `bridge ask … --json` contract (never hangs in a pipe) plus an outbound MCP `ask` tool, so any agent can drive a web chat.
|
|
30
30
|
- **Sandboxed local tools over MCP** — every file operation is validated against the selected repo root; no arbitrary shell, allowlisted test commands only.
|
|
31
31
|
- **Browser actions as commands** — `/resume`, `/new`, `/model`, `/rewind`, `/stop`, `/context`, `/diff`, `/compact`, and more.
|
|
32
|
-
- **Repo-
|
|
32
|
+
- **Repo-root sessions, transcripts, and downloads** — TUI and tool-enabled runs persist under the Git working-tree root's `<repo>/.bridge/`, even when launched from a nested directory; plain `bridge ask` stays stateless and only reuses the shared Chrome profile.
|
|
33
33
|
- **Safety controls** — permission modes (`read-only` / `ask` / `auto`) and automatic file checkpoints around every patch.
|
|
34
34
|
- **Project conventions** — custom commands plus `AGENTS.md` / `CLAUDE.md` are fed to ChatGPT for `/task` runs.
|
|
35
35
|
- **A real composer** — prompt history, reverse search, queued prompts, and `@file` mention autocomplete.
|
|
@@ -57,7 +57,7 @@ Four layers, each with one job:
|
|
|
57
57
|
|-------|------|----------------|
|
|
58
58
|
| **CLI** | Ink / React | Terminal UI: message pane, status line, `@file` mentions, `/commands`. |
|
|
59
59
|
| **Browser** | Playwright + Chrome DevTools Protocol | Attaches to Chrome on the debug port and reuses one shared bridge Chrome profile. Lifecycle/status/cache code lives in `src/features/browser/`; provider selectors live under `src/features/providers/<name>/`. |
|
|
60
|
-
| **MCP server** | MCP SDK +
|
|
60
|
+
| **MCP server** | MCP SDK + Effect Schema | Exposes the local repo tools to ChatGPT, Claude, and Grok as schema-validated, sandboxed handlers. |
|
|
61
61
|
| **Tunnel** | Cloudflare Tunnel (`cloudflared`) | Gives the local MCP server a temporary public HTTPS URL that provider connectors can reach — no deployment required. |
|
|
62
62
|
|
|
63
63
|
**Why a tunnel at all?** Provider MCP connectors call tools over HTTPS, but the tool server runs on your machine. Rather than deploy anything, the bridge spins up an ephemeral Cloudflare Tunnel (`*.trycloudflare.com`) in front of the local port and syncs that Streamable HTTP `…/mcp` URL into the provider app on startup. (ngrok would solve the same reachability problem; Cloudflare's `cloudflared` is used because its quick tunnels need no account or auth token. Grok's UI may show an `/sse` example — the bridge registers `/mcp` because cloudflared quick tunnels do not support SSE.)
|
|
@@ -67,7 +67,7 @@ Four layers, each with one job:
|
|
|
67
67
|
**Prerequisites**
|
|
68
68
|
|
|
69
69
|
- **macOS** — Chrome is launched with the macOS `open` command, and clipboard/process helpers use `pbcopy`/`lsof`.
|
|
70
|
-
- **Node.js ≥
|
|
70
|
+
- **Node.js ≥ 22** and **pnpm** (the repo pins `pnpm@10.14.0`).
|
|
71
71
|
- **Google Chrome or Chrome for Testing** — the bridge drives one shared bridge profile through a debug port. Sign in once in that bridge-launched window; every repo reuses it.
|
|
72
72
|
- **`cloudflared`** *(optional; ChatGPT, Claude, Grok)* — only needed for those providers to call local MCP tools. Without it the TUI still runs. Install with `brew install cloudflared`.
|
|
73
73
|
|
|
@@ -140,12 +140,14 @@ node dist/bridge.js ask "hello" --provider gemini --repo /path/to/project
|
|
|
140
140
|
|
|
141
141
|
```text
|
|
142
142
|
refactor the CLI input flow in @src/features/terminal/tui/App.tsx
|
|
143
|
-
compare @src/features/store/
|
|
143
|
+
compare @src/features/store/fileMentions.ts with @src/features/store/fileMentions.test.ts
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
Paths that escape the repo root are skipped; files over 100 KB are summarized rather than inlined.
|
|
147
147
|
|
|
148
|
-
**Conversation search** — `bridge chat search "query" --json`
|
|
148
|
+
**Conversation search** — `bridge chat search "query" --json` opens ChatGPT's Search UI,
|
|
149
|
+
selects Chats, and returns matching Conversations across titles and message content. It scrolls
|
|
150
|
+
the result overlay up to `--limit`; add `--open` to navigate the browser to the best match.
|
|
149
151
|
|
|
150
152
|
## Agents & fan-out
|
|
151
153
|
|
|
@@ -186,11 +188,10 @@ The `ask` tool takes `{ prompt, providers?, timeoutSeconds? }` and returns each
|
|
|
186
188
|
|
|
187
189
|
## Where state lives
|
|
188
190
|
|
|
189
|
-
Persistent bridge state
|
|
191
|
+
Persistent bridge state is written under the canonical Git working-tree root's `<repo>/.bridge/`. The bridge resolves both `--repo` and the launch directory to that root, so nested launches cannot create competing state or download folders. An explicit non-Git directory remains its own root.
|
|
190
192
|
|
|
191
193
|
```text
|
|
192
194
|
<repo>/.bridge/
|
|
193
|
-
├── .gitignore # a single "*", written automatically — see below
|
|
194
195
|
├── config.json # per-repo settings (includes `provider`: chatgpt | gemini)
|
|
195
196
|
├── sessions/<id>/ # metadata.json + append-only events.jsonl transcript
|
|
196
197
|
├── logs/<date>.jsonl # prompts, replies, and MCP tool-call summaries
|
|
@@ -202,7 +203,7 @@ Persistent bridge state for a project is written **inside that project**, under
|
|
|
202
203
|
|
|
203
204
|
Plain `bridge ask` and `bridge chrome start` do not create repo-local state; they only reuse the shared Chrome profile. The bridge creates `<repo>/.bridge/` for persistent TUI sessions, tool-enabled asks (`bridge ask --tools`), checkpoints, exports, screenshots, or default attachment downloads.
|
|
204
205
|
|
|
205
|
-
|
|
206
|
+
The bridge does not create or manage `.bridge/.gitignore`; ignore policy belongs to the target repository. Chrome cookies for bridge-driven sessions stay in the shared bridge profile under `~/.ai-browser-bridge/chrome-profile`, not under `.bridge/`.
|
|
206
207
|
|
|
207
208
|
> User-authored config meant to apply across **all** repos lives in your home directory: custom commands in `~/.ai-browser-bridge/commands/*.md` and user-level hooks in `~/.ai-browser-bridge/hooks.json`.
|
|
208
209
|
|
|
@@ -225,10 +226,10 @@ The package was renamed to **`ai-browser-bridge`**. Global user config moved fro
|
|
|
225
226
|
```bash
|
|
226
227
|
pnpm test # vitest run
|
|
227
228
|
pnpm typecheck # tsc --noEmit
|
|
228
|
-
pnpm verify:push #
|
|
229
|
+
pnpm verify:push # Biome + style mirror + typecheck + test + build + boundary/compatibility checks
|
|
229
230
|
```
|
|
230
231
|
|
|
231
|
-
Coverage focuses on the safety-sensitive paths — sandbox validation, repo-
|
|
232
|
+
Coverage focuses on the safety-sensitive paths — sandbox validation, canonical repo-root resolution, session/checkpoint stores, permissions, and context counting.
|
|
232
233
|
|
|
233
234
|
## Gemini web support
|
|
234
235
|
|
|
@@ -257,6 +258,27 @@ For full MCP on Gemini, use the official [Gemini API Remote MCP](https://ai.goog
|
|
|
257
258
|
|
|
258
259
|
**Selector maintenance:** when Google changes the Gemini web UI, fix selectors only in [`src/features/providers/gemini/geminiPage.ts`](src/features/providers/gemini/geminiPage.ts).
|
|
259
260
|
|
|
261
|
+
## Arena.ai support
|
|
262
|
+
|
|
263
|
+
The bridge drives **[Arena](https://arena.ai/code/direct)** (LMSYS) with a dedicated adapter for the mode menu and model picker:
|
|
264
|
+
|
|
265
|
+
| Mode | `--model` token | URL |
|
|
266
|
+
|------|-----------------|-----|
|
|
267
|
+
| **Direct** (default) | `direct` | `/code/direct` — one model |
|
|
268
|
+
| **Battle Mode** | `battle` | `/code` — Option A/B (dual reply when both finish) |
|
|
269
|
+
| **Agent Mode** | `agent` | `/agent` — agent shell (best-effort) |
|
|
270
|
+
| **Side by Side** | `side` / `sbs` | `/text/side-by-side` — pick two models |
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
bridge chrome start --provider arena
|
|
274
|
+
bridge ask --provider arena "build a todo app" # Direct + Max
|
|
275
|
+
bridge ask --provider arena --model glm-5.1 "reply with pong" # pick a model
|
|
276
|
+
bridge ask --provider arena --model battle "compare two approaches" # dual Option A/B
|
|
277
|
+
bridge ask --provider arena --model direct/gemini-3-flash "hello" # mode + model
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Model search matches the in-UI picker (Search models + Text/Code/Image/Search tabs). Battle turns on Code Arena can take minutes (full site builds) — raise `--timeout` if needed. No MCP connector on Arena.
|
|
281
|
+
|
|
260
282
|
## Google Flow support
|
|
261
283
|
|
|
262
284
|
The bridge can also drive **[Google Labs Flow](https://labs.google/fx/tools/flow)** — Google's Veo-powered AI video studio — with the same Playwright/CDP pattern. Flow is different in kind from the chat providers: it is a **generation** surface, so a "reply" is a rendered **clip** and attachments are **ingredients** (reference images).
|
|
@@ -271,7 +293,7 @@ Beyond generating, the bridge drives Flow's full **asset lifecycle** through `br
|
|
|
271
293
|
|
|
272
294
|
```bash
|
|
273
295
|
bridge flow clips # list clips in the current project (id + fetchable URL)
|
|
274
|
-
bridge flow download # download every clip's mp4 to
|
|
296
|
+
bridge flow download # download every clip's mp4 to <repo>/.bridge/downloads/flow
|
|
275
297
|
bridge flow reuse --id <clipId> # add a clip back to the prompt as input ("Add to prompt")
|
|
276
298
|
bridge flow extend --id <clipId> # add a clip to a scene (Flow's "Add to scene")
|
|
277
299
|
bridge flow rename --id <clipId> --name "hero shot"
|
|
@@ -303,7 +325,7 @@ Agents without shell access get the same lifecycle as **`flow_*` MCP tools** ove
|
|
|
303
325
|
|
|
304
326
|
Flow requires a **Google AI Pro/Ultra** plan. Because Veo renders take minutes, `--provider flow` waits far longer for a response than the chat providers do.
|
|
305
327
|
|
|
306
|
-
**Selector maintenance:** Flow's selectors were **LIVE-VERIFIED** against a signed-in project editor. If Google changes the UI, recapture with `node
|
|
328
|
+
**Selector maintenance:** Flow's selectors were **LIVE-VERIFIED** against a signed-in project editor. If Google changes the UI, recapture with `node scripts/dev/captureProviderSelectors.mjs`, then update [`src/config.ts`](src/config.ts); generation lives in [`src/features/providers/flow/flowPage.ts`](src/features/providers/flow/flowPage.ts) and asset CRUD in [`src/features/providers/flow/flowAssets.ts`](src/features/providers/flow/flowAssets.ts).
|
|
307
329
|
|
|
308
330
|
## Limitations
|
|
309
331
|
|