semrush-cli 0.1.1 → 0.2.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-CJuwKbEZ.js","names":["packageInfo.version","catalog","filters: Query","params: Query","properties: Schema.Json[]"],"sources":["../package.json","../src/report-catalog.json","../src/report-parameters.ts","../src/errors.ts"],"sourcesContent":["{\n \"name\": \"semrush-cli\",\n \"version\": \"0.2.0\",\n \"description\": \"Semrush research from your terminal and MCP clients. TypeScript, Effect, and Galleton.\",\n \"type\": \"module\",\n \"bin\": {\n \"semrush-cli\": \"dist/cli.js\"\n },\n \"files\": [\n \"dist\",\n \"src/vendor/GALLETON-LICENSE\",\n \"README.md\",\n \"LICENSE\",\n \"assets\",\n \"docs/architecture.md\",\n \"src/vendor/README.md\",\n \"THIRD-PARTY-NOTICES.md\"\n ],\n \"engines\": {\n \"node\": \">=22\"\n },\n \"scripts\": {\n \"build\": \"tsdown && node scripts/build-daemon.mjs\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run\",\n \"lint\": \"oxlint src tests --deny-warnings\",\n \"check\": \"npm run typecheck && npm run lint && npm run build && npm test\",\n \"prepublishOnly\": \"npm run check\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/Microck/semrush-cli.git\"\n },\n \"homepage\": \"https://semrush.micr.dev\",\n \"bugs\": {\n \"url\": \"https://github.com/Microck/semrush-cli/issues\"\n },\n \"license\": \"MIT\",\n \"author\": \"Microck <contact@micr.dev>\",\n \"dependencies\": {\n \"@modelcontextprotocol/sdk\": \"1.32.1\",\n \"ajv\": \"^8.17.1\",\n \"commander\": \"^14.0.0\",\n \"effect\": \"4.0.4\",\n \"json-bigint\": \"^1.0.0\",\n \"patchright\": \"1.64.0\"\n },\n \"devDependencies\": {\n \"@oxlint/plugins\": \"^1.88.0\",\n \"@types/json-bigint\": \"^1.0.4\",\n \"@types/node\": \"^24.0.0\",\n \"oxlint\": \"^1.88.0\",\n \"tsdown\": \"^0.16.0\",\n \"typescript\": \"^5.9.3\",\n \"vitest\": \"^4.0.0\"\n }\n}\n","{\n \"account_status\": {\n \"method\": \"user.GetInfo\",\n \"description\": \"Signed-in account and report limits.\",\n \"transport\": \"keyword\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {},\n \"title\": \"EmptyQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_overview\": {\n \"method\": \"keywords.GetInfo\",\n \"description\": \"Volume, difficulty, CPC, intent and trends.\",\n \"transport\": \"keyword\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"keyword\": {\n \"maxLength\": 200,\n \"minLength\": 1,\n \"title\": \"Keyword\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"keyword\"\n ],\n \"title\": \"KeywordQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_ideas\": {\n \"method\": \"ideas.GetKeywords\",\n \"description\": \"Overview sample of related keywords or questions.\",\n \"transport\": \"keyword\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"keyword\": {\n \"maxLength\": 200,\n \"minLength\": 1,\n \"title\": \"Keyword\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"questions_only\": {\n \"default\": false,\n \"title\": \"Questions Only\",\n \"type\": \"boolean\"\n },\n \"limit\": {\n \"default\": 10,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Limit\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"keyword\"\n ],\n \"title\": \"IdeasQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_ideas_summary\": {\n \"method\": \"ideas.GetKeywordsSummary\",\n \"description\": \"Total related keyword count and volume.\",\n \"transport\": \"keyword\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"keyword\": {\n \"maxLength\": 200,\n \"minLength\": 1,\n \"title\": \"Keyword\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"questions_only\": {\n \"default\": false,\n \"title\": \"Questions Only\",\n \"type\": \"boolean\"\n }\n },\n \"required\": [\n \"keyword\"\n ],\n \"title\": \"IdeasSummaryQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_serp\": {\n \"method\": \"serp.GetURLs\",\n \"description\": \"Ranked URLs and SERP features.\",\n \"transport\": \"keyword\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"keyword\": {\n \"maxLength\": 200,\n \"minLength\": 1,\n \"title\": \"Keyword\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"limit\": {\n \"default\": 10,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Limit\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"keyword\"\n ],\n \"title\": \"KeywordListQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_ads\": {\n \"method\": \"adwords.GetCopies\",\n \"description\": \"Search ad copies for a keyword.\",\n \"transport\": \"keyword\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"keyword\": {\n \"maxLength\": 200,\n \"minLength\": 1,\n \"title\": \"Keyword\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"limit\": {\n \"default\": 10,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Limit\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"keyword\"\n ],\n \"title\": \"KeywordListQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_clusters\": {\n \"method\": \"clusters.Get\",\n \"description\": \"Keyword topics and search intents.\",\n \"transport\": \"keyword\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"keyword\": {\n \"maxLength\": 200,\n \"minLength\": 1,\n \"title\": \"Keyword\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"keyword\"\n ],\n \"title\": \"KeywordQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_magic\": {\n \"method\": \"ideas.GetKeywords\",\n \"description\": \"Paginated Keyword Magic research with filters and sorting.\",\n \"transport\": \"magic\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"keyword\": {\n \"maxLength\": 200,\n \"minLength\": 1,\n \"title\": \"Keyword\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"questions_only\": {\n \"default\": false,\n \"title\": \"Questions Only\",\n \"type\": \"boolean\"\n },\n \"mode\": {\n \"default\": 4,\n \"description\": \"Web Keyword Magic matching mode\",\n \"maximum\": 4,\n \"minimum\": 0,\n \"title\": \"Mode\",\n \"type\": \"integer\"\n },\n \"currency\": {\n \"default\": \"USD\",\n \"pattern\": \"^[A-Z]{3}$\",\n \"title\": \"Currency\",\n \"type\": \"string\"\n },\n \"sort_field\": {\n \"default\": \"similarity_score\",\n \"pattern\": \"^[a-z_]+$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n },\n \"filters\": {\n \"additionalProperties\": true,\n \"description\": \"Keyword Magic web filter object\",\n \"title\": \"Filters\",\n \"type\": \"object\"\n },\n \"groups\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"title\": \"Groups\",\n \"type\": \"array\"\n },\n \"page\": {\n \"default\": 1,\n \"minimum\": 1,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"page_size\": {\n \"default\": 100,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Page Size\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"keyword\"\n ],\n \"title\": \"MagicQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_magic_summary\": {\n \"method\": \"ideas.GetKeywordsSummary\",\n \"description\": \"Keyword Magic totals for matching filters.\",\n \"transport\": \"magic\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"keyword\": {\n \"maxLength\": 200,\n \"minLength\": 1,\n \"title\": \"Keyword\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"questions_only\": {\n \"default\": false,\n \"title\": \"Questions Only\",\n \"type\": \"boolean\"\n },\n \"mode\": {\n \"default\": 4,\n \"description\": \"Web Keyword Magic matching mode\",\n \"maximum\": 4,\n \"minimum\": 0,\n \"title\": \"Mode\",\n \"type\": \"integer\"\n },\n \"currency\": {\n \"default\": \"USD\",\n \"pattern\": \"^[A-Z]{3}$\",\n \"title\": \"Currency\",\n \"type\": \"string\"\n },\n \"sort_field\": {\n \"default\": \"similarity_score\",\n \"pattern\": \"^[a-z_]+$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n },\n \"filters\": {\n \"additionalProperties\": true,\n \"description\": \"Keyword Magic web filter object\",\n \"title\": \"Filters\",\n \"type\": \"object\"\n },\n \"groups\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"title\": \"Groups\",\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"keyword\"\n ],\n \"title\": \"MagicSummaryQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_magic_groups\": {\n \"method\": \"ideas.GetGroups\",\n \"description\": \"Keyword Magic topic groups.\",\n \"transport\": \"magic\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"keyword\": {\n \"maxLength\": 200,\n \"minLength\": 1,\n \"title\": \"Keyword\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"questions_only\": {\n \"default\": false,\n \"title\": \"Questions Only\",\n \"type\": \"boolean\"\n },\n \"mode\": {\n \"default\": 4,\n \"description\": \"Web Keyword Magic matching mode\",\n \"maximum\": 4,\n \"minimum\": 0,\n \"title\": \"Mode\",\n \"type\": \"integer\"\n },\n \"currency\": {\n \"default\": \"USD\",\n \"pattern\": \"^[A-Z]{3}$\",\n \"title\": \"Currency\",\n \"type\": \"string\"\n },\n \"sort_field\": {\n \"default\": \"similarity_score\",\n \"pattern\": \"^[a-z_]+$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n },\n \"filters\": {\n \"additionalProperties\": true,\n \"description\": \"Keyword Magic web filter object\",\n \"title\": \"Filters\",\n \"type\": \"object\"\n },\n \"groups\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"title\": \"Groups\",\n \"type\": \"array\"\n },\n \"page\": {\n \"default\": 1,\n \"minimum\": 1,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"page_size\": {\n \"default\": 100,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Page Size\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"keyword\"\n ],\n \"title\": \"MagicQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_overview\": {\n \"method\": \"organic.Summary\",\n \"description\": \"Search metrics and backlink summary.\",\n \"transport\": \"domain\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_keywords\": {\n \"method\": \"organic.Positions\",\n \"description\": \"Paginated organic rankings with filters, sorting and totals.\",\n \"transport\": \"domain\",\n \"total_method\": \"organic.PositionsTotal\",\n \"web_report\": \"organic.positions\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"date\": {\n \"anyOf\": [\n {\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null,\n \"description\": \"Unix snapshot timestamp from snapshot_dates; omit for latest\",\n \"title\": \"Date\"\n },\n \"search_type\": {\n \"default\": \"domain\",\n \"pattern\": \"^(domain|subdomain|subfolder|url)$\",\n \"title\": \"Search Type\",\n \"type\": \"string\"\n },\n \"date_type\": {\n \"default\": \"daily\",\n \"pattern\": \"^(daily|monthly)$\",\n \"title\": \"Date Type\",\n \"type\": \"string\"\n },\n \"page\": {\n \"default\": 1,\n \"minimum\": 1,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"page_size\": {\n \"default\": 100,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Page Size\",\n \"type\": \"integer\"\n },\n \"sort_field\": {\n \"default\": \"trafficPercent\",\n \"pattern\": \"^[a-zA-Z]+$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n },\n \"filters\": {\n \"additionalProperties\": true,\n \"description\": \"Organic report web filter object\",\n \"title\": \"Filters\",\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainReportQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_pages\": {\n \"method\": \"organic.PagesV3\",\n \"description\": \"Paginated top organic pages with totals.\",\n \"transport\": \"domain\",\n \"total_method\": \"organic.PagesTotalV3\",\n \"web_report\": \"organic.pages\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"date\": {\n \"anyOf\": [\n {\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null,\n \"description\": \"Unix snapshot timestamp from snapshot_dates; omit for latest\",\n \"title\": \"Date\"\n },\n \"search_type\": {\n \"default\": \"domain\",\n \"pattern\": \"^(domain|subdomain|subfolder|url)$\",\n \"title\": \"Search Type\",\n \"type\": \"string\"\n },\n \"date_type\": {\n \"default\": \"daily\",\n \"pattern\": \"^(daily|monthly)$\",\n \"title\": \"Date Type\",\n \"type\": \"string\"\n },\n \"page\": {\n \"default\": 1,\n \"minimum\": 1,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"page_size\": {\n \"default\": 100,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Page Size\",\n \"type\": \"integer\"\n },\n \"sort_field\": {\n \"default\": \"traffic\",\n \"pattern\": \"^[a-zA-Z]+$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n },\n \"filters\": {\n \"additionalProperties\": true,\n \"description\": \"Organic report web filter object\",\n \"title\": \"Filters\",\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainPagesQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_subdomains\": {\n \"method\": \"organic.Subdomains\",\n \"description\": \"Paginated organic subdomain traffic and keyword totals.\",\n \"transport\": \"domain\",\n \"total_method\": \"organic.SubdomainsTotal\",\n \"web_report\": \"organic.subdomains\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"date\": {\n \"anyOf\": [\n {\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null,\n \"description\": \"Unix snapshot timestamp from snapshot_dates; omit for latest\",\n \"title\": \"Date\"\n },\n \"search_type\": {\n \"default\": \"domain\",\n \"pattern\": \"^(domain|subdomain|subfolder|url)$\",\n \"title\": \"Search Type\",\n \"type\": \"string\"\n },\n \"date_type\": {\n \"default\": \"daily\",\n \"pattern\": \"^(daily|monthly)$\",\n \"title\": \"Date Type\",\n \"type\": \"string\"\n },\n \"page\": {\n \"default\": 1,\n \"minimum\": 1,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"page_size\": {\n \"default\": 100,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Page Size\",\n \"type\": \"integer\"\n },\n \"sort_field\": {\n \"default\": \"traffic\",\n \"pattern\": \"^[a-zA-Z]+$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n },\n \"filters\": {\n \"additionalProperties\": true,\n \"description\": \"Organic report web filter object\",\n \"title\": \"Filters\",\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainPagesQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_position_changes\": {\n \"method\": \"organic.PositionChangesV2\",\n \"description\": \"Paginated ranking changes with totals.\",\n \"transport\": \"domain\",\n \"total_method\": \"organic.PositionChangesTotalV2\",\n \"web_report\": \"organic.changes\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"date\": {\n \"anyOf\": [\n {\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null,\n \"description\": \"Unix snapshot timestamp from snapshot_dates; omit for latest\",\n \"title\": \"Date\"\n },\n \"search_type\": {\n \"default\": \"domain\",\n \"pattern\": \"^(domain|subdomain|subfolder|url)$\",\n \"title\": \"Search Type\",\n \"type\": \"string\"\n },\n \"date_type\": {\n \"default\": \"daily\",\n \"pattern\": \"^(daily|monthly)$\",\n \"title\": \"Date Type\",\n \"type\": \"string\"\n },\n \"page\": {\n \"default\": 1,\n \"minimum\": 1,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"page_size\": {\n \"default\": 100,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Page Size\",\n \"type\": \"integer\"\n },\n \"sort_field\": {\n \"default\": \"changeOfTraffic\",\n \"pattern\": \"^[a-zA-Z]+$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n },\n \"filters\": {\n \"additionalProperties\": true,\n \"description\": \"Organic report web filter object\",\n \"title\": \"Filters\",\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainChangesQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_competitors\": {\n \"method\": \"organic.Competitors\",\n \"description\": \"Paginated organic search competitors and totals.\",\n \"transport\": \"domain\",\n \"total_method\": \"organic.CompetitorsTotal\",\n \"web_report\": \"organic.competitors\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"date\": {\n \"anyOf\": [\n {\n \"minimum\": 0,\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null,\n \"description\": \"Unix snapshot timestamp from snapshot_dates; omit for latest\",\n \"title\": \"Date\"\n },\n \"search_type\": {\n \"default\": \"domain\",\n \"pattern\": \"^(domain|subdomain|subfolder|url)$\",\n \"title\": \"Search Type\",\n \"type\": \"string\"\n },\n \"date_type\": {\n \"default\": \"daily\",\n \"pattern\": \"^(daily|monthly)$\",\n \"title\": \"Date Type\",\n \"type\": \"string\"\n },\n \"page\": {\n \"default\": 1,\n \"minimum\": 1,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"page_size\": {\n \"default\": 100,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Page Size\",\n \"type\": \"integer\"\n },\n \"sort_field\": {\n \"default\": \"competitionLvl\",\n \"pattern\": \"^[a-zA-Z]+$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainCompetitorsQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_backlinks\": {\n \"method\": \"backlinks.Overview\",\n \"description\": \"Backlink summary, sample links and anchors.\",\n \"transport\": \"domain\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainIdentityQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_ai_visibility\": {\n \"method\": \"organic.AiSeoSummary\",\n \"description\": \"AI visibility, mentions and citations.\",\n \"transport\": \"domain\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainIdentityQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_ai_countries\": {\n \"method\": \"organic.AiDistributionByCountry\",\n \"description\": \"AI visibility and mentions by country.\",\n \"transport\": \"domain\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainIdentityQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_ai_sources\": {\n \"method\": \"organic.AiTopSources\",\n \"description\": \"Top AI citation sources with offset and limit.\",\n \"transport\": \"domain\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"limit\": {\n \"default\": 20,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Limit\",\n \"type\": \"integer\"\n },\n \"offset\": {\n \"default\": 0,\n \"minimum\": 0,\n \"title\": \"Offset\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"AiSourcesQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_trends\": {\n \"method\": \"organic.OverviewTrend\",\n \"description\": \"Daily or monthly organic and paid search trends.\",\n \"transport\": \"domain\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"date_type\": {\n \"default\": \"monthly\",\n \"pattern\": \"^(daily|monthly)$\",\n \"title\": \"Date Type\",\n \"type\": \"string\"\n },\n \"global_data\": {\n \"default\": false,\n \"title\": \"Global Data\",\n \"type\": \"boolean\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainTrendQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_paid_keywords\": {\n \"method\": \"adwords.PositionsOverview\",\n \"description\": \"Paid keyword overview sample; account permissions apply.\",\n \"transport\": \"domain\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"limit\": {\n \"default\": 5,\n \"maximum\": 10,\n \"minimum\": 1,\n \"title\": \"Limit\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainListQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_paid_competitors\": {\n \"method\": \"adwords.CompetitorsOverview\",\n \"description\": \"Paid search competitors; account permissions apply.\",\n \"transport\": \"domain\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"limit\": {\n \"default\": 5,\n \"maximum\": 10,\n \"minimum\": 1,\n \"title\": \"Limit\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainListQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_topics\": {\n \"method\": \"organic.TopicsResult\",\n \"description\": \"Organic search topics already available for a domain.\",\n \"transport\": \"domain\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"domain_topics_status\": {\n \"method\": \"organic.TopicsStatus\",\n \"description\": \"Availability of domain organic topics.\",\n \"transport\": \"domain\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"description\": \"Bare domain, e.g. openai.com\",\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"DomainQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"databases\": {\n \"method\": \"user.Databases\",\n \"description\": \"Search databases and account access.\",\n \"transport\": \"direct\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {},\n \"title\": \"EmptyQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"snapshot_dates\": {\n \"method\": \"organic.SnapshotDates\",\n \"description\": \"Available historical domain snapshots.\",\n \"transport\": \"direct\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"global_data\": {\n \"default\": false,\n \"title\": \"Global Data\",\n \"type\": \"boolean\"\n }\n },\n \"title\": \"HistoryQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"report_permissions\": {\n \"method\": \"dpa.UserPermissions\",\n \"description\": \"Account history, export and research permissions.\",\n \"transport\": \"domain\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n }\n },\n \"title\": \"DatabaseQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_links\": {\n \"method\": \"backlinks\",\n \"description\": \"Paginated backlinks with provider caps and totals.\",\n \"transport\": \"backlink\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"target_type\": {\n \"default\": \"root_domain\",\n \"pattern\": \"^(root_domain|domain|url)$\",\n \"title\": \"Target Type\",\n \"type\": \"string\"\n },\n \"filters\": {\n \"default\": \"\",\n \"description\": \"Web backlink filter, e.g. +|type||nofollow\",\n \"title\": \"Filters\",\n \"type\": \"string\"\n },\n \"page\": {\n \"default\": 0,\n \"description\": \"Zero-based provider page\",\n \"minimum\": 0,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"sort_field\": {\n \"default\": \"\",\n \"pattern\": \"^[a-z_]*$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"BacklinkListQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_referring_domains\": {\n \"method\": \"backlinks_refdomains\",\n \"description\": \"Paginated referring domains.\",\n \"transport\": \"backlink\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"target_type\": {\n \"default\": \"root_domain\",\n \"pattern\": \"^(root_domain|domain|url)$\",\n \"title\": \"Target Type\",\n \"type\": \"string\"\n },\n \"filters\": {\n \"default\": \"\",\n \"description\": \"Web backlink filter, e.g. +|type||nofollow\",\n \"title\": \"Filters\",\n \"type\": \"string\"\n },\n \"page\": {\n \"default\": 0,\n \"description\": \"Zero-based provider page\",\n \"minimum\": 0,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"sort_field\": {\n \"default\": \"\",\n \"pattern\": \"^[a-z_]*$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"BacklinkListQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_history\": {\n \"method\": \"historical\",\n \"description\": \"Historical backlink and referring-domain trends.\",\n \"transport\": \"backlink_overview\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"target_type\": {\n \"default\": \"root_domain\",\n \"pattern\": \"^(root_domain|domain|url)$\",\n \"title\": \"Target Type\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"BacklinkQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_competitors\": {\n \"method\": \"competitors\",\n \"description\": \"Competitors sharing a backlink profile.\",\n \"transport\": \"backlink_overview\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"target_type\": {\n \"default\": \"root_domain\",\n \"pattern\": \"^(root_domain|domain|url)$\",\n \"title\": \"Target Type\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"BacklinkQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_top_pages\": {\n \"method\": \"backlinks_pages\",\n \"description\": \"Paginated indexed pages ranked by referring domains.\",\n \"transport\": \"backlink\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"target_type\": {\n \"default\": \"root_domain\",\n \"pattern\": \"^(root_domain|domain|url)$\",\n \"title\": \"Target Type\",\n \"type\": \"string\"\n },\n \"filters\": {\n \"default\": \"\",\n \"description\": \"Web backlink filter, e.g. +|type||nofollow\",\n \"title\": \"Filters\",\n \"type\": \"string\"\n },\n \"page\": {\n \"default\": 0,\n \"description\": \"Zero-based provider page\",\n \"minimum\": 0,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"sort_field\": {\n \"default\": \"\",\n \"pattern\": \"^[a-z_]*$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"BacklinkListQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_anchors\": {\n \"method\": \"backlinks_anchors\",\n \"description\": \"Paginated anchor texts and backlink counts.\",\n \"transport\": \"backlink\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"target_type\": {\n \"default\": \"root_domain\",\n \"pattern\": \"^(root_domain|domain|url)$\",\n \"title\": \"Target Type\",\n \"type\": \"string\"\n },\n \"filters\": {\n \"default\": \"\",\n \"description\": \"Web backlink filter, e.g. +|type||nofollow\",\n \"title\": \"Filters\",\n \"type\": \"string\"\n },\n \"page\": {\n \"default\": 0,\n \"description\": \"Zero-based provider page\",\n \"minimum\": 0,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"sort_field\": {\n \"default\": \"\",\n \"pattern\": \"^[a-z_]*$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"BacklinkListQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_outgoing_domains\": {\n \"method\": \"backlinks_outgoing_domains\",\n \"description\": \"Paginated outbound domains and outgoing link counts.\",\n \"transport\": \"backlink\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"target_type\": {\n \"default\": \"root_domain\",\n \"pattern\": \"^(root_domain|domain|url)$\",\n \"title\": \"Target Type\",\n \"type\": \"string\"\n },\n \"filters\": {\n \"default\": \"\",\n \"description\": \"Web backlink filter, e.g. +|type||nofollow\",\n \"title\": \"Filters\",\n \"type\": \"string\"\n },\n \"page\": {\n \"default\": 0,\n \"description\": \"Zero-based provider page\",\n \"minimum\": 0,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"sort_field\": {\n \"default\": \"\",\n \"pattern\": \"^[a-z_]*$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"BacklinkListQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_countries\": {\n \"method\": \"geodomains\",\n \"description\": \"Referring-domain country distribution.\",\n \"transport\": \"backlink_overview\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"target_type\": {\n \"default\": \"root_domain\",\n \"pattern\": \"^(root_domain|domain|url)$\",\n \"title\": \"Target Type\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"BacklinkQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_authority\": {\n \"method\": \"ascore\",\n \"description\": \"Authority score and supporting metrics.\",\n \"transport\": \"backlink_overview\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"target_type\": {\n \"default\": \"root_domain\",\n \"pattern\": \"^(root_domain|domain|url)$\",\n \"title\": \"Target Type\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"BacklinkQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_categories\": {\n \"method\": \"category-profile\",\n \"description\": \"Referring-domain category profile.\",\n \"transport\": \"backlink_overview\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"maxLength\": 253,\n \"minLength\": 1,\n \"title\": \"Domain\",\n \"type\": \"string\"\n },\n \"target_type\": {\n \"default\": \"root_domain\",\n \"pattern\": \"^(root_domain|domain|url)$\",\n \"title\": \"Target Type\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domain\"\n ],\n \"title\": \"BacklinkQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_gap\": {\n \"method\": \"/spectrum/v1/Gap/KeywordsList\",\n \"description\": \"Paginated organic keyword gap between two to five sites.\",\n \"transport\": \"gap\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"domains\": {\n \"description\": \"Two to five root domains, first is your site\",\n \"items\": {\n \"type\": \"string\"\n },\n \"maxItems\": 5,\n \"minItems\": 2,\n \"title\": \"Domains\",\n \"type\": \"array\"\n },\n \"filters\": {\n \"default\": \"\",\n \"description\": \"Semrush spectrum filter expression\",\n \"title\": \"Filters\",\n \"type\": \"string\"\n },\n \"gap_type\": {\n \"default\": 2,\n \"description\": \"Semrush web gap type, default 2\",\n \"maximum\": 7,\n \"minimum\": 1,\n \"title\": \"Gap Type\",\n \"type\": \"integer\"\n },\n \"limit\": {\n \"default\": 100,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Limit\",\n \"type\": \"integer\"\n },\n \"offset\": {\n \"default\": 0,\n \"minimum\": 0,\n \"title\": \"Offset\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"domains\"\n ],\n \"title\": \"GapQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_gap_totals\": {\n \"method\": \"/spectrum/v1/Gap/KeywordsTotals\",\n \"description\": \"Counts for keyword overlap and opportunity types.\",\n \"transport\": \"gap\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"domains\": {\n \"description\": \"Two to five root domains, first is your site\",\n \"items\": {\n \"type\": \"string\"\n },\n \"maxItems\": 5,\n \"minItems\": 2,\n \"title\": \"Domains\",\n \"type\": \"array\"\n },\n \"filters\": {\n \"default\": \"\",\n \"description\": \"Semrush spectrum filter expression\",\n \"title\": \"Filters\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domains\"\n ],\n \"title\": \"GapSummaryQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"keyword_gap_overlap\": {\n \"method\": \"/spectrum/v1/Gap/Overlaps\",\n \"description\": \"Organic keyword profile overlaps.\",\n \"transport\": \"gap\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"database\": {\n \"default\": \"us\",\n \"pattern\": \"^(mobile-)?[a-z]{2}$\",\n \"title\": \"Database\",\n \"type\": \"string\"\n },\n \"domains\": {\n \"description\": \"Two to five root domains, first is your site\",\n \"items\": {\n \"type\": \"string\"\n },\n \"maxItems\": 5,\n \"minItems\": 2,\n \"title\": \"Domains\",\n \"type\": \"array\"\n },\n \"filters\": {\n \"default\": \"\",\n \"description\": \"Semrush spectrum filter expression\",\n \"title\": \"Filters\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"domains\"\n ],\n \"title\": \"GapSummaryQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_gap\": {\n \"method\": \"backlinks_matrix\",\n \"description\": \"Paginated link-building prospects shared by competitors but missing from your site.\",\n \"transport\": \"backlink_gap\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domains\": {\n \"description\": \"Two to five root domains, first is your site\",\n \"items\": {\n \"type\": \"string\"\n },\n \"maxItems\": 5,\n \"minItems\": 2,\n \"title\": \"Domains\",\n \"type\": \"array\"\n },\n \"page\": {\n \"default\": 0,\n \"minimum\": 0,\n \"title\": \"Page\",\n \"type\": \"integer\"\n },\n \"limit\": {\n \"default\": 100,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Limit\",\n \"type\": \"integer\"\n },\n \"filters\": {\n \"default\": \"+|backlinksnum_0|Eq|0\",\n \"description\": \"Web filter; default finds referring domains missing from your site\",\n \"title\": \"Filters\",\n \"type\": \"string\"\n },\n \"sort_field\": {\n \"default\": \"matchesnum\",\n \"pattern\": \"^[a-z_]+$\",\n \"title\": \"Sort Field\",\n \"type\": \"string\"\n },\n \"descending\": {\n \"default\": true,\n \"title\": \"Descending\",\n \"type\": \"boolean\"\n },\n \"sort_target\": {\n \"default\": 0,\n \"maximum\": 4,\n \"minimum\": 0,\n \"title\": \"Sort Target\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"domains\"\n ],\n \"title\": \"BacklinkGapQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"backlink_comparison\": {\n \"method\": \"backlinks_comparison\",\n \"description\": \"Compare backlink history, country distribution and domain zones.\",\n \"transport\": \"backlink_gap\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"domains\": {\n \"description\": \"Two to five root domains, first is your site\",\n \"items\": {\n \"type\": \"string\"\n },\n \"maxItems\": 5,\n \"minItems\": 2,\n \"title\": \"Domains\",\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"domains\"\n ],\n \"title\": \"BacklinkComparisonQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"projects\": {\n \"method\": \"/apis/v4-raw/crossroad/api/v0/crossroad/list\",\n \"description\": \"Existing projects and folder access, with pagination.\",\n \"transport\": \"projects\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"limit\": {\n \"default\": 15,\n \"maximum\": 100,\n \"minimum\": 1,\n \"title\": \"Limit\",\n \"type\": \"integer\"\n },\n \"offset\": {\n \"default\": 0,\n \"minimum\": 0,\n \"title\": \"Offset\",\n \"type\": \"integer\"\n },\n \"filters\": {\n \"additionalProperties\": true,\n \"description\": \"Project list web filter object\",\n \"title\": \"Filters\",\n \"type\": \"object\"\n }\n },\n \"title\": \"ProjectListQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"ai_capabilities\": {\n \"method\": \"/ai-seo/api/v2/user/user_capabilities\",\n \"description\": \"Account AI Visibility Toolkit access and limits.\",\n \"transport\": \"post\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {},\n \"title\": \"EmptyQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"audit_campaigns\": {\n \"method\": \"/siteaudit/api/campaigns/seolist\",\n \"description\": \"Existing Site Audit campaigns; does not start a crawl.\",\n \"transport\": \"get\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {},\n \"title\": \"EmptyQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"folders\": {\n \"method\": \"/apis/v4-raw/folders/api/v0/folders/selector-list\",\n \"description\": \"Accessible project folders.\",\n \"transport\": \"get\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {},\n \"title\": \"EmptyQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"saved_keyword_lists\": {\n \"method\": \"/apis/v4-raw/saved-keywords/api/v0/list/all\",\n \"description\": \"Existing saved keyword lists.\",\n \"transport\": \"post\",\n \"total_method\": \"\",\n \"web_report\": \"domain.overview\",\n \"schema\": {\n \"additionalProperties\": false,\n \"properties\": {},\n \"title\": \"EmptyQuery\",\n \"type\": \"object\"\n },\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"\"\n },\n \"project_create\": {\n \"method\": \"/apis/v4-raw/folders/api/v0/folders\",\n \"description\": \"Create a project, optionally with a website. Does not start tools or share it.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": true,\n \"destructive\": false,\n \"http_method\": \"POST\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 255,\n \"pattern\": \"^(?=.*\\\\S)[^~|`!#%^&*=\\\\[\\\\]\\\\\\\\\\\\x27/{}\\\":<>?]+$\",\n \"description\": \"Project name, up to 255 characters. The web UI restricts punctuation.\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 253,\n \"pattern\": \"^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\\\.)+[A-Za-z]{2,63}$\",\n \"description\": \"Domain or subdomain, without protocol or path.\"\n },\n \"confirm\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Confirm this account mutation.\"\n },\n \"dry_run\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Print the request without sending it.\"\n }\n },\n \"required\": [\n \"name\"\n ]\n }\n },\n \"project_get\": {\n \"method\": \"/apis/v4-raw/folders/api/v0/folders/folder\",\n \"description\": \"Read one project by its current web folder ID.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"GET\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"folder_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+$\",\n \"maxLength\": 30,\n \"description\": \"Current web project folder ID, as a decimal string.\"\n }\n },\n \"required\": [\n \"folder_id\"\n ]\n }\n },\n \"project_update\": {\n \"method\": \"/apis/v4-raw/folders/api/v0/folders/{folder_id}\",\n \"description\": \"Rename a project or add its first domain. Existing domains cannot be changed.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": true,\n \"destructive\": false,\n \"http_method\": \"PUT\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"folder_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+$\",\n \"maxLength\": 30,\n \"description\": \"Current web project folder ID, as a decimal string.\"\n },\n \"name\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 255,\n \"pattern\": \"^(?=.*\\\\S)[^~|`!#%^&*=\\\\[\\\\]\\\\\\\\\\\\x27/{}\\\":<>?]+$\",\n \"description\": \"Project name, up to 255 characters. The web UI restricts punctuation.\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 253,\n \"pattern\": \"^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\\\.)+[A-Za-z]{2,63}$\",\n \"description\": \"Domain or subdomain, without protocol or path.\"\n },\n \"confirm\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Confirm this account mutation.\"\n },\n \"dry_run\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Print the request without sending it.\"\n }\n },\n \"required\": [\n \"folder_id\"\n ],\n \"anyOf\": [\n {\n \"required\": [\n \"name\"\n ]\n },\n {\n \"required\": [\n \"domain\"\n ]\n }\n ]\n }\n },\n \"project_delete\": {\n \"method\": \"/apis/v4-raw/folders/api/v0/folders/{folder_id}\",\n \"description\": \"Permanently delete a project and its attached tool data.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": true,\n \"destructive\": true,\n \"http_method\": \"DELETE\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"folder_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+$\",\n \"maxLength\": 30,\n \"description\": \"Current web project folder ID, as a decimal string.\"\n },\n \"confirm\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Confirm this account mutation.\"\n },\n \"dry_run\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Print the request without sending it.\"\n }\n },\n \"required\": [\n \"folder_id\"\n ]\n }\n },\n \"project_leave\": {\n \"method\": \"/share/json/leave/project-smb\",\n \"description\": \"Leave a shared project.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": true,\n \"destructive\": true,\n \"http_method\": \"POST\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"folder_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+$\",\n \"maxLength\": 30,\n \"description\": \"Current web project folder ID, as a decimal string.\"\n },\n \"confirm\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Confirm this account mutation.\"\n },\n \"dry_run\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Print the request without sending it.\"\n }\n },\n \"required\": [\n \"folder_id\"\n ]\n }\n },\n \"project_limits\": {\n \"method\": \"/apis/v4-raw/folders/api/v0/folders/limits\",\n \"description\": \"Read project creation limits.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"GET\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {},\n \"required\": []\n }\n },\n \"project_tags\": {\n \"method\": \"/apis/v4-raw/folders/api/v0/folders/tags\",\n \"description\": \"Read available project tags.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"GET\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {},\n \"required\": []\n }\n },\n \"project_set_tags\": {\n \"method\": \"/apis/v4-raw/folders/api/v0/folders/tags/{folder_id}\",\n \"description\": \"Replace project tags. An empty array removes all its tags.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": true,\n \"destructive\": false,\n \"http_method\": \"POST\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"folder_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+$\",\n \"maxLength\": 30,\n \"description\": \"Current web project folder ID, as a decimal string.\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 50,\n \"pattern\": \"^[^~|`!#%^&*=\\\\[\\\\]\\\\\\\\\\\\x27/{}\\\":<>?]+$\"\n },\n \"maxItems\": 3,\n \"uniqueItems\": true\n },\n \"confirm\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Confirm this account mutation.\"\n },\n \"dry_run\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Print the request without sending it.\"\n }\n },\n \"required\": [\n \"folder_id\",\n \"tags\"\n ]\n }\n },\n \"project_check_domain\": {\n \"method\": \"/apis/v4-raw/folders/api/v0/folders/check-domain\",\n \"description\": \"Check website information before creating a project.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"GET\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 253,\n \"pattern\": \"^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\\\.)+[A-Za-z]{2,63}$\",\n \"description\": \"Domain or subdomain, without protocol or path.\"\n }\n },\n \"required\": [\n \"domain\"\n ]\n }\n },\n \"project_pin\": {\n \"method\": \"/apis/v4-raw/crossroad/api/v0/crossroad/set-pinned\",\n \"description\": \"Pin or unpin a project on the dashboard.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": true,\n \"destructive\": false,\n \"http_method\": \"POST\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"folder_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+$\",\n \"maxLength\": 30,\n \"description\": \"Current web project folder ID, as a decimal string.\"\n },\n \"pinned\": {\n \"type\": \"boolean\"\n },\n \"confirm\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Confirm this account mutation.\"\n },\n \"dry_run\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Print the request without sending it.\"\n }\n },\n \"required\": [\n \"folder_id\",\n \"pinned\"\n ]\n }\n },\n \"project_toolkits\": {\n \"method\": \"/apis/v4-raw/crossroad/api/v0/crossroad/toolkits\",\n \"description\": \"Read SEO, AI, local, social, advertising and content toolkit status.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"POST\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"folder_ids\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+$\",\n \"maxLength\": 30,\n \"description\": \"Current web project folder ID, as a decimal string.\"\n },\n \"minItems\": 1,\n \"maxItems\": 100,\n \"uniqueItems\": true\n },\n \"with_promo\": {\n \"type\": \"boolean\",\n \"default\": false\n }\n },\n \"required\": [\n \"folder_ids\"\n ]\n }\n },\n \"project_tools\": {\n \"method\": \"/apis/v4-raw/crossroad/api/v0/crossroad/tools\",\n \"description\": \"Read project dashboard metrics. Tool IDs match the web dashboard.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": false,\n \"destructive\": false,\n \"http_method\": \"POST\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"folder_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+$\",\n \"maxLength\": 30,\n \"description\": \"Current web project folder ID, as a decimal string.\"\n },\n \"tools\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"integer\",\n \"minimum\": 3,\n \"maximum\": 33\n },\n \"minItems\": 1,\n \"maxItems\": 31,\n \"uniqueItems\": true\n }\n },\n \"required\": [\n \"folder_id\",\n \"tools\"\n ]\n }\n },\n \"project_enable_seo\": {\n \"method\": \"/projects/api/projects\",\n \"description\": \"Create the SEO project associated with an existing web project. Uses project allowance.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": true,\n \"destructive\": false,\n \"http_method\": \"POST\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"folder_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+$\",\n \"maxLength\": 30,\n \"description\": \"Current web project folder ID, as a decimal string.\"\n },\n \"confirm\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Confirm this account mutation.\"\n },\n \"dry_run\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Print the request without sending it.\"\n }\n },\n \"required\": [\n \"folder_id\"\n ]\n }\n },\n \"project_seo_auto_setup\": {\n \"method\": \"/projects/api/projects/seo_auto_setup\",\n \"description\": \"Start automatic SEO setup, including Site Audit and Position Tracking. Uses account allowances.\",\n \"transport\": \"project_web\",\n \"total_method\": \"\",\n \"web_report\": \"\",\n \"mutation\": true,\n \"destructive\": false,\n \"http_method\": \"POST\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"folder_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+$\",\n \"maxLength\": 30,\n \"description\": \"Current web project folder ID, as a decimal string.\"\n },\n \"confirm\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Confirm this account mutation.\"\n },\n \"dry_run\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Print the request without sending it.\"\n }\n },\n \"required\": [\n \"folder_id\"\n ]\n }\n }\n}\n","import type { Schema } from 'effect';\nimport packageInfo from '../package.json' with { type: 'json' };\nimport catalog from './report-catalog.json' with { type: 'json' };\n\nconst backlinkSorts = new Map([['backlinks', 'page_ascore'], ['backlinks_refdomains', 'backlinksnum'], ['backlinks_anchors', 'backlinksnum'], ['backlinks_pages', 'domainsnum'], ['backlinks_outgoing_domains', 'links_num']]);\n\nexport const version = packageInfo.version;\nexport const reports = catalog;\nexport type ReportName = keyof typeof reports;\nexport type Report = (typeof reports)[ReportName];\n/** Validated catalog queries and fixed JSON request payloads; optional keys are omitted on wire. */\nexport interface Query { [key: string]: Schema.Json; }\n\n/** Fixed request shapes observed in semrush-web-mcp. No arbitrary RPC or URL input. */\nexport function reportParameters(definition: Report, q: Query): Query {\n const family = definition.transport;\n if (family === 'project_web') return projectParameters(definition, q);\n if (family === 'magic') return magicParameters(definition, q);\n if (family === 'keyword') return keywordParameters(definition, q);\n if (family === 'direct') return 'database' in q ? { database: (q.database ?? null), global: (q.global_data ?? null), dateFormat: 'date' } : {};\n if (family === 'domain') return domainParameters(definition, q);\n if (family === 'backlink_gap') return backlinkComparisonParameters(definition, q);\n if (family.startsWith('backlink')) return backlinkParameters(definition, q);\n if (family === 'gap') return gapParameters(definition, q);\n if (family === 'projects') return { filter: (q.filters ?? null), range: { limit: (q.limit ?? null), offset: (q.offset ?? null) } };\n if (family === 'post' && definition.method.endsWith('/list/all')) return { ownership: 1, order: { field: 3, direction: 2 }, range: { limit: 1000, offset: 0 } };\n if (definition.method.endsWith('selector-list')) return { limit: 10000, offset: 0 };\n return {};\n}\n\nfunction magicParameters(definition: Report, q: Query): Query {\n const method = definition.method;\n const filters: Query = Object.fromEntries(['phrase', 'competition_level', 'cpc', 'difficulty', 'results', 'volume', 'words_count'].map(key => [key, []]));\n Object.assign(filters, { serp_features: [{ inverted: false, value: [] }], phrase_include_logic: 0 }, (q.filters ?? null));\n const params: Query = { phrase: (q.keyword ?? null), database: (q.database ?? null), currency: (q.currency ?? null), mode: (q.mode ?? null), questions_only: (q.questions_only ?? null), topics_enabled: true, filter: filters, groups: (q.groups ?? null), order: { direction: q.descending ? 1 : 0, field: (q.sort_field ?? null) }, groups_order: { direction: 1, field: 'relevance' } };\n if (method === 'ideas.GetKeywords') params.page = { number: (q.page ?? null), size: (q.page_size ?? null) };\n if (method === 'ideas.GetGroups') params.groups_page = { number: (q.page ?? null), size: (q.page_size ?? null) };\n return params;\n}\n\n\nfunction keywordParameters(definition: Report, q: Query): Query {\n const method = definition.method;\n if (!('keyword' in q)) return {};\n const params: Query = { phrase: (q.keyword ?? null), database: (q.database ?? null), device: 0, currency: 'USD', location: 0, date: '' };\n if (method.startsWith('ideas.')) Object.assign(params, { mode: 0, questions_only: (q.questions_only ?? null) });\n return params;\n}\n\n\nfunction domainParameters(definition: Report, q: Query): Query {\n const method = definition.method;\n if (!('domain' in q)) return { database: (q.database ?? null) };\n const params: Query = { searchItem: (q.domain ?? null), searchType: 'domain', dateFormat: 'date', dateType: q.date_type ?? 'daily' };\n if ('database' in q) params.database = (q.database ?? null);\n if ('search_type' in q) {\n delete params.dateFormat;\n if ((q.date ?? null) !== null) params.date = (q.date ?? null);\n Object.assign(params, { searchType: (q.search_type ?? null), display: { page: (q.page ?? null), pageSize: (q.page_size ?? null), order: { field: (q.sort_field ?? null), direction: q.descending ? 'desc' : 'asc' } } });\n if (method === 'organic.Positions' || method === 'organic.PositionChangesV2') params.positionsType = 'all';\n if ('filters' in q) params.filter = (q.filters ?? null);\n if (method === 'organic.PositionChangesV2') Object.assign(params, { changesTypes: null, dateRange: null });\n }\n if (method.endsWith('CompetitorsOverview')) Object.assign(params, { display: { page: 1, pageSize: (q.limit ?? null) }, youDomain: true });\n if (method === 'organic.OverviewTrend') {\n delete params.dateFormat;\n Object.assign(params, { dateRange: null, global: (q.global_data ?? null) });\n }\n if (method === 'organic.TopicsStatus' || method === 'organic.TopicsResult') {\n delete params.dateFormat;\n delete params.dateType;\n }\n if (method === 'organic.AiTopSources') params.range = { limit: (q.limit ?? null), offset: (q.offset ?? null) };\n return params;\n}\n\n\nfunction backlinkComparisonParameters(definition: Report, q: Query): Query {\n const method = definition.method;\n const params: Query = { action: 'report', type: method, 'targets[]': (q.domains ?? null), 'target_types[]': Array.isArray(q.domains) ? q.domains.map(() => 'root_domain') : [] };\n if (method === 'backlinks_matrix') Object.assign(params, { display_limit: (q.limit ?? null), export_columns: 'domain,domain_ascore,matches_num,backlinks_num,traffic', display_filter: (q.filters ?? null), sort_field: (q.sort_field ?? null), sort_type: q.descending ? 'desc' : 'asc', sort_target: (q.sort_target ?? null), display_page: (q.page ?? null) });\n else params.export_columns = 'zones,backlinks_historical,geodomains';\n return params;\n}\n\n\nfunction backlinkParameters(definition: Report, q: Query): Query {\n const method = definition.method;\n const family = definition.transport;\n const params: Query = { target: (q.domain ?? null), target_type: (q.target_type ?? null) };\n if (family === 'backlink') {\n Object.assign(params, { action: 'report', type: method, display_page: (q.page ?? null), sort_field: (q.sort_field ?? null) || backlinkSorts.get(method), sort_type: q.descending ? 'desc' : 'asc' });\n if ((q.filters ?? null)) params.display_filter = (q.filters ?? null);\n }\n return params;\n}\n\n\nfunction gapParameters(definition: Report, q: Query): Query {\n const method = definition.method;\n const params: Query = { targets: Array.isArray(q.domains) ? q.domains.map(value => ({ product_type: 2, type: 1, value, filters: '' })) : [], date: null, database: (q.database ?? null), filters: (q.filters ?? null) };\n if (method.endsWith('KeywordsList')) Object.assign(params, { type: (q.gap_type ?? null), range: { limit: (q.limit ?? null), offset: (q.offset ?? null) }, columns: ['KEYWORD', 'INTENTS', 'VOLUME', 'KEYWORD_DIFFICULTY', 'CPC', 'COMPETITION_DENSITY', 'TARGETS_POSITION', 'TARGETS_URL', 'RESULTS'], order: { column: 6, direction: 2 } });\n return params;\n}\n\n/** Current project-selector and Crossroad web contracts. Control flags never go on wire. */\nfunction projectParameters(definition: Report, q: Query): Query {\n const path = definition.method;\n if (path === '/apis/v4-raw/folders/api/v0/folders' || definition.http_method === 'PUT') {\n const properties: Schema.Json[] = [];\n if (q.name !== undefined) properties.push({ name: { value: q.name } });\n if (q.domain !== undefined) properties.push({ domain: { value: q.domain } });\n return { properties };\n }\n if (path.endsWith('/leave/project-smb')) return { object_ids: [q.folder_id ?? null] };\n if (path.includes('/tags/')) return { tags: Array.isArray(q.tags) ? q.tags.map(name => ({ name })) : [] };\n if (path.endsWith('/set-pinned')) return { id: q.folder_id ?? null, is_pinned: q.pinned ?? null };\n if (path.endsWith('/toolkits')) return { folders: q.folder_ids ?? [], withPromo: q.with_promo ?? false };\n if (path.endsWith('/tools')) return { items: Array.isArray(q.tools) ? q.tools.map(tool => ({ folder_id: q.folder_id ?? null, tool })) : [] };\n if (definition.http_method === 'DELETE') return {};\n return Object.fromEntries(Object.entries(q).filter(([key]) => key !== 'confirm' && key !== 'dry_run'));\n}\n\n/** Paths come only from the catalog; folder IDs pass the decimal-string input schema. */\nexport function projectRequest(definition: Report, query: Query) {\n return {\n method: definition.http_method,\n path: definition.method.replace('{folder_id}', String(query.folder_id)),\n body: reportParameters(definition, query),\n };\n}\n\nexport function previewMutation(name: string, definition: Report, query: Query) {\n return definition.mutation && query.dry_run === true\n ? { dry_run: true, report: name, request: projectRequest(definition, query) }\n : undefined;\n}\n","import { Schema } from 'effect';\n\n/** Safe errors are the only error details exposed by CLI and MCP boundaries. */\nexport class SessionError extends Schema.TaggedError<SessionError>()('SessionError', { message: Schema.String, code: Schema.optional(Schema.String) }) {}\nexport class ReportError extends Schema.TaggedError<ReportError>()('ReportError', { message: Schema.String }) {}\nexport class UsageError extends Schema.TaggedError<UsageError>()('UsageError', { message: Schema.String }) {}\n"],"mappings":";;;gBAEa;;;;6BCFb;iBACoB;EAChB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc,EAAE;GAChB,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;mBACmB;EAClB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,WAAW;KACT,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,UACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;gBACgB;EACf,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,WAAW;KACT,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,kBAAkB;KAChB,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,SAAS;KACP,WAAW;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,UACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;wBACwB;EACvB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,WAAW;KACT,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,kBAAkB;KAChB,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,UACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;eACe;EACd,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,WAAW;KACT,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,SAAS;KACP,WAAW;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,UACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;cACc;EACb,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,WAAW;KACT,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,SAAS;KACP,WAA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X,SAAS;KACT,QAAQ;KACT;IACD,cAAc;KACZ,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,cAAc;KACZ,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;mBACmB;EAClB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc,EACZ,UAAU;IACR,eAAe;IACf,aAAa;IACb,aAAa;IACb,SAAS;IACT,QAAQ;IACT,EACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;uBACuB;EACtB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc,EACZ,UAAU;IACR,eAAe;IACf,aAAa;IACb,aAAa;IACb,SAAS;IACT,QAAQ;IACT,EACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;sBACsB;EACrB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc,EACZ,UAAU;IACR,eAAe;IACf,aAAa;IACb,aAAa;IACb,SAAS;IACT,QAAQ;IACT,EACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;oBACoB;EACnB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,UAAU;KACR,eAAe;KACf,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,SAAS;KACP,WAAW;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,UAAU;KACR,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;gBACgB;EACf,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,UAAU;KACR,eAAe;KACf,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,aAAa;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,eAAe;KACb,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;uBACuB;EACtB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,UAAU;KACR,eAAe;KACf,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,SAAS;KACP,WAAW;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;0BAC0B;EACzB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,UAAU;KACR,eAAe;KACf,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,SAAS;KACP,WAAW;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;gBACgB;EACf,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,UAAU;KACR,eAAe;KACf,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;uBACuB;EACtB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,UAAU;KACR,eAAe;KACf,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;YACY;EACX,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc,EAAE;GAChB,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;iBACiB;EAChB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;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ACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;qBACqB;EACpB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,UAAU;KACR,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,eAAe;KACb,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;qBACqB;EACpB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,UAAU;KACR,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,eAAe;KACb,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;sBACsB;EACrB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,UAAU;KACR,aAAa;KACb,aAAa;KACb,SAAS;KACT,QAAQ;KACT;IACD,eAAe;KACb,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACD,YAAY;EACZ,eAAe;EACf,eAAe;EAChB;cACc;EACb,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc;IACZ,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD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QAAQ;KACR,WAAW;KACX,eAAe;KAChB;IACF;GACD,YAAY,CACV,OACD;GACF;EACF;cACc;EACb,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,YAAY;EACZ,eAAe;EACf,eAAe;EACf,UAAU;GACR,QAAQ;GACR,wBAAwB;GACxB,cAAc,EACZ,aAAa;IACX,QAAQ;IACR,WAAW;IACX,aAAa;IACb,eAAe;IAChB,EACF;GACD,YAAY,CACV,YACD;GACF;EACF;iBACiB;EAChB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,YAAY;EACZ,eAAe;EACf,eAAe;EACf,UAAU;GACR,QAAQ;GACR,wBAAwB;GACxB,cAAc;IACZ,aAAa;KACX,QAAQ;KACR,WAAW;KACX,aAAa;KACb,eAAe;KAChB;IACD,QAAQ;KACN,QAAQ;KACR,aAAa;KACb,aAAa;KACb,WAAW;KACX,eAAe;KAChB;IACD,UAAU;KACR,QAAQ;KACR,aAAa;KACb,aAAa;KACb,WAAW;KACX,eAAe;KAChB;IACD,WAAW;KACT,QAAQ;KACR,WAAW;KACX,eAAe;KAChB;IACD,WAAW;KACT,QAAQ;KACR,WAAW;KACX,eAAe;KAChB;IACF;GACD,YAAY,CACV,YACD;GACD,SAAS,CACP,EACE,YAAY,CACV,OACD,EACF,EACD,EACE,YAAY,CACV,SACD,EACF,CACF;GACF;EACF;iBACiB;EAChB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,YAAY;EACZ,eAAe;EACf,eAAe;EACf,UAAU;GACR,QAAQ;GACR,wBAAwB;GACxB,cAAc;IACZ,aAAa;KACX,QAAQ;KACR,WAAW;KACX,aAAa;KACb,eAAe;KAChB;IACD,WAAW;KACT,QAAQ;KACR,WAAW;KACX,eAAe;KAChB;IACD,WAAW;KACT,QAAQ;KACR,WAAW;KACX,eAAe;KAChB;IACF;GACD,YAAY,CACV,YACD;GACF;EACF;gBACgB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,OAAO,aAA0B,CAAC,eAAe,EAAE,SAAS,OAAO,QAAQ,CAAC,CAAC;AAC9G,IAAa,aAAb,cAAgC,OAAO,aAAyB,CAAC,cAAc,EAAE,SAAS,OAAO,QAAQ,CAAC,CAAC"}
@@ -1,8 +1,8 @@
1
- import { a as reports, o as version, r as UsageError } from "./errors-BhvanypE.js";
2
- import { r as sessionsLive } from "./session-layer-BUU0ZG9M.js";
1
+ import { c as version, i as previewMutation, r as UsageError, s as reports } from "./errors-CJuwKbEZ.js";
2
+ import { r as sessionsLive } from "./session-layer-BIL6Umvb.js";
3
3
  import { t as Semrush } from "./browser-service-BYYE-vSm.js";
