@workflow/web 5.0.0-beta.57 → 5.0.0-beta.58

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 (27) hide show
  1. package/build/client/assets/{arrow-up-right-XpJjI06G.js → arrow-up-right-jHPcOZmb.js} +1 -1
  2. package/build/client/assets/{highlighted-body-B3W2YXNL-DA3N01jE.js → highlighted-body-B3W2YXNL-CBBI0JQ-.js} +1 -1
  3. package/build/client/assets/{home-CLktiGIz.js → home-BcIEUw9E.js} +33 -12
  4. package/build/client/assets/{loader-circle-Cj8CH5bR.js → loader-circle-HeezuKOU.js} +1 -1
  5. package/build/client/assets/{manifest-3ffb4984.js → manifest-a541ae9e.js} +1 -1
  6. package/build/client/assets/{mermaid-3ZIDBTTL-DG0Grjgm.js → mermaid-3ZIDBTTL-ClcCzUqi.js} +62 -8
  7. package/build/client/assets/{root-3gE7cfR2.js → root-DLS5V7HU.js} +3 -3
  8. package/build/client/assets/{run-detail-gOfjBB1S.js → run-detail-DWoMKBqC.js} +37 -11
  9. package/build/client/assets/{workflow-graph-viewer-Cg3Lr_h8.js → workflow-graph-viewer-syfKq6DB.js} +29 -9
  10. package/build/client/assets/{zstd-browser-decoder-CEJ92wdJ.js → zstd-browser-decoder-D2p6f8lN.js} +1 -1
  11. package/build/server/assets/{app-CLgyAdH3.js → app-CEqDw6uM.js} +24156 -13446
  12. package/build/server/assets/{highlighted-body-B3W2YXNL-B8wbEqnx.js → highlighted-body-B3W2YXNL-C2u3JoU4.js} +7 -2
  13. package/build/server/assets/{index-qorbufop.js → index-BG8LHWgA.js} +8 -3
  14. package/build/server/assets/{index-CD3sqsfS.js → index-BrFZB5-R.js} +1 -1
  15. package/build/server/assets/{mermaid-3ZIDBTTL-CDOlxgin.js → mermaid-3ZIDBTTL-BZ2gmvHb.js} +7 -2
  16. package/build/server/assets/{token-BfBe4cAY.js → token-KvMwAySl.js} +1 -1
  17. package/build/server/assets/{token-util-CYhmjL6g.js → token-util-DGBKzRwD.js} +1 -1
  18. package/build/server/assets/{wrapper-CUYQE5_Q.js → wrapper-CBRVXtq2.js} +12 -14
  19. package/build/server/assets/{zstd-browser-decoder-CIXVj9sh.js → zstd-browser-decoder-BxTIaNvq.js} +7 -2
  20. package/build/server/index.js +8 -4
  21. package/handler.js +13 -96
  22. package/package.json +9 -10
  23. package/server.d.ts +5 -1
  24. package/server.js +32 -39
  25. package/static.js +86 -0
  26. package/build/server/assets/websocket-server-DB4GPS66.js +0 -3669
  27. package/build/server/assets/ws-transport-xTHJJcp4.js +0 -551
