@toolproof-core/schema 1.0.0 → 1.0.1

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 (78) hide show
  1. package/dist/generated/types/standalone/Resource_Genesis.d.ts +3 -0
  2. package/dist/generated/types/standalone/Resource_Job.d.ts +3 -0
  3. package/dist/generated/types/standalone/Resource_RawStrategy.d.ts +3 -0
  4. package/dist/generated/types/standalone/Resource_ResourceType.d.ts +3 -0
  5. package/dist/generated/types/standalone/Resource_RunnableStrategy.d.ts +3 -0
  6. package/dist/generated/types/types.d.ts +487 -548
  7. package/dist/scripts/_lib/config.d.ts +12 -6
  8. package/dist/scripts/_lib/config.js +33 -15
  9. package/dist/scripts/{extractSchemas.js → extractSchemasFromResourceTypeShells.js} +14 -27
  10. package/dist/scripts/generateDependencies.js +2 -2
  11. package/dist/scripts/generateSchemaShims.js +22 -4
  12. package/dist/scripts/{extractSubSchemaWithDefs.js → generateStandaloneSchema.js} +12 -34
  13. package/dist/scripts/{generateResourceTypeType.js → generateStandaloneType.js} +23 -14
  14. package/dist/scripts/generateTypes.js +1 -1
  15. package/dist/scripts/{rewriteAnchors.js → normalizeAnchorsToPointers.js} +2 -2
  16. package/dist/scripts/{generateResourceShells.js → wrapResourceTypesWithResourceShells.js} +12 -34
  17. package/package.json +8 -8
  18. package/src/Genesis.json +44 -87
  19. package/src/generated/{dependencies.json → dependencyMap.json} +207 -214
  20. package/src/generated/{resourceTypes → normalized}/Genesis.json +44 -87
  21. package/src/generated/resources/Genesis.json +415 -478
  22. package/src/generated/schemas/Genesis.json +1026 -1057
  23. package/src/generated/schemas/{Goal.json → standalone/Goal.json} +34 -34
  24. package/src/generated/schemas/{Job.json → standalone/Job.json} +85 -85
  25. package/src/generated/schemas/{RawStrategy.json → standalone/RawStrategy.json} +238 -263
  26. package/src/generated/schemas/{ResourceType.json → standalone/ResourceType.json} +60 -60
  27. package/src/generated/schemas/{RunnableStrategy.json → standalone/RunnableStrategy.json} +296 -321
  28. package/src/generated/schemas/{StrategyRun.json → standalone/StrategyRun.json} +390 -421
  29. package/src/generated/types/standalone/Resource_Genesis.d.ts +3 -0
  30. package/src/generated/types/standalone/Resource_Job.d.ts +3 -0
  31. package/src/generated/types/standalone/Resource_RawStrategy.d.ts +3 -0
  32. package/src/generated/types/standalone/Resource_ResourceType.d.ts +3 -0
  33. package/src/generated/types/standalone/Resource_RunnableStrategy.d.ts +3 -0
  34. package/src/generated/types/types.d.ts +487 -548
  35. package/src/generated/types/types.js +1 -1
  36. package/src/scripts/_lib/config.ts +42 -18
  37. package/src/scripts/extractSchemasFromResourceTypeShells.ts +218 -0
  38. package/src/scripts/generateDependencies.ts +2 -2
  39. package/src/scripts/generateSchemaShims.ts +24 -4
  40. package/src/scripts/{extractSubSchemaWithDefs.ts → generateStandaloneSchema.ts} +13 -34
  41. package/src/scripts/{generateResourceTypeType.ts → generateStandaloneType.ts} +23 -14
  42. package/src/scripts/generateTypes.ts +1 -1
  43. package/src/scripts/{rewriteAnchors.ts → normalizeAnchorsToPointers.ts} +3 -3
  44. package/src/scripts/{generateResourceShells.ts → wrapResourceTypesWithResourceShells.ts} +13 -34
  45. package/dist/generated/types/Resource_Genesis.d.ts +0 -3
  46. package/dist/generated/types/Resource_Job.d.ts +0 -3
  47. package/dist/generated/types/Resource_RawStrategy.d.ts +0 -3
  48. package/dist/generated/types/Resource_ResourceType.d.ts +0 -3
  49. package/dist/generated/types/Resource_RunnableStrategy.d.ts +0 -3
  50. package/src/Roadmap.json +0 -102
  51. package/src/generated/types/Resource_Genesis.d.ts +0 -3
  52. package/src/generated/types/Resource_Job.d.ts +0 -3
  53. package/src/generated/types/Resource_RawStrategy.d.ts +0 -3
  54. package/src/generated/types/Resource_ResourceType.d.ts +0 -3
  55. package/src/generated/types/Resource_RunnableStrategy.d.ts +0 -3
  56. package/src/scripts/extractSchemas.ts +0 -229
  57. /package/dist/generated/types/{Resource_Genesis.js → standalone/Resource_Genesis.js} +0 -0
  58. /package/dist/generated/types/{Resource_Job.js → standalone/Resource_Job.js} +0 -0
  59. /package/dist/generated/types/{Resource_RawStrategy.js → standalone/Resource_RawStrategy.js} +0 -0
  60. /package/dist/generated/types/{Resource_ResourceType.js → standalone/Resource_ResourceType.js} +0 -0
  61. /package/dist/generated/types/{Resource_RunnableStrategy.js → standalone/Resource_RunnableStrategy.js} +0 -0
  62. /package/dist/scripts/{extractSchemas.d.ts → extractSchemasFromResourceTypeShells.d.ts} +0 -0
  63. /package/dist/scripts/{extractSubSchemaWithDefs.d.ts → generateStandaloneSchema.d.ts} +0 -0
  64. /package/dist/scripts/{generateResourceShells.d.ts → generateStandaloneType.d.ts} +0 -0
  65. /package/dist/scripts/{generateResourceTypeType.d.ts → normalizeAnchorsToPointers.d.ts} +0 -0
  66. /package/dist/scripts/{rewriteAnchors.d.ts → wrapResourceTypesWithResourceShells.d.ts} +0 -0
  67. /package/src/generated/{resourceTypes → normalized}/Genesis.ts +0 -0
  68. /package/src/generated/schemas/{Goal.ts → standalone/Goal.ts} +0 -0
  69. /package/src/generated/schemas/{Job.ts → standalone/Job.ts} +0 -0
  70. /package/src/generated/schemas/{RawStrategy.ts → standalone/RawStrategy.ts} +0 -0
  71. /package/src/generated/schemas/{ResourceType.ts → standalone/ResourceType.ts} +0 -0
  72. /package/src/generated/schemas/{RunnableStrategy.ts → standalone/RunnableStrategy.ts} +0 -0
  73. /package/src/generated/schemas/{StrategyRun.ts → standalone/StrategyRun.ts} +0 -0
  74. /package/src/generated/types/{Resource_Genesis.js → standalone/Resource_Genesis.js} +0 -0
  75. /package/src/generated/types/{Resource_Job.js → standalone/Resource_Job.js} +0 -0
  76. /package/src/generated/types/{Resource_RawStrategy.js → standalone/Resource_RawStrategy.js} +0 -0
  77. /package/src/generated/types/{Resource_ResourceType.js → standalone/Resource_ResourceType.js} +0 -0
  78. /package/src/generated/types/{Resource_RunnableStrategy.js → standalone/Resource_RunnableStrategy.js} +0 -0
