@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,11 +1,16 @@
1
- import { W as WorkflowDefinition, a as JsonObject } from '../types-Dr2Fn1Ax.cjs';
2
- import { m as LayoutSidecar } from '../assemble-DEf3znGD.cjs';
3
- import { N as NodeManifest } from '../manifest-Duf-gHdO.cjs';
1
+ import { b as WorkflowDefinition, J as JsonObject } from '../types-BGoPzgcl.cjs';
2
+ import { b as LayoutSidecar } from '../assemble-BLqQ8lSu.cjs';
3
+ import { N as NodeManifest } from '../manifest-0OLw0i7k.cjs';
4
4
  import { P as PathSegment } from '../expressions-DhHaqyar.cjs';
5
- import { E as Evaluator, a as EsbuildApi } from '../lower-DAzvsJCo.cjs';
6
- export { D as DeterminismViolationError, b as ESBUILD_VERSION, c as EVALUATION_GLOBAL, L as LowerError, d as LowerFailureReason, e as LowerOptions, f as LowerResult, g as LoweredWorkflow, h as bundleProject, i as defaultEntries, l as lower } from '../lower-DAzvsJCo.cjs';
7
- import 'esbuild';
5
+ import { V as VendoredDeps, a as VendoredPackage, E as Evaluator } from '../lower-BzmUz0sq.cjs';
6
+ export { B as BuildBundleOptions, b as BuiltBundle, D as DeterminismViolationError, c as ESBUILD_VERSION, d as EVALUATION_GLOBAL, L as LowerIssue, e as LowerOptions, f as LowerResult, g as LoweredWorkflow, N as NODE_BUILTINS, h as buildBundle, i as bundleProject, j as bundleSourceHash, k as defaultEntries, l as lower, r as resolvePackageEntry, s as scanDurableSources, m as splitSpecifier } from '../lower-BzmUz0sq.cjs';
7
+ import { E as EsbuildApi } from '../lower-types-DQNBfWQn.cjs';
8
+ export { B as BuildDiagnostic, a as BuildDiagnosticLocation, L as LowerError, b as LowerFailureReason } from '../lower-types-DQNBfWQn.cjs';
9
+ import '../workflow-FXUkpIBc.cjs';
10
+ import '../workflow-J-yYixny.cjs';
11
+ import '../types-CpBBjaGX.cjs';
8
12
  import '../hash-CZkTXPCX.cjs';
13
+ import 'esbuild';
9
14
 
10
15
  /**
11
16
  * The language-neutral lift plan: a definition expressed as tier-1 builder
@@ -215,6 +220,33 @@ declare function liftToTypeScript(definition: unknown, options?: LiftOptions): P
215
220
  /** Lift to a tier-1 Python project fragment. */
216
221
  declare function liftToPython(definition: unknown, options?: LiftOptions): Promise<LiftResult>;
217
222
 
