You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(everyrow-cc): add conversation privacy and sharing (#5035)
## Summary
- **Phase 1 (Privacy):** Gate agent read endpoints (`/stream`,
`/session-history`, `/session-status`) behind owner verification.
Express proxy extracts user ID from Supabase auth cookie and forwards
`X-User-Id`/`X-Share-Token` headers to the agent service, which stores
`owner_user_id` on first `/chat` and rejects unauthorized reads.
- **Phase 2 (Sharing):** Add share toggle endpoints, public share
metadata endpoint, session-to-conversation linkage, and a read-only
share view. Database migration adds `share_token`, `forked_from`, and
`cc_conversation_id` columns with RLS policies cascading read access
through sessions → tasks → artifacts. Frontend adds `ShareButton` in
conversation header and `SharedConversationView` at `/share/[token]`.
- **Phase 3 (Forking):** `forked_from` column added to schema for future
support — no logic yet.
### Key changes across layers
| Layer | Files | What |
|-------|-------|------|
| Express proxy | `server/auth.ts`, `routes.ts`, `agent-client.ts`,
`server.ts` | Cookie-based auth extraction, share token forwarding, new
proxy routes |
| Agent service | `server.py`, `sdk_manager.py` | Owner
storage/verification, share token validation against engine |
| Engine API | `cc_conversations.py`, `cc_conversations_types.py`,
`db.py`, `main.py` | Share toggle, public share endpoint, session
linking, new DB functions |
| Frontend | `ShareButton.tsx`, `SharedConversationView.tsx`,
`share/[token]/page.tsx`, `AppShell.tsx`, `ChatPane.tsx`, `useSSE.ts`,
`conversations-api.ts` | Share UI, read-only public view, session
linking on everyrow_session event |
| Database | `20260324000000_cc_conversation_sharing.sql` | share_token,
forked_from, cc_conversation_id, RLS policies |
## Test plan
- [ ] Open a conversation as User A — SSE stream works, chat works
- [ ] In incognito (no auth), try
`/app/api/session-history?sessionId=<UUID>` — should get 401
- [ ] Log in as User B, try the same — should get 403
- [ ] As User A, click Share toggle — get share URL with copyable link
- [ ] Open share URL in incognito — see read-only chat + data view (no
input box)
- [ ] Revoke share — share URL returns error
- [ ] Verify existing conversation flow (create, chat, resume) still
works end-to-end
- [ ] Run migration against local/docker Supabase and verify columns +
policies created
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sourced from commit 6682622497b22cf60863fdad10c050d960f36567
0 commit comments