@ironflow/node 0.20.2 → 0.21.0

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 (145) hide show
  1. package/dist/agent/agent.d.ts +60 -0
  2. package/dist/agent/agent.d.ts.map +1 -0
  3. package/dist/agent/agent.js +133 -0
  4. package/dist/agent/agent.js.map +1 -0
  5. package/dist/agent/approve.d.ts +23 -0
  6. package/dist/agent/approve.d.ts.map +1 -0
  7. package/dist/agent/approve.js +42 -0
  8. package/dist/agent/approve.js.map +1 -0
  9. package/dist/agent/dispatch.d.ts +63 -0
  10. package/dist/agent/dispatch.d.ts.map +1 -0
  11. package/dist/agent/dispatch.js +130 -0
  12. package/dist/agent/dispatch.js.map +1 -0
  13. package/dist/agent/errors.d.ts +90 -0
  14. package/dist/agent/errors.d.ts.map +1 -0
  15. package/dist/agent/errors.js +136 -0
  16. package/dist/agent/errors.js.map +1 -0
  17. package/dist/agent/index.d.ts +35 -0
  18. package/dist/agent/index.d.ts.map +1 -0
  19. package/dist/agent/index.js +32 -0
  20. package/dist/agent/index.js.map +1 -0
  21. package/dist/agent/internal-registry.d.ts +27 -0
  22. package/dist/agent/internal-registry.d.ts.map +1 -0
  23. package/dist/agent/internal-registry.js +36 -0
  24. package/dist/agent/internal-registry.js.map +1 -0
  25. package/dist/agent/internal.d.ts +24 -0
  26. package/dist/agent/internal.d.ts.map +1 -0
  27. package/dist/agent/internal.js +29 -0
  28. package/dist/agent/internal.js.map +1 -0
  29. package/dist/agent/llm.d.ts +39 -0
  30. package/dist/agent/llm.d.ts.map +1 -0
  31. package/dist/agent/llm.js +59 -0
  32. package/dist/agent/llm.js.map +1 -0
  33. package/dist/agent/mcp.d.ts +51 -0
  34. package/dist/agent/mcp.d.ts.map +1 -0
  35. package/dist/agent/mcp.js +155 -0
  36. package/dist/agent/mcp.js.map +1 -0
  37. package/dist/agent/memory.d.ts +74 -0
  38. package/dist/agent/memory.d.ts.map +1 -0
  39. package/dist/agent/memory.js +130 -0
  40. package/dist/agent/memory.js.map +1 -0
  41. package/dist/agent/spawn.d.ts +20 -0
  42. package/dist/agent/spawn.d.ts.map +1 -0
  43. package/dist/agent/spawn.js +29 -0
  44. package/dist/agent/spawn.js.map +1 -0
  45. package/dist/agent/tool.d.ts +39 -0
  46. package/dist/agent/tool.d.ts.map +1 -0
  47. package/dist/agent/tool.js +103 -0
  48. package/dist/agent/tool.js.map +1 -0
  49. package/dist/agent/types.d.ts +363 -0
  50. package/dist/agent/types.d.ts.map +1 -0
  51. package/dist/agent/types.js +9 -0
  52. package/dist/agent/types.js.map +1 -0
  53. package/dist/client.d.ts +942 -0
  54. package/dist/client.d.ts.map +1 -0
  55. package/dist/client.js +1557 -0
  56. package/dist/client.js.map +1 -0
  57. package/dist/command-dedup.d.ts +61 -0
  58. package/dist/command-dedup.d.ts.map +1 -0
  59. package/dist/command-dedup.js +129 -0
  60. package/dist/command-dedup.js.map +1 -0
  61. package/dist/config-client.d.ts +58 -0
  62. package/dist/config-client.d.ts.map +1 -0
  63. package/dist/config-client.js +171 -0
  64. package/dist/config-client.js.map +1 -0
  65. package/dist/function.d.ts +53 -0
  66. package/dist/function.d.ts.map +1 -0
  67. package/dist/function.js +72 -0
  68. package/dist/function.js.map +1 -0
  69. package/dist/index.d.ts +71 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/index.js +70 -0
  72. package/dist/index.js.map +1 -0
  73. package/dist/internal/assert-defined.d.ts +10 -0
  74. package/dist/internal/assert-defined.d.ts.map +1 -0
  75. package/dist/internal/assert-defined.js +15 -0
  76. package/dist/internal/assert-defined.js.map +1 -0
  77. package/dist/internal/context.d.ts +142 -0
  78. package/dist/internal/context.d.ts.map +1 -0
  79. package/dist/internal/context.js +306 -0
  80. package/dist/internal/context.js.map +1 -0
  81. package/dist/internal/errors.d.ts +66 -0
  82. package/dist/internal/errors.d.ts.map +1 -0
  83. package/dist/internal/errors.js +29 -0
  84. package/dist/internal/errors.js.map +1 -0
  85. package/dist/internal/run-context.d.ts +10 -0
  86. package/dist/internal/run-context.d.ts.map +1 -0
  87. package/dist/internal/run-context.js +23 -0
  88. package/dist/internal/run-context.js.map +1 -0
  89. package/dist/kv.d.ts +86 -0
  90. package/dist/kv.d.ts.map +1 -0
  91. package/dist/kv.js +261 -0
  92. package/dist/kv.js.map +1 -0
  93. package/dist/projection-runner.d.ts +83 -0
  94. package/dist/projection-runner.d.ts.map +1 -0
  95. package/dist/projection-runner.js +498 -0
  96. package/dist/projection-runner.js.map +1 -0
  97. package/dist/projection.d.ts +36 -0
  98. package/dist/projection.d.ts.map +1 -0
  99. package/dist/projection.js +55 -0
  100. package/dist/projection.js.map +1 -0
  101. package/dist/secrets.d.ts +6 -0
  102. package/dist/secrets.d.ts.map +1 -0
  103. package/dist/secrets.js +19 -0
  104. package/dist/secrets.js.map +1 -0
  105. package/dist/serve.d.ts +71 -0
  106. package/dist/serve.d.ts.map +1 -0
  107. package/dist/serve.js +460 -0
  108. package/dist/serve.js.map +1 -0
  109. package/dist/step.d.ts +18 -0
  110. package/dist/step.d.ts.map +1 -0
  111. package/dist/step.js +581 -0
  112. package/dist/step.js.map +1 -0
  113. package/dist/subscribe.d.ts +164 -0
  114. package/dist/subscribe.d.ts.map +1 -0
  115. package/dist/subscribe.js +487 -0
  116. package/dist/subscribe.js.map +1 -0
  117. package/dist/test/index.d.ts +22 -0
  118. package/dist/test/index.d.ts.map +1 -0
  119. package/dist/test/index.js +112 -0
  120. package/dist/test/index.js.map +1 -0
  121. package/dist/test/test-step.d.ts +21 -0
  122. package/dist/test/test-step.d.ts.map +1 -0
  123. package/dist/test/test-step.js +83 -0
  124. package/dist/test/test-step.js.map +1 -0
  125. package/dist/types.d.ts +108 -0
  126. package/dist/types.d.ts.map +1 -0
  127. package/dist/types.js +5 -0
  128. package/dist/types.js.map +1 -0
  129. package/dist/version.d.ts +2 -0
  130. package/dist/version.d.ts.map +1 -0
  131. package/dist/version.js +4 -0
  132. package/dist/version.js.map +1 -0
  133. package/dist/webhook.d.ts +22 -0
  134. package/dist/webhook.d.ts.map +1 -0
  135. package/dist/webhook.js +23 -0
  136. package/dist/webhook.js.map +1 -0
  137. package/dist/worker-streaming.d.ts +17 -0
  138. package/dist/worker-streaming.d.ts.map +1 -0
  139. package/dist/worker-streaming.js +510 -0
  140. package/dist/worker-streaming.js.map +1 -0
  141. package/dist/worker.d.ts +28 -0
  142. package/dist/worker.d.ts.map +1 -0
  143. package/dist/worker.js +559 -0
  144. package/dist/worker.js.map +1 -0
  145. package/package.json +3 -3