223
+ interface VendorOptions {
224
+ /** Package names to vendor instead of the project's `dependencies`. */
225
+ packages?: readonly string[];
226
+ /** Largest total size of the vendored files, in bytes. Default 32 MiB. */
227
+ maxBytes?: number;
228
+ }
229
+ /** Vendor the dependencies of the project at `projectDir`. */
230
+ declare function vendorDependencies(projectDir: string, options?: VendorOptions): VendoredDeps;
231
+
232
+ interface SourceArchive {
233
+ /** Project files by path. */
234
+ files: Record<string, string>;
235
+ /** The lockfile text (`bun.lock`, `package-lock.json`), if any. */
236
+ lock?: string;
237
+ /** Vendored packages by name. */
238
+ vendored?: Record<string, VendoredPackage>;
239
+ }
240
+ declare const SOURCE_ARCHIVE_MAX_BYTES: number;
241
+ /** Pack a source archive. */
242
+ declare function packSources(archive: SourceArchive): Uint8Array;
243
+ /** Unpack and check a source archive. */
244
+ declare function unpackSources(data: Uint8Array, options?: {
245
+ maxBytes?: number;
246
+ }): SourceArchive;
247
+ /** The vendored packages of an archive as `buildBundle` takes them. */
248
+ declare function archiveDeps(archive: SourceArchive): VendoredDeps;
249
+
218
250
  interface NodeVmEvaluatorOptions {
219
251
  /** Wall-clock budget for evaluating the bundle. Default 5000 ms. */
220
252
  timeoutMs?: number;
@@ -287,4 +319,4 @@ declare const PY_PROJECT_MODULE = "fluidgrids_workflows.project";
287
319
  */
288
320
  declare const PY_LINE_LENGTH = 88;
289
321
 
290
- export { EsbuildApi, Evaluator, type ExportCodeOptions, type ExportCodeResult, type ExportedFile, type FidelityItem, type FidelityItemKind, type FidelityReport, LiftError, type LiftHeader, type LiftOptions, type LiftResult, type NodeVmEvaluatorOptions, PY_LINE_LENGTH, PY_PROJECT_MODULE, PY_SDK_MODULE, type PlanOptions, type PreparedLift, TS_FORMAT_OPTIONS, TS_NODES_IMPORT, checkFidelity, createNodeVmEvaluator, exportWorkflowCode, liftToPython, liftToTypeScript, prepareLift };
322
+ export { EsbuildApi, Evaluator, type ExportCodeOptions, type ExportCodeResult, type ExportedFile, type FidelityItem, type FidelityItemKind, type FidelityReport, LiftError, type LiftHeader, type LiftOptions, type LiftResult, type NodeVmEvaluatorOptions, PY_LINE_LENGTH, PY_PROJECT_MODULE, PY_SDK_MODULE, type PlanOptions, type PreparedLift, SOURCE_ARCHIVE_MAX_BYTES, type SourceArchive, TS_FORMAT_OPTIONS, TS_NODES_IMPORT, type VendorOptions, VendoredDeps, VendoredPackage, archiveDeps, checkFidelity, createNodeVmEvaluator, exportWorkflowCode, liftToPython, liftToTypeScript, packSources, prepareLift, unpackSources, vendorDependencies };
@@ -1,11 +1,16 @@
1
- import { W as WorkflowDefinition, a as JsonObject } from '../types-Dr2Fn1Ax.js';
2
- import { m as LayoutSidecar } from '../assemble-CrpUyd_3.js';
3
- import { N as NodeManifest } from '../manifest-Bp9ZJlav.js';
1
+ import { b as WorkflowDefinition, J as JsonObject } from '../types-BGoPzgcl.js';
2
+ import { b as LayoutSidecar } from '../assemble-DWgaXHd-.js';
3
+ import { N as NodeManifest } from '../manifest-C8N6HDYl.js';
4
4
  import { P as PathSegment } from '../expressions-DhHaqyar.js';
5
- import { E as Evaluator, a as EsbuildApi } from '../lower-CXggJTIo.js';
6
- export { D as DeterminismViolationError, b as ESBUILD_VERSION, c as EVALUATION_GLOBAL, L as LowerError, d as LowerFailureReason, e as LowerOptions, f as LowerResult, g as LoweredWorkflow, h as bundleProject, i as defaultEntries, l as lower } from '../lower-CXggJTIo.js';
7
- import 'esbuild';
5
+ import { V as VendoredDeps, a as VendoredPackage, E as Evaluator } from '../lower-_-iT4HYs.js';
6
+ export { B as BuildBundleOptions, b as BuiltBundle, D as DeterminismViolationError, c as ESBUILD_VERSION, d as EVALUATION_GLOBAL, L as LowerIssue, e as LowerOptions, f as LowerResult, g as LoweredWorkflow, N as NODE_BUILTINS, h as buildBundle, i as bundleProject, j as bundleSourceHash, k as defaultEntries, l as lower, r as resolvePackageEntry, s as scanDurableSources, m as splitSpecifier } from '../lower-_-iT4HYs.js';
7
+ import { E as EsbuildApi } from '../lower-types-DQNBfWQn.js';
8
+ export { B as BuildDiagnostic, a as BuildDiagnosticLocation, L as LowerError, b as LowerFailureReason } from '../lower-types-DQNBfWQn.js';
9
+ import '../workflow-Bpr3vnA_.js';
10
+ import '../workflow-C2a05WUJ.js';
11
+ import '../types-DV-HX_Gt.js';
8
12
  import '../hash-CZkTXPCX.js';
13
+ import 'esbuild';
9
14
 
10
15
  /**
11
16
  * The language-neutral lift plan: a definition expressed as tier-1 builder
@@ -215,6 +220,33 @@ declare function liftToTypeScript(definition: unknown, options?: LiftOptions): P
215
220
  /** Lift to a tier-1 Python project fragment. */
216
221
  declare function liftToPython(definition: unknown, options?: LiftOptions): Promise<LiftResult>;
217
222
 
223
+ interface VendorOptions {
224
+ /** Package names to vendor instead of the project's `dependencies`. */
225
+ packages?: readonly string[];
226
+ /** Largest total size of the vendored files, in bytes. Default 32 MiB. */
227
+ maxBytes?: number;
228
+ }
229
+ /** Vendor the dependencies of the project at `projectDir`. */
230
+ declare function vendorDependencies(projectDir: string, options?: VendorOptions): VendoredDeps;
231
+
232
+ interface SourceArchive {
233
+ /** Project files by path. */
234
+ files: Record<string, string>;
235
+ /** The lockfile text (`bun.lock`, `package-lock.json`), if any. */
236
+ lock?: string;
237
+ /** Vendored packages by name. */
238
+ vendored?: Record<string, VendoredPackage>;
239
+ }
240
+ declare const SOURCE_ARCHIVE_MAX_BYTES: number;
241
+ /** Pack a source archive. */
242
+ declare function packSources(archive: SourceArchive): Uint8Array;
243
+ /** Unpack and check a source archive. */
244
+ declare function unpackSources(data: Uint8Array, options?: {
245
+ maxBytes?: number;
246
+ }): SourceArchive;
247
+ /** The vendored packages of an archive as `buildBundle` takes them. */
248
+ declare function archiveDeps(archive: SourceArchive): VendoredDeps;
249
+
218
250
  interface NodeVmEvaluatorOptions {
219
251
  /** Wall-clock budget for evaluating the bundle. Default 5000 ms. */
220
252
  timeoutMs?: number;
@@ -287,4 +319,4 @@ declare const PY_PROJECT_MODULE = "fluidgrids_workflows.project";
287
319
  */
288
320
  declare const PY_LINE_LENGTH = 88;
289
321
 
290
- export { EsbuildApi, Evaluator, type ExportCodeOptions, type ExportCodeResult, type ExportedFile, type FidelityItem, type FidelityItemKind, type FidelityReport, LiftError, type LiftHeader, type LiftOptions, type LiftResult, type NodeVmEvaluatorOptions, PY_LINE_LENGTH, PY_PROJECT_MODULE, PY_SDK_MODULE, type PlanOptions, type PreparedLift, TS_FORMAT_OPTIONS, TS_NODES_IMPORT, checkFidelity, createNodeVmEvaluator, exportWorkflowCode, liftToPython, liftToTypeScript, prepareLift };
322
+ export { EsbuildApi, Evaluator, type ExportCodeOptions, type ExportCodeResult, type ExportedFile, type FidelityItem, type FidelityItemKind, type FidelityReport, LiftError, type LiftHeader, type LiftOptions, type LiftResult, type NodeVmEvaluatorOptions, PY_LINE_LENGTH, PY_PROJECT_MODULE, PY_SDK_MODULE, type PlanOptions, type PreparedLift, SOURCE_ARCHIVE_MAX_BYTES, type SourceArchive, TS_FORMAT_OPTIONS, TS_NODES_IMPORT, type VendorOptions, VendoredDeps, VendoredPackage, archiveDeps, checkFidelity, createNodeVmEvaluator, exportWorkflowCode, liftToPython, liftToTypeScript, packSources, prepareLift, unpackSources, vendorDependencies };
@@ -1,16 +1,23 @@
1
- import { diffDefinitions } from '../chunk-W32BSO3M.js';
2
- import { renderTypeScript, generateNodeClients, pyWorkflowName, NameAllocator, referencedLater, formatLines, formatImport, clientNames, pyString, snakeCase, pyNumber, PY_KEYWORDS } from '../chunk-XBIID5DY.js';
3
- export { PY_LINE_LENGTH, TS_FORMAT_OPTIONS, TS_NODES_IMPORT } from '../chunk-XBIID5DY.js';
4
- import { operationsOf, isTriggerOperation } from '../chunk-6BEW4QD6.js';
5
- export { createNodeVmEvaluator } from '../chunk-5AW745OG.js';
6
- import { lower } from '../chunk-MBBKGD7K.js';
7
- export { DeterminismViolationError, ESBUILD_VERSION, EVALUATION_GLOBAL, LowerError, bundleProject, defaultEntries, lower } from '../chunk-MBBKGD7K.js';
8
- import { assembleRecording, LAYOUT_FORMAT_VERSION, LAYOUT_FORMAT, defineWorkflow, nodes, trigger, op, internalNodes, triggers, edge, defaultEdgeId } from '../chunk-EEAIM35V.js';
9
- import { normalizeDefinition, irHash } from '../chunk-6U446SKY.js';
1
+ export { createNodeVmEvaluator } from '../chunk-XHXIDVEC.js';
2
+ import { diffDefinitions } from '../chunk-6FSHT5IL.js';
3
+ import { renderTypeScript, generateNodeClients, pyWorkflowName, NameAllocator, referencedLater, formatLines, formatImport, clientNames, pyString, snakeCase, pyNumber, PY_KEYWORDS } from '../chunk-SMCANK3F.js';
4
+ export { PY_LINE_LENGTH, TS_FORMAT_OPTIONS, TS_NODES_IMPORT } from '../chunk-SMCANK3F.js';
5
+ import { operationsOf, isTriggerOperation } from '../chunk-QAN5MZEM.js';
6
+ import { LowerError, lower } from '../chunk-I5LR3D2K.js';
7
+ export { DeterminismViolationError, ESBUILD_VERSION, EVALUATION_GLOBAL, LowerError, NODE_BUILTINS, buildBundle, bundleProject, bundleSourceHash, defaultEntries, lower, resolvePackageEntry, scanDurableSources, splitSpecifier } from '../chunk-I5LR3D2K.js';
8
+ import '../chunk-XKJA7KX3.js';
9
+ import { assembleRecording, LAYOUT_FORMAT_VERSION, LAYOUT_FORMAT, defineWorkflow, nodes, trigger, op, internalNodes, triggers, edge, defaultEdgeId } from '../chunk-HWJZVOG7.js';
10
+ import { normalizeDefinition, irHash } from '../chunk-BD7ZPG53.js';
10
11
  import '../chunk-5LUIDMF4.js';
11
- import { PREDICATE_OPERATORS, BuilderError, and, or, expr, RESERVED_REF_KEYS } from '../chunk-UB2BHU2M.js';
12
- import { stableStringify } from '../chunk-IHKXLG6I.js';
13
- import { isRecord, setOwn, deepEqual, parseTemplate } from '../chunk-UJNHTS6D.js';
12
+ import { PREDICATE_OPERATORS, BuilderError, and, or, expr, RESERVED_REF_KEYS } from '../chunk-JZ4TOOLN.js';
13
+ import { canonicalJson, stableStringify } from '../chunk-E2VK7J2C.js';
14
+ import { parseTemplate } from '../chunk-7AAZGVKD.js';
15
+ import { isRecord, setOwn, deepEqual } from '../chunk-PMCM2OH4.js';
16
+ import '../chunk-N23SKIG4.js';
17
+ import '../chunk-BO6OVILK.js';
18
+ import { readFileSync, existsSync, readdirSync, statSync } from 'fs';
19
+ import { resolve, join, dirname, relative, sep } from 'path';
20
+ import { gzipSync, gunzipSync } from 'zlib';
14
21
 
15
22
  // src/roundtrip/plan.ts
16
23
  var TYPED_HANDLES = {
@@ -1339,6 +1346,171 @@ async function liftToPython(definition, options2 = {}) {
1339
1346
  }
1340
1347
  return { files, items: prepared.items, reference: prepared.reference };
1341
1348
  }
1349
+ var SDK_PACKAGE = "@fluidgrids/workflows";
1350
+ var KEPT_EXTENSIONS = [".js", ".mjs", ".json"];
1351
+ var NATIVE_MARKERS = [".node", "binding.gyp"];
1352
+ var SKIPPED_DIRECTORIES = /* @__PURE__ */ new Set(["node_modules", ".git", "test", "tests", "__tests__"]);
1353
+ var DEFAULT_MAX_BYTES = 32 * 1024 * 1024;
1354
+ function readJson(path) {
1355
+ let parsed;
1356
+ try {
1357
+ parsed = JSON.parse(readFileSync(path, "utf8"));
1358
+ } catch (error) {
1359
+ throw new LowerError(
1360
+ `Cannot read ${path}: ${error instanceof Error ? error.message : String(error)}`
1361
+ );
1362
+ }
1363
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
1364
+ throw new LowerError(`${path} is not a JSON object`);
1365
+ return parsed;
1366
+ }
1367
+ function namesOf(value2) {
1368
+ if (typeof value2 !== "object" || value2 === null || Array.isArray(value2)) return [];
1369
+ return Object.keys(value2);
1370
+ }
1371
+ function locate(name, fromDir) {
1372
+ let dir = fromDir;
1373
+ for (; ; ) {
1374
+ const candidate = join(dir, "node_modules", ...name.split("/"));
1375
+ if (existsSync(join(candidate, "package.json"))) return candidate;
1376
+ const parent = dirname(dir);
1377
+ if (parent === dir) return void 0;
1378
+ dir = parent;
1379
+ }
1380
+ }
1381
+ function collectFiles(packageDir, dir, files, budget) {
1382
+ for (const entry of readdirSync(dir).sort()) {
1383
+ const full = join(dir, entry);
1384
+ const stats = statSync(full);
1385
+ if (stats.isDirectory()) {
1386
+ if (!SKIPPED_DIRECTORIES.has(entry)) collectFiles(packageDir, full, files, budget);
1387
+ continue;
1388
+ }
1389
+ const path = relative(packageDir, full).split(sep).join("/");
1390
+ if (NATIVE_MARKERS.some((marker) => entry.endsWith(marker))) {
1391
+ files[path] = "";
1392
+ continue;
1393
+ }
1394
+ if (!KEPT_EXTENSIONS.some((ext) => entry.endsWith(ext))) continue;
1395
+ budget.left -= stats.size;
1396
+ if (budget.left < 0)
1397
+ throw new LowerError(
1398
+ `The vendored packages are larger than the limit (reached at "${budget.name}")`,
1399
+ "too-large"
1400
+ );
1401
+ files[path] = readFileSync(full, "utf8");
1402
+ }
1403
+ }
1404
+ function vendorDependencies(projectDir, options2 = {}) {
1405
+ const rootDir = resolve(projectDir);
1406
+ const manifest = readJson(join(rootDir, "package.json"));
1407
+ const wanted = options2.packages ?? namesOf(manifest["dependencies"]);
1408
+ const budget = { left: options2.maxBytes ?? DEFAULT_MAX_BYTES, name: "" };
1409
+ const out = {};
1410
+ const queue = wanted.filter((name) => name !== SDK_PACKAGE).map((name) => ({ name, fromDir: rootDir, optional: false }));
1411
+ while (queue.length > 0) {
1412
+ const next = queue.shift();
1413
+ if (!next || Object.hasOwn(out, next.name) || next.name === SDK_PACKAGE) continue;
1414
+ const packageDir = locate(next.name, next.fromDir);
1415
+ if (packageDir === void 0) {
1416
+ if (next.optional) continue;
1417
+ throw new LowerError(
1418
+ `"${next.name}" is a dependency but is not installed under ${rootDir}; run your package manager's install first`
1419
+ );
1420
+ }
1421
+ const pkgJson = readJson(join(packageDir, "package.json"));
1422
+ const files = {};
1423
+ budget.name = next.name;
1424
+ collectFiles(packageDir, packageDir, files, budget);
1425
+ out[next.name] = {
1426
+ version: typeof pkgJson["version"] === "string" ? pkgJson["version"] : "0.0.0",
1427
+ files
1428
+ };
1429
+ for (const dependency of namesOf(pkgJson["dependencies"]))
1430
+ queue.push({ name: dependency, fromDir: packageDir, optional: false });
1431
+ for (const peer of namesOf(pkgJson["peerDependencies"]))
1432
+ queue.push({ name: peer, fromDir: packageDir, optional: true });
1433
+ }
1434
+ const sorted = {};
1435
+ for (const name of Object.keys(out).sort()) {
1436
+ const pkg = out[name];
1437
+ if (pkg) sorted[name] = pkg;
1438
+ }
1439
+ return sorted;
1440
+ }
1441
+ var SOURCE_ARCHIVE_MAX_BYTES = 64 * 1024 * 1024;
1442
+ var GZIP_OS_BYTE = 9;
1443
+ function packSources(archive) {
1444
+ const value2 = { files: archive.files };
1445
+ if (archive.lock !== void 0) value2["lock"] = archive.lock;
1446
+ if (archive.vendored !== void 0 && Object.keys(archive.vendored).length > 0)
1447
+ value2["vendored"] = archive.vendored;
1448
+ const text = canonicalJson(value2);
1449
+ const zipped = gzipSync(Buffer.from(text, "utf8"), { level: 9 });
1450
+ zipped[GZIP_OS_BYTE] = 255;
1451
+ return new Uint8Array(zipped.buffer, zipped.byteOffset, zipped.byteLength);
1452
+ }
1453
+ function stringMap(value2, what) {
1454
+ if (!isRecord(value2)) throw new LowerError(`${what} must be an object`);
1455
+ const out = {};
1456
+ for (const [key, entry] of Object.entries(value2)) {
1457
+ if (typeof entry !== "string") throw new LowerError(`${what}["${key}"] must be a string`);
1458
+ Object.defineProperty(out, key, {
1459
+ value: entry,
1460
+ enumerable: true,
1461
+ writable: true,
1462
+ configurable: true
1463
+ });
1464
+ }
1465
+ return out;
1466
+ }
1467
+ function unpackSources(data, options2 = {}) {
1468
+ const maxBytes = options2.maxBytes ?? SOURCE_ARCHIVE_MAX_BYTES;
1469
+ let text;
1470
+ try {
1471
+ text = gunzipSync(data, { maxOutputLength: maxBytes }).toString("utf8");
1472
+ } catch (error) {
1473
+ const message = error instanceof Error ? error.message : String(error);
1474
+ throw new LowerError(
1475
+ /buffer|length|range/i.test(message) ? `The source archive is larger than ${maxBytes} bytes uncompressed` : `The source archive is not gzip: ${message}`,
1476
+ /buffer|length|range/i.test(message) ? "too-large" : void 0
1477
+ );
1478
+ }
1479
+ let parsed;
1480
+ try {
1481
+ parsed = JSON.parse(text);
1482
+ } catch {
1483
+ throw new LowerError("The source archive is not JSON");
1484
+ }
1485
+ if (!isRecord(parsed)) throw new LowerError("The source archive is not an object");
1486
+ const archive = { files: stringMap(parsed["files"], "files") };
1487
+ if (parsed["lock"] !== void 0) {
1488
+ if (typeof parsed["lock"] !== "string") throw new LowerError("lock must be a string");
1489
+ archive.lock = parsed["lock"];
1490
+ }
1491
+ if (parsed["vendored"] !== void 0) {
1492
+ if (!isRecord(parsed["vendored"])) throw new LowerError("vendored must be an object");
1493
+ const vendored = {};
1494
+ for (const [name, pkg] of Object.entries(parsed["vendored"])) {
1495
+ if (!isRecord(pkg) || typeof pkg["version"] !== "string")
1496
+ throw new LowerError(`vendored["${name}"] needs a version`);
1497
+ Object.defineProperty(vendored, name, {
1498
+ value: {
1499
+ version: pkg["version"],
1500
+ files: stringMap(pkg["files"], `vendored["${name}"].files`)
1501
+ },
1502
+ enumerable: true,
1503
+ writable: true,
1504
+ configurable: true
1505
+ });
1506
+ }
1507
+ archive.vendored = vendored;
1508
+ }
1509
+ return archive;
1510
+ }
1511
+ function archiveDeps(archive) {
1512
+ return archive.vendored ?? {};
1513
+ }
1342
1514
 
1343
1515
  // src/roundtrip/fidelity.ts
1344
1516
  var LOSSY_KINDS = /* @__PURE__ */ new Set([
@@ -1394,4 +1566,4 @@ async function exportWorkflowCode(definition, options2) {
1394
1566
  return { format: options2.format, files, fidelity, irHash: irHash(definition) };
1395
1567
  }
1396
1568
 
1397
- export { LiftError, PY_PROJECT_MODULE, PY_SDK_MODULE, checkFidelity, exportWorkflowCode, liftToPython, liftToTypeScript, prepareLift };
1569
+ export { LiftError, PY_PROJECT_MODULE, PY_SDK_MODULE, SOURCE_ARCHIVE_MAX_BYTES, archiveDeps, checkFidelity, exportWorkflowCode, liftToPython, liftToTypeScript, packSources, prepareLift, unpackSources, vendorDependencies };
@@ -0,0 +1,90 @@
1
+ 'use strict';
2
+
3
+ var chunkM4BBAERY_cjs = require('../chunk-M4BBAERY.cjs');
4
+ require('../chunk-FMSW2HDF.cjs');
5
+ require('../chunk-FR7KYWRO.cjs');
6
+ var chunkL24YIZY7_cjs = require('../chunk-L24YIZY7.cjs');
7
+ require('../chunk-DHTLALBL.cjs');
8
+ var chunkP6TA5EZT_cjs = require('../chunk-P6TA5EZT.cjs');
9
+ require('../chunk-623FVQSN.cjs');
10
+ require('../chunk-2J6TF7YI.cjs');
11
+ require('../chunk-Z2Y65YOY.cjs');
12
+
13
+
14
+
15
+ Object.defineProperty(exports, "CommandIds", {
16
+ enumerable: true,
17
+ get: function () { return chunkM4BBAERY_cjs.CommandIds; }
18
+ });
19
+ Object.defineProperty(exports, "RUNTIME_GLOBAL", {
20
+ enumerable: true,
21
+ get: function () { return chunkM4BBAERY_cjs.RUNTIME_GLOBAL; }
22
+ });
23
+ Object.defineProperty(exports, "SDK_NAME", {
24
+ enumerable: true,
25
+ get: function () { return chunkM4BBAERY_cjs.SDK_NAME; }
26
+ });
27
+ Object.defineProperty(exports, "WorkflowExecution", {
28
+ enumerable: true,
29
+ get: function () { return chunkM4BBAERY_cjs.WorkflowExecution; }
30
+ });
31
+ Object.defineProperty(exports, "buildWorkflowRegistry", {
32
+ enumerable: true,
33
+ get: function () { return chunkM4BBAERY_cjs.buildWorkflowRegistry; }
34
+ });
35
+ Object.defineProperty(exports, "createWorkflowRuntime", {
36
+ enumerable: true,
37
+ get: function () { return chunkM4BBAERY_cjs.createWorkflowRuntime; }
38
+ });
39
+ Object.defineProperty(exports, "installWorkflowRuntime", {
40
+ enumerable: true,
41
+ get: function () { return chunkM4BBAERY_cjs.installWorkflowRuntime; }
42
+ });
43
+ Object.defineProperty(exports, "isPatchMarkerId", {
44
+ enumerable: true,
45
+ get: function () { return chunkM4BBAERY_cjs.isPatchMarkerId; }
46
+ });
47
+ Object.defineProperty(exports, "isRuntimeAbi", {
48
+ enumerable: true,
49
+ get: function () { return chunkM4BBAERY_cjs.isRuntimeAbi; }
50
+ });
51
+ Object.defineProperty(exports, "matchActivation", {
52
+ enumerable: true,
53
+ get: function () { return chunkM4BBAERY_cjs.matchActivation; }
54
+ });
55
+ Object.defineProperty(exports, "mismatch", {
56
+ enumerable: true,
57
+ get: function () { return chunkM4BBAERY_cjs.mismatch; }
58
+ });
59
+ Object.defineProperty(exports, "patchMarkerId", {
60
+ enumerable: true,
61
+ get: function () { return chunkM4BBAERY_cjs.patchMarkerId; }
62
+ });
63
+ Object.defineProperty(exports, "SHIM_HOOK", {
64
+ enumerable: true,
65
+ get: function () { return chunkL24YIZY7_cjs.SHIM_HOOK; }
66
+ });
67
+ Object.defineProperty(exports, "SHIM_VIOLATION", {
68
+ enumerable: true,
69
+ get: function () { return chunkL24YIZY7_cjs.SHIM_VIOLATION; }
70
+ });
71
+ Object.defineProperty(exports, "TASK_PRELUDE", {
72
+ enumerable: true,
73
+ get: function () { return chunkL24YIZY7_cjs.TASK_PRELUDE; }
74
+ });
75
+ Object.defineProperty(exports, "createRandom", {
76
+ enumerable: true,
77
+ get: function () { return chunkL24YIZY7_cjs.createRandom; }
78
+ });
79
+ Object.defineProperty(exports, "seedOf", {
80
+ enumerable: true,
81
+ get: function () { return chunkL24YIZY7_cjs.seedOf; }
82
+ });
83
+ Object.defineProperty(exports, "uuidFrom", {
84
+ enumerable: true,
85
+ get: function () { return chunkL24YIZY7_cjs.uuidFrom; }
86
+ });
87
+ Object.defineProperty(exports, "splitActivations", {
88
+ enumerable: true,
89
+ get: function () { return chunkP6TA5EZT_cjs.splitActivations; }
90
+ });