@toolproof-core/genesis 1.0.48 → 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.
Files changed (93) hide show
  1. package/dist/src/implementations/tools.d.ts +100 -0
  2. package/dist/src/implementations/tools.js +135 -0
  3. package/dist/src/index.d.ts +9 -8
  4. package/dist/src/index.js +4 -3
  5. package/dist/src/utils/resourceTypes.d.ts +2 -1
  6. package/dist/src/utils/resourceTypes.js +22 -6
  7. package/dist/src/utils/schemaRefNormalization.js +3 -3
  8. package/dist/src/utils/standaloneTypes.js +2 -2
  9. package/dist/src/utils/timestampedResources.d.ts +16 -0
  10. package/dist/src/utils/timestampedResources.js +17 -0
  11. package/dist/src/utils/typeGenerationPostProcess.js +2 -2
  12. package/dist/src/utils/zodCodegen.js +3 -3
  13. package/generated-src/declarations/booleans.json +4 -0
  14. package/generated-src/declarations/booleans.ts +2 -0
  15. package/generated-src/declarations/naturals.json +13 -0
  16. package/generated-src/declarations/naturals.ts +2 -0
  17. package/generated-src/{resourceTypes → declarations}/resourceTypes.json +176 -39
  18. package/generated-src/declarations/resourceTypes.ts +2 -0
  19. package/generated-src/declarations/tools.json +705 -0
  20. package/generated-src/declarations/tools.ts +2 -0
  21. package/generated-src/implementations/tools.ts +214 -0
  22. package/generated-src/{derived → lookups}/constants.ts +4 -5
  23. package/generated-src/metadata/Core.json +51 -114
  24. package/generated-src/metadata/dependencyMap.json +16 -2
  25. package/generated-src/metadata/terminals.json +3 -4
  26. package/generated-src/schemas/schemas.json +198 -29
  27. package/generated-src/schemas/standalone/Resource.json +4 -8
  28. package/generated-src/schemas/standalone/ResourceType.json +21 -5
  29. package/generated-src/schemas/standalone/Strategy.json +4 -8
  30. package/generated-src/schemas/standalone/StrategyTrace.json +4 -8
  31. package/generated-src/schemas/standalone/Suite.json +646 -0
  32. package/generated-src/schemas/standalone/Suite.ts +2 -0
  33. package/generated-src/schemas/standalone/Tool.json +48 -23
  34. package/generated-src/schemas/zod/Resource.ts +2 -2
  35. package/generated-src/schemas/zod/ResourceType.ts +1 -1
  36. package/generated-src/schemas/zod/Strategy.ts +3 -3
  37. package/generated-src/schemas/zod/StrategyTrace.ts +3 -3
  38. package/generated-src/schemas/zod/Suite.ts +44 -0
  39. package/generated-src/schemas/zod/Tool.ts +7 -2
  40. package/generated-src/schemas/zod/index.ts +1 -0
  41. package/{src/genesis/resources → generated-src/timestampedResources}/booleans.json +19 -23
  42. package/generated-src/timestampedResources/booleans.ts +2 -0
  43. package/{src/genesis/resources → generated-src/timestampedResources}/naturals.json +100 -111
  44. package/generated-src/timestampedResources/naturals.ts +2 -0
  45. package/generated-src/{resources → timestampedResources}/resourceTypes.json +202 -66
  46. package/generated-src/timestampedResources/resourceTypes.ts +2 -0
  47. package/{src/genesis/resources → generated-src/timestampedResources}/tools.json +824 -839
  48. package/generated-src/timestampedResources/tools.ts +2 -0
  49. package/generated-src/types/standalone/BooleanResource.d.ts +2 -2
  50. package/generated-src/types/standalone/ErrorResource.d.ts +2 -2
  51. package/generated-src/types/standalone/GoalResource.d.ts +2 -2
  52. package/generated-src/types/standalone/NaturalResource.d.ts +2 -2
  53. package/generated-src/types/standalone/ResourceResource.d.ts +2 -2
  54. package/generated-src/types/standalone/ResourceTypeResource.d.ts +2 -2
  55. package/generated-src/types/standalone/StrategyResource.d.ts +2 -2
  56. package/generated-src/types/standalone/StrategyTraceResource.d.ts +2 -2
  57. package/generated-src/types/standalone/SuiteResource.d.ts +3 -0
  58. package/generated-src/types/standalone/SuiteResource.js +1 -0
  59. package/generated-src/types/standalone/ToolResource.d.ts +2 -2
  60. package/generated-src/types/types.d.ts +57 -14
  61. package/package.json +18 -13
  62. package/src/declarations/booleans.json +4 -0
  63. package/src/declarations/naturals.json +13 -0
  64. package/src/{genesis → declarations/resourceTypes}/resourceTypeShells.json +52 -46
  65. package/src/{genesis → declarations/resourceTypes}/schemas.json +1838 -1669
  66. package/src/declarations/tools.json +705 -0
  67. package/src/implementations/tools.ts +214 -0
  68. package/src/index.ts +131 -27
  69. package/src/utils/constantsAndMappings.ts +194 -194
  70. package/src/utils/coreProjection.ts +52 -52
  71. package/src/utils/resourceTypes.ts +70 -38
  72. package/src/utils/schemaDependencies.ts +114 -114
  73. package/src/utils/schemaObjectNormalization.ts +70 -70
  74. package/src/utils/schemaRefNormalization.ts +82 -82
  75. package/src/utils/schemaShims.ts +16 -16
  76. package/src/utils/standaloneSchemas.ts +113 -113
  77. package/src/utils/standaloneTypes.ts +27 -27
  78. package/src/utils/standaloneZodSchemas.ts +71 -71
  79. package/src/utils/timestampedResources.ts +42 -0
  80. package/src/utils/typeGeneration.ts +30 -30
  81. package/src/utils/typeGenerationPostProcess.ts +245 -245
  82. package/src/utils/typeGenerationPreflight.ts +118 -118
  83. package/src/utils/zodCodegen.ts +548 -548
  84. package/toolproof.json +19 -0
  85. package/dist/src/genesis/resources/implementations/foo.d.ts +0 -1
  86. package/dist/src/genesis/resources/implementations/foo.js +0 -184
  87. package/dist/src/utils/resources.d.ts +0 -5
  88. package/dist/src/utils/resources.js +0 -17
  89. package/generated-src/resourceTypes/resourceTypes.ts +0 -2
  90. package/generated-src/resources/resourceTypes.ts +0 -2
  91. package/src/genesis/resources/implementations/foo.ts +0 -183
  92. package/src/utils/resources.ts +0 -26
  93. /package/generated-src/{derived → lookups}/mappings.ts +0 -0
