Skip to content

feat: add get_post / sideshow show for single-post reads#166

Merged
benvinegar merged 3 commits into
mainfrom
feat/get-post
Jun 26, 2026
Merged

feat: add get_post / sideshow show for single-post reads#166
benvinegar merged 3 commits into
mainfrom
feat/get-post

Conversation

@benvinegar

@benvinegar benvinegar commented Jun 26, 2026

Copy link
Copy Markdown
Member

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:

HTTP API:

  • POST /api/posts/:id/surfaces — append a surface (optional before/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/:id extended with optional surface param.

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_post gives agents a direct, cheap way to recover them without listing the entire session.

Read parity after this PR

Need HTTP API MCP CLI
List posts in session GET /api/sessions/:id/posts list_posts sideshow list
Get one post GET /api/posts/:id get_post sideshow show <id>

Validation

npm test          → 379 pass, 0 fail
npm run typecheck → 3 programs clean
npm run lint      → 0 warnings, 0 errors
npm run format:check → clean

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.
@benvinegar benvinegar merged commit d58264a into main Jun 26, 2026
9 checks passed
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.

CLI publish: surface order is fixed by flag identity, not command-line flag order

1 participant