@korl3one/ccode 2.2.0 → 3.1.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.md CHANGED
@@ -1,93 +1,89 @@
1
- ```
2
- ██████╗ ██████╗ ██████╗ ██████╗ ███████╗
3
- ██╔════╝██╔════╝ ██╔═══██╗██╔══██╗██╔════╝
4
- ██║ ██║ ██║ ██║██║ ██║█████╗
5
- ██║ ██║ ██║ ██║██║ ██║██╔══╝
6
- ╚██████╗╚██████╗ ╚██████╔╝██████╔╝███████╗
7
- ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
8
- ```
1
+ <div align="center">
9
2
 
10
- # CCODE
3
+ <img src="assets/logo.png" alt="CCODE" width="600"/>
4
+
5
+ <br/>
6
+ <br/>
11
7
 
12
8
  **Persistent context CLI for AI-assisted development.**
13
9
 
14
10
  Stop re-explaining your project to AI every time the session resets.
15
11
 
12
+ <br/>
13
+
16
14
  ```bash
17
15
  npm install -g @korl3one/ccode
18
- ccode init
19
16
  ```
20
17
 
21
- [![npm version](https://img.shields.io/npm/v/@korl3one/ccode)](https://www.npmjs.com/package/@korl3one/ccode)
22
- [![license](https://img.shields.io/npm/l/@korl3one/ccode)](LICENSE)
23
- [![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)
18
+ <br/>
19
+
20
+ [![npm version](https://img.shields.io/npm/v/@korl3one/ccode?color=00B4D8&style=for-the-badge)](https://www.npmjs.com/package/@korl3one/ccode)
21
+ [![license](https://img.shields.io/npm/l/@korl3one/ccode?color=0077B6&style=for-the-badge)](LICENSE)
22
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D18-2DC653?style=for-the-badge)](https://nodejs.org)
23
+ [![GitHub stars](https://img.shields.io/github/stars/iDevelop25/ccode?style=for-the-badge&color=FFB703)](https://github.com/iDevelop25/ccode)
24
+
25
+ </div>
24
26
 
25
27
  ---
26
28
 
27
29
  ## The problem
28
30
 
29
- Every time you switch sessions, models, or tools when working with AI, you lose your project context. You end up re-explaining the architecture, previous decisions, and current state over and over again.
31
+ Every time you switch sessions, models, or tools when working with AI, **you lose your project context**. You end up re-explaining the architecture, previous decisions, and current state over and over again.
30
32
 
31
- ## The solution
32
-
33
- CCODE stores your project context **inside the repository**. One command generates professional documentation, architecture, rules, and a verifiable task checklist — all adapted to your project's actual complexity.
33
+ And if you use multiple AI tools — Claude Code, Cursor, Gemini CLI, Copilot — you have to configure context files for each one manually.
34
34
 
35
- Any developer or AI can read `.ccode/` and understand the project instantly.
35
+ ## The solution
36
36
 
37
- ---
37
+ CCODE generates and maintains your project context **inside the repository**. One command produces professional documentation, architecture, rules, and a verifiable task checklist — all adapted to your project's actual complexity.
38
38
 
39
- ## Demo
39
+ Then it **syncs that context to every major AI tool** automatically.
40
40
 
41
- ```
42
- $ ccode init
41
+ Any developer or AI can read your project and understand it instantly.
43
42
 
44
- ██████╗ ██████╗ ██████╗ ██████╗ ███████╗
45
- ██╔════╝██╔════╝ ██╔═══██╗██╔══██╗██╔════╝
46
- ██║ ██║ ██║ ██║██║ ██║█████╗
47
- ╚██████╗╚██████╗ ╚██████╔╝██████╔╝███████╗
48
- ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
43
+ ---
49
44
 
50
- ●●●● Paso 4/4
45
+ ## Universal Context Sync
51
46
 
52
- Contexto generado exitosamente
47
+ This is what makes CCODE different. One command generates context files for **every major AI tool**:
53
48
 
54
- .ccode/
55
- ├── project.md Documentacion del proyecto
56
- ├── architecture.md Arquitectura del sistema
57
- ├── rules.md Estandares de desarrollo
58
- ├── tasks.json Checklist de tareas (8 tareas)
59
- ├── context.json Configuracion
60
- ├── state.json Estado del workflow
61
- └── memory.md Historial de decisiones
49
+ ```bash
50
+ ccode sync
51
+ ```
62
52
 
63
- CCODE sigue observando tu proyecto...
53
+ ```
54
+ project/
55
+ ├── AGENTS.md ← Open Standard (60K+ repos)
56
+ ├── CLAUDE.md ← Claude Code
57
+ ├── GEMINI.md ← Gemini CLI
58
+ ├── .cursorrules ← Cursor
59
+ ├── .github/copilot-instructions.md ← GitHub Copilot
60
+ └── .ccode/context-export.md ← Universal (copy/paste to any AI chat)
61
+ ```
64
62
 
65
- ████████████░░░░░░░░ 60% (3/5)
66
- > Tarea activa: TASK-002 — Crear formulario de login
63
+ Each file is adapted to the tool's expected format. Your project context — architecture, rules, tasks, decisions — synced everywhere, from a single source of truth.
67
64
 
68
- ? Que hacemos?
69
- > Verificar progreso (se detectaron cambios)
70
- Marcar tarea como completada
71
- Iniciar siguiente tarea
72
- Ver estado completo
73
- Salir
74
- ```
65
+ No manual setup per tool. No copy-pasting between files. Context stays in sync automatically with `ccode init`, `ccode update`, and `ccode sync`.
75
66
 
76
67
  ---
77
68
 
78
69
  ## Why CCODE?
79
70
 
71
+ <div align="center">
72
+
80
73
  | | CCODE | Manual prompts |
81
74
  |---|:---:|:---:|
82
75
  | Persistent project context | ✅ | ❌ |
76
+ | Universal context sync (5+ AI tools) | ✅ | ❌ |
83
77
  | Architecture adapted to complexity | ✅ | ❌ |
84
78
  | AI-ready documentation | ✅ | ❌ |
85
79
  | Verifiable task checklist | ✅ | ❌ |
86
80
  | Auto-detect file changes | ✅ | ❌ |
87
81
  | AI-powered task verification | ✅ | ❌ |
88
- | Works with 6 AI providers | ✅ | ❌ |
82
+ | Zero-config AI provider detection | ✅ | ❌ |
89
83
  | Context lives in the repo (Git) | ✅ | ❌ |
90
84
 
85
+ </div>
86
+
91
87
  ---
92
88
 
93
89
  ## How it works
@@ -99,15 +95,21 @@ cd my-project
99
95
  ccode init
100
96
  ```
101
97
 
102
- A step-by-step wizard asks about your project and an AI generates the full context. CCODE adapts automatically:
98
+ A step-by-step wizard asks about your project and an AI generates the full context. CCODE **adapts automatically**:
99
+
100
+ | Project type | Context depth | Tasks |
101
+ |---|---|---|
102
+ | Simple (prototype, few features) | Lightweight docs | 3-5 |
103
+ | Medium (standard app) | Moderate architecture | 5-8 |
104
+ | Complex (multiple modules) | Detailed patterns + diagrams | 8-12 |
105
+
106
+ A simple login doesn't need microservice diagrams. CCODE is smart about it.
103
107
 
104
- - **Simple project** (prototype, few features) lightweight context, 3-5 tasks
105
- - **Medium project** (standard app) → moderate context, 5-8 tasks
106
- - **Complex project** (multiple modules, integrations) → detailed architecture, 8-12 tasks
108
+ After generation, context is automatically synced to all AI tools.
107
109
 
108
110
  ### 2. Persistent session
109
111
 
110
- After init, CCODE stays active — watching your project in real time:
112
+ After init, CCODE **stays active** — watching your project in real time:
111
113
 
112
114
  - Detects file changes automatically
113
115
  - Suggests verifying tasks when it sees progress
@@ -130,40 +132,50 @@ CCODE compares **acceptance criteria** against **actual project files**:
130
132
  ○ TASK-003: Implement JWT auth — PENDING
131
133
  ```
132
134
 
133
- ### 4. Context export
135
+ It doesn't guess — it verifies.
136
+
137
+ ### 4. Context sync
138
+
139
+ ```bash
140
+ ccode sync
141
+ ```
142
+
143
+ Regenerates context files for every AI tool. Run it after making significant changes, or let `ccode update` handle it when you re-analyze the project.
144
+
145
+ ### 5. Context export
134
146
 
135
147
  ```bash
136
148
  ccode export
137
149
  ```
138
150
 
139
- Generates a single `.md` file with your full project context ready to paste into any AI chat (ChatGPT, Claude, Gemini, etc.) without connecting an API.
151
+ Three options: sync to all tools, export a universal `.md` for copy/paste into any AI chat, or pick specific tools.
140
152
 
141
- ### 5. Project health check
153
+ ### 6. Project health check
142
154
 
143
155
  ```bash
144
156
  ccode doctor
145
157
  ```
146
158
 
147
- ```
148
- ✓ Contexto generado
149
- ✓ Proveedor de IA configurado
150
- ⚠ 2 tareas sin completar
151
- ⚠ architecture.md no refleja 3 archivos nuevos
152
- ✓ Conexion con IA activa
153
- ```
159
+ Like a linter, but for your project context. Checks context files, AI connection, task status, export state, and tells you what needs attention.
154
160
 
155
161
  ---
156
162
 
157
163
  ## Supported AI Providers
158
164
 
165
+ <div align="center">
166
+
159
167
  | Provider | Models | Note |
160
168
  |----------|--------|------|
161
- | **Claude** (Anthropic) | Sonnet 4, Haiku 3.5, Opus 4 | Recommended |
162
- | **OpenAI** (ChatGPT) | GPT-4o, GPT-4o mini, GPT-4.1, o3-mini | Most popular |
163
- | **Google Gemini** | 2.5 Flash, 2.5 Pro, 2.0 Flash | Free tier available |
164
- | **DeepSeek** | Chat, Reasoner | Budget-friendly |
165
- | **Groq** | Llama 3.3 70B, Llama 3.1 8B, Mixtral 8x7B | Ultra-fast, free tier |
166
- | **Ollama** | Any local model | Offline, no API key |
169
+ | **Google Gemini** | 2.5 Flash, 2.5 Pro, 2.0 Flash | Free — just a Google account |
170
+ | **Claude** (Anthropic) | Sonnet 4, Haiku 3.5, Opus 4 | Best quality |
171
+
172
+ </div>
173
+
174
+ CCODE auto-detects your provider:
175
+
176
+ 1. **Gemini CLI OAuth** — If you have `gemini` CLI installed and authenticated, it works instantly. Zero config.
177
+ 2. **Environment variables** — `GOOGLE_API_KEY` or `ANTHROPIC_API_KEY` detected automatically.
178
+ 3. **Manual setup** — Guided wizard with browser-based key generation as fallback.
167
179
 
168
180
  ---
169
181
 
@@ -171,29 +183,49 @@ ccode doctor
171
183
 
172
184
  | Command | What it does |
173
185
  |---------|-------------|
174
- | `ccode init` | Interactive wizard — generates full project context |
175
- | `ccode update` | Re-analyze project and refresh context |
176
- | `ccode export` | Export context as a single `.md` file for any AI |
177
- | `ccode explain` | Quick project summary for onboarding |
178
- | `ccode doctor` | Health check what's good, what's missing |
179
- | `ccode connect` | Configure AI provider |
186
+ | `ccode init` | Interactive wizard — generates full project context + syncs to all AI tools |
187
+ | `ccode sync` | Sync context to all AI tools (AGENTS.md, CLAUDE.md, .cursorrules, ...) |
188
+ | `ccode update` | Re-analyze project with AI and refresh context |
189
+ | `ccode export` | Export context all tools, universal .md, or pick specific |
190
+ | `ccode verify` | AI-powered task verification against actual project files |
180
191
  | `ccode status` | Dashboard with progress bar and stats |
192
+ | `ccode doctor` | Health check — context files, AI connection, exports, tasks |
193
+ | `ccode connect` | Configure or reconfigure AI provider |
194
+ | `ccode explain` | Quick project summary for onboarding |
195
+ | `ccode plan` | Generate or regenerate task checklist |
196
+ | `ccode next` | Show and start the next pending task |
197
+ | `ccode complete` | Mark active task as completed |
181
198
 
182
199
  ---
183
200
 
184
201
  ## What gets generated
185
202
 
186
- Everything lives in `.ccode/` inside your repository:
203
+ ### Source of truth (`.ccode/`)
204
+
205
+ ```
206
+ .ccode/
207
+ ├── project.md Vision, objectives, scope
208
+ ├── architecture.md System structure (adapted to complexity)
209
+ ├── rules.md Development standards for your stack
210
+ ├── tasks.json Task checklist with acceptance criteria
211
+ ├── state.json Active task, workflow stage
212
+ ├── context.json Project configuration
213
+ ├── memory.md Decision history
214
+ ├── config.json AI provider config
215
+ └── context-export.md Universal export
216
+ ```
217
+
218
+ ### Synced context files (project root)
219
+
220
+ ```
221
+ AGENTS.md Open Standard
222
+ CLAUDE.md Claude Code
223
+ GEMINI.md Gemini CLI
224
+ .cursorrules Cursor
225
+ .github/copilot-instructions.md GitHub Copilot
226
+ ```
187
227
 
188
- | File | Content |
189
- |------|---------|
190
- | `project.md` | Vision, objectives, scope |
191
- | `architecture.md` | System structure adapted to complexity |
192
- | `rules.md` | Development standards for your stack |
193
- | `tasks.json` | Task checklist with acceptance criteria |
194
- | `state.json` | Active task, workflow stage |
195
- | `memory.md` | Decision history |
196
- | `config.json` | AI provider config |
228
+ All derived from `.ccode/`. One source, multiple outputs.
197
229
 
198
230
  ---
199
231
 
@@ -201,46 +233,54 @@ Everything lives in `.ccode/` inside your repository:
201
233
 
202
234
  ```
203
235
  src/
204
- cli/Session, branding, file watcher
205
- core/Context engine, tasks, prompt builder
206
- ai/ 6 provider adapters (Adapter pattern)
207
- utils/File system abstraction
236
+ ├── cli/ Session, branding, file watcher
237
+ ├── core/ Context engine, tasks, prompt builder, exports
238
+ ├── ai/ Provider adapters (Adapter pattern)
239
+ └── utils/ File system abstraction
208
240
  ```
209
241
 
210
- Key patterns: **Adapter** (AI providers), **Observer** (file watcher), **State Machine** (workflow), **Builder** (prompts).
242
+ **Patterns:** Adapter (AI providers) · Observer (file watcher) · State Machine (workflow) · Builder (prompts)
211
243
 
212
244
  ---
213
245
 
214
246
  ## Contributing
215
247
 
216
- See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions and guidelines.
248
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions.
217
249
 
218
- Adding a new AI provider? Just implement `IAIProvider`, add it to the manager switch, done.
250
+ Adding a new AI provider? Implement `IAIProvider`, add it to the manager, done.
251
+
252
+ Adding a new export format? Add a method to `ContextExporter`, register the format, done.
253
+
254
+ Zero changes to the rest of the system in both cases.
219
255
 
220
256
  ---
221
257
 
222
258
  ## Learn more
223
259
 
224
- - [Learning guide](docs/learning/README.md) 6 modules following QP2C methodology
225
- - [AGENTS.md](AGENTS.md) — Engineering roles
226
- - [SKILLS.md](SKILLS.md) — Technical competencies
227
- - [YouTube @CreativeCode25](https://www.youtube.com/@CreativeCode25) — Tutorials and walkthroughs
260
+ | Resource | Link |
261
+ |----------|------|
262
+ | Engineering roles | [AGENTS.md](AGENTS.md) |
263
+ | Technical competencies | [SKILLS.md](SKILLS.md) |
264
+ | YouTube | [@CreativeCode25](https://www.youtube.com/@CreativeCode25) |
228
265
 
229
266
  ---
230
267
 
231
- ## Support the project
268
+ <div align="center">
269
+
270
+ ### If CCODE helps you, consider giving it a star
232
271
 
233
- If CCODE helps you, consider giving it a **star on GitHub** ⭐
234
272
  It helps the project grow and reach more developers.
235
273
 
236
- [![GitHub stars](https://img.shields.io/github/stars/iDevelop25/ccode?style=social)](https://github.com/iDevelop25/ccode)
274
+ <br/>
237
275
 
238
- ---
276
+ [![Star on GitHub](https://img.shields.io/github/stars/iDevelop25/ccode?style=for-the-badge&color=FFB703&label=Star%20on%20GitHub)](https://github.com/iDevelop25/ccode)
239
277
 
240
- ## License
278
+ <br/>
241
279
 
242
- ISC
280
+ **[npm](https://www.npmjs.com/package/@korl3one/ccode)** · **[GitHub](https://github.com/iDevelop25/ccode)** · **[YouTube](https://www.youtube.com/@CreativeCode25)**
243
281
 
244
- ---
282
+ <br/>
245
283
 
246
284
  *CCODE doesn't tell you how to code — it tells you what to build and makes sure you don't lose track.*
285
+
286
+ </div>
@@ -3,7 +3,8 @@ import { IAIProvider, IAIConfig } from './provider.js';
3
3
  * Adaptador para Claude (Anthropic).
4
4
  */
5
5
  export declare class ClaudeAdapter implements IAIProvider {
6
- private config;
6
+ private apiKey;
7
+ private model;
7
8
  constructor(config: IAIConfig);
8
9
  getName(): string;
9
10
  generate(prompt: string): Promise<string>;
package/dist/ai/claude.js CHANGED
@@ -3,32 +3,35 @@ import axios from 'axios';
3
3
  * Adaptador para Claude (Anthropic).
4
4
  */
5
5
  export class ClaudeAdapter {
6
- config;
6
+ apiKey;
7
+ model;
7
8
  constructor(config) {
8
- this.config = {
9
- apiKey: config.apiKey || '',
10
- model: config.model || 'claude-sonnet-4-20250514',
11
- baseUrl: config.baseUrl || 'https://api.anthropic.com/v1/messages',
12
- };
9
+ this.apiKey = config.apiKey || '';
10
+ this.model = config.model || 'claude-sonnet-4-20250514';
13
11
  }
14
12
  getName() {
15
- return `Claude (${this.config.model})`;
13
+ return `Claude (${this.model})`;
16
14
  }
17
15
  async generate(prompt) {
18
- if (!this.config.apiKey) {
16
+ if (!this.apiKey) {
19
17
  throw new Error('API Key de Anthropic no configurada.');
20
18
  }
21
- const response = await axios.post(this.config.baseUrl, {
22
- model: this.config.model,
19
+ const response = await axios.post('https://api.anthropic.com/v1/messages', {
20
+ model: this.model,
23
21
  max_tokens: 8096,
24
22
  messages: [{ role: 'user', content: prompt }],
25
23
  }, {
26
24
  headers: {
27
- 'x-api-key': this.config.apiKey,
25
+ 'x-api-key': this.apiKey,
28
26
  'anthropic-version': '2023-06-01',
29
27
  'content-type': 'application/json',
30
28
  },
29
+ timeout: 120000,
31
30
  });
32
- return response.data.content[0].text;
31
+ const text = response.data?.content?.[0]?.text;
32
+ if (!text) {
33
+ throw new Error('Claude respondio pero sin contenido. Intenta de nuevo.');
34
+ }
35
+ return text;
33
36
  }
34
37
  }
@@ -1,10 +1,22 @@
1
1
  import { IAIProvider, IAIConfig } from './provider.js';
2
2
  /**
3
3
  * Adaptador para Google Gemini.
4
+ * Soporta API Key y OAuth token (de Gemini CLI).
4
5
  */
5
6
  export declare class GeminiAdapter implements IAIProvider {
6
- private config;
7
+ private apiKey;
8
+ private oauthToken;
9
+ private model;
7
10
  constructor(config: IAIConfig);
8
11
  getName(): string;
12
+ /**
13
+ * Try to read OAuth token from Gemini CLI installation.
14
+ */
15
+ static readOAuthToken(): string | null;
16
+ /**
17
+ * Check if Gemini CLI is installed and authenticated.
18
+ */
19
+ static isAvailable(): boolean;
20
+ setOAuthToken(token: string): void;
9
21
  generate(prompt: string): Promise<string>;
10
22
  }
package/dist/ai/gemini.js CHANGED
@@ -1,31 +1,78 @@
1
1
  import axios from 'axios';
2
+ import * as fs from 'fs';
3
+ import * as path from 'path';
4
+ import * as os from 'os';
2
5
  /**
3
6
  * Adaptador para Google Gemini.
7
+ * Soporta API Key y OAuth token (de Gemini CLI).
4
8
  */
5
9
  export class GeminiAdapter {
6
- config;
10
+ apiKey;
11
+ oauthToken;
12
+ model;
7
13
  constructor(config) {
8
- this.config = {
9
- apiKey: config.apiKey || '',
10
- model: config.model || 'gemini-2.5-flash',
11
- baseUrl: config.baseUrl || 'https://generativelanguage.googleapis.com/v1beta/models',
12
- };
14
+ this.apiKey = config.apiKey || '';
15
+ this.oauthToken = '';
16
+ this.model = config.model || 'gemini-2.5-flash';
13
17
  }
14
18
  getName() {
15
- return `Gemini (${this.config.model})`;
19
+ return `Gemini (${this.model})`;
20
+ }
21
+ /**
22
+ * Try to read OAuth token from Gemini CLI installation.
23
+ */
24
+ static readOAuthToken() {
25
+ try {
26
+ const credsPath = path.join(os.homedir(), '.gemini', 'oauth_creds.json');
27
+ if (!fs.existsSync(credsPath))
28
+ return null;
29
+ const creds = JSON.parse(fs.readFileSync(credsPath, 'utf-8'));
30
+ if (creds.access_token && typeof creds.access_token === 'string') {
31
+ return creds.access_token;
32
+ }
33
+ }
34
+ catch {
35
+ // ignore
36
+ }
37
+ return null;
38
+ }
39
+ /**
40
+ * Check if Gemini CLI is installed and authenticated.
41
+ */
42
+ static isAvailable() {
43
+ return GeminiAdapter.readOAuthToken() !== null;
44
+ }
45
+ setOAuthToken(token) {
46
+ this.oauthToken = token;
16
47
  }
17
48
  async generate(prompt) {
18
- if (!this.config.apiKey) {
19
- throw new Error('API Key de Google AI no configurada.');
49
+ const baseUrl = `https://generativelanguage.googleapis.com/v1beta/models/${this.model}:generateContent`;
50
+ let url;
51
+ let headers;
52
+ if (this.oauthToken) {
53
+ // Use OAuth token from Gemini CLI
54
+ url = baseUrl;
55
+ headers = {
56
+ 'Content-Type': 'application/json',
57
+ 'Authorization': `Bearer ${this.oauthToken}`,
58
+ };
59
+ }
60
+ else if (this.apiKey) {
61
+ // Use API key
62
+ url = `${baseUrl}?key=${this.apiKey}`;
63
+ headers = { 'Content-Type': 'application/json' };
64
+ }
65
+ else {
66
+ throw new Error('No hay credenciales de Gemini configuradas.');
20
67
  }
21
- const url = `${this.config.baseUrl}/${this.config.model}:generateContent?key=${this.config.apiKey}`;
22
68
  const response = await axios.post(url, {
23
69
  contents: [{ parts: [{ text: prompt }] }],
24
70
  generationConfig: { maxOutputTokens: 8096 },
25
- }, {
26
- headers: { 'Content-Type': 'application/json' },
27
- timeout: 120000,
28
- });
29
- return response.data.candidates[0].content.parts[0].text;
71
+ }, { headers, timeout: 120000 });
72
+ const text = response.data?.candidates?.[0]?.content?.parts?.[0]?.text;
73
+ if (!text) {
74
+ throw new Error('Gemini respondio pero sin contenido. Intenta de nuevo.');
75
+ }
76
+ return text;
30
77
  }
31
78
  }
@@ -1,18 +1,37 @@
1
1
  import { IAIProvider } from './provider.js';
2
- export type ProviderName = 'claude' | 'openai' | 'gemini' | 'deepseek' | 'groq' | 'ollama';
2
+ export type ProviderName = 'claude' | 'gemini';
3
3
  export interface ICCODEConfig {
4
4
  provider: ProviderName;
5
5
  apiKey?: string;
6
6
  model?: string;
7
- baseUrl?: string;
7
+ authType?: 'api-key' | 'oauth';
8
8
  }
9
- /**
10
- * Gestiona la configuración y conexión con proveedores de IA.
11
- */
9
+ export declare const PROVIDER_INFO: Record<ProviderName, {
10
+ name: string;
11
+ keyUrl: string;
12
+ envVars: string[];
13
+ models: Array<{
14
+ name: string;
15
+ value: string;
16
+ }>;
17
+ }>;
12
18
  export declare class AIManager {
13
19
  private static readonly CONFIG_FILE;
14
20
  static loadConfig(): Promise<ICCODEConfig | null>;
15
21
  static saveConfig(config: ICCODEConfig): Promise<void>;
16
22
  static getProvider(config: ICCODEConfig): IAIProvider;
17
- static testConnection(config: ICCODEConfig): Promise<boolean>;
23
+ static testConnection(config: ICCODEConfig): Promise<{
24
+ ok: boolean;
25
+ error?: string;
26
+ }>;
27
+ /**
28
+ * Auto-detect the best available provider.
29
+ * Priority: 1) Gemini CLI OAuth, 2) env vars, 3) null
30
+ */
31
+ static autoDetect(): {
32
+ provider: ProviderName;
33
+ authType: 'oauth' | 'api-key';
34
+ apiKey?: string;
35
+ source: string;
36
+ } | null;
18
37
  }