Commit graph

1 commit

Author SHA1 Message Date
trvon
73e5d3831c
fix(cli): decode compressed content in yams get
Since v0.7.3 'yams get' has requested compressed transfers
(acceptCompressed), and the daemon has answered with a framed payload: a
CompressionHeader followed by a Zstandard body. Only the MCP server
decoded it; 'yams get' wrote the frame itself to stdout or -o, so users
saw the 'CNRK' header and a zstd frame instead of the document. 'yams cat'
was unaffected because it does not request compression.

- Move the frame format into compression/framed_payload
  (encodeFramedPayload/decodeFramedPayload). DocumentService encodes with
  it; 'yams get' and MCP decode with it.
- The decoder checks the header, body size and CRC, and the decoded size
  and CRC. A payload that fails is an error; MCP used to fall back to
  returning the framed bytes as content.

Verified end to end: 'yams get' output (stdout and -o) is byte-identical
to the added file while the transfer stays compressed (51.75x).

Signed-off-by: trvon <me@trevon.dev>
2026-09-26 21:10:00 -06:00