mcp-scraper 0.66.6 → 0.66.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 (34) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/README.md +1 -1
  3. package/dist/bin/api-server.cjs +889 -597
  4. package/dist/bin/api-server.js +3 -3
  5. package/dist/bin/mcp-scraper-cli.cjs +1 -1
  6. package/dist/bin/mcp-scraper-cli.js +1 -1
  7. package/dist/bin/mcp-scraper-install.cjs +2 -2
  8. package/dist/bin/mcp-scraper-install.js +2 -2
  9. package/dist/bin/mcp-stdio-server.cjs +102 -16
  10. package/dist/bin/mcp-stdio-server.js +6 -6
  11. package/dist/bin/paa-harvest.cjs +14 -1
  12. package/dist/bin/paa-harvest.js +3 -3
  13. package/dist/{chunk-NLEAYKOC.js → chunk-7KB5QTHP.js} +1 -1
  14. package/dist/{chunk-K7Y27ND3.js → chunk-CGOMGGOF.js} +2 -2
  15. package/dist/{chunk-DBWWIK7O.js → chunk-EVOBJYBE.js} +1 -1
  16. package/dist/{chunk-3EYALCYK.js → chunk-F434YJPV.js} +1 -1
  17. package/dist/{chunk-PMCT2YQM.js → chunk-HBZENASD.js} +1 -1
  18. package/dist/{chunk-KXRWY7DZ.js → chunk-HWGQVP3Q.js} +1 -1
  19. package/dist/{chunk-55B3T5L2.js → chunk-HZDJ5UZ4.js} +68 -1
  20. package/dist/{chunk-ABYBPODM.js → chunk-JZPSG4NR.js} +1 -1
  21. package/dist/{chunk-CETDPNMZ.js → chunk-LVXRWJJJ.js} +1 -1
  22. package/dist/{chunk-KPE52NPT.js → chunk-O7ZC5Y3Z.js} +1 -1
  23. package/dist/{chunk-3TKKJQB4.js → chunk-U2UHJWFW.js} +1 -1
  24. package/dist/{chunk-VMWVEKZT.js → chunk-Z5QQEWXA.js} +50 -17
  25. package/dist/{db-4RVZ3NYZ.js → db-MNNNIWVS.js} +1 -1
  26. package/dist/{extract-bundle-EA5URLXN.js → extract-bundle-RW7CVIRF.js} +3 -3
  27. package/dist/index.cjs +14 -1
  28. package/dist/index.js +3 -3
  29. package/dist/{lead-list-enrichment-repository-IBXNWM6H.js → lead-list-enrichment-repository-PZYE6TDP.js} +2 -2
  30. package/dist/{location-data-repository-WHHQUCUI.js → location-data-repository-EPCNGMOM.js} +2 -2
  31. package/dist/{server-5WPS3LZD.js → server-KSVJ4X4V.js} +633 -444
  32. package/dist/{site-extract-repository-NTM4MDQN.js → site-extract-repository-CZ7SVT3Z.js} +2 -2
  33. package/dist/{worker-UTBUWEXQ.js → worker-IBLGV272.js} +5 -5
  34. package/package.json +1 -1
@@ -8,13 +8,13 @@ import {
8
8
  } from "./chunk-PGJQDMC2.js";
9
9
  import {
10
10
  sanitizeOutboundDiagnostics
11
- } from "./chunk-3EYALCYK.js";
11
+ } from "./chunk-F434YJPV.js";
12
12
  import {
13
13
  browserServiceProfileName,
14
14
  browserServiceProfileSaveChanges,
15
15
  recordVendorUsage,
16
16
  vendorCostUsd
17
- } from "./chunk-3TKKJQB4.js";
17
+ } from "./chunk-U2UHJWFW.js";
18
18
  import {
19
19
  buildSerpEmailQuery,
20
20
  classifyEmailScope,
@@ -25,7 +25,7 @@ import {
25
25
  } from "./chunk-VXLU74YZ.js";
26
26
  import {
27
27
  PACKAGE_VERSION
28
- } from "./chunk-NLEAYKOC.js";
28
+ } from "./chunk-7KB5QTHP.js";
29
29
  import {
30
30
  createPrivateArtifact,
31
31
  privateArtifactOwnerId,
@@ -45,7 +45,7 @@ import {
45
45
  normalizePublicErrorCode,
46
46
  publicErrorMessage,
47
47
  sanitizeVendorName
48
- } from "./chunk-55B3T5L2.js";
48
+ } from "./chunk-HZDJ5UZ4.js";
49
49
 
