linkque-cli-v2 1.6.18 → 1.6.20
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/dataTransformWorker.js +17 -3
- package/dev/worker.js +11 -37
- package/linkquejs.js +884 -813
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/data-transform/dataTransformWorker.js +17 -3
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{anthropic-messages-GSYNBLMR.js → anthropic-messages-TBZKK7UX.js} +2 -2
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-L5WNKJ4W.js → chunk-22EQ6RXO.js} +253 -3078
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-M6E4Y5HY.js → chunk-5MR5ICJ4.js} +1916 -2642
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-EAODRPW4.js +518 -0
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-KRE5FADB.js → chunk-JMBJJF7P.js} +11 -37
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-3BH2PDL3.js → chunk-WHXLLQZR.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-generative-ai-YD5ZGNXC.js → google-generative-ai-KD7MXONK.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-vertex-M34UDW4J.js → google-vertex-TREYA472.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-EIVAJAMW.js → mistral-conversations-5EI6JQBZ.js} +4 -4
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{otel-LQR5KPZ3.js → otel-RUUFBBFE.js} +266 -578
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +1562 -1888
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +3 -2
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +3 -2
- package/worker.js +3544 -4996
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{azure-openai-responses-NPKMM3LF.js → azure-openai-responses-IYC43YOB.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-KDHBKVSL.js → chunk-FCD4O3BT.js} +3 -3
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-codex-responses-GEFKSNVN.js → openai-codex-responses-HYLTKNTN.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-completions-TAACO6T5.js → openai-completions-CS3OYESP.js} +3 -3
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-responses-4DDTXIGI.js → openai-responses-IYAGUHY7.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{pi-messages-7JN3W3BC.js → pi-messages-XGBW55RS.js} +3 -3
package/dataTransformWorker.js
CHANGED
|
@@ -1830,8 +1830,11 @@ async function execute(module2, input) {
|
|
|
1830
1830
|
result.value.dispose();
|
|
1831
1831
|
return "{}";
|
|
1832
1832
|
}
|
|
1833
|
-
const host = context.newFunction("__hostFilter", (listHandle, promptHandle) => {
|
|
1833
|
+
const host = context.newFunction("__hostFilter", (listHandle, promptHandle, lengthHandle) => {
|
|
1834
1834
|
const modelList = JSON.parse(context.getString(listHandle));
|
|
1835
|
+
if (!Array.isArray(modelList) || modelList.length !== context.getNumber(lengthHandle)) {
|
|
1836
|
+
throw new TypeError("\u5E8F\u5217\u5316\u540E\u7684\u6A21\u578B\u6295\u5F71\u5FC5\u987B\u4E0E\u539F\u59CB\u6570\u7EC4\u7B49\u957F");
|
|
1837
|
+
}
|
|
1835
1838
|
const prompt = context.getString(promptHandle);
|
|
1836
1839
|
const callId = nextCallId++;
|
|
1837
1840
|
const promise = context.newPromise();
|
|
@@ -1863,13 +1866,22 @@ async function execute(module2, input) {
|
|
|
1863
1866
|
if (typeof prompt !== 'string') throw new TypeError('AI \u7B5B\u9009\u6307\u4EE4\u5FC5\u987B\u662F\u5B57\u7B26\u4E32');
|
|
1864
1867
|
const original = list.slice();
|
|
1865
1868
|
if (original.length === 0 || ${input.preview === true}) return original;
|
|
1866
|
-
const indices = JSON.parse(await hostFilter(JSON.stringify(modelList), prompt));
|
|
1869
|
+
const indices = JSON.parse(await hostFilter(JSON.stringify(modelList), prompt, original.length));
|
|
1867
1870
|
return indices.map(index => original[index]);
|
|
1868
1871
|
} }) });
|
|
1869
1872
|
const transform = (() => { ${input.source}
|
|
1870
1873
|
return transform; })();
|
|
1871
1874
|
if (typeof transform !== 'function') throw new TypeError('transform \u5FC5\u987B\u662F\u51FD\u6570');
|
|
1872
|
-
|
|
1875
|
+
const serialize = output => {
|
|
1876
|
+
if (output === undefined || typeof output !== 'object') {
|
|
1877
|
+
throw new TypeError('transform \u5FC5\u987B\u8FD4\u56DE JSON \u5BF9\u8C61\u6216 null');
|
|
1878
|
+
}
|
|
1879
|
+
return JSON.stringify(output);
|
|
1880
|
+
};
|
|
1881
|
+
const output = transform(input, ctx);
|
|
1882
|
+
return output && typeof output.then === 'function'
|
|
1883
|
+
? Promise.resolve(output).then(serialize)
|
|
1884
|
+
: serialize(output);
|
|
1873
1885
|
})()
|
|
1874
1886
|
`;
|
|
1875
1887
|
const evaluated = run(() => context.evalCode(source));
|
|
@@ -1879,6 +1891,8 @@ async function execute(module2, input) {
|
|
|
1879
1891
|
throw new Error(readQuickJsError(error));
|
|
1880
1892
|
}
|
|
1881
1893
|
try {
|
|
1894
|
+
if (context.typeof(evaluated.value) !== "object")
|
|
1895
|
+
return read(evaluated.value);
|
|
1882
1896
|
let done = false;
|
|
1883
1897
|
const settled = context.resolvePromise(evaluated.value).then((result2) => {
|
|
1884
1898
|
done = true;
|
package/dev/worker.js
CHANGED
|
@@ -53,7 +53,6 @@ var require_constants = __commonJS({
|
|
|
53
53
|
var require_buffer_util = __commonJS({
|
|
54
54
|
"../../node_modules/ws/lib/buffer-util.js"(exports2, module2) {
|
|
55
55
|
"use strict";
|
|
56
|
-
var { websocketMask, websocketUnmask } = require("http");
|
|
57
56
|
var { EMPTY_BUFFER } = require_constants();
|
|
58
57
|
var FastBuffer = Buffer[Symbol.species];
|
|
59
58
|
function concat(list, totalLength) {
|
|
@@ -108,16 +107,7 @@ var require_buffer_util = __commonJS({
|
|
|
108
107
|
toBuffer,
|
|
109
108
|
unmask: _unmask
|
|
110
109
|
};
|
|
111
|
-
if (
|
|
112
|
-
module2.exports.mask = function(source, mask, output, offset, length) {
|
|
113
|
-
if (length < 24) _mask(source, mask, output, offset, length);
|
|
114
|
-
else websocketMask(source, mask, output, offset, length);
|
|
115
|
-
};
|
|
116
|
-
module2.exports.unmask = function(buffer, mask) {
|
|
117
|
-
if (buffer.length < 24) _unmask(buffer, mask);
|
|
118
|
-
else websocketUnmask(buffer, mask);
|
|
119
|
-
};
|
|
120
|
-
} else if (!process.env.WS_NO_BUFFER_UTIL) {
|
|
110
|
+
if (!process.env.WS_NO_BUFFER_UTIL) {
|
|
121
111
|
try {
|
|
122
112
|
const bufferUtil = require("bufferutil");
|
|
123
113
|
module2.exports.mask = function(source, mask, output, offset, length) {
|
|
@@ -1180,7 +1170,6 @@ var require_receiver = __commonJS({
|
|
|
1180
1170
|
unmask(data, this._mask);
|
|
1181
1171
|
}
|
|
1182
1172
|
}
|
|
1183
|
-
this._mask = void 0;
|
|
1184
1173
|
if (this._opcode > 7) {
|
|
1185
1174
|
this.controlMessage(data, cb);
|
|
1186
1175
|
return;
|
|
@@ -1513,15 +1502,12 @@ var require_sender = __commonJS({
|
|
|
1513
1502
|
target[2] = target[3] = 0;
|
|
1514
1503
|
target.writeUIntBE(dataLength, 4, 6);
|
|
1515
1504
|
}
|
|
1516
|
-
if (!options.mask)
|
|
1517
|
-
return dataLength ? [target, data] : [target];
|
|
1518
|
-
}
|
|
1505
|
+
if (!options.mask) return [target, data];
|
|
1519
1506
|
target[1] |= 128;
|
|
1520
1507
|
target[offset - 4] = mask[0];
|
|
1521
1508
|
target[offset - 3] = mask[1];
|
|
1522
1509
|
target[offset - 2] = mask[2];
|
|
1523
1510
|
target[offset - 1] = mask[3];
|
|
1524
|
-
if (!dataLength) return [target];
|
|
1525
1511
|
if (skipMasking) return [target, data];
|
|
1526
1512
|
if (merge) {
|
|
1527
1513
|
applyMask(data, mask, target, offset, dataLength);
|
|
@@ -2278,7 +2264,6 @@ var require_websocket = __commonJS({
|
|
|
2278
2264
|
var https = require("https");
|
|
2279
2265
|
var http = require("http");
|
|
2280
2266
|
var net = require("net");
|
|
2281
|
-
var querystring = require("querystring");
|
|
2282
2267
|
var tls = require("tls");
|
|
2283
2268
|
var { randomBytes, createHash } = require("crypto");
|
|
2284
2269
|
var { Duplex, Readable } = require("stream");
|
|
@@ -2805,9 +2790,10 @@ var require_websocket = __commonJS({
|
|
|
2805
2790
|
throw new SyntaxError(`Invalid URL: ${address}`);
|
|
2806
2791
|
}
|
|
2807
2792
|
}
|
|
2808
|
-
if (parsedUrl.protocol === "http:"
|
|
2809
|
-
parsedUrl =
|
|
2810
|
-
|
|
2793
|
+
if (parsedUrl.protocol === "http:") {
|
|
2794
|
+
parsedUrl.protocol = "ws:";
|
|
2795
|
+
} else if (parsedUrl.protocol === "https:") {
|
|
2796
|
+
parsedUrl.protocol = "wss:";
|
|
2811
2797
|
}
|
|
2812
2798
|
websocket._url = parsedUrl.href;
|
|
2813
2799
|
const isSecure = parsedUrl.protocol === "wss:";
|
|
@@ -2876,19 +2862,12 @@ var require_websocket = __commonJS({
|
|
|
2876
2862
|
}
|
|
2877
2863
|
}
|
|
2878
2864
|
if (parsedUrl.username || parsedUrl.password) {
|
|
2879
|
-
|
|
2880
|
-
const password = querystring.unescape(parsedUrl.password);
|
|
2881
|
-
opts.auth = `${username}:${password}`;
|
|
2865
|
+
opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
|
|
2882
2866
|
}
|
|
2883
2867
|
if (isIpcUrl) {
|
|
2884
|
-
const
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
opts.path = "";
|
|
2888
|
-
} else {
|
|
2889
|
-
opts.socketPath = opts.path.slice(0, i);
|
|
2890
|
-
opts.path = opts.path.slice(i + 1);
|
|
2891
|
-
}
|
|
2868
|
+
const parts = opts.path.split(":");
|
|
2869
|
+
opts.socketPath = parts[0];
|
|
2870
|
+
opts.path = parts[1];
|
|
2892
2871
|
}
|
|
2893
2872
|
let req;
|
|
2894
2873
|
if (opts.followRedirects) {
|
|
@@ -3083,13 +3062,8 @@ var require_websocket = __commonJS({
|
|
|
3083
3062
|
function receiverOnConclude(code, reason) {
|
|
3084
3063
|
const websocket = this[kWebSocket];
|
|
3085
3064
|
websocket._closeFrameReceived = true;
|
|
3065
|
+
websocket._closeMessage = reason;
|
|
3086
3066
|
websocket._closeCode = code;
|
|
3087
|
-
if (reason.length === 0) {
|
|
3088
|
-
websocket._closeMessage = EMPTY_BUFFER;
|
|
3089
|
-
} else {
|
|
3090
|
-
websocket._closeMessage = Buffer.allocUnsafeSlow(reason.length);
|
|
3091
|
-
websocket._closeMessage.set(reason);
|
|
3092
|
-
}
|
|
3093
3067
|
if (websocket._socket[kWebSocket] === void 0) return;
|
|
3094
3068
|
websocket._socket.removeListener("data", socketOnData);
|
|
3095
3069
|
process.nextTick(resume, websocket._socket);
|