@fluidgrids/workflows 2026.1027.0 → 2026.1028.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +170 -18
- package/dist/activation-BBh1p82z.d.cts +57 -0
- package/dist/activation-DnhG7SmF.d.ts +57 -0
- package/dist/assemble-BLqQ8lSu.d.cts +39 -0
- package/dist/assemble-DWgaXHd-.d.ts +39 -0
- package/dist/chunk-2DP2Y6EU.cjs +832 -0
- package/dist/chunk-2J6TF7YI.cjs +86 -0
- package/dist/chunk-3FOTFQ3J.js +1622 -0
- package/dist/chunk-4LYSEANA.js +199 -0
- package/dist/{chunk-KUTMY2IO.cjs → chunk-57MSZ24T.cjs} +162 -98
- package/dist/{chunk-BWSLWF2E.js → chunk-5HDSBTBX.js} +99 -32
- package/dist/chunk-623FVQSN.cjs +251 -0
- package/dist/{chunk-4DPEGDPW.js → chunk-6FSHT5IL.js} +4 -4
- package/dist/{chunk-REV7ZOA4.js → chunk-7AAZGVKD.js} +1 -35
- package/dist/chunk-7NQ37GZU.js +73 -0
- package/dist/chunk-ABFZWYHT.js +612 -0
- package/dist/{chunk-SS4LT2IP.js → chunk-BD7ZPG53.js} +5 -10
- package/dist/chunk-BO6OVILK.js +79 -0
- package/dist/chunk-C5OLWZ42.js +245 -0
- package/dist/chunk-CBL5JSCC.cjs +75 -0
- package/dist/{chunk-LSKSBVL4.cjs → chunk-CPDK3K5N.cjs} +6 -6
- package/dist/chunk-CSNWNFKU.cjs +1635 -0
- package/dist/chunk-DJYMDLV5.js +227 -0
- package/dist/{chunk-X4HKU3MX.js → chunk-E2VK7J2C.js} +3 -1
- package/dist/chunk-FMSW2HDF.cjs +267 -0
- package/dist/chunk-FQIHX7YI.cjs +80 -0
- package/dist/chunk-FR7KYWRO.cjs +41 -0
- package/dist/{chunk-AU3YW7FZ.cjs → chunk-GBQ33SIZ.cjs} +46 -51
- package/dist/{chunk-RRQ5HOBF.cjs → chunk-GVTZMA5C.cjs} +4 -4
- package/dist/chunk-H7KEVW2M.js +816 -0
- package/dist/chunk-HR3BN4C4.cjs +27 -0
- package/dist/chunk-IISBRUWJ.js +13 -0
- package/dist/chunk-JD2VQIDZ.cjs +15 -0
- package/dist/{chunk-PL73GJR4.js → chunk-JZ4TOOLN.js} +1 -1
- package/dist/chunk-L24YIZY7.cjs +207 -0
- package/dist/chunk-LNUQE6D6.js +39 -0
- package/dist/{chunk-BYJ7QTLY.cjs → chunk-NEIUQASE.cjs} +13 -13
- package/dist/chunk-P6TA5EZT.cjs +634 -0
- package/dist/chunk-PDHLTDZB.js +72 -0
- package/dist/chunk-PMCM2OH4.js +46 -0
- package/dist/chunk-PZCVF76Q.cjs +868 -0
- package/dist/{chunk-GO34UHSY.js → chunk-QAN5MZEM.js} +3 -3
- package/dist/{chunk-27HASETB.cjs → chunk-QKZL3ONM.cjs} +3 -1
- package/dist/chunk-SAENRNBJ.cjs +52 -0
- package/dist/{chunk-LMX35GNQ.js → chunk-SMCANK3F.js} +5 -4
- package/dist/{chunk-IZQNUNSU.cjs → chunk-SX2PNKKT.cjs} +18 -17
- package/dist/{chunk-LRM6JXJA.cjs → chunk-TBDXTV22.cjs} +0 -37
- package/dist/chunk-VOKMAAJP.js +848 -0
- package/dist/chunk-XB53G2DK.js +25 -0
- package/dist/chunk-Z2Y65YOY.cjs +7 -0
- package/dist/codegen/index.cjs +9 -7
- package/dist/codegen/index.d.cts +2 -2
- package/dist/codegen/index.d.ts +2 -2
- package/dist/codegen/index.js +6 -5
- package/dist/file-BOoHZgoQ.d.cts +1557 -0
- package/dist/file-yuPCFU5b.d.ts +1557 -0
- package/dist/history/index.cjs +287 -0
- package/dist/history/index.d.cts +157 -0
- package/dist/history/index.d.ts +157 -0
- package/dist/history/index.js +5 -0
- package/dist/index.cjs +134 -36
- package/dist/index.d.cts +137 -9
- package/dist/index.d.ts +137 -9
- package/dist/index.js +8 -3
- package/dist/ir/index.cjs +161 -165
- package/dist/ir/index.d.cts +32 -12
- package/dist/ir/index.d.ts +32 -12
- package/dist/ir/index.js +54 -61
- package/dist/lower-BuSvAFqi.d.cts +129 -0
- package/dist/lower-C_Qv_34S.d.ts +129 -0
- package/dist/lower-types-nofRXw9c.d.cts +15 -0
- package/dist/lower-types-nofRXw9c.d.ts +15 -0
- package/dist/{manifest-Duf-gHdO.d.cts → manifest-0OLw0i7k.d.cts} +1 -1
- package/dist/{manifest-Bp9ZJlav.d.ts → manifest-C8N6HDYl.d.ts} +1 -1
- package/dist/node-evaluator-CJNP4GHX.js +12 -0
- package/dist/node-evaluator-DMKPKUWA.cjs +22 -0
- package/dist/quickjs/index.cjs +256 -78
- package/dist/quickjs/index.d.cts +48 -7
- package/dist/quickjs/index.d.ts +48 -7
- package/dist/quickjs/index.js +254 -79
- package/dist/roundtrip/index.cjs +404 -129
- package/dist/roundtrip/index.d.cts +43 -8
- package/dist/roundtrip/index.d.ts +43 -8
- package/dist/roundtrip/index.js +260 -19
- package/dist/runtime/index.cjs +90 -0
- package/dist/runtime/index.d.cts +297 -0
- package/dist/runtime/index.d.ts +297 -0
- package/dist/runtime/index.js +8 -0
- package/dist/testing/index.cjs +1057 -0
- package/dist/testing/index.d.cts +305 -0
- package/dist/testing/index.d.ts +305 -0
- package/dist/testing/index.js +1037 -0
- package/dist/{types-Dr2Fn1Ax.d.ts → types-BGoPzgcl.d.cts} +1 -1
- package/dist/{types-Dr2Fn1Ax.d.cts → types-BGoPzgcl.d.ts} +1 -1
- package/dist/types-CpBBjaGX.d.cts +380 -0
- package/dist/types-DV-HX_Gt.d.ts +380 -0
- package/dist/{assemble-DMOuaxRI.d.ts → workflow-Bpr3vnA_.d.ts} +60 -162
- package/dist/workflow-C2a05WUJ.d.ts +444 -0
- package/dist/{assemble-BJo9TECS.d.cts → workflow-FXUkpIBc.d.cts} +60 -162
- package/dist/workflow-J-yYixny.d.cts +444 -0
- package/fixtures/README.md +128 -0
- package/fixtures/histories/activity-failure-fails-run.history.json +163 -0
- package/fixtures/histories/activity-retry-then-success.history.json +147 -0
- package/fixtures/histories/cancel-activity-abandon.history.json +126 -0
- package/fixtures/histories/cancel-activity-compensate.history.json +307 -0
- package/fixtures/histories/cancel-concurrent-non-cancellable.history.json +234 -0
- package/fixtures/histories/cancel-concurrent-scope-timeout.history.json +184 -0
- package/fixtures/histories/cancel-condition-after-cancel.history.json +200 -0
- package/fixtures/histories/cancel-during-timer.history.json +123 -0
- package/fixtures/histories/cancel-saga-compensations.history.json +325 -0
- package/fixtures/histories/cancel-scope-timeout.history.json +148 -0
- package/fixtures/histories/child-abandon-outlives-parent.history.json +191 -0
- package/fixtures/histories/child-cancel-default.history.json +234 -0
- package/fixtures/histories/child-cancel-request.history.json +206 -0
- package/fixtures/histories/child-durable-child-side.history.json +124 -0
- package/fixtures/histories/child-durable-result.history.json +163 -0
- package/fixtures/histories/child-failure-caught.history.json +166 -0
- package/fixtures/histories/child-graph-by-key.history.json +138 -0
- package/fixtures/histories/child-terminated-by-parent-close.history.json +85 -0
- package/fixtures/histories/continue-as-new-first-run.history.json +146 -0
- package/fixtures/histories/continue-as-new-history-limit.history.json +489 -0
- package/fixtures/histories/continue-as-new-last-run.history.json +147 -0
- package/fixtures/histories/continue-as-new-suggested.history.json +352 -0
- package/fixtures/histories/details-and-context.history.json +176 -0
- package/fixtures/histories/deterministic-values.history.json +128 -0
- package/fixtures/histories/engine-builtins.history.json +172 -0
- package/fixtures/histories/gather-activities.history.json +291 -0
- package/fixtures/histories/gather-all-settled.history.json +219 -0
- package/fixtures/histories/gather-mixed.history.json +281 -0
- package/fixtures/histories/input-during-running-task.history.json +111 -0
- package/fixtures/histories/nondeterminism-reordered.history.json +218 -0
- package/fixtures/histories/patched-deprecated.history.json +271 -0
- package/fixtures/histories/patched-new-run.history.json +270 -0
- package/fixtures/histories/patched-old-history.history.json +190 -0
- package/fixtures/histories/race-activity-wins.history.json +152 -0
- package/fixtures/histories/race-signal-beats-child.history.json +161 -0
- package/fixtures/histories/race-timeout-wins.history.json +118 -0
- package/fixtures/histories/side-effect-recorded.history.json +153 -0
- package/fixtures/histories/signal-buffered-at-start.history.json +157 -0
- package/fixtures/histories/signal-default-handler.history.json +187 -0
- package/fixtures/histories/signal-handler.history.json +191 -0
- package/fixtures/histories/signal-parent-child-side.history.json +132 -0
- package/fixtures/histories/signal-parent.history.json +202 -0
- package/fixtures/histories/signal-run-delivered.history.json +128 -0
- package/fixtures/histories/signal-run-undelivered.history.json +134 -0
- package/fixtures/histories/signal-wait.history.json +111 -0
- package/fixtures/histories/task-failure-code-error.history.json +137 -0
- package/fixtures/histories/task-failure-then-transient-attempt.history.json +140 -0
- package/fixtures/histories/timer-condition-met.history.json +201 -0
- package/fixtures/histories/timer-condition-timeout.history.json +118 -0
- package/fixtures/histories/timer-sleep-once.history.json +118 -0
- package/fixtures/histories/timer-sleep-sequence.history.json +210 -0
- package/fixtures/histories/update-accepted-completed.history.json +149 -0
- package/fixtures/histories/update-with-start-rejected-validation.history.json +91 -0
- package/package.json +85 -20
- package/schema/history-file.schema.json +2544 -0
- package/schema/ir-v2.schema.json +16 -0
- package/schema/run-event.schema.json +2374 -0
- package/schema/workflow-command.schema.json +1095 -0
- package/schema/workflow-task.schema.json +3560 -0
- package/dist/chunk-265J2FCH.cjs +0 -33
- package/dist/chunk-LUXCXFOE.cjs +0 -269
- package/dist/chunk-S34NJE3A.js +0 -262
- package/dist/chunk-SRQRLWOS.js +0 -31
- package/dist/lower-DcOY8ux0.d.cts +0 -49
- package/dist/lower-Dw5grNrI.d.ts +0 -49
- package/dist/node-evaluator-2GTUZVPK.cjs +0 -17
- package/dist/node-evaluator-RMYEWCXZ.js +0 -8
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { N as NodeManifest } from '../manifest-
|
|
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 {
|
|
6
|
-
export { b as
|
|
7
|
-
import '
|
|
5
|
+
import { V as VendoredDeps, a as VendoredPackage, E as Evaluator } from '../lower-BuSvAFqi.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-BuSvAFqi.cjs';
|
|
7
|
+
import { E as EsbuildApi } from '../lower-types-nofRXw9c.cjs';
|
|
8
|
+
export { L as LowerError, a as LowerFailureReason } from '../lower-types-nofRXw9c.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
|
|
@@ -139,12 +144,13 @@ interface LiftPlan {
|
|
|
139
144
|
* - `legacy-syntax`: a `${…}` template, an edge mapping or legacy credentials kept verbatim;
|
|
140
145
|
* - `unknown-node`: a node type or operation the registry snapshot does not know, written as `nodes.custom()`;
|
|
141
146
|
* - `connection-id-only`: a connection with no name, kept as its id;
|
|
147
|
+
* - `connection-ambiguous`: a connection whose name more than one connection has, kept as its id;
|
|
142
148
|
* - `raw-node`: a node written in its exact form (`nodes.custom()` plus `extra`);
|
|
143
149
|
* - `layout-omitted`, `pinned-data-omitted`: left out by the export options (lossy);
|
|
144
150
|
* - `key-added`: the definition had no `key`; the workflow key was written;
|
|
145
151
|
* - `roundtrip-mismatch` / `lowering-failed`: lowering the code did not reproduce the IR (lossy).
|
|
146
152
|
*/
|
|
147
|
-
type FidelityItemKind = 'expression-verbatim' | 'legacy-syntax' | 'unknown-node' | 'connection-id-only' | 'raw-node' | 'layout-omitted' | 'pinned-data-omitted' | 'key-added' | 'roundtrip-mismatch' | 'lowering-failed';
|
|
153
|
+
type FidelityItemKind = 'expression-verbatim' | 'legacy-syntax' | 'unknown-node' | 'connection-id-only' | 'connection-ambiguous' | 'raw-node' | 'layout-omitted' | 'pinned-data-omitted' | 'key-added' | 'roundtrip-mismatch' | 'lowering-failed';
|
|
148
154
|
interface FidelityItem {
|
|
149
155
|
nodeId?: string;
|
|
150
156
|
path?: string;
|
|
@@ -214,9 +220,38 @@ declare function liftToTypeScript(definition: unknown, options?: LiftOptions): P
|
|
|
214
220
|
/** Lift to a tier-1 Python project fragment. */
|
|
215
221
|
declare function liftToPython(definition: unknown, options?: LiftOptions): Promise<LiftResult>;
|
|
216
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
|
+
|
|
217
250
|
interface NodeVmEvaluatorOptions {
|
|
218
251
|
/** Wall-clock budget for evaluating the bundle. Default 5000 ms. */
|
|
219
252
|
timeoutMs?: number;
|
|
253
|
+
/** Old-generation heap cap of the evaluation worker. Default 512 MiB. */
|
|
254
|
+
memoryLimitBytes?: number;
|
|
220
255
|
}
|
|
221
256
|
declare function createNodeVmEvaluator(options?: NodeVmEvaluatorOptions): Evaluator;
|
|
222
257
|
|
|
@@ -284,4 +319,4 @@ declare const PY_PROJECT_MODULE = "fluidgrids_workflows.project";
|
|
|
284
319
|
*/
|
|
285
320
|
declare const PY_LINE_LENGTH = 88;
|
|
286
321
|
|
|
287
|
-
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { N as NodeManifest } from '../manifest-
|
|
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 {
|
|
6
|
-
export { b as
|
|
7
|
-
import '
|
|
5
|
+
import { V as VendoredDeps, a as VendoredPackage, E as Evaluator } from '../lower-C_Qv_34S.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-C_Qv_34S.js';
|
|
7
|
+
import { E as EsbuildApi } from '../lower-types-nofRXw9c.js';
|
|
8
|
+
export { L as LowerError, a as LowerFailureReason } from '../lower-types-nofRXw9c.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
|
|
@@ -139,12 +144,13 @@ interface LiftPlan {
|
|
|
139
144
|
* - `legacy-syntax`: a `${…}` template, an edge mapping or legacy credentials kept verbatim;
|
|
140
145
|
* - `unknown-node`: a node type or operation the registry snapshot does not know, written as `nodes.custom()`;
|
|
141
146
|
* - `connection-id-only`: a connection with no name, kept as its id;
|
|
147
|
+
* - `connection-ambiguous`: a connection whose name more than one connection has, kept as its id;
|
|
142
148
|
* - `raw-node`: a node written in its exact form (`nodes.custom()` plus `extra`);
|
|
143
149
|
* - `layout-omitted`, `pinned-data-omitted`: left out by the export options (lossy);
|
|
144
150
|
* - `key-added`: the definition had no `key`; the workflow key was written;
|
|
145
151
|
* - `roundtrip-mismatch` / `lowering-failed`: lowering the code did not reproduce the IR (lossy).
|
|
146
152
|
*/
|
|
147
|
-
type FidelityItemKind = 'expression-verbatim' | 'legacy-syntax' | 'unknown-node' | 'connection-id-only' | 'raw-node' | 'layout-omitted' | 'pinned-data-omitted' | 'key-added' | 'roundtrip-mismatch' | 'lowering-failed';
|
|
153
|
+
type FidelityItemKind = 'expression-verbatim' | 'legacy-syntax' | 'unknown-node' | 'connection-id-only' | 'connection-ambiguous' | 'raw-node' | 'layout-omitted' | 'pinned-data-omitted' | 'key-added' | 'roundtrip-mismatch' | 'lowering-failed';
|
|
148
154
|
interface FidelityItem {
|
|
149
155
|
nodeId?: string;
|
|
150
156
|
path?: string;
|
|
@@ -214,9 +220,38 @@ declare function liftToTypeScript(definition: unknown, options?: LiftOptions): P
|
|
|
214
220
|
/** Lift to a tier-1 Python project fragment. */
|
|
215
221
|
declare function liftToPython(definition: unknown, options?: LiftOptions): Promise<LiftResult>;
|
|
216
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
|
+
|
|
217
250
|
interface NodeVmEvaluatorOptions {
|
|
218
251
|
/** Wall-clock budget for evaluating the bundle. Default 5000 ms. */
|
|
219
252
|
timeoutMs?: number;
|
|
253
|
+
/** Old-generation heap cap of the evaluation worker. Default 512 MiB. */
|
|
254
|
+
memoryLimitBytes?: number;
|
|
220
255
|
}
|
|
221
256
|
declare function createNodeVmEvaluator(options?: NodeVmEvaluatorOptions): Evaluator;
|
|
222
257
|
|
|
@@ -284,4 +319,4 @@ declare const PY_PROJECT_MODULE = "fluidgrids_workflows.project";
|
|
|
284
319
|
*/
|
|
285
320
|
declare const PY_LINE_LENGTH = 88;
|
|
286
321
|
|
|
287
|
-
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 };
|
package/dist/roundtrip/index.js
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { lower } from '../chunk-
|
|
7
|
-
export { ESBUILD_VERSION, EVALUATION_GLOBAL, LowerError, bundleProject, defaultEntries, lower } from '../chunk-
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
1
|
+
export { createNodeVmEvaluator } from '../chunk-XB53G2DK.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-H7KEVW2M.js';
|
|
7
|
+
export { DeterminismViolationError, ESBUILD_VERSION, EVALUATION_GLOBAL, LowerError, NODE_BUILTINS, buildBundle, bundleProject, bundleSourceHash, defaultEntries, lower, resolvePackageEntry, scanDurableSources, splitSpecifier } from '../chunk-H7KEVW2M.js';
|
|
8
|
+
import '../chunk-PDHLTDZB.js';
|
|
9
|
+
import { assembleRecording, LAYOUT_FORMAT_VERSION, LAYOUT_FORMAT, defineWorkflow, nodes, trigger, op, internalNodes, triggers, edge, defaultEdgeId } from '../chunk-5HDSBTBX.js';
|
|
10
|
+
import { normalizeDefinition, irHash } from '../chunk-BD7ZPG53.js';
|
|
10
11
|
import '../chunk-5LUIDMF4.js';
|
|
11
|
-
import { PREDICATE_OPERATORS, and, or, expr, RESERVED_REF_KEYS } from '../chunk-
|
|
12
|
-
import { stableStringify } from '../chunk-
|
|
13
|
-
import {
|
|
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-7NQ37GZU.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 = {
|
|
@@ -379,14 +386,37 @@ function errorConfigOptions(errorConfig) {
|
|
|
379
386
|
}
|
|
380
387
|
return options2;
|
|
381
388
|
}
|
|
389
|
+
function ambiguousConnectionNames(names) {
|
|
390
|
+
const idByName = /* @__PURE__ */ new Map();
|
|
391
|
+
const ambiguous = /* @__PURE__ */ new Set();
|
|
392
|
+
for (const [id, name] of Object.entries(names)) {
|
|
393
|
+
const previous = idByName.get(name);
|
|
394
|
+
if (previous === void 0) idByName.set(name, id);
|
|
395
|
+
else if (previous !== id) ambiguous.add(name);
|
|
396
|
+
}
|
|
397
|
+
return ambiguous;
|
|
398
|
+
}
|
|
382
399
|
function connectionOptions(value2, names, nodeId, items) {
|
|
383
400
|
if (Array.isArray(value2) && value2.length > 0 && names) {
|
|
401
|
+
const ambiguous = ambiguousConnectionNames(names);
|
|
384
402
|
const resolved = value2.map((ref) => {
|
|
385
403
|
if (!isRecord(ref) || Object.keys(ref).sort().join(",") !== "adapter,connectionId")
|
|
386
404
|
return void 0;
|
|
387
405
|
const id = ref["connectionId"];
|
|
388
406
|
return typeof id === "string" && Object.hasOwn(names, id) ? names[id] : void 0;
|
|
389
407
|
});
|
|
408
|
+
const shared = resolved.filter(
|
|
409
|
+
(name) => typeof name === "string" && ambiguous.has(name)
|
|
410
|
+
);
|
|
411
|
+
if (shared.length > 0) {
|
|
412
|
+
items.push({
|
|
413
|
+
nodeId,
|
|
414
|
+
path: "args.connections",
|
|
415
|
+
kind: "connection-ambiguous",
|
|
416
|
+
detail: `The connection name ${[...new Set(shared)].map((name) => `"${name}"`).join(", ")} belongs to more than one connection; the connection id is kept`
|
|
417
|
+
});
|
|
418
|
+
return ["connections", literalOrStructure(value2)];
|
|
419
|
+
}
|
|
390
420
|
if (resolved.every((name) => typeof name === "string")) {
|
|
391
421
|
return resolved.length === 1 ? ["connection", { k: "literal", value: resolved[0] ?? "" }] : [
|
|
392
422
|
"connection",
|
|
@@ -699,15 +729,21 @@ function buildPlan(normalized, options2, rawNodeIds = /* @__PURE__ */ new Set(),
|
|
|
699
729
|
}
|
|
700
730
|
function connectionsByName(connectionNames, definition) {
|
|
701
731
|
const out = {};
|
|
732
|
+
const ambiguous = ambiguousConnectionNames(connectionNames);
|
|
702
733
|
const data = isRecord(definition["data"]) ? definition["data"] : {};
|
|
703
734
|
for (const node of Array.isArray(data["nodes"]) ? data["nodes"] : []) {
|
|
704
735
|
const args = isRecord(node) && isRecord(node["args"]) ? node["args"] : void 0;
|
|
705
736
|
for (const ref of Array.isArray(args?.["connections"]) ? args["connections"] : []) {
|
|
706
737
|
if (!isRecord(ref) || typeof ref["connectionId"] !== "string" || typeof ref["adapter"] !== "string")
|
|
707
738
|
continue;
|
|
708
|
-
const
|
|
709
|
-
|
|
710
|
-
|
|
739
|
+
const id = ref["connectionId"];
|
|
740
|
+
const name = Object.hasOwn(connectionNames, id) ? connectionNames[id] : void 0;
|
|
741
|
+
if (name === void 0 || ambiguous.has(name)) continue;
|
|
742
|
+
const previous = Object.hasOwn(out, name) ? out[name] : void 0;
|
|
743
|
+
if (previous && previous.adapter !== ref["adapter"]) {
|
|
744
|
+
ambiguous.add(name);
|
|
745
|
+
delete out[name];
|
|
746
|
+
} else setOwn(out, name, { connectionId: id, adapter: ref["adapter"] });
|
|
711
747
|
}
|
|
712
748
|
}
|
|
713
749
|
return out;
|
|
@@ -1090,7 +1126,7 @@ function layoutOf(reference) {
|
|
|
1090
1126
|
for (const node of Array.isArray(data["nodes"]) ? data["nodes"] : []) {
|
|
1091
1127
|
if (!isRecord(node) || typeof node["id"] !== "string" || !isRecord(node["position"])) continue;
|
|
1092
1128
|
const { x, y } = node["position"];
|
|
1093
|
-
if (typeof x === "number" && typeof y === "number") positions
|
|
1129
|
+
if (typeof x === "number" && typeof y === "number") setOwn(positions, node["id"], { x, y });
|
|
1094
1130
|
}
|
|
1095
1131
|
const sidecar = {
|
|
1096
1132
|
format: LAYOUT_FORMAT,
|
|
@@ -1129,6 +1165,37 @@ function mismatches(reference, candidate) {
|
|
|
1129
1165
|
};
|
|
1130
1166
|
return { nodes: nodes2, edges, document: !deepEqual(strip(reference), strip(candidate)) };
|
|
1131
1167
|
}
|
|
1168
|
+
function tryRun(attempt) {
|
|
1169
|
+
try {
|
|
1170
|
+
return attempt();
|
|
1171
|
+
} catch (error) {
|
|
1172
|
+
if (error instanceof BuilderError) return void 0;
|
|
1173
|
+
throw error;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
function rejectedByBuilder(reference, run) {
|
|
1177
|
+
const nodes2 = /* @__PURE__ */ new Set();
|
|
1178
|
+
const edges = /* @__PURE__ */ new Set();
|
|
1179
|
+
const data = isRecord(reference["data"]) ? reference["data"] : {};
|
|
1180
|
+
const nodeIds = (Array.isArray(data["nodes"]) ? data["nodes"] : []).flatMap(
|
|
1181
|
+
(node) => isRecord(node) && typeof node["id"] === "string" ? [node["id"]] : []
|
|
1182
|
+
);
|
|
1183
|
+
const edgeCount = Array.isArray(data["edges"]) ? data["edges"].length : 0;
|
|
1184
|
+
const edgeIndices = Array.from({ length: edgeCount }, (_, index) => index);
|
|
1185
|
+
const allNodes = new Set(nodeIds);
|
|
1186
|
+
const allEdges = new Set(edgeIndices);
|
|
1187
|
+
for (const id of nodeIds) {
|
|
1188
|
+
const others = new Set(allNodes);
|
|
1189
|
+
others.delete(id);
|
|
1190
|
+
if (tryRun(() => run(others, allEdges)) === void 0) nodes2.add(id);
|
|
1191
|
+
}
|
|
1192
|
+
for (const index of edgeIndices) {
|
|
1193
|
+
const others = new Set(allEdges);
|
|
1194
|
+
others.delete(index);
|
|
1195
|
+
if (tryRun(() => run(allNodes, others)) === void 0) edges.add(index);
|
|
1196
|
+
}
|
|
1197
|
+
return { nodes: nodes2, edges };
|
|
1198
|
+
}
|
|
1132
1199
|
function prepareLift(definition, options2 = {}) {
|
|
1133
1200
|
const normalized = normalizeDefinition(definition);
|
|
1134
1201
|
if (!isRecord(normalized) || !isRecord(normalized["data"]))
|
|
@@ -1168,9 +1235,18 @@ function prepareLift(definition, options2 = {}) {
|
|
|
1168
1235
|
});
|
|
1169
1236
|
return { build, candidate: normalizeDefinition(candidate) };
|
|
1170
1237
|
};
|
|
1171
|
-
let
|
|
1238
|
+
let rejected = { nodes: /* @__PURE__ */ new Set(), edges: /* @__PURE__ */ new Set() };
|
|
1239
|
+
let attempt = tryRun(() => run(rejected.nodes, rejected.edges));
|
|
1240
|
+
if (attempt === void 0) {
|
|
1241
|
+
rejected = rejectedByBuilder(reference, run);
|
|
1242
|
+
attempt = run(rejected.nodes, rejected.edges);
|
|
1243
|
+
}
|
|
1172
1244
|
const first = mismatches(reference, attempt.candidate);
|
|
1173
|
-
if (first.nodes.size > 0 || first.edges.size > 0)
|
|
1245
|
+
if (first.nodes.size > 0 || first.edges.size > 0)
|
|
1246
|
+
attempt = run(
|
|
1247
|
+
/* @__PURE__ */ new Set([...rejected.nodes, ...first.nodes]),
|
|
1248
|
+
/* @__PURE__ */ new Set([...rejected.edges, ...first.edges])
|
|
1249
|
+
);
|
|
1174
1250
|
const residual = mismatches(reference, attempt.candidate);
|
|
1175
1251
|
for (const id of residual.nodes)
|
|
1176
1252
|
items.push({
|
|
@@ -1270,6 +1346,171 @@ async function liftToPython(definition, options2 = {}) {
|
|
|
1270
1346
|
}
|
|
1271
1347
|
return { files, items: prepared.items, reference: prepared.reference };
|
|
1272
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
|
+
}
|
|
1273
1514
|
|
|
1274
1515
|
// src/roundtrip/fidelity.ts
|
|
1275
1516
|
var LOSSY_KINDS = /* @__PURE__ */ new Set([
|
|
@@ -1325,4 +1566,4 @@ async function exportWorkflowCode(definition, options2) {
|
|
|
1325
1566
|
return { format: options2.format, files, fidelity, irHash: irHash(definition) };
|
|
1326
1567
|
}
|
|
1327
1568
|
|
|
1328
|
-
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 chunkCSNWNFKU_cjs = require('../chunk-CSNWNFKU.cjs');
|
|
4
|
+
require('../chunk-FMSW2HDF.cjs');
|
|
5
|
+
require('../chunk-FR7KYWRO.cjs');
|
|
6
|
+
var chunkL24YIZY7_cjs = require('../chunk-L24YIZY7.cjs');
|
|
7
|
+
require('../chunk-FQIHX7YI.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 chunkCSNWNFKU_cjs.CommandIds; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "RUNTIME_GLOBAL", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return chunkCSNWNFKU_cjs.RUNTIME_GLOBAL; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "SDK_NAME", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkCSNWNFKU_cjs.SDK_NAME; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "WorkflowExecution", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkCSNWNFKU_cjs.WorkflowExecution; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "buildWorkflowRegistry", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkCSNWNFKU_cjs.buildWorkflowRegistry; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "createWorkflowRuntime", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return chunkCSNWNFKU_cjs.createWorkflowRuntime; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "installWorkflowRuntime", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return chunkCSNWNFKU_cjs.installWorkflowRuntime; }
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "isPatchMarkerId", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return chunkCSNWNFKU_cjs.isPatchMarkerId; }
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, "isRuntimeAbi", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return chunkCSNWNFKU_cjs.isRuntimeAbi; }
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, "matchActivation", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () { return chunkCSNWNFKU_cjs.matchActivation; }
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "mismatch", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () { return chunkCSNWNFKU_cjs.mismatch; }
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(exports, "patchMarkerId", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function () { return chunkCSNWNFKU_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
|
+
});
|