Commit Graph
7 Commits
Author SHA1 Message Date
Raven Scott a2068ed706 Protocol
strokeStart (mousedown): { type: 'strokeStart', id, color, width } — other peers create a draft for this id.
strokeDraft (mousemove, throttled): { type: 'strokeDraft', id, points } — peers update that draft’s points and redraw so the line grows as you move.
stroke (mouseup): unchanged — final stroke; peers remove the draft and add the stroke to the main list.
Implementation
drafts: Map of id → { color, width, points } for in-progress strokes from others.
currentStrokeId: Set on mousedown and used for all messages for that stroke.
Throttling: strokeDraft is sent at most every 32ms (~30 fps) to limit traffic while keeping motion smooth.
Redraw: Draws committed strokes, then all drafts, then your own current stroke.
Clear: Clears both strokes and drafts.
finishStroke(): Sends one last strokeDraft with the full points before sending stroke, so the final segment isn’t missing on other peers.
2026-02-12 06:11:51 -05:00
Raven Scott 2cdfa78881 add simple peer to peer whiteboard 2026-02-12 06:08:37 -05:00
Raven Scott 168c1090dd Add HRPC demo 2026-02-12 06:01:02 -05:00
Raven Scott 2f058fbac3 docs 2026-02-12 04:58:02 -05:00
Raven Scott bb47954b9f Implement hrpc with streaming and wire into setup
- Add spec/hyperschema and spec/hrpc codegen (scripts/build-hrpc.js)
  with unary, request/response-stream, duplex, and send-only commands
- Run build:hrpc and build:protomux from install.sh so setup is one-step
- Native host: add attachHrpc (Protomux channel + generated HRPC),
  handlers for ping, streamSum, fetchStream, duplex, notify
- Load HRPC lazily so missing spec does not crash host; use bare-stream
  for Duplex under Bare; add bare-stream, compact-encoding deps
2026-02-12 04:51:03 -05:00
Raven Scott a7f86f3af5 Update README 2026-02-12 03:29:21 -05:00
Raven Scott 90c7a4910e first commit 2026-02-12 03:27:05 -05:00