@snowcone-app/mcp 0.6.0 → 0.7.1

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,17 @@
1
1
  # @snowcone-app/mcp
2
2
 
3
+ ## 0.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#812](https://github.com/snowcone-app/snowcone-monorepo/pull/812) [`d109687`](https://github.com/snowcone-app/snowcone-monorepo/commit/d1096871902f250655fba2afa3276df8710a7e36) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Rotate the public catalog search key (the previous value was over-permissioned; the new one is read-only/search-scoped).
8
+
9
+ ## 0.7.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#662](https://github.com/snowcone-app/snowcone-monorepo/pull/662) [`755ad1d`](https://github.com/snowcone-app/snowcone-monorepo/commit/755ad1dc55449c4ec2b0da0158ff411913dce832) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Semantic visual search for the designs catalog: every design gets an AI-generated visual caption (indexed + searchable) and the index carries an embedder, so descriptive queries like "pink cowgirl boots on the moon" match designs regardless of publisher metadata. `searchDesigns` (SDK) and `snowcone_search_designs` (MCP) now send hybrid keyword+semantic search by default — tune with `semanticRatio` / `semantic_ratio` (0 = keyword-only).
14
+
3
15
  ## 0.6.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ var API_BASE = stripSlash(process.env.SNOWCONE_API_BASE ?? "https://api.snowcone
12
12
  var IMG_BASE = stripSlash(process.env.SNOWCONE_IMG_BASE ?? "https://img.snowcone.app");
13
13
  var BUY_BASE = stripSlash(process.env.SNOWCONE_BUY_BASE ?? "https://buy.snowcone.app");
14
14
  var MEILI_HOST = stripSlash(process.env.SNOWCONE_MEILI_HOST ?? "https://search.snowcone.app");
15
- var MEILI_KEY = process.env.SNOWCONE_MEILI_KEY ?? "eee819b849798ad9091228c486ec05d0931e5292";
15
+ var MEILI_KEY = process.env.SNOWCONE_MEILI_KEY ?? "4a11f6599e39af365f6289dab46b77a30ef78ba1ac078f7d74e152c099b3b63c";
16
16
  var MEILI_INDEX = process.env.SNOWCONE_MEILI_INDEX ?? "snowcone";
17
17
  var MEILI_DESIGNS_INDEX = process.env.SNOWCONE_MEILI_DESIGNS_INDEX ?? "snowcone-designs";
18
18
  var CHARACTER_LIMIT = 25e3;
