@workglow/util 0.0.102 → 0.0.104
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/dist/browser.js +641 -117
- package/dist/browser.js.map +17 -7
- package/dist/bun.js +641 -113
- package/dist/bun.js.map +17 -7
- package/dist/common.d.ts +5 -0
- package/dist/common.d.ts.map +1 -1
- package/dist/credentials/ChainedCredentialStore.d.ts +34 -0
- package/dist/credentials/ChainedCredentialStore.d.ts.map +1 -0
- package/dist/credentials/CredentialStoreRegistry.d.ts +27 -0
- package/dist/credentials/CredentialStoreRegistry.d.ts.map +1 -0
- package/dist/credentials/EnvCredentialStore.d.ts +41 -0
- package/dist/credentials/EnvCredentialStore.d.ts.map +1 -0
- package/dist/credentials/ICredentialStore.d.ts +95 -0
- package/dist/credentials/ICredentialStore.d.ts.map +1 -0
- package/dist/credentials/InMemoryCredentialStore.d.ts +23 -0
- package/dist/credentials/InMemoryCredentialStore.d.ts.map +1 -0
- package/dist/credentials/index.d.ts +11 -0
- package/dist/credentials/index.d.ts.map +1 -0
- package/dist/crypto/{Crypto.bun.d.ts → Crypto.d.ts} +1 -1
- package/dist/crypto/Crypto.d.ts.map +1 -0
- package/dist/crypto/WebCrypto.d.ts +29 -0
- package/dist/crypto/WebCrypto.d.ts.map +1 -0
- package/dist/json-schema/JsonSchema.d.ts +2 -1
- package/dist/json-schema/JsonSchema.d.ts.map +1 -1
- package/dist/json-schema/parsePartialJson.d.ts +21 -0
- package/dist/json-schema/parsePartialJson.d.ts.map +1 -0
- package/dist/logging/ConsoleLogger.d.ts +27 -0
- package/dist/logging/ConsoleLogger.d.ts.map +1 -0
- package/dist/logging/ILogger.d.ts +22 -0
- package/dist/logging/ILogger.d.ts.map +1 -0
- package/dist/logging/LoggerRegistry.d.ts +19 -0
- package/dist/logging/LoggerRegistry.d.ts.map +1 -0
- package/dist/logging/NullLogger.d.ts +23 -0
- package/dist/logging/NullLogger.d.ts.map +1 -0
- package/dist/logging/index.d.ts +10 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/node.js +641 -114
- package/dist/node.js.map +17 -7
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/worker/WorkerManager.d.ts +4 -0
- package/dist/worker/WorkerManager.d.ts.map +1 -1
- package/dist/worker/WorkerServer.d.ts +6 -0
- package/dist/worker/WorkerServer.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/crypto/Crypto.browser.d.ts +0 -10
- package/dist/crypto/Crypto.browser.d.ts.map +0 -1
- package/dist/crypto/Crypto.bun.d.ts.map +0 -1
- package/dist/crypto/Crypto.node.d.ts +0 -10
- package/dist/crypto/Crypto.node.d.ts.map +0 -1
package/dist/node.js
CHANGED
|
@@ -1,3 +1,86 @@
|
|
|
1
|
+
// src/utilities/Misc.ts
|
|
2
|
+
function forceArray(input) {
|
|
3
|
+
if (Array.isArray(input))
|
|
4
|
+
return input;
|
|
5
|
+
return [input];
|
|
6
|
+
}
|
|
7
|
+
async function sleep(ms) {
|
|
8
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
9
|
+
}
|
|
10
|
+
function collectPropertyValues(input) {
|
|
11
|
+
const output = {};
|
|
12
|
+
(input || []).forEach((item) => {
|
|
13
|
+
Object.keys(item).forEach((key) => {
|
|
14
|
+
const value = item[key];
|
|
15
|
+
if (output[key]) {
|
|
16
|
+
output[key].push(value);
|
|
17
|
+
} else {
|
|
18
|
+
output[key] = [value];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
return output;
|
|
23
|
+
}
|
|
24
|
+
function toSQLiteTimestamp(date) {
|
|
25
|
+
if (!date)
|
|
26
|
+
return null;
|
|
27
|
+
const pad = (number) => number < 10 ? "0" + number : number;
|
|
28
|
+
const year = date.getUTCFullYear();
|
|
29
|
+
const month = pad(date.getUTCMonth() + 1);
|
|
30
|
+
const day = pad(date.getUTCDate());
|
|
31
|
+
const hours = pad(date.getUTCHours());
|
|
32
|
+
const minutes = pad(date.getUTCMinutes());
|
|
33
|
+
const seconds = pad(date.getUTCSeconds());
|
|
34
|
+
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
35
|
+
}
|
|
36
|
+
function deepEqual(a, b) {
|
|
37
|
+
if (a === b) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
const keysA = Object.keys(a);
|
|
44
|
+
const keysB = Object.keys(b);
|
|
45
|
+
if (keysA.length !== keysB.length) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
for (const key of keysA) {
|
|
49
|
+
if (!keysB.includes(key)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
if (!deepEqual(a[key], b[key])) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
function sortObject(obj) {
|
|
59
|
+
return Object.keys(obj).sort().reduce((result, key) => {
|
|
60
|
+
result[key] = obj[key];
|
|
61
|
+
return result;
|
|
62
|
+
}, {});
|
|
63
|
+
}
|
|
64
|
+
function serialize(obj) {
|
|
65
|
+
const sortedObj = sortObject(obj);
|
|
66
|
+
return JSON.stringify(sortedObj);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/crypto/Crypto.ts
|
|
70
|
+
async function sha256(data) {
|
|
71
|
+
const encoder = new TextEncoder;
|
|
72
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", encoder.encode(data));
|
|
73
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
74
|
+
return hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
75
|
+
}
|
|
76
|
+
async function makeFingerprint(input) {
|
|
77
|
+
const serializedObj = serialize(input);
|
|
78
|
+
const hash = await sha256(serializedObj);
|
|
79
|
+
return hash;
|
|
80
|
+
}
|
|
81
|
+
function uuid4() {
|
|
82
|
+
return crypto.randomUUID();
|
|
83
|
+
}
|
|
1
84
|
// src/di/Container.ts
|
|
2
85
|
class Container {
|
|
3
86
|
services = new Map;
|
|
@@ -143,6 +226,117 @@ class EventEmitter {
|
|
|
143
226
|
return () => this.off(event, listener);
|
|
144
227
|
}
|
|
145
228
|
}
|
|
229
|
+
// src/logging/ConsoleLogger.ts
|
|
230
|
+
class ConsoleLogger {
|
|
231
|
+
bindings;
|
|
232
|
+
constructor(bindings = {}) {
|
|
233
|
+
this.bindings = bindings;
|
|
234
|
+
}
|
|
235
|
+
info(message, meta) {
|
|
236
|
+
const merged = this.merge(meta);
|
|
237
|
+
if (merged) {
|
|
238
|
+
console.info(message, merged);
|
|
239
|
+
} else {
|
|
240
|
+
console.info(message);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
warn(message, meta) {
|
|
244
|
+
const merged = this.merge(meta);
|
|
245
|
+
if (merged) {
|
|
246
|
+
console.warn(message, merged);
|
|
247
|
+
} else {
|
|
248
|
+
console.warn(message);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
error(message, meta) {
|
|
252
|
+
const merged = this.merge(meta);
|
|
253
|
+
if (merged) {
|
|
254
|
+
console.error(message, merged);
|
|
255
|
+
} else {
|
|
256
|
+
console.error(message);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
debug(message, meta) {
|
|
260
|
+
const merged = this.merge(meta);
|
|
261
|
+
if (merged) {
|
|
262
|
+
console.debug(message, merged);
|
|
263
|
+
} else {
|
|
264
|
+
console.debug(message);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
fatal(err, message, meta) {
|
|
268
|
+
const merged = this.merge(meta);
|
|
269
|
+
if (merged) {
|
|
270
|
+
console.error(message, { ...merged, error: err });
|
|
271
|
+
} else {
|
|
272
|
+
console.error(message, { error: err });
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
time(label, meta) {
|
|
276
|
+
const merged = this.merge(meta);
|
|
277
|
+
if (merged) {
|
|
278
|
+
console.info(`[time] ${label}`, merged);
|
|
279
|
+
}
|
|
280
|
+
console.time(label);
|
|
281
|
+
}
|
|
282
|
+
timeEnd(label, meta) {
|
|
283
|
+
console.timeEnd(label);
|
|
284
|
+
const merged = this.merge(meta);
|
|
285
|
+
if (merged) {
|
|
286
|
+
console.info(`[timeEnd] ${label}`, merged);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
group(label, meta) {
|
|
290
|
+
const merged = this.merge(meta);
|
|
291
|
+
if (merged) {
|
|
292
|
+
console.group(label, merged);
|
|
293
|
+
} else {
|
|
294
|
+
console.group(label);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
groupEnd() {
|
|
298
|
+
console.groupEnd();
|
|
299
|
+
}
|
|
300
|
+
child(bindings) {
|
|
301
|
+
return new ConsoleLogger({ ...this.bindings, ...bindings });
|
|
302
|
+
}
|
|
303
|
+
merge(meta) {
|
|
304
|
+
const hasBindings = Object.keys(this.bindings).length > 0;
|
|
305
|
+
if (!hasBindings && !meta)
|
|
306
|
+
return;
|
|
307
|
+
if (!hasBindings)
|
|
308
|
+
return meta;
|
|
309
|
+
if (!meta)
|
|
310
|
+
return this.bindings;
|
|
311
|
+
return { ...this.bindings, ...meta };
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
// src/logging/NullLogger.ts
|
|
315
|
+
class NullLogger {
|
|
316
|
+
info(_message, _meta) {}
|
|
317
|
+
error(_message, _meta) {}
|
|
318
|
+
warn(_message, _meta) {}
|
|
319
|
+
debug(_message, _meta) {}
|
|
320
|
+
fatal(_err, _message, _meta) {}
|
|
321
|
+
time(_label, _meta) {}
|
|
322
|
+
timeEnd(_label, _meta) {}
|
|
323
|
+
group(_label, _meta) {}
|
|
324
|
+
groupEnd() {}
|
|
325
|
+
child(_bindings) {
|
|
326
|
+
return this;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
// src/logging/LoggerRegistry.ts
|
|
330
|
+
var LOGGER = createServiceToken("logger");
|
|
331
|
+
if (!globalServiceRegistry.has(LOGGER)) {
|
|
332
|
+
globalServiceRegistry.register(LOGGER, () => new ConsoleLogger, true);
|
|
333
|
+
}
|
|
334
|
+
function getLogger() {
|
|
335
|
+
return globalServiceRegistry.get(LOGGER);
|
|
336
|
+
}
|
|
337
|
+
function setLogger(logger) {
|
|
338
|
+
globalServiceRegistry.registerInstance(LOGGER, logger);
|
|
339
|
+
}
|
|
146
340
|
// src/utilities/BaseError.ts
|
|
147
341
|
class BaseError {
|
|
148
342
|
static type = "BaseError";
|
|
@@ -977,72 +1171,168 @@ function areObjectSchemasSemanticallyCompatible(sourceSchema, targetSchema) {
|
|
|
977
1171
|
}
|
|
978
1172
|
// src/json-schema/SchemaValidation.ts
|
|
979
1173
|
import { compileSchema } from "@sroussey/json-schema-library";
|
|
980
|
-
// src/
|
|
981
|
-
function
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1174
|
+
// src/json-schema/parsePartialJson.ts
|
|
1175
|
+
function parsePartialJson(text) {
|
|
1176
|
+
const trimmed = text.trim();
|
|
1177
|
+
if (!trimmed)
|
|
1178
|
+
return;
|
|
1179
|
+
try {
|
|
1180
|
+
const result = JSON.parse(trimmed);
|
|
1181
|
+
if (typeof result === "object" && result !== null && !Array.isArray(result)) {
|
|
1182
|
+
return result;
|
|
1183
|
+
}
|
|
1184
|
+
return;
|
|
1185
|
+
} catch {}
|
|
1186
|
+
if (trimmed[0] !== "{")
|
|
1187
|
+
return;
|
|
1188
|
+
const repaired = repairJson(trimmed);
|
|
1189
|
+
if (repaired === undefined)
|
|
1190
|
+
return;
|
|
1191
|
+
try {
|
|
1192
|
+
const result = JSON.parse(repaired);
|
|
1193
|
+
if (typeof result === "object" && result !== null && !Array.isArray(result)) {
|
|
1194
|
+
return result;
|
|
1195
|
+
}
|
|
1196
|
+
return;
|
|
1197
|
+
} catch {
|
|
1198
|
+
return;
|
|
1199
|
+
}
|
|
988
1200
|
}
|
|
989
|
-
function
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1201
|
+
function repairJson(text) {
|
|
1202
|
+
let result = "";
|
|
1203
|
+
let i = 0;
|
|
1204
|
+
const len = text.length;
|
|
1205
|
+
const stack = [];
|
|
1206
|
+
let inString = false;
|
|
1207
|
+
let escaped = false;
|
|
1208
|
+
let lastSafeEnd = 0;
|
|
1209
|
+
while (i < len) {
|
|
1210
|
+
const ch = text[i];
|
|
1211
|
+
if (escaped) {
|
|
1212
|
+
escaped = false;
|
|
1213
|
+
result += ch;
|
|
1214
|
+
i++;
|
|
1215
|
+
continue;
|
|
1216
|
+
}
|
|
1217
|
+
if (ch === "\\") {
|
|
1218
|
+
escaped = true;
|
|
1219
|
+
result += ch;
|
|
1220
|
+
i++;
|
|
1221
|
+
continue;
|
|
1222
|
+
}
|
|
1223
|
+
if (inString) {
|
|
1224
|
+
if (ch === '"') {
|
|
1225
|
+
inString = false;
|
|
1226
|
+
result += ch;
|
|
1227
|
+
i++;
|
|
1228
|
+
lastSafeEnd = result.length;
|
|
1229
|
+
continue;
|
|
998
1230
|
}
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1231
|
+
result += ch;
|
|
1232
|
+
i++;
|
|
1233
|
+
continue;
|
|
1234
|
+
}
|
|
1235
|
+
switch (ch) {
|
|
1236
|
+
case '"':
|
|
1237
|
+
inString = true;
|
|
1238
|
+
result += ch;
|
|
1239
|
+
i++;
|
|
1240
|
+
break;
|
|
1241
|
+
case "{":
|
|
1242
|
+
stack.push("}");
|
|
1243
|
+
result += ch;
|
|
1244
|
+
i++;
|
|
1245
|
+
break;
|
|
1246
|
+
case "[":
|
|
1247
|
+
stack.push("]");
|
|
1248
|
+
result += ch;
|
|
1249
|
+
i++;
|
|
1250
|
+
break;
|
|
1251
|
+
case "}":
|
|
1252
|
+
if (stack.length > 0 && stack[stack.length - 1] === "}") {
|
|
1253
|
+
stack.pop();
|
|
1254
|
+
result += ch;
|
|
1255
|
+
i++;
|
|
1256
|
+
lastSafeEnd = result.length;
|
|
1257
|
+
} else {
|
|
1258
|
+
return closeStack(result, stack);
|
|
1259
|
+
}
|
|
1260
|
+
break;
|
|
1261
|
+
case "]":
|
|
1262
|
+
if (stack.length > 0 && stack[stack.length - 1] === "]") {
|
|
1263
|
+
stack.pop();
|
|
1264
|
+
result += ch;
|
|
1265
|
+
i++;
|
|
1266
|
+
lastSafeEnd = result.length;
|
|
1267
|
+
} else {
|
|
1268
|
+
return closeStack(result, stack);
|
|
1269
|
+
}
|
|
1270
|
+
break;
|
|
1271
|
+
default:
|
|
1272
|
+
result += ch;
|
|
1273
|
+
i++;
|
|
1274
|
+
break;
|
|
1275
|
+
}
|
|
1018
1276
|
}
|
|
1019
|
-
if (
|
|
1020
|
-
|
|
1277
|
+
if (inString) {
|
|
1278
|
+
result += '"';
|
|
1021
1279
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
if (keysA.length !== keysB.length) {
|
|
1025
|
-
return false;
|
|
1280
|
+
if (stack.length === 0) {
|
|
1281
|
+
return result;
|
|
1026
1282
|
}
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1283
|
+
return closeStack(cleanTrailing(result), stack);
|
|
1284
|
+
}
|
|
1285
|
+
function cleanTrailing(text) {
|
|
1286
|
+
let s = text.trimEnd();
|
|
1287
|
+
let changed = true;
|
|
1288
|
+
while (changed) {
|
|
1289
|
+
changed = false;
|
|
1290
|
+
const trimmed = s.trimEnd();
|
|
1291
|
+
if (trimmed.endsWith(",")) {
|
|
1292
|
+
s = trimmed.slice(0, -1);
|
|
1293
|
+
changed = true;
|
|
1294
|
+
continue;
|
|
1030
1295
|
}
|
|
1031
|
-
if (
|
|
1032
|
-
|
|
1296
|
+
if (trimmed.endsWith(":")) {
|
|
1297
|
+
const withoutColon = trimmed.slice(0, -1).trimEnd();
|
|
1298
|
+
if (withoutColon.endsWith('"')) {
|
|
1299
|
+
const keyStart = withoutColon.lastIndexOf('"', withoutColon.length - 2);
|
|
1300
|
+
if (keyStart >= 0) {
|
|
1301
|
+
let before = withoutColon.slice(0, keyStart).trimEnd();
|
|
1302
|
+
if (before.endsWith(",")) {
|
|
1303
|
+
before = before.slice(0, -1);
|
|
1304
|
+
}
|
|
1305
|
+
s = before;
|
|
1306
|
+
changed = true;
|
|
1307
|
+
continue;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
s = withoutColon;
|
|
1311
|
+
changed = true;
|
|
1312
|
+
continue;
|
|
1313
|
+
}
|
|
1314
|
+
const bareTokenMatch = trimmed.match(/,\s*"[^"]*"\s*:\s*(?:tru|fal|nul|true|false|null|[\d.eE+-]+)$/);
|
|
1315
|
+
if (bareTokenMatch) {
|
|
1316
|
+
const valueStr = trimmed.slice(trimmed.lastIndexOf(":") + 1).trim();
|
|
1317
|
+
try {
|
|
1318
|
+
JSON.parse(valueStr);
|
|
1319
|
+
} catch {
|
|
1320
|
+
s = trimmed.slice(0, bareTokenMatch.index).trimEnd();
|
|
1321
|
+
if (s.endsWith(","))
|
|
1322
|
+
s = s.slice(0, -1);
|
|
1323
|
+
changed = true;
|
|
1324
|
+
continue;
|
|
1325
|
+
}
|
|
1033
1326
|
}
|
|
1034
1327
|
}
|
|
1035
|
-
return
|
|
1328
|
+
return s;
|
|
1036
1329
|
}
|
|
1037
|
-
function
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
function serialize(obj) {
|
|
1044
|
-
const sortedObj = sortObject(obj);
|
|
1045
|
-
return JSON.stringify(sortedObj);
|
|
1330
|
+
function closeStack(text, stack) {
|
|
1331
|
+
let result = text;
|
|
1332
|
+
for (let i = stack.length - 1;i >= 0; i--) {
|
|
1333
|
+
result += stack[i];
|
|
1334
|
+
}
|
|
1335
|
+
return result;
|
|
1046
1336
|
}
|
|
1047
1337
|
// src/utilities/objectOfArraysAsArrayOfObjects.ts
|
|
1048
1338
|
function objectOfArraysAsArrayOfObjects(data) {
|
|
@@ -1581,43 +1871,12 @@ function normalizeNumberArray(values, throwOnZero = false) {
|
|
|
1581
1871
|
return values.map((v) => v / norm);
|
|
1582
1872
|
}
|
|
1583
1873
|
// src/worker/WorkerManager.ts
|
|
1584
|
-
function extractTransferables(obj) {
|
|
1585
|
-
const transferables = [];
|
|
1586
|
-
const seen = new WeakSet;
|
|
1587
|
-
function findTransferables(value) {
|
|
1588
|
-
if (value && typeof value === "object" && seen.has(value)) {
|
|
1589
|
-
return;
|
|
1590
|
-
}
|
|
1591
|
-
if (value && typeof value === "object") {
|
|
1592
|
-
seen.add(value);
|
|
1593
|
-
}
|
|
1594
|
-
if (value instanceof Float32Array || value instanceof Int16Array) {
|
|
1595
|
-
transferables.push(value.buffer);
|
|
1596
|
-
} else if (value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Int8Array || value instanceof Uint16Array || value instanceof Int32Array || value instanceof Uint32Array || value instanceof Float64Array || value instanceof BigInt64Array || value instanceof BigUint64Array) {
|
|
1597
|
-
transferables.push(value.buffer);
|
|
1598
|
-
} else if (typeof OffscreenCanvas !== "undefined" && value instanceof OffscreenCanvas) {
|
|
1599
|
-
transferables.push(value);
|
|
1600
|
-
} else if (typeof ImageBitmap !== "undefined" && value instanceof ImageBitmap) {
|
|
1601
|
-
transferables.push(value);
|
|
1602
|
-
} else if (typeof VideoFrame !== "undefined" && value instanceof VideoFrame) {
|
|
1603
|
-
transferables.push(value);
|
|
1604
|
-
} else if (typeof MessagePort !== "undefined" && value instanceof MessagePort) {
|
|
1605
|
-
transferables.push(value);
|
|
1606
|
-
} else if (value instanceof ArrayBuffer) {
|
|
1607
|
-
transferables.push(value);
|
|
1608
|
-
} else if (Array.isArray(value)) {
|
|
1609
|
-
value.forEach(findTransferables);
|
|
1610
|
-
} else if (value && typeof value === "object") {
|
|
1611
|
-
Object.values(value).forEach(findTransferables);
|
|
1612
|
-
}
|
|
1613
|
-
}
|
|
1614
|
-
findTransferables(obj);
|
|
1615
|
-
return transferables;
|
|
1616
|
-
}
|
|
1617
|
-
|
|
1618
1874
|
class WorkerManager {
|
|
1619
1875
|
workers = new Map;
|
|
1620
1876
|
readyWorkers = new Map;
|
|
1877
|
+
workerFunctions = new Map;
|
|
1878
|
+
workerStreamFunctions = new Map;
|
|
1879
|
+
workerReactiveFunctions = new Map;
|
|
1621
1880
|
registerWorker(name, worker) {
|
|
1622
1881
|
if (this.workers.has(name))
|
|
1623
1882
|
throw new Error(`Worker ${name} is already registered.`);
|
|
@@ -1633,6 +1892,9 @@ class WorkerManager {
|
|
|
1633
1892
|
const handleReady = (event) => {
|
|
1634
1893
|
if (event.data?.type === "ready") {
|
|
1635
1894
|
worker.removeEventListener("message", handleReady);
|
|
1895
|
+
this.workerFunctions.set(name, new Set(event.data.functions ?? []));
|
|
1896
|
+
this.workerStreamFunctions.set(name, new Set(event.data.streamFunctions ?? []));
|
|
1897
|
+
this.workerReactiveFunctions.set(name, new Set(event.data.reactiveFunctions ?? []));
|
|
1636
1898
|
resolve();
|
|
1637
1899
|
}
|
|
1638
1900
|
};
|
|
@@ -1651,6 +1913,10 @@ class WorkerManager {
|
|
|
1651
1913
|
if (!worker)
|
|
1652
1914
|
throw new Error(`Worker ${workerName} not found.`);
|
|
1653
1915
|
await this.readyWorkers.get(workerName);
|
|
1916
|
+
const knownFunctions = this.workerFunctions.get(workerName);
|
|
1917
|
+
if (knownFunctions && !knownFunctions.has(functionName)) {
|
|
1918
|
+
throw new Error(`Function "${functionName}" is not registered on worker "${workerName}".`);
|
|
1919
|
+
}
|
|
1654
1920
|
return new Promise((resolve, reject) => {
|
|
1655
1921
|
const requestId = crypto.randomUUID();
|
|
1656
1922
|
const handleMessage = (event) => {
|
|
@@ -1679,8 +1945,7 @@ class WorkerManager {
|
|
|
1679
1945
|
options.signal.addEventListener("abort", handleAbort, { once: true });
|
|
1680
1946
|
}
|
|
1681
1947
|
const message = { id: requestId, type: "call", functionName, args };
|
|
1682
|
-
|
|
1683
|
-
worker.postMessage(message, transferables);
|
|
1948
|
+
worker.postMessage(message);
|
|
1684
1949
|
});
|
|
1685
1950
|
}
|
|
1686
1951
|
async callWorkerReactiveFunction(workerName, functionName, args) {
|
|
@@ -1688,6 +1953,9 @@ class WorkerManager {
|
|
|
1688
1953
|
if (!worker)
|
|
1689
1954
|
return;
|
|
1690
1955
|
await this.readyWorkers.get(workerName);
|
|
1956
|
+
const knownReactive = this.workerReactiveFunctions.get(workerName);
|
|
1957
|
+
if (knownReactive && !knownReactive.has(functionName))
|
|
1958
|
+
return;
|
|
1691
1959
|
return new Promise((resolve) => {
|
|
1692
1960
|
const requestId = crypto.randomUUID();
|
|
1693
1961
|
const handleMessage = (event) => {
|
|
@@ -1707,8 +1975,7 @@ class WorkerManager {
|
|
|
1707
1975
|
};
|
|
1708
1976
|
worker.addEventListener("message", handleMessage);
|
|
1709
1977
|
const message = { id: requestId, type: "call", functionName, args, reactive: true };
|
|
1710
|
-
|
|
1711
|
-
worker.postMessage(message, transferables);
|
|
1978
|
+
worker.postMessage(message);
|
|
1712
1979
|
});
|
|
1713
1980
|
}
|
|
1714
1981
|
async* callWorkerStreamFunction(workerName, functionName, args, options) {
|
|
@@ -1716,6 +1983,11 @@ class WorkerManager {
|
|
|
1716
1983
|
if (!worker)
|
|
1717
1984
|
throw new Error(`Worker ${workerName} not found.`);
|
|
1718
1985
|
await this.readyWorkers.get(workerName);
|
|
1986
|
+
const knownStream = this.workerStreamFunctions.get(workerName);
|
|
1987
|
+
const knownFns = this.workerFunctions.get(workerName);
|
|
1988
|
+
if (knownStream && knownFns && !knownStream.has(functionName) && !knownFns.has(functionName)) {
|
|
1989
|
+
throw new Error(`Function "${functionName}" is not registered on worker "${workerName}".`);
|
|
1990
|
+
}
|
|
1719
1991
|
const requestId = crypto.randomUUID();
|
|
1720
1992
|
const queue = [];
|
|
1721
1993
|
let waiting = null;
|
|
@@ -1757,8 +2029,7 @@ class WorkerManager {
|
|
|
1757
2029
|
options.signal.addEventListener("abort", handleAbort, { once: true });
|
|
1758
2030
|
}
|
|
1759
2031
|
const message = { id: requestId, type: "call", functionName, args, stream: true };
|
|
1760
|
-
|
|
1761
|
-
worker.postMessage(message, transferables);
|
|
2032
|
+
worker.postMessage(message);
|
|
1762
2033
|
let completedNormally = false;
|
|
1763
2034
|
try {
|
|
1764
2035
|
while (true) {
|
|
@@ -1790,7 +2061,7 @@ var WORKER_MANAGER = createServiceToken("worker.manager");
|
|
|
1790
2061
|
globalServiceRegistry.register(WORKER_MANAGER, () => new WorkerManager, true);
|
|
1791
2062
|
// src/worker/WorkerServer.ts
|
|
1792
2063
|
import { parentPort } from "@workglow/util";
|
|
1793
|
-
function
|
|
2064
|
+
function extractTransferables(obj) {
|
|
1794
2065
|
const transferables = [];
|
|
1795
2066
|
const seen = new WeakSet;
|
|
1796
2067
|
function findTransferables(value) {
|
|
@@ -1844,8 +2115,9 @@ class WorkerServer {
|
|
|
1844
2115
|
return;
|
|
1845
2116
|
}
|
|
1846
2117
|
this.completedRequests.add(id);
|
|
1847
|
-
const transferables =
|
|
1848
|
-
|
|
2118
|
+
const transferables = extractTransferables(result);
|
|
2119
|
+
const uniqueTransferables = [...new Set(transferables)];
|
|
2120
|
+
postMessage({ id, type: "complete", data: result }, uniqueTransferables);
|
|
1849
2121
|
};
|
|
1850
2122
|
postError = (id, errorMessage) => {
|
|
1851
2123
|
if (this.completedRequests.has(id)) {
|
|
@@ -1860,6 +2132,14 @@ class WorkerServer {
|
|
|
1860
2132
|
}
|
|
1861
2133
|
postMessage({ id, type: "stream_chunk", data: event });
|
|
1862
2134
|
};
|
|
2135
|
+
sendReady() {
|
|
2136
|
+
postMessage({
|
|
2137
|
+
type: "ready",
|
|
2138
|
+
functions: Object.keys(this.functions),
|
|
2139
|
+
streamFunctions: Object.keys(this.streamFunctions),
|
|
2140
|
+
reactiveFunctions: Object.keys(this.reactiveFunctions)
|
|
2141
|
+
});
|
|
2142
|
+
}
|
|
1863
2143
|
registerFunction(name, fn) {
|
|
1864
2144
|
this.functions[name] = fn;
|
|
1865
2145
|
}
|
|
@@ -1975,6 +2255,248 @@ class WorkerServer {
|
|
|
1975
2255
|
}
|
|
1976
2256
|
var WORKER_SERVER = createServiceToken("worker.server");
|
|
1977
2257
|
globalServiceRegistry.register(WORKER_SERVER, () => new WorkerServer, true);
|
|
2258
|
+
// src/credentials/ICredentialStore.ts
|
|
2259
|
+
var CREDENTIAL_STORE = createServiceToken("credential.store");
|
|
2260
|
+
// src/credentials/InMemoryCredentialStore.ts
|
|
2261
|
+
class InMemoryCredentialStore {
|
|
2262
|
+
store = new Map;
|
|
2263
|
+
async get(key) {
|
|
2264
|
+
const entry = this.store.get(key);
|
|
2265
|
+
if (!entry)
|
|
2266
|
+
return;
|
|
2267
|
+
if (entry.metadata.expiresAt && entry.metadata.expiresAt <= new Date) {
|
|
2268
|
+
this.store.delete(key);
|
|
2269
|
+
return;
|
|
2270
|
+
}
|
|
2271
|
+
return entry.value;
|
|
2272
|
+
}
|
|
2273
|
+
async put(key, value, options) {
|
|
2274
|
+
const now = new Date;
|
|
2275
|
+
const existing = this.store.get(key);
|
|
2276
|
+
const metadata = {
|
|
2277
|
+
label: options?.label ?? existing?.metadata.label,
|
|
2278
|
+
provider: options?.provider ?? existing?.metadata.provider,
|
|
2279
|
+
createdAt: existing?.metadata.createdAt ?? now,
|
|
2280
|
+
updatedAt: now,
|
|
2281
|
+
expiresAt: options?.expiresAt ?? existing?.metadata.expiresAt
|
|
2282
|
+
};
|
|
2283
|
+
this.store.set(key, { key, value, metadata });
|
|
2284
|
+
}
|
|
2285
|
+
async delete(key) {
|
|
2286
|
+
return this.store.delete(key);
|
|
2287
|
+
}
|
|
2288
|
+
async has(key) {
|
|
2289
|
+
const entry = this.store.get(key);
|
|
2290
|
+
if (!entry)
|
|
2291
|
+
return false;
|
|
2292
|
+
if (entry.metadata.expiresAt && entry.metadata.expiresAt <= new Date) {
|
|
2293
|
+
this.store.delete(key);
|
|
2294
|
+
return false;
|
|
2295
|
+
}
|
|
2296
|
+
return true;
|
|
2297
|
+
}
|
|
2298
|
+
async keys() {
|
|
2299
|
+
const now = new Date;
|
|
2300
|
+
const result = [];
|
|
2301
|
+
for (const [key, entry] of this.store) {
|
|
2302
|
+
if (entry.metadata.expiresAt && entry.metadata.expiresAt <= now) {
|
|
2303
|
+
this.store.delete(key);
|
|
2304
|
+
continue;
|
|
2305
|
+
}
|
|
2306
|
+
result.push(key);
|
|
2307
|
+
}
|
|
2308
|
+
return result;
|
|
2309
|
+
}
|
|
2310
|
+
async deleteAll() {
|
|
2311
|
+
this.store.clear();
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
// src/credentials/EnvCredentialStore.ts
|
|
2315
|
+
class EnvCredentialStore {
|
|
2316
|
+
keyToEnvVar;
|
|
2317
|
+
prefix;
|
|
2318
|
+
constructor(mapping = {}, prefix) {
|
|
2319
|
+
this.keyToEnvVar = new Map(Object.entries(mapping));
|
|
2320
|
+
this.prefix = prefix;
|
|
2321
|
+
}
|
|
2322
|
+
resolveEnvVar(key) {
|
|
2323
|
+
const explicit = this.keyToEnvVar.get(key);
|
|
2324
|
+
if (explicit)
|
|
2325
|
+
return explicit;
|
|
2326
|
+
if (this.prefix) {
|
|
2327
|
+
return `${this.prefix}_${key.toUpperCase().replace(/-/g, "_")}`;
|
|
2328
|
+
}
|
|
2329
|
+
return key.toUpperCase().replace(/-/g, "_");
|
|
2330
|
+
}
|
|
2331
|
+
getEnv(envVar) {
|
|
2332
|
+
if (typeof process !== "undefined" && process.env) {
|
|
2333
|
+
return process.env[envVar];
|
|
2334
|
+
}
|
|
2335
|
+
return;
|
|
2336
|
+
}
|
|
2337
|
+
async get(key) {
|
|
2338
|
+
const envVar = this.resolveEnvVar(key);
|
|
2339
|
+
return this.getEnv(envVar);
|
|
2340
|
+
}
|
|
2341
|
+
async put(key, value, _options) {
|
|
2342
|
+
const envVar = this.resolveEnvVar(key);
|
|
2343
|
+
if (typeof process !== "undefined" && process.env) {
|
|
2344
|
+
process.env[envVar] = value;
|
|
2345
|
+
}
|
|
2346
|
+
if (!this.keyToEnvVar.has(key)) {
|
|
2347
|
+
this.keyToEnvVar.set(key, envVar);
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
async delete(key) {
|
|
2351
|
+
const envVar = this.resolveEnvVar(key);
|
|
2352
|
+
if (typeof process !== "undefined" && process.env && envVar in process.env) {
|
|
2353
|
+
delete process.env[envVar];
|
|
2354
|
+
return true;
|
|
2355
|
+
}
|
|
2356
|
+
return false;
|
|
2357
|
+
}
|
|
2358
|
+
async has(key) {
|
|
2359
|
+
const envVar = this.resolveEnvVar(key);
|
|
2360
|
+
return this.getEnv(envVar) !== undefined;
|
|
2361
|
+
}
|
|
2362
|
+
async keys() {
|
|
2363
|
+
const result = [];
|
|
2364
|
+
for (const [credKey] of this.keyToEnvVar) {
|
|
2365
|
+
if (await this.has(credKey)) {
|
|
2366
|
+
result.push(credKey);
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
return result;
|
|
2370
|
+
}
|
|
2371
|
+
async deleteAll() {
|
|
2372
|
+
for (const [credKey] of this.keyToEnvVar) {
|
|
2373
|
+
await this.delete(credKey);
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
// src/credentials/ChainedCredentialStore.ts
|
|
2378
|
+
class ChainedCredentialStore {
|
|
2379
|
+
stores;
|
|
2380
|
+
constructor(stores) {
|
|
2381
|
+
this.stores = stores;
|
|
2382
|
+
if (stores.length === 0) {
|
|
2383
|
+
throw new Error("ChainedCredentialStore requires at least one store.");
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
async get(key) {
|
|
2387
|
+
for (const store of this.stores) {
|
|
2388
|
+
const value = await store.get(key);
|
|
2389
|
+
if (value !== undefined)
|
|
2390
|
+
return value;
|
|
2391
|
+
}
|
|
2392
|
+
return;
|
|
2393
|
+
}
|
|
2394
|
+
async put(key, value, options) {
|
|
2395
|
+
await this.stores[0].put(key, value, options);
|
|
2396
|
+
}
|
|
2397
|
+
async delete(key) {
|
|
2398
|
+
let deleted = false;
|
|
2399
|
+
for (const store of this.stores) {
|
|
2400
|
+
if (await store.delete(key)) {
|
|
2401
|
+
deleted = true;
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
return deleted;
|
|
2405
|
+
}
|
|
2406
|
+
async has(key) {
|
|
2407
|
+
for (const store of this.stores) {
|
|
2408
|
+
if (await store.has(key))
|
|
2409
|
+
return true;
|
|
2410
|
+
}
|
|
2411
|
+
return false;
|
|
2412
|
+
}
|
|
2413
|
+
async keys() {
|
|
2414
|
+
const seen = new Set;
|
|
2415
|
+
for (const store of this.stores) {
|
|
2416
|
+
for (const key of await store.keys()) {
|
|
2417
|
+
seen.add(key);
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
return [...seen];
|
|
2421
|
+
}
|
|
2422
|
+
async deleteAll() {
|
|
2423
|
+
await Promise.all(this.stores.map((s) => s.deleteAll()));
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
// src/credentials/CredentialStoreRegistry.ts
|
|
2427
|
+
if (!globalServiceRegistry.has(CREDENTIAL_STORE)) {
|
|
2428
|
+
globalServiceRegistry.register(CREDENTIAL_STORE, () => new InMemoryCredentialStore, true);
|
|
2429
|
+
}
|
|
2430
|
+
function getGlobalCredentialStore() {
|
|
2431
|
+
return globalServiceRegistry.get(CREDENTIAL_STORE);
|
|
2432
|
+
}
|
|
2433
|
+
function setGlobalCredentialStore(store) {
|
|
2434
|
+
globalServiceRegistry.registerInstance(CREDENTIAL_STORE, store);
|
|
2435
|
+
}
|
|
2436
|
+
async function resolveCredential(key, registry) {
|
|
2437
|
+
const store = registry && registry.has(CREDENTIAL_STORE) ? registry.get(CREDENTIAL_STORE) : getGlobalCredentialStore();
|
|
2438
|
+
return store.get(key);
|
|
2439
|
+
}
|
|
2440
|
+
registerInputResolver("credential", async (id, _format, registry) => {
|
|
2441
|
+
return await resolveCredential(id, registry) ?? id;
|
|
2442
|
+
});
|
|
2443
|
+
// src/crypto/WebCrypto.ts
|
|
2444
|
+
var SALT_LENGTH = 16;
|
|
2445
|
+
async function deriveKey(passphrase, salt) {
|
|
2446
|
+
const enc = new TextEncoder;
|
|
2447
|
+
const keyMaterial = await crypto.subtle.importKey("raw", enc.encode(passphrase), "PBKDF2", false, [
|
|
2448
|
+
"deriveKey"
|
|
2449
|
+
]);
|
|
2450
|
+
return crypto.subtle.deriveKey({ name: "PBKDF2", salt, iterations: 1e5, hash: "SHA-256" }, keyMaterial, { name: "AES-GCM", length: 256 }, false, ["encrypt", "decrypt"]);
|
|
2451
|
+
}
|
|
2452
|
+
async function encrypt(plaintext, passphrase, keyCache) {
|
|
2453
|
+
const enc = new TextEncoder;
|
|
2454
|
+
const salt = crypto.getRandomValues(new Uint8Array(SALT_LENGTH));
|
|
2455
|
+
const saltB64 = bufToBase64(salt);
|
|
2456
|
+
let key = keyCache.get(saltB64);
|
|
2457
|
+
if (!key) {
|
|
2458
|
+
key = await deriveKey(passphrase, salt);
|
|
2459
|
+
keyCache.set(saltB64, key);
|
|
2460
|
+
}
|
|
2461
|
+
const iv = crypto.getRandomValues(new Uint8Array(12));
|
|
2462
|
+
const rawCiphertext = await crypto.subtle.encrypt({ name: "AES-GCM", iv }, key, enc.encode(plaintext));
|
|
2463
|
+
const ciphertextBytes = new Uint8Array(rawCiphertext);
|
|
2464
|
+
const combined = new Uint8Array(SALT_LENGTH + ciphertextBytes.length);
|
|
2465
|
+
combined.set(salt, 0);
|
|
2466
|
+
combined.set(ciphertextBytes, SALT_LENGTH);
|
|
2467
|
+
return {
|
|
2468
|
+
encrypted: bufToBase64(combined),
|
|
2469
|
+
iv: bufToBase64(iv)
|
|
2470
|
+
};
|
|
2471
|
+
}
|
|
2472
|
+
async function decrypt(encrypted, iv, passphrase, keyCache) {
|
|
2473
|
+
const encryptedBuf = base64ToBuf(encrypted);
|
|
2474
|
+
const salt = encryptedBuf.subarray(0, SALT_LENGTH);
|
|
2475
|
+
const ciphertextBytes = encryptedBuf.subarray(SALT_LENGTH);
|
|
2476
|
+
const saltB64 = bufToBase64(salt);
|
|
2477
|
+
let key = keyCache.get(saltB64);
|
|
2478
|
+
if (!key) {
|
|
2479
|
+
key = await deriveKey(passphrase, salt);
|
|
2480
|
+
keyCache.set(saltB64, key);
|
|
2481
|
+
}
|
|
2482
|
+
const plainBuf = await crypto.subtle.decrypt({ name: "AES-GCM", iv: base64ToBuf(iv) }, key, ciphertextBytes);
|
|
2483
|
+
return new TextDecoder().decode(plainBuf);
|
|
2484
|
+
}
|
|
2485
|
+
function bufToBase64(buf) {
|
|
2486
|
+
let binary = "";
|
|
2487
|
+
for (let i = 0;i < buf.length; i++) {
|
|
2488
|
+
binary += String.fromCharCode(buf[i]);
|
|
2489
|
+
}
|
|
2490
|
+
return btoa(binary);
|
|
2491
|
+
}
|
|
2492
|
+
function base64ToBuf(b64) {
|
|
2493
|
+
const binary = atob(b64);
|
|
2494
|
+
const buf = new Uint8Array(binary.length);
|
|
2495
|
+
for (let i = 0;i < binary.length; i++) {
|
|
2496
|
+
buf[i] = binary.charCodeAt(i);
|
|
2497
|
+
}
|
|
2498
|
+
return buf;
|
|
2499
|
+
}
|
|
1978
2500
|
// src/compress/compress.node.ts
|
|
1979
2501
|
import { promisify } from "util";
|
|
1980
2502
|
import zlib from "zlib";
|
|
@@ -1994,19 +2516,6 @@ async function decompress(input, algorithm = "gzip") {
|
|
|
1994
2516
|
const resultBuffer = await decompressAsyncTyped(sourceBuffer);
|
|
1995
2517
|
return resultBuffer.toString();
|
|
1996
2518
|
}
|
|
1997
|
-
// src/crypto/Crypto.node.ts
|
|
1998
|
-
import { createHash } from "node:crypto";
|
|
1999
|
-
async function sha256(data) {
|
|
2000
|
-
return createHash("sha256").update(data).digest("hex");
|
|
2001
|
-
}
|
|
2002
|
-
async function makeFingerprint(input) {
|
|
2003
|
-
const serializedObj = serialize(input);
|
|
2004
|
-
const hash = await sha256(serializedObj);
|
|
2005
|
-
return hash;
|
|
2006
|
-
}
|
|
2007
|
-
function uuid4() {
|
|
2008
|
-
return crypto.randomUUID();
|
|
2009
|
-
}
|
|
2010
2519
|
// src/mcp/McpClientUtil.node.ts
|
|
2011
2520
|
import { Client } from "@modelcontextprotocol/sdk/client";
|
|
2012
2521
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
@@ -2152,8 +2661,12 @@ export {
|
|
|
2152
2661
|
sortObject,
|
|
2153
2662
|
sleep,
|
|
2154
2663
|
sha256,
|
|
2664
|
+
setLogger,
|
|
2665
|
+
setGlobalCredentialStore,
|
|
2155
2666
|
serialize,
|
|
2667
|
+
resolveCredential,
|
|
2156
2668
|
registerInputResolver,
|
|
2669
|
+
parsePartialJson,
|
|
2157
2670
|
parseDataUri,
|
|
2158
2671
|
parentPort2 as parentPort,
|
|
2159
2672
|
objectOfArraysAsArrayOfObjects,
|
|
@@ -2171,9 +2684,14 @@ export {
|
|
|
2171
2684
|
hammingDistance,
|
|
2172
2685
|
globalServiceRegistry,
|
|
2173
2686
|
globalContainer,
|
|
2687
|
+
getLogger,
|
|
2174
2688
|
getInputResolvers,
|
|
2689
|
+
getGlobalCredentialStore,
|
|
2175
2690
|
forceArray,
|
|
2691
|
+
encrypt,
|
|
2692
|
+
deriveKey,
|
|
2176
2693
|
deepEqual,
|
|
2694
|
+
decrypt,
|
|
2177
2695
|
decompress,
|
|
2178
2696
|
createTypedArrayFrom,
|
|
2179
2697
|
createServiceToken,
|
|
@@ -2183,6 +2701,8 @@ export {
|
|
|
2183
2701
|
compress,
|
|
2184
2702
|
compileSchema,
|
|
2185
2703
|
collectPropertyValues,
|
|
2704
|
+
bufToBase64,
|
|
2705
|
+
base64ToBuf,
|
|
2186
2706
|
areSemanticallyCompatible,
|
|
2187
2707
|
areObjectSchemasSemanticallyCompatible,
|
|
2188
2708
|
WorkerServer,
|
|
@@ -2194,17 +2714,24 @@ export {
|
|
|
2194
2714
|
TensorType,
|
|
2195
2715
|
TensorSchema,
|
|
2196
2716
|
ServiceRegistry,
|
|
2717
|
+
NullLogger,
|
|
2197
2718
|
NodeDoesntExistError,
|
|
2198
2719
|
NodeAlreadyExistsError,
|
|
2720
|
+
LOGGER,
|
|
2721
|
+
InMemoryCredentialStore,
|
|
2199
2722
|
INPUT_RESOLVERS,
|
|
2200
2723
|
Graph,
|
|
2201
2724
|
FromSchemaDefaultOptions,
|
|
2202
2725
|
EventEmitter,
|
|
2726
|
+
EnvCredentialStore,
|
|
2203
2727
|
DirectedGraph,
|
|
2204
2728
|
DirectedAcyclicGraph,
|
|
2205
2729
|
CycleError,
|
|
2206
2730
|
Container,
|
|
2731
|
+
ConsoleLogger,
|
|
2732
|
+
ChainedCredentialStore,
|
|
2733
|
+
CREDENTIAL_STORE,
|
|
2207
2734
|
BaseError
|
|
2208
2735
|
};
|
|
2209
2736
|
|
|
2210
|
-
//# debugId=
|
|
2737
|
+
//# debugId=AA942AD3DE6A9D8664756E2164756E21
|