mcp-scraper 0.89.8 → 0.89.9

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
+ import{a as O,b as y,c as D,d as g,f as A,g as _}from"./chunk-PHBU6X5B.js";import"./chunk-XG6GCEUE.js";import{u as k}from"./chunk-F4LIB772.js";import"./chunk-M5QHXNFZ.js";import{b as f,c as H}from"./chunk-7AC66V3T.js";import{a as m,b}from"./chunk-E4ME7J6G.js";import{a as v}from"./chunk-4FROKQJN.js";import{b as M}from"./chunk-DKQZNSYM.js";import"./chunk-2TZBO52D.js";import"./chunk-2PXP7TMY.js";import{Mb as l,Qb as p,Sb as d,Ua as u,gb as h,ib as c,na as o}from"./chunk-7BEWBRMT.js";var P=2,w=0;function C(e){if(!e||typeof e!="object")return 0;let t=e;return typeof t.totalQuestions=="number"?t.totalQuestions:Array.isArray(t.flat)?t.flat.length:0}function R(e){return m.paa_base+Math.max(1,e)*m.paa}async function N(e){w++;try{let t=typeof e.options=="string"?JSON.parse(e.options):e.options,r={value:null},i=await M({op:t.serpOnly?"serp":"paa",userId:Number(e.user_id),headlessSentOut:r},()=>k({...t,\u006b\u0065\u0072\u006e\u0065\u006cApiKey:v(),headless:!0,format:"json",outputDir:"/tmp/paa-output-api",onAttemptEvent:A(e.id,e.user_id)}));await h(e.id,i);let s=await o(e.id,e.user_id);if(typeof t.billingHoldMc=="number"&&t.billingDebitKey){let n=t.serpOnly?b(r.value):R(C(i));await d(Number(e.user_id),t.billingDebitKey,n,t.serpOnly?"serp_refund":"paa_refund",t.serpOnly?"SERP search settlement":"PAA harvest settlement",t.serpOnly?"serp_search":"paa_harvest")}else if(!t.serpOnly&&typeof t.billingHoldMc=="number"){let n=R(C(i)),a=t.billingHoldMc-n;a>0?await l(e.user_id,a,"paa_refund","overestimate refund"):a<0&&await p(e.user_id,-a,"paa",t.query??e.query)}else if(t.serpOnly&&typeof t.billingHoldMc=="number"){let n=b(r.value),a=t.billingHoldMc-n;a>0?await l(e.user_id,a,"serp_refund","headless-mode pricing settle"):a<0&&await p(e.user_id,-a,"serp",t.query??e.query)}e.callback_url&&await _(e.callback_url,{job_id:e.id,status:"done",result:H(i),attempts:f(s)})}catch(t){console.error("[harvest/worker] failed",{jobId:e.id,error:t instanceof Error?t.message:String(t)});let r=O(t),i=typeof e.options=="string"?JSON.parse(e.options):e.options,s=typeof i.billingHoldMc=="number"&&i.billingHoldMc>0;await c(e.id,y(r),g(r,{chargeStatus:s?"refund_pending":"not_charged"}));let n=await o(e.id,e.user_id);try{s&&(i.billingDebitKey?await d(Number(e.user_id),i.billingDebitKey,0,i.serpOnly?"serp_refund":"paa_refund","failed call",i.serpOnly?"serp_search":"paa_harvest"):await l(e.user_id,i.billingHoldMc,"refund","failed call"),await c(e.id,y(r),g(r,{chargeStatus:"refunded"})))}catch{}e.callback_url&&await _(e.callback_url,{job_id:e.id,status:"failed",...D(r),attempts:f(n)})}finally{w--}}async function x(){let e=await u();if(!e)return{claimed:!1};let t=Date.now();return await N(e),{claimed:!0,jobId:e.id,completed:!0,durationMs:Date.now()-t}}async function W(e){let t=[];for(let r=0;r<e.maxJobs&&!(Date.now()>=e.deadlineMs);r++){let i=await x();if(t.push(i),!i.claimed)break}return t}function B(){setInterval(async()=>{if(w>=P)return;let e=await u();e&&N(e)},2e3),console.log(`[worker] started \u2014 polling every 2s, max ${P} concurrent`)}export{W as drainQueue,B as startWorker,x as tickOnce};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-scraper",
3
- "version": "0.89.8",
3
+ "version": "0.89.9",
4
4
  "description": "MCP server for MCP Scraper web intelligence tools",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -23,110 +23,11 @@
