@toolproof-npm/schema 0.1.81 → 0.1.82

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.
@@ -31,7 +31,6 @@
31
31
  "required": [
32
32
  "statelessStrategy"
33
33
  ],
34
- "unevaluatedProperties": false,
35
34
  "$anchor": "StatelessStrategyWrapper"
36
35
  },
37
36
  "StrategyStateWrapper": {
@@ -45,7 +44,6 @@
45
44
  "required": [
46
45
  "strategyState"
47
46
  ],
48
- "unevaluatedProperties": false,
49
47
  "$anchor": "StrategyStateWrapper"
50
48
  },
51
49
  "StatefulStrategyIdentity": {
@@ -41,7 +41,6 @@
41
41
  "required": [
42
42
  "strategyThreadMap"
43
43
  ],
44
- "unevaluatedProperties": false,
45
44
  "$anchor": "StrategyThreadMapWrapper"
46
45
  },
47
46
  "StrategyStateWrapper": {
@@ -55,7 +54,6 @@
55
54
  "required": [
56
55
  "strategyState"
57
56
  ],
58
- "unevaluatedProperties": false,
59
57
  "$anchor": "StrategyStateWrapper"
60
58
  },
61
59
  "StrategyRunIdentity": {
@@ -5,5 +5,6 @@
5
5
  "ResourceMeta",
6
6
  "Job",
7
7
  "StatefulStrategy",
8
- "StrategyRunUpdate"
8
+ "StrategyRunUpdate",
9
+ "RunRecording"
9
10
  ]
@@ -838,6 +838,470 @@ export interface ExtractionSchemaWrapper {
838
838
  extractionSchema: ExtractionSchema;
839
839
  }
840
840
 
