feat: web consumes @codeoid/protocol — retire the hand-maintained mirror - #105
Conversation
The web UI kept a 700-line hand-synced copy of the wire types (web/src/protocol/types.ts, "keep them in sync"). It now depends on @codeoid/protocol (file:../packages/protocol — web stays a standalone package; bun's link: doesn't support relative paths) and the mirror file becomes a one-line re-export shim, so all existing "../protocol/types" imports resolve unchanged. One source of truth for daemon + web; the mobile client consumes the same package next. The switch immediately surfaced real drift the mirror had accumulated: web still typed and handled a "working" SessionStatus that was split into thinking/tool_running BEFORE v0.1.0 ever shipped — no published daemon has ever emitted it. Removed the dead handling (StatusDot, Transcript streaming gate, WorkerIndicator, approvals active-set, tests). Note on bun file: semantics — the dep is COPIED at install, not symlinked; after editing packages/protocol run `bun install` in web/ to refresh (documented in the shim header). CI installs fresh every run; --frozen-lockfile verified. Verified: web tsc clean, eslint clean, 171 tests pass, vite production build green (bundles the TS-source dep). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
💤 Files with no reviewable changes (4)
📝 WalkthroughWalkthroughThis PR removes the "working" session status from status-gating logic across UI components (StatusDot, WorkerIndicator, Transcript) and approval eligibility checks, updating corresponding tests. Separately, it adds a workspace dependency on ChangesSession Status Handling
Protocol Package Consolidation
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #105 +/- ##
=======================================
Coverage 76.39% 76.39%
=======================================
Files 70 70
Lines 11605 11605
=======================================
Hits 8866 8866
Misses 2739 2739
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Follow-up deferred from #101 (and the resolution to CodeRabbit's
CAPABILITIES-duplication nitpick on #102): the web UI's 700-line hand-synced protocol mirror is gone.What changed
webnow depends on@codeoid/protocolviafile:../packages/protocol— web stays a standalone package (its CI runs its ownbun install --frozen-lockfile, verified working). Bun'slink:protocol doesn't accept relative paths, sofile:(copy-at-install) it is; the shim header documents the one gotcha: after editingpackages/protocol, re-runbun installinweb/(CI always installs fresh).web/src/protocol/types.tsis now a one-line re-export shim — all existing../protocol/typesimports across web/src resolve unchanged, same pattern as the daemon's shims.The migration instantly caught real drift 🎯
The mirror still typed and handled a
"working"SessionStatusthat was split intothinking/tool_runningbefore v0.1.0 ever shipped (verified viagit log -S+git show v0.1.0) — no published daemon has ever emitted it. Exactly the class of silent divergence this migration exists to kill. Removed the dead handling:StatusDot,Transcript's streaming gate,WorkerIndicator, the approvals active-status set, and two tests (semantics preserved — the "returns null when nothing is waiting" case now usestool_running, still an approval-possible status).Verification
web
tsc -bclean · eslint clean (2 pre-existing warnings on untouched lines) · 171 tests pass · vite production build green (bundles the TS-source dep) ·--frozen-lockfilere-install verified.Next
@codeoid/coreextraction (ws client + reducers + formatters) builds on this — web and mobile then share client logic, not just types.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests