@fluidgrids/workflows 2026.1028.2 → 2026.1030.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 (154) hide show
  1. package/README.md +181 -11
  2. package/dist/{activation-BBh1p82z.d.cts → activation-DqUfpHzk.d.cts} +1 -1
  3. package/dist/{activation-DnhG7SmF.d.ts → activation-xpx1oWuo.d.ts} +1 -1
  4. package/dist/{chunk-VRHHBPT6.js → chunk-2D3MYIIF.js} +1212 -128
  5. package/dist/chunk-3U2NU7YC.cjs +124 -0
  6. package/dist/{chunk-NEIUQASE.cjs → chunk-4QKB4ARC.cjs} +3 -3
  7. package/dist/{chunk-GBQ33SIZ.cjs → chunk-54FLQNUM.cjs} +12 -1
  8. package/dist/chunk-5HIVIV53.js +330 -0
  9. package/dist/chunk-5MFVJM76.js +1222 -0
  10. package/dist/{chunk-JD2VQIDZ.cjs → chunk-672KMMBK.cjs} +2 -2
  11. package/dist/{chunk-C5OLWZ42.js → chunk-6A2FGSUS.js} +22 -14
  12. package/dist/{chunk-XKJA7KX3.js → chunk-6OLN6BMB.js} +52 -3
  13. package/dist/{chunk-6FSHT5IL.js → chunk-7EZIANC7.js} +1 -1
  14. package/dist/{chunk-2J6TF7YI.cjs → chunk-A5SXCA62.cjs} +10 -3
  15. package/dist/{chunk-BO6OVILK.js → chunk-AC6ZEXVR.js} +10 -4
  16. package/dist/{chunk-ABFZWYHT.js → chunk-AE5Q6ZAJ.js} +315 -50
  17. package/dist/chunk-C4F5KJTI.js +293 -0
  18. package/dist/{chunk-IISBRUWJ.js → chunk-G5H32GIG.js} +1 -1
  19. package/dist/chunk-GEQDGUGB.cjs +2719 -0
  20. package/dist/{chunk-XHXIDVEC.js → chunk-HCM7ZC7Q.js} +1 -1
  21. package/dist/chunk-HMZUGSMU.cjs +1554 -0
  22. package/dist/{chunk-SAOBPYYJ.cjs → chunk-IQPXHQQQ.cjs} +8 -4
  23. package/dist/{chunk-P6TA5EZT.cjs → chunk-ISOIA7NV.cjs} +335 -58
  24. package/dist/chunk-JSC75O5C.cjs +167 -0
  25. package/dist/chunk-M272AHEX.js +25 -0
  26. package/dist/{chunk-BD7ZPG53.js → chunk-NWQ5WRLE.js} +10 -2
  27. package/dist/chunk-ODZ2IAR2.cjs +1247 -0
  28. package/dist/chunk-Q4MWQNJK.cjs +28 -0
  29. package/dist/{chunk-HWJZVOG7.js → chunk-SR7TR5KX.js} +6 -2
  30. package/dist/{chunk-FEW3JBYA.cjs → chunk-TCTE7DX5.cjs} +3 -3
  31. package/dist/{chunk-623FVQSN.cjs → chunk-TYF56RGB.cjs} +123 -0
  32. package/dist/chunk-VA4OFR72.cjs +324 -0
  33. package/dist/chunk-VU5S5A7V.js +150 -0
  34. package/dist/chunk-YEHR4NNE.js +1522 -0
  35. package/dist/{chunk-FMSW2HDF.cjs → chunk-ZCGKGDCL.cjs} +23 -15
  36. package/dist/codegen/index.d.cts +2 -2
  37. package/dist/codegen/index.d.ts +2 -2
  38. package/dist/collect-6NIEufHd.d.ts +103 -0
  39. package/dist/collect-CcTCKqx6.d.cts +103 -0
  40. package/dist/{file-BOoHZgoQ.d.cts → file-BxYpwjRQ.d.cts} +1007 -21
  41. package/dist/{file-yuPCFU5b.d.ts → file-CFdPQJI9.d.ts} +1007 -21
  42. package/dist/history/index.cjs +375 -86
  43. package/dist/history/index.d.cts +590 -12
  44. package/dist/history/index.d.ts +590 -12
  45. package/dist/history/index.js +50 -4
  46. package/dist/index.cjs +156 -50
  47. package/dist/index.d.cts +38 -58
  48. package/dist/index.d.ts +38 -58
  49. package/dist/index.js +6 -4
  50. package/dist/interceptors-CNcr2dlk.d.ts +159 -0
  51. package/dist/interceptors-CqkNZVfI.d.cts +159 -0
  52. package/dist/ir/index.cjs +362 -38
  53. package/dist/ir/index.d.cts +282 -7
  54. package/dist/ir/index.d.ts +282 -7
  55. package/dist/ir/index.js +329 -23
  56. package/dist/{lower-BzmUz0sq.d.cts → lower-BtRfIW2A.d.cts} +56 -8
  57. package/dist/{lower-_-iT4HYs.d.ts → lower-CpsMFOFX.d.ts} +56 -8
  58. package/dist/{manifest-C8N6HDYl.d.ts → manifest-D-I_twys.d.ts} +1 -1
  59. package/dist/{manifest-0OLw0i7k.d.cts → manifest-DahBQVM8.d.cts} +1 -1
  60. package/dist/node-evaluator-DGQDPSPI.cjs +24 -0
  61. package/dist/node-evaluator-LEEVD7H7.js +14 -0
  62. package/dist/payload-fields-BVRQn2yH.d.cts +122 -0
  63. package/dist/payload-fields-oOBWxDiG.d.ts +122 -0
  64. package/dist/quickjs/index.cjs +28 -27
  65. package/dist/quickjs/index.d.cts +6 -6
  66. package/dist/quickjs/index.d.ts +6 -6
  67. package/dist/quickjs/index.js +10 -9
  68. package/dist/roundtrip/index.cjs +259 -51
  69. package/dist/roundtrip/index.d.cts +100 -9
  70. package/dist/roundtrip/index.d.ts +100 -9
  71. package/dist/roundtrip/index.js +177 -11
  72. package/dist/runtime/index.cjs +21 -20
  73. package/dist/runtime/index.d.cts +184 -15
  74. package/dist/runtime/index.d.ts +184 -15
  75. package/dist/runtime/index.js +8 -7
  76. package/dist/testing/index.cjs +1122 -115
  77. package/dist/testing/index.d.cts +294 -13
  78. package/dist/testing/index.d.ts +294 -13
  79. package/dist/testing/index.js +1086 -84
  80. package/dist/{types-DV-HX_Gt.d.ts → types-Bv2i4cBX.d.cts} +244 -33
  81. package/dist/{types-CpBBjaGX.d.cts → types-DGx-b9eq.d.ts} +244 -33
  82. package/dist/{types-BGoPzgcl.d.ts → types-V7jEEUaL.d.cts} +20 -1
  83. package/dist/{types-BGoPzgcl.d.cts → types-V7jEEUaL.d.ts} +20 -1
  84. package/dist/{workflow-Bpr3vnA_.d.ts → workflow-B18OeF7g.d.ts} +2 -2
  85. package/dist/workflow-BGnv8SS6.d.ts +803 -0
  86. package/dist/{workflow-FXUkpIBc.d.cts → workflow-BJPFv3cp.d.cts} +2 -2
  87. package/dist/workflow-DS32Gtws.d.cts +803 -0
  88. package/fixtures/histories/activity-options-updated.history.json +159 -0
  89. package/fixtures/histories/activity-paused-unpaused.history.json +160 -0
  90. package/fixtures/histories/auto-upgrade-patched.history.json +276 -0
  91. package/fixtures/histories/benign-failure.history.json +146 -0
  92. package/fixtures/histories/cancel-activity-try-cancel.history.json +150 -0
  93. package/fixtures/histories/child-cancel-wait-requested.history.json +217 -0
  94. package/fixtures/histories/child-options-roundtrip.history.json +192 -0
  95. package/fixtures/histories/codec-opaque.history.json +229 -0
  96. package/fixtures/histories/continue-as-new-last-result.history.json +86 -0
  97. package/fixtures/histories/continue-as-new-options.history.json +99 -0
  98. package/fixtures/histories/continue-as-new-r1-long-task-queue.history.json +78 -0
  99. package/fixtures/histories/continue-as-new-r1-retry-options.history.json +83 -0
  100. package/fixtures/histories/dynamic-workflow.history.json +150 -0
  101. package/fixtures/histories/execution-timeout-chain.history.json +98 -0
  102. package/fixtures/histories/external-cancel-resolved.history.json +123 -0
  103. package/fixtures/histories/external-cancel-unknown-target.history.json +127 -0
  104. package/fixtures/histories/failure-error-types-fails-run.history.json +144 -0
  105. package/fixtures/histories/handler-drain-warn.history.json +222 -0
  106. package/fixtures/histories/heartbeat-details-on-retry.history.json +145 -0
  107. package/fixtures/histories/interceptor-headers.history.json +339 -0
  108. package/fixtures/histories/local-activity-abandoned-at-completion.history.json +73 -0
  109. package/fixtures/histories/local-activity-cancelled-in-scope.history.json +118 -0
  110. package/fixtures/histories/local-activity-completed.history.json +157 -0
  111. package/fixtures/histories/local-activity-failed.history.json +93 -0
  112. package/fixtures/histories/local-activity-retry-in-task.history.json +88 -0
  113. package/fixtures/histories/query-custom.history.json +213 -0
  114. package/fixtures/histories/query-default-handler.history.json +120 -0
  115. package/fixtures/histories/reset-forked-reapplied-signals.history.json +239 -0
  116. package/fixtures/histories/reset-reapplied-update-admitted.history.json +228 -0
  117. package/fixtures/histories/run-retry-last-failure.history.json +90 -0
  118. package/fixtures/histories/run-timeout.history.json +159 -0
  119. package/fixtures/histories/schedule-to-start-timeout.history.json +132 -0
  120. package/fixtures/histories/search-attributes-upserted.history.json +177 -0
  121. package/fixtures/histories/start-delay-signal-ends-delay.history.json +155 -0
  122. package/fixtures/histories/typeerror-task-retry-100.history.json +137 -0
  123. package/fixtures/histories/update-accepted-completed.history.json +45 -30
  124. package/fixtures/histories/update-default-handler.history.json +246 -0
  125. package/fixtures/histories/update-handler-awaits-activity.history.json +196 -0
  126. package/fixtures/histories/update-not-handled.history.json +138 -0
  127. package/fixtures/histories/update-rejected-no-event.history.json +190 -0
  128. package/fixtures/histories/update-with-start-admitted.history.json +150 -0
  129. package/fixtures/histories/user-activity-cancel.history.json +149 -0
  130. package/fixtures/histories/user-activity-retry.history.json +143 -0
  131. package/fixtures/histories/user-activity.history.json +149 -0
  132. package/package.json +1 -1
  133. package/schema/bridge-v2.schema.json +1062 -0
  134. package/schema/history-file.schema.json +538 -83
  135. package/schema/ir-v2.schema.json +290 -0
  136. package/schema/payload-fields.json +162 -0
  137. package/schema/run-event.schema.json +503 -82
  138. package/schema/workflow-command.schema.json +372 -69
  139. package/schema/workflow-task.schema.json +924 -171
  140. package/dist/assemble-BLqQ8lSu.d.cts +0 -39
  141. package/dist/assemble-DWgaXHd-.d.ts +0 -39
  142. package/dist/chunk-DHTLALBL.cjs +0 -80
  143. package/dist/chunk-DJYMDLV5.js +0 -227
  144. package/dist/chunk-I5LR3D2K.js +0 -869
  145. package/dist/chunk-M4BBAERY.cjs +0 -1635
  146. package/dist/chunk-N23SKIG4.js +0 -73
  147. package/dist/chunk-PZCVF76Q.cjs +0 -868
  148. package/dist/chunk-QQ6ULXHI.cjs +0 -885
  149. package/dist/chunk-UK3WM7YZ.cjs +0 -75
  150. package/dist/chunk-VOKMAAJP.js +0 -848
  151. package/dist/node-evaluator-4MSDKWOG.cjs +0 -22
  152. package/dist/node-evaluator-SX4LEYQC.js +0 -12
  153. package/dist/workflow-C2a05WUJ.d.ts +0 -444
  154. package/dist/workflow-J-yYixny.d.cts +0 -444
