agentid-sdk 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -466,12 +466,20 @@ function inferRegionsFromAnchors(hits) {
466
466
  }
467
467
  function resolveRegions(text, locale) {
468
468
  const localeRegion = parseLocaleRegion(locale);
469
- if (localeRegion) return [localeRegion];
470
469
  const normalizedLocale = locale?.toLowerCase().trim() ?? "";
471
470
  const inferred = inferRegionsFromAnchors(
472
471
  scanAnchorHits(text, Date.now(), DEFAULT_PREFILTER_DEADLINE_MS)
473
472
  );
474
- if (inferred.length > 0) return inferred;
473
+ const regions = /* @__PURE__ */ new Set();
474
+ if (localeRegion) {
475
+ regions.add(localeRegion);
476
+ }
477
+ for (const region of inferred) {
478
+ regions.add(region);
479
+ }
480
+ if (regions.size > 0) {
481
+ return Array.from(regions);
482
+ }
475
483
  if (normalizedLocale.startsWith("uk")) {
476
484
  return ["czsk", "pl", "ro", "de", "hu", "fr", "es", "it", "nl", "at"];
477
485
  }
@@ -1196,7 +1204,7 @@ var CONFIG_TTL_MS = 5 * 60 * 1e3;
1196
1204
  var CONFIG_TIMEOUT_MS = 8e3;
1197
1205
  var CONFIG_RETRY_DELAY_MS = 1e3;
1198
1206
  var MAX_CAPABILITY_CACHE_ENTRIES = 500;
1199
- var AGENTID_SDK_VERSION_HEADER = "js-1.0.7";
1207
+ var AGENTID_SDK_VERSION_HEADER = "js-1.0.8";
1200
1208
  var CapabilityConfigFetchError = class extends Error {
1201
1209
  constructor(message, params) {
1202
1210
  super(message);
@@ -1795,10 +1803,10 @@ function getInjectionScanner() {
1795
1803
  }
1796
1804
 
1797
1805
  // src/agentid.ts
1798
- var AGENTID_SDK_VERSION_HEADER2 = "js-1.0.7";
1799
- var DEFAULT_GUARD_TIMEOUT_MS = 800;
1806
+ var AGENTID_SDK_VERSION_HEADER2 = "js-1.0.8";
1807
+ var DEFAULT_GUARD_TIMEOUT_MS = 1e4;
1800
1808
  var MIN_GUARD_TIMEOUT_MS = 500;
1801
- var MAX_GUARD_TIMEOUT_MS = 1e4;
1809
+ var MAX_GUARD_TIMEOUT_MS = 15e3;
1802
1810
  function normalizeBaseUrl3(baseUrl) {
1803
1811
  return baseUrl.replace(/\/+$/, "");
1804
1812
  }
package/dist/index.mjs CHANGED
@@ -428,12 +428,20 @@ function inferRegionsFromAnchors(hits) {
428
428
  }
429
429
  function resolveRegions(text, locale) {
430
430
  const localeRegion = parseLocaleRegion(locale);
431
- if (localeRegion) return [localeRegion];
432
431
  const normalizedLocale = locale?.toLowerCase().trim() ?? "";
433
432
  const inferred = inferRegionsFromAnchors(
434
433
  scanAnchorHits(text, Date.now(), DEFAULT_PREFILTER_DEADLINE_MS)
435
434
  );
436
- if (inferred.length > 0) return inferred;
435
+ const regions = /* @__PURE__ */ new Set();
436
+ if (localeRegion) {
437
+ regions.add(localeRegion);
438
+ }
439
+ for (const region of inferred) {
440
+ regions.add(region);
441
+ }
442
+ if (regions.size > 0) {
443
+ return Array.from(regions);
444
+ }
437
445
  if (normalizedLocale.startsWith("uk")) {
438
446
  return ["czsk", "pl", "ro", "de", "hu", "fr", "es", "it", "nl", "at"];
439
447
  }
@@ -1158,7 +1166,7 @@ var CONFIG_TTL_MS = 5 * 60 * 1e3;
1158
1166
  var CONFIG_TIMEOUT_MS = 8e3;
1159
1167
  var CONFIG_RETRY_DELAY_MS = 1e3;
1160
1168
  var MAX_CAPABILITY_CACHE_ENTRIES = 500;
1161
- var AGENTID_SDK_VERSION_HEADER = "js-1.0.7";
1169
+ var AGENTID_SDK_VERSION_HEADER = "js-1.0.8";
1162
1170
  var CapabilityConfigFetchError = class extends Error {
1163
1171
  constructor(message, params) {
1164
1172
  super(message);
@@ -1757,10 +1765,10 @@ function getInjectionScanner() {
1757
1765
  }
1758
1766
 
1759
1767
  // src/agentid.ts
1760
- var AGENTID_SDK_VERSION_HEADER2 = "js-1.0.7";
1761
- var DEFAULT_GUARD_TIMEOUT_MS = 800;
1768
+ var AGENTID_SDK_VERSION_HEADER2 = "js-1.0.8";
1769
+ var DEFAULT_GUARD_TIMEOUT_MS = 1e4;
1762
1770
  var MIN_GUARD_TIMEOUT_MS = 500;
1763
- var MAX_GUARD_TIMEOUT_MS = 1e4;
1771
+ var MAX_GUARD_TIMEOUT_MS = 15e3;
1764
1772
  function normalizeBaseUrl3(baseUrl) {
1765
1773
  return baseUrl.replace(/\/+$/, "");
1766
1774
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentid-sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "AgentID JavaScript/TypeScript SDK for guard, ingest, tracing, and analytics.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://agentid.ai",