@workflow/web 5.0.0-beta.2 → 5.0.0-beta.20

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 (36) hide show
  1. package/build/client/assets/encryption-g14N5vQl.js +51 -0
  2. package/build/client/assets/{entry.client-BWsSsWQm.js → entry.client-DOJDY_4b.js} +1 -1
  3. package/build/client/assets/{highlighted-body-B3W2YXNL-DPWdt39H.js → highlighted-body-B3W2YXNL-LmACipCR.js} +2 -2
  4. package/build/client/assets/{home-OcN-ARTU.js → home-B-QPEXVb.js} +4 -13
  5. package/build/client/assets/index-B6-SzLmT.js +308 -0
  6. package/build/client/assets/{index-DQa-BExo.js → index-BXZSIDEp.js} +19 -19
  7. package/build/client/assets/index-C7C6cDW5.js +200 -0
  8. package/build/client/assets/manifest-225d97da.js +1 -0
  9. package/build/client/assets/mermaid-3ZIDBTTL-DDxQhcP4.css +1 -0
  10. package/build/client/assets/{mermaid-3ZIDBTTL-B9v3aKRl.js → mermaid-3ZIDBTTL-DndzaIEl.js} +4485 -2957
  11. package/build/client/assets/{root-ClRrWHkX.js → root--Sg25-Lb.js} +2 -2
  12. package/build/client/assets/root-1hd8ZXAx.css +1 -0
  13. package/build/client/assets/{run-detail-BdYMODbi.js → run-detail-Djwnox1v.js} +2614 -3527
  14. package/build/client/assets/server-build-DixvNjKe.css +1 -0
  15. package/build/client/assets/{workflow-graph-viewer-yls6qlc0.css → workflow-graph-viewer-DnlNuQQH.css} +1 -1
  16. package/build/client/assets/{workflow-graph-viewer-BdFIMYrh.js → workflow-graph-viewer-j7J3_oSH.js} +4921 -4920
  17. package/build/client/assets/zstd-B5R2yJjB.wasm +0 -0
  18. package/build/client/assets/zstd-browser-decoder-DGiXPDxR.js +27 -0
  19. package/build/server/assets/{app-coxrYAYu.js → app-1_2pZk38.js} +2 -2
  20. package/build/server/assets/{highlighted-body-B3W2YXNL-DhGWas67.js → highlighted-body-B3W2YXNL-D2HzMi-f.js} +5 -6
  21. package/build/server/assets/index-B8YoYr9f.js +1117 -0
  22. package/build/server/assets/index-C7C6cDW5.js +200 -0
  23. package/build/server/assets/index-CVx-QxTu.js +96 -0
  24. package/build/server/assets/{mermaid-3ZIDBTTL-DJkW_cc4.js → mermaid-3ZIDBTTL-BhD6Cf7K.js} +5 -6
  25. package/build/server/assets/{server-build-dCNkWo2d.js → server-build-BSWGuT66.js} +72842 -69560
  26. package/build/server/assets/{token-Bi1ru9oe.js → token-C-jXTIrz.js} +2 -2
  27. package/build/server/assets/{token-util-Bwj_Mj31.js → token-util-B-DxVT99.js} +2 -2
  28. package/build/server/assets/zstd-browser-decoder-DPcDXhvm.js +64 -0
  29. package/build/server/index.js +1 -1
  30. package/package.json +11 -10
  31. package/build/client/assets/encryption-80GMP4r0.js +0 -26
  32. package/build/client/assets/manifest-62352cd9.js +0 -1
  33. package/build/client/assets/mermaid-3ZIDBTTL-DKxHcEOp.css +0 -1
  34. package/build/client/assets/root-BrnNveEi.css +0 -1
  35. package/build/client/assets/server-build-DKWv59Tp.css +0 -1
  36. package/build/server/assets/index-DJ8Yt9MV.js +0 -82
