@emaxe/agento 0.1.2 → 0.3.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.
Files changed (46) hide show
  1. package/AGENTS.md +341 -0
  2. package/CHANGELOG.md +117 -0
  3. package/README.md +168 -31
  4. package/README.ru.md +427 -0
  5. package/dist/src/adapters/base.d.ts +3 -1
  6. package/dist/src/adapters/base.d.ts.map +1 -1
  7. package/dist/src/adapters/claude-code.d.ts +1 -0
  8. package/dist/src/adapters/claude-code.d.ts.map +1 -1
  9. package/dist/src/adapters/claude-code.js +20 -2
  10. package/dist/src/adapters/claude-code.js.map +1 -1
  11. package/dist/src/adapters/codex.d.ts +1 -1
  12. package/dist/src/adapters/codex.d.ts.map +1 -1
  13. package/dist/src/adapters/codex.js +6 -2
  14. package/dist/src/adapters/codex.js.map +1 -1
  15. package/dist/src/adapters/opencode.d.ts +1 -0
  16. package/dist/src/adapters/opencode.d.ts.map +1 -1
  17. package/dist/src/adapters/opencode.js +50 -1
  18. package/dist/src/adapters/opencode.js.map +1 -1
  19. package/dist/src/adapters/qwen.d.ts +1 -0
  20. package/dist/src/adapters/qwen.d.ts.map +1 -1
  21. package/dist/src/adapters/qwen.js +12 -4
  22. package/dist/src/adapters/qwen.js.map +1 -1
  23. package/dist/src/cli/commands/launch.d.ts.map +1 -1
  24. package/dist/src/cli/commands/launch.js +13 -0
  25. package/dist/src/cli/commands/launch.js.map +1 -1
  26. package/dist/src/cli/commands/provider.d.ts.map +1 -1
  27. package/dist/src/cli/commands/provider.js +7 -3
  28. package/dist/src/cli/commands/provider.js.map +1 -1
  29. package/dist/src/config/schema.d.ts +177 -29
  30. package/dist/src/config/schema.d.ts.map +1 -1
  31. package/dist/src/config/schema.js +18 -2
  32. package/dist/src/config/schema.js.map +1 -1
  33. package/dist/src/config/store.d.ts.map +1 -1
  34. package/dist/src/config/store.js +25 -1
  35. package/dist/src/config/store.js.map +1 -1
  36. package/dist/src/tui/screens/LaunchAgent.d.ts.map +1 -1
  37. package/dist/src/tui/screens/LaunchAgent.js +21 -4
  38. package/dist/src/tui/screens/LaunchAgent.js.map +1 -1
  39. package/dist/src/tui/screens/MainMenu.js +1 -1
  40. package/dist/src/tui/screens/Profiles.d.ts.map +1 -1
  41. package/dist/src/tui/screens/Profiles.js +5 -4
  42. package/dist/src/tui/screens/Profiles.js.map +1 -1
  43. package/dist/src/tui/screens/Providers.d.ts.map +1 -1
  44. package/dist/src/tui/screens/Providers.js +39 -20
  45. package/dist/src/tui/screens/Providers.js.map +1 -1
  46. package/package.json +4 -2
package/README.md CHANGED
@@ -7,14 +7,16 @@
7
7
 
8
8
  AgentO is a CLI tool that centralizes configuration management for popular AI coding agents. Define your API providers once, create profiles with different model combinations, and switch between them with a single command.
9
9
 
10
+ **Русская версия:** [README.ru.md](README.ru.md)
11
+
10
12
  ## Supported Agents
11
13
 
