@multiplier-labs/stepflow 0.3.3 → 0.3.6

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 (84) hide show
  1. package/README.md +9 -0
  2. package/dist/{chunk-GYPNJBDP.js → chunk-D5HW7VEG.js} +269 -48
  3. package/dist/chunk-D5HW7VEG.js.map +1 -0
  4. package/dist/{chunk-KHTUWLVZ.js → chunk-FMPJBK2N.js} +55 -10
  5. package/dist/chunk-FMPJBK2N.js.map +1 -0
  6. package/dist/{chunk-ML35PIHX.js → chunk-JPXPB7U5.js} +52 -2
  7. package/dist/chunk-JPXPB7U5.js.map +1 -0
  8. package/dist/{chunk-4VOKMGP6.js → chunk-JUPZEBR3.js} +519 -522
  9. package/dist/chunk-JUPZEBR3.js.map +1 -0
  10. package/dist/events/index.d.ts +58 -3
  11. package/dist/events/index.js +1 -1
  12. package/dist/{index-Dzr437iW.d.ts → index-Cd0IZ40L.d.ts} +50 -11
  13. package/dist/index.d.ts +2 -12
  14. package/dist/index.js +764 -485
  15. package/dist/index.js.map +1 -1
  16. package/dist/scheduler/index.d.ts +1 -1
  17. package/dist/scheduler/index.js +2 -2
  18. package/dist/storage/index.d.ts +313 -47
  19. package/dist/storage/index.js +4 -2
  20. package/package.json +27 -13
  21. package/.codekin/reports/comments/2026-04-04_comment-assessment.md +0 -179
  22. package/.codekin/reports/complexity/2026-04-03_complexity-report.md +0 -152
  23. package/.codekin/reports/dependencies/2026-04-04_dependency-health.md +0 -94
  24. package/.codekin/reports/docs-audit/2026-04-04_docs-audit.md +0 -10
  25. package/.codekin/reports/security/2026-04-03_security-audit.md +0 -208
  26. package/.github/CODEOWNERS +0 -15
  27. package/.github/dependabot.yml +0 -23
  28. package/.github/workflows/ci.yml +0 -38
  29. package/.github/workflows/publish.yml +0 -36
  30. package/.github/workflows/security.yml +0 -29
  31. package/CHANGELOG.md +0 -34
  32. package/SECURITY.md +0 -40
  33. package/dist/chunk-4VOKMGP6.js.map +0 -1
  34. package/dist/chunk-GYPNJBDP.js.map +0 -1
  35. package/dist/chunk-KHTUWLVZ.js.map +0 -1
  36. package/dist/chunk-ML35PIHX.js.map +0 -1
  37. package/docs/github-packages-setup.md +0 -97
  38. package/docs/stepflow-api-reference.md +0 -1661
  39. package/src/core/engine.test.ts +0 -1365
  40. package/src/core/engine.ts +0 -692
  41. package/src/core/index.ts +0 -7
  42. package/src/core/orchestrator.ts +0 -571
  43. package/src/core/types.ts +0 -220
  44. package/src/events/index.ts +0 -8
  45. package/src/events/memory.test.ts +0 -107
  46. package/src/events/memory.ts +0 -92
  47. package/src/events/socketio.test.ts +0 -378
  48. package/src/events/socketio.ts +0 -262
  49. package/src/events/types.ts +0 -118
  50. package/src/events/webhook.test.ts +0 -657
  51. package/src/events/webhook.ts +0 -564
  52. package/src/index.ts +0 -270
  53. package/src/planning/index.ts +0 -55
  54. package/src/planning/planner.ts +0 -576
  55. package/src/planning/planning.test.ts +0 -727
  56. package/src/planning/registry.test.ts +0 -398
  57. package/src/planning/registry.ts +0 -365
  58. package/src/planning/types.ts +0 -566
  59. package/src/scheduler/cron.test.ts +0 -471
  60. package/src/scheduler/cron.ts +0 -414
  61. package/src/scheduler/index.ts +0 -8
  62. package/src/scheduler/postgres-persistence.ts +0 -518
  63. package/src/scheduler/sqlite-persistence.test.ts +0 -235
  64. package/src/scheduler/sqlite-persistence.ts +0 -261
  65. package/src/scheduler/types.ts +0 -73
  66. package/src/storage/index.ts +0 -27
  67. package/src/storage/memory.test.ts +0 -349
  68. package/src/storage/memory.ts +0 -227
  69. package/src/storage/postgres.ts +0 -1354
  70. package/src/storage/sqlite.test.ts +0 -466
  71. package/src/storage/sqlite.ts +0 -627
  72. package/src/storage/types.ts +0 -343
  73. package/src/utils/errors.test.ts +0 -150
  74. package/src/utils/errors.ts +0 -161
  75. package/src/utils/id.ts +0 -21
  76. package/src/utils/index.ts +0 -8
  77. package/src/utils/logger.test.ts +0 -121
  78. package/src/utils/logger.ts +0 -96
  79. package/src/utils/postgres-deps.ts +0 -63
  80. package/src/utils/retry.test.ts +0 -177
  81. package/src/utils/retry.ts +0 -121
  82. package/tsconfig.json +0 -21
  83. package/tsup.config.ts +0 -14
  84. package/vitest.config.ts +0 -9
