@workflow/web 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/build/client/assets/app-Cruj5elv.css +1 -0
  2. package/build/client/assets/{arrow-up-right-CIRm41Zm.js → arrow-up-right-CCSP9ily.js} +1 -1
  3. package/build/client/assets/{highlighted-body-B3W2YXNL-DQ3Je3B9.js → highlighted-body-B3W2YXNL-QxC_q3zz.js} +1 -1
  4. package/build/client/assets/{home-Dl1wTnFS.js → home-D3lvKrxA.js} +27 -25
  5. package/build/client/assets/{loader-circle-CD4z6T9x.js → loader-circle-BV40-ex9.js} +1 -1
  6. package/build/client/assets/{manifest-7d7b25b4.js → manifest-b2d18a63.js} +1 -1
  7. package/build/client/assets/{mermaid-3ZIDBTTL-fKP9rqOT.js → mermaid-3ZIDBTTL-DYqrMrvl.js} +210 -193
  8. package/build/client/assets/root-D51qsCcK.css +1 -0
  9. package/build/client/assets/{root-ESATuWiF.js → root-cIgKV8UA.js} +6 -6
  10. package/build/client/assets/{run-detail-ClvtUP5Y.js → run-detail-xT6TzcQH.js} +4 -4
  11. package/build/client/assets/{workflow-graph-viewer-DWfB9i-1.js → workflow-graph-viewer-DDSZhqQ2.js} +19 -8
  12. package/build/client/assets/{zstd-browser-decoder-Cg5apldO.js → zstd-browser-decoder-BbUG_G04.js} +1 -1
  13. package/build/server/assets/{app-DB1r_8VA.js → app-DtQP9zzZ.js} +882 -573
  14. package/build/server/assets/{highlighted-body-B3W2YXNL-CHWCmTRA.js → highlighted-body-B3W2YXNL-0R2gvzDD.js} +1 -1
  15. package/build/server/assets/{index-B2Fjee_4.js → index-HeFIWQE6.js} +1 -1
  16. package/build/server/assets/{index-CvPUU1wY.js → index-xhDuD_-a.js} +2 -2
  17. package/build/server/assets/{mermaid-3ZIDBTTL-CNO9LDDa.js → mermaid-3ZIDBTTL-Bubx0Bc0.js} +1 -1
  18. package/build/server/assets/{token-C2ZfbDqj.js → token-Dp-Ryz8o.js} +1 -1
  19. package/build/server/assets/{token-util-Df3UC21b.js → token-util-D-AD5yDZ.js} +1 -1
  20. package/build/server/assets/{wrapper-D66LMJdl.js → wrapper-ikjqnRtL.js} +2 -2
  21. package/build/server/assets/{zstd-browser-decoder-DF4c9PWF.js → zstd-browser-decoder-uUOME713.js} +1 -1
  22. package/build/server/index.js +1 -1
  23. package/package.json +8 -8
  24. package/build/client/assets/app-BIKwaF7E.css +0 -1
  25. package/build/client/assets/root-grl25rxS.css +0 -1
@@ -48825,6 +48825,11 @@ const HookResumeContextSchema = compile(object$1({
48825
48825
  // Named `runSpecVersion` to distinguish it from the hook's own `specVersion`.
48826
48826
  runSpecVersion: number$3().optional(),
48827
48827
  workflowCoreVersion: string$2().optional(),
48828
+ // Node.js version of the run's creating deployment, mirrored from
48829
+ // `executionContext.nodeVersion`. Decides whether a resume may write zstd
48830
+ // (which needs Node.js >= 22.15) or must use gzip. Absent on runs created
48831
+ // before the field existed and on non-Node runtimes, where writers use gzip.
48832
+ nodeVersion: string$2().optional(),
48828
48833
  traceCarrier: TraceCarrierSchema.optional(),
48829
48834
  // The run's published X25519 public key (base64), mirrored from the run
48830
48835
  // entity. Lets a resume seal (`encp`) its payload to the run without reading
@@ -52798,6 +52803,13 @@ function requireMs() {
52798
52803
  var msExports = requireMs();
52799
52804
  const ms = /* @__PURE__ */ getDefaultExportFromCjs(msExports);
52800
52805
  function parseDurationToDate(param) {
52806
+ const date2 = durationToDate(param);
52807
+ if (Number.isNaN(date2.getTime())) {
52808
+ throw new Error(typeof param === "object" ? "Invalid date: the Date object does not hold a valid time." : `Invalid duration: ${JSON.stringify(param)} ends past the latest time a Date can represent.`);
52809
+ }
52810
+ return date2;
52811
+ }
52812
+ function durationToDate(param) {
52801
52813
  if (typeof param === "string") {
52802
52814
  const durationMs = ms(param);
52803
52815
  if (typeof durationMs !== "number" || durationMs < 0) {
@@ -55241,7 +55253,7 @@ function replaceEncryptedAndExpiredWithMarkers(resource) {
55241
55253
  }
55242
55254
  async function hydrateResourceIOAsync(resource, key) {
55243
55255
  const { hydrateDataWithKey: hydrateDataWithKey2, deriveRunPayloadKeys: deriveRunPayloadKeys2 } = await Promise.resolve().then(() => serializationFormat);
55244
- const { ensureZstdDecoderRegistered } = await import("./zstd-browser-decoder-DF4c9PWF.js");
55256
+ const { ensureZstdDecoderRegistered } = await import("./zstd-browser-decoder-uUOME713.js");
55245
55257
  ensureZstdDecoderRegistered();
55246
55258
  const cryptoKey = key ? await deriveRunPayloadKeys2(key) : void 0;
55247
55259
  const revivers = getRevivers();
@@ -56953,47 +56965,201 @@ function CollapsibleContent({ children: children2, className }) {
56953
56965
  function Collapsible({ label, children: children2, disabled, defaultOpen, onOpenChange }) {
56954
56966
  return jsxRuntimeExports.jsxs(CollapsibleRoot, { disabled, defaultOpen, onOpenChange, children: [jsxRuntimeExports.jsx(CollapsibleTrigger, { children: label }), children2 != null && jsxRuntimeExports.jsx(CollapsibleContent, { children: children2 })] });
56955
56967
  }
56956
- const buttonVariants$1 = cva([
56957
- "outline-none m-0 border-0 align-baseline no-underline group/trigger",
56958
- "relative cursor-pointer select-none transform translate-z-0",
56959
- "inline-flex max-w-full items-center justify-center gap-x-1 whitespace-nowrap rounded-md font-medium",
56960
- "!text-gray-100",
56961
- "bg-gray-1000",
56968
+ function setRef(ref2, value) {
56969
+ if (typeof ref2 === "function") {
56970
+ return ref2(value);
56971
+ } else if (ref2 !== null && ref2 !== void 0) {
56972
+ ref2.current = value;
56973
+ }
56974
+ }
56975
+ function composeRefs(...refs) {
56976
+ return (node2) => {
56977
+ let hasCleanup = false;
56978
+ const cleanups = refs.map((ref2) => {
56979
+ const cleanup = setRef(ref2, node2);
56980
+ if (!hasCleanup && typeof cleanup == "function") {
56981
+ hasCleanup = true;
56982
+ }
56983
+ return cleanup;
56984
+ });
56985
+ if (hasCleanup) {
56986
+ return () => {
56987
+ for (let i = 0; i < cleanups.length; i++) {
56988
+ const cleanup = cleanups[i];
56989
+ if (typeof cleanup == "function") {
56990
+ cleanup();
56991
+ } else {
56992
+ setRef(refs[i], null);
56993
+ }
56994
+ }
56995
+ };
56996
+ }
56997
+ };
56998
+ }
56999
+ function useComposedRefs(...refs) {
57000
+ return reactExports.useCallback(composeRefs(...refs), refs);
57001
+ }
57002
+ var Slot$3 = reactExports.forwardRef((props, forwardedRef) => {
57003
+ const { children: children2, ...slotProps } = props;
57004
+ const childrenArray = reactExports.Children.toArray(children2);
57005
+ const slottable = childrenArray.find(isSlottable$1);
57006
+ if (slottable) {
57007
+ const newElement = slottable.props.children;
57008
+ const newChildren = childrenArray.map((child) => {
57009
+ if (child === slottable) {
57010
+ if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
57011
+ return reactExports.isValidElement(newElement) ? newElement.props.children : null;
57012
+ } else {
57013
+ return child;
57014
+ }
57015
+ });
57016
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone$1, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null });
57017
+ }
57018
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone$1, { ...slotProps, ref: forwardedRef, children: children2 });
57019
+ });
57020
+ Slot$3.displayName = "Slot";
57021
+ var SlotClone$1 = reactExports.forwardRef((props, forwardedRef) => {
57022
+ const { children: children2, ...slotProps } = props;
57023
+ if (reactExports.isValidElement(children2)) {
57024
+ const childrenRef = getElementRef$2(children2);
57025
+ return reactExports.cloneElement(children2, {
57026
+ ...mergeProps$1(slotProps, children2.props),
57027
+ // @ts-ignore
57028
+ ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef
57029
+ });
57030
+ }
57031
+ return reactExports.Children.count(children2) > 1 ? reactExports.Children.only(null) : null;
57032
+ });
57033
+ SlotClone$1.displayName = "SlotClone";
57034
+ var Slottable$1 = ({ children: children2 }) => {
57035
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: children2 });
57036
+ };
57037
+ function isSlottable$1(child) {
57038
+ return reactExports.isValidElement(child) && child.type === Slottable$1;
57039
+ }
57040
+ function mergeProps$1(slotProps, childProps) {
57041
+ const overrideProps = { ...childProps };
57042
+ for (const propName in childProps) {
57043
+ const slotPropValue = slotProps[propName];
57044
+ const childPropValue = childProps[propName];
57045
+ const isHandler = /^on[A-Z]/.test(propName);
57046
+ if (isHandler) {
57047
+ if (slotPropValue && childPropValue) {
57048
+ overrideProps[propName] = (...args) => {
57049
+ childPropValue(...args);
57050
+ slotPropValue(...args);
57051
+ };
57052
+ } else if (slotPropValue) {
57053
+ overrideProps[propName] = slotPropValue;
57054
+ }
57055
+ } else if (propName === "style") {
57056
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
57057
+ } else if (propName === "className") {
57058
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
57059
+ }
57060
+ }
57061
+ return { ...slotProps, ...overrideProps };
57062
+ }
57063
+ function getElementRef$2(element2) {
57064
+ var _a3, _b2;
57065
+ let getter = (_a3 = Object.getOwnPropertyDescriptor(element2.props, "ref")) == null ? void 0 : _a3.get;
57066
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
57067
+ if (mayWarn) {
57068
+ return element2.ref;
57069
+ }
57070
+ getter = (_b2 = Object.getOwnPropertyDescriptor(element2, "ref")) == null ? void 0 : _b2.get;
57071
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
57072
+ if (mayWarn) {
57073
+ return element2.props.ref;
57074
+ }
57075
+ return element2.props.ref || element2.ref;
57076
+ }
57077
+ var Root$6 = Slot$3;
57078
+ const buttonVariants = cva([
57079
+ "group/trigger relative m-0 inline-flex max-w-full shrink-0 items-center justify-center gap-2",
57080
+ "cursor-pointer select-none whitespace-nowrap border-0 align-baseline font-medium no-underline outline-none",
57081
+ "transform translate-z-0",
57082
+ // Fill, text and border all come from --themed-*; the fallbacks below are
57083
+ // the inverted `default` variant, so it declares no colour tokens at all.
57084
+ "text-[var(--themed-fg,_var(--ds-background-100))]",
57085
+ "bg-[var(--themed-bg,_var(--ds-gray-1000))]",
57086
+ "shadow-[0_0_0_1px_var(--themed-border,_transparent)]",
57087
+ // Every variant declares --themed-hover-bg, so there is a single
57088
+ // `hover:bg-*` utility on the element and a call site that needs its own
57089
+ // hover fill replaces it in both themes at once.
57090
+ "hover:bg-[var(--themed-hover-bg)]",
56962
57091
  "transition-[border-color,background,color,transform,box-shadow] duration-150 ease-in-out",
56963
- // Geist invert hover: literal fallbacks (no token dep, so it resolves in any
56964
- // consuming app), darkened via ancestor theme class without a registered variant.
56965
- "hover:bg-[var(--themed-hover-bg,_hsl(0,_0%,_22%))]",
56966
- "[.dark-theme_&]:hover:bg-[var(--themed-hover-bg,_hsl(0,_0%,_80%))]",
56967
- "[[data-theme=dark]_&]:hover:bg-[var(--themed-hover-bg,_hsl(0,_0%,_80%))]",
56968
- // Geist focus ring as arbitrary properties (no bare `outline`/ambiguous
56969
- // arbitrary-color utilities, which differ between Tailwind v3 and v4).
56970
57092
  "focus-visible:[outline:2px_solid_var(--ds-focus-color)] focus-visible:[outline-offset:2px]",
56971
- // disabled styles
56972
- "disabled:cursor-not-allowed aria-disabled:cursor-not-allowed",
56973
- "disabled:bg-gray-100 disabled:!text-gray-700 disabled:hover:bg-gray-100",
56974
- "aria-disabled:bg-gray-100 aria-disabled:text-gray-700 aria-disabled:hover:bg-gray-100"
57093
+ "[&_svg]:shrink-0",
57094
+ // Disabled buttons flatten to the gray-100 fill with a gray-400 border.
57095
+ "disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-700 disabled:[--themed-border:_var(--ds-gray-400)] disabled:hover:bg-gray-100",
57096
+ "aria-disabled:cursor-not-allowed aria-disabled:bg-gray-100 aria-disabled:text-gray-700 aria-disabled:[--themed-border:_var(--ds-gray-400)] aria-disabled:hover:bg-gray-100"
56975
57097
  ], {
56976
57098
  variants: {
56977
57099
  variant: {
56978
- default: "",
56979
- secondary: "border border-gray-alpha-400 [--themed-bg:_var(--ds-background-100)] [--themed-fg:_var(--ds-gray-1000)] [--themed-hover-bg:_var(--ds-gray-alpha-200)]",
56980
- ghost: "[--themed-bg:_transparent] [--themed-fg:_var(--ds-gray-1000)] [--themed-hover-bg:_var(--ds-gray-alpha-100)]"
57100
+ // No `--ds-*` token sits one step lighter/darker than the inverted
57101
+ // fill, so its hover colours are literal — and they have to flip with
57102
+ // the theme, because the fill itself does.
57103
+ default: [
57104
+ "[--themed-hover-bg:_hsl(0,_0%,_22%)]",
57105
+ "[.dark_&]:[--themed-hover-bg:_hsl(0,_0%,_80%)]",
57106
+ "[.dark-theme_&]:[--themed-hover-bg:_hsl(0,_0%,_80%)]",
57107
+ "[[data-theme=dark]_&]:[--themed-hover-bg:_hsl(0,_0%,_80%)]"
57108
+ ],
57109
+ secondary: [
57110
+ "[--themed-bg:_var(--ds-background-100)]",
57111
+ "[--themed-fg:_var(--ds-gray-1000)]",
57112
+ "[--themed-border:_var(--ds-gray-400)]",
57113
+ "[--themed-hover-bg:_var(--ds-gray-100)]",
57114
+ "[.dark_&]:[--themed-hover-bg:_var(--ds-gray-200)]",
57115
+ "[.dark-theme_&]:[--themed-hover-bg:_var(--ds-gray-200)]",
57116
+ "[[data-theme=dark]_&]:[--themed-hover-bg:_var(--ds-gray-200)]"
57117
+ ],
57118
+ // Tertiary is the one variant allowed to go borderless when disabled;
57119
+ // it drops to 50% opacity instead.
57120
+ tertiary: [
57121
+ "[--themed-bg:_transparent]",
57122
+ "[--themed-fg:_var(--ds-gray-1000)]",
57123
+ "[--themed-border:_transparent]",
57124
+ // The alpha token already flips with the theme.
57125
+ "[--themed-hover-bg:_var(--ds-gray-alpha-200)]",
57126
+ "disabled:bg-transparent disabled:opacity-50 disabled:shadow-none disabled:hover:bg-transparent",
57127
+ "aria-disabled:bg-transparent aria-disabled:opacity-50 aria-disabled:shadow-none aria-disabled:hover:bg-transparent"
57128
+ ]
56981
57129
  },
57130
+ // Radii are literal rather than `rounded-md`/`rounded-lg`: apps that
57131
+ // still carry a shadcn theme redefine the `--radius-*` scale, and these
57132
+ // corners should not move with it.
56982
57133
  size: {
56983
- default: "h-10 px-4 text-button-14",
56984
- sm: "h-8 px-3 text-button-14",
56985
- xs: "h-6 px-1.5 py-0.5 text-button-12 rounded-[4px]",
56986
- icon: "h-8 w-8"
57134
+ tiny: "h-6 gap-1 rounded-[4px] px-1.5 text-button-12 [&_svg]:size-3",
57135
+ small: "h-8 rounded-[6px] px-3 text-button-14 [&_svg]:size-4",
57136
+ medium: "h-9 rounded-[6px] px-4 text-button-14 [&_svg]:size-4",
57137
+ large: "h-10 rounded-[8px] px-5 text-button-16 [&_svg]:size-4"
57138
+ },
57139
+ // Icon-only buttons: square keeps the size's radius, circle is a pill.
57140
+ shape: {
57141
+ square: "aspect-square px-0",
57142
+ circle: "aspect-square rounded-full px-0"
56987
57143
  }
56988
57144
  },
56989
57145
  defaultVariants: {
56990
57146
  variant: "default",
56991
- size: "default"
57147
+ size: "medium"
56992
57148
  }
56993
57149
  });
56994
- function Button$1({ className, variant, size: size2, type = "button", ...props }) {
56995
- return jsxRuntimeExports.jsx("button", { type, className: cn$4(buttonVariants$1({ variant, size: size2, className })), ...props });
56996
- }
57150
+ const Button = reactExports.forwardRef(({ className, variant, size: size2, shape, asChild = false, type, ...props }, ref2) => {
57151
+ const Comp = asChild ? Slot$3 : "button";
57152
+ return jsxRuntimeExports.jsx(Comp, {
57153
+ ref: ref2,
57154
+ // `type` only means anything on a real <button>; forwarding it to the
57155
+ // anchor (or whatever else) an `asChild` call site renders would be
57156
+ // invalid HTML.
57157
+ type: asChild ? type : type ?? "button",
57158
+ className: cn$4(buttonVariants({ variant, size: size2, shape, className })),
57159
+ ...props
57160
+ });
57161
+ });
57162
+ Button.displayName = "Button";
56997
57163
  function summarizeArrayBufferView(value) {
56998
57164
  const ta = value;
56999
57165
  const name2 = ta.constructor.name;
@@ -57203,7 +57369,7 @@ const RunClickContext = reactExports.createContext(void 0);
57203
57369
  function EncryptedInlineLabel() {
57204
57370
  const ctx = reactExports.useContext(DecryptClickContext);
57205
57371
  if (ctx) {
57206
- return jsxRuntimeExports.jsxs(Button$1, { size: "xs", className: "align-baseline gap-x-1", disabled: ctx.isDecrypting || ctx.isDecryptDisabled, title: ctx.isDecryptDisabled ? ctx.decryptDisabledReason : void 0, onClick: (e) => {
57372
+ return jsxRuntimeExports.jsxs(Button, { size: "tiny", className: "align-baseline", disabled: ctx.isDecrypting || ctx.isDecryptDisabled, title: ctx.isDecryptDisabled ? ctx.decryptDisabledReason : void 0, onClick: (e) => {
57207
57373
  e.stopPropagation();
57208
57374
  ctx.onDecrypt();
57209
57375
  }, children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 10 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), jsxRuntimeExports.jsx("span", { children: "Decrypt" })] });
@@ -57647,7 +57813,7 @@ const encryptedPlaceholderPreview = `{
57647
57813
  }`;
57648
57814
  function EncryptedDataBlock() {
57649
57815
  const ctx = reactExports.useContext(DecryptClickContext);
57650
- return jsxRuntimeExports.jsxs("div", { className: "relative min-h-20 overflow-hidden rounded-md border border-gray-alpha-400 bg-background-100", children: [jsxRuntimeExports.jsx("pre", { "aria-hidden": "true", className: "pointer-events-none m-0 select-none p-3 font-mono text-label-12 text-gray-900 blur-[4px]", children: encryptedPlaceholderPreview }), jsxRuntimeExports.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: ctx ? jsxRuntimeExports.jsxs(Button$1, { onClick: ctx.onDecrypt, disabled: ctx.isDecrypting || ctx.isDecryptDisabled, title: ctx.isDecryptDisabled ? ctx.decryptDisabledReason : void 0, size: "xs", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 10 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), jsxRuntimeExports.jsx("span", { children: "Decrypt" })] }) : jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1 rounded border border-gray-alpha-400 bg-gray-100 px-1.5 py-0.5 text-button-12 font-medium text-gray-700", children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), "Encrypted"] }) })] });
57816
+ return jsxRuntimeExports.jsxs("div", { className: "relative min-h-20 overflow-hidden rounded-md border border-gray-alpha-400 bg-background-100", children: [jsxRuntimeExports.jsx("pre", { "aria-hidden": "true", className: "pointer-events-none m-0 select-none p-3 font-mono text-label-12 text-gray-900 blur-[4px]", children: encryptedPlaceholderPreview }), jsxRuntimeExports.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: ctx ? jsxRuntimeExports.jsxs(Button, { onClick: ctx.onDecrypt, disabled: ctx.isDecrypting || ctx.isDecryptDisabled, title: ctx.isDecryptDisabled ? ctx.decryptDisabledReason : void 0, size: "tiny", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 10 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), jsxRuntimeExports.jsx("span", { children: "Decrypt" })] }) : jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1 rounded border border-gray-alpha-400 bg-gray-100 px-1.5 py-0.5 text-button-12 font-medium text-gray-700", children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), "Encrypted"] }) })] });
57651
57817
  }
57652
57818
  const serializeForClipboard = (value) => {
57653
57819
  if (typeof value === "string")
@@ -57768,116 +57934,6 @@ function AttrSetEventBlock({ data: data2 }) {
57768
57934
  const writerLabel = describeWriter(data2.writer);
57769
57935
  return jsxRuntimeExports.jsxs("div", { className: "flex flex-col px-3 py-1", children: [jsxRuntimeExports.jsx("div", { className: "flex flex-col", children: data2.changes.map((change, index2) => jsxRuntimeExports.jsx(AttributeRow, { attributeKey: change.key, removed: change.value === null, value: change.value ?? void 0 }, `${change.key}:${index2}`)) }), writerLabel && jsxRuntimeExports.jsx("div", { className: "border-gray-alpha-400 border-t py-1.5 text-gray-700 text-label-12", children: writerLabel })] });
57770
57936
  }
57771
- function setRef(ref2, value) {
57772
- if (typeof ref2 === "function") {
57773
- return ref2(value);
57774
- } else if (ref2 !== null && ref2 !== void 0) {
57775
- ref2.current = value;
57776
- }
57777
- }
57778
- function composeRefs(...refs) {
57779
- return (node2) => {
57780
- let hasCleanup = false;
57781
- const cleanups = refs.map((ref2) => {
57782
- const cleanup = setRef(ref2, node2);
57783
- if (!hasCleanup && typeof cleanup == "function") {
57784
- hasCleanup = true;
57785
- }
57786
- return cleanup;
57787
- });
57788
- if (hasCleanup) {
57789
- return () => {
57790
- for (let i = 0; i < cleanups.length; i++) {
57791
- const cleanup = cleanups[i];
57792
- if (typeof cleanup == "function") {
57793
- cleanup();
57794
- } else {
57795
- setRef(refs[i], null);
57796
- }
57797
- }
57798
- };
57799
- }
57800
- };
57801
- }
57802
- function useComposedRefs(...refs) {
57803
- return reactExports.useCallback(composeRefs(...refs), refs);
57804
- }
57805
- var Slot$3 = reactExports.forwardRef((props, forwardedRef) => {
57806
- const { children: children2, ...slotProps } = props;
57807
- const childrenArray = reactExports.Children.toArray(children2);
57808
- const slottable = childrenArray.find(isSlottable$1);
57809
- if (slottable) {
57810
- const newElement = slottable.props.children;
57811
- const newChildren = childrenArray.map((child) => {
57812
- if (child === slottable) {
57813
- if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
57814
- return reactExports.isValidElement(newElement) ? newElement.props.children : null;
57815
- } else {
57816
- return child;
57817
- }
57818
- });
57819
- return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone$1, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null });
57820
- }
57821
- return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone$1, { ...slotProps, ref: forwardedRef, children: children2 });
57822
- });
57823
- Slot$3.displayName = "Slot";
57824
- var SlotClone$1 = reactExports.forwardRef((props, forwardedRef) => {
57825
- const { children: children2, ...slotProps } = props;
57826
- if (reactExports.isValidElement(children2)) {
57827
- const childrenRef = getElementRef$2(children2);
57828
- return reactExports.cloneElement(children2, {
57829
- ...mergeProps$1(slotProps, children2.props),
57830
- // @ts-ignore
57831
- ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef
57832
- });
57833
- }
57834
- return reactExports.Children.count(children2) > 1 ? reactExports.Children.only(null) : null;
57835
- });
57836
- SlotClone$1.displayName = "SlotClone";
57837
- var Slottable$1 = ({ children: children2 }) => {
57838
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: children2 });
57839
- };
57840
- function isSlottable$1(child) {
57841
- return reactExports.isValidElement(child) && child.type === Slottable$1;
57842
- }
57843
- function mergeProps$1(slotProps, childProps) {
57844
- const overrideProps = { ...childProps };
57845
- for (const propName in childProps) {
57846
- const slotPropValue = slotProps[propName];
57847
- const childPropValue = childProps[propName];
57848
- const isHandler = /^on[A-Z]/.test(propName);
57849
- if (isHandler) {
57850
- if (slotPropValue && childPropValue) {
57851
- overrideProps[propName] = (...args) => {
57852
- childPropValue(...args);
57853
- slotPropValue(...args);
57854
- };
57855
- } else if (slotPropValue) {
57856
- overrideProps[propName] = slotPropValue;
57857
- }
57858
- } else if (propName === "style") {
57859
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
57860
- } else if (propName === "className") {
57861
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
57862
- }
57863
- }
57864
- return { ...slotProps, ...overrideProps };
57865
- }
57866
- function getElementRef$2(element2) {
57867
- var _a3, _b2;
57868
- let getter = (_a3 = Object.getOwnPropertyDescriptor(element2.props, "ref")) == null ? void 0 : _a3.get;
57869
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
57870
- if (mayWarn) {
57871
- return element2.ref;
57872
- }
57873
- getter = (_b2 = Object.getOwnPropertyDescriptor(element2, "ref")) == null ? void 0 : _b2.get;
57874
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
57875
- if (mayWarn) {
57876
- return element2.props.ref;
57877
- }
57878
- return element2.props.ref || element2.ref;
57879
- }
57880
- var Root$6 = Slot$3;
57881
57937
  var debounce_1;
57882
57938
  var hasRequiredDebounce;
57883
57939
  function requireDebounce() {
@@ -86185,7 +86241,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
86185
86241
  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 });
86186
86242
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
86187
86243
  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 }) });
86188
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-CHWCmTRA.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
86244
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-0R2gvzDD.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
86189
86245
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
86190
86246
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
86191
86247
  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 }) })] }) });