@@ -1,4 +1,4 @@
1
- import { J as JsonObject, E as ErrorType, a as Json } from './types-BGoPzgcl.cjs';
1
+ import { J as JsonObject, E as ErrorType, a as Json } from './types-V7jEEUaL.js';
2
2
 
3
3
  /**
4
4
  * The durable-function history contract (PLAN-B C-HIST, C-CMD, C-ABI):
@@ -13,6 +13,25 @@ import { J as JsonObject, E as ErrorType, a as Json } from './types-BGoPzgcl.cjs
13
13
 
14
14
  /** Version of the runtime ABI and of the history file format. */
15
15
  declare const HISTORY_PROTOCOL = 1;
16
+ /**
17
+ * The runtime compatibility release of this SDK (the runtime train of
18
+ * PLAN-B19 critique 4.5). R1 is the Phase B core runtime; R2 adds local
19
+ * activities, handler drain, run handles by workflow id and the R2 history
20
+ * fields. Release 3 (Phase C, C-R1) adds updates, custom and default queries,
21
+ * dynamic workflows, user activities, search attributes, interceptors with
22
+ * header propagation and sinks. A history recorded by release N replays under
23
+ * every release >= N; the service and the workers pin the release whose
24
+ * histories they accept.
25
+ */
26
+ declare const RUNTIME_RELEASE = 3;
27
+ /**
28
+ * What the runtime of this release can answer (C-ABI-H, reported as
29
+ * `FluidgridsRuntimeAbi.capabilities`). A bundle built before C-R1 reports no
30
+ * capabilities, and the service refuses updates and custom queries for it
31
+ * (DC4) instead of delivering requests the bundle would ignore.
32
+ */
33
+ declare const RUNTIME_CAPABILITIES: readonly ["updates", "queries", "dynamic"];
34
+ type RuntimeCapability = (typeof RUNTIME_CAPABILITIES)[number];
16
35
  /** Every value of the `type` column of `workflow_run_events`, UPPER_SNAKE (DB4). */
