Skip to content

feat(runtime): @comline/runtime — the contract layer - #6

Merged
Kinflou merged 1 commit into
mainfrom
feat/ts-runtime-contract
Sep 2, 2026
Merged

feat(runtime): @comline/runtime — the contract layer#6
Kinflou merged 1 commit into
mainfrom
feat/ts-runtime-contract

Conversation

@Kinflou

@Kinflou Kinflou commented Sep 2, 2026

Copy link
Copy Markdown
Member

First cut of the TypeScript runtime that generated bindings will link against — the counterpart of the Rust comline-runtime crate. MPL-2.0, Node, zero runtime dependencies.

Module Contents
src/contract.ts RuntimeError, Kind + resolveKind, Call, Envelope, Outcome, Reply, CallError, the Codec and Dispatch interfaces
src/handshake.ts Handshake (the fixed 31-byte frame), FNV-1a nameHash, check()
src/codec.ts JsonCodec (name === "json", pairs with Rust format::Json)

Handshake and nameHash are byte-compatible with comline-runtime's contract::handshake — the nameHash reference vectors in the tests are cross-checked against the Rust FNV-1a constants, so a TS peer and a Rust peer generated from the same schema negotiate the same frame.

CI gains a runtime - Node job (npm ci / npm run typecheck / npm testtsc + node --test) next to the existing cargo one.

Next: Framing (datagram + JSON-RPC), Transport + an in-memory pair, Client / Server, then the generator emitting <Proto>Client / dispatcher against this package, then lib mode.

First cut of the TypeScript runtime generated bindings will link against
(the counterpart of the Rust comline-runtime crate). MPL-2.0, Node, zero
runtime dependencies.

  - contract.ts — RuntimeError, Kind + resolveKind, Call, Envelope,
    Outcome, Reply, CallError, the Codec and Dispatch interfaces.
  - handshake.ts — Handshake (the fixed 31-byte frame), FNV-1a nameHash,
    check(). Byte-compatible with comline-runtime's contract::handshake —
    the nameHash reference vectors are cross-checked against the Rust
    constants, so a TS peer and a Rust peer generated from one schema
    negotiate the same frame.
  - codec.ts — JsonCodec (name "json", pairs with Rust format::Json).

Framing (datagram + JSON-RPC), Transport, Client, Server, and a generator
that emits <Proto>Client / dispatcher against this package follow.

CI gains a Node job (npm ci / typecheck / node --test) alongside the
existing cargo one.
@Kinflou
Kinflou merged commit 4256d26 into main Sep 2, 2026
4 checks passed
@Kinflou
Kinflou deleted the feat/ts-runtime-contract branch September 2, 2026 08:45
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