Skip to content

Sync v1 REST client with API spec (/v1/assets)#28

Open
ellipsis-dev[bot] wants to merge 1 commit into
mainfrom
sync/v1-assets-client
Open

Sync v1 REST client with API spec (/v1/assets)#28
ellipsis-dev[bot] wants to merge 1 commit into
mainfrom
sync/v1-assets-client

Conversation

@ellipsis-dev

@ellipsis-dev ellipsis-dev Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Syncs the hand-maintained /v1 REST client with the API spec after ellipsis-dev/ellipsis#5634 (Agent asset storage: backend upload API + gated viewing route), which added the /v1/assets surface.

Only src/lib/api.ts and src/lib/types.ts changed.

Endpoints added

  • POST /v1/assetscreateAsset(req: CreateAssetRequest): Promise<CreateAssetResponse> — upload a base64 PNG (≤10 MiB), returns the gated dashboard URL.
  • GET /v1/assetslistAssets(query?: ListAssetsQuery): Promise<AssetView[]> — newest-first metadata for the token's customer; optional agent_session_id filter and limit. Unwraps ListAssetsResponse.assets (matches the listAgentSessions pattern).
  • GET /v1/assets/{asset_id}getAsset(assetId): Promise<GetAssetResponse> — metadata + gated url + short-lived presigned download_url.

Types added

  • AssetViewid, filename, content_type, size_bytes, created_at, optional agent_session_id.
  • CreateAssetRequestfilename, content_type, data_b64.
  • CreateAssetResponseasset, url.
  • ListAssetsQueryagent_session_id?, limit?.
  • ListAssetsResponseassets.
  • GetAssetResponseasset, url, download_url.

Out of scope

  • GET /frontend/assets/{asset_id} is a /frontend viewer route, not part of the public /v1 surface — intentionally not mirrored.
  • No run-stream / WebSocket frame schema changes in this PR, so src/lib/ws.ts is untouched.

Verification

bun run typecheck clean; bun run test → 145 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.

0 participants