@cascade-flow/backend-interface 0.2.2 → 0.2.4

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.
package/dist/events.d.ts CHANGED
@@ -175,6 +175,36 @@ export declare const stepSkippedEventSchema: z.ZodObject<{
175
175
  attemptNumber: z.ZodNumber;
176
176
  cascadedFrom: z.ZodOptional<z.ZodString>;
177
177
  }, z.core.$strip>;
178
+ export declare const stepCheckpointEventSchema: z.ZodObject<{
179
+ eventId: z.ZodString;
180
+ timestampUs: z.ZodNumber;
181
+ workflowSlug: z.ZodString;
182
+ runId: z.ZodString;
183
+ category: z.ZodLiteral<"step">;
184
+ stepId: z.ZodString;
185
+ type: z.ZodLiteral<"StepCheckpoint">;
186
+ name: z.ZodString;
187
+ sequenceNumber: z.ZodNumber;
188
+ attemptNumber: z.ZodNumber;
189
+ data: z.ZodString;
190
+ }, z.core.$strip>;
191
+ export declare const stepCheckpointFailedEventSchema: z.ZodObject<{
192
+ eventId: z.ZodString;
193
+ timestampUs: z.ZodNumber;
194
+ workflowSlug: z.ZodString;
195
+ runId: z.ZodString;
196
+ category: z.ZodLiteral<"step">;
197
+ stepId: z.ZodString;
198
+ type: z.ZodLiteral<"StepCheckpointFailed">;
199
+ name: z.ZodString;
200
+ sequenceNumber: z.ZodNumber;
201
+ attemptNumber: z.ZodNumber;
202
+ error: z.ZodObject<{
203
+ message: z.ZodString;
204
+ stack: z.ZodOptional<z.ZodString>;
205
+ name: z.ZodOptional<z.ZodString>;
206
+ }, z.core.$strip>;
207
+ }, z.core.$strip>;
178
208
  export declare const stepEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
179
209
  eventId: z.ZodString;
180
210
  timestampUs: z.ZodNumber;
@@ -316,6 +346,34 @@ export declare const stepEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
316
346
  durationUs: z.ZodNumber;
317
347
  attemptNumber: z.ZodNumber;
318
348
  cascadedFrom: z.ZodOptional<z.ZodString>;
349
+ }, z.core.$strip>, z.ZodObject<{
350
+ eventId: z.ZodString;
351
+ timestampUs: z.ZodNumber;
352
+ workflowSlug: z.ZodString;
353
+ runId: z.ZodString;
354
+ category: z.ZodLiteral<"step">;
355
+ stepId: z.ZodString;
356
+ type: z.ZodLiteral<"StepCheckpoint">;
357
+ name: z.ZodString;
358
+ sequenceNumber: z.ZodNumber;
359
+ attemptNumber: z.ZodNumber;
360
+ data: z.ZodString;
361
+ }, z.core.$strip>, z.ZodObject<{
362
+ eventId: z.ZodString;
363
+ timestampUs: z.ZodNumber;
364
+ workflowSlug: z.ZodString;
365
+ runId: z.ZodString;
366
+ category: z.ZodLiteral<"step">;
367
+ stepId: z.ZodString;
368
+ type: z.ZodLiteral<"StepCheckpointFailed">;
369
+ name: z.ZodString;
370
+ sequenceNumber: z.ZodNumber;
371
+ attemptNumber: z.ZodNumber;
372
+ error: z.ZodObject<{
373
+ message: z.ZodString;
374
+ stack: z.ZodOptional<z.ZodString>;
375
+ name: z.ZodOptional<z.ZodString>;
376
+ }, z.core.$strip>;
319
377
  }, z.core.$strip>], "type">;
