@toolproof-npm/schema 0.1.81 → 0.1.83

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 (28) hide show
  1. package/dist/genesis/generated/dependencies_ordered.json +69 -21
  2. package/dist/genesis/generated/resourceTypes/Genesis.json +46 -76
  3. package/dist/genesis/generated/resources/Genesis.json +56 -96
  4. package/dist/genesis/generated/schemas/Genesis.json +104 -128
  5. package/dist/genesis/generated/schemas/RunRecording.d.ts +2 -0
  6. package/dist/genesis/generated/schemas/RunRecording.js +2 -0
  7. package/dist/genesis/generated/schemas/RunRecording.json +998 -0
  8. package/dist/genesis/generated/schemas/RunnableStrategy.d.ts +2 -0
  9. package/dist/genesis/generated/schemas/RunnableStrategy.js +2 -0
  10. package/dist/genesis/generated/schemas/{StrategyRun.json → RunnableStrategy.json} +21 -23
  11. package/dist/genesis/generated/schemas/StatefulStrategy.json +0 -2
  12. package/dist/genesis/generated/terminals.json +2 -1
  13. package/dist/genesis/generated/types/ResourceTypeGenesis.d.ts +5 -6
  14. package/dist/genesis/generated/types/Resource_RunnableStrategy.d.ts +3 -0
  15. package/dist/genesis/generated/types/types.d.ts +661 -209
  16. package/dist/index.d.ts +4 -3
  17. package/dist/index.js +2 -1
  18. package/package.json +2 -2
  19. package/dist/genesis/generated/resource-envelopes/Genesis.d.ts +0 -2
  20. package/dist/genesis/generated/resource-envelopes/Genesis.js +0 -2
  21. package/dist/genesis/generated/resource-envelopes/Genesis.json +0 -2337
  22. package/dist/genesis/generated/resource-type-envelopes/Genesis.d.ts +0 -2
  23. package/dist/genesis/generated/resource-type-envelopes/Genesis.js +0 -2
  24. package/dist/genesis/generated/resource-type-envelopes/Genesis.json +0 -1757
  25. package/dist/genesis/generated/schemas/StrategyRun.d.ts +0 -2
  26. package/dist/genesis/generated/schemas/StrategyRun.js +0 -2
  27. package/dist/genesis/generated/types/Resource_StrategyRun.d.ts +0 -3
  28. /package/dist/genesis/generated/types/{Resource_StrategyRun.js → Resource_RunnableStrategy.js} +0 -0
@@ -204,6 +204,12 @@ export type GraphEndRunEvent =
204
204
  */
205
205
  export type RunEventKind =
206
206
  "graph_start" | "tick" | "interrupt" | "graph_end";
207
+ /**
208
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
209
+ * via the `definition` "RunnableStrategyIdentity".
210
+ */
211
+ export type RunnableStrategyIdentity =
212
+ `RUNNABLE_STRATEGY-${string}`;
207
213
  /**
208
214
  * This interface was referenced by `GenesisJson`'s JSON-Schema
209
215
  * via the `definition` "RunEventStepKind".
@@ -216,12 +222,6 @@ export type RunEventStepKind =
216
222
  */
217
223
  export type WhileStepIdentity =
218
224
  `WHILESTEP-${string}`;
219
- /**
220
- * This interface was referenced by `GenesisJson`'s JSON-Schema
221
- * via the `definition` "StrategyRunIdentity".
222
- */
223
- export type StrategyRunIdentity =
224
- `STRATEGY_RUN-${string}`;
225
225
  /**
226
226
  * This interface was referenced by `GenesisJson`'s JSON-Schema
227
227
  * via the `definition` "StrategyThreadIdentity".
@@ -264,31 +264,31 @@ export type WhileStep =
264
264
  export type GraphStartRunEvent =
265
265
  RunEventBase & {
266
266
  kind?: "graph_start";
267
- strategyRunSeed: StrategyRun;
267
+ runnableStrategySeed: RunnableStrategy;
268
268
  };
269
269
  /**
270
270
  * This interface was referenced by `GenesisJson`'s JSON-Schema
271
- * via the `definition` "StrategyRun".
271
+ * via the `definition` "RunnableStrategy".
272
272
  */
273
- export type StrategyRun =
273
+ export type RunnableStrategy =
274
274
  {
275
- identity: StrategyRunIdentity;
275
+ identity: RunnableStrategyIdentity;
276
+ runnableStrategyContext: RunnableStrategyContext;
276
277
  statefulStrategyRef: StatefulStrategyIdentity;
277
- strategyRunContext: StrategyRunContext;
278
278
  } & StrategyThreadMapWrapper &
279
279
  StrategyStateWrapper;
280
280
  /**
281
281
  * This interface was referenced by `GenesisJson`'s JSON-Schema
282
- * via the `definition` "StatefulStrategyIdentity".
282
+ * via the `definition` "RunnableStrategyStatus".
283
283
  */
284
- export type StatefulStrategyIdentity =
285
- `STATEFUL_STRATEGY-${string}`;
284
+ export type RunnableStrategyStatus =
285
+ "pending" | "running" | "completed" | "failed" | "cancelled";
286
286
  /**
287
287
  * This interface was referenced by `GenesisJson`'s JSON-Schema
288
- * via the `definition` "StrategyRunStatus".
288
+ * via the `definition` "StatefulStrategyIdentity".
289
289
  */