@@ -0,0 +1,2 @@
1
+ import timestampedResources from './tools.json' with { type: 'json' };
2
+ export default timestampedResources;
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ResourcePointer, Boolean as ValueSchema } from "../types.js";
3
- export type BooleanResource = ResourcePointer & { value: ValueSchema };
2
+ import type { ResourcePointer, Boolean as ProjectionSchema } from "../types.js";
3
+ export type BooleanResource = ResourcePointer & { projection: ProjectionSchema };
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ResourcePointer, Error as ValueSchema } from "../types.js";
3
- export type ErrorResource = ResourcePointer & { value: ValueSchema };
2
+ import type { ResourcePointer, Error as ProjectionSchema } from "../types.js";
3
+ export type ErrorResource = ResourcePointer & { projection: ProjectionSchema };
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ResourcePointer, Goal as ValueSchema } from "../types.js";
3
- export type GoalResource = ResourcePointer & { value: ValueSchema };
2
+ import type { ResourcePointer, Goal as ProjectionSchema } from "../types.js";
3
+ export type GoalResource = ResourcePointer & { projection: ProjectionSchema };
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ResourcePointer, Natural as ValueSchema } from "../types.js";
3
- export type NaturalResource = ResourcePointer & { value: ValueSchema };
2
+ import type { ResourcePointer, Natural as ProjectionSchema } from "../types.js";
3
+ export type NaturalResource = ResourcePointer & { projection: ProjectionSchema };
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ResourcePointer, Resource as ValueSchema } from "../types.js";
3
- export type ResourceResource = ResourcePointer & { value: ValueSchema };
2
+ import type { ResourcePointer, Resource as ProjectionSchema } from "../types.js";
3
+ export type ResourceResource = ResourcePointer & { projection: ProjectionSchema };
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ResourcePointer, ResourceType as ValueSchema } from "../types.js";
3
- export type ResourceTypeResource = ResourcePointer & { value: ValueSchema };
2
+ import type { ResourcePointer, ResourceType as ProjectionSchema } from "../types.js";
3
+ export type ResourceTypeResource = ResourcePointer & { projection: ProjectionSchema };
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ResourcePointer, Strategy as ValueSchema } from "../types.js";
3
- export type StrategyResource = ResourcePointer & { value: ValueSchema };
2
+ import type { ResourcePointer, Strategy as ProjectionSchema } from "../types.js";
3
+ export type StrategyResource = ResourcePointer & { projection: ProjectionSchema };
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ResourcePointer, StrategyTrace as ValueSchema } from "../types.js";
3
- export type StrategyTraceResource = ResourcePointer & { value: ValueSchema };
2
+ import type { ResourcePointer, StrategyTrace as ProjectionSchema } from "../types.js";
3
+ export type StrategyTraceResource = ResourcePointer & { projection: ProjectionSchema };
@@ -0,0 +1,3 @@
1
+ // Auto-generated strict composite type. Do not edit.
2
+ import type { ResourcePointer, Suite as ProjectionSchema } from "../types.js";
3
+ export type SuiteResource = ResourcePointer & { projection: ProjectionSchema };
@@ -0,0 +1 @@
1
+ export {}
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ResourcePointer, Tool as ValueSchema } from "../types.js";
3
- export type ToolResource = ResourcePointer & { value: ValueSchema };
2
+ import type { ResourcePointer, Tool as ProjectionSchema } from "../types.js";
3
+ export type ToolResource = ResourcePointer & { projection: ProjectionSchema };
@@ -23,9 +23,9 @@ export type DocumentationSpec =
23
23
  } & DescriptionFacet;
