mcp-scraper 0.97.0 → 0.97.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/README.md +1 -1
  3. package/dist/actions-5X5CQAKO.js +1 -0
  4. package/dist/bin/api-server.js +1 -1
  5. package/dist/bin/mcp-scraper-cli.js +1 -1
  6. package/dist/bin/mcp-scraper-core.js +1 -1
  7. package/dist/bin/mcp-scraper-install.js +1 -1
  8. package/dist/bin/mcp-stdio-server.js +1 -1
  9. package/dist/bin/paa-harvest.js +1 -1
  10. package/dist/bundle-GS657HXG.js +1 -0
  11. package/dist/chunk-2L7CHN5N.js +4 -0
  12. package/dist/{chunk-4P3LZNVA.js → chunk-4AEW53RU.js} +145 -145
  13. package/dist/{chunk-U3NV72AL.js → chunk-4YZ74SJ6.js} +1 -8
  14. package/dist/{chunk-AMYPXA2F.js → chunk-5RQWFYXY.js} +74 -74
  15. package/dist/{chunk-PD7BI7TR.js → chunk-5TQINRZN.js} +1 -1
  16. package/dist/{chunk-Z4EHBBL4.js → chunk-5UQAL7HV.js} +1 -1
  17. package/dist/{chunk-GLCR4KJI.js → chunk-6D25Q5BR.js} +20 -14
  18. package/dist/chunk-C3JWX6KM.js +10 -0
  19. package/dist/{chunk-NULRGHJ4.js → chunk-F3M7INSN.js} +7 -7
  20. package/dist/chunk-FLAWC5PF.js +5 -0
  21. package/dist/{chunk-PQRT4T2G.js → chunk-FM7BX2LU.js} +1 -1
  22. package/dist/chunk-IPQOBOFY.js +1 -0
  23. package/dist/chunk-J7XDXIB6.js +163 -0
  24. package/dist/chunk-JHDD6R3O.js +8 -0
  25. package/dist/chunk-KBZY2OGP.js +11 -0
  26. package/dist/{chunk-JNPM3U3L.js → chunk-NQFTETVC.js} +1 -1
  27. package/dist/{chunk-A4UASMEQ.js → chunk-P6CDR3RM.js} +1 -1
  28. package/dist/chunk-QCBCOEH5.js +1 -0
  29. package/dist/chunk-SJNSTO3C.js +42 -0
  30. package/dist/{chunk-MVMWPKRC.js → chunk-TZYITYL4.js} +1 -1
  31. package/dist/{chunk-YJPFEL2E.js → chunk-UUJYICAJ.js} +1 -1
  32. package/dist/{chunk-OSKCHEVM.js → chunk-XNTAHMPA.js} +1 -1
  33. package/dist/{chunk-ND4WIBXT.js → chunk-ZDECILF6.js} +1 -1
  34. package/dist/{chunk-OOB3RKWD.js → chunk-ZNPGM3XE.js} +1 -1
  35. package/dist/compatibility-UPPKZ4KY.js +1 -0
  36. package/dist/direct-completion-ZVPPEBDU.js +1 -0
  37. package/dist/dispatch-GRMMPKQD.js +1 -0
  38. package/dist/index.cjs +34 -34
  39. package/dist/index.js +1 -1
  40. package/dist/jobs-NRZHGQ7I.js +1 -0
  41. package/dist/queue-2VKW7SGH.js +1 -0
  42. package/dist/reconciliation-QC6SILLR.js +1 -0
  43. package/dist/{report-artifact-offload-6OOY2PTM.js → report-artifact-offload-PQNFDNPL.js} +1 -1
  44. package/dist/{server-6HUBN3OR.js → server-EYMJROPX.js} +530 -533
  45. package/dist/settlement-47EUTSGX.js +1 -0
  46. package/dist/vendor-errors-647LSH6H.js +1 -0
  47. package/dist/worker-AWJF7UYR.js +1 -0
  48. package/package.json +1 -1
  49. package/dist/actions-NCZNPYEY.js +0 -1
  50. package/dist/bundle-XR6XKYJM.js +0 -1
  51. package/dist/chunk-63VWBMYR.js +0 -3
  52. package/dist/chunk-6FAMBNHY.js +0 -1
  53. package/dist/chunk-M5QHXNFZ.js +0 -10
  54. package/dist/chunk-U4WIJZCX.js +0 -1
  55. package/dist/chunk-WHVK6FUB.js +0 -11
  56. package/dist/chunk-XYUJTIPE.js +0 -203
  57. package/dist/dispatch-ILBBKOSW.js +0 -1
  58. package/dist/queue-VOGXQDPR.js +0 -1
  59. package/dist/reconciliation-OXBG7JA2.js +0 -1
  60. package/dist/settlement-3PS32LQO.js +0 -1
  61. package/dist/worker-NXRU3TT3.js +0 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ All notable changes to MCP Scraper are documented here. The format is based on [
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.97.1] - 2026-10-15
8
+
9
+ ### Fixed
10
+
11
+ - Keep upstream identities, session identifiers and service diagnostics out of public job and Maps responses and generated clients.
12
+ - Refund failed browser requests after an explicit connection rejection, and safely recover original holds without repeating work or issuing duplicate refunds.
13
+ - Recover failed search holds across supported search methods. Preserve uncertain connection outcomes for reconciliation.
14
+ - Mark Maps runs partial when requested fields are unavailable, and omit unsupported verification-challenge claims from failure summaries.
15
+
16
+ - Restore native background execution after an older deployment caused funded extraction jobs to remain pending. Preserve original job identities and billing during recovery.
17
+
18
+ ### Changed
19
+
20
+ - Allow temporary free X-Ray access across reports, collection, forms, and setup without changing saved trial dates or Thorbit links.
21
+
7
22
  ## [0.97.0] - 2026-10-13
8
23
 
9
24
  ### Removed
@@ -2253,7 +2268,7 @@ All notable changes to MCP Scraper are documented here. The format is based on [
2253
2268
  - Write actions remain unavailable until the account owner explicitly enables them.
2254
2269
  - Provider-specific connection data is normalized into one agent-facing contract.
2255
2270
 
2256
- [Unreleased]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.97.0...HEAD
2271
+ [Unreleased]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.97.1...HEAD
2257
2272
  [0.95.2]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.95.1...v0.95.2
2258
2273
  [0.95.1]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.95.0...v0.95.1
2259
2274
  [0.95.0]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.94.4...v0.95.0
@@ -2429,3 +2444,5 @@ All notable changes to MCP Scraper are documented here. The format is based on [
2429
2444
  [0.96.3]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.96.2...v0.96.3
2430
2445
 
2431
2446
  [0.97.0]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.96.3...v0.97.0
2447
+
2448
+ [0.97.1]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.97.0...v0.97.1
package/README.md CHANGED
@@ -172,7 +172,7 @@ Build the branded one-click bundle:
172
172
  npm run build:mcpb
173
173
  ```
174
174
 
175
- The generated bundle is written to `build/mcpb/mcp-scraper-<version>.mcpb` and copied to `public/downloads/` for the hosted download. The current public bundle is `https://mcpscraper.dev/downloads/mcp-scraper.mcpb` (`0.97.0`, SHA-256 `96b701920f66a0ee1a19dc52c6f39bf017e41c33983368d1dc09bbdc999bd110`). Install it by opening or dragging it into Claude Desktop. Claude displays the `MCP Scraper` install card, icon, API-key configuration field, and manually curated current-release message from the bundle manifest.
175
+ The generated bundle is written to `build/mcpb/mcp-scraper-<version>.mcpb` and copied to `public/downloads/` for the hosted download. The current public bundle is `https://mcpscraper.dev/downloads/mcp-scraper.mcpb` (`0.97.1`, SHA-256 `2c98f521dd1cb860f08a6344febd9f7a4607606d9767085f899a0f834b5d88b1`). Install it by opening or dragging it into Claude Desktop. Claude displays the `MCP Scraper` install card, icon, API-key configuration field, and manually curated current-release message from the bundle manifest.
176
176
 
177
177
  The MCPB install exposes every tool — web-intelligence plus all `browser_*` tools — through the one `mcp-scraper` server.
178
178
 
@@ -0,0 +1 @@
1
+ import{e as a,f as b,g as c,h as d,i as e,j as f,k as g,l as h}from"./chunk-5UQAL7HV.js";import"./chunk-FM7BX2LU.js";import"./chunk-NALXKTUU.js";import"./chunk-XNTAHMPA.js";import"./chunk-RDHGQ2WZ.js";import"./chunk-4YZ74SJ6.js";import"./chunk-JHDD6R3O.js";import"./chunk-SEZETSB3.js";import"./chunk-SDQW7IJN.js";import"./chunk-VVSHZV5S.js";import"./chunk-4ZVO6GX4.js";import"./chunk-WNUXMPVX.js";import"./chunk-EYGA6LOU.js";import"./chunk-OILOHQNL.js";export{d as GMAIL_ATTACHMENT_REF_TTL_MS,c as GMAIL_INLINE_BODY_BYTES,b as GMAIL_MAIN_CONTRACT_HASH,a as GMAIL_MAIN_CONTRACT_VERSION,h as GmailService,e as GmailServiceError,g as normalizeGmailMessage,f as parseGmailAddresses};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import{readFileSync as s}from"fs";function c(){try{for(let r of s(".env","utf8").split(`
3
- `)){let o=r.indexOf("=");if(o<1||r.trimStart().startsWith("#"))continue;let e=r.slice(0,o).trim();process.env[e]||(process.env[e]=r.slice(o+1).trim())}}catch{}}c();async function a(){let[{serve:r},{app:o},{startWorker:e},{migrate:i}]=await Promise.all([import("@hono/node-server"),import("../server-6HUBN3OR.js"),import("../worker-NXRU3TT3.js"),import("../core-schema-Y47YFKH2.js")]),n=parseInt(process.env.PORT??"3001");try{if(await i(),process.env.ANALYTICS_DATABASE_URL){let{migrateAnalytics:t}=await import("../migrations-3AKEC5QE.js");await t()}e(),r({fetch:o.fetch,port:n},t=>{console.log(`[server] http://localhost:${t.port}`),console.log(`[server] admin auth: ${process.env.ADMIN_KEY?"configured":"not configured"}`)})}catch(t){console.error("[startup] server preflight failed",t instanceof Error?t.name:"unknown_error"),process.exit(1)}}a();
3
+ `)){let o=r.indexOf("=");if(o<1||r.trimStart().startsWith("#"))continue;let e=r.slice(0,o).trim();process.env[e]||(process.env[e]=r.slice(o+1).trim())}}catch{}}c();async function a(){let[{serve:r},{app:o},{startWorker:e},{migrate:i}]=await Promise.all([import("@hono/node-server"),import("../server-EYMJROPX.js"),import("../worker-AWJF7UYR.js"),import("../core-schema-Y47YFKH2.js")]),n=parseInt(process.env.PORT??"3001");try{if(await i(),process.env.ANALYTICS_DATABASE_URL){let{migrateAnalytics:t}=await import("../migrations-3AKEC5QE.js");await t()}e(),r({fetch:o.fetch,port:n},t=>{console.log(`[server] http://localhost:${t.port}`),console.log(`[server] admin auth: ${process.env.ADMIN_KEY?"configured":"not configured"}`)})}catch(t){console.error("[startup] server preflight failed",t instanceof Error?t.name:"unknown_error"),process.exit(1)}}a();
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{k as E,l as j,m as N,n as D,r as L}from"../chunk-4HZXATHB.js";import"../chunk-KJQXUZ4Y.js";import"../chunk-6N5EC7ZO.js";import{g as v,j as b,k as U,l as T,m as K}from"../chunk-24YDQ3EO.js";import"../chunk-OLYPLX5C.js";import"../chunk-B3JRL45T.js";import{c as S}from"../chunk-OILOHQNL.js";import{a as h}from"../chunk-6FAMBNHY.js";import{Command as we}from"commander";import{spawn as Z}from"child_process";import{mkdir as ye,writeFile as he}from"fs/promises";import{basename as ke,join as X}from"path";function ne(e){return e.apiKey?.trim()||"sk_live_your_key"}function oe(e){return e.packageSpec?.trim()||"mcp-scraper@latest"}function P(e={}){return["-y","--package",oe(e),"mcp-scraper"]}function ie(e){let t={MCP_SCRAPER_API_KEY:ne(e)},s=e.browserProfileName?.trim();return s&&(t.BROWSER_AGENT_PROFILE_NAME=s),e.browserProfileSaveChanges===!0&&(t.BROWSER_AGENT_PROFILE_SAVE_CHANGES="true"),t}function H(){return["mcp","remove","mcp-scraper","-s","user"]}function B(){return["mcp","get","mcp-scraper"]}function q(e){let t=e.match(/^\s*Command:\s*(.+?)\s*$/m)?.[1];if(!t)return null;let s=e.match(/^\s*Args:\s*(.*?)\s*$/m)?.[1]??"",i=s.length?s.split(/\s+/):[],p={},u=e.split(/^\s*Environment:\s*$/m)[1];if(u)for(let a of u.split(`
2
+ import{k as E,l as j,m as N,n as D,r as L}from"../chunk-4HZXATHB.js";import"../chunk-KJQXUZ4Y.js";import"../chunk-6N5EC7ZO.js";import{g as v,j as b,k as U,l as T,m as K}from"../chunk-24YDQ3EO.js";import"../chunk-OLYPLX5C.js";import"../chunk-B3JRL45T.js";import{c as S}from"../chunk-OILOHQNL.js";import{a as h}from"../chunk-IPQOBOFY.js";import{Command as we}from"commander";import{spawn as Z}from"child_process";import{mkdir as ye,writeFile as he}from"fs/promises";import{basename as ke,join as X}from"path";function ne(e){return e.apiKey?.trim()||"sk_live_your_key"}function oe(e){return e.packageSpec?.trim()||"mcp-scraper@latest"}function P(e={}){return["-y","--package",oe(e),"mcp-scraper"]}function ie(e){let t={MCP_SCRAPER_API_KEY:ne(e)},s=e.browserProfileName?.trim();return s&&(t.BROWSER_AGENT_PROFILE_NAME=s),e.browserProfileSaveChanges===!0&&(t.BROWSER_AGENT_PROFILE_SAVE_CHANGES="true"),t}function H(){return["mcp","remove","mcp-scraper","-s","user"]}function B(){return["mcp","get","mcp-scraper"]}function q(e){let t=e.match(/^\s*Command:\s*(.+?)\s*$/m)?.[1];if(!t)return null;let s=e.match(/^\s*Args:\s*(.*?)\s*$/m)?.[1]??"",i=s.length?s.split(/\s+/):[],p={},u=e.split(/^\s*Environment:\s*$/m)[1];if(u)for(let a of u.split(`
3
3
  `)){let o=a.match(/^\s{2,}([A-Za-z_][A-Za-z0-9_]*)=(.*)$/);if(!o){if(a.trim().length&&!/^\s{2,}/.test(a))break;continue}p[o[1]]=o[2]}return{command:t,args:i,env:p}}function O(e){let t=["mcp","add","mcp-scraper","--scope","user"];for(let[s,i]of Object.entries(e.env))t.push("--env",`${s}=${i}`);return t.push("--",e.command,...e.args),t}function G(e={}){let t=["mcp","add","mcp-scraper","--scope","user"];for(let[s,i]of Object.entries(ie(e)))t.push("--env",`${s}=${i}`);return t.push("--","npx",...P(e)),t}function M(e){if(e==="claude-code")return"claude";if(e==="claude"||U.hosts.some(t=>t.id===e))return e;throw new Error('Unknown host "'+e+'". Use: codex, claude, claude-code, claude-desktop, cursor, windsurf, cline, or user-action-only')}function ae(e){return T(e==="claude"?"claude-code":e)}function J(e,t={}){let s=M(e),i=ae(s),p="Restart the MCP client so it starts a fresh npx process.",u='MCP_SCRAPER_API_KEY="$MCP_SCRAPER_API_KEY" npx -y -p mcp-scraper@latest mcp-scraper-cli agent install claude --apply',a=`X-Ray install protocol: ${v} (${b})`;return s==="codex"?["# Codex MCP config",a,i.exactConfig,"",`Continuation: ${i.continuation}`,`Rollback: ${i.rollback}`,"",p].join(`
4
4
  `):s==="claude"?["# Claude Code command",a,i.exactConfig,"","# One-command Claude Code setup",u,"",`Continuation: ${i.continuation}`,`Rollback: ${i.rollback}`,"",p].join(`
5
5
  `):s==="claude-desktop"?["# Claude Desktop config",a,i.exactConfig,"","Desktop Extension: https://mcpscraper.dev/downloads/mcp-scraper.mcpb",`Continuation: ${i.continuation}`,`Rollback: ${i.rollback}`,p].join(`
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as e}from"../chunk-OOB3RKWD.js";import"../chunk-4P3LZNVA.js";import"../chunk-QER2ELZP.js";import"../chunk-WHVK6FUB.js";import"../chunk-7POHNTVW.js";import"../chunk-MVMWPKRC.js";import"../chunk-63VWBMYR.js";import"../chunk-3F7AFM53.js";import"../chunk-RDHGQ2WZ.js";import"../chunk-B5Y26E3A.js";import"../chunk-U3NV72AL.js";import"../chunk-CNSVZTTT.js";import"../chunk-K3VDGJNK.js";import"../chunk-7SR7MEU5.js";import"../chunk-ANQ4JJVI.js";import"../chunk-SEZETSB3.js";import"../chunk-SDQW7IJN.js";import"../chunk-B4ZKPLSP.js";import"../chunk-VVSHZV5S.js";import"../chunk-C7MGJUTU.js";import"../chunk-PKQHHCO4.js";import"../chunk-4ZVO6GX4.js";import"../chunk-WNUXMPVX.js";import"../chunk-ND4WIBXT.js";import"../chunk-EYGA6LOU.js";import"../chunk-24YDQ3EO.js";import"../chunk-OLYPLX5C.js";import"../chunk-B3JRL45T.js";import"../chunk-OILOHQNL.js";import"../chunk-6FAMBNHY.js";import"../chunk-HNNYXMSI.js";var _=["harvest_paa","search_serp","extract_url","diff_page","map_site_urls","map_wayback_snapshots","extract_site","analyze_site_similarity","audit_site","check_site_export","site_export_read","site_export_image","archive_read","youtube_harvest","youtube_transcribe","facebook_page_intel","facebook_ad_search","reddit_thread","reddit_trending","video_frame_analysis","video_frame_analysis_status","facebook_ad_transcribe","google_ads_search","google_ads_page_intel","google_ads_transcribe","facebook_video_transcribe","instagram_profile_content","instagram_media_download","maps_place_intel","maps_search","trustpilot_reviews","g2_reviews","capture_serp_snapshot","capture_serp_page_snapshots"];e({toolsets:new Set(["paa","serp"]),allowedToolNames:_});
2
+ import{a as e}from"../chunk-ZNPGM3XE.js";import"../chunk-4AEW53RU.js";import"../chunk-TZYITYL4.js";import"../chunk-B5Y26E3A.js";import"../chunk-QER2ELZP.js";import"../chunk-QCBCOEH5.js";import"../chunk-7POHNTVW.js";import"../chunk-3F7AFM53.js";import"../chunk-KBZY2OGP.js";import"../chunk-RDHGQ2WZ.js";import"../chunk-4YZ74SJ6.js";import"../chunk-JHDD6R3O.js";import"../chunk-CNSVZTTT.js";import"../chunk-SEZETSB3.js";import"../chunk-SDQW7IJN.js";import"../chunk-K3VDGJNK.js";import"../chunk-7SR7MEU5.js";import"../chunk-ANQ4JJVI.js";import"../chunk-FLAWC5PF.js";import"../chunk-B4ZKPLSP.js";import"../chunk-VVSHZV5S.js";import"../chunk-PKQHHCO4.js";import"../chunk-4ZVO6GX4.js";import"../chunk-C7MGJUTU.js";import"../chunk-WNUXMPVX.js";import"../chunk-ZDECILF6.js";import"../chunk-EYGA6LOU.js";import"../chunk-24YDQ3EO.js";import"../chunk-OLYPLX5C.js";import"../chunk-B3JRL45T.js";import"../chunk-OILOHQNL.js";import"../chunk-IPQOBOFY.js";import"../chunk-HNNYXMSI.js";var _=["harvest_paa","search_serp","extract_url","diff_page","map_site_urls","map_wayback_snapshots","extract_site","analyze_site_similarity","audit_site","check_site_export","site_export_read","site_export_image","archive_read","youtube_harvest","youtube_transcribe","facebook_page_intel","facebook_ad_search","reddit_thread","reddit_trending","video_frame_analysis","video_frame_analysis_status","facebook_ad_transcribe","google_ads_search","google_ads_page_intel","google_ads_transcribe","facebook_video_transcribe","instagram_profile_content","instagram_media_download","maps_place_intel","maps_search","trustpilot_reviews","g2_reviews","capture_serp_snapshot","capture_serp_page_snapshots"];e({toolsets:new Set(["paa","serp"]),allowedToolNames:_});
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as s}from"../chunk-ND4WIBXT.js";import"../chunk-EYGA6LOU.js";import{a as e}from"../chunk-6FAMBNHY.js";var r=process.argv.includes("--no-color")||process.env.NO_COLOR!==void 0||process.env.FORCE_COLOR==="0"||!process.stdout.isTTY,n=process.argv.includes("--help")||process.argv.includes("-h");n&&(process.stdout.write(["Usage: mcp-scraper-install [--no-color]","","Prints the branded MCP Scraper terminal install card and copyable install commands.","mcp-scraper prints the same card in a human terminal and runs as the MCP stdio server in clients.",""].join(`
2
+ import{a as s}from"../chunk-ZDECILF6.js";import"../chunk-EYGA6LOU.js";import{a as e}from"../chunk-IPQOBOFY.js";var r=process.argv.includes("--no-color")||process.env.NO_COLOR!==void 0||process.env.FORCE_COLOR==="0"||!process.stdout.isTTY,n=process.argv.includes("--help")||process.argv.includes("-h");n&&(process.stdout.write(["Usage: mcp-scraper-install [--no-color]","","Prints the branded MCP Scraper terminal install card and copyable install commands.","mcp-scraper prints the same card in a human terminal and runs as the MCP stdio server in clients.",""].join(`
3
3
  `)),process.exit(0));process.stdout.write(s({version:e,color:!r,apiKeyConfigured:!!process.env.MCP_SCRAPER_API_KEY?.trim()}));
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as r}from"../chunk-OOB3RKWD.js";import"../chunk-4P3LZNVA.js";import"../chunk-QER2ELZP.js";import"../chunk-WHVK6FUB.js";import"../chunk-7POHNTVW.js";import"../chunk-MVMWPKRC.js";import"../chunk-63VWBMYR.js";import"../chunk-3F7AFM53.js";import"../chunk-RDHGQ2WZ.js";import"../chunk-B5Y26E3A.js";import"../chunk-U3NV72AL.js";import"../chunk-CNSVZTTT.js";import"../chunk-K3VDGJNK.js";import"../chunk-7SR7MEU5.js";import"../chunk-ANQ4JJVI.js";import"../chunk-SEZETSB3.js";import"../chunk-SDQW7IJN.js";import"../chunk-B4ZKPLSP.js";import"../chunk-VVSHZV5S.js";import"../chunk-C7MGJUTU.js";import"../chunk-PKQHHCO4.js";import"../chunk-4ZVO6GX4.js";import"../chunk-WNUXMPVX.js";import"../chunk-ND4WIBXT.js";import"../chunk-EYGA6LOU.js";import"../chunk-24YDQ3EO.js";import"../chunk-OLYPLX5C.js";import"../chunk-B3JRL45T.js";import"../chunk-OILOHQNL.js";import"../chunk-6FAMBNHY.js";import"../chunk-HNNYXMSI.js";r();
2
+ import{a as r}from"../chunk-ZNPGM3XE.js";import"../chunk-4AEW53RU.js";import"../chunk-TZYITYL4.js";import"../chunk-B5Y26E3A.js";import"../chunk-QER2ELZP.js";import"../chunk-QCBCOEH5.js";import"../chunk-7POHNTVW.js";import"../chunk-3F7AFM53.js";import"../chunk-KBZY2OGP.js";import"../chunk-RDHGQ2WZ.js";import"../chunk-4YZ74SJ6.js";import"../chunk-JHDD6R3O.js";import"../chunk-CNSVZTTT.js";import"../chunk-SEZETSB3.js";import"../chunk-SDQW7IJN.js";import"../chunk-K3VDGJNK.js";import"../chunk-7SR7MEU5.js";import"../chunk-ANQ4JJVI.js";import"../chunk-FLAWC5PF.js";import"../chunk-B4ZKPLSP.js";import"../chunk-VVSHZV5S.js";import"../chunk-PKQHHCO4.js";import"../chunk-4ZVO6GX4.js";import"../chunk-C7MGJUTU.js";import"../chunk-WNUXMPVX.js";import"../chunk-ZDECILF6.js";import"../chunk-EYGA6LOU.js";import"../chunk-24YDQ3EO.js";import"../chunk-OLYPLX5C.js";import"../chunk-B3JRL45T.js";import"../chunk-OILOHQNL.js";import"../chunk-IPQOBOFY.js";import"../chunk-HNNYXMSI.js";r();
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{K as t}from"../chunk-GLCR4KJI.js";import"../chunk-M5QHXNFZ.js";import{d as r}from"../chunk-B4ZKPLSP.js";import"../chunk-VVSHZV5S.js";import"../chunk-C7MGJUTU.js";import"../chunk-PKQHHCO4.js";import"../chunk-4ZVO6GX4.js";import"../chunk-WNUXMPVX.js";import"../chunk-6N5EC7ZO.js";import"../chunk-HNNYXMSI.js";import{Command as s,Option as a}from"commander";var i=new s;i.name("paa-harvest").description("Recursively extract Google People Also Ask questions").requiredOption("-q, --query <query>","Seed query").option("-l, --location <location>",'Location name (e.g. "austin" or "Austin,Texas,United States")').option("--gl <gl>","Google country code","us").option("--hl <hl>","Google language code","en").option("-d, --depth <depth>","BFS depth (1-30)","3").option("-m, --max-questions <n>","Max questions to harvest","100").option("-o, --output <dir>","Output directory","./paa-output").option("-f, --format <format>","Output format: json, csv, or both","both").option("--headless","Run browser in headless mode",!1).option("--profile <dir>","Persistent browser profile directory").option("--proxy <url>","Proxy server URL").option("--browser-api-key <key>","Browser service API key (or set BROWSER_SERVICE_API_KEY env var)").addOption(new a("--\u006b\u0065\u0072\u006e\u0065\u006c-api-key <key>").hideHelp()).action(async e=>{try{let o=await t({query:e.query,location:e.location,gl:e.gl,hl:e.hl,depth:parseInt(e.depth,10),maxQuestions:parseInt(e.maxQuestions,10),outputDir:e.output,format:e.format,headless:e.headless,profileDir:e.profile,proxy:e.proxy,\u006b\u0065\u0072\u006e\u0065\u006cApiKey:e.browserApiKey??e.\u006b\u0065\u0072\u006e\u0065\u006cApiKey??r()});console.log(JSON.stringify({totalQuestions:o.totalQuestions,outputDir:o.stats.seed}))}catch(o){console.error(o instanceof Error?o.message:String(o)),process.exit(1)}});async function n(){await i.parseAsync()}n();
2
+ import{L as t}from"../chunk-6D25Q5BR.js";import"../chunk-C3JWX6KM.js";import{d as r}from"../chunk-B4ZKPLSP.js";import"../chunk-VVSHZV5S.js";import"../chunk-PKQHHCO4.js";import"../chunk-4ZVO6GX4.js";import"../chunk-C7MGJUTU.js";import"../chunk-WNUXMPVX.js";import"../chunk-6N5EC7ZO.js";import"../chunk-HNNYXMSI.js";import{Command as s,Option as a}from"commander";var i=new s;i.name("paa-harvest").description("Recursively extract Google People Also Ask questions").requiredOption("-q, --query <query>","Seed query").option("-l, --location <location>",'Location name (e.g. "austin" or "Austin,Texas,United States")').option("--gl <gl>","Google country code","us").option("--hl <hl>","Google language code","en").option("-d, --depth <depth>","BFS depth (1-30)","3").option("-m, --max-questions <n>","Max questions to harvest","100").option("-o, --output <dir>","Output directory","./paa-output").option("-f, --format <format>","Output format: json, csv, or both","both").option("--headless","Run browser in headless mode",!1).option("--profile <dir>","Persistent browser profile directory").option("--proxy <url>","Proxy server URL").option("--browser-api-key <key>","Browser service API key (or set BROWSER_SERVICE_API_KEY env var)").addOption(new a("--\u006b\u0065\u0072\u006e\u0065\u006c-api-key <key>").hideHelp()).action(async e=>{try{let o=await t({query:e.query,location:e.location,gl:e.gl,hl:e.hl,depth:parseInt(e.depth,10),maxQuestions:parseInt(e.maxQuestions,10),outputDir:e.output,format:e.format,headless:e.headless,profileDir:e.profile,proxy:e.proxy,\u006b\u0065\u0072\u006e\u0065\u006cApiKey:e.browserApiKey??e.\u006b\u0065\u0072\u006e\u0065\u006cApiKey??r()});console.log(JSON.stringify({totalQuestions:o.totalQuestions,outputDir:o.stats.seed}))}catch(o){console.error(o instanceof Error?o.message:String(o)),process.exit(1)}});async function n(){await i.parseAsync()}n();
@@ -0,0 +1 @@
1
+ import{j as b,k as c}from"./chunk-F3M7INSN.js";import"./chunk-JMZIDHYQ.js";import{F as a}from"./chunk-NQFTETVC.js";import"./chunk-KXJCGV3H.js";import"./chunk-C3JWX6KM.js";import"./chunk-CNSVZTTT.js";import"./chunk-SEZETSB3.js";import"./chunk-SDQW7IJN.js";import"./chunk-K3VDGJNK.js";import"./chunk-7SR7MEU5.js";import"./chunk-ANQ4JJVI.js";import"./chunk-PKQHHCO4.js";import"./chunk-4ZVO6GX4.js";import"./chunk-C7MGJUTU.js";import"./chunk-WNUXMPVX.js";import"./chunk-OLYPLX5C.js";import"./chunk-B3JRL45T.js";import"./chunk-OILOHQNL.js";import"./chunk-HNNYXMSI.js";export{b as MAX_ANALYZED_LINK_EDGES,a as SITE_EXTRACT_PAGE_CHUNK,c as assembleExtractArtifacts};
@@ -0,0 +1,4 @@
1
+ import{A as _,B as x,C as b,D as C,E as d,g as w}from"./chunk-SJNSTO3C.js";import{d as g,i as h,t as u}from"./chunk-ANQ4JJVI.js";import{c}from"./chunk-FLAWC5PF.js";import{a as f}from"./chunk-WNUXMPVX.js";import{c as y,d as l}from"./chunk-HNNYXMSI.js";var s=e=>`paa-execution:${e}`;async function I(e,t){if(e.options.executionProtocol!==1||e.options.directCompletionProtocol!==1||e.options.executionOwner!=="direct"||e.options.serpOnly===!0||!t)return null;let r=await u(s(e.id),e.user_id,"harvest_paa",e.id);if(!r||r.flags.intentVersion!==1||r.flags.purpose!=="paa-direct")return null;let i=r.flags,n=i.hold,o=i.options,p={intentVersion:1,purpose:"paa-direct",userId:i.userId,jobId:i.jobId,options:o,callbackUrl:i.callbackUrl,requestFingerprint:i.requestFingerprint,hold:n};if(i.userId!==e.user_id||i.jobId!==e.id||!o||n?.userId!==e.user_id||n.key!==`paa-harvest:${e.id}:hold`||n.operation!=="paa"||!Number.isSafeInteger(n.amountMc)||n.amountMc<=0||n.description!==`PAA harvest: ${o.query}`.slice(0,500)||e.options.executionRunId!==s(e.id)||e.options.billingDebitKey!==n.key||e.options.billingHoldMc!==n.amountMc||e.query!==o.query||e.callback_url!==i.callbackUrl||e.options.requestFingerprint!==i.requestFingerprint||e.options.paaLeaseToken!==t||l(Object.fromEntries(Object.keys(o).map(m=>[m,e.options[m]])))!==l(o)||r.fingerprint!==y(l(p)))throw Error("Direct completion intent conflicts");return{profile:"direct",recordToken:t,jobId:e.id,userId:e.user_id,tool:"harvest_paa",requestFingerprint:String(i.requestFingerprint),options:o,callbackUrl:e.callback_url,hold:n,refundOperation:"paa_refund",sourceSurface:"paa_harvest",deadlineAt:0}}async function a(e,t,r){r&&(await h(r).catch(()=>{}),t&&await x(t,r).catch(()=>{}));let i=await c(e.id,e.user_id)??e;return _(i,i.options.holdState==="settled"?"settled":t?"held":"unconfirmed")}async function N(e){let t;try{return t=await I(e.job,e.recordToken)??void 0,!t||e.claim.runId!==s(e.job.id)||e.claim.userId!==e.job.user_id?a(e.job):(await b(t,e.claim,e.result,e.amountMc,e.status,e.publicError??null,e.httpStatus??200,e.requiresPhysical??!0),await d(t,e.claim,!1))}catch{return a(e.job,t,e.claim)}}async function E(e){let t=await c(typeof e=="string"?e:e.id,typeof e=="string"?void 0:e.user_id);if(!t||t.options.directCompletionProtocol!==1)return null;let r,i=null;try{let n=await u(s(t.id),t.user_id,"harvest_paa",t.id);return!t.options.syncCapturedAt&&n?.phase==="claimed"?null:(r=await I(t,String(t.options.paaLeaseToken??""))??void 0,r?n?.phase==="published"&&t.options.executionState==="finalized"&&t.options.holdState==="settled"?C(t,!0):!t.options.syncCapturedAt||(i=await g(s(t.id),t.user_id),!i)?a(t,r):(await w(t,i),await d(r,i,!0,!0)):a(t))}catch{return a(t,r,i??void 0)}}async function R(e,t){return(await E(e))?.status===200}async function q(e=25){let t=(await f().execute({sql:`SELECT j.id,j.user_id FROM jobs j JOIN operation_runs r ON r.id='paa-execution:'||j.id AND r.user_id=j.user_id JOIN operation_executions x ON x.run_id=r.id
2
+ WHERE json_extract(j.options,'$.directCompletionProtocol')=1 AND json_extract(j.options,'$.syncCapturedAt') IS NOT NULL
3
+ AND (x.phase='unknown' OR (x.phase='effects_started' AND x.expires_at_ms<=CAST(strftime('%s','now') AS INTEGER)*1000))
4
+ ORDER BY j.created_at LIMIT ?`,args:[Math.max(1,Math.min(100,Math.floor(e)))]})).rows,r=0,i=0;for(let n of t){let o=await c(String(n.id),Number(n.user_id));if(o)try{(await E(o))?.status===200?r++:i++}catch{i++}}return{checked:t.length,finalized:r,pending:i}}export{N as a,E as b,R as c,q as d};