Repository navigation
feat(sdk-ts): sessions (session/scoped) + lock down sdk/typescript to the facade-only layout - #1670
Merged
Merged
Conversation
… of the Rust client The TypeScript twin of the merged Rust client surface (continuum-client #1669), completing the sessions layer on the JS/web/desktop SDK. Mirrors the Rust semantics exactly so the conformance contract holds across both: - transport.ts: SessionIdentity { userId?, sessionId? } (Uuids as strings at the JSON boundary); Transport.session(); and stampContext(value, contextId) — the shared helper that stamps contextId as an envelope/payload sibling, the twin of CommandClient::stamp_context (only objects; no-op when unscoped; identity is NEVER stamped — kernel-injected, unforgeable client-side). - Continuum.session (getter) + Continuum.scoped(contextId) → a scoped Continuum whose commands + events auto-stamp contextId. Same transport + identity, only the context differs. - Commands / Events carry the optional contextId and stamp via stampContext. Conformance dimension 6 (sessions) added to Commands.test.ts — the contract the swift/kotlin/rust twins mirror name-for-name: session() surfaces established identity (never fabricated); scoped() auto-stamps contextId into both command envelope and event payload; unscoped stamps nothing (opt-in); scoped carries identity forward + leaves the parent unscoped. MockTransport gains session(). Uniform shape now real on BOTH the Rust and TS skins: connect → session → scoped(context), identical for a browser tab and a persona ([[persona-is-a-client]]). Not run locally (headless box, no node — by design); written against the live facade API + mirrors the validated Rust (continuum-client: 23 tests green). Runs in CI where node is present. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The file is THE SDK conformance SPEC — the authoritative cross-language specification (addressing, commands, events, handles, timing, sessions; six dimensions the native twins implement against name-for-name), not a unit test of Commands.ts. It started as a Commands sketch and kept that name; the name lied twice — wrong scope (it's the whole facade) and 'test' framed the load-bearing contract as incidental verification. 'spec' is what it is and what the team already calls it; the .spec.ts suffix still runs under vitest (the executable specification), so the contract both documents AND proves itself. Co-Authored-By: Claude Opus 4.8 <[email protected]>
joelteply
force-pushed
the
feat/sdk-ts-sessions
branch
from
June 17, 2026 22:52
ee4b092 to
a08f6c5
Compare
The folder was two SDKs jammed together: the new thin facade (transport, Commands, Events, Handle, Continuum, index, conformance spec, generated/) AND a full DUPLICATE of the legacy RustCoreIPC client (RustCore, RustCoreIPC, the 24 `modules/` mixins, ~12 hand-written wire types, and loose top-level test-*/ benchmark-*/verify-* scripts). Those loose `test-*.ts` scripts are exactly why a conformance CONTRACT read as "just a test." The duplicate is orphaned cruft: the canonical legacy client lives at core/continuum-core/bindings/RustCoreIPC (CLAUDE.md's IPC-mixin location), and all 108 src/ consumers import it from THERE. Verified nothing in the repo imports the sdk/typescript copies — the package's public surface (index.ts) and its only internal consumer (the conformance spec) reference the facade alone. Removed the orphaned duplicate. sdk/typescript is now ONLY the thin typed client its package.json describes: Continuum.ts · Commands.ts · Events.ts · Handle.ts · transport.ts (facade) conformance.spec.ts (the contract) generated/CommandMap.ts (generated types) index.ts · package.json · tsconfig.json Naming is now coherent: PascalCase = class-exporting module; lowercase = types/util/spec/barrel; generated types isolated under generated/. No behavior change, no consumer change (the deleted files had zero importers). The canonical legacy bindings at core/continuum-core/bindings are untouched. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The TypeScript twin of the merged Rust client surface (
continuum-client, #1669), completing the sessions layer on the JS/web/desktop SDK. Mirrors the Rust semantics exactly so the conformance contract holds across both skins.transport.ts—SessionIdentity { userId?, sessionId? }(Uuids as strings at the JSON boundary);Transport.session(); andstampContext(value, contextId)— the shared helper that stampscontextIdas an envelope/payload sibling, the twin ofCommandClient::stamp_context(objects only; no-op when unscoped; identity is never stamped — kernel-injected, unforgeable client-side).Continuum.session(getter) +Continuum.scoped(contextId)→ a scopedContinuumwhosecommands+eventsauto-stampcontextId. Same transport + identity, only the context differs.Commands/Eventscarry the optionalcontextIdand stamp viastampContext.Conformance dimension 6 (sessions)
Added to
Commands.test.ts— the contract the swift/kotlin/rust twins mirror name-for-name:session()surfaces established identity (never fabricated);scoped()auto-stampscontextIdinto both command envelope and event payload; unscoped stamps nothing (opt-in); scoped carries identity forward and leaves the parent unscoped.The shape, now real on both skins
connect → session → scoped(context), identical for a browser tab and a persona. A persona's tool executor is just a scoped client.Caveat
Not run locally (headless box, no node — by design). Written against the live facade API and mirrors the validated Rust (
continuum-client: 23 tests green). Runs in CI where node is present.Next
The persona
TsIpcToolExecutorcomposed as a scoped client → fillstool_context()→ acts-loop live (task #15). That one touches the cognition pipeline, so it gets its own careful slice (read PERSONA-COGNITION-PIPELINE.md first).🤖 Generated with Claude Code