@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
@@ -9,17 +9,17 @@
9
9
  "handle": {
10
10
  "$ref": "#/$defs/ToolHandle"
11
11
  },
12
- "isTemplate": {
13
- "type": "boolean"
14
- },
15
12
  "templateToolHandle": {
16
13
  "$ref": "#/$defs/ToolHandle"
17
14
  },
15
+ "isTemplate": {
16
+ "type": "boolean"
17
+ },
18
18
  "instantiationRoleSpec": {
19
19
  "$ref": "#/$defs/RoleSpec"
20
20
  }
21
21
  },
22
- "$comment": "Template Tools own dispatch contract: Core scans all instantiation Tools grouped by templateToolHandle, derives a specializationKey from each tool's generic role assignment (canonical order of genericRoleName -> 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 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.",
22
+ "$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.",
23
23
  "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.",
24
24
  "allOf": [
25
25
  {
@@ -50,7 +50,7 @@
50
50
  }
51
51
  },
52
52
  {
53
- "$comment": "Template Tools must declare named roles: two map inputs (GenericAssignmentByRoleName and InstantiationToolHandleBySpecializationKey) and one scalar TYPE-Tool output (InstantiationTool). Runtime semantic validation enforces that invocation input keys for GenericAssignmentByRoleName exactly match this role's declared mapKeys.",
53
+ "$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.",
54
54
  "if": {
55
55
  "required": [
56
56
  "isTemplate"
@@ -289,7 +289,7 @@
289
289
  },
290
290
  "RoleValue": {
291
291
  "$schema": "https://json-schema.org/draft/2020-12/schema",
292
- "$comment": "Pairs a type reference (typeRef) with a container shape. typeRef is either resource-backed (resourceTypeHandle) or schema-backed (roleSchema).",
292
+ "$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.",
293
293
  "type": "object",
294
294
  "required": [
295
295
  "typeRef",
@@ -443,8 +443,49 @@
443
443
  "semanticValidation": "Ajv custom keyword to verify description."
444
444
  },
445
445
  "TypeRef": {
446
+ "$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.",
447
+ "oneOf": [
448
+ {
449
+ "$ref": "#/$defs/AtomicTypeRef"
450
+ },
451
+ {
452
+ "type": "object",
453
+ "required": [
454
+ "oneOfTypeRefs"
455
+ ],
456
+ "properties": {
457
+ "oneOfTypeRefs": {
458
+ "type": "array",
459
+ "items": {
460
+ "$ref": "#/$defs/AtomicTypeRef"
461
+ },
462
+ "minItems": 2,
463
+ "uniqueItems": true
464
+ }
465
+ },
466
+ "additionalProperties": false
467
+ }
468
+ ]
469
+ },
470
+ "ContainerKind": {
446
471
  "$schema": "https://json-schema.org/draft/2020-12/schema",
447
- "$comment": "A 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 branch must be present.",
472
+ "type": "string",
473
+ "enum": [
474
+ "scalar",
475
+ "array",
476
+ "map"
477
+ ]
478
+ },
479
+ "RoleNameArray": {
480
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
481
+ "type": "array",
482
+ "items": {
483
+ "$ref": "#/$defs/RoleName"
484
+ }
485
+ },
486
+ "AtomicTypeRef": {
487
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
488
+ "$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.",
448
489
  "oneOf": [
449
490
  {
450
491
  "type": "object",
@@ -483,22 +524,6 @@
483
524
  }
484
525
  ]
485
526
  },
486
- "ContainerKind": {
487
- "$schema": "https://json-schema.org/draft/2020-12/schema",
488
- "type": "string",
489
- "enum": [
490
- "scalar",
491
- "array",
492
- "map"
493
- ]
494
- },
495
- "RoleNameArray": {
496
- "$schema": "https://json-schema.org/draft/2020-12/schema",
497
- "type": "array",
498
- "items": {
499
- "$ref": "#/$defs/RoleName"
500
- }
501
- },
502
527
  "ResourceTypeHandle": {
503
528
  "$schema": "https://json-schema.org/draft/2020-12/schema",
504
529
  "type": "string",
@@ -2,14 +2,14 @@
2
2
  import { z } from 'zod/v4';
3
3
 
4
4
 
5
- const BaseResourceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "value": z.any(), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "version": z.literal(1), "provenance": ProvenanceSchema }).strict());
5
+ const BaseResourceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "projection": z.any(), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "provenance": ProvenanceSchema }).strict());
6
6
  const GenesisProvenanceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "provenanceKind": z.literal("genesis") }).strict());