24
24
  /**
25
25
  * This interface was referenced by `Genesis`'s JSON-Schema
26
- * via the `definition` "TypeRef".
26
+ * via the `definition` "AtomicTypeRef".
27
27
  */
28
- export type TypeRef =
28
+ export type AtomicTypeRef =
29
29
  | {
30
30
  resourceTypeHandle: ResourceTypeHandle;
31
31
  }
@@ -40,6 +40,18 @@ export type TypeRef =
40
40
  */
41
41
  export type ResourceTypeHandle =
42
42
  `TYPE-${string}`;
43
+ /**
44
+ * This interface was referenced by `Genesis`'s JSON-Schema
45
+ * via the `definition` "TypeRef".
46
+ */
47
+ export type TypeRef =
48
+ | AtomicTypeRef
49
+ | {
50
+ /**
51
+ * @minItems 2
52
+ */
53
+ oneOfTypeRefs: [AtomicTypeRef, AtomicTypeRef, ...AtomicTypeRef[]];
54
+ };
43
55
  /**
44
56
  * This interface was referenced by `Genesis`'s JSON-Schema
45
57
  * via the `definition` "ToolHandle".
@@ -54,7 +66,6 @@ export type ResourcePointer =
54
66
  {
55
67
  id: ResourceId;
56
68
  resourceTypeHandle: ResourceTypeHandle;
57
- version: 1;
58
69
  } & ProvenanceFacet;
59
70
  /**
60
71
  * This interface was referenced by `Genesis`'s JSON-Schema
@@ -99,8 +110,9 @@ export type ThreadedToolStepPath =
99
110
  export type ResourceType =
100
111
  {
101
112
  handle: ResourceTypeHandle;
102
- valueSchema?: JsonSchemaObject;
103
- parserToolHandle?: ToolHandle;
113
+ projectionSchema?: JsonSchemaObject;
114
+ ingestorToolHandle?: ToolHandle;
115
+ ingestorToolInputSchema?: JsonSchemaObject;
104
116
  /**
105
117
  * @minItems 1
106
118
  */
