workspec 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/bin/workspec.js +289 -0
- package/index.js +10 -0
- package/package.json +30 -0
- package/v2.0.schema.json +775 -0
- package/workspec-migrate-v1-to-v2.js +714 -0
- package/workspec-validator.js +1812 -0
package/v2.0.schema.json
ADDED
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://universalautomation.wiki/workspec/v2.0.schema.json",
|
|
4
|
+
"title": "WorkSpec v2.0",
|
|
5
|
+
"description": "WorkSpec is an AI-native JSON specification for modeling work activities, processes, and simulations. This schema defines the WorkSpec v2.0 document structure (world/process split, unified interactions, dependency operators, flexible durations, multi-day starts, recipes, and type definitions).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"simulation"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"$schema": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"format": "uri",
|
|
14
|
+
"description": "Reference to this JSON Schema for IDE autocomplete and validation. Recommended value: 'https://universalautomation.wiki/workspec/v2.0.schema.json'."
|
|
15
|
+
},
|
|
16
|
+
"simulation": {
|
|
17
|
+
"$ref": "#/definitions/Simulation"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"additionalProperties": true,
|
|
21
|
+
"definitions": {
|
|
22
|
+
"Simulation": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"description": "Root container for a WorkSpec simulation (also referred to as: workflow, process).",
|
|
25
|
+
"required": [
|
|
26
|
+
"schema_version",
|
|
27
|
+
"meta",
|
|
28
|
+
"config",
|
|
29
|
+
"world",
|
|
30
|
+
"process"
|
|
31
|
+
],
|
|
32
|
+
"properties": {
|
|
33
|
+
"schema_version": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"pattern": "^[0-9]+\\.[0-9]+$",
|
|
36
|
+
"enum": [
|
|
37
|
+
"2.0"
|
|
38
|
+
],
|
|
39
|
+
"description": "WorkSpec schema version using Major.Minor format. For this schema: '2.0'."
|
|
40
|
+
},
|
|
41
|
+
"meta": {
|
|
42
|
+
"$ref": "#/definitions/Meta"
|
|
43
|
+
},
|
|
44
|
+
"config": {
|
|
45
|
+
"$ref": "#/definitions/Config"
|
|
46
|
+
},
|
|
47
|
+
"world": {
|
|
48
|
+
"$ref": "#/definitions/World"
|
|
49
|
+
},
|
|
50
|
+
"process": {
|
|
51
|
+
"$ref": "#/definitions/Process"
|
|
52
|
+
},
|
|
53
|
+
"type_definitions": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"description": "Optional custom type definitions. Keys are custom type names; values describe base type extension and additional properties.",
|
|
56
|
+
"additionalProperties": {
|
|
57
|
+
"$ref": "#/definitions/TypeDefinition"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"not": {
|
|
62
|
+
"properties": {
|
|
63
|
+
"meta": {
|
|
64
|
+
"required": [
|
|
65
|
+
"article_title"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"additionalProperties": true
|
|
71
|
+
},
|
|
72
|
+
"Meta": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"description": "Human-readable metadata about the simulation.",
|
|
75
|
+
"required": [
|
|
76
|
+
"title",
|
|
77
|
+
"description",
|
|
78
|
+
"domain"
|
|
79
|
+
],
|
|
80
|
+
"properties": {
|
|
81
|
+
"title": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"description": "Human-readable title (also referred to as: name, label)."
|
|
84
|
+
},
|
|
85
|
+
"description": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"description": "Detailed description of what this simulation models (also referred to as: summary, overview)."
|
|
88
|
+
},
|
|
89
|
+
"domain": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"description": "Industry/domain category (also referred to as: sector, category)."
|
|
92
|
+
},
|
|
93
|
+
"version": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"description": "Optional document version (not schema version)."
|
|
96
|
+
},
|
|
97
|
+
"author": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"description": "Optional author/creator."
|
|
100
|
+
},
|
|
101
|
+
"created_at": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"format": "date-time",
|
|
104
|
+
"description": "Optional ISO 8601 creation timestamp."
|
|
105
|
+
},
|
|
106
|
+
"updated_at": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"format": "date-time",
|
|
109
|
+
"description": "Optional ISO 8601 update timestamp."
|
|
110
|
+
},
|
|
111
|
+
"tags": {
|
|
112
|
+
"type": "array",
|
|
113
|
+
"items": {
|
|
114
|
+
"type": "string"
|
|
115
|
+
},
|
|
116
|
+
"description": "Optional tags for discovery."
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"not": {
|
|
120
|
+
"required": [
|
|
121
|
+
"article_title"
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"additionalProperties": true
|
|
125
|
+
},
|
|
126
|
+
"Config": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"description": "Global simulation configuration (timing, locale, currency).",
|
|
129
|
+
"required": [
|
|
130
|
+
"time_unit",
|
|
131
|
+
"start_time",
|
|
132
|
+
"end_time",
|
|
133
|
+
"currency",
|
|
134
|
+
"locale"
|
|
135
|
+
],
|
|
136
|
+
"properties": {
|
|
137
|
+
"time_unit": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"enum": [
|
|
140
|
+
"seconds",
|
|
141
|
+
"minutes",
|
|
142
|
+
"hours"
|
|
143
|
+
],
|
|
144
|
+
"description": "Base unit for numeric duration values."
|
|
145
|
+
},
|
|
146
|
+
"start_time": {
|
|
147
|
+
"$ref": "#/definitions/TimeOrDateTime",
|
|
148
|
+
"description": "Simulation start time (HH:MM / HH:MM:SS or ISO 8601 date-time)."
|
|
149
|
+
},
|
|
150
|
+
"end_time": {
|
|
151
|
+
"$ref": "#/definitions/TimeOrDateTime",
|
|
152
|
+
"description": "Simulation end time (HH:MM / HH:MM:SS or ISO 8601 date-time)."
|
|
153
|
+
},
|
|
154
|
+
"timezone": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"description": "Optional IANA timezone identifier (default: UTC)."
|
|
157
|
+
},
|
|
158
|
+
"currency": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"pattern": "^[A-Z]{3}$",
|
|
161
|
+
"description": "ISO 4217 currency code."
|
|
162
|
+
},
|
|
163
|
+
"locale": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"pattern": "^[a-z]{2}(-[A-Z]{2})?$",
|
|
166
|
+
"description": "BCP 47 locale (e.g., en-US)."
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"additionalProperties": true
|
|
170
|
+
},
|
|
171
|
+
"World": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"description": "Static environment definition: layout and objects.",
|
|
174
|
+
"required": [
|
|
175
|
+
"objects"
|
|
176
|
+
],
|
|
177
|
+
"properties": {
|
|
178
|
+
"layout": {
|
|
179
|
+
"$ref": "#/definitions/Layout"
|
|
180
|
+
},
|
|
181
|
+
"objects": {
|
|
182
|
+
"type": "array",
|
|
183
|
+
"items": {
|
|
184
|
+
"$ref": "#/definitions/Object"
|
|
185
|
+
},
|
|
186
|
+
"description": "All entities in the simulation (people, equipment, resources, products, services, digital objects)."
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"additionalProperties": true
|
|
190
|
+
},
|
|
191
|
+
"Process": {
|
|
192
|
+
"type": "object",
|
|
193
|
+
"description": "Dynamic workflow definition: tasks and optional recipes.",
|
|
194
|
+
"required": [
|
|
195
|
+
"tasks"
|
|
196
|
+
],
|
|
197
|
+
"properties": {
|
|
198
|
+
"tasks": {
|
|
199
|
+
"type": "array",
|
|
200
|
+
"items": {
|
|
201
|
+
"$ref": "#/definitions/Task"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"recipes": {
|
|
205
|
+
"$ref": "#/definitions/Recipes"
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"additionalProperties": true
|
|
209
|
+
},
|
|
210
|
+
"Layout": {
|
|
211
|
+
"type": "object",
|
|
212
|
+
"description": "Spatial configuration for the simulation world.",
|
|
213
|
+
"properties": {
|
|
214
|
+
"meta": {
|
|
215
|
+
"$ref": "#/definitions/LayoutMeta"
|
|
216
|
+
},
|
|
217
|
+
"locations": {
|
|
218
|
+
"type": "array",
|
|
219
|
+
"items": {
|
|
220
|
+
"$ref": "#/definitions/Location"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"additionalProperties": true
|
|
225
|
+
},
|
|
226
|
+
"LayoutMeta": {
|
|
227
|
+
"type": "object",
|
|
228
|
+
"description": "Layout measurement and rendering hints.",
|
|
229
|
+
"properties": {
|
|
230
|
+
"units": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"enum": [
|
|
233
|
+
"meters",
|
|
234
|
+
"feet",
|
|
235
|
+
"pixels"
|
|
236
|
+
],
|
|
237
|
+
"description": "Distance unit for coordinates."
|
|
238
|
+
},
|
|
239
|
+
"pixels_per_unit": {
|
|
240
|
+
"type": "number",
|
|
241
|
+
"minimum": 1,
|
|
242
|
+
"description": "Rendering scale factor."
|
|
243
|
+
},
|
|
244
|
+
"origin": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"enum": [
|
|
247
|
+
"top-left",
|
|
248
|
+
"bottom-left",
|
|
249
|
+
"top-right",
|
|
250
|
+
"bottom-right"
|
|
251
|
+
],
|
|
252
|
+
"description": "Coordinate origin."
|
|
253
|
+
},
|
|
254
|
+
"coordinate_system": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"enum": [
|
|
257
|
+
"2d",
|
|
258
|
+
"3d"
|
|
259
|
+
],
|
|
260
|
+
"description": "Coordinate system mode."
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"additionalProperties": true
|
|
264
|
+
},
|
|
265
|
+
"Location": {
|
|
266
|
+
"type": "object",
|
|
267
|
+
"description": "A place/area where objects exist and tasks occur.",
|
|
268
|
+
"required": [
|
|
269
|
+
"id",
|
|
270
|
+
"name"
|
|
271
|
+
],
|
|
272
|
+
"properties": {
|
|
273
|
+
"id": {
|
|
274
|
+
"$ref": "#/definitions/PlainId",
|
|
275
|
+
"description": "Location identifier (snake_case)."
|
|
276
|
+
},
|
|
277
|
+
"name": {
|
|
278
|
+
"type": "string"
|
|
279
|
+
},
|
|
280
|
+
"shape": {
|
|
281
|
+
"$ref": "#/definitions/Shape"
|
|
282
|
+
},
|
|
283
|
+
"coordinates": {
|
|
284
|
+
"$ref": "#/definitions/Coordinates"
|
|
285
|
+
},
|
|
286
|
+
"parent_id": {
|
|
287
|
+
"type": "string"
|
|
288
|
+
},
|
|
289
|
+
"properties": {
|
|
290
|
+
"type": "object",
|
|
291
|
+
"additionalProperties": true
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"additionalProperties": true
|
|
295
|
+
},
|
|
296
|
+
"Shape": {
|
|
297
|
+
"type": "object",
|
|
298
|
+
"description": "Geometric shape for layout rendering.",
|
|
299
|
+
"required": [
|
|
300
|
+
"type"
|
|
301
|
+
],
|
|
302
|
+
"properties": {
|
|
303
|
+
"type": {
|
|
304
|
+
"type": "string",
|
|
305
|
+
"enum": [
|
|
306
|
+
"rect",
|
|
307
|
+
"circle",
|
|
308
|
+
"polygon"
|
|
309
|
+
]
|
|
310
|
+
},
|
|
311
|
+
"x": {
|
|
312
|
+
"type": "number"
|
|
313
|
+
},
|
|
314
|
+
"y": {
|
|
315
|
+
"type": "number"
|
|
316
|
+
},
|
|
317
|
+
"width": {
|
|
318
|
+
"type": "number",
|
|
319
|
+
"minimum": 0
|
|
320
|
+
},
|
|
321
|
+
"height": {
|
|
322
|
+
"type": "number",
|
|
323
|
+
"minimum": 0
|
|
324
|
+
},
|
|
325
|
+
"radius": {
|
|
326
|
+
"type": "number",
|
|
327
|
+
"minimum": 0
|
|
328
|
+
},
|
|
329
|
+
"points": {
|
|
330
|
+
"type": "array",
|
|
331
|
+
"items": {
|
|
332
|
+
"type": "object",
|
|
333
|
+
"required": [
|
|
334
|
+
"x",
|
|
335
|
+
"y"
|
|
336
|
+
],
|
|
337
|
+
"properties": {
|
|
338
|
+
"x": {
|
|
339
|
+
"type": "number"
|
|
340
|
+
},
|
|
341
|
+
"y": {
|
|
342
|
+
"type": "number"
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"additionalProperties": true
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"additionalProperties": true
|
|
350
|
+
},
|
|
351
|
+
"Coordinates": {
|
|
352
|
+
"type": "object",
|
|
353
|
+
"description": "Optional coordinate metadata.",
|
|
354
|
+
"properties": {
|
|
355
|
+
"x": {
|
|
356
|
+
"type": "number"
|
|
357
|
+
},
|
|
358
|
+
"y": {
|
|
359
|
+
"type": "number"
|
|
360
|
+
},
|
|
361
|
+
"z": {
|
|
362
|
+
"type": "number"
|
|
363
|
+
},
|
|
364
|
+
"width": {
|
|
365
|
+
"type": "number",
|
|
366
|
+
"minimum": 0
|
|
367
|
+
},
|
|
368
|
+
"height": {
|
|
369
|
+
"type": "number",
|
|
370
|
+
"minimum": 0
|
|
371
|
+
},
|
|
372
|
+
"depth": {
|
|
373
|
+
"type": "number",
|
|
374
|
+
"minimum": 0
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
"additionalProperties": true
|
|
378
|
+
},
|
|
379
|
+
"Object": {
|
|
380
|
+
"type": "object",
|
|
381
|
+
"description": "An entity in the simulation (actor, equipment, resource, product, service, or digital object).",
|
|
382
|
+
"required": [
|
|
383
|
+
"id",
|
|
384
|
+
"type",
|
|
385
|
+
"name"
|
|
386
|
+
],
|
|
387
|
+
"properties": {
|
|
388
|
+
"id": {
|
|
389
|
+
"$ref": "#/definitions/ObjectId",
|
|
390
|
+
"description": "Object identifier (snake_case). May optionally be namespaced as '{type}:{id}'."
|
|
391
|
+
},
|
|
392
|
+
"type": {
|
|
393
|
+
"type": "string",
|
|
394
|
+
"description": "Object type (built-in or custom)."
|
|
395
|
+
},
|
|
396
|
+
"name": {
|
|
397
|
+
"type": "string",
|
|
398
|
+
"description": "Display name."
|
|
399
|
+
},
|
|
400
|
+
"emoji": {
|
|
401
|
+
"type": "string",
|
|
402
|
+
"maxLength": 8
|
|
403
|
+
},
|
|
404
|
+
"location": {
|
|
405
|
+
"type": "string",
|
|
406
|
+
"description": "Location ID where the object is situated."
|
|
407
|
+
},
|
|
408
|
+
"properties": {
|
|
409
|
+
"type": "object",
|
|
410
|
+
"description": "Type-specific and custom properties.",
|
|
411
|
+
"additionalProperties": true
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"not": {
|
|
415
|
+
"properties": {
|
|
416
|
+
"type": {
|
|
417
|
+
"enum": [
|
|
418
|
+
"timeline_actors",
|
|
419
|
+
"any",
|
|
420
|
+
"unknown"
|
|
421
|
+
]
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
"additionalProperties": true
|
|
426
|
+
},
|
|
427
|
+
"Task": {
|
|
428
|
+
"type": "object",
|
|
429
|
+
"description": "A discrete step performed by an actor/equipment/service.",
|
|
430
|
+
"required": [
|
|
431
|
+
"id",
|
|
432
|
+
"actor_id",
|
|
433
|
+
"start",
|
|
434
|
+
"duration"
|
|
435
|
+
],
|
|
436
|
+
"properties": {
|
|
437
|
+
"id": {
|
|
438
|
+
"$ref": "#/definitions/PlainId"
|
|
439
|
+
},
|
|
440
|
+
"emoji": {
|
|
441
|
+
"type": "string",
|
|
442
|
+
"maxLength": 8
|
|
443
|
+
},
|
|
444
|
+
"actor_id": {
|
|
445
|
+
"type": "string",
|
|
446
|
+
"description": "Performer object id."
|
|
447
|
+
},
|
|
448
|
+
"start": {
|
|
449
|
+
"$ref": "#/definitions/TaskStart"
|
|
450
|
+
},
|
|
451
|
+
"duration": {
|
|
452
|
+
"$ref": "#/definitions/Duration"
|
|
453
|
+
},
|
|
454
|
+
"location": {
|
|
455
|
+
"type": "string"
|
|
456
|
+
},
|
|
457
|
+
"depends_on": {
|
|
458
|
+
"$ref": "#/definitions/DependsOn"
|
|
459
|
+
},
|
|
460
|
+
"interactions": {
|
|
461
|
+
"type": "array",
|
|
462
|
+
"items": {
|
|
463
|
+
"$ref": "#/definitions/Interaction"
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
"description": {
|
|
467
|
+
"type": "string"
|
|
468
|
+
},
|
|
469
|
+
"priority": {
|
|
470
|
+
"type": "string",
|
|
471
|
+
"enum": [
|
|
472
|
+
"low",
|
|
473
|
+
"medium",
|
|
474
|
+
"high",
|
|
475
|
+
"critical"
|
|
476
|
+
]
|
|
477
|
+
},
|
|
478
|
+
"tags": {
|
|
479
|
+
"type": "array",
|
|
480
|
+
"items": {
|
|
481
|
+
"type": "string"
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
"additionalProperties": true
|
|
486
|
+
},
|
|
487
|
+
"Interaction": {
|
|
488
|
+
"type": "object",
|
|
489
|
+
"description": "A task effect on an object. Either a property change, or an action (create/delete).",
|
|
490
|
+
"properties": {
|
|
491
|
+
"target_id": {
|
|
492
|
+
"type": "string",
|
|
493
|
+
"description": "ID of the affected object."
|
|
494
|
+
},
|
|
495
|
+
"property_changes": {
|
|
496
|
+
"$ref": "#/definitions/PropertyChanges"
|
|
497
|
+
},
|
|
498
|
+
"action": {
|
|
499
|
+
"type": "string",
|
|
500
|
+
"enum": [
|
|
501
|
+
"create",
|
|
502
|
+
"delete"
|
|
503
|
+
]
|
|
504
|
+
},
|
|
505
|
+
"object": {
|
|
506
|
+
"$ref": "#/definitions/Object"
|
|
507
|
+
},
|
|
508
|
+
"temporary": {
|
|
509
|
+
"type": "boolean",
|
|
510
|
+
"description": "If true, revert changes after the task completes."
|
|
511
|
+
},
|
|
512
|
+
"description": {
|
|
513
|
+
"type": "string"
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
"allOf": [
|
|
517
|
+
{
|
|
518
|
+
"not": {
|
|
519
|
+
"required": [
|
|
520
|
+
"object_id"
|
|
521
|
+
]
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"not": {
|
|
526
|
+
"required": [
|
|
527
|
+
"revert_after"
|
|
528
|
+
]
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"oneOf": [
|
|
533
|
+
{
|
|
534
|
+
"title": "Property Change Interaction",
|
|
535
|
+
"required": [
|
|
536
|
+
"target_id",
|
|
537
|
+
"property_changes"
|
|
538
|
+
],
|
|
539
|
+
"properties": {
|
|
540
|
+
"action": {
|
|
541
|
+
"not": {}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"title": "Create Interaction",
|
|
547
|
+
"required": [
|
|
548
|
+
"action",
|
|
549
|
+
"object"
|
|
550
|
+
],
|
|
551
|
+
"properties": {
|
|
552
|
+
"action": {
|
|
553
|
+
"const": "create"
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"title": "Delete Interaction",
|
|
559
|
+
"required": [
|
|
560
|
+
"action",
|
|
561
|
+
"target_id"
|
|
562
|
+
],
|
|
563
|
+
"properties": {
|
|
564
|
+
"action": {
|
|
565
|
+
"const": "delete"
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
]
|
|
570
|
+
}
|
|
571
|
+
],
|
|
572
|
+
"additionalProperties": true
|
|
573
|
+
},
|
|
574
|
+
"PropertyChanges": {
|
|
575
|
+
"type": "object",
|
|
576
|
+
"description": "Map of property name -> change operator.",
|
|
577
|
+
"additionalProperties": {
|
|
578
|
+
"$ref": "#/definitions/ChangeOperator"
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
"ChangeOperator": {
|
|
582
|
+
"type": "object",
|
|
583
|
+
"description": "A change operator (delta/set/from-to/multiply/append/remove/increment/decrement).",
|
|
584
|
+
"properties": {
|
|
585
|
+
"from": {},
|
|
586
|
+
"to": {},
|
|
587
|
+
"delta": {
|
|
588
|
+
"type": "number"
|
|
589
|
+
},
|
|
590
|
+
"set": {},
|
|
591
|
+
"multiply": {
|
|
592
|
+
"type": "number"
|
|
593
|
+
},
|
|
594
|
+
"append": {},
|
|
595
|
+
"remove": {},
|
|
596
|
+
"increment": {
|
|
597
|
+
"type": "boolean"
|
|
598
|
+
},
|
|
599
|
+
"decrement": {
|
|
600
|
+
"type": "boolean"
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
"additionalProperties": true
|
|
604
|
+
},
|
|
605
|
+
"DependsOn": {
|
|
606
|
+
"description": "Task dependencies, either an array (implicit AND), or an object with explicit all/any operators.",
|
|
607
|
+
"anyOf": [
|
|
608
|
+
{
|
|
609
|
+
"type": "array",
|
|
610
|
+
"items": {
|
|
611
|
+
"$ref": "#/definitions/PlainId"
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
"type": "object",
|
|
616
|
+
"properties": {
|
|
617
|
+
"all": {
|
|
618
|
+
"type": "array",
|
|
619
|
+
"items": {
|
|
620
|
+
"$ref": "#/definitions/PlainId"
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
"any": {
|
|
624
|
+
"type": "array",
|
|
625
|
+
"items": {
|
|
626
|
+
"$ref": "#/definitions/PlainId"
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
"additionalProperties": true
|
|
631
|
+
}
|
|
632
|
+
]
|
|
633
|
+
},
|
|
634
|
+
"TaskStart": {
|
|
635
|
+
"description": "Task start time. Supports HH:MM, HH:MM:SS, ISO 8601 date-time, or {day,time}.",
|
|
636
|
+
"anyOf": [
|
|
637
|
+
{
|
|
638
|
+
"$ref": "#/definitions/TimeOrDateTime"
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
"type": "object",
|
|
642
|
+
"required": [
|
|
643
|
+
"day",
|
|
644
|
+
"time"
|
|
645
|
+
],
|
|
646
|
+
"properties": {
|
|
647
|
+
"day": {
|
|
648
|
+
"type": "integer",
|
|
649
|
+
"minimum": 1
|
|
650
|
+
},
|
|
651
|
+
"time": {
|
|
652
|
+
"$ref": "#/definitions/TimeOrDateTime"
|
|
653
|
+
}
|
|
654
|
+
},
|
|
655
|
+
"additionalProperties": true
|
|
656
|
+
}
|
|
657
|
+
]
|
|
658
|
+
},
|
|
659
|
+
"Duration": {
|
|
660
|
+
"description": "Task duration. Supports integer (uses config.time_unit), ISO 8601 duration (e.g., PT30M), or shorthand (e.g., 30m, 1h, 1d, 10s, 1w, 1M).",
|
|
661
|
+
"anyOf": [
|
|
662
|
+
{
|
|
663
|
+
"type": "integer",
|
|
664
|
+
"minimum": 1
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
"type": "string",
|
|
668
|
+
"anyOf": [
|
|
669
|
+
{
|
|
670
|
+
"pattern": "^\\d+[smhdwWM]$"
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
"pattern": "^P(?!$)(?:\\d+Y)?(?:\\d+M)?(?:\\d+W)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+S)?)?$"
|
|
674
|
+
}
|
|
675
|
+
]
|
|
676
|
+
}
|
|
677
|
+
]
|
|
678
|
+
},
|
|
679
|
+
"TimeOrDateTime": {
|
|
680
|
+
"description": "Either a strict time-of-day (HH:MM or HH:MM:SS, zero-padded) or an ISO 8601 date-time.",
|
|
681
|
+
"anyOf": [
|
|
682
|
+
{
|
|
683
|
+
"type": "string",
|
|
684
|
+
"pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"type": "string",
|
|
688
|
+
"pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$"
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
"type": "string",
|
|
692
|
+
"format": "date-time"
|
|
693
|
+
}
|
|
694
|
+
]
|
|
695
|
+
},
|
|
696
|
+
"PlainId": {
|
|
697
|
+
"type": "string",
|
|
698
|
+
"pattern": "^[a-z][a-z0-9_]{0,249}$"
|
|
699
|
+
},
|
|
700
|
+
"ObjectId": {
|
|
701
|
+
"description": "Object id, either plain snake_case or optional namespaced id '{type}:{identifier}'.",
|
|
702
|
+
"type": "string",
|
|
703
|
+
"maxLength": 250,
|
|
704
|
+
"anyOf": [
|
|
705
|
+
{
|
|
706
|
+
"$ref": "#/definitions/PlainId"
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"pattern": "^[a-z][a-z0-9_]*:[a-z][a-z0-9_]{0,249}$"
|
|
710
|
+
}
|
|
711
|
+
]
|
|
712
|
+
},
|
|
713
|
+
"Recipes": {
|
|
714
|
+
"type": "object",
|
|
715
|
+
"description": "Recipe definitions keyed by product id.",
|
|
716
|
+
"additionalProperties": {
|
|
717
|
+
"$ref": "#/definitions/Recipe"
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
"Recipe": {
|
|
721
|
+
"type": "object",
|
|
722
|
+
"description": "A recipe describing required inputs for a product.",
|
|
723
|
+
"required": [
|
|
724
|
+
"inputs"
|
|
725
|
+
],
|
|
726
|
+
"properties": {
|
|
727
|
+
"inputs": {
|
|
728
|
+
"type": "object",
|
|
729
|
+
"description": "Resource ID -> required quantity.",
|
|
730
|
+
"additionalProperties": {
|
|
731
|
+
"type": "number",
|
|
732
|
+
"minimum": 0
|
|
733
|
+
}
|
|
734
|
+
},
|
|
735
|
+
"equipment": {
|
|
736
|
+
"type": "array",
|
|
737
|
+
"items": {
|
|
738
|
+
"type": "string"
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
"output_quantity": {
|
|
742
|
+
"type": "number",
|
|
743
|
+
"minimum": 0
|
|
744
|
+
},
|
|
745
|
+
"process_time": {
|
|
746
|
+
"type": "number",
|
|
747
|
+
"minimum": 0
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
"additionalProperties": true
|
|
751
|
+
},
|
|
752
|
+
"TypeDefinition": {
|
|
753
|
+
"type": "object",
|
|
754
|
+
"description": "Custom type definition extending a built-in base type.",
|
|
755
|
+
"required": [
|
|
756
|
+
"extends"
|
|
757
|
+
],
|
|
758
|
+
"properties": {
|
|
759
|
+
"extends": {
|
|
760
|
+
"type": "string",
|
|
761
|
+
"description": "Built-in base type to extend."
|
|
762
|
+
},
|
|
763
|
+
"description": {
|
|
764
|
+
"type": "string"
|
|
765
|
+
},
|
|
766
|
+
"additional_properties": {
|
|
767
|
+
"type": "object",
|
|
768
|
+
"description": "Optional schema-like description of extra properties for this custom type.",
|
|
769
|
+
"additionalProperties": true
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
"additionalProperties": true
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|