@@ -0,0 +1,51 @@
1
+ import { W as WorkflowRuntimeError, R as RuntimeDecryptionError } from "./index-B6-SzLmT.js";
2
+ import "./index-BXZSIDEp.js";
3
+ const NONCE_LENGTH = 12;
4
+ const TAG_LENGTH = 128;
5
+ const KEY_LENGTH = 32;
6
+ async function importKey(raw, usages = ["encrypt", "decrypt"]) {
7
+ if (raw.byteLength !== KEY_LENGTH) {
8
+ throw new WorkflowRuntimeError(`Encryption key must be exactly ${KEY_LENGTH} bytes, got ${raw.byteLength}`);
9
+ }
10
+ return globalThis.crypto.subtle.importKey(
11
+ "raw",
12
+ raw,
13
+ "AES-GCM",
14
+ false,
15
+ // `KeyUsage` is a DOM-lib type that's not in scope under `es2022`.
16
+ // The `ReadonlyArray<'encrypt' | 'decrypt'>` parameter type matches
17
+ // a strict subset of `KeyUsage[]`, so this cast is sound.
18
+ usages
19
+ );
20
+ }
21
+ async function decrypt(key, data) {
22
+ const minLength = NONCE_LENGTH + TAG_LENGTH / 8;
23
+ if (data.byteLength < minLength) {
24
+ throw new RuntimeDecryptionError(`Encrypted data too short: expected at least ${minLength} bytes, got ${data.byteLength}`, {
25
+ context: {
26
+ operation: "decrypt",
27
+ byteLength: data.byteLength
28
+ }
29
+ });
30
+ }
31
+ const nonce = data.subarray(0, NONCE_LENGTH);
32
+ const ciphertext = data.subarray(NONCE_LENGTH);
33
+ let plaintext;
34
+ try {
35
+ plaintext = await globalThis.crypto.subtle.decrypt({ name: "AES-GCM", iv: nonce, tagLength: TAG_LENGTH }, key, ciphertext);
36
+ } catch (cause) {
37
+ const causeMsg = cause instanceof Error ? cause.message : String(cause);
38
+ throw new RuntimeDecryptionError(`AES-256-GCM decryption failed: ${causeMsg}`, {
39
+ cause,
40
+ context: {
41
+ operation: "decrypt",
42
+ byteLength: data.byteLength
43
+ }
44
+ });
45
+ }
46
+ return new Uint8Array(plaintext);
47
+ }
48
+ export {
49
+ decrypt,
50
+ importKey
51
+ };
@@ -1,4 +1,4 @@
1
- import { a as requireReact, b as requireReactDom, m as matchRoutes, s as shouldHydrateRouteLoader, E as ErrorResponseImpl, N as NO_BODY_STATUS_CODES, R as ReactExports, i as isRouteErrorResponse, r as reactExports, c as invariant, u as useFogOFWarDiscovery, F as FrameworkContext, d as RemixErrorBoundary, e as RouterProvider, f as reactDomExports, g as decodeViaTurboStream, h as createClientRoutes, k as createRouter, l as getPatchRoutesOnNavigationFunction, n as getTurboStreamSingleFetchDataStrategy, o as createBrowserHistory, p as createClientRoutesWithHMRRevalidationOptOut, q as mapRouteProperties, t as hydrationRouteProperties, j as jsxRuntimeExports } from "./index-DQa-BExo.js";
1
+ import { a as requireReact, b as requireReactDom, m as matchRoutes, s as shouldHydrateRouteLoader, E as ErrorResponseImpl, N as NO_BODY_STATUS_CODES, R as ReactExports, i as isRouteErrorResponse, r as reactExports, c as invariant, u as useFogOFWarDiscovery, F as FrameworkContext, d as RemixErrorBoundary, e as RouterProvider, f as reactDomExports, h as decodeViaTurboStream, k as createClientRoutes, l as createRouter, n as getPatchRoutesOnNavigationFunction, o as getTurboStreamSingleFetchDataStrategy, p as createBrowserHistory, q as createClientRoutesWithHMRRevalidationOptOut, t as mapRouteProperties, v as hydrationRouteProperties, j as jsxRuntimeExports } from "./index-BXZSIDEp.js";
2
2
  var client = { exports: {} };
3
3
  var reactDomClient_production = {};
4
4
  var scheduler = { exports: {} };
