Skip to content

Documentation / @super-line/core / Contract

Interface: Contract

Defined in: packages/core/src/contract.ts:138

The single source of truth, imported by both server and client. Split by direction and scoped by role: a shared base every role inherits, plus one block per role.

Properties

collections?

optional collections?: Record<string, CollectionDef>

Defined in: packages/core/src/contract.ts:148

Typed row collections (see CollectionDef). A top-level sibling of roles, not a role block: a collection is a global data domain, and per-caller visibility is a server-side row policy, not contract structure.


plugins?

optional plugins?: readonly ContractPlugin<ContractFragment>[]

Defined in: packages/core/src/contract.ts:156

The ContractPlugins whose fragments were merged in (ADR-0016). An INPUT to defineContract, retained on the merged result so the origin of each collection/surface key stays knowable — the Control Center attributes contract entries to their owning plugin from this. Contract-time only: a plugin may contribute runtime behavior without a fragment (the inspector), so this is NOT the list of plugins registered on the server.


roles

roles: Record<string, RoleBlock>

Defined in: packages/core/src/contract.ts:142

Per-role surfaces. A connection's role selects which one (plus shared) it sees.


shared?

optional shared?: Directional

Defined in: packages/core/src/contract.ts:140

Surface common to every role (merged into each role's effective surface).

Released under the MIT License.