@@ -217,13 +217,20 @@ function summarizeProduct(p) {
217
217
 
218
218
  // src/designs.ts
219
219
  var headers2 = { Authorization: `Bearer ${MEILI_KEY}` };
220
- async function searchDesigns(query, limit, offset, filter) {
220
+ async function searchDesigns(query, limit, offset, filter, semanticRatio) {
221
+ const ratio = semanticRatio ?? 0.5;
221
222
  const body = await httpJson(
222
223
  `${MEILI_HOST}/indexes/${MEILI_DESIGNS_INDEX}/search`,
223
224
  {
224
225
  method: "POST",
225
226
  headers: headers2,
226
- body: { q: query, limit, offset, ...filter ? { filter } : {} }
227
+ body: {
228
+ q: query,
229
+ limit,
230
+ offset,
231
+ ...filter ? { filter } : {},
232
+ ...query && ratio > 0 ? { hybrid: { embedder: "default", semanticRatio: ratio } } : {}
233
+ }
227
234
  }
228
235
  );
229
236
  return { hits: body.hits ?? [], estimatedTotalHits: body.estimatedTotalHits ?? body.hits?.length ?? 0 };
@@ -364,6 +371,15 @@ var PARAMS = {
364
371
  */
365
372
  design: "design",
366
373
  placement: "placement",
374
+ /**
375
+ * Album page selector (ADR-0086 §5): `page=N` (positive integer) picks which
376
+ * page/spread of an album product a mockup renders. Only valid on products
377
+ * whose catalog entry carries an `album` block — the edge resolver maps page
378
+ * N onto the repeating page placement (`page_N` → the geometry of
379
+ * `album.pagePlacement`); the catalog never enumerates `page_1…page_100` and
380
+ * the render server is unchanged.
381
+ */
382
+ page: "page",
367
383
  variant: "variant",
368
384
  mockup: "mockup",
369
385
  width: "width",
@@ -373,10 +389,10 @@ var PARAMS = {
373
389
  maskOverrides: "maskOverrides",
374
390
  /**
375
391
  * Render-only option picks (the `affectsCombinations:false` attributes), as a
376
- * base64 JSON map `{ attributeName: choiceLabel }`. rendercenter already parses
392
+ * base64 JSON map `{ attributeName: choiceLabel }`. The render server already parses
377
393
  * this and resolves per-choice underlays from it; the builder emits it so the
378
394
  * edge resolver can forward render-only picks (e.g. a cap's Crown/Strap color)
379
- * without changing rendercenter's grammar.
395
+ * without changing the server grammar.
380
396
  */
381
397
  optionSelections: "optionSelections",
382
398
  signature: "signature",
@@ -422,6 +438,9 @@ function buildPublicMockupUrl(options, cfg = {}) {
422
438
  if (options.placement !== void 0) {
423
439
  parts.push(`${PARAMS.placement}=${enc(options.placement)}`);
424
440
  }
441
+ if (options.page !== void 0) {
442
+ parts.push(`${PARAMS.page}=${options.page}`);
443
+ }
425
444
  if (options.options) {
426
445
  for (const attr of Object.keys(options.options).sort()) {
427
446
  parts.push(`${PARAM_PREFIX.opt}${enc(attr)}=${enc(options.options[attr])}`);
@@ -444,6 +463,7 @@ var PUBLIC_PARAM_NAMES = [
444
463
  PARAMS.design,
445
464
  PARAMS.shop,
446
465
  PARAMS.placement,
466
+ PARAMS.page,
447
467
  PARAMS.variant,
448
468
  PARAMS.mockup,
449
469
  PARAMS.width,
@@ -721,12 +741,13 @@ server.registerTool(
721
741
  "snowcone_search_designs",
722
742
  {
723
743
  title: "Search the pre-made designs catalog",
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.",
744
+ description: "Search the public catalog of remixable published designs \u2014 hybrid semantic + keyword over each design's AI visual caption, so descriptive queries like 'pink cowgirl boots on the moon' work (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.",
725
745
  inputSchema: {
726
746
  query: z.string().default("").describe("Search text, e.g. 'christmas card'. Empty string lists curated designs."),
727
747
  limit: z.number().int().min(1).max(50).default(10).describe("Max results (1-50)."),
728
748
  offset: z.number().int().min(0).default(0).describe("Pagination offset."),
729
749
  filter: z.string().optional().describe(`Meilisearch filter expression, e.g. "occasion = 'christmas' AND style = 'watercolor'".`),
750
+ semantic_ratio: z.number().min(0).max(1).default(0.5).describe("Semantic vs keyword blend (0 = keyword-only, 1 = fully semantic). Default 0.5."),
730
751
  shop: z.string().optional().describe("Your public Shop ID \u2014 when set, each result includes a ready-to-render mockup_url."),
731
752
  shop_secret: z.string().optional().describe("Per-shop secret (scsec_\u2026). With 'shop', URLs are L3-signed (server-side only \u2014 never expose it).")
732
753
  },
@@ -734,7 +755,7 @@ server.registerTool(
734
755
  },
735
756
  async (args) => {
736
757
  try {
737
- const { hits, estimatedTotalHits } = await searchDesigns(args.query, args.limit, args.offset, args.filter);
758
+ const { hits, estimatedTotalHits } = await searchDesigns(args.query, args.limit, args.offset, args.filter, args.semantic_ratio);
738
759
  const items = await Promise.all(hits.map((h) => summarizeDesign(h, args.shop, args.shop_secret)));
739
760
  const out = {
740
761
  total: estimatedTotalHits,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowcone-app/mcp",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
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",
@@ -42,7 +42,7 @@
42
42
  "tsup": "^8.1.0",
43
43
  "typescript": "^5.5.4",
44
44
  "vitest": "^2.1.9",
45
- "@snowcone-app/mockup-url": "0.1.1"
45
+ "@snowcone-app/mockup-url": "0.2.1"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"