@pseolint/core 0.4.1 → 0.5.3
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 +264 -169
- package/dist/ai/manifest/diff.d.ts +78 -0
- package/dist/ai/manifest/diff.d.ts.map +1 -0
- package/dist/ai/manifest/diff.js +139 -0
- package/dist/ai/manifest/diff.js.map +1 -0
- package/dist/ai/manifest/index.d.ts +18 -0
- package/dist/ai/manifest/index.d.ts.map +1 -0
- package/dist/ai/manifest/index.js +15 -0
- package/dist/ai/manifest/index.js.map +1 -0
- package/dist/ai/manifest/validate-manifest.d.ts +37 -0
- package/dist/ai/manifest/validate-manifest.d.ts.map +1 -0
- package/dist/ai/manifest/validate-manifest.js +67 -0
- package/dist/ai/manifest/validate-manifest.js.map +1 -0
- package/dist/ai/manifest/validators/domain-patches.d.ts +15 -0
- package/dist/ai/manifest/validators/domain-patches.d.ts.map +1 -0
- package/dist/ai/manifest/validators/domain-patches.js +110 -0
- package/dist/ai/manifest/validators/domain-patches.js.map +1 -0
- package/dist/ai/manifest/validators/index.d.ts +5 -0
- package/dist/ai/manifest/validators/index.d.ts.map +1 -0
- package/dist/ai/manifest/validators/index.js +4 -0
- package/dist/ai/manifest/validators/index.js.map +1 -0
- package/dist/ai/manifest/validators/page-changes.d.ts +36 -0
- package/dist/ai/manifest/validators/page-changes.d.ts.map +1 -0
- package/dist/ai/manifest/validators/page-changes.js +221 -0
- package/dist/ai/manifest/validators/page-changes.js.map +1 -0
- package/dist/ai/manifest/validators/types.d.ts +17 -0
- package/dist/ai/manifest/validators/types.d.ts.map +1 -0
- package/dist/ai/manifest/validators/types.js +5 -0
- package/dist/ai/manifest/validators/types.js.map +1 -0
- package/dist/ai/orchestrate.d.ts +74 -0
- package/dist/ai/orchestrate.d.ts.map +1 -0
- package/dist/ai/orchestrate.js +54 -0
- package/dist/ai/orchestrate.js.map +1 -0
- package/dist/ai/orchestrator/budget.d.ts +57 -0
- package/dist/ai/orchestrator/budget.d.ts.map +1 -0
- package/dist/ai/orchestrator/budget.js +114 -0
- package/dist/ai/orchestrator/budget.js.map +1 -0
- package/dist/ai/orchestrator/finish-tool.d.ts +568 -0
- package/dist/ai/orchestrator/finish-tool.d.ts.map +1 -0
- package/dist/ai/orchestrator/finish-tool.js +114 -0
- package/dist/ai/orchestrator/finish-tool.js.map +1 -0
- package/dist/ai/orchestrator/index.d.ts +25 -0
- package/dist/ai/orchestrator/index.d.ts.map +1 -0
- package/dist/ai/orchestrator/index.js +21 -0
- package/dist/ai/orchestrator/index.js.map +1 -0
- package/dist/ai/orchestrator/log.d.ts +24 -0
- package/dist/ai/orchestrator/log.d.ts.map +1 -0
- package/dist/ai/orchestrator/log.js +48 -0
- package/dist/ai/orchestrator/log.js.map +1 -0
- package/dist/ai/orchestrator/page-cache.d.ts +64 -0
- package/dist/ai/orchestrator/page-cache.d.ts.map +1 -0
- package/dist/ai/orchestrator/page-cache.js +127 -0
- package/dist/ai/orchestrator/page-cache.js.map +1 -0
- package/dist/ai/orchestrator/prompt.d.ts +16 -0
- package/dist/ai/orchestrator/prompt.d.ts.map +1 -0
- package/dist/ai/orchestrator/prompt.js +52 -0
- package/dist/ai/orchestrator/prompt.js.map +1 -0
- package/dist/ai/orchestrator/runner.d.ts +65 -0
- package/dist/ai/orchestrator/runner.d.ts.map +1 -0
- package/dist/ai/orchestrator/runner.js +223 -0
- package/dist/ai/orchestrator/runner.js.map +1 -0
- package/dist/ai/orchestrator/session.d.ts +44 -0
- package/dist/ai/orchestrator/session.d.ts.map +1 -0
- package/dist/ai/orchestrator/session.js +64 -0
- package/dist/ai/orchestrator/session.js.map +1 -0
- package/dist/ai/orchestrator/types.d.ts +99 -0
- package/dist/ai/orchestrator/types.d.ts.map +1 -0
- package/dist/ai/orchestrator/types.js +8 -0
- package/dist/ai/orchestrator/types.js.map +1 -0
- package/dist/ai/probes/cache.d.ts +12 -0
- package/dist/ai/probes/cache.d.ts.map +1 -0
- package/dist/ai/probes/cache.js +46 -0
- package/dist/ai/probes/cache.js.map +1 -0
- package/dist/ai/tools/ask-ai-engine.d.ts +77 -0
- package/dist/ai/tools/ask-ai-engine.d.ts.map +1 -0
- package/dist/ai/tools/ask-ai-engine.js +253 -0
- package/dist/ai/tools/ask-ai-engine.js.map +1 -0
- package/dist/ai/tools/check-domain-crawler-access.d.ts +71 -0
- package/dist/ai/tools/check-domain-crawler-access.d.ts.map +1 -0
- package/dist/ai/tools/check-domain-crawler-access.js +76 -0
- package/dist/ai/tools/check-domain-crawler-access.js.map +1 -0
- package/dist/ai/tools/check-domain-llms-txt.d.ts +70 -0
- package/dist/ai/tools/check-domain-llms-txt.d.ts.map +1 -0
- package/dist/ai/tools/check-domain-llms-txt.js +75 -0
- package/dist/ai/tools/check-domain-llms-txt.js.map +1 -0
- package/dist/ai/tools/check-indexability.d.ts +58 -0
- package/dist/ai/tools/check-indexability.d.ts.map +1 -0
- package/dist/ai/tools/check-indexability.js +64 -0
- package/dist/ai/tools/check-indexability.js.map +1 -0
- package/dist/ai/tools/check-robots.d.ts +68 -0
- package/dist/ai/tools/check-robots.d.ts.map +1 -0
- package/dist/ai/tools/check-robots.js +90 -0
- package/dist/ai/tools/check-robots.js.map +1 -0
- package/dist/ai/tools/check-rule-answer-first.d.ts +54 -0
- package/dist/ai/tools/check-rule-answer-first.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-answer-first.js +50 -0
- package/dist/ai/tools/check-rule-answer-first.js.map +1 -0
- package/dist/ai/tools/check-rule-canonical-consistency.d.ts +66 -0
- package/dist/ai/tools/check-rule-canonical-consistency.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-canonical-consistency.js +51 -0
- package/dist/ai/tools/check-rule-canonical-consistency.js.map +1 -0
- package/dist/ai/tools/check-rule-citable-facts.d.ts +58 -0
- package/dist/ai/tools/check-rule-citable-facts.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-citable-facts.js +41 -0
- package/dist/ai/tools/check-rule-citable-facts.js.map +1 -0
- package/dist/ai/tools/check-rule-content-modularity.d.ts +58 -0
- package/dist/ai/tools/check-rule-content-modularity.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-content-modularity.js +45 -0
- package/dist/ai/tools/check-rule-content-modularity.js.map +1 -0
- package/dist/ai/tools/check-rule-faq-coverage.d.ts +54 -0
- package/dist/ai/tools/check-rule-faq-coverage.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-faq-coverage.js +39 -0
- package/dist/ai/tools/check-rule-faq-coverage.js.map +1 -0
- package/dist/ai/tools/check-rule-freshness-signals.d.ts +54 -0
- package/dist/ai/tools/check-rule-freshness-signals.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-freshness-signals.js +45 -0
- package/dist/ai/tools/check-rule-freshness-signals.js.map +1 -0
- package/dist/ai/tools/check-rule-json-ld-valid.d.ts +54 -0
- package/dist/ai/tools/check-rule-json-ld-valid.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-json-ld-valid.js +44 -0
- package/dist/ai/tools/check-rule-json-ld-valid.js.map +1 -0
- package/dist/ai/tools/check-rule-missing-author.d.ts +54 -0
- package/dist/ai/tools/check-rule-missing-author.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-missing-author.js +45 -0
- package/dist/ai/tools/check-rule-missing-author.js.map +1 -0
- package/dist/ai/tools/check-rule-near-duplicate.d.ts +82 -0
- package/dist/ai/tools/check-rule-near-duplicate.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-near-duplicate.js +63 -0
- package/dist/ai/tools/check-rule-near-duplicate.js.map +1 -0
- package/dist/ai/tools/check-rule-required-fields.d.ts +50 -0
- package/dist/ai/tools/check-rule-required-fields.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-required-fields.js +38 -0
- package/dist/ai/tools/check-rule-required-fields.js.map +1 -0
- package/dist/ai/tools/check-rule-schema-consistency.d.ts +54 -0
- package/dist/ai/tools/check-rule-schema-consistency.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-schema-consistency.js +44 -0
- package/dist/ai/tools/check-rule-schema-consistency.js.map +1 -0
- package/dist/ai/tools/check-rule-summary-bait.d.ts +54 -0
- package/dist/ai/tools/check-rule-summary-bait.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-summary-bait.js +39 -0
- package/dist/ai/tools/check-rule-summary-bait.js.map +1 -0
- package/dist/ai/tools/check-rule-thin-content.d.ts +66 -0
- package/dist/ai/tools/check-rule-thin-content.d.ts.map +1 -0
- package/dist/ai/tools/check-rule-thin-content.js +58 -0
- package/dist/ai/tools/check-rule-thin-content.js.map +1 -0
- package/dist/ai/tools/detect-templates.d.ts +60 -0
- package/dist/ai/tools/detect-templates.d.ts.map +1 -0
- package/dist/ai/tools/detect-templates.js +43 -0
- package/dist/ai/tools/detect-templates.js.map +1 -0
- package/dist/ai/tools/fetch-page.d.ts +70 -0
- package/dist/ai/tools/fetch-page.d.ts.map +1 -0
- package/dist/ai/tools/fetch-page.js +93 -0
- package/dist/ai/tools/fetch-page.js.map +1 -0
- package/dist/ai/tools/fetch-sitemap.d.ts +60 -0
- package/dist/ai/tools/fetch-sitemap.d.ts.map +1 -0
- package/dist/ai/tools/fetch-sitemap.js +116 -0
- package/dist/ai/tools/fetch-sitemap.js.map +1 -0
- package/dist/ai/tools/index.d.ts +1555 -0
- package/dist/ai/tools/index.d.ts.map +1 -0
- package/dist/ai/tools/index.js +119 -0
- package/dist/ai/tools/index.js.map +1 -0
- package/dist/ai/tools/parse-page.d.ts +94 -0
- package/dist/ai/tools/parse-page.d.ts.map +1 -0
- package/dist/ai/tools/parse-page.js +108 -0
- package/dist/ai/tools/parse-page.js.map +1 -0
- package/dist/ai/tools/query-serp.d.ts +113 -0
- package/dist/ai/tools/query-serp.d.ts.map +1 -0
- package/dist/ai/tools/query-serp.js +131 -0
- package/dist/ai/tools/query-serp.js.map +1 -0
- package/dist/ai/tools/sample-template.d.ts +67 -0
- package/dist/ai/tools/sample-template.d.ts.map +1 -0
- package/dist/ai/tools/sample-template.js +75 -0
- package/dist/ai/tools/sample-template.js.map +1 -0
- package/dist/ai/tools/types.d.ts +73 -0
- package/dist/ai/tools/types.d.ts.map +1 -0
- package/dist/ai/tools/types.js +64 -0
- package/dist/ai/tools/types.js.map +1 -0
- package/dist/ai/tools/validate-jsonld.d.ts +62 -0
- package/dist/ai/tools/validate-jsonld.d.ts.map +1 -0
- package/dist/ai/tools/validate-jsonld.js +84 -0
- package/dist/ai/tools/validate-jsonld.js.map +1 -0
- package/dist/auditor.d.ts +16 -1
- package/dist/auditor.d.ts.map +1 -1
- package/dist/auditor.js +862 -88
- package/dist/auditor.js.map +1 -1
- package/dist/backpressure.d.ts.map +1 -1
- package/dist/backpressure.js +10 -3
- package/dist/backpressure.js.map +1 -1
- package/dist/enrich-findings.d.ts.map +1 -1
- package/dist/enrich-findings.js +15 -1
- package/dist/enrich-findings.js.map +1 -1
- package/dist/formatters/bucket-findings.d.ts +43 -0
- package/dist/formatters/bucket-findings.d.ts.map +1 -0
- package/dist/formatters/bucket-findings.js +110 -0
- package/dist/formatters/bucket-findings.js.map +1 -0
- package/dist/formatters/console.d.ts.map +1 -1
- package/dist/formatters/console.js +116 -34
- package/dist/formatters/console.js.map +1 -1
- package/dist/formatters/fixplan.d.ts +13 -0
- package/dist/formatters/fixplan.d.ts.map +1 -0
- package/dist/formatters/fixplan.js +328 -0
- package/dist/formatters/fixplan.js.map +1 -0
- package/dist/formatters/html.d.ts.map +1 -1
- package/dist/formatters/html.js +27 -0
- package/dist/formatters/html.js.map +1 -1
- package/dist/formatters/index.d.ts +2 -0
- package/dist/formatters/index.d.ts.map +1 -1
- package/dist/formatters/index.js +1 -0
- package/dist/formatters/index.js.map +1 -1
- package/dist/formatters/markdown.d.ts.map +1 -1
- package/dist/formatters/markdown.js +97 -9
- package/dist/formatters/markdown.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/page-filter.d.ts +64 -6
- package/dist/page-filter.d.ts.map +1 -1
- package/dist/page-filter.js +124 -3
- package/dist/page-filter.js.map +1 -1
- package/dist/rule-references.d.ts.map +1 -1
- package/dist/rule-references.js +5 -0
- package/dist/rule-references.js.map +1 -1
- package/dist/rules/aeo/answer-first.d.ts.map +1 -1
- package/dist/rules/aeo/answer-first.js +17 -3
- package/dist/rules/aeo/answer-first.js.map +1 -1
- package/dist/rules/aeo/citable-facts.d.ts.map +1 -1
- package/dist/rules/aeo/citable-facts.js +12 -1
- package/dist/rules/aeo/citable-facts.js.map +1 -1
- package/dist/rules/aeo/content-modularity.d.ts.map +1 -1
- package/dist/rules/aeo/content-modularity.js +3 -0
- package/dist/rules/aeo/content-modularity.js.map +1 -1
- package/dist/rules/aeo/crawler-access.d.ts.map +1 -1
- package/dist/rules/aeo/crawler-access.js +6 -0
- package/dist/rules/aeo/crawler-access.js.map +1 -1
- package/dist/rules/aeo/faq-coverage.d.ts.map +1 -1
- package/dist/rules/aeo/faq-coverage.js +4 -0
- package/dist/rules/aeo/faq-coverage.js.map +1 -1
- package/dist/rules/aeo/freshness-signals.d.ts.map +1 -1
- package/dist/rules/aeo/freshness-signals.js +9 -2
- package/dist/rules/aeo/freshness-signals.js.map +1 -1
- package/dist/rules/aeo/llms-txt.d.ts.map +1 -1
- package/dist/rules/aeo/llms-txt.js +6 -1
- package/dist/rules/aeo/llms-txt.js.map +1 -1
- package/dist/rules/aeo/summary-bait.d.ts.map +1 -1
- package/dist/rules/aeo/summary-bait.js +5 -2
- package/dist/rules/aeo/summary-bait.js.map +1 -1
- package/dist/rules/content/heading-structure.d.ts +21 -0
- package/dist/rules/content/heading-structure.d.ts.map +1 -0
- package/dist/rules/content/heading-structure.js +56 -0
- package/dist/rules/content/heading-structure.js.map +1 -0
- package/dist/rules/content/image-alt-text.d.ts +18 -0
- package/dist/rules/content/image-alt-text.d.ts.map +1 -0
- package/dist/rules/content/image-alt-text.js +77 -0
- package/dist/rules/content/image-alt-text.js.map +1 -0
- package/dist/rules/content/missing-author.d.ts.map +1 -1
- package/dist/rules/content/missing-author.js +10 -2
- package/dist/rules/content/missing-author.js.map +1 -1
- package/dist/rules/content/title-uniqueness.d.ts +18 -0
- package/dist/rules/content/title-uniqueness.d.ts.map +1 -0
- package/dist/rules/content/title-uniqueness.js +70 -0
- package/dist/rules/content/title-uniqueness.js.map +1 -0
- package/dist/rules/links/host-section-divergence.d.ts +3 -0
- package/dist/rules/links/host-section-divergence.d.ts.map +1 -0
- package/dist/rules/links/host-section-divergence.js +158 -0
- package/dist/rules/links/host-section-divergence.js.map +1 -0
- package/dist/rules/links/link-depth.d.ts +12 -1
- package/dist/rules/links/link-depth.d.ts.map +1 -1
- package/dist/rules/links/link-depth.js +25 -12
- package/dist/rules/links/link-depth.js.map +1 -1
- package/dist/rules/scope.d.ts.map +1 -1
- package/dist/rules/scope.js +5 -0
- package/dist/rules/scope.js.map +1 -1
- package/dist/rules/spam/doorway-pattern.d.ts.map +1 -1
- package/dist/rules/spam/doorway-pattern.js +27 -4
- package/dist/rules/spam/doorway-pattern.js.map +1 -1
- package/dist/rules/spam/publication-velocity.d.ts +1 -1
- package/dist/rules/spam/publication-velocity.d.ts.map +1 -1
- package/dist/rules/spam/publication-velocity.js +9 -4
- package/dist/rules/spam/publication-velocity.js.map +1 -1
- package/dist/rules/spam/template-coverage.js +1 -1
- package/dist/rules/spam/template-coverage.js.map +1 -1
- package/dist/rules/spam/template-diversity.js +1 -1
- package/dist/rules/spam/template-diversity.js.map +1 -1
- package/dist/rules/spam/thin-content.d.ts.map +1 -1
- package/dist/rules/spam/thin-content.js +9 -1
- package/dist/rules/spam/thin-content.js.map +1 -1
- package/dist/rules/tech/hreflang-consistency.d.ts.map +1 -1
- package/dist/rules/tech/hreflang-consistency.js +33 -4
- package/dist/rules/tech/hreflang-consistency.js.map +1 -1
- package/dist/rules/tech/og-completeness.d.ts +11 -0
- package/dist/rules/tech/og-completeness.d.ts.map +1 -1
- package/dist/rules/tech/og-completeness.js +22 -23
- package/dist/rules/tech/og-completeness.js.map +1 -1
- package/dist/ruleset-version.d.ts +8 -0
- package/dist/ruleset-version.d.ts.map +1 -0
- package/dist/ruleset-version.js +8 -0
- package/dist/ruleset-version.js.map +1 -0
- package/dist/scrape-strategy.d.ts +42 -0
- package/dist/scrape-strategy.d.ts.map +1 -0
- package/dist/scrape-strategy.js +101 -0
- package/dist/scrape-strategy.js.map +1 -0
- package/dist/site-classifier.d.ts +1 -1
- package/dist/site-classifier.d.ts.map +1 -1
- package/dist/site-classifier.js +217 -0
- package/dist/site-classifier.js.map +1 -1
- package/dist/state.d.ts +36 -1
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +3 -1
- package/dist/state.js.map +1 -1
- package/dist/stratified-sample.d.ts +9 -1
- package/dist/stratified-sample.d.ts.map +1 -1
- package/dist/stratified-sample.js +23 -6
- package/dist/stratified-sample.js.map +1 -1
- package/dist/types.d.ts +179 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/url-normalize.d.ts.map +1 -1
- package/dist/url-normalize.js +13 -1
- package/dist/url-normalize.js.map +1 -1
- package/package.json +90 -90
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const checkRuleRequiredFieldsTool: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: z.ZodType<{
|
|
6
|
+
pageIds: string[];
|
|
7
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
8
|
+
pageIds: string[];
|
|
9
|
+
}, unknown>>;
|
|
10
|
+
outputSchema: z.ZodType<{
|
|
11
|
+
findings: {
|
|
12
|
+
ruleId: "schema/required-fields";
|
|
13
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
14
|
+
message: string;
|
|
15
|
+
pageUrl?: string | undefined;
|
|
16
|
+
fix?: string | undefined;
|
|
17
|
+
}[];
|
|
18
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
19
|
+
findings: {
|
|
20
|
+
ruleId: "schema/required-fields";
|
|
21
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
22
|
+
message: string;
|
|
23
|
+
pageUrl?: string | undefined;
|
|
24
|
+
fix?: string | undefined;
|
|
25
|
+
}[];
|
|
26
|
+
}, unknown>>;
|
|
27
|
+
toAiTool(): import("ai").Tool<{
|
|
28
|
+
pageIds: string[];
|
|
29
|
+
}, import("./types.js").ToolResult<{
|
|
30
|
+
findings: {
|
|
31
|
+
ruleId: "schema/required-fields";
|
|
32
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
33
|
+
message: string;
|
|
34
|
+
pageUrl?: string | undefined;
|
|
35
|
+
fix?: string | undefined;
|
|
36
|
+
}[];
|
|
37
|
+
}>>;
|
|
38
|
+
run(input: {
|
|
39
|
+
pageIds: string[];
|
|
40
|
+
}, ctx?: import("./types.js").ToolExecuteContext): Promise<import("./types.js").ToolResult<{
|
|
41
|
+
findings: {
|
|
42
|
+
ruleId: "schema/required-fields";
|
|
43
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
44
|
+
message: string;
|
|
45
|
+
pageUrl?: string | undefined;
|
|
46
|
+
fix?: string | undefined;
|
|
47
|
+
}[];
|
|
48
|
+
}>>;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=check-rule-required-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-rule-required-fields.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/check-rule-required-fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBtC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { parseHtmlPage } from "../../parser.js";
|
|
3
|
+
import { requiredFieldsRule } from "../../rules/schema/required-fields.js";
|
|
4
|
+
import { resolvePages } from "../orchestrator/page-cache.js";
|
|
5
|
+
import { defineTool } from "./types.js";
|
|
6
|
+
const inputSchema = z.object({
|
|
7
|
+
pageIds: z.array(z.string()).min(1).max(50).describe("Page references from fetch_page."),
|
|
8
|
+
});
|
|
9
|
+
const outputSchema = z.object({
|
|
10
|
+
findings: z.array(z.object({
|
|
11
|
+
ruleId: z.literal("schema/required-fields"),
|
|
12
|
+
severity: z.enum(["info", "warning", "error", "critical"]),
|
|
13
|
+
message: z.string(),
|
|
14
|
+
pageUrl: z.string().optional(),
|
|
15
|
+
fix: z.string().optional(),
|
|
16
|
+
})),
|
|
17
|
+
});
|
|
18
|
+
export const checkRuleRequiredFieldsTool = defineTool({
|
|
19
|
+
name: "check_rule_required_fields",
|
|
20
|
+
description: "For each JSON-LD block declaring an @type on the referenced pages, verify required Schema.org properties are present (Article: headline/datePublished/author; Product: name/offers; FAQPage: mainEntity; etc.). Flags missing fields per page so the orchestrator can propose `add_jsonld` patches with the correct shape.",
|
|
21
|
+
inputSchema,
|
|
22
|
+
outputSchema,
|
|
23
|
+
async execute({ pageIds }) {
|
|
24
|
+
const entries = resolvePages(pageIds);
|
|
25
|
+
const parsed = entries.map((e) => parseHtmlPage(e.html, e.url));
|
|
26
|
+
const findings = requiredFieldsRule(parsed);
|
|
27
|
+
return {
|
|
28
|
+
findings: findings.map((f) => ({
|
|
29
|
+
ruleId: "schema/required-fields",
|
|
30
|
+
severity: f.severity,
|
|
31
|
+
message: f.message,
|
|
32
|
+
pageUrl: f.pageUrl,
|
|
33
|
+
fix: f.fix,
|
|
34
|
+
})),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=check-rule-required-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-rule-required-fields.js","sourceRoot":"","sources":["../../../src/ai/tools/check-rule-required-fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAA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AAC,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC5C,OAAO;YACL,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC7B,MAAM,EAAE,wBAAiC;gBACzC,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBACpB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,GAAG,EAAE,CAAC,CAAC,GAAG;aACX,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const checkRuleSchemaConsistencyTool: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: z.ZodType<{
|
|
6
|
+
pageIds: string[];
|
|
7
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
8
|
+
pageIds: string[];
|
|
9
|
+
}, unknown>>;
|
|
10
|
+
outputSchema: z.ZodType<{
|
|
11
|
+
findings: {
|
|
12
|
+
ruleId: "schema/consistency";
|
|
13
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
14
|
+
message: string;
|
|
15
|
+
pageUrl?: string | undefined;
|
|
16
|
+
relatedUrls?: string[] | undefined;
|
|
17
|
+
fix?: string | undefined;
|
|
18
|
+
}[];
|
|
19
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
20
|
+
findings: {
|
|
21
|
+
ruleId: "schema/consistency";
|
|
22
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
23
|
+
message: string;
|
|
24
|
+
pageUrl?: string | undefined;
|
|
25
|
+
relatedUrls?: string[] | undefined;
|
|
26
|
+
fix?: string | undefined;
|
|
27
|
+
}[];
|
|
28
|
+
}, unknown>>;
|
|
29
|
+
toAiTool(): import("ai").Tool<{
|
|
30
|
+
pageIds: string[];
|
|
31
|
+
}, import("./types.js").ToolResult<{
|
|
32
|
+
findings: {
|
|
33
|
+
ruleId: "schema/consistency";
|
|
34
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
35
|
+
message: string;
|
|
36
|
+
pageUrl?: string | undefined;
|
|
37
|
+
relatedUrls?: string[] | undefined;
|
|
38
|
+
fix?: string | undefined;
|
|
39
|
+
}[];
|
|
40
|
+
}>>;
|
|
41
|
+
run(input: {
|
|
42
|
+
pageIds: string[];
|
|
43
|
+
}, ctx?: import("./types.js").ToolExecuteContext): Promise<import("./types.js").ToolResult<{
|
|
44
|
+
findings: {
|
|
45
|
+
ruleId: "schema/consistency";
|
|
46
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
47
|
+
message: string;
|
|
48
|
+
pageUrl?: string | undefined;
|
|
49
|
+
relatedUrls?: string[] | undefined;
|
|
50
|
+
fix?: string | undefined;
|
|
51
|
+
}[];
|
|
52
|
+
}>>;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=check-rule-schema-consistency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-rule-schema-consistency.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/check-rule-schema-consistency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA2BxB,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBzC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { parseHtmlPage } from "../../parser.js";
|
|
3
|
+
import { schemaConsistencyRule } from "../../rules/schema/consistency.js";
|
|
4
|
+
import { resolvePages } from "../orchestrator/page-cache.js";
|
|
5
|
+
import { defineTool } from "./types.js";
|
|
6
|
+
const inputSchema = z.object({
|
|
7
|
+
pageIds: z
|
|
8
|
+
.array(z.string())
|
|
9
|
+
.min(2)
|
|
10
|
+
.max(50)
|
|
11
|
+
.describe("Min 2 pageIds — consistency only makes sense across a sample."),
|
|
12
|
+
});
|
|
13
|
+
const outputSchema = z.object({
|
|
14
|
+
findings: z.array(z.object({
|
|
15
|
+
ruleId: z.literal("schema/consistency"),
|
|
16
|
+
severity: z.enum(["info", "warning", "error", "critical"]),
|
|
17
|
+
message: z.string(),
|
|
18
|
+
pageUrl: z.string().optional(),
|
|
19
|
+
relatedUrls: z.array(z.string()).optional(),
|
|
20
|
+
fix: z.string().optional(),
|
|
21
|
+
})),
|
|
22
|
+
});
|
|
23
|
+
export const checkRuleSchemaConsistencyTool = defineTool({
|
|
24
|
+
name: "check_rule_schema_consistency",
|
|
25
|
+
description: "Detect JSON-LD @type mismatches across a page sample (e.g. most /city/* pages declare Place+Service but a few drop Service). Min 2 pageIds — pass a representative sample of one template at a time for the cleanest signal.",
|
|
26
|
+
inputSchema,
|
|
27
|
+
outputSchema,
|
|
28
|
+
async execute({ pageIds }) {
|
|
29
|
+
const entries = resolvePages(pageIds);
|
|
30
|
+
const parsed = entries.map((e) => parseHtmlPage(e.html, e.url));
|
|
31
|
+
const findings = schemaConsistencyRule(parsed);
|
|
32
|
+
return {
|
|
33
|
+
findings: findings.map((f) => ({
|
|
34
|
+
ruleId: "schema/consistency",
|
|
35
|
+
severity: f.severity,
|
|
36
|
+
message: f.message,
|
|
37
|
+
pageUrl: f.pageUrl,
|
|
38
|
+
relatedUrls: f.relatedUrls,
|
|
39
|
+
fix: f.fix,
|
|
40
|
+
})),
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=check-rule-schema-consistency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-rule-schema-consistency.js","sourceRoot":"","sources":["../../../src/ai/tools/check-rule-schema-consistency.ts"],"names":[],"mappings":"AAAA,OAAO,EA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AG,YAAY,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC/C,OAAO;YACL,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC7B,MAAM,EAAE,oBAA6B;gBACrC,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBACpB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,WAAW,EAAE,CAAC,CAAC,WAAW;gBAC1B,GAAG,EAAE,CAAC,CAAC,GAAG;aACX,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const checkRuleSummaryBaitTool: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: z.ZodType<{
|
|
6
|
+
pageIds: string[];
|
|
7
|
+
openerWordCount?: number | undefined;
|
|
8
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
9
|
+
pageIds: string[];
|
|
10
|
+
openerWordCount?: number | undefined;
|
|
11
|
+
}, unknown>>;
|
|
12
|
+
outputSchema: z.ZodType<{
|
|
13
|
+
findings: {
|
|
14
|
+
ruleId: "aeo/summary-bait";
|
|
15
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
16
|
+
message: string;
|
|
17
|
+
pageUrl?: string | undefined;
|
|
18
|
+
fix?: string | undefined;
|
|
19
|
+
}[];
|
|
20
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
21
|
+
findings: {
|
|
22
|
+
ruleId: "aeo/summary-bait";
|
|
23
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
24
|
+
message: string;
|
|
25
|
+
pageUrl?: string | undefined;
|
|
26
|
+
fix?: string | undefined;
|
|
27
|
+
}[];
|
|
28
|
+
}, unknown>>;
|
|
29
|
+
toAiTool(): import("ai").Tool<{
|
|
30
|
+
pageIds: string[];
|
|
31
|
+
openerWordCount?: number | undefined;
|
|
32
|
+
}, import("./types.js").ToolResult<{
|
|
33
|
+
findings: {
|
|
34
|
+
ruleId: "aeo/summary-bait";
|
|
35
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
36
|
+
message: string;
|
|
37
|
+
pageUrl?: string | undefined;
|
|
38
|
+
fix?: string | undefined;
|
|
39
|
+
}[];
|
|
40
|
+
}>>;
|
|
41
|
+
run(input: {
|
|
42
|
+
pageIds: string[];
|
|
43
|
+
openerWordCount?: number | undefined;
|
|
44
|
+
}, ctx?: import("./types.js").ToolExecuteContext): Promise<import("./types.js").ToolResult<{
|
|
45
|
+
findings: {
|
|
46
|
+
ruleId: "aeo/summary-bait";
|
|
47
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
48
|
+
message: string;
|
|
49
|
+
pageUrl?: string | undefined;
|
|
50
|
+
fix?: string | undefined;
|
|
51
|
+
}[];
|
|
52
|
+
}>>;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=check-rule-summary-bait.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-rule-summary-bait.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/check-rule-summary-bait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBnC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { parseHtmlPage } from "../../parser.js";
|
|
3
|
+
import { summaryBaitRule } from "../../rules/aeo/summary-bait.js";
|
|
4
|
+
import { resolvePages } from "../orchestrator/page-cache.js";
|
|
5
|
+
import { defineTool } from "./types.js";
|
|
6
|
+
const inputSchema = z.object({
|
|
7
|
+
pageIds: z.array(z.string()).min(1).max(50).describe("Page references from fetch_page."),
|
|
8
|
+
openerWordCount: z.number().int().positive().max(500).optional(),
|
|
9
|
+
});
|
|
10
|
+
const outputSchema = z.object({
|
|
11
|
+
findings: z.array(z.object({
|
|
12
|
+
ruleId: z.literal("aeo/summary-bait"),
|
|
13
|
+
severity: z.enum(["info", "warning", "error", "critical"]),
|
|
14
|
+
message: z.string(),
|
|
15
|
+
pageUrl: z.string().optional(),
|
|
16
|
+
fix: z.string().optional(),
|
|
17
|
+
})),
|
|
18
|
+
});
|
|
19
|
+
export const checkRuleSummaryBaitTool = defineTool({
|
|
20
|
+
name: "check_rule_summary_bait",
|
|
21
|
+
description: "Detect 'summary bait' openers — content that withholds the answer to extract a scroll/click instead of resolving the query. AI engines preferentially cite pages that answer in the opener. Pass at least 3 pages so the rule can detect templated bait patterns across a sample.",
|
|
22
|
+
inputSchema,
|
|
23
|
+
outputSchema,
|
|
24
|
+
async execute({ pageIds, openerWordCount }) {
|
|
25
|
+
const entries = resolvePages(pageIds);
|
|
26
|
+
const parsed = entries.map((e) => parseHtmlPage(e.html, e.url));
|
|
27
|
+
const findings = summaryBaitRule(parsed, [], openerWordCount !== undefined ? { openerWordCount } : undefined);
|
|
28
|
+
return {
|
|
29
|
+
findings: findings.map((f) => ({
|
|
30
|
+
ruleId: "aeo/summary-bait",
|
|
31
|
+
severity: f.severity,
|
|
32
|
+
message: f.message,
|
|
33
|
+
pageUrl: f.pageUrl,
|
|
34
|
+
fix: f.fix,
|
|
35
|
+
})),
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=check-rule-summary-bait.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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,EAAE,yBAAyB;IAC/B,WAAW,EACT,mRAAmR;IACrR,WAAW;IACX,YAAY;IACZ,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE;QACxC,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,eAAe,CAC9B,MAAM,EACN,EAAE,EACF,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,SAAS,CAChE,CAAC;QACF,OAAO;YACL,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC7B,MAAM,EAAE,kBAA2B;gBACnC,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBACpB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,GAAG,EAAE,CAAC,CAAC,GAAG;aACX,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const checkRuleThinContentTool: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: z.ZodType<{
|
|
6
|
+
pageId: string;
|
|
7
|
+
minWords?: number | undefined;
|
|
8
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
9
|
+
pageId: string;
|
|
10
|
+
minWords?: number | undefined;
|
|
11
|
+
}, unknown>>;
|
|
12
|
+
outputSchema: z.ZodType<{
|
|
13
|
+
isThin: boolean;
|
|
14
|
+
wordCount: number;
|
|
15
|
+
threshold: number;
|
|
16
|
+
finding: {
|
|
17
|
+
ruleId: "spam/thin-content";
|
|
18
|
+
severity: "error";
|
|
19
|
+
confidence: "high" | "medium" | "low" | "speculative";
|
|
20
|
+
message: string;
|
|
21
|
+
fix?: string | undefined;
|
|
22
|
+
} | null;
|
|
23
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
24
|
+
isThin: boolean;
|
|
25
|
+
wordCount: number;
|
|
26
|
+
threshold: number;
|
|
27
|
+
finding: {
|
|
28
|
+
ruleId: "spam/thin-content";
|
|
29
|
+
severity: "error";
|
|
30
|
+
confidence: "high" | "medium" | "low" | "speculative";
|
|
31
|
+
message: string;
|
|
32
|
+
fix?: string | undefined;
|
|
33
|
+
} | null;
|
|
34
|
+
}, unknown>>;
|
|
35
|
+
toAiTool(): import("ai").Tool<{
|
|
36
|
+
pageId: string;
|
|
37
|
+
minWords?: number | undefined;
|
|
38
|
+
}, import("./types.js").ToolResult<{
|
|
39
|
+
isThin: boolean;
|
|
40
|
+
wordCount: number;
|
|
41
|
+
threshold: number;
|
|
42
|
+
finding: {
|
|
43
|
+
ruleId: "spam/thin-content";
|
|
44
|
+
severity: "error";
|
|
45
|
+
confidence: "high" | "medium" | "low" | "speculative";
|
|
46
|
+
message: string;
|
|
47
|
+
fix?: string | undefined;
|
|
48
|
+
} | null;
|
|
49
|
+
}>>;
|
|
50
|
+
run(input: {
|
|
51
|
+
pageId: string;
|
|
52
|
+
minWords?: number | undefined;
|
|
53
|
+
}, ctx?: import("./types.js").ToolExecuteContext): Promise<import("./types.js").ToolResult<{
|
|
54
|
+
isThin: boolean;
|
|
55
|
+
wordCount: number;
|
|
56
|
+
threshold: number;
|
|
57
|
+
finding: {
|
|
58
|
+
ruleId: "spam/thin-content";
|
|
59
|
+
severity: "error";
|
|
60
|
+
confidence: "high" | "medium" | "low" | "speculative";
|
|
61
|
+
message: string;
|
|
62
|
+
fix?: string | undefined;
|
|
63
|
+
} | null;
|
|
64
|
+
}>>;
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=check-rule-thin-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-rule-thin-content.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/check-rule-thin-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkCxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BnC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { parseHtmlPage } from "../../parser.js";
|
|
3
|
+
import { thinContentRule } from "../../rules/spam/thin-content.js";
|
|
4
|
+
import { resolvePage } from "../orchestrator/page-cache.js";
|
|
5
|
+
import { defineTool } from "./types.js";
|
|
6
|
+
const inputSchema = z.object({
|
|
7
|
+
pageId: z.string().describe("Page reference returned by fetch_page."),
|
|
8
|
+
minWords: z
|
|
9
|
+
.number()
|
|
10
|
+
.int()
|
|
11
|
+
.positive()
|
|
12
|
+
.max(5000)
|
|
13
|
+
.optional()
|
|
14
|
+
.describe("Threshold for thin content. Default 300 (matches v0.4 engine default)."),
|
|
15
|
+
});
|
|
16
|
+
const outputSchema = z.object({
|
|
17
|
+
isThin: z.boolean(),
|
|
18
|
+
wordCount: z.number().int().nonnegative(),
|
|
19
|
+
threshold: z.number().int().positive(),
|
|
20
|
+
finding: z
|
|
21
|
+
.object({
|
|
22
|
+
ruleId: z.literal("spam/thin-content"),
|
|
23
|
+
severity: z.literal("error"),
|
|
24
|
+
confidence: z.enum(["high", "medium", "low", "speculative"]),
|
|
25
|
+
message: z.string(),
|
|
26
|
+
fix: z.string().optional(),
|
|
27
|
+
})
|
|
28
|
+
.nullable(),
|
|
29
|
+
});
|
|
30
|
+
const DEFAULT_MIN_WORDS = 300;
|
|
31
|
+
export const checkRuleThinContentTool = defineTool({
|
|
32
|
+
name: "check_rule_thin_content",
|
|
33
|
+
description: "Check if a single page (referenced by pageId from fetch_page) is thin content (fewer than N words of substantive copy). Returns the word count, threshold, and the finding object if thin. Default threshold 300 words; lower it (e.g. 150) for landing-page-style sites to reduce false positives.",
|
|
34
|
+
inputSchema,
|
|
35
|
+
outputSchema,
|
|
36
|
+
async execute({ pageId, minWords = DEFAULT_MIN_WORDS }) {
|
|
37
|
+
const entry = resolvePage(pageId);
|
|
38
|
+
const parsed = parseHtmlPage(entry.html, entry.url);
|
|
39
|
+
const { findings } = thinContentRule([parsed], minWords);
|
|
40
|
+
const wordCount = parsed.contentText.split(/\s+/).filter(Boolean).length;
|
|
41
|
+
const finding = findings[0];
|
|
42
|
+
return {
|
|
43
|
+
isThin: findings.length > 0,
|
|
44
|
+
wordCount,
|
|
45
|
+
threshold: minWords,
|
|
46
|
+
finding: finding
|
|
47
|
+
? {
|
|
48
|
+
ruleId: "spam/thin-content",
|
|
49
|
+
severity: "error",
|
|
50
|
+
confidence: finding.confidence ?? "high",
|
|
51
|
+
message: finding.message,
|
|
52
|
+
fix: finding.fix,
|
|
53
|
+
}
|
|
54
|
+
: null,
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=check-rule-thin-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-rule-thin-content.js","sourceRoot":"","sources":["../../../src/ai/tools/check-rule-thin-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EA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CAAC,GAAG,CAAC,CAAC;QACpD,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAe,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;QACzD,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;QAEzE,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC5B,OAAO;YACL,MAAM,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC;YAC3B,SAAS;YACT,SAAS,EAAE,QAAQ;YACnB,OAAO,EAAE,OAAO;gBACd,CAAC,CAAC;oBACE,MAAM,EAAE,mBAA4B;oBACpC,QAAQ,EAAE,OAAgB;oBAC1B,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,MAAM;oBACxC,OAAO,EAAE,OAAO,CAAC,OAAO;oBACxB,GAAG,EAAE,OAAO,CAAC,GAAG;iBACjB;gBACH,CAAC,CAAC,IAAI;SACT,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Group URLs into template clusters. Wraps `clusterUrlTemplates` from the
|
|
4
|
+
* site classifier. Lets the orchestrator decide where to focus sampling —
|
|
5
|
+
* high-ratio templates (e.g. 80% of URLs share `/city/:slug`) deserve
|
|
6
|
+
* deeper inspection than long-tail one-offs.
|
|
7
|
+
*/
|
|
8
|
+
export declare const detectTemplatesTool: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
inputSchema: z.ZodType<{
|
|
12
|
+
urls: string[];
|
|
13
|
+
minRatio?: number | undefined;
|
|
14
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
15
|
+
urls: string[];
|
|
16
|
+
minRatio?: number | undefined;
|
|
17
|
+
}, unknown>>;
|
|
18
|
+
outputSchema: z.ZodType<{
|
|
19
|
+
templateCount: number;
|
|
20
|
+
totalUrls: number;
|
|
21
|
+
templates: {
|
|
22
|
+
template: string;
|
|
23
|
+
count: number;
|
|
24
|
+
ratio: number;
|
|
25
|
+
}[];
|
|
26
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
27
|
+
templateCount: number;
|
|
28
|
+
totalUrls: number;
|
|
29
|
+
templates: {
|
|
30
|
+
template: string;
|
|
31
|
+
count: number;
|
|
32
|
+
ratio: number;
|
|
33
|
+
}[];
|
|
34
|
+
}, unknown>>;
|
|
35
|
+
toAiTool(): import("ai").Tool<{
|
|
36
|
+
urls: string[];
|
|
37
|
+
minRatio?: number | undefined;
|
|
38
|
+
}, import("./types.js").ToolResult<{
|
|
39
|
+
templateCount: number;
|
|
40
|
+
totalUrls: number;
|
|
41
|
+
templates: {
|
|
42
|
+
template: string;
|
|
43
|
+
count: number;
|
|
44
|
+
ratio: number;
|
|
45
|
+
}[];
|
|
46
|
+
}>>;
|
|
47
|
+
run(input: {
|
|
48
|
+
urls: string[];
|
|
49
|
+
minRatio?: number | undefined;
|
|
50
|
+
}, ctx?: import("./types.js").ToolExecuteContext): Promise<import("./types.js").ToolResult<{
|
|
51
|
+
templateCount: number;
|
|
52
|
+
totalUrls: number;
|
|
53
|
+
templates: {
|
|
54
|
+
template: string;
|
|
55
|
+
count: number;
|
|
56
|
+
ratio: number;
|
|
57
|
+
}[];
|
|
58
|
+
}>>;
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=detect-templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-templates.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/detect-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe9B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { clusterUrlTemplates } from "../../site-classifier.js";
|
|
3
|
+
import { defineTool } from "./types.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
urls: z.array(z.string()).min(1).describe("URL list, typically from fetch_sitemap."),
|
|
6
|
+
minRatio: z
|
|
7
|
+
.number()
|
|
8
|
+
.min(0)
|
|
9
|
+
.max(1)
|
|
10
|
+
.optional()
|
|
11
|
+
.describe("Drop templates that account for less than this fraction of URLs. Default 0.01 (1%)."),
|
|
12
|
+
});
|
|
13
|
+
const outputSchema = z.object({
|
|
14
|
+
templateCount: z.number().int().nonnegative(),
|
|
15
|
+
totalUrls: z.number().int().nonnegative(),
|
|
16
|
+
templates: z.array(z.object({
|
|
17
|
+
template: z.string().describe("Generalized URL pattern, e.g. '/city/:slug'."),
|
|
18
|
+
count: z.number().int().nonnegative(),
|
|
19
|
+
ratio: z.number().min(0).max(1),
|
|
20
|
+
})),
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Group URLs into template clusters. Wraps `clusterUrlTemplates` from the
|
|
24
|
+
* site classifier. Lets the orchestrator decide where to focus sampling —
|
|
25
|
+
* high-ratio templates (e.g. 80% of URLs share `/city/:slug`) deserve
|
|
26
|
+
* deeper inspection than long-tail one-offs.
|
|
27
|
+
*/
|
|
28
|
+
export const detectTemplatesTool = defineTool({
|
|
29
|
+
name: "detect_templates",
|
|
30
|
+
description: "Group a URL list into template clusters (e.g. 80% of URLs share '/city/:slug', 5% share '/blog/:slug'). Returns templates sorted by descending count with the ratio of URLs each represents. Use this after fetch_sitemap to identify which template patterns dominate the site, then use sample_template to pull representative pages from each.",
|
|
31
|
+
inputSchema,
|
|
32
|
+
outputSchema,
|
|
33
|
+
async execute({ urls, minRatio = 0.01 }) {
|
|
34
|
+
const clustered = clusterUrlTemplates(urls);
|
|
35
|
+
const filtered = clustered.filter((t) => t.ratio >= minRatio);
|
|
36
|
+
return {
|
|
37
|
+
templateCount: filtered.length,
|
|
38
|
+
totalUrls: urls.length,
|
|
39
|
+
templates: filtered,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=detect-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-templates.js","sourceRoot":"","sources":["../../../src/ai/tools/detect-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IACpF,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,qFAAqF,CAAC;CACnG,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACzC,SAAS,EAAE,CAAC,CAAC,KAAK,CAChB,CAAC,CAAC,MAAM,CAAC;QACP,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;QAC7E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;QACrC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KAChC,CAAC,CACH;CACF,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;IAC5C,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,mVAAmV;IACrV,WAAW;IACX,YAAY;IACZ,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE;QACrC,MAAM,SAAS,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC5C,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC;QAC9D,OAAO;YACL,aAAa,EAAE,QAAQ,CAAC,MAAM;YAC9B,SAAS,EAAE,IAAI,CAAC,MAAM;YACtB,SAAS,EAAE,QAAQ;SACpB,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* SSRF-guarded HTTP fetch with optional disk cache. Wraps the existing
|
|
4
|
+
* `cachedFetch` primitive plus `validateTargetHost` so private/reserved IPs
|
|
5
|
+
* are rejected on every redirect hop.
|
|
6
|
+
*
|
|
7
|
+
* Returned as a tool to the orchestrator — typically the first call the
|
|
8
|
+
* model makes when auditing a domain.
|
|
9
|
+
*/
|
|
10
|
+
export declare const fetchPageTool: {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
inputSchema: z.ZodType<{
|
|
14
|
+
url: string;
|
|
15
|
+
timeoutMs?: number | undefined;
|
|
16
|
+
cacheDir?: string | undefined;
|
|
17
|
+
cacheTtlMs?: number | undefined;
|
|
18
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
19
|
+
url: string;
|
|
20
|
+
timeoutMs?: number | undefined;
|
|
21
|
+
cacheDir?: string | undefined;
|
|
22
|
+
cacheTtlMs?: number | undefined;
|
|
23
|
+
}, unknown>>;
|
|
24
|
+
outputSchema: z.ZodType<{
|
|
25
|
+
url: string;
|
|
26
|
+
status: number;
|
|
27
|
+
headers: Record<string, string>;
|
|
28
|
+
pageId: string;
|
|
29
|
+
bodyExcerpt: string;
|
|
30
|
+
fromCache: boolean;
|
|
31
|
+
bodyBytes: number;
|
|
32
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
33
|
+
url: string;
|
|
34
|
+
status: number;
|
|
35
|
+
headers: Record<string, string>;
|
|
36
|
+
pageId: string;
|
|
37
|
+
bodyExcerpt: string;
|
|
38
|
+
fromCache: boolean;
|
|
39
|
+
bodyBytes: number;
|
|
40
|
+
}, unknown>>;
|
|
41
|
+
toAiTool(): import("ai").Tool<{
|
|
42
|
+
url: string;
|
|
43
|
+
timeoutMs?: number | undefined;
|
|
44
|
+
cacheDir?: string | undefined;
|
|
45
|
+
cacheTtlMs?: number | undefined;
|
|
46
|
+
}, import("./types.js").ToolResult<{
|
|
47
|
+
url: string;
|
|
48
|
+
status: number;
|
|
49
|
+
headers: Record<string, string>;
|
|
50
|
+
pageId: string;
|
|
51
|
+
bodyExcerpt: string;
|
|
52
|
+
fromCache: boolean;
|
|
53
|
+
bodyBytes: number;
|
|
54
|
+
}>>;
|
|
55
|
+
run(input: {
|
|
56
|
+
url: string;
|
|
57
|
+
timeoutMs?: number | undefined;
|
|
58
|
+
cacheDir?: string | undefined;
|
|
59
|
+
cacheTtlMs?: number | undefined;
|
|
60
|
+
}, ctx?: import("./types.js").ToolExecuteContext): Promise<import("./types.js").ToolResult<{
|
|
61
|
+
url: string;
|
|
62
|
+
status: number;
|
|
63
|
+
headers: Record<string, string>;
|
|
64
|
+
pageId: string;
|
|
65
|
+
bodyExcerpt: string;
|
|
66
|
+
fromCache: boolean;
|
|
67
|
+
bodyBytes: number;
|
|
68
|
+
}>>;
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=fetch-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-page.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/fetch-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8CxB;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CxB,CAAC"}
|