Add --json-standard option for opencode/claude output formats#21
Add --json-standard option for opencode/claude output formats#21
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #20
- Add new --json-standard CLI option with 'opencode' (default) and 'claude' choices - Implement JSON format adapters in src/json-standard/index.ts - OpenCode format: pretty-printed JSON with step_start/step_finish/text/tool_use events - Claude format: NDJSON with init/message/tool_use/tool_result/result events - Add comprehensive unit tests for both formats (17 tests) - Update README.md and EXAMPLES.md with documentation - Bump version to 0.0.9 The Claude format is experimental and provides compatibility with Anthropic's Claude CLI stream-json output format for use with Claude-based tools. Fixes #20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
--json-standard optionThis reverts commit 6058a56.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit them. Uncommitted files: Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback. |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
🤖 AI Work Session Started Starting automated work session at 2025-12-09T00:19:38.879Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
Resolved merge conflicts in src/index.js by combining changes from both branches: - Keep hasError flag tracking from main branch (issue #22 fix) - Keep eventHandler.output() for JSON standard formatting from our branch The resolution ensures both error tracking and proper JSON output formatting work together. Changes: - Set hasError = true when session.error events occur - Set hasError = true in catch blocks for error handling - Use eventHandler.output() for all error output (respects --json-standard flag) - Include new experiment scripts from main branch 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
🤖 AI Work Session Started Starting automated work session at 2025-12-09T00:30:42.637Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
Resolved merge conflicts between: - PR #21 (issue-20): --json-standard option for opencode/claude formats - main branch: MCP command support and test infrastructure Changes: - Integrated both imports (json-standard and McpCommand) - Updated runAgentMode to validate and pass jsonStandard parameter - Modified runServerMode and runDirectMode to accept jsonStandard - Maintained event handler functionality for both output formats - Preserved command execution check from main branch refactoring All JSON standard tests passing: - json-standard-unit.test.js: 17 pass - json-standard-opencode.test.js: 9 pass - json-standard-claude.test.js: 11 pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
✅ Merge Conflict ResolvedSuccessfully merged main branch into issue-20 branch and resolved all conflicts. Changes MadeMerge Resolution:
Test Results:
PR Status:
The |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
--json-standardCLI option withopencode(default) andclaudechoicessrc/json-standard/index.tsJSON Output Standards
The agent now supports two JSON output format standards:
OpenCode Standard (default)
step_start,step_finish,text,tool_use,errorsessionID(camelCase)Claude Standard (experimental)
init,message,tool_use,tool_result,resultsession_id(snake_case)Usage
Test Plan
tests/json-standard-unit.test.js)tests/json-standard-opencode.test.js)tests/json-standard-claude.test.js)--helpshows new option correctlyFixes #20
🤖 Generated with Claude Code