@@ -86507,7 +86563,7 @@ var Dt = ({ children: e, className: t, onDownload: o, onError: n }) => {
86507
86563
  }, []), 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] });
86508
86564
  };
86509
86565
  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 }) })] });
86510
- var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-CNO9LDDa.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
86566
+ var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-Bubx0Bc0.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
86511
86567
  function ke(e, t) {
86512
86568
  if (!(e != null && e.position || t != null && t.position)) return true;
86513
86569
  if (!(e != null && e.position && (t != null && t.position))) return false;
@@ -92286,56 +92342,6 @@ function ConnectionStatus() {
92286
92342
  ] }) })
92287
92343
  ] });
92288
92344
  }
92289
- const DEFAULT_PAGE_SIZE = 10;
92290
- function cn(...inputs) {
92291
- return twMerge(clsx(inputs));
92292
- }
92293
- const LIVE_UPDATE_INTERVAL_MS$1 = 5e3;
92294
- function getPaginationDisplay(currentPage, totalPages, hasMore) {
92295
- if (hasMore) {
92296
- return `Page ${currentPage} of ${totalPages}+`;
92297
- }
92298
- return `Page ${currentPage} of ${totalPages}`;
92299
- }
92300
- const buttonVariants = cva(
92301
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
92302
- {
92303
- variants: {
92304
- variant: {
92305
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
92306
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
92307
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
92308
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
92309
- ghost: "hover:bg-accent hover:text-accent-foreground",
92310
- link: "text-primary underline-offset-4 hover:underline"
92311
- },
92312
- size: {
92313
- default: "h-10 px-4 py-2",
92314
- sm: "h-9 rounded-md px-3",
92315
- lg: "h-11 rounded-md px-8",
92316
- icon: "h-10 w-10"
92317
- }
92318
- },
92319
- defaultVariants: {
92320
- variant: "default",
92321
- size: "default"
92322
- }
92323
- }
92324
- );
92325
- const Button = reactExports.forwardRef(
92326
- ({ className, variant, size: size2, asChild = false, ...props }, ref2) => {
92327
- const Comp = asChild ? Slot$3 : "button";
92328
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
92329
- Comp,
92330
- {
92331
- className: cn(buttonVariants({ variant, size: size2, className })),
92332
- ref: ref2,
92333
- ...props
92334
- }
92335
- );
92336
- }
92337
- );
92338
- Button.displayName = "Button";
92339
92345
  let decoder$1;
92340
92346
  try {
92341
92347
  decoder$1 = new TextDecoder();
@@ -94742,8 +94748,8 @@ function HealthCheckButton() {
94742
94748
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
94743
94749
  Button,
94744
94750
  {
94745
- variant: "ghost",
94746
- size: "sm",
94751
+ variant: "tertiary",
94752
+ size: "small",
94747
94753
  onClick: runChecks,
94748
94754
  disabled: isChecking,
94749
94755
  className: "gap-1.5",
@@ -94760,6 +94766,17 @@ function HealthCheckButton() {
94760
94766
  ] }) })
94761
94767
  ] });
94762
94768
  }
