You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
Copy file name to clipboardExpand all lines: docs/api.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,7 @@ cmd_slow = Command(name="integration", run="uv run pytest tests/integration", ti
102
102
103
103
| Field | Type | Default | Description |
104
104
|---|---|---|---|
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. |
106
106
|`run`|`str`| (required) | Shell command to execute |
107
107
|`timeout`|`float`|`60`| Max seconds before the command is killed |
108
108
@@ -258,11 +258,19 @@ Use `event.to_dict()` to serialize to a JSON-compatible dict.
258
258
|---|---|
259
259
|`PROMPT_ASSEMBLED`|`iteration`, `prompt_length`|
260
260
261
-
#### Other
261
+
#### Agent output
262
262
263
263
| Event | Data fields |
264
264
|---|---|
265
265
|`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).
@@ -272,7 +280,7 @@ Use `event.to_dict()` to serialize to a JSON-compatible dict.
272
280
|`NullEmitter`| Discards all events silently. Default when no emitter is passed. |
273
281
|`QueueEmitter`| Pushes events into a `queue.Queue` for async consumption. |
274
282
|`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. |
276
284
277
285
```python
278
286
from ralphify import QueueEmitter, FanoutEmitter, BoundEmitter
@@ -385,5 +393,4 @@ When extra listeners are registered, events are broadcast to both the built-in q
385
393
## Next steps
386
394
387
395
-[**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
389
396
-[**Cookbook**](cookbook.md) — real-world ralph examples you can adapt for your own projects
0 commit comments