@toolproof-npm/schema 0.1.67 → 0.1.69

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 CHANGED
@@ -1,59 +1,59 @@
1
- # @toolproof-npm/schema
2
-
3
- JSON schemas and TypeScript types for ToolProof...
4
-
5
- ## Installation
6
-
7
- ```bash
8
- pnpm add @toolproof-npm/schema
9
- # or
10
- npm install @toolproof-npm/schema
11
- # or
12
- yarn add @toolproof-npm/schema
13
- ```
14
-
15
- ## Usage
16
-
17
- ### Import Schemas and Types
18
-
19
- ```typescript
20
- import { /* schemas and types */ } from '@toolproof-npm/schema';
21
- ```
22
-
23
- ## Features
24
-
25
- - JSON Schema definitions with $defs subschemas
26
- - Generated TypeScript types from JSON schemas
27
- - Runtime schema validation support
28
- - Extractors for non-JSON resource types
29
- - Schema bundling utilities
30
-
31
- ## Development
32
-
33
- ### Generate Types
34
-
35
- ```bash
36
- pnpm run generateTypes
37
- ```
38
-
39
- ### Build
40
-
41
- ```bash
42
- pnpm run build
43
- ```
44
-
45
- ### Update (Clean build + generate types)
46
-
47
- ```bash
48
- pnpm run update
49
- ```
50
-
51
- ## Requirements
52
-
53
- - Node.js 16+
54
- - TypeScript 4.5+ (for TypeScript projects)
55
-
56
- ## License
57
-
58
- MIT
59
-
1
+ # @toolproof-npm/schema
2
+
3
+ JSON schemas and TypeScript types for ToolProof...
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @toolproof-npm/schema
9
+ # or
10
+ npm install @toolproof-npm/schema
11
+ # or
12
+ yarn add @toolproof-npm/schema
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ### Import Schemas and Types
18
+
19
+ ```typescript
20
+ import { /* schemas and types */ } from '@toolproof-npm/schema';
21
+ ```
22
+
23
+ ## Features
24
+
25
+ - JSON Schema definitions with $defs subschemas
26
+ - Generated TypeScript types from JSON schemas
27
+ - Runtime schema validation support
28
+ - Extractors for non-JSON resource types
29
+ - Schema bundling utilities
30
+
31
+ ## Development
32
+
33
+ ### Generate Types
34
+
35
+ ```bash
36
+ pnpm run generateTypes
37
+ ```
38
+
39
+ ### Build
40
+
41
+ ```bash
42
+ pnpm run build
43
+ ```
44
+
45
+ ### Update (Clean build + generate types)
46
+
47
+ ```bash
48
+ pnpm run update
49
+ ```
50
+
51
+ ## Requirements
52
+
53
+ - Node.js 16+
54
+ - TypeScript 4.5+ (for TypeScript projects)
55
+
56
+ ## License
57
+
58
+ MIT
59
+
@@ -62,6 +62,9 @@
62
62
  "JsonData"
63
63
  ],
64
64
  "BranchStepIdentity": [],
65
+ "Error": [
66
+ "Documented"
67
+ ],
65
68
  "ForStepIdentity": [],
66
69
  "JobIdentity": [],
67
70
  "ResourceFormat": [
@@ -109,7 +112,8 @@
109
112
  "ResourceRoleIdentity"
110
113
  ],
111
114
  "Roles": [
112
- "RoleMap"
115
+ "RoleMap",
116
+ "ResourceRoleValue"
113
117
  ],
114
118
  "RolesWrapper": [
115
119
  "Roles"
@@ -814,7 +814,8 @@
814
814
  "$ref": "#/$defs/Documented"
815
815
  }
816
816
  ]
817
- }
817
+ },
818
+ "unevaluatedProperties": false
818
819
  },
819
820
  "RoleMap": {
820
821
  "identity": "TYPE-RoleMap",
@@ -833,6 +834,30 @@
833
834
  }
834
835
  }
835
836
  },
