@emaxe/agento 0.4.0 → 0.4.2
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/AGENTS.md +28 -0
- package/CHANGELOG.md +33 -1
- package/README.md +27 -18
- package/README.ru.md +31 -19
- package/dist/bin/agento.js +34 -5
- package/dist/bin/agento.js.map +1 -1
- package/dist/src/adapters/copilot.d.ts +15 -0
- package/dist/src/adapters/copilot.d.ts.map +1 -0
- package/dist/src/adapters/copilot.js +71 -0
- package/dist/src/adapters/copilot.js.map +1 -0
- package/dist/src/adapters/goose.d.ts +28 -0
- package/dist/src/adapters/goose.d.ts.map +1 -0
- package/dist/src/adapters/goose.js +114 -0
- package/dist/src/adapters/goose.js.map +1 -0
- package/dist/src/adapters/opencode.d.ts +1 -0
- package/dist/src/adapters/opencode.d.ts.map +1 -1
- package/dist/src/adapters/opencode.js +10 -0
- package/dist/src/adapters/opencode.js.map +1 -1
- package/dist/src/cli/commands/agent.d.ts +7 -0
- package/dist/src/cli/commands/agent.d.ts.map +1 -1
- package/dist/src/cli/commands/agent.js +11 -1
- package/dist/src/cli/commands/agent.js.map +1 -1
- package/dist/src/cli/commands/launch.d.ts +7 -0
- package/dist/src/cli/commands/launch.d.ts.map +1 -1
- package/dist/src/cli/commands/launch.js +18 -5
- package/dist/src/cli/commands/launch.js.map +1 -1
- package/dist/src/cli/commands/profile.d.ts +6 -0
- package/dist/src/cli/commands/profile.d.ts.map +1 -1
- package/dist/src/cli/commands/profile.js +6 -0
- package/dist/src/cli/commands/profile.js.map +1 -1
- package/dist/src/cli/commands/provider.d.ts +6 -0
- package/dist/src/cli/commands/provider.d.ts.map +1 -1
- package/dist/src/cli/commands/provider.js +6 -0
- package/dist/src/cli/commands/provider.js.map +1 -1
- package/dist/src/cli/commands/restore.d.ts +8 -0
- package/dist/src/cli/commands/restore.d.ts.map +1 -1
- package/dist/src/cli/commands/restore.js +8 -0
- package/dist/src/cli/commands/restore.js.map +1 -1
- package/dist/src/config/schema.d.ts +1 -1
- package/dist/src/config/schema.d.ts.map +1 -1
- package/dist/src/config/schema.js +1 -1
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/config/store.d.ts +4 -0
- package/dist/src/config/store.d.ts.map +1 -1
- package/dist/src/config/store.js +18 -0
- package/dist/src/config/store.js.map +1 -1
- package/dist/src/installers/claude-code.d.ts +4 -0
- package/dist/src/installers/claude-code.d.ts.map +1 -1
- package/dist/src/installers/claude-code.js +4 -0
- package/dist/src/installers/claude-code.js.map +1 -1
- package/dist/src/installers/codex.d.ts +4 -0
- package/dist/src/installers/codex.d.ts.map +1 -1
- package/dist/src/installers/codex.js +4 -0
- package/dist/src/installers/codex.js.map +1 -1
- package/dist/src/installers/copilot.d.ts +19 -0
- package/dist/src/installers/copilot.d.ts.map +1 -0
- package/dist/src/installers/copilot.js +55 -0
- package/dist/src/installers/copilot.js.map +1 -0
- package/dist/src/installers/goose.d.ts +19 -0
- package/dist/src/installers/goose.d.ts.map +1 -0
- package/dist/src/installers/goose.js +55 -0
- package/dist/src/installers/goose.js.map +1 -0
- package/dist/src/installers/opencode.d.ts +4 -0
- package/dist/src/installers/opencode.d.ts.map +1 -1
- package/dist/src/installers/opencode.js +4 -0
- package/dist/src/installers/opencode.js.map +1 -1
- package/dist/src/installers/qwen.d.ts +4 -0
- package/dist/src/installers/qwen.d.ts.map +1 -1
- package/dist/src/installers/qwen.js +4 -0
- package/dist/src/installers/qwen.js.map +1 -1
- package/dist/src/installers/registry.d.ts +7 -0
- package/dist/src/installers/registry.d.ts.map +1 -1
- package/dist/src/installers/registry.js +6 -0
- package/dist/src/installers/registry.js.map +1 -1
- package/dist/src/launcher/child.js +1 -1
- package/dist/src/launcher/child.js.map +1 -1
- package/dist/src/launcher/independent.d.ts +16 -3
- package/dist/src/launcher/independent.d.ts.map +1 -1
- package/dist/src/launcher/independent.js +12 -3
- package/dist/src/launcher/independent.js.map +1 -1
- package/dist/src/profiles/profile-manager.d.ts +26 -7
- package/dist/src/profiles/profile-manager.d.ts.map +1 -1
- package/dist/src/profiles/profile-manager.js +26 -7
- package/dist/src/profiles/profile-manager.js.map +1 -1
- package/dist/src/providers/provider-manager.d.ts +18 -5
- package/dist/src/providers/provider-manager.d.ts.map +1 -1
- package/dist/src/providers/provider-manager.js +25 -5
- package/dist/src/providers/provider-manager.js.map +1 -1
- package/dist/src/tui/App.d.ts +12 -1
- package/dist/src/tui/App.d.ts.map +1 -1
- package/dist/src/tui/App.js +6 -2
- package/dist/src/tui/App.js.map +1 -1
- package/dist/src/tui/screens/AgentInstall.d.ts.map +1 -1
- package/dist/src/tui/screens/AgentInstall.js +2 -0
- package/dist/src/tui/screens/AgentInstall.js.map +1 -1
- package/dist/src/tui/screens/Agents.d.ts +1 -0
- package/dist/src/tui/screens/Agents.d.ts.map +1 -1
- package/dist/src/tui/screens/Agents.js +5 -1
- package/dist/src/tui/screens/Agents.js.map +1 -1
- package/dist/src/tui/screens/LaunchAgent.d.ts +14 -1
- package/dist/src/tui/screens/LaunchAgent.d.ts.map +1 -1
- package/dist/src/tui/screens/LaunchAgent.js +99 -19
- package/dist/src/tui/screens/LaunchAgent.js.map +1 -1
- package/dist/src/tui/screens/MainMenu.d.ts +7 -0
- package/dist/src/tui/screens/MainMenu.d.ts.map +1 -1
- package/dist/src/tui/screens/MainMenu.js +7 -0
- package/dist/src/tui/screens/MainMenu.js.map +1 -1
- package/dist/src/tui/screens/Profiles.d.ts +1 -0
- package/dist/src/tui/screens/Profiles.d.ts.map +1 -1
- package/dist/src/tui/screens/Profiles.js +1 -0
- package/dist/src/tui/screens/Profiles.js.map +1 -1
- package/dist/src/tui/screens/Providers.d.ts +1 -0
- package/dist/src/tui/screens/Providers.d.ts.map +1 -1
- package/dist/src/tui/screens/Providers.js +1 -0
- package/dist/src/tui/screens/Providers.js.map +1 -1
- package/dist/src/tui/screens/Settings.d.ts +1 -0
- package/dist/src/tui/screens/Settings.d.ts.map +1 -1
- package/dist/src/tui/screens/Settings.js +20 -3
- package/dist/src/tui/screens/Settings.js.map +1 -1
- package/dist/src/tui/start.d.ts +9 -0
- package/dist/src/tui/start.d.ts.map +1 -1
- package/dist/src/tui/start.js +15 -0
- package/dist/src/tui/start.js.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -37,6 +37,13 @@ AgentO — CLI-инструмент для управления конфигур
|
|
|
37
37
|
│ ├── config/ # Конфигурация AgentO
|
|
38
38
|
│ │ ├── schema.ts # Zod-схемы и типы
|
|
39
39
|
│ │ └── store.ts # Чтение/запись ~/.agento/config.json
|
|
40
|
+
│ ├── installers/ # Установщики агентов (TUI Install Wizard)
|
|
41
|
+
│ │ ├── base.ts # Интерфейс AgentInstaller
|
|
42
|
+
│ │ ├── registry.ts # Реестр установщиков
|
|
43
|
+
│ │ ├── claude-code.ts # Установщик Claude Code
|
|
44
|
+
│ │ ├── opencode.ts # Установщик OpenCode
|
|
45
|
+
│ │ ├── qwen.ts # Установщик Qwen CLI
|
|
46
|
+
│ │ └── codex.ts # Установщик Codex CLI
|
|
40
47
|
│ ├── launcher/ # Запуск агентов
|
|
41
48
|
│ │ ├── child.ts # Child mode (backup → patch → spawn → restore)
|
|
42
49
|
│ │ ├── independent.ts # Independent mode (backup → patch → exec)
|
|
@@ -52,6 +59,7 @@ AgentO — CLI-инструмент для управления конфигур
|
|
|
52
59
|
│ └── screens/ # Экраны TUI
|
|
53
60
|
│ ├── MainMenu.tsx
|
|
54
61
|
│ ├── LaunchAgent.tsx
|
|
62
|
+
│ ├── AgentInstall.tsx # Мастер установки агента
|
|
55
63
|
│ ├── Providers.tsx
|
|
56
64
|
│ ├── Profiles.tsx
|
|
57
65
|
│ ├── Agents.tsx
|
|
@@ -148,6 +156,26 @@ AgentO — CLI-инструмент для управления конфигур
|
|
|
148
156
|
const providerKey = 'openai'; // Было: provider.name.toLowerCase().replace(/\s+/g, '-')
|
|
149
157
|
```
|
|
150
158
|
|
|
159
|
+
## Install Wizard / Installers
|
|
160
|
+
|
|
161
|
+
The TUI includes an install wizard (`AgentInstall.tsx`) that triggers when a user selects an agent that is not yet installed on the system.
|
|
162
|
+
|
|
163
|
+
Each supported agent has a dedicated installer under `src/installers/` that implements the `AgentInstaller` interface from `src/installers/base.ts`:
|
|
164
|
+
|
|
165
|
+
- **`checkInstalled()`** — runs the agent's `--version` command to detect presence and extract version.
|
|
166
|
+
- **`checkEnvironment()`** — verifies prerequisites (e.g. `npm` is available for auto-install).
|
|
167
|
+
- **`install()`** — performs a global `npm install -g <package>` and captures stderr for error reporting.
|
|
168
|
+
- **`manualInstructions`** — provides the exact install command and docs URL shown in manual-install mode.
|
|
169
|
+
|
|
170
|
+
**Registry:** `src/installers/registry.ts` maps `AgentId` → `AgentInstaller`. The TUI calls `getInstaller(agentId)` to retrieve the appropriate installer before showing the wizard.
|
|
171
|
+
|
|
172
|
+
| Agent | Package | Docs URL |
|
|
173
|
+
|-------|---------|----------|
|
|
174
|
+
| Claude Code | `npm install -g @anthropic-ai/claude-code` | https://docs.anthropic.com/en/docs/claude-code/setup |
|
|
175
|
+
| OpenCode | `npm install -g opencode` | https://opencode.ai/docs |
|
|
176
|
+
| Qwen CLI | `npm install -g @qwen-code/qwen-code@latest` | https://github.com/QwenLM/qwen-code |
|
|
177
|
+
| Codex CLI | `npm install -g @openai/codex` | https://github.com/openai/codex |
|
|
178
|
+
|
|
151
179
|
## CLI команды
|
|
152
180
|
|
|
153
181
|
### Запуск
|
package/CHANGELOG.md
CHANGED
|
@@ -13,9 +13,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
13
13
|
- Profile import/export
|
|
14
14
|
- CLI flags for setting non-default capabilities at `provider add` time
|
|
15
15
|
- Plugin system for custom adapters
|
|
16
|
-
- Better error handling and logging
|
|
17
16
|
- Configuration templates and presets
|
|
18
17
|
|
|
18
|
+
## [0.4.2] - 2026-05-12
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **Goose agent** (`goose`) — full support for [Block's Goose](https://goose-docs.ai) CLI agent across all 4 provider types:
|
|
23
|
+
- All config delivered via environment variables (`GOOSE_PROVIDER`, `GOOSE_MODEL`, plus provider-specific keys) — no config file mutation
|
|
24
|
+
- Provider mapping: `anthropic` → `GOOSE_PROVIDER=anthropic` + `ANTHROPIC_API_KEY` (+ `ANTHROPIC_HOST` for custom endpoints); `openrouter` → `GOOSE_PROVIDER=openrouter` + `OPENROUTER_API_KEY`; `fireworks` / `openai-compatible` → `GOOSE_PROVIDER=openai` + `OPENAI_API_KEY` + `OPENAI_HOST`
|
|
25
|
+
- Automatic `/v1` path stripping from `OPENAI_HOST` — Goose appends `/v1/chat/completions` itself; passing a URL with trailing `/v1` would produce a double-versioned path
|
|
26
|
+
- Config paths: `~/.config/goose/config.yaml` (global), `./.goose/config.yaml` (project)
|
|
27
|
+
- Installer: Homebrew (`brew install block-goose-cli`); `manualInstructions` point to official Goose docs
|
|
28
|
+
- Registered in TUI Launch Agent screen, `agento launch`, and `agento agent status`
|
|
29
|
+
|
|
30
|
+
## [0.4.1] - 2026-05-12
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- **Copilot CLI agent** (`copilot`) — full support for GitHub Copilot CLI across all 4 provider types:
|
|
35
|
+
- All config delivered via environment variables (`COPILOT_MODEL`, `COPILOT_PROVIDER_TYPE`, `COPILOT_PROVIDER_API_KEY`, `COPILOT_PROVIDER_BASE_URL`) — no settings file mutation
|
|
36
|
+
- Provider type mapping: `anthropic` → `anthropic`, `openai-compatible` / `fireworks` / `openrouter` → `openai`
|
|
37
|
+
- Default base URLs: Anthropic `https://api.anthropic.com`, Fireworks `https://api.fireworks.ai/inference/v1`, OpenRouter `https://openrouter.ai/api/v1`
|
|
38
|
+
- Auto-enables `COPILOT_PROVIDER_WIRE_API=responses` for gpt-5 family models
|
|
39
|
+
- Registered in TUI Launch Agent screen and CLI `agento launch` command
|
|
40
|
+
- Installer: Homebrew Cask (`gh` extension via `brew install --cask github-copilot-for-xcode` / `gh extension install github/gh-copilot`)
|
|
41
|
+
- **Install status disk cache** — agent install statuses persisted to `~/.agento/agent-status.json`; already-known-installed agents are skipped on next launch (no redundant `checkInstalled()` calls)
|
|
42
|
+
- **ENOENT recovery loop** — when `spawnSync` throws `ENOENT` (command not found), the TUI relaunches with a `launchError` context: profile is pre-selected, affected agent is marked not-installed, and the error message is shown on the agent selection step
|
|
43
|
+
- **Settings value descriptions** — the Settings screen now shows an inline description of the current value for the highlighted setting (e.g. explains what `child` vs `independent` mode means)
|
|
44
|
+
- `agentId` / `profileId` fields added to `ExecRequest` interface — allows the relaunch loop to identify which agent failed without re-parsing the command string
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
|
|
48
|
+
- Copilot adapter `writeConfig` no longer creates a stale empty directory — it is a true no-op since Copilot CLI needs no settings file
|
|
49
|
+
- Copilot adapter now throws a descriptive error when no base URL can be resolved for a provider type (previously silently set an empty string)
|
|
50
|
+
|
|
19
51
|
## [0.4.0] - 2026-05-11
|
|
20
52
|
|
|
21
53
|
### Added
|
package/README.md
CHANGED
|
@@ -17,6 +17,8 @@ AgentO is a CLI tool that centralizes configuration management for popular AI co
|
|
|
17
17
|
| [OpenCode](https://github.com/opencode-ai/opencode) | `opencode` | JSON | `anthropic`, `openai-compatible`, `fireworks`, `openrouter` | Full function calling support via Vercel AI SDK |
|
|
18
18
|
| [Qwen CLI](https://github.com/QwenLM/qwen) | `qwen` | JSON | `openai-compatible`, `fireworks`, `openrouter` | OpenAI-compatible API structure |
|
|
19
19
|
| [Codex CLI](https://github.com/openai/codex) | `codex` | TOML | `fireworks`, `openrouter` | Environment variable injection. `wire_api: responses`. |
|
|
20
|
+
| [Copilot CLI](https://github.com/github/gh-copilot) | `gh copilot` | env vars only | `anthropic`, `openai-compatible`, `fireworks`, `openrouter` | Config delivered entirely via env vars — no settings file patched. |
|
|
21
|
+
| [Goose](https://goose-docs.ai) | `goose` | env vars only | `anthropic`, `openai-compatible`, `fireworks`, `openrouter` | Config delivered entirely via env vars (`GOOSE_PROVIDER`, `GOOSE_MODEL`). |
|
|
20
22
|
|
|
21
23
|
## Installation
|
|
22
24
|
|
|
@@ -42,15 +44,16 @@ npx @emaxe/agento
|
|
|
42
44
|
|
|
43
45
|
| Provider Type | Compatible Agents | Examples |
|
|
44
46
|
|---|---|---|
|
|
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) |
|
|
47
|
+
| `anthropic` | claude-code, opencode, copilot, goose | Anthropic |
|
|
48
|
+
| `openai-compatible` | opencode, qwen, copilot, goose | OpenAI, Together.ai, Cerebras, Perplexity, DeepSeek, etc. |
|
|
49
|
+
| `fireworks` | claude-code, opencode, qwen, codex, copilot, goose | Fireworks AI (supports all 3 API types) |
|
|
50
|
+
| `openrouter` | claude-code, opencode, qwen, codex, copilot, goose | [OpenRouter](https://openrouter.ai) — universal LLM gateway (Anthropic Skin / OpenAI / Responses API) |
|
|
49
51
|
|
|
50
52
|
**Notes:**
|
|
51
53
|
- `claude-code` works with `anthropic`, `fireworks`, and `openrouter` types. For `openrouter` it uses OpenRouter's **Anthropic Skin** with `ANTHROPIC_AUTH_TOKEN` (Bearer auth).
|
|
52
|
-
-
|
|
53
|
-
- `
|
|
54
|
+
- `copilot` and `goose` work with all 4 provider types; config is delivered entirely via environment variables (no settings file is patched).
|
|
55
|
+
- Use `opencode`, `qwen`, `copilot`, or `goose` for general OpenAI-compatible providers.
|
|
56
|
+
- `openrouter` is the most flexible — works with all 6 agents.
|
|
54
57
|
|
|
55
58
|
## Model Capability Flags
|
|
56
59
|
|
|
@@ -141,7 +144,7 @@ Running `agento` without arguments launches an interactive Terminal User Interfa
|
|
|
141
144
|
### Main Menu
|
|
142
145
|
|
|
143
146
|
```
|
|
144
|
-
┌────────── AgentO v0.4.
|
|
147
|
+
┌────────── AgentO v0.4.2 ──────────┐
|
|
145
148
|
│ │
|
|
146
149
|
│ ▶ Launch Agent │
|
|
147
150
|
│ Providers │
|
|
@@ -158,18 +161,19 @@ Running `agento` without arguments launches an interactive Terminal User Interfa
|
|
|
158
161
|
|
|
159
162
|
| Screen | What You Can Do | Key Shortcuts |
|
|
160
163
|
|--------|----------------|---------------|
|
|
161
|
-
| **Launch Agent** | Select profile → select agent (with install hints) → launch; opens Install Wizard for uninstalled agents | **Enter** select, **Esc** back |
|
|
164
|
+
| **Launch Agent** | Select profile → select agent (with install hints) → launch; opens Install Wizard for uninstalled agents; install statuses cached on disk | **Enter** select, **Esc** back |
|
|
162
165
|
| **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 |
|
|
163
166
|
| **Profiles** | View, add, delete profiles. In profile details: add/remove/edit models | **Enter** details, **a** add, **d** delete, **Esc** back |
|
|
164
167
|
| **Agents** | Check config status (global/project), backup availability | **Enter** details, **Esc** back |
|
|
165
|
-
| **Settings** | Change default launch mode, default config scope
|
|
168
|
+
| **Settings** | Change default launch mode, default config scope; selected setting shows inline description of the current value | **↑↓** navigate, **Enter/Space** toggle, **Esc** save & back |
|
|
166
169
|
|
|
167
170
|
### Launch Agent Workflow
|
|
168
171
|
|
|
169
172
|
1. **Select Profile** — Choose from your saved profiles
|
|
170
|
-
2. **Select Agent** — AgentO checks install status of all agents (spinner while checking). Uninstalled agents show a `(not installed)` hint.
|
|
173
|
+
2. **Select Agent** — AgentO checks install status of all agents (spinner while checking). Uninstalled agents show a `(not installed)` hint. Statuses are cached to `~/.agento/agent-status.json` so already-known-installed agents are skipped on the next launch.
|
|
171
174
|
- If the selected agent **is installed** → proceeds to launch
|
|
172
175
|
- If the selected agent **is not installed** → opens the **Install Wizard**
|
|
176
|
+
- If the command is not found at launch time (ENOENT) → TUI relaunches with the error shown and the agent marked as not installed
|
|
173
177
|
3. **Install Wizard** (if needed):
|
|
174
178
|
- **Auto-install** — checks environment (requires npm), then installs via `npm install -g <package>`
|
|
175
179
|
- **Manual install** — shows the exact command and a docs URL
|
|
@@ -240,18 +244,19 @@ Use **TUI** for exploration and interactive workflows. Use **CLI** for scripting
|
|
|
240
244
|
|
|
241
245
|
## Provider & Agent Compatibility Matrix
|
|
242
246
|
|
|
243
|
-
| Provider Type | claude-code | opencode | qwen | codex |
|
|
244
|
-
|
|
245
|
-
| **anthropic** | ✅ Full support | ✅ (via SDK) | ❌ Not supported | ❌ Not supported |
|
|
246
|
-
| **openai-compatible** | ❌ Not supported | ✅ Full support | ✅ Full support | ❌ Not supported |
|
|
247
|
-
| **fireworks** | ✅ (Anthropic API) | ✅ (OpenAI API) | ✅ (OpenAI API) | ✅ (Responses API) |
|
|
248
|
-
| **openrouter** | ✅ (Anthropic Skin) | ✅ (OpenAI API) | ✅ (OpenAI API) | ✅ (Responses API) |
|
|
247
|
+
| Provider Type | claude-code | opencode | qwen | codex | copilot | goose |
|
|
248
|
+
|---|---|---|---|---|---|---|
|
|
249
|
+
| **anthropic** | ✅ Full support | ✅ (via SDK) | ❌ Not supported | ❌ Not supported | ✅ (env vars) | ✅ (env vars) |
|
|
250
|
+
| **openai-compatible** | ❌ Not supported | ✅ Full support | ✅ Full support | ❌ Not supported | ✅ (env vars) | ✅ (env vars) |
|
|
251
|
+
| **fireworks** | ✅ (Anthropic API) | ✅ (OpenAI API) | ✅ (OpenAI API) | ✅ (Responses API) | ✅ (env vars, OpenAI type) | ✅ (env vars, openai provider) |
|
|
252
|
+
| **openrouter** | ✅ (Anthropic Skin) | ✅ (OpenAI API) | ✅ (OpenAI API) | ✅ (Responses API) | ✅ (env vars, OpenAI type) | ✅ (env vars, openrouter provider) |
|
|
249
253
|
|
|
250
254
|
**Key Constraints:**
|
|
251
255
|
- `claude-code` uses Anthropic-compatible APIs and works with `anthropic`, `fireworks`, `openrouter` types
|
|
252
256
|
- For `openrouter` Claude Code uses `ANTHROPIC_AUTH_TOKEN` (Bearer) — not `apiKeyHelper`
|
|
253
|
-
- Other OpenAI-compatible providers must use `opencode` or `
|
|
254
|
-
- `
|
|
257
|
+
- Other OpenAI-compatible providers must use `opencode`, `qwen`, `copilot`, or `goose` agents
|
|
258
|
+
- `copilot` and `goose` deliver all config via env vars — no settings file is ever patched or restored
|
|
259
|
+
- `fireworks` and `openrouter` are the most flexible — work with all 6 agents
|
|
255
260
|
|
|
256
261
|
## CLI Reference
|
|
257
262
|
|
|
@@ -412,6 +417,10 @@ Each supported agent has a dedicated adapter that translates AgentO's generic co
|
|
|
412
417
|
|
|
413
418
|
- **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).
|
|
414
419
|
|
|
420
|
+
- **Copilot CLI** (supports all 4 provider types): No settings file is written. All config is delivered at launch via `COPILOT_MODEL`, `COPILOT_PROVIDER_TYPE`, `COPILOT_PROVIDER_API_KEY`, `COPILOT_PROVIDER_BASE_URL`. Provider types `fireworks` and `openrouter` map to `COPILOT_PROVIDER_TYPE=openai`. Auto-enables `COPILOT_PROVIDER_WIRE_API=responses` for gpt-5 family models.
|
|
421
|
+
|
|
422
|
+
- **Goose** (supports all 4 provider types): No settings file is written. All config is delivered via `GOOSE_PROVIDER` + `GOOSE_MODEL` + provider-specific keys. `anthropic` → `ANTHROPIC_API_KEY`; `openrouter` → `OPENROUTER_API_KEY`; `fireworks` / `openai-compatible` → `OPENAI_API_KEY` + `OPENAI_HOST`. Trailing `/v1` is stripped from `OPENAI_HOST` (Goose appends its own `/v1/chat/completions`).
|
|
423
|
+
|
|
415
424
|
### Backup & Restore
|
|
416
425
|
|
|
417
426
|
Before modifying any agent configuration, AgentO creates a backup at `~/.agento/backups/<agent>/<scope>.bak.*`.
|
package/README.ru.md
CHANGED
|
@@ -13,20 +13,27 @@ AgentO — это CLI-инструмент для централизованно
|
|
|
13
13
|
|
|
14
14
|
| Агент | Команда | Формат конфига | Поддерживаемые провайдеры | Особенности |
|
|
15
15
|
|-------|---------|----------------|---|-------------|
|
|
16
|
-
| [Claude Code](https://github.com/anthropics/claude-code) | `claude` | JSON | `anthropic`, `fireworks` | Поддержка уровней (small/base/smart) |
|
|
17
|
-
| [OpenCode](https://github.com/opencode-ai/opencode) | `opencode` | JSON | `anthropic`, `openai-compatible`, `fireworks` | Полная поддержка function calling через Vercel AI SDK; пробрасывает модальности |
|
|
18
|
-
| [Qwen CLI](https://github.com/QwenLM/qwen) | `qwen` | JSON | `openai-compatible`, `fireworks` | Структура OpenAI-совместимого API; пробрасывает модальности |
|
|
19
|
-
| [Codex CLI](https://github.com/openai/codex) | `codex` | TOML |
|
|
16
|
+
| [Claude Code](https://github.com/anthropics/claude-code) | `claude` | JSON | `anthropic`, `fireworks`, `openrouter` | Поддержка уровней (small/base/smart) |
|
|
17
|
+
| [OpenCode](https://github.com/opencode-ai/opencode) | `opencode` | JSON | `anthropic`, `openai-compatible`, `fireworks`, `openrouter` | Полная поддержка function calling через Vercel AI SDK; пробрасывает модальности |
|
|
18
|
+
| [Qwen CLI](https://github.com/QwenLM/qwen) | `qwen` | JSON | `openai-compatible`, `fireworks`, `openrouter` | Структура OpenAI-совместимого API; пробрасывает модальности |
|
|
19
|
+
| [Codex CLI](https://github.com/openai/codex) | `codex` | TOML | `fireworks`, `openrouter` | Инжект переменных окружения. Скрыт по умолчанию (флаг `--dev`). |
|
|
20
|
+
| [Copilot CLI](https://github.com/github/gh-copilot) | `gh copilot` | только env-переменные | `anthropic`, `openai-compatible`, `fireworks`, `openrouter` | Весь конфиг передаётся через переменные окружения — файл настроек не изменяется. |
|
|
21
|
+
| [Goose](https://goose-docs.ai) | `goose` | только env-переменные | `anthropic`, `openai-compatible`, `fireworks`, `openrouter` | Весь конфиг через env vars (`GOOSE_PROVIDER`, `GOOSE_MODEL`). |
|
|
20
22
|
|
|
21
23
|
## Поддерживаемые типы провайдеров
|
|
22
24
|
|
|
23
25
|
| Тип провайдера | Совместимые агенты | Примеры |
|
|
24
26
|
|---|---|---|
|
|
25
|
-
| `anthropic` | claude-code | Anthropic |
|
|
26
|
-
| `openai-compatible` | opencode, qwen | OpenAI, Together.ai, Cerebras, Perplexity, DeepSeek и т. д. |
|
|
27
|
-
| `fireworks` | claude-code, opencode, qwen, codex | Fireworks AI (поддерживает все 3 типа API) |
|
|
27
|
+
| `anthropic` | claude-code, opencode, copilot, goose | Anthropic |
|
|
28
|
+
| `openai-compatible` | opencode, qwen, copilot, goose | OpenAI, Together.ai, Cerebras, Perplexity, DeepSeek и т. д. |
|
|
29
|
+
| `fireworks` | claude-code, opencode, qwen, codex, copilot, goose | Fireworks AI (поддерживает все 3 типа API) |
|
|
30
|
+
| `openrouter` | claude-code, opencode, qwen, codex, copilot, goose | [OpenRouter](https://openrouter.ai) — универсальный шлюз (Anthropic Skin / OpenAI / Responses API) |
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
**Примечания:**
|
|
33
|
+
- `claude-code` работает с `anthropic`, `fireworks` и `openrouter` (требование Anthropic SDK). Для `openrouter` использует **Anthropic Skin** — `ANTHROPIC_AUTH_TOKEN` (Bearer).
|
|
34
|
+
- `copilot` и `goose` работают со всеми 4 типами провайдеров; конфиг передаётся через переменные окружения, файл настроек не изменяется.
|
|
35
|
+
- Для других OpenAI-совместимых провайдеров используйте `opencode`, `qwen`, `copilot` или `goose`.
|
|
36
|
+
- `openrouter` наиболее универсален — работает со всеми 6 агентами.
|
|
30
37
|
|
|
31
38
|
## Флаги возможностей моделей
|
|
32
39
|
|
|
@@ -120,7 +127,7 @@ agento launch -p default -a qwen -m child -s project
|
|
|
120
127
|
### Главное меню
|
|
121
128
|
|
|
122
129
|
```
|
|
123
|
-
┌────────── AgentO v0.2
|
|
130
|
+
┌────────── AgentO v0.4.2 ──────────┐
|
|
124
131
|
│ │
|
|
125
132
|
│ ▶ Запустить агента │
|
|
126
133
|
│ Провайдеры │
|
|
@@ -137,18 +144,20 @@ agento launch -p default -a qwen -m child -s project
|
|
|
137
144
|
|
|
138
145
|
| Экран | Возможности | Горячие клавиши |
|
|
139
146
|
|-------|-------------|-----------------|
|
|
140
|
-
| **Запуск агента** | Выбор профиля → агента →
|
|
147
|
+
| **Запуск агента** | Выбор профиля → агента → запуск; статус установки кешируется на диск; при ENOENT — перезапуск TUI с ошибкой | **Enter** выбор, **Esc** назад |
|
|
141
148
|
| **Провайдеры** | Просмотр, добавление, редактирование, удаление провайдеров; переключение возможностей моделей | **Enter** детали / добавить модель, **a** добавить провайдер, **e** редактировать, **d** удалить, **i/v/a** переключить флаг, **Esc** назад |
|
|
142
149
|
| **Профили** | Просмотр, добавление, удаление профилей. В деталях: добавление/удаление/редактирование моделей | **Enter** детали, **a** добавить, **d** удалить, **Esc** назад |
|
|
143
150
|
| **Агенты** | Проверка статуса конфигов (global/project), наличие бэкапов | **Enter** детали, **Esc** назад |
|
|
144
|
-
| **Настройки** | Изменение режима
|
|
151
|
+
| **Настройки** | Изменение режима запуска и области конфига; выделенная настройка показывает описание текущего значения | **↑↓** навигация, **Enter/Space** переключение, **Esc** сохранить и назад |
|
|
145
152
|
|
|
146
153
|
### Сценарий запуска агента
|
|
147
154
|
|
|
148
155
|
1. **Выбор профиля** — выберите один из сохранённых профилей
|
|
149
|
-
2. **Выбор агента** —
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
2. **Выбор агента** — AgentO проверяет статус установки всех агентов (спиннер). Незаконченные агенты отмечены `(not installed)`. Статусы кешируются в `~/.agento/agent-status.json` — при следующем открытии уже известные агенты не перепроверяются.
|
|
157
|
+
- Агент **установлен** → переходим к запуску
|
|
158
|
+
- Агент **не установлен** → открывается **Мастер установки**
|
|
159
|
+
- Команда не найдена при запуске (ENOENT) → TUI перезапускается с ошибкой, агент помечается как не установленный
|
|
160
|
+
3. **Запуск** — AgentO применяет конфиг агента и запускает его
|
|
152
161
|
|
|
153
162
|
```
|
|
154
163
|
Profile: default
|
|
@@ -197,7 +206,8 @@ Profile: default
|
|
|
197
206
|
|-----------|----------|----------|
|
|
198
207
|
| **Режим запуска по умолчанию** | `child` / `independent` | Как запускать агентов по умолчанию |
|
|
199
208
|
| **Область конфига по умолчанию** | `global` / `project` | Куда записывать конфиги агентов |
|
|
200
|
-
|
|
209
|
+
|
|
210
|
+
При навигации выделенная настройка показывает пояснение к текущему значению прямо под строкой.
|
|
201
211
|
|
|
202
212
|
**Управление:** **↑↓** навигация, **Enter** или **Space** переключение значений, **Esc** сохранить и вернуться.
|
|
203
213
|
|
|
@@ -342,10 +352,12 @@ AgentO хранит свою конфигурацию в `~/.agento/config.json`
|
|
|
342
352
|
|
|
343
353
|
Каждый поддерживаемый агент имеет адаптер, который переводит универсальный формат AgentO в специфичный конфиг агента:
|
|
344
354
|
|
|
345
|
-
- **Claude Code** (`anthropic`, `fireworks`): Генерирует `~/.claude/settings.json` с выбором модели по уровням и переменными окружения `ANTHROPIC_*`. Использует Anthropic SDK.
|
|
346
|
-
- **OpenCode** (`anthropic`, `openai-compatible`, `fireworks`): Генерирует `~/.config/opencode/config.json` через Vercel AI SDK
|
|
347
|
-
- **Qwen CLI** (`openai-compatible`, `fireworks`): Генерирует `~/.qwen/settings.json` со структурой OpenAI-совместимого провайдера. Требует `baseUrl`. Пробрасывает флаги возможностей через `generationConfig.modalities`.
|
|
348
|
-
- **Codex CLI** (`--dev` для отображения): Генерирует `~/.codex/config.toml` с `wire_api: responses`, профилями и ссылками на переменные окружения. При project-области разделяет конфиг между глобальным (`model_providers`) и проектным (`model`) конфигами.
|
|
355
|
+
- **Claude Code** (`anthropic`, `fireworks`, `openrouter`): Генерирует `~/.claude/settings.json` с выбором модели по уровням и переменными окружения `ANTHROPIC_*`. Использует Anthropic SDK. Для `openrouter` использует **Anthropic Skin** — `ANTHROPIC_AUTH_TOKEN` (Bearer). Флаги возможностей не пробрасываются.
|
|
356
|
+
- **OpenCode** (`anthropic`, `openai-compatible`, `fireworks`, `openrouter`): Генерирует `~/.config/opencode/config.json` через Vercel AI SDK. Полная поддержка function calling через `@ai-sdk/openai-compatible`. Для каждой модели генерируется `modalities: { input: [...], output: ["text"] }` из флагов возможностей.
|
|
357
|
+
- **Qwen CLI** (`openai-compatible`, `fireworks`, `openrouter`): Генерирует `~/.qwen/settings.json` со структурой OpenAI-совместимого провайдера. Требует `baseUrl`. Пробрасывает флаги возможностей через `generationConfig.modalities`.
|
|
358
|
+
- **Codex CLI** (`--dev` для отображения): Генерирует `~/.codex/config.toml` с `wire_api: responses`, профилями и ссылками на переменные окружения. При project-области разделяет конфиг между глобальным (`model_providers`) и проектным (`model`) конфигами. Флаги возможностей не пробрасываются.
|
|
359
|
+
- **Copilot CLI** (все 4 типа провайдеров): Не записывает и не изменяет файл настроек. Весь конфиг передаётся через `COPILOT_MODEL`, `COPILOT_PROVIDER_TYPE`, `COPILOT_PROVIDER_API_KEY`, `COPILOT_PROVIDER_BASE_URL`. Типы `fireworks` и `openrouter` отображаются как `COPILOT_PROVIDER_TYPE=openai`. Для моделей семейства gpt-5 автоматически добавляется `COPILOT_PROVIDER_WIRE_API=responses`.
|
|
360
|
+
- **Goose** (все 4 типа провайдеров): Не изменяет файл настроек. Весь конфиг через `GOOSE_PROVIDER` + `GOOSE_MODEL` + ключи провайдера. `anthropic` → `ANTHROPIC_API_KEY`; `openrouter` → `OPENROUTER_API_KEY`; `fireworks`/`openai-compatible` → `OPENAI_API_KEY` + `OPENAI_HOST`. Суффикс `/v1` автоматически убирается из `OPENAI_HOST` (Goose сам дописывает `/v1/chat/completions`).
|
|
349
361
|
|
|
350
362
|
### Бэкап и восстановление
|
|
351
363
|
|
package/dist/bin/agento.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Entry point for the `agento` CLI tool.
|
|
4
|
+
*
|
|
5
|
+
* Registers all subcommands (launch, provider, profile, restore, agent)
|
|
6
|
+
* and defaults to launching the interactive Terminal UI (TUI) when no
|
|
7
|
+
* subcommand is provided.
|
|
8
|
+
*/
|
|
2
9
|
import { program } from 'commander';
|
|
3
10
|
import { createRequire } from 'module';
|
|
4
11
|
import { spawnSync } from 'node:child_process';
|
|
@@ -14,12 +21,17 @@ program
|
|
|
14
21
|
.description('Manage AI agent configurations with profiles and providers')
|
|
15
22
|
.version(pkg.version)
|
|
16
23
|
.option('-d, --dev', 'Show development agents (e.g. codex)');
|
|
24
|
+
// Register CLI subcommands
|
|
17
25
|
program.addCommand(createLaunchCommand());
|
|
18
26
|
program.addCommand(createProviderCommand());
|
|
19
27
|
program.addCommand(createProfileCommand());
|
|
20
28
|
program.addCommand(createRestoreCommand());
|
|
21
29
|
program.addCommand(createAgentCommand());
|
|
22
|
-
|
|
30
|
+
/** Returns true if error looks like ENOENT from spawnSync. */
|
|
31
|
+
function isEnoent(err) {
|
|
32
|
+
return err instanceof Error && 'code' in err && err.code === 'ENOENT';
|
|
33
|
+
}
|
|
34
|
+
// Default action: launch interactive TUI
|
|
23
35
|
program.action(() => {
|
|
24
36
|
const opts = program.opts();
|
|
25
37
|
import('../src/tui/start.js')
|
|
@@ -28,10 +40,27 @@ program.action(() => {
|
|
|
28
40
|
while (execReq) {
|
|
29
41
|
// Ink may leave stdin in "flowing" state — pause before handing fd to child
|
|
30
42
|
process.stdin.pause();
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
try {
|
|
44
|
+
spawnSync(execReq.command, execReq.args, {
|
|
45
|
+
stdio: 'inherit',
|
|
46
|
+
env: execReq.env,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
if (isEnoent(err)) {
|
|
51
|
+
await execReq.cleanup?.();
|
|
52
|
+
execReq = await startTui({
|
|
53
|
+
dev: opts.dev,
|
|
54
|
+
launchError: {
|
|
55
|
+
agentId: execReq.agentId ?? execReq.command,
|
|
56
|
+
profileId: execReq.profileId,
|
|
57
|
+
error: `Command "${execReq.command}" not found`,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
throw err;
|
|
63
|
+
}
|
|
35
64
|
await execReq.cleanup?.();
|
|
36
65
|
if (!execReq.relaunch)
|
|
37
66
|
break;
|
package/dist/bin/agento.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agento.js","sourceRoot":"","sources":["../../bin/agento.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAwB,CAAC;AAEjE,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CAAC,4DAA4D,CAAC;KACzE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;KACpB,MAAM,CAAC,WAAW,EAAE,sCAAsC,CAAC,CAAC;AAE/D,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;AAC1C,OA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CAAC,CAAC;oBACH,SAAS;gBACX,CAAC;gBACD,MAAM,GAAG,CAAC;YACZ,CAAC;YACD,MAAM,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1B,IAAI,CAAC,OAAO,CAAC,QAAQ;gBAAE,MAAM;YAC7B,OAAO,GAAG,MAAM,QAAQ,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC,CAAC;SACD,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AgentAdapter, AgentConfig, AgentConfigPaths } from './base.js';
|
|
2
|
+
import type { LaunchScope } from './base.js';
|
|
3
|
+
import type { Profile, Provider } from '../config/schema.js';
|
|
4
|
+
export declare class CopilotAdapter implements AgentAdapter {
|
|
5
|
+
readonly id = "copilot";
|
|
6
|
+
readonly displayName = "Copilot CLI";
|
|
7
|
+
readonly supportedProviderTypes: readonly ["openai-compatible", "anthropic", "fireworks", "openrouter"];
|
|
8
|
+
configPaths(cwd?: string): AgentConfigPaths;
|
|
9
|
+
readConfig(scope: LaunchScope, cwd?: string): Promise<AgentConfig | null>;
|
|
10
|
+
buildConfig(_profile: Profile, _providers: Provider[]): AgentConfig;
|
|
11
|
+
buildEnv(profile: Profile, providers: Provider[]): Record<string, string>;
|
|
12
|
+
writeConfig(_config: AgentConfig, _scope: LaunchScope, _cwd?: string): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare const copilotAdapter: CopilotAdapter;
|
|
15
|
+
//# sourceMappingURL=copilot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot.d.ts","sourceRoot":"","sources":["../../../src/adapters/copilot.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;AAgB3E,qBAAa,cAAe,YAAW,YAAY;IACjD,QAAQ,CAAC,EAAE,aAAa;IACxB,QAAQ,CAAC,WAAW,iBAAiB;IACrC,QAAQ,CAAC,sBAAsB,yEAA0E;IAEzG,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,gBAAgB;IAOrC,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAO/E,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,WAAW;IAMnE,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IA8BnE,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3F;AAED,eAAO,MAAM,cAAc,gBAAuB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
const DEFAULT_BASE_URLS = {
|
|
6
|
+
anthropic: 'https://api.anthropic.com',
|
|
7
|
+
fireworks: 'https://api.fireworks.ai/inference/v1',
|
|
8
|
+
openrouter: 'https://openrouter.ai/api/v1',
|
|
9
|
+
};
|
|
10
|
+
/** Map AgentO provider types to Copilot CLI COPILOT_PROVIDER_TYPE values. */
|
|
11
|
+
const PROVIDER_TYPE_MAP = {
|
|
12
|
+
'openai-compatible': 'openai',
|
|
13
|
+
'anthropic': 'anthropic',
|
|
14
|
+
'fireworks': 'openai',
|
|
15
|
+
'openrouter': 'openai',
|
|
16
|
+
};
|
|
17
|
+
export class CopilotAdapter {
|
|
18
|
+
id = 'copilot';
|
|
19
|
+
displayName = 'Copilot CLI';
|
|
20
|
+
supportedProviderTypes = ['openai-compatible', 'anthropic', 'fireworks', 'openrouter'];
|
|
21
|
+
configPaths(cwd) {
|
|
22
|
+
return {
|
|
23
|
+
global: join(homedir(), '.copilot', 'settings.json'),
|
|
24
|
+
project: join(cwd ?? process.cwd(), '.copilot', 'settings.json'),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
async readConfig(scope, cwd) {
|
|
28
|
+
const path = this.configPaths(cwd)[scope];
|
|
29
|
+
if (!existsSync(path))
|
|
30
|
+
return null;
|
|
31
|
+
const raw = await readFile(path, 'utf-8');
|
|
32
|
+
return JSON.parse(raw);
|
|
33
|
+
}
|
|
34
|
+
buildConfig(_profile, _providers) {
|
|
35
|
+
// Copilot CLI accepts model via COPILOT_MODEL env var (handled by buildEnv),
|
|
36
|
+
// so we do not need to mutate the settings file.
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
buildEnv(profile, providers) {
|
|
40
|
+
const base = profile.models.find((m) => m.tier === 'base') ?? profile.models[0];
|
|
41
|
+
if (!base)
|
|
42
|
+
return {};
|
|
43
|
+
const provider = providers.find((p) => p.id === base.providerId);
|
|
44
|
+
if (!provider)
|
|
45
|
+
return {};
|
|
46
|
+
const env = {
|
|
47
|
+
COPILOT_MODEL: base.model,
|
|
48
|
+
COPILOT_PROVIDER_TYPE: PROVIDER_TYPE_MAP[provider.type],
|
|
49
|
+
COPILOT_PROVIDER_API_KEY: provider.apiKey,
|
|
50
|
+
};
|
|
51
|
+
const defaultUrl = DEFAULT_BASE_URLS[provider.type];
|
|
52
|
+
if (!provider.baseUrl && provider.type === 'openai-compatible') {
|
|
53
|
+
throw new Error('baseUrl required for openai-compatible provider in Copilot CLI');
|
|
54
|
+
}
|
|
55
|
+
const resolvedUrl = provider.baseUrl ?? defaultUrl;
|
|
56
|
+
if (!resolvedUrl) {
|
|
57
|
+
throw new Error(`No base URL configured for provider type "${provider.type}" in Copilot CLI`);
|
|
58
|
+
}
|
|
59
|
+
env.COPILOT_PROVIDER_BASE_URL = resolvedUrl;
|
|
60
|
+
if (base.model.startsWith('gpt-5')) {
|
|
61
|
+
env.COPILOT_PROVIDER_WIRE_API = 'responses';
|
|
62
|
+
}
|
|
63
|
+
return env;
|
|
64
|
+
}
|
|
65
|
+
async writeConfig(_config, _scope, _cwd) {
|
|
66
|
+
// No-op: Copilot CLI receives all config via environment variables (see buildEnv).
|
|
67
|
+
// There is nothing to write to settings.json.
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export const copilotAdapter = new CopilotAdapter();
|
|
71
|
+
//# sourceMappingURL=copilot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../src/adapters/copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,MAAM,iBAAiB,GAA0C;IAC/D,SAAS,EAAE,2BAA2B;IACtC,SAAS,EAAE,uCAAuC;IAClD,UAAU,EAAE,8BAA8B;CAC3C,CAAC;AAEF,6EAA6E;AAC7E,MAAM,iBAAiB,GAAiC;IACtD,mBAAmB,EAAE,QAAQ;IAC7B,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,QAAQ;IACrB,YAAY,EAAE,QAAQ;CACvB,CAAC;AAEF,MAAM,OAAO,cAAc;IAChB,EAAE,GAAG,S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EAAE,CAAC;QAEzB,MAAM,GAAG,GAA2B;YAClC,aAAa,EAAE,IAAI,CAAC,KAAK;YACzB,qBAAqB,EAAE,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC;YACvD,wBAAwB,EAAE,QAAQ,CAAC,MAAM;SAC1C,CAAC;QAEF,MAAM,UAAU,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;YAC/D,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;QACpF,CAAC;QACD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,IAAI,UAAU,CAAC;QACnD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,6CAA6C,QAAQ,CAAC,IAAI,kBAAkB,CAAC,CAAC;QAChG,CAAC;QACD,GAAG,CAAC,yBAAyB,GAAG,WAAW,CAAC;QAE5C,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACnC,GAAG,CAAC,yBAAyB,GAAG,WAAW,CAAC;QAC9C,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAoB,EAAE,MAAmB,EAAE,IAAa;QACxE,mFAAmF;QACnF,8CAA8C;IAChD,CAAC;CACF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AgentAdapter, AgentConfig, AgentConfigPaths } from './base.js';
|
|
2
|
+
import type { LaunchScope } from './base.js';
|
|
3
|
+
import type { Profile, Provider } from '../config/schema.js';
|
|
4
|
+
export declare class GooseAdapter implements AgentAdapter {
|
|
5
|
+
readonly id = "goose";
|
|
6
|
+
readonly displayName = "Goose";
|
|
7
|
+
readonly supportedProviderTypes: readonly ["openai-compatible", "anthropic", "fireworks", "openrouter"];
|
|
8
|
+
configPaths(cwd?: string): AgentConfigPaths;
|
|
9
|
+
readConfig(scope: LaunchScope, cwd?: string): Promise<AgentConfig | null>;
|
|
10
|
+
buildConfig(_profile: Profile, _providers: Provider[]): AgentConfig;
|
|
11
|
+
/**
|
|
12
|
+
* Builds the env vars Goose needs to pick up provider/model without interactive configure.
|
|
13
|
+
*
|
|
14
|
+
* Required keys (read by Goose config layer before checking config.yaml):
|
|
15
|
+
* GOOSE_PROVIDER — provider identifier string (e.g. "anthropic", "openai", "openrouter")
|
|
16
|
+
* GOOSE_MODEL — model name string
|
|
17
|
+
*
|
|
18
|
+
* Provider-specific keys:
|
|
19
|
+
* anthropic → ANTHROPIC_API_KEY, optionally ANTHROPIC_HOST (custom endpoint)
|
|
20
|
+
* openrouter → OPENROUTER_API_KEY, optionally OPENROUTER_HOST (non-default endpoint)
|
|
21
|
+
* fireworks → routed as GOOSE_PROVIDER=openai + OPENAI_API_KEY + OPENAI_HOST
|
|
22
|
+
* openai-compat → GOOSE_PROVIDER=openai + OPENAI_API_KEY + OPENAI_HOST (baseUrl required)
|
|
23
|
+
*/
|
|
24
|
+
buildEnv(profile: Profile, providers: Provider[]): Record<string, string>;
|
|
25
|
+
writeConfig(_config: AgentConfig, _scope: LaunchScope, _cwd?: string): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export declare const gooseAdapter: GooseAdapter;
|
|
28
|
+
//# sourceMappingURL=goose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goose.d.ts","sourceRoot":"","sources":["../../../src/adapters/goose.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AA6B7D,qBAAa,YAAa,YAAW,YAAY;IAC/C,QAAQ,CAAC,EAAE,WAAW;IACtB,QAAQ,CAAC,WAAW,WAAW;IAC/B,QAAQ,CAAC,sBAAsB,yEAA0E;IAEzG,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,gBAAgB;IAOrC,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAQ/E,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,WAAW;IAMnE;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IA2CnE,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3F;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|