841
+ /**
842
+ * This interface was referenced by `Normalized`'s JSON-Schema
843
+ * via the `definition` "RunEvent".
844
+ */
845
+ export type RunEvent =
846
+ GraphStartRunEvent | TickRunEvent | InterruptRunEvent | GraphEndRunEvent;
847
+ /**
848
+ * This interface was referenced by `Normalized`'s JSON-Schema
849
+ * via the `definition` "GraphStartRunEvent".
850
+ */
851
+ export type GraphStartRunEvent =
852
+ RunEventBase & {
853
+ kind?: "graph_start";
854
+ strategyRunSeed: StrategyRun;
855
+ };
856
+ /**
857
+ * This interface was referenced by `Normalized`'s JSON-Schema
858
+ * via the `definition` "RunEventKind".
859
+ */
860
+ export type RunEventKind =
861
+ "graph_start" | "tick" | "interrupt" | "graph_end";
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` "StrategyRunIdentity".
907
+ */
908
+ export type StrategyRunIdentity =
909
+ `STRATEGY_RUN-${string}`;
910
+ /**
911
+ * This interface was referenced by `Normalized`'s JSON-Schema
912
+ * via the `definition` "StrategyThreadIdentity".
913
+ */
914
+ export type StrategyThreadIdentity =
915
+ `STRATEGY_THREAD-${string}`;
916
+ /**
917
+ * This interface was referenced by `Normalized`'s JSON-Schema
918
+ * via the `definition` "RunEventUpdates".
919
+ */
920
+ export type RunEventUpdates =
921
+ {
922
+ interruptData?: {
923
+ } | null;
924
+ stepsMutation?: {
925
+ insertAt: number;
926
+ inserted: Step[];
927
+ };
928
+ } & StrategyStateDelta;
929
+ /**
930
+ * This interface was referenced by `Normalized`'s JSON-Schema
931
+ * via the `definition` "Step".
932
+ */
933
+ export type Step =
934
+ WorkStep | BranchStep | WhileStep | ForStep;
935
+ /**
936
+ * This interface was referenced by `Normalized`'s JSON-Schema
937
+ * via the `definition` "WorkStep".
938
+ */
939
+ export type WorkStep =
940
+ {
941
+ execution: Execution;
942
+ identity: WorkStepIdentity;
943
+ kind: "work";
944
+ } & StepKind;
945
+ /**
946
+ * This interface was referenced by `Normalized`'s JSON-Schema
947
+ * via the `definition` "Execution".
948
+ */
949
+ export type Execution =
950
+ {
951
+ identity: ExecutionIdentity;
952
+ jobRef: JobIdentity;
953
+ } & RoleBindingsWrapper;
954
+ /**
955
+ * This interface was referenced by `Normalized`'s JSON-Schema
956
+ * via the `definition` "ResourceIdentity".
957
+ */
958
+ export type ResourceIdentity =
959
+ `RESOURCE-${string}`;
960
+ /**
961
+ * This interface was referenced by `Normalized`'s JSON-Schema
962
+ * via the `definition` "BranchStep".
963
+ */
964
+ export type BranchStep =
965
+ {
966
+ /**
967
+ * @minItems 1
968
+ */
969
+ cases: [Conditional, ...Conditional[]];
970
+ identity: BranchStepIdentity;
971
+ kind: "branch";
972
+ } & StepKind;
973
+ /**
974
+ * This interface was referenced by `Normalized`'s JSON-Schema
975
+ * via the `definition` "WhileStep".
976
+ */
977
+ export type WhileStep =
978
+ {
979
+ case: Conditional;
980
+ identity: WhileStepIdentity;
981
+ kind: "while";
982
+ } & StepKind;
983
+ /**
984
+ * This interface was referenced by `Normalized`'s JSON-Schema
985
+ * via the `definition` "ForStep".
986
+ */
987
+ export type ForStep =
988
+ {
989
+ case: Conditional;
990
+ identity: ForStepIdentity;
991
+ kind: "for";
992
+ } & StepKind;
993
+ /**
994
+ * This interface was referenced by `Normalized`'s JSON-Schema
995
+ * via the `definition` "Resource".
996
+ */
997
+ export type Resource =
998
+ {
999
+ } & ResourceMetaBase & {
1000
+ extractedData: {
1001
+ [k: string]: JsonData;
1002
+ };
1003
+ };
1004
+ /**
1005
+ * This interface was referenced by `Normalized`'s JSON-Schema
1006
+ * via the `definition` "ResourceMetaBase".
1007
+ */
1008
+ export type ResourceMetaBase =
1009
+ ResourceBase &
1010
+ CreationContextWrapper &
1011
+ ResourceKind & {
1012
+ kind: "materialized";
1013
+ } & Timestamp1 &
1014
+ 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
+ /**
1028
+ * This interface was referenced by `Normalized`'s JSON-Schema
1029
+ * via the `definition` "JsonData".
1030
+ */
1031
+ export type JsonData =
1032
+ | null
1033
+ | boolean
1034
+ | number
1035
+ | string
1036
+ | JsonData
1037
+ | {
1038
+ [k: string]: JsonData;
1039
+ };
1040
+ /**
1041
+ * This interface was referenced by `Normalized`'s JSON-Schema
1042
+ * via the `definition` "ResourceMissing".
1043
+ */
1044
+ export type ResourceMissing =
1045
+ {
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;
1079
+ statefulStrategyRef: StatefulStrategyIdentity;
1080
+ strategyRunContext: StrategyRunContext;
1081
+ } & StrategyThreadMapWrapper &
1082
+ StrategyStateWrapper;
1083
+ /**
1084
+ * This interface was referenced by `Normalized`'s JSON-Schema
1085
+ * via the `definition` "StatefulStrategyIdentity".
1086
+ */
1087
+ export type StatefulStrategyIdentity =
1088
+ `STATEFUL_STRATEGY-${string}`;
1089
+ /**
1090
+ * This interface was referenced by `Normalized`'s JSON-Schema
1091
+ * via the `definition` "StrategyRunStatus".
1092
+ */
1093
+ export type StrategyRunStatus =
1094
+ "pending" | "running" | "completed" | "failed" | "cancelled";
1095
+ /**
1096
+ * This interface was referenced by `Normalized`'s JSON-Schema
1097
+ * via the `definition` "TickRunEvent".
1098
+ */
1099
+ export type TickRunEvent =
1100
+ RunEventBase & {
1101
+ kind?: "tick";
1102
+ };
1103
+ /**
1104
+ * This interface was referenced by `Normalized`'s JSON-Schema
1105
+ * via the `definition` "InterruptRunEvent".
1106
+ */
1107
+ export type InterruptRunEvent =
1108
+ RunEventBase & {
1109
+ kind?: "interrupt";
1110
+ };
1111
+ /**
1112
+ * This interface was referenced by `Normalized`'s JSON-Schema
1113
+ * via the `definition` "GraphEndRunEvent".
1114
+ */
1115
+ export type GraphEndRunEvent =
1116
+ RunEventBase & {
1117
+ kind?: "graph_end";
1118
+ };
1119
+
1120
+ export interface Normalized {
1121
+ recordedAt?: Timestamp;
1122
+ runEvents: RunEvent[];
1123
+ strategyRunRef?: string;
1124
+ strategyThreadRef?: string;
1125
+ }
1126
+ export interface Timestamp {
1127
+ timestamp: string;
1128
+ }
1129
+ /**
1130
+ * This interface was referenced by `Normalized`'s JSON-Schema
1131
+ * via the `definition` "RunEventBase".
1132
+ */
1133
+ export interface RunEventBase {
1134
+ counters?: RunEventCounters;
1135
+ createdAt: Timestamp1;
1136
+ eventSeq: number;
1137
+ kind: RunEventKind;
1138
+ nodeName: string;
1139
+ stepMetaData?: RunEventStepMetaData;
1140
+ strategyRunRef: StrategyRunIdentity;
1141
+ strategyThreadRef: StrategyThreadIdentity;
1142
+ updates?: RunEventUpdates;
1143
+ }
1144
+ /**
1145
+ * This interface was referenced by `Normalized`'s JSON-Schema
1146
+ * via the `definition` "RunEventCounters".
1147
+ */
1148
+ export interface RunEventCounters {
1149
+ iterationCounterAfter?: number;
1150
+ stepCounterAfter?: number;
1151
+ }
1152
+ /**
1153
+ * This interface was referenced by `Normalized`'s JSON-Schema
1154
+ * via the `definition` "Timestamp".
1155
+ */
1156
+ export interface Timestamp1 {
1157
+ timestamp: string;
1158
+ }
1159
+ /**
1160
+ * This interface was referenced by `Normalized`'s JSON-Schema
1161
+ * via the `definition` "RunEventStepMetaData".
1162
+ */
1163
+ export interface RunEventStepMetaData {
1164
+ executionRef?: ExecutionIdentity;
1165
+ jobRef?: JobIdentity;
1166
+ stepKind: RunEventStepKind;
1167
+ stepRef: WorkStepIdentity | BranchStepIdentity | WhileStepIdentity | ForStepIdentity;
1168
+ threadStepIndex: number;
1169
+ }
1170
+ export interface RoleBindingsWrapper {
1171
+ roleBindings: RoleBindings;
1172
+ }
1173
+ /**
1174
+ * This interface was referenced by `Normalized`'s JSON-Schema
1175
+ * via the `definition` "RoleBindings".
1176
+ */
1177
+ export interface RoleBindings {
1178
+ inputBindingMap: RoleBindingMap;
1179
+ outputBindingMap: RoleBindingMap;
1180
+ }
1181
+ /**
1182
+ * This interface was referenced by `Normalized`'s JSON-Schema
1183
+ * via the `definition` "RoleBindingMap".
1184
+ */
1185
+ export type RoleBindingMap = Record<ResourceRoleIdentity, ResourceIdentity>;
1186
+ /**
1187
+ * This interface was referenced by `Normalized`'s JSON-Schema
1188
+ * via the `definition` "StepKind".
1189
+ */
1190
+ export interface StepKind {
1191
+ kind: "work" | "branch" | "while" | "for";
1192
+ }
1193
+ /**
1194
+ * This interface was referenced by `Normalized`'s JSON-Schema
1195
+ * via the `definition` "Conditional".
1196
+ */
1197
+ export interface Conditional {
1198
+ what: WorkStep;
1199
+ when: WorkStep;
1200
+ }
1201
+ /**
1202
+ * This interface was referenced by `Normalized`'s JSON-Schema
1203
+ * via the `definition` "StrategyStateDelta".
1204
+ */
1205
+ export interface StrategyStateDelta {
1206
+ strategyStateUpdate?: {
1207
+ [k: string]: ExecutionSocketMaterialized;
1208
+ };
1209
+ strategyStateUpdateWide?: Record<ExecutionIdentity, ExecutionSocket>;
1210
+ }
1211
+ /**
1212
+ * This interface was referenced by `Normalized`'s JSON-Schema
1213
+ * via the `definition` "ExecutionSocketMaterialized".
1214
+ */
1215
+ export type ExecutionSocketMaterialized = Record<ResourceRoleIdentity, Resource>;
1216
+ /**
1217
+ * This interface was referenced by `Normalized`'s JSON-Schema
1218
+ * via the `definition` "ResourceBase".
1219
+ */
1220
+ export interface ResourceBase {
1221
+ identity: ResourceIdentity;
1222
+ resourceTypeRef: ResourceTypeIdentity;
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` "ResourceKind".
1242
+ */
1243
+ export interface ResourceKind {
1244
+ kind: "missing" | "potential-input" | "potential-output" | "materialized";
1245
+ }
1246
+ /**
1247
+ * This interface was referenced by `Normalized`'s JSON-Schema
1248
+ * via the `definition` "Path".
1249
+ */
1250
+ export interface Path {
1251
+ path: string;
1252
+ }
1253
+ /**
1254
+ * 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".
1261
+ */
1262
+ export interface StrategyRunContext {
1263
+ completedAt?: Timestamp1;
1264
+ startedAt?: Timestamp1;
1265
+ status: StrategyRunStatus;
1266
+ }
1267
+ export interface StrategyThreadMapWrapper {
1268
+ strategyThreadMap: StrategyThreadMap;
1269
+ }
1270
+ /**
1271
+ * This interface was referenced by `Normalized`'s JSON-Schema
1272
+ * via the `definition` "StrategyThreadMap".
1273
+ */
1274
+ export type StrategyThreadMap = Record<StrategyThreadIdentity, Step[]>;
1275
+ export interface StrategyStateWrapper {
1276
+ strategyState: StrategyState;
1277
+ }
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
+ /**
1284
+ * This interface was referenced by `Normalized`'s JSON-Schema
1285
+ * via the `definition` "StrategyThreadMapWrapper".
1286
+ */
1287
+ export interface StrategyThreadMapWrapper1 {
1288
+ strategyThreadMap: StrategyThreadMap;
1289
+ }
1290
+ /**
1291
+ * This interface was referenced by `Normalized`'s JSON-Schema
1292
+ * via the `definition` "StrategyStateWrapper".
1293
+ */
1294
+ export interface StrategyStateWrapper1 {
1295
+ strategyState: StrategyState;
1296
+ }
1297
+ /**
1298
+ * This interface was referenced by `Normalized`'s JSON-Schema
1299
+ * via the `definition` "RoleBindingsWrapper".
1300
+ */
1301
+ export interface RoleBindingsWrapper1 {
1302
+ roleBindings: RoleBindings;
1303
+ }
1304
+
841
1305
  export type Normalized =
