mcp-scraper 0.66.7 → 0.67.0

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 +7 -0
  2. package/README.md +1 -1
  3. package/dist/bin/api-server.cjs +246 -41
  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 +56 -12
  10. package/dist/bin/mcp-stdio-server.js +6 -6
  11. package/dist/bin/paa-harvest.cjs +6 -0
  12. package/dist/bin/paa-harvest.js +3 -3
  13. package/dist/{chunk-F434YJPV.js → chunk-2L4C4DAZ.js} +1 -1
  14. package/dist/{chunk-LVXRWJJJ.js → chunk-2LXTOAKS.js} +1 -1
  15. package/dist/{chunk-CGOMGGOF.js → chunk-62LEXS5O.js} +2 -2
  16. package/dist/{chunk-HZDJ5UZ4.js → chunk-65FTMB7G.js} +25 -1
  17. package/dist/{chunk-U2UHJWFW.js → chunk-ES25GP6C.js} +1 -1
  18. package/dist/{chunk-7KB5QTHP.js → chunk-GT63KEUB.js} +1 -1
  19. package/dist/{chunk-O7ZC5Y3Z.js → chunk-IHDTONZV.js} +1 -1
  20. package/dist/{chunk-HWGQVP3Q.js → chunk-LCGTNWOT.js} +1 -1
  21. package/dist/{chunk-EVOBJYBE.js → chunk-LN6N3YLK.js} +1 -1
  22. package/dist/{chunk-JZPSG4NR.js → chunk-UL4ZKAWZ.js} +1 -1
  23. package/dist/{chunk-Z5QQEWXA.js → chunk-XOOKZYZG.js} +33 -13
  24. package/dist/{chunk-HBZENASD.js → chunk-Y46YNQMM.js} +1 -1
  25. package/dist/{db-MNNNIWVS.js → db-ZGZAKYBW.js} +1 -1
  26. package/dist/{extract-bundle-RW7CVIRF.js → extract-bundle-QQIYJSBW.js} +3 -3
  27. package/dist/index.cjs +6 -0
  28. package/dist/index.js +3 -3
  29. package/dist/{lead-list-enrichment-repository-PZYE6TDP.js → lead-list-enrichment-repository-CXLVIV3R.js} +2 -2
  30. package/dist/{location-data-repository-EPCNGMOM.js → location-data-repository-G72M7DTN.js} +2 -2
  31. package/dist/{server-KSVJ4X4V.js → server-MFVYRB6I.js} +206 -48
  32. package/dist/{site-extract-repository-CZ7SVT3Z.js → site-extract-repository-7EP6UX6I.js} +2 -2
  33. package/dist/{worker-IBLGV272.js → worker-JGWV2LID.js} +5 -5
  34. package/package.json +1 -1
