@carrierllc/mcp 0.13.48 → 0.13.51
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/{chunk-H77A3SME.js → chunk-NPAD6AA7.js} +49 -23
- package/dist/chunk-NPAD6AA7.js.map +1 -0
- package/dist/cli.js +26 -7
- package/dist/cli.js.map +1 -1
- package/dist/index.js +69 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/plugin/carrier/skills/storefront/SKILL.md +2 -2
- package/templates/storefront/CLERK.md +2 -0
- package/dist/chunk-H77A3SME.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
deriveAccentDark,
|
|
15
15
|
deriveAccentLight,
|
|
16
16
|
deriveAccentPaletteSubs,
|
|
17
|
+
discoverSecrets,
|
|
17
18
|
extractSubscriberStatus,
|
|
18
19
|
fleetScreen,
|
|
19
20
|
formatProbes,
|
|
@@ -44,7 +45,7 @@ import {
|
|
|
44
45
|
verifyStorefront,
|
|
45
46
|
walletScreen,
|
|
46
47
|
which
|
|
47
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-NPAD6AA7.js";
|
|
48
49
|
import {
|
|
49
50
|
copyTree,
|
|
50
51
|
exists,
|
|
@@ -6605,7 +6606,7 @@ async function maybeBuildDeploy(target, brand, opts) {
|
|
|
6605
6606
|
}
|
|
6606
6607
|
if (r.url) info(pc4.green(r.url));
|
|
6607
6608
|
if (opts.clerk && r.url) {
|
|
6608
|
-
const secretKey = process.env.CLERK_SECRET_KEY?.trim();
|
|
6609
|
+
const secretKey = process.env.CLERK_SECRET_KEY?.trim() || (await discoverSecrets(target, process.env)).CLERK_SECRET_KEY?.trim();
|
|
6609
6610
|
if (secretKey) {
|
|
6610
6611
|
const { allowedOrigins, redirectUrls } = storefrontClerkUrls(r.url, brand.domain);
|
|
6611
6612
|
const configured = await configureClerkInstance(secretKey, { allowedOrigins, redirectUrls });
|
|
@@ -6646,7 +6647,18 @@ async function verifyAndRepair(storefront, brand, url, targetId, projectName, op
|
|
|
6646
6647
|
}
|
|
6647
6648
|
const rs = p3.spinner();
|
|
6648
6649
|
rs.start(`Repairing: ${plan.note}`);
|
|
6649
|
-
if (plan.runClerk)
|
|
6650
|
+
if (plan.runClerk) {
|
|
6651
|
+
const provisioned = await runClerkStep(storefront, brand, url);
|
|
6652
|
+
if (!provisioned) {
|
|
6653
|
+
rs.stop("Repair skipped: Clerk could not be provisioned");
|
|
6654
|
+
info(
|
|
6655
|
+
pc4.yellow(
|
|
6656
|
+
"The storefront stays live without sign-in. Set CLERK_PLATFORM_API_KEY or add existing Clerk keys to .env.local, then redeploy."
|
|
6657
|
+
)
|
|
6658
|
+
);
|
|
6659
|
+
return;
|
|
6660
|
+
}
|
|
6661
|
+
}
|
|
6650
6662
|
if (plan.rebuild) {
|
|
6651
6663
|
const rebuilt = await buildSite(storefront, targetId);
|
|
6652
6664
|
if (!rebuilt) {
|
|
@@ -6684,10 +6696,14 @@ async function verifyAndRepair(storefront, brand, url, targetId, projectName, op
|
|
|
6684
6696
|
async function runClerkStep(storefront, brand, deployedUrl) {
|
|
6685
6697
|
const s = p3.spinner();
|
|
6686
6698
|
s.start("Provisioning Clerk");
|
|
6699
|
+
const env = { ...process.env, ...await discoverSecrets(storefront, process.env) };
|
|
6687
6700
|
const result = await provisionClerk({
|
|
6688
6701
|
name: brand.name,
|
|
6689
6702
|
domain: brand.domain,
|
|
6690
|
-
|
|
6703
|
+
// carrier site deploy ships a production storefront, so a platform-tier
|
|
6704
|
+
// application must be created with a production instance, not a dev one.
|
|
6705
|
+
production: true,
|
|
6706
|
+
env,
|
|
6691
6707
|
storefront,
|
|
6692
6708
|
cli: clerkCliDeps()
|
|
6693
6709
|
});
|
|
@@ -6695,7 +6711,7 @@ async function runClerkStep(storefront, brand, deployedUrl) {
|
|
|
6695
6711
|
s.stop("Clerk not configured");
|
|
6696
6712
|
if (result.reason) info(pc4.yellow(result.reason));
|
|
6697
6713
|
if (result.guidance) p3.note(result.guidance.join("\n"), "Set up Clerk");
|
|
6698
|
-
return;
|
|
6714
|
+
return false;
|
|
6699
6715
|
}
|
|
6700
6716
|
const { credentials } = result;
|
|
6701
6717
|
s.stop(
|
|
@@ -6718,6 +6734,7 @@ async function runClerkStep(storefront, brand, deployedUrl) {
|
|
|
6718
6734
|
});
|
|
6719
6735
|
if (configured.applied.length) info(pc4.dim(`Clerk configured: ${configured.applied.length} settings`));
|
|
6720
6736
|
for (const f of configured.failed) info(pc4.yellow(`Clerk ${f.step}: ${f.reason}`));
|
|
6737
|
+
return true;
|
|
6721
6738
|
}
|
|
6722
6739
|
async function interactiveSiteCreate() {
|
|
6723
6740
|
const brand = await promptBrand(CARRIER_BRAND);
|
|
@@ -7318,7 +7335,9 @@ site.command("create [dir]").description("Scaffold a white-labeled storefront fr
|
|
|
7318
7335
|
}
|
|
7319
7336
|
p3.outro(pc4.green(`Scaffolded. cd ${dir ?? "storefront"} && pnpm install && pnpm dev`));
|
|
7320
7337
|
});
|
|
7321
|
-
site.command("deploy [dir]").description(
|
|
7338
|
+
site.command("deploy [dir]").description(
|
|
7339
|
+
"Build + deploy a storefront to whichever host is available on this box. Clerk is provisioned and configured automatically; pass --no-clerk to skip."
|
|
7340
|
+
).option("--name <name>", "Project/worker name (defaults from brand)").option("--force", "Deploy under the scaffold default name anyway (acknowledges the overwrite risk)").option(`--target <target>`, `Force a host: ${TARGET_IDS.join(" | ")}`).option("--no-secrets", "Skip staging runtime secrets on the host").option("--no-clerk", "Skip Clerk provisioning and configuration (default is to do it)").option("--no-verify", "Skip the post-deploy check that the site actually serves").option("--autofix-agent", "On an unrecognised failure, print an agent-ready diagnosis bundle").option("--domain", "Route the brand domain to the deployment (Cloudflare provisions DNS + cert)").action(
|
|
7322
7341
|
async (dir, o) => {
|
|
7323
7342
|
header();
|
|
7324
7343
|
const target = resolve4(dir ?? "./storefront");
|
|
@@ -7335,7 +7354,7 @@ site.command("deploy [dir]").description("Build + deploy a storefront to whichev
|
|
|
7335
7354
|
deploy: true,
|
|
7336
7355
|
preferred: o.target,
|
|
7337
7356
|
pushSecrets: o.secrets !== false,
|
|
7338
|
-
clerk: o.clerk
|
|
7357
|
+
clerk: o.clerk !== false,
|
|
7339
7358
|
verify: o.verify !== false,
|
|
7340
7359
|
autofixAgent: o.autofixAgent === true,
|
|
7341
7360
|
customDomain: o.domain === true,
|