@glintbase/scanner-core 3.3.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
@@ -1,61 +1,61 @@
1
- # @glintbase/scanner-core
2
-
3
- The **ARS 3.2** (Agent Readiness Score) engine behind [scan.glintbase.dev](https://scan.glintbase.dev), packaged for reuse.
4
- It contains the live probes, the check registry, archetype classification, scoring and grade bands, the URL
5
- policy (SSRF guards) and the MCP live prober. The [Glintbase CLI](https://github.com/athertech/glintbase-cli)
6
- (`@glintbase/cli`) scores with this package, so a CLI audit and a web scan of the same site use the same rules.
7
-
8
- - ESM only, Node.js 20+, no runtime dependencies (uses the global `fetch`).
9
- - Type declarations included.
10
- - Every scorecard carries `version` (`ars-3.2.0`): never compare scores across score versions.
11
-
12
- ## Install
13
-
14
- ```bash
15
- npm install @glintbase/scanner-core
16
- ```
17
-
18
- ## Usage
19
-
20
- ```ts
21
- import { runArs3Probes, validateScanUrl, getAllChecks, ARS_SCORE_VERSION } from '@glintbase/scanner-core';
22
-
23
- const policy = validateScanUrl('example.com', { allowHttp: false });
24
- if (!policy.ok) throw new Error(policy.message);
25
-
26
- const scorecard = await runArs3Probes(policy.url!);
27
- console.log(scorecard.score, scorecard.grade, scorecard.version); // e.g. 78 'B' 'ars-3.2.0'
28
- console.log(`${scorecard.evidence?.checksEvaluated}/${getAllChecks().length} checks measured`);
29
- ```
30
-
31
- Main exports:
32
-
33
- | Area | Exports |
34
- | --- | --- |
35
- | Scoring | `runArs3Probes`, `runArs3ProbesDetailed`, `runArs2Probes`, `RunProbesOptions`, `Ars3Scorecard`, `CheckResult`, `LayerScoreSummary`, `ScanEvidenceSummary`, `RemediationSummary` |
36
- | Registry | `ALL_CHECKS`, `getAllChecks`, `getCheckById`, `getChecksForLayer`, `getBonusChecks`, `getChecksForSpec`, `CheckDefinition` |
37
- | Re-checks | `parseCheckIds`, `partitionCheckIds`, `recheckFromResults`, `unknownCheckResult` |
38
- | Archetypes | `classifyArchetype`, `normalizeArchetypeOverride`, `ArchetypeProfile` |
39
- | Bands | `scoreBand`, `scoreBandLabel`, `getArsGrade`, `SCORE_BANDS`, `ARS_GRADE_BANDS` |
40
- | URLs | `validateScanUrl`, `normalizeUrl`, `registrableDomain`, `brandFromHostname`, `deriveCompanySlug` |
41
- | Network | `fetchResource`, `probeMcpServer`, `inspectOpenApi` |
42
- | Full pipeline | `runScan`, `ScanResult`, `formatScanMarkdown` |
43
- | Versions | `GLINTBASE_VERSION`, `ARS_SCORE_VERSION`, `ARS_LABEL` |
44
-
45
- `fetchResource` (and therefore every probe) applies the URL policy before any network I/O: private, loopback
46
- and metadata addresses and non-standard ports are refused.
47
-
48
- ## Development
49
-
50
- The source is not duplicated here: `src/index.ts` re-exports `../src/lib/scanner` through the `@scanner`
51
- alias and tsup bundles it into `dist/`.
52
-
53
- ```bash
54
- npm install
55
- npm run typecheck
56
- npm run build
57
- ```
58
-
59
- ## License
60
-
61
- Apache-2.0
1
+ # @glintbase/scanner-core
2
+
3
+ The **ARS 3.3** (Agent Readiness Score) engine behind [scan.glintbase.dev](https://scan.glintbase.dev), packaged for reuse.
4
+ It contains the live probes, the check registry, archetype classification, scoring and grade bands, the URL
5
+ policy (SSRF guards) and the MCP live prober. The [Glintbase CLI](https://github.com/athertech/glintbase-cli)
6
+ (`@glintbase/cli`) scores with this package, so a CLI audit and a web scan of the same site use the same rules.
7
+
8
+ - ESM only, Node.js 20+, no runtime dependencies (uses the global `fetch`).
9
+ - Type declarations included.
10
+ - Every scorecard carries `version` (`ars-3.3.1`): never compare scores across score versions.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm install @glintbase/scanner-core
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { runArs3Probes, validateScanUrl, getAllChecks, ARS_SCORE_VERSION } from '@glintbase/scanner-core';
22
+
23
+ const policy = validateScanUrl('example.com', { allowHttp: false });
24
+ if (!policy.ok) throw new Error(policy.message);
25
+
26
+ const scorecard = await runArs3Probes(policy.url!);
27
+ console.log(scorecard.score, scorecard.grade, scorecard.version); // e.g. 78 'B' 'ars-3.3.1'
28
+ console.log(`${scorecard.evidence?.checksEvaluated}/${getAllChecks().length} checks measured`);
29
+ ```
30
+
31
+ Main exports:
32
+
33
+ | Area | Exports |
34
+ | --- | --- |
35
+ | Scoring | `runArs3Probes`, `runArs3ProbesDetailed`, `runArs2Probes`, `RunProbesOptions`, `Ars3Scorecard`, `CheckResult`, `LayerScoreSummary`, `ScanEvidenceSummary`, `RemediationSummary` |
36
+ | Registry | `ALL_CHECKS`, `getAllChecks`, `getCheckById`, `getChecksForLayer`, `getBonusChecks`, `getChecksForSpec`, `CheckDefinition` |
37
+ | Re-checks | `parseCheckIds`, `partitionCheckIds`, `recheckFromResults`, `unknownCheckResult` |
38
+ | Archetypes | `classifyArchetype`, `normalizeArchetypeOverride`, `ArchetypeProfile` |
39
+ | Bands | `scoreBand`, `scoreBandLabel`, `getArsGrade`, `SCORE_BANDS`, `ARS_GRADE_BANDS` |
40
+ | URLs | `validateScanUrl`, `normalizeUrl`, `registrableDomain`, `brandFromHostname`, `deriveCompanySlug` |
41
+ | Network | `fetchResource`, `probeMcpServer`, `inspectOpenApi` |
42
+ | Full pipeline | `runScan`, `ScanResult`, `formatScanMarkdown` |
43
+ | Versions | `GLINTBASE_VERSION`, `ARS_SCORE_VERSION`, `ARS_LABEL` |
44
+
45
+ `fetchResource` (and therefore every probe) applies the URL policy before any network I/O: private, loopback
46
+ and metadata addresses and non-standard ports are refused.
47
+
48
+ ## Development
49
+
50
+ The source is not duplicated here: `src/index.ts` re-exports `../src/lib/scanner` through the `@scanner`
51
+ alias and tsup bundles it into `dist/`.
52
+
53
+ ```bash
54
+ npm install
55
+ npm run typecheck
56
+ npm run build
57
+ ```
58
+
59
+ ## License
60
+
61
+ Apache-2.0
package/dist/index.d.ts CHANGED
@@ -4,11 +4,11 @@
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.3.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.2.0";
9
+ declare const ARS_SCORE_VERSION: "ars-3.3.1";
10
10
  /** Human-readable name of the current scoring model. */
11
- declare const ARS_LABEL = "ARS 3.2";
11
+ declare const ARS_LABEL = "ARS 3.3";
12
12
  declare function isCurrentArsVersion(version?: string | null): boolean;
13
13
  /** Any ARS 3.x scan (3.0, 3.1, 3.2, ...). */
14
14
  declare function isArs3Version(version?: string | null): boolean;
@@ -100,11 +100,14 @@ interface CheckDefinition {
100
100
  description: string;
101
101
  remediationId?: string;
102
102
  }
103
+ /** What kind of evidence a check rests on; see probes/measurement.ts. */
104
+ type CheckMeasurement = 'live' | 'content' | 'presence' | 'declared';
103
105
  interface CheckResult {
104
106
  checkId: string;
105
107
  name?: string;
106
108
  layer?: LayerId;
107
109
  status: CheckStatus;
110
+ measurement?: CheckMeasurement;
108
111
  earnedPoints: number;
109
112
  maxPoints: number;
110
113
  isBonus: boolean;
@@ -137,6 +140,13 @@ interface ScanEvidenceSummary {
137
140
  /** Verified base points / registered base points across applicable layers (0-1). */
138
141
  baseCoverage: number;
139
142
  lowConfidenceLayers: LayerId[];
143
+ /** The homepage served a bot challenge or HTTP 403; checks derived from it are `skip` ("not observed"). */
144
+ homepageBlocked?: boolean;
145
+ }
146
+ /** A failure that stops a plain-fetch agent outright; any gate caps the score (see GATE_SCORE_CAP). */
147
+ interface ScoreGate {
148
+ checkId: string;
149
+ reason: string;
140
150
  }
141
151
  interface RemediationSummary {
142
152
  id: string;
@@ -192,6 +202,10 @@ interface Ars3Scorecard {
192
202
  pillars?: {
193
203
  discoverability: ArsPillarSummary;
194
204
  runtimeErgonomics: ArsPillarSummary;
205
+ /** Runtime pillar from `live` and `content` base checks only (no presence, no bonus). */
206
+ runtimeMeasured?: ArsPillarSummary & {
207
+ checksCounted: number;
208
+ };
195
209
  };
196
210
  layers: {
197
211
  discovery: LayerScoreSummary;
@@ -202,6 +216,9 @@ interface Ars3Scorecard {
202
216
  results: CheckResult[];
203
217
  remediations: RemediationSummary[];
204
218
  evidence?: ScanEvidenceSummary;
219
+ /** Failed gates. When non-empty, `score` is capped and `uncappedScore` holds the weighted result. */
220
+ gates?: ScoreGate[];
221
+ uncappedScore?: number;
205
222
  criticalVulnerabilities?: CriticalVulnerability[];
206
223
  simulation?: SimulationResult;
207
224
  durationMs?: number;
@@ -210,7 +227,7 @@ interface Ars3Scorecard {
210
227
  }
211
228
 
212
229
  /**
213
- * ARS 3.0 Layer 1 Probe: Discovery (16 Checks | 20 Base Pts)
230
+ * ARS 3.3 Layer 1 Probe: Discovery
214
231
  * Evaluates robots.txt AI policy, ARD/Agent-Card catalogs, Wikidata P856,
215
232
  * MCP registry branding, agent rules, and package listings.
216
233
  */
@@ -245,6 +262,9 @@ interface DiscoveryProbeResult {
245
262
  interface AccessProbeResult {
246
263
  /** False when the homepage request got no HTTP response at all (DNS/TLS/connect failure or timeout). */
247
264
  targetReachable: boolean;
265
+ /** The homepage served a bot challenge or HTTP 403 to the scanner, so its content was not observed. */
266
+ homepageBlocked?: boolean;
267
+ homepageStatus?: number;
248
268
  score: number;
249
269
  baseEarned: number;
250
270
  bonusEarned: number;
@@ -269,7 +289,7 @@ interface AccessProbeResult {
269
289
  found: boolean;
270
290
  url?: string;
271
291
  version?: string;
272
- /** Parsed document when the spec is JSON; YAML specs are detected but not parsed. */
292
+ /** Parsed document (JSON or YAML). Undefined only when a YAML spec failed to parse. */
273
293
  spec?: any;
274
294
  };
275
295
  }
@@ -446,7 +466,6 @@ interface RunProbesOptions {
446
466
  /** Below this share of verified base points a layer is flagged lowConfidence. */
447
467
  declare const MIN_LAYER_COVERAGE = 0.5;
448
468
  declare function runArs3Probes(url: string, options?: RunProbesOptions): Promise<Ars3Scorecard>;
449
- /** Same as runArs3Probes, but also returns each layer's raw probe output. */
450
469
  declare function runArs3ProbesDetailed(url: string, options?: RunProbesOptions): Promise<{
451
470
  scorecard: Ars3Scorecard;
452
471
  discovery: DiscoveryProbeResult;
@@ -460,8 +479,8 @@ declare function runArs3ProbesDetailed(url: string, options?: RunProbesOptions):
460
479
  declare function runArs2Probes(url: string, archetypeInput?: Partial<ArchetypeInput>): Promise<Ars2Scorecard>;
461
480
 
462
481
  /**
463
- * ARS 3.2 Central Check Registry
464
- * Specification: GLINTBASE_AUDIT_3_0_UPGRADE_SPEC.md, methodology: docs/methodology/ars-3.2.md
482
+ * ARS 3.3 Central Check Registry
483
+ * Specification: GLINTBASE_AUDIT_3_0_UPGRADE_SPEC.md, methodology: docs/methodology/ars-3.3.md
465
484
  * Single source of truth for each check's points and bonus status (count: getAllChecks().length).
466
485
  */
467
486
 
@@ -629,14 +648,6 @@ declare function fetchResource(url: string, options?: FetchResourceOptions): Pro
629
648
  /** True if URL is reachable (GET), including auth walls. */
630
649
  declare function verifyUrlExists(url: string | null, timeoutMs?: number): Promise<boolean>;
631
650
 
632
- /**
633
- * 4-Step Empirical MCP Live Prober (SPEC-09 / ARS 3.1)
634
- * Evaluates production MCP servers across:
635
- * 1. Dual Wire-Form Handshake (2026-07-28 in _meta/headers vs legacy)
636
- * 2. Anonymous Tools Discovery & Hidden Auth Gates
637
- * 3. Safe Execution Probe & Schema Honesty
638
- * 4. Error Channel Integrity (isError: true vs 200 string masquerade)
639
- */
640
651
  interface McpProbeStepResult {
641
652
  step: 'handshake' | 'tools_list' | 'safe_call' | 'error_channel';
642
653
  passed: boolean;
@@ -649,9 +660,14 @@ interface McpProbeStepResult {
649
660
  interface McpLiveProbeResult {
650
661
  live: boolean;
651
662
  endpoint: string;
652
- /** initialize returned a JSON-RPC result on either wire form. */
663
+ /** The server completed a handshake (server/discover result or initialize result). */
653
664
  handshakeAccepted: boolean;
665
+ /** `modern` answered server/discover; `legacy` completed initialize. */
666
+ era?: 'modern' | 'legacy';
654
667
  protocolVersion?: string;
668
+ /** Revisions a modern server lists in its DiscoverResult. */
669
+ supportedVersions?: string[];
670
+ /** Modern server that also completed a legacy initialize handshake. */
655
671
  dualWireCompatible: boolean;
656
672
  wireForm2026Supported: boolean;
657
673
  legacyWireSupported: boolean;
@@ -662,7 +678,7 @@ interface McpLiveProbeResult {
662
678
  toolCount: number;
663
679
  /** True only when tools/list returned a well-formed tools array. */
664
680
  toolsListed: boolean;
665
- /** Server capabilities from the initialize result (prompts, resources, logging, ...). */
681
+ /** Server capabilities from the handshake result (prompts, resources, logging, ...). */
666
682
  capabilities: Record<string, any>;
667
683
  /** Raw WWW-Authenticate header when the endpoint answered 401. */
668
684
  wwwAuthenticate?: string;
@@ -681,12 +697,16 @@ interface McpLiveProbeResult {
681
697
  /** inputSchema is an object schema whose properties all declare a type. */
682
698
  schemaStrict: boolean;
683
699
  declaredRequiredCount: number;
700
+ /** `$schema` declared on inputSchema, if any (MCP's default dialect is JSON Schema 2020-12). */
701
+ schemaDialect?: string;
684
702
  }>;
703
+ /** Characters in the serialized tool definitions from the first tools/list page. */
704
+ toolDefinitionChars: number;
685
705
  steps: McpProbeStepResult[];
686
706
  reliabilityScore: number;
687
707
  }
688
708
  /**
689
- * Executes the 4-step MCP live diagnostic probe against an endpoint.
709
+ * Executes the dual-era MCP live diagnostic probe against an endpoint.
690
710
  */
691
711
  declare function probeMcpServer(endpointUrl: string): Promise<McpLiveProbeResult>;
692
712
 
@@ -732,6 +752,24 @@ declare function isJsonMediaType(mediaType: string): boolean;
732
752
  declare function jsonMediaOf(content: any): any;
733
753
  declare function inspectOpenApi(spec: any): OpenApiInspection;
734
754
 
755
+ /**
756
+ * Glintbase Bundled MCP Skills (ARS 3.3)
757
+ *
758
+ * Comprehensive suite of 8 production-grade playbooks delivered tri-modally:
759
+ * 1. MCP Resources (skill://glintbase/<name>)
760
+ * 2. MCP Prompts (optimize_<name>)
761
+ * 3. MCP Tools (glintbase_get_skill / glintbase_install_skill)
762
+ */
763
+ interface BundledSkill {
764
+ name: string;
765
+ title: string;
766
+ description: string;
767
+ uri: string;
768
+ tags: string[];
769
+ content: string;
770
+ }
771
+ declare const BUNDLED_SKILLS: Record<string, BundledSkill>;
772
+
735
773
  type SurfaceType = 'landing' | 'docs' | 'api' | 'sdk' | 'github' | 'support' | 'blog' | 'changelog' | 'status' | 'auth' | 'dashboard' | 'openapi' | 'llms_txt' | 'llms_full_txt' | 'sitemap' | 'mcp';
736
774
  interface DiscoveredSurface {
737
775
  type: SurfaceType;
@@ -1019,4 +1057,4 @@ interface SpecParseResult {
1019
1057
  */
1020
1058
  declare function parseSpec(url: string, type: SpecType): Promise<SpecParseResult>;
1021
1059
 
1022
- export { ALL_CHECKS, ARS_GRADE_BANDS, ARS_LABEL, ARS_SCORE_VERSION, type AccessProbeResult, type ArchetypeInput, type ArchetypeOverride, type ArchetypeProfile, type Ars2Scorecard, type Ars3Scorecard, type ArsGrade, type ArsPillarSummary, CANONICAL_ARCHETYPES, type CanonicalArchetype, type CheckDefinition, type CheckKind, type CheckRemediation, type CheckResult, type CheckStatus, type CheckTier, type CriticalVulnerability, type DiscoveryProbeResult, type EvaluatorMode, type FetchResourceOptions, type FetchResourceResult, type FetchStatus, GLINTBASE_VERSION, type GradeBand, type LayerId, type LayerScoreSummary, type LayerWeightConfig, MIN_LAYER_COVERAGE, type McpLiveProbeResult, type McpProbeStepResult, type OpenApiInspection, type OpenApiOperationRef, type PaymentsProbeResult, type ReachabilityResult, type RecheckResult, type RemediationSummary, type RunProbesOptions, type RunScanHooks, SCORE_BANDS, type ScanEvidenceSummary, type ScanOptions, type ScanProgressEvent, type ScanResult, type ScoreBand, type ScoreBandKey, type SimulationResult, type SiteArchetype, type SpecParseResult, type SpecType, type UrlPolicyCode, type UrlPolicyResult, type UsabilityProbeResult, badgeColorForScore, brandFromHostname, checkReachability, classifyArchetype, deriveCompany, deriveCompanySlug, fetchResource, formatScanMarkdown, getAllChecks, getArsGrade, getBonusChecks, getCheckById, getChecksForLayer, getChecksForSpec, inspectOpenApi, isArs3Version, isCurrentArsVersion, isJsonMediaType, jsonMediaOf, listOperations, normalizeArchetypeOverride, normalizeUrl, parseCheckIds, parseSpec, partitionCheckIds, policyToErrorCode, probeMcpServer, recheckFromResults, registrableDomain, runArs2Probes, runArs3Probes, runArs3ProbesDetailed, runScan, scoreBand, scoreBandColorHex, scoreBandLabel, scoreBandTextClass, sseHasJsonData, unknownCheckResult, validateScanUrl, verifyUrlExists };
1060
+ export { ALL_CHECKS, ARS_GRADE_BANDS, ARS_LABEL, ARS_SCORE_VERSION, type AccessProbeResult, type ArchetypeInput, type ArchetypeOverride, type ArchetypeProfile, type Ars2Scorecard, type Ars3Scorecard, type ArsGrade, type ArsPillarSummary, BUNDLED_SKILLS, type BundledSkill, CANONICAL_ARCHETYPES, type CanonicalArchetype, type CheckDefinition, type CheckKind, type CheckRemediation, type CheckResult, type CheckStatus, type CheckTier, type CriticalVulnerability, type DiscoveryProbeResult, type EvaluatorMode, type FetchResourceOptions, type FetchResourceResult, type FetchStatus, GLINTBASE_VERSION, type GradeBand, type LayerId, type LayerScoreSummary, type LayerWeightConfig, MIN_LAYER_COVERAGE, type McpLiveProbeResult, type McpProbeStepResult, type OpenApiInspection, type OpenApiOperationRef, type PaymentsProbeResult, type ReachabilityResult, type RecheckResult, type RemediationSummary, type RunProbesOptions, type RunScanHooks, SCORE_BANDS, type ScanEvidenceSummary, type ScanOptions, type ScanProgressEvent, type ScanResult, type ScoreBand, type ScoreBandKey, type SimulationResult, type SiteArchetype, type SpecParseResult, type SpecType, type UrlPolicyCode, type UrlPolicyResult, type UsabilityProbeResult, badgeColorForScore, brandFromHostname, checkReachability, classifyArchetype, deriveCompany, deriveCompanySlug, fetchResource, formatScanMarkdown, getAllChecks, getArsGrade, getBonusChecks, getCheckById, getChecksForLayer, getChecksForSpec, inspectOpenApi, isArs3Version, isCurrentArsVersion, isJsonMediaType, jsonMediaOf, listOperations, normalizeArchetypeOverride, normalizeUrl, parseCheckIds, parseSpec, partitionCheckIds, policyToErrorCode, probeMcpServer, recheckFromResults, registrableDomain, runArs2Probes, runArs3Probes, runArs3ProbesDetailed, runScan, scoreBand, scoreBandColorHex, scoreBandLabel, scoreBandTextClass, sseHasJsonData, unknownCheckResult, validateScanUrl, verifyUrlExists };