@botpress/runtime 1.12.4 → 1.13.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.
@@ -48,7 +48,7 @@ var init_define_BUILD = __esm({
48
48
  var define_PACKAGE_VERSIONS_default;
49
49
  var init_define_PACKAGE_VERSIONS = __esm({
50
50
  "<define:__PACKAGE_VERSIONS__>"() {
51
- define_PACKAGE_VERSIONS_default = { runtime: "1.12.4", adk: "1.12.4", sdk: "4.20.2", llmz: "0.0.33", zai: "2.5.0", cognitive: "0.2.0" };
51
+ define_PACKAGE_VERSIONS_default = { runtime: "1.13.1", adk: "1.13.1", sdk: "5.0.2", llmz: "0.0.35", zai: "2.5.5", cognitive: "0.3.3" };
52
52
  }
53
53
  });
54
54
 
@@ -10652,7 +10652,7 @@ var require_form_data = __commonJS({
10652
10652
  var CombinedStream = require_combined_stream();
10653
10653
  var util3 = __require("util");
10654
10654
  var path4 = __require("path");
10655
- var http3 = __require("http");
10655
+ var http4 = __require("http");
10656
10656
  var https3 = __require("https");
10657
10657
  var parseUrl = __require("url").parse;
10658
10658
  var fs3 = __require("fs");
@@ -10924,7 +10924,7 @@ var require_form_data = __commonJS({
10924
10924
  if (options.protocol === "https:") {
10925
10925
  request = https3.request(options);
10926
10926
  } else {
10927
- request = http3.request(options);
10927
+ request = http4.request(options);
10928
10928
  }
10929
10929
  this.getLength(function(err, length) {
10930
10930
  if (err && err !== "Unknown stream") {
@@ -11217,7 +11217,7 @@ var init_InterceptorManager = __esm({
11217
11217
  *
11218
11218
  * @param {Number} id The ID that was returned by `use`
11219
11219
  *
11220
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
11220
+ * @returns {void}
11221
11221
  */
11222
11222
  eject(id) {
11223
11223
  if (this.handlers[id]) {
@@ -12865,7 +12865,7 @@ var require_follow_redirects = __commonJS({
12865
12865
  init_define_PACKAGE_VERSIONS();
12866
12866
  var url2 = __require("url");
12867
12867
  var URL2 = url2.URL;
12868
- var http3 = __require("http");
12868
+ var http4 = __require("http");
12869
12869
  var https3 = __require("https");
12870
12870
  var Writable = __require("stream").Writable;
12871
12871
  var assert3 = __require("assert");
@@ -13351,7 +13351,7 @@ var require_follow_redirects = __commonJS({
13351
13351
  function isURL(value) {
13352
13352
  return URL2 && value instanceof URL2;
13353
13353
  }
13354
- module.exports = wrap({ http: http3, https: https3 });
13354
+ module.exports = wrap({ http: http4, https: https3 });
13355
13355
  module.exports.wrap = wrap;
13356
13356
  }
13357
13357
  });
@@ -13362,7 +13362,7 @@ var init_data = __esm({
13362
13362
  "../../node_modules/axios/lib/env/data.js"() {
13363
13363
  init_define_BUILD();
13364
13364
  init_define_PACKAGE_VERSIONS();
13365
- VERSION = "1.12.2";
13365
+ VERSION = "1.13.2";
13366
13366
  }
13367
13367
  });
13368
13368
 
@@ -13900,6 +13900,7 @@ var init_estimateDataURLDecodedBytes = __esm({
13900
13900
  // ../../node_modules/axios/lib/adapters/http.js
13901
13901
  import http from "http";
13902
13902
  import https from "https";
13903
+ import http2 from "http2";
13903
13904
  import util2 from "util";
13904
13905
  import zlib from "zlib";
13905
13906
  import stream3 from "stream";
@@ -13945,10 +13946,9 @@ function setProxy(options, configProxy, location) {
13945
13946
  setProxy(redirectOptions, configProxy, redirectOptions.href);
13946
13947
  };
13947
13948
  }
13948
- var import_proxy_from_env, import_follow_redirects, zlibOptions, brotliOptions, isBrotliSupported, httpFollow, httpsFollow, isHttps, supportedProtocols, flushOnFinish, isHttpAdapterSupported, wrapAsync, resolveFamily, buildAddressEntry, http_default;
13949
+ var import_proxy_from_env, import_follow_redirects, zlibOptions, brotliOptions, isBrotliSupported, httpFollow, httpsFollow, isHttps, supportedProtocols, flushOnFinish, Http2Sessions, http2Sessions, isHttpAdapterSupported, wrapAsync, resolveFamily, buildAddressEntry, http2Transport, http_default;
13949
13950
  var init_http = __esm({
13950
13951
  "../../node_modules/axios/lib/adapters/http.js"() {
13951
- "use strict";
13952
13952
  init_define_BUILD();
13953
13953
  init_define_PACKAGE_VERSIONS();
13954
13954
  init_utils();
@@ -13989,6 +13989,76 @@ var init_http = __esm({
13989
13989
  stream5.on("end", flush).on("error", flush);
13990
13990
  return throttled;
13991
13991
  };
13992
+ Http2Sessions = class {
13993
+ constructor() {
13994
+ this.sessions = /* @__PURE__ */ Object.create(null);
13995
+ }
13996
+ getSession(authority, options) {
13997
+ options = Object.assign({
13998
+ sessionTimeout: 1e3
13999
+ }, options);
14000
+ let authoritySessions = this.sessions[authority];
14001
+ if (authoritySessions) {
14002
+ let len = authoritySessions.length;
14003
+ for (let i = 0; i < len; i++) {
14004
+ const [sessionHandle, sessionOptions] = authoritySessions[i];
14005
+ if (!sessionHandle.destroyed && !sessionHandle.closed && util2.isDeepStrictEqual(sessionOptions, options)) {
14006
+ return sessionHandle;
14007
+ }
14008
+ }
14009
+ }
14010
+ const session = http2.connect(authority, options);
14011
+ let removed;
14012
+ const removeSession = () => {
14013
+ if (removed) {
14014
+ return;
14015
+ }
14016
+ removed = true;
14017
+ let entries = authoritySessions, len = entries.length, i = len;
14018
+ while (i--) {
14019
+ if (entries[i][0] === session) {
14020
+ if (len === 1) {
14021
+ delete this.sessions[authority];
14022
+ } else {
14023
+ entries.splice(i, 1);
14024
+ }
14025
+ return;
14026
+ }
14027
+ }
14028
+ };
14029
+ const originalRequestFn = session.request;
14030
+ const { sessionTimeout } = options;
14031
+ if (sessionTimeout != null) {
14032
+ let timer;
14033
+ let streamsCount = 0;
14034
+ session.request = function() {
14035
+ const stream5 = originalRequestFn.apply(this, arguments);
14036
+ streamsCount++;
14037
+ if (timer) {
14038
+ clearTimeout(timer);
14039
+ timer = null;
14040
+ }
14041
+ stream5.once("close", () => {
14042
+ if (!--streamsCount) {
14043
+ timer = setTimeout(() => {
14044
+ timer = null;
14045
+ removeSession();
14046
+ }, sessionTimeout);
14047
+ }
14048
+ });
14049
+ return stream5;
14050
+ };
14051
+ }
14052
+ session.once("close", removeSession);
14053
+ let entry = [
14054
+ session,
14055
+ options
14056
+ ];
14057
+ authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
14058
+ return session;
14059
+ }
14060
+ };
14061
+ http2Sessions = new Http2Sessions();
13992
14062
  isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
13993
14063
  wrapAsync = (asyncExecutor) => {
13994
14064
  return new Promise((resolve, reject) => {
@@ -14020,14 +14090,54 @@ var init_http = __esm({
14020
14090
  };
14021
14091
  };
14022
14092
  buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family });
14093
+ http2Transport = {
14094
+ request(options, cb) {
14095
+ const authority = options.protocol + "//" + options.hostname + ":" + (options.port || 80);
14096
+ const { http2Options, headers } = options;
14097
+ const session = http2Sessions.getSession(authority, http2Options);
14098
+ const {
14099
+ HTTP2_HEADER_SCHEME,
14100
+ HTTP2_HEADER_METHOD,
14101
+ HTTP2_HEADER_PATH,
14102
+ HTTP2_HEADER_STATUS
14103
+ } = http2.constants;
14104
+ const http2Headers = {
14105
+ [HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""),
14106
+ [HTTP2_HEADER_METHOD]: options.method,
14107
+ [HTTP2_HEADER_PATH]: options.path
14108
+ };
14109
+ utils_default.forEach(headers, (header, name) => {
14110
+ name.charAt(0) !== ":" && (http2Headers[name] = header);
14111
+ });
14112
+ const req = session.request(http2Headers);
14113
+ req.once("response", (responseHeaders) => {
14114
+ const response = req;
14115
+ responseHeaders = Object.assign({}, responseHeaders);
14116
+ const status = responseHeaders[HTTP2_HEADER_STATUS];
14117
+ delete responseHeaders[HTTP2_HEADER_STATUS];
14118
+ response.headers = responseHeaders;
14119
+ response.statusCode = +status;
14120
+ cb(response);
14121
+ });
14122
+ return req;
14123
+ }
14124
+ };
14023
14125
  http_default = isHttpAdapterSupported && function httpAdapter(config) {
14024
14126
  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
14025
- let { data, lookup, family } = config;
14127
+ let { data, lookup, family, httpVersion = 1, http2Options } = config;
14026
14128
  const { responseType, responseEncoding } = config;
14027
14129
  const method = config.method.toUpperCase();
14028
14130
  let isDone;
14029
14131
  let rejected = false;
14030
14132
  let req;
14133
+ httpVersion = +httpVersion;
14134
+ if (Number.isNaN(httpVersion)) {
14135
+ throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
14136
+ }
14137
+ if (httpVersion !== 1 && httpVersion !== 2) {
14138
+ throw TypeError(`Unsupported protocol version '${httpVersion}'`);
14139
+ }
14140
+ const isHttp2 = httpVersion === 2;
14031
14141
  if (lookup) {
14032
14142
  const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]);
14033
14143
  lookup = (hostname, opt, cb) => {
@@ -14040,7 +14150,15 @@ var init_http = __esm({
14040
14150
  });
14041
14151
  };
14042
14152
  }
14043
- const emitter = new EventEmitter();
14153
+ const abortEmitter = new EventEmitter();
14154
+ function abort(reason) {
14155
+ try {
14156
+ abortEmitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
14157
+ } catch (err) {
14158
+ console.warn("emit error", err);
14159
+ }
14160
+ }
14161
+ abortEmitter.once("abort", reject);
14044
14162
  const onFinished = () => {
14045
14163
  if (config.cancelToken) {
14046
14164
  config.cancelToken.unsubscribe(abort);
@@ -14048,25 +14166,31 @@ var init_http = __esm({
14048
14166
  if (config.signal) {
14049
14167
  config.signal.removeEventListener("abort", abort);
14050
14168
  }
14051
- emitter.removeAllListeners();
14169
+ abortEmitter.removeAllListeners();
14052
14170
  };
14053
- onDone((value, isRejected) => {
14054
- isDone = true;
14055
- if (isRejected) {
14056
- rejected = true;
14057
- onFinished();
14058
- }
14059
- });
14060
- function abort(reason) {
14061
- emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
14062
- }
14063
- emitter.once("abort", reject);
14064
14171
  if (config.cancelToken || config.signal) {
14065
14172
  config.cancelToken && config.cancelToken.subscribe(abort);
14066
14173
  if (config.signal) {
14067
14174
  config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
14068
14175
  }
14069
14176
  }
14177
+ onDone((response, isRejected) => {
14178
+ isDone = true;
14179
+ if (isRejected) {
14180
+ rejected = true;
14181
+ onFinished();
14182
+ return;
14183
+ }
14184
+ const { data: data2 } = response;
14185
+ if (data2 instanceof stream3.Readable || data2 instanceof stream3.Duplex) {
14186
+ const offListeners = stream3.finished(data2, () => {
14187
+ offListeners();
14188
+ onFinished();
14189
+ });
14190
+ } else {
14191
+ onFinished();
14192
+ }
14193
+ });
14070
14194
  const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
14071
14195
  const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
14072
14196
  const protocol = parsed.protocol || supportedProtocols[0];
@@ -14232,7 +14356,8 @@ var init_http = __esm({
14232
14356
  protocol,
14233
14357
  family,
14234
14358
  beforeRedirect: dispatchBeforeRedirect,
14235
- beforeRedirects: {}
14359
+ beforeRedirects: {},
14360
+ http2Options
14236
14361
  };
14237
14362
  !utils_default.isUndefined(lookup) && (options.lookup = lookup);
14238
14363
  if (config.socketPath) {
@@ -14245,18 +14370,22 @@ var init_http = __esm({
14245
14370
  let transport;
14246
14371
  const isHttpsRequest = isHttps.test(options.protocol);
14247
14372
  options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
14248
- if (config.transport) {
14249
- transport = config.transport;
14250
- } else if (config.maxRedirects === 0) {
14251
- transport = isHttpsRequest ? https : http;
14373
+ if (isHttp2) {
14374
+ transport = http2Transport;
14252
14375
  } else {
14253
- if (config.maxRedirects) {
14254
- options.maxRedirects = config.maxRedirects;
14255
- }
14256
- if (config.beforeRedirect) {
14257
- options.beforeRedirects.config = config.beforeRedirect;
14376
+ if (config.transport) {
14377
+ transport = config.transport;
14378
+ } else if (config.maxRedirects === 0) {
14379
+ transport = isHttpsRequest ? https : http;
14380
+ } else {
14381
+ if (config.maxRedirects) {
14382
+ options.maxRedirects = config.maxRedirects;
14383
+ }
14384
+ if (config.beforeRedirect) {
14385
+ options.beforeRedirects.config = config.beforeRedirect;
14386
+ }
14387
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
14258
14388
  }
14259
- transport = isHttpsRequest ? httpsFollow : httpFollow;
14260
14389
  }
14261
14390
  if (config.maxBodyLength > -1) {
14262
14391
  options.maxBodyLength = config.maxBodyLength;
@@ -14269,7 +14398,7 @@ var init_http = __esm({
14269
14398
  req = transport.request(options, function handleResponse(res) {
14270
14399
  if (req.destroyed) return;
14271
14400
  const streams2 = [res];
14272
- const responseLength = +res.headers["content-length"];
14401
+ const responseLength = utils_default.toFiniteNumber(res.headers["content-length"]);
14273
14402
  if (onDownloadProgress || maxDownloadRate) {
14274
14403
  const transformStream = new AxiosTransformStream_default({
14275
14404
  maxRate: utils_default.toFiniteNumber(maxDownloadRate)
@@ -14311,10 +14440,6 @@ var init_http = __esm({
14311
14440
  }
14312
14441
  }
14313
14442
  responseStream = streams2.length > 1 ? stream3.pipeline(streams2, utils_default.noop) : streams2[0];
14314
- const offListeners = stream3.finished(responseStream, () => {
14315
- offListeners();
14316
- onFinished();
14317
- });
14318
14443
  const response = {
14319
14444
  status: res.statusCode,
14320
14445
  statusText: res.statusMessage,
@@ -14334,7 +14459,7 @@ var init_http = __esm({
14334
14459
  if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
14335
14460
  rejected = true;
14336
14461
  responseStream.destroy();
14337
- reject(new AxiosError_default(
14462
+ abort(new AxiosError_default(
14338
14463
  "maxContentLength size of " + config.maxContentLength + " exceeded",
14339
14464
  AxiosError_default.ERR_BAD_RESPONSE,
14340
14465
  config,
@@ -14375,16 +14500,19 @@ var init_http = __esm({
14375
14500
  settle(resolve, reject, response);
14376
14501
  });
14377
14502
  }
14378
- emitter.once("abort", (err) => {
14503
+ abortEmitter.once("abort", (err) => {
14379
14504
  if (!responseStream.destroyed) {
14380
14505
  responseStream.emit("error", err);
14381
14506
  responseStream.destroy();
14382
14507
  }
14383
14508
  });
14384
14509
  });
14385
- emitter.once("abort", (err) => {
14386
- reject(err);
14387
- req.destroy(err);
14510
+ abortEmitter.once("abort", (err) => {
14511
+ if (req.close) {
14512
+ req.close();
14513
+ } else {
14514
+ req.destroy(err);
14515
+ }
14388
14516
  });
14389
14517
  req.on("error", function handleRequestError(err) {
14390
14518
  reject(AxiosError_default.from(err, null, config, req));
@@ -14395,7 +14523,7 @@ var init_http = __esm({
14395
14523
  if (config.timeout) {
14396
14524
  const timeout = parseInt(config.timeout, 10);
14397
14525
  if (Number.isNaN(timeout)) {
14398
- reject(new AxiosError_default(
14526
+ abort(new AxiosError_default(
14399
14527
  "error trying to parse `config.timeout` to int",
14400
14528
  AxiosError_default.ERR_BAD_OPTION_VALUE,
14401
14529
  config,
@@ -14410,14 +14538,15 @@ var init_http = __esm({
14410
14538
  if (config.timeoutErrorMessage) {
14411
14539
  timeoutErrorMessage = config.timeoutErrorMessage;
14412
14540
  }
14413
- reject(new AxiosError_default(
14541
+ abort(new AxiosError_default(
14414
14542
  timeoutErrorMessage,
14415
14543
  transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
14416
14544
  config,
14417
14545
  req
14418
14546
  ));
14419
- abort();
14420
14547
  });
14548
+ } else {
14549
+ req.setTimeout(0);
14421
14550
  }
14422
14551
  if (utils_default.isStream(data)) {
14423
14552
  let ended = false;
@@ -14436,7 +14565,8 @@ var init_http = __esm({
14436
14565
  });
14437
14566
  data.pipe(req);
14438
14567
  } else {
14439
- req.end(data);
14568
+ data && req.write(data);
14569
+ req.end();
14440
14570
  }
14441
14571
  });
14442
14572
  };
@@ -14471,20 +14601,33 @@ var init_cookies = __esm({
14471
14601
  cookies_default = platform_default.hasStandardBrowserEnv ? (
14472
14602
  // Standard browser envs support document.cookie
14473
14603
  {
14474
- write(name, value, expires, path4, domain, secure) {
14475
- const cookie = [name + "=" + encodeURIComponent(value)];
14476
- utils_default.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
14477
- utils_default.isString(path4) && cookie.push("path=" + path4);
14478
- utils_default.isString(domain) && cookie.push("domain=" + domain);
14479
- secure === true && cookie.push("secure");
14604
+ write(name, value, expires, path4, domain, secure, sameSite) {
14605
+ if (typeof document === "undefined") return;
14606
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
14607
+ if (utils_default.isNumber(expires)) {
14608
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
14609
+ }
14610
+ if (utils_default.isString(path4)) {
14611
+ cookie.push(`path=${path4}`);
14612
+ }
14613
+ if (utils_default.isString(domain)) {
14614
+ cookie.push(`domain=${domain}`);
14615
+ }
14616
+ if (secure === true) {
14617
+ cookie.push("secure");
14618
+ }
14619
+ if (utils_default.isString(sameSite)) {
14620
+ cookie.push(`SameSite=${sameSite}`);
14621
+ }
14480
14622
  document.cookie = cookie.join("; ");
14481
14623
  },
14482
14624
  read(name) {
14483
- const match2 = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
14484
- return match2 ? decodeURIComponent(match2[3]) : null;
14625
+ if (typeof document === "undefined") return null;
14626
+ const match2 = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
14627
+ return match2 ? decodeURIComponent(match2[1]) : null;
14485
14628
  },
14486
14629
  remove(name) {
14487
- this.write(name, "", Date.now() - 864e5);
14630
+ this.write(name, "", Date.now() - 864e5, "/");
14488
14631
  }
14489
14632
  }
14490
14633
  ) : (
@@ -15126,7 +15269,7 @@ var init_fetch = __esm({
15126
15269
  };
15127
15270
  seedCache = /* @__PURE__ */ new Map();
15128
15271
  getFetch = (config) => {
15129
- let env2 = config ? config.env : {};
15272
+ let env2 = config && config.env || {};
15130
15273
  const { fetch: fetch2, Request, Response } = env2;
15131
15274
  const seeds = [
15132
15275
  Request,
@@ -15147,6 +15290,39 @@ var init_fetch = __esm({
15147
15290
  });
15148
15291
 
15149
15292
  // ../../node_modules/axios/lib/adapters/adapters.js
15293
+ function getAdapter(adapters, config) {
15294
+ adapters = utils_default.isArray(adapters) ? adapters : [adapters];
15295
+ const { length } = adapters;
15296
+ let nameOrAdapter;
15297
+ let adapter2;
15298
+ const rejectedReasons = {};
15299
+ for (let i = 0; i < length; i++) {
15300
+ nameOrAdapter = adapters[i];
15301
+ let id;
15302
+ adapter2 = nameOrAdapter;
15303
+ if (!isResolvedHandle(nameOrAdapter)) {
15304
+ adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
15305
+ if (adapter2 === void 0) {
15306
+ throw new AxiosError_default(`Unknown adapter '${id}'`);
15307
+ }
15308
+ }
15309
+ if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
15310
+ break;
15311
+ }
15312
+ rejectedReasons[id || "#" + i] = adapter2;
15313
+ }
15314
+ if (!adapter2) {
15315
+ const reasons = Object.entries(rejectedReasons).map(
15316
+ ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
15317
+ );
15318
+ let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
15319
+ throw new AxiosError_default(
15320
+ `There is no suitable adapter to dispatch the request ` + s,
15321
+ "ERR_NOT_SUPPORT"
15322
+ );
15323
+ }
15324
+ return adapter2;
15325
+ }
15150
15326
  var knownAdapters, renderReason, isResolvedHandle, adapters_default;
15151
15327
  var init_adapters = __esm({
15152
15328
  "../../node_modules/axios/lib/adapters/adapters.js"() {
@@ -15176,39 +15352,15 @@ var init_adapters = __esm({
15176
15352
  renderReason = (reason) => `- ${reason}`;
15177
15353
  isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
15178
15354
  adapters_default = {
15179
- getAdapter: (adapters, config) => {
15180
- adapters = utils_default.isArray(adapters) ? adapters : [adapters];
15181
- const { length } = adapters;
15182
- let nameOrAdapter;
15183
- let adapter2;
15184
- const rejectedReasons = {};
15185
- for (let i = 0; i < length; i++) {
15186
- nameOrAdapter = adapters[i];
15187
- let id;
15188
- adapter2 = nameOrAdapter;
15189
- if (!isResolvedHandle(nameOrAdapter)) {
15190
- adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
15191
- if (adapter2 === void 0) {
15192
- throw new AxiosError_default(`Unknown adapter '${id}'`);
15193
- }
15194
- }
15195
- if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
15196
- break;
15197
- }
15198
- rejectedReasons[id || "#" + i] = adapter2;
15199
- }
15200
- if (!adapter2) {
15201
- const reasons = Object.entries(rejectedReasons).map(
15202
- ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
15203
- );
15204
- let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
15205
- throw new AxiosError_default(
15206
- `There is no suitable adapter to dispatch the request ` + s,
15207
- "ERR_NOT_SUPPORT"
15208
- );
15209
- }
15210
- return adapter2;
15211
- },
15355
+ /**
15356
+ * Resolve an adapter from a list of adapter names or functions.
15357
+ * @type {Function}
15358
+ */
15359
+ getAdapter,
15360
+ /**
15361
+ * Exposes all known adapters
15362
+ * @type {Object<string, Function|Object>}
15363
+ */
15212
15364
  adapters: knownAdapters
15213
15365
  };
15214
15366
  }
@@ -15737,7 +15889,13 @@ var init_HttpStatusCode = __esm({
15737
15889
  InsufficientStorage: 507,
15738
15890
  LoopDetected: 508,
15739
15891
  NotExtended: 510,
15740
- NetworkAuthenticationRequired: 511
15892
+ NetworkAuthenticationRequired: 511,
15893
+ WebServerIsDown: 521,
15894
+ ConnectionTimedOut: 522,
15895
+ OriginIsUnreachable: 523,
15896
+ TimeoutOccurred: 524,
15897
+ SslHandshakeFailed: 525,
15898
+ InvalidSslCertificate: 526
15741
15899
  };
15742
15900
  Object.entries(HttpStatusCode).forEach(([key, value]) => {
15743
15901
  HttpStatusCode[value] = key;
@@ -15805,7 +15963,7 @@ var init_axios = __esm({
15805
15963
  });
15806
15964
 
15807
15965
  // ../../node_modules/axios/index.js
15808
- var Axios2, AxiosError2, CanceledError2, isCancel2, CancelToken2, VERSION2, all2, Cancel, isAxiosError2, spread2, toFormData2, AxiosHeaders2, HttpStatusCode2, formToJSON, getAdapter, mergeConfig2;
15966
+ var Axios2, AxiosError2, CanceledError2, isCancel2, CancelToken2, VERSION2, all2, Cancel, isAxiosError2, spread2, toFormData2, AxiosHeaders2, HttpStatusCode2, formToJSON, getAdapter2, mergeConfig2;
15809
15967
  var init_axios2 = __esm({
15810
15968
  "../../node_modules/axios/index.js"() {
15811
15969
  init_define_BUILD();
@@ -15826,7 +15984,7 @@ var init_axios2 = __esm({
15826
15984
  AxiosHeaders: AxiosHeaders2,
15827
15985
  HttpStatusCode: HttpStatusCode2,
15828
15986
  formToJSON,
15829
- getAdapter,
15987
+ getAdapter: getAdapter2,
15830
15988
  mergeConfig: mergeConfig2
15831
15989
  } = axios_default);
15832
15990
  }
@@ -19913,11 +20071,15 @@ var require_attributes = __commonJS({
19913
20071
  if (typeof attributes !== "object" || attributes == null) {
19914
20072
  return out;
19915
20073
  }
19916
- for (const [key, val] of Object.entries(attributes)) {
20074
+ for (const key in attributes) {
20075
+ if (!Object.prototype.hasOwnProperty.call(attributes, key)) {
20076
+ continue;
20077
+ }
19917
20078
  if (!isAttributeKey(key)) {
19918
20079
  api_1.diag.warn(`Invalid attribute key: ${key}`);
19919
20080
  continue;
19920
20081
  }
20082
+ const val = attributes[key];
19921
20083
  if (!isAttributeValue(val)) {
19922
20084
  api_1.diag.warn(`Invalid attribute value set for key: ${key}`);
19923
20085
  continue;
@@ -19932,7 +20094,7 @@ var require_attributes = __commonJS({
19932
20094
  }
19933
20095
  exports2.sanitizeAttributes = sanitizeAttributes;
19934
20096
  function isAttributeKey(key) {
19935
- return typeof key === "string" && key.length > 0;
20097
+ return typeof key === "string" && key !== "";
19936
20098
  }
19937
20099
  exports2.isAttributeKey = isAttributeKey;
19938
20100
  function isAttributeValue(val) {
@@ -19942,7 +20104,7 @@ var require_attributes = __commonJS({
19942
20104
  if (Array.isArray(val)) {
19943
20105
  return isHomogeneousAttributeValueArray(val);
19944
20106
  }
19945
- return isValidPrimitiveAttributeValue(val);
20107
+ return isValidPrimitiveAttributeValueType(typeof val);
19946
20108
  }
19947
20109
  exports2.isAttributeValue = isAttributeValue;
19948
20110
  function isHomogeneousAttributeValueArray(arr) {
@@ -19950,22 +20112,23 @@ var require_attributes = __commonJS({
19950
20112
  for (const element of arr) {
19951
20113
  if (element == null)
19952
20114
  continue;
20115
+ const elementType = typeof element;
20116
+ if (elementType === type) {
20117
+ continue;
20118
+ }
19953
20119
  if (!type) {
19954
- if (isValidPrimitiveAttributeValue(element)) {
19955
- type = typeof element;
20120
+ if (isValidPrimitiveAttributeValueType(elementType)) {
20121
+ type = elementType;
19956
20122
  continue;
19957
20123
  }
19958
20124
  return false;
19959
20125
  }
19960
- if (typeof element === type) {
19961
- continue;
19962
- }
19963
20126
  return false;
19964
20127
  }
19965
20128
  return true;
19966
20129
  }
19967
- function isValidPrimitiveAttributeValue(val) {
19968
- switch (typeof val) {
20130
+ function isValidPrimitiveAttributeValueType(valType) {
20131
+ switch (valType) {
19969
20132
  case "number":
19970
20133
  case "boolean":
19971
20134
  case "string":
@@ -20127,7 +20290,7 @@ var require_version = __commonJS({
20127
20290
  init_define_PACKAGE_VERSIONS();
20128
20291
  Object.defineProperty(exports2, "__esModule", { value: true });
20129
20292
  exports2.VERSION = void 0;
20130
- exports2.VERSION = "2.1.0";
20293
+ exports2.VERSION = "2.2.0";
20131
20294
  }
20132
20295
  });
20133
20296
 
@@ -22265,21 +22428,6 @@ var require_sdk_info = __commonJS({
22265
22428
  }
22266
22429
  });
22267
22430
 
22268
- // ../../node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js
22269
- var require_timer_util = __commonJS({
22270
- "../../node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js"(exports2) {
22271
- "use strict";
22272
- init_define_BUILD();
22273
- init_define_PACKAGE_VERSIONS();
22274
- Object.defineProperty(exports2, "__esModule", { value: true });
22275
- exports2.unrefTimer = void 0;
22276
- function unrefTimer(timer) {
22277
- timer.unref();
22278
- }
22279
- exports2.unrefTimer = unrefTimer;
22280
- }
22281
- });
22282
-
22283
22431
  // ../../node_modules/@opentelemetry/core/build/src/platform/node/index.js
22284
22432
  var require_node2 = __commonJS({
22285
22433
  "../../node_modules/@opentelemetry/core/build/src/platform/node/index.js"(exports2) {
@@ -22287,7 +22435,7 @@ var require_node2 = __commonJS({
22287
22435
  init_define_BUILD();
22288
22436
  init_define_PACKAGE_VERSIONS();
22289
22437
  Object.defineProperty(exports2, "__esModule", { value: true });
22290
- exports2.unrefTimer = exports2.SDK_INFO = exports2.otperformance = exports2._globalThis = exports2.getStringListFromEnv = exports2.getNumberFromEnv = exports2.getBooleanFromEnv = exports2.getStringFromEnv = void 0;
22438
+ exports2.SDK_INFO = exports2.otperformance = exports2._globalThis = exports2.getStringListFromEnv = exports2.getNumberFromEnv = exports2.getBooleanFromEnv = exports2.getStringFromEnv = void 0;
22291
22439
  var environment_1 = require_environment();
22292
22440
  Object.defineProperty(exports2, "getStringFromEnv", { enumerable: true, get: function() {
22293
22441
  return environment_1.getStringFromEnv;
@@ -22313,10 +22461,6 @@ var require_node2 = __commonJS({
22313
22461
  Object.defineProperty(exports2, "SDK_INFO", { enumerable: true, get: function() {
22314
22462
  return sdk_info_1.SDK_INFO;
22315
22463
  } });
22316
- var timer_util_1 = require_timer_util();
22317
- Object.defineProperty(exports2, "unrefTimer", { enumerable: true, get: function() {
22318
- return timer_util_1.unrefTimer;
22319
- } });
22320
22464
  }
22321
22465
  });
22322
22466
 
@@ -22327,7 +22471,7 @@ var require_platform = __commonJS({
22327
22471
  init_define_BUILD();
22328
22472
  init_define_PACKAGE_VERSIONS();
22329
22473
  Object.defineProperty(exports2, "__esModule", { value: true });
22330
- exports2.getStringListFromEnv = exports2.getNumberFromEnv = exports2.getStringFromEnv = exports2.getBooleanFromEnv = exports2.unrefTimer = exports2.otperformance = exports2._globalThis = exports2.SDK_INFO = void 0;
22474
+ exports2.getStringListFromEnv = exports2.getNumberFromEnv = exports2.getStringFromEnv = exports2.getBooleanFromEnv = exports2.otperformance = exports2._globalThis = exports2.SDK_INFO = void 0;
22331
22475
  var node_1 = require_node2();
22332
22476
  Object.defineProperty(exports2, "SDK_INFO", { enumerable: true, get: function() {
22333
22477
  return node_1.SDK_INFO;
@@ -22338,9 +22482,6 @@ var require_platform = __commonJS({
22338
22482
  Object.defineProperty(exports2, "otperformance", { enumerable: true, get: function() {
22339
22483
  return node_1.otperformance;
22340
22484
  } });
22341
- Object.defineProperty(exports2, "unrefTimer", { enumerable: true, get: function() {
22342
- return node_1.unrefTimer;
22343
- } });
22344
22485
  Object.defineProperty(exports2, "getBooleanFromEnv", { enumerable: true, get: function() {
22345
22486
  return node_1.getBooleanFromEnv;
22346
22487
  } });
@@ -22457,6 +22598,23 @@ var require_time = __commonJS({
22457
22598
  }
22458
22599
  });
22459
22600
 
22601
+ // ../../node_modules/@opentelemetry/core/build/src/common/timer-util.js
22602
+ var require_timer_util = __commonJS({
22603
+ "../../node_modules/@opentelemetry/core/build/src/common/timer-util.js"(exports2) {
22604
+ "use strict";
22605
+ init_define_BUILD();
22606
+ init_define_PACKAGE_VERSIONS();
22607
+ Object.defineProperty(exports2, "__esModule", { value: true });
22608
+ exports2.unrefTimer = void 0;
22609
+ function unrefTimer(timer) {
22610
+ if (typeof timer !== "number") {
22611
+ timer.unref();
22612
+ }
22613
+ }
22614
+ exports2.unrefTimer = unrefTimer;
22615
+ }
22616
+ });
22617
+
22460
22618
  // ../../node_modules/@opentelemetry/core/build/src/ExportResult.js
22461
22619
  var require_ExportResult = __commonJS({
22462
22620
  "../../node_modules/@opentelemetry/core/build/src/ExportResult.js"(exports2) {
@@ -23117,7 +23275,7 @@ var require_src2 = __commonJS({
23117
23275
  init_define_BUILD();
23118
23276
  init_define_PACKAGE_VERSIONS();
23119
23277
  Object.defineProperty(exports2, "__esModule", { value: true });
23120
- exports2.internal = exports2.diagLogLevelFromString = exports2.BindOnceFuture = exports2.urlMatches = exports2.isUrlIgnored = exports2.callWithTimeout = exports2.TimeoutError = exports2.merge = exports2.TraceState = exports2.unsuppressTracing = exports2.suppressTracing = exports2.isTracingSuppressed = exports2.setRPCMetadata = exports2.getRPCMetadata = exports2.deleteRPCMetadata = exports2.RPCType = exports2.parseTraceParent = exports2.W3CTraceContextPropagator = exports2.TRACE_STATE_HEADER = exports2.TRACE_PARENT_HEADER = exports2.CompositePropagator = exports2.unrefTimer = exports2.otperformance = exports2.getStringListFromEnv = exports2.getNumberFromEnv = exports2.getBooleanFromEnv = exports2.getStringFromEnv = exports2._globalThis = exports2.SDK_INFO = exports2.parseKeyPairsIntoRecord = exports2.ExportResultCode = exports2.timeInputToHrTime = exports2.millisToHrTime = exports2.isTimeInputHrTime = exports2.isTimeInput = exports2.hrTimeToTimeStamp = exports2.hrTimeToNanoseconds = exports2.hrTimeToMilliseconds = exports2.hrTimeToMicroseconds = exports2.hrTimeDuration = exports2.hrTime = exports2.getTimeOrigin = exports2.addHrTimes = exports2.loggingErrorHandler = exports2.setGlobalErrorHandler = exports2.globalErrorHandler = exports2.sanitizeAttributes = exports2.isAttributeValue = exports2.AnchoredClock = exports2.W3CBaggagePropagator = void 0;
23278
+ exports2.internal = exports2.diagLogLevelFromString = exports2.BindOnceFuture = exports2.urlMatches = exports2.isUrlIgnored = exports2.callWithTimeout = exports2.TimeoutError = exports2.merge = exports2.TraceState = exports2.unsuppressTracing = exports2.suppressTracing = exports2.isTracingSuppressed = exports2.setRPCMetadata = exports2.getRPCMetadata = exports2.deleteRPCMetadata = exports2.RPCType = exports2.parseTraceParent = exports2.W3CTraceContextPropagator = exports2.TRACE_STATE_HEADER = exports2.TRACE_PARENT_HEADER = exports2.CompositePropagator = exports2.otperformance = exports2.getStringListFromEnv = exports2.getNumberFromEnv = exports2.getBooleanFromEnv = exports2.getStringFromEnv = exports2._globalThis = exports2.SDK_INFO = exports2.parseKeyPairsIntoRecord = exports2.ExportResultCode = exports2.unrefTimer = exports2.timeInputToHrTime = exports2.millisToHrTime = exports2.isTimeInputHrTime = exports2.isTimeInput = exports2.hrTimeToTimeStamp = exports2.hrTimeToNanoseconds = exports2.hrTimeToMilliseconds = exports2.hrTimeToMicroseconds = exports2.hrTimeDuration = exports2.hrTime = exports2.getTimeOrigin = exports2.addHrTimes = exports2.loggingErrorHandler = exports2.setGlobalErrorHandler = exports2.globalErrorHandler = exports2.sanitizeAttributes = exports2.isAttributeValue = exports2.AnchoredClock = exports2.W3CBaggagePropagator = void 0;
23121
23279
  var W3CBaggagePropagator_1 = require_W3CBaggagePropagator();
23122
23280
  Object.defineProperty(exports2, "W3CBaggagePropagator", { enumerable: true, get: function() {
23123
23281
  return W3CBaggagePropagator_1.W3CBaggagePropagator;
@@ -23181,6 +23339,10 @@ var require_src2 = __commonJS({
23181
23339
  Object.defineProperty(exports2, "timeInputToHrTime", { enumerable: true, get: function() {
23182
23340
  return time_1.timeInputToHrTime;
23183
23341
  } });
23342
+ var timer_util_1 = require_timer_util();
23343
+ Object.defineProperty(exports2, "unrefTimer", { enumerable: true, get: function() {
23344
+ return timer_util_1.unrefTimer;
23345
+ } });
23184
23346
  var ExportResult_1 = require_ExportResult();
23185
23347
  Object.defineProperty(exports2, "ExportResultCode", { enumerable: true, get: function() {
23186
23348
  return ExportResult_1.ExportResultCode;
@@ -23211,9 +23373,6 @@ var require_src2 = __commonJS({
23211
23373
  Object.defineProperty(exports2, "otperformance", { enumerable: true, get: function() {
23212
23374
  return platform_1.otperformance;
23213
23375
  } });
23214
- Object.defineProperty(exports2, "unrefTimer", { enumerable: true, get: function() {
23215
- return platform_1.unrefTimer;
23216
- } });
23217
23376
  var composite_1 = require_composite();
23218
23377
  Object.defineProperty(exports2, "CompositePropagator", { enumerable: true, get: function() {
23219
23378
  return composite_1.CompositePropagator;
@@ -24907,7 +25066,9 @@ var require_BatchSpanProcessorBase = __commonJS({
24907
25066
  if (this._timer !== void 0)
24908
25067
  return;
24909
25068
  this._timer = setTimeout(() => flush(), this._scheduledDelayMillis);
24910
- (0, core_1.unrefTimer)(this._timer);
25069
+ if (typeof this._timer !== "number") {
25070
+ this._timer.unref();
25071
+ }
24911
25072
  }
24912
25073
  _clearTimer() {
24913
25074
  if (this._timer !== void 0) {
@@ -26253,7 +26414,7 @@ var init_context_manager = __esm({
26253
26414
 
26254
26415
  // src/telemetry/instrument-http.ts
26255
26416
  import { randomBytes } from "node:crypto";
26256
- import http2 from "node:http";
26417
+ import http3 from "node:http";
26257
26418
  import https2 from "node:https";
26258
26419
  import { Dispatcher, getGlobalDispatcher, setGlobalDispatcher } from "undici";
26259
26420
  function isBotpressUrl(fullUrl) {
@@ -26416,16 +26577,16 @@ function installHttpClientInstrumentation({ injectTraceHeader = true } = {}) {
26416
26577
  };
26417
26578
  var wrapRequest = wrapRequest2;
26418
26579
  const orig = {
26419
- httpRequest: http2.request,
26420
- httpGet: http2.get,
26580
+ httpRequest: http3.request,
26581
+ httpGet: http3.get,
26421
26582
  httpsRequest: https2.request,
26422
26583
  httpsGet: https2.get
26423
26584
  };
26424
26585
  ;
26425
- http2.request = wrapRequest2(orig.httpRequest);
26586
+ http3.request = wrapRequest2(orig.httpRequest);
26426
26587
  https2.request = wrapRequest2(orig.httpsRequest);
26427
- http2.get = function wrappedGet(...a) {
26428
- const r = http2.request(...a);
26588
+ http3.get = function wrappedGet(...a) {
26589
+ const r = http3.request(...a);
26429
26590
  r.end();
26430
26591
  return r;
26431
26592
  };
@@ -26435,8 +26596,8 @@ function installHttpClientInstrumentation({ injectTraceHeader = true } = {}) {
26435
26596
  return r;
26436
26597
  };
26437
26598
  restores.push(() => {
26438
- http2.request = orig.httpRequest;
26439
- http2.get = orig.httpGet;
26599
+ http3.request = orig.httpRequest;
26600
+ http3.get = orig.httpGet;
26440
26601
  https2.request = orig.httpsRequest;
26441
26602
  https2.get = orig.httpsGet;
26442
26603
  });
@@ -33208,6 +33369,17 @@ function createDedent(options) {
33208
33369
  if (escapeSpecialCharacters) {
33209
33370
  result = result.replace(/\\n/g, "\n");
33210
33371
  }
33372
+ if (typeof Bun !== "undefined") {
33373
+ result = result.replace(
33374
+ // Matches e.g. \\u{1f60a} or \\u5F1F
33375
+ /\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g,
33376
+ (_2, braced, unbraced) => {
33377
+ var _ref;
33378
+ const hex = (_ref = braced !== null && braced !== void 0 ? braced : unbraced) !== null && _ref !== void 0 ? _ref : "";
33379
+ return String.fromCodePoint(parseInt(hex, 16));
33380
+ }
33381
+ );
33382
+ }
33211
33383
  return result;
33212
33384
  }
33213
33385
  }
@@ -34195,10 +34367,16 @@ var init_conversation_instance = __esm({
34195
34367
  init_define_BUILD();
34196
34368
  init_define_PACKAGE_VERSIONS();
34197
34369
  init_runtime2();
34198
- BaseConversationInstance = class {
34370
+ BaseConversationInstance = class _BaseConversationInstance {
34199
34371
  id;
34200
34372
  channel;
34201
34373
  integration;
34374
+ /**
34375
+ * The integration alias (e.g., "telegram1", "telegram2").
34376
+ * This is useful when you have multiple instances of the same integration
34377
+ * with different configurations (multi-integration setup).
34378
+ */
34379
+ alias;
34202
34380
  conversation;
34203
34381
  // @internal
34204
34382
  client;
@@ -34206,10 +34384,25 @@ var init_conversation_instance = __esm({
34206
34384
  TrackedState;
34207
34385
  // @internal
34208
34386
  TrackedTags;
34209
- constructor(conversation, client2) {
34387
+ /**
34388
+ * Extract integration alias from tags (e.g., "telegram3:id" -> "telegram3")
34389
+ * @internal
34390
+ */
34391
+ static extractAliasFromTags(tags) {
34392
+ if (!tags) return void 0;
34393
+ for (const tagKey of Object.keys(tags)) {
34394
+ const colonIndex = tagKey.indexOf(":");
34395
+ if (colonIndex > 0) {
34396
+ return tagKey.substring(0, colonIndex);
34397
+ }
34398
+ }
34399
+ return void 0;
34400
+ }
34401
+ constructor(conversation, client2, alias) {
34210
34402
  this.id = conversation.id;
34211
- this.channel = `${conversation.integration}.${conversation.channel}`;
34212
34403
  this.integration = conversation.integration;
34404
+ this.alias = alias ?? _BaseConversationInstance.extractAliasFromTags(conversation.tags) ?? conversation.integration;
34405
+ this.channel = `${this.alias}.${conversation.channel}`;
34213
34406
  this.conversation = conversation;
34214
34407
  this.client = client2;
34215
34408
  const states = context2.get("states", { optional: true });
@@ -37198,8 +37391,11 @@ var init_unescape = __esm({
37198
37391
  "../../node_modules/minimatch/dist/esm/unescape.js"() {
37199
37392
  init_define_BUILD();
37200
37393
  init_define_PACKAGE_VERSIONS();
37201
- unescape2 = (s, { windowsPathsNoEscape = false } = {}) => {
37202
- return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
37394
+ unescape2 = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
37395
+ if (magicalBraces) {
37396
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
37397
+ }
37398
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
37203
37399
  };
37204
37400
  }
37205
37401
  });
@@ -37562,7 +37758,7 @@ var init_ast = __esm({
37562
37758
  if (this.#root === this)
37563
37759
  this.#fillNegs();
37564
37760
  if (!this.type) {
37565
- const noEmpty = this.isStart() && this.isEnd();
37761
+ const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
37566
37762
  const src = this.#parts.map((p) => {
37567
37763
  const [re2, _2, hasMagic2, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
37568
37764
  this.#hasMagic = this.#hasMagic || hasMagic2;
@@ -37672,10 +37868,7 @@ var init_ast = __esm({
37672
37868
  }
37673
37869
  }
37674
37870
  if (c === "*") {
37675
- if (noEmpty && glob2 === "*")
37676
- re2 += starNoEmpty;
37677
- else
37678
- re2 += star;
37871
+ re2 += noEmpty && glob2 === "*" ? starNoEmpty : star;
37679
37872
  hasMagic2 = true;
37680
37873
  continue;
37681
37874
  }
@@ -37698,7 +37891,10 @@ var init_escape = __esm({
37698
37891
  "../../node_modules/minimatch/dist/esm/escape.js"() {
37699
37892
  init_define_BUILD();
37700
37893
  init_define_PACKAGE_VERSIONS();
37701
- escape = (s, { windowsPathsNoEscape = false } = {}) => {
37894
+ escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
37895
+ if (magicalBraces) {
37896
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
37897
+ }
37702
37898
  return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
37703
37899
  };
37704
37900
  }
@@ -38354,16 +38550,27 @@ var init_esm5 = __esm({
38354
38550
  pp[i] = twoStar;
38355
38551
  }
38356
38552
  } else if (next === void 0) {
38357
- pp[i - 1] = prev + "(?:\\/|" + twoStar + ")?";
38553
+ pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
38358
38554
  } else if (next !== GLOBSTAR) {
38359
38555
  pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
38360
38556
  pp[i + 1] = GLOBSTAR;
38361
38557
  }
38362
38558
  });
38363
- return pp.filter((p) => p !== GLOBSTAR).join("/");
38559
+ const filtered = pp.filter((p) => p !== GLOBSTAR);
38560
+ if (this.partial && filtered.length >= 1) {
38561
+ const prefixes = [];
38562
+ for (let i = 1; i <= filtered.length; i++) {
38563
+ prefixes.push(filtered.slice(0, i).join("/"));
38564
+ }
38565
+ return "(?:" + prefixes.join("|") + ")";
38566
+ }
38567
+ return filtered.join("/");
38364
38568
  }).join("|");
38365
38569
  const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
38366
38570
  re2 = "^" + open + re2 + close + "$";
38571
+ if (this.partial) {
38572
+ re2 = "^(?:\\/|" + open + re2.slice(1, -1) + close + ")$";
38573
+ }
38367
38574
  if (this.negate)
38368
38575
  re2 = "^(?!" + re2 + ").+$";
38369
38576
  try {