@pseolint/core 0.4.3 → 0.5.4

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.
Files changed (270) hide show
  1. package/README.md +264 -169
  2. package/dist/ai/manifest/diff.d.ts +78 -0
  3. package/dist/ai/manifest/diff.d.ts.map +1 -0
  4. package/dist/ai/manifest/diff.js +139 -0
  5. package/dist/ai/manifest/diff.js.map +1 -0
  6. package/dist/ai/manifest/index.d.ts +18 -0
  7. package/dist/ai/manifest/index.d.ts.map +1 -0
  8. package/dist/ai/manifest/index.js +15 -0
  9. package/dist/ai/manifest/index.js.map +1 -0
  10. package/dist/ai/manifest/validate-manifest.d.ts +37 -0
  11. package/dist/ai/manifest/validate-manifest.d.ts.map +1 -0
  12. package/dist/ai/manifest/validate-manifest.js +67 -0
  13. package/dist/ai/manifest/validate-manifest.js.map +1 -0
  14. package/dist/ai/manifest/validators/domain-patches.d.ts +15 -0
  15. package/dist/ai/manifest/validators/domain-patches.d.ts.map +1 -0
  16. package/dist/ai/manifest/validators/domain-patches.js +110 -0
  17. package/dist/ai/manifest/validators/domain-patches.js.map +1 -0
  18. package/dist/ai/manifest/validators/index.d.ts +5 -0
  19. package/dist/ai/manifest/validators/index.d.ts.map +1 -0
  20. package/dist/ai/manifest/validators/index.js +4 -0
  21. package/dist/ai/manifest/validators/index.js.map +1 -0
  22. package/dist/ai/manifest/validators/page-changes.d.ts +36 -0
  23. package/dist/ai/manifest/validators/page-changes.d.ts.map +1 -0
  24. package/dist/ai/manifest/validators/page-changes.js +221 -0
  25. package/dist/ai/manifest/validators/page-changes.js.map +1 -0
  26. package/dist/ai/manifest/validators/types.d.ts +17 -0
  27. package/dist/ai/manifest/validators/types.d.ts.map +1 -0
  28. package/dist/ai/manifest/validators/types.js +5 -0
  29. package/dist/ai/manifest/validators/types.js.map +1 -0
  30. package/dist/ai/orchestrate.d.ts +74 -0
  31. package/dist/ai/orchestrate.d.ts.map +1 -0
  32. package/dist/ai/orchestrate.js +54 -0
  33. package/dist/ai/orchestrate.js.map +1 -0
  34. package/dist/ai/orchestrator/budget.d.ts +57 -0
  35. package/dist/ai/orchestrator/budget.d.ts.map +1 -0
  36. package/dist/ai/orchestrator/budget.js +114 -0
  37. package/dist/ai/orchestrator/budget.js.map +1 -0
  38. package/dist/ai/orchestrator/finish-tool.d.ts +568 -0
  39. package/dist/ai/orchestrator/finish-tool.d.ts.map +1 -0
  40. package/dist/ai/orchestrator/finish-tool.js +114 -0
  41. package/dist/ai/orchestrator/finish-tool.js.map +1 -0
  42. package/dist/ai/orchestrator/index.d.ts +25 -0
  43. package/dist/ai/orchestrator/index.d.ts.map +1 -0
  44. package/dist/ai/orchestrator/index.js +21 -0
  45. package/dist/ai/orchestrator/index.js.map +1 -0
  46. package/dist/ai/orchestrator/log.d.ts +24 -0
  47. package/dist/ai/orchestrator/log.d.ts.map +1 -0
  48. package/dist/ai/orchestrator/log.js +48 -0
  49. package/dist/ai/orchestrator/log.js.map +1 -0
  50. package/dist/ai/orchestrator/page-cache.d.ts +64 -0
  51. package/dist/ai/orchestrator/page-cache.d.ts.map +1 -0
  52. package/dist/ai/orchestrator/page-cache.js +127 -0
  53. package/dist/ai/orchestrator/page-cache.js.map +1 -0
  54. package/dist/ai/orchestrator/prompt.d.ts +16 -0
  55. package/dist/ai/orchestrator/prompt.d.ts.map +1 -0
  56. package/dist/ai/orchestrator/prompt.js +52 -0
  57. package/dist/ai/orchestrator/prompt.js.map +1 -0
  58. package/dist/ai/orchestrator/runner.d.ts +65 -0
  59. package/dist/ai/orchestrator/runner.d.ts.map +1 -0
  60. package/dist/ai/orchestrator/runner.js +223 -0
  61. package/dist/ai/orchestrator/runner.js.map +1 -0
  62. package/dist/ai/orchestrator/session.d.ts +44 -0
  63. package/dist/ai/orchestrator/session.d.ts.map +1 -0
  64. package/dist/ai/orchestrator/session.js +64 -0
  65. package/dist/ai/orchestrator/session.js.map +1 -0
  66. package/dist/ai/orchestrator/types.d.ts +99 -0
  67. package/dist/ai/orchestrator/types.d.ts.map +1 -0
  68. package/dist/ai/orchestrator/types.js +8 -0
  69. package/dist/ai/orchestrator/types.js.map +1 -0
  70. package/dist/ai/probes/cache.d.ts +12 -0
  71. package/dist/ai/probes/cache.d.ts.map +1 -0
  72. package/dist/ai/probes/cache.js +46 -0
  73. package/dist/ai/probes/cache.js.map +1 -0
  74. package/dist/ai/tools/ask-ai-engine.d.ts +77 -0
  75. package/dist/ai/tools/ask-ai-engine.d.ts.map +1 -0
  76. package/dist/ai/tools/ask-ai-engine.js +253 -0
  77. package/dist/ai/tools/ask-ai-engine.js.map +1 -0
  78. package/dist/ai/tools/check-domain-crawler-access.d.ts +71 -0
  79. package/dist/ai/tools/check-domain-crawler-access.d.ts.map +1 -0
  80. package/dist/ai/tools/check-domain-crawler-access.js +76 -0
  81. package/dist/ai/tools/check-domain-crawler-access.js.map +1 -0
  82. package/dist/ai/tools/check-domain-llms-txt.d.ts +70 -0
  83. package/dist/ai/tools/check-domain-llms-txt.d.ts.map +1 -0
  84. package/dist/ai/tools/check-domain-llms-txt.js +75 -0
  85. package/dist/ai/tools/check-domain-llms-txt.js.map +1 -0
  86. package/dist/ai/tools/check-indexability.d.ts +58 -0
  87. package/dist/ai/tools/check-indexability.d.ts.map +1 -0
  88. package/dist/ai/tools/check-indexability.js +64 -0
  89. package/dist/ai/tools/check-indexability.js.map +1 -0
  90. package/dist/ai/tools/check-robots.d.ts +68 -0
  91. package/dist/ai/tools/check-robots.d.ts.map +1 -0
  92. package/dist/ai/tools/check-robots.js +90 -0
  93. package/dist/ai/tools/check-robots.js.map +1 -0
  94. package/dist/ai/tools/check-rule-answer-first.d.ts +54 -0
  95. package/dist/ai/tools/check-rule-answer-first.d.ts.map +1 -0
  96. package/dist/ai/tools/check-rule-answer-first.js +50 -0
  97. package/dist/ai/tools/check-rule-answer-first.js.map +1 -0
  98. package/dist/ai/tools/check-rule-canonical-consistency.d.ts +66 -0
  99. package/dist/ai/tools/check-rule-canonical-consistency.d.ts.map +1 -0
  100. package/dist/ai/tools/check-rule-canonical-consistency.js +51 -0
  101. package/dist/ai/tools/check-rule-canonical-consistency.js.map +1 -0
  102. package/dist/ai/tools/check-rule-citable-facts.d.ts +58 -0
  103. package/dist/ai/tools/check-rule-citable-facts.d.ts.map +1 -0
  104. package/dist/ai/tools/check-rule-citable-facts.js +41 -0
  105. package/dist/ai/tools/check-rule-citable-facts.js.map +1 -0
  106. package/dist/ai/tools/check-rule-content-modularity.d.ts +58 -0
  107. package/dist/ai/tools/check-rule-content-modularity.d.ts.map +1 -0
  108. package/dist/ai/tools/check-rule-content-modularity.js +45 -0
  109. package/dist/ai/tools/check-rule-content-modularity.js.map +1 -0
  110. package/dist/ai/tools/check-rule-faq-coverage.d.ts +54 -0
  111. package/dist/ai/tools/check-rule-faq-coverage.d.ts.map +1 -0
  112. package/dist/ai/tools/check-rule-faq-coverage.js +39 -0
  113. package/dist/ai/tools/check-rule-faq-coverage.js.map +1 -0
  114. package/dist/ai/tools/check-rule-freshness-signals.d.ts +54 -0
  115. package/dist/ai/tools/check-rule-freshness-signals.d.ts.map +1 -0
  116. package/dist/ai/tools/check-rule-freshness-signals.js +45 -0
  117. package/dist/ai/tools/check-rule-freshness-signals.js.map +1 -0
  118. package/dist/ai/tools/check-rule-json-ld-valid.d.ts +54 -0
  119. package/dist/ai/tools/check-rule-json-ld-valid.d.ts.map +1 -0
  120. package/dist/ai/tools/check-rule-json-ld-valid.js +44 -0
  121. package/dist/ai/tools/check-rule-json-ld-valid.js.map +1 -0
  122. package/dist/ai/tools/check-rule-missing-author.d.ts +54 -0
  123. package/dist/ai/tools/check-rule-missing-author.d.ts.map +1 -0
  124. package/dist/ai/tools/check-rule-missing-author.js +45 -0
  125. package/dist/ai/tools/check-rule-missing-author.js.map +1 -0
  126. package/dist/ai/tools/check-rule-near-duplicate.d.ts +82 -0
  127. package/dist/ai/tools/check-rule-near-duplicate.d.ts.map +1 -0
  128. package/dist/ai/tools/check-rule-near-duplicate.js +63 -0
  129. package/dist/ai/tools/check-rule-near-duplicate.js.map +1 -0
  130. package/dist/ai/tools/check-rule-required-fields.d.ts +50 -0
  131. package/dist/ai/tools/check-rule-required-fields.d.ts.map +1 -0
  132. package/dist/ai/tools/check-rule-required-fields.js +38 -0
  133. package/dist/ai/tools/check-rule-required-fields.js.map +1 -0
  134. package/dist/ai/tools/check-rule-schema-consistency.d.ts +54 -0
  135. package/dist/ai/tools/check-rule-schema-consistency.d.ts.map +1 -0
  136. package/dist/ai/tools/check-rule-schema-consistency.js +44 -0
  137. package/dist/ai/tools/check-rule-schema-consistency.js.map +1 -0
  138. package/dist/ai/tools/check-rule-summary-bait.d.ts +54 -0
  139. package/dist/ai/tools/check-rule-summary-bait.d.ts.map +1 -0
  140. package/dist/ai/tools/check-rule-summary-bait.js +39 -0
  141. package/dist/ai/tools/check-rule-summary-bait.js.map +1 -0
  142. package/dist/ai/tools/check-rule-thin-content.d.ts +66 -0
  143. package/dist/ai/tools/check-rule-thin-content.d.ts.map +1 -0
  144. package/dist/ai/tools/check-rule-thin-content.js +58 -0
  145. package/dist/ai/tools/check-rule-thin-content.js.map +1 -0
  146. package/dist/ai/tools/detect-templates.d.ts +60 -0
  147. package/dist/ai/tools/detect-templates.d.ts.map +1 -0
  148. package/dist/ai/tools/detect-templates.js +43 -0
  149. package/dist/ai/tools/detect-templates.js.map +1 -0
  150. package/dist/ai/tools/fetch-page.d.ts +70 -0
  151. package/dist/ai/tools/fetch-page.d.ts.map +1 -0
  152. package/dist/ai/tools/fetch-page.js +93 -0
  153. package/dist/ai/tools/fetch-page.js.map +1 -0
  154. package/dist/ai/tools/fetch-sitemap.d.ts +60 -0
  155. package/dist/ai/tools/fetch-sitemap.d.ts.map +1 -0
  156. package/dist/ai/tools/fetch-sitemap.js +116 -0
  157. package/dist/ai/tools/fetch-sitemap.js.map +1 -0
  158. package/dist/ai/tools/index.d.ts +1555 -0
  159. package/dist/ai/tools/index.d.ts.map +1 -0
  160. package/dist/ai/tools/index.js +119 -0
  161. package/dist/ai/tools/index.js.map +1 -0
  162. package/dist/ai/tools/parse-page.d.ts +94 -0
  163. package/dist/ai/tools/parse-page.d.ts.map +1 -0
  164. package/dist/ai/tools/parse-page.js +108 -0
  165. package/dist/ai/tools/parse-page.js.map +1 -0
  166. package/dist/ai/tools/query-serp.d.ts +113 -0
  167. package/dist/ai/tools/query-serp.d.ts.map +1 -0
  168. package/dist/ai/tools/query-serp.js +131 -0
  169. package/dist/ai/tools/query-serp.js.map +1 -0
  170. package/dist/ai/tools/sample-template.d.ts +67 -0
  171. package/dist/ai/tools/sample-template.d.ts.map +1 -0
  172. package/dist/ai/tools/sample-template.js +75 -0
  173. package/dist/ai/tools/sample-template.js.map +1 -0
  174. package/dist/ai/tools/types.d.ts +73 -0
  175. package/dist/ai/tools/types.d.ts.map +1 -0
  176. package/dist/ai/tools/types.js +64 -0
  177. package/dist/ai/tools/types.js.map +1 -0
  178. package/dist/ai/tools/validate-jsonld.d.ts +62 -0
  179. package/dist/ai/tools/validate-jsonld.d.ts.map +1 -0
  180. package/dist/ai/tools/validate-jsonld.js +84 -0
  181. package/dist/ai/tools/validate-jsonld.js.map +1 -0
  182. package/dist/auditor.d.ts +4 -0
  183. package/dist/auditor.d.ts.map +1 -1
  184. package/dist/auditor.js +629 -64
  185. package/dist/auditor.js.map +1 -1
  186. package/dist/backpressure.d.ts.map +1 -1
  187. package/dist/backpressure.js +10 -3
  188. package/dist/backpressure.js.map +1 -1
  189. package/dist/enrich-findings.d.ts.map +1 -1
  190. package/dist/enrich-findings.js +15 -1
  191. package/dist/enrich-findings.js.map +1 -1
  192. package/dist/formatters/console.d.ts.map +1 -1
  193. package/dist/formatters/console.js +13 -0
  194. package/dist/formatters/console.js.map +1 -1
  195. package/dist/formatters/markdown.d.ts.map +1 -1
  196. package/dist/formatters/markdown.js +20 -2
  197. package/dist/formatters/markdown.js.map +1 -1
  198. package/dist/index.d.ts +12 -1
  199. package/dist/index.d.ts.map +1 -1
  200. package/dist/index.js +8 -0
  201. package/dist/index.js.map +1 -1
  202. package/dist/rule-references.d.ts.map +1 -1
  203. package/dist/rule-references.js +5 -0
  204. package/dist/rule-references.js.map +1 -1
  205. package/dist/rules/content/heading-structure.d.ts +21 -0
  206. package/dist/rules/content/heading-structure.d.ts.map +1 -0
  207. package/dist/rules/content/heading-structure.js +56 -0
  208. package/dist/rules/content/heading-structure.js.map +1 -0
  209. package/dist/rules/content/image-alt-text.d.ts +18 -0
  210. package/dist/rules/content/image-alt-text.d.ts.map +1 -0
  211. package/dist/rules/content/image-alt-text.js +77 -0
  212. package/dist/rules/content/image-alt-text.js.map +1 -0
  213. package/dist/rules/content/title-uniqueness.d.ts +18 -0
  214. package/dist/rules/content/title-uniqueness.d.ts.map +1 -0
  215. package/dist/rules/content/title-uniqueness.js +70 -0
  216. package/dist/rules/content/title-uniqueness.js.map +1 -0
  217. package/dist/rules/links/host-section-divergence.d.ts +3 -0
  218. package/dist/rules/links/host-section-divergence.d.ts.map +1 -0
  219. package/dist/rules/links/host-section-divergence.js +158 -0
  220. package/dist/rules/links/host-section-divergence.js.map +1 -0
  221. package/dist/rules/links/link-depth.d.ts +12 -1
  222. package/dist/rules/links/link-depth.d.ts.map +1 -1
  223. package/dist/rules/links/link-depth.js +25 -12
  224. package/dist/rules/links/link-depth.js.map +1 -1
  225. package/dist/rules/scope.d.ts.map +1 -1
  226. package/dist/rules/scope.js +5 -0
  227. package/dist/rules/scope.js.map +1 -1
  228. package/dist/rules/spam/doorway-pattern.d.ts.map +1 -1
  229. package/dist/rules/spam/doorway-pattern.js +27 -4
  230. package/dist/rules/spam/doorway-pattern.js.map +1 -1
  231. package/dist/rules/spam/publication-velocity.d.ts +1 -1
  232. package/dist/rules/spam/publication-velocity.d.ts.map +1 -1
  233. package/dist/rules/spam/publication-velocity.js +9 -4
  234. package/dist/rules/spam/publication-velocity.js.map +1 -1
  235. package/dist/rules/spam/template-coverage.js +1 -1
  236. package/dist/rules/spam/template-coverage.js.map +1 -1
  237. package/dist/rules/spam/template-diversity.js +1 -1
  238. package/dist/rules/spam/template-diversity.js.map +1 -1
  239. package/dist/rules/tech/hreflang-consistency.d.ts.map +1 -1
  240. package/dist/rules/tech/hreflang-consistency.js +33 -4
  241. package/dist/rules/tech/hreflang-consistency.js.map +1 -1
  242. package/dist/rules/tech/og-completeness.d.ts +11 -0
  243. package/dist/rules/tech/og-completeness.d.ts.map +1 -1
  244. package/dist/rules/tech/og-completeness.js +22 -23
  245. package/dist/rules/tech/og-completeness.js.map +1 -1
  246. package/dist/ruleset-version.d.ts +8 -0
  247. package/dist/ruleset-version.d.ts.map +1 -0
  248. package/dist/ruleset-version.js +8 -0
  249. package/dist/ruleset-version.js.map +1 -0
  250. package/dist/scrape-strategy.d.ts +42 -0
  251. package/dist/scrape-strategy.d.ts.map +1 -0
  252. package/dist/scrape-strategy.js +101 -0
  253. package/dist/scrape-strategy.js.map +1 -0
  254. package/dist/site-classifier.d.ts.map +1 -1
  255. package/dist/site-classifier.js +1 -0
  256. package/dist/site-classifier.js.map +1 -1
  257. package/dist/state.d.ts +36 -1
  258. package/dist/state.d.ts.map +1 -1
  259. package/dist/state.js +3 -1
  260. package/dist/state.js.map +1 -1
  261. package/dist/stratified-sample.d.ts +9 -1
  262. package/dist/stratified-sample.d.ts.map +1 -1
  263. package/dist/stratified-sample.js +23 -6
  264. package/dist/stratified-sample.js.map +1 -1
  265. package/dist/types.d.ts +135 -2
  266. package/dist/types.d.ts.map +1 -1
  267. package/dist/url-normalize.d.ts.map +1 -1
  268. package/dist/url-normalize.js +13 -1
  269. package/dist/url-normalize.js.map +1 -1
  270. package/package.json +90 -90
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCpB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,iBAAiB,CAAC"}
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Orchestrator tool registry. Each entry is a `DefinedTool` — call
3
+ * `.toAiTool()` to get an AI-SDK-compatible tool object, or `.run()` for
4
+ * direct unit-test invocation.
5
+ *
6
+ * Phase 1 covers the canonical tool patterns:
7
+ * - HTTP / sitemap I/O (fetch_page, fetch_sitemap)
8
+ * - Page parsing (parse_page)
9
+ * - Template clustering (detect_templates, sample_template)
10
+ * - Per-page rule checks (check_rule_*)
11
+ * - Cluster-aware rule checks (check_rule_near_duplicate, check_rule_schema_consistency)
12
+ * - Multi-page AEO rule checks (check_rule_faq_coverage, _citable_facts, etc.)
13
+ * - Domain-level checks (check_domain_llms_txt, check_domain_crawler_access)
14
+ *
15
+ * Future phases extend this map with the remaining rule wrappers (links/*,
16
+ * tech/redirect-chain, tech/soft-404, etc. — most useful as part of
17
+ * `check_all_rules` once that escape hatch lands), schema/text validators,
18
+ * and external probes (SerpAPI, ask_ai_engine).
19
+ */
20
+ export { defineTool } from "./types.js";
21
+ // I/O + sampling
22
+ export { fetchPageTool } from "./fetch-page.js";
23
+ export { fetchSitemapTool } from "./fetch-sitemap.js";
24
+ export { parsePageTool } from "./parse-page.js";
25
+ export { detectTemplatesTool } from "./detect-templates.js";
26
+ export { sampleTemplateTool } from "./sample-template.js";
27
+ // Single-page rule checks
28
+ export { checkRuleThinContentTool } from "./check-rule-thin-content.js";
29
+ export { checkRuleMissingAuthorTool } from "./check-rule-missing-author.js";
30
+ export { checkRuleCanonicalConsistencyTool } from "./check-rule-canonical-consistency.js";
31
+ export { checkRuleJsonLdValidTool } from "./check-rule-json-ld-valid.js";
32
+ export { checkRuleAnswerFirstTool } from "./check-rule-answer-first.js";
33
+ // Cluster / multi-page rule checks
34
+ export { checkRuleNearDuplicateTool } from "./check-rule-near-duplicate.js";
35
+ export { checkRuleFaqCoverageTool } from "./check-rule-faq-coverage.js";
36
+ export { checkRuleCitableFactsTool } from "./check-rule-citable-facts.js";
37
+ export { checkRuleFreshnessSignalsTool } from "./check-rule-freshness-signals.js";
38
+ export { checkRuleContentModularityTool } from "./check-rule-content-modularity.js";
39
+ export { checkRuleSummaryBaitTool } from "./check-rule-summary-bait.js";
40
+ export { checkRuleRequiredFieldsTool } from "./check-rule-required-fields.js";
41
+ export { checkRuleSchemaConsistencyTool } from "./check-rule-schema-consistency.js";
42
+ // Domain-level checks
43
+ export { checkDomainLlmsTxtTool } from "./check-domain-llms-txt.js";
44
+ export { checkDomainCrawlerAccessTool } from "./check-domain-crawler-access.js";
45
+ // Utility checks
46
+ export { checkRobotsTool } from "./check-robots.js";
47
+ export { checkIndexabilityTool } from "./check-indexability.js";
48
+ export { validateJsonLdTool } from "./validate-jsonld.js";
49
+ // External probes
50
+ export { querySerpTool } from "./query-serp.js";
51
+ export { askAiEngineTool } from "./ask-ai-engine.js";
52
+ import { fetchPageTool } from "./fetch-page.js";
53
+ import { fetchSitemapTool } from "./fetch-sitemap.js";
54
+ import { parsePageTool } from "./parse-page.js";
55
+ import { detectTemplatesTool } from "./detect-templates.js";
56
+ import { sampleTemplateTool } from "./sample-template.js";
57
+ import { checkRuleThinContentTool } from "./check-rule-thin-content.js";
58
+ import { checkRuleMissingAuthorTool } from "./check-rule-missing-author.js";
59
+ import { checkRuleCanonicalConsistencyTool } from "./check-rule-canonical-consistency.js";
60
+ import { checkRuleJsonLdValidTool } from "./check-rule-json-ld-valid.js";
61
+ import { checkRuleAnswerFirstTool } from "./check-rule-answer-first.js";
62
+ import { checkRuleNearDuplicateTool } from "./check-rule-near-duplicate.js";
63
+ import { checkRuleFaqCoverageTool } from "./check-rule-faq-coverage.js";
64
+ import { checkRuleCitableFactsTool } from "./check-rule-citable-facts.js";
65
+ import { checkRuleFreshnessSignalsTool } from "./check-rule-freshness-signals.js";
66
+ import { checkRuleContentModularityTool } from "./check-rule-content-modularity.js";
67
+ import { checkRuleSummaryBaitTool } from "./check-rule-summary-bait.js";
68
+ import { checkRuleRequiredFieldsTool } from "./check-rule-required-fields.js";
69
+ import { checkRuleSchemaConsistencyTool } from "./check-rule-schema-consistency.js";
70
+ import { checkDomainLlmsTxtTool } from "./check-domain-llms-txt.js";
71
+ import { checkDomainCrawlerAccessTool } from "./check-domain-crawler-access.js";
72
+ import { checkRobotsTool } from "./check-robots.js";
73
+ import { checkIndexabilityTool } from "./check-indexability.js";
74
+ import { validateJsonLdTool } from "./validate-jsonld.js";
75
+ import { querySerpTool } from "./query-serp.js";
76
+ import { askAiEngineTool } from "./ask-ai-engine.js";
77
+ /**
78
+ * The full orchestrator tool registry, keyed by tool name.
79
+ *
80
+ * To convert into AI-SDK input shape:
81
+ * const aiTools = Object.fromEntries(
82
+ * Object.entries(orchestratorTools).map(([k, t]) => [k, t.toAiTool()])
83
+ * );
84
+ * streamText({ tools: aiTools, ... });
85
+ */
86
+ export const orchestratorTools = {
87
+ // I/O + sampling
88
+ fetch_page: fetchPageTool,
89
+ fetch_sitemap: fetchSitemapTool,
90
+ parse_page: parsePageTool,
91
+ detect_templates: detectTemplatesTool,
92
+ sample_template: sampleTemplateTool,
93
+ // Per-page rule checks
94
+ check_rule_thin_content: checkRuleThinContentTool,
95
+ check_rule_missing_author: checkRuleMissingAuthorTool,
96
+ check_rule_canonical_consistency: checkRuleCanonicalConsistencyTool,
97
+ check_rule_json_ld_valid: checkRuleJsonLdValidTool,
98
+ check_rule_answer_first: checkRuleAnswerFirstTool,
99
+ // Cluster / multi-page rule checks
100
+ check_rule_near_duplicate: checkRuleNearDuplicateTool,
101
+ check_rule_faq_coverage: checkRuleFaqCoverageTool,
102
+ check_rule_citable_facts: checkRuleCitableFactsTool,
103
+ check_rule_freshness_signals: checkRuleFreshnessSignalsTool,
104
+ check_rule_content_modularity: checkRuleContentModularityTool,
105
+ check_rule_summary_bait: checkRuleSummaryBaitTool,
106
+ check_rule_required_fields: checkRuleRequiredFieldsTool,
107
+ check_rule_schema_consistency: checkRuleSchemaConsistencyTool,
108
+ // Domain-level checks
109
+ check_domain_llms_txt: checkDomainLlmsTxtTool,
110
+ check_domain_crawler_access: checkDomainCrawlerAccessTool,
111
+ // Utility checks
112
+ check_robots: checkRobotsTool,
113
+ check_indexability: checkIndexabilityTool,
114
+ validate_jsonld: validateJsonLdTool,
115
+ // External probes
116
+ query_serp: querySerpTool,
117
+ ask_ai_engine: askAiEngineTool,
118
+ };
119
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ai/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA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C,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,iBAAiB;IACjB,UAAU,EAAE,aAAa;IACzB,aAAa,EAAE,gBAAgB;IAC/B,UAAU,EAAE,aAAa;IACzB,gBAAgB,EAAE,mBAAmB;IACrC,eAAe,EAAE,kBAAkB;IAEnC,uBAAuB;IACvB,uBAAuB,EAAE,wBAAwB;IACjD,yBAAyB,EAAE,0BAA0B;IACrD,gCAAgC,EAAE,iCAAiC;IACnE,wBAAwB,EAAE,wBAAwB;IAClD,uBAAuB,EAAE,wBAAwB;IAEjD,mCAAmC;IACnC,yBAAyB,EAAE,0BAA0B;IACrD,uBAAuB,EAAE,wBAAwB;IACjD,wBAAwB,EAAE,yBAAyB;IACnD,4BAA4B,EAAE,6BAA6B;IAC3D,6BAA6B,EAAE,8BAA8B;IAC7D,uBAAuB,EAAE,wBAAwB;IACjD,0BAA0B,EAAE,2BAA2B;IACvD,6BAA6B,EAAE,8BAA8B;IAE7D,sBAAsB;IACtB,qBAAqB,EAAE,sBAAsB;IAC7C,2BAA2B,EAAE,4BAA4B;IAEzD,iBAAiB;IACjB,YAAY,EAAE,eAAe;IAC7B,kBAAkB,EAAE,qBAAqB;IACzC,eAAe,EAAE,kBAAkB;IAEnC,kBAAkB;IAClB,UAAU,EAAE,aAAa;IACzB,aAAa,EAAE,eAAe;CACtB,CAAC"}
@@ -0,0 +1,94 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Parse a previously-fetched page into the LLM-facing projection. Resolves
4
+ * the `pageId` against the session-scoped page cache (populated by
5
+ * fetch_page); the HTML itself never travels through the LLM conversation.
6
+ *
7
+ * For deeper analysis (text uniqueness, schema validation), use the
8
+ * dedicated tools: validate_jsonld, compute_text_metrics.
9
+ */
10
+ export declare const parsePageTool: {
11
+ name: string;
12
+ description: string;
13
+ inputSchema: z.ZodType<{
14
+ pageId: string;
15
+ }, unknown, z.core.$ZodTypeInternals<{
16
+ pageId: string;
17
+ }, unknown>>;
18
+ outputSchema: z.ZodType<{
19
+ url: string;
20
+ title: string;
21
+ metaDescription: string;
22
+ canonical: string;
23
+ robotsMeta: string;
24
+ headings: {
25
+ h1: string[];
26
+ h2: string[];
27
+ };
28
+ contentWordCount: number;
29
+ jsonLdBlockCount: number;
30
+ jsonLdTypes: string[];
31
+ outboundLinkCount: number;
32
+ internalLinkCount: number;
33
+ hasAuthorSignal: boolean;
34
+ hasFaqBlock: boolean;
35
+ }, unknown, z.core.$ZodTypeInternals<{
36
+ url: string;
37
+ title: string;
38
+ metaDescription: string;
39
+ canonical: string;
40
+ robotsMeta: string;
41
+ headings: {
42
+ h1: string[];
43
+ h2: string[];
44
+ };
45
+ contentWordCount: number;
46
+ jsonLdBlockCount: number;
47
+ jsonLdTypes: string[];
48
+ outboundLinkCount: number;
49
+ internalLinkCount: number;
50
+ hasAuthorSignal: boolean;
51
+ hasFaqBlock: boolean;
52
+ }, unknown>>;
53
+ toAiTool(): import("ai").Tool<{
54
+ pageId: string;
55
+ }, import("./types.js").ToolResult<{
56
+ url: string;
57
+ title: string;
58
+ metaDescription: string;
59
+ canonical: string;
60
+ robotsMeta: string;
61
+ headings: {
62
+ h1: string[];
63
+ h2: string[];
64
+ };
65
+ contentWordCount: number;
66
+ jsonLdBlockCount: number;
67
+ jsonLdTypes: string[];
68
+ outboundLinkCount: number;
69
+ internalLinkCount: number;
70
+ hasAuthorSignal: boolean;
71
+ hasFaqBlock: boolean;
72
+ }>>;
73
+ run(input: {
74
+ pageId: string;
75
+ }, ctx?: import("./types.js").ToolExecuteContext): Promise<import("./types.js").ToolResult<{
76
+ url: string;
77
+ title: string;
78
+ metaDescription: string;
79
+ canonical: string;
80
+ robotsMeta: string;
81
+ headings: {
82
+ h1: string[];
83
+ h2: string[];
84
+ };
85
+ contentWordCount: number;
86
+ jsonLdBlockCount: number;
87
+ jsonLdTypes: string[];
88
+ outboundLinkCount: number;
89
+ internalLinkCount: number;
90
+ hasAuthorSignal: boolean;
91
+ hasFaqBlock: boolean;
92
+ }>>;
93
+ };
94
+ //# sourceMappingURL=parse-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-page.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/parse-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+CxB;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDxB,CAAC"}
@@ -0,0 +1,108 @@
1
+ import { z } from "zod";
2
+ import { parseHtmlPage } from "../../parser.js";
3
+ import { resolvePage } from "../orchestrator/page-cache.js";
4
+ import { defineTool } from "./types.js";
5
+ const inputSchema = z.object({
6
+ pageId: z.string().describe("Page reference returned by fetch_page."),
7
+ });
8
+ /**
9
+ * Trimmed projection of `ParsedPage`. The full parser shape is broader than
10
+ * what the LLM benefits from seeing on every parse — we surface the fields
11
+ * that drive AEO / schema / content rules and let dedicated tools dig deeper
12
+ * when the model asks (validate_jsonld, compute_text_metrics).
13
+ */
14
+ const outputSchema = z.object({
15
+ url: z.string(),
16
+ title: z.string(),
17
+ metaDescription: z.string(),
18
+ canonical: z.string(),
19
+ robotsMeta: z.string(),
20
+ headings: z.object({
21
+ h1: z.array(z.string()),
22
+ h2: z.array(z.string()),
23
+ }),
24
+ contentWordCount: z.number().int().nonnegative(),
25
+ jsonLdBlockCount: z.number().int().nonnegative(),
26
+ jsonLdTypes: z.array(z.string()),
27
+ outboundLinkCount: z.number().int().nonnegative(),
28
+ internalLinkCount: z.number().int().nonnegative(),
29
+ hasAuthorSignal: z.boolean(),
30
+ hasFaqBlock: z.boolean(),
31
+ });
32
+ function countWords(text) {
33
+ return text.split(/\s+/).filter(Boolean).length;
34
+ }
35
+ /** Pull `@type` from a JSON-LD block — handles string, array, and missing cases. */
36
+ function jsonLdTypesOf(block) {
37
+ if (typeof block !== "object" || block === null)
38
+ return [];
39
+ const t = block["@type"];
40
+ if (typeof t === "string")
41
+ return [t];
42
+ if (Array.isArray(t))
43
+ return t.filter((x) => typeof x === "string");
44
+ return [];
45
+ }
46
+ /**
47
+ * Parse a previously-fetched page into the LLM-facing projection. Resolves
48
+ * the `pageId` against the session-scoped page cache (populated by
49
+ * fetch_page); the HTML itself never travels through the LLM conversation.
50
+ *
51
+ * For deeper analysis (text uniqueness, schema validation), use the
52
+ * dedicated tools: validate_jsonld, compute_text_metrics.
53
+ */
54
+ export const parsePageTool = defineTool({
55
+ name: "parse_page",
56
+ description: "Parse a previously-fetched page (referenced by pageId) into structured fields: title, meta, canonical, headings, word count, JSON-LD types, link counts, author + FAQ presence. Call after fetch_page. For Schema.org compliance use validate_jsonld; for cross-sibling text uniqueness use compute_text_metrics.",
57
+ inputSchema,
58
+ outputSchema,
59
+ async execute({ pageId }) {
60
+ const entry = resolvePage(pageId);
61
+ const parsed = parseHtmlPage(entry.html, entry.url);
62
+ let internalHost = "";
63
+ try {
64
+ internalHost = new URL(entry.url).hostname;
65
+ }
66
+ catch {
67
+ // Non-URL `url` (e.g. file path) — every link counts as internal.
68
+ }
69
+ let internal = 0;
70
+ let external = 0;
71
+ for (const href of parsed.resolvedHrefs) {
72
+ try {
73
+ const host = new URL(href).hostname;
74
+ if (internalHost === "" || host === internalHost)
75
+ internal++;
76
+ else
77
+ external++;
78
+ }
79
+ catch {
80
+ // Already-resolved relative path — treat as internal.
81
+ internal++;
82
+ }
83
+ }
84
+ const allTypes = parsed.jsonLd.flatMap(jsonLdTypesOf);
85
+ const uniqueTypes = Array.from(new Set(allTypes));
86
+ const sig = parsed.authorSignals;
87
+ const hasAuthorSignal = sig.metaAuthor !== "" || sig.schemaAuthor || sig.bylineElement || sig.relAuthorLink;
88
+ return {
89
+ url: parsed.url,
90
+ title: parsed.title,
91
+ metaDescription: parsed.metaDescription,
92
+ canonical: parsed.canonical,
93
+ robotsMeta: parsed.robotsMeta,
94
+ headings: {
95
+ h1: parsed.headings.h1,
96
+ h2: parsed.headings.h2,
97
+ },
98
+ contentWordCount: countWords(parsed.contentText),
99
+ jsonLdBlockCount: parsed.jsonLd.length,
100
+ jsonLdTypes: uniqueTypes,
101
+ outboundLinkCount: external,
102
+ internalLinkCount: internal,
103
+ hasAuthorSignal,
104
+ hasFaqBlock: uniqueTypes.includes("FAQPage"),
105
+ };
106
+ },
107
+ });
108
+ //# sourceMappingURL=parse-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-page.js","sourceRoot":"","sources":["../../../src/ai/tools/parse-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,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,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;CACtE,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAA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AG,MAAM,CAAC,aAAa,CAAC;QACjC,MAAM,eAAe,GACnB,GAAG,CAAC,UAAU,KAAK,EAAE,IAAI,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,aAAa,CAAC;QAEtF,OAAO;YACL,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,QAAQ,EAAE;gBACR,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE;gBACtB,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE;aACvB;YACD,gBAAgB,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC;YAChD,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM;YACtC,WAAW,EAAE,WAAW;YACxB,iBAAiB,EAAE,QAAQ;YAC3B,iBAAiB,EAAE,QAAQ;YAC3B,eAAe;YACf,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC;SAC7C,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,113 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Google SERP query via SerpAPI. Caches responses by `keyword + locale +
4
+ * language + num` for 24h via `cachedFetch`. The orchestrator typically
5
+ * calls this when proposing AEO improvements — knowing what currently
6
+ * ranks for a target query informs whether the page being audited has a
7
+ * realistic shot at displacing the incumbents.
8
+ *
9
+ * SerpAPI key resolution order: explicit `apiKey` arg → `SERPAPI_API_KEY`
10
+ * env var. Tool returns an error result when no key is available — the
11
+ * orchestrator should skip this probe rather than retry.
12
+ */
13
+ export declare const querySerpTool: {
14
+ name: string;
15
+ description: string;
16
+ inputSchema: z.ZodType<{
17
+ keyword: string;
18
+ locale?: string | undefined;
19
+ language?: string | undefined;
20
+ num?: number | undefined;
21
+ apiKey?: string | undefined;
22
+ cacheDir?: string | undefined;
23
+ }, unknown, z.core.$ZodTypeInternals<{
24
+ keyword: string;
25
+ locale?: string | undefined;
26
+ language?: string | undefined;
27
+ num?: number | undefined;
28
+ apiKey?: string | undefined;
29
+ cacheDir?: string | undefined;
30
+ }, unknown>>;
31
+ outputSchema: z.ZodType<{
32
+ keyword: string;
33
+ locale: string;
34
+ language: string;
35
+ resultCount: number;
36
+ organicResults: {
37
+ position: number;
38
+ title: string;
39
+ url: string;
40
+ snippet: string | null;
41
+ source: string | null;
42
+ }[];
43
+ hasAnswerBox: boolean;
44
+ hasKnowledgeGraph: boolean;
45
+ fromCache: boolean;
46
+ apiCostUsd: number;
47
+ }, unknown, z.core.$ZodTypeInternals<{
48
+ keyword: string;
49
+ locale: string;
50
+ language: string;
51
+ resultCount: number;
52
+ organicResults: {
53
+ position: number;
54
+ title: string;
55
+ url: string;
56
+ snippet: string | null;
57
+ source: string | null;
58
+ }[];
59
+ hasAnswerBox: boolean;
60
+ hasKnowledgeGraph: boolean;
61
+ fromCache: boolean;
62
+ apiCostUsd: number;
63
+ }, unknown>>;
64
+ toAiTool(): import("ai").Tool<{
65
+ keyword: string;
66
+ locale?: string | undefined;
67
+ language?: string | undefined;
68
+ num?: number | undefined;
69
+ apiKey?: string | undefined;
70
+ cacheDir?: string | undefined;
71
+ }, import("./types.js").ToolResult<{
72
+ keyword: string;
73
+ locale: string;
74
+ language: string;
75
+ resultCount: number;
76
+ organicResults: {
77
+ position: number;
78
+ title: string;
79
+ url: string;
80
+ snippet: string | null;
81
+ source: string | null;
82
+ }[];
83
+ hasAnswerBox: boolean;
84
+ hasKnowledgeGraph: boolean;
85
+ fromCache: boolean;
86
+ apiCostUsd: number;
87
+ }>>;
88
+ run(input: {
89
+ keyword: string;
90
+ locale?: string | undefined;
91
+ language?: string | undefined;
92
+ num?: number | undefined;
93
+ apiKey?: string | undefined;
94
+ cacheDir?: string | undefined;
95
+ }, ctx?: import("./types.js").ToolExecuteContext): Promise<import("./types.js").ToolResult<{
96
+ keyword: string;
97
+ locale: string;
98
+ language: string;
99
+ resultCount: number;
100
+ organicResults: {
101
+ position: number;
102
+ title: string;
103
+ url: string;
104
+ snippet: string | null;
105
+ source: string | null;
106
+ }[];
107
+ hasAnswerBox: boolean;
108
+ hasKnowledgeGraph: boolean;
109
+ fromCache: boolean;
110
+ apiCostUsd: number;
111
+ }>>;
112
+ };
113
+ //# sourceMappingURL=query-serp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-serp.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/query-serp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;sBAuDV,MAAM;mBACT,MAAM;iBACR,MAAM;qBACF,MAAM,GAAG,IAAI;oBACd,MAAM,GAAG,IAAI;;;;;;;;;;;;sBAJX,MAAM;mBACT,MAAM;iBACR,MAAM;qBACF,MAAM,GAAG,IAAI;oBACd,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;sBAJX,MAAM;mBACT,MAAM;iBACR,MAAM;qBACF,MAAM,GAAG,IAAI;oBACd,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;sBAJX,MAAM;mBACT,MAAM;iBACR,MAAM;qBACF,MAAM,GAAG,IAAI;oBACd,MAAM,GAAG,IAAI;;;;;;;CAqBzB,CAAC"}
@@ -0,0 +1,131 @@
1
+ import { z } from "zod";
2
+ import { cachedFetch } from "../../cache.js";
3
+ import { validateTargetHost } from "../../ssrf-guard.js";
4
+ import { defineTool } from "./types.js";
5
+ const inputSchema = z.object({
6
+ keyword: z.string().min(1).max(200),
7
+ locale: z
8
+ .string()
9
+ .length(2)
10
+ .toLowerCase()
11
+ .optional()
12
+ .describe("ISO 3166-1 alpha-2 country code (e.g. 'us', 'de'). Default 'us'."),
13
+ language: z
14
+ .string()
15
+ .length(2)
16
+ .toLowerCase()
17
+ .optional()
18
+ .describe("ISO 639-1 language code (e.g. 'en', 'es'). Default 'en'."),
19
+ num: z.number().int().min(1).max(20).optional().describe("Number of organic results to return. Default 10."),
20
+ apiKey: z
21
+ .string()
22
+ .min(8)
23
+ .optional()
24
+ .describe("SerpAPI key. Falls back to SERPAPI_API_KEY env var."),
25
+ cacheDir: z.string().optional(),
26
+ });
27
+ const organicResultSchema = z.object({
28
+ position: z.number().int().nonnegative(),
29
+ title: z.string(),
30
+ url: z.string(),
31
+ snippet: z.string().nullable(),
32
+ source: z.string().nullable(),
33
+ });
34
+ const outputSchema = z.object({
35
+ keyword: z.string(),
36
+ locale: z.string(),
37
+ language: z.string(),
38
+ resultCount: z.number().int().nonnegative(),
39
+ organicResults: z.array(organicResultSchema),
40
+ hasAnswerBox: z.boolean(),
41
+ hasKnowledgeGraph: z.boolean(),
42
+ fromCache: z.boolean(),
43
+ /**
44
+ * Approximate cost of this call, in USD. The orchestrator's BudgetTracker
45
+ * sums these into the session-level USD cap. Cache hits report 0.
46
+ */
47
+ apiCostUsd: z.number().nonnegative(),
48
+ });
49
+ const COST_PER_QUERY_USD = 0.005;
50
+ const SERPAPI_BASE = "https://serpapi.com/search.json";
51
+ const DEFAULT_TTL_MS = 24 * 60 * 60 * 1000;
52
+ /**
53
+ * Google SERP query via SerpAPI. Caches responses by `keyword + locale +
54
+ * language + num` for 24h via `cachedFetch`. The orchestrator typically
55
+ * calls this when proposing AEO improvements — knowing what currently
56
+ * ranks for a target query informs whether the page being audited has a
57
+ * realistic shot at displacing the incumbents.
58
+ *
59
+ * SerpAPI key resolution order: explicit `apiKey` arg → `SERPAPI_API_KEY`
60
+ * env var. Tool returns an error result when no key is available — the
61
+ * orchestrator should skip this probe rather than retry.
62
+ */
63
+ export const querySerpTool = defineTool({
64
+ name: "query_serp",
65
+ description: "Query Google SERP (via SerpAPI) for a keyword. Returns organic results (position, title, URL, snippet) plus flags for answer-box and knowledge-graph presence. Use this when proposing AEO improvements — knowing what currently ranks informs realistic positioning. Caches responses for 24h. Costs ~$0.005 per call.",
66
+ inputSchema,
67
+ outputSchema,
68
+ async execute({ keyword, locale = "us", language = "en", num = 10, apiKey, cacheDir }, ctx) {
69
+ const key = apiKey ?? process.env.SERPAPI_API_KEY;
70
+ if (!key) {
71
+ throw new Error("query_serp: no SerpAPI key (pass apiKey or set SERPAPI_API_KEY)");
72
+ }
73
+ const params = new URLSearchParams({
74
+ engine: "google",
75
+ q: keyword,
76
+ gl: locale,
77
+ hl: language,
78
+ num: String(num),
79
+ api_key: key,
80
+ });
81
+ const url = `${SERPAPI_BASE}?${params.toString()}`;
82
+ const validateHop = async (hopUrl) => {
83
+ let host;
84
+ try {
85
+ host = new URL(hopUrl).hostname;
86
+ }
87
+ catch {
88
+ throw new Error(`query_serp: invalid URL ${hopUrl}`);
89
+ }
90
+ await validateTargetHost(host);
91
+ };
92
+ const result = await cachedFetch(url, {
93
+ timeoutMs: 15_000,
94
+ cache: cacheDir ? { dir: cacheDir, ttlMs: DEFAULT_TTL_MS } : null,
95
+ validateHop,
96
+ signal: ctx?.signal,
97
+ });
98
+ if (result.status >= 400) {
99
+ throw new Error(`query_serp: SerpAPI returned ${result.status}`);
100
+ }
101
+ let payload;
102
+ try {
103
+ payload = JSON.parse(result.body);
104
+ }
105
+ catch {
106
+ throw new Error("query_serp: SerpAPI response was not valid JSON");
107
+ }
108
+ if (payload.error) {
109
+ throw new Error(`query_serp: ${payload.error}`);
110
+ }
111
+ const organicResults = (payload.organic_results ?? []).map((r) => ({
112
+ position: r.position ?? 0,
113
+ title: r.title ?? "",
114
+ url: r.link ?? "",
115
+ snippet: r.snippet ?? null,
116
+ source: r.source ?? null,
117
+ }));
118
+ return {
119
+ keyword,
120
+ locale,
121
+ language,
122
+ resultCount: organicResults.length,
123
+ organicResults,
124
+ hasAnswerBox: payload.answer_box !== undefined,
125
+ hasKnowledgeGraph: payload.knowledge_graph !== undefined,
126
+ fromCache: result.fromCache,
127
+ apiCostUsd: result.fromCache ? 0 : COST_PER_QUERY_USD,
128
+ };
129
+ },
130
+ });
131
+ //# sourceMappingURL=query-serp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-serp.js","sourceRoot":"","sources":["../../../src/ai/tools/query-serp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACnC,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,MAAM,CAAC,CAAC,CAAC;SACT,WAAW,EAAE;SACb,QAAQ,EAAE;SACV,QAAQ,CAAC,kEAAkE,CAAC;IAC/E,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,MAAM,CAAC,CAAC,CAAC;SACT,WAAW,EAAE;SACb,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IACvE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;IAC5G,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,qDAAqD,CAAC;IAClE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAEH,MA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