@fluidgrids/workflows 2026.1027.1 → 2026.1028.2

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 (166) hide show
  1. package/README.md +144 -13
  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-2J6TF7YI.cjs +86 -0
  7. package/dist/chunk-4LYSEANA.js +199 -0
  8. package/dist/chunk-623FVQSN.cjs +251 -0
  9. package/dist/{chunk-W32BSO3M.js → chunk-6FSHT5IL.js} +2 -2
  10. package/dist/{chunk-E3APHA6O.cjs → chunk-7AAZGVKD.js} +1 -64
  11. package/dist/chunk-ABFZWYHT.js +612 -0
  12. package/dist/{chunk-6U446SKY.js → chunk-BD7ZPG53.js} +2 -2
  13. package/dist/chunk-BO6OVILK.js +79 -0
  14. package/dist/chunk-C5OLWZ42.js +245 -0
  15. package/dist/{chunk-OSPTJCDI.cjs → chunk-CPDK3K5N.cjs} +6 -6
  16. package/dist/chunk-DHTLALBL.cjs +80 -0
  17. package/dist/chunk-DJYMDLV5.js +227 -0
  18. package/dist/{chunk-IHKXLG6I.js → chunk-E2VK7J2C.js} +1 -1
  19. package/dist/{chunk-3M34AUIY.cjs → chunk-FEW3JBYA.cjs} +3 -3
  20. package/dist/chunk-FMSW2HDF.cjs +267 -0
  21. package/dist/chunk-FR7KYWRO.cjs +41 -0
  22. package/dist/{chunk-7YR7DI7B.cjs → chunk-GBQ33SIZ.cjs} +44 -44
  23. package/dist/{chunk-6AIAC2FP.cjs → chunk-GVTZMA5C.cjs} +4 -4
  24. package/dist/{chunk-EEAIM35V.js → chunk-HWJZVOG7.js} +64 -23
  25. package/dist/chunk-I5LR3D2K.js +869 -0
  26. package/dist/chunk-IISBRUWJ.js +13 -0
  27. package/dist/chunk-JD2VQIDZ.cjs +15 -0
  28. package/dist/{chunk-UB2BHU2M.js → chunk-JZ4TOOLN.js} +1 -1
  29. package/dist/chunk-L24YIZY7.cjs +207 -0
  30. package/dist/chunk-LNUQE6D6.js +39 -0
  31. package/dist/chunk-M4BBAERY.cjs +1635 -0
  32. package/dist/chunk-N23SKIG4.js +73 -0
  33. package/dist/{chunk-TWOYB4Y7.cjs → chunk-NEIUQASE.cjs} +13 -13
  34. package/dist/chunk-P6TA5EZT.cjs +634 -0
  35. package/dist/chunk-PMCM2OH4.js +46 -0
  36. package/dist/chunk-PZCVF76Q.cjs +868 -0
  37. package/dist/{chunk-6BEW4QD6.js → chunk-QAN5MZEM.js} +1 -1
  38. package/dist/{chunk-CSYBNN3V.cjs → chunk-QKZL3ONM.cjs} +2 -2
  39. package/dist/chunk-QQ6ULXHI.cjs +885 -0
  40. package/dist/chunk-SAENRNBJ.cjs +52 -0
  41. package/dist/{chunk-TQF7MYEN.cjs → chunk-SAOBPYYJ.cjs} +134 -96
  42. package/dist/{chunk-XBIID5DY.js → chunk-SMCANK3F.js} +5 -4
  43. package/dist/{chunk-UWQWD7BP.cjs → chunk-SX2PNKKT.cjs} +18 -17
  44. package/dist/{chunk-UJNHTS6D.js → chunk-TBDXTV22.cjs} +8 -45
  45. package/dist/chunk-UK3WM7YZ.cjs +75 -0
  46. package/dist/chunk-VOKMAAJP.js +848 -0
  47. package/dist/chunk-VRHHBPT6.js +1622 -0
  48. package/dist/{chunk-5AW745OG.js → chunk-XHXIDVEC.js} +1 -1
  49. package/dist/chunk-XKJA7KX3.js +72 -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 +152 -158
  66. package/dist/ir/index.d.cts +14 -4
  67. package/dist/ir/index.d.ts +14 -4
  68. package/dist/ir/index.js +41 -50
  69. package/dist/lower-BzmUz0sq.d.cts +129 -0
  70. package/dist/lower-_-iT4HYs.d.ts +129 -0
  71. package/dist/lower-types-DQNBfWQn.d.cts +37 -0
  72. package/dist/lower-types-DQNBfWQn.d.ts +37 -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-4MSDKWOG.cjs +22 -0
  76. package/dist/node-evaluator-SX4LEYQC.js +12 -0
  77. package/dist/quickjs/index.cjs +236 -12
  78. package/dist/quickjs/index.d.cts +46 -5
  79. package/dist/quickjs/index.d.ts +46 -5
  80. package/dist/quickjs/index.js +230 -9
  81. package/dist/roundtrip/index.cjs +333 -131
  82. package/dist/roundtrip/index.d.cts +39 -7
  83. package/dist/roundtrip/index.d.ts +39 -7
  84. package/dist/roundtrip/index.js +185 -13
  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-CrpUyd_3.d.ts → workflow-Bpr3vnA_.d.ts} +40 -160
  98. package/dist/workflow-C2a05WUJ.d.ts +444 -0
  99. package/dist/{assemble-DEf3znGD.d.cts → workflow-FXUkpIBc.d.cts} +40 -160
  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 +44 -5
  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-MBBKGD7K.js +0 -440
  162. package/dist/chunk-Y7NWR3WH.cjs +0 -450
  163. package/dist/lower-CXggJTIo.d.ts +0 -67
  164. package/dist/lower-DAzvsJCo.d.cts +0 -67
  165. package/dist/node-evaluator-CH3XCJND.cjs +0 -17
  166. package/dist/node-evaluator-TULXA3WE.js +0 -8
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ // src/ir/json-utils.ts
4
+ function isRecord(value) {
5
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6
+ }
7
+ function deepEqual(left, right) {
8
+ if (left === right) return true;
9
+ if (Array.isArray(left)) {
10
+ if (!Array.isArray(right) || left.length !== right.length) return false;
11
+ return left.every((item, index) => deepEqual(item, right[index]));
12
+ }
13
+ if (isRecord(left)) {
14
+ if (!isRecord(right)) return false;
15
+ const leftKeys = Object.keys(left).filter((key) => left[key] !== void 0);
16
+ const rightKeys = Object.keys(right).filter((key) => right[key] !== void 0);
17
+ if (leftKeys.length !== rightKeys.length) return false;
18
+ return leftKeys.every((key) => Object.hasOwn(right, key) && deepEqual(left[key], right[key]));
19
+ }
20
+ return false;
21
+ }
22
+ function setOwn(target, key, value) {
23
+ Object.defineProperty(target, key, {
24
+ value,
25
+ enumerable: true,
26
+ writable: true,
27
+ configurable: true
28
+ });
29
+ }
30
+ function ownValue(record, key) {
31
+ return Object.hasOwn(record, key) ? record[key] : void 0;
32
+ }
33
+ function cloneJson(value) {
34
+ return structuredCloneJson(value);
35
+ }
36
+ function structuredCloneJson(value) {
37
+ if (Array.isArray(value)) return value.map(structuredCloneJson);
38
+ if (isRecord(value)) {
39
+ const out = {};
40
+ for (const [key, child] of Object.entries(value)) {
41
+ if (child !== void 0) setOwn(out, key, structuredCloneJson(child));
42
+ }
43
+ return out;
44
+ }
45
+ return value;
46
+ }
47
+
48
+ exports.cloneJson = cloneJson;
49
+ exports.deepEqual = deepEqual;
50
+ exports.isRecord = isRecord;
51
+ exports.ownValue = ownValue;
52
+ exports.setOwn = setOwn;
@@ -1,8 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkG4UEPUGO_cjs = require('./chunk-G4UEPUGO.cjs');
4
- var chunk6AIAC2FP_cjs = require('./chunk-6AIAC2FP.cjs');
5
- var chunkE3APHA6O_cjs = require('./chunk-E3APHA6O.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 chunkDHTLALBL_cjs = require('./chunk-DHTLALBL.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 chunkE3APHA6O_cjs.isRecord(value) && value["__fluidgrids"] === WORKFLOW_MARKER && chunkE3APHA6O_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 = chunkE3APHA6O_cjs.ownValue(base, key);
90
- if (chunkE3APHA6O_cjs.isRecord(existing) && chunkE3APHA6O_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 chunk6AIAC2FP_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
- chunkE3APHA6O_cjs.setOwn(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 = chunk6AIAC2FP_cjs.refModelOf(value);
103
- if (model) return chunkE3APHA6O_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 chunk6AIAC2FP_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 (chunk6AIAC2FP_cjs.isPredicate(value)) {
112
- throw new chunk6AIAC2FP_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 (chunkE3APHA6O_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 chunk6AIAC2FP_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
- chunkE3APHA6O_cjs.setOwn(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 chunk6AIAC2FP_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 (!chunkE3APHA6O_cjs.isRecord(lowered)) throw new chunk6AIAC2FP_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: chunk6AIAC2FP_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 chunkE3APHA6O_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 chunkE3APHA6O_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 chunkE3APHA6O_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 chunk6AIAC2FP_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 chunk6AIAC2FP_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,13 +189,13 @@ var WorkflowBuilder = class {
187
189
  }
188
190
  autoIds;
189
191
  /** `$json`: the current item's JSON. */
190
- json = chunk6AIAC2FP_cjs.makeRef({ kind: "json" });
192
+ json = chunkGVTZMA5C_cjs.makeRef({ kind: "json" });
191
193
  /** `$vars`: workflow variables. */
192
- vars = chunk6AIAC2FP_cjs.makeRef({ kind: "vars" });
194
+ vars = chunkGVTZMA5C_cjs.makeRef({ kind: "vars" });
193
195
  /** `$now`. */
194
- now = chunk6AIAC2FP_cjs.makeRef({ kind: "now" });
196
+ now = chunkGVTZMA5C_cjs.makeRef({ kind: "now" });
195
197
  /** `$execution`: run metadata. */
196
- execution = chunk6AIAC2FP_cjs.makeRef({ kind: "execution" });
198
+ execution = chunkGVTZMA5C_cjs.makeRef({ kind: "execution" });
197
199
  nodes = [];
198
200
  edges = [];
199
201
  notes = [];
@@ -203,6 +205,7 @@ var WorkflowBuilder = class {
203
205
  /** Edges whose id is the default, as indices into `edges`, with the unsuffixed default id. */
204
206
  defaultIds = [];
205
207
  edgeOrder;
208
+ durableRefs = [];
206
209
  /** A reference to a node by id, for nodes declared later in the source. */
207
210
  ref(id) {
208
211
  return nodeRef(id);
@@ -221,9 +224,9 @@ var WorkflowBuilder = class {
221
224
  const sugar = {};
222
225
  if (condition !== void 0) {
223
226
  if (typeof condition === "string") sugar["condition"] = condition;
224
- else if (chunk6AIAC2FP_cjs.isPredicate(condition)) sugar["conditionTree"] = chunk6AIAC2FP_cjs.conditionTreeOf(condition);
227
+ else if (chunkGVTZMA5C_cjs.isPredicate(condition)) sugar["conditionTree"] = chunkGVTZMA5C_cjs.conditionTreeOf(condition);
225
228
  else
226
- throw new chunk6AIAC2FP_cjs.BuilderError(
229
+ throw new chunkGVTZMA5C_cjs.BuilderError(
227
230
  "condition takes a comparison such as x.output.total.gte(500), and(), or() or a string"
228
231
  );
229
232
  }
@@ -263,7 +266,7 @@ var WorkflowBuilder = class {
263
266
  const sugar = {};
264
267
  if (mode !== void 0) sugar["mode"] = mode;
265
268
  if (inputs !== void 0 && rest.after !== void 0) {
266
- throw new chunk6AIAC2FP_cjs.BuilderError("merge takes inputs or after, not both");
269
+ throw new chunkGVTZMA5C_cjs.BuilderError("merge takes inputs or after, not both");
267
270
  }
268
271
  const after = inputs?.map(
269
272
  (input, index) => edge(input, { targetHandle: `input-${index + 1}` })
@@ -276,10 +279,21 @@ var WorkflowBuilder = class {
276
279
  }
277
280
  /** `internal:wait-for-signal` (IR v2). */
278
281
  waitForSignal(options) {
279
- 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)}")`);
280
287
  const sugar = {};
281
288
  if (name !== void 0) sugar["signalName"] = name;
289
+ if (consume !== void 0) sugar["consume"] = consume;
282
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
+ }
283
297
  const ref = this.add(internalNodes.waitForSignal, rest, sugar);
284
298
  return { ...ref, received: ref.handle("received"), timedOut: ref.handle("timedOut") };
285
299
  }
@@ -302,6 +316,45 @@ var WorkflowBuilder = class {
302
316
  if (input !== void 0) sugar["inputMapping"] = input;
303
317
  return this.add(internalNodes.subworkflow, rest, sugar);
304
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 (chunkDHTLALBL_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
+ }
305
358
  /** `internal:validate`. */
306
359
  validate(options) {
307
360
  const ref = this.add(internalNodes.validate, options, {});
@@ -380,7 +433,7 @@ var WorkflowBuilder = class {
380
433
  }
381
434
  /** A sticky note on the canvas. */
382
435
  note(content, options) {
383
- if (typeof content !== "string") throw new chunk6AIAC2FP_cjs.BuilderError("A note takes Markdown text");
436
+ if (typeof content !== "string") throw new chunkGVTZMA5C_cjs.BuilderError("A note takes Markdown text");
384
437
  this.claimId(options.id, "sticky note");
385
438
  const near = options.near === void 0 ? void 0 : typeof options.near === "string" ? options.near : options.near.id;
386
439
  this.notes.push({
@@ -407,7 +460,7 @@ var WorkflowBuilder = class {
407
460
  * differs from the order the code declares its edges in.
408
461
  */
409
462
  edgeOrderIs(order) {
410
- if (this.edgeOrder) throw new chunk6AIAC2FP_cjs.BuilderError("edgeOrderIs() may be called once");
463
+ if (this.edgeOrder) throw new chunkGVTZMA5C_cjs.BuilderError("edgeOrderIs() may be called once");
411
464
  this.edgeOrder = [...order];
412
465
  }
413
466
  /** The recording, once the callback has returned. */
@@ -425,14 +478,14 @@ var WorkflowBuilder = class {
425
478
  };
426
479
  }
427
480
  claimId(id, what) {
428
- if (typeof id !== "string" || id === "") throw new chunk6AIAC2FP_cjs.BuilderError(`A ${what} needs an id`);
429
- if (this.ids.has(id)) throw new chunk6AIAC2FP_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}"`);
430
483
  this.ids.add(id);
431
484
  }
432
485
  resolveId(options, operation) {
433
486
  if (options.id !== void 0) return options.id;
434
487
  if (!this.autoIds) {
435
- throw new chunk6AIAC2FP_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)`);
436
489
  }
437
490
  const base = slugify(options.label ?? operation.nodeType.split(/[:/]/).pop() ?? "node");
438
491
  let candidate = base;
@@ -460,9 +513,9 @@ var WorkflowBuilder = class {
460
513
  const { source, sourceHandle } = sourceOf(spec.from);
461
514
  const explicit = typeof spec.id === "string" ? spec.id : void 0;
462
515
  if (spec.id !== void 0 && spec.id !== false && explicit === void 0)
463
- throw new chunk6AIAC2FP_cjs.BuilderError("An edge id must be a string or false");
516
+ throw new chunkGVTZMA5C_cjs.BuilderError("An edge id must be a string or false");
464
517
  if (explicit !== void 0) {
465
- if (this.edgeIds.has(explicit)) throw new chunk6AIAC2FP_cjs.BuilderError(`Duplicate edge id "${explicit}"`);
518
+ if (this.edgeIds.has(explicit)) throw new chunkGVTZMA5C_cjs.BuilderError(`Duplicate edge id "${explicit}"`);
466
519
  this.edgeIds.add(explicit);
467
520
  }
468
521
  const base = spec.id === void 0 ? defaultEdgeId(source, target, sourceHandle, spec.targetHandle) : void 0;
@@ -483,12 +536,12 @@ var WorkflowBuilder = class {
483
536
  }
484
537
  add(operation, options, sugar) {
485
538
  if (!isOperation(operation)) {
486
- throw new chunk6AIAC2FP_cjs.BuilderError(
539
+ throw new chunkGVTZMA5C_cjs.BuilderError(
487
540
  "The first argument must be a node operation (nodes.*, triggers.* or a generated client)"
488
541
  );
489
542
  }
490
543
  if (typeof options !== "object" || options === null || Array.isArray(options)) {
491
- throw new chunk6AIAC2FP_cjs.BuilderError("Node options must be an object");
544
+ throw new chunkGVTZMA5C_cjs.BuilderError("Node options must be an object");
492
545
  }
493
546
  const id = this.resolveId(options, operation);
494
547
  this.claimId(id, "node");
@@ -505,17 +558,17 @@ var WorkflowBuilder = class {
505
558
  if (explicitArgs || Object.keys(sugarArgs).length > 0) {
506
559
  for (const key of Object.keys(sugarArgs)) {
507
560
  if (explicitArgs && Object.hasOwn(explicitArgs, key)) {
508
- throw new chunk6AIAC2FP_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)`);
509
562
  }
510
563
  }
511
564
  args["state"] = { ...explicitArgs, ...sugarArgs };
512
565
  }
513
566
  if (options.connection !== void 0 && options.connections !== void 0) {
514
- throw new chunk6AIAC2FP_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`);
515
568
  }
516
569
  const connectionNames = options.connection === void 0 ? void 0 : typeof options.connection === "string" ? [options.connection] : [...options.connection];
517
570
  if (connectionNames?.some((name) => typeof name !== "string" || name === "")) {
518
- throw new chunk6AIAC2FP_cjs.BuilderError(`${where}: connection names must be non-empty strings`);
571
+ throw new chunkGVTZMA5C_cjs.BuilderError(`${where}: connection names must be non-empty strings`);
519
572
  }
520
573
  if (options.connections !== void 0)
521
574
  args["connections"] = lowerValue(options.connections, `${where} connections`);
@@ -526,7 +579,7 @@ var WorkflowBuilder = class {
526
579
  if (Object.keys(args).length > 0 || connectionNames) node["args"] = args;
527
580
  const hasSugar = options.retry !== void 0 || options.timeout !== void 0 || options.onError !== void 0;
528
581
  if (options.errorConfig !== void 0 && hasSugar) {
529
- throw new chunk6AIAC2FP_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`);
530
583
  }
531
584
  if (options.errorConfig !== void 0) {
532
585
  node["errorConfig"] = lowerObject(options.errorConfig, `${where} errorConfig`);
@@ -566,7 +619,7 @@ var WorkflowBuilder = class {
566
619
  };
567
620
  function defineWorkflow(options, build) {
568
621
  if (typeof options !== "object" || options === null || typeof options.key !== "string" || options.key === "") {
569
- throw new chunk6AIAC2FP_cjs.BuilderError("defineWorkflow needs a key");
622
+ throw new chunkGVTZMA5C_cjs.BuilderError("defineWorkflow needs a key");
570
623
  }
571
624
  const builder = new WorkflowBuilder(options.autoIds === true);
572
625
  build(builder);
@@ -582,12 +635,15 @@ function defineWorkflow(options, build) {
582
635
  if (options.extra !== void 0)
583
636
  deepMerge(document, lowerObject(options.extra, "extra"), "workflow");
584
637
  const recording = builder.finish(options.key, document);
585
- 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
+ };
586
645
  }
587
646
 
588
- // src/generated/version.ts
589
- var SDK_VERSION = "2026.1027.1";
590
-
591
647
  // src/builder/assemble.ts
592
648
  var LAYOUT_FORMAT = "fluidgrids.layout";
593
649
  var LAYOUT_FORMAT_VERSION = 1;
@@ -605,19 +661,19 @@ function resolveConnection(resolver, name) {
605
661
  return Object.hasOwn(resolver, name) ? resolver[name] : void 0;
606
662
  }
607
663
  function parseLayoutSidecar(value) {
608
- if (!chunkE3APHA6O_cjs.isRecord(value) || value["format"] !== LAYOUT_FORMAT || value["formatVersion"] !== LAYOUT_FORMAT_VERSION) {
609
- throw new chunk6AIAC2FP_cjs.BuilderError(
664
+ if (!chunkSAENRNBJ_cjs.isRecord(value) || value["format"] !== LAYOUT_FORMAT || value["formatVersion"] !== LAYOUT_FORMAT_VERSION) {
665
+ throw new chunkGVTZMA5C_cjs.BuilderError(
610
666
  `A layout file must have format "${LAYOUT_FORMAT}" and formatVersion ${LAYOUT_FORMAT_VERSION}`
611
667
  );
612
668
  }
613
669
  const positions = value["positions"];
614
- if (!chunkE3APHA6O_cjs.isRecord(positions)) throw new chunk6AIAC2FP_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");
615
671
  const parsed = {};
616
672
  for (const [id, position] of Object.entries(positions)) {
617
- if (!chunkE3APHA6O_cjs.isRecord(position) || typeof position["x"] !== "number" || typeof position["y"] !== "number") {
618
- throw new chunk6AIAC2FP_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 }`);
619
675
  }
620
- chunkE3APHA6O_cjs.setOwn(parsed, id, { x: position["x"], y: position["y"] });
676
+ chunkSAENRNBJ_cjs.setOwn(parsed, id, { x: position["x"], y: position["y"] });
621
677
  }
622
678
  const sidecar = {
623
679
  format: LAYOUT_FORMAT,
@@ -625,15 +681,15 @@ function parseLayoutSidecar(value) {
625
681
  positions: parsed
626
682
  };
627
683
  if (value["stickyNotes"] !== void 0) {
628
- if (!Array.isArray(value["stickyNotes"]) || !value["stickyNotes"].every(chunkE3APHA6O_cjs.isRecord)) {
629
- throw new chunk6AIAC2FP_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");
630
686
  }
631
- sidecar.stickyNotes = chunkE3APHA6O_cjs.cloneJson(value["stickyNotes"]);
687
+ sidecar.stickyNotes = chunkSAENRNBJ_cjs.cloneJson(value["stickyNotes"]);
632
688
  }
633
689
  if (value["metaLayout"] !== void 0) {
634
- if (!chunkE3APHA6O_cjs.isRecord(value["metaLayout"]))
635
- throw new chunk6AIAC2FP_cjs.BuilderError("metaLayout in a layout file must be an object");
636
- sidecar.metaLayout = chunkE3APHA6O_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"]);
637
693
  }
638
694
  return sidecar;
639
695
  }
@@ -648,7 +704,7 @@ function orderEdges(edges, order) {
648
704
  );
649
705
  const valid = indices.length === edges.length && new Set(indices).size === indices.length && indices.every((index) => Number.isInteger(index) && index >= 0 && index < edges.length);
650
706
  if (!valid)
651
- throw new chunk6AIAC2FP_cjs.BuilderError(
707
+ throw new chunkGVTZMA5C_cjs.BuilderError(
652
708
  "edgeOrderIs() must name every edge exactly once, by id or declaration position"
653
709
  );
654
710
  return indices.map((index) => edges[index]);
@@ -656,7 +712,7 @@ function orderEdges(edges, order) {
656
712
  function assembleRecording(recording, options = {}) {
657
713
  const missing = /* @__PURE__ */ new Set();
658
714
  const nodes2 = recording.nodes.map((recorded) => {
659
- const node = chunkE3APHA6O_cjs.cloneJson(recorded.node);
715
+ const node = chunkSAENRNBJ_cjs.cloneJson(recorded.node);
660
716
  if (recorded.connectionNames) {
661
717
  const refs = [];
662
718
  for (const name of recorded.connectionNames) {
@@ -664,14 +720,14 @@ function assembleRecording(recording, options = {}) {
664
720
  if (ref) refs.push({ connectionId: ref.connectionId, adapter: ref.adapter });
665
721
  else missing.add(name);
666
722
  }
667
- const args = chunkE3APHA6O_cjs.isRecord(node["args"]) ? node["args"] : {};
723
+ const args = chunkSAENRNBJ_cjs.isRecord(node["args"]) ? node["args"] : {};
668
724
  args["connections"] = refs;
669
725
  node["args"] = args;
670
726
  }
671
727
  return node;
672
728
  });
673
729
  if (missing.size > 0) throw new UnresolvedConnectionsError([...missing].sort());
674
- const edges = orderEdges(chunkE3APHA6O_cjs.cloneJson(recording.edges), recording.edgeOrder);
730
+ const edges = orderEdges(chunkSAENRNBJ_cjs.cloneJson(recording.edges), recording.edgeOrder);
675
731
  const ids = nodes2.map((node) => String(node["id"]));
676
732
  const positions = options.layout?.positions ?? {};
677
733
  const needsAuto = ids.some((id) => !Object.hasOwn(positions, id));
@@ -681,25 +737,25 @@ function assembleRecording(recording, options = {}) {
681
737
  const position = Object.hasOwn(positions, id) ? positions[id] : auto.get(id);
682
738
  if (position) node["position"] = { x: position.x, y: position.y };
683
739
  }
684
- const stickyNotes = options.layout?.stickyNotes !== void 0 || recording.notes.length > 0 ? [...options.layout?.stickyNotes ? chunkE3APHA6O_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;
685
741
  for (const recorded of recording.notes) {
686
742
  const anchor = recorded.near !== void 0 ? nodes2.find((node) => node["id"] === recorded.near) : void 0;
687
- const anchorPosition = chunkE3APHA6O_cjs.isRecord(anchor?.["position"]) ? anchor["position"] : { x: 0, y: 0 };
743
+ const anchorPosition = chunkSAENRNBJ_cjs.isRecord(anchor?.["position"]) ? anchor["position"] : { x: 0, y: 0 };
688
744
  const x = typeof anchorPosition["x"] === "number" ? anchorPosition["x"] : 0;
689
745
  const y = typeof anchorPosition["y"] === "number" ? anchorPosition["y"] : 0;
690
- stickyNotes?.push({ ...chunkE3APHA6O_cjs.cloneJson(recorded.note), position: { x, y: y - 220 } });
746
+ stickyNotes?.push({ ...chunkSAENRNBJ_cjs.cloneJson(recorded.note), position: { x, y: y - 220 } });
691
747
  }
692
- const document = chunkE3APHA6O_cjs.cloneJson(recording.document);
693
- const extraData = chunkE3APHA6O_cjs.isRecord(document["data"]) ? document["data"] : {};
748
+ const document = chunkSAENRNBJ_cjs.cloneJson(recording.document);
749
+ const extraData = chunkSAENRNBJ_cjs.isRecord(document["data"]) ? document["data"] : {};
694
750
  for (const key of ["nodes", "edges", "stickyNotes"]) {
695
751
  if (Object.hasOwn(extraData, key))
696
- throw new chunk6AIAC2FP_cjs.BuilderError(`extra.data.${key} is written by the builder`);
752
+ throw new chunkGVTZMA5C_cjs.BuilderError(`extra.data.${key} is written by the builder`);
697
753
  }
698
754
  delete document["data"];
699
755
  const authoring = options.authoring ?? {
700
756
  mode: "canvas",
701
757
  generator: "sdk-ts",
702
- generatorVersion: SDK_VERSION
758
+ generatorVersion: chunkDHTLALBL_cjs.SDK_VERSION
703
759
  };
704
760
  const out = { schemaVersion: 2 };
705
761
  for (const key of ["key", "name", "description", "interface", "code"]) {
@@ -713,50 +769,32 @@ function assembleRecording(recording, options = {}) {
713
769
  ...stickyNotes !== void 0 ? { stickyNotes } : {}
714
770
  };
715
771
  for (const key of ["config"]) if (document[key] !== void 0) out[key] = document[key];
716
- if (options.pinnedData !== void 0) out["pinnedData"] = chunkE3APHA6O_cjs.cloneJson(options.pinnedData);
772
+ if (options.pinnedData !== void 0) out["pinnedData"] = chunkSAENRNBJ_cjs.cloneJson(options.pinnedData);
717
773
  if (options.layout?.metaLayout !== void 0) {
718
- const meta = chunkE3APHA6O_cjs.isRecord(document["meta"]) ? document["meta"] : {};
774
+ const meta = chunkSAENRNBJ_cjs.isRecord(document["meta"]) ? document["meta"] : {};
719
775
  if (meta["layout"] !== void 0)
720
- throw new chunk6AIAC2FP_cjs.BuilderError("meta.layout comes from the layout file; do not set it in code");
721
- meta["layout"] = chunkE3APHA6O_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);
722
778
  document["meta"] = meta;
723
779
  }
724
780
  for (const [key, value] of Object.entries(document)) {
725
- if (!Object.hasOwn(out, key) && value !== void 0) chunkE3APHA6O_cjs.setOwn(out, key, value);
781
+ if (!Object.hasOwn(out, key) && value !== void 0) chunkSAENRNBJ_cjs.setOwn(out, key, value);
726
782
  }
727
783
  return out;
728
784
  }
729
785
  function toIR(workflow, options = {}) {
730
786
  if (!isTier1Workflow(workflow))
731
- throw new chunk6AIAC2FP_cjs.BuilderError("toIR takes the value defineWorkflow returned");
787
+ throw new chunkGVTZMA5C_cjs.BuilderError("toIR takes the value defineWorkflow returned");
732
788
  return assembleRecording(workflow.recording, options);
733
789
  }
734
790
 
735
- // src/builder/collect.ts
736
- var COLLECTION_FORMAT = "fluidgrids.tier1-collection";
737
- function collectWorkflowExports(modules) {
738
- const workflows = [];
739
- for (const [module, namespace] of modules) {
740
- for (const exportName of Object.keys(namespace).sort()) {
741
- const value = namespace[exportName];
742
- if (isTier1Workflow(value))
743
- workflows.push({ module, exportName, recording: value.recording });
744
- }
745
- }
746
- const collection = { format: COLLECTION_FORMAT, workflows };
747
- return JSON.stringify(collection);
748
- }
749
-
750
- exports.COLLECTION_FORMAT = COLLECTION_FORMAT;
751
791
  exports.LAYOUT_FORMAT = LAYOUT_FORMAT;
752
792
  exports.LAYOUT_FORMAT_VERSION = LAYOUT_FORMAT_VERSION;
753
793
  exports.RECORDING_FORMAT = RECORDING_FORMAT;
754
794
  exports.RECORDING_FORMAT_VERSION = RECORDING_FORMAT_VERSION;
755
- exports.SDK_VERSION = SDK_VERSION;
756
795
  exports.UnresolvedConnectionsError = UnresolvedConnectionsError;
757
796
  exports.WorkflowBuilder = WorkflowBuilder;
758
797
  exports.assembleRecording = assembleRecording;
759
- exports.collectWorkflowExports = collectWorkflowExports;
760
798
  exports.defaultEdgeId = defaultEdgeId;
761
799
  exports.defineWorkflow = defineWorkflow;
762
800
  exports.edge = edge;
@@ -1,7 +1,8 @@
1
- import { compareVersions, operationsOf, isTriggerOperation } from './chunk-6BEW4QD6.js';
2
- import { RESERVED_REF_KEYS } from './chunk-UB2BHU2M.js';
3
- import { sha256Tagged, canonicalJson } from './chunk-IHKXLG6I.js';
4
- import { isJsIdentifier, isRecord } from './chunk-UJNHTS6D.js';
1
+ import { compareVersions, operationsOf, isTriggerOperation } from './chunk-QAN5MZEM.js';
2
+ import { RESERVED_REF_KEYS } from './chunk-JZ4TOOLN.js';
3
+ import { sha256Tagged, canonicalJson } from './chunk-E2VK7J2C.js';
4
+ import { isJsIdentifier } from './chunk-7AAZGVKD.js';
5
+ import { isRecord } from './chunk-PMCM2OH4.js';
5
6
  import { format } from 'prettier/standalone';
6
7
  import * as prettierPluginEstree from 'prettier/plugins/estree';
7
8
  import * as prettierPluginTypescript from 'prettier/plugins/typescript';