Expand description
TypeScript schema generation for runtime service descriptors.
Generates the ServiceDescriptor constant used by the runtime to perform
schema-driven decode/encode for all methods. The generated code has zero
serialization logic — everything is driven by the descriptor at runtime.
Each method descriptor has:
args: a tuple schema covering all arguments (decoded once before dispatch)result: the fullResult<T, RoamError<E>>enum schema for encoding responses
The RoamError<E> schema always has four variants at fixed indices:
- 0: User(E) — user-defined error (null fields for infallible methods)
- 1: UnknownMethod — unit
- 2: InvalidPayload — unit
- 3: Cancelled — unit
Functions§
- generate_
descriptor - Generate the service descriptor constant.
- generate_
schema - Generate a TypeScript Schema object literal for a type.