feat(middleware): implement ClaudeCliRuntime concrete class#9
Merged
alexey-pelykh merged 1 commit intomainfrom Feb 25, 2026
Merged
feat(middleware): implement ClaudeCliRuntime concrete class#9alexey-pelykh merged 1 commit intomainfrom
alexey-pelykh merged 1 commit intomainfrom
Conversation
d62e2b7 to
0330b24
Compare
First concrete runtime extending CLIRuntimeBase. Invokes `claude -p --output-format stream-json --verbose` and maps the streaming NDJSON output (stream_event envelopes and result line) to AgentEvent instances. Key capabilities: - buildArgs: session resume, inline MCP config JSON, prompt as positional - extractEvent: stateful parsing of text deltas, tool_use buffering, session ID tracking, usage/cost extraction from result line - execute override: enriches base class done event with accumulated state Co-Authored-By: Claude Opus 4.6 <[email protected]>
0330b24 to
d525ffc
Compare
This was referenced Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #8.
ClaudeCliRuntimeextendingCLIRuntimeBase— the first concrete runtime for the new middleware architecturestream-jsonNDJSON output (stream_eventenvelopes +resultline) toAgentEventinstances--mcp-configexecute()to enrich the base class done event with accumulated text, session ID, usage, cost, and turn metadataTest plan
pnpm buildpassespnpm checkpasses (format + typecheck + lint)pnpm test— 31 new tests, all passingcli-runtime-base.test.ts(16 tests) unaffected🤖 Generated with Claude Code