Skip to content

feat(app): GET /api/surfaces/recent — post-grained recent surfaces#173

Draft
benvinegar wants to merge 1 commit into
mainfrom
feat/recent-surfaces-endpoint
Draft

feat(app): GET /api/surfaces/recent — post-grained recent surfaces#173
benvinegar wants to merge 1 commit into
mainfrom
feat/recent-surfaces-endpoint

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Adds GET /api/surfaces/recent?limit= to the workspace app: the N most-recently-updated surfaces (posts) across all sessions, newest first — a post-grained source for cross-session "latest posts" feeds, distinct from the session-grained GET /api/sessions.

Each item carries its sessionId, sessionTitle, agent, title, partKinds, timestamps, and parts with oversized inline text capped server-side (8000 chars, truncated: true flag) while images stay referenced by assetId. So a client can render a real, clipped preview cheaply and load the full post on click.

  • listRecentPosts(limit) added to the Store interface and implemented in both SqlStore (ORDER BY updatedAt DESC LIMIT ?) and JsonFileStore; covered by the shared storeContract so both backends are exercised.
  • Auth: gated exactly like /api/sessions. Fixes a latent public-read over-match — /api/surfaces/recent is explicitly excluded from the /api/surfaces/ public prefix so it isn't exposed on session-scoped boards.
  • Integration tests in test/surfaces-recent.test.ts (ordering, limit clamp, truncation, assetId passthrough, auth). Changeset (minor). 389/389 tests pass.

🤖 Generated with Claude Code

Post-grained source for cross-session feeds (Org Home + per-workspace Home),
distinct from the session-grained /api/sessions. Caps oversized inline text
parts (truncated:true) while images stay by-reference (assetId); same auth as
/api/sessions (not broadened on a session-scoped publicRead board).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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