837
+ "Error": {
838
+ "identity": "TYPE-Error",
839
+ "name": "Error",
840
+ "description": "dummy-description",
841
+ "resourceFormatRef": "FORMAT-ApplicationJson",
842
+ "extractionSchema": {
843
+ "$anchor": "Error",
844
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
845
+ "type": "object",
846
+ "allOf": [
847
+ {
848
+ "$ref": "#/$defs/Documented"
849
+ },
850
+ {
851
+ "properties": {
852
+ "details": {
853
+ "type": "object"
854
+ }
855
+ }
856
+ }
857
+ ],
858
+ "unevaluatedProperties": false
859
+ }
860
+ },
836
861
  "Roles": {
837
862
  "identity": "TYPE-Roles",
838
863
  "name": "Roles",
@@ -851,7 +876,44 @@
851
876
  "$ref": "#/$defs/RoleMap"
852
877
  },
853
878
  "outputMap": {
854
- "$ref": "#/$defs/RoleMap"
879
+ "allOf": [
880
+ {
881
+ "$ref": "#/$defs/RoleMap"
882
+ },
883
+ {
884
+ "required": [
885
+ "ROLE-ErrorOutput"
886
+ ],
887
+ "properties": {
888
+ "ROLE-ErrorOutput": {
889
+ "type": "object",
890
+ "allOf": [
891
+ {
892
+ "$ref": "#/$defs/ResourceRoleValue"
893
+ },
894
+ {
895
+ "required": [
896
+ "resourceTypeRef",
897
+ "name",
898
+ "description"
899
+ ],
900
+ "properties": {
901
+ "resourceTypeRef": {
902
+ "const": "TYPE-Error"
903
+ },
904
+ "name": {
905
+ "const": "ErrorOutput"
906
+ },
907
+ "description": {
908
+ "const": "Represents error outputs from job executions."
909
+ }
910
+ }
911
+ }
912
+ ]
913
+ }
914
+ }
915
+ }
916
+ ]
855
917
  }
856
918
  },
857
919
  "unevaluatedProperties": false
@@ -1678,7 +1740,8 @@
1678
1740
  "statelessStrategy": {
1679
1741
  "$ref": "#/$defs/StatelessStrategy"
1680
1742
  }
1681
- }
1743
+ },
1744
+ "unevaluatedProperties": false
1682
1745
  }
1683
1746
  },
1684
1747
  "StrategyState": {
@@ -1733,7 +1796,8 @@
1733
1796
  "strategyState": {
1734
1797
  "$ref": "#/$defs/StrategyState"
1735
1798
  }
1736
- }
1799
+ },
1800
+ "unevaluatedProperties": false
1737
1801
  }
1738
1802
  },
1739
1803
  "StatefulStrategyIdentity": {
@@ -1865,6 +1929,26 @@
1865
1929
  "$comment": "Each thread contains an array of steps, allowing for sequential execution within a thread while supporting parallel execution across multiple threads."
1866
1930
  }
1867
1931
  },
1932
+ "StrategyThreadMapWrapper": {
1933
+ "identity": "TYPE-StrategyThreadMapWrapper",
1934
+ "name": "StrategyThreadMapWrapper",
1935
+ "description": "dummy-description",
1936
+ "resourceFormatRef": "FORMAT-ApplicationJson",
1937
+ "extractionSchema": {
1938
+ "$anchor": "StrategyThreadMapWrapper",
1939
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1940
+ "type": "object",
1941
+ "required": [
1942
+ "strategyThreadMap"
1943
+ ],
1944
+ "properties": {
1945
+ "strategyThreadMap": {
1946
+ "$ref": "#/$defs/StrategyThreadMap"
1947
+ }
1948
+ },
1949
+ "unevaluatedProperties": false
1950
+ }
1951
+ },
1868
1952
  "StrategyRun": {
1869
1953
  "identity": "TYPE-StrategyRun",
1870
1954
  "name": "StrategyRun",
@@ -1893,7 +1977,7 @@
1893
1977
  "allOf": [
1894
1978
  {
1895
1979
  "$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.",
1896
- "$ref": "#/$defs/StrategyThreadMap"
1980
+ "$ref": "#/$defs/StrategyThreadMapWrapper"
1897
1981
  },
1898
1982
  {
1899
1983
  "$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.",
@@ -995,7 +995,8 @@
995
995
  "$ref": "#/$defs/Documented"
996
996
  }
997
997
  ]
998
- }
998
+ },
999
+ "unevaluatedProperties": false
999
1000
  }
