refactor: extract @agent-device/command-output
Summary
Extracts the shared CLI/MCP presentation (family formatters, warning routing, color, human error lines, serialization) into private @agent-device/command-output. Sources moved with git mv. command-surface gains no presentation import; MCP stays root. 82 files, +663/ā277 rename-aware.
- Purity: the package reads no
processmember (R86, including named imports).printHumanError,printJsonand the stderr progress sink stay root; stdout/stderrIsTTYarrive as input. - Entry: exactly
".", explicit names, includingFormatCliOutputParams.formatCliOutputand the diff renderers load the formatter tables on first call. - Deep callers render through production
formatCliOutput. - Review fixes kept: bounded warning-collapse regex (CodeQL),
-iconformance samples, named-import guard. - Rebase: onto
ff8c2285c8(#4121 client extraction). Conflicts were manifests, entry pins,cli-runner.tsandrender-fixtures.ts; both packages stay registered. Lockfile regenerated with pnpm (only the new importer).range-diff: the last four commits are unchanged; one added commit merges a duplicate import.
Eager closure at the old base: cli.ts 256ā256, SDK 241ā241, MCP server 254ā230, entry 19 (ceiling 20); the budget gate passed on the rebased head.
Validation
Full gate at bc1c0dece1: pnpm check --head bc1c0dece1 passed, exactCommit: true (tooling, fallow, unit); merge-tree against current main is clean. CI then failed AgentGuidance (docs/agents 40,007 bytes > 40,000); f4795dfaa7 shortens one sentence in code-ownership.md, no cap raised. Docs-only delta to f4795dfaa7: check:affected --base bc1c0dece1 --head f4795dfaa7 selected agent-guidance, passed, exactCommit: true; not a new full gate. Earlier CI passes apply to older heads. Not device-facing. CI-only lanes pending.
š¤ Generated with Claude Code