@workflow/web 5.0.0-beta.1 → 5.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/client/assets/encryption-80GMP4r0.js +26 -0
- package/build/client/assets/entry.client-BWsSsWQm.js +11899 -0
- package/build/client/assets/highlighted-body-B3W2YXNL-DPWdt39H.js +18 -0
- package/build/client/assets/home-OcN-ARTU.js +3992 -0
- package/build/client/assets/index-DQa-BExo.js +9432 -0
- package/build/client/assets/{manifest-2d7ab41e.js → manifest-62352cd9.js} +1 -1
- package/build/client/assets/mermaid-3ZIDBTTL-B9v3aKRl.js +48141 -0
- package/build/client/assets/root-BrnNveEi.css +1 -0
- package/build/client/assets/root-ClRrWHkX.js +690 -0
- package/build/client/assets/run-detail-BdYMODbi.js +6710 -0
- package/build/client/assets/{server-build-CiTtikBY.css → server-build-DKWv59Tp.css} +1 -1
- package/build/client/assets/worker-CqHKTA7D.js +115 -0
- package/build/client/assets/workflow-graph-viewer-BdFIMYrh.js +16175 -0
- package/build/server/assets/{app-DaJqmGT8.js → app-coxrYAYu.js} +1 -1
- package/build/server/assets/{highlighted-body-B3W2YXNL-xowfciga.js → highlighted-body-B3W2YXNL-DhGWas67.js} +2 -2
- package/build/server/assets/{index-CFBIzXaR.js → index-DJ8Yt9MV.js} +30 -29
- package/build/server/assets/{mermaid-3ZIDBTTL-nU8V7hWp.js → mermaid-3ZIDBTTL-DJkW_cc4.js} +3 -3
- package/build/server/assets/{server-build-rhQJXUIP.js → server-build-dCNkWo2d.js} +420 -95
- package/build/server/assets/{token-BZ35B6LQ.js → token-Bi1ru9oe.js} +2 -2
- package/build/server/assets/{token-util-vRsmZMJV.js → token-util-Bwj_Mj31.js} +2 -2
- package/build/server/index.js +1 -1
- package/package.json +6 -6
- package/build/client/assets/encryption-8OvC6eoJ.js +0 -1
- package/build/client/assets/entry.client-BiVEcoV8.js +0 -29
- package/build/client/assets/highlighted-body-B3W2YXNL-epbVCzUZ.js +0 -1
- package/build/client/assets/home-cYqw84jW.js +0 -40
- package/build/client/assets/index-BmZS3y7B.js +0 -59
- package/build/client/assets/mermaid-3ZIDBTTL-CCXSRVd3.js +0 -210
- package/build/client/assets/root-aMfmV5uh.css +0 -1
- package/build/client/assets/root-kDmPgm4u.js +0 -26
- package/build/client/assets/run-detail-B5k2OYOu.js +0 -37
- package/build/client/assets/worker-D-HfgUMl.js +0 -1
- package/build/client/assets/workflow-graph-viewer-B5c_xYyF.js +0 -161
|
@@ -14,7 +14,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
14
14
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
15
15
|
var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
|
|
16
16
|
var _a2, _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, canAdoptWithSpace_fn, canAdopt_fn, canAdoptType_fn, adoptWithSpace_fn, adopt_fn, canUsurpType_fn, canUsurp_fn, usurp_fn, flatten_fn, partsToRegExp_fn, parseGlob_fn, _Minimatch_instances, matchGlobstar_fn, matchGlobStarBodySections_fn, matchOne_fn, _reader, _worldPromise, _Run_instances, lazyWorldPromise_get, _encryptionKeyPromise, _resilientStart, getEncryptionKey_fn, pollReturnValue_fn;
|
|
17
|
-
import { a as requireReact, S as ServerRouter, c as createReadableStreamFromReadable, r as reactExports, g as getDefaultExportFromCjs, R as React, b as ReactExports, w as withComponentProps, d as withErrorBoundaryProps, M as Meta, L as Links, e as ScrollRestoration, f as Scripts, O as Outlet, u as useNavigate, h as useSearchParams, i as Link$1, j as useRouteError, k as isRouteErrorResponse, l as useLocation, m as useParams } from "./app-
|
|
17
|
+
import { a as requireReact, S as ServerRouter, c as createReadableStreamFromReadable, r as reactExports, g as getDefaultExportFromCjs, R as React, b as ReactExports, w as withComponentProps, d as withErrorBoundaryProps, M as Meta, L as Links, e as ScrollRestoration, f as Scripts, O as Outlet, u as useNavigate, h as useSearchParams, i as Link$1, j as useRouteError, k as isRouteErrorResponse, l as useLocation, m as useParams } from "./app-coxrYAYu.js";
|
|
18
18
|
import require$$0$4, { PassThrough } from "node:stream";
|
|
19
19
|
import require$$0 from "util";
|
|
20
20
|
import require$$1 from "crypto";
|
|
@@ -34599,6 +34599,13 @@ async function hydrateDataWithKey(value, revivers, key) {
|
|
|
34599
34599
|
}
|
|
34600
34600
|
const STREAM_ID_PREFIX = "strm_";
|
|
34601
34601
|
const STREAM_REF_TYPE$1 = "__workflow_stream_ref__";
|
|
34602
|
+
const RUN_REF_TYPE$1 = "__workflow_run_ref__";
|
|
34603
|
+
const isRunRef$1 = (value) => {
|
|
34604
|
+
return value !== null && typeof value === "object" && "__type" in value && value.__type === RUN_REF_TYPE$1 && "runId" in value && typeof value.runId === "string";
|
|
34605
|
+
};
|
|
34606
|
+
const serializedRunToRunRef = (value) => {
|
|
34607
|
+
return { __type: RUN_REF_TYPE$1, runId: value.runId };
|
|
34608
|
+
};
|
|
34602
34609
|
const CLASS_INSTANCE_REF_TYPE$1 = "__workflow_class_instance_ref__";
|
|
34603
34610
|
class ClassInstanceRef {
|
|
34604
34611
|
constructor(className, classId, data) {
|
|
@@ -34650,7 +34657,11 @@ const extractClassName = (classId) => {
|
|
|
34650
34657
|
return parts[parts.length - 1] || classId;
|
|
34651
34658
|
};
|
|
34652
34659
|
const serializedInstanceToRef = (value) => {
|
|
34653
|
-
|
|
34660
|
+
const className = extractClassName(value.classId);
|
|
34661
|
+
if (className === "Run" && value.data !== null && typeof value.data === "object" && "runId" in value.data && typeof value.data.runId === "string") {
|
|
34662
|
+
return serializedRunToRunRef(value.data);
|
|
34663
|
+
}
|
|
34664
|
+
return new ClassInstanceRef(className, value.classId, value.data);
|
|
34654
34665
|
};
|
|
34655
34666
|
const serializedClassToString = (value) => {
|
|
34656
34667
|
return `<class:${extractClassName(value.classId)}>`;
|
|
@@ -34771,6 +34782,7 @@ const serializationFormat = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object
|
|
|
34771
34782
|
__proto__: null,
|
|
34772
34783
|
CLASS_INSTANCE_REF_TYPE: CLASS_INSTANCE_REF_TYPE$1,
|
|
34773
34784
|
ClassInstanceRef,
|
|
34785
|
+
RUN_REF_TYPE: RUN_REF_TYPE$1,
|
|
34774
34786
|
STREAM_REF_TYPE: STREAM_REF_TYPE$1,
|
|
34775
34787
|
SerializationFormat: SerializationFormat$1,
|
|
34776
34788
|
decodeFormatPrefix: decodeFormatPrefix$1,
|
|
@@ -34780,9 +34792,11 @@ const serializationFormat = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object
|
|
|
34780
34792
|
hydrateResourceIO: hydrateResourceIO$1,
|
|
34781
34793
|
isEncryptedData,
|
|
34782
34794
|
isExpiredStub,
|
|
34795
|
+
isRunRef: isRunRef$1,
|
|
34783
34796
|
observabilityRevivers,
|
|
34784
34797
|
serializedClassToString,
|
|
34785
34798
|
serializedInstanceToRef,
|
|
34799
|
+
serializedRunToRunRef,
|
|
34786
34800
|
serializedStepFunctionToString,
|
|
34787
34801
|
streamToStreamRef
|
|
34788
34802
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -49174,6 +49188,10 @@ function getWebRevivers() {
|
|
|
49174
49188
|
// react-inspector shows the class name (it reads constructor.name).
|
|
49175
49189
|
Class: (value) => `<class:${extractClassName(value.classId)}>`,
|
|
49176
49190
|
Instance: (value) => {
|
|
49191
|
+
const runRef = serializedInstanceToRef(value);
|
|
49192
|
+
if (isRunRef$1(runRef)) {
|
|
49193
|
+
return runRef;
|
|
49194
|
+
}
|
|
49177
49195
|
const className = extractClassName(value.classId);
|
|
49178
49196
|
const data = value.data;
|
|
49179
49197
|
const props = data && typeof data === "object" ? { ...data } : { value: data };
|
|
@@ -49285,6 +49303,25 @@ async function hydrateResourceIOWithKey(resource, key) {
|
|
|
49285
49303
|
}
|
|
49286
49304
|
return result;
|
|
49287
49305
|
}
|
|
49306
|
+
function hasEncryptedFields(resource) {
|
|
49307
|
+
if (!resource || typeof resource !== "object")
|
|
49308
|
+
return false;
|
|
49309
|
+
const r2 = resource;
|
|
49310
|
+
for (const key of ["input", "output", "metadata", "error"]) {
|
|
49311
|
+
if (isEncryptedMarker(r2[key]))
|
|
49312
|
+
return true;
|
|
49313
|
+
}
|
|
49314
|
+
if (r2.eventData && typeof r2.eventData === "object") {
|
|
49315
|
+
const eventType = typeof r2.eventType === "string" ? r2.eventType : "";
|
|
49316
|
+
const refKeys = EVENT_DATA_REF_FIELDS[eventType] ?? [];
|
|
49317
|
+
const ed = r2.eventData;
|
|
49318
|
+
for (const key of refKeys) {
|
|
49319
|
+
if (key in ed && isEncryptedMarker(ed[key]))
|
|
49320
|
+
return true;
|
|
49321
|
+
}
|
|
49322
|
+
}
|
|
49323
|
+
return false;
|
|
49324
|
+
}
|
|
49288
49325
|
const KEYFRAMES = `@keyframes wf-spinner-fade{0%{opacity:1}100%{opacity:.15}}`;
|
|
49289
49326
|
function Spinner({ size: size2 = 14, color: color5 }) {
|
|
49290
49327
|
const config2 = size2 <= 12 ? {
|
|
@@ -50231,32 +50268,76 @@ const inspectorThemeDark = {
|
|
|
50231
50268
|
};
|
|
50232
50269
|
const STREAM_REF_TYPE = "__workflow_stream_ref__";
|
|
50233
50270
|
const CLASS_INSTANCE_REF_TYPE = "__workflow_class_instance_ref__";
|
|
50271
|
+
const RUN_REF_TYPE = "__workflow_run_ref__";
|
|
50234
50272
|
function isStreamRef(value) {
|
|
50235
|
-
|
|
50273
|
+
if (value === null || typeof value !== "object")
|
|
50274
|
+
return false;
|
|
50275
|
+
const desc = Object.getOwnPropertyDescriptor(value, "__type");
|
|
50276
|
+
return (desc == null ? void 0 : desc.value) === STREAM_REF_TYPE;
|
|
50277
|
+
}
|
|
50278
|
+
function isRunRef(value) {
|
|
50279
|
+
if (value === null || typeof value !== "object")
|
|
50280
|
+
return false;
|
|
50281
|
+
const desc = Object.getOwnPropertyDescriptor(value, "__type");
|
|
50282
|
+
return (desc == null ? void 0 : desc.value) === RUN_REF_TYPE;
|
|
50236
50283
|
}
|
|
50237
50284
|
function isClassInstanceRef(value) {
|
|
50238
50285
|
return value !== null && typeof value === "object" && "__type" in value && value.__type === CLASS_INSTANCE_REF_TYPE;
|
|
50239
50286
|
}
|
|
50240
50287
|
const StreamClickContext = reactExports.createContext(void 0);
|
|
50288
|
+
const DecryptClickContext = reactExports.createContext(void 0);
|
|
50289
|
+
const RunClickContext = reactExports.createContext(void 0);
|
|
50290
|
+
function EncryptedInlineLabel() {
|
|
50291
|
+
const ctx = reactExports.useContext(DecryptClickContext);
|
|
50292
|
+
if (ctx) {
|
|
50293
|
+
return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[11px] cursor-pointer", style: {
|
|
50294
|
+
backgroundColor: "var(--ds-gray-100)",
|
|
50295
|
+
color: "var(--ds-gray-700)",
|
|
50296
|
+
border: "1px solid var(--ds-gray-400)",
|
|
50297
|
+
fontStyle: "italic",
|
|
50298
|
+
opacity: ctx.isDecrypting ? 0.6 : 1
|
|
50299
|
+
}, disabled: ctx.isDecrypting, onClick: (e) => {
|
|
50300
|
+
e.stopPropagation();
|
|
50301
|
+
ctx.onDecrypt();
|
|
50302
|
+
}, title: "Click to decrypt", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 12 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: { display: "inline", flexShrink: 0 } }), jsxRuntimeExports.jsx("span", { children: ctx.isDecrypting ? "Decrypting…" : "Decrypt" })] });
|
|
50303
|
+
}
|
|
50304
|
+
return jsxRuntimeExports.jsxs("span", { style: { color: "var(--ds-gray-600)", fontStyle: "italic" }, children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: {
|
|
50305
|
+
display: "inline",
|
|
50306
|
+
verticalAlign: "middle",
|
|
50307
|
+
marginRight: "3px",
|
|
50308
|
+
marginTop: "-1px"
|
|
50309
|
+
} }), "Encrypted"] });
|
|
50310
|
+
}
|
|
50241
50311
|
function StreamRefInline({ streamRef }) {
|
|
50242
50312
|
const onStreamClick = reactExports.useContext(StreamClickContext);
|
|
50243
|
-
|
|
50244
|
-
|
|
50245
|
-
|
|
50313
|
+
const [hovered, setHovered] = reactExports.useState(false);
|
|
50314
|
+
return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono cursor-pointer underline decoration-transparent transition-colors", style: {
|
|
50315
|
+
backgroundColor: hovered ? "var(--ds-blue-200)" : "var(--ds-blue-100)",
|
|
50316
|
+
color: "var(--ds-blue-900)",
|
|
50246
50317
|
border: "1px solid var(--ds-blue-300)"
|
|
50247
|
-
},
|
|
50318
|
+
}, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), onClick: (e) => {
|
|
50319
|
+
e.stopPropagation();
|
|
50320
|
+
onStreamClick == null ? void 0 : onStreamClick(streamRef.streamId);
|
|
50321
|
+
}, title: `View stream: ${streamRef.streamId}`, children: [jsxRuntimeExports.jsx("span", { children: "📡" }), jsxRuntimeExports.jsx("span", { children: streamRef.streamId })] });
|
|
50322
|
+
}
|
|
50323
|
+
function RunRefInline({ runRef }) {
|
|
50324
|
+
const onRunClick = reactExports.useContext(RunClickContext);
|
|
50325
|
+
const [hovered, setHovered] = reactExports.useState(false);
|
|
50326
|
+
return jsxRuntimeExports.jsx("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono cursor-pointer underline decoration-transparent transition-colors", style: {
|
|
50327
|
+
backgroundColor: hovered ? "var(--ds-purple-200)" : "var(--ds-purple-100)",
|
|
50328
|
+
color: "var(--ds-purple-900)",
|
|
50329
|
+
border: "1px solid var(--ds-purple-300)"
|
|
50330
|
+
}, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), onClick: (e) => {
|
|
50331
|
+
e.stopPropagation();
|
|
50332
|
+
onRunClick == null ? void 0 : onRunClick(runRef.runId);
|
|
50333
|
+
}, title: `View run: ${runRef.runId}`, children: jsxRuntimeExports.jsx("span", { children: runRef.runId }) });
|
|
50248
50334
|
}
|
|
50249
50335
|
const ExtendedThemeContext = reactExports.createContext(inspectorThemeExtendedLight);
|
|
50250
50336
|
function NodeRenderer$1({ depth, name: name2, data, isNonenumerable }) {
|
|
50251
50337
|
var _a3;
|
|
50252
50338
|
const extendedTheme = reactExports.useContext(ExtendedThemeContext);
|
|
50253
50339
|
if (data !== null && typeof data === "object" && ((_a3 = data.constructor) == null ? void 0 : _a3.name) === ENCRYPTED_DISPLAY_NAME) {
|
|
50254
|
-
const label = jsxRuntimeExports.
|
|
50255
|
-
display: "inline",
|
|
50256
|
-
verticalAlign: "middle",
|
|
50257
|
-
marginRight: "3px",
|
|
50258
|
-
marginTop: "-1px"
|
|
50259
|
-
} }), "Encrypted"] });
|
|
50340
|
+
const label = jsxRuntimeExports.jsx(EncryptedInlineLabel, {});
|
|
50260
50341
|
if (depth === 0) {
|
|
50261
50342
|
return label;
|
|
50262
50343
|
}
|
|
@@ -50265,6 +50346,9 @@ function NodeRenderer$1({ depth, name: name2, data, isNonenumerable }) {
|
|
|
50265
50346
|
if (isStreamRef(data)) {
|
|
50266
50347
|
return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx(StreamRefInline, { streamRef: data })] });
|
|
50267
50348
|
}
|
|
50349
|
+
if (isRunRef(data)) {
|
|
50350
|
+
return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx(RunRefInline, { runRef: data })] });
|
|
50351
|
+
}
|
|
50268
50352
|
if (isClassInstanceRef(data)) {
|
|
50269
50353
|
if (depth === 0) {
|
|
50270
50354
|
return jsxRuntimeExports.jsx(ObjectRootLabel, { name: data.className, data: data.data });
|
|
@@ -50283,8 +50367,32 @@ function NodeRenderer$1({ depth, name: name2, data, isNonenumerable }) {
|
|
|
50283
50367
|
}
|
|
50284
50368
|
return jsxRuntimeExports.jsx(ObjectLabel, { name: name2, data, isNonenumerable });
|
|
50285
50369
|
}
|
|
50286
|
-
function
|
|
50287
|
-
const
|
|
50370
|
+
function makeOpaqueRef(ref) {
|
|
50371
|
+
const opaque = /* @__PURE__ */ Object.create(null);
|
|
50372
|
+
for (const [key, value] of Object.entries(ref)) {
|
|
50373
|
+
Object.defineProperty(opaque, key, { value, enumerable: false });
|
|
50374
|
+
}
|
|
50375
|
+
return opaque;
|
|
50376
|
+
}
|
|
50377
|
+
function collapseRefs(data) {
|
|
50378
|
+
if (data === null || typeof data !== "object")
|
|
50379
|
+
return data;
|
|
50380
|
+
if (isRunRef(data) || isStreamRef(data))
|
|
50381
|
+
return makeOpaqueRef(data);
|
|
50382
|
+
if (Array.isArray(data))
|
|
50383
|
+
return data.map(collapseRefs);
|
|
50384
|
+
const proto2 = Object.getPrototypeOf(data);
|
|
50385
|
+
if (proto2 !== Object.prototype && proto2 !== null)
|
|
50386
|
+
return data;
|
|
50387
|
+
const result = {};
|
|
50388
|
+
for (const [key, value] of Object.entries(data)) {
|
|
50389
|
+
result[key] = collapseRefs(value);
|
|
50390
|
+
}
|
|
50391
|
+
return result;
|
|
50392
|
+
}
|
|
50393
|
+
function DataInspector({ data, expandLevel = 2, name: name2, onStreamClick, onRunClick, onDecrypt, isDecrypting = false }) {
|
|
50394
|
+
const collapsedData = reactExports.useMemo(() => collapseRefs(data), [data]);
|
|
50395
|
+
const stableData = useStableInspectorData(collapsedData);
|
|
50288
50396
|
const [initialExpandLevel, setInitialExpandLevel] = reactExports.useState(expandLevel);
|
|
50289
50397
|
const isDark = useDarkMode();
|
|
50290
50398
|
const extendedTheme = isDark ? inspectorThemeExtendedDark : inspectorThemeExtendedLight;
|
|
@@ -50300,10 +50408,17 @@ function DataInspector({ data, expandLevel = 2, name: name2, onStreamClick }) {
|
|
|
50300
50408
|
expandLevel: initialExpandLevel,
|
|
50301
50409
|
nodeRenderer: NodeRenderer$1
|
|
50302
50410
|
}) });
|
|
50411
|
+
let wrapped = content2;
|
|
50303
50412
|
if (onStreamClick) {
|
|
50304
|
-
|
|
50413
|
+
wrapped = jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: wrapped });
|
|
50305
50414
|
}
|
|
50306
|
-
|
|
50415
|
+
if (onRunClick) {
|
|
50416
|
+
wrapped = jsxRuntimeExports.jsx(RunClickContext.Provider, { value: onRunClick, children: wrapped });
|
|
50417
|
+
}
|
|
50418
|
+
if (onDecrypt) {
|
|
50419
|
+
wrapped = jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: { onDecrypt, isDecrypting }, children: wrapped });
|
|
50420
|
+
}
|
|
50421
|
+
return wrapped;
|
|
50307
50422
|
}
|
|
50308
50423
|
function useStableInspectorData(next2) {
|
|
50309
50424
|
const previousRef = reactExports.useRef(next2);
|
|
@@ -52156,7 +52271,7 @@ function EventRow({ event, index: index2, isFirst, isLast, isExpanded, onToggleE
|
|
|
52156
52271
|
color: "var(--ds-red-900)"
|
|
52157
52272
|
}, children: loadError }) : isLoading || loadedEventData === null && !hasAttemptedLoad && event.correlationId ? jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2 p-3", children: [jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: "75%" } }), jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: "50%" } }), jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3", style: { width: "60%" } })] }) : jsxRuntimeExports.jsx("div", { className: "p-2 text-xs", style: { color: "var(--ds-gray-900)" }, children: "No data" })] })] })] });
|
|
52158
52273
|
}
|
|
52159
|
-
function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents = false, isLoadingMoreEvents = false, onLoadMoreEvents, encryptionKey, isLoading = false, sortOrder: sortOrderProp, onSortOrderChange, onDecrypt, isDecrypting = false }) {
|
|
52274
|
+
function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents = false, isLoadingMoreEvents = false, onLoadMoreEvents, encryptionKey, isLoading = false, sortOrder: sortOrderProp, onSortOrderChange, onDecrypt, isDecrypting = false, hasEncryptedData: hasEncryptedDataProp = false }) {
|
|
52160
52275
|
const [internalSortOrder, setInternalSortOrder] = reactExports.useState("asc");
|
|
52161
52276
|
const effectiveSortOrder = sortOrderProp ?? internalSortOrder;
|
|
52162
52277
|
const handleSortOrderChange = reactExports.useCallback((order2) => {
|
|
@@ -52186,7 +52301,7 @@ function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents =
|
|
|
52186
52301
|
const handleEncryptedDataDetected = reactExports.useCallback(() => {
|
|
52187
52302
|
setFoundEncryptedInLazyData(true);
|
|
52188
52303
|
}, []);
|
|
52189
|
-
const hasEncryptedData = hasEncryptedInlineData || foundEncryptedInLazyData;
|
|
52304
|
+
const hasEncryptedData = hasEncryptedDataProp || hasEncryptedInlineData || foundEncryptedInLazyData;
|
|
52190
52305
|
const { correlationNameMap, workflowName } = reactExports.useMemo(() => buildNameMaps(events2 ?? null, run ?? null), [events2, run]);
|
|
52191
52306
|
const durationMap = reactExports.useMemo(() => buildDurationMap(sortedEvents2), [sortedEvents2]);
|
|
52192
52307
|
const [selectedGroupKey, setSelectedGroupKey] = reactExports.useState(void 0);
|
|
@@ -52319,7 +52434,7 @@ function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents =
|
|
|
52319
52434
|
if (!isLoading && (!events2 || events2.length === 0)) {
|
|
52320
52435
|
return jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center h-full text-sm", style: { color: "var(--ds-gray-700)" }, children: "No events found" });
|
|
52321
52436
|
}
|
|
52322
|
-
return jsxRuntimeExports.jsxs("div", { className: "h-full flex flex-col overflow-hidden", children: [jsxRuntimeExports.jsx("style", { children: `@keyframes workflow-dot-pulse{0%{transform:scale(1);opacity:.7}70%,100%{transform:scale(2.2);opacity:0}}` }), jsxRuntimeExports.jsxs("div", { style: {
|
|
52437
|
+
return jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: onDecrypt ? { onDecrypt, isDecrypting } : void 0, children: jsxRuntimeExports.jsxs("div", { className: "h-full flex flex-col overflow-hidden", children: [jsxRuntimeExports.jsx("style", { children: `@keyframes workflow-dot-pulse{0%{transform:scale(1);opacity:.7}70%,100%{transform:scale(2.2);opacity:0}}` }), jsxRuntimeExports.jsxs("div", { style: {
|
|
52323
52438
|
padding: 6,
|
|
52324
52439
|
backgroundColor: "var(--ds-background-100)",
|
|
52325
52440
|
display: "flex",
|
|
@@ -52368,7 +52483,7 @@ function EventListView({ events: events2, run, onLoadEventData, hasMoreEvents =
|
|
|
52368
52483
|
borderColor: "var(--ds-gray-alpha-200)",
|
|
52369
52484
|
color: "var(--ds-gray-900)",
|
|
52370
52485
|
backgroundColor: "var(--ds-background-100)"
|
|
52371
|
-
}, children: [jsxRuntimeExports.jsxs("span", { children: [sortedEvents2.length, " event", sortedEvents2.length !== 1 ? "s" : "", " loaded"] }), hasMoreEvents && jsxRuntimeExports.jsx("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto", children: jsxRuntimeExports.jsx(LoadMoreButton, { loading: isLoadingMoreEvents, onClick: () => void (onLoadMoreEvents == null ? void 0 : onLoadMoreEvents()) }) }) })] })] });
|
|
52486
|
+
}, children: [jsxRuntimeExports.jsxs("span", { children: [sortedEvents2.length, " event", sortedEvents2.length !== 1 ? "s" : "", " loaded"] }), hasMoreEvents && jsxRuntimeExports.jsx("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto", children: jsxRuntimeExports.jsx(LoadMoreButton, { loading: isLoadingMoreEvents, onClick: () => void (onLoadMoreEvents == null ? void 0 : onLoadMoreEvents()) }) }) })] })] }) });
|
|
52372
52487
|
}
|
|
52373
52488
|
function ResolveHookModal({ isOpen, onClose, onSubmit, isSubmitting = false }) {
|
|
52374
52489
|
var _a3;
|
|
@@ -79245,7 +79360,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
|
|
|
79245
79360
|
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 });
|
|
79246
79361
|
var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
|
|
79247
79362
|
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 }) });
|
|
79248
|
-
var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-
|
|
79363
|
+
var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-DhGWas67.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
|
|
79249
79364
|
let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
|
|
79250
79365
|
`).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
|
|
79251
79366
|
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 }) })] }) });
|
|
@@ -79567,7 +79682,7 @@ var Dt = ({ children: e, className: t, onDownload: o, onError: n }) => {
|
|
|
79567
79682
|
}, []), 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] });
|
|
79568
79683
|
};
|
|
79569
79684
|
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 }) })] });
|
|
79570
|
-
var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-
|
|
79685
|
+
var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-DJkW_cc4.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
|
|
79571
79686
|
function ke(e, t) {
|
|
79572
79687
|
if (!(e != null && e.position || t != null && t.position)) return true;
|
|
79573
79688
|
if (!(e != null && e.position && (t != null && t.position))) return false;
|
|
@@ -80196,7 +80311,16 @@ function ConversationWithTabs({ conversation, args }) {
|
|
|
80196
80311
|
return jsxRuntimeExports.jsx(DetailCard, { summary: `Input (${conversation.length} messages)`, children: jsxRuntimeExports.jsx(TabbedContainer, { tabs: conversationTabs, activeTab, onTabChange: setActiveTab, ariaLabel: "Conversation view", children: activeTab === "conversation" ? jsxRuntimeExports.jsx(ConversationView, { messages: conversation }) : jsxRuntimeExports.jsx("div", { className: "p-3", children: Array.isArray(args) ? args.map((v2, i) => jsxRuntimeExports.jsx("div", { className: "mt-2 first:mt-0", children: JsonBlock(v2) }, i)) : JsonBlock(args) }) }) });
|
|
80197
80312
|
}
|
|
80198
80313
|
function EncryptedFieldBlock() {
|
|
80199
|
-
|
|
80314
|
+
const ctx = reactExports.useContext(DecryptClickContext);
|
|
80315
|
+
if (ctx) {
|
|
80316
|
+
return jsxRuntimeExports.jsxs("button", { type: "button", onClick: ctx.onDecrypt, disabled: ctx.isDecrypting, className: "flex w-full items-center justify-center gap-1.5 rounded-md border px-3 py-2 text-xs cursor-pointer transition-colors", style: {
|
|
80317
|
+
borderColor: "var(--ds-gray-400)",
|
|
80318
|
+
backgroundColor: "var(--ds-gray-100)",
|
|
80319
|
+
color: "var(--ds-gray-700)",
|
|
80320
|
+
opacity: ctx.isDecrypting ? 0.6 : 1
|
|
80321
|
+
}, title: "Click to decrypt", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 12 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), jsxRuntimeExports.jsx("span", { className: "font-medium", children: ctx.isDecrypting ? "Decrypting…" : "Decrypt" })] });
|
|
80322
|
+
}
|
|
80323
|
+
return jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-center gap-1.5 rounded-md border px-3 py-2 text-xs", style: {
|
|
80200
80324
|
borderColor: "var(--ds-gray-300)",
|
|
80201
80325
|
backgroundColor: "var(--ds-gray-100)",
|
|
80202
80326
|
color: "var(--ds-gray-700)"
|
|
@@ -80334,7 +80458,7 @@ const attributeToDisplayFn = {
|
|
|
80334
80458
|
moduleSpecifier: (value) => getModuleSpecifierFromName(value),
|
|
80335
80459
|
stepName: (value) => {
|
|
80336
80460
|
var _a3;
|
|
80337
|
-
return ((_a3 = parseStepName(String(value))) == null ? void 0 : _a3.shortName) ??
|
|
80461
|
+
return ((_a3 = parseStepName(String(value))) == null ? void 0 : _a3.shortName) ?? String(value);
|
|
80338
80462
|
},
|
|
80339
80463
|
// IDs
|
|
80340
80464
|
runId: (value) => String(value),
|
|
@@ -80471,7 +80595,7 @@ const AttributeBlock = ({ attribute, value, isLoading, inline = false, context }
|
|
|
80471
80595
|
}
|
|
80472
80596
|
return jsxRuntimeExports.jsxs("div", { className: "relative", children: [typeof isLoading === "boolean" && isLoading && jsxRuntimeExports.jsx("div", { className: "absolute top-9 right-4", children: jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2", style: { borderColor: "var(--ds-gray-900)" } }) }), jsxRuntimeExports.jsxs("div", { className: `my-2 flex flex-col ${attribute === "input" || attribute === "output" || attribute === "error" ? "gap-2 my-3.5" : "gap-0"}`, children: [jsxRuntimeExports.jsx("span", { className: `${attribute === "input" || attribute === "output" || attribute === "error" ? "text-base" : "text-xs"} font-medium first-letter:uppercase`, style: { color: "var(--ds-gray-700)" }, children: attribute }), jsxRuntimeExports.jsx("span", { className: "text-xs", style: { color: "var(--ds-gray-1000)" }, children: displayValue })] }, attribute)] });
|
|
80473
80597
|
};
|
|
80474
|
-
const AttributePanel = ({ data, moduleSpecifier, isLoading, error: error2, expiredAt, onStreamClick, resource }) => {
|
|
80598
|
+
const AttributePanel = ({ data, moduleSpecifier, isLoading, error: error2, expiredAt, onStreamClick, onRunClick, onDecrypt, isDecrypting = false, resource }) => {
|
|
80475
80599
|
const toast2 = useToast();
|
|
80476
80600
|
const displayData = reactExports.useMemo(() => {
|
|
80477
80601
|
const result = { ...data };
|
|
@@ -80539,7 +80663,7 @@ const AttributePanel = ({ data, moduleSpecifier, isLoading, error: error2, expir
|
|
|
80539
80663
|
toast2.error("Failed to copy moduleSpecifier");
|
|
80540
80664
|
});
|
|
80541
80665
|
}, []);
|
|
80542
|
-
return jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: jsxRuntimeExports.jsxs("div", { children: [visibleBasicAttributes.length > 0 && jsxRuntimeExports.jsxs("div", { className: "mb-3 flex flex-col overflow-hidden rounded-lg border", style: {
|
|
80666
|
+
return jsxRuntimeExports.jsx(RunClickContext.Provider, { value: onRunClick, children: jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: onDecrypt ? { onDecrypt, isDecrypting } : void 0, children: jsxRuntimeExports.jsxs("div", { children: [visibleBasicAttributes.length > 0 && jsxRuntimeExports.jsxs("div", { className: "mb-3 flex flex-col overflow-hidden rounded-lg border", style: {
|
|
80543
80667
|
borderColor: "var(--ds-gray-300)"
|
|
80544
80668
|
}, children: [orderedBasicAttributes.map((attribute, index2) => {
|
|
80545
80669
|
var _a3;
|
|
@@ -80555,7 +80679,7 @@ const AttributePanel = ({ data, moduleSpecifier, isLoading, error: error2, expir
|
|
|
80555
80679
|
border: "none",
|
|
80556
80680
|
padding: 0
|
|
80557
80681
|
}, title: moduleSpecifierValue, onClick: () => handleCopyModuleSpecifier(moduleSpecifierValue), children: moduleSpecifierValue }) : jsxRuntimeExports.jsx("span", { className: "min-w-0 max-w-[70%] truncate text-right text-[13px] font-mono", style: { color: "var(--ds-gray-1000)" }, children: displayValue })] }), showDivider ? jsxRuntimeExports.jsx("div", { className: "mx-2.5 border-b", style: { borderColor: "var(--ds-gray-300)" } }) : null] }, attribute);
|
|
80558
|
-
}), isLoading && resource === "sleep" && !displayData.resumeAt && jsxRuntimeExports.jsx("div", { className: "py-1", children: jsxRuntimeExports.jsxs("div", { className: "flex min-h-[32px] items-center justify-between gap-4 rounded-sm px-2.5 py-1", children: [jsxRuntimeExports.jsx("span", { className: "text-[14px] first-letter:uppercase", style: { color: "var(--ds-gray-700)" }, children: "resumeAt" }), jsxRuntimeExports.jsx(Skeleton$2, { className: "h-4 w-[55%]" })] }) })] }), error2 ? jsxRuntimeExports.jsx(ErrorCard, { title: "Failed to load resource details", details: error2.message, className: "my-4" }) : hasExpired ? jsxRuntimeExports.jsx(ExpiredDataMessage, {}) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: resolvedAttributes.map((attribute) => jsxRuntimeExports.jsx(AttributeBlock, { isLoading, attribute, value: displayData[attribute], context: displayContext }, attribute)) })] }) });
|
|
80682
|
+
}), isLoading && resource === "sleep" && !displayData.resumeAt && jsxRuntimeExports.jsx("div", { className: "py-1", children: jsxRuntimeExports.jsxs("div", { className: "flex min-h-[32px] items-center justify-between gap-4 rounded-sm px-2.5 py-1", children: [jsxRuntimeExports.jsx("span", { className: "text-[14px] first-letter:uppercase", style: { color: "var(--ds-gray-700)" }, children: "resumeAt" }), jsxRuntimeExports.jsx(Skeleton$2, { className: "h-4 w-[55%]" })] }) })] }), error2 ? jsxRuntimeExports.jsx(ErrorCard, { title: "Failed to load resource details", details: error2.message, className: "my-4" }) : hasExpired ? jsxRuntimeExports.jsx(ExpiredDataMessage, {}) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: resolvedAttributes.map((attribute) => jsxRuntimeExports.jsx(AttributeBlock, { isLoading, attribute, value: displayData[attribute], context: displayContext }, attribute)) })] }) }) }) });
|
|
80559
80683
|
};
|
|
80560
80684
|
const ERROR_EVENT_TYPES = /* @__PURE__ */ new Set(["step_failed", "step_retrying"]);
|
|
80561
80685
|
const DATA_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
@@ -80664,7 +80788,7 @@ function isWorkflowRun(data) {
|
|
|
80664
80788
|
function isHook(data) {
|
|
80665
80789
|
return data !== null && typeof data === "object" && "hookId" in data;
|
|
80666
80790
|
}
|
|
80667
|
-
function EntityDetailPanel({ run, onStreamClick, spanDetailData, spanDetailError, spanDetailLoading, onSpanSelect, onWakeUpSleep, onLoadEventData, onResolveHook, encryptionKey, onDecrypt, isDecrypting = false, selectedSpan }) {
|
|
80791
|
+
function EntityDetailPanel({ run, onStreamClick, onRunClick, spanDetailData, spanDetailError, spanDetailLoading, onSpanSelect, onWakeUpSleep, onLoadEventData, onResolveHook, encryptionKey, onDecrypt, isDecrypting = false, selectedSpan, hasEncryptedData = false }) {
|
|
80668
80792
|
const toast2 = useToast();
|
|
80669
80793
|
const [stoppingSleep, setStoppingSleep] = reactExports.useState(false);
|
|
80670
80794
|
const [showResolveHookModal, setShowResolveHookModal] = reactExports.useState(false);
|
|
@@ -80742,7 +80866,7 @@ function EntityDetailPanel({ run, onStreamClick, spanDetailData, spanDetailError
|
|
|
80742
80866
|
]);
|
|
80743
80867
|
const error2 = spanDetailError ?? void 0;
|
|
80744
80868
|
const loading = spanDetailLoading ?? false;
|
|
80745
|
-
const
|
|
80869
|
+
const hasEncryptedFields2 = reactExports.useMemo(() => {
|
|
80746
80870
|
if (!spanDetailData)
|
|
80747
80871
|
return false;
|
|
80748
80872
|
const d2 = spanDetailData;
|
|
@@ -80860,7 +80984,7 @@ function EntityDetailPanel({ run, onStreamClick, spanDetailData, spanDetailError
|
|
|
80860
80984
|
backgroundColor: "var(--ds-background-100)"
|
|
80861
80985
|
}, children: resourceLabel }), jsxRuntimeExports.jsx("span", { className: "text-[13px]", style: {
|
|
80862
80986
|
color: run.completedAt ? "var(--ds-gray-700)" : "var(--ds-green-800)"
|
|
80863
|
-
}, children: runStateLabel })] }), jsxRuntimeExports.jsx("p", { className: "mt-1 truncate font-mono text-[13px]", style: { color: "var(--ds-gray-700)" }, title: resourceId, children: resourceId })] }), (
|
|
80987
|
+
}, children: runStateLabel })] }), jsxRuntimeExports.jsx("p", { className: "mt-1 truncate font-mono text-[13px]", style: { color: "var(--ds-gray-700)" }, title: resourceId, children: resourceId })] }), (hasEncryptedFields2 || hasEncryptedData || encryptionKey) && onDecrypt && jsxRuntimeExports.jsx(DecryptButton, { decrypted: !!encryptionKey, loading: isDecrypting, onClick: onDecrypt })] }) }), jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: onDecrypt ? { onDecrypt, isDecrypting } : void 0, children: jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto px-3 pt-3 pb-8", children: [hasPendingActions && jsxRuntimeExports.jsxs("div", { className: "mb-4 rounded-lg border p-2", style: {
|
|
80864
80988
|
borderColor: "var(--ds-gray-300)",
|
|
80865
80989
|
backgroundColor: "var(--ds-gray-100)"
|
|
80866
80990
|
}, children: [jsxRuntimeExports.jsx("p", { className: "mb-2 px-1 text-[13px] font-medium uppercase tracking-wide", style: { color: "var(--ds-gray-700)" }, children: "Actions" }), jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [resource === "sleep" && canWakeUp && jsxRuntimeExports.jsxs("button", { type: "button", onClick: handleWakeUp, disabled: stoppingSleep, className: clsx("flex items-center justify-center gap-2 rounded-md px-3 py-2 text-sm font-medium", "disabled:opacity-50 disabled:cursor-not-allowed transition-colors", stoppingSleep ? "opacity-50 cursor-not-allowed" : "cursor-pointer"), style: {
|
|
@@ -80869,7 +80993,7 @@ function EntityDetailPanel({ run, onStreamClick, spanDetailData, spanDetailError
|
|
|
80869
80993
|
}, children: [jsxRuntimeExports.jsx(Zap, { className: "h-4 w-4" }), stoppingSleep ? "Waking up..." : "Wake Up Sleep"] }), resource === "hook" && canResolveHook && jsxRuntimeExports.jsxs("button", { type: "button", onClick: () => setShowResolveHookModal(true), disabled: resolvingHook, className: clsx("flex items-center justify-center gap-2 rounded-md px-3 py-2 text-sm font-medium", "disabled:opacity-50 disabled:cursor-not-allowed transition-colors", resolvingHook ? "opacity-50 cursor-not-allowed" : "cursor-pointer"), style: {
|
|
80870
80994
|
background: "var(--ds-gray-1000)",
|
|
80871
80995
|
color: "var(--ds-background-100)"
|
|
80872
|
-
}, children: [jsxRuntimeExports.jsx(Send, { className: "h-4 w-4" }), "Resolve Hook"] })] })] }), jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [jsxRuntimeExports.jsxs("section", { children: [jsxRuntimeExports.jsx("h3", { className: "mb-2 text-[13px] font-medium uppercase tracking-wide", style: { color: "var(--ds-gray-700)" }, children: "Details" }), jsxRuntimeExports.jsx(AttributePanel, { data: displayData, moduleSpecifier, expiredAt: run.expiredAt, isLoading: loading, error: error2 ?? void 0, onStreamClick, resource })] }), resource !== "run" && rawEvents && jsxRuntimeExports.jsx("section", { children: jsxRuntimeExports.jsx(EventsList, { events: rawEvents, onLoadEventData, encryptionKey }) })] })] }), jsxRuntimeExports.jsx(ResolveHookModal, { isOpen: showResolveHookModal, onClose: () => setShowResolveHookModal(false), onSubmit: handleResolveHook, isSubmitting: resolvingHook })] });
|
|
80996
|
+
}, children: [jsxRuntimeExports.jsx(Send, { className: "h-4 w-4" }), "Resolve Hook"] })] })] }), jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [jsxRuntimeExports.jsxs("section", { children: [jsxRuntimeExports.jsx("h3", { className: "mb-2 text-[13px] font-medium uppercase tracking-wide", style: { color: "var(--ds-gray-700)" }, children: "Details" }), jsxRuntimeExports.jsx(AttributePanel, { data: displayData, moduleSpecifier, expiredAt: run.expiredAt, isLoading: loading, error: error2 ?? void 0, onStreamClick, onRunClick, onDecrypt, isDecrypting, resource })] }), resource !== "run" && rawEvents && jsxRuntimeExports.jsx("section", { children: jsxRuntimeExports.jsx(EventsList, { events: rawEvents, onLoadEventData, encryptionKey }) })] })] }) }), jsxRuntimeExports.jsx(ResolveHookModal, { isOpen: showResolveHookModal, onClose: () => setShowResolveHookModal(false), onSubmit: handleResolveHook, isSubmitting: resolvingHook })] });
|
|
80873
80997
|
}
|
|
80874
80998
|
const SEARCH_HEIGHT = 40;
|
|
80875
80999
|
const SEARCH_GAP = 8;
|
|
@@ -84164,7 +84288,7 @@ function stepToSpan(stepEvents, maxEndTime) {
|
|
|
84164
84288
|
}
|
|
84165
84289
|
return {
|
|
84166
84290
|
spanId: String(step.stepId),
|
|
84167
|
-
name: (parsedName == null ? void 0 : parsedName.shortName) ??
|
|
84291
|
+
name: (parsedName == null ? void 0 : parsedName.shortName) ?? String(step.stepName),
|
|
84168
84292
|
kind: 1,
|
|
84169
84293
|
// INTERNAL span kind
|
|
84170
84294
|
resource,
|
|
@@ -84774,7 +84898,7 @@ function TraceViewerFooter({ hasMore, isLive, isInitialLoading }) {
|
|
|
84774
84898
|
}
|
|
84775
84899
|
return jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center py-3 text-xs", style: style2, children: "End of run" });
|
|
84776
84900
|
}
|
|
84777
|
-
const WorkflowTraceViewer = ({ run, events: events2, isLoading, error: error2, spanDetailData, spanDetailLoading, spanDetailError, onWakeUpSleep, onResolveHook, onCancelRun, onStreamClick, onSpanSelect, onLoadEventData, onLoadMoreSpans, hasMoreSpans = false, isLoadingMoreSpans = false, encryptionKey, onDecrypt, isDecrypting = false }) => {
|
|
84901
|
+
const WorkflowTraceViewer = ({ run, events: events2, isLoading, error: error2, spanDetailData, spanDetailLoading, spanDetailError, onWakeUpSleep, onResolveHook, onCancelRun, onStreamClick, onRunClick, onSpanSelect, onLoadEventData, onLoadMoreSpans, hasMoreSpans = false, isLoadingMoreSpans = false, encryptionKey, onDecrypt, isDecrypting = false, hasEncryptedData = false }) => {
|
|
84778
84902
|
const toast2 = useToast();
|
|
84779
84903
|
const [selectedSpan, setSelectedSpan] = reactExports.useState(null);
|
|
84780
84904
|
const [panelWidth, setPanelWidth] = reactExports.useState(DEFAULT_PANEL_WIDTH);
|
|
@@ -84831,6 +84955,10 @@ const WorkflowTraceViewer = ({ run, events: events2, isLoading, error: error2, s
|
|
|
84831
84955
|
};
|
|
84832
84956
|
});
|
|
84833
84957
|
}, [events2, selectedSpan == null ? void 0 : selectedSpan.spanId]);
|
|
84958
|
+
reactExports.useEffect(() => {
|
|
84959
|
+
setSelectedSpan(null);
|
|
84960
|
+
setDeselectTrigger((n) => n + 1);
|
|
84961
|
+
}, [run == null ? void 0 : run.runId]);
|
|
84834
84962
|
const handleClose = reactExports.useCallback(() => {
|
|
84835
84963
|
setSelectedSpan(null);
|
|
84836
84964
|
setDeselectTrigger((n) => n + 1);
|
|
@@ -84945,7 +85073,7 @@ const WorkflowTraceViewer = ({ run, events: events2, isLoading, error: error2, s
|
|
|
84945
85073
|
e.currentTarget.style.background = "var(--ds-gray-alpha-100)";
|
|
84946
85074
|
}, onMouseLeave: (e) => {
|
|
84947
85075
|
e.currentTarget.style.background = "transparent";
|
|
84948
|
-
}, children: jsxRuntimeExports.jsx(X$3, { size: 16 }) }) })] }), jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto", children: jsxRuntimeExports.jsx(ErrorBoundary$1, { title: "Failed to load entity details", children: jsxRuntimeExports.jsx(EntityDetailPanel, { run, onStreamClick, spanDetailData: spanDetailData ?? null, spanDetailError, spanDetailLoading, onSpanSelect: handleSpanSelect, onWakeUpSleep, onLoadEventData, onResolveHook, encryptionKey, onDecrypt, isDecrypting, selectedSpan }) }) })] })] });
|
|
85076
|
+
}, children: jsxRuntimeExports.jsx(X$3, { size: 16 }) }) })] }), jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto", children: jsxRuntimeExports.jsx(ErrorBoundary$1, { title: "Failed to load entity details", children: jsxRuntimeExports.jsx(EntityDetailPanel, { run, onStreamClick, onRunClick, spanDetailData: spanDetailData ?? null, spanDetailError, spanDetailLoading, onSpanSelect: handleSpanSelect, onWakeUpSleep, onLoadEventData, onResolveHook, encryptionKey, onDecrypt, isDecrypting, selectedSpan, hasEncryptedData }) }) })] })] });
|
|
84949
85077
|
};
|
|
84950
85078
|
function deserializeChunkText(text2) {
|
|
84951
85079
|
try {
|
|
@@ -85195,7 +85323,7 @@ function ConnectionStatus() {
|
|
|
85195
85323
|
"a",
|
|
85196
85324
|
{
|
|
85197
85325
|
className: "underline",
|
|
85198
|
-
href: "https://
|
|
85326
|
+
href: "https://workflow-sdk.dev/docs/observability",
|
|
85199
85327
|
target: "_blank",
|
|
85200
85328
|
rel: "noopener noreferrer",
|
|
85201
85329
|
children: "docs"
|
|
@@ -87878,7 +88006,7 @@ function DocsLink$1() {
|
|
|
87878
88006
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
87879
88007
|
"a",
|
|
87880
88008
|
{
|
|
87881
|
-
href: "https://
|
|
88009
|
+
href: "https://workflow-sdk.dev/docs/observability",
|
|
87882
88010
|
target: "_blank",
|
|
87883
88011
|
rel: "noopener noreferrer",
|
|
87884
88012
|
className: "gap-1",
|
|
@@ -88157,7 +88285,7 @@ function resolveWorkflowTargetWorld(env2 = process.env) {
|
|
|
88157
88285
|
function isVercelWorldTarget(targetWorld) {
|
|
88158
88286
|
return targetWorld === "vercel" || targetWorld === "@workflow/world-vercel";
|
|
88159
88287
|
}
|
|
88160
|
-
const BASE_URL = "https://
|
|
88288
|
+
const BASE_URL = "https://workflow-sdk.dev/err";
|
|
88161
88289
|
function isError(value) {
|
|
88162
88290
|
return typeof value === "object" && value !== null && "name" in value && "message" in value;
|
|
88163
88291
|
}
|
|
@@ -89230,7 +89358,7 @@ const runtimeLogger = createLogger("runtime");
|
|
|
89230
89358
|
createLogger("webhook");
|
|
89231
89359
|
createLogger("events");
|
|
89232
89360
|
createLogger("adapter");
|
|
89233
|
-
const version$1 = "5.0.0-beta.
|
|
89361
|
+
const version$1 = "5.0.0-beta.2";
|
|
89234
89362
|
const execFileAsync = promisify(execFile);
|
|
89235
89363
|
function parsePort$1(value, radix = 10) {
|
|
89236
89364
|
const port = parseInt(value, radix);
|
|
@@ -115425,23 +115553,27 @@ function createStreamer$1(basedir, tag) {
|
|
|
115425
115553
|
const chunksDir = path$3.join(basedir, "streams", "chunks");
|
|
115426
115554
|
let removeListeners = () => {
|
|
115427
115555
|
};
|
|
115556
|
+
let pollInterval = null;
|
|
115428
115557
|
return new ReadableStream({
|
|
115429
115558
|
async start(controller) {
|
|
115430
115559
|
const deliveredChunkIds = /* @__PURE__ */ new Set();
|
|
115431
115560
|
const bufferedEventChunks = [];
|
|
115432
115561
|
let isReadingFromDisk = true;
|
|
115433
115562
|
let pendingClose = false;
|
|
115563
|
+
let streamClosed = false;
|
|
115434
115564
|
const chunkListener = (event) => {
|
|
115435
|
-
deliveredChunkIds.add(event.chunkId);
|
|
115436
115565
|
if (event.chunkData.byteLength === 0) {
|
|
115566
|
+
deliveredChunkIds.add(event.chunkId);
|
|
115437
115567
|
return;
|
|
115438
115568
|
}
|
|
115439
115569
|
if (isReadingFromDisk) {
|
|
115570
|
+
deliveredChunkIds.add(event.chunkId);
|
|
115440
115571
|
bufferedEventChunks.push({
|
|
115441
115572
|
chunkId: event.chunkId,
|
|
115442
115573
|
chunkData: Uint8Array.from(event.chunkData)
|
|
115443
115574
|
});
|
|
115444
|
-
} else {
|
|
115575
|
+
} else if (!deliveredChunkIds.has(event.chunkId)) {
|
|
115576
|
+
deliveredChunkIds.add(event.chunkId);
|
|
115445
115577
|
controller.enqueue(Uint8Array.from(event.chunkData));
|
|
115446
115578
|
}
|
|
115447
115579
|
};
|
|
@@ -115450,8 +115582,13 @@ function createStreamer$1(basedir, tag) {
|
|
|
115450
115582
|
pendingClose = true;
|
|
115451
115583
|
return;
|
|
115452
115584
|
}
|
|
115585
|
+
streamClosed = true;
|
|
115453
115586
|
streamEmitter.off(`chunk:${name2}`, chunkListener);
|
|
115454
115587
|
streamEmitter.off(`close:${name2}`, closeListener);
|
|
115588
|
+
if (pollInterval) {
|
|
115589
|
+
clearInterval(pollInterval);
|
|
115590
|
+
pollInterval = null;
|
|
115591
|
+
}
|
|
115455
115592
|
try {
|
|
115456
115593
|
controller.close();
|
|
115457
115594
|
} catch {
|
|
@@ -115485,6 +115622,7 @@ function createStreamer$1(basedir, tag) {
|
|
|
115485
115622
|
isComplete = true;
|
|
115486
115623
|
break;
|
|
115487
115624
|
}
|
|
115625
|
+
deliveredChunkIds.add(chunkId);
|
|
115488
115626
|
if (chunk.chunk.byteLength) {
|
|
115489
115627
|
controller.enqueue(Uint8Array.from(chunk.chunk));
|
|
115490
115628
|
}
|
|
@@ -115509,10 +115647,64 @@ function createStreamer$1(basedir, tag) {
|
|
|
115509
115647
|
controller.close();
|
|
115510
115648
|
} catch {
|
|
115511
115649
|
}
|
|
115650
|
+
return;
|
|
115512
115651
|
}
|
|
115652
|
+
for (let i = 0; i < resolvedStartIndex && i < chunkFiles.length; i++) {
|
|
115653
|
+
const file2 = chunkFiles[i];
|
|
115654
|
+
const rawChunkId = file2.substring(name2.length + 1);
|
|
115655
|
+
const chunkId = tag ? rawChunkId.replace(`.${tag}`, "") : rawChunkId;
|
|
115656
|
+
deliveredChunkIds.add(chunkId);
|
|
115657
|
+
}
|
|
115658
|
+
let isPolling = false;
|
|
115659
|
+
pollInterval = setInterval(async () => {
|
|
115660
|
+
if (isPolling)
|
|
115661
|
+
return;
|
|
115662
|
+
isPolling = true;
|
|
115663
|
+
try {
|
|
115664
|
+
const { files: currentFiles, extMap: currentExtMap } = await listChunkFilesForStream(chunksDir, name2, tag);
|
|
115665
|
+
for (const file2 of currentFiles) {
|
|
115666
|
+
const rawChunkId = file2.substring(name2.length + 1);
|
|
115667
|
+
const chunkId = tag ? rawChunkId.replace(`.${tag}`, "") : rawChunkId;
|
|
115668
|
+
if (deliveredChunkIds.has(chunkId))
|
|
115669
|
+
continue;
|
|
115670
|
+
deliveredChunkIds.add(chunkId);
|
|
115671
|
+
const ext2 = currentExtMap.get(file2) ?? ".bin";
|
|
115672
|
+
const chunk = deserializeChunk(await readBuffer(path$3.join(chunksDir, `${file2}${ext2}`)));
|
|
115673
|
+
if ((chunk == null ? void 0 : chunk.eof) === true) {
|
|
115674
|
+
streamClosed = true;
|
|
115675
|
+
if (pollInterval) {
|
|
115676
|
+
clearInterval(pollInterval);
|
|
115677
|
+
pollInterval = null;
|
|
115678
|
+
}
|
|
115679
|
+
streamEmitter.off(`chunk:${name2}`, chunkListener);
|
|
115680
|
+
streamEmitter.off(`close:${name2}`, closeListener);
|
|
115681
|
+
try {
|
|
115682
|
+
controller.close();
|
|
115683
|
+
} catch {
|
|
115684
|
+
}
|
|
115685
|
+
return;
|
|
115686
|
+
}
|
|
115687
|
+
if (streamClosed)
|
|
115688
|
+
return;
|
|
115689
|
+
if (chunk.chunk.byteLength) {
|
|
115690
|
+
controller.enqueue(Uint8Array.from(chunk.chunk));
|
|
115691
|
+
}
|
|
115692
|
+
}
|
|
115693
|
+
} catch (err) {
|
|
115694
|
+
if (!(err instanceof Error && "code" in err)) {
|
|
115695
|
+
console.error("[world-local] Unexpected polling error:", err);
|
|
115696
|
+
}
|
|
115697
|
+
} finally {
|
|
115698
|
+
isPolling = false;
|
|
115699
|
+
}
|
|
115700
|
+
}, 100);
|
|
115513
115701
|
},
|
|
115514
115702
|
cancel() {
|
|
115515
115703
|
removeListeners();
|
|
115704
|
+
if (pollInterval) {
|
|
115705
|
+
clearInterval(pollInterval);
|
|
115706
|
+
pollInterval = null;
|
|
115707
|
+
}
|
|
115516
115708
|
}
|
|
115517
115709
|
});
|
|
115518
115710
|
}
|
|
@@ -115547,7 +115739,7 @@ function createLocalWorld(args) {
|
|
|
115547
115739
|
const basedir = mergedConfig.dataDir;
|
|
115548
115740
|
const hooksDir = path$3.join(basedir, "hooks");
|
|
115549
115741
|
const taggedHookFiles = await listTaggedFiles(hooksDir, tag);
|
|
115550
|
-
const { HookSchema: HookSchema2 } = await import("./index-
|
|
115742
|
+
const { HookSchema: HookSchema2 } = await import("./index-DJ8Yt9MV.js");
|
|
115551
115743
|
await Promise.all(taggedHookFiles.map(async (hookFile) => {
|
|
115552
115744
|
const hook = await readJSON(path$3.join(hooksDir, hookFile), HookSchema2);
|
|
115553
115745
|
if (hook == null ? void 0 : hook.token) {
|
|
@@ -115699,8 +115891,8 @@ function requireGetVercelOidcToken() {
|
|
|
115699
115891
|
}
|
|
115700
115892
|
try {
|
|
115701
115893
|
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
|
|
115702
|
-
await import("./token-util-
|
|
115703
|
-
await import("./token-
|
|
115894
|
+
await import("./token-util-Bwj_Mj31.js").then((n) => n.t),
|
|
115895
|
+
await import("./token-Bi1ru9oe.js").then((n) => n.t)
|
|
115704
115896
|
]);
|
|
115705
115897
|
if (!token || isExpired(getTokenPayload(token), options == null ? void 0 : options.expirationBufferMs)) {
|
|
115706
115898
|
await refreshToken(options);
|
|
@@ -120865,7 +121057,7 @@ var QueueClient = class {
|
|
|
120865
121057
|
setApi(this, new ApiClient({ ...options, region }));
|
|
120866
121058
|
}
|
|
120867
121059
|
};
|
|
120868
|
-
const version = "5.0.0-beta.
|
|
121060
|
+
const version = "5.0.0-beta.2";
|
|
120869
121061
|
const HTTP_DEBUG_ENABLED = typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
|
|
120870
121062
|
function httpLog(method, endpoint, status, ms2) {
|
|
120871
121063
|
if (HTTP_DEBUG_ENABLED) {
|
|
@@ -122010,8 +122202,35 @@ function createStorage(config2) {
|
|
|
122010
122202
|
};
|
|
122011
122203
|
}
|
|
122012
122204
|
const MAX_CHUNKS_PER_REQUEST = 1e3;
|
|
122013
|
-
|
|
122014
|
-
|
|
122205
|
+
const STREAM_CONTROL_FRAME_SIZE = 13;
|
|
122206
|
+
const STREAM_CONTROL_MAGIC = new Uint8Array([87, 70, 67, 84]);
|
|
122207
|
+
function parseStreamControlFrame(buffer) {
|
|
122208
|
+
if (buffer.length < STREAM_CONTROL_FRAME_SIZE)
|
|
122209
|
+
return null;
|
|
122210
|
+
const offset2 = buffer.length - STREAM_CONTROL_FRAME_SIZE;
|
|
122211
|
+
if (buffer[offset2] !== 0 || buffer[offset2 + 1] !== 0 || buffer[offset2 + 2] !== 0 || buffer[offset2 + 3] !== 0) {
|
|
122212
|
+
return null;
|
|
122213
|
+
}
|
|
122214
|
+
if (buffer[offset2 + 9] !== STREAM_CONTROL_MAGIC[0] || buffer[offset2 + 10] !== STREAM_CONTROL_MAGIC[1] || buffer[offset2 + 11] !== STREAM_CONTROL_MAGIC[2] || buffer[offset2 + 12] !== STREAM_CONTROL_MAGIC[3]) {
|
|
122215
|
+
return null;
|
|
122216
|
+
}
|
|
122217
|
+
const flags = buffer[offset2 + 4];
|
|
122218
|
+
const view = new DataView(buffer.buffer, buffer.byteOffset + offset2 + 5, 4);
|
|
122219
|
+
const nextIndex = view.getUint32(0, false);
|
|
122220
|
+
return {
|
|
122221
|
+
done: (flags & 1) === 1,
|
|
122222
|
+
nextIndex,
|
|
122223
|
+
totalLength: STREAM_CONTROL_FRAME_SIZE
|
|
122224
|
+
};
|
|
122225
|
+
}
|
|
122226
|
+
function concatUint8Arrays(a2, b2) {
|
|
122227
|
+
const result = new Uint8Array(a2.length + b2.length);
|
|
122228
|
+
result.set(a2, 0);
|
|
122229
|
+
result.set(b2, a2.length);
|
|
122230
|
+
return result;
|
|
122231
|
+
}
|
|
122232
|
+
function getStreamUrl(name2, runId, httpConfig, version2 = "v2") {
|
|
122233
|
+
return new URL(`${httpConfig.baseUrl}/${version2}/runs/${encodeURIComponent(runId)}/stream/${encodeURIComponent(name2)}`);
|
|
122015
122234
|
}
|
|
122016
122235
|
function encodeMultiChunks(chunks) {
|
|
122017
122236
|
const encoder = new TextEncoder();
|
|
@@ -122096,21 +122315,83 @@ function createStreamer(config2) {
|
|
|
122096
122315
|
}
|
|
122097
122316
|
},
|
|
122098
122317
|
async get(runId, name2, startIndex) {
|
|
122099
|
-
|
|
122100
|
-
const
|
|
122101
|
-
|
|
122102
|
-
|
|
122103
|
-
|
|
122104
|
-
|
|
122105
|
-
|
|
122318
|
+
let currentStartIndex = startIndex ?? 0;
|
|
122319
|
+
const MAX_RECONNECTS = 50;
|
|
122320
|
+
let reconnectCount = 0;
|
|
122321
|
+
const connect2 = async () => {
|
|
122322
|
+
const httpConfig = await getHttpConfig(config2);
|
|
122323
|
+
const url2 = getStreamUrl(name2, runId, httpConfig, "v3");
|
|
122324
|
+
url2.searchParams.set("startIndex", String(currentStartIndex));
|
|
122325
|
+
const response2 = await fetch(url2, {
|
|
122326
|
+
headers: httpConfig.headers
|
|
122327
|
+
});
|
|
122328
|
+
if (!response2.ok) {
|
|
122329
|
+
throw new Error(`Failed to fetch stream: ${response2.status}`);
|
|
122330
|
+
}
|
|
122331
|
+
if (!response2.body) {
|
|
122332
|
+
throw new Error("No response body for stream");
|
|
122333
|
+
}
|
|
122334
|
+
return response2.body.getReader();
|
|
122335
|
+
};
|
|
122336
|
+
let reader = await connect2();
|
|
122337
|
+
let tailBuffer = new Uint8Array(0);
|
|
122338
|
+
return new ReadableStream({
|
|
122339
|
+
pull: async (controller) => {
|
|
122340
|
+
for (; ; ) {
|
|
122341
|
+
let result;
|
|
122342
|
+
try {
|
|
122343
|
+
result = await reader.read();
|
|
122344
|
+
} catch (err) {
|
|
122345
|
+
if (tailBuffer.length > 0) {
|
|
122346
|
+
controller.enqueue(tailBuffer);
|
|
122347
|
+
tailBuffer = new Uint8Array(0);
|
|
122348
|
+
}
|
|
122349
|
+
controller.error(err);
|
|
122350
|
+
return;
|
|
122351
|
+
}
|
|
122352
|
+
if (!result.done) {
|
|
122353
|
+
const combined = concatUint8Arrays(tailBuffer, result.value);
|
|
122354
|
+
const holdBack = Math.min(STREAM_CONTROL_FRAME_SIZE, combined.length);
|
|
122355
|
+
if (combined.length > holdBack) {
|
|
122356
|
+
controller.enqueue(combined.subarray(0, -holdBack));
|
|
122357
|
+
tailBuffer = combined.slice(-holdBack);
|
|
122358
|
+
return;
|
|
122359
|
+
}
|
|
122360
|
+
tailBuffer = new Uint8Array(combined);
|
|
122361
|
+
continue;
|
|
122362
|
+
}
|
|
122363
|
+
const control = parseStreamControlFrame(tailBuffer);
|
|
122364
|
+
if (control) {
|
|
122365
|
+
const dataLen = tailBuffer.length - control.totalLength;
|
|
122366
|
+
if (dataLen > 0) {
|
|
122367
|
+
controller.enqueue(tailBuffer.subarray(0, dataLen));
|
|
122368
|
+
}
|
|
122369
|
+
tailBuffer = new Uint8Array(0);
|
|
122370
|
+
if (control.done) {
|
|
122371
|
+
controller.close();
|
|
122372
|
+
return;
|
|
122373
|
+
}
|
|
122374
|
+
reconnectCount++;
|
|
122375
|
+
if (reconnectCount > MAX_RECONNECTS) {
|
|
122376
|
+
controller.error(new Error(`Stream exceeded maximum reconnection attempts (${MAX_RECONNECTS})`));
|
|
122377
|
+
return;
|
|
122378
|
+
}
|
|
122379
|
+
currentStartIndex = control.nextIndex;
|
|
122380
|
+
reader = await connect2();
|
|
122381
|
+
continue;
|
|
122382
|
+
}
|
|
122383
|
+
if (tailBuffer.length > 0) {
|
|
122384
|
+
controller.enqueue(tailBuffer);
|
|
122385
|
+
tailBuffer = new Uint8Array(0);
|
|
122386
|
+
}
|
|
122387
|
+
controller.close();
|
|
122388
|
+
return;
|
|
122389
|
+
}
|
|
122390
|
+
},
|
|
122391
|
+
cancel: async () => {
|
|
122392
|
+
await reader.cancel();
|
|
122393
|
+
}
|
|
122106
122394
|
});
|
|
122107
|
-
if (!response2.ok) {
|
|
122108
|
-
throw new Error(`Failed to fetch stream: ${response2.status}`);
|
|
122109
|
-
}
|
|
122110
|
-
if (!response2.body) {
|
|
122111
|
-
throw new Error("No response body for stream");
|
|
122112
|
-
}
|
|
122113
|
-
return response2.body;
|
|
122114
122395
|
},
|
|
122115
122396
|
async getChunks(runId, name2, options) {
|
|
122116
122397
|
const params = new URLSearchParams();
|
|
@@ -127411,7 +127692,11 @@ async function start$1(workflow, argsOrOptions, options) {
|
|
|
127411
127692
|
}));
|
|
127412
127693
|
const encryptionKey = rawKey ? await importKey(rawKey) : void 0;
|
|
127413
127694
|
const workflowArguments = await dehydrateWorkflowArguments(args, runId, encryptionKey, ops, globalThis, v1Compat);
|
|
127414
|
-
const executionContext = {
|
|
127695
|
+
const executionContext = {
|
|
127696
|
+
traceCarrier,
|
|
127697
|
+
workflowCoreVersion: version$1,
|
|
127698
|
+
features: { encryption: !!encryptionKey }
|
|
127699
|
+
};
|
|
127415
127700
|
const [runCreatedResult, queueResult] = await Promise.allSettled([
|
|
127416
127701
|
world.events.create(runId, {
|
|
127417
127702
|
eventType: "run_created",
|
|
@@ -128884,7 +129169,7 @@ const CardFooter = reactExports.forwardRef(({ className, ...props }, ref) => /*
|
|
|
128884
129169
|
CardFooter.displayName = "CardFooter";
|
|
128885
129170
|
const DocsLink = reactExports.forwardRef(
|
|
128886
129171
|
({ className, href, children: children2, ...props }, ref) => {
|
|
128887
|
-
const fullHref = href.startsWith("http") ? href : `https://
|
|
129172
|
+
const fullHref = href.startsWith("http") ? href : `https://workflow-sdk.dev/docs/${href.replace(/^\//, "")}`;
|
|
128888
129173
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
128889
129174
|
Link$1,
|
|
128890
129175
|
{
|
|
@@ -134529,7 +134814,9 @@ function useWorkflowTraceViewerData(env2, runId, options = {}) {
|
|
|
134529
134814
|
const [eventsCursor, setEventsCursor] = reactExports.useState();
|
|
134530
134815
|
const [eventsHasMore, setEventsHasMore] = reactExports.useState(false);
|
|
134531
134816
|
const [isLoadingMoreTraceData, setIsLoadingMoreTraceData] = reactExports.useState(false);
|
|
134817
|
+
const [hasEncryptedData, setHasEncryptedData] = reactExports.useState(false);
|
|
134532
134818
|
const isFetchingRef = reactExports.useRef(false);
|
|
134819
|
+
const mountedRef = reactExports.useRef(true);
|
|
134533
134820
|
const [initialLoadCompleted, setInitialLoadCompleted] = reactExports.useState(false);
|
|
134534
134821
|
const fetchAllData = reactExports.useCallback(async () => {
|
|
134535
134822
|
if (isFetchingRef.current) {
|
|
@@ -134567,6 +134854,27 @@ function useWorkflowTraceViewerData(env2, runId, options = {}) {
|
|
|
134567
134854
|
if (!runResult.error && eventsResult.error) {
|
|
134568
134855
|
setError(eventsResult.error);
|
|
134569
134856
|
}
|
|
134857
|
+
if (!runResult.error) {
|
|
134858
|
+
const ctx = runResult.result.executionContext;
|
|
134859
|
+
if ((ctx == null ? void 0 : ctx.features) && ctx.features.encryption) {
|
|
134860
|
+
setHasEncryptedData(true);
|
|
134861
|
+
} else {
|
|
134862
|
+
unwrapServerActionResult(
|
|
134863
|
+
fetchEvents$1(env2, runId, {
|
|
134864
|
+
sortOrder: "asc",
|
|
134865
|
+
limit: 1,
|
|
134866
|
+
withData: true
|
|
134867
|
+
})
|
|
134868
|
+
).then((probeResult) => {
|
|
134869
|
+
if (mountedRef.current && !probeResult.error && probeResult.result.data.some(
|
|
134870
|
+
(e) => hasEncryptedFields(hydrateResourceIO(e))
|
|
134871
|
+
)) {
|
|
134872
|
+
setHasEncryptedData(true);
|
|
134873
|
+
}
|
|
134874
|
+
}).catch(() => {
|
|
134875
|
+
});
|
|
134876
|
+
}
|
|
134877
|
+
}
|
|
134570
134878
|
}, [env2, runId]);
|
|
134571
134879
|
const loadMoreTraceData = reactExports.useCallback(async () => {
|
|
134572
134880
|
if (isFetchingRef.current || !initialLoadCompleted || isLoadingMoreTraceData || !eventsHasMore) {
|
|
@@ -134654,6 +134962,12 @@ function useWorkflowTraceViewerData(env2, runId, options = {}) {
|
|
|
134654
134962
|
reactExports.useEffect(() => {
|
|
134655
134963
|
fetchAllData();
|
|
134656
134964
|
}, [fetchAllData]);
|
|
134965
|
+
reactExports.useEffect(() => {
|
|
134966
|
+
mountedRef.current = true;
|
|
134967
|
+
return () => {
|
|
134968
|
+
mountedRef.current = false;
|
|
134969
|
+
};
|
|
134970
|
+
}, []);
|
|
134657
134971
|
reactExports.useEffect(() => {
|
|
134658
134972
|
if (!live || !initialLoadCompleted || (run == null ? void 0 : run.completedAt)) {
|
|
134659
134973
|
return;
|
|
@@ -134673,7 +134987,8 @@ function useWorkflowTraceViewerData(env2, runId, options = {}) {
|
|
|
134673
134987
|
update,
|
|
134674
134988
|
loadMoreTraceData,
|
|
134675
134989
|
hasMoreTraceData: eventsHasMore,
|
|
134676
|
-
isLoadingMoreTraceData
|
|
134990
|
+
isLoadingMoreTraceData,
|
|
134991
|
+
hasEncryptedData
|
|
134677
134992
|
};
|
|
134678
134993
|
}
|
|
134679
134994
|
function isServerActionError(value) {
|
|
@@ -134946,7 +135261,7 @@ function HooksTable({
|
|
|
134946
135261
|
] }) : !loading && (!hooks || hooks.length === 0) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
|
|
134947
135262
|
"No active hooks found. ",
|
|
134948
135263
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
134949
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(DocsLink, { href: "https://
|
|
135264
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(DocsLink, { href: "https://workflow-sdk.dev/docs/api-reference/workflow/create-hook", children: "Learn how to create a hook" })
|
|
134950
135265
|
] }) : loading && !(data == null ? void 0 : data.data) ? /* @__PURE__ */ jsxRuntimeExports.jsx(TableSkeleton, { variant: "hooks" }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
134951
135266
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: "overflow-hidden mt-4 bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardContent, { className: "p-0 max-h-[calc(100vh-280px)] overflow-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { children: [
|
|
134952
135267
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TableHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { children: [
|
|
@@ -150421,6 +150736,12 @@ function RunDetailView({
|
|
|
150421
150736
|
},
|
|
150422
150737
|
[updateSearchParams]
|
|
150423
150738
|
);
|
|
150739
|
+
const handleRunRefClick = reactExports.useCallback(
|
|
150740
|
+
(targetRunId) => {
|
|
150741
|
+
navigate(`/run/${encodeURIComponent(targetRunId)}`);
|
|
150742
|
+
},
|
|
150743
|
+
[navigate]
|
|
150744
|
+
);
|
|
150424
150745
|
const handleWakeUpSleep = reactExports.useCallback(
|
|
150425
150746
|
async (runId2, correlationId) => {
|
|
150426
150747
|
return wakeUpRun(env2, runId2, { correlationIds: [correlationId] });
|
|
@@ -150475,7 +150796,8 @@ function RunDetailView({
|
|
|
150475
150796
|
update,
|
|
150476
150797
|
loadMoreTraceData,
|
|
150477
150798
|
hasMoreTraceData,
|
|
150478
|
-
isLoadingMoreTraceData
|
|
150799
|
+
isLoadingMoreTraceData,
|
|
150800
|
+
hasEncryptedData
|
|
150479
150801
|
} = useWorkflowTraceViewerData(env2, runId, { live: true });
|
|
150480
150802
|
const run = runData ?? {};
|
|
150481
150803
|
const [encryptionKey, setEncryptionKey] = reactExports.useState(null);
|
|
@@ -150741,6 +151063,7 @@ function RunDetailView({
|
|
|
150741
151063
|
spanDetailError,
|
|
150742
151064
|
onSpanSelect: handleSpanSelect,
|
|
150743
151065
|
onStreamClick: handleStreamClick,
|
|
151066
|
+
onRunClick: handleRunRefClick,
|
|
150744
151067
|
onWakeUpSleep: handleWakeUpSleep,
|
|
150745
151068
|
onResolveHook: handleResolveHook,
|
|
150746
151069
|
onLoadEventData: handleLoadSidebarEventData,
|
|
@@ -150749,7 +151072,8 @@ function RunDetailView({
|
|
|
150749
151072
|
isLoadingMoreSpans: isLoadingMoreTraceData,
|
|
150750
151073
|
encryptionKey: encryptionKey ?? void 0,
|
|
150751
151074
|
onDecrypt: handleDecrypt,
|
|
150752
|
-
isDecrypting
|
|
151075
|
+
isDecrypting,
|
|
151076
|
+
hasEncryptedData
|
|
150753
151077
|
}
|
|
150754
151078
|
) }) }) }),
|
|
150755
151079
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "events", className: "mt-0 flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$1, { title: "Failed to load events list", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -150766,7 +151090,8 @@ function RunDetailView({
|
|
|
150766
151090
|
sortOrder: eventsSortOrder,
|
|
150767
151091
|
onSortOrderChange: setEventsSortOrder,
|
|
150768
151092
|
onDecrypt: handleDecrypt,
|
|
150769
|
-
isDecrypting
|
|
151093
|
+
isDecrypting,
|
|
151094
|
+
hasEncryptedData
|
|
150770
151095
|
}
|
|
150771
151096
|
) }) }) }),
|
|
150772
151097
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "streams", className: "mt-0 flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$1, { title: "Failed to load stream data", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-full flex gap-4", children: [
|
|
@@ -151060,7 +151385,7 @@ const route4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
151060
151385
|
__proto__: null,
|
|
151061
151386
|
loader
|
|
151062
151387
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
151063
|
-
const serverManifest = { "entry": { "module": "/assets/entry.client-
|
|
151388
|
+
const serverManifest = { "entry": { "module": "/assets/entry.client-BWsSsWQm.js", "imports": ["/assets/index-DQa-BExo.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-ClRrWHkX.js", "imports": ["/assets/index-DQa-BExo.js", "/assets/mermaid-3ZIDBTTL-B9v3aKRl.js"], "css": ["/assets/root-BrnNveEi.css", "/assets/mermaid-3ZIDBTTL-DKxHcEOp.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-OcN-ARTU.js", "imports": ["/assets/index-DQa-BExo.js", "/assets/workflow-graph-viewer-BdFIMYrh.js", "/assets/mermaid-3ZIDBTTL-B9v3aKRl.js"], "css": ["/assets/workflow-graph-viewer-yls6qlc0.css", "/assets/mermaid-3ZIDBTTL-DKxHcEOp.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-BdYMODbi.js", "imports": ["/assets/index-DQa-BExo.js", "/assets/workflow-graph-viewer-BdFIMYrh.js", "/assets/mermaid-3ZIDBTTL-B9v3aKRl.js", "/assets/encryption-80GMP4r0.js"], "css": ["/assets/workflow-graph-viewer-yls6qlc0.css", "/assets/mermaid-3ZIDBTTL-DKxHcEOp.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-62352cd9.js", "version": "62352cd9", "sri": void 0 };
|
|
151064
151389
|
const assetsBuildDirectory = "build/client";
|
|
151065
151390
|
const basename = "/";
|
|
151066
151391
|
const future = { "unstable_optimizeDeps": false, "unstable_subResourceIntegrity": false, "unstable_trailingSlashAwareDataRequests": false, "unstable_previewServerPrerendering": false, "v8_middleware": false, "v8_splitRouteModules": false, "v8_viteEnvironmentApi": false };
|
|
@@ -151144,33 +151469,33 @@ export {
|
|
|
151144
151469
|
PaginatedResponseSchema as P,
|
|
151145
151470
|
QueuePayloadSchema as Q,
|
|
151146
151471
|
RunInputSchema as R,
|
|
151147
|
-
|
|
151472
|
+
SPEC_VERSION_CURRENT as S,
|
|
151148
151473
|
ValidQueueName as V,
|
|
151149
|
-
|
|
151150
|
-
|
|
151151
|
-
|
|
151152
|
-
|
|
151153
|
-
|
|
151154
|
-
|
|
151155
|
-
|
|
151156
|
-
|
|
151157
|
-
|
|
151158
|
-
|
|
151159
|
-
|
|
151160
|
-
|
|
151161
|
-
|
|
151162
|
-
|
|
151163
|
-
|
|
151164
|
-
|
|
151165
|
-
|
|
151166
|
-
|
|
151167
|
-
|
|
151168
|
-
|
|
151169
|
-
|
|
151170
|
-
|
|
151171
|
-
|
|
151172
|
-
|
|
151173
|
-
|
|
151474
|
+
WaitSchema as W,
|
|
151475
|
+
DEFAULT_TIMESTAMP_THRESHOLD_PAST_MS as a,
|
|
151476
|
+
EventSchema as b,
|
|
151477
|
+
EventTypeSchema as c,
|
|
151478
|
+
HealthCheckPayloadSchema as d,
|
|
151479
|
+
QueuePrefix as e,
|
|
151480
|
+
SPEC_VERSION_LEGACY as f,
|
|
151481
|
+
SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT as g,
|
|
151482
|
+
SPEC_VERSION_SUPPORTS_EVENT_SOURCING as h,
|
|
151483
|
+
SerializedDataSchema as i,
|
|
151484
|
+
StepInvokePayloadSchema as j,
|
|
151485
|
+
StepSchema as k,
|
|
151486
|
+
StepStatusSchema as l,
|
|
151487
|
+
StructuredErrorSchema as m,
|
|
151488
|
+
WaitStatusSchema as n,
|
|
151489
|
+
WorkflowInvokePayloadSchema as o,
|
|
151490
|
+
WorkflowRunBaseSchema as p,
|
|
151491
|
+
WorkflowRunSchema as q,
|
|
151492
|
+
WorkflowRunStatusSchema as r,
|
|
151493
|
+
isLegacySpecVersion as s,
|
|
151494
|
+
reenqueueActiveRuns as t,
|
|
151495
|
+
requiresNewerWorld as u,
|
|
151496
|
+
stripEventDataRefs as v,
|
|
151497
|
+
ulidToDate as w,
|
|
151498
|
+
validateUlidTimestamp as x,
|
|
151174
151499
|
R as y,
|
|
151175
151500
|
jsxRuntimeExports as z
|
|
151176
151501
|
};
|