linkque-cli-v2 1.6.20 → 1.6.22

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.
Files changed (17) hide show
  1. package/dev/worker.js +61 -17
  2. package/linkquejs.js +294 -161
  3. package/package.json +1 -1
  4. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-WHXLLQZR.js → chunk-27TIUPEZ.js} +1 -1
  5. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-JMBJJF7P.js → chunk-2QJITP7G.js} +62 -18
  6. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-5MR5ICJ4.js → chunk-5YW4CWBG.js} +2988 -2022
  7. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-22EQ6RXO.js → chunk-Q6N5427R.js} +3019 -168
  8. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{dist-TGBYXSBU.js → dist-6U5W3RLM.js} +74 -95
  9. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-generative-ai-KD7MXONK.js → google-generative-ai-RT2OOQDJ.js} +1 -1
  10. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-vertex-TREYA472.js → google-vertex-HVFMVQVY.js} +1 -1
  11. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-5EI6JQBZ.js → mistral-conversations-KIOTOF73.js} +1 -1
  12. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{otel-RUUFBBFE.js → otel-LQR5KPZ3.js} +578 -266
  13. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +1357 -658
  14. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +2 -3
  15. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +2 -3
  16. package/worker.js +6028 -4038
  17. package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-EAODRPW4.js +0 -518
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkque-cli-v2",
3
- "version": "1.6.20",
3
+ "version": "1.6.22",
4
4
  "description": "Public Linkque CLI bundle for sandbox debugging",
5
5
  "bin": {
6
6
  "linkquejs": "linkquejs.js"
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  EModelProvider
3
- } from "./chunk-5MR5ICJ4.js";
3
+ } from "./chunk-5YW4CWBG.js";
4
4
 
5
5
  // ../linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js
6
6
  var baked;
@@ -1324,7 +1324,7 @@ Content-Type: ${partContentType}\r
1324
1324
  * @returns A proxy agent
1325
1325
  */
1326
1326
  static async #getProxyAgent() {
1327
- this.#proxyAgent ||= (await import("./dist-TGBYXSBU.js")).HttpsProxyAgent;
1327
+ this.#proxyAgent ||= (await import("./dist-6U5W3RLM.js")).HttpsProxyAgent;
1328
1328
  return this.#proxyAgent;
1329
1329
  }
1330
1330
  static async #getFetch() {