320
378
  export declare const workflowStartedEventSchema: z.ZodObject<{
321
379
  eventId: z.ZodString;
@@ -391,6 +449,7 @@ export declare const workflowResumedEventSchema: z.ZodObject<{
391
449
  runId: z.ZodString;
392
450
  category: z.ZodLiteral<"workflow">;
393
451
  type: z.ZodLiteral<"WorkflowResumed">;
452
+ versionId: z.ZodString;
394
453
  originalRunId: z.ZodString;
395
454
  resumedSteps: z.ZodNumber;
396
455
  pendingSteps: z.ZodNumber;
@@ -436,6 +495,19 @@ export declare const runSubmittedEventSchema: z.ZodObject<{
436
495
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
437
496
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
438
497
  }, z.core.$strip>;
498
+ export declare const workflowRerunFromStepEventSchema: z.ZodObject<{
499
+ eventId: z.ZodString;
500
+ timestampUs: z.ZodNumber;
501
+ workflowSlug: z.ZodString;
502
+ runId: z.ZodString;
503
+ category: z.ZodLiteral<"workflow">;
504
+ type: z.ZodLiteral<"WorkflowRerunFromStep">;
505
+ parentRunId: z.ZodString;
506
+ rerunFromStepId: z.ZodString;
507
+ rerunStepIds: z.ZodArray<z.ZodString>;
508
+ versionId: z.ZodString;
509
+ parentVersionId: z.ZodString;
510
+ }, z.core.$strip>;
439
511
  export declare const workflowEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
440
512
  eventId: z.ZodString;
441
513
  timestampUs: z.ZodNumber;
@@ -522,6 +594,7 @@ export declare const workflowEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
522
594
  runId: z.ZodString;
523
595
  category: z.ZodLiteral<"workflow">;
524
596
  type: z.ZodLiteral<"WorkflowResumed">;
597
+ versionId: z.ZodString;
525
598
  originalRunId: z.ZodString;
526
599
  resumedSteps: z.ZodNumber;
527
600
  pendingSteps: z.ZodNumber;
@@ -547,6 +620,18 @@ export declare const workflowEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
547
620
  previousAttemptNumber: z.ZodNumber;
548
621
  retriedSteps: z.ZodArray<z.ZodString>;
549
622
  reason: z.ZodOptional<z.ZodString>;
623
+ }, z.core.$strip>, z.ZodObject<{
624
+ eventId: z.ZodString;
625
+ timestampUs: z.ZodNumber;
626
+ workflowSlug: z.ZodString;
627
+ runId: z.ZodString;
628
+ category: z.ZodLiteral<"workflow">;
629
+ type: z.ZodLiteral<"WorkflowRerunFromStep">;
630
+ parentRunId: z.ZodString;
631
+ rerunFromStepId: z.ZodString;
632
+ rerunStepIds: z.ZodArray<z.ZodString>;
633
+ versionId: z.ZodString;
634
+ parentVersionId: z.ZodString;
550
635
  }, z.core.$strip>], "type">;
551
636
  export declare const eventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
552
637
  eventId: z.ZodString;
@@ -689,6 +774,34 @@ export declare const eventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[
689
774
  durationUs: z.ZodNumber;
690
775
  attemptNumber: z.ZodNumber;
691
776
  cascadedFrom: z.ZodOptional<z.ZodString>;
777
+ }, z.core.$strip>, z.ZodObject<{
778
+ eventId: z.ZodString;
779
+ timestampUs: z.ZodNumber;
780
+ workflowSlug: z.ZodString;
781
+ runId: z.ZodString;
782
+ category: z.ZodLiteral<"step">;
783
+ stepId: z.ZodString;
784
+ type: z.ZodLiteral<"StepCheckpoint">;
785
+ name: z.ZodString;
786
+ sequenceNumber: z.ZodNumber;
787
+ attemptNumber: z.ZodNumber;
788
+ data: z.ZodString;
789
+ }, z.core.$strip>, z.ZodObject<{
790
+ eventId: z.ZodString;
791
+ timestampUs: z.ZodNumber;
792
+ workflowSlug: z.ZodString;
793
+ runId: z.ZodString;
794
+ category: z.ZodLiteral<"step">;
795
+ stepId: z.ZodString;
796
+ type: z.ZodLiteral<"StepCheckpointFailed">;
797
+ name: z.ZodString;
798
+ sequenceNumber: z.ZodNumber;
799
+ attemptNumber: z.ZodNumber;
800
+ error: z.ZodObject<{
801
+ message: z.ZodString;
802
+ stack: z.ZodOptional<z.ZodString>;
803
+ name: z.ZodOptional<z.ZodString>;
804
+ }, z.core.$strip>;
692
805
  }, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
