ralph-cli-sandboxed 0.6.2 → 0.6.4
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 +9 -5
- package/dist/commands/branch.js +113 -78
- package/dist/commands/chat.js +90 -30
- package/dist/commands/docker.js +192 -11
- package/dist/commands/fix-prd.js +2 -2
- package/dist/commands/help.js +2 -2
- package/dist/commands/init.js +6 -0
- package/dist/commands/once.js +4 -0
- package/dist/commands/prd.js +22 -2
- package/dist/commands/progress.js +2 -1
- package/dist/commands/run.js +24 -3
- package/dist/config/cli-providers.json +18 -0
- package/dist/tui/components/SectionNav.js +6 -0
- package/dist/utils/config.d.ts +1 -0
- package/dist/utils/prd-validator.d.ts +5 -0
- package/dist/utils/prd-validator.js +75 -6
- package/dist/utils/vcs-git.d.ts +36 -0
- package/dist/utils/vcs-git.js +193 -0
- package/dist/utils/vcs-jj.d.ts +36 -0
- package/dist/utils/vcs-jj.js +214 -0
- package/dist/utils/vcs.d.ts +85 -0
- package/dist/utils/vcs.js +56 -0
- package/docs/BRANCHING.md +22 -29
- package/docs/CHAT-CLIENTS.md +13 -17
- package/docs/CHAT-RESPONDERS.md +3 -3
- package/docs/DEVELOPMENT.md +45 -7
- package/docs/DOCKER.md +5 -4
- package/docs/FAQ.md +125 -0
- package/docs/HOW-TO-WRITE-PRDs.md +5 -8
- package/docs/MACOS-DEVELOPMENT.md +3 -3
- package/docs/PRD-GENERATOR.md +11 -12
- package/docs/RALPH-SETUP-TEMPLATE.md +56 -24
- package/docs/SECURITY.md +4 -2
- package/docs/SKILLS.md +3 -3
- package/docs/chat-architecture.md +37 -30
- package/docs/run-state-machine.md +13 -4
- package/package.json +1 -1
|
@@ -89,29 +89,30 @@ Set up a Ralph CLI project based on the configuration above.
|
|
|
89
89
|
|
|
90
90
|
| Stack | language | checkCommand | testCommand |
|
|
91
91
|
|-------|----------|--------------|-------------|
|
|
92
|
-
| Node/TS (
|
|
93
|
-
| Node/TS (
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
| Python | `pypi.org`, `files.pythonhosted.org
|
|
107
|
-
| Go | `proxy.golang.org`, `sum.golang.org
|
|
108
|
-
| Rust | `crates.io`, `static.crates.io
|
|
92
|
+
| Node/TS (npm) | `node` | `npm run typecheck` | `npm test` |
|
|
93
|
+
| Node/TS (bun) | `bun` | `bun check` | `bun test` |
|
|
94
|
+
| Python | `python` | `mypy .` | `pytest` |
|
|
95
|
+
| Go | `go` | `go build ./...` | `go test ./...` |
|
|
96
|
+
| Rust | `rust` | `cargo check` | `cargo test` |
|
|
97
|
+
|
|
98
|
+
### Firewall Domains
|
|
99
|
+
|
|
100
|
+
The Docker firewall allows these domains by default: `github.com`, `api.github.com`, `raw.githubusercontent.com`, `registry.npmjs.org`, `api.anthropic.com`.
|
|
101
|
+
|
|
102
|
+
Add additional domains to `docker.firewall.allowedDomains` in `.ralph/config.json` based on your stack:
|
|
103
|
+
|
|
104
|
+
| Stack | Recommended Additions |
|
|
105
|
+
|-------|----------------------|
|
|
106
|
+
| Python | `pypi.org`, `files.pythonhosted.org` |
|
|
107
|
+
| Go | `proxy.golang.org`, `sum.golang.org` |
|
|
108
|
+
| Rust | `crates.io`, `static.crates.io` |
|
|
109
109
|
|
|
110
110
|
### API Provider Domains
|
|
111
111
|
|
|
112
|
+
Add these to `docker.firewall.allowedDomains` if using external APIs:
|
|
113
|
+
|
|
112
114
|
| Provider | Domains |
|
|
113
115
|
|----------|---------|
|
|
114
|
-
| Anthropic Claude | `api.anthropic.com` |
|
|
115
116
|
| OpenAI | `api.openai.com` |
|
|
116
117
|
| Google AI | `generativelanguage.googleapis.com` |
|
|
117
118
|
| AWS | `*.amazonaws.com` |
|
|
@@ -124,6 +125,8 @@ Set up a Ralph CLI project based on the configuration above.
|
|
|
124
125
|
|
|
125
126
|
### Notifications Config
|
|
126
127
|
|
|
128
|
+
Supported providers: `ntfy`, `pushover`, `gotify`, `command`.
|
|
129
|
+
|
|
127
130
|
Using ntfy (recommended - no install needed):
|
|
128
131
|
```json
|
|
129
132
|
{
|
|
@@ -137,6 +140,32 @@ Using ntfy (recommended - no install needed):
|
|
|
137
140
|
}
|
|
138
141
|
```
|
|
139
142
|
|
|
143
|
+
Using pushover:
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"notifications": {
|
|
147
|
+
"provider": "pushover",
|
|
148
|
+
"pushover": {
|
|
149
|
+
"user": "your-user-key",
|
|
150
|
+
"token": "your-app-token"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Using gotify:
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"notifications": {
|
|
160
|
+
"provider": "gotify",
|
|
161
|
+
"gotify": {
|
|
162
|
+
"server": "https://gotify.example.com",
|
|
163
|
+
"token": "your-app-token"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
140
169
|
Using custom command:
|
|
141
170
|
```json
|
|
142
171
|
{
|
|
@@ -205,10 +234,14 @@ Log task completions and ralph finished to file:
|
|
|
205
234
|
```
|
|
206
235
|
|
|
207
236
|
Chat commands (send in Telegram):
|
|
208
|
-
- `/run` - Start ralph automation
|
|
237
|
+
- `/run [category]` - Start ralph automation
|
|
209
238
|
- `/status` - Show PRD progress
|
|
239
|
+
- `/stop` - Stop a running ralph process
|
|
210
240
|
- `/add [desc]` - Add new task
|
|
211
241
|
- `/exec [cmd]` - Execute shell command
|
|
242
|
+
- `/action [name]` - Execute a daemon action
|
|
243
|
+
- `/claude [prompt]` - Run Claude Code with a prompt
|
|
244
|
+
- `/branch [subcommand]` - Manage git branches
|
|
212
245
|
- `/help` - Show help
|
|
213
246
|
|
|
214
247
|
### PRD Task Categories
|
|
@@ -216,12 +249,11 @@ Chat commands (send in Telegram):
|
|
|
216
249
|
| Category | Use For |
|
|
217
250
|
|----------|---------|
|
|
218
251
|
| `setup` | Project initialization, dependency installation |
|
|
219
|
-
| `config` | Environment variables, configuration files |
|
|
220
252
|
| `feature` | New functionality implementation |
|
|
221
|
-
| `integration` | External API clients, third-party services |
|
|
222
|
-
| `test` | Unit tests, integration tests |
|
|
223
|
-
| `refactor` | Code restructuring without behavior change |
|
|
224
253
|
| `bugfix` | Bug fixes |
|
|
254
|
+
| `ui` | User interface changes |
|
|
255
|
+
| `development` | Development tooling, build configuration |
|
|
256
|
+
| `testing` | Unit tests, integration tests |
|
|
225
257
|
| `docs` | Documentation |
|
|
226
258
|
|
|
227
259
|
### PRD Guidelines
|
|
@@ -231,7 +263,7 @@ Chat commands (send in Telegram):
|
|
|
231
263
|
- Include 2-4 concrete steps per task
|
|
232
264
|
- End with a verification step (build, typecheck, test)
|
|
233
265
|
- All tasks start with `"passes": false`
|
|
234
|
-
- Order by dependency: setup ->
|
|
266
|
+
- Order by dependency: setup -> development -> feature -> testing -> docs
|
|
235
267
|
|
|
236
268
|
### Sandbox Safety
|
|
237
269
|
|
package/docs/SECURITY.md
CHANGED
|
@@ -20,7 +20,9 @@ When running inside a container, ralph automatically passes the appropriate auto
|
|
|
20
20
|
| AMP | `--dangerously-allow-all` | ✅ Supported |
|
|
21
21
|
| Aider | `--yes-always` | ✅ Supported |
|
|
22
22
|
| Goose | (none needed) | ✅ Supported |
|
|
23
|
-
| OpenCode |
|
|
23
|
+
| OpenCode | (none) | ❌ Not yet implemented |
|
|
24
|
+
| Ollama | (none needed) | ✅ Supported |
|
|
25
|
+
| Custom | (none) | ⚙️ User-configured |
|
|
24
26
|
|
|
25
27
|
For providers without autonomous mode support, you may need to manually approve actions during execution.
|
|
26
28
|
|
|
@@ -64,7 +66,7 @@ For Claude Code users with Pro/Max subscriptions, the `~/.claude` directory is m
|
|
|
64
66
|
|
|
65
67
|
```yaml
|
|
66
68
|
volumes:
|
|
67
|
-
- ~/.claude:/home/node/.claude
|
|
69
|
+
- ~/.claude:/home/node/.claude
|
|
68
70
|
```
|
|
69
71
|
|
|
70
72
|
This allows the AI agent to use your existing OAuth credentials without exposing API keys.
|
package/docs/SKILLS.md
CHANGED
|
@@ -174,11 +174,11 @@ Target project-specific requirements:
|
|
|
174
174
|
|
|
175
175
|
## How Skills Are Applied
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
During `ralph docker init`:
|
|
178
178
|
|
|
179
179
|
1. Skills from `claude.skills` are loaded from config
|
|
180
|
-
2.
|
|
181
|
-
3. Claude
|
|
180
|
+
2. Each skill is written as a `.claude/commands/<name>.md` file with YAML frontmatter (`description`, `user-invocable`)
|
|
181
|
+
3. Claude Code natively reads these command files and applies the skill instructions
|
|
182
182
|
|
|
183
183
|
This ensures Claude consistently follows your defined rules across all iterations.
|
|
184
184
|
|
|
@@ -47,7 +47,8 @@ The Ralph CLI chat system enables external control of Ralph projects via chat pl
|
|
|
47
47
|
│ │ └─────────┘ │ ▼ │
|
|
48
48
|
│ └─────────────┘ ┌───────────────────────────────────────┐ │
|
|
49
49
|
│ │ Command Handler │ │
|
|
50
|
-
│ │ run, stop, status, exec, add, claude
|
|
50
|
+
│ │ run, stop, status, exec, add, claude, │ │
|
|
51
|
+
│ │ help, start, action, branch │ │
|
|
51
52
|
│ └───────────────────┬───────────────────┘ │
|
|
52
53
|
│ │ │
|
|
53
54
|
│ ▼ │
|
|
@@ -96,7 +97,7 @@ The Ralph CLI chat system enables external control of Ralph projects via chat pl
|
|
|
96
97
|
┌─────────────────────────────────────────────────────────────────┐
|
|
97
98
|
│ ResponderMatcher │
|
|
98
99
|
│ │
|
|
99
|
-
│ 1. Check @mention triggers: @qa, @review, @explain, @code
|
|
100
|
+
│ 1. Check @mention triggers: @qa, @review, @arch, @explain, @code│
|
|
100
101
|
│ 2. Check keyword triggers: !lint, help │
|
|
101
102
|
│ 3. Fall back to default responder │
|
|
102
103
|
└─────────────────────────────┬───────────────────────────────────┘
|
|
@@ -111,11 +112,11 @@ The Ralph CLI chat system enables external control of Ralph projects via chat pl
|
|
|
111
112
|
┌─────────────────────────────────────────────────────────────────┐
|
|
112
113
|
│ LLM Responder │
|
|
113
114
|
│ │
|
|
114
|
-
│ 1. Detect git keyword: "last" → git show HEAD
|
|
115
|
+
│ 1. Detect git keyword: "last" → git show HEAD --stat --patch │
|
|
115
116
|
│ 2. Fetch git diff content │
|
|
116
117
|
│ 3. Build message with diff │
|
|
117
118
|
│ 4. Load conversation history (if thread) │
|
|
118
|
-
│ 5. Send to LLM (Anthropic/OpenAI)
|
|
119
|
+
│ 5. Send to LLM (Anthropic/OpenAI/Ollama) │
|
|
119
120
|
│ 6. Log to .ralph/logs/responder-YYYY-MM-DD.log │
|
|
120
121
|
│ 7. Return response │
|
|
121
122
|
└─────────────────────────────┬───────────────────────────────────┘
|
|
@@ -168,48 +169,54 @@ Reply in thread history (max 20 messages)
|
|
|
168
169
|
|
|
169
170
|
## Message Queue Format
|
|
170
171
|
|
|
172
|
+
The messages file stores a direct JSON array (no wrapper object):
|
|
173
|
+
|
|
171
174
|
```json
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
"
|
|
190
|
-
|
|
191
|
-
"output": "Ralph run started (category: feature)"
|
|
192
|
-
}
|
|
175
|
+
[
|
|
176
|
+
{
|
|
177
|
+
"id": "uuid-1234",
|
|
178
|
+
"from": "host",
|
|
179
|
+
"action": "run",
|
|
180
|
+
"args": ["feature"],
|
|
181
|
+
"timestamp": 1706789012345,
|
|
182
|
+
"status": "pending"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": "uuid-1234",
|
|
186
|
+
"from": "host",
|
|
187
|
+
"action": "run",
|
|
188
|
+
"args": ["feature"],
|
|
189
|
+
"timestamp": 1706789012345,
|
|
190
|
+
"status": "done",
|
|
191
|
+
"response": {
|
|
192
|
+
"success": true,
|
|
193
|
+
"output": "Ralph run started (category: feature)"
|
|
193
194
|
}
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
}
|
|
196
|
+
]
|
|
196
197
|
```
|
|
197
198
|
|
|
199
|
+
Fields:
|
|
200
|
+
- `from`: `"sandbox"` or `"host"`
|
|
201
|
+
- `args`: optional string array
|
|
202
|
+
- `status`: `"pending"` or `"done"`
|
|
203
|
+
- `response`: optional, contains `success` (boolean), `output` (optional string), and `error` (optional string)
|
|
204
|
+
|
|
198
205
|
## Git Diff Keywords
|
|
199
206
|
|
|
200
207
|
| Keyword | Git Command | Description |
|
|
201
208
|
|---------|-------------|-------------|
|
|
202
209
|
| `diff` / `changes` | `git diff` | Unstaged changes |
|
|
203
210
|
| `staged` | `git diff --cached` | Staged changes |
|
|
204
|
-
| `last` / `last commit` | `git show HEAD` | Last commit |
|
|
211
|
+
| `last` / `last commit` | `git show HEAD --stat --patch` | Last commit |
|
|
205
212
|
| `all` | `git diff HEAD` | All uncommitted |
|
|
206
|
-
| `HEAD~N` | `git show HEAD~N` | N commits ago |
|
|
213
|
+
| `HEAD~N` | `git show HEAD~N --stat --patch` | N commits ago |
|
|
207
214
|
|
|
208
215
|
## Responder Types
|
|
209
216
|
|
|
210
217
|
| Type | Description | Example Trigger |
|
|
211
218
|
|------|-------------|-----------------|
|
|
212
|
-
| `llm` | Send to LLM (Anthropic/OpenAI) | `@qa`, `@review` |
|
|
219
|
+
| `llm` | Send to LLM (Anthropic/OpenAI/Ollama) | `@qa`, `@review` |
|
|
213
220
|
| `claude-code` | Spawn Claude Code CLI | `@code` |
|
|
214
221
|
| `cli` | Run shell command | `!lint` |
|
|
215
222
|
|
|
@@ -27,13 +27,21 @@ flowchart TD
|
|
|
27
27
|
subgraph Analysis ["4. Result Analysis"]
|
|
28
28
|
ExitCheck{Exit Code == 0?}
|
|
29
29
|
|
|
30
|
-
ExitCheck -- "No" --> FailurePath[
|
|
31
|
-
FailurePath -->
|
|
30
|
+
ExitCheck -- "No" --> FailurePath[Track Failure]
|
|
31
|
+
FailurePath --> SameCode{Same Exit Code\nas Last Failure?}
|
|
32
|
+
SameCode -- "Yes" --> IncrementFailures[Increment Consecutive\nFailure Counter]
|
|
33
|
+
SameCode -- "No" --> ResetToOne[Reset Counter to 1]
|
|
34
|
+
IncrementFailures --> CriticalCheck{Consecutive\nFailures >= 3?}
|
|
35
|
+
ResetToOne --> CriticalCheck
|
|
32
36
|
CriticalCheck -- "Yes" --> Abort([Abort: Too Many Errors])
|
|
33
|
-
CriticalCheck -- "No" -->
|
|
37
|
+
CriticalCheck -- "No" --> ProgressCheck
|
|
34
38
|
|
|
35
39
|
ExitCheck -- "Yes" --> SuccessPath[Reset Failure Counter]
|
|
36
|
-
SuccessPath -->
|
|
40
|
+
SuccessPath --> ProgressCheck
|
|
41
|
+
|
|
42
|
+
ProgressCheck{All Mode:\nProgress Made?}
|
|
43
|
+
ProgressCheck -- "Yes / Not All Mode" --> SignalCheck
|
|
44
|
+
ProgressCheck -- "No progress\n3 iterations" --> StallAbort([Abort: No Progress])
|
|
37
45
|
|
|
38
46
|
SignalCheck{COMPLETE Signal?}
|
|
39
47
|
SignalCheck -- "Yes" --> CompleteModeCheck
|
|
@@ -73,5 +81,6 @@ flowchart TD
|
|
|
73
81
|
style Analysis fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
|
|
74
82
|
style Completion fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
|
|
75
83
|
style Abort fill:#ffebee,stroke:#c62828,color:#c62828
|
|
84
|
+
style StallAbort fill:#ffebee,stroke:#c62828,color:#c62828
|
|
76
85
|
style End fill:#e8f5e9,stroke:#2e7d32,color:#2e7d32
|
|
77
86
|
```
|