@workflow/web 5.0.6 → 5.0.7

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 (21) hide show
  1. package/build/client/assets/{arrow-up-right-DDLzuSl1.js → arrow-up-right-a32MzRMp.js} +1 -1
  2. package/build/client/assets/{highlighted-body-B3W2YXNL-7nJixRf5.js → highlighted-body-B3W2YXNL-DCgLQxra.js} +1 -1
  3. package/build/client/assets/{home-DjMKxUF0.js → home-DpdZcGVy.js} +3 -3
  4. package/build/client/assets/{loader-circle-BuHkkqyY.js → loader-circle-Cmjna4Hz.js} +1 -1
  5. package/build/client/assets/{manifest-4ef14c64.js → manifest-9394faa9.js} +1 -1
  6. package/build/client/assets/{mermaid-3ZIDBTTL-CQkIfF6F.js → mermaid-3ZIDBTTL-DLxMuWKz.js} +287 -38
  7. package/build/client/assets/{root-BdoS4wTM.js → root-09zD_6mm.js} +3 -3
  8. package/build/client/assets/{run-detail-CY1rcVcm.js → run-detail-CmoLyPEh.js} +30 -11
  9. package/build/client/assets/{workflow-graph-viewer-DaFQpLw8.js → workflow-graph-viewer-CDgnftai.js} +1 -1
  10. package/build/client/assets/{zstd-browser-decoder-BEdfA1e2.js → zstd-browser-decoder-EPcbqS8a.js} +1 -1
  11. package/build/server/assets/{app-BWanCGIY.js → app-CGNn2sgH.js} +61445 -58530
  12. package/build/server/assets/{highlighted-body-B3W2YXNL-DTYrZ-0h.js → highlighted-body-B3W2YXNL-B_5okmFo.js} +1 -1
  13. package/build/server/assets/{index-DKlEIDGP.js → index-B4MODFYC.js} +1 -1
  14. package/build/server/assets/{index-BE6TqyDE.js → index-D-4ijDGf.js} +96 -79
  15. package/build/server/assets/{mermaid-3ZIDBTTL-lgfv9_nj.js → mermaid-3ZIDBTTL-nxLg8eQL.js} +1 -1
  16. package/build/server/assets/{token-BhYk3Bk4.js → token-gWdV0VkL.js} +1 -1
  17. package/build/server/assets/{token-util-CfkQa5kX.js → token-util-Bwa03_6B.js} +1 -1
  18. package/build/server/assets/{wrapper-BO03ZtLx.js → wrapper-D5B7_s57.js} +9 -9
  19. package/build/server/assets/{zstd-browser-decoder-BAaFFyPz.js → zstd-browser-decoder-Dt7h9Xjv.js} +1 -1
  20. package/build/server/index.js +2 -2
  21. package/package.json +7 -7
@@ -1,4 +1,4 @@
1
- import { c as createLucideIcon } from "./mermaid-3ZIDBTTL-CQkIfF6F.js";
1
+ import { c as createLucideIcon } from "./mermaid-3ZIDBTTL-DLxMuWKz.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-CQkIfF6F.js";
1
+ import { R, K as Ks, Q as Qe } from "./mermaid-3ZIDBTTL-DLxMuWKz.js";
2
2
  import { r as reactExports, j as jsxRuntimeExports } from "./index-CRmVVsbP.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-CRmVVsbP.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-DaFQpLw8.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-CQkIfF6F.js";