23
23
  "mcp-scraper-install": "dist/bin/mcp-scraper-install.js",
24
24
  "mcp-scraper-cli": "dist/bin/mcp-scraper-cli.js"
25
25
  },
26
- "files": [
27
- "dist/*.js",
28
- "dist/*.cjs",
29
- "dist/*.d.ts",
30
- "dist/*.d.cts",
31
- "dist/bin/*.js",
32
- "dist/editorial-reading-room/assets",
33
- "public/agent-install.md",
34
- "public/.well-known/xray-install.json",
35
- "README.md",
36
- "CHANGELOG.md"
37
- ],
38
- "repository": {
39
- "type": "git",
40
- "url": "git+https://github.com/VilovietaSEO/mcp-scraper.git"
41
- },
42
26
  "homepage": "https://mcpscraper.dev",
43
- "bugs": {
44
- "url": "https://github.com/VilovietaSEO/mcp-scraper/issues"
45
- },
46
- "scripts": {
47
- "build": "tsup",
48
- "build:md": "node scripts/build-md-mirror.mjs",
49
- "build:mcpb": "npm run build && node scripts/build-mcpb.mjs",
50
- "build:mcpb:candidate": "npm run build && node scripts/build-mcpb.mjs --candidate",
51
- "build:rates": "node --import tsx scripts/gen-rates.ts",
52
- "build:geotargets": "node --import tsx scripts/gen-geotargets.ts",
53
- "build:blog": "node scripts/run-ts-sandbox-safe.mjs scripts/build-blog.ts",
54
- "mcp:manifest": "node scripts/run-ts-sandbox-safe.mjs scripts/generate-mcp-tool-manifest.ts",
55
- "contracts:memory": "node --import tsx scripts/generate-memory-tool-contract.ts",
56
- "contracts:memory-governed": "node --import tsx scripts/generate-governed-memory-mcp-schemas.ts",
57
- "verify:crm-authority": "node --import tsx scripts/verify-crm-authority-boundary.ts",
58
- "contracts:openapi": "node --import tsx scripts/generate-personal-assistant-openapi.ts",
59
- "contracts:assistant": "npm run mcp:manifest && npm run contracts:memory && npm run contracts:openapi",
60
- "contracts:assistant:verify": "node --import tsx scripts/verify-personal-assistant-contract.ts",
61
- "contracts:assistant:verify:release": "node --import tsx scripts/verify-personal-assistant-contract.ts --release",
62
- "mcp:memory-image-schemas": "node scripts/generate-memory-image-mcp-schemas.mjs",
63
- "mcp:measure-catalog": "node scripts/run-ts-sandbox-safe.mjs scripts/measure-mcp-catalog.ts",
64
- "mcp:lint-tools": "node scripts/run-ts-sandbox-safe.mjs scripts/lint-mcp-tool-craft.ts",
65
- "mcp:lint-tools:write": "node scripts/run-ts-sandbox-safe.mjs scripts/lint-mcp-tool-craft.ts --write",
66
- "xray:install-contract": "node --import tsx scripts/generate-xray-install-contract.ts",
67
- "xray:install-contract:check": "node --import tsx scripts/generate-xray-install-contract.ts --check",
68
- "api": "node scripts/run-ts-sandbox-safe.mjs bin/api-server.ts",
69
- "dev": "node scripts/run-ts-sandbox-safe.mjs src/cli.ts",
70
- "test": "vitest run tests/unit tests/contract",
71
- "test:live": "vitest run --config vitest.live.config.ts",
72
- "test:site-similarity": "node --import tsx scripts/run-site-similarity-live.ts",
73
- "reanalyze:site-similarity": "node --import tsx scripts/reanalyze-site-similarity-zip.ts",
74
- "test:headless-harvest": "node scripts/run-ts-sandbox-safe.mjs tests/live/harness/headless-harvest-canary.ts",
75
- "test:integration": "node scripts/run-integration-tests.mjs",
76
- "test:smoke": "vitest run tests/smoke",
77
- "test:stripe": "node scripts/stripe-setup-smoke.mjs",
78
- "typecheck": "tsc --noEmit",
79
- "test:kernel": "vitest run tests/integration/kernel.smoke.test.ts",
80
- "sync:env": "bash scripts/push-env.sh",
81
- "sync:env:apply": "bash scripts/push-env.sh --apply",
82
- "locations:publish-geonames": "node --import tsx scripts/publish-geonames-location-data.ts",
83
- "locations:sync": "node --import tsx scripts/sync-hosted-location-data.ts",
84
- "integrations:migrate-scheduler": "node --import tsx scripts/migrate-scheduler-integrations.ts",
85
- "test:webhook": "node scripts/test-webhook.mjs",
86
- "test:e2e": "playwright test",
87
- "email:preview": "node scripts/run-ts-sandbox-safe.mjs scripts/email/render-previews.ts",
88
- "email:preflight": "node --import tsx scripts/email/preflight.ts",
89
- "email:avatar": "node --import tsx scripts/email/generate-sender-avatar.ts",
90
- "email:inbound:setup": "node --import tsx scripts/email/setup-resend-inbound.ts",
91
- "email:audience": "node scripts/run-ts-sandbox-safe.mjs scripts/email/sync-resend-audience.ts",
92
- "email:drafts": "node scripts/run-ts-sandbox-safe.mjs scripts/email/create-resend-drafts.ts",
93
- "email:workshop-reminders": "node --import tsx scripts/email/refresh-workshop-reminders.ts",
94
- "email:workshop-reminders:apply": "node --import tsx scripts/email/refresh-workshop-reminders.ts --apply",
95
- "billing:preview-credit-lot-repair": "node --import tsx scripts/billing/preview-credit-lot-repair.ts",
96
- "billing:apply-credit-lot-repair": "node --import tsx scripts/billing/apply-credit-lot-repair.ts",
97
- "brightdata:usage": "node scripts/brightdata-usage-report.mjs",
98
- "brightdata:test:bandwidth": "node --import tsx scripts/brightdata-paa-bandwidth-test.ts",
99
- "db:migrate": "node --import tsx scripts/run-core-migration.ts",
100
- "db:verify": "node --import tsx scripts/verify-core-schema.ts",
101
- "release:server:predeploy": "npm run db:migrate && npm run db:verify && npm run version:check:core",
102
- "oauth-store:migrate": "node --import tsx scripts/migrate-oauth-store.ts --apply-schema",
103
- "oauth-store:verify": "node --import tsx scripts/migrate-oauth-store.ts --verify",
104
- "oauth-store:test": "vitest run tests/unit/oauth-store.test.ts",
105
- "oauth-store:test-remote": "OAUTH_STORE_REMOTE_REQUIRED=1 vitest run --config vitest.live.config.ts tests/live/oauth-store-remote.live.test.ts",
106
- "oauth:prepare-production-canary": "node --import tsx scripts/prepare-mcp-oauth-production-canary.ts",
107
- "oauth:verify-live": "node scripts/verify-mcp-oauth-live.mjs",
108
- "analytics:migrate": "node --import tsx scripts/run-analytics-migration.ts",
109
- "analytics:contract": "node --import tsx scripts/analytics/export-analytics-rest-contract.ts",
110
- "analytics:contract:check": "node --import tsx scripts/analytics/export-analytics-rest-contract.ts --check",
111
- "assistant:migrate": "node --import tsx scripts/run-personal-assistant-migration.ts",
112
- "assistant:schema:verify": "vitest run tests/unit/personal-assistant-db.test.ts tests/unit/personal-assistant-production-stores.test.ts tests/integration/personal-assistant-db.test.ts",
113
- "assistant:deployment:preflight": "node --import tsx scripts/verify-personal-assistant-deployment-config.ts",
114
- "analytics:rollups": "node --import tsx scripts/run-analytics-rollups.ts",
115
- "test:mcp-output-contract": "vitest run --config vitest.mcp-output-contract.config.ts tests/unit/golden-payloads.test.ts tests/unit/mcp-formatter-structured.test.ts tests/unit/mcp-2026-stdio.test.ts",
116
- "version:check": "node scripts/verify-release-version-sync.mjs",
117
- "version:check:core": "node scripts/verify-release-version-sync.mjs --core",
118
- "prebuild": "npm run version:check:core",
119
- "mcp:verify": "npm run xray:install-contract:check && npm run build && npm run mcp:manifest && npm run version:check && npm run build:rates && npm run mcp:measure-catalog && npm run mcp:lint-tools && npm run test:mcp-output-contract && npm run typecheck && npm test && npm run package:verify-entrypoints",
120
- "prepack": "npm run mcp:verify",
121
- "package:verify-entrypoints": "node scripts/verify-package-entrypoints.mjs",
122
- "product:install": "node scripts/run-product-command.mjs install",
123
- "product:build": "node scripts/run-product-command.mjs build",
124
- "product:typecheck": "node scripts/run-product-command.mjs typecheck",
125
- "product:test": "node scripts/run-product-command.mjs test",
126
- "product:verify-layout": "node scripts/verify-product-repository-layout.mjs",
127
- "package:public": "npm run mcp:verify && node scripts/build-public-package.mjs",
128
- "prepublishOnly": "node -e \"throw new Error('Publish the verified archive produced by npm run package:public')\""
27
+ "engines": {
28
+ "node": ">=20.18.1"
129
29
  },
30
+ "license": "ISC",
130
31
  "dependencies": {
131
32
  "@anthropic-ai/sdk": "^0.96.0",
132
33
  "@fal-ai/client": "^1.10.1",
@@ -165,38 +66,17 @@
165
66
  "youtube-transcript": "^1.3.1",
166
67
  "zod": "4.4.3"
167
68
  },
168
- "devDependencies": {
169
- "@onkernel/cli": "^0.19.2",
170
- "@playwright/test": "^1.60.0",
171
- "@types/better-sqlite3": "^7.6.13",
172
- "@types/jsdom": "^28.0.3",
173
- "@types/node": "^20.0.0",
174
- "@types/papaparse": "^5.3.0",
175
- "@types/pg": "^8.23.1",
176
- "@types/turndown": "^5.0.6",
177
- "@types/yauzl": "^2.10.3",
178
- "axe-core": "^4.13.0",
179
- "better-sqlite3": "^12.9.0",
180
- "bgutils-js": "^3.2.0",
181
- "dotenv": "^17.4.2",
182
- "esbuild": "^0.27.7",
183
- "fflate": "^0.7.4",
184
- "jsdom": "^29.1.1",
185
- "tsup": "^8.0.0",
186
- "tsx": "^4.0.0",
187
- "typescript": "^5.4.0",
188
- "vitest": "^1.6.0",
189
- "youtubei.js": "^17.0.1",
190
- "@onkernel/sdk": "^0.93.0"
191
- },
192
- "engines": {
193
- "node": ">=20.18.1"
194
- },
195
- "directories": {
196
- "doc": "docs",
197
- "test": "tests"
198
- },
199
- "keywords": [],
200
- "author": "",
201
- "license": "ISC"
69
+ "files": [
70
+ "dist/*.js",
71
+ "dist/*.cjs",
72
+ "dist/*.d.ts",
73
+ "dist/*.d.cts",
74
+ "dist/bin/*.js",
75
+ "dist/editorial-reading-room/assets",
76
+ "public/agent-install.md",
77
+ "public/.well-known/xray-install.json",
78
+ "README.md",
79
+ "CHANGELOG.md",
80
+ "THIRD_PARTY_NOTICES.html"
81
+ ]
202
82
  }
