@workflow/web 4.1.19 → 4.1.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.
@@ -9180,7 +9180,7 @@ const app = express();
9180
9180
  app.all(
9181
9181
  "/{*splat}",
9182
9182
  createRequestHandler({
9183
- build: () => import("./server-build-CewQdZNd.js").then((n) => n.a2)
9183
+ build: () => import("./server-build-DMT2kgzu.js").then((n) => n.a6)
9184
9184
  })
9185
9185
  );
9186
9186
  app.use(
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { Y as R, Z as Ks, _ as jsxRuntimeExports, $ as Qe } from "./server-build-CewQdZNd.js";
6
- import { r as reactExports } from "./app-aFdZLlgg.js";
5
+ import { a0 as R, a1 as Ks, a2 as jsxRuntimeExports, a3 as Qe } from "./server-build-DMT2kgzu.js";
6
+ import { r as reactExports } from "./app-C6I0cOSv.js";
7
7
  import "node:stream";
8
8
  import "util";
9
9
  import "crypto";
@@ -22,16 +22,17 @@ import "node:fs";
22
22
  import "node:child_process";
23
23
  import "node:util";
24
24
  import "node:timers/promises";
25
+ import "node:buffer";
26
+ import "node:http";
27
+ import "node:https";
28
+ import "node:zlib";
25
29
  import "events";
26
30
  import "node:assert";
27
31
  import "node:net";
28
- import "node:http";
29
32
  import "node:querystring";
30
33
  import "node:events";
31
34
  import "node:diagnostics_channel";
32
35
  import "node:tls";
33
- import "node:buffer";
34
- import "node:zlib";
35
36
  import "node:perf_hooks";
36
37
  import "node:util/types";
37
38
  import "node:sqlite";
@@ -2,9 +2,9 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { H as HookSchema } from "./server-build-CewQdZNd.js";
6
- import { B, D, a, E, b, c, d, e, L, M, P, Q, f, R, S, g, h, i, j, k, l, m, n, T, o, p, q, r, s, V, W, t, u, v, w, x, y, z, A, C, F, G, I, J, K, O, U, X } from "./server-build-CewQdZNd.js";
7
- import "./app-aFdZLlgg.js";
5
+ import { H as HookSchema } from "./server-build-DMT2kgzu.js";
6
+ import { B, D, a, E, b, c, d, e, L, M, f, g, P, Q, h, R, S, i, j, k, l, m, n, o, p, T, q, r, s, t, u, V, W, v, w, x, y, z, A, C, F, G, I, J, K, O, U, X, Y, Z, _, $ } from "./server-build-DMT2kgzu.js";
7
+ import "./app-C6I0cOSv.js";
8
8
  import "stream";
9
9
  import "express";
10
10
  import "node:stream";
@@ -24,16 +24,17 @@ import "node:fs";
24
24
  import "node:child_process";
25
25
  import "node:util";
26
26
  import "node:timers/promises";
27
+ import "node:buffer";
28
+ import "node:http";
29
+ import "node:https";
30
+ import "node:zlib";
27
31
  import "events";
28
32
  import "node:assert";
29
33
  import "node:net";
30
- import "node:http";
31
34
  import "node:querystring";
32
35
  import "node:events";
33
36
  import "node:diagnostics_channel";
34
37
  import "node:tls";
35
- import "node:buffer";
36
- import "node:zlib";
37
38
  import "node:perf_hooks";
38
39
  import "node:util/types";
39
40
  import "node:sqlite";
@@ -58,42 +59,46 @@ export {
58
59
  HookSchema,
59
60
  L as LegacySerializedDataSchemaV1,
60
61
  M as MessageId,
62
+ f as NODE_HTTP_DEFAULT,
63
+ g as NODE_HTTP_ENV_VAR,
61
64
  P as PaginatedResponseSchema,
62
65
  Q as QueuePayloadSchema,
63
- f as QueuePrefix,
66
+ h as QueuePrefix,
64
67
  R as RunInputSchema,
65
68
  S as SPEC_VERSION_CURRENT,
66
- g as SPEC_VERSION_LEGACY,
67
- h as SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT,
68
- i as SPEC_VERSION_SUPPORTS_EVENT_SOURCING,
69
- j as SerializedDataSchema,
70
- k as StepInvokePayloadSchema,
71
- l as StepSchema,
72
- m as StepStatusSchema,
73
- n as StructuredErrorSchema,
69
+ i as SPEC_VERSION_LEGACY,
70
+ j as SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT,
71
+ k as SPEC_VERSION_SUPPORTS_EVENT_SOURCING,
72
+ l as SerializedDataSchema,
73
+ m as StepInvokePayloadSchema,
74
+ n as StepSchema,
75
+ o as StepStatusSchema,
76
+ p as StructuredErrorSchema,
74
77
  T as TERMINAL_RUN_EVENT_TYPES,
75
- o as TERMINAL_STEP_STATUSES,
76
- p as TERMINAL_WORKFLOW_RUN_STATUSES,
77
- q as TerminalRunEventTypeSchema,
78
- r as TerminalStepStatusSchema,
79
- s as TerminalWorkflowRunStatusSchema,
78
+ q as TERMINAL_STEP_STATUSES,
79
+ r as TERMINAL_WORKFLOW_RUN_STATUSES,
80
+ s as TerminalRunEventTypeSchema,
81
+ t as TerminalStepStatusSchema,
82
+ u as TerminalWorkflowRunStatusSchema,
80
83
  V as ValidQueueName,
81
84
  W as WaitSchema,
82
- t as WaitStatusSchema,
83
- u as WorkflowInvokePayloadSchema,
84
- v as WorkflowRunBaseSchema,
85
- w as WorkflowRunSchema,
86
- x as WorkflowRunStatusSchema,
87
- y as getQueueTopicPrefix,
88
- z as isLegacySpecVersion,
89
- A as isTerminalRunEventType,
90
- C as isTerminalStepStatus,
91
- F as isTerminalWorkflowRunStatus,
92
- G as parseQueueName,
93
- I as reenqueueActiveRuns,
94
- J as requiresNewerWorld,
95
- K as resolveQueueNamespace,
96
- O as stripEventDataRefs,
97
- U as ulidToDate,
98
- X as validateUlidTimestamp
85
+ v as WaitStatusSchema,
86
+ w as WorkflowInvokePayloadSchema,
87
+ x as WorkflowRunBaseSchema,
88
+ y as WorkflowRunSchema,
89
+ z as WorkflowRunStatusSchema,
90
+ A as envFlag,
91
+ C as getQueueTopicPrefix,
92
+ F as isLegacySpecVersion,
93
+ G as isNodeHttpEnabled,
94
+ I as isTerminalRunEventType,
95
+ J as isTerminalStepStatus,
96
+ K as isTerminalWorkflowRunStatus,
97
+ O as parseQueueName,
98
+ U as reenqueueActiveRuns,
99
+ X as requiresNewerWorld,
100
+ Y as resolveQueueNamespace,
101
+ Z as stripEventDataRefs,
102
+ _ as ulidToDate,
103
+ $ as validateUlidTimestamp
99
104
  };
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { N as Nt } from "./server-build-CewQdZNd.js";
6
- import "./app-aFdZLlgg.js";
5
+ import { N as Nt } from "./server-build-DMT2kgzu.js";
6
+ import "./app-C6I0cOSv.js";
7
7
  import "stream";
8
8
  import "express";
9
9
  import "node:stream";
@@ -23,16 +23,17 @@ import "node:fs";
23
23
  import "node:child_process";
24
24
  import "node:util";
25
25
  import "node:timers/promises";
26
+ import "node:buffer";
27
+ import "node:http";
28
+ import "node:https";
29
+ import "node:zlib";
26
30
  import "events";
27
31
  import "node:assert";
28
32
  import "node:net";
29
- import "node:http";
30
33
  import "node:querystring";
31
34
  import "node:events";
32
35
  import "node:diagnostics_channel";
33
36
  import "node:tls";
34
- import "node:buffer";
35
- import "node:zlib";
36
37
  import "node:perf_hooks";
37
38
  import "node:util/types";
38
39
  import "node:sqlite";
@@ -18,8 +18,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
18
18
  if (typeof globalThis.require === "undefined") {
19
19
  globalThis.require = __wkfCreateRequire(import.meta.url);
20
20
  }
21
- import { a as requireReact, S as ServerRouter, c as createReadableStreamFromReadable, r as reactExports, g as getDefaultExportFromCjs, R as React, b as ReactExports, w as withComponentProps, d as withErrorBoundaryProps, M as Meta, L as Links, e as ScrollRestoration, f as Scripts, O as Outlet, u as useNavigate, h as useSearchParams, i as Link$1, j as useRouteError, k as isRouteErrorResponse, l as useLocation, m as useParams } from "./app-aFdZLlgg.js";
22
- import require$$0$5, { PassThrough } from "node:stream";
21
+ import { a as requireReact, S as ServerRouter, c as createReadableStreamFromReadable, r as reactExports, g as getDefaultExportFromCjs, R as React, b as ReactExports, w as withComponentProps, d as withErrorBoundaryProps, M as Meta, L as Links, e as ScrollRestoration, f as Scripts, O as Outlet, u as useNavigate, h as useSearchParams, i as Link$1, j as useRouteError, k as isRouteErrorResponse, l as useLocation, m as useParams } from "./app-C6I0cOSv.js";
22
+ import require$$0$5, { PassThrough, Transform as Transform$1 } from "node:stream";
23
23
  import require$$0 from "util";
24
24
  import require$$1 from "crypto";
25
25
  import require$$2 from "async_hooks";
@@ -37,23 +37,24 @@ import { promises } from "node:fs";
37
37
  import { execFile } from "node:child_process";
38
38
  import require$$3, { promisify, inspect, types as types$3 } from "node:util";
39
39
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
40
+ import require$$0$7, { Buffer as Buffer$2 } from "node:buffer";
41
+ import http from "node:http";
42
+ import https from "node:https";
43
+ import zlib from "node:zlib";
40
44
  import require$$0$2 from "events";
41
45
  import require$$0$4 from "node:assert";
42
46
  import require$$1$2 from "node:net";
43
- import require$$2$1 from "node:http";
44
47
  import require$$5$1 from "node:querystring";
45
48
  import require$$0$3, { EventEmitter } from "node:events";
46
49
  import require$$0$6 from "node:diagnostics_channel";
47
50
  import require$$4 from "node:tls";
48
- import require$$0$7 from "node:buffer";
49
- import require$$3$1 from "node:zlib";
50
51
  import require$$5$2 from "node:perf_hooks";
51
52
  import require$$8 from "node:util/types";
52
53
  import require$$1$3 from "node:sqlite";
53
- import require$$2$2 from "node:worker_threads";
54
+ import require$$2$1 from "node:worker_threads";
54
55
  import require$$1$4, { AsyncLocalStorage } from "node:async_hooks";
55
56
  import require$$1$5 from "node:console";
56
- import require$$2$3 from "node:timers";
57
+ import require$$2$2 from "node:timers";
57
58
  import require$$1$6 from "node:dns";
58
59
  import * as path$2 from "path";
59
60
  import path__default from "path";
@@ -610,7 +611,7 @@ function requireReactDom_development() {
610
611
  function getValueDescriptorExpectingEnumForWarning(thing) {
611
612
  return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : 'something with type "' + typeof thing + '"';
612
613
  }
613
- function resolveDispatcher() {
614
+ function resolveDispatcher2() {
614
615
  var dispatcher2 = ReactSharedInternals.H;
615
616
  null === dispatcher2 && console.error(
616
617
  "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
@@ -802,10 +803,10 @@ function requireReactDom_development() {
802
803
  return fn2(a2);
803
804
  };
804
805
  reactDom_development.useFormState = function(action2, initialState2, permalink) {
805
- return resolveDispatcher().useFormState(action2, initialState2, permalink);
806
+ return resolveDispatcher2().useFormState(action2, initialState2, permalink);
806
807
  };
807
808
  reactDom_development.useFormStatus = function() {
808
- return resolveDispatcher().useHostTransitionStatus();
809
+ return resolveDispatcher2().useHostTransitionStatus();
809
810
  };
810
811
  reactDom_development.version = "19.1.0";
811
812
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
@@ -34866,6 +34867,25 @@ const serializationFormat = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object
34866
34867
  serializedStepFunctionToString,
34867
34868
  streamToStreamRef
34868
34869
  }, Symbol.toStringTag, { value: "Module" }));
34870
+ const warnedEnvValues = /* @__PURE__ */ new Set();
34871
+ function warnOnce(key, message2) {
34872
+ if (warnedEnvValues.has(key))
34873
+ return;
34874
+ warnedEnvValues.add(key);
34875
+ console.warn(`[workflow] ${message2}`);
34876
+ }
34877
+ function envFlag(name2, fallback, env2 = process.env) {
34878
+ const raw2 = env2[name2];
34879
+ if (raw2 === void 0 || raw2 === "")
34880
+ return fallback;
34881
+ const normalized = raw2.toLowerCase();
34882
+ if (normalized === "0" || normalized === "false")
34883
+ return false;
34884
+ if (normalized === "1" || normalized === "true")
34885
+ return true;
34886
+ warnOnce(`${name2}=${raw2}`, `Ignoring ${name2}: expected 0/1/true/false; using default ${fallback}`);
34887
+ return fallback;
34888
+ }
34869
34889
  const NEVER = Object.freeze({
34870
34890
  status: "aborted"
34871
34891
  });
@@ -48800,6 +48820,11 @@ const HookSchema = object$1({
48800
48820
  specVersion: number$3().optional(),
48801
48821
  isWebhook: boolean$3().optional()
48802
48822
  });
48823
+ const NODE_HTTP_ENV_VAR = "WORKFLOW_NODE_HTTP";
48824
+ const NODE_HTTP_DEFAULT = false;
48825
+ function isNodeHttpEnabled(env2 = process.env) {
48826
+ return envFlag(NODE_HTTP_ENV_VAR, NODE_HTTP_DEFAULT, env2);
48827
+ }
48803
48828
  const QueuePrefix = string$3().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_$/, "Must match __wkf_{workflow|step}_ or __{namespace}_wkf_{workflow|step}_");
48804
48829
  const ValidQueueName = string$3().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_.+$/, "Must be a valid queue name with a recognized prefix");
