docs: improve documentation coverage (#52)

This commit is contained in:
banteg
2026-01-04 19:00:27 +04:00
committed by GitHub
parent 465dda20a2
commit c64913ed6d
11 changed files with 197 additions and 219 deletions
+7 -3
View File
@@ -1,8 +1,12 @@
Heres a clean way to make “Takopi events” just **3 shapes** while still covering **every `codex exec --json` line type** and preserving the invariants you care about (stable IDs, resume/thread ownership, final answer delivery).
# Codex -> Takopi event mapping
This document describes how Codex exec --json events are translated to Takopi's normalized event model.
> **Authoritative source:** The schema definitions are in `src/takopi/schemas/codex.py` and the translation logic is in `src/takopi/runners/codex.py`. When in doubt, refer to the code.
## The 3-event Takopi schema
Id model it like this (JSON-ish). The important trick is: **your single `action` event needs a `phase`**, otherwise you cant represent started/updated/completed lifecycles.
The Takopi event model uses 3 event types. The `action` event includes a `phase` field to represent started/updated/completed lifecycles.
### 1) `started`
@@ -28,7 +32,7 @@ Emitted for **everything that is progress / updates / warnings / per-item lifecy
"engine": "codex",
"action": {
"id": "item_5",
"kind": "tool", // command | tool | file_change | web_search | note | turn | warning | telemetry
"kind": "tool", // command | tool | file_change | web_search | subagent | note | turn | warning | telemetry
"title": "docs.search", // short label for renderer
"detail": { ... } // structured payload (freeform)
},