linkque-cli-v2 1.6.7 → 1.6.9

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/linkquejs.js +102 -32
  2. package/package.json +1 -1
  3. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-C2TN5LPS.js → chunk-BJXGRRWL.js} +1 -1
  4. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-SICWMO5Y.js → chunk-DNTEEBEH.js} +0 -1
  5. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-Z2A5GMVJ.js → chunk-HGKCCOSQ.js} +1 -26
  6. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-Y2STWI2J.js → chunk-NJKO34ZC.js} +143 -62
  7. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-bsd-NYGVHXGN.js → getMachineId-bsd-JGCLGHFY.js} +1 -1
  8. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-darwin-OPTJOAYC.js → getMachineId-darwin-COHLFNXH.js} +1 -1
  9. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-linux-5SQRYTUJ.js → getMachineId-linux-XV3Z5FQG.js} +1 -1
  10. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-unsupported-OJE7WPEH.js → getMachineId-unsupported-FCRKLIZL.js} +1 -1
  11. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-win-SLTTCNXU.js → getMachineId-win-A4WRNVV6.js} +1 -1
  12. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-C43A6QIS.js → mistral-conversations-OEOTQWE5.js} +1 -1
  13. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{otel-RUUFBBFE.js → otel-WGS5CC2J.js} +1 -1
  14. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +28 -58
  15. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +3 -3
  16. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +3 -3
  17. package/worker.js +122 -76
package/linkquejs.js CHANGED
@@ -6763,6 +6763,37 @@ var require_utils = __commonJS({
6763
6763
  }
6764
6764
  return output.join("");
6765
6765
  }
6766
+ function removeDotSegmentsRelative(path24) {
6767
+ if (path24 === "" || path24[0] === "/") {
6768
+ return removeDotSegments(path24);
6769
+ }
6770
+ const segments = path24.split("/");
6771
+ const last = segments.length - 1;
6772
+ const output = [];
6773
+ let trailingDirectory = false;
6774
+ for (let i = 0; i <= last; i++) {
6775
+ const segment = segments[i];
6776
+ if (segment === "." || segment === "..") {
6777
+ if (segment === "..") {
6778
+ if (output.length !== 0 && output[output.length - 1] !== "..") {
6779
+ output.pop();
6780
+ } else {
6781
+ output.push("..");
6782
+ }
6783
+ }
6784
+ trailingDirectory = i === last;
6785
+ } else {
6786
+ output.push(segment);
6787
+ }
6788
+ }
6789
+ if (trailingDirectory && output[output.length - 1] !== "..") {
6790
+ output.push("");
6791
+ }
6792
+ if (output.length === 0 || output[0] === "" || output[0].includes(":")) {
6793
+ output.unshift(".");
6794
+ }
6795
+ return output.join("/");
6796
+ }
6766
6797
  var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
