refactor: convert remaining Tier 1 commands to return-based output#382
Merged
refactor: convert remaining Tier 1 commands to return-based output#382
Conversation
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Init
Other
Bug Fixes 🐛Init
Other
Internal Changes 🔧Init
Other
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ 104 passed | Total: 104 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 95.93%. Project has 898 uncovered lines. Files with missing lines (2)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.49% 95.50% +0.01%
==========================================
Files 142 142 —
Lines 19936 19935 -1
Branches 0 0 —
==========================================
+ Hits 19037 19037 —
- Misses 899 898 -1
- Partials 0 0 —Generated by Codecov Action |
BYK
commented
Mar 10, 2026
bcd114a to
ef64745
Compare
e347d5f to
b13b810
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
bbca7b9 to
151de57
Compare
Convert 5 remaining Tier 1 commands to the return-based CommandOutput<T> pattern introduced in #380. Commands return { data, hint? } and declare an OutputConfig with json: true and a human formatter — the framework handles JSON serialization and human-readable rendering. Commands converted: - event/view: formatEventView + buildEventData - issue/view: formatIssueView + buildIssueData - issue/plan: formatPlanOutput + buildPlanData (removed outputSolution) - project/create: formatProjectCreatedView - trace/view: formatTraceView + buildTraceData Additional cleanup from review feedback: - Unify hint and footer into single hint field on CommandOutput<T> - Replace normalizePlatform stderr.write with consola logger - Remove stdout parameter from openInBrowser/openOrShowUrl (now uses process.stdout directly) — all 7 command callers updated - Remove unused Writer imports and stdout destructuring from commands
151de57 to
b9e1083
Compare
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
Convert 5 remaining Tier 1 commands to the return-based
CommandOutput<T>pattern introduced in #380.Each command now returns
{ data, hint?, footer? }and declares anOutputConfigwithjson: trueand ahumanformatter — the framework handles JSON serialization and human-readable rendering.Commands converted
event/viewformatEventView(){ data: { event, trace, spanTreeLines }, hint }issue/viewformatIssueView(){ data: { issue, event, trace, spanTreeLines }, footer }issue/planformatPlanOutput(){ data: { run_id, status, solution } }project/createformatProjectCreated(){ data: ProjectCreatedResult }trace/viewformatTraceView(){ data: { summary, spans, spanTreeLines }, footer }Infrastructure changes
footer?: stringtoCommandOutput<T>andRenderContextrenderCommandOutput()now renders footer viawriteFooter()handleReturnValueincommand.tspassesvalue.footerthroughWhat was removed
writeHumanOutput()from trace/view (replaced byformatTraceView)outputSolution()from issue/plan (replaced byformatPlanOutput+buildPlanData)writeJson/writeFooter/stdout.writecalls from all 5 commandsWritertype imports (no longer needed)Test updates
test/commands/trace/view.func.test.ts:writeHumanOutputtests replaced withformatTraceViewpure function teststest/commands/project/create.test.ts:parsed.slug→parsed.project.slug(JSON shape now uses fullProjectCreatedResult)Net: -33 lines (188 insertions, 221 deletions)
Part of the output convergence plan: #373 → #376 → #380 → this PR