@@ -1 +0,0 @@
1
- function M(E,t=!1){let _=t?3e4:4e5,e=Math.min(_+15e3,795e3);return{serverMs:_,clientMs:e}}export{M as a};
@@ -1 +0,0 @@
1
- var o="0.89.8";export{o as a};
@@ -1 +0,0 @@
1
- import{a as O,b as y,c as D,d as g,f as A,g as _}from"./chunk-PHBU6X5B.js";import"./chunk-XG6GCEUE.js";import{u as k}from"./chunk-KX72IORC.js";import"./chunk-M5QHXNFZ.js";import{b as f,c as H}from"./chunk-7AC66V3T.js";import{a as m,b}from"./chunk-E4ME7J6G.js";import{a as v}from"./chunk-4FROKQJN.js";import{b as M}from"./chunk-DKQZNSYM.js";import"./chunk-2TZBO52D.js";import"./chunk-MM6QBDPC.js";import{Mb as l,Qb as p,Sb as d,Ua as u,gb as h,ib as c,na as o}from"./chunk-7BEWBRMT.js";var P=2,w=0;function C(e){if(!e||typeof e!="object")return 0;let t=e;return typeof t.totalQuestions=="number"?t.totalQuestions:Array.isArray(t.flat)?t.flat.length:0}function R(e){return m.paa_base+Math.max(1,e)*m.paa}async function N(e){w++;try{let t=typeof e.options=="string"?JSON.parse(e.options):e.options,r={value:null},i=await M({op:t.serpOnly?"serp":"paa",userId:Number(e.user_id),headlessSentOut:r},()=>k({...t,kernelApiKey:v(),headless:!0,format:"json",outputDir:"/tmp/paa-output-api",onAttemptEvent:A(e.id,e.user_id)}));await h(e.id,i);let s=await o(e.id,e.user_id);if(typeof t.billingHoldMc=="number"&&t.billingDebitKey){let n=t.serpOnly?b(r.value):R(C(i));await d(Number(e.user_id),t.billingDebitKey,n,t.serpOnly?"serp_refund":"paa_refund",t.serpOnly?"SERP search settlement":"PAA harvest settlement",t.serpOnly?"serp_search":"paa_harvest")}else if(!t.serpOnly&&typeof t.billingHoldMc=="number"){let n=R(C(i)),a=t.billingHoldMc-n;a>0?await l(e.user_id,a,"paa_refund","overestimate refund"):a<0&&await p(e.user_id,-a,"paa",t.query??e.query)}else if(t.serpOnly&&typeof t.billingHoldMc=="number"){let n=b(r.value),a=t.billingHoldMc-n;a>0?await l(e.user_id,a,"serp_refund","headless-mode pricing settle"):a<0&&await p(e.user_id,-a,"serp",t.query??e.query)}e.callback_url&&await _(e.callback_url,{job_id:e.id,status:"done",result:H(i),attempts:f(s)})}catch(t){console.error("[harvest/worker] failed",{jobId:e.id,error:t instanceof Error?t.message:String(t)});let r=O(t),i=typeof e.options=="string"?JSON.parse(e.options):e.options,s=typeof i.billingHoldMc=="number"&&i.billingHoldMc>0;await c(e.id,y(r),g(r,{chargeStatus:s?"refund_pending":"not_charged"}));let n=await o(e.id,e.user_id);try{s&&(i.billingDebitKey?await d(Number(e.user_id),i.billingDebitKey,0,i.serpOnly?"serp_refund":"paa_refund","failed call",i.serpOnly?"serp_search":"paa_harvest"):await l(e.user_id,i.billingHoldMc,"refund","failed call"),await c(e.id,y(r),g(r,{chargeStatus:"refunded"})))}catch{}e.callback_url&&await _(e.callback_url,{job_id:e.id,status:"failed",...D(r),attempts:f(n)})}finally{w--}}async function x(){let e=await u();if(!e)return{claimed:!1};let t=Date.now();return await N(e),{claimed:!0,jobId:e.id,completed:!0,durationMs:Date.now()-t}}async function W(e){let t=[];for(let r=0;r<e.maxJobs&&!(Date.now()>=e.deadlineMs);r++){let i=await x();if(t.push(i),!i.claimed)break}return t}function B(){setInterval(async()=>{if(w>=P)return;let e=await u();e&&N(e)},2e3),console.log(`[worker] started \u2014 polling every 2s, max ${P} concurrent`)}export{W as drainQueue,B as startWorker,x as tickOnce};