ai-browser-bridge 0.3.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 CHANGED
@@ -1,33 +1,34 @@
1
1
  <p align="center">
2
- <img src="assets/hero.png" alt="chatgpt-local-bridge — controla una sesión de ChatGPT en el navegador desde tu terminal mediante un puente MCP aislado" width="640" />
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
- # chatgpt-local-bridge
5
+ # ai-browser-bridge
6
6
 
7
7
  [English](README.md) · [עברית](README.he.md) · **Español** · [中文](README.zh.md)
8
8
 
9
9
  ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
10
- ![Node](https://img.shields.io/badge/node-%E2%89%A520-339933?logo=node.js&logoColor=white)
10
+ ![Node](https://img.shields.io/badge/node-%E2%89%A522-339933?logo=node.js&logoColor=white)
11
11
  ![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white)
12
12
  ![Playwright](https://img.shields.io/badge/Playwright-browser-2EAD33?logo=playwright&logoColor=white)
13
13
  ![MCP](https://img.shields.io/badge/MCP-connector-000000)
14
14
 
15
15
  ---
16
16
 
17
- > Controla una conversación real de ChatGPT en el navegador desde tu terminal y dale un conjunto reducido y aislado (sandbox) de herramientas locales del repositorio vía MCP — sin entregarle nunca una shell.
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
- `chatgpt-local-bridge` conecta esas dos superficies. Un prompt en la terminal controla tu sesión existente de ChatGPT 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; ChatGPT conserva su interfaz real.
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
- - **ChatGPT desde la terminal** — envía prompts y recibe respuestas sin salir de la shell; la conversación real del navegador es la fuente de verdad.
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 transcripciones locales por repositorio** — cada ejecución se registra en `<repo>/.bridge/` y se exporta como Markdown, JSON o JSONL.
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 | Controla la pestaña real de ChatGPT y captura respuestas. Los selectores están aislados en `src/browser/chatgpt-page.ts` para que los cambios de UI sean fáciles de arreglar. |
58
- | **Servidor MCP** | MCP SDK + Effect Schema | Expone las herramientas locales del repositorio a ChatGPT como handlers validados por esquema y en sandbox. |
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 ≥ 20** y **pnpm** (el repo fija `pnpm@10.14.0`).
69
- - **Google Chrome** — el bridge controla un perfil real de Chrome.
70
- - **`cloudflared`** *(opcional)* — solo necesario para que ChatGPT llame a herramientas locales. Sin él la TUI igual funciona. Instala con `brew install cloudflared`.
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/chatgpt-local-bridge.git
76
- cd chatgpt-local-bridge
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 sesión una vez y luego ejecuta**
82
+ **Inicia Chrome una vez y luego ejecuta**
82
83
 
83
84
  ```bash
84
- # Abre el perfil aislado de Chrome del bridge e inicia sesión en ChatGPT (persiste entre ejecuciones)
85
- node dist/bridge.js login
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 login`, `bridge ask "…"`, etc.
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 **dentro de ese proyecto**, bajo `<repo>/.bridge/`. En el primer uso, el bridge escribe `.bridge/.gitignore` con un único `*`. Eso hace que git ignore **todo** lo que hay en el directorio — incluidas las transcripciones y las cookies de inicio de sesión — de modo que nada pueda llegar a un commit, aunque viva dentro del repositorio. Tanto `git add -A` como `git add .bridge/` lo omiten; solo un `git add -f` explícito podría forzarlo. El archivo se reafirma en cada ejecución, así que borrarlo o manipularlo se cura automáticamente.
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 sigue en tu directorio home: comandos personalizados en `~/.chatgpt-local-bridge/commands/*.md` y hooks de usuario en `~/.chatgpt-local-bridge/hooks.json`.
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 + test + build (ejecutar antes de push)
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 rutas locales del repositorio, la auto-exclusión de `.bridge/`, los almacenes de sesiones/checkpoints, permisos y conteo de contexto.
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 el mp4 de cada clip en ./downloads/flow (o --id <clipId...>)
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 src/scripts/maintain/captureProviderSelectors.mjs`, luego actualiza [`src/config/index.ts`](src/config/index.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).
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 del navegador de ChatGPT pueden romperse cuando cambia la UI web; los arreglos están localizados en la capa del navegador.
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="chatgpt-local-bridge — drive a ChatGPT browser session from your terminal over a sandboxed MCP bridge" width="640" />
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
- # chatgpt-local-bridge
5
+ # ai-browser-bridge
6
6
 
7
7
  [English](README.md) · **עברית** · [Español](README.es.md) · [中文](README.zh.md)
8
8
 
9
9
  ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
10
- ![Node](https://img.shields.io/badge/node-%E2%89%A520-339933?logo=node.js&logoColor=white)
10
+ ![Node](https://img.shields.io/badge/node-%E2%89%A522-339933?logo=node.js&logoColor=white)
11
11
  ![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white)
12
12
  ![Playwright](https://img.shields.io/badge/Playwright-browser-2EAD33?logo=playwright&logoColor=white)
13
13
  ![MCP](https://img.shields.io/badge/MCP-connector-000000)
14
14
 
15
15
  <div dir="rtl">
16
16
 
17
- > הפעילו שיחת ChatGPT אמיתית מהדפדפן ישירות מהטרמינל, ותנו לה גישה מצומצמת ומבוקרת (sandbox) לכלי הריפו המקומי דרך MCP — בלי למסור לה אף פעם גישת shell.
17
+ > הפעילו שיחות ChatGPT או Gemini אמיתיות מהדפדפן ישירות מהטרמינל, ותנו ל-ChatGPT גישה מצומצמת ומבוקרת לכלי הריפו המקומי דרך MCP — בלי למסור לו גישת shell.
18
18
 
19
19
  ## למה זה קיים
20
20
 
21
21
  ‏ChatGPT נמצא בשיאו בדפדפן — מצב החשבון האמיתי, בורר המודלים, עריכת הודעות, רגנרציה והיסטוריית השיחה נשמרים במלואם. פיתוח קוד נמצא בשיאו בטרמינל, שם בודקים ומשנים קבצים, טסטים, diffs ו-patches ישירות.
22
22
 
23
- ‏`chatgpt-local-bridge` מחבר בין שני המשטחים האלה. שורת פקודה בטרמינל מפעילה את שיחת ה-ChatGPT הקיימת שלכם בדפדפן, ו-ChatGPT יכול לגשת לריפו הנוכחי דרך מספר מצומצם של **כלי MCP מאומתים** — `grep`, `read`, `apply_patch`, `run_tests`, `git_diff` — במקום גישת shell חופשית. אתם נשארים בתהליך עבודה אחד בטרמינל; ל-ChatGPT נשאר ה-UI האמיתי שלו.
23
+ ‏`ai-browser-bridge` מחבר בין שני המשטחים האלה. שורת פקודה בטרמינל מפעילה את שיחת הספק הקיימת בדפדפן, ו-ChatGPT יכול לגשת לריפו הנוכחי דרך מספר מצומצם של **כלי MCP מאומתים** — `grep`, `read`, `apply_patch`, `run_tests`, `git_diff` — במקום גישת shell חופשית. אתם נשארים בתהליך עבודה אחד בטרמינל; לספק נשאר ה-UI האמיתי שלו.
24
24
 
25
25
  ## יכולות
26
26
 
27
- - **הפעלת ChatGPT מהטרמינל** — שולחים פרומפטים ומקבלים תשובות בלי לעזוב את ה-shell; שיחת הדפדפן האמיתית היא מקור האמת.
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
- - **סשנים ותמלולים מקומיים לריפו** — כל הרצה נשמרת תחת `<repo>/.bridge/` וניתנת לייצוא כ-Markdown, JSON או JSONL.
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 | מפעיל את לשונית ה-ChatGPT האמיתית ולוכד תשובות. הסלקטורים מבודדים ב-`src/browser/chatgpt-page.ts` כך ששינויי UI קלים לתיקון. |
62
- | **שרת MCP** | MCP SDK + Effect Schema | חושף את כלי הריפו המקומיים ל-ChatGPT כ-handlers מאומתי-סכמה ומוגני-sandbox. |
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 ≥ 20** ו-**pnpm** (הריפו מקבע `pnpm@10.14.0`).
73
- - **Google Chrome** — ה-bridge מפעיל פרופיל Chrome אמיתי.
74
- - **`cloudflared`** *(אופציונלי)* — נדרש רק כדי ש-ChatGPT יקרא לכלים מקומיים. בלעדיו ה-TUI עדיין רץ. התקנה: `brew install 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/chatgpt-local-bridge.git
82
- cd chatgpt-local-bridge
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 המבודד של ה-bridge והתחברות ל-ChatGPT (נשמר בין הרצות)
95
- node dist/bridge.js login
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 login`, `bridge ask "…"` וכו'.
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 של פרויקט נכתב **בתוך אותו פרויקט**, תחת `<repo>/.bridge/`. בשימוש הראשון נכתב `.bridge/.gitignore` המכיל `*` בודד. זה גורם ל-git להתעלם מ**כל** מה שבתיקייה — כולל התמלולים ועוגיות ההתחברות — כך ששום דבר לא יכול להיכנס ל-commit, למרות שהוא נמצא בתוך הריפו. גם `git add -A` וגם `git add .bridge/` מדלגים עליו; רק `git add -f` מפורש יכול לעקוף. הקובץ נכתב מחדש בכל הרצה, כך שמחיקה או שינוי שלו מתרפאים אוטומטית.
124
+ כל מצב ה-bridge של פרויקט נכתב תחת `<repo>/.bridge/` בשורש הקנוני של עץ העבודה של Git. גם הפעלה מתיקיית משנה משתמשת באותו שורש יחיד; תיקייה מפורשת שאינה חלק מ-Git נשארת השורש של עצמה. ה-bridge אינו יוצר או מנהל `.bridge/.gitignore`; מדיניות ההתעלמות שייכת לריפו היעד.
108
125
 
109
- > תצורה שנכתבת על ידי המשתמש ומיועדת לחול על **כל** הריפואים נשמרת עדיין בתיקיית הבית: פקודות מותאמות ב-`~/.chatgpt-local-bridge/commands/*.md` ו-hooks ברמת המשתמש ב-`~/.chatgpt-local-bridge/hooks.json`.
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 + test + build (להריץ לפני push)
149
+ pnpm verify:push # Biome + typecheck + tests + build + בדיקות מבנה
133
150
  ```
134
151
 
135
152
  <div dir="rtl">
136
153
 
137
- הכיסוי מתמקד בנתיבים רגישי-בטיחות — אימות sandbox, רזולוציית נתיבים מקומיים לריפו, מנגנון ההתעלמות העצמית של `.bridge/`, מאגרי הסשנים/checkpoints, הרשאות וספירת הקשר.
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 # הורדת ה-mp4 של כל קליפ אל ./downloads/flow (או --id <clipId...>)
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 src/scripts/maintain/captureProviderSelectors.mjs`, ואז עדכנו את [`src/config/index.ts`](src/config/index.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).
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
- - סלקטורים של ChatGPT עלולים להישבר כשממשק הווב משתנה; התיקונים ממוקדים בשכבת הדפדפן.
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
  ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
12
- ![Node](https://img.shields.io/badge/node-%E2%89%A520-339933?logo=node.js&logoColor=white)
12
+ ![Node](https://img.shields.io/badge/node-%E2%89%A522-339933?logo=node.js&logoColor=white)
13
13
  ![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white)
14
14
  ![Playwright](https://img.shields.io/badge/Playwright-browser-2EAD33?logo=playwright&logoColor=white)
15
15
  ![MCP](https://img.shields.io/badge/MCP-connector-000000)
@@ -29,7 +29,7 @@ ChatGPT is at its best in the browser — real account state, the model picker,
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-local sessions & transcripts when needed** — TUI and tool-enabled runs persist under `<repo>/.bridge/`; plain `bridge ask` stays stateless and only reuses the shared Chrome profile.
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.
@@ -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 ≥ 20** and **pnpm** (the repo pins `pnpm@10.14.0`).
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/fileResolver.ts with @src/features/store/fileResolver.test.ts
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` searches ChatGPT history through the shared conversation catalog. Add `--open` to navigate the browser to the best match.
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 for a project is written **inside that project**, under `<repo>/.bridge/`:
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
- When repo-local state is needed, the bridge writes `.bridge/.gitignore` containing a single `*`. That makes git ignore **everything** in the directory — session transcripts, logs, downloads, screenshots, and checkpoints — so none of it can be committed, even though it lives inside the repo. Chrome cookies for bridge-driven sessions stay in the shared bridge profile under `~/.ai-browser-bridge/chrome-profile`, not under `.bridge/`. `git add -A` and `git add .bridge/` both skip bridge state; only an explicit `git add -f` could override. The file is re-asserted on persistent runs, so deleting or tampering with it heals automatically.
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 # biome ci + typecheck + test + build + check:class-api + check:tsdoc + check:boundaries
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-local path resolution, the `.bridge/` self-ignore guard, session/checkpoint stores, permissions, and context counting.
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
 
@@ -292,7 +293,7 @@ Beyond generating, the bridge drives Flow's full **asset lifecycle** through `br
292
293
 
293
294
  ```bash
294
295
  bridge flow clips # list clips in the current project (id + fetchable URL)
295
- bridge flow download # download every clip's mp4 to ./downloads/flow (or --id <clipId...>)
296
+ bridge flow download # download every clip's mp4 to <repo>/.bridge/downloads/flow
296
297
  bridge flow reuse --id <clipId> # add a clip back to the prompt as input ("Add to prompt")
297
298
  bridge flow extend --id <clipId> # add a clip to a scene (Flow's "Add to scene")
298
299
  bridge flow rename --id <clipId> --name "hero shot"
@@ -324,7 +325,7 @@ Agents without shell access get the same lifecycle as **`flow_*` MCP tools** ove
324
325
 
325
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.
326
327
 
327
- **Selector maintenance:** Flow's selectors were **LIVE-VERIFIED** against a signed-in project editor. If Google changes the UI, recapture with `node src/scripts/maintain/captureProviderSelectors.mjs`, then update [`src/config/index.ts`](src/config/index.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).
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).
328
329
 
329
330
  ## Limitations
330
331
 
package/README.zh.md CHANGED
@@ -1,33 +1,34 @@
1
1
  <p align="center">
2
- <img src="assets/hero.png" alt="chatgpt-local-bridge — 从终端驱动浏览器中的真实 ChatGPT 会话,通过隔离的 MCP 桥接访问本地仓库工具" width="640" />
2
+ <img src="assets/hero.png" alt="ai-browser-bridge — 通过 Chrome 从终端驱动 ChatGPT、Gemini、Claude、DeepSeek、Grok、Perplexity 与 Flow" width="640" />
3
3
  </p>
4
4
 
5
- # chatgpt-local-bridge
5
+ # ai-browser-bridge
6
6
 
7
7
  [English](README.md) · [עברית](README.he.md) · [Español](README.es.md) · **中文**
8
8
 
9
9
  ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
10
- ![Node](https://img.shields.io/badge/node-%E2%89%A520-339933?logo=node.js&logoColor=white)
10
+ ![Node](https://img.shields.io/badge/node-%E2%89%A522-339933?logo=node.js&logoColor=white)
11
11
  ![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white)
12
12
  ![Playwright](https://img.shields.io/badge/Playwright-browser-2EAD33?logo=playwright&logoColor=white)
13
13
  ![MCP](https://img.shields.io/badge/MCP-connector-000000)
14
14
 
15
15
  ---
16
16
 
17
- > 从终端驱动真实的 ChatGPT 浏览器会话,并通过 MCP 给它一组受限、沙箱化的本地仓库工具——永远不交给它一个 shell。
17
+ > 从终端驱动真实的 ChatGPT 或 Gemini 浏览器会话,并通过 MCP 给 ChatGPT 一组受限的本地仓库工具——永远不交给它一个 shell。
18
18
 
19
19
  ## 为什么需要它
20
20
 
21
21
  ChatGPT 在浏览器中表现最佳——真实的账户状态、模型选择器、消息编辑、重新生成以及会话历史都完整保留。而写代码在终端中最高效,可以直接检查和修改文件、测试、diff 与补丁。
22
22
 
23
- `chatgpt-local-bridge` 把这两个界面连接起来。终端中的一个提示词驱动你现有的 ChatGPT 浏览器会话,而 ChatGPT 可以通过一小组**经过校验的 MCP 工具**——`grep`、`read`、`apply_patch`、`run_tests`、`git_diff`——访问当前仓库,而不是获得原始 shell 访问权限。你始终停留在单一的终端工作流中;ChatGPT 保留它真实的界面。
23
+ `ai-browser-bridge` 把这两个界面连接起来。终端中的一个提示词驱动你现有的提供商浏览器会话,而 ChatGPT 可以通过一小组**经过校验的 MCP 工具**——`grep`、`read`、`apply_patch`、`run_tests`、`git_diff`——访问当前仓库,而不是获得原始 shell 访问权限。你始终停留在单一的终端工作流中;提供商保留其真实界面。
24
24
 
25
25
  ## 功能
26
26
 
27
- - **终端驱动 ChatGPT** — 在 shell 内发送提示词并接收回复;真实的浏览器会话才是事实来源。
27
+ - **九个提供商,一个命令** — ChatGPT、Gemini、Claude、DeepSeek、Grok、Perplexity、Duck.ai、Arena 与 Google Flow。使用 `--provider` 选择一个,或并行询问多个。
28
+ - **面向智能体** — `bridge ask … --json` 提供稳定的非交互接口,`bridge serve` 则暴露出站 MCP 工具。
28
29
  - **通过 MCP 的沙箱化本地工具** — 每个文件操作都针对所选仓库根目录进行校验;没有任意 shell,仅允许白名单内的测试命令。
29
30
  - **浏览器操作即命令** — `/resume`、`/new`、`/model`、`/rewind`、`/stop`、`/context`、`/diff`、`/compact` 等。
30
- - **仓库本地的会话与记录** — 每次运行都记录在 `<repo>/.bridge/` 下,可导出为 Markdown、JSON 或 JSONL。
31
+ - **仓库根目录中的会话、记录与下载** — 持久化运行始终使用 `<repo>/.bridge/`,即使从子目录启动也是如此。
31
32
  - **安全控制** — 权限模式(`read-only` / `ask` / `auto`)以及每次补丁前后的自动文件检查点。
32
33
  - **项目约定** — 自定义命令以及 `AGENTS.md` / `CLAUDE.md` 会在 `/task` 运行时提供给 ChatGPT。
33
34
  - **真正的输入器** — 提示词历史、反向搜索、提示词排队,以及 `@file` 提及的自动补全。
@@ -54,8 +55,8 @@ ChatGPT 在浏览器中表现最佳——真实的账户状态、模型选择器
54
55
  | 层 | 技术 | 职责 |
55
56
  |----|------|------|
56
57
  | **CLI** | Ink / React | 终端界面:消息面板、状态栏、`@file` 提及、`/` 命令。 |
57
- | **浏览器** | Playwright + Chrome DevTools Protocol | 驱动真实的 ChatGPT 标签页并捕获响应。选择器隔离在 `src/browser/chatgpt-page.ts`,便于在 UI 变动时修复。 |
58
- | **MCP 服务器** | MCP SDK + Effect Schema | 将本地仓库工具以经过 schema 校验且沙箱化的处理器形式暴露给 ChatGPT。 |
58
+ | **浏览器** | Playwright + Chrome DevTools Protocol | 通过调试端口连接 Chrome,并复用唯一的共享 bridge 配置文件。提供商适配器位于 `src/features/providers/`。 |
59
+ | **MCP 服务器** | MCP SDK + Effect Schema | 向 ChatGPT、Claude 与 Grok 暴露经过校验且沙箱化的本地工具。 |
59
60
  | **隧道** | Cloudflare Tunnel (`cloudflared`) | 为本地 MCP 服务器提供一个临时的公共 HTTPS 地址,供 ChatGPT 连接器访问——无需部署。 |
60
61
 
61
62
  **为什么需要隧道?** ChatGPT 的 MCP 连接器通过 HTTPS 调用工具,但工具服务器运行在你的机器上。与其部署任何东西,bridge 在本地端口前面启动一个临时的 Cloudflare 隧道(`*.trycloudflare.com`),并在启动时把该 `…/mcp` 地址同步到 ChatGPT 应用中。(ngrok 也能解决同样的可达性问题;这里使用 Cloudflare 的 `cloudflared`,因为它的快速隧道无需账户或令牌。)
@@ -65,36 +66,48 @@ ChatGPT 在浏览器中表现最佳——真实的账户状态、模型选择器
65
66
  **前置条件**
66
67
 
67
68
  - **macOS** — Chrome 从 `/Applications/Google Chrome.app` 启动,剪贴板/进程辅助使用 `pbcopy`/`lsof`。
68
- - **Node.js ≥ 20** 与 **pnpm**(仓库锁定 `pnpm@10.14.0`)。
69
- - **Google Chrome** — bridge 驱动一个真实的 Chrome 配置文件。
70
- - **`cloudflared`** *(可选)* — 仅当需要 ChatGPT 调用本地工具时才需要。没有它 TUI 仍可运行。安装:`brew install cloudflared`。
69
+ - **Node.js ≥ 22** 与 **pnpm**(仓库锁定 `pnpm@10.14.0`)。
70
+ - **Google Chrome 或 Chrome for Testing** — bridge 复用 `~/.ai-browser-bridge/chrome-profile` 中的全局共享配置文件。
71
+ - **`cloudflared`** *(可选)* — ChatGPT、Claude 或 Grok 调用本地工具时需要。没有它 TUI 仍可运行。安装:`brew install cloudflared`。
71
72
 
72
73
  **安装与构建**
73
74
 
74
75
  ```bash
75
- git clone https://github.com/YosefHayim/chatgpt-local-bridge.git
76
- cd chatgpt-local-bridge
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
- **登录一次,然后运行**
82
+ **启动 Chrome,然后运行**
82
83
 
83
84
  ```bash
84
- # 打开 bridge 的隔离 Chrome 配置文件并登录 ChatGPT(在多次运行间保持登录)
85
- node dist/bridge.js login
85
+ # 打开 bridge 的共享 Chrome 配置文件;如有需要请登录
86
+ node dist/bridge.js chrome start
86
87
 
87
88
  # 针对你希望 ChatGPT 操作的仓库启动终端界面
88
89
  node dist/bridge.js --repo /path/to/your/project
89
90
  ```
90
91
 
91
- 想要一个全局 `bridge` 命令?构建后运行 `pnpm link --global`,然后使用 `bridge`、`bridge login`、`bridge ask "…"` 等。
92
+ 想要一个全局 `bridge` 命令?构建后运行 `pnpm link --global`,然后使用 `bridge`、`bridge chrome start`、`bridge ask "…"` 等。
93
+
94
+ ## 智能体与提供商
95
+
96
+ `bridge ask` 可以询问单个提供商,也可以把同一问题并行发送给多个提供商。结果按提供商返回,部分失败不会丢弃成功结果。
97
+
98
+ ```bash
99
+ bridge ask --provider claude --json "summarize this repo"
100
+ bridge ask --provider claude,deepseek,grok --json "compare these approaches"
101
+ bridge serve
102
+ ```
103
+
104
+ `bridge serve` 通过 MCP stdio 提供 `ask` 与 `search_conversations`。ChatGPT、Claude 与 Grok 可使用入站 MCP 连接器;Gemini、DeepSeek、Perplexity、Duck.ai 与 Arena 作为网页聊天运行,Flow 则作为视频生成界面运行。
92
105
 
93
106
  ## 状态保存在哪里
94
107
 
95
- 某个项目的所有 bridge 状态都写入**该项目内部**,位于 `<repo>/.bridge/` 下。首次使用时,bridge 会写入仅含一个 `*` 的 `.bridge/.gitignore`。这会让 git 忽略该目录中的**所有内容**——包括会话记录和登录 cookie——因此即使它位于仓库内部,也无法被提交。`git add -A` 和 `git add .bridge/` 都会跳过它;只有显式的 `git add -f` 才能覆盖。该文件在每次运行时都会重新写入,因此删除或篡改它都会自动恢复。
108
+ 某个项目的所有 bridge 状态都写入 Git 工作树规范根目录下的 `<repo>/.bridge/`。即使从子目录启动,也只会使用这一处根目录;显式指定的非 Git 目录仍以自身作为根目录。bridge 不会创建或管理 `.bridge/.gitignore`;忽略策略由目标仓库自行决定。
96
109
 
97
- > 由用户编写、意在应用于**所有**仓库的配置仍保留在你的主目录中:自定义命令位于 `~/.chatgpt-local-bridge/commands/*.md`,用户级 hooks 位于 `~/.chatgpt-local-bridge/hooks.json`。
110
+ > 由用户编写、意在应用于**所有**仓库的配置位于你的主目录中:自定义命令在 `~/.ai-browser-bridge/commands/*.md`,用户级 hooks 在 `~/.ai-browser-bridge/hooks.json`。
98
111
 
99
112
  ## 权限与检查点
100
113
 
@@ -111,10 +124,10 @@ node dist/bridge.js --repo /path/to/your/project
111
124
  ```bash
112
125
  pnpm test # vitest run
113
126
  pnpm typecheck # tsc --noEmit
114
- pnpm verify:push # typecheck + test + build(推送前运行)
127
+ pnpm verify:push # Biome + typecheck + tests + build + 结构检查
115
128
  ```
116
129
 
117
- 覆盖率聚焦于安全敏感路径——沙箱校验、仓库本地路径解析、`.bridge/` 自忽略保护、会话/检查点存储、权限以及上下文计数。
130
+ 覆盖率聚焦于安全敏感路径——沙箱校验、规范仓库根目录解析、会话/检查点存储、权限以及上下文计数。
118
131
 
119
132
  ## Google Flow 支持
120
133
 
@@ -130,7 +143,7 @@ bridge ask --provider flow "same scene, dawn light" --attach ref1.png ref2.png
130
143
 
131
144
  ```bash
132
145
  bridge flow clips # 列出当前项目中的片段(id + 可获取的 URL)
133
- bridge flow download # 将每个片段的 mp4 下载到 ./downloads/flow(或 --id <clipId...>)
146
+ bridge flow download # 将片段下载到 <repo>/.bridge/downloads/flow
134
147
  bridge flow reuse --id <clipId> # 将片段作为输入重新加入提示词("Add to prompt")
135
148
  bridge flow extend --id <clipId> # 将片段加入场景(Flow 的 "Add to scene")
136
149
  bridge flow rename --id <clipId> --name "hero shot"
@@ -162,12 +175,12 @@ bridge flow project-delete --yes # 永久删除当前项目
162
175
 
163
176
  Flow 需要 **Google AI Pro/Ultra** 套餐。由于 Veo 渲染需要数分钟,`--provider flow` 等待响应的时间远比聊天类提供商更长。
164
177
 
165
- **选择器维护:** Flow 的选择器已针对已登录的项目编辑器**实时验证(LIVE-VERIFIED)**。如果 Google 更改了 UI,请使用 `node src/scripts/maintain/captureProviderSelectors.mjs` 重新捕获,然后更新 [`src/config/index.ts`](src/config/index.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)。
178
+ **选择器维护:** 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)。
166
179
 
167
180
  ## 限制
168
181
 
169
182
  - 目前**仅支持 macOS**(硬编码的 Chrome 路径以及 `pbcopy`/`lsof` 辅助)。
170
- - 当网页 UI 变动时,ChatGPT 浏览器选择器可能失效;修复集中在浏览器层。
183
+ - 当提供商的网页界面变动时,选择器可能失效;修复集中在对应适配器中。
171
184
  - 上下文用量是**估算值**——浏览器不暴露服务器端的精确 token 计数。
172
185
  - Cloudflare 隧道需要已安装 `cloudflared`。
173
186
  - 设计上以本地优先;并非托管的多用户服务。