Skip to content

Converge the chat onto the SDK's shared derivations and ChatTurn grouping - #134

Merged
hbrooks merged 3 commits into
mainfrom
sdk-shared-derivation
Aug 26, 2026
Merged

Converge the chat onto the SDK's shared derivations and ChatTurn grouping#134
hbrooks merged 3 commits into
mainfrom
sdk-shared-derivation

Conversation

@hbrooks

@hbrooks hbrooks commented Aug 26, 2026

Copy link
Copy Markdown
Member

Finishes DRYing session rendering between the CLI and the web app onto @ellipsis-dev/sdk 0.16.0 (ellipsis#6389).

  • Repoints the SDK from the file: link to ^0.16.0 (now on npm) and seeds stores via seedTranscriptStore instead of hand-built snapshot/records_append frames.
  • Deletes ConnectApp's copies of deriveSandboxState, sessionLogText, awaitingAgentPhase, deliveredUnechoedSends, sandboxSummary, lastLines, hookPhrase, humanDuration and the SandboxState types; imports them from @ellipsis-dev/sdk/store. sessionLogText and deriveSandboxState are wrapped in src/lib/steps.ts to swap the store's middot separators for commas, so the terminal copy is unchanged (same pattern lifecycleText already used).
  • Replaces reshapeTranscript with the SDK's ChatTurn grouping: the chat now consumes groupRecordsToChatTurns (store.chatTurns(), the same objects the web's SessionChat renders, mapped to transcript items in src/lib/chatItems.ts. Turn errors render from turn.isError; the wake line still settles in place under the same key; the undisplayed-records counter is preserved (undisplayedRecordCount). --no-records groups a filtered record slice since turns carry no feed_seq.
  • The verbose steps path (session records / renderFrameHuman) stays on recordToItems/formatStepLine, untouched.
  • Tests: the moved derivations are tested in the SDK now; the CLI keeps comma-wording tests through the wrappers plus new chatTurnsToItems/undisplayedRecordCount coverage.

Casts worth a look: seedTranscriptStore call sites cast the REST page to the frame types (REST marks nullable fields optional, frames require them; same JSON either way). If that grates, an SDK follow-up could accept the REST flavor directly.
EOF
)

@hbrooks
hbrooks merged commit 7113399 into main Aug 26, 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