Chasing MasteryDevelopers
Reference
Chasing Mastery public platform

TypeScript SDK

The small public helper layer that validates packages, engines, worker adapters, and portable UI messages.

The package SDK re-exports public contracts and adds validated author helpers. It deliberately does not expose persistence, member data, Station, OBS, filesystem, network, or provider authority.

Engine contracts

Prop

Type

Prop

Type

Prop

Type

Portable bridge

Prop

Type

Validated helpers

HelperPurpose
definePackageParse the full manifest and every contribution.
defineActivityEngineValidate descriptions, contexts, inputs, and transitions on direct calls.
defineCoordinationEngineValidate rosters, signals, and match transitions.
defineNarrationDirectorValidate provider-neutral narration plans.
createActivityWorkerHandlerExpose one engine through the isolated runtime protocol.
createCoordinationWorkerHandlerExpose deterministic coordination policy.
createNarrationWorkerHandlerExpose fact-to-cue planning.
createPortablePackageUiBridgeUse one bounded transport in iframe and WebView hosts.
parsePackageUiMessage / parseHostUiMessageValidate portable UI frames at boundaries.

Prefer these wrappers to custom transport or ad hoc validation. They keep local tests, Workbench, and production execution on the same contract.

SDK implementationpackages/sdk/src/index.ts

Exact exported helpers and validated worker adapters.

Contract barrelpackages/contracts/src/index.ts

Allowlisted public schema and type exports.

SDK boundary testtest/package-workbench.test.ts

Prevents private host or domain imports from leaking into public packages.

On this page