WIP: first-class session sharing (shared flag + built-in Share button)#114
Draft
benvinegar wants to merge 1 commit into
Draft
WIP: first-class session sharing (shared flag + built-in Share button)#114benvinegar wants to merge 1 commit into
benvinegar wants to merge 1 commit into
Conversation
…button)
Make "sharing" a first-class concept in the OSS core so the cloud can stop
owning the Share button and own only the dialog.
- Session gains a `shared` boolean: SQLite column (probe-and-ALTER migration
like agentSeq), Session type, JsonFileStore + SqlStore, and a contract test.
- PATCH /api/sessions/:id now accepts `{ shared? }` (still accepts `{ title? }`),
broadcasting session-updated so live viewers relight.
- Host contract gains onShareClick?(sessionId): the engine owns the Share BUTTON
and its "Shared" pill (lit from session.shared); the host owns the DIALOG. When
no host provides it, a built-in copy-the-/session/:id-URL dialog is the
self-hosted fallback, so self-hosted needs no host code.
- Viewer renders the built-in Share button in the session header.
Deferred (noted in code): ENFORCING read access from the flag (per-session
publicRead). This proves the UX/architecture split; the cloud already gates
reads at the edge.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Idea
Today a session has no notion of being shared, and the viewer's
ss:session-actionsslot is empty by default — an embedder (cloud) projects its own Share button + dialog. This prototype moves the button into the engine as built-in chrome and lets the host own just the dialog:sharedand hands over its stable/session/:idURL (built-in fallback dialog — no host code needed).onShareClickhook (cloud mints a tenant-scoped link). The button's "Shared" pill is driven bysession.shared.Changes
sharedboolean on the session — SQLite column (probe-and-ALTER migration likeagentSeq),Sessiontype, both stores (JsonFileStore+SqlStore), contract test.PATCH /api/sessions/:idnow accepts{ shared? }(still accepts{ title? }), broadcastingsession-updatedso live viewers relight.onShareClick?(sessionId)— engine owns the button, host owns the dialog. Omitted → built-in copy-the-URL fallback, so self-hosted parity holds.Verified
shared, PATCH route), typecheck, full build + embed.session.shared→ pill relights to "Shared".Deliberately deferred (for discussion)
Enforcement of read access from the flag — i.e. a per-session
publicReadmode that gates unauthenticated reads onsession.shared. This prototype proves the UX/architecture split; todaysharedis cosmetic in OSS (no read gate). The cloud already gates per-session reads at its edge, so it doesn't block on this — but self-hosted sharing only becomes "real" once enforcement lands. That's the main open design question.🤖 Generated with Claude Code