@toolproof-core/schema 1.0.2 → 1.0.4

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 (90) hide show
  1. package/dist/generated/normalized/Genesis.d.ts +2 -0
  2. package/dist/generated/normalized/Genesis.js +2 -0
  3. package/dist/generated/normalized/Genesis.json +2008 -0
  4. package/dist/generated/resources/Genesis.d.ts +2 -0
  5. package/dist/generated/resources/Genesis.js +2 -0
  6. package/dist/generated/resources/Genesis.json +2907 -0
  7. package/dist/generated/schemas/Genesis.d.ts +2 -0
  8. package/dist/generated/schemas/Genesis.js +2 -0
  9. package/dist/generated/schemas/Genesis.json +1466 -0
  10. package/dist/generated/schemas/standalone/Goal.d.ts +2 -0
  11. package/dist/generated/schemas/standalone/Goal.js +2 -0
  12. package/dist/generated/schemas/standalone/Goal.json +86 -0
  13. package/dist/generated/schemas/standalone/Job.d.ts +2 -0
  14. package/dist/generated/schemas/standalone/Job.js +2 -0
  15. package/dist/generated/schemas/standalone/Job.json +236 -0
  16. package/dist/generated/schemas/standalone/RawStrategy.d.ts +2 -0
  17. package/dist/generated/schemas/standalone/RawStrategy.js +2 -0
  18. package/dist/generated/schemas/standalone/RawStrategy.json +650 -0
  19. package/dist/generated/schemas/standalone/ResourceType.d.ts +2 -0
  20. package/dist/generated/schemas/standalone/ResourceType.js +2 -0
  21. package/dist/generated/schemas/standalone/ResourceType.json +140 -0
  22. package/dist/generated/schemas/standalone/RunnableStrategy.d.ts +2 -0
  23. package/dist/generated/schemas/standalone/RunnableStrategy.js +2 -0
  24. package/dist/generated/schemas/standalone/RunnableStrategy.json +720 -0
  25. package/dist/generated/schemas/standalone/StrategyRun.d.ts +2 -0
  26. package/dist/generated/schemas/standalone/StrategyRun.js +2 -0
  27. package/dist/generated/schemas/standalone/StrategyRun.json +1002 -0
  28. package/dist/generated/{types → typesTS}/standalone/Resource_Genesis.d.ts +1 -1
  29. package/{src/generated/types → dist/generated/typesTS}/standalone/Resource_Job.d.ts +1 -1
  30. package/{src/generated/types → dist/generated/typesTS}/standalone/Resource_RawStrategy.d.ts +1 -1
  31. package/{src/generated/types → dist/generated/typesTS}/standalone/Resource_ResourceType.d.ts +1 -1
  32. package/dist/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.d.ts +1 -1
  33. package/dist/generated/typesTS/typesTS.d.ts +745 -0
  34. package/dist/index.d.ts +10 -0
  35. package/dist/index.js +5 -0
  36. package/dist/scripts/_lib/config.d.ts +10 -10
  37. package/dist/scripts/_lib/config.js +23 -23
  38. package/dist/scripts/extractSchemasFromResourceTypeShells.js +109 -103
  39. package/dist/scripts/generateDependencies.js +15 -14
  40. package/dist/scripts/generateSchemaShims.js +76 -84
  41. package/dist/scripts/generateStandaloneSchema.js +47 -37
  42. package/dist/scripts/generateStandaloneTypeTS.js +108 -0
  43. package/dist/scripts/generateTypesTS.js +430 -0
  44. package/dist/scripts/normalizeAnchorsToPointers.js +37 -30
  45. package/dist/scripts/wrapResourceTypesWithResourceShells.js +14 -16
  46. package/package.json +11 -12
  47. package/src/Genesis.json +2007 -1999
  48. package/src/generated/{dependencyMap.json → dependencies/dependencyMap.json} +7 -6
  49. package/src/generated/normalized/Genesis.json +17 -9
  50. package/src/generated/resources/Genesis.json +19 -11
  51. package/src/generated/schemas/Genesis.json +15 -7
  52. package/src/generated/schemas/standalone/RawStrategy.json +15 -7
  53. package/src/generated/schemas/standalone/RunnableStrategy.json +15 -7
  54. package/src/generated/schemas/standalone/StrategyRun.json +15 -7
  55. package/src/generated/{types → typesTS}/standalone/Resource_Genesis.d.ts +1 -1
  56. package/{dist/generated/types → src/generated/typesTS}/standalone/Resource_Job.d.ts +1 -1
  57. package/{dist/generated/types → src/generated/typesTS}/standalone/Resource_RawStrategy.d.ts +1 -1
  58. package/{dist/generated/types → src/generated/typesTS}/standalone/Resource_ResourceType.d.ts +1 -1
  59. package/src/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.d.ts +1 -1
  60. package/src/generated/typesTS/typesTS.d.ts +745 -0
  61. package/src/index.ts +67 -1
  62. package/src/scripts/_lib/config.ts +205 -205
  63. package/src/scripts/extractSchemasFromResourceTypeShells.ts +261 -218
  64. package/src/scripts/generateDependencies.ts +121 -120
  65. package/src/scripts/generateSchemaShims.ts +127 -135
  66. package/src/scripts/generateStandaloneSchema.ts +185 -175
  67. package/src/scripts/generateStandaloneTypeTS.ts +127 -0
  68. package/src/scripts/generateTypesTS.ts +532 -0
  69. package/src/scripts/normalizeAnchorsToPointers.ts +115 -123
  70. package/src/scripts/wrapResourceTypesWithResourceShells.ts +82 -84
  71. package/dist/generated/types/types.d.ts +0 -1723
  72. package/dist/scripts/generateStandaloneType.js +0 -102
  73. package/dist/scripts/generateTypes.js +0 -550
  74. package/src/generated/types/types.d.ts +0 -1723
  75. package/src/scripts/generateStandaloneType.ts +0 -119
  76. package/src/scripts/generateTypes.ts +0 -615
  77. /package/dist/generated/{types → typesTS}/standalone/Resource_Genesis.js +0 -0
  78. /package/dist/generated/{types → typesTS}/standalone/Resource_Job.js +0 -0
  79. /package/dist/generated/{types → typesTS}/standalone/Resource_RawStrategy.js +0 -0
  80. /package/dist/generated/{types → typesTS}/standalone/Resource_ResourceType.js +0 -0
  81. /package/dist/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.js +0 -0
  82. /package/dist/generated/{types/types.js → typesTS/typesTS.js} +0 -0
  83. /package/dist/scripts/{generateStandaloneType.d.ts → generateStandaloneTypeTS.d.ts} +0 -0
  84. /package/dist/scripts/{generateTypes.d.ts → generateTypesTS.d.ts} +0 -0
  85. /package/src/generated/{types → typesTS}/standalone/Resource_Genesis.js +0 -0
  86. /package/src/generated/{types → typesTS}/standalone/Resource_Job.js +0 -0
  87. /package/src/generated/{types → typesTS}/standalone/Resource_RawStrategy.js +0 -0
  88. /package/src/generated/{types → typesTS}/standalone/Resource_ResourceType.js +0 -0
  89. /package/src/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.js +0 -0
  90. /package/src/generated/{types/types.js → typesTS/typesTS.js} +0 -0
@@ -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;