@emaxe/agento 0.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/LICENSE +21 -0
- package/README.md +304 -0
- package/dist/bin/agento.d.ts +3 -0
- package/dist/bin/agento.d.ts.map +1 -0
- package/dist/bin/agento.js +44 -0
- package/dist/bin/agento.js.map +1 -0
- package/dist/src/adapters/base.d.ts +38 -0
- package/dist/src/adapters/base.d.ts.map +1 -0
- package/dist/src/adapters/base.js +2 -0
- package/dist/src/adapters/base.js.map +1 -0
- package/dist/src/adapters/claude-code.d.ts +13 -0
- package/dist/src/adapters/claude-code.d.ts.map +1 -0
- package/dist/src/adapters/claude-code.js +70 -0
- package/dist/src/adapters/claude-code.js.map +1 -0
- package/dist/src/adapters/codex.d.ts +15 -0
- package/dist/src/adapters/codex.d.ts.map +1 -0
- package/dist/src/adapters/codex.js +148 -0
- package/dist/src/adapters/codex.js.map +1 -0
- package/dist/src/adapters/opencode.d.ts +13 -0
- package/dist/src/adapters/opencode.d.ts.map +1 -0
- package/dist/src/adapters/opencode.js +62 -0
- package/dist/src/adapters/opencode.js.map +1 -0
- package/dist/src/adapters/qwen.d.ts +13 -0
- package/dist/src/adapters/qwen.d.ts.map +1 -0
- package/dist/src/adapters/qwen.js +84 -0
- package/dist/src/adapters/qwen.js.map +1 -0
- package/dist/src/cli/commands/agent.d.ts +3 -0
- package/dist/src/cli/commands/agent.d.ts.map +1 -0
- package/dist/src/cli/commands/agent.js +42 -0
- package/dist/src/cli/commands/agent.js.map +1 -0
- package/dist/src/cli/commands/launch.d.ts +3 -0
- package/dist/src/cli/commands/launch.d.ts.map +1 -0
- package/dist/src/cli/commands/launch.js +80 -0
- package/dist/src/cli/commands/launch.js.map +1 -0
- package/dist/src/cli/commands/profile.d.ts +3 -0
- package/dist/src/cli/commands/profile.d.ts.map +1 -0
- package/dist/src/cli/commands/profile.js +102 -0
- package/dist/src/cli/commands/profile.js.map +1 -0
- package/dist/src/cli/commands/provider.d.ts +3 -0
- package/dist/src/cli/commands/provider.d.ts.map +1 -0
- package/dist/src/cli/commands/provider.js +70 -0
- package/dist/src/cli/commands/provider.js.map +1 -0
- package/dist/src/cli/commands/restore.d.ts +3 -0
- package/dist/src/cli/commands/restore.d.ts.map +1 -0
- package/dist/src/cli/commands/restore.js +41 -0
- package/dist/src/cli/commands/restore.js.map +1 -0
- package/dist/src/config/schema.d.ts +218 -0
- package/dist/src/config/schema.d.ts.map +1 -0
- package/dist/src/config/schema.js +49 -0
- package/dist/src/config/schema.js.map +1 -0
- package/dist/src/config/store.d.ts +20 -0
- package/dist/src/config/store.d.ts.map +1 -0
- package/dist/src/config/store.js +59 -0
- package/dist/src/config/store.js.map +1 -0
- package/dist/src/launcher/child.d.ts +30 -0
- package/dist/src/launcher/child.d.ts.map +1 -0
- package/dist/src/launcher/child.js +115 -0
- package/dist/src/launcher/child.js.map +1 -0
- package/dist/src/launcher/independent.d.ts +25 -0
- package/dist/src/launcher/independent.d.ts.map +1 -0
- package/dist/src/launcher/independent.js +26 -0
- package/dist/src/launcher/independent.js.map +1 -0
- package/dist/src/launcher/shell-path-resolver.d.ts +17 -0
- package/dist/src/launcher/shell-path-resolver.d.ts.map +1 -0
- package/dist/src/launcher/shell-path-resolver.js +97 -0
- package/dist/src/launcher/shell-path-resolver.js.map +1 -0
- package/dist/src/profiles/profile-manager.d.ts +17 -0
- package/dist/src/profiles/profile-manager.d.ts.map +1 -0
- package/dist/src/profiles/profile-manager.js +74 -0
- package/dist/src/profiles/profile-manager.js.map +1 -0
- package/dist/src/providers/provider-manager.d.ts +13 -0
- package/dist/src/providers/provider-manager.d.ts.map +1 -0
- package/dist/src/providers/provider-manager.js +42 -0
- package/dist/src/providers/provider-manager.js.map +1 -0
- package/dist/src/tui/App.d.ts +10 -0
- package/dist/src/tui/App.d.ts.map +1 -0
- package/dist/src/tui/App.js +43 -0
- package/dist/src/tui/App.js.map +1 -0
- package/dist/src/tui/screens/Agents.d.ts +8 -0
- package/dist/src/tui/screens/Agents.d.ts.map +1 -0
- package/dist/src/tui/screens/Agents.js +70 -0
- package/dist/src/tui/screens/Agents.js.map +1 -0
- package/dist/src/tui/screens/LaunchAgent.d.ts +10 -0
- package/dist/src/tui/screens/LaunchAgent.d.ts.map +1 -0
- package/dist/src/tui/screens/LaunchAgent.js +119 -0
- package/dist/src/tui/screens/LaunchAgent.js.map +1 -0
- package/dist/src/tui/screens/MainMenu.d.ts +9 -0
- package/dist/src/tui/screens/MainMenu.d.ts.map +1 -0
- package/dist/src/tui/screens/MainMenu.js +32 -0
- package/dist/src/tui/screens/MainMenu.js.map +1 -0
- package/dist/src/tui/screens/Profiles.d.ts +7 -0
- package/dist/src/tui/screens/Profiles.d.ts.map +1 -0
- package/dist/src/tui/screens/Profiles.js +528 -0
- package/dist/src/tui/screens/Profiles.js.map +1 -0
- package/dist/src/tui/screens/Providers.d.ts +7 -0
- package/dist/src/tui/screens/Providers.d.ts.map +1 -0
- package/dist/src/tui/screens/Providers.js +235 -0
- package/dist/src/tui/screens/Providers.js.map +1 -0
- package/dist/src/tui/screens/Settings.d.ts +7 -0
- package/dist/src/tui/screens/Settings.d.ts.map +1 -0
- package/dist/src/tui/screens/Settings.js +49 -0
- package/dist/src/tui/screens/Settings.js.map +1 -0
- package/dist/src/tui/start.d.ts +6 -0
- package/dist/src/tui/start.d.ts.map +1 -0
- package/dist/src/tui/start.js +15 -0
- package/dist/src/tui/start.js.map +1 -0
- package/dist/src/tui/use-key-input.d.ts +9 -0
- package/dist/src/tui/use-key-input.d.ts.map +1 -0
- package/dist/src/tui/use-key-input.js +19 -0
- package/dist/src/tui/use-key-input.js.map +1 -0
- package/package.json +82 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 AgentO Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# AgentO — AI Agent Configuration Manager
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@emaxe/agento)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
> Manage AI agent configurations with profiles and providers. Switch between models, providers, and agents seamlessly.
|
|
7
|
+
|
|
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
|
+
|
|
10
|
+
## Supported Agents
|
|
11
|
+
|
|
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). |
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
### Global Installation (Recommended)
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g @emaxe/agento
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Local Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install --save-dev @emaxe/agento
|
|
31
|
+
npx @emaxe/agento
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Requirements
|
|
35
|
+
|
|
36
|
+
- Node.js ≥ 18
|
|
37
|
+
- One or more supported AI agent CLI tools installed
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
### 1. Add an API Provider
|
|
42
|
+
|
|
43
|
+
```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
|
+
# Anthropic provider
|
|
53
|
+
agento provider add \
|
|
54
|
+
-n "Anthropic" \
|
|
55
|
+
-t anthropic \
|
|
56
|
+
-k "sk-ant-your-key" \
|
|
57
|
+
-M "claude-sonnet-4-20250514,claude-3-5-haiku-20241022"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 2. Create a Profile
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Single model profile
|
|
64
|
+
agento profile add -n "default" -m "provider-id:claude-sonnet-4-20250514"
|
|
65
|
+
|
|
66
|
+
# Multi-tier profile (requires tiers: small/base/smart)
|
|
67
|
+
agento profile add -n "multi" -m "provider-id:claude-3-5-haiku-20241022:small,provider-id:claude-sonnet-4-20250514:base,provider-id:claude-opus-4-20250514:smart"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 3. Launch an Agent
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Interactive TUI mode (default)
|
|
74
|
+
agento
|
|
75
|
+
|
|
76
|
+
# Direct launch
|
|
77
|
+
agento launch -p default -a claude-code
|
|
78
|
+
|
|
79
|
+
# Launch with specific mode and scope
|
|
80
|
+
agento launch -p default -a qwen -m child -s project
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Interactive TUI
|
|
84
|
+
|
|
85
|
+
Running `agento` without arguments launches an interactive Terminal User Interface:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
┌────────── AgentO v0.1.0 ──────────┐
|
|
89
|
+
│ │
|
|
90
|
+
│ ▶ Launch Agent │
|
|
91
|
+
│ Providers │
|
|
92
|
+
│ Profiles │
|
|
93
|
+
│ Agents │
|
|
94
|
+
│ Settings │
|
|
95
|
+
│ │
|
|
96
|
+
└───────────────────────────────────┘
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
- **↑↓** Navigate
|
|
100
|
+
- **Enter** Select
|
|
101
|
+
- **Esc / q** Back/Quit
|
|
102
|
+
|
|
103
|
+
## CLI Reference
|
|
104
|
+
|
|
105
|
+
### `agento` — Main Command
|
|
106
|
+
|
|
107
|
+
Launches the interactive TUI by default.
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
agento # Launch interactive TUI
|
|
111
|
+
agento --dev # Show development agents (e.g. codex) in TUI
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### `agento launch` — Launch Agent
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
agento launch -p <profile> -a <agent> [options]
|
|
118
|
+
|
|
119
|
+
Options:
|
|
120
|
+
-p, --profile <name> Profile name to use (required)
|
|
121
|
+
-a, --agent <id> Agent to launch: claude-code, opencode, qwen, codex (required)
|
|
122
|
+
-m, --mode <mode> Launch mode: child or independent (default: from settings)
|
|
123
|
+
-s, --scope <scope> Config scope: global or project (default: from settings)
|
|
124
|
+
-d, --dev Show development agents (e.g. codex)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Launch Modes:**
|
|
128
|
+
|
|
129
|
+
- **Child** (default): Temporarily patches agent config, runs agent, restores original config on exit
|
|
130
|
+
- **Independent**: Patches config permanently; user must restore manually
|
|
131
|
+
|
|
132
|
+
**Config Scopes:**
|
|
133
|
+
|
|
134
|
+
- **Global**: `~/.<agent>/settings.*`
|
|
135
|
+
- **Project**: `./.<agent>/settings.*` or `./<agent>.*`
|
|
136
|
+
|
|
137
|
+
### `agento provider` — Manage Providers
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
agento provider list # List all providers
|
|
141
|
+
agento provider add [options] # Add a new provider
|
|
142
|
+
-n, --name <name> Provider display name (required)
|
|
143
|
+
-t, --type <type> Provider type: openai-compatible or anthropic (required)
|
|
144
|
+
-k, --api-key <key> API key (required)
|
|
145
|
+
-u, --base-url <url> Base URL (for openai-compatible)
|
|
146
|
+
-M, --models <models> Comma-separated list of model names (required)
|
|
147
|
+
agento provider remove <name> # Remove a provider
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### `agento profile` — Manage Profiles
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
agento profile list # List all profiles
|
|
154
|
+
agento profile add [options] # Add a new profile
|
|
155
|
+
-n, --name <name> Profile name (required)
|
|
156
|
+
-m, --models <models> Comma-separated list of providerId:modelName[:tier] (required)
|
|
157
|
+
Tier is optional for single-model profiles.
|
|
158
|
+
For multi-model: tier must be small|base|smart, at least one base.
|
|
159
|
+
agento profile remove <name> # Remove a profile
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### `agento agent` — Agent Status
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
agento agent status # Show config status for all agents
|
|
166
|
+
agento agent status --dev # Include development agents (e.g. codex)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### `agento restore` — Restore Config
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
agento restore -a <agent> -s <scope> # Restore agent config from backup
|
|
173
|
+
|
|
174
|
+
Options:
|
|
175
|
+
-a, --agent <id> Agent ID (required)
|
|
176
|
+
-s, --scope <scope> Config scope: global or project (required)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Configuration
|
|
180
|
+
|
|
181
|
+
AgentO stores its configuration in `~/.agento/config.json`:
|
|
182
|
+
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"providers": [
|
|
186
|
+
{
|
|
187
|
+
"id": "uuid",
|
|
188
|
+
"name": "Fireworks AI",
|
|
189
|
+
"type": "openai-compatible",
|
|
190
|
+
"apiKey": "sk-...",
|
|
191
|
+
"baseUrl": "https://api.fireworks.ai/inference/v1",
|
|
192
|
+
"models": ["accounts/fireworks/models/llama-v3p1-70b-instruct"]
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"profiles": [
|
|
196
|
+
{
|
|
197
|
+
"id": "uuid",
|
|
198
|
+
"name": "default",
|
|
199
|
+
"models": [
|
|
200
|
+
{
|
|
201
|
+
"providerId": "uuid",
|
|
202
|
+
"model": "accounts/fireworks/models/llama-v3p1-70b-instruct",
|
|
203
|
+
"tier": "base"
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
"settings": {
|
|
209
|
+
"defaultLaunchMode": "child",
|
|
210
|
+
"defaultConfigScope": "global",
|
|
211
|
+
"independentMode": "pty"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## How It Works
|
|
217
|
+
|
|
218
|
+
### Agent Adapters
|
|
219
|
+
|
|
220
|
+
Each supported agent has a dedicated adapter that translates AgentO's generic config format into the agent's specific configuration:
|
|
221
|
+
|
|
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.
|
|
226
|
+
|
|
227
|
+
### Backup & Restore
|
|
228
|
+
|
|
229
|
+
Before modifying any agent configuration, AgentO creates a backup at `~/.agento/backups/<agent>/<scope>.bak.*`.
|
|
230
|
+
|
|
231
|
+
In **Child Mode**, the original config is automatically restored when the agent exits or receives SIGTERM/SIGINT.
|
|
232
|
+
|
|
233
|
+
In **Independent Mode**, the config remains modified. Restore manually with `agento restore`.
|
|
234
|
+
|
|
235
|
+
## Development
|
|
236
|
+
|
|
237
|
+
### Setup
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
git clone https://github.com/emaxe/agentO.git
|
|
241
|
+
cd agentO
|
|
242
|
+
npm install
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Scripts
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
npm run build # Compile TypeScript to dist/
|
|
249
|
+
npm run dev # Watch mode compilation
|
|
250
|
+
npm test # Run all tests
|
|
251
|
+
npm run test:watch # Watch mode tests
|
|
252
|
+
npm run typecheck # TypeScript type checking
|
|
253
|
+
npm run lint # ESLint
|
|
254
|
+
npm run format # Prettier
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Architecture
|
|
258
|
+
|
|
259
|
+
```
|
|
260
|
+
src/
|
|
261
|
+
├── adapters/ # Agent-specific config translators
|
|
262
|
+
├── cli/commands/ # CLI command implementations
|
|
263
|
+
├── config/ # Config schema and storage
|
|
264
|
+
├── launcher/ # Agent launch logic
|
|
265
|
+
├── profiles/ # Profile management
|
|
266
|
+
├── providers/ # Provider management
|
|
267
|
+
└── tui/ # Terminal UI (Ink + React)
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Troubleshooting
|
|
271
|
+
|
|
272
|
+
### Changes in `src/` not applied
|
|
273
|
+
|
|
274
|
+
AgentO's global command uses compiled code from `dist/`, not `src/`. After any source changes:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
npm run build
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Tests pass but global command behaves differently
|
|
281
|
+
|
|
282
|
+
The `dist/` folder is out of date. Rebuild:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
npm run build
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Qwen CLI config shows "omni" instead of "openai"
|
|
289
|
+
|
|
290
|
+
This was a bug in versions < 0.1.1. Update to the latest version or rebuild.
|
|
291
|
+
|
|
292
|
+
## Contributing
|
|
293
|
+
|
|
294
|
+
Contributions are welcome! Please:
|
|
295
|
+
|
|
296
|
+
1. Fork the repository
|
|
297
|
+
2. Create a feature branch
|
|
298
|
+
3. Write tests for new functionality
|
|
299
|
+
4. Ensure all tests pass (`npm test`)
|
|
300
|
+
5. Submit a pull request
|
|
301
|
+
|
|
302
|
+
## License
|
|
303
|
+
|
|
304
|
+
[MIT](LICENSE) © AgentO Contributors
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agento.d.ts","sourceRoot":"","sources":["../../bin/agento.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { program } from 'commander';
|
|
3
|
+
import { createRequire } from 'module';
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
import { createLaunchCommand } from '../src/cli/commands/launch.js';
|
|
6
|
+
import { createProviderCommand } from '../src/cli/commands/provider.js';
|
|
7
|
+
import { createProfileCommand } from '../src/cli/commands/profile.js';
|
|
8
|
+
import { createRestoreCommand } from '../src/cli/commands/restore.js';
|
|
9
|
+
import { createAgentCommand } from '../src/cli/commands/agent.js';
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
const pkg = require('../../package.json');
|
|
12
|
+
program
|
|
13
|
+
.name('agento')
|
|
14
|
+
.description('Manage AI agent configurations with profiles and providers')
|
|
15
|
+
.version(pkg.version)
|
|
16
|
+
.option('-d, --dev', 'Show development agents (e.g. codex)');
|
|
17
|
+
program.addCommand(createLaunchCommand());
|
|
18
|
+
program.addCommand(createProviderCommand());
|
|
19
|
+
program.addCommand(createProfileCommand());
|
|
20
|
+
program.addCommand(createRestoreCommand());
|
|
21
|
+
program.addCommand(createAgentCommand());
|
|
22
|
+
// Default action: launch TUI
|
|
23
|
+
program.action(() => {
|
|
24
|
+
const opts = program.opts();
|
|
25
|
+
import('../src/tui/start.js')
|
|
26
|
+
.then(async ({ startTui }) => {
|
|
27
|
+
let execReq = await startTui({ dev: opts.dev });
|
|
28
|
+
while (execReq) {
|
|
29
|
+
// Ink may leave stdin in "flowing" state — pause before handing fd to child
|
|
30
|
+
process.stdin.pause();
|
|
31
|
+
spawnSync(execReq.command, execReq.args, {
|
|
32
|
+
stdio: 'inherit',
|
|
33
|
+
env: execReq.env,
|
|
34
|
+
});
|
|
35
|
+
await execReq.cleanup?.();
|
|
36
|
+
if (!execReq.relaunch)
|
|
37
|
+
break;
|
|
38
|
+
execReq = await startTui({ dev: opts.dev });
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
.catch(console.error);
|
|
42
|
+
});
|
|
43
|
+
program.parse(process.argv);
|
|
44
|
+
//# sourceMappingURL=agento.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agento.js","sourceRoot":"","sources":["../../bin/agento.ts"],"names":[],"mappings":";AACA,OAA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,MAAM,QAAQ,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAChD,OAAO,OAAO,EAAE,CAAC;YACf,4EAA4E;YAC5E,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACtB,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;gBACvC,KAAK,EAAE,SAAS;gBAChB,GAAG,EAAE,OAAO,CAAC,GAAG;aACjB,CAAC,CAAC;YACH,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,38 @@
|
|
|
1
|
+
import type { Profile, Provider } from '../config/schema.js';
|
|
2
|
+
import type { LaunchScope } from '../config/schema.js';
|
|
3
|
+
/** Режим области действия конфига агента */
|
|
4
|
+
export type { LaunchScope };
|
|
5
|
+
/** Базовый тип конфига агента (произвольный JSON-объект) */
|
|
6
|
+
export type AgentConfig = Record<string, unknown>;
|
|
7
|
+
/** Пути к конфигам агента для разных scope */
|
|
8
|
+
export interface AgentConfigPaths {
|
|
9
|
+
global: string;
|
|
10
|
+
project: string;
|
|
11
|
+
}
|
|
12
|
+
/** Интерфейс адаптера агента */
|
|
13
|
+
export interface AgentAdapter {
|
|
14
|
+
/** Уникальный идентификатор агента (например 'claude-code') */
|
|
15
|
+
readonly id: string;
|
|
16
|
+
/** Отображаемое имя агента */
|
|
17
|
+
readonly displayName: string;
|
|
18
|
+
/** Флаг разработки: скрыт из UI/CLI по умолчанию */
|
|
19
|
+
readonly dev?: boolean;
|
|
20
|
+
/** Возвращает пути к конфигам агента (global и project) */
|
|
21
|
+
configPaths(cwd?: string): AgentConfigPaths;
|
|
22
|
+
/** Читает текущий конфиг агента для указанного scope */
|
|
23
|
+
readConfig(scope: LaunchScope, cwd?: string): Promise<AgentConfig | null>;
|
|
24
|
+
/** Генерирует конфиг агента из профиля AgentO и списка провайдеров.
|
|
25
|
+
* Использует первую пару (провайдер, модель) из профиля.
|
|
26
|
+
*/
|
|
27
|
+
buildConfig(profile: Profile, providers: Provider[]): AgentConfig;
|
|
28
|
+
/** Записывает конфиг агента для указанного scope */
|
|
29
|
+
writeConfig(config: AgentConfig, scope: LaunchScope, cwd?: string): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Опционально: возвращает env-переменные, которые нужно инжектировать при запуске агента.
|
|
32
|
+
* Используется адаптерами (например Codex), которые хранят ключ API как ссылку на env-переменную.
|
|
33
|
+
*/
|
|
34
|
+
buildEnv?(profile: Profile, providers: Provider[]): Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
/** Карта зарегистрированных адаптеров */
|
|
37
|
+
export type AdapterRegistry = Map<string, AgentAdapter>;
|
|
38
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/adapters/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,4CAA4C;AAC5C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,4DAA4D;AAC5D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAElD,8CAA8C;AAC9C,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,gCAAgC;AAChC,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,8BAA8B;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,oDAAoD;IACpD,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAEvB,2DAA2D;IAC3D,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAE5C,wDAAwD;IACxD,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAE1E;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;IAElE,oDAAoD;IACpD,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElF;;;OAGG;IACH,QAAQ,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5E;AAED,yCAAyC;AACzC,MAAM,MAAM,eAAe,GAAG,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/adapters/base.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
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 ClaudeCodeAdapter implements AgentAdapter {
|
|
5
|
+
readonly id = "claude-code";
|
|
6
|
+
readonly displayName = "Claude Code";
|
|
7
|
+
configPaths(cwd?: string): AgentConfigPaths;
|
|
8
|
+
readConfig(scope: LaunchScope, cwd?: string): Promise<AgentConfig | null>;
|
|
9
|
+
buildConfig(profile: Profile, providers: Provider[]): AgentConfig;
|
|
10
|
+
writeConfig(config: AgentConfig, scope: LaunchScope, cwd?: string): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare const claudeCodeAdapter: ClaudeCodeAdapter;
|
|
13
|
+
//# sourceMappingURL=claude-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude-code.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,EAAa,OAAO,EAAgB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AActF,qBAAa,iBAAkB,YAAW,YAAY;IACpD,QAAQ,CAAC,EAAE,iBAAiB;IAC5B,QAAQ,CAAC,WAAW,iBAAiB;IAErC,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,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,WAAW;IA4C3D,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAMxF;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { readFile, writeFile, mkdir } from 'node:fs/promises';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
function escapeForSingleQuoted(value) {
|
|
6
|
+
return value.replace(/'/g, "'\\''");
|
|
7
|
+
}
|
|
8
|
+
function pickByTier(models, tier, fallback) {
|
|
9
|
+
return models.find((m) => m.tier === tier) ?? fallback;
|
|
10
|
+
}
|
|
11
|
+
export class ClaudeCodeAdapter {
|
|
12
|
+
id = 'claude-code';
|
|
13
|
+
displayName = 'Claude Code';
|
|
14
|
+
configPaths(cwd) {
|
|
15
|
+
return {
|
|
16
|
+
global: join(homedir(), '.claude', 'settings.json'),
|
|
17
|
+
project: join(cwd ?? process.cwd(), '.claude', 'settings.json'),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async readConfig(scope, cwd) {
|
|
21
|
+
const path = this.configPaths(cwd)[scope];
|
|
22
|
+
if (!existsSync(path))
|
|
23
|
+
return null;
|
|
24
|
+
const raw = await readFile(path, 'utf-8');
|
|
25
|
+
return JSON.parse(raw);
|
|
26
|
+
}
|
|
27
|
+
buildConfig(profile, providers) {
|
|
28
|
+
const first = profile.models[0];
|
|
29
|
+
if (!first)
|
|
30
|
+
throw new Error(`Profile "${profile.name}" has no models`);
|
|
31
|
+
// Базовая модель: явный tier=base, иначе первая в списке.
|
|
32
|
+
const base = profile.models.find((m) => m.tier === 'base') ?? first;
|
|
33
|
+
const baseProvider = providers.find((p) => p.id === base.providerId);
|
|
34
|
+
if (!baseProvider)
|
|
35
|
+
throw new Error(`Provider not found for id: ${base.providerId}`);
|
|
36
|
+
// Если в профиле одна модель — она применяется ко всем уровням.
|
|
37
|
+
const small = pickByTier(profile.models, 'small', base);
|
|
38
|
+
const smart = pickByTier(profile.models, 'smart', base);
|
|
39
|
+
// Claude Code supports only one provider per profile
|
|
40
|
+
const providerIds = new Set([small.providerId, base.providerId, smart.providerId]);
|
|
41
|
+
if (providerIds.size > 1) {
|
|
42
|
+
throw new Error(`Claude Code supports only one provider per profile. Found providers for different tiers: ${[...providerIds].join(', ')}`);
|
|
43
|
+
}
|
|
44
|
+
const env = {
|
|
45
|
+
ANTHROPIC_MODEL: base.model,
|
|
46
|
+
ANTHROPIC_SMALL_FAST_MODEL: small.model,
|
|
47
|
+
ANTHROPIC_DEFAULT_HAIKU_MODEL: small.model,
|
|
48
|
+
ANTHROPIC_DEFAULT_SONNET_MODEL: base.model,
|
|
49
|
+
ANTHROPIC_DEFAULT_OPUS_MODEL: smart.model,
|
|
50
|
+
};
|
|
51
|
+
if (baseProvider.baseUrl) {
|
|
52
|
+
env['ANTHROPIC_BASE_URL'] = baseProvider.baseUrl;
|
|
53
|
+
}
|
|
54
|
+
const config = {
|
|
55
|
+
$schema: 'https://json.schemastore.org/claude-code-settings.json',
|
|
56
|
+
apiKeyHelper: `bash -c 'echo ${escapeForSingleQuoted(baseProvider.apiKey)}'`,
|
|
57
|
+
env,
|
|
58
|
+
model: base.model,
|
|
59
|
+
};
|
|
60
|
+
return config;
|
|
61
|
+
}
|
|
62
|
+
async writeConfig(config, scope, cwd) {
|
|
63
|
+
const path = this.configPaths(cwd)[scope];
|
|
64
|
+
const dir = join(path, '..');
|
|
65
|
+
await mkdir(dir, { recursive: true });
|
|
66
|
+
await writeFile(path, JSON.stringify(config, null, 2), 'utf-8');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export const claudeCodeAdapter = new ClaudeCodeAdapter();
|
|
70
|
+
//# sourceMappingURL=claude-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../src/adapters/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,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Y,CAAC,OAAO,CAAC;QACnD,CAAC;QAED,MAAM,MAAM,GAAgB;YAC1B,OAAO,EAAE,wDAAwD;YACjE,YAAY,EAAE,iBAAiB,qBAAqB,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG;YAC5E,GAAG;YACH,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;QAEF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,MAAmB,EAAE,KAAkB,EAAE,GAAY;QACrE,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7B,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtC,MAAM,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CACF;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,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 CodexAdapter implements AgentAdapter {
|
|
5
|
+
readonly id = "codex";
|
|
6
|
+
readonly displayName = "Codex CLI";
|
|
7
|
+
readonly dev = true;
|
|
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 codexAdapter: CodexAdapter;
|
|
15
|
+
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex.ts"],"names":[],"mappings":"AAKA,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;AAe7D,qBAAa,YAAa,YAAW,YAAY;IAC/C,QAAQ,CAAC,EAAE,WAAW;IACtB,QAAQ,CAAC,WAAW,eAAe;IACnC,QAAQ,CAAC,GAAG,QAAQ;IAEpB,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,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,WAAW;IA8BjE,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAanE,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAyFxF;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|