@valerypopoff/rivet2-core 2.32.0 → 2.34.0
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/cjs/bundle.cjs +180 -66
- package/dist/cjs/bundle.cjs.map +3 -3
- package/dist/cjs/serialization.cjs +29 -3
- package/dist/cjs/serialization.cjs.map +3 -3
- package/dist/esm/model/nodes/HttpCallNode.js +25 -1
- package/dist/esm/recording/ExecutionRecorder.js +131 -48
- package/dist/esm/serialization.js +1 -0
- package/dist/esm/utils/serialization/serialization_v4.js +23 -1
- package/dist/esm/vendor/fnv1a.js +9 -2
- package/dist/types/recording/ExecutionRecorder.d.ts +8 -0
- package/dist/types/serialization.d.ts +1 -0
- package/dist/types/utils/serialization/serialization_v4.d.ts +3 -0
- package/package.json +1 -1
package/dist/cjs/bundle.cjs
CHANGED
|
@@ -5449,6 +5449,7 @@ function fromSerializedNode(serializedNode) {
|
|
|
5449
5449
|
|
|
5450
5450
|
// src/utils/serialization/serialization_v4.ts
|
|
5451
5451
|
var import_lodash_es2 = require("lodash");
|
|
5452
|
+
var import_safe_stable_stringify3 = __toESM(require("safe-stable-stringify"), 1);
|
|
5452
5453
|
|
|
5453
5454
|
// src/model/chat-v2/llmChatV2NodeMigration.ts
|
|
5454
5455
|
function normalizeSerializedLLMTemperatureData(nodeType, data) {
|
|
@@ -5534,6 +5535,9 @@ function graphV4Deserializer(data) {
|
|
|
5534
5535
|
return fromSerializedGraph2(serializedGraph);
|
|
5535
5536
|
}
|
|
5536
5537
|
function projectV4Serializer(project, attachedData) {
|
|
5538
|
+
return wrapInYamlEnvelope(4, prepareSerializedProject(project, attachedData));
|
|
5539
|
+
}
|
|
5540
|
+
function prepareSerializedProject(project, attachedData) {
|
|
5537
5541
|
if (!isValidProjectStaticData(project.data)) {
|
|
5538
5542
|
throw new Error("Project data must be a record of static-data strings");
|
|
5539
5543
|
}
|
|
@@ -5547,7 +5551,7 @@ function projectV4Serializer(project, attachedData) {
|
|
|
5547
5551
|
path: void 0
|
|
5548
5552
|
}
|
|
5549
5553
|
};
|
|
5550
|
-
return
|
|
5554
|
+
return toSerializedProject(filteredProject, attachedData);
|
|
5551
5555
|
}
|
|
5552
5556
|
function graphV4Serializer(graph) {
|
|
5553
5557
|
return wrapInYamlEnvelope(4, toSerializedGraph(graph));
|
|
@@ -6231,12 +6235,12 @@ function parseProviderJsonChunk(provider, chunk) {
|
|
|
6231
6235
|
}
|
|
6232
6236
|
|
|
6233
6237
|
// src/utils/projectComparison/connections.ts
|
|
6234
|
-
var
|
|
6238
|
+
var import_safe_stable_stringify5 = __toESM(require("safe-stable-stringify"), 1);
|
|
6235
6239
|
|
|
6236
6240
|
// src/utils/projectComparison/values.ts
|
|
6237
|
-
var
|
|
6241
|
+
var import_safe_stable_stringify4 = __toESM(require("safe-stable-stringify"), 1);
|
|
6238
6242
|
function areComparisonValuesEqual(left, right) {
|
|
6239
|
-
return (0,
|
|
6243
|
+
return (0, import_safe_stable_stringify4.default)(left) === (0, import_safe_stable_stringify4.default)(right);
|
|
6240
6244
|
}
|
|
6241
6245
|
function getChangedValueComparisons(path, before, after) {
|
|
6242
6246
|
if (areComparisonValuesEqual(before, after)) {
|
|
@@ -6281,7 +6285,7 @@ function formatComparisonPath(path) {
|
|
|
6281
6285
|
|
|
6282
6286
|
// src/utils/projectComparison/connections.ts
|
|
6283
6287
|
function getProjectConnectionComparisonKey(connection) {
|
|
6284
|
-
return (0,
|
|
6288
|
+
return (0, import_safe_stable_stringify5.default)([
|
|
6285
6289
|
connection.outputNodeId,
|
|
6286
6290
|
connection.outputId,
|
|
6287
6291
|
connection.inputNodeId,
|
|
@@ -11553,6 +11557,13 @@ var FNV_OFFSETS = {
|
|
|
11553
11557
|
};
|
|
11554
11558
|
var cachedEncoder = new globalThis.TextEncoder();
|
|
11555
11559
|
function fnv1aUint8Array(uint8Array, size) {
|
|
11560
|
+
if (size === 32) {
|
|
11561
|
+
let hash2 = 2166136261;
|
|
11562
|
+
for (let index = 0; index < uint8Array.length; index++) {
|
|
11563
|
+
hash2 = Math.imul(hash2 ^ uint8Array[index], 16777619);
|
|
11564
|
+
}
|
|
11565
|
+
return BigInt(hash2 >>> 0);
|
|
11566
|
+
}
|
|
11556
11567
|
const fnvPrime = FNV_PRIMES[size];
|
|
11557
11568
|
let hash = FNV_OFFSETS[size];
|
|
11558
11569
|
for (let index = 0; index < uint8Array.length; index++) {
|
|
@@ -11626,7 +11637,16 @@ var toRecordedEventMap = {
|
|
|
11626
11637
|
},
|
|
11627
11638
|
execution
|
|
11628
11639
|
),
|
|
11629
|
-
nodeFinish: ({
|
|
11640
|
+
nodeFinish: ({
|
|
11641
|
+
node,
|
|
11642
|
+
outputs,
|
|
11643
|
+
processId,
|
|
11644
|
+
resultOrigin,
|
|
11645
|
+
durationMs,
|
|
11646
|
+
splitRunDurationMs,
|
|
11647
|
+
streamingWatchTerminal,
|
|
11648
|
+
execution
|
|
11649
|
+
}) => withExecution(
|
|
11630
11650
|
withDuration(
|
|
11631
11651
|
{
|
|
11632
11652
|
nodeId: node.id,
|
|
@@ -11640,7 +11660,17 @@ var toRecordedEventMap = {
|
|
|
11640
11660
|
),
|
|
11641
11661
|
execution
|
|
11642
11662
|
),
|
|
11643
|
-
nodeError: ({
|
|
11663
|
+
nodeError: ({
|
|
11664
|
+
node,
|
|
11665
|
+
error,
|
|
11666
|
+
processId,
|
|
11667
|
+
outputs,
|
|
11668
|
+
splitOutputs,
|
|
11669
|
+
resultOrigin,
|
|
11670
|
+
durationMs,
|
|
11671
|
+
splitRunDurationMs,
|
|
11672
|
+
execution
|
|
11673
|
+
}) => withExecution(
|
|
11644
11674
|
withDuration(
|
|
11645
11675
|
{
|
|
11646
11676
|
nodeId: node.id,
|
|
@@ -11798,18 +11828,17 @@ function mapValuesDeep(obj, fn) {
|
|
|
11798
11828
|
});
|
|
11799
11829
|
}
|
|
11800
11830
|
if ((0, import_lodash_es5.isPlainObject)(obj)) {
|
|
11801
|
-
|
|
11802
|
-
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
})
|
|
11808
|
-
);
|
|
11831
|
+
const entries2 = Object.entries(obj);
|
|
11832
|
+
for (const entry of entries2) {
|
|
11833
|
+
const value = entry[1];
|
|
11834
|
+
entry[1] = (0, import_lodash_es5.isPlainObject)(value) || Array.isArray(value) ? mapValuesDeep(value, fn) : fn(value);
|
|
11835
|
+
}
|
|
11836
|
+
return Object.fromEntries(entries2);
|
|
11809
11837
|
}
|
|
11810
11838
|
return fn(obj);
|
|
11811
11839
|
}
|
|
11812
11840
|
function serializeToObject(recording) {
|
|
11841
|
+
const stringHashes = /* @__PURE__ */ new Map();
|
|
11813
11842
|
const serialized = {
|
|
11814
11843
|
version: 1,
|
|
11815
11844
|
recording,
|
|
@@ -11829,9 +11858,13 @@ function serializeToObject(recording) {
|
|
|
11829
11858
|
return `$ASSET:${id}`;
|
|
11830
11859
|
}
|
|
11831
11860
|
}
|
|
11832
|
-
if (typeof val === "string" && !val.startsWith("$ASSET:")
|
|
11833
|
-
|
|
11834
|
-
|
|
11861
|
+
if (typeof val === "string" && val.length > 30 && !val.startsWith("$ASSET:")) {
|
|
11862
|
+
let hash = stringHashes.get(val);
|
|
11863
|
+
if (hash === void 0) {
|
|
11864
|
+
hash = String(fnv1a(val, { size: 32 }));
|
|
11865
|
+
stringHashes.set(val, hash);
|
|
11866
|
+
}
|
|
11867
|
+
serialized.strings[hash] = val;
|
|
11835
11868
|
return `$STRING:${hash}`;
|
|
11836
11869
|
}
|
|
11837
11870
|
return val;
|
|
@@ -11869,27 +11902,64 @@ var ExecutionRecorder = class _ExecutionRecorder {
|
|
|
11869
11902
|
#emitter;
|
|
11870
11903
|
#includePartialOutputs;
|
|
11871
11904
|
#includeTrace;
|
|
11905
|
+
#capturePolicy;
|
|
11906
|
+
#captureDiscarded = false;
|
|
11872
11907
|
constructor(options2 = {}) {
|
|
11908
|
+
var _a;
|
|
11873
11909
|
this.#emitter = new import_emittery.default();
|
|
11874
11910
|
this.#emitter.bindMethods(this, ["on", "off", "once"]);
|
|
11875
11911
|
this.#includePartialOutputs = options2.includePartialOutputs ?? false;
|
|
11876
11912
|
this.#includeTrace = options2.includeTrace ?? false;
|
|
11913
|
+
try {
|
|
11914
|
+
this.#capturePolicy = (_a = options2.createCapturePolicy) == null ? void 0 : _a.call(options2, this);
|
|
11915
|
+
} catch {
|
|
11916
|
+
this.#captureDiscarded = true;
|
|
11917
|
+
}
|
|
11918
|
+
}
|
|
11919
|
+
get captureDiscarded() {
|
|
11920
|
+
return this.#captureDiscarded;
|
|
11921
|
+
}
|
|
11922
|
+
/** Release replay data, without cancelling the graph or its terminal listener. */
|
|
11923
|
+
discard() {
|
|
11924
|
+
this.#captureDiscarded = true;
|
|
11925
|
+
this.#events.length = 0;
|
|
11926
|
+
const policy = this.#capturePolicy;
|
|
11927
|
+
this.#capturePolicy = void 0;
|
|
11928
|
+
try {
|
|
11929
|
+
policy == null ? void 0 : policy.release();
|
|
11930
|
+
} catch {
|
|
11931
|
+
}
|
|
11932
|
+
}
|
|
11933
|
+
#append(event) {
|
|
11934
|
+
if (this.#captureDiscarded) return;
|
|
11935
|
+
try {
|
|
11936
|
+
if (this.#capturePolicy && !this.#capturePolicy.retain(event)) {
|
|
11937
|
+
this.discard();
|
|
11938
|
+
return;
|
|
11939
|
+
}
|
|
11940
|
+
} catch {
|
|
11941
|
+
this.discard();
|
|
11942
|
+
return;
|
|
11943
|
+
}
|
|
11944
|
+
this.#events.push(event);
|
|
11877
11945
|
}
|
|
11878
11946
|
on = void 0;
|
|
11879
11947
|
off = void 0;
|
|
11880
11948
|
once = void 0;
|
|
11881
11949
|
recordSocket(channel, options2 = {}) {
|
|
11882
|
-
return new Promise((resolve) => {
|
|
11950
|
+
return new Promise((resolve, reject) => {
|
|
11883
11951
|
var _a, _b;
|
|
11884
|
-
this.recordingId = (0, import_non_secure7.nanoid)();
|
|
11885
11952
|
let settled = false;
|
|
11886
|
-
const
|
|
11953
|
+
const detach = () => {
|
|
11887
11954
|
var _a2;
|
|
11888
|
-
if (settled) return;
|
|
11889
|
-
settled = true;
|
|
11890
11955
|
channel.removeEventListener("message", listener);
|
|
11891
11956
|
channel.removeEventListener("close", onClose);
|
|
11892
11957
|
(_a2 = options2.signal) == null ? void 0 : _a2.removeEventListener("abort", onOwnerDisposed);
|
|
11958
|
+
};
|
|
11959
|
+
const finish = (emitFinishedRecording) => {
|
|
11960
|
+
if (settled) return;
|
|
11961
|
+
settled = true;
|
|
11962
|
+
detach();
|
|
11893
11963
|
if (emitFinishedRecording) {
|
|
11894
11964
|
emitDetached(this.#emitter, "finish", {
|
|
11895
11965
|
recording: this.getRecording()
|
|
@@ -11922,57 +11992,80 @@ var ExecutionRecorder = class _ExecutionRecorder {
|
|
|
11922
11992
|
if (getEventProjectScope(data) !== void 0) {
|
|
11923
11993
|
return;
|
|
11924
11994
|
}
|
|
11925
|
-
this.#
|
|
11995
|
+
if (!this.#captureDiscarded) this.#append(toRecordedEvent(message2, data));
|
|
11926
11996
|
if (isSocketRecordingTerminalEvent(message2)) {
|
|
11927
11997
|
finish(true);
|
|
11928
11998
|
}
|
|
11929
11999
|
};
|
|
11930
|
-
|
|
11931
|
-
|
|
11932
|
-
|
|
11933
|
-
|
|
11934
|
-
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
|
|
12000
|
+
try {
|
|
12001
|
+
this.recordingId = (0, import_non_secure7.nanoid)();
|
|
12002
|
+
if ((_a = options2.signal) == null ? void 0 : _a.aborted) {
|
|
12003
|
+
onOwnerDisposed();
|
|
12004
|
+
return;
|
|
12005
|
+
}
|
|
12006
|
+
channel.addEventListener("message", listener);
|
|
12007
|
+
channel.addEventListener("close", onClose, { once: true });
|
|
12008
|
+
(_b = options2.signal) == null ? void 0 : _b.addEventListener("abort", onOwnerDisposed, { once: true });
|
|
12009
|
+
if (channel.readyState === CLOSED_WEBSOCKET_READY_STATE) onClose();
|
|
12010
|
+
} catch (error) {
|
|
12011
|
+
settled = true;
|
|
12012
|
+
try {
|
|
12013
|
+
detach();
|
|
12014
|
+
} catch {
|
|
12015
|
+
}
|
|
12016
|
+
this.discard();
|
|
12017
|
+
reject(error);
|
|
11939
12018
|
}
|
|
11940
12019
|
});
|
|
11941
12020
|
}
|
|
11942
12021
|
record(processor) {
|
|
11943
|
-
|
|
11944
|
-
|
|
12022
|
+
let unsubscribeAny;
|
|
12023
|
+
let unsubscribeFinish;
|
|
11945
12024
|
let settled = false;
|
|
11946
12025
|
const finish = () => {
|
|
11947
12026
|
if (settled) return;
|
|
11948
12027
|
settled = true;
|
|
11949
|
-
unsubscribeAny();
|
|
11950
|
-
unsubscribeFinish();
|
|
12028
|
+
unsubscribeAny == null ? void 0 : unsubscribeAny();
|
|
12029
|
+
unsubscribeFinish == null ? void 0 : unsubscribeFinish();
|
|
11951
12030
|
emitDetached(this.#emitter, "finish", {
|
|
11952
12031
|
recording: this.getRecording()
|
|
11953
12032
|
});
|
|
11954
12033
|
};
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
12034
|
+
try {
|
|
12035
|
+
this.recordingId = (0, import_non_secure7.nanoid)();
|
|
12036
|
+
const recordingProjectScope = processor.recordingProjectScope;
|
|
12037
|
+
unsubscribeAny = processor.onAny((event, data) => {
|
|
12038
|
+
if (settled || event === "finish") {
|
|
12039
|
+
return;
|
|
12040
|
+
}
|
|
12041
|
+
if (this.#includePartialOutputs === false && event === "partialOutput") {
|
|
12042
|
+
return;
|
|
12043
|
+
}
|
|
12044
|
+
if (this.#includeTrace === false && event === "trace") {
|
|
12045
|
+
return;
|
|
12046
|
+
}
|
|
12047
|
+
const eventScope = getEventProjectScope(data);
|
|
12048
|
+
if (eventScope !== void 0 && eventScope !== recordingProjectScope) {
|
|
12049
|
+
return;
|
|
12050
|
+
}
|
|
12051
|
+
if (!this.#captureDiscarded) this.#append(toRecordedEvent(event, data));
|
|
12052
|
+
});
|
|
12053
|
+
unsubscribeFinish = processor.on("finish", finish);
|
|
12054
|
+
} catch (error) {
|
|
12055
|
+
settled = true;
|
|
12056
|
+
try {
|
|
12057
|
+
unsubscribeAny == null ? void 0 : unsubscribeAny();
|
|
12058
|
+
} catch {
|
|
11968
12059
|
}
|
|
11969
|
-
this
|
|
11970
|
-
|
|
11971
|
-
|
|
12060
|
+
this.discard();
|
|
12061
|
+
throw error;
|
|
12062
|
+
}
|
|
11972
12063
|
return (terminal) => {
|
|
11973
12064
|
if (settled) return;
|
|
11974
|
-
if ((terminal == null ? void 0 : terminal.type) === "done")
|
|
11975
|
-
|
|
12065
|
+
if (!this.#captureDiscarded && (terminal == null ? void 0 : terminal.type) === "done")
|
|
12066
|
+
this.#append(toRecordedEvent("done", { results: terminal.results }));
|
|
12067
|
+
if (!this.#captureDiscarded && (terminal == null ? void 0 : terminal.type) === "error")
|
|
12068
|
+
this.#append(toRecordedEvent("error", { error: terminal.error }));
|
|
11976
12069
|
finish();
|
|
11977
12070
|
};
|
|
11978
12071
|
}
|
|
@@ -12011,9 +12104,11 @@ var ExecutionRecorder = class _ExecutionRecorder {
|
|
|
12011
12104
|
return recorder;
|
|
12012
12105
|
}
|
|
12013
12106
|
serialize() {
|
|
12107
|
+
if (this.#captureDiscarded) throw new Error("Recording capture is unavailable.");
|
|
12014
12108
|
return JSON.stringify(serializeToObject(this.getRecording()));
|
|
12015
12109
|
}
|
|
12016
12110
|
serializeStream() {
|
|
12111
|
+
if (this.#captureDiscarded) throw new Error("Recording capture is unavailable.");
|
|
12017
12112
|
return (0, import_json_stream_es.stringifyJsonStream)(serializeToObject(this.getRecording()));
|
|
12018
12113
|
}
|
|
12019
12114
|
};
|
|
@@ -22992,9 +23087,9 @@ function audioFormatToMediaType(format) {
|
|
|
22992
23087
|
|
|
22993
23088
|
// src/model/LegacyChatEditorCache.ts
|
|
22994
23089
|
var import_crypto_js2 = __toESM(require("crypto-js"), 1);
|
|
22995
|
-
var
|
|
23090
|
+
var import_safe_stable_stringify6 = __toESM(require("safe-stable-stringify"), 1);
|
|
22996
23091
|
function buildLegacyChatEditorCacheKey(parts) {
|
|
22997
|
-
const serialized = (0,
|
|
23092
|
+
const serialized = (0, import_safe_stable_stringify6.default)({ cacheVersion: 1, ...parts }) ?? "";
|
|
22998
23093
|
return `legacy-chat:v1:sha256:${import_crypto_js2.default.SHA256(serialized).toString(import_crypto_js2.default.enc.Hex)}`;
|
|
22999
23094
|
}
|
|
23000
23095
|
function resolveLegacyChatEditorCache(params) {
|
|
@@ -29397,11 +29492,11 @@ function getLLMChatV2EditorCacheEligibility(data) {
|
|
|
29397
29492
|
}
|
|
29398
29493
|
|
|
29399
29494
|
// src/model/chat-v2/chatV2EditorCache.ts
|
|
29400
|
-
var
|
|
29495
|
+
var import_safe_stable_stringify7 = __toESM(require("safe-stable-stringify"), 1);
|
|
29401
29496
|
var import_crypto_js3 = __toESM(require("crypto-js"), 1);
|
|
29402
29497
|
function buildLLMChatV2EditorCacheKey(parts) {
|
|
29403
29498
|
const { cacheVersion = 3, ...keyParts } = parts;
|
|
29404
|
-
return (0,
|
|
29499
|
+
return (0, import_safe_stable_stringify7.default)({ cacheVersion, ...keyParts }) ?? "";
|
|
29405
29500
|
}
|
|
29406
29501
|
function cloneLLMChatV2EditorCacheOutputs(outputs) {
|
|
29407
29502
|
return cloneExecutionOutputs(outputs);
|
|
@@ -29434,7 +29529,7 @@ function fingerprintCustomProviderBaseURL(value) {
|
|
|
29434
29529
|
}
|
|
29435
29530
|
try {
|
|
29436
29531
|
const endpoint = normalizeOpenAICompatibleEndpoint(value);
|
|
29437
|
-
return (0,
|
|
29532
|
+
return (0, import_safe_stable_stringify7.default)({
|
|
29438
29533
|
baseURL: endpoint.baseURL,
|
|
29439
29534
|
endpointQuery: endpoint.endpointQuery.map(([key, queryValue]) => [key, fingerprintSecret(queryValue) ?? ""])
|
|
29440
29535
|
}) ?? "";
|
|
@@ -29462,7 +29557,7 @@ function fingerprintRuntimeValueForCache(value) {
|
|
|
29462
29557
|
if (value == null) {
|
|
29463
29558
|
return void 0;
|
|
29464
29559
|
}
|
|
29465
|
-
return fingerprintSecret((0,
|
|
29560
|
+
return fingerprintSecret((0, import_safe_stable_stringify7.default)(value) ?? "");
|
|
29466
29561
|
}
|
|
29467
29562
|
function fingerprintProfileChainForCache(data, profiles) {
|
|
29468
29563
|
if (profiles == null) {
|
|
@@ -40166,6 +40261,18 @@ var HttpCallNodeImpl = class extends NodeImpl {
|
|
|
40166
40261
|
async process(inputs, context) {
|
|
40167
40262
|
var _a, _b;
|
|
40168
40263
|
const requestAttempts = this.data.retryOnNon200 ? createHttpCallRequestAttempts() : void 0;
|
|
40264
|
+
let ownedResponse;
|
|
40265
|
+
const discardResponse = () => {
|
|
40266
|
+
const response = ownedResponse;
|
|
40267
|
+
ownedResponse = void 0;
|
|
40268
|
+
try {
|
|
40269
|
+
const body = response == null ? void 0 : response.body;
|
|
40270
|
+
if (body && !body.locked) {
|
|
40271
|
+
void body.cancel().catch(() => void 0);
|
|
40272
|
+
}
|
|
40273
|
+
} catch {
|
|
40274
|
+
}
|
|
40275
|
+
};
|
|
40169
40276
|
try {
|
|
40170
40277
|
const method = getInputOrData(this.data, inputs, "method", "string");
|
|
40171
40278
|
const url = getInputOrData(this.data, inputs, "url", "string");
|
|
@@ -40202,13 +40309,15 @@ var HttpCallNodeImpl = class extends NodeImpl {
|
|
|
40202
40309
|
}
|
|
40203
40310
|
const performRequest = async () => {
|
|
40204
40311
|
try {
|
|
40205
|
-
|
|
40312
|
+
const response2 = await fetch(url, {
|
|
40206
40313
|
method,
|
|
40207
40314
|
headers,
|
|
40208
40315
|
body,
|
|
40209
40316
|
signal: context.signal,
|
|
40210
40317
|
mode: "cors"
|
|
40211
40318
|
});
|
|
40319
|
+
ownedResponse = response2;
|
|
40320
|
+
return response2;
|
|
40212
40321
|
} catch (err) {
|
|
40213
40322
|
if (isAbortError(err, context.signal)) {
|
|
40214
40323
|
throw err;
|
|
@@ -40238,6 +40347,7 @@ var HttpCallNodeImpl = class extends NodeImpl {
|
|
|
40238
40347
|
const repeatTimes = normalizeHttpRetryCount(this.data.retryOnNon200RepeatTimes);
|
|
40239
40348
|
const cooldownMs = normalizeHttpRetryCooldownMs(this.data.retryOnNon200CooldownMs);
|
|
40240
40349
|
for (let attempt = 0; response.status !== 200 && attempt < repeatTimes; attempt++) {
|
|
40350
|
+
discardResponse();
|
|
40241
40351
|
await waitForRetryCooldown(cooldownMs, context.signal);
|
|
40242
40352
|
response = await performTrackedRequest();
|
|
40243
40353
|
}
|
|
@@ -40256,12 +40366,14 @@ var HttpCallNodeImpl = class extends NodeImpl {
|
|
|
40256
40366
|
const output = responseMetadataOutputs;
|
|
40257
40367
|
if (this.data.isBinaryOutput) {
|
|
40258
40368
|
const responseBlob = await response.blob();
|
|
40369
|
+
ownedResponse = void 0;
|
|
40259
40370
|
output["binary"] = {
|
|
40260
40371
|
type: "binary",
|
|
40261
40372
|
value: new Uint8Array(await responseBlob.arrayBuffer())
|
|
40262
40373
|
};
|
|
40263
40374
|
} else {
|
|
40264
40375
|
const responseText = await response.text();
|
|
40376
|
+
ownedResponse = void 0;
|
|
40265
40377
|
output["res_body"] = {
|
|
40266
40378
|
type: "string",
|
|
40267
40379
|
value: responseText
|
|
@@ -40300,6 +40412,8 @@ var HttpCallNodeImpl = class extends NodeImpl {
|
|
|
40300
40412
|
});
|
|
40301
40413
|
}
|
|
40302
40414
|
throw error;
|
|
40415
|
+
} finally {
|
|
40416
|
+
discardResponse();
|
|
40303
40417
|
}
|
|
40304
40418
|
}
|
|
40305
40419
|
};
|
|
@@ -47042,7 +47156,7 @@ function getRetryDelayMs(retryAfter, attempt, deadline) {
|
|
|
47042
47156
|
|
|
47043
47157
|
// src/model/classifier/profile.ts
|
|
47044
47158
|
var import_crypto_js4 = __toESM(require("crypto-js"), 1);
|
|
47045
|
-
var
|
|
47159
|
+
var import_safe_stable_stringify8 = __toESM(require("safe-stable-stringify"), 1);
|
|
47046
47160
|
var DEFAULT_CLASSIFIER_PROFILE_RESPONSE_TIMEOUT_MS = 500;
|
|
47047
47161
|
var DEFAULT_CLASSIFIER_PROFILE_FAILURE_THRESHOLD = 3;
|
|
47048
47162
|
var DEFAULT_CLASSIFIER_PROFILE_FAILURE_WINDOW_MS = 3e5;
|
|
@@ -47179,7 +47293,7 @@ function resolveClassifierProfile(data, inputs, context) {
|
|
|
47179
47293
|
});
|
|
47180
47294
|
}
|
|
47181
47295
|
function classifierProfileHealthIdentity(profile, projectId, fallbackNodeId) {
|
|
47182
|
-
const hash = (value) => `sha256:${import_crypto_js4.default.SHA256((0,
|
|
47296
|
+
const hash = (value) => `sha256:${import_crypto_js4.default.SHA256((0, import_safe_stable_stringify8.default)(value) ?? "").toString(import_crypto_js4.default.enc.Hex)}`;
|
|
47183
47297
|
const configurationFingerprint = hash({
|
|
47184
47298
|
provider: profile.configuration.provider,
|
|
47185
47299
|
model: profile.configuration.model,
|
|
@@ -48839,7 +48953,7 @@ registerIntegration("embeddingGenerator", "openai", (context) => new OpenAIEmbed
|
|
|
48839
48953
|
|
|
48840
48954
|
// src/integrations/ManagedKnowledgeStore.ts
|
|
48841
48955
|
var import_crypto_js5 = __toESM(require("crypto-js"), 1);
|
|
48842
|
-
var
|
|
48956
|
+
var import_safe_stable_stringify9 = __toESM(require("safe-stable-stringify"), 1);
|
|
48843
48957
|
var MANAGED_SCHEMA_VERSION = "1";
|
|
48844
48958
|
var CHUNKER_VERSION = "1";
|
|
48845
48959
|
var ManagedKnowledgeStore = class {
|
|
@@ -49141,7 +49255,7 @@ async function waitForPromiseOrAbort(promise, signal) {
|
|
|
49141
49255
|
});
|
|
49142
49256
|
}
|
|
49143
49257
|
function createSourceVersion(documents, metadata, chunking) {
|
|
49144
|
-
const canonical = (0,
|
|
49258
|
+
const canonical = (0, import_safe_stable_stringify9.default)({
|
|
49145
49259
|
schemaVersion: MANAGED_SCHEMA_VERSION,
|
|
49146
49260
|
chunkerVersion: CHUNKER_VERSION,
|
|
49147
49261
|
documents,
|