1000
1001
  },
1001
1002
  "RoleMap": {
@@ -1025,6 +1026,40 @@
1025
1026
  }
1026
1027
  }
1027
1028
  },
1029
+ "Error": {
1030
+ "identity": "RESOURCE-Error",
1031
+ "resourceTypeRef": "TYPE-ResourceType",
1032
+ "creationContext": {
1033
+ "resourceRoleRef": "ROLE-Genesis",
1034
+ "executionRef": "EXECUTION-Error"
1035
+ },
1036
+ "kind": "materialized",
1037
+ "timestamp": "2025-11-30T00:00:00.000Z",
1038
+ "extractedData": {
1039
+ "identity": "TYPE-Error",
1040
+ "name": "Error",
1041
+ "description": "dummy-description",
1042
+ "resourceFormatRef": "FORMAT-ApplicationJson",
1043
+ "extractionSchema": {
1044
+ "$anchor": "Error",
1045
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1046
+ "type": "object",
1047
+ "allOf": [
1048
+ {
1049
+ "$ref": "#/$defs/Documented"
1050
+ },
1051
+ {
1052
+ "properties": {
1053
+ "details": {
1054
+ "type": "object"
1055
+ }
1056
+ }
1057
+ }
1058
+ ],
1059
+ "unevaluatedProperties": false
1060
+ }
1061
+ }
1062
+ },
1028
1063
  "Roles": {
1029
1064
  "identity": "RESOURCE-Roles",
1030
1065
  "resourceTypeRef": "TYPE-ResourceType",
@@ -1052,7 +1087,44 @@
1052
1087
  "$ref": "#/$defs/RoleMap"
1053
1088
  },
1054
1089
  "outputMap": {
1055
- "$ref": "#/$defs/RoleMap"
1090
+ "allOf": [
1091
+ {
1092
+ "$ref": "#/$defs/RoleMap"
1093
+ },
1094
+ {
1095
+ "required": [
1096
+ "ROLE-ErrorOutput"
1097
+ ],
1098
+ "properties": {
1099
+ "ROLE-ErrorOutput": {
1100
+ "type": "object",
1101
+ "allOf": [
1102
+ {
1103
+ "$ref": "#/$defs/ResourceRoleValue"
1104
+ },
1105
+ {
1106
+ "required": [
1107
+ "resourceTypeRef",
1108
+ "name",
1109
+ "description"
1110
+ ],
1111
+ "properties": {
1112
+ "resourceTypeRef": {
1113
+ "const": "TYPE-Error"
1114
+ },
1115
+ "name": {
1116
+ "const": "ErrorOutput"
1117
+ },
1118
+ "description": {
1119
+ "const": "Represents error outputs from job executions."
1120
+ }
1121
+ }
1122
+ }
1123
+ ]
1124
+ }
1125
+ }
1126
+ }
1127
+ ]
1056
1128
  }
1057
1129
  },
1058
1130
  "unevaluatedProperties": false
@@ -2229,7 +2301,8 @@
2229
2301
  "statelessStrategy": {
2230
2302
  "$ref": "#/$defs/StatelessStrategy"
2231
2303
  }
2232
- }
2304
+ },
2305
+ "unevaluatedProperties": false
2233
2306
  }
2234
2307
  }
2235
2308
  },
@@ -2304,7 +2377,8 @@
2304
2377
  "strategyState": {
2305
2378
  "$ref": "#/$defs/StrategyState"
2306
2379
  }