693
806
  eventId: z.ZodString;
694
807
  timestampUs: z.ZodNumber;
@@ -775,6 +888,7 @@ export declare const eventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[
775
888
  runId: z.ZodString;
776
889
  category: z.ZodLiteral<"workflow">;
777
890
  type: z.ZodLiteral<"WorkflowResumed">;
891
+ versionId: z.ZodString;
778
892
  originalRunId: z.ZodString;
779
893
  resumedSteps: z.ZodNumber;
780
894
  pendingSteps: z.ZodNumber;
@@ -800,6 +914,18 @@ export declare const eventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[
800
914
  previousAttemptNumber: z.ZodNumber;
801
915
  retriedSteps: z.ZodArray<z.ZodString>;
802
916
  reason: z.ZodOptional<z.ZodString>;
917
+ }, z.core.$strip>, z.ZodObject<{
918
+ eventId: z.ZodString;
919
+ timestampUs: z.ZodNumber;
920
+ workflowSlug: z.ZodString;
921
+ runId: z.ZodString;
922
+ category: z.ZodLiteral<"workflow">;
923
+ type: z.ZodLiteral<"WorkflowRerunFromStep">;
924
+ parentRunId: z.ZodString;
925
+ rerunFromStepId: z.ZodString;
926
+ rerunStepIds: z.ZodArray<z.ZodString>;
927
+ versionId: z.ZodString;
928
+ parentVersionId: z.ZodString;
803
929
  }, z.core.$strip>], "type">]>;
804
930
  export type StepEvent = z.infer<typeof stepEventSchema>;
805
931
  export type StepStartedEvent = z.infer<typeof stepStartedEventSchema>;
@@ -811,6 +937,8 @@ export type StepScheduledEvent = z.infer<typeof stepScheduledEventSchema>;
811
937
  export type StepHeartbeatEvent = z.infer<typeof stepHeartbeatEventSchema>;
812
938
  export type StepReclaimedEvent = z.infer<typeof stepReclaimedEventSchema>;
813
939
  export type StepSkippedEvent = z.infer<typeof stepSkippedEventSchema>;
940
+ export type StepCheckpointEvent = z.infer<typeof stepCheckpointEventSchema>;
941
+ export type StepCheckpointFailedEvent = z.infer<typeof stepCheckpointFailedEventSchema>;
814
942
  export type WorkflowEvent = z.infer<typeof workflowEventSchema>;
815
943
  export type RunSubmittedEvent = z.infer<typeof runSubmittedEventSchema>;
816
944
  export type WorkflowStartedEvent = z.infer<typeof workflowStartedEventSchema>;
@@ -820,5 +948,6 @@ export type WorkflowFailedEvent = z.infer<typeof workflowFailedEventSchema>;
820
948
  export type WorkflowResumedEvent = z.infer<typeof workflowResumedEventSchema>;
821
949
  export type WorkflowCancelledEvent = z.infer<typeof workflowCancelledEventSchema>;
822
950
  export type WorkflowRetryStartedEvent = z.infer<typeof workflowRetryStartedEventSchema>;
951
+ export type WorkflowRerunFromStepEvent = z.infer<typeof workflowRerunFromStepEventSchema>;
823
952
  export type Event = z.infer<typeof eventSchema>;
824
953
  //# sourceMappingURL=events.d.ts.map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C,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAG1F,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