12
- | Agent | Command | Config Format | Special Features |
13
- |-------|---------|---------------|------------------|
14
- | [Claude Code](https://github.com/anthropics/claude-code) | `claude` | JSON | Multi-tier support (small/base/smart) |
15
- | [OpenCode](https://github.com/opencode-ai/opencode) | `opencode` | JSON | Custom provider prefix |
16
- | [Qwen CLI](https://github.com/QwenLM/qwen) | `qwen` | JSON | OpenAI-compatible providers |
17
- | [Codex CLI](https://github.com/openai/codex) | `codex` | TOML | Environment variable injection. Hidden by default (`--dev` to show). |
14
+ | Agent | Command | Config Format | Supported Providers | Special Features |
15
+ |-------|---------|---------------|---|------------------|
16
+ | [Claude Code](https://github.com/anthropics/claude-code) | `claude` | JSON | `anthropic`, `fireworks`, `openrouter` | Multi-tier support (small/base/smart) |
17
+ | [OpenCode](https://github.com/opencode-ai/opencode) | `opencode` | JSON | `anthropic`, `openai-compatible`, `fireworks`, `openrouter` | Full function calling support via Vercel AI SDK |
18
+ | [Qwen CLI](https://github.com/QwenLM/qwen) | `qwen` | JSON | `openai-compatible`, `fireworks`, `openrouter` | OpenAI-compatible API structure |
19
+ | [Codex CLI](https://github.com/openai/codex) | `codex` | TOML | `fireworks`, `openrouter` | Environment variable injection. `wire_api: responses`. |
18
20
 
19
21
  ## Installation
20
22
 
@@ -36,25 +38,74 @@ npx @emaxe/agento
36
38
  - Node.js ≥ 18
37
39
  - One or more supported AI agent CLI tools installed
38
40
 
41
+ ## Supported Provider Types
42
+
43
+ | Provider Type | Compatible Agents | Examples |
44
+ |---|---|---|
45
+ | `anthropic` | claude-code, opencode | Anthropic |
46
+ | `openai-compatible` | opencode, qwen | OpenAI, Together.ai, Cerebras, Perplexity, DeepSeek, etc. |
47
+ | `fireworks` | claude-code, opencode, qwen, codex | Fireworks AI (supports all 3 API types) |
48
+ | `openrouter` | claude-code, opencode, qwen, codex | [OpenRouter](https://openrouter.ai) — universal LLM gateway (Anthropic Skin / OpenAI / Responses API) |
49
+
50
+ **Notes:**
51
+ - `claude-code` works with `anthropic`, `fireworks`, and `openrouter` types. For `openrouter` it uses OpenRouter's **Anthropic Skin** with `ANTHROPIC_AUTH_TOKEN` (Bearer auth).
52
+ - Use `opencode` or `qwen` for general OpenAI-compatible providers.
53
+ - `openrouter` is the most flexible — works with all 4 agents.
54
+
55
+ ## Model Capability Flags
56
+
57
+ Every model in a provider carries three capability flags that describe which modalities it supports:
58
+
59
+ - **`image`** — model can process image inputs
60
+ - **`video`** — model can process video inputs
61
+ - **`audio`** — model can process audio inputs
62
+
63
+ Defaults when adding a model: `image=true`, `video=false`, `audio=false`.
64
+
65
+ **Marker format:** in the TUI and `agento provider list`, capabilities render as `[iva]` (all on), `[i--]` (image only), `[---]` (text only), etc. The marker is informational and is **never** written into the launched agent's config.
66
+
67
+ **Why it matters:**
68
+ - **Qwen** receives `generationConfig.modalities` derived from these flags (previously hardcoded to `false` — images didn't work).
69
+ - **OpenCode** emits per-model `modalities: { input: ["text", "image", ...], output: ["text"] }` so the agent knows what the model accepts.
70
+ - **Claude Code** and **Codex** ignore these flags today (Anthropic SDK and Codex `responses` API don't expose modality config).
71
+
72
+ **Toggling capabilities:** open the TUI → Providers → Edit, navigate to a model row, press `i` / `v` / `a` to toggle each flag. Add new models via the `[+ add model]` row (Enter). The CLI `provider add -M ...` creates models with default capabilities.
73
+
74
+ > Existing configs from older versions (with `string[]` models) are auto-migrated on first read with default capabilities.
75
+
39
76
  ## Quick Start
40
77
 
41
- ### 1. Add an API Provider
78
+ ### 1. Add API Providers
42
79
 
43
80
  ```bash
44
- # OpenAI-compatible provider (e.g., Fireworks AI)
45
- agento provider add \
46
- -n "Fireworks AI" \
47
- -t openai-compatible \
48
- -k "sk-your-api-key" \
49
- -u "https://api.fireworks.ai/inference/v1" \
50
- -M "accounts/fireworks/models/llama-v3p1-70b-instruct,accounts/fireworks/models/kimi-k2p6"
51
-
52
81
  # Anthropic provider
53
82
  agento provider add \
54
83
  -n "Anthropic" \
55
84
  -t anthropic \
56
85
  -k "sk-ant-your-key" \
57
86
  -M "claude-sonnet-4-20250514,claude-3-5-haiku-20241022"
87
+
88
+ # Fireworks AI provider (works with all agents)
89
+ agento provider add \
90
+ -n "Fireworks" \
91
+ -t fireworks \
92
+ -k "fw-your-key" \
93
+ -M "accounts/fireworks/models/llama-v3p1-70b-instruct,accounts/fireworks/models/kimi-k2p6"
94
+
95
+ # Other OpenAI-compatible providers (use with opencode or qwen)
96
+ agento provider add \
97
+ -n "Together" \
98
+ -t openai-compatible \
99
+ -k "your-api-key" \
100
+ -u "https://api.together.xyz/v1" \
101
+ -M "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo"
102
+
103
+ # OpenRouter (universal gateway — works with all 4 agents)
104
+ agento provider add \
105
+ -n "OpenRouter" \
106
+ -t openrouter \
107
+ -k "sk-or-v1-your-key" \
108
+ -M "anthropic/claude-sonnet-4.6,openai/gpt-5,google/gemini-2.5-pro"
58
109
  ```
59
110
 
60
111
  ### 2. Create a Profile
@@ -73,9 +124,12 @@ agento profile add -n "multi" -m "provider-id:claude-3-5-haiku-20241022:small,pr
73
124
  # Interactive TUI mode (default)
74
125
  agento
75
126
 
76
- # Direct launch
127
+ # Direct launch with Anthropic/Fireworks provider
77
128
  agento launch -p default -a claude-code
78
129
 
130
+ # Launch with OpenAI-compatible provider (use opencode or qwen)
131
+ agento launch -p openai-profile -a opencode
132
+
79
133
  # Launch with specific mode and scope
80
134
  agento launch -p default -a qwen -m child -s project
81
135
  ```
@@ -87,7 +141,7 @@ Running `agento` without arguments launches an interactive Terminal User Interfa
87
141
  ### Main Menu
88
142
 
89
143
  ```
90
- ┌────────── AgentO v0.1.1 ──────────┐
144
+ ┌────────── AgentO v0.2.0 ──────────┐
91
145
  │ │
92
146
  │ ▶ Launch Agent │
93
147
  │ Providers │
@@ -105,7 +159,7 @@ Running `agento` without arguments launches an interactive Terminal User Interfa
105
159
  | Screen | What You Can Do | Key Shortcuts |
106
160
  |--------|----------------|---------------|
107
161
  | **Launch Agent** | Select profile → select agent → choose mode/scope → launch | **Enter** select, **Esc** back |
108
- | **Providers** | View, add, edit, delete API providers | **Enter** details, **a** add, **e** edit, **d** delete, **Esc** back |
162
+ | **Providers** | View, add, edit, delete API providers; toggle model capabilities | **Enter** details / add model, **a** add provider, **e** edit, **d** delete, **i/v/a** toggle capability, **Esc** back |
109
163
  | **Profiles** | View, add, delete profiles. In profile details: add/remove/edit models | **Enter** details, **a** add, **d** delete, **Esc** back |
110
164
  | **Agents** | Check config status (global/project), backup availability | **Enter** details, **Esc** back |
111
165
  | **Settings** | Change default launch mode, default config scope, independent mode | **↑↓** change, **Enter** toggle, **Esc** save & back |
@@ -113,7 +167,7 @@ Running `agento` without arguments launches an interactive Terminal User Interfa
113
167
  ### Launch Agent Workflow
114
168
 
115
169
  1. **Select Profile** — Choose from your saved profiles
116
- 2. **Select Agent** — Pick which agent to launch (claude-code, opencode, qwen, or codex with `--dev`)
170
+ 2. **Select Agent** — Pick which agent to launch (claude-code, opencode, qwen, or codex)
117
171
  3. **Optional:** Adjust **Mode** (child/independent) and **Scope** (global/project)
118
172
  4. **Launch** — AgentO patches the agent config and starts the agent
119
173
 
@@ -133,11 +187,13 @@ In **independent mode**, AgentO exits immediately and leaves the patched config
133
187
 
134
188
  Manage your API providers without memorizing CLI flags:
135
189
 
136
- - **View** all providers with their type, models count, and base URL
190
+ - **View** all providers with their type, models, capability markers, and base URL
137
191
  - **Add** a new provider with guided prompts (name, type, API key, models, base URL)
138
- - **Edit** existing provider details
192
+ - **Edit** existing provider details — including per-model capability flags (`i`/`v`/`a` toggles)
139
193
  - **Delete** providers you no longer need
140
194
 
195
+ In edit view, models render as `▶ [i--] model-name`. Press `i` / `v` / `a` while a model row is highlighted to toggle image / video / audio capabilities. Use the `[+ add model]` row (Enter) to append models, `d` to delete, `e` to rename.
196
+
141
197
  ### Profiles Screen
142
198
 
143
199
  Organize your model configurations:
@@ -178,6 +234,21 @@ Configure defaults for AgentO behavior:
178
234
 
179
235
  Use **TUI** for exploration and interactive workflows. Use **CLI** for scripting, aliases, and quick launches.
180
236
 
237
+ ## Provider & Agent Compatibility Matrix
238
+
239
+ | Provider Type | claude-code | opencode | qwen | codex |
240
+ |---|---|---|---|---|
241
+ | **anthropic** | ✅ Full support | ✅ (via SDK) | ❌ Not supported | ❌ Not supported |
242
+ | **openai-compatible** | ❌ Not supported | ✅ Full support | ✅ Full support | ❌ Not supported |
243
+ | **fireworks** | ✅ (Anthropic API) | ✅ (OpenAI API) | ✅ (OpenAI API) | ✅ (Responses API) |
244
+ | **openrouter** | ✅ (Anthropic Skin) | ✅ (OpenAI API) | ✅ (OpenAI API) | ✅ (Responses API) |
245
+
246
+ **Key Constraints:**
247
+ - `claude-code` uses Anthropic-compatible APIs and works with `anthropic`, `fireworks`, `openrouter` types
248
+ - For `openrouter` Claude Code uses `ANTHROPIC_AUTH_TOKEN` (Bearer) — not `apiKeyHelper`
249
+ - Other OpenAI-compatible providers must use `opencode` or `qwen` agents
250
+ - `fireworks` and `openrouter` are the most flexible — work with all 4 agents
251
+
181
252
  ## CLI Reference
182
253
 
183
254
  ### `agento` — Main Command
@@ -218,13 +289,19 @@ Options:
218
289
  agento provider list # List all providers
219
290
  agento provider add [options] # Add a new provider
220
291
  -n, --name <name> Provider display name (required)
221
- -t, --type <type> Provider type: openai-compatible or anthropic (required)
292
+ -t, --type <type> Provider type: anthropic, openai-compatible, fireworks, or openrouter (required)
222
293
  -k, --api-key <key> API key (required)
223
- -u, --base-url <url> Base URL (for openai-compatible)
294
+ -u, --base-url <url> Base URL (required for openai-compatible, optional for others)
224
295
  -M, --models <models> Comma-separated list of model names (required)
225
296
  agento provider remove <name> # Remove a provider
226
297
  ```
227
298
 
299
+ **Base URL Defaults:**
300
+ - `anthropic`: Uses Anthropic's default endpoint
301
+ - `fireworks`: Auto-defaults to `https://api.fireworks.ai/inference` if not specified
302
+ - `openrouter`: Auto-defaults to `https://openrouter.ai/api/v1` (Claude Code: `https://openrouter.ai/api`) if not specified
303
+ - `openai-compatible`: Must be explicitly provided with `-u`
304
+
228
305
  ### `agento profile` — Manage Profiles
229
306
 
230
307
  ```bash
@@ -263,11 +340,32 @@ AgentO stores its configuration in `~/.agento/config.json`:
263
340
  "providers": [
264
341
  {
265
342
  "id": "uuid",
266
- "name": "Fireworks AI",
343
+ "name": "Anthropic",
344
+ "type": "anthropic",
345
+ "apiKey": "sk-ant-...",
346
+ "models": [
347
+ { "name": "claude-opus-4-20250514", "capabilities": { "image": true, "video": false, "audio": false } },
348
+ { "name": "claude-sonnet-4-20250514", "capabilities": { "image": true, "video": false, "audio": false } }
349
+ ]
350
+ },
351
+ {
352
+ "id": "uuid",
353
+ "name": "Fireworks",
354
+ "type": "fireworks",
355
+ "apiKey": "fw-...",
356
+ "models": [
357
+ { "name": "accounts/fireworks/models/llama-v3p1-70b-instruct", "capabilities": { "image": false, "video": false, "audio": false } }
358
+ ]
359
+ },
360
+ {
361
+ "id": "uuid",
362
+ "name": "Together",
267
363
  "type": "openai-compatible",
268
- "apiKey": "sk-...",
269
- "baseUrl": "https://api.fireworks.ai/inference/v1",
270
- "models": ["accounts/fireworks/models/llama-v3p1-70b-instruct"]
364
+ "apiKey": "your-api-key",
365
+ "baseUrl": "https://api.together.xyz/v1",
366
+ "models": [
367
+ { "name": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo", "capabilities": { "image": false, "video": false, "audio": false } }
368
+ ]
271
369
  }
272
370
  ],
273
371
  "profiles": [
@@ -291,16 +389,24 @@ AgentO stores its configuration in `~/.agento/config.json`:
291
389
  }
292
390
  ```
293
391
 
392
+ > Configs created with AgentO < 0.2.0 use bare `string[]` for `models`. They are migrated automatically on read; capabilities default to `{ image: true, video: false, audio: false }` and can be adjusted in the TUI.
393
+
294
394
  ## How It Works
295
395
 
296
396
  ### Agent Adapters
297
397
 
298
398
  Each supported agent has a dedicated adapter that translates AgentO's generic config format into the agent's specific configuration:
299
399
 
300
- - **Claude Code**: Generates `~/.claude/settings.json` with tier-based model selection
301
- - **OpenCode**: Generates `~/.config/opencode/config.json` with provider-prefixed model names
302
- - **Qwen CLI**: Generates `~/.qwen/settings.json` with OpenAI-compatible provider structure
303
- - **Codex CLI** (`--dev` to show): Generates `~/.codex/config.toml` with `wire_api: responses`, profiles, and environment variable references. In project scope, splits config between global (`model_providers`) and project (`model`) configs.
400
+ - **Claude Code** (supports `anthropic`, `fireworks`, `openrouter`): Generates `~/.claude/settings.json` with tier-based model selection and ANTHROPIC_* env vars. Uses Anthropic SDK.
401
+ - For `openrouter`: uses OpenRouter's **Anthropic Skin** — sets `ANTHROPIC_AUTH_TOKEN` (Bearer) + empty `ANTHROPIC_API_KEY`, no `apiKeyHelper`. Base URL: `https://openrouter.ai/api`
402
+ - ⚠️ **Does NOT support** `openai-compatible` providers (Anthropic SDK incompatibility)
403
+ - Capability flags are not propagated (Anthropic SDK doesn't expose modality config)
404
+
405
+ - **OpenCode** (supports `anthropic`, `openai-compatible`, `fireworks`): Generates `~/.config/opencode/config.json` using Vercel AI SDK with provider-prefixed model names. Full function calling support via `@ai-sdk/openai-compatible`. Emits per-model `modalities: { input: [...], output: ["text"] }` derived from capability flags.
406
+
407
+ - **Qwen CLI** (supports `openai-compatible`, `fireworks`): Generates `~/.qwen/settings.json` with OpenAI-compatible provider structure. Requires `baseUrl` for all providers. Auto-defaults for `fireworks` type. Passes capability flags via `generationConfig.modalities`.
408
+
409
+ - **Codex CLI** (`--dev` to show): Generates `~/.codex/config.toml` with `wire_api: responses`, profiles, and environment variable references. In project scope, splits config between global (`model_providers`) and project (`model`) configs. Supports all provider types. Capability flags are not propagated (Codex `responses` API has no modality config).
304
410
 
305
411
  ### Backup & Restore
306
412
 
@@ -345,6 +451,37 @@ src/
345
451
  └── tui/ # Terminal UI (Ink + React)
346
452
  ```
347
453
 
454
+ ## Limitations & Known Issues
455
+
456
+ ### Claude Code with OpenAI-Compatible Providers
457
+
458
+ **Problem:** Claude Code only works with Anthropic API due to hard dependency on Anthropic SDK.
459
+
460
+ **Solution:** Use `opencode` or `qwen` agents instead:
461
+ ```bash
462
+ # ❌ This won't work:
463
+ agento launch -p myprofile -a claude-code # (if profile uses openai-compatible provider)
464
+
465
+ # ✅ Use OpenCode instead:
466
+ agento launch -p myprofile -a opencode
467
+ ```
468
+
469
+ ### Qwen CLI with Missing Base URL
470
+
471
+ **Problem:** Qwen requires `baseUrl` for all providers. Using `anthropic` type without URL will error.
472
+
473
+ **Solution:** Always provide `-u` for Qwen with non-standard providers, or use `fireworks` type which auto-defaults.
474
+
475
+ ### Codex CLI Hidden by Default
476
+
477
+ **Problem:** Codex is a development agent and hidden in TUI/CLI by default.
478
+
479
+ **Solution:** Add `--dev` flag to show it:
480
+ ```bash
481
+ agento --dev # TUI with Codex
482
+ agento launch -a codex --dev # CLI with Codex
483
+ ```
484
+
348
485
  ## Troubleshooting
349
486
 
350
487
  ### Changes in `src/` not applied