@workflow/web 4.1.30 → 4.1.32

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.
@@ -1,4 +1,4 @@
1
- import { R, K as Ks, Q as Qe } from "./mermaid-3ZIDBTTL-DV4S4pTo.js";
1
+ import { R, K as Ks, Q as Qe } from "./mermaid-3ZIDBTTL-Q2_PQwJo.js";
2
2
  import { r as reactExports, j as jsxRuntimeExports } from "./index-BQ-Xa8kF.js";
3
3
  var L = ({ code: s, language: t, raw: e, className: n, ...d$1 }) => {
4
4
  let { shikiTheme: l } = reactExports.useContext(R), o = Ks(), [m, i] = reactExports.useState(e);
@@ -1,6 +1,6 @@
1
1
  import { r as reactExports, D as ReactDOM, j as jsxRuntimeExports, A as Link, f as reactDomExports, C as useSearchParams, B as useNavigate, E as useLocation, w as withComponentProps } from "./index-BQ-Xa8kF.js";
2
- import { R as ResolveHookModal, S as Send, a as Skeleton, u as unwrapOrThrow, W as WorkflowWebAPIError, b as RelativeTime, A as Alert, C as CircleAlert, c as AlertTitle, d as AlertDescription, g as getErrorMessage, e as CopyableText, D as DropdownMenu, f as DropdownMenuTrigger, E as Ellipsis, h as DropdownMenuContent, i as DropdownMenuItem, j as ChevronRight, r as resumeHook, k as createCollection, l as hideOthers, m as ReactRemoveScroll, n as useDirection, o as ChevronDown, p as ChevronUp, q as Check, X, s as useControllableState$1, P as Primitive$1, t as composeEventHandlers$1, v as Presence, w as useSize, x as createContextScope$1, y as cancelRun, z as reenqueueRun, B as parseWorkflowName, F as StatusBadge, Z as Zap, G as CircleX, H as RunActionsDropdownItems, I as unwrapServerActionResult, J as WorkflowGraphViewer, T as Tabs, K as TabsList, L as TabsTrigger, M as TabsContent, N as ErrorBoundary } from "./workflow-graph-viewer-De_-9tJh.js";
3
- import { g as useLayoutEffect2, P as Primitive, c as createLucideIcon, h as useToast, d as cn, D as DEFAULT_PAGE_SIZE, i as fetchRuns, j as fetchHooks, k as getPaginationDisplay, T as Tooltip, a as TooltipTrigger, B as Button, b as TooltipContent, l as fetchEvents, m as useCallbackRef, n as useComposedRefs, A as Anchor, o as composeEventHandlers, p as useId, q as createPopperScope, s as DismissableLayer, v as createContextScope, w as createSlot, C as Content$1, x as useControllableState, y as Root2$1, V as VISUALLY_HIDDEN_STYLES, z as Arrow, E as useComposedRefs$1, u as useServerConfig, t as toast, L as LoaderCircle, F as fetchRun, G as cva, H as Presence$1, I as createContext2, J as fetchWorkflowsManifest } from "./mermaid-3ZIDBTTL-DV4S4pTo.js";
2
+ import { R as ResolveHookModal, S as Send, a as Skeleton, u as unwrapOrThrow, W as WorkflowWebAPIError, b as RelativeTime, A as Alert, C as CircleAlert, c as AlertTitle, d as AlertDescription, g as getErrorMessage, e as CopyableText, D as DropdownMenu, f as DropdownMenuTrigger, E as Ellipsis, h as DropdownMenuContent, i as DropdownMenuItem, j as ChevronRight, r as resumeHook, k as createCollection, l as hideOthers, m as ReactRemoveScroll, n as useDirection, o as ChevronDown, p as ChevronUp, q as Check, X, s as useControllableState$1, P as Primitive$1, t as composeEventHandlers$1, v as Presence, w as useSize, x as createContextScope$1, y as cancelRun, z as reenqueueRun, B as parseWorkflowName, F as StatusBadge, Z as Zap, G as CircleX, H as RunActionsDropdownItems, I as unwrapServerActionResult, J as WorkflowGraphViewer, T as Tabs, K as TabsList, L as TabsTrigger, M as TabsContent, N as ErrorBoundary } from "./workflow-graph-viewer-CazJ_HP0.js";
3
+ import { g as useLayoutEffect2, P as Primitive, c as createLucideIcon, h as useToast, d as cn, D as DEFAULT_PAGE_SIZE, i as fetchRuns, j as fetchHooks, k as getPaginationDisplay, T as Tooltip, a as TooltipTrigger, B as Button, b as TooltipContent, l as fetchEvents, m as useCallbackRef, n as useComposedRefs, A as Anchor, o as composeEventHandlers, p as useId, q as createPopperScope, s as DismissableLayer, v as createContextScope, w as createSlot, C as Content$1, x as useControllableState, y as Root2$1, V as VISUALLY_HIDDEN_STYLES, z as Arrow, E as useComposedRefs$1, u as useServerConfig, t as toast, L as LoaderCircle, F as fetchRun, G as cva, H as Presence$1, I as createContext2, J as fetchWorkflowsManifest } from "./mermaid-3ZIDBTTL-Q2_PQwJo.js";
4
4
  import "./index-CXBr7N7m.js";
5
5
  var PORTAL_NAME$2 = "Portal";
6
6
  var Portal$2 = reactExports.forwardRef((props, forwardedRef) => {
@@ -1 +1 @@
1
- window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-C7XgFTHI.js","imports":["/assets/index-BQ-Xa8kF.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root-DQQlQnXn.js","imports":["/assets/index-BQ-Xa8kF.js","/assets/mermaid-3ZIDBTTL-DV4S4pTo.js"],"css":["/assets/root-BOS11TzD.css","/assets/mermaid-3ZIDBTTL-yyHEMZs4.css"]},"routes/home":{"id":"routes/home","parentId":"root","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/home-Yy5gk_jJ.js","imports":["/assets/index-BQ-Xa8kF.js","/assets/workflow-graph-viewer-De_-9tJh.js","/assets/mermaid-3ZIDBTTL-DV4S4pTo.js","/assets/index-CXBr7N7m.js"],"css":["/assets/workflow-graph-viewer-yls6qlc0.css","/assets/mermaid-3ZIDBTTL-yyHEMZs4.css"]},"routes/run-detail":{"id":"routes/run-detail","parentId":"root","path":"run/:runId","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/run-detail-rocfw9Z5.js","imports":["/assets/index-BQ-Xa8kF.js","/assets/workflow-graph-viewer-De_-9tJh.js","/assets/mermaid-3ZIDBTTL-DV4S4pTo.js","/assets/encryption-Cu4jq70Y.js","/assets/index-CXBr7N7m.js"],"css":["/assets/workflow-graph-viewer-yls6qlc0.css","/assets/mermaid-3ZIDBTTL-yyHEMZs4.css"]},"routes/api.rpc":{"id":"routes/api.rpc","parentId":"root","path":"api/rpc","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.rpc-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.stream.$streamId":{"id":"routes/api.stream.$streamId","parentId":"root","path":"api/stream/:streamId","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.stream._streamId-l0sNRNKZ.js","imports":[],"css":[]}},"url":"/assets/manifest-e13ef35a.js","version":"e13ef35a"};
1
+ window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-C7XgFTHI.js","imports":["/assets/index-BQ-Xa8kF.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root-DpF6w_fA.js","imports":["/assets/index-BQ-Xa8kF.js","/assets/mermaid-3ZIDBTTL-Q2_PQwJo.js"],"css":["/assets/root-BOS11TzD.css","/assets/mermaid-3ZIDBTTL-yyHEMZs4.css"]},"routes/home":{"id":"routes/home","parentId":"root","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/home-BaDfLHa9.js","imports":["/assets/index-BQ-Xa8kF.js","/assets/workflow-graph-viewer-CazJ_HP0.js","/assets/mermaid-3ZIDBTTL-Q2_PQwJo.js","/assets/index-CXBr7N7m.js"],"css":["/assets/workflow-graph-viewer-yls6qlc0.css","/assets/mermaid-3ZIDBTTL-yyHEMZs4.css"]},"routes/run-detail":{"id":"routes/run-detail","parentId":"root","path":"run/:runId","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/run-detail-BP7Q8-uY.js","imports":["/assets/index-BQ-Xa8kF.js","/assets/workflow-graph-viewer-CazJ_HP0.js","/assets/mermaid-3ZIDBTTL-Q2_PQwJo.js","/assets/encryption-Cu4jq70Y.js","/assets/index-CXBr7N7m.js"],"css":["/assets/workflow-graph-viewer-yls6qlc0.css","/assets/mermaid-3ZIDBTTL-yyHEMZs4.css"]},"routes/api.rpc":{"id":"routes/api.rpc","parentId":"root","path":"api/rpc","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.rpc-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.stream.$streamId":{"id":"routes/api.stream.$streamId","parentId":"root","path":"api/stream/:streamId","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.stream._streamId-l0sNRNKZ.js","imports":[],"css":[]}},"url":"/assets/manifest-830ddfa8.js","version":"830ddfa8"};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/encryption-Cu4jq70Y.js","assets/index-CXBr7N7m.js","assets/index-BQ-Xa8kF.js","assets/highlighted-body-B3W2YXNL-B6-MkXV1.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/encryption-Cu4jq70Y.js","assets/index-CXBr7N7m.js","assets/index-BQ-Xa8kF.js","assets/highlighted-body-B3W2YXNL-Bim_Vs7c.js"])))=>i.map(i=>d[i]);
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -43693,7 +43693,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
43693
43693
  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 });
