@toolproof-npm/schema 0.1.82 → 0.1.84

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 (27) hide show
  1. package/README.md +59 -59
  2. package/dist/genesis/generated/dependencies_ordered.json +17 -23
  3. package/dist/genesis/generated/resourceTypes/Genesis.json +42 -77
  4. package/dist/genesis/generated/resources/Genesis.json +52 -97
  5. package/dist/genesis/generated/schemas/Genesis.json +104 -133
  6. package/dist/genesis/generated/schemas/RunRecording.json +186 -215
  7. package/dist/genesis/generated/schemas/RunnableStrategy.d.ts +2 -0
  8. package/dist/genesis/generated/schemas/RunnableStrategy.js +2 -0
  9. package/dist/genesis/generated/schemas/{StrategyRun.json → RunnableStrategy.json} +21 -21
  10. package/dist/genesis/generated/terminals.json +1 -1
  11. package/dist/genesis/generated/types/ResourceTypeGenesis.d.ts +5 -6
  12. package/dist/genesis/generated/types/Resource_RunnableStrategy.d.ts +3 -0
  13. package/dist/genesis/generated/types/types.d.ts +284 -300
  14. package/dist/index.d.ts +3 -3
  15. package/dist/index.js +1 -1
  16. package/dist/scripts/generateTypes.js +1 -3
  17. package/package.json +62 -62
  18. package/dist/genesis/generated/resource-envelopes/Genesis.d.ts +0 -2
  19. package/dist/genesis/generated/resource-envelopes/Genesis.js +0 -2
  20. package/dist/genesis/generated/resource-envelopes/Genesis.json +0 -2337
  21. package/dist/genesis/generated/resource-type-envelopes/Genesis.d.ts +0 -2
  22. package/dist/genesis/generated/resource-type-envelopes/Genesis.js +0 -2
  23. package/dist/genesis/generated/resource-type-envelopes/Genesis.json +0 -1757
  24. package/dist/genesis/generated/schemas/StrategyRun.d.ts +0 -2
  25. package/dist/genesis/generated/schemas/StrategyRun.js +0 -2
  26. package/dist/genesis/generated/types/Resource_StrategyRun.d.ts +0 -3
  27. /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
  }
