@fluidgrids/workflows 2026.1027.0 → 2026.1028.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 (168) hide show
  1. package/README.md +170 -18
  2. package/dist/activation-BBh1p82z.d.cts +57 -0
  3. package/dist/activation-DnhG7SmF.d.ts +57 -0
  4. package/dist/assemble-BLqQ8lSu.d.cts +39 -0
  5. package/dist/assemble-DWgaXHd-.d.ts +39 -0
  6. package/dist/chunk-2DP2Y6EU.cjs +832 -0
  7. package/dist/chunk-2J6TF7YI.cjs +86 -0
  8. package/dist/chunk-3FOTFQ3J.js +1622 -0
  9. package/dist/chunk-4LYSEANA.js +199 -0
  10. package/dist/{chunk-KUTMY2IO.cjs → chunk-57MSZ24T.cjs} +162 -98
  11. package/dist/{chunk-BWSLWF2E.js → chunk-5HDSBTBX.js} +99 -32
  12. package/dist/chunk-623FVQSN.cjs +251 -0
  13. package/dist/{chunk-4DPEGDPW.js → chunk-6FSHT5IL.js} +4 -4
  14. package/dist/{chunk-REV7ZOA4.js → chunk-7AAZGVKD.js} +1 -35
  15. package/dist/chunk-7NQ37GZU.js +73 -0
  16. package/dist/chunk-ABFZWYHT.js +612 -0
  17. package/dist/{chunk-SS4LT2IP.js → chunk-BD7ZPG53.js} +5 -10
  18. package/dist/chunk-BO6OVILK.js +79 -0
  19. package/dist/chunk-C5OLWZ42.js +245 -0
  20. package/dist/chunk-CBL5JSCC.cjs +75 -0
  21. package/dist/{chunk-LSKSBVL4.cjs → chunk-CPDK3K5N.cjs} +6 -6
  22. package/dist/chunk-CSNWNFKU.cjs +1635 -0
  23. package/dist/chunk-DJYMDLV5.js +227 -0
  24. package/dist/{chunk-X4HKU3MX.js → chunk-E2VK7J2C.js} +3 -1
  25. package/dist/chunk-FMSW2HDF.cjs +267 -0
  26. package/dist/chunk-FQIHX7YI.cjs +80 -0
  27. package/dist/chunk-FR7KYWRO.cjs +41 -0
  28. package/dist/{chunk-AU3YW7FZ.cjs → chunk-GBQ33SIZ.cjs} +46 -51
  29. package/dist/{chunk-RRQ5HOBF.cjs → chunk-GVTZMA5C.cjs} +4 -4
  30. package/dist/chunk-H7KEVW2M.js +816 -0
  31. package/dist/chunk-HR3BN4C4.cjs +27 -0
  32. package/dist/chunk-IISBRUWJ.js +13 -0
  33. package/dist/chunk-JD2VQIDZ.cjs +15 -0
  34. package/dist/{chunk-PL73GJR4.js → chunk-JZ4TOOLN.js} +1 -1
  35. package/dist/chunk-L24YIZY7.cjs +207 -0
  36. package/dist/chunk-LNUQE6D6.js +39 -0
  37. package/dist/{chunk-BYJ7QTLY.cjs → chunk-NEIUQASE.cjs} +13 -13
  38. package/dist/chunk-P6TA5EZT.cjs +634 -0
  39. package/dist/chunk-PDHLTDZB.js +72 -0
  40. package/dist/chunk-PMCM2OH4.js +46 -0
  41. package/dist/chunk-PZCVF76Q.cjs +868 -0
  42. package/dist/{chunk-GO34UHSY.js → chunk-QAN5MZEM.js} +3 -3
  43. package/dist/{chunk-27HASETB.cjs → chunk-QKZL3ONM.cjs} +3 -1
  44. package/dist/chunk-SAENRNBJ.cjs +52 -0
  45. package/dist/{chunk-LMX35GNQ.js → chunk-SMCANK3F.js} +5 -4
  46. package/dist/{chunk-IZQNUNSU.cjs → chunk-SX2PNKKT.cjs} +18 -17
  47. package/dist/{chunk-LRM6JXJA.cjs → chunk-TBDXTV22.cjs} +0 -37
  48. package/dist/chunk-VOKMAAJP.js +848 -0
  49. package/dist/chunk-XB53G2DK.js +25 -0
  50. package/dist/chunk-Z2Y65YOY.cjs +7 -0
  51. package/dist/codegen/index.cjs +9 -7
  52. package/dist/codegen/index.d.cts +2 -2
  53. package/dist/codegen/index.d.ts +2 -2
  54. package/dist/codegen/index.js +6 -5
  55. package/dist/file-BOoHZgoQ.d.cts +1557 -0
  56. package/dist/file-yuPCFU5b.d.ts +1557 -0
  57. package/dist/history/index.cjs +287 -0
  58. package/dist/history/index.d.cts +157 -0
  59. package/dist/history/index.d.ts +157 -0
  60. package/dist/history/index.js +5 -0
  61. package/dist/index.cjs +134 -36
  62. package/dist/index.d.cts +137 -9
  63. package/dist/index.d.ts +137 -9
  64. package/dist/index.js +8 -3
  65. package/dist/ir/index.cjs +161 -165
  66. package/dist/ir/index.d.cts +32 -12
  67. package/dist/ir/index.d.ts +32 -12
  68. package/dist/ir/index.js +54 -61
  69. package/dist/lower-BuSvAFqi.d.cts +129 -0
  70. package/dist/lower-C_Qv_34S.d.ts +129 -0
  71. package/dist/lower-types-nofRXw9c.d.cts +15 -0
  72. package/dist/lower-types-nofRXw9c.d.ts +15 -0
  73. package/dist/{manifest-Duf-gHdO.d.cts → manifest-0OLw0i7k.d.cts} +1 -1
  74. package/dist/{manifest-Bp9ZJlav.d.ts → manifest-C8N6HDYl.d.ts} +1 -1
  75. package/dist/node-evaluator-CJNP4GHX.js +12 -0
  76. package/dist/node-evaluator-DMKPKUWA.cjs +22 -0
  77. package/dist/quickjs/index.cjs +256 -78
  78. package/dist/quickjs/index.d.cts +48 -7
  79. package/dist/quickjs/index.d.ts +48 -7
  80. package/dist/quickjs/index.js +254 -79
  81. package/dist/roundtrip/index.cjs +404 -129
  82. package/dist/roundtrip/index.d.cts +43 -8
  83. package/dist/roundtrip/index.d.ts +43 -8
  84. package/dist/roundtrip/index.js +260 -19
  85. package/dist/runtime/index.cjs +90 -0
  86. package/dist/runtime/index.d.cts +297 -0
  87. package/dist/runtime/index.d.ts +297 -0
  88. package/dist/runtime/index.js +8 -0
  89. package/dist/testing/index.cjs +1057 -0
  90. package/dist/testing/index.d.cts +305 -0
  91. package/dist/testing/index.d.ts +305 -0
  92. package/dist/testing/index.js +1037 -0
  93. package/dist/{types-Dr2Fn1Ax.d.ts → types-BGoPzgcl.d.cts} +1 -1
  94. package/dist/{types-Dr2Fn1Ax.d.cts → types-BGoPzgcl.d.ts} +1 -1
  95. package/dist/types-CpBBjaGX.d.cts +380 -0
  96. package/dist/types-DV-HX_Gt.d.ts +380 -0
  97. package/dist/{assemble-DMOuaxRI.d.ts → workflow-Bpr3vnA_.d.ts} +60 -162
  98. package/dist/workflow-C2a05WUJ.d.ts +444 -0
  99. package/dist/{assemble-BJo9TECS.d.cts → workflow-FXUkpIBc.d.cts} +60 -162
  100. package/dist/workflow-J-yYixny.d.cts +444 -0
  101. package/fixtures/README.md +128 -0
  102. package/fixtures/histories/activity-failure-fails-run.history.json +163 -0
  103. package/fixtures/histories/activity-retry-then-success.history.json +147 -0
  104. package/fixtures/histories/cancel-activity-abandon.history.json +126 -0
  105. package/fixtures/histories/cancel-activity-compensate.history.json +307 -0
  106. package/fixtures/histories/cancel-concurrent-non-cancellable.history.json +234 -0
  107. package/fixtures/histories/cancel-concurrent-scope-timeout.history.json +184 -0
  108. package/fixtures/histories/cancel-condition-after-cancel.history.json +200 -0
  109. package/fixtures/histories/cancel-during-timer.history.json +123 -0
  110. package/fixtures/histories/cancel-saga-compensations.history.json +325 -0
  111. package/fixtures/histories/cancel-scope-timeout.history.json +148 -0
  112. package/fixtures/histories/child-abandon-outlives-parent.history.json +191 -0
  113. package/fixtures/histories/child-cancel-default.history.json +234 -0
  114. package/fixtures/histories/child-cancel-request.history.json +206 -0
  115. package/fixtures/histories/child-durable-child-side.history.json +124 -0
  116. package/fixtures/histories/child-durable-result.history.json +163 -0
  117. package/fixtures/histories/child-failure-caught.history.json +166 -0
  118. package/fixtures/histories/child-graph-by-key.history.json +138 -0
  119. package/fixtures/histories/child-terminated-by-parent-close.history.json +85 -0
  120. package/fixtures/histories/continue-as-new-first-run.history.json +146 -0
  121. package/fixtures/histories/continue-as-new-history-limit.history.json +489 -0
  122. package/fixtures/histories/continue-as-new-last-run.history.json +147 -0
  123. package/fixtures/histories/continue-as-new-suggested.history.json +352 -0
  124. package/fixtures/histories/details-and-context.history.json +176 -0
  125. package/fixtures/histories/deterministic-values.history.json +128 -0
  126. package/fixtures/histories/engine-builtins.history.json +172 -0
  127. package/fixtures/histories/gather-activities.history.json +291 -0
  128. package/fixtures/histories/gather-all-settled.history.json +219 -0
  129. package/fixtures/histories/gather-mixed.history.json +281 -0
  130. package/fixtures/histories/input-during-running-task.history.json +111 -0
  131. package/fixtures/histories/nondeterminism-reordered.history.json +218 -0
  132. package/fixtures/histories/patched-deprecated.history.json +271 -0
  133. package/fixtures/histories/patched-new-run.history.json +270 -0
  134. package/fixtures/histories/patched-old-history.history.json +190 -0
  135. package/fixtures/histories/race-activity-wins.history.json +152 -0
  136. package/fixtures/histories/race-signal-beats-child.history.json +161 -0
  137. package/fixtures/histories/race-timeout-wins.history.json +118 -0
  138. package/fixtures/histories/side-effect-recorded.history.json +153 -0
  139. package/fixtures/histories/signal-buffered-at-start.history.json +157 -0
  140. package/fixtures/histories/signal-default-handler.history.json +187 -0
  141. package/fixtures/histories/signal-handler.history.json +191 -0
  142. package/fixtures/histories/signal-parent-child-side.history.json +132 -0
  143. package/fixtures/histories/signal-parent.history.json +202 -0
  144. package/fixtures/histories/signal-run-delivered.history.json +128 -0
  145. package/fixtures/histories/signal-run-undelivered.history.json +134 -0
  146. package/fixtures/histories/signal-wait.history.json +111 -0
  147. package/fixtures/histories/task-failure-code-error.history.json +137 -0
  148. package/fixtures/histories/task-failure-then-transient-attempt.history.json +140 -0
  149. package/fixtures/histories/timer-condition-met.history.json +201 -0
  150. package/fixtures/histories/timer-condition-timeout.history.json +118 -0
  151. package/fixtures/histories/timer-sleep-once.history.json +118 -0
  152. package/fixtures/histories/timer-sleep-sequence.history.json +210 -0
  153. package/fixtures/histories/update-accepted-completed.history.json +149 -0
  154. package/fixtures/histories/update-with-start-rejected-validation.history.json +91 -0
  155. package/package.json +85 -20
  156. package/schema/history-file.schema.json +2544 -0
  157. package/schema/ir-v2.schema.json +16 -0
  158. package/schema/run-event.schema.json +2374 -0
  159. package/schema/workflow-command.schema.json +1095 -0
  160. package/schema/workflow-task.schema.json +3560 -0
  161. package/dist/chunk-265J2FCH.cjs +0 -33
  162. package/dist/chunk-LUXCXFOE.cjs +0 -269
  163. package/dist/chunk-S34NJE3A.js +0 -262
  164. package/dist/chunk-SRQRLWOS.js +0 -31
  165. package/dist/lower-DcOY8ux0.d.cts +0 -49
  166. package/dist/lower-Dw5grNrI.d.ts +0 -49
  167. package/dist/node-evaluator-2GTUZVPK.cjs +0 -17
  168. package/dist/node-evaluator-RMYEWCXZ.js +0 -8