4
- import { L as LoaderCircle } from "./loader-circle-BuHkkqyY.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-CDgnftai.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-DLxMuWKz.js";
4
+ import { L as LoaderCircle } from "./loader-circle-Cmjna4Hz.js";
5
5
  /**
6
6
  * @license lucide-react v0.575.0 - ISC
7
7
  *
@@ -1,4 +1,4 @@
1
- import { c as createLucideIcon } from "./mermaid-3ZIDBTTL-CQkIfF6F.js";
1
+ import { c as createLucideIcon } from "./mermaid-3ZIDBTTL-DLxMuWKz.js";
2
2
  /**
3
3
  * @license lucide-react v0.575.0 - ISC
4
4
  *
@@ -1 +1 @@
1
- window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-GbcnkvKL.js","imports":["/assets/index-CRmVVsbP.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root-BdoS4wTM.js","imports":["/assets/index-CRmVVsbP.js","/assets/mermaid-3ZIDBTTL-CQkIfF6F.js","/assets/loader-circle-BuHkkqyY.js","/assets/arrow-up-right-DDLzuSl1.js"],"css":["/assets/root-DlBeVW_-.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-DjMKxUF0.js","imports":["/assets/index-CRmVVsbP.js","/assets/workflow-graph-viewer-DaFQpLw8.js","/assets/mermaid-3ZIDBTTL-CQkIfF6F.js","/assets/loader-circle-BuHkkqyY.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-CY1rcVcm.js","imports":["/assets/index-CRmVVsbP.js","/assets/workflow-graph-viewer-DaFQpLw8.js","/assets/mermaid-3ZIDBTTL-CQkIfF6F.js","/assets/arrow-up-right-DDLzuSl1.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-4ef14c64.js","version":"4ef14c64"};
1
+ window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-GbcnkvKL.js","imports":["/assets/index-CRmVVsbP.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root-09zD_6mm.js","imports":["/assets/index-CRmVVsbP.js","/assets/mermaid-3ZIDBTTL-DLxMuWKz.js","/assets/loader-circle-Cmjna4Hz.js","/assets/arrow-up-right-a32MzRMp.js"],"css":["/assets/root-DlBeVW_-.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-DpdZcGVy.js","imports":["/assets/index-CRmVVsbP.js","/assets/workflow-graph-viewer-CDgnftai.js","/assets/mermaid-3ZIDBTTL-DLxMuWKz.js","/assets/loader-circle-Cmjna4Hz.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-CmoLyPEh.js","imports":["/assets/index-CRmVVsbP.js","/assets/workflow-graph-viewer-CDgnftai.js","/assets/mermaid-3ZIDBTTL-DLxMuWKz.js","/assets/arrow-up-right-a32MzRMp.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-9394faa9.js","version":"9394faa9"};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/zstd-browser-decoder-BEdfA1e2.js","assets/index-CRmVVsbP.js","assets/highlighted-body-B3W2YXNL-7nJixRf5.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/zstd-browser-decoder-EPcbqS8a.js","assets/index-CRmVVsbP.js","assets/highlighted-body-B3W2YXNL-DCgLQxra.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);
@@ -14687,6 +14687,29 @@ function getEventDataRefFields(eventType) {
14687
14687
  const BinarySerializedDataSchema = compile(_instanceof(Uint8Array));
14688
14688
  const LegacySerializedDataSchemaV1 = compile(any());
14689
14689
  const SerializedDataSchema = compile(union([BinarySerializedDataSchema, LegacySerializedDataSchemaV1]));
14690
+ const StartHookSchema = object({
14691
+ /** The start Hook's token. Non-empty. */
14692
+ token: string$2().min(1),
14693
+ /**
14694
+ * The start Hook's id, {@link startHookId}`(runId)`. Set by the World on
14695
+ * what it returns (`run.startHook` and the stored
14696
+ * `run_created.eventData.startHook`); ignored on requests, since the id is
14697
+ * derived from the run's.
14698
+ */
14699
+ hookId: string$2().optional(),
14700
+ /**
14701
+ * The start Hook's minimum retention, like `createHook()`'s
14702
+ * `tokenRetentionUntil`: once the run has ended, the Hook keeps its token
14703
+ * until this time has passed. Disposing the Hook frees the token earlier.
14704
+ * Requires `capabilities.hookRetention`.
14705
+ */
14706
+ tokenRetentionUntil: date().optional(),
14707
+ /**
14708
+ * The start Hook's metadata, serialized like `createHook({ metadata })`'s
14709
+ * (the same bytes `hook_created.eventData.metadata` carries).
14710
+ */
14711
+ metadata: SerializedDataSchema.optional()
14712
+ });
14690
14713
  const EventTypeSchema = compile(_enum([
14691
14714
  // Run lifecycle events
14692
14715
  "run_created",
@@ -14834,6 +14857,8 @@ const StepFailedEventSchema = BaseEventSchema.extend({
14834
14857
  // The thrown value, serialized via the workflow serialization pipeline.
14835
14858
  // Can be any JavaScript value (string, number, object, Error, etc.)
14836
14859
  error: SerializedDataSchema,
14860
+ /** The attempt that failed (spec >= 9). */
14861
+ attempt: number$3().int().positive().optional(),
14837
14862
  ...stepLatencyTelemetryFields
14838
14863
  })
14839
14864
  });
@@ -14845,7 +14870,17 @@ const StepRetryingEventSchema = BaseEventSchema.extend({
14845
14870
  // The thrown value, serialized via the workflow serialization pipeline.
14846
14871
  // Can be any JavaScript value (string, number, object, Error, etc.)
14847
14872
  error: SerializedDataSchema,
14848
- retryAfter: date().optional()
14873
+ retryAfter: date().optional(),
14874
+ /** The attempt that failed (spec >= 9). */
14875
+ attempt: number$3().int().positive().optional(),
14876
+ /**
14877
+ * Queue message id of the orchestrator delivery that wrote this event
14878
+ * (spec >= 9): set only when an inline step's failed attempt moves its
14879
+ * retry to the background. Only a redelivery of this same message
14880
+ * enqueues the step's message again, and only while this is the step's
14881
+ * last event. Absent when the step's own message wrote it.
14882
+ */
14883
+ creatorMessageId: string$2().optional()
14849
14884
  })
14850
14885
  });