@@ -138,12 +150,6 @@ export type RoleValue =
138
150
  */
139
151
  export type RoleNameArray =
140
152
  string[];
141
- /**
142
- * This interface was referenced by `Genesis`'s JSON-Schema
143
- * via the `definition` "ToolKind".
144
- */
145
- export type ToolKind =
146
- "runtime" | "buildtime";
147
153
  /**
148
154
  * This interface was referenced by `Genesis`'s JSON-Schema
149
155
  * via the `definition` "Tool".
@@ -151,8 +157,8 @@ export type ToolKind =
151
157
  export type Tool =
152
158
  {
153
159
  handle: ToolHandle;
154
- isTemplate: boolean;
155
160
  templateToolHandle?: ToolHandle;
161
+ isTemplate: boolean;
156
162
  instantiationRoleSpec?: RoleSpec;
157
163
  } & DocumentationSpec & {
158
164
  } & RoleSpecFacet;
@@ -220,7 +226,7 @@ export type ProvenanceKind =
220
226
  */
221
227
  export type BaseResource =
222
228
  {
223
- value: unknown;
229
+ projection: unknown;
224
230
  } & ResourcePointer;
225
231
  /**
226
232
  * This interface was referenced by `Genesis`'s JSON-Schema
@@ -228,7 +234,7 @@ export type BaseResource =
228
234
  */
229
235
  export type Resource =
230
236
  {
231
- value: unknown;
237
+ projection: unknown;
232
238
  } & ResourcePointer;
233
239
  /**
234
240
  * This interface was referenced by `Genesis`'s JSON-Schema
@@ -428,6 +434,34 @@ export type TimestampedResource =
428
434
  {
429
435
  timestamp: string;
430
436
  } & Resource;
437
+ /**
438
+ * This interface was referenced by `Genesis`'s JSON-Schema
439
+ * via the `definition` "Suite".
440
+ */
441
+ export type Suite =
442
+ {
443
+ } & {
444
+ name: Name;
445
+ version: string;
446
+ description: Description;
447
+ } & {
448
+ resourceTypes: ResourceType[];
449
+ tools: Tool[];
450
+ };
451
+ /**
452
+ * This interface was referenced by `Genesis`'s JSON-Schema
453
+ * via the `definition` "SuiteIngestorInputSchema".
454
+ */
455
+ export type SuiteIngestorInputSchema =
456
+ {
457
+ } & {
458
+ name: Name | JsonScalarLink;
459
+ version: string | JsonScalarLink;
460
+ description: Description | JsonScalarLink;
461
+ } & {
462
+ resourceTypesPath: string;
463
+ toolsPath: string;
464
+ };
431
465
 
432
466
  /**
433
467
  * This interface was referenced by `Genesis`'s JSON-Schema
@@ -698,4 +732,13 @@ export interface Goal {
698
732
  minSteps?: number;
699
733
  maxSteps?: number;
700
734
  }
735
+ /**
736
+ * This interface was referenced by `Genesis`'s JSON-Schema
737
+ * via the `definition` "JsonScalarLink".
738
+ */
739
+ export interface JsonScalarLink {
740
+ kind: "json-pointer";
741
+ filePath: string;
742
+ pointer: string;
743
+ }
701
744
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@toolproof-core/genesis",
3
- "version": "1.0.48",
4
- "description": "JSON schemas and TypeScript types for ToolProof",
3
+ "version": "1.0.50",
4
+ "description": "Core ToolProof ontology, schemas, declarations, implementations, and generated type artifacts.",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
7
7
  "exports": {
@@ -11,6 +11,7 @@
11
11
  }