7
7
  const NameSchema: z.ZodTypeAny = z.lazy(() => z.string().min(1).regex(new RegExp("^[A-Z][a-zA-Z0-9]*$")));
8
8
  const OutputAddressSchema: z.ZodTypeAny = z.lazy(() => z.object({ "roleName": RoleNameSchema, "toolStepPath": ToolStepPathSchema }).strict());
9
9
  const ProvenanceSchema: z.ZodTypeAny = z.lazy(() => z.union([GenesisProvenanceSchema, StrategyProvenanceSchema]));
10
10
  const ProvenanceFacetSchema: z.ZodTypeAny = z.lazy(() => z.object({ "provenance": ProvenanceSchema }));
11
11
  const ResourceIdSchema: z.ZodTypeAny = z.lazy(() => z.string().regex(new RegExp("^RESOURCE-.+$")));
12
- const ResourcePointerSchema: z.ZodTypeAny = z.lazy(() => z.object({ "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "version": z.literal(1), "provenance": ProvenanceSchema }).strict());
12
+ const ResourcePointerSchema: z.ZodTypeAny = z.lazy(() => z.object({ "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "provenance": ProvenanceSchema }).strict());
13
13
  const ResourceTypeHandleSchema: z.ZodTypeAny = z.lazy(() => z.string().regex(new RegExp("^TYPE-.+$")));
14
14
  const RoleNameSchema: z.ZodTypeAny = z.lazy(() => NameSchema);
15
15
  const StrategyProvenanceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "provenanceKind": z.literal("strategy"), "strategyTraceHandle": StrategyTraceHandleSchema, "outputAddress": OutputAddressSchema }).strict());
@@ -11,4 +11,4 @@ const NameFacetSchema: z.ZodTypeAny = z.lazy(() => z.object({ "name": NameSchema
11
11
  const ResourceTypeHandleSchema: z.ZodTypeAny = z.lazy(() => z.string().regex(new RegExp("^TYPE-.+$")));
12
12
  const ToolHandleSchema: z.ZodTypeAny = z.lazy(() => z.string().regex(new RegExp("^TOOL-.+$")));
13
13
 
14
- export const ResourceTypeSchema: z.ZodTypeAny = z.lazy(() => z.intersection(z.intersection(z.object({ "handle": ResourceTypeHandleSchema, "valueSchema": JsonSchemaObjectSchema.optional(), "parserToolHandle": ToolHandleSchema.optional(), "embeddingModelTools": z.array(ToolHandleSchema).min(1).optional() }).strict(), DocumentationSpecSchema), z.union([z.object({ }), z.object({ })])));
14
+ export const ResourceTypeSchema: z.ZodTypeAny = z.lazy(() => z.intersection(z.intersection(z.intersection(z.object({ "handle": ResourceTypeHandleSchema, "projectionSchema": JsonSchemaObjectSchema.optional(), "ingestorToolHandle": ToolHandleSchema.optional(), "ingestorToolInputSchema": JsonSchemaObjectSchema.optional(), "embeddingModelTools": z.array(ToolHandleSchema).min(1).optional() }).strict(), DocumentationSpecSchema), z.union([z.object({ }), z.object({ })])), z.any()));
@@ -17,7 +17,7 @@ export const StrategyZodGenerationWarnings = [
17
17
  }
18
18
  ] as const;
19
19
 
20
- const BaseResourceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "value": z.any(), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "version": z.literal(1), "provenance": ProvenanceSchema }).strict());
20
+ const BaseResourceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "projection": z.any(), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "provenance": ProvenanceSchema }).strict());
21
21
  const BaseStrategySchema: z.ZodTypeAny = z.lazy(() => z.object({ "handle": StrategyHandleSchema, "strategyKind": StrategyKindSchema }));
22
22
  const BranchStepSchema: z.ZodTypeAny = z.lazy(() => z.object({ "stepKind": z.intersection(z.literal("branch"), StepKindSchema), "cases": z.array(CaseSchema).min(1) }));
23
23
  const CaseSchema: z.ZodTypeAny = z.lazy(() => z.object({ "when": ToolStepSchema, "what": ToolStepSchema }).strict());
@@ -26,14 +26,14 @@ const ExternalInputPotentialSchema: z.ZodTypeAny = z.lazy(() => z.object({ "stra
26
26
  const ForStepSchema: z.ZodTypeAny = z.lazy(() => z.object({ "stepKind": z.intersection(z.literal("for"), StepKindSchema), "case": CaseSchema }));
27
27
  const GenesisProvenanceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "provenanceKind": z.literal("genesis") }).strict());