14851
14886
  const StepStartedEventSchema = BaseEventSchema.extend({
@@ -14858,8 +14893,17 @@ const StepStartedEventSchema = BaseEventSchema.extend({
14858
14893
  // backend can build the payload ref key without re-reading the run.
14859
14894
  workflowName: string$2().optional(),
14860
14895
  // Lazy-start: the dehydrated step input, present only when this
14861
- // step_started is also responsible for creating the step.
14896
+ // step_started is also responsible for creating the step. On a
14897
+ // single-orchestrator run (spec >= 9) an inline step has no
14898
+ // `step_created`: its first `step_started` carries the input and is its
14899
+ // creation.
14862
14900
  input: SerializedDataSchema.optional(),
14901
+ /**
14902
+ * A creation-bearing start's execution mode, as
14903
+ * `step_created.eventData.inline` (spec >= 9): always `true`, since
14904
+ * only an inline step is created by its start.
14905
+ */
14906
+ inline: boolean$2().optional(),
14863
14907
  // Inline step ownership: the queue message ID of the invocation whose
14864
14908
  // handler is executing this step's body inline. Stamped on the lazy
14865
14909
  // step_started (and re-stamped on an owner-recovery bare start) so
@@ -14881,7 +14925,22 @@ const StepCreatedEventSchema = BaseEventSchema.extend({
14881
14925
  eventData: object({
14882
14926
  stepName: string$2(),
14883
14927
  workflowName: string$2().optional(),
14884
- input: SerializedDataSchema
14928
+ input: SerializedDataSchema,
14929
+ /**
14930
+ * The step's execution mode, fixed at creation (spec >= 9). `true`: the
14931
+ * orchestrator invocation that wrote this event may run the body in its
14932
+ * own process, and a retry of that invocation may run it again. `false`
14933
+ * (or absent): the step was handed to the queue, and only its queue
14934
+ * message's invocation ever runs the body.
14935
+ */
14936
+ inline: boolean$2().optional(),
14937
+ /**
14938
+ * Queue message id of the orchestrator delivery that wrote this event
14939
+ * (spec >= 9). A background step is enqueued again only by a
14940
+ * redelivery of this same message, and only while the step has no
14941
+ * `step_started`.
14942
+ */
14943
+ creatorMessageId: string$2().optional()
14885
14944
  })
14886
14945
  });
14887
14946
  const HookCreatedEventSchema = compile(BaseEventSchema.extend({
@@ -14956,7 +15015,8 @@ const HookConflictEventSchema = BaseEventSchema.extend({
14956
15015
  * understand the involuntary disposal — the forced hook gets the
14957
15016
  * ordinary `HookConflictError` it opted out of instead of stranding
14958
15017
  * that run. Absent on a conflict answered by a World that does not
14959
- * implement forcing at all.
15018
+ * implement forcing at all. (A run's `start({ hook })` Hook is taken like
15019
+ * any other Hook, so it is never a reason to refuse.)
14960
15020
  */
14961
15021
  forceRefusedReason: literal("victim-spec-version").optional()
14962
15022
  })
@@ -14971,7 +15031,13 @@ const WaitCreatedEventSchema = BaseEventSchema.extend({
14971
15031
  eventType: literal("wait_created"),
14972
15032
  correlationId: string$2(),
14973
15033
  eventData: object({
14974
- resumeAt: date()
15034
+ resumeAt: date(),
15035
+ /**
15036
+ * Queue message id of the orchestrator delivery that wrote this event
15037
+ * (spec >= 9). Only that delivery, or a redelivery of the same message,
15038
+ * schedules the wait's timer.
15039
+ */
15040
+ creatorMessageId: string$2().optional()
14975
15041
  })
14976
15042
  });
14977
15043
  const WaitCompletedEventSchema = BaseEventSchema.extend({
@@ -15026,7 +15092,18 @@ const RunCreatedEventSchema = BaseEventSchema.extend({
15026
15092
  * cross-run writers can seal payloads to this run without holding its
15027
15093
  * symmetric key. Not secret. See `WorkflowRunBaseSchema`.
15028
15094
  */
15029
- encryptionPublicKey: string$2().optional()
15095
+ encryptionPublicKey: string$2().optional(),
15096
+ /**
15097
+ * Create the run's start Hook (id `startHookId(runId)`) for this token
15098
+ * atomically with the run's creation. Only sent to Worlds that declare
15099
+ * `capabilities.atomicStartHook`; see `start-hook.ts` for the admission
15100
+ * contract. A stored `run_created` keeps it, with `hookId`, as the
15101
+ * record of the start Hook's creation: no `hook_created` is written for
15102
+ * that Hook, so `run_created` stands for one with `{ token, metadata,
15103
+ * tokenRetentionUntil, isWebhook: false }`. A World may strip
15104
+ * `metadata` from the stored copy.
15105
+ */
15106
+ startHook: StartHookSchema.optional()
15030
15107
  }).refine((value) => value.dynamicWorkflowCode === void 0 || value.dynamicWorkflowCodeRef === void 0, {
15031
15108
  path: ["dynamicWorkflowCodeRef"],
15032
15109
  message: "dynamicWorkflowCode and dynamicWorkflowCodeRef are mutually exclusive"
@@ -15050,7 +15127,13 @@ const RunStartedEventSchema = BaseEventSchema.extend({
15050
15127
  encryptionPublicKey: string$2().optional(),
15051
15128
  /** Dynamic code carried for resilient run creation. */
15052
15129
  dynamicWorkflowCode: SerializedDataSchema.optional(),
15053
- dynamicWorkflowCodeRef: string$2().optional()
15130
+ dynamicWorkflowCodeRef: string$2().optional(),
15131
+ /**
15132
+ * Mirrors `run_created.eventData.startHook` for the queued copy of an
15133
+ * atomic start. Either write may admit the candidate, and both must
15134
+ * reach the same decision; see `start-hook.ts`.
15135
+ */
15136
+ startHook: StartHookSchema.optional()
15054
15137
  }).refine((value) => value.dynamicWorkflowCode === void 0 || value.dynamicWorkflowCodeRef === void 0, {
15055
15138
  path: ["dynamicWorkflowCodeRef"],
15056
15139
  message: "dynamicWorkflowCode and dynamicWorkflowCodeRef are mutually exclusive"
@@ -15242,6 +15325,14 @@ const WorkflowRunBaseSchema = compile(object({
15242
15325
  * implement `getEncryptionKeyForRun` (encryption disabled).
15243
15326
  */
15244
15327
  encryptionPublicKey: string$2().optional(),
15328
+ /**
15329
+ * The start Hook this run was admitted with through `start({ hook })`,
15330
+ * echoed by a World that admitted it (see `start-hook.ts`), with its
15331
+ * `hookId` (`startHookId(runId)`). Required on the `run_created` response,
15332
+ * on `runs.get` and on the `run_started` response. Never forwarded when a
15333
+ * run is re-run: a re-run is a new run by intent.
15334
+ */
15335
+ startHook: StartHookSchema.optional(),
15245
15336
  expiredAt: date().optional(),
15246
15337
  startedAt: date().optional(),
15247
15338
  completedAt: date().optional(),
@@ -15474,6 +15565,20 @@ compile(object({
15474
15565
  firstSeenAt: UTCDateSchema,
15475
15566
  lastSeenAt: UTCDateSchema
15476
15567
  }));
15568
+ const flag = boolean$2().optional().catch(void 0);
15569
+ const activeFlag = object({ active: boolean$2() }).optional().catch(void 0);
15570
+ object({
15571
+ invoke: flag,
15572
+ hookRetention: activeFlag,
15573
+ atomicStartHook: activeFlag,
15574
+ maxConcurrency: flag,
15575
+ inBandFence: flag,
15576
+ hookResumeDedup: flag,
15577
+ resolvedHookResume: flag,
15578
+ hookForceClaim: flag,
15579
+ deploymentAffinity: flag,
15580
+ dynamicWorkflowCode: flag
15581
+ }).optional().catch(void 0);
15477
15582
  const WarnedEnvValuesKey = Symbol.for("@workflow/world//warnedEnvValues/v1");
15478
15583
  const globalStore = globalThis;
15479
15584
  globalStore[WarnedEnvValuesKey] ?? (globalStore[WarnedEnvValuesKey] = /* @__PURE__ */ new Set());
@@ -15500,6 +15605,17 @@ const RunInputSchema = compile(object({
15500
15605
  * the original `run_created` attempt.
15501
15606
  */
15502
15607
  allowReservedAttributes: literal(true).optional(),
15608
+ /**
15609
+ * The run's X25519 public key, mirrored from `run_created` so a run the
15610
+ * resilient-start path creates can still receive sealed writes.
15611
+ */
15612
+ encryptionPublicKey: string$2().optional(),
15613
+ /**
15614
+ * The atomic start Hook request, mirrored from `run_created` so the
15615
+ * queued copy of the candidate can admit (or be refused) on its own.
15616
+ * See `start-hook.ts`.
15617
+ */
15618
+ startHook: StartHookSchema.optional(),
15503
15619
  /**
15504
15620
  * The environment the creating client's writes are attributed to, as
15505
15621
  * reported by {@link World.getEnvironment} at `start()` time (on Vercel:
@@ -15603,6 +15719,24 @@ const HookResumeTimingSchema = compile(object({
15603
15719
  }));
15604
15720
  const WorkflowInvokePayloadSchema = compile(object({
15605
15721
  runId: string$2(),
15722
+ /**
15723
+ * The run's persisted spec version (`WorkflowRun.specVersion`), which picks
15724
+ * the orchestrator that drives it. A routing hint only: a message without
15725
+ * it (from a producer that predates the field, or one the World sends
15726
+ * itself) is routed off the run instead, and a step message's
15727
+ * `runContext` or a first delivery's `runInput` carries the same value.
15728
+ */
15729
+ runSpecVersion: number$3().int().optional().catch(void 0),
15730
+ /**
15731
+ * Set on a message a World sent to resume a run after it lost its queue
15732
+ * (`reenqueueActiveRuns` with `queueLost`, world-local after a restart):
15733
+ * every message the run had queued, its step messages and wait timers,
15734
+ * died with the queue. A single-orchestrator delivery of it re-sends
15735
+ * every open step message and arms every open wait's timer. A consumer
15736
+ * that predates the field ignores it, and `.catch(undefined)` keeps a
15737
+ * malformed value from failing the parse.
15738
+ */
15739
+ recovery: literal(true).optional().catch(void 0),
15606
15740
  /** Process this input and return the handler's result as response data. */
15607
15741
  invoke: literal(true).optional(),
15608
15742
  /** Identifies one input across retries, separately from the queue delivery ID. */
@@ -15611,7 +15745,9 @@ const WorkflowInvokePayloadSchema = compile(object({
15611
15745
  traceCarrier: TraceCarrierSchema.optional(),
15612
15746
  requestedAt: date().optional(),
15613
15747
  /**
15614
- * Consecutive replay divergences in this recovery chain and latest position.
15748
+ * Consecutive replay divergences in this recovery chain and latest position
15749
+ * (spec <= 8 runs: a spec 9 orchestrator recovers within its delivery and
15750
+ * never sends it).
15615
15751
  *
15616
15752
  * `eventIds` is every divergent event id in the chain, oldest first, so the
15617
15753
  * terminal failure can say whether each recovery replay diverged at the same
@@ -15668,13 +15804,75 @@ const WorkflowInvokePayloadSchema = compile(object({
15668
15804
  */
15669
15805
  waitContinuation: object({
15670
15806
  correlationId: string$2(),
15671
- attempt: number$3().int().nonnegative()
15807
+ attempt: number$3().int().nonnegative(),
15808
+ /**
15809
+ * The wait's `resumeAt` (epoch ms), set only on an intermediate hop
15810
+ * of a spec 9 wait longer than one queue delay: a timer sent to fire
15811
+ * before the wait is due, only so that the next hop can be sent (see
15812
+ * {@link isIntermediateWaitHop}). Absent on a final hop, the timer
15813
+ * due when the wait is.
15814
+ */
15815
+ resumeAtMs: number$3().optional(),
15816
+ /**
15817
+ * The deadline (epoch ms) of this intermediate hop, set beside
15818
+ * `resumeAtMs`. Hops are anchored on the wait's deadline, and each
15819
+ * is keyed by its own deadline, so the delivery of this hop sends
15820
+ * the one after it: one it could not compute from its own clock
15821
+ * when it was delivered a little early.
15822
+ */
15823
+ hopAtMs: number$3().optional()
15672
15824
  }).optional().catch(void 0),
15825
+ /**
15826
+ * Waits the orchestrator completes on this delivery whatever their
15827
+ * `resumeAt` (spec >= 9): `run.wakeUp()` names them here instead of
15828
+ * writing `wait_completed` itself, so the orchestrator writes it in-band,
15829
+ * in log order with its own decisions. A wait already completed, or not
15830
+ * open, is ignored. The message is an ordinary orchestrator message: a
15831
+ * queue that coalesces it into a running delivery drops the names, and
15832
+ * the waits then run their full length (`run.wakeUp()` is best-effort
15833
+ * there). `.catch(undefined)` so a malformed value degrades to "no waits
15834
+ * named" rather than failing the parse.
15835
+ */
15836
+ completeWaits: array(string$2()).optional().catch(void 0),
15673
15837
  /** Step ID for inline step execution in combined handler. If provided, the flow execution
15674
15838
  * will jump directly to execute the step with the given ID before doing an event replay. */
15675
15839
  stepId: string$2().optional(),
15676
15840
  /** Step name, sent alongside stepId to avoid loading the event log to resolve the name. */
15677
15841
  stepName: string$2().optional(),
15842
+ /**
15843
+ * The attempt this step message starts with (spec >= 9). Absent means 1.
15844
+ * Set above 1 when a step that ran inline in the orchestrator failed with
15845
+ * a retryable error and its retry moved to this message. A message whose
15846
+ * `stepAttempt` is above 1 counts as a retry, so its handler reads the
15847
+ * log before running the body.
15848
+ */
15849
+ stepAttempt: number$3().int().positive().optional(),
15850
+ /**
15851
+ * Set on a step message the orchestrator sent again (spec >= 9): a
15852
+ * re-send of a step whose message a delivery that died may never have
15853
+ * sent (`Queue.createQueueHandler`). Normally the step's stable key
15854
+ * deduplicates it against the first message. When it does go out as a
15855
+ * new message, its handler reads the log before running the body even on
15856
+ * the message's first delivery: the re-send was decided from a log that
15857
+ * can be older than the step's progress, so the step may already have
15858
+ * an outcome.
15859
+ */
15860
+ stepResent: boolean$2().optional(),
15861
+ /**
15862
+ * Event id of the step's `step_created` (spec >= 9). The step handler
15863
+ * reads the step's input from that event when the message does not carry
15864
+ * it in {@link WorkflowInvokePayloadSchema.shape.stepInput}.
15865
+ */
15866
+ stepCreatedEventId: string$2().optional(),
15867
+ /**
15868
+ * When the step's `step_created` was committed, as epoch milliseconds
15869
+ * (spec >= 9): the `createdAt` the World answered it with. The step
15870
+ * handler passes it on the step's first-attempt `step_started` as
15871
+ * `CreateEventParams.stepCreatedAt`, for creation-to-start latency
15872
+ * telemetry. Absent on retry messages and from older runtimes.
15873
+ * `.catch(undefined)` so a malformed value only drops the telemetry.
15874
+ */
15875
+ stepCreatedAt: number$3().optional().catch(void 0),
15678
15876
  /** Run creation data, only present on the first queue delivery from start() */
15679
15877
  runInput: RunInputSchema.optional(),
15680
15878
  /**
@@ -19730,17 +19928,41 @@ class WorkflowWorldError extends WorkflowError {
19730
19928
  * parameter without parsing the message.
19731
19929
  */
19732
19930
  __publicField(this, "field");
19931
+ /**
19932
+ * Why the World gave `code`, when it says. For
19933
+ * `START_HOOK_ADMISSION_REJECTED`: `invalid`, `expired`, `token_mismatch`,
19934
+ * `ordinary_run` or `disabled`; for `START_HOOK_ADMISSION_DISABLED`:
19935
+ * `disabled`.
19936
+ */
19937
+ __publicField(this, "reason");
19733
19938
  this.name = "WorkflowWorldError";
19734
19939
  this.status = options == null ? void 0 : options.status;
19735
19940
  this.code = options == null ? void 0 : options.code;
19736
19941
  this.url = options == null ? void 0 : options.url;
19737
19942
  this.retryAfter = options == null ? void 0 : options.retryAfter;
19738
19943
  this.field = options == null ? void 0 : options.field;
19944
+ this.reason = options == null ? void 0 : options.reason;
19739
19945
  }
19740
19946
  static is(value) {
19741
19947
  return isError(value) && value.name === "WorkflowWorldError";
19742
19948
  }
19743
19949
  }
19950
+ class WorkflowStartError extends WorkflowError {
19951
+ constructor(runId, stage, cause) {
19952
+ const causeMessage = isError(cause) ? cause.message : cause === void 0 ? "unknown error" : String(cause);
19953
+ super(`Could not confirm whether workflow run "${runId}" was ${stage === "queue" ? "queued" : "admitted"}: ${causeMessage}. Retrying with the same hook token is safe while the token is held: it never admits a second run while the first one holds it.`, { cause });
19954
+ /** The candidate run's ID. */
19955
+ __publicField(this, "runId");
19956
+ /** The step whose outcome could not be confirmed. */
19957
+ __publicField(this, "stage");
19958
+ this.name = "WorkflowStartError";
19959
+ this.runId = runId;
19960
+ this.stage = stage;
19961
+ }
19962
+ static is(value) {
19963
+ return isError(value) && value.name === "WorkflowStartError";
19964
+ }
19965
+ }
19744
19966
  class WorkflowRuntimeError extends WorkflowError {
19745
19967
  constructor(message, options) {
19746
19968
  super(message, {
@@ -19768,19 +19990,26 @@ class RuntimeDecryptionError extends WorkflowRuntimeError {
19768
19990
  }
19769
19991
  }
19770
19992
  class HookConflictError extends WorkflowError {
19771
- constructor(token, conflictingRunId) {
19772
- super(`Hook token "${token}" is already in use by another workflow${conflictingRunId ? ` (run "${conflictingRunId}")` : ""}`, {
19993
+ constructor(token, conflictingRunId, options) {
19994
+ super((options == null ? void 0 : options.kind) === "start" ? (
19995
+ // Without the token: this message becomes the start span's status.
19996
+ `No run was created: workflow run "${conflictingRunId}" already owns this hook token`
19997
+ ) : `Hook token "${token}" is already in use by another workflow${conflictingRunId ? ` (run "${conflictingRunId}")` : ""}`, {
19773
19998
  slug: ERROR_SLUGS.HOOK_CONFLICT
19774
19999
  });
19775
20000
  __publicField(this, "token");
19776
20001
  // TODO: Make this required once all persisted hook_conflict events and World
19777
20002
  // implementations always include the active hook owner's run ID.
19778
20003
  __publicField(this, "conflictingRunId");
20004
+ /** `'start'` when a `start({ hook })` was refused; no run was created. */
20005
+ __publicField(this, "kind");
19779
20006
  this.name = "HookConflictError";
19780
20007
  this.token = token;
19781
20008
  if (conflictingRunId !== void 0) {
19782
20009
  this.conflictingRunId = conflictingRunId;
19783
20010
  }
20011
+ if ((options == null ? void 0 : options.kind) !== void 0)
20012
+ this.kind = options.kind;
19784
20013
  }
19785
20014
  static is(value) {
19786
20015
  return isError(value) && value.name === "HookConflictError";
@@ -19858,6 +20087,7 @@ const HOOK_CONFLICT_ERROR_KEY = Symbol.for("@workflow/errors//HookConflictError"
19858
20087
  const HOOK_FORCE_CLAIMED_ERROR_KEY = Symbol.for("@workflow/errors//HookForceClaimedError");
19859
20088
  const RUNTIME_DECRYPTION_ERROR_KEY = Symbol.for("@workflow/errors//RuntimeDecryptionError");
19860
20089
  const STREAM_ERROR_KEY = Symbol.for("@workflow/errors//StreamError");
20090
+ const WORKFLOW_START_ERROR_KEY = Symbol.for("@workflow/errors//WorkflowStartError");
19861
20091
  if (typeof globalThis !== "undefined") {
19862
20092
  if (!Object.hasOwn(globalThis, FATAL_ERROR_KEY)) {
19863
20093
  Object.defineProperty(globalThis, FATAL_ERROR_KEY, {
@@ -19907,6 +20137,14 @@ if (typeof globalThis !== "undefined") {
19907
20137
  configurable: false
19908
20138
  });
19909
20139
  }
20140
+ if (!Object.hasOwn(globalThis, WORKFLOW_START_ERROR_KEY)) {
20141
+ Object.defineProperty(globalThis, WORKFLOW_START_ERROR_KEY, {
20142
+ value: WorkflowStartError,
20143
+ writable: false,
20144
+ enumerable: false,
20145
+ configurable: false
20146
+ });
20147
+ }
19910
20148
  }
19911
20149
  const NONCE_LENGTH = 12;
19912
20150
  const TAG_LENGTH = 128;
@@ -20805,6 +21043,16 @@ function getWebRevivers() {
20805
21043
  error2.stack = value.stack;
20806
21044
  return error2;
20807
21045
  },
21046
+ WorkflowStartError: (value) => {
21047
+ const opts = "cause" in value ? { cause: value.cause } : void 0;
21048
+ const error2 = new Error(value.message, opts);
21049
+ error2.name = "WorkflowStartError";
21050
+ error2.runId = value.runId;
21051
+ error2.stage = value.stage;
21052
+ if (value.stack !== void 0)
21053
+ error2.stack = value.stack;
21054
+ return error2;
21055
+ },
20808
21056
  RetryableError: (value) => {
20809
21057
  const opts = "cause" in value ? { cause: value.cause } : void 0;
20810
21058
  const error2 = new Error(value.message, opts);
@@ -21000,7 +21248,7 @@ async function hydrateResourceIOAsync(resource, key) {
21000
21248
  return { hydrateDataWithKey: hydrateDataWithKey3, deriveRunPayloadKeys: deriveRunPayloadKeys3 };
21001
21249
  }, true ? void 0 : void 0);
21002
21250
  const { ensureZstdDecoderRegistered } = await __vitePreload(async () => {
21003
- const { ensureZstdDecoderRegistered: ensureZstdDecoderRegistered2 } = await import("./zstd-browser-decoder-BEdfA1e2.js");
21251
+ const { ensureZstdDecoderRegistered: ensureZstdDecoderRegistered2 } = await import("./zstd-browser-decoder-EPcbqS8a.js");
21004
21252
  return { ensureZstdDecoderRegistered: ensureZstdDecoderRegistered2 };
21005
21253
  }, true ? __vite__mapDeps([0,1]) : void 0);
21006
21254
  ensureZstdDecoderRegistered();
@@ -48710,7 +48958,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
48710
48958
  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 });
48711
48959
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
48712
48960
  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 }) });
48713
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-7nJixRf5.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 }) => {
48961
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-DCgLQxra.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 }) => {
48714
48962
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
48715
48963
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
48716
48964
  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 }) })] }) });
@@ -53186,30 +53434,31 @@ export {
53186
53434
  hydrateData as b7,
53187
53435
  decrypt as b8,
53188
53436
  deriveRunPayloadKeys as b9,
53189
- getWebRevivers as ba,
53190
- LIVE_UPDATE_INTERVAL_MS as bb,
53191
- getEncryptionKeyForRun as bc,
53192
- StreamViewerSkeleton as bd,
53193
- Lock as be,
53194
- StreamViewer as bf,
53195
- composeRefs as bg,
53196
- useFloating as bh,
53197
- offset as bi,
53198
- shift as bj,
53199
- limitShift as bk,
53200
- flip as bl,
53201
- size as bm,
53202
- arrow as bn,
53203
- hide$1 as bo,
53204
- autoUpdate as bp,
53205
- VERCEL_403_ERROR_MESSAGE as bq,
53206
- bulkCancelRuns as br,
53207
- reenqueueRun as bs,
53208
- wakeUpRun as bt,
53209
- resumeHook as bu,
53210
- fetchHookToken as bv,
53211
- cancelRun as bw,
53212
- recreateRun as bx,
53437
+ SerializationFormat as ba,
53438
+ getWebRevivers as bb,
53439
+ LIVE_UPDATE_INTERVAL_MS as bc,
53440
+ getEncryptionKeyForRun as bd,
53441
+ StreamViewerSkeleton as be,
53442
+ Lock as bf,
53443
+ StreamViewer as bg,
53444
+ composeRefs as bh,
53445
+ useFloating as bi,
53446
+ offset as bj,
53447
+ shift as bk,
53448
+ limitShift as bl,
53449
+ flip as bm,
53450
+ size as bn,
53451
+ arrow as bo,
53452
+ hide$1 as bp,
53453
+ autoUpdate as bq,
53454
+ VERCEL_403_ERROR_MESSAGE as br,
53455
+ bulkCancelRuns as bs,
53456
+ reenqueueRun as bt,
53457
+ wakeUpRun as bu,
53458
+ resumeHook as bv,
53459
+ fetchHookToken as bw,
53460
+ cancelRun as bx,
53461
+ recreateRun as by,
53213
53462
  createLucideIcon as c,
53214
53463
  runHealthCheck as d,
53215
53464
  cn as e,
@@ -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-CRmVVsbP.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-CQkIfF6F.js";
3
- import { L as LoaderCircle } from "./loader-circle-BuHkkqyY.js";
4
- import { A as ArrowUpRight } from "./arrow-up-right-DDLzuSl1.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-DLxMuWKz.js";
3
+ import { L as LoaderCircle } from "./loader-circle-Cmjna4Hz.js";
4
+ import { A as ArrowUpRight } from "./arrow-up-right-a32MzRMp.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) {