12
12
  },
13
13
  "files": [
14
+ "toolproof.json",
14
15
  "dist/src",
15
16
  "src",
16
17
  "generated-src"
@@ -19,20 +20,13 @@
19
20
  "keywords": [],
20
21
  "author": "",
21
22
  "license": "ISC",
23
+ "packageManager": "pnpm@10.15.0",
22
24
  "publishConfig": {
23
25
  "access": "public"
24
26
  },
25
- "dependencies": {
26
- "zod": "^4.3.6"
27
- },
28
- "devDependencies": {
29
- "@types/node": "^20.8.1",
30
- "json-schema-to-typescript": "^15.0.4",
31
- "rimraf": "^5.0.0",
32
- "typescript": "^5.9.3"
33
- },
34
27
  "scripts": {
35
28
  "test": "echo \"Error: no test specified\" && exit 1",
29
+ "prepack": "pnpm run update && pnpm run build",
36
30
  "build": "tsc -b",
37
31
  "build:scripts": "tsc -p tsconfig.scripts.json",
38
32
  "normalizeAnchorsToPointers": "node ./dist/scripts/normalizeAnchorsToPointers.js",
@@ -41,12 +35,23 @@
41
35
  "generateTerminals": "node ./dist/scripts/generateTerminals.js",
42
36
  "generateCoreProjection": "node ./dist/scripts/generateCoreProjection.js",
43
37
  "generateResourceTypes": "node ./dist/scripts/generateResourceTypes.js",
44
- "generateResources": "node ./dist/scripts/generateResources.js",
38
+ "generateDeclarations": "node ./dist/scripts/generateDeclarations.js",
39
+ "generateImplementations": "node ./dist/scripts/generateImplementations.js",
40
+ "generateTimestampedResources": "node ./dist/scripts/generateTimestampedResources.js",
45
41
  "generateSchemaShims": "node ./dist/scripts/generateSchemaShims.js",
46
42
  "generateStandaloneSchemas": "node ./dist/scripts/generateStandaloneSchemas.js",
47
43
  "generateStandaloneZodSchemas": "node ./dist/scripts/generateStandaloneZodSchemas.js",
48
44
  "generateTypes": "node ./dist/scripts/generateTypes.js",
49
45
  "generateStandaloneTypes": "node ./dist/scripts/generateStandaloneTypes.js",
50
- "update": "rimraf dist generated-src tsconfig.tsbuildinfo && pnpm run build:scripts && pnpm run normalizeAnchorsToPointers && pnpm run generateConstantsAndMappings && pnpm run generateStandaloneSchemas && pnpm run generateStandaloneZodSchemas && pnpm run generateResourceTypes && pnpm run generateResources && pnpm run generateSchemaShims && pnpm run generateTypes && pnpm run generateStandaloneTypes && pnpm run generateDependencies && pnpm run generateTerminals && pnpm run generateCoreProjection"
46
+ "update": "rimraf dist generated-src tsconfig.tsbuildinfo && pnpm run build:scripts && pnpm run normalizeAnchorsToPointers && pnpm run generateConstantsAndMappings && pnpm run generateStandaloneSchemas && pnpm run generateStandaloneZodSchemas && pnpm run generateDeclarations && pnpm run generateTimestampedResources && pnpm run generateSchemaShims && pnpm run generateTypes && pnpm run generateImplementations && pnpm run generateStandaloneTypes && pnpm run generateDependencies && pnpm run generateTerminals && pnpm run generateCoreProjection"
47
+ },
48
+ "dependencies": {
49
+ "zod": "^4.3.6"
50
+ },
51
+ "devDependencies": {
52
+ "@types/node": "^20.8.1",
53
+ "json-schema-to-typescript": "^15.0.4",
54
+ "rimraf": "^5.0.0",
55
+ "typescript": "^5.9.3"
51
56
  }
52
57
  }
