Skip to content

Migrate the TypeScript SDK to Effect and unify the station protocol - #171

Merged
kstonekuan merged 2 commits into
mainfrom
effect-sdk-station-protocol
Nov 30, 2026
Merged

kstonekuan merged 2 commits into
mainfrom
effect-sdk-station-protocol

Conversation

@kstonekuan

@kstonekuan kstonekuan commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

  • Move the TypeScript SDK's asynchronous workflows to Effect while keeping a Promise-based public API. Model connection and lease transitions explicitly and scope the event reader, lease renewal, and command cleanup.
  • End Rust subscriptions and pending sequence waits on explicit reader shutdown. Release uninstalled lease grants when acquisition fails or is cancelled. Keep sequence image history tied to the most recently started local submission in TypeScript, Rust, and Python.
  • Move revocation into a retry-safe station operation, return structured lease refusals, and send a fresh snapshot on the same request when a replay cursor is stale.

How you checked it

  • pnpm check and 212 TypeScript tests passed.
  • Regenerated contracts and verified no generated-file drift.
  • Rust formatting and strict Clippy passed for the server, SDK, and Python bindings. 291 server-core tests and 55 Rust SDK and CLI tests passed. Three server-core tests were ignored.
  • Python lint, formatting, type, and import checks passed. 15 Python and cross-SDK integration tests passed against the rebuilt station, including the packed TypeScript SDK.

Notes for reviewers

Update the station and SDKs together. Run telemetry and replay now travel through /events as run events. The separate /run/records endpoint was removed. Rust's next_sequence() now returns a Result. The station still advertises operation completion for the examples pinned to the released SDK. The current SDKs use the completion route directly.

Lease revocation uses the station's existing stop and handoff checks before releasing authority. Local validation uses loopback HTTP and simulated stations. Physical hardware was outside validation.

@kstonekuan
kstonekuan marked this pull request as ready for review November 30, 2026 00:57
@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; the previous image-error finding is fixed and no new blocking issue was found.RetriggerView in GreptileConfidence Score: 5/5

[Critical impact] The PR appears safe to merge; the previous image-error finding is fixed and no new blocking issue was found.

Summary

The PR moves TypeScript workflows to Effect while keeping the public Promise API. It also unifies station telemetry and lease operations.

  • Station clients receive state and run telemetry through one event stream.
  • Lease revocation stops the current holder before the station releases control.
  • Sequence image history stays tied to the latest local submission.
  • The TypeScript SDK keeps Promise calls while Effect scopes its async work.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  SDK[SDK clients] -->|Commands and leases| Station[Station HTTP API]
  Station -->|State and run events| Events["/events"]
  Events --> SDK
  Events --> Recorder[Recorder]
  Recorder -->|Separate replay positions| Events
  Recorder --> Archive[Recording archive]
Loading

Reviews (2) · Last reviewed commit: "Preserve completed sequences and resume ..." · Reviewed by Greptile

Comment thread typescript-client/src/robot-tools.ts Resolved
@kstonekuan
kstonekuan merged commit c4eedb9 into main Nov 30, 2026
12 checks passed
@kstonekuan
kstonekuan deleted the effect-sdk-station-protocol branch November 30, 2026 03:07
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