@emaxe/agento 0.1.1 → 0.2.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 +340 -0
  2. package/CHANGELOG.md +102 -0
  3. package/README.md +231 -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 +5 -2
  10. package/dist/src/adapters/claude-code.js.map +1 -1
  11. package/dist/src/adapters/codex.d.ts +1 -0
  12. package/dist/src/adapters/codex.d.ts.map +1 -1
  13. package/dist/src/adapters/codex.js +3 -1
  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 +30 -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 +9 -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 +176 -29
  30. package/dist/src/config/schema.d.ts.map +1 -1
  31. package/dist/src/config/schema.js +17 -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 +40 -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` | Multi-tier support (small/base/smart) |
17
+ | [OpenCode](https://github.com/opencode-ai/opencode) | `opencode` | JSON | `anthropic`, `openai-compatible`, `fireworks` | Full function calling support via Vercel AI SDK |
18
+ | [Qwen CLI](https://github.com/QwenLM/qwen) | `qwen` | JSON | `openai-compatible`, `fireworks` | OpenAI-compatible API structure |
19
+ | [Codex CLI](https://github.com/openai/codex) | `codex` | TOML | All types | Environment variable injection. Hidden by default (`--dev` to show). |
18
20
 
19
21
  ## Installation
20
22
 
@@ -36,25 +38,63 @@ 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 | 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
+
49
+ **Note:** `claude-code` only works with `anthropic` and `fireworks` types (Anthropic SDK requirement). Use `opencode` or `qwen` for other OpenAI-compatible providers.
50
+
51
+ ## Model Capability Flags
52
+
53
+ Every model in a provider carries three capability flags that describe which modalities it supports:
54
+
55
+ - **`image`** — model can process image inputs
56
+ - **`video`** — model can process video inputs
57
+ - **`audio`** — model can process audio inputs
58
+
59
+ Defaults when adding a model: `image=true`, `video=false`, `audio=false`.
60
+
61
+ **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.
62
+
63
+ **Why it matters:**
64
+ - **Qwen** receives `generationConfig.modalities` derived from these flags (previously hardcoded to `false` — images didn't work).
65
+ - **OpenCode** emits per-model `modalities: { input: ["text", "image", ...], output: ["text"] }` so the agent knows what the model accepts.
66
+ - **Claude Code** and **Codex** ignore these flags today (Anthropic SDK and Codex `responses` API don't expose modality config).
67
+
68
+ **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.
69
+
70
+ > Existing configs from older versions (with `string[]` models) are auto-migrated on first read with default capabilities.
71
+
39
72
  ## Quick Start
40
73
 
41
- ### 1. Add an API Provider
74
+ ### 1. Add API Providers
42
75
 
43
76
  ```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
77
  # Anthropic provider
53
78
  agento provider add \
54
79
  -n "Anthropic" \
55
80
  -t anthropic \
56
81
  -k "sk-ant-your-key" \
57
82
  -M "claude-sonnet-4-20250514,claude-3-5-haiku-20241022"
83
+
84
+ # Fireworks AI provider (works with all agents)
85
+ agento provider add \
86
+ -n "Fireworks" \
87
+ -t fireworks \
88
+ -k "fw-your-key" \
89
+ -M "accounts/fireworks/models/llama-v3p1-70b-instruct,accounts/fireworks/models/kimi-k2p6"
90
+
91
+ # Other OpenAI-compatible providers (use with opencode or qwen)
92
+ agento provider add \
93
+ -n "Together" \
94
+ -t openai-compatible \
95
+ -k "your-api-key" \
96
+ -u "https://api.together.xyz/v1" \
97
+ -M "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo"
58
98
  ```
59
99
 
60
100
  ### 2. Create a Profile
@@ -73,19 +113,24 @@ agento profile add -n "multi" -m "provider-id:claude-3-5-haiku-20241022:small,pr
73
113
  # Interactive TUI mode (default)
74
114
  agento
75
115
 
76
- # Direct launch
116
+ # Direct launch with Anthropic/Fireworks provider
77
117
  agento launch -p default -a claude-code
78
118
 
119
+ # Launch with OpenAI-compatible provider (use opencode or qwen)
120
+ agento launch -p openai-profile -a opencode
121
+
79
122
  # Launch with specific mode and scope
80
123
  agento launch -p default -a qwen -m child -s project
81
124
  ```