43694
43694
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
43695
43695
  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 }) });
43696
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-B6-MkXV1.js"), true ? __vite__mapDeps([3,2]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
43696
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-Bim_Vs7c.js"), true ? __vite__mapDeps([3,2]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
43697
43697
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
43698
43698
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
43699
43699
  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 }) })] }) });
@@ -48776,28 +48776,29 @@ export {
48776
48776
  buttonVariants as aA,
48777
48777
  isEncryptedData as aB,
48778
48778
  hydrateData as aC,
48779
- getWebRevivers as aD,
48780
- fetchEvent as aE,
48781
- fetchEventsByCorrelationId as aF,
48782
- LIVE_UPDATE_INTERVAL_MS as aG,
48783
- getEncryptionKeyForRun as aH,
48784
- StreamViewer as aI,
48785
- cn$4 as aJ,
48786
- composeRefs as aK,
48787
- useFloating as aL,
48788
- offset as aM,
48789
- shift as aN,
48790
- limitShift as aO,
48791
- flip as aP,
48792
- size as aQ,
48793
- arrow as aR,
48794
- hide as aS,
48795
- autoUpdate as aT,
48796
- cancelRun as aU,
48797
- reenqueueRun as aV,
48798
- wakeUpRun as aW,
48799
- resumeHook as aX,
48800
- recreateRun as aY,
48779
+ SerializationFormat as aD,
48780
+ getWebRevivers as aE,
48781
+ fetchEvent as aF,
48782
+ fetchEventsByCorrelationId as aG,
48783
+ LIVE_UPDATE_INTERVAL_MS as aH,
48784
+ getEncryptionKeyForRun as aI,
48785
+ StreamViewer as aJ,
48786
+ cn$4 as aK,
48787
+ composeRefs as aL,
48788
+ useFloating as aM,
48789
+ offset as aN,
48790
+ shift as aO,
48791
+ limitShift as aP,
48792
+ flip as aQ,
48793
+ size as aR,
48794
+ arrow as aS,
48795
+ hide as aT,
48796
+ autoUpdate as aU,
48797
+ cancelRun as aV,
48798
+ reenqueueRun as aW,
48799
+ wakeUpRun as aX,
48800
+ resumeHook as aY,
48801
+ recreateRun as aZ,
48801
48802
  formatDurationForTimeline as aa,
48802
48803
  formatWallClockTime as ab,
48803
48804
  useImmediateStyle as ac,
@@ -1,5 +1,5 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports, w as withComponentProps, x as withErrorBoundaryProps, M as Meta, L as Links, S as ScrollRestoration, y as Scripts, O as Outlet, z as useRouteError, i as isRouteErrorResponse, A as Link, B as useNavigate, C as useSearchParams } from "./index-BQ-Xa8kF.js";
2
- import { c as createLucideIcon, u as useServerConfig, T as Tooltip, a as TooltipTrigger, b as TooltipContent, r as runHealthCheck, t as toast, B as Button, L as LoaderCircle, d as cn, e as Toaster$1, S as ServerConfigProvider, f as TooltipProvider } from "./mermaid-3ZIDBTTL-DV4S4pTo.js";
2
+ import { c as createLucideIcon, u as useServerConfig, T as Tooltip, a as TooltipTrigger, b as TooltipContent, r as runHealthCheck, t as toast, B as Button, L as LoaderCircle, d as cn, e as Toaster$1, S as ServerConfigProvider, f as TooltipProvider } from "./mermaid-3ZIDBTTL-Q2_PQwJo.js";
3
3
  var M = (e, i, s, u, m, a, l, h) => {
4
4
  let d = document.documentElement, w = ["light", "dark"];
5
5
  function p(n) {
@@ -1,6 +1,6 @@
1
1
  import { j as jsxRuntimeExports, r as reactExports, f as reactDomExports, D as ReactDOM, B as useNavigate, C as useSearchParams, A as Link, w as withComponentProps, G as useParams } from "./index-BQ-Xa8kF.js";
2
- import { O as Copy, C as CircleAlert, Q as parseStepName, B as parseWorkflowName, j as ChevronRight, q as Check, U as ErrorCard, V as format, Z as Zap, S as Send, R as ResolveHookModal, p as ChevronUp, o as ChevronDown, X, N as ErrorBoundary, Y as Clock, G as CircleX, I as unwrapServerActionResult, u as unwrapOrThrow, W as WorkflowWebAPIError, _ as useEscapeKeydown, t as composeEventHandlers, $ as useCallbackRef, a0 as useLayoutEffect2, s as useControllableState, a1 as useId, a2 as createContext2, v as Presence, x as createContextScope, l as hideOthers, m as ReactRemoveScroll, a3 as useFocusGuards, a4 as LAYOUT, a5 as wakeUpRun, r as resumeHook, A as Alert, c as AlertTitle, d as AlertDescription, a as Skeleton$1, a6 as RunActionsButtons, F as StatusBadge, e as CopyableText, b as RelativeTime, T as Tabs, K as TabsList, L as TabsTrigger, M as TabsContent, y as cancelRun, a7 as recreateRun } from "./workflow-graph-viewer-De_-9tJh.js";
3
- import { c as createLucideIcon, M as Spinner, h as useToast, N as useHasContextCardProvider, O as ContextCardProvider, U as ContextCardTrigger, W as Skeleton, X as DecryptClickContext, Y as Yr, Z as isEncryptedMarker, _ as formatDuration, $ as DataInspector, a0 as _r, a1 as StreamClickContext, a2 as isExpiredMarker, a3 as isDoStreamStep, a4 as extractConversation, a5 as Lock, a6 as EVENT_DATA_REF_FIELDS, a7 as clsx, a8 as useTraceViewer, a9 as styles, aa as formatDurationForTimeline, ab as formatWallClockTime, ac as useImmediateStyle, ad as TIMELINE_PADDING, ae as formatTimeSelection, af as MARKER_HEIGHT, ag as ROW_HEIGHT, ah as ROW_PADDING, ai as SEARCH_HEIGHT, aj as getHighResInMs, ak as getMsInHighRes, al as MARKER_NOTCH_HEIGHT, am as MAP_HEIGHT, an as SEARCH_GAP, ao as MiniMap, ap as SpanNodes, aq as SpanDetailPanel, ar as TraceViewerContextProvider, as as hydrateResourceIOWithKey, at as hydrateResourceIO, au as fetchHook, l as fetchEvents, F as fetchRun, av as fetchStep, aw as hasEncryptedFields, ax as fetchStreams, ay as Slot, E as useComposedRefs, az as Slottable, d as cn, aA as buttonVariants, aB as isEncryptedData, aC as hydrateData, aD as getWebRevivers, aE as fetchEvent, aF as fetchEventsByCorrelationId, T as Tooltip, a as TooltipTrigger, b as TooltipContent, aG as LIVE_UPDATE_INTERVAL_MS$1, u as useServerConfig, aH as getEncryptionKeyForRun, t as toast, L as LoaderCircle, aI as StreamViewer } from "./mermaid-3ZIDBTTL-DV4S4pTo.js";
2
+ import { O as Copy, C as CircleAlert, Q as parseStepName, B as parseWorkflowName, j as ChevronRight, q as Check, U as ErrorCard, V as format, Z as Zap, S as Send, R as ResolveHookModal, p as ChevronUp, o as ChevronDown, X, N as ErrorBoundary, Y as Clock, G as CircleX, I as unwrapServerActionResult, u as unwrapOrThrow, W as WorkflowWebAPIError, _ as useEscapeKeydown, t as composeEventHandlers, $ as useCallbackRef, a0 as useLayoutEffect2, s as useControllableState, a1 as useId, a2 as createContext2, v as Presence, x as createContextScope, l as hideOthers, m as ReactRemoveScroll, a3 as useFocusGuards, a4 as LAYOUT, a5 as wakeUpRun, r as resumeHook, A as Alert, c as AlertTitle, d as AlertDescription, a as Skeleton$1, a6 as RunActionsButtons, F as StatusBadge, e as CopyableText, b as RelativeTime, T as Tabs, K as TabsList, L as TabsTrigger, M as TabsContent, y as cancelRun, a7 as recreateRun } from "./workflow-graph-viewer-CazJ_HP0.js";
3
+ import { c as createLucideIcon, M as Spinner, h as useToast, N as useHasContextCardProvider, O as ContextCardProvider, U as ContextCardTrigger, W as Skeleton, X as DecryptClickContext, Y as Yr, Z as isEncryptedMarker, _ as formatDuration, $ as DataInspector, a0 as _r, a1 as StreamClickContext, a2 as isExpiredMarker, a3 as isDoStreamStep, a4 as extractConversation, a5 as Lock, a6 as EVENT_DATA_REF_FIELDS, a7 as clsx, a8 as useTraceViewer, a9 as styles, aa as formatDurationForTimeline, ab as formatWallClockTime, ac as useImmediateStyle, ad as TIMELINE_PADDING, ae as formatTimeSelection, af as MARKER_HEIGHT, ag as ROW_HEIGHT, ah as ROW_PADDING, ai as SEARCH_HEIGHT, aj as getHighResInMs, ak as getMsInHighRes, al as MARKER_NOTCH_HEIGHT, am as MAP_HEIGHT, an as SEARCH_GAP, ao as MiniMap, ap as SpanNodes, aq as SpanDetailPanel, ar as TraceViewerContextProvider, as as hydrateResourceIOWithKey, at as hydrateResourceIO, au as fetchHook, l as fetchEvents, F as fetchRun, av as fetchStep, aw as hasEncryptedFields, ax as fetchStreams, ay as Slot, E as useComposedRefs, az as Slottable, d as cn, aA as buttonVariants, aB as isEncryptedData, aC as hydrateData, aD as SerializationFormat, aE as getWebRevivers, aF as fetchEvent, aG as fetchEventsByCorrelationId, T as Tooltip, a as TooltipTrigger, b as TooltipContent, aH as LIVE_UPDATE_INTERVAL_MS$1, u as useServerConfig, aI as getEncryptionKeyForRun, t as toast, L as LoaderCircle, aJ as StreamViewer } from "./mermaid-3ZIDBTTL-Q2_PQwJo.js";
4
4
  import { decrypt, importKey } from "./encryption-Cu4jq70Y.js";
5
5
  import "./index-CXBr7N7m.js";
6
6
  /**
@@ -5768,8 +5768,12 @@ function sanitizeForDisplay(value, depth = 0) {
5768
5768
  }
5769
5769
  const yieldToMain = () => new Promise((resolve) => setTimeout(resolve, 0));
5770
5770
  const YIELD_EVERY_N_FRAMES = 64;
5771
- function detectEncoding(data) {
5771
+ function detectEncoding(data, streamId) {
5772
5772
  if (data.length < FRAME_HEADER_SIZE) return "framed";
5773
+ const prefix = new TextDecoder().decode(data.subarray(0, FRAME_HEADER_SIZE));
5774
+ if (streamId.endsWith("_system_abort") && Object.values(SerializationFormat).some((format2) => format2 === prefix)) {
5775
+ return "unframed";
5776
+ }
5773
5777
  const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
5774
5778
  const len = view.getUint32(0, false);
5775
5779
  if (len > 0 && len <= 10 * 1024 * 1024) return "framed";
@@ -5888,7 +5892,14 @@ function useStreamReader(env, streamId, runId, encryptionKey, runStatus) {
5888
5892
  if (abortController.signal.aborted) break;
5889
5893
  const { value, done } = await reader.read();
5890
5894
  if (done) {
5891
- if (encoding === "legacy" && textRemainder.trim()) {
5895
+ if (encoding === "unframed" && buffer.length > 0) {
5896
+ frameIndex++;
5897
+ if (frameIndex > skipFrames) {
5898
+ const result = await processFrame(buffer, cryptoKey, revivers);
5899
+ if (result.encrypted) return { encrypted: true };
5900
+ targetBuffer.push(result.chunk);
5901
+ }
5902
+ } else if (encoding === "legacy" && textRemainder.trim()) {
5892
5903
  frameIndex++;
5893
5904
  if (frameIndex > skipFrames) {
5894
5905
  targetBuffer.push(parseLegacyLine(textRemainder.trim()));
@@ -5900,7 +5911,7 @@ function useStreamReader(env, streamId, runId, encryptionKey, runStatus) {
5900
5911
  if (encoding === null) {
5901
5912
  appendToBuffer(value);
5902
5913
  if (buffer.length >= FRAME_HEADER_SIZE) {
5903
- encoding = detectEncoding(buffer);
5914
+ encoding = detectEncoding(buffer, streamId);
5904
5915
  }
5905
5916
  if (encoding === "legacy") {
5906
5917
  textRemainder = decoder.decode(buffer, { stream: true });
@@ -5925,6 +5936,7 @@ function useStreamReader(env, streamId, runId, encryptionKey, runStatus) {
5925
5936
  }
5926
5937
  continue;
5927
5938
  }
5939
+ if (encoding === "unframed") continue;
5928
5940
  let offset = 0;
5929
5941
  let framesInBatch = 0;
5930
5942
  while (offset + FRAME_HEADER_SIZE <= buffer.length) {
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { c as createLucideIcon, aJ as cn, d as cn$1, G as cva, aK as composeRefs, E as useComposedRefs, aL as useFloating, aM as offset, aN as shift, aO as limitShift, aP as flip, aQ as size, aR as arrow, aS as hide, aT as autoUpdate, T as Tooltip, a as TooltipTrigger, b as TooltipContent, aU as cancelRun$1, aV as reenqueueRun$1, aW as wakeUpRun$1, aX as resumeHook$1, aY as recreateRun$1, v as createContextScope$1, n as useComposedRefs$1, w as createSlot, _ as formatDuration, B as Button, t as toast, p as useId$1, P as Primitive$1, o as composeEventHandlers$1, x as useControllableState$1, m as useCallbackRef$2, H as Presence$1 } from "./mermaid-3ZIDBTTL-DV4S4pTo.js";
4
+ import { c as createLucideIcon, aK as cn, d as cn$1, G as cva, aL as composeRefs, E as useComposedRefs, aM as useFloating, aN as offset, aO as shift, aP as limitShift, aQ as flip, aR as size, aS as arrow, aT as hide, aU as autoUpdate, T as Tooltip, a as TooltipTrigger, b as TooltipContent, aV as cancelRun$1, aW as reenqueueRun$1, aX as wakeUpRun$1, aY as resumeHook$1, aZ as recreateRun$1, v as createContextScope$1, n as useComposedRefs$1, w as createSlot, _ as formatDuration, B as Button, t as toast, p as useId$1, P as Primitive$1, o as composeEventHandlers$1, x as useControllableState$1, m as useCallbackRef$2, H as Presence$1 } from "./mermaid-3ZIDBTTL-Q2_PQwJo.js";
5
5
  import { r as reactExports, j as jsxRuntimeExports, f as reactDomExports, R as ReactExports, H as React, D as ReactDOM, a as requireReact, g as getDefaultExportFromCjs } from "./index-BQ-Xa8kF.js";
6
6
  import { V as VERCEL_403_ERROR_MESSAGE } from "./index-CXBr7N7m.js";
7
7
  function parseName(tag, name) {
@@ -9457,7 +9457,7 @@ const app = express();
9457
9457
  app.all(
9458
9458
  "/{*splat}",
9459
9459
  createRequestHandler({
9460
- build: () => import("./server-build-CgjoLYPd.js").then((n) => n.a7)
9460
+ build: () => import("./server-build-Blw7jSyo.js").then((n) => n.a7)
9461
9461
  })
9462
9462
  );
9463
9463
  app.use(
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { a1 as R, a2 as Ks, a3 as jsxRuntimeExports, a4 as Qe } from "./server-build-CgjoLYPd.js";
6
- import { r as reactExports } from "./app-juehGONX.js";
5
+ import { a1 as R, a2 as Ks, a3 as jsxRuntimeExports, a4 as Qe } from "./server-build-Blw7jSyo.js";
6
+ import { r as reactExports } from "./app-Z_Os_Okl.js";
7
7
  import "node:stream";
8
8
  import "util";
9
9
  import "crypto";
@@ -2,9 +2,9 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { H as HookSchema } from "./server-build-CgjoLYPd.js";
6
- import { B, D, a, E, b, c, d, e, L, M, f, g, P, Q, h, R, S, i, j, k, l, m, n, o, p, T, q, r, s, t, u, V, W, v, w, x, y, z, A, C, F, G, I, J, K, O, U, X, Y, Z, _, $, a0 } from "./server-build-CgjoLYPd.js";
7
- import "./app-juehGONX.js";
5
+ import { H as HookSchema } from "./server-build-Blw7jSyo.js";
6
+ import { B, D, a, E, b, c, d, e, L, M, f, g, P, Q, h, R, S, i, j, k, l, m, n, o, p, T, q, r, s, t, u, V, W, v, w, x, y, z, A, C, F, G, I, J, K, O, U, X, Y, Z, _, $, a0 } from "./server-build-Blw7jSyo.js";
7
+ import "./app-Z_Os_Okl.js";
8
8
  import "stream";
9
9
  import "express";
10
10
  import "node:stream";
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { N as Nt } from "./server-build-CgjoLYPd.js";
6
- import "./app-juehGONX.js";
5
+ import { N as Nt } from "./server-build-Blw7jSyo.js";
6
+ import "./app-Z_Os_Okl.js";
7
7
  import "stream";
8
8
  import "express";
9
9
  import "node:stream";
@@ -18,13 +18,13 @@ import { createRequire as __wkfCreateRequire } from "node:module";
18
18
  if (typeof globalThis.require === "undefined") {
19
19
  globalThis.require = __wkfCreateRequire(import.meta.url);
20
20
  }
21
- import { a as requireReact, S as ServerRouter, c as createReadableStreamFromReadable, r as reactExports, g as getDefaultExportFromCjs, R as React, b as ReactExports, d as commonjsGlobal, w as withComponentProps, e as withErrorBoundaryProps, M as Meta, L as Links, f as ScrollRestoration, h as Scripts, O as Outlet, u as useNavigate, i as useSearchParams, j as Link$1, k as useRouteError, l as isRouteErrorResponse, m as useLocation, n as useParams } from "./app-juehGONX.js";
21
+ import { a as requireReact, S as ServerRouter, c as createReadableStreamFromReadable, r as reactExports, g as getDefaultExportFromCjs, R as React, b as ReactExports, d as commonjsGlobal, w as withComponentProps, e as withErrorBoundaryProps, M as Meta, L as Links, f as ScrollRestoration, h as Scripts, O as Outlet, u as useNavigate, i as useSearchParams, j as Link$1, k as useRouteError, l as isRouteErrorResponse, m as useLocation, n as useParams } from "./app-Z_Os_Okl.js";
22
22
  import require$$0$5, { PassThrough, Transform as Transform$1 } from "node:stream";
23
23
  import require$$0 from "util";
24
24
  import require$$1 from "crypto";
25
25
  import require$$2 from "async_hooks";
26
26
  import require$$5 from "stream";
27
- import crypto, { createHash, webcrypto } from "node:crypto";
27
+ import crypto, { createHash, randomUUID, webcrypto } from "node:crypto";
28
28
  import minproc from "node:process";
29
29
  import path$3, { join as join$1, resolve, dirname, isAbsolute, sep as sep$1 } from "node:path";
30
30
  import require$$0$8, { fileURLToPath } from "node:url";
@@ -81975,7 +81975,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
81975
81975
  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 });
81976
81976
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
81977
81977
  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 }) });
81978
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-DgD9LFQJ.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
81978
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-CbAkIAJ-.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
81979
81979
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
81980
81980
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
81981
81981
  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 }) })] }) });
@@ -82297,7 +82297,7 @@ var Dt = ({ children: e, className: t, onDownload: o, onError: n }) => {
82297
82297
  }, []), 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] });
82298
82298
  };
82299
82299
  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 }) })] });
82300
- var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-DBfS-ZH8.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
82300
+ var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-DrIhQkL1.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
82301
82301
  function ke(e, t) {
82302
82302
  if (!(e != null && e.position || t != null && t.position)) return true;
82303
82303
  if (!(e != null && e.position && (t != null && t.position))) return false;
@@ -92206,7 +92206,7 @@ createLogger("build", {
92206
92206
  debugNamespace: "workflow:build"
92207
92207
  });
92208
92208
  const MAX_QUEUE_DELIVERIES = 48;
92209
- const version$1 = "4.8.14";
92209
+ const version$1 = "4.8.16";
92210
92210
  const execFileAsync = promisify(execFile);
92211
92211
  function parsePort$1(value, radix = 10) {
92212
92212
  const port = parseInt(value, radix);
@@ -92687,6 +92687,9 @@ async function write(filePath, data, opts) {
92687
92687
  throw error2;
92688
92688
  }
92689
92689
  }
92690
+ async function writeTempFile(filePath, data) {
92691
+ await withEnsuredDirectory(path$3.dirname(filePath), () => promises.writeFile(filePath, data, { flag: "wx" }));
92692
+ }
92690
92693
  async function readJSON(filePath, decoder2) {
92691
92694
  try {
92692
92695
  const content2 = await promises.readFile(filePath, "utf-8");
@@ -120348,7 +120351,7 @@ function hookRecoveryMarkerPath(basedir, token, runId, hookId) {
120348
120351
  const key = createHash("sha256").update(`${token}\0${runId}\0${hookId}`).digest("hex");
120349
120352
  return path$3.join(basedir, "hooks", "tokens", `${key}.recovery.json`);
120350
120353
  }
120351
- const monotonicUlid$1 = monotonicFactory(() => Math.random());
120354
+ const monotonicUlid = monotonicFactory(() => Math.random());
120352
120355
  const getObjectCreatedAt = (idPrefix) => (filename) => {
120353
120356
  const cleanName = stripTag(filename.replace(/\.json$/, "")) + ".json";
120354
120357
  const replaceRegex = new RegExp(`^${idPrefix}_`, "g");
@@ -120596,7 +120599,7 @@ async function handleLegacyEvent(basedir, runId, data, currentRun, params) {
120596
120599
  }
120597
120600
  case "wait_completed":
120598
120601
  case "hook_received": {
120599
- const eventId = `evnt_${monotonicUlid$1()}`;
120602
+ const eventId = `evnt_${monotonicUlid()}`;
120600
120603
  const now2 = /* @__PURE__ */ new Date();
120601
120604
  const event = {
120602
120605
  ...data,
@@ -120807,11 +120810,11 @@ function createEventsStorage(basedir, tag) {
120807
120810
  return createImpl();
120808
120811
  async function createImpl() {
120809
120812
  var _a3, _b2, _c, _d;
120810
- let eventId = `evnt_${monotonicUlid$1()}`;
120813
+ let eventId = `evnt_${monotonicUlid()}`;
120811
120814
  const now2 = /* @__PURE__ */ new Date();
120812
120815
  let effectiveRunId;
120813
120816
  if (data.eventType === "run_created" && (!runId || runId === "")) {
120814
- effectiveRunId = `wrun_${monotonicUlid$1()}`;
120817
+ effectiveRunId = `wrun_${monotonicUlid()}`;
120815
120818
  } else if (!runId) {
120816
120819
  throw new Error("runId is required for non-run_created events");
120817
120820
  } else {
@@ -120849,7 +120852,7 @@ function createEventsStorage(basedir, tag) {
120849
120852
  const runPath = taggedPath(basedir, "runs", effectiveRunId, tag);
120850
120853
  const created = await writeExclusive(runPath, JSON.stringify(createdRun, jsonReplacer));
120851
120854
  if (created) {
120852
- const runCreatedEventId = `evnt_${monotonicUlid$1()}`;
120855
+ const runCreatedEventId = `evnt_${monotonicUlid()}`;
120853
120856
  const runCreatedEvent = {
120854
120857
  eventType: "run_created",
120855
120858
  runId: effectiveRunId,
@@ -123124,7 +123127,125 @@ function requireProperLockfile() {
123124
123127
  return properLockfile.exports;
123125
123128
  }
123126
123129
  var properLockfileExports = requireProperLockfile();
123127
- const monotonicUlid = monotonicFactory(() => Math.random());
123130
+ const ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
123131
+ const CHUNK_FILE = /^chnk_([0-9A-HJKMNP-TV-Z]{26})(?![0-9A-Za-z])/;
123132
+ const FIRST_CHUNK_ID = `${"0".repeat(25)}1`;
123133
+ function chunkSuccessor(id2) {
123134
+ const digits = id2.split("");
123135
+ for (let at2 = digits.length - 1; at2 >= 0; at2 -= 1) {
123136
+ const value = ALPHABET.indexOf(digits[at2]);
123137
+ if (value < 0)
123138
+ throw new Error(`not a chunk id: ${id2}`);
123139
+ if (value < ALPHABET.length - 1) {
123140
+ digits[at2] = ALPHABET[value + 1];
123141
+ return digits.join("");
123142
+ }
123143
+ digits[at2] = ALPHABET[0];
123144
+ }
123145
+ throw new Error(`no chunk id follows ${id2}`);
123146
+ }
123147
+ async function newestChunkId(dir, prefix = "") {
123148
+ var _a3;
123149
+ let entries;
123150
+ try {
123151
+ entries = await fs$1.readdir(dir);
123152
+ } catch (error2) {
123153
+ if (error2.code === "ENOENT")
123154
+ return null;
123155
+ throw error2;
123156
+ }
123157
+ let newest = null;
123158
+ for (const entry2 of entries) {
123159
+ if (!entry2.startsWith(prefix))
123160
+ continue;
123161
+ const id2 = (_a3 = CHUNK_FILE.exec(entry2.slice(prefix.length))) == null ? void 0 : _a3[1];
123162
+ if (id2 !== void 0 && (newest === null || id2 > newest))
123163
+ newest = id2;
123164
+ }
123165
+ return newest;
123166
+ }
123167
+ function createChunkPlacer({ tagSuffix, writeFile: writeFile2, retry: retry2 }) {
123168
+ const turns = /* @__PURE__ */ new Map();
123169
+ const newest = /* @__PURE__ */ new Map();
123170
+ const keyOf = (dir, prefix) => path$3.join(dir, prefix);
123171
+ const fileOf = (dir, prefix, id2) => path$3.join(dir, `${prefix}chnk_${id2}${tagSuffix}.bin`);
123172
+ const linkInto = (temp, target2) => retry2(() => fs$1.link(temp, target2)).then(() => null, (error2) => error2);
123173
+ const successorOf = (id2) => id2 === null ? FIRST_CHUNK_ID : chunkSuccessor(id2);
123174
+ async function newestSince(dir, prefix, taken) {
123175
+ const listed = await newestChunkId(dir, prefix);
123176
+ return listed !== null && listed > taken ? listed : taken;
123177
+ }
123178
+ async function place(dir, prefix, temp, data) {
123179
+ const key = keyOf(dir, prefix);
123180
+ let id2 = newest.has(key) ? newest.get(key) : await newestChunkId(dir, prefix);
123181
+ let rewritten = false;
123182
+ for (; ; ) {
123183
+ const next2 = successorOf(id2);
123184
+ const error2 = await linkInto(temp, fileOf(dir, prefix, next2));
123185
+ if (error2 === null) {
123186
+ newest.set(key, next2);
123187
+ return `chnk_${next2}`;
123188
+ }
123189
+ if (error2.code === "EEXIST") {
123190
+ id2 = await newestSince(dir, prefix, next2);
123191
+ } else if (error2.code === "ENOENT" && !rewritten) {
123192
+ rewritten = true;
123193
+ await writeFile2(temp, data);
123194
+ } else {
123195
+ throw error2;
123196
+ }
123197
+ }
123198
+ }
123199
+ async function land(before, dir, prefix, chunks, landed) {
123200
+ const temps = chunks.map(() => path$3.join(dir, `.${randomUUID()}.tmp`));
123201
+ const left = new Set(temps);
123202
+ try {
123203
+ const written = await Promise.allSettled(chunks.map((data, index2) => writeFile2(temps[index2], data)));
123204
+ const failed = written.find((result) => result.status === "rejected");
123205
+ if (failed)
123206
+ throw failed.reason;
123207
+ await before;
123208
+ const ids = [];
123209
+ for (const [index2, temp] of temps.entries()) {
123210
+ const id2 = await place(dir, prefix, temp, chunks[index2]);
123211
+ ids.push(id2);
123212
+ left.delete(temp);
123213
+ await retry2(() => fs$1.unlink(temp)).catch(() => {
123214
+ });
123215
+ landed == null ? void 0 : landed(id2, index2);
123216
+ }
123217
+ return ids;
123218
+ } finally {
123219
+ for (const temp of left) {
123220
+ await retry2(() => fs$1.unlink(temp)).catch(() => {
123221
+ });
123222
+ }
123223
+ }
123224
+ }
123225
+ return {
123226
+ turn(name2) {
123227
+ const before = turns.get(name2);
123228
+ let done;
123229
+ const ended = new Promise((resolve2) => {
123230
+ done = resolve2;
123231
+ });
123232
+ const mine = before ? Promise.all([ended, before]).then(() => {
123233
+ }) : ended;
123234
+ turns.set(name2, mine);
123235
+ void mine.then(() => {
123236
+ if (turns.get(name2) === mine)
123237
+ turns.delete(name2);
123238
+ });
123239
+ return {
123240
+ land: (dir, prefix, chunks, landed) => land(before, dir, prefix, chunks, landed),
123241
+ done
123242
+ };
123243
+ },
123244
+ forget(dir, prefix) {
123245
+ newest.delete(keyOf(dir, prefix));
123246
+ }
123247
+ };
123248
+ }
123128
123249
  const RunStreamsSchema = object$1({
123129
123250
  streams: array$1(string$3())
123130
123251
  });
@@ -123253,64 +123374,67 @@ function createStreamer$1(basedir, tag) {
123253
123374
  return Buffer.from(chunk);
123254
123375
  }
123255
123376
  }
123377
+ const placer = createChunkPlacer({
123378
+ tagSuffix,
123379
+ writeFile: writeTempFile,
123380
+ retry: (fn2) => withWindowsRetry(fn2)
123381
+ });
123382
+ const chunksDir = path$3.join(basedir, "streams", "chunks");
123383
+ const chunkPrefix = (name2) => `${name2}-`;
123256
123384
  return {
123257
123385
  clearCache() {
123258
123386
  registeredStreams.clear();
123259
123387
  },
123260
123388
  async writeToStream(name2, _runId, chunk) {
123261
- const chunkId = `chnk_${monotonicUlid()}`;
123262
- const runId = await _runId;
123263
- await registerStreamForRun(runId, name2);
123264
- const chunkBuffer = toBuffer(chunk);
123265
- const serialized = serializeChunk({
123266
- chunk: chunkBuffer,
123267
- eof: false
123268
- });
123269
- const chunkPath = path$3.join(basedir, "streams", "chunks", `${name2}-${chunkId}${tagSuffix}.bin`);
123270
- await write(chunkPath, serialized);
123271
- const chunkData = Uint8Array.from(chunkBuffer);
123272
- streamEmitter.emit(`chunk:${name2}`, {
123273
- streamName: name2,
123274
- chunkData,
123275
- chunkId
123276
- });
123389
+ const turn = placer.turn(name2);
123390
+ try {
123391
+ await registerStreamForRun(await _runId, name2);
123392
+ assertSafeEntityId("streamName", name2);
123393
+ const chunkBuffer = toBuffer(chunk);
123394
+ const [chunkId] = await turn.land(chunksDir, chunkPrefix(name2), [
123395
+ serializeChunk({ chunk: chunkBuffer, eof: false })
123396
+ ]);
123397
+ streamEmitter.emit(`chunk:${name2}`, {
123398
+ streamName: name2,
123399
+ chunkData: Uint8Array.from(chunkBuffer),
123400
+ chunkId
123401
+ });
123402
+ } finally {
123403
+ turn.done();
123404
+ }
123277
123405
  },
123278
123406
  async writeToStreamMulti(name2, _runId, chunks) {
123279
123407
  if (chunks.length === 0)
123280
123408
  return;
123281
- const chunkIds = chunks.map(() => `chnk_${monotonicUlid()}`);
123282
- const runId = await _runId;
123283
- await registerStreamForRun(runId, name2);
123284
- const chunkBuffers = chunks.map((chunk) => toBuffer(chunk));
123285
- const writePromises = chunkBuffers.map(async (chunkBuffer, i) => {
123286
- const chunkId = chunkIds[i];
123287
- const serialized = serializeChunk({
123288
- chunk: chunkBuffer,
123289
- eof: false
123290
- });
123291
- const chunkPath = path$3.join(basedir, "streams", "chunks", `${name2}-${chunkId}${tagSuffix}.bin`);
123292
- await write(chunkPath, serialized);
123293
- return {
123294
- chunkId,
123295
- chunkData: Uint8Array.from(chunkBuffer)
123296
- };
123297
- });
123298
- for (const writePromise of writePromises) {
123299
- const { chunkId, chunkData } = await writePromise;
123300
- streamEmitter.emit(`chunk:${name2}`, {
123301
- streamName: name2,
123302
- chunkData,
123303
- chunkId
123409
+ const turn = placer.turn(name2);
123410
+ try {
123411
+ await registerStreamForRun(await _runId, name2);
123412
+ assertSafeEntityId("streamName", name2);
123413
+ const chunkBuffers = chunks.map((chunk) => toBuffer(chunk));
123414
+ await turn.land(chunksDir, chunkPrefix(name2), chunkBuffers.map((chunkBuffer) => serializeChunk({ chunk: chunkBuffer, eof: false })), (chunkId, index2) => {
123415
+ streamEmitter.emit(`chunk:${name2}`, {
123416
+ streamName: name2,
123417
+ chunkData: Uint8Array.from(chunkBuffers[index2]),
123418
+ chunkId
123419
+ });
123304
123420
  });
123421
+ } finally {
123422
+ turn.done();
123305
123423
  }
123306
123424
  },
123307
123425
  async closeStream(name2, _runId) {
123308
- const chunkId = `chnk_${monotonicUlid()}`;
123309
- const runId = await _runId;
123310
- await registerStreamForRun(runId, name2, { verify: true });
123311
- const chunkPath = path$3.join(basedir, "streams", "chunks", `${name2}-${chunkId}${tagSuffix}.bin`);
123312
- await write(chunkPath, serializeChunk({ chunk: Buffer.from([]), eof: true }));
123313
- streamEmitter.emit(`close:${name2}`, { streamName: name2 });
123426
+ const turn = placer.turn(name2);
123427
+ try {
123428
+ await registerStreamForRun(await _runId, name2, { verify: true });
123429
+ assertSafeEntityId("streamName", name2);
123430
+ await turn.land(chunksDir, chunkPrefix(name2), [
123431
+ serializeChunk({ chunk: Buffer.from([]), eof: true })
123432
+ ]);
123433
+ placer.forget(chunksDir, chunkPrefix(name2));
123434
+ streamEmitter.emit(`close:${name2}`, { streamName: name2 });
123435
+ } finally {
123436
+ turn.done();
123437
+ }
123314
123438
  },
123315
123439
  async listStreamsByRunId(runId) {
123316
123440
  assertSafeEntityId("runId", runId);
@@ -123318,7 +123442,6 @@ function createStreamer$1(basedir, tag) {
123318
123442
  },
123319
123443
  async getStreamChunks(name2, _runId, options) {
123320
123444
  const limit = (options == null ? void 0 : options.limit) ?? 100;
123321
- const chunksDir = path$3.join(basedir, "streams", "chunks");
123322
123445
  const { files: chunkFiles, extMap: fileExtMap } = await listChunkFilesForStream(chunksDir, name2, tag);
123323
123446
  let startIndex = 0;
123324
123447
  if (options == null ? void 0 : options.cursor) {
@@ -123373,7 +123496,6 @@ function createStreamer$1(basedir, tag) {
123373
123496
  };
123374
123497
  },
123375
123498
  async getStreamInfo(name2, _runId) {
123376
- const chunksDir = path$3.join(basedir, "streams", "chunks");
123377
123499
  const { files: chunkFiles, extMap: fileExtMap } = await listChunkFilesForStream(chunksDir, name2, tag);
123378
123500
  let streamDone = false;
123379
123501
  let dataCount = 0;
@@ -123388,38 +123510,29 @@ function createStreamer$1(basedir, tag) {
123388
123510
  return { tailIndex: dataCount - 1, done: streamDone };
123389
123511
  },
123390
123512
  async readFromStream(name2, startIndex = 0) {
123391
- const chunksDir = path$3.join(basedir, "streams", "chunks");
123392
123513
  let removeListeners = () => {
123393
123514
  };
123394
123515
  let pollInterval = null;
123395
123516
  return new ReadableStream({
123396
123517
  async start(controller) {
123397
123518
  const deliveredChunkIds = /* @__PURE__ */ new Set();
123398
- const bufferedEventChunks = [];
123519
+ const bufferedEventChunks = /* @__PURE__ */ new Map();
123399
123520
  let isReadingFromDisk = true;
123400
123521
  let pendingClose = false;
123401
123522
  let streamClosed = false;
123402
- const chunkListener = (event) => {
123403
- if (event.chunkData.byteLength === 0) {
123404
- deliveredChunkIds.add(event.chunkId);
123405
- return;
123406
- }
123407
- if (isReadingFromDisk) {
123408
- deliveredChunkIds.add(event.chunkId);
123409
- bufferedEventChunks.push({
123410
- chunkId: event.chunkId,
123411
- chunkData: Uint8Array.from(event.chunkData)
123412
- });
123413
- } else if (!deliveredChunkIds.has(event.chunkId)) {
123414
- deliveredChunkIds.add(event.chunkId);
123415
- controller.enqueue(Uint8Array.from(event.chunkData));
123416
- }
123523
+ const chunkIdForFile = (file2) => {
123524
+ const rawChunkId = file2.substring(name2.length + 1);
123525
+ return tag ? rawChunkId.replace(`.${tag}`, "") : rawChunkId;
123417
123526
  };
123418
- const closeListener = () => {
123419
- if (isReadingFromDisk) {
123420
- pendingClose = true;
123527
+ const deliver = (chunkId, chunkData) => {
123528
+ if (streamClosed || deliveredChunkIds.has(chunkId))
123421
123529
  return;
123530
+ deliveredChunkIds.add(chunkId);
123531
+ if (chunkData.byteLength) {
123532
+ controller.enqueue(Uint8Array.from(chunkData));
123422
123533
  }
123534
+ };
123535
+ const closeStream = () => {
123423
123536
  streamClosed = true;
123424
123537
  streamEmitter.off(`chunk:${name2}`, chunkListener);
123425
123538
  streamEmitter.off(`close:${name2}`, closeListener);
@@ -123432,7 +123545,46 @@ function createStreamer$1(basedir, tag) {
123432
123545
  } catch {
123433
123546
  }
123434
123547
  };
123435
- removeListeners = closeListener;
123548
+ const finishDiskRead = () => {
123549
+ isReadingFromDisk = false;
123550
+ const held = [...bufferedEventChunks].sort(([a2], [b2]) => a2 < b2 ? -1 : a2 > b2 ? 1 : 0);
123551
+ bufferedEventChunks.clear();
123552
+ for (const [chunkId, chunkData] of held) {
123553
+ deliver(chunkId, chunkData);
123554
+ }
123555
+ if (pendingClose)
123556
+ closeStream();
123557
+ };
123558
+ const deliverFile = async (file2, ext2) => {
123559
+ const chunkId = chunkIdForFile(file2);
123560
+ if (deliveredChunkIds.has(chunkId))
123561
+ return false;
123562
+ const live = bufferedEventChunks.get(chunkId);
123563
+ if (live !== void 0) {
123564
+ deliver(chunkId, live);
123565
+ return false;
123566
+ }
123567
+ const chunk = deserializeChunk(await readBuffer(path$3.join(chunksDir, `${file2}${ext2}`)));
123568
+ if ((chunk == null ? void 0 : chunk.eof) === true)
123569
+ return true;
123570
+ deliver(chunkId, chunk.chunk);
123571
+ return false;
123572
+ };
123573
+ const chunkListener = (event) => {
123574
+ if (isReadingFromDisk) {
123575
+ bufferedEventChunks.set(event.chunkId, Uint8Array.from(event.chunkData));
123576
+ return;
123577
+ }
123578
+ deliver(event.chunkId, event.chunkData);
123579
+ };
123580
+ const closeListener = () => {
123581
+ if (isReadingFromDisk) {
123582
+ pendingClose = true;
123583
+ return;
123584
+ }
123585
+ closeStream();
123586
+ };
123587
+ removeListeners = closeStream;
123436
123588
  streamEmitter.on(`chunk:${name2}`, chunkListener);
123437
123589
  streamEmitter.on(`close:${name2}`, closeListener);
123438
123590
  const { files: chunkFiles, extMap: fileExtMap } = await listChunkFilesForStream(chunksDir, name2, tag);
@@ -123445,94 +123597,51 @@ function createStreamer$1(basedir, tag) {
123445
123597
  }
123446
123598
  }
123447
123599
  const resolvedStartIndex = typeof startIndex === "number" && startIndex < 0 ? Math.max(0, dataChunkCount + startIndex) : startIndex;
123600
+ for (let i = 0; i < resolvedStartIndex && i < chunkFiles.length; i++) {
123601
+ deliveredChunkIds.add(chunkIdForFile(chunkFiles[i]));
123602
+ }
123448
123603
  let isComplete = false;
123449
123604
  for (let i = resolvedStartIndex; i < chunkFiles.length; i++) {
123450
123605
  const file2 = chunkFiles[i];
123451
- const rawChunkId = file2.substring(name2.length + 1);
123452
- const chunkId = tag ? rawChunkId.replace(`.${tag}`, "") : rawChunkId;
123453
- if (deliveredChunkIds.has(chunkId)) {
123454
- continue;
123455
- }
123456
- const ext2 = fileExtMap.get(file2) ?? ".bin";
123457
- const chunk = deserializeChunk(await readBuffer(path$3.join(chunksDir, `${file2}${ext2}`)));
123458
- if ((chunk == null ? void 0 : chunk.eof) === true) {
123606
+ if (await deliverFile(file2, fileExtMap.get(file2) ?? ".bin")) {
123459
123607
  isComplete = true;
123460
123608
  break;
123461
123609
  }
123462
- deliveredChunkIds.add(chunkId);
123463
- if (chunk.chunk.byteLength) {
123464
- controller.enqueue(Uint8Array.from(chunk.chunk));
123465
- }
123466
- }
123467
- isReadingFromDisk = false;
123468
- bufferedEventChunks.sort((a2, b2) => a2.chunkId.localeCompare(b2.chunkId));
123469
- for (const buffered of bufferedEventChunks) {
123470
- controller.enqueue(Uint8Array.from(buffered.chunkData));
123471
123610
  }
123611
+ finishDiskRead();
123472
123612
  if (isComplete) {
123473
- removeListeners();
123474
- try {
123475
- controller.close();
123476
- } catch {
123477
- }
123613
+ closeStream();
123478
123614
  return;
123479
123615
  }
123480
- if (pendingClose) {
123481
- streamEmitter.off(`chunk:${name2}`, chunkListener);
123482
- streamEmitter.off(`close:${name2}`, closeListener);
123483
- try {
123484
- controller.close();
123485
- } catch {
123486
- }
123616
+ if (streamClosed)
123487
123617
  return;
123488
- }
123489
- for (let i = 0; i < resolvedStartIndex && i < chunkFiles.length; i++) {
123490
- const file2 = chunkFiles[i];
123491
- const rawChunkId = file2.substring(name2.length + 1);
123492
- const chunkId = tag ? rawChunkId.replace(`.${tag}`, "") : rawChunkId;
123493
- deliveredChunkIds.add(chunkId);
123494
- }
123495
123618
  let isPolling = false;
123496
123619
  pollInterval = setInterval(async () => {
123497
- if (isPolling)
123620
+ if (isPolling || streamClosed)
123498
123621
  return;
123499
123622
  isPolling = true;
123623
+ isReadingFromDisk = true;
123624
+ let readEveryListedFile = false;
123500
123625
  try {
123501
123626
  const { files: currentFiles, extMap: currentExtMap } = await listChunkFilesForStream(chunksDir, name2, tag);
123502
123627
  for (const file2 of currentFiles) {
123503
- const rawChunkId = file2.substring(name2.length + 1);
123504
- const chunkId = tag ? rawChunkId.replace(`.${tag}`, "") : rawChunkId;
123505
- if (deliveredChunkIds.has(chunkId))
123506
- continue;
123507
- deliveredChunkIds.add(chunkId);
123508
- const ext2 = currentExtMap.get(file2) ?? ".bin";
123509
- const chunk = deserializeChunk(await readBuffer(path$3.join(chunksDir, `${file2}${ext2}`)));
123510
- if ((chunk == null ? void 0 : chunk.eof) === true) {
123511
- streamClosed = true;
123512
- if (pollInterval) {
123513
- clearInterval(pollInterval);
123514
- pollInterval = null;
123515
- }
123516
- streamEmitter.off(`chunk:${name2}`, chunkListener);
123517
- streamEmitter.off(`close:${name2}`, closeListener);
123518
- try {
123519
- controller.close();
123520
- } catch {
123521
- }
123628
+ if (await deliverFile(file2, currentExtMap.get(file2) ?? ".bin")) {
123629
+ finishDiskRead();
123630
+ closeStream();
123522
123631
  return;
123523
123632
  }
123524
123633
  if (streamClosed)
123525
123634
  return;
123526
- if (chunk.chunk.byteLength) {
123527
- controller.enqueue(Uint8Array.from(chunk.chunk));
123528
- }
123529
123635
  }
123636
+ readEveryListedFile = true;
123530
123637
  } catch (err) {
123531
123638
  if (!(err instanceof Error && "code" in err)) {
123532
123639
  console.error("[world-local] Unexpected polling error:", err);
123533
123640
  }
123534
123641
  } finally {
123535
123642
  isPolling = false;
123643
+ if (readEveryListedFile && !streamClosed)
123644
+ finishDiskRead();
123536
123645
  }
123537
123646
  }, 100);
123538
123647
  },
@@ -123610,7 +123719,7 @@ function createLocalWorld(args) {
123610
123719
  const basedir = mergedConfig.dataDir;
123611
123720
  const hooksDir = path$3.join(basedir, "hooks");
123612
123721
  const taggedHookFiles = await listTaggedFiles(hooksDir, tag);
123613
- const { HookSchema: HookSchema2 } = await import("./index-C1by_z-e.js");
123722
+ const { HookSchema: HookSchema2 } = await import("./index-DSSbZLUP.js");
123614
123723
  await Promise.all(taggedHookFiles.map(async (hookFile) => {
123615
123724
  const hook = await readJSON(path$3.join(hooksDir, hookFile), HookSchema2);
123616
123725
  if (hook == null ? void 0 : hook.token) {
@@ -124137,8 +124246,8 @@ function requireGetVercelOidcToken() {
124137
124246
  }
124138
124247
  try {
124139
124248
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
124140
- await import("./token-util-BrBJCxub.js").then((n) => n.t),
124141
- await import("./token-CP9u68ZL.js").then((n) => n.t)
124249
+ await import("./token-util-CqAM_3Fj.js").then((n) => n.t),
124250
+ await import("./token-CYktKmaH.js").then((n) => n.t)
124142
124251
  ]);
124143
124252
  if (!token || isExpired(getTokenPayload(token), options == null ? void 0 : options.expirationBufferMs)) {
124144
124253
  await refreshToken(options);
@@ -136834,7 +136943,7 @@ createQueueHandler(stepPrefix, async (message_, metadata) => {
136834
136943
  getSpanKind$2("CONSUMER")
136835
136944
  ]);
136836
136945
  return trace$2(`STEP ${stepName}`, { kind: spanKind, links: spanLinks }, async (span) => {
136837
- var _a3, _b2, _c, _d, _e2, _f;
136946
+ var _a3, _b2, _c, _d, _e2, _f, _g;
136838
136947
  span == null ? void 0 : span.setAttributes({
136839
136948
  ...StepName(stepName),
136840
136949
  ...StepAttempt(metadata.attempt),
@@ -136954,9 +137063,9 @@ createQueueHandler(stepPrefix, async (message_, metadata) => {
136954
137063
  stepName,
136955
137064
  message: stepFailErr.message
136956
137065
  });
136957
- return;
137066
+ } else {
137067
+ throw stepFailErr;
136958
137068
  }
136959
- throw stepFailErr;
136960
137069
  }
136961
137070
  span == null ? void 0 : span.setAttributes({
136962
137071
  ...StepStatus("failed"),
@@ -137001,9 +137110,9 @@ createQueueHandler(stepPrefix, async (message_, metadata) => {
137001
137110
  stepName,
137002
137111
  message: err.message
137003
137112
  });
137004
- return;
137113
+ } else {
137114
+ throw err;
137005
137115
  }
137006
- throw err;
137007
137116
  }
137008
137117
  span == null ? void 0 : span.setAttributes({
137009
137118
  ...StepStatus("failed"),
@@ -137036,10 +137145,9 @@ createQueueHandler(stepPrefix, async (message_, metadata) => {
137036
137145
  }
137037
137146
  }, { requestId });
137038
137147
  } catch (failErr) {
137039
- if (EntityConflictError.is(failErr)) {
137040
- return;
137148
+ if (!EntityConflictError.is(failErr)) {
137149
+ throw failErr;
137041
137150
  }
137042
- throw failErr;
137043
137151
  }
137044
137152
  await queueMessage(world, getWorkflowQueueName(workflowName, stepNamespace), {
137045
137153
  runId: workflowRunId,
@@ -137156,9 +137264,9 @@ createQueueHandler(stepPrefix, async (message_, metadata) => {
137156
137264
  stepName,
137157
137265
  message: stepFailErr.message
137158
137266
  });
137159
- return;
137267
+ } else {
137268
+ throw stepFailErr;
137160
137269
  }
137161
- throw stepFailErr;
137162
137270
  }
137163
137271
  span == null ? void 0 : span.setAttributes({
137164
137272
  ...StepStatus("failed"),
@@ -137200,9 +137308,9 @@ createQueueHandler(stepPrefix, async (message_, metadata) => {
137200
137308
  stepName,
137201
137309
  message: stepFailErr.message
137202
137310
  });
137203
- return;
137311
+ } else {
137312
+ throw stepFailErr;
137204
137313
  }
137205
- throw stepFailErr;
137206
137314
  }
137207
137315
  span == null ? void 0 : span.setAttributes({
137208
137316
  ...StepStatus("failed"),
@@ -137316,12 +137424,21 @@ createQueueHandler(stepPrefix, async (message_, metadata) => {
137316
137424
  serializeTraceCarrier()
137317
137425
  ]);
137318
137426
  if (stepCompleted409) {
137319
- return;
137427
+ span == null ? void 0 : span.setAttributes({
137428
+ ...StepSkipped(true),
137429
+ ...StepSkipReason("completed")
137430
+ });
137431
+ (_g = span == null ? void 0 : span.addEvent) == null ? void 0 : _g.call(span, "step.skipped", {
137432
+ "skip.reason": "terminal_state",
137433
+ "step.name": stepName,
137434
+ "step.id": stepId
137435
+ });
137436
+ } else {
137437
+ span == null ? void 0 : span.setAttributes({
137438
+ ...StepStatus("completed"),
137439
+ ...StepResultType(typeof result)
137440
+ });
137320
137441
  }
137321
- span == null ? void 0 : span.setAttributes({
137322
- ...StepStatus("completed"),
137323
- ...StepResultType(typeof result)
137324
- });
137325
137442
  await queueMessage(world, getWorkflowQueueName(workflowName, stepNamespace), {
137326
137443
  runId: workflowRunId,
137327
137444
  traceCarrier,
@@ -157921,8 +158038,12 @@ function sanitizeForDisplay(value, depth = 0) {
157921
158038
  }
157922
158039
  const yieldToMain = () => new Promise((resolve2) => setTimeout(resolve2, 0));
157923
158040
  const YIELD_EVERY_N_FRAMES = 64;
157924
- function detectEncoding(data) {
158041
+ function detectEncoding(data, streamId) {
157925
158042
  if (data.length < FRAME_HEADER_SIZE) return "framed";
158043
+ const prefix = new TextDecoder().decode(data.subarray(0, FRAME_HEADER_SIZE));
158044
+ if (streamId.endsWith("_system_abort") && Object.values(SerializationFormat$1).some((format2) => format2 === prefix)) {
158045
+ return "unframed";
158046
+ }
157926
158047
  const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
157927
158048
  const len = view.getUint32(0, false);
157928
158049
  if (len > 0 && len <= 10 * 1024 * 1024) return "framed";
@@ -158041,7 +158162,14 @@ function useStreamReader(env2, streamId, runId, encryptionKey, runStatus) {
158041
158162
  if (abortController.signal.aborted) break;
158042
158163
  const { value, done } = await reader.read();
158043
158164
  if (done) {
158044
- if (encoding2 === "legacy" && textRemainder.trim()) {
158165
+ if (encoding2 === "unframed" && buffer2.length > 0) {
158166
+ frameIndex++;
158167
+ if (frameIndex > skipFrames) {
158168
+ const result = await processFrame(buffer2, cryptoKey, revivers);
158169
+ if (result.encrypted) return { encrypted: true };
158170
+ targetBuffer.push(result.chunk);
158171
+ }
158172
+ } else if (encoding2 === "legacy" && textRemainder.trim()) {
158045
158173
  frameIndex++;
158046
158174
  if (frameIndex > skipFrames) {
158047
158175
  targetBuffer.push(parseLegacyLine(textRemainder.trim()));
@@ -158053,7 +158181,7 @@ function useStreamReader(env2, streamId, runId, encryptionKey, runStatus) {
158053
158181
  if (encoding2 === null) {
158054
158182
  appendToBuffer(value);
158055
158183
  if (buffer2.length >= FRAME_HEADER_SIZE) {
158056
- encoding2 = detectEncoding(buffer2);
158184
+ encoding2 = detectEncoding(buffer2, streamId);
158057
158185
  }
158058
158186
  if (encoding2 === "legacy") {
158059
158187
  textRemainder = decoder2.decode(buffer2, { stream: true });
@@ -158078,6 +158206,7 @@ function useStreamReader(env2, streamId, runId, encryptionKey, runStatus) {
158078
158206
  }
158079
158207
  continue;
158080
158208
  }
158209
+ if (encoding2 === "unframed") continue;
158081
158210
  let offset2 = 0;
158082
158211
  let framesInBatch = 0;
158083
158212
  while (offset2 + FRAME_HEADER_SIZE <= buffer2.length) {
@@ -159084,7 +159213,7 @@ const route4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
159084
159213
  __proto__: null,
159085
159214
  loader
159086
159215
  }, Symbol.toStringTag, { value: "Module" }));
159087
- const serverManifest = { "entry": { "module": "/assets/entry.client-C7XgFTHI.js", "imports": ["/assets/index-BQ-Xa8kF.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-DQQlQnXn.js", "imports": ["/assets/index-BQ-Xa8kF.js", "/assets/mermaid-3ZIDBTTL-DV4S4pTo.js"], "css": ["/assets/root-BOS11TzD.css", "/assets/mermaid-3ZIDBTTL-yyHEMZs4.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-Yy5gk_jJ.js", "imports": ["/assets/index-BQ-Xa8kF.js", "/assets/workflow-graph-viewer-De_-9tJh.js", "/assets/mermaid-3ZIDBTTL-DV4S4pTo.js", "/assets/index-CXBr7N7m.js"], "css": ["/assets/workflow-graph-viewer-yls6qlc0.css", "/assets/mermaid-3ZIDBTTL-yyHEMZs4.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-rocfw9Z5.js", "imports": ["/assets/index-BQ-Xa8kF.js", "/assets/workflow-graph-viewer-De_-9tJh.js", "/assets/mermaid-3ZIDBTTL-DV4S4pTo.js", "/assets/encryption-Cu4jq70Y.js", "/assets/index-CXBr7N7m.js"], "css": ["/assets/workflow-graph-viewer-yls6qlc0.css", "/assets/mermaid-3ZIDBTTL-yyHEMZs4.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-e13ef35a.js", "version": "e13ef35a", "sri": void 0 };
159216
+ const serverManifest = { "entry": { "module": "/assets/entry.client-C7XgFTHI.js", "imports": ["/assets/index-BQ-Xa8kF.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-DpF6w_fA.js", "imports": ["/assets/index-BQ-Xa8kF.js", "/assets/mermaid-3ZIDBTTL-Q2_PQwJo.js"], "css": ["/assets/root-BOS11TzD.css", "/assets/mermaid-3ZIDBTTL-yyHEMZs4.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-BaDfLHa9.js", "imports": ["/assets/index-BQ-Xa8kF.js", "/assets/workflow-graph-viewer-CazJ_HP0.js", "/assets/mermaid-3ZIDBTTL-Q2_PQwJo.js", "/assets/index-CXBr7N7m.js"], "css": ["/assets/workflow-graph-viewer-yls6qlc0.css", "/assets/mermaid-3ZIDBTTL-yyHEMZs4.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-BP7Q8-uY.js", "imports": ["/assets/index-BQ-Xa8kF.js", "/assets/workflow-graph-viewer-CazJ_HP0.js", "/assets/mermaid-3ZIDBTTL-Q2_PQwJo.js", "/assets/encryption-Cu4jq70Y.js", "/assets/index-CXBr7N7m.js"], "css": ["/assets/workflow-graph-viewer-yls6qlc0.css", "/assets/mermaid-3ZIDBTTL-yyHEMZs4.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-830ddfa8.js", "version": "830ddfa8", "sri": void 0 };
159088
159217
  const assetsBuildDirectory = "build/client";
159089
159218
  const basename = "/";
159090
159219
  const future = { "unstable_optimizeDeps": false, "v8_passThroughRequests": false, "v8_trailingSlashAwareDataRequests": false, "unstable_previewServerPrerendering": false, "v8_middleware": false, "v8_splitRouteModules": false, "v8_viteEnvironmentApi": false };
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { g as getDefaultExportFromCjs } from "./app-juehGONX.js";
6
- import { a6 as requireTokenError, a5 as requireTokenUtil } from "./server-build-CgjoLYPd.js";
5
+ import { g as getDefaultExportFromCjs } from "./app-Z_Os_Okl.js";
6
+ import { a6 as requireTokenError, a5 as requireTokenUtil } from "./server-build-Blw7jSyo.js";
7
7
  function _mergeNamespaces(n, m) {
8
8
  for (var i = 0; i < m.length; i++) {
9
9
  const e = m[i];
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { g as getDefaultExportFromCjs } from "./app-juehGONX.js";
6
- import { a5 as requireTokenUtil } from "./server-build-CgjoLYPd.js";
5
+ import { g as getDefaultExportFromCjs } from "./app-Z_Os_Okl.js";
6
+ import { a5 as requireTokenUtil } from "./server-build-Blw7jSyo.js";
7
7
  function _mergeNamespaces(n, m) {
8
8
  for (var i = 0; i < m.length; i++) {
9
9
  const e = m[i];
@@ -2,7 +2,7 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof globalThis.require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { o } from "./assets/app-juehGONX.js";
5
+ import { o } from "./assets/app-Z_Os_Okl.js";
6
6
  import "express";
7
7
  import "stream";
8
8
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@workflow/web",
3
3
  "description": "Workflow Observability UI",
4
- "version": "4.1.30",
4
+ "version": "4.1.32",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "files": [
@@ -71,10 +71,10 @@
71
71
  "vite": "^6",
72
72
  "vitest": "^3",
73
73
  "jsdom": "^26",
74
- "@workflow/core": "4.8.14",
74
+ "@workflow/core": "4.8.16",
75
75
  "@workflow/errors": "4.2.2",
76
76
  "@workflow/utils": "4.1.4",
77
- "@workflow/web-shared": "4.1.30",
77
+ "@workflow/web-shared": "4.1.32",
78
78
  "@workflow/world": "4.5.1",
79
79
  "@workflow/world-vercel": "4.7.8"
80
80
  },