842
1306
  {
843
1307
  identity: StatefulStrategyIdentity;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { WorkStepIdentity, BranchStepIdentity, WhileStepIdentity, ForStepIdentity } from './genesis/generated/types/types.js';
2
2
  export { default as SchemaGenesis } from './genesis/generated/schemas/Genesis.js';
3
3
  export { default as SchemaJob } from './genesis/generated/schemas/Job.js';
4
+ export { default as SchemaRunRecording } from './genesis/generated/schemas/RunRecording.js';
4
5
  export { default as ResourceTypeGenesis } from './genesis/generated/resource-type-envelopes/Genesis.js';
5
6
  export { default as dependencies } from './genesis/generated/dependencies_ordered.json';
6
7
  export { default as terminals } from './genesis/generated/terminals.json';
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // Re-export JSON schemas via .ts shims to avoid .json re-exports in declarations
2
2
  export { default as SchemaGenesis } from './genesis/generated/schemas/Genesis.js';
3
3
  export { default as SchemaJob } from './genesis/generated/schemas/Job.js';
4
+ export { default as SchemaRunRecording } from './genesis/generated/schemas/RunRecording.js';
4
5
  export { default as ResourceTypeGenesis } from './genesis/generated/resource-type-envelopes/Genesis.js';
5
6
  export { default as dependencies } from './genesis/generated/dependencies_ordered.json';
6
7
  export { default as terminals } from './genesis/generated/terminals.json';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolproof-npm/schema",
3
- "version": "0.1.81",
3
+ "version": "0.1.82",
4
4
  "description": "JSON schemas and TypeScript types for ToolProof",
5
5
  "keywords": [
6
6
  "toolproof",
@@ -60,6 +60,6 @@
60
60
  "generateDependencies": "node ./dist/scripts/generateDependencies.js",
61
61
  "generateDependenciesOrdered": "node ./dist/scripts/generateDependenciesOrdered.js",
62
62
  "generateTerminals": "node ./dist/scripts/generateTerminals.js",
63
- "update": "rimraf /s /q dist && pnpm run build:scripts && pnpm run rewriteAnchors && pnpm run generateResourceEnvelopes && pnpm run extractSchemas && pnpm run extractSubschema -- --name Job && pnpm run extractSubschema -- --name ResourceFormat && pnpm run extractSubschema -- --name ResourceType && pnpm run extractSubschema -- --name StatelessStrategy && pnpm run extractSubschema -- --name StatefulStrategy && pnpm run extractSubschema -- --name StrategyRun && pnpm run generateSchemaShims && pnpm run generateTypes && pnpm run generateResourceTypeType -- --name Job && pnpm run generateResourceTypeType -- --name ResourceFormat && pnpm run generateResourceTypeType -- --name ResourceType && pnpm run generateResourceTypeType -- --name StatelessStrategy && pnpm run generateResourceTypeType -- --name StatefulStrategy && pnpm run generateResourceTypeType -- --name StrategyRun && pnpm run generateResourceTypeGenesisType && pnpm run build && pnpm run generateDependencies && pnpm run generateDependenciesOrdered && pnpm run generateTerminals"
63
+ "update": "rimraf /s /q dist && pnpm run build:scripts && pnpm run rewriteAnchors && pnpm run generateResourceEnvelopes && pnpm run extractSchemas && pnpm run extractSubschema -- --name Job && pnpm run extractSubschema -- --name ResourceFormat && pnpm run extractSubschema -- --name ResourceType && pnpm run extractSubschema -- --name StatelessStrategy && pnpm run extractSubschema -- --name StatefulStrategy && pnpm run extractSubschema -- --name StrategyRun && pnpm run extractSubschema -- --name RunRecording && pnpm run generateSchemaShims && pnpm run generateTypes && pnpm run generateResourceTypeType -- --name Job && pnpm run generateResourceTypeType -- --name ResourceFormat && pnpm run generateResourceTypeType -- --name ResourceType && pnpm run generateResourceTypeType -- --name StatelessStrategy && pnpm run generateResourceTypeType -- --name StatefulStrategy && pnpm run generateResourceTypeType -- --name StrategyRun && pnpm run generateResourceTypeGenesisType && pnpm run build && pnpm run generateDependencies && pnpm run generateDependenciesOrdered && pnpm run generateTerminals"
64
64
  }
65
65
  }