82
125
 
83
126
  ## Interactive TUI
84
127
 
85
- Running `agento` without arguments launches an interactive Terminal User Interface:
128
+ Running `agento` without arguments launches an interactive Terminal User Interface built with [Ink](https://github.com/vadimdemedes/ink) and React.
129
+
130
+ ### Main Menu
86
131
 
87
132
  ```
88
- ┌────────── AgentO v0.1.0 ──────────┐
133
+ ┌────────── AgentO v0.2.0 ──────────┐
89
134
  │ │
90
135
  │ ▶ Launch Agent │
91
136
  │ Providers │
@@ -96,9 +141,100 @@ Running `agento` without arguments launches an interactive Terminal User Interfa
96
141
  └───────────────────────────────────┘
97
142
  ```
98
143
 
99
- - **↑↓** Navigate
100
- - **Enter** Select
101
- - **Esc / q** Back/Quit
144
+ **Navigation:** **↑↓** to move, **Enter** to select, **Esc / q** to quit.
145
+
146
+ ### Screens Overview
147
+
148
+ | Screen | What You Can Do | Key Shortcuts |
149
+ |--------|----------------|---------------|
150
+ | **Launch Agent** | Select profile → select agent → choose mode/scope → launch | **Enter** select, **Esc** back |
151
+ | **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 |
152
+ | **Profiles** | View, add, delete profiles. In profile details: add/remove/edit models | **Enter** details, **a** add, **d** delete, **Esc** back |
153
+ | **Agents** | Check config status (global/project), backup availability | **Enter** details, **Esc** back |
154
+ | **Settings** | Change default launch mode, default config scope, independent mode | **↑↓** change, **Enter** toggle, **Esc** save & back |
155
+
156
+ ### Launch Agent Workflow
157
+
158
+ 1. **Select Profile** — Choose from your saved profiles
159
+ 2. **Select Agent** — Pick which agent to launch (claude-code, opencode, qwen, or codex with `--dev`)
160
+ 3. **Optional:** Adjust **Mode** (child/independent) and **Scope** (global/project)
161
+ 4. **Launch** — AgentO patches the agent config and starts the agent
162
+
163
+ ```
164
+ Profile: default
165
+ ├─ Agent: claude-code
166
+ ├─ Mode: child
167
+ ├─ Scope: global
168
+ └─ [ Launch ]
169
+ ```
170
+
171
+ In **child mode**, you'll be returned to AgentO when the agent exits, and the original config is automatically restored.
172
+
173
+ In **independent mode**, AgentO exits immediately and leaves the patched config in place.
174
+
175
+ ### Providers Screen
176
+
177
+ Manage your API providers without memorizing CLI flags:
178
+
179
+ - **View** all providers with their type, models, capability markers, and base URL
180
+ - **Add** a new provider with guided prompts (name, type, API key, models, base URL)
181
+ - **Edit** existing provider details — including per-model capability flags (`i`/`v`/`a` toggles)
182
+ - **Delete** providers you no longer need
183
+
184
+ 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.
185
+
186
+ ### Profiles Screen
187
+
188
+ Organize your model configurations:
189
+
190
+ - **View** all profiles with their models and tiers
191
+ - **Add** profiles with single or multi-tier model configurations
192
+ - **In profile details:** add/remove/edit individual model assignments
193
+
194
+ ### Agents Screen
195
+
196
+ Monitor the status of your agent configurations:
197
+
198
+ - See if each agent has a **global** or **project** config
199
+ - Check if **backups** exist (indicating AgentO has previously patched the config)
200
+ - View config file paths for each agent
201
+
202
+ ### Settings Screen
203
+
204
+ Configure defaults for AgentO behavior:
205
+
206
+ | Setting | Options | Description |
207
+ |---------|---------|-------------|
208
+ | **Default Launch Mode** | `child` / `independent` | How agents are launched by default |
209
+ | **Default Config Scope** | `global` / `project` | Where agent configs are written |
210
+ | **Independent Mode** | `spawn-detached` / `pty` | How independent mode spawns agents |
211
+
212
+ **Controls:** **↑↓** navigate between settings, **Enter** or **Space** toggle values, **Esc** save and return.
213
+
214
+ ### TUI vs CLI
215
+
216
+ | Task | TUI | CLI |
217
+ |------|-----|-----|
218
+ | Explore providers visually | ✅ | — |
219
+ | Quick one-off launch | — | `agento launch -p <p> -a <a>` |
220
+ | Script automation | — | ✅ |
221
+ | Check agent config status | ✅ | `agento agent status` |
222
+ | Guided provider/profile creation | ✅ | Manual flag composition |
223
+
224
+ Use **TUI** for exploration and interactive workflows. Use **CLI** for scripting, aliases, and quick launches.
225
+
226
+ ## Provider & Agent Compatibility Matrix
227
+
228
+ | Provider Type | claude-code | opencode | qwen | codex |
229
+ |---|---|---|---|---|
230
+ | **anthropic** | ✅ Full support | ✅ (via SDK) | ❌ Not supported | ✅ (via Responses API) |
231
+ | **openai-compatible** | ❌ Not supported | ✅ Full support | ✅ Full support | ✅ (via Responses API) |
232
+ | **fireworks** | ✅ (Anthropic API) | ✅ (OpenAI API) | ✅ (OpenAI API) | ✅ (Responses API) |
233
+
234
+ **Key Constraints:**
235
+ - `claude-code` uses **Anthropic SDK** and only works with `anthropic` or `fireworks` types
236
+ - Other OpenAI-compatible providers must use `opencode` or `qwen` agents
237
+ - `fireworks` type is the most flexible — works with all agents through native Fireworks APIs
102
238
 
103
239
  ## CLI Reference
104
240
 
@@ -140,13 +276,18 @@ Options:
140
276
  agento provider list # List all providers
141
277
  agento provider add [options] # Add a new provider
142
278
  -n, --name <name> Provider display name (required)
143
- -t, --type <type> Provider type: openai-compatible or anthropic (required)
279
+ -t, --type <type> Provider type: anthropic, openai-compatible, or fireworks (required)
144
280
  -k, --api-key <key> API key (required)
145
- -u, --base-url <url> Base URL (for openai-compatible)
281
+ -u, --base-url <url> Base URL (required for openai-compatible, optional for others)
146
282
  -M, --models <models> Comma-separated list of model names (required)
147
283
  agento provider remove <name> # Remove a provider
148
284
  ```
149
285
 
286
+ **Base URL Defaults:**
287
+ - `anthropic`: Uses Anthropic's default endpoint
288
+ - `fireworks`: Auto-defaults to `https://api.fireworks.ai/inference` if not specified
289
+ - `openai-compatible`: Must be explicitly provided with `-u`
290
+
150
291
  ### `agento profile` — Manage Profiles
151
292
 
152
293
  ```bash
@@ -185,11 +326,32 @@ AgentO stores its configuration in `~/.agento/config.json`:
185
326
  "providers": [
186
327
  {
187
328
  "id": "uuid",
188
- "name": "Fireworks AI",
329
+ "name": "Anthropic",
330
+ "type": "anthropic",
331
+ "apiKey": "sk-ant-...",
332
+ "models": [
333
+ { "name": "claude-opus-4-20250514", "capabilities": { "image": true, "video": false, "audio": false } },
334
+ { "name": "claude-sonnet-4-20250514", "capabilities": { "image": true, "video": false, "audio": false } }
335
+ ]
336
+ },
337
+ {
338
+ "id": "uuid",
339
+ "name": "Fireworks",
340
+ "type": "fireworks",
341
+ "apiKey": "fw-...",
342
+ "models": [
343
+ { "name": "accounts/fireworks/models/llama-v3p1-70b-instruct", "capabilities": { "image": false, "video": false, "audio": false } }
344
+ ]
345
+ },
346
+ {
347
+ "id": "uuid",
348
+ "name": "Together",
189
349
  "type": "openai-compatible",
190
- "apiKey": "sk-...",
191
- "baseUrl": "https://api.fireworks.ai/inference/v1",
192
- "models": ["accounts/fireworks/models/llama-v3p1-70b-instruct"]
350
+ "apiKey": "your-api-key",
351
+ "baseUrl": "https://api.together.xyz/v1",
352
+ "models": [
353
+ { "name": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo", "capabilities": { "image": false, "video": false, "audio": false } }
354
+ ]
193
355
  }
194
356
  ],
195
357
  "profiles": [
@@ -213,16 +375,23 @@ AgentO stores its configuration in `~/.agento/config.json`:
213
375
  }
214
376
  ```
215
377
 
378
+ > 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.
379
+
216
380
  ## How It Works
217
381
 
218
382
  ### Agent Adapters
219
383
 
220
384
  Each supported agent has a dedicated adapter that translates AgentO's generic config format into the agent's specific configuration:
221
385
 
222
- - **Claude Code**: Generates `~/.claude/settings.json` with tier-based model selection
223
- - **OpenCode**: Generates `~/.config/opencode/config.json` with provider-prefixed model names
224
- - **Qwen CLI**: Generates `~/.qwen/settings.json` with OpenAI-compatible provider structure
225
- - **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.
386
+ - **Claude Code** (supports `anthropic`, `fireworks`): Generates `~/.claude/settings.json` with tier-based model selection and ANTHROPIC_* env vars. Uses Anthropic SDK.
387
+ - ⚠️ **Does NOT support** `openai-compatible` providers (Anthropic SDK incompatibility)
388
+ - Capability flags are not propagated (Anthropic SDK doesn't expose modality config)
389
+
390
+ - **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.
391
+
392
+ - **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`.
393
+
394
+ - **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).
226
395
 
227
396
  ### Backup & Restore
228
397
 
@@ -267,6 +436,37 @@ src/
267
436
  └── tui/ # Terminal UI (Ink + React)
268
437
  ```
269
438
 
439
+ ## Limitations & Known Issues
440
+
441
+ ### Claude Code with OpenAI-Compatible Providers
442
+
443
+ **Problem:** Claude Code only works with Anthropic API due to hard dependency on Anthropic SDK.
444
+
445
+ **Solution:** Use `opencode` or `qwen` agents instead:
446
+ ```bash
447
+ # ❌ This won't work:
448
+ agento launch -p myprofile -a claude-code # (if profile uses openai-compatible provider)
449
+
450
+ # ✅ Use OpenCode instead:
451
+ agento launch -p myprofile -a opencode
452
+ ```
453
+
454
+ ### Qwen CLI with Missing Base URL
455
+
456
+ **Problem:** Qwen requires `baseUrl` for all providers. Using `anthropic` type without URL will error.
457
+
458
+ **Solution:** Always provide `-u` for Qwen with non-standard providers, or use `fireworks` type which auto-defaults.
459
+
460
+ ### Codex CLI Hidden by Default
461
+
462
+ **Problem:** Codex is a development agent and hidden in TUI/CLI by default.
463
+
464
+ **Solution:** Add `--dev` flag to show it:
465
+ ```bash
466
+ agento --dev # TUI with Codex
467
+ agento launch -a codex --dev # CLI with Codex
468
+ ```
469
+
270
470
  ## Troubleshooting
271
471
 
272
472
  ### Changes in `src/` not applied