@@ -0,0 +1,4 @@
1
+ [
2
+ false,
3
+ true
4
+ ]
@@ -0,0 +1,13 @@
1
+ [
2
+ 0,
3
+ 1,
4
+ 2,
5
+ 3,
6
+ 4,
7
+ 5,
8
+ 6,
9
+ 7,
10
+ 8,
11
+ 9,
12
+ 100
13
+ ]
@@ -1,47 +1,53 @@
1
- {
2
- "ResourceType": {
3
- "handle": "TYPE-RESOURCE-TYPE",
4
- "name": "ResourceType",
5
- "description": ""
6
- },
7
- "Tool": {
8
- "handle": "TYPE-TOOL",
9
- "name": "Tool",
10
- "description": ""
11
- },
12
- "Strategy": {
13
- "handle": "TYPE-STRATEGY",
14
- "name": "Strategy",
15
- "description": ""
16
- },
17
- "StrategyTrace": {
18
- "handle": "TYPE-STRATEGY_TRACE",
19
- "name": "StrategyTrace",
20
- "description": ""
21
- },
22
- "Goal": {
23
- "handle": "TYPE-GOAL",
24
- "name": "Goal",
25
- "description": ""
26
- },
27
- "Error": {
28
- "handle": "TYPE-ERROR",
29
- "name": "Error",
30
- "description": ""
31
- },
32
- "Boolean": {
33
- "handle": "TYPE-BOOLEAN",
34
- "name": "Boolean",
35
- "description": ""
36
- },
37
- "Natural": {
38
- "handle": "TYPE-NATURAL",
39
- "name": "Natural",
40
- "description": ""
41
- },
42
- "Resource": {
43
- "handle": "TYPE-RESOURCE",
44
- "name": "Resource",
45
- "description": ""
46
- }
1
+ {
2
+ "ResourceType": {
3
+ "handle": "TYPE-ResourceType",
4
+ "name": "ResourceType",
5
+ "description": ""
6
+ },
7
+ "Tool": {
8
+ "handle": "TYPE-Tool",
9
+ "name": "Tool",
10
+ "description": ""
11
+ },
12
+ "Strategy": {
13
+ "handle": "TYPE-Strategy",
14
+ "name": "Strategy",
15
+ "description": ""
16
+ },
17
+ "StrategyTrace": {
18
+ "handle": "TYPE-StrategyTrace",
19
+ "name": "StrategyTrace",
20
+ "description": ""
21
+ },
22
+ "Goal": {
23
+ "handle": "TYPE-Goal",
24
+ "name": "Goal",
25
+ "description": ""
26
+ },
27
+ "Error": {
28
+ "handle": "TYPE-Error",
29
+ "name": "Error",
30
+ "description": ""
31
+ },
32
+ "Boolean": {
33
+ "handle": "TYPE-Boolean",
34
+ "name": "Boolean",
35
+ "description": ""
36
+ },
37
+ "Natural": {
38
+ "handle": "TYPE-Natural",
39
+ "name": "Natural",
40
+ "description": ""
41
+ },
42
+ "Resource": {
43
+ "handle": "TYPE-Resource",
44
+ "name": "Resource",
45
+ "description": ""
46
+ },
47
+ "Suite": {
48
+ "handle": "TYPE-Suite",
49
+ "name": "Suite",
50
+ "description": "",
51
+ "ingestorToolInputSchema": "SuiteIngestorInputSchema"
52
+ }
47
53
  }