@anuma/sdk 3.0.0 → 3.1.1
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/expo/{chunk-IY7NNIYM.mjs → chunk-IP2B74KE.mjs} +30 -866
- package/dist/expo/index.cjs +1658 -1070
- package/dist/expo/index.d.mts +179 -10
- package/dist/expo/index.d.ts +179 -10
- package/dist/expo/index.mjs +1563 -77
- package/dist/expo/{recall-DJ5LD5WJ.mjs → recall-NSSIYFNY.mjs} +1 -1
- package/dist/index.cjs +415 -394
- package/dist/index.mjs +412 -391
- package/dist/react/{chunk-OSDVRDLI.mjs → chunk-XVC7DWDN.mjs} +22 -1003
- package/dist/react/index.cjs +1702 -1731
- package/dist/react/index.d.mts +103 -12
- package/dist/react/index.d.ts +103 -12
- package/dist/react/index.mjs +1216 -228
- package/dist/react/{recall-3BDCIEQF.mjs → recall-VDP3H3QT.mjs} +1 -1
- package/dist/server/{chunk-QQOIC37O.mjs → chunk-4GKKHVF7.mjs} +21 -833
- package/dist/server/index.cjs +244 -966
- package/dist/server/index.d.mts +95 -12
- package/dist/server/index.d.ts +95 -12
- package/dist/server/index.mjs +189 -32
- package/dist/server/{recall-6QLUEYB7.mjs → recall-KYSR3XZJ.mjs} +1 -1
- package/dist/tools/selection/chunk-4ETHWSXJ.mjs +25 -0
- package/dist/tools/selection/clientConfig-WITO4T6L.mjs +12 -0
- package/dist/tools/selection/index.cjs +1977 -0
- package/dist/tools/selection/index.d.mts +1380 -0
- package/dist/tools/selection/index.d.ts +1380 -0
- package/dist/tools/selection/index.mjs +1859 -0
- package/package.json +8 -1
package/dist/server/index.cjs
CHANGED
|
@@ -17509,27 +17509,25 @@ async function stampTopicsExtractedAtOp(ctx, memoryIds, extractedAt, version = T
|
|
|
17509
17509
|
for (let i = 0; i < uniqueIds.length; i += CHUNK) {
|
|
17510
17510
|
const chunkIds = uniqueIds.slice(i, i + CHUNK);
|
|
17511
17511
|
await ctx.database.write(async () => {
|
|
17512
|
-
const
|
|
17512
|
+
const records = [];
|
|
17513
17513
|
for (const id of chunkIds) {
|
|
17514
|
-
let record;
|
|
17515
17514
|
try {
|
|
17516
|
-
|
|
17515
|
+
records.push(await ctx.vaultMemoryCollection.find(id));
|
|
17517
17516
|
} catch {
|
|
17518
|
-
continue;
|
|
17519
|
-
}
|
|
17520
|
-
if (record.isDeleted || !isOwnedByCtxUser(ctx, record) || record.topicsUserManaged) {
|
|
17521
|
-
continue;
|
|
17522
17517
|
}
|
|
17523
|
-
const originalUpdatedAt = record.updatedAt.getTime();
|
|
17524
|
-
prepared.push(
|
|
17525
|
-
record.prepareUpdate((r) => {
|
|
17526
|
-
r._setRaw("topics_extracted_at", extractedAt);
|
|
17527
|
-
r._setRaw("topics_extracted_version", version);
|
|
17528
|
-
r._setRaw("updated_at", originalUpdatedAt);
|
|
17529
|
-
})
|
|
17530
|
-
);
|
|
17531
|
-
stamped.push(id);
|
|
17532
17518
|
}
|
|
17519
|
+
const eligible = records.filter(
|
|
17520
|
+
(record) => !record.isDeleted && isOwnedByCtxUser(ctx, record) && !record.topicsUserManaged
|
|
17521
|
+
);
|
|
17522
|
+
const prepared = eligible.map((record) => {
|
|
17523
|
+
const originalUpdatedAt = record.updatedAt.getTime();
|
|
17524
|
+
return record.prepareUpdate((r) => {
|
|
17525
|
+
r._setRaw("topics_extracted_at", extractedAt);
|
|
17526
|
+
r._setRaw("topics_extracted_version", version);
|
|
17527
|
+
r._setRaw("updated_at", originalUpdatedAt);
|
|
17528
|
+
});
|
|
17529
|
+
});
|
|
17530
|
+
for (const record of eligible) stamped.push(record.id);
|
|
17533
17531
|
if (prepared.length > 0) await ctx.database.batch(...prepared);
|
|
17534
17532
|
});
|
|
17535
17533
|
}
|
|
@@ -17729,896 +17727,6 @@ var init_chunking = __esm({
|
|
|
17729
17727
|
}
|
|
17730
17728
|
});
|
|
17731
17729
|
|
|
17732
|
-
// src/client/core/bodySerializer.gen.ts
|
|
17733
|
-
var jsonBodySerializer;
|
|
17734
|
-
var init_bodySerializer_gen = __esm({
|
|
17735
|
-
"src/client/core/bodySerializer.gen.ts"() {
|
|
17736
|
-
"use strict";
|
|
17737
|
-
jsonBodySerializer = {
|
|
17738
|
-
bodySerializer: (body) => JSON.stringify(
|
|
17739
|
-
body,
|
|
17740
|
-
(_key, value) => typeof value === "bigint" ? value.toString() : value
|
|
17741
|
-
)
|
|
17742
|
-
};
|
|
17743
|
-
}
|
|
17744
|
-
});
|
|
17745
|
-
|
|
17746
|
-
// src/client/core/serverSentEvents.gen.ts
|
|
17747
|
-
var createSseClient;
|
|
17748
|
-
var init_serverSentEvents_gen = __esm({
|
|
17749
|
-
"src/client/core/serverSentEvents.gen.ts"() {
|
|
17750
|
-
"use strict";
|
|
17751
|
-
createSseClient = ({
|
|
17752
|
-
onRequest,
|
|
17753
|
-
onSseError,
|
|
17754
|
-
onSseEvent,
|
|
17755
|
-
responseTransformer,
|
|
17756
|
-
responseValidator,
|
|
17757
|
-
sseDefaultRetryDelay,
|
|
17758
|
-
sseMaxRetryAttempts,
|
|
17759
|
-
sseMaxRetryDelay,
|
|
17760
|
-
sseSleepFn,
|
|
17761
|
-
url,
|
|
17762
|
-
...options
|
|
17763
|
-
}) => {
|
|
17764
|
-
let lastEventId;
|
|
17765
|
-
const sleep4 = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
17766
|
-
const createStream = async function* () {
|
|
17767
|
-
let retryDelay = sseDefaultRetryDelay ?? 3e3;
|
|
17768
|
-
let attempt = 0;
|
|
17769
|
-
const signal = options.signal ?? new AbortController().signal;
|
|
17770
|
-
while (true) {
|
|
17771
|
-
if (signal.aborted) break;
|
|
17772
|
-
attempt++;
|
|
17773
|
-
const headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
|
|
17774
|
-
if (lastEventId !== void 0) {
|
|
17775
|
-
headers.set("Last-Event-ID", lastEventId);
|
|
17776
|
-
}
|
|
17777
|
-
try {
|
|
17778
|
-
const requestInit = {
|
|
17779
|
-
redirect: "follow",
|
|
17780
|
-
...options,
|
|
17781
|
-
body: options.serializedBody,
|
|
17782
|
-
headers,
|
|
17783
|
-
signal
|
|
17784
|
-
};
|
|
17785
|
-
let request = new Request(url, requestInit);
|
|
17786
|
-
if (onRequest) {
|
|
17787
|
-
request = await onRequest(url, requestInit);
|
|
17788
|
-
}
|
|
17789
|
-
const _fetch = options.fetch ?? globalThis.fetch;
|
|
17790
|
-
const response = await _fetch(request);
|
|
17791
|
-
if (!response.ok)
|
|
17792
|
-
throw new Error(
|
|
17793
|
-
`SSE failed: ${response.status} ${response.statusText}`
|
|
17794
|
-
);
|
|
17795
|
-
if (!response.body) throw new Error("No body in SSE response");
|
|
17796
|
-
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
17797
|
-
let buffer = "";
|
|
17798
|
-
const abortHandler = () => {
|
|
17799
|
-
try {
|
|
17800
|
-
reader.cancel();
|
|
17801
|
-
} catch {
|
|
17802
|
-
}
|
|
17803
|
-
};
|
|
17804
|
-
signal.addEventListener("abort", abortHandler);
|
|
17805
|
-
try {
|
|
17806
|
-
while (true) {
|
|
17807
|
-
const { done, value } = await reader.read();
|
|
17808
|
-
if (done) break;
|
|
17809
|
-
buffer += value;
|
|
17810
|
-
const chunks = buffer.split("\n\n");
|
|
17811
|
-
buffer = chunks.pop() ?? "";
|
|
17812
|
-
for (const chunk of chunks) {
|
|
17813
|
-
const lines = chunk.split("\n");
|
|
17814
|
-
const dataLines = [];
|
|
17815
|
-
let eventName;
|
|
17816
|
-
for (const line of lines) {
|
|
17817
|
-
if (line.startsWith("data:")) {
|
|
17818
|
-
dataLines.push(line.replace(/^data:\s*/, ""));
|
|
17819
|
-
} else if (line.startsWith("event:")) {
|
|
17820
|
-
eventName = line.replace(/^event:\s*/, "");
|
|
17821
|
-
} else if (line.startsWith("id:")) {
|
|
17822
|
-
lastEventId = line.replace(/^id:\s*/, "");
|
|
17823
|
-
} else if (line.startsWith("retry:")) {
|
|
17824
|
-
const parsed = Number.parseInt(
|
|
17825
|
-
line.replace(/^retry:\s*/, ""),
|
|
17826
|
-
10
|
|
17827
|
-
);
|
|
17828
|
-
if (!Number.isNaN(parsed)) {
|
|
17829
|
-
retryDelay = parsed;
|
|
17830
|
-
}
|
|
17831
|
-
}
|
|
17832
|
-
}
|
|
17833
|
-
let data;
|
|
17834
|
-
let parsedJson = false;
|
|
17835
|
-
if (dataLines.length) {
|
|
17836
|
-
const rawData = dataLines.join("\n");
|
|
17837
|
-
try {
|
|
17838
|
-
data = JSON.parse(rawData);
|
|
17839
|
-
parsedJson = true;
|
|
17840
|
-
} catch {
|
|
17841
|
-
data = rawData;
|
|
17842
|
-
}
|
|
17843
|
-
}
|
|
17844
|
-
if (parsedJson) {
|
|
17845
|
-
if (responseValidator) {
|
|
17846
|
-
await responseValidator(data);
|
|
17847
|
-
}
|
|
17848
|
-
if (responseTransformer) {
|
|
17849
|
-
data = await responseTransformer(data);
|
|
17850
|
-
}
|
|
17851
|
-
}
|
|
17852
|
-
onSseEvent?.({
|
|
17853
|
-
data,
|
|
17854
|
-
event: eventName,
|
|
17855
|
-
id: lastEventId,
|
|
17856
|
-
retry: retryDelay
|
|
17857
|
-
});
|
|
17858
|
-
if (dataLines.length) {
|
|
17859
|
-
yield data;
|
|
17860
|
-
}
|
|
17861
|
-
}
|
|
17862
|
-
}
|
|
17863
|
-
} finally {
|
|
17864
|
-
signal.removeEventListener("abort", abortHandler);
|
|
17865
|
-
reader.releaseLock();
|
|
17866
|
-
}
|
|
17867
|
-
break;
|
|
17868
|
-
} catch (error) {
|
|
17869
|
-
onSseError?.(error);
|
|
17870
|
-
if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
|
|
17871
|
-
break;
|
|
17872
|
-
}
|
|
17873
|
-
const backoff = Math.min(
|
|
17874
|
-
retryDelay * 2 ** (attempt - 1),
|
|
17875
|
-
sseMaxRetryDelay ?? 3e4
|
|
17876
|
-
);
|
|
17877
|
-
await sleep4(backoff);
|
|
17878
|
-
}
|
|
17879
|
-
}
|
|
17880
|
-
};
|
|
17881
|
-
const stream = createStream();
|
|
17882
|
-
return { stream };
|
|
17883
|
-
};
|
|
17884
|
-
}
|
|
17885
|
-
});
|
|
17886
|
-
|
|
17887
|
-
// src/client/core/pathSerializer.gen.ts
|
|
17888
|
-
var separatorArrayExplode, separatorArrayNoExplode, separatorObjectExplode, serializeArrayParam, serializePrimitiveParam, serializeObjectParam;
|
|
17889
|
-
var init_pathSerializer_gen = __esm({
|
|
17890
|
-
"src/client/core/pathSerializer.gen.ts"() {
|
|
17891
|
-
"use strict";
|
|
17892
|
-
separatorArrayExplode = (style) => {
|
|
17893
|
-
switch (style) {
|
|
17894
|
-
case "label":
|
|
17895
|
-
return ".";
|
|
17896
|
-
case "matrix":
|
|
17897
|
-
return ";";
|
|
17898
|
-
case "simple":
|
|
17899
|
-
return ",";
|
|
17900
|
-
default:
|
|
17901
|
-
return "&";
|
|
17902
|
-
}
|
|
17903
|
-
};
|
|
17904
|
-
separatorArrayNoExplode = (style) => {
|
|
17905
|
-
switch (style) {
|
|
17906
|
-
case "form":
|
|
17907
|
-
return ",";
|
|
17908
|
-
case "pipeDelimited":
|
|
17909
|
-
return "|";
|
|
17910
|
-
case "spaceDelimited":
|
|
17911
|
-
return "%20";
|
|
17912
|
-
default:
|
|
17913
|
-
return ",";
|
|
17914
|
-
}
|
|
17915
|
-
};
|
|
17916
|
-
separatorObjectExplode = (style) => {
|
|
17917
|
-
switch (style) {
|
|
17918
|
-
case "label":
|
|
17919
|
-
return ".";
|
|
17920
|
-
case "matrix":
|
|
17921
|
-
return ";";
|
|
17922
|
-
case "simple":
|
|
17923
|
-
return ",";
|
|
17924
|
-
default:
|
|
17925
|
-
return "&";
|
|
17926
|
-
}
|
|
17927
|
-
};
|
|
17928
|
-
serializeArrayParam = ({
|
|
17929
|
-
allowReserved,
|
|
17930
|
-
explode,
|
|
17931
|
-
name,
|
|
17932
|
-
style,
|
|
17933
|
-
value
|
|
17934
|
-
}) => {
|
|
17935
|
-
if (!explode) {
|
|
17936
|
-
const joinedValues2 = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
|
|
17937
|
-
switch (style) {
|
|
17938
|
-
case "label":
|
|
17939
|
-
return `.${joinedValues2}`;
|
|
17940
|
-
case "matrix":
|
|
17941
|
-
return `;${name}=${joinedValues2}`;
|
|
17942
|
-
case "simple":
|
|
17943
|
-
return joinedValues2;
|
|
17944
|
-
default:
|
|
17945
|
-
return `${name}=${joinedValues2}`;
|
|
17946
|
-
}
|
|
17947
|
-
}
|
|
17948
|
-
const separator = separatorArrayExplode(style);
|
|
17949
|
-
const joinedValues = value.map((v) => {
|
|
17950
|
-
if (style === "label" || style === "simple") {
|
|
17951
|
-
return allowReserved ? v : encodeURIComponent(v);
|
|
17952
|
-
}
|
|
17953
|
-
return serializePrimitiveParam({
|
|
17954
|
-
allowReserved,
|
|
17955
|
-
name,
|
|
17956
|
-
value: v
|
|
17957
|
-
});
|
|
17958
|
-
}).join(separator);
|
|
17959
|
-
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
17960
|
-
};
|
|
17961
|
-
serializePrimitiveParam = ({
|
|
17962
|
-
allowReserved,
|
|
17963
|
-
name,
|
|
17964
|
-
value
|
|
17965
|
-
}) => {
|
|
17966
|
-
if (value === void 0 || value === null) {
|
|
17967
|
-
return "";
|
|
17968
|
-
}
|
|
17969
|
-
if (typeof value === "object") {
|
|
17970
|
-
throw new Error(
|
|
17971
|
-
"Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these."
|
|
17972
|
-
);
|
|
17973
|
-
}
|
|
17974
|
-
return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
|
|
17975
|
-
};
|
|
17976
|
-
serializeObjectParam = ({
|
|
17977
|
-
allowReserved,
|
|
17978
|
-
explode,
|
|
17979
|
-
name,
|
|
17980
|
-
style,
|
|
17981
|
-
value,
|
|
17982
|
-
valueOnly
|
|
17983
|
-
}) => {
|
|
17984
|
-
if (value instanceof Date) {
|
|
17985
|
-
return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
|
|
17986
|
-
}
|
|
17987
|
-
if (style !== "deepObject" && !explode) {
|
|
17988
|
-
let values = [];
|
|
17989
|
-
Object.entries(value).forEach(([key, v]) => {
|
|
17990
|
-
values = [
|
|
17991
|
-
...values,
|
|
17992
|
-
key,
|
|
17993
|
-
allowReserved ? v : encodeURIComponent(v)
|
|
17994
|
-
];
|
|
17995
|
-
});
|
|
17996
|
-
const joinedValues2 = values.join(",");
|
|
17997
|
-
switch (style) {
|
|
17998
|
-
case "form":
|
|
17999
|
-
return `${name}=${joinedValues2}`;
|
|
18000
|
-
case "label":
|
|
18001
|
-
return `.${joinedValues2}`;
|
|
18002
|
-
case "matrix":
|
|
18003
|
-
return `;${name}=${joinedValues2}`;
|
|
18004
|
-
default:
|
|
18005
|
-
return joinedValues2;
|
|
18006
|
-
}
|
|
18007
|
-
}
|
|
18008
|
-
const separator = separatorObjectExplode(style);
|
|
18009
|
-
const joinedValues = Object.entries(value).map(
|
|
18010
|
-
([key, v]) => serializePrimitiveParam({
|
|
18011
|
-
allowReserved,
|
|
18012
|
-
name: style === "deepObject" ? `${name}[${key}]` : key,
|
|
18013
|
-
value: v
|
|
18014
|
-
})
|
|
18015
|
-
).join(separator);
|
|
18016
|
-
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
18017
|
-
};
|
|
18018
|
-
}
|
|
18019
|
-
});
|
|
18020
|
-
|
|
18021
|
-
// src/client/core/utils.gen.ts
|
|
18022
|
-
function getValidRequestBody(options) {
|
|
18023
|
-
const hasBody = options.body !== void 0;
|
|
18024
|
-
const isSerializedBody = hasBody && options.bodySerializer;
|
|
18025
|
-
if (isSerializedBody) {
|
|
18026
|
-
if ("serializedBody" in options) {
|
|
18027
|
-
const hasSerializedBody = options.serializedBody !== void 0 && options.serializedBody !== "";
|
|
18028
|
-
return hasSerializedBody ? options.serializedBody : null;
|
|
18029
|
-
}
|
|
18030
|
-
return options.body !== "" ? options.body : null;
|
|
18031
|
-
}
|
|
18032
|
-
if (hasBody) {
|
|
18033
|
-
return options.body;
|
|
18034
|
-
}
|
|
18035
|
-
return void 0;
|
|
18036
|
-
}
|
|
18037
|
-
var init_utils_gen = __esm({
|
|
18038
|
-
"src/client/core/utils.gen.ts"() {
|
|
18039
|
-
"use strict";
|
|
18040
|
-
}
|
|
18041
|
-
});
|
|
18042
|
-
|
|
18043
|
-
// src/client/core/auth.gen.ts
|
|
18044
|
-
var getAuthToken;
|
|
18045
|
-
var init_auth_gen = __esm({
|
|
18046
|
-
"src/client/core/auth.gen.ts"() {
|
|
18047
|
-
"use strict";
|
|
18048
|
-
getAuthToken = async (auth, callback) => {
|
|
18049
|
-
const token = typeof callback === "function" ? await callback(auth) : callback;
|
|
18050
|
-
if (!token) {
|
|
18051
|
-
return;
|
|
18052
|
-
}
|
|
18053
|
-
if (auth.scheme === "bearer") {
|
|
18054
|
-
return `Bearer ${token}`;
|
|
18055
|
-
}
|
|
18056
|
-
if (auth.scheme === "basic") {
|
|
18057
|
-
return `Basic ${btoa(token)}`;
|
|
18058
|
-
}
|
|
18059
|
-
return token;
|
|
18060
|
-
};
|
|
18061
|
-
}
|
|
18062
|
-
});
|
|
18063
|
-
|
|
18064
|
-
// src/client/client/utils.gen.ts
|
|
18065
|
-
var PATH_PARAM_RE, defaultPathSerializer, createQuerySerializer, getParseAs, checkForExistence, setAuthParams, buildUrl, getUrl, mergeConfigs, headersEntries, mergeHeaders, Interceptors, createInterceptors, defaultQuerySerializer, defaultHeaders, createConfig;
|
|
18066
|
-
var init_utils_gen2 = __esm({
|
|
18067
|
-
"src/client/client/utils.gen.ts"() {
|
|
18068
|
-
"use strict";
|
|
18069
|
-
init_auth_gen();
|
|
18070
|
-
init_bodySerializer_gen();
|
|
18071
|
-
init_pathSerializer_gen();
|
|
18072
|
-
PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
18073
|
-
defaultPathSerializer = ({ path, url: _url }) => {
|
|
18074
|
-
let url = _url;
|
|
18075
|
-
const matches = _url.match(PATH_PARAM_RE);
|
|
18076
|
-
if (matches) {
|
|
18077
|
-
for (const match of matches) {
|
|
18078
|
-
let explode = false;
|
|
18079
|
-
let name = match.substring(1, match.length - 1);
|
|
18080
|
-
let style = "simple";
|
|
18081
|
-
if (name.endsWith("*")) {
|
|
18082
|
-
explode = true;
|
|
18083
|
-
name = name.substring(0, name.length - 1);
|
|
18084
|
-
}
|
|
18085
|
-
if (name.startsWith(".")) {
|
|
18086
|
-
name = name.substring(1);
|
|
18087
|
-
style = "label";
|
|
18088
|
-
} else if (name.startsWith(";")) {
|
|
18089
|
-
name = name.substring(1);
|
|
18090
|
-
style = "matrix";
|
|
18091
|
-
}
|
|
18092
|
-
const value = path[name];
|
|
18093
|
-
if (value === void 0 || value === null) {
|
|
18094
|
-
continue;
|
|
18095
|
-
}
|
|
18096
|
-
if (Array.isArray(value)) {
|
|
18097
|
-
url = url.replace(
|
|
18098
|
-
match,
|
|
18099
|
-
serializeArrayParam({ explode, name, style, value })
|
|
18100
|
-
);
|
|
18101
|
-
continue;
|
|
18102
|
-
}
|
|
18103
|
-
if (typeof value === "object") {
|
|
18104
|
-
url = url.replace(
|
|
18105
|
-
match,
|
|
18106
|
-
serializeObjectParam({
|
|
18107
|
-
explode,
|
|
18108
|
-
name,
|
|
18109
|
-
style,
|
|
18110
|
-
value,
|
|
18111
|
-
valueOnly: true
|
|
18112
|
-
})
|
|
18113
|
-
);
|
|
18114
|
-
continue;
|
|
18115
|
-
}
|
|
18116
|
-
if (style === "matrix") {
|
|
18117
|
-
url = url.replace(
|
|
18118
|
-
match,
|
|
18119
|
-
`;${serializePrimitiveParam({
|
|
18120
|
-
name,
|
|
18121
|
-
value
|
|
18122
|
-
})}`
|
|
18123
|
-
);
|
|
18124
|
-
continue;
|
|
18125
|
-
}
|
|
18126
|
-
const replaceValue = encodeURIComponent(
|
|
18127
|
-
style === "label" ? `.${value}` : value
|
|
18128
|
-
);
|
|
18129
|
-
url = url.replace(match, replaceValue);
|
|
18130
|
-
}
|
|
18131
|
-
}
|
|
18132
|
-
return url;
|
|
18133
|
-
};
|
|
18134
|
-
createQuerySerializer = ({
|
|
18135
|
-
parameters = {},
|
|
18136
|
-
...args
|
|
18137
|
-
} = {}) => {
|
|
18138
|
-
const querySerializer = (queryParams) => {
|
|
18139
|
-
const search = [];
|
|
18140
|
-
if (queryParams && typeof queryParams === "object") {
|
|
18141
|
-
for (const name in queryParams) {
|
|
18142
|
-
const value = queryParams[name];
|
|
18143
|
-
if (value === void 0 || value === null) {
|
|
18144
|
-
continue;
|
|
18145
|
-
}
|
|
18146
|
-
const options = parameters[name] || args;
|
|
18147
|
-
if (Array.isArray(value)) {
|
|
18148
|
-
const serializedArray = serializeArrayParam({
|
|
18149
|
-
allowReserved: options.allowReserved,
|
|
18150
|
-
explode: true,
|
|
18151
|
-
name,
|
|
18152
|
-
style: "form",
|
|
18153
|
-
value,
|
|
18154
|
-
...options.array
|
|
18155
|
-
});
|
|
18156
|
-
if (serializedArray) search.push(serializedArray);
|
|
18157
|
-
} else if (typeof value === "object") {
|
|
18158
|
-
const serializedObject = serializeObjectParam({
|
|
18159
|
-
allowReserved: options.allowReserved,
|
|
18160
|
-
explode: true,
|
|
18161
|
-
name,
|
|
18162
|
-
style: "deepObject",
|
|
18163
|
-
value,
|
|
18164
|
-
...options.object
|
|
18165
|
-
});
|
|
18166
|
-
if (serializedObject) search.push(serializedObject);
|
|
18167
|
-
} else {
|
|
18168
|
-
const serializedPrimitive = serializePrimitiveParam({
|
|
18169
|
-
allowReserved: options.allowReserved,
|
|
18170
|
-
name,
|
|
18171
|
-
value
|
|
18172
|
-
});
|
|
18173
|
-
if (serializedPrimitive) search.push(serializedPrimitive);
|
|
18174
|
-
}
|
|
18175
|
-
}
|
|
18176
|
-
}
|
|
18177
|
-
return search.join("&");
|
|
18178
|
-
};
|
|
18179
|
-
return querySerializer;
|
|
18180
|
-
};
|
|
18181
|
-
getParseAs = (contentType) => {
|
|
18182
|
-
if (!contentType) {
|
|
18183
|
-
return "stream";
|
|
18184
|
-
}
|
|
18185
|
-
const cleanContent = contentType.split(";")[0]?.trim();
|
|
18186
|
-
if (!cleanContent) {
|
|
18187
|
-
return;
|
|
18188
|
-
}
|
|
18189
|
-
if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) {
|
|
18190
|
-
return "json";
|
|
18191
|
-
}
|
|
18192
|
-
if (cleanContent === "multipart/form-data") {
|
|
18193
|
-
return "formData";
|
|
18194
|
-
}
|
|
18195
|
-
if (["application/", "audio/", "image/", "video/"].some(
|
|
18196
|
-
(type) => cleanContent.startsWith(type)
|
|
18197
|
-
)) {
|
|
18198
|
-
return "blob";
|
|
18199
|
-
}
|
|
18200
|
-
if (cleanContent.startsWith("text/")) {
|
|
18201
|
-
return "text";
|
|
18202
|
-
}
|
|
18203
|
-
return;
|
|
18204
|
-
};
|
|
18205
|
-
checkForExistence = (options, name) => {
|
|
18206
|
-
if (!name) {
|
|
18207
|
-
return false;
|
|
18208
|
-
}
|
|
18209
|
-
if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) {
|
|
18210
|
-
return true;
|
|
18211
|
-
}
|
|
18212
|
-
return false;
|
|
18213
|
-
};
|
|
18214
|
-
setAuthParams = async ({
|
|
18215
|
-
security,
|
|
18216
|
-
...options
|
|
18217
|
-
}) => {
|
|
18218
|
-
for (const auth of security) {
|
|
18219
|
-
if (checkForExistence(options, auth.name)) {
|
|
18220
|
-
continue;
|
|
18221
|
-
}
|
|
18222
|
-
const token = await getAuthToken(auth, options.auth);
|
|
18223
|
-
if (!token) {
|
|
18224
|
-
continue;
|
|
18225
|
-
}
|
|
18226
|
-
const name = auth.name ?? "Authorization";
|
|
18227
|
-
switch (auth.in) {
|
|
18228
|
-
case "query":
|
|
18229
|
-
if (!options.query) {
|
|
18230
|
-
options.query = {};
|
|
18231
|
-
}
|
|
18232
|
-
options.query[name] = token;
|
|
18233
|
-
break;
|
|
18234
|
-
case "cookie":
|
|
18235
|
-
options.headers.append("Cookie", `${name}=${token}`);
|
|
18236
|
-
break;
|
|
18237
|
-
case "header":
|
|
18238
|
-
default:
|
|
18239
|
-
options.headers.set(name, token);
|
|
18240
|
-
break;
|
|
18241
|
-
}
|
|
18242
|
-
}
|
|
18243
|
-
};
|
|
18244
|
-
buildUrl = (options) => {
|
|
18245
|
-
const url = getUrl({
|
|
18246
|
-
baseUrl: options.baseUrl,
|
|
18247
|
-
path: options.path,
|
|
18248
|
-
query: options.query,
|
|
18249
|
-
querySerializer: typeof options.querySerializer === "function" ? options.querySerializer : createQuerySerializer(options.querySerializer),
|
|
18250
|
-
url: options.url
|
|
18251
|
-
});
|
|
18252
|
-
return url;
|
|
18253
|
-
};
|
|
18254
|
-
getUrl = ({
|
|
18255
|
-
baseUrl,
|
|
18256
|
-
path,
|
|
18257
|
-
query,
|
|
18258
|
-
querySerializer,
|
|
18259
|
-
url: _url
|
|
18260
|
-
}) => {
|
|
18261
|
-
const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
|
|
18262
|
-
let url = (baseUrl ?? "") + pathUrl;
|
|
18263
|
-
if (path) {
|
|
18264
|
-
url = defaultPathSerializer({ path, url });
|
|
18265
|
-
}
|
|
18266
|
-
let search = query ? querySerializer(query) : "";
|
|
18267
|
-
if (search.startsWith("?")) {
|
|
18268
|
-
search = search.substring(1);
|
|
18269
|
-
}
|
|
18270
|
-
if (search) {
|
|
18271
|
-
url += `?${search}`;
|
|
18272
|
-
}
|
|
18273
|
-
return url;
|
|
18274
|
-
};
|
|
18275
|
-
mergeConfigs = (a, b) => {
|
|
18276
|
-
const config = { ...a, ...b };
|
|
18277
|
-
if (config.baseUrl?.endsWith("/")) {
|
|
18278
|
-
config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
|
|
18279
|
-
}
|
|
18280
|
-
config.headers = mergeHeaders(a.headers, b.headers);
|
|
18281
|
-
return config;
|
|
18282
|
-
};
|
|
18283
|
-
headersEntries = (headers) => {
|
|
18284
|
-
const entries = [];
|
|
18285
|
-
headers.forEach((value, key) => {
|
|
18286
|
-
entries.push([key, value]);
|
|
18287
|
-
});
|
|
18288
|
-
return entries;
|
|
18289
|
-
};
|
|
18290
|
-
mergeHeaders = (...headers) => {
|
|
18291
|
-
const mergedHeaders = new Headers();
|
|
18292
|
-
for (const header of headers) {
|
|
18293
|
-
if (!header || typeof header !== "object") {
|
|
18294
|
-
continue;
|
|
18295
|
-
}
|
|
18296
|
-
const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
|
|
18297
|
-
for (const [key, value] of iterator) {
|
|
18298
|
-
if (value === null) {
|
|
18299
|
-
mergedHeaders.delete(key);
|
|
18300
|
-
} else if (Array.isArray(value)) {
|
|
18301
|
-
for (const v of value) {
|
|
18302
|
-
mergedHeaders.append(key, v);
|
|
18303
|
-
}
|
|
18304
|
-
} else if (value !== void 0) {
|
|
18305
|
-
mergedHeaders.set(
|
|
18306
|
-
key,
|
|
18307
|
-
typeof value === "object" ? JSON.stringify(value) : value
|
|
18308
|
-
);
|
|
18309
|
-
}
|
|
18310
|
-
}
|
|
18311
|
-
}
|
|
18312
|
-
return mergedHeaders;
|
|
18313
|
-
};
|
|
18314
|
-
Interceptors = class {
|
|
18315
|
-
constructor() {
|
|
18316
|
-
this.fns = [];
|
|
18317
|
-
}
|
|
18318
|
-
clear() {
|
|
18319
|
-
this.fns = [];
|
|
18320
|
-
}
|
|
18321
|
-
eject(id) {
|
|
18322
|
-
const index = this.getInterceptorIndex(id);
|
|
18323
|
-
if (this.fns[index]) {
|
|
18324
|
-
this.fns[index] = null;
|
|
18325
|
-
}
|
|
18326
|
-
}
|
|
18327
|
-
exists(id) {
|
|
18328
|
-
const index = this.getInterceptorIndex(id);
|
|
18329
|
-
return Boolean(this.fns[index]);
|
|
18330
|
-
}
|
|
18331
|
-
getInterceptorIndex(id) {
|
|
18332
|
-
if (typeof id === "number") {
|
|
18333
|
-
return this.fns[id] ? id : -1;
|
|
18334
|
-
}
|
|
18335
|
-
return this.fns.indexOf(id);
|
|
18336
|
-
}
|
|
18337
|
-
update(id, fn) {
|
|
18338
|
-
const index = this.getInterceptorIndex(id);
|
|
18339
|
-
if (this.fns[index]) {
|
|
18340
|
-
this.fns[index] = fn;
|
|
18341
|
-
return id;
|
|
18342
|
-
}
|
|
18343
|
-
return false;
|
|
18344
|
-
}
|
|
18345
|
-
use(fn) {
|
|
18346
|
-
this.fns.push(fn);
|
|
18347
|
-
return this.fns.length - 1;
|
|
18348
|
-
}
|
|
18349
|
-
};
|
|
18350
|
-
createInterceptors = () => ({
|
|
18351
|
-
error: new Interceptors(),
|
|
18352
|
-
request: new Interceptors(),
|
|
18353
|
-
response: new Interceptors()
|
|
18354
|
-
});
|
|
18355
|
-
defaultQuerySerializer = createQuerySerializer({
|
|
18356
|
-
allowReserved: false,
|
|
18357
|
-
array: {
|
|
18358
|
-
explode: true,
|
|
18359
|
-
style: "form"
|
|
18360
|
-
},
|
|
18361
|
-
object: {
|
|
18362
|
-
explode: true,
|
|
18363
|
-
style: "deepObject"
|
|
18364
|
-
}
|
|
18365
|
-
});
|
|
18366
|
-
defaultHeaders = {
|
|
18367
|
-
"Content-Type": "application/json"
|
|
18368
|
-
};
|
|
18369
|
-
createConfig = (override = {}) => ({
|
|
18370
|
-
...jsonBodySerializer,
|
|
18371
|
-
headers: defaultHeaders,
|
|
18372
|
-
parseAs: "auto",
|
|
18373
|
-
querySerializer: defaultQuerySerializer,
|
|
18374
|
-
...override
|
|
18375
|
-
});
|
|
18376
|
-
}
|
|
18377
|
-
});
|
|
18378
|
-
|
|
18379
|
-
// src/client/client/client.gen.ts
|
|
18380
|
-
var createClient;
|
|
18381
|
-
var init_client_gen = __esm({
|
|
18382
|
-
"src/client/client/client.gen.ts"() {
|
|
18383
|
-
"use strict";
|
|
18384
|
-
init_serverSentEvents_gen();
|
|
18385
|
-
init_utils_gen();
|
|
18386
|
-
init_utils_gen2();
|
|
18387
|
-
createClient = (config = {}) => {
|
|
18388
|
-
let _config = mergeConfigs(createConfig(), config);
|
|
18389
|
-
const getConfig = () => ({ ..._config });
|
|
18390
|
-
const setConfig = (config2) => {
|
|
18391
|
-
_config = mergeConfigs(_config, config2);
|
|
18392
|
-
return getConfig();
|
|
18393
|
-
};
|
|
18394
|
-
const interceptors = createInterceptors();
|
|
18395
|
-
const beforeRequest = async (options) => {
|
|
18396
|
-
const opts = {
|
|
18397
|
-
..._config,
|
|
18398
|
-
...options,
|
|
18399
|
-
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
18400
|
-
headers: mergeHeaders(_config.headers, options.headers),
|
|
18401
|
-
serializedBody: void 0
|
|
18402
|
-
};
|
|
18403
|
-
if (opts.security) {
|
|
18404
|
-
await setAuthParams({
|
|
18405
|
-
...opts,
|
|
18406
|
-
security: opts.security
|
|
18407
|
-
});
|
|
18408
|
-
}
|
|
18409
|
-
if (opts.requestValidator) {
|
|
18410
|
-
await opts.requestValidator(opts);
|
|
18411
|
-
}
|
|
18412
|
-
if (opts.body !== void 0 && opts.bodySerializer) {
|
|
18413
|
-
opts.serializedBody = opts.bodySerializer(opts.body);
|
|
18414
|
-
}
|
|
18415
|
-
if (opts.body === void 0 || opts.serializedBody === "") {
|
|
18416
|
-
opts.headers.delete("Content-Type");
|
|
18417
|
-
}
|
|
18418
|
-
const url = buildUrl(opts);
|
|
18419
|
-
return { opts, url };
|
|
18420
|
-
};
|
|
18421
|
-
const request = async (options) => {
|
|
18422
|
-
const { opts, url } = await beforeRequest(options);
|
|
18423
|
-
for (const fn of interceptors.request.fns) {
|
|
18424
|
-
if (fn) {
|
|
18425
|
-
await fn(opts);
|
|
18426
|
-
}
|
|
18427
|
-
}
|
|
18428
|
-
const _fetch = opts.fetch;
|
|
18429
|
-
const requestInit = {
|
|
18430
|
-
...opts,
|
|
18431
|
-
body: getValidRequestBody(opts)
|
|
18432
|
-
};
|
|
18433
|
-
let response = await _fetch(url, requestInit);
|
|
18434
|
-
for (const fn of interceptors.response.fns) {
|
|
18435
|
-
if (fn) {
|
|
18436
|
-
response = await fn(response, opts);
|
|
18437
|
-
}
|
|
18438
|
-
}
|
|
18439
|
-
const result = {
|
|
18440
|
-
response
|
|
18441
|
-
};
|
|
18442
|
-
if (response.ok) {
|
|
18443
|
-
const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
|
|
18444
|
-
if (response.status === 204 || response.headers.get("Content-Length") === "0") {
|
|
18445
|
-
let emptyData;
|
|
18446
|
-
switch (parseAs) {
|
|
18447
|
-
case "arrayBuffer":
|
|
18448
|
-
case "blob":
|
|
18449
|
-
case "text":
|
|
18450
|
-
emptyData = await response[parseAs]();
|
|
18451
|
-
break;
|
|
18452
|
-
case "formData":
|
|
18453
|
-
emptyData = new FormData();
|
|
18454
|
-
break;
|
|
18455
|
-
case "stream":
|
|
18456
|
-
emptyData = response.body;
|
|
18457
|
-
break;
|
|
18458
|
-
case "json":
|
|
18459
|
-
default:
|
|
18460
|
-
emptyData = {};
|
|
18461
|
-
break;
|
|
18462
|
-
}
|
|
18463
|
-
return {
|
|
18464
|
-
data: emptyData,
|
|
18465
|
-
...result
|
|
18466
|
-
};
|
|
18467
|
-
}
|
|
18468
|
-
let data;
|
|
18469
|
-
switch (parseAs) {
|
|
18470
|
-
case "arrayBuffer":
|
|
18471
|
-
case "blob":
|
|
18472
|
-
case "formData":
|
|
18473
|
-
case "json":
|
|
18474
|
-
case "text":
|
|
18475
|
-
data = await response[parseAs]();
|
|
18476
|
-
break;
|
|
18477
|
-
case "stream":
|
|
18478
|
-
return {
|
|
18479
|
-
data: response.body,
|
|
18480
|
-
...result
|
|
18481
|
-
};
|
|
18482
|
-
}
|
|
18483
|
-
if (parseAs === "json") {
|
|
18484
|
-
if (opts.responseValidator) {
|
|
18485
|
-
await opts.responseValidator(data);
|
|
18486
|
-
}
|
|
18487
|
-
if (opts.responseTransformer) {
|
|
18488
|
-
data = await opts.responseTransformer(data);
|
|
18489
|
-
}
|
|
18490
|
-
}
|
|
18491
|
-
return {
|
|
18492
|
-
data,
|
|
18493
|
-
...result
|
|
18494
|
-
};
|
|
18495
|
-
}
|
|
18496
|
-
const textError = await response.text();
|
|
18497
|
-
let jsonError;
|
|
18498
|
-
try {
|
|
18499
|
-
jsonError = JSON.parse(textError);
|
|
18500
|
-
} catch {
|
|
18501
|
-
}
|
|
18502
|
-
const error = jsonError ?? textError;
|
|
18503
|
-
let finalError = error;
|
|
18504
|
-
for (const fn of interceptors.error.fns) {
|
|
18505
|
-
if (fn) {
|
|
18506
|
-
finalError = await fn(error, response, opts);
|
|
18507
|
-
}
|
|
18508
|
-
}
|
|
18509
|
-
finalError = finalError || {};
|
|
18510
|
-
if (opts.throwOnError) {
|
|
18511
|
-
throw finalError;
|
|
18512
|
-
}
|
|
18513
|
-
return {
|
|
18514
|
-
error: finalError,
|
|
18515
|
-
...result
|
|
18516
|
-
};
|
|
18517
|
-
};
|
|
18518
|
-
const makeMethodFn = (method) => (options) => request({ ...options, method });
|
|
18519
|
-
const makeSseFn = (method) => async (options) => {
|
|
18520
|
-
const { opts, url } = await beforeRequest(options);
|
|
18521
|
-
return createSseClient({
|
|
18522
|
-
...opts,
|
|
18523
|
-
body: opts.body,
|
|
18524
|
-
headers: opts.headers,
|
|
18525
|
-
method,
|
|
18526
|
-
onRequest: async (url2, init) => {
|
|
18527
|
-
let request2 = new Request(url2, init);
|
|
18528
|
-
const requestInit = {
|
|
18529
|
-
...init,
|
|
18530
|
-
method: init.method,
|
|
18531
|
-
url: url2
|
|
18532
|
-
};
|
|
18533
|
-
for (const fn of interceptors.request.fns) {
|
|
18534
|
-
if (fn) {
|
|
18535
|
-
await fn(requestInit);
|
|
18536
|
-
request2 = new Request(requestInit.url, requestInit);
|
|
18537
|
-
}
|
|
18538
|
-
}
|
|
18539
|
-
return request2;
|
|
18540
|
-
},
|
|
18541
|
-
url
|
|
18542
|
-
});
|
|
18543
|
-
};
|
|
18544
|
-
return {
|
|
18545
|
-
buildUrl,
|
|
18546
|
-
connect: makeMethodFn("CONNECT"),
|
|
18547
|
-
delete: makeMethodFn("DELETE"),
|
|
18548
|
-
get: makeMethodFn("GET"),
|
|
18549
|
-
getConfig,
|
|
18550
|
-
head: makeMethodFn("HEAD"),
|
|
18551
|
-
interceptors,
|
|
18552
|
-
options: makeMethodFn("OPTIONS"),
|
|
18553
|
-
patch: makeMethodFn("PATCH"),
|
|
18554
|
-
post: makeMethodFn("POST"),
|
|
18555
|
-
put: makeMethodFn("PUT"),
|
|
18556
|
-
request,
|
|
18557
|
-
setConfig,
|
|
18558
|
-
sse: {
|
|
18559
|
-
connect: makeSseFn("CONNECT"),
|
|
18560
|
-
delete: makeSseFn("DELETE"),
|
|
18561
|
-
get: makeSseFn("GET"),
|
|
18562
|
-
head: makeSseFn("HEAD"),
|
|
18563
|
-
options: makeSseFn("OPTIONS"),
|
|
18564
|
-
patch: makeSseFn("PATCH"),
|
|
18565
|
-
post: makeSseFn("POST"),
|
|
18566
|
-
put: makeSseFn("PUT"),
|
|
18567
|
-
trace: makeSseFn("TRACE")
|
|
18568
|
-
},
|
|
18569
|
-
trace: makeMethodFn("TRACE")
|
|
18570
|
-
};
|
|
18571
|
-
};
|
|
18572
|
-
}
|
|
18573
|
-
});
|
|
18574
|
-
|
|
18575
|
-
// src/client/client/index.ts
|
|
18576
|
-
var init_client = __esm({
|
|
18577
|
-
"src/client/client/index.ts"() {
|
|
18578
|
-
"use strict";
|
|
18579
|
-
init_client_gen();
|
|
18580
|
-
init_utils_gen2();
|
|
18581
|
-
}
|
|
18582
|
-
});
|
|
18583
|
-
|
|
18584
|
-
// src/client/client.gen.ts
|
|
18585
|
-
var client;
|
|
18586
|
-
var init_client_gen2 = __esm({
|
|
18587
|
-
"src/client/client.gen.ts"() {
|
|
18588
|
-
"use strict";
|
|
18589
|
-
init_client();
|
|
18590
|
-
init_clientConfig();
|
|
18591
|
-
client = createClient(createClientConfig(createConfig()));
|
|
18592
|
-
}
|
|
18593
|
-
});
|
|
18594
|
-
|
|
18595
|
-
// src/client/sdk.gen.ts
|
|
18596
|
-
var postApiV1Embeddings;
|
|
18597
|
-
var init_sdk_gen = __esm({
|
|
18598
|
-
"src/client/sdk.gen.ts"() {
|
|
18599
|
-
"use strict";
|
|
18600
|
-
init_client_gen2();
|
|
18601
|
-
postApiV1Embeddings = (options) => {
|
|
18602
|
-
return (options.client ?? client).post({
|
|
18603
|
-
url: "/api/v1/embeddings",
|
|
18604
|
-
...options,
|
|
18605
|
-
headers: {
|
|
18606
|
-
"Content-Type": "application/json",
|
|
18607
|
-
...options.headers
|
|
18608
|
-
}
|
|
18609
|
-
});
|
|
18610
|
-
};
|
|
18611
|
-
}
|
|
18612
|
-
});
|
|
18613
|
-
|
|
18614
|
-
// src/client/index.ts
|
|
18615
|
-
var init_client2 = __esm({
|
|
18616
|
-
"src/client/index.ts"() {
|
|
18617
|
-
"use strict";
|
|
18618
|
-
init_sdk_gen();
|
|
18619
|
-
}
|
|
18620
|
-
});
|
|
18621
|
-
|
|
18622
17730
|
// src/lib/memoryEngine/constants.ts
|
|
18623
17731
|
var DEFAULT_API_EMBEDDING_MODEL;
|
|
18624
17732
|
var init_constants = __esm({
|
|
@@ -18628,7 +17736,7 @@ var init_constants = __esm({
|
|
|
18628
17736
|
}
|
|
18629
17737
|
});
|
|
18630
17738
|
|
|
18631
|
-
// src/lib/memoryEngine/
|
|
17739
|
+
// src/lib/memoryEngine/generate.ts
|
|
18632
17740
|
async function withEmbeddingRetry(call) {
|
|
18633
17741
|
let last;
|
|
18634
17742
|
let lastThrown;
|
|
@@ -18679,7 +17787,7 @@ async function generateEmbedding(text12, options) {
|
|
|
18679
17787
|
throw new Error("Either apiKey or getToken must be provided");
|
|
18680
17788
|
}
|
|
18681
17789
|
const response = await withEmbeddingRetry(
|
|
18682
|
-
() => postApiV1Embeddings({
|
|
17790
|
+
() => (0, import_client.postApiV1Embeddings)({
|
|
18683
17791
|
baseUrl,
|
|
18684
17792
|
body: {
|
|
18685
17793
|
// Mask PII from the request body only — the cache above still keys on
|
|
@@ -18711,7 +17819,7 @@ async function generateEmbedding(text12, options) {
|
|
|
18711
17819
|
}
|
|
18712
17820
|
async function generateEmbeddingsBatch(texts, headers, baseUrl, model, onUsage, maskInput) {
|
|
18713
17821
|
const response = await withEmbeddingRetry(
|
|
18714
|
-
() => postApiV1Embeddings({
|
|
17822
|
+
() => (0, import_client.postApiV1Embeddings)({
|
|
18715
17823
|
baseUrl,
|
|
18716
17824
|
// Mask PII from the request body only; cache/order still key on originals.
|
|
18717
17825
|
body: { input: maskInput ? texts.map(maskInput) : texts, model },
|
|
@@ -18812,6 +17920,27 @@ async function generateEmbeddings(texts, options) {
|
|
|
18812
17920
|
}
|
|
18813
17921
|
return results;
|
|
18814
17922
|
}
|
|
17923
|
+
var import_client, EMBED_MAX_ATTEMPTS, EmbeddingHttpError, DEFAULT_EMBEDDING_BATCH_SIZE, DEFAULT_EMBEDDING_BATCH_CONCURRENCY;
|
|
17924
|
+
var init_generate = __esm({
|
|
17925
|
+
"src/lib/memoryEngine/generate.ts"() {
|
|
17926
|
+
"use strict";
|
|
17927
|
+
import_client = require("@anuma/sdk");
|
|
17928
|
+
init_clientConfig();
|
|
17929
|
+
init_constants();
|
|
17930
|
+
EMBED_MAX_ATTEMPTS = 4;
|
|
17931
|
+
EmbeddingHttpError = class extends Error {
|
|
17932
|
+
constructor(message, status) {
|
|
17933
|
+
super(message);
|
|
17934
|
+
this.name = "EmbeddingHttpError";
|
|
17935
|
+
this.status = status;
|
|
17936
|
+
}
|
|
17937
|
+
};
|
|
17938
|
+
DEFAULT_EMBEDDING_BATCH_SIZE = 100;
|
|
17939
|
+
DEFAULT_EMBEDDING_BATCH_CONCURRENCY = 3;
|
|
17940
|
+
}
|
|
17941
|
+
});
|
|
17942
|
+
|
|
17943
|
+
// src/lib/memoryEngine/embeddings.ts
|
|
18815
17944
|
async function embedMessage(ctx, messageId, options) {
|
|
18816
17945
|
let message;
|
|
18817
17946
|
const conversations = await getConversationsOp(ctx);
|
|
@@ -18967,27 +18096,17 @@ async function chunkAndEmbedAllMessages(ctx, options, filter) {
|
|
|
18967
18096
|
}
|
|
18968
18097
|
return embeddedCount;
|
|
18969
18098
|
}
|
|
18970
|
-
var DEFAULT_MIN_CONTENT_LENGTH
|
|
18099
|
+
var DEFAULT_MIN_CONTENT_LENGTH;
|
|
18971
18100
|
var init_embeddings = __esm({
|
|
18972
18101
|
"src/lib/memoryEngine/embeddings.ts"() {
|
|
18973
18102
|
"use strict";
|
|
18974
|
-
init_client2();
|
|
18975
|
-
init_clientConfig();
|
|
18976
18103
|
init_operations();
|
|
18977
18104
|
init_logger();
|
|
18978
18105
|
init_chunking();
|
|
18979
18106
|
init_constants();
|
|
18107
|
+
init_generate();
|
|
18108
|
+
init_generate();
|
|
18980
18109
|
DEFAULT_MIN_CONTENT_LENGTH = 10;
|
|
18981
|
-
EMBED_MAX_ATTEMPTS = 4;
|
|
18982
|
-
EmbeddingHttpError = class extends Error {
|
|
18983
|
-
constructor(message, status) {
|
|
18984
|
-
super(message);
|
|
18985
|
-
this.name = "EmbeddingHttpError";
|
|
18986
|
-
this.status = status;
|
|
18987
|
-
}
|
|
18988
|
-
};
|
|
18989
|
-
DEFAULT_EMBEDDING_BATCH_SIZE = 100;
|
|
18990
|
-
DEFAULT_EMBEDDING_BATCH_CONCURRENCY = 3;
|
|
18991
18110
|
}
|
|
18992
18111
|
});
|
|
18993
18112
|
|
|
@@ -23981,17 +23100,17 @@ var _PostgreSQLAdapter = class _PostgreSQLAdapter {
|
|
|
23981
23100
|
}
|
|
23982
23101
|
case "sql": {
|
|
23983
23102
|
if (this._pgSchema !== "public" && this.pool.connect) {
|
|
23984
|
-
const
|
|
23103
|
+
const client = await this.pool.connect();
|
|
23985
23104
|
try {
|
|
23986
|
-
await
|
|
23987
|
-
await
|
|
23988
|
-
await
|
|
23989
|
-
await
|
|
23105
|
+
await client.query("BEGIN");
|
|
23106
|
+
await client.query(`SET LOCAL search_path TO "${this._pgSchema}", public`);
|
|
23107
|
+
await client.query(step.sql);
|
|
23108
|
+
await client.query("COMMIT");
|
|
23990
23109
|
} catch (err) {
|
|
23991
|
-
await
|
|
23110
|
+
await client.query("ROLLBACK");
|
|
23992
23111
|
throw err;
|
|
23993
23112
|
} finally {
|
|
23994
|
-
|
|
23113
|
+
client.release();
|
|
23995
23114
|
}
|
|
23996
23115
|
} else {
|
|
23997
23116
|
await this.pool.query(step.sql);
|
|
@@ -24137,16 +23256,16 @@ var _PostgreSQLAdapter = class _PostgreSQLAdapter {
|
|
|
24137
23256
|
}
|
|
24138
23257
|
};
|
|
24139
23258
|
if (this.pool.connect) {
|
|
24140
|
-
const
|
|
23259
|
+
const client = await this.pool.connect();
|
|
24141
23260
|
try {
|
|
24142
|
-
await
|
|
24143
|
-
await runOps(
|
|
24144
|
-
await
|
|
23261
|
+
await client.query("BEGIN");
|
|
23262
|
+
await runOps(client);
|
|
23263
|
+
await client.query("COMMIT");
|
|
24145
23264
|
} catch (err) {
|
|
24146
|
-
await
|
|
23265
|
+
await client.query("ROLLBACK");
|
|
24147
23266
|
throw err;
|
|
24148
23267
|
} finally {
|
|
24149
|
-
|
|
23268
|
+
client.release();
|
|
24150
23269
|
}
|
|
24151
23270
|
} else {
|
|
24152
23271
|
await runOps(this.pool);
|
|
@@ -24826,6 +23945,7 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
24826
23945
|
if (record.isDeleted) return null;
|
|
24827
23946
|
const scopeChanged = opts.scope !== void 0 && opts.scope !== record.scope;
|
|
24828
23947
|
const updated = await ctx.database.write(async () => {
|
|
23948
|
+
const memories = scopeChanged ? await ctx.vaultMemoryCollection.query(import_watermelondb18.Q.where("folder_id", id), import_watermelondb18.Q.where("is_deleted", false)).fetch() : [];
|
|
24829
23949
|
const updates = [];
|
|
24830
23950
|
updates.push(
|
|
24831
23951
|
record.prepareUpdate((r) => {
|
|
@@ -24833,15 +23953,12 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
24833
23953
|
if (opts.scope !== void 0) r._setRaw("scope", opts.scope);
|
|
24834
23954
|
})
|
|
24835
23955
|
);
|
|
24836
|
-
|
|
24837
|
-
|
|
24838
|
-
|
|
24839
|
-
|
|
24840
|
-
|
|
24841
|
-
|
|
24842
|
-
})
|
|
24843
|
-
);
|
|
24844
|
-
}
|
|
23956
|
+
for (const memory of memories) {
|
|
23957
|
+
updates.push(
|
|
23958
|
+
memory.prepareUpdate((r) => {
|
|
23959
|
+
r._setRaw("scope", opts.scope);
|
|
23960
|
+
})
|
|
23961
|
+
);
|
|
24845
23962
|
}
|
|
24846
23963
|
await ctx.database.batch(...updates);
|
|
24847
23964
|
return ctx.vaultFolderCollection.find(id);
|
|
@@ -27014,8 +26131,12 @@ init_recall();
|
|
|
27014
26131
|
|
|
27015
26132
|
// src/lib/memory/recallTool.ts
|
|
27016
26133
|
init_recall();
|
|
26134
|
+
|
|
26135
|
+
// src/lib/memory/recallConstants.ts
|
|
27017
26136
|
var RECALL_TOOL_NAME = "recall_memory";
|
|
27018
26137
|
var RECALL_MAX_LIMIT = 50;
|
|
26138
|
+
|
|
26139
|
+
// src/lib/memory/recallTool.ts
|
|
27019
26140
|
var DEFAULT_LIMIT2 = 8;
|
|
27020
26141
|
var DEFAULT_BUDGET2 = "low";
|
|
27021
26142
|
function formatEventTime(start, end, kind) {
|
|
@@ -27542,7 +26663,7 @@ WORKFLOW:
|
|
|
27542
26663
|
|
|
27543
26664
|
// src/lib/tools/serverTools.ts
|
|
27544
26665
|
init_logger();
|
|
27545
|
-
|
|
26666
|
+
init_generate();
|
|
27546
26667
|
init_vector();
|
|
27547
26668
|
var DEFAULT_CACHE_EXPIRATION_MS = 24 * 60 * 60 * 1e3;
|
|
27548
26669
|
var SERVER_TOOLS_CACHE_KEY = "sdk_server_tools_cache";
|
|
@@ -27589,7 +26710,7 @@ function getCachedServerTools() {
|
|
|
27589
26710
|
if (!cached) return null;
|
|
27590
26711
|
const parsed = JSON.parse(cached);
|
|
27591
26712
|
if (parsed.version !== CACHE_VERSION) {
|
|
27592
|
-
|
|
26713
|
+
removeLocalStorageCache();
|
|
27593
26714
|
return null;
|
|
27594
26715
|
}
|
|
27595
26716
|
return parsed;
|
|
@@ -27601,37 +26722,45 @@ function isCacheExpired(cache, expirationMs = DEFAULT_CACHE_EXPIRATION_MS) {
|
|
|
27601
26722
|
if (!cache) return true;
|
|
27602
26723
|
return Date.now() - cache.timestamp > expirationMs;
|
|
27603
26724
|
}
|
|
27604
|
-
function
|
|
27605
|
-
|
|
27606
|
-
const cacheData = {
|
|
26725
|
+
function buildCacheEntry(tools, checksum) {
|
|
26726
|
+
return {
|
|
27607
26727
|
tools,
|
|
27608
26728
|
timestamp: Date.now(),
|
|
27609
26729
|
version: CACHE_VERSION,
|
|
27610
26730
|
...checksum && { checksum }
|
|
27611
26731
|
};
|
|
26732
|
+
}
|
|
26733
|
+
function writeLocalStorageCache(entry) {
|
|
26734
|
+
if (typeof localStorage === "undefined") return;
|
|
27612
26735
|
try {
|
|
27613
|
-
localStorage.setItem(SERVER_TOOLS_CACHE_KEY, JSON.stringify(
|
|
26736
|
+
localStorage.setItem(SERVER_TOOLS_CACHE_KEY, JSON.stringify(entry));
|
|
27614
26737
|
} catch (error) {
|
|
27615
26738
|
getLogger().warn("[serverTools] Failed to cache tools:", error);
|
|
27616
26739
|
}
|
|
27617
26740
|
}
|
|
27618
|
-
function
|
|
26741
|
+
function removeLocalStorageCache() {
|
|
27619
26742
|
if (typeof localStorage === "undefined") return;
|
|
27620
26743
|
localStorage.removeItem(SERVER_TOOLS_CACHE_KEY);
|
|
27621
26744
|
}
|
|
27622
|
-
|
|
27623
|
-
|
|
27624
|
-
|
|
26745
|
+
var localStorageToolsCache = {
|
|
26746
|
+
get: getCachedServerTools,
|
|
26747
|
+
set: writeLocalStorageCache,
|
|
26748
|
+
clear: removeLocalStorageCache
|
|
26749
|
+
};
|
|
26750
|
+
function clearServerToolsCache(cache = localStorageToolsCache) {
|
|
26751
|
+
return cache.clear?.();
|
|
26752
|
+
}
|
|
26753
|
+
function getToolsChecksum(cache = localStorageToolsCache) {
|
|
26754
|
+
const cached = cache.get();
|
|
26755
|
+
return cached instanceof Promise ? cached.then((c) => c?.checksum) : cached?.checksum;
|
|
27625
26756
|
}
|
|
27626
|
-
function shouldRefreshTools(responseChecksum) {
|
|
26757
|
+
function shouldRefreshTools(responseChecksum, cache = localStorageToolsCache) {
|
|
27627
26758
|
if (!responseChecksum) {
|
|
27628
26759
|
return false;
|
|
27629
26760
|
}
|
|
27630
|
-
const
|
|
27631
|
-
|
|
27632
|
-
|
|
27633
|
-
}
|
|
27634
|
-
return cachedChecksum !== responseChecksum;
|
|
26761
|
+
const decide = (cachedChecksum2) => !cachedChecksum2 || cachedChecksum2 !== responseChecksum;
|
|
26762
|
+
const cachedChecksum = getToolsChecksum(cache);
|
|
26763
|
+
return cachedChecksum instanceof Promise ? cachedChecksum.then(decide) : decide(cachedChecksum);
|
|
27635
26764
|
}
|
|
27636
26765
|
async function fetchServerToolsFromApi(baseUrl, token) {
|
|
27637
26766
|
const response = await fetch(`${baseUrl}/api/v1/tools`, {
|
|
@@ -27653,9 +26782,23 @@ async function getServerTools(options) {
|
|
|
27653
26782
|
cacheExpirationMs = DEFAULT_CACHE_EXPIRATION_MS,
|
|
27654
26783
|
forceRefresh = false,
|
|
27655
26784
|
getToken,
|
|
27656
|
-
apiKey
|
|
26785
|
+
apiKey,
|
|
26786
|
+
cache = localStorageToolsCache
|
|
27657
26787
|
} = options;
|
|
27658
|
-
const
|
|
26788
|
+
const persistCache = async (entry) => {
|
|
26789
|
+
try {
|
|
26790
|
+
await cache.set(entry);
|
|
26791
|
+
} catch (error) {
|
|
26792
|
+
getLogger().warn("[serverTools] Cache write failed (non-fatal):", error);
|
|
26793
|
+
}
|
|
26794
|
+
};
|
|
26795
|
+
let rawCached = null;
|
|
26796
|
+
try {
|
|
26797
|
+
rawCached = await cache.get();
|
|
26798
|
+
} catch (error) {
|
|
26799
|
+
getLogger().warn("[serverTools] Cache read failed; falling through to server fetch:", error);
|
|
26800
|
+
}
|
|
26801
|
+
const cached = rawCached && rawCached.version === CACHE_VERSION ? rawCached : null;
|
|
27659
26802
|
const cacheValid = !isCacheExpired(cached, cacheExpirationMs);
|
|
27660
26803
|
if (cached && cacheValid && !forceRefresh) {
|
|
27661
26804
|
return cached.tools;
|
|
@@ -27676,7 +26819,7 @@ async function getServerTools(options) {
|
|
|
27676
26819
|
}
|
|
27677
26820
|
const data = await response.json();
|
|
27678
26821
|
const { tools: tools2, checksum: checksum2 } = convertServerToolsResponse(data);
|
|
27679
|
-
|
|
26822
|
+
await persistCache(buildCacheEntry(tools2, checksum2));
|
|
27680
26823
|
return tools2;
|
|
27681
26824
|
}
|
|
27682
26825
|
if (!getToken) {
|
|
@@ -27689,7 +26832,7 @@ async function getServerTools(options) {
|
|
|
27689
26832
|
return cached?.tools ?? [];
|
|
27690
26833
|
}
|
|
27691
26834
|
const { tools, checksum } = await fetchServerToolsFromApi(effectiveBaseUrl, token);
|
|
27692
|
-
|
|
26835
|
+
await persistCache(buildCacheEntry(tools, checksum));
|
|
27693
26836
|
return tools;
|
|
27694
26837
|
} catch (error) {
|
|
27695
26838
|
getLogger().error("[serverTools] Failed to fetch server tools:", error);
|
|
@@ -28073,13 +27216,14 @@ async function selectServerToolsForPrompt(options) {
|
|
|
28073
27216
|
baseUrl,
|
|
28074
27217
|
embeddingModel,
|
|
28075
27218
|
cacheExpirationMs,
|
|
27219
|
+
cache,
|
|
28076
27220
|
deferLoading
|
|
28077
27221
|
} = options;
|
|
28078
27222
|
if (serverToolsFilter === void 0) return [];
|
|
28079
27223
|
if (Array.isArray(serverToolsFilter) && serverToolsFilter.length === 0) return [];
|
|
28080
27224
|
let allServerTools;
|
|
28081
27225
|
try {
|
|
28082
|
-
allServerTools = await getServerTools({ baseUrl, cacheExpirationMs, getToken });
|
|
27226
|
+
allServerTools = await getServerTools({ baseUrl, cacheExpirationMs, getToken, cache });
|
|
28083
27227
|
} catch {
|
|
28084
27228
|
return [];
|
|
28085
27229
|
}
|
|
@@ -29437,8 +28581,142 @@ function createCryptoPricePreProcessor(options = {}) {
|
|
|
29437
28581
|
// src/lib/chat/resumeStream.ts
|
|
29438
28582
|
init_clientConfig();
|
|
29439
28583
|
|
|
28584
|
+
// src/client/core/serverSentEvents.gen.ts
|
|
28585
|
+
var createSseClient = ({
|
|
28586
|
+
onRequest,
|
|
28587
|
+
onSseError,
|
|
28588
|
+
onSseEvent,
|
|
28589
|
+
responseTransformer,
|
|
28590
|
+
responseValidator,
|
|
28591
|
+
sseDefaultRetryDelay,
|
|
28592
|
+
sseMaxRetryAttempts,
|
|
28593
|
+
sseMaxRetryDelay,
|
|
28594
|
+
sseSleepFn,
|
|
28595
|
+
url,
|
|
28596
|
+
...options
|
|
28597
|
+
}) => {
|
|
28598
|
+
let lastEventId;
|
|
28599
|
+
const sleep4 = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
28600
|
+
const createStream = async function* () {
|
|
28601
|
+
let retryDelay = sseDefaultRetryDelay ?? 3e3;
|
|
28602
|
+
let attempt = 0;
|
|
28603
|
+
const signal = options.signal ?? new AbortController().signal;
|
|
28604
|
+
while (true) {
|
|
28605
|
+
if (signal.aborted) break;
|
|
28606
|
+
attempt++;
|
|
28607
|
+
const headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
|
|
28608
|
+
if (lastEventId !== void 0) {
|
|
28609
|
+
headers.set("Last-Event-ID", lastEventId);
|
|
28610
|
+
}
|
|
28611
|
+
try {
|
|
28612
|
+
const requestInit = {
|
|
28613
|
+
redirect: "follow",
|
|
28614
|
+
...options,
|
|
28615
|
+
body: options.serializedBody,
|
|
28616
|
+
headers,
|
|
28617
|
+
signal
|
|
28618
|
+
};
|
|
28619
|
+
let request = new Request(url, requestInit);
|
|
28620
|
+
if (onRequest) {
|
|
28621
|
+
request = await onRequest(url, requestInit);
|
|
28622
|
+
}
|
|
28623
|
+
const _fetch = options.fetch ?? globalThis.fetch;
|
|
28624
|
+
const response = await _fetch(request);
|
|
28625
|
+
if (!response.ok)
|
|
28626
|
+
throw new Error(
|
|
28627
|
+
`SSE failed: ${response.status} ${response.statusText}`
|
|
28628
|
+
);
|
|
28629
|
+
if (!response.body) throw new Error("No body in SSE response");
|
|
28630
|
+
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
28631
|
+
let buffer = "";
|
|
28632
|
+
const abortHandler = () => {
|
|
28633
|
+
try {
|
|
28634
|
+
reader.cancel();
|
|
28635
|
+
} catch {
|
|
28636
|
+
}
|
|
28637
|
+
};
|
|
28638
|
+
signal.addEventListener("abort", abortHandler);
|
|
28639
|
+
try {
|
|
28640
|
+
while (true) {
|
|
28641
|
+
const { done, value } = await reader.read();
|
|
28642
|
+
if (done) break;
|
|
28643
|
+
buffer += value;
|
|
28644
|
+
const chunks = buffer.split("\n\n");
|
|
28645
|
+
buffer = chunks.pop() ?? "";
|
|
28646
|
+
for (const chunk of chunks) {
|
|
28647
|
+
const lines = chunk.split("\n");
|
|
28648
|
+
const dataLines = [];
|
|
28649
|
+
let eventName;
|
|
28650
|
+
for (const line of lines) {
|
|
28651
|
+
if (line.startsWith("data:")) {
|
|
28652
|
+
dataLines.push(line.replace(/^data:\s*/, ""));
|
|
28653
|
+
} else if (line.startsWith("event:")) {
|
|
28654
|
+
eventName = line.replace(/^event:\s*/, "");
|
|
28655
|
+
} else if (line.startsWith("id:")) {
|
|
28656
|
+
lastEventId = line.replace(/^id:\s*/, "");
|
|
28657
|
+
} else if (line.startsWith("retry:")) {
|
|
28658
|
+
const parsed = Number.parseInt(
|
|
28659
|
+
line.replace(/^retry:\s*/, ""),
|
|
28660
|
+
10
|
|
28661
|
+
);
|
|
28662
|
+
if (!Number.isNaN(parsed)) {
|
|
28663
|
+
retryDelay = parsed;
|
|
28664
|
+
}
|
|
28665
|
+
}
|
|
28666
|
+
}
|
|
28667
|
+
let data;
|
|
28668
|
+
let parsedJson = false;
|
|
28669
|
+
if (dataLines.length) {
|
|
28670
|
+
const rawData = dataLines.join("\n");
|
|
28671
|
+
try {
|
|
28672
|
+
data = JSON.parse(rawData);
|
|
28673
|
+
parsedJson = true;
|
|
28674
|
+
} catch {
|
|
28675
|
+
data = rawData;
|
|
28676
|
+
}
|
|
28677
|
+
}
|
|
28678
|
+
if (parsedJson) {
|
|
28679
|
+
if (responseValidator) {
|
|
28680
|
+
await responseValidator(data);
|
|
28681
|
+
}
|
|
28682
|
+
if (responseTransformer) {
|
|
28683
|
+
data = await responseTransformer(data);
|
|
28684
|
+
}
|
|
28685
|
+
}
|
|
28686
|
+
onSseEvent?.({
|
|
28687
|
+
data,
|
|
28688
|
+
event: eventName,
|
|
28689
|
+
id: lastEventId,
|
|
28690
|
+
retry: retryDelay
|
|
28691
|
+
});
|
|
28692
|
+
if (dataLines.length) {
|
|
28693
|
+
yield data;
|
|
28694
|
+
}
|
|
28695
|
+
}
|
|
28696
|
+
}
|
|
28697
|
+
} finally {
|
|
28698
|
+
signal.removeEventListener("abort", abortHandler);
|
|
28699
|
+
reader.releaseLock();
|
|
28700
|
+
}
|
|
28701
|
+
break;
|
|
28702
|
+
} catch (error) {
|
|
28703
|
+
onSseError?.(error);
|
|
28704
|
+
if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
|
|
28705
|
+
break;
|
|
28706
|
+
}
|
|
28707
|
+
const backoff = Math.min(
|
|
28708
|
+
retryDelay * 2 ** (attempt - 1),
|
|
28709
|
+
sseMaxRetryDelay ?? 3e4
|
|
28710
|
+
);
|
|
28711
|
+
await sleep4(backoff);
|
|
28712
|
+
}
|
|
28713
|
+
}
|
|
28714
|
+
};
|
|
28715
|
+
const stream = createStream();
|
|
28716
|
+
return { stream };
|
|
28717
|
+
};
|
|
28718
|
+
|
|
29440
28719
|
// src/lib/chat/toolLoop.ts
|
|
29441
|
-
init_serverSentEvents_gen();
|
|
29442
28720
|
init_clientConfig();
|
|
29443
28721
|
init_embeddings();
|
|
29444
28722
|
init_redactor();
|