@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
@@ -1,16 +1,24 @@
1
1
  'use strict';
2
2
 
3
- var chunkTWOYB4Y7_cjs = require('../chunk-TWOYB4Y7.cjs');
4
- var chunkUWQWD7BP_cjs = require('../chunk-UWQWD7BP.cjs');
5
- var chunkOSPTJCDI_cjs = require('../chunk-OSPTJCDI.cjs');
6
- var chunk3M34AUIY_cjs = require('../chunk-3M34AUIY.cjs');
7
- var chunkY7NWR3WH_cjs = require('../chunk-Y7NWR3WH.cjs');
8
- var chunkTQF7MYEN_cjs = require('../chunk-TQF7MYEN.cjs');
9
- var chunk7YR7DI7B_cjs = require('../chunk-7YR7DI7B.cjs');
3
+ var chunkFEW3JBYA_cjs = require('../chunk-FEW3JBYA.cjs');
4
+ var chunkNEIUQASE_cjs = require('../chunk-NEIUQASE.cjs');
5
+ var chunkSX2PNKKT_cjs = require('../chunk-SX2PNKKT.cjs');
6
+ var chunkCPDK3K5N_cjs = require('../chunk-CPDK3K5N.cjs');
7
+ var chunkQQ6ULXHI_cjs = require('../chunk-QQ6ULXHI.cjs');
8
+ require('../chunk-UK3WM7YZ.cjs');
9
+ var chunkSAOBPYYJ_cjs = require('../chunk-SAOBPYYJ.cjs');
10
+ var chunkGBQ33SIZ_cjs = require('../chunk-GBQ33SIZ.cjs');
10
11
  require('../chunk-G4UEPUGO.cjs');
11
- var chunk6AIAC2FP_cjs = require('../chunk-6AIAC2FP.cjs');
12
- var chunkCSYBNN3V_cjs = require('../chunk-CSYBNN3V.cjs');
13
- var chunkE3APHA6O_cjs = require('../chunk-E3APHA6O.cjs');
12
+ var chunkGVTZMA5C_cjs = require('../chunk-GVTZMA5C.cjs');
13
+ var chunkQKZL3ONM_cjs = require('../chunk-QKZL3ONM.cjs');
14
+ var chunkTBDXTV22_cjs = require('../chunk-TBDXTV22.cjs');
15
+ var chunkSAENRNBJ_cjs = require('../chunk-SAENRNBJ.cjs');
16
+ require('../chunk-DHTLALBL.cjs');
17
+ require('../chunk-2J6TF7YI.cjs');
18
+ require('../chunk-Z2Y65YOY.cjs');
19
+ var fs = require('fs');
20
+ var path = require('path');
21
+ var zlib = require('zlib');
14
22
 
15
23
  // src/roundtrip/plan.ts
16
24
  var TYPED_HANDLES = {
@@ -79,14 +87,14 @@ var LiftError = class extends Error {
79
87
  }
80
88
  };
