@workflow/web 5.0.0-beta.3 → 5.0.0-beta.31

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 (38) hide show
  1. package/build/client/assets/arrow-up-right-UTJqZa58.js +15 -0
  2. package/build/client/assets/encryption-CLVP4klT.js +51 -0
  3. package/build/client/assets/{entry.client-BWsSsWQm.js → entry.client-Q4eUIqMI.js} +25 -25
  4. package/build/client/assets/{highlighted-body-B3W2YXNL-Be0uLJd8.js → highlighted-body-B3W2YXNL-BJU4jA-M.js} +2 -2
  5. package/build/client/assets/{home-Ce97yLJ7.js → home-1xisMAzt.js} +1704 -257
  6. package/build/client/assets/index-HqNj_XIX.js +200 -0
  7. package/build/client/assets/{index-DQa-BExo.js → index-Q81MFBxC.js} +26 -26
  8. package/build/client/assets/index-STTN0-2V.js +306 -0
  9. package/build/client/assets/manifest-37d4814f.js +1 -0
  10. package/build/client/assets/{mermaid-3ZIDBTTL-BSJR0c5A.js → mermaid-3ZIDBTTL-BxUZpfmG.js} +4914 -3226
  11. package/build/client/assets/mermaid-3ZIDBTTL-DDxQhcP4.css +1 -0
  12. package/build/client/assets/root-CQggqXow.css +1 -0
  13. package/build/client/assets/{root-DdOfCnSG.js → root-mjlqO83r.js} +5 -15
  14. package/build/client/assets/run-detail-CWoGxu_0.css +1 -0
  15. package/build/client/assets/{run-detail-JQ32aJru.js → run-detail-ysogMwZA.js} +1811 -1014
  16. package/build/client/assets/server-build-C5ehvmav.css +1 -0
  17. package/build/client/assets/{workflow-graph-viewer-DYhMo9jl.js → workflow-graph-viewer-DpvUticH.js} +5093 -5076
  18. package/build/client/assets/zstd-B5R2yJjB.wasm +0 -0
  19. package/build/client/assets/zstd-browser-decoder-BFS0fmpR.js +27 -0
  20. package/build/server/assets/{app-Bh_7yjpl.js → app-BgN_e9S7.js} +48 -44
  21. package/build/server/assets/{highlighted-body-B3W2YXNL-Cdb-ypB4.js → highlighted-body-B3W2YXNL-CsR2wqX2.js} +10 -7
  22. package/build/server/assets/index-BbpsBsGO.js +132 -0
  23. package/build/server/assets/index-BfLBLRRi.js +204 -0
  24. package/build/server/assets/index-DIXsjgfZ.js +1121 -0
  25. package/build/server/assets/{index-meg9qk8y.js → index-Dq5jTBN4.js} +4 -0
  26. package/build/server/assets/{mermaid-3ZIDBTTL-CE8Volk5.js → mermaid-3ZIDBTTL-B-ddv9lk.js} +10 -7
  27. package/build/server/assets/{server-build-DztRAoMd.js → server-build-CQLvkWL5.js} +55524 -47343
  28. package/build/server/assets/{token-DMEdoEUo.js → token-Batv2rdg.js} +6 -2
  29. package/build/server/assets/{token-util-DsMisyo3.js → token-util-C03rrkmJ.js} +6 -2
  30. package/build/server/assets/zstd-browser-decoder-vLGtEQW6.js +68 -0
  31. package/build/server/index.js +5 -1
  32. package/package.json +14 -11
  33. package/build/client/assets/encryption-80GMP4r0.js +0 -26
  34. package/build/client/assets/manifest-923d96a0.js +0 -1
  35. package/build/client/assets/mermaid-3ZIDBTTL-DKxHcEOp.css +0 -1
  36. package/build/client/assets/root-DXDFWibD.css +0 -1
  37. package/build/client/assets/server-build-pZ5ucXET.css +0 -1
  38. package/build/server/assets/index-CNvEtg5c.js +0 -82
