Skip to content

Depend on @ellipsis-dev/sdk; render connect from the SDK transcript store#65

Merged
hbrooks merged 2 commits into
mainfrom
sdk-swap
Jul 21, 2026
Merged

Depend on @ellipsis-dev/sdk; render connect from the SDK transcript store#65
hbrooks merged 2 commits into
mainfrom
sdk-swap

Conversation

@hbrooks

@hbrooks hbrooks commented Jul 21, 2026

Copy link
Copy Markdown
Member

The CLI now consumes @ellipsis-dev/sdk — the official TypeScript SDK for the Ellipsis platform (generated API types, the session-stream WebSocket client, and the session transcript store) — instead of hand-rolling that layer. Net −1,700 lines.

What moved to the SDK

  • src/lib/ws.ts and src/lib/events.ts are deleted: the stream machinery (reconnect/backoff, after_seq resume, heartbeat liveness, frame types) and the transcript shaping (event → items, tool-run collapsing, pending-call inference, lifecycle copy, cost folding) are @ellipsis-dev/sdk/stream + @ellipsis-dev/sdk/store imports now. The new src/lib/stream.ts keeps only what is CLI-specific: ELLIPSIS_WS_BASE resolution, the bearer-door URL, and the ws-package adapter behind the SDK's injected openSocket.
  • src/lib/types.ts: the session-surface types (records, inbox messages, turns, the session wire shape, and their request/response DTOs) are SDK re-exports under their historical names — generated from the server's schema, so they can no longer drift.

ConnectApp renders from the SDK store

agent session connect is now driven by one SessionTranscriptStore: records arrive pushed over the stream, so the 250ms REST refresh loop, the 3s records/status polls, and the turns-polling for queued chips are gone. Queued chips retire by acknowledged message id (the old text-matching dedup is deleted). If the stream is unavailable, a REST poll feeds the same store through synthetic frames — the UI is identical either way. --no-records still skips replaying history on screen without re-streaming it.

Also: src/ui/SessionView.tsx deleted (no callers).

Verified

tsc clean; 201 tests green (the deleted ws/events suites live in the SDK now, incl. a golden frame fixture recorded from the real server stream); bun --compile binary builds and answers --version; full suite re-run against the published @ellipsis-dev/sdk@0.1.0 from npm (not a local link).

hbrooks added 2 commits July 21, 2026 17:28
…tore

The session-stream machinery now comes from the published @ellipsis-dev/sdk (types generated from the server's schema; WebSocket client; SessionTranscriptStore):

- src/lib/ws.ts and src/lib/events.ts are deleted; the reconnect/resume/backoff machinery, frame types, and transcript shaping are SDK imports. src/lib/stream.ts keeps the CLI-specific transport bits: ELLIPSIS_WS_BASE resolution, the bearer-door URL, and the ws-package adapter behind the SDK's injected openSocket.

- ConnectApp renders from one SessionTranscriptStore: records arrive PUSHED as records_append frames (the 250ms REST refresh loop, the 3s records/status polls, and the turns-polling for queued chips are gone), the open inbox slice drives the queued region, chips retire by acknowledged message id (text-matching dedup deleted), and deltas overlay from the store. If the stream is unavailable, a REST poll feeds the same store through synthetic frames, so the UI is identical either way.

- types.ts: the session-surface types (records, messages, turns, send request/response, status/source/state unions) are SDK re-exports under their historical names; the endpoints outside the SDK's REST surface stay hand-rolled for now.

- SessionView.tsx deleted (no callers). ws/events tests deleted with their subjects (the SDK carries those suites); stream.test.ts covers the CLI-side adapter.

Verified: tsc clean, 201 tests green, bun --compile binary builds and answers --version. NOTE: do not merge until @ellipsis-dev/sdk@0.1.x is on npm (dev loop is bun link).
@hbrooks
hbrooks merged commit 0c89daf into main Jul 21, 2026
1 check 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.

1 participant