@@ -1,4 +1,4 @@
1
- import { c as createLucideIcon } from "./mermaid-3ZIDBTTL-DG0Grjgm.js";
1
+ import { c as createLucideIcon } from "./mermaid-3ZIDBTTL-ClcCzUqi.js";
2
2
  /**
3
3
  * @license lucide-react v0.575.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import { R, K as Ks, Q as Qe } from "./mermaid-3ZIDBTTL-DG0Grjgm.js";
1
+ import { R, K as Ks, Q as Qe } from "./mermaid-3ZIDBTTL-ClcCzUqi.js";
2
2
  import { r as reactExports, j as jsxRuntimeExports } from "./index-thGVuYbY.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,7 +1,7 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports, z as Link, R as ReactExports, f as reactDomExports, B as useSearchParams, A as useNavigate, C as useLocation, w as withComponentProps } from "./index-thGVuYbY.js";
2
- import { R as ResolveHookModal, S as Send, r as requireShim, u as unwrapOrThrow, W as WorkflowWebAPIError, f as fetchHookToken, a as Skeleton, b as RelativeTime, A as Alert, C as CircleAlert, c as AlertTitle, g as getErrorTitle, d as AlertDescription, e as getErrorMessage, h as CopyableText, D as DropdownMenu, i as DropdownMenuTrigger, E as Ellipsis, j as DropdownMenuContent, k as DropdownMenuItem, l as resumeHook, m as createCollection, n as hideOthers, o as ReactRemoveScroll, p as useDirection, q as ChevronUp, 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 bulkCancelRuns, 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-Cg3Lr_h8.js";
3
- import { c as createLucideIcon, h as useToast, e as cn, i as fetchRuns, j as fetchHooks, k as getPaginationDisplay, T as Tooltip, a as TooltipTrigger, C as Check, l as Copy, b as TooltipContent, D as DEFAULT_PAGE_SIZE, B as Button, m as ChevronRight, n as fetchEvents, o as useCallbackRef, p as useComposedRefs, P as Primitive, A as Anchor, q as composeEventHandlers, s as useLayoutEffect2, v as Portal$2, w as useId, x as createPopperScope, y as DismissableLayer, z as createContextScope, E as createSlot, F as Content$1, G as useControllableState, H as Root2$1, V as VISUALLY_HIDDEN_STYLES, I as Arrow, J as ChevronDown, L as useComposedRefs$1, u as useServerConfig, M as BULK_CANCEL_MAX_RUN_IDS, t as toast, N as fetchRun, O as cva, U as Presence$1, W as createContext2, X as fetchWorkflowsManifest } from "./mermaid-3ZIDBTTL-DG0Grjgm.js";
4
- import { L as LoaderCircle } from "./loader-circle-Cj8CH5bR.js";
2
+ import { R as ResolveHookModal, S as Send, r as requireShim, u as unwrapOrThrow, W as WorkflowWebAPIError, f as fetchHookToken, a as Skeleton, b as RelativeTime, A as Alert, C as CircleAlert, c as AlertTitle, g as getErrorTitle, d as AlertDescription, e as getErrorMessage, h as CopyableText, D as DropdownMenu, i as DropdownMenuTrigger, E as Ellipsis, j as DropdownMenuContent, k as DropdownMenuItem, l as resumeHook, m as createCollection, n as hideOthers, o as ReactRemoveScroll, p as useDirection, q as ChevronUp, 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 bulkCancelRuns, 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-syfKq6DB.js";
3
+ import { c as createLucideIcon, h as useToast, e as cn, i as fetchRuns, j as fetchHooks, k as getPaginationDisplay, T as Tooltip, a as TooltipTrigger, C as Check, l as Copy, b as TooltipContent, D as DEFAULT_PAGE_SIZE, B as Button, m as ChevronRight, n as fetchEvents, o as useCallbackRef, p as useComposedRefs, P as Primitive, A as Anchor, q as composeEventHandlers, s as useLayoutEffect2, v as Portal$2, w as useId, x as createPopperScope, y as DismissableLayer, z as createContextScope, E as createSlot, F as Content$1, G as useControllableState, H as Root2$1, V as VISUALLY_HIDDEN_STYLES, I as Arrow, J as ChevronDown, L as useComposedRefs$1, u as useServerConfig, M as BULK_CANCEL_MAX_RUN_IDS, t as toast, N as fetchRun, O as cva, U as Presence$1, W as createContext2, X as fetchWorkflowsManifest } from "./mermaid-3ZIDBTTL-ClcCzUqi.js";
4
+ import { L as LoaderCircle } from "./loader-circle-HeezuKOU.js";
5
5
  /**
6
6
  * @license lucide-react v0.575.0 - ISC
7
7
  *
@@ -3764,6 +3764,19 @@ function useTableSelection({
3764
3764
  ]
3765
3765
  );
3766
3766
  }
3767
+ function getRunReplayDisabledReason(run, runIdentityLoading) {
3768
+ var _a;
3769
+ if (runIdentityLoading) {
3770
+ return "Loading run identity...";
3771
+ }
3772
+ if (!run) {
3773
+ return "Unable to verify whether this run can be replayed.";
3774
+ }
3775
+ if ((_a = run.executionContext) == null ? void 0 : _a.dynamicWorkflow) {
3776
+ return "Dynamic runs cannot be replayed as a new run.";
3777
+ }
3778
+ return void 0;
3779
+ }
3767
3780
  function SelectionBar({
3768
3781
  selectionCount,
3769
3782
  onClearSelection,
@@ -4010,25 +4023,32 @@ function RunActionsDropdownContentInner({
4010
4023
  onSuccess
4011
4024
  }) {
4012
4025
  const [events, setEvents] = reactExports.useState(void 0);
4013
- const [isLoading, setIsLoading] = reactExports.useState(true);
4026
+ const [eventsLoading, setEventsLoading] = reactExports.useState(true);
4014
4027
  const [run, setRun] = reactExports.useState(void 0);
4028
+ const [runIdentityLoading, setRunIdentityLoading] = reactExports.useState(true);
4015
4029
  const status = (run == null ? void 0 : run.status) || runStatus;
4016
4030
  reactExports.useEffect(() => {
4017
- setIsLoading(true);
4018
- Promise.all([
4019
- fetchRun(env, runId, "none"),
4020
- fetchEvents(env, runId, { limit: 1e3, sortOrder: "desc" })
4021
- ]).then(([runResult, eventsResult]) => {
4031
+ setRun(void 0);
4032
+ setRunIdentityLoading(true);
4033
+ fetchRun(env, runId, "none").then((runResult) => {
4022
4034
  if (runResult.success) {
4023
4035
  setRun(runResult.data);
4024
4036
  }
4037
+ }).catch((err) => {
4038
+ console.error("Failed to fetch run:", err);
4039
+ }).finally(() => {
4040
+ setRunIdentityLoading(false);
4041
+ });
4042
+ setEvents(void 0);
4043
+ setEventsLoading(true);
4044
+ fetchEvents(env, runId, { limit: 1e3, sortOrder: "desc" }).then((eventsResult) => {
4025
4045
  if (eventsResult.success) {
4026
4046
  setEvents(eventsResult.data.data);
4027
4047
  }
4028
4048
  }).catch((err) => {
4029
- console.error("Failed to fetch run or events:", err);
4049
+ console.error("Failed to fetch events:", err);
4030
4050
  }).finally(() => {
4031
- setIsLoading(false);
4051
+ setEventsLoading(false);
4032
4052
  });
4033
4053
  }, [env, runId]);
4034
4054
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -4038,7 +4058,8 @@ function RunActionsDropdownContentInner({
4038
4058
  runId,
4039
4059
  runStatus: status,
4040
4060
  events,
4041
- eventsLoading: isLoading,
4061
+ eventsLoading,
4062
+ replayDisabledReason: getRunReplayDisabledReason(run, runIdentityLoading),
4042
4063
  stopPropagation: true,
4043
4064
  callbacks: { onSuccess }
4044
4065
  }
@@ -1,4 +1,4 @@
1
- import { c as createLucideIcon } from "./mermaid-3ZIDBTTL-DG0Grjgm.js";
1
+ import { c as createLucideIcon } from "./mermaid-3ZIDBTTL-ClcCzUqi.js";
2
2
  /**
3
3
  * @license lucide-react v0.575.0 - ISC
4
4
  *
@@ -1 +1 @@
1
- window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-DmlDFlyx.js","imports":["/assets/index-thGVuYbY.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root-3gE7cfR2.js","imports":["/assets/index-thGVuYbY.js","/assets/mermaid-3ZIDBTTL-DG0Grjgm.js","/assets/loader-circle-Cj8CH5bR.js","/assets/arrow-up-right-XpJjI06G.js"],"css":["/assets/root-grl25rxS.css","/assets/mermaid-3ZIDBTTL-D8CjRQta.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-CLktiGIz.js","imports":["/assets/index-thGVuYbY.js","/assets/workflow-graph-viewer-Cg3Lr_h8.js","/assets/mermaid-3ZIDBTTL-DG0Grjgm.js","/assets/loader-circle-Cj8CH5bR.js"],"css":["/assets/workflow-graph-viewer-DnlNuQQH.css","/assets/mermaid-3ZIDBTTL-D8CjRQta.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-gOfjBB1S.js","imports":["/assets/index-thGVuYbY.js","/assets/workflow-graph-viewer-Cg3Lr_h8.js","/assets/mermaid-3ZIDBTTL-DG0Grjgm.js","/assets/arrow-up-right-XpJjI06G.js"],"css":["/assets/run-detail-CWoGxu_0.css","/assets/workflow-graph-viewer-DnlNuQQH.css","/assets/mermaid-3ZIDBTTL-D8CjRQta.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-3ffb4984.js","version":"3ffb4984"};
1
+ window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-DmlDFlyx.js","imports":["/assets/index-thGVuYbY.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root-DLS5V7HU.js","imports":["/assets/index-thGVuYbY.js","/assets/mermaid-3ZIDBTTL-ClcCzUqi.js","/assets/loader-circle-HeezuKOU.js","/assets/arrow-up-right-jHPcOZmb.js"],"css":["/assets/root-grl25rxS.css","/assets/mermaid-3ZIDBTTL-D8CjRQta.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-BcIEUw9E.js","imports":["/assets/index-thGVuYbY.js","/assets/workflow-graph-viewer-syfKq6DB.js","/assets/mermaid-3ZIDBTTL-ClcCzUqi.js","/assets/loader-circle-HeezuKOU.js"],"css":["/assets/workflow-graph-viewer-DnlNuQQH.css","/assets/mermaid-3ZIDBTTL-D8CjRQta.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-DWoMKBqC.js","imports":["/assets/index-thGVuYbY.js","/assets/workflow-graph-viewer-syfKq6DB.js","/assets/mermaid-3ZIDBTTL-ClcCzUqi.js","/assets/arrow-up-right-jHPcOZmb.js"],"css":["/assets/run-detail-CWoGxu_0.css","/assets/workflow-graph-viewer-DnlNuQQH.css","/assets/mermaid-3ZIDBTTL-D8CjRQta.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-a541ae9e.js","version":"a541ae9e"};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/zstd-browser-decoder-CEJ92wdJ.js","assets/index-thGVuYbY.js","assets/highlighted-body-B3W2YXNL-DA3N01jE.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/zstd-browser-decoder-D2p6f8lN.js","assets/index-thGVuYbY.js","assets/highlighted-body-B3W2YXNL-CBBI0JQ-.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);
@@ -15000,6 +15000,17 @@ const RunCreatedEventSchema = compile(BaseEventSchema.extend({
15000
15000
  executionContext: record(string$2(), any()).optional(),
15001
15001
  attributes: record(string$2(), string$2()).optional(),
15002
15002
  allowReservedAttributes: literal(true).optional(),
15003
+ /**
15004
+ * A dynamic run's serialized workflow VM code. The World materializes it
15005
+ * onto the run record and does not keep a second copy on the event.
15006
+ * Mutually exclusive with `dynamicWorkflowCodeRef`.
15007
+ */
15008
+ dynamicWorkflowCode: SerializedDataSchema.optional(),
15009
+ /**
15010
+ * Ref for dynamic workflow code uploaded before this write. Worlds must
15011
+ * validate it against the caller and run before attaching it.
15012
+ */
15013
+ dynamicWorkflowCodeRef: string$2().optional(),
15003
15014
  /**
15004
15015
  * The run's X25519 public key (base64), stamped by SDKs that support
15005
15016
  * sealed (`encp`) envelopes. Persisted onto the run entity so that
@@ -15007,6 +15018,9 @@ const RunCreatedEventSchema = compile(BaseEventSchema.extend({
15007
15018
  * symmetric key. Not secret. See `WorkflowRunBaseSchema`.
15008
15019
  */