50
50
  // src/harvest-timeout.ts
51
51
  var SCRAPE_FUNCTION_MAX_MS = 8e5;
@@ -388,11 +388,20 @@ seam is noted so you can chain them.
388
388
  - Plan a new or edited entity -> **commons_prepare_entity**. This is the Commons equivalent of
389
389
  prepare-memory-write: it returns the live entity profile contract, duplicate candidates, tag reuse/review/create
390
390
  guidance, recommended sections, optional sections, and heading guidance before any write occurs.
391
- - Validate a composed entity without writing -> **commons_validate_entity**. Use it after composing and before submit
392
- to catch missing featured images, missing source/body evidence, duplicate candidates, and
393
- unsupported placeholder sections.
391
+ - Host a featured image -> **commons_host_image**. The normal write sequence is **commons_prepare_entity ->
392
+ compose the payload -> commons_host_image -> commons_validate_entity -> commons_submit_entity**. Put the
393
+ permanent returned URL in featuredImage.url. Use imageBase64 for available attachment bytes within the request
394
+ bound, or a stable direct public HTTPS image URL; never use a caller-local path, opaque chat attachment reference,
395
+ HTML page, private URL, or temporary/signed URL.
396
+ - Validate a composed entity without writing -> **commons_validate_entity**. Use it after image hosting and before
397
+ submit. Validation does not fetch or store image bytes; an external/unregistered featured image is reported in
398
+ imageDiagnostics as not publishable until commons_host_image returns its permanent Commons URL. Validation also
399
+ catches missing source/body evidence, duplicate candidates, and unsupported placeholder sections.
394
400
  - Create or edit a public wiki entity -> **commons_submit_entity**. This is a governed proposal write,
395
- not direct rendered HTML editing. Normal workflow is prepare -> validate -> submit. Pick the closest entity type
401
+ not direct rendered HTML editing. Submit retains defensive auto-hosting for a stable direct public HTTPS image,
402
+ but image ingress failure returns an actionable tool error: host different bytes or a different stable source,
403
+ replace featuredImage.url, validate again, and retry the same intended write with the same idempotency key.
404
+ Pick the closest entity type
396
405
  first: SoftwareApplication, Organization, Person, Event, Place, Taxon, ScienceConcept, MathConcept, TechArticle,
397
406
  Trail, or PublicArticle.
398
407
  Creating a new entity costs 10 Credits; editing an existing entity costs 2 Credits. Preparation, validation,
@@ -7496,7 +7505,7 @@ var CommonsGetEntityLinksetInputSchema = {
7496
7505
  idOrSlug: z6.string().trim().min(1).max(180).describe("Transparent Commons TPW-Q entity id or /wiki/ slug whose governed RFC 9264 linkset should be read.")
7497
7506
  };
