mcp-scraper 0.57.1 → 0.57.3

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.
@@ -169,7 +169,7 @@ import {
169
169
  resolveDeploymentProfile,
170
170
  resolveLocalSourcebookSchemaType,
171
171
  transcribeMediaUrl
172
- } from "./chunk-2KL4MSZP.js";
172
+ } from "./chunk-QSUSTYB3.js";
173
173
  import {
174
174
  auditImageUrls,
175
175
  auditImages,
@@ -225,7 +225,7 @@ import {
225
225
  } from "./chunk-FG6LJGJ7.js";
226
226
  import {
227
227
  PACKAGE_VERSION
228
- } from "./chunk-VTBJVKBE.js";
228
+ } from "./chunk-LHH3GX3W.js";
229
229
  import {
230
230
  abandonExtractSettlement,
231
231
  countSuccessfulPages,
@@ -12884,6 +12884,7 @@ function mapSubmission(row) {
12884
12884
  businessName: String(rowValue(row, "business_name")),
12885
12885
  websiteUrl: String(rowValue(row, "website_url")),
12886
12886
  status: String(rowValue(row, "status")),
12887
+ acquisitionError: rowValue(row, "acquisition_error") == null ? null : String(rowValue(row, "acquisition_error")),
12887
12888
  draftRevision: Number(rowValue(row, "draft_revision")),
12888
12889
  publishedRevision: rowValue(row, "published_revision") == null ? null : Number(rowValue(row, "published_revision")),
12889
12890
  coverage: parseJson2(rowValue(row, "coverage_json")),
@@ -14576,6 +14577,15 @@ function nameOverlap(left, right) {
14576
14577
  const intersection = [...a].filter((token6) => b.has(token6)).length;
14577
14578
  return intersection / Math.max(a.size, b.size);
14578
14579
  }
14580
+ function nameContainment(left, right) {
14581
+ const a = tokens(left);
14582
+ const b = tokens(right);
14583
+ if (!a.size || !b.size) return 0;
14584
+ const smaller = a.size <= b.size ? a : b;
14585
+ if (smaller.size < 2) return 0;
14586
+ const intersection = [...a].filter((token6) => b.has(token6)).length;
14587
+ return intersection / smaller.size;
14588
+ }
14579
14589
  function validateLocalSourcebookMapsIdentity(submission, maps) {
14580
14590
  const expectedHost = host(submission.websiteUrl);
14581
14591
  const mapsHost = host(maps.website);
@@ -14585,7 +14595,9 @@ function validateLocalSourcebookMapsIdentity(submission, maps) {
14585
14595
  if (mapsHost && expectedHost && mapsHost !== expectedHost && !mapsHost.endsWith(`.${expectedHost}`) && !expectedHost.endsWith(`.${mapsHost}`)) {
14586
14596
  throw new Error(`Exact-place match rejected: Google Maps linked ${mapsHost}, not the submitted domain ${expectedHost}.`);
14587
14597
  }
14588
- if (overlap < 0.6) {
14598
+ const containment = nameContainment(submission.businessName, actualName);
14599
+ const domainConfirmsIdentity = Boolean(mapsHost && expectedHost);
14600
+ if (overlap < 0.6 && containment < 0.9 && !domainConfirmsIdentity) {
14589
14601
  throw new Error(`Exact-place match rejected: Google Maps returned \u201C${actualName},\u201D which does not sufficiently match \u201C${submission.businessName}.\u201D`);
14590
14602
  }
14591
14603
  if (addressState && addressState !== submission.state.toLowerCase()) {
@@ -20449,13 +20461,27 @@ function localBaseDir() {
20449
20461
  return process.env.MCP_SCRAPER_OUTPUT_DIR?.trim() || join4(homedir(), "Downloads", "mcp-scraper");
20450
20462
  }
20451
20463
  var cached = null;
20464
+ var UnconfiguredBlobStore = class {
20465
+ kind = "unconfigured";
20466
+ async put() {
20467
+ throw new Error("Blob storage is not configured on this deployment: set BLOB_READ_WRITE_TOKEN. Refusing to write to a local path that no request can read back.");
20468
+ }
20469
+ async get() {
20470
+ return null;
20471
+ }
20472
+ };
20473
+ function runsWithoutLocalDisk(env = process.env) {
20474
+ return Boolean(env.VERCEL || env.AWS_LAMBDA_FUNCTION_NAME);
20475
+ }
20476
+ function resolveBlobStore(env = process.env) {
20477
+ const token6 = env.BLOB_READ_WRITE_TOKEN?.trim();
20478
+ if (token6) return new VercelBlobStore(token6);
20479
+ if (runsWithoutLocalDisk(env)) return new UnconfiguredBlobStore();
20480
+ return new LocalBlobStore(localBaseDir());
20481
+ }
20452
20482
  function getBlobStore() {
20453
20483
  if (cached) return cached;
20454
- if (process.env.BLOB_READ_WRITE_TOKEN) {
20455
- cached = new VercelBlobStore(process.env.BLOB_READ_WRITE_TOKEN);
20456
- } else {
20457
- cached = new LocalBlobStore(localBaseDir());
20458
- }
20484
+ cached = resolveBlobStore();
20459
20485
  return cached;
20460
20486
  }
20461
20487
  var VercelBlobStore = class {
@@ -47448,4 +47474,4 @@ app.get("/blog/:slug/", (c) => {
47448
47474
  export {
47449
47475
  app
47450
47476
  };
47451
- //# sourceMappingURL=server-DSCKFM7K.js.map
47477
+ //# sourceMappingURL=server-EP2SK2ID.js.map