milieu-cli 0.3.2 → 0.4.0
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 +177 -76
- package/dist/bridges/context/agents-json.d.ts +0 -1
- package/dist/bridges/context/agents-json.js +21 -12
- package/dist/bridges/context/auth-clarity.d.ts +0 -1
- package/dist/bridges/context/auth-clarity.js +11 -9
- package/dist/bridges/context/auth-legibility.d.ts +2 -2
- package/dist/bridges/context/auth-legibility.js +67 -60
- package/dist/bridges/context/index.d.ts +1 -2
- package/dist/bridges/context/index.js +19 -40
- package/dist/bridges/context/oauth-metadata.d.ts +14 -0
- package/dist/bridges/context/oauth-metadata.js +127 -0
- package/dist/bridges/context/probe.d.ts +33 -0
- package/dist/bridges/context/probe.js +157 -0
- package/dist/bridges/context/rate-limits.d.ts +5 -2
- package/dist/bridges/context/rate-limits.js +27 -51
- package/dist/bridges/context/tos-contact.d.ts +13 -4
- package/dist/bridges/context/tos-contact.js +108 -46
- package/dist/bridges/context/versioning.d.ts +1 -2
- package/dist/bridges/context/versioning.js +42 -7
- package/dist/bridges/index.d.ts +0 -1
- package/dist/bridges/index.js +0 -1
- package/dist/bridges/reachability/crawler-policy.d.ts +30 -10
- package/dist/bridges/reachability/crawler-policy.js +41 -56
- package/dist/bridges/reachability/http-status.d.ts +3 -2
- package/dist/bridges/reachability/http-status.js +18 -3
- package/dist/bridges/reachability/https-check.d.ts +2 -2
- package/dist/bridges/reachability/https-check.js +6 -3
- package/dist/bridges/reachability/index.d.ts +1 -2
- package/dist/bridges/reachability/index.js +34 -43
- package/dist/bridges/reachability/meta-robots.d.ts +0 -13
- package/dist/bridges/reachability/meta-robots.js +89 -101
- package/dist/bridges/reachability/robots-parser.d.ts +7 -7
- package/dist/bridges/reachability/robots-parser.js +65 -15
- package/dist/bridges/reachability/robots-txt.d.ts +4 -2
- package/dist/bridges/reachability/robots-txt.js +33 -60
- package/dist/bridges/schema/descriptions.d.ts +2 -2
- package/dist/bridges/schema/descriptions.js +79 -44
- package/dist/bridges/schema/error-schemas.d.ts +2 -2
- package/dist/bridges/schema/error-schemas.js +31 -18
- package/dist/bridges/schema/index.d.ts +2 -2
- package/dist/bridges/schema/index.js +48 -30
- package/dist/bridges/schema/oas-types.d.ts +65 -26
- package/dist/bridges/schema/oas-types.js +37 -7
- package/dist/bridges/schema/operation-ids.d.ts +2 -2
- package/dist/bridges/schema/operation-ids.js +2 -3
- package/dist/bridges/schema/required-fields.d.ts +2 -2
- package/dist/bridges/schema/required-fields.js +12 -10
- package/dist/bridges/schema/schema-sources.d.ts +19 -0
- package/dist/bridges/schema/schema-sources.js +182 -0
- package/dist/bridges/schema/schema-types.d.ts +2 -2
- package/dist/bridges/schema/schema-types.js +20 -21
- package/dist/bridges/separation/api-presence.d.ts +3 -15
- package/dist/bridges/separation/api-presence.js +34 -85
- package/dist/bridges/separation/developer-docs.d.ts +6 -18
- package/dist/bridges/separation/developer-docs.js +100 -99
- package/dist/bridges/separation/docs-discovery.d.ts +28 -0
- package/dist/bridges/separation/docs-discovery.js +95 -0
- package/dist/bridges/separation/evidence-summary.d.ts +2 -0
- package/dist/bridges/separation/evidence-summary.js +67 -0
- package/dist/bridges/separation/index.d.ts +2 -19
- package/dist/bridges/separation/index.js +35 -39
- package/dist/bridges/separation/published-routes.d.ts +69 -0
- package/dist/bridges/separation/published-routes.js +271 -0
- package/dist/bridges/separation/sdk-references.d.ts +8 -3
- package/dist/bridges/separation/sdk-references.js +86 -61
- package/dist/bridges/separation/webhook-support.d.ts +3 -23
- package/dist/bridges/separation/webhook-support.js +61 -162
- package/dist/bridges/standards/a2a-agent-card.d.ts +0 -1
- package/dist/bridges/standards/a2a-agent-card.js +24 -9
- package/dist/bridges/standards/graphql.d.ts +3 -4
- package/dist/bridges/standards/graphql.js +70 -66
- package/dist/bridges/standards/index.d.ts +1 -2
- package/dist/bridges/standards/index.js +57 -47
- package/dist/bridges/standards/json-ld.d.ts +25 -11
- package/dist/bridges/standards/json-ld.js +114 -56
- package/dist/bridges/standards/llms-txt.d.ts +4 -2
- package/dist/bridges/standards/llms-txt.js +46 -32
- package/dist/bridges/standards/markdown-negotiation.d.ts +4 -1
- package/dist/bridges/standards/markdown-negotiation.js +16 -11
- package/dist/bridges/standards/mcp.d.ts +3 -12
- package/dist/bridges/standards/mcp.js +89 -132
- package/dist/bridges/standards/openapi.d.ts +7 -15
- package/dist/bridges/standards/openapi.js +657 -207
- package/dist/bridges/standards/probe-evidence.d.ts +30 -0
- package/dist/bridges/standards/probe-evidence.js +90 -0
- package/dist/bridges/standards/schema-org.d.ts +15 -9
- package/dist/bridges/standards/schema-org.js +38 -64
- package/dist/bridges/standards/sitemap.d.ts +2 -3
- package/dist/bridges/standards/sitemap.js +161 -169
- package/dist/bridges/standards/well-known.d.ts +3 -7
- package/dist/bridges/standards/well-known.js +28 -12
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +107 -22
- package/dist/cli/journey-commands.d.ts +3 -0
- package/dist/cli/journey-commands.js +35 -0
- package/dist/cli/read-report.d.ts +2 -0
- package/dist/cli/read-report.js +11 -0
- package/dist/core/bridge-output.d.ts +11 -0
- package/dist/core/bridge-output.js +86 -0
- package/dist/core/bridge-session.d.ts +28 -0
- package/dist/core/bridge-session.js +58 -0
- package/dist/core/bridge-worker.d.ts +1 -0
- package/dist/core/bridge-worker.js +66 -0
- package/dist/core/diff.d.ts +79 -0
- package/dist/core/diff.js +499 -0
- package/dist/core/explanations.d.ts +1 -3
- package/dist/core/explanations.js +36 -59
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +2 -3
- package/dist/core/scan-options.d.ts +0 -1
- package/dist/core/scan-options.js +14 -6
- package/dist/core/scan.d.ts +0 -1
- package/dist/core/scan.js +91 -41
- package/dist/core/scoring.d.ts +6 -0
- package/dist/core/scoring.js +27 -0
- package/dist/core/types.d.ts +97 -61
- package/dist/core/types.js +9 -3
- package/dist/core/validate-report.d.ts +5 -0
- package/dist/core/validate-report.js +95 -0
- package/dist/core/version.d.ts +0 -1
- package/dist/core/version.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/journey/body-worker.d.ts +27 -0
- package/dist/journey/body-worker.js +140 -0
- package/dist/journey/case.d.ts +74 -0
- package/dist/journey/case.js +187 -0
- package/dist/journey/cli.d.ts +14 -0
- package/dist/journey/cli.js +226 -0
- package/dist/journey/compare.d.ts +43 -0
- package/dist/journey/compare.js +83 -0
- package/dist/journey/contracts.d.ts +143 -0
- package/dist/journey/contracts.js +37 -0
- package/dist/journey/decision.d.ts +72 -0
- package/dist/journey/decision.js +121 -0
- package/dist/journey/demo.d.ts +36 -0
- package/dist/journey/demo.js +137 -0
- package/dist/journey/document.d.ts +8 -0
- package/dist/journey/document.js +113 -0
- package/dist/journey/excerpt.d.ts +6 -0
- package/dist/journey/excerpt.js +54 -0
- package/dist/journey/name-guidance.d.ts +2 -0
- package/dist/journey/name-guidance.js +41 -0
- package/dist/journey/providers.d.ts +34 -0
- package/dist/journey/providers.js +197 -0
- package/dist/journey/report-validation.d.ts +3 -0
- package/dist/journey/report-validation.js +457 -0
- package/dist/journey/runner.d.ts +12 -0
- package/dist/journey/runner.js +321 -0
- package/dist/journey/scope.d.ts +8 -0
- package/dist/journey/scope.js +50 -0
- package/dist/journey/transport.d.ts +3 -0
- package/dist/journey/transport.js +45 -0
- package/dist/journey/verify.d.ts +21 -0
- package/dist/journey/verify.js +213 -0
- package/dist/render/colors.d.ts +6 -7
- package/dist/render/colors.js +16 -25
- package/dist/render/discovery-guidance.d.ts +3 -0
- package/dist/render/discovery-guidance.js +66 -0
- package/dist/render/format-bridge.d.ts +1 -2
- package/dist/render/format-bridge.js +22 -17
- package/dist/render/format-diff.d.ts +2 -0
- package/dist/render/format-diff.js +169 -0
- package/dist/render/format-scan.d.ts +0 -1
- package/dist/render/format-scan.js +6 -4
- package/dist/render/format-verbose.d.ts +0 -1
- package/dist/render/format-verbose.js +7 -4
- package/dist/render/index.d.ts +0 -1
- package/dist/render/index.js +1 -2
- package/dist/render/oauth-observations.d.ts +4 -0
- package/dist/render/oauth-observations.js +27 -0
- package/dist/render/progress-bar.d.ts +1 -2
- package/dist/render/progress-bar.js +8 -6
- package/dist/render/robots-inventory.d.ts +3 -0
- package/dist/render/robots-inventory.js +38 -0
- package/dist/render/symbols.d.ts +4 -10
- package/dist/render/symbols.js +15 -17
- package/dist/render/terminal-text.d.ts +1 -3
- package/dist/render/terminal-text.js +1 -5
- package/dist/utils/analysis-worker-entry.d.ts +3 -0
- package/dist/utils/analysis-worker-entry.js +12 -0
- package/dist/utils/analysis-worker.d.ts +12 -0
- package/dist/utils/analysis-worker.js +54 -0
- package/dist/utils/html.d.ts +39 -0
- package/dist/utils/html.js +261 -0
- package/dist/utils/http-client.d.ts +24 -17
- package/dist/utils/http-client.js +166 -200
- package/dist/utils/http-types.d.ts +43 -0
- package/dist/utils/http-types.js +11 -0
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/package-registry.d.ts +11 -0
- package/dist/utils/package-registry.js +69 -0
- package/dist/utils/read-json-file.d.ts +3 -0
- package/dist/utils/read-json-file.js +41 -0
- package/dist/utils/record.d.ts +1 -0
- package/dist/utils/record.js +3 -0
- package/dist/utils/response-body.d.ts +7 -0
- package/dist/utils/response-body.js +71 -0
- package/dist/utils/ssrf.d.ts +11 -15
- package/dist/utils/ssrf.js +80 -44
- package/dist/utils/terminal-text.d.ts +2 -0
- package/dist/utils/terminal-text.js +4 -0
- package/dist/utils/url.d.ts +29 -1
- package/dist/utils/url.js +147 -17
- package/docs/examples/onboarding/account-claim.json +25 -0
- package/docs/examples/onboarding/pages/account-claim.html +3 -0
- package/docs/examples/onboarding/pages/production-activation.html +3 -0
- package/docs/examples/onboarding/pages/test-credential.html +3 -0
- package/docs/examples/onboarding/production-activation.json +25 -0
- package/docs/examples/onboarding/test-credential.json +25 -0
- package/docs/journey-qualification.md +46 -0
- package/docs/journeys.md +83 -0
- package/package.json +28 -8
- package/dist/bridges/context/agents-json.d.ts.map +0 -1
- package/dist/bridges/context/agents-json.js.map +0 -1
- package/dist/bridges/context/auth-clarity.d.ts.map +0 -1
- package/dist/bridges/context/auth-clarity.js.map +0 -1
- package/dist/bridges/context/auth-legibility.d.ts.map +0 -1
- package/dist/bridges/context/auth-legibility.js.map +0 -1
- package/dist/bridges/context/index.d.ts.map +0 -1
- package/dist/bridges/context/index.js.map +0 -1
- package/dist/bridges/context/rate-limits.d.ts.map +0 -1
- package/dist/bridges/context/rate-limits.js.map +0 -1
- package/dist/bridges/context/tos-contact.d.ts.map +0 -1
- package/dist/bridges/context/tos-contact.js.map +0 -1
- package/dist/bridges/context/versioning.d.ts.map +0 -1
- package/dist/bridges/context/versioning.js.map +0 -1
- package/dist/bridges/index.d.ts.map +0 -1
- package/dist/bridges/index.js.map +0 -1
- package/dist/bridges/reachability/crawler-policy.d.ts.map +0 -1
- package/dist/bridges/reachability/crawler-policy.js.map +0 -1
- package/dist/bridges/reachability/http-status.d.ts.map +0 -1
- package/dist/bridges/reachability/http-status.js.map +0 -1
- package/dist/bridges/reachability/https-check.d.ts.map +0 -1
- package/dist/bridges/reachability/https-check.js.map +0 -1
- package/dist/bridges/reachability/index.d.ts.map +0 -1
- package/dist/bridges/reachability/index.js.map +0 -1
- package/dist/bridges/reachability/meta-robots.d.ts.map +0 -1
- package/dist/bridges/reachability/meta-robots.js.map +0 -1
- package/dist/bridges/reachability/robots-parser.d.ts.map +0 -1
- package/dist/bridges/reachability/robots-parser.js.map +0 -1
- package/dist/bridges/reachability/robots-txt.d.ts.map +0 -1
- package/dist/bridges/reachability/robots-txt.js.map +0 -1
- package/dist/bridges/schema/descriptions.d.ts.map +0 -1
- package/dist/bridges/schema/descriptions.js.map +0 -1
- package/dist/bridges/schema/error-schemas.d.ts.map +0 -1
- package/dist/bridges/schema/error-schemas.js.map +0 -1
- package/dist/bridges/schema/index.d.ts.map +0 -1
- package/dist/bridges/schema/index.js.map +0 -1
- package/dist/bridges/schema/oas-types.d.ts.map +0 -1
- package/dist/bridges/schema/oas-types.js.map +0 -1
- package/dist/bridges/schema/operation-ids.d.ts.map +0 -1
- package/dist/bridges/schema/operation-ids.js.map +0 -1
- package/dist/bridges/schema/required-fields.d.ts.map +0 -1
- package/dist/bridges/schema/required-fields.js.map +0 -1
- package/dist/bridges/schema/schema-types.d.ts.map +0 -1
- package/dist/bridges/schema/schema-types.js.map +0 -1
- package/dist/bridges/separation/api-presence.d.ts.map +0 -1
- package/dist/bridges/separation/api-presence.js.map +0 -1
- package/dist/bridges/separation/developer-docs.d.ts.map +0 -1
- package/dist/bridges/separation/developer-docs.js.map +0 -1
- package/dist/bridges/separation/index.d.ts.map +0 -1
- package/dist/bridges/separation/index.js.map +0 -1
- package/dist/bridges/separation/sdk-references.d.ts.map +0 -1
- package/dist/bridges/separation/sdk-references.js.map +0 -1
- package/dist/bridges/separation/webhook-support.d.ts.map +0 -1
- package/dist/bridges/separation/webhook-support.js.map +0 -1
- package/dist/bridges/standards/a2a-agent-card.d.ts.map +0 -1
- package/dist/bridges/standards/a2a-agent-card.js.map +0 -1
- package/dist/bridges/standards/graphql.d.ts.map +0 -1
- package/dist/bridges/standards/graphql.js.map +0 -1
- package/dist/bridges/standards/index.d.ts.map +0 -1
- package/dist/bridges/standards/index.js.map +0 -1
- package/dist/bridges/standards/json-ld.d.ts.map +0 -1
- package/dist/bridges/standards/json-ld.js.map +0 -1
- package/dist/bridges/standards/llms-txt.d.ts.map +0 -1
- package/dist/bridges/standards/llms-txt.js.map +0 -1
- package/dist/bridges/standards/markdown-negotiation.d.ts.map +0 -1
- package/dist/bridges/standards/markdown-negotiation.js.map +0 -1
- package/dist/bridges/standards/mcp.d.ts.map +0 -1
- package/dist/bridges/standards/mcp.js.map +0 -1
- package/dist/bridges/standards/openapi.d.ts.map +0 -1
- package/dist/bridges/standards/openapi.js.map +0 -1
- package/dist/bridges/standards/schema-org.d.ts.map +0 -1
- package/dist/bridges/standards/schema-org.js.map +0 -1
- package/dist/bridges/standards/sitemap.d.ts.map +0 -1
- package/dist/bridges/standards/sitemap.js.map +0 -1
- package/dist/bridges/standards/well-known.d.ts.map +0 -1
- package/dist/bridges/standards/well-known.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/core/explanations.d.ts.map +0 -1
- package/dist/core/explanations.js.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/scan-options.d.ts.map +0 -1
- package/dist/core/scan-options.js.map +0 -1
- package/dist/core/scan.d.ts.map +0 -1
- package/dist/core/scan.js.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js.map +0 -1
- package/dist/core/version.d.ts.map +0 -1
- package/dist/core/version.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/render/colors.d.ts.map +0 -1
- package/dist/render/colors.js.map +0 -1
- package/dist/render/format-bridge.d.ts.map +0 -1
- package/dist/render/format-bridge.js.map +0 -1
- package/dist/render/format-scan.d.ts.map +0 -1
- package/dist/render/format-scan.js.map +0 -1
- package/dist/render/format-verbose.d.ts.map +0 -1
- package/dist/render/format-verbose.js.map +0 -1
- package/dist/render/index.d.ts.map +0 -1
- package/dist/render/index.js.map +0 -1
- package/dist/render/progress-bar.d.ts.map +0 -1
- package/dist/render/progress-bar.js.map +0 -1
- package/dist/render/symbols.d.ts.map +0 -1
- package/dist/render/symbols.js.map +0 -1
- package/dist/render/terminal-text.d.ts.map +0 -1
- package/dist/render/terminal-text.js.map +0 -1
- package/dist/utils/http-client.d.ts.map +0 -1
- package/dist/utils/http-client.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/ssrf.d.ts.map +0 -1
- package/dist/utils/ssrf.js.map +0 -1
- package/dist/utils/url.d.ts.map +0 -1
- package/dist/utils/url.js.map +0 -1
|
@@ -1,57 +1,30 @@
|
|
|
1
1
|
/** Static explanations for why each check matters for AI agent readiness */
|
|
2
|
-
|
|
2
|
+
const explanations = {
|
|
3
3
|
// Bridge 1: Reachability
|
|
4
4
|
https_available: "HTTPS is required for secure communication. AI agents refuse to interact with insecure endpoints.",
|
|
5
5
|
http_status: {
|
|
6
6
|
pass: "Your product surface returns a clean 200 response — agents can reach your content without issues.",
|
|
7
7
|
fail: "Agents can't reach your content. Non-200 responses block automated workflows entirely.",
|
|
8
|
-
partial: "
|
|
8
|
+
partial: "Agents may not receive all of your content: the response was a redirect, a partial body, or too large to inspect.",
|
|
9
9
|
default: "A non-200 status means agents can't reliably reach your content.",
|
|
10
10
|
},
|
|
11
11
|
robots_txt: {
|
|
12
|
-
pass: "
|
|
13
|
-
fail: "
|
|
14
|
-
partial: "
|
|
15
|
-
default: "robots.txt
|
|
16
|
-
},
|
|
17
|
-
crawler_policy_gptbot:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
crawler_policy_ccbot: {
|
|
30
|
-
pass: "CCBot can access your content — it will be included in the Common Crawl open dataset used to train AI models.",
|
|
31
|
-
fail: "Blocking CCBot removes your content from the largest open web dataset used to train AI models.",
|
|
32
|
-
partial: "CCBot has restricted access — some of your content may be excluded from AI training datasets.",
|
|
33
|
-
default: "CCBot is Common Crawl's bot. Its policy affects whether your content appears in AI training data.",
|
|
34
|
-
},
|
|
35
|
-
crawler_policy_googlebot: {
|
|
36
|
-
pass: "Googlebot can access your content — it will appear in Google Search and Gemini.",
|
|
37
|
-
fail: "Blocking Googlebot removes your content from Google Search results and Gemini.",
|
|
38
|
-
partial: "Googlebot has restricted access — some of your content may not appear in Google Search or Gemini.",
|
|
39
|
-
default: "Googlebot powers Google Search and AI features. Its policy determines your Google visibility.",
|
|
40
|
-
},
|
|
41
|
-
crawler_policy_bingbot: {
|
|
42
|
-
pass: "Bingbot can access your content — it will appear in Bing Search and Microsoft Copilot.",
|
|
43
|
-
fail: "Blocking Bingbot removes your content from Bing Search and Microsoft Copilot.",
|
|
44
|
-
partial: "Bingbot has restricted access — some of your content may not appear in Bing or Copilot.",
|
|
45
|
-
default: "Bingbot powers Bing Search and Microsoft Copilot. Its policy determines your Microsoft AI visibility.",
|
|
46
|
-
},
|
|
47
|
-
crawler_policy_perplexitybot: {
|
|
48
|
-
pass: "PerplexityBot can access your content — it will appear in Perplexity AI search answers.",
|
|
49
|
-
fail: "Blocking PerplexityBot prevents your content from appearing in AI-powered search answers.",
|
|
50
|
-
partial: "PerplexityBot has restricted access — some of your content may not appear in Perplexity answers.",
|
|
51
|
-
default: "PerplexityBot powers Perplexity AI search. Its policy affects your visibility in AI search.",
|
|
52
|
-
},
|
|
53
|
-
meta_robots: "Meta robots tags can override robots.txt — preventing AI agents from indexing or following links even when crawling is allowed.",
|
|
54
|
-
x_robots_tag: "X-Robots-Tag headers apply indexing restrictions at the server level, affecting all AI agents regardless of page content.",
|
|
12
|
+
pass: "This origin publishes crawling instructions in robots.txt.",
|
|
13
|
+
fail: "The response at /robots.txt did not contain a usable robots file. Check what this origin serves to crawlers.",
|
|
14
|
+
partial: "Crawlers may access an origin whose /robots.txt returns a 4xx or contains no rules. A readable file can specify different rules for individual crawlers.",
|
|
15
|
+
default: "Crawlers consult the robots.txt file on each origin for its crawling policy.",
|
|
16
|
+
},
|
|
17
|
+
crawler_policy_gptbot: "GPTBot collects content that may be used to improve OpenAI models. ChatGPT search and user-initiated retrieval use separate agents.",
|
|
18
|
+
crawler_policy_claudebot: "ClaudeBot gathers material for model development. Claude search and user-requested reads use separate agents.",
|
|
19
|
+
crawler_policy_ccbot: "CCBot collects pages for the Common Crawl dataset. Its robots rules govern which pages it may crawl.",
|
|
20
|
+
crawler_policy_google_extended: "Google-Extended controls use of crawled content for Gemini training and grounding in certain Google products.",
|
|
21
|
+
crawler_policy_applebot_extended: "Applebot-Extended controls use of crawled content for training Apple foundation models.",
|
|
22
|
+
crawler_policy_perplexitybot: "PerplexityBot crawls for search. Robots rules can restrict which pages it may retrieve.",
|
|
23
|
+
// Keep archived report IDs recognizable in offline comparisons.
|
|
24
|
+
crawler_policy_googlebot: "Googlebot crawls for Google Search.",
|
|
25
|
+
crawler_policy_bingbot: "Bingbot crawls for Bing Search.",
|
|
26
|
+
meta_robots: "Page-level robots directives tell supporting crawlers how to index a page or follow its links.",
|
|
27
|
+
x_robots_tag: "X-Robots-Tag delivers indexing and presentation directives with an HTTP response.",
|
|
55
28
|
// Bridge 2: Standards
|
|
56
29
|
markdown_negotiation: {
|
|
57
30
|
pass: "Your server returns markdown via content negotiation — AI agents get clean, token-efficient content instead of parsing HTML.",
|
|
@@ -90,9 +63,9 @@ export const CHECK_EXPLANATIONS = {
|
|
|
90
63
|
default: "llms-full.txt provides comprehensive product content that gives AI agents deep context beyond the llms.txt summary.",
|
|
91
64
|
},
|
|
92
65
|
mcp_endpoint: {
|
|
93
|
-
pass: "
|
|
94
|
-
fail: "
|
|
95
|
-
default: "
|
|
66
|
+
pass: "A recognized MCP declaration advertises support. A client can use its connection instructions to verify protocol access.",
|
|
67
|
+
fail: "Inspect the declaration at /.well-known/mcp.json or publish a link to your supported MCP configuration.",
|
|
68
|
+
default: "This check reads a published declaration and records text references separately.",
|
|
96
69
|
},
|
|
97
70
|
json_ld: {
|
|
98
71
|
pass: "Your JSON-LD lets AI agents extract structured entities, relationships, and attributes from your pages.",
|
|
@@ -112,23 +85,23 @@ export const CHECK_EXPLANATIONS = {
|
|
|
112
85
|
},
|
|
113
86
|
// Bridge 3: Separation
|
|
114
87
|
api_presence: {
|
|
115
|
-
pass: "
|
|
116
|
-
fail: "
|
|
88
|
+
pass: "The scan found evidence of an API. The Separation summary identifies the strongest observation.",
|
|
89
|
+
fail: "The checked sources gave an integrator no indication of an API.",
|
|
117
90
|
default: "API presence signals tell AI agents your product has a programmatic interface, not just web pages.",
|
|
118
91
|
},
|
|
119
92
|
developer_docs: {
|
|
120
|
-
pass: "
|
|
121
|
-
fail: "
|
|
93
|
+
pass: "The inventory identifies published documentation links and the pages verified at their destinations.",
|
|
94
|
+
fail: "The checked links and paths yielded no developer documentation.",
|
|
122
95
|
default: "Developer documentation is where AI agents learn how to build integrations with your product.",
|
|
123
96
|
},
|
|
124
97
|
sdk_references: {
|
|
125
|
-
pass: "
|
|
126
|
-
fail: "
|
|
98
|
+
pass: "A package registry reference or installation command gives an integrator a client library to investigate.",
|
|
99
|
+
fail: "The checked sources yielded no package registry references or installation commands.",
|
|
127
100
|
default: "SDK and package references tell AI agents which languages your API supports and how to get started.",
|
|
128
101
|
},
|
|
129
102
|
webhook_support: {
|
|
130
|
-
pass: "
|
|
131
|
-
fail: "
|
|
103
|
+
pass: "The recorded signals identify where an integrator can look for event delivery support.",
|
|
104
|
+
fail: "The checked sources yielded no webhook evidence.",
|
|
132
105
|
default: "Webhooks enable AI agents to receive real-time events instead of polling your API.",
|
|
133
106
|
},
|
|
134
107
|
// Bridge 4: Schema
|
|
@@ -138,7 +111,7 @@ export const CHECK_EXPLANATIONS = {
|
|
|
138
111
|
default: "operationId is the machine-readable function name that AI agents use to call your API endpoints.",
|
|
139
112
|
},
|
|
140
113
|
schema_types_defined: {
|
|
141
|
-
pass: "
|
|
114
|
+
pass: "The inspected request and successful-response schemas declare their types.",
|
|
142
115
|
fail: "Schemas lack type definitions — agents cannot determine the shape of data to send or expect.",
|
|
143
116
|
default: "Typed schemas tell AI agents exactly what data structures your API accepts and returns.",
|
|
144
117
|
},
|
|
@@ -198,16 +171,20 @@ export const CHECK_EXPLANATIONS = {
|
|
|
198
171
|
default: "agents.json at /.well-known/ defines policies for how AI agents should interact with your service.",
|
|
199
172
|
},
|
|
200
173
|
};
|
|
174
|
+
for (const entry of Object.values(explanations)) {
|
|
175
|
+
if (typeof entry === "object")
|
|
176
|
+
Object.freeze(entry);
|
|
177
|
+
}
|
|
178
|
+
export const CHECK_EXPLANATIONS = Object.freeze(explanations);
|
|
201
179
|
/**
|
|
202
180
|
* Resolve the explanation for a check given its ID and status.
|
|
203
181
|
* Falls back: status-specific → "default" key → plain string → undefined.
|
|
204
182
|
*/
|
|
205
183
|
export function resolveExplanation(checkId, status) {
|
|
206
|
-
const entry = CHECK_EXPLANATIONS[checkId];
|
|
184
|
+
const entry = Object.hasOwn(CHECK_EXPLANATIONS, checkId) ? CHECK_EXPLANATIONS[checkId] : undefined;
|
|
207
185
|
if (entry === undefined)
|
|
208
186
|
return undefined;
|
|
209
187
|
if (typeof entry === "string")
|
|
210
188
|
return entry;
|
|
211
189
|
return entry[status] ?? entry.default;
|
|
212
190
|
}
|
|
213
|
-
//# sourceMappingURL=explanations.js.map
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type { BridgeId, BridgeName, BridgeResult, BridgeStatus, Check, CheckStatus, CliErrorKind, ContentSource, HttpError, HttpErrorKind, HttpFailure, HttpResponse, HttpSuccess, ScanContext, ScanErrorKind, ScanFailure, ScanOptions, ScanOutcome, ScanRequestSummary, ScanResult, } from "./types.js";
|
|
2
2
|
export { scan } from "./scan.js";
|
|
3
|
+
export { compareReports } from "./diff.js";
|
|
4
|
+
export type { AuthSummary, Coverage, DiffFinding, DiffOptions, FindingEvidence, ReportDiff, RouteSummary } from "./diff.js";
|
|
5
|
+
export { parseScanReport, validateReport } from "./validate-report.js";
|
|
3
6
|
export { getVersion } from "./version.js";
|
|
4
7
|
export { resolveExplanation, CHECK_EXPLANATIONS } from "./explanations.js";
|
|
5
8
|
export type { ExplanationEntry } from "./explanations.js";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
// Core barrel: public API surface (Phase 8 -- programmatic API contract)
|
|
2
|
-
export * from "./types.js";
|
|
3
1
|
export { scan } from "./scan.js";
|
|
2
|
+
export { compareReports } from "./diff.js";
|
|
3
|
+
export { parseScanReport, validateReport } from "./validate-report.js";
|
|
4
4
|
export { getVersion } from "./version.js";
|
|
5
5
|
export { resolveExplanation, CHECK_EXPLANATIONS } from "./explanations.js";
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -4,14 +4,22 @@ export function validateScanOptions(options) {
|
|
|
4
4
|
if (!options || typeof options !== "object" || Array.isArray(options)) {
|
|
5
5
|
return "Scan options must be an object";
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
for (const key of ["timeout", "deadlineMs"]) {
|
|
8
|
+
const value = options[key];
|
|
9
|
+
if (value !== undefined && (!Number.isInteger(value) || value < 1 || value > MAX_TIMEOUT_MS)) {
|
|
10
|
+
return `${key} requires an integer between 1 and ${MAX_TIMEOUT_MS} milliseconds`;
|
|
11
|
+
}
|
|
10
12
|
}
|
|
11
|
-
for (const
|
|
13
|
+
for (const key of ["maxConcurrency", "maxRequests"]) {
|
|
14
|
+
const value = options[key];
|
|
12
15
|
if (value !== undefined && (!Number.isSafeInteger(value) || value < 1)) {
|
|
13
|
-
return `${
|
|
16
|
+
return `${key} requires a positive safe integer`;
|
|
14
17
|
}
|
|
15
18
|
}
|
|
19
|
+
if (options.signal !== undefined && !(options.signal instanceof AbortSignal))
|
|
20
|
+
return "signal must be an AbortSignal";
|
|
21
|
+
if (options.registryLookup !== undefined && typeof options.registryLookup !== "boolean")
|
|
22
|
+
return "registryLookup must be a boolean";
|
|
23
|
+
if (options.onProgress !== undefined && typeof options.onProgress !== "function")
|
|
24
|
+
return "onProgress must be a function";
|
|
16
25
|
}
|
|
17
|
-
//# sourceMappingURL=scan-options.js.map
|
package/dist/core/scan.d.ts
CHANGED
package/dist/core/scan.js
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { checkCoverage, scoreLabel } from "./scoring.js";
|
|
2
|
+
import { BRIDGES } from "./types.js";
|
|
2
3
|
import { normalizeUrl } from "../utils/index.js";
|
|
3
|
-
import {
|
|
4
|
+
import { createBridgeRunner } from "./bridge-session.js";
|
|
5
|
+
import { AnalysisLimitError } from "../utils/analysis-worker.js";
|
|
4
6
|
import { getVersion } from "./version.js";
|
|
7
|
+
import { resolveExplanation } from "./explanations.js";
|
|
5
8
|
import { validateScanOptions } from "./scan-options.js";
|
|
6
9
|
import { runWithScanRequestContext, getScanRequestStats } from "../utils/http-client.js";
|
|
10
|
+
function skipped(id, message) {
|
|
11
|
+
return { ...BRIDGES[id], status: "not_evaluated", score: null,
|
|
12
|
+
scoreLabel: null, checks: [], durationMs: 0, ...(message && { message }) };
|
|
13
|
+
}
|
|
14
|
+
async function runBridge(id, run) {
|
|
15
|
+
try {
|
|
16
|
+
return await run();
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return skipped(id, error instanceof Error ? error.message : "Bridge evaluation failed");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
7
22
|
export async function scan(url, options = {}) {
|
|
8
23
|
const start = performance.now();
|
|
9
24
|
const timestamp = new Date().toISOString();
|
|
@@ -13,57 +28,92 @@ export async function scan(url, options = {}) {
|
|
|
13
28
|
}
|
|
14
29
|
const optionError = validateScanOptions(options);
|
|
15
30
|
if (optionError)
|
|
16
|
-
return { ok: false, error: { kind: "
|
|
31
|
+
return { ok: false, error: { kind: "invalid_options", message: optionError } };
|
|
17
32
|
const { domain, baseUrl } = normalized;
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
33
|
+
const deadline = options.deadlineMs === undefined ? undefined : AbortSignal.timeout(options.deadlineMs);
|
|
34
|
+
const signal = deadline && options.signal ? AbortSignal.any([deadline, options.signal]) : deadline ?? options.signal;
|
|
35
|
+
const ctx = { url, domain, baseUrl, options: { ...options, signal }, shared: {} };
|
|
36
|
+
// An observer must not decide the outcome, and a silent library has no channel to report its failure.
|
|
37
|
+
const progress = (stage) => {
|
|
22
38
|
try {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
Promise.resolve(options.onProgress?.(stage)).catch(() => { });
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// Ignored, as above.
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const cancelled = () => ({ ok: false, error: { kind: "scan_cancelled",
|
|
46
|
+
message: deadline?.aborted ? "Scan deadline exceeded" : "Scan cancelled" } });
|
|
47
|
+
try {
|
|
48
|
+
return await runWithScanRequestContext(ctx.options, async () => {
|
|
49
|
+
if (signal?.aborted)
|
|
50
|
+
return cancelled();
|
|
51
|
+
progress("Bridge 1: Reachability");
|
|
52
|
+
const evaluate = createBridgeRunner(ctx);
|
|
53
|
+
const first = await evaluate(1).catch((error) => {
|
|
54
|
+
if (error instanceof AnalysisLimitError)
|
|
55
|
+
return skipped(1, error.message);
|
|
56
|
+
throw error;
|
|
57
|
+
});
|
|
58
|
+
const bridges = [first, skipped(2), skipped(3), skipped(4), skipped(5)];
|
|
59
|
+
if (!first.abort && first.status === "evaluated") {
|
|
60
|
+
if (signal?.aborted)
|
|
61
|
+
return cancelled();
|
|
62
|
+
progress("Bridge 2: Standards");
|
|
63
|
+
bridges[1] = await runBridge(2, () => evaluate(2));
|
|
64
|
+
if (bridges[1].status === "evaluated") {
|
|
65
|
+
if (signal?.aborted)
|
|
66
|
+
return cancelled();
|
|
67
|
+
progress("Bridge 3: Separation");
|
|
68
|
+
bridges[2] = await runBridge(3, () => evaluate(3));
|
|
69
|
+
if (signal?.aborted)
|
|
70
|
+
return cancelled();
|
|
71
|
+
progress("Bridges 4 and 5: Schema and Context");
|
|
72
|
+
[bridges[3], bridges[4]] = await Promise.all([
|
|
73
|
+
runBridge(4, () => evaluate(4)), runBridge(5, () => evaluate(5)),
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
for (const id of [3, 4, 5])
|
|
78
|
+
bridges[id - 1] = skipped(id, "Standards evidence unavailable");
|
|
79
|
+
}
|
|
35
80
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
spinner.text = "Bridge 3: Separation...";
|
|
40
|
-
bridge3 = await runSeparationBridge(ctx);
|
|
41
|
-
spinner.text = "Bridges 4-5: Schema & Context...";
|
|
42
|
-
[bridge4, bridge5] = await Promise.all([runSchemaBridge(ctx), runContextBridge(ctx)]);
|
|
81
|
+
if (first.status === "not_evaluated") {
|
|
82
|
+
for (const bridge of bridges.slice(1))
|
|
83
|
+
bridge.message = "Reachability evidence unavailable";
|
|
43
84
|
}
|
|
44
|
-
|
|
85
|
+
if (signal?.aborted)
|
|
86
|
+
return cancelled();
|
|
87
|
+
for (const bridge of bridges) {
|
|
88
|
+
if (bridge.status === "evaluated")
|
|
89
|
+
bridge.measurement = checkCoverage(bridge.checks);
|
|
90
|
+
for (const check of bridge.checks) {
|
|
91
|
+
check.why ??= resolveExplanation(check.id, check.status);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const scoredBridges = bridges.filter((b) => b.score !== null);
|
|
45
95
|
const overallScore = scoredBridges.length > 0
|
|
46
96
|
? Math.round(scoredBridges.reduce((sum, b) => sum + b.score, 0) / scoredBridges.length)
|
|
47
97
|
: 0;
|
|
48
|
-
const overallScoreLabel = overallScore
|
|
98
|
+
const overallScoreLabel = scoreLabel(overallScore);
|
|
99
|
+
const requestContext = getScanRequestStats();
|
|
49
100
|
const result = {
|
|
50
101
|
ok: true,
|
|
51
102
|
version: getVersion(), url, scannedOrigin: baseUrl, timestamp,
|
|
52
103
|
durationMs: Math.round(performance.now() - start),
|
|
53
104
|
overallScore, overallScoreLabel,
|
|
54
|
-
incomplete:
|
|
55
|
-
bridges
|
|
105
|
+
incomplete: requestContext.denied > 0, requestContext,
|
|
106
|
+
bridges,
|
|
56
107
|
};
|
|
57
|
-
spinner.stop();
|
|
58
108
|
return result;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
// Bridges are built on a never-throwing HTTP client, so this is a
|
|
113
|
+
// defensive backstop: surface it as a failure outcome, never a throw.
|
|
114
|
+
if (signal?.aborted)
|
|
115
|
+
return cancelled();
|
|
116
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
117
|
+
return { ok: false, error: { kind: "scan_failed", message } };
|
|
118
|
+
}
|
|
68
119
|
}
|
|
69
|
-
//# sourceMappingURL=scan.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Check, BridgeResult } from "./types.js";
|
|
2
|
+
export declare function scoreLabel(score: number, pass?: number, partial?: number): "pass" | "partial" | "fail";
|
|
3
|
+
/** Checks a policy skip leaves out are not eligible; an eligible check with status error is unmeasured. */
|
|
4
|
+
export declare function checkCoverage(checks: readonly Check[]): NonNullable<BridgeResult["measurement"]>;
|
|
5
|
+
/** Include measured, applicable checks only. Each bridge owns its weights and thresholds. */
|
|
6
|
+
export declare function scoreChecks(checks: readonly Check[], weights?: Readonly<Record<string, number>>, pass?: number, partial?: number): Pick<BridgeResult, "score" | "scoreLabel">;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function scoreLabel(score, pass = 80, partial = 40) {
|
|
2
|
+
return score >= pass ? "pass" : score >= partial ? "partial" : "fail";
|
|
3
|
+
}
|
|
4
|
+
/** Checks a policy skip leaves out are not eligible; an eligible check with status error is unmeasured. */
|
|
5
|
+
export function checkCoverage(checks) {
|
|
6
|
+
const eligible = checks.filter(check => check.data?.policy !== "skip");
|
|
7
|
+
return { measured: eligible.filter(check => check.status !== "error").length, eligible: eligible.length };
|
|
8
|
+
}
|
|
9
|
+
/** Include measured, applicable checks only. Each bridge owns its weights and thresholds. */
|
|
10
|
+
export function scoreChecks(checks, weights = {}, pass = 80, partial = 40) {
|
|
11
|
+
let earned = 0;
|
|
12
|
+
let possible = 0;
|
|
13
|
+
for (const check of checks) {
|
|
14
|
+
if (check.status === "error" || check.data?.policy === "skip")
|
|
15
|
+
continue;
|
|
16
|
+
const weight = weights[check.id] ?? 1;
|
|
17
|
+
possible += weight;
|
|
18
|
+
if (check.status === "pass")
|
|
19
|
+
earned += weight;
|
|
20
|
+
if (check.status === "partial")
|
|
21
|
+
earned += weight / 2;
|
|
22
|
+
}
|
|
23
|
+
if (!possible)
|
|
24
|
+
return { score: null, scoreLabel: null };
|
|
25
|
+
const score = Math.round(100 * earned / possible);
|
|
26
|
+
return { score, scoreLabel: scoreLabel(score, pass, partial) };
|
|
27
|
+
}
|