7498
7507
  var CommonsFeaturedImageInputSchema = z6.object({
7499
- url: z6.string().url().describe("Required public image URL for a publishable entity. Use extract_url includeFeaturedImage or preserved media when available."),
7508
+ url: z6.string().url().describe("For a publish-ready entity, use the permanent URL returned by commons_host_image. Submit can auto-host a stable direct public HTTPS image URL as a compatibility fallback, but validation reports any unregistered external URL as not ready. Do not use a chat attachment reference, caller-local path, temporary or signed URL, private URL, or HTML page URL."),
7500
7509
  alt: z6.string().trim().max(500).optional(),
7501
7510
  caption: z6.string().trim().max(1e3).optional(),
7502
7511
  sourceUrl: z6.string().url().optional(),
@@ -7588,14 +7597,14 @@ var CommonsPrepareEntityInputSchema = {
7588
7597
  maxCandidates: z6.number().int().min(1).max(20).default(8).describe("Maximum duplicate candidates to return.")
7589
7598
  };
7590
7599
  var CommonsSubmitEntityInputSchema = {
7591
- idempotencyKey: z6.string().trim().min(8).max(200).describe("Required unique opaque ID for this intended Commons write. Reuse only when retrying the same write after a timeout; use a new value for each intentional create or edit."),
7600
+ idempotencyKey: z6.string().trim().min(8).max(200).describe("Required unique opaque ID for this intended Commons write. Reuse it when retrying the same intended write after a timeout or after correcting a pre-persistence image-ingress failure; use a new value for each intentional create or edit."),
7592
7601
  title: z6.string().trim().min(3).max(180).describe("Public page title. This is also used for duplicate slug/entity checks when slug is omitted."),
7593
7602
  description: z6.string().trim().min(8).max(600).describe("Short article summary and schema.org description."),
7594
7603
  slug: z6.string().trim().max(180).optional().describe("Optional URL slug. Omit to derive one from title."),
7595
7604
  entityId: z6.string().trim().max(80).optional().describe("Existing Transparent Public Wiki entity id when proposing an edit. New entities normally omit this and receive a TPW-Q id."),
7596
7605
  entityType: z6.string().trim().max(120).default("PublicArticle").describe("Backend Wikidata-style type. Prefer precise entity classes such as SoftwareApplication, Organization, Person, Event, Place, Taxon, ScienceConcept, MathConcept, TechArticle, or PublicArticle; the public article structure should match the selected type."),
7597
7606
  disambiguationName: z6.string().trim().max(240).optional().describe("Clarifying name used when the concept could be confused with another entity."),
7598
- featuredImage: CommonsFeaturedImageInputSchema.optional().describe("Required for auto-published public entities. The image is also added to the media manifest if absent."),
7607
+ featuredImage: CommonsFeaturedImageInputSchema.optional().describe("Required for auto-published public entities. First call commons_host_image and place its returned permanent URL here; validation does not fetch external images and reports unregistered URLs as not publishable. Submit retains a compatibility fallback that auto-hosts a stable direct public HTTPS image URL. The image is also added to the media manifest if absent."),
7599
7608
  source: CommonsSourceInputSchema.optional().describe("Source provenance. Store original URL, source byline, and origin canonical here; canonical does not replace rights review."),
7600
7609
  tags: z6.array(z6.string().trim().min(1).max(80)).max(24).optional().describe("Standardized topic tags. Use existing/searchable concepts when possible."),
7601
7610
  keywords: z6.array(z6.string().trim().min(1).max(120)).max(50).optional().describe("SEO and retrieval keywords."),
@@ -7657,8 +7666,8 @@ var CommonsGetEntityLedgerInputSchema = {
7657
7666
  idOrSlug: z6.string().trim().min(1).max(180).describe("Published entity id or /wiki/ slug whose contribution ledger should be read.")
7658
7667
  };
7659
7668
  var CommonsHostImageInputSchema = {
7660
- sourceUrl: z6.string().url().optional().describe("Public https image URL to download and host. The wiki never serves a third-party URL directly, so pass the original source here rather than putting it on the entity."),
7661
- imageBase64: z6.string().min(16).optional().describe("Base64 image bytes for an image you already hold. Use for images under about 3 MB; larger files should be published from a URL."),
7669
+ sourceUrl: z6.string().url().optional().describe("Stable direct public HTTPS URL whose response is the image bytes to host. Do not pass an HTML webpage, chat attachment reference, caller-local path, temporary or signed URL, or private/authenticated URL."),
7670
+ imageBase64: z6.string().min(16).optional().describe("Base64 image bytes for an image you already hold, including forwarded chat attachment bytes. Prefer this over a temporary attachment URL when the serialized request remains under about 3 MB; larger files require a stable direct public HTTPS source URL."),
7662
7671
  alt: z6.string().trim().max(500).optional().describe("Alt text describing the image for readers who cannot see it."),
7663
7672
  license: z6.string().trim().max(240).optional().describe("License or usage terms of the original image, preserved with the hosted copy."),
7664
7673
  attribution: z6.string().trim().max(500).optional().describe("Credit line for the original photographer, publication, or archive.")
@@ -7690,6 +7699,30 @@ var CommonsGenericOutputSchema = {
7690
7699
  error: z6.string().optional(),
7691
7700
  message: z6.string().optional()
7692
7701
  };
7702
+ var CommonsFeaturedImageDiagnosticsOutputSchema = z6.object({
7703
+ state: z6.enum(["missing", "external_unhosted", "commons_hosted"]).describe("Storage-readiness state for the candidate featured image."),
7704
+ url: z6.string().url().nullable().describe("Normalized candidate featured-image URL, or null when none was supplied."),
7705
+ commonsImageId: z6.string().nullable().describe("Registered Commons image ID when metadata proves the image is hosted, otherwise null."),
7706
+ readyForPublish: z6.boolean().describe("Whether Commons storage metadata proves this featured image is ready to publish."),
7707
+ submitWillAttemptAutoHost: z6.boolean().describe("Whether submit will use its compatibility fallback to try hosting this external image."),
7708
+ requiredAction: z6.string().nullable().describe("Action the caller must take before submit, or null when the image is ready.")
7709
+ }).describe("Featured-image storage readiness determined without fetching or storing external bytes.");
7710
+ var CommonsValidateEntityOutputSchema = {
7711
+ ok: z6.boolean(),
7712
+ data: z6.object({
7713
+ ok: z6.literal(true),
7714
+ valid: z6.boolean(),
7715
+ publishable: z6.boolean(),
7716
+ autoPublishEligible: z6.boolean(),
7717
+ errors: z6.array(z6.string()),
7718
+ warnings: z6.array(z6.string()),
7719
+ imageDiagnostics: z6.object({
7720
+ featuredImage: CommonsFeaturedImageDiagnosticsOutputSchema
7721
+ }).describe("Read-only image readiness and recovery guidance for this payload.")
7722
+ }).passthrough().optional(),
7723
+ error: z6.string().optional(),
7724
+ message: z6.string().optional()
7725
+ };
7693
7726
  var DirectoryWorkflowStatusInputSchema = {
7694
7727
  jobId: z6.string().trim().min(1).describe("The jobId returned by directory_workflow. Poll until status is complete, partial, empty, or failed.")
7695
7728
  };
@@ -11527,9 +11560,9 @@ function registerPaaExtractorMcpTools(server, executor, options = {}) {
11527
11560
  }, async (input) => executor.commonsPrepareEntity(input));
11528
11561
  server.registerTool("commons_validate_entity", {
11529
11562
  title: "Transparent Commons Validate Entity",
11530
- description: "Validate a proposed Transparent Commons entity payload without writing. Checks publishable basics, featured image, source/body evidence, existing-entity conflict state, heading profile alignment, and unsupported placeholder sections. Call this after composing the page and before commons_submit_entity.",
11563
+ description: "Read-only validation for a proposed Transparent Commons entity payload. Call it after commons_prepare_entity, composing the page, and commons_host_image. It does not fetch or store image bytes: an external or otherwise unregistered featured image remains not publishable until commons_host_image returns the permanent Commons URL. Inspect imageDiagnostics for readiness and the required action before commons_submit_entity. Also checks source/body evidence, existing-entity conflict state, heading profile alignment, and unsupported placeholder sections.",
11531
11564
  inputSchema: CommonsValidateEntityInputSchema,
11532
- outputSchema: recordOutputSchema("commons_validate_entity", CommonsGenericOutputSchema),
11565
+ outputSchema: recordOutputSchema("commons_validate_entity", CommonsValidateEntityOutputSchema),
11533
11566
  annotations: {
11534
11567
  title: "Transparent Commons Validate Entity",
11535
11568
  readOnlyHint: true,
@@ -11540,7 +11573,7 @@ function registerPaaExtractorMcpTools(server, executor, options = {}) {
11540
11573
  }, async (input) => executor.commonsValidateEntity(input));
11541
11574
  server.registerTool("commons_submit_entity", {
11542
11575
  title: "Transparent Commons Governed Entity Write",
11543
- description: "Create or propose an edit to a Transparent Commons public wiki entity through the governed MCP Scraper write plane. A new entity costs 10 Credits; an edit to an existing entity costs 2 Credits. Preparation and validation are free, and idempotent retries are not charged twice. This never edits rendered HTML directly. Normal workflow is commons_prepare_entity, compose, commons_validate_entity, then submit. commons_prepare_entity returns the entity profile contract and section guidance to compose against. Transparent Commons is an open wiki: any account may edit any entity, and every edit publishes and is recorded on the public contribution ledger. Publishing requires a featured image and body/source evidence. Pass baseRevision when editing so the ledger can show whether the edit was written on top of a newer revision. Requires idempotencyKey.",
11576
+ description: "Charged governed write that creates or proposes an edit to a Transparent Commons public wiki entity. A new entity costs 10 Credits; an edit costs 2 Credits. Preparation, image hosting, and validation are free, and idempotent retries are not charged twice. Normal workflow is commons_prepare_entity, compose the page, commons_host_image, commons_validate_entity, then submit with the returned permanent featuredImage.url. Submit retains a compatibility fallback that auto-hosts a stable direct public HTTPS image URL; if image ingress fails, it returns an actionable image tool error so you can host different bytes or a different stable source, replace the URL, validate again, and retry the same intended write with the same idempotencyKey. This never edits rendered HTML directly. Transparent Commons is an open wiki: any account may edit any entity, and every applied edit is recorded on the public contribution ledger. Publishing requires a ready featured image and body/source evidence. Pass baseRevision when editing so the ledger can show whether the edit was written on top of a newer revision. Requires idempotencyKey.",
11544
11577
  inputSchema: CommonsSubmitEntityInputSchema,
11545
11578
  outputSchema: recordOutputSchema("commons_submit_entity", CommonsGenericOutputSchema),
11546
11579
  annotations: {
@@ -11566,7 +11599,7 @@ function registerPaaExtractorMcpTools(server, executor, options = {}) {
11566
11599
  }, async (input) => executor.commonsGetEntityLedger(input));
11567
11600
  server.registerTool("commons_host_image", {
11568
11601
  title: "Host a Transparent Commons Image",
11569
- description: "Host an image from a public https URL or base64 bytes, returning a permanent Commons URL. Commons never serves a third-party image URL \u2014 commons_submit_entity hosts external images automatically, so use this only to host one before or independently of a write. JPEG, PNG, GIF, WebP up to 10 MB; SVG rejected. Identical bytes are stored once.",
11602
+ description: "Normal prerequisite for any featured image whose URL was not already returned by commons_host_image. Host image bytes from imageBase64 when you already have an attachment and the serialized request stays under about 3 MB, or from a stable direct public HTTPS image URL; do not pass a webpage, caller-local path, private URL, or temporary/signed attachment URL. Returns the permanent Commons URL to place in featuredImage.url before commons_validate_entity and commons_submit_entity. Submit can still auto-host a stable public source as a compatibility fallback. JPEG, PNG, GIF, and WebP are accepted up to 10 MB; SVG is rejected. Identical bytes are stored once.",
11570
11603
  inputSchema: CommonsHostImageInputSchema,
11571
11604
  outputSchema: recordOutputSchema("commons_host_image", CommonsGenericOutputSchema),
11572
11605
  annotations: {
@@ -126,7 +126,7 @@ import {
126
126
  updateKpoJobState,
127
127
  upsertPageSnapshot,
128
128
  verifyPassword
129
- } from "./chunk-55B3T5L2.js";
129
+ } from "./chunk-HZDJ5UZ4.js";
130
130
  export {
131
131
  CORE_SCHEMA_VERSION,
132
132
  CREDIT_LOTS_EPOCH,
@@ -4,7 +4,7 @@ import {
4
4
  downloadAsset,
5
5
  embedCommonsTexts,
6
6
  publicizeExtractionFailure
7
- } from "./chunk-DBWWIK7O.js";
7
+ } from "./chunk-EVOBJYBE.js";
8
8
  import "./chunk-OZJMVCDK.js";
9
9
  import {
10
10
  computeIssues,
@@ -18,12 +18,12 @@ import {
18
18
  createSiteExtractContentReader,
19
19
  createSiteExtractImageArtifact,
20
20
  extractJobLimitInfo
21
- } from "./chunk-KXRWY7DZ.js";
21
+ } from "./chunk-HWGQVP3Q.js";
22
22
  import "./chunk-DNM65UCK.js";
23
23
  import "./chunk-AYJHI2FK.js";
24
24
  import {
25
25
  getDb
26
- } from "./chunk-55B3T5L2.js";
26
+ } from "./chunk-HZDJ5UZ4.js";
27
27
 
28
28
  // src/api/extract-bundle.ts
29
29
  import { createWriteStream, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "fs";
package/dist/index.cjs CHANGED
@@ -310,7 +310,20 @@ var PUBLIC_ERROR_CODES = [
310
310
  "site_export_not_found",
311
311
  "site_export_format_unavailable",
312
312
  "site_export_read_failed",
313
- "site_export_image_not_found"
313
+ "site_export_image_not_found",
314
+ "image_url_invalid",
315
+ "image_url_not_https",
316
+ "image_host_unresolvable",
317
+ "image_host_blocked",
318
+ "image_redirect_invalid",
319
+ "image_source_unavailable",
320
+ "image_too_large",
321
+ "image_redirect_limit",
322
+ "image_base64_invalid",
323
+ "image_source_missing",
324
+ "image_format_unsupported",
325
+ "image_storage_unconfigured",
326
+ "featured_image_unhostable"
314
327
  ];
315
328
  var PUBLIC_ERROR_TYPES = [
316
329
  "request_aborted",
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  harvest
3
- } from "./chunk-K7Y27ND3.js";
3
+ } from "./chunk-CGOMGGOF.js";
4
4
  import {
5
5
  recordVendorUsage
6
- } from "./chunk-3TKKJQB4.js";
6
+ } from "./chunk-U2UHJWFW.js";
7
7
  import "./chunk-77LQV73B.js";
8
- import "./chunk-55B3T5L2.js";
8
+ import "./chunk-HZDJ5UZ4.js";
9
9
 
10
10
  // src/video/VideoGenerator.ts
11
11
  import { execSync as execSync2 } from "child_process";
@@ -30,8 +30,8 @@ import {
30
30
  saveLeadListEnrichmentRowResult,
31
31
  setInitializingLeadListEnrichmentConcurrencyLock,
32
32
  stableCanonicalJson
33
- } from "./chunk-ABYBPODM.js";
34
- import "./chunk-55B3T5L2.js";
33
+ } from "./chunk-JZPSG4NR.js";
34
+ import "./chunk-HZDJ5UZ4.js";
35
35
  export {
36
36
  LEAD_LIST_MAX_DISPATCH_ATTEMPTS,
37
37
  LEAD_LIST_RUNNING_STALE_MINUTES,
@@ -13,9 +13,9 @@ import {
13
13
  parseHostedCensusPlacesCsv,
14
14
  parseHostedZipGroupsCsv,
15
15
  queryHostedLocationMarkets
16
- } from "./chunk-PMCT2YQM.js";
16
+ } from "./chunk-HBZENASD.js";
17
17
  import "./chunk-RJ7JVYKU.js";
18
- import "./chunk-55B3T5L2.js";
18
+ import "./chunk-HZDJ5UZ4.js";
19
19
  export {
20
20
  HOSTED_CENSUS_DATASET_PREFIX,
21
21
  HOSTED_ZIP_DATASET_KIND,