Repository navigation
Labels
Description
Parent story: #1466
Goal
Make the reusable session workflows already available in mecatui discoverable through the TypeScript SDK's normal Client and Session APIs.
Scope
- Add typed session inspection methods for snapshots and transcripts.
- Add ergonomic operations for rename, permission-mode changes, and manual compaction.
- Add
clearas a successor-producing operation. Return the successor session without silently closing or invalidating the source session. - Add failed-step retry using the server's retry-start operation and return the resulting
Runlifecycle object. - Expand fork options to cover provider, model, reasoning effort, and worktree selection supported by the protocol.
- Preserve useful session metadata in SDK projections instead of discarding fields needed by non-TUI clients.
- Carry request options, cancellation, affinity, and typed server errors consistently with existing SDK operations.
The exact public names should follow the existing SDK conventions; likely shapes include session.snapshot(), session.transcript(), session.rename(), session.setMode(), session.compact(), session.clear(), and session.retry().
Boundaries
- Do not implement these operations by sending TUI command strings.
- Do not reproduce server-side validation, authorization, or session-state rules in the SDK.
- Do not make TUI-only presentation state part of the SDK.
Acceptance criteria
- Each in-scope workflow is reachable through a documented, typed high-level API without constructing a raw descriptor call.
- Successor-producing operations return a bound
Sessionfor the successor and leave the source object's lifecycle explicit. - Retry returns a normal
Runwith the same streaming, cancellation, and terminal-state guarantees as a new run. - Fork options map all supported protocol fields without lossy translation.
- High-level API tests cover success, typed failure, request options, cancellation where applicable, and session affinity.
- Public API reports and the SDK changelog are updated for the new surface.
Activity