WorkSpec v2.0 Type Reference
This page lists built-in types, reserved names, and the custom type definition mechanism.
This page lists built-in types, reserved names, and the custom type definition mechanism.
Built-in types¶
Core types¶
| Type | Meaning | Traits |
|---|---|---|
actor |
Human worker | stateful, performer |
equipment |
Machine/tool | stateful, performer |
resource |
Consumable input | quantifiable |
product |
Output | quantifiable |
service |
Automated/background performer | stateful, performer |
Digital types¶
| Type | Meaning | Traits |
|---|---|---|
display |
Digital screen | stateful |
screen_element |
UI component | stateful |
digital_object |
Virtual entity | stateful and/or quantifiable |
Type traits (capabilities)¶
WorkSpec uses type traits to define capabilities:
| Trait | Meaning | Typical properties |
|---|---|---|
| performer | Can be used in task.actor_id |
none required |
| stateful | Has discrete states | state |
| quantifiable | Has measurable quantity | quantity |
Built-in trait mappings:
actor: stateful + performerequipment: stateful + performerresource: quantifiableproduct: quantifiableservice: stateful + performerdisplay: statefulscreen_element: statefuldigital_object: stateful + quantifiable
Reserved type names¶
The following type names are reserved and must not be used:
timeline_actors_internal(and any type starting with_)anyunknown
Removed aliases (v2.0)¶
The following are not valid in v2.0:
material→ useresourceingredient→ useresourcetool→ useequipment
Custom type definitions¶
Custom types are declared at:
simulation.type_definitions
Example:
{
"type_definitions": {
"vehicle": {
"extends": "equipment",
"description": "Motorized transport equipment",
"additional_properties": {
"speed": { "type": "number", "unit": "km/h" },
"fuel_capacity": { "type": "number", "unit": "liters" }
}
}
}
}
Rules:
extendsmust reference a built-in type (or a chain that resolves to a built-in type).- Objects with
type: "vehicle"must have avehicledefinition. - Additional property schemas can be used by validators for type checking.