@@ -1,8 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkG4UEPUGO_cjs = require('./chunk-G4UEPUGO.cjs');
4
- var chunkRRQ5HOBF_cjs = require('./chunk-RRQ5HOBF.cjs');
5
- var chunkLRM6JXJA_cjs = require('./chunk-LRM6JXJA.cjs');
4
+ var chunkGVTZMA5C_cjs = require('./chunk-GVTZMA5C.cjs');
5
+ var chunkTBDXTV22_cjs = require('./chunk-TBDXTV22.cjs');
6
+ var chunkSAENRNBJ_cjs = require('./chunk-SAENRNBJ.cjs');
7
+ var chunkFQIHX7YI_cjs = require('./chunk-FQIHX7YI.cjs');
6
8
 
7
9
  // src/builder/descriptors.ts
8
10
  function op(nodeType, version, operation) {
@@ -82,52 +84,52 @@ function edge(from, options = {}) {
82
84
  return { kind: "edge", from, ...options };
83
85
  }
84
86
  function isTier1Workflow(value) {
85
- return chunkLRM6JXJA_cjs.isRecord(value) && value["__fluidgrids"] === WORKFLOW_MARKER && chunkLRM6JXJA_cjs.isRecord(value["recording"]);
87
+ return chunkSAENRNBJ_cjs.isRecord(value) && value["__fluidgrids"] === WORKFLOW_MARKER && chunkSAENRNBJ_cjs.isRecord(value["recording"]);
86
88
  }
87
89
  function deepMerge(base, extra, path) {
88
90
  for (const [key, value] of Object.entries(extra)) {
89
- const existing = base[key];
90
- if (chunkLRM6JXJA_cjs.isRecord(existing) && chunkLRM6JXJA_cjs.isRecord(value)) {
91
+ const existing = chunkSAENRNBJ_cjs.ownValue(base, key);
92
+ if (chunkSAENRNBJ_cjs.isRecord(existing) && chunkSAENRNBJ_cjs.isRecord(value)) {
91
93
  deepMerge(existing, value, `${path}.${key}`);
92
94
  } else if (existing !== void 0) {
93
- throw new chunkRRQ5HOBF_cjs.BuilderError(
95
+ throw new chunkGVTZMA5C_cjs.BuilderError(
94
96
  `extra sets ${path}.${key}, which the builder already wrote; use the typed option`
95
97
  );
96
98
  } else {
97
- base[key] = lowerValue(value, `${path}.${key}`);
99
+ chunkSAENRNBJ_cjs.setOwn(base, key, lowerValue(value, `${path}.${key}`));
98
100
  }
99
101
  }
100
102
  }
101
103
  function lowerValue(value, path) {
102
- const model = chunkRRQ5HOBF_cjs.refModelOf(value);
103
- if (model) return chunkLRM6JXJA_cjs.formatRefTemplate(model);
104
+ const model = chunkGVTZMA5C_cjs.refModelOf(value);
105
+ if (model) return chunkTBDXTV22_cjs.formatRefTemplate(model);
104
106
  if (value === null || typeof value === "string" || typeof value === "boolean") return value;
105
107
  if (typeof value === "number") {
106
- if (!Number.isFinite(value)) throw new chunkRRQ5HOBF_cjs.BuilderError(`${path} is not a finite number`);
108
+ if (!Number.isFinite(value)) throw new chunkGVTZMA5C_cjs.BuilderError(`${path} is not a finite number`);
107
109
  return value;
108
110
  }
109
111
  if (Array.isArray(value))
110
112
  return value.map((item, index) => lowerValue(item, `${path}[${index}]`));
111
- if (chunkRRQ5HOBF_cjs.isPredicate(value)) {
112
- throw new chunkRRQ5HOBF_cjs.BuilderError(`${path} is a condition; conditions belong in wf.if({ condition })`);
113
+ if (chunkGVTZMA5C_cjs.isPredicate(value)) {
114
+ throw new chunkGVTZMA5C_cjs.BuilderError(`${path} is a condition; conditions belong in wf.if({ condition })`);
113
115
  }
114
- if (chunkLRM6JXJA_cjs.isRecord(value)) {
116
+ if (chunkSAENRNBJ_cjs.isRecord(value)) {
115
117
  const proto = Object.getPrototypeOf(value);
116
118
  if (proto !== Object.prototype && proto !== null) {
117
- throw new chunkRRQ5HOBF_cjs.BuilderError(`${path} is not a plain object`);
119
+ throw new chunkGVTZMA5C_cjs.BuilderError(`${path} is not a plain object`);
118
120
  }
119
121
  const out = {};
120
122
  for (const [key, child] of Object.entries(value)) {
121
123
  if (child === void 0) continue;
122
- out[key] = lowerValue(child, `${path}.${key}`);
124
+ chunkSAENRNBJ_cjs.setOwn(out, key, lowerValue(child, `${path}.${key}`));
123
125
  }
124
126
  return out;
125
127
  }
126
- throw new chunkRRQ5HOBF_cjs.BuilderError(`${path} cannot be stored in a workflow definition (${typeof value})`);
128
+ throw new chunkGVTZMA5C_cjs.BuilderError(`${path} cannot be stored in a workflow definition (${typeof value})`);
127
129
  }
128
130
  function lowerObject(value, path) {
129
131
  const lowered = lowerValue(value, path);
130
- if (!chunkLRM6JXJA_cjs.isRecord(lowered)) throw new chunkRRQ5HOBF_cjs.BuilderError(`${path} must be an object`);
132
+ if (!chunkSAENRNBJ_cjs.isRecord(lowered)) throw new chunkGVTZMA5C_cjs.BuilderError(`${path} must be an object`);
131
133
  return lowered;
132
134
  }
133
135
  function slugify(text) {
@@ -142,24 +144,24 @@ function nodeRef(id) {
142
144
  kind: "node",
143
145
  id,
144
146
  // An untyped reference serves every output type; the static type comes from the operation.
145
- output: chunkRRQ5HOBF_cjs.makeRef({ kind: "node", nodeId: id }),
147
+ output: chunkGVTZMA5C_cjs.makeRef({ kind: "node", nodeId: id }),
146
148
  handle: (name) => handleRef(id, name)
147
149
  };
148
150
  }
149
151
  function isNodeRef(value) {
150
- return chunkLRM6JXJA_cjs.isRecord(value) && value["kind"] === "node" && typeof value["id"] === "string";
152
+ return chunkSAENRNBJ_cjs.isRecord(value) && value["kind"] === "node" && typeof value["id"] === "string";
151
153
  }
152
154
  function isHandleRef(value) {
153
- return chunkLRM6JXJA_cjs.isRecord(value) && value["kind"] === "handle" && typeof value["nodeId"] === "string";
155
+ return chunkSAENRNBJ_cjs.isRecord(value) && value["kind"] === "handle" && typeof value["nodeId"] === "string";
154
156
  }
155
157
  function isEdgeSpec(value) {
156
- return chunkLRM6JXJA_cjs.isRecord(value) && value["kind"] === "edge" && "from" in value;
158
+ return chunkSAENRNBJ_cjs.isRecord(value) && value["kind"] === "edge" && "from" in value;
157
159
  }
158
160
  function sourceOf(from) {
159
161
  if (typeof from === "string") return { source: from };
160
162
  if (isHandleRef(from)) return { source: from.nodeId, sourceHandle: from.handle };
161
163
  if (isNodeRef(from)) return { source: from.id };
162
- throw new chunkRRQ5HOBF_cjs.BuilderError("after takes node references, handles, node ids or edge(\u2026) entries");
164
+ throw new chunkGVTZMA5C_cjs.BuilderError("after takes node references, handles, node ids or edge(\u2026) entries");
163
165
  }
164
166
  function defaultEdgeId(source, target, sourceHandle, targetHandle) {
165
167
  return ["e", source, target, sourceHandle, targetHandle].filter((part) => Boolean(part)).join("-");
@@ -176,7 +178,7 @@ function limitWait(limit) {
176
178
  const match = /^([1-9][0-9]*)([smhdw])$/.exec(limit);
177
179
  const unit = match?.[2] !== void 0 ? LIMIT_UNITS[match[2]] : void 0;
178
180
  if (!match?.[1] || !unit)
179
- throw new chunkRRQ5HOBF_cjs.BuilderError(`limit "${limit}" must look like 30s, 15m, 2h, 3d or 1w`);
181
+ throw new chunkGVTZMA5C_cjs.BuilderError(`limit "${limit}" must look like 30s, 15m, 2h, 3d or 1w`);
180
182
  return { amount: Number(match[1]), unit };
181
183
  }
182
184
  return { amount: limit.amount, unit: limit.unit };
@@ -187,19 +189,23 @@ var WorkflowBuilder = class {
187
189
  }
188
190
  autoIds;
189
191
  /** `$json`: the current item's JSON. */
190
- json = chunkRRQ5HOBF_cjs.makeRef({ kind: "json" });
192
+ json = chunkGVTZMA5C_cjs.makeRef({ kind: "json" });
191
193
  /** `$vars`: workflow variables. */
192
- vars = chunkRRQ5HOBF_cjs.makeRef({ kind: "vars" });
194
+ vars = chunkGVTZMA5C_cjs.makeRef({ kind: "vars" });
193
195
  /** `$now`. */
194
- now = chunkRRQ5HOBF_cjs.makeRef({ kind: "now" });
196
+ now = chunkGVTZMA5C_cjs.makeRef({ kind: "now" });
195
197
  /** `$execution`: run metadata. */
196
- execution = chunkRRQ5HOBF_cjs.makeRef({ kind: "execution" });
198
+ execution = chunkGVTZMA5C_cjs.makeRef({ kind: "execution" });
197
199
  nodes = [];
198
200
  edges = [];
199
201
  notes = [];
200
202
  ids = /* @__PURE__ */ new Set();
203
+ /** Ids given explicitly; a second edge with the same explicit id is an error. */
201
204
  edgeIds = /* @__PURE__ */ new Set();
205
+ /** Edges whose id is the default, as indices into `edges`, with the unsuffixed default id. */
206
+ defaultIds = [];
202
207
  edgeOrder;
208
+ durableRefs = [];
203
209
  /** A reference to a node by id, for nodes declared later in the source. */
204
210
  ref(id) {
205
211
  return nodeRef(id);
@@ -218,9 +224,9 @@ var WorkflowBuilder = class {
218
224
  const sugar = {};
219
225
  if (condition !== void 0) {
220
226
  if (typeof condition === "string") sugar["condition"] = condition;
221
- else if (chunkRRQ5HOBF_cjs.isPredicate(condition)) sugar["conditionTree"] = chunkRRQ5HOBF_cjs.conditionTreeOf(condition);
227
+ else if (chunkGVTZMA5C_cjs.isPredicate(condition)) sugar["conditionTree"] = chunkGVTZMA5C_cjs.conditionTreeOf(condition);
222
228
  else
223
- throw new chunkRRQ5HOBF_cjs.BuilderError(
229
+ throw new chunkGVTZMA5C_cjs.BuilderError(
224
230
  "condition takes a comparison such as x.output.total.gte(500), and(), or() or a string"
225
231
  );
226
232
  }
@@ -260,7 +266,7 @@ var WorkflowBuilder = class {
260
266
  const sugar = {};
261
267
  if (mode !== void 0) sugar["mode"] = mode;
262
268
  if (inputs !== void 0 && rest.after !== void 0) {
263
- throw new chunkRRQ5HOBF_cjs.BuilderError("merge takes inputs or after, not both");
269
+ throw new chunkGVTZMA5C_cjs.BuilderError("merge takes inputs or after, not both");
264
270
  }
265
271
  const after = inputs?.map(
266
272
  (input, index) => edge(input, { targetHandle: `input-${index + 1}` })
@@ -273,10 +279,21 @@ var WorkflowBuilder = class {
273
279
  }
274
280
  /** `internal:wait-for-signal` (IR v2). */
275
281
  waitForSignal(options) {
276
- const { name, limit, ...rest } = options;
282
+ const { name, limit, until, consume, ...rest } = options;
283
+ if (limit !== void 0 && until !== void 0)
284
+ throw new chunkGVTZMA5C_cjs.BuilderError("wf.waitForSignal takes limit or until, not both");
285
+ if (consume !== void 0 && consume !== "first" && consume !== "all")
286
+ throw new chunkGVTZMA5C_cjs.BuilderError(`consume must be "first" or "all" (got "${String(consume)}")`);
277
287
  const sugar = {};
278
288
  if (name !== void 0) sugar["signalName"] = name;
289
+ if (consume !== void 0) sugar["consume"] = consume;
279
290
  if (limit !== void 0) sugar["limitWait"] = limitWait(limit);
291
+ if (until !== void 0) {
292
+ const deadline = until instanceof Date ? until.toISOString() : until;
293
+ if (typeof deadline !== "string" || Number.isNaN(Date.parse(deadline)))
294
+ throw new chunkGVTZMA5C_cjs.BuilderError(`until "${String(until)}" is not an ISO 8601 date-time`);
295
+ sugar["limitWaitUntil"] = deadline;
296
+ }
280
297
  const ref = this.add(internalNodes.waitForSignal, rest, sugar);
281
298
  return { ...ref, received: ref.handle("received"), timedOut: ref.handle("timedOut") };
282
299
  }
@@ -299,6 +316,45 @@ var WorkflowBuilder = class {
299
316
  if (input !== void 0) sugar["inputMapping"] = input;
300
317
  return this.add(internalNodes.subworkflow, rest, sugar);
301
318
  }
319
+ /**
320
+ * `internal:code-workflow`: run a tier-2 function of this project as a
321
+ * durable child run. `fn` is a `workflow()` value (its export name is
322
+ * resolved when the bundle is collected) or an export name.
323
+ */
324
+ codeWorkflow(fn, options = {}) {
325
+ const {
326
+ input,
327
+ taskQueue,
328
+ waitForCompletion,
329
+ timeoutSeconds,
330
+ failOnError,
331
+ parentClosePolicy,
332
+ ...rest
333
+ } = options;
334
+ let workflowFn;
335
+ let definition;
336
+ if (typeof fn === "string" && fn !== "") workflowFn = fn;
337
+ else if (chunkFQIHX7YI_cjs.isDurableWorkflow(fn)) {
338
+ definition = fn;
339
+ workflowFn = fn.name;
340
+ } else throw new chunkGVTZMA5C_cjs.BuilderError("wf.codeWorkflow needs a workflow() function or its export name");
341
+ if (parentClosePolicy !== void 0 && !["TERMINATE", "ABANDON", "REQUEST_CANCEL"].includes(parentClosePolicy))
342
+ throw new chunkGVTZMA5C_cjs.BuilderError(`parentClosePolicy "${String(parentClosePolicy)}" is not a policy`);
343
+ const sugar = { workflowFn };
344
+ if (input !== void 0) sugar["inputMapping"] = input;
345
+ if (taskQueue !== void 0) sugar["taskQueue"] = taskQueue;
346
+ if (waitForCompletion !== void 0) sugar["waitForCompletion"] = waitForCompletion;
347
+ if (timeoutSeconds !== void 0) sugar["timeout"] = timeoutSeconds;
348
+ if (failOnError !== void 0) sugar["failOnError"] = failOnError;
349
+ if (parentClosePolicy !== void 0) sugar["parentClosePolicy"] = parentClosePolicy;
350
+ const ref = this.add(internalNodes.codeWorkflow, rest, sugar);
351
+ if (definition) this.durableRefs.push({ nodeId: ref.id, definition });
352
+ return ref;
353
+ }
354
+ /** The `wf.codeWorkflow` calls that named a function. */
355
+ durableReferences() {
356
+ return [...this.durableRefs];
357
+ }
302
358
  /** `internal:validate`. */
303
359
  validate(options) {
304
360
  const ref = this.add(internalNodes.validate, options, {});
@@ -377,7 +433,7 @@ var WorkflowBuilder = class {
377
433
  }
378
434
  /** A sticky note on the canvas. */
379
435
  note(content, options) {
380
- if (typeof content !== "string") throw new chunkRRQ5HOBF_cjs.BuilderError("A note takes Markdown text");
436
+ if (typeof content !== "string") throw new chunkGVTZMA5C_cjs.BuilderError("A note takes Markdown text");
381
437
  this.claimId(options.id, "sticky note");
382
438
  const near = options.near === void 0 ? void 0 : typeof options.near === "string" ? options.near : options.near.id;
383
439
  this.notes.push({
@@ -404,11 +460,12 @@ var WorkflowBuilder = class {
404
460
  * differs from the order the code declares its edges in.
405
461
  */
406
462
  edgeOrderIs(order) {
407
- if (this.edgeOrder) throw new chunkRRQ5HOBF_cjs.BuilderError("edgeOrderIs() may be called once");
463
+ if (this.edgeOrder) throw new chunkGVTZMA5C_cjs.BuilderError("edgeOrderIs() may be called once");
408
464
  this.edgeOrder = [...order];
409
465
  }
410
466
  /** The recording, once the callback has returned. */
411
467
  finish(key, document) {
468
+ this.assignDefaultEdgeIds();
412
469
  return {
413
470
  format: RECORDING_FORMAT,
414
471
  formatVersion: RECORDING_FORMAT_VERSION,
@@ -421,27 +478,49 @@ var WorkflowBuilder = class {
421
478
  };
422
479
  }
423
480
  claimId(id, what) {
424
- if (typeof id !== "string" || id === "") throw new chunkRRQ5HOBF_cjs.BuilderError(`A ${what} needs an id`);
425
- if (this.ids.has(id)) throw new chunkRRQ5HOBF_cjs.BuilderError(`Duplicate id "${id}"`);
481
+ if (typeof id !== "string" || id === "") throw new chunkGVTZMA5C_cjs.BuilderError(`A ${what} needs an id`);
482
+ if (this.ids.has(id)) throw new chunkGVTZMA5C_cjs.BuilderError(`Duplicate id "${id}"`);
426
483
  this.ids.add(id);
427
484
  }
428
485
  resolveId(options, operation) {
429
486
  if (options.id !== void 0) return options.id;
430
487
  if (!this.autoIds) {
431
- throw new chunkRRQ5HOBF_cjs.BuilderError(`Every node needs an id (a ${operation.nodeType} node has none)`);
488
+ throw new chunkGVTZMA5C_cjs.BuilderError(`Every node needs an id (a ${operation.nodeType} node has none)`);
432
489
  }
433
490
  const base = slugify(options.label ?? operation.nodeType.split(/[:/]/).pop() ?? "node");
434
491
  let candidate = base;
435
492
  for (let suffix = 2; this.ids.has(candidate); suffix++) candidate = `${base}-${suffix}`;
436
493
  return candidate;
437
494
  }
495
+ /**
496
+ * Give every edge declared without an id its default id. Explicit ids are
497
+ * claimed first, so a default never takes an id the code names; a default that
498
+ * is taken gets `-2`, `-3`, … in declaration order. The result depends only on
499
+ * the builder calls.
500
+ */
501
+ assignDefaultEdgeIds() {
502
+ const taken = new Set(this.edgeIds);
503
+ for (const { index, base } of this.defaultIds) {
504
+ let id = base;
505
+ for (let suffix = 2; taken.has(id); suffix++) id = `${base}-${suffix}`;
506
+ taken.add(id);
507
+ const built = this.edges[index];
508
+ if (built) built.id = id;
509
+ }
510
+ this.defaultIds.length = 0;
511
+ }
438
512
  addEdge(spec, target) {
439
513
  const { source, sourceHandle } = sourceOf(spec.from);
440
- const id = spec.id === false ? void 0 : spec.id ?? defaultEdgeId(source, target, sourceHandle, spec.targetHandle);
441
- if (id !== void 0) {
442
- if (this.edgeIds.has(id)) throw new chunkRRQ5HOBF_cjs.BuilderError(`Duplicate edge id "${id}"`);
443
- this.edgeIds.add(id);
514
+ const explicit = typeof spec.id === "string" ? spec.id : void 0;
515
+ if (spec.id !== void 0 && spec.id !== false && explicit === void 0)
516
+ throw new chunkGVTZMA5C_cjs.BuilderError("An edge id must be a string or false");
517
+ if (explicit !== void 0) {
518
+ if (this.edgeIds.has(explicit)) throw new chunkGVTZMA5C_cjs.BuilderError(`Duplicate edge id "${explicit}"`);
519
+ this.edgeIds.add(explicit);
444
520
  }
521
+ const base = spec.id === void 0 ? defaultEdgeId(source, target, sourceHandle, spec.targetHandle) : void 0;
522
+ const id = explicit ?? base;
523
+ if (base !== void 0) this.defaultIds.push({ index: this.edges.length, base });
445
524
  const built = id !== void 0 ? { id, source, target } : { source, target };
446
525
  if (sourceHandle !== void 0) built["sourceHandle"] = sourceHandle;
447
526
  if (spec.targetHandle !== void 0) built["targetHandle"] = spec.targetHandle;
@@ -457,12 +536,12 @@ var WorkflowBuilder = class {
457
536
  }
458
537
  add(operation, options, sugar) {
459
538
  if (!isOperation(operation)) {
460
- throw new chunkRRQ5HOBF_cjs.BuilderError(
539
+ throw new chunkGVTZMA5C_cjs.BuilderError(
461
540
  "The first argument must be a node operation (nodes.*, triggers.* or a generated client)"
462
541
  );
463
542
  }
464
543
  if (typeof options !== "object" || options === null || Array.isArray(options)) {
465
- throw new chunkRRQ5HOBF_cjs.BuilderError("Node options must be an object");
544
+ throw new chunkGVTZMA5C_cjs.BuilderError("Node options must be an object");
466
545
  }
467
546
  const id = this.resolveId(options, operation);
468
547
  this.claimId(id, "node");
@@ -479,17 +558,17 @@ var WorkflowBuilder = class {
479
558
  if (explicitArgs || Object.keys(sugarArgs).length > 0) {
480
559
  for (const key of Object.keys(sugarArgs)) {
481
560
  if (explicitArgs && Object.hasOwn(explicitArgs, key)) {
482
- throw new chunkRRQ5HOBF_cjs.BuilderError(`${where}: "${key}" is set twice (by an option and in args)`);
561
+ throw new chunkGVTZMA5C_cjs.BuilderError(`${where}: "${key}" is set twice (by an option and in args)`);
483
562
  }
484
563
  }
485
564
  args["state"] = { ...explicitArgs, ...sugarArgs };
486
565
  }
487
566
  if (options.connection !== void 0 && options.connections !== void 0) {
488
- throw new chunkRRQ5HOBF_cjs.BuilderError(`${where}: use connection (names) or connections (ids), not both`);
567
+ throw new chunkGVTZMA5C_cjs.BuilderError(`${where}: use connection (names) or connections (ids), not both`);
489
568
  }
490
569
  const connectionNames = options.connection === void 0 ? void 0 : typeof options.connection === "string" ? [options.connection] : [...options.connection];
491
570
  if (connectionNames?.some((name) => typeof name !== "string" || name === "")) {
492
- throw new chunkRRQ5HOBF_cjs.BuilderError(`${where}: connection names must be non-empty strings`);
571
+ throw new chunkGVTZMA5C_cjs.BuilderError(`${where}: connection names must be non-empty strings`);
493
572
  }
494
573
  if (options.connections !== void 0)
495
574
  args["connections"] = lowerValue(options.connections, `${where} connections`);
@@ -500,7 +579,7 @@ var WorkflowBuilder = class {
500
579
  if (Object.keys(args).length > 0 || connectionNames) node["args"] = args;
501
580
  const hasSugar = options.retry !== void 0 || options.timeout !== void 0 || options.onError !== void 0;
502
581
  if (options.errorConfig !== void 0 && hasSugar) {
503
- throw new chunkRRQ5HOBF_cjs.BuilderError(`${where}: use errorConfig or retry / timeout / onError, not both`);
582
+ throw new chunkGVTZMA5C_cjs.BuilderError(`${where}: use errorConfig or retry / timeout / onError, not both`);
504
583
  }
505
584
  if (options.errorConfig !== void 0) {
506
585
  node["errorConfig"] = lowerObject(options.errorConfig, `${where} errorConfig`);
@@ -540,7 +619,7 @@ var WorkflowBuilder = class {
540
619
  };
541
620
  function defineWorkflow(options, build) {
542
621
  if (typeof options !== "object" || options === null || typeof options.key !== "string" || options.key === "") {
543
- throw new chunkRRQ5HOBF_cjs.BuilderError("defineWorkflow needs a key");
622
+ throw new chunkGVTZMA5C_cjs.BuilderError("defineWorkflow needs a key");
544
623
  }
545
624
  const builder = new WorkflowBuilder(options.autoIds === true);
546
625
  build(builder);
@@ -556,12 +635,15 @@ function defineWorkflow(options, build) {
556
635
  if (options.extra !== void 0)
557
636
  deepMerge(document, lowerObject(options.extra, "extra"), "workflow");
558
637
  const recording = builder.finish(options.key, document);
559
- return { __fluidgrids: WORKFLOW_MARKER, key: options.key, recording };
638
+ const durableRefs = builder.durableReferences();
639
+ return {
640
+ __fluidgrids: WORKFLOW_MARKER,
641
+ key: options.key,
642
+ recording,
643
+ ...durableRefs.length > 0 ? { durableRefs } : {}
644
+ };
560
645
  }
561
646
 
562
- // src/generated/version.ts
563
- var SDK_VERSION = "2026.1027.0";
564
-
565
647
  // src/builder/assemble.ts
566
648
  var LAYOUT_FORMAT = "fluidgrids.layout";
567
649
  var LAYOUT_FORMAT_VERSION = 1;
@@ -579,19 +661,19 @@ function resolveConnection(resolver, name) {
579
661
  return Object.hasOwn(resolver, name) ? resolver[name] : void 0;
580
662
  }
581
663
  function parseLayoutSidecar(value) {
582
- if (!chunkLRM6JXJA_cjs.isRecord(value) || value["format"] !== LAYOUT_FORMAT || value["formatVersion"] !== LAYOUT_FORMAT_VERSION) {
583
- throw new chunkRRQ5HOBF_cjs.BuilderError(
664
+ if (!chunkSAENRNBJ_cjs.isRecord(value) || value["format"] !== LAYOUT_FORMAT || value["formatVersion"] !== LAYOUT_FORMAT_VERSION) {
665
+ throw new chunkGVTZMA5C_cjs.BuilderError(
584
666
  `A layout file must have format "${LAYOUT_FORMAT}" and formatVersion ${LAYOUT_FORMAT_VERSION}`
585
667
  );
586
668
  }
587
669
  const positions = value["positions"];
588
- if (!chunkLRM6JXJA_cjs.isRecord(positions)) throw new chunkRRQ5HOBF_cjs.BuilderError("A layout file needs a positions object");
670
+ if (!chunkSAENRNBJ_cjs.isRecord(positions)) throw new chunkGVTZMA5C_cjs.BuilderError("A layout file needs a positions object");
589
671
  const parsed = {};
590
672
  for (const [id, position] of Object.entries(positions)) {
591
- if (!chunkLRM6JXJA_cjs.isRecord(position) || typeof position["x"] !== "number" || typeof position["y"] !== "number") {
592
- throw new chunkRRQ5HOBF_cjs.BuilderError(`The layout position of "${id}" must be { x, y }`);
673
+ if (!chunkSAENRNBJ_cjs.isRecord(position) || typeof position["x"] !== "number" || typeof position["y"] !== "number") {
674
+ throw new chunkGVTZMA5C_cjs.BuilderError(`The layout position of "${id}" must be { x, y }`);
593
675
  }
594
- parsed[id] = { x: position["x"], y: position["y"] };
676
+ chunkSAENRNBJ_cjs.setOwn(parsed, id, { x: position["x"], y: position["y"] });
595
677
  }
596
678
  const sidecar = {
597
679
  format: LAYOUT_FORMAT,
@@ -599,15 +681,15 @@ function parseLayoutSidecar(value) {
599
681
  positions: parsed
600
682
  };
601
683
  if (value["stickyNotes"] !== void 0) {
602
- if (!Array.isArray(value["stickyNotes"]) || !value["stickyNotes"].every(chunkLRM6JXJA_cjs.isRecord)) {
603
- throw new chunkRRQ5HOBF_cjs.BuilderError("stickyNotes in a layout file must be an array of objects");
684
+ if (!Array.isArray(value["stickyNotes"]) || !value["stickyNotes"].every(chunkSAENRNBJ_cjs.isRecord)) {
685
+ throw new chunkGVTZMA5C_cjs.BuilderError("stickyNotes in a layout file must be an array of objects");
604
686
  }
605
- sidecar.stickyNotes = chunkLRM6JXJA_cjs.cloneJson(value["stickyNotes"]);
687
+ sidecar.stickyNotes = chunkSAENRNBJ_cjs.cloneJson(value["stickyNotes"]);
606
688
  }
607
689
  if (value["metaLayout"] !== void 0) {
608
- if (!chunkLRM6JXJA_cjs.isRecord(value["metaLayout"]))
609
- throw new chunkRRQ5HOBF_cjs.BuilderError("metaLayout in a layout file must be an object");
610
- sidecar.metaLayout = chunkLRM6JXJA_cjs.cloneJson(value["metaLayout"]);
690
+ if (!chunkSAENRNBJ_cjs.isRecord(value["metaLayout"]))
691
+ throw new chunkGVTZMA5C_cjs.BuilderError("metaLayout in a layout file must be an object");
692
+ sidecar.metaLayout = chunkSAENRNBJ_cjs.cloneJson(value["metaLayout"]);
611
693
  }
612
694
  return sidecar;
613
695
  }
@@ -622,7 +704,7 @@ function orderEdges(edges, order) {
622
704
  );
623
705
  const valid = indices.length === edges.length && new Set(indices).size === indices.length && indices.every((index) => Number.isInteger(index) && index >= 0 && index < edges.length);
624
706
  if (!valid)
625
- throw new chunkRRQ5HOBF_cjs.BuilderError(
707
+ throw new chunkGVTZMA5C_cjs.BuilderError(
626
708
  "edgeOrderIs() must name every edge exactly once, by id or declaration position"
627
709
  );
628
710
  return indices.map((index) => edges[index]);
@@ -630,7 +712,7 @@ function orderEdges(edges, order) {
630
712
  function assembleRecording(recording, options = {}) {
631
713
  const missing = /* @__PURE__ */ new Set();
632
714
  const nodes2 = recording.nodes.map((recorded) => {
633
- const node = chunkLRM6JXJA_cjs.cloneJson(recorded.node);
715
+ const node = chunkSAENRNBJ_cjs.cloneJson(recorded.node);
634
716
  if (recorded.connectionNames) {
635
717
  const refs = [];
636
718
  for (const name of recorded.connectionNames) {
@@ -638,14 +720,14 @@ function assembleRecording(recording, options = {}) {
638
720
  if (ref) refs.push({ connectionId: ref.connectionId, adapter: ref.adapter });
639
721
  else missing.add(name);
640
722
  }
641
- const args = chunkLRM6JXJA_cjs.isRecord(node["args"]) ? node["args"] : {};
723
+ const args = chunkSAENRNBJ_cjs.isRecord(node["args"]) ? node["args"] : {};
642
724
  args["connections"] = refs;
643
725
  node["args"] = args;
644
726
  }
645
727
  return node;
646
728
  });
647
729
  if (missing.size > 0) throw new UnresolvedConnectionsError([...missing].sort());
648
- const edges = orderEdges(chunkLRM6JXJA_cjs.cloneJson(recording.edges), recording.edgeOrder);
730
+ const edges = orderEdges(chunkSAENRNBJ_cjs.cloneJson(recording.edges), recording.edgeOrder);
649
731
  const ids = nodes2.map((node) => String(node["id"]));
650
732
  const positions = options.layout?.positions ?? {};
651
733
  const needsAuto = ids.some((id) => !Object.hasOwn(positions, id));
@@ -655,25 +737,25 @@ function assembleRecording(recording, options = {}) {
655
737
  const position = Object.hasOwn(positions, id) ? positions[id] : auto.get(id);
656
738
  if (position) node["position"] = { x: position.x, y: position.y };
657
739
  }
658
- const stickyNotes = options.layout?.stickyNotes !== void 0 || recording.notes.length > 0 ? [...options.layout?.stickyNotes ? chunkLRM6JXJA_cjs.cloneJson(options.layout.stickyNotes) : []] : void 0;
740
+ const stickyNotes = options.layout?.stickyNotes !== void 0 || recording.notes.length > 0 ? [...options.layout?.stickyNotes ? chunkSAENRNBJ_cjs.cloneJson(options.layout.stickyNotes) : []] : void 0;
659
741
  for (const recorded of recording.notes) {
660
742
  const anchor = recorded.near !== void 0 ? nodes2.find((node) => node["id"] === recorded.near) : void 0;
661
- const anchorPosition = chunkLRM6JXJA_cjs.isRecord(anchor?.["position"]) ? anchor["position"] : { x: 0, y: 0 };
743
+ const anchorPosition = chunkSAENRNBJ_cjs.isRecord(anchor?.["position"]) ? anchor["position"] : { x: 0, y: 0 };
662
744
  const x = typeof anchorPosition["x"] === "number" ? anchorPosition["x"] : 0;
663
745
  const y = typeof anchorPosition["y"] === "number" ? anchorPosition["y"] : 0;
664
- stickyNotes?.push({ ...chunkLRM6JXJA_cjs.cloneJson(recorded.note), position: { x, y: y - 220 } });
746
+ stickyNotes?.push({ ...chunkSAENRNBJ_cjs.cloneJson(recorded.note), position: { x, y: y - 220 } });
665
747
  }
666
- const document = chunkLRM6JXJA_cjs.cloneJson(recording.document);
667
- const extraData = chunkLRM6JXJA_cjs.isRecord(document["data"]) ? document["data"] : {};
748
+ const document = chunkSAENRNBJ_cjs.cloneJson(recording.document);
749
+ const extraData = chunkSAENRNBJ_cjs.isRecord(document["data"]) ? document["data"] : {};
668
750
  for (const key of ["nodes", "edges", "stickyNotes"]) {
669
751
  if (Object.hasOwn(extraData, key))
670
- throw new chunkRRQ5HOBF_cjs.BuilderError(`extra.data.${key} is written by the builder`);
752
+ throw new chunkGVTZMA5C_cjs.BuilderError(`extra.data.${key} is written by the builder`);
671
753
  }
672
754
  delete document["data"];
673
755
  const authoring = options.authoring ?? {
674
756
  mode: "canvas",
675
757
  generator: "sdk-ts",
676
- generatorVersion: SDK_VERSION
758
+ generatorVersion: chunkFQIHX7YI_cjs.SDK_VERSION
677
759
  };
678
760
  const out = { schemaVersion: 2 };
679
761
  for (const key of ["key", "name", "description", "interface", "code"]) {
@@ -687,50 +769,32 @@ function assembleRecording(recording, options = {}) {
687
769
  ...stickyNotes !== void 0 ? { stickyNotes } : {}
688
770
  };
689
771
  for (const key of ["config"]) if (document[key] !== void 0) out[key] = document[key];
690
- if (options.pinnedData !== void 0) out["pinnedData"] = chunkLRM6JXJA_cjs.cloneJson(options.pinnedData);
772
+ if (options.pinnedData !== void 0) out["pinnedData"] = chunkSAENRNBJ_cjs.cloneJson(options.pinnedData);
691
773
  if (options.layout?.metaLayout !== void 0) {
692
- const meta = chunkLRM6JXJA_cjs.isRecord(document["meta"]) ? document["meta"] : {};
774
+ const meta = chunkSAENRNBJ_cjs.isRecord(document["meta"]) ? document["meta"] : {};
693
775
  if (meta["layout"] !== void 0)
694
- throw new chunkRRQ5HOBF_cjs.BuilderError("meta.layout comes from the layout file; do not set it in code");
695
- meta["layout"] = chunkLRM6JXJA_cjs.cloneJson(options.layout.metaLayout);
776
+ throw new chunkGVTZMA5C_cjs.BuilderError("meta.layout comes from the layout file; do not set it in code");
777
+ meta["layout"] = chunkSAENRNBJ_cjs.cloneJson(options.layout.metaLayout);
696
778
  document["meta"] = meta;
697
779
  }
698
780
  for (const [key, value] of Object.entries(document)) {
699
- if (!Object.hasOwn(out, key) && value !== void 0) out[key] = value;
781
+ if (!Object.hasOwn(out, key) && value !== void 0) chunkSAENRNBJ_cjs.setOwn(out, key, value);
700
782
  }
701
783
  return out;
702
784
  }
703
785
  function toIR(workflow, options = {}) {
704
786
  if (!isTier1Workflow(workflow))
705
- throw new chunkRRQ5HOBF_cjs.BuilderError("toIR takes the value defineWorkflow returned");
787
+ throw new chunkGVTZMA5C_cjs.BuilderError("toIR takes the value defineWorkflow returned");
706
788
  return assembleRecording(workflow.recording, options);
707
789
  }
708
790
 
709
- // src/builder/collect.ts
710
- var COLLECTION_FORMAT = "fluidgrids.tier1-collection";
711
- function collectWorkflowExports(modules) {
712
- const workflows = [];
713
- for (const [module, namespace] of modules) {
714
- for (const exportName of Object.keys(namespace).sort()) {
715
- const value = namespace[exportName];
716
- if (isTier1Workflow(value))
717
- workflows.push({ module, exportName, recording: value.recording });
718
- }
719
- }
720
- const collection = { format: COLLECTION_FORMAT, workflows };
721
- return JSON.stringify(collection);
722
- }
723
-
724
- exports.COLLECTION_FORMAT = COLLECTION_FORMAT;
725
791
  exports.LAYOUT_FORMAT = LAYOUT_FORMAT;
726
792
  exports.LAYOUT_FORMAT_VERSION = LAYOUT_FORMAT_VERSION;
727
793
  exports.RECORDING_FORMAT = RECORDING_FORMAT;
728
794
  exports.RECORDING_FORMAT_VERSION = RECORDING_FORMAT_VERSION;
729
- exports.SDK_VERSION = SDK_VERSION;
730
795
  exports.UnresolvedConnectionsError = UnresolvedConnectionsError;
731
796
  exports.WorkflowBuilder = WorkflowBuilder;
732
797
  exports.assembleRecording = assembleRecording;
733
- exports.collectWorkflowExports = collectWorkflowExports;
734
798
  exports.defaultEdgeId = defaultEdgeId;
735
799
  exports.defineWorkflow = defineWorkflow;
736
800
  exports.edge = edge;