Skip to content

v0.4.2

@ejfkdev ejfkdev tagged this 06 Oct 01:13
Patch release after v0.4.1.

1. Rich error model (spec §8.5/§8.6): CodedError gains Code (business
   identifier), Detail (structured context), Status (HTTP override);
   chainable builders + per-Kind shortcuts; extractors From/Code/Detail/
   StatusFor/RPCCodeFor; shared errs.Body{error,kind,code,detail} on all
   three channels. The flat {"error":"..."} HTTP body is retained
   byte-for-byte; kind/code/detail are additive.

2. CLI --format (spec §10.7): --format text|json|jsonl|markdown, --json
   alias. Canonical --xyz.format=<fmt> always works and never collides; the
   bare --format/--json is honoured only when the target command has no
   format/json flag (else it binds to the command). Precedence: bare
   (unshadowed) > --xyz.format > text. jsonl one compact line per element;
   markdown tables with | / newline escaping; explicit formats bypass custom
   CLIOutput; machine-mode errors → stderr as the §8.6 object.

3. Application identity + server context (spec §11.6 HTTP / §12.8 MCP): the
   application's version is distinct from the xyz SDK's. xyz.SDKVersion =
   library version; xyz.Version / Config.Version = application version;
   Config.Name / basename = application name. HTTP X-App-Name + X-App-Version
   + X-XYZ-Version (SDK) + X-XYZ-Command + X-XYZ-Duration-Ms + statics
   (--xyz.header); NoServerHeaders suppresses the automatic five. MCP
   serverInfo = app identity; _meta.xyz {app_name, app_version, sdk_version,
   command, duration_ms, headers, error}; NoServerMeta suppresses xyz only.
   CLI -v prints the resolved app name + version.

4. Per-channel output functions (spec §9.5, optional MAY; absorbs D-go-03).

Tests: errors/rich, httpapi/meta, mcp/meta, cli/format, builtins_meta. Full
suite green; trim variants build; vet clean.
Assets 2
Loading