6767
6798
  var HOST_DELIM_RE = /[@/?#:]/g;
6768
6799
  var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
@@ -7023,6 +7054,7 @@ var require_utils = __commonJS({
7023
7054
  encodeFragment,
7024
7055
  escapePreservingEscapes,
7025
7056
  removeDotSegments,
7057
+ removeDotSegmentsRelative,
7026
7058
  isIPv4,
7027
7059
  isUUID,
7028
7060
  normalizeIPv6,
@@ -7246,16 +7278,18 @@ var require_schemes = __commonJS({
7246
7278
  var require_fast_uri = __commonJS({
7247
7279
  "../../node_modules/fast-uri/index.js"(exports2, module2) {
7248
7280
  "use strict";
7249
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
7281
+ var { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
7250
7282
  var { SCHEMES, getSchemeHandler } = require_schemes();
7251
7283
  var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
7252
7284
  var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
7253
- function decodeValidScheme(scheme) {
7254
- const decodedScheme = unescape(String(scheme));
7255
- if (!VALID_SCHEME.test(decodedScheme)) {
7285
+ var MALFORMED_HOST_ERROR = "URI host is malformed.";
7286
+ var FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;
7287
+ function validateScheme(scheme) {
7288
+ const stringScheme = String(scheme);
7289
+ if (!VALID_SCHEME.test(stringScheme)) {
7256
7290
  throw new TypeError(MALFORMED_SCHEME_ERROR);
7257
7291
  }
7258
- return decodedScheme;
7292
+ return stringScheme;
7259
7293
  }
7260
7294
  function normalize(uri, options) {
7261
7295
  if (typeof uri === "string") {
@@ -7292,6 +7326,9 @@ var require_fast_uri = __commonJS({
7292
7326
  const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
7293
7327
  const resolvedHost = resolved.host;
7294
7328
  const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
7329
+ if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) {
7330
+ throw new Error(MALFORMED_HOST_ERROR);
7331
+ }
7295
7332
  canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
7296
7333
  const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost);
7297
7334
  if (resolved.error && !encodedASCIIHost) {
@@ -7333,14 +7370,15 @@ var require_fast_uri = __commonJS({
7333
7370
  if (relative.path[0] === "/") {
7334
7371
  target.path = removeDotSegments(relative.path);
7335
7372
  } else {
7336
- if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
7373
+ const baseHasAuthority = base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0;
7374
+ if (baseHasAuthority && !base.path) {
7337
7375
  target.path = "/" + relative.path;
7338
7376
  } else if (!base.path) {
7339
7377
  target.path = relative.path;
7340
7378
  } else {
7341
7379
  target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
7342
7380
  }
7343
- target.path = removeDotSegments(target.path);
7381
+ target.path = base.scheme === void 0 && !baseHasAuthority && target.path[0] !== "/" ? removeDotSegmentsRelative(target.path) : removeDotSegments(target.path);
7344
7382
  }
7345
7383
  target.query = relative.query;
7346
7384
  }
@@ -7378,12 +7416,13 @@ var require_fast_uri = __commonJS({
7378
7416
  const options = Object.assign({}, opts);
7379
7417
  const uriTokens = [];
7380
7418
  if (component.scheme) {
7381
- component.scheme = decodeValidScheme(component.scheme);
7419
+ component.scheme = validateScheme(component.scheme);
7382
7420
  }
7383
7421
  const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
7384
7422
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
7385
7423
  const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
7386
- const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority;
7424
+ const schemelessReference = (component.scheme === void 0 || options.reference === "suffix") && !hasAuthority;
7425
+ const pathNoScheme = !options.skipEscape && schemelessReference;
7387
7426
  if (component.path !== void 0) {
7388
7427
  if (!options.skipEscape) {
7389
7428
  component.path = serializePathEncoding(component.path, pathNoScheme);
@@ -7392,7 +7431,7 @@ var require_fast_uri = __commonJS({
7392
7431
  }
7393
7432
  }
7394
7433
  if (options.reference !== "suffix" && component.scheme) {
7395
- component.scheme = decodeValidScheme(component.scheme);
7434
+ component.scheme = validateScheme(component.scheme);
7396
7435
  uriTokens.push(component.scheme, ":");
7397
7436
  }
7398
7437
  const authority = recomposeAuthority(component);
@@ -7408,9 +7447,9 @@ var require_fast_uri = __commonJS({
7408
7447
  if (component.path !== void 0) {
7409
7448
  let s4 = component.path;
7410
7449
  if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
7411
- s4 = removeDotSegments(s4);
7450
+ s4 = schemelessReference && s4[0] !== "/" ? removeDotSegmentsRelative(s4) : removeDotSegments(s4);
7412
7451
  }
7413
- if (pathNoScheme) {
7452
+ if (schemelessReference) {
7414
7453
  s4 = serializePathEncoding(s4, true);
7415
7454
  }
7416
7455
  if (authority === void 0 && s4[0] === "/" && s4[1] === "/") {
@@ -7457,16 +7496,34 @@ var require_fast_uri = __commonJS({
7457
7496
  return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
7458
7497
  }
7459
7498
  function canonicalizeHost(parsed, options, schemeHandler, isIP) {
7499
+ if (hasForbiddenDomainHost(parsed, options, schemeHandler, isIP)) {
7500
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
7501
+ return true;
7502
+ }
7460
7503
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
7504
+ let url2;
7461
7505
  try {
7462
- parsed.host = new URL("http://" + parsed.host).hostname;
7506
+ url2 = new URL("http://" + parsed.host);
7463
7507
  } catch (e3) {
7464
7508
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e3;
7465
7509
  return true;
7466
7510
  }
7511
+ if (!isHostOnlyURL(url2)) {
7512
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
7513
+ return true;
7514
+ }
7515
+ parsed.host = url2.hostname;
7467
7516
  }
7468
7517
  return false;
7469
7518
  }
7519
+ function hasForbiddenDomainHost(parsed, options, schemeHandler, isIP) {
7520
+ return Boolean(
7521
+ parsed.host && isIP === false && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed.host)
7522
+ );
7523
+ }
7524
+ function isHostOnlyURL(url2) {
7525
+ return url2.username === "" && url2.password === "" && url2.port === "" && url2.pathname === "/" && url2.search === "" && url2.hash === "" && url2.hostname !== "";
7526
+ }
7470
7527
  function parseWithStatus(uri, opts) {
7471
7528
  const options = Object.assign({}, opts);
7472
7529
  const parsed = {
@@ -7521,9 +7578,8 @@ var require_fast_uri = __commonJS({
7521
7578
  parsed.query = matches[7];
7522
7579
  parsed.fragment = matches[8];
7523
7580
  if (parsed.scheme !== void 0) {
7524
- const decodedScheme = unescape(parsed.scheme);
7525
- if (VALID_SCHEME.test(decodedScheme)) {
7526
- parsed.scheme = decodedScheme.toLowerCase();
7581
+ if (VALID_SCHEME.test(parsed.scheme)) {
7582
+ parsed.scheme = parsed.scheme.toLowerCase();
7527
7583
  } else {
7528
7584
  parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
7529
7585
  malformedScheme = true;
@@ -7551,7 +7607,7 @@ var require_fast_uri = __commonJS({
7551
7607
  malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
7552
7608
  parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
7553
7609
  if (malformedIPLiteral) {
7554
- parsed.error = parsed.error || "URI host is malformed.";
7610
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
7555
7611
  malformedAuthorityOrPort = true;
7556
7612
  }
7557
7613
  } else {
@@ -7579,7 +7635,7 @@ var require_fast_uri = __commonJS({
7579
7635
  if (!isIP) {
7580
7636
  host = normalizePercentEncoding(host.toLowerCase());
7581
7637
  }
7582
- parsed.host = reescapeHostDelimiters(host, isIP);
7638
+ parsed.host = isIP || options.scheme !== "null" ? reescapeHostDelimiters(host, isIP) : host;
7583
7639
  }
7584
7640
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
7585
7641
  if (parsed.path) {
@@ -22489,11 +22545,11 @@ function validateClientAction(body, path24, issues) {
22489
22545
  issues.push(issue2(`${path24}.context`, "INVALID_CLIENT_ACTION_CONTEXT", "ui.surface.open requires context.surfaceId"));
22490
22546
  return;
22491
22547
  }
22492
- if (body.name === "ui.page.open") {
22548
+ if (body.name === "ui.page.open" || body.name === "ui.miniprogram.embed") {
22493
22549
  if (!isPlainRecord(body.context) || Object.keys(body.context).length !== 1 || typeof body.context.url !== "string" && !isStrictBinding(body.context.url))
22494
- issues.push(issue2(`${path24}.context`, "INVALID_CLIENT_ACTION_CONTEXT", "ui.page.open requires one literal or bound URL"));
22550
+ issues.push(issue2(`${path24}.context`, "INVALID_CLIENT_ACTION_CONTEXT", `${body.name} requires one literal or bound URL`));
22495
22551
  else if (typeof body.context.url === "string" && !isSafePageUrl(body.context.url))
22496
- issues.push(issue2(`${path24}.context.url`, "INVALID_PAGE_URL", "ui.page.open URL must use https or the approved Alipay scheme"));
22552
+ issues.push(issue2(`${path24}.context.url`, "INVALID_PAGE_URL", `${body.name} URL must use https or the approved Alipay scheme`));
22497
22553
  return;
22498
22554
  }
22499
22555
  issues.push(issue2(`${path24}.name`, "UNSUPPORTED_CLIENT_ACTION", `unsupported client action ${String(body.name)}`));
@@ -24446,7 +24502,7 @@ function getA2UICardAuthoringDiagnostics(bundle, partial2) {
24446
24502
  const component = findComponent(bundle, group.surfaceId, group.componentId);
24447
24503
  const action = isPlainRecord(component?.action) ? component.action : void 0;
24448
24504
  const client = action && isPlainRecord(action.client) ? action.client : void 0;
24449
- if (client?.name === "ui.page.open") {
24505
+ if (client?.name === "ui.page.open" || client?.name === "ui.miniprogram.embed") {
24450
24506
  const context = isPlainRecord(client.context) ? client.context : void 0;
24451
24507
  if (typeof context?.url === "string" && !isSafePageUrl2(context.url)) {
24452
24508
  diagnostics.push({
@@ -24586,16 +24642,16 @@ function actionTargets(component, occurrenceId) {
24586
24642
  ];
24587
24643
  }
24588
24644
  const client = isPlainRecord(action.client) ? action.client : void 0;
24589
- if (client?.name === "ui.page.open") {
24645
+ if (client?.name === "ui.page.open" || client?.name === "ui.miniprogram.embed") {
24590
24646
  const context = isPlainRecord(client.context) ? client.context : void 0;
24591
24647
  const url2 = context?.url;
24592
24648
  return [
24593
24649
  {
24594
- kind: "page-open",
24650
+ kind: client.name === "ui.miniprogram.embed" ? "miniprogram-embed" : "page-open",
24595
24651
  targetId: createA2UICardAuthoringTargetId(occurrenceId, "action"),
24596
24652
  occurrenceId,
24597
24653
  propertyPath: "action",
24598
- label: "\u6253\u5F00\u9875\u9762",
24654
+ label: client.name === "ui.miniprogram.embed" ? "\u5C0F\u7A0B\u5E8F\u534A\u5C4F\u6253\u5F00" : "\u6253\u5F00\u9875\u9762",
24599
24655
  ...typeof url2 === "string" ? { url: url2 } : {},
24600
24656
  dynamic: isPlainRecord(url2) && typeof url2.path === "string"
24601
24657
  }
@@ -38444,6 +38500,7 @@ var ERR_INVALID_UNIX_ID_SIZE = "uid/gid must be 0..65535 for unixExtraFieldType
38444
38500
  var ERR_INVALID_MSDOS_ATTRIBUTES = "Invalid msdosAttributesRaw (must be integer 0..255)";
38445
38501
  var ERR_INVALID_MSDOS_DATA = "Invalid msdosAttributes (must be an object with boolean flags)";
38446
38502
  var ERR_INVALID_LEVEL = "Invalid level (must be integer 0..9)";
38503
+ var ERR_INVALID_UNCOMPRESSED_SIZE_OPTION = "Invalid uncompressedSize option (must be a non-negative integer)";
38447
38504
  var ERR_INVALID_SIGNATURE_DATA = "Signature data exceeds 64KB";
38448
38505
  var ERR_INVALID_ENTRY = "Invalid entry option (must be an entry returned by ZipReader#getEntries())";
38449
38506
  var ERR_ZIP_CRYPTO_LAST_MOD_DATE = "The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set";
@@ -39216,8 +39273,10 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
39216
39273
  let maximumCompressedSize = 0;
39217
39274
  let uncompressedSize = 0;
39218
39275
  let unknownSize = false;
39276
+ const uncompressedSizeOption = toNumber(options[PROPERTY_NAME_UNCOMPRESSED_SIZE]);
39277
+ checkIntegerOption(uncompressedSizeOption, Number.MAX_SAFE_INTEGER, ERR_INVALID_UNCOMPRESSED_SIZE_OPTION);
39219
39278
  if (passThroughCompression && hasContent) {
39220
- uncompressedSize = options[PROPERTY_NAME_UNCOMPRESSED_SIZE];
39279
+ uncompressedSize = uncompressedSizeOption;
39221
39280
  if (uncompressedSize === UNDEFINED_VALUE) {
39222
39281
  throw new Error(ERR_UNDEFINED_UNCOMPRESSED_SIZE);
39223
39282
  }
@@ -39238,14 +39297,14 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
39238
39297
  const encryptionOverhead = getEncryptionOverhead(encryptedEntry, zipCrypto, encryptionStrength);
39239
39298
  if (hasContent) {
39240
39299
  if (!passThroughCompression) {
39241
- if (contentSize === UNDEFINED_VALUE) {
39242
- dataDescriptor = true;
39300
+ const expectedSize = contentSize === UNDEFINED_VALUE ? uncompressedSizeOption : contentSize;
39301
+ if (expectedSize === UNDEFINED_VALUE) {
39243
39302
  if (zip64 || zip64 === UNDEFINED_VALUE) {
39244
39303
  zip64 = unknownSize = true;
39245
39304
  maximumCompressedSize = MAX_32_BITS + 1;
39246
39305
  }
39247
39306
  } else {
39248
- options.uncompressedSize = uncompressedSize = contentSize;
39307
+ options.uncompressedSize = uncompressedSize = expectedSize;
39249
39308
  maximumCompressedSize = (isCompressed(compressionMethod, level) ? getMaximumCompressedSize(uncompressedSize) : uncompressedSize) + encryptionOverhead;
39250
39309
  }
39251
39310
  } else {
@@ -39254,7 +39313,9 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
39254
39313
  }
39255
39314
  }
39256
39315
  const emptyEntry = !encryptedEntry && (!hasContent || contentSize === 0 && !passThroughCompression) && !isCompressed(compressionMethod, level);
39257
- if (emptyEntry && getOptionValue2(zipWriter, options, OPTION_DATA_DESCRIPTOR) === UNDEFINED_VALUE) {
39316
+ const crc32Provided = options.crc32 !== UNDEFINED_VALUE || options[PROPERTY_NAME_SIGNATURE] !== UNDEFINED_VALUE;
39317
+ const completeHeader = passThroughCompression && hasContent && contentSize !== UNDEFINED_VALUE && !(encryptedEntry && zipCrypto) && (crc32Provided || encryptedEntry && !zipCrypto);
39318
+ if ((emptyEntry || completeHeader) && getOptionValue2(zipWriter, options, OPTION_DATA_DESCRIPTOR) === UNDEFINED_VALUE) {
39258
39319
  dataDescriptor = false;
39259
39320
  }
39260
39321
  const zip64UncompressedSize = zip64Enabled || unknownSize || uncompressedSize >= MAX_32_BITS;
@@ -39272,6 +39333,8 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
39272
39333
  resolvedOptions: {
39273
39334
  dataDescriptor,
39274
39335
  emptyEntry,
39336
+ completeHeader,
39337
+ knownCompressedSize: completeHeader ? maximumCompressedSize : UNDEFINED_VALUE,
39275
39338
  zip64,
39276
39339
  zip64Enabled,
39277
39340
  unknownSize,
@@ -39293,6 +39356,7 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
39293
39356
  keepOrder,
39294
39357
  dataDescriptor,
39295
39358
  emptyEntry,
39359
+ completeHeader,
39296
39360
  signal
39297
39361
  } = options;
39298
39362
  const {
@@ -39314,7 +39378,7 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
39314
39378
  const lockPreviousFileEntry = keepOrder && previousFileEntry ? previousFileEntry.lockFileEntry : UNDEFINED_VALUE;
39315
39379
  fileEntries.set(name, fileEntry);
39316
39380
  try {
39317
- if (options.bufferedWrite || !keepOrder || zipWriter.writerLocked || zipWriter.bufferedWrites || zipWriter.directWrites || !dataDescriptor && !emptyEntry) {
39381
+ if (options.bufferedWrite || !keepOrder || zipWriter.writerLocked || zipWriter.bufferedWrites || zipWriter.directWrites || !dataDescriptor && !emptyEntry && !completeHeader) {
39318
39382
  bufferedWrite = true;
39319
39383
  zipWriter.bufferedWrites++;
39320
39384
  if (options.createTempStream) {
@@ -39657,10 +39721,12 @@ function getHeaderInfo(options) {
39657
39721
  zip64UncompressedSize,
39658
39722
  zip64CompressedSize,
39659
39723
  uncompressedSize,
39724
+ knownCompressedSize,
39660
39725
  unknownSize,
39661
39726
  crc32
39662
39727
  } = options;
39663
39728
  let { version: version3, compressionMethod } = options;
39729
+ const compressedSize = dataDescriptor ? UNDEFINED_VALUE : knownCompressedSize;
39664
39730
  const compressed = !directory && isCompressed(compressionMethod, level);
39665
39731
  let rawLocalExtraFieldZip64;
39666
39732
  const uncompressedFile = passThroughCompression || !compressed;
@@ -39676,7 +39742,7 @@ function getHeaderInfo(options) {
39676
39742
  extraFieldZip64.writeUint64(uncompressedSize);
39677
39743
  if (uncompressedFile) {
39678
39744
  const encryptionOverhead = getEncryptionOverhead(encrypted, zipCrypto, encryptionStrength);
39679
- extraFieldZip64.writeUint64(passThroughCompression ? 0 : uncompressedSize + encryptionOverhead);
39745
+ extraFieldZip64.writeUint64(passThroughCompression ? compressedSize === UNDEFINED_VALUE ? 0 : compressedSize : uncompressedSize + encryptionOverhead);
39680
39746
  }
39681
39747
  }
39682
39748
  } else {
@@ -39814,6 +39880,7 @@ function getHeaderInfo(options) {
39814
39880
  bitFlag: getBitFlag(level, useUnicodeFileNames, dataDescriptor, encrypted, compressionMethod),
39815
39881
  compressionMethod,
39816
39882
  uncompressedSize,
39883
+ compressedSize,
39817
39884
  lastModDate: clampedLastModDate,
39818
39885
  rawLastModDate: rawLastModDateOption,
39819
39886
  rawFilename,
@@ -39821,6 +39888,9 @@ function getHeaderInfo(options) {
39821
39888
  zip64UncompressedSize,
39822
39889
  extraFieldLength
39823
39890
  });
39891
+ if (compressedSize !== UNDEFINED_VALUE && passThroughCompression && crc32 !== UNDEFINED_VALUE) {
39892
+ setUint32(headerView, HEADER_OFFSET_SIGNATURE, crc32);
39893
+ }
39824
39894
  const localHeader = createRecordWriter(HEADER_SIZE + getLength(rawFilename) + extraFieldLength);
39825
39895
  const localHeaderArray = localHeader.array;
39826
39896
  const localHeaderView = getDataView(localHeaderArray);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkque-cli-v2",
3
- "version": "1.6.7",
3
+ "version": "1.6.9",
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-Y2STWI2J.js";
3
+ } from "./chunk-NJKO34ZC.js";
4
4
 
5
5
  // ../linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js
6
6
  var baked;
@@ -1632,7 +1632,6 @@ var init_esm = __esm({
1632
1632
  export {
1633
1633
  createContextKey,
1634
1634
  ROOT_CONTEXT,
1635
- isValidTraceId,
1636
1635
  isSpanContextValid,
1637
1636
  SpanKind,
1638
1637
  SpanStatusCode,
@@ -22,7 +22,7 @@ import {
22
22
  RUNTIME_CONFIG_DEFAULTS,
23
23
  RuntimeConfigProvider,
24
24
  isDebugLoggingEnabled
25
- } from "./chunk-Y2STWI2J.js";
25
+ } from "./chunk-NJKO34ZC.js";
26
26
  import {
27
27
  __commonJS,
28
28
  __require,
@@ -15663,7 +15663,6 @@ var API_KEY_HEADER = "x-appwrite-key";
15663
15663
  var TRIGGER_HEADER = "x-appwrite-trigger";
15664
15664
  var ENV_SELECTOR_HEADER = "x-linkque-env";
15665
15665
  var TRACE_ID_HEADER = "x-trace-id";
15666
- var OTEL_TRACE_ID_HEADER = "x-linkque-otel-trace-id";
15667
15666
  var TEMPORARY_FRONTEND_APP_ID_HEADER = "x-linkque-alipay-app-id";
15668
15667
  var ALIPAY_AUTH_CODE_HEADER = "x-alipay-authcode";
15669
15668
  var AUTH_UNAVAILABLE_HEADER = "x-linkque-phone-auth-unavailable";
@@ -15743,28 +15742,6 @@ function readTraceId(headers) {
15743
15742
  }
15744
15743
  return void 0;
15745
15744
  }
15746
- function readOtelTraceId(headers) {
15747
- if (!headers)
15748
- return { kind: "missing" };
15749
- let found = Object.prototype.hasOwnProperty.call(headers, OTEL_TRACE_ID_HEADER);
15750
- let value = found ? headers[OTEL_TRACE_ID_HEADER] : void 0;
15751
- if (!found) {
15752
- for (const [key, candidate] of Object.entries(headers)) {
15753
- if (key.toLowerCase() === OTEL_TRACE_ID_HEADER) {
15754
- found = true;
15755
- value = candidate;
15756
- break;
15757
- }
15758
- }
15759
- }
15760
- if (!found)
15761
- return { kind: "missing" };
15762
- const raw = headValue(value);
15763
- if (!raw)
15764
- return { kind: "invalid" };
15765
- const traceId = raw.toLowerCase();
15766
- return /^[0-9a-f]{32}$/u.test(traceId) && traceId !== "00000000000000000000000000000000" ? { kind: "valid", traceId } : { kind: "invalid" };
15767
- }
15768
15745
  function readTemporaryFrontendAppId(headers) {
15769
15746
  if (!headers)
15770
15747
  return void 0;
@@ -15931,7 +15908,6 @@ export {
15931
15908
  LinkqueGatewayAuthError,
15932
15909
  LinkqueGatewayAuthUnconfiguredError,
15933
15910
  resolveLinkqueGatewayRequestAuth,
15934
- resolveLinkqueGatewayAuth,
15935
15911
  resolveGatewayAuthContext,
15936
15912
  resolveBodyJSON,
15937
15913
  toAgentRunMessages,
@@ -15940,7 +15916,6 @@ export {
15940
15916
  mcpPhoneAuthorizationChallenge,
15941
15917
  readEnvSelector,
15942
15918
  readTraceId,
15943
- readOtelTraceId,
15944
15919
  readTemporaryFrontendAppId,
15945
15920
  readAuthenticatedUserId,
15946
15921
  readAppwriteApiKey,