erosolar-cli 1.2.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +544 -66
- package/dist/contracts/tools.schema.json +92 -74
- package/dist/core/contextManager.d.ts +24 -4
- package/dist/core/contextManager.d.ts.map +1 -1
- package/dist/core/contextManager.js +91 -9
- package/dist/core/contextManager.js.map +1 -1
- package/dist/core/contextWindow.d.ts +30 -0
- package/dist/core/contextWindow.d.ts.map +1 -1
- package/dist/core/contextWindow.js +102 -17
- package/dist/core/contextWindow.js.map +1 -1
- package/dist/plugins/tools/learn/learnPlugin.js +2 -2
- package/dist/plugins/tools/learn/learnPlugin.js.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +1 -1
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/runtime/agentSession.js +1 -1
- package/dist/runtime/agentSession.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,127 +2,478 @@
|
|
|
2
2
|
|
|
3
3
|
A unified AI agent framework for the command line. Multi-provider support with schema-driven tools, code intelligence, and transparent reasoning.
|
|
4
4
|
|
|
5
|
+
[](https://www.npmjs.com/package/erosolar-cli)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://nodejs.org)
|
|
8
|
+
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Quick Start](#quick-start)
|
|
13
|
+
- [Supported Providers](#supported-providers)
|
|
14
|
+
- [Core Concepts](#core-concepts)
|
|
15
|
+
- [Usage Guide](#usage-guide)
|
|
16
|
+
- [Commands Reference](#commands-reference)
|
|
17
|
+
- [Tool Capabilities](#tool-capabilities)
|
|
18
|
+
- [Schema Architecture](#schema-architecture)
|
|
19
|
+
- [Configuration](#configuration)
|
|
20
|
+
- [Development](#development)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
5
24
|
## Installation
|
|
6
25
|
|
|
7
26
|
```bash
|
|
8
27
|
npm install -g erosolar-cli
|
|
9
28
|
```
|
|
10
29
|
|
|
11
|
-
|
|
30
|
+
**Requirements:** Node.js 20+
|
|
31
|
+
|
|
32
|
+
**Verify installation:**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
erosolar-cli --version
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
12
39
|
|
|
13
40
|
## Quick Start
|
|
14
41
|
|
|
15
42
|
```bash
|
|
43
|
+
# Start interactive session
|
|
16
44
|
erosolar-cli
|
|
45
|
+
|
|
46
|
+
# Or use the short alias
|
|
47
|
+
erosolar
|
|
17
48
|
```
|
|
18
49
|
|
|
19
|
-
On first run, you'll
|
|
50
|
+
On first run, you'll see available providers based on your configured API keys:
|
|
20
51
|
|
|
21
|
-
|
|
52
|
+
```
|
|
53
|
+
✓ Providers: anthropic (claude-sonnet-4-5) | openai (gpt-4o) | deepseek (deepseek-reasoner)
|
|
54
|
+
ℹ Add: google: set GOOGLE_API_KEY, xai: set XAI_API_KEY
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Basic Workflow
|
|
58
|
+
|
|
59
|
+
1. **Ask a question or give a task** in natural language
|
|
60
|
+
2. **Watch the agent work** - see tool calls, reasoning, and results in real-time
|
|
61
|
+
3. **Iterate** - refine your request based on results
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
> find all TODO comments in the codebase
|
|
65
|
+
|
|
66
|
+
⏺ I'll search for TODO comments across the codebase.
|
|
67
|
+
|
|
68
|
+
⏺ Grep(pattern: "TODO", output_mode: "content")
|
|
69
|
+
⎿ Found 23 matches in 8 files
|
|
70
|
+
|
|
71
|
+
Here are the TODO comments I found:
|
|
72
|
+
- src/api/handler.ts:45 - TODO: Add rate limiting
|
|
73
|
+
- src/utils/cache.ts:12 - TODO: Implement TTL expiration
|
|
74
|
+
...
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
22
78
|
|
|
23
|
-
|
|
24
|
-
- **OpenAI** (GPT-4, GPT-4o)
|
|
25
|
-
- **Google** (Gemini)
|
|
26
|
-
- **DeepSeek** (deepseek-reasoner, deepseek-chat)
|
|
27
|
-
- **xAI** (Grok)
|
|
28
|
-
- **Ollama** (local models)
|
|
79
|
+
## Supported Providers
|
|
29
80
|
|
|
30
|
-
|
|
81
|
+
| Provider | Models | Environment Variable |
|
|
82
|
+
|----------|--------|---------------------|
|
|
83
|
+
| **Anthropic** | Claude Opus, Sonnet, Haiku | `ANTHROPIC_API_KEY` |
|
|
84
|
+
| **OpenAI** | GPT-4o, GPT-4, o1, o1-mini | `OPENAI_API_KEY` |
|
|
85
|
+
| **Google** | Gemini 2.0 Flash, 1.5 Pro | `GOOGLE_API_KEY` or `GEMINI_API_KEY` |
|
|
86
|
+
| **DeepSeek** | deepseek-reasoner, deepseek-chat | `DEEPSEEK_API_KEY` |
|
|
87
|
+
| **xAI** | Grok-2, Grok-beta | `XAI_API_KEY` |
|
|
88
|
+
| **Ollama** | Llama, Qwen, Mistral (local) | `OLLAMA_BASE_URL` (optional) |
|
|
89
|
+
| **Mistral** | Mistral Large, Codestral | `MISTRAL_API_KEY` |
|
|
90
|
+
| **Groq** | Llama 3.1, Mixtral (fast) | `GROQ_API_KEY` |
|
|
91
|
+
| **Together** | Various open models | `TOGETHER_API_KEY` |
|
|
92
|
+
| **Fireworks** | Various open models | `FIREWORKS_API_KEY` |
|
|
93
|
+
|
|
94
|
+
### Setting Up API Keys
|
|
31
95
|
|
|
32
96
|
```bash
|
|
33
|
-
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export DEEPSEEK_API_KEY=
|
|
37
|
-
export XAI_API_KEY=your-key
|
|
97
|
+
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
|
|
98
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
99
|
+
export OPENAI_API_KEY="sk-..."
|
|
100
|
+
export DEEPSEEK_API_KEY="sk-..."
|
|
38
101
|
```
|
|
39
102
|
|
|
40
|
-
|
|
103
|
+
### Switching Providers
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# In the CLI
|
|
107
|
+
/provider anthropic # Switch to Anthropic
|
|
108
|
+
/provider deepseek # Switch to DeepSeek
|
|
109
|
+
/providers # List all configured providers
|
|
110
|
+
```
|
|
41
111
|
|
|
42
|
-
|
|
112
|
+
---
|
|
43
113
|
|
|
44
|
-
|
|
114
|
+
## Core Concepts
|
|
45
115
|
|
|
46
116
|
### Transparent Reasoning
|
|
47
117
|
|
|
48
|
-
|
|
118
|
+
Every action is visible. The agent narrates its thought process and shows tool execution in real-time:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
⏺ I'll analyze the authentication module for security issues.
|
|
122
|
+
|
|
123
|
+
⏺ Read(src/auth/login.ts)
|
|
124
|
+
⎿ Read 156 lines
|
|
125
|
+
|
|
126
|
+
⏺ Grep(pattern: "password.*=", type: "ts")
|
|
127
|
+
⎿ Found 3 matches
|
|
49
128
|
|
|
129
|
+
Based on my analysis, I found a potential issue at line 42...
|
|
50
130
|
```
|
|
51
|
-
⏺ I'll analyze the codebase to find the bug.
|
|
52
131
|
|
|
53
|
-
|
|
54
|
-
⎿ Read 340 lines
|
|
132
|
+
### Schema-Driven Tools
|
|
55
133
|
|
|
56
|
-
|
|
57
|
-
|
|
134
|
+
All tools are defined in JSON schemas, making them:
|
|
135
|
+
- **Provider-agnostic**: Same tools work across all LLM providers
|
|
136
|
+
- **Self-documenting**: Schemas describe parameters and types
|
|
137
|
+
- **Extensible**: Add custom tools via plugins or MCP servers
|
|
58
138
|
|
|
59
|
-
|
|
139
|
+
### Context Management
|
|
140
|
+
|
|
141
|
+
The CLI tracks token usage and manages context efficiently:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
• Context 45% used (52.3k tokens) • Ready for prompts
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
- **Green** (<70%): Plenty of room
|
|
148
|
+
- **Yellow** (70-90%): Getting full
|
|
149
|
+
- **Red** (>90%): Approaching limit, consider `/clear`
|
|
150
|
+
|
|
151
|
+
### Session Persistence
|
|
152
|
+
|
|
153
|
+
Sessions auto-save and restore. Use `/sessions` to manage:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
/sessions list # Show saved sessions
|
|
157
|
+
/sessions load <name> # Load a session
|
|
158
|
+
/sessions save <name> # Save current session
|
|
60
159
|
```
|
|
61
160
|
|
|
62
|
-
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Usage Guide
|
|
63
164
|
|
|
64
|
-
|
|
165
|
+
### Natural Language Tasks
|
|
65
166
|
|
|
66
|
-
|
|
167
|
+
Just describe what you want:
|
|
67
168
|
|
|
68
|
-
|
|
169
|
+
```
|
|
170
|
+
> refactor the UserService class to use dependency injection
|
|
171
|
+
> write tests for the authentication module
|
|
172
|
+
> find and fix the memory leak in the event handler
|
|
173
|
+
> explain how the caching system works
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### File Operations
|
|
69
177
|
|
|
70
|
-
|
|
178
|
+
```
|
|
179
|
+
> read src/config.ts
|
|
180
|
+
> create a new utility file for date formatting
|
|
181
|
+
> rename all instances of 'userId' to 'accountId' in the api folder
|
|
182
|
+
```
|
|
71
183
|
|
|
72
|
-
|
|
184
|
+
### Code Analysis
|
|
73
185
|
|
|
74
|
-
|
|
186
|
+
```
|
|
187
|
+
> analyze the complexity of this codebase
|
|
188
|
+
> find all functions with more than 50 lines
|
|
189
|
+
> show the dependency graph for the auth module
|
|
190
|
+
```
|
|
75
191
|
|
|
76
|
-
|
|
192
|
+
### Git Operations
|
|
77
193
|
|
|
78
|
-
|
|
194
|
+
```
|
|
195
|
+
> show recent commits
|
|
196
|
+
> create a commit with a descriptive message
|
|
197
|
+
> what changed in the last PR?
|
|
198
|
+
```
|
|
79
199
|
|
|
80
|
-
###
|
|
200
|
+
### Multi-Step Tasks
|
|
81
201
|
|
|
82
|
-
|
|
202
|
+
For complex tasks, the agent uses a todo list to track progress:
|
|
83
203
|
|
|
84
204
|
```
|
|
85
|
-
|
|
205
|
+
> implement user authentication with JWT, tests, and documentation
|
|
206
|
+
|
|
207
|
+
⏺ Creating task list...
|
|
208
|
+
|
|
209
|
+
[1. [in_progress] Design JWT authentication flow
|
|
210
|
+
2. [pending] Implement login endpoint
|
|
211
|
+
3. [pending] Implement token refresh
|
|
212
|
+
4. [pending] Add middleware for protected routes
|
|
213
|
+
5. [pending] Write unit tests
|
|
214
|
+
6. [pending] Add API documentation]
|
|
86
215
|
```
|
|
87
216
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Commands Reference
|
|
220
|
+
|
|
221
|
+
### Provider & Model Commands
|
|
222
|
+
|
|
223
|
+
| Command | Description |
|
|
224
|
+
|---------|-------------|
|
|
225
|
+
| `/provider <name>` | Switch to a provider (openai, anthropic, etc.) |
|
|
226
|
+
| `/providers` | List all configured providers |
|
|
227
|
+
| `/model` | Interactive model selection menu |
|
|
228
|
+
| `/discover` | Auto-discover models from provider APIs |
|
|
229
|
+
|
|
230
|
+
### Session Commands
|
|
91
231
|
|
|
92
|
-
|
|
232
|
+
| Command | Description |
|
|
233
|
+
|---------|-------------|
|
|
234
|
+
| `/sessions list` | Show saved sessions |
|
|
235
|
+
| `/sessions save <name>` | Save current session |
|
|
236
|
+
| `/sessions load <name>` | Load a saved session |
|
|
237
|
+
| `/clear` | Clear conversation history |
|
|
93
238
|
|
|
94
|
-
|
|
239
|
+
### Tool Commands
|
|
95
240
|
|
|
96
|
-
|
|
241
|
+
| Command | Description |
|
|
242
|
+
|---------|-------------|
|
|
243
|
+
| `/tools` | Manage enabled tool suites |
|
|
244
|
+
| `/doctor` | Diagnose environment and credentials |
|
|
245
|
+
| `/checks` | Run repo validation (test/build/lint) |
|
|
97
246
|
|
|
98
|
-
|
|
247
|
+
### Display Commands
|
|
248
|
+
|
|
249
|
+
| Command | Description |
|
|
250
|
+
|---------|-------------|
|
|
251
|
+
| `/shortcuts` or `/keys` | Show keyboard shortcuts |
|
|
252
|
+
| `/thinking [mode]` | Set thinking display (concise/balanced/extended) |
|
|
253
|
+
| `/changes` | Show file modifications this session |
|
|
254
|
+
| `/metrics` | Show performance metrics |
|
|
255
|
+
|
|
256
|
+
### Other Commands
|
|
257
|
+
|
|
258
|
+
| Command | Description |
|
|
259
|
+
|---------|-------------|
|
|
260
|
+
| `/context` | Refresh workspace context |
|
|
261
|
+
| `/agents` | Switch agent profiles |
|
|
262
|
+
| `/skills` | Load skill bundles |
|
|
263
|
+
| `/local` | Manage local LLM providers |
|
|
99
264
|
|
|
100
265
|
### Keyboard Shortcuts
|
|
101
266
|
|
|
267
|
+
| Shortcut | Action |
|
|
268
|
+
|----------|--------|
|
|
269
|
+
| `Ctrl+C` | Cancel current operation |
|
|
270
|
+
| `Ctrl+D` | Exit (when input empty) |
|
|
271
|
+
| `Ctrl+G` | Compose multi-line message |
|
|
272
|
+
| `Ctrl+O` | Expand collapsed output |
|
|
273
|
+
| `Up/Down` | Navigate command history |
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Tool Capabilities
|
|
278
|
+
|
|
279
|
+
### Core Tools
|
|
280
|
+
|
|
281
|
+
| Tool Suite | Tools | Description |
|
|
282
|
+
|------------|-------|-------------|
|
|
283
|
+
| **Filesystem** | `read_file`, `write_file`, `list_files` | File I/O operations |
|
|
284
|
+
| **Edit** | `edit_file` | Surgical string replacement |
|
|
285
|
+
| **Search** | `grep_search`, `find_definition` | Code and text search |
|
|
286
|
+
| **Glob** | `glob_files` | Pattern-based file matching |
|
|
287
|
+
| **Bash** | `execute_command` | Sandboxed shell execution |
|
|
288
|
+
|
|
289
|
+
### Analysis Tools
|
|
290
|
+
|
|
291
|
+
| Tool Suite | Tools | Description |
|
|
292
|
+
|------------|-------|-------------|
|
|
293
|
+
| **Code Analysis** | `analyze_structure`, `dependency_graph` | AST and dependency analysis |
|
|
294
|
+
| **Code Quality** | `lint_check`, `complexity_metrics` | Quality inspection |
|
|
295
|
+
| **Refactoring** | `find_hotspots`, `impact_analysis` | Refactoring assistance |
|
|
296
|
+
| **Testing** | `run_tests`, `coverage_report` | Test execution |
|
|
297
|
+
|
|
298
|
+
### Integration Tools
|
|
299
|
+
|
|
300
|
+
| Tool Suite | Tools | Description |
|
|
301
|
+
|------------|-------|-------------|
|
|
302
|
+
| **Web** | `fetch_url`, `web_search` | HTTP and search |
|
|
303
|
+
| **Git** | `git_status`, `git_diff`, `git_commit` | Version control |
|
|
304
|
+
| **MCP** | Dynamic | Model Context Protocol servers |
|
|
305
|
+
| **Agent Spawning** | `spawn_agent` | Sub-agent delegation |
|
|
306
|
+
|
|
307
|
+
### Task Management
|
|
308
|
+
|
|
309
|
+
| Tool Suite | Tools | Description |
|
|
310
|
+
|------------|-------|-------------|
|
|
311
|
+
| **Todo** | `todo_write`, `todo_read` | Task tracking |
|
|
312
|
+
| **Planning** | `create_plan`, `update_plan` | Multi-step planning |
|
|
313
|
+
| **Interaction** | `ask_user` | User clarification |
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Schema Architecture
|
|
318
|
+
|
|
319
|
+
Erosolar CLI uses a **unified schema architecture** for configuration, providers, tools, and agent behavior. All schemas are JSON-based and version-controlled.
|
|
320
|
+
|
|
321
|
+
### Schema Hierarchy
|
|
322
|
+
|
|
102
323
|
```
|
|
103
|
-
/
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
324
|
+
contracts/
|
|
325
|
+
├── unified-schema.json # Master schema - single source of truth
|
|
326
|
+
├── agent-schemas.json # Agent and model configurations
|
|
327
|
+
├── tools.schema.json # Tool capability definitions
|
|
328
|
+
├── agent-profiles.schema.json
|
|
329
|
+
└── schemas/
|
|
330
|
+
├── agent.schema.json
|
|
331
|
+
├── agent-profile.schema.json
|
|
332
|
+
├── agent-rules.schema.json
|
|
333
|
+
├── agent-schemas.schema.json
|
|
334
|
+
└── tool-selection.schema.json
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Unified Schema (unified-schema.json)
|
|
338
|
+
|
|
339
|
+
The master schema defines all providers, models, and capabilities:
|
|
340
|
+
|
|
341
|
+
```json
|
|
342
|
+
{
|
|
343
|
+
"contractVersion": "2.0.0",
|
|
344
|
+
"providers": [
|
|
345
|
+
{
|
|
346
|
+
"id": "anthropic",
|
|
347
|
+
"label": "Anthropic",
|
|
348
|
+
"baseUrl": "https://api.anthropic.com",
|
|
349
|
+
"envVars": { "apiKey": "ANTHROPIC_API_KEY" },
|
|
350
|
+
"capabilities": ["chat", "reasoning", "tools", "streaming", "vision"],
|
|
351
|
+
"models": ["claude-opus-4-5-20251101", "claude-sonnet-4-5-20250929"],
|
|
352
|
+
"defaultModel": "claude-sonnet-4-5-20250929"
|
|
353
|
+
}
|
|
354
|
+
]
|
|
355
|
+
}
|
|
109
356
|
```
|
|
110
357
|
|
|
358
|
+
### Provider Schema
|
|
359
|
+
|
|
360
|
+
Each provider defines:
|
|
361
|
+
|
|
362
|
+
| Field | Description |
|
|
363
|
+
|-------|-------------|
|
|
364
|
+
| `id` | Unique identifier (e.g., "anthropic") |
|
|
365
|
+
| `baseUrl` | API endpoint |
|
|
366
|
+
| `envVars` | Required environment variables |
|
|
367
|
+
| `capabilities` | Supported features (chat, tools, streaming, vision) |
|
|
368
|
+
| `models` | Available model IDs |
|
|
369
|
+
| `openaiCompatible` | If true, uses OpenAI-compatible API |
|
|
370
|
+
|
|
371
|
+
### Tool Schema (tools.schema.json)
|
|
372
|
+
|
|
373
|
+
Tools are organized into capability suites:
|
|
374
|
+
|
|
375
|
+
```json
|
|
376
|
+
{
|
|
377
|
+
"options": [
|
|
378
|
+
{
|
|
379
|
+
"id": "filesystem",
|
|
380
|
+
"label": "File operations",
|
|
381
|
+
"defaultEnabled": true,
|
|
382
|
+
"category": "core",
|
|
383
|
+
"scopes": ["filesystem:read", "filesystem:write"],
|
|
384
|
+
"pluginIds": ["tool.filesystem.local"]
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
### Agent Rules (agents/*.rules.json)
|
|
391
|
+
|
|
392
|
+
Agent behavior is controlled by rules:
|
|
393
|
+
|
|
394
|
+
```json
|
|
395
|
+
{
|
|
396
|
+
"profile": "erosolar-code",
|
|
397
|
+
"globalPrinciples": [
|
|
398
|
+
{
|
|
399
|
+
"id": "guardrail.snapshot_lock",
|
|
400
|
+
"summary": "Require workspace snapshot before editing",
|
|
401
|
+
"severity": "critical"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"id": "guardrail.tool_transparency",
|
|
405
|
+
"summary": "Narrate intent before running tools",
|
|
406
|
+
"severity": "required"
|
|
407
|
+
}
|
|
408
|
+
]
|
|
409
|
+
}
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
### Type System (src/core/types.ts)
|
|
413
|
+
|
|
414
|
+
TypeScript types mirror the JSON schemas:
|
|
415
|
+
|
|
416
|
+
```typescript
|
|
417
|
+
export interface LLMProvider {
|
|
418
|
+
readonly id: ProviderId;
|
|
419
|
+
readonly model: string;
|
|
420
|
+
generate(messages: ConversationMessage[], tools: ProviderToolDefinition[]): Promise<ProviderResponse>;
|
|
421
|
+
generateStream?(messages: ConversationMessage[], tools: ProviderToolDefinition[]): AsyncIterableIterator<StreamChunk>;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export interface ProviderToolDefinition {
|
|
425
|
+
name: string;
|
|
426
|
+
description: string;
|
|
427
|
+
parameters?: JSONSchemaObject;
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### Model Discovery
|
|
432
|
+
|
|
433
|
+
Models can be statically defined or auto-discovered:
|
|
434
|
+
|
|
435
|
+
```typescript
|
|
436
|
+
// Discover models from provider APIs
|
|
437
|
+
const result = await discoverAllModels();
|
|
438
|
+
// Returns models from OpenAI, Anthropic, Google, etc.
|
|
439
|
+
|
|
440
|
+
// Get best model for a provider
|
|
441
|
+
const best = getBestModel('anthropic', models);
|
|
442
|
+
// Returns highest-priority model based on rankings
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
111
447
|
## Configuration
|
|
112
448
|
|
|
113
449
|
### Agent Profiles
|
|
114
450
|
|
|
115
|
-
Profiles define provider, model, and behavior
|
|
451
|
+
Profiles define provider, model, and behavior. Located in `agents/`:
|
|
452
|
+
|
|
453
|
+
```json
|
|
454
|
+
{
|
|
455
|
+
"profile": "erosolar-code",
|
|
456
|
+
"label": "Erosolar Code",
|
|
457
|
+
"defaultProvider": "openai",
|
|
458
|
+
"defaultModel": "gpt-4o",
|
|
459
|
+
"systemPrompt": "You are an expert coding assistant..."
|
|
460
|
+
}
|
|
461
|
+
```
|
|
116
462
|
|
|
117
463
|
### MCP Servers
|
|
118
464
|
|
|
119
|
-
Add `.mcp.json` or `.erosolar/mcp.json
|
|
465
|
+
Add Model Context Protocol servers via `.mcp.json` or `.erosolar/mcp.json`:
|
|
120
466
|
|
|
121
467
|
```json
|
|
122
468
|
{
|
|
123
469
|
"filesystem": {
|
|
124
470
|
"command": "npx",
|
|
125
471
|
"args": ["-y", "@modelcontextprotocol/server-filesystem", "${WORKSPACE_ROOT}"]
|
|
472
|
+
},
|
|
473
|
+
"github": {
|
|
474
|
+
"command": "npx",
|
|
475
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
476
|
+
"env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
|
|
126
477
|
}
|
|
127
478
|
}
|
|
128
479
|
```
|
|
@@ -131,45 +482,172 @@ Add `.mcp.json` or `.erosolar/mcp.json` to your workspace:
|
|
|
131
482
|
|
|
132
483
|
Load reusable knowledge bundles from `SKILL.md` files:
|
|
133
484
|
|
|
485
|
+
```markdown
|
|
486
|
+
<!-- SKILL.md -->
|
|
487
|
+
# React Component Development
|
|
488
|
+
|
|
489
|
+
## Principles
|
|
490
|
+
- Use functional components with hooks
|
|
491
|
+
- Implement proper error boundaries
|
|
492
|
+
- Follow accessibility guidelines
|
|
493
|
+
|
|
494
|
+
## Patterns
|
|
495
|
+
```typescript
|
|
496
|
+
const Component: FC<Props> = ({ data }) => {
|
|
497
|
+
const [state, setState] = useState(initial);
|
|
498
|
+
// ...
|
|
499
|
+
};
|
|
134
500
|
```
|
|
135
|
-
/skill plugin-dev:skill-development
|
|
136
501
|
```
|
|
137
502
|
|
|
138
|
-
|
|
503
|
+
Load with `/skill <name>` or reference in prompts.
|
|
139
504
|
|
|
140
|
-
|
|
505
|
+
### Tool Settings
|
|
141
506
|
|
|
142
|
-
|
|
143
|
-
|
|
507
|
+
Configure which tools are enabled via `/tools` command or `~/.erosolar/tools.json`:
|
|
508
|
+
|
|
509
|
+
```json
|
|
510
|
+
{
|
|
511
|
+
"enabled": ["filesystem", "search", "bash", "edit"],
|
|
512
|
+
"disabled": ["web"]
|
|
513
|
+
}
|
|
144
514
|
```
|
|
145
515
|
|
|
516
|
+
---
|
|
517
|
+
|
|
146
518
|
## Development
|
|
147
519
|
|
|
520
|
+
### Setup
|
|
521
|
+
|
|
148
522
|
```bash
|
|
149
523
|
git clone https://github.com/ErosolarAI/erosolar-by-bo.git
|
|
150
524
|
cd erosolar-by-bo
|
|
151
525
|
npm install
|
|
152
526
|
npm run build
|
|
153
|
-
npm run dev
|
|
154
527
|
```
|
|
155
528
|
|
|
156
|
-
###
|
|
529
|
+
### Development Mode
|
|
530
|
+
|
|
531
|
+
```bash
|
|
532
|
+
npm run dev # Run with ts-node
|
|
533
|
+
npm run build # Compile TypeScript
|
|
534
|
+
npm run type-check # Check types only
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
### Testing
|
|
157
538
|
|
|
158
539
|
```bash
|
|
159
|
-
npm
|
|
160
|
-
npm run
|
|
161
|
-
npm
|
|
162
|
-
npm run
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
540
|
+
npm test # Run test suite
|
|
541
|
+
npm run lint # Run ESLint
|
|
542
|
+
npm run health-check # Validate core components
|
|
543
|
+
npm run quality-gate # All quality checks
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### Project Structure
|
|
547
|
+
|
|
548
|
+
```
|
|
549
|
+
src/
|
|
550
|
+
├── bin/ # CLI entry point
|
|
551
|
+
├── core/ # Core types, agent, context management
|
|
552
|
+
│ ├── agent.ts
|
|
553
|
+
│ ├── types.ts
|
|
554
|
+
│ ├── modelDiscovery.ts
|
|
555
|
+
│ └── unified/ # Unified schema runtime
|
|
556
|
+
├── providers/ # LLM provider implementations
|
|
557
|
+
│ ├── anthropicProvider.ts
|
|
558
|
+
│ ├── openaiResponsesProvider.ts
|
|
559
|
+
│ └── googleProvider.ts
|
|
560
|
+
├── capabilities/ # Tool implementations
|
|
561
|
+
│ ├── filesystemCapability.ts
|
|
562
|
+
│ ├── searchCapability.ts
|
|
563
|
+
│ └── bashCapability.ts
|
|
564
|
+
├── shell/ # Interactive shell
|
|
565
|
+
│ ├── shellApp.ts
|
|
566
|
+
│ └── interactiveShell.ts
|
|
567
|
+
├── ui/ # Display and theming
|
|
568
|
+
├── plugins/ # Plugin system
|
|
569
|
+
├── contracts/ # JSON schemas
|
|
570
|
+
└── mcp/ # MCP client
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
### Adding a Provider
|
|
574
|
+
|
|
575
|
+
1. Create provider in `src/providers/`:
|
|
576
|
+
|
|
577
|
+
```typescript
|
|
578
|
+
export class CustomProvider implements LLMProvider {
|
|
579
|
+
readonly id = 'custom';
|
|
580
|
+
readonly model: string;
|
|
581
|
+
|
|
582
|
+
async generate(messages, tools) {
|
|
583
|
+
// Implementation
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
async *generateStream(messages, tools) {
|
|
587
|
+
// Streaming implementation
|
|
588
|
+
}
|
|
589
|
+
}
|
|
166
590
|
```
|
|
167
591
|
|
|
592
|
+
2. Register in `src/plugins/providers/`:
|
|
593
|
+
|
|
594
|
+
```typescript
|
|
595
|
+
registerProvider('custom', (config) => new CustomProvider(config));
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
3. Add to `unified-schema.json`:
|
|
599
|
+
|
|
600
|
+
```json
|
|
601
|
+
{
|
|
602
|
+
"id": "custom",
|
|
603
|
+
"label": "Custom Provider",
|
|
604
|
+
"envVars": { "apiKey": "CUSTOM_API_KEY" },
|
|
605
|
+
"capabilities": ["chat", "tools", "streaming"]
|
|
606
|
+
}
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
### Adding a Tool
|
|
610
|
+
|
|
611
|
+
1. Create capability in `src/capabilities/`:
|
|
612
|
+
|
|
613
|
+
```typescript
|
|
614
|
+
export function createCustomTools(): ProviderToolDefinition[] {
|
|
615
|
+
return [{
|
|
616
|
+
name: 'custom_tool',
|
|
617
|
+
description: 'Does something useful',
|
|
618
|
+
parameters: {
|
|
619
|
+
type: 'object',
|
|
620
|
+
properties: {
|
|
621
|
+
input: { type: 'string', description: 'Input value' }
|
|
622
|
+
},
|
|
623
|
+
required: ['input']
|
|
624
|
+
}
|
|
625
|
+
}];
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
export async function executeCustomTool(args: { input: string }) {
|
|
629
|
+
// Implementation
|
|
630
|
+
return { result: 'success' };
|
|
631
|
+
}
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
2. Register in tool registry
|
|
635
|
+
|
|
636
|
+
3. Add to `tools.schema.json`
|
|
637
|
+
|
|
638
|
+
---
|
|
639
|
+
|
|
168
640
|
## License
|
|
169
641
|
|
|
170
642
|
MIT
|
|
171
643
|
|
|
172
644
|
## Links
|
|
173
645
|
|
|
646
|
+
- [npm Package](https://www.npmjs.com/package/erosolar-cli)
|
|
174
647
|
- [GitHub Repository](https://github.com/ErosolarAI/erosolar-by-bo)
|
|
175
648
|
- [Issues](https://github.com/ErosolarAI/erosolar-by-bo/issues)
|
|
649
|
+
|
|
650
|
+
## Support
|
|
651
|
+
|
|
652
|
+
- Email: support@ero.solar
|
|
653
|
+
- GitHub Issues for bug reports and feature requests
|