@@ -602,19 +597,21 @@ export interface RunEventStepMetaData {
602
597
  * via the `definition` "StrategyStateDelta".
603
598
  */
604
599
  export interface StrategyStateDelta {
605
- strategyStateUpdate?: {
606
- [k: string]: ExecutionSocketMaterialized;
607
- };
608
- strategyStateUpdateWide?: Record<ExecutionIdentity, ExecutionSocket>;
600
+ strategyStateUpdate?: StrategyState;
609
601
  }
610
602
  /**
611
603
  * This interface was referenced by `GenesisJson`'s JSON-Schema
612
- * via the `definition` "StrategyRunContext".
604
+ * via the `definition` "StrategyState".
613
605
  */
614
- export interface StrategyRunContext {
606
+ export type StrategyState = Record<ExecutionIdentity, ExecutionSocket>;
607
+ /**
608
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
609
+ * via the `definition` "RunnableStrategyContext".
610
+ */
611
+ export interface RunnableStrategyContext {
615
612
  completedAt?: Timestamp;
616
613
  startedAt?: Timestamp;
617
- status: StrategyRunStatus;
614
+ status: RunnableStrategyStatus;
618
615
  }
619
616
  export interface StrategyThreadMapWrapper {
620
617
  strategyThreadMap: StrategyThreadMap;
@@ -627,11 +624,6 @@ export type StrategyThreadMap = Record<StrategyThreadIdentity, Step[]>;
627
624
  export interface StrategyStateWrapper {
628
625
  strategyState: StrategyState;
629
626
  }
630
- /**
631
- * This interface was referenced by `GenesisJson`'s JSON-Schema
632
- * via the `definition` "StrategyState".
633
- */
634
- export type StrategyState = Record<ExecutionIdentity, ExecutionSocket>;
635
627
  /**
636
628
  * This interface was referenced by `GenesisJson`'s JSON-Schema
637
629
  * via the `definition` "IdentityProp".
@@ -710,7 +702,7 @@ export interface RoleBindingsWrapper1 {
710
702
  export interface RunRecording {
711
703
  recordedAt?: Timestamp1;
712
704
  runEvents: RunEvent[];
713
- strategyRunRef?: string;
705
+ runnableStrategyRef?: string;
714
706
  strategyThreadRef?: string;
715
707
  }
716
708
  export interface Timestamp1 {
@@ -851,7 +843,7 @@ export type RunEvent =
851
843
  export type GraphStartRunEvent =
852
844
  RunEventBase & {
853
845
  kind?: "graph_start";
854
- strategyRunSeed: StrategyRun;
846
+ runnableStrategySeed: RunnableStrategy;
855
847
  };
856
848
  /**
857
849
  * This interface was referenced by `Normalized`'s JSON-Schema
@@ -859,6 +851,12 @@ export type GraphStartRunEvent =
859
851
  */
860
852
  export type RunEventKind =
861
853
  "graph_start" | "tick" | "interrupt" | "graph_end";
854
+ /**
855
+ * This interface was referenced by `Normalized`'s JSON-Schema
856
+ * via the `definition` "RunnableStrategyIdentity".
857
+ */
858
+ export type RunnableStrategyIdentity =
859
+ `RUNNABLE_STRATEGY-${string}`;
862
860
  /**
863
861
  * This interface was referenced by `Normalized`'s JSON-Schema
864
862
  * via the `definition` "ExecutionIdentity".
@@ -901,12 +899,6 @@ export type WhileStepIdentity =
901
899
  */
902
900
  export type ForStepIdentity =
903
901
  `FORSTEP-${string}`;
904
- /**
905
- * This interface was referenced by `Normalized`'s JSON-Schema
906
- * via the `definition` "StrategyRunIdentity".
907
- */
908
- export type StrategyRunIdentity =
909
- `STRATEGY_RUN-${string}`;
910
902
  /**
911
903
  * This interface was referenced by `Normalized`'s JSON-Schema
912
904
  * via the `definition` "StrategyThreadIdentity".
@@ -990,6 +982,50 @@ export type ForStep =
990
982
  identity: ForStepIdentity;
991
983
  kind: "for";
992
984
  } & StepKind;
985
+ /**
986
+ * This interface was referenced by `Normalized`'s JSON-Schema
987
+ * via the `definition` "ResourceMissing".
988
+ */
989
+ export type ResourceMissing =
990
+ {
991
+ } & ResourceBase &
992
+ ResourceKind & {
993
+ kind: "missing";
994
+ };
995
+ /**
996
+ * This interface was referenced by `Normalized`'s JSON-Schema
997
+ * via the `definition` "ResourceTypeIdentity".
998
+ */
999
+ export type ResourceTypeIdentity =
1000
+ `TYPE-${string}`;
1001
+ /**
1002
+ * This interface was referenced by `Normalized`'s JSON-Schema
1003
+ * via the `definition` "ResourcePotentialInput".
1004
+ */
1005
+ export type ResourcePotentialInput =
1006
+ {
1007
+ } & ResourceBase &
1008
+ CreationContextWrapper &
1009
+ ResourceKind & {
1010
+ kind: "potential-input";
1011
+ };
1012
+ /**
1013
+ * This interface was referenced by `Normalized`'s JSON-Schema
1014
+ * via the `definition` "ResourceRoleIdentity".
1015
+ */
1016
+ export type ResourceRoleIdentity =
1017
+ `ROLE-${string}`;
1018
+ /**
1019
+ * This interface was referenced by `Normalized`'s JSON-Schema
1020
+ * via the `definition` "ResourcePotentialOutput".
1021
+ */
1022
+ export type ResourcePotentialOutput =
1023
+ {
1024
+ } & ResourceBase &
1025
+ CreationContextWrapper &
1026
+ ResourceKind & {
1027
+ kind: "potential-output";
1028
+ };
993
1029
  /**
994
1030
  * This interface was referenced by `Normalized`'s JSON-Schema
995
1031
  * via the `definition` "Resource".
@@ -1012,18 +1048,6 @@ export type ResourceMetaBase =
1012
1048
  kind: "materialized";
1013
1049
  } & Timestamp1 &
1014
1050
  Path;
1015
- /**
1016
- * This interface was referenced by `Normalized`'s JSON-Schema
1017
- * via the `definition` "ResourceTypeIdentity".
1018
- */
1019
- export type ResourceTypeIdentity =
1020
- `TYPE-${string}`;
1021
- /**
1022
- * This interface was referenced by `Normalized`'s JSON-Schema
1023
- * via the `definition` "ResourceRoleIdentity".
1024
- */
1025
- export type ResourceRoleIdentity =
1026
- `ROLE-${string}`;
1027
1051
  /**
1028
1052
  * This interface was referenced by `Normalized`'s JSON-Schema
1029
1053
  * via the `definition` "JsonData".
@@ -1039,59 +1063,27 @@ export type JsonData =
1039
1063
  };
1040
1064
  /**
1041
1065
  * This interface was referenced by `Normalized`'s JSON-Schema
1042
- * via the `definition` "ResourceMissing".
1066
+ * via the `definition` "RunnableStrategy".
1043
1067
  */
1044
- export type ResourceMissing =
1068
+ export type RunnableStrategy =
1045
1069
  {
1046
- } & ResourceBase &
1047
- ResourceKind & {
1048
- kind: "missing";
1049
- };
1050
- /**
1051
- * This interface was referenced by `Normalized`'s JSON-Schema
1052
- * via the `definition` "ResourcePotentialInput".
1053
- */
1054
- export type ResourcePotentialInput =
1055
- {
1056
- } & ResourceBase &
1057
- CreationContextWrapper &
1058
- ResourceKind & {
1059
- kind: "potential-input";
1060
- };
1061
- /**
1062
- * This interface was referenced by `Normalized`'s JSON-Schema
1063
- * via the `definition` "ResourcePotentialOutput".
1064
- */
1065
- export type ResourcePotentialOutput =
1066
- {
1067
- } & ResourceBase &
1068
- CreationContextWrapper &
1069
- ResourceKind & {
1070
- kind: "potential-output";
1071
- };
1072
- /**
1073
- * This interface was referenced by `Normalized`'s JSON-Schema
1074
- * via the `definition` "StrategyRun".
1075
- */
1076
- export type StrategyRun =
1077
- {
1078
- identity: StrategyRunIdentity;
1070
+ identity: RunnableStrategyIdentity;
1071
+ runnableStrategyContext: RunnableStrategyContext;
1079
1072
  statefulStrategyRef: StatefulStrategyIdentity;
1080
- strategyRunContext: StrategyRunContext;
1081
1073
  } & StrategyThreadMapWrapper &
1082
1074
  StrategyStateWrapper;
1083
1075
  /**
1084
1076
  * This interface was referenced by `Normalized`'s JSON-Schema
1085
- * via the `definition` "StatefulStrategyIdentity".
1077
+ * via the `definition` "RunnableStrategyStatus".
1086
1078
  */
1087
- export type StatefulStrategyIdentity =
1088
- `STATEFUL_STRATEGY-${string}`;
1079
+ export type RunnableStrategyStatus =
1080
+ "pending" | "running" | "completed" | "failed" | "cancelled";
1089
1081
  /**
1090
1082
  * This interface was referenced by `Normalized`'s JSON-Schema
1091
- * via the `definition` "StrategyRunStatus".
1083
+ * via the `definition` "StatefulStrategyIdentity".
1092
1084
  */
1093
- export type StrategyRunStatus =
1094
- "pending" | "running" | "completed" | "failed" | "cancelled";
1085
+ export type StatefulStrategyIdentity =
1086
+ `STATEFUL_STRATEGY-${string}`;
1095
1087
  /**
1096
1088
  * This interface was referenced by `Normalized`'s JSON-Schema
1097
1089
  * via the `definition` "TickRunEvent".
@@ -1120,7 +1112,7 @@ export type GraphEndRunEvent =
1120
1112
  export interface Normalized {
1121
1113
  recordedAt?: Timestamp;
1122
1114
  runEvents: RunEvent[];
1123
- strategyRunRef?: string;
1115
+ runnableStrategyRef?: string;
1124
1116
  strategyThreadRef?: string;
1125
1117
  }
1126
1118
  export interface Timestamp {
@@ -1136,8 +1128,8 @@ export interface RunEventBase {
1136
1128
  eventSeq: number;
1137
1129
  kind: RunEventKind;
1138
1130
  nodeName: string;
1131
+ runnableStrategyRef: RunnableStrategyIdentity;
1139
1132
  stepMetaData?: RunEventStepMetaData;
1140
- strategyRunRef: StrategyRunIdentity;
1141
1133
  strategyThreadRef: StrategyThreadIdentity;
1142
1134
  updates?: RunEventUpdates;
1143
1135
  }
@@ -1203,16 +1195,18 @@ export interface Conditional {
1203
1195
  * via the `definition` "StrategyStateDelta".
1204
1196
  */
1205
1197
  export interface StrategyStateDelta {
1206
- strategyStateUpdate?: {
1207
- [k: string]: ExecutionSocketMaterialized;
1208
- };
1209
- strategyStateUpdateWide?: Record<ExecutionIdentity, ExecutionSocket>;
1198
+ strategyStateUpdate?: StrategyState;
1210
1199
  }
1211
1200
  /**
1212
1201
  * This interface was referenced by `Normalized`'s JSON-Schema
1213
- * via the `definition` "ExecutionSocketMaterialized".
1202
+ * via the `definition` "StrategyState".
1203
+ */
1204
+ export type StrategyState = Record<ExecutionIdentity, ExecutionSocket>;
1205
+ /**
1206
+ * This interface was referenced by `Normalized`'s JSON-Schema
1207
+ * via the `definition` "ExecutionSocket".
1214
1208
  */
1215
- export type ExecutionSocketMaterialized = Record<ResourceRoleIdentity, Resource>;
1209
+ export type ExecutionSocket = Record<ResourceRoleIdentity, ResourceMissing | ResourcePotentialInput | ResourcePotentialOutput | Resource>;
1216
1210
  /**
1217
1211
  * This interface was referenced by `Normalized`'s JSON-Schema
1218
1212
  * via the `definition` "ResourceBase".
@@ -1221,6 +1215,13 @@ export interface ResourceBase {
1221
1215
  identity: ResourceIdentity;
1222
1216
  resourceTypeRef: ResourceTypeIdentity;
1223
1217
  }
1218
+ /**
1219
+ * This interface was referenced by `Normalized`'s JSON-Schema
1220
+ * via the `definition` "ResourceKind".
1221
+ */
1222
+ export interface ResourceKind {
1223
+ kind: "missing" | "potential-input" | "potential-output" | "materialized";
1224
+ }
1224
1225
  /**
1225
1226
  * This interface was referenced by `Normalized`'s JSON-Schema
1226
1227
  * via the `definition` "CreationContextWrapper".
@@ -1236,13 +1237,6 @@ export interface CreationContext {
1236
1237
  executionRef: ExecutionIdentity;
1237
1238
  resourceRoleRef: ResourceRoleIdentity;
1238
1239
  }
1239
- /**
1240
- * This interface was referenced by `Normalized`'s JSON-Schema
1241
- * via the `definition` "ResourceKind".
1242
- */
1243
- export interface ResourceKind {
1244
- kind: "missing" | "potential-input" | "potential-output" | "materialized";
1245
- }
1246
1240
  /**
1247
1241
  * This interface was referenced by `Normalized`'s JSON-Schema
1248
1242
  * via the `definition` "Path".
@@ -1252,17 +1246,12 @@ export interface Path {
1252
1246
  }
1253
1247
  /**
1254
1248
  * This interface was referenced by `Normalized`'s JSON-Schema
1255
- * via the `definition` "ExecutionSocket".
1256
- */
1257
- export type ExecutionSocket = Record<ResourceRoleIdentity, ResourceMissing | ResourcePotentialInput | ResourcePotentialOutput | Resource>;
1258
- /**
1259
- * This interface was referenced by `Normalized`'s JSON-Schema
1260
- * via the `definition` "StrategyRunContext".
1249
+ * via the `definition` "RunnableStrategyContext".
1261
1250
  */
1262
- export interface StrategyRunContext {
1251
+ export interface RunnableStrategyContext {
1263
1252
  completedAt?: Timestamp1;
1264
1253
  startedAt?: Timestamp1;
1265
- status: StrategyRunStatus;
1254
+ status: RunnableStrategyStatus;
1266
1255
  }
1267
1256
  export interface StrategyThreadMapWrapper {
1268
1257
  strategyThreadMap: StrategyThreadMap;
@@ -1275,11 +1264,6 @@ export type StrategyThreadMap = Record<StrategyThreadIdentity, Step[]>;
1275
1264
  export interface StrategyStateWrapper {
1276
1265
  strategyState: StrategyState;
1277
1266
  }
1278
- /**
1279
- * This interface was referenced by `Normalized`'s JSON-Schema
1280
- * via the `definition` "StrategyState".
1281
- */
1282
- export type StrategyState = Record<ExecutionIdentity, ExecutionSocket>;
1283
1267
  /**
1284
1268
  * This interface was referenced by `Normalized`'s JSON-Schema
1285
1269
  * via the `definition` "StrategyThreadMapWrapper".
@@ -1302,6 +1286,165 @@ export interface RoleBindingsWrapper1 {
1302
1286
  roleBindings: RoleBindings;
1303
1287
  }
1304
1288
 
1289
+ export type Normalized =
1290
+ {
1291
+ identity: RunnableStrategyIdentity;
1292
+ runnableStrategyContext: RunnableStrategyContext;
1293
+ statefulStrategyRef: StatefulStrategyIdentity;
1294
+ } & StrategyThreadMapWrapper &
1295
+ StrategyStateWrapper;
1296
+ export type RunnableStrategyIdentity =
1297
+ `RUNNABLE_STRATEGY-${string}`;
1298
+ export type RunnableStrategyStatus =
1299
+ "pending" | "running" | "completed" | "failed" | "cancelled";
1300
+ export type StatefulStrategyIdentity =
1301
+ `STATEFUL_STRATEGY-${string}`;
1302
+ export type Step =
1303
+ WorkStep | BranchStep | WhileStep | ForStep;
1304
+ export type WorkStep =
1305
+ {
1306
+ execution: Execution;
1307
+ identity: WorkStepIdentity;
1308
+ kind: "work";
1309
+ } & StepKind;
1310
+ export type Execution =
1311
+ {
1312
+ identity: ExecutionIdentity;
1313
+ jobRef: JobIdentity;
1314
+ } & RoleBindingsWrapper;
1315
+ export type ExecutionIdentity =
1316
+ `EXECUTION-${string}`;
1317
+ export type JobIdentity =
1318
+ `JOB-${string}`;
1319
+ export type ResourceIdentity =
1320
+ `RESOURCE-${string}`;
1321
+ export type WorkStepIdentity =
1322
+ `WORKSTEP-${string}`;
1323
+ export type BranchStep =
1324
+ {
1325
+ /**
1326
+ * @minItems 1
1327
+ */
1328
+ cases: [Conditional, ...Conditional[]];
1329
+ identity: BranchStepIdentity;
1330
+ kind: "branch";
1331
+ } & StepKind;
1332
+ export type BranchStepIdentity =
1333
+ `BRANCHSTEP-${string}`;
1334
+ export type WhileStep =
1335
+ {
1336
+ case: Conditional;
1337
+ identity: WhileStepIdentity;
1338
+ kind: "while";
1339
+ } & StepKind;
1340
+ export type WhileStepIdentity =
1341
+ `WHILESTEP-${string}`;
1342
+ export type ForStep =
1343
+ {
1344
+ case: Conditional;
1345
+ identity: ForStepIdentity;
1346
+ kind: "for";
1347
+ } & StepKind;
1348
+ export type ForStepIdentity =
1349
+ `FORSTEP-${string}`;
1350
+ export type ResourceMissing =
1351
+ {
1352
+ } & ResourceBase &
1353
+ ResourceKind & {
1354
+ kind: "missing";
1355
+ };
1356
+ export type ResourceTypeIdentity =
1357
+ `TYPE-${string}`;
1358
+ export type ResourcePotentialInput =
1359
+ {
1360
+ } & ResourceBase &
1361
+ CreationContextWrapper &
1362
+ ResourceKind & {
1363
+ kind: "potential-input";
1364
+ };
1365
+ export type ResourceRoleIdentity =
1366
+ `ROLE-${string}`;
1367
+ export type ResourcePotentialOutput =
1368
+ {
1369
+ } & ResourceBase &
1370
+ CreationContextWrapper &
1371
+ ResourceKind & {
1372
+ kind: "potential-output";
1373
+ };
1374
+ export type Resource =
1375
+ {
1376
+ } & ResourceMetaBase & {
1377
+ extractedData: {
1378
+ [k: string]: JsonData;
1379
+ };
1380
+ };
1381
+ export type ResourceMetaBase =
1382
+ ResourceBase &
1383
+ CreationContextWrapper &
1384
+ ResourceKind & {
1385
+ kind: "materialized";
1386
+ } & Timestamp &
1387
+ Path;
1388
+ export type JsonData =
1389
+ | null
1390
+ | boolean
1391
+ | number
1392
+ | string
1393
+ | JsonData
1394
+ | {
1395
+ [k: string]: JsonData;
1396
+ };
1397
+
1398
+ export interface RunnableStrategyContext {
1399
+ completedAt?: Timestamp;
1400
+ startedAt?: Timestamp;
1401
+ status: RunnableStrategyStatus;
1402
+ }
1403
+ export interface Timestamp {
1404
+ timestamp: string;
1405
+ }
1406
+ export interface StrategyThreadMapWrapper {
1407
+ strategyThreadMap: StrategyThreadMap;
1408
+ }
1409
+ export type StrategyThreadMap = Record<StrategyThreadIdentity, Step[]>;
1410
+ export interface RoleBindingsWrapper {
1411
+ roleBindings: RoleBindings;
1412
+ }
1413
+ export interface RoleBindings {
1414
+ inputBindingMap: RoleBindingMap;
1415
+ outputBindingMap: RoleBindingMap;
1416
+ }
1417
+ export type RoleBindingMap = Record<ResourceRoleIdentity, ResourceIdentity>;
1418
+ export interface StepKind {
1419
+ kind: "work" | "branch" | "while" | "for";
1420
+ }
1421
+ export interface Conditional {
1422
+ what: WorkStep;
1423
+ when: WorkStep;
1424
+ }
1425
+ export interface StrategyStateWrapper {
1426
+ strategyState: StrategyState;
1427
+ }
1428
+ export type StrategyState = Record<ExecutionIdentity, ExecutionSocket>;
1429
+ export type ExecutionSocket = Record<ResourceRoleIdentity, ResourceMissing | ResourcePotentialInput | ResourcePotentialOutput | Resource>;
1430
+ export interface ResourceBase {
1431
+ identity: ResourceIdentity;
1432
+ resourceTypeRef: ResourceTypeIdentity;
1433
+ }
1434
+ export interface ResourceKind {
1435
+ kind: "missing" | "potential-input" | "potential-output" | "materialized";
1436
+ }
1437
+ export interface CreationContextWrapper {
1438
+ creationContext: CreationContext;
1439
+ }
1440
+ export interface CreationContext {
1441
+ executionRef: ExecutionIdentity;
1442
+ resourceRoleRef: ResourceRoleIdentity;
1443
+ }
1444
+ export interface Path {
1445
+ path: string;
1446
+ }
1447
+
1305
1448
  export type Normalized =
1306
1449
  {
1307
1450
  identity: StatefulStrategyIdentity;
@@ -1611,162 +1754,3 @@ export interface RoleBindingsWrapper1 {
1611
1754
  roleBindings: RoleBindings;
1612
1755
  }
1613
1756
 
1614
- export type Normalized =
1615
- {
1616
- identity: StrategyRunIdentity;
1617
- statefulStrategyRef: StatefulStrategyIdentity;
1618
- strategyRunContext: StrategyRunContext;
1619
- } & StrategyThreadMapWrapper &
1620
- StrategyStateWrapper;
1621
- export type StrategyRunIdentity =
1622
- `STRATEGY_RUN-${string}`;
1623
- export type StatefulStrategyIdentity =
1624
- `STATEFUL_STRATEGY-${string}`;
1625
- export type StrategyRunStatus =
1626
- "pending" | "running" | "completed" | "failed" | "cancelled";
1627
- export type Step =
1628
- WorkStep | BranchStep | WhileStep | ForStep;
1629
- export type WorkStep =
1630
- {
1631
- execution: Execution;
1632
- identity: WorkStepIdentity;
1633
- kind: "work";
1634
- } & StepKind;
1635
- export type Execution =
1636
- {
1637
- identity: ExecutionIdentity;
1638
- jobRef: JobIdentity;
1639
- } & RoleBindingsWrapper;
1640
- export type ExecutionIdentity =
1641
- `EXECUTION-${string}`;
1642
- export type JobIdentity =
1643
- `JOB-${string}`;
1644
- export type ResourceIdentity =
1645
- `RESOURCE-${string}`;
1646
- export type WorkStepIdentity =
1647
- `WORKSTEP-${string}`;
1648
- export type BranchStep =
1649
- {
1650
- /**
1651
- * @minItems 1
1652
- */
1653
- cases: [Conditional, ...Conditional[]];
1654
- identity: BranchStepIdentity;
1655
- kind: "branch";
1656
- } & StepKind;
1657
- export type BranchStepIdentity =
1658
- `BRANCHSTEP-${string}`;
1659
- export type WhileStep =
1660
- {
1661
- case: Conditional;
1662
- identity: WhileStepIdentity;
1663
- kind: "while";
1664
- } & StepKind;
1665
- export type WhileStepIdentity =
1666
- `WHILESTEP-${string}`;
1667
- export type ForStep =
1668
- {
1669
- case: Conditional;
1670
- identity: ForStepIdentity;
1671
- kind: "for";
1672
- } & StepKind;
1673
- export type ForStepIdentity =
1674
- `FORSTEP-${string}`;
1675
- export type ResourceMissing =
1676
- {
1677
- } & ResourceBase &
1678
- ResourceKind & {
1679
- kind: "missing";
1680
- };
1681
- export type ResourceTypeIdentity =
1682
- `TYPE-${string}`;
1683
- export type ResourcePotentialInput =
1684
- {
1685
- } & ResourceBase &
1686
- CreationContextWrapper &
1687
- ResourceKind & {
1688
- kind: "potential-input";
1689
- };
1690
- export type ResourceRoleIdentity =
1691
- `ROLE-${string}`;
1692
- export type ResourcePotentialOutput =
1693
- {
1694
- } & ResourceBase &
1695
- CreationContextWrapper &
1696
- ResourceKind & {
1697
- kind: "potential-output";
1698
- };
1699
- export type Resource =
1700
- {
1701
- } & ResourceMetaBase & {
1702
- extractedData: {
1703
- [k: string]: JsonData;
1704
- };
1705
- };
1706
- export type ResourceMetaBase =
1707
- ResourceBase &
1708
- CreationContextWrapper &
1709
- ResourceKind & {
1710
- kind: "materialized";
1711
- } & Timestamp &
1712
- Path;
1713
- export type JsonData =
1714
- | null
1715
- | boolean
1716
- | number
1717
- | string
1718
- | JsonData
1719
- | {
1720
- [k: string]: JsonData;
1721
- };
1722
-
1723
- export interface StrategyRunContext {
1724
- completedAt?: Timestamp;
1725
- startedAt?: Timestamp;
1726
- status: StrategyRunStatus;
1727
- }
1728
- export interface Timestamp {
1729
- timestamp: string;
1730
- }
1731
- export interface StrategyThreadMapWrapper {
1732
- strategyThreadMap: StrategyThreadMap;
1733
- }
1734
- export type StrategyThreadMap = Record<StrategyThreadIdentity, Step[]>;
1735
- export interface RoleBindingsWrapper {
1736
- roleBindings: RoleBindings;
1737
- }
1738
- export interface RoleBindings {
1739
- inputBindingMap: RoleBindingMap;
1740
- outputBindingMap: RoleBindingMap;
1741
- }
1742
- export type RoleBindingMap = Record<ResourceRoleIdentity, ResourceIdentity>;
1743
- export interface StepKind {
1744
- kind: "work" | "branch" | "while" | "for";
1745
- }
1746
- export interface Conditional {
1747
- what: WorkStep;
1748
- when: WorkStep;
1749
- }
1750
- export interface StrategyStateWrapper {
1751
- strategyState: StrategyState;
1752
- }
1753
- export type StrategyState = Record<ExecutionIdentity, ExecutionSocket>;
1754
- export type ExecutionSocket = Record<ResourceRoleIdentity, ResourceMissing | ResourcePotentialInput | ResourcePotentialOutput | Resource>;
1755
- export interface ResourceBase {
1756
- identity: ResourceIdentity;
1757
- resourceTypeRef: ResourceTypeIdentity;
1758
- }
1759
- export interface ResourceKind {
1760
- kind: "missing" | "potential-input" | "potential-output" | "materialized";
1761
- }
1762
- export interface CreationContextWrapper {
1763
- creationContext: CreationContext;
1764
- }
1765
- export interface CreationContext {
1766
- executionRef: ExecutionIdentity;
1767
- resourceRoleRef: ResourceRoleIdentity;
1768
- }
1769
- export interface Path {
1770
- path: string;
1771
- }
1772
-