48805
48830
  const QueueNamespace = string$3().regex(/^[a-z][a-z0-9]*$/, "Must be lowercase alphanumeric, starting with a letter");
@@ -81832,7 +81857,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
81832
81857
  var et = ({ className: e, language: t, style: o, isIncomplete: n, ...s2 }) => jsxRuntimeExports.jsx("div", { className: f("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2", e), "data-incomplete": n || void 0, "data-language": t, "data-streamdown": "code-block", style: { contentVisibility: "auto", containIntrinsicSize: "auto 200px", ...o }, ...s2 });
81833
81858
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
81834
81859
  var ot = ({ language: e }) => jsxRuntimeExports.jsx("div", { className: "flex h-8 items-center text-muted-foreground text-xs", "data-language": e, "data-streamdown": "code-block-header", children: jsxRuntimeExports.jsx("span", { className: "ml-1 font-mono lowercase", children: e }) });
81835
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL--Q6LYe80.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
81860
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-cjj8MLkd.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
81836
81861
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
81837
81862
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
81838
81863
  return jsxRuntimeExports.jsx(Se.Provider, { value: { code: e }, children: jsxRuntimeExports.jsxs(et, { isIncomplete: s2, language: t, children: [jsxRuntimeExports.jsx(ot, { language: t }), n ? jsxRuntimeExports.jsx("div", { className: "pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur", "data-streamdown": "code-block-actions", children: n }) }) : null, jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: jsxRuntimeExports.jsx(Qe, { className: o, language: t, result: c, ...r2 }), children: jsxRuntimeExports.jsx(dn, { className: o, code: i, language: t, raw: c, ...r2 }) })] }) });