81
89
  var RULE_METHOD_BY_OPERATOR = new Map(
82
- Object.entries(chunk6AIAC2FP_cjs.PREDICATE_OPERATORS).map(([method, spec]) => [
90
+ Object.entries(chunkGVTZMA5C_cjs.PREDICATE_OPERATORS).map(([method, spec]) => [
83
91
  spec.operator,
84
92
  { method, unary: spec.unary }
85
93
  ])
86
94
  );
87
95
  function literalOrStructure(value2) {
88
96
  if (Array.isArray(value2)) return { k: "array", items: value2.map(literalOrStructure) };
89
- if (chunkE3APHA6O_cjs.isRecord(value2))
97
+ if (chunkSAENRNBJ_cjs.isRecord(value2))
90
98
  return {
91
99
  k: "object",
92
100
  entries: Object.entries(value2).map(([key, child]) => [key, literalOrStructure(child)])
@@ -98,7 +106,7 @@ function literalOrStructure(value2) {
98
106
  }
99
107
  function expressible(ref) {
100
108
  return ref.path.every(
101
- (segment) => segment.kind === "index" || !chunk6AIAC2FP_cjs.RESERVED_REF_KEYS.has(segment.key)
109
+ (segment) => segment.kind === "index" || !chunkGVTZMA5C_cjs.RESERVED_REF_KEYS.has(segment.key)
102
110
  );
103
111
  }
104
112
  function toPlanRef(ref) {
@@ -107,7 +115,7 @@ function toPlanRef(ref) {
107
115
  }
108
116
  function liftValue(value2, path, nodeId, items) {
109
117
  if (typeof value2 === "string") {
110
- const parts = chunkE3APHA6O_cjs.parseTemplate(value2);
118
+ const parts = chunkTBDXTV22_cjs.parseTemplate(value2);
111
119
  if (parts && parts.every((part) => part.kind === "text" || expressible(part.ref))) {
112
120
  const [only] = parts;
113
121
  if (parts.length === 1 && only?.kind === "ref") return { k: "ref", ref: toPlanRef(only.ref) };
@@ -136,7 +144,7 @@ function liftValue(value2, path, nodeId, items) {
136
144
  k: "array",
137
145
  items: value2.map((item, index) => liftValue(item, `${path}[${index}]`, nodeId, items))
138
146
  };
139
- if (chunkE3APHA6O_cjs.isRecord(value2)) {
147
+ if (chunkSAENRNBJ_cjs.isRecord(value2)) {
140
148
  return {
141
149
  k: "object",
142
150
  entries: Object.entries(value2).map(([key, child]) => [
@@ -185,7 +193,7 @@ function liftRule(rule, nodeIds) {
185
193
  if (typeof rule["field"] !== "string" || typeof rule["operator"] !== "string" || rule["operator"] === "")
186
194
  return void 0;
187
195
  const ref = fieldRef(rule["field"], nodeIds);
188
- if (!ref || !ref.path.every((segment) => segment.kind === "index" || !chunk6AIAC2FP_cjs.RESERVED_REF_KEYS.has(segment.key))) {
196
+ if (!ref || !ref.path.every((segment) => segment.kind === "index" || !chunkGVTZMA5C_cjs.RESERVED_REF_KEYS.has(segment.key))) {
189
197
  return void 0;
190
198
  }
191
199
  const hasValue = Object.hasOwn(rule, "value");
@@ -204,7 +212,7 @@ function liftRule(rule, nodeIds) {
204
212
  };
205
213
  }
206
214
  function liftCondition(tree, nodeIds, top) {
207
- if (!chunkE3APHA6O_cjs.isRecord(tree)) return void 0;
215
+ if (!chunkSAENRNBJ_cjs.isRecord(tree)) return void 0;
208
216
  if (tree["type"] === "rule") return top ? void 0 : liftRule(tree, nodeIds);
209
217
  if (tree["type"] !== "group") return void 0;
210
218
  const keys = Object.keys(tree).sort();
@@ -245,7 +253,7 @@ function richEdge(edge2, info, items) {
245
253
  const options2 = [];
246
254
  const extra = [];
247
255
  if (edge2["id"] === void 0) options2.push(["id", { k: "literal", value: false }]);
248
- else if (edge2["id"] !== chunkTQF7MYEN_cjs.defaultEdgeId(source, target, sourceHandle, targetHandle))
256
+ else if (edge2["id"] !== chunkSAOBPYYJ_cjs.defaultEdgeId(source, target, sourceHandle, targetHandle))
249
257
  options2.push(["id", literalOrStructure(edge2["id"])]);
250
258
  if (edge2["type"] === void 0) options2.push(["type", { k: "literal", value: false }]);
251
259
  else if (edge2["type"] !== "deletable") options2.push(["type", literalOrStructure(edge2["type"])]);
@@ -259,7 +267,7 @@ function richEdge(edge2, info, items) {
259
267
  }
260
268
  if (key === "label" && typeof value2 === "string")
261
269
  options2.push(["label", { k: "literal", value: value2 }]);
262
- else if ((key === "data" || key === "mapping") && chunkE3APHA6O_cjs.isRecord(value2)) {
270
+ else if ((key === "data" || key === "mapping") && chunkSAENRNBJ_cjs.isRecord(value2)) {
263
271
  options2.push([key, literalOrStructure(value2)]);
264
272
  if (key === "mapping") {
265
273
  items.push({
@@ -312,10 +320,10 @@ function chooseOperation(node, hasIncoming, clients, manifests, items) {
312
320
  const manifest = manifests?.find(
313
321
  (candidate) => candidate.nodeType === type && candidate.nodeVersion === client?.version
314
322
  );
315
- const operation = operationName && manifest ? chunkOSPTJCDI_cjs.operationsOf(manifest).find((candidate) => candidate.name === operationName) : void 0;
323
+ const operation = operationName && manifest ? chunkCPDK3K5N_cjs.operationsOf(manifest).find((candidate) => candidate.name === operationName) : void 0;
316
324
  const operationKey = operationName ? client?.operations.get(operationName) : void 0;
317
325
  if (client && operation && operationKey) {
318
- const isTrigger = chunkOSPTJCDI_cjs.isTriggerOperation(operation);
326
+ const isTrigger = chunkCPDK3K5N_cjs.isTriggerOperation(operation);
319
327
  return {
320
328
  method: isTrigger && !hasIncoming ? "trigger" : "step",
321
329
  operation: {
@@ -352,7 +360,7 @@ function chooseOperation(node, hasIncoming, clients, manifests, items) {
352
360
  }
353
361
  var ERROR_CONFIG_KEYS = /* @__PURE__ */ new Set(["onError", "errorBranchId", "retryConfig", "timeout"]);
354
362
  function errorConfigOptions(errorConfig) {
355
- if (!chunkE3APHA6O_cjs.isRecord(errorConfig) || Object.keys(errorConfig).length === 0) return void 0;
363
+ if (!chunkSAENRNBJ_cjs.isRecord(errorConfig) || Object.keys(errorConfig).length === 0) return void 0;
356
364
  if (!Object.keys(errorConfig).every((key) => ERROR_CONFIG_KEYS.has(key))) return void 0;
357
365
  const options2 = [];
358
366
  const onError = errorConfig["onError"];
@@ -370,11 +378,11 @@ function errorConfigOptions(errorConfig) {
370
378
  else if (onError !== void 0) return void 0;
371
379
  }
372
380
  if (errorConfig["retryConfig"] !== void 0) {
373
- if (!chunkE3APHA6O_cjs.isRecord(errorConfig["retryConfig"])) return void 0;
381
+ if (!chunkSAENRNBJ_cjs.isRecord(errorConfig["retryConfig"])) return void 0;
374
382
  options2.push(["retry", literalOrStructure(errorConfig["retryConfig"])]);
375
383
  }
376
384
  if (errorConfig["timeout"] !== void 0) {
377
- if (!chunkE3APHA6O_cjs.isRecord(errorConfig["timeout"])) return void 0;
385
+ if (!chunkSAENRNBJ_cjs.isRecord(errorConfig["timeout"])) return void 0;
378
386
  options2.push(["timeout", literalOrStructure(errorConfig["timeout"])]);
379
387
  }
380
388
  return options2;
@@ -393,7 +401,7 @@ function connectionOptions(value2, names, nodeId, items) {
393
401
  if (Array.isArray(value2) && value2.length > 0 && names) {
394
402
  const ambiguous = ambiguousConnectionNames(names);
395
403
  const resolved = value2.map((ref) => {
396
- if (!chunkE3APHA6O_cjs.isRecord(ref) || Object.keys(ref).sort().join(",") !== "adapter,connectionId")
404
+ if (!chunkSAENRNBJ_cjs.isRecord(ref) || Object.keys(ref).sort().join(",") !== "adapter,connectionId")
397
405
  return void 0;
398
406
  const id = ref["connectionId"];
399
407
  return typeof id === "string" && Object.hasOwn(names, id) ? names[id] : void 0;
@@ -457,12 +465,12 @@ function richNode(node, choice, incoming, nodeIds, options2, items) {
457
465
  extra.push(["version", literalOrStructure(version)]);
458
466
  }
459
467
  }
460
- const args = chunkE3APHA6O_cjs.isRecord(node["args"]) ? node["args"] : void 0;
468
+ const args = chunkSAENRNBJ_cjs.isRecord(node["args"]) ? node["args"] : void 0;
461
469
  if (node["args"] !== void 0 && !args) extra.push(["args", literalOrStructure(node["args"])]);
462
470
  if (args) {
463
471
  const argsExtra = [];
464
472
  let state = args["state"];
465
- if (choice.method === "if" && chunkE3APHA6O_cjs.isRecord(state) && state["conditionTree"] !== void 0) {
473
+ if (choice.method === "if" && chunkSAENRNBJ_cjs.isRecord(state) && state["conditionTree"] !== void 0) {
466
474
  const condition = liftCondition(state["conditionTree"], nodeIds, true);
467
475
  if (condition) {
468
476
  out.push(["condition", condition]);
@@ -472,7 +480,7 @@ function richNode(node, choice, incoming, nodeIds, options2, items) {
472
480
  }
473
481
  }
474
482
  if (state !== void 0) {
475
- if (chunkE3APHA6O_cjs.isRecord(state)) out.push(["args", liftState(String(node["type"]), state, id, items)]);
483
+ if (chunkSAENRNBJ_cjs.isRecord(state)) out.push(["args", liftState(String(node["type"]), state, id, items)]);
476
484
  else argsExtra.push(["state", literalOrStructure(state)]);
477
485
  }
478
486
  for (const [key, value2] of Object.entries(args)) {
@@ -487,7 +495,7 @@ function richNode(node, choice, incoming, nodeIds, options2, items) {
487
495
  kind: "legacy-syntax",
488
496
  detail: "Legacy credential references kept verbatim"
489
497
  });
490
- } else if (key === "context" && chunkE3APHA6O_cjs.isRecord(value2))
498
+ } else if (key === "context" && chunkSAENRNBJ_cjs.isRecord(value2))
491
499
  out.push(["context", literalOrStructure(value2)]);
492
500
  else argsExtra.push([key, literalOrStructure(value2)]);
493
501
  }
@@ -500,12 +508,12 @@ function richNode(node, choice, incoming, nodeIds, options2, items) {
500
508
  if (sugar) out.push(...sugar);
501
509
  else out.push(["errorConfig", literalOrStructure(node["errorConfig"])]);
502
510
  }
503
- const data = chunkE3APHA6O_cjs.isRecord(node["data"]) ? { ...node["data"] } : void 0;
511
+ const data = chunkSAENRNBJ_cjs.isRecord(node["data"]) ? { ...node["data"] } : void 0;
504
512
  if (node["executionSettings"] !== void 0) {
505
513
  const settings = node["executionSettings"];
506
- if (chunkE3APHA6O_cjs.isRecord(settings)) {
507
- const mirror = chunkE3APHA6O_cjs.isRecord(data?.["executionSettings"]) ? data["executionSettings"] : void 0;
508
- const mirrored = settings["runOn"] !== void 0 && mirror !== void 0 && Object.keys(mirror).length === 1 && chunkE3APHA6O_cjs.deepEqual(mirror["runOn"], settings["runOn"]);
514
+ if (chunkSAENRNBJ_cjs.isRecord(settings)) {
515
+ const mirror = chunkSAENRNBJ_cjs.isRecord(data?.["executionSettings"]) ? data["executionSettings"] : void 0;
516
+ const mirrored = settings["runOn"] !== void 0 && mirror !== void 0 && Object.keys(mirror).length === 1 && chunkSAENRNBJ_cjs.deepEqual(mirror["runOn"], settings["runOn"]);
509
517
  if (settings["runOn"] === void 0 || mirrored) {
510
518
  out.push(["executionSettings", literalOrStructure(settings)]);
511
519
  if (mirrored && data) delete data["executionSettings"];
@@ -526,9 +534,9 @@ function richNode(node, choice, incoming, nodeIds, options2, items) {
526
534
  else extra.push(["disabled", literalOrStructure(node["disabled"])]);
527
535
  }
528
536
  if (data && Object.keys(data).length > 0) extra.push(["data", literalOrStructure(data)]);
529
- else if (node["data"] !== void 0 && !chunkE3APHA6O_cjs.isRecord(node["data"]))
537
+ else if (node["data"] !== void 0 && !chunkSAENRNBJ_cjs.isRecord(node["data"]))
530
538
  extra.push(["data", literalOrStructure(node["data"])]);
531
- else if (chunkE3APHA6O_cjs.isRecord(node["data"]) && Object.keys(node["data"]).length === 0)
539
+ else if (chunkSAENRNBJ_cjs.isRecord(node["data"]) && Object.keys(node["data"]).length === 0)
532
540
  extra.push(["data", { k: "object", entries: [] }]);
533
541
  for (const [key, value2] of Object.entries(node)) {
534
542
  if ([
@@ -593,17 +601,17 @@ function workflowOptions(definition, key) {
593
601
  for (const option of WORKFLOW_OPTION_KEYS) {
594
602
  const value2 = definition[option];
595
603
  if (value2 === void 0) continue;
596
- if (option === "meta" && chunkE3APHA6O_cjs.isRecord(value2)) {
604
+ if (option === "meta" && chunkSAENRNBJ_cjs.isRecord(value2)) {
597
605
  const meta = { ...value2 };
598
606
  delete meta["layout"];
599
607
  if (Object.keys(meta).length > 0) out.push(["meta", literalOrStructure(meta)]);
600
608
  continue;
601
609
  }
602
- const typed = (option === "name" || option === "description") && typeof value2 === "string" || option === "tags" && Array.isArray(value2) || ["config", "interface", "code"].includes(option) && chunkE3APHA6O_cjs.isRecord(value2);
610
+ const typed = (option === "name" || option === "description") && typeof value2 === "string" || option === "tags" && Array.isArray(value2) || ["config", "interface", "code"].includes(option) && chunkSAENRNBJ_cjs.isRecord(value2);
603
611
  if (typed) out.push([option, literalOrStructure(value2)]);
604
612
  else extra.push([option, literalOrStructure(value2)]);
605
613
  }
606
- const data = chunkE3APHA6O_cjs.isRecord(definition["data"]) ? definition["data"] : {};
614
+ const data = chunkSAENRNBJ_cjs.isRecord(definition["data"]) ? definition["data"] : {};
607
615
  const dataExtra = Object.entries(data).filter(
608
616
  ([dataKey]) => !["nodes", "edges", "stickyNotes"].includes(dataKey)
609
617
  );
@@ -624,14 +632,14 @@ function workflowOptions(definition, key) {
624
632
  }
625
633
  function buildPlan(normalized, options2, rawNodeIds = /* @__PURE__ */ new Set(), rawEdgeIndices = /* @__PURE__ */ new Set()) {
626
634
  const items = [];
627
- const data = chunkE3APHA6O_cjs.isRecord(normalized["data"]) ? normalized["data"] : {};
635
+ const data = chunkSAENRNBJ_cjs.isRecord(normalized["data"]) ? normalized["data"] : {};
628
636
  const nodes2 = Array.isArray(data["nodes"]) ? data["nodes"] : [];
629
637
  const edges = Array.isArray(data["edges"]) ? data["edges"] : [];
630
638
  const key = typeof normalized["key"] === "string" && normalized["key"] ? normalized["key"] : options2.workflowKey;
631
639
  if (!key) throw new LiftError("The definition has no key; pass workflowKey");
632
640
  const nodeIds = /* @__PURE__ */ new Set();
633
641
  for (const node of nodes2) {
634
- if (!chunkE3APHA6O_cjs.isRecord(node) || typeof node["id"] !== "string" || node["id"] === "" || typeof node["type"] !== "string") {
642
+ if (!chunkSAENRNBJ_cjs.isRecord(node) || typeof node["id"] !== "string" || node["id"] === "" || typeof node["type"] !== "string") {
635
643
  throw new LiftError("Every node needs a string id and type to be lifted");
636
644
  }
637
645
  if (nodeIds.has(node["id"])) throw new LiftError(`Node id "${node["id"]}" is used twice`);
@@ -639,7 +647,7 @@ function buildPlan(normalized, options2, rawNodeIds = /* @__PURE__ */ new Set(),
639
647
  }
640
648
  const edgeIds = /* @__PURE__ */ new Set();
641
649
  for (const edge2 of edges) {
642
- if (!chunkE3APHA6O_cjs.isRecord(edge2) || typeof edge2["source"] !== "string" || typeof edge2["target"] !== "string") {
650
+ if (!chunkSAENRNBJ_cjs.isRecord(edge2) || typeof edge2["source"] !== "string" || typeof edge2["target"] !== "string") {
643
651
  throw new LiftError("Every edge needs a string source and target to be lifted");
644
652
  }
645
653
  if (edge2["id"] === void 0) continue;
@@ -647,9 +655,9 @@ function buildPlan(normalized, options2, rawNodeIds = /* @__PURE__ */ new Set(),
647
655
  if (edgeIds.has(edge2["id"])) throw new LiftError(`Edge id "${edge2["id"]}" is used twice`);
648
656
  edgeIds.add(edge2["id"]);
649
657
  }
650
- const nodeRecords = nodes2.filter(chunkE3APHA6O_cjs.isRecord);
651
- const edgeRecords = edges.filter(chunkE3APHA6O_cjs.isRecord);
652
- const clients = options2.registry ? chunkUWQWD7BP_cjs.clientNames(options2.registry) : /* @__PURE__ */ new Map();
658
+ const nodeRecords = nodes2.filter(chunkSAENRNBJ_cjs.isRecord);
659
+ const edgeRecords = edges.filter(chunkSAENRNBJ_cjs.isRecord);
660
+ const clients = options2.registry ? chunkSX2PNKKT_cjs.clientNames(options2.registry) : /* @__PURE__ */ new Map();
653
661
  const edgeIndex = /* @__PURE__ */ new Map();
654
662
  edgeRecords.forEach((edge2, index) => edgeIndex.set(edge2, index));
655
663
  const incomingByTarget = /* @__PURE__ */ new Map();
@@ -723,11 +731,11 @@ function buildPlan(normalized, options2, rawNodeIds = /* @__PURE__ */ new Set(),
723
731
  function connectionsByName(connectionNames, definition) {
724
732
  const out = {};
725
733
  const ambiguous = ambiguousConnectionNames(connectionNames);
726
- const data = chunkE3APHA6O_cjs.isRecord(definition["data"]) ? definition["data"] : {};
734
+ const data = chunkSAENRNBJ_cjs.isRecord(definition["data"]) ? definition["data"] : {};
727
735
  for (const node of Array.isArray(data["nodes"]) ? data["nodes"] : []) {
728
- const args = chunkE3APHA6O_cjs.isRecord(node) && chunkE3APHA6O_cjs.isRecord(node["args"]) ? node["args"] : void 0;
736
+ const args = chunkSAENRNBJ_cjs.isRecord(node) && chunkSAENRNBJ_cjs.isRecord(node["args"]) ? node["args"] : void 0;
729
737
  for (const ref of Array.isArray(args?.["connections"]) ? args["connections"] : []) {
730
- if (!chunkE3APHA6O_cjs.isRecord(ref) || typeof ref["connectionId"] !== "string" || typeof ref["adapter"] !== "string")
738
+ if (!chunkSAENRNBJ_cjs.isRecord(ref) || typeof ref["connectionId"] !== "string" || typeof ref["adapter"] !== "string")
731
739
  continue;
732
740
  const id = ref["connectionId"];
733
741
  const name = Object.hasOwn(connectionNames, id) ? connectionNames[id] : void 0;
@@ -736,7 +744,7 @@ function connectionsByName(connectionNames, definition) {
736
744
  if (previous && previous.adapter !== ref["adapter"]) {
737
745
  ambiguous.add(name);
738
746
  delete out[name];
739
- } else chunkE3APHA6O_cjs.setOwn(out, name, { connectionId: id, adapter: ref["adapter"] });
747
+ } else chunkSAENRNBJ_cjs.setOwn(out, name, { connectionId: id, adapter: ref["adapter"] });
740
748
  }
741
749
  }
742
750
  return out;
@@ -746,19 +754,19 @@ function connectionsByName(connectionNames, definition) {
746
754
  function descriptor(operation) {
747
755
  switch (operation.kind) {
748
756
  case "trigger": {
749
- const value2 = chunkTQF7MYEN_cjs.triggers[operation.name];
757
+ const value2 = chunkSAOBPYYJ_cjs.triggers[operation.name];
750
758
  if (!value2) throw new LiftError(`Unknown trigger ${operation.name}`);
751
759
  return value2;
752
760
  }
753
761
  case "internal": {
754
- const value2 = chunkTQF7MYEN_cjs.internalNodes[operation.name];
762
+ const value2 = chunkSAOBPYYJ_cjs.internalNodes[operation.name];
755
763
  if (!value2) throw new LiftError(`Unknown internal node ${operation.name}`);
756
764
  return value2;
757
765
  }
758
766
  case "client":
759
- return operation.role === "trigger" ? chunkTQF7MYEN_cjs.trigger(operation.nodeType, operation.version, operation.operation) : chunkTQF7MYEN_cjs.op(operation.nodeType, operation.version, operation.operation);
767
+ return operation.role === "trigger" ? chunkSAOBPYYJ_cjs.trigger(operation.nodeType, operation.version, operation.operation) : chunkSAOBPYYJ_cjs.op(operation.nodeType, operation.version, operation.operation);
760
768
  case "custom":
761
- return chunkTQF7MYEN_cjs.nodes.custom(operation.nodeType, operation.operation, operation.version);
769
+ return chunkSAOBPYYJ_cjs.nodes.custom(operation.nodeType, operation.operation, operation.version);
762
770
  }
763
771
  }
764
772
  function refValue(ref, wf, runtime) {
@@ -793,7 +801,7 @@ function value(expression2, wf, runtime) {
793
801
  strings.push("");
794
802
  }
795
803
  }
796
- return chunk6AIAC2FP_cjs.expr(Object.assign([...strings], { raw: [...strings] }), ...values);
804
+ return chunkGVTZMA5C_cjs.expr(Object.assign([...strings], { raw: [...strings] }), ...values);
797
805
  }
798
806
  case "rule": {
799
807
  const target = refValue(expression2.ref, wf, runtime);
@@ -805,7 +813,7 @@ function value(expression2, wf, runtime) {
805
813
  }
806
814
  case "group": {
807
815
  const children = expression2.children.map((child) => value(child, wf, runtime));
808
- return expression2.combinator === "and" ? chunk6AIAC2FP_cjs.and(...children) : chunk6AIAC2FP_cjs.or(...children);
816
+ return expression2.combinator === "and" ? chunkGVTZMA5C_cjs.and(...children) : chunkGVTZMA5C_cjs.or(...children);
809
817
  }
810
818
  case "node":
811
819
  return runtime.get(expression2.nodeId) ?? wf.ref(expression2.nodeId);
@@ -816,7 +824,7 @@ function value(expression2, wf, runtime) {
816
824
  return (declared ?? wf.ref(expression2.nodeId)).handle(expression2.handle);
817
825
  }
818
826
  case "edge":
819
- return chunkTQF7MYEN_cjs.edge(
827
+ return chunkSAOBPYYJ_cjs.edge(
820
828
  value(expression2.from, wf, runtime),
821
829
  value({ k: "object", entries: expression2.options }, wf, runtime)
822
830
  );
@@ -844,7 +852,7 @@ function interpretPlan(plan) {
844
852
  k: "object",
845
853
  entries: plan.workflowOptions
846
854
  });
847
- const workflow = chunkTQF7MYEN_cjs.defineWorkflow(workflowOptions2, (wf) => {
855
+ const workflow = chunkSAOBPYYJ_cjs.defineWorkflow(workflowOptions2, (wf) => {
848
856
  const runtime = /* @__PURE__ */ new Map();
849
857
  for (const statement of plan.statements) {
850
858
  if (statement.kind === "node") {
@@ -913,7 +921,7 @@ var BUILDER_METHODS = {
913
921
  };
914
922
  var atom = (text) => ({ t: "atom", text });
915
923
  function isPyIdentifier(name) {
916
- return /^[A-Za-z][A-Za-z0-9_]*$/.test(name) && !chunkUWQWD7BP_cjs.PY_KEYWORDS.has(name);
924
+ return /^[A-Za-z][A-Za-z0-9_]*$/.test(name) && !chunkSX2PNKKT_cjs.PY_KEYWORDS.has(name);
917
925
  }
918
926
  function nodeSource(nodeId, ctx) {
919
927
  const name = ctx.vars.get(nodeId);
@@ -921,7 +929,7 @@ function nodeSource(nodeId, ctx) {
921
929
  return {
922
930
  t: "call",
923
931
  func: atom("wf.ref"),
924
- args: [{ kind: "positional", value: atom(chunkUWQWD7BP_cjs.pyString(nodeId)) }]
932
+ args: [{ kind: "positional", value: atom(chunkSX2PNKKT_cjs.pyString(nodeId)) }]
925
933
  };
926
934
  }
927
935
  function refExpr(ref, ctx) {
@@ -931,21 +939,21 @@ function refExpr(ref, ctx) {
931
939
  current = { t: "subscript", base: current, indices: [atom(String(segment.index))] };
932
940
  else if (isPyIdentifier(segment.key) && !PY_REF_METHODS.has(segment.key))
933
941
  current = { t: "attr", base: current, name: segment.key };
934
- else current = { t: "subscript", base: current, indices: [atom(chunkUWQWD7BP_cjs.pyString(segment.key))] };
942
+ else current = { t: "subscript", base: current, indices: [atom(chunkSX2PNKKT_cjs.pyString(segment.key))] };
935
943
  }
936
944
  return current;
937
945
  }
938
946
  function literal(value2) {
939
947
  if (value2 === null) return atom("None");
940
948
  if (typeof value2 === "boolean") return atom(value2 ? "True" : "False");
941
- if (typeof value2 === "number") return atom(chunkUWQWD7BP_cjs.pyNumber(value2));
942
- return atom(chunkUWQWD7BP_cjs.pyString(value2));
949
+ if (typeof value2 === "number") return atom(chunkSX2PNKKT_cjs.pyNumber(value2));
950
+ return atom(chunkSX2PNKKT_cjs.pyString(value2));
943
951
  }
944
952
  function call(func, args) {
945
953
  return { t: "call", func: atom(func), args };
946
954
  }
947
955
  function keywordName(option) {
948
- return chunkUWQWD7BP_cjs.snakeCase(option);
956
+ return chunkSX2PNKKT_cjs.snakeCase(option);
949
957
  }
950
958
  function expression(planExpr, ctx) {
951
959
  switch (planExpr.k) {
@@ -955,7 +963,7 @@ function expression(planExpr, ctx) {
955
963
  return {
956
964
  t: "dict",
957
965
  entries: planExpr.entries.map(([key, child]) => [
958
- atom(chunkUWQWD7BP_cjs.pyString(key)),
966
+ atom(chunkSX2PNKKT_cjs.pyString(key)),
959
967
  expression(child, ctx)
960
968
  ])
961
969
  };
@@ -969,7 +977,7 @@ function expression(planExpr, ctx) {
969
977
  "expr",
970
978
  planExpr.parts.map((part) => ({
971
979
  kind: "positional",
972
- value: "text" in part ? atom(chunkUWQWD7BP_cjs.pyString(part.text)) : refExpr(part.ref, ctx)
980
+ value: "text" in part ? atom(chunkSX2PNKKT_cjs.pyString(part.text)) : refExpr(part.ref, ctx)
973
981
  }))
974
982
  );
975
983
  case "rule": {
@@ -983,10 +991,10 @@ function expression(planExpr, ctx) {
983
991
  right: literal(planExpr.value ?? null)
984
992
  };
985
993
  }
986
- const method = planExpr.method === "is" ? "is_" : chunkUWQWD7BP_cjs.snakeCase(planExpr.method);
994
+ const method = planExpr.method === "is" ? "is_" : chunkSX2PNKKT_cjs.snakeCase(planExpr.method);
987
995
  const args = [];
988
996
  if (planExpr.method === "is")
989
- args.push({ kind: "positional", value: atom(chunkUWQWD7BP_cjs.pyString(planExpr.operator)) });
997
+ args.push({ kind: "positional", value: atom(chunkSX2PNKKT_cjs.pyString(planExpr.operator)) });
990
998
  if (planExpr.hasValue)
991
999
  args.push({ kind: "positional", value: literal(planExpr.value ?? null) });
992
1000
  return { t: "call", func: { t: "attr", base: target, name: method }, args };
@@ -1005,12 +1013,12 @@ function expression(planExpr, ctx) {
1005
1013
  const source = nodeSource(planExpr.nodeId, ctx);
1006
1014
  const declared = ctx.declared.has(planExpr.nodeId) && ctx.vars.has(planExpr.nodeId);
1007
1015
  if (declared && planExpr.accessor.kind === "property")
1008
- return { t: "attr", base: source, name: chunkUWQWD7BP_cjs.snakeCase(planExpr.accessor.name) };
1016
+ return { t: "attr", base: source, name: chunkSX2PNKKT_cjs.snakeCase(planExpr.accessor.name) };
1009
1017
  const method = declared && planExpr.accessor.kind === "case" ? "case" : "handle";
1010
1018
  return {
1011
1019
  t: "call",
1012
1020
  func: { t: "attr", base: source, name: method },
1013
- args: [{ kind: "positional", value: atom(chunkUWQWD7BP_cjs.pyString(planExpr.handle)) }]
1021
+ args: [{ kind: "positional", value: atom(chunkSX2PNKKT_cjs.pyString(planExpr.handle)) }]
1014
1022
  };
1015
1023
  }
1016
1024
  case "edge":
@@ -1032,21 +1040,21 @@ function operationExpr(operation, ctx, clientPy) {
1032
1040
  switch (operation.kind) {
1033
1041
  case "trigger":
1034
1042
  ctx.used.add("triggers");
1035
- return atom(`triggers.${chunkUWQWD7BP_cjs.snakeCase(operation.name)}`);
1043
+ return atom(`triggers.${chunkSX2PNKKT_cjs.snakeCase(operation.name)}`);
1036
1044
  case "internal":
1037
1045
  ctx.used.add("nodes");
1038
- return atom(`nodes.internal.${chunkUWQWD7BP_cjs.snakeCase(operation.name)}`);
1046
+ return atom(`nodes.internal.${chunkSX2PNKKT_cjs.snakeCase(operation.name)}`);
1039
1047
  case "client":
1040
1048
  ctx.used.add("n");
1041
1049
  return atom(clientPy(operation.nodeType, operation.operation));
1042
1050
  case "custom": {
1043
1051
  ctx.used.add("nodes");
1044
- const args = [{ kind: "positional", value: atom(chunkUWQWD7BP_cjs.pyString(operation.nodeType)) }];
1052
+ const args = [{ kind: "positional", value: atom(chunkSX2PNKKT_cjs.pyString(operation.nodeType)) }];
1045
1053
  if (operation.operation !== void 0)
1046
- args.push({ kind: "positional", value: atom(chunkUWQWD7BP_cjs.pyString(operation.operation)) });
1054
+ args.push({ kind: "positional", value: atom(chunkSX2PNKKT_cjs.pyString(operation.operation)) });
1047
1055
  if (operation.version !== void 0) {
1048
1056
  args.push(
1049
- operation.operation !== void 0 ? { kind: "positional", value: atom(chunkUWQWD7BP_cjs.pyString(operation.version)) } : { kind: "keyword", name: "version", value: atom(chunkUWQWD7BP_cjs.pyString(operation.version)) }
1057
+ operation.operation !== void 0 ? { kind: "positional", value: atom(chunkSX2PNKKT_cjs.pyString(operation.version)) } : { kind: "keyword", name: "version", value: atom(chunkSX2PNKKT_cjs.pyString(operation.version)) }
1050
1058
  );
1051
1059
  }
1052
1060
  return call("nodes.custom", args);
@@ -1055,7 +1063,7 @@ function operationExpr(operation, ctx, clientPy) {
1055
1063
  }
1056
1064
  function statementLines(statement, ctx, clientPy) {
1057
1065
  if (statement.kind === "edgeOrder") {
1058
- return chunkUWQWD7BP_cjs.formatLines(
1066
+ return chunkSX2PNKKT_cjs.formatLines(
1059
1067
  "",
1060
1068
  call("wf.edge_order_is", [
1061
1069
  { kind: "positional", value: { t: "list", items: statement.ids.map((id) => literal(id)) } }
@@ -1067,28 +1075,28 @@ function statementLines(statement, ctx, clientPy) {
1067
1075
  if (statement.kind === "connect") {
1068
1076
  const args2 = [
1069
1077
  { kind: "positional", value: expression(statement.from, ctx) },
1070
- { kind: "positional", value: atom(chunkUWQWD7BP_cjs.pyString(statement.to)) },
1078
+ { kind: "positional", value: atom(chunkSX2PNKKT_cjs.pyString(statement.to)) },
1071
1079
  ...keywords(statement.options, ctx)
1072
1080
  ];
1073
- return chunkUWQWD7BP_cjs.formatLines("", call("wf.connect", args2), "", 1);
1081
+ return chunkSX2PNKKT_cjs.formatLines("", call("wf.connect", args2), "", 1);
1074
1082
  }
1075
1083
  const args = [
1076
1084
  ...statement.operation ? [{ kind: "positional", value: operationExpr(statement.operation, ctx, clientPy) }] : [],
1077
1085
  ...keywords(statement.options, ctx)
1078
1086
  ];
1079
- const method = BUILDER_METHODS[statement.method] ?? chunkUWQWD7BP_cjs.snakeCase(statement.method);
1087
+ const method = BUILDER_METHODS[statement.method] ?? chunkSX2PNKKT_cjs.snakeCase(statement.method);
1080
1088
  const callExpr = call(`wf.${method}`, args);
1081
1089
  ctx.declared.add(statement.nodeId);
1082
1090
  const name = ctx.vars.get(statement.nodeId);
1083
- return chunkUWQWD7BP_cjs.formatLines(name !== void 0 ? `${name} = ` : "", callExpr, "", 1);
1091
+ return chunkSX2PNKKT_cjs.formatLines(name !== void 0 ? `${name} = ` : "", callExpr, "", 1);
1084
1092
  }
1085
1093
  function renderPython(plan, clientPy, header = []) {
1086
- const allocator = new chunkUWQWD7BP_cjs.NameAllocator("py");
1094
+ const allocator = new chunkSX2PNKKT_cjs.NameAllocator("py");
1087
1095
  const vars = /* @__PURE__ */ new Map();
1088
- for (const nodeId of chunkUWQWD7BP_cjs.referencedLater(plan)) vars.set(nodeId, allocator.forNode(nodeId));
1096
+ for (const nodeId of chunkSX2PNKKT_cjs.referencedLater(plan)) vars.set(nodeId, allocator.forNode(nodeId));
1089
1097
  const ctx = { vars, declared: /* @__PURE__ */ new Set(), used: /* @__PURE__ */ new Set() };
1090
1098
  const body = plan.statements.flatMap((statement) => statementLines(statement, ctx, clientPy));
1091
- const decorator = chunkUWQWD7BP_cjs.formatLines(
1099
+ const decorator = chunkSX2PNKKT_cjs.formatLines(
1092
1100
  "@",
1093
1101
  call("define_workflow", keywords(plan.workflowOptions, ctx)),
1094
1102
  "",
@@ -1100,12 +1108,12 @@ function renderPython(plan, clientPy, header = []) {
1100
1108
  const lines = [
1101
1109
  ...header.map((line) => `# ${line}`),
1102
1110
  ...header.length > 0 ? [""] : [],
1103
- ...chunkUWQWD7BP_cjs.formatImport(PY_SDK_MODULE, sdkNames),
1104
- ...ctx.used.has("n") ? chunkUWQWD7BP_cjs.formatImport(PY_PROJECT_MODULE, ["nodes as n"]) : [],
1111
+ ...chunkSX2PNKKT_cjs.formatImport(PY_SDK_MODULE, sdkNames),
1112
+ ...ctx.used.has("n") ? chunkSX2PNKKT_cjs.formatImport(PY_PROJECT_MODULE, ["nodes as n"]) : [],
1105
1113
  "",
1106
1114
  "",
1107
1115
  ...decorator,
1108
- `def ${chunkUWQWD7BP_cjs.pyWorkflowName(plan.key)}(wf):`,
1116
+ `def ${chunkSX2PNKKT_cjs.pyWorkflowName(plan.key)}(wf):`,
1109
1117
  ...body.length > 0 ? body : [" pass"],
1110
1118
  ""
1111
1119
  ];
@@ -1114,64 +1122,64 @@ function renderPython(plan, clientPy, header = []) {
1114
1122
 
1115
1123
  // src/roundtrip/lift.ts
1116
1124
  function layoutOf(reference) {
1117
- const data = chunkE3APHA6O_cjs.isRecord(reference["data"]) ? reference["data"] : {};
1125
+ const data = chunkSAENRNBJ_cjs.isRecord(reference["data"]) ? reference["data"] : {};
1118
1126
  const positions = {};
1119
1127
  for (const node of Array.isArray(data["nodes"]) ? data["nodes"] : []) {
1120
- if (!chunkE3APHA6O_cjs.isRecord(node) || typeof node["id"] !== "string" || !chunkE3APHA6O_cjs.isRecord(node["position"])) continue;
1128
+ if (!chunkSAENRNBJ_cjs.isRecord(node) || typeof node["id"] !== "string" || !chunkSAENRNBJ_cjs.isRecord(node["position"])) continue;
1121
1129
  const { x, y } = node["position"];
1122
- if (typeof x === "number" && typeof y === "number") chunkE3APHA6O_cjs.setOwn(positions, node["id"], { x, y });
1130
+ if (typeof x === "number" && typeof y === "number") chunkSAENRNBJ_cjs.setOwn(positions, node["id"], { x, y });
1123
1131
  }
1124
1132
  const sidecar = {
1125
- format: chunkTQF7MYEN_cjs.LAYOUT_FORMAT,
1126
- formatVersion: chunkTQF7MYEN_cjs.LAYOUT_FORMAT_VERSION,
1133
+ format: chunkSAOBPYYJ_cjs.LAYOUT_FORMAT,
1134
+ formatVersion: chunkSAOBPYYJ_cjs.LAYOUT_FORMAT_VERSION,
1127
1135
  positions
1128
1136
  };
1129
1137
  if (Array.isArray(data["stickyNotes"])) sidecar.stickyNotes = data["stickyNotes"];
1130
- const meta = chunkE3APHA6O_cjs.isRecord(reference["meta"]) ? reference["meta"] : void 0;
1131
- if (chunkE3APHA6O_cjs.isRecord(meta?.["layout"])) sidecar.metaLayout = meta["layout"];
1138
+ const meta = chunkSAENRNBJ_cjs.isRecord(reference["meta"]) ? reference["meta"] : void 0;
1139
+ if (chunkSAENRNBJ_cjs.isRecord(meta?.["layout"])) sidecar.metaLayout = meta["layout"];
1132
1140
  return sidecar;
1133
1141
  }
1134
1142
  function mismatches(reference, candidate) {
1135
- const refData = chunkE3APHA6O_cjs.isRecord(reference["data"]) ? reference["data"] : {};
1136
- const candData = chunkE3APHA6O_cjs.isRecord(candidate["data"]) ? candidate["data"] : {};
1143
+ const refData = chunkSAENRNBJ_cjs.isRecord(reference["data"]) ? reference["data"] : {};
1144
+ const candData = chunkSAENRNBJ_cjs.isRecord(candidate["data"]) ? candidate["data"] : {};
1137
1145
  const byId = (items) => new Map(
1138
- (Array.isArray(items) ? items : []).filter(chunkE3APHA6O_cjs.isRecord).map((item) => [String(item["id"]), item])
1146
+ (Array.isArray(items) ? items : []).filter(chunkSAENRNBJ_cjs.isRecord).map((item) => [String(item["id"]), item])
1139
1147
  );
1140
1148
  const nodes2 = /* @__PURE__ */ new Set();
1141
1149
  const candNodes = byId(candData["nodes"]);
1142
1150
  for (const [id, node] of byId(refData["nodes"]))
1143
- if (!chunkE3APHA6O_cjs.deepEqual(node, candNodes.get(id))) nodes2.add(id);
1151
+ if (!chunkSAENRNBJ_cjs.deepEqual(node, candNodes.get(id))) nodes2.add(id);
1144
1152
  const edges = /* @__PURE__ */ new Set();
1145
1153
  const refEdges = Array.isArray(refData["edges"]) ? refData["edges"] : [];
1146
1154
  const candEdges = Array.isArray(candData["edges"]) ? candData["edges"] : [];
1147
1155
  refEdges.forEach((edge2, index) => {
1148
- if (!chunkE3APHA6O_cjs.deepEqual(edge2, candEdges[index])) edges.add(index);
1156
+ if (!chunkSAENRNBJ_cjs.deepEqual(edge2, candEdges[index])) edges.add(index);
1149
1157
  });
1150
1158
  const strip = (doc) => {
1151
1159
  const copy = { ...doc };
1152
1160
  delete copy["authoring"];
1153
- const data = chunkE3APHA6O_cjs.isRecord(copy["data"]) ? { ...copy["data"] } : {};
1161
+ const data = chunkSAENRNBJ_cjs.isRecord(copy["data"]) ? { ...copy["data"] } : {};
1154
1162
  delete data["nodes"];
1155
1163
  delete data["edges"];
1156
1164
  copy["data"] = data;
1157
1165
  return copy;
1158
1166
  };
1159
- return { nodes: nodes2, edges, document: !chunkE3APHA6O_cjs.deepEqual(strip(reference), strip(candidate)) };
1167
+ return { nodes: nodes2, edges, document: !chunkSAENRNBJ_cjs.deepEqual(strip(reference), strip(candidate)) };
1160
1168
  }
1161
1169
  function tryRun(attempt) {
1162
1170
  try {
1163
1171
  return attempt();
1164
1172
  } catch (error) {
1165
- if (error instanceof chunk6AIAC2FP_cjs.BuilderError) return void 0;
1173
+ if (error instanceof chunkGVTZMA5C_cjs.BuilderError) return void 0;
1166
1174
  throw error;
1167
1175
  }
1168
1176
  }
1169
1177
  function rejectedByBuilder(reference, run) {
1170
1178
  const nodes2 = /* @__PURE__ */ new Set();
1171
1179
  const edges = /* @__PURE__ */ new Set();
1172
- const data = chunkE3APHA6O_cjs.isRecord(reference["data"]) ? reference["data"] : {};
1180
+ const data = chunkSAENRNBJ_cjs.isRecord(reference["data"]) ? reference["data"] : {};
1173
1181
  const nodeIds = (Array.isArray(data["nodes"]) ? data["nodes"] : []).flatMap(
1174
- (node) => chunkE3APHA6O_cjs.isRecord(node) && typeof node["id"] === "string" ? [node["id"]] : []
1182
+ (node) => chunkSAENRNBJ_cjs.isRecord(node) && typeof node["id"] === "string" ? [node["id"]] : []
1175
1183
  );
1176
1184
  const edgeCount = Array.isArray(data["edges"]) ? data["edges"].length : 0;
1177
1185
  const edgeIndices = Array.from({ length: edgeCount }, (_, index) => index);
@@ -1190,8 +1198,8 @@ function rejectedByBuilder(reference, run) {
1190
1198
  return { nodes: nodes2, edges };
1191
1199
  }
1192
1200
  function prepareLift(definition, options2 = {}) {
1193
- const normalized = chunk7YR7DI7B_cjs.normalizeDefinition(definition);
1194
- if (!chunkE3APHA6O_cjs.isRecord(normalized) || !chunkE3APHA6O_cjs.isRecord(normalized["data"]))
1201
+ const normalized = chunkGBQ33SIZ_cjs.normalizeDefinition(definition);
1202
+ if (!chunkSAENRNBJ_cjs.isRecord(normalized) || !chunkSAENRNBJ_cjs.isRecord(normalized["data"]))
1195
1203
  throw new TypeError("A workflow definition must be an object with data");
1196
1204
  const reference = { ...normalized };
1197
1205
  const items = [];
@@ -1211,7 +1219,7 @@ function prepareLift(definition, options2 = {}) {
1211
1219
  kind: "layout-omitted",
1212
1220
  detail: "Node positions, sticky notes and meta.layout are not exported"
1213
1221
  });
1214
- const pinned = chunkE3APHA6O_cjs.isRecord(reference["pinnedData"]) ? (
1222
+ const pinned = chunkSAENRNBJ_cjs.isRecord(reference["pinnedData"]) ? (
1215
1223
  // Checked to be a record; carried verbatim.
1216
1224
  reference["pinnedData"]
1217
1225
  ) : void 0;
@@ -1221,12 +1229,12 @@ function prepareLift(definition, options2 = {}) {
1221
1229
  const run = (rawNodes, rawEdges) => {
1222
1230
  const build = buildPlan(reference, options2, rawNodes, rawEdges);
1223
1231
  const recording = interpretPlan(build.plan);
1224
- const candidate = chunkTQF7MYEN_cjs.assembleRecording(recording, {
1232
+ const candidate = chunkSAOBPYYJ_cjs.assembleRecording(recording, {
1225
1233
  layout,
1226
1234
  ...connections ? { connections } : {},
1227
1235
  ...pinned ? { pinnedData: pinned } : {}
1228
1236
  });
1229
- return { build, candidate: chunk7YR7DI7B_cjs.normalizeDefinition(candidate) };
1237
+ return { build, candidate: chunkGBQ33SIZ_cjs.normalizeDefinition(candidate) };
1230
1238
  };
1231
1239
  let rejected = { nodes: /* @__PURE__ */ new Set(), edges: /* @__PURE__ */ new Set() };
1232
1240
  let attempt = tryRun(() => run(rejected.nodes, rejected.edges));
@@ -1297,27 +1305,27 @@ function sidecarFiles(prepared) {
1297
1305
  files.push({
1298
1306
  path: `workflows/${key}.layout.json`,
1299
1307
  contentType: "application/json",
1300
- content: chunkCSYBNN3V_cjs.stableStringify(prepared.layout)
1308
+ content: chunkQKZL3ONM_cjs.stableStringify(prepared.layout)
1301
1309
  });
1302
1310
  }
1303
1311
  if (prepared.pinnedData) {
1304
1312
  files.push({
1305
1313
  path: `workflows/${key}.pinned.json`,
1306
1314
  contentType: "application/json",
1307
- content: chunkCSYBNN3V_cjs.stableStringify(prepared.pinnedData)
1315
+ content: chunkQKZL3ONM_cjs.stableStringify(prepared.pinnedData)
1308
1316
  });
1309
1317
  }
1310
1318
  return files;
1311
1319
  }
1312
1320
  async function liftToTypeScript(definition, options2 = {}) {
1313
1321
  const prepared = prepareLift(definition, options2);
1314
- const source = await chunkUWQWD7BP_cjs.renderTypeScript(prepared.plan, headerLines(options2.header));
1322
+ const source = await chunkSX2PNKKT_cjs.renderTypeScript(prepared.plan, headerLines(options2.header));
1315
1323
  const files = [
1316
1324
  { path: `workflows/${prepared.plan.key}.ts`, contentType: "text/typescript", content: source },
1317
1325
  ...sidecarFiles(prepared)
1318
1326
  ];
1319
1327
  if (prepared.usesClients) {
1320
- const clients = await chunkUWQWD7BP_cjs.generateNodeClients(prepared.registry, "ts");
1328
+ const clients = await chunkSX2PNKKT_cjs.generateNodeClients(prepared.registry, "ts");
1321
1329
  files.push({ path: clients.path, contentType: "text/typescript", content: clients.content });
1322
1330
  }
1323
1331
  return { files, items: prepared.items, reference: prepared.reference };
@@ -1327,18 +1335,183 @@ async function liftToPython(definition, options2 = {}) {
1327
1335
  const source = renderPython(prepared.plan, prepared.clientPy, headerLines(options2.header));
1328
1336
  const files = [
1329
1337
  {
1330
- path: `workflows/${chunkUWQWD7BP_cjs.pyWorkflowName(prepared.plan.key)}.py`,
1338
+ path: `workflows/${chunkSX2PNKKT_cjs.pyWorkflowName(prepared.plan.key)}.py`,
1331
1339
  contentType: "text/x-python",
1332
1340
  content: source
1333
1341
  },
1334
1342
  ...sidecarFiles(prepared)
1335
1343
  ];
1336
1344
  if (prepared.usesClients) {
1337
- const clients = await chunkUWQWD7BP_cjs.generateNodeClients(prepared.registry, "py");
1345
+ const clients = await chunkSX2PNKKT_cjs.generateNodeClients(prepared.registry, "py");
1338
1346
  files.push({ path: clients.path, contentType: "text/x-python", content: clients.content });
1339
1347
  }
1340
1348
  return { files, items: prepared.items, reference: prepared.reference };
1341
1349
  }
1350
+ var SDK_PACKAGE = "@fluidgrids/workflows";
1351
+ var KEPT_EXTENSIONS = [".js", ".mjs", ".json"];
1352
+ var NATIVE_MARKERS = [".node", "binding.gyp"];
1353
+ var SKIPPED_DIRECTORIES = /* @__PURE__ */ new Set(["node_modules", ".git", "test", "tests", "__tests__"]);
1354
+ var DEFAULT_MAX_BYTES = 32 * 1024 * 1024;
1355
+ function readJson(path) {
1356
+ let parsed;
1357
+ try {
1358
+ parsed = JSON.parse(fs.readFileSync(path, "utf8"));
1359
+ } catch (error) {
1360
+ throw new chunkQQ6ULXHI_cjs.LowerError(
1361
+ `Cannot read ${path}: ${error instanceof Error ? error.message : String(error)}`
1362
+ );
1363
+ }
1364
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
1365
+ throw new chunkQQ6ULXHI_cjs.LowerError(`${path} is not a JSON object`);
1366
+ return parsed;
1367
+ }
1368
+ function namesOf(value2) {
1369
+ if (typeof value2 !== "object" || value2 === null || Array.isArray(value2)) return [];
1370
+ return Object.keys(value2);
1371
+ }
1372
+ function locate(name, fromDir) {
1373
+ let dir = fromDir;
1374
+ for (; ; ) {
1375
+ const candidate = path.join(dir, "node_modules", ...name.split("/"));
1376
+ if (fs.existsSync(path.join(candidate, "package.json"))) return candidate;
1377
+ const parent = path.dirname(dir);
1378
+ if (parent === dir) return void 0;
1379
+ dir = parent;
1380
+ }
1381
+ }
1382
+ function collectFiles(packageDir, dir, files, budget) {
1383
+ for (const entry of fs.readdirSync(dir).sort()) {
1384
+ const full = path.join(dir, entry);
1385
+ const stats = fs.statSync(full);
1386
+ if (stats.isDirectory()) {
1387
+ if (!SKIPPED_DIRECTORIES.has(entry)) collectFiles(packageDir, full, files, budget);
1388
+ continue;
1389
+ }
1390
+ const path$1 = path.relative(packageDir, full).split(path.sep).join("/");
1391
+ if (NATIVE_MARKERS.some((marker) => entry.endsWith(marker))) {
1392
+ files[path$1] = "";
1393
+ continue;
1394
+ }
1395
+ if (!KEPT_EXTENSIONS.some((ext) => entry.endsWith(ext))) continue;
1396
+ budget.left -= stats.size;
1397
+ if (budget.left < 0)
1398
+ throw new chunkQQ6ULXHI_cjs.LowerError(
1399
+ `The vendored packages are larger than the limit (reached at "${budget.name}")`,
1400
+ "too-large"
1401
+ );
1402
+ files[path$1] = fs.readFileSync(full, "utf8");
1403
+ }
1404
+ }
1405
+ function vendorDependencies(projectDir, options2 = {}) {
1406
+ const rootDir = path.resolve(projectDir);
1407
+ const manifest = readJson(path.join(rootDir, "package.json"));
1408
+ const wanted = options2.packages ?? namesOf(manifest["dependencies"]);
1409
+ const budget = { left: options2.maxBytes ?? DEFAULT_MAX_BYTES, name: "" };
1410
+ const out = {};
1411
+ const queue = wanted.filter((name) => name !== SDK_PACKAGE).map((name) => ({ name, fromDir: rootDir, optional: false }));
1412
+ while (queue.length > 0) {
1413
+ const next = queue.shift();
1414
+ if (!next || Object.hasOwn(out, next.name) || next.name === SDK_PACKAGE) continue;
1415
+ const packageDir = locate(next.name, next.fromDir);
1416
+ if (packageDir === void 0) {
1417
+ if (next.optional) continue;
1418
+ throw new chunkQQ6ULXHI_cjs.LowerError(
1419
+ `"${next.name}" is a dependency but is not installed under ${rootDir}; run your package manager's install first`
1420
+ );
1421
+ }
1422
+ const pkgJson = readJson(path.join(packageDir, "package.json"));
1423
+ const files = {};
1424
+ budget.name = next.name;
1425
+ collectFiles(packageDir, packageDir, files, budget);
1426
+ out[next.name] = {
1427
+ version: typeof pkgJson["version"] === "string" ? pkgJson["version"] : "0.0.0",
1428
+ files
1429
+ };
1430
+ for (const dependency of namesOf(pkgJson["dependencies"]))
1431
+ queue.push({ name: dependency, fromDir: packageDir, optional: false });
1432
+ for (const peer of namesOf(pkgJson["peerDependencies"]))
1433
+ queue.push({ name: peer, fromDir: packageDir, optional: true });
1434
+ }
1435
+ const sorted = {};
1436
+ for (const name of Object.keys(out).sort()) {
1437
+ const pkg = out[name];
1438
+ if (pkg) sorted[name] = pkg;
1439
+ }
1440
+ return sorted;
1441
+ }
1442
+ var SOURCE_ARCHIVE_MAX_BYTES = 64 * 1024 * 1024;
1443
+ var GZIP_OS_BYTE = 9;
1444
+ function packSources(archive) {
1445
+ const value2 = { files: archive.files };
1446
+ if (archive.lock !== void 0) value2["lock"] = archive.lock;
1447
+ if (archive.vendored !== void 0 && Object.keys(archive.vendored).length > 0)
1448
+ value2["vendored"] = archive.vendored;
1449
+ const text = chunkQKZL3ONM_cjs.canonicalJson(value2);
1450
+ const zipped = zlib.gzipSync(Buffer.from(text, "utf8"), { level: 9 });
1451
+ zipped[GZIP_OS_BYTE] = 255;
1452
+ return new Uint8Array(zipped.buffer, zipped.byteOffset, zipped.byteLength);
1453
+ }
1454
+ function stringMap(value2, what) {
1455
+ if (!chunkSAENRNBJ_cjs.isRecord(value2)) throw new chunkQQ6ULXHI_cjs.LowerError(`${what} must be an object`);
1456
+ const out = {};
1457
+ for (const [key, entry] of Object.entries(value2)) {
1458
+ if (typeof entry !== "string") throw new chunkQQ6ULXHI_cjs.LowerError(`${what}["${key}"] must be a string`);
1459
+ Object.defineProperty(out, key, {
1460
+ value: entry,
1461
+ enumerable: true,
1462
+ writable: true,
1463
+ configurable: true
1464
+ });
1465
+ }
1466
+ return out;
1467
+ }
1468
+ function unpackSources(data, options2 = {}) {
1469
+ const maxBytes = options2.maxBytes ?? SOURCE_ARCHIVE_MAX_BYTES;
1470
+ let text;
1471
+ try {
1472
+ text = zlib.gunzipSync(data, { maxOutputLength: maxBytes }).toString("utf8");
1473
+ } catch (error) {
1474
+ const message = error instanceof Error ? error.message : String(error);
1475
+ throw new chunkQQ6ULXHI_cjs.LowerError(
1476
+ /buffer|length|range/i.test(message) ? `The source archive is larger than ${maxBytes} bytes uncompressed` : `The source archive is not gzip: ${message}`,
1477
+ /buffer|length|range/i.test(message) ? "too-large" : void 0
1478
+ );
1479
+ }
1480
+ let parsed;
1481
+ try {
1482
+ parsed = JSON.parse(text);
1483
+ } catch {
1484
+ throw new chunkQQ6ULXHI_cjs.LowerError("The source archive is not JSON");
1485
+ }
1486
+ if (!chunkSAENRNBJ_cjs.isRecord(parsed)) throw new chunkQQ6ULXHI_cjs.LowerError("The source archive is not an object");
1487
+ const archive = { files: stringMap(parsed["files"], "files") };
1488
+ if (parsed["lock"] !== void 0) {
1489
+ if (typeof parsed["lock"] !== "string") throw new chunkQQ6ULXHI_cjs.LowerError("lock must be a string");
1490
+ archive.lock = parsed["lock"];
1491
+ }
1492
+ if (parsed["vendored"] !== void 0) {
1493
+ if (!chunkSAENRNBJ_cjs.isRecord(parsed["vendored"])) throw new chunkQQ6ULXHI_cjs.LowerError("vendored must be an object");
1494
+ const vendored = {};
1495
+ for (const [name, pkg] of Object.entries(parsed["vendored"])) {
1496
+ if (!chunkSAENRNBJ_cjs.isRecord(pkg) || typeof pkg["version"] !== "string")
1497
+ throw new chunkQQ6ULXHI_cjs.LowerError(`vendored["${name}"] needs a version`);
1498
+ Object.defineProperty(vendored, name, {
1499
+ value: {
1500
+ version: pkg["version"],
1501
+ files: stringMap(pkg["files"], `vendored["${name}"].files`)
1502
+ },
1503
+ enumerable: true,
1504
+ writable: true,
1505
+ configurable: true
1506
+ });
1507
+ }
1508
+ archive.vendored = vendored;
1509
+ }
1510
+ return archive;
1511
+ }
1512
+ function archiveDeps(archive) {
1513
+ return archive.vendored ?? {};
1514
+ }
1342
1515
 
1343
1516
  // src/roundtrip/fidelity.ts
1344
1517
  var LOSSY_KINDS = /* @__PURE__ */ new Set([
@@ -1349,9 +1522,9 @@ var LOSSY_KINDS = /* @__PURE__ */ new Set([
1349
1522
  ]);
1350
1523
  async function checkFidelity(files, reference, items, options2 = {}) {
1351
1524
  const all = [...items];
1352
- const connections = options2.connectionNames && chunkE3APHA6O_cjs.isRecord(reference) ? connectionsByName(options2.connectionNames, reference) : void 0;
1525
+ const connections = options2.connectionNames && chunkSAENRNBJ_cjs.isRecord(reference) ? connectionsByName(options2.connectionNames, reference) : void 0;
1353
1526
  try {
1354
- const result = await chunkY7NWR3WH_cjs.lower(
1527
+ const result = await chunkQQ6ULXHI_cjs.lower(
1355
1528
  files.map((file) => ({ path: file.path, content: file.content })),
1356
1529
  {
1357
1530
  ...options2.esbuild ? { esbuild: options2.esbuild } : {},
@@ -1365,8 +1538,8 @@ async function checkFidelity(files, reference, items, options2 = {}) {
1365
1538
  kind: "lowering-failed",
1366
1539
  detail: `Lowering produced ${result.workflows.length} workflows instead of one`
1367
1540
  });
1368
- } else if (chunk7YR7DI7B_cjs.irHash(lowered) !== chunk7YR7DI7B_cjs.irHash(reference)) {
1369
- for (const change of chunkTWOYB4Y7_cjs.diffDefinitions(reference, lowered)) {
1541
+ } else if (chunkGBQ33SIZ_cjs.irHash(lowered) !== chunkGBQ33SIZ_cjs.irHash(reference)) {
1542
+ for (const change of chunkNEIUQASE_cjs.diffDefinitions(reference, lowered)) {
1370
1543
  all.push({
1371
1544
  path: change.path,
1372
1545
  kind: "roundtrip-mismatch",
@@ -1391,58 +1564,87 @@ async function exportWorkflowCode(definition, options2) {
1391
1564
  ...options2.connectionNames ? { connectionNames: options2.connectionNames } : {}
1392
1565
  });
1393
1566
  const files = options2.format === "PYTHON" ? (await liftToPython(definition, options2)).files : ts.files;
1394
- return { format: options2.format, files, fidelity, irHash: chunk7YR7DI7B_cjs.irHash(definition) };
1567
+ return { format: options2.format, files, fidelity, irHash: chunkGBQ33SIZ_cjs.irHash(definition) };
1395
1568
  }
1396
1569
 
1570
+ Object.defineProperty(exports, "createNodeVmEvaluator", {
1571
+ enumerable: true,
1572
+ get: function () { return chunkFEW3JBYA_cjs.createNodeVmEvaluator; }
1573
+ });
1397
1574
  Object.defineProperty(exports, "PY_LINE_LENGTH", {
1398
1575
  enumerable: true,
1399
- get: function () { return chunkUWQWD7BP_cjs.PY_LINE_LENGTH; }
1576
+ get: function () { return chunkSX2PNKKT_cjs.PY_LINE_LENGTH; }
1400
1577
  });
1401
1578
  Object.defineProperty(exports, "TS_FORMAT_OPTIONS", {
1402
1579
  enumerable: true,
1403
- get: function () { return chunkUWQWD7BP_cjs.TS_FORMAT_OPTIONS; }
1580
+ get: function () { return chunkSX2PNKKT_cjs.TS_FORMAT_OPTIONS; }
1404
1581
  });
1405
1582
  Object.defineProperty(exports, "TS_NODES_IMPORT", {
1406
1583
  enumerable: true,
1407
- get: function () { return chunkUWQWD7BP_cjs.TS_NODES_IMPORT; }
1408
- });
1409
- Object.defineProperty(exports, "createNodeVmEvaluator", {
1410
- enumerable: true,
1411
- get: function () { return chunk3M34AUIY_cjs.createNodeVmEvaluator; }
1584
+ get: function () { return chunkSX2PNKKT_cjs.TS_NODES_IMPORT; }
1412
1585
  });
1413
1586
  Object.defineProperty(exports, "DeterminismViolationError", {
1414
1587
  enumerable: true,
1415
- get: function () { return chunkY7NWR3WH_cjs.DeterminismViolationError; }
1588
+ get: function () { return chunkQQ6ULXHI_cjs.DeterminismViolationError; }
1416
1589
  });
1417
1590
  Object.defineProperty(exports, "ESBUILD_VERSION", {
1418
1591
  enumerable: true,
1419
- get: function () { return chunkY7NWR3WH_cjs.ESBUILD_VERSION; }
1592
+ get: function () { return chunkQQ6ULXHI_cjs.ESBUILD_VERSION; }
1420
1593
  });
1421
1594
  Object.defineProperty(exports, "EVALUATION_GLOBAL", {
1422
1595
  enumerable: true,
1423
- get: function () { return chunkY7NWR3WH_cjs.EVALUATION_GLOBAL; }
1596
+ get: function () { return chunkQQ6ULXHI_cjs.EVALUATION_GLOBAL; }
1424
1597
  });
1425
1598
  Object.defineProperty(exports, "LowerError", {
1426
1599
  enumerable: true,
1427
- get: function () { return chunkY7NWR3WH_cjs.LowerError; }
1600
+ get: function () { return chunkQQ6ULXHI_cjs.LowerError; }
1601
+ });
1602
+ Object.defineProperty(exports, "NODE_BUILTINS", {
1603
+ enumerable: true,
1604
+ get: function () { return chunkQQ6ULXHI_cjs.NODE_BUILTINS; }
1605
+ });
1606
+ Object.defineProperty(exports, "buildBundle", {
1607
+ enumerable: true,
1608
+ get: function () { return chunkQQ6ULXHI_cjs.buildBundle; }
1428
1609
  });
1429
1610
  Object.defineProperty(exports, "bundleProject", {
1430
1611
  enumerable: true,
1431
- get: function () { return chunkY7NWR3WH_cjs.bundleProject; }
1612
+ get: function () { return chunkQQ6ULXHI_cjs.bundleProject; }
1613
+ });
1614
+ Object.defineProperty(exports, "bundleSourceHash", {
1615
+ enumerable: true,
1616
+ get: function () { return chunkQQ6ULXHI_cjs.bundleSourceHash; }
1432
1617
  });
1433
1618
  Object.defineProperty(exports, "defaultEntries", {
1434
1619
  enumerable: true,
1435
- get: function () { return chunkY7NWR3WH_cjs.defaultEntries; }
1620
+ get: function () { return chunkQQ6ULXHI_cjs.defaultEntries; }
1436
1621
  });
1437
1622
  Object.defineProperty(exports, "lower", {
1438
1623
  enumerable: true,
1439
- get: function () { return chunkY7NWR3WH_cjs.lower; }
1624
+ get: function () { return chunkQQ6ULXHI_cjs.lower; }
1625
+ });
1626
+ Object.defineProperty(exports, "resolvePackageEntry", {
1627
+ enumerable: true,
1628
+ get: function () { return chunkQQ6ULXHI_cjs.resolvePackageEntry; }
1629
+ });
1630
+ Object.defineProperty(exports, "scanDurableSources", {
1631
+ enumerable: true,
1632
+ get: function () { return chunkQQ6ULXHI_cjs.scanDurableSources; }
1633
+ });
1634
+ Object.defineProperty(exports, "splitSpecifier", {
1635
+ enumerable: true,
1636
+ get: function () { return chunkQQ6ULXHI_cjs.splitSpecifier; }
1440
1637
  });
1441
1638
  exports.LiftError = LiftError;
1442
1639
  exports.PY_PROJECT_MODULE = PY_PROJECT_MODULE;
1443
1640
  exports.PY_SDK_MODULE = PY_SDK_MODULE;
1641
+ exports.SOURCE_ARCHIVE_MAX_BYTES = SOURCE_ARCHIVE_MAX_BYTES;
1642
+ exports.archiveDeps = archiveDeps;
1444
1643
  exports.checkFidelity = checkFidelity;
1445
1644
  exports.exportWorkflowCode = exportWorkflowCode;
1446
1645
  exports.liftToPython = liftToPython;
1447
1646
  exports.liftToTypeScript = liftToTypeScript;
1647
+ exports.packSources = packSources;
1448
1648
  exports.prepareLift = prepareLift;
1649
+ exports.unpackSources = unpackSources;
1650
+ exports.vendorDependencies = vendorDependencies;