feat: add get_post / sideshow show for single-post reads#166
Merged
Conversation
Surfaces now carry stable server-assigned ids, enabling targeted operations (append, edit, remove, reorder) on individual surfaces within a post — across all three integration tiers. CLI: - publish honors flag order instead of a fixed if-ladder (#158) - update --surface N targets a surface in multi-surface posts - new surface subcommand: add, remove, edit, move HTTP API: - POST /api/posts/:id/surfaces (append) - PATCH /api/posts/:id/surfaces/:target (replace/content-only) - DELETE /api/posts/:id/surfaces/:target (remove) - PATCH /api/posts/:id/surfaces (reorder) - PATCH /api/posts/:id extended with surface param MCP: - new tools: add_surface, edit_surface, remove_surface, reorder_surfaces Viewer: - surfaces keyed by stable id (For + reconcile key=id) Data model: - Surface.id assigned server-side via normalizeSurfaceIds - one-time migration for existing data in both stores
…tml replacement - surface add: add --layout flag and propagate layout:'split' to diff surfaces (matches publish behavior) - replaceSurface: merge kits into a full html surface replacement so edit_surface no longer silently drops kits
Adds a read primitive for fetching a single post by id across all three tiers — the missing counterpart to list_posts / sideshow list. MCP: get_post(id) — returns the full post (surfaces with ids, version, history). Available on both stdio and HTTP transports. CLI: sideshow show <id> — prints the full post JSON. Agents need this to recover surface ids for per-surface operations (edit_surface, remove_surface, reorder_surfaces) after a context compaction, without listing the entire session.
This was referenced Jun 26, 2026
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.
What
This PR also includes the full per-surface operations feature (#165), since it was branched from #165 and merged first. #165 was closed as redundant.
Per-surface operations (from #165)
Surfaces now carry stable server-assigned ids, enabling targeted operations on individual surfaces within a post — across all three integration tiers.
CLI:
sideshow publishhonors flag order (surfaces appear in the order their--md/--code/ etc. flags appear on the command line, not a fixed sequence). Fixes CLI publish: surface order is fixed by flag identity, not command-line flag order #158.sideshow update <id> <file|-> --surface Ntargets a specific surface in a multi-surface post.sideshow surfacesubcommand:add,remove,edit,move.HTTP API:
POST /api/posts/:id/surfaces— append a surface (optionalbefore/after).PATCH /api/posts/:id/surfaces/:target— replace or content-edit one surface.DELETE /api/posts/:id/surfaces/:target— remove one surface (400 if last).PATCH /api/posts/:id/surfaces— reorder surfaces.PATCH /api/posts/:idextended with optionalsurfaceparam.MCP: New tools
add_surface,edit_surface,remove_surface,reorder_surfaces(both stdio and HTTP).Data model: Every surface carries an optional
id: string, assigned server-side. Existing data migrated automatically.Viewer: Surfaces keyed by stable id (Solid
<For>) instead of array position.get_post / sideshow show (this PR)
Adds a read primitive for fetching a single post by id — the missing counterpart to
list_posts/sideshow list.MCP:
get_post(id)— returns the full post object (surfaces with ids, version, history). Both stdio and HTTP transports.CLI:
sideshow show <id>— prints the full post JSON.Why
Per-surface operations need surface ids to target a specific surface. After a context compaction, the agent loses the surface ids from an earlier publish but still has the post id.
get_postgives agents a direct, cheap way to recover them without listing the entire session.Read parity after this PR
GET /api/sessions/:id/postslist_postssideshow listGET /api/posts/:idget_postsideshow show <id>Validation