@@ -9350,6 +9350,7 @@ var require_constants = __commonJS({
9350
9350
  var require_buffer_util = __commonJS({
9351
9351
  "../../node_modules/ws/lib/buffer-util.js"(exports, module) {
9352
9352
  "use strict";
9353
+ var { websocketMask, websocketUnmask } = __require("http");
9353
9354
  var { EMPTY_BUFFER } = require_constants();
9354
9355
  var FastBuffer = Buffer[Symbol.species];
9355
9356
  function concat(list, totalLength) {
@@ -9404,7 +9405,16 @@ var require_buffer_util = __commonJS({
9404
9405
  toBuffer,
9405
9406
  unmask: _unmask
9406
9407
  };
9407
- if (!process.env.WS_NO_BUFFER_UTIL) {
9408
+ if (websocketMask) {
9409
+ module.exports.mask = function(source, mask, output, offset, length) {
9410
+ if (length < 24) _mask(source, mask, output, offset, length);
9411
+ else websocketMask(source, mask, output, offset, length);
9412
+ };
9413
+ module.exports.unmask = function(buffer, mask) {
9414
+ if (buffer.length < 24) _unmask(buffer, mask);
9415
+ else websocketUnmask(buffer, mask);
9416
+ };
9417
+ } else if (!process.env.WS_NO_BUFFER_UTIL) {
9408
9418
  try {
9409
9419
  const bufferUtil = __require("bufferutil");
9410
9420
  module.exports.mask = function(source, mask, output, offset, length) {
@@ -10467,6 +10477,7 @@ var require_receiver = __commonJS({
10467
10477
  unmask(data, this._mask);
10468
10478
  }
10469
10479
  }
10480
+ this._mask = void 0;
10470
10481
  if (this._opcode > 7) {
10471
10482
  this.controlMessage(data, cb);
10472
10483
  return;
@@ -10799,12 +10810,15 @@ var require_sender = __commonJS({
10799
10810
  target[2] = target[3] = 0;
10800
10811
  target.writeUIntBE(dataLength, 4, 6);
10801
10812
  }
10802
- if (!options.mask) return [target, data];
10813
+ if (!options.mask) {
10814
+ return dataLength ? [target, data] : [target];
10815
+ }
10803
10816
  target[1] |= 128;
10804
10817
  target[offset - 4] = mask[0];
10805
10818
  target[offset - 3] = mask[1];
10806
10819
  target[offset - 2] = mask[2];
10807
10820
  target[offset - 1] = mask[3];
10821
+ if (!dataLength) return [target];
10808
10822
  if (skipMasking) return [target, data];
10809
10823
  if (merge) {
10810
10824
  applyMask(data, mask, target, offset, dataLength);
@@ -11561,6 +11575,7 @@ var require_websocket = __commonJS({
11561
11575
  var https = __require("https");
11562
11576
  var http = __require("http");
11563
11577
  var net = __require("net");
11578
+ var querystring = __require("querystring");
11564
11579
  var tls = __require("tls");
11565
11580
  var { randomBytes, createHash } = __require("crypto");
11566
11581
  var { Duplex, Readable: Readable2 } = __require("stream");
@@ -11639,12 +11654,17 @@ var require_websocket = __commonJS({
11639
11654
  protocols = [protocols];
11640
11655
  }
11641
11656
  }
11642
- initAsClient(this, address, protocols, options);
11657
+ options = initAsClient(this, address, protocols, options);
11643
11658
  } else {
11644
- this._autoPong = options.autoPong;
11645
- this._closeTimeout = options.closeTimeout;
11646
11659
  this._isServer = true;
11647
11660
  }
11661
+ if (options.autoPong) {
11662
+ this._autoPong = true;
11663
+ this._autoPongComplete = () => autoPongComplete(this);
11664
+ this._pendingAutoPongs = 0;
11665
+ this._maxPendingAutoPongs = options.maxPendingAutoPongs | 0;
11666
+ }
11667
+ this._closeTimeout = options.closeTimeout;
11648
11668
  }
11649
11669
  /**
11650
11670
  * For historical reasons, the custom "nodebuffer" type is used by the default
@@ -12055,6 +12075,7 @@ var require_websocket = __commonJS({
12055
12075
  maxBufferedChunks: 256 * 1024,
12056
12076
  maxFragments: 16 * 1024,
12057
12077
  maxPayload: 100 * 1024 * 1024,
12078
+ maxPendingAutoPongs: 60,
12058
12079
  skipUTF8Validation: false,
12059
12080
  perMessageDeflate: true,
12060
12081
  followRedirects: false,
@@ -12070,8 +12091,6 @@ var require_websocket = __commonJS({
12070
12091
  path: void 0,
12071
12092
  port: void 0
12072
12093
  };
12073
- websocket._autoPong = opts.autoPong;
12074
- websocket._closeTimeout = opts.closeTimeout;
12075
12094
  if (!protocolVersions.includes(opts.protocolVersion)) {
12076
12095
  throw new RangeError(
12077
12096
  `Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`
@@ -12087,10 +12106,9 @@ var require_websocket = __commonJS({
12087
12106
  throw new SyntaxError(`Invalid URL: ${address}`);
12088
12107
  }
12089
12108
  }
12090
- if (parsedUrl.protocol === "http:") {
12091
- parsedUrl.protocol = "ws:";
12092
- } else if (parsedUrl.protocol === "https:") {
12093
- parsedUrl.protocol = "wss:";
12109
+ if (parsedUrl.protocol === "http:" || parsedUrl.protocol === "https:") {
12110
+ parsedUrl = new URL2(parsedUrl);
12111
+ parsedUrl.protocol = parsedUrl.protocol === "http:" ? "ws:" : "wss:";
12094
12112
  }
12095
12113
  websocket._url = parsedUrl.href;
12096
12114
  const isSecure = parsedUrl.protocol === "wss:";
@@ -12159,12 +12177,19 @@ var require_websocket = __commonJS({
12159
12177
  }
12160
12178
  }
12161
12179
  if (parsedUrl.username || parsedUrl.password) {
12162
- opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
12180
+ const username = querystring.unescape(parsedUrl.username);
12181
+ const password = querystring.unescape(parsedUrl.password);
12182
+ opts.auth = `${username}:${password}`;
12163
12183
  }
12164
12184
  if (isIpcUrl) {
12165
- const parts = opts.path.split(":");
12166
- opts.socketPath = parts[0];
12167
- opts.path = parts[1];
12185
+ const i = opts.path.indexOf(":");
12186
+ if (i === -1) {
12187
+ opts.socketPath = opts.path;
12188
+ opts.path = "";
12189
+ } else {
12190
+ opts.socketPath = opts.path.slice(0, i);
12191
+ opts.path = opts.path.slice(i + 1);
12192
+ }
12168
12193
  }
12169
12194
  let req;
12170
12195
  if (opts.followRedirects) {
@@ -12308,6 +12333,7 @@ var require_websocket = __commonJS({
12308
12333
  } else {
12309
12334
  req.end();
12310
12335
  }
12336
+ return opts;
12311
12337
  }
12312
12338
  function emitErrorAndClose(websocket, err) {
12313
12339
  websocket._readyState = WebSocket2.CLOSING;
@@ -12359,8 +12385,13 @@ var require_websocket = __commonJS({
12359
12385
  function receiverOnConclude(code, reason) {
12360
12386
  const websocket = this[kWebSocket];
12361
12387
  websocket._closeFrameReceived = true;
12362
- websocket._closeMessage = reason;
12363
12388
  websocket._closeCode = code;
12389
+ if (reason.length === 0) {
12390
+ websocket._closeMessage = EMPTY_BUFFER;
12391
+ } else {
12392
+ websocket._closeMessage = Buffer.allocUnsafeSlow(reason.length);
12393
+ websocket._closeMessage.set(reason);
12394
+ }
12364
12395
  if (websocket._socket[kWebSocket] === void 0) return;
12365
12396
  websocket._socket.removeListener("data", socketOnData);
12366
12397
  process.nextTick(resume, websocket._socket);
@@ -12391,9 +12422,19 @@ var require_websocket = __commonJS({
12391
12422
  }
12392
12423
  function receiverOnPing(data) {
12393
12424
  const websocket = this[kWebSocket];
12394
- if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
12425
+ if (websocket._autoPong && websocket.readyState === WebSocket2.OPEN) {
12426
+ if (websocket._maxPendingAutoPongs > 0 && websocket._pendingAutoPongs >= websocket._maxPendingAutoPongs) {
12427
+ websocket.terminate();
12428
+ } else {
12429
+ websocket._pendingAutoPongs++;
12430
+ websocket.pong(data, !this._isServer, websocket._autoPongComplete);
12431
+ }
12432
+ }
12395
12433
  websocket.emit("ping", data);
12396
12434
  }
12435
+ function autoPongComplete(websocket) {
12436
+ websocket._pendingAutoPongs--;
12437
+ }
12397
12438
  function receiverOnPong(data) {
12398
12439
  this[kWebSocket].emit("pong", data);
12399
12440
  }
@@ -12647,6 +12688,8 @@ var require_websocket_server = __commonJS({
12647
12688
  * fragments
12648
12689
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
12649
12690
  * size
12691
+ * @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
12692
+ * pending automatic pongs
12650
12693
  * @param {Boolean} [options.noServer=false] Enable no server mode
12651
12694
  * @param {String} [options.path] Accept only connections matching this path
12652
12695
  * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
@@ -12669,6 +12712,7 @@ var require_websocket_server = __commonJS({
12669
12712
  maxBufferedChunks: 256 * 1024,
12670
12713
  maxFragments: 16 * 1024,
12671
12714
  maxPayload: 100 * 1024 * 1024,
12715
+ maxPendingAutoPongs: 60,
12672
12716
  skipUTF8Validation: false,
12673
12717
  perMessageDeflate: false,
12674
12718
  handleProtocols: null,