@toolproof-core/schema 1.0.1 → 1.0.3

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.
Files changed (47) hide show
  1. package/dist/generated/dependencyMap.json +292 -0
  2. package/dist/generated/normalized/Genesis.d.ts +2 -0
  3. package/dist/generated/normalized/Genesis.js +2 -0
  4. package/dist/generated/normalized/Genesis.json +2000 -0
  5. package/dist/generated/resources/Genesis.d.ts +2 -0
  6. package/dist/generated/resources/Genesis.js +2 -0
  7. package/dist/generated/resources/Genesis.json +2899 -0
  8. package/dist/generated/schemas/Genesis.d.ts +2 -0
  9. package/dist/generated/schemas/Genesis.js +2 -0
  10. package/dist/generated/schemas/Genesis.json +1458 -0
  11. package/dist/generated/schemas/standalone/Goal.d.ts +2 -0
  12. package/dist/generated/schemas/standalone/Goal.js +2 -0
  13. package/dist/generated/schemas/standalone/Goal.json +86 -0
  14. package/dist/generated/schemas/standalone/Job.d.ts +2 -0
  15. package/dist/generated/schemas/standalone/Job.js +2 -0
  16. package/dist/generated/schemas/standalone/Job.json +236 -0
  17. package/dist/generated/schemas/standalone/RawStrategy.d.ts +2 -0
  18. package/dist/generated/schemas/standalone/RawStrategy.js +2 -0
  19. package/dist/generated/schemas/standalone/RawStrategy.json +642 -0
  20. package/dist/generated/schemas/standalone/ResourceType.d.ts +2 -0
  21. package/dist/generated/schemas/standalone/ResourceType.js +2 -0
  22. package/dist/generated/schemas/standalone/ResourceType.json +140 -0
  23. package/dist/generated/schemas/standalone/RunnableStrategy.d.ts +2 -0
  24. package/dist/generated/schemas/standalone/RunnableStrategy.js +2 -0
  25. package/dist/generated/schemas/standalone/RunnableStrategy.json +712 -0
  26. package/dist/generated/schemas/standalone/StrategyRun.d.ts +2 -0
  27. package/dist/generated/schemas/standalone/StrategyRun.js +2 -0
  28. package/dist/generated/schemas/standalone/StrategyRun.json +994 -0
  29. package/dist/index.d.ts +13 -0
  30. package/dist/index.js +7 -0
  31. package/package.json +9 -8
  32. package/src/Genesis.json +1999 -1999
  33. package/src/generated/types/standalone/Resource_Genesis.js +1 -1
  34. package/src/generated/types/standalone/Resource_Job.js +1 -1
  35. package/src/generated/types/standalone/Resource_RawStrategy.js +1 -1
  36. package/src/generated/types/standalone/Resource_ResourceType.js +1 -1
  37. package/src/generated/types/standalone/Resource_RunnableStrategy.js +1 -1
  38. package/src/index.ts +93 -1
  39. package/src/scripts/_lib/config.ts +205 -205
  40. package/src/scripts/extractSchemasFromResourceTypeShells.ts +218 -218
  41. package/src/scripts/generateDependencies.ts +120 -120
  42. package/src/scripts/generateSchemaShims.ts +135 -135
  43. package/src/scripts/generateStandaloneSchema.ts +175 -175
  44. package/src/scripts/generateStandaloneType.ts +119 -119
  45. package/src/scripts/generateTypes.ts +614 -614
  46. package/src/scripts/normalizeAnchorsToPointers.ts +123 -123
  47. package/src/scripts/wrapResourceTypesWithResourceShells.ts +84 -84
