@carrierllc/mcp 0.13.82 → 0.13.83

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/dist/cli.js CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  verifyStorefront,
46
46
  walletScreen,
47
47
  which
48
- } from "./chunk-FKHHZ7V2.js";
48
+ } from "./chunk-MIGP6YJH.js";
49
49
  import {
50
50
  copyTree,
51
51
  exists,
@@ -2368,16 +2368,17 @@ async function publishHostedStorefront(input) {
2368
2368
  }
2369
2369
  const filled = completePlanInput(planInput(input), existing?.plans ?? []);
2370
2370
  const plan = storefrontPlanBody(filled);
2371
- if (isStorefrontPlanError(plan)) return { ok: false, text: plan.error };
2371
+ const planError = isStorefrontPlanError(plan) ? plan.error : null;
2372
2372
  const brand = storefrontBrandPatch(input, existing ?? void 0);
2373
2373
  const record2 = { slug: input.slug, name: input.name, status: input.status, ...brand };
2374
2374
  const saved = existing ? await callRestEndpoint("PATCH", "/v1/storefronts/{id}", { id: existing.id, ...record2 }) : await callRestEndpoint("POST", "/v1/storefronts", record2, { idempotencyKey: `site-publish:${input.slug}` });
2375
2375
  if (!saved.ok) return saved;
2376
+ if (planError) return withPlanError(withShopAddress(saved, input.slug), planError);
2376
2377
  if (!plan) return withShopAddress(saved, input.slug);
2377
2378
  const id = existing?.id ?? readId(saved.text);
2378
2379
  if (!id) return { ok: false, text: "The store was saved but its id was missing, so the plan was not written." };
2379
2380
  const planned = await callRestEndpoint("POST", "/v1/storefronts/{id}/plans", { id, ...plan });
2380
- return planned.ok ? withShopAddress(planned, input.slug) : planned;
2381
+ return planned.ok ? withShopAddress(planned, input.slug) : withPlanError(withShopAddress(saved, input.slug), planned.text);
2381
2382
  }
2382
2383
  function firstPublishCopy(input) {
2383
2384
  const hero = input.hero?.trim() ?? "";
@@ -2391,6 +2392,10 @@ function firstPublishCopy(input) {
2391
2392
  if (legalName === "" || legalName === "Lifecycle Innovations Limited") return "Enter a legal name.";
2392
2393
  return null;
2393
2394
  }
2395
+ function withPlanError(result, message) {
2396
+ return { ok: true, text: `${result.text}
2397
+ Plan not added: ${message}` };
2398
+ }
2394
2399
  function withShopAddress(result, slug2) {
2395
2400
  const address = hostedStorefrontUrl(slug2);
2396
2401
  if (result.text.includes(address)) return result;