@@ -1,51 +1,64 @@
1
1
  {
2
+ "$anchor": "ResourceType",
2
3
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
4
  "type": "object",
4
- "allOf": [
5
- {
6
- "$ref": "#/$defs/DocumentationFacet"
7
- },
8
- {
9
- "$ref": "#/$defs/ResourceTypeImplementationKindFacet"
10
- }
5
+ "required": [
6
+ "identity",
7
+ "nucleusSchema"
11
8
  ],
12
9
  "properties": {
10
+ "identity": {
11
+ "$ref": "#/$defs/ResourceTypeIdentity"
12
+ },
13
+ "nucleusSchema": true,
13
14
  "embeddingUriMap": {
14
15
  "type": "object",
16
+ "propertyNames": {
17
+ "type": "string",
18
+ "pattern": "^EMBEDDING-.+$"
19
+ },
15
20
  "additionalProperties": {
16
21
  "$ref": "#/$defs/Uri"
17
22
  },
18
- "$comment": "A ResourceType may specify a set of embedding models that convert the raw data (or one of its alternative representations) into vector embeddings. The build process enforces that the keys of this map are members of a set of predefined embedding models.",
19
23
  "minProperties": 1,
20
- "propertyNames": {
21
- "type": "string",
22
- "pattern": "^EMBEDDING-.+$"
23
- }
24
+ "$comment": "A ResourceType may specify a set of embedding models that convert the raw data (or one of its alternative representations) into vector embeddings. The build process enforces that the keys of this map are members of a set of predefined embedding models."
24
25
  },
25
26
  "generatorUriMap": {
26
27
  "type": "object",
28
+ "propertyNames": {
29
+ "type": "string",
30
+ "pattern": "^GENERATOR-.+$"
31
+ },
27
32
  "additionalProperties": {
28
33
  "$ref": "#/$defs/Uri"
29
34
  },
30
- "$comment": "A ResourceType may specify a set of generators that generate different representations of its instances from the raw file. A ToolProof Resource is always backed by a raw file. This is also true for the Resources (of type ResourceType) defined in this file! The build process enforces that the keys of this map are members of a set of predefined generators. GENERATOR-Json is an identifier for a generator that generates JSON data from the raw file. If the raw file is a JSON file, GENERATOR-Json is an implicit identity operation (i.e. an operation that does nothing) and must not be present in the map. A ResourceType may also specify other generators, such as GENERATOR-LeanTerm, which generates an instance (or 'term' in Lean jargon) of a corresponding Lean type from the raw file. ResourceTypes that specify GENERATOR-LeanTerm must also specify a corresponding GENERATOR-LeanType. While the term-version runs when data instances enter the ecosystem, the type-version runs when the ResourceType itself enters the ecosystem.",
31
35
  "minProperties": 1,
32
- "propertyNames": {
33
- "type": "string",
34
- "pattern": "^GENERATOR-.+$"
35
- }
36
- },
37
- "identity": {
38
- "$ref": "#/$defs/ResourceTypeIdentity"
39
- },
40
- "nucleusSchema": true
36
+ "$comment": "A ResourceType may specify a set of generators that generate different representations of its instances from the raw file. A ToolProof Resource is always backed by a raw file. This is also true for the Resources (of type ResourceType) defined in this file! The build process enforces that the keys of this map are members of a set of predefined generators. GENERATOR-Json is an identifier for a generator that generates JSON data from the raw file. If the raw file is a JSON file, GENERATOR-Json is an implicit identity operation (i.e. an operation that does nothing) and must not be present in the map. A ResourceType may also specify other generators, such as GENERATOR-LeanTerm, which generates an instance (or 'term' in Lean jargon) of a corresponding Lean type from the raw file. ResourceTypes that specify GENERATOR-LeanTerm must also specify a corresponding GENERATOR-LeanType. While the term-version runs when data instances enter the ecosystem, the type-version runs when the ResourceType itself enters the ecosystem."
37
+ }
41
38
  },
42
- "required": [
43
- "identity",
44
- "nucleusSchema"
39
+ "allOf": [
40
+ {
41
+ "$ref": "#/$defs/DocumentationFacet"
42
+ },
43
+ {
44
+ "$ref": "#/$defs/ResourceTypeImplementationKindFacet"
45
+ }
45
46
  ],
46
- "$anchor": "ResourceType",
47
47
  "$defs": {
48
+ "ResourceTypeIdentity": {
49
+ "$anchor": "ResourceTypeIdentity",
50
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
51
+ "type": "string",
52
+ "pattern": "^TYPE-.+$"
53
+ },
54
+ "Uri": {
55
+ "$anchor": "Uri",
56
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
57
+ "type": "string",
58
+ "format": "uri"
59
+ },
48
60
  "DocumentationFacet": {
61
+ "$anchor": "DocumentationFacet",
49
62
  "$schema": "https://json-schema.org/draft/2020-12/schema",
50
63
  "type": "object",
51
64
  "allOf": [
@@ -55,64 +68,51 @@
55
68
  {
56
69
  "$ref": "#/$defs/DescriptionFacet"
57
70
  }
58
- ],
59
- "$anchor": "DocumentationFacet"
71
+ ]
60
72
  },
61
73
  "ResourceTypeImplementationKindFacet": {
74
+ "$anchor": "ResourceTypeImplementationKindFacet",
62
75
  "$schema": "https://json-schema.org/draft/2020-12/schema",
63
76
  "type": "object",
77
+ "required": [
78
+ "resourceTypeImplementationKind"
79
+ ],
64
80
  "properties": {
65
81
  "resourceTypeImplementationKind": {
66
82
  "$ref": "#/$defs/ResourceTypeImplementationKind"
67
83
  }
68
- },
69
- "required": [
70
- "resourceTypeImplementationKind"
71
- ],
72
- "$anchor": "ResourceTypeImplementationKindFacet"
73
- },
74
- "Uri": {
75
- "$schema": "https://json-schema.org/draft/2020-12/schema",
76
- "type": "string",
77
- "$anchor": "Uri",
78
- "format": "uri"
79
- },
80
- "ResourceTypeIdentity": {
81
- "$schema": "https://json-schema.org/draft/2020-12/schema",
82
- "type": "string",
83
- "$anchor": "ResourceTypeIdentity",
84
- "pattern": "^TYPE-.+$"
84
+ }
85
85
  },
86
86
  "NameFacet": {
87
+ "$anchor": "NameFacet",
87
88
  "$schema": "https://json-schema.org/draft/2020-12/schema",
88
89
  "type": "object",
90
+ "required": [
91
+ "name"
92
+ ],
89
93
  "properties": {
90
94
  "name": {
91
95
  "$ref": "#/$defs/Name"
92
96
  }
93
- },
94
- "required": [
95
- "name"
96
- ],
97
- "$anchor": "NameFacet"
97
+ }
98
98
  },
