@cascade-flow/backend-interface 0.2.1 → 0.2.3

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
@@ -391,6 +391,7 @@ export declare const workflowResumedEventSchema: z.ZodObject<{
391
391
  runId: z.ZodString;
392
392
  category: z.ZodLiteral<"workflow">;
393
393
  type: z.ZodLiteral<"WorkflowResumed">;
394
+ versionId: z.ZodString;
394
395
  originalRunId: z.ZodString;
395
396
  resumedSteps: z.ZodNumber;
396
397
  pendingSteps: z.ZodNumber;
@@ -436,6 +437,19 @@ export declare const runSubmittedEventSchema: z.ZodObject<{
436
437
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
437
438
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
438
439
  }, z.core.$strip>;
440
+ export declare const workflowRerunFromStepEventSchema: z.ZodObject<{
441
+ eventId: z.ZodString;
442
+ timestampUs: z.ZodNumber;
443
+ workflowSlug: z.ZodString;
444
+ runId: z.ZodString;
445
+ category: z.ZodLiteral<"workflow">;
446
+ type: z.ZodLiteral<"WorkflowRerunFromStep">;
447
+ parentRunId: z.ZodString;
448
+ rerunFromStepId: z.ZodString;
449
+ rerunStepIds: z.ZodArray<z.ZodString>;
450
+ versionId: z.ZodString;
451
+ parentVersionId: z.ZodString;
452
+ }, z.core.$strip>;
439
453
  export declare const workflowEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
440
454
  eventId: z.ZodString;
441
455
  timestampUs: z.ZodNumber;
@@ -522,6 +536,7 @@ export declare const workflowEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
522
536
  runId: z.ZodString;
523
537
  category: z.ZodLiteral<"workflow">;
524
538
  type: z.ZodLiteral<"WorkflowResumed">;
539
+ versionId: z.ZodString;
525
540
  originalRunId: z.ZodString;
526
541
  resumedSteps: z.ZodNumber;
527
542
  pendingSteps: z.ZodNumber;
@@ -547,6 +562,18 @@ export declare const workflowEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
547
562
  previousAttemptNumber: z.ZodNumber;
548
563
  retriedSteps: z.ZodArray<z.ZodString>;
549
564
  reason: z.ZodOptional<z.ZodString>;
565
+ }, z.core.$strip>, z.ZodObject<{
566
+ eventId: z.ZodString;
567
+ timestampUs: z.ZodNumber;
568
+ workflowSlug: z.ZodString;
569
+ runId: z.ZodString;
570
+ category: z.ZodLiteral<"workflow">;
571
+ type: z.ZodLiteral<"WorkflowRerunFromStep">;
572
+ parentRunId: z.ZodString;
573
+ rerunFromStepId: z.ZodString;
574
+ rerunStepIds: z.ZodArray<z.ZodString>;
575
+ versionId: z.ZodString;
576
+ parentVersionId: z.ZodString;
550
577
  }, z.core.$strip>], "type">;
551
578
  export declare const eventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
552
579
  eventId: z.ZodString;
@@ -775,6 +802,7 @@ export declare const eventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[
775
802
  runId: z.ZodString;
776
803
  category: z.ZodLiteral<"workflow">;
777
804
  type: z.ZodLiteral<"WorkflowResumed">;
805
+ versionId: z.ZodString;
778
806
  originalRunId: z.ZodString;
779
807
  resumedSteps: z.ZodNumber;
780
808
  pendingSteps: z.ZodNumber;
@@ -800,6 +828,18 @@ export declare const eventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[
800
828
  previousAttemptNumber: z.ZodNumber;
801
829
  retriedSteps: z.ZodArray<z.ZodString>;
802
830
  reason: z.ZodOptional<z.ZodString>;
831
+ }, z.core.$strip>, z.ZodObject<{
832
+ eventId: z.ZodString;
833
+ timestampUs: z.ZodNumber;
834
+ workflowSlug: z.ZodString;
835
+ runId: z.ZodString;
836
+ category: z.ZodLiteral<"workflow">;
837
+ type: z.ZodLiteral<"WorkflowRerunFromStep">;
838
+ parentRunId: z.ZodString;
839
+ rerunFromStepId: z.ZodString;
840
+ rerunStepIds: z.ZodArray<z.ZodString>;
841
+ versionId: z.ZodString;
842
+ parentVersionId: z.ZodString;
803
843
  }, z.core.$strip>], "type">]>;
804
844
  export type StepEvent = z.infer<typeof stepEventSchema>;
805
845
  export type StepStartedEvent = z.infer<typeof stepStartedEventSchema>;
@@ -820,5 +860,6 @@ export type WorkflowFailedEvent = z.infer<typeof workflowFailedEventSchema>;
820
860
  export type WorkflowResumedEvent = z.infer<typeof workflowResumedEventSchema>;
821
861
  export type WorkflowCancelledEvent = z.infer<typeof workflowCancelledEventSchema>;
822
862
  export type WorkflowRetryStartedEvent = z.infer<typeof workflowRetryStartedEventSchema>;
863
+ export type WorkflowRerunFromStepEvent = z.infer<typeof workflowRerunFromStepEventSchema>;
823
864
  export type Event = z.infer<typeof eventSchema>;
