Skip to content

feat: list and unshare published sessions, reuse links on re-share - #7

Open
mvanhorn wants to merge 1 commit into
spacefast:mainfrom
mvanhorn:fix/push-session-list-unshare
Open

mvanhorn wants to merge 1 commit into
spacefast:mainfrom
mvanhorn:fix/push-session-list-unshare

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Nov 16, 2026 •

Copy link
Copy Markdown

Summary

Two new commands manage what you've already shared. npx push-session list shows the sessions in your remembered Space with their routes, agents, dates and share links. npx push-session unshare <session-id|route|url> revokes every share link scoped to that session and removes its files from the live Space. Re-sharing a session now reuses its active view-only link instead of minting a new one each time.

Why this matters

The README warns that anyone with the link can read a session, but until now there was no undo. Re-sharing always created another link, so links piled up and none could be revoked from the CLI. In my Space, one session had collected three live links from three shares.

Demo

Simulated demo (HyperFrames), built from a real run against a signed-in Space:

demo

Changes

  • src/spacefast.js adds listShareLinks, revokeShareLink, listFiles and readSessionMetadata, plus a deletePaths option on publishSession. The files endpoint's q filter is a substring match, so results are filtered to the exact sessions/<id>/ prefix before anything is deleted.
  • A deletion-only publish leaves its version at uploaded, and the files stay live. publishSession now finalizes that version itself and fails loudly if it doesn't become ready, so unshare never reports a removal that didn't happen.
  • Link reuse only picks a link that is active, unexpired, under its use limit, targets live, lands on the session route, and grants only page.view on that session. Anything broader gets a fresh link as before.
  • unshare asks for confirmation (--yes skips it, --json is non-interactive) and takes --keep-files to revoke links only. If it stops partway, the error says how many links were revoked and that a rerun finishes the job.
  • Signed-out (claim token) Spaces that can't list or revoke links get a "Sign in with sf login" message. Publishing still works and just creates a new link.

Testing

  • npm run check passes 76 tests, covering list output, unshare with exact-path deletes, consent and cancellation, partial failure and retry, claim-token degradation, link reuse rules, and the finalize step for deletion-only versions.
  • Live run on a signed-in Space: published a throwaway session twice and got the same link back, then ran unshare --yes. The link went from 200 to 403, the page itself returned 403, and list no longer showed the session.

Open questions: can claim tokens manage share links, or should unshare always require sf login? Does deletePaths accept a directory prefix? This PR lists every file under the session route to be safe.


See it in action
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Add `push-session list` to show sessions in the remembered Space with their
links, and `push-session unshare <id|route|url>` to revoke every share link
scoped to a session and remove its files (--keep-files keeps them, --yes
skips the prompt). Re-sharing a session now reuses an active view-only link
for that route instead of minting a new one each time.

A deletion-only publish leaves its version at "uploaded", so unshare
finalizes it to make the removal live.
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a453b375-1a46-4c53-b2fe-a3a5900b7033
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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