290
- export type StrategyRunStatus =
291
- "pending" | "running" | "completed" | "failed" | "cancelled";
290
+ export type StatefulStrategyIdentity =
291
+ `STATEFUL_STRATEGY-${string}`;
292
292
  /**
293
293
  * This interface was referenced by `undefined`'s JSON-Schema definition
294
294
  * via the `patternProperty` "^[A-Za-z][A-Za-z0-9._-]*Identity$".
@@ -423,6 +423,22 @@ export type TickRunEvent =
423
423
  RunEventBase & {
424
424
  kind?: "tick";
425
425
  };
426
+ /**
427
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
428
+ * via the `definition` "RunnableStrategyUpdate".
429
+ */
430
+ export type RunnableStrategyUpdate =
431
+ {
432
+ runnableStrategy?: RunnableStrategy1;
433
+ runnableStrategyRef: RunnableStrategyIdentity;
434
+ } & StrategyStateDelta;
435
+ export type RunnableStrategy1 =
436
+ {
437
+ identity: RunnableStrategyIdentity;
438
+ runnableStrategyContext: RunnableStrategyContext;
439
+ statefulStrategyRef: StatefulStrategyIdentity;
440
+ } & StrategyThreadMapWrapper &
441
+ StrategyStateWrapper;
426
442
  /**
427
443
  * This interface was referenced by `GenesisJson`'s JSON-Schema
428
444
  * via the `definition` "StatefulStrategy".
@@ -438,22 +454,6 @@ export type StatefulStrategy =
438
454
  */
439
455
  export type StatelessStrategyIdentity =
440
456
  `STATELESS_STRATEGY-${string}`;
441
- /**
442
- * This interface was referenced by `GenesisJson`'s JSON-Schema
443
- * via the `definition` "StrategyRunUpdate".
444
- */
445
- export type StrategyRunUpdate =
446
- {
447
- strategyRun?: StrategyRun1;
448
- strategyRunRef: StrategyRunIdentity;
449
- } & StrategyStateDelta;
450
- export type StrategyRun1 =
451
- {
452
- identity: StrategyRunIdentity;
453
- statefulStrategyRef: StatefulStrategyIdentity;
454
- strategyRunContext: StrategyRunContext;
455
- } & StrategyThreadMapWrapper &
456
- StrategyStateWrapper;
457
457
 
458
458
  export interface GenesisJson {
459
459
  }