4
- import { n as semrushLive } from "./browser-layer-D6mEyv9Y.js";
5
- import { n as parseReport } from "./validation-C_lcBSzX.js";
4
+ import { n as semrushLive } from "./browser-layer-CY1KdjJo.js";
5
+ import { n as parseReport } from "./validation-BCtts-Al.js";
6
6
  import { Effect, Layer, ManagedRuntime, Schema } from "effect";
7
7
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
8
8
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -22,8 +22,9 @@ async function serveMcp() {
22
22
  description: report.description,
23
23
  inputSchema: report.schema,
24
24
  annotations: {
25
- readOnlyHint: true,
26
- destructiveHint: false,
25
+ readOnlyHint: !report.mutation,
26
+ destructiveHint: report.destructive,
27
+ idempotentHint: !report.mutation,
27
28
  openWorldHint: true
28
29
  }
29
30
  })) }));
@@ -48,6 +49,11 @@ async function serveMcp() {
48
49
  text: validated.message
49
50
  }]
50
51
  };
52
+ const preview = previewMutation(validated.value.name, validated.value.definition, validated.value.query);
53
+ if (preview) return { content: [{
54
+ type: "text",
55
+ text: JSON.stringify(preview)
56
+ }] };
51
57
  const outcome = await runtime.runPromise(Effect.gen(function* () {
52
58
  return yield* (yield* Semrush).report(validated.value);
53
59
  }).pipe(Effect.match({
@@ -92,4 +98,4 @@ async function serveMcp() {
92
98
 
93
99
  //#endregion
94
100
  export { appLayer, serveMcp };
95
- //# sourceMappingURL=mcp-Cuzenjra.js.map
101
+ //# sourceMappingURL=mcp-CSgmSxRc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-CSgmSxRc.js","names":[],"sources":["../src/mcp.ts"],"sourcesContent":["import { Server } from '@modelcontextprotocol/sdk/server/index.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';\nimport { Effect, ManagedRuntime, Schema } from 'effect';\nimport { reports, version, previewMutation } from './report-parameters.js';\nimport { Semrush } from './browser-service.js';\nimport { semrushLive } from './browser-layer.js';\nimport { sessionsLive } from './session-layer.js';\nimport { Layer } from 'effect';\nimport { parseReport } from './validation.js';\nimport { UsageError } from './errors.js';\n\nexport const appLayer = semrushLive.pipe(Layer.provide(sessionsLive));\n\n/** Protocol-only stdout; validation and auth failures become ordinary MCP tool errors. */\nexport async function serveMcp(): Promise<void> {\n const runtime = ManagedRuntime.make(appLayer);\n const server = new Server({ name: 'semrush-cli', version }, { capabilities: { tools: {} } });\n server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: Object.entries(reports).map(([name, report]) => ({ name, description: report.description, inputSchema: report.schema, annotations: { readOnlyHint: !report.mutation, destructiveHint: report.destructive, idempotentHint: !report.mutation, openWorldHint: true } })) }));\n server.setRequestHandler(CallToolRequestSchema, async request => {\n const program = Effect.gen(function* () {\n const parsed = yield* parseReport(request.params.name, yield* Schema.decodeUnknownEffect(Schema.JsonObject)(request.params.arguments ?? {}).pipe(Effect.mapError(() => new UsageError({ message: 'Tool arguments must be a JSON object.' }))));\n return parsed;\n });\n const validated = await Effect.runPromise(program.pipe(Effect.match({ onSuccess: value => ({ ok: true as const, value }), onFailure: error => ({ ok: false as const, message: error.message }) })));\n if (!validated.ok) return { isError: true, content: [{ type: 'text', text: validated.message }] };\n const preview = previewMutation(validated.value.name, validated.value.definition, validated.value.query);\n if (preview) return { content: [{ type: 'text', text: JSON.stringify(preview) }] };\n const outcome = await runtime.runPromise(Effect.gen(function* () {\n return yield* (yield* Semrush).report(validated.value);\n }).pipe(Effect.match({ onSuccess: value => ({ ok: true as const, text: JSON.stringify(value) }), onFailure: error => ({ ok: false as const, text: error.message }) }))).catch(() => ({ ok: false as const, text: 'Semrush session or browser unavailable. Run semrush-cli doctor, then reconnect this MCP server.' }));\n return { isError: !outcome.ok, content: [{ type: 'text', text: outcome.text }] };\n });\n let closing = false;\n const close = async () => { if (closing) return; closing = true; await runtime.dispose(); await server.close(); };\n server.onclose = () => { void close(); };\n process.once('SIGINT', () => { void close(); });\n process.once('SIGTERM', () => { void close(); });\n await server.connect(new StdioServerTransport());\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAa,WAAW,YAAY,KAAK,MAAM,QAAQ,aAAa,CAAC;;AAGrE,eAAsB,WAA0B;CAC9C,MAAM,UAAU,eAAe,KAAK,SAAS;CAC7C,MAAM,SAAS,IAAI,OAAO;EAAE,MAAM;EAAe;EAAS,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC5F,QAAO,kBAAkB,wBAAwB,aAAa,EAAE,OAAO,OAAO,QAAQ,QAAQ,CAAC,KAAK,CAAC,MAAM,aAAa;EAAE;EAAM,aAAa,OAAO;EAAa,aAAa,OAAO;EAAQ,aAAa;GAAE,cAAc,CAAC,OAAO;GAAU,iBAAiB,OAAO;GAAa,gBAAgB,CAAC,OAAO;GAAU,eAAe;GAAM;EAAE,EAAE,EAAE,EAAE;AAChV,QAAO,kBAAkB,uBAAuB,OAAM,YAAW;EAC/D,MAAM,UAAU,OAAO,IAAI,aAAa;AAEtC,UADe,OAAO,YAAY,QAAQ,OAAO,MAAM,OAAO,OAAO,oBAAoB,OAAO,WAAW,CAAC,QAAQ,OAAO,aAAa,EAAE,CAAC,CAAC,KAAK,OAAO,eAAe,IAAI,WAAW,EAAE,SAAS,yCAAyC,CAAC,CAAC,CA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AQ,IAAI,sBAAsB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { n as SessionError } from "./errors-BhvanypE.js";
1
+ import { n as SessionError } from "./errors-CJuwKbEZ.js";
2
2
  import { Config, Context, Effect, Layer } from "effect";
3
3
  import { readFile } from "node:fs/promises";
4
4
  import { homedir } from "node:os";
@@ -236,4 +236,4 @@ const sessionsLive = makeSessionsLayer(origin);
236
236
 
237
237
  //#endregion
238
238
  export { Sessions as i, origin as n, sessionsLive as r, defaultStateDirectory as t };
239
- //# sourceMappingURL=session-layer-BUU0ZG9M.js.map
239
+ //# sourceMappingURL=session-layer-BIL6Umvb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-layer-BUU0ZG9M.js","names":["code: string","retryAt?: string","status: number","headers: Record<string, string[]>","body: Uint8Array","revision: number","response: Response","text: string","decoded: unknown"],"sources":["../src/session-service.ts","../src/vendor/galleton.ts","../src/session-layer.ts"],"sourcesContent":["import { Context, Effect } from 'effect';\nimport type { Credentials, SessionStatus } from './vendor/galleton.js';\nimport type { SessionError } from './errors.js';\n\n/** Galleton owns all durable credentials. Consumers only receive scoped headers. */\nexport class Sessions extends Context.Service<Sessions, {\n readonly headers: () => Effect.Effect<Record<string, string>, SessionError>;\n readonly status: () => Effect.Effect<SessionStatus, SessionError>;\n readonly save: (credentials: Credentials) => Effect.Effect<SessionStatus, SessionError>;\n readonly capture: (cookies: string[]) => Effect.Effect<void, SessionError>;\n readonly forget: () => Effect.Effect<void, SessionError>;\n}>()('semrush/Sessions') {}\n","/** Server-side client for an authenticated, loopback-only Galleton daemon. */\nexport interface Credentials {\n provider: string;\n cookie_origin?: string;\n cookie_header?: string;\n set_cookies?: string[];\n access_token?: string;\n refresh_token?: string;\n access_expires_at?: string;\n secrets?: Record<string, string>;\n replace?: boolean;\n expected_revision?: number;\n}\nexport interface Problem { code: string; message: string; retry_at?: string }\nexport interface SessionStatus {\n id: string; provider: string; status: string; revision: number;\n created_at: string; last_refresh?: string; next_refresh?: string;\n access_expires_at?: string; cookie_count: number; error?: Problem;\n}\nexport class GalletonError extends Error {\n constructor(public readonly code: string, message: string,\n public readonly status = 0, public readonly retryAt?: string) {\n super(message); this.name = \"GalletonError\";\n }\n}\nexport interface RequestOptions {\n method?: string;\n headers?: Record<string, string>;\n body?: Uint8Array | string;\n json?: unknown;\n}\nexport class ManagedResponse {\n constructor(public readonly status: number,\n public readonly headers: Record<string, string[]>,\n public readonly body: Uint8Array,\n public readonly revision: number) {}\n get ok(): boolean { return this.status >= 200 && this.status < 300; }\n text(): string { return new TextDecoder().decode(this.body); }\n json<T = unknown>(): T { return JSON.parse(this.text()) as T; }\n}\nfunction encode64(bytes: Uint8Array): string {\n let binary = \"\";\n for (let start = 0; start < bytes.length; start += 8192) {\n binary += String.fromCharCode(...bytes.subarray(start, start + 8192));\n }\n return btoa(binary);\n}\nfunction decode64(value: string): Uint8Array {\n return Uint8Array.from(atob(value), char => char.charCodeAt(0));\n}\nfunction sessionPath(id: string): string {\n if (!/^[A-Za-z0-9_-]{1,64}$/.test(id)) throw new TypeError(\"Invalid session ID\");\n return `/v1/sessions/${id}`;\n}\nasync function responseText(response: Response): Promise<string> {\n const reader = response.body?.getReader();\n if (!reader) return \"\";\n const decoder = new TextDecoder();\n let size = 0;\n let text = \"\";\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n size += value.byteLength;\n if (size > 8 * 1024 * 1024) {\n await reader.cancel().catch(() => {});\n throw new GalletonError(\"invalid_response\", \"Oversized daemon response.\", response.status);\n }\n text += decoder.decode(value, { stream: true });\n }\n return text + decoder.decode();\n } finally {\n reader.releaseLock();\n }\n}\nexport class Galleton {\n private readonly base: string;\n private readonly token: string;\n private readonly timeoutMs: number;\n constructor(options: { token: string; baseURL?: string; timeoutMs?: number }) {\n const url = new URL(options.baseURL ?? \"http://127.0.0.1:8766\");\n const host = url.hostname;\n const loopback = host === \"[::1]\" ||\n /^127(?:\\.[0-9]{1,3}){3}$/.test(host) && host.split(\".\").every(n => +n <= 255);\n if (!loopback || url.protocol !== \"http:\" || url.username || url.password ||\n url.search || url.hash || url.pathname !== \"/\") {\n throw new TypeError(\"Galleton requires a literal loopback HTTP origin\");\n }\n this.base = url.origin;\n this.token = options.token.trim();\n if (!this.token || /[\\r\\n]/.test(this.token)) throw new TypeError(\"Invalid local API token\");\n this.timeoutMs = options.timeoutMs ?? 300_000;\n if (!Number.isFinite(this.timeoutMs) || this.timeoutMs <= 0) throw new TypeError(\"Invalid timeout\");\n }\n private async call<T>(method: string, path: string, body?: unknown): Promise<T> {\n let response: Response;\n try {\n response = await fetch(this.base + path, {\n method,\n headers: { Authorization: `Bearer ${this.token}`, \"Content-Type\": \"application/json\" },\n body: body === undefined ? undefined : JSON.stringify(body),\n redirect: \"manual\", signal: AbortSignal.timeout(this.timeoutMs),\n });\n } catch {\n throw new GalletonError(\"daemon_unavailable\", \"Galleton is unavailable or the local request timed out.\");\n }\n let text: string;\n try { text = await responseText(response); }\n catch (error) {\n if (error instanceof GalletonError) throw error;\n throw new GalletonError(\"daemon_unavailable\", \"Galleton response was interrupted; the request may already have completed.\", response.status);\n }\n let decoded: unknown;\n try { decoded = JSON.parse(text); }\n catch {\n if (!response.ok) throw new GalletonError(\"daemon_error\", \"Galleton request failed.\", response.status);\n throw new GalletonError(\"invalid_response\", \"Expected a JSON daemon response.\", response.status);\n }\n if (!response.ok) {\n const error = (decoded as { error?: Problem }).error;\n throw new GalletonError(error?.code ?? \"daemon_error\",\n error?.message ?? \"Galleton request failed.\", response.status, error?.retry_at);\n }\n return decoded as T;\n }\n connect(id: string, credentials: Credentials): Promise<SessionStatus> {\n return this.call(\"PUT\", sessionPath(id), credentials);\n }\n status(id: string): Promise<SessionStatus> { return this.call(\"GET\", sessionPath(id)); }\n async list(): Promise<SessionStatus[]> {\n return (await this.call<{ sessions: SessionStatus[] }>(\"GET\", \"/v1/sessions\")).sessions;\n }\n refresh(id: string): Promise<SessionStatus> { return this.call(\"POST\", sessionPath(id) + \"/refresh\", {}); }\n async headers(id: string, url: string): Promise<Record<string, string>> {\n return (await this.call<{ headers: Record<string, string> }>(\n \"POST\", sessionPath(id) + \"/headers\", { url })).headers;\n }\n capture(id: string, url: string, setCookie: string[]): Promise<SessionStatus> {\n return this.call(\"POST\", sessionPath(id) + \"/cookies\", { url, set_cookie: setCookie });\n }\n async forget(id: string): Promise<void> { await this.call(\"DELETE\", sessionPath(id)); }\n /** Buffered request with automatic Cookie/Authorization injection and Set-Cookie capture.\n * Resource calls are never automatically retried. Non-2xx upstream statuses are returned. */\n async request(id: string, url: string, options: RequestOptions = {}): Promise<ManagedResponse> {\n if (options.body !== undefined && options.json !== undefined) throw new TypeError(\"Use body or json, not both\");\n const headers = { ...options.headers };\n let body = options.body;\n if (options.json !== undefined) {\n body = JSON.stringify(options.json);\n for (const name of Object.keys(headers)) {\n if (name.toLowerCase() === \"content-type\") delete headers[name];\n }\n headers[\"Content-Type\"] = \"application/json\";\n }\n const bytes = typeof body === \"string\" ? new TextEncoder().encode(body) : body ?? new Uint8Array();\n if (bytes.length > 1024 * 1024) throw new TypeError(\"Request body exceeds 1 MiB\");\n const wire = await this.call<{\n status: number; headers: Record<string, string[]>; body_base64: string; revision: number;\n }>(\"POST\", sessionPath(id) + \"/request\", {\n url, method: options.method ?? \"GET\", headers, body_base64: encode64(bytes),\n });\n return new ManagedResponse(wire.status, wire.headers, decode64(wire.body_base64), wire.revision);\n }\n}\n","import { readFile } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { Config, Effect, Layer } from 'effect';\nimport { Galleton, GalletonError, type Credentials } from './vendor/galleton.js';\nimport { SessionError } from './errors.js';\nimport { Sessions } from './session-service.js';\n\nexport const origin = 'https://www.semrush.com';\nexport const defaultStateDirectory = join(homedir(), '.local', 'share', 'semrush-cli', 'galleton');\n\n/** Raw SDK errors stop here; daemon and upstream payloads never reach diagnostics. */\nconst sdkError = (cause: unknown): SessionError => {\n if (cause instanceof GalletonError) {\n const recovery = cause.code === 'not_found' ? 'Run semrush-cli auth login or semrush-cli auth import --cdp-url URL.' : 'Run semrush-cli daemon start and semrush-cli auth status. Reimport if renewal or authentication failed.';\n return new SessionError({ message: `Galleton ${cause.code}. ${recovery}`, code: cause.code });\n }\n return new SessionError({ message: 'Galleton operation failed. Run semrush-cli doctor and check local configuration.' });\n};\n\nexport const makeSessionsLayer = (credentialOrigin: string) => Layer.effect(Sessions, Effect.gen(function* () {\n const baseURL = yield* Config.String('SEMRUSH_GALLETON_URL').pipe(Config.withDefault('http://127.0.0.1:8768'));\n const tokenFile = yield* Config.String('SEMRUSH_GALLETON_TOKEN_FILE').pipe(Config.withDefault(join(defaultStateDirectory, 'api.token')));\n const id = yield* Config.String('SEMRUSH_SESSION').pipe(Config.withDefault('semrush-cli'));\n const token = yield* Effect.tryPromise({ try: () => readFile(tokenFile, 'utf8'), catch: () => new SessionError({ message: 'Galleton token unavailable. Run semrush-cli setup, or set SEMRUSH_GALLETON_TOKEN_FILE.' }) });\n const sdk = yield* Effect.try({ try: () => new Galleton({ baseURL, token, timeoutMs: 60000 }), catch: sdkError });\n const status = Effect.fn('Sessions.status')(() => Effect.tryPromise({ try: () => sdk.status(id), catch: sdkError }));\n return Sessions.of({\n status,\n headers: Effect.fn('Sessions.headers')(() => Effect.tryPromise({ try: () => sdk.headers(id, credentialOrigin + '/'), catch: sdkError })),\n save: Effect.fn('Sessions.save')(function* (credentials: Credentials) {\n // Replacements are explicit and revision-checked; missing profiles are created.\n const previous = yield* status().pipe(Effect.map(value => value.revision), Effect.catchTag('SessionError', error => error.code === 'not_found' ? Effect.succeed(undefined) : Effect.fail(error)));\n const input = { ...credentials };\n if (previous !== undefined) { input.replace = true; input.expected_revision = previous; }\n return yield* Effect.tryPromise({ try: () => sdk.connect(id, input), catch: sdkError });\n }),\n capture: Effect.fn('Sessions.capture')((cookies: string[]) => Effect.tryPromise({ try: async () => { await sdk.capture(id, credentialOrigin + '/', cookies); }, catch: sdkError })),\n forget: Effect.fn('Sessions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AAsB,OAAO,WAAW;GAAE,KAAK,YAAY;AAAE,UAAM,IAAI,QAAQ,IAAI,mBAAmB,KAAK,QAAQ;;GAAK,OAAO;GAAU,CAAC,CAAC;EACnL,QAAQ,OAAO,GAAG,kBAAkB,OAAO,OAAO,WAAW;GAAE,WAAW,IAAI,OAAO,GAAG;GAAE,OAAO;GAAU,CAAC,CAAC;EAC9G,CAAC;EACF,CAAC;AAEH,MAAa,eAAe,kBAAkB,OAAO"}
1
+ {"version":3,"file":"session-layer-BIL6Umvb.js","names":["code: string","retryAt?: string","status: number","headers: Record<string, string[]>","body: Uint8Array","revision: number","response: Response","text: string","decoded: unknown"],"sources":["../src/session-service.ts","../src/vendor/galleton.ts","../src/session-layer.ts"],"sourcesContent":["import { Context, Effect } from 'effect';\nimport type { Credentials, SessionStatus } from './vendor/galleton.js';\nimport type { SessionError } from './errors.js';\n\n/** Galleton owns all durable credentials. Consumers only receive scoped headers. */\nexport class Sessions extends Context.Service<Sessions, {\n readonly headers: () => Effect.Effect<Record<string, string>, SessionError>;\n readonly status: () => Effect.Effect<SessionStatus, SessionError>;\n readonly save: (credentials: Credentials) => Effect.Effect<SessionStatus, SessionError>;\n readonly capture: (cookies: string[]) => Effect.Effect<void, SessionError>;\n readonly forget: () => Effect.Effect<void, SessionError>;\n}>()('semrush/Sessions') {}\n","/** Server-side client for an authenticated, loopback-only Galleton daemon. */\nexport interface Credentials {\n provider: string;\n cookie_origin?: string;\n cookie_header?: string;\n set_cookies?: string[];\n access_token?: string;\n refresh_token?: string;\n access_expires_at?: string;\n secrets?: Record<string, string>;\n replace?: boolean;\n expected_revision?: number;\n}\nexport interface Problem { code: string; message: string; retry_at?: string }\nexport interface SessionStatus {\n id: string; provider: string; status: string; revision: number;\n created_at: string; last_refresh?: string; next_refresh?: string;\n access_expires_at?: string; cookie_count: number; error?: Problem;\n}\nexport class GalletonError extends Error {\n constructor(public readonly code: string, message: string,\n public readonly status = 0, public readonly retryAt?: string) {\n super(message); this.name = \"GalletonError\";\n }\n}\nexport interface RequestOptions {\n method?: string;\n headers?: Record<string, string>;\n body?: Uint8Array | string;\n json?: unknown;\n}\nexport class ManagedResponse {\n constructor(public readonly status: number,\n public readonly headers: Record<string, string[]>,\n public readonly body: Uint8Array,\n public readonly revision: number) {}\n get ok(): boolean { return this.status >= 200 && this.status < 300; }\n text(): string { return new TextDecoder().decode(this.body); }\n json<T = unknown>(): T { return JSON.parse(this.text()) as T; }\n}\nfunction encode64(bytes: Uint8Array): string {\n let binary = \"\";\n for (let start = 0; start < bytes.length; start += 8192) {\n binary += String.fromCharCode(...bytes.subarray(start, start + 8192));\n }\n return btoa(binary);\n}\nfunction decode64(value: string): Uint8Array {\n return Uint8Array.from(atob(value), char => char.charCodeAt(0));\n}\nfunction sessionPath(id: string): string {\n if (!/^[A-Za-z0-9_-]{1,64}$/.test(id)) throw new TypeError(\"Invalid session ID\");\n return `/v1/sessions/${id}`;\n}\nasync function responseText(response: Response): Promise<string> {\n const reader = response.body?.getReader();\n if (!reader) return \"\";\n const decoder = new TextDecoder();\n let size = 0;\n let text = \"\";\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n size += value.byteLength;\n if (size > 8 * 1024 * 1024) {\n await reader.cancel().catch(() => {});\n throw new GalletonError(\"invalid_response\", \"Oversized daemon response.\", response.status);\n }\n text += decoder.decode(value, { stream: true });\n }\n return text + decoder.decode();\n } finally {\n reader.releaseLock();\n }\n}\nexport class Galleton {\n private readonly base: string;\n private readonly token: string;\n private readonly timeoutMs: number;\n constructor(options: { token: string; baseURL?: string; timeoutMs?: number }) {\n const url = new URL(options.baseURL ?? \"http://127.0.0.1:8766\");\n const host = url.hostname;\n const loopback = host === \"[::1]\" ||\n /^127(?:\\.[0-9]{1,3}){3}$/.test(host) && host.split(\".\").every(n => +n <= 255);\n if (!loopback || url.protocol !== \"http:\" || url.username || url.password ||\n url.search || url.hash || url.pathname !== \"/\") {\n throw new TypeError(\"Galleton requires a literal loopback HTTP origin\");\n }\n this.base = url.origin;\n this.token = options.token.trim();\n if (!this.token || /[\\r\\n]/.test(this.token)) throw new TypeError(\"Invalid local API token\");\n this.timeoutMs = options.timeoutMs ?? 300_000;\n if (!Number.isFinite(this.timeoutMs) || this.timeoutMs <= 0) throw new TypeError(\"Invalid timeout\");\n }\n private async call<T>(method: string, path: string, body?: unknown): Promise<T> {\n let response: Response;\n try {\n response = await fetch(this.base + path, {\n method,\n headers: { Authorization: `Bearer ${this.token}`, \"Content-Type\": \"application/json\" },\n body: body === undefined ? undefined : JSON.stringify(body),\n redirect: \"manual\", signal: AbortSignal.timeout(this.timeoutMs),\n });\n } catch {\n throw new GalletonError(\"daemon_unavailable\", \"Galleton is unavailable or the local request timed out.\");\n }\n let text: string;\n try { text = await responseText(response); }\n catch (error) {\n if (error instanceof GalletonError) throw error;\n throw new GalletonError(\"daemon_unavailable\", \"Galleton response was interrupted; the request may already have completed.\", response.status);\n }\n let decoded: unknown;\n try { decoded = JSON.parse(text); }\n catch {\n if (!response.ok) throw new GalletonError(\"daemon_error\", \"Galleton request failed.\", response.status);\n throw new GalletonError(\"invalid_response\", \"Expected a JSON daemon response.\", response.status);\n }\n if (!response.ok) {\n const error = (decoded as { error?: Problem }).error;\n throw new GalletonError(error?.code ?? \"daemon_error\",\n error?.message ?? \"Galleton request failed.\", response.status, error?.retry_at);\n }\n return decoded as T;\n }\n connect(id: string, credentials: Credentials): Promise<SessionStatus> {\n return this.call(\"PUT\", sessionPath(id), credentials);\n }\n status(id: string): Promise<SessionStatus> { return this.call(\"GET\", sessionPath(id)); }\n async list(): Promise<SessionStatus[]> {\n return (await this.call<{ sessions: SessionStatus[] }>(\"GET\", \"/v1/sessions\")).sessions;\n }\n refresh(id: string): Promise<SessionStatus> { return this.call(\"POST\", sessionPath(id) + \"/refresh\", {}); }\n async headers(id: string, url: string): Promise<Record<string, string>> {\n return (await this.call<{ headers: Record<string, string> }>(\n \"POST\", sessionPath(id) + \"/headers\", { url })).headers;\n }\n capture(id: string, url: string, setCookie: string[]): Promise<SessionStatus> {\n return this.call(\"POST\", sessionPath(id) + \"/cookies\", { url, set_cookie: setCookie });\n }\n async forget(id: string): Promise<void> { await this.call(\"DELETE\", sessionPath(id)); }\n /** Buffered request with automatic Cookie/Authorization injection and Set-Cookie capture.\n * Resource calls are never automatically retried. Non-2xx upstream statuses are returned. */\n async request(id: string, url: string, options: RequestOptions = {}): Promise<ManagedResponse> {\n if (options.body !== undefined && options.json !== undefined) throw new TypeError(\"Use body or json, not both\");\n const headers = { ...options.headers };\n let body = options.body;\n if (options.json !== undefined) {\n body = JSON.stringify(options.json);\n for (const name of Object.keys(headers)) {\n if (name.toLowerCase() === \"content-type\") delete headers[name];\n }\n headers[\"Content-Type\"] = \"application/json\";\n }\n const bytes = typeof body === \"string\" ? new TextEncoder().encode(body) : body ?? new Uint8Array();\n if (bytes.length > 1024 * 1024) throw new TypeError(\"Request body exceeds 1 MiB\");\n const wire = await this.call<{\n status: number; headers: Record<string, string[]>; body_base64: string; revision: number;\n }>(\"POST\", sessionPath(id) + \"/request\", {\n url, method: options.method ?? \"GET\", headers, body_base64: encode64(bytes),\n });\n return new ManagedResponse(wire.status, wire.headers, decode64(wire.body_base64), wire.revision);\n }\n}\n","import { readFile } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { Config, Effect, Layer } from 'effect';\nimport { Galleton, GalletonError, type Credentials } from './vendor/galleton.js';\nimport { SessionError } from './errors.js';\nimport { Sessions } from './session-service.js';\n\nexport const origin = 'https://www.semrush.com';\nexport const defaultStateDirectory = join(homedir(), '.local', 'share', 'semrush-cli', 'galleton');\n\n/** Raw SDK errors stop here; daemon and upstream payloads never reach diagnostics. */\nconst sdkError = (cause: unknown): SessionError => {\n if (cause instanceof GalletonError) {\n const recovery = cause.code === 'not_found' ? 'Run semrush-cli auth login or semrush-cli auth import --cdp-url URL.' : 'Run semrush-cli daemon start and semrush-cli auth status. Reimport if renewal or authentication failed.';\n return new SessionError({ message: `Galleton ${cause.code}. ${recovery}`, code: cause.code });\n }\n return new SessionError({ message: 'Galleton operation failed. Run semrush-cli doctor and check local configuration.' });\n};\n\nexport const makeSessionsLayer = (credentialOrigin: string) => Layer.effect(Sessions, Effect.gen(function* () {\n const baseURL = yield* Config.String('SEMRUSH_GALLETON_URL').pipe(Config.withDefault('http://127.0.0.1:8768'));\n const tokenFile = yield* Config.String('SEMRUSH_GALLETON_TOKEN_FILE').pipe(Config.withDefault(join(defaultStateDirectory, 'api.token')));\n const id = yield* Config.String('SEMRUSH_SESSION').pipe(Config.withDefault('semrush-cli'));\n const token = yield* Effect.tryPromise({ try: () => readFile(tokenFile, 'utf8'), catch: () => new SessionError({ message: 'Galleton token unavailable. Run semrush-cli setup, or set SEMRUSH_GALLETON_TOKEN_FILE.' }) });\n const sdk = yield* Effect.try({ try: () => new Galleton({ baseURL, token, timeoutMs: 60000 }), catch: sdkError });\n const status = Effect.fn('Sessions.status')(() => Effect.tryPromise({ try: () => sdk.status(id), catch: sdkError }));\n return Sessions.of({\n status,\n headers: Effect.fn('Sessions.headers')(() => Effect.tryPromise({ try: () => sdk.headers(id, credentialOrigin + '/'), catch: sdkError })),\n save: Effect.fn('Sessions.save')(function* (credentials: Credentials) {\n // Replacements are explicit and revision-checked; missing profiles are created.\n const previous = yield* status().pipe(Effect.map(value => value.revision), Effect.catchTag('SessionError', error => error.code === 'not_found' ? Effect.succeed(undefined) : Effect.fail(error)));\n const input = { ...credentials };\n if (previous !== undefined) { input.replace = true; input.expected_revision = previous; }\n return yield* Effect.tryPromise({ try: () => sdk.connect(id, input), catch: sdkError });\n }),\n capture: Effect.fn('Sessions.capture')((cookies: string[]) => Effect.tryPromise({ try: async () => { await sdk.capture(id, credentialOrigin + '/', cookies); }, catch: sdkError })),\n forget: Effect.fn('Sessions.forget')(() => Effect.tryPromise({ try: () => sdk.forget(id), catch: sdkError })),\n });\n}));\n\nexport const sessionsLive = makeSessionsLayer(origin);\n"],"mappings":";;;;;;;;AAKA,IA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C;EACnL,QAAQ,OAAO,GAAG,kBAAkB,OAAO,OAAO,WAAW;GAAE,WAAW,IAAI,OAAO,GAAG;GAAE,OAAO;GAAU,CAAC,CAAC;EAC9G,CAAC;EACF,CAAC;AAEH,MAAa,eAAe,kBAAkB,OAAO"}
@@ -1,4 +1,4 @@
1
- import { a as reports, r as UsageError } from "./errors-BhvanypE.js";
1
+ import { r as UsageError, s as reports } from "./errors-CJuwKbEZ.js";
2
2
  import { Effect } from "effect";
3
3
  import { Ajv } from "ajv";
4
4
 
@@ -18,13 +18,15 @@ const parseReport = Effect.fn("Reports.parse")(function* (name, input) {
18
18
  const validate = validators.get(name);
19
19
  const query = structuredClone(input);
20
20
  if (!validate || !validate(query)) return yield* Effect.fail(new UsageError({ message: `Invalid ${name} input: ${ajv.errorsText(validate?.errors)}. Run semrush-cli ${name.replaceAll("_", "-")} --help.` }));
21
+ const definition = reports[name];
22
+ if (definition.mutation && query.confirm !== true && query.dry_run !== true) return yield* Effect.fail(new UsageError({ message: `${name} changes your Semrush account. Use --confirm (MCP confirm:true) to send it, or --dry-run to inspect the request.` }));
21
23
  return {
22
24
  name,
23
- definition: reports[name],
25
+ definition,
24
26
  query
25
27
  };
26
28
  });
27
29
 
28
30
  //#endregion
29
31
  export { parseReport as n, isReportName as t };
30
- //# sourceMappingURL=validation-C_lcBSzX.js.map
32
+ //# sourceMappingURL=validation-BCtts-Al.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-BCtts-Al.js","names":[],"sources":["../src/validation.ts"],"sourcesContent":["import { Ajv } from 'ajv';\nimport { Effect } from 'effect';\nimport { reports, type Query, type ReportName } from './report-parameters.js';\nimport { UsageError } from './errors.js';\n\nconst ajv = new Ajv({ useDefaults: true, allErrors: true, strict: false });\nconst validators = new Map(Object.entries(reports).map(([name, report]) => [name, ajv.compile<Query>(report.schema)]));\nexport function isReportName(name: string): name is ReportName { return Object.hasOwn(reports, name); }\n\n/** Validate once at the public boundary, populate schema defaults, reject unknown keys. */\nexport const parseReport = Effect.fn('Reports.parse')(function* (name: string, input: Query) {\n if (!isReportName(name)) return yield* Effect.fail(new UsageError({ message: `Unknown report: ${name}. Run semrush-cli reports.` }));\n const validate = validators.get(name);\n const query = structuredClone(input);\n if (!validate || !validate(query)) return yield* Effect.fail(new UsageError({ message: `Invalid ${name} input: ${ajv.errorsText(validate?.errors)}. Run semrush-cli ${name.replaceAll('_', '-')} --help.` }));\n const definition = reports[name];\n if (definition.mutation && query.confirm !== true && query.dry_run !== true) return yield* Effect.fail(new UsageError({ message: `${name} changes your Semrush account. Use --confirm (MCP confirm:true) to send it, or --dry-run to inspect the request.` }));\n return { name, definition, query };\n});\n\nexport type ReportRequest = Effect.Success<ReturnType<typeof parseReport>>;\n"],"mappings":";;;;;AAKA,MAAM,MAAM,IAAI,IAAI;CAAE,aAAa;CAAM,WAAW;CAAM,QAAQ;CAAO,CAAC;AAC1E,MAAM,aAAa,IAAI,IAAI,OAAO,QAAQ,QAAQ,CAAC,KAAK,CAAC,MAAM,YAAY,CAAC,MAAM,IAAI,QAAe,OAAO,OAAO,CAAC,CAAC,CAAC;AACtH,SAAgB,aAAa,MAAkC;AAAE,QAAO,OAAO,OAAO,SAAS,KAAK;;;AAGpG,MAAa,cAAc,OAAO,GAAG,gBAAgB,CAAC,WAAW,MAAc,OAAc;AAC3F,KAAI,CAAC,aAAa,KAAK,CAAE,QAAO,OAAO,OAAO,KAAK,IAAI,WAAW,EAAE,SAAS,mBAAmB,KAAK,6BAA6B,CAAC,CAAC;CACpI,MAAM,WAAW,WAAW,IAAI,KAAK;CACrC,MAAM,QAAQ,gBAAgB,MAAM;AACpC,KAAI,CAAC,YAAY,CAAC,SAAS,MAAM,CAAE,QAAO,OAAO,OAAO,KAAK,IAAI,WAAW,EAAE,SAAS,WAAW,KAAK,UAAU,IAAI,WAAW,UAAU,OAAO,CAAC,oBAAoB,KAAK,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC;CAC7M,MAAM,aAAa,QAAQ;AAC3B,KAAI,WAAW,YAAY,MAAM,YAAY,QAAQ,MAAM,YAAY,KAAM,QAAO,OAAO,OAAO,KAAK,IAAI,WAAW,EAAE,SAAS,GAAG,KAAK,mHAAmH,CAAC,CAAC;AAC9P,QAAO;EAAE;EAAM;EAAY;EAAO;EAClC"}
@@ -0,0 +1,4 @@
1
+ import "./errors-CJuwKbEZ.js";
2
+ import { n as parseReport, t as isReportName } from "./validation-BCtts-Al.js";
3
+
4
+ export { isReportName, parseReport };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semrush-cli",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Semrush research from your terminal and MCP clients. TypeScript, Effect, and Galleton.",
5
5
  "type": "module",
6
6
  "bin": {