94769
+ const DEFAULT_PAGE_SIZE = 10;
94770
+ function cn(...inputs) {
94771
+ return twMerge(clsx(inputs));
94772
+ }
94773
+ const LIVE_UPDATE_INTERVAL_MS$1 = 5e3;
94774
+ function getPaginationDisplay(currentPage, totalPages, hasMore) {
94775
+ if (hasMore) {
94776
+ return `Page ${currentPage} of ${totalPages}+`;
94777
+ }
94778
+ return `Page ${currentPage} of ${totalPages}`;
94779
+ }
94763
94780
  function SegmentedControl({
94764
94781
  value,
94765
94782
  onValueChange,
@@ -94810,7 +94827,7 @@ function ThemePicker() {
94810
94827
  );
94811
94828
  }
94812
94829
  function DocsLink$1() {
94813
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
94830
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { asChild: true, variant: "secondary", size: "small", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
94814
94831
  "a",
94815
94832
  {
94816
94833
  href: "https://workflow-sdk.dev/docs/observability",
@@ -95583,6 +95600,7 @@ const STREAM_SERVER_RUN_ID_SYMBOL = Symbol.for("WORKFLOW_STREAM_SERVER_RUN_ID");
95583
95600
  const STREAM_SERVER_DEPLOYMENT_ID_SYMBOL = Symbol.for("WORKFLOW_STREAM_SERVER_DEPLOYMENT_ID");
95584
95601
  const STREAM_SERVER_PUBLIC_KEY_SYMBOL = Symbol.for("WORKFLOW_STREAM_SERVER_PUBLIC_KEY");
95585
95602
  const STREAM_DRAIN_SYMBOL = Symbol.for("WORKFLOW_STREAM_DRAIN");
95603
+ const STREAM_RELEASE_SYMBOL = Symbol.for("WORKFLOW_STREAM_RELEASE");
95586
95604
  const BODY_INIT_SYMBOL = Symbol.for("BODY_INIT");
95587
95605
  const WEBHOOK_RESPONSE_WRITABLE = Symbol.for("WEBHOOK_RESPONSE_WRITABLE");
95588
95606
  const WORKFLOW_CLASS_REGISTRY = Symbol.for("workflow-class-registry");
@@ -95662,12 +95680,12 @@ function isReadableUnlockedNotClosed(readable2) {
95662
95680
  return true;
95663
95681
  }
95664
95682
  function resolveAfterDrain(state) {
95665
- const barrier = state.drainBarrier;
95666
- if (!barrier) {
95667
- state.resolve();
95668
- return;
95669
- }
95670
- barrier().then(() => state.resolve(), (err) => state.reject(err));
95683
+ const release = async () => {
95684
+ var _a3, _b2;
95685
+ await ((_a3 = state.drainBarrier) == null ? void 0 : _a3.call(state));
95686
+ await ((_b2 = state.releaseTransport) == null ? void 0 : _b2.call(state));
95687
+ };
95688
+ release().then(() => state.resolve(), (err) => state.reject(err));
95671
95689
  }
95672
95690
  function markFlushableFrameProduced(state) {
95673
95691
  state.producedFrames++;
@@ -95749,6 +95767,7 @@ function trackFlushableWritable(writable, state, WritableStreamConstructor = Wri
95749
95767
  return Promise.resolve(false);
95750
95768
  }
95751
95769
  settlement = (async () => {
95770
+ var _a3;
95752
95771
  try {
95753
95772
  try {
95754
95773
  await checkpointWriter.write(checkpoint);
@@ -95761,6 +95780,7 @@ function trackFlushableWritable(writable, state, WritableStreamConstructor = Wri
95761
95780
  }
95762
95781
  }
95763
95782
  await drainFlushableSnapshot(state);
95783
+ await ((_a3 = state.releaseTransport) == null ? void 0 : _a3.call(state));
95764
95784
  if (!state.doneResolved) {
95765
95785
  state.doneResolved = true;
95766
95786
  state.resolve();
@@ -95832,6 +95852,10 @@ function flushablePipe(source, sink, state) {
95832
95852
  if (typeof drain === "function") {
95833
95853
  state.drainBarrier = drain;
95834
95854
  }
95855
+ const release = sink[STREAM_RELEASE_SYMBOL];
95856
+ if (typeof release === "function") {
95857
+ state.releaseTransport = release;
95858
+ }
95835
95859
  return flushablePipePerChunk(source, sink, state);
95836
95860
  }
95837
95861
  async function flushablePipePerChunk(source, sink, state) {
@@ -95885,6 +95909,8 @@ async function flushablePipePerChunk(source, sink, state) {
95885
95909
  await state.drainBarrier().catch(() => {
95886
95910
  });
95887
95911
  }
95912
+ await writer.abort(err).catch(() => {
95913
+ });
95888
95914
  if (!state.doneResolved) {
95889
95915
  state.doneResolved = true;
95890
95916
  state.reject(err);
@@ -95993,6 +96019,9 @@ const typedArrayBuffer = protoGetter(TypedArrayPrototype, "buffer");
95993
96019
  const typedArrayByteOffset = protoGetter(TypedArrayPrototype, "byteOffset");
95994
96020
  const typedArrayByteLength = protoGetter(TypedArrayPrototype, "byteLength");
95995
96021
  const typedArrayLength = protoGetter(TypedArrayPrototype, "length");
96022
+ const typedArraySet = uncurryThis(TypedArrayPrototype.set);
96023
+ const HostArrayBuffer = ArrayBuffer;
96024
+ const HostUint8Array = Uint8Array;
95996
96025
  const dataViewBuffer = protoGetter(DataView.prototype, "buffer");
95997
96026
  const dataViewByteOffset = protoGetter(DataView.prototype, "byteOffset");
95998
96027
  const dataViewByteLength = protoGetter(DataView.prototype, "byteLength");
@@ -96244,12 +96273,19 @@ const hardenedStringifyOperations = {
96244
96273
  entriesOf: (map2) => mapToEntries(map2),
96245
96274
  viewInfo: (view) => {
96246
96275
  const info = viewInfo(view);
96276
+ const length = types$5.isDataView(view) ? 0 : typedArrayLength(view);
96277
+ const bufferByteLength = types$5.isSharedArrayBuffer(info.buffer) ? sharedArrayBufferByteLength(info.buffer) : arrayBufferByteLength(info.buffer);
96278
+ if (info.byteLength === bufferByteLength) {
96279
+ return { ...info, length, bufferByteLength };
96280
+ }
96281
+ const copy = new HostArrayBuffer(info.byteLength);
96282
+ typedArraySet(new HostUint8Array(copy), new HostUint8Array(info.buffer, info.byteOffset, info.byteLength));
96247
96283
  return {
96248
- ...info,
96249
- // devalue only reads `length` for typed-array subviews; DataView
96250
- // subviews are encoded from `byteLength`.
96251
- length: types$5.isDataView(view) ? 0 : typedArrayLength(view),
96252
- bufferByteLength: types$5.isSharedArrayBuffer(info.buffer) ? sharedArrayBufferByteLength(info.buffer) : arrayBufferByteLength(info.buffer)
96284
+ buffer: copy,
96285
+ byteOffset: 0,
96286
+ byteLength: info.byteLength,
96287
+ length,
96288
+ bufferByteLength: info.byteLength
96253
96289
  };
96254
96290
  },
96255
96291
  shapeOf: (value) => {
@@ -96993,24 +97029,25 @@ function recordStats(stats2, codec, uncompressedBytes, storedBytes) {
96993
97029
  stats2.uncompressedBytes = uncompressedBytes;
96994
97030
  stats2.storedBytes = storedBytes;
96995
97031
  }
96996
- function selectWriteCodec() {
97032
+ function selectWriteCodec(mode) {
96997
97033
  const override = codecOverrideFromEnv();
96998
- if (override === "gzip")
97034
+ if (mode === "gzip" || override === "gzip") {
96999
97035
  return isGzipAvailable() ? "gzip" : "none";
97036
+ }
97000
97037
  if (isZstdAvailable())
97001
97038
  return "zstd";
97002
97039
  if (isGzipAvailable())
97003
97040
  return "gzip";
97004
97041
  return "none";
97005
97042
  }
97006
- async function compress(data2, enabled, stats2, opts) {
97043
+ async function compress(data2, mode, stats2, opts) {
97007
97044
  if (!(data2 instanceof Uint8Array))
97008
97045
  return data2;
97009
- if (!enabled || data2.length < COMPRESSION_MIN_BYTES || isCompressionDisabledByEnv()) {
97046
+ if (!mode || data2.length < COMPRESSION_MIN_BYTES || isCompressionDisabledByEnv()) {
97010
97047
  recordStats(stats2, "none", data2.length, data2.length);
97011
97048
  return data2;
97012
97049
  }
97013
- const codec = selectWriteCodec();
97050
+ const codec = selectWriteCodec(mode);
97014
97051
  if (codec === "none") {
97015
97052
  recordStats(stats2, "none", data2.length, data2.length);
97016
97053
  return data2;
@@ -97071,7 +97108,7 @@ async function serialize$3(value, encryptionKey, options) {
97071
97108
  try {
97072
97109
  const payload = devalueCodec.serialize(value, "client", options);
97073
97110
  const prefixed = encodeWithFormatPrefix(SerializationFormat$1.DEVALUE_V1, payload);
97074
- const compressed = await compress(prefixed, (options == null ? void 0 : options.compression) === true, options == null ? void 0 : options.compressionStats);
97111
+ const compressed = await compress(prefixed, (options == null ? void 0 : options.compression) ?? false, options == null ? void 0 : options.compressionStats);
97075
97112
  return encrypt(compressed, encryptionKey);
97076
97113
  } catch (error2) {
97077
97114
  rethrowIfRuntimeError(error2);
@@ -97097,7 +97134,7 @@ async function serialize$2(value, encryptionKey, options) {
97097
97134
  try {
97098
97135
  const payload = devalueCodec.serialize(value, "step", options);
97099
97136
  const prefixed = encodeWithFormatPrefix(SerializationFormat$1.DEVALUE_V1, payload);
97100
- const compressed = await compress(prefixed, (options == null ? void 0 : options.compression) === true, options == null ? void 0 : options.compressionStats);
97137
+ const compressed = await compress(prefixed, (options == null ? void 0 : options.compression) ?? false, options == null ? void 0 : options.compressionStats);
97101
97138
  return encrypt(compressed, encryptionKey);
97102
97139
  } catch (error2) {
97103
97140
  rethrowIfRuntimeError(error2);
@@ -98029,6 +98066,15 @@ class WorkflowServerWritableStream extends WritableStream {
98029
98066
  enumerable: false,
98030
98067
  writable: false
98031
98068
  });
98069
+ Object.defineProperty(this, STREAM_RELEASE_SYMBOL, {
98070
+ value: async () => {
98071
+ var _a3;
98072
+ const session = await writeSessionPromise.catch(() => void 0);
98073
+ await ((_a3 = session == null ? void 0 : session.release) == null ? void 0 : _a3.call(session));
98074
+ },
98075
+ enumerable: false,
98076
+ writable: false
98077
+ });
98032
98078
  }
98033
98079
  }
98034
98080
  function getAllBaseReducers(global2 = globalThis) {
@@ -98800,7 +98846,7 @@ function getWorkflowRevivers(global2 = globalThis) {
98800
98846
  }
98801
98847
  };
98802
98848
  }
98803
- function getStepRevivers(global2 = globalThis, ops, runId, cryptoKey, deploymentId, streamStates) {
98849
+ function getStepRevivers(global2 = globalThis, ops, runId, cryptoKey, deploymentId, streamStates, runReadyBarrier) {
98804
98850
  return {
98805
98851
  ...getCommonRevivers(global2),
98806
98852
  // StepFunction reviver for step context - returns raw step function
@@ -98916,7 +98962,7 @@ function getStepRevivers(global2 = globalThis, ops, runId, cryptoKey, deployment
98916
98962
  pollReadableLock(userReadable, state);
98917
98963
  return userReadable;
98918
98964
  } else {
98919
- const transform2 = getDeserializeStream(getStepRevivers(global2, ops, runId, cryptoKey, deploymentId), cryptoKey);
98965
+ const transform2 = getDeserializeStream(getStepRevivers(global2, ops, runId, cryptoKey, deploymentId, streamStates, runReadyBarrier), cryptoKey);
98920
98966
  const state = createFlushableState();
98921
98967
  ops.push(state.promise);
98922
98968
  flushablePipe(readable2, transform2.writable, state).catch(() => {
@@ -98929,8 +98975,9 @@ function getStepRevivers(global2 = globalThis, ops, runId, cryptoKey, deployment
98929
98975
  const targetRunId = typeof value.runId === "string" ? value.runId : runId;
98930
98976
  const targetDeploymentId = typeof value.deploymentId === "string" ? value.deploymentId : targetRunId === runId ? deploymentId : void 0;
98931
98977
  const targetKey = targetRunId === runId ? cryptoKey : lazyForwardedWritableEncryptionKey(targetRunId, targetDeploymentId, value.encryptionPublicKey);
98932
- const serialize2 = getSerializeStream(getStepReducers(global2, ops, targetRunId, targetKey), targetKey);
98933
- const serverWritable = new WorkflowServerWritableStream(targetRunId, value.name);
98978
+ const targetRunReady = targetRunId === runId ? runReadyBarrier : void 0;
98979
+ const serialize2 = getSerializeStream(getStepReducers(global2, ops, targetRunId, targetKey, false, targetRunReady), targetKey);
98980
+ const serverWritable = new WorkflowServerWritableStream(targetRunId, value.name, targetRunReady);
98934
98981
  const state = createFlushableState();
98935
98982
  state.deferReleaseSettlement = streamStates !== void 0;
98936
98983
  ops.push(state.promise);
@@ -99051,12 +99098,12 @@ async function dehydrateStepArguments(value, _runId, key, global2 = globalThis,
99051
99098
  throw new SerializationError(message2, { hint: hint2, cause });
99052
99099
  }
99053
99100
  }
99054
- async function hydrateStepArguments(value, runId, key, ops = [], global2 = globalThis, extraRevivers = {}, deploymentId, streamStates) {
99101
+ async function hydrateStepArguments(value, runId, key, ops = [], global2 = globalThis, extraRevivers = {}, deploymentId, streamStates, runReadyBarrier) {
99055
99102
  const compressionStats = {};
99056
99103
  const result = await deserialize$1(value, key, {
99057
99104
  global: global2,
99058
99105
  extraRevivers: {
99059
- ...getStreamAndRequestRevivers(getStepRevivers(global2, ops, runId, key, deploymentId, streamStates)),
99106
+ ...getStreamAndRequestRevivers(getStepRevivers(global2, ops, runId, key, deploymentId, streamStates, runReadyBarrier)),
99060
99107
  ...extraRevivers
99061
99108
  },
99062
99109
  compressionStats
@@ -104950,173 +104997,6 @@ function readDynamicWorkflowMetadata(executionContext) {
104950
104997
  steps: candidate.steps && typeof candidate.steps === "object" ? candidate.steps : {}
104951
104998
  };
104952
104999
  }
104953
- const version$1 = "5.0.1";
104954
- const DEFAULT_HEALTH_CHECK_TIMEOUT = 3e4;
104955
- const SAFE_WORKFLOW_NAME_PATTERN = /^[a-zA-Z0-9_\-./@()[\]]+$/;
104956
- function getWorkflowQueueName(workflowName, namespace2) {
104957
- if (!SAFE_WORKFLOW_NAME_PATTERN.test(workflowName)) {
104958
- throw new Error(`Invalid workflow name "${workflowName}": must only contain alphanumeric characters, underscores, hyphens, dots, forward slashes, at signs, parentheses, or square brackets`);
104959
- }
104960
- const prefix = getQueueTopicPrefix("workflow", resolveQueueNamespace(namespace2));
104961
- return `${prefix}${workflowName}`;
104962
- }
104963
- const generateId = monotonicFactory();
104964
- function getHealthCheckStreamName(correlationId) {
104965
- return `__health_check__${correlationId}`;
104966
- }
104967
- function generateHealthCheckRunId(correlationId) {
104968
- return `wrun_hc_${correlationId}`;
104969
- }
104970
- const HEALTH_CHECK_POLL_INTERVAL = 100;
104971
- const HEALTH_CHECK_READ_TIMEOUT = 500;
104972
- function withDeadline(promise2, ms2) {
104973
- let timer2;
104974
- return Promise.race([
104975
- promise2,
104976
- new Promise((_2, reject) => {
104977
- timer2 = setTimeout(() => reject(new Error(`Operation timed out after ${ms2}ms`)), ms2);
104978
- })
104979
- ]).finally(() => clearTimeout(timer2));
104980
- }
104981
- async function readStreamWithTimeout(reader, readTimeout) {
104982
- const chunks = [];
104983
- let done = false;
104984
- let timedOut = false;
104985
- while (!done && !timedOut) {
104986
- const readPromise = reader.read();
104987
- const timeoutPromise = new Promise((resolve2) => setTimeout(() => {
104988
- timedOut = true;
104989
- resolve2({ done: true, value: void 0 });
104990
- }, readTimeout));
104991
- const result = await Promise.race([readPromise, timeoutPromise]);
104992
- done = result.done;
104993
- if (result.value)
104994
- chunks.push(result.value);
104995
- }
104996
- return { chunks, timedOut };
104997
- }
104998
- function parseHealthCheckResponse(chunks) {
104999
- if (chunks.length === 0)
105000
- return null;
105001
- const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
105002
- const combined = new Uint8Array(totalLength);
105003
- let offset3 = 0;
105004
- for (const chunk of chunks) {
105005
- combined.set(chunk, offset3);
105006
- offset3 += chunk.length;
105007
- }
105008
- const responseText = new TextDecoder().decode(combined);
105009
- let response2;
105010
- try {
105011
- response2 = JSON.parse(responseText);
105012
- } catch {
105013
- if (responseText.length > 0) {
105014
- return { healthy: true, format: "text" };
105015
- }
105016
- return null;
105017
- }
105018
- if (typeof response2 !== "object" || response2 === null || !("healthy" in response2) || typeof response2.healthy !== "boolean") {
105019
- return null;
105020
- }
105021
- const r2 = response2;
105022
- const parsed = {
105023
- healthy: r2.healthy,
105024
- format: "json"
105025
- };
105026
- if (typeof r2.specVersion === "number") {
105027
- parsed.specVersion = r2.specVersion;
105028
- }
105029
- if (typeof r2.workflowCoreVersion === "string") {
105030
- parsed.workflowCoreVersion = r2.workflowCoreVersion;
105031
- }
105032
- if (typeof r2.encryptionPublicKey === "string") {
105033
- parsed.encryptionPublicKey = r2.encryptionPublicKey;
105034
- }
105035
- if (typeof r2.hookResumeInputVersion === "number") {
105036
- parsed.hookResumeInputVersion = r2.hookResumeInputVersion;
105037
- }
105038
- if (typeof r2.dynamicWorkflowVersion === "number") {
105039
- parsed.dynamicWorkflowVersion = r2.dynamicWorkflowVersion;
105040
- }
105041
- return parsed;
105042
- }
105043
- async function healthCheck(world, options) {
105044
- var _a3;
105045
- const timeout2 = (options == null ? void 0 : options.timeout) ?? DEFAULT_HEALTH_CHECK_TIMEOUT;
105046
- const correlationId = ((_a3 = world.createRunId) == null ? void 0 : _a3.call(world)) ?? generateId();
105047
- const streamName = getHealthCheckStreamName(correlationId);
105048
- const queueName = `${getQueueTopicPrefix("workflow", resolveQueueNamespace(options == null ? void 0 : options.namespace))}health_check`;
105049
- const startTime = Date.now();
105050
- try {
105051
- await world.queue(queueName, {
105052
- __healthCheck: true,
105053
- correlationId,
105054
- ...(options == null ? void 0 : options.runId) ? { runId: options.runId } : {}
105055
- }, {
105056
- // Use JSON transport so the health check works against both
105057
- // old (JSON-only) and new (dual) deployments.
105058
- specVersion: SPEC_VERSION_LEGACY,
105059
- deploymentId: options == null ? void 0 : options.deploymentId
105060
- });
105061
- while (Date.now() - startTime < timeout2) {
105062
- try {
105063
- const remainingMs = timeout2 - (Date.now() - startTime);
105064
- const stream2 = await withDeadline(world.streams.get(generateHealthCheckRunId(correlationId), streamName), remainingMs);
105065
- const reader = stream2.getReader();
105066
- const { chunks, timedOut } = await readStreamWithTimeout(reader, HEALTH_CHECK_READ_TIMEOUT);
105067
- if (timedOut) {
105068
- try {
105069
- reader.cancel();
105070
- } catch {
105071
- }
105072
- await new Promise((resolve2) => setTimeout(resolve2, HEALTH_CHECK_POLL_INTERVAL));
105073
- continue;
105074
- }
105075
- const response2 = parseHealthCheckResponse(chunks);
105076
- if (response2) {
105077
- return {
105078
- ...response2,
105079
- latencyMs: Date.now() - startTime
105080
- };
105081
- }
105082
- await new Promise((resolve2) => setTimeout(resolve2, HEALTH_CHECK_POLL_INTERVAL));
105083
- } catch {
105084
- await new Promise((resolve2) => setTimeout(resolve2, HEALTH_CHECK_POLL_INTERVAL));
105085
- }
105086
- }
105087
- return {
105088
- healthy: false,
105089
- error: `Health check timed out after ${timeout2}ms`
105090
- };
105091
- } catch (error2) {
105092
- return {
105093
- healthy: false,
105094
- error: error2 instanceof Error ? error2.message : String(error2)
105095
- };
105096
- }
105097
- }
105098
- function normalizeAttributeChanges(attrs, options = {}, writer) {
105099
- if (attrs === null || typeof attrs !== "object" || Array.isArray(attrs)) {
105100
- throw new FatalError(`setAttributes requires a plain object, got ${attrs === null ? "null" : Array.isArray(attrs) ? "array" : typeof attrs}`);
105101
- }
105102
- const changes = Object.entries(attrs).map(([key, value]) => ({
105103
- key,
105104
- value: value === void 0 ? null : value
105105
- }));
105106
- if (changes.length === 0)
105107
- return changes;
105108
- const allowReservedAttributes = options.allowReservedAttributes === true;
105109
- try {
105110
- validateAttributeChanges(changes, { allowReservedAttributes });
105111
- if (writer) ;
105112
- } catch (err) {
105113
- if (err instanceof AttributeValidationError) {
105114
- throw new FatalError(err.message);
105115
- }
105116
- throw err;
105117
- }
105118
- return changes;
105119
- }
105120
105000
  var re = { exports: {} };
105121
105001
  var constants$6;
105122
105002
  var hasRequiredConstants$6;
@@ -107058,7 +106938,8 @@ const FORMAT_VERSION_TABLE = [
107058
106938
  // bump to the next beta. A too-low cutoff makes new producers write
107059
106939
  // compressed payloads to consumers that cannot decompress them; too-high
107060
106940
  // merely delays the optimization (safe). gzip and zstd ship together, so
107061
- // they share a min version: a run that can read one can read both.
106941
+ // they share a min version. zstd additionally requires the run's runtime to
106942
+ // decode it; see `getRunCapabilities`.
107062
106943
  { format: SerializationFormat$1.GZIP, minVersion: "5.0.0-beta.18" },
107063
106944
  { format: SerializationFormat$1.ZSTD, minVersion: "5.0.0-beta.18" },
107064
106945
  // TODO(release): verify this matches the actual version that ships sealed-box
@@ -107089,7 +106970,25 @@ const CAPABILITY_VERSION_TABLE = [
107089
106970
  const BASELINE_FORMATS = /* @__PURE__ */ new Set([
107090
106971
  SerializationFormat$1.DEVALUE_V1
107091
106972
  ]);
107092
- function getRunCapabilities(workflowCoreVersion) {
106973
+ const ZSTD_NODE_RANGE = "^22.15.0 || >=23.8.0";
106974
+ function nodeVersionSupportsZstd(nodeVersion) {
106975
+ if (typeof nodeVersion !== "string" || !semver.valid(nodeVersion)) {
106976
+ return false;
106977
+ }
106978
+ return semver.satisfies(nodeVersion, ZSTD_NODE_RANGE);
106979
+ }
106980
+ function getCurrentNodeVersion() {
106981
+ var _a3;
106982
+ try {
106983
+ const versions = (_a3 = globalThis.process) == null ? void 0 : _a3.versions;
106984
+ if (!versions || versions.bun || versions.deno)
106985
+ return void 0;
106986
+ return typeof versions.node === "string" ? versions.node : void 0;
106987
+ } catch {
106988
+ return void 0;
106989
+ }
106990
+ }
106991
+ function getRunCapabilities(workflowCoreVersion, nodeVersion) {
107093
106992
  if (!workflowCoreVersion || !semver.valid(workflowCoreVersion)) {
107094
106993
  return {
107095
106994
  supportedFormats: BASELINE_FORMATS,
@@ -107102,6 +107001,9 @@ function getRunCapabilities(workflowCoreVersion) {
107102
107001
  formats.add(format2);
107103
107002
  }
107104
107003
  }
107004
+ if (!nodeVersionSupportsZstd(nodeVersion)) {
107005
+ formats.delete(SerializationFormat$1.ZSTD);
107006
+ }
107105
107007
  const result = {
107106
107008
  supportedFormats: formats,
107107
107009
  framedByteStreams: false
@@ -107113,6 +107015,182 @@ function getRunCapabilities(workflowCoreVersion) {
107113
107015
  }
107114
107016
  return result;
107115
107017
  }
107018
+ function getCompressionMode(capabilities) {
107019
+ if (!capabilities.supportedFormats.has(SerializationFormat$1.GZIP)) {
107020
+ return false;
107021
+ }
107022
+ return capabilities.supportedFormats.has(SerializationFormat$1.ZSTD) ? true : "gzip";
107023
+ }
107024
+ const version$1 = "5.1.0";
107025
+ const DEFAULT_HEALTH_CHECK_TIMEOUT = 3e4;
107026
+ const SAFE_WORKFLOW_NAME_PATTERN = /^[a-zA-Z0-9_\-./@()[\]]+$/;
107027
+ function getWorkflowQueueName(workflowName, namespace2) {
107028
+ if (!SAFE_WORKFLOW_NAME_PATTERN.test(workflowName)) {
107029
+ throw new Error(`Invalid workflow name "${workflowName}": must only contain alphanumeric characters, underscores, hyphens, dots, forward slashes, at signs, parentheses, or square brackets`);
107030
+ }
107031
+ const prefix = getQueueTopicPrefix("workflow", resolveQueueNamespace(namespace2));
107032
+ return `${prefix}${workflowName}`;
107033
+ }
107034
+ const generateId = monotonicFactory();
107035
+ function getHealthCheckStreamName(correlationId) {
107036
+ return `__health_check__${correlationId}`;
107037
+ }
107038
+ function generateHealthCheckRunId(correlationId) {
107039
+ return `wrun_hc_${correlationId}`;
107040
+ }
107041
+ const HEALTH_CHECK_POLL_INTERVAL = 100;
107042
+ const HEALTH_CHECK_READ_TIMEOUT = 500;
107043
+ function withDeadline(promise2, ms2) {
107044
+ let timer2;
107045
+ return Promise.race([
107046
+ promise2,
107047
+ new Promise((_2, reject) => {
107048
+ timer2 = setTimeout(() => reject(new Error(`Operation timed out after ${ms2}ms`)), ms2);
107049
+ })
107050
+ ]).finally(() => clearTimeout(timer2));
107051
+ }
107052
+ async function readStreamWithTimeout(reader, readTimeout) {
107053
+ const chunks = [];
107054
+ let done = false;
107055
+ let timedOut = false;
107056
+ while (!done && !timedOut) {
107057
+ const readPromise = reader.read();
107058
+ const timeoutPromise = new Promise((resolve2) => setTimeout(() => {
107059
+ timedOut = true;
107060
+ resolve2({ done: true, value: void 0 });
107061
+ }, readTimeout));
107062
+ const result = await Promise.race([readPromise, timeoutPromise]);
107063
+ done = result.done;
107064
+ if (result.value)
107065
+ chunks.push(result.value);
107066
+ }
107067
+ return { chunks, timedOut };
107068
+ }
107069
+ function parseHealthCheckResponse(chunks) {
107070
+ if (chunks.length === 0)
107071
+ return null;
107072
+ const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
107073
+ const combined = new Uint8Array(totalLength);
107074
+ let offset3 = 0;
107075
+ for (const chunk of chunks) {
107076
+ combined.set(chunk, offset3);
107077
+ offset3 += chunk.length;
107078
+ }
107079
+ const responseText = new TextDecoder().decode(combined);
107080
+ let response2;
107081
+ try {
107082
+ response2 = JSON.parse(responseText);
107083
+ } catch {
107084
+ if (responseText.length > 0) {
107085
+ return { healthy: true, format: "text" };
107086
+ }
107087
+ return null;
107088
+ }
107089
+ if (typeof response2 !== "object" || response2 === null || !("healthy" in response2) || typeof response2.healthy !== "boolean") {
107090
+ return null;
107091
+ }
107092
+ const r2 = response2;
107093
+ const parsed = {
107094
+ healthy: r2.healthy,
107095
+ format: "json"
107096
+ };
107097
+ if (typeof r2.specVersion === "number") {
107098
+ parsed.specVersion = r2.specVersion;
107099
+ }
107100
+ if (typeof r2.workflowCoreVersion === "string") {
107101
+ parsed.workflowCoreVersion = r2.workflowCoreVersion;
107102
+ }
107103
+ if (typeof r2.nodeVersion === "string") {
107104
+ parsed.nodeVersion = r2.nodeVersion;
107105
+ }
107106
+ if (typeof r2.encryptionPublicKey === "string") {
107107
+ parsed.encryptionPublicKey = r2.encryptionPublicKey;
107108
+ }
107109
+ if (typeof r2.hookResumeInputVersion === "number") {
107110
+ parsed.hookResumeInputVersion = r2.hookResumeInputVersion;
107111
+ }
107112
+ if (typeof r2.dynamicWorkflowVersion === "number") {
107113
+ parsed.dynamicWorkflowVersion = r2.dynamicWorkflowVersion;
107114
+ }
107115
+ return parsed;
107116
+ }
107117
+ async function healthCheck(world, options) {
107118
+ var _a3;
107119
+ const timeout2 = (options == null ? void 0 : options.timeout) ?? DEFAULT_HEALTH_CHECK_TIMEOUT;
107120
+ const correlationId = ((_a3 = world.createRunId) == null ? void 0 : _a3.call(world)) ?? generateId();
107121
+ const streamName = getHealthCheckStreamName(correlationId);
107122
+ const queueName = `${getQueueTopicPrefix("workflow", resolveQueueNamespace(options == null ? void 0 : options.namespace))}health_check`;
107123
+ const startTime = Date.now();
107124
+ try {
107125
+ await world.queue(queueName, {
107126
+ __healthCheck: true,
107127
+ correlationId,
107128
+ ...(options == null ? void 0 : options.runId) ? { runId: options.runId } : {}
107129
+ }, {
107130
+ // Use JSON transport so the health check works against both
107131
+ // old (JSON-only) and new (dual) deployments.
107132
+ specVersion: SPEC_VERSION_LEGACY,
107133
+ deploymentId: options == null ? void 0 : options.deploymentId
107134
+ });
107135
+ while (Date.now() - startTime < timeout2) {
107136
+ try {
107137
+ const remainingMs = timeout2 - (Date.now() - startTime);
107138
+ const stream2 = await withDeadline(world.streams.get(generateHealthCheckRunId(correlationId), streamName), remainingMs);
107139
+ const reader = stream2.getReader();
107140
+ const { chunks, timedOut } = await readStreamWithTimeout(reader, HEALTH_CHECK_READ_TIMEOUT);
107141
+ if (timedOut) {
107142
+ try {
107143
+ reader.cancel();
107144
+ } catch {
107145
+ }
107146
+ await new Promise((resolve2) => setTimeout(resolve2, HEALTH_CHECK_POLL_INTERVAL));
107147
+ continue;
107148
+ }
107149
+ const response2 = parseHealthCheckResponse(chunks);
107150
+ if (response2) {
107151
+ return {
107152
+ ...response2,
107153
+ latencyMs: Date.now() - startTime
107154
+ };
107155
+ }
107156
+ await new Promise((resolve2) => setTimeout(resolve2, HEALTH_CHECK_POLL_INTERVAL));
107157
+ } catch {
107158
+ await new Promise((resolve2) => setTimeout(resolve2, HEALTH_CHECK_POLL_INTERVAL));
107159
+ }
107160
+ }
107161
+ return {
107162
+ healthy: false,
107163
+ error: `Health check timed out after ${timeout2}ms`
107164
+ };
107165
+ } catch (error2) {
107166
+ return {
107167
+ healthy: false,
107168
+ error: error2 instanceof Error ? error2.message : String(error2)
107169
+ };
107170
+ }
107171
+ }
107172
+ function normalizeAttributeChanges(attrs, options = {}, writer) {
107173
+ if (attrs === null || typeof attrs !== "object" || Array.isArray(attrs)) {
107174
+ throw new FatalError(`setAttributes requires a plain object, got ${attrs === null ? "null" : Array.isArray(attrs) ? "array" : typeof attrs}`);
107175
+ }
107176
+ const changes = Object.entries(attrs).map(([key, value]) => ({
107177
+ key,
107178
+ value: value === void 0 ? null : value
107179
+ }));
107180
+ if (changes.length === 0)
107181
+ return changes;
107182
+ const allowReservedAttributes = options.allowReservedAttributes === true;
107183
+ try {
107184
+ validateAttributeChanges(changes, { allowReservedAttributes });
107185
+ if (writer) ;
107186
+ } catch (err) {
107187
+ if (err instanceof AttributeValidationError) {
107188
+ throw new FatalError(err.message);
107189
+ }
107190
+ throw err;
107191
+ }
107192
+ return changes;
107193
+ }
107116
107194
  const WORKFLOW_VMS = ["node", "quickjs"];
107117
107195
  function getWorkflowVmFromEnv(env2 = process.env) {
107118
107196
  const raw2 = env2.WORKFLOW_VM;
@@ -107134,7 +107212,7 @@ function getSnapshotThresholdFromEnv(env2 = process.env) {
107134
107212
  return parsed;
107135
107213
  }
107136
107214
  function waitUntil(promise2) {
107137
- void import("./index-B2Fjee_4.js").then((n) => n.i).then(({ waitUntil: waitUntil2 }) => {
107215
+ void import("./index-HeFIWQE6.js").then((n) => n.i).then(({ waitUntil: waitUntil2 }) => {
107138
107216
  waitUntil2(promise2);
107139
107217
  });
107140
107218
  }
@@ -107312,20 +107390,23 @@ async function start$1(workflow, argsOrOptions, options) {
107312
107390
  throw dynamicStartRefusal("Dynamic workflows require a World that declares `capabilities.dynamicWorkflowCode`. This World does not, so no run was created.");
107313
107391
  }
107314
107392
  let framedByteStreams;
107315
- let targetSupportsCompression;
107393
+ let targetCompression;
107394
+ let targetNodeVersion;
107316
107395
  let targetHookResumeInputVersion;
107317
107396
  let probedRunPublicKey;
107318
107397
  let targetSpecVersion;
107319
107398
  let specVersionSource;
107320
107399
  if (!crossDeployment) {
107321
107400
  framedByteStreams = true;
107322
- targetSupportsCompression = true;
107401
+ targetCompression = true;
107402
+ targetNodeVersion = getCurrentNodeVersion();
107323
107403
  targetHookResumeInputVersion = HOOK_RESUME_INPUT_VERSION;
107324
107404
  targetSpecVersion = world.specVersion;
107325
107405
  specVersionSource = "same-deployment";
107326
107406
  } else if (typeof ((_b2 = world.streams) == null ? void 0 : _b2.get) !== "function") {
107327
107407
  framedByteStreams = false;
107328
- targetSupportsCompression = false;
107408
+ targetCompression = false;
107409
+ targetNodeVersion = void 0;
107329
107410
  targetHookResumeInputVersion = void 0;
107330
107411
  ({ specVersion: targetSpecVersion, source: specVersionSource } = resolveCrossDeploymentSpecVersion(void 0, world.specVersion));
107331
107412
  } else {
@@ -107335,9 +107416,10 @@ async function start$1(workflow, argsOrOptions, options) {
107335
107416
  namespace: opts.namespace
107336
107417
  });
107337
107418
  probedRunPublicKey = probe == null ? void 0 : probe.encryptionPublicKey;
107338
- const capabilities = getRunCapabilities(probe == null ? void 0 : probe.workflowCoreVersion);
107419
+ const capabilities = getRunCapabilities(probe == null ? void 0 : probe.workflowCoreVersion, probe == null ? void 0 : probe.nodeVersion);
107339
107420
  framedByteStreams = capabilities.framedByteStreams;
107340
- targetSupportsCompression = capabilities.supportedFormats.has(SerializationFormat$1.GZIP);
107421
+ targetCompression = getCompressionMode(capabilities);
107422
+ targetNodeVersion = probe == null ? void 0 : probe.nodeVersion;
107341
107423
  targetHookResumeInputVersion = probe == null ? void 0 : probe.hookResumeInputVersion;
107342
107424
  ({ specVersion: targetSpecVersion, source: specVersionSource } = resolveCrossDeploymentSpecVersion(probe, world.specVersion));
107343
107425
  span == null ? void 0 : span.setAttributes({
@@ -107421,6 +107503,7 @@ async function start$1(workflow, argsOrOptions, options) {
107421
107503
  const executionContext = {
107422
107504
  traceCarrier,
107423
107505
  workflowCoreVersion: version$1,
107506
+ ...targetNodeVersion ? { nodeVersion: targetNodeVersion } : {},
107424
107507
  features: { encryption: !!encryptionKey },
107425
107508
  ...targetHookResumeInputVersion !== void 0 ? { hookResumeInputVersion: targetHookResumeInputVersion } : {},
107426
107509
  ...workflowVm ? { workflowVm } : {},
@@ -107435,7 +107518,7 @@ async function start$1(workflow, argsOrOptions, options) {
107435
107518
  throw dynamicStartRefusalFrom(err);
107436
107519
  }
107437
107520
  }
107438
- const compression = targetSupportsCompression && specVersion >= SPEC_VERSION_SUPPORTS_COMPRESSION;
107521
+ const compression = specVersion >= SPEC_VERSION_SUPPORTS_COMPRESSION ? targetCompression : false;
107439
107522
  const workflowArguments = await dehydrateWorkflowArguments(args, runId, encryptionKey, ops, globalThis, v1Compat, framedByteStreams, compression);
107440
107523
  let dynamicWorkflowCode;
107441
107524
  let dynamicWorkflowCodeRef;
@@ -108371,7 +108454,7 @@ function resolveRecoverActiveRuns(config2) {
108371
108454
  function resolveDirectBaseUrl(config2) {
108372
108455
  return config2.baseUrl ?? process.env.WORKFLOW_LOCAL_BASE_URL ?? createWorkflowBaseUrl("http://localhost");
108373
108456
  }
108374
- async function resolveBaseUrl$1(config2) {
108457
+ async function resolveBaseUrl(config2) {
108375
108458
  if (config2.baseUrl) {
108376
108459
  return config2.baseUrl;
108377
108460
  }
@@ -136177,7 +136260,7 @@ function createQueue$2(config2) {
136177
136260
  }), { method: "POST", headers: headers2, body: body2 });
136178
136261
  response2 = await directHandler(req);
136179
136262
  } else {
136180
- const baseUrl = await resolveBaseUrl$1(config2);
136263
+ const baseUrl = await resolveBaseUrl(config2);
136181
136264
  const url = createWorkflowUrl(baseUrl, { type: "flow" });
136182
136265
  response2 = nodeHttpAgents ? await nodeHttpFetch(url, {
136183
136266
  method: "POST",
@@ -140706,6 +140789,12 @@ function createEventsStorage(basedir, tag) {
140706
140789
  return { event: occupant };
140707
140790
  }
140708
140791
  }
140792
+ if (data2.eventType === "hook_created" && data2.correlationId) {
140793
+ const occupant = await readJSONWithFallback(basedir, "events", `${effectiveRunId}-${eventId}`, ReadEventSchema, tag);
140794
+ if ((occupant == null ? void 0 : occupant.eventType) === "hook_created" && occupant.correlationId === data2.correlationId) {
140795
+ break;
140796
+ }
140797
+ }
140709
140798
  if (!await bumpEventSlot(attempt)) {
140710
140799
  break;
140711
140800
  }
@@ -141020,7 +141109,7 @@ function createWorld$2(args) {
141020
141109
  const basedir = mergedConfig.dataDir;
141021
141110
  const hooksDir = path$3.join(basedir, "hooks");
141022
141111
  const taggedHookFiles = await listTaggedFiles(hooksDir, tag);
141023
- const { HookSchema: HookSchema2 } = await import("./index-CvPUU1wY.js");
141112
+ const { HookSchema: HookSchema2 } = await import("./index-xhDuD_-a.js");
141024
141113
  await Promise.all(taggedHookFiles.map(async (hookFile) => {
141025
141114
  const hook = await readJSON(path$3.join(hooksDir, hookFile), HookSchema2);
141026
141115
  if (hook == null ? void 0 : hook.token) {
@@ -141203,8 +141292,8 @@ function requireGetVercelOidcToken() {
141203
141292
  }
141204
141293
  try {
141205
141294
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
141206
- await import("./token-util-Df3UC21b.js").then((n) => n.t),
141207
- await import("./token-C2ZfbDqj.js").then((n) => n.t)
141295
+ await import("./token-util-D-AD5yDZ.js").then((n) => n.t),
141296
+ await import("./token-Dp-Ryz8o.js").then((n) => n.t)
141208
141297
  ]);
141209
141298
  if (!token || isExpired(getTokenPayload(token), options == null ? void 0 : options.expirationBufferMs)) {
141210
141299
  await refreshToken(options);
@@ -141767,7 +141856,7 @@ function requireDist() {
141767
141856
  return dist;
141768
141857
  }
141769
141858
  var distExports = requireDist();
141770
- const version = "5.0.1";
141859
+ const version = "5.1.0";
141771
141860
  const pools = globalSingleton("@workflow/world-vercel//httpPools", 1, () => ({
141772
141861
  dispatcher: void 0,
141773
141862
  queueDispatcher: void 0,
@@ -143505,7 +143594,7 @@ function validateRunExecutionContext(value) {
143505
143594
  }
143506
143595
  }
143507
143596
  async function getDeadline() {
143508
- const { getDeadline: getDeadline2 } = await import("./index-B2Fjee_4.js").then((n) => n.i);
143597
+ const { getDeadline: getDeadline2 } = await import("./index-HeFIWQE6.js").then((n) => n.i);
143509
143598
  return getDeadline2();
143510
143599
  }
143511
143600
  const WORKFLOW_SERVER_SERVICE = {
@@ -146031,6 +146120,18 @@ var MessageCorruptedError = class extends Error {
146031
146120
  this.name = "MessageCorruptedError";
146032
146121
  }
146033
146122
  };
146123
+ var MessageLockedError = class extends MessageNotAvailableError {
146124
+ constructor(messageId, retryAfter) {
146125
+ super(
146126
+ messageId,
146127
+ retryAfter !== void 0 ? `temporarily locked. Retry after ${retryAfter} seconds.` : "temporarily locked. Try again later."
146128
+ );
146129
+ /** Suggested retry delay in seconds, if provided by the server. */
146130
+ __publicField(this, "retryAfter");
146131
+ this.name = "MessageLockedError";
146132
+ this.retryAfter = retryAfter;
146133
+ }
146134
+ };
146034
146135
  var TooManyRequestsError = class extends Error {
146035
146136
  constructor(message2 = "Too many requests", retryAfter) {
146036
146137
  super(message2);
@@ -146058,6 +146159,12 @@ var BadRequestError = class extends Error {
146058
146159
  this.name = "BadRequestError";
146059
146160
  }
146060
146161
  };
146162
+ var PayloadTooLargeError = class extends Error {
146163
+ constructor(message2) {
146164
+ super(message2);
146165
+ this.name = "PayloadTooLargeError";
146166
+ }
146167
+ };
146061
146168
  var InternalServerError = class extends Error {
146062
146169
  constructor(message2 = "Unexpected server error") {
146063
146170
  super(message2);
@@ -146203,12 +146310,13 @@ var ConsumerGroup = class {
146203
146310
  * - On transient failures (5xx, network errors): retry every 3 seconds
146204
146311
  * - On 4xx client errors: stop retrying (the lease is lost or invalid)
146205
146312
  *
146206
- * @param receiptHandle - The receipt handle to extend visibility for
146313
+ * @param message - The message ID and receipt handle for the active lease
146207
146314
  * @param options - Optional configuration
146208
146315
  * @param options.visibilityDeadline - Absolute deadline (from server's `ce-vqsvisibilitydeadline`)
146209
146316
  * when the current visibility timeout expires. Used to calculate the first extension delay.
146210
146317
  */
146211
- startVisibilityExtension(receiptHandle, options) {
146318
+ startVisibilityExtension(message2, options) {
146319
+ const { messageId, receiptHandle } = message2;
146212
146320
  let isRunning = true;
146213
146321
  let isResolved = false;
146214
146322
  let resolveLifecycle;
@@ -146240,6 +146348,7 @@ var ConsumerGroup = class {
146240
146348
  }
146241
146349
  try {
146242
146350
  await this.client.changeVisibility({
146351
+ messageId,
146243
146352
  queueName: this.topicName,
146244
146353
  consumerGroup: this.consumerGroupName,
146245
146354
  receiptHandle,
@@ -146298,10 +146407,7 @@ var ConsumerGroup = class {
146298
146407
  }
146299
146408
  }
146300
146409
  async processMessage(message2, handler, options) {
146301
- const stopExtension = this.startVisibilityExtension(
146302
- message2.receiptHandle,
146303
- options
146304
- );
146410
+ const stopExtension = this.startVisibilityExtension(message2, options);
146305
146411
  const DEFAULT_RETENTION_MS = 864e5;
146306
146412
  const metadata = {
146307
146413
  messageId: message2.messageId,
@@ -146316,6 +146422,7 @@ var ConsumerGroup = class {
146316
146422
  await handler(message2.payload, metadata);
146317
146423
  await stopExtension();
146318
146424
  await this.client.acknowledgeMessage({
146425
+ messageId: message2.messageId,
146319
146426
  queueName: this.topicName,
146320
146427
  consumerGroup: this.consumerGroupName,
146321
146428
  receiptHandle: message2.receiptHandle
@@ -146334,6 +146441,7 @@ var ConsumerGroup = class {
146334
146441
  try {
146335
146442
  await this.directiveCallWithRetries(
146336
146443
  () => this.client.acknowledgeMessage({
146444
+ messageId: message2.messageId,
146337
146445
  queueName: this.topicName,
146338
146446
  consumerGroup: this.consumerGroupName,
146339
146447
  receiptHandle: message2.receiptHandle
@@ -146349,6 +146457,7 @@ var ConsumerGroup = class {
146349
146457
  try {
146350
146458
  await this.directiveCallWithRetries(
146351
146459
  () => this.client.changeVisibility({
146460
+ messageId: message2.messageId,
146352
146461
  queueName: this.topicName,
146353
146462
  consumerGroup: this.consumerGroupName,
146354
146463
  receiptHandle: message2.receiptHandle,
@@ -146408,7 +146517,8 @@ var ConsumerGroup = class {
146408
146517
  queueName: this.topicName,
146409
146518
  consumerGroup: this.consumerGroupName,
146410
146519
  visibilityTimeoutSeconds: this.visibilityTimeout,
146411
- limit
146520
+ limit,
146521
+ cursorFallback: options && "cursorFallback" in options ? options.cursorFallback : void 0
146412
146522
  })) {
146413
146523
  messagesProcessed++;
146414
146524
  await this.processMessage(message2, handler, { retry: retry2 });
@@ -146460,7 +146570,7 @@ var Topic = class {
146460
146570
  headers: options == null ? void 0 : options.headers,
146461
146571
  telemetry: options == null ? void 0 : options.telemetry
146462
146572
  });
146463
- if (result.messageId && isDevMode()) {
146573
+ if (result.messageId && isDevMode() && !this.client.usesLocalBroker()) {
146464
146574
  invokeDevHandlers(
146465
146575
  this.topicName,
146466
146576
  result.messageId,
@@ -146872,6 +146982,8 @@ function registerHandlerForFile(filePath, handler, client2, options) {
146872
146982
  return true;
146873
146983
  }
146874
146984
  function registerDevHandler(handler, client2, options, _testCallerPath) {
146985
+ var _a3, _b2;
146986
+ if ((_b2 = (_a3 = getApiClient(client2)).usesLocalBroker) == null ? void 0 : _b2.call(_a3)) return;
146875
146987
  const callerPath = _testCallerPath ?? extractCallerFilePath();
146876
146988
  if (!callerPath) {
146877
146989
  console.warn(
@@ -147656,30 +147768,69 @@ function parseRetryAfterSeconds(value) {
147656
147768
  }
147657
147769
  return void 0;
147658
147770
  }
147659
- function throwCommonHttpError(status, statusText, errorText, operation, badRequestDefault = "Invalid parameters", retryAfterHeader) {
147771
+ async function readHttpErrorResponse(response2) {
147772
+ var _a3;
147773
+ const text2 = await response2.text();
147774
+ if (!((_a3 = response2.headers.get("Content-Type")) == null ? void 0 : _a3.toLowerCase().includes("json"))) {
147775
+ return {
147776
+ response: response2,
147777
+ message: text2
147778
+ };
147779
+ }
147780
+ try {
147781
+ const body2 = JSON.parse(text2);
147782
+ if (typeof body2 !== "object" || body2 === null) {
147783
+ return { response: response2, message: text2 };
147784
+ }
147785
+ const error2 = "error" in body2 ? body2.error : void 0;
147786
+ let message2 = text2;
147787
+ if (typeof error2 === "string") {
147788
+ message2 = error2;
147789
+ } else if (typeof error2 === "object" && error2 !== null && "message" in error2 && typeof error2.message === "string") {
147790
+ message2 = error2.message;
147791
+ }
147792
+ return {
147793
+ response: response2,
147794
+ message: message2,
147795
+ originalMessageId: "originalMessageId" in body2 && typeof body2.originalMessageId === "string" ? body2.originalMessageId : void 0
147796
+ };
147797
+ } catch {
147798
+ return { response: response2, message: text2 };
147799
+ }
147800
+ }
147801
+ function throwCommonHttpError(error2, operation, badRequestDefault = "Invalid parameters") {
147802
+ const { status, statusText } = error2.response;
147803
+ const message2 = error2.message;
147804
+ const statusDescription = statusText ? `${status} ${statusText}` : `${status}`;
147805
+ if (status === 503 && error2.response.headers.get("Vqs-Error-Code") === "consumer_registry_not_configured") {
147806
+ throw new ConsumerRegistryNotConfiguredError(
147807
+ message2 || "Consumer registry not configured"
147808
+ );
147809
+ }
147810
+ if (status === 413) {
147811
+ throw new PayloadTooLargeError(message2 || "Request payload is too large");
147812
+ }
147660
147813
  if (status === 400) {
147661
- throw new BadRequestError(errorText || badRequestDefault);
147814
+ throw new BadRequestError(message2 || badRequestDefault);
147662
147815
  }
147663
147816
  if (status === 429) {
147664
147817
  throw new TooManyRequestsError(
147665
- errorText || `Too many requests: ${operation}`,
147666
- parseRetryAfterSeconds(retryAfterHeader)
147818
+ message2 || `Too many requests: ${operation}`,
147819
+ parseRetryAfterSeconds(error2.response.headers.get("Retry-After"))
147667
147820
  );
147668
147821
  }
147669
147822
  if (status === 401) {
147670
- throw new UnauthorizedError(errorText || void 0);
147823
+ throw new UnauthorizedError(message2 || void 0);
147671
147824
  }
147672
147825
  if (status === 403) {
147673
- throw new ForbiddenError(errorText || void 0);
147826
+ throw new ForbiddenError(message2 || void 0);
147674
147827
  }
147675
147828
  if (status >= 500) {
147676
147829
  throw new InternalServerError(
147677
- errorText || `Server error: ${status} ${statusText}`
147830
+ message2 || `Server error: ${statusDescription}`
147678
147831
  );
147679
147832
  }
147680
- throw new Error(
147681
- errorText || `Failed to ${operation}: ${status} ${statusText}`
147682
- );
147833
+ throw new Error(message2 || `Failed to ${operation}: ${statusDescription}`);
147683
147834
  }
147684
147835
  function parseQueueHeaders(headers2) {
147685
147836
  const messageId = headers2.get("Vqs-Message-Id");
@@ -147713,12 +147864,29 @@ function validateRegion(region) {
147713
147864
  }
147714
147865
  }
147715
147866
  var DEFAULT_BASE_URL_RESOLVER = (region) => new URL(`https://${region}.vercel-queue.com`);
147716
- function resolveBaseUrl(region, resolver2) {
147717
- return (resolver2 ?? DEFAULT_BASE_URL_RESOLVER)(region);
147867
+ function stripTrailingSlashes(path2) {
147868
+ let end = path2.length;
147869
+ while (end > 0 && path2[end - 1] === "/") {
147870
+ end--;
147871
+ }
147872
+ return path2.slice(0, end);
147873
+ }
147874
+ function supportsLocalQueueBroker(version2) {
147875
+ if (!version2 || version2.length > 256) return false;
147876
+ const match2 = version2.match(
147877
+ /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([\da-zA-Z-]+(?:\.[\da-zA-Z-]+)*))?(?:\+[\da-zA-Z-]+(?:\.[\da-zA-Z-]+)*)?$/
147878
+ );
147879
+ if (!match2 || match2[0] !== version2) return false;
147880
+ const [major, minor, patch2] = match2.slice(1, 4).map(Number);
147881
+ const prerelease = match2[4];
147882
+ if (![major, minor, patch2].every(Number.isSafeInteger) || (prerelease == null ? void 0 : prerelease.split(".").some((part) => /^0\d+$/.test(part)))) {
147883
+ return false;
147884
+ }
147885
+ return major > 59 || major === 59 && (minor > 26 || minor === 26 && (patch2 > 0 || !prerelease));
147718
147886
  }
147719
147887
  var BASE_PATH = "/api/v3/topic";
147720
147888
  var ApiClient = class _ApiClient {
147721
- constructor(options) {
147889
+ constructor(options, localResource) {
147722
147890
  __publicField(this, "baseUrl");
147723
147891
  __publicField(this, "customHeaders");
147724
147892
  __publicField(this, "providedToken");
@@ -147728,12 +147896,36 @@ var ApiClient = class _ApiClient {
147728
147896
  __publicField(this, "transport");
147729
147897
  __publicField(this, "region");
147730
147898
  __publicField(this, "baseUrlResolver");
147899
+ // Keep injected credentials separate from explicit tokens: a regional resolver
147900
+ // can select a different endpoint, where the broker token must not be used.
147901
+ __publicField(this, "localResource");
147731
147902
  __publicField(this, "dispatcher");
147732
147903
  __publicField(this, "telemetry");
147904
+ var _a3;
147733
147905
  validateRegion(options.region);
147734
147906
  this.region = options.region;
147735
- this.baseUrlResolver = options.resolveBaseUrl;
147736
- this.baseUrl = resolveBaseUrl(this.region, this.baseUrlResolver);
147907
+ this.localResource = localResource ?? null;
147908
+ if (localResource === void 0 && isDevMode() && supportsLocalQueueBroker(process.env.VERCEL_CLI_VERSION)) {
147909
+ const injectedUrl = process.env.VERCEL_QUEUE_BASE_URL;
147910
+ if (injectedUrl) {
147911
+ try {
147912
+ this.localResource = {
147913
+ baseUrl: new URL(injectedUrl),
147914
+ token: process.env.VERCEL_QUEUE_TOKEN
147915
+ };
147916
+ } catch (cause) {
147917
+ if (!options.resolveBaseUrl) {
147918
+ throw new Error(
147919
+ "Invalid VERCEL_QUEUE_BASE_URL: expected an absolute URL",
147920
+ { cause }
147921
+ );
147922
+ }
147923
+ }
147924
+ }
147925
+ }
147926
+ const localBaseUrl = (_a3 = this.localResource) == null ? void 0 : _a3.baseUrl;
147927
+ this.baseUrlResolver = options.resolveBaseUrl ?? (localBaseUrl ? () => new URL(localBaseUrl) : DEFAULT_BASE_URL_RESOLVER);
147928
+ this.baseUrl = this.baseUrlResolver(this.region);
147737
147929
  this.customHeaders = options.headers || {};
147738
147930
  this.providedToken = options.token;
147739
147931
  this.transport = options.transport || new JsonTransport$1();
@@ -147755,16 +147947,24 @@ var ApiClient = class _ApiClient {
147755
147947
  * region indicated by the incoming `ce-vqsregion` header.
147756
147948
  */
147757
147949
  withRegion(region) {
147758
- return new _ApiClient({
147759
- region,
147760
- resolveBaseUrl: this.baseUrlResolver,
147761
- token: this.providedToken,
147762
- headers: { ...this.customHeaders },
147763
- deploymentId: this.explicitlyUnpinned ? null : this.resolvedDeploymentId,
147764
- transport: this.transport,
147765
- dispatcher: this.dispatcher,
147766
- telemetry: this.telemetry
147767
- });
147950
+ return new _ApiClient(
147951
+ {
147952
+ region,
147953
+ resolveBaseUrl: this.baseUrlResolver,
147954
+ token: this.providedToken,
147955
+ headers: { ...this.customHeaders },
147956
+ deploymentId: this.explicitlyUnpinned ? null : this.resolvedDeploymentId,
147957
+ transport: this.transport,
147958
+ dispatcher: this.dispatcher,
147959
+ telemetry: this.telemetry
147960
+ },
147961
+ this.localResource
147962
+ );
147963
+ }
147964
+ usesLocalBroker() {
147965
+ var _a3;
147966
+ const local = (_a3 = this.localResource) == null ? void 0 : _a3.baseUrl;
147967
+ return local !== void 0 && this.baseUrl.origin === local.origin && stripTrailingSlashes(this.baseUrl.pathname) === stripTrailingSlashes(local.pathname);
147768
147968
  }
147769
147969
  getRegion() {
147770
147970
  return this.region;
@@ -147784,23 +147984,32 @@ var ApiClient = class _ApiClient {
147784
147984
  );
147785
147985
  }
147786
147986
  getSendDeploymentId() {
147787
- if (isDevMode()) {
147987
+ if (this.usesLocalBroker() || isDevMode()) {
147788
147988
  return void 0;
147789
147989
  }
147790
147990
  this.requireDeploymentId();
147791
147991
  return this.pinSends ? this.resolvedDeploymentId : void 0;
147792
147992
  }
147793
147993
  getConsumeDeploymentId() {
147794
- if (isDevMode()) {
147994
+ if (this.usesLocalBroker() || isDevMode()) {
147795
147995
  return void 0;
147796
147996
  }
147797
147997
  this.requireDeploymentId();
147798
147998
  return this.resolvedDeploymentId;
147799
147999
  }
147800
148000
  async getToken() {
148001
+ var _a3;
147801
148002
  if (this.providedToken) {
147802
148003
  return this.providedToken;
147803
148004
  }
148005
+ if (this.usesLocalBroker()) {
148006
+ if ((_a3 = this.localResource) == null ? void 0 : _a3.token) {
148007
+ return this.localResource.token;
148008
+ }
148009
+ throw new Error(
148010
+ "Missing local queue token. VERCEL_QUEUE_BASE_URL selects a local broker, but VERCEL_QUEUE_TOKEN is not set. Start your app with a Vercel CLI version that supports local Queues, or provide an explicit token."
148011
+ );
148012
+ }
147804
148013
  try {
147805
148014
  return await distExports.getVercelOidcToken();
147806
148015
  } catch (err) {
@@ -147825,7 +148034,7 @@ Cause: ${cause}`
147825
148034
  const encodedQueue = encodeURIComponent(queueName);
147826
148035
  const segments = pathSegments.map((s2) => encodeURIComponent(s2));
147827
148036
  const path2 = segments.length > 0 ? "/" + segments.join("/") : "";
147828
- const basePath = this.baseUrl.pathname.replace(/\/+$/, "");
148037
+ const basePath = stripTrailingSlashes(this.baseUrl.pathname);
147829
148038
  return `${this.baseUrl.origin}${basePath}${BASE_PATH}/${encodedQueue}${path2}`;
147830
148039
  }
147831
148040
  async fetch(url, init2) {
@@ -147850,7 +148059,7 @@ Cause: ${cause}`
147850
148059
  }
147851
148060
  console.debug("[VQS Debug] Request:", JSON.stringify(logData, null, 2));
147852
148061
  }
147853
- init2.headers.set("User-Agent", `@vercel/queue/${"0.5.1"}`);
148062
+ init2.headers.set("User-Agent", `@vercel/queue/${"0.8.0"}`);
147854
148063
  init2.headers.set("Vqs-Client-Ts", (/* @__PURE__ */ new Date()).toISOString());
147855
148064
  const fetchInit = this.dispatcher ? { ...init2, dispatcher: this.dispatcher } : init2;
147856
148065
  const response2 = await fetch(url, fetchInit);
@@ -147889,24 +148098,14 @@ Cause: ${cause}`
147889
148098
  ...body2 instanceof ReadableStream && { duplex: "half" }
147890
148099
  });
147891
148100
  if (!response2.ok) {
147892
- const errorText = await response2.text();
148101
+ const error2 = await readHttpErrorResponse(response2);
147893
148102
  if (response2.status === 502 && response2.headers.get("Vqs-Error-Code") === "consumer_discovery_failed") {
147894
148103
  throw new ConsumerDiscoveryError(
147895
- errorText || "Consumer discovery failed",
148104
+ error2.message || "Consumer discovery failed",
147896
148105
  deploymentId
147897
148106
  );
147898
148107
  }
147899
- if (response2.status === 503) {
147900
- throw new ConsumerRegistryNotConfiguredError(
147901
- errorText || "Consumer registry not configured"
147902
- );
147903
- }
147904
- throwCommonHttpError(
147905
- response2.status,
147906
- response2.statusText,
147907
- errorText,
147908
- "send message"
147909
- );
148108
+ throwCommonHttpError(error2, "send message");
147910
148109
  }
147911
148110
  if (response2.status === 202) {
147912
148111
  await response2.text();
@@ -147953,18 +148152,8 @@ Cause: ${cause}`
147953
148152
  duplex: "half"
147954
148153
  });
147955
148154
  if (!response2.ok) {
147956
- const errorText = await response2.text();
147957
- if (response2.status === 503) {
147958
- throw new ConsumerRegistryNotConfiguredError(
147959
- errorText || "Consumer registry not configured"
147960
- );
147961
- }
147962
- throwCommonHttpError(
147963
- response2.status,
147964
- response2.statusText,
147965
- errorText,
147966
- "send message batch"
147967
- );
148155
+ const error2 = await readHttpErrorResponse(response2);
148156
+ throwCommonHttpError(error2, "send message batch");
147968
148157
  }
147969
148158
  const { results } = await response2.json();
147970
148159
  if (results.length !== messages.length) {
@@ -148004,7 +148193,13 @@ Cause: ${cause}`
148004
148193
  }
148005
148194
  async *receiveMessages(options) {
148006
148195
  const transport = this.transport;
148007
- const { queueName, consumerGroup, visibilityTimeoutSeconds, limit } = options;
148196
+ const {
148197
+ queueName,
148198
+ consumerGroup,
148199
+ visibilityTimeoutSeconds,
148200
+ limit,
148201
+ cursorFallback
148202
+ } = options;
148008
148203
  if (limit !== void 0 && (limit < 1 || limit > 10)) {
148009
148204
  throw new InvalidLimitError(limit);
148010
148205
  }
@@ -148022,6 +148217,9 @@ Cause: ${cause}`
148022
148217
  if (limit !== void 0) {
148023
148218
  headers2.set("Vqs-Max-Messages", limit.toString());
148024
148219
  }
148220
+ if (cursorFallback !== void 0) {
148221
+ headers2.set("Vqs-Cursor-Fallback", cursorFallback);
148222
+ }
148025
148223
  const effectiveDeploymentId = this.getConsumeDeploymentId();
148026
148224
  if (effectiveDeploymentId) {
148027
148225
  headers2.set("Vqs-Deployment-Id", effectiveDeploymentId);
@@ -148038,11 +148236,8 @@ Cause: ${cause}`
148038
148236
  return;
148039
148237
  }
148040
148238
  if (!response2.ok) {
148041
- const errorText = await response2.text();
148042
148239
  throwCommonHttpError(
148043
- response2.status,
148044
- response2.statusText,
148045
- errorText,
148240
+ await readHttpErrorResponse(response2),
148046
148241
  "receive messages"
148047
148242
  );
148048
148243
  }
@@ -148094,33 +148289,26 @@ Cause: ${cause}`
148094
148289
  }
148095
148290
  );
148096
148291
  if (!response2.ok) {
148097
- const errorText = await response2.text();
148292
+ const error2 = await readHttpErrorResponse(response2);
148098
148293
  if (response2.status === 404) {
148099
148294
  throw new MessageNotFoundError(messageId);
148100
148295
  }
148101
148296
  if (response2.status === 409) {
148102
- let errorData = {};
148103
- try {
148104
- errorData = JSON.parse(errorText);
148105
- } catch {
148106
- }
148107
- if (errorData.originalMessageId) {
148297
+ if (error2.originalMessageId) {
148108
148298
  throw new MessageNotAvailableError(
148109
148299
  messageId,
148110
- `This message was a duplicate - use originalMessageId: ${errorData.originalMessageId}`
148300
+ `This message was a duplicate - use originalMessageId: ${error2.originalMessageId}`
148111
148301
  );
148112
148302
  }
148113
- throw new MessageNotAvailableError(messageId);
148303
+ throw new MessageLockedError(
148304
+ messageId,
148305
+ parseRetryAfterSeconds(response2.headers.get("Retry-After"))
148306
+ );
148114
148307
  }
148115
148308
  if (response2.status === 410) {
148116
148309
  throw new MessageAlreadyProcessedError(messageId);
148117
148310
  }
148118
- throwCommonHttpError(
148119
- response2.status,
148120
- response2.statusText,
148121
- errorText,
148122
- "receive message by ID"
148123
- );
148311
+ throwCommonHttpError(error2, "receive message by ID");
148124
148312
  }
148125
148313
  for await (const multipartMessage of parseMultipartStream(response2)) {
148126
148314
  const parsedHeaders = parseQueueHeaders(multipartMessage.headers);
@@ -148143,8 +148331,7 @@ Cause: ${cause}`
148143
148331
  throw new MessageNotFoundError(messageId);
148144
148332
  }
148145
148333
  async acknowledgeMessage(options) {
148146
- var _a3;
148147
- const { queueName, consumerGroup, receiptHandle } = options;
148334
+ const { messageId, queueName, consumerGroup, receiptHandle } = options;
148148
148335
  const headers2 = new Headers({
148149
148336
  Authorization: `Bearer ${await this.getToken()}`,
148150
148337
  ...this.customHeaders
@@ -148167,31 +148354,28 @@ Cause: ${cause}`
148167
148354
  }
148168
148355
  );
148169
148356
  if (!response2.ok) {
148170
- const errorText = await response2.text();
148357
+ const error2 = await readHttpErrorResponse(response2);
148171
148358
  if (response2.status === 404) {
148172
- throw new MessageNotFoundError(receiptHandle);
148359
+ throw new MessageNotFoundError(messageId);
148173
148360
  }
148174
148361
  if (response2.status === 409) {
148175
148362
  throw new MessageNotAvailableError(
148176
- receiptHandle,
148177
- errorText || "Invalid receipt handle, message not in correct state, or already processed"
148363
+ messageId,
148364
+ error2.message || "Invalid receipt handle, message not in correct state, or already processed"
148178
148365
  );
148179
148366
  }
148180
148367
  throwCommonHttpError(
148181
- response2.status,
148182
- response2.statusText,
148183
- errorText,
148368
+ error2,
148184
148369
  "acknowledge message",
148185
- "Missing or invalid receipt handle",
148186
- ((_a3 = response2.headers) == null ? void 0 : _a3.get("Retry-After")) ?? null
148370
+ "Missing or invalid receipt handle"
148187
148371
  );
148188
148372
  }
148189
148373
  await response2.text();
148190
148374
  return { acknowledged: true };
148191
148375
  }
148192
148376
  async changeVisibility(options) {
148193
- var _a3;
148194
148377
  const {
148378
+ messageId,
148195
148379
  queueName,
148196
148380
  consumerGroup,
148197
148381
  receiptHandle,
@@ -148221,23 +148405,20 @@ Cause: ${cause}`
148221
148405
  }
148222
148406
  );
148223
148407
  if (!response2.ok) {
148224
- const errorText = await response2.text();
148408
+ const error2 = await readHttpErrorResponse(response2);
148225
148409
  if (response2.status === 404) {
148226
- throw new MessageNotFoundError(receiptHandle);
148410
+ throw new MessageNotFoundError(messageId);
148227
148411
  }
148228
148412
  if (response2.status === 409) {
148229
148413
  throw new MessageNotAvailableError(
148230
- receiptHandle,
148231
- errorText || "Invalid receipt handle, message not in correct state, or already processed"
148414
+ messageId,
148415
+ error2.message || "Invalid receipt handle, message not in correct state, or already processed"
148232
148416
  );
148233
148417
  }
148234
148418
  throwCommonHttpError(
148235
- response2.status,
148236
- response2.statusText,
148237
- errorText,
148419
+ error2,
148238
148420
  "change visibility",
148239
- "Missing receipt handle or invalid visibility timeout",
148240
- ((_a3 = response2.headers) == null ? void 0 : _a3.get("Retry-After")) ?? null
148421
+ "Missing receipt handle or invalid visibility timeout"
148241
148422
  );
148242
148423
  }
148243
148424
  await response2.text();
@@ -148276,6 +148457,25 @@ function resolveCallbackRequest(input) {
148276
148457
  }
148277
148458
  return input;
148278
148459
  }
148460
+ function skippedDeliveryReason(error2) {
148461
+ if (error2 instanceof MessageAlreadyProcessedError || error2 instanceof Error && error2.name === "MessageAlreadyProcessedError") {
148462
+ return "already_processed";
148463
+ }
148464
+ if (error2 instanceof MessageNotAvailableError || error2 instanceof Error && error2.name === "MessageNotAvailableError") {
148465
+ return "not_available";
148466
+ }
148467
+ return null;
148468
+ }
148469
+ function reportSkippedDelivery(reason, messageId) {
148470
+ console.debug(
148471
+ `Queue callback skipped (${reason}) for message ${messageId ?? "<unknown>"}: the message was already handled or is no longer available to this consumer.`
148472
+ );
148473
+ return {
148474
+ status: "skipped",
148475
+ reason,
148476
+ ...messageId !== void 0 ? { messageId } : {}
148477
+ };
148478
+ }
148279
148479
  function getApiClient(client2) {
148280
148480
  return getApi(client2);
148281
148481
  }
@@ -148319,7 +148519,7 @@ var QueueClient = class {
148319
148519
  headers: options == null ? void 0 : options.headers,
148320
148520
  telemetry: options == null ? void 0 : options.telemetry
148321
148521
  });
148322
- if (result.messageId && isDevMode()) {
148522
+ if (result.messageId && isDevMode() && !api2.usesLocalBroker()) {
148323
148523
  invokeDevHandlers(
148324
148524
  topicName,
148325
148525
  result.messageId,
@@ -148343,7 +148543,7 @@ var QueueClient = class {
148343
148543
  messages,
148344
148544
  telemetry: options == null ? void 0 : options.telemetry
148345
148545
  });
148346
- if (!isDevMode()) {
148546
+ if (!isDevMode() || api2.usesLocalBroker()) {
148347
148547
  return results;
148348
148548
  }
148349
148549
  const region = api2.getRegion();
@@ -148382,13 +148582,13 @@ var QueueClient = class {
148382
148582
  */
148383
148583
  __publicField(this, "handleCallback", (handler, options) => {
148384
148584
  var _a3, _b2;
148385
- if (isDevMode()) {
148585
+ if (isDevMode() && !getApi(this).usesLocalBroker()) {
148386
148586
  registerDevHandler(handler, this, options);
148387
148587
  }
148388
148588
  const telemetry = resolveTelemetryConfig((_b2 = (_a3 = getApi(this)).getTelemetry) == null ? void 0 : _b2.call(_a3));
148389
148589
  return async (requestOrEvent) => {
148390
148590
  const request2 = resolveCallbackRequest(requestOrEvent);
148391
- if (isDevMode() && request2.headers.get("x-vercel-queue-prime") === "1") {
148591
+ if (isDevMode() && !getApi(this).usesLocalBroker() && request2.headers.get("x-vercel-queue-prime") === "1") {
148392
148592
  const primeFile = request2.headers.get("x-vercel-queue-prime-file");
148393
148593
  if (primeFile) {
148394
148594
  registerDevHandler(
@@ -148400,11 +148600,13 @@ var QueueClient = class {
148400
148600
  }
148401
148601
  return Response.json({ status: "primed" });
148402
148602
  }
148603
+ let parsed;
148403
148604
  try {
148404
- const parsed = await parseCallback(request2);
148605
+ parsed = await parseCallback(request2);
148606
+ const callback = parsed;
148405
148607
  await withConsumerSpan(
148406
148608
  request2.headers,
148407
- () => handleCallback(handler, parsed, {
148609
+ () => handleCallback(handler, callback, {
148408
148610
  client: this,
148409
148611
  visibilityTimeoutSeconds: options == null ? void 0 : options.visibilityTimeoutSeconds,
148410
148612
  retry: options == null ? void 0 : options.retry
@@ -148413,6 +148615,12 @@ var QueueClient = class {
148413
148615
  );
148414
148616
  return Response.json({ status: "success" });
148415
148617
  } catch (error2) {
148618
+ const skipped = skippedDeliveryReason(error2);
148619
+ if (skipped) {
148620
+ return Response.json(
148621
+ reportSkippedDelivery(skipped, parsed == null ? void 0 : parsed.messageId)
148622
+ );
148623
+ }
148416
148624
  console.error("Queue callback error:", error2);
148417
148625
  if (error2 instanceof Error && (error2.message.includes("Invalid content type") || error2.message.includes("Invalid CloudEvent") || error2.message.includes("Missing required CloudEvent") || error2.message.includes("Failed to parse CloudEvent") || error2.message.includes("Binary mode callback"))) {
148418
148626
  return Response.json({ error: error2.message }, { status: 400 });
@@ -148446,7 +148654,7 @@ var QueueClient = class {
148446
148654
  */
148447
148655
  __publicField(this, "handleNodeCallback", (handler, options) => {
148448
148656
  var _a3, _b2;
148449
- if (isDevMode()) {
148657
+ if (isDevMode() && !getApi(this).usesLocalBroker()) {
148450
148658
  registerDevHandler(handler, this, options);
148451
148659
  }
148452
148660
  const telemetry = resolveTelemetryConfig((_b2 = (_a3 = getApi(this)).getTelemetry) == null ? void 0 : _b2.call(_a3));
@@ -148456,7 +148664,7 @@ var QueueClient = class {
148456
148664
  return;
148457
148665
  }
148458
148666
  const primeHeader = req.headers["x-vercel-queue-prime"];
148459
- if (isDevMode() && primeHeader === "1") {
148667
+ if (isDevMode() && !getApi(this).usesLocalBroker() && primeHeader === "1") {
148460
148668
  const primeFileHeader = req.headers["x-vercel-queue-prime-file"];
148461
148669
  const primeFile = Array.isArray(primeFileHeader) ? primeFileHeader[0] : primeFileHeader;
148462
148670
  if (primeFile) {
@@ -148470,11 +148678,13 @@ var QueueClient = class {
148470
148678
  res.status(200).json({ status: "primed" });
148471
148679
  return;
148472
148680
  }
148681
+ let parsed;
148473
148682
  try {
148474
- const parsed = parseRawCallback(req.body, req.headers);
148683
+ parsed = parseRawCallback(req.body, req.headers);
148684
+ const callback = parsed;
148475
148685
  await withConsumerSpan(
148476
148686
  req.headers,
148477
- () => handleCallback(handler, parsed, {
148687
+ () => handleCallback(handler, callback, {
148478
148688
  client: this,
148479
148689
  visibilityTimeoutSeconds: options == null ? void 0 : options.visibilityTimeoutSeconds,
148480
148690
  retry: options == null ? void 0 : options.retry
@@ -148483,6 +148693,11 @@ var QueueClient = class {
148483
148693
  );
148484
148694
  res.status(200).json({ status: "success" });
148485
148695
  } catch (error2) {
148696
+ const skipped = skippedDeliveryReason(error2);
148697
+ if (skipped) {
148698
+ res.status(200).json(reportSkippedDelivery(skipped, parsed == null ? void 0 : parsed.messageId));
148699
+ return;
148700
+ }
148486
148701
  console.error("Queue callback error:", error2);
148487
148702
  if (error2 instanceof Error && (error2.message.includes("Invalid content type") || error2.message.includes("Invalid CloudEvent") || error2.message.includes("Missing required CloudEvent") || error2.message.includes("Failed to parse CloudEvent") || error2.message.includes("Binary mode callback"))) {
148488
148703
  res.status(400).json({ error: error2.message });
@@ -148501,7 +148716,7 @@ function missingDeploymentIdMessage(operation) {
148501
148716
  }
148502
148717
  function isWsEventsTransportEnabled() {
148503
148718
  var _a3;
148504
- return ((_a3 = process.env.WORKFLOW_EVENTS_TRANSPORT) == null ? void 0 : _a3.trim().toLowerCase()) === "ws";
148719
+ return ((_a3 = process.env.WORKFLOW_EVENTS_TRANSPORT) == null ? void 0 : _a3.trim().toLowerCase()) !== "http";
148505
148720
  }
148506
148721
  function wsEventsTransportOverrideWorkflows() {
148507
148722
  const raw2 = process.env.WORKFLOW_EVENTS_TRANSPORT_WS_OVERRIDE_WORKFLOWS;
@@ -149026,6 +149241,21 @@ class ReplayEventObserverError extends Error {
149026
149241
  this.name = "ReplayEventObserverError";
149027
149242
  }
149028
149243
  }
149244
+ class AfterCommitError extends Error {
149245
+ constructor(error2) {
149246
+ super("Event log read after a committed write failed", { cause: error2 });
149247
+ __publicField(this, "error");
149248
+ this.error = error2;
149249
+ this.name = "AfterCommitError";
149250
+ }
149251
+ }
149252
+ const STEP_OUTCOME_EVENT_TYPES = /* @__PURE__ */ new Set([
149253
+ "step_completed",
149254
+ "step_retrying"
149255
+ ]);
149256
+ function recordsStepOutcome(eventType) {
149257
+ return STEP_OUTCOME_EVENT_TYPES.has(eventType);
149258
+ }
149029
149259
  const EVENT_RETRY_ELIGIBILITY = {
149030
149260
  // Creates: conditional create → 409 EntityConflictError if it already exists.
149031
149261
  run_created: {
@@ -149111,6 +149341,8 @@ const EVENT_RETRY_ELIGIBILITY = {
149111
149341
  };
149112
149342
  const MAX_EVENT_POST_RETRIES = 2;
149113
149343
  const THROTTLE_RETRY_BUDGET_MS = 3e4;
149344
+ const THROTTLE_DEADLINE_RESERVE_MS = 15e3;
149345
+ const THROTTLE_RETRY_MAX_BUDGET_MS = 15 * 6e4;
149114
149346
  const DEFAULT_THROTTLE_RETRY_AFTER_SECONDS = 1;
149115
149347
  const EVENT_POST_RETRY_BASE_MS = 100;
149116
149348
  const EVENT_POST_RETRY_JITTER_MS = 50;
@@ -149207,23 +149439,48 @@ function errorMarker(err) {
149207
149439
  }
149208
149440
  return collectErrorMarkers(err)[0] ?? (err instanceof Error ? err.name : "unknown");
149209
149441
  }
149210
- function createThrottleWaiter(target2) {
149442
+ async function resolveDeadlineMs() {
149443
+ try {
149444
+ const deadline = await getDeadline();
149445
+ const ms2 = deadline == null ? void 0 : deadline.getTime();
149446
+ return ms2 !== void 0 && Number.isFinite(ms2) ? ms2 : void 0;
149447
+ } catch {
149448
+ return void 0;
149449
+ }
149450
+ }
149451
+ function createThrottleWaiter(target2, budget) {
149211
149452
  let waitedMs = 0;
149453
+ let limit;
149212
149454
  return async (err, signal) => {
149213
149455
  const waitMs = Math.max(1, typeof err.retryAfter === "number" ? err.retryAfter : DEFAULT_THROTTLE_RETRY_AFTER_SECONDS) * 1e3;
149214
- if (waitedMs + waitMs > THROTTLE_RETRY_BUDGET_MS) {
149215
- logRetry("throttle retry budget exhausted", {
149456
+ if (limit === void 0) {
149457
+ const deadlineMs = await resolveDeadlineMs();
149458
+ limit = {
149459
+ budgetMs: budget === "invocation" && deadlineMs !== void 0 ? THROTTLE_RETRY_MAX_BUDGET_MS : THROTTLE_RETRY_BUDGET_MS,
149460
+ deadlineMs
149461
+ };
149462
+ }
149463
+ const outlastsInvocation = limit.deadlineMs !== void 0 && Date.now() + waitMs > limit.deadlineMs - THROTTLE_DEADLINE_RESERVE_MS;
149464
+ if (waitedMs + waitMs > limit.budgetMs || outlastsInvocation) {
149465
+ logRetry("throttle retry budget exhausted; surfacing to the queue", {
149216
149466
  target: target2,
149467
+ budget,
149217
149468
  waitedMs,
149218
- retryAfter: err.retryAfter
149469
+ retryAfter: err.retryAfter,
149470
+ outlastsInvocation
149219
149471
  });
149220
149472
  throw err;
149221
149473
  }
149222
149474
  waitedMs += waitMs;
149223
- console.warn(`[workflow] Throttled (429) writing ${target2}; retrying in-process in ${waitMs / 1e3}s`);
149475
+ console.warn(`[workflow] Throttled (429) ${target2}; retrying in-process in ${waitMs / 1e3}s`);
149224
149476
  await sleep$1(waitMs, signal);
149225
149477
  };
149226
149478
  }
149479
+ function throttleBudgetFor(eventType, options) {
149480
+ if ((options == null ? void 0 : options.batchIdempotent) !== void 0)
149481
+ return "bounded";
149482
+ return (options == null ? void 0 : options.afterStepBody) === true || recordsStepOutcome(eventType) ? "invocation" : "bounded";
149483
+ }
149227
149484
  function isEligibleForTransientRetry(eventType, options) {
149228
149485
  var _a3;
149229
149486
  if ((options == null ? void 0 : options.batchIdempotent) !== void 0) {
@@ -149233,11 +149490,13 @@ function isEligibleForTransientRetry(eventType, options) {
149233
149490
  }
149234
149491
  async function withEventPostRetry(fn2, eventType, options) {
149235
149492
  const retryable = isEligibleForTransientRetry(eventType, options);
149236
- const waitOutThrottle = createThrottleWaiter(`${eventType} event`);
149493
+ const waitOutThrottle = createThrottleWaiter(`writing ${eventType} event`, throttleBudgetFor(eventType, options));
149237
149494
  for (let attempt = 0; ; ) {
149238
149495
  try {
149239
149496
  return await fn2();
149240
149497
  } catch (err) {
149498
+ if (err instanceof AfterCommitError)
149499
+ throw err;
149241
149500
  if (ThrottleError.is(err)) {
149242
149501
  await waitOutThrottle(err);
149243
149502
  continue;
@@ -150317,11 +150576,18 @@ async function consumeReplayLogResponse(response2, { runId, eventsRemoteRefBehav
150317
150576
  if (!page.cursor) {
150318
150577
  throw new WorkflowWorldError("v4 createEvent: partial event stream missing cursor", { code: "SCHEMA_VALIDATION" });
150319
150578
  }
150320
- const suffix = await getWorkflowRunEventsV4(runId, {
150321
- cursor: page.cursor,
150322
- // The suffix of a replay log is the same replay log.
150323
- remoteRefBehavior: eventsRemoteRefBehavior === "skip-step-inputs" ? "skip-step-inputs" : "resolve"
150324
- }, config2, replayEventObserver);
150579
+ let suffix;
150580
+ try {
150581
+ suffix = await getWorkflowRunEventsV4(runId, {
150582
+ cursor: page.cursor,
150583
+ // The suffix of a replay log is the same replay log.
150584
+ remoteRefBehavior: eventsRemoteRefBehavior === "skip-step-inputs" ? "skip-step-inputs" : "resolve"
150585
+ }, config2, replayEventObserver);
150586
+ } catch (err) {
150587
+ if (ThrottleError.is(err))
150588
+ throw new AfterCommitError(err);
150589
+ throw err;
150590
+ }
150325
150591
  return {
150326
150592
  events: [...page.events, ...suffix.events],
150327
150593
  cursor: suffix.cursor ?? page.cursor,
@@ -150384,9 +150650,22 @@ async function getWorkflowRunEventsV4(runId, params = {}, config2, replayEventOb
150384
150650
  let cursor = params.cursor ?? null;
150385
150651
  let partialStreamRetries = 0;
150386
150652
  let consumed;
150387
- do {
150653
+ const fullLog = params.limit === void 0;
150654
+ const waitOutThrottle = createThrottleWaiter("reading events", "bounded");
150655
+ for (; ; ) {
150388
150656
  const pageCursor = cursor ?? void 0;
150389
- consumed = await consumeListWithSkipFallback(baseUrl, params.remoteRefBehavior, (remoteRefBehavior) => `${baseUrl}/v4/runs/${encodeURIComponent(runId)}/events` + paginationToQuery({ ...params, remoteRefBehavior, cursor: pageCursor }), headers2, config2, "listEvents", replayEventObserver);
150657
+ try {
150658
+ consumed = await consumeListWithSkipFallback(baseUrl, params.remoteRefBehavior, (remoteRefBehavior) => `${baseUrl}/v4/runs/${encodeURIComponent(runId)}/events` + paginationToQuery({
150659
+ ...params,
150660
+ remoteRefBehavior,
150661
+ cursor: pageCursor
150662
+ }), headers2, config2, "listEvents", replayEventObserver);
150663
+ } catch (err) {
150664
+ if (!fullLog || !ThrottleError.is(err))
150665
+ throw err;
150666
+ await waitOutThrottle(err);
150667
+ continue;
150668
+ }
150390
150669
  const cursorAdvanced = !!consumed.cursor && consumed.cursor !== cursor;
150391
150670
  if (consumed.kind === "partial") {
150392
150671
  if (params.limit !== void 0 || !cursorAdvanced || partialStreamRetries === MAX_PARTIAL_STREAM_RETRIES) {
@@ -150400,7 +150679,9 @@ async function getWorkflowRunEventsV4(runId, params = {}, config2, replayEventOb
150400
150679
  for (const event of consumed.events) {
150401
150680
  events2.push(event);
150402
150681
  }
150403
- } while (consumed.kind === "partial");
150682
+ if (consumed.kind !== "partial")
150683
+ break;
150684
+ }
150404
150685
  return {
150405
150686
  events: events2,
150406
150687
  cursor: consumed.cursor || (partialStreamRetries > 0 ? cursor : null),
@@ -150859,7 +151140,8 @@ async function createWorkflowRunEvent(id2, data2, params, config2) {
150859
151140
  // The atomic lazy-resume shape is deduplicated server-side by the
150860
151141
  // (runId, resumeId) claim, so its POST is idempotent-on-retry even
150861
151142
  // though plain hook_received is not; see EVENT_RETRY_ELIGIBILITY.
150862
- idempotentHookResume: data2.eventType === "hook_received" && (params == null ? void 0 : params.resumeId) !== void 0 && (params == null ? void 0 : params.resumePayloadDigest) !== void 0
151143
+ idempotentHookResume: data2.eventType === "hook_received" && (params == null ? void 0 : params.resumeId) !== void 0 && (params == null ? void 0 : params.resumePayloadDigest) !== void 0,
151144
+ afterStepBody: (params == null ? void 0 : params.afterStepBody) === true
150863
151145
  });
150864
151146
  if (data2.eventType === "run_created" && !result.run) {
150865
151147
  throw new WorkflowWorldError(`${data2.eventType} response is missing the run entity`, { code: "SCHEMA_VALIDATION" });
@@ -150874,6 +151156,8 @@ async function createWorkflowRunEvent(id2, data2, params, config2) {
150874
151156
  } catch (err) {
150875
151157
  if (err instanceof ReplayEventObserverError)
150876
151158
  throw err.error;
151159
+ if (err instanceof AfterCommitError)
151160
+ throw err.error;
150877
151161
  if (HookForceClaimedError.is(err) && data2.eventType === "hook_received") {
150878
151162
  const token = (_c2 = data2.eventData) == null ? void 0 : _c2.token;
150879
151163
  throw new HookForceClaimedError(typeof token === "string" ? token : err.token, err.claimedByRunId, err.claimedByHookId);
@@ -151594,7 +151878,7 @@ function beginNormalWsClose(ws, reason) {
151594
151878
  await observed;
151595
151879
  span == null ? void 0 : span.setAttribute("workflow.stream.ws.close_cleanup_timeout", timedOut);
151596
151880
  });
151597
- void import("./index-B2Fjee_4.js").then((n) => n.i).then(({ waitUntil: waitUntil2 }) => waitUntil2(cleanup)).catch(() => {
151881
+ void import("./index-HeFIWQE6.js").then((n) => n.i).then(({ waitUntil: waitUntil2 }) => waitUntil2(cleanup)).catch(() => {
151598
151882
  });
151599
151883
  void cleanup.catch(() => {
151600
151884
  });
@@ -151848,6 +152132,13 @@ class VercelStreamWriteSession {
151848
152132
  if (this.mode === "deferred")
151849
152133
  this.mode = "waiting_to_connect";
151850
152134
  }
152135
+ release() {
152136
+ return this.enqueue(async () => {
152137
+ if (this.mode === "closed" || this.mode === "poisoned")
152138
+ return;
152139
+ this.fallbackToHttpBeforeSend("stream writer released");
152140
+ });
152141
+ }
151851
152142
  dispose() {
151852
152143
  var _a3;
151853
152144
  if (this.mode === "closed")
@@ -151972,7 +152263,7 @@ class VercelStreamWriteSession {
151972
152263
  return http3;
151973
152264
  });
151974
152265
  const [{ WebSocket: WebSocketImpl }, http2] = await Promise.all([
151975
- import("./wrapper-D66LMJdl.js"),
152266
+ import("./wrapper-ikjqnRtL.js"),
151976
152267
  httpPromise
151977
152268
  ]);
151978
152269
  if (this.mode !== "connecting")
@@ -152039,6 +152330,8 @@ class VercelStreamWriteSession {
152039
152330
  return;
152040
152331
  }
152041
152332
  void this.inbound.then(() => {
152333
+ if (ws !== this.socket)
152334
+ return;
152042
152335
  if (this.isIdleThrottledSocket(ws)) {
152043
152336
  this.leaveThrottledSocketForHttp();
152044
152337
  return;
@@ -152250,12 +152543,14 @@ class VercelStreamWriteSession {
152250
152543
  release == null ? void 0 : release();
152251
152544
  }
152252
152545
  fallbackToHttpBeforeSend(reason = "HTTP fallback before send") {
152253
- var _a3;
152254
152546
  this.mode = "http";
152255
152547
  this.drainReason = void 0;
152256
- (_a3 = this.socket) == null ? void 0 : _a3.close(1e3, reason);
152548
+ const socket = this.socket;
152257
152549
  this.socket = void 0;
152550
+ this.transportDecision = Promise.resolve();
152258
152551
  this.finishDrainWait();
152552
+ if (socket)
152553
+ beginNormalWsClose(socket, reason);
152259
152554
  }
152260
152555
  /**
152261
152556
  * Classifies a correlated error and applies its session effect
@@ -152283,7 +152578,7 @@ class VercelStreamWriteSession {
152283
152578
  * StreamWsRequestNotSentError, which callers turn into an HTTP fallback.
152284
152579
  */
152285
152580
  async requestRetryingThrottle(operation, buildFrame, writeTiming, writeMetadata, maxMessageBytes) {
152286
- const waitOutThrottle = createThrottleWaiter(operation === "write" ? "stream chunks" : "stream close");
152581
+ const waitOutThrottle = createThrottleWaiter(operation === "write" ? "writing stream chunks" : "writing stream close", "bounded");
152287
152582
  for (let attempt = 0; ; attempt++) {
152288
152583
  try {
152289
152584
  return await this.request(operation, buildFrame, attempt === 0 ? writeTiming : void 0, writeMetadata, maxMessageBytes);
@@ -156391,8 +156686,7 @@ class WsEventsTransport {
156391
156686
  * That de-opt covers the handshake only. A channel that connects and then
156392
156687
  * fails every write stays registered and keeps taking the WS path, so the
156393
156688
  * fallback is per-invocation rather than a circuit breaker. Tolerable while
156394
- * the transport is opt-in; defaulting it on would need a write-failure
156395
- * de-opt too.
156689
+ * the transport is opt-in; defaulting it on needs a write-failure de-opt too.
156396
156690
  */
156397
156691
  open() {
156398
156692
  if (this.closed)
@@ -157737,15 +158031,17 @@ async function computeResumePayloadDigest(bytes) {
157737
158031
  return hex2;
157738
158032
  }
157739
158033
  function resumeContextFromRun(run2) {
157740
- var _a3, _b2, _c2;
158034
+ var _a3, _b2, _c2, _d2;
157741
158035
  const coreVersion = (_a3 = run2.executionContext) == null ? void 0 : _a3.workflowCoreVersion;
157742
158036
  const traceCarrier = (_b2 = run2.executionContext) == null ? void 0 : _b2.traceCarrier;
157743
158037
  const hookResumeInputVersion = (_c2 = run2.executionContext) == null ? void 0 : _c2.hookResumeInputVersion;
158038
+ const nodeVersion = (_d2 = run2.executionContext) == null ? void 0 : _d2.nodeVersion;
157744
158039
  return {
157745
158040
  deploymentId: run2.deploymentId,
157746
158041
  workflowName: run2.workflowName,
157747
158042
  runSpecVersion: run2.specVersion,
157748
158043
  workflowCoreVersion: typeof coreVersion === "string" ? coreVersion : void 0,
158044
+ nodeVersion: typeof nodeVersion === "string" ? nodeVersion : void 0,
157749
158045
  traceCarrier: traceCarrier && typeof traceCarrier === "object" ? traceCarrier : void 0,
157750
158046
  encryptionPublicKey: run2.encryptionPublicKey,
157751
158047
  hookResumeInputVersion: typeof hookResumeInputVersion === "number" ? hookResumeInputVersion : void 0
@@ -157937,7 +158233,7 @@ async function resumeHookAttempt(world, span, tokenOrHook, payload, encryptionKe
157937
158233
  if (info.run && isTerminalWorkflowRunStatus(info.run.status)) {
157938
158234
  throw new HookNotFoundError(hook.token);
157939
158235
  }
157940
- const capabilities = getRunCapabilities(resumeContext.workflowCoreVersion);
158236
+ const capabilities = getRunCapabilities(resumeContext.workflowCoreVersion, resumeContext.nodeVersion);
157941
158237
  let payloadKey;
157942
158238
  const runPublicKey = encryptionKeyOverride ? (
157943
158239
  // The caller already holds a key (resumeWebhook resolved one to
@@ -157954,7 +158250,7 @@ async function resumeHookAttempt(world, span, tokenOrHook, payload, encryptionKe
157954
158250
  }
157955
158251
  payloadKey = encryptionKey;
157956
158252
  }
157957
- const compression = (resumeContext.runSpecVersion ?? 0) >= SPEC_VERSION_SUPPORTS_COMPRESSION && capabilities.supportedFormats.has(SerializationFormat$1.GZIP);
158253
+ const compression = (resumeContext.runSpecVersion ?? 0) >= SPEC_VERSION_SUPPORTS_COMPRESSION ? getCompressionMode(capabilities) : false;
157958
158254
  const ops = [];
157959
158255
  const readbackOps = [];
157960
158256
  const v1Compat = isLegacySpecVersion(hook.specVersion);
@@ -165181,8 +165477,8 @@ function HooksTable({
165181
165477
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
165182
165478
  Button,
165183
165479
  {
165184
- variant: "outline",
165185
- size: "sm",
165480
+ variant: "secondary",
165481
+ size: "small",
165186
165482
  onClick: onRefresh,
165187
165483
  disabled: loading,
165188
165484
  children: [
@@ -165235,9 +165531,10 @@ function HooksTable({
165235
165531
  /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
165236
165532
  Button,
165237
165533
  {
165238
- variant: "ghost",
165239
- size: "icon",
165240
- className: "h-8 w-8",
165534
+ variant: "tertiary",
165535
+ size: "small",
165536
+ shape: "square",
165537
+ "aria-label": "Hook actions",
165241
165538
  onClick: (e) => e.stopPropagation(),
165242
165539
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(Ellipsis, { className: "h-4 w-4" })
165243
165540
  }
@@ -165263,8 +165560,8 @@ function HooksTable({
165263
165560
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
165264
165561
  Button,
165265
165562
  {
165266
- variant: "outline",
165267
- size: "sm",
165563
+ variant: "secondary",
165564
+ size: "small",
165268
165565
  onClick: previousPage,
165269
165566
  disabled: !hasPreviousPage,
165270
165567
  children: [
@@ -165276,8 +165573,8 @@ function HooksTable({
165276
165573
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
165277
165574
  Button,
165278
165575
  {
165279
- variant: "outline",
165280
- size: "sm",
165576
+ variant: "secondary",
165577
+ size: "small",
165281
165578
  onClick: nextPage,
165282
165579
  disabled: !hasNextPage,
165283
165580
  children: [
@@ -167025,8 +167322,8 @@ function SelectionBar({
167025
167322
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
167026
167323
  Button,
167027
167324
  {
167028
- variant: "ghost",
167029
- size: "sm",
167325
+ variant: "tertiary",
167326
+ size: "small",
167030
167327
  className: "h-7 px-2 text-primary-foreground hover:bg-primary-foreground/10 hover:text-primary-foreground",
167031
167328
  onClick: onClearSelection,
167032
167329
  children: [
@@ -167124,9 +167421,11 @@ function ErrorCodeBadge({
167124
167421
  /* @__PURE__ */ jsxRuntimeExports.jsx(
167125
167422
  Button,
167126
167423
  {
167127
- variant: "ghost",
167128
- size: "icon",
167424
+ variant: "tertiary",
167425
+ size: "tiny",
167426
+ shape: "square",
167129
167427
  className: "h-5 w-5 shrink-0",
167428
+ "aria-label": "Copy error code",
167130
167429
  onClick: handleCopy,
167131
167430
  children: copied ? /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "h-2.5 w-2.5 text-muted-foreground" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "h-2.5 w-2.5 text-muted-foreground" })
167132
167431
  }
@@ -167393,8 +167692,8 @@ function RunActionsButtons({
167393
167692
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
167394
167693
  Button,
167395
167694
  {
167396
- variant: "outline",
167397
- size: "sm",
167695
+ variant: "secondary",
167696
+ size: "small",
167398
167697
  onClick: onRerunClick,
167399
167698
  disabled: !canRerun,
167400
167699
  children: [
@@ -167409,8 +167708,8 @@ function RunActionsButtons({
167409
167708
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
167410
167709
  Button,
167411
167710
  {
167412
- variant: "outline",
167413
- size: "sm",
167711
+ variant: "secondary",
167712
+ size: "small",
167414
167713
  onClick: onCancelClick,
167415
167714
  disabled: !canCancel,
167416
167715
  children: [
@@ -167423,7 +167722,16 @@ function RunActionsButtons({
167423
167722
  ] }),
167424
167723
  /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { children: [
167425
167724
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
167426
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", size: "sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Ellipsis, { className: "h-4 w-4" }) }) }) }),
167725
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
167726
+ Button,
167727
+ {
167728
+ variant: "secondary",
167729
+ size: "small",
167730
+ shape: "square",
167731
+ "aria-label": "More actions",
167732
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Ellipsis, { className: "h-4 w-4" })
167733
+ }
167734
+ ) }) }),
167427
167735
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: "More actions" })
167428
167736
  ] }),
167429
167737
  /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenuContent, { align: "end", children: [
@@ -167712,9 +168020,10 @@ function LazyDropdownMenu({
167712
168020
  /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
167713
168021
  Button,
167714
168022
  {
167715
- variant: "ghost",
167716
- size: "icon",
167717
- className: "h-8 w-8",
168023
+ variant: "tertiary",
168024
+ size: "small",
168025
+ shape: "square",
168026
+ "aria-label": "Run actions",
167718
168027
  onClick: (e) => e.stopPropagation(),
167719
168028
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(Ellipsis, { className: "h-4 w-4" })
167720
168029
  }
@@ -167912,8 +168221,8 @@ function FilterControls({
167912
168221
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
167913
168222
  Button,
167914
168223
  {
167915
- variant: "outline",
167916
- size: "sm",
168224
+ variant: "secondary",
168225
+ size: "small",
167917
168226
  onClick: onSortToggle,
167918
168227
  disabled: loading,
167919
168228
  children: [
@@ -167928,8 +168237,8 @@ function FilterControls({
167928
168237
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
167929
168238
  Button,
167930
168239
  {
167931
- variant: "outline",
167932
- size: "sm",
168240
+ variant: "secondary",
168241
+ size: "small",
167933
168242
  onClick: onRefresh,
167934
168243
  disabled: loading,
167935
168244
  children: [
@@ -168298,8 +168607,8 @@ function RunsTable({ onRunClick }) {
168298
168607
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
168299
168608
  Button,
168300
168609
  {
168301
- variant: "ghost",
168302
- size: "sm",
168610
+ variant: "tertiary",
168611
+ size: "small",
168303
168612
  className: "h-7 text-primary-foreground hover:bg-primary-foreground/10 hover:text-primary-foreground",
168304
168613
  onClick: handleBulkReenqueue,
168305
168614
  disabled: isBulkReenqueuing || selectedRuns.length === 0,
@@ -168315,8 +168624,8 @@ function RunsTable({ onRunClick }) {
168315
168624
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "inline-flex", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
168316
168625
  Button,
168317
168626
  {
168318
- variant: "ghost",
168319
- size: "sm",
168627
+ variant: "tertiary",
168628
+ size: "small",
168320
168629
  className: "h-7 text-primary-foreground hover:bg-primary-foreground/10 hover:text-primary-foreground",
168321
168630
  onClick: handleBulkCancel,
168322
168631
  disabled: isBulkCancelling || exceedsBulkCancelLimit,
@@ -180132,7 +180441,7 @@ function AlertDialogCancel({
180132
180441
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
180133
180442
  Cancel,
180134
180443
  {
180135
- className: cn(buttonVariants({ variant: "outline" }), className),
180444
+ className: cn(buttonVariants({ variant: "secondary" }), className),
180136
180445
  ...props
180137
180446
  }
180138
180447
  );
@@ -181350,7 +181659,7 @@ const route4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
181350
181659
  __proto__: null,
181351
181660
  loader
181352
181661
  }, Symbol.toStringTag, { value: "Module" }));
181353
- const serverManifest = { "entry": { "module": "/assets/entry.client-DmlDFlyx.js", "imports": ["/assets/index-thGVuYbY.js"], "css": [] }, "routes": { "root": { "id": "root", "parentId": void 0, "path": "", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": true, "module": "/assets/root-ESATuWiF.js", "imports": ["/assets/index-thGVuYbY.js", "/assets/mermaid-3ZIDBTTL-fKP9rqOT.js", "/assets/loader-circle-CD4z6T9x.js", "/assets/arrow-up-right-CIRm41Zm.js"], "css": ["/assets/root-grl25rxS.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/home": { "id": "routes/home", "parentId": "root", "path": void 0, "index": true, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/home-Dl1wTnFS.js", "imports": ["/assets/index-thGVuYbY.js", "/assets/workflow-graph-viewer-DWfB9i-1.js", "/assets/mermaid-3ZIDBTTL-fKP9rqOT.js", "/assets/loader-circle-CD4z6T9x.js"], "css": ["/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/run-detail": { "id": "routes/run-detail", "parentId": "root", "path": "run/:runId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/run-detail-ClvtUP5Y.js", "imports": ["/assets/index-thGVuYbY.js", "/assets/workflow-graph-viewer-DWfB9i-1.js", "/assets/mermaid-3ZIDBTTL-fKP9rqOT.js", "/assets/arrow-up-right-CIRm41Zm.js"], "css": ["/assets/run-detail-CWoGxu_0.css", "/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.rpc": { "id": "routes/api.rpc", "parentId": "root", "path": "api/rpc", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.rpc-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.stream.$streamId": { "id": "routes/api.stream.$streamId", "parentId": "root", "path": "api/stream/:streamId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.stream._streamId-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 } }, "url": "/assets/manifest-7d7b25b4.js", "version": "7d7b25b4", "sri": void 0 };
181662
+ const serverManifest = { "entry": { "module": "/assets/entry.client-DmlDFlyx.js", "imports": ["/assets/index-thGVuYbY.js"], "css": [] }, "routes": { "root": { "id": "root", "parentId": void 0, "path": "", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": true, "module": "/assets/root-cIgKV8UA.js", "imports": ["/assets/index-thGVuYbY.js", "/assets/mermaid-3ZIDBTTL-DYqrMrvl.js", "/assets/loader-circle-BV40-ex9.js", "/assets/arrow-up-right-CCSP9ily.js"], "css": ["/assets/root-D51qsCcK.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/home": { "id": "routes/home", "parentId": "root", "path": void 0, "index": true, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/home-D3lvKrxA.js", "imports": ["/assets/index-thGVuYbY.js", "/assets/workflow-graph-viewer-DDSZhqQ2.js", "/assets/mermaid-3ZIDBTTL-DYqrMrvl.js", "/assets/loader-circle-BV40-ex9.js"], "css": ["/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/run-detail": { "id": "routes/run-detail", "parentId": "root", "path": "run/:runId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/run-detail-xT6TzcQH.js", "imports": ["/assets/index-thGVuYbY.js", "/assets/workflow-graph-viewer-DDSZhqQ2.js", "/assets/mermaid-3ZIDBTTL-DYqrMrvl.js", "/assets/arrow-up-right-CCSP9ily.js"], "css": ["/assets/run-detail-CWoGxu_0.css", "/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.rpc": { "id": "routes/api.rpc", "parentId": "root", "path": "api/rpc", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.rpc-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.stream.$streamId": { "id": "routes/api.stream.$streamId", "parentId": "root", "path": "api/stream/:streamId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.stream._streamId-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 } }, "url": "/assets/manifest-b2d18a63.js", "version": "b2d18a63", "sri": void 0 };
181354
181663
  const assetsBuildDirectory = "build/client";
181355
181664
  const basename = "/";
181356
181665
  const future = { "unstable_optimizeDeps": false, "unstable_subResourceIntegrity": false, "unstable_trailingSlashAwareDataRequests": false, "unstable_previewServerPrerendering": false, "v8_middleware": false, "v8_splitRouteModules": false, "v8_viteEnvironmentApi": false };