@workflow/web 5.0.0-beta.29 → 5.0.0-beta.30
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/build/client/assets/{arrow-up-right-nUJMbeWN.js → arrow-up-right-qJMh7AD6.js} +1 -1
- package/build/client/assets/{highlighted-body-B3W2YXNL-_4bJAUnT.js → highlighted-body-B3W2YXNL-TNY6Phfb.js} +1 -1
- package/build/client/assets/{home-W4Ja_rr1.js → home-VRVjXSQY.js} +2 -2
- package/build/client/assets/{manifest-56b6d9e0.js → manifest-479fb7d3.js} +1 -1
- package/build/client/assets/{mermaid-3ZIDBTTL-BfwKRFTU.js → mermaid-3ZIDBTTL-CnDvMd8R.js} +1058 -942
- package/build/client/assets/{root-DOkL1_-J.js → root-C7ElgjAN.js} +2 -2
- package/build/client/assets/root-CQggqXow.css +1 -0
- package/build/client/assets/{run-detail-CRleiBxx.js → run-detail-CmptzMYo.js} +28 -67
- package/build/client/assets/server-build-C5ehvmav.css +1 -0
- package/build/client/assets/{workflow-graph-viewer-CvsdACR5.js → workflow-graph-viewer-DQf8ZZM2.js} +1 -1
- package/build/client/assets/{zstd-browser-decoder-bX851D8O.js → zstd-browser-decoder-VtbaLP8T.js} +1 -1
- package/build/server/assets/{app-jsOjV9W7.js → app-CVZBwwJu.js} +1 -1
- package/build/server/assets/{highlighted-body-B3W2YXNL-DpTmbI4L.js → highlighted-body-B3W2YXNL-DU9e_6JW.js} +2 -2
- package/build/server/assets/index-CtG82ntm.js +132 -0
- package/build/server/assets/{mermaid-3ZIDBTTL-Dl6hRpcE.js → mermaid-3ZIDBTTL-DgV-PzsY.js} +2 -2
- package/build/server/assets/{server-build-BRxoSdNU.js → server-build-CRXCLKDJ.js} +1651 -1334
- package/build/server/assets/{token-BqP-cpRD.js → token-bLcjz8Va.js} +2 -2
- package/build/server/assets/{token-util-DaPlIe_a.js → token-util-C0zuFOay.js} +2 -2
- package/build/server/assets/{zstd-browser-decoder-Cyb8--z9.js → zstd-browser-decoder-BgFuN9zt.js} +2 -2
- package/build/server/index.js +1 -1
- package/package.json +6 -6
- package/build/client/assets/root-okIQN2A_.css +0 -1
- package/build/client/assets/server-build-H39y96IB.css +0 -1
- package/build/server/assets/index-CJPCT6Jd.js +0 -115
|
@@ -18,7 +18,7 @@ import { createRequire as __wkfCreateRequire } from "node:module";
|
|
|
18
18
|
if (typeof require === "undefined") {
|
|
19
19
|
globalThis.require = __wkfCreateRequire(import.meta.url);
|
|
20
20
|
}
|
|
21
|
-
import { a as requireReact, S as ServerRouter, c as createReadableStreamFromReadable, r as reactExports, g as getDefaultExportFromCjs, R as React, b as ReactExports, 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-
|
|
21
|
+
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-CVZBwwJu.js";
|
|
22
22
|
import require$$0$4, { PassThrough } from "node:stream";
|
|
23
23
|
import require$$0 from "util";
|
|
24
24
|
import require$$1 from "crypto";
|
|
@@ -34127,983 +34127,6 @@ function looksLikeWorkflowIdSearchInput(query) {
|
|
|
34127
34127
|
}
|
|
34128
34128
|
return /\d/.test(trimmed);
|
|
34129
34129
|
}
|
|
34130
|
-
const UNDEFINED$2 = -1;
|
|
34131
|
-
const HOLE = -2;
|
|
34132
|
-
const NAN = -3;
|
|
34133
|
-
const POSITIVE_INFINITY = -4;
|
|
34134
|
-
const NEGATIVE_INFINITY = -5;
|
|
34135
|
-
const NEGATIVE_ZERO = -6;
|
|
34136
|
-
const SPARSE = -7;
|
|
34137
|
-
const MAX_ARRAY_LEN = 2 ** 32 - 1;
|
|
34138
|
-
const MAX_ARRAY_INDEX = MAX_ARRAY_LEN - 1;
|
|
34139
|
-
class DevalueError extends Error {
|
|
34140
|
-
/**
|
|
34141
|
-
* @param {string} message
|
|
34142
|
-
* @param {string[]} keys
|
|
34143
|
-
* @param {any} [value] - The value that failed to be serialized
|
|
34144
|
-
* @param {any} [root] - The root value being serialized
|
|
34145
|
-
*/
|
|
34146
|
-
constructor(message2, keys2, value, root2) {
|
|
34147
|
-
super(message2);
|
|
34148
|
-
this.name = "DevalueError";
|
|
34149
|
-
this.path = keys2.join("");
|
|
34150
|
-
this.value = value;
|
|
34151
|
-
this.root = root2;
|
|
34152
|
-
}
|
|
34153
|
-
}
|
|
34154
|
-
function is_primitive(thing) {
|
|
34155
|
-
return thing === null || typeof thing !== "object" && typeof thing !== "function";
|
|
34156
|
-
}
|
|
34157
|
-
const object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
34158
|
-
function is_plain_object(thing) {
|
|
34159
|
-
const proto2 = Object.getPrototypeOf(thing);
|
|
34160
|
-
return proto2 === Object.prototype || proto2 === null || Object.getPrototypeOf(proto2) === null || Object.getOwnPropertyNames(proto2).sort().join("\0") === object_proto_names;
|
|
34161
|
-
}
|
|
34162
|
-
function get_type(thing) {
|
|
34163
|
-
return Object.prototype.toString.call(thing).slice(8, -1);
|
|
34164
|
-
}
|
|
34165
|
-
function get_escaped_char(char) {
|
|
34166
|
-
switch (char) {
|
|
34167
|
-
case '"':
|
|
34168
|
-
return '\\"';
|
|
34169
|
-
case "<":
|
|
34170
|
-
return "\\u003C";
|
|
34171
|
-
case "\\":
|
|
34172
|
-
return "\\\\";
|
|
34173
|
-
case "\n":
|
|
34174
|
-
return "\\n";
|
|
34175
|
-
case "\r":
|
|
34176
|
-
return "\\r";
|
|
34177
|
-
case " ":
|
|
34178
|
-
return "\\t";
|
|
34179
|
-
case "\b":
|
|
34180
|
-
return "\\b";
|
|
34181
|
-
case "\f":
|
|
34182
|
-
return "\\f";
|
|
34183
|
-
case "\u2028":
|
|
34184
|
-
return "\\u2028";
|
|
34185
|
-
case "\u2029":
|
|
34186
|
-
return "\\u2029";
|
|
34187
|
-
default:
|
|
34188
|
-
return char < " " ? `\\u${char.charCodeAt(0).toString(16).padStart(4, "0")}` : "";
|
|
34189
|
-
}
|
|
34190
|
-
}
|
|
34191
|
-
function stringify_string(str) {
|
|
34192
|
-
let result = "";
|
|
34193
|
-
let last_pos = 0;
|
|
34194
|
-
const len = str.length;
|
|
34195
|
-
for (let i = 0; i < len; i += 1) {
|
|
34196
|
-
const char = str[i];
|
|
34197
|
-
const replacement = get_escaped_char(char);
|
|
34198
|
-
if (replacement) {
|
|
34199
|
-
result += str.slice(last_pos, i) + replacement;
|
|
34200
|
-
last_pos = i + 1;
|
|
34201
|
-
}
|
|
34202
|
-
}
|
|
34203
|
-
return `"${last_pos === 0 ? str : result + str.slice(last_pos)}"`;
|
|
34204
|
-
}
|
|
34205
|
-
function enumerable_symbols(object2) {
|
|
34206
|
-
return Object.getOwnPropertySymbols(object2).filter(
|
|
34207
|
-
(symbol2) => Object.getOwnPropertyDescriptor(object2, symbol2).enumerable
|
|
34208
|
-
);
|
|
34209
|
-
}
|
|
34210
|
-
const is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
|
|
34211
|
-
function stringify_key(key) {
|
|
34212
|
-
return is_identifier.test(key) ? "." + key : "[" + JSON.stringify(key) + "]";
|
|
34213
|
-
}
|
|
34214
|
-
function is_valid_array_index(n) {
|
|
34215
|
-
if (!Number.isInteger(n)) return false;
|
|
34216
|
-
if (n < 0) return false;
|
|
34217
|
-
if (n > MAX_ARRAY_INDEX) return false;
|
|
34218
|
-
return true;
|
|
34219
|
-
}
|
|
34220
|
-
function is_valid_array_len(n) {
|
|
34221
|
-
if (!Number.isInteger(n)) return false;
|
|
34222
|
-
if (n < 0) return false;
|
|
34223
|
-
if (n > MAX_ARRAY_LEN) return false;
|
|
34224
|
-
return true;
|
|
34225
|
-
}
|
|
34226
|
-
function is_valid_array_index_string(s2) {
|
|
34227
|
-
if (s2.length === 0) return false;
|
|
34228
|
-
if (s2.length > 1 && s2.charCodeAt(0) === 48) return false;
|
|
34229
|
-
for (let i = 0; i < s2.length; i++) {
|
|
34230
|
-
const c = s2.charCodeAt(i);
|
|
34231
|
-
if (c < 48 || c > 57) return false;
|
|
34232
|
-
}
|
|
34233
|
-
return is_valid_array_index(+s2);
|
|
34234
|
-
}
|
|
34235
|
-
function valid_array_indices(array2) {
|
|
34236
|
-
const keys2 = Object.keys(array2);
|
|
34237
|
-
for (var i = keys2.length - 1; i >= 0; i--) {
|
|
34238
|
-
if (is_valid_array_index_string(keys2[i])) {
|
|
34239
|
-
break;
|
|
34240
|
-
}
|
|
34241
|
-
}
|
|
34242
|
-
keys2.length = i + 1;
|
|
34243
|
-
return keys2;
|
|
34244
|
-
}
|
|
34245
|
-
function encode_native(array_buffer) {
|
|
34246
|
-
return new Uint8Array(array_buffer).toBase64();
|
|
34247
|
-
}
|
|
34248
|
-
function decode_native(base642) {
|
|
34249
|
-
return Uint8Array.fromBase64(base642).buffer;
|
|
34250
|
-
}
|
|
34251
|
-
function encode_buffer(array_buffer) {
|
|
34252
|
-
return Buffer.from(array_buffer).toString("base64");
|
|
34253
|
-
}
|
|
34254
|
-
function decode_buffer(base642) {
|
|
34255
|
-
return Uint8Array.from(Buffer.from(base642, "base64")).buffer;
|
|
34256
|
-
}
|
|
34257
|
-
function encode_legacy(array_buffer) {
|
|
34258
|
-
const array2 = new Uint8Array(array_buffer);
|
|
34259
|
-
let binary = "";
|
|
34260
|
-
const chunk_size = 32768;
|
|
34261
|
-
for (let i = 0; i < array2.length; i += chunk_size) {
|
|
34262
|
-
const chunk = array2.subarray(i, i + chunk_size);
|
|
34263
|
-
binary += String.fromCharCode.apply(null, chunk);
|
|
34264
|
-
}
|
|
34265
|
-
return btoa(binary);
|
|
34266
|
-
}
|
|
34267
|
-
function decode_legacy(base642) {
|
|
34268
|
-
const binary_string = atob(base642);
|
|
34269
|
-
const len = binary_string.length;
|
|
34270
|
-
const array2 = new Uint8Array(len);
|
|
34271
|
-
for (let i = 0; i < len; i++) {
|
|
34272
|
-
array2[i] = binary_string.charCodeAt(i);
|
|
34273
|
-
}
|
|
34274
|
-
return array2.buffer;
|
|
34275
|
-
}
|
|
34276
|
-
const native = typeof Uint8Array.fromBase64 === "function";
|
|
34277
|
-
const buffer = typeof process === "object" && ((_a2 = process.versions) == null ? void 0 : _a2.node) !== void 0;
|
|
34278
|
-
const encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy;
|
|
34279
|
-
const decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;
|
|
34280
|
-
function parse$7(serialized, revivers) {
|
|
34281
|
-
return unflatten(JSON.parse(serialized), revivers);
|
|
34282
|
-
}
|
|
34283
|
-
function unflatten(parsed, revivers) {
|
|
34284
|
-
if (typeof parsed === "number") return hydrate(parsed, true);
|
|
34285
|
-
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
34286
|
-
throw new Error("Invalid input");
|
|
34287
|
-
}
|
|
34288
|
-
const values = (
|
|
34289
|
-
/** @type {any[]} */
|
|
34290
|
-
parsed
|
|
34291
|
-
);
|
|
34292
|
-
const hydrated = Array(values.length);
|
|
34293
|
-
let hydrating = null;
|
|
34294
|
-
function hydrate(index2, standalone = false) {
|
|
34295
|
-
if (index2 === UNDEFINED$2) return void 0;
|
|
34296
|
-
if (index2 === NAN) return NaN;
|
|
34297
|
-
if (index2 === POSITIVE_INFINITY) return Infinity;
|
|
34298
|
-
if (index2 === NEGATIVE_INFINITY) return -Infinity;
|
|
34299
|
-
if (index2 === NEGATIVE_ZERO) return -0;
|
|
34300
|
-
if (standalone || typeof index2 !== "number") {
|
|
34301
|
-
throw new Error(`Invalid input`);
|
|
34302
|
-
}
|
|
34303
|
-
if (index2 in hydrated) return hydrated[index2];
|
|
34304
|
-
const value = values[index2];
|
|
34305
|
-
if (!value || typeof value !== "object") {
|
|
34306
|
-
hydrated[index2] = value;
|
|
34307
|
-
} else if (Array.isArray(value)) {
|
|
34308
|
-
if (typeof value[0] === "string") {
|
|
34309
|
-
const type = value[0];
|
|
34310
|
-
const reviver = revivers && Object.hasOwn(revivers, type) ? revivers[type] : void 0;
|
|
34311
|
-
if (reviver) {
|
|
34312
|
-
let i = value[1];
|
|
34313
|
-
if (typeof i !== "number") {
|
|
34314
|
-
i = values.push(value[1]) - 1;
|
|
34315
|
-
}
|
|
34316
|
-
hydrating ?? (hydrating = /* @__PURE__ */ new Set());
|
|
34317
|
-
if (hydrating.has(i)) {
|
|
34318
|
-
throw new Error("Invalid circular reference");
|
|
34319
|
-
}
|
|
34320
|
-
hydrating.add(i);
|
|
34321
|
-
hydrated[index2] = reviver(hydrate(i));
|
|
34322
|
-
hydrating.delete(i);
|
|
34323
|
-
return hydrated[index2];
|
|
34324
|
-
}
|
|
34325
|
-
switch (type) {
|
|
34326
|
-
case "Date":
|
|
34327
|
-
hydrated[index2] = new Date(value[1]);
|
|
34328
|
-
break;
|
|
34329
|
-
case "Set":
|
|
34330
|
-
const set2 = /* @__PURE__ */ new Set();
|
|
34331
|
-
hydrated[index2] = set2;
|
|
34332
|
-
for (let i = 1; i < value.length; i += 1) {
|
|
34333
|
-
set2.add(hydrate(value[i]));
|
|
34334
|
-
}
|
|
34335
|
-
break;
|
|
34336
|
-
case "Map":
|
|
34337
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
34338
|
-
hydrated[index2] = map2;
|
|
34339
|
-
for (let i = 1; i < value.length; i += 2) {
|
|
34340
|
-
map2.set(hydrate(value[i]), hydrate(value[i + 1]));
|
|
34341
|
-
}
|
|
34342
|
-
break;
|
|
34343
|
-
case "RegExp":
|
|
34344
|
-
hydrated[index2] = new RegExp(value[1], value[2]);
|
|
34345
|
-
break;
|
|
34346
|
-
case "Object": {
|
|
34347
|
-
const wrapped_index = value[1];
|
|
34348
|
-
if (typeof values[wrapped_index] === "object" && values[wrapped_index][0] !== "BigInt") {
|
|
34349
|
-
throw new Error("Invalid input");
|
|
34350
|
-
}
|
|
34351
|
-
hydrated[index2] = Object(hydrate(wrapped_index));
|
|
34352
|
-
break;
|
|
34353
|
-
}
|
|
34354
|
-
case "BigInt":
|
|
34355
|
-
hydrated[index2] = BigInt(value[1]);
|
|
34356
|
-
break;
|
|
34357
|
-
case "null":
|
|
34358
|
-
const obj = /* @__PURE__ */ Object.create(null);
|
|
34359
|
-
hydrated[index2] = obj;
|
|
34360
|
-
for (let i = 1; i < value.length; i += 2) {
|
|
34361
|
-
if (value[i] === "__proto__") {
|
|
34362
|
-
throw new Error("Cannot parse an object with a `__proto__` property");
|
|
34363
|
-
}
|
|
34364
|
-
obj[value[i]] = hydrate(value[i + 1]);
|
|
34365
|
-
}
|
|
34366
|
-
break;
|
|
34367
|
-
case "Int8Array":
|
|
34368
|
-
case "Uint8Array":
|
|
34369
|
-
case "Uint8ClampedArray":
|
|
34370
|
-
case "Int16Array":
|
|
34371
|
-
case "Uint16Array":
|
|
34372
|
-
case "Float16Array":
|
|
34373
|
-
case "Int32Array":
|
|
34374
|
-
case "Uint32Array":
|
|
34375
|
-
case "Float32Array":
|
|
34376
|
-
case "Float64Array":
|
|
34377
|
-
case "BigInt64Array":
|
|
34378
|
-
case "BigUint64Array":
|
|
34379
|
-
case "DataView": {
|
|
34380
|
-
if (values[value[1]][0] !== "ArrayBuffer") {
|
|
34381
|
-
throw new Error("Invalid data");
|
|
34382
|
-
}
|
|
34383
|
-
const TypedArrayConstructor = globalThis[type];
|
|
34384
|
-
const buffer2 = hydrate(value[1]);
|
|
34385
|
-
hydrated[index2] = value[2] !== void 0 ? new TypedArrayConstructor(buffer2, value[2], value[3]) : new TypedArrayConstructor(buffer2);
|
|
34386
|
-
break;
|
|
34387
|
-
}
|
|
34388
|
-
case "ArrayBuffer": {
|
|
34389
|
-
const base642 = value[1];
|
|
34390
|
-
if (typeof base642 !== "string") {
|
|
34391
|
-
throw new Error("Invalid ArrayBuffer encoding");
|
|
34392
|
-
}
|
|
34393
|
-
const arraybuffer = decode64(base642);
|
|
34394
|
-
hydrated[index2] = arraybuffer;
|
|
34395
|
-
break;
|
|
34396
|
-
}
|
|
34397
|
-
case "Temporal.Duration":
|
|
34398
|
-
case "Temporal.Instant":
|
|
34399
|
-
case "Temporal.PlainDate":
|
|
34400
|
-
case "Temporal.PlainTime":
|
|
34401
|
-
case "Temporal.PlainDateTime":
|
|
34402
|
-
case "Temporal.PlainMonthDay":
|
|
34403
|
-
case "Temporal.PlainYearMonth":
|
|
34404
|
-
case "Temporal.ZonedDateTime": {
|
|
34405
|
-
const temporalName = type.slice(9);
|
|
34406
|
-
hydrated[index2] = Temporal[temporalName].from(value[1]);
|
|
34407
|
-
break;
|
|
34408
|
-
}
|
|
34409
|
-
case "URL": {
|
|
34410
|
-
const url2 = new URL(value[1]);
|
|
34411
|
-
hydrated[index2] = url2;
|
|
34412
|
-
break;
|
|
34413
|
-
}
|
|
34414
|
-
case "URLSearchParams": {
|
|
34415
|
-
const url2 = new URLSearchParams(value[1]);
|
|
34416
|
-
hydrated[index2] = url2;
|
|
34417
|
-
break;
|
|
34418
|
-
}
|
|
34419
|
-
default:
|
|
34420
|
-
throw new Error(`Unknown type ${type}`);
|
|
34421
|
-
}
|
|
34422
|
-
} else if (value[0] === SPARSE) {
|
|
34423
|
-
const len = value[1];
|
|
34424
|
-
if (!is_valid_array_len(len)) {
|
|
34425
|
-
throw new Error("Invalid input");
|
|
34426
|
-
}
|
|
34427
|
-
const array2 = [];
|
|
34428
|
-
hydrated[index2] = array2;
|
|
34429
|
-
array2[MAX_ARRAY_INDEX] = void 0;
|
|
34430
|
-
delete array2[MAX_ARRAY_INDEX];
|
|
34431
|
-
for (let i = 2; i < value.length; i += 2) {
|
|
34432
|
-
const idx = value[i];
|
|
34433
|
-
if (!is_valid_array_index(idx) || idx >= len) {
|
|
34434
|
-
throw new Error("Invalid input");
|
|
34435
|
-
}
|
|
34436
|
-
array2[idx] = hydrate(value[i + 1]);
|
|
34437
|
-
}
|
|
34438
|
-
array2.length = len;
|
|
34439
|
-
} else {
|
|
34440
|
-
const array2 = new Array(value.length);
|
|
34441
|
-
hydrated[index2] = array2;
|
|
34442
|
-
for (let i = 0; i < value.length; i += 1) {
|
|
34443
|
-
const n = value[i];
|
|
34444
|
-
if (n === HOLE) continue;
|
|
34445
|
-
array2[i] = hydrate(n);
|
|
34446
|
-
}
|
|
34447
|
-
}
|
|
34448
|
-
} else {
|
|
34449
|
-
const object2 = {};
|
|
34450
|
-
hydrated[index2] = object2;
|
|
34451
|
-
for (const key of Object.keys(value)) {
|
|
34452
|
-
if (key === "__proto__") {
|
|
34453
|
-
throw new Error("Cannot parse an object with a `__proto__` property");
|
|
34454
|
-
}
|
|
34455
|
-
const n = value[key];
|
|
34456
|
-
object2[key] = hydrate(n);
|
|
34457
|
-
}
|
|
34458
|
-
}
|
|
34459
|
-
return hydrated[index2];
|
|
34460
|
-
}
|
|
34461
|
-
return hydrate(0);
|
|
34462
|
-
}
|
|
34463
|
-
function stringify$2(value, reducers) {
|
|
34464
|
-
const stringified = run(false, value, reducers);
|
|
34465
|
-
return typeof stringified === "string" ? stringified : `[${stringified.join(",")}]`;
|
|
34466
|
-
}
|
|
34467
|
-
function run(async, value, reducers) {
|
|
34468
|
-
const stringified = [];
|
|
34469
|
-
const indexes = /* @__PURE__ */ new Map();
|
|
34470
|
-
const custom2 = [];
|
|
34471
|
-
if (reducers) {
|
|
34472
|
-
for (const key of Object.getOwnPropertyNames(reducers)) {
|
|
34473
|
-
custom2.push({ key, fn: reducers[key] });
|
|
34474
|
-
}
|
|
34475
|
-
}
|
|
34476
|
-
const keys2 = [];
|
|
34477
|
-
let p2 = 0;
|
|
34478
|
-
function flatten(thing, index3) {
|
|
34479
|
-
if (thing === void 0) return UNDEFINED$2;
|
|
34480
|
-
if (Number.isNaN(thing)) return NAN;
|
|
34481
|
-
if (thing === Infinity) return POSITIVE_INFINITY;
|
|
34482
|
-
if (thing === -Infinity) return NEGATIVE_INFINITY;
|
|
34483
|
-
if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO;
|
|
34484
|
-
if (indexes.has(thing)) return (
|
|
34485
|
-
/** @type {number} */
|
|
34486
|
-
indexes.get(thing)
|
|
34487
|
-
);
|
|
34488
|
-
index3 ?? (index3 = p2++);
|
|
34489
|
-
indexes.set(thing, index3);
|
|
34490
|
-
for (const { key, fn: fn2 } of custom2) {
|
|
34491
|
-
const value2 = fn2(thing);
|
|
34492
|
-
if (value2) {
|
|
34493
|
-
stringified[index3] = `["${key}",${flatten(value2)}]`;
|
|
34494
|
-
return index3;
|
|
34495
|
-
}
|
|
34496
|
-
}
|
|
34497
|
-
if (typeof thing === "function") {
|
|
34498
|
-
throw new DevalueError(`Cannot stringify a function`, keys2, thing, value);
|
|
34499
|
-
} else if (typeof thing === "symbol") {
|
|
34500
|
-
throw new DevalueError(`Cannot stringify a Symbol primitive`, keys2, thing, value);
|
|
34501
|
-
}
|
|
34502
|
-
let str = "";
|
|
34503
|
-
if (is_primitive(thing)) {
|
|
34504
|
-
str = stringify_primitive(thing);
|
|
34505
|
-
} else if (typeof thing.then === "function") {
|
|
34506
|
-
{
|
|
34507
|
-
throw new DevalueError(
|
|
34508
|
-
`Cannot stringify a Promise or thenable — use stringifyAsync instead`,
|
|
34509
|
-
keys2,
|
|
34510
|
-
thing,
|
|
34511
|
-
value
|
|
34512
|
-
);
|
|
34513
|
-
}
|
|
34514
|
-
} else {
|
|
34515
|
-
const type = get_type(thing);
|
|
34516
|
-
switch (type) {
|
|
34517
|
-
case "Number":
|
|
34518
|
-
case "String":
|
|
34519
|
-
case "Boolean":
|
|
34520
|
-
case "BigInt":
|
|
34521
|
-
str = `["Object",${flatten(thing.valueOf())}]`;
|
|
34522
|
-
break;
|
|
34523
|
-
case "Date":
|
|
34524
|
-
const valid2 = !isNaN(thing.getDate());
|
|
34525
|
-
str = `["Date","${valid2 ? thing.toISOString() : ""}"]`;
|
|
34526
|
-
break;
|
|
34527
|
-
case "URL":
|
|
34528
|
-
str = `["URL",${stringify_string(thing.toString())}]`;
|
|
34529
|
-
break;
|
|
34530
|
-
case "URLSearchParams":
|
|
34531
|
-
str = `["URLSearchParams",${stringify_string(thing.toString())}]`;
|
|
34532
|
-
break;
|
|
34533
|
-
case "RegExp":
|
|
34534
|
-
const { source, flags } = thing;
|
|
34535
|
-
str = flags ? `["RegExp",${stringify_string(source)},"${flags}"]` : `["RegExp",${stringify_string(source)}]`;
|
|
34536
|
-
break;
|
|
34537
|
-
case "Array": {
|
|
34538
|
-
let mostly_dense = false;
|
|
34539
|
-
str = "[";
|
|
34540
|
-
for (let i = 0; i < thing.length; i += 1) {
|
|
34541
|
-
if (i > 0) str += ",";
|
|
34542
|
-
if (Object.hasOwn(thing, i)) {
|
|
34543
|
-
keys2.push(`[${i}]`);
|
|
34544
|
-
str += flatten(thing[i]);
|
|
34545
|
-
keys2.pop();
|
|
34546
|
-
} else if (mostly_dense) {
|
|
34547
|
-
str += HOLE;
|
|
34548
|
-
} else {
|
|
34549
|
-
const populated_keys = valid_array_indices(
|
|
34550
|
-
/** @type {any[]} */
|
|
34551
|
-
thing
|
|
34552
|
-
);
|
|
34553
|
-
const population = populated_keys.length;
|
|
34554
|
-
const d2 = String(thing.length).length;
|
|
34555
|
-
const hole_cost = (thing.length - population) * 3;
|
|
34556
|
-
const sparse_cost = 4 + d2 + population * (d2 + 1);
|
|
34557
|
-
if (hole_cost > sparse_cost) {
|
|
34558
|
-
str = "[" + SPARSE + "," + thing.length;
|
|
34559
|
-
for (let j2 = 0; j2 < populated_keys.length; j2++) {
|
|
34560
|
-
const key = populated_keys[j2];
|
|
34561
|
-
keys2.push(`[${key}]`);
|
|
34562
|
-
str += "," + key + "," + flatten(thing[key]);
|
|
34563
|
-
keys2.pop();
|
|
34564
|
-
}
|
|
34565
|
-
break;
|
|
34566
|
-
} else {
|
|
34567
|
-
mostly_dense = true;
|
|
34568
|
-
str += HOLE;
|
|
34569
|
-
}
|
|
34570
|
-
}
|
|
34571
|
-
}
|
|
34572
|
-
str += "]";
|
|
34573
|
-
break;
|
|
34574
|
-
}
|
|
34575
|
-
case "Set":
|
|
34576
|
-
str = '["Set"';
|
|
34577
|
-
for (const value2 of thing) {
|
|
34578
|
-
str += `,${flatten(value2)}`;
|
|
34579
|
-
}
|
|
34580
|
-
str += "]";
|
|
34581
|
-
break;
|
|
34582
|
-
case "Map":
|
|
34583
|
-
str = '["Map"';
|
|
34584
|
-
for (const [key, value2] of thing) {
|
|
34585
|
-
keys2.push(`.get(${is_primitive(key) ? stringify_primitive(key) : "..."})`);
|
|
34586
|
-
str += `,${flatten(key)},${flatten(value2)}`;
|
|
34587
|
-
keys2.pop();
|
|
34588
|
-
}
|
|
34589
|
-
str += "]";
|
|
34590
|
-
break;
|
|
34591
|
-
case "Int8Array":
|
|
34592
|
-
case "Uint8Array":
|
|
34593
|
-
case "Uint8ClampedArray":
|
|
34594
|
-
case "Int16Array":
|
|
34595
|
-
case "Uint16Array":
|
|
34596
|
-
case "Float16Array":
|
|
34597
|
-
case "Int32Array":
|
|
34598
|
-
case "Uint32Array":
|
|
34599
|
-
case "Float32Array":
|
|
34600
|
-
case "Float64Array":
|
|
34601
|
-
case "BigInt64Array":
|
|
34602
|
-
case "BigUint64Array":
|
|
34603
|
-
case "DataView": {
|
|
34604
|
-
const typedArray = thing;
|
|
34605
|
-
str = '["' + type + '",' + flatten(typedArray.buffer);
|
|
34606
|
-
if (typedArray.byteLength !== typedArray.buffer.byteLength) {
|
|
34607
|
-
str += `,${typedArray.byteOffset},${typedArray.length}`;
|
|
34608
|
-
}
|
|
34609
|
-
str += "]";
|
|
34610
|
-
break;
|
|
34611
|
-
}
|
|
34612
|
-
case "ArrayBuffer": {
|
|
34613
|
-
const arraybuffer = thing;
|
|
34614
|
-
const base642 = encode64(arraybuffer);
|
|
34615
|
-
str = `["ArrayBuffer","${base642}"]`;
|
|
34616
|
-
break;
|
|
34617
|
-
}
|
|
34618
|
-
case "Temporal.Duration":
|
|
34619
|
-
case "Temporal.Instant":
|
|
34620
|
-
case "Temporal.PlainDate":
|
|
34621
|
-
case "Temporal.PlainTime":
|
|
34622
|
-
case "Temporal.PlainDateTime":
|
|
34623
|
-
case "Temporal.PlainMonthDay":
|
|
34624
|
-
case "Temporal.PlainYearMonth":
|
|
34625
|
-
case "Temporal.ZonedDateTime":
|
|
34626
|
-
str = `["${type}",${stringify_string(thing.toString())}]`;
|
|
34627
|
-
break;
|
|
34628
|
-
default:
|
|
34629
|
-
if (!is_plain_object(thing)) {
|
|
34630
|
-
throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys2, thing, value);
|
|
34631
|
-
}
|
|
34632
|
-
if (enumerable_symbols(thing).length > 0) {
|
|
34633
|
-
throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys2, thing, value);
|
|
34634
|
-
}
|
|
34635
|
-
if (Object.getPrototypeOf(thing) === null) {
|
|
34636
|
-
str = '["null"';
|
|
34637
|
-
for (const key of Object.keys(thing)) {
|
|
34638
|
-
if (key === "__proto__") {
|
|
34639
|
-
throw new DevalueError(
|
|
34640
|
-
`Cannot stringify objects with __proto__ keys`,
|
|
34641
|
-
keys2,
|
|
34642
|
-
thing,
|
|
34643
|
-
value
|
|
34644
|
-
);
|
|
34645
|
-
}
|
|
34646
|
-
keys2.push(stringify_key(key));
|
|
34647
|
-
str += `,${stringify_string(key)},${flatten(thing[key])}`;
|
|
34648
|
-
keys2.pop();
|
|
34649
|
-
}
|
|
34650
|
-
str += "]";
|
|
34651
|
-
} else {
|
|
34652
|
-
str = "{";
|
|
34653
|
-
let started = false;
|
|
34654
|
-
for (const key of Object.keys(thing)) {
|
|
34655
|
-
if (key === "__proto__") {
|
|
34656
|
-
throw new DevalueError(
|
|
34657
|
-
`Cannot stringify objects with __proto__ keys`,
|
|
34658
|
-
keys2,
|
|
34659
|
-
thing,
|
|
34660
|
-
value
|
|
34661
|
-
);
|
|
34662
|
-
}
|
|
34663
|
-
if (started) str += ",";
|
|
34664
|
-
started = true;
|
|
34665
|
-
keys2.push(stringify_key(key));
|
|
34666
|
-
str += `${stringify_string(key)}:${flatten(thing[key])}`;
|
|
34667
|
-
keys2.pop();
|
|
34668
|
-
}
|
|
34669
|
-
str += "}";
|
|
34670
|
-
}
|
|
34671
|
-
}
|
|
34672
|
-
}
|
|
34673
|
-
stringified[index3] = str;
|
|
34674
|
-
return index3;
|
|
34675
|
-
}
|
|
34676
|
-
const index2 = flatten(value);
|
|
34677
|
-
if (index2 < 0) return `${index2}`;
|
|
34678
|
-
return stringified;
|
|
34679
|
-
}
|
|
34680
|
-
function stringify_primitive(thing) {
|
|
34681
|
-
const type = typeof thing;
|
|
34682
|
-
if (type === "string") return stringify_string(thing);
|
|
34683
|
-
if (thing === void 0) return UNDEFINED$2.toString();
|
|
34684
|
-
if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO.toString();
|
|
34685
|
-
if (type === "bigint") return `["BigInt","${thing}"]`;
|
|
34686
|
-
return String(thing);
|
|
34687
|
-
}
|
|
34688
|
-
const SerializationFormat$1 = {
|
|
34689
|
-
/** devalue stringify/parse with TextEncoder/TextDecoder */
|
|
34690
|
-
DEVALUE_V1: "devl",
|
|
34691
|
-
/** Encrypted payload (inner payload has its own format prefix after decryption) */
|
|
34692
|
-
ENCRYPTED: "encr",
|
|
34693
|
-
/** Gzip-compressed payload (inner payload has its own format prefix after decompression) */
|
|
34694
|
-
GZIP: "gzip",
|
|
34695
|
-
/** Zstandard-compressed payload (inner payload has its own format prefix after decompression) */
|
|
34696
|
-
ZSTD: "zstd"
|
|
34697
|
-
};
|
|
34698
|
-
const FORMAT_PREFIX_LENGTH$2 = 4;
|
|
34699
|
-
new TextEncoder();
|
|
34700
|
-
const formatDecoder$2 = new TextDecoder();
|
|
34701
|
-
function decodeFormatPrefix$1(data) {
|
|
34702
|
-
if (!(data instanceof Uint8Array)) {
|
|
34703
|
-
return {
|
|
34704
|
-
format: SerializationFormat$1.DEVALUE_V1,
|
|
34705
|
-
payload: new TextEncoder().encode(JSON.stringify(data))
|
|
34706
|
-
};
|
|
34707
|
-
}
|
|
34708
|
-
if (data.length < FORMAT_PREFIX_LENGTH$2) {
|
|
34709
|
-
throw new Error(`Data too short to contain format prefix: expected at least ${FORMAT_PREFIX_LENGTH$2} bytes, got ${data.length}`);
|
|
34710
|
-
}
|
|
34711
|
-
const prefixBytes = data.subarray(0, FORMAT_PREFIX_LENGTH$2);
|
|
34712
|
-
const format2 = formatDecoder$2.decode(prefixBytes);
|
|
34713
|
-
const knownFormats = Object.values(SerializationFormat$1);
|
|
34714
|
-
if (!knownFormats.includes(format2)) {
|
|
34715
|
-
throw new Error(`Unknown serialization format: "${format2}". Known formats: ${knownFormats.join(", ")}`);
|
|
34716
|
-
}
|
|
34717
|
-
const payload = data.subarray(FORMAT_PREFIX_LENGTH$2);
|
|
34718
|
-
return { format: format2, payload };
|
|
34719
|
-
}
|
|
34720
|
-
function isExpiredObject(data) {
|
|
34721
|
-
if (data === null || typeof data !== "object" || Array.isArray(data)) {
|
|
34722
|
-
return false;
|
|
34723
|
-
}
|
|
34724
|
-
const keys2 = Object.keys(data);
|
|
34725
|
-
return keys2.length === 1 && keys2[0] === "expiredAt" && typeof data.expiredAt === "string";
|
|
34726
|
-
}
|
|
34727
|
-
function isExpiredStub(data) {
|
|
34728
|
-
if (isExpiredObject(data))
|
|
34729
|
-
return true;
|
|
34730
|
-
if (Array.isArray(data) && data.length === 1 && isExpiredObject(data[0])) {
|
|
34731
|
-
return true;
|
|
34732
|
-
}
|
|
34733
|
-
return false;
|
|
34734
|
-
}
|
|
34735
|
-
function isEncryptedData(data) {
|
|
34736
|
-
if (!(data instanceof Uint8Array) || data.length < FORMAT_PREFIX_LENGTH$2) {
|
|
34737
|
-
return false;
|
|
34738
|
-
}
|
|
34739
|
-
const prefix = formatDecoder$2.decode(data.subarray(0, FORMAT_PREFIX_LENGTH$2));
|
|
34740
|
-
return prefix === SerializationFormat$1.ENCRYPTED;
|
|
34741
|
-
}
|
|
34742
|
-
function isCompressedData(data) {
|
|
34743
|
-
if (!(data instanceof Uint8Array) || data.length < FORMAT_PREFIX_LENGTH$2) {
|
|
34744
|
-
return false;
|
|
34745
|
-
}
|
|
34746
|
-
const prefix = formatDecoder$2.decode(data.subarray(0, FORMAT_PREFIX_LENGTH$2));
|
|
34747
|
-
return prefix === SerializationFormat$1.GZIP || prefix === SerializationFormat$1.ZSTD;
|
|
34748
|
-
}
|
|
34749
|
-
function getNodeZlib$2() {
|
|
34750
|
-
var _a3, _b2;
|
|
34751
|
-
try {
|
|
34752
|
-
return (_b2 = (_a3 = globalThis.process) == null ? void 0 : _a3.getBuiltinModule) == null ? void 0 : _b2.call(_a3, "node:zlib");
|
|
34753
|
-
} catch {
|
|
34754
|
-
return void 0;
|
|
34755
|
-
}
|
|
34756
|
-
}
|
|
34757
|
-
function decompressSyncIfAvailable(format2, payload) {
|
|
34758
|
-
try {
|
|
34759
|
-
const zlib = getNodeZlib$2();
|
|
34760
|
-
if (format2 === SerializationFormat$1.GZIP && (zlib == null ? void 0 : zlib.gunzipSync)) {
|
|
34761
|
-
return new Uint8Array(zlib.gunzipSync(payload));
|
|
34762
|
-
}
|
|
34763
|
-
if (format2 === SerializationFormat$1.ZSTD && (zlib == null ? void 0 : zlib.zstdDecompressSync)) {
|
|
34764
|
-
return new Uint8Array(zlib.zstdDecompressSync(payload));
|
|
34765
|
-
}
|
|
34766
|
-
} catch {
|
|
34767
|
-
}
|
|
34768
|
-
return void 0;
|
|
34769
|
-
}
|
|
34770
|
-
let zstdBrowserDecoder;
|
|
34771
|
-
function registerZstdDecoder(decoder2) {
|
|
34772
|
-
zstdBrowserDecoder = decoder2;
|
|
34773
|
-
}
|
|
34774
|
-
async function decompressAsync(format2, payload) {
|
|
34775
|
-
if (format2 === SerializationFormat$1.ZSTD) {
|
|
34776
|
-
const sync = decompressSyncIfAvailable(format2, payload);
|
|
34777
|
-
if (sync)
|
|
34778
|
-
return sync;
|
|
34779
|
-
if (zstdBrowserDecoder)
|
|
34780
|
-
return zstdBrowserDecoder(payload);
|
|
34781
|
-
throw new Error("zstd-compressed workflow data encountered but no zstd decoder is available. Node.js 22.15+ decodes natively; in the browser register one via registerZstdDecoder (the web o11y package does this).");
|
|
34782
|
-
}
|
|
34783
|
-
const transform2 = new DecompressionStream("gzip");
|
|
34784
|
-
const writer = transform2.writable.getWriter();
|
|
34785
|
-
const writePromise = writer.write(payload).then(() => writer.close());
|
|
34786
|
-
writePromise.catch(() => {
|
|
34787
|
-
});
|
|
34788
|
-
const chunks = [];
|
|
34789
|
-
let total = 0;
|
|
34790
|
-
const reader = transform2.readable.getReader();
|
|
34791
|
-
for (; ; ) {
|
|
34792
|
-
const { done, value } = await reader.read();
|
|
34793
|
-
if (done)
|
|
34794
|
-
break;
|
|
34795
|
-
chunks.push(value);
|
|
34796
|
-
total += value.length;
|
|
34797
|
-
}
|
|
34798
|
-
await writePromise;
|
|
34799
|
-
const out = new Uint8Array(total);
|
|
34800
|
-
let offset2 = 0;
|
|
34801
|
-
for (const chunk of chunks) {
|
|
34802
|
-
out.set(chunk, offset2);
|
|
34803
|
-
offset2 += chunk.length;
|
|
34804
|
-
}
|
|
34805
|
-
return out;
|
|
34806
|
-
}
|
|
34807
|
-
function hydrateData(value, revivers) {
|
|
34808
|
-
if (value instanceof Uint8Array) {
|
|
34809
|
-
if (isEncryptedData(value)) {
|
|
34810
|
-
return value;
|
|
34811
|
-
}
|
|
34812
|
-
const { format: format2, payload } = decodeFormatPrefix$1(value);
|
|
34813
|
-
if (format2 === SerializationFormat$1.DEVALUE_V1) {
|
|
34814
|
-
const str = new TextDecoder().decode(payload);
|
|
34815
|
-
return parse$7(str, revivers);
|
|
34816
|
-
}
|
|
34817
|
-
if (format2 === SerializationFormat$1.GZIP || format2 === SerializationFormat$1.ZSTD) {
|
|
34818
|
-
const inflated = decompressSyncIfAvailable(format2, payload);
|
|
34819
|
-
if (inflated === void 0) {
|
|
34820
|
-
return value;
|
|
34821
|
-
}
|
|
34822
|
-
return hydrateData(inflated, revivers);
|
|
34823
|
-
}
|
|
34824
|
-
throw new Error(`Unsupported serialization format: ${format2}`);
|
|
34825
|
-
}
|
|
34826
|
-
if (Array.isArray(value)) {
|
|
34827
|
-
return unflatten(value, revivers);
|
|
34828
|
-
}
|
|
34829
|
-
return value;
|
|
34830
|
-
}
|
|
34831
|
-
async function hydrateDataWithKey(value, revivers, key) {
|
|
34832
|
-
let data = value;
|
|
34833
|
-
if (data instanceof Uint8Array && isEncryptedData(data) && key) {
|
|
34834
|
-
const { decrypt: decrypt2 } = await Promise.resolve().then(() => encryption);
|
|
34835
|
-
const { payload } = decodeFormatPrefix$1(data);
|
|
34836
|
-
data = await decrypt2(key, payload);
|
|
34837
|
-
}
|
|
34838
|
-
if (data instanceof Uint8Array && isCompressedData(data)) {
|
|
34839
|
-
const { format: format2, payload } = decodeFormatPrefix$1(data);
|
|
34840
|
-
data = await decompressAsync(format2, payload);
|
|
34841
|
-
}
|
|
34842
|
-
return hydrateData(data, revivers);
|
|
34843
|
-
}
|
|
34844
|
-
const STREAM_ID_PREFIX = "strm_";
|
|
34845
|
-
const STREAM_REF_TYPE$1 = "__workflow_stream_ref__";
|
|
34846
|
-
const RUN_REF_TYPE$1 = "__workflow_run_ref__";
|
|
34847
|
-
const isRunRef$1 = (value) => {
|
|
34848
|
-
return value !== null && typeof value === "object" && "__type" in value && value.__type === RUN_REF_TYPE$1 && "runId" in value && typeof value.runId === "string";
|
|
34849
|
-
};
|
|
34850
|
-
const serializedRunToRunRef = (value) => {
|
|
34851
|
-
return { __type: RUN_REF_TYPE$1, runId: value.runId };
|
|
34852
|
-
};
|
|
34853
|
-
const CLASS_INSTANCE_REF_TYPE$1 = "__workflow_class_instance_ref__";
|
|
34854
|
-
class ClassInstanceRef {
|
|
34855
|
-
constructor(className, classId, data) {
|
|
34856
|
-
__publicField(this, "className");
|
|
34857
|
-
__publicField(this, "classId");
|
|
34858
|
-
__publicField(this, "data");
|
|
34859
|
-
__publicField(this, "__type", CLASS_INSTANCE_REF_TYPE$1);
|
|
34860
|
-
this.className = className;
|
|
34861
|
-
this.classId = classId;
|
|
34862
|
-
this.data = data;
|
|
34863
|
-
}
|
|
34864
|
-
toJSON() {
|
|
34865
|
-
return {
|
|
34866
|
-
__type: this.__type,
|
|
34867
|
-
className: this.className,
|
|
34868
|
-
classId: this.classId,
|
|
34869
|
-
data: this.data
|
|
34870
|
-
};
|
|
34871
|
-
}
|
|
34872
|
-
}
|
|
34873
|
-
const streamToStreamRef = (value) => {
|
|
34874
|
-
let streamId;
|
|
34875
|
-
if ("name" in value) {
|
|
34876
|
-
const name2 = String(value.name);
|
|
34877
|
-
if (!name2.startsWith(STREAM_ID_PREFIX)) {
|
|
34878
|
-
streamId = `${STREAM_ID_PREFIX}${name2}`;
|
|
34879
|
-
} else {
|
|
34880
|
-
streamId = name2;
|
|
34881
|
-
}
|
|
34882
|
-
} else {
|
|
34883
|
-
streamId = `${STREAM_ID_PREFIX}null`;
|
|
34884
|
-
}
|
|
34885
|
-
return { __type: STREAM_REF_TYPE$1, streamId };
|
|
34886
|
-
};
|
|
34887
|
-
const serializedStepFunctionToString = (value) => {
|
|
34888
|
-
if (!value)
|
|
34889
|
-
return "null";
|
|
34890
|
-
if (typeof value !== "object")
|
|
34891
|
-
return "null";
|
|
34892
|
-
if ("stepId" in value) {
|
|
34893
|
-
return `<step:${value.stepId}>`;
|
|
34894
|
-
}
|
|
34895
|
-
return "<function>";
|
|
34896
|
-
};
|
|
34897
|
-
const extractClassName = (classId) => {
|
|
34898
|
-
if (!classId)
|
|
34899
|
-
return "Unknown";
|
|
34900
|
-
const parts = classId.split("/");
|
|
34901
|
-
return parts[parts.length - 1] || classId;
|
|
34902
|
-
};
|
|
34903
|
-
const serializedInstanceToRef = (value) => {
|
|
34904
|
-
const className = extractClassName(value.classId);
|
|
34905
|
-
if (className === "Run" && value.data !== null && typeof value.data === "object" && "runId" in value.data && typeof value.data.runId === "string") {
|
|
34906
|
-
return serializedRunToRunRef(value.data);
|
|
34907
|
-
}
|
|
34908
|
-
return new ClassInstanceRef(className, value.classId, value.data);
|
|
34909
|
-
};
|
|
34910
|
-
const serializedClassToString = (value) => {
|
|
34911
|
-
return `<class:${extractClassName(value.classId)}>`;
|
|
34912
|
-
};
|
|
34913
|
-
const observabilityRevivers = {
|
|
34914
|
-
ReadableStream: streamToStreamRef,
|
|
34915
|
-
WritableStream: streamToStreamRef,
|
|
34916
|
-
TransformStream: streamToStreamRef,
|
|
34917
|
-
AbortController: (value) => `<AbortController(aborted: ${value.aborted})>`,
|
|
34918
|
-
AbortSignal: (value) => `<AbortSignal(aborted: ${value.aborted})>`,
|
|
34919
|
-
// DOMException needs an explicit reviver: without one, devalue.parse
|
|
34920
|
-
// throws on the `["DOMException", ...]` tag and `hydrateStepIO`'s
|
|
34921
|
-
// try/catch leaves the raw flat-encoded string in the UI. AbortController
|
|
34922
|
-
// synthesizes a DOMException as the default `signal.reason` when abort()
|
|
34923
|
-
// is called with no arg — so any abort that round-trips through a step
|
|
34924
|
-
// boundary surfaces here. Reconstruct as a real DOMException when the
|
|
34925
|
-
// global is available (modern browsers + Node 18+), else fall back to
|
|
34926
|
-
// an Error preserving name/message/stack/cause for display.
|
|
34927
|
-
DOMException: (value) => {
|
|
34928
|
-
const G2 = globalThis;
|
|
34929
|
-
if (typeof G2.DOMException === "function") {
|
|
34930
|
-
const e2 = new G2.DOMException(value.message, value.name);
|
|
34931
|
-
if (value.stack !== void 0)
|
|
34932
|
-
e2.stack = value.stack;
|
|
34933
|
-
if ("cause" in value)
|
|
34934
|
-
e2.cause = value.cause;
|
|
34935
|
-
return e2;
|
|
34936
|
-
}
|
|
34937
|
-
const e = new Error(value.message);
|
|
34938
|
-
e.name = value.name;
|
|
34939
|
-
if (value.stack !== void 0)
|
|
34940
|
-
e.stack = value.stack;
|
|
34941
|
-
if ("cause" in value)
|
|
34942
|
-
e.cause = value.cause;
|
|
34943
|
-
return e;
|
|
34944
|
-
},
|
|
34945
|
-
StepFunction: serializedStepFunctionToString,
|
|
34946
|
-
WorkflowFunction: (value) => `<workflow:${value.workflowId}>`,
|
|
34947
|
-
Instance: serializedInstanceToRef,
|
|
34948
|
-
Class: serializedClassToString
|
|
34949
|
-
};
|
|
34950
|
-
function hydrateStepIO(resource, revivers) {
|
|
34951
|
-
let hydratedInput = resource.input;
|
|
34952
|
-
let hydratedOutput = resource.output;
|
|
34953
|
-
let hydratedError = resource.error;
|
|
34954
|
-
if (resource.input != null) {
|
|
34955
|
-
try {
|
|
34956
|
-
hydratedInput = hydrateData(resource.input, revivers);
|
|
34957
|
-
} catch {
|
|
34958
|
-
}
|
|
34959
|
-
}
|
|
34960
|
-
if (resource.output != null) {
|
|
34961
|
-
try {
|
|
34962
|
-
hydratedOutput = hydrateData(resource.output, revivers);
|
|
34963
|
-
} catch {
|
|
34964
|
-
}
|
|
34965
|
-
}
|
|
34966
|
-
if (resource.error != null) {
|
|
34967
|
-
try {
|
|
34968
|
-
hydratedError = hydrateData(resource.error, revivers);
|
|
34969
|
-
} catch {
|
|
34970
|
-
}
|
|
34971
|
-
}
|
|
34972
|
-
return {
|
|
34973
|
-
...resource,
|
|
34974
|
-
input: hydratedInput,
|
|
34975
|
-
output: hydratedOutput,
|
|
34976
|
-
error: hydratedError
|
|
34977
|
-
};
|
|
34978
|
-
}
|
|
34979
|
-
function hydrateWorkflowIO(resource, revivers) {
|
|
34980
|
-
let hydratedInput = resource.input;
|
|
34981
|
-
let hydratedOutput = resource.output;
|
|
34982
|
-
let hydratedError = resource.error;
|
|
34983
|
-
if (resource.input != null) {
|
|
34984
|
-
try {
|
|
34985
|
-
hydratedInput = hydrateData(resource.input, revivers);
|
|
34986
|
-
} catch {
|
|
34987
|
-
}
|
|
34988
|
-
}
|
|
34989
|
-
if (resource.output != null) {
|
|
34990
|
-
try {
|
|
34991
|
-
hydratedOutput = hydrateData(resource.output, revivers);
|
|
34992
|
-
} catch {
|
|
34993
|
-
}
|
|
34994
|
-
}
|
|
34995
|
-
if (resource.error != null) {
|
|
34996
|
-
try {
|
|
34997
|
-
hydratedError = hydrateData(resource.error, revivers);
|
|
34998
|
-
} catch {
|
|
34999
|
-
}
|
|
35000
|
-
}
|
|
35001
|
-
return {
|
|
35002
|
-
...resource,
|
|
35003
|
-
input: hydratedInput,
|
|
35004
|
-
output: hydratedOutput,
|
|
35005
|
-
error: hydratedError
|
|
35006
|
-
};
|
|
35007
|
-
}
|
|
35008
|
-
function hydrateEventData(resource, revivers) {
|
|
35009
|
-
if (!resource.eventData)
|
|
35010
|
-
return resource;
|
|
35011
|
-
const eventData = { ...resource.eventData };
|
|
35012
|
-
if ("result" in eventData && eventData.result != null) {
|
|
35013
|
-
try {
|
|
35014
|
-
eventData.result = hydrateData(eventData.result, revivers);
|
|
35015
|
-
} catch {
|
|
35016
|
-
}
|
|
35017
|
-
}
|
|
35018
|
-
if ("input" in eventData && eventData.input != null) {
|
|
35019
|
-
try {
|
|
35020
|
-
eventData.input = hydrateData(eventData.input, revivers);
|
|
35021
|
-
} catch {
|
|
35022
|
-
}
|
|
35023
|
-
}
|
|
35024
|
-
if ("output" in eventData && eventData.output != null) {
|
|
35025
|
-
try {
|
|
35026
|
-
eventData.output = hydrateData(eventData.output, revivers);
|
|
35027
|
-
} catch {
|
|
35028
|
-
}
|
|
35029
|
-
}
|
|
35030
|
-
if ("metadata" in eventData && eventData.metadata != null) {
|
|
35031
|
-
try {
|
|
35032
|
-
eventData.metadata = hydrateData(eventData.metadata, revivers);
|
|
35033
|
-
} catch {
|
|
35034
|
-
}
|
|
35035
|
-
}
|
|
35036
|
-
if ("payload" in eventData && eventData.payload != null) {
|
|
35037
|
-
try {
|
|
35038
|
-
eventData.payload = hydrateData(eventData.payload, revivers);
|
|
35039
|
-
} catch {
|
|
35040
|
-
}
|
|
35041
|
-
}
|
|
35042
|
-
if ("error" in eventData && eventData.error != null) {
|
|
35043
|
-
try {
|
|
35044
|
-
eventData.error = hydrateData(eventData.error, revivers);
|
|
35045
|
-
} catch {
|
|
35046
|
-
}
|
|
35047
|
-
}
|
|
35048
|
-
return { ...resource, eventData };
|
|
35049
|
-
}
|
|
35050
|
-
function hydrateHookMetadata(resource, revivers) {
|
|
35051
|
-
if (resource.metadata == null)
|
|
35052
|
-
return resource;
|
|
35053
|
-
let hydratedMetadata = resource.metadata;
|
|
35054
|
-
try {
|
|
35055
|
-
hydratedMetadata = hydrateData(resource.metadata, revivers);
|
|
35056
|
-
} catch {
|
|
35057
|
-
}
|
|
35058
|
-
return { ...resource, metadata: hydratedMetadata };
|
|
35059
|
-
}
|
|
35060
|
-
function hydrateResourceIO$1(resource, revivers) {
|
|
35061
|
-
if (!resource)
|
|
35062
|
-
return resource;
|
|
35063
|
-
let hydrated;
|
|
35064
|
-
if ("stepId" in resource) {
|
|
35065
|
-
hydrated = hydrateStepIO(resource, revivers);
|
|
35066
|
-
} else if ("hookId" in resource) {
|
|
35067
|
-
hydrated = hydrateHookMetadata(resource, revivers);
|
|
35068
|
-
} else if ("eventId" in resource) {
|
|
35069
|
-
hydrated = hydrateEventData(resource, revivers);
|
|
35070
|
-
} else {
|
|
35071
|
-
hydrated = hydrateWorkflowIO(resource, revivers);
|
|
35072
|
-
}
|
|
35073
|
-
if ("executionContext" in hydrated) {
|
|
35074
|
-
const { executionContext, ...rest } = hydrated;
|
|
35075
|
-
const workflowCoreVersion = executionContext && typeof executionContext === "object" && "workflowCoreVersion" in executionContext ? executionContext.workflowCoreVersion : void 0;
|
|
35076
|
-
if (workflowCoreVersion) {
|
|
35077
|
-
return { ...rest, workflowCoreVersion };
|
|
35078
|
-
}
|
|
35079
|
-
return rest;
|
|
35080
|
-
}
|
|
35081
|
-
return hydrated;
|
|
35082
|
-
}
|
|
35083
|
-
const serializationFormat = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
35084
|
-
__proto__: null,
|
|
35085
|
-
CLASS_INSTANCE_REF_TYPE: CLASS_INSTANCE_REF_TYPE$1,
|
|
35086
|
-
ClassInstanceRef,
|
|
35087
|
-
RUN_REF_TYPE: RUN_REF_TYPE$1,
|
|
35088
|
-
STREAM_REF_TYPE: STREAM_REF_TYPE$1,
|
|
35089
|
-
SerializationFormat: SerializationFormat$1,
|
|
35090
|
-
decodeFormatPrefix: decodeFormatPrefix$1,
|
|
35091
|
-
extractClassName,
|
|
35092
|
-
hydrateData,
|
|
35093
|
-
hydrateDataWithKey,
|
|
35094
|
-
hydrateResourceIO: hydrateResourceIO$1,
|
|
35095
|
-
isCompressedData,
|
|
35096
|
-
isEncryptedData,
|
|
35097
|
-
isExpiredStub,
|
|
35098
|
-
isRunRef: isRunRef$1,
|
|
35099
|
-
observabilityRevivers,
|
|
35100
|
-
registerZstdDecoder,
|
|
35101
|
-
serializedClassToString,
|
|
35102
|
-
serializedInstanceToRef,
|
|
35103
|
-
serializedRunToRunRef,
|
|
35104
|
-
serializedStepFunctionToString,
|
|
35105
|
-
streamToStreamRef
|
|
35106
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
35107
34130
|
const NEVER = Object.freeze({
|
|
35108
34131
|
status: "aborted"
|
|
35109
34132
|
});
|
|
@@ -36003,7 +35026,7 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
|
36003
35026
|
}
|
|
36004
35027
|
return result.value;
|
|
36005
35028
|
};
|
|
36006
|
-
const parse$
|
|
35029
|
+
const parse$7 = /* @__PURE__ */ _parse($ZodRealError);
|
|
36007
35030
|
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
36008
35031
|
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
36009
35032
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -38682,10 +37705,10 @@ const $ZodFunction = /* @__PURE__ */ $constructor("$ZodFunction", (inst, def) =>
|
|
|
38682
37705
|
throw new Error("implement() must be called with a function");
|
|
38683
37706
|
}
|
|
38684
37707
|
return function(...args) {
|
|
38685
|
-
const parsedArgs = inst._def.input ? parse$
|
|
37708
|
+
const parsedArgs = inst._def.input ? parse$7(inst._def.input, args) : args;
|
|
38686
37709
|
const result = Reflect.apply(func, this, parsedArgs);
|
|
38687
37710
|
if (inst._def.output) {
|
|
38688
|
-
return parse$
|
|
37711
|
+
return parse$7(inst._def.output, result);
|
|
38689
37712
|
}
|
|
38690
37713
|
return result;
|
|
38691
37714
|
};
|
|
@@ -46612,7 +45635,7 @@ const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
46612
45635
|
isValidJWT,
|
|
46613
45636
|
locales: index$3,
|
|
46614
45637
|
meta: meta$1,
|
|
46615
|
-
parse: parse$
|
|
45638
|
+
parse: parse$7,
|
|
46616
45639
|
parseAsync: parseAsync$1,
|
|
46617
45640
|
prettifyError,
|
|
46618
45641
|
process: process$1,
|
|
@@ -46739,7 +45762,7 @@ const ZodError = $constructor("ZodError", initializer);
|
|
|
46739
45762
|
const ZodRealError = $constructor("ZodError", initializer, {
|
|
46740
45763
|
Parent: Error
|
|
46741
45764
|
});
|
|
46742
|
-
const parse$
|
|
45765
|
+
const parse$6 = /* @__PURE__ */ _parse(ZodRealError);
|
|
46743
45766
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
46744
45767
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
46745
45768
|
const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
@@ -46780,7 +45803,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
46780
45803
|
reg.add(inst, meta2);
|
|
46781
45804
|
return inst;
|
|
46782
45805
|
});
|
|
46783
|
-
inst.parse = (data, params) => parse$
|
|
45806
|
+
inst.parse = (data, params) => parse$6(inst, data, params, { callee: inst.parse });
|
|
46784
45807
|
inst.safeParse = (data, params) => safeParse(inst, data, params);
|
|
46785
45808
|
inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
|
|
46786
45809
|
inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
|
|
@@ -48698,7 +47721,7 @@ const z$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
48698
47721
|
object: object$1,
|
|
48699
47722
|
optional,
|
|
48700
47723
|
overwrite: _overwrite,
|
|
48701
|
-
parse: parse$
|
|
47724
|
+
parse: parse$6,
|
|
48702
47725
|
parseAsync,
|
|
48703
47726
|
partialRecord,
|
|
48704
47727
|
pipe,
|
|
@@ -48849,40 +47872,6 @@ const SerializedDataSchema = union([
|
|
|
48849
47872
|
BinarySerializedDataSchema,
|
|
48850
47873
|
LegacySerializedDataSchemaV1
|
|
48851
47874
|
]);
|
|
48852
|
-
const EVENT_DATA_REF_FIELDS = {
|
|
48853
|
-
run_created: ["input"],
|
|
48854
|
-
run_completed: ["output"],
|
|
48855
|
-
run_failed: ["error"],
|
|
48856
|
-
step_created: ["input"],
|
|
48857
|
-
step_completed: ["result"],
|
|
48858
|
-
step_failed: ["error"],
|
|
48859
|
-
step_retrying: ["error"],
|
|
48860
|
-
hook_created: ["metadata"],
|
|
48861
|
-
hook_received: ["payload"]
|
|
48862
|
-
};
|
|
48863
|
-
function stripEventDataRefs(event, resolveData) {
|
|
48864
|
-
if (resolveData !== "none")
|
|
48865
|
-
return event;
|
|
48866
|
-
if (!("eventData" in event))
|
|
48867
|
-
return event;
|
|
48868
|
-
const eventData = event.eventData;
|
|
48869
|
-
if (!eventData || typeof eventData !== "object") {
|
|
48870
|
-
const { eventData: _3, ...rest2 } = event;
|
|
48871
|
-
return rest2;
|
|
48872
|
-
}
|
|
48873
|
-
const refFields = EVENT_DATA_REF_FIELDS[event.eventType];
|
|
48874
|
-
if (!refFields || refFields.length === 0)
|
|
48875
|
-
return event;
|
|
48876
|
-
const stripped = { ...eventData };
|
|
48877
|
-
for (const field of refFields) {
|
|
48878
|
-
delete stripped[field];
|
|
48879
|
-
}
|
|
48880
|
-
const { eventData: _2, ...rest } = event;
|
|
48881
|
-
return {
|
|
48882
|
-
...rest,
|
|
48883
|
-
...Object.keys(stripped).length > 0 ? { eventData: stripped } : {}
|
|
48884
|
-
};
|
|
48885
|
-
}
|
|
48886
47875
|
const EventTypeSchema = _enum([
|
|
48887
47876
|
// Run lifecycle events
|
|
48888
47877
|
"run_created",
|
|
@@ -48908,6 +47897,14 @@ const EventTypeSchema = _enum([
|
|
|
48908
47897
|
"wait_created",
|
|
48909
47898
|
"wait_completed"
|
|
48910
47899
|
]);
|
|
47900
|
+
const RunEventTypeSchema = EventTypeSchema.extract([
|
|
47901
|
+
"run_created",
|
|
47902
|
+
"run_started",
|
|
47903
|
+
"run_completed",
|
|
47904
|
+
"run_failed",
|
|
47905
|
+
"run_cancelled"
|
|
47906
|
+
]);
|
|
47907
|
+
RunEventTypeSchema.options;
|
|
48911
47908
|
const TerminalRunEventTypeSchema = EventTypeSchema.extract([
|
|
48912
47909
|
"run_completed",
|
|
48913
47910
|
"run_failed",
|
|
@@ -48917,6 +47914,102 @@ const TERMINAL_RUN_EVENT_TYPES = TerminalRunEventTypeSchema.options;
|
|
|
48917
47914
|
function isTerminalRunEventType(eventType) {
|
|
48918
47915
|
return TERMINAL_RUN_EVENT_TYPES.includes(eventType);
|
|
48919
47916
|
}
|
|
47917
|
+
const StepEventTypeSchema = EventTypeSchema.extract([
|
|
47918
|
+
"step_created",
|
|
47919
|
+
"step_completed",
|
|
47920
|
+
"step_failed",
|
|
47921
|
+
"step_retrying",
|
|
47922
|
+
"step_started"
|
|
47923
|
+
]);
|
|
47924
|
+
const STEP_EVENT_TYPES = StepEventTypeSchema.options;
|
|
47925
|
+
function isStepEventType(eventType) {
|
|
47926
|
+
return STEP_EVENT_TYPES.includes(eventType);
|
|
47927
|
+
}
|
|
47928
|
+
const TerminalStepEventTypeSchema = EventTypeSchema.extract([
|
|
47929
|
+
"step_completed",
|
|
47930
|
+
"step_failed"
|
|
47931
|
+
]);
|
|
47932
|
+
const TERMINAL_STEP_EVENT_TYPES = TerminalStepEventTypeSchema.options;
|
|
47933
|
+
function isTerminalStepEventType(eventType) {
|
|
47934
|
+
return TERMINAL_STEP_EVENT_TYPES.includes(eventType);
|
|
47935
|
+
}
|
|
47936
|
+
const HookLifecycleEventTypeSchema = EventTypeSchema.extract([
|
|
47937
|
+
"hook_created",
|
|
47938
|
+
"hook_received",
|
|
47939
|
+
"hook_disposed"
|
|
47940
|
+
]);
|
|
47941
|
+
const HOOK_LIFECYCLE_EVENT_TYPES = HookLifecycleEventTypeSchema.options;
|
|
47942
|
+
function isHookLifecycleEventType(eventType) {
|
|
47943
|
+
return HOOK_LIFECYCLE_EVENT_TYPES.includes(eventType);
|
|
47944
|
+
}
|
|
47945
|
+
const HookEventRequiringExistenceTypeSchema = EventTypeSchema.extract([
|
|
47946
|
+
"hook_disposed",
|
|
47947
|
+
"hook_received"
|
|
47948
|
+
]);
|
|
47949
|
+
const HOOK_EVENTS_REQUIRING_EXISTENCE = HookEventRequiringExistenceTypeSchema.options;
|
|
47950
|
+
function isHookEventRequiringExistence(eventType) {
|
|
47951
|
+
return HOOK_EVENTS_REQUIRING_EXISTENCE.includes(eventType);
|
|
47952
|
+
}
|
|
47953
|
+
const WaitEventTypeSchema = EventTypeSchema.extract([
|
|
47954
|
+
"wait_created",
|
|
47955
|
+
"wait_completed"
|
|
47956
|
+
]);
|
|
47957
|
+
const WAIT_EVENT_TYPES = WaitEventTypeSchema.options;
|
|
47958
|
+
function isWaitEventType(eventType) {
|
|
47959
|
+
return WAIT_EVENT_TYPES.includes(eventType);
|
|
47960
|
+
}
|
|
47961
|
+
const ChildEntityCreationEventTypeSchema = EventTypeSchema.extract([
|
|
47962
|
+
"step_created",
|
|
47963
|
+
"hook_created",
|
|
47964
|
+
"wait_created"
|
|
47965
|
+
]);
|
|
47966
|
+
const CHILD_ENTITY_CREATION_EVENT_TYPES = ChildEntityCreationEventTypeSchema.options;
|
|
47967
|
+
function isChildEntityCreationEventType(eventType) {
|
|
47968
|
+
return CHILD_ENTITY_CREATION_EVENT_TYPES.includes(eventType);
|
|
47969
|
+
}
|
|
47970
|
+
const EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE = {
|
|
47971
|
+
run_created: "input",
|
|
47972
|
+
run_started: "input",
|
|
47973
|
+
run_completed: "output",
|
|
47974
|
+
run_failed: "error",
|
|
47975
|
+
step_created: "input",
|
|
47976
|
+
step_started: "input",
|
|
47977
|
+
step_completed: "result",
|
|
47978
|
+
step_failed: "error",
|
|
47979
|
+
step_retrying: "error",
|
|
47980
|
+
hook_created: "metadata",
|
|
47981
|
+
hook_received: "payload"
|
|
47982
|
+
};
|
|
47983
|
+
const EVENT_DATA_REF_FIELDS = Object.fromEntries(Object.entries(EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE).map(([eventType, field]) => [eventType, [field]]));
|
|
47984
|
+
function getEventDataRefFields(eventType) {
|
|
47985
|
+
return EVENT_DATA_REF_FIELDS[eventType] ?? [];
|
|
47986
|
+
}
|
|
47987
|
+
function getEventDataPayloadField(eventType) {
|
|
47988
|
+
return EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE[eventType];
|
|
47989
|
+
}
|
|
47990
|
+
function stripEventDataRefs(event, resolveData) {
|
|
47991
|
+
if (resolveData !== "none")
|
|
47992
|
+
return event;
|
|
47993
|
+
if (!("eventData" in event))
|
|
47994
|
+
return event;
|
|
47995
|
+
const eventData = event.eventData;
|
|
47996
|
+
if (!eventData || typeof eventData !== "object") {
|
|
47997
|
+
const { eventData: _3, ...rest2 } = event;
|
|
47998
|
+
return rest2;
|
|
47999
|
+
}
|
|
48000
|
+
const refFields = getEventDataRefFields(event.eventType);
|
|
48001
|
+
if (refFields.length === 0)
|
|
48002
|
+
return event;
|
|
48003
|
+
const stripped = { ...eventData };
|
|
48004
|
+
for (const field of refFields) {
|
|
48005
|
+
delete stripped[field];
|
|
48006
|
+
}
|
|
48007
|
+
const { eventData: _2, ...rest } = event;
|
|
48008
|
+
return {
|
|
48009
|
+
...rest,
|
|
48010
|
+
...Object.keys(stripped).length > 0 ? { eventData: stripped } : {}
|
|
48011
|
+
};
|
|
48012
|
+
}
|
|
48920
48013
|
const BaseEventSchema = object$1({
|
|
48921
48014
|
eventType: EventTypeSchema,
|
|
48922
48015
|
correlationId: string$3().optional(),
|
|
@@ -48933,6 +48026,10 @@ const stepLatencyTelemetryFields = {
|
|
|
48933
48026
|
// two steps ran back-to-back (the previous event-log entry is a
|
|
48934
48027
|
// step_completed/step_failed).
|
|
48935
48028
|
stso: number$3().optional(),
|
|
48029
|
+
// Progress counters taken when the STSO gap began. Only present alongside
|
|
48030
|
+
// stso.
|
|
48031
|
+
stepCount: number$3().int().positive().optional(),
|
|
48032
|
+
eventCount: number$3().int().positive().optional(),
|
|
48936
48033
|
// Names of the runtime's optional startup-latency optimizations that were
|
|
48937
48034
|
// active for this measurement (e.g. 'turbo', 'lazyStepStart',
|
|
48938
48035
|
// 'optimisticStart'), so latency metrics can be segmented by them.
|
|
@@ -48984,7 +48081,20 @@ const StepStartedEventSchema = BaseEventSchema.extend({
|
|
|
48984
48081
|
workflowName: string$3().optional(),
|
|
48985
48082
|
// Lazy-start: the dehydrated step input, present only when this
|
|
48986
48083
|
// step_started is also responsible for creating the step.
|
|
48987
|
-
input: SerializedDataSchema.optional()
|
|
48084
|
+
input: SerializedDataSchema.optional(),
|
|
48085
|
+
// Inline step ownership: the queue message ID of the invocation whose
|
|
48086
|
+
// handler is executing this step's body inline. Stamped on the lazy
|
|
48087
|
+
// step_started (and re-stamped on an owner-recovery bare start) so
|
|
48088
|
+
// that a wake replay can tell "this attempt is in flight in a live
|
|
48089
|
+
// invocation" apart from "this attempt died with its process" — the
|
|
48090
|
+
// owner's queue message doubles as the liveness lease (a crash means
|
|
48091
|
+
// the queue redelivers that same messageId, which is allowed to
|
|
48092
|
+
// re-execute). Ownership derives from the step's LATEST step_started:
|
|
48093
|
+
// an unstamped bare start (a retry attempt driven by a queued step
|
|
48094
|
+
// message) clears it. Absent on eager steps and from older runtimes.
|
|
48095
|
+
// Requires the queue's messageId to be stable across redeliveries of
|
|
48096
|
+
// one message (see the Queue.createQueueHandler meta contract).
|
|
48097
|
+
ownerMessageId: string$3().optional()
|
|
48988
48098
|
}).optional()
|
|
48989
48099
|
});
|
|
48990
48100
|
const StepCreatedEventSchema = BaseEventSchema.extend({
|
|
@@ -49167,6 +48277,12 @@ const EventSchema = AllEventsSchema.and(object$1({
|
|
|
49167
48277
|
occurredAt: date$2().optional(),
|
|
49168
48278
|
specVersion: number$3().optional()
|
|
49169
48279
|
}));
|
|
48280
|
+
function isChildEntityCreationEvent(event) {
|
|
48281
|
+
var _a3;
|
|
48282
|
+
if (isChildEntityCreationEventType(event.eventType))
|
|
48283
|
+
return true;
|
|
48284
|
+
return event.eventType === "step_started" && typeof ((_a3 = event.eventData) == null ? void 0 : _a3.stepName) === "string" && event.eventData.input !== void 0;
|
|
48285
|
+
}
|
|
49170
48286
|
const WorkflowRunStatusSchema = _enum([
|
|
49171
48287
|
"pending",
|
|
49172
48288
|
"running",
|
|
@@ -49772,6 +48888,7 @@ function monotonicFactory(prng) {
|
|
|
49772
48888
|
};
|
|
49773
48889
|
}
|
|
49774
48890
|
const UlidSchema = string$3().ulid();
|
|
48891
|
+
const workflowRunIdSchema = templateLiteral(["wrun_", ulid$2()]);
|
|
49775
48892
|
const DEFAULT_TIMESTAMP_THRESHOLD_PAST_MS = 24 * 60 * 60 * 1e3;
|
|
49776
48893
|
const DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS = 5 * 60 * 1e3;
|
|
49777
48894
|
function ulidToDate(maybeUlid) {
|
|
@@ -49802,18 +48919,955 @@ function validateUlidTimestamp(prefixedUlid, prefix, pastThresholdMs = DEFAULT_T
|
|
|
49802
48919
|
const thresholdSeconds = Math.round(thresholdMs / 1e3);
|
|
49803
48920
|
return `Invalid runId timestamp: embedded timestamp is ${driftSeconds}s in the ${direction} (threshold: ${thresholdSeconds}s)`;
|
|
49804
48921
|
}
|
|
49805
|
-
const
|
|
49806
|
-
|
|
49807
|
-
|
|
48922
|
+
const UNDEFINED$2 = -1;
|
|
48923
|
+
const HOLE = -2;
|
|
48924
|
+
const NAN = -3;
|
|
48925
|
+
const POSITIVE_INFINITY = -4;
|
|
48926
|
+
const NEGATIVE_INFINITY = -5;
|
|
48927
|
+
const NEGATIVE_ZERO = -6;
|
|
48928
|
+
const SPARSE = -7;
|
|
48929
|
+
const MAX_ARRAY_LEN = 2 ** 32 - 1;
|
|
48930
|
+
const MAX_ARRAY_INDEX = MAX_ARRAY_LEN - 1;
|
|
48931
|
+
class DevalueError extends Error {
|
|
48932
|
+
/**
|
|
48933
|
+
* @param {string} message
|
|
48934
|
+
* @param {string[]} keys
|
|
48935
|
+
* @param {any} [value] - The value that failed to be serialized
|
|
48936
|
+
* @param {any} [root] - The root value being serialized
|
|
48937
|
+
*/
|
|
48938
|
+
constructor(message2, keys2, value, root2) {
|
|
48939
|
+
super(message2);
|
|
48940
|
+
this.name = "DevalueError";
|
|
48941
|
+
this.path = keys2.join("");
|
|
48942
|
+
this.value = value;
|
|
48943
|
+
this.root = root2;
|
|
48944
|
+
}
|
|
48945
|
+
}
|
|
48946
|
+
function is_primitive(thing) {
|
|
48947
|
+
return thing === null || typeof thing !== "object" && typeof thing !== "function";
|
|
48948
|
+
}
|
|
48949
|
+
const object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
48950
|
+
function is_plain_object(thing) {
|
|
48951
|
+
const proto2 = Object.getPrototypeOf(thing);
|
|
48952
|
+
return proto2 === Object.prototype || proto2 === null || Object.getPrototypeOf(proto2) === null || Object.getOwnPropertyNames(proto2).sort().join("\0") === object_proto_names;
|
|
48953
|
+
}
|
|
48954
|
+
function get_type(thing) {
|
|
48955
|
+
return Object.prototype.toString.call(thing).slice(8, -1);
|
|
48956
|
+
}
|
|
48957
|
+
function get_escaped_char(char) {
|
|
48958
|
+
switch (char) {
|
|
48959
|
+
case '"':
|
|
48960
|
+
return '\\"';
|
|
48961
|
+
case "<":
|
|
48962
|
+
return "\\u003C";
|
|
48963
|
+
case "\\":
|
|
48964
|
+
return "\\\\";
|
|
48965
|
+
case "\n":
|
|
48966
|
+
return "\\n";
|
|
48967
|
+
case "\r":
|
|
48968
|
+
return "\\r";
|
|
48969
|
+
case " ":
|
|
48970
|
+
return "\\t";
|
|
48971
|
+
case "\b":
|
|
48972
|
+
return "\\b";
|
|
48973
|
+
case "\f":
|
|
48974
|
+
return "\\f";
|
|
48975
|
+
case "\u2028":
|
|
48976
|
+
return "\\u2028";
|
|
48977
|
+
case "\u2029":
|
|
48978
|
+
return "\\u2029";
|
|
48979
|
+
default:
|
|
48980
|
+
return char < " " ? `\\u${char.charCodeAt(0).toString(16).padStart(4, "0")}` : "";
|
|
48981
|
+
}
|
|
48982
|
+
}
|
|
48983
|
+
function stringify_string(str) {
|
|
48984
|
+
let result = "";
|
|
48985
|
+
let last_pos = 0;
|
|
48986
|
+
const len = str.length;
|
|
48987
|
+
for (let i = 0; i < len; i += 1) {
|
|
48988
|
+
const char = str[i];
|
|
48989
|
+
const replacement = get_escaped_char(char);
|
|
48990
|
+
if (replacement) {
|
|
48991
|
+
result += str.slice(last_pos, i) + replacement;
|
|
48992
|
+
last_pos = i + 1;
|
|
48993
|
+
}
|
|
48994
|
+
}
|
|
48995
|
+
return `"${last_pos === 0 ? str : result + str.slice(last_pos)}"`;
|
|
48996
|
+
}
|
|
48997
|
+
function enumerable_symbols(object2) {
|
|
48998
|
+
return Object.getOwnPropertySymbols(object2).filter(
|
|
48999
|
+
(symbol2) => Object.getOwnPropertyDescriptor(object2, symbol2).enumerable
|
|
49000
|
+
);
|
|
49001
|
+
}
|
|
49002
|
+
const is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
|
|
49003
|
+
function stringify_key(key) {
|
|
49004
|
+
return is_identifier.test(key) ? "." + key : "[" + JSON.stringify(key) + "]";
|
|
49005
|
+
}
|
|
49006
|
+
function is_valid_array_index(n) {
|
|
49007
|
+
if (!Number.isInteger(n)) return false;
|
|
49008
|
+
if (n < 0) return false;
|
|
49009
|
+
if (n > MAX_ARRAY_INDEX) return false;
|
|
49010
|
+
return true;
|
|
49011
|
+
}
|
|
49012
|
+
function is_valid_array_len(n) {
|
|
49013
|
+
if (!Number.isInteger(n)) return false;
|
|
49014
|
+
if (n < 0) return false;
|
|
49015
|
+
if (n > MAX_ARRAY_LEN) return false;
|
|
49016
|
+
return true;
|
|
49017
|
+
}
|
|
49018
|
+
function is_valid_array_index_string(s2) {
|
|
49019
|
+
if (s2.length === 0) return false;
|
|
49020
|
+
if (s2.length > 1 && s2.charCodeAt(0) === 48) return false;
|
|
49021
|
+
for (let i = 0; i < s2.length; i++) {
|
|
49022
|
+
const c = s2.charCodeAt(i);
|
|
49023
|
+
if (c < 48 || c > 57) return false;
|
|
49024
|
+
}
|
|
49025
|
+
return is_valid_array_index(+s2);
|
|
49026
|
+
}
|
|
49027
|
+
function valid_array_indices(array2) {
|
|
49028
|
+
const keys2 = Object.keys(array2);
|
|
49029
|
+
for (var i = keys2.length - 1; i >= 0; i--) {
|
|
49030
|
+
if (is_valid_array_index_string(keys2[i])) {
|
|
49031
|
+
break;
|
|
49032
|
+
}
|
|
49033
|
+
}
|
|
49034
|
+
keys2.length = i + 1;
|
|
49035
|
+
return keys2;
|
|
49036
|
+
}
|
|
49037
|
+
function encode_native(array_buffer) {
|
|
49038
|
+
return new Uint8Array(array_buffer).toBase64();
|
|
49039
|
+
}
|
|
49040
|
+
function decode_native(base642) {
|
|
49041
|
+
return Uint8Array.fromBase64(base642).buffer;
|
|
49042
|
+
}
|
|
49043
|
+
function encode_buffer(array_buffer) {
|
|
49044
|
+
return Buffer.from(array_buffer).toString("base64");
|
|
49045
|
+
}
|
|
49046
|
+
function decode_buffer(base642) {
|
|
49047
|
+
return Uint8Array.from(Buffer.from(base642, "base64")).buffer;
|
|
49048
|
+
}
|
|
49049
|
+
function encode_legacy(array_buffer) {
|
|
49050
|
+
const array2 = new Uint8Array(array_buffer);
|
|
49051
|
+
let binary = "";
|
|
49052
|
+
const chunk_size = 32768;
|
|
49053
|
+
for (let i = 0; i < array2.length; i += chunk_size) {
|
|
49054
|
+
const chunk = array2.subarray(i, i + chunk_size);
|
|
49055
|
+
binary += String.fromCharCode.apply(null, chunk);
|
|
49056
|
+
}
|
|
49057
|
+
return btoa(binary);
|
|
49058
|
+
}
|
|
49059
|
+
function decode_legacy(base642) {
|
|
49060
|
+
const binary_string = atob(base642);
|
|
49061
|
+
const len = binary_string.length;
|
|
49062
|
+
const array2 = new Uint8Array(len);
|
|
49063
|
+
for (let i = 0; i < len; i++) {
|
|
49064
|
+
array2[i] = binary_string.charCodeAt(i);
|
|
49065
|
+
}
|
|
49066
|
+
return array2.buffer;
|
|
49067
|
+
}
|
|
49068
|
+
const native = typeof Uint8Array.fromBase64 === "function";
|
|
49069
|
+
const buffer = typeof process === "object" && ((_a2 = process.versions) == null ? void 0 : _a2.node) !== void 0;
|
|
49070
|
+
const encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy;
|
|
49071
|
+
const decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;
|
|
49072
|
+
function parse$5(serialized, revivers) {
|
|
49073
|
+
return unflatten(JSON.parse(serialized), revivers);
|
|
49074
|
+
}
|
|
49075
|
+
function unflatten(parsed, revivers) {
|
|
49076
|
+
if (typeof parsed === "number") return hydrate(parsed, true);
|
|
49077
|
+
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
49078
|
+
throw new Error("Invalid input");
|
|
49079
|
+
}
|
|
49080
|
+
const values = (
|
|
49081
|
+
/** @type {any[]} */
|
|
49082
|
+
parsed
|
|
49083
|
+
);
|
|
49084
|
+
const hydrated = Array(values.length);
|
|
49085
|
+
let hydrating = null;
|
|
49086
|
+
function hydrate(index2, standalone = false) {
|
|
49087
|
+
if (index2 === UNDEFINED$2) return void 0;
|
|
49088
|
+
if (index2 === NAN) return NaN;
|
|
49089
|
+
if (index2 === POSITIVE_INFINITY) return Infinity;
|
|
49090
|
+
if (index2 === NEGATIVE_INFINITY) return -Infinity;
|
|
49091
|
+
if (index2 === NEGATIVE_ZERO) return -0;
|
|
49092
|
+
if (standalone || typeof index2 !== "number") {
|
|
49093
|
+
throw new Error(`Invalid input`);
|
|
49094
|
+
}
|
|
49095
|
+
if (index2 in hydrated) return hydrated[index2];
|
|
49096
|
+
const value = values[index2];
|
|
49097
|
+
if (!value || typeof value !== "object") {
|
|
49098
|
+
hydrated[index2] = value;
|
|
49099
|
+
} else if (Array.isArray(value)) {
|
|
49100
|
+
if (typeof value[0] === "string") {
|
|
49101
|
+
const type = value[0];
|
|
49102
|
+
const reviver = revivers && Object.hasOwn(revivers, type) ? revivers[type] : void 0;
|
|
49103
|
+
if (reviver) {
|
|
49104
|
+
let i = value[1];
|
|
49105
|
+
if (typeof i !== "number") {
|
|
49106
|
+
i = values.push(value[1]) - 1;
|
|
49107
|
+
}
|
|
49108
|
+
hydrating ?? (hydrating = /* @__PURE__ */ new Set());
|
|
49109
|
+
if (hydrating.has(i)) {
|
|
49110
|
+
throw new Error("Invalid circular reference");
|
|
49111
|
+
}
|
|
49112
|
+
hydrating.add(i);
|
|
49113
|
+
hydrated[index2] = reviver(hydrate(i));
|
|
49114
|
+
hydrating.delete(i);
|
|
49115
|
+
return hydrated[index2];
|
|
49116
|
+
}
|
|
49117
|
+
switch (type) {
|
|
49118
|
+
case "Date":
|
|
49119
|
+
hydrated[index2] = new Date(value[1]);
|
|
49120
|
+
break;
|
|
49121
|
+
case "Set":
|
|
49122
|
+
const set2 = /* @__PURE__ */ new Set();
|
|
49123
|
+
hydrated[index2] = set2;
|
|
49124
|
+
for (let i = 1; i < value.length; i += 1) {
|
|
49125
|
+
set2.add(hydrate(value[i]));
|
|
49126
|
+
}
|
|
49127
|
+
break;
|
|
49128
|
+
case "Map":
|
|
49129
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
49130
|
+
hydrated[index2] = map2;
|
|
49131
|
+
for (let i = 1; i < value.length; i += 2) {
|
|
49132
|
+
map2.set(hydrate(value[i]), hydrate(value[i + 1]));
|
|
49133
|
+
}
|
|
49134
|
+
break;
|
|
49135
|
+
case "RegExp":
|
|
49136
|
+
hydrated[index2] = new RegExp(value[1], value[2]);
|
|
49137
|
+
break;
|
|
49138
|
+
case "Object": {
|
|
49139
|
+
const wrapped_index = value[1];
|
|
49140
|
+
if (typeof values[wrapped_index] === "object" && values[wrapped_index][0] !== "BigInt") {
|
|
49141
|
+
throw new Error("Invalid input");
|
|
49142
|
+
}
|
|
49143
|
+
hydrated[index2] = Object(hydrate(wrapped_index));
|
|
49144
|
+
break;
|
|
49145
|
+
}
|
|
49146
|
+
case "BigInt":
|
|
49147
|
+
hydrated[index2] = BigInt(value[1]);
|
|
49148
|
+
break;
|
|
49149
|
+
case "null":
|
|
49150
|
+
const obj = /* @__PURE__ */ Object.create(null);
|
|
49151
|
+
hydrated[index2] = obj;
|
|
49152
|
+
for (let i = 1; i < value.length; i += 2) {
|
|
49153
|
+
if (value[i] === "__proto__") {
|
|
49154
|
+
throw new Error("Cannot parse an object with a `__proto__` property");
|
|
49155
|
+
}
|
|
49156
|
+
obj[value[i]] = hydrate(value[i + 1]);
|
|
49157
|
+
}
|
|
49158
|
+
break;
|
|
49159
|
+
case "Int8Array":
|
|
49160
|
+
case "Uint8Array":
|
|
49161
|
+
case "Uint8ClampedArray":
|
|
49162
|
+
case "Int16Array":
|
|
49163
|
+
case "Uint16Array":
|
|
49164
|
+
case "Float16Array":
|
|
49165
|
+
case "Int32Array":
|
|
49166
|
+
case "Uint32Array":
|
|
49167
|
+
case "Float32Array":
|
|
49168
|
+
case "Float64Array":
|
|
49169
|
+
case "BigInt64Array":
|
|
49170
|
+
case "BigUint64Array":
|
|
49171
|
+
case "DataView": {
|
|
49172
|
+
if (values[value[1]][0] !== "ArrayBuffer") {
|
|
49173
|
+
throw new Error("Invalid data");
|
|
49174
|
+
}
|
|
49175
|
+
const TypedArrayConstructor = globalThis[type];
|
|
49176
|
+
const buffer2 = hydrate(value[1]);
|
|
49177
|
+
hydrated[index2] = value[2] !== void 0 ? new TypedArrayConstructor(buffer2, value[2], value[3]) : new TypedArrayConstructor(buffer2);
|
|
49178
|
+
break;
|
|
49179
|
+
}
|
|
49180
|
+
case "ArrayBuffer": {
|
|
49181
|
+
const base642 = value[1];
|
|
49182
|
+
if (typeof base642 !== "string") {
|
|
49183
|
+
throw new Error("Invalid ArrayBuffer encoding");
|
|
49184
|
+
}
|
|
49185
|
+
const arraybuffer = decode64(base642);
|
|
49186
|
+
hydrated[index2] = arraybuffer;
|
|
49187
|
+
break;
|
|
49188
|
+
}
|
|
49189
|
+
case "Temporal.Duration":
|
|
49190
|
+
case "Temporal.Instant":
|
|
49191
|
+
case "Temporal.PlainDate":
|
|
49192
|
+
case "Temporal.PlainTime":
|
|
49193
|
+
case "Temporal.PlainDateTime":
|
|
49194
|
+
case "Temporal.PlainMonthDay":
|
|
49195
|
+
case "Temporal.PlainYearMonth":
|
|
49196
|
+
case "Temporal.ZonedDateTime": {
|
|
49197
|
+
const temporalName = type.slice(9);
|
|
49198
|
+
hydrated[index2] = Temporal[temporalName].from(value[1]);
|
|
49199
|
+
break;
|
|
49200
|
+
}
|
|
49201
|
+
case "URL": {
|
|
49202
|
+
const url2 = new URL(value[1]);
|
|
49203
|
+
hydrated[index2] = url2;
|
|
49204
|
+
break;
|
|
49205
|
+
}
|
|
49206
|
+
case "URLSearchParams": {
|
|
49207
|
+
const url2 = new URLSearchParams(value[1]);
|
|
49208
|
+
hydrated[index2] = url2;
|
|
49209
|
+
break;
|
|
49210
|
+
}
|
|
49211
|
+
default:
|
|
49212
|
+
throw new Error(`Unknown type ${type}`);
|
|
49213
|
+
}
|
|
49214
|
+
} else if (value[0] === SPARSE) {
|
|
49215
|
+
const len = value[1];
|
|
49216
|
+
if (!is_valid_array_len(len)) {
|
|
49217
|
+
throw new Error("Invalid input");
|
|
49218
|
+
}
|
|
49219
|
+
const array2 = [];
|
|
49220
|
+
hydrated[index2] = array2;
|
|
49221
|
+
array2[MAX_ARRAY_INDEX] = void 0;
|
|
49222
|
+
delete array2[MAX_ARRAY_INDEX];
|
|
49223
|
+
for (let i = 2; i < value.length; i += 2) {
|
|
49224
|
+
const idx = value[i];
|
|
49225
|
+
if (!is_valid_array_index(idx) || idx >= len) {
|
|
49226
|
+
throw new Error("Invalid input");
|
|
49227
|
+
}
|
|
49228
|
+
array2[idx] = hydrate(value[i + 1]);
|
|
49229
|
+
}
|
|
49230
|
+
array2.length = len;
|
|
49231
|
+
} else {
|
|
49232
|
+
const array2 = new Array(value.length);
|
|
49233
|
+
hydrated[index2] = array2;
|
|
49234
|
+
for (let i = 0; i < value.length; i += 1) {
|
|
49235
|
+
const n = value[i];
|
|
49236
|
+
if (n === HOLE) continue;
|
|
49237
|
+
array2[i] = hydrate(n);
|
|
49238
|
+
}
|
|
49239
|
+
}
|
|
49240
|
+
} else {
|
|
49241
|
+
const object2 = {};
|
|
49242
|
+
hydrated[index2] = object2;
|
|
49243
|
+
for (const key of Object.keys(value)) {
|
|
49244
|
+
if (key === "__proto__") {
|
|
49245
|
+
throw new Error("Cannot parse an object with a `__proto__` property");
|
|
49246
|
+
}
|
|
49247
|
+
const n = value[key];
|
|
49248
|
+
object2[key] = hydrate(n);
|
|
49249
|
+
}
|
|
49250
|
+
}
|
|
49251
|
+
return hydrated[index2];
|
|
49252
|
+
}
|
|
49253
|
+
return hydrate(0);
|
|
49254
|
+
}
|
|
49255
|
+
function stringify$2(value, reducers) {
|
|
49256
|
+
const stringified = run(false, value, reducers);
|
|
49257
|
+
return typeof stringified === "string" ? stringified : `[${stringified.join(",")}]`;
|
|
49258
|
+
}
|
|
49259
|
+
function run(async, value, reducers) {
|
|
49260
|
+
const stringified = [];
|
|
49261
|
+
const indexes = /* @__PURE__ */ new Map();
|
|
49262
|
+
const custom2 = [];
|
|
49263
|
+
if (reducers) {
|
|
49264
|
+
for (const key of Object.getOwnPropertyNames(reducers)) {
|
|
49265
|
+
custom2.push({ key, fn: reducers[key] });
|
|
49266
|
+
}
|
|
49267
|
+
}
|
|
49268
|
+
const keys2 = [];
|
|
49269
|
+
let p2 = 0;
|
|
49270
|
+
function flatten(thing, index3) {
|
|
49271
|
+
if (thing === void 0) return UNDEFINED$2;
|
|
49272
|
+
if (Number.isNaN(thing)) return NAN;
|
|
49273
|
+
if (thing === Infinity) return POSITIVE_INFINITY;
|
|
49274
|
+
if (thing === -Infinity) return NEGATIVE_INFINITY;
|
|
49275
|
+
if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO;
|
|
49276
|
+
if (indexes.has(thing)) return (
|
|
49277
|
+
/** @type {number} */
|
|
49278
|
+
indexes.get(thing)
|
|
49279
|
+
);
|
|
49280
|
+
index3 ?? (index3 = p2++);
|
|
49281
|
+
indexes.set(thing, index3);
|
|
49282
|
+
for (const { key, fn: fn2 } of custom2) {
|
|
49283
|
+
const value2 = fn2(thing);
|
|
49284
|
+
if (value2) {
|
|
49285
|
+
stringified[index3] = `["${key}",${flatten(value2)}]`;
|
|
49286
|
+
return index3;
|
|
49287
|
+
}
|
|
49288
|
+
}
|
|
49289
|
+
if (typeof thing === "function") {
|
|
49290
|
+
throw new DevalueError(`Cannot stringify a function`, keys2, thing, value);
|
|
49291
|
+
} else if (typeof thing === "symbol") {
|
|
49292
|
+
throw new DevalueError(`Cannot stringify a Symbol primitive`, keys2, thing, value);
|
|
49293
|
+
}
|
|
49294
|
+
let str = "";
|
|
49295
|
+
if (is_primitive(thing)) {
|
|
49296
|
+
str = stringify_primitive(thing);
|
|
49297
|
+
} else if (typeof thing.then === "function") {
|
|
49298
|
+
{
|
|
49299
|
+
throw new DevalueError(
|
|
49300
|
+
`Cannot stringify a Promise or thenable — use stringifyAsync instead`,
|
|
49301
|
+
keys2,
|
|
49302
|
+
thing,
|
|
49303
|
+
value
|
|
49304
|
+
);
|
|
49305
|
+
}
|
|
49306
|
+
} else {
|
|
49307
|
+
const type = get_type(thing);
|
|
49308
|
+
switch (type) {
|
|
49309
|
+
case "Number":
|
|
49310
|
+
case "String":
|
|
49311
|
+
case "Boolean":
|
|
49312
|
+
case "BigInt":
|
|
49313
|
+
str = `["Object",${flatten(thing.valueOf())}]`;
|
|
49314
|
+
break;
|
|
49315
|
+
case "Date":
|
|
49316
|
+
const valid2 = !isNaN(thing.getDate());
|
|
49317
|
+
str = `["Date","${valid2 ? thing.toISOString() : ""}"]`;
|
|
49318
|
+
break;
|
|
49319
|
+
case "URL":
|
|
49320
|
+
str = `["URL",${stringify_string(thing.toString())}]`;
|
|
49321
|
+
break;
|
|
49322
|
+
case "URLSearchParams":
|
|
49323
|
+
str = `["URLSearchParams",${stringify_string(thing.toString())}]`;
|
|
49324
|
+
break;
|
|
49325
|
+
case "RegExp":
|
|
49326
|
+
const { source, flags } = thing;
|
|
49327
|
+
str = flags ? `["RegExp",${stringify_string(source)},"${flags}"]` : `["RegExp",${stringify_string(source)}]`;
|
|
49328
|
+
break;
|
|
49329
|
+
case "Array": {
|
|
49330
|
+
let mostly_dense = false;
|
|
49331
|
+
str = "[";
|
|
49332
|
+
for (let i = 0; i < thing.length; i += 1) {
|
|
49333
|
+
if (i > 0) str += ",";
|
|
49334
|
+
if (Object.hasOwn(thing, i)) {
|
|
49335
|
+
keys2.push(`[${i}]`);
|
|
49336
|
+
str += flatten(thing[i]);
|
|
49337
|
+
keys2.pop();
|
|
49338
|
+
} else if (mostly_dense) {
|
|
49339
|
+
str += HOLE;
|
|
49340
|
+
} else {
|
|
49341
|
+
const populated_keys = valid_array_indices(
|
|
49342
|
+
/** @type {any[]} */
|
|
49343
|
+
thing
|
|
49344
|
+
);
|
|
49345
|
+
const population = populated_keys.length;
|
|
49346
|
+
const d2 = String(thing.length).length;
|
|
49347
|
+
const hole_cost = (thing.length - population) * 3;
|
|
49348
|
+
const sparse_cost = 4 + d2 + population * (d2 + 1);
|
|
49349
|
+
if (hole_cost > sparse_cost) {
|
|
49350
|
+
str = "[" + SPARSE + "," + thing.length;
|
|
49351
|
+
for (let j2 = 0; j2 < populated_keys.length; j2++) {
|
|
49352
|
+
const key = populated_keys[j2];
|
|
49353
|
+
keys2.push(`[${key}]`);
|
|
49354
|
+
str += "," + key + "," + flatten(thing[key]);
|
|
49355
|
+
keys2.pop();
|
|
49356
|
+
}
|
|
49357
|
+
break;
|
|
49358
|
+
} else {
|
|
49359
|
+
mostly_dense = true;
|
|
49360
|
+
str += HOLE;
|
|
49361
|
+
}
|
|
49362
|
+
}
|
|
49363
|
+
}
|
|
49364
|
+
str += "]";
|
|
49365
|
+
break;
|
|
49366
|
+
}
|
|
49367
|
+
case "Set":
|
|
49368
|
+
str = '["Set"';
|
|
49369
|
+
for (const value2 of thing) {
|
|
49370
|
+
str += `,${flatten(value2)}`;
|
|
49371
|
+
}
|
|
49372
|
+
str += "]";
|
|
49373
|
+
break;
|
|
49374
|
+
case "Map":
|
|
49375
|
+
str = '["Map"';
|
|
49376
|
+
for (const [key, value2] of thing) {
|
|
49377
|
+
keys2.push(`.get(${is_primitive(key) ? stringify_primitive(key) : "..."})`);
|
|
49378
|
+
str += `,${flatten(key)},${flatten(value2)}`;
|
|
49379
|
+
keys2.pop();
|
|
49380
|
+
}
|
|
49381
|
+
str += "]";
|
|
49382
|
+
break;
|
|
49383
|
+
case "Int8Array":
|
|
49384
|
+
case "Uint8Array":
|
|
49385
|
+
case "Uint8ClampedArray":
|
|
49386
|
+
case "Int16Array":
|
|
49387
|
+
case "Uint16Array":
|
|
49388
|
+
case "Float16Array":
|
|
49389
|
+
case "Int32Array":
|
|
49390
|
+
case "Uint32Array":
|
|
49391
|
+
case "Float32Array":
|
|
49392
|
+
case "Float64Array":
|
|
49393
|
+
case "BigInt64Array":
|
|
49394
|
+
case "BigUint64Array":
|
|
49395
|
+
case "DataView": {
|
|
49396
|
+
const typedArray = thing;
|
|
49397
|
+
str = '["' + type + '",' + flatten(typedArray.buffer);
|
|
49398
|
+
if (typedArray.byteLength !== typedArray.buffer.byteLength) {
|
|
49399
|
+
str += `,${typedArray.byteOffset},${typedArray.length}`;
|
|
49400
|
+
}
|
|
49401
|
+
str += "]";
|
|
49402
|
+
break;
|
|
49403
|
+
}
|
|
49404
|
+
case "ArrayBuffer": {
|
|
49405
|
+
const arraybuffer = thing;
|
|
49406
|
+
const base642 = encode64(arraybuffer);
|
|
49407
|
+
str = `["ArrayBuffer","${base642}"]`;
|
|
49408
|
+
break;
|
|
49409
|
+
}
|
|
49410
|
+
case "Temporal.Duration":
|
|
49411
|
+
case "Temporal.Instant":
|
|
49412
|
+
case "Temporal.PlainDate":
|
|
49413
|
+
case "Temporal.PlainTime":
|
|
49414
|
+
case "Temporal.PlainDateTime":
|
|
49415
|
+
case "Temporal.PlainMonthDay":
|
|
49416
|
+
case "Temporal.PlainYearMonth":
|
|
49417
|
+
case "Temporal.ZonedDateTime":
|
|
49418
|
+
str = `["${type}",${stringify_string(thing.toString())}]`;
|
|
49419
|
+
break;
|
|
49420
|
+
default:
|
|
49421
|
+
if (!is_plain_object(thing)) {
|
|
49422
|
+
throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys2, thing, value);
|
|
49423
|
+
}
|
|
49424
|
+
if (enumerable_symbols(thing).length > 0) {
|
|
49425
|
+
throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys2, thing, value);
|
|
49426
|
+
}
|
|
49427
|
+
if (Object.getPrototypeOf(thing) === null) {
|
|
49428
|
+
str = '["null"';
|
|
49429
|
+
for (const key of Object.keys(thing)) {
|
|
49430
|
+
if (key === "__proto__") {
|
|
49431
|
+
throw new DevalueError(
|
|
49432
|
+
`Cannot stringify objects with __proto__ keys`,
|
|
49433
|
+
keys2,
|
|
49434
|
+
thing,
|
|
49435
|
+
value
|
|
49436
|
+
);
|
|
49437
|
+
}
|
|
49438
|
+
keys2.push(stringify_key(key));
|
|
49439
|
+
str += `,${stringify_string(key)},${flatten(thing[key])}`;
|
|
49440
|
+
keys2.pop();
|
|
49441
|
+
}
|
|
49442
|
+
str += "]";
|
|
49443
|
+
} else {
|
|
49444
|
+
str = "{";
|
|
49445
|
+
let started = false;
|
|
49446
|
+
for (const key of Object.keys(thing)) {
|
|
49447
|
+
if (key === "__proto__") {
|
|
49448
|
+
throw new DevalueError(
|
|
49449
|
+
`Cannot stringify objects with __proto__ keys`,
|
|
49450
|
+
keys2,
|
|
49451
|
+
thing,
|
|
49452
|
+
value
|
|
49453
|
+
);
|
|
49454
|
+
}
|
|
49455
|
+
if (started) str += ",";
|
|
49456
|
+
started = true;
|
|
49457
|
+
keys2.push(stringify_key(key));
|
|
49458
|
+
str += `${stringify_string(key)}:${flatten(thing[key])}`;
|
|
49459
|
+
keys2.pop();
|
|
49460
|
+
}
|
|
49461
|
+
str += "}";
|
|
49462
|
+
}
|
|
49463
|
+
}
|
|
49464
|
+
}
|
|
49465
|
+
stringified[index3] = str;
|
|
49466
|
+
return index3;
|
|
49467
|
+
}
|
|
49468
|
+
const index2 = flatten(value);
|
|
49469
|
+
if (index2 < 0) return `${index2}`;
|
|
49470
|
+
return stringified;
|
|
49471
|
+
}
|
|
49472
|
+
function stringify_primitive(thing) {
|
|
49473
|
+
const type = typeof thing;
|
|
49474
|
+
if (type === "string") return stringify_string(thing);
|
|
49475
|
+
if (thing === void 0) return UNDEFINED$2.toString();
|
|
49476
|
+
if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO.toString();
|
|
49477
|
+
if (type === "bigint") return `["BigInt","${thing}"]`;
|
|
49478
|
+
return String(thing);
|
|
49479
|
+
}
|
|
49480
|
+
const SerializationFormat$1 = {
|
|
49481
|
+
/** devalue stringify/parse with TextEncoder/TextDecoder */
|
|
49482
|
+
DEVALUE_V1: "devl",
|
|
49483
|
+
/** Encrypted payload (inner payload has its own format prefix after decryption) */
|
|
49484
|
+
ENCRYPTED: "encr",
|
|
49485
|
+
/** Gzip-compressed payload (inner payload has its own format prefix after decompression) */
|
|
49486
|
+
GZIP: "gzip",
|
|
49487
|
+
/** Zstandard-compressed payload (inner payload has its own format prefix after decompression) */
|
|
49488
|
+
ZSTD: "zstd"
|
|
49808
49489
|
};
|
|
49809
|
-
|
|
49810
|
-
|
|
49811
|
-
|
|
49812
|
-
|
|
49813
|
-
|
|
49814
|
-
|
|
49815
|
-
|
|
49490
|
+
const FORMAT_PREFIX_LENGTH$2 = 4;
|
|
49491
|
+
new TextEncoder();
|
|
49492
|
+
const formatDecoder$2 = new TextDecoder();
|
|
49493
|
+
function decodeFormatPrefix$1(data) {
|
|
49494
|
+
if (!(data instanceof Uint8Array)) {
|
|
49495
|
+
return {
|
|
49496
|
+
format: SerializationFormat$1.DEVALUE_V1,
|
|
49497
|
+
payload: new TextEncoder().encode(JSON.stringify(data))
|
|
49498
|
+
};
|
|
49499
|
+
}
|
|
49500
|
+
if (data.length < FORMAT_PREFIX_LENGTH$2) {
|
|
49501
|
+
throw new Error(`Data too short to contain format prefix: expected at least ${FORMAT_PREFIX_LENGTH$2} bytes, got ${data.length}`);
|
|
49502
|
+
}
|
|
49503
|
+
const prefixBytes = data.subarray(0, FORMAT_PREFIX_LENGTH$2);
|
|
49504
|
+
const format2 = formatDecoder$2.decode(prefixBytes);
|
|
49505
|
+
const knownFormats = Object.values(SerializationFormat$1);
|
|
49506
|
+
if (!knownFormats.includes(format2)) {
|
|
49507
|
+
throw new Error(`Unknown serialization format: "${format2}". Known formats: ${knownFormats.join(", ")}`);
|
|
49508
|
+
}
|
|
49509
|
+
const payload = data.subarray(FORMAT_PREFIX_LENGTH$2);
|
|
49510
|
+
return { format: format2, payload };
|
|
49511
|
+
}
|
|
49512
|
+
function isExpiredObject(data) {
|
|
49513
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) {
|
|
49514
|
+
return false;
|
|
49515
|
+
}
|
|
49516
|
+
const keys2 = Object.keys(data);
|
|
49517
|
+
return keys2.length === 1 && keys2[0] === "expiredAt" && typeof data.expiredAt === "string";
|
|
49518
|
+
}
|
|
49519
|
+
function isExpiredStub(data) {
|
|
49520
|
+
if (isExpiredObject(data))
|
|
49521
|
+
return true;
|
|
49522
|
+
if (Array.isArray(data) && data.length === 1 && isExpiredObject(data[0])) {
|
|
49523
|
+
return true;
|
|
49524
|
+
}
|
|
49525
|
+
return false;
|
|
49526
|
+
}
|
|
49527
|
+
function isEncryptedData(data) {
|
|
49528
|
+
if (!(data instanceof Uint8Array) || data.length < FORMAT_PREFIX_LENGTH$2) {
|
|
49529
|
+
return false;
|
|
49530
|
+
}
|
|
49531
|
+
const prefix = formatDecoder$2.decode(data.subarray(0, FORMAT_PREFIX_LENGTH$2));
|
|
49532
|
+
return prefix === SerializationFormat$1.ENCRYPTED;
|
|
49533
|
+
}
|
|
49534
|
+
function isCompressedData(data) {
|
|
49535
|
+
if (!(data instanceof Uint8Array) || data.length < FORMAT_PREFIX_LENGTH$2) {
|
|
49536
|
+
return false;
|
|
49537
|
+
}
|
|
49538
|
+
const prefix = formatDecoder$2.decode(data.subarray(0, FORMAT_PREFIX_LENGTH$2));
|
|
49539
|
+
return prefix === SerializationFormat$1.GZIP || prefix === SerializationFormat$1.ZSTD;
|
|
49540
|
+
}
|
|
49541
|
+
function getNodeZlib$2() {
|
|
49542
|
+
var _a3, _b2;
|
|
49543
|
+
try {
|
|
49544
|
+
return (_b2 = (_a3 = globalThis.process) == null ? void 0 : _a3.getBuiltinModule) == null ? void 0 : _b2.call(_a3, "node:zlib");
|
|
49545
|
+
} catch {
|
|
49546
|
+
return void 0;
|
|
49547
|
+
}
|
|
49548
|
+
}
|
|
49549
|
+
function decompressSyncIfAvailable(format2, payload) {
|
|
49550
|
+
try {
|
|
49551
|
+
const zlib = getNodeZlib$2();
|
|
49552
|
+
if (format2 === SerializationFormat$1.GZIP && (zlib == null ? void 0 : zlib.gunzipSync)) {
|
|
49553
|
+
return new Uint8Array(zlib.gunzipSync(payload));
|
|
49554
|
+
}
|
|
49555
|
+
if (format2 === SerializationFormat$1.ZSTD && (zlib == null ? void 0 : zlib.zstdDecompressSync)) {
|
|
49556
|
+
return new Uint8Array(zlib.zstdDecompressSync(payload));
|
|
49557
|
+
}
|
|
49558
|
+
} catch {
|
|
49559
|
+
}
|
|
49560
|
+
return void 0;
|
|
49561
|
+
}
|
|
49562
|
+
let zstdBrowserDecoder;
|
|
49563
|
+
function registerZstdDecoder(decoder2) {
|
|
49564
|
+
zstdBrowserDecoder = decoder2;
|
|
49565
|
+
}
|
|
49566
|
+
async function decompressAsync(format2, payload) {
|
|
49567
|
+
if (format2 === SerializationFormat$1.ZSTD) {
|
|
49568
|
+
const sync = decompressSyncIfAvailable(format2, payload);
|
|
49569
|
+
if (sync)
|
|
49570
|
+
return sync;
|
|
49571
|
+
if (zstdBrowserDecoder)
|
|
49572
|
+
return zstdBrowserDecoder(payload);
|
|
49573
|
+
throw new Error("zstd-compressed workflow data encountered but no zstd decoder is available. Node.js 22.15+ decodes natively; in the browser register one via registerZstdDecoder (the web o11y package does this).");
|
|
49574
|
+
}
|
|
49575
|
+
const transform2 = new DecompressionStream("gzip");
|
|
49576
|
+
const writer = transform2.writable.getWriter();
|
|
49577
|
+
const writePromise = writer.write(payload).then(() => writer.close());
|
|
49578
|
+
writePromise.catch(() => {
|
|
49579
|
+
});
|
|
49580
|
+
const chunks = [];
|
|
49581
|
+
let total = 0;
|
|
49582
|
+
const reader = transform2.readable.getReader();
|
|
49583
|
+
for (; ; ) {
|
|
49584
|
+
const { done, value } = await reader.read();
|
|
49585
|
+
if (done)
|
|
49586
|
+
break;
|
|
49587
|
+
chunks.push(value);
|
|
49588
|
+
total += value.length;
|
|
49589
|
+
}
|
|
49590
|
+
await writePromise;
|
|
49591
|
+
const out = new Uint8Array(total);
|
|
49592
|
+
let offset2 = 0;
|
|
49593
|
+
for (const chunk of chunks) {
|
|
49594
|
+
out.set(chunk, offset2);
|
|
49595
|
+
offset2 += chunk.length;
|
|
49596
|
+
}
|
|
49597
|
+
return out;
|
|
49598
|
+
}
|
|
49599
|
+
function hydrateData(value, revivers) {
|
|
49600
|
+
if (value instanceof Uint8Array) {
|
|
49601
|
+
if (isEncryptedData(value)) {
|
|
49602
|
+
return value;
|
|
49603
|
+
}
|
|
49604
|
+
const { format: format2, payload } = decodeFormatPrefix$1(value);
|
|
49605
|
+
if (format2 === SerializationFormat$1.DEVALUE_V1) {
|
|
49606
|
+
const str = new TextDecoder().decode(payload);
|
|
49607
|
+
return parse$5(str, revivers);
|
|
49608
|
+
}
|
|
49609
|
+
if (format2 === SerializationFormat$1.GZIP || format2 === SerializationFormat$1.ZSTD) {
|
|
49610
|
+
const inflated = decompressSyncIfAvailable(format2, payload);
|
|
49611
|
+
if (inflated === void 0) {
|
|
49612
|
+
return value;
|
|
49613
|
+
}
|
|
49614
|
+
return hydrateData(inflated, revivers);
|
|
49615
|
+
}
|
|
49616
|
+
throw new Error(`Unsupported serialization format: ${format2}`);
|
|
49617
|
+
}
|
|
49618
|
+
if (Array.isArray(value)) {
|
|
49619
|
+
return unflatten(value, revivers);
|
|
49620
|
+
}
|
|
49621
|
+
return value;
|
|
49622
|
+
}
|
|
49623
|
+
async function hydrateDataWithKey(value, revivers, key) {
|
|
49624
|
+
let data = value;
|
|
49625
|
+
if (data instanceof Uint8Array && isEncryptedData(data) && key) {
|
|
49626
|
+
const { decrypt: decrypt2 } = await Promise.resolve().then(() => encryption);
|
|
49627
|
+
const { payload } = decodeFormatPrefix$1(data);
|
|
49628
|
+
data = await decrypt2(key, payload);
|
|
49629
|
+
}
|
|
49630
|
+
if (data instanceof Uint8Array && isCompressedData(data)) {
|
|
49631
|
+
const { format: format2, payload } = decodeFormatPrefix$1(data);
|
|
49632
|
+
data = await decompressAsync(format2, payload);
|
|
49633
|
+
}
|
|
49634
|
+
return hydrateData(data, revivers);
|
|
49635
|
+
}
|
|
49636
|
+
const STREAM_ID_PREFIX = "strm_";
|
|
49637
|
+
const STREAM_REF_TYPE$1 = "__workflow_stream_ref__";
|
|
49638
|
+
const RUN_REF_TYPE$1 = "__workflow_run_ref__";
|
|
49639
|
+
const isRunRef$1 = (value) => {
|
|
49640
|
+
return value !== null && typeof value === "object" && "__type" in value && value.__type === RUN_REF_TYPE$1 && "runId" in value && typeof value.runId === "string";
|
|
49641
|
+
};
|
|
49642
|
+
const serializedRunToRunRef = (value) => {
|
|
49643
|
+
return { __type: RUN_REF_TYPE$1, runId: value.runId };
|
|
49644
|
+
};
|
|
49645
|
+
const CLASS_INSTANCE_REF_TYPE$1 = "__workflow_class_instance_ref__";
|
|
49646
|
+
class ClassInstanceRef {
|
|
49647
|
+
constructor(className, classId, data) {
|
|
49648
|
+
__publicField(this, "className");
|
|
49649
|
+
__publicField(this, "classId");
|
|
49650
|
+
__publicField(this, "data");
|
|
49651
|
+
__publicField(this, "__type", CLASS_INSTANCE_REF_TYPE$1);
|
|
49652
|
+
this.className = className;
|
|
49653
|
+
this.classId = classId;
|
|
49654
|
+
this.data = data;
|
|
49655
|
+
}
|
|
49656
|
+
toJSON() {
|
|
49657
|
+
return {
|
|
49658
|
+
__type: this.__type,
|
|
49659
|
+
className: this.className,
|
|
49660
|
+
classId: this.classId,
|
|
49661
|
+
data: this.data
|
|
49662
|
+
};
|
|
49663
|
+
}
|
|
49664
|
+
}
|
|
49665
|
+
const streamToStreamRef = (value) => {
|
|
49666
|
+
let streamId;
|
|
49667
|
+
if ("name" in value) {
|
|
49668
|
+
const name2 = String(value.name);
|
|
49669
|
+
if (!name2.startsWith(STREAM_ID_PREFIX)) {
|
|
49670
|
+
streamId = `${STREAM_ID_PREFIX}${name2}`;
|
|
49671
|
+
} else {
|
|
49672
|
+
streamId = name2;
|
|
49673
|
+
}
|
|
49674
|
+
} else {
|
|
49675
|
+
streamId = `${STREAM_ID_PREFIX}null`;
|
|
49676
|
+
}
|
|
49677
|
+
return { __type: STREAM_REF_TYPE$1, streamId };
|
|
49678
|
+
};
|
|
49679
|
+
const serializedStepFunctionToString = (value) => {
|
|
49680
|
+
if (!value)
|
|
49681
|
+
return "null";
|
|
49682
|
+
if (typeof value !== "object")
|
|
49683
|
+
return "null";
|
|
49684
|
+
if ("stepId" in value) {
|
|
49685
|
+
return `<step:${value.stepId}>`;
|
|
49686
|
+
}
|
|
49687
|
+
return "<function>";
|
|
49688
|
+
};
|
|
49689
|
+
const extractClassName = (classId) => {
|
|
49690
|
+
if (!classId)
|
|
49691
|
+
return "Unknown";
|
|
49692
|
+
const parts = classId.split("/");
|
|
49693
|
+
return parts[parts.length - 1] || classId;
|
|
49694
|
+
};
|
|
49695
|
+
const serializedInstanceToRef = (value) => {
|
|
49696
|
+
const className = extractClassName(value.classId);
|
|
49697
|
+
if (className === "Run" && value.data !== null && typeof value.data === "object" && "runId" in value.data && typeof value.data.runId === "string") {
|
|
49698
|
+
return serializedRunToRunRef(value.data);
|
|
49699
|
+
}
|
|
49700
|
+
return new ClassInstanceRef(className, value.classId, value.data);
|
|
49701
|
+
};
|
|
49702
|
+
const serializedClassToString = (value) => {
|
|
49703
|
+
return `<class:${extractClassName(value.classId)}>`;
|
|
49704
|
+
};
|
|
49705
|
+
const observabilityRevivers = {
|
|
49706
|
+
ReadableStream: streamToStreamRef,
|
|
49707
|
+
WritableStream: streamToStreamRef,
|
|
49708
|
+
TransformStream: streamToStreamRef,
|
|
49709
|
+
AbortController: (value) => `<AbortController(aborted: ${value.aborted})>`,
|
|
49710
|
+
AbortSignal: (value) => `<AbortSignal(aborted: ${value.aborted})>`,
|
|
49711
|
+
// DOMException needs an explicit reviver: without one, devalue.parse
|
|
49712
|
+
// throws on the `["DOMException", ...]` tag and `hydrateStepIO`'s
|
|
49713
|
+
// try/catch leaves the raw flat-encoded string in the UI. AbortController
|
|
49714
|
+
// synthesizes a DOMException as the default `signal.reason` when abort()
|
|
49715
|
+
// is called with no arg — so any abort that round-trips through a step
|
|
49716
|
+
// boundary surfaces here. Reconstruct as a real DOMException when the
|
|
49717
|
+
// global is available (modern browsers + Node 18+), else fall back to
|
|
49718
|
+
// an Error preserving name/message/stack/cause for display.
|
|
49719
|
+
DOMException: (value) => {
|
|
49720
|
+
const G2 = globalThis;
|
|
49721
|
+
if (typeof G2.DOMException === "function") {
|
|
49722
|
+
const e2 = new G2.DOMException(value.message, value.name);
|
|
49723
|
+
if (value.stack !== void 0)
|
|
49724
|
+
e2.stack = value.stack;
|
|
49725
|
+
if ("cause" in value)
|
|
49726
|
+
e2.cause = value.cause;
|
|
49727
|
+
return e2;
|
|
49728
|
+
}
|
|
49729
|
+
const e = new Error(value.message);
|
|
49730
|
+
e.name = value.name;
|
|
49731
|
+
if (value.stack !== void 0)
|
|
49732
|
+
e.stack = value.stack;
|
|
49733
|
+
if ("cause" in value)
|
|
49734
|
+
e.cause = value.cause;
|
|
49735
|
+
return e;
|
|
49736
|
+
},
|
|
49737
|
+
StepFunction: serializedStepFunctionToString,
|
|
49738
|
+
WorkflowFunction: (value) => `<workflow:${value.workflowId}>`,
|
|
49739
|
+
Instance: serializedInstanceToRef,
|
|
49740
|
+
Class: serializedClassToString
|
|
49741
|
+
};
|
|
49742
|
+
function hydrateStepIO(resource, revivers) {
|
|
49743
|
+
let hydratedInput = resource.input;
|
|
49744
|
+
let hydratedOutput = resource.output;
|
|
49745
|
+
let hydratedError = resource.error;
|
|
49746
|
+
if (resource.input != null) {
|
|
49747
|
+
try {
|
|
49748
|
+
hydratedInput = hydrateData(resource.input, revivers);
|
|
49749
|
+
} catch {
|
|
49750
|
+
}
|
|
49751
|
+
}
|
|
49752
|
+
if (resource.output != null) {
|
|
49753
|
+
try {
|
|
49754
|
+
hydratedOutput = hydrateData(resource.output, revivers);
|
|
49755
|
+
} catch {
|
|
49756
|
+
}
|
|
49757
|
+
}
|
|
49758
|
+
if (resource.error != null) {
|
|
49759
|
+
try {
|
|
49760
|
+
hydratedError = hydrateData(resource.error, revivers);
|
|
49761
|
+
} catch {
|
|
49762
|
+
}
|
|
49763
|
+
}
|
|
49764
|
+
return {
|
|
49765
|
+
...resource,
|
|
49766
|
+
input: hydratedInput,
|
|
49767
|
+
output: hydratedOutput,
|
|
49768
|
+
error: hydratedError
|
|
49769
|
+
};
|
|
49770
|
+
}
|
|
49771
|
+
function hydrateWorkflowIO(resource, revivers) {
|
|
49772
|
+
let hydratedInput = resource.input;
|
|
49773
|
+
let hydratedOutput = resource.output;
|
|
49774
|
+
let hydratedError = resource.error;
|
|
49775
|
+
if (resource.input != null) {
|
|
49776
|
+
try {
|
|
49777
|
+
hydratedInput = hydrateData(resource.input, revivers);
|
|
49778
|
+
} catch {
|
|
49779
|
+
}
|
|
49780
|
+
}
|
|
49781
|
+
if (resource.output != null) {
|
|
49782
|
+
try {
|
|
49783
|
+
hydratedOutput = hydrateData(resource.output, revivers);
|
|
49784
|
+
} catch {
|
|
49785
|
+
}
|
|
49786
|
+
}
|
|
49787
|
+
if (resource.error != null) {
|
|
49788
|
+
try {
|
|
49789
|
+
hydratedError = hydrateData(resource.error, revivers);
|
|
49790
|
+
} catch {
|
|
49791
|
+
}
|
|
49792
|
+
}
|
|
49793
|
+
return {
|
|
49794
|
+
...resource,
|
|
49795
|
+
input: hydratedInput,
|
|
49796
|
+
output: hydratedOutput,
|
|
49797
|
+
error: hydratedError
|
|
49798
|
+
};
|
|
49799
|
+
}
|
|
49800
|
+
function hydrateEventData(resource, revivers) {
|
|
49801
|
+
if (!resource.eventData)
|
|
49802
|
+
return resource;
|
|
49803
|
+
const eventData = { ...resource.eventData };
|
|
49804
|
+
for (const field of getEventDataRefFields(resource.eventType ?? "")) {
|
|
49805
|
+
if (eventData[field] == null)
|
|
49806
|
+
continue;
|
|
49807
|
+
try {
|
|
49808
|
+
eventData[field] = hydrateData(eventData[field], revivers);
|
|
49809
|
+
} catch {
|
|
49810
|
+
}
|
|
49811
|
+
}
|
|
49812
|
+
return { ...resource, eventData };
|
|
49816
49813
|
}
|
|
49814
|
+
function hydrateHookMetadata(resource, revivers) {
|
|
49815
|
+
if (resource.metadata == null)
|
|
49816
|
+
return resource;
|
|
49817
|
+
let hydratedMetadata = resource.metadata;
|
|
49818
|
+
try {
|
|
49819
|
+
hydratedMetadata = hydrateData(resource.metadata, revivers);
|
|
49820
|
+
} catch {
|
|
49821
|
+
}
|
|
49822
|
+
return { ...resource, metadata: hydratedMetadata };
|
|
49823
|
+
}
|
|
49824
|
+
function hydrateResourceIO$1(resource, revivers) {
|
|
49825
|
+
if (!resource)
|
|
49826
|
+
return resource;
|
|
49827
|
+
let hydrated;
|
|
49828
|
+
if ("stepId" in resource) {
|
|
49829
|
+
hydrated = hydrateStepIO(resource, revivers);
|
|
49830
|
+
} else if ("hookId" in resource) {
|
|
49831
|
+
hydrated = hydrateHookMetadata(resource, revivers);
|
|
49832
|
+
} else if ("eventId" in resource) {
|
|
49833
|
+
hydrated = hydrateEventData(resource, revivers);
|
|
49834
|
+
} else {
|
|
49835
|
+
hydrated = hydrateWorkflowIO(resource, revivers);
|
|
49836
|
+
}
|
|
49837
|
+
if ("executionContext" in hydrated) {
|
|
49838
|
+
const { executionContext, ...rest } = hydrated;
|
|
49839
|
+
const workflowCoreVersion = executionContext && typeof executionContext === "object" && "workflowCoreVersion" in executionContext ? executionContext.workflowCoreVersion : void 0;
|
|
49840
|
+
if (workflowCoreVersion) {
|
|
49841
|
+
return { ...rest, workflowCoreVersion };
|
|
49842
|
+
}
|
|
49843
|
+
return rest;
|
|
49844
|
+
}
|
|
49845
|
+
return hydrated;
|
|
49846
|
+
}
|
|
49847
|
+
const serializationFormat = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
49848
|
+
__proto__: null,
|
|
49849
|
+
CLASS_INSTANCE_REF_TYPE: CLASS_INSTANCE_REF_TYPE$1,
|
|
49850
|
+
ClassInstanceRef,
|
|
49851
|
+
RUN_REF_TYPE: RUN_REF_TYPE$1,
|
|
49852
|
+
STREAM_REF_TYPE: STREAM_REF_TYPE$1,
|
|
49853
|
+
SerializationFormat: SerializationFormat$1,
|
|
49854
|
+
decodeFormatPrefix: decodeFormatPrefix$1,
|
|
49855
|
+
extractClassName,
|
|
49856
|
+
hydrateData,
|
|
49857
|
+
hydrateDataWithKey,
|
|
49858
|
+
hydrateResourceIO: hydrateResourceIO$1,
|
|
49859
|
+
isCompressedData,
|
|
49860
|
+
isEncryptedData,
|
|
49861
|
+
isExpiredStub,
|
|
49862
|
+
isRunRef: isRunRef$1,
|
|
49863
|
+
observabilityRevivers,
|
|
49864
|
+
registerZstdDecoder,
|
|
49865
|
+
serializedClassToString,
|
|
49866
|
+
serializedInstanceToRef,
|
|
49867
|
+
serializedRunToRunRef,
|
|
49868
|
+
serializedStepFunctionToString,
|
|
49869
|
+
streamToStreamRef
|
|
49870
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
49817
49871
|
function base64ToArrayBuffer(base642) {
|
|
49818
49872
|
if (base642 === "" || base642 === ".") {
|
|
49819
49873
|
return new ArrayBuffer(0);
|
|
@@ -50088,7 +50142,7 @@ function replaceEncryptedAndExpiredWithMarkers(resource) {
|
|
|
50088
50142
|
}
|
|
50089
50143
|
async function hydrateResourceIOAsync(resource, key) {
|
|
50090
50144
|
const { hydrateDataWithKey: hydrateDataWithKey2 } = await Promise.resolve().then(() => serializationFormat);
|
|
50091
|
-
const { ensureZstdDecoderRegistered } = await import("./zstd-browser-decoder-
|
|
50145
|
+
const { ensureZstdDecoderRegistered } = await import("./zstd-browser-decoder-BgFuN9zt.js");
|
|
50092
50146
|
ensureZstdDecoderRegistered();
|
|
50093
50147
|
const cryptoKey = key ? await Promise.resolve().then(() => encryption).then(({ importKey: importKey2 }) => importKey2(key)) : void 0;
|
|
50094
50148
|
const revivers = getRevivers();
|
|
@@ -52381,7 +52435,7 @@ const rowValueVariants = cva("min-w-0 flex-1 truncate text-right text-copy-13 te
|
|
|
52381
52435
|
variant: "default"
|
|
52382
52436
|
}
|
|
52383
52437
|
});
|
|
52384
|
-
const rowCopyValueVariants = cva("flex min-w-0
|
|
52438
|
+
const rowCopyValueVariants = cva("flex min-w-0 items-center justify-end gap-1 text-copy-13 text-gray-1000", {
|
|
52385
52439
|
variants: {
|
|
52386
52440
|
variant: {
|
|
52387
52441
|
default: "",
|
|
@@ -53395,7 +53449,7 @@ function TimestampTooltip({ date: date2, children: children2, side = "top" }) {
|
|
|
53395
53449
|
const card = jsxRuntimeExports.jsx(RelativeTimeCard, { date: ts, side, asChild: true, children: children2 });
|
|
53396
53450
|
return hasProvider ? card : jsxRuntimeExports.jsx(ContextCardProvider, { children: card });
|
|
53397
53451
|
}
|
|
53398
|
-
const ERROR_EVENT_TYPES
|
|
53452
|
+
const ERROR_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
53399
53453
|
"step_failed",
|
|
53400
53454
|
"step_retrying",
|
|
53401
53455
|
"run_failed",
|
|
@@ -53642,7 +53696,7 @@ function deepParseJson(value) {
|
|
|
53642
53696
|
return value;
|
|
53643
53697
|
}
|
|
53644
53698
|
function extractStructuredError(data, eventType) {
|
|
53645
|
-
if (!eventType || !ERROR_EVENT_TYPES
|
|
53699
|
+
if (!eventType || !ERROR_EVENT_TYPES.has(eventType))
|
|
53646
53700
|
return null;
|
|
53647
53701
|
if (data == null || typeof data !== "object")
|
|
53648
53702
|
return null;
|
|
@@ -54414,7 +54468,7 @@ function TraceViewerSkeleton() {
|
|
|
54414
54468
|
} }, row.id)) }) }), jsxRuntimeExports.jsxs("div", { className: "shrink-0 grid", style: { gridTemplateColumns: COL_TEMPLATE }, children: [jsxRuntimeExports.jsxs("div", { className: "h-10 min-h-10 flex items-center border-b border-gray-alpha-400 pl-4 pr-2 gap-1.5", children: [jsxRuntimeExports.jsx(Skeleton$2, { className: "w-3.5 h-3.5 shrink-0 rounded-sm" }), jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3.5 w-40" })] }), jsxRuntimeExports.jsx(HeaderDivider, {}), jsxRuntimeExports.jsx("div", { className: "h-10 min-h-10 flex items-end border-b border-gray-alpha-400 px-4 pb-1 gap-2", children: jsxRuntimeExports.jsx("div", { className: "relative flex-1 flex items-end justify-between", children: HEADER_MARKERS.map((id2) => jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3.5 w-9" }, id2)) }) })] }), jsxRuntimeExports.jsxs("div", { className: "grid flex-1 min-h-0 overflow-hidden", style: { gridTemplateColumns: COL_TEMPLATE }, children: [jsxRuntimeExports.jsx("div", { className: "block overflow-visible", children: jsxRuntimeExports.jsx("ul", { className: "block divide-y divide-gray-alpha-400 border-b border-gray-alpha-400", children: ROWS.map((row) => jsxRuntimeExports.jsxs("li", { className: "h-10 flex items-center pl-4 pr-2", children: [jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [jsxRuntimeExports.jsx(Skeleton$2, { className: "w-4 h-4 shrink-0 rounded-sm" }), jsxRuntimeExports.jsx(Skeleton$2, { className: "h-3.5", style: { width: `${row.name}%` } })] }), jsxRuntimeExports.jsx(Skeleton$2, { className: "ml-2 h-3.5 w-10 shrink-0" })] }, row.id)) }) }), jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "h-full w-px bg-gray-alpha-400" }), jsxRuntimeExports.jsx("div", { className: "relative min-h-0", children: ROWS.map((row) => jsxRuntimeExports.jsx("div", { className: "relative h-10", children: jsxRuntimeExports.jsx("div", { className: "absolute inset-x-4 inset-y-0", children: jsxRuntimeExports.jsx(Skeleton$2, { className: "absolute top-1/2 -translate-y-1/2 h-6 rounded-[0.25rem]", style: { left: `${row.off}%`, width: `${row.bar}%` } }) }) }, row.id)) })] })] });
|
|
54415
54469
|
}
|
|
54416
54470
|
function shouldShowVerticalLine(eventType) {
|
|
54417
|
-
if (eventType
|
|
54471
|
+
if (isHookLifecycleEventType(eventType)) {
|
|
54418
54472
|
return true;
|
|
54419
54473
|
}
|
|
54420
54474
|
return false;
|
|
@@ -54613,7 +54667,7 @@ function stepToSpan(stepEvents, maxEndTime) {
|
|
|
54613
54667
|
}
|
|
54614
54668
|
let endTime = new Date(maxEndTime);
|
|
54615
54669
|
if (step.completedAt) {
|
|
54616
|
-
const completedEvent = stepEvents.slice().reverse().find((event) => event.eventType
|
|
54670
|
+
const completedEvent = stepEvents.slice().reverse().find((event) => isTerminalStepEventType(event.eventType));
|
|
54617
54671
|
endTime = getEventTimestamp(completedEvent) ?? new Date(step.completedAt);
|
|
54618
54672
|
}
|
|
54619
54673
|
return {
|
|
@@ -54723,10 +54777,7 @@ function runToSpan(run2, runEvents, nowTime) {
|
|
|
54723
54777
|
activeStartTime: activeStartTime && activeStartTime.getTime() > spanStartTime.getTime() ? dateToOtelTime(activeStartTime) : void 0
|
|
54724
54778
|
};
|
|
54725
54779
|
}
|
|
54726
|
-
const
|
|
54727
|
-
const isTimerEvent = (eventType) => eventType === "wait_created" || eventType === "wait_completed";
|
|
54728
|
-
const isHookLifecycleEvent = (eventType) => eventType === "hook_received" || eventType === "hook_created" || eventType === "hook_disposed";
|
|
54729
|
-
const isRunLevelEvent = (event) => !event.correlationId || !isTimerEvent(event.eventType) && !isHookLifecycleEvent(event.eventType) && !isStepEvent(event.eventType);
|
|
54780
|
+
const isRunLevelEvent = (event) => !event.correlationId || !isWaitEventType(event.eventType) && !isHookLifecycleEventType(event.eventType) && !isStepEventType(event.eventType);
|
|
54730
54781
|
function filterSpanRawEvents(events2, resource, spanId) {
|
|
54731
54782
|
if (resource === "run") {
|
|
54732
54783
|
return events2.filter(isRunLevelEvent);
|
|
@@ -54754,15 +54805,15 @@ function groupEventsByCorrelation(events2) {
|
|
|
54754
54805
|
runLevelEvents.push(event);
|
|
54755
54806
|
continue;
|
|
54756
54807
|
}
|
|
54757
|
-
if (
|
|
54808
|
+
if (isWaitEventType(event.eventType)) {
|
|
54758
54809
|
pushEvent(timerEvents, correlationId, event);
|
|
54759
54810
|
continue;
|
|
54760
54811
|
}
|
|
54761
|
-
if (
|
|
54812
|
+
if (isHookLifecycleEventType(event.eventType)) {
|
|
54762
54813
|
pushEvent(hookEvents, correlationId, event);
|
|
54763
54814
|
continue;
|
|
54764
54815
|
}
|
|
54765
|
-
if (
|
|
54816
|
+
if (isStepEventType(event.eventType)) {
|
|
54766
54817
|
pushEvent(eventsByStepId, correlationId, event);
|
|
54767
54818
|
continue;
|
|
54768
54819
|
}
|
|
@@ -83056,7 +83107,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
|
|
|
83056
83107
|
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 });
|
|
83057
83108
|
var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
|
|
83058
83109
|
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 }) });
|
|
83059
|
-
var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-
|
|
83110
|
+
var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-DU9e_6JW.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
|
|
83060
83111
|
let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
|
|
83061
83112
|
`).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
|
|
83062
83113
|
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 }) })] }) });
|
|
@@ -83378,7 +83429,7 @@ var Dt = ({ children: e, className: t, onDownload: o, onError: n }) => {
|
|
|
83378
83429
|
}, []), 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] });
|
|
83379
83430
|
};
|
|
83380
83431
|
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 }) })] });
|
|
83381
|
-
var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-
|
|
83432
|
+
var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-DgV-PzsY.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
|
|
83382
83433
|
function ke(e, t) {
|
|
83383
83434
|
if (!(e != null && e.position || t != null && t.position)) return true;
|
|
83384
83435
|
if (!(e != null && e.position && (t != null && t.position))) return false;
|
|
@@ -84373,21 +84424,6 @@ const AttributePanel = ({ data, moduleSpecifier, moduleSourceUrl, isLoading, err
|
|
|
84373
84424
|
return jsxRuntimeExports.jsx(DetailMonoKeyValueRow, { label, value: displayValue, copyText: isCopyableBasicAttribute ? displayValue : void 0, href: attribute === "moduleSpecifier" ? moduleSourceUrl : void 0 }, attribute);
|
|
84374
84425
|
}), isLoading && resource === "sleep" && !displayData.resumeAt && jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-3 py-0.5", children: [jsxRuntimeExports.jsx("span", { className: "text-label-13 text-gray-900", children: "Resume" }), 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, {}) : resolvedAttributes.length > 0 ? resolvedAttributes.map((attribute) => jsxRuntimeExports.jsx(AttributeBlock, { isLoading, attribute, value: displayData[attribute], context: displayContext }, attribute)) : null] }) }) }) });
|
|
84375
84426
|
};
|
|
84376
|
-
const ERROR_EVENT_TYPES = /* @__PURE__ */ new Set(["step_failed", "step_retrying"]);
|
|
84377
|
-
const DATA_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
84378
|
-
"step_created",
|
|
84379
|
-
"step_completed",
|
|
84380
|
-
"step_failed",
|
|
84381
|
-
"step_retrying",
|
|
84382
|
-
"hook_created",
|
|
84383
|
-
"hook_received",
|
|
84384
|
-
"run_created",
|
|
84385
|
-
"run_completed",
|
|
84386
|
-
"run_failed",
|
|
84387
|
-
"wait_created",
|
|
84388
|
-
"wait_completed",
|
|
84389
|
-
"attr_set"
|
|
84390
|
-
]);
|
|
84391
84427
|
const parseDateValue = (value) => {
|
|
84392
84428
|
if (value == null)
|
|
84393
84429
|
return null;
|
|
@@ -84412,17 +84448,17 @@ function EventItem({ event, onLoadEventData, encryptionKey, showSeparateEventOcc
|
|
|
84412
84448
|
const loadedDataRef = reactExports.useRef(null);
|
|
84413
84449
|
const existingData = "eventData" in event && event.eventData != null ? event.eventData : null;
|
|
84414
84450
|
const mergedDisplay = loadedData ?? existingData;
|
|
84415
|
-
const canHaveData =
|
|
84416
|
-
const loadEventData = reactExports.useCallback(async (
|
|
84417
|
-
if (!onLoadEventData
|
|
84451
|
+
const canHaveData = existingData !== null || getEventDataRefFields(event.eventType).length > 0;
|
|
84452
|
+
const loadEventData = reactExports.useCallback(async (force) => {
|
|
84453
|
+
if (!onLoadEventData)
|
|
84418
84454
|
return;
|
|
84419
|
-
if (!
|
|
84455
|
+
if (!force && loadedDataRef.current !== null) {
|
|
84420
84456
|
return;
|
|
84421
84457
|
}
|
|
84422
84458
|
try {
|
|
84423
84459
|
setIsLoading(true);
|
|
84424
84460
|
setLoadError(null);
|
|
84425
|
-
const data = await onLoadEventData(event
|
|
84461
|
+
const data = await onLoadEventData(event);
|
|
84426
84462
|
loadedDataRef.current = data;
|
|
84427
84463
|
setLoadedData(data);
|
|
84428
84464
|
} catch (err) {
|
|
@@ -84430,19 +84466,19 @@ function EventItem({ event, onLoadEventData, encryptionKey, showSeparateEventOcc
|
|
|
84430
84466
|
} finally {
|
|
84431
84467
|
setIsLoading(false);
|
|
84432
84468
|
}
|
|
84433
|
-
}, [onLoadEventData, event
|
|
84434
|
-
const handleExpand = reactExports.useCallback(
|
|
84469
|
+
}, [onLoadEventData, event]);
|
|
84470
|
+
const handleExpand = reactExports.useCallback(() => {
|
|
84435
84471
|
if (isLoading)
|
|
84436
84472
|
return;
|
|
84437
84473
|
wasExpandedRef.current = true;
|
|
84438
|
-
|
|
84474
|
+
void loadEventData(false);
|
|
84439
84475
|
}, [isLoading, loadEventData]);
|
|
84440
84476
|
reactExports.useLayoutEffect(() => {
|
|
84441
84477
|
if (!encryptionKey || !wasExpandedRef.current)
|
|
84442
84478
|
return;
|
|
84443
84479
|
loadedDataRef.current = null;
|
|
84444
84480
|
setLoadedData(null);
|
|
84445
|
-
void loadEventData(
|
|
84481
|
+
void loadEventData(true);
|
|
84446
84482
|
}, [encryptionKey, loadEventData]);
|
|
84447
84483
|
const createdAt = new Date(event.createdAt);
|
|
84448
84484
|
const occurredAt = parseDateValue(event.occurredAt);
|
|
@@ -84481,7 +84517,7 @@ function EventDataBlock({ eventType, data }) {
|
|
|
84481
84517
|
if (eventType === "attr_set") {
|
|
84482
84518
|
return jsxRuntimeExports.jsx(AttrSetEventBlock, { data });
|
|
84483
84519
|
}
|
|
84484
|
-
if (
|
|
84520
|
+
if (getEventDataRefFields(eventType).includes("error") && data != null && typeof data === "object") {
|
|
84485
84521
|
const record2 = data;
|
|
84486
84522
|
if (isStructuredError(record2.error)) {
|
|
84487
84523
|
return jsxRuntimeExports.jsx(ErrorStackBlock, { value: record2.error });
|
|
@@ -84682,8 +84718,7 @@ function EntityDetailPanel({ run: run2, onStreamClick, onRunClick, fetchSpanDeta
|
|
|
84682
84718
|
const canWakeUp = reactExports.useMemo(() => {
|
|
84683
84719
|
if (resource !== "sleep" || !rawEvents)
|
|
84684
84720
|
return false;
|
|
84685
|
-
|
|
84686
|
-
if (terminalStates.includes(run2.status))
|
|
84721
|
+
if (isTerminalWorkflowRunStatus(run2.status))
|
|
84687
84722
|
return false;
|
|
84688
84723
|
const hasWaitCreated = rawEvents.some((e) => e.eventType === "wait_created");
|
|
84689
84724
|
if (!hasWaitCreated)
|
|
@@ -84696,8 +84731,7 @@ function EntityDetailPanel({ run: run2, onStreamClick, onRunClick, fetchSpanDeta
|
|
|
84696
84731
|
return false;
|
|
84697
84732
|
if (resolvedHookIds.has(resourceId))
|
|
84698
84733
|
return false;
|
|
84699
|
-
|
|
84700
|
-
if (terminalStates.includes(run2.status))
|
|
84734
|
+
if (isTerminalWorkflowRunStatus(run2.status))
|
|
84701
84735
|
return false;
|
|
84702
84736
|
const hasHookDisposed = rawEvents.some((e) => e.eventType === "hook_disposed");
|
|
84703
84737
|
if (hasHookDisposed)
|
|
@@ -87675,7 +87709,7 @@ function TraceShortcutHelper({ hasMultipleSpans, reducedMotion }) {
|
|
|
87675
87709
|
}
|
|
87676
87710
|
setVisible(false);
|
|
87677
87711
|
};
|
|
87678
|
-
return jsxRuntimeExports.jsxs("div", { className: "group
|
|
87712
|
+
return jsxRuntimeExports.jsxs("div", { className: "group sticky bottom-3 z-10 ml-4 mb-3 hidden h-8 w-fit items-center gap-1 text-xs leading-none text-gray-900 @min-[480px]:flex", children: [jsxRuntimeExports.jsx("span", { "aria-live": "polite", "aria-atomic": "true", className: "inline-flex items-center whitespace-nowrap", children: reducedMotion ? jsxRuntimeExports.jsx(AltHint, {}) : jsxRuntimeExports.jsx("span", { className: `inline-flex items-center ${styles$1.hint}`, children: index2 === 0 ? jsxRuntimeExports.jsx(AltHint, {}) : jsxRuntimeExports.jsx(NavHint, {}) }, index2) }), jsxRuntimeExports.jsx("button", { type: "button", className: "inline-flex h-5 w-5 items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 motion-reduce:transition-none", onClick: dismiss, "aria-label": "Dismiss trace shortcuts helper", children: jsxRuntimeExports.jsx(X$3, { className: "h-3 w-3" }) })] });
|
|
87679
87713
|
}
|
|
87680
87714
|
const MIN_VIEWPORT_MS = 1e-3;
|
|
87681
87715
|
const ZOOM_DEBOUNCE_MS = 150;
|
|
@@ -87969,7 +88003,7 @@ function NewTraceViewerContent({ trace: trace2, onLoadMore, hasMore, isLoadingMo
|
|
|
87969
88003
|
e.stopPropagation();
|
|
87970
88004
|
setSearchQuery("");
|
|
87971
88005
|
}
|
|
87972
|
-
}, placeholder: "Search spans...", "aria-label": "Search spans", className: "flex-1 min-w-0 bg-transparent text-sm text-gray-1000 placeholder:text-gray-800 outline-none" }), searchQuery && jsxRuntimeExports.jsx("button", { type: "button", "aria-label": "Clear search", onClick: () => setSearchQuery(""), className: "-mr-2 hidden h-full max-w-full shrink-0 cursor-pointer items-center rounded-r-md border-0 bg-transparent px-2.5 font-inherit text-base text-gray-900 no-underline transition-colors duration-150 ease-in hover:text-gray-1000 focus-visible:-outline-offset-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--ds-focus-color)] min-[961px]:flex", children: jsxRuntimeExports.jsx(Kbd, { variant: "outline", size: "search", children: "Esc" }) })] }), endHeader: jsxRuntimeExports.jsx(TimelineHeader, { markers: timeMarkers, hoverInfo: hoverInfo2 }), children: [jsxRuntimeExports.jsxs("div", { className: "block overflow-visible", children: [jsxRuntimeExports.jsx(EventList, { spans: trace2.spans, activeSpanId, searchResult, onSelectSpan: handleSelectSpan }), jsxRuntimeExports.jsx("div", { ref: loadMoreSentinelRef, className: "flex justify-center", children: isLoadingMore ? jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2 py-3 text-sm text-gray-800", children: [jsxRuntimeExports.jsx(Spinner, { size: 14 }), jsxRuntimeExports.jsx("span", { children: "Loading spans…" })] }) : null })] }), jsxRuntimeExports.
|
|
88006
|
+
}, placeholder: "Search spans...", "aria-label": "Search spans", className: "flex-1 min-w-0 bg-transparent text-sm text-gray-1000 placeholder:text-gray-800 outline-none" }), searchQuery && jsxRuntimeExports.jsx("button", { type: "button", "aria-label": "Clear search", onClick: () => setSearchQuery(""), className: "-mr-2 hidden h-full max-w-full shrink-0 cursor-pointer items-center rounded-r-md border-0 bg-transparent px-2.5 font-inherit text-base text-gray-900 no-underline transition-colors duration-150 ease-in hover:text-gray-1000 focus-visible:-outline-offset-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--ds-focus-color)] min-[961px]:flex", children: jsxRuntimeExports.jsx(Kbd, { variant: "outline", size: "search", children: "Esc" }) })] }), endHeader: jsxRuntimeExports.jsx(TimelineHeader, { markers: timeMarkers, hoverInfo: hoverInfo2 }), children: [jsxRuntimeExports.jsxs("div", { className: "block overflow-visible", children: [jsxRuntimeExports.jsx(EventList, { spans: trace2.spans, activeSpanId, searchResult, onSelectSpan: handleSelectSpan }), jsxRuntimeExports.jsx("div", { ref: loadMoreSentinelRef, className: "flex justify-center", children: isLoadingMore ? jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2 py-3 text-sm text-gray-800", children: [jsxRuntimeExports.jsx(Spinner, { size: 14 }), jsxRuntimeExports.jsx("span", { children: "Loading spans…" })] }) : null })] }), jsxRuntimeExports.jsxs("div", { ref: timelineRef, id: "trace-timeline", className: "@container block min-h-0 overflow-visible relative", onDoubleClick: resetZoom, onMouseMove: handleTimelineMouseMove, onMouseLeave: handleTimelineMouseLeave, children: [jsxRuntimeExports.jsx(Timeline, { spans: trace2.spans, viewStart: viewport.start, viewEnd: viewport.end, markers: timeMarkers, selectedId: activeSpanId, searchResult, onSelect: handleSelectSpan, onRevealTime: handleRevealTime, hoverFraction, altHeld }), jsxRuntimeExports.jsx(TraceShortcutHelper, { hasMultipleSpans: trace2.spans.length > 1, reducedMotion })] })] }), jsxRuntimeExports.jsxs("div", { className: "absolute right-3 bottom-3 z-[5] flex items-center border border-gray-alpha-400 rounded-md bg-background-100 shadow-sm overflow-hidden divide-x divide-gray-alpha-400", children: [jsxRuntimeExports.jsx(IconButton, { variant: "muted", size: "small", onClick: zoomOut, disabled: isAtMinZoom, "aria-label": "Zoom out", children: jsxRuntimeExports.jsx(ZoomOut, { className: "w-4 h-4" }) }), jsxRuntimeExports.jsx(IconButton, { variant: "muted", size: "small", onClick: resetZoom, "aria-label": "Reset zoom", children: jsxRuntimeExports.jsx(RotateCcw, { className: "w-3.5 h-3.5" }) }), jsxRuntimeExports.jsx(IconButton, { variant: "muted", size: "small", onClick: zoomIn, disabled: isAtMaxZoom, "aria-label": "Zoom in", children: jsxRuntimeExports.jsx(ZoomIn, { className: "w-4 h-4" }) })] })] }), jsxRuntimeExports.jsx(TraceDetailPanel, { containerRef: paneRootRef, onNavigateToSpan: navigateToSpan, onClose: handleClearActiveSpan })] });
|
|
87973
88007
|
}
|
|
87974
88008
|
const NewTraceViewer = ({ run: run2, events: events2, sidebarData, onLoadMore, hasMore, isLoadingMore, loading = false }) => {
|
|
87975
88009
|
const trace2 = reactExports.useMemo(() => {
|
|
@@ -91742,6 +91776,12 @@ async function trace$2(spanName2, ...args) {
|
|
|
91742
91776
|
}
|
|
91743
91777
|
});
|
|
91744
91778
|
}
|
|
91779
|
+
async function recordElapsedSpan(spanName2, startEpochMs, opts) {
|
|
91780
|
+
const tracer = await Tracer.value;
|
|
91781
|
+
if (!tracer)
|
|
91782
|
+
return;
|
|
91783
|
+
tracer.startSpan(spanName2, { ...opts, startTime: startEpochMs }).end();
|
|
91784
|
+
}
|
|
91745
91785
|
function applyWorkflowSuspensionToSpan(error2, otel, span) {
|
|
91746
91786
|
if (!error2 || !WorkflowSuspension.is(error2)) {
|
|
91747
91787
|
return;
|
|
@@ -91766,6 +91806,9 @@ async function getSpanContextForTraceCarrier(carrier) {
|
|
|
91766
91806
|
async function getActiveSpan() {
|
|
91767
91807
|
return await withOtel((otel) => otel.trace.getActiveSpan());
|
|
91768
91808
|
}
|
|
91809
|
+
async function getSpanKind$2(field) {
|
|
91810
|
+
return withOtel((x2) => x2.SpanKind[field]);
|
|
91811
|
+
}
|
|
91769
91812
|
async function withOtel(fn2) {
|
|
91770
91813
|
const otel = await OtelApi.value;
|
|
91771
91814
|
if (!otel)
|
|
@@ -91921,7 +91964,7 @@ const encryption = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
91921
91964
|
encrypt: encrypt$1,
|
|
91922
91965
|
importKey
|
|
91923
91966
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
91924
|
-
const version$1 = "5.0.0-beta.
|
|
91967
|
+
const version$1 = "5.0.0-beta.30";
|
|
91925
91968
|
function assertWorldSupportsRuntimeProtocol(world) {
|
|
91926
91969
|
if (world.specVersion === SPEC_VERSION_CURRENT) {
|
|
91927
91970
|
return;
|
|
@@ -91969,6 +92012,15 @@ function generateHealthCheckRunId(correlationId) {
|
|
|
91969
92012
|
}
|
|
91970
92013
|
const HEALTH_CHECK_POLL_INTERVAL = 100;
|
|
91971
92014
|
const HEALTH_CHECK_READ_TIMEOUT = 500;
|
|
92015
|
+
function withDeadline(promise2, ms2) {
|
|
92016
|
+
let timer2;
|
|
92017
|
+
return Promise.race([
|
|
92018
|
+
promise2,
|
|
92019
|
+
new Promise((_2, reject) => {
|
|
92020
|
+
timer2 = setTimeout(() => reject(new Error(`Operation timed out after ${ms2}ms`)), ms2);
|
|
92021
|
+
})
|
|
92022
|
+
]).finally(() => clearTimeout(timer2));
|
|
92023
|
+
}
|
|
91972
92024
|
async function readStreamWithTimeout(reader, readTimeout) {
|
|
91973
92025
|
const chunks = [];
|
|
91974
92026
|
let done = false;
|
|
@@ -92036,7 +92088,8 @@ async function healthCheck(world, endpoint, options) {
|
|
|
92036
92088
|
});
|
|
92037
92089
|
while (Date.now() - startTime < timeout2) {
|
|
92038
92090
|
try {
|
|
92039
|
-
const
|
|
92091
|
+
const remainingMs = timeout2 - (Date.now() - startTime);
|
|
92092
|
+
const stream = await withDeadline(world.streams.get(generateHealthCheckRunId(correlationId), streamName), remainingMs);
|
|
92040
92093
|
const reader = stream.getReader();
|
|
92041
92094
|
const { chunks, timedOut } = await readStreamWithTimeout(reader, HEALTH_CHECK_READ_TIMEOUT);
|
|
92042
92095
|
if (timedOut) {
|
|
@@ -92812,7 +92865,7 @@ const devalueCodec = {
|
|
|
92812
92865
|
deserialize(data, mode, options) {
|
|
92813
92866
|
const revivers = getReviversForMode(mode, options == null ? void 0 : options.global, options == null ? void 0 : options.extraRevivers);
|
|
92814
92867
|
const str = decoder.decode(data);
|
|
92815
|
-
return parse$
|
|
92868
|
+
return parse$5(str, revivers);
|
|
92816
92869
|
},
|
|
92817
92870
|
deserializeLegacy(data, mode, options) {
|
|
92818
92871
|
const revivers = getReviversForMode(mode, options == null ? void 0 : options.global, options == null ? void 0 : options.extraRevivers);
|
|
@@ -93319,7 +93372,7 @@ function getDeserializeStream(revivers, cryptoKey) {
|
|
|
93319
93372
|
}
|
|
93320
93373
|
if (format2 === SerializationFormat.DEVALUE_V1) {
|
|
93321
93374
|
const text2 = decoder2.decode(payload);
|
|
93322
|
-
controller.enqueue(parse$
|
|
93375
|
+
controller.enqueue(parse$5(text2, revivers));
|
|
93323
93376
|
}
|
|
93324
93377
|
}
|
|
93325
93378
|
}
|
|
@@ -93341,7 +93394,7 @@ function getDeserializeStream(revivers, cryptoKey) {
|
|
|
93341
93394
|
const lines = text2.split("\n");
|
|
93342
93395
|
for (const line of lines) {
|
|
93343
93396
|
if (line.length > 0) {
|
|
93344
|
-
controller.enqueue(parse$
|
|
93397
|
+
controller.enqueue(parse$5(line, revivers));
|
|
93345
93398
|
}
|
|
93346
93399
|
}
|
|
93347
93400
|
},
|
|
@@ -93402,17 +93455,35 @@ function getByteUnframingStream() {
|
|
|
93402
93455
|
}
|
|
93403
93456
|
});
|
|
93404
93457
|
}
|
|
93458
|
+
function recordReadTimeToFirstChunk(startEpochMs, runId, name2, startIndex) {
|
|
93459
|
+
void (async () => {
|
|
93460
|
+
await recordElapsedSpan("workflow.stream.read", startEpochMs, {
|
|
93461
|
+
kind: await getSpanKind$2("CLIENT"),
|
|
93462
|
+
attributes: {
|
|
93463
|
+
"workflow.run.id": runId,
|
|
93464
|
+
"workflow.stream.name": name2,
|
|
93465
|
+
"workflow.stream.operation": "read",
|
|
93466
|
+
"workflow.stream.read.ttfc_ms": Date.now() - startEpochMs,
|
|
93467
|
+
...typeof startIndex === "number" ? { "workflow.stream.start_index": startIndex } : {}
|
|
93468
|
+
}
|
|
93469
|
+
});
|
|
93470
|
+
})();
|
|
93471
|
+
}
|
|
93405
93472
|
class WorkflowServerReadableStream extends ReadableStream {
|
|
93406
93473
|
constructor(runId, name2, startIndex) {
|
|
93407
93474
|
if (typeof name2 !== "string" || name2.length === 0) {
|
|
93408
93475
|
throw new WorkflowRuntimeError(`"name" is required, got "${name2}"`);
|
|
93409
93476
|
}
|
|
93477
|
+
let readStart;
|
|
93478
|
+
let firstChunkReported = false;
|
|
93410
93479
|
super({
|
|
93411
93480
|
// @ts-expect-error Not sure why TypeScript is complaining about this
|
|
93412
93481
|
type: "bytes",
|
|
93413
93482
|
pull: async (controller) => {
|
|
93414
93483
|
let reader = __privateGet(this, _reader);
|
|
93415
93484
|
if (!reader) {
|
|
93485
|
+
if (readStart === void 0)
|
|
93486
|
+
readStart = Date.now();
|
|
93416
93487
|
const world = await getWorldLazy();
|
|
93417
93488
|
const stream = await world.streams.get(runId, name2, startIndex);
|
|
93418
93489
|
reader = __privateSet(this, _reader, stream.getReader());
|
|
@@ -93426,6 +93497,10 @@ class WorkflowServerReadableStream extends ReadableStream {
|
|
|
93426
93497
|
__privateSet(this, _reader, void 0);
|
|
93427
93498
|
controller.close();
|
|
93428
93499
|
} else {
|
|
93500
|
+
if (!firstChunkReported && result.value.byteLength > 0 && readStart !== void 0) {
|
|
93501
|
+
firstChunkReported = true;
|
|
93502
|
+
recordReadTimeToFirstChunk(readStart, runId, name2, startIndex);
|
|
93503
|
+
}
|
|
93429
93504
|
controller.enqueue(result.value);
|
|
93430
93505
|
}
|
|
93431
93506
|
},
|
|
@@ -94569,7 +94644,7 @@ async function hydrateRunError(value, runId, key, ops = [], global2 = globalThis
|
|
|
94569
94644
|
const { format: format2, payload } = decodeFormatPrefix(decrypted);
|
|
94570
94645
|
if (format2 === SerializationFormat.DEVALUE_V1) {
|
|
94571
94646
|
const str = new TextDecoder().decode(payload);
|
|
94572
|
-
return parse$
|
|
94647
|
+
return parse$5(str, {
|
|
94573
94648
|
...getExternalRevivers(global2, ops, runId, key),
|
|
94574
94649
|
...extraRevivers
|
|
94575
94650
|
});
|
|
@@ -97565,7 +97640,8 @@ async function start$1(workflow, argsOrOptions, options) {
|
|
|
97565
97640
|
} else {
|
|
97566
97641
|
const probe = await healthCheck(world, "workflow", {
|
|
97567
97642
|
deploymentId,
|
|
97568
|
-
timeout: CROSS_DEPLOYMENT_CAPABILITY_PROBE_TIMEOUT_MS
|
|
97643
|
+
timeout: CROSS_DEPLOYMENT_CAPABILITY_PROBE_TIMEOUT_MS,
|
|
97644
|
+
namespace: opts.namespace
|
|
97569
97645
|
}).catch(() => void 0);
|
|
97570
97646
|
const capabilities = getRunCapabilities(probe == null ? void 0 : probe.workflowCoreVersion);
|
|
97571
97647
|
framedByteStreams = capabilities.framedByteStreams;
|
|
@@ -97596,6 +97672,9 @@ async function start$1(workflow, argsOrOptions, options) {
|
|
|
97596
97672
|
attributes,
|
|
97597
97673
|
...allowReservedAttributes ? { allowReservedAttributes: true } : {}
|
|
97598
97674
|
} : {};
|
|
97675
|
+
if (opts.replayedFromRunId !== void 0 && !workflowRunIdSchema.safeParse(opts.replayedFromRunId).success) {
|
|
97676
|
+
throw new WorkflowRuntimeError(`replayedFromRunId must be a run ID (wrun_<ulid>); received ${JSON.stringify(String(opts.replayedFromRunId).slice(0, 64))}.`);
|
|
97677
|
+
}
|
|
97599
97678
|
const rawKey = await ((_b2 = world.getEncryptionKeyForRun) == null ? void 0 : _b2.call(world, runId, {
|
|
97600
97679
|
...opts,
|
|
97601
97680
|
deploymentId
|
|
@@ -97606,7 +97685,8 @@ async function start$1(workflow, argsOrOptions, options) {
|
|
|
97606
97685
|
const executionContext = {
|
|
97607
97686
|
traceCarrier,
|
|
97608
97687
|
workflowCoreVersion: version$1,
|
|
97609
|
-
features: { encryption: !!encryptionKey }
|
|
97688
|
+
features: { encryption: !!encryptionKey },
|
|
97689
|
+
...opts.replayedFromRunId ? { replayedFromRunId: opts.replayedFromRunId } : {}
|
|
97610
97690
|
};
|
|
97611
97691
|
const [runCreatedResult, queueResult] = await Promise.allSettled([
|
|
97612
97692
|
world.events.create(runId, {
|
|
@@ -97620,7 +97700,7 @@ async function start$1(workflow, argsOrOptions, options) {
|
|
|
97620
97700
|
...attributeSeed
|
|
97621
97701
|
}
|
|
97622
97702
|
}, { v1Compat }),
|
|
97623
|
-
world.queue(getWorkflowQueueName(workflowName), {
|
|
97703
|
+
world.queue(getWorkflowQueueName(workflowName, opts.namespace), {
|
|
97624
97704
|
runId,
|
|
97625
97705
|
traceCarrier,
|
|
97626
97706
|
...specVersion >= SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT ? {
|
|
@@ -97690,7 +97770,9 @@ async function recreateRunFromExisting(world, runId, options = {}) {
|
|
|
97690
97770
|
const newRun = await start$1({ workflowId: run2.workflowName }, workflowArgs, {
|
|
97691
97771
|
deploymentId,
|
|
97692
97772
|
world,
|
|
97693
|
-
specVersion
|
|
97773
|
+
specVersion,
|
|
97774
|
+
replayedFromRunId: runId,
|
|
97775
|
+
namespace: options.namespace
|
|
97694
97776
|
});
|
|
97695
97777
|
return newRun.runId;
|
|
97696
97778
|
} catch (err) {
|
|
@@ -97712,10 +97794,10 @@ async function cancelRun$2(world, runId, options) {
|
|
|
97712
97794
|
throw new Error(`Failed to cancel run ${runId}: ${err instanceof Error ? err.message : String(err)}`, { cause: err });
|
|
97713
97795
|
}
|
|
97714
97796
|
}
|
|
97715
|
-
async function reenqueueRun$2(world, runId) {
|
|
97797
|
+
async function reenqueueRun$2(world, runId, options) {
|
|
97716
97798
|
try {
|
|
97717
97799
|
const run2 = await world.runs.get(runId, { resolveData: "none" });
|
|
97718
|
-
await world.queue(getWorkflowQueueName(run2.workflowName), {
|
|
97800
|
+
await world.queue(getWorkflowQueueName(run2.workflowName, options == null ? void 0 : options.namespace), {
|
|
97719
97801
|
runId
|
|
97720
97802
|
}, {
|
|
97721
97803
|
deploymentId: run2.deploymentId,
|
|
@@ -97775,7 +97857,7 @@ async function wakeUpRun$2(world, runId, options) {
|
|
|
97775
97857
|
}
|
|
97776
97858
|
}
|
|
97777
97859
|
if (stoppedCount > 0) {
|
|
97778
|
-
await world.queue(getWorkflowQueueName(run2.workflowName), {
|
|
97860
|
+
await world.queue(getWorkflowQueueName(run2.workflowName, options == null ? void 0 : options.namespace), {
|
|
97779
97861
|
runId
|
|
97780
97862
|
}, {
|
|
97781
97863
|
deploymentId: run2.deploymentId,
|
|
@@ -98906,22 +98988,22 @@ async function initDataDir(dataDir) {
|
|
|
98906
98988
|
throw error2;
|
|
98907
98989
|
}
|
|
98908
98990
|
}
|
|
98909
|
-
let otelApiPromise$
|
|
98910
|
-
async function getOtelApi$
|
|
98911
|
-
if (!otelApiPromise$
|
|
98912
|
-
otelApiPromise$
|
|
98991
|
+
let otelApiPromise$2 = null;
|
|
98992
|
+
async function getOtelApi$2() {
|
|
98993
|
+
if (!otelApiPromise$2) {
|
|
98994
|
+
otelApiPromise$2 = import("./index-Dq5jTBN4.js").catch(() => null);
|
|
98913
98995
|
}
|
|
98914
|
-
return otelApiPromise$
|
|
98996
|
+
return otelApiPromise$2;
|
|
98915
98997
|
}
|
|
98916
98998
|
let tracerPromise$1 = null;
|
|
98917
98999
|
async function getTracer$1() {
|
|
98918
99000
|
if (!tracerPromise$1) {
|
|
98919
|
-
tracerPromise$1 = getOtelApi$
|
|
99001
|
+
tracerPromise$1 = getOtelApi$2().then((otel) => otel ? otel.trace.getTracer("workflow") : null);
|
|
98920
99002
|
}
|
|
98921
99003
|
return tracerPromise$1;
|
|
98922
99004
|
}
|
|
98923
99005
|
async function trace$1(spanName2, ...args) {
|
|
98924
|
-
const [tracer, otel] = await Promise.all([getTracer$1(), getOtelApi$
|
|
99006
|
+
const [tracer, otel] = await Promise.all([getTracer$1(), getOtelApi$2()]);
|
|
98925
99007
|
const { fn: fn2, opts } = typeof args[0] === "function" ? { fn: args[0], opts: {} } : { fn: args[1], opts: args[0] };
|
|
98926
99008
|
if (!fn2)
|
|
98927
99009
|
throw new Error("Function to trace must be provided");
|
|
@@ -98945,7 +99027,7 @@ async function trace$1(spanName2, ...args) {
|
|
|
98945
99027
|
});
|
|
98946
99028
|
}
|
|
98947
99029
|
async function getSpanKind$1(field) {
|
|
98948
|
-
const otel = await getOtelApi$
|
|
99030
|
+
const otel = await getOtelApi$2();
|
|
98949
99031
|
if (!otel)
|
|
98950
99032
|
return void 0;
|
|
98951
99033
|
return otel.SpanKind[field];
|
|
@@ -125703,13 +125785,11 @@ function createEventsStorage(basedir, tag) {
|
|
|
125703
125785
|
if ("correlationId" in data && typeof data.correlationId === "string") {
|
|
125704
125786
|
assertSafeEntityId("correlationId", data.correlationId);
|
|
125705
125787
|
}
|
|
125706
|
-
|
|
125707
|
-
if (isStepEvent2 && runId && data.correlationId) {
|
|
125788
|
+
if (isStepEventType(data.eventType) && runId && data.correlationId) {
|
|
125708
125789
|
const lockKey = tag ? `${runId}-${data.correlationId}.${tag}` : `${runId}-${data.correlationId}`;
|
|
125709
125790
|
return withInProcessLock(stepLocks, lockKey, () => createImpl());
|
|
125710
125791
|
}
|
|
125711
|
-
|
|
125712
|
-
if (isHookLifecycleEvent2 && runId && data.correlationId) {
|
|
125792
|
+
if (isHookLifecycleEventType(data.eventType) && runId && data.correlationId) {
|
|
125713
125793
|
const lockKey = tag ? `${runId}-${data.correlationId}.hook.${tag}` : `${runId}-${data.correlationId}.hook`;
|
|
125714
125794
|
return withInProcessLock(hookLocks, lockKey, () => createImpl());
|
|
125715
125795
|
}
|
|
@@ -125799,13 +125879,9 @@ function createEventsStorage(basedir, tag) {
|
|
|
125799
125879
|
return handleLegacyEvent(basedir, effectiveRunId, data, currentRun, params);
|
|
125800
125880
|
}
|
|
125801
125881
|
}
|
|
125802
|
-
const
|
|
125882
|
+
const createsChildEntity = isChildEntityCreationEvent(data);
|
|
125883
|
+
const lazyStepStart = createsChildEntity && data.eventType === "step_started";
|
|
125803
125884
|
if (currentRun && isTerminalWorkflowRunStatus(currentRun.status)) {
|
|
125804
|
-
const runTerminalEvents = [
|
|
125805
|
-
"run_started",
|
|
125806
|
-
"run_completed",
|
|
125807
|
-
"run_failed"
|
|
125808
|
-
];
|
|
125809
125885
|
if (data.eventType === "run_cancelled" && currentRun.status === "cancelled") {
|
|
125810
125886
|
const event2 = {
|
|
125811
125887
|
...data,
|
|
@@ -125824,10 +125900,10 @@ function createEventsStorage(basedir, tag) {
|
|
|
125824
125900
|
if (data.eventType === "run_started") {
|
|
125825
125901
|
throw new RunExpiredError(`Workflow run "${effectiveRunId}" is already in terminal state "${currentRun.status}"`);
|
|
125826
125902
|
}
|
|
125827
|
-
if (
|
|
125903
|
+
if (isTerminalRunEventType(data.eventType)) {
|
|
125828
125904
|
throw new EntityConflictError(`Cannot transition run from terminal state "${currentRun.status}"`);
|
|
125829
125905
|
}
|
|
125830
|
-
if (
|
|
125906
|
+
if (createsChildEntity) {
|
|
125831
125907
|
throw new EntityConflictError(`Cannot create new entities on run in terminal state "${currentRun.status}"`);
|
|
125832
125908
|
}
|
|
125833
125909
|
if (data.eventType === "attr_set") {
|
|
@@ -125835,13 +125911,8 @@ function createEventsStorage(basedir, tag) {
|
|
|
125835
125911
|
}
|
|
125836
125912
|
}
|
|
125837
125913
|
let validatedStep = null;
|
|
125838
|
-
const
|
|
125839
|
-
|
|
125840
|
-
"step_completed",
|
|
125841
|
-
"step_failed",
|
|
125842
|
-
"step_retrying"
|
|
125843
|
-
];
|
|
125844
|
-
if (stepEvents.includes(data.eventType) && data.correlationId) {
|
|
125914
|
+
const stepEventRequiresExistingStep = isStepEventType(data.eventType) && data.eventType !== "step_created";
|
|
125915
|
+
if (stepEventRequiresExistingStep && data.correlationId) {
|
|
125845
125916
|
const stepCompositeKey = `${effectiveRunId}-${data.correlationId}`;
|
|
125846
125917
|
validatedStep = await readJSONWithFallback(basedir, "steps", stepCompositeKey, StepSchema, tag);
|
|
125847
125918
|
if (!validatedStep && !lazyStepStart) {
|
|
@@ -125861,8 +125932,7 @@ function createEventsStorage(basedir, tag) {
|
|
|
125861
125932
|
}
|
|
125862
125933
|
}
|
|
125863
125934
|
}
|
|
125864
|
-
|
|
125865
|
-
if (hookEventsRequiringExistence2.includes(data.eventType) && data.correlationId) {
|
|
125935
|
+
if (isHookEventRequiringExistence(data.eventType) && data.correlationId) {
|
|
125866
125936
|
if (data.eventType === "hook_received" && await isHookDisposalCommitted(basedir, data.correlationId, tag)) {
|
|
125867
125937
|
throw new HookNotFoundError(data.correlationId);
|
|
125868
125938
|
}
|
|
@@ -125881,9 +125951,9 @@ function createEventsStorage(basedir, tag) {
|
|
|
125881
125951
|
if (data.eventType === "run_started" && "eventData" in event) {
|
|
125882
125952
|
delete event.eventData;
|
|
125883
125953
|
}
|
|
125884
|
-
if (lazyStepStart && "
|
|
125885
|
-
const { input: _strippedInput, ...
|
|
125886
|
-
event
|
|
125954
|
+
if (lazyStepStart && event.eventType === "step_started" && event.eventData) {
|
|
125955
|
+
const { input: _strippedInput, ...eventData } = event.eventData;
|
|
125956
|
+
event = { ...event, eventData };
|
|
125887
125957
|
}
|
|
125888
125958
|
let run2;
|
|
125889
125959
|
let step;
|
|
@@ -126406,7 +126476,7 @@ function createEventsStorage(basedir, tag) {
|
|
|
126406
126476
|
cursor = allEvents.cursor;
|
|
126407
126477
|
hasMore = allEvents.hasMore;
|
|
126408
126478
|
}
|
|
126409
|
-
if ((data.eventType
|
|
126479
|
+
if (isTerminalStepEventType(data.eventType) && typeof (params == null ? void 0 : params.sinceCursor) === "string") {
|
|
126410
126480
|
const delta = await paginatedFileSystemQuery({
|
|
126411
126481
|
directory: path$3.join(basedir, "events"),
|
|
126412
126482
|
schema: EventSchema,
|
|
@@ -126967,7 +127037,7 @@ function createWorld$1(args) {
|
|
|
126967
127037
|
const basedir = mergedConfig.dataDir;
|
|
126968
127038
|
const hooksDir = path$3.join(basedir, "hooks");
|
|
126969
127039
|
const taggedHookFiles = await listTaggedFiles(hooksDir, tag);
|
|
126970
|
-
const { HookSchema: HookSchema2 } = await import("./index-
|
|
127040
|
+
const { HookSchema: HookSchema2 } = await import("./index-CtG82ntm.js");
|
|
126971
127041
|
await Promise.all(taggedHookFiles.map(async (hookFile) => {
|
|
126972
127042
|
const hook = await readJSON(path$3.join(hooksDir, hookFile), HookSchema2);
|
|
126973
127043
|
if (hook == null ? void 0 : hook.token) {
|
|
@@ -127150,8 +127220,8 @@ function requireGetVercelOidcToken() {
|
|
|
127150
127220
|
}
|
|
127151
127221
|
try {
|
|
127152
127222
|
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
|
|
127153
|
-
await import("./token-util-
|
|
127154
|
-
await import("./token-
|
|
127223
|
+
await import("./token-util-C0zuFOay.js").then((n) => n.t),
|
|
127224
|
+
await import("./token-bLcjz8Va.js").then((n) => n.t)
|
|
127155
127225
|
]);
|
|
127156
127226
|
if (!token || isExpired(getTokenPayload(token), options == null ? void 0 : options.expirationBufferMs)) {
|
|
127157
127227
|
await refreshToken(options);
|
|
@@ -127775,22 +127845,22 @@ function getDefaultStreamDispatcher() {
|
|
|
127775
127845
|
_streamDispatcher ?? (_streamDispatcher = makeRetryDispatcher(EVENTS_AGENT_OPTIONS, STREAM_RETRY_OPTIONS));
|
|
127776
127846
|
return _streamDispatcher;
|
|
127777
127847
|
}
|
|
127778
|
-
let otelApiPromise = null;
|
|
127779
|
-
async function getOtelApi() {
|
|
127780
|
-
if (!otelApiPromise) {
|
|
127781
|
-
otelApiPromise = import("./index-Dq5jTBN4.js").catch(() => null);
|
|
127848
|
+
let otelApiPromise$1 = null;
|
|
127849
|
+
async function getOtelApi$1() {
|
|
127850
|
+
if (!otelApiPromise$1) {
|
|
127851
|
+
otelApiPromise$1 = import("./index-Dq5jTBN4.js").catch(() => null);
|
|
127782
127852
|
}
|
|
127783
|
-
return otelApiPromise;
|
|
127853
|
+
return otelApiPromise$1;
|
|
127784
127854
|
}
|
|
127785
127855
|
let tracerPromise = null;
|
|
127786
127856
|
async function getTracer() {
|
|
127787
127857
|
if (!tracerPromise) {
|
|
127788
|
-
tracerPromise = getOtelApi().then((otel) => otel ? otel.trace.getTracer("workflow") : null);
|
|
127858
|
+
tracerPromise = getOtelApi$1().then((otel) => otel ? otel.trace.getTracer("workflow") : null);
|
|
127789
127859
|
}
|
|
127790
127860
|
return tracerPromise;
|
|
127791
127861
|
}
|
|
127792
127862
|
async function trace(spanName2, ...args) {
|
|
127793
|
-
const [tracer, otel] = await Promise.all([getTracer(), getOtelApi()]);
|
|
127863
|
+
const [tracer, otel] = await Promise.all([getTracer(), getOtelApi$1()]);
|
|
127794
127864
|
const { fn: fn2, opts } = typeof args[0] === "function" ? { fn: args[0], opts: {} } : { fn: args[1], opts: args[0] };
|
|
127795
127865
|
if (!fn2)
|
|
127796
127866
|
throw new Error("Function to trace must be provided");
|
|
@@ -127814,13 +127884,13 @@ async function trace(spanName2, ...args) {
|
|
|
127814
127884
|
});
|
|
127815
127885
|
}
|
|
127816
127886
|
async function getSpanKind(field) {
|
|
127817
|
-
const otel = await getOtelApi();
|
|
127887
|
+
const otel = await getOtelApi$1();
|
|
127818
127888
|
if (!otel)
|
|
127819
127889
|
return void 0;
|
|
127820
127890
|
return otel.SpanKind[field];
|
|
127821
127891
|
}
|
|
127822
127892
|
async function injectTraceContextIntoHeaders(headers2) {
|
|
127823
|
-
const otel = await getOtelApi();
|
|
127893
|
+
const otel = await getOtelApi$1();
|
|
127824
127894
|
if (!otel)
|
|
127825
127895
|
return;
|
|
127826
127896
|
const carrier = {};
|
|
@@ -127845,6 +127915,9 @@ const RpcService = SemanticConvention("rpc.service");
|
|
|
127845
127915
|
const RpcMethod = SemanticConvention("rpc.method");
|
|
127846
127916
|
const WorkflowRunId = SemanticConvention("workflow.run.id");
|
|
127847
127917
|
const StepId = SemanticConvention("step.id");
|
|
127918
|
+
const WorkflowStreamName = SemanticConvention("workflow.stream.name");
|
|
127919
|
+
const WorkflowStreamOperation = SemanticConvention("workflow.stream.operation");
|
|
127920
|
+
const WorkflowStreamStartIndex = SemanticConvention("workflow.stream.start_index");
|
|
127848
127921
|
const REQUEST_TIMEOUT_MS = 6e4;
|
|
127849
127922
|
const getRequestTimeoutMs = () => envNumber("WORKFLOW_REQUEST_TIMEOUT_MS", REQUEST_TIMEOUT_MS, {
|
|
127850
127923
|
integer: true,
|
|
@@ -127938,12 +128011,14 @@ function httpClientSpanAttributes(args) {
|
|
|
127938
128011
|
};
|
|
127939
128012
|
}
|
|
127940
128013
|
async function instrumentedFetch(opts) {
|
|
127941
|
-
const { method, url: url2, headers: headers2, body: body2, dispatcher: dispatcher2, peerService = "workflow-server", timeoutMs = getRequestTimeoutMs(), signal: callerSignal, injectTraceContext = true, cacheBust = true, logLabel, buildError } = opts;
|
|
128014
|
+
const { method, url: url2, headers: headers2, body: body2, dispatcher: dispatcher2, peerService = "workflow-server", timeoutMs = getRequestTimeoutMs(), signal: callerSignal, injectTraceContext: injectTraceContext2 = true, cacheBust = true, logLabel, buildError, spanName: spanName2, attributes, durationAttribute } = opts;
|
|
127942
128015
|
const label = logLabel ?? url2;
|
|
127943
|
-
return trace(`http ${method}`, { kind: await getSpanKind("CLIENT") }, async (span) => {
|
|
128016
|
+
return trace(spanName2 ?? `http ${method}`, { kind: await getSpanKind("CLIENT") }, async (span) => {
|
|
127944
128017
|
var _a3, _b2, _c2;
|
|
127945
128018
|
span == null ? void 0 : span.setAttributes(httpClientSpanAttributes({ method, url: url2, peerService }));
|
|
127946
|
-
if (
|
|
128019
|
+
if (attributes)
|
|
128020
|
+
span == null ? void 0 : span.setAttributes(attributes);
|
|
128021
|
+
if (injectTraceContext2)
|
|
127947
128022
|
await injectTraceContextIntoHeaders(headers2);
|
|
127948
128023
|
if (cacheBust)
|
|
127949
128024
|
headers2.set("X-Request-Time", Date.now().toString());
|
|
@@ -127973,6 +128048,8 @@ async function instrumentedFetch(opts) {
|
|
|
127973
128048
|
const ms2 = Date.now() - start2;
|
|
127974
128049
|
httpLog(method, label, response2, ms2);
|
|
127975
128050
|
span == null ? void 0 : span.setAttributes({ ...HttpResponseStatusCode(response2.status) });
|
|
128051
|
+
if (durationAttribute)
|
|
128052
|
+
span == null ? void 0 : span.setAttributes({ [durationAttribute]: ms2 });
|
|
127976
128053
|
if (!response2.ok) {
|
|
127977
128054
|
span == null ? void 0 : span.setAttributes({ ...ErrorType(`HTTP ${response2.status}`) });
|
|
127978
128055
|
logCurlRepro(method, url2, headers2);
|
|
@@ -127992,7 +128069,7 @@ async function instrumentedFetch(opts) {
|
|
|
127992
128069
|
return response2;
|
|
127993
128070
|
});
|
|
127994
128071
|
}
|
|
127995
|
-
const version = "5.0.0-beta.
|
|
128072
|
+
const version = "5.0.0-beta.26";
|
|
127996
128073
|
const IDEMPOTENT_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD"]);
|
|
127997
128074
|
const MAX_BODY_PARSE_RETRIES = 2;
|
|
127998
128075
|
const BODY_PARSE_RETRY_BASE_MS = 100;
|
|
@@ -131409,7 +131486,8 @@ var Topic = class {
|
|
|
131409
131486
|
idempotencyKey: options == null ? void 0 : options.idempotencyKey,
|
|
131410
131487
|
retentionSeconds: options == null ? void 0 : options.retentionSeconds,
|
|
131411
131488
|
delaySeconds: options == null ? void 0 : options.delaySeconds,
|
|
131412
|
-
headers: options == null ? void 0 : options.headers
|
|
131489
|
+
headers: options == null ? void 0 : options.headers,
|
|
131490
|
+
telemetry: options == null ? void 0 : options.telemetry
|
|
131413
131491
|
});
|
|
131414
131492
|
if (result.messageId && isDevMode()) {
|
|
131415
131493
|
invokeDevHandlers(
|
|
@@ -131630,7 +131708,7 @@ var OK = pc.green("✓");
|
|
|
131630
131708
|
var FAIL = pc.red("✗");
|
|
131631
131709
|
var RETRY = pc.yellow("↻");
|
|
131632
131710
|
function isDevMode() {
|
|
131633
|
-
return process.env.NODE_ENV === "development";
|
|
131711
|
+
return process.env.NODE_ENV === "development" && process.env.VERCEL_DEPLOYMENT_ID === void 0;
|
|
131634
131712
|
}
|
|
131635
131713
|
var ROUTE_MAPPINGS_KEY = Symbol.for("@vercel/queue.devRouteMappings");
|
|
131636
131714
|
function filePathToConsumerGroup(filePath) {
|
|
@@ -132310,6 +132388,189 @@ if (process.env.NODE_ENV === "test" || process.env.VITEST) {
|
|
|
132310
132388
|
globalThis.__matchesFunctionsPattern = matchesFunctionsPattern;
|
|
132311
132389
|
globalThis.__stripSrcPrefix = stripSrcPrefix;
|
|
132312
132390
|
}
|
|
132391
|
+
function resolveTelemetryConfig(client2, send2) {
|
|
132392
|
+
const metadata = { ...client2 == null ? void 0 : client2.metadata, ...send2 == null ? void 0 : send2.metadata };
|
|
132393
|
+
return {
|
|
132394
|
+
isEnabled: (send2 == null ? void 0 : send2.isEnabled) ?? (client2 == null ? void 0 : client2.isEnabled) ?? true,
|
|
132395
|
+
// The public `tracer` option is typed with a vendored structural `Tracer`
|
|
132396
|
+
// (so the peer stays out of the published .d.ts). A real tracer is passed
|
|
132397
|
+
// at runtime; treat it as the full `@opentelemetry/api` `Tracer` here.
|
|
132398
|
+
tracer: client2 == null ? void 0 : client2.tracer,
|
|
132399
|
+
metadata: Object.keys(metadata).length > 0 ? metadata : void 0
|
|
132400
|
+
};
|
|
132401
|
+
}
|
|
132402
|
+
var otelApiPromise;
|
|
132403
|
+
function getOtelApi() {
|
|
132404
|
+
if (!otelApiPromise) {
|
|
132405
|
+
otelApiPromise = import("./index-Dq5jTBN4.js").then(
|
|
132406
|
+
(mod) => mod,
|
|
132407
|
+
() => null
|
|
132408
|
+
);
|
|
132409
|
+
}
|
|
132410
|
+
return otelApiPromise;
|
|
132411
|
+
}
|
|
132412
|
+
function isTracePropagationDisabled() {
|
|
132413
|
+
var _a3;
|
|
132414
|
+
const value = (_a3 = process.env.VERCEL_QUEUE_TRACE_PROPAGATION) == null ? void 0 : _a3.toLowerCase();
|
|
132415
|
+
return value === "off" || value === "0" || value === "false";
|
|
132416
|
+
}
|
|
132417
|
+
var INJECTED_CONTEXT_HEADERS = [
|
|
132418
|
+
"traceparent",
|
|
132419
|
+
"tracestate",
|
|
132420
|
+
"baggage"
|
|
132421
|
+
];
|
|
132422
|
+
async function injectTraceContext(headers2, telemetry) {
|
|
132423
|
+
if (isTracePropagationDisabled()) return;
|
|
132424
|
+
if (telemetry && !telemetry.isEnabled) return;
|
|
132425
|
+
const otel = await getOtelApi();
|
|
132426
|
+
if (!otel) return;
|
|
132427
|
+
try {
|
|
132428
|
+
const carrier = {};
|
|
132429
|
+
otel.propagation.inject(otel.context.active(), carrier);
|
|
132430
|
+
for (const name2 of INJECTED_CONTEXT_HEADERS) {
|
|
132431
|
+
const value = carrier[name2];
|
|
132432
|
+
if (value !== void 0) {
|
|
132433
|
+
headers2.set(name2, value);
|
|
132434
|
+
}
|
|
132435
|
+
}
|
|
132436
|
+
} catch {
|
|
132437
|
+
}
|
|
132438
|
+
}
|
|
132439
|
+
function setSpanErrorSafely(otel, span, error2) {
|
|
132440
|
+
try {
|
|
132441
|
+
span.setStatus({
|
|
132442
|
+
code: otel.SpanStatusCode.ERROR,
|
|
132443
|
+
message: error2 instanceof Error ? error2.message : String(error2)
|
|
132444
|
+
});
|
|
132445
|
+
} catch {
|
|
132446
|
+
}
|
|
132447
|
+
}
|
|
132448
|
+
function endSpanSafely(span) {
|
|
132449
|
+
try {
|
|
132450
|
+
span.end();
|
|
132451
|
+
} catch {
|
|
132452
|
+
}
|
|
132453
|
+
}
|
|
132454
|
+
async function withSendSpan(queueName, fn2, telemetry) {
|
|
132455
|
+
if (isTracePropagationDisabled()) return fn2(null);
|
|
132456
|
+
if (telemetry && !telemetry.isEnabled) return fn2(null);
|
|
132457
|
+
const otel = await getOtelApi();
|
|
132458
|
+
if (!otel) return fn2(null);
|
|
132459
|
+
let started = null;
|
|
132460
|
+
try {
|
|
132461
|
+
const tracer = (telemetry == null ? void 0 : telemetry.tracer) ?? otel.trace.getTracer("@vercel/queue");
|
|
132462
|
+
const attributes = {
|
|
132463
|
+
"messaging.system": "vercel-queue",
|
|
132464
|
+
"messaging.destination.name": queueName
|
|
132465
|
+
};
|
|
132466
|
+
if (telemetry == null ? void 0 : telemetry.metadata) {
|
|
132467
|
+
for (const [key, value] of Object.entries(telemetry.metadata)) {
|
|
132468
|
+
attributes[`vqs.metadata.${key}`] = value;
|
|
132469
|
+
}
|
|
132470
|
+
}
|
|
132471
|
+
const span2 = tracer.startSpan("vqs.send", {
|
|
132472
|
+
kind: otel.SpanKind.PRODUCER,
|
|
132473
|
+
attributes
|
|
132474
|
+
});
|
|
132475
|
+
started = { span: span2, ctx: otel.trace.setSpan(otel.context.active(), span2) };
|
|
132476
|
+
} catch {
|
|
132477
|
+
}
|
|
132478
|
+
if (!started) return fn2(null);
|
|
132479
|
+
const { span, ctx } = started;
|
|
132480
|
+
try {
|
|
132481
|
+
return await otel.context.with(
|
|
132482
|
+
ctx,
|
|
132483
|
+
() => fn2({
|
|
132484
|
+
setMessageId(messageId) {
|
|
132485
|
+
try {
|
|
132486
|
+
span.setAttribute("messaging.message.id", messageId);
|
|
132487
|
+
} catch {
|
|
132488
|
+
}
|
|
132489
|
+
}
|
|
132490
|
+
})
|
|
132491
|
+
);
|
|
132492
|
+
} catch (error2) {
|
|
132493
|
+
setSpanErrorSafely(otel, span, error2);
|
|
132494
|
+
throw error2;
|
|
132495
|
+
} finally {
|
|
132496
|
+
endSpanSafely(span);
|
|
132497
|
+
}
|
|
132498
|
+
}
|
|
132499
|
+
var CONSUMER_TRACEPARENT_HEADER = "x-vercel-queue-traceparent";
|
|
132500
|
+
var CONSUMER_TRACESTATE_HEADER = "x-vercel-queue-tracestate";
|
|
132501
|
+
var CONSUMER_BAGGAGE_HEADER = "x-vercel-queue-baggage";
|
|
132502
|
+
async function withConsumerSpan(headers2, fn2, telemetry) {
|
|
132503
|
+
if (isTracePropagationDisabled()) return fn2();
|
|
132504
|
+
if (telemetry && !telemetry.isEnabled) return fn2();
|
|
132505
|
+
const otel = await getOtelApi();
|
|
132506
|
+
if (!otel) return fn2();
|
|
132507
|
+
let started = null;
|
|
132508
|
+
try {
|
|
132509
|
+
const carrier = headersToCarrier(headers2);
|
|
132510
|
+
const links = extractProducerLink(otel, carrier);
|
|
132511
|
+
const tracer = (telemetry == null ? void 0 : telemetry.tracer) ?? otel.trace.getTracer("@vercel/queue");
|
|
132512
|
+
const attributes = {
|
|
132513
|
+
"messaging.system": "vercel-queue",
|
|
132514
|
+
"messaging.operation": "process"
|
|
132515
|
+
};
|
|
132516
|
+
if (telemetry == null ? void 0 : telemetry.metadata) {
|
|
132517
|
+
for (const [key, value] of Object.entries(telemetry.metadata)) {
|
|
132518
|
+
attributes[`vqs.metadata.${key}`] = value;
|
|
132519
|
+
}
|
|
132520
|
+
}
|
|
132521
|
+
const span2 = tracer.startSpan("vqs.process", {
|
|
132522
|
+
kind: otel.SpanKind.CONSUMER,
|
|
132523
|
+
attributes,
|
|
132524
|
+
links
|
|
132525
|
+
});
|
|
132526
|
+
started = { span: span2, ctx: otel.trace.setSpan(otel.context.active(), span2) };
|
|
132527
|
+
} catch {
|
|
132528
|
+
}
|
|
132529
|
+
if (!started) return fn2();
|
|
132530
|
+
const { span, ctx } = started;
|
|
132531
|
+
try {
|
|
132532
|
+
return await otel.context.with(ctx, fn2);
|
|
132533
|
+
} catch (error2) {
|
|
132534
|
+
setSpanErrorSafely(otel, span, error2);
|
|
132535
|
+
throw error2;
|
|
132536
|
+
} finally {
|
|
132537
|
+
endSpanSafely(span);
|
|
132538
|
+
}
|
|
132539
|
+
}
|
|
132540
|
+
function extractProducerLink(otel, carrier) {
|
|
132541
|
+
const traceparent = carrier[CONSUMER_TRACEPARENT_HEADER];
|
|
132542
|
+
if (!traceparent) return [];
|
|
132543
|
+
const standardCarrier = { traceparent };
|
|
132544
|
+
const tracestate = carrier[CONSUMER_TRACESTATE_HEADER];
|
|
132545
|
+
if (tracestate) standardCarrier.tracestate = tracestate;
|
|
132546
|
+
const baggage = carrier[CONSUMER_BAGGAGE_HEADER];
|
|
132547
|
+
if (baggage) standardCarrier.baggage = baggage;
|
|
132548
|
+
const producerCtx = otel.propagation.extract(
|
|
132549
|
+
otel.ROOT_CONTEXT,
|
|
132550
|
+
standardCarrier
|
|
132551
|
+
);
|
|
132552
|
+
const producerSpanContext = otel.trace.getSpanContext(producerCtx);
|
|
132553
|
+
if (!producerSpanContext || !otel.trace.isSpanContextValid(producerSpanContext)) {
|
|
132554
|
+
return [];
|
|
132555
|
+
}
|
|
132556
|
+
return [{ context: producerSpanContext }];
|
|
132557
|
+
}
|
|
132558
|
+
function headersToCarrier(headers2) {
|
|
132559
|
+
const carrier = {};
|
|
132560
|
+
if (headers2 instanceof Headers) {
|
|
132561
|
+
headers2.forEach((value, key) => {
|
|
132562
|
+
carrier[key.toLowerCase()] = value;
|
|
132563
|
+
});
|
|
132564
|
+
return carrier;
|
|
132565
|
+
}
|
|
132566
|
+
for (const [key, value] of Object.entries(headers2)) {
|
|
132567
|
+
const single = Array.isArray(value) ? value[0] : value;
|
|
132568
|
+
if (single !== void 0) {
|
|
132569
|
+
carrier[key.toLowerCase()] = single;
|
|
132570
|
+
}
|
|
132571
|
+
}
|
|
132572
|
+
return carrier;
|
|
132573
|
+
}
|
|
132313
132574
|
function isDebugEnabled() {
|
|
132314
132575
|
return process.env.VERCEL_QUEUE_DEBUG === "1" || process.env.VERCEL_QUEUE_DEBUG === "true";
|
|
132315
132576
|
}
|
|
@@ -132407,6 +132668,7 @@ var ApiClient = class _ApiClient {
|
|
|
132407
132668
|
__publicField(this, "region");
|
|
132408
132669
|
__publicField(this, "baseUrlResolver");
|
|
132409
132670
|
__publicField(this, "dispatcher");
|
|
132671
|
+
__publicField(this, "telemetry");
|
|
132410
132672
|
validateRegion(options.region);
|
|
132411
132673
|
this.region = options.region;
|
|
132412
132674
|
this.baseUrlResolver = options.resolveBaseUrl;
|
|
@@ -132415,6 +132677,7 @@ var ApiClient = class _ApiClient {
|
|
|
132415
132677
|
this.providedToken = options.token;
|
|
132416
132678
|
this.transport = options.transport || new JsonTransport$1();
|
|
132417
132679
|
this.dispatcher = options.dispatcher;
|
|
132680
|
+
this.telemetry = options.telemetry;
|
|
132418
132681
|
if (options.deploymentId === null) {
|
|
132419
132682
|
this.pinSends = false;
|
|
132420
132683
|
this.explicitlyUnpinned = true;
|
|
@@ -132438,7 +132701,8 @@ var ApiClient = class _ApiClient {
|
|
|
132438
132701
|
headers: { ...this.customHeaders },
|
|
132439
132702
|
deploymentId: this.explicitlyUnpinned ? null : this.resolvedDeploymentId,
|
|
132440
132703
|
transport: this.transport,
|
|
132441
|
-
dispatcher: this.dispatcher
|
|
132704
|
+
dispatcher: this.dispatcher,
|
|
132705
|
+
telemetry: this.telemetry
|
|
132442
132706
|
});
|
|
132443
132707
|
}
|
|
132444
132708
|
getRegion() {
|
|
@@ -132447,6 +132711,9 @@ var ApiClient = class _ApiClient {
|
|
|
132447
132711
|
getTransport() {
|
|
132448
132712
|
return this.transport;
|
|
132449
132713
|
}
|
|
132714
|
+
getTelemetry() {
|
|
132715
|
+
return this.telemetry;
|
|
132716
|
+
}
|
|
132450
132717
|
requireDeploymentId() {
|
|
132451
132718
|
if (isDevMode() || this.explicitlyUnpinned || this.resolvedDeploymentId) {
|
|
132452
132719
|
return;
|
|
@@ -132522,7 +132789,7 @@ Cause: ${cause}`
|
|
|
132522
132789
|
}
|
|
132523
132790
|
console.debug("[VQS Debug] Request:", JSON.stringify(logData, null, 2));
|
|
132524
132791
|
}
|
|
132525
|
-
init2.headers.set("User-Agent", `@vercel/queue/${"0.
|
|
132792
|
+
init2.headers.set("User-Agent", `@vercel/queue/${"0.4.0"}`);
|
|
132526
132793
|
init2.headers.set("Vqs-Client-Ts", (/* @__PURE__ */ new Date()).toISOString());
|
|
132527
132794
|
const fetchInit = this.dispatcher ? { ...init2, dispatcher: this.dispatcher } : init2;
|
|
132528
132795
|
const response2 = await fetch(url2, fetchInit);
|
|
@@ -132546,7 +132813,8 @@ Cause: ${cause}`
|
|
|
132546
132813
|
idempotencyKey,
|
|
132547
132814
|
retentionSeconds,
|
|
132548
132815
|
delaySeconds,
|
|
132549
|
-
headers: optionHeaders
|
|
132816
|
+
headers: optionHeaders,
|
|
132817
|
+
telemetry: sendTelemetry
|
|
132550
132818
|
} = options;
|
|
132551
132819
|
const headers2 = new Headers();
|
|
132552
132820
|
if (this.customHeaders) {
|
|
@@ -132584,43 +132852,54 @@ Cause: ${cause}`
|
|
|
132584
132852
|
}
|
|
132585
132853
|
const serialized = transport.serialize(payload);
|
|
132586
132854
|
const body2 = Buffer.isBuffer(serialized) ? new Uint8Array(serialized) : serialized;
|
|
132587
|
-
const
|
|
132588
|
-
|
|
132589
|
-
|
|
132590
|
-
|
|
132591
|
-
|
|
132592
|
-
|
|
132593
|
-
|
|
132594
|
-
|
|
132595
|
-
|
|
132596
|
-
|
|
132597
|
-
|
|
132598
|
-
|
|
132599
|
-
|
|
132600
|
-
|
|
132601
|
-
|
|
132602
|
-
|
|
132603
|
-
|
|
132604
|
-
|
|
132605
|
-
|
|
132606
|
-
|
|
132607
|
-
|
|
132608
|
-
|
|
132609
|
-
|
|
132610
|
-
|
|
132611
|
-
|
|
132612
|
-
|
|
132613
|
-
|
|
132614
|
-
|
|
132615
|
-
|
|
132616
|
-
|
|
132617
|
-
|
|
132618
|
-
|
|
132619
|
-
|
|
132620
|
-
|
|
132621
|
-
|
|
132622
|
-
|
|
132623
|
-
|
|
132855
|
+
const telemetry = resolveTelemetryConfig(this.telemetry, sendTelemetry);
|
|
132856
|
+
return withSendSpan(
|
|
132857
|
+
queueName,
|
|
132858
|
+
async (span) => {
|
|
132859
|
+
await injectTraceContext(headers2, telemetry);
|
|
132860
|
+
const response2 = await this.fetch(this.buildUrl(queueName), {
|
|
132861
|
+
method: "POST",
|
|
132862
|
+
body: body2,
|
|
132863
|
+
headers: headers2
|
|
132864
|
+
});
|
|
132865
|
+
if (!response2.ok) {
|
|
132866
|
+
const errorText = await response2.text();
|
|
132867
|
+
if (response2.status === 409) {
|
|
132868
|
+
throw new DuplicateMessageError(
|
|
132869
|
+
errorText || "Duplicate idempotency key detected",
|
|
132870
|
+
idempotencyKey
|
|
132871
|
+
);
|
|
132872
|
+
}
|
|
132873
|
+
if (response2.status === 502) {
|
|
132874
|
+
throw new ConsumerDiscoveryError(
|
|
132875
|
+
errorText || "Consumer discovery failed",
|
|
132876
|
+
deploymentId
|
|
132877
|
+
);
|
|
132878
|
+
}
|
|
132879
|
+
if (response2.status === 503) {
|
|
132880
|
+
throw new ConsumerRegistryNotConfiguredError(
|
|
132881
|
+
errorText || "Consumer registry not configured"
|
|
132882
|
+
);
|
|
132883
|
+
}
|
|
132884
|
+
throwCommonHttpError(
|
|
132885
|
+
response2.status,
|
|
132886
|
+
response2.statusText,
|
|
132887
|
+
errorText,
|
|
132888
|
+
"send message"
|
|
132889
|
+
);
|
|
132890
|
+
}
|
|
132891
|
+
if (response2.status === 202) {
|
|
132892
|
+
await response2.text();
|
|
132893
|
+
return { messageId: null };
|
|
132894
|
+
}
|
|
132895
|
+
const responseData = await response2.json();
|
|
132896
|
+
if (span && responseData.messageId) {
|
|
132897
|
+
span.setMessageId(responseData.messageId);
|
|
132898
|
+
}
|
|
132899
|
+
return responseData;
|
|
132900
|
+
},
|
|
132901
|
+
telemetry
|
|
132902
|
+
);
|
|
132624
132903
|
}
|
|
132625
132904
|
async *receiveMessages(options) {
|
|
132626
132905
|
const transport = this.transport;
|
|
@@ -132936,7 +133215,8 @@ var QueueClient = class {
|
|
|
132936
133215
|
idempotencyKey: options == null ? void 0 : options.idempotencyKey,
|
|
132937
133216
|
retentionSeconds: options == null ? void 0 : options.retentionSeconds,
|
|
132938
133217
|
delaySeconds: options == null ? void 0 : options.delaySeconds,
|
|
132939
|
-
headers: options == null ? void 0 : options.headers
|
|
133218
|
+
headers: options == null ? void 0 : options.headers,
|
|
133219
|
+
telemetry: options == null ? void 0 : options.telemetry
|
|
132940
133220
|
});
|
|
132941
133221
|
if (result.messageId && isDevMode()) {
|
|
132942
133222
|
invokeDevHandlers(
|
|
@@ -132969,9 +133249,11 @@ var QueueClient = class {
|
|
|
132969
133249
|
* @returns A route handler that accepts either `Request` or `{ request: Request }`
|
|
132970
133250
|
*/
|
|
132971
133251
|
__publicField(this, "handleCallback", (handler, options) => {
|
|
133252
|
+
var _a3, _b2;
|
|
132972
133253
|
if (isDevMode()) {
|
|
132973
133254
|
registerDevHandler(handler, this, options);
|
|
132974
133255
|
}
|
|
133256
|
+
const telemetry = resolveTelemetryConfig((_b2 = (_a3 = getApi(this)).getTelemetry) == null ? void 0 : _b2.call(_a3));
|
|
132975
133257
|
return async (requestOrEvent) => {
|
|
132976
133258
|
const request2 = resolveCallbackRequest(requestOrEvent);
|
|
132977
133259
|
if (isDevMode() && request2.headers.get("x-vercel-queue-prime") === "1") {
|
|
@@ -132988,11 +133270,15 @@ var QueueClient = class {
|
|
|
132988
133270
|
}
|
|
132989
133271
|
try {
|
|
132990
133272
|
const parsed = await parseCallback(request2);
|
|
132991
|
-
await
|
|
132992
|
-
|
|
132993
|
-
|
|
132994
|
-
|
|
132995
|
-
|
|
133273
|
+
await withConsumerSpan(
|
|
133274
|
+
request2.headers,
|
|
133275
|
+
() => handleCallback(handler, parsed, {
|
|
133276
|
+
client: this,
|
|
133277
|
+
visibilityTimeoutSeconds: options == null ? void 0 : options.visibilityTimeoutSeconds,
|
|
133278
|
+
retry: options == null ? void 0 : options.retry
|
|
133279
|
+
}),
|
|
133280
|
+
telemetry
|
|
133281
|
+
);
|
|
132996
133282
|
return Response.json({ status: "success" });
|
|
132997
133283
|
} catch (error2) {
|
|
132998
133284
|
console.error("Queue callback error:", error2);
|
|
@@ -133027,9 +133313,11 @@ var QueueClient = class {
|
|
|
133027
133313
|
* @returns A `(req, res) => Promise<void>` route handler
|
|
133028
133314
|
*/
|
|
133029
133315
|
__publicField(this, "handleNodeCallback", (handler, options) => {
|
|
133316
|
+
var _a3, _b2;
|
|
133030
133317
|
if (isDevMode()) {
|
|
133031
133318
|
registerDevHandler(handler, this, options);
|
|
133032
133319
|
}
|
|
133320
|
+
const telemetry = resolveTelemetryConfig((_b2 = (_a3 = getApi(this)).getTelemetry) == null ? void 0 : _b2.call(_a3));
|
|
133033
133321
|
return async (req, res) => {
|
|
133034
133322
|
if (req.method !== "POST") {
|
|
133035
133323
|
res.status(200).end();
|
|
@@ -133052,11 +133340,15 @@ var QueueClient = class {
|
|
|
133052
133340
|
}
|
|
133053
133341
|
try {
|
|
133054
133342
|
const parsed = parseRawCallback(req.body, req.headers);
|
|
133055
|
-
await
|
|
133056
|
-
|
|
133057
|
-
|
|
133058
|
-
|
|
133059
|
-
|
|
133343
|
+
await withConsumerSpan(
|
|
133344
|
+
req.headers,
|
|
133345
|
+
() => handleCallback(handler, parsed, {
|
|
133346
|
+
client: this,
|
|
133347
|
+
visibilityTimeoutSeconds: options == null ? void 0 : options.visibilityTimeoutSeconds,
|
|
133348
|
+
retry: options == null ? void 0 : options.retry
|
|
133349
|
+
}),
|
|
133350
|
+
telemetry
|
|
133351
|
+
);
|
|
133060
133352
|
res.status(200).json({ status: "success" });
|
|
133061
133353
|
} catch (error2) {
|
|
133062
133354
|
console.error("Queue callback error:", error2);
|
|
@@ -133531,40 +133823,54 @@ async function* decodeFrames(source) {
|
|
|
133531
133823
|
buffer2 = buffer2.subarray(n);
|
|
133532
133824
|
return out;
|
|
133533
133825
|
};
|
|
133534
|
-
|
|
133535
|
-
|
|
133536
|
-
|
|
133537
|
-
|
|
133538
|
-
|
|
133539
|
-
|
|
133540
|
-
|
|
133541
|
-
|
|
133542
|
-
|
|
133543
|
-
|
|
133544
|
-
|
|
133545
|
-
|
|
133546
|
-
|
|
133547
|
-
|
|
133548
|
-
|
|
133549
|
-
if (!await refill(bodyLen)) {
|
|
133826
|
+
try {
|
|
133827
|
+
while (true) {
|
|
133828
|
+
if (!await refill(4))
|
|
133829
|
+
return;
|
|
133830
|
+
const metaLen = new DataView(buffer2.buffer, buffer2.byteOffset, 4).getUint32(0, false);
|
|
133831
|
+
take(4);
|
|
133832
|
+
if (!await refill(metaLen)) {
|
|
133833
|
+
throw new Error("decodeFrames: truncated meta block");
|
|
133834
|
+
}
|
|
133835
|
+
const meta2 = decode(take(metaLen));
|
|
133836
|
+
if (!await refill(4)) {
|
|
133837
|
+
throw new Error("decodeFrames: truncated body length");
|
|
133838
|
+
}
|
|
133839
|
+
const bodyLen = new DataView(buffer2.buffer, buffer2.byteOffset, 4).getUint32(0, false);
|
|
133840
|
+
take(4);
|
|
133841
|
+
if (bodyLen > 0 && !await refill(bodyLen)) {
|
|
133550
133842
|
throw new Error("decodeFrames: truncated body bytes");
|
|
133551
133843
|
}
|
|
133552
133844
|
yield { meta: meta2, body: buffer2.slice(0, bodyLen) };
|
|
133553
133845
|
take(bodyLen);
|
|
133554
|
-
|
|
133555
|
-
|
|
133846
|
+
if (meta2._end === 1)
|
|
133847
|
+
return;
|
|
133556
133848
|
}
|
|
133557
|
-
|
|
133558
|
-
|
|
133849
|
+
} finally {
|
|
133850
|
+
closeQuietly(() => {
|
|
133851
|
+
var _a3;
|
|
133852
|
+
return (_a3 = chunks.return) == null ? void 0 : _a3.call(chunks);
|
|
133853
|
+
});
|
|
133854
|
+
}
|
|
133855
|
+
}
|
|
133856
|
+
function closeQuietly(close) {
|
|
133857
|
+
try {
|
|
133858
|
+
void Promise.resolve(close()).catch(() => {
|
|
133859
|
+
});
|
|
133860
|
+
} catch {
|
|
133559
133861
|
}
|
|
133560
133862
|
}
|
|
133561
133863
|
async function* readerToIterator(reader) {
|
|
133562
|
-
|
|
133563
|
-
|
|
133564
|
-
|
|
133565
|
-
|
|
133566
|
-
|
|
133567
|
-
|
|
133864
|
+
try {
|
|
133865
|
+
while (true) {
|
|
133866
|
+
const { done, value } = await reader.read();
|
|
133867
|
+
if (done)
|
|
133868
|
+
return;
|
|
133869
|
+
if (value)
|
|
133870
|
+
yield value;
|
|
133871
|
+
}
|
|
133872
|
+
} finally {
|
|
133873
|
+
closeQuietly(() => reader.cancel());
|
|
133568
133874
|
}
|
|
133569
133875
|
}
|
|
133570
133876
|
async function fetchV4(url2, init2, config2, opName) {
|
|
@@ -133627,6 +133933,9 @@ function buildPostFrameMeta(input) {
|
|
|
133627
133933
|
meta2.errorCode = input.errorCode;
|
|
133628
133934
|
if (input.cancelReason !== void 0)
|
|
133629
133935
|
meta2.cancelReason = input.cancelReason;
|
|
133936
|
+
if (input.ownerMessageId !== void 0) {
|
|
133937
|
+
meta2.ownerMessageId = input.ownerMessageId;
|
|
133938
|
+
}
|
|
133630
133939
|
if (input.executionContext !== void 0) {
|
|
133631
133940
|
meta2.executionContext = input.executionContext;
|
|
133632
133941
|
}
|
|
@@ -133643,6 +133952,10 @@ function buildPostFrameMeta(input) {
|
|
|
133643
133952
|
meta2.ttfs = input.ttfs;
|
|
133644
133953
|
if (input.stso !== void 0)
|
|
133645
133954
|
meta2.stso = input.stso;
|
|
133955
|
+
if (input.stepCount !== void 0)
|
|
133956
|
+
meta2.stepCount = input.stepCount;
|
|
133957
|
+
if (input.eventCount !== void 0)
|
|
133958
|
+
meta2.eventCount = input.eventCount;
|
|
133646
133959
|
if (input.optimizations !== void 0) {
|
|
133647
133960
|
meta2.optimizations = input.optimizations;
|
|
133648
133961
|
}
|
|
@@ -133780,10 +134093,6 @@ const FORMAT_PREFIX_LENGTH = 4;
|
|
|
133780
134093
|
const GZIP_FORMAT_PREFIX = "gzip";
|
|
133781
134094
|
const ZSTD_FORMAT_PREFIX = "zstd";
|
|
133782
134095
|
const formatDecoder = new TextDecoder();
|
|
133783
|
-
const V4_EXTRA_EVENT_DATA_REF_FIELDS = {
|
|
133784
|
-
run_started: ["input"],
|
|
133785
|
-
step_started: ["input"]
|
|
133786
|
-
};
|
|
133787
134096
|
function getNodeZlib() {
|
|
133788
134097
|
var _a3, _b2;
|
|
133789
134098
|
try {
|
|
@@ -133842,12 +134151,7 @@ function normalizeEventData(event) {
|
|
|
133842
134151
|
return event;
|
|
133843
134152
|
}
|
|
133844
134153
|
const eventType = typeof event.eventType === "string" ? event.eventType : "";
|
|
133845
|
-
const refFields =
|
|
133846
|
-
.../* @__PURE__ */ new Set([
|
|
133847
|
-
...EVENT_DATA_REF_FIELDS[eventType] ?? [],
|
|
133848
|
-
...V4_EXTRA_EVENT_DATA_REF_FIELDS[eventType] ?? []
|
|
133849
|
-
])
|
|
133850
|
-
];
|
|
134154
|
+
const refFields = getEventDataRefFields(eventType);
|
|
133851
134155
|
if (refFields.length === 0) {
|
|
133852
134156
|
return event;
|
|
133853
134157
|
}
|
|
@@ -134078,32 +134382,6 @@ async function getStep(runId, stepId, params, config2) {
|
|
|
134078
134382
|
});
|
|
134079
134383
|
return filterStepData(step, resolveData);
|
|
134080
134384
|
}
|
|
134081
|
-
const PAYLOAD_FIELD_BY_EVENT_TYPE = {
|
|
134082
|
-
run_created: "input",
|
|
134083
|
-
// run_started normally has no payload, but on the resilient-start path
|
|
134084
|
-
// the runtime piggybacks `runInput.input` here so the server can
|
|
134085
|
-
// synthesize the missing run_created. Without this entry the v4 split
|
|
134086
|
-
// would silently drop those bytes and the backend's "run_started arrived
|
|
134087
|
-
// before run_created" fallback would have nothing to backfill from.
|
|
134088
|
-
run_started: "input",
|
|
134089
|
-
run_completed: "output",
|
|
134090
|
-
run_failed: "error",
|
|
134091
|
-
step_created: "input",
|
|
134092
|
-
// step_started normally has no payload, but on the lazy-start path the
|
|
134093
|
-
// runtime piggybacks the step input here so the server can synthesize the
|
|
134094
|
-
// missing step_created (mirrors run_started above). Without this entry the
|
|
134095
|
-
// v4 split would silently drop those bytes and the backend's "step_started
|
|
134096
|
-
// arrived before step_created" fallback would have nothing to create from.
|
|
134097
|
-
step_started: "input",
|
|
134098
|
-
step_completed: "result",
|
|
134099
|
-
step_failed: "error",
|
|
134100
|
-
step_retrying: "error",
|
|
134101
|
-
hook_created: "metadata",
|
|
134102
|
-
hook_received: "payload"
|
|
134103
|
-
};
|
|
134104
|
-
function payloadFieldFor(eventType) {
|
|
134105
|
-
return PAYLOAD_FIELD_BY_EVENT_TYPE[eventType];
|
|
134106
|
-
}
|
|
134107
134385
|
const eventsNeedingResolve = /* @__PURE__ */ new Set([
|
|
134108
134386
|
"run_created",
|
|
134109
134387
|
// runtime reads result.run.runId
|
|
@@ -134112,14 +134390,10 @@ const eventsNeedingResolve = /* @__PURE__ */ new Set([
|
|
|
134112
134390
|
"step_started"
|
|
134113
134391
|
// runtime reads result.step (checks attempt, state)
|
|
134114
134392
|
]);
|
|
134115
|
-
const hookEventsRequiringExistence = /* @__PURE__ */ new Set([
|
|
134116
|
-
"hook_disposed",
|
|
134117
|
-
"hook_received"
|
|
134118
|
-
]);
|
|
134119
134393
|
function splitEventDataForV4(data) {
|
|
134120
134394
|
var _a3;
|
|
134121
134395
|
const eventData = data.eventData ?? {};
|
|
134122
|
-
const payloadField =
|
|
134396
|
+
const payloadField = getEventDataPayloadField(data.eventType);
|
|
134123
134397
|
const meta2 = {};
|
|
134124
134398
|
if (typeof eventData.deploymentId === "string") {
|
|
134125
134399
|
meta2.deploymentId = eventData.deploymentId;
|
|
@@ -134162,6 +134436,9 @@ function splitEventDataForV4(data) {
|
|
|
134162
134436
|
if (typeof eventData.cancelReason === "string") {
|
|
134163
134437
|
meta2.cancelReason = eventData.cancelReason;
|
|
134164
134438
|
}
|
|
134439
|
+
if (typeof eventData.ownerMessageId === "string") {
|
|
134440
|
+
meta2.ownerMessageId = eventData.ownerMessageId;
|
|
134441
|
+
}
|
|
134165
134442
|
if (eventData.executionContext !== void 0 && eventData.executionContext !== null && typeof eventData.executionContext === "object") {
|
|
134166
134443
|
meta2.executionContext = eventData.executionContext;
|
|
134167
134444
|
}
|
|
@@ -134183,6 +134460,12 @@ function splitEventDataForV4(data) {
|
|
|
134183
134460
|
if (typeof eventData.stso === "number") {
|
|
134184
134461
|
meta2.stso = eventData.stso;
|
|
134185
134462
|
}
|
|
134463
|
+
if (typeof eventData.stepCount === "number" && Number.isSafeInteger(eventData.stepCount) && eventData.stepCount > 0) {
|
|
134464
|
+
meta2.stepCount = eventData.stepCount;
|
|
134465
|
+
}
|
|
134466
|
+
if (typeof eventData.eventCount === "number" && Number.isSafeInteger(eventData.eventCount) && eventData.eventCount > 0) {
|
|
134467
|
+
meta2.eventCount = eventData.eventCount;
|
|
134468
|
+
}
|
|
134186
134469
|
if (Array.isArray(eventData.optimizations) && eventData.optimizations.every((o) => typeof o === "string")) {
|
|
134187
134470
|
meta2.optimizations = eventData.optimizations;
|
|
134188
134471
|
}
|
|
@@ -134213,7 +134496,7 @@ function coerceNormalizedEvent(raw2) {
|
|
|
134213
134496
|
function buildEventFromV4(decoded, payloadBody, resolveData) {
|
|
134214
134497
|
const eventData = decoded.eventData ?? {};
|
|
134215
134498
|
if (payloadBody.byteLength > 0) {
|
|
134216
|
-
const payloadField =
|
|
134499
|
+
const payloadField = getEventDataPayloadField(decoded.eventType);
|
|
134217
134500
|
const normalizedPayload = normalizeSerializedData(payloadBody);
|
|
134218
134501
|
if (payloadField && normalizedPayload instanceof Uint8Array) {
|
|
134219
134502
|
eventData[payloadField] = normalizedPayload;
|
|
@@ -134263,7 +134546,7 @@ async function createWorkflowRunEvent(id2, data, params, config2) {
|
|
|
134263
134546
|
try {
|
|
134264
134547
|
return await withEventPostRetry(() => createWorkflowRunEventInner(id2, data, params, config2), data.eventType);
|
|
134265
134548
|
} catch (err) {
|
|
134266
|
-
if (
|
|
134549
|
+
if (isHookEventRequiringExistence(data.eventType) && WorkflowWorldError.is(err) && err.status === 404 && data.correlationId) {
|
|
134267
134550
|
throw new HookNotFoundError(data.correlationId);
|
|
134268
134551
|
}
|
|
134269
134552
|
throw err;
|
|
@@ -134450,6 +134733,14 @@ function getStreamUrl(name2, runId, httpConfig) {
|
|
|
134450
134733
|
function getStreamReadUrl(name2, runId, httpConfig) {
|
|
134451
134734
|
return new URL(`${httpConfig.baseUrl}/v3/runs/${encodeURIComponent(runId)}/stream/${encodeURIComponent(name2)}`);
|
|
134452
134735
|
}
|
|
134736
|
+
function streamSpanAttributes(args) {
|
|
134737
|
+
return {
|
|
134738
|
+
...WorkflowRunId(args.runId),
|
|
134739
|
+
...WorkflowStreamName(args.name),
|
|
134740
|
+
...WorkflowStreamOperation(args.operation),
|
|
134741
|
+
...typeof args.startIndex === "number" ? WorkflowStreamStartIndex(args.startIndex) : {}
|
|
134742
|
+
};
|
|
134743
|
+
}
|
|
134453
134744
|
function createStreamRequestError(operation, url2, response2, text2) {
|
|
134454
134745
|
const context = [
|
|
134455
134746
|
`PUT ${url2.origin}${url2.pathname}`,
|
|
@@ -134505,6 +134796,13 @@ function createStreamer(config2) {
|
|
|
134505
134796
|
dispatcher: getStreamDispatcher(config2),
|
|
134506
134797
|
timeoutMs: null,
|
|
134507
134798
|
logLabel: url2.pathname,
|
|
134799
|
+
spanName: "workflow.stream.write",
|
|
134800
|
+
durationAttribute: "workflow.stream.write.chunk_rtt",
|
|
134801
|
+
attributes: streamSpanAttributes({
|
|
134802
|
+
runId: resolvedRunId,
|
|
134803
|
+
name: name2,
|
|
134804
|
+
operation: "write"
|
|
134805
|
+
}),
|
|
134508
134806
|
buildError: async (res) => createStreamRequestError("write", url2, res, await res.text())
|
|
134509
134807
|
});
|
|
134510
134808
|
await response2.text();
|
|
@@ -134528,6 +134826,13 @@ function createStreamer(config2) {
|
|
|
134528
134826
|
dispatcher: getStreamDispatcher(config2),
|
|
134529
134827
|
timeoutMs: null,
|
|
134530
134828
|
logLabel: url2.pathname,
|
|
134829
|
+
spanName: "workflow.stream.write",
|
|
134830
|
+
durationAttribute: "workflow.stream.write.chunk_rtt",
|
|
134831
|
+
attributes: streamSpanAttributes({
|
|
134832
|
+
runId: resolvedRunId,
|
|
134833
|
+
name: name2,
|
|
134834
|
+
operation: "write_multi"
|
|
134835
|
+
}),
|
|
134531
134836
|
buildError: async (res) => createStreamRequestError("write", url2, res, await res.text())
|
|
134532
134837
|
});
|
|
134533
134838
|
await response2.text();
|
|
@@ -134545,6 +134850,13 @@ function createStreamer(config2) {
|
|
|
134545
134850
|
dispatcher: getStreamDispatcher(config2),
|
|
134546
134851
|
timeoutMs: null,
|
|
134547
134852
|
logLabel: url2.pathname,
|
|
134853
|
+
spanName: "workflow.stream.write",
|
|
134854
|
+
durationAttribute: "workflow.stream.write.chunk_rtt",
|
|
134855
|
+
attributes: streamSpanAttributes({
|
|
134856
|
+
runId: resolvedRunId,
|
|
134857
|
+
name: name2,
|
|
134858
|
+
operation: "close"
|
|
134859
|
+
}),
|
|
134548
134860
|
buildError: async (res) => createStreamRequestError("close", url2, res, await res.text())
|
|
134549
134861
|
});
|
|
134550
134862
|
await response2.text();
|
|
@@ -134562,6 +134874,13 @@ function createStreamer(config2) {
|
|
|
134562
134874
|
dispatcher: void 0,
|
|
134563
134875
|
timeoutMs: null,
|
|
134564
134876
|
logLabel: url2.pathname,
|
|
134877
|
+
spanName: "workflow.stream.read.connect",
|
|
134878
|
+
attributes: streamSpanAttributes({
|
|
134879
|
+
runId,
|
|
134880
|
+
name: name2,
|
|
134881
|
+
operation: "read",
|
|
134882
|
+
startIndex
|
|
134883
|
+
}),
|
|
134565
134884
|
buildError: (res) => new Error(`Failed to fetch stream: ${res.status}`)
|
|
134566
134885
|
});
|
|
134567
134886
|
if (!response2.body) {
|
|
@@ -157140,25 +157459,6 @@ function RunDetailView({
|
|
|
157140
157459
|
},
|
|
157141
157460
|
[env2]
|
|
157142
157461
|
);
|
|
157143
|
-
const handleLoadSidebarEventData = reactExports.useCallback(
|
|
157144
|
-
async (_correlationId, eventId) => {
|
|
157145
|
-
const { error: error22, result } = await unwrapServerActionResult(
|
|
157146
|
-
fetchEvent$1(env2, runId, eventId, "all")
|
|
157147
|
-
);
|
|
157148
|
-
if (error22) {
|
|
157149
|
-
throw error22;
|
|
157150
|
-
}
|
|
157151
|
-
const fullEvent = await hydrateResourceIOAsync(
|
|
157152
|
-
result,
|
|
157153
|
-
encryptionKeyRef.current ?? void 0
|
|
157154
|
-
);
|
|
157155
|
-
if ("eventData" in fullEvent) {
|
|
157156
|
-
return fullEvent.eventData;
|
|
157157
|
-
}
|
|
157158
|
-
return null;
|
|
157159
|
-
},
|
|
157160
|
-
[env2, runId]
|
|
157161
|
-
);
|
|
157162
157462
|
serverConfig.backendId === "local" || serverConfig.backendId === "@workflow/world-local";
|
|
157163
157463
|
const {
|
|
157164
157464
|
run: runData,
|
|
@@ -157222,7 +157522,7 @@ function RunDetailView({
|
|
|
157222
157522
|
onStreamClick: handleStreamClick,
|
|
157223
157523
|
onRunClick: handleRunRefClick,
|
|
157224
157524
|
onWakeUpSleep: handleWakeUpSleep,
|
|
157225
|
-
onLoadEventData:
|
|
157525
|
+
onLoadEventData: handleLoadEventData,
|
|
157226
157526
|
onResolveHook: handleResolveHook,
|
|
157227
157527
|
encryptionKey: encryptionKey ?? void 0,
|
|
157228
157528
|
onDecrypt: handleDecrypt,
|
|
@@ -157236,7 +157536,7 @@ function RunDetailView({
|
|
|
157236
157536
|
handleStreamClick,
|
|
157237
157537
|
handleRunRefClick,
|
|
157238
157538
|
handleWakeUpSleep,
|
|
157239
|
-
|
|
157539
|
+
handleLoadEventData,
|
|
157240
157540
|
handleResolveHook,
|
|
157241
157541
|
encryptionKey,
|
|
157242
157542
|
handleDecrypt,
|
|
@@ -157759,7 +158059,7 @@ const route4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
157759
158059
|
__proto__: null,
|
|
157760
158060
|
loader
|
|
157761
158061
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
157762
|
-
const serverManifest = { "entry": { "module": "/assets/entry.client-Q4eUIqMI.js", "imports": ["/assets/index-Q81MFBxC.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-
|
|
158062
|
+
const serverManifest = { "entry": { "module": "/assets/entry.client-Q4eUIqMI.js", "imports": ["/assets/index-Q81MFBxC.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-C7ElgjAN.js", "imports": ["/assets/index-Q81MFBxC.js", "/assets/mermaid-3ZIDBTTL-CnDvMd8R.js", "/assets/arrow-up-right-qJMh7AD6.js"], "css": ["/assets/root-CQggqXow.css", "/assets/mermaid-3ZIDBTTL-DDxQhcP4.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-VRVjXSQY.js", "imports": ["/assets/index-Q81MFBxC.js", "/assets/workflow-graph-viewer-DQf8ZZM2.js", "/assets/mermaid-3ZIDBTTL-CnDvMd8R.js", "/assets/index-STTN0-2V.js"], "css": ["/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-DDxQhcP4.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-CmptzMYo.js", "imports": ["/assets/index-Q81MFBxC.js", "/assets/workflow-graph-viewer-DQf8ZZM2.js", "/assets/mermaid-3ZIDBTTL-CnDvMd8R.js", "/assets/arrow-up-right-qJMh7AD6.js", "/assets/encryption-CLVP4klT.js", "/assets/index-STTN0-2V.js"], "css": ["/assets/run-detail-CWoGxu_0.css", "/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-DDxQhcP4.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-479fb7d3.js", "version": "479fb7d3", "sri": void 0 };
|
|
157763
158063
|
const assetsBuildDirectory = "build/client";
|
|
157764
158064
|
const basename = "/";
|
|
157765
158065
|
const future = { "unstable_optimizeDeps": false, "unstable_subResourceIntegrity": false, "unstable_trailingSlashAwareDataRequests": false, "unstable_previewServerPrerendering": false, "v8_middleware": false, "v8_splitRouteModules": false, "v8_viteEnvironmentApi": false };
|
|
@@ -157828,56 +158128,73 @@ const serverBuild = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
157828
158128
|
ssr
|
|
157829
158129
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
157830
158130
|
export {
|
|
157831
|
-
|
|
158131
|
+
WorkflowInvokePayloadSchema as $,
|
|
157832
158132
|
ATTRIBUTE_KEY_MAX_LENGTH as A,
|
|
157833
158133
|
BaseEventSchema as B,
|
|
157834
|
-
|
|
158134
|
+
CHILD_ENTITY_CREATION_EVENT_TYPES as C,
|
|
157835
158135
|
DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS as D,
|
|
157836
|
-
|
|
157837
|
-
|
|
157838
|
-
|
|
158136
|
+
EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE as E,
|
|
158137
|
+
StepInvokePayloadSchema as F,
|
|
158138
|
+
StepSchema as G,
|
|
157839
158139
|
HookSchema as H,
|
|
157840
|
-
|
|
157841
|
-
|
|
157842
|
-
|
|
158140
|
+
StepStatusSchema as I,
|
|
158141
|
+
TERMINAL_STEP_EVENT_TYPES as J,
|
|
158142
|
+
TERMINAL_STEP_STATUSES as K,
|
|
157843
158143
|
LegacySerializedDataSchemaV1 as L,
|
|
157844
158144
|
MessageId as M,
|
|
157845
158145
|
Nt as N,
|
|
157846
|
-
|
|
158146
|
+
TERMINAL_WORKFLOW_RUN_STATUSES as O,
|
|
157847
158147
|
PaginatedResponseSchema as P,
|
|
157848
158148
|
QueuePayloadSchema as Q,
|
|
157849
158149
|
RESERVED_ATTRIBUTE_KEY_PREFIX as R,
|
|
157850
158150
|
SPEC_VERSION_CURRENT as S,
|
|
157851
158151
|
TERMINAL_RUN_EVENT_TYPES as T,
|
|
157852
|
-
|
|
157853
|
-
|
|
157854
|
-
|
|
157855
|
-
|
|
157856
|
-
|
|
157857
|
-
|
|
157858
|
-
|
|
158152
|
+
TerminalRunEventTypeSchema as U,
|
|
158153
|
+
TerminalStepStatusSchema as V,
|
|
158154
|
+
TerminalWorkflowRunStatusSchema as W,
|
|
158155
|
+
ValidQueueName as X,
|
|
158156
|
+
WAIT_EVENT_TYPES as Y,
|
|
158157
|
+
WaitSchema as Z,
|
|
158158
|
+
WaitStatusSchema as _,
|
|
157859
158159
|
ATTRIBUTE_MAX_PER_RUN as a,
|
|
157860
|
-
|
|
157861
|
-
|
|
157862
|
-
|
|
157863
|
-
|
|
157864
|
-
|
|
157865
|
-
|
|
157866
|
-
|
|
157867
|
-
|
|
157868
|
-
|
|
157869
|
-
|
|
157870
|
-
|
|
157871
|
-
|
|
157872
|
-
|
|
157873
|
-
|
|
157874
|
-
|
|
157875
|
-
|
|
157876
|
-
|
|
157877
|
-
|
|
157878
|
-
|
|
157879
|
-
|
|
157880
|
-
|
|
158160
|
+
WorkflowRunBaseSchema as a0,
|
|
158161
|
+
WorkflowRunSchema as a1,
|
|
158162
|
+
WorkflowRunStatusSchema as a2,
|
|
158163
|
+
applyAttributeChanges as a3,
|
|
158164
|
+
envNumber as a4,
|
|
158165
|
+
getEventDataPayloadField as a5,
|
|
158166
|
+
getEventDataRefFields as a6,
|
|
158167
|
+
getQueueTopicPrefix as a7,
|
|
158168
|
+
isChildEntityCreationEvent as a8,
|
|
158169
|
+
isChildEntityCreationEventType as a9,
|
|
158170
|
+
requireTokenError as aA,
|
|
158171
|
+
serverBuild as aB,
|
|
158172
|
+
isHookEventRequiringExistence as aa,
|
|
158173
|
+
isHookLifecycleEventType as ab,
|
|
158174
|
+
isLegacySpecVersion as ac,
|
|
158175
|
+
isStepEventType as ad,
|
|
158176
|
+
isTerminalRunEventType as ae,
|
|
158177
|
+
isTerminalStepEventType as af,
|
|
158178
|
+
isTerminalStepStatus as ag,
|
|
158179
|
+
isTerminalWorkflowRunStatus as ah,
|
|
158180
|
+
isWaitEventType as ai,
|
|
158181
|
+
parseQueueName as aj,
|
|
158182
|
+
reenqueueActiveRuns as ak,
|
|
158183
|
+
requiresNewerWorld as al,
|
|
158184
|
+
resolveQueueNamespace as am,
|
|
158185
|
+
stripEventDataRefs as an,
|
|
158186
|
+
ulidToDate as ao,
|
|
158187
|
+
validateAttributeChanges as ap,
|
|
158188
|
+
validateAttributeKey as aq,
|
|
158189
|
+
validateAttributeValue as ar,
|
|
158190
|
+
validateUlidTimestamp as as,
|
|
158191
|
+
workflowRunIdSchema as at,
|
|
158192
|
+
R as au,
|
|
158193
|
+
Ks as av,
|
|
158194
|
+
jsxRuntimeExports as aw,
|
|
158195
|
+
Qe as ax,
|
|
158196
|
+
registerZstdDecoder as ay,
|
|
158197
|
+
requireTokenUtil as az,
|
|
157881
158198
|
ATTRIBUTE_VALUE_MAX_BYTES as b,
|
|
157882
158199
|
AnalyticsEventSchema as c,
|
|
157883
158200
|
AnalyticsHookSchema as d,
|
|
@@ -157888,19 +158205,19 @@ export {
|
|
|
157888
158205
|
AttributeChangesSchema as i,
|
|
157889
158206
|
AttributeValidationError as j,
|
|
157890
158207
|
DEFAULT_TIMESTAMP_THRESHOLD_PAST_MS as k,
|
|
157891
|
-
|
|
157892
|
-
|
|
157893
|
-
|
|
157894
|
-
|
|
157895
|
-
|
|
157896
|
-
|
|
157897
|
-
|
|
157898
|
-
|
|
157899
|
-
|
|
157900
|
-
|
|
157901
|
-
|
|
157902
|
-
|
|
157903
|
-
|
|
157904
|
-
|
|
157905
|
-
|
|
158208
|
+
EVENT_DATA_REF_FIELDS as l,
|
|
158209
|
+
EventSchema as m,
|
|
158210
|
+
EventTypeSchema as n,
|
|
158211
|
+
HOOK_EVENTS_REQUIRING_EXISTENCE as o,
|
|
158212
|
+
HOOK_LIFECYCLE_EVENT_TYPES as p,
|
|
158213
|
+
HealthCheckPayloadSchema as q,
|
|
158214
|
+
HookCreatedEventSchema as r,
|
|
158215
|
+
QueuePrefix as s,
|
|
158216
|
+
RunInputSchema as t,
|
|
158217
|
+
SPEC_VERSION_LEGACY as u,
|
|
158218
|
+
SPEC_VERSION_SUPPORTS_ATTRIBUTES as v,
|
|
158219
|
+
SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT as w,
|
|
158220
|
+
SPEC_VERSION_SUPPORTS_COMPRESSION as x,
|
|
158221
|
+
STEP_EVENT_TYPES as y,
|
|
158222
|
+
SerializedDataSchema as z
|
|
157906
158223
|
};
|