@@ -1,118 +0,0 @@
1
- /**
2
- * Event system types for the workflow engine.
3
- */
4
-
5
- import type { WorkflowKind } from '../core/types';
6
-
7
- // ============================================================================
8
- // Event Types
9
- // ============================================================================
10
-
11
- /**
12
- * Built-in event types emitted by the workflow engine.
13
- */
14
- export type BuiltInEventType =
15
- | 'run.created'
16
- | 'run.queued'
17
- | 'run.dequeued'
18
- | 'run.started'
19
- | 'run.resumed'
20
- | 'run.completed'
21
- | 'run.failed'
22
- | 'run.canceled'
23
- | 'run.timeout'
24
- | 'step.started'
25
- | 'step.completed'
26
- | 'step.failed'
27
- | 'step.skipped'
28
- | 'step.retry';
29
-
30
- /**
31
- * Event types emitted by the workflow engine.
32
- * Includes built-in types and allows custom events via string.
33
- */
34
- export type WorkflowEventType = BuiltInEventType | (string & {});
35
-
36
- // ============================================================================
37
- // Event Payload
38
- // ============================================================================
39
-
40
- /**
41
- * Workflow event payload structure.
42
- */
43
- export interface WorkflowEvent {
44
- /** Unique run identifier */
45
- runId: string;
46
-
47
- /** Workflow type */
48
- kind: WorkflowKind;
49
-
50
- /** Type of event */
51
- eventType: WorkflowEventType;
52
-
53
- /** Step key (for step-related events) */
54
- stepKey?: string;
55
-
56
- /** When the event occurred */
57
- timestamp: Date;
58
-
59
- /** Event-specific data */
60
- payload?: unknown;
61
- }
62
-
63
- // ============================================================================
64
- // Event Callback Types
65
- // ============================================================================
66
-
67
- /**
68
- * Callback function for handling workflow events.
69
- */
70
- export type EventCallback = (event: WorkflowEvent) => void;
71
-
72
- /**
73
- * Unsubscribe function returned when subscribing to events.
74
- */
75
- export type Unsubscribe = () => void;
76
-
77
- // ============================================================================
78
- // Event Transport Interface
79
- // ============================================================================
80
-
81
- /**
82
- * Event transport interface.
83
- * Implement this to customize how events are delivered.
84
- */
85
- export interface EventTransport {
86
- /**
87
- * Emit an event to all subscribers.
88
- */
89
- emit(event: WorkflowEvent): void;
90
-
91
- /**
92
- * Subscribe to events for a specific run.
93
- * @returns Unsubscribe function
94
- */
95
- subscribe(runId: string, callback: EventCallback): Unsubscribe;
96
-
97
- /**
98
- * Subscribe to all events.
99
- * @returns Unsubscribe function
100
- */
101
- subscribeAll(callback: EventCallback): Unsubscribe;
102
-
103
- /**
104
- * Optional: Filter events by type.
105
- * @returns Unsubscribe function
106
- */
107
- subscribeToType?(eventType: WorkflowEventType, callback: EventCallback): Unsubscribe;
108
-
109
- /**
110
- * Optional: Persist event for later retrieval.
111
- */
112
- persist?(event: WorkflowEvent): Promise<void>;
113
-
114
- /**
115
- * Optional: Close/cleanup the transport.
116
- */
117
- close?(): void;
118
- }