@@ -107,6 +107,12 @@ var PUBLIC_ERROR_CODES = [
107
107
  "image_redirect_limit",
108
108
  "image_base64_invalid",
109
109
  "image_source_missing",
110
+ "image_source_ambiguous",
111
+ "image_source_type_invalid",
112
+ "image_artifact_not_found",
113
+ "image_page_too_large",
114
+ "page_image_not_found",
115
+ "page_image_candidates_unusable",
110
116
  "image_format_unsupported",
111
117
  "image_storage_unconfigured",
112
118
  "featured_image_unhostable"
@@ -214,6 +220,12 @@ function publicErrorType(code) {
214
220
  case "image_redirect_limit":
215
221
  case "image_base64_invalid":
216
222
  case "image_source_missing":
223
+ case "image_source_ambiguous":
224
+ case "image_source_type_invalid":
225
+ case "image_artifact_not_found":
226
+ case "image_page_too_large":
227
+ case "page_image_not_found":
228
+ case "page_image_candidates_unusable":
217
229
  case "image_format_unsupported":
218
230
  case "image_storage_unconfigured":
219
231
  case "featured_image_unhostable":
@@ -310,7 +322,19 @@ function publicErrorMessage(code) {
310
322
  case "image_base64_invalid":
311
323
  return "The supplied inline image bytes are invalid.";
312
324
  case "image_source_missing":
313
- return "Provide either a stable public image URL or inline image bytes.";
325
+ return "Provide exactly one of a public image or webpage URL, inline image bytes, or an owner-scoped image artifact.";
326
+ case "image_source_ambiguous":
327
+ return "Provide only one image source: sourceUrl, imageBase64, or artifactId.";
328
+ case "image_source_type_invalid":
329
+ return "Use sourceType only with inline image bytes or an owner-scoped image artifact.";
330
+ case "image_artifact_not_found":
331
+ return "The image artifact was not found, expired, or does not belong to this account.";
332
+ case "image_page_too_large":
333
+ return "The webpage is too large for bounded Commons image discovery.";
334
+ case "page_image_not_found":
335
+ return "The webpage did not expose a usable featured or content image.";
336
+ case "page_image_candidates_unusable":
337
+ return "The webpage exposed image candidates, but none returned supported public image bytes.";
314
338
  case "image_format_unsupported":
315
339
  return "Commons accepts JPEG, PNG, GIF, or WebP image bytes.";
316
340
  case "image_storage_unconfigured":
@@ -1286,7 +1310,7 @@ render();
1286
1310
  }
1287
1311
 
1288
1312
  // src/version.ts
1289
- var PACKAGE_VERSION = "0.66.7";
1313
+ var PACKAGE_VERSION = "0.67.0";
1290
1314
 
1291
1315
  // src/mcp/input-field-descriptions.ts
1292
1316
  var import_zod = require("zod");
@@ -8272,9 +8296,10 @@ seam is noted so you can chain them.
8272
8296
  guidance, recommended sections, optional sections, and heading guidance before any write occurs.
8273
8297
  - Host a featured image -> **commons_host_image**. The normal write sequence is **commons_prepare_entity ->
8274
8298
  compose the payload -> commons_host_image -> commons_validate_entity -> commons_submit_entity**. Put the
8275
- permanent returned URL in featuredImage.url. Use imageBase64 for available attachment bytes within the request
8276
- bound, or a stable direct public HTTPS image URL; never use a caller-local path, opaque chat attachment reference,
8277
- HTML page, private URL, or temporary/signed URL.
8299
+ permanent returned URL in featuredImage.url. Use imageBase64 for pasted or AI-generated bytes, artifactId for an
8300
+ owner-scoped MCP Scraper image artifact, or sourceUrl for either a public HTTPS image or a webpage containing one.
8301
+ Webpage discovery tries Open Graph, Twitter, JSON-LD, then meaningful content images. Never pass a caller-local
8302
+ path, opaque chat attachment reference, or private/authenticated URL.
8278
8303
  - Validate a composed entity without writing -> **commons_validate_entity**. Use it after image hosting and before
8279
8304
  submit. Validation does not fetch or store image bytes; an external/unregistered featured image is reported in
8280
8305
  imageDiagnostics as not publishable until commons_host_image returns its permanent Commons URL. Validation also
@@ -10181,7 +10206,7 @@ var CommonsGetEntityLinksetInputSchema = {
10181
10206
  idOrSlug: import_zod8.z.string().trim().min(1).max(180).describe("Transparent Commons TPW-Q entity id or /wiki/ slug whose governed RFC 9264 linkset should be read.")
10182
10207
  };
10183
10208
  var CommonsFeaturedImageInputSchema = import_zod8.z.object({
10184
- url: import_zod8.z.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."),
10209
+ url: import_zod8.z.string().url().describe("For a publish-ready entity, use the permanent URL returned by commons_host_image. Validation reports any unregistered external URL as not ready. Do not use a chat attachment reference, caller-local path, private URL, or HTML page URL here; pass the original image or webpage source to commons_host_image first."),
10185
10210
  alt: import_zod8.z.string().trim().max(500).optional(),
10186
10211
  caption: import_zod8.z.string().trim().max(1e3).optional(),
10187
10212
  sourceUrl: import_zod8.z.string().url().optional(),
@@ -10280,7 +10305,7 @@ var CommonsSubmitEntityInputSchema = {
10280
10305
  entityId: import_zod8.z.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."),
10281
10306
  entityType: import_zod8.z.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."),
10282
10307
  disambiguationName: import_zod8.z.string().trim().max(240).optional().describe("Clarifying name used when the concept could be confused with another entity."),
10283
- 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."),
10308
+ featuredImage: CommonsFeaturedImageInputSchema.optional().describe("Required for auto-published public entities. First call commons_host_image with attachment bytes, an image artifact, a direct image URL, or a webpage URL, then place its returned permanent URL here. Validation does not fetch external images and reports unregistered URLs as not publishable. Submit retains a compatibility fallback for public URLs. The image is also added to the media manifest if absent."),
10284
10309
  source: CommonsSourceInputSchema.optional().describe("Source provenance. Store original URL, source byline, and origin canonical here; canonical does not replace rights review."),
10285
10310
  tags: import_zod8.z.array(import_zod8.z.string().trim().min(1).max(80)).max(24).optional().describe("Standardized topic tags. Use existing/searchable concepts when possible."),
10286
10311
  keywords: import_zod8.z.array(import_zod8.z.string().trim().min(1).max(120)).max(50).optional().describe("SEO and retrieval keywords."),
@@ -10342,12 +10367,31 @@ var CommonsGetEntityLedgerInputSchema = {
10342
10367
  idOrSlug: import_zod8.z.string().trim().min(1).max(180).describe("Published entity id or /wiki/ slug whose contribution ledger should be read.")
10343
10368
  };
10344
10369
  var CommonsHostImageInputSchema = {
10345
- sourceUrl: import_zod8.z.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."),
10346
- imageBase64: import_zod8.z.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."),
10370
+ sourceUrl: import_zod8.z.string().url().optional().describe("Public HTTPS direct image URL or webpage URL. A direct image is hosted as-is; an HTML page is inspected for Open Graph, Twitter, JSON-LD, and meaningful content images, then the first usable candidate is hosted. Temporary signed URLs are consumed immediately and query credentials are not retained as provenance."),
10371
+ imageBase64: import_zod8.z.string().min(16).optional().describe("Base64 image bytes for an image already available to the caller, including a pasted attachment or AI-generated image. Use sourceType to preserve whether it was uploaded or generated. Keep the complete serialized request within the client transport limit."),
10372
+ artifactId: import_zod8.z.string().trim().min(1).max(500).optional().describe("Owner-scoped image artifact returned by an MCP Scraper media or screenshot workflow. The server reauthorizes ownership and reads the bytes directly; do not construct an artifact ID."),
10373
+ sourceType: import_zod8.z.enum(["uploaded", "ai_generated"]).optional().describe("Provenance for imageBase64 or artifactId. Use ai_generated only when an image model created the supplied bytes; otherwise use uploaded or omit it."),
10347
10374
  alt: import_zod8.z.string().trim().max(500).optional().describe("Alt text describing the image for readers who cannot see it."),
10348
10375
  license: import_zod8.z.string().trim().max(240).optional().describe("License or usage terms of the original image, preserved with the hosted copy."),
10349
10376
  attribution: import_zod8.z.string().trim().max(500).optional().describe("Credit line for the original photographer, publication, or archive.")
10350
10377
  };
10378
+ var CommonsHostImageOutputSchema = {
10379
+ ok: import_zod8.z.boolean(),
10380
+ data: import_zod8.z.object({
10381
+ id: import_zod8.z.string().describe("Stable Commons image ID."),
10382
+ url: import_zod8.z.string().url().describe("Permanent Commons URL to use as featuredImage.url."),
10383
+ contentType: import_zod8.z.enum(["image/jpeg", "image/png", "image/gif", "image/webp"]),
10384
+ bytes: import_zod8.z.number().int().positive(),
10385
+ digest: import_zod8.z.string(),
10386
+ sourceUrl: import_zod8.z.string().url().nullable().describe("Sanitized direct asset URL that supplied the hosted bytes, when applicable."),
10387
+ sourcePageUrl: import_zod8.z.string().url().nullable().describe("Sanitized webpage URL from which the image was discovered, when applicable."),
10388
+ sourceKind: import_zod8.z.enum(["uploaded", "ai_generated", "artifact", "direct_url", "webpage", "registered"]),
10389
+ selectionSource: import_zod8.z.enum(["provided_bytes", "artifact", "direct_url", "og:image", "twitter:image", "json-ld", "content-image", "registered"]),
10390
+ reused: import_zod8.z.boolean().describe("True when identical image bytes were already stored.")
10391
+ }).optional(),
10392
+ error: import_zod8.z.string().optional(),
10393
+ message: import_zod8.z.string().optional()
10394
+ };
10351
10395
  var CommonsGetProposalInputSchema = {
10352
10396
  proposalId: import_zod8.z.string().trim().min(1).max(120).describe("Proposal id returned by commons_submit_entity, in the form commons-proposal-<uuid>.")
10353
10397
  };
@@ -14144,9 +14188,9 @@ function registerPaaExtractorMcpTools(server, executor, options = {}) {
14144
14188
  }, async (input) => executor.commonsGetEntityLedger(input));
14145
14189
  server.registerTool("commons_host_image", {
14146
14190
  title: "Host a Transparent Commons Image",
14147
- 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.",
14191
+ description: "Turn one supplied image source into a permanent Transparent Commons image before validation and submission. Provide exactly one of imageBase64 for a pasted or AI-generated image, artifactId for an owner-scoped MCP Scraper image artifact, or sourceUrl for either a direct public HTTPS image or a webpage containing the desired image. Webpages are inspected in deterministic order for Open Graph, Twitter, JSON-LD, and meaningful content images; unusable candidates fall through to the next candidate. Returns the permanent URL for featuredImage.url plus source and selection provenance. JPEG, PNG, GIF, and WebP are accepted up to 10 MB; SVG is rejected. Identical bytes are stored once. Never pass a caller-local path or private/authenticated URL.",
14148
14192
  inputSchema: CommonsHostImageInputSchema,
14149
- outputSchema: recordOutputSchema("commons_host_image", CommonsGenericOutputSchema),
14193
+ outputSchema: recordOutputSchema("commons_host_image", CommonsHostImageOutputSchema),
14150
14194
  annotations: {
14151
14195
  title: "Host a Transparent Commons Image",
14152
14196
  readOnlyHint: false,
@@ -18752,7 +18796,7 @@ var HostedMemoryMcpToolExecutor = class {
18752
18796
 
18753
18797
  // release-message.json
18754
18798
  var release_message_default = {
18755
- message: "Transparent Commons now verifies featured-image readiness before publishing, and replacement integration connections keep their paid period."
18799
+ message: "Transparent Commons can now turn pasted images, generated image bytes, stored image artifacts, direct image URLs, or ordinary webpage URLs into one permanent Commons-hosted image before validation and publishing."
18756
18800
  };
18757
18801
 
18758
18802
  // src/install-terminal.ts
@@ -13,21 +13,21 @@ import {
13
13
  registerScheduledResultsMcpTools,
14
14
  registerSerpIntelligenceCaptureTools,
15
15
  resolveDeploymentProfile
16
- } from "../chunk-Z5QQEWXA.js";
16
+ } from "../chunk-XOOKZYZG.js";
17
17
  import "../chunk-PGJQDMC2.js";
18
- import "../chunk-F434YJPV.js";
19
- import "../chunk-U2UHJWFW.js";
18
+ import "../chunk-2L4C4DAZ.js";
19
+ import "../chunk-ES25GP6C.js";
20
20
  import {
21
21
  renderInstallTerminal
22
- } from "../chunk-O7ZC5Y3Z.js";
22
+ } from "../chunk-IHDTONZV.js";
23
23
  import "../chunk-VXLU74YZ.js";
24
24
  import "../chunk-GGZEC22A.js";
25
25
  import {
26
26
  PACKAGE_VERSION
27
- } from "../chunk-7KB5QTHP.js";
27
+ } from "../chunk-GT63KEUB.js";
28
28
  import "../chunk-DNM65UCK.js";
29
29
  import "../chunk-AYJHI2FK.js";
30
- import "../chunk-HZDJ5UZ4.js";
30
+ import "../chunk-65FTMB7G.js";
31
31
 
32
32
  // bin/mcp-stdio-server.ts
33
33
  import { readFileSync } from "fs";
@@ -311,6 +311,12 @@ var PUBLIC_ERROR_CODES = [
311
311
  "image_redirect_limit",
312
312
  "image_base64_invalid",
313
313
  "image_source_missing",
314
+ "image_source_ambiguous",
315
+ "image_source_type_invalid",
316
+ "image_artifact_not_found",
317
+ "image_page_too_large",
318
+ "page_image_not_found",
319
+ "page_image_candidates_unusable",
314
320
  "image_format_unsupported",
315
321
  "image_storage_unconfigured",
316
322
  "featured_image_unhostable"
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  harvest
4
- } from "../chunk-CGOMGGOF.js";
4
+ } from "../chunk-62LEXS5O.js";
5
5
  import {
6
6
  browserServiceApiKey
7
- } from "../chunk-U2UHJWFW.js";
7
+ } from "../chunk-ES25GP6C.js";
8
8
  import "../chunk-77LQV73B.js";
9
- import "../chunk-HZDJ5UZ4.js";
9
+ import "../chunk-65FTMB7G.js";
10
10
 
11
11
  // src/cli.ts
12
12
  import { Command } from "commander";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  publicErrorMessage,
3
3
  sanitizeVendorName
4
- } from "./chunk-HZDJ5UZ4.js";
4
+ } from "./chunk-65FTMB7G.js";
5
5
 
6
6
  // src/api/outbound-sanitize.ts
7
7
  var KEY_RENAMES = {
@@ -10,7 +10,7 @@ import {
10
10
  finishHarvestAttempt,
11
11
  publicErrorMessage,
12
12
  startHarvestAttempt
13
- } from "./chunk-HZDJ5UZ4.js";
13
+ } from "./chunk-65FTMB7G.js";
14
14
 
15
15
  // src/api/harvest-problems.ts
16
16
  function errorMessage(err) {
@@ -6,7 +6,7 @@ import {
6
6
  currentCostContext,
7
7
  recordKernelSession,
8
8
  runWithCostContext
9
- } from "./chunk-U2UHJWFW.js";
9
+ } from "./chunk-ES25GP6C.js";
10
10
  import {
11
11
  DEFAULT_PROXY_MODE,
12
12
  HarvestOptionsSchema,
@@ -21,7 +21,7 @@ import {
21
21
  RECAPTCHA_INSTRUCTIONS,
22
22
  RequestAbortedError,
23
23
  sanitizeVendorName
24
- } from "./chunk-HZDJ5UZ4.js";
24
+ } from "./chunk-65FTMB7G.js";
25
25
 
26
26
  // src/driver/BrowserDriver.ts
27
27
  import { chromium } from "playwright-extra";
@@ -53,6 +53,12 @@ var PUBLIC_ERROR_CODES = [
53
53
  "image_redirect_limit",
54
54
  "image_base64_invalid",
55
55
  "image_source_missing",
56
+ "image_source_ambiguous",
57
+ "image_source_type_invalid",
58
+ "image_artifact_not_found",
59
+ "image_page_too_large",
60
+ "page_image_not_found",
61
+ "page_image_candidates_unusable",
56
62
  "image_format_unsupported",
57
63
  "image_storage_unconfigured",
58
64
  "featured_image_unhostable"
@@ -187,6 +193,12 @@ function publicErrorType(code) {
187
193
  case "image_redirect_limit":
188
194
  case "image_base64_invalid":
189
195
  case "image_source_missing":
196
+ case "image_source_ambiguous":
197
+ case "image_source_type_invalid":
198
+ case "image_artifact_not_found":
199
+ case "image_page_too_large":
200
+ case "page_image_not_found":
201
+ case "page_image_candidates_unusable":
190
202
  case "image_format_unsupported":
191
203
  case "image_storage_unconfigured":
192
204
  case "featured_image_unhostable":
@@ -283,7 +295,19 @@ function publicErrorMessage(code) {
283
295
  case "image_base64_invalid":
284
296
  return "The supplied inline image bytes are invalid.";
285
297
  case "image_source_missing":
286
- return "Provide either a stable public image URL or inline image bytes.";
298
+ return "Provide exactly one of a public image or webpage URL, inline image bytes, or an owner-scoped image artifact.";
299
+ case "image_source_ambiguous":
300
+ return "Provide only one image source: sourceUrl, imageBase64, or artifactId.";
301
+ case "image_source_type_invalid":
302
+ return "Use sourceType only with inline image bytes or an owner-scoped image artifact.";
303
+ case "image_artifact_not_found":
304
+ return "The image artifact was not found, expired, or does not belong to this account.";
305
+ case "image_page_too_large":
306
+ return "The webpage is too large for bounded Commons image discovery.";
307
+ case "page_image_not_found":
308
+ return "The webpage did not expose a usable featured or content image.";
309
+ case "page_image_candidates_unusable":
310
+ return "The webpage exposed image candidates, but none returned supported public image bytes.";
287
311
  case "image_format_unsupported":
288
312
  return "Commons accepts JPEG, PNG, GIF, or WebP image bytes.";
289
313
  case "image_storage_unconfigured":
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDb
3
- } from "./chunk-HZDJ5UZ4.js";
3
+ } from "./chunk-65FTMB7G.js";
4
4
 
5
5
  // src/lib/browser-service-env.ts
6
6
  function browserServiceApiKey() {
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var PACKAGE_VERSION = "0.66.7";
2
+ var PACKAGE_VERSION = "0.67.0";
3
3
 
4
4
  export {
5
5
  PACKAGE_VERSION
@@ -1,6 +1,6 @@
1
1
  // release-message.json
2
2
  var release_message_default = {
3
- message: "Transparent Commons now verifies featured-image readiness before publishing, and replacement integration connections keep their paid period."
3
+ message: "Transparent Commons can now turn pasted images, generated image bytes, stored image artifacts, direct image URLs, or ordinary webpage URLs into one permanent Commons-hosted image before validation and publishing."
4
4
  };
5
5
 
6
6
  // src/install-terminal.ts
@@ -15,7 +15,7 @@ import {
15
15
  sanitizeVendorName,
16
16
  serializePublicErrorEnvelope,
17
17
  settleDebitMcIdempotent
18
- } from "./chunk-HZDJ5UZ4.js";
18
+ } from "./chunk-65FTMB7G.js";
19
19
 
20
20
  // src/api/site-extract-content-store.ts
21
21
  import { createHash } from "crypto";
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  buildPublicErrorEnvelope,
10
10
  getDb
11
- } from "./chunk-HZDJ5UZ4.js";
11
+ } from "./chunk-65FTMB7G.js";
12
12
 
13
13
  // src/lib/media-extractor.ts
14
14
  import { createWriteStream, mkdirSync, rmSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDb
3
- } from "./chunk-HZDJ5UZ4.js";
3
+ } from "./chunk-65FTMB7G.js";
4
4
 
