OSDL Component Library Definition
Describes a component library: the set of component types a plugin contributes, including their ports, parameter schemas, observable state, and emitted events. Tools derive palettes, parameter forms, validation, and documentation from this document; it is the contract between an engine plugin and every OSDL-aware tool.
Generated from spec/schemas/osdl.library.schema.json · https://osdl.dev/schemas/0.1/osdl.library.schema.json
Document root#
| Field | Type | Description |
$schema |
string |
Optional URI of the OSDL library JSON Schema, for editor tooling. |
osdlrequired |
"0.1" |
Version of the OSDL specification this library definition conforms to. |
libraryrequired |
object |
|
Definitions#
componentType#
| Field | Type | Description |
namerequired |
string |
Local type name. The full type is <namespace>.<name>. pattern ^[a-z][a-zA-Z0-9_]*$ |
label |
string |
|
descriptionrequired |
string |
Required. The semantic contract of this component type, written for humans and language models alike. |
category |
string |
Palette grouping hint for visual editors. |
portsrequired |
array<portSpec> |
The ports every instance of this type exposes. May be empty for components referenced only via expressions (e.g. sd.auxiliary). |
params |
object |
A JSON Schema (draft 2020-12) that validates the params object of instances of this type (phase-two validation). MAY reference value definitions from the core schema, e.g. https://osdl.dev/schemas/0.1/osdl.schema.json#/$defs/numericValue. |
state |
array<stateVar> |
Observable state variables, addressable as <componentId>.<stateId> in outputs and expressions. |
emits |
array<eventSpec> |
Event types instances of this component emit onto the simulation event stream. |
metadata |
object |
|
portSpec#
| Field | Type | Description |
idrequired |
string |
pattern ^[A-Za-z_][A-Za-z0-9_-]*$ |
directionrequired |
"in" | "out" |
|
kind |
"entity" | "message" | "value" |
What the port carries: entities under the custody protocol, immutable message payloads, or typed scalar values. Connections must join ports of the same kind. default "entity" |
description |
string |
|
multiple |
boolean |
Whether more than one connection may attach to this port. default false |
stateVar#
| Field | Type | Description |
idrequired |
string |
pattern ^[A-Za-z_][A-Za-z0-9_-]*$ |
typerequired |
"number" | "integer" | "boolean" | "string" |
|
descriptionrequired |
string |
|
unit |
string |
|
eventSpec#
| Field | Type | Description |
eventrequired |
string |
pattern ^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)+$ |
descriptionrequired |
string |
|
payload |
object |
A JSON Schema (draft 2020-12) describing the event payload. |