@@ -0,0 +1,2 @@
1
+ import schema from './Goal.json';
2
+ export default schema;
@@ -0,0 +1,2 @@
1
+ import schema from './Goal.json' with { type: 'json' };
2
+ export default schema;
@@ -0,0 +1,86 @@
1
+ {
2
+ "$anchor": "Goal",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "required": [
6
+ "identity",
7
+ "target"
8
+ ],
9
+ "properties": {
10
+ "identity": {
11
+ "$ref": "#/$defs/GoalIdentity"
12
+ },
13
+ "target": {
14
+ "type": "integer",
15
+ "minimum": 0
16
+ },
17
+ "disallowedJobs": {
18
+ "type": "array",
19
+ "items": {
20
+ "$ref": "#/$defs/JobIdentity"
21
+ }
22
+ },
23
+ "disallowedSequences": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "array",
27
+ "items": {
28
+ "$ref": "#/$defs/JobIdentity"
29
+ }
30
+ }
31
+ },
32
+ "minSteps": {
33
+ "type": "integer",
34
+ "minimum": 1
35
+ },
36
+ "maxSteps": {
37
+ "type": "integer",
38
+ "minimum": 1
39
+ }
40
+ },
41
+ "allOf": [
42
+ {
43
+ "$ref": "#/$defs/DomainFacet"
44
+ }
45
+ ],
46
+ "unevaluatedProperties": false,
47
+ "$defs": {
48
+ "GoalIdentity": {
49
+ "$anchor": "GoalIdentity",
50
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
51
+ "type": "string",
52
+ "pattern": "^GOAL-.+$"
53
+ },
54
+ "JobIdentity": {
55
+ "$anchor": "JobIdentity",
56
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
57
+ "type": "string",
58
+ "pattern": "^JOB-.+$"
59
+ },
60
+ "DomainFacet": {
61
+ "$anchor": "DomainFacet",
62
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
63
+ "type": "object",
64
+ "required": [
65
+ "domain"
66
+ ],
67
+ "properties": {
68
+ "domain": {
69
+ "$ref": "#/$defs/Domain"
70
+ }
71
+ }
72
+ },
73
+ "Domain": {
74
+ "$anchor": "Domain",
75
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
76
+ "type": "string",
77
+ "enum": [
78
+ "internal",
79
+ "numerical",
80
+ "biological",
81
+ "logical",
82
+ "augmental"
83
+ ]
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,2 @@
1
+ import schema from './Job.json';
2
+ export default schema;
@@ -0,0 +1,2 @@
1
+ import schema from './Job.json' with { type: 'json' };
2
+ export default schema;
@@ -0,0 +1,236 @@
1
+ {
2
+ "$anchor": "Job",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "required": [
6
+ "identity",
7
+ "implementationUri"
8
+ ],
9
+ "properties": {
10
+ "identity": {
11
+ "$ref": "#/$defs/JobIdentity"
12
+ },
13
+ "implementationUri": {
14
+ "$ref": "#/$defs/Uri"
15
+ }
16
+ },
17
+ "allOf": [
18
+ {
19
+ "$ref": "#/$defs/DocumentationFacet"
20
+ },
21
+ {
22
+ "$ref": "#/$defs/DomainFacet"
23
+ },
24
+ {
25
+ "$ref": "#/$defs/RolesFacet"
26
+ }
27
+ ],
28
+ "unevaluatedProperties": false,
29
+ "$defs": {
30
+ "JobIdentity": {
31
+ "$anchor": "JobIdentity",
32
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
33
+ "type": "string",
34
+ "pattern": "^JOB-.+$"
35
+ },
36
+ "Uri": {
37
+ "$anchor": "Uri",
38
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
39
+ "type": "string",
40
+ "format": "uri"
41
+ },
42
+ "DocumentationFacet": {
43
+ "$anchor": "DocumentationFacet",
44
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
45
+ "type": "object",
46
+ "allOf": [
47
+ {
48
+ "$ref": "#/$defs/NameFacet"
49
+ },
50
+ {
51
+ "$ref": "#/$defs/DescriptionFacet"
52
+ }
53
+ ]
54
+ },
55
+ "DomainFacet": {
56
+ "$anchor": "DomainFacet",
57
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
58
+ "type": "object",
59
+ "required": [
60
+ "domain"
61
+ ],
62
+ "properties": {
63
+ "domain": {
64
+ "$ref": "#/$defs/Domain"
65
+ }
66
+ }
67
+ },
68
+ "RolesFacet": {
69
+ "$anchor": "RolesFacet",
70
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
71
+ "type": "object",
72
+ "required": [
73
+ "roles"
74
+ ],
75
+ "properties": {
76
+ "roles": {
77
+ "$ref": "#/$defs/Roles"
78
+ }
79
+ }
80
+ },
81
+ "NameFacet": {
82
+ "$anchor": "NameFacet",
83
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
84
+ "type": "object",
85
+ "required": [
86
+ "name"
87
+ ],
88
+ "properties": {
89
+ "name": {
90
+ "$ref": "#/$defs/Name"
91
+ }
92
+ }
93
+ },
94
+ "DescriptionFacet": {
95
+ "$anchor": "DescriptionFacet",
96
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
97
+ "type": "object",
98
+ "required": [
99
+ "description"
100
+ ],
101
+ "properties": {
102
+ "description": {
103
+ "$ref": "#/$defs/Description"
104
+ }
105
+ }
106
+ },
107
+ "Domain": {
108
+ "$anchor": "Domain",
109
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
110
+ "type": "string",
111
+ "enum": [
112
+ "internal",
113
+ "numerical",
114
+ "biological",
115
+ "logical",
116
+ "augmental"
117
+ ]
118
+ },
119
+ "Roles": {
120
+ "$anchor": "Roles",
121
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
122
+ "type": "object",
123
+ "required": [
124
+ "inputMap",
125
+ "outputMap"
126
+ ],
127
+ "properties": {
128
+ "inputMap": {
129
+ "$ref": "#/$defs/RoleMap"
130
+ },
131
+ "outputMap": {
132
+ "allOf": [
133
+ {
134
+ "$ref": "#/$defs/RoleMap"
135
+ },
136
+ {
137
+ "required": [
138
+ "ROLE-ErrorOutput"
139
+ ],
140
+ "properties": {
141
+ "ROLE-ErrorOutput": {
142
+ "type": "object",
143
+ "allOf": [
144
+ {
145
+ "$ref": "#/$defs/ResourceRoleValue"
146
+ },
147
+ {
148
+ "required": [
149
+ "resourceTypeHandle",
150
+ "name",
151
+ "description"
152
+ ],
153
+ "properties": {
154
+ "resourceTypeHandle": {
155
+ "const": "TYPE-Error"
156
+ },
157
+ "name": {
158
+ "const": "ErrorOutput"
159
+ },
160
+ "description": {
161
+ "const": "Represents error outputs from job runs."
162
+ }
163
+ }
164
+ }
165
+ ]
166
+ }
167
+ }
168
+ }
169
+ ]
170
+ }
171
+ },
172
+ "unevaluatedProperties": false
173
+ },
174
+ "Name": {
175
+ "$anchor": "Name",
176
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
177
+ "type": "string",
178
+ "minLength": 1,
179
+ "pattern": "^(?:[A-Z][^0-9]*|[a-z]+/[a-z.+&-]+)$",
180
+ "$comment": "Validation is intercepted by an AI Agent that verifies the name against Toolproof's naming conventions.",
181
+ "semanticValidation": "Ajv custom keyword to verify name."
182
+ },
183
+ "Description": {
184
+ "$anchor": "Description",
185
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
186
+ "type": "string",
187
+ "minLength": 1,
188
+ "$comment": "Validation is intercepted by an AI Agent that verifies the description against Toolproof's documentation standards.",
189
+ "semanticValidation": "Ajv custom keyword to verify description."
190
+ },
191
+ "RoleMap": {
192
+ "$anchor": "RoleMap",
193
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
194
+ "type": "object",
195
+ "propertyNames": {
196
+ "$ref": "#/$defs/ResourceRoleIdentity"
197
+ },
198
+ "additionalProperties": {
199
+ "$ref": "#/$defs/ResourceRoleValue"
200
+ }
201
+ },
202
+ "ResourceRoleValue": {
203
+ "$anchor": "ResourceRoleValue",
204
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
205
+ "type": "object",
206
+ "allOf": [
207
+ {
208
+ "$comment": "A ResourceRole does not have a self-contained identity, as it is always defined in the context of a RoleMap. ResourceRoleValue uses the Value suffix to mean 'the value stored in this map' (RoleMap.additionalProperties).",
209
+ "required": [
210
+ "resourceTypeHandle"
211
+ ],
212
+ "properties": {
213
+ "resourceTypeHandle": {
214
+ "$ref": "#/$defs/ResourceTypeIdentity"
215
+ }
216
+ }
217
+ },
218
+ {
219
+ "$ref": "#/$defs/DocumentationFacet"
220
+ }
221
+ ]
222
+ },
223
+ "ResourceRoleIdentity": {
224
+ "$anchor": "ResourceRoleIdentity",
225
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
226
+ "type": "string",
227
+ "pattern": "^ROLE-.+$"
228
+ },
229
+ "ResourceTypeIdentity": {
230
+ "$anchor": "ResourceTypeIdentity",
231
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
232
+ "type": "string",
233
+ "pattern": "^TYPE-.+$"
234
+ }
235
+ }
236
+ }
@@ -0,0 +1,2 @@
1
+ import schema from './RawStrategy.json';
2
+ export default schema;
@@ -0,0 +1,2 @@
1
+ import schema from './RawStrategy.json' with { type: 'json' };
2
+ export default schema;