5
5
  // src/api/lead-list-enrichment-repository.ts
6
6
  import { createHash, randomUUID } from "crypto";
@@ -8,13 +8,13 @@ import {
8
8
  } from "./chunk-PGJQDMC2.js";
9
9
  import {
10
10
  sanitizeOutboundDiagnostics
11
- } from "./chunk-F434YJPV.js";
11
+ } from "./chunk-2L4C4DAZ.js";
12
12
  import {
13
13
  browserServiceProfileName,
14
14
  browserServiceProfileSaveChanges,
15
15
  recordVendorUsage,
16
16
  vendorCostUsd
17
- } from "./chunk-U2UHJWFW.js";
17
+ } from "./chunk-ES25GP6C.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-7KB5QTHP.js";
28
+ } from "./chunk-GT63KEUB.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-HZDJ5UZ4.js";
48
+ } from "./chunk-65FTMB7G.js";
49
49
 
50
50
  // src/harvest-timeout.ts
51
51
  var SCRAPE_FUNCTION_MAX_MS = 8e5;
@@ -390,9 +390,10 @@ seam is noted so you can chain them.
390
390
  guidance, recommended sections, optional sections, and heading guidance before any write occurs.
391
391
  - Host a featured image -> **commons_host_image**. The normal write sequence is **commons_prepare_entity ->