28
28
  const InputPotentialSchema: z.ZodTypeAny = z.lazy(() => z.union([ExternalInputPotentialSchema, InternalInputPotentialSchema]));
29
- const InputResourceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "strategyStateInputKind": z.literal("inputResource"), "value": z.any(), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "version": z.literal(1), "provenance": ProvenanceSchema }).strict());
29
+ const InputResourceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "strategyStateInputKind": z.literal("inputResource"), "projection": z.any(), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "provenance": ProvenanceSchema }).strict());
30
30
  const InternalInputPotentialSchema: z.ZodTypeAny = z.lazy(() => z.object({ "strategyStateInputKind": z.literal("internalInputPotential"), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "provenance": DeferredStrategyProvenanceSchema }).strict());
31
31
  const NameSchema: z.ZodTypeAny = z.lazy(() => z.string().min(1).regex(new RegExp("^[A-Z][a-zA-Z0-9]*$")));
32
32
  const OutputAddressSchema: z.ZodTypeAny = z.lazy(() => z.object({ "roleName": RoleNameSchema, "toolStepPath": ToolStepPathSchema }).strict());
33
33
  const ProvenanceSchema: z.ZodTypeAny = z.lazy(() => z.union([GenesisProvenanceSchema, StrategyProvenanceSchema]));
34
34
  const ProvenanceFacetSchema: z.ZodTypeAny = z.lazy(() => z.object({ "provenance": ProvenanceSchema }));
35
35
  const ResourceIdSchema: z.ZodTypeAny = z.lazy(() => z.string().regex(new RegExp("^RESOURCE-.+$")));
36
- const ResourcePointerSchema: z.ZodTypeAny = z.lazy(() => z.object({ "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "version": z.literal(1), "provenance": ProvenanceSchema }).strict());
36
+ const ResourcePointerSchema: z.ZodTypeAny = z.lazy(() => z.object({ "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "provenance": ProvenanceSchema }).strict());
37
37
  const ResourceTypeHandleSchema: z.ZodTypeAny = z.lazy(() => z.string().regex(new RegExp("^TYPE-.+$")));
38
38
  const RoleBindingSpecSchema: z.ZodTypeAny = z.lazy(() => z.object({ "inputBindings": RoleNameArraySchema, "outputBindings": RoleNameArraySchema }).strict());
39
39
  const RoleBindingSpecFacetSchema: z.ZodTypeAny = z.lazy(() => z.object({ "roleBindingSpec": RoleBindingSpecSchema }));
@@ -17,7 +17,7 @@ export const StrategyTraceZodGenerationWarnings = [
17
17
  }
18
18
  ] as const;
19
19
 
20
- const BaseResourceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "value": z.any(), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "version": z.literal(1), "provenance": ProvenanceSchema }).strict());
20
+ const BaseResourceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "projection": z.any(), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "provenance": ProvenanceSchema }).strict());
21
21
  const BaseStrategySchema: z.ZodTypeAny = z.lazy(() => z.object({ "handle": StrategyHandleSchema, "strategyKind": StrategyKindSchema }));
22
22
  const BaseTracePointSchema: z.ZodTypeAny = z.lazy(() => z.object({ "tracePointKind": TracePointKindSchema, "strategyHandle": StrategyHandleSchema, "threadIndex": NaturalSchema, "tracePointIndex": NaturalSchema }));
23
23
  const BranchStepSchema: z.ZodTypeAny = z.lazy(() => z.object({ "stepKind": z.intersection(z.literal("branch"), StepKindSchema), "cases": z.array(CaseSchema).min(1) }));
@@ -29,7 +29,7 @@ const GenesisProvenanceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "provenanc
29
29
  const GraphEndTracePointSchema: z.ZodTypeAny = z.lazy(() => z.object({ "tracePointKind": z.intersection(TracePointKindSchema, z.literal("graph_end")), "strategyHandle": StrategyHandleSchema, "threadIndex": NaturalSchema, "tracePointIndex": NaturalSchema }));
30
30
  const GraphStartTracePointSchema: z.ZodTypeAny = z.lazy(() => z.object({ "tracePointKind": z.intersection(TracePointKindSchema, z.literal("graph_start")), "strategyHandle": StrategyHandleSchema, "threadIndex": NaturalSchema, "tracePointIndex": NaturalSchema, "threadedStrategy": ThreadedStrategySchema }));
31
31
  const InputPotentialSchema: z.ZodTypeAny = z.lazy(() => z.union([ExternalInputPotentialSchema, InternalInputPotentialSchema]));
