Skip to content

Commit 8d37247

Browse files
Kasper JungeRalphify
authored andcommitted
docs: add AGENT_OUTPUT_LINE event to API reference and fix stale links
The AGENT_OUTPUT_LINE event type was added for live peek but wasn't documented in the API reference. Also fixes broken links to the deleted writing-prompts.md page. Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent b997d9c commit 8d37247

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docs/api.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ cmd_slow = Command(name="integration", run="uv run pytest tests/integration", ti
102102

103103
| Field | Type | Default | Description |
104104
|---|---|---|---|
105-
| `name` | `str` | (required) | Identifier used in [`{{ commands.<name> }}`](writing-prompts.md#using-commands-for-dynamic-data) placeholders. Letters, digits, hyphens, and underscores only. |
105+
| `name` | `str` | (required) | Identifier used in [`{{ commands.<name> }}`](how-it-works.md#3-resolve-placeholders-with-command-output) placeholders. Letters, digits, hyphens, and underscores only. |
106106
| `run` | `str` | (required) | Shell command to execute |
107107
| `timeout` | `float` | `60` | Max seconds before the command is killed |
108108

@@ -258,11 +258,19 @@ Use `event.to_dict()` to serialize to a JSON-compatible dict.
258258
|---|---|
259259
| `PROMPT_ASSEMBLED` | `iteration`, `prompt_length` |
260260

261-
#### Other
261+
#### Agent output
262262

263263
| Event | Data fields |
264264
|---|---|
265265
| `AGENT_ACTIVITY` | `iteration`, `raw` (dict — one stream-json line from the agent) |
266+
| `AGENT_OUTPUT_LINE` | `iteration`, `line` (raw text), `stream` (`"stdout"` or `"stderr"`) |
267+
268+
`AGENT_ACTIVITY` fires only for Claude Code (streaming mode) and carries parsed JSON events. `AGENT_OUTPUT_LINE` fires for **all agents** and carries each raw output line as it's produced — this is what powers [live peek](cli.md#peeking-at-live-agent-output).
269+
270+
#### Other
271+
272+
| Event | Data fields |
273+
|---|---|
266274
| `LOG_MESSAGE` | `message`, `level` (`"info"` / `"error"`), `traceback` (optional) |
267275

268276
### Built-in emitters
@@ -272,7 +280,7 @@ Use `event.to_dict()` to serialize to a JSON-compatible dict.
272280
| `NullEmitter` | Discards all events silently. Default when no emitter is passed. |
273281
| `QueueEmitter` | Pushes events into a `queue.Queue` for async consumption. |
274282
| `FanoutEmitter` | Broadcasts each event to multiple emitters. |
275-
| `BoundEmitter` | Wraps any emitter with a fixed `run_id` so you don't have to construct `Event` objects manually. Has `log_info(message)` and `log_error(message, traceback=...)` convenience methods. |
283+
| `BoundEmitter` | Wraps any emitter with a fixed `run_id` so you don't have to construct `Event` objects manually. Has `log_info(message)`, `log_error(message, traceback=...)`, and `agent_output_line(line, stream, iteration)` convenience methods. |
276284

277285
```python
278286
from ralphify import QueueEmitter, FanoutEmitter, BoundEmitter
@@ -385,5 +393,4 @@ When extra listeners are registered, events are broadcast to both the built-in q
385393
## Next steps
386394

387395
- [**How the loop works**](how-it-works.md) — understand the iteration cycle that `run_loop` executes
388-
- [**Writing prompts**](writing-prompts.md) — learn how to write RALPH.md files with commands and placeholders
389396
- [**Cookbook**](cookbook.md) — real-world ralph examples you can adapt for your own projects

0 commit comments

Comments
 (0)