@getnella/latest 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/README.md +286 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +28822 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +80 -0
- package/dist/index.js +26616 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/index.d.ts +31 -0
- package/dist/mcp/index.js +27506 -0
- package/dist/mcp/index.js.map +1 -0
- package/package.json +93 -0
package/README.md
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# @usenella/nella
|
|
2
|
+
|
|
3
|
+
> Unified CLI and MCP Server for AI agent validation
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@usenella/nella)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
Nella is a complete validation toolkit for AI coding agents. It provides both a CLI for direct use and an MCP (Model Context Protocol) server for integration with AI assistants like Claude.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Global installation
|
|
14
|
+
npm install -g @usenella/nella
|
|
15
|
+
|
|
16
|
+
# Or use with npx
|
|
17
|
+
npx @usenella/nella --help
|
|
18
|
+
|
|
19
|
+
# As a dev dependency
|
|
20
|
+
npm install -D @usenella/nella
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
### CLI Usage
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Pre-flight check before running an agent
|
|
29
|
+
nella check -t ./tasks/my-task -r ./project
|
|
30
|
+
|
|
31
|
+
# Validate agent changes
|
|
32
|
+
nella validate -t ./tasks/my-task -r ./project -c changes.json
|
|
33
|
+
|
|
34
|
+
# Full validation run with metrics
|
|
35
|
+
nella run -t ./tasks/my-task -r ./project -c changes.json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### MCP Server (for Claude Desktop)
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Start MCP server
|
|
42
|
+
nella mcp --workspace /path/to/project
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Playground Server
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Start playground with real-time dashboard
|
|
49
|
+
nella playground --workspace /path/to/project
|
|
50
|
+
|
|
51
|
+
# With custom port
|
|
52
|
+
nella playground --workspace /path/to/project --port 4000
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Open `http://localhost:3847` to view the dashboard with:
|
|
56
|
+
- Real-time tool call monitoring
|
|
57
|
+
- Chain of thought visualization
|
|
58
|
+
- Cost tracking (tokens + estimated $)
|
|
59
|
+
- Session management
|
|
60
|
+
|
|
61
|
+
## Commands
|
|
62
|
+
|
|
63
|
+
### `nella check`
|
|
64
|
+
|
|
65
|
+
Pre-flight check to determine if a task can proceed.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
nella check --task <path> --repo <path> [options]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Detects:
|
|
72
|
+
- Risk patterns (dangerous requests like logging passwords)
|
|
73
|
+
- Missing prerequisites (package.json, node_modules)
|
|
74
|
+
- Invalid task structure
|
|
75
|
+
|
|
76
|
+
### `nella validate`
|
|
77
|
+
|
|
78
|
+
Validate agent changes against task constraints.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
nella validate --task <path> --repo <path> --changes <path> [options]
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Validates:
|
|
85
|
+
- Constraint violations (forbidden files, patterns)
|
|
86
|
+
- Scope creep (unexpected file modifications)
|
|
87
|
+
- Test/lint/compile commands (unless `--skip-validation`)
|
|
88
|
+
|
|
89
|
+
### `nella run`
|
|
90
|
+
|
|
91
|
+
Full validation run combining check + validate + metrics.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
nella run --task <path> --repo <path> [--changes <path>] [options]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Includes:
|
|
98
|
+
- All checks from `check` and `validate`
|
|
99
|
+
- Metrics calculation
|
|
100
|
+
- Artifact generation in `.nella/runs/`
|
|
101
|
+
|
|
102
|
+
### `nella mcp`
|
|
103
|
+
|
|
104
|
+
Start an MCP server for AI agent integration.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
nella mcp [--workspace <path>]
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### `nella playground`
|
|
111
|
+
|
|
112
|
+
Start the playground server with a real-time dashboard.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
nella playground [--workspace <path>] [--port <number>] [--host <host>]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Features:
|
|
119
|
+
- **Dashboard UI** — Visual interface for monitoring agent sessions
|
|
120
|
+
- **WebSocket updates** — Real-time tool calls, chain of thought, cost tracking
|
|
121
|
+
- **HTTP API** — `/health`, `/api/status`, `/api/session/:id` endpoints
|
|
122
|
+
|
|
123
|
+
## MCP Integration
|
|
124
|
+
|
|
125
|
+
### Claude Desktop Setup
|
|
126
|
+
|
|
127
|
+
Add to your Claude Desktop config:
|
|
128
|
+
|
|
129
|
+
**Windows** (`%APPDATA%\Claude\claude_desktop_config.json`):
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"mcpServers": {
|
|
134
|
+
"nella": {
|
|
135
|
+
"command": "npx",
|
|
136
|
+
"args": ["@usenella/nella", "mcp", "--workspace", "C:/path/to/project"]
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**macOS/Linux** (`~/.config/Claude/claude_desktop_config.json`):
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"mcpServers": {
|
|
147
|
+
"nella": {
|
|
148
|
+
"command": "npx",
|
|
149
|
+
"args": ["@usenella/nella", "mcp", "--workspace", "/path/to/project"]
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Available MCP Tools
|
|
156
|
+
|
|
157
|
+
| Tool | Description |
|
|
158
|
+
|------|-------------|
|
|
159
|
+
| `nella_check` | Pre-flight task validation |
|
|
160
|
+
| `nella_validate` | Validate agent changes against constraints |
|
|
161
|
+
| `nella_run` | Full validation run with metrics |
|
|
162
|
+
| `nella_detect_risks` | Detect dangerous patterns in prompts |
|
|
163
|
+
| `nella_should_refuse` | Check if a task should be refused |
|
|
164
|
+
| `nella_check_prerequisites` | Verify project prerequisites |
|
|
165
|
+
| `nella_get_context` | Get current validation context |
|
|
166
|
+
| `nella_add_assumption` | Add a context assumption |
|
|
167
|
+
| `nella_check_assumptions` | Validate all assumptions |
|
|
168
|
+
| `nella_get_file_history` | Track file modification history |
|
|
169
|
+
| `nella_check_dependencies` | Verify project dependencies |
|
|
170
|
+
| `nella_record_change` | Record a file change for validation |
|
|
171
|
+
|
|
172
|
+
## CLI Options
|
|
173
|
+
|
|
174
|
+
| Option | Short | Description |
|
|
175
|
+
|--------|-------|-------------|
|
|
176
|
+
| `--task <path>` | `-t` | Path to task.yaml or task directory |
|
|
177
|
+
| `--repo <path>` | `-r` | Path to repository |
|
|
178
|
+
| `--changes <path>` | `-c` | Path to changes.json file |
|
|
179
|
+
| `--workspace <path>` | `-w` | Path to workspace (for `mcp`/`playground`) |
|
|
180
|
+
| `--port <number>` | `-p` | Port for playground server (default: 3847) |
|
|
181
|
+
| `--host <host>` | | Host for playground server (default: localhost) |
|
|
182
|
+
| `--skip-validation` | | Skip test/lint/compile commands |
|
|
183
|
+
| `--skip-prerequisites` | | Skip package.json/node_modules checks |
|
|
184
|
+
| `--json` | | Output as JSON |
|
|
185
|
+
| `--help` | `-h` | Show help |
|
|
186
|
+
|
|
187
|
+
## Programmatic Usage
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
// Core validation functions
|
|
191
|
+
import {
|
|
192
|
+
runTask,
|
|
193
|
+
check,
|
|
194
|
+
validate,
|
|
195
|
+
checkConstraints,
|
|
196
|
+
detectRiskPatterns,
|
|
197
|
+
} from '@usenella/nella';
|
|
198
|
+
|
|
199
|
+
// MCP server
|
|
200
|
+
import { startMcpServer } from '@usenella/nella/mcp';
|
|
201
|
+
|
|
202
|
+
// Example: Run validation programmatically
|
|
203
|
+
const result = await runTask(repoPath, task, changes);
|
|
204
|
+
console.log(result.passed ? 'Validation passed!' : 'Validation failed');
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Core Modules (Re-exported)
|
|
208
|
+
|
|
209
|
+
`@usenella/nella` re-exports everything from `@usenella/core`, including advanced modules:
|
|
210
|
+
|
|
211
|
+
- Indexing & search (RAG)
|
|
212
|
+
- Workspace management
|
|
213
|
+
- Auth + rate limiting
|
|
214
|
+
- Context sharing
|
|
215
|
+
- Cloud sync (GCS)
|
|
216
|
+
- Playground server
|
|
217
|
+
|
|
218
|
+
See the [Core Modules guide](../../docs/core/modules.md) for examples.
|
|
219
|
+
|
|
220
|
+
## Task YAML Format
|
|
221
|
+
|
|
222
|
+
```yaml
|
|
223
|
+
id: my-task
|
|
224
|
+
name: "Task description"
|
|
225
|
+
prompt: |
|
|
226
|
+
Your task prompt here...
|
|
227
|
+
category: feature # feature | bug-fix | refactor | edge-case | refusal
|
|
228
|
+
difficulty: easy # easy | medium | hard
|
|
229
|
+
fixture: my-project
|
|
230
|
+
|
|
231
|
+
constraints:
|
|
232
|
+
- id: no-auth-changes
|
|
233
|
+
description: "Do not modify authentication"
|
|
234
|
+
files_not_to_modify:
|
|
235
|
+
- "src/auth/**"
|
|
236
|
+
forbidden_patterns:
|
|
237
|
+
- "console\\.log"
|
|
238
|
+
|
|
239
|
+
validation:
|
|
240
|
+
test: "npm run test"
|
|
241
|
+
lint: "npm run lint"
|
|
242
|
+
compile: "npm run check:types"
|
|
243
|
+
|
|
244
|
+
expected:
|
|
245
|
+
files_to_modify:
|
|
246
|
+
- "src/routes/users.ts"
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Changes JSON Format
|
|
250
|
+
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"files": [
|
|
254
|
+
{
|
|
255
|
+
"path": "src/users.ts",
|
|
256
|
+
"operation": "modify",
|
|
257
|
+
"content": "// Full file content..."
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Exit Codes
|
|
264
|
+
|
|
265
|
+
| Code | Meaning |
|
|
266
|
+
|------|---------|
|
|
267
|
+
| `0` | Success / OK to proceed / Validation passed |
|
|
268
|
+
| `1` | Failure / Should refuse / Validation failed |
|
|
269
|
+
|
|
270
|
+
## Related Packages
|
|
271
|
+
|
|
272
|
+
- [`@usenella/core`](https://www.npmjs.com/package/@usenella/core) - Core validation library
|
|
273
|
+
- [`@usenella/benchmark`](https://www.npmjs.com/package/@usenella/benchmark) - Benchmarking tools
|
|
274
|
+
|
|
275
|
+
## Documentation
|
|
276
|
+
|
|
277
|
+
Full documentation available at:
|
|
278
|
+
- [CLI Commands](../../docs/cli/commands.md)
|
|
279
|
+
- [MCP Integration](../../docs/mcp/integration.md)
|
|
280
|
+
- [Core API Reference](../../docs/core/api-reference.md)
|
|
281
|
+
- [Core Modules](../../docs/core/modules.md)
|
|
282
|
+
- [Examples](../../docs/core/examples.md)
|
|
283
|
+
|
|
284
|
+
## License
|
|
285
|
+
|
|
286
|
+
MIT © [Nella Labs](https://github.com/usenella)
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|