Просмотр исходного кода

docs(skills): document grok --output-format streaming-json in fleetflow

Capture grok's three headless output modes (plain/json/streaming-json) and
the streaming-json NDJSON event schema (thought/text/end) in the fleetflow
worker contract, and wire grok's streaming-json stream into the live-monitor
introspection note alongside codex's --json stream. Verified against live
headless runs 2026-07-11.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0xDarkMatter 3 дней назад
Родитель
Сommit
a1fbbdfbb0
2 измененных файлов с 16 добавлено и 1 удалено
  1. 3 1
      skills/fleetflow/SKILL.md
  2. 13 0
      skills/fleetflow/references/worker-contracts.md

+ 3 - 1
skills/fleetflow/SKILL.md

@@ -267,7 +267,9 @@ tail, artifact). Wire-up: copy it into the run dir as `index.html`, run
 `ff-status --watch 3 --out <rundir>/status.json`, serve the run dir with any
 static server, open in a browser/preview panel. It polls `status.json` every
 2.5s. Live claude-brain lanes are introspected via the session transcript in
-their isolated config dir; codex lanes via their `--json` event stream.
+their isolated config dir; codex lanes via their `--json` event stream; grok
+lanes via their `--output-format streaming-json` NDJSON event stream
+(`thought`/`text`/`end` events).
 
 **Two surfaces, like the native tool.** The served monitor is the *live*
 grid (the Background-tasks panel analogue). In-chat, the orchestrator emits a

+ 13 - 0
skills/fleetflow/references/worker-contracts.md

@@ -98,6 +98,19 @@ binary and protocol, **not** a `claude -p` wrapper. Verified against
 - **Envelope** (`--output-format json`): `{text, stopReason, sessionId,
   requestId, thought, structuredOutput?}` — **no `is_error`**. A clean turn ends
   `stopReason:"EndTurn"`.
+- **Output modes** (`--output-format`, verified live 2026-07-11): `plain` (text
+  only, the default), `json` (the single buffered envelope above), and
+  `streaming-json` — **NDJSON**, one event object per line streamed as it
+  generates: `{"type":"thought","data":"…"}` (reasoning tokens),
+  `{"type":"text","data":"…"}` (answer tokens), terminated by
+  `{"type":"end","stopReason","sessionId","requestId"}`. This is grok's analog of
+  `claude -p --output-format stream-json`. **ff-collect gates on the buffered
+  `json` envelope** (a whole-turn result is what a lane's success is judged on);
+  **`streaming-json` is the live-progress source** — the codex `--json`
+  event-stream analog the live monitor consumes. Consumer note: it interleaves
+  `thought` and `text`, so filter `type=="text"` for answer-only, and read
+  `structuredOutput` off the terminal event (not a `thought`) on `--json-schema`
+  lanes.
 - **Auth:** the `GROK_DEPLOYMENT_KEY` env var **only** — grok has no
   config/auth/key subcommand to store a deployment key (`~/.grok/auth.json`
   holds OAuth tokens, and OAuth lacked chat entitlement on the test account, so