Skip to content

feat(standards): --compact output switch and WC-OUT-24 - #445

Merged
leemour merged 1 commit into
mainfrom
feat/compact-flag
Nov 2, 2026
Merged

leemour merged 1 commit into
mainfrom
feat/compact-flag

Conversation

@leemour

@leemour leemour commented Nov 2, 2026

Copy link
Copy Markdown
Member

Adds the shared --compact switch for agent-sized output.

  • --compact in the flag vocabulary (role output, switch).
  • COMPACT_FLAG in @wirecat/cli-base/standards holds the name. The owner has not settled the name yet, so a rename is one constant.
  • New rule WC-OUT-24: one line per item from the same answer as --json; the reference first, the text last and cut with …(+N); page, missing, next and meta.complete kept as # lines on stdout; refused with --json, --jsonl and --brief.
  • WC-CMD-14 and WC-CMD-15 list it.

cli-core draws the form (separate PR, needs this release first).

Checks: lint, typecheck, tests, docs:check, docs:lint and standards:check pass. docs:spell fails on Glama in docs/standards/new-cli.md:120, which is on main already and not touched here.

🤖 Generated with Claude Code

Adds --compact to the flag vocabulary (role output, switch) and the rule
WC-OUT-24: one line per item, drawn from the same answer as --json, with
page, missing, next and meta.complete kept as "# " lines on stdout.

The flag's name is held once in COMPACT_FLAG (exported from
@wirecat/cli-base/standards), because the owner has not settled it yet
(NEED-2131); a rename is that one constant. WC-CMD-14 and WC-CMD-15 list it
with the shared output switches and the non-interactive ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour merged commit ede29bd into main Nov 2, 2026
10 checks passed
@leemour leemour mentioned this pull request Nov 2, 2026
leemour added a commit that referenced this pull request Nov 2, 2026
Dates the Unreleased section (`--compact`, WC-OUT-24, #445) as 0.74.0.
Only package.json and the CHANGELOG heading change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
leemour added a commit to WireCatLabs/cli-core that referenced this pull request Nov 2, 2026
…pe (#2375)

Slice F1 of the compact output plan: one renderer that every answer goes
through, by declaring a row shape.

- `RowShape`, `SHARED_ROWS` (`message`, `message.summary`,
`message.hit`, `chat`), `entityRows`, `rowShapeOf` and a pure
`compactText(body, shape, options)`. No store, no clock.
- `answerEntity(cmd, name, schema, { row })` declares a command's own
row. Otherwise the generic row (moved from memo) is used: key/ref/id,
title/name/path, state, text.
- Global `--compact`, wired into `resolveOutput` and `renderAnswer`.
Header: shared ref prefix, columns every row has in common, date span,
zone. Footer on stdout: `# more`, `# missing`, `# next`, `# complete:
false`. Each command line in it carries `--compact`.
- Refused with `--json`, `--json=…`, `--jsonl` and `--brief`
(`output.conflict`). Counts as machine output for prompts, failures and
the output cap. Exit code is the same as JSON's. MCP stays JSON.
- Side fix: `--brief` did nothing on messenger search hits. It now cuts
them.

Size: on 1 000 synthetic MAX messages of one chat (Cyrillic, ~150 chars
each), compact is **48.6 %** of the JSON bytes and keeps every ref. The
plan's bar is 45 %. The texts alone are 40 % of the JSON, so the id,
time and sender on each row leave 48 %.

**CI will fail until cli-base releases `COMPACT_FLAG`**
(WireCatLabs/cli-base#445). Locally, built against that branch: lint,
typecheck, command lint, all 8 723 tests, docs:check, docs:lint,
docs:spell, standards:check and check:dist pass. After the release, the
pin in `package.json` needs a bump.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant