@durable-effect/jobs 0.0.1-next.1

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 (199) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +490 -0
  3. package/dist/client/client.d.ts +34 -0
  4. package/dist/client/client.d.ts.map +1 -0
  5. package/dist/client/client.js +427 -0
  6. package/dist/client/client.js.map +1 -0
  7. package/dist/client/index.d.ts +4 -0
  8. package/dist/client/index.d.ts.map +1 -0
  9. package/dist/client/index.js +4 -0
  10. package/dist/client/index.js.map +1 -0
  11. package/dist/client/response.d.ts +99 -0
  12. package/dist/client/response.d.ts.map +1 -0
  13. package/dist/client/response.js +92 -0
  14. package/dist/client/response.js.map +1 -0
  15. package/dist/client/types.d.ts +242 -0
  16. package/dist/client/types.d.ts.map +1 -0
  17. package/dist/client/types.js +3 -0
  18. package/dist/client/types.js.map +1 -0
  19. package/dist/definitions/continuous.d.ts +110 -0
  20. package/dist/definitions/continuous.d.ts.map +1 -0
  21. package/dist/definitions/continuous.js +79 -0
  22. package/dist/definitions/continuous.js.map +1 -0
  23. package/dist/definitions/debounce.d.ts +67 -0
  24. package/dist/definitions/debounce.d.ts.map +1 -0
  25. package/dist/definitions/debounce.js +28 -0
  26. package/dist/definitions/debounce.js.map +1 -0
  27. package/dist/definitions/index.d.ts +4 -0
  28. package/dist/definitions/index.d.ts.map +1 -0
  29. package/dist/definitions/index.js +5 -0
  30. package/dist/definitions/index.js.map +1 -0
  31. package/dist/definitions/task.d.ts +234 -0
  32. package/dist/definitions/task.d.ts.map +1 -0
  33. package/dist/definitions/task.js +106 -0
  34. package/dist/definitions/task.js.map +1 -0
  35. package/dist/engine/engine.d.ts +60 -0
  36. package/dist/engine/engine.d.ts.map +1 -0
  37. package/dist/engine/engine.js +89 -0
  38. package/dist/engine/engine.js.map +1 -0
  39. package/dist/engine/index.d.ts +3 -0
  40. package/dist/engine/index.d.ts.map +1 -0
  41. package/dist/engine/index.js +3 -0
  42. package/dist/engine/index.js.map +1 -0
  43. package/dist/engine/types.d.ts +53 -0
  44. package/dist/engine/types.d.ts.map +1 -0
  45. package/dist/engine/types.js +3 -0
  46. package/dist/engine/types.js.map +1 -0
  47. package/dist/errors.d.ts +119 -0
  48. package/dist/errors.d.ts.map +1 -0
  49. package/dist/errors.js +80 -0
  50. package/dist/errors.js.map +1 -0
  51. package/dist/factory.d.ts +97 -0
  52. package/dist/factory.d.ts.map +1 -0
  53. package/dist/factory.js +94 -0
  54. package/dist/factory.js.map +1 -0
  55. package/dist/handlers/continuous/context.d.ts +25 -0
  56. package/dist/handlers/continuous/context.d.ts.map +1 -0
  57. package/dist/handlers/continuous/context.js +38 -0
  58. package/dist/handlers/continuous/context.js.map +1 -0
  59. package/dist/handlers/continuous/executor.d.ts +10 -0
  60. package/dist/handlers/continuous/executor.d.ts.map +1 -0
  61. package/dist/handlers/continuous/executor.js +83 -0
  62. package/dist/handlers/continuous/executor.js.map +1 -0
  63. package/dist/handlers/continuous/handler.d.ts +14 -0
  64. package/dist/handlers/continuous/handler.d.ts.map +1 -0
  65. package/dist/handlers/continuous/handler.js +283 -0
  66. package/dist/handlers/continuous/handler.js.map +1 -0
  67. package/dist/handlers/continuous/index.d.ts +4 -0
  68. package/dist/handlers/continuous/index.d.ts.map +1 -0
  69. package/dist/handlers/continuous/index.js +4 -0
  70. package/dist/handlers/continuous/index.js.map +1 -0
  71. package/dist/handlers/continuous/types.d.ts +36 -0
  72. package/dist/handlers/continuous/types.d.ts.map +1 -0
  73. package/dist/handlers/continuous/types.js +3 -0
  74. package/dist/handlers/continuous/types.js.map +1 -0
  75. package/dist/handlers/debounce/handler.d.ts +14 -0
  76. package/dist/handlers/debounce/handler.d.ts.map +1 -0
  77. package/dist/handlers/debounce/handler.js +261 -0
  78. package/dist/handlers/debounce/handler.js.map +1 -0
  79. package/dist/handlers/debounce/index.d.ts +3 -0
  80. package/dist/handlers/debounce/index.d.ts.map +1 -0
  81. package/dist/handlers/debounce/index.js +3 -0
  82. package/dist/handlers/debounce/index.js.map +1 -0
  83. package/dist/handlers/debounce/types.d.ts +10 -0
  84. package/dist/handlers/debounce/types.d.ts.map +1 -0
  85. package/dist/handlers/debounce/types.js +3 -0
  86. package/dist/handlers/debounce/types.js.map +1 -0
  87. package/dist/handlers/index.d.ts +14 -0
  88. package/dist/handlers/index.d.ts.map +1 -0
  89. package/dist/handlers/index.js +25 -0
  90. package/dist/handlers/index.js.map +1 -0
  91. package/dist/handlers/task/context.d.ts +35 -0
  92. package/dist/handlers/task/context.d.ts.map +1 -0
  93. package/dist/handlers/task/context.js +156 -0
  94. package/dist/handlers/task/context.js.map +1 -0
  95. package/dist/handlers/task/handler.d.ts +13 -0
  96. package/dist/handlers/task/handler.d.ts.map +1 -0
  97. package/dist/handlers/task/handler.js +280 -0
  98. package/dist/handlers/task/handler.js.map +1 -0
  99. package/dist/handlers/task/index.d.ts +3 -0
  100. package/dist/handlers/task/index.d.ts.map +1 -0
  101. package/dist/handlers/task/index.js +2 -0
  102. package/dist/handlers/task/index.js.map +1 -0
  103. package/dist/handlers/task/types.d.ts +10 -0
  104. package/dist/handlers/task/types.d.ts.map +1 -0
  105. package/dist/handlers/task/types.js +3 -0
  106. package/dist/handlers/task/types.js.map +1 -0
  107. package/dist/index.d.ts +28 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +79 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/registry/index.d.ts +5 -0
  112. package/dist/registry/index.d.ts.map +1 -0
  113. package/dist/registry/index.js +4 -0
  114. package/dist/registry/index.js.map +1 -0
  115. package/dist/registry/registry.d.ts +74 -0
  116. package/dist/registry/registry.d.ts.map +1 -0
  117. package/dist/registry/registry.js +159 -0
  118. package/dist/registry/registry.js.map +1 -0
  119. package/dist/registry/typed.d.ts +146 -0
  120. package/dist/registry/typed.d.ts.map +1 -0
  121. package/dist/registry/typed.js +29 -0
  122. package/dist/registry/typed.js.map +1 -0
  123. package/dist/registry/types.d.ts +497 -0
  124. package/dist/registry/types.d.ts.map +1 -0
  125. package/dist/registry/types.js +3 -0
  126. package/dist/registry/types.js.map +1 -0
  127. package/dist/retry/errors.d.ts +31 -0
  128. package/dist/retry/errors.d.ts.map +1 -0
  129. package/dist/retry/errors.js +22 -0
  130. package/dist/retry/errors.js.map +1 -0
  131. package/dist/retry/executor.d.ts +53 -0
  132. package/dist/retry/executor.d.ts.map +1 -0
  133. package/dist/retry/executor.js +112 -0
  134. package/dist/retry/executor.js.map +1 -0
  135. package/dist/retry/index.d.ts +4 -0
  136. package/dist/retry/index.d.ts.map +1 -0
  137. package/dist/retry/index.js +4 -0
  138. package/dist/retry/index.js.map +1 -0
  139. package/dist/retry/types.d.ts +29 -0
  140. package/dist/retry/types.d.ts.map +1 -0
  141. package/dist/retry/types.js +3 -0
  142. package/dist/retry/types.js.map +1 -0
  143. package/dist/runtime/dispatcher.d.ts +39 -0
  144. package/dist/runtime/dispatcher.d.ts.map +1 -0
  145. package/dist/runtime/dispatcher.js +76 -0
  146. package/dist/runtime/dispatcher.js.map +1 -0
  147. package/dist/runtime/index.d.ts +4 -0
  148. package/dist/runtime/index.d.ts.map +1 -0
  149. package/dist/runtime/index.js +6 -0
  150. package/dist/runtime/index.js.map +1 -0
  151. package/dist/runtime/runtime.d.ts +88 -0
  152. package/dist/runtime/runtime.d.ts.map +1 -0
  153. package/dist/runtime/runtime.js +116 -0
  154. package/dist/runtime/runtime.js.map +1 -0
  155. package/dist/runtime/types.d.ts +182 -0
  156. package/dist/runtime/types.d.ts.map +1 -0
  157. package/dist/runtime/types.js +3 -0
  158. package/dist/runtime/types.js.map +1 -0
  159. package/dist/services/alarm.d.ts +37 -0
  160. package/dist/services/alarm.d.ts.map +1 -0
  161. package/dist/services/alarm.js +39 -0
  162. package/dist/services/alarm.js.map +1 -0
  163. package/dist/services/cleanup.d.ts +27 -0
  164. package/dist/services/cleanup.d.ts.map +1 -0
  165. package/dist/services/cleanup.js +25 -0
  166. package/dist/services/cleanup.js.map +1 -0
  167. package/dist/services/entity-state.d.ts +49 -0
  168. package/dist/services/entity-state.d.ts.map +1 -0
  169. package/dist/services/entity-state.js +72 -0
  170. package/dist/services/entity-state.js.map +1 -0
  171. package/dist/services/execution.d.ts +70 -0
  172. package/dist/services/execution.d.ts.map +1 -0
  173. package/dist/services/execution.js +159 -0
  174. package/dist/services/execution.js.map +1 -0
  175. package/dist/services/execution_test.d.ts +13 -0
  176. package/dist/services/execution_test.d.ts.map +1 -0
  177. package/dist/services/execution_test.js +11 -0
  178. package/dist/services/execution_test.js.map +1 -0
  179. package/dist/services/idempotency.d.ts +36 -0
  180. package/dist/services/idempotency.d.ts.map +1 -0
  181. package/dist/services/idempotency.js +48 -0
  182. package/dist/services/idempotency.js.map +1 -0
  183. package/dist/services/index.d.ts +19 -0
  184. package/dist/services/index.d.ts.map +1 -0
  185. package/dist/services/index.js +33 -0
  186. package/dist/services/index.js.map +1 -0
  187. package/dist/services/metadata.d.ts +64 -0
  188. package/dist/services/metadata.d.ts.map +1 -0
  189. package/dist/services/metadata.js +56 -0
  190. package/dist/services/metadata.js.map +1 -0
  191. package/dist/services/registry.d.ts +19 -0
  192. package/dist/services/registry.d.ts.map +1 -0
  193. package/dist/services/registry.js +17 -0
  194. package/dist/services/registry.js.map +1 -0
  195. package/dist/storage-keys.d.ts +38 -0
  196. package/dist/storage-keys.d.ts.map +1 -0
  197. package/dist/storage-keys.js +47 -0
  198. package/dist/storage-keys.js.map +1 -0
  199. package/package.json +35 -0
@@ -0,0 +1,29 @@
1
+ // packages/jobs/src/registry/typed.ts
2
+ // =============================================================================
3
+ // Type Guards
4
+ // =============================================================================
5
+ /**
6
+ * Check if a registry has a specific continuous job.
7
+ */
8
+ export function hasContinuousJob(registry, name) {
9
+ return name in registry.continuous;
10
+ }
11
+ /**
12
+ * Check if a registry has a specific debounce job.
13
+ */
14
+ export function hasDebounceJob(registry, name) {
15
+ return name in registry.debounce;
16
+ }
17
+ /**
18
+ * Check if a registry has a specific workerPool job.
19
+ */
20
+ export function hasWorkerPoolJob(registry, name) {
21
+ return name in registry.workerPool;
22
+ }
23
+ /**
24
+ * Check if a registry has a specific task job.
25
+ */
26
+ export function hasTaskJob(registry, name) {
27
+ return name in registry.task;
28
+ }
29
+ //# sourceMappingURL=typed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed.js","sourceRoot":"","sources":["../../src/registry/typed.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAwOtC,gFAAgF;AAChF,cAAc;AACd,gFAAgF;AAEhF;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAI9B,QAA6B,EAC7B,IAAO;IAEP,OAAO,IAAI,IAAI,QAAQ,CAAC,UAAU,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAI5B,QAA6B,EAC7B,IAAO;IAEP,OAAO,IAAI,IAAI,QAAQ,CAAC,QAAQ,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAI9B,QAA6B,EAC7B,IAAO;IAEP,OAAO,IAAI,IAAI,QAAQ,CAAC,UAAU,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAIxB,QAA6B,EAC7B,IAAO;IAEP,OAAO,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,497 @@
1
+ import type { Schema } from "effect";
2
+ import type { Effect, Duration } from "effect";
3
+ import type { JobRetryConfig } from "../retry/types";
4
+ /**
5
+ * Schedule for continuous jobs.
6
+ */
7
+ export type ContinuousSchedule = {
8
+ readonly _tag: "Every";
9
+ readonly interval: Duration.DurationInput;
10
+ } | {
11
+ readonly _tag: "Cron";
12
+ readonly expression: string;
13
+ };
14
+ /**
15
+ * Unregistered continuous job definition.
16
+ * Created by Continuous.make() - does not have a name yet.
17
+ * Name is assigned when registered via createDurableJobs().
18
+ */
19
+ export interface UnregisteredContinuousDefinition<S = unknown, E = unknown, R = never> {
20
+ readonly _tag: "ContinuousDefinition";
21
+ /** Schema for state - encoded type can be anything (typically same as S for simple schemas) */
22
+ readonly stateSchema: Schema.Schema<S, any, never>;
23
+ readonly schedule: ContinuousSchedule;
24
+ readonly startImmediately?: boolean;
25
+ /**
26
+ * Optional retry configuration for execute handler failures.
27
+ *
28
+ * When configured:
29
+ * - Failed executions are retried up to maxAttempts times
30
+ * - Retries are scheduled via alarm (durable, survives restarts)
31
+ * - After all retries exhausted, job is terminated (state purged)
32
+ *
33
+ * When not configured:
34
+ * - Failed executions fail immediately
35
+ */
36
+ readonly retry?: JobRetryConfig;
37
+ /** Function to execute on schedule */
38
+ execute(ctx: ContinuousContext<S>): Effect.Effect<void, E, R>;
39
+ }
40
+ /**
41
+ * Unregistered debounce job definition.
42
+ * Created by Debounce.make() - does not have a name yet.
43
+ */
44
+ export interface UnregisteredDebounceDefinition<I = unknown, S = unknown, E = unknown, R = never> {
45
+ readonly _tag: "DebounceDefinition";
46
+ readonly eventSchema: Schema.Schema<I, any, never>;
47
+ readonly stateSchema: Schema.Schema<S, any, never>;
48
+ readonly flushAfter: Duration.DurationInput;
49
+ readonly maxEvents?: number;
50
+ /**
51
+ * Optional retry configuration for flush/execute handler failures.
52
+ *
53
+ * When configured:
54
+ * - Failed flush executions are retried up to maxAttempts times
55
+ * - Events remain in buffer during retry attempts
56
+ * - Retries are scheduled via alarm
57
+ * - After all retries exhausted, job is terminated (state purged)
58
+ *
59
+ * When not configured:
60
+ * - Failed flush fails immediately
61
+ */
62
+ readonly retry?: JobRetryConfig;
63
+ execute(ctx: DebounceExecuteContext<S>): Effect.Effect<void, E, R>;
64
+ onEvent?(ctx: DebounceEventContext<I, S>): Effect.Effect<S, never, R>;
65
+ }
66
+ /**
67
+ * Retry configuration for workerPool jobs.
68
+ */
69
+ export interface WorkerPoolRetryConfig {
70
+ readonly maxAttempts: number;
71
+ readonly initialDelay: Duration.DurationInput;
72
+ readonly maxDelay?: Duration.DurationInput;
73
+ readonly backoffMultiplier?: number;
74
+ }
75
+ /**
76
+ * Unregistered workerPool job definition.
77
+ * Created by WorkerPool.make() - does not have a name yet.
78
+ */
79
+ export interface UnregisteredWorkerPoolDefinition<E = unknown, Err = unknown, R = never> {
80
+ readonly _tag: "WorkerPoolDefinition";
81
+ readonly eventSchema: Schema.Schema<E, any, never>;
82
+ readonly concurrency: number;
83
+ readonly retry?: WorkerPoolRetryConfig;
84
+ execute(ctx: WorkerPoolExecuteContext<E>): Effect.Effect<void, Err, R>;
85
+ onDeadLetter?(event: E, error: Err, ctx: WorkerPoolDeadLetterContext): Effect.Effect<void, never, R>;
86
+ onEmpty?(ctx: WorkerPoolEmptyContext): Effect.Effect<void, never, R>;
87
+ }
88
+ /**
89
+ * Unregistered task job definition.
90
+ * Created by Task.make() - does not have a name yet.
91
+ *
92
+ * Task provides user-controlled durable state machines:
93
+ * - Events update state and optionally schedule execution
94
+ * - Execute runs when alarm fires
95
+ * - User controls lifecycle via schedule/clear
96
+ *
97
+ * Type Parameters:
98
+ * - S: State schema type (decoded)
99
+ * - E: Event schema type (decoded)
100
+ * - Err: Error type from handlers
101
+ * - R: Effect requirements (context)
102
+ */
103
+ export interface UnregisteredTaskDefinition<S = unknown, E = unknown, Err = unknown, R = never> {
104
+ readonly _tag: "TaskDefinition";
105
+ /** Schema for validating and serializing state */
106
+ readonly stateSchema: Schema.Schema<S, any, never>;
107
+ /** Schema for validating incoming events */
108
+ readonly eventSchema: Schema.Schema<E, any, never>;
109
+ /**
110
+ * Handler called for each incoming event.
111
+ * Updates state and optionally schedules execution.
112
+ *
113
+ * @param event - The incoming event (already validated against eventSchema)
114
+ * @param ctx - Context for state access, scheduling, and metadata
115
+ */
116
+ onEvent(event: E, ctx: TaskEventContext<S>): Effect.Effect<void, Err, R>;
117
+ /**
118
+ * Handler called when alarm fires.
119
+ * Processes state and optionally schedules next execution.
120
+ */
121
+ execute(ctx: TaskExecuteContext<S>): Effect.Effect<void, Err, R>;
122
+ /**
123
+ * Optional handler called when either `onEvent` or `execute` completes
124
+ * and no alarm is scheduled.
125
+ */
126
+ onIdle?(ctx: TaskIdleContext<S>): Effect.Effect<void, never, R>;
127
+ /**
128
+ * Optional error handler for onEvent/execute failures.
129
+ * If not provided, errors are logged and task continues.
130
+ */
131
+ onError?(error: Err, ctx: TaskErrorContext<S>): Effect.Effect<void, never, R>;
132
+ }
133
+ /**
134
+ * Union of all unregistered job definition types.
135
+ *
136
+ * Note: Error types use `unknown` to accept definitions with any error type.
137
+ * The stored types (below) handle the runtime representation with unknown errors.
138
+ */
139
+ export type AnyUnregisteredDefinition = UnregisteredContinuousDefinition<any, unknown, any> | UnregisteredDebounceDefinition<any, any, unknown, any> | UnregisteredWorkerPoolDefinition<any, unknown, any> | UnregisteredTaskDefinition<any, any, unknown, any>;
140
+ /**
141
+ * Retry config with error type widened to unknown for storage.
142
+ * Simplified to only contain timing configuration.
143
+ */
144
+ export interface StoredJobRetryConfig {
145
+ readonly maxAttempts: number;
146
+ readonly delay?: import("@durable-effect/core").RetryDelay;
147
+ readonly jitter?: boolean;
148
+ readonly maxDuration?: Duration.DurationInput;
149
+ }
150
+ /**
151
+ * Stored continuous job definition (error type widened to unknown).
152
+ */
153
+ export interface StoredContinuousDefinition<S = unknown, R = never> {
154
+ readonly _tag: "ContinuousDefinition";
155
+ readonly name: string;
156
+ readonly stateSchema: Schema.Schema<S, any, never>;
157
+ readonly schedule: ContinuousSchedule;
158
+ readonly startImmediately?: boolean;
159
+ readonly retry?: StoredJobRetryConfig;
160
+ execute(ctx: ContinuousContext<S>): Effect.Effect<void, unknown, R>;
161
+ }
162
+ /**
163
+ * Stored debounce job definition (error type widened to unknown).
164
+ */
165
+ export interface StoredDebounceDefinition<I = unknown, S = unknown, R = never> {
166
+ readonly _tag: "DebounceDefinition";
167
+ readonly name: string;
168
+ readonly eventSchema: Schema.Schema<I, any, never>;
169
+ readonly stateSchema: Schema.Schema<S, any, never>;
170
+ readonly flushAfter: Duration.DurationInput;
171
+ readonly maxEvents?: number;
172
+ readonly retry?: StoredJobRetryConfig;
173
+ execute(ctx: DebounceExecuteContext<S>): Effect.Effect<void, unknown, R>;
174
+ onEvent?(ctx: DebounceEventContext<I, S>): Effect.Effect<S, never, R>;
175
+ }
176
+ /**
177
+ * Stored workerPool job definition (error type widened to unknown).
178
+ */
179
+ export interface StoredWorkerPoolDefinition<E = unknown, R = never> {
180
+ readonly _tag: "WorkerPoolDefinition";
181
+ readonly name: string;
182
+ readonly eventSchema: Schema.Schema<E, any, never>;
183
+ readonly concurrency: number;
184
+ readonly retry?: WorkerPoolRetryConfig;
185
+ execute(ctx: WorkerPoolExecuteContext<E>): Effect.Effect<void, unknown, R>;
186
+ onDeadLetter?(event: E, error: unknown, ctx: WorkerPoolDeadLetterContext): Effect.Effect<void, never, R>;
187
+ onEmpty?(ctx: WorkerPoolEmptyContext): Effect.Effect<void, never, R>;
188
+ }
189
+ /**
190
+ * Stored task job definition (error type widened to unknown).
191
+ */
192
+ export interface StoredTaskDefinition<S = unknown, E = unknown, R = never> {
193
+ readonly _tag: "TaskDefinition";
194
+ readonly name: string;
195
+ readonly stateSchema: Schema.Schema<S, any, never>;
196
+ readonly eventSchema: Schema.Schema<E, any, never>;
197
+ onEvent(event: E, ctx: TaskEventContext<S>): Effect.Effect<void, unknown, R>;
198
+ execute(ctx: TaskExecuteContext<S>): Effect.Effect<void, unknown, R>;
199
+ onIdle?(ctx: TaskIdleContext<S>): Effect.Effect<void, never, R>;
200
+ onError?(error: unknown, ctx: TaskErrorContext<S>): Effect.Effect<void, never, R>;
201
+ }
202
+ /**
203
+ * Continuous job definition with name (after registration).
204
+ */
205
+ export interface ContinuousDefinition<S = unknown, E = unknown, R = never> extends UnregisteredContinuousDefinition<S, E, R> {
206
+ readonly name: string;
207
+ }
208
+ /**
209
+ * Debounce job definition with name (after registration).
210
+ */
211
+ export interface DebounceDefinition<I = unknown, S = unknown, E = unknown, R = never> extends UnregisteredDebounceDefinition<I, S, E, R> {
212
+ readonly name: string;
213
+ }
214
+ /**
215
+ * WorkerPool job definition with name (after registration).
216
+ */
217
+ export interface WorkerPoolDefinition<E = unknown, Err = unknown, R = never> extends UnregisteredWorkerPoolDefinition<E, Err, R> {
218
+ readonly name: string;
219
+ }
220
+ /**
221
+ * Task job definition with name (after registration).
222
+ */
223
+ export interface TaskDefinition<S = unknown, E = unknown, Err = unknown, R = never> extends UnregisteredTaskDefinition<S, E, Err, R> {
224
+ readonly name: string;
225
+ }
226
+ /**
227
+ * Union of all registered job definition types.
228
+ */
229
+ export type AnyJobDefinition = ContinuousDefinition<any, any, any> | DebounceDefinition<any, any, any, any> | WorkerPoolDefinition<any, any, any> | TaskDefinition<any, any, any, any>;
230
+ /**
231
+ * Options for terminating a continuous job.
232
+ */
233
+ export interface TerminateOptions {
234
+ /** Optional reason for termination */
235
+ readonly reason?: string;
236
+ }
237
+ /**
238
+ * Context provided to continuous job execute function.
239
+ */
240
+ export interface ContinuousContext<S> {
241
+ /** Current state value */
242
+ readonly state: Effect.Effect<S, never, never>;
243
+ /** Replace the entire state */
244
+ readonly setState: (state: S) => Effect.Effect<void, never, never>;
245
+ /** Update state via transformation function */
246
+ readonly updateState: (fn: (current: S) => S) => Effect.Effect<void, never, never>;
247
+ /** The unique instance ID for this job instance */
248
+ readonly instanceId: string;
249
+ /** The number of times execute has been called (1-indexed) */
250
+ readonly runCount: number;
251
+ /** The name of this job (as registered) */
252
+ readonly jobName: string;
253
+ /**
254
+ * Current retry attempt (1 = first attempt, 2+ = retry).
255
+ * Only relevant when retry is configured.
256
+ */
257
+ readonly attempt: number;
258
+ /**
259
+ * Whether this execution is a retry of a previous failure.
260
+ */
261
+ readonly isRetry: boolean;
262
+ /**
263
+ * Terminate this job instance.
264
+ *
265
+ * When called, the job will:
266
+ * 1. Cancel any scheduled alarm
267
+ * 2. Delete all state from storage
268
+ * 3. Short-circuit the current execution (no further code runs)
269
+ *
270
+ * @param options.reason - Optional reason for termination
271
+ * @returns Effect<never> - short-circuits execution
272
+ *
273
+ * @example
274
+ * ```ts
275
+ * if (ctx.state.failureCount > 10) {
276
+ * return yield* ctx.terminate({ reason: "Too many failures" });
277
+ * }
278
+ * ```
279
+ */
280
+ readonly terminate: (options?: TerminateOptions) => Effect.Effect<never, never, never>;
281
+ }
282
+ /**
283
+ * Context provided to debounce job execute function.
284
+ */
285
+ export interface DebounceExecuteContext<S> {
286
+ readonly state: Effect.Effect<S, never, never>;
287
+ readonly eventCount: Effect.Effect<number, never, never>;
288
+ readonly instanceId: string;
289
+ readonly debounceStartedAt: Effect.Effect<number, never, never>;
290
+ readonly executionStartedAt: number;
291
+ readonly flushReason: "maxEvents" | "flushAfter" | "manual";
292
+ /**
293
+ * Current retry attempt (1 = first attempt, 2+ = retry).
294
+ * Only relevant when retry is configured.
295
+ */
296
+ readonly attempt: number;
297
+ /**
298
+ * Whether this execution is a retry of a previous failure.
299
+ */
300
+ readonly isRetry: boolean;
301
+ }
302
+ /**
303
+ * Context provided to debounce job onEvent function.
304
+ *
305
+ * Note: On the first event, `state` equals `event` (auto-initialized).
306
+ * This means `I` should be assignable to `S` for proper type safety.
307
+ */
308
+ export interface DebounceEventContext<I, S> {
309
+ readonly event: I;
310
+ readonly state: S;
311
+ readonly eventCount: number;
312
+ readonly instanceId: string;
313
+ }
314
+ /**
315
+ * Context provided to workerPool job execute function.
316
+ */
317
+ export interface WorkerPoolExecuteContext<E> {
318
+ readonly event: E;
319
+ readonly eventId: string;
320
+ readonly attempt: number;
321
+ readonly instanceId: string;
322
+ readonly instanceIndex: number;
323
+ readonly jobName: string;
324
+ }
325
+ /**
326
+ * Context provided to workerPool job onDeadLetter function.
327
+ */
328
+ export interface WorkerPoolDeadLetterContext {
329
+ readonly eventId: string;
330
+ readonly attempts: number;
331
+ readonly instanceId: string;
332
+ readonly instanceIndex: number;
333
+ readonly jobName: string;
334
+ }
335
+ /**
336
+ * Context provided to workerPool job onEmpty function.
337
+ */
338
+ export interface WorkerPoolEmptyContext {
339
+ readonly instanceId: string;
340
+ readonly instanceIndex: number;
341
+ readonly jobName: string;
342
+ readonly processedCount: number;
343
+ }
344
+ /**
345
+ * Context provided to task onEvent handler.
346
+ *
347
+ * The event is passed as the first parameter to onEvent, not on the context.
348
+ * This makes it clear that the event is a direct value, not an Effect.
349
+ *
350
+ * The onEvent handler receives each incoming event and should:
351
+ * - Update state based on the event
352
+ * - Schedule execution if needed (via ctx.schedule)
353
+ * - Optionally terminate the task (via ctx.terminate)
354
+ */
355
+ export interface TaskEventContext<S> {
356
+ /** Current state (null if no state set yet) */
357
+ readonly state: Effect.Effect<S | null, never, never>;
358
+ /** Replace the entire state */
359
+ readonly setState: (state: S) => Effect.Effect<void, never, never>;
360
+ /** Update state via transformation function (no-op if state is null) */
361
+ readonly updateState: (fn: (current: S) => S) => Effect.Effect<void, never, never>;
362
+ /**
363
+ * Schedule execution at a specific time.
364
+ * @param when - Duration from now, timestamp (ms), or Date
365
+ */
366
+ readonly schedule: (when: Duration.DurationInput | number | Date) => Effect.Effect<void, never, never>;
367
+ /** Cancel any scheduled execution */
368
+ readonly cancelSchedule: () => Effect.Effect<void, never, never>;
369
+ /** Get the currently scheduled execution time (null if none) */
370
+ readonly getScheduledTime: () => Effect.Effect<number | null, never, never>;
371
+ /**
372
+ * Terminate this task - cancel alarms and delete all state.
373
+ * Short-circuits the current handler (no further code runs).
374
+ */
375
+ readonly terminate: () => Effect.Effect<never, never, never>;
376
+ /** The unique instance ID for this task */
377
+ readonly instanceId: string;
378
+ /** The name of this job (as registered) */
379
+ readonly jobName: string;
380
+ /** When this handler invocation started (ms since epoch) */
381
+ readonly executionStartedAt: number;
382
+ /** True if this is the first event (state was null) */
383
+ readonly isFirstEvent: boolean;
384
+ /** Total number of events received (Effect for lazy loading) */
385
+ readonly eventCount: Effect.Effect<number, never, never>;
386
+ /** When this task was created (Effect for lazy loading) */
387
+ readonly createdAt: Effect.Effect<number, never, never>;
388
+ }
389
+ /**
390
+ * Context provided to task execute handler.
391
+ *
392
+ * The execute handler runs when an alarm fires and should:
393
+ * - Process the current state
394
+ * - Schedule next execution if needed
395
+ * - Clear the task when complete
396
+ */
397
+ export interface TaskExecuteContext<S> {
398
+ /** Get current state (null if no state set) */
399
+ readonly state: Effect.Effect<S | null, never, never>;
400
+ /** Replace the entire state */
401
+ readonly setState: (state: S) => Effect.Effect<void, never, never>;
402
+ /** Update state via transformation function */
403
+ readonly updateState: (fn: (current: S) => S) => Effect.Effect<void, never, never>;
404
+ /**
405
+ * Schedule next execution at a specific time.
406
+ * @param when - Duration from now, timestamp (ms), or Date
407
+ */
408
+ readonly schedule: (when: Duration.DurationInput | number | Date) => Effect.Effect<void, never, never>;
409
+ /** Cancel any scheduled execution */
410
+ readonly cancelSchedule: () => Effect.Effect<void, never, never>;
411
+ /** Get the currently scheduled execution time (null if none) */
412
+ readonly getScheduledTime: () => Effect.Effect<number | null, never, never>;
413
+ /**
414
+ * Terminate this task - cancel alarms and delete all state.
415
+ * Short-circuits the current handler.
416
+ */
417
+ readonly terminate: () => Effect.Effect<never, never, never>;
418
+ /** The unique instance ID for this task */
419
+ readonly instanceId: string;
420
+ /** The name of this job (as registered) */
421
+ readonly jobName: string;
422
+ /** When this handler invocation started (ms since epoch) */
423
+ readonly executionStartedAt: number;
424
+ /** Total number of events received */
425
+ readonly eventCount: Effect.Effect<number, never, never>;
426
+ /** When this task was created */
427
+ readonly createdAt: Effect.Effect<number, never, never>;
428
+ /** Number of times execute has been called (1-indexed) */
429
+ readonly executeCount: Effect.Effect<number, never, never>;
430
+ }
431
+ /**
432
+ * Context provided to task onIdle handler.
433
+ *
434
+ * Called when either onEvent or execute completes without scheduling
435
+ * another execution. Use this to schedule cleanup or maintenance.
436
+ */
437
+ export interface TaskIdleContext<S> {
438
+ /** Get current state */
439
+ readonly state: Effect.Effect<S | null, never, never>;
440
+ /** Schedule execution (e.g., for delayed cleanup) */
441
+ readonly schedule: (when: Duration.DurationInput | number | Date) => Effect.Effect<void, never, never>;
442
+ /** Terminate the task immediately - cancel alarms and delete all state */
443
+ readonly terminate: () => Effect.Effect<never, never, never>;
444
+ /** The unique instance ID for this task */
445
+ readonly instanceId: string;
446
+ /** The name of this job (as registered) */
447
+ readonly jobName: string;
448
+ /** What triggered the idle state */
449
+ readonly idleReason: "onEvent" | "execute";
450
+ }
451
+ /**
452
+ * Context provided to task onError handler.
453
+ *
454
+ * Called when onEvent or execute throws an error.
455
+ * Use this to log errors, update state, or schedule retries.
456
+ */
457
+ export interface TaskErrorContext<S> {
458
+ /** Get current state */
459
+ readonly state: Effect.Effect<S | null, never, never>;
460
+ /** Update state (e.g., to track error count) */
461
+ readonly updateState: (fn: (current: S) => S) => Effect.Effect<void, never, never>;
462
+ /** Schedule execution (e.g., for retry) */
463
+ readonly schedule: (when: Duration.DurationInput | number | Date) => Effect.Effect<void, never, never>;
464
+ /** Terminate the task immediately - cancel alarms and delete all state */
465
+ readonly terminate: () => Effect.Effect<never, never, never>;
466
+ /** The unique instance ID for this task */
467
+ readonly instanceId: string;
468
+ /** The name of this job (as registered) */
469
+ readonly jobName: string;
470
+ /** Which handler produced the error */
471
+ readonly errorSource: "onEvent" | "execute";
472
+ }
473
+ /**
474
+ * Registry of job definitions.
475
+ *
476
+ * Organized by job type for efficient lookup.
477
+ */
478
+ export interface JobRegistry {
479
+ readonly continuous: Map<string, ContinuousDefinition<any, any, any>>;
480
+ readonly debounce: Map<string, DebounceDefinition<any, any, any, any>>;
481
+ readonly workerPool: Map<string, WorkerPoolDefinition<any, any, any>>;
482
+ }
483
+ /**
484
+ * Type helper to extract the registry type from a definitions object.
485
+ */
486
+ export type InferRegistry<T extends Record<string, AnyJobDefinition>> = {
487
+ continuous: {
488
+ [K in keyof T as T[K] extends ContinuousDefinition<any, any, any> ? K : never]: T[K] extends ContinuousDefinition<infer S, infer E, infer R> ? ContinuousDefinition<S, E, R> : never;
489
+ };
490
+ debounce: {
491
+ [K in keyof T as T[K] extends DebounceDefinition<any, any, any, any> ? K : never]: T[K] extends DebounceDefinition<infer I, infer S, infer E, infer R> ? DebounceDefinition<I, S, E, R> : never;
492
+ };
493
+ workerPool: {
494
+ [K in keyof T as T[K] extends WorkerPoolDefinition<any, any, any> ? K : never]: T[K] extends WorkerPoolDefinition<infer E, infer Err, infer R> ? WorkerPoolDefinition<E, Err, R> : never;
495
+ };
496
+ };
497
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMrD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAA;CAAE,GACrE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAM3D;;;;GAIG;AACH,MAAM,WAAW,gCAAgC,CAC/C,CAAC,GAAG,OAAO,EACX,CAAC,GAAG,OAAO,EACX,CAAC,GAAG,KAAK;IAET,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,+FAA+F;IAC/F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACnD,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC,sCAAsC;IACtC,OAAO,CAAC,GAAG,EAAE,iBAAiB,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AAC,CAAC,SAAS,oBAAoB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GACpE,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC7B,KAAK;KACV,CAAC;IACF,QAAQ,EAAE;SACP,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAChE,CAAC,GACD,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAC3E,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC9B,KAAK;KACV,CAAC;IACF,UAAU,EAAE;SACT,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAC7D,CAAC,GACD,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,oBAAoB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,MAAM,CAAC,CAAC,GACtE,oBAAoB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAC/B,KAAK;KACV,CAAC;CACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ // packages/jobs/src/registry/types.ts
2
+ export {};
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA,sCAAsC"}
@@ -0,0 +1,31 @@
1
+ import type { RetryExhaustedInfo } from "./types";
2
+ declare const RetryExhaustedSignal_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
3
+ readonly _tag: "RetryExhaustedSignal";
4
+ } & Readonly<A>;
5
+ /**
6
+ * Signal that all retry attempts have been exhausted.
7
+ *
8
+ * This is a control flow signal, not a true error. It's caught by
9
+ * JobExecutionService which then either:
10
+ * - Calls onRetryExhausted if defined on the job
11
+ * - Terminates the job (default behavior for cost control)
12
+ */
13
+ export declare class RetryExhaustedSignal extends RetryExhaustedSignal_base<RetryExhaustedInfo & {
14
+ readonly reason: "max_attempts_exceeded" | "max_duration_exceeded";
15
+ }> {
16
+ get message(): string;
17
+ }
18
+ declare const RetryScheduledSignal_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
19
+ readonly _tag: "RetryScheduledSignal";
20
+ } & Readonly<A>;
21
+ /**
22
+ * Signal that a retry has been scheduled.
23
+ * This is a control flow signal, not an error - caught by handlers.
24
+ */
25
+ export declare class RetryScheduledSignal extends RetryScheduledSignal_base<{
26
+ readonly resumeAt: number;
27
+ readonly attempt: number;
28
+ }> {
29
+ }
30
+ export {};
31
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/retry/errors.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;;;;AAElD;;;;;;;GAOG;AACH,qBAAa,oBAAqB,SAAQ,0BACxC,kBAAkB,GAAG;IACnB,QAAQ,CAAC,MAAM,EAAE,uBAAuB,GAAG,uBAAuB,CAAC;CACpE,CACF;IACC,IAAI,OAAO,IAAI,MAAM,CAEpB;CACF;;;;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,0BAAyC;IACjF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;CAAG"}
@@ -0,0 +1,22 @@
1
+ // packages/jobs/src/retry/errors.ts
2
+ import { Data } from "effect";
3
+ /**
4
+ * Signal that all retry attempts have been exhausted.
5
+ *
6
+ * This is a control flow signal, not a true error. It's caught by
7
+ * JobExecutionService which then either:
8
+ * - Calls onRetryExhausted if defined on the job
9
+ * - Terminates the job (default behavior for cost control)
10
+ */
11
+ export class RetryExhaustedSignal extends Data.TaggedError("RetryExhaustedSignal") {
12
+ get message() {
13
+ return `Job "${this.jobName}" exhausted after ${this.attempts} attempts: ${this.reason}`;
14
+ }
15
+ }
16
+ /**
17
+ * Signal that a retry has been scheduled.
18
+ * This is a control flow signal, not an error - caught by handlers.
19
+ */
20
+ export class RetryScheduledSignal extends Data.TaggedError("RetryScheduledSignal") {
21
+ }
22
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/retry/errors.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B;;;;;;;GAOG;AACH,MAAM,OAAO,oBAAqB,SAAQ,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAIhF;IACC,IAAI,OAAO;QACT,OAAO,QAAQ,IAAI,CAAC,OAAO,qBAAqB,IAAI,CAAC,QAAQ,cAAc,IAAI,CAAC,MAAM,EAAE,CAAC;IAC3F,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAG/E;CAAG"}