@@ -0,0 +1,27 @@
1
+ import { r as registerZstdDecoder, _ as __vitePreload } from "./mermaid-3ZIDBTTL-BxUZpfmG.js";
2
+ import "./index-Q81MFBxC.js";
3
+ let registered = false;
4
+ let modulePromise;
5
+ function loadWasmModule() {
6
+ if (!modulePromise) {
7
+ const url = new URL("/assets/zstd-B5R2yJjB.wasm", import.meta.url);
8
+ modulePromise = fetch(url).then((res) => res.arrayBuffer()).then((bytes) => WebAssembly.compile(bytes));
9
+ }
10
+ return modulePromise;
11
+ }
12
+ function ensureZstdDecoderRegistered() {
13
+ if (registered)
14
+ return;
15
+ registered = true;
16
+ registerZstdDecoder(async (payload) => {
17
+ const { decompressBytes } = await __vitePreload(async () => {
18
+ const { decompressBytes: decompressBytes2 } = await import("./index-HqNj_XIX.js");
19
+ return { decompressBytes: decompressBytes2 };
20
+ }, true ? [] : void 0);
21
+ const wasmModule = await loadWasmModule();
22
+ return decompressBytes(wasmModule, payload);
23
+ });
24
+ }
25
+ export {
26
+ ensureZstdDecoderRegistered
27
+ };
@@ -1,6 +1,10 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { createRequire as __wkfCreateRequire } from "node:module";
5
+ if (typeof require === "undefined") {
6
+ globalThis.require = __wkfCreateRequire(import.meta.url);
7
+ }
4
8
  import { Stream } from "stream";
5
9
  import express from "express";