99
99
  "DescriptionFacet": {
100
+ "$anchor": "DescriptionFacet",
100
101
  "$schema": "https://json-schema.org/draft/2020-12/schema",
101
102
  "type": "object",
103
+ "required": [
104
+ "description"
105
+ ],
102
106
  "properties": {
103
107
  "description": {
104
108
  "$ref": "#/$defs/Description"
105
109
  }
106
- },
107
- "required": [
108
- "description"
109
- ],
110
- "$anchor": "DescriptionFacet"
110
+ }
111
111
  },
112
112
  "ResourceTypeImplementationKind": {
113
+ "$anchor": "ResourceTypeImplementationKind",
113
114
  "$schema": "https://json-schema.org/draft/2020-12/schema",
114
115
  "type": "string",
115
- "$anchor": "ResourceTypeImplementationKind",
116
116
  "enum": [
117
117
  "internal-without-identity",
118
118
  "internal-with-identity",
@@ -120,20 +120,20 @@
120
120
  ]
121
121
  },
122
122
  "Name": {
123
+ "$anchor": "Name",
123
124
  "$schema": "https://json-schema.org/draft/2020-12/schema",
124
125
  "type": "string",
125
- "$anchor": "Name",
126
- "$comment": "Validation is intercepted by an AI Agent that verifies the name against Toolproof's naming conventions.",
127
126
  "minLength": 1,
128
127
  "pattern": "^(?:[A-Z][^0-9]*|[a-z]+/[a-z.+&-]+)$",
128
+ "$comment": "Validation is intercepted by an AI Agent that verifies the name against Toolproof's naming conventions.",
129
129
  "semanticValidation": "Ajv custom keyword to verify name."
130
130
  },
131
131
  "Description": {
132
+ "$anchor": "Description",
132
133
  "$schema": "https://json-schema.org/draft/2020-12/schema",
133
134
  "type": "string",
134
- "$anchor": "Description",
135
- "$comment": "Validation is intercepted by an AI Agent that verifies the description against Toolproof's documentation standards.",
136
135
  "minLength": 1,
136
+ "$comment": "Validation is intercepted by an AI Agent that verifies the description against Toolproof's documentation standards.",
137
137
  "semanticValidation": "Ajv custom keyword to verify description."
138
138
  }
139
139
  }