@toolproof-core/genesis 1.0.49 → 1.0.50
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/dist/src/implementations/tools.d.ts +100 -0
- package/dist/src/implementations/tools.js +135 -0
- package/dist/src/index.d.ts +5 -4
- package/dist/src/index.js +4 -3
- package/dist/src/utils/resourceTypes.d.ts +2 -1
- package/dist/src/utils/resourceTypes.js +22 -6
- package/dist/src/utils/schemaRefNormalization.js +3 -3
- package/dist/src/utils/standaloneTypes.js +2 -2
- package/dist/src/utils/timestampedResources.d.ts +16 -0
- package/dist/src/utils/timestampedResources.js +17 -0
- package/dist/src/utils/typeGenerationPostProcess.js +2 -2
- package/dist/src/utils/zodCodegen.js +3 -3
- package/generated-src/declarations/booleans.json +4 -0
- package/generated-src/declarations/booleans.ts +2 -0
- package/generated-src/declarations/naturals.json +13 -0
- package/generated-src/declarations/naturals.ts +2 -0
- package/generated-src/{resourceTypes → declarations}/resourceTypes.json +176 -39
- package/generated-src/declarations/resourceTypes.ts +2 -0
- package/generated-src/declarations/tools.json +705 -0
- package/generated-src/declarations/tools.ts +2 -0
- package/generated-src/implementations/tools.ts +214 -0
- package/generated-src/{derived → lookups}/constants.ts +4 -5
- package/generated-src/metadata/Core.json +51 -114
- package/generated-src/metadata/dependencyMap.json +16 -2
- package/generated-src/metadata/terminals.json +3 -4
- package/generated-src/schemas/schemas.json +198 -29
- package/generated-src/schemas/standalone/Resource.json +4 -8
- package/generated-src/schemas/standalone/ResourceType.json +21 -5
- package/generated-src/schemas/standalone/Strategy.json +4 -8
- package/generated-src/schemas/standalone/StrategyTrace.json +4 -8
- package/generated-src/schemas/standalone/Suite.json +646 -0
- package/generated-src/schemas/standalone/Suite.ts +2 -0
- package/generated-src/schemas/standalone/Tool.json +48 -23
- package/generated-src/schemas/zod/Resource.ts +2 -2
- package/generated-src/schemas/zod/ResourceType.ts +1 -1
- package/generated-src/schemas/zod/Strategy.ts +3 -3
- package/generated-src/schemas/zod/StrategyTrace.ts +3 -3
- package/generated-src/schemas/zod/Suite.ts +44 -0
- package/generated-src/schemas/zod/Tool.ts +7 -2
- package/generated-src/schemas/zod/index.ts +1 -0
- package/{src/genesis/resources → generated-src/timestampedResources}/booleans.json +19 -23
- package/generated-src/timestampedResources/booleans.ts +2 -0
- package/{src/genesis/resources → generated-src/timestampedResources}/naturals.json +100 -111
- package/generated-src/timestampedResources/naturals.ts +2 -0
- package/generated-src/{resources → timestampedResources}/resourceTypes.json +202 -66
- package/generated-src/timestampedResources/resourceTypes.ts +2 -0
- package/{src/genesis/resources → generated-src/timestampedResources}/tools.json +824 -839
- package/generated-src/timestampedResources/tools.ts +2 -0
- package/generated-src/types/standalone/BooleanResource.d.ts +2 -2
- package/generated-src/types/standalone/ErrorResource.d.ts +2 -2
- package/generated-src/types/standalone/GoalResource.d.ts +2 -2
- package/generated-src/types/standalone/NaturalResource.d.ts +2 -2
- package/generated-src/types/standalone/ResourceResource.d.ts +2 -2
- package/generated-src/types/standalone/ResourceTypeResource.d.ts +2 -2
- package/generated-src/types/standalone/StrategyResource.d.ts +2 -2
- package/generated-src/types/standalone/StrategyTraceResource.d.ts +2 -2
- package/generated-src/types/standalone/SuiteResource.d.ts +3 -0
- package/generated-src/types/standalone/SuiteResource.js +1 -0
- package/generated-src/types/standalone/ToolResource.d.ts +2 -2
- package/generated-src/types/types.d.ts +57 -14
- package/package.json +18 -13
- package/src/declarations/booleans.json +4 -0
- package/src/declarations/naturals.json +13 -0
- package/src/{genesis → declarations/resourceTypes}/resourceTypeShells.json +52 -46
- package/src/{genesis → declarations/resourceTypes}/schemas.json +1838 -1669
- package/src/declarations/tools.json +705 -0
- package/src/implementations/tools.ts +214 -0
- package/src/index.ts +131 -110
- package/src/utils/constantsAndMappings.ts +194 -194
- package/src/utils/coreProjection.ts +52 -52
- package/src/utils/resourceTypes.ts +70 -38
- package/src/utils/schemaDependencies.ts +114 -114
- package/src/utils/schemaObjectNormalization.ts +70 -70
- package/src/utils/schemaRefNormalization.ts +82 -82
- package/src/utils/schemaShims.ts +16 -16
- package/src/utils/standaloneSchemas.ts +113 -113
- package/src/utils/standaloneTypes.ts +27 -27
- package/src/utils/standaloneZodSchemas.ts +71 -71
- package/src/utils/timestampedResources.ts +42 -0
- package/src/utils/typeGeneration.ts +30 -30
- package/src/utils/typeGenerationPostProcess.ts +245 -245
- package/src/utils/typeGenerationPreflight.ts +118 -118
- package/src/utils/zodCodegen.ts +548 -548
- package/toolproof.json +19 -0
- package/dist/src/genesis/resources/implementations/foo.d.ts +0 -1
- package/dist/src/genesis/resources/implementations/foo.js +0 -184
- package/dist/src/utils/resources.d.ts +0 -5
- package/dist/src/utils/resources.js +0 -17
- package/generated-src/resourceTypes/resourceTypes.ts +0 -2
- package/generated-src/resources/resourceTypes.ts +0 -2
- package/src/genesis/resources/implementations/foo.ts +0 -183
- package/src/utils/resources.ts +0 -26
- /package/generated-src/{derived → lookups}/mappings.ts +0 -0
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"allOf": [
|
|
5
|
+
{
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"name",
|
|
9
|
+
"version",
|
|
10
|
+
"description"
|
|
11
|
+
],
|
|
12
|
+
"properties": {
|
|
13
|
+
"name": {
|
|
14
|
+
"$ref": "#/$defs/Name"
|
|
15
|
+
},
|
|
16
|
+
"version": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"minLength": 1
|
|
19
|
+
},
|
|
20
|
+
"description": {
|
|
21
|
+
"$ref": "#/$defs/Description"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "object",
|
|
27
|
+
"required": [
|
|
28
|
+
"resourceTypes",
|
|
29
|
+
"tools"
|
|
30
|
+
],
|
|
31
|
+
"properties": {
|
|
32
|
+
"resourceTypes": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": {
|
|
35
|
+
"$ref": "#/$defs/ResourceType"
|
|
36
|
+
},
|
|
37
|
+
"uniqueItems": true
|
|
38
|
+
},
|
|
39
|
+
"tools": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"items": {
|
|
42
|
+
"$ref": "#/$defs/Tool"
|
|
43
|
+
},
|
|
44
|
+
"uniqueItems": true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"unevaluatedProperties": false,
|
|
50
|
+
"$defs": {
|
|
51
|
+
"Name": {
|
|
52
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
53
|
+
"type": "string",
|
|
54
|
+
"minLength": 1,
|
|
55
|
+
"pattern": "^[A-Z][a-zA-Z0-9]*$",
|
|
56
|
+
"$comment": "Validation is intercepted by an AI Agent that verifies the name against Toolproof's naming conventions.",
|
|
57
|
+
"semanticValidation": "Ajv custom keyword to verify name."
|
|
58
|
+
},
|
|
59
|
+
"Description": {
|
|
60
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
61
|
+
"type": "string",
|
|
62
|
+
"minLength": 1,
|
|
63
|
+
"$comment": "Validation is intercepted by an AI Agent that verifies the description against Toolproof's documentation standards.",
|
|
64
|
+
"semanticValidation": "Ajv custom keyword to verify description."
|
|
65
|
+
},
|
|
66
|
+
"ResourceType": {
|
|
67
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"required": [
|
|
70
|
+
"handle"
|
|
71
|
+
],
|
|
72
|
+
"semanticValidation": "If ingestorToolHandle is present, verify that it references an existing non-template Tool whose distinguished raw-instance input semantically matches ingestorToolInputSchema when provided, whose distinguished Boolean output reports whether the raw instance is valid for this ResourceType, and whose distinguished projection output is typed as this ResourceType and conforms to projectionSchema when projectionSchema is present.",
|
|
73
|
+
"properties": {
|
|
74
|
+
"handle": {
|
|
75
|
+
"$ref": "#/$defs/ResourceTypeHandle"
|
|
76
|
+
},
|
|
77
|
+
"projectionSchema": {
|
|
78
|
+
"$ref": "#/$defs/JsonSchemaObject"
|
|
79
|
+
},
|
|
80
|
+
"ingestorToolHandle": {
|
|
81
|
+
"$ref": "#/$defs/ToolHandle"
|
|
82
|
+
},
|
|
83
|
+
"ingestorToolInputSchema": {
|
|
84
|
+
"$ref": "#/$defs/JsonSchemaObject"
|
|
85
|
+
},
|
|
86
|
+
"embeddingModelTools": {
|
|
87
|
+
"type": "array",
|
|
88
|
+
"items": {
|
|
89
|
+
"$ref": "#/$defs/ToolHandle"
|
|
90
|
+
},
|
|
91
|
+
"minItems": 1,
|
|
92
|
+
"$comment": "A ResourceType may specify a set of embeddingModelTools that convert the raw data (or one of its alternative representations) into vector embeddings. The build process enforces that the entries are members of a set of predefined embeddingModelTools."
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"allOf": [
|
|
96
|
+
{
|
|
97
|
+
"$ref": "#/$defs/DocumentationSpec"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"$comment": "A ResourceType ultimately describes both raw instances and their Core-visible JSON projection. Inside ToolProof Core, the ResourceType denotes the projection. projectionSchema describes the shape of that Core-visible projection. ingestorToolHandle identifies the Tool that ingests raw instances for this ResourceType by validating them against the built-in format grammar and, when projectionSchema is present, emitting the corresponding projection for Core. ingestorToolInputSchema describes the raw-instance input accepted by that ingestor. A ResourceType must specify either a projectionSchema or an ingestorToolHandle, or both. If only a projectionSchema is specified, the author relies on schema-based validation of the Core-visible projection and does not designate an ingestor. If only an ingestorToolHandle is specified, the author designates an ingestor that is authoritative for validating raw instances of the ResourceType. If both are specified, the ingestor must emit projections that conform to projectionSchema.",
|
|
101
|
+
"anyOf": [
|
|
102
|
+
{
|
|
103
|
+
"required": [
|
|
104
|
+
"projectionSchema"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"required": [
|
|
109
|
+
"ingestorToolHandle"
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"if": {
|
|
116
|
+
"required": [
|
|
117
|
+
"ingestorToolInputSchema"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"then": {
|
|
121
|
+
"required": [
|
|
122
|
+
"ingestorToolHandle"
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"unevaluatedProperties": false
|
|
128
|
+
},
|
|
129
|
+
"Tool": {
|
|
130
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
131
|
+
"type": "object",
|
|
132
|
+
"required": [
|
|
133
|
+
"handle",
|
|
134
|
+
"isTemplate"
|
|
135
|
+
],
|
|
136
|
+
"properties": {
|
|
137
|
+
"handle": {
|
|
138
|
+
"$ref": "#/$defs/ToolHandle"
|
|
139
|
+
},
|
|
140
|
+
"templateToolHandle": {
|
|
141
|
+
"$ref": "#/$defs/ToolHandle"
|
|
142
|
+
},
|
|
143
|
+
"isTemplate": {
|
|
144
|
+
"type": "boolean"
|
|
145
|
+
},
|
|
146
|
+
"instantiationRoleSpec": {
|
|
147
|
+
"$ref": "#/$defs/RoleSpec"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"$comment": "Template Tools own dispatch contract: Core scans all instantiation Tools grouped by templateToolHandle, derives a specializationKey from each instantiation tool's generic assignment by taking the canonical order of genericRoleName -> assigned ResourceType.resourceTypeHandle pairs, and asserts injectivity (no two instantiation Tools share the same key for the same template). At invocation time Core injects the specializationKey -> instantiationToolHandle lookup as the second input, then the template resolves the first input against it to return one instantiation Tool. Cross-resource compatibility between an instantiation Tool's roleSpec and the template's instantiationRoleSpec is deferred to the validation package.",
|
|
151
|
+
"semanticValidation": "Deferred: verify injectivity of specializationKey map per template; verify instantiation Tool roleSpec matches template instantiationRoleSpec; verify every supplied generic assignment key-set exactly equals roleSpec.inputRoleValueByName.GenericAssignmentByRoleName.mapKeys; verify every supplied generic assignment matches a registered specializationKey.",
|
|
152
|
+
"allOf": [
|
|
153
|
+
{
|
|
154
|
+
"$ref": "#/$defs/DocumentationSpec"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"if": {
|
|
158
|
+
"required": [
|
|
159
|
+
"isTemplate"
|
|
160
|
+
],
|
|
161
|
+
"properties": {
|
|
162
|
+
"isTemplate": {
|
|
163
|
+
"const": true
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"then": {
|
|
168
|
+
"required": [
|
|
169
|
+
"instantiationRoleSpec"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
"else": {
|
|
173
|
+
"not": {
|
|
174
|
+
"required": [
|
|
175
|
+
"instantiationRoleSpec"
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"$comment": "Template Tools must declare named roles: two map inputs (GenericAssignmentByRoleName and InstantiationToolHandleBySpecializationKey) and one scalar TYPE-Tool output (InstantiationTool). GenericAssignmentByRoleName.mapKeys declares the generic parameter names accepted by the template. Runtime semantic validation enforces that each invocation's GenericAssignmentByRoleName object has exactly that key set: no missing keys, no extra keys. These keys are the generic parameter names later referenced via roleSchema refs such as #OperandType; they are not required to match the top-level role names of instantiationRoleSpec.",
|
|
182
|
+
"if": {
|
|
183
|
+
"required": [
|
|
184
|
+
"isTemplate"
|
|
185
|
+
],
|
|
186
|
+
"properties": {
|
|
187
|
+
"isTemplate": {
|
|
188
|
+
"const": true
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"then": {
|
|
193
|
+
"properties": {
|
|
194
|
+
"roleSpec": {
|
|
195
|
+
"properties": {
|
|
196
|
+
"inputRoleValueByName": {
|
|
197
|
+
"required": [
|
|
198
|
+
"GenericAssignmentByRoleName",
|
|
199
|
+
"InstantiationToolHandleBySpecializationKey"
|
|
200
|
+
],
|
|
201
|
+
"properties": {
|
|
202
|
+
"GenericAssignmentByRoleName": {
|
|
203
|
+
"required": [
|
|
204
|
+
"containerKind",
|
|
205
|
+
"typeRef",
|
|
206
|
+
"mapKeys"
|
|
207
|
+
],
|
|
208
|
+
"properties": {
|
|
209
|
+
"containerKind": {
|
|
210
|
+
"const": "map"
|
|
211
|
+
},
|
|
212
|
+
"typeRef": {
|
|
213
|
+
"required": [
|
|
214
|
+
"resourceTypeHandle"
|
|
215
|
+
],
|
|
216
|
+
"properties": {
|
|
217
|
+
"resourceTypeHandle": {
|
|
218
|
+
"const": "TYPE-ResourceType"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"mapKeys": {
|
|
223
|
+
"type": "array",
|
|
224
|
+
"items": {
|
|
225
|
+
"$ref": "#/$defs/RoleName"
|
|
226
|
+
},
|
|
227
|
+
"minItems": 1,
|
|
228
|
+
"uniqueItems": true
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"InstantiationToolHandleBySpecializationKey": {
|
|
233
|
+
"required": [
|
|
234
|
+
"containerKind",
|
|
235
|
+
"typeRef"
|
|
236
|
+
],
|
|
237
|
+
"properties": {
|
|
238
|
+
"containerKind": {
|
|
239
|
+
"const": "map"
|
|
240
|
+
},
|
|
241
|
+
"typeRef": {
|
|
242
|
+
"required": [
|
|
243
|
+
"resourceTypeHandle"
|
|
244
|
+
],
|
|
245
|
+
"properties": {
|
|
246
|
+
"resourceTypeHandle": {
|
|
247
|
+
"const": "TYPE-Tool"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"not": {
|
|
253
|
+
"required": [
|
|
254
|
+
"mapKeys"
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"additionalProperties": false
|
|
260
|
+
},
|
|
261
|
+
"outputRoleValueByName": {
|
|
262
|
+
"required": [
|
|
263
|
+
"InstantiationTool"
|
|
264
|
+
],
|
|
265
|
+
"properties": {
|
|
266
|
+
"InstantiationTool": {
|
|
267
|
+
"required": [
|
|
268
|
+
"containerKind",
|
|
269
|
+
"typeRef"
|
|
270
|
+
],
|
|
271
|
+
"properties": {
|
|
272
|
+
"containerKind": {
|
|
273
|
+
"const": "scalar"
|
|
274
|
+
},
|
|
275
|
+
"typeRef": {
|
|
276
|
+
"required": [
|
|
277
|
+
"resourceTypeHandle"
|
|
278
|
+
],
|
|
279
|
+
"properties": {
|
|
280
|
+
"resourceTypeHandle": {
|
|
281
|
+
"const": "TYPE-Tool"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"additionalProperties": false
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"$ref": "#/$defs/RoleSpecFacet"
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
"unevaluatedProperties": false
|
|
300
|
+
},
|
|
301
|
+
"ResourceTypeHandle": {
|
|
302
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
303
|
+
"type": "string",
|
|
304
|
+
"pattern": "^TYPE-.+$"
|
|
305
|
+
},
|
|
306
|
+
"JsonSchemaObject": {
|
|
307
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
308
|
+
"type": "object",
|
|
309
|
+
"required": [
|
|
310
|
+
"$schema"
|
|
311
|
+
],
|
|
312
|
+
"properties": {
|
|
313
|
+
"$schema": {
|
|
314
|
+
"const": "https://json-schema.org/draft/2020-12/schema"
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"additionalProperties": true
|
|
318
|
+
},
|
|
319
|
+
"ToolHandle": {
|
|
320
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
321
|
+
"type": "string",
|
|
322
|
+
"pattern": "^TOOL-.+$"
|
|
323
|
+
},
|
|
324
|
+
"DocumentationSpec": {
|
|
325
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
326
|
+
"type": "object",
|
|
327
|
+
"allOf": [
|
|
328
|
+
{
|
|
329
|
+
"$ref": "#/$defs/NameFacet"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"type": "object",
|
|
333
|
+
"properties": {
|
|
334
|
+
"symbol": {
|
|
335
|
+
"type": "string"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"$ref": "#/$defs/DescriptionFacet"
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
},
|
|
344
|
+
"RoleSpec": {
|
|
345
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
346
|
+
"type": "object",
|
|
347
|
+
"required": [
|
|
348
|
+
"inputRoleValueByName",
|
|
349
|
+
"outputRoleValueByName"
|
|
350
|
+
],
|
|
351
|
+
"properties": {
|
|
352
|
+
"inputRoleValueByName": {
|
|
353
|
+
"$ref": "#/$defs/RoleValueByName"
|
|
354
|
+
},
|
|
355
|
+
"outputRoleValueByName": {
|
|
356
|
+
"$ref": "#/$defs/RoleValueByName"
|
|
357
|
+
},
|
|
358
|
+
"refinementSchema": {
|
|
359
|
+
"$comment": "Allows Tool authors to specify additional constraints on the role assignment beyond those expressible in the type system.",
|
|
360
|
+
"$ref": "#/$defs/JsonSchemaObject"
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
"unevaluatedProperties": false
|
|
364
|
+
},
|
|
365
|
+
"RoleName": {
|
|
366
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
367
|
+
"$ref": "#/$defs/Name"
|
|
368
|
+
},
|
|
369
|
+
"RoleSpecFacet": {
|
|
370
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
371
|
+
"type": "object",
|
|
372
|
+
"required": [
|
|
373
|
+
"roleSpec"
|
|
374
|
+
],
|
|
375
|
+
"properties": {
|
|
376
|
+
"roleSpec": {
|
|
377
|
+
"$ref": "#/$defs/RoleSpec"
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
"NameFacet": {
|
|
382
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
383
|
+
"type": "object",
|
|
384
|
+
"required": [
|
|
385
|
+
"name"
|
|
386
|
+
],
|
|
387
|
+
"properties": {
|
|
388
|
+
"name": {
|
|
389
|
+
"$ref": "#/$defs/Name"
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
"DescriptionFacet": {
|
|
394
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
395
|
+
"type": "object",
|
|
396
|
+
"required": [
|
|
397
|
+
"description"
|
|
398
|
+
],
|
|
399
|
+
"properties": {
|
|
400
|
+
"description": {
|
|
401
|
+
"$ref": "#/$defs/Description"
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
"RoleValueByName": {
|
|
406
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
407
|
+
"type": "object",
|
|
408
|
+
"propertyNames": {
|
|
409
|
+
"$ref": "#/$defs/RoleName"
|
|
410
|
+
},
|
|
411
|
+
"additionalProperties": {
|
|
412
|
+
"$ref": "#/$defs/RoleValue"
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
"RoleValue": {
|
|
416
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
417
|
+
"$comment": "Pairs a type reference (typeRef) with a container shape. typeRef may be a single atomic type reference or a finite sum type over atomic successful value alternatives.",
|
|
418
|
+
"type": "object",
|
|
419
|
+
"required": [
|
|
420
|
+
"typeRef",
|
|
421
|
+
"containerKind"
|
|
422
|
+
],
|
|
423
|
+
"properties": {
|
|
424
|
+
"typeRef": {
|
|
425
|
+
"$ref": "#/$defs/TypeRef"
|
|
426
|
+
},
|
|
427
|
+
"refinementSchema": {
|
|
428
|
+
"$comment": "Allows Tool authors to specify additional constraints on the role value beyond those expressible in the type system.",
|
|
429
|
+
"$ref": "#/$defs/JsonSchemaObject"
|
|
430
|
+
},
|
|
431
|
+
"containerKind": {
|
|
432
|
+
"$ref": "#/$defs/ContainerKind"
|
|
433
|
+
},
|
|
434
|
+
"containerSchema": {
|
|
435
|
+
"$ref": "#/$defs/JsonSchemaObject"
|
|
436
|
+
},
|
|
437
|
+
"mapKeys": {
|
|
438
|
+
"$ref": "#/$defs/RoleNameArray"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
"allOf": [
|
|
442
|
+
{
|
|
443
|
+
"$comment": "If containerKind is scalar, containerSchema is forbidden. Otherwise, it is optional.",
|
|
444
|
+
"if": {
|
|
445
|
+
"properties": {
|
|
446
|
+
"containerKind": {
|
|
447
|
+
"const": "scalar"
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"then": {
|
|
452
|
+
"not": {
|
|
453
|
+
"required": [
|
|
454
|
+
"containerSchema"
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"$comment": "If containerKind is array and containerSchema is provided, it must describe a homogeneous array (type=array with items; tuple-only schemas are disallowed).",
|
|
461
|
+
"if": {
|
|
462
|
+
"required": [
|
|
463
|
+
"containerSchema"
|
|
464
|
+
],
|
|
465
|
+
"properties": {
|
|
466
|
+
"containerKind": {
|
|
467
|
+
"const": "array"
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
"then": {
|
|
472
|
+
"properties": {
|
|
473
|
+
"containerSchema": {
|
|
474
|
+
"type": "object",
|
|
475
|
+
"required": [
|
|
476
|
+
"type",
|
|
477
|
+
"items"
|
|
478
|
+
],
|
|
479
|
+
"properties": {
|
|
480
|
+
"type": {
|
|
481
|
+
"const": "array"
|
|
482
|
+
},
|
|
483
|
+
"items": {
|
|
484
|
+
"type": "object"
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
"not": {
|
|
488
|
+
"required": [
|
|
489
|
+
"prefixItems"
|
|
490
|
+
]
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"$comment": "If containerKind is map and containerSchema is provided, it must describe a homogeneous map (type=object with additionalProperties; key-specific schemas are disallowed).",
|
|
498
|
+
"if": {
|
|
499
|
+
"required": [
|
|
500
|
+
"containerSchema"
|
|
501
|
+
],
|
|
502
|
+
"properties": {
|
|
503
|
+
"containerKind": {
|
|
504
|
+
"const": "map"
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
"then": {
|
|
509
|
+
"properties": {
|
|
510
|
+
"containerSchema": {
|
|
511
|
+
"type": "object",
|
|
512
|
+
"required": [
|
|
513
|
+
"type",
|
|
514
|
+
"additionalProperties"
|
|
515
|
+
],
|
|
516
|
+
"properties": {
|
|
517
|
+
"type": {
|
|
518
|
+
"const": "object"
|
|
519
|
+
},
|
|
520
|
+
"additionalProperties": {
|
|
521
|
+
"type": "object"
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
"not": {
|
|
525
|
+
"anyOf": [
|
|
526
|
+
{
|
|
527
|
+
"required": [
|
|
528
|
+
"properties"
|
|
529
|
+
]
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"required": [
|
|
533
|
+
"patternProperties"
|
|
534
|
+
]
|
|
535
|
+
}
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
"$comment": "If containerKind is map, mapKeys is optional (omit for open/dynamic keys, supply for statically-known fixed keys). On non-map containers, mapKeys is forbidden.",
|
|
544
|
+
"if": {
|
|
545
|
+
"properties": {
|
|
546
|
+
"containerKind": {
|
|
547
|
+
"const": "map"
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
"then": {},
|
|
552
|
+
"else": {
|
|
553
|
+
"not": {
|
|
554
|
+
"required": [
|
|
555
|
+
"mapKeys"
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
],
|
|
561
|
+
"unevaluatedProperties": false
|
|
562
|
+
},
|
|
563
|
+
"TypeRef": {
|
|
564
|
+
"$comment": "A type reference is either a single AtomicTypeRef or a finite sum type expressed as oneOfTypeRefs. The oneOfTypeRefs branch permits a union of atomic successful value alternatives and does not permit nested unions.",
|
|
565
|
+
"oneOf": [
|
|
566
|
+
{
|
|
567
|
+
"$ref": "#/$defs/AtomicTypeRef"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"type": "object",
|
|
571
|
+
"required": [
|
|
572
|
+
"oneOfTypeRefs"
|
|
573
|
+
],
|
|
574
|
+
"properties": {
|
|
575
|
+
"oneOfTypeRefs": {
|
|
576
|
+
"type": "array",
|
|
577
|
+
"items": {
|
|
578
|
+
"$ref": "#/$defs/AtomicTypeRef"
|
|
579
|
+
},
|
|
580
|
+
"minItems": 2,
|
|
581
|
+
"uniqueItems": true
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
"additionalProperties": false
|
|
585
|
+
}
|
|
586
|
+
]
|
|
587
|
+
},
|
|
588
|
+
"ContainerKind": {
|
|
589
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
590
|
+
"type": "string",
|
|
591
|
+
"enum": [
|
|
592
|
+
"scalar",
|
|
593
|
+
"array",
|
|
594
|
+
"map"
|
|
595
|
+
]
|
|
596
|
+
},
|
|
597
|
+
"RoleNameArray": {
|
|
598
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
599
|
+
"type": "array",
|
|
600
|
+
"items": {
|
|
601
|
+
"$ref": "#/$defs/RoleName"
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
"AtomicTypeRef": {
|
|
605
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
606
|
+
"$comment": "An atomic type reference is either resource-backed (resourceTypeHandle, strategy-legal) or schema-backed (roleSchema, internal/Core-only). The roleSchema branch holds an object whose $ref names the type parameter (e.g. '#OperandType'), matching an entry in the template's GenericAssignmentByRoleName.mapKeys. Exactly one atomic branch must be present.",
|
|
607
|
+
"oneOf": [
|
|
608
|
+
{
|
|
609
|
+
"type": "object",
|
|
610
|
+
"required": [
|
|
611
|
+
"resourceTypeHandle"
|
|
612
|
+
],
|
|
613
|
+
"properties": {
|
|
614
|
+
"resourceTypeHandle": {
|
|
615
|
+
"$ref": "#/$defs/ResourceTypeHandle"
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
"additionalProperties": false
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
"type": "object",
|
|
622
|
+
"required": [
|
|
623
|
+
"roleSchema"
|
|
624
|
+
],
|
|
625
|
+
"properties": {
|
|
626
|
+
"roleSchema": {
|
|
627
|
+
"type": "object",
|
|
628
|
+
"required": [
|
|
629
|
+
"$ref"
|
|
630
|
+
],
|
|
631
|
+
"$comment": "A reference to a named type parameter. The $ref value must be '#' followed by a RoleName, matching a key in the template's GenericAssignmentByRoleName.mapKeys.",
|
|
632
|
+
"properties": {
|
|
633
|
+
"$ref": {
|
|
634
|
+
"type": "string",
|
|
635
|
+
"pattern": "^#[A-Z][a-zA-Z0-9]*$"
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
"additionalProperties": false
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
"additionalProperties": false
|
|
642
|
+
}
|
|
643
|
+
]
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|