6
10
  function _mergeNamespaces(n, m) {
@@ -481,7 +485,7 @@ var hasRequiredReact_development;
481
485
  function requireReact_development() {
482
486
  if (hasRequiredReact_development) return react_development.exports;
483
487
  hasRequiredReact_development = 1;
484
- (function(module, exports$1) {
488
+ (function(module, exports) {
485
489
  "production" !== process.env.NODE_ENV && (function() {
486
490
  function defineDeprecationWarning(methodName, info) {
487
491
  Object.defineProperty(Component.prototype, methodName, {
@@ -1021,7 +1025,7 @@ function requireReact_development() {
1021
1025
  return resolveDispatcher().useMemoCache(size);
1022
1026
  }
1023
1027
  });
1024
- exports$1.Children = {
1028
+ exports.Children = {
1025
1029
  map: mapChildren,
1026
1030
  forEach: function(children, forEachFunc, forEachContext) {
1027
1031
  mapChildren(
@@ -1052,15 +1056,15 @@ function requireReact_development() {
1052
1056
  return children;
1053
1057
  }
1054
1058
  };
1055
- exports$1.Component = Component;
1056
- exports$1.Fragment = REACT_FRAGMENT_TYPE;
1057
- exports$1.Profiler = REACT_PROFILER_TYPE;
1058
- exports$1.PureComponent = PureComponent;
1059
- exports$1.StrictMode = REACT_STRICT_MODE_TYPE;
1060
- exports$1.Suspense = REACT_SUSPENSE_TYPE;
1061
- exports$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1062
- exports$1.__COMPILER_RUNTIME = deprecatedAPIs;
1063
- exports$1.act = function(callback) {
1059
+ exports.Component = Component;
1060
+ exports.Fragment = REACT_FRAGMENT_TYPE;
1061
+ exports.Profiler = REACT_PROFILER_TYPE;
1062
+ exports.PureComponent = PureComponent;
1063
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
1064
+ exports.Suspense = REACT_SUSPENSE_TYPE;
1065
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1066
+ exports.__COMPILER_RUNTIME = deprecatedAPIs;
1067
+ exports.act = function(callback) {
1064
1068
  var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
1065
1069
  actScopeDepth++;
1066
1070
  var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
@@ -1137,16 +1141,16 @@ function requireReact_development() {
1137
1141
  }
1138
1142
  };
1139
1143
  };
1140
- exports$1.cache = function(fn) {
1144
+ exports.cache = function(fn) {
1141
1145
  return function() {
1142
1146
  return fn.apply(null, arguments);
1143
1147
  };
1144
1148
  };
1145
- exports$1.captureOwnerStack = function() {
1149
+ exports.captureOwnerStack = function() {
1146
1150
  var getCurrentStack = ReactSharedInternals.getCurrentStack;
1147
1151
  return null === getCurrentStack ? null : getCurrentStack();
1148
1152
  };
1149
- exports$1.cloneElement = function(element, config, children) {
1153
+ exports.cloneElement = function(element, config, children) {
1150
1154
  if (null === element || void 0 === element)
1151
1155
  throw Error(
1152
1156
  "The argument must be a React element, but you passed " + element + "."
@@ -1191,7 +1195,7 @@ function requireReact_development() {
1191
1195
  owner = arguments[key], isValidElement(owner) && owner._store && (owner._store.validated = 1);
1192
1196
  return props;
1193
1197
  };
1194
- exports$1.createContext = function(defaultValue) {
1198
+ exports.createContext = function(defaultValue) {
1195
1199
  defaultValue = {
1196
1200
  $$typeof: REACT_CONTEXT_TYPE,
1197
1201
  _currentValue: defaultValue,
@@ -1209,7 +1213,7 @@ function requireReact_development() {
1209
1213
  defaultValue._currentRenderer2 = null;
1210
1214
  return defaultValue;
1211
1215
  };
1212
- exports$1.createElement = function(type, config, children) {
1216
+ exports.createElement = function(type, config, children) {
1213
1217
  for (var i = 2; i < arguments.length; i++) {
1214
1218
  var node = arguments[i];
1215
1219
  isValidElement(node) && node._store && (node._store.validated = 1);
@@ -1248,12 +1252,12 @@ function requireReact_development() {
1248
1252
  propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1249
1253
  );
1250
1254
  };
1251
- exports$1.createRef = function() {
1255
+ exports.createRef = function() {
1252
1256
  var refObject = { current: null };
1253
1257
  Object.seal(refObject);
1254
1258
  return refObject;
1255
1259
  };
1256
- exports$1.forwardRef = function(render) {
1260
+ exports.forwardRef = function(render) {
1257
1261
  null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
1258
1262
  "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1259
1263
  ) : "function" !== typeof render ? console.error(
@@ -1280,15 +1284,15 @@ function requireReact_development() {
1280
1284
  });
1281
1285
  return elementType;
1282
1286
  };
1283
- exports$1.isValidElement = isValidElement;
1284
- exports$1.lazy = function(ctor) {
1287
+ exports.isValidElement = isValidElement;
1288
+ exports.lazy = function(ctor) {
1285
1289
  return {
1286
1290
  $$typeof: REACT_LAZY_TYPE,
1287
1291
  _payload: { _status: -1, _result: ctor },
1288
1292
  _init: lazyInitializer
1289
1293
  };
1290
1294
  };
1291
- exports$1.memo = function(type, compare) {
1295
+ exports.memo = function(type, compare) {
1292
1296
  null == type && console.error(
1293
1297
  "memo: The first argument must be a component. Instead received: %s",
1294
1298
  null === type ? "null" : typeof type
@@ -1312,7 +1316,7 @@ function requireReact_development() {
1312
1316
  });
1313
1317
  return compare;
1314
1318
  };
1315
- exports$1.startTransition = function(scope) {
1319
+ exports.startTransition = function(scope) {
1316
1320
  var prevTransition = ReactSharedInternals.T, currentTransition = {};
1317
1321
  ReactSharedInternals.T = currentTransition;
1318
1322
  currentTransition._updatedFibers = /* @__PURE__ */ new Set();
@@ -1328,36 +1332,36 @@ function requireReact_development() {
1328
1332
  )), ReactSharedInternals.T = prevTransition;
1329
1333
  }
1330
1334
  };
1331
- exports$1.unstable_useCacheRefresh = function() {
1335
+ exports.unstable_useCacheRefresh = function() {
1332
1336
  return resolveDispatcher().useCacheRefresh();
1333
1337
  };
1334
- exports$1.use = function(usable) {
1338
+ exports.use = function(usable) {
1335
1339
  return resolveDispatcher().use(usable);
1336
1340
  };
1337
- exports$1.useActionState = function(action, initialState, permalink) {
1341
+ exports.useActionState = function(action, initialState, permalink) {
1338
1342
  return resolveDispatcher().useActionState(
1339
1343
  action,
1340
1344
  initialState,
1341
1345
  permalink
1342
1346
  );
1343
1347
  };
1344
- exports$1.useCallback = function(callback, deps) {
1348
+ exports.useCallback = function(callback, deps) {
1345
1349
  return resolveDispatcher().useCallback(callback, deps);
1346
1350
  };
1347
- exports$1.useContext = function(Context) {
1351
+ exports.useContext = function(Context) {
1348
1352
  var dispatcher = resolveDispatcher();
1349
1353
  Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
1350
1354
  "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1351
1355
  );
1352
1356
  return dispatcher.useContext(Context);
1353
1357
  };
1354
- exports$1.useDebugValue = function(value, formatterFn) {
1358
+ exports.useDebugValue = function(value, formatterFn) {
1355
1359
  return resolveDispatcher().useDebugValue(value, formatterFn);
1356
1360
  };
1357
- exports$1.useDeferredValue = function(value, initialValue) {
1361
+ exports.useDeferredValue = function(value, initialValue) {
1358
1362
  return resolveDispatcher().useDeferredValue(value, initialValue);
1359
1363
  };
1360
- exports$1.useEffect = function(create, createDeps, update) {
1364
+ exports.useEffect = function(create, createDeps, update) {
1361
1365
  null == create && console.warn(
1362
1366
  "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1363
1367
  );
@@ -1368,50 +1372,50 @@ function requireReact_development() {
1368
1372
  );
1369
1373
  return dispatcher.useEffect(create, createDeps);
1370
1374
  };
1371
- exports$1.useId = function() {
1375
+ exports.useId = function() {
1372
1376
  return resolveDispatcher().useId();
1373
1377
  };
1374
- exports$1.useImperativeHandle = function(ref, create, deps) {
1378
+ exports.useImperativeHandle = function(ref, create, deps) {
1375
1379
  return resolveDispatcher().useImperativeHandle(ref, create, deps);
1376
1380
  };
1377
- exports$1.useInsertionEffect = function(create, deps) {
1381
+ exports.useInsertionEffect = function(create, deps) {
1378
1382
  null == create && console.warn(
1379
1383
  "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1380
1384
  );
1381
1385
  return resolveDispatcher().useInsertionEffect(create, deps);
1382
1386
  };
1383
- exports$1.useLayoutEffect = function(create, deps) {
1387
+ exports.useLayoutEffect = function(create, deps) {
1384
1388
  null == create && console.warn(
1385
1389
  "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1386
1390
  );
1387
1391
  return resolveDispatcher().useLayoutEffect(create, deps);
1388
1392
  };
1389
- exports$1.useMemo = function(create, deps) {
1393
+ exports.useMemo = function(create, deps) {
1390
1394
  return resolveDispatcher().useMemo(create, deps);
1391
1395
  };
1392
- exports$1.useOptimistic = function(passthrough, reducer) {
1396
+ exports.useOptimistic = function(passthrough, reducer) {
1393
1397
  return resolveDispatcher().useOptimistic(passthrough, reducer);
1394
1398
  };
1395
- exports$1.useReducer = function(reducer, initialArg, init) {
1399
+ exports.useReducer = function(reducer, initialArg, init) {
1396
1400
  return resolveDispatcher().useReducer(reducer, initialArg, init);
1397
1401
  };
1398
- exports$1.useRef = function(initialValue) {
1402
+ exports.useRef = function(initialValue) {
1399
1403
  return resolveDispatcher().useRef(initialValue);
1400
1404
  };
1401
- exports$1.useState = function(initialState) {
1405
+ exports.useState = function(initialState) {
1402
1406
  return resolveDispatcher().useState(initialState);
1403
1407
  };
1404
- exports$1.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1408
+ exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1405
1409
  return resolveDispatcher().useSyncExternalStore(
1406
1410
  subscribe,
1407
1411
  getSnapshot,
1408
1412
  getServerSnapshot
1409
1413
  );
1410
1414
  };
1411
- exports$1.useTransition = function() {
1415
+ exports.useTransition = function() {
1412
1416
  return resolveDispatcher().useTransition();
1413
1417
  };
1414
- exports$1.version = "19.1.0";
1418
+ exports.version = "19.1.0";
1415
1419
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1416
1420
  })();
1417
1421
  })(react_development, react_development.exports);
@@ -9174,9 +9178,9 @@ async function sendRemixResponse(res, nodeResponse) {
9174
9178
  }
9175
9179
  const app = express();
9176
9180
  app.all(
9177
- "*",
9181
+ "/{*splat}",
9178
9182
  createRequestHandler({
9179
- build: () => import("./server-build-DztRAoMd.js").then((n) => n.G)
9183
+ build: () => import("./server-build-CQLvkWL5.js").then((n) => n.aB)
9180
9184
  })
9181
9185
  );
9182
9186
  app.use(
@@ -1,5 +1,9 @@
1
- import { y as R, K as Ks, z as jsxRuntimeExports, A as Qe } from "./server-build-DztRAoMd.js";
2
- import { r as reactExports } from "./app-Bh_7yjpl.js";
1
+ import { createRequire as __wkfCreateRequire } from "node:module";
2
+ if (typeof require === "undefined") {
3
+ globalThis.require = __wkfCreateRequire(import.meta.url);
4
+ }
5
+ import { au as R, av as Ks, aw as jsxRuntimeExports, ax as Qe } from "./server-build-CQLvkWL5.js";
6
+ import { r as reactExports } from "./app-BgN_e9S7.js";
3
7
  import "node:stream";
4
8
  import "util";
5
9
  import "crypto";
@@ -11,12 +15,12 @@ import "node:path";
11
15
  import "node:url";
12
16
  import "module";
13
17
  import "node:fs/promises";
14
- import "tty";
15
- import "os";
16
18
  import "node:module";
19
+ import "node:util";
20
+ import "node:async_hooks";
21
+ import "node:os";
17
22
  import "node:fs";
18
23
  import "node:child_process";
19
- import "node:util";
20
24
  import "node:timers/promises";
21
25
  import "events";
22
26
  import "node:assert";
@@ -32,13 +36,12 @@ import "node:perf_hooks";
32
36
  import "node:util/types";
33
37
  import "node:sqlite";
34
38
  import "node:worker_threads";
35
- import "node:async_hooks";
36
39
  import "node:console";
37
40
  import "node:timers";
38
41
  import "node:dns";
39
42
  import "path";
40
43
  import "fs";
41
- import "node:os";
44
+ import "os";
42
45
  import "net";
43
46
  import "express";
44
47
  var L = ({ code: s, language: t, raw: e, className: n, ...d$1 }) => {
@@ -0,0 +1,132 @@
1
+ import { createRequire as __wkfCreateRequire } from "node:module";
2
+ if (typeof require === "undefined") {
3
+ globalThis.require = __wkfCreateRequire(import.meta.url);
4
+ }
5
+ import { H as HookSchema } from "./server-build-CQLvkWL5.js";
6
+ import { A, a, b, c, d, e, f, g, h, i, j, B, C, D, k, E, l, m, n, o, p, q, r, L, M, P, Q, s, R, t, S, u, v, w, x, y, z, F, G, I, T, J, K, O, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at } from "./server-build-CQLvkWL5.js";
7
+ import "./app-BgN_e9S7.js";
8
+ import "stream";
9
+ import "express";
10
+ import "node:stream";
11
+ import "util";
12
+ import "crypto";
13
+ import "async_hooks";
14
+ import "node:crypto";
15
+ import "node:process";
16
+ import "node:path";
17
+ import "node:url";
18
+ import "module";
19
+ import "node:fs/promises";
20
+ import "node:module";
21
+ import "node:util";
22
+ import "node:async_hooks";
23
+ import "node:os";
24
+ import "node:fs";
25
+ import "node:child_process";
26
+ import "node:timers/promises";
27
+ import "events";
28
+ import "node:assert";
29
+ import "node:net";
30
+ import "node:http";
31
+ import "node:querystring";
32
+ import "node:events";
33
+ import "node:diagnostics_channel";
34
+ import "node:tls";
35
+ import "node:buffer";
36
+ import "node:zlib";
37
+ import "node:perf_hooks";
38
+ import "node:util/types";
39
+ import "node:sqlite";
40
+ import "node:worker_threads";
41
+ import "node:console";
42
+ import "node:timers";
43
+ import "node:dns";
44
+ import "path";
45
+ import "fs";
46
+ import "os";
47
+ import "net";
48
+ export {
49
+ A as ATTRIBUTE_KEY_MAX_LENGTH,
50
+ a as ATTRIBUTE_MAX_PER_RUN,
51
+ b as ATTRIBUTE_VALUE_MAX_BYTES,
52
+ c as AnalyticsEventSchema,
53
+ d as AnalyticsHookSchema,
54
+ e as AnalyticsRunSchema,
55
+ f as AnalyticsStepSchema,
56
+ g as AnalyticsWaitSchema,
57
+ h as AttributeChangeSchema,
58
+ i as AttributeChangesSchema,
59
+ j as AttributeValidationError,
60
+ B as BaseEventSchema,
61
+ C as CHILD_ENTITY_CREATION_EVENT_TYPES,
62
+ D as DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS,
63
+ k as DEFAULT_TIMESTAMP_THRESHOLD_PAST_MS,
64
+ E as EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE,
65
+ l as EVENT_DATA_REF_FIELDS,
66
+ m as EventSchema,
67
+ n as EventTypeSchema,
68
+ o as HOOK_EVENTS_REQUIRING_EXISTENCE,
69
+ p as HOOK_LIFECYCLE_EVENT_TYPES,
70
+ q as HealthCheckPayloadSchema,
71
+ r as HookCreatedEventSchema,
72
+ HookSchema,
73
+ L as LegacySerializedDataSchemaV1,
74
+ M as MessageId,
75
+ P as PaginatedResponseSchema,
76
+ Q as QueuePayloadSchema,
77
+ s as QueuePrefix,
78
+ R as RESERVED_ATTRIBUTE_KEY_PREFIX,
79
+ t as RunInputSchema,
80
+ S as SPEC_VERSION_CURRENT,
81
+ u as SPEC_VERSION_LEGACY,
82
+ v as SPEC_VERSION_SUPPORTS_ATTRIBUTES,
83
+ w as SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT,
84
+ x as SPEC_VERSION_SUPPORTS_COMPRESSION,
85
+ y as STEP_EVENT_TYPES,
86
+ z as SerializedDataSchema,
87
+ F as StepInvokePayloadSchema,
88
+ G as StepSchema,
89
+ I as StepStatusSchema,
90
+ T as TERMINAL_RUN_EVENT_TYPES,
91
+ J as TERMINAL_STEP_EVENT_TYPES,
92
+ K as TERMINAL_STEP_STATUSES,
93
+ O as TERMINAL_WORKFLOW_RUN_STATUSES,
94
+ U as TerminalRunEventTypeSchema,
95
+ V as TerminalStepStatusSchema,
96
+ W as TerminalWorkflowRunStatusSchema,
97
+ X as ValidQueueName,
98
+ Y as WAIT_EVENT_TYPES,
99
+ Z as WaitSchema,
100
+ _ as WaitStatusSchema,
101
+ $ as WorkflowInvokePayloadSchema,
102
+ a0 as WorkflowRunBaseSchema,
103
+ a1 as WorkflowRunSchema,
104
+ a2 as WorkflowRunStatusSchema,
105
+ a3 as applyAttributeChanges,
106
+ a4 as envNumber,
107
+ a5 as getEventDataPayloadField,
108
+ a6 as getEventDataRefFields,
109
+ a7 as getQueueTopicPrefix,
110
+ a8 as isChildEntityCreationEvent,
111
+ a9 as isChildEntityCreationEventType,
112
+ aa as isHookEventRequiringExistence,
113
+ ab as isHookLifecycleEventType,
114
+ ac as isLegacySpecVersion,
115
+ ad as isStepEventType,
116
+ ae as isTerminalRunEventType,
117
+ af as isTerminalStepEventType,
118
+ ag as isTerminalStepStatus,
119
+ ah as isTerminalWorkflowRunStatus,
120
+ ai as isWaitEventType,
121
+ aj as parseQueueName,
122
+ ak as reenqueueActiveRuns,
123
+ al as requiresNewerWorld,
124
+ am as resolveQueueNamespace,
125
+ an as stripEventDataRefs,
126
+ ao as ulidToDate,
127
+ ap as validateAttributeChanges,
128
+ aq as validateAttributeKey,
129
+ ar as validateAttributeValue,
130
+ as as validateUlidTimestamp,
131
+ at as workflowRunIdSchema
132
+ };
@@ -0,0 +1,204 @@
1
+ import { createRequire as __wkfCreateRequire } from "node:module";
2
+ if (typeof require === "undefined") {
3
+ globalThis.require = __wkfCreateRequire(import.meta.url);
4
+ }
5
+ const compiledCache = /* @__PURE__ */ new WeakMap();
6
+ async function compileSource(source) {
7
+ const resolved = await source;
8
+ if (resolved instanceof WebAssembly.Module)
9
+ return resolved;
10
+ const buf = resolved;
11
+ const cacheKey = buf.buffer instanceof ArrayBuffer ? buf.buffer : buf;
12
+ const cached = compiledCache.get(cacheKey);
13
+ if (cached)
14
+ return cached;
15
+ const compiled = await WebAssembly.compile(buf);
16
+ compiledCache.set(cacheKey, compiled);
17
+ return compiled;
18
+ }
19
+ const BUF_LAYOUT = {
20
+ src: 0,
21
+ srcSize: 4,
22
+ srcPos: 8,
23
+ dst: 12,
24
+ dstSize: 16,
25
+ dstPos: 20,
26
+ SIZE: 24
27
+ };
28
+ function readCString(memory, ptr) {
29
+ const bytes = new Uint8Array(memory.buffer, ptr);
30
+ let end = 0;
31
+ while (bytes[end] !== 0 && end < bytes.length)
32
+ end++;
33
+ return new TextDecoder().decode(bytes.subarray(0, end));
34
+ }
35
+ class ZstdDecoder {
36
+ constructor(exports, dctxPtr, inPtr, inCap, outPtr, outCap, bufPtr) {
37
+ this.exports = exports;
38
+ this.dctxPtr = dctxPtr;
39
+ this.inPtr = inPtr;
40
+ this.inCap = inCap;
41
+ this.outPtr = outPtr;
42
+ this.outCap = outCap;
43
+ this.bufPtr = bufPtr;
44
+ }
45
+ /**
46
+ * Compile the bundled `zstd.wasm` (or a pre-compiled module) and
47
+ * return a ready-to-use `ZstdDecoder`.
48
+ */
49
+ static async create(wasm) {
50
+ const module = await compileSource(wasm);
51
+ const instance = await WebAssembly.instantiate(module, {});
52
+ const exports = instance.exports;
53
+ const dctxPtr = exports.dctx_new();
54
+ if (!dctxPtr)
55
+ throw new Error("zstd: failed to allocate decompression context");
56
+ const inCap = exports.dstream_in_size();
57
+ const outCap = exports.dstream_out_size();
58
+ const inPtr = exports.zstd_malloc(inCap);
59
+ const outPtr = exports.zstd_malloc(outCap);
60
+ const bufPtr = exports.zstd_malloc(BUF_LAYOUT.SIZE);
61
+ if (!inPtr || !outPtr || !bufPtr) {
62
+ throw new Error("zstd: failed to allocate streaming buffers");
63
+ }
64
+ return new ZstdDecoder(exports, dctxPtr, inPtr, inCap, outPtr, outCap, bufPtr);
65
+ }
66
+ dispose() {
67
+ if (!this.dctxPtr)
68
+ return;
69
+ const e = this.exports;
70
+ e.dctx_free(this.dctxPtr);
71
+ e.zstd_free(this.inPtr);
72
+ e.zstd_free(this.outPtr);
73
+ e.zstd_free(this.bufPtr);
74
+ this.dctxPtr = 0;
75
+ }
76
+ /**
77
+ * Get a fresh `Uint8Array` view of WASM linear memory.
78
+ *
79
+ * IMPORTANT: any call into WASM may grow `memory.buffer`, which
80
+ * detaches all existing `ArrayBuffer`-backed views. Always
81
+ * re-acquire views from this getter (and `bufView`) AFTER each
82
+ * WASM call rather than caching them.
83
+ */
84
+ get heap() {
85
+ return new Uint8Array(this.exports.memory.buffer);
86
+ }
87
+ get bufView() {
88
+ return new DataView(this.exports.memory.buffer, this.bufPtr, BUF_LAYOUT.SIZE);
89
+ }
90
+ checkError(ret) {
91
+ if (this.exports.is_error(ret) !== 0) {
92
+ const name = readCString(this.exports.memory, this.exports.get_error_name(ret));
93
+ throw new Error(`zstd: ${name} (code ${ret})`);
94
+ }
95
+ }
96
+ /**
97
+ * Feed `chunk` to the decoder and pull out as much decoded data
98
+ * as fits in our output buffer. Calls `onOutput` zero or more
99
+ * times with non-empty `Uint8Array` slices into the WASM memory.
100
+ *
101
+ * IMPORTANT: the slices passed to `onOutput` are views into WASM
102
+ * memory and are only valid until the next decoder call. Callers
103
+ * that need to keep the data must copy it (`.slice()` or
104
+ * `.set()` into their own buffer).
105
+ */
106
+ push(chunk, onOutput) {
107
+ const e = this.exports;
108
+ let chunkOffset = 0;
109
+ while (chunkOffset < chunk.length) {
110
+ const copyLen = Math.min(chunk.length - chunkOffset, this.inCap);
111
+ this.heap.set(chunk.subarray(chunkOffset, chunkOffset + copyLen), this.inPtr);
112
+ chunkOffset += copyLen;
113
+ let srcPos = 0;
114
+ while (srcPos < copyLen) {
115
+ let view = this.bufView;
116
+ view.setUint32(BUF_LAYOUT.src, this.inPtr, true);
117
+ view.setUint32(BUF_LAYOUT.srcSize, copyLen, true);
118
+ view.setUint32(BUF_LAYOUT.srcPos, srcPos, true);
119
+ view.setUint32(BUF_LAYOUT.dst, this.outPtr, true);
120
+ view.setUint32(BUF_LAYOUT.dstSize, this.outCap, true);
121
+ view.setUint32(BUF_LAYOUT.dstPos, 0, true);
122
+ const ret = e.decompress_stream(this.dctxPtr, this.bufPtr);
123
+ this.checkError(ret);
124
+ view = this.bufView;
125
+ const dstPos = view.getUint32(BUF_LAYOUT.dstPos, true);
126
+ if (dstPos > 0) {
127
+ onOutput(this.heap.subarray(this.outPtr, this.outPtr + dstPos));
128
+ }
129
+ const newSrcPos = view.getUint32(BUF_LAYOUT.srcPos, true);
130
+ if (newSrcPos === srcPos && dstPos === 0) {
131
+ throw new Error("zstd: decoder made no progress");
132
+ }
133
+ srcPos = newSrcPos;
134
+ if (ret === 0 && srcPos === copyLen)
135
+ break;
136
+ }
137
+ }
138
+ }
139
+ /**
140
+ * Decompress an entire compressed buffer in one shot. Convenient
141
+ * for small inputs; large inputs should prefer
142
+ * `ZstdDecompressStream` to avoid buffering everything in memory.
143
+ */
144
+ decode(compressed) {
145
+ const out = [];
146
+ let total = 0;
147
+ this.push(compressed, (chunk) => {
148
+ const copy = new Uint8Array(chunk);
149
+ out.push(copy);
150
+ total += copy.length;
151
+ });
152
+ const result = new Uint8Array(total);
153
+ let off = 0;
154
+ for (const c of out) {
155
+ result.set(c, off);
156
+ off += c.length;
157
+ }
158
+ return result;
159
+ }
160
+ }
161
+ class ZstdDecompressStream extends TransformStream {
162
+ constructor(wasm) {
163
+ let decoderPromise = null;
164
+ const getDecoder = () => {
165
+ if (!decoderPromise)
166
+ decoderPromise = ZstdDecoder.create(wasm);
167
+ return decoderPromise;
168
+ };
169
+ super({
170
+ async transform(chunk, controller) {
171
+ try {
172
+ const dec = await getDecoder();
173
+ dec.push(chunk, (out) => {
174
+ controller.enqueue(new Uint8Array(out));
175
+ });
176
+ } catch (err) {
177
+ controller.error(err);
178
+ }
179
+ },
180
+ async flush() {
181
+ if (decoderPromise) {
182
+ try {
183
+ const dec = await decoderPromise;
184
+ dec.dispose();
185
+ } catch {
186
+ }
187
+ }
188
+ }
189
+ });
190
+ }
191
+ }
192
+ async function decompressBytes(wasm, compressed) {
193
+ const dec = await ZstdDecoder.create(wasm);
194
+ try {
195
+ return dec.decode(compressed);
196
+ } finally {
197
+ dec.dispose();
198
+ }
199
+ }
200
+ export {
201
+ ZstdDecoder,
202
+ ZstdDecompressStream,
203
+ decompressBytes
204
+ };