824
865
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,aAAa,aAA4B,CAAC;AAGvD,eAAO,MAAM,eAAe;;;;;;;;;iBAM1B,CAAC;AAMH,eAAO,MAAM,mBAAmB;;;;;;;iBAG9B,CAAC;AAGH,eAAO,MAAM,uBAAuB;;;;;;iBAElC,CAAC;AAOH,eAAO,MAAM,sBAAsB;;;;;;;;;;;iBAKjC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;iBAMnC,CAAC;AAGH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBhC,CAAC;AAGH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;iBAK9B,CAAC;AAGH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;iBAMlC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;iBAMnC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;;iBAKnC,CAAC;AAGH,eAAO,MAAM,w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CAAC;AAC9F,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,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(),
@@ -12735,6 +12736,7 @@ var workflowFailedEventSchema = baseWorkflowEventSchema.extend({
12735
12736
  });
12736
12737
  var workflowResumedEventSchema = baseWorkflowEventSchema.extend({
12737
12738
  type: exports_external.literal("WorkflowResumed"),
12739
+ versionId: exports_external.string(),
12738
12740
  originalRunId: exports_external.string(),
12739
12741
  resumedSteps: exports_external.number().int().nonnegative(),
12740
12742
  pendingSteps: exports_external.number().int().nonnegative()
@@ -12765,6 +12767,14 @@ var runSubmittedEventSchema = baseWorkflowEventSchema.extend({
12765
12767
  metadata: exports_external.record(exports_external.string(), exports_external.any()).optional(),
12766
12768
  tags: exports_external.array(exports_external.string()).optional()
12767
12769
  });
12770
+ var workflowRerunFromStepEventSchema = baseWorkflowEventSchema.extend({
12771
+ type: exports_external.literal("WorkflowRerunFromStep"),
12772
+ parentRunId: exports_external.string(),
12773
+ rerunFromStepId: exports_external.string(),
12774
+ rerunStepIds: exports_external.array(exports_external.string()),
12775
+ versionId: exports_external.string(),
12776
+ parentVersionId: exports_external.string()
12777
+ });
12768
12778
  var workflowEventSchema = exports_external.discriminatedUnion("type", [
12769
12779
  runSubmittedEventSchema,
12770
12780
  workflowStartedEventSchema,
@@ -12773,7 +12783,8 @@ var workflowEventSchema = exports_external.discriminatedUnion("type", [
12773
12783
  workflowFailedEventSchema,
12774
12784
  workflowResumedEventSchema,
12775
12785
  workflowCancelledEventSchema,
12776
- workflowRetryStartedEventSchema
12786
+ workflowRetryStartedEventSchema,
12787
+ workflowRerunFromStepEventSchema
12777
12788
  ]);
12778
12789
  var eventSchema = exports_external.union([stepEventSchema, workflowEventSchema]);
12779
12790
  // src/projection.ts
@@ -13114,8 +13125,46 @@ function projectStepState(events, workflowSlug) {
13114
13125
  }
13115
13126
  return state;
13116
13127
  }
13128
+ function getVersionIdFromEvents(events) {
13129
+ const startedEvent = events.find((e) => e.type === "WorkflowStarted");
13130
+ return startedEvent?.versionId ?? "unknown";
13131
+ }
13117
13132
  // src/interface.ts
13118
13133
  class Backend {
13134
+ async calculateDependents(workflowSlug, targetStepId) {
13135
+ const workflowSteps = await this.getWorkflowSteps(workflowSlug);
13136
+ if (!workflowSteps || workflowSteps.length === 0) {
13137
+ throw new Error(`Cannot rerun workflow "${workflowSlug}": no registered step definitions found. ` + `Please ensure the worker has started and registered this workflow.`);
13138
+ }
13139
+ const dependentsMap = new Map;
13140
+ for (const step of workflowSteps) {
13141
+ const dependencies = step.dependencies || [];
13142
+ for (const depId of dependencies) {
13143
+ if (!dependentsMap.has(depId)) {
13144
+ dependentsMap.set(depId, []);
13145
+ }
13146
+ dependentsMap.get(depId).push(step.id);
13147
+ }
13148
+ }
13149
+ const stepExists = workflowSteps.some((s) => s.id === targetStepId);
13150
+ if (!stepExists) {
13151
+ throw new Error(`Cannot rerun from step "${targetStepId}": step not found in workflow "${workflowSlug}".`);
13152
+ }
13153
+ const allDependents = new Set;
13154
+ const visited = new Set;
13155
+ const dfs = (stepId) => {
13156
+ if (visited.has(stepId))
13157
+ return;
13158
+ visited.add(stepId);
13159
+ const dependents = dependentsMap.get(stepId) || [];
13160
+ for (const dependent of dependents) {
13161
+ allDependents.add(dependent);
13162
+ dfs(dependent);
13163
+ }
13164
+ };
13165
+ dfs(targetStepId);
13166
+ return allDependents;
13167
+ }
13119
13168
  }
13120
13169
  // src/serialization.ts
13121
13170
  function safeSerialize(value) {
@@ -13743,6 +13792,7 @@ export {
13743
13792
  workflowStartedEventSchema,
13744
13793
  workflowRetryStartedEventSchema,
13745
13794
  workflowResumedEventSchema,
13795
+ workflowRerunFromStepEventSchema,
13746
13796
  workflowInputValidationEventSchema,
13747
13797
  workflowFailedEventSchema,
13748
13798
  workflowEventSchema,
@@ -13779,6 +13829,7 @@ export {
13779
13829
  normalizePaths,
13780
13830
  logEntryEventSchema,
13781
13831
  hashString,
13832
+ getVersionIdFromEvents,
13782
13833
  getMicrosecondTimestamp,
13783
13834
  getCurrentAttemptNumber,
13784
13835
  extractTopFrames,
@@ -13824,4 +13875,4 @@ export {
13824
13875
  Backend
13825
13876
  };
13826
13877
 
13827
- //# debugId=8B4CDB82A5D2121C64756E2164756E21
13878
+ //# debugId=235E712262A1C2A664756E2164756E21