15009
15020
  encryptionPublicKey: string$2().optional()
15021
+ }).refine((value) => value.dynamicWorkflowCode === void 0 || value.dynamicWorkflowCodeRef === void 0, {
15022
+ path: ["dynamicWorkflowCodeRef"],
15023
+ message: "dynamicWorkflowCode and dynamicWorkflowCodeRef are mutually exclusive"
15010
15024
  })
15011
15025
  }));
15012
15026
  const RunStartedEventSchema = compile(BaseEventSchema.extend({
@@ -15024,7 +15038,13 @@ const RunStartedEventSchema = compile(BaseEventSchema.extend({
15024
15038
  * server creates the run from this event instead, and without the key
15025
15039
  * the run would silently lose its ability to receive sealed writes.
15026
15040
  */
15027
- encryptionPublicKey: string$2().optional()
15041
+ encryptionPublicKey: string$2().optional(),
15042
+ /** Dynamic code carried for resilient run creation. */
15043
+ dynamicWorkflowCode: SerializedDataSchema.optional(),
15044
+ dynamicWorkflowCodeRef: string$2().optional()
15045
+ }).refine((value) => value.dynamicWorkflowCode === void 0 || value.dynamicWorkflowCodeRef === void 0, {
15046
+ path: ["dynamicWorkflowCodeRef"],
15047
+ message: "dynamicWorkflowCode and dynamicWorkflowCodeRef are mutually exclusive"
15028
15048
  }).optional()
15029
15049
  }));
15030
15050
  const RunCompletedEventSchema = compile(BaseEventSchema.extend({
@@ -15154,6 +15174,13 @@ const WorkflowRunBaseSchema = compile(object({
15154
15174
  executionContext: record(string$2(), any()).optional(),
15155
15175
  input: SerializedDataSchema.optional(),
15156
15176
  output: SerializedDataSchema.optional(),
15177
+ /**
15178
+ * A dynamic run's workflow VM code, serialized through the run-payload
15179
+ * pipeline. Compression is conditional on protocol support and benefit;
15180
+ * encryption is conditional on the World supplying run key material.
15181
+ * Replay reads this opaque payload from the run rather than creation events.
15182
+ */
15183
+ dynamicWorkflowCode: SerializedDataSchema.optional(),
15157
15184
  /**
15158
15185
  * The thrown value from a run_failed event, serialized via the workflow
15159
15186
  * serialization pipeline. To display the error to a user, hydrate it via
@@ -15452,6 +15479,10 @@ const RunInputSchema = compile(object({
15452
15479
  workflowName: string$2(),
15453
15480
  specVersion: number$3(),
15454
15481
  executionContext: record(string$2(), any()).optional(),
15482
+ /** Dynamic workflow code carried for resilient run creation. */
15483
+ dynamicWorkflowCode: SerializedDataSchema.optional(),
15484
+ /** Ref for deferred dynamic workflow code; mutually exclusive with bytes. */
15485
+ dynamicWorkflowCodeRef: string$2().optional(),
15455
15486
  /** Initial plaintext run attributes, for resilient run creation. */
15456
15487
  attributes: record(string$2(), string$2()).optional(),
15457
15488
  /**
@@ -15480,6 +15511,9 @@ const RunInputSchema = compile(object({
15480
15511
  * when it is missing.
15481
15512
  */
15482
15513
  environment: string$2().optional()
15514
+ }).refine((value) => value.dynamicWorkflowCode === void 0 || value.dynamicWorkflowCodeRef === void 0, {
15515
+ path: ["dynamicWorkflowCodeRef"],
15516
+ message: "dynamicWorkflowCode and dynamicWorkflowCodeRef are mutually exclusive"
15483
15517
  }));
15484
15518
  const StepDispatchInputSchema = compile(object({
15485
15519
  /**
@@ -20395,6 +20429,7 @@ function hydrateWorkflowIO(resource, revivers) {
20395
20429
  let hydratedInput = resource.input;
20396
20430
  let hydratedOutput = resource.output;
20397
20431
  let hydratedError = resource.error;
20432
+ let hydratedDynamicWorkflowCode = resource.dynamicWorkflowCode;
20398
20433
  if (resource.input != null) {
20399
20434
  try {
20400
20435
  hydratedInput = hydrateData(resource.input, revivers);
@@ -20413,11 +20448,18 @@ function hydrateWorkflowIO(resource, revivers) {
20413
20448
  } catch {
20414
20449
  }
20415
20450
  }
20451
+ if (resource.dynamicWorkflowCode != null) {
20452
+ try {
20453
+ hydratedDynamicWorkflowCode = hydrateData(resource.dynamicWorkflowCode, revivers);
20454
+ } catch {
20455
+ }
20456
+ }
20416
20457
  return {
20417
20458
  ...resource,
20418
20459
  input: hydratedInput,
20419
20460
  output: hydratedOutput,
20420
- error: hydratedError
20461
+ error: hydratedError,
20462
+ ...resource.dynamicWorkflowCode != null ? { dynamicWorkflowCode: hydratedDynamicWorkflowCode } : {}
20421
20463
  };
20422
20464
  }
20423
20465
  function hydrateEventData(resource, revivers) {
@@ -20536,6 +20578,11 @@ function getWebRevivers() {
20536
20578
  BigInt: (value) => BigInt(value),
20537
20579
  BigInt64Array: (value) => new BigInt64Array(reviveArrayBuffer(value)),
20538
20580
  BigUint64Array: (value) => new BigUint64Array(reviveArrayBuffer(value)),
20581
+ // Deliberately not registered under `DataView`: payloads written before
20582
+ // core gained this reducer use devalue's built-in encoding, and a custom
20583
+ // reviver for that tag would strip their bounds and render the whole
20584
+ // backing buffer. See `serialization/reducers/common.ts` in core.
20585
+ DataViewBytes: (value) => new DataView(reviveArrayBuffer(value)),
20539
20586
  Date: (value) => new Date(value),
20540
20587
  // Error family. The reducer side (see
20541
20588
  // `packages/core/src/serialization/reducers/common.ts`) emits a tagged
@@ -20774,12 +20821,19 @@ function toDisplayMarker(value) {
20774
20821
  return createExpiredMarker();
20775
20822
  return value;
20776
20823
  }
20824
+ const TOP_LEVEL_SERIALIZED_FIELDS = [
20825
+ "input",
20826
+ "output",
20827
+ "metadata",
20828
+ "error",
20829
+ "dynamicWorkflowCode"
20830
+ ];
20777
20831
  function replaceEncryptedAndExpiredWithMarkers(resource) {
20778
20832
  if (!resource || typeof resource !== "object")
20779
20833
  return resource;
20780
20834
  const r2 = resource;
20781
20835
  const result = { ...r2 };
20782
- for (const key of ["input", "output", "metadata", "error"]) {
20836
+ for (const key of TOP_LEVEL_SERIALIZED_FIELDS) {
20783
20837
  result[key] = toDisplayMarker(result[key]);
20784
20838
  }
20785
20839
  if (result.eventData && typeof result.eventData === "object") {
@@ -20801,7 +20855,7 @@ async function hydrateResourceIOAsync(resource, key) {
20801
20855
  return { hydrateDataWithKey: hydrateDataWithKey3, deriveRunPayloadKeys: deriveRunPayloadKeys3 };
20802
20856
  }, true ? void 0 : void 0);
20803
20857
  const { ensureZstdDecoderRegistered } = await __vitePreload(async () => {
20804
- const { ensureZstdDecoderRegistered: ensureZstdDecoderRegistered2 } = await import("./zstd-browser-decoder-CEJ92wdJ.js");
20858
+ const { ensureZstdDecoderRegistered: ensureZstdDecoderRegistered2 } = await import("./zstd-browser-decoder-D2p6f8lN.js");
20805
20859
  return { ensureZstdDecoderRegistered: ensureZstdDecoderRegistered2 };
20806
20860
  }, true ? __vite__mapDeps([0,1]) : void 0);
20807
20861
  ensureZstdDecoderRegistered();
@@ -20819,7 +20873,7 @@ async function hydrateResourceIOAsync(resource, key) {
20819
20873
  }
20820
20874
  const r2 = resource;
20821
20875
  const result = { ...r2 };
20822
- for (const field of ["input", "output", "metadata", "error"]) {
20876
+ for (const field of TOP_LEVEL_SERIALIZED_FIELDS) {
20823
20877
  if (field in result) {
20824
20878
  result[field] = await hydrateField(result[field]);
20825
20879
  }
@@ -20841,7 +20895,7 @@ function hasEncryptedFields(resource) {
20841
20895
  if (!resource || typeof resource !== "object")
20842
20896
  return false;
20843
20897
  const r2 = resource;
20844
- for (const key of ["input", "output", "metadata", "error"]) {
20898
+ for (const key of TOP_LEVEL_SERIALIZED_FIELDS) {
20845
20899
  if (isEncryptedMarker$1(r2[key]))
20846
20900
  return true;
20847
20901
  }
@@ -48467,7 +48521,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
48467
48521
  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 });
48468
48522
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
48469
48523
  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 }) });
48470
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-DA3N01jE.js"), true ? __vite__mapDeps([2,1]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
48524
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-CBBI0JQ-.js"), true ? __vite__mapDeps([2,1]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
48471
48525
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
48472
48526
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
48473
48527
  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 }) })] }) });
@@ -1,7 +1,7 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports, w as withComponentProps, v as withErrorBoundaryProps, M as Meta, L as Links, S as ScrollRestoration, x as Scripts, O as Outlet, y as useRouteError, i as isRouteErrorResponse, z as Link, A as useNavigate, B as useSearchParams } from "./index-thGVuYbY.js";
2
- import { c as createLucideIcon, u as useServerConfig, T as Tooltip, a as TooltipTrigger, b as TooltipContent, d as runHealthCheck, t as toast, B as Button, e as cn, f as Toaster$1, S as ServerConfigProvider, g as TooltipProvider } from "./mermaid-3ZIDBTTL-DG0Grjgm.js";
3
- import { L as LoaderCircle } from "./loader-circle-Cj8CH5bR.js";
4
- import { A as ArrowUpRight } from "./arrow-up-right-XpJjI06G.js";
2
+ import { c as createLucideIcon, u as useServerConfig, T as Tooltip, a as TooltipTrigger, b as TooltipContent, d as runHealthCheck, t as toast, B as Button, e as cn, f as Toaster$1, S as ServerConfigProvider, g as TooltipProvider } from "./mermaid-3ZIDBTTL-ClcCzUqi.js";
3
+ import { L as LoaderCircle } from "./loader-circle-HeezuKOU.js";
4
+ import { A as ArrowUpRight } from "./arrow-up-right-jHPcOZmb.js";
5
5
  var M = (e, i, s, u, m, a, l, h) => {
6
6
  let d = document.documentElement, w = ["light", "dark"];
7
7
  function p(n) {
@@ -1,7 +1,7 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports, f as reactDomExports, D as ReactDOM, A as useNavigate, B as useSearchParams, z as Link, w as withComponentProps, G as useParams } from "./index-thGVuYbY.js";
2
- import { C as CircleAlert, O as parseStepName, B as parseWorkflowName, Q as ErrorCard, U as format, Z as Zap, S as Send, R as ResolveHookModal, q as ChevronUp, X, N as ErrorBoundary, V as Circle, u as unwrapOrThrow, W as WorkflowWebAPIError, I as unwrapServerActionResult, Y as useEscapeKeydown, t as composeEventHandlers, _ as useCallbackRef, $ as useLayoutEffect2, s as useControllableState, a0 as useId, a1 as createContext2, v as Presence, x as createContextScope, n as hideOthers, o as ReactRemoveScroll, a2 as useFocusGuards, a3 as LAYOUT, a4 as wakeUpRun, l as resumeHook, A as Alert, c as AlertTitle, g as getErrorTitle, d as AlertDescription, e as getErrorMessage, a as Skeleton$1, a5 as RunActionsButtons, F as StatusBadge, h as CopyableText, b as RelativeTime, T as Tabs, K as TabsList, L as TabsTrigger, M as TabsContent, a6 as cancelRun, a7 as recreateRun } from "./workflow-graph-viewer-Cg3Lr_h8.js";
3
- import { c as createLucideIcon, Y as classifyEntityEvent, Z as TERMINAL_EVENT_CLASSES, $ as isSealedNoopEvent$1, a0 as cn, a1 as CopyableDataBlock, a2 as CollapsibleRoot, a3 as CollapsibleTrigger, a4 as CollapsibleContent, a5 as CopyButton, O as cva, a6 as RESERVED_ATTRIBUTE_KEY_PREFIX, a7 as Spinner, a8 as TooltipProvider, T as Tooltip, a as TooltipTrigger, b as TooltipContent, a9 as ContextCardProvider, h as useToast, aa as Skeleton, ab as DecryptClickContext, ac as Yr, ad as isEncryptedMarker, ae as getEventDataRefFields, m as ChevronRight, af as TimestampTooltip, ag as formatDuration, C as Check, l as Copy, ah as DataInspector, ai as _r, aj as isHookLifecycleEventType, ak as isTerminalStepEventType, al as isWaitEventType, am as isStepEventType, an as RunClickContext, ao as StreamClickContext, ap as Collapsible, aq as isExpiredMarker, ar as isDoStreamStep, as as extractConversation, at as EncryptedDataBlock, au as hasEncryptedFields, av as useSidebarDataOptional, aw as isTerminalWorkflowRunStatus, ax as clsx, ay as useActiveSpan, az as useSidebarData, aA as IconButton, J as ChevronDown, aB as useRowWindow, aC as isSpanDimmedBySearch, aD as ROW_HEIGHT_PX, aE as getSpanDurationMs, aF as isSpanErrored, aG as isSpanCancelled, aH as formatDurationPrecise, aI as ActiveSpanProvider, aJ as useReducedMotion, aK as searchSpans, aL as computeRootBounds, aM as computeTimeMarkers, aN as clampViewportToRoot, aO as getHighResInMs, aP as scrollRowIntoView, aQ as TIMELINE_PADDING_PX, aR as Minimap, aS as Timeline, aT as TimelineHeader, aU as wheelZoomScaleFactor, aV as wheelDeltaToPixels, aW as SidebarDataProvider, aX as fetchHook, n as fetchEvents, aY as hydrateResourceIOAsync, N as fetchRun, aZ as fetchStep, a_ as hydrateResourceIO, a$ as fetchStreams, b0 as apiBase, b1 as Slot, L as useComposedRefs, b2 as Slottable, e as cn$1, b3 as buttonVariants, b4 as fetchEvent, b5 as fetchEventsByCorrelationId, b6 as isEncryptedData, b7 as hydrateData, b8 as decrypt, b9 as deriveRunPayloadKeys, ba as getWebRevivers, bb as LIVE_UPDATE_INTERVAL_MS$1, u as useServerConfig, bc as getEncryptionKeyForRun, t as toast, bd as StreamViewerSkeleton, be as Lock, bf as StreamViewer } from "./mermaid-3ZIDBTTL-DG0Grjgm.js";
4
- import { A as ArrowUpRight } from "./arrow-up-right-XpJjI06G.js";
2
+ import { C as CircleAlert, O as parseStepName, B as parseWorkflowName, Q as ErrorCard, U as format, Z as Zap, S as Send, R as ResolveHookModal, q as ChevronUp, X, N as ErrorBoundary, V as Circle, u as unwrapOrThrow, W as WorkflowWebAPIError, I as unwrapServerActionResult, Y as useEscapeKeydown, t as composeEventHandlers, _ as useCallbackRef, $ as useLayoutEffect2, s as useControllableState, a0 as useId, a1 as createContext2, v as Presence, x as createContextScope, n as hideOthers, o as ReactRemoveScroll, a2 as useFocusGuards, a3 as LAYOUT, a4 as wakeUpRun, l as resumeHook, A as Alert, c as AlertTitle, g as getErrorTitle, d as AlertDescription, e as getErrorMessage, a as Skeleton$1, a5 as RunActionsButtons, F as StatusBadge, h as CopyableText, b as RelativeTime, T as Tabs, K as TabsList, L as TabsTrigger, M as TabsContent, a6 as cancelRun, a7 as recreateRun } from "./workflow-graph-viewer-syfKq6DB.js";
3
+ import { c as createLucideIcon, Y as classifyEntityEvent, Z as TERMINAL_EVENT_CLASSES, $ as isSealedNoopEvent$1, a0 as cn, a1 as CopyableDataBlock, a2 as CollapsibleRoot, a3 as CollapsibleTrigger, a4 as CollapsibleContent, a5 as CopyButton, O as cva, a6 as RESERVED_ATTRIBUTE_KEY_PREFIX, a7 as Spinner, a8 as TooltipProvider, T as Tooltip, a as TooltipTrigger, b as TooltipContent, a9 as ContextCardProvider, h as useToast, aa as Skeleton, ab as DecryptClickContext, ac as Yr, ad as isEncryptedMarker, ae as getEventDataRefFields, m as ChevronRight, af as TimestampTooltip, ag as formatDuration, C as Check, l as Copy, ah as DataInspector, ai as _r, aj as isHookLifecycleEventType, ak as isTerminalStepEventType, al as isWaitEventType, am as isStepEventType, an as RunClickContext, ao as StreamClickContext, ap as Collapsible, aq as isExpiredMarker, ar as isDoStreamStep, as as extractConversation, at as EncryptedDataBlock, au as hasEncryptedFields, av as useSidebarDataOptional, aw as isTerminalWorkflowRunStatus, ax as clsx, ay as useActiveSpan, az as useSidebarData, aA as IconButton, J as ChevronDown, aB as useRowWindow, aC as isSpanDimmedBySearch, aD as ROW_HEIGHT_PX, aE as getSpanDurationMs, aF as isSpanErrored, aG as isSpanCancelled, aH as formatDurationPrecise, aI as ActiveSpanProvider, aJ as useReducedMotion, aK as searchSpans, aL as computeRootBounds, aM as computeTimeMarkers, aN as clampViewportToRoot, aO as getHighResInMs, aP as scrollRowIntoView, aQ as TIMELINE_PADDING_PX, aR as Minimap, aS as Timeline, aT as TimelineHeader, aU as wheelZoomScaleFactor, aV as wheelDeltaToPixels, aW as SidebarDataProvider, aX as fetchHook, n as fetchEvents, aY as hydrateResourceIOAsync, N as fetchRun, aZ as fetchStep, a_ as hydrateResourceIO, a$ as fetchStreams, b0 as apiBase, b1 as Slot, L as useComposedRefs, b2 as Slottable, e as cn$1, b3 as buttonVariants, b4 as fetchEvent, b5 as fetchEventsByCorrelationId, b6 as isEncryptedData, b7 as hydrateData, b8 as decrypt, b9 as deriveRunPayloadKeys, ba as getWebRevivers, bb as LIVE_UPDATE_INTERVAL_MS$1, u as useServerConfig, bc as getEncryptionKeyForRun, t as toast, bd as StreamViewerSkeleton, be as Lock, bf as StreamViewer } from "./mermaid-3ZIDBTTL-ClcCzUqi.js";
4
+ import { A as ArrowUpRight } from "./arrow-up-right-jHPcOZmb.js";
5
5
  /**
6
6
  * @license lucide-react v0.575.0 - ISC
7
7
  *
@@ -2236,6 +2236,7 @@ const attributeOrder = [
2236
2236
  "eventData",
2237
2237
  "input",
2238
2238
  "output",
2239
+ "dynamicWorkflowCode",
2239
2240
  "attributes",
2240
2241
  "resumeAt"
2241
2242
  ];
@@ -2274,7 +2275,8 @@ const attributeDisplayNames = {
2274
2275
  resumeAt: "Resume",
2275
2276
  lastReceivedAt: "Last Received",
2276
2277
  disposedAt: "Disposed",
2277
- receivedCount: "Times Resolved"
2278
+ receivedCount: "Times Resolved",
2279
+ dynamicWorkflowCode: "Workflow Code"
2278
2280
  };
2279
2281
  const getAttributeDisplayName = (attribute) => {
2280
2282
  return attributeDisplayNames[attribute] ?? attribute;
@@ -2460,7 +2462,25 @@ const attributeToDisplayFn = {
2460
2462
  // Internal encryption plumbing: the run's X25519 public key, used by
2461
2463
  // cross-run writers to seal payloads to this run. Not actionable for users
2462
2464
  // and not secret, so hidden rather than rendered as 44 opaque base64 chars.
2463
- encryptionPublicKey: (_value) => null
2465
+ encryptionPublicKey: (_value) => null,
2466
+ // A dynamic run's own workflow code — the code the run actually executed,
2467
+ // which for these runs exists nowhere in the deployment's source. Shown as
2468
+ // its own collapsed section: it is the most useful thing on a dynamic run's
2469
+ // detail view, and irrelevant (absent) on every other run.
2470
+ //
2471
+ // Follows the same locked-by-default treatment as input/output: generated
2472
+ // orchestration names internal step ids, prompts and business rules, so the
2473
+ // decrypt flow is the gate on reading it.
2474
+ dynamicWorkflowCode: (value, context) => {
2475
+ if (isEncryptedMarker(value)) {
2476
+ return jsxRuntimeExports.jsx(Collapsible, { label: "Workflow Code", defaultOpen: context == null ? void 0 : context.sectionOpen, onOpenChange: context == null ? void 0 : context.onSectionOpenChange, children: jsxRuntimeExports.jsx(EncryptedFieldBlock, {}) });
2477
+ }
2478
+ if (isExpiredMarker(value))
2479
+ return jsxRuntimeExports.jsx(ExpiredFieldBlock, {});
2480
+ if (typeof value !== "string" || value.trim().length === 0)
2481
+ return null;
2482
+ return jsxRuntimeExports.jsx(Collapsible, { label: "Workflow Code", defaultOpen: context == null ? void 0 : context.sectionOpen, onOpenChange: context == null ? void 0 : context.onSectionOpenChange, children: jsxRuntimeExports.jsx(CopyableDataBlock, { data: value }) });
2483
+ }
2464
2484
  };
2465
2485
  const resolvableAttributes = [
2466
2486
  "input",
@@ -2468,7 +2488,8 @@ const resolvableAttributes = [
2468
2488
  "error",
2469
2489
  "metadata",
2470
2490
  "attributes",
2471
- "eventData"
2491
+ "eventData",
2492
+ "dynamicWorkflowCode"
2472
2493
  ];
2473
2494
  const selfHeaderedAttributes = /* @__PURE__ */ new Set([
2474
2495
  "input",
@@ -2476,7 +2497,8 @@ const selfHeaderedAttributes = /* @__PURE__ */ new Set([
2476
2497
  "error",
2477
2498
  "metadata",
2478
2499
  "attributes",
2479
- "eventData"
2500
+ "eventData",
2501
+ "dynamicWorkflowCode"
2480
2502
  ]);
2481
2503
  const ExpiredDataMessage = () => jsxRuntimeExports.jsx("div", { className: "text-label-12 rounded-md border p-4 my-2", style: {
2482
2504
  borderColor: "var(--ds-gray-300)",
@@ -2496,7 +2518,8 @@ const copyableBasicAttributes = /* @__PURE__ */ new Set([
2496
2518
  const loadingSectionLabels = {
2497
2519
  input: "Input",
2498
2520
  output: "Output",
2499
- eventData: "Event Data"
2521
+ eventData: "Event Data",
2522
+ dynamicWorkflowCode: "Workflow Code"
2500
2523
  };
2501
2524
  const AttributeBlock = ({ attribute, value, isLoading, inline = false, context }) => {
2502
2525
  const decryptCtx = reactExports.useContext(DecryptClickContext);
@@ -5750,7 +5773,7 @@ function RunDetailView({
5750
5773
  runId,
5751
5774
  selectedId: _selectedId
5752
5775
  }) {
5753
- var _a;
5776
+ var _a, _b;
5754
5777
  const navigate = useNavigate();
5755
5778
  const [searchParams] = useSearchParams();
5756
5779
  const { serverConfig } = useServerConfig();
@@ -5953,11 +5976,13 @@ function RunDetailView({
5953
5976
  setCancelling(false);
5954
5977
  }
5955
5978
  };
5979
+ const isDynamicRun = Boolean((_a = run.executionContext) == null ? void 0 : _a.dynamicWorkflow);
5956
5980
  const handleRerunClick = () => {
5981
+ if (isDynamicRun) return;
5957
5982
  setShowRerunDialog(true);
5958
5983
  };
5959
5984
  const handleConfirmRerun = async () => {
5960
- if (rerunning) return;
5985
+ if (rerunning || isDynamicRun) return;
5961
5986
  try {
5962
5987
  setRerunning(true);
5963
5988
  setShowRerunDialog(false);
@@ -5983,7 +6008,7 @@ function RunDetailView({
5983
6008
  /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: getErrorMessage(error) })
5984
6009
  ] });
5985
6010
  }
5986
- const workflowName = (_a = parseWorkflowName(run.workflowName)) == null ? void 0 : _a.shortName;
6011
+ const workflowName = (_b = parseWorkflowName(run.workflowName)) == null ? void 0 : _b.shortName;
5987
6012
  const hasError = false;
5988
6013
  const errorMessage = "";
5989
6014
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -6035,6 +6060,7 @@ function RunDetailView({
6035
6060
  events: allEvents,
6036
6061
  eventsLoading: loading,
6037
6062
  loading,
6063
+ replayDisabledReason: isDynamicRun ? "Dynamic runs cannot be replayed as a new run." : void 0,
6038
6064
  onRerunClick: handleRerunClick,
6039
6065
  onCancelClick: handleCancelClick,
6040
6066
  callbacks: { onSuccess: update }
@@ -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, J as ChevronDown, a0 as cn, e as cn$1, O as cva, bg as composeRefs, L as useComposedRefs, bh as useFloating, bi as offset, bj as shift, bk as limitShift, bl as flip, bm as size, bn as arrow, bo as hide, bp as autoUpdate, m as ChevronRight, C as Check, bq as VERCEL_403_ERROR_MESSAGE, br as bulkCancelRuns$1, bs as reenqueueRun$1, bt as wakeUpRun$1, bu as resumeHook$1, bv as fetchHookToken$1, bw as cancelRun$1, bx as recreateRun$1, T as Tooltip, a as TooltipTrigger, l as Copy, b as TooltipContent, z as createContextScope$1, p as useComposedRefs$1, E as createSlot, ag as formatDuration, B as Button, t as toast, w as useId$1, P as Primitive$1, q as composeEventHandlers$1, G as useControllableState$1, o as useCallbackRef$2, U as Presence$1 } from "./mermaid-3ZIDBTTL-DG0Grjgm.js";
4
+ import { c as createLucideIcon, J as ChevronDown, a0 as cn, e as cn$1, O as cva, bg as composeRefs, L as useComposedRefs, bh as useFloating, bi as offset, bj as shift, bk as limitShift, bl as flip, bm as size, bn as arrow, bo as hide, bp as autoUpdate, m as ChevronRight, C as Check, bq as VERCEL_403_ERROR_MESSAGE, br as bulkCancelRuns$1, bs as reenqueueRun$1, bt as wakeUpRun$1, bu as resumeHook$1, bv as fetchHookToken$1, bw as cancelRun$1, bx as recreateRun$1, T as Tooltip, a as TooltipTrigger, l as Copy, b as TooltipContent, z as createContextScope$1, p as useComposedRefs$1, E as createSlot, ag as formatDuration, B as Button, t as toast, w as useId$1, P as Primitive$1, q as composeEventHandlers$1, G as useControllableState$1, o as useCallbackRef$2, U as Presence$1 } from "./mermaid-3ZIDBTTL-ClcCzUqi.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, I as getDefaultExportFromCjs } from "./index-thGVuYbY.js";
6
6
  function parseName(tag, name) {
7
7
  if (typeof name !== "string") {
@@ -5782,6 +5782,7 @@ function useRunActions({
5782
5782
  runId,
5783
5783
  runStatus,
5784
5784
  events,
5785
+ replayDisabledReason,
5785
5786
  callbacks
5786
5787
  }) {
5787
5788
  const [rerunning, setRerunning] = reactExports.useState(false);
@@ -5792,7 +5793,7 @@ function useRunActions({
5792
5793
  const hasPendingSleeps = eventAnalysis.hasPendingSleeps;
5793
5794
  const handleReplay = reactExports.useCallback(async () => {
5794
5795
  var _a, _b;
5795
- if (rerunning) return null;
5796
+ if (rerunning || replayDisabledReason) return null;
5796
5797
  try {
5797
5798
  setRerunning(true);
5798
5799
  const newRunId = await recreateRun(env, runId);
@@ -5810,7 +5811,7 @@ function useRunActions({
5810
5811
  } finally {
5811
5812
  setRerunning(false);
5812
5813
  }
5813
- }, [env, runId, rerunning, callbacks]);
5814
+ }, [env, runId, rerunning, replayDisabledReason, callbacks]);
5814
5815
  const handleReenqueue = reactExports.useCallback(async () => {
5815
5816
  var _a;
5816
5817
  if (reenqueuing) return;
@@ -5912,6 +5913,7 @@ function RunActionsDropdownItems({
5912
5913
  events,
5913
5914
  eventsLoading,
5914
5915
  callbacks,
5916
+ replayDisabledReason,
5915
5917
  stopPropagation = false
5916
5918
  }) {
5917
5919
  const {
@@ -5924,7 +5926,14 @@ function RunActionsDropdownItems({
5924
5926
  handleReenqueue,
5925
5927
  handleWakeUp,
5926
5928
  handleCancel
5927
- } = useRunActions({ env, runId, runStatus, events, callbacks });
5929
+ } = useRunActions({
5930
+ env,
5931
+ runId,
5932
+ runStatus,
5933
+ events,
5934
+ replayDisabledReason,
5935
+ callbacks
5936
+ });
5928
5937
  const onReplay = (e) => {
5929
5938
  if (stopPropagation) e.stopPropagation();
5930
5939
  handleReplay();
@@ -5943,9 +5952,19 @@ function RunActionsDropdownItems({
5943
5952
  };
5944
5953
  const isRunActive = runStatus === "pending" || runStatus === "running";
5945
5954
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
5946
- /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenuItem, { onClick: onReplay, disabled: rerunning, children: [
5947
- /* @__PURE__ */ jsxRuntimeExports.jsx(RotateCw, { className: "h-4 w-4 mr-2" }),
5948
- rerunning ? "Replaying..." : "Replay Run"
5955
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
5956
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
5957
+ DropdownMenuItem,
5958
+ {
5959
+ onClick: onReplay,
5960
+ disabled: rerunning || Boolean(replayDisabledReason),
5961
+ children: [
5962
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RotateCw, { className: "h-4 w-4 mr-2" }),
5963
+ rerunning ? "Replaying..." : "Replay Run"
5964
+ ]
5965
+ }
5966
+ ) }),
5967
+ replayDisabledReason ? /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { side: "left", className: "max-w-xs", children: replayDisabledReason }) : null
5949
5968
  ] }),
5950
5969
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
5951
5970
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -5996,6 +6015,7 @@ function RunActionsButtons({
5996
6015
  eventsLoading,
5997
6016
  loading,
5998
6017
  callbacks,
6018
+ replayDisabledReason,
5999
6019
  onCancelClick,
6000
6020
  onRerunClick
6001
6021
  }) {
@@ -6008,8 +6028,8 @@ function RunActionsButtons({
6008
6028
  } = useRunActions({ env, runId, runStatus, events, callbacks });
6009
6029
  const isRunActive = runStatus === "pending" || runStatus === "running";
6010
6030
  const canCancel = isRunActive;
6011
- const canRerun = !loading && !isRunActive;
6012
- const rerunDisabledReason = loading ? "Loading run data..." : isRunActive ? "Cannot re-run while workflow is still running" : "";
6031
+ const canRerun = !loading && !isRunActive && !replayDisabledReason;
6032
+ const rerunDisabledReason = replayDisabledReason ? replayDisabledReason : loading ? "Loading run data..." : isRunActive ? "Cannot re-run while workflow is still running" : "";
6013
6033
  const cancelDisabledReason = runStatus === "completed" ? "Run has already completed" : runStatus === "failed" ? "Run has already failed" : runStatus === "cancelled" ? "Run has already been cancelled" : "";
6014
6034
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
6015
6035
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
@@ -1,4 +1,4 @@
1
- import { r as registerZstdDecoder, _ as __vitePreload } from "./mermaid-3ZIDBTTL-DG0Grjgm.js";
1
+ import { r as registerZstdDecoder, _ as __vitePreload } from "./mermaid-3ZIDBTTL-ClcCzUqi.js";
2
2
  import "./index-thGVuYbY.js";
3
3
  let registered = false;
4
4
  let modulePromise;