@glintbase/scanner-core 3.5.0 → 3.5.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.
package/README.md CHANGED
@@ -7,7 +7,7 @@ policy (SSRF guards) and the MCP live prober. The [Glintbase CLI](https://github
7
7
 
8
8
  - ESM only, Node.js 20+, no runtime dependencies (uses the global `fetch`).
9
9
  - Type declarations included.
10
- - Every scorecard carries `version` (`ars-3.3.0`): never compare scores across score versions.
10
+ - Every scorecard carries `version` (`ars-3.3.1`): never compare scores across score versions.
11
11
 
12
12
  ## Install
13
13
 
@@ -24,7 +24,7 @@ const policy = validateScanUrl('example.com', { allowHttp: false });
24
24
  if (!policy.ok) throw new Error(policy.message);
25
25
 
26
26
  const scorecard = await runArs3Probes(policy.url!);
27
- console.log(scorecard.score, scorecard.grade, scorecard.version); // e.g. 78 'B' 'ars-3.3.0'
27
+ console.log(scorecard.score, scorecard.grade, scorecard.version); // e.g. 78 'B' 'ars-3.3.1'
28
28
  console.log(`${scorecard.evidence?.checksEvaluated}/${getAllChecks().length} checks measured`);
29
29
  ```
30
30
 
package/dist/index.d.ts CHANGED
@@ -4,9 +4,9 @@
4
4
  * rule sets are never compared as if they were equivalent.
5
5
  */
6
6
  /** Product version shared by the web app, CLI and MCP packages. */
7
- declare const GLINTBASE_VERSION = "3.5.0";
7
+ declare const GLINTBASE_VERSION = "3.5.1";
8
8
  /** Scoring model version stamped on every scan result (score_version). */
9
- declare const ARS_SCORE_VERSION: "ars-3.3.0";
9
+ declare const ARS_SCORE_VERSION: "ars-3.3.1";
10
10
  /** Human-readable name of the current scoring model. */
11
11
  declare const ARS_LABEL = "ARS 3.3";
12
12
  declare function isCurrentArsVersion(version?: string | null): boolean;
package/dist/index.js CHANGED
@@ -7362,8 +7362,8 @@ var require_dist = __commonJS({
7362
7362
  });
7363
7363
 
7364
7364
  // ../src/lib/scanner/version.ts
7365
- var GLINTBASE_VERSION = "3.5.0";
7366
- var ARS_SCORE_VERSION = "ars-3.3.0";
7365
+ var GLINTBASE_VERSION = "3.5.1";
7366
+ var ARS_SCORE_VERSION = "ars-3.3.1";
7367
7367
  var ARS_LABEL = "ARS 3.3";
7368
7368
  function isCurrentArsVersion(version) {
7369
7369
  return version === ARS_SCORE_VERSION;
@@ -7560,6 +7560,9 @@ function classifyArchetype(input) {
7560
7560
  };
7561
7561
  }
7562
7562
 
7563
+ // ../src/lib/scanner/v2/fetchResource.ts
7564
+ import { AsyncLocalStorage } from "async_hooks";
7565
+
7563
7566
  // ../src/lib/scanner/v2/urlPolicy.ts
7564
7567
  var BLOCKED_HOSTNAMES = /* @__PURE__ */ new Set([
7565
7568
  "localhost",
@@ -7737,7 +7740,15 @@ function policyToErrorCode(code) {
7737
7740
  }
7738
7741
 
7739
7742
  // ../src/lib/scanner/v2/fetchResource.ts
7740
- var DEFAULT_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36";
7743
+ var SCANNER_USER_AGENTS = {
7744
+ agent: "Mozilla/5.0 (compatible; GlintbaseScanner/3.5; +https://glintbase.dev/research/bot)",
7745
+ browser: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
7746
+ };
7747
+ var DEFAULT_SCANNER_IDENTITY = "agent";
7748
+ var uaStore = new AsyncLocalStorage();
7749
+ function currentScannerUserAgent() {
7750
+ return uaStore.getStore() || SCANNER_USER_AGENTS[DEFAULT_SCANNER_IDENTITY];
7751
+ }
7741
7752
  var DEFAULT_TIMEOUT = 8e3;
7742
7753
  var DEFAULT_MAX_BYTES = 2e6;
7743
7754
  function looksLikeSoft404(body, httpStatus) {
@@ -7853,7 +7864,7 @@ async function fetchResource(url, options = {}) {
7853
7864
  signal: controller.signal,
7854
7865
  redirect: "manual",
7855
7866
  headers: {
7856
- "User-Agent": DEFAULT_UA,
7867
+ "User-Agent": currentScannerUserAgent(),
7857
7868
  Accept: "*/*",
7858
7869
  ...options.headers
7859
7870
  },
@@ -10380,6 +10391,11 @@ function parseOpenApiDocument(body) {
10380
10391
  return void 0;
10381
10392
  }
10382
10393
  }
10394
+ function markdownTwinUrl(pageUrl) {
10395
+ const u = new URL(pageUrl);
10396
+ const path = u.pathname.replace(/\/+$/, "");
10397
+ return `${u.origin}${path ? `${path}.md` : "/index.md"}`;
10398
+ }
10383
10399
  function parseLinkHeader(value) {
10384
10400
  if (!value) return [];
10385
10401
  const out = [];
@@ -10672,7 +10688,7 @@ async function probeAccess(targetUrl, localContext) {
10672
10688
  }
10673
10689
  }
10674
10690
  if (!markdownSupported && !localContext?.isLocalCodebase) {
10675
- const twinUrl = targetUrl.endsWith("/") ? `${targetUrl.slice(0, -1)}.md` : `${targetUrl}.md`;
10691
+ const twinUrl = markdownTwinUrl(targetUrl);
10676
10692
  const twinRes = await fetchResource(twinUrl, { timeoutMs: 3e3 });
10677
10693
  if (twinRes.ok && twinRes.body && !twinRes.body.includes("<html")) {
10678
10694
  markdownSupported = true;