2307
- }
2380
+ },
2381
+ "unevaluatedProperties": false
2308
2382
  }
2309
2383
  }
2310
2384
  },
@@ -2507,6 +2581,36 @@
2507
2581
  }
2508
2582
  }
2509
2583
  },
2584
+ "StrategyThreadMapWrapper": {
2585
+ "identity": "RESOURCE-StrategyThreadMapWrapper",
2586
+ "resourceTypeRef": "TYPE-ResourceType",
2587
+ "creationContext": {
2588
+ "resourceRoleRef": "ROLE-Genesis",
2589
+ "executionRef": "EXECUTION-StrategyThreadMapWrapper"
2590
+ },
2591
+ "kind": "materialized",
2592
+ "timestamp": "2025-11-30T00:00:00.000Z",
2593
+ "extractedData": {
2594
+ "identity": "TYPE-StrategyThreadMapWrapper",
2595
+ "name": "StrategyThreadMapWrapper",
2596
+ "description": "dummy-description",
2597
+ "resourceFormatRef": "FORMAT-ApplicationJson",
2598
+ "extractionSchema": {
2599
+ "$anchor": "StrategyThreadMapWrapper",
2600
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
2601
+ "type": "object",
2602
+ "required": [
2603
+ "strategyThreadMap"
2604
+ ],
2605
+ "properties": {
2606
+ "strategyThreadMap": {
2607
+ "$ref": "#/$defs/StrategyThreadMap"
2608
+ }
2609
+ },
2610
+ "unevaluatedProperties": false
2611
+ }
2612
+ }
2613
+ },
2510
2614
  "StrategyRun": {
2511
2615
  "identity": "RESOURCE-StrategyRun",
2512
2616
  "resourceTypeRef": "TYPE-ResourceType",
@@ -2544,7 +2648,7 @@
2544
2648
  "allOf": [
2545
2649
  {
2546
2650
  "$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.",
2547
- "$ref": "#/$defs/StrategyThreadMap"
2651
+ "$ref": "#/$defs/StrategyThreadMapWrapper"
2548
2652
  },
2549
2653
  {
2550
2654
  "$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.",
@@ -116,6 +116,24 @@
116
116
  ],
117
117
  "$anchor": "Documented"
118
118
  },
119
+ "Error": {
120
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
121
+ "type": "object",
122
+ "allOf": [
123
+ {
124
+ "$ref": "#/$defs/Documented"
125
+ },
126
+ {
127
+ "properties": {
128
+ "details": {
129
+ "type": "object"
130
+ }
131
+ }
132
+ }
133
+ ],
134
+ "unevaluatedProperties": false,
135
+ "$anchor": "Error"
136
+ },
119
137
  "Execution": {
120
138
  "$schema": "https://json-schema.org/draft/2020-12/schema",
121
139
  "type": "object",
@@ -1164,7 +1182,44 @@
1164
1182
  "$ref": "#/$defs/RoleMap"
1165
1183
  },
1166
1184
  "outputMap": {
1167
- "$ref": "#/$defs/RoleMap"
1185
+ "allOf": [
1186
+ {
1187
+ "$ref": "#/$defs/RoleMap"
1188
+ },
1189
+ {
1190
+ "properties": {
1191
+ "ROLE-ErrorOutput": {
1192
+ "type": "object",
1193
+ "allOf": [
1194
+ {
1195
+ "$ref": "#/$defs/ResourceRoleValue"
1196
+ },
1197
+ {
1198
+ "properties": {
1199
+ "description": {
1200
+ "const": "Represents error outputs from job executions."
1201
+ },
1202
+ "name": {
1203
+ "const": "ErrorOutput"
1204
+ },
1205
+ "resourceTypeRef": {
1206
+ "const": "TYPE-Error"
1207
+ }
1208
+ },
1209
+ "required": [
1210
+ "resourceTypeRef",
1211
+ "name",
1212
+ "description"
1213
+ ]
1214
+ }
1215
+ ]
1216
+ }
1217
+ },
1218
+ "required": [
1219
+ "ROLE-ErrorOutput"
1220
+ ]
1221
+ }
1222
+ ]
1168
1223
  }
1169
1224
  },
