Skip to content

feat(cli,cloud): QR code at startup + relay keepalive fix - #56

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

feat(cli,cloud): QR code at startup + relay keepalive fix#56
koistya merged 1 commit into
mainfrom
dev

Conversation

@koistya

@koistya koistya commented Mar 8, 2026

Copy link
Copy Markdown
Member

Summary

  • QR code: Print a half-block Unicode QR code below the Quick Connect URL at daemon startup. Skipped silently when the terminal is too narrow or encodeQR throws — startup is never blocked.
  • Relay keepalive (daemon): Send SBRP Ping every 45s in runMux to keep the daemon's relay connection alive past the relay's 90s idle sweep; cleared in finally on disconnect.
  • Relay keepalive (client): Fix timer race in connect.ts — capture the interval handle in a local const timer so a stale send failure from a prior connection cannot clear the active connection's timer; terminate() now clears explicitly before transport close.
  • ADR-019: Documents trust policy defaults ("auto") for both QC and account auth paths and the future path to "pinned-only" once expectedFingerprint is plumbed through the account API.
  • npm TypeScript badge: Added types and exports fields to packages/cli/package.json so the package shows the TypeScript icon on npm.

QR output

  Quick Connect: https://sideband.cloud/connect#qc=abcd-efgh-ijkl
  Code:          abcd-efgh-ijkl

  Scan to connect:
  ████████████████████████████████
  ██ ▄▄▄▄▄ █▀▄ █▄▀▄▀▄▄▀ █ ▄▄▄▄▄ ██
  ██ █   █ █▀▀▄█▄▄█▄▀ ▀▄█ █   █ ██
  ██ █▄▄▄█ █▀▄▀▄▀▀▄▀▄▄▄▀█ █▄▄▄█ ██
  ████████████████████████████████

  Waiting for connections...

Test plan

  • bun test packages/cli — QR width-guard and emitError tests pass
  • Start daemon with a wide terminal: QR appears below the URL
  • Start daemon with a narrow terminal (< matrix width + 2): QR silently absent
  • Leave a cloud-connected daemon idle for >90s: connection stays alive
  • Verify npm package page shows the TypeScript icon after publish

- Print a half-block Unicode QR code below the Quick Connect URL on
  daemon startup; skipped silently when the terminal is too narrow or
  encodeQR throws — startup is never blocked by QR rendering
- Fix relay keepalive timer race in connect.ts: capture the interval
  handle in a local `const timer` so a stale send failure from a prior
  connection cannot clear the active connection's timer
- Add SBRP Ping every 45s in runMux (listen.ts) to keep the daemon's
  relay connection alive past the relay's 90s idle sweep
- Add ADR-019 documenting trust policy defaults for both auth paths
@koistya
koistya merged commit 00fca3e into main Mar 8, 2026
1 check passed
@koistya
koistya deleted the dev branch March 8, 2026 13:00
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