@@ -1,5 +1,5 @@
1
- import { R, K as Ks, Q as Qe } from "./mermaid-3ZIDBTTL-B9v3aKRl.js";
2
- import { r as reactExports, j as jsxRuntimeExports } from "./index-DQa-BExo.js";
1
+ import { R, K as Ks, Q as Qe } from "./mermaid-3ZIDBTTL-DndzaIEl.js";
2
+ import { r as reactExports, j as jsxRuntimeExports } from "./index-BXZSIDEp.js";
3
3
  var L = ({ code: s, language: t, raw: e, className: n, ...d$1 }) => {
4
4
  let { shikiTheme: l } = reactExports.useContext(R), o = Ks(), [m, i] = reactExports.useState(e);
5
5
  return reactExports.useEffect(() => {
@@ -1,16 +1,7 @@
1
- import { r as reactExports, C as ReactDOM, j as jsxRuntimeExports, z as Link, f as reactDomExports, B as useSearchParams, A as useNavigate, D as useLocation, w as withComponentProps } from "./index-DQa-BExo.js";
2
- import { R as ResolveHookModal, S as Send, a as Skeleton, u as unwrapOrThrow, W as WorkflowWebAPIError, b as RelativeTime, A as Alert, C as CircleAlert, c as AlertTitle, d as AlertDescription, g as getErrorMessage, e as CopyableText, D as DropdownMenu, f as DropdownMenuTrigger, E as Ellipsis, h as DropdownMenuContent, i as DropdownMenuItem, j as ChevronRight, r as resumeHook, k as createCollection, l as hideOthers, m as ReactRemoveScroll, n as useDirection, o as ChevronDown, p as ChevronUp, q as Check, X, s as useControllableState$1, P as Primitive$1, t as composeEventHandlers$1, v as Presence, w as useSize, x as createContextScope$1, y as cancelRun, z as reenqueueRun, B as parseWorkflowName, F as StatusBadge, Z as Zap, G as CircleX, H as RunActionsDropdownItems, I as unwrapServerActionResult, J as WorkflowGraphViewer, T as Tabs, K as TabsList, L as TabsTrigger, M as TabsContent, N as ErrorBoundary } from "./workflow-graph-viewer-BdFIMYrh.js";
3
- import { g as useLayoutEffect2, P as Primitive, c as createLucideIcon, h as useToast, d as cn, D as DEFAULT_PAGE_SIZE, i as fetchRuns, j as fetchHooks, k as getPaginationDisplay, T as Tooltip, a as TooltipTrigger, B as Button, b as TooltipContent, l as fetchEvents, m as useCallbackRef, n as useComposedRefs, A as Anchor, o as composeEventHandlers, p as useId, q as createPopperScope, s as DismissableLayer, v as createContextScope, w as createSlot, C as Content$1, x as useControllableState, y as Root2$1, V as VISUALLY_HIDDEN_STYLES, z as Arrow, E as useComposedRefs$1, u as useServerConfig, t as toast, L as LoaderCircle, F as fetchRun, G as cva, H as Presence$1, I as createContext2, J as fetchWorkflowsManifest } from "./mermaid-3ZIDBTTL-B9v3aKRl.js";
4
- var PORTAL_NAME$2 = "Portal";
5
- var Portal$2 = reactExports.forwardRef((props, forwardedRef) => {
6
- var _a;
7
- const { container: containerProp, ...portalProps } = props;
8
- const [mounted, setMounted] = reactExports.useState(false);
9
- useLayoutEffect2(() => setMounted(true), []);
10
- const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
11
- return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
12
- });
13
- Portal$2.displayName = PORTAL_NAME$2;
1
+ import { r as reactExports, j as jsxRuntimeExports, A as Link, f as reactDomExports, C as useSearchParams, B as useNavigate, D as useLocation, w as withComponentProps } from "./index-BXZSIDEp.js";
2
+ import { R as ResolveHookModal, S as Send, a as Skeleton, u as unwrapOrThrow, W as WorkflowWebAPIError, b as RelativeTime, A as Alert, C as CircleAlert, c as AlertTitle, d as AlertDescription, g as getErrorMessage, e as CopyableText, D as DropdownMenu, f as DropdownMenuTrigger, E as Ellipsis, h as DropdownMenuContent, i as DropdownMenuItem, j as ChevronRight, r as resumeHook, k as createCollection, l as hideOthers, m as ReactRemoveScroll, n as useDirection, o as ChevronDown, p as ChevronUp, q as Check, X, s as useControllableState$1, P as Primitive$1, t as composeEventHandlers$1, v as Presence, w as useSize, x as createContextScope$1, y as cancelRun, z as reenqueueRun, B as parseWorkflowName, F as StatusBadge, Z as Zap, G as CircleX, H as RunActionsDropdownItems, I as unwrapServerActionResult, J as WorkflowGraphViewer, T as Tabs, K as TabsList, L as TabsTrigger, M as TabsContent, N as ErrorBoundary } from "./workflow-graph-viewer-j7J3_oSH.js";
3
+ import { c as createLucideIcon, h as useToast, e as cn, D as DEFAULT_PAGE_SIZE, i as fetchRuns, j as fetchHooks, k as getPaginationDisplay, T as Tooltip, a as TooltipTrigger, B as Button, b as TooltipContent, l as fetchEvents, m as useCallbackRef, n as useComposedRefs, P as Primitive, A as Anchor, o as composeEventHandlers, p as useLayoutEffect2, q as Portal$2, s as useId, v as createPopperScope, w as DismissableLayer, x as createContextScope, y as createSlot, C as Content$1, z as useControllableState, E as Root2$1, V as VISUALLY_HIDDEN_STYLES, F as Arrow, G as useComposedRefs$1, u as useServerConfig, t as toast, L as LoaderCircle, H as fetchRun, I as cva, J as Presence$1, M as createContext2, N as fetchWorkflowsManifest } from "./mermaid-3ZIDBTTL-DndzaIEl.js";
4
+ import "./index-B6-SzLmT.js";
14
5
  /**
15
6
  * @license lucide-react v0.575.0 - ISC
16
7
  *
@@ -0,0 +1,308 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { g as getDefaultExportFromCjs } from "./index-BXZSIDEp.js";
5
+ var ms$1;
6
+ var hasRequiredMs;
7
+ function requireMs() {
8
+ if (hasRequiredMs) return ms$1;
9
+ hasRequiredMs = 1;
10
+ var s = 1e3;
11
+ var m = s * 60;
12
+ var h = m * 60;
13
+ var d = h * 24;
14
+ var w = d * 7;
15
+ var y = d * 365.25;
16
+ ms$1 = function(val, options) {
17
+ options = options || {};
18
+ var type = typeof val;
19
+ if (type === "string" && val.length > 0) {
20
+ return parse(val);
21
+ } else if (type === "number" && isFinite(val)) {
22
+ return options.long ? fmtLong(val) : fmtShort(val);
23
+ }
24
+ throw new Error(
25
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
26
+ );
27
+ };
28
+ function parse(str) {
29
+ str = String(str);
30
+ if (str.length > 100) {
31
+ return;
32
+ }
33
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
34
+ str
35
+ );
36
+ if (!match) {
37
+ return;
38
+ }
39
+ var n = parseFloat(match[1]);
40
+ var type = (match[2] || "ms").toLowerCase();
41
+ switch (type) {
42
+ case "years":
43
+ case "year":
44
+ case "yrs":
45
+ case "yr":
46
+ case "y":
47
+ return n * y;
48
+ case "weeks":
49
+ case "week":
50
+ case "w":
51
+ return n * w;
52
+ case "days":
53
+ case "day":
54
+ case "d":
55
+ return n * d;
56
+ case "hours":
57
+ case "hour":
58
+ case "hrs":
59
+ case "hr":
60
+ case "h":
61
+ return n * h;
62
+ case "minutes":
63
+ case "minute":
64
+ case "mins":
65
+ case "min":
66
+ case "m":
67
+ return n * m;
68
+ case "seconds":
69
+ case "second":
70
+ case "secs":
71
+ case "sec":
72
+ case "s":
73
+ return n * s;
74
+ case "milliseconds":
75
+ case "millisecond":
76
+ case "msecs":
77
+ case "msec":
78
+ case "ms":
79
+ return n;
80
+ default:
81
+ return void 0;
82
+ }
83
+ }
84
+ function fmtShort(ms2) {
85
+ var msAbs = Math.abs(ms2);
86
+ if (msAbs >= d) {
87
+ return Math.round(ms2 / d) + "d";
88
+ }
89
+ if (msAbs >= h) {
90
+ return Math.round(ms2 / h) + "h";
91
+ }
92
+ if (msAbs >= m) {
93
+ return Math.round(ms2 / m) + "m";
94
+ }
95
+ if (msAbs >= s) {
96
+ return Math.round(ms2 / s) + "s";
97
+ }
98
+ return ms2 + "ms";
99
+ }
100
+ function fmtLong(ms2) {
101
+ var msAbs = Math.abs(ms2);
102
+ if (msAbs >= d) {
103
+ return plural(ms2, msAbs, d, "day");
104
+ }
105
+ if (msAbs >= h) {
106
+ return plural(ms2, msAbs, h, "hour");
107
+ }
108
+ if (msAbs >= m) {
109
+ return plural(ms2, msAbs, m, "minute");
110
+ }
111
+ if (msAbs >= s) {
112
+ return plural(ms2, msAbs, s, "second");
113
+ }
114
+ return ms2 + " ms";
115
+ }
116
+ function plural(ms2, msAbs, n, name) {
117
+ var isPlural = msAbs >= n * 1.5;
118
+ return Math.round(ms2 / n) + " " + name + (isPlural ? "s" : "");
119
+ }
120
+ return ms$1;
121
+ }
122
+ var msExports = requireMs();
123
+ const ms = /* @__PURE__ */ getDefaultExportFromCjs(msExports);
124
+ function parseDurationToDate(param) {
125
+ if (typeof param === "string") {
126
+ const durationMs = ms(param);
127
+ if (typeof durationMs !== "number" || durationMs < 0) {
128
+ throw new Error(`Invalid duration: "${param}". Expected a valid duration string like "1s", "1m", "1h", etc.`);
129
+ }
130
+ return new Date(Date.now() + durationMs);
131
+ } else if (typeof param === "number") {
132
+ if (param < 0 || !Number.isFinite(param)) {
133
+ throw new Error(`Invalid duration: ${param}. Expected a non-negative finite number of milliseconds.`);
134
+ }
135
+ return new Date(Date.now() + param);
136
+ } else if (param instanceof Date || param && typeof param === "object" && typeof param.getTime === "function") {
137
+ return param instanceof Date ? param : new Date(param.getTime());
138
+ } else {
139
+ throw new Error(`Invalid duration parameter. Expected a duration string, number (milliseconds), or Date object.`);
140
+ }
141
+ }
142
+ const BASE_URL = "https://workflow-sdk.dev/err";
143
+ function isError(value) {
144
+ return typeof value === "object" && value !== null && "name" in value && "message" in value;
145
+ }
146
+ function appendFramedDetails(title, details) {
147
+ if (details.length === 0)
148
+ return title;
149
+ const lines = [title];
150
+ details.forEach((detail, index) => {
151
+ const isLast = index === details.length - 1;
152
+ const head = isLast ? "╰▶ " : "├▶ ";
153
+ const cont = isLast ? " " : "│ ";
154
+ const text = `${detail.label}: ${detail.value}`;
155
+ text.split("\n").forEach((line, i) => lines.push(`${i === 0 ? head : cont}${line}`));
156
+ });
157
+ return lines.join("\n");
158
+ }
159
+ function buildFramedDetails(hint, slug) {
160
+ const out = [];
161
+ if (slug)
162
+ out.push({ label: "docs", value: `${BASE_URL}/${slug}` });
163
+ return out;
164
+ }
165
+ const ERROR_SLUGS = {
166
+ HOOK_CONFLICT: "hook-conflict",
167
+ RUNTIME_DECRYPTION_FAILED: "runtime-decryption-failed"
168
+ };
169
+ class WorkflowError extends Error {
170
+ constructor(message, options) {
171
+ const msgDocs = appendFramedDetails(message, buildFramedDetails(void 0, options == null ? void 0 : options.slug));
172
+ super(msgDocs, { cause: options == null ? void 0 : options.cause });
173
+ __publicField(this, "cause");
174
+ if ((options == null ? void 0 : options.cause) !== void 0) {
175
+ this.cause = options.cause;
176
+ }
177
+ if ((options == null ? void 0 : options.cause) instanceof Error) {
178
+ this.stack = `${this.stack}
179
+ Caused by: ${options.cause.stack}`;
180
+ }
181
+ }
182
+ static is(value) {
183
+ return isError(value) && value.name === "WorkflowError";
184
+ }
185
+ }
186
+ class WorkflowRuntimeError extends WorkflowError {
187
+ constructor(message, options) {
188
+ super(message, {
189
+ ...options
190
+ });
191
+ this.name = "WorkflowRuntimeError";
192
+ }
193
+ static is(value) {
194
+ return isError(value) && value.name === "WorkflowRuntimeError";
195
+ }
196
+ }
197
+ class RuntimeDecryptionError extends WorkflowRuntimeError {
198
+ constructor(message, options) {
199
+ super(message, {
200
+ cause: options == null ? void 0 : options.cause,
201
+ slug: ERROR_SLUGS.RUNTIME_DECRYPTION_FAILED
202
+ });
203
+ /** Optional structured context about the failed encrypt/decrypt call. */
204
+ __publicField(this, "context");
205
+ this.name = "RuntimeDecryptionError";
206
+ if ((options == null ? void 0 : options.context) !== void 0) {
207
+ this.context = options.context;
208
+ }
209
+ }
210
+ static is(value) {
211
+ return isError(value) && value.name === "RuntimeDecryptionError";
212
+ }
213
+ }
214
+ class HookConflictError extends WorkflowError {
215
+ constructor(token, conflictingRunId) {
216
+ super(`Hook token "${token}" is already in use by another workflow${conflictingRunId ? ` (run "${conflictingRunId}")` : ""}`, {
217
+ slug: ERROR_SLUGS.HOOK_CONFLICT
218
+ });
219
+ __publicField(this, "token");
220
+ // TODO: Make this required once all persisted hook_conflict events and World
221
+ // implementations always include the active hook owner's run ID.
222
+ __publicField(this, "conflictingRunId");
223
+ this.name = "HookConflictError";
224
+ this.token = token;
225
+ if (conflictingRunId !== void 0) {
226
+ this.conflictingRunId = conflictingRunId;
227
+ }
228
+ }
229
+ static is(value) {
230
+ return isError(value) && value.name === "HookConflictError";
231
+ }
232
+ }
233
+ class FatalError extends Error {
234
+ constructor(message) {
235
+ super(message);
236
+ __publicField(this, "fatal", true);
237
+ this.name = "FatalError";
238
+ }
239
+ static is(value) {
240
+ if (!isError(value))
241
+ return false;
242
+ if (value.name === "FatalError")
243
+ return true;
244
+ return value.fatal === true;
245
+ }
246
+ }
247
+ class RetryableError extends Error {
248
+ constructor(message, options = {}) {
249
+ super(message);
250
+ /**
251
+ * The Date when the step should be retried.
252
+ */
253
+ __publicField(this, "retryAfter");
254
+ this.name = "RetryableError";
255
+ if (options.retryAfter !== void 0) {
256
+ this.retryAfter = parseDurationToDate(options.retryAfter);
257
+ } else {
258
+ this.retryAfter = new Date(Date.now() + 1e3);
259
+ }
260
+ }
261
+ static is(value) {
262
+ return isError(value) && value.name === "RetryableError";
263
+ }
264
+ }
265
+ const VERCEL_403_ERROR_MESSAGE = "Your current vercel account does not have access to this resource. Use `vercel login` or `vercel switch` to ensure you are linked to the right account.";
266
+ const FATAL_ERROR_KEY = Symbol.for("@workflow/errors//FatalError");
267
+ const RETRYABLE_ERROR_KEY = Symbol.for("@workflow/errors//RetryableError");
268
+ const HOOK_CONFLICT_ERROR_KEY = Symbol.for("@workflow/errors//HookConflictError");
269
+ const RUNTIME_DECRYPTION_ERROR_KEY = Symbol.for("@workflow/errors//RuntimeDecryptionError");
270
+ if (typeof globalThis !== "undefined") {
271
+ if (!Object.hasOwn(globalThis, FATAL_ERROR_KEY)) {
272
+ Object.defineProperty(globalThis, FATAL_ERROR_KEY, {
273
+ value: FatalError,
274
+ writable: false,
275
+ enumerable: false,
276
+ configurable: false
277
+ });
278
+ }
279
+ if (!Object.hasOwn(globalThis, RETRYABLE_ERROR_KEY)) {
280
+ Object.defineProperty(globalThis, RETRYABLE_ERROR_KEY, {
281
+ value: RetryableError,
282
+ writable: false,
283
+ enumerable: false,
284
+ configurable: false
285
+ });
286
+ }
287
+ if (!Object.hasOwn(globalThis, HOOK_CONFLICT_ERROR_KEY)) {
288
+ Object.defineProperty(globalThis, HOOK_CONFLICT_ERROR_KEY, {
289
+ value: HookConflictError,
290
+ writable: false,
291
+ enumerable: false,
292
+ configurable: false
293
+ });
294
+ }
295
+ if (!Object.hasOwn(globalThis, RUNTIME_DECRYPTION_ERROR_KEY)) {
296
+ Object.defineProperty(globalThis, RUNTIME_DECRYPTION_ERROR_KEY, {
297
+ value: RuntimeDecryptionError,
298
+ writable: false,
299
+ enumerable: false,
300
+ configurable: false
301
+ });
302
+ }
303
+ }
304
+ export {
305
+ RuntimeDecryptionError as R,
306
+ VERCEL_403_ERROR_MESSAGE as V,
307
+ WorkflowRuntimeError as W
308
+ };
@@ -9388,15 +9388,15 @@ function useViewTransitionState(to, { relative } = {}) {
9388
9388
  var reactDomExports = requireReactDom();
9389
9389
  const ReactDOM = /* @__PURE__ */ getDefaultExportFromCjs(reactDomExports);
9390
9390
  export {
9391
- useNavigate as A,
9392
- useSearchParams as B,
9393
- ReactDOM as C,
9391
+ Link as A,
9392
+ useNavigate as B,
9393
+ useSearchParams as C,
9394
9394
  useLocation as D,
9395
9395
  ErrorResponseImpl as E,
9396
9396
  FrameworkContext as F,
9397
- useParams as G,
9398
- React as H,
9399
- getDefaultExportFromCjs as I,
9397
+ ReactDOM as G,
9398
+ useParams as H,
9399
+ React as I,
9400
9400
  Links as L,
9401
9401
  Meta as M,
9402
9402
  NO_BODY_STATUS_CODES as N,
@@ -9409,24 +9409,24 @@ export {
9409
9409
  RemixErrorBoundary as d,
9410
9410
  RouterProvider as e,
9411
9411
  reactDomExports as f,
9412
- decodeViaTurboStream as g,
9413
- createClientRoutes as h,
9412
+ getDefaultExportFromCjs as g,
9413
+ decodeViaTurboStream as h,
9414
9414
  isRouteErrorResponse as i,
9415
9415
  jsxRuntimeExports as j,
9416
- createRouter as k,
9417
- getPatchRoutesOnNavigationFunction as l,
9416
+ createClientRoutes as k,
9417
+ createRouter as l,
9418
9418
  matchRoutes as m,
9419
- getTurboStreamSingleFetchDataStrategy as n,
9420
- createBrowserHistory as o,
9421
- createClientRoutesWithHMRRevalidationOptOut as p,
9422
- mapRouteProperties as q,
9419
+ getPatchRoutesOnNavigationFunction as n,
9420
+ getTurboStreamSingleFetchDataStrategy as o,
9421
+ createBrowserHistory as p,
9422
+ createClientRoutesWithHMRRevalidationOptOut as q,
9423
9423
  reactExports as r,
9424
9424
  shouldHydrateRouteLoader as s,
9425
- hydrationRouteProperties as t,
9425
+ mapRouteProperties as t,
9426
9426
  useFogOFWarDiscovery as u,
9427
- withErrorBoundaryProps as v,
9427
+ hydrationRouteProperties as v,
9428
9428
  withComponentProps as w,
9429
- Scripts as x,
9430
- useRouteError as y,
9431
- Link as z
9429
+ withErrorBoundaryProps as x,
9430
+ Scripts as y,
9431
+ useRouteError as z
9432
9432
  };
@@ -0,0 +1,200 @@
1
+ const compiledCache = /* @__PURE__ */ new WeakMap();
2
+ async function compileSource(source) {
3
+ const resolved = await source;
4
+ if (resolved instanceof WebAssembly.Module)
5
+ return resolved;
6
+ const buf = resolved;
7
+ const cacheKey = buf.buffer instanceof ArrayBuffer ? buf.buffer : buf;
8
+ const cached = compiledCache.get(cacheKey);
9
+ if (cached)
10
+ return cached;
11
+ const compiled = await WebAssembly.compile(buf);
12
+ compiledCache.set(cacheKey, compiled);
13
+ return compiled;
14
+ }
15
+ const BUF_LAYOUT = {
16
+ src: 0,
17
+ srcSize: 4,
18
+ srcPos: 8,
19
+ dst: 12,
20
+ dstSize: 16,
21
+ dstPos: 20,
22
+ SIZE: 24
23
+ };
24
+ function readCString(memory, ptr) {
25
+ const bytes = new Uint8Array(memory.buffer, ptr);
26
+ let end = 0;
27
+ while (bytes[end] !== 0 && end < bytes.length)
28
+ end++;
29
+ return new TextDecoder().decode(bytes.subarray(0, end));
30
+ }
31
+ class ZstdDecoder {
32
+ constructor(exports$1, dctxPtr, inPtr, inCap, outPtr, outCap, bufPtr) {
33
+ this.exports = exports$1;
34
+ this.dctxPtr = dctxPtr;
35
+ this.inPtr = inPtr;
36
+ this.inCap = inCap;
37
+ this.outPtr = outPtr;
38
+ this.outCap = outCap;
39
+ this.bufPtr = bufPtr;
40
+ }
41
+ /**
42
+ * Compile the bundled `zstd.wasm` (or a pre-compiled module) and
43
+ * return a ready-to-use `ZstdDecoder`.
44
+ */
45
+ static async create(wasm) {
46
+ const module = await compileSource(wasm);
47
+ const instance = await WebAssembly.instantiate(module, {});
48
+ const exports$1 = instance.exports;
49
+ const dctxPtr = exports$1.dctx_new();
50
+ if (!dctxPtr)
51
+ throw new Error("zstd: failed to allocate decompression context");
52
+ const inCap = exports$1.dstream_in_size();
53
+ const outCap = exports$1.dstream_out_size();
54
+ const inPtr = exports$1.zstd_malloc(inCap);
55
+ const outPtr = exports$1.zstd_malloc(outCap);
56
+ const bufPtr = exports$1.zstd_malloc(BUF_LAYOUT.SIZE);
57
+ if (!inPtr || !outPtr || !bufPtr) {
58
+ throw new Error("zstd: failed to allocate streaming buffers");
59
+ }
60
+ return new ZstdDecoder(exports$1, dctxPtr, inPtr, inCap, outPtr, outCap, bufPtr);
61
+ }
62
+ dispose() {
63
+ if (!this.dctxPtr)
64
+ return;
65
+ const e = this.exports;
66
+ e.dctx_free(this.dctxPtr);
67
+ e.zstd_free(this.inPtr);
68
+ e.zstd_free(this.outPtr);
69
+ e.zstd_free(this.bufPtr);
70
+ this.dctxPtr = 0;
71
+ }
72
+ /**
73
+ * Get a fresh `Uint8Array` view of WASM linear memory.
74
+ *
75
+ * IMPORTANT: any call into WASM may grow `memory.buffer`, which
76
+ * detaches all existing `ArrayBuffer`-backed views. Always
77
+ * re-acquire views from this getter (and `bufView`) AFTER each
78
+ * WASM call rather than caching them.
79
+ */
80
+ get heap() {
81
+ return new Uint8Array(this.exports.memory.buffer);
82
+ }
83
+ get bufView() {
84
+ return new DataView(this.exports.memory.buffer, this.bufPtr, BUF_LAYOUT.SIZE);
85
+ }
86
+ checkError(ret) {
87
+ if (this.exports.is_error(ret) !== 0) {
88
+ const name = readCString(this.exports.memory, this.exports.get_error_name(ret));
89
+ throw new Error(`zstd: ${name} (code ${ret})`);
90
+ }
91
+ }
92
+ /**
93
+ * Feed `chunk` to the decoder and pull out as much decoded data
94
+ * as fits in our output buffer. Calls `onOutput` zero or more
95
+ * times with non-empty `Uint8Array` slices into the WASM memory.
96
+ *
97
+ * IMPORTANT: the slices passed to `onOutput` are views into WASM
98
+ * memory and are only valid until the next decoder call. Callers
99
+ * that need to keep the data must copy it (`.slice()` or
100
+ * `.set()` into their own buffer).
101
+ */
102
+ push(chunk, onOutput) {
103
+ const e = this.exports;
104
+ let chunkOffset = 0;
105
+ while (chunkOffset < chunk.length) {
106
+ const copyLen = Math.min(chunk.length - chunkOffset, this.inCap);
107
+ this.heap.set(chunk.subarray(chunkOffset, chunkOffset + copyLen), this.inPtr);
108
+ chunkOffset += copyLen;
109
+ let srcPos = 0;
110
+ while (srcPos < copyLen) {
111
+ let view = this.bufView;
112
+ view.setUint32(BUF_LAYOUT.src, this.inPtr, true);
113
+ view.setUint32(BUF_LAYOUT.srcSize, copyLen, true);
114
+ view.setUint32(BUF_LAYOUT.srcPos, srcPos, true);
115
+ view.setUint32(BUF_LAYOUT.dst, this.outPtr, true);
116
+ view.setUint32(BUF_LAYOUT.dstSize, this.outCap, true);
117
+ view.setUint32(BUF_LAYOUT.dstPos, 0, true);
118
+ const ret = e.decompress_stream(this.dctxPtr, this.bufPtr);
119
+ this.checkError(ret);
120
+ view = this.bufView;
121
+ const dstPos = view.getUint32(BUF_LAYOUT.dstPos, true);
122
+ if (dstPos > 0) {
123
+ onOutput(this.heap.subarray(this.outPtr, this.outPtr + dstPos));
124
+ }
125
+ const newSrcPos = view.getUint32(BUF_LAYOUT.srcPos, true);
126
+ if (newSrcPos === srcPos && dstPos === 0) {
127
+ throw new Error("zstd: decoder made no progress");
128
+ }
129
+ srcPos = newSrcPos;
130
+ if (ret === 0 && srcPos === copyLen)
131
+ break;
132
+ }
133
+ }
134
+ }
135
+ /**
136
+ * Decompress an entire compressed buffer in one shot. Convenient
137
+ * for small inputs; large inputs should prefer
138
+ * `ZstdDecompressStream` to avoid buffering everything in memory.
139
+ */
140
+ decode(compressed) {
141
+ const out = [];
142
+ let total = 0;
143
+ this.push(compressed, (chunk) => {
144
+ const copy = new Uint8Array(chunk);
145
+ out.push(copy);
146
+ total += copy.length;
147
+ });
148
+ const result = new Uint8Array(total);
149
+ let off = 0;
150
+ for (const c of out) {
151
+ result.set(c, off);
152
+ off += c.length;
153
+ }
154
+ return result;
155
+ }
156
+ }
157
+ class ZstdDecompressStream extends TransformStream {
158
+ constructor(wasm) {
159
+ let decoderPromise = null;
160
+ const getDecoder = () => {
161
+ if (!decoderPromise)
162
+ decoderPromise = ZstdDecoder.create(wasm);
163
+ return decoderPromise;
164
+ };
165
+ super({
166
+ async transform(chunk, controller) {
167
+ try {
168
+ const dec = await getDecoder();
169
+ dec.push(chunk, (out) => {
170
+ controller.enqueue(new Uint8Array(out));
171
+ });
172
+ } catch (err) {
173
+ controller.error(err);
174
+ }
175
+ },
176
+ async flush() {
177
+ if (decoderPromise) {
178
+ try {
179
+ const dec = await decoderPromise;
180
+ dec.dispose();
181
+ } catch {
182
+ }
183
+ }
184
+ }
185
+ });
186
+ }
187
+ }
188
+ async function decompressBytes(wasm, compressed) {
189
+ const dec = await ZstdDecoder.create(wasm);
190
+ try {
191
+ return dec.decode(compressed);
192
+ } finally {
193
+ dec.dispose();
194
+ }
195
+ }
196
+ export {
197
+ ZstdDecoder,
198
+ ZstdDecompressStream,
199
+ decompressBytes
200
+ };
@@ -0,0 +1 @@
1
+ window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-DOJDY_4b.js","imports":["/assets/index-BXZSIDEp.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root--Sg25-Lb.js","imports":["/assets/index-BXZSIDEp.js","/assets/mermaid-3ZIDBTTL-DndzaIEl.js"],"css":["/assets/root-1hd8ZXAx.css","/assets/mermaid-3ZIDBTTL-DDxQhcP4.css"]},"routes/home":{"id":"routes/home","parentId":"root","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/home-B-QPEXVb.js","imports":["/assets/index-BXZSIDEp.js","/assets/workflow-graph-viewer-j7J3_oSH.js","/assets/mermaid-3ZIDBTTL-DndzaIEl.js","/assets/index-B6-SzLmT.js"],"css":["/assets/workflow-graph-viewer-DnlNuQQH.css","/assets/mermaid-3ZIDBTTL-DDxQhcP4.css"]},"routes/run-detail":{"id":"routes/run-detail","parentId":"root","path":"run/:runId","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/run-detail-Djwnox1v.js","imports":["/assets/index-BXZSIDEp.js","/assets/workflow-graph-viewer-j7J3_oSH.js","/assets/mermaid-3ZIDBTTL-DndzaIEl.js","/assets/encryption-g14N5vQl.js","/assets/index-B6-SzLmT.js"],"css":["/assets/workflow-graph-viewer-DnlNuQQH.css","/assets/mermaid-3ZIDBTTL-DDxQhcP4.css"]},"routes/api.rpc":{"id":"routes/api.rpc","parentId":"root","path":"api/rpc","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.rpc-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.stream.$streamId":{"id":"routes/api.stream.$streamId","parentId":"root","path":"api/stream/:streamId","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.stream._streamId-l0sNRNKZ.js","imports":[],"css":[]}},"url":"/assets/manifest-225d97da.js","version":"225d97da"};