@toolproof-npm/schema 0.1.61 → 0.1.62

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.
@@ -0,0 +1,685 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "allOf": [
5
+ {
6
+ "$comment": "The Engine will convert the statelessStrategy.steps array of the referenced StatefulStrategy into this map before the run. This is to allow jobs that do not depend on previous-step inputs to run in parallel.The Engine will also inject internal steps to prompt for runtime-provided inputs and handle other orchestration tasks such as repeted steps when encountering a loop.",
7
+ "$ref": "#/$defs/StrategyThreadMap"
8
+ },
9
+ {
10
+ "$comment": "Reusing StrategyStateWrapper to include the strategy state in the StrategyRun. The Engine will update it with materialized Resources (i.e. runtime-provided inputs and job-created outputs) during the run.",
11
+ "$ref": "#/$defs/StrategyStateWrapper"
12
+ }
13
+ ],
14
+ "properties": {
15
+ "identity": {
16
+ "$ref": "#/$defs/StrategyRunIdentity"
17
+ },
18
+ "statefulStrategyRef": {
19
+ "$ref": "#/$defs/StatefulStrategyIdentity"
20
+ },
21
+ "strategyRunContext": {
22
+ "$ref": "#/$defs/StrategyRunContext"
23
+ }
24
+ },
25
+ "required": [
26
+ "identity",
27
+ "statefulStrategyRef",
28
+ "strategyRunContext"
29
+ ],
30
+ "unevaluatedProperties": false,
31
+ "$anchor": "StrategyRun",
32
+ "$defs": {
33
+ "StrategyThreadMap": {
34
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
35
+ "type": "object",
36
+ "additionalProperties": {
37
+ "items": {
38
+ "$ref": "#/$defs/Step"
39
+ }
40
+ },
41
+ "$anchor": "StrategyThreadMap",
42
+ "$comment": "Each thread contains an array of steps, allowing for sequential execution within a thread while supporting parallel execution across multiple threads.",
43
+ "propertyNames": {
44
+ "$ref": "#/$defs/StrategyThreadIdentity"
45
+ }
46
+ },
47
+ "StrategyStateWrapper": {
48
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
49
+ "type": "object",
50
+ "properties": {
51
+ "strategyState": {
52
+ "$ref": "#/$defs/StrategyState"
53
+ }
54
+ },
55
+ "required": [
56
+ "strategyState"
57
+ ],
58
+ "$anchor": "StrategyStateWrapper"
59
+ },
60
+ "StrategyRunIdentity": {
61
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
62
+ "type": "string",
63
+ "$anchor": "StrategyRunIdentity",
64
+ "pattern": "^STRATEGY_RUN-.+$"
65
+ },
66
+ "StatefulStrategyIdentity": {
67
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
68
+ "type": "string",
69
+ "$anchor": "StatefulStrategyIdentity",
70
+ "pattern": "^STATEFUL_STRATEGY-.+$"
71
+ },
72
+ "StrategyRunContext": {
73
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
74
+ "type": "object",
75
+ "properties": {
76
+ "completedAt": {
77
+ "$ref": "#/$defs/Timestamp"
78
+ },
79
+ "startedAt": {
80
+ "$ref": "#/$defs/Timestamp"
81
+ },
82
+ "status": {
83
+ "$ref": "#/$defs/StrategyRunStatus"
84
+ }
85
+ },
86
+ "required": [
87
+ "status"
88
+ ],
89
+ "unevaluatedProperties": false,
90
+ "$anchor": "StrategyRunContext"
91
+ },
92
+ "Step": {
93
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
94
+ "type": "object",
95
+ "oneOf": [
96
+ {
97
+ "$ref": "#/$defs/WorkStep"
98
+ },
99
+ {
100
+ "$ref": "#/$defs/BranchStep"
101
+ },
102
+ {
103
+ "$ref": "#/$defs/WhileStep"
104
+ },
105
+ {
106
+ "$ref": "#/$defs/ForStep"
107
+ }
108
+ ],
109
+ "unevaluatedProperties": false,
110
+ "$anchor": "Step"
111
+ },
112
+ "StrategyThreadIdentity": {
113
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
114
+ "type": "string",
115
+ "$anchor": "StrategyThreadIdentity",
116
+ "pattern": "^STRATEGY_THREAD-.+$"
117
+ },
118
+ "StrategyState": {
119
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
120
+ "type": "object",
121
+ "additionalProperties": {
122
+ "type": "object",
123
+ "additionalProperties": {
124
+ "oneOf": [
125
+ {
126
+ "$ref": "#/$defs/ResourceMissing"
127
+ },
128
+ {
129
+ "$ref": "#/$defs/ResourcePotentialInput"
130
+ },
131
+ {
132
+ "$ref": "#/$defs/ResourcePotentialOutput"
133
+ },
134
+ {
135
+ "$ref": "#/$defs/Resource"
136
+ }
137
+ ]
138
+ },
139
+ "propertyNames": {
140
+ "$ref": "#/$defs/ResourceRoleIdentity"
141
+ }
142
+ },
143
+ "$anchor": "StrategyState",
144
+ "propertyNames": {
145
+ "$ref": "#/$defs/ExecutionIdentity"
146
+ }
147
+ },
148
+ "Timestamp": {
149
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
150
+ "type": "object",
151
+ "properties": {
152
+ "timestamp": {
153
+ "type": "string",
154
+ "format": "date-time"
155
+ }
156
+ },
157
+ "required": [
158
+ "timestamp"
159
+ ],
160
+ "$anchor": "Timestamp"
161
+ },
162
+ "StrategyRunStatus": {
163
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
164
+ "type": "string",
165
+ "$anchor": "StrategyRunStatus",
166
+ "enum": [
167
+ "pending",
168
+ "running",
169
+ "completed",
170
+ "failed",
171
+ "cancelled"
172
+ ]
173
+ },
174
+ "WorkStep": {
175
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
176
+ "type": "object",
177
+ "allOf": [
178
+ {
179
+ "$ref": "#/$defs/StepKind"
180
+ }
181
+ ],
182
+ "properties": {
183
+ "execution": {
184
+ "$ref": "#/$defs/Execution"
185
+ },
186
+ "identity": {
187
+ "$ref": "#/$defs/WorkStepIdentity"
188
+ },
189
+ "kind": {
190
+ "const": "work"
191
+ }
192
+ },
193
+ "required": [
194
+ "identity",
195
+ "kind",
196
+ "execution"
197
+ ],
198
+ "$anchor": "WorkStep"
199
+ },
200
+ "BranchStep": {
201
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
202
+ "type": "object",
203
+ "allOf": [
204
+ {
205
+ "$ref": "#/$defs/StepKind"
206
+ }
207
+ ],
208
+ "properties": {
209
+ "cases": {
210
+ "type": "array",
211
+ "items": {
212
+ "$ref": "#/$defs/Conditional"
213
+ },
214
+ "minItems": 1,
215
+ "uniqueItems": true
216
+ },
217
+ "identity": {
218
+ "$ref": "#/$defs/BranchStepIdentity"
219
+ },
220
+ "kind": {
221
+ "const": "branch"
222
+ }
223
+ },
224
+ "required": [
225
+ "identity",
226
+ "kind",
227
+ "cases"
228
+ ],
229
+ "$anchor": "BranchStep"
230
+ },
231
+ "WhileStep": {
232
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
233
+ "type": "object",
234
+ "allOf": [
235
+ {
236
+ "$ref": "#/$defs/StepKind"
237
+ }
238
+ ],
239
+ "properties": {
240
+ "case": {
241
+ "$ref": "#/$defs/Conditional"
242
+ },
243
+ "identity": {
244
+ "$ref": "#/$defs/WhileStepIdentity"
245
+ },
246
+ "kind": {
247
+ "const": "while"
248
+ }
249
+ },
250
+ "required": [
251
+ "identity",
252
+ "kind",
253
+ "case"
254
+ ],
255
+ "$anchor": "WhileStep"
256
+ },
257
+ "ForStep": {
258
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
259
+ "type": "object",
260
+ "allOf": [
261
+ {
262
+ "$ref": "#/$defs/StepKind"
263
+ }
264
+ ],
265
+ "properties": {
266
+ "case": {
267
+ "$ref": "#/$defs/Conditional"
268
+ },
269
+ "identity": {
270
+ "$ref": "#/$defs/ForStepIdentity"
271
+ },
272
+ "kind": {
273
+ "const": "for"
274
+ }
275
+ },
276
+ "required": [
277
+ "identity",
278
+ "kind",
279
+ "case"
280
+ ],
281
+ "$anchor": "ForStep"
282
+ },
283
+ "ResourceMissing": {
284
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
285
+ "type": "object",
286
+ "allOf": [
287
+ {
288
+ "$ref": "#/$defs/ResourceBase"
289
+ },
290
+ {
291
+ "$ref": "#/$defs/ResourceKind"
292
+ },
293
+ {
294
+ "properties": {
295
+ "kind": {
296
+ "const": "missing"
297
+ }
298
+ },
299
+ "required": [
300
+ "kind"
301
+ ]
302
+ }
303
+ ],
304
+ "unevaluatedProperties": false,
305
+ "$anchor": "ResourceMissing"
306
+ },
307
+ "ResourcePotentialInput": {
308
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
309
+ "type": "object",
310
+ "allOf": [
311
+ {
312
+ "$ref": "#/$defs/ResourceBase"
313
+ },
314
+ {
315
+ "$ref": "#/$defs/CreationContextWrapper"
316
+ },
317
+ {
318
+ "$ref": "#/$defs/ResourceKind"
319
+ },
320
+ {
321
+ "properties": {
322
+ "kind": {
323
+ "const": "potential-input"
324
+ }
325
+ },
326
+ "required": [
327
+ "kind"
328
+ ]
329
+ }
330
+ ],
331
+ "unevaluatedProperties": false,
332
+ "$anchor": "ResourcePotentialInput"
333
+ },
334
+ "ResourcePotentialOutput": {
335
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
336
+ "type": "object",
337
+ "allOf": [
338
+ {
339
+ "$ref": "#/$defs/ResourceBase"
340
+ },
341
+ {
342
+ "$ref": "#/$defs/CreationContextWrapper"
343
+ },
344
+ {
345
+ "$ref": "#/$defs/ResourceKind"
346
+ },
347
+ {
348
+ "properties": {
349
+ "kind": {
350
+ "const": "potential-output"
351
+ }
352
+ },
353
+ "required": [
354
+ "kind"
355
+ ]
356
+ }
357
+ ],
358
+ "unevaluatedProperties": false,
359
+ "$anchor": "ResourcePotentialOutput"
360
+ },
361
+ "Resource": {
362
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
363
+ "type": "object",
364
+ "allOf": [
365
+ {
366
+ "$ref": "#/$defs/ResourceMetaBase"
367
+ },
368
+ {
369
+ "properties": {
370
+ "extractedData": {
371
+ "type": "object",
372
+ "additionalProperties": {
373
+ "$ref": "#/$defs/JsonData"
374
+ },
375
+ "$comment": "This will be overlayed at runtime to match the data structure of the underlying type's extractionSchema. At compile time, we guarantee it has an identity property."
376
+ }
377
+ },
378
+ "required": [
379
+ "extractedData"
380
+ ]
381
+ }
382
+ ],
383
+ "unevaluatedProperties": false,
384
+ "$anchor": "Resource"
385
+ },
386
+ "ResourceRoleIdentity": {
387
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
388
+ "type": "string",
389
+ "$anchor": "ResourceRoleIdentity",
390
+ "pattern": "^ROLE-.+$"
391
+ },
392
+ "ExecutionIdentity": {
393
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
394
+ "type": "string",
395
+ "$anchor": "ExecutionIdentity",
396
+ "pattern": "^EXECUTION-.+$"
397
+ },
398
+ "StepKind": {
399
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
400
+ "type": "object",
401
+ "properties": {
402
+ "kind": {
403
+ "type": "string",
404
+ "enum": [
405
+ "work",
406
+ "branch",
407
+ "while",
408
+ "for"
409
+ ]
410
+ }
411
+ },
412
+ "required": [
413
+ "kind"
414
+ ],
415
+ "$anchor": "StepKind"
416
+ },
417
+ "Execution": {
418
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
419
+ "type": "object",
420
+ "allOf": [
421
+ {
422
+ "$comment": "This will be overlayed at runtime to specify roleBindings corresponding to the roles of the underlying job.",
423
+ "$ref": "#/$defs/RoleBindingsWrapper"
424
+ }
425
+ ],
426
+ "properties": {
427
+ "identity": {
428
+ "$ref": "#/$defs/ExecutionIdentity"
429
+ },
430
+ "jobRef": {
431
+ "$ref": "#/$defs/JobIdentity"
432
+ }
433
+ },
434
+ "required": [
435
+ "identity",
436
+ "jobRef"
437
+ ],
438
+ "$anchor": "Execution"
439
+ },
440
+ "WorkStepIdentity": {
441
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
442
+ "type": "string",
443
+ "$anchor": "WorkStepIdentity",
444
+ "pattern": "^WORKSTEP-.+$"
445
+ },
446
+ "Conditional": {
447
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
448
+ "type": "object",
449
+ "properties": {
450
+ "what": {
451
+ "$ref": "#/$defs/WorkStep"
452
+ },
453
+ "when": {
454
+ "$ref": "#/$defs/WorkStep"
455
+ }
456
+ },
457
+ "required": [
458
+ "when",
459
+ "what"
460
+ ],
461
+ "unevaluatedProperties": false,
462
+ "$anchor": "Conditional"
463
+ },
464
+ "BranchStepIdentity": {
465
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
466
+ "type": "string",
467
+ "$anchor": "BranchStepIdentity",
468
+ "pattern": "^BRANCHSTEP-.+$"
469
+ },
470
+ "WhileStepIdentity": {
471
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
472
+ "type": "string",
473
+ "$anchor": "WhileStepIdentity",
474
+ "pattern": "^WHILESTEP-.+$"
475
+ },
476
+ "ForStepIdentity": {
477
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
478
+ "type": "string",
479
+ "$anchor": "ForStepIdentity",
480
+ "pattern": "^FORSTEP-.+$"
481
+ },
482
+ "ResourceBase": {
483
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
484
+ "type": "object",
485
+ "properties": {
486
+ "identity": {
487
+ "$ref": "#/$defs/ResourceIdentity"
488
+ },
489
+ "resourceTypeRef": {
490
+ "$ref": "#/$defs/ResourceTypeIdentity"
491
+ }
492
+ },
493
+ "required": [
494
+ "identity",
495
+ "resourceTypeRef"
496
+ ],
497
+ "$anchor": "ResourceBase"
498
+ },
499
+ "ResourceKind": {
500
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
501
+ "type": "object",
502
+ "properties": {
503
+ "kind": {
504
+ "enum": [
505
+ "missing",
506
+ "potential-input",
507
+ "potential-output",
508
+ "materialized"
509
+ ]
510
+ }
511
+ },
512
+ "required": [
513
+ "kind"
514
+ ],
515
+ "$anchor": "ResourceKind"
516
+ },
517
+ "CreationContextWrapper": {
518
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
519
+ "type": "object",
520
+ "properties": {
521
+ "creationContext": {
522
+ "$ref": "#/$defs/CreationContext"
523
+ }
524
+ },
525
+ "required": [
526
+ "creationContext"
527
+ ],
528
+ "$anchor": "CreationContextWrapper"
529
+ },
530
+ "ResourceMetaBase": {
531
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
532
+ "type": "object",
533
+ "allOf": [
534
+ {
535
+ "$ref": "#/$defs/ResourceBase"
536
+ },
537
+ {
538
+ "$ref": "#/$defs/CreationContextWrapper"
539
+ },
540
+ {
541
+ "$ref": "#/$defs/ResourceKind"
542
+ },
543
+ {
544
+ "properties": {
545
+ "kind": {
546
+ "const": "materialized"
547
+ }
548
+ },
549
+ "required": [
550
+ "kind"
551
+ ]
552
+ },
553
+ {
554
+ "$ref": "#/$defs/Timestamp"
555
+ },
556
+ {
557
+ "$ref": "#/$defs/Path"
558
+ }
559
+ ],
560
+ "$anchor": "ResourceMetaBase"
561
+ },
562
+ "JsonData": {
563
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
564
+ "oneOf": [
565
+ {
566
+ "type": "null"
567
+ },
568
+ {
569
+ "type": "boolean"
570
+ },
571
+ {
572
+ "type": "number"
573
+ },
574
+ {
575
+ "type": "string"
576
+ },
577
+ {
578
+ "type": "array",
579
+ "items": {
580
+ "$ref": "#/$defs/JsonData"
581
+ }
582
+ },
583
+ {
584
+ "type": "object",
585
+ "additionalProperties": {
586
+ "$ref": "#/$defs/JsonData"
587
+ }
588
+ }
589
+ ],
590
+ "$anchor": "JsonData"
591
+ },
592
+ "RoleBindingsWrapper": {
593
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
594
+ "type": "object",
595
+ "properties": {
596
+ "roleBindings": {
597
+ "$ref": "#/$defs/RoleBindings"
598
+ }
599
+ },
600
+ "required": [
601
+ "roleBindings"
602
+ ],
603
+ "$anchor": "RoleBindingsWrapper"
604
+ },
605
+ "JobIdentity": {
606
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
607
+ "type": "string",
608
+ "$anchor": "JobIdentity",
609
+ "$comment": "",
610
+ "pattern": "^JOB-.+$"
611
+ },
612
+ "ResourceIdentity": {
613
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
614
+ "type": "string",
615
+ "$anchor": "ResourceIdentity",
616
+ "$comment": "",
617
+ "pattern": "^RESOURCE-.+$"
618
+ },
619
+ "ResourceTypeIdentity": {
620
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
621
+ "type": "string",
622
+ "$anchor": "ResourceTypeIdentity",
623
+ "pattern": "^TYPE-.+$"
624
+ },
625
+ "CreationContext": {
626
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
627
+ "type": "object",
628
+ "properties": {
629
+ "executionRef": {
630
+ "$ref": "#/$defs/ExecutionIdentity"
631
+ },
632
+ "resourceRoleRef": {
633
+ "$ref": "#/$defs/ResourceRoleIdentity"
634
+ }
635
+ },
636
+ "required": [
637
+ "resourceRoleRef",
638
+ "executionRef"
639
+ ],
640
+ "$anchor": "CreationContext"
641
+ },
642
+ "Path": {
643
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
644
+ "type": "object",
645
+ "properties": {
646
+ "path": {
647
+ "type": "string"
648
+ }
649
+ },
650
+ "required": [
651
+ "path"
652
+ ],
653
+ "$anchor": "Path"
654
+ },
655
+ "RoleBindings": {
656
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
657
+ "type": "object",
658
+ "properties": {
659
+ "inputBindingMap": {
660
+ "$ref": "#/$defs/RoleBindingMap"
661
+ },
662
+ "outputBindingMap": {
663
+ "$ref": "#/$defs/RoleBindingMap"
664
+ }
665
+ },
666
+ "required": [
667
+ "inputBindingMap",
668
+ "outputBindingMap"
669
+ ],
670
+ "unevaluatedProperties": false,
671
+ "$anchor": "RoleBindings"
672
+ },
673
+ "RoleBindingMap": {
674
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
675
+ "type": "object",
676
+ "additionalProperties": {
677
+ "$ref": "#/$defs/ResourceIdentity"
678
+ },
679
+ "$anchor": "RoleBindingMap",
680
+ "propertyNames": {
681
+ "$ref": "#/$defs/ResourceRoleIdentity"
682
+ }
683
+ }
684
+ }
685
+ }