392
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.
393
+ permanent returned URL in featuredImage.url. Use imageBase64 for pasted or AI-generated bytes, artifactId for an
394
+ owner-scoped MCP Scraper image artifact, or sourceUrl for either a public HTTPS image or a webpage containing one.
395
+ Webpage discovery tries Open Graph, Twitter, JSON-LD, then meaningful content images. Never pass a caller-local
396
+ path, opaque chat attachment reference, or private/authenticated URL.
396
397
  - Validate a composed entity without writing -> **commons_validate_entity**. Use it after image hosting and before
397
398
  submit. Validation does not fetch or store image bytes; an external/unregistered featured image is reported in
398
399
  imageDiagnostics as not publishable until commons_host_image returns its permanent Commons URL. Validation also
@@ -7505,7 +7506,7 @@ var CommonsGetEntityLinksetInputSchema = {
7505
7506
  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.")
7506
7507
  };
7507
7508
  var CommonsFeaturedImageInputSchema = z6.object({
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."),
7509
+ url: z6.string().url().describe("For a publish-ready entity, use the permanent URL returned by commons_host_image. Validation reports any unregistered external URL as not ready. Do not use a chat attachment reference, caller-local path, private URL, or HTML page URL here; pass the original image or webpage source to commons_host_image first."),
7509
7510
  alt: z6.string().trim().max(500).optional(),
7510
7511
  caption: z6.string().trim().max(1e3).optional(),
7511
7512
  sourceUrl: z6.string().url().optional(),
@@ -7604,7 +7605,7 @@ var CommonsSubmitEntityInputSchema = {
7604
7605
  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."),
7605
7606
  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."),
7606
7607
  disambiguationName: z6.string().trim().max(240).optional().describe("Clarifying name used when the concept could be confused with another entity."),
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."),
7608
+ featuredImage: CommonsFeaturedImageInputSchema.optional().describe("Required for auto-published public entities. First call commons_host_image with attachment bytes, an image artifact, a direct image URL, or a webpage URL, then place its returned permanent URL here. Validation does not fetch external images and reports unregistered URLs as not publishable. Submit retains a compatibility fallback for public URLs. The image is also added to the media manifest if absent."),
7608
7609
  source: CommonsSourceInputSchema.optional().describe("Source provenance. Store original URL, source byline, and origin canonical here; canonical does not replace rights review."),
7609
7610
  tags: z6.array(z6.string().trim().min(1).max(80)).max(24).optional().describe("Standardized topic tags. Use existing/searchable concepts when possible."),
7610
7611
  keywords: z6.array(z6.string().trim().min(1).max(120)).max(50).optional().describe("SEO and retrieval keywords."),
@@ -7666,12 +7667,31 @@ var CommonsGetEntityLedgerInputSchema = {
7666
7667
  idOrSlug: z6.string().trim().min(1).max(180).describe("Published entity id or /wiki/ slug whose contribution ledger should be read.")
7667
7668
  };
7668
7669
  var CommonsHostImageInputSchema = {
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."),
7670
+ sourceUrl: z6.string().url().optional().describe("Public HTTPS direct image URL or webpage URL. A direct image is hosted as-is; an HTML page is inspected for Open Graph, Twitter, JSON-LD, and meaningful content images, then the first usable candidate is hosted. Temporary signed URLs are consumed immediately and query credentials are not retained as provenance."),
7671
+ imageBase64: z6.string().min(16).optional().describe("Base64 image bytes for an image already available to the caller, including a pasted attachment or AI-generated image. Use sourceType to preserve whether it was uploaded or generated. Keep the complete serialized request within the client transport limit."),
7672
+ artifactId: z6.string().trim().min(1).max(500).optional().describe("Owner-scoped image artifact returned by an MCP Scraper media or screenshot workflow. The server reauthorizes ownership and reads the bytes directly; do not construct an artifact ID."),
7673
+ sourceType: z6.enum(["uploaded", "ai_generated"]).optional().describe("Provenance for imageBase64 or artifactId. Use ai_generated only when an image model created the supplied bytes; otherwise use uploaded or omit it."),
7671
7674
  alt: z6.string().trim().max(500).optional().describe("Alt text describing the image for readers who cannot see it."),
7672
7675
  license: z6.string().trim().max(240).optional().describe("License or usage terms of the original image, preserved with the hosted copy."),
7673
7676
  attribution: z6.string().trim().max(500).optional().describe("Credit line for the original photographer, publication, or archive.")
7674
7677
  };
7678
+ var CommonsHostImageOutputSchema = {
7679
+ ok: z6.boolean(),
7680
+ data: z6.object({
7681
+ id: z6.string().describe("Stable Commons image ID."),
7682
+ url: z6.string().url().describe("Permanent Commons URL to use as featuredImage.url."),
7683
+ contentType: z6.enum(["image/jpeg", "image/png", "image/gif", "image/webp"]),
7684
+ bytes: z6.number().int().positive(),
7685
+ digest: z6.string(),
7686
+ sourceUrl: z6.string().url().nullable().describe("Sanitized direct asset URL that supplied the hosted bytes, when applicable."),
7687
+ sourcePageUrl: z6.string().url().nullable().describe("Sanitized webpage URL from which the image was discovered, when applicable."),
7688
+ sourceKind: z6.enum(["uploaded", "ai_generated", "artifact", "direct_url", "webpage", "registered"]),
7689
+ selectionSource: z6.enum(["provided_bytes", "artifact", "direct_url", "og:image", "twitter:image", "json-ld", "content-image", "registered"]),
7690
+ reused: z6.boolean().describe("True when identical image bytes were already stored.")
7691
+ }).optional(),
7692
+ error: z6.string().optional(),
7693
+ message: z6.string().optional()
7694
+ };
7675
7695
  var CommonsGetProposalInputSchema = {
7676
7696
  proposalId: z6.string().trim().min(1).max(120).describe("Proposal id returned by commons_submit_entity, in the form commons-proposal-<uuid>.")
7677
7697
  };
@@ -11599,9 +11619,9 @@ function registerPaaExtractorMcpTools(server, executor, options = {}) {
11599
11619
  }, async (input) => executor.commonsGetEntityLedger(input));
11600
11620
  server.registerTool("commons_host_image", {
11601
11621
  title: "Host a Transparent Commons Image",
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.",
11622
+ description: "Turn one supplied image source into a permanent Transparent Commons image before validation and submission. Provide exactly one of imageBase64 for a pasted or AI-generated image, artifactId for an owner-scoped MCP Scraper image artifact, or sourceUrl for either a direct public HTTPS image or a webpage containing the desired image. Webpages are inspected in deterministic order for Open Graph, Twitter, JSON-LD, and meaningful content images; unusable candidates fall through to the next candidate. Returns the permanent URL for featuredImage.url plus source and selection provenance. JPEG, PNG, GIF, and WebP are accepted up to 10 MB; SVG is rejected. Identical bytes are stored once. Never pass a caller-local path or private/authenticated URL.",
11603
11623
  inputSchema: CommonsHostImageInputSchema,
11604
- outputSchema: recordOutputSchema("commons_host_image", CommonsGenericOutputSchema),
11624
+ outputSchema: recordOutputSchema("commons_host_image", CommonsHostImageOutputSchema),
11605
11625
  annotations: {
11606
11626
  title: "Host a Transparent Commons Image",
11607
11627
  readOnlyHint: false,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-RJ7JVYKU.js";
4
4
  import {
5
5
  getDb
6
- } from "./chunk-HZDJ5UZ4.js";
6
+ } from "./chunk-65FTMB7G.js";
7
7
 
8
8
  // src/api/location-data-repository.ts
9
9
  import { createHash, randomUUID } from "crypto";
@@ -126,7 +126,7 @@ import {
126
126
  updateKpoJobState,
127
127
  upsertPageSnapshot,
128
128
  verifyPassword
129
- } from "./chunk-HZDJ5UZ4.js";
129
+ } from "./chunk-65FTMB7G.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-EVOBJYBE.js";
7
+ } from "./chunk-LN6N3YLK.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-HWGQVP3Q.js";
21
+ } from "./chunk-LCGTNWOT.js";
22
22
  import "./chunk-DNM65UCK.js";
23
23
  import "./chunk-AYJHI2FK.js";
24
24
  import {
25
25
  getDb
26
- } from "./chunk-HZDJ5UZ4.js";
26
+ } from "./chunk-65FTMB7G.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
@@ -321,6 +321,12 @@ var PUBLIC_ERROR_CODES = [
321
321
  "image_redirect_limit",
322
322
  "image_base64_invalid",
323
323
  "image_source_missing",
324
+ "image_source_ambiguous",
325
+ "image_source_type_invalid",
326
+ "image_artifact_not_found",
327
+ "image_page_too_large",
328
+ "page_image_not_found",
329
+ "page_image_candidates_unusable",
324
330
  "image_format_unsupported",
325
331
  "image_storage_unconfigured",
326
332
  "featured_image_unhostable"
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  harvest
3
- } from "./chunk-CGOMGGOF.js";
3
+ } from "./chunk-62LEXS5O.js";
4
4
  import {
5
5
  recordVendorUsage
6
- } from "./chunk-U2UHJWFW.js";
6
+ } from "./chunk-ES25GP6C.js";
7
7
  import "./chunk-77LQV73B.js";
8
- import "./chunk-HZDJ5UZ4.js";
8
+ import "./chunk-65FTMB7G.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-JZPSG4NR.js";
34
- import "./chunk-HZDJ5UZ4.js";
33
+ } from "./chunk-UL4ZKAWZ.js";
34
+ import "./chunk-65FTMB7G.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-HBZENASD.js";
16
+ } from "./chunk-Y46YNQMM.js";
17
17
  import "./chunk-RJ7JVYKU.js";
18
- import "./chunk-HZDJ5UZ4.js";
18
+ import "./chunk-65FTMB7G.js";
19
19
  export {
20
20
  HOSTED_CENSUS_DATASET_PREFIX,
21
21
  HOSTED_ZIP_DATASET_KIND,