@@ -82154,7 +82179,7 @@ var Dt = ({ children: e, className: t, onDownload: o, onError: n }) => {
82154
82179
  }, []), jsxRuntimeExports.jsxs("div", { className: "relative", ref: i, children: [jsxRuntimeExports.jsx("button", { className: f("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50", t), disabled: c, onClick: () => r2(!s2), title: "Download table", type: "button", children: e != null ? e : jsxRuntimeExports.jsx(Z, { size: 14 }) }), s2 ? jsxRuntimeExports.jsxs("div", { className: "absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg", children: [jsxRuntimeExports.jsx("button", { className: "w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40", onClick: () => a2("csv"), title: "Download table as CSV", type: "button", children: "CSV" }), jsxRuntimeExports.jsx("button", { className: "w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40", onClick: () => a2("markdown"), title: "Download table as Markdown", type: "button", children: "Markdown" })] }) : null] });
82155
82180
  };
82156
82181
  var Vt = ({ children: e, className: t, showControls: o, ...n }) => jsxRuntimeExports.jsxs("div", { className: "my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2", "data-streamdown": "table-wrapper", children: [o ? jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-end gap-1", children: [jsxRuntimeExports.jsx(Ht, {}), jsxRuntimeExports.jsx(Dt, {})] }) : null, jsxRuntimeExports.jsx("div", { className: "border-collapse overflow-x-auto overscroll-y-auto rounded-md border border-border bg-background", children: jsxRuntimeExports.jsx("table", { className: f("w-full divide-y divide-border", t), "data-streamdown": "table", ...n, children: e }) })] });
82157
- var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-DrVDu1xg.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
82182
+ var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-hoeX1Afz.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
82158
82183
  function ke(e, t) {
82159
82184
  if (!(e != null && e.position || t != null && t.position)) return true;
82160
82185
  if (!(e != null && e.position && (t != null && t.position))) return false;
@@ -92046,7 +92071,7 @@ createLogger("build", {
92046
92071
  debugNamespace: "workflow:build"
92047
92072
  });
92048
92073
  const MAX_QUEUE_DELIVERIES = 48;
92049
- const version$1 = "4.8.3";
92074
+ const version$1 = "4.8.4";
92050
92075
  const execFileAsync = promisify(execFile);
92051
92076
  function parsePort$1(value, radix = 10) {
92052
92077
  const port = parseInt(value, radix);
@@ -92962,6 +92987,263 @@ function instrumentObject$1(prefix, o) {
92962
92987
  }
92963
92988
  return handlers2;
92964
92989
  }
92990
+ function createNodeHttpAgents(options) {
92991
+ const shared2 = {
92992
+ keepAlive: true,
92993
+ keepAliveMsecs: options.keepAliveMs,
92994
+ maxSockets: options.maxSockets
92995
+ };
92996
+ return { http: new http.Agent(shared2), https: new https.Agent(shared2) };
92997
+ }
92998
+ function destroyNodeHttpAgents(agents) {
92999
+ agents.http.destroy();
93000
+ agents.https.destroy();
93001
+ }
93002
+ const NULL_BODY_STATUSES = /* @__PURE__ */ new Set([204, 205, 304]);
93003
+ const ACCEPTED_ENCODINGS = "gzip, deflate, br";
93004
+ const TIMEOUT_CODE = "ETIMEDOUT";
93005
+ function transportError(message2, code2) {
93006
+ return Object.assign(new Error(message2), { code: code2 });
93007
+ }
93008
+ function toOutgoingHeaders(headers2) {
93009
+ const outgoing = {};
93010
+ headers2 == null ? void 0 : headers2.forEach((value, name2) => {
93011
+ outgoing[name2] = value;
93012
+ });
93013
+ return outgoing;
93014
+ }
93015
+ function toResponseHeaders(message2) {
93016
+ const headers2 = new Headers();
93017
+ for (const [name2, value] of Object.entries(message2.headers)) {
93018
+ if (value === void 0)
93019
+ continue;
93020
+ if (Array.isArray(value)) {
93021
+ for (const entry2 of value)
93022
+ headers2.append(name2, entry2);
93023
+ } else {
93024
+ headers2.append(name2, value);
93025
+ }
93026
+ }
93027
+ return headers2;
93028
+ }
93029
+ const ZLIB_OPTIONS = {
93030
+ flush: zlib.constants.Z_SYNC_FLUSH,
93031
+ finishFlush: zlib.constants.Z_SYNC_FLUSH
93032
+ };
93033
+ const BROTLI_OPTIONS = {
93034
+ flush: zlib.constants.BROTLI_OPERATION_FLUSH,
93035
+ finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
93036
+ };
93037
+ class InflateAuto extends Transform$1 {
93038
+ constructor() {
93039
+ super(...arguments);
93040
+ __publicField(this, "inner");
93041
+ }
93042
+ _transform(chunk, _encoding, callback) {
93043
+ if (!this.inner) {
93044
+ if (chunk.length === 0) {
93045
+ callback();
93046
+ return;
93047
+ }
93048
+ const inner = (chunk[0] & 15) === 8 ? zlib.createInflate(ZLIB_OPTIONS) : zlib.createInflateRaw(ZLIB_OPTIONS);
93049
+ inner.on("data", (decoded) => this.push(decoded));
93050
+ inner.on("end", () => this.push(null));
93051
+ inner.on("error", (error2) => this.destroy(error2));
93052
+ this.inner = inner;
93053
+ }
93054
+ this.inner.write(chunk, callback);
93055
+ }
93056
+ /**
93057
+ * Overriding `_final` keeps the readable side open past the end of the
93058
+ * writable one, so the last inflated bytes still reach the consumer. It is
93059
+ * closed by the inner stream's `end`, or here when there was no body at all.
93060
+ */
93061
+ _final(callback) {
93062
+ if (this.inner) {
93063
+ this.inner.end();
93064
+ } else {
93065
+ this.push(null);
93066
+ }
93067
+ callback();
93068
+ }
93069
+ _destroy(error2, callback) {
93070
+ var _a3;
93071
+ (_a3 = this.inner) == null ? void 0 : _a3.destroy();
93072
+ callback(error2);
93073
+ }
93074
+ }
93075
+ function decodeBody(message2) {
93076
+ var _a3;
93077
+ const encoding2 = (_a3 = message2.headers["content-encoding"]) == null ? void 0 : _a3.toLowerCase().trim();
93078
+ if (!encoding2 || encoding2 === "identity")
93079
+ return message2;
93080
+ let decoder2;
93081
+ if (encoding2 === "gzip" || encoding2 === "x-gzip") {
93082
+ decoder2 = zlib.createGunzip(ZLIB_OPTIONS);
93083
+ } else if (encoding2 === "deflate") {
93084
+ decoder2 = new InflateAuto();
93085
+ } else if (encoding2 === "br") {
93086
+ decoder2 = zlib.createBrotliDecompress(BROTLI_OPTIONS);
93087
+ } else {
93088
+ return message2;
93089
+ }
93090
+ message2.on("error", (error2) => decoder2.destroy(error2));
93091
+ message2.on("close", () => {
93092
+ if (message2.complete)
93093
+ return;
93094
+ decoder2.destroy(transportError("socket hang up", "ECONNRESET"));
93095
+ });
93096
+ decoder2.on("close", () => {
93097
+ if (!message2.complete)
93098
+ message2.destroy();
93099
+ });
93100
+ return message2.pipe(decoder2);
93101
+ }
93102
+ function toWebStream(source, hooks) {
93103
+ let closed = false;
93104
+ const finish = (fn2) => {
93105
+ if (closed)
93106
+ return;
93107
+ closed = true;
93108
+ hooks.done();
93109
+ fn2();
93110
+ };
93111
+ return new ReadableStream({
93112
+ start(controller) {
93113
+ source.on("data", (chunk) => {
93114
+ hooks.progress();
93115
+ controller.enqueue(new Uint8Array(chunk));
93116
+ if ((controller.desiredSize ?? 1) <= 0)
93117
+ source.pause();
93118
+ });
93119
+ source.on("end", () => finish(() => controller.close()));
93120
+ source.on("error", (error2) => finish(() => controller.error(hooks.failure(error2))));
93121
+ source.on("close", () => finish(() => controller.error(hooks.failure())));
93122
+ },
93123
+ pull() {
93124
+ source.resume();
93125
+ },
93126
+ cancel(reason) {
93127
+ var _a3;
93128
+ finish(() => {
93129
+ });
93130
+ (_a3 = source.destroy) == null ? void 0 : _a3.call(source, reason instanceof Error ? reason : void 0);
93131
+ }
93132
+ });
93133
+ }
93134
+ function nodeHttpFetch(url2, init2 = {}) {
93135
+ const { method = "GET", headers: headers2, body: body2, signal, agents, headersTimeoutMs, bodyTimeoutMs } = init2;
93136
+ const target2 = new URL(url2);
93137
+ const secure = target2.protocol === "https:";
93138
+ if (!secure && target2.protocol !== "http:") {
93139
+ return Promise.reject(new TypeError(`node:http transport cannot request ${target2.protocol}// URLs`));
93140
+ }
93141
+ const outgoing = toOutgoingHeaders(headers2);
93142
+ const payload = body2 == null ? void 0 : typeof body2 === "string" ? Buffer$2.from(body2, "utf8") : Buffer$2.from(body2.buffer, body2.byteOffset, body2.byteLength);
93143
+ if (payload)
93144
+ outgoing["content-length"] = String(payload.byteLength);
93145
+ if (!("accept-encoding" in outgoing)) {
93146
+ outgoing["accept-encoding"] = ACCEPTED_ENCODINGS;
93147
+ }
93148
+ return new Promise((resolve2, reject) => {
93149
+ if (signal == null ? void 0 : signal.aborted) {
93150
+ reject(signal.reason);
93151
+ return;
93152
+ }
93153
+ let settled = false;
93154
+ let headersTimer;
93155
+ let bodyTimer;
93156
+ let teardownReason;
93157
+ const clearTimers = () => {
93158
+ clearTimeout(headersTimer);
93159
+ clearTimeout(bodyTimer);
93160
+ headersTimer = void 0;
93161
+ bodyTimer = void 0;
93162
+ };
93163
+ const request2 = (secure ? https : http).request(target2, {
93164
+ method,
93165
+ headers: outgoing,
93166
+ agent: agents ? secure ? agents.https : agents.http : void 0
93167
+ });
93168
+ const abort = () => {
93169
+ if ((signal == null ? void 0 : signal.reason) instanceof Error)
93170
+ teardownReason = signal.reason;
93171
+ request2.destroy(signal == null ? void 0 : signal.reason);
93172
+ };
93173
+ signal == null ? void 0 : signal.addEventListener("abort", abort, { once: true });
93174
+ const detach = () => {
93175
+ signal == null ? void 0 : signal.removeEventListener("abort", abort);
93176
+ };
93177
+ const fail = (error2) => {
93178
+ clearTimers();
93179
+ detach();
93180
+ if (settled)
93181
+ return;
93182
+ settled = true;
93183
+ reject(error2);
93184
+ };
93185
+ if (headersTimeoutMs) {
93186
+ request2.on("socket", () => {
93187
+ headersTimer = setTimeout(() => {
93188
+ request2.destroy(transportError(`no response headers within ${headersTimeoutMs}ms`, TIMEOUT_CODE));
93189
+ }, headersTimeoutMs);
93190
+ });
93191
+ }
93192
+ request2.on("error", fail);
93193
+ request2.on("response", (message2) => {
93194
+ clearTimeout(headersTimer);
93195
+ headersTimer = void 0;
93196
+ const status = message2.statusCode ?? 0;
93197
+ if (status < 200 || status > 599) {
93198
+ request2.destroy();
93199
+ fail(transportError(`origin returned an unusable status line (${status})`, "UNSUPPORTED_STATUS"));
93200
+ return;
93201
+ }
93202
+ const responseHeaders = toResponseHeaders(message2);
93203
+ const statusText = message2.statusMessage ?? "";
93204
+ const bodiless = NULL_BODY_STATUSES.has(status) || method.toUpperCase() === "HEAD";
93205
+ if (bodiless) {
93206
+ message2.resume();
93207
+ clearTimers();
93208
+ detach();
93209
+ settled = true;
93210
+ resolve2(new Response(null, { status, statusText, headers: responseHeaders }));
93211
+ return;
93212
+ }
93213
+ const armBodyTimer = () => {
93214
+ if (!bodyTimeoutMs)
93215
+ return;
93216
+ clearTimeout(bodyTimer);
93217
+ bodyTimer = setTimeout(() => {
93218
+ teardownReason = transportError(`no response body progress for ${bodyTimeoutMs}ms`, TIMEOUT_CODE);
93219
+ request2.destroy(teardownReason);
93220
+ }, bodyTimeoutMs);
93221
+ };
93222
+ armBodyTimer();
93223
+ const decoded = decodeBody(message2);
93224
+ if (decoded !== message2) {
93225
+ responseHeaders.delete("content-encoding");
93226
+ responseHeaders.delete("content-length");
93227
+ }
93228
+ const stream = toWebStream(decoded, {
93229
+ progress: armBodyTimer,
93230
+ done: () => {
93231
+ clearTimers();
93232
+ detach();
93233
+ },
93234
+ // A deliberate teardown (body deadline, caller abort) reaches the
93235
+ // socket as a plain reset, so the reason we tore it down for wins over
93236
+ // whatever the socket reported.
93237
+ failure: (cause) => teardownReason ?? cause ?? transportError("socket hang up", "ECONNRESET")
93238
+ });
93239
+ settled = true;
93240
+ resolve2(new Response(stream, { status, statusText, headers: responseHeaders }));
93241
+ });
93242
+ if (payload)
93243
+ request2.write(payload);
93244
+ request2.end();
93245
+ });
93246
+ }
92965
93247
  var lib = {};
92966
93248
  var hasRequiredLib;
92967
93249
  function requireLib() {
@@ -94130,7 +94412,7 @@ function requireUtil$5() {
94130
94412
  hasRequiredUtil$5 = 1;
94131
94413
  const assert2 = require$$0$4;
94132
94414
  const { kDestroyed, kBodyUsed, kListeners, kBody } = requireSymbols();
94133
- const { IncomingMessage } = require$$2$1;
94415
+ const { IncomingMessage } = http;
94134
94416
  const stream = require$$0$5;
94135
94417
  const net2 = require$$1$2;
94136
94418
  const { stringify: stringify2 } = require$$5$1;
@@ -97450,8 +97732,8 @@ function requireRuntimeFeatures() {
97450
97732
  __proto__: null,
97451
97733
  "node:crypto": () => crypto,
97452
97734
  "node:sqlite": () => require$$1$3,
97453
- "node:worker_threads": () => require$$2$2,
97454
- "node:zlib": () => require$$3$1
97735
+ "node:worker_threads": () => require$$2$1,
97736
+ "node:zlib": () => zlib
97455
97737
  };
97456
97738
  function detectRuntimeFeatureByNodeModule(moduleName) {
97457
97739
  try {
@@ -97675,7 +97957,7 @@ function requireWebidl() {
97675
97957
  return "Object";
97676
97958
  }
97677
97959
  };
97678
- webidl.util.markAsUncloneable = runtimeFeatures2.has("markAsUncloneable") ? require$$2$2.markAsUncloneable : () => {
97960
+ webidl.util.markAsUncloneable = runtimeFeatures2.has("markAsUncloneable") ? require$$2$1.markAsUncloneable : () => {
97679
97961
  };
97680
97962
  webidl.util.ConvertToInt = function(V2, bitLength, signedness, flags) {
97681
97963
  let upperBound;
@@ -98158,7 +98440,7 @@ function requireUtil$4() {
98158
98440
  if (hasRequiredUtil$4) return util$4;
98159
98441
  hasRequiredUtil$4 = 1;
98160
98442
  const { Transform: Transform2 } = require$$0$5;
98161
- const zlib = require$$3$1;
98443
+ const zlib$1 = zlib;
98162
98444
  const { redirectStatusSet, referrerPolicyTokens, badPortsSet } = requireConstants$3();
98163
98445
  const { getGlobalOrigin } = requireGlobal$1();
98164
98446
  const { collectAnHTTPQuotedString, parseMIMEType } = requireDataUrl();
@@ -98766,7 +99048,7 @@ function requireUtil$4() {
98766
99048
  callback();
98767
99049
  return;
98768
99050
  }
98769
- this._inflateStream = (chunk[0] & 15) === 8 ? zlib.createInflate(__privateGet(this, _zlibOptions)) : zlib.createInflateRaw(__privateGet(this, _zlibOptions));
99051
+ this._inflateStream = (chunk[0] & 15) === 8 ? zlib$1.createInflate(__privateGet(this, _zlibOptions)) : zlib$1.createInflateRaw(__privateGet(this, _zlibOptions));
98770
99052
  this._inflateStream.on("data", this.push.bind(this));
98771
99053
  this._inflateStream.on("end", () => this.push(null));
98772
99054
  this._inflateStream.on("error", (err) => this.destroy(err));
@@ -101725,7 +102007,7 @@ function requireClient() {
101725
102007
  hasRequiredClient = 1;
101726
102008
  const assert2 = require$$0$4;
101727
102009
  const net2 = require$$1$2;
101728
- const http = require$$2$1;
102010
+ const http$1 = http;
101729
102011
  const util2 = requireUtil$5();
101730
102012
  const { ClientStats } = requireStats();
101731
102013
  const { channels } = requireDiagnostics();
@@ -101783,7 +102065,7 @@ function requireClient() {
101783
102065
  const connectH1 = requireClientH1();
101784
102066
  const connectH2 = requireClientH2();
101785
102067
  const kClosedResolve = Symbol("kClosedResolve");
101786
- const getDefaultNodeMaxHeaderSize = http && http.maxHeaderSize && Number.isInteger(http.maxHeaderSize) && http.maxHeaderSize > 0 ? () => http.maxHeaderSize : () => {
102068
+ const getDefaultNodeMaxHeaderSize = http$1 && http$1.maxHeaderSize && Number.isInteger(http$1.maxHeaderSize) && http$1.maxHeaderSize > 0 ? () => http$1.maxHeaderSize : () => {
101787
102069
  throw new InvalidArgumentError("http module not available or http.maxHeaderSize invalid");
101788
102070
  };
101789
102071
  const noop3 = () => {
@@ -105768,7 +106050,7 @@ function requireMockUtils() {
105768
106050
  kTotalDispatchCount
105769
106051
  } = requireMockSymbols();
105770
106052
  const { serializePathWithQuery } = requireUtil$5();
105771
- const { STATUS_CODES } = require$$2$1;
106053
+ const { STATUS_CODES } = http;
105772
106054
  const {
105773
106055
  types: {
105774
106056
  isPromise
@@ -106939,7 +107221,7 @@ function requireSnapshotRecorder() {
106939
107221
  hasRequiredSnapshotRecorder = 1;
106940
107222
  const { writeFile: writeFile2, readFile: readFile2, mkdir: mkdir2 } = fs$1;
106941
107223
  const { dirname: dirname2, resolve: resolve2 } = path$3;
106942
- const { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = require$$2$3;
107224
+ const { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = require$$2$2;
106943
107225
  const { InvalidArgumentError, UndiciError } = requireErrors();
106944
107226
  const { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = requireSnapshotUtils();
106945
107227
  function formatRequestKey(opts, headerFilters, matchOptions = {}) {
@@ -110375,7 +110657,7 @@ function requireDecompress() {
110375
110657
  var _decompressors, _skipStatusCodes, _skipErrorResponses, _DecompressHandler_instances, shouldSkipDecompression_fn, createDecompressionChain_fn, setupDecompressorEvents_fn, setupSingleDecompressor_fn, setupMultipleDecompressors_fn, cleanupDecompressors_fn;
110376
110658
  if (hasRequiredDecompress) return decompress;
110377
110659
  hasRequiredDecompress = 1;
110378
- const { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress } = require$$3$1;
110660
+ const { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress } = zlib;
110379
110661
  const { pipeline } = require$$0$5;
110380
110662
  const DecoratorHandler = requireDecoratorHandler();
110381
110663
  const { runtimeFeatures: runtimeFeatures2 } = requireRuntimeFeatures();
@@ -113231,7 +113513,7 @@ function requireFetch() {
113231
113513
  } = requireResponse();
113232
113514
  const { HeadersList } = requireHeaders();
113233
113515
  const { Request: Request2, cloneRequest, getRequestDispatcher, getRequestState } = requireRequest();
113234
- const zlib = require$$3$1;
113516
+ const zlib$1 = zlib;
113235
113517
  const {
113236
113518
  makePolicyContainer,
113237
113519
  clonePolicyContainer,
@@ -113281,7 +113563,7 @@ function requireFetch() {
113281
113563
  const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = requireDataUrl();
113282
113564
  const { getGlobalDispatcher } = requireGlobal();
113283
113565
  const { webidl } = requireWebidl();
113284
- const { STATUS_CODES } = require$$2$1;
113566
+ const { STATUS_CODES } = http;
113285
113567
  const { bytesMatch } = requireSubresourceIntegrity();
113286
113568
  const { createDeferredPromise } = requirePromise();
113287
113569
  const { isomorphicEncode } = requireInfra();
@@ -114225,28 +114507,28 @@ function requireFetch() {
114225
114507
  for (let i = codings.length - 1; i >= 0; --i) {
114226
114508
  const coding = codings[i].trim();
114227
114509
  if (coding === "x-gzip" || coding === "gzip") {
114228
- decoders.push(zlib.createGunzip({
114510
+ decoders.push(zlib$1.createGunzip({
114229
114511
  // Be less strict when decoding compressed responses, since sometimes
114230
114512
  // servers send slightly invalid responses that are still accepted
114231
114513
  // by common browsers.
114232
114514
  // Always using Z_SYNC_FLUSH is what cURL does.
114233
- flush: zlib.constants.Z_SYNC_FLUSH,
114234
- finishFlush: zlib.constants.Z_SYNC_FLUSH
114515
+ flush: zlib$1.constants.Z_SYNC_FLUSH,
114516
+ finishFlush: zlib$1.constants.Z_SYNC_FLUSH
114235
114517
  }));
114236
114518
  } else if (coding === "deflate") {
114237
114519
  decoders.push(createInflate({
114238
- flush: zlib.constants.Z_SYNC_FLUSH,
114239
- finishFlush: zlib.constants.Z_SYNC_FLUSH
114520
+ flush: zlib$1.constants.Z_SYNC_FLUSH,
114521
+ finishFlush: zlib$1.constants.Z_SYNC_FLUSH
114240
114522
  }));
114241
114523
  } else if (coding === "br") {
114242
- decoders.push(zlib.createBrotliDecompress({
114243
- flush: zlib.constants.BROTLI_OPERATION_FLUSH,
114244
- finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
114524
+ decoders.push(zlib$1.createBrotliDecompress({
114525
+ flush: zlib$1.constants.BROTLI_OPERATION_FLUSH,
114526
+ finishFlush: zlib$1.constants.BROTLI_OPERATION_FLUSH
114245
114527
  }));
114246
114528
  } else if (coding === "zstd" && hasZstd) {
114247
- decoders.push(zlib.createZstdDecompress({
114248
- flush: zlib.constants.ZSTD_e_continue,
114249
- finishFlush: zlib.constants.ZSTD_e_end
114529
+ decoders.push(zlib$1.createZstdDecompress({
114530
+ flush: zlib$1.constants.ZSTD_e_continue,
114531
+ finishFlush: zlib$1.constants.ZSTD_e_end
114250
114532
  }));
114251
114533
  } else {
114252
114534
  decoders.length = 0;
@@ -116287,7 +116569,7 @@ function requirePermessageDeflate() {
116287
116569
  var _inflate, _options2, _maxPayloadSize;
116288
116570
  if (hasRequiredPermessageDeflate) return permessageDeflate;
116289
116571
  hasRequiredPermessageDeflate = 1;
116290
- const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require$$3$1;
116572
+ const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = zlib;
116291
116573
  const { isValidClientWindowBits } = requireUtil$1();
116292
116574
  const { MessageSizeExceededError } = requireErrors();
116293
116575
  const tail = Buffer.from([0, 0, 255, 255]);
@@ -118574,11 +118856,17 @@ function getQueueRoute(queueName) {
118574
118856
  };
118575
118857
  }
118576
118858
  function createQueue$2(config2) {
118577
- const httpAgent = new undiciExports.Agent({
118859
+ const agentOptions = {
118578
118860
  headersTimeout: 0,
118579
118861
  connections: 1e3,
118580
- keepAliveTimeout: 3e4
118581
- });
118862
+ keepAliveTimeout: 3e4,
118863
+ bodyTimeout: 3e5
118864
+ };
118865
+ const nodeHttpAgents = isNodeHttpEnabled() ? createNodeHttpAgents({
118866
+ maxSockets: agentOptions.connections,
118867
+ keepAliveMs: agentOptions.keepAliveTimeout
118868
+ }) : void 0;
118869
+ const httpAgent = nodeHttpAgents ? void 0 : new undiciExports.Agent(agentOptions);
118582
118870
  const transport = new TypedJsonTransport();
118583
118871
  const generateId2 = monotonicFactory();
118584
118872
  const semaphore = new libExports.Sema(WORKFLOW_LOCAL_QUEUE_CONCURRENCY);
@@ -118634,13 +118922,24 @@ function createQueue$2(config2) {
118634
118922
  response2 = await directHandler(req);
118635
118923
  } else {
118636
118924
  const baseUrl = await resolveBaseUrl$1(config2);
118637
- response2 = await fetch(createWorkflowUrl(baseUrl, { type: pathname }), {
118925
+ const url2 = createWorkflowUrl(baseUrl, { type: pathname });
118926
+ response2 = nodeHttpAgents ? await nodeHttpFetch(url2, {
118638
118927
  method: "POST",
118639
- duplex: "half",
118640
- dispatcher: httpAgent,
118641
- headers: headers2,
118642
- body: body2
118643
- });
118928
+ headers: new Headers(headers2),
118929
+ body: body2,
118930
+ agents: nodeHttpAgents,
118931
+ headersTimeoutMs: agentOptions.headersTimeout,
118932
+ bodyTimeoutMs: agentOptions.bodyTimeout
118933
+ }) : (
118934
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- undici v7 dispatcher types don't match @types/node's RequestInit
118935
+ await fetch(url2, {
118936
+ method: "POST",
118937
+ duplex: "half",
118938
+ dispatcher: httpAgent,
118939
+ headers: headers2,
118940
+ body: body2
118941
+ })
118942
+ );
118644
118943
  }
118645
118944
  const text2 = await response2.text();
118646
118945
  if (response2.ok) {
@@ -118744,7 +119043,9 @@ function createQueue$2(config2) {
118744
119043
  directHandlers.set(prefix, handler);
118745
119044
  },
118746
119045
  async close() {
118747
- await httpAgent.close();
119046
+ if (nodeHttpAgents)
119047
+ destroyNodeHttpAgents(nodeHttpAgents);
119048
+ await (httpAgent == null ? void 0 : httpAgent.close());
118748
119049
  }
118749
119050
  };
118750
119051
  }
@@ -120316,7 +120617,7 @@ function createLocalWorld(args) {
120316
120617
  const basedir = mergedConfig.dataDir;
120317
120618
  const hooksDir = path$3.join(basedir, "hooks");
120318
120619
  const taggedHookFiles = await listTaggedFiles(hooksDir, tag);
120319
- const { HookSchema: HookSchema2 } = await import("./index-Bq9UALYe.js");
120620
+ const { HookSchema: HookSchema2 } = await import("./index-DKbGT0YI.js");
120320
120621
  await Promise.all(taggedHookFiles.map(async (hookFile) => {
120321
120622
  const hook = await readJSON(path$3.join(hooksDir, hookFile), HookSchema2);
120322
120623
  if (hook == null ? void 0 : hook.token) {
@@ -120354,6 +120655,7 @@ function createLocalWorld(args) {
120354
120655
  let _dispatcher;
120355
120656
  let _streamDispatcher;
120356
120657
  let _streamCloseDispatcher;
120658
+ let _nodeHttpAgents;
120357
120659
  const DEFAULT_HEADERS_TIMEOUT_MS = 3e4;
120358
120660
  const DEFAULT_BODY_TIMEOUT_MS = 3e4;
120359
120661
  function envTimeoutMs(name2, fallback) {
@@ -120385,6 +120687,10 @@ function getBaseAgentOptions() {
120385
120687
  bodyTimeout: envTimeoutMs("WORKFLOW_VERCEL_BODY_TIMEOUT_MS", DEFAULT_BODY_TIMEOUT_MS)
120386
120688
  };
120387
120689
  }
120690
+ function getNodeHttpPhaseTimeouts() {
120691
+ const { headersTimeout, bodyTimeout } = getBaseAgentOptions();
120692
+ return { headersTimeoutMs: headersTimeout, bodyTimeoutMs: bodyTimeout };
120693
+ }
120388
120694
  const H2_MAX_IN_FLIGHT_STREAMS = 100;
120389
120695
  const H2_STREAM_WINDOW_BYTES = 4 * 1024 * 1024;
120390
120696
  const H2_CONNECTION_WINDOW_BYTES = 16 * 1024 * 1024;
@@ -120556,17 +120862,37 @@ const eventsRecycler = createDispatcherRecycler(() => createEventsDispatcher(),
120556
120862
  function noteEventsTransportOutcome(dispatcher2, error2) {
120557
120863
  eventsRecycler.note(dispatcher2, error2);
120558
120864
  }
120865
+ function resolveDispatcher(config2, buildDefault) {
120866
+ if (config2 == null ? void 0 : config2.dispatcher)
120867
+ return config2.dispatcher;
120868
+ return isNodeHttpEnabled() ? void 0 : buildDefault();
120869
+ }
120870
+ function getNodeHttpAgents(config2) {
120871
+ if (config2 == null ? void 0 : config2.dispatcher)
120872
+ return void 0;
120873
+ if (!isNodeHttpEnabled())
120874
+ return void 0;
120875
+ const baseOptions = getBaseAgentOptions();
120876
+ _nodeHttpAgents ?? (_nodeHttpAgents = createNodeHttpAgents({
120877
+ maxSockets: baseOptions.connections,
120878
+ keepAliveMs: baseOptions.keepAliveTimeout
120879
+ }));
120880
+ return _nodeHttpAgents;
120881
+ }
120559
120882
  function getDispatcher(config2) {
120883
+ return resolveDispatcher(config2, getDefaultDispatcher);
120884
+ }
120885
+ function getQueueDispatcher(config2) {
120560
120886
  return (config2 == null ? void 0 : config2.dispatcher) ?? getDefaultDispatcher();
120561
120887
  }
120562
120888
  function getEventsDispatcher(config2) {
120563
- return (config2 == null ? void 0 : config2.dispatcher) ?? eventsRecycler.get();
120889
+ return resolveDispatcher(config2, () => eventsRecycler.get());
120564
120890
  }
120565
120891
  function getStreamDispatcher(config2) {
120566
- return (config2 == null ? void 0 : config2.dispatcher) ?? getDefaultStreamDispatcher();
120892
+ return resolveDispatcher(config2, getDefaultStreamDispatcher);
120567
120893
  }
120568
120894
  function getStreamCloseDispatcher(config2) {
120569
- return (config2 == null ? void 0 : config2.dispatcher) ?? getDefaultStreamCloseDispatcher();
120895
+ return resolveDispatcher(config2, getDefaultStreamCloseDispatcher);
120570
120896
  }
120571
120897
  function createEventsDispatcher(agentOverrides) {
120572
120898
  const h2 = h2EventsEnabled();
@@ -120717,8 +121043,8 @@ function requireGetVercelOidcToken() {
120717
121043
  }
120718
121044
  try {
120719
121045
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
120720
- await import("./token-util-CEKv99vM.js").then((n) => n.t),
120721
- await import("./token-BSJJ1ZPx.js").then((n) => n.t)
121046
+ await import("./token-util-VIl8FT7v.js").then((n) => n.t),
121047
+ await import("./token-BY9pJoVX.js").then((n) => n.t)
120722
121048
  ]);
120723
121049
  if (!token || isExpired(getTokenPayload(token), options == null ? void 0 : options.expirationBufferMs)) {
120724
121050
  await refreshToken(options);
@@ -121351,6 +121677,7 @@ const RpcService = SemanticConvention("rpc.service");
121351
121677
  const RpcMethod = SemanticConvention("rpc.method");
121352
121678
  const WorkflowRunId = SemanticConvention("workflow.run.id");
121353
121679
  const StepId = SemanticConvention("step.id");
121680
+ const WorkflowHttpTransport = SemanticConvention("workflow.http.transport");
121354
121681
  const REQUEST_TIMEOUT_MS = 6e4;
121355
121682
  const HTTP_DEBUG_ENABLED = typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
121356
121683
  const DIAGNOSTIC_HEADERS = [
@@ -121456,7 +121783,22 @@ async function instrumentedFetch(opts) {
121456
121783
  const start2 = Date.now();
121457
121784
  let response2;
121458
121785
  try {
121459
- response2 = await fetch(url2, {
121786
+ const nodeAgents = dispatcher2 ? void 0 : getNodeHttpAgents();
121787
+ span == null ? void 0 : span.setAttributes({
121788
+ ...WorkflowHttpTransport(nodeAgents ? "node-http" : "undici")
121789
+ });
121790
+ response2 = nodeAgents ? await nodeHttpFetch(url2, {
121791
+ method,
121792
+ headers: headers2,
121793
+ body: body2,
121794
+ signal,
121795
+ agents: nodeAgents,
121796
+ // Same per-phase deadlines the undici agents are configured
121797
+ // with: without these the node:http path arms no stalled-socket
121798
+ // deadline, and a `timeoutMs: null` caller would have no deadline
121799
+ // at all.
121800
+ ...getNodeHttpPhaseTimeouts()
121801
+ }) : await fetch(url2, {
121460
121802
  method,
121461
121803
  headers: headers2,
121462
121804
  body: body2,
@@ -126189,7 +126531,7 @@ var QueueClient = class {
126189
126531
  setApi(this, new ApiClient({ ...options, region }));
126190
126532
  }
126191
126533
  };
126192
- const version = "4.6.2";
126534
+ const version = "4.7.0";
126193
126535
  const IDEMPOTENT_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD"]);
126194
126536
  const MAX_BODY_PARSE_RETRIES = 2;
126195
126537
  const BODY_PARSE_RETRY_BASE_MS = 100;
@@ -126205,7 +126547,8 @@ const TRANSIENT_TRANSPORT_ERROR_CODES = /* @__PURE__ */ new Set([
126205
126547
  "ECONNREFUSED",
126206
126548
  "ENOTFOUND",
126207
126549
  "EAI_AGAIN",
126208
- "EPIPE"
126550
+ "EPIPE",
126551
+ "ETIMEDOUT"
126209
126552
  ]);
126210
126553
  function getTransientTransportCode(error2) {
126211
126554
  let current = error2;
@@ -126324,7 +126667,7 @@ async function getHttpConfig(config2) {
126324
126667
  return { baseUrl, headers: headers2, usingProxy };
126325
126668
  }
126326
126669
  async function makeRequest({ endpoint, options = {}, config: config2 = {}, schema, data, onResponse, retryConnectTimeout = false }) {
126327
- const method = options.method || "GET";
126670
+ const method = (options.method || "GET").toUpperCase();
126328
126671
  const { baseUrl, headers: headers2 } = await getHttpConfig(config2);
126329
126672
  const url2 = `${baseUrl}${endpoint}`;
126330
126673
  return trace(`http ${method}`, { kind: await getSpanKind("CLIENT") }, async (span) => {
@@ -126341,23 +126684,32 @@ async function makeRequest({ endpoint, options = {}, config: config2 = {}, schem
126341
126684
  headers2.set("Content-Type", "application/cbor");
126342
126685
  body2 = encode(data);
126343
126686
  }
126344
- const canRetryRead = IDEMPOTENT_METHODS.has(method.toUpperCase());
126687
+ const canRetryRead = IDEMPOTENT_METHODS.has(method);
126345
126688
  let parseResult;
126346
126689
  let responseDiagnostics = "";
126347
126690
  for (let attempt = 0; ; attempt++) {
126348
126691
  headers2.set("X-Request-Time", Date.now().toString());
126349
126692
  const timeoutSignal = AbortSignal.timeout(REQUEST_TIMEOUT_MS);
126350
126693
  const signal = options.signal ? AbortSignal.any([options.signal, timeoutSignal]) : timeoutSignal;
126351
- const request2 = new Request(url2, {
126352
- ...options,
126353
- body: body2,
126354
- headers: headers2,
126355
- signal
126356
- });
126357
126694
  const fetchStart = Date.now();
126358
126695
  let response2;
126359
126696
  try {
126360
- response2 = await fetch(request2, {
126697
+ const nodeAgents = getNodeHttpAgents(config2);
126698
+ span == null ? void 0 : span.setAttributes({
126699
+ ...WorkflowHttpTransport(nodeAgents ? "node-http" : "undici")
126700
+ });
126701
+ response2 = nodeAgents ? await nodeHttpFetch(url2, {
126702
+ method,
126703
+ headers: headers2,
126704
+ body: body2,
126705
+ signal,
126706
+ agents: nodeAgents,
126707
+ // Same per-phase deadlines the undici agents are configured
126708
+ // with: without these the node:http path arms no stalled-socket
126709
+ // deadline.
126710
+ ...getNodeHttpPhaseTimeouts()
126711
+ }) : await fetch(new Request(url2, { ...options, body: body2, headers: headers2, signal }), {
126712
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- undici v7 dispatcher types don't match @types/node's RequestInit
126361
126713
  dispatcher: getDispatcher(config2)
126362
126714
  });
126363
126715
  } catch (error2) {
@@ -126374,10 +126726,10 @@ async function makeRequest({ endpoint, options = {}, config: config2 = {}, schem
126374
126726
  await new Promise((resolve2) => setTimeout(resolve2, BODY_PARSE_RETRY_BASE_MS));
126375
126727
  continue;
126376
126728
  }
126377
- const transportError = new WorkflowWorldError(`${method} ${endpoint} transport failure after ${elapsed}ms (${transportCode})`, { url: url2, code: "TRANSPORT", cause: error2 });
126729
+ const transportError2 = new WorkflowWorldError(`${method} ${endpoint} transport failure after ${elapsed}ms (${transportCode})`, { url: url2, code: "TRANSPORT", cause: error2 });
126378
126730
  span == null ? void 0 : span.setAttributes({ ...ErrorType("TRANSPORT") });
126379
- (_b2 = span == null ? void 0 : span.recordException) == null ? void 0 : _b2.call(span, transportError);
126380
- throw transportError;
126731
+ (_b2 = span == null ? void 0 : span.recordException) == null ? void 0 : _b2.call(span, transportError2);
126732
+ throw transportError2;
126381
126733
  }
126382
126734
  throw error2;
126383
126735
  }
@@ -126389,9 +126741,9 @@ async function makeRequest({ endpoint, options = {}, config: config2 = {}, schem
126389
126741
  });
126390
126742
  if (!response2.ok) {
126391
126743
  const errorData = await parseResponseBody(response2).then((r2) => r2.data).catch(() => ({}));
126392
- logCurlRepro(request2.method, url2, headers2);
126744
+ logCurlRepro(method, url2, headers2);
126393
126745
  const retryAfter = parseRetryAfter(response2.headers.get("Retry-After"));
126394
- const defaultMessage = (errorData.message || `${request2.method} ${endpoint} -> HTTP ${response2.status}: ${response2.statusText}`) + responseDiagnostics;
126746
+ const defaultMessage = (errorData.message || `${method} ${endpoint} -> HTTP ${response2.status}: ${response2.statusText}`) + responseDiagnostics;
126395
126747
  const error2 = errorForResponse(response2.status, defaultMessage, {
126396
126748
  url: url2,
126397
126749
  code: errorData.code,
@@ -126580,7 +126932,7 @@ function createQueue$1(config2) {
126580
126932
  const dualTransport = new DualTransport();
126581
126933
  const clientOptions = {
126582
126934
  region,
126583
- dispatcher: getDispatcher(config2),
126935
+ dispatcher: getQueueDispatcher(config2),
126584
126936
  transport: dualTransport,
126585
126937
  ...usingProxy && {
126586
126938
  // final path will be /queues-proxy/api/v3/topic/...
@@ -155366,61 +155718,65 @@ const serverBuild = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
155366
155718
  ssr
155367
155719
  }, Symbol.toStringTag, { value: "Module" }));
155368
155720
  export {
155369
- Qe as $,
155370
- isTerminalRunEventType as A,
155721
+ validateUlidTimestamp as $,
155722
+ envFlag as A,
155371
155723
  BaseEventSchema as B,
155372
- isTerminalStepStatus as C,
155724
+ getQueueTopicPrefix as C,
155373
155725
  DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS as D,
155374
155726
  EVENT_DATA_REF_FIELDS as E,
155375
- isTerminalWorkflowRunStatus as F,
155376
- parseQueueName as G,
155727
+ isLegacySpecVersion as F,
155728
+ isNodeHttpEnabled as G,
155377
155729
  HookSchema as H,
155378
- reenqueueActiveRuns as I,
155379
- requiresNewerWorld as J,
155380
- resolveQueueNamespace as K,
155730
+ isTerminalRunEventType as I,
155731
+ isTerminalStepStatus as J,
155732
+ isTerminalWorkflowRunStatus as K,
155381
155733
  LegacySerializedDataSchemaV1 as L,
155382
155734
  MessageId as M,
155383
155735
  Nt as N,
155384
- stripEventDataRefs as O,
155736
+ parseQueueName as O,
155385
155737
  PaginatedResponseSchema as P,
155386
155738
  QueuePayloadSchema as Q,
155387
155739
  RunInputSchema as R,
155388
155740
  SPEC_VERSION_CURRENT as S,
155389
155741
  TERMINAL_RUN_EVENT_TYPES as T,
155390
- ulidToDate as U,
155742
+ reenqueueActiveRuns as U,
155391
155743
  ValidQueueName as V,
155392
155744
  WaitSchema as W,
155393
- validateUlidTimestamp as X,
155394
- R as Y,
155395
- Ks as Z,
155396
- jsxRuntimeExports as _,
155745
+ requiresNewerWorld as X,
155746
+ resolveQueueNamespace as Y,
155747
+ stripEventDataRefs as Z,
155748
+ ulidToDate as _,
155397
155749
  DEFAULT_TIMESTAMP_THRESHOLD_PAST_MS as a,
155398
- requireTokenUtil as a0,
155399
- requireTokenError as a1,
155400
- serverBuild as a2,
155750
+ R as a0,
155751
+ Ks as a1,
155752
+ jsxRuntimeExports as a2,
155753
+ Qe as a3,
155754
+ requireTokenUtil as a4,
155755
+ requireTokenError as a5,
155756
+ serverBuild as a6,
155401
155757
  EventSchema as b,
155402
155758
  EventTypeSchema as c,
155403
155759
  HealthCheckPayloadSchema as d,
155404
155760
  HookCreatedEventSchema as e,
155405
- QueuePrefix as f,
155406
- SPEC_VERSION_LEGACY as g,
155407
- SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT as h,
155408
- SPEC_VERSION_SUPPORTS_EVENT_SOURCING as i,
155409
- SerializedDataSchema as j,
155410
- StepInvokePayloadSchema as k,
155411
- StepSchema as l,
155412
- StepStatusSchema as m,
155413
- StructuredErrorSchema as n,
155414
- TERMINAL_STEP_STATUSES as o,
155415
- TERMINAL_WORKFLOW_RUN_STATUSES as p,
155416
- TerminalRunEventTypeSchema as q,
155417
- TerminalStepStatusSchema as r,
155418
- TerminalWorkflowRunStatusSchema as s,
155419
- WaitStatusSchema as t,
155420
- WorkflowInvokePayloadSchema as u,
155421
- WorkflowRunBaseSchema as v,
155422
- WorkflowRunSchema as w,
155423
- WorkflowRunStatusSchema as x,
155424
- getQueueTopicPrefix as y,
155425
- isLegacySpecVersion as z
155761
+ NODE_HTTP_DEFAULT as f,
155762
+ NODE_HTTP_ENV_VAR as g,
155763
+ QueuePrefix as h,
155764
+ SPEC_VERSION_LEGACY as i,
155765
+ SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT as j,
155766
+ SPEC_VERSION_SUPPORTS_EVENT_SOURCING as k,
155767
+ SerializedDataSchema as l,
155768
+ StepInvokePayloadSchema as m,
155769
+ StepSchema as n,
155770
+ StepStatusSchema as o,
155771
+ StructuredErrorSchema as p,
155772
+ TERMINAL_STEP_STATUSES as q,
155773
+ TERMINAL_WORKFLOW_RUN_STATUSES as r,
155774
+ TerminalRunEventTypeSchema as s,
155775
+ TerminalStepStatusSchema as t,
155776
+ TerminalWorkflowRunStatusSchema as u,
155777
+ WaitStatusSchema as v,
155778
+ WorkflowInvokePayloadSchema as w,
155779
+ WorkflowRunBaseSchema as x,
155780
+ WorkflowRunSchema as y,
155781
+ WorkflowRunStatusSchema as z
155426
155782
  };
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { g as getDefaultExportFromCjs } from "./app-aFdZLlgg.js";
6
- import { a1 as requireTokenError, a0 as requireTokenUtil } from "./server-build-CewQdZNd.js";
5
+ import { g as getDefaultExportFromCjs } from "./app-C6I0cOSv.js";
6
+ import { a5 as requireTokenError, a4 as requireTokenUtil } from "./server-build-DMT2kgzu.js";
7
7
  function _mergeNamespaces(n, m) {
8
8
  for (var i = 0; i < m.length; i++) {
9
9
  const e = m[i];
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { g as getDefaultExportFromCjs } from "./app-aFdZLlgg.js";
6
- import { a0 as requireTokenUtil } from "./server-build-CewQdZNd.js";
5
+ import { g as getDefaultExportFromCjs } from "./app-C6I0cOSv.js";
6
+ import { a4 as requireTokenUtil } from "./server-build-DMT2kgzu.js";
7
7
  function _mergeNamespaces(n, m) {
8
8
  for (var i = 0; i < m.length; i++) {
9
9
  const e = m[i];
@@ -2,7 +2,7 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { n } from "./assets/app-aFdZLlgg.js";
5
+ import { n } from "./assets/app-C6I0cOSv.js";
6
6
  import "express";
7
7
  import "stream";
8
8
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@workflow/web",
3
3
  "description": "Workflow Observability UI",
4
- "version": "4.1.19",
4
+ "version": "4.1.20",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "files": [
@@ -71,12 +71,12 @@
71
71
  "vite": "^6",
72
72
  "vitest": "^3",
73
73
  "jsdom": "^26",
74
- "@workflow/core": "4.8.3",
74
+ "@workflow/core": "4.8.4",
75
75
  "@workflow/errors": "4.2.1",
76
76
  "@workflow/utils": "4.1.4",
77
- "@workflow/web-shared": "4.1.19",
78
- "@workflow/world": "4.3.1",
79
- "@workflow/world-vercel": "4.6.2"
77
+ "@workflow/web-shared": "4.1.20",
78
+ "@workflow/world": "4.4.0",
79
+ "@workflow/world-vercel": "4.7.0"
80
80
  },
81
81
  "scripts": {
82
82
  "dev": "react-router dev",