@snowcone-app/mcp 0.5.0 → 0.6.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @snowcone-app/mcp
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#652](https://github.com/snowcone-app/snowcone-monorepo/pull/652) [`3f9175f`](https://github.com/snowcone-app/snowcone-monorepo/commit/3f9175fb1986642c94757f6b0f1b586c196f0ac6) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Render catalog designs by reference (ADR-0086): new `design=<pairingId|slug>` wire param. `getMockupUrl` accepts `designRef`, and the MCP `snowcone_search_designs` tool now returns `design=` reference URLs instead of re-assembling raw asset components. Catalog design renders are free — they never count against the shop's usage budget.
8
+
3
9
  ## 0.5.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.js CHANGED
@@ -354,6 +354,15 @@ var PARAMS = {
354
354
  shop: "shop",
355
355
  asset: "asset",
356
356
  assets: "assets",
357
+ /**
358
+ * Render a catalog design by reference (ADR-0086): `design=<pairingId|slug>`.
359
+ * The resolver looks the design up in the public `snowcone-designs` index
360
+ * (membership = license) and injects its asset components server-side, so no
361
+ * raw asset URL crosses the wire and no origin allowlisting is involved.
362
+ * Catalog renders are FREE — mutually exclusive with `asset`/`asset.<key>`/
363
+ * `color.<key>` (free = the design as published).
364
+ */
365
+ design: "design",
357
366
  placement: "placement",
358
367
  variant: "variant",
359
368
  mockup: "mockup",
@@ -407,6 +416,8 @@ function buildPublicMockupUrl(options, cfg = {}) {
407
416
  }
408
417
  } else if (options.assetUrl !== void 0) {
409
418
  parts.push(`${PARAMS.asset}=${enc(options.assetUrl)}`);
419
+ } else if (options.designRef !== void 0) {
420
+ parts.push(`${PARAMS.design}=${enc(options.designRef)}`);
410
421
  }
411
422
  if (options.placement !== void 0) {
412
423
  parts.push(`${PARAMS.placement}=${enc(options.placement)}`);
@@ -430,6 +441,7 @@ function buildPublicMockupUrl(options, cfg = {}) {
430
441
  }
431
442
  var PUBLIC_PARAM_NAMES = [
432
443
  PARAMS.asset,
444
+ PARAMS.design,
433
445
  PARAMS.shop,
434
446
  PARAMS.placement,
435
447
  PARAMS.variant,
@@ -496,6 +508,7 @@ async function buildUrl(input, base) {
496
508
  shop: input.shop,
497
509
  ...input.design ? { design: input.design } : {},
498
510
  ...input.asset !== void 0 ? { assetUrl: input.asset } : {},
511
+ ...input.designRef !== void 0 ? { designRef: input.designRef } : {},
499
512
  ...input.options ? { options: input.options } : {},
500
513
  ...input.variant !== void 0 ? { variant: input.variant } : {},
501
514
  ...input.view !== void 0 ? { mockup: input.view } : {},
@@ -694,12 +707,11 @@ async function summarizeDesign(d, shop, shopSecret) {
694
707
  license: d.license ?? { remixable: true },
695
708
  preview_thumbnail: d.previewThumbnail ?? null
696
709
  };
697
- if (!d.productId || !d.assets && !d.asset) return base;
710
+ if (!d.productId) return base;
698
711
  const input = {
699
712
  product: d.productId,
700
713
  shop: shop ?? "YOUR_SHOP_ID",
701
- ...d.assets ? { design: d.assets } : d.asset ? { asset: d.asset } : {},
702
- ...d.variant ? { variant: d.variant } : {},
714
+ designRef: String(d.pairingId ?? d.id),
703
715
  ...shop && shopSecret ? { shopSecret } : {}
704
716
  };
705
717
  const url = await renderUrl(input);
@@ -709,7 +721,7 @@ server.registerTool(
709
721
  "snowcone_search_designs",
710
722
  {
711
723
  title: "Search the pre-made designs catalog",
712
- description: "Full-text search the public catalog of remixable published designs (e.g. holiday cards, tees, posters; filter curated = true for first-party-curated picks) so an integration never starts from a blank canvas. Filterable facets: tags, occasion, style, productId, minPriceCents, curated. Each result includes the design's product, license, and a ready-to-render mockup_url when you pass your 'shop'. Without 'shop' you get a mockup_url_template containing YOUR_SHOP_ID to substitute.",
724
+ description: "Full-text search the public catalog of remixable published designs (e.g. holiday cards, tees, posters; filter curated = true for first-party-curated picks) so an integration never starts from a blank canvas. Filterable facets: tags, occasion, style, productId, minPriceCents, curated. Each result includes the design's product, license, and a ready-to-render mockup_url (a design=<pairingId> reference URL) when you pass your 'shop'. Catalog design renders are FREE \u2014 they don't count against the shop's usage budget. Without 'shop' you get a mockup_url_template containing YOUR_SHOP_ID to substitute.",
713
725
  inputSchema: {
714
726
  query: z.string().default("").describe("Search text, e.g. 'christmas card'. Empty string lists curated designs."),
715
727
  limit: z.number().int().min(1).max(50).default(10).describe("Max results (1-50)."),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowcone-app/mcp",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Snowcone MCP server — the agent-native quickstart. Mint a sandbox shop, browse the catalog, and turn any image into a buyable printed-merch mockup URL, all as callable tools.",
5
5
  "keywords": [
6
6
  "mcp",