17
36
  declare const EVENT_TYPES: readonly ["WORKFLOW_STARTED", "WORKFLOW_TASK_SCHEDULED", "WORKFLOW_TASK_STARTED", "WORKFLOW_TASK_COMPLETED", "WORKFLOW_TASK_FAILED", "WORKFLOW_TASK_TIMED_OUT", "ACTIVITY_SCHEDULED", "ACTIVITY_STARTED", "ACTIVITY_HEARTBEAT", "ACTIVITY_COMPLETED", "ACTIVITY_FAILED", "ACTIVITY_TIMED_OUT", "ACTIVITY_CANCEL_REQUESTED", "ACTIVITY_CANCELLED", "ACTIVITY_PAUSED", "ACTIVITY_UNPAUSED", "ACTIVITY_RESET", "ACTIVITY_OPTIONS_UPDATED", "TIMER_STARTED", "TIMER_FIRED", "TIMER_CANCELLED", "SIGNAL_RECEIVED", "UPDATE_ADMITTED", "UPDATE_ACCEPTED", "UPDATE_COMPLETED", "CHILD_RUN_INITIATED", "CHILD_RUN_STARTED", "CHILD_RUN_COMPLETED", "CHILD_RUN_FAILED", "CHILD_RUN_CANCELLED", "CHILD_RUN_TERMINATED", "CHILD_RUN_TIMED_OUT", "EXTERNAL_RUN_CANCEL_REQUESTED", "EXTERNAL_RUN_CANCEL_RESOLVED", "EXTERNAL_RUN_SIGNALED", "SIDE_EFFECT_RECORDED", "LOCAL_ACTIVITY_COMPLETED", "LOCAL_ACTIVITY_FAILED", "SEARCH_ATTRIBUTES_UPSERTED", "CONTEXT_UPSERTED", "MARKER_RECORDED", "WORKFLOW_CANCEL_REQUESTED", "WORKFLOW_RESET", "VERSIONING_OVERRIDE_SET", "WORKFLOW_COMPLETED", "WORKFLOW_FAILED", "WORKFLOW_CANCELLED", "WORKFLOW_TERMINATED", "WORKFLOW_TIMED_OUT", "WORKFLOW_CONTINUED_AS_NEW"];
18
37
  type RunEventType = (typeof EVENT_TYPES)[number];
@@ -23,7 +42,11 @@ type CommandType = (typeof COMMAND_TYPES)[number];
23
42
  declare const PHASE_B_CORE_COMMANDS: ReadonlySet<CommandType>;
24
43
  /** Commands of the Phase B parity releases (defined now, enabled by the service per release). */
25
44
  declare const PHASE_B_PARITY_COMMANDS: ReadonlySet<CommandType>;
26
- /** Commands that are defined but refused in Phase B (`UNSUPPORTED_COMMAND`). */
45
+ /**
46
+ * Commands of Phase C. They were refused throughout Phase B; from C-R1 the
47
+ * C-GATE feature set decides (`c.updates`, `c.searchAttributes`), and the
48
+ * deprecated release levels of `isCommandEnabled` still refuse them.
49
+ */
27
50
  declare const PHASE_C_COMMANDS: ReadonlySet<CommandType>;
28
51
  /** Commands that end the run; one may appear, and only last in a batch. */
29
52
  declare const TERMINAL_COMMANDS: ReadonlySet<CommandType>;
@@ -106,7 +129,11 @@ type Headers = Record<string, string>;
106
129
  interface CommandBase {
107
130
  headers?: Headers;
108
131
  }
