gsxdsm
1fc615d0da
FN-7724: bridge Grok CLI tool_use NDJSON events in GrokRuntimeAdapter
Bridges Grok CLI tool execution events (tool_use start/result) from the NDJSON stream into the runtime adapter's onToolStart/onToolEnd callbacks, alongside existing text bridging.
- GrokRuntimeAdapter.promptWithFallback now parses and bridges tool_use NDJSON events into onToolStart/onToolEnd callbacks
- Tool name/args/result pass through unchanged (no Grok→pi tool-name mapping, since the verified contract doesn't pin a vocabulary)
- step_finish/error remain non-terminal per-step events, not bridged to any callback; only subprocess close/error finalizes (unchanged from FN-7722)
- Extended stream-parser.ts to recognize tool_use event shapes
- Added new types for tool event payloads in types.ts
- Updated docs/grok-cli-contract.md and plugin README to document tool event bridging
- Added changeset for @runfusion/fusion (minor)
- Added/extended tests in runtime-adapter.test.ts and stream-parser.test.ts (fixture-based, no live binary)
Files changed:
.changeset/fn-7724-grok-cli-tool-bridging.md | 7 ++
docs/grok-cli-contract.md | 16 ++-
plugins/fusion-plugin-grok-runtime/README.md | 12 +++
.../src/__tests__/runtime-adapter.test.ts | 120 +++++++++++++++++++++
.../src/__tests__/stream-parser.test.ts | 33 ++++++
.../src/runtime-adapter.ts | 83 +++++++++++---
.../src/stream-parser.ts | 10 ++
plugins/fusion-plugin-grok-runtime/src/types.ts | 23 ++++
8 files changed, 287 insertions(+), 17 deletions(-)
Fusion-Task-Id: FN-7724
Fusion-Task-Lineage: 73abbf2a-6dcd-44fb-86be-71d4788c92d2
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-09 19:58:05 -07:00
..
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 23:39:34 -07:00
2026-07-08 22:30:29 -07:00
2026-07-08 16:27:10 -07:00
2026-07-01 20:40:02 -07:00
2026-07-08 16:27:10 -07:00
2026-07-09 19:58:05 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-04-09 20:19:43 -07:00