@toolproof-npm/schema 0.1.79 → 0.1.81

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.
@@ -190,6 +190,105 @@ export type ForStep =
190
190
  */
191
191
  export type ForStepIdentity =
192
192
  `FORSTEP-${string}`;
193
+ /**
194
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
195
+ * via the `definition` "GraphEndRunEvent".
196
+ */
197
+ export type GraphEndRunEvent =
198
+ RunEventBase & {
199
+ kind?: "graph_end";
200
+ };
201
+ /**
202
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
203
+ * via the `definition` "RunEventKind".
204
+ */
205
+ export type RunEventKind =
206
+ "graph_start" | "tick" | "interrupt" | "graph_end";
207
+ /**
208
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
209
+ * via the `definition` "RunEventStepKind".
210
+ */
211
+ export type RunEventStepKind =
212
+ "work" | "branch" | "while" | "for";
213
+ /**
214
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
215
+ * via the `definition` "WhileStepIdentity".
216
+ */
217
+ export type WhileStepIdentity =
218
+ `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
+ /**
226
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
227
+ * via the `definition` "StrategyThreadIdentity".
228
+ */
229
+ export type StrategyThreadIdentity =
230
+ `STRATEGY_THREAD-${string}`;
231
+ /**
232
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
233
+ * via the `definition` "RunEventUpdates".
234
+ */
235
+ export type RunEventUpdates =
236
+ {
237
+ interruptData?: {
238
+ } | null;
239
+ stepsMutation?: {
240
+ insertAt: number;
241
+ inserted: Step[];
242
+ };
243
+ } & StrategyStateDelta;
244
+ /**
245
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
246
+ * via the `definition` "Step".
247
+ */
248
+ export type Step =
249
+ WorkStep | BranchStep | WhileStep | ForStep;
250
+ /**
251
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
252
+ * via the `definition` "WhileStep".
253
+ */
254
+ export type WhileStep =
255
+ {
256
+ case: Conditional;
257
+ identity: WhileStepIdentity;
258
+ kind: "while";
259
+ } & StepKind;
260
+ /**
261
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
262
+ * via the `definition` "GraphStartRunEvent".
263
+ */
264
+ export type GraphStartRunEvent =
265
+ RunEventBase & {
266
+ kind?: "graph_start";
267
+ strategyRunSeed: StrategyRun;
268
+ };
269
+ /**
270
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
271
+ * via the `definition` "StrategyRun".
272
+ */
273
+ export type StrategyRun =
274
+ {
275
+ identity: StrategyRunIdentity;
276
+ statefulStrategyRef: StatefulStrategyIdentity;
277
+ strategyRunContext: StrategyRunContext;
278
+ } & StrategyThreadMapWrapper &
279
+ StrategyStateWrapper;
280
+ /**
281
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
282
+ * via the `definition` "StatefulStrategyIdentity".
283
+ */
284
+ export type StatefulStrategyIdentity =
285
+ `STATEFUL_STRATEGY-${string}`;
286
+ /**
287
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
288
+ * via the `definition` "StrategyRunStatus".
289
+ */
290
+ export type StrategyRunStatus =
291
+ "pending" | "running" | "completed" | "failed" | "cancelled";
193
292
  /**
194
293
  * This interface was referenced by `undefined`'s JSON-Schema definition
195
294
  * via the `patternProperty` "^[A-Za-z][A-Za-z0-9._-]*Identity$".
@@ -213,6 +312,14 @@ export type IdentitySchema =
213
312
  pattern?: string;
214
313
  } & {
215
314
  };
315
+ /**
316
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
317
+ * via the `definition` "InterruptRunEvent".
318
+ */
319
+ export type InterruptRunEvent =
320
+ RunEventBase & {
321
+ kind?: "interrupt";
322
+ };
216
323
  /**
217
324
  * This interface was referenced by `GenesisJson`'s JSON-Schema
218
325
  * via the `definition` "Job".
@@ -302,6 +409,20 @@ export type ResourceType =
302
409
  } & Documented &
303
410
  ExtractionSchemaWrapper & {
304
411
  };
412
+ /**
413
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
414
+ * via the `definition` "RunEvent".
415
+ */
416
+ export type RunEvent =
417
+ GraphStartRunEvent | TickRunEvent | InterruptRunEvent | GraphEndRunEvent;
418
+ /**
419
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
420
+ * via the `definition` "TickRunEvent".
421
+ */
422
+ export type TickRunEvent =
423
+ RunEventBase & {
424
+ kind?: "tick";
425
+ };
305
426
  /**
306
427
  * This interface was referenced by `GenesisJson`'s JSON-Schema
307
428
  * via the `definition` "StatefulStrategy".
@@ -310,13 +431,7 @@ export type StatefulStrategy =
310
431
  {
311
432
  identity: StatefulStrategyIdentity;
312
433
  } & StatelessStrategyWrapper &
313
- StrategyStateWrapper;
314
- /**
315
- * This interface was referenced by `GenesisJson`'s JSON-Schema
316
- * via the `definition` "StatefulStrategyIdentity".
317
- */
318
- export type StatefulStrategyIdentity =
319
- `STATEFUL_STRATEGY-${string}`;
434
+ StrategyStateWrapper1;
320
435
  /**
321
436
  * This interface was referenced by `GenesisJson`'s JSON-Schema
322
437
  * via the `definition` "StatelessStrategyIdentity".
@@ -325,62 +440,20 @@ export type StatelessStrategyIdentity =
325
440
  `STATELESS_STRATEGY-${string}`;
326
441
  /**
327
442
  * This interface was referenced by `GenesisJson`'s JSON-Schema
328
- * via the `definition` "Step".
329
- */
330
- export type Step =
331
- WorkStep | BranchStep | WhileStep | ForStep;
332
- /**
333
- * This interface was referenced by `GenesisJson`'s JSON-Schema
334
- * via the `definition` "WhileStep".
335
- */
336
- export type WhileStep =
337
- {
338
- case: Conditional;
339
- identity: WhileStepIdentity;
340
- kind: "while";
341
- } & StepKind;
342
- /**
343
- * This interface was referenced by `GenesisJson`'s JSON-Schema
344
- * via the `definition` "WhileStepIdentity".
345
- */
346
- export type WhileStepIdentity =
347
- `WHILESTEP-${string}`;
348
- /**
349
- * This interface was referenced by `GenesisJson`'s JSON-Schema
350
- * via the `definition` "StrategyRun".
443
+ * via the `definition` "StrategyRunUpdate".
351
444
  */
352
- export type StrategyRun =
445
+ export type StrategyRunUpdate =
353
446
  {
354
- identity: StrategyRunIdentity;
355
- statefulStrategyRef: StatefulStrategyIdentity;
356
- strategyRunContext: StrategyRunContext;
357
- } & StrategyThreadMapWrapper &
358
- StrategyStateWrapper1;
359
- /**
360
- * This interface was referenced by `GenesisJson`'s JSON-Schema
361
- * via the `definition` "StrategyRunIdentity".
362
- */
363
- export type StrategyRunIdentity =
364
- `STRATEGY_RUN-${string}`;
365
- /**
366
- * This interface was referenced by `GenesisJson`'s JSON-Schema
367
- * via the `definition` "StrategyRunStatus".
368
- */
369
- export type StrategyRunStatus =
370
- "pending" | "running" | "completed" | "failed" | "cancelled";
447
+ strategyRun?: StrategyRun1;
448
+ strategyRunRef: StrategyRunIdentity;
449
+ } & StrategyStateDelta;
371
450
  export type StrategyRun1 =
372
451
  {
373
452
  identity: StrategyRunIdentity;
374
453
  statefulStrategyRef: StatefulStrategyIdentity;
375
454
  strategyRunContext: StrategyRunContext;
376
455
  } & StrategyThreadMapWrapper &
377
- StrategyStateWrapper1;
378
- /**
379
- * This interface was referenced by `GenesisJson`'s JSON-Schema
380
- * via the `definition` "StrategyThreadIdentity".
381
- */
382
- export type StrategyThreadIdentity =
383
- `STRATEGY_THREAD-${string}`;
456
+ StrategyStateWrapper;
384
457
 
385
458
  export interface GenesisJson {
386
459
  }
@@ -490,6 +563,75 @@ export type ExecutionSocketMaterialized = Record<ResourceRoleIdentity, Resource>
490
563
  export interface ExtractionSchemaWrapper {
491
564
  extractionSchema: ExtractionSchema;
492
565
  }
566
+ /**
567
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
568
+ * via the `definition` "RunEventBase".
569
+ */
570
+ export interface RunEventBase {
571
+ counters?: RunEventCounters;
572
+ createdAt: Timestamp;
573
+ eventSeq: number;
574
+ kind: RunEventKind;
575
+ nodeName: string;
576
+ stepMetaData?: RunEventStepMetaData;
577
+ strategyRunRef: StrategyRunIdentity;
578
+ strategyThreadRef: StrategyThreadIdentity;
579
+ updates?: RunEventUpdates;
580
+ }
581
+ /**
582
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
583
+ * via the `definition` "RunEventCounters".
584
+ */
585
+ export interface RunEventCounters {
586
+ iterationCounterAfter?: number;
587
+ stepCounterAfter?: number;
588
+ }
589
+ /**
590
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
591
+ * via the `definition` "RunEventStepMetaData".
592
+ */
593
+ export interface RunEventStepMetaData {
594
+ executionRef?: ExecutionIdentity;
595
+ jobRef?: JobIdentity;
596
+ stepKind: RunEventStepKind;
597
+ stepRef: WorkStepIdentity | BranchStepIdentity | WhileStepIdentity | ForStepIdentity;
598
+ threadStepIndex: number;
599
+ }
600
+ /**
601
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
602
+ * via the `definition` "StrategyStateDelta".
603
+ */
604
+ export interface StrategyStateDelta {
605
+ strategyStateUpdate?: {
606
+ [k: string]: ExecutionSocketMaterialized;
607
+ };
608
+ strategyStateUpdateWide?: Record<ExecutionIdentity, ExecutionSocket>;
609
+ }
610
+ /**
611
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
612
+ * via the `definition` "StrategyRunContext".
613
+ */
614
+ export interface StrategyRunContext {
615
+ completedAt?: Timestamp;
616
+ startedAt?: Timestamp;
617
+ status: StrategyRunStatus;
618
+ }
619
+ export interface StrategyThreadMapWrapper {
620
+ strategyThreadMap: StrategyThreadMap;
621
+ }
622
+ /**
623
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
624
+ * via the `definition` "StrategyThreadMap".
625
+ */
626
+ export type StrategyThreadMap = Record<StrategyThreadIdentity, Step[]>;
627
+ export interface StrategyStateWrapper {
628
+ strategyState: StrategyState;
629
+ }
630
+ /**
631
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
632
+ * via the `definition` "StrategyState".
633
+ */
634
+ export type StrategyState = Record<ExecutionIdentity, ExecutionSocket>;
493
635
  /**
494
636
  * This interface was referenced by `GenesisJson`'s JSON-Schema
495
637
  * via the `definition` "IdentityProp".
@@ -561,6 +703,19 @@ export interface MeritSchemaRef {
561
703
  export interface RoleBindingsWrapper1 {
562
704
  roleBindings: RoleBindings;
563
705
  }
706
+ /**
707
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
708
+ * via the `definition` "RunRecording".
709
+ */
710
+ export interface RunRecording {
711
+ recordedAt?: Timestamp1;
712
+ runEvents: RunEvent[];
713
+ strategyRunRef?: string;
714
+ strategyThreadRef?: string;
715
+ }
716
+ export interface Timestamp1 {
717
+ timestamp: string;
718
+ }
564
719
  /**
565
720
  * This interface was referenced by `GenesisJson`'s JSON-Schema
566
721
  * via the `definition` "StatelessStrategyWrapper".
@@ -580,44 +735,9 @@ export interface StatelessStrategy {
580
735
  * This interface was referenced by `GenesisJson`'s JSON-Schema
581
736
  * via the `definition` "StrategyStateWrapper".
582
737
  */
583
- export interface StrategyStateWrapper {
584
- strategyState: StrategyState;
585
- }
586
- /**
587
- * This interface was referenced by `GenesisJson`'s JSON-Schema
588
- * via the `definition` "StrategyState".
589
- */
590
- export type StrategyState = Record<ExecutionIdentity, ExecutionSocket>;
591
- /**
592
- * This interface was referenced by `GenesisJson`'s JSON-Schema
593
- * via the `definition` "StrategyRunContext".
594
- */
595
- export interface StrategyRunContext {
596
- completedAt?: Timestamp;
597
- startedAt?: Timestamp;
598
- status: StrategyRunStatus;
599
- }
600
- export interface StrategyThreadMapWrapper {
601
- strategyThreadMap: StrategyThreadMap;
602
- }
603
- /**
604
- * This interface was referenced by `GenesisJson`'s JSON-Schema
605
- * via the `definition` "StrategyThreadMap".
606
- */
607
- export type StrategyThreadMap = Record<StrategyThreadIdentity, Step[]>;
608
738
  export interface StrategyStateWrapper1 {
609
739
  strategyState: StrategyState;
610
740
  }
611
- /**
612
- * This interface was referenced by `GenesisJson`'s JSON-Schema
613
- * via the `definition` "StrategyRunUpdate".
614
- */
615
- export interface StrategyRunUpdate {
616
- strategyRun?: StrategyRun1;
617
- strategyRunRef: StrategyRunIdentity;
618
- strategyStateUpdate: Record<ExecutionIdentity, ExecutionSocketMaterialized>;
619
- strategyStateUpdateWide?: Record<ExecutionIdentity, ExecutionSocket>;
620
- }
621
741
  /**
622
742
  * This interface was referenced by `GenesisJson`'s JSON-Schema
623
743
  * via the `definition` "StrategyThreadMapWrapper".
@@ -0,0 +1,3 @@
1
+ import type { ResourceRoleIdentity, StrategyThreadIdentity } from './genesis/generated/types/types.js';
2
+ export declare function isResourceRoleIdentityJson(value: string): value is ResourceRoleIdentity;
3
+ export declare function isStrategyThreadIdentityJson(value: string): value is StrategyThreadIdentity;
@@ -0,0 +1,6 @@
1
+ export function isResourceRoleIdentityJson(value) {
2
+ return value.startsWith('ROLE-');
3
+ }
4
+ export function isStrategyThreadIdentityJson(value) {
5
+ return value.startsWith('STRATEGY_THREAD-');
6
+ }
package/dist/index.d.ts CHANGED
@@ -14,3 +14,4 @@ export type { Resource_StrategyRun as Resource_StrategyRunJson } from './genesis
14
14
  export type StepIdentityJson = WorkStepIdentity | BranchStepIdentity | WhileStepIdentity | ForStepIdentity;
15
15
  export type { Documented as DocumentedJson, ResourceFormatIdentity as ResourceFormatIdentityJson, ResourceFormat as ResourceFormatJson, ExtractionSchema as ExtractionSchemaJson, IdentityProp as IdentityPropJson, MeritProp as MeritPropJson, ResourceTypeIdentity as ResourceTypeIdentityJson, ResourceType as ResourceTypeJson, ResourceRoleIdentity as ResourceRoleIdentityJson, ResourceRoleValue as ResourceRoleValueJson, ExecutionIdentity as ExecutionIdentityJson, Execution as ExecutionJson, Conditional as ConditionalJson, RoleMap as RoleMapJson, Roles as RolesJson, RoleBindingMap as RoleBindingMapJson, RoleBindings as RoleBindingsJson, ResourceIdentity as ResourceIdentityJson, WorkStepIdentity as WorkStepIdentityJson, BranchStepIdentity as BranchStepIdentityJson, WhileStepIdentity as WhileStepIdentityJson, ForStepIdentity as ForStepIdentityJson, WorkStep as WorkStepJson, BranchStep as BranchStepJson, WhileStep as WhileStepJson, ForStep as ForStepJson, StepKind as StepKindJson, Step as StepJson, CreationContext as CreationContextJson, ResourceMissing as ResourceMissingJson, ResourcePotentialInput as ResourcePotentialInputJson, ResourcePotentialOutput as ResourcePotentialOutputJson, ResourceMetaBase as ResourceMetaJson, // ATTENTION: type not generated for ResourceMeta
16
16
  Resource as ResourceJson, StrategyState as StrategyStateJson, StatelessStrategyIdentity as StatelessStrategyIdentityJson, StatelessStrategy as StatelessStrategyJson, StatefulStrategyIdentity as StatefulStrategyIdentityJson, StatefulStrategy as StatefulStrategyJson, StrategyRunIdentity as StrategyRunIdentityJson, StrategyRunStatus as StrategyRunStatusJson, StrategyRun as StrategyRunJson, StrategyRunUpdate as StrategyRunUpdateJson, JobIdentity as JobIdentityJson, Job as JobJson, JsonData as JsonDataJson, StrategyThreadIdentity as StrategyThreadIdentityJson, StrategyThreadMap as StrategyThreadMapJson, ExecutionSocket as ExecutionSocketJson, ExecutionSocketMaterialized as ExecutionSocketMaterializedJson, Timestamp as TimestampJson, } from './genesis/generated/types/types.js';
17
+ export { isResourceRoleIdentityJson, isStrategyThreadIdentityJson } from './identityGuards.js';
package/dist/index.js CHANGED
@@ -4,3 +4,4 @@ export { default as SchemaJob } from './genesis/generated/schemas/Job.js';
4
4
  export { default as ResourceTypeGenesis } from './genesis/generated/resource-type-envelopes/Genesis.js';
5
5
  export { default as dependencies } from './genesis/generated/dependencies_ordered.json';
6
6
  export { default as terminals } from './genesis/generated/terminals.json';
7
+ export { isResourceRoleIdentityJson, isStrategyThreadIdentityJson } from './identityGuards.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolproof-npm/schema",
3
- "version": "0.1.79",
3
+ "version": "0.1.81",
4
4
  "description": "JSON schemas and TypeScript types for ToolProof",
5
5
  "keywords": [
6
6
  "toolproof",
@@ -26,6 +26,10 @@
26
26
  ".": {
27
27
  "import": "./dist/index.js",
28
28
  "types": "./dist/index.d.ts"
29
+ },
30
+ "./identityGuards": {
31
+ "import": "./dist/identityGuards.js",
32
+ "types": "./dist/identityGuards.d.ts"
29
33
  }
30
34
  },
31
35
  "files": [