109
- /** Signal and cancel targets. `workflowKey`/`workflowId` addressing is parity (11 §2.1). */
132
+ /**
133
+ * Signal and cancel targets. `workflowKey`/`workflowId` addressing is parity
134
+ * (11 §2.1): it reaches the open run of that business id, following the
135
+ * continue-as-new chain; `firstRunId` pins the chain whose first run it names.
136
+ */
110
137
  type RunTarget = {
111
138
  runId: string;
112
139
  } | {
@@ -116,16 +143,63 @@ type RunTarget = {
116
143
  } | {
117
144
  workflowKey: string;
118
145
  workflowId: string;
146
+ firstRunId?: string;
119
147
  };
120
- interface ScheduleActivityCommand extends CommandBase {
148
+ /** `idReusePolicy` of a start (11 §2.1): what a closed run with the same workflow id allows. */
149
+ declare const WORKFLOW_ID_REUSE_POLICIES: readonly ["ALLOW_DUPLICATE", "ALLOW_DUPLICATE_FAILED_ONLY", "REJECT_DUPLICATE"];
150
+ type WorkflowIdReusePolicy = (typeof WORKFLOW_ID_REUSE_POLICIES)[number];
151
+ /** `idConflictPolicy` of a start (11 §2.1): what an open run with the same workflow id does. */
152
+ declare const WORKFLOW_ID_CONFLICT_POLICIES: readonly ["FAIL", "USE_EXISTING", "TERMINATE_EXISTING"];
153
+ type WorkflowIdConflictPolicy = (typeof WORKFLOW_ID_CONFLICT_POLICIES)[number];
154
+ /** `versioningBehavior` of a version or a run (11 §2.27). */
155
+ declare const VERSIONING_BEHAVIORS: readonly ["PINNED", "AUTO_UPGRADE"];
156
+ type VersioningBehavior = (typeof VERSIONING_BEHAVIORS)[number];
157
+ /** `timeoutType` of `WORKFLOW_TIMED_OUT` and `CHILD_RUN_TIMED_OUT` (11 §2.20). */
158
+ declare const WORKFLOW_TIMEOUT_TYPES: readonly ["WORKFLOW_RUN", "WORKFLOW_EXECUTION"];
159
+ type WorkflowTimeoutType = (typeof WORKFLOW_TIMEOUT_TYPES)[number];
160
+ /**
161
+ * The run-level retry policy of a DURABLE_FN run (11 §2.17), in milliseconds.
162
+ * A run that fails with a retryable failure, or whose run timeout expires,
163
+ * is started again as a new run of the same chain, up to `maxAttempts`
164
+ * attempts in total (absent: unlimited, bounded by the execution timeout).
165
+ */
166
+ interface RunRetryPolicy {
167
+ maxAttempts?: number;
168
+ /** Delay before the second attempt. */
169
+ initialDelayMs: number;
170
+ backoffMultiplier?: number;
171
+ maxDelayMs?: number;
172
+ /** Allow-list on `errorType`. */
173
+ retryOnErrorTypes?: ErrorType[];
174
+ /** Deny-list on the free-form `Failure.type`; wins over the allow-list. */
175
+ nonRetryableErrorTypes?: string[];
176
+ }
177
+ /** The three workflow timeouts of a run (11 §2.20), in milliseconds. */
178
+ interface WorkflowTimeouts {
179
+ executionTimeout?: number;
180
+ runTimeout?: number;
181
+ workflowTaskTimeout?: number;
182
+ }
183
+ /** The longest fairness key (11 §2.11). */
184
+ declare const FAIRNESS_KEY_MAX_LENGTH = 255;
185
+ /** The range of a fairness weight (11 §2.11); the default is 1. */
186
+ declare const FAIRNESS_WEIGHT_MIN = 0.1;
187
+ declare const FAIRNESS_WEIGHT_MAX = 10;
188
+ /** The name of a user activity (C-CMD-C). */
189
+ declare const ACTIVITY_NAME_PATTERN = "^[A-Za-z_][A-Za-z0-9_.-]{0,127}$";
190
+ /** The name of a task queue (C-CMD-C); `managed` is the platform's queue. */
191
+ declare const TASK_QUEUE_NAME_PATTERN = "^[a-z0-9][a-z0-9-]{0,62}$";
192
+ /** At most this many connections a user activity may name. */
193
+ declare const MAX_ACTIVITY_CONNECTIONS = 16;
194
+ /** UTF-8 bytes of the JSON of a command's `headers` map, at most. */
195
+ declare const MAX_HEADERS_BYTES: number;
196
+ /** At most this many sink calls one workflow task reports. */
197
+ declare const MAX_SINK_CALLS = 256;
198
+ /** What both kinds of `SCHEDULE_ACTIVITY` carry. */
199
+ interface ScheduleActivityBase extends CommandBase {
121
200
  type: 'SCHEDULE_ACTIVITY';
122
201
  activityId: string;
123
- kind: 'node';
124
- nodeType: string;
125
- nodeVersion?: string;
126
- operation: string;
127
202
  args: Json;
128
- connection?: string;
129
203
  retry: RetryPolicy;
130
204
  startToCloseTimeout?: number;
131
205
  scheduleToCloseTimeout?: number;
@@ -134,8 +208,34 @@ interface ScheduleActivityCommand extends CommandBase {
134
208
  cancellationType?: ActivityCancellationType;
135
209
  priority?: number;
136
210
  summary?: string;
211
+ /** Fairness within the queue (11 §2.11, Phase C); default the workspace id. */
212
+ fairnessKey?: string;
213
+ /** 0.1 to 10; default 1. */
214
+ fairnessWeight?: number;
215
+ }
216
+ /** A canvas node operation run as an activity (`ctx.run`). */
217
+ interface ScheduleNodeActivityCommand extends ScheduleActivityBase {
218
+ kind: 'node';
219
+ nodeType: string;
220
+ nodeVersion?: string;
221
+ operation: string;
222
+ connection?: string;
137
223
  runOn?: string;
138
224
  }
225
+ /**
226
+ * A user activity (`ctx.activity`, Phase C, C-CMD-C): a function a
227
+ * self-hosted worker polling `taskQueue` implements. It has no node type,
228
+ * operation or `runOn`.
229
+ */
230
+ interface ScheduleUserActivityCommand extends ScheduleActivityBase {
231
+ kind: 'user';
232
+ activityName: string;
233
+ taskQueue: string;
234
+ /** Connection names the worker may resolve per attempt (H2), at most 16. */
235
+ connections?: string[];
236
+ }
237
+ /** `SCHEDULE_ACTIVITY`, a `oneOf` on `kind` (C-CMD-C). */
238
+ type ScheduleActivityCommand = ScheduleNodeActivityCommand | ScheduleUserActivityCommand;
139
239
  interface RequestCancelActivityCommand extends CommandBase {
140
240
  type: 'REQUEST_CANCEL_ACTIVITY';
141
241
  activityId: string;
@@ -164,7 +264,15 @@ interface ChildRunOptions {
164
264
  runTimeout?: number;
165
265
  workflowTaskTimeout?: number;
166
266
  startDelay?: number;
167
- [key: string]: Json | undefined;
267
+ /** Run-level retry of the child (11 §2.17). */
268
+ retry?: RunRetryPolicy;
269
+ versioningBehavior?: VersioningBehavior;
270
+ idReusePolicy?: WorkflowIdReusePolicy;
271
+ idConflictPolicy?: WorkflowIdConflictPolicy;
272
+ /** Fairness of the child's tasks (11 §2.11, Phase C); inherited by default. */
273
+ fairnessKey?: string;
274
+ fairnessWeight?: number;
275
+ [key: string]: Json | RunRetryPolicy | undefined;
168
276
  }
169
277
  interface StartChildRunCommand extends CommandBase {
170
278
  type: 'START_CHILD_RUN';
@@ -216,6 +324,10 @@ interface RecordLocalActivityCommand extends CommandBase {
216
324
  result?: Json;
217
325
  failure?: Failure;
218
326
  attempts: number;
327
+ /** The node operation that ran (R2), for the History tab and replay matching. */
328
+ nodeType?: string;
329
+ operation?: string;
330
+ summary?: string;
219
331
  }
220
332
  interface ContinueAsNewCommand extends CommandBase {
221
333
  type: 'CONTINUE_AS_NEW';
@@ -258,15 +370,28 @@ declare const DEFAULT_HISTORY_LIMIT: HistoryLimit;
258
370
  declare const CONTINUE_AS_NEW_SUGGESTED_RATIO = 0.8;
259
371
  /** Fraction of the cap at which the next command throws `HistoryLimitExceeded`. */
260
372
  declare const HISTORY_LIMIT_EXCEEDED_RATIO = 0.95;
261
- /** What a task knows about its run (C-ABI `WorkflowInfoSnapshot`). */
373
+ /**
374
+ * What a task knows about its run (C-ABI `WorkflowInfoSnapshot`). From SDK R2
375
+ * the runtime reads `workflowId`, `runAttempt`, `lastResult`, `lastFailure`,
376
+ * `summary`, `details`, the memo (`context`), the timeouts, `retry`,
377
+ * `priority` and `versioningBehavior` from `WORKFLOW_STARTED` when the event
378
+ * carries them, so a replay sees what the first execution saw; the lease
379
+ * values here are the fallback for histories written before R2.
380
+ */
262
381
  interface WorkflowInfoSnapshot {
263
382
  runId: string;
264
383
  workspaceId: string;
265
384
  workflowKey?: string;
266
385
  version?: number | string;
267
386
  buildId?: string;
387
+ /** The column name of the workflow id (11 §2.1). */
268
388
  businessId?: string;
389
+ /** The caller-chosen workflow id (`businessId`), else the first run's id. */
390
+ workflowId?: string;
391
+ /** Run-level retry attempt, 1-based (same value as `runAttempt`). */
269
392
  attempt?: number;
393
+ /** Run-level retry attempt, 1-based (11 §2.17). */
394
+ runAttempt?: number;
270
395
  taskQueue?: string;
271
396
  parentRunId?: string | null;
272
397
  rootRunId?: string | null;
@@ -286,11 +411,58 @@ interface WorkflowInfoSnapshot {
286
411
  priority?: number;
287
412
  summary?: string;
288
413
  details?: string;
414
+ /** The run's memo (11 §2.22); `memo` is the same value under its Temporal name. */
289
415
  context?: JsonObject;
416
+ memo?: JsonObject;
417
+ versioningBehavior?: VersioningBehavior;
418
+ /** The run-level retry policy of the chain. */
419
+ retry?: RunRetryPolicy;
420
+ /** The run's search attributes at the start (11 §2.8, Phase C). */
421
+ searchAttributes?: JsonObject;
422
+ /** Fairness of the run's tasks (11 §2.11, Phase C). */
423
+ fairnessKey?: string;
424
+ fairnessWeight?: number;
290
425
  }
291
- /** A built-in query (11 §2.21). Custom queries are Phase C. */
426
+ /** A built-in query (11 §2.21); any other name is a custom query (Phase C). */
292
427
  type BuiltInQueryName = '__stack_trace' | '__enhanced_stack_trace' | '__metadata';
293
428
  declare const BUILT_IN_QUERIES: readonly BuiltInQueryName[];
429
+ /**
430
+ * A pending update the lease delivers to a workflow task (C-ABI-H). The
431
+ * request is not in history until the task accepts it (`UPDATE_ACCEPTED`);
432
+ * `admitted` marks one that history already holds as `UPDATE_ADMITTED`
433
+ * (update-with-start, reset re-application), which the runtime delivers from
434
+ * that event instead.
435
+ */
436
+ interface UpdateRequest {
437
+ updateId: string;
438
+ name: string;
439
+ args?: Json;
440
+ admitted?: boolean;
441
+ headers?: Headers;
442
+ }
443
+ /** A query a task answers (11 §2.21). Built-in names need no handler. */
444
+ interface QueryRequest {
445
+ queryId: string;
446
+ name: string;
447
+ args?: Json;
448
+ }
449
+ /**
450
+ * The answer to one query. `rejected` means no handler took the name (the
451
+ * service answers `VALIDATION`); `error` without `rejected` means the handler
452
+ * threw or the replay failed.
453
+ */
454
+ interface QueryResult {
455
+ queryId: string;
456
+ value?: Json;
457
+ error?: string;
458
+ rejected?: boolean;
459
+ }
460
+ /** One call workflow code made to a worker-side sink (11 §2.31); never on replay. */
461
+ interface SinkCall {
462
+ sink: string;
463
+ fn: string;
464
+ args: Json[];
465
+ }
294
466
  /** The input of one workflow task (C-ABI). */
295
467
  interface WorkflowTaskRequest {
296
468
  protocol: number;
@@ -300,27 +472,63 @@ interface WorkflowTaskRequest {
300
472
  history: RunEventRecord[];
301
473
  /** The task's start time; the clock for new side effects only. */
302
474
  nowMs: number;
303
- localActivityResults?: Array<{
304
- localActivityId: string;
305
- result?: Json;
306
- failure?: Failure;
307
- attempts: number;
308
- }>;
309
- queries?: Array<{
310
- queryId: string;
311
- name: BuiltInQueryName;
312
- args?: Json;
313
- }>;
314
- }
315
- /** A local activity the task wants run before it can continue (parity). */
475
+ localActivityResults?: LocalActivityResult[];
476
+ /** Pending updates the lease delivers (C-ABI-H, Phase C). */
477
+ updates?: UpdateRequest[];
478
+ /** Queries to answer once the history is replayed. */
479
+ queries?: QueryRequest[];
480
+ /**
481
+ * The bundle features (C-FEATURES, the names of `code.features`) the
482
+ * workspace enables for this task, from its flags (Phase C). From C-R1 the
483
+ * runtime reads `interceptors`: a `task` of a bundle that exports
484
+ * interceptors fails with `UNSUPPORTED_COMMAND` unless it is listed, so
485
+ * turning `fluidgrids.run-control` off stops interceptors from running even
486
+ * for a bundle pushed while it was on. Absent means none.
487
+ */
488
+ features?: string[];
489
+ }
490
+ /** The result of one local activity, as the worker passes it back into the task (C-ABI). */
491
+ interface LocalActivityResult {
492
+ localActivityId: string;
493
+ result?: Json;
494
+ failure?: Failure;
495
+ /** Attempts run so far, the last one included. */
496
+ attempts: number;
497
+ }
498
+ /** The largest `startToCloseTimeout` of a local activity, and its default (11 §2.12). */
499
+ declare const LOCAL_ACTIVITY_MAX_TIMEOUT_MS = 30000;
500
+ /**
501
+ * A local activity the task wants run before it can continue (parity, 11
502
+ * §2.12). The worker runs attempt `attempt` (after waiting `backoffMs` when
503
+ * it is a retry) inside the task's budget, then runs the same task again with
504
+ * the outcome in `localActivityResults`. The runtime decides with
505
+ * `computeRetryDelay` whether a failure is final; a retryable one is
506
+ * requested again with the next attempt. A worker that cannot fit the wait
507
+ * and the attempt into the remaining budget answers with a non-retryable
508
+ * `TIMEOUT` failure of type `LocalActivityBudgetExceeded` instead.
509
+ */
316
510
  interface LocalActivityRequest {
317
511
  localActivityId: string;
512
+ kind: 'node';
318
513
  nodeType: string;
514
+ nodeVersion?: string;
319
515
  operation: string;
320
516
  args: Json;
321
517
  connection?: string;
322
- retry?: RetryPolicy;
323
- startToCloseTimeout?: number;
518
+ retry: RetryPolicy;
519
+ /** Milliseconds; at most {@link LOCAL_ACTIVITY_MAX_TIMEOUT_MS}. */
520
+ startToCloseTimeout: number;
521
+ /** The attempt to run, 1-based. */
522
+ attempt: number;
523
+ /** Milliseconds to wait before this attempt (0 for the first). */
524
+ backoffMs: number;
525
+ summary?: string;
526
+ }
527
+ /** Signal or update handlers still running when the workflow finished (11 §2.18). */
528
+ interface UnfinishedHandler {
529
+ kind: 'signal' | 'update';
530
+ name: string;
531
+ count: number;
324
532
  }
325
533
  interface TaskLogLine {
326
534
  level: 'debug' | 'info' | 'warn' | 'error';
@@ -333,11 +541,9 @@ interface WorkflowTaskResult {
333
541
  outcome: 'commands' | 'failed' | 'localActivityRequested';
334
542
  commands: WorkflowCommand[];
335
543
  localActivityRequests?: LocalActivityRequest[];
336
- queryResults?: Array<{
337
- queryId: string;
338
- value?: Json;
339
- error?: string;
340
- }>;
544
+ queryResults?: QueryResult[];
545
+ /** Sink calls of the open activation, at most {@link MAX_SINK_CALLS} (Phase C). */
546
+ sinkCalls?: SinkCall[];
341
547
  failure?: {
342
548
  cause: WorkflowTaskFailureCause;
343
549
  message: string;
@@ -347,6 +553,11 @@ interface WorkflowTaskResult {
347
553
  };
348
554
  logs: TaskLogLine[];
349
555
  stackTrace?: string;
556
+ /**
557
+ * Handlers still running when this task's terminal command was issued, with
558
+ * policy `WARN_AND_ABANDON` (R2). Never set on replay.
559
+ */
560
+ unfinishedHandlers?: UnfinishedHandler[];
350
561
  }
351
562
  /**
352
563
  * The event each command appends (C-CMD). `REJECT_UPDATE` appends nothing: a
@@ -377,4 +588,4 @@ declare function isCommandEvent(event: {
377
588
  payload: JsonObject;
378
589
  }): boolean;
379
590
 
380
- export { type StartTimerCommand as $, ACTIVITY_CANCELLATION_TYPES as A, BUILT_IN_QUERIES as B, type ChildCancellationType as C, DEFAULT_HISTORY_LIMIT as D, ERROR_TYPES as E, type Failure as F, PHASE_B_PARITY_COMMANDS as G, HISTORY_LIMIT_EXCEEDED_RATIO as H, INPUT_EVENTS as I, PHASE_C_COMMANDS as J, type RecordLocalActivityCommand as K, type LocalActivityRequest as L, type RecordMarkerCommand as M, type RecordSideEffectCommand as N, type RejectUpdateCommand as O, type ParentClosePolicy as P, type RequestCancelActivityCommand as Q, type RetryPolicy as R, type RequestCancelExternalRunCommand as S, type RunEventDraft as T, type RunEventRecord as U, type RunEventType as V, type WorkflowCommand as W, type RunTarget as X, type ScheduleActivityCommand as Y, type SignalRunCommand as Z, type StartChildRunCommand as _, type WorkflowTaskFailureCause as a, TASK_FAILURE_CAUSES as a0, TERMINAL_COMMANDS as a1, TERMINAL_EVENTS as a2, type TaskLogLine as a3, type UpsertContextCommand as a4, type UpsertSearchAttributesCommand as a5, type WorkflowInfoSnapshot as a6, type WorkflowTaskRequest as a7, type WorkflowTaskResult as a8, isCommandEvent as a9, isInputEvent as aa, type AcceptUpdateCommand as b, type ActivityCancellationType as c, type BuiltInQueryName as d, CHILD_CANCELLATION_TYPES as e, COMMAND_EVENTS as f, COMMAND_EVENT_TYPES as g, COMMAND_TYPES as h, CONTINUE_AS_NEW_SUGGESTED_RATIO as i, type CancelTimerCommand as j, type CancelWorkflowCommand as k, type ChildRunOptions as l, type CommandType as m, type CompleteUpdateCommand as n, type CompleteWorkflowCommand as o, type ContinueAsNewCommand as p, EVENT_TYPES as q, EXECUTION_KINDS as r, type ExecutionKind as s, type FailWorkflowCommand as t, type FailureSource as u, HISTORY_PROTOCOL as v, type Headers as w, type HistoryLimit as x, PARENT_CLOSE_POLICIES as y, PHASE_B_CORE_COMMANDS as z };
591
+ export { PARENT_CLOSE_POLICIES as $, ACTIVITY_CANCELLATION_TYPES as A, BUILT_IN_QUERIES as B, type ChildCancellationType as C, DEFAULT_HISTORY_LIMIT as D, ERROR_TYPES as E, type Failure as F, FAIRNESS_WEIGHT_MAX as G, FAIRNESS_WEIGHT_MIN as H, type FailWorkflowCommand as I, type FailureSource as J, HISTORY_LIMIT_EXCEEDED_RATIO as K, HISTORY_PROTOCOL as L, type Headers as M, type HistoryLimit as N, INPUT_EVENTS as O, type ParentClosePolicy as P, type QueryResult as Q, type RunEventRecord as R, LOCAL_ACTIVITY_MAX_TIMEOUT_MS as S, type TaskLogLine as T, type UnfinishedHandler as U, type LocalActivityRequest as V, type WorkflowCommand as W, type LocalActivityResult as X, MAX_ACTIVITY_CONNECTIONS as Y, MAX_HEADERS_BYTES as Z, MAX_SINK_CALLS as _, type WorkflowTaskFailureCause as a, PHASE_B_CORE_COMMANDS as a0, PHASE_B_PARITY_COMMANDS as a1, PHASE_C_COMMANDS as a2, RUNTIME_CAPABILITIES as a3, RUNTIME_RELEASE as a4, type RecordLocalActivityCommand as a5, type RecordMarkerCommand as a6, type RecordSideEffectCommand as a7, type RejectUpdateCommand as a8, type RequestCancelActivityCommand as a9, type WorkflowTaskResult as aA, type WorkflowTimeoutType as aB, type WorkflowTimeouts as aC, isCommandEvent as aD, isInputEvent as aE, type RequestCancelExternalRunCommand as aa, type RunEventDraft as ab, type RunEventType as ac, type RunTarget as ad, type RuntimeCapability as ae, type ScheduleActivityCommand as af, type ScheduleNodeActivityCommand as ag, type ScheduleUserActivityCommand as ah, type SignalRunCommand as ai, type SinkCall as aj, type StartChildRunCommand as ak, type StartTimerCommand as al, TASK_FAILURE_CAUSES as am, TASK_QUEUE_NAME_PATTERN as an, TERMINAL_COMMANDS as ao, TERMINAL_EVENTS as ap, type UpsertContextCommand as aq, type UpsertSearchAttributesCommand as ar, VERSIONING_BEHAVIORS as as, type VersioningBehavior as at, WORKFLOW_ID_CONFLICT_POLICIES as au, WORKFLOW_ID_REUSE_POLICIES as av, WORKFLOW_TIMEOUT_TYPES as aw, type WorkflowIdConflictPolicy as ax, type WorkflowIdReusePolicy as ay, type WorkflowTaskRequest as az, type WorkflowInfoSnapshot as b, type UpdateRequest as c, type QueryRequest as d, type RetryPolicy as e, type RunRetryPolicy as f, ACTIVITY_NAME_PATTERN as g, type AcceptUpdateCommand as h, type ActivityCancellationType as i, type BuiltInQueryName as j, CHILD_CANCELLATION_TYPES as k, COMMAND_EVENTS as l, COMMAND_EVENT_TYPES as m, COMMAND_TYPES as n, CONTINUE_AS_NEW_SUGGESTED_RATIO as o, type CancelTimerCommand as p, type CancelWorkflowCommand as q, type ChildRunOptions as r, type CommandType as s, type CompleteUpdateCommand as t, type CompleteWorkflowCommand as u, type ContinueAsNewCommand as v, EVENT_TYPES as w, EXECUTION_KINDS as x, type ExecutionKind as y, FAIRNESS_KEY_MAX_LENGTH as z };
@@ -147,6 +147,12 @@ interface WorkflowInterface {
147
147
  interface CodeBundleWorkflowExport {
148
148
  interface?: WorkflowInterface;
149
149
  taskQueue?: string;
150
+ /**
151
+ * The run-level settings of the function's `workflow()` declaration (R2,
152
+ * C-FEATURES): what the service applies to a run of this `workflowFn`,
153
+ * including a same-bundle child that runs on its parent's definition.
154
+ */
155
+ config?: WorkflowConfig;
150
156
  [key: string]: unknown;
151
157
  }
152
158
  /** A user activity declared by a code bundle. */
@@ -173,6 +179,8 @@ interface WorkflowCode {
173
179
  };
174
180
  };
175
181
  determinism?: 'isolate' | 'worker';
182
+ /** Runtime features the bundle uses (C-FEATURES, SDK R2); absent before R2. */
183
+ features?: string[];
176
184
  [key: string]: unknown;
177
185
  }
178
186
  /** How a document was produced (spec 01 §6). Never affects execution. */
@@ -198,6 +206,17 @@ interface WorkflowConfig {
198
206
  /** Workflow-task budget in seconds or a duration string (v2). */
199
207
  workflowTaskTimeout?: number | string;
200
208
  versioningBehavior?: 'PINNED' | 'AUTO_UPGRADE';
209
+ /** Run-level retry of DURABLE_FN runs (v2); delays are seconds or duration strings. */
210
+ retry?: WorkflowRunRetryConfig;
211
+ [key: string]: unknown;
212
+ }
213
+ /** `config.retry` (11 §2.17). */
214
+ interface WorkflowRunRetryConfig {
215
+ maxAttempts?: number;
216
+ initialDelay?: number | string;
217
+ backoffMultiplier?: number;
218
+ maxDelay?: number | string;
219
+ nonRetryableErrorTypes?: string[];
201
220
  [key: string]: unknown;
202
221
  }
203
222
  /** The canonical workflow definition (`definitionJson`). */
@@ -222,4 +241,4 @@ interface WorkflowDefinition {
222
241
  [key: string]: unknown;
223
242
  }
224
243
 
225
- export type { CodeBundleActivityExport as C, ErrorType as E, JsonObject as J, LegacyCredentialRef as L, NodeArgs as N, Position as P, RetryConfig as R, WorkflowInterface as W, Json as a, WorkflowDefinition as b, CodeBundleWorkflowExport as c, ConnectionRef as d, ExecutionSettings as e, NodeErrorConfig as f, NodeTimeout as g, RunOnSetting as h, WorkflowAuthoring as i, WorkflowCode as j, WorkflowConfig as k, WorkflowEdge as l, WorkflowNode as m };
244
+ export type { CodeBundleActivityExport as C, ErrorType as E, JsonObject as J, LegacyCredentialRef as L, NodeArgs as N, Position as P, RetryConfig as R, WorkflowDefinition as W, Json as a, WorkflowInterface as b, CodeBundleWorkflowExport as c, ConnectionRef as d, ExecutionSettings as e, NodeErrorConfig as f, NodeTimeout as g, RunOnSetting as h, WorkflowAuthoring as i, WorkflowCode as j, WorkflowConfig as k, WorkflowEdge as l, WorkflowNode as m, WorkflowRunRetryConfig as n };
@@ -147,6 +147,12 @@ interface WorkflowInterface {
147
147
  interface CodeBundleWorkflowExport {
148
148
  interface?: WorkflowInterface;
149
149
  taskQueue?: string;
150
+ /**
151
+ * The run-level settings of the function's `workflow()` declaration (R2,
152
+ * C-FEATURES): what the service applies to a run of this `workflowFn`,
153
+ * including a same-bundle child that runs on its parent's definition.
154
+ */
155
+ config?: WorkflowConfig;
150
156
  [key: string]: unknown;
151
157
  }
152
158
  /** A user activity declared by a code bundle. */
@@ -173,6 +179,8 @@ interface WorkflowCode {
173
179
  };
174
180
  };
175
181
  determinism?: 'isolate' | 'worker';
182
+ /** Runtime features the bundle uses (C-FEATURES, SDK R2); absent before R2. */
183
+ features?: string[];
176
184
  [key: string]: unknown;
177
185
  }
178
186
  /** How a document was produced (spec 01 §6). Never affects execution. */
@@ -198,6 +206,17 @@ interface WorkflowConfig {
198
206
  /** Workflow-task budget in seconds or a duration string (v2). */
199
207
  workflowTaskTimeout?: number | string;
200
208
  versioningBehavior?: 'PINNED' | 'AUTO_UPGRADE';
209
+ /** Run-level retry of DURABLE_FN runs (v2); delays are seconds or duration strings. */
210
+ retry?: WorkflowRunRetryConfig;
211
+ [key: string]: unknown;
212
+ }
213
+ /** `config.retry` (11 §2.17). */
214
+ interface WorkflowRunRetryConfig {
215
+ maxAttempts?: number;
216
+ initialDelay?: number | string;
217
+ backoffMultiplier?: number;
218
+ maxDelay?: number | string;
219
+ nonRetryableErrorTypes?: string[];
201
220
  [key: string]: unknown;
202
221
  }
203
222
  /** The canonical workflow definition (`definitionJson`). */
@@ -222,4 +241,4 @@ interface WorkflowDefinition {
222
241
  [key: string]: unknown;
223
242
  }
224
243
 
225
- export type { CodeBundleActivityExport as C, ErrorType as E, JsonObject as J, LegacyCredentialRef as L, NodeArgs as N, Position as P, RetryConfig as R, WorkflowInterface as W, Json as a, WorkflowDefinition as b, CodeBundleWorkflowExport as c, ConnectionRef as d, ExecutionSettings as e, NodeErrorConfig as f, NodeTimeout as g, RunOnSetting as h, WorkflowAuthoring as i, WorkflowCode as j, WorkflowConfig as k, WorkflowEdge as l, WorkflowNode as m };
244
+ export type { CodeBundleActivityExport as C, ErrorType as E, JsonObject as J, LegacyCredentialRef as L, NodeArgs as N, Position as P, RetryConfig as R, WorkflowDefinition as W, Json as a, WorkflowInterface as b, CodeBundleWorkflowExport as c, ConnectionRef as d, ExecutionSettings as e, NodeErrorConfig as f, NodeTimeout as g, RunOnSetting as h, WorkflowAuthoring as i, WorkflowCode as j, WorkflowConfig as k, WorkflowEdge as l, WorkflowNode as m, WorkflowRunRetryConfig as n };
@@ -1,5 +1,5 @@
1
- import { a as Json, J as JsonObject, d as ConnectionRef, L as LegacyCredentialRef, R as RetryConfig, g as NodeTimeout, f as NodeErrorConfig, e as ExecutionSettings, m as WorkflowNode, l as WorkflowEdge, k as WorkflowConfig, W as WorkflowInterface, j as WorkflowCode } from './types-BGoPzgcl.js';
2
- import { h as DurableWorkflow, O as Operation } from './workflow-C2a05WUJ.js';
1
+ import { a as Json, J as JsonObject, d as ConnectionRef, L as LegacyCredentialRef, R as RetryConfig, g as NodeTimeout, f as NodeErrorConfig, e as ExecutionSettings, m as WorkflowNode, l as WorkflowEdge, k as WorkflowConfig, b as WorkflowInterface, j as WorkflowCode } from './types-V7jEEUaL.js';
2
+ import { v as DurableWorkflow, O as Operation } from './workflow-BGnv8SS6.js';
3
3
 
4
4
  /**
5
5
  * Typed references and predicates for the tier-1 builder (spec 02 §3).