1170
1225
  "required": [
@@ -1254,6 +1309,7 @@
1254
1309
  "required": [
1255
1310
  "statelessStrategy"
1256
1311
  ],
1312
+ "unevaluatedProperties": false,
1257
1313
  "$anchor": "StatelessStrategyWrapper"
1258
1314
  },
1259
1315
  "Step": {
@@ -1301,7 +1357,7 @@
1301
1357
  "allOf": [
1302
1358
  {
1303
1359
  "$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.",
1304
- "$ref": "#/$defs/StrategyThreadMap"
1360
+ "$ref": "#/$defs/StrategyThreadMapWrapper"
1305
1361
  },
1306
1362
  {
1307
1363
  "$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.",
@@ -1406,6 +1462,7 @@
1406
1462
  "required": [
1407
1463
  "strategyState"
1408
1464
  ],
1465
+ "unevaluatedProperties": false,
1409
1466
  "$anchor": "StrategyStateWrapper"
1410
1467
  },
1411
1468
  "StrategyThreadIdentity": {
@@ -1429,6 +1486,20 @@
1429
1486
  "$ref": "#/$defs/StrategyThreadIdentity"
1430
1487
  }
1431
1488
  },
1489
+ "StrategyThreadMapWrapper": {
1490
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1491
+ "type": "object",
1492
+ "properties": {
1493
+ "strategyThreadMap": {
1494
+ "$ref": "#/$defs/StrategyThreadMap"
1495
+ }
1496
+ },
1497
+ "required": [
1498
+ "strategyThreadMap"
1499
+ ],
1500
+ "unevaluatedProperties": false,
1501
+ "$anchor": "StrategyThreadMapWrapper"
1502
+ },
1432
1503
  "Timestamp": {
1433
1504
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1434
1505
  "type": "object",
@@ -99,7 +99,44 @@
99
99
  "$ref": "#/$defs/RoleMap"
100
100
  },
101
101
  "outputMap": {
102
- "$ref": "#/$defs/RoleMap"
102
+ "allOf": [
103
+ {
104
+ "$ref": "#/$defs/RoleMap"
105
+ },
106
+ {
107
+ "properties": {
108
+ "ROLE-ErrorOutput": {
109
+ "type": "object",
110
+ "allOf": [
111
+ {
112
+ "$ref": "#/$defs/ResourceRoleValue"
113
+ },
114
+ {
115
+ "properties": {
116
+ "description": {
117
+ "const": "Represents error outputs from job executions."
118
+ },
119
+ "name": {
120
+ "const": "ErrorOutput"
121
+ },
122
+ "resourceTypeRef": {
123
+ "const": "TYPE-Error"
124
+ }
125
+ },
126
+ "required": [
127
+ "resourceTypeRef",
128
+ "name",
129
+ "description"
130
+ ]
131
+ }
132
+ ]
133
+ }
134
+ },
135
+ "required": [
136
+ "ROLE-ErrorOutput"
137
+ ]
138
+ }
139
+ ]
103
140
  }
104
141
  },
105
142
  "required": [
@@ -31,6 +31,7 @@
31
31
  "required": [
32
32
  "statelessStrategy"
33
33
  ],
34
+ "unevaluatedProperties": false,
34
35
  "$anchor": "StatelessStrategyWrapper"
35
36
  },
36
37
  "StrategyStateWrapper": {
@@ -44,6 +45,7 @@
44
45
  "required": [
45
46
  "strategyState"
46
47
  ],
48
+ "unevaluatedProperties": false,
47
49
  "$anchor": "StrategyStateWrapper"
48
50
  },
49
51
  "StatefulStrategyIdentity": {