@@ -551,11 +551,6 @@ export interface Timestamp {
551
551
  export interface Path {
552
552
  path: string;
553
553
  }
554
- /**
555
- * This interface was referenced by `GenesisJson`'s JSON-Schema
556
- * via the `definition` "ExecutionSocketMaterialized".
557
- */
558
- export type ExecutionSocketMaterialized = Record<ResourceRoleIdentity, Resource>;
559
554
  /**
560
555
  * This interface was referenced by `GenesisJson`'s JSON-Schema
561
556
  * via the `definition` "ExtractionSchemaWrapper".
@@ -573,8 +568,8 @@ export interface RunEventBase {
573
568
  eventSeq: number;
574
569
  kind: RunEventKind;
575
570
  nodeName: string;
571
+ runnableStrategyRef: RunnableStrategyIdentity;
576
572
  stepMetaData?: RunEventStepMetaData;
577
- strategyRunRef: StrategyRunIdentity;
578
573
  strategyThreadRef: StrategyThreadIdentity;
579
574
  updates?: RunEventUpdates;
580
575
  }
@@ -603,18 +598,17 @@ export interface RunEventStepMetaData {
603
598
  */
604
599
  export interface StrategyStateDelta {
605
600
  strategyStateUpdate?: {
606
- [k: string]: ExecutionSocketMaterialized;
601
+ [k: string]: ExecutionSocket;
607
602
  };
608
- strategyStateUpdateWide?: Record<ExecutionIdentity, ExecutionSocket>;
609
603
  }
610
604
  /**
611
605
  * This interface was referenced by `GenesisJson`'s JSON-Schema
612
- * via the `definition` "StrategyRunContext".
606
+ * via the `definition` "RunnableStrategyContext".
613
607
  */
614
- export interface StrategyRunContext {
608
+ export interface RunnableStrategyContext {
615
609
  completedAt?: Timestamp;
616
610
  startedAt?: Timestamp;
617
- status: StrategyRunStatus;
611
+ status: RunnableStrategyStatus;
618
612
  }
619
613
  export interface StrategyThreadMapWrapper {
620
614
  strategyThreadMap: StrategyThreadMap;
@@ -710,7 +704,7 @@ export interface RoleBindingsWrapper1 {
710
704
  export interface RunRecording {
711
705
  recordedAt?: Timestamp1;
712
706
  runEvents: RunEvent[];
713
- strategyRunRef?: string;
707
+ runnableStrategyRef?: string;
714
708
  strategyThreadRef?: string;
715
709
  }
716
710
  export interface Timestamp1 {
@@ -838,36 +832,129 @@ export interface ExtractionSchemaWrapper {
838
832
  extractionSchema: ExtractionSchema;
839
833
  }
840
834
 
841
- export type Normalized =
835
+ /**
836
+ * This interface was referenced by `Normalized`'s JSON-Schema
837
+ * via the `definition` "RunEvent".
838
+ */
839
+ export type RunEvent =
840
+ GraphStartRunEvent | TickRunEvent | InterruptRunEvent | GraphEndRunEvent;
841
+ /**
842
+ * This interface was referenced by `Normalized`'s JSON-Schema
843
+ * via the `definition` "GraphStartRunEvent".
844
+ */
845
+ export type GraphStartRunEvent =
846
+ RunEventBase & {
847
+ kind?: "graph_start";
848
+ runnableStrategySeed: RunnableStrategy;
849
+ };
850
+ /**
851
+ * This interface was referenced by `Normalized`'s JSON-Schema
852
+ * via the `definition` "RunEventKind".
853
+ */
854
+ export type RunEventKind =
855
+ "graph_start" | "tick" | "interrupt" | "graph_end";
856
+ /**
857
+ * This interface was referenced by `Normalized`'s JSON-Schema
858
+ * via the `definition` "RunnableStrategyIdentity".
859
+ */
860
+ export type RunnableStrategyIdentity =
861
+ `RUNNABLE_STRATEGY-${string}`;
862
+ /**
863
+ * This interface was referenced by `Normalized`'s JSON-Schema
864
+ * via the `definition` "ExecutionIdentity".
865
+ */
866
+ export type ExecutionIdentity =
867
+ `EXECUTION-${string}`;
868
+ /**
869
+ * This interface was referenced by `Normalized`'s JSON-Schema
870
+ * via the `definition` "JobIdentity".
871
+ */
872
+ export type JobIdentity =
873
+ `JOB-${string}`;
874
+ /**
875
+ * This interface was referenced by `Normalized`'s JSON-Schema
876
+ * via the `definition` "RunEventStepKind".
877
+ */
878
+ export type RunEventStepKind =
879
+ "work" | "branch" | "while" | "for";
880
+ /**
881
+ * This interface was referenced by `Normalized`'s JSON-Schema
882
+ * via the `definition` "WorkStepIdentity".
883
+ */
884
+ export type WorkStepIdentity =
885
+ `WORKSTEP-${string}`;
886
+ /**
887
+ * This interface was referenced by `Normalized`'s JSON-Schema
888
+ * via the `definition` "BranchStepIdentity".
889
+ */
890
+ export type BranchStepIdentity =
891
+ `BRANCHSTEP-${string}`;
892
+ /**
893
+ * This interface was referenced by `Normalized`'s JSON-Schema
894
+ * via the `definition` "WhileStepIdentity".
895
+ */
896
+ export type WhileStepIdentity =
897
+ `WHILESTEP-${string}`;
898
+ /**
899
+ * This interface was referenced by `Normalized`'s JSON-Schema
900
+ * via the `definition` "ForStepIdentity".
901
+ */
902
+ export type ForStepIdentity =
903
+ `FORSTEP-${string}`;
904
+ /**
905
+ * This interface was referenced by `Normalized`'s JSON-Schema
906
+ * via the `definition` "StrategyThreadIdentity".
907
+ */
908
+ export type StrategyThreadIdentity =
909
+ `STRATEGY_THREAD-${string}`;
910
+ /**
911
+ * This interface was referenced by `Normalized`'s JSON-Schema
912
+ * via the `definition` "RunEventUpdates".
913
+ */
914
+ export type RunEventUpdates =
842
915
  {
843
- identity: StatefulStrategyIdentity;
844
- } & StatelessStrategyWrapper &
845
- StrategyStateWrapper;
846
- export type StatefulStrategyIdentity =
847
- `STATEFUL_STRATEGY-${string}`;
848
- export type StatelessStrategyIdentity =
849
- `STATELESS_STRATEGY-${string}`;
916
+ interruptData?: {
917
+ } | null;
918
+ stepsMutation?: {
919
+ insertAt: number;
920
+ inserted: Step[];
921
+ };
922
+ } & StrategyStateDelta;
923
+ /**
924
+ * This interface was referenced by `Normalized`'s JSON-Schema
925
+ * via the `definition` "Step".
926
+ */
850
927
  export type Step =
851
928
  WorkStep | BranchStep | WhileStep | ForStep;
929
+ /**
930
+ * This interface was referenced by `Normalized`'s JSON-Schema
931
+ * via the `definition` "WorkStep".
932
+ */
852
933
  export type WorkStep =
853
934
  {
854
935
  execution: Execution;
855
936
  identity: WorkStepIdentity;
856
937
  kind: "work";
857
938
  } & StepKind;
939
+ /**
940
+ * This interface was referenced by `Normalized`'s JSON-Schema
941
+ * via the `definition` "Execution".
942
+ */
858
943
  export type Execution =
859
944
  {
860
945
  identity: ExecutionIdentity;
861
946
  jobRef: JobIdentity;
862
947
  } & RoleBindingsWrapper;
863
- export type ExecutionIdentity =
864
- `EXECUTION-${string}`;
865
- export type JobIdentity =
866
- `JOB-${string}`;
948
+ /**
949
+ * This interface was referenced by `Normalized`'s JSON-Schema
950
+ * via the `definition` "ResourceIdentity".
951
+ */
867
952
  export type ResourceIdentity =
868
953
  `RESOURCE-${string}`;
869
- export type WorkStepIdentity =
870
- `WORKSTEP-${string}`;
954
+ /**
955
+ * This interface was referenced by `Normalized`'s JSON-Schema
956
+ * via the `definition` "BranchStep".
957
+ */
871
958
  export type BranchStep =
872
959
  {
873
960
  /**
@@ -877,32 +964,46 @@ export type BranchStep =
877
964
  identity: BranchStepIdentity;
878
965
  kind: "branch";
879
966
  } & StepKind;
880
- export type BranchStepIdentity =
881
- `BRANCHSTEP-${string}`;
967
+ /**
968
+ * This interface was referenced by `Normalized`'s JSON-Schema
969
+ * via the `definition` "WhileStep".
970
+ */
882
971
  export type WhileStep =
883
972
  {
884
973
  case: Conditional;
885
974
  identity: WhileStepIdentity;
886
975
  kind: "while";
887
976
  } & StepKind;
888
- export type WhileStepIdentity =
889
- `WHILESTEP-${string}`;
977
+ /**
978
+ * This interface was referenced by `Normalized`'s JSON-Schema
979
+ * via the `definition` "ForStep".
980
+ */
890
981
  export type ForStep =
891
982
  {
892
983
  case: Conditional;
893
984
  identity: ForStepIdentity;
894
985
  kind: "for";
895
986
  } & StepKind;
896
- export type ForStepIdentity =
897
- `FORSTEP-${string}`;
987
+ /**
988
+ * This interface was referenced by `Normalized`'s JSON-Schema
989
+ * via the `definition` "ResourceMissing".
990
+ */
898
991
  export type ResourceMissing =
899
992
  {
900
993
  } & ResourceBase &
901
994
  ResourceKind & {
902
995
  kind: "missing";
903
996
  };
997
+ /**
998
+ * This interface was referenced by `Normalized`'s JSON-Schema
999
+ * via the `definition` "ResourceTypeIdentity".
1000
+ */
904
1001
  export type ResourceTypeIdentity =
905
1002
  `TYPE-${string}`;
1003
+ /**
1004
+ * This interface was referenced by `Normalized`'s JSON-Schema
1005
+ * via the `definition` "ResourcePotentialInput".
1006
+ */
906
1007
  export type ResourcePotentialInput =
907
1008
  {
908
1009
  } & ResourceBase &
@@ -910,8 +1011,16 @@ export type ResourcePotentialInput =
910
1011
  ResourceKind & {
911
1012
  kind: "potential-input";
912
1013
  };
1014
+ /**
1015
+ * This interface was referenced by `Normalized`'s JSON-Schema
1016
+ * via the `definition` "ResourceRoleIdentity".
1017
+ */
913
1018
  export type ResourceRoleIdentity =
914
1019
  `ROLE-${string}`;
1020
+ /**
1021
+ * This interface was referenced by `Normalized`'s JSON-Schema
1022
+ * via the `definition` "ResourcePotentialOutput".
1023
+ */
915
1024
  export type ResourcePotentialOutput =
916
1025
  {
917
1026
  } & ResourceBase &
@@ -919,6 +1028,10 @@ export type ResourcePotentialOutput =
919
1028
  ResourceKind & {
920
1029
  kind: "potential-output";
921
1030
  };
1031
+ /**
1032
+ * This interface was referenced by `Normalized`'s JSON-Schema
1033
+ * via the `definition` "Resource".
1034
+ */
922
1035
  export type Resource =
923
1036
  {
924
1037
  } & ResourceMetaBase & {
@@ -926,13 +1039,21 @@ export type Resource =
926
1039
  [k: string]: JsonData;
927
1040
  };
928
1041
  };
1042
+ /**
1043
+ * This interface was referenced by `Normalized`'s JSON-Schema
1044
+ * via the `definition` "ResourceMetaBase".
1045
+ */
929
1046
  export type ResourceMetaBase =
930
1047
  ResourceBase &
931
1048
  CreationContextWrapper &
932
1049
  ResourceKind & {
933
1050
  kind: "materialized";
934
- } & Timestamp &
1051
+ } & Timestamp1 &
935
1052
  Path;
1053
+ /**
1054
+ * This interface was referenced by `Normalized`'s JSON-Schema
1055
+ * via the `definition` "JsonData".
1056
+ */
936
1057
  export type JsonData =
937
1058
  | null
938
1059
  | boolean
@@ -942,171 +1063,103 @@ export type JsonData =
942
1063
  | {
943
1064
  [k: string]: JsonData;
944
1065
  };
945
-
946
- export interface StatelessStrategyWrapper {
947
- statelessStrategy: StatelessStrategy;
948
- }
949
- export interface StatelessStrategy {
950
- identity: StatelessStrategyIdentity;
951
- steps: Step[];
952
- }
953
- export interface RoleBindingsWrapper {
954
- roleBindings: RoleBindings;
955
- }
956
- export interface RoleBindings {
957
- inputBindingMap: RoleBindingMap;
958
- outputBindingMap: RoleBindingMap;
959
- }
960
- export type RoleBindingMap = Record<ResourceRoleIdentity, ResourceIdentity>;
961
- export interface StepKind {
962
- kind: "work" | "branch" | "while" | "for";
963
- }
964
- export interface Conditional {
965
- what: WorkStep;
966
- when: WorkStep;
967
- }
968
- export interface StrategyStateWrapper {
969
- strategyState: StrategyState;
970
- }
971
- export type StrategyState = Record<ExecutionIdentity, ExecutionSocket>;
972
- export type ExecutionSocket = Record<ResourceRoleIdentity, ResourceMissing | ResourcePotentialInput | ResourcePotentialOutput | Resource>;
973
- export interface ResourceBase {
974
- identity: ResourceIdentity;
975
- resourceTypeRef: ResourceTypeIdentity;
976
- }
977
- export interface ResourceKind {
978
- kind: "missing" | "potential-input" | "potential-output" | "materialized";
979
- }
980
- export interface CreationContextWrapper {
981
- creationContext: CreationContext;
982
- }
983
- export interface CreationContext {
984
- executionRef: ExecutionIdentity;
985
- resourceRoleRef: ResourceRoleIdentity;
986
- }
987
- export interface Timestamp {
988
- timestamp: string;
989
- }
990
- export interface Path {
991
- path: string;
992
- }
993
-
994
1066
  /**
995
1067
  * This interface was referenced by `Normalized`'s JSON-Schema
996
- * via the `definition` "StatelessStrategyIdentity".
1068
+ * via the `definition` "RunnableStrategy".
997
1069
  */
998
- export type StatelessStrategyIdentity =
999
- `STATELESS_STRATEGY-${string}`;
1070
+ export type RunnableStrategy =
1071
+ {
1072
+ identity: RunnableStrategyIdentity;
1073
+ runnableStrategyContext: RunnableStrategyContext;
1074
+ statefulStrategyRef: StatefulStrategyIdentity;
1075
+ } & StrategyThreadMapWrapper &
1076
+ StrategyStateWrapper;
1000
1077
  /**
1001
1078
  * This interface was referenced by `Normalized`'s JSON-Schema
1002
- * via the `definition` "Step".
1079
+ * via the `definition` "RunnableStrategyStatus".
1003
1080
  */
1004
- export type Step =
1005
- WorkStep | BranchStep | WhileStep | ForStep;
1006
- /**
1007
- * This interface was referenced by `Normalized`'s JSON-Schema
1008
- * via the `definition` "WorkStep".
1009
- */
1010
- export type WorkStep =
1011
- {
1012
- execution: Execution;
1013
- identity: WorkStepIdentity;
1014
- kind: "work";
1015
- } & StepKind;
1016
- /**
1017
- * This interface was referenced by `Normalized`'s JSON-Schema
1018
- * via the `definition` "Execution".
1019
- */
1020
- export type Execution =
1021
- {
1022
- identity: ExecutionIdentity;
1023
- jobRef: JobIdentity;
1024
- } & RoleBindingsWrapper;
1025
- /**
1026
- * This interface was referenced by `Normalized`'s JSON-Schema
1027
- * via the `definition` "ExecutionIdentity".
1028
- */
1029
- export type ExecutionIdentity =
1030
- `EXECUTION-${string}`;
1031
- /**
1032
- * This interface was referenced by `Normalized`'s JSON-Schema
1033
- * via the `definition` "JobIdentity".
1034
- */
1035
- export type JobIdentity =
1036
- `JOB-${string}`;
1037
- /**
1038
- * This interface was referenced by `Normalized`'s JSON-Schema
1039
- * via the `definition` "ResourceIdentity".
1040
- */
1041
- export type ResourceIdentity =
1042
- `RESOURCE-${string}`;
1081
+ export type RunnableStrategyStatus =
1082
+ "pending" | "running" | "completed" | "failed" | "cancelled";
1043
1083
  /**
1044
1084
  * This interface was referenced by `Normalized`'s JSON-Schema
1045
- * via the `definition` "WorkStepIdentity".
1085
+ * via the `definition` "StatefulStrategyIdentity".
1046
1086
  */
1047
- export type WorkStepIdentity =
1048
- `WORKSTEP-${string}`;
1087
+ export type StatefulStrategyIdentity =
1088
+ `STATEFUL_STRATEGY-${string}`;
1049
1089
  /**
1050
1090
  * This interface was referenced by `Normalized`'s JSON-Schema
1051
- * via the `definition` "BranchStep".
1091
+ * via the `definition` "TickRunEvent".
1052
1092
  */
1053
- export type BranchStep =
1054
- {
1055
- /**
1056
- * @minItems 1
1057
- */
1058
- cases: [Conditional, ...Conditional[]];
1059
- identity: BranchStepIdentity;
1060
- kind: "branch";
1061
- } & StepKind;
1093
+ export type TickRunEvent =
1094
+ RunEventBase & {
1095
+ kind?: "tick";
1096
+ };
1062
1097
  /**
1063
1098
  * This interface was referenced by `Normalized`'s JSON-Schema
1064
- * via the `definition` "BranchStepIdentity".
1099
+ * via the `definition` "InterruptRunEvent".
1065
1100
  */
1066
- export type BranchStepIdentity =
1067
- `BRANCHSTEP-${string}`;
1101
+ export type InterruptRunEvent =
1102
+ RunEventBase & {
1103
+ kind?: "interrupt";
1104
+ };
1068
1105
  /**
1069
1106
  * This interface was referenced by `Normalized`'s JSON-Schema
1070
- * via the `definition` "WhileStep".
1107
+ * via the `definition` "GraphEndRunEvent".
1071
1108
  */
1072
- export type WhileStep =
1073
- {
1074
- case: Conditional;
1075
- identity: WhileStepIdentity;
1076
- kind: "while";
1077
- } & StepKind;
1109
+ export type GraphEndRunEvent =
1110
+ RunEventBase & {
1111
+ kind?: "graph_end";
1112
+ };
1113
+
1114
+ export interface Normalized {
1115
+ recordedAt?: Timestamp;
1116
+ runEvents: RunEvent[];
1117
+ runnableStrategyRef?: string;
1118
+ strategyThreadRef?: string;
1119
+ }
1120
+ export interface Timestamp {
1121
+ timestamp: string;
1122
+ }
1078
1123
  /**
1079
1124
  * This interface was referenced by `Normalized`'s JSON-Schema
1080
- * via the `definition` "WhileStepIdentity".
1125
+ * via the `definition` "RunEventBase".
1081
1126
  */
1082
- export type WhileStepIdentity =
1083
- `WHILESTEP-${string}`;
1127
+ export interface RunEventBase {
1128
+ counters?: RunEventCounters;
1129
+ createdAt: Timestamp1;
1130
+ eventSeq: number;
1131
+ kind: RunEventKind;
1132
+ nodeName: string;
1133
+ runnableStrategyRef: RunnableStrategyIdentity;
1134
+ stepMetaData?: RunEventStepMetaData;
1135
+ strategyThreadRef: StrategyThreadIdentity;
1136
+ updates?: RunEventUpdates;
1137
+ }
1084
1138
  /**
1085
1139
  * This interface was referenced by `Normalized`'s JSON-Schema
1086
- * via the `definition` "ForStep".
1140
+ * via the `definition` "RunEventCounters".
1087
1141
  */
1088
- export type ForStep =
1089
- {
1090
- case: Conditional;
1091
- identity: ForStepIdentity;
1092
- kind: "for";
1093
- } & StepKind;
1142
+ export interface RunEventCounters {
1143
+ iterationCounterAfter?: number;
1144
+ stepCounterAfter?: number;
1145
+ }
1094
1146
  /**
1095
1147
  * This interface was referenced by `Normalized`'s JSON-Schema
1096
- * via the `definition` "ForStepIdentity".
1148
+ * via the `definition` "Timestamp".
1097
1149
  */
1098
- export type ForStepIdentity =
1099
- `FORSTEP-${string}`;
1150
+ export interface Timestamp1 {
1151
+ timestamp: string;
1152
+ }
1100
1153
  /**
1101
1154
  * This interface was referenced by `Normalized`'s JSON-Schema
1102
- * via the `definition` "ResourceRoleIdentity".
1155
+ * via the `definition` "RunEventStepMetaData".
1103
1156
  */
1104
- export type ResourceRoleIdentity =
1105
- `ROLE-${string}`;
1106
-
1107
- export interface Normalized {
1108
- identity: StatelessStrategyIdentity;
1109
- steps: Step[];
1157
+ export interface RunEventStepMetaData {
1158
+ executionRef?: ExecutionIdentity;
1159
+ jobRef?: JobIdentity;
1160
+ stepKind: RunEventStepKind;
1161
+ stepRef: WorkStepIdentity | BranchStepIdentity | WhileStepIdentity | ForStepIdentity;
1162
+ threadStepIndex: number;
1110
1163
  }
1111
1164
  export interface RoleBindingsWrapper {
1112
1165
  roleBindings: RoleBindings;
@@ -1139,6 +1192,96 @@ export interface Conditional {
1139
1192
  what: WorkStep;
1140
1193
  when: WorkStep;
1141
1194
  }
1195
+ /**
1196
+ * This interface was referenced by `Normalized`'s JSON-Schema
1197
+ * via the `definition` "StrategyStateDelta".
1198
+ */
1199
+ export interface StrategyStateDelta {
1200
+ strategyStateUpdate?: {
1201
+ [k: string]: ExecutionSocket;
1202
+ };
1203
+ }
1204
+ /**
1205
+ * This interface was referenced by `Normalized`'s JSON-Schema
1206
+ * via the `definition` "ExecutionSocket".
1207
+ */
1208
+ export type ExecutionSocket = Record<ResourceRoleIdentity, ResourceMissing | ResourcePotentialInput | ResourcePotentialOutput | Resource>;
1209
+ /**
1210
+ * This interface was referenced by `Normalized`'s JSON-Schema
1211
+ * via the `definition` "ResourceBase".
1212
+ */
1213
+ export interface ResourceBase {
1214
+ identity: ResourceIdentity;
1215
+ resourceTypeRef: ResourceTypeIdentity;
1216
+ }
1217
+ /**
1218
+ * This interface was referenced by `Normalized`'s JSON-Schema
1219
+ * via the `definition` "ResourceKind".
1220
+ */
1221
+ export interface ResourceKind {
1222
+ kind: "missing" | "potential-input" | "potential-output" | "materialized";
1223
+ }
1224
+ /**
1225
+ * This interface was referenced by `Normalized`'s JSON-Schema
1226
+ * via the `definition` "CreationContextWrapper".
1227
+ */
1228
+ export interface CreationContextWrapper {
1229
+ creationContext: CreationContext;
1230
+ }
1231
+ /**
1232
+ * This interface was referenced by `Normalized`'s JSON-Schema
1233
+ * via the `definition` "CreationContext".
1234
+ */
1235
+ export interface CreationContext {
1236
+ executionRef: ExecutionIdentity;
1237
+ resourceRoleRef: ResourceRoleIdentity;
1238
+ }
1239
+ /**
1240
+ * This interface was referenced by `Normalized`'s JSON-Schema
1241
+ * via the `definition` "Path".
1242
+ */
1243
+ export interface Path {
1244
+ path: string;
1245
+ }
1246
+ /**
1247
+ * This interface was referenced by `Normalized`'s JSON-Schema
1248
+ * via the `definition` "RunnableStrategyContext".
1249
+ */
1250
+ export interface RunnableStrategyContext {
1251
+ completedAt?: Timestamp1;
1252
+ startedAt?: Timestamp1;
1253
+ status: RunnableStrategyStatus;
1254
+ }
1255
+ export interface StrategyThreadMapWrapper {
1256
+ strategyThreadMap: StrategyThreadMap;
1257
+ }
1258
+ /**
1259
+ * This interface was referenced by `Normalized`'s JSON-Schema
1260
+ * via the `definition` "StrategyThreadMap".
1261
+ */
1262
+ export type StrategyThreadMap = Record<StrategyThreadIdentity, Step[]>;
1263
+ export interface StrategyStateWrapper {
1264
+ strategyState: StrategyState;
1265
+ }
1266
+ /**
1267
+ * This interface was referenced by `Normalized`'s JSON-Schema
1268
+ * via the `definition` "StrategyState".
1269
+ */
1270
+ export type StrategyState = Record<ExecutionIdentity, ExecutionSocket>;
1271
+ /**
1272
+ * This interface was referenced by `Normalized`'s JSON-Schema
1273
+ * via the `definition` "StrategyThreadMapWrapper".
1274
+ */
1275
+ export interface StrategyThreadMapWrapper1 {
1276
+ strategyThreadMap: StrategyThreadMap;
1277
+ }
1278
+ /**
1279
+ * This interface was referenced by `Normalized`'s JSON-Schema
1280
+ * via the `definition` "StrategyStateWrapper".
1281
+ */
1282
+ export interface StrategyStateWrapper1 {
1283
+ strategyState: StrategyState;
1284
+ }
1142
1285
  /**
1143
1286
  * This interface was referenced by `Normalized`'s JSON-Schema
1144
1287
  * via the `definition` "RoleBindingsWrapper".
@@ -1149,17 +1292,17 @@ export interface RoleBindingsWrapper1 {
1149
1292
 
1150
1293
  export type Normalized =
1151
1294
  {
1152
- identity: StrategyRunIdentity;
1295
+ identity: RunnableStrategyIdentity;
1296
+ runnableStrategyContext: RunnableStrategyContext;
1153
1297
  statefulStrategyRef: StatefulStrategyIdentity;
1154
- strategyRunContext: StrategyRunContext;
1155
1298
  } & StrategyThreadMapWrapper &
1156
1299
  StrategyStateWrapper;
1157
- export type StrategyRunIdentity =
1158
- `STRATEGY_RUN-${string}`;
1300
+ export type RunnableStrategyIdentity =
1301
+ `RUNNABLE_STRATEGY-${string}`;
1302
+ export type RunnableStrategyStatus =
1303
+ "pending" | "running" | "completed" | "failed" | "cancelled";
1159
1304
  export type StatefulStrategyIdentity =
1160
1305
  `STATEFUL_STRATEGY-${string}`;
1161
- export type StrategyRunStatus =
1162
- "pending" | "running" | "completed" | "failed" | "cancelled";
1163
1306
  export type Step =
1164
1307
  WorkStep | BranchStep | WhileStep | ForStep;
1165
1308
  export type WorkStep =
@@ -1256,10 +1399,10 @@ export type JsonData =
1256
1399
  [k: string]: JsonData;
1257
1400
  };
1258
1401
 
1259
- export interface StrategyRunContext {
1402
+ export interface RunnableStrategyContext {
1260
1403
  completedAt?: Timestamp;
1261
1404
  startedAt?: Timestamp;
1262
- status: StrategyRunStatus;
1405
+ status: RunnableStrategyStatus;
1263
1406
  }
1264
1407
  export interface Timestamp {
1265
1408
  timestamp: string;
@@ -1306,3 +1449,312 @@ export interface Path {
1306
1449
  path: string;
1307
1450
  }
1308
1451
 
1452
+ export type Normalized =
1453
+ {
1454
+ identity: StatefulStrategyIdentity;
1455
+ } & StatelessStrategyWrapper &
1456
+ StrategyStateWrapper;
1457
+ export type StatefulStrategyIdentity =
1458
+ `STATEFUL_STRATEGY-${string}`;
1459
+ export type StatelessStrategyIdentity =
1460
+ `STATELESS_STRATEGY-${string}`;
1461
+ export type Step =
1462
+ WorkStep | BranchStep | WhileStep | ForStep;
1463
+ export type WorkStep =
1464
+ {
1465
+ execution: Execution;
1466
+ identity: WorkStepIdentity;
1467
+ kind: "work";
1468
+ } & StepKind;
1469
+ export type Execution =
1470
+ {
1471
+ identity: ExecutionIdentity;
1472
+ jobRef: JobIdentity;
1473
+ } & RoleBindingsWrapper;
1474
+ export type ExecutionIdentity =
1475
+ `EXECUTION-${string}`;
1476
+ export type JobIdentity =
1477
+ `JOB-${string}`;
1478
+ export type ResourceIdentity =
1479
+ `RESOURCE-${string}`;
1480
+ export type WorkStepIdentity =
1481
+ `WORKSTEP-${string}`;
1482
+ export type BranchStep =
1483
+ {
1484
+ /**
1485
+ * @minItems 1
1486
+ */
1487
+ cases: [Conditional, ...Conditional[]];
1488
+ identity: BranchStepIdentity;
1489
+ kind: "branch";
1490
+ } & StepKind;
1491
+ export type BranchStepIdentity =
1492
+ `BRANCHSTEP-${string}`;
1493
+ export type WhileStep =
1494
+ {
1495
+ case: Conditional;
1496
+ identity: WhileStepIdentity;
1497
+ kind: "while";
1498
+ } & StepKind;
1499
+ export type WhileStepIdentity =
1500
+ `WHILESTEP-${string}`;
1501
+ export type ForStep =
1502
+ {
1503
+ case: Conditional;
1504
+ identity: ForStepIdentity;
1505
+ kind: "for";
1506
+ } & StepKind;
1507
+ export type ForStepIdentity =
1508
+ `FORSTEP-${string}`;
1509
+ export type ResourceMissing =
1510
+ {
1511
+ } & ResourceBase &
1512
+ ResourceKind & {
1513
+ kind: "missing";
1514
+ };
1515
+ export type ResourceTypeIdentity =
1516
+ `TYPE-${string}`;
1517
+ export type ResourcePotentialInput =
1518
+ {
1519
+ } & ResourceBase &
1520
+ CreationContextWrapper &
1521
+ ResourceKind & {
1522
+ kind: "potential-input";
1523
+ };
1524
+ export type ResourceRoleIdentity =
1525
+ `ROLE-${string}`;
1526
+ export type ResourcePotentialOutput =
1527
+ {
1528
+ } & ResourceBase &
1529
+ CreationContextWrapper &
1530
+ ResourceKind & {
1531
+ kind: "potential-output";
1532
+ };
1533
+ export type Resource =
1534
+ {
1535
+ } & ResourceMetaBase & {
1536
+ extractedData: {
1537
+ [k: string]: JsonData;
1538
+ };
1539
+ };
1540
+ export type ResourceMetaBase =
1541
+ ResourceBase &
1542
+ CreationContextWrapper &
1543
+ ResourceKind & {
1544
+ kind: "materialized";
1545
+ } & Timestamp &
1546
+ Path;
1547
+ export type JsonData =
1548
+ | null
1549
+ | boolean
1550
+ | number
1551
+ | string
1552
+ | JsonData
1553
+ | {
1554
+ [k: string]: JsonData;
1555
+ };
1556
+
1557
+ export interface StatelessStrategyWrapper {
1558
+ statelessStrategy: StatelessStrategy;
1559
+ }
1560
+ export interface StatelessStrategy {
1561
+ identity: StatelessStrategyIdentity;
1562
+ steps: Step[];
1563
+ }
1564
+ export interface RoleBindingsWrapper {
1565
+ roleBindings: RoleBindings;
1566
+ }
1567
+ export interface RoleBindings {
1568
+ inputBindingMap: RoleBindingMap;
1569
+ outputBindingMap: RoleBindingMap;
1570
+ }
1571
+ export type RoleBindingMap = Record<ResourceRoleIdentity, ResourceIdentity>;
1572
+ export interface StepKind {
1573
+ kind: "work" | "branch" | "while" | "for";
1574
+ }
1575
+ export interface Conditional {
1576
+ what: WorkStep;
1577
+ when: WorkStep;
1578
+ }
1579
+ export interface StrategyStateWrapper {
1580
+ strategyState: StrategyState;
1581
+ }
1582
+ export type StrategyState = Record<ExecutionIdentity, ExecutionSocket>;
1583
+ export type ExecutionSocket = Record<ResourceRoleIdentity, ResourceMissing | ResourcePotentialInput | ResourcePotentialOutput | Resource>;
1584
+ export interface ResourceBase {
1585
+ identity: ResourceIdentity;
1586
+ resourceTypeRef: ResourceTypeIdentity;
1587
+ }
1588
+ export interface ResourceKind {
1589
+ kind: "missing" | "potential-input" | "potential-output" | "materialized";
1590
+ }
1591
+ export interface CreationContextWrapper {
1592
+ creationContext: CreationContext;
1593
+ }
1594
+ export interface CreationContext {
1595
+ executionRef: ExecutionIdentity;
1596
+ resourceRoleRef: ResourceRoleIdentity;
1597
+ }
1598
+ export interface Timestamp {
1599
+ timestamp: string;
1600
+ }
1601
+ export interface Path {
1602
+ path: string;
1603
+ }
1604
+
1605
+ /**
1606
+ * This interface was referenced by `Normalized`'s JSON-Schema
1607
+ * via the `definition` "StatelessStrategyIdentity".
1608
+ */
1609
+ export type StatelessStrategyIdentity =
1610
+ `STATELESS_STRATEGY-${string}`;
1611
+ /**
1612
+ * This interface was referenced by `Normalized`'s JSON-Schema
1613
+ * via the `definition` "Step".
1614
+ */
1615
+ export type Step =
1616
+ WorkStep | BranchStep | WhileStep | ForStep;
1617
+ /**
1618
+ * This interface was referenced by `Normalized`'s JSON-Schema
1619
+ * via the `definition` "WorkStep".
1620
+ */
1621
+ export type WorkStep =
1622
+ {
1623
+ execution: Execution;
1624
+ identity: WorkStepIdentity;
1625
+ kind: "work";
1626
+ } & StepKind;
1627
+ /**
1628
+ * This interface was referenced by `Normalized`'s JSON-Schema
1629
+ * via the `definition` "Execution".
1630
+ */
1631
+ export type Execution =
1632
+ {
1633
+ identity: ExecutionIdentity;
1634
+ jobRef: JobIdentity;
1635
+ } & RoleBindingsWrapper;
1636
+ /**
1637
+ * This interface was referenced by `Normalized`'s JSON-Schema
1638
+ * via the `definition` "ExecutionIdentity".
1639
+ */
1640
+ export type ExecutionIdentity =
1641
+ `EXECUTION-${string}`;
1642
+ /**
1643
+ * This interface was referenced by `Normalized`'s JSON-Schema
1644
+ * via the `definition` "JobIdentity".
1645
+ */
1646
+ export type JobIdentity =
1647
+ `JOB-${string}`;
1648
+ /**
1649
+ * This interface was referenced by `Normalized`'s JSON-Schema
1650
+ * via the `definition` "ResourceIdentity".
1651
+ */
1652
+ export type ResourceIdentity =
1653
+ `RESOURCE-${string}`;
1654
+ /**
1655
+ * This interface was referenced by `Normalized`'s JSON-Schema
1656
+ * via the `definition` "WorkStepIdentity".
1657
+ */
1658
+ export type WorkStepIdentity =
1659
+ `WORKSTEP-${string}`;
1660
+ /**
1661
+ * This interface was referenced by `Normalized`'s JSON-Schema
1662
+ * via the `definition` "BranchStep".
1663
+ */
1664
+ export type BranchStep =
1665
+ {
1666
+ /**
1667
+ * @minItems 1
1668
+ */
1669
+ cases: [Conditional, ...Conditional[]];
1670
+ identity: BranchStepIdentity;
1671
+ kind: "branch";
1672
+ } & StepKind;
1673
+ /**
1674
+ * This interface was referenced by `Normalized`'s JSON-Schema
1675
+ * via the `definition` "BranchStepIdentity".
1676
+ */
1677
+ export type BranchStepIdentity =
1678
+ `BRANCHSTEP-${string}`;
1679
+ /**
1680
+ * This interface was referenced by `Normalized`'s JSON-Schema
1681
+ * via the `definition` "WhileStep".
1682
+ */
1683
+ export type WhileStep =
1684
+ {
1685
+ case: Conditional;
1686
+ identity: WhileStepIdentity;
1687
+ kind: "while";
1688
+ } & StepKind;
1689
+ /**
1690
+ * This interface was referenced by `Normalized`'s JSON-Schema
1691
+ * via the `definition` "WhileStepIdentity".
1692
+ */
1693
+ export type WhileStepIdentity =
1694
+ `WHILESTEP-${string}`;
1695
+ /**
1696
+ * This interface was referenced by `Normalized`'s JSON-Schema
1697
+ * via the `definition` "ForStep".
1698
+ */
1699
+ export type ForStep =
1700
+ {
1701
+ case: Conditional;
1702
+ identity: ForStepIdentity;
1703
+ kind: "for";
1704
+ } & StepKind;
1705
+ /**
1706
+ * This interface was referenced by `Normalized`'s JSON-Schema
1707
+ * via the `definition` "ForStepIdentity".
1708
+ */
1709
+ export type ForStepIdentity =
1710
+ `FORSTEP-${string}`;
1711
+ /**
1712
+ * This interface was referenced by `Normalized`'s JSON-Schema
1713
+ * via the `definition` "ResourceRoleIdentity".
1714
+ */
1715
+ export type ResourceRoleIdentity =
1716
+ `ROLE-${string}`;
1717
+
1718
+ export interface Normalized {
1719
+ identity: StatelessStrategyIdentity;
1720
+ steps: Step[];
1721
+ }
1722
+ export interface RoleBindingsWrapper {
1723
+ roleBindings: RoleBindings;
1724
+ }
1725
+ /**
1726
+ * This interface was referenced by `Normalized`'s JSON-Schema
1727
+ * via the `definition` "RoleBindings".
1728
+ */
1729
+ export interface RoleBindings {
1730
+ inputBindingMap: RoleBindingMap;
1731
+ outputBindingMap: RoleBindingMap;
1732
+ }
1733
+ /**
1734
+ * This interface was referenced by `Normalized`'s JSON-Schema
1735
+ * via the `definition` "RoleBindingMap".
1736
+ */
1737
+ export type RoleBindingMap = Record<ResourceRoleIdentity, ResourceIdentity>;
1738
+ /**
1739
+ * This interface was referenced by `Normalized`'s JSON-Schema
1740
+ * via the `definition` "StepKind".
1741
+ */
1742
+ export interface StepKind {
1743
+ kind: "work" | "branch" | "while" | "for";
1744
+ }
1745
+ /**
1746
+ * This interface was referenced by `Normalized`'s JSON-Schema
1747
+ * via the `definition` "Conditional".
1748
+ */
1749
+ export interface Conditional {
1750
+ what: WorkStep;
1751
+ when: WorkStep;
1752
+ }
1753
+ /**
1754
+ * This interface was referenced by `Normalized`'s JSON-Schema
1755
+ * via the `definition` "RoleBindingsWrapper".
1756
+ */
1757
+ export interface RoleBindingsWrapper1 {
1758
+ roleBindings: RoleBindings;
1759
+ }
1760
+