package/dist/step.js ADDED
@@ -0,0 +1,581 @@
1
+ /**
2
+ * Step Execution Client
3
+ *
4
+ * Implements durable step primitives: run, sleep, sleepUntil, waitForEvent, parallel, map
5
+ */
6
+ import { StepError, StepTimeoutError, isRetryable, parseDuration, InvokeError } from "@ironflow/core";
7
+ import { ExecutionContext, BranchContext } from "./internal/context.js";
8
+ import { YieldSignal, } from "./internal/errors.js";
9
+ /**
10
+ * Create a step client for the given execution context
11
+ */
12
+ export function createStepClient(ctx) {
13
+ return createStepClientInternal(ctx);
14
+ }
15
+ /**
16
+ * Internal step client creation that works with any StepContext
17
+ */
18
+ function createStepClientInternal(ctx) {
19
+ return {
20
+ run: (name, fn, options) => executeStep(ctx, name, fn, options),
21
+ sleep: (name, duration) => executeSleep(ctx, name, duration),
22
+ sleepUntil: (name, until) => executeSleepUntil(ctx, name, until),
23
+ waitForEvent: (name, filter) => executeWaitForEvent(ctx, name, filter),
24
+ parallel: (name, branches, options) => executeParallel(ctx, name, branches, options),
25
+ map: (name, items, fn, options) => executeMap(ctx, name, items, fn, options),
26
+ compensate: (stepName, fn) => {
27
+ ctx.registerCompensation(stepName, fn);
28
+ },
29
+ invoke: (functionId, input, options) => executeInvoke(ctx, functionId, input, options),
30
+ invokeAsync: (functionId, input) => executeInvokeAsync(ctx, functionId, input),
31
+ publish: (topic, data) => executePublish(ctx, topic, data),
32
+ };
33
+ }
34
+ /**
35
+ * Wrap a step function with a timeout.
36
+ * If the timeout fires before fn() resolves, throws StepTimeoutError.
37
+ */
38
+ async function withStepTimeout(fn, stepName, timeout) {
39
+ const timeoutMs = parseDuration(timeout);
40
+ return new Promise((resolve, reject) => {
41
+ const timer = setTimeout(() => {
42
+ reject(new StepTimeoutError(stepName, timeout));
43
+ }, timeoutMs);
44
+ fn().then((result) => {
45
+ clearTimeout(timer);
46
+ resolve(result);
47
+ }, (error) => {
48
+ clearTimeout(timer);
49
+ reject(error);
50
+ });
51
+ });
52
+ }
53
+ /**
54
+ * Execute a step with memoization
55
+ *
56
+ * WHY: Use step.run() for any non-idempotent operation (e.g., sending an email,
57
+ * charging a card, calling an external API). Ironflow memoizes the result
58
+ * of the first successful execution. If the workflow retries, this step will
59
+ * be skipped and the previously stored result will be returned.
60
+ */
61
+ async function executeStep(ctx, name, fn, options) {
62
+ const stepId = ctx.generateStepId(name);
63
+ // Check if step is already completed (memoized)
64
+ if (ctx.shouldSkipStep(stepId)) {
65
+ ctx.logger.debug(`Step memoized: ${name}`, { stepId });
66
+ return ctx.getMemoizedOutput(stepId);
67
+ }
68
+ // Execute the step
69
+ const startedAt = new Date();
70
+ ctx.logger.debug(`Step starting: ${name}`, { stepId });
71
+ try {
72
+ const timeoutStr = options?.timeout ?? ctx.stepTimeout;
73
+ const output = timeoutStr
74
+ ? await withStepTimeout(fn, name, timeoutStr)
75
+ : await fn();
76
+ const endedAt = new Date();
77
+ const durationMs = endedAt.getTime() - startedAt.getTime();
78
+ // Record successful step
79
+ const result = {
80
+ id: stepId,
81
+ name,
82
+ type: "invoke",
83
+ status: "completed",
84
+ started_at: startedAt.toISOString(),
85
+ ended_at: endedAt.toISOString(),
86
+ duration_ms: durationMs,
87
+ output,
88
+ };
89
+ ctx.recordStep(result);
90
+ ctx.logger.debug(`Step completed: ${name}`, { stepId, durationMs });
91
+ return output;
92
+ }
93
+ catch (error) {
94
+ const endedAt = new Date();
95
+ const durationMs = endedAt.getTime() - startedAt.getTime();
96
+ // Re-throw YieldSignal (it's not a real error)
97
+ if (error instanceof YieldSignal) {
98
+ throw error;
99
+ }
100
+ // Record failed step
101
+ const errorMessage = error instanceof Error ? error.message : String(error);
102
+ const errorStack = error instanceof Error ? error.stack : undefined;
103
+ const result = {
104
+ id: stepId,
105
+ name,
106
+ type: "invoke",
107
+ status: "failed",
108
+ started_at: startedAt.toISOString(),
109
+ ended_at: endedAt.toISOString(),
110
+ duration_ms: durationMs,
111
+ error: {
112
+ message: errorMessage,
113
+ retryable: isRetryable(error),
114
+ stack: errorStack,
115
+ },
116
+ };
117
+ ctx.recordStep(result);
118
+ // Re-throw StepTimeoutError as-is (already has step context)
119
+ if (error instanceof StepTimeoutError) {
120
+ ctx.logger.error(`Step timed out: ${name}`, {
121
+ stepId,
122
+ error: errorMessage,
123
+ durationMs,
124
+ });
125
+ throw error;
126
+ }
127
+ ctx.logger.error(`Step failed: ${name}`, {
128
+ stepId,
129
+ error: errorMessage,
130
+ durationMs,
131
+ });
132
+ // Wrap in StepError for better context
133
+ throw new StepError(errorMessage, {
134
+ stepId,
135
+ stepName: name,
136
+ retryable: isRetryable(error),
137
+ cause: error instanceof Error ? error : undefined,
138
+ });
139
+ }
140
+ }
141
+ /**
142
+ * Execute a durable sleep
143
+ *
144
+ * WHY: Use step.sleep() for long-running pauses (minutes, hours, or days).
145
+ * Unlike setTimeout, this is durable—the worker can restart or the server
146
+ * can be upgraded, and the workflow will resume exactly where it left off
147
+ * once the duration has elapsed.
148
+ */
149
+ async function executeSleep(ctx, name, duration) {
150
+ const stepId = ctx.generateStepId(name);
151
+ // Check if resuming from this sleep
152
+ if (ctx.isResumingFrom(stepId, "sleep")) {
153
+ ctx.logger.debug(`Sleep resumed: ${name}`, { stepId });
154
+ ctx.markResumeProcessed();
155
+ return;
156
+ }
157
+ // Check if step is already completed (memoized)
158
+ if (ctx.shouldSkipStep(stepId)) {
159
+ ctx.logger.debug(`Sleep memoized: ${name}`, { stepId });
160
+ return;
161
+ }
162
+ // Calculate wake time. Reject non-positive durations explicitly: a negative
163
+ // or zero duration silently yielded to the server puts SleepUntil in the
164
+ // past, so the scheduler wakes the step on the next tick — which looks like
165
+ // a no-op sleep and is almost always a caller bug (inverted subtraction,
166
+ // unit mix-up, etc.).
167
+ const ms = parseDuration(duration);
168
+ if (!Number.isFinite(ms) || ms <= 0) {
169
+ throw new Error(`step.sleep(${JSON.stringify(name)}): duration must be a positive finite value, got ${JSON.stringify(duration)} (parsed to ${ms}ms)`);
170
+ }
171
+ const wakeAt = new Date(Date.now() + ms);
172
+ ctx.logger.debug(`Sleep yielding: ${name}`, {
173
+ stepId,
174
+ duration,
175
+ wakeAt: wakeAt.toISOString(),
176
+ });
177
+ // Throw yield signal to pause execution
178
+ const yieldInfo = {
179
+ step_id: stepId,
180
+ type: "sleep",
181
+ until: wakeAt.toISOString(),
182
+ };
183
+ throw new YieldSignal(yieldInfo);
184
+ }
185
+ /**
186
+ * Execute a durable sleep until a specific time
187
+ */
188
+ async function executeSleepUntil(ctx, name, until) {
189
+ const stepId = ctx.generateStepId(name);
190
+ // Check if resuming from this sleep
191
+ if (ctx.isResumingFrom(stepId, "sleep")) {
192
+ ctx.logger.debug(`SleepUntil resumed: ${name}`, { stepId });
193
+ ctx.markResumeProcessed();
194
+ return;
195
+ }
196
+ // Check if step is already completed (memoized)
197
+ if (ctx.shouldSkipStep(stepId)) {
198
+ ctx.logger.debug(`SleepUntil memoized: ${name}`, { stepId });
199
+ return;
200
+ }
201
+ // Parse the target time
202
+ const wakeAt = typeof until === "string" ? new Date(until) : until;
203
+ // Validate the date
204
+ if (isNaN(wakeAt.getTime())) {
205
+ throw new Error(`Invalid date for sleepUntil: ${until}`);
206
+ }
207
+ // A wake time in the past silently wakes on the next scheduler tick. That
208
+ // is almost always a caller bug (stale timestamp, timezone confusion) —
209
+ // fail fast so the error surfaces in the step output rather than producing
210
+ // an instant-complete sleep that looks correct.
211
+ if (wakeAt.getTime() <= Date.now()) {
212
+ throw new Error(`step.sleepUntil(${JSON.stringify(name)}): target time must be in the future, got ${wakeAt.toISOString()}`);
213
+ }
214
+ ctx.logger.debug(`SleepUntil yielding: ${name}`, {
215
+ stepId,
216
+ until: wakeAt.toISOString(),
217
+ });
218
+ // Throw yield signal to pause execution
219
+ const yieldInfo = {
220
+ step_id: stepId,
221
+ type: "sleep",
222
+ until: wakeAt.toISOString(),
223
+ };
224
+ throw new YieldSignal(yieldInfo);
225
+ }
226
+ /**
227
+ * Execute a durable wait for event
228
+ *
229
+ * WHY: Use step.waitForEvent() to implement choreography-based orchestration.
230
+ * The workflow pauses durably until an external event arrives that matches
231
+ * the provided filter. This is the primary way to handle human-in-the-loop
232
+ * or asynchronous external callbacks.
233
+ */
234
+ async function executeWaitForEvent(ctx, name, filter) {
235
+ const stepId = ctx.generateStepId(name);
236
+ // Check if resuming from this wait with the event data
237
+ if (ctx.isResumingFrom(stepId, "wait_for_event")) {
238
+ ctx.logger.debug(`WaitForEvent resumed: ${name}`, { stepId });
239
+ ctx.markResumeProcessed();
240
+ // The resume data contains the event that matched
241
+ const resumeData = ctx.getResumeData();
242
+ if (resumeData) {
243
+ return resumeData;
244
+ }
245
+ }
246
+ // Check if step is already completed (memoized)
247
+ if (ctx.shouldSkipStep(stepId)) {
248
+ ctx.logger.debug(`WaitForEvent memoized: ${name}`, { stepId });
249
+ const output = ctx.getMemoizedOutput(stepId);
250
+ if (output) {
251
+ return output;
252
+ }
253
+ }
254
+ // Validate the event filter before yielding. An empty event name would
255
+ // produce a correlation that can never match — the step waits forever
256
+ // until it times out, which is impossible to debug from a running workflow.
257
+ if (!filter || typeof filter.event !== "string" || filter.event.trim() === "") {
258
+ throw new Error(`step.waitForEvent(${JSON.stringify(name)}): filter.event must be a non-empty string`);
259
+ }
260
+ // Use the trimmed event name for the correlation. Validating the trimmed
261
+ // form but sending the raw " approval.received " wouldn't match the event
262
+ // the producer publishes as "approval.received".
263
+ const eventName = filter.event.trim();
264
+ ctx.logger.debug(`WaitForEvent yielding: ${name}`, { stepId, filter });
265
+ // Convert duration to string. Validate numeric inputs — 0, negatives,
266
+ // NaN, and Infinity all serialize to bogus timeout strings that the
267
+ // server will treat as immediate/past deadlines or parse failures.
268
+ let timeout;
269
+ if (filter.timeout === undefined || filter.timeout === null) {
270
+ timeout = "7d";
271
+ }
272
+ else if (typeof filter.timeout === "number") {
273
+ if (!Number.isFinite(filter.timeout) || filter.timeout <= 0) {
274
+ throw new Error(`step.waitForEvent(${JSON.stringify(name)}): filter.timeout must be a positive finite value, got ${filter.timeout}`);
275
+ }
276
+ timeout = durationToString(filter.timeout);
277
+ }
278
+ else if (typeof filter.timeout === "string") {
279
+ if (filter.timeout.trim() === "") {
280
+ throw new Error(`step.waitForEvent(${JSON.stringify(name)}): filter.timeout must be a non-empty string`);
281
+ }
282
+ timeout = filter.timeout;
283
+ }
284
+ else {
285
+ throw new Error(`step.waitForEvent(${JSON.stringify(name)}): filter.timeout must be a string or positive number`);
286
+ }
287
+ // Throw yield signal to pause execution
288
+ const yieldInfo = {
289
+ step_id: stepId,
290
+ type: "wait_for_event",
291
+ event_filter: {
292
+ event: eventName,
293
+ match: filter.match,
294
+ timeout,
295
+ },
296
+ };
297
+ throw new YieldSignal(yieldInfo);
298
+ }
299
+ /**
300
+ * Execute multiple branches in parallel
301
+ */
302
+ async function executeParallel(ctx, name, branches, options = {}) {
303
+ const { concurrency, onError = "failFast" } = options;
304
+ ctx.logger.debug(`Starting parallel execution: ${name}`, {
305
+ branchCount: branches.length,
306
+ concurrency,
307
+ onError,
308
+ });
309
+ const results = new Array(branches.length);
310
+ let firstError = null;
311
+ let yieldSignal = null;
312
+ const cancelled = { value: false };
313
+ // Pre-create branch contexts and step clients for each branch
314
+ const branchStepClients = branches.map((_, index) => {
315
+ const branchCtx = ctx.createBranchContext(name, index);
316
+ return createStepClientInternal(branchCtx);
317
+ });
318
+ const executeBranch = async (index) => {
319
+ if (cancelled.value && onError === "failFast")
320
+ return;
321
+ try {
322
+ const scopedStep = branchStepClients[index];
323
+ const branchFn = branches[index];
324
+ const result = await branchFn(scopedStep);
325
+ results[index] = result;
326
+ }
327
+ catch (error) {
328
+ if (error instanceof YieldSignal) {
329
+ yieldSignal = error;
330
+ cancelled.value = true;
331
+ }
332
+ else {
333
+ const err = error instanceof Error ? error : new Error(String(error));
334
+ results[index] = err;
335
+ if (onError === "failFast" && !firstError) {
336
+ firstError = err;
337
+ cancelled.value = true;
338
+ }
339
+ }
340
+ }
341
+ };
342
+ // Execute with optional concurrency limit
343
+ if (concurrency && concurrency > 0) {
344
+ const pending = [];
345
+ for (let i = 0; i < branches.length; i++) {
346
+ if (cancelled.value && onError === "failFast")
347
+ break;
348
+ if (pending.length >= concurrency) {
349
+ await Promise.race(pending);
350
+ }
351
+ const promise = executeBranch(i).finally(() => {
352
+ const idx = pending.indexOf(promise);
353
+ if (idx !== -1)
354
+ pending.splice(idx, 1);
355
+ });
356
+ pending.push(promise);
357
+ }
358
+ await Promise.all(pending);
359
+ }
360
+ else {
361
+ await Promise.all(branches.map((_, i) => executeBranch(i)));
362
+ }
363
+ // Handle yield signal
364
+ if (yieldSignal) {
365
+ throw yieldSignal;
366
+ }
367
+ // Handle errors based on mode
368
+ if (onError === "failFast" && firstError) {
369
+ throw firstError;
370
+ }
371
+ if (onError !== "allSettled") {
372
+ const errorIndex = results.findIndex((r) => r instanceof Error);
373
+ if (errorIndex !== -1) {
374
+ throw results[errorIndex];
375
+ }
376
+ }
377
+ ctx.logger.debug(`Parallel execution completed: ${name}`, {
378
+ successCount: results.filter((r) => !(r instanceof Error)).length,
379
+ errorCount: results.filter((r) => r instanceof Error).length,
380
+ });
381
+ return results;
382
+ }
383
+ /**
384
+ * Map over items with parallel execution
385
+ */
386
+ async function executeMap(ctx, name, items, fn, options = {}) {
387
+ ctx.logger.debug(`Starting map execution: ${name}`, {
388
+ itemCount: items.length,
389
+ options,
390
+ });
391
+ const branches = items.map((item, index) => {
392
+ return async (step) => {
393
+ return await fn(item, step, index);
394
+ };
395
+ });
396
+ return executeParallel(ctx, name, branches, options);
397
+ }
398
+ /**
399
+ * Execute registered compensations in reverse order.
400
+ * Each compensation is executed as a durable step (memoized).
401
+ * Compensation failures are recorded but don't stop remaining compensations.
402
+ */
403
+ export async function executeCompensations(ctx) {
404
+ const compensations = ctx.getCompensationsInReverse();
405
+ for (const { stepName, fn } of compensations) {
406
+ const compStepName = `compensate:${stepName}`;
407
+ const stepId = ctx.generateStepId(compStepName);
408
+ // Check memoization - skip if already completed
409
+ if (ctx.shouldSkipStep(stepId)) {
410
+ ctx.logger.debug(`Compensation memoized: ${compStepName}`, { stepId });
411
+ continue;
412
+ }
413
+ const startedAt = new Date();
414
+ try {
415
+ await fn();
416
+ const endedAt = new Date();
417
+ const durationMs = endedAt.getTime() - startedAt.getTime();
418
+ const result = {
419
+ id: stepId,
420
+ name: compStepName,
421
+ type: "compensate",
422
+ status: "completed",
423
+ started_at: startedAt.toISOString(),
424
+ ended_at: endedAt.toISOString(),
425
+ duration_ms: durationMs,
426
+ compensation_for: stepName,
427
+ };
428
+ ctx.recordStep(result);
429
+ ctx.logger.debug(`Compensation completed: ${compStepName}`, { stepId, durationMs });
430
+ }
431
+ catch (error) {
432
+ const endedAt = new Date();
433
+ const durationMs = endedAt.getTime() - startedAt.getTime();
434
+ const errorMessage = error instanceof Error ? error.message : String(error);
435
+ const errorStack = error instanceof Error ? error.stack : undefined;
436
+ const result = {
437
+ id: stepId,
438
+ name: compStepName,
439
+ type: "compensate",
440
+ status: "failed",
441
+ started_at: startedAt.toISOString(),
442
+ ended_at: endedAt.toISOString(),
443
+ duration_ms: durationMs,
444
+ compensation_for: stepName,
445
+ error: {
446
+ message: errorMessage,
447
+ retryable: false,
448
+ stack: errorStack,
449
+ },
450
+ };
451
+ ctx.recordStep(result);
452
+ ctx.logger.error(`Compensation failed: ${compStepName}`, {
453
+ stepId,
454
+ error: errorMessage,
455
+ durationMs,
456
+ });
457
+ // Don't throw - continue with remaining compensations
458
+ }
459
+ }
460
+ }
461
+ /**
462
+ * Execute a durable invoke (calls another function and waits for result)
463
+ */
464
+ async function executeInvoke(ctx, functionId, input, options) {
465
+ const stepId = ctx.generateStepId(functionId);
466
+ // Check memoization — completed
467
+ if (ctx.shouldSkipStep(stepId)) {
468
+ ctx.logger.debug(`Invoke memoized: ${functionId}`, { stepId });
469
+ return ctx.getMemoizedOutput(stepId);
470
+ }
471
+ // Check for failed invoke step — surface as InvokeError
472
+ const failedStepError = ctx.getFailedStep?.(stepId);
473
+ if (failedStepError !== undefined) {
474
+ throw parseInvokeError(functionId, failedStepError);
475
+ }
476
+ // Check for timed out invoke step
477
+ if (ctx.isStepTimedOut?.(stepId)) {
478
+ throw new InvokeError(functionId, undefined, "invoke timed out");
479
+ }
480
+ // Calculate timeout
481
+ let timeoutMs = 30000;
482
+ if (options?.timeout) {
483
+ timeoutMs = parseDuration(options.timeout);
484
+ }
485
+ ctx.logger.debug(`Invoke yielding: ${functionId}`, { stepId, timeoutMs });
486
+ const yieldInfo = {
487
+ step_id: stepId,
488
+ type: "invoke_function",
489
+ function_id: functionId,
490
+ input,
491
+ invoke_timeout_ms: timeoutMs,
492
+ };
493
+ throw new YieldSignal(yieldInfo);
494
+ }
495
+ /**
496
+ * Execute a fire-and-forget invoke (calls another function without waiting)
497
+ */
498
+ async function executeInvokeAsync(ctx, functionId, input) {
499
+ const stepId = ctx.generateStepId(functionId);
500
+ if (ctx.shouldSkipStep(stepId)) {
501
+ ctx.logger.debug(`InvokeAsync memoized: ${functionId}`, { stepId });
502
+ const output = ctx.getMemoizedOutput(stepId);
503
+ return { runId: output.run_id };
504
+ }
505
+ // Surface a previously failed async invoke step as an error to the caller.
506
+ const failedStepError = ctx.getFailedStep?.(stepId);
507
+ if (failedStepError !== undefined) {
508
+ throw parseInvokeError(functionId, failedStepError);
509
+ }
510
+ ctx.logger.debug(`InvokeAsync yielding: ${functionId}`, { stepId });
511
+ const yieldInfo = {
512
+ step_id: stepId,
513
+ type: "invoke_function_async",
514
+ function_id: functionId,
515
+ input,
516
+ };
517
+ throw new YieldSignal(yieldInfo);
518
+ }
519
+ /**
520
+ * Parse engine error data for a failed invoke step into an InvokeError.
521
+ */
522
+ function parseInvokeError(functionId, errorData) {
523
+ if (typeof errorData === "object" && errorData !== null) {
524
+ const e = errorData;
525
+ return new InvokeError(e["function_id"] || functionId, e["child_run_id"] || undefined, e["cause"] || e["message"] || "unknown error");
526
+ }
527
+ return new InvokeError(functionId, undefined, String(errorData));
528
+ }
529
+ /**
530
+ * Execute a durable publish to a developer pub/sub topic.
531
+ * Wraps step.run() so the publish is memoized and retried like any other step.
532
+ */
533
+ async function executePublish(ctx, topic, data) {
534
+ return executeStep(ctx, `publish:${topic}`, async () => {
535
+ const serverUrl = ctx.serverUrl;
536
+ if (!serverUrl) {
537
+ throw new Error("Server URL not configured for publish step");
538
+ }
539
+ const url = `${serverUrl}/ironflow.v1.PubSubService/Publish`;
540
+ const headers = {
541
+ "Content-Type": "application/json",
542
+ };
543
+ if (ctx.apiKey) {
544
+ headers["Authorization"] = `Bearer ${ctx.apiKey}`;
545
+ }
546
+ const response = await fetch(url, {
547
+ method: "POST",
548
+ headers,
549
+ body: JSON.stringify({ topic, data: data ?? {} }),
550
+ });
551
+ if (!response.ok) {
552
+ const body = await response.text();
553
+ throw new Error(body || `Publish failed: ${response.status}`);
554
+ }
555
+ const result = (await response.json());
556
+ return {
557
+ eventId: result.eventId,
558
+ sequence: parseInt(result.sequence, 10) || 0,
559
+ };
560
+ });
561
+ }
562
+ /**
563
+ * Convert a duration to a string representation
564
+ */
565
+ function durationToString(duration) {
566
+ const ms = duration;
567
+ const seconds = Math.floor(ms / 1000);
568
+ const minutes = Math.floor(seconds / 60);
569
+ const hours = Math.floor(minutes / 60);
570
+ const days = Math.floor(hours / 24);
571
+ if (days > 0)
572
+ return `${days}d`;
573
+ if (hours > 0)
574
+ return `${hours}h`;
575
+ if (minutes > 0)
576
+ return `${minutes}m`;
577
+ if (seconds > 0)
578
+ return `${seconds}s`;
579
+ return `${ms}ms`;
580
+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