32
- const InputResourceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "strategyStateInputKind": z.literal("inputResource"), "value": z.any(), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "version": z.literal(1), "provenance": ProvenanceSchema }).strict());
32
+ const InputResourceSchema: z.ZodTypeAny = z.lazy(() => z.object({ "strategyStateInputKind": z.literal("inputResource"), "projection": z.any(), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "provenance": ProvenanceSchema }).strict());
33
33
  const InternalInputPotentialSchema: z.ZodTypeAny = z.lazy(() => z.object({ "strategyStateInputKind": z.literal("internalInputPotential"), "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "provenance": DeferredStrategyProvenanceSchema }).strict());
34
34
  const InterruptTracePointSchema: z.ZodTypeAny = z.lazy(() => z.object({ "tracePointKind": z.intersection(TracePointKindSchema, z.literal("interrupt")), "strategyHandle": StrategyHandleSchema, "threadIndex": NaturalSchema, "tracePointIndex": NaturalSchema, "counterSnapshot": TracePointCounterSnapshotSchema, "toolStepPath": ThreadedToolStepPathSchema, "delta": z.object({ "stepsMutation": z.object({ "insertAt": NaturalSchema, "insertedSteps": StepArraySchema }).optional(), "strategyStateDelta": ThreadedStrategyStateSchema.optional(), "interruptData": z.intersection(z.union([z.object({ }), z.null()]), z.object({ })) }) }));
35
35
  const NameSchema: z.ZodTypeAny = z.lazy(() => z.string().min(1).regex(new RegExp("^[A-Z][a-zA-Z0-9]*$")));
@@ -38,7 +38,7 @@ const OutputAddressSchema: z.ZodTypeAny = z.lazy(() => z.object({ "roleName": Ro
38
38
  const ProvenanceSchema: z.ZodTypeAny = z.lazy(() => z.union([GenesisProvenanceSchema, StrategyProvenanceSchema]));
39
39
  const ProvenanceFacetSchema: z.ZodTypeAny = z.lazy(() => z.object({ "provenance": ProvenanceSchema }));
40
40
  const ResourceIdSchema: z.ZodTypeAny = z.lazy(() => z.string().regex(new RegExp("^RESOURCE-.+$")));
41
- const ResourcePointerSchema: z.ZodTypeAny = z.lazy(() => z.object({ "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "version": z.literal(1), "provenance": ProvenanceSchema }).strict());
41
+ const ResourcePointerSchema: z.ZodTypeAny = z.lazy(() => z.object({ "id": ResourceIdSchema, "resourceTypeHandle": ResourceTypeHandleSchema, "provenance": ProvenanceSchema }).strict());
42
42
  const ResourceTypeHandleSchema: z.ZodTypeAny = z.lazy(() => z.string().regex(new RegExp("^TYPE-.+$")));
43
43
  const RoleBindingSpecSchema: z.ZodTypeAny = z.lazy(() => z.object({ "inputBindings": RoleNameArraySchema, "outputBindings": RoleNameArraySchema }).strict());
44
44
  const RoleBindingSpecFacetSchema: z.ZodTypeAny = z.lazy(() => z.object({ "roleBindingSpec": RoleBindingSpecSchema }));
@@ -0,0 +1,44 @@
1
+ // Auto-generated from standalone schema 'Suite'. Do not edit.
2
+ import { z } from 'zod/v4';
3
+
4
+
5
+ export const SuiteZodGenerationWarnings = [
6
+ {
7
+ "path": "$defs.RoleValueByName.propertyNames",
8
+ "message": "Unsupported propertyNames $ref target; keys will not be validated."
9
+ },
10
+ {
11
+ "path": "$defs.TypeRef.oneOf[1].properties.oneOfTypeRefs.uniqueItems",
12
+ "message": "uniqueItems not enforced by generated Zod."
13
+ },
14
+ {
15
+ "path": "Suite.allOfMerged.properties.resourceTypes.uniqueItems",
16
+ "message": "uniqueItems not enforced by generated Zod."
17
+ },
18
+ {
19
+ "path": "Suite.allOfMerged.properties.tools.uniqueItems",
20
+ "message": "uniqueItems not enforced by generated Zod."
21
+ }
22
+ ] as const;
23
+
24
+ const AtomicTypeRefSchema: z.ZodTypeAny = z.lazy(() => z.union([z.object({ "resourceTypeHandle": ResourceTypeHandleSchema }).strict(), z.object({ "roleSchema": z.object({ "$ref": z.string().regex(new RegExp("^#[A-Z][a-zA-Z0-9]*$")) }).strict() }).strict()]));
25
+ const ContainerKindSchema: z.ZodTypeAny = z.lazy(() => z.union([z.literal("scalar"), z.literal("array"), z.literal("map")]));
26
+ const DescriptionSchema: z.ZodTypeAny = z.lazy(() => z.string().min(1));
27
+ const DescriptionFacetSchema: z.ZodTypeAny = z.lazy(() => z.object({ "description": DescriptionSchema }));
28
+ const DocumentationSpecSchema: z.ZodTypeAny = z.lazy(() => z.object({ "name": NameSchema, "symbol": z.string().optional(), "description": DescriptionSchema }));
29
+ const JsonSchemaObjectSchema: z.ZodTypeAny = z.lazy(() => z.object({ "$schema": z.literal("https://json-schema.org/draft/2020-12/schema") }).passthrough());
30
+ const NameSchema: z.ZodTypeAny = z.lazy(() => z.string().min(1).regex(new RegExp("^[A-Z][a-zA-Z0-9]*$")));
31
+ const NameFacetSchema: z.ZodTypeAny = z.lazy(() => z.object({ "name": NameSchema }));
32
+ const ResourceTypeSchema: z.ZodTypeAny = z.lazy(() => z.intersection(z.intersection(z.intersection(z.object({ "handle": ResourceTypeHandleSchema, "projectionSchema": JsonSchemaObjectSchema.optional(), "ingestorToolHandle": ToolHandleSchema.optional(), "ingestorToolInputSchema": JsonSchemaObjectSchema.optional(), "embeddingModelTools": z.array(ToolHandleSchema).min(1).optional() }).strict(), DocumentationSpecSchema), z.union([z.object({ }), z.object({ })])), z.any()));
33
+ const ResourceTypeHandleSchema: z.ZodTypeAny = z.lazy(() => z.string().regex(new RegExp("^TYPE-.+$")));
34
+ const RoleNameSchema: z.ZodTypeAny = z.lazy(() => NameSchema);
35
+ const RoleNameArraySchema: z.ZodTypeAny = z.lazy(() => z.array(RoleNameSchema));
36
+ const RoleSpecSchema: z.ZodTypeAny = z.lazy(() => z.object({ "inputRoleValueByName": RoleValueByNameSchema, "outputRoleValueByName": RoleValueByNameSchema, "refinementSchema": JsonSchemaObjectSchema.optional() }).strict());
37
+ const RoleSpecFacetSchema: z.ZodTypeAny = z.lazy(() => z.object({ "roleSpec": RoleSpecSchema }));
38
+ const RoleValueSchema: z.ZodTypeAny = z.lazy(() => z.intersection(z.intersection(z.intersection(z.intersection(z.object({ "typeRef": TypeRefSchema, "refinementSchema": JsonSchemaObjectSchema.optional(), "containerKind": ContainerKindSchema, "containerSchema": JsonSchemaObjectSchema.optional(), "mapKeys": RoleNameArraySchema.optional() }).strict(), z.any()), z.any()), z.any()), z.any()));
39
+ const RoleValueByNameSchema: z.ZodTypeAny = z.lazy(() => z.record(z.string(), RoleValueSchema));
40
+ const ToolSchema: z.ZodTypeAny = z.lazy(() => z.intersection(z.intersection(z.intersection(z.intersection(z.object({ "handle": ToolHandleSchema, "templateToolHandle": ToolHandleSchema.optional(), "isTemplate": z.boolean(), "instantiationRoleSpec": RoleSpecSchema.optional() }).strict(), DocumentationSpecSchema), z.any()), z.any()), RoleSpecFacetSchema));
41
+ const ToolHandleSchema: z.ZodTypeAny = z.lazy(() => z.string().regex(new RegExp("^TOOL-.+$")));
42
+ const TypeRefSchema: z.ZodTypeAny = z.lazy(() => z.union([AtomicTypeRefSchema, z.object({ "oneOfTypeRefs": z.array(AtomicTypeRefSchema).min(2) }).strict()]));
43
+
44
+ export const SuiteSchema: z.ZodTypeAny = z.lazy(() => z.object({ "name": NameSchema, "version": z.string().min(1), "description": DescriptionSchema, "resourceTypes": z.array(ResourceTypeSchema), "tools": z.array(ToolSchema) }).strict());
@@ -6,9 +6,14 @@ export const ToolZodGenerationWarnings = [
6
6
  {
7
7
  "path": "$defs.RoleValueByName.propertyNames",
8
8
  "message": "Unsupported propertyNames $ref target; keys will not be validated."
9
+ },
10
+ {
11
+ "path": "$defs.TypeRef.oneOf[1].properties.oneOfTypeRefs.uniqueItems",
12
+ "message": "uniqueItems not enforced by generated Zod."
9
13
  }
10
14
  ] as const;
11
15
 
16
+ const AtomicTypeRefSchema: z.ZodTypeAny = z.lazy(() => z.union([z.object({ "resourceTypeHandle": ResourceTypeHandleSchema }).strict(), z.object({ "roleSchema": z.object({ "$ref": z.string().regex(new RegExp("^#[A-Z][a-zA-Z0-9]*$")) }).strict() }).strict()]));
12
17
  const ContainerKindSchema: z.ZodTypeAny = z.lazy(() => z.union([z.literal("scalar"), z.literal("array"), z.literal("map")]));
13
18
  const DescriptionSchema: z.ZodTypeAny = z.lazy(() => z.string().min(1));
14
19
  const DescriptionFacetSchema: z.ZodTypeAny = z.lazy(() => z.object({ "description": DescriptionSchema }));
@@ -24,6 +29,6 @@ const RoleSpecFacetSchema: z.ZodTypeAny = z.lazy(() => z.object({ "roleSpec": Ro
24
29
  const RoleValueSchema: z.ZodTypeAny = z.lazy(() => z.intersection(z.intersection(z.intersection(z.intersection(z.object({ "typeRef": TypeRefSchema, "refinementSchema": JsonSchemaObjectSchema.optional(), "containerKind": ContainerKindSchema, "containerSchema": JsonSchemaObjectSchema.optional(), "mapKeys": RoleNameArraySchema.optional() }).strict(), z.any()), z.any()), z.any()), z.any()));
25
30
  const RoleValueByNameSchema: z.ZodTypeAny = z.lazy(() => z.record(z.string(), RoleValueSchema));
26
31
  const ToolHandleSchema: z.ZodTypeAny = z.lazy(() => z.string().regex(new RegExp("^TOOL-.+$")));
27
- const TypeRefSchema: z.ZodTypeAny = z.lazy(() => z.union([z.object({ "resourceTypeHandle": ResourceTypeHandleSchema }).strict(), z.object({ "roleSchema": z.object({ "$ref": z.string().regex(new RegExp("^#[A-Z][a-zA-Z0-9]*$")) }).strict() }).strict()]));
32
+ const TypeRefSchema: z.ZodTypeAny = z.lazy(() => z.union([AtomicTypeRefSchema, z.object({ "oneOfTypeRefs": z.array(AtomicTypeRefSchema).min(2) }).strict()]));
28
33
 
29
- export const ToolSchema: z.ZodTypeAny = z.lazy(() => z.intersection(z.intersection(z.intersection(z.intersection(z.object({ "handle": ToolHandleSchema, "isTemplate": z.boolean(), "templateToolHandle": ToolHandleSchema.optional(), "instantiationRoleSpec": RoleSpecSchema.optional() }).strict(), DocumentationSpecSchema), z.any()), z.any()), RoleSpecFacetSchema));
34
+ export const ToolSchema: z.ZodTypeAny = z.lazy(() => z.intersection(z.intersection(z.intersection(z.intersection(z.object({ "handle": ToolHandleSchema, "templateToolHandle": ToolHandleSchema.optional(), "isTemplate": z.boolean(), "instantiationRoleSpec": RoleSpecSchema.optional() }).strict(), DocumentationSpecSchema), z.any()), z.any()), RoleSpecFacetSchema));
@@ -7,4 +7,5 @@ export { ResourceSchema } from './Resource.js';
7
7
  export { ResourceTypeSchema } from './ResourceType.js';
8
8
  export { StrategySchema } from './Strategy.js';
9
9
  export { StrategyTraceSchema } from './StrategyTrace.js';
10
+ export { SuiteSchema } from './Suite.js';
10
11
  export { ToolSchema } from './Tool.js';
@@ -1,24 +1,20 @@
1
- [
2
- {
3
- "id": "RESOURCE-False",
4
- "resourceTypeHandle": "TYPE-Boolean",
5
- "provenance": {
6
- "resourceProvenanceKind": "genesis"
7
- },
8
- "version": 1,
9
-
10
- "timestamp": "2025-11-30T00:00:00.000Z",
11
- "value": false
12
- },
13
- {
14
- "id": "RESOURCE-True",
15
- "resourceTypeHandle": "TYPE-Boolean",
16
- "provenance": {
17
- "resourceProvenanceKind": "genesis"
18
- },
19
- "version": 1,
20
-
21
- "timestamp": "2025-11-30T00:00:00.000Z",
22
- "value": true
23
- }
1
+ [
2
+ {
3
+ "id": "RESOURCE-BOOLEAN:False",
4
+ "resourceTypeHandle": "TYPE-Boolean",
5
+ "provenance": {
6
+ "resourceProvenanceKind": "genesis"
7
+ },
8
+ "timestamp": "2025-11-30T00:00:00.000Z",
9
+ "projection": false
10
+ },
11
+ {
12
+ "id": "RESOURCE-BOOLEAN:True",
13
+ "resourceTypeHandle": "TYPE-Boolean",
14
+ "provenance": {
15
+ "resourceProvenanceKind": "genesis"
16
+ },
17
+ "timestamp": "2025-11-30T00:00:00.000Z",
18
+ "projection": true
19
+ }
24
20
  ]
@@ -0,0 +1,2 @@
1
+ import timestampedResources from './booleans.json' with { type: 'json' };
2
+ export default timestampedResources;
@@ -1,112 +1,101 @@
1
- [
2
- {
3
- "id": "RESOURCE-0",
4
- "resourceTypeHandle": "TYPE-Natural",
5
- "provenance": {
6
- "resourceProvenanceKind": "genesis"
7
- },
8
- "version": 1,
9
- "timestamp": "2025-11-30T00:00:00.000Z",
10
- "value": 0
11
- },
12
- {
13
- "id": "RESOURCE-1",
14
- "resourceTypeHandle": "TYPE-Natural",
15
- "provenance": {
16
- "resourceProvenanceKind": "genesis"
17
- },
18
- "version": 1,
19
- "timestamp": "2025-11-30T00:00:00.000Z",
20
- "value": 1
21
- },
22
- {
23
- "id": "RESOURCE-2",
24
- "resourceTypeHandle": "TYPE-Natural",
25
- "provenance": {
26
- "resourceProvenanceKind": "genesis"
27
- },
28
- "version": 1,
29
- "timestamp": "2025-11-30T00:00:00.000Z",
30
- "value": 2
31
- },
32
- {
33
- "id": "RESOURCE-3",
34
- "resourceTypeHandle": "TYPE-Natural",
35
- "provenance": {
36
- "resourceProvenanceKind": "genesis"
37
- },
38
- "version": 1,
39
- "timestamp": "2025-11-30T00:00:00.000Z",
40
- "value": 3
41
- },
42
- {
43
- "id": "RESOURCE-4",
44
- "resourceTypeHandle": "TYPE-Natural",
45
- "provenance": {
46
- "resourceProvenanceKind": "genesis"
47
- },
48
- "version": 1,
49
- "timestamp": "2025-11-30T00:00:00.000Z",
50
- "value": 4
51
- },
52
- {
53
- "id": "RESOURCE-5",
54
- "resourceTypeHandle": "TYPE-Natural",
55
- "provenance": {
56
- "resourceProvenanceKind": "genesis"
57
- },
58
- "version": 1,
59
- "timestamp": "2025-11-30T00:00:00.000Z",
60
- "value": 5
61
- },
62
- {
63
- "id": "RESOURCE-6",
64
- "resourceTypeHandle": "TYPE-Natural",
65
- "provenance": {
66
- "resourceProvenanceKind": "genesis"
67
- },
68
- "version": 1,
69
- "timestamp": "2025-11-30T00:00:00.000Z",
70
- "value": 6
71
- },
72
- {
73
- "id": "RESOURCE-7",
74
- "resourceTypeHandle": "TYPE-Natural",
75
- "provenance": {
76
- "resourceProvenanceKind": "genesis"
77
- },
78
- "version": 1,
79
- "timestamp": "2025-11-30T00:00:00.000Z",
80
- "value": 7
81
- },
82
- {
83
- "id": "RESOURCE-8",
84
- "resourceTypeHandle": "TYPE-Natural",
85
- "provenance": {
86
- "resourceProvenanceKind": "genesis"
87
- },
88
- "version": 1,
89
- "timestamp": "2025-11-30T00:00:00.000Z",
90
- "value": 8
91
- },
92
- {
93
- "id": "RESOURCE-9",
94
- "resourceTypeHandle": "TYPE-Natural",
95
- "provenance": {
96
- "resourceProvenanceKind": "genesis"
97
- },
98
- "version": 1,
99
- "timestamp": "2025-11-30T00:00:00.000Z",
100
- "value": 9
101
- },
102
- {
103
- "id": "RESOURCE-100",
104
- "resourceTypeHandle": "TYPE-Natural",
105
- "provenance": {
106
- "resourceProvenanceKind": "genesis"
107
- },
108
- "version": 1,
109
- "timestamp": "2025-11-30T00:00:00.000Z",
110
- "value": 100
111
- }
1
+ [
2
+ {
3
+ "id": "RESOURCE-NATURAL:0",
4
+ "resourceTypeHandle": "TYPE-Natural",
5
+ "provenance": {
6
+ "resourceProvenanceKind": "genesis"
7
+ },
8
+ "timestamp": "2025-11-30T00:00:00.000Z",
9
+ "projection": 0
10
+ },
11
+ {
12
+ "id": "RESOURCE-NATURAL:1",
13
+ "resourceTypeHandle": "TYPE-Natural",
14
+ "provenance": {
15
+ "resourceProvenanceKind": "genesis"
16
+ },
17
+ "timestamp": "2025-11-30T00:00:00.000Z",
18
+ "projection": 1
19
+ },
20
+ {
21
+ "id": "RESOURCE-NATURAL:2",
22
+ "resourceTypeHandle": "TYPE-Natural",
23
+ "provenance": {
24
+ "resourceProvenanceKind": "genesis"
25
+ },
26
+ "timestamp": "2025-11-30T00:00:00.000Z",
27
+ "projection": 2
28
+ },
29
+ {
30
+ "id": "RESOURCE-NATURAL:3",
31
+ "resourceTypeHandle": "TYPE-Natural",
32
+ "provenance": {
33
+ "resourceProvenanceKind": "genesis"
34
+ },
35
+ "timestamp": "2025-11-30T00:00:00.000Z",
36
+ "projection": 3
37
+ },
38
+ {
39
+ "id": "RESOURCE-NATURAL:4",
40
+ "resourceTypeHandle": "TYPE-Natural",
41
+ "provenance": {
42
+ "resourceProvenanceKind": "genesis"
43
+ },
44
+ "timestamp": "2025-11-30T00:00:00.000Z",
45
+ "projection": 4
46
+ },
47
+ {
48
+ "id": "RESOURCE-NATURAL:5",
49
+ "resourceTypeHandle": "TYPE-Natural",
50
+ "provenance": {
51
+ "resourceProvenanceKind": "genesis"
52
+ },
53
+ "timestamp": "2025-11-30T00:00:00.000Z",
54
+ "projection": 5
55
+ },
56
+ {
57
+ "id": "RESOURCE-NATURAL:6",
58
+ "resourceTypeHandle": "TYPE-Natural",
59
+ "provenance": {
60
+ "resourceProvenanceKind": "genesis"
61
+ },
62
+ "timestamp": "2025-11-30T00:00:00.000Z",
63
+ "projection": 6
64
+ },
65
+ {
66
+ "id": "RESOURCE-NATURAL:7",
67
+ "resourceTypeHandle": "TYPE-Natural",
68
+ "provenance": {
69
+ "resourceProvenanceKind": "genesis"
70
+ },
71
+ "timestamp": "2025-11-30T00:00:00.000Z",
72
+ "projection": 7
73
+ },
74
+ {
75
+ "id": "RESOURCE-NATURAL:8",
76
+ "resourceTypeHandle": "TYPE-Natural",
77
+ "provenance": {
78
+ "resourceProvenanceKind": "genesis"
79
+ },
80
+ "timestamp": "2025-11-30T00:00:00.000Z",
81
+ "projection": 8
82
+ },
83
+ {
84
+ "id": "RESOURCE-NATURAL:9",
85
+ "resourceTypeHandle": "TYPE-Natural",
86
+ "provenance": {
87
+ "resourceProvenanceKind": "genesis"
88
+ },
89
+ "timestamp": "2025-11-30T00:00:00.000Z",
90
+ "projection": 9
91
+ },
92
+ {
93
+ "id": "RESOURCE-NATURAL:100",
94
+ "resourceTypeHandle": "TYPE-Natural",
95
+ "provenance": {
96
+ "resourceProvenanceKind": "genesis"
97
+ },
98
+ "timestamp": "2025-11-30T00:00:00.000Z",
99
+ "projection": 100
100
+ }
112
101
  ]
@@ -0,0 +1,2 @@
1
+ import timestampedResources from './naturals.json' with { type: 'json' };
2
+ export default timestampedResources;