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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser-layer-D6mEyv9Y.js","names":["browser","payload: Schema.JsonObject","get","payload","options: RequestInit","extraHeaders","path","reportData: Schema.Json | undefined","extra: Record<string, string>","request"],"sources":["../src/browser-layer.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { Config, Effect, Layer, Option, Semaphore, Schema, Predicate } from 'effect';\nimport { chromium, type BrowserContext, type Page } from 'patchright';\nimport JSONbig from 'json-bigint';\nimport { Semrush } from './browser-service.js';\nimport { Sessions } from './session-service.js';\nimport { origin } from './session-layer.js';\nimport { ReportError, SessionError } from './errors.js';\nimport { reportParameters, type Query } from './report-parameters.js';\nimport type { ReportRequest } from './validation.js';\n\nconst transportPaths = new Map([['domain', '/dpa/rpc'], ['direct', '/dpa/rpc'], ['magic', '/kmtgw/v2/webapi'], ['keyword', '/kwogw/v2/webapi']]);\nconst json = JSONbig({ storeAsString: true, protoAction: 'error', constructorAction: 'error' });\nconst safeBrowserError = () => new ReportError({ message: 'Semrush browser request failed. Run semrush-cli doctor. If your session expired, sign in again with semrush-cli auth login.' });\nconst browserCall = <A>(run: () => Promise<A>) => Effect.tryPromise({ try: run, catch: safeBrowserError });\nconst objectValue = (value: Schema.Json | undefined): value is Schema.JsonObject => Predicate.isObject(value) && !Array.isArray(value);\n\n/** JSON never passes through the browser's number parser, preserving 64-bit IDs. */\nexport function parseWire(text: string): Schema.Json { return Schema.decodeUnknownSync(Schema.Json)(json.parse(text)); }\n\n/** Remove credential fields and echoed secrets, including nested provider errors. */\nexport function redact(value: Schema.Json, secrets: string[]): Schema.Json {\n if (Array.isArray(value)) return value.map(item => redact(item, secrets));\n if (objectValue(value)) return Object.fromEntries(Object.entries(value).filter(([key]) => !/^(api_?key|key|user_?id|access_token|refresh_token|authorization|cookie|set-cookie)$/i.test(key)).map(([key, item]) => [key, redact(item, secrets)]));\n if (Predicate.isString(value)) return secrets.filter(secret => secret.length > 0).reduce((text, secret) => text.replaceAll(secret, '[redacted]'), value);\n return value;\n}\n\nexport const makeSemrushLayer = (browserOrigin: string) => Layer.effect(Semrush, Effect.gen(function* () {\n const sessions = yield* Sessions;\n const executable = yield* Config.option(Config.String('SEMRUSH_BROWSER_EXECUTABLE'));\n const headers = yield* sessions.headers();\n const browser = yield* Effect.acquireRelease(browserCall(() => chromium.launch({ headless: true, executablePath: Option.getOrUndefined(executable) })), browser => Effect.promise(() => browser.close()));\n const context = yield* browserCall(() => browser.newContext({ userAgent: 'OpenAI File Downloader, XaiImageApiFetch/1.0' }));\n const cookieHeader = headers.Cookie ?? headers.cookie ?? '';\n yield* browserCall(() => context.addCookies(cookieHeader.split(';').filter(cookie => cookie.includes('=')).map(cookie => {\n const separator = cookie.indexOf('=');\n return { name: cookie.slice(0, separator).trim(), value: cookie.slice(separator + 1).trim(), url: browserOrigin, httpOnly: true, secure: browserOrigin.startsWith('https:'), sameSite: 'Lax' as const };\n })));\n const page = yield* browserCall(() => context.newPage());\n yield* browserCall(() => page.goto(browserOrigin + '/robots.txt', { waitUntil: 'domcontentloaded', timeout: 45000 }));\n const bootstrap = yield* browserCall(() => page.evaluate(async () => {\n const response = await fetch('/analytics/overview/?db=us', { credentials: 'include', signal: AbortSignal.timeout(45000) });\n return { status: response.status, text: response.ok ? await response.text() : '' };\n }));\n // Extract the JSON value with a balanced scanner, never eval page-owned JavaScript.\n const auth = yield* Effect.try({ try: () => readBootstrap(bootstrap.text), catch: () => new SessionError({ message: 'Semrush sign-in metadata unavailable. Run semrush-cli auth login or import a signed-in browser.' }) });\n const semaphore = yield* Semaphore.make(1);\n let spectrumToken = '';\n const request = Effect.fn('Semrush.request')(function* (path: string, payload: Query, get = false, extraHeaders: Record<string, string> = {}) {\n const wire = yield* browserCall(() => page.evaluate(async ({ path, encodedPayload, get, extraHeaders }) => {\n const payload: Schema.JsonObject = JSON.parse(encodedPayload);\n const query = new URLSearchParams();\n if (get) for (const [key, value] of Object.entries(payload)) for (const item of Array.isArray(value) ? value : [value]) query.append(key, String(item));\n const options: RequestInit = { method: get ? 'GET' : 'POST', credentials: 'include', headers: extraHeaders, signal: AbortSignal.timeout(45000) };\n if (!get) { options.headers = { ...extraHeaders, 'Content-Type': 'application/json' }; options.body = JSON.stringify(payload); }\n const response = await fetch(get ? path + '?' + query : path, options);\n return { status: response.status, text: response.ok ? await response.text() : '' };\n }, { path, encodedPayload: JSON.stringify(payload), get, extraHeaders }));\n if (wire.status !== 200) return yield* Effect.fail(new ReportError({ message: `Semrush report returned HTTP ${wire.status}. Check your session and account permissions.` }));\n const body = yield* Effect.try({ try: () => parseWire(wire.text), catch: () => new ReportError({ message: 'Semrush returned a page or challenge instead of JSON. Sign in again or retry later.' }) });\n if (objectValue(body) && ('error' in body || ('status' in body && !(body.status === null || body.status === 'SUCCESS' || body.status === 'success')))) return yield* Effect.fail(new ReportError({ message: `Semrush report failed: ${JSON.stringify(redact(body.error ?? body.status ?? null, [auth.apiKey, spectrumToken, spectrumToken.replace(/^Bearer /, '')])).slice(0, 500)}` }));\n return body;\n });\n const rpc = Effect.fn('Semrush.rpc')(function* (method: string, params: Query, transport = 'keyword', webReport = 'domain.overview') {\n const payload = transport === 'domain' ? { request_id: randomUUID(), report: webReport, args: params, ...auth } : transport === 'direct' ? { ...params, ...auth } : params;\n const body = yield* request(transportPaths.get(transport) ?? '/kwogw/v2/webapi', { id: 1, jsonrpc: '2.0', method, params: payload });\n if (!objectValue(body) || !('result' in body)) return yield* Effect.fail(new ReportError({ message: `Semrush ${method}: missing report result.` }));\n return body.result ?? null;\n });\n const report = Effect.fn('Semrush.report')(function* ({ name, definition, query }: ReportRequest) {\n const valid = yield* browserCall(() => page.evaluate(async () => {\n const response = await fetch('/home/', { method: 'HEAD', credentials: 'include', cache: 'no-store', signal: AbortSignal.timeout(15000) });\n return response.ok && new URL(response.url).pathname === '/home/';\n }));\n if (!valid) return yield* Effect.fail(new SessionError({ message: 'Semrush session expired. Run semrush-cli auth login or import a signed-in browser.' }));\n const params = reportParameters(definition, query);\n const family = definition.transport;\n let reportData: Schema.Json | undefined;\n if (['keyword', 'domain', 'direct', 'magic'].includes(family)) reportData = yield* rpc(definition.method, params, family, definition.web_report);\n else {\n const extra: Record<string, string> = {};\n if (family === 'gap') {\n if (!spectrumToken) spectrumToken = yield* browserCall(() => observeSpectrum(page, browserOrigin));\n Object.assign(extra, { authorization: spectrumToken, 'x-report': 'gap.keywords', 'x-request-id': randomUUID() });\n }\n let path = definition.method;\n if (family.startsWith('backlink')) {\n path = '/analytics/backlinks/webapi2/';\n params.key = auth.apiKey;\n if (family === 'backlink_overview') {\n path += 'overview/' + definition.method;\n extra['x-request-id'] = randomUUID();\n yield* request('/analytics/backlinks/webapi2/overview/init', params, true, extra);\n }\n } else if (path.startsWith('/siteaudit/')) params.key = auth.apiKey;\n reportData = yield* request(path, params, !['post', 'gap', 'projects'].includes(family), extra);\n }\n if (definition.total_method) {\n const totalParams = name === 'domain_position_changes' ? Object.fromEntries(Object.entries(params).filter(([key]) => key !== 'display')) : params;\n const total = yield* rpc(definition.total_method, totalParams, 'domain', definition.web_report);\n reportData = { rows: reportData, total, page: query.page ?? null, page_size: query.page_size ?? null };\n }\n if (name === 'keyword_overview') {\n const rows = objectValue(reportData) ? reportData.keywords : undefined;\n reportData = Array.isArray(rows) ? rows.find(item => objectValue(item) && item.database === query.database) : undefined;\n if (!reportData) return yield* Effect.fail(new ReportError({ message: 'No keyword data for the selected database.' }));\n } else if (name === 'domain_overview') {\n const search = Array.isArray(reportData) ? reportData.find(item => objectValue(item) && item.database === query.database) : undefined;\n if (!search) return yield* Effect.fail(new ReportError({ message: 'No domain data for the selected database.' }));\n reportData = { search, backlinks: yield* rpc('backlinks.Summary', { searchItem: query.domain ?? null, searchType: 'domain' }, 'domain') };\n }\n if (Predicate.isNumber(query.limit) && Array.isArray(reportData)) reportData = reportData.slice(0, query.limit);\n yield* captureCookies(context, sessions.capture, browserOrigin);\n return { authenticated: true as const, report: name, data: redact(reportData ?? null, [auth.apiKey, spectrumToken, spectrumToken.replace(/^Bearer /, '')]) };\n });\n return Semrush.of({ report: request => semaphore.withPermits(1)(report(request)) });\n}));\n\nexport const semrushLive = makeSemrushLayer(origin);\n\ninterface BootstrapAuth { readonly apiKey: string; readonly userId: string | number; }\nexport function readBootstrap(html: string): BootstrapAuth {\n const match = /window\\.sm2\\.user\\s*=\\s*/.exec(html);\n if (!match) throw new Error('No bootstrap');\n const start = match.index + match[0].length;\n let depth = 0, quoted = false, escaped = false;\n for (let index = start; index < html.length; index++) {\n const char = html[index];\n if (quoted) {\n if (escaped) escaped = false;\n else if (char === '\\\\') escaped = true;\n else if (char === '\"') quoted = false;\n } else if (char === '\"') quoted = true;\n else if (char === '{') depth++;\n else if (char === '}' && --depth === 0) {\n const user = parseWire(html.slice(start, index + 1));\n if (objectValue(user) && Predicate.isString(user.api_key) && (Predicate.isString(user.id) || Predicate.isNumber(user.id))) return { apiKey: user.api_key, userId: user.id };\n break;\n }\n }\n throw new Error('Invalid bootstrap');\n}\n\nasync function observeSpectrum(page: Page, browserOrigin: string): Promise<string> {\n try {\n // Observe and navigate together so either timeout is handled immediately.\n const [observed] = await Promise.all([\n page.waitForRequest(request => request.url().startsWith(browserOrigin + '/spectrum/') && Boolean(request.headers().authorization), { timeout: 20000 }),\n page.goto(browserOrigin + '/analytics/keywordgap/?db=us', { waitUntil: 'domcontentloaded', timeout: 45000 }),\n ]);\n return observed.headers().authorization ?? '';\n } finally {\n await page.goto(browserOrigin + '/robots.txt', { waitUntil: 'domcontentloaded', timeout: 45000 });\n }\n}\n\nconst captureCookies = Effect.fn('Semrush.captureCookies')(function* (context: BrowserContext, capture: (cookies: string[]) => Effect.Effect<void, SessionError>, cookieOrigin: string) {\n const cookies = yield* browserCall(() => context.cookies(cookieOrigin));\n yield* capture(cookies.map(cookie => `${cookie.name}=${cookie.value}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AK,EAAC,aAAa,GAAG,KAAK,CAAC;EACjR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors-BhvanypE.js","names":["packageInfo.version","catalog","filters: Query","params: Query"],"sources":["../package.json","../src/report-catalog.json","../src/report-parameters.ts","../src/errors.ts"],"sourcesContent":["{\n \"name\": \"semrush-cli\",\n \"version\": \"0.1.1\",\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 }\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 === '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","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;EACF;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;EACF;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;EACF;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;EACF;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;EACF;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,WAAW;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,UACD;GACD,SAAS;GACT,QAAQ;GACT;EACF;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;EACF;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,QAAQ;KACN,WAAW;KACX,eAAe;KACf,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,cA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ACD,YAAY;KACV,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,QAAQ;KACN,SAAS,CACP;MACE,WAAW;MACX,QAAQ;MACT,EACD,EACE,QAAQ,QACT,CACF;KACD,WAAW;KACX,eAAe;KACf,SAAS;KACV;IACD,eAAe;KACb,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,aAAa;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,QAAQ;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,aAAa;KACX,WAAW;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,cAAc;KACZ,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,cAAc;KACZ,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,WAAW;KACT,wBAAwB;KACxB,eAAe;KACf,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACF;eACe;EACd,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,QAAQ;KACN,SAAS,CACP;MACE,WAAW;MACX,QAAQ;MACT,EACD,EACE,QAAQ,QACT,CACF;KACD,WAAW;KACX,eAAe;KACf,SAAS;KACV;IACD,eAAe;KACb,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,aAAa;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,QAAQ;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACD,aAAa;KACX,WAAW;KACX,WAAW;KACX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AS;KACT,QAAQ;KACT;IACD,aAAa;KACX,WAAW;KACX,WAAW;KACX,WAAW;KACX,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;EACF;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;EACF;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;EACF;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;EACF;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;EACF;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;EACF;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;EACF;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;EACF;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;EACF;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;EACF;YACY;EACX,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc,EAAE;GAChB,SAAS;GACT,QAAQ;GACT;EACF;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;KACT,QAAQ;KACT;IACD,eAAe;KACb,WAAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,SAAS;GACT,QAAQ;GACT;EACF;qBACqB;EACpB,UAAU;EACV,eAAe;EACf,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,UAAU;GACR,wBAAwB;GACxB,cAAc,EACZ,YAAY;IACV,WAAW;IACX,WAAW;IACX,SAAS;IACT,QAAQ;IACT,EACF;GACD,SAAS;GACT,QAAQ;GACT;EACF;iBACiB;EAChB,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AAW;KACX,SAAS;KACT,QAAQ;KACT;IACF;GACD,YAAY,CACV,SACD;GACD,SAAS;GACT,QAAQ;GACT;EACF;uBACuB;EACtB,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;EACF;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;IACD,WAAW;KACT,WAAW;KACX,eAAe;KACf,SAAS;KACT,QAAQ;KACT;IACD,QAAQ;KACN,WAAW;KACX,eAAe;KACf,WAAW;KACX,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;EACF;mBACmB;EAClB,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;IACD,WAAW;KACT,WAAW;KACX,eAAe;KACf,SAAS;KACT,QAAQ;KACT;IACD,QAAQ;KACN,WAAW;KACX,eAAe;KACf,WAAW;KACX,S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AE,CAAC,CAAC;AACvJ,IAAa,cAAb,cAAiC,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 +0,0 @@
1
- {"version":3,"file":"mcp-Cuzenjra.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 } 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: true, destructiveHint: false, 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 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;GAAM,iBAAiB;GAAO,eAAe;GAAM;EAAE,EAAE,EAAE,EAAE;AACrR,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,CAAC,CAAC;IAE9O;EACF,MAAM,YAAY,MAAM,OAAO,WAAW,QAAQ,KAAK,OAAO,MAAM;GAAE,YAAW,WAAU;IAAE,IAAI;IAAe;IAAO;GAAG,YAAW,WAAU;IAAE,IAAI;IAAgB,SAAS,MAAM;IAAS;GAAG,CAAC,CAAC,CAAC;AACnM,MAAI,CAAC,UAAU,GAAI,QAAO;GAAE,SAAS;GAAM,SAAS,CAAC;IAAE,MAAM;IAAQ,MAAM,UAAU;IAAS,CAAC;GAAE;EACjG,MAAM,UAAU,MAAM,QAAQ,WAAW,OAAO,IAAI,aAAa;AAC/D,UAAO,QAAQ,OAAO,SAAS,OAAO,UAAU,MAAM;IACtD,CAAC,KAAK,OAAO,MAAM;GAAE,YAAW,WAAU;IAAE,IAAI;IAAe,MAAM,KAAK,UAAU,MAAM;IAAE;GAAG,YAAW,WAAU;IAAE,IAAI;IAAgB,MAAM,MAAM;IAAS;GAAG,CAAC,CAAC,CAAC,CAAC,aAAa;GAAE,IAAI;GAAgB,MAAM;GAAmG,EAAE;AACtT,SAAO;GAAE,SAAS,CAAC,QAAQ;GAAI,SAAS,CAAC;IAAE,MAAM;IAAQ,MAAM,QAAQ;IAAM,CAAC;GAAE;GAChF;CACF,IAAI,UAAU;CACd,MAAM,QAAQ,YAAY;AAAE,MAAI,QAAS;AAAQ,YAAU;AAAM,QAAM,QAAQ,SAAS;AAAE,QAAM,OAAO,OAAO;;AAC9G,QAAO,gBAAgB;AAAE,EAAK,OAAO;;AACrC,SAAQ,KAAK,gBAAgB;AAAE,EAAK,OAAO;GAAI;AAC/C,SAAQ,KAAK,iBAAiB;AAAE,EAAK,OAAO;GAAI;AAChD,OAAM,OAAO,QAAQ,IAAI,sBAAsB,CAAC"}
@@ -1,4 +0,0 @@
1
- import "./errors-BhvanypE.js";
2
- import { n as parseReport, t as isReportName } from "./validation-C_lcBSzX.js";
3
-
4
- export { isReportName, parseReport };
@@ -1 +0,0 @@
1
- {"version":3,"file":"validation-C_lcBSzX.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 return { name, definition: reports[name], 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;AAC7M,QAAO;EAAE;EAAM,YAAY,QAAQ;EAAO;EAAO;EACjD"}