package/dist/index.js CHANGED
@@ -12583,6 +12583,7 @@ var WorkflowVersionGitInfoSchema = exports_external.object({
12583
12583
  var WorkflowVersionSchema = exports_external.object({
12584
12584
  workflowSlug: exports_external.string(),
12585
12585
  versionId: exports_external.string(),
12586
+ versionNumber: exports_external.number().int().positive(),
12586
12587
  createdAt: exports_external.number(),
12587
12588
  stepManifest: exports_external.array(exports_external.string()),
12588
12589
  totalSteps: exports_external.number().int().nonnegative(),
@@ -12683,6 +12684,20 @@ var stepSkippedEventSchema = baseStepEventSchema.extend({
12683
12684
  attemptNumber: exports_external.number().int().positive(),
12684
12685
  cascadedFrom: exports_external.string().optional()
12685
12686
  });
12687
+ var stepCheckpointEventSchema = baseStepEventSchema.extend({
12688
+ type: exports_external.literal("StepCheckpoint"),
12689
+ name: exports_external.string(),
12690
+ sequenceNumber: exports_external.number().int().nonnegative(),
12691
+ attemptNumber: exports_external.number().int().positive(),
12692
+ data: exports_external.string()
12693
+ });
12694
+ var stepCheckpointFailedEventSchema = baseStepEventSchema.extend({
12695
+ type: exports_external.literal("StepCheckpointFailed"),
12696
+ name: exports_external.string(),
12697
+ sequenceNumber: exports_external.number().int().nonnegative(),
12698
+ attemptNumber: exports_external.number().int().positive(),
12699
+ error: StepErrorSchema
12700
+ });
12686
12701
  var stepEventSchema = exports_external.discriminatedUnion("type", [
12687
12702
  stepStartedEventSchema,
12688
12703
  stepCompletedEventSchema,
@@ -12692,7 +12707,9 @@ var stepEventSchema = exports_external.discriminatedUnion("type", [
12692
12707
  stepScheduledEventSchema,
12693
12708
  stepHeartbeatEventSchema,
12694
12709
  stepReclaimedEventSchema,
12695
- stepSkippedEventSchema
12710
+ stepSkippedEventSchema,
12711
+ stepCheckpointEventSchema,
12712
+ stepCheckpointFailedEventSchema
12696
12713
  ]);
12697
12714
  var workflowStartedEventSchema = baseWorkflowEventSchema.extend({
12698
12715
  type: exports_external.literal("WorkflowStarted"),
@@ -12735,6 +12752,7 @@ var workflowFailedEventSchema = baseWorkflowEventSchema.extend({
12735
12752
  });
12736
12753
  var workflowResumedEventSchema = baseWorkflowEventSchema.extend({
12737
12754
  type: exports_external.literal("WorkflowResumed"),
12755
+ versionId: exports_external.string(),
12738
12756
  originalRunId: exports_external.string(),
12739
12757
  resumedSteps: exports_external.number().int().nonnegative(),
12740
12758
  pendingSteps: exports_external.number().int().nonnegative()
@@ -12765,6 +12783,14 @@ var runSubmittedEventSchema = baseWorkflowEventSchema.extend({
12765
12783
  metadata: exports_external.record(exports_external.string(), exports_external.any()).optional(),
12766
12784
  tags: exports_external.array(exports_external.string()).optional()
12767
12785
  });
12786
+ var workflowRerunFromStepEventSchema = baseWorkflowEventSchema.extend({
12787
+ type: exports_external.literal("WorkflowRerunFromStep"),
12788
+ parentRunId: exports_external.string(),
12789
+ rerunFromStepId: exports_external.string(),
12790
+ rerunStepIds: exports_external.array(exports_external.string()),
12791
+ versionId: exports_external.string(),
12792
+ parentVersionId: exports_external.string()
12793
+ });
12768
12794
  var workflowEventSchema = exports_external.discriminatedUnion("type", [
12769
12795
  runSubmittedEventSchema,
12770
12796
  workflowStartedEventSchema,
@@ -12773,7 +12799,8 @@ var workflowEventSchema = exports_external.discriminatedUnion("type", [
12773
12799
  workflowFailedEventSchema,
12774
12800
  workflowResumedEventSchema,
12775
12801
  workflowCancelledEventSchema,
12776
- workflowRetryStartedEventSchema
12802
+ workflowRetryStartedEventSchema,
12803
+ workflowRerunFromStepEventSchema
12777
12804
  ]);
12778
12805
  var eventSchema = exports_external.union([stepEventSchema, workflowEventSchema]);
12779
12806
  // src/projection.ts
@@ -13114,8 +13141,46 @@ function projectStepState(events, workflowSlug) {
13114
13141
  }
13115
13142
  return state;
13116
13143
  }
13144
+ function getVersionIdFromEvents(events) {
13145
+ const startedEvent = events.find((e) => e.type === "WorkflowStarted");
13146
+ return startedEvent?.versionId ?? "unknown";
13147
+ }
13117
13148
  // src/interface.ts
13118
13149
  class Backend {
13150
+ async calculateDependents(workflowSlug, targetStepId) {
13151
+ const workflowSteps = await this.getWorkflowSteps(workflowSlug);
13152
+ if (!workflowSteps || workflowSteps.length === 0) {
13153
+ throw new Error(`Cannot rerun workflow "${workflowSlug}": no registered step definitions found. ` + `Please ensure the worker has started and registered this workflow.`);
13154
+ }
13155
+ const dependentsMap = new Map;
13156
+ for (const step of workflowSteps) {
13157
+ const dependencies = step.dependencies || [];
13158
+ for (const depId of dependencies) {
13159
+ if (!dependentsMap.has(depId)) {
13160
+ dependentsMap.set(depId, []);
13161
+ }
13162
+ dependentsMap.get(depId).push(step.id);
13163
+ }
13164
+ }
13165
+ const stepExists = workflowSteps.some((s) => s.id === targetStepId);
13166
+ if (!stepExists) {
13167
+ throw new Error(`Cannot rerun from step "${targetStepId}": step not found in workflow "${workflowSlug}".`);
13168
+ }
13169
+ const allDependents = new Set;
13170
+ const visited = new Set;
13171
+ const dfs = (stepId) => {
13172
+ if (visited.has(stepId))
13173
+ return;
13174
+ visited.add(stepId);
13175
+ const dependents = dependentsMap.get(stepId) || [];
13176
+ for (const dependent of dependents) {
13177
+ allDependents.add(dependent);
13178
+ dfs(dependent);
13179
+ }
13180
+ };
13181
+ dfs(targetStepId);
13182
+ return allDependents;
13183
+ }
13119
13184
  }
13120
13185
  // src/serialization.ts
13121
13186
  function safeSerialize(value) {
@@ -13743,6 +13808,7 @@ export {
13743
13808
  workflowStartedEventSchema,
13744
13809
  workflowRetryStartedEventSchema,
13745
13810
  workflowResumedEventSchema,
13811
+ workflowRerunFromStepEventSchema,
13746
13812
  workflowInputValidationEventSchema,
13747
13813
  workflowFailedEventSchema,
13748
13814
  workflowEventSchema,
@@ -13763,6 +13829,8 @@ export {
13763
13829
  stepEventSchema,
13764
13830
  stepDurationSchema,
13765
13831
  stepCompletedEventSchema,
13832
+ stepCheckpointFailedEventSchema,
13833
+ stepCheckpointEventSchema,
13766
13834
  serializeError,
13767
13835
  schedulingLatencySchema,
13768
13836
  safeSerialize,
@@ -13779,6 +13847,7 @@ export {
13779
13847
  normalizePaths,
13780
13848
  logEntryEventSchema,
13781
13849
  hashString,
13850
+ getVersionIdFromEvents,
13782
13851
  getMicrosecondTimestamp,
13783
13852
  getCurrentAttemptNumber,
13784
13853
  extractTopFrames,
@@ -13824,4 +13893,4 @@ export {
13824
13893
  Backend
13825
13894
  };
13826
13895
 
13827
- //# debugId=8B4CDB82A5D2121C64756E2164756E21
13896
+ //# debugId=55E8C867E138DC0E64756E2164756E21