Skip to content

refactor(cli): polish output formatting#50

Merged
koistya merged 1 commit into
mainfrom
dev
Mar 5, 2026
Merged

refactor(cli): polish output formatting#50
koistya merged 1 commit into
mainfrom
dev

Conversation

@koistya

@koistya koistya commented Mar 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Consistent activity sigils: + connected, - disconnected, RPC, echo, warning
  • Short peer IDs (first 8 chars) for readability
  • Dedicated printEcho/emitEcho with safe serialization (handles circular refs, BigInt, undefined)
  • QC expiry message moved from stderr to stdout with timestamp
  • Streamlined printFatal format
  + Connected (8f3kN2p1) [12:34:05]
  ← echo: hello [12:34:06]
  → $sideband/info [12:34:07]
  - Disconnected (8f3kN2p1) [12:34:12]

Test plan

  • Existing output tests updated and passing
  • New tests for emitEcho (data payload, circular refs, undefined normalization)
  • printEcho safe stringify test for non-serializable data
  • Manual: npx sideband and verify human-mode output formatting
  • Manual: npx sideband --json and verify NDJSON echo events include data field

Consistent sigils (+ → ← - ⚠), short peer IDs, dedicated printEcho/emitEcho
with safe serialization, QC expiry moved to stdout.
@koistya koistya merged commit 420ed6f into main Mar 5, 2026
1 check passed
@koistya koistya deleted the dev branch March 5, 2026 22:10
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