linkque-cli-v2 1.6.20 → 1.6.21

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 +285 -161
  3. package/package.json +1 -1
  4. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-JMBJJF7P.js → chunk-2QJITP7G.js} +62 -18
  5. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-5MR5ICJ4.js → chunk-6G25V7QM.js} +2977 -2022
  6. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-WHXLLQZR.js → chunk-7PXOEKVE.js} +1 -1
  7. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-22EQ6RXO.js → chunk-JTSY7FS5.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 +1338 -657
  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 +5987 -4037
  17. package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-EAODRPW4.js +0 -518
@@ -222,50 +222,64 @@ var require_common = __commonJS({
222
222
  createDebug.namespaces = namespaces;
223
223
  createDebug.names = [];
224
224
  createDebug.skips = [];
225
- let i;
226
- const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
227
- const len = split.length;
228
- for (i = 0; i < len; i++) {
229
- if (!split[i]) {
230
- continue;
225
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
226
+ for (const ns of split) {
227
+ if (ns[0] === "-") {
228
+ createDebug.skips.push(ns.slice(1));
229
+ } else {
230
+ createDebug.names.push(ns);
231
231
  }
232
- namespaces = split[i].replace(/\*/g, ".*?");
233
- if (namespaces[0] === "-") {
234
- createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
232
+ }
233
+ }
234
+ function matchesTemplate(search, template) {
235
+ let searchIndex = 0;
236
+ let templateIndex = 0;
237
+ let starIndex = -1;
238
+ let matchIndex = 0;
239
+ while (searchIndex < search.length) {
240
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
241
+ if (template[templateIndex] === "*") {
242
+ starIndex = templateIndex;
243
+ matchIndex = searchIndex;
244
+ templateIndex++;
245
+ } else {
246
+ searchIndex++;
247
+ templateIndex++;
248
+ }
249
+ } else if (starIndex !== -1) {
250
+ templateIndex = starIndex + 1;
251
+ matchIndex++;
252
+ searchIndex = matchIndex;
235
253
  } else {
236
- createDebug.names.push(new RegExp("^" + namespaces + "$"));
254
+ return false;
237
255
  }
238
256
  }
257
+ while (templateIndex < template.length && template[templateIndex] === "*") {
258
+ templateIndex++;
259
+ }
260
+ return templateIndex === template.length;
239
261
  }
240
262
  function disable() {
241
263
  const namespaces = [
242
- ...createDebug.names.map(toNamespace),
243
- ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
264
+ ...createDebug.names,
265
+ ...createDebug.skips.map((namespace) => "-" + namespace)
244
266
  ].join(",");
245
267
  createDebug.enable("");
246
268
  return namespaces;
247
269
  }
248
270
  function enabled(name) {
249
- if (name[name.length - 1] === "*") {
250
- return true;
251
- }
252
- let i;
253
- let len;
254
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
255
- if (createDebug.skips[i].test(name)) {
271
+ for (const skip of createDebug.skips) {
272
+ if (matchesTemplate(name, skip)) {
256
273
  return false;
257
274
  }
258
275
  }
259
- for (i = 0, len = createDebug.names.length; i < len; i++) {
260
- if (createDebug.names[i].test(name)) {
276
+ for (const ns of createDebug.names) {
277
+ if (matchesTemplate(name, ns)) {
261
278
  return true;
262
279
  }
263
280
  }
264
281
  return false;
265
282
  }
266
- function toNamespace(regexp) {
267
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
268
- }
269
283
  function coerce(val) {
270
284
  if (val instanceof Error) {
271
285
  return val.stack || val.message;
@@ -384,10 +398,11 @@ var require_browser = __commonJS({
384
398
  if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
385
399
  return false;
386
400
  }
401
+ let m;
387
402
  return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
388
403
  typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
389
404
  // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
390
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
405
+ typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
391
406
  typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
392
407
  }
393
408
  function formatArgs(args) {
@@ -425,7 +440,7 @@ var require_browser = __commonJS({
425
440
  function load() {
426
441
  let r;
427
442
  try {
428
- r = exports.storage.getItem("debug");
443
+ r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
429
444
  } catch (error) {
430
445
  }
431
446
  if (!r && typeof process !== "undefined" && "env" in process) {
@@ -451,15 +466,16 @@ var require_browser = __commonJS({
451
466
  }
452
467
  });
453
468
 
454
- // ../../node_modules/has-flag/index.js
469
+ // ../../node_modules/supports-color/node_modules/has-flag/index.js
455
470
  var require_has_flag = __commonJS({
456
- "../../node_modules/has-flag/index.js"(exports, module) {
471
+ "../../node_modules/supports-color/node_modules/has-flag/index.js"(exports, module) {
457
472
  "use strict";
458
- module.exports = (flag, argv = process.argv) => {
459
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
460
- const position = argv.indexOf(prefix + flag);
461
- const terminatorPosition = argv.indexOf("--");
462
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
473
+ module.exports = function(flag, argv) {
474
+ argv = argv || process.argv;
475
+ var terminatorPos = argv.indexOf("--");
476
+ var prefix = /^--/.test(flag) ? "" : "--";
477
+ var pos = argv.indexOf(prefix + flag);
478
+ return pos !== -1 && (terminatorPos !== -1 ? pos < terminatorPos : true);
463
479
  };
464
480
  }
465
481
  });
@@ -468,26 +484,8 @@ var require_has_flag = __commonJS({
468
484
  var require_supports_color = __commonJS({
469
485
  "../../node_modules/supports-color/index.js"(exports, module) {
470
486
  "use strict";
471
- var os = __require("os");
472
- var tty = __require("tty");
473
487
  var hasFlag = require_has_flag();
474
- var { env } = process;
475
- var forceColor;
476
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
477
- forceColor = 0;
478
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
479
- forceColor = 1;
480
- }
481
- if ("FORCE_COLOR" in env) {
482
- if (env.FORCE_COLOR === "true") {
483
- forceColor = 1;
484
- } else if (env.FORCE_COLOR === "false") {
485
- forceColor = 0;
486
- } else {
487
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
488
- }
489
- }
490
- function translateLevel(level) {
488
+ var support = function(level) {
491
489
  if (level === 0) {
492
490
  return false;
493
491
  }
@@ -497,9 +495,9 @@ var require_supports_color = __commonJS({
497
495
  has256: level >= 2,
498
496
  has16m: level >= 3
499
497
  };
500
- }
501
- function supportsColor(haveStream, streamIsTTY) {
502
- if (forceColor === 0) {
498
+ };
499
+ var supportLevel = function() {
500
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
503
501
  return 0;
504
502
  }
505
503
  if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
@@ -508,61 +506,42 @@ var require_supports_color = __commonJS({
508
506
  if (hasFlag("color=256")) {
509
507
  return 2;
510
508
  }
511
- if (haveStream && !streamIsTTY && forceColor === void 0) {
512
- return 0;
509
+ if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
510
+ return 1;
513
511
  }
514
- const min = forceColor || 0;
515
- if (env.TERM === "dumb") {
516
- return min;
512
+ if (process.stdout && !process.stdout.isTTY) {
513
+ return 0;
517
514
  }
518
515
  if (process.platform === "win32") {
519
- const osRelease = os.release().split(".");
520
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
521
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
522
- }
523
516
  return 1;
524
517
  }
525
- if ("CI" in env) {
526
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
518
+ if ("CI" in process.env) {
519
+ if ("TRAVIS" in process.env || process.env.CI === "Travis") {
527
520
  return 1;
528
521
  }
529
- return min;
530
- }
531
- if ("TEAMCITY_VERSION" in env) {
532
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
533
- }
534
- if (env.COLORTERM === "truecolor") {
535
- return 3;
522
+ return 0;
536
523
  }
537
- if ("TERM_PROGRAM" in env) {
538
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
539
- switch (env.TERM_PROGRAM) {
540
- case "iTerm.app":
541
- return version >= 3 ? 3 : 2;
542
- case "Apple_Terminal":
543
- return 2;
544
- }
524
+ if ("TEAMCITY_VERSION" in process.env) {
525
+ return process.env.TEAMCITY_VERSION.match(/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/) === null ? 0 : 1;
545
526
  }
546
- if (/-256(color)?$/i.test(env.TERM)) {
527
+ if (/^(screen|xterm)-256(?:color)?/.test(process.env.TERM)) {
547
528
  return 2;
548
529
  }
549
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
530
+ if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
550
531
  return 1;
551
532
  }
552
- if ("COLORTERM" in env) {
533
+ if ("COLORTERM" in process.env) {
553
534
  return 1;
554
535
  }
555
- return min;
556
- }
557
- function getSupportLevel(stream) {
558
- const level = supportsColor(stream, stream && stream.isTTY);
559
- return translateLevel(level);
536
+ if (process.env.TERM === "dumb") {
537
+ return 0;
538
+ }
539
+ return 0;
540
+ }();
541
+ if (supportLevel === 0 && "FORCE_COLOR" in process.env) {
542
+ supportLevel = 1;
560
543
  }
561
- module.exports = {
562
- supportsColor: getSupportLevel,
563
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
564
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
565
- };
544
+ module.exports = process && support(supportLevel);
566
545
  }
567
546
  });
568
547
 
@@ -708,7 +687,7 @@ var require_node = __commonJS({
708
687
  return (/* @__PURE__ */ new Date()).toISOString() + " ";
709
688
  }
710
689
  function log(...args) {
711
- return process.stderr.write(util.format(...args) + "\n");
690
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + "\n");
712
691
  }
713
692
  function save(namespaces) {
714
693
  if (namespaces) {
@@ -6,7 +6,7 @@ import {
6
6
  mapStopReason,
7
7
  mapToolChoice,
8
8
  retainThoughtSignature
9
- } from "./chunk-JMBJJF7P.js";
9
+ } from "./chunk-2QJITP7G.js";
10
10
  import {
11
11
  formatProviderError,
12
12
  normalizeProviderError
@@ -8,7 +8,7 @@ import {
8
8
  mapStopReason,
9
9
  mapToolChoice,
10
10
  retainThoughtSignature
11
- } from "./chunk-JMBJJF7P.js";
11
+ } from "./chunk-2QJITP7G.js";
12
12
  import {
13
13
  formatProviderError,
14
14
  normalizeProviderError
@@ -388,7 +388,7 @@ async function getObservabilityModule() {
388
388
  return observabilityModule;
389
389
  }
390
390
  try {
391
- observabilityModule = await import("./otel-RUUFBBFE.js");
391
+ observabilityModule = await import("./otel-LQR5KPZ3.js");
392
392
  } catch {
393
393
  observabilityModule = null;
394
394
  }