mcp-scraper 0.1.6 → 0.1.7

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 (36) hide show
  1. package/README.md +13 -2
  2. package/dist/bin/api-server.cjs +572 -171
  3. package/dist/bin/api-server.cjs.map +1 -1
  4. package/dist/bin/api-server.js +2 -2
  5. package/dist/bin/mcp-stdio-server.cjs +299 -149
  6. package/dist/bin/mcp-stdio-server.cjs.map +1 -1
  7. package/dist/bin/mcp-stdio-server.js +2 -1
  8. package/dist/bin/mcp-stdio-server.js.map +1 -1
  9. package/dist/bin/paa-harvest.cjs +22 -1
  10. package/dist/bin/paa-harvest.cjs.map +1 -1
  11. package/dist/bin/paa-harvest.js +2 -1
  12. package/dist/bin/paa-harvest.js.map +1 -1
  13. package/dist/{chunk-6TWZS2FQ.js → chunk-3OIRNUF5.js} +302 -150
  14. package/dist/chunk-3OIRNUF5.js.map +1 -0
  15. package/dist/{chunk-W4P2U5VF.js → chunk-LUBDFS67.js} +32 -32
  16. package/dist/chunk-LUBDFS67.js.map +1 -0
  17. package/dist/{chunk-7HB7NDOY.js → chunk-ZK456YXN.js} +12 -2
  18. package/dist/chunk-ZK456YXN.js.map +1 -0
  19. package/dist/chunk-ZMOWIBMK.js +36 -0
  20. package/dist/chunk-ZMOWIBMK.js.map +1 -0
  21. package/dist/index.cjs +22 -1
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.js +2 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/{server-2Y27U4TO.js → server-YNJHP5PU.js} +235 -22
  26. package/dist/server-YNJHP5PU.js.map +1 -0
  27. package/dist/{worker-UT4ZQU2T.js → worker-PBG6LGET.js} +4 -3
  28. package/dist/{worker-UT4ZQU2T.js.map → worker-PBG6LGET.js.map} +1 -1
  29. package/docs/adr/0001-in-page-graphql-interception-for-anti-bot-scraping.md +58 -0
  30. package/docs/adr/README.md +11 -0
  31. package/docs/mcp-tool-quality-spec.md +238 -0
  32. package/package.json +5 -4
  33. package/dist/chunk-6TWZS2FQ.js.map +0 -1
  34. package/dist/chunk-7HB7NDOY.js.map +0 -1
  35. package/dist/chunk-W4P2U5VF.js.map +0 -1
  36. package/dist/server-2Y27U4TO.js.map +0 -1
@@ -61,6 +61,16 @@ var MapsPlaceOptionsSchema = import_zod.z.object({
61
61
  kernelProxyId: import_zod.z.string().optional(),
62
62
  headless: import_zod.z.boolean().default(true)
63
63
  });
64
+ var MapsSearchOptionsSchema = import_zod.z.object({
65
+ query: import_zod.z.string().min(1),
66
+ location: import_zod.z.string().optional(),
67
+ gl: import_zod.z.string().length(2).default("us"),
68
+ hl: import_zod.z.string().length(2).default("en"),
69
+ maxResults: import_zod.z.number().int().min(1).max(50).default(10),
70
+ kernelApiKey: import_zod.z.string().optional(),
71
+ kernelProxyId: import_zod.z.string().optional(),
72
+ headless: import_zod.z.boolean().default(true)
73
+ });
64
74
  var RawPAAItemSchema = import_zod.z.object({
65
75
  question: import_zod.z.string().min(1),
66
76
  answer: import_zod.z.string().optional(),
@@ -924,8 +934,19 @@ function addCandidate(candidates, city, region, example) {
924
934
  }
925
935
  candidates.set(key, { city: normalizedCity, regionCode, count: 1, examples: [example] });
926
936
  }
937
+ function decodeSerpText(text) {
938
+ try {
939
+ return decodeURIComponent(text);
940
+ } catch {
941
+ }
942
+ try {
943
+ return decodeURIComponent(text.replace(/%(?![0-9a-fA-F]{2})/g, "%25"));
944
+ } catch {
945
+ return text;
946
+ }
947
+ }
927
948
  function scanText(candidates, text) {
928
- const normalized = decodeURIComponent(text).replace(/[+/|_-]+/g, " ");
949
+ const normalized = decodeSerpText(text).replace(/[+/|_-]+/g, " ");
929
950
  for (const match of normalized.matchAll(CITY_STATE_RE)) {
930
951
  addCandidate(candidates, match[1] ?? "", match[2] ?? "", normalized.slice(0, 180));
931
952
  }