@wraps.dev/cli 2.21.17 → 2.21.19

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
@@ -1748,8 +1748,8 @@ async function ensurePulumiWorkDir(options) {
1748
1748
  );
1749
1749
  return;
1750
1750
  } catch (error) {
1751
- const clack62 = await import("@clack/prompts");
1752
- clack62.log.warn(
1751
+ const clack63 = await import("@clack/prompts");
1752
+ clack63.log.warn(
1753
1753
  `S3 state backend unavailable (${error instanceof Error ? error.message : error}). Using local state.`
1754
1754
  );
1755
1755
  }
@@ -6855,23 +6855,23 @@ async function withLockRetry(fn, options) {
6855
6855
  if (parsed.code !== "STACK_LOCKED") {
6856
6856
  throw error;
6857
6857
  }
6858
- const clack62 = await import("@clack/prompts");
6859
- const pc66 = (await import("picocolors")).default;
6858
+ const clack63 = await import("@clack/prompts");
6859
+ const pc67 = (await import("picocolors")).default;
6860
6860
  if (options.autoConfirm) {
6861
- clack62.log.warn(
6861
+ clack63.log.warn(
6862
6862
  "Stack is locked from a previous interrupted run. Auto-clearing..."
6863
6863
  );
6864
6864
  } else {
6865
- const shouldClear = await clack62.confirm({
6866
- message: `Stack is locked from a previous interrupted run. ${pc66.yellow("Clear the stale lock and retry?")}`,
6865
+ const shouldClear = await clack63.confirm({
6866
+ message: `Stack is locked from a previous interrupted run. ${pc67.yellow("Clear the stale lock and retry?")}`,
6867
6867
  initialValue: true
6868
6868
  });
6869
- if (clack62.isCancel(shouldClear) || !shouldClear) {
6869
+ if (clack63.isCancel(shouldClear) || !shouldClear) {
6870
6870
  throw errors.stackLocked();
6871
6871
  }
6872
6872
  }
6873
6873
  const cleared = await clearStackLocks(options.accountId, options.region);
6874
- clack62.log.info(
6874
+ clack63.log.info(
6875
6875
  `Cleared ${cleared} lock file${cleared === 1 ? "" : "s"}. Retrying...`
6876
6876
  );
6877
6877
  return fn();
@@ -9286,8 +9286,8 @@ async function pollDomainVerification(domain, region, options) {
9286
9286
  const timeoutMs = options?.timeoutMs ?? DEFAULT_DOMAIN_POLL_TIMEOUT_MS;
9287
9287
  const startTime = Date.now();
9288
9288
  const sesv22 = new SESv2Client6({ region });
9289
- const spinner10 = clack25.spinner();
9290
- spinner10.start(
9289
+ const spinner11 = clack25.spinner();
9290
+ spinner11.start(
9291
9291
  `Waiting for ${pc27.cyan(domain)} DNS verification (this can take a few minutes)...`
9292
9292
  );
9293
9293
  while (Date.now() - startTime < timeoutMs) {
@@ -9301,19 +9301,19 @@ async function pollDomainVerification(domain, region, options) {
9301
9301
  const elapsed = Math.round((Date.now() - startTime) / 1e3);
9302
9302
  const elapsedStr = elapsed >= 60 ? `${Math.floor(elapsed / 60)}m ${elapsed % 60}s` : `${elapsed}s`;
9303
9303
  if (verified) {
9304
- spinner10.stop(
9304
+ spinner11.stop(
9305
9305
  pc27.green(`\u2713 Domain ${domain} is verified! (${elapsedStr})`)
9306
9306
  );
9307
9307
  return true;
9308
9308
  }
9309
- spinner10.message(
9309
+ spinner11.message(
9310
9310
  `DKIM: ${dkimStatus} \u2014 ${elapsedStr} elapsed, checking every ${intervalMs / 1e3}s...`
9311
9311
  );
9312
9312
  } catch {
9313
9313
  }
9314
9314
  }
9315
9315
  const totalElapsed = Math.round((Date.now() - startTime) / 1e3);
9316
- spinner10.stop(
9316
+ spinner11.stop(
9317
9317
  pc27.yellow(
9318
9318
  `\u23F1 Timed out after ${Math.round(totalElapsed / 60)}m waiting for DNS verification`
9319
9319
  )
@@ -9330,8 +9330,8 @@ async function verifySandboxRecipient(email, region, options) {
9330
9330
  const msg = error instanceof Error ? error.message : String(error);
9331
9331
  return { verified: false, email, error: msg };
9332
9332
  }
9333
- const spinner10 = clack25.spinner();
9334
- spinner10.start(
9333
+ const spinner11 = clack25.spinner();
9334
+ spinner11.start(
9335
9335
  `Verification email sent to ${pc27.cyan(email)} \u2014 waiting for confirmation...`
9336
9336
  );
9337
9337
  const startTime = Date.now();
@@ -9347,16 +9347,16 @@ async function verifySandboxRecipient(email, region, options) {
9347
9347
  const elapsed = Math.round((Date.now() - startTime) / 1e3);
9348
9348
  const elapsedStr = elapsed >= 60 ? `${Math.floor(elapsed / 60)}m ${elapsed % 60}s` : `${elapsed}s`;
9349
9349
  if (attrs?.VerificationStatus === "Success") {
9350
- spinner10.stop(pc27.green(`\u2713 ${email} verified! (${elapsedStr})`));
9350
+ spinner11.stop(pc27.green(`\u2713 ${email} verified! (${elapsedStr})`));
9351
9351
  return { verified: true, email };
9352
9352
  }
9353
- spinner10.message(
9353
+ spinner11.message(
9354
9354
  `Waiting for ${email} to click verification link (${elapsedStr} elapsed)...`
9355
9355
  );
9356
9356
  } catch {
9357
9357
  }
9358
9358
  }
9359
- spinner10.stop(pc27.yellow(`\u23F1 Timed out waiting for ${email} to verify`));
9359
+ spinner11.stop(pc27.yellow(`\u23F1 Timed out waiting for ${email} to verify`));
9360
9360
  return { verified: false, email };
9361
9361
  }
9362
9362
  var DEFAULT_DOMAIN_POLL_INTERVAL_MS, DEFAULT_DOMAIN_POLL_TIMEOUT_MS, DEFAULT_RECIPIENT_POLL_INTERVAL_MS, DEFAULT_RECIPIENT_POLL_TIMEOUT_MS;
@@ -10205,8 +10205,8 @@ import { homedir as homedir4, tmpdir as tmpdir2 } from "os";
10205
10205
  import { join as join23 } from "path";
10206
10206
  import { Readable } from "stream";
10207
10207
  import { pipeline } from "stream/promises";
10208
- import { cancel as cancel35, confirm as confirm29, intro as intro57, isCancel as isCancel40, log as log55 } from "@clack/prompts";
10209
- import pc64 from "picocolors";
10208
+ import { cancel as cancel35, confirm as confirm29, intro as intro58, isCancel as isCancel40, log as log56 } from "@clack/prompts";
10209
+ import pc65 from "picocolors";
10210
10210
  function isStandaloneInstall() {
10211
10211
  return process.execPath.includes(".wraps/runtime");
10212
10212
  }
@@ -10235,7 +10235,7 @@ function detectPlatformArch() {
10235
10235
  return { platform: platform2, arch };
10236
10236
  }
10237
10237
  async function update(currentVersion) {
10238
- intro57(pc64.bold("Wraps CLI Update"));
10238
+ intro58(pc65.bold("Wraps CLI Update"));
10239
10239
  const progress = new DeploymentProgress();
10240
10240
  const result = await progress.execute(
10241
10241
  "Checking for updates...",
@@ -10247,20 +10247,20 @@ async function update(currentVersion) {
10247
10247
  }
10248
10248
  const { version: latestVersion, release } = result;
10249
10249
  if (currentVersion === latestVersion) {
10250
- progress.succeed(`Already up to date ${pc64.dim(`(v${currentVersion})`)}`);
10250
+ progress.succeed(`Already up to date ${pc65.dim(`(v${currentVersion})`)}`);
10251
10251
  return;
10252
10252
  }
10253
10253
  console.log();
10254
- log55.info(
10255
- `Current version: ${pc64.dim(`v${currentVersion}`)}
10256
- Latest version: ${pc64.cyan(`v${latestVersion}`)}`
10254
+ log56.info(
10255
+ `Current version: ${pc65.dim(`v${currentVersion}`)}
10256
+ Latest version: ${pc65.cyan(`v${latestVersion}`)}`
10257
10257
  );
10258
10258
  console.log();
10259
10259
  if (!isStandaloneInstall()) {
10260
- log55.info(
10260
+ log56.info(
10261
10261
  `You installed Wraps via npm. Update with:
10262
10262
 
10263
- ${pc64.cyan("npm update -g @wraps.dev/cli")}`
10263
+ ${pc65.cyan("npm update -g @wraps.dev/cli")}`
10264
10264
  );
10265
10265
  return;
10266
10266
  }
@@ -10335,7 +10335,7 @@ async function update(currentVersion) {
10335
10335
  });
10336
10336
  console.log();
10337
10337
  progress.succeed(
10338
- `Updated to ${pc64.cyan(`v${latestVersion}`)} successfully!`
10338
+ `Updated to ${pc65.cyan(`v${latestVersion}`)} successfully!`
10339
10339
  );
10340
10340
  } finally {
10341
10341
  rmSync(tmp, { recursive: true, force: true });
@@ -10358,8 +10358,8 @@ init_esm_shims();
10358
10358
  import { readFileSync as readFileSync3 } from "fs";
10359
10359
  import { dirname as dirname7, join as join24 } from "path";
10360
10360
  import { fileURLToPath as fileURLToPath8 } from "url";
10361
- import * as clack61 from "@clack/prompts";
10362
- import pc65 from "picocolors";
10361
+ import * as clack62 from "@clack/prompts";
10362
+ import pc66 from "picocolors";
10363
10363
 
10364
10364
  // src/commands/auth/login.ts
10365
10365
  init_esm_shims();
@@ -10367,13 +10367,16 @@ init_events();
10367
10367
  init_config();
10368
10368
  init_json_output();
10369
10369
  import * as clack2 from "@clack/prompts";
10370
+ import open from "open";
10371
+ import pc3 from "picocolors";
10372
+
10373
+ // src/utils/shared/auth-client.ts
10374
+ init_esm_shims();
10370
10375
  import { createAuthClient } from "better-auth/client";
10371
10376
  import {
10372
10377
  deviceAuthorizationClient,
10373
10378
  organizationClient
10374
10379
  } from "better-auth/client/plugins";
10375
- import open from "open";
10376
- import pc3 from "picocolors";
10377
10380
  function createCliAuthClient(baseURL) {
10378
10381
  return createAuthClient({
10379
10382
  baseURL,
@@ -10388,9 +10391,7 @@ async function fetchOrganizations(baseURL, token) {
10388
10391
  headers: { Authorization: `Bearer ${token}` }
10389
10392
  }
10390
10393
  });
10391
- if (!data) {
10392
- return [];
10393
- }
10394
+ if (!data) return [];
10394
10395
  return data.map((org) => ({
10395
10396
  id: org.id,
10396
10397
  name: org.name,
@@ -10400,6 +10401,8 @@ async function fetchOrganizations(baseURL, token) {
10400
10401
  return [];
10401
10402
  }
10402
10403
  }
10404
+
10405
+ // src/commands/auth/login.ts
10403
10406
  async function login(options) {
10404
10407
  const startTime = Date.now();
10405
10408
  if (options.token) {
@@ -10424,7 +10427,7 @@ async function login(options) {
10424
10427
  clack2.intro(pc3.bold("Wraps \u203A Sign In"));
10425
10428
  const baseURL = getAppBaseUrl();
10426
10429
  const authClient = createCliAuthClient(baseURL);
10427
- const spinner10 = clack2.spinner();
10430
+ const spinner11 = clack2.spinner();
10428
10431
  const { data: codeData, error: codeError } = await authClient.device.code({
10429
10432
  client_id: "wraps-cli"
10430
10433
  });
@@ -10453,7 +10456,7 @@ async function login(options) {
10453
10456
  clack2.log.info("Opening browser...");
10454
10457
  } catch {
10455
10458
  }
10456
- spinner10.start("Waiting for approval...");
10459
+ spinner11.start("Waiting for approval...");
10457
10460
  const pollInterval = (interval || 3) * 1e3;
10458
10461
  const expiresAt = Date.now() + (expires_in || 900) * 1e3;
10459
10462
  while (Date.now() < expiresAt) {
@@ -10464,7 +10467,7 @@ async function login(options) {
10464
10467
  client_id: "wraps-cli"
10465
10468
  });
10466
10469
  if (tokenData?.access_token) {
10467
- spinner10.stop("Approved!");
10470
+ spinner11.stop("Approved!");
10468
10471
  const organizations = await fetchOrganizations(
10469
10472
  baseURL,
10470
10473
  tokenData.access_token
@@ -10517,7 +10520,7 @@ async function login(options) {
10517
10520
  method: "device"
10518
10521
  });
10519
10522
  trackError("ACCESS_DENIED", "auth:login", { step: "poll_token" });
10520
- spinner10.stop("Denied.");
10523
+ spinner11.stop("Denied.");
10521
10524
  clack2.log.error("Authorization was denied.");
10522
10525
  throw new Error("Authorization was denied.");
10523
10526
  }
@@ -10532,7 +10535,7 @@ async function login(options) {
10532
10535
  method: "device"
10533
10536
  });
10534
10537
  trackError("DEVICE_CODE_EXPIRED", "auth:login", { step: "poll_token" });
10535
- spinner10.stop("Expired.");
10538
+ spinner11.stop("Expired.");
10536
10539
  clack2.log.error("Device code expired. Run `wraps auth login` to try again.");
10537
10540
  throw new Error("Device code expired.");
10538
10541
  }
@@ -10907,11 +10910,11 @@ async function doctor() {
10907
10910
  if (!isJsonMode()) {
10908
10911
  clack5.intro(pc6.bold("AWS Setup Diagnostics"));
10909
10912
  }
10910
- const spinner10 = isJsonMode() ? null : clack5.spinner();
10911
- spinner10?.start("Running diagnostics...");
10913
+ const spinner11 = isJsonMode() ? null : clack5.spinner();
10914
+ spinner11?.start("Running diagnostics...");
10912
10915
  const state = await detectAWSState();
10913
10916
  const results = await runDiagnostics(state);
10914
- spinner10?.stop("Diagnostics complete");
10917
+ spinner11?.stop("Diagnostics complete");
10915
10918
  const failCount = results.filter((r) => r.status === "fail").length;
10916
10919
  const warnCount = results.filter((r) => r.status === "warn").length;
10917
10920
  const passCount = results.filter((r) => r.status === "pass").length;
@@ -11515,10 +11518,10 @@ function showNextSteps(_state) {
11515
11518
  async function setup(_options = {}) {
11516
11519
  const startTime = Date.now();
11517
11520
  clack7.intro(pc9.bold("AWS Setup Wizard"));
11518
- const spinner10 = clack7.spinner();
11519
- spinner10.start("Checking your AWS setup...");
11521
+ const spinner11 = clack7.spinner();
11522
+ spinner11.start("Checking your AWS setup...");
11520
11523
  const state = await detectAWSState();
11521
- spinner10.stop("AWS setup check complete");
11524
+ spinner11.stop("AWS setup check complete");
11522
11525
  displayCurrentState(state);
11523
11526
  if (!state.cliInstalled) {
11524
11527
  await runFullSetup();
@@ -17007,8 +17010,8 @@ async function check(options) {
17007
17010
  clack15.intro(pc17.bold("Wraps Email Check"));
17008
17011
  console.log();
17009
17012
  }
17010
- const spinner10 = isJsonMode() ? null : clack15.spinner();
17011
- spinner10?.start(`Checking ${pc17.cyan(domain)}...`);
17013
+ const spinner11 = isJsonMode() ? null : clack15.spinner();
17014
+ spinner11?.start(`Checking ${pc17.cyan(domain)}...`);
17012
17015
  let dkimSelectors;
17013
17016
  if (!options.dkimSelector) {
17014
17017
  const sesTokens = await tryGetSesDkimTokens(domain);
@@ -17027,7 +17030,7 @@ async function check(options) {
17027
17030
  skipTls: options.skipTls,
17028
17031
  timeout: options.timeout
17029
17032
  });
17030
- spinner10?.stop(`Check complete in ${result.duration}ms`);
17033
+ spinner11?.stop(`Check complete in ${result.duration}ms`);
17031
17034
  if (isJsonMode()) {
17032
17035
  jsonSuccess("email.check", result);
17033
17036
  } else {
@@ -17041,7 +17044,7 @@ async function check(options) {
17041
17044
  });
17042
17045
  process.exit(getExitCode(result.score.grade));
17043
17046
  } catch (error) {
17044
- spinner10?.stop("Check failed");
17047
+ spinner11?.stop("Check failed");
17045
17048
  const msg = error instanceof Error ? error.message : String(error);
17046
17049
  if (isJsonMode()) {
17047
17050
  jsonError("email.check", { code: "CHECK_FAILED", message: msg });
@@ -22856,8 +22859,8 @@ Enable it: ${pc25.cyan("wraps email inbound init")}
22856
22859
  });
22857
22860
  const { S3Client: S3Client2, ListObjectsV2Command: ListObjectsV2Command2, GetObjectCommand: GetObjectCommand2 } = await import("@aws-sdk/client-s3");
22858
22861
  const s34 = new S3Client2({ region });
22859
- const spinner10 = clack23.spinner();
22860
- spinner10.start("Waiting for email to be processed...");
22862
+ const spinner11 = clack23.spinner();
22863
+ spinner11.start("Waiting for email to be processed...");
22861
22864
  let found = false;
22862
22865
  const startTime = Date.now();
22863
22866
  const timeout = 3e4;
@@ -22891,7 +22894,7 @@ Enable it: ${pc25.cyan("wraps email inbound init")}
22891
22894
  const parsed = JSON.parse(body);
22892
22895
  if (parsed.subject === testSubject) {
22893
22896
  found = true;
22894
- spinner10.stop("Email received and processed!");
22897
+ spinner11.stop("Email received and processed!");
22895
22898
  console.log();
22896
22899
  console.log(` ${pc25.dim("Email ID:")} ${pc25.cyan(parsed.emailId)}`);
22897
22900
  console.log(
@@ -22916,7 +22919,7 @@ Enable it: ${pc25.cyan("wraps email inbound init")}
22916
22919
  await new Promise((resolve) => setTimeout(resolve, 2e3));
22917
22920
  }
22918
22921
  if (!found) {
22919
- spinner10.stop("Timed out waiting for email.");
22922
+ spinner11.stop("Timed out waiting for email.");
22920
22923
  if (isJsonMode()) {
22921
22924
  jsonSuccess("email.inbound.test", {
22922
22925
  sent: true,
@@ -34009,6 +34012,153 @@ The deployment may have failed partway through. Re-run ${pc47.cyan("wraps selfho
34009
34012
  });
34010
34013
  }
34011
34014
 
34015
+ // src/commands/selfhost/login.ts
34016
+ init_esm_shims();
34017
+ init_events();
34018
+ init_config();
34019
+ init_json_output();
34020
+ init_metadata();
34021
+ init_region_resolver();
34022
+ init_aws();
34023
+ import * as clack45 from "@clack/prompts";
34024
+ import open2 from "open";
34025
+ import pc48 from "picocolors";
34026
+ async function selfhostLogin(options) {
34027
+ const startTime = Date.now();
34028
+ if (!isJsonMode()) {
34029
+ clack45.intro(pc48.bold("Wraps Self-Hosted \u203A Sign In"));
34030
+ }
34031
+ const identity = await validateAWSCredentials();
34032
+ const region = await resolveRegionForCommand({
34033
+ accountId: identity.accountId,
34034
+ optionRegion: options.region,
34035
+ service: "selfhost",
34036
+ label: "self-hosted deployment"
34037
+ });
34038
+ const metadata = await loadConnectionMetadata(identity.accountId, region);
34039
+ if (!metadata?.services?.selfhost) {
34040
+ clack45.log.error("No self-hosted deployment found.");
34041
+ console.log(
34042
+ `
34043
+ Run ${pc48.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane first.
34044
+ `
34045
+ );
34046
+ process.exit(1);
34047
+ return;
34048
+ }
34049
+ const { appUrl: baseURL } = metadata.services.selfhost.config;
34050
+ clack45.log.info(`Connecting to: ${pc48.cyan(baseURL)}`);
34051
+ const authClient = createCliAuthClient(baseURL);
34052
+ const spinner11 = clack45.spinner();
34053
+ const { data: codeData, error: codeError } = await authClient.device.code({
34054
+ client_id: "wraps-cli"
34055
+ });
34056
+ if (codeError || !codeData) {
34057
+ trackCommand("selfhost:login", {
34058
+ success: false,
34059
+ duration_ms: Date.now() - startTime,
34060
+ method: "device"
34061
+ });
34062
+ trackError("DEVICE_AUTH_FAILED", "selfhost:login", {
34063
+ step: "request_code"
34064
+ });
34065
+ clack45.log.error(
34066
+ `Failed to reach ${pc48.cyan(baseURL)}. Make sure the dashboard is deployed and reachable.`
34067
+ );
34068
+ throw new Error("Failed to start device authorization.");
34069
+ }
34070
+ const { device_code, user_code, interval, expires_in } = codeData;
34071
+ const formatted = `${user_code.slice(0, 4)}-${user_code.slice(4)}`;
34072
+ clack45.log.info(`Your code: ${pc48.bold(pc48.cyan(formatted))}`);
34073
+ clack45.log.info(`Visit: ${pc48.underline(`${baseURL}/device`)}`);
34074
+ try {
34075
+ await open2(`${baseURL}/device?user_code=${user_code}`);
34076
+ clack45.log.info("Opening browser...");
34077
+ } catch {
34078
+ }
34079
+ spinner11.start("Waiting for approval...");
34080
+ const pollInterval = (interval || 3) * 1e3;
34081
+ const expiresAt = Date.now() + (expires_in || 900) * 1e3;
34082
+ while (Date.now() < expiresAt) {
34083
+ await new Promise((r) => setTimeout(r, pollInterval));
34084
+ const { data: tokenData, error: tokenError } = await authClient.device.token({
34085
+ grant_type: "urn:ietf:params:oauth:grant-type:device_code",
34086
+ device_code,
34087
+ client_id: "wraps-cli"
34088
+ });
34089
+ if (tokenData?.access_token) {
34090
+ spinner11.stop("Approved!");
34091
+ const organizations = await fetchOrganizations(
34092
+ baseURL,
34093
+ tokenData.access_token
34094
+ );
34095
+ await saveAuthConfig({
34096
+ auth: {
34097
+ token: tokenData.access_token,
34098
+ tokenType: "session",
34099
+ expiresAt: tokenData.expires_in ? new Date(
34100
+ Date.now() + tokenData.expires_in * 1e3
34101
+ ).toISOString() : void 0,
34102
+ organizations: organizations.length > 0 ? organizations : void 0
34103
+ }
34104
+ });
34105
+ trackCommand("selfhost:login", {
34106
+ success: true,
34107
+ duration_ms: Date.now() - startTime,
34108
+ method: "device"
34109
+ });
34110
+ clack45.log.success("Signed in to your self-hosted Wraps instance.");
34111
+ if (organizations.length === 1) {
34112
+ clack45.log.info(`Organization: ${pc48.cyan(organizations[0].name)}`);
34113
+ } else if (organizations.length > 1) {
34114
+ clack45.log.info(`${organizations.length} organizations available`);
34115
+ } else {
34116
+ clack45.log.info(
34117
+ `No organizations found. Create one at ${pc48.underline(`${baseURL}/onboarding`)} and run ${pc48.cyan("wraps selfhost login")} again.`
34118
+ );
34119
+ }
34120
+ if (isJsonMode()) {
34121
+ jsonSuccess("selfhost.login", { tokenType: "session", organizations });
34122
+ } else {
34123
+ clack45.outro(pc48.green("Done!"));
34124
+ }
34125
+ return;
34126
+ }
34127
+ if (tokenError) {
34128
+ const err = tokenError;
34129
+ const errorCode = err.error || err.code;
34130
+ if (errorCode === "authorization_pending") continue;
34131
+ if (errorCode === "slow_down") {
34132
+ await new Promise((r) => setTimeout(r, pollInterval));
34133
+ continue;
34134
+ }
34135
+ if (errorCode === "access_denied") {
34136
+ trackCommand("selfhost:login", {
34137
+ success: false,
34138
+ duration_ms: Date.now() - startTime,
34139
+ method: "device"
34140
+ });
34141
+ trackError("ACCESS_DENIED", "selfhost:login", { step: "poll_token" });
34142
+ spinner11.stop("Denied.");
34143
+ clack45.log.error("Authorization was denied.");
34144
+ throw new Error("Authorization was denied.");
34145
+ }
34146
+ if (errorCode === "expired_token") break;
34147
+ }
34148
+ }
34149
+ trackCommand("selfhost:login", {
34150
+ success: false,
34151
+ duration_ms: Date.now() - startTime,
34152
+ method: "device"
34153
+ });
34154
+ trackError("DEVICE_CODE_EXPIRED", "selfhost:login", { step: "poll_token" });
34155
+ spinner11.stop("Expired.");
34156
+ clack45.log.error(
34157
+ "Device code expired. Run `wraps selfhost login` to try again."
34158
+ );
34159
+ throw new Error("Device code expired.");
34160
+ }
34161
+
34012
34162
  // src/commands/selfhost/status.ts
34013
34163
  init_esm_shims();
34014
34164
  init_events();
@@ -34017,30 +34167,30 @@ init_json_output();
34017
34167
  init_metadata();
34018
34168
  init_output();
34019
34169
  init_region_resolver();
34020
- import * as clack45 from "@clack/prompts";
34021
- import pc48 from "picocolors";
34170
+ import * as clack46 from "@clack/prompts";
34171
+ import pc49 from "picocolors";
34022
34172
  function displaySelfhostStatus(options) {
34023
34173
  const lines = [];
34024
- lines.push(pc48.bold(pc48.green("Self-Hosted Control Plane Active")));
34174
+ lines.push(pc49.bold(pc49.green("Self-Hosted Control Plane Active")));
34025
34175
  lines.push("");
34026
- lines.push(pc48.bold("API"));
34027
- lines.push(` URL: ${pc48.cyan(options.apiUrl)}`);
34028
- lines.push(` Region: ${pc48.cyan(options.region)}`);
34029
- lines.push(` Deployed: ${pc48.dim(options.deployedAt)}`);
34176
+ lines.push(pc49.bold("API"));
34177
+ lines.push(` URL: ${pc49.cyan(options.apiUrl)}`);
34178
+ lines.push(` Region: ${pc49.cyan(options.region)}`);
34179
+ lines.push(` Deployed: ${pc49.dim(options.deployedAt)}`);
34030
34180
  lines.push("");
34031
- lines.push(pc48.bold("Configuration"));
34032
- lines.push(` App URL: ${pc48.cyan(options.appUrl)}`);
34033
- lines.push(` License Key: ${pc48.dim(`${options.licenseKeyPrefix}...`)}`);
34181
+ lines.push(pc49.bold("Configuration"));
34182
+ lines.push(` App URL: ${pc49.cyan(options.appUrl)}`);
34183
+ lines.push(` License Key: ${pc49.dim(`${options.licenseKeyPrefix}...`)}`);
34034
34184
  if (options.neonProjectId) {
34035
- lines.push(` Neon Project: ${pc48.dim(options.neonProjectId)}`);
34185
+ lines.push(` Neon Project: ${pc49.dim(options.neonProjectId)}`);
34036
34186
  }
34037
- clack45.note(lines.join("\n"), "Self-Hosted Status");
34187
+ clack46.note(lines.join("\n"), "Self-Hosted Status");
34038
34188
  }
34039
34189
  async function selfhostStatus(options) {
34040
34190
  const startTime = Date.now();
34041
34191
  const progress = new DeploymentProgress();
34042
34192
  if (!isJsonMode()) {
34043
- clack45.intro(pc48.bold("Wraps Self-Hosted Status"));
34193
+ clack46.intro(pc49.bold("Wraps Self-Hosted Status"));
34044
34194
  }
34045
34195
  const identity = await progress.execute(
34046
34196
  "Loading self-hosted status",
@@ -34055,10 +34205,10 @@ async function selfhostStatus(options) {
34055
34205
  const metadata = await loadConnectionMetadata(identity.accountId, region);
34056
34206
  if (!metadata?.services?.selfhost) {
34057
34207
  progress.stop();
34058
- clack45.log.error("No self-hosted deployment found");
34208
+ clack46.log.error("No self-hosted deployment found");
34059
34209
  console.log(
34060
34210
  `
34061
- Run ${pc48.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane.
34211
+ Run ${pc49.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane.
34062
34212
  `
34063
34213
  );
34064
34214
  process.exit(1);
@@ -34080,15 +34230,15 @@ Run ${pc48.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
34080
34230
  }
34081
34231
  displaySelfhostStatus(statusData);
34082
34232
  console.log("");
34083
- clack45.log.info(pc48.bold("Commands:"));
34233
+ clack46.log.info(pc49.bold("Commands:"));
34084
34234
  console.log(
34085
- ` ${pc48.cyan("wraps selfhost upgrade")} - Rebuild and redeploy the API Lambda`
34235
+ ` ${pc49.cyan("wraps selfhost upgrade")} - Rebuild and redeploy the API Lambda`
34086
34236
  );
34087
34237
  trackCommand("selfhost:status", {
34088
34238
  success: true,
34089
34239
  duration_ms: Date.now() - startTime
34090
34240
  });
34091
- clack45.outro(pc48.dim("Self-hosted deployment is active"));
34241
+ clack46.outro(pc49.dim("Self-hosted deployment is active"));
34092
34242
  }
34093
34243
 
34094
34244
  // src/commands/selfhost/upgrade.ts
@@ -34096,9 +34246,9 @@ init_esm_shims();
34096
34246
  import { existsSync as existsSync19 } from "fs";
34097
34247
  import { dirname as dirname6, join as join21 } from "path";
34098
34248
  import { fileURLToPath as fileURLToPath6 } from "url";
34099
- import * as clack46 from "@clack/prompts";
34249
+ import * as clack47 from "@clack/prompts";
34100
34250
  import * as pulumi27 from "@pulumi/pulumi";
34101
- import pc49 from "picocolors";
34251
+ import pc50 from "picocolors";
34102
34252
  init_events();
34103
34253
  init_aws();
34104
34254
  init_errors();
@@ -34114,7 +34264,7 @@ var bundledLambdaZip2 = join21(cliDir2, "api-lambda.zip");
34114
34264
  async function selfhostUpgrade(options) {
34115
34265
  const startTime = Date.now();
34116
34266
  if (!isJsonMode()) {
34117
- clack46.intro(pc49.bold("Wraps Self-Hosted Control Plane Upgrade"));
34267
+ clack47.intro(pc50.bold("Wraps Self-Hosted Control Plane Upgrade"));
34118
34268
  }
34119
34269
  const progress = new DeploymentProgress();
34120
34270
  const wasAutoInstalled = await progress.execute(
@@ -34129,7 +34279,7 @@ async function selfhostUpgrade(options) {
34129
34279
  async () => validateAWSCredentialsWithDetails()
34130
34280
  );
34131
34281
  const identity = credentialResult.identity;
34132
- progress.info(`Connected to AWS account: ${pc49.cyan(identity.accountId)}`);
34282
+ progress.info(`Connected to AWS account: ${pc50.cyan(identity.accountId)}`);
34133
34283
  const region = await resolveRegionForCommand({
34134
34284
  accountId: identity.accountId,
34135
34285
  optionRegion: options.region,
@@ -34138,20 +34288,20 @@ async function selfhostUpgrade(options) {
34138
34288
  });
34139
34289
  const metadata = await loadConnectionMetadata(identity.accountId, region);
34140
34290
  if (!metadata?.services?.selfhost) {
34141
- clack46.log.error("No self-hosted deployment found.");
34142
- clack46.log.info(`Run ${pc49.cyan("wraps selfhost deploy")} first.`);
34291
+ clack47.log.error("No self-hosted deployment found.");
34292
+ clack47.log.info(`Run ${pc50.cyan("wraps selfhost deploy")} first.`);
34143
34293
  process.exit(1);
34144
34294
  }
34145
34295
  const selfhostService = metadata.services.selfhost;
34146
34296
  progress.info(`Found deployment from: ${selfhostService.deployedAt}`);
34147
- progress.info(`API URL: ${pc49.cyan(selfhostService.apiUrl)}`);
34297
+ progress.info(`API URL: ${pc50.cyan(selfhostService.apiUrl)}`);
34148
34298
  if (!(options.yes || options.preview)) {
34149
- const confirmed = await clack46.confirm({
34150
- message: `Upgrade self-hosted deployment in ${pc49.cyan(identity.accountId)} / ${pc49.cyan(region)}?`,
34299
+ const confirmed = await clack47.confirm({
34300
+ message: `Upgrade self-hosted deployment in ${pc50.cyan(identity.accountId)} / ${pc50.cyan(region)}?`,
34151
34301
  initialValue: true
34152
34302
  });
34153
- if (clack46.isCancel(confirmed) || !confirmed) {
34154
- clack46.cancel("Upgrade cancelled.");
34303
+ if (clack47.isCancel(confirmed) || !confirmed) {
34304
+ clack47.cancel("Upgrade cancelled.");
34155
34305
  process.exit(0);
34156
34306
  }
34157
34307
  }
@@ -34225,8 +34375,8 @@ async function selfhostUpgrade(options) {
34225
34375
  resourceChanges: previewResult.resourceChanges,
34226
34376
  commandName: "wraps selfhost upgrade"
34227
34377
  });
34228
- clack46.outro(
34229
- pc49.green("Preview complete. Run without --preview to upgrade.")
34378
+ clack47.outro(
34379
+ pc50.green("Preview complete. Run without --preview to upgrade.")
34230
34380
  );
34231
34381
  return;
34232
34382
  } catch (error) {
@@ -34297,28 +34447,28 @@ async function selfhostUpgrade(options) {
34297
34447
  }
34298
34448
  progress.info("Deployment metadata updated");
34299
34449
  console.log("\n");
34300
- clack46.log.success(pc49.green(pc49.bold("Self-hosted Wraps API upgraded!")));
34450
+ clack47.log.success(pc50.green(pc50.bold("Self-hosted Wraps API upgraded!")));
34301
34451
  console.log("\n");
34302
- clack46.note(
34452
+ clack47.note(
34303
34453
  [
34304
- `${pc49.bold("API URL:")} ${pc49.cyan(outputs.apiUrl || selfhostService.apiUrl)}`,
34305
- `${pc49.bold("Region:")} ${pc49.cyan(region)}`,
34306
- `${pc49.bold("Lambda ARN:")} ${pc49.dim(outputs.lambdaArn)}`
34454
+ `${pc50.bold("API URL:")} ${pc50.cyan(outputs.apiUrl || selfhostService.apiUrl)}`,
34455
+ `${pc50.bold("Region:")} ${pc50.cyan(region)}`,
34456
+ `${pc50.bold("Lambda ARN:")} ${pc50.dim(outputs.lambdaArn)}`
34307
34457
  ].join("\n"),
34308
34458
  "Self-Hosted Deployment"
34309
34459
  );
34310
- clack46.outro(
34311
- pc49.green(`Upgraded in ${((Date.now() - startTime) / 1e3).toFixed(1)}s`)
34460
+ clack47.outro(
34461
+ pc50.green(`Upgraded in ${((Date.now() - startTime) / 1e3).toFixed(1)}s`)
34312
34462
  );
34313
34463
  }
34314
34464
 
34315
34465
  // src/commands/shared/dashboard.ts
34316
34466
  init_esm_shims();
34317
- import * as clack47 from "@clack/prompts";
34467
+ import * as clack48 from "@clack/prompts";
34318
34468
  import * as pulumi28 from "@pulumi/pulumi";
34319
34469
  import getPort from "get-port";
34320
- import open2 from "open";
34321
- import pc50 from "picocolors";
34470
+ import open3 from "open";
34471
+ import pc51 from "picocolors";
34322
34472
 
34323
34473
  // src/console/server.ts
34324
34474
  init_esm_shims();
@@ -35518,13 +35668,13 @@ function createMetricsRouter(config2) {
35518
35668
  const router = createRouter5();
35519
35669
  router.get("/stream", async (req, res) => {
35520
35670
  const connectionId = randomUUID().slice(0, 8);
35521
- const log57 = (msg, data) => {
35671
+ const log58 = (msg, data) => {
35522
35672
  console.log(JSON.stringify({ connectionId, msg, ...data }));
35523
35673
  };
35524
35674
  res.setHeader("Content-Type", "text/event-stream");
35525
35675
  res.setHeader("Cache-Control", "no-cache");
35526
35676
  res.setHeader("Connection", "keep-alive");
35527
- log57("SSE connected");
35677
+ log58("SSE connected");
35528
35678
  res.write('data: {"type":"connected"}\n\n');
35529
35679
  const { startTime, endTime } = req.query;
35530
35680
  const getTimeRange = () => ({
@@ -35534,7 +35684,7 @@ function createMetricsRouter(config2) {
35534
35684
  const sendMetrics = async () => {
35535
35685
  try {
35536
35686
  const timeRange = getTimeRange();
35537
- log57("Fetching metrics", {
35687
+ log58("Fetching metrics", {
35538
35688
  start: timeRange.start.toISOString(),
35539
35689
  end: timeRange.end.toISOString()
35540
35690
  });
@@ -35547,7 +35697,7 @@ function createMetricsRouter(config2) {
35547
35697
  ),
35548
35698
  fetchSendQuota(config2.roleArn, config2.region)
35549
35699
  ]);
35550
- log57("Metrics fetched successfully");
35700
+ log58("Metrics fetched successfully");
35551
35701
  const data = {
35552
35702
  type: "metrics",
35553
35703
  timestamp: Date.now(),
@@ -35577,7 +35727,7 @@ function createMetricsRouter(config2) {
35577
35727
  const interval = setInterval(sendMetrics, 6e4);
35578
35728
  req.on("close", () => {
35579
35729
  clearInterval(interval);
35580
- log57("SSE disconnected");
35730
+ log58("SSE disconnected");
35581
35731
  });
35582
35732
  });
35583
35733
  router.get("/snapshot", async (_req, res) => {
@@ -36972,7 +37122,7 @@ init_output();
36972
37122
  init_pulumi();
36973
37123
  async function dashboard(options) {
36974
37124
  await ensurePulumiInstalled();
36975
- clack47.intro(pc50.bold("Wraps Dashboard"));
37125
+ clack48.intro(pc51.bold("Wraps Dashboard"));
36976
37126
  const progress = new DeploymentProgress();
36977
37127
  const identity = await progress.execute(
36978
37128
  "Validating AWS credentials",
@@ -37013,9 +37163,9 @@ async function dashboard(options) {
37013
37163
  }
37014
37164
  } catch (_error) {
37015
37165
  progress.stop();
37016
- clack47.log.error("No Wraps infrastructure found");
37166
+ clack48.log.error("No Wraps infrastructure found");
37017
37167
  console.log(
37018
- `\\nRun ${pc50.cyan("wraps email init")}, ${pc50.cyan("wraps sms init")}, or ${pc50.cyan("wraps storage init")} to deploy infrastructure first.\\n`
37168
+ `\\nRun ${pc51.cyan("wraps email init")}, ${pc51.cyan("wraps sms init")}, or ${pc51.cyan("wraps storage init")} to deploy infrastructure first.\\n`
37019
37169
  );
37020
37170
  process.exit(1);
37021
37171
  }
@@ -37057,9 +37207,9 @@ async function dashboard(options) {
37057
37207
  }
37058
37208
  const port = options.port || await getPort({ port: [5555, 5556, 5557, 5558, 5559] });
37059
37209
  progress.stop();
37060
- clack47.log.success("Starting dashboard server...");
37210
+ clack48.log.success("Starting dashboard server...");
37061
37211
  console.log(
37062
- `${pc50.dim("Using current AWS credentials (no role assumption)")}\\n`
37212
+ `${pc51.dim("Using current AWS credentials (no role assumption)")}\\n`
37063
37213
  );
37064
37214
  const { url } = await startConsoleServer({
37065
37215
  port,
@@ -37092,11 +37242,11 @@ async function dashboard(options) {
37092
37242
  cdnCustomDomain,
37093
37243
  cdnCertificateArn
37094
37244
  });
37095
- console.log(`\\n${pc50.bold("Dashboard:")} ${pc50.cyan(url)}`);
37096
- console.log(`${pc50.dim("Press Ctrl+C to stop")}\\n`);
37245
+ console.log(`\\n${pc51.bold("Dashboard:")} ${pc51.cyan(url)}`);
37246
+ console.log(`${pc51.dim("Press Ctrl+C to stop")}\\n`);
37097
37247
  getTelemetryClient().showFooterOnce();
37098
37248
  if (!options.noOpen) {
37099
- await open2(url);
37249
+ await open3(url);
37100
37250
  }
37101
37251
  trackCommand("console", {
37102
37252
  success: true,
@@ -37114,8 +37264,8 @@ init_aws();
37114
37264
  init_errors();
37115
37265
  init_json_output();
37116
37266
  init_metadata();
37117
- import * as clack48 from "@clack/prompts";
37118
- import pc51 from "picocolors";
37267
+ import * as clack49 from "@clack/prompts";
37268
+ import pc52 from "picocolors";
37119
37269
  async function destroy(options) {
37120
37270
  trackCommand("destroy", { success: true });
37121
37271
  if (isJsonMode() && !options.force) {
@@ -37126,16 +37276,16 @@ async function destroy(options) {
37126
37276
  );
37127
37277
  }
37128
37278
  if (!isJsonMode()) {
37129
- clack48.intro(pc51.bold("Wraps Infrastructure Teardown"));
37279
+ clack49.intro(pc52.bold("Wraps Infrastructure Teardown"));
37130
37280
  }
37131
- const spinner10 = clack48.spinner();
37132
- spinner10.start("Validating AWS credentials");
37281
+ const spinner11 = clack49.spinner();
37282
+ spinner11.start("Validating AWS credentials");
37133
37283
  let identity;
37134
37284
  try {
37135
37285
  identity = await validateAWSCredentials();
37136
- spinner10.stop("AWS credentials validated");
37286
+ spinner11.stop("AWS credentials validated");
37137
37287
  } catch (error) {
37138
- spinner10.stop("AWS credentials validation failed");
37288
+ spinner11.stop("AWS credentials validation failed");
37139
37289
  throw error;
37140
37290
  }
37141
37291
  const region = options.region || await getAWSRegion();
@@ -37145,17 +37295,17 @@ async function destroy(options) {
37145
37295
  deployedServices.push("email");
37146
37296
  }
37147
37297
  if (deployedServices.length === 0) {
37148
- clack48.log.warn("No Wraps services found in this region");
37298
+ clack49.log.warn("No Wraps services found in this region");
37149
37299
  console.log(
37150
37300
  `
37151
- Run ${pc51.cyan("wraps email init")} to deploy infrastructure.
37301
+ Run ${pc52.cyan("wraps email init")} to deploy infrastructure.
37152
37302
  `
37153
37303
  );
37154
37304
  process.exit(0);
37155
37305
  }
37156
37306
  if (deployedServices.length === 1) {
37157
37307
  const service = deployedServices[0];
37158
- clack48.log.info(`Found ${pc51.cyan(service)} service deployed`);
37308
+ clack49.log.info(`Found ${pc52.cyan(service)} service deployed`);
37159
37309
  if (service === "email") {
37160
37310
  await emailDestroy(options);
37161
37311
  return;
@@ -37170,7 +37320,7 @@ Run ${pc51.cyan("wraps email init")} to deploy infrastructure.
37170
37320
  jsonSuccess("destroy", { destroyed: true });
37171
37321
  return;
37172
37322
  }
37173
- const serviceToDestroy = await clack48.select({
37323
+ const serviceToDestroy = await clack49.select({
37174
37324
  message: "Which service would you like to destroy?",
37175
37325
  options: [
37176
37326
  ...deployedServices.map((s) => ({
@@ -37185,15 +37335,15 @@ Run ${pc51.cyan("wraps email init")} to deploy infrastructure.
37185
37335
  }
37186
37336
  ]
37187
37337
  });
37188
- if (clack48.isCancel(serviceToDestroy)) {
37189
- clack48.cancel("Operation cancelled.");
37338
+ if (clack49.isCancel(serviceToDestroy)) {
37339
+ clack49.cancel("Operation cancelled.");
37190
37340
  process.exit(0);
37191
37341
  }
37192
37342
  if ((serviceToDestroy === "email" || serviceToDestroy === "all") && deployedServices.includes("email")) {
37193
37343
  await emailDestroy(options);
37194
37344
  }
37195
37345
  if (serviceToDestroy === "all") {
37196
- clack48.outro(pc51.green("All Wraps infrastructure has been removed"));
37346
+ clack49.outro(pc52.green("All Wraps infrastructure has been removed"));
37197
37347
  }
37198
37348
  }
37199
37349
 
@@ -37205,26 +37355,26 @@ init_fs();
37205
37355
  init_json_output();
37206
37356
  init_output();
37207
37357
  init_pulumi();
37208
- import * as clack49 from "@clack/prompts";
37358
+ import * as clack50 from "@clack/prompts";
37209
37359
  import * as pulumi29 from "@pulumi/pulumi";
37210
- import pc52 from "picocolors";
37360
+ import pc53 from "picocolors";
37211
37361
  async function status(options) {
37212
37362
  await ensurePulumiInstalled();
37213
37363
  const startTime = Date.now();
37214
37364
  const progress = new DeploymentProgress();
37215
37365
  if (!isJsonMode()) {
37216
- clack49.intro(pc52.bold("Wraps Infrastructure Status"));
37366
+ clack50.intro(pc53.bold("Wraps Infrastructure Status"));
37217
37367
  }
37218
37368
  const identity = await progress.execute(
37219
37369
  "Loading infrastructure status",
37220
37370
  async () => validateAWSCredentials()
37221
37371
  );
37222
37372
  if (!isJsonMode()) {
37223
- progress.info(`AWS Account: ${pc52.cyan(identity.accountId)}`);
37373
+ progress.info(`AWS Account: ${pc53.cyan(identity.accountId)}`);
37224
37374
  }
37225
37375
  const region = options.region || await getAWSRegion();
37226
37376
  if (!isJsonMode()) {
37227
- progress.info(`Region: ${pc52.cyan(region)}`);
37377
+ progress.info(`Region: ${pc53.cyan(region)}`);
37228
37378
  }
37229
37379
  const services = [];
37230
37380
  try {
@@ -37276,35 +37426,35 @@ async function status(options) {
37276
37426
  return;
37277
37427
  }
37278
37428
  console.log();
37279
- clack49.note(
37429
+ clack50.note(
37280
37430
  services.map((s) => {
37281
37431
  if (s.status === "deployed") {
37282
- const details = s.details ? pc52.dim(` (${s.details})`) : "";
37283
- return ` ${pc52.green("\u2713")} ${s.name}${details}`;
37432
+ const details = s.details ? pc53.dim(` (${s.details})`) : "";
37433
+ return ` ${pc53.green("\u2713")} ${s.name}${details}`;
37284
37434
  }
37285
- return ` ${pc52.dim("\u25CB")} ${s.name} ${pc52.dim("(not deployed)")}`;
37435
+ return ` ${pc53.dim("\u25CB")} ${s.name} ${pc53.dim("(not deployed)")}`;
37286
37436
  }).join("\n"),
37287
37437
  "Services"
37288
37438
  );
37289
37439
  const hasDeployedServices = services.some((s) => s.status === "deployed");
37290
37440
  if (hasDeployedServices) {
37291
37441
  console.log(`
37292
- ${pc52.bold("Details:")}`);
37442
+ ${pc53.bold("Details:")}`);
37293
37443
  if (services.find((s) => s.name === "Email")?.status === "deployed") {
37294
- console.log(` ${pc52.dim("Email:")} ${pc52.cyan("wraps email status")}`);
37444
+ console.log(` ${pc53.dim("Email:")} ${pc53.cyan("wraps email status")}`);
37295
37445
  }
37296
37446
  if (services.find((s) => s.name === "SMS")?.status === "deployed") {
37297
- console.log(` ${pc52.dim("SMS:")} ${pc52.cyan("wraps sms status")}`);
37447
+ console.log(` ${pc53.dim("SMS:")} ${pc53.cyan("wraps sms status")}`);
37298
37448
  }
37299
37449
  } else {
37300
37450
  console.log(`
37301
- ${pc52.bold("Get started:")}`);
37302
- console.log(` ${pc52.dim("Deploy email:")} ${pc52.cyan("wraps email init")}`);
37303
- console.log(` ${pc52.dim("Deploy SMS:")} ${pc52.cyan("wraps sms init")}`);
37451
+ ${pc53.bold("Get started:")}`);
37452
+ console.log(` ${pc53.dim("Deploy email:")} ${pc53.cyan("wraps email init")}`);
37453
+ console.log(` ${pc53.dim("Deploy SMS:")} ${pc53.cyan("wraps sms init")}`);
37304
37454
  }
37305
37455
  console.log(`
37306
- ${pc52.bold("Dashboard:")} ${pc52.blue("https://app.wraps.dev")}`);
37307
- console.log(`${pc52.bold("Docs:")} ${pc52.blue("https://wraps.dev/docs")}
37456
+ ${pc53.bold("Dashboard:")} ${pc53.blue("https://app.wraps.dev")}`);
37457
+ console.log(`${pc53.bold("Docs:")} ${pc53.blue("https://wraps.dev/docs")}
37308
37458
  `);
37309
37459
  trackCommand("status", {
37310
37460
  success: true,
@@ -37315,9 +37465,9 @@ ${pc52.bold("Dashboard:")} ${pc52.blue("https://app.wraps.dev")}`);
37315
37465
 
37316
37466
  // src/commands/sms/destroy.ts
37317
37467
  init_esm_shims();
37318
- import * as clack50 from "@clack/prompts";
37468
+ import * as clack51 from "@clack/prompts";
37319
37469
  import * as pulumi31 from "@pulumi/pulumi";
37320
- import pc53 from "picocolors";
37470
+ import pc54 from "picocolors";
37321
37471
 
37322
37472
  // src/infrastructure/sms-stack.ts
37323
37473
  init_esm_shims();
@@ -38008,18 +38158,18 @@ async function createSMSProtectConfigurationWithSDK(configurationSetName, region
38008
38158
  const existing = await client.send(
38009
38159
  new DescribeProtectConfigurationsCommand({})
38010
38160
  );
38011
- for (const pc66 of existing.ProtectConfigurations || []) {
38012
- if (!(pc66.ProtectConfigurationArn && pc66.ProtectConfigurationId)) {
38161
+ for (const pc67 of existing.ProtectConfigurations || []) {
38162
+ if (!(pc67.ProtectConfigurationArn && pc67.ProtectConfigurationId)) {
38013
38163
  continue;
38014
38164
  }
38015
38165
  const tagsResponse = await client.send(
38016
38166
  new ListTagsForResourceCommand({
38017
- ResourceArn: pc66.ProtectConfigurationArn
38167
+ ResourceArn: pc67.ProtectConfigurationArn
38018
38168
  })
38019
38169
  );
38020
38170
  const nameTag = tagsResponse.Tags?.find((t) => t.Key === "Name");
38021
38171
  if (nameTag?.Value === protectConfigName) {
38022
- existingProtectConfigId = pc66.ProtectConfigurationId;
38172
+ existingProtectConfigId = pc67.ProtectConfigurationId;
38023
38173
  break;
38024
38174
  }
38025
38175
  }
@@ -38115,13 +38265,13 @@ async function deleteSMSProtectConfigurationWithSDK(region) {
38115
38265
  new DescribeProtectConfigurationsCommand({})
38116
38266
  );
38117
38267
  if (existing.ProtectConfigurations) {
38118
- for (const pc66 of existing.ProtectConfigurations) {
38119
- if (!(pc66.ProtectConfigurationArn && pc66.ProtectConfigurationId)) {
38268
+ for (const pc67 of existing.ProtectConfigurations) {
38269
+ if (!(pc67.ProtectConfigurationArn && pc67.ProtectConfigurationId)) {
38120
38270
  continue;
38121
38271
  }
38122
38272
  const tagsResponse = await client.send(
38123
38273
  new ListTagsForResourceCommand({
38124
- ResourceArn: pc66.ProtectConfigurationArn
38274
+ ResourceArn: pc67.ProtectConfigurationArn
38125
38275
  })
38126
38276
  );
38127
38277
  const isWrapsManaged = tagsResponse.Tags?.some(
@@ -38130,7 +38280,7 @@ async function deleteSMSProtectConfigurationWithSDK(region) {
38130
38280
  if (isWrapsManaged) {
38131
38281
  await client.send(
38132
38282
  new DeleteProtectConfigurationCommand({
38133
- ProtectConfigurationId: pc66.ProtectConfigurationId
38283
+ ProtectConfigurationId: pc67.ProtectConfigurationId
38134
38284
  })
38135
38285
  );
38136
38286
  }
@@ -38165,8 +38315,8 @@ async function smsDestroy(options) {
38165
38315
  );
38166
38316
  }
38167
38317
  if (!isJsonMode()) {
38168
- clack50.intro(
38169
- pc53.bold(
38318
+ clack51.intro(
38319
+ pc54.bold(
38170
38320
  options.preview ? "SMS Infrastructure Destruction Preview" : "SMS Infrastructure Teardown"
38171
38321
  )
38172
38322
  );
@@ -38192,15 +38342,15 @@ async function smsDestroy(options) {
38192
38342
  `Available regions: ${smsConnections.map((c) => c.region).join(", ")}`
38193
38343
  );
38194
38344
  }
38195
- const selectedRegion = await clack50.select({
38345
+ const selectedRegion = await clack51.select({
38196
38346
  message: "Multiple SMS deployments found. Which region to destroy?",
38197
38347
  options: smsConnections.map((conn) => ({
38198
38348
  value: conn.region,
38199
38349
  label: conn.region
38200
38350
  }))
38201
38351
  });
38202
- if (clack50.isCancel(selectedRegion)) {
38203
- clack50.cancel("Operation cancelled");
38352
+ if (clack51.isCancel(selectedRegion)) {
38353
+ clack51.cancel("Operation cancelled");
38204
38354
  process.exit(0);
38205
38355
  }
38206
38356
  region = selectedRegion;
@@ -38211,18 +38361,18 @@ async function smsDestroy(options) {
38211
38361
  const storedStackName = smsService?.pulumiStackName;
38212
38362
  if (!smsService) {
38213
38363
  progress.stop();
38214
- clack50.log.warn("No SMS infrastructure found");
38364
+ clack51.log.warn("No SMS infrastructure found");
38215
38365
  process.exit(0);
38216
38366
  }
38217
38367
  if (!(options.force || options.preview)) {
38218
- const confirmed = await clack50.confirm({
38219
- message: pc53.red(
38368
+ const confirmed = await clack51.confirm({
38369
+ message: pc54.red(
38220
38370
  "Are you sure you want to destroy all SMS infrastructure?"
38221
38371
  ),
38222
38372
  initialValue: false
38223
38373
  });
38224
- if (clack50.isCancel(confirmed) || !confirmed) {
38225
- clack50.cancel("Destruction cancelled.");
38374
+ if (clack51.isCancel(confirmed) || !confirmed) {
38375
+ clack51.cancel("Destruction cancelled.");
38226
38376
  process.exit(0);
38227
38377
  }
38228
38378
  }
@@ -38254,8 +38404,8 @@ async function smsDestroy(options) {
38254
38404
  costEstimate: "Monthly cost after destruction: $0.00",
38255
38405
  commandName: "wraps sms destroy"
38256
38406
  });
38257
- clack50.outro(
38258
- pc53.green("Preview complete. Run without --preview to destroy.")
38407
+ clack51.outro(
38408
+ pc54.green("Preview complete. Run without --preview to destroy.")
38259
38409
  );
38260
38410
  trackServiceRemoved("sms", {
38261
38411
  preview: true,
@@ -38266,7 +38416,7 @@ async function smsDestroy(options) {
38266
38416
  progress.stop();
38267
38417
  const errorMessage = error instanceof Error ? error.message : String(error);
38268
38418
  if (errorMessage.includes("No SMS infrastructure found")) {
38269
- clack50.log.warn("No SMS infrastructure found to preview");
38419
+ clack51.log.warn("No SMS infrastructure found to preview");
38270
38420
  process.exit(0);
38271
38421
  }
38272
38422
  trackError("PREVIEW_FAILED", "sms destroy", { step: "preview" });
@@ -38315,7 +38465,7 @@ async function smsDestroy(options) {
38315
38465
  progress.stop();
38316
38466
  const errorMessage = error instanceof Error ? error.message : String(error);
38317
38467
  if (errorMessage.includes("No SMS infrastructure found")) {
38318
- clack50.log.warn("No SMS infrastructure found");
38468
+ clack51.log.warn("No SMS infrastructure found");
38319
38469
  if (metadata) {
38320
38470
  removeServiceFromConnection(metadata, "sms");
38321
38471
  await saveConnectionMetadata(metadata);
@@ -38328,7 +38478,7 @@ async function smsDestroy(options) {
38328
38478
  }
38329
38479
  trackError("DESTROY_FAILED", "sms destroy", { step: "destroy" });
38330
38480
  destroyFailed = true;
38331
- clack50.log.warn(
38481
+ clack51.log.warn(
38332
38482
  "Some resources may not have been fully removed. You can re-run this command or clean up manually in the AWS console."
38333
38483
  );
38334
38484
  }
@@ -38351,21 +38501,21 @@ async function smsDestroy(options) {
38351
38501
  return;
38352
38502
  }
38353
38503
  if (destroyFailed) {
38354
- clack50.outro(
38355
- pc53.yellow("SMS infrastructure partially removed. Metadata cleaned up.")
38504
+ clack51.outro(
38505
+ pc54.yellow("SMS infrastructure partially removed. Metadata cleaned up.")
38356
38506
  );
38357
38507
  } else {
38358
- clack50.outro(pc53.green("SMS infrastructure has been removed"));
38508
+ clack51.outro(pc54.green("SMS infrastructure has been removed"));
38359
38509
  console.log(`
38360
- ${pc53.bold("Cleaned up:")}`);
38361
- console.log(` ${pc53.green("\u2713")} Phone number released`);
38362
- console.log(` ${pc53.green("\u2713")} Configuration set deleted`);
38363
- console.log(` ${pc53.green("\u2713")} Event processing infrastructure removed`);
38364
- console.log(` ${pc53.green("\u2713")} IAM role deleted`);
38510
+ ${pc54.bold("Cleaned up:")}`);
38511
+ console.log(` ${pc54.green("\u2713")} Phone number released`);
38512
+ console.log(` ${pc54.green("\u2713")} Configuration set deleted`);
38513
+ console.log(` ${pc54.green("\u2713")} Event processing infrastructure removed`);
38514
+ console.log(` ${pc54.green("\u2713")} IAM role deleted`);
38365
38515
  }
38366
38516
  console.log(
38367
38517
  `
38368
- Run ${pc53.cyan("wraps sms init")} to deploy infrastructure again.
38518
+ Run ${pc54.cyan("wraps sms init")} to deploy infrastructure again.
38369
38519
  `
38370
38520
  );
38371
38521
  trackServiceRemoved("sms", {
@@ -38377,9 +38527,9 @@ Run ${pc53.cyan("wraps sms init")} to deploy infrastructure again.
38377
38527
 
38378
38528
  // src/commands/sms/init.ts
38379
38529
  init_esm_shims();
38380
- import * as clack51 from "@clack/prompts";
38530
+ import * as clack52 from "@clack/prompts";
38381
38531
  import * as pulumi32 from "@pulumi/pulumi";
38382
- import pc54 from "picocolors";
38532
+ import pc55 from "picocolors";
38383
38533
  init_events();
38384
38534
  init_aws();
38385
38535
  init_fs();
@@ -38798,7 +38948,7 @@ function validateSMSConfig(config2) {
38798
38948
 
38799
38949
  // src/commands/sms/init.ts
38800
38950
  async function promptPhoneNumberType() {
38801
- const result = await clack51.select({
38951
+ const result = await clack52.select({
38802
38952
  message: "Select phone number type:",
38803
38953
  options: [
38804
38954
  {
@@ -38818,14 +38968,14 @@ async function promptPhoneNumberType() {
38818
38968
  }
38819
38969
  ]
38820
38970
  });
38821
- if (clack51.isCancel(result)) {
38822
- clack51.cancel("Operation cancelled.");
38971
+ if (clack52.isCancel(result)) {
38972
+ clack52.cancel("Operation cancelled.");
38823
38973
  process.exit(0);
38824
38974
  }
38825
38975
  return result;
38826
38976
  }
38827
38977
  async function promptSMSPreset() {
38828
- const result = await clack51.select({
38978
+ const result = await clack52.select({
38829
38979
  message: "Choose configuration preset:",
38830
38980
  options: [
38831
38981
  {
@@ -38850,8 +39000,8 @@ async function promptSMSPreset() {
38850
39000
  }
38851
39001
  ]
38852
39002
  });
38853
- if (clack51.isCancel(result)) {
38854
- clack51.cancel("Operation cancelled.");
39003
+ if (clack52.isCancel(result)) {
39004
+ clack52.cancel("Operation cancelled.");
38855
39005
  process.exit(0);
38856
39006
  }
38857
39007
  return result;
@@ -38871,7 +39021,7 @@ var COMMON_COUNTRIES = [
38871
39021
  { code: "IN", name: "India" }
38872
39022
  ];
38873
39023
  async function promptAllowedCountries() {
38874
- const result = await clack51.multiselect({
39024
+ const result = await clack52.multiselect({
38875
39025
  message: "Select countries to allow SMS delivery (blocks all others):",
38876
39026
  options: COMMON_COUNTRIES.map((c) => ({
38877
39027
  value: c.code,
@@ -38880,14 +39030,14 @@ async function promptAllowedCountries() {
38880
39030
  initialValues: ["US"],
38881
39031
  required: true
38882
39032
  });
38883
- if (clack51.isCancel(result)) {
38884
- clack51.cancel("Operation cancelled.");
39033
+ if (clack52.isCancel(result)) {
39034
+ clack52.cancel("Operation cancelled.");
38885
39035
  process.exit(0);
38886
39036
  }
38887
39037
  return result;
38888
39038
  }
38889
39039
  async function promptEstimatedSMSVolume() {
38890
- const result = await clack51.select({
39040
+ const result = await clack52.select({
38891
39041
  message: "Estimated messages per month:",
38892
39042
  options: [
38893
39043
  { value: 100, label: "< 100 (Testing)" },
@@ -38897,8 +39047,8 @@ async function promptEstimatedSMSVolume() {
38897
39047
  { value: 1e5, label: "50,000+" }
38898
39048
  ]
38899
39049
  });
38900
- if (clack51.isCancel(result)) {
38901
- clack51.cancel("Operation cancelled.");
39050
+ if (clack52.isCancel(result)) {
39051
+ clack52.cancel("Operation cancelled.");
38902
39052
  process.exit(0);
38903
39053
  }
38904
39054
  return result;
@@ -38906,7 +39056,7 @@ async function promptEstimatedSMSVolume() {
38906
39056
  async function init3(options) {
38907
39057
  const startTime = Date.now();
38908
39058
  if (!isJsonMode()) {
38909
- clack51.intro(pc54.bold("Wraps SMS Infrastructure Setup"));
39059
+ clack52.intro(pc55.bold("Wraps SMS Infrastructure Setup"));
38910
39060
  }
38911
39061
  const progress = new DeploymentProgress();
38912
39062
  const wasAutoInstalled = await progress.execute(
@@ -38920,7 +39070,7 @@ async function init3(options) {
38920
39070
  "Validating AWS credentials",
38921
39071
  async () => validateAWSCredentials()
38922
39072
  );
38923
- progress.info(`Connected to AWS account: ${pc54.cyan(identity.accountId)}`);
39073
+ progress.info(`Connected to AWS account: ${pc55.cyan(identity.accountId)}`);
38924
39074
  const provider = options.provider || await promptProvider();
38925
39075
  const region = options.region || await promptRegion(await getAWSRegion());
38926
39076
  let vercelConfig;
@@ -38932,10 +39082,10 @@ async function init3(options) {
38932
39082
  region
38933
39083
  );
38934
39084
  if (existingConnection?.services?.sms) {
38935
- clack51.log.warn(
38936
- `SMS already configured for account ${pc54.cyan(identity.accountId)} in region ${pc54.cyan(region)}`
39085
+ clack52.log.warn(
39086
+ `SMS already configured for account ${pc55.cyan(identity.accountId)} in region ${pc55.cyan(region)}`
38937
39087
  );
38938
- clack51.log.info(`Use ${pc54.cyan("wraps sms status")} to view current setup`);
39088
+ clack52.log.info(`Use ${pc55.cyan("wraps sms status")} to view current setup`);
38939
39089
  process.exit(0);
38940
39090
  }
38941
39091
  let preset = options.preset;
@@ -38952,12 +39102,12 @@ async function init3(options) {
38952
39102
  optOutManagement: true,
38953
39103
  sendingEnabled: true
38954
39104
  };
38955
- const enableEventTracking = await clack51.confirm({
39105
+ const enableEventTracking = await clack52.confirm({
38956
39106
  message: "Enable event tracking (EventBridge + DynamoDB)?",
38957
39107
  initialValue: false
38958
39108
  });
38959
- if (clack51.isCancel(enableEventTracking)) {
38960
- clack51.cancel("Operation cancelled.");
39109
+ if (clack52.isCancel(enableEventTracking)) {
39110
+ clack52.cancel("Operation cancelled.");
38961
39111
  process.exit(0);
38962
39112
  }
38963
39113
  if (enableEventTracking) {
@@ -38977,17 +39127,17 @@ async function init3(options) {
38977
39127
  }
38978
39128
  progress.info(
38979
39129
  `
38980
- ${pc54.bold("Fraud Protection")} - Block SMS to countries where you don't do business`
39130
+ ${pc55.bold("Fraud Protection")} - Block SMS to countries where you don't do business`
38981
39131
  );
38982
39132
  const allowedCountries = await promptAllowedCountries();
38983
39133
  let aitFiltering = false;
38984
39134
  if (smsConfig.phoneNumberType !== "simulator") {
38985
- const enableAIT = await clack51.confirm({
39135
+ const enableAIT = await clack52.confirm({
38986
39136
  message: "Enable AIT (Artificially Inflated Traffic) filtering? (adds per-message cost)",
38987
39137
  initialValue: false
38988
39138
  });
38989
- if (clack51.isCancel(enableAIT)) {
38990
- clack51.cancel("Operation cancelled.");
39139
+ if (clack52.isCancel(enableAIT)) {
39140
+ clack52.cancel("Operation cancelled.");
38991
39141
  process.exit(0);
38992
39142
  }
38993
39143
  aitFiltering = enableAIT;
@@ -38999,21 +39149,21 @@ ${pc54.bold("Fraud Protection")} - Block SMS to countries where you don't do bus
38999
39149
  };
39000
39150
  const estimatedVolume = await promptEstimatedSMSVolume();
39001
39151
  progress.info(`
39002
- ${pc54.bold("Cost Estimate:")}`);
39152
+ ${pc55.bold("Cost Estimate:")}`);
39003
39153
  const costSummary = getSMSCostSummary(smsConfig, estimatedVolume);
39004
- clack51.log.info(costSummary);
39154
+ clack52.log.info(costSummary);
39005
39155
  const warnings = validateSMSConfig(smsConfig);
39006
39156
  if (warnings.length > 0) {
39007
39157
  progress.info(`
39008
- ${pc54.yellow(pc54.bold("Important Notes:"))}`);
39158
+ ${pc55.yellow(pc55.bold("Important Notes:"))}`);
39009
39159
  for (const warning of warnings) {
39010
- clack51.log.warn(warning);
39160
+ clack52.log.warn(warning);
39011
39161
  }
39012
39162
  }
39013
39163
  if (!(options.yes || options.preview)) {
39014
39164
  const confirmed = await confirmDeploy();
39015
39165
  if (!confirmed) {
39016
- clack51.cancel("Deployment cancelled.");
39166
+ clack52.cancel("Deployment cancelled.");
39017
39167
  process.exit(0);
39018
39168
  }
39019
39169
  }
@@ -39073,8 +39223,8 @@ ${pc54.yellow(pc54.bold("Important Notes:"))}`);
39073
39223
  costEstimate: getSMSCostSummary(smsConfig, 0),
39074
39224
  commandName: "wraps sms init"
39075
39225
  });
39076
- clack51.outro(
39077
- pc54.green("Preview complete. Run without --preview to deploy.")
39226
+ clack52.outro(
39227
+ pc55.green("Preview complete. Run without --preview to deploy.")
39078
39228
  );
39079
39229
  trackServiceInit("sms", true, {
39080
39230
  provider,
@@ -39123,9 +39273,9 @@ ${pc54.yellow(pc54.bold("Important Notes:"))}`);
39123
39273
  } catch (sdkError) {
39124
39274
  sdkResourceWarning = true;
39125
39275
  const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
39126
- clack51.log.warn(`Phone pool creation failed: ${msg}`);
39127
- clack51.log.info(
39128
- `Run ${pc54.cyan("wraps sms sync")} to retry SDK resource creation.`
39276
+ clack52.log.warn(`Phone pool creation failed: ${msg}`);
39277
+ clack52.log.info(
39278
+ `Run ${pc55.cyan("wraps sms sync")} to retry SDK resource creation.`
39129
39279
  );
39130
39280
  }
39131
39281
  }
@@ -39141,9 +39291,9 @@ ${pc54.yellow(pc54.bold("Important Notes:"))}`);
39141
39291
  } catch (sdkError) {
39142
39292
  sdkResourceWarning = true;
39143
39293
  const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
39144
- clack51.log.warn(`Event destination creation failed: ${msg}`);
39145
- clack51.log.info(
39146
- `Run ${pc54.cyan("wraps sms sync")} to retry SDK resource creation.`
39294
+ clack52.log.warn(`Event destination creation failed: ${msg}`);
39295
+ clack52.log.info(
39296
+ `Run ${pc55.cyan("wraps sms sync")} to retry SDK resource creation.`
39147
39297
  );
39148
39298
  }
39149
39299
  }
@@ -39162,14 +39312,14 @@ ${pc54.yellow(pc54.bold("Important Notes:"))}`);
39162
39312
  } catch (sdkError) {
39163
39313
  sdkResourceWarning = true;
39164
39314
  const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
39165
- clack51.log.warn(`Protect configuration creation failed: ${msg}`);
39166
- clack51.log.info(
39167
- `Run ${pc54.cyan("wraps sms sync")} to retry SDK resource creation.`
39315
+ clack52.log.warn(`Protect configuration creation failed: ${msg}`);
39316
+ clack52.log.info(
39317
+ `Run ${pc55.cyan("wraps sms sync")} to retry SDK resource creation.`
39168
39318
  );
39169
39319
  }
39170
39320
  }
39171
39321
  if (sdkResourceWarning) {
39172
- clack51.log.warn(
39322
+ clack52.log.warn(
39173
39323
  "Some SDK resources failed to create. Core infrastructure is deployed."
39174
39324
  );
39175
39325
  }
@@ -39214,47 +39364,47 @@ ${pc54.yellow(pc54.bold("Important Notes:"))}`);
39214
39364
  return;
39215
39365
  }
39216
39366
  console.log("\n");
39217
- clack51.log.success(pc54.green(pc54.bold("SMS infrastructure deployed!")));
39367
+ clack52.log.success(pc55.green(pc55.bold("SMS infrastructure deployed!")));
39218
39368
  console.log("\n");
39219
- clack51.note(
39369
+ clack52.note(
39220
39370
  [
39221
- `${pc54.bold("Phone Number:")} ${pc54.cyan(outputs.phoneNumber || "Provisioning...")}`,
39222
- `${pc54.bold("Phone Type:")} ${pc54.cyan(smsConfig.phoneNumberType || "simulator")}`,
39223
- `${pc54.bold("Config Set:")} ${pc54.cyan(outputs.configSetName || "wraps-sms-config")}`,
39224
- `${pc54.bold("Region:")} ${pc54.cyan(outputs.region)}`,
39225
- outputs.tableName ? `${pc54.bold("History Table:")} ${pc54.cyan(outputs.tableName)}` : "",
39371
+ `${pc55.bold("Phone Number:")} ${pc55.cyan(outputs.phoneNumber || "Provisioning...")}`,
39372
+ `${pc55.bold("Phone Type:")} ${pc55.cyan(smsConfig.phoneNumberType || "simulator")}`,
39373
+ `${pc55.bold("Config Set:")} ${pc55.cyan(outputs.configSetName || "wraps-sms-config")}`,
39374
+ `${pc55.bold("Region:")} ${pc55.cyan(outputs.region)}`,
39375
+ outputs.tableName ? `${pc55.bold("History Table:")} ${pc55.cyan(outputs.tableName)}` : "",
39226
39376
  "",
39227
- pc54.dim("IAM Role:"),
39228
- pc54.dim(` ${outputs.roleArn}`)
39377
+ pc55.dim("IAM Role:"),
39378
+ pc55.dim(` ${outputs.roleArn}`)
39229
39379
  ].filter(Boolean).join("\n"),
39230
39380
  "SMS Infrastructure"
39231
39381
  );
39232
39382
  const nextSteps = [];
39233
39383
  if (smsConfig.phoneNumberType === "toll-free") {
39234
39384
  nextSteps.push(
39235
- `${pc54.cyan("wraps sms register")} - Submit toll-free registration (required before sending)`
39385
+ `${pc55.cyan("wraps sms register")} - Submit toll-free registration (required before sending)`
39236
39386
  );
39237
39387
  }
39238
39388
  nextSteps.push(
39239
- `${pc54.cyan("wraps sms test --to +1234567890")} - Send a test message`
39389
+ `${pc55.cyan("wraps sms test --to +1234567890")} - Send a test message`
39240
39390
  );
39241
- nextSteps.push(`${pc54.cyan("wraps sms status")} - View SMS configuration`);
39391
+ nextSteps.push(`${pc55.cyan("wraps sms status")} - View SMS configuration`);
39242
39392
  console.log("\n");
39243
- clack51.log.info(pc54.bold("Next steps:"));
39393
+ clack52.log.info(pc55.bold("Next steps:"));
39244
39394
  for (const step of nextSteps) {
39245
39395
  console.log(` ${step}`);
39246
39396
  }
39247
39397
  console.log("\n");
39248
- clack51.log.info(pc54.bold("SDK Usage:"));
39249
- console.log(pc54.dim(" npm install @wraps.dev/sms"));
39398
+ clack52.log.info(pc55.bold("SDK Usage:"));
39399
+ console.log(pc55.dim(" npm install @wraps.dev/sms"));
39250
39400
  console.log("");
39251
- console.log(pc54.dim(" import { Wraps } from '@wraps.dev/sms';"));
39252
- console.log(pc54.dim(" const wraps = new Wraps();"));
39253
- console.log(pc54.dim(" await wraps.sms.send({"));
39254
- console.log(pc54.dim(" to: '+14155551234',"));
39255
- console.log(pc54.dim(" message: 'Your code is 123456',"));
39256
- console.log(pc54.dim(" });"));
39257
- clack51.outro(pc54.green("Setup complete!"));
39401
+ console.log(pc55.dim(" import { Wraps } from '@wraps.dev/sms';"));
39402
+ console.log(pc55.dim(" const wraps = new Wraps();"));
39403
+ console.log(pc55.dim(" await wraps.sms.send({"));
39404
+ console.log(pc55.dim(" to: '+14155551234',"));
39405
+ console.log(pc55.dim(" message: 'Your code is 123456',"));
39406
+ console.log(pc55.dim(" });"));
39407
+ clack52.outro(pc55.green("Setup complete!"));
39258
39408
  const duration = Date.now() - startTime;
39259
39409
  const enabledFeatures = [];
39260
39410
  if (smsConfig.tracking?.enabled) {
@@ -39290,8 +39440,8 @@ init_aws();
39290
39440
  init_json_output();
39291
39441
  init_metadata();
39292
39442
  init_output();
39293
- import * as clack52 from "@clack/prompts";
39294
- import pc55 from "picocolors";
39443
+ import * as clack53 from "@clack/prompts";
39444
+ import pc56 from "picocolors";
39295
39445
  async function getPhoneNumberDetails(region) {
39296
39446
  const { PinpointSMSVoiceV2Client: PinpointSMSVoiceV2Client5, DescribePhoneNumbersCommand: DescribePhoneNumbersCommand2 } = await import("@aws-sdk/client-pinpoint-sms-voice-v2");
39297
39447
  const client = new PinpointSMSVoiceV2Client5({ region });
@@ -39311,7 +39461,7 @@ async function getPhoneNumberDetails(region) {
39311
39461
  return null;
39312
39462
  } catch (error) {
39313
39463
  const errorMessage = error instanceof Error ? error.message : String(error);
39314
- clack52.log.error(`Error fetching phone number: ${errorMessage}`);
39464
+ clack53.log.error(`Error fetching phone number: ${errorMessage}`);
39315
39465
  return null;
39316
39466
  }
39317
39467
  }
@@ -39332,7 +39482,7 @@ async function getRegistrationStatus(region, registrationId) {
39332
39482
  async function smsRegister(options) {
39333
39483
  const startTime = Date.now();
39334
39484
  if (!isJsonMode()) {
39335
- clack52.intro(pc55.bold("Wraps SMS - Toll-Free Registration"));
39485
+ clack53.intro(pc56.bold("Wraps SMS - Toll-Free Registration"));
39336
39486
  }
39337
39487
  const progress = new DeploymentProgress();
39338
39488
  const identity = await progress.execute(
@@ -39345,8 +39495,8 @@ async function smsRegister(options) {
39345
39495
  }
39346
39496
  const metadata = await loadConnectionMetadata(identity.accountId, region);
39347
39497
  if (!metadata?.services?.sms) {
39348
- clack52.log.error("No SMS infrastructure found.");
39349
- clack52.log.info(`Run ${pc55.cyan("wraps sms init")} first.`);
39498
+ clack53.log.error("No SMS infrastructure found.");
39499
+ clack53.log.info(`Run ${pc56.cyan("wraps sms init")} first.`);
39350
39500
  process.exit(1);
39351
39501
  }
39352
39502
  const phoneDetails = await progress.execute(
@@ -39354,7 +39504,7 @@ async function smsRegister(options) {
39354
39504
  async () => getPhoneNumberDetails(region)
39355
39505
  );
39356
39506
  if (!phoneDetails) {
39357
- clack52.log.error("No phone number found.");
39507
+ clack53.log.error("No phone number found.");
39358
39508
  process.exit(1);
39359
39509
  }
39360
39510
  let registrationStatus = null;
@@ -39380,53 +39530,53 @@ async function smsRegister(options) {
39380
39530
  }
39381
39531
  console.log("");
39382
39532
  console.log(
39383
- `${pc55.bold("Phone Number:")} ${pc55.cyan(phoneDetails.phoneNumber)}`
39533
+ `${pc56.bold("Phone Number:")} ${pc56.cyan(phoneDetails.phoneNumber)}`
39384
39534
  );
39385
- console.log(`${pc55.bold("Type:")} ${pc55.cyan(phoneDetails.type)}`);
39535
+ console.log(`${pc56.bold("Type:")} ${pc56.cyan(phoneDetails.type)}`);
39386
39536
  console.log(
39387
- `${pc55.bold("Status:")} ${phoneDetails.status === "ACTIVE" ? pc55.green(phoneDetails.status) : pc55.yellow(phoneDetails.status)}`
39537
+ `${pc56.bold("Status:")} ${phoneDetails.status === "ACTIVE" ? pc56.green(phoneDetails.status) : pc56.yellow(phoneDetails.status)}`
39388
39538
  );
39389
39539
  if (registrationStatus) {
39390
- console.log(`${pc55.bold("Registration:")} ${pc55.cyan(registrationStatus)}`);
39540
+ console.log(`${pc56.bold("Registration:")} ${pc56.cyan(registrationStatus)}`);
39391
39541
  }
39392
39542
  console.log("");
39393
39543
  if (phoneDetails.status === "ACTIVE") {
39394
- clack52.log.success("Your phone number is already ACTIVE and ready to use!");
39544
+ clack53.log.success("Your phone number is already ACTIVE and ready to use!");
39395
39545
  const { PinpointSMSVoiceV2Client: PinpointSMSVoiceV2Client5, DescribePoolsCommand } = await import("@aws-sdk/client-pinpoint-sms-voice-v2");
39396
39546
  const client = new PinpointSMSVoiceV2Client5({ region });
39397
39547
  const pools = await client.send(new DescribePoolsCommand({}));
39398
39548
  if (!pools.Pools?.length) {
39399
- clack52.log.info("Run `wraps sms sync` to create the phone pool.");
39549
+ clack53.log.info("Run `wraps sms sync` to create the phone pool.");
39400
39550
  }
39401
39551
  process.exit(0);
39402
39552
  }
39403
39553
  if (phoneDetails.type !== "TOLL_FREE") {
39404
- clack52.log.info("Only toll-free numbers require registration.");
39405
- clack52.log.info(`Your ${phoneDetails.type} number should be ready to use.`);
39554
+ clack53.log.info("Only toll-free numbers require registration.");
39555
+ clack53.log.info(`Your ${phoneDetails.type} number should be ready to use.`);
39406
39556
  process.exit(0);
39407
39557
  }
39408
- console.log(pc55.bold("Toll-Free Registration Required"));
39558
+ console.log(pc56.bold("Toll-Free Registration Required"));
39409
39559
  console.log("");
39410
39560
  console.log(
39411
- pc55.dim("To send SMS at scale, you must register your toll-free number.")
39561
+ pc56.dim("To send SMS at scale, you must register your toll-free number.")
39412
39562
  );
39413
- console.log(pc55.dim("This process typically takes 1-15 business days."));
39563
+ console.log(pc56.dim("This process typically takes 1-15 business days."));
39414
39564
  console.log("");
39415
- console.log(pc55.bold("You'll need to provide:"));
39416
- console.log(` ${pc55.dim("\u2022")} Business name and address`);
39565
+ console.log(pc56.bold("You'll need to provide:"));
39566
+ console.log(` ${pc56.dim("\u2022")} Business name and address`);
39417
39567
  console.log(
39418
- ` ${pc55.dim("\u2022")} Use case description (what messages you're sending)`
39568
+ ` ${pc56.dim("\u2022")} Use case description (what messages you're sending)`
39419
39569
  );
39420
- console.log(` ${pc55.dim("\u2022")} Sample messages (2-3 examples)`);
39421
- console.log(` ${pc55.dim("\u2022")} How users opt-in to receive messages`);
39422
- console.log(` ${pc55.dim("\u2022")} Expected monthly message volume`);
39570
+ console.log(` ${pc56.dim("\u2022")} Sample messages (2-3 examples)`);
39571
+ console.log(` ${pc56.dim("\u2022")} How users opt-in to receive messages`);
39572
+ console.log(` ${pc56.dim("\u2022")} Expected monthly message volume`);
39423
39573
  console.log("");
39424
- const openConsole = await clack52.confirm({
39574
+ const openConsole = await clack53.confirm({
39425
39575
  message: "Open AWS Console to start registration?",
39426
39576
  initialValue: true
39427
39577
  });
39428
- if (clack52.isCancel(openConsole)) {
39429
- clack52.cancel("Registration cancelled.");
39578
+ if (clack53.isCancel(openConsole)) {
39579
+ clack53.cancel("Registration cancelled.");
39430
39580
  process.exit(0);
39431
39581
  }
39432
39582
  if (openConsole) {
@@ -39436,41 +39586,41 @@ async function smsRegister(options) {
39436
39586
  const execAsync2 = promisify2(exec2);
39437
39587
  try {
39438
39588
  await execAsync2(`open "${consoleUrl}"`);
39439
- clack52.log.success("Opened AWS Console in your browser.");
39589
+ clack53.log.success("Opened AWS Console in your browser.");
39440
39590
  } catch {
39441
39591
  try {
39442
39592
  await execAsync2(`xdg-open "${consoleUrl}"`);
39443
- clack52.log.success("Opened AWS Console in your browser.");
39593
+ clack53.log.success("Opened AWS Console in your browser.");
39444
39594
  } catch {
39445
- clack52.log.info("Open this URL in your browser:");
39595
+ clack53.log.info("Open this URL in your browser:");
39446
39596
  console.log(`
39447
- ${pc55.cyan(consoleUrl)}
39597
+ ${pc56.cyan(consoleUrl)}
39448
39598
  `);
39449
39599
  }
39450
39600
  }
39451
39601
  console.log("");
39452
- console.log(pc55.bold("Next Steps:"));
39602
+ console.log(pc56.bold("Next Steps:"));
39453
39603
  console.log(
39454
- ` 1. Click ${pc55.cyan("Create registration")} in the AWS Console`
39604
+ ` 1. Click ${pc56.cyan("Create registration")} in the AWS Console`
39455
39605
  );
39456
- console.log(` 2. Select ${pc55.cyan("Toll-free number registration")}`);
39606
+ console.log(` 2. Select ${pc56.cyan("Toll-free number registration")}`);
39457
39607
  console.log(" 3. Fill out the business information form");
39458
39608
  console.log(" 4. Submit and wait for approval (1-15 business days)");
39459
39609
  console.log("");
39460
39610
  console.log(
39461
- pc55.dim("Once approved, run `wraps sms sync` to complete setup.")
39611
+ pc56.dim("Once approved, run `wraps sms sync` to complete setup.")
39462
39612
  );
39463
39613
  } else {
39464
39614
  const consoleUrl = `https://${region}.console.aws.amazon.com/sms-voice/home?region=${region}#/registrations`;
39465
39615
  console.log("");
39466
39616
  console.log("When you're ready, go to:");
39467
- console.log(` ${pc55.cyan(consoleUrl)}`);
39617
+ console.log(` ${pc56.cyan(consoleUrl)}`);
39468
39618
  }
39469
39619
  trackCommand("sms:register", {
39470
39620
  success: true,
39471
39621
  duration_ms: Date.now() - startTime
39472
39622
  });
39473
- clack52.outro(pc55.dim("Good luck with your registration!"));
39623
+ clack53.outro(pc56.dim("Good luck with your registration!"));
39474
39624
  }
39475
39625
 
39476
39626
  // src/commands/sms/status.ts
@@ -39483,54 +39633,54 @@ init_metadata();
39483
39633
  init_output();
39484
39634
  init_pulumi();
39485
39635
  init_region_resolver();
39486
- import * as clack53 from "@clack/prompts";
39636
+ import * as clack54 from "@clack/prompts";
39487
39637
  import * as pulumi33 from "@pulumi/pulumi";
39488
- import pc56 from "picocolors";
39638
+ import pc57 from "picocolors";
39489
39639
  function displaySMSStatus(options) {
39490
39640
  const lines = [];
39491
- lines.push(pc56.bold(pc56.green("SMS Infrastructure Active")));
39641
+ lines.push(pc57.bold(pc57.green("SMS Infrastructure Active")));
39492
39642
  lines.push("");
39493
- lines.push(pc56.bold("Phone Number"));
39643
+ lines.push(pc57.bold("Phone Number"));
39494
39644
  if (options.phoneNumber) {
39495
- lines.push(` Number: ${pc56.cyan(options.phoneNumber)}`);
39645
+ lines.push(` Number: ${pc57.cyan(options.phoneNumber)}`);
39496
39646
  } else {
39497
- lines.push(` Number: ${pc56.yellow("Provisioning...")}`);
39647
+ lines.push(` Number: ${pc57.yellow("Provisioning...")}`);
39498
39648
  }
39499
- lines.push(` Type: ${pc56.cyan(options.phoneNumberType || "simulator")}`);
39649
+ lines.push(` Type: ${pc57.cyan(options.phoneNumberType || "simulator")}`);
39500
39650
  lines.push("");
39501
- lines.push(pc56.bold("Configuration"));
39502
- lines.push(` Region: ${pc56.cyan(options.region)}`);
39651
+ lines.push(pc57.bold("Configuration"));
39652
+ lines.push(` Region: ${pc57.cyan(options.region)}`);
39503
39653
  if (options.preset) {
39504
- lines.push(` Preset: ${pc56.cyan(options.preset)}`);
39654
+ lines.push(` Preset: ${pc57.cyan(options.preset)}`);
39505
39655
  }
39506
39656
  if (options.configSetName) {
39507
- lines.push(` Config Set: ${pc56.cyan(options.configSetName)}`);
39657
+ lines.push(` Config Set: ${pc57.cyan(options.configSetName)}`);
39508
39658
  }
39509
39659
  lines.push("");
39510
- lines.push(pc56.bold("Features"));
39660
+ lines.push(pc57.bold("Features"));
39511
39661
  lines.push(
39512
- ` Event Tracking: ${options.eventTracking ? pc56.green("Enabled") : pc56.dim("Disabled")}`
39662
+ ` Event Tracking: ${options.eventTracking ? pc57.green("Enabled") : pc57.dim("Disabled")}`
39513
39663
  );
39514
39664
  if (options.tableName) {
39515
- lines.push(` Message History: ${pc56.green("Enabled")}`);
39516
- lines.push(` Table: ${pc56.dim(options.tableName)}`);
39665
+ lines.push(` Message History: ${pc57.green("Enabled")}`);
39666
+ lines.push(` Table: ${pc57.dim(options.tableName)}`);
39517
39667
  }
39518
39668
  if (options.queueUrl) {
39519
- lines.push(` Event Queue: ${pc56.green("Enabled")}`);
39669
+ lines.push(` Event Queue: ${pc57.green("Enabled")}`);
39520
39670
  }
39521
39671
  lines.push("");
39522
39672
  if (options.roleArn) {
39523
- lines.push(pc56.bold("IAM Role"));
39524
- lines.push(` ${pc56.dim(options.roleArn)}`);
39673
+ lines.push(pc57.bold("IAM Role"));
39674
+ lines.push(` ${pc57.dim(options.roleArn)}`);
39525
39675
  }
39526
- clack53.note(lines.join("\n"), "SMS Status");
39676
+ clack54.note(lines.join("\n"), "SMS Status");
39527
39677
  }
39528
39678
  async function smsStatus(options) {
39529
39679
  await ensurePulumiInstalled();
39530
39680
  const startTime = Date.now();
39531
39681
  const progress = new DeploymentProgress();
39532
39682
  if (!isJsonMode()) {
39533
- clack53.intro(pc56.bold("Wraps SMS Status"));
39683
+ clack54.intro(pc57.bold("Wraps SMS Status"));
39534
39684
  }
39535
39685
  const identity = await progress.execute(
39536
39686
  "Loading SMS infrastructure status",
@@ -39545,10 +39695,10 @@ async function smsStatus(options) {
39545
39695
  const metadata = await loadConnectionMetadata(identity.accountId, region);
39546
39696
  if (!metadata?.services?.sms) {
39547
39697
  progress.stop();
39548
- clack53.log.error("No SMS infrastructure found");
39698
+ clack54.log.error("No SMS infrastructure found");
39549
39699
  console.log(
39550
39700
  `
39551
- Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure.
39701
+ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
39552
39702
  `
39553
39703
  );
39554
39704
  process.exit(1);
@@ -39584,25 +39734,25 @@ Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure.
39584
39734
  }
39585
39735
  displaySMSStatus(smsStatusData);
39586
39736
  console.log("");
39587
- clack53.log.info(pc56.bold("Commands:"));
39737
+ clack54.log.info(pc57.bold("Commands:"));
39588
39738
  console.log(
39589
- ` ${pc56.cyan("wraps sms test --to +1234567890")} - Send a test message`
39739
+ ` ${pc57.cyan("wraps sms test --to +1234567890")} - Send a test message`
39590
39740
  );
39591
- console.log(` ${pc56.cyan("wraps sms destroy")} - Remove SMS infrastructure`);
39741
+ console.log(` ${pc57.cyan("wraps sms destroy")} - Remove SMS infrastructure`);
39592
39742
  trackCommand("sms:status", {
39593
39743
  success: true,
39594
39744
  phone_type: smsConfig?.phoneNumberType,
39595
39745
  event_tracking: smsConfig?.eventTracking?.enabled,
39596
39746
  duration_ms: Date.now() - startTime
39597
39747
  });
39598
- clack53.outro(pc56.dim("SMS infrastructure is ready"));
39748
+ clack54.outro(pc57.dim("SMS infrastructure is ready"));
39599
39749
  }
39600
39750
 
39601
39751
  // src/commands/sms/sync.ts
39602
39752
  init_esm_shims();
39603
- import * as clack54 from "@clack/prompts";
39753
+ import * as clack55 from "@clack/prompts";
39604
39754
  import * as pulumi34 from "@pulumi/pulumi";
39605
- import pc57 from "picocolors";
39755
+ import pc58 from "picocolors";
39606
39756
  init_events();
39607
39757
  init_aws();
39608
39758
  init_errors();
@@ -39615,7 +39765,7 @@ async function smsSync(options) {
39615
39765
  await ensurePulumiInstalled();
39616
39766
  const startTime = Date.now();
39617
39767
  if (!isJsonMode()) {
39618
- clack54.intro(pc57.bold("Wraps SMS Infrastructure Sync"));
39768
+ clack55.intro(pc58.bold("Wraps SMS Infrastructure Sync"));
39619
39769
  }
39620
39770
  const progress = new DeploymentProgress();
39621
39771
  const identity = await progress.execute(
@@ -39627,10 +39777,10 @@ async function smsSync(options) {
39627
39777
  const smsService = metadata?.services?.sms;
39628
39778
  if (!smsService?.config) {
39629
39779
  progress.stop();
39630
- clack54.log.error("No SMS infrastructure found to sync");
39780
+ clack55.log.error("No SMS infrastructure found to sync");
39631
39781
  console.log(
39632
39782
  `
39633
- Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure first.
39783
+ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure first.
39634
39784
  `
39635
39785
  );
39636
39786
  process.exit(1);
@@ -39639,18 +39789,18 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure first.
39639
39789
  const storedStackName = smsService.pulumiStackName;
39640
39790
  progress.info("Found existing SMS configuration");
39641
39791
  progress.info(
39642
- `Phone type: ${pc57.cyan(smsConfig.phoneNumberType || "simulator")}`
39792
+ `Phone type: ${pc58.cyan(smsConfig.phoneNumberType || "simulator")}`
39643
39793
  );
39644
39794
  progress.info(
39645
- `Event tracking: ${pc57.cyan(smsConfig.eventTracking?.enabled ? "enabled" : "disabled")}`
39795
+ `Event tracking: ${pc58.cyan(smsConfig.eventTracking?.enabled ? "enabled" : "disabled")}`
39646
39796
  );
39647
39797
  if (!options.yes) {
39648
- const confirmed = await clack54.confirm({
39798
+ const confirmed = await clack55.confirm({
39649
39799
  message: "Sync SMS infrastructure? This will update Lambda code and recreate any missing resources.",
39650
39800
  initialValue: true
39651
39801
  });
39652
- if (clack54.isCancel(confirmed) || !confirmed) {
39653
- clack54.cancel("Sync cancelled.");
39802
+ if (clack55.isCancel(confirmed) || !confirmed) {
39803
+ clack55.cancel("Sync cancelled.");
39654
39804
  process.exit(0);
39655
39805
  }
39656
39806
  }
@@ -39755,7 +39905,7 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure first.
39755
39905
  throw errors.stackLocked();
39756
39906
  }
39757
39907
  trackError("SYNC_FAILED", "sms:sync", { step: "sync" });
39758
- clack54.log.error(`SMS sync failed: ${errorMessage}`);
39908
+ clack55.log.error(`SMS sync failed: ${errorMessage}`);
39759
39909
  process.exit(1);
39760
39910
  }
39761
39911
  if (metadata && smsService) {
@@ -39775,7 +39925,7 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure first.
39775
39925
  return;
39776
39926
  }
39777
39927
  console.log("\n");
39778
- clack54.log.success(pc57.green("SMS infrastructure synced successfully!"));
39928
+ clack55.log.success(pc58.green("SMS infrastructure synced successfully!"));
39779
39929
  const changes = [];
39780
39930
  if (outputs.lambdaFunctions?.length) {
39781
39931
  changes.push("Lambda functions updated");
@@ -39783,13 +39933,13 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure first.
39783
39933
  changes.push("SDK resources verified");
39784
39934
  console.log("");
39785
39935
  for (const change of changes) {
39786
- console.log(` ${pc57.green("\u2713")} ${change}`);
39936
+ console.log(` ${pc58.green("\u2713")} ${change}`);
39787
39937
  }
39788
39938
  trackCommand("sms:sync", {
39789
39939
  success: true,
39790
39940
  duration_ms: Date.now() - startTime
39791
39941
  });
39792
- clack54.outro(pc57.green("Sync complete!"));
39942
+ clack55.outro(pc58.green("Sync complete!"));
39793
39943
  }
39794
39944
 
39795
39945
  // src/commands/sms/test.ts
@@ -39804,8 +39954,8 @@ import {
39804
39954
  PinpointSMSVoiceV2Client as PinpointSMSVoiceV2Client3,
39805
39955
  SendTextMessageCommand
39806
39956
  } from "@aws-sdk/client-pinpoint-sms-voice-v2";
39807
- import * as clack55 from "@clack/prompts";
39808
- import pc58 from "picocolors";
39957
+ import * as clack56 from "@clack/prompts";
39958
+ import pc59 from "picocolors";
39809
39959
 
39810
39960
  // src/utils/sms/validation.ts
39811
39961
  init_esm_shims();
@@ -39828,7 +39978,7 @@ async function smsTest(options) {
39828
39978
  const startTime = Date.now();
39829
39979
  const progress = new DeploymentProgress();
39830
39980
  if (!isJsonMode()) {
39831
- clack55.intro(pc58.bold("Wraps SMS Test"));
39981
+ clack56.intro(pc59.bold("Wraps SMS Test"));
39832
39982
  }
39833
39983
  const identity = await progress.execute(
39834
39984
  "Validating AWS credentials",
@@ -39838,10 +39988,10 @@ async function smsTest(options) {
39838
39988
  const metadata = await loadConnectionMetadata(identity.accountId, region);
39839
39989
  if (!metadata?.services?.sms) {
39840
39990
  progress.stop();
39841
- clack55.log.error("No SMS infrastructure found");
39991
+ clack56.log.error("No SMS infrastructure found");
39842
39992
  console.log(
39843
39993
  `
39844
- Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
39994
+ Run ${pc59.cyan("wraps sms init")} to deploy SMS infrastructure.
39845
39995
  `
39846
39996
  );
39847
39997
  process.exit(1);
@@ -39855,7 +40005,7 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
39855
40005
  );
39856
40006
  }
39857
40007
  if (!toNumber) {
39858
- const destinationType = await clack55.select({
40008
+ const destinationType = await clack56.select({
39859
40009
  message: "Choose destination number:",
39860
40010
  options: [
39861
40011
  {
@@ -39870,25 +40020,25 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
39870
40020
  }
39871
40021
  ]
39872
40022
  });
39873
- if (clack55.isCancel(destinationType)) {
39874
- clack55.cancel("Operation cancelled.");
40023
+ if (clack56.isCancel(destinationType)) {
40024
+ clack56.cancel("Operation cancelled.");
39875
40025
  process.exit(0);
39876
40026
  }
39877
40027
  if (destinationType === "simulator") {
39878
- const simResult = await clack55.select({
40028
+ const simResult = await clack56.select({
39879
40029
  message: "Select simulator destination:",
39880
40030
  options: SIMULATOR_DESTINATIONS.map((sim) => ({
39881
40031
  value: sim.number,
39882
40032
  label: `${sim.number} | ${sim.country}`
39883
40033
  }))
39884
40034
  });
39885
- if (clack55.isCancel(simResult)) {
39886
- clack55.cancel("Operation cancelled.");
40035
+ if (clack56.isCancel(simResult)) {
40036
+ clack56.cancel("Operation cancelled.");
39887
40037
  process.exit(0);
39888
40038
  }
39889
40039
  toNumber = simResult;
39890
40040
  } else {
39891
- const result = await clack55.text({
40041
+ const result = await clack56.text({
39892
40042
  message: "Enter destination phone number (E.164 format):",
39893
40043
  placeholder: "+14155551234",
39894
40044
  validate: (value) => {
@@ -39901,22 +40051,22 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
39901
40051
  return;
39902
40052
  }
39903
40053
  });
39904
- if (clack55.isCancel(result)) {
39905
- clack55.cancel("Operation cancelled.");
40054
+ if (clack56.isCancel(result)) {
40055
+ clack56.cancel("Operation cancelled.");
39906
40056
  process.exit(0);
39907
40057
  }
39908
40058
  toNumber = result;
39909
40059
  }
39910
40060
  } else if (!isValidPhoneNumber(toNumber)) {
39911
40061
  progress.stop();
39912
- clack55.log.error(
40062
+ clack56.log.error(
39913
40063
  `Invalid phone number format: ${toNumber}. Use E.164 format (e.g., +14155551234)`
39914
40064
  );
39915
40065
  process.exit(1);
39916
40066
  }
39917
40067
  let message = options.message;
39918
40068
  if (!message) {
39919
- const result = await clack55.text({
40069
+ const result = await clack56.text({
39920
40070
  message: "Enter test message:",
39921
40071
  placeholder: "Hello from Wraps SMS!",
39922
40072
  defaultValue: "Hello from Wraps SMS! This is a test message.",
@@ -39930,8 +40080,8 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
39930
40080
  return;
39931
40081
  }
39932
40082
  });
39933
- if (clack55.isCancel(result)) {
39934
- clack55.cancel("Operation cancelled.");
40083
+ if (clack56.isCancel(result)) {
40084
+ clack56.cancel("Operation cancelled.");
39935
40085
  process.exit(0);
39936
40086
  }
39937
40087
  message = result;
@@ -39970,16 +40120,16 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
39970
40120
  return;
39971
40121
  }
39972
40122
  console.log("\n");
39973
- clack55.log.success(pc58.green("Test SMS sent successfully!"));
40123
+ clack56.log.success(pc59.green("Test SMS sent successfully!"));
39974
40124
  console.log("");
39975
- clack55.note(
40125
+ clack56.note(
39976
40126
  [
39977
- `${pc58.bold("Message ID:")} ${pc58.cyan(messageId || "unknown")}`,
39978
- `${pc58.bold("To:")} ${pc58.cyan(toNumber)}`,
39979
- `${pc58.bold("Message:")} ${message}`,
39980
- `${pc58.bold("Type:")} ${pc58.cyan(smsConfig?.phoneNumberType || "simulator")}`,
40127
+ `${pc59.bold("Message ID:")} ${pc59.cyan(messageId || "unknown")}`,
40128
+ `${pc59.bold("To:")} ${pc59.cyan(toNumber)}`,
40129
+ `${pc59.bold("Message:")} ${message}`,
40130
+ `${pc59.bold("Type:")} ${pc59.cyan(smsConfig?.phoneNumberType || "simulator")}`,
39981
40131
  "",
39982
- pc58.dim(
40132
+ pc59.dim(
39983
40133
  smsConfig?.phoneNumberType === "simulator" ? "Note: Simulator messages are not actually delivered" : "Check your phone for the message!"
39984
40134
  )
39985
40135
  ].join("\n"),
@@ -39987,11 +40137,11 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
39987
40137
  );
39988
40138
  if (smsConfig?.eventTracking?.enabled) {
39989
40139
  console.log("");
39990
- clack55.log.info(
39991
- pc58.dim("Event tracking is enabled. Check DynamoDB for delivery status.")
40140
+ clack56.log.info(
40141
+ pc59.dim("Event tracking is enabled. Check DynamoDB for delivery status.")
39992
40142
  );
39993
40143
  }
39994
- clack55.outro(pc58.green("Test complete!"));
40144
+ clack56.outro(pc59.green("Test complete!"));
39995
40145
  } catch (error) {
39996
40146
  progress.stop();
39997
40147
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -40003,33 +40153,33 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
40003
40153
  });
40004
40154
  const errorName = error instanceof Error ? error.name : "";
40005
40155
  if (errorName === "ConflictException" || errorMessage.includes("opt-out")) {
40006
- clack55.log.error("Destination number has opted out of messages");
40156
+ clack56.log.error("Destination number has opted out of messages");
40007
40157
  console.log("\nThe recipient has opted out of receiving SMS messages.\n");
40008
40158
  } else if (errorName === "ThrottlingException" || errorMessage.includes("spending limit")) {
40009
- clack55.log.error("SMS rate or spending limit reached");
40159
+ clack56.log.error("SMS rate or spending limit reached");
40010
40160
  console.log(
40011
40161
  "\nCheck your AWS account SMS spending limits in the console.\n"
40012
40162
  );
40013
40163
  } else if (errorName === "ValidationException") {
40014
- clack55.log.error(`Invalid request: ${errorMessage}`);
40164
+ clack56.log.error(`Invalid request: ${errorMessage}`);
40015
40165
  } else if (errorMessage.includes("not verified") || errorMessage.includes("not registered")) {
40016
- clack55.log.error("Toll-free number registration is not complete");
40166
+ clack56.log.error("Toll-free number registration is not complete");
40017
40167
  console.log(
40018
40168
  `
40019
- Run ${pc58.cyan("wraps sms register")} to check registration status.
40169
+ Run ${pc59.cyan("wraps sms register")} to check registration status.
40020
40170
  `
40021
40171
  );
40022
40172
  } else if (errorName === "AccessDeniedException") {
40023
- clack55.log.error(
40173
+ clack56.log.error(
40024
40174
  "Permission denied \u2014 IAM role may be missing SMS send permissions"
40025
40175
  );
40026
40176
  console.log(
40027
40177
  `
40028
- Run ${pc58.cyan("wraps sms upgrade")} to update IAM policies.
40178
+ Run ${pc59.cyan("wraps sms upgrade")} to update IAM policies.
40029
40179
  `
40030
40180
  );
40031
40181
  } else {
40032
- clack55.log.error(`Failed to send SMS: ${errorMessage}`);
40182
+ clack56.log.error(`Failed to send SMS: ${errorMessage}`);
40033
40183
  }
40034
40184
  process.exit(1);
40035
40185
  }
@@ -40037,9 +40187,9 @@ Run ${pc58.cyan("wraps sms upgrade")} to update IAM policies.
40037
40187
 
40038
40188
  // src/commands/sms/upgrade.ts
40039
40189
  init_esm_shims();
40040
- import * as clack56 from "@clack/prompts";
40190
+ import * as clack57 from "@clack/prompts";
40041
40191
  import * as pulumi35 from "@pulumi/pulumi";
40042
- import pc59 from "picocolors";
40192
+ import pc60 from "picocolors";
40043
40193
  init_events();
40044
40194
  init_aws();
40045
40195
  init_errors();
@@ -40054,7 +40204,7 @@ async function smsUpgrade(options) {
40054
40204
  const startTime = Date.now();
40055
40205
  let upgradeAction = "";
40056
40206
  if (!isJsonMode()) {
40057
- clack56.intro(pc59.bold("Wraps SMS Upgrade - Enhance Your SMS Infrastructure"));
40207
+ clack57.intro(pc60.bold("Wraps SMS Upgrade - Enhance Your SMS Infrastructure"));
40058
40208
  }
40059
40209
  const progress = new DeploymentProgress();
40060
40210
  const wasAutoInstalled = await progress.execute(
@@ -40068,7 +40218,7 @@ async function smsUpgrade(options) {
40068
40218
  "Validating AWS credentials",
40069
40219
  async () => validateAWSCredentials()
40070
40220
  );
40071
- progress.info(`Connected to AWS account: ${pc59.cyan(identity.accountId)}`);
40221
+ progress.info(`Connected to AWS account: ${pc60.cyan(identity.accountId)}`);
40072
40222
  const region = await resolveRegionForCommand({
40073
40223
  accountId: identity.accountId,
40074
40224
  optionRegion: options.region,
@@ -40077,35 +40227,35 @@ async function smsUpgrade(options) {
40077
40227
  });
40078
40228
  const metadata = await loadConnectionMetadata(identity.accountId, region);
40079
40229
  if (!metadata) {
40080
- clack56.log.error(
40081
- `No Wraps connection found for account ${pc59.cyan(identity.accountId)} in region ${pc59.cyan(region)}`
40230
+ clack57.log.error(
40231
+ `No Wraps connection found for account ${pc60.cyan(identity.accountId)} in region ${pc60.cyan(region)}`
40082
40232
  );
40083
- clack56.log.info(
40084
- `Use ${pc59.cyan("wraps sms init")} to create new infrastructure.`
40233
+ clack57.log.info(
40234
+ `Use ${pc60.cyan("wraps sms init")} to create new infrastructure.`
40085
40235
  );
40086
40236
  process.exit(1);
40087
40237
  }
40088
40238
  if (!metadata.services.sms) {
40089
- clack56.log.error("No SMS infrastructure found");
40090
- clack56.log.info(
40091
- `Use ${pc59.cyan("wraps sms init")} to deploy SMS infrastructure.`
40239
+ clack57.log.error("No SMS infrastructure found");
40240
+ clack57.log.info(
40241
+ `Use ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure.`
40092
40242
  );
40093
40243
  process.exit(1);
40094
40244
  }
40095
40245
  progress.info(`Found existing connection created: ${metadata.timestamp}`);
40096
40246
  console.log(`
40097
- ${pc59.bold("Current Configuration:")}
40247
+ ${pc60.bold("Current Configuration:")}
40098
40248
  `);
40099
40249
  if (metadata.services.sms.preset) {
40100
- console.log(` Preset: ${pc59.cyan(metadata.services.sms.preset)}`);
40250
+ console.log(` Preset: ${pc60.cyan(metadata.services.sms.preset)}`);
40101
40251
  } else {
40102
- console.log(` Preset: ${pc59.cyan("custom")}`);
40252
+ console.log(` Preset: ${pc60.cyan("custom")}`);
40103
40253
  }
40104
40254
  const config2 = metadata.services.sms.config;
40105
40255
  if (!config2) {
40106
- clack56.log.error("No SMS configuration found in metadata");
40107
- clack56.log.info(
40108
- `Use ${pc59.cyan("wraps sms init")} to create new infrastructure.`
40256
+ clack57.log.error("No SMS configuration found in metadata");
40257
+ clack57.log.info(
40258
+ `Use ${pc60.cyan("wraps sms init")} to create new infrastructure.`
40109
40259
  );
40110
40260
  process.exit(1);
40111
40261
  }
@@ -40117,45 +40267,45 @@ ${pc59.bold("Current Configuration:")}
40117
40267
  "short-code": "Short code ($995+/mo, 100+ MPS)"
40118
40268
  };
40119
40269
  console.log(
40120
- ` Phone Type: ${pc59.cyan(phoneTypeLabels2[config2.phoneNumberType] || config2.phoneNumberType)}`
40270
+ ` Phone Type: ${pc60.cyan(phoneTypeLabels2[config2.phoneNumberType] || config2.phoneNumberType)}`
40121
40271
  );
40122
40272
  }
40123
40273
  if (config2.tracking?.enabled) {
40124
- console.log(` ${pc59.green("\u2713")} Delivery Tracking`);
40274
+ console.log(` ${pc60.green("\u2713")} Delivery Tracking`);
40125
40275
  if (config2.tracking.linkTracking) {
40126
- console.log(` ${pc59.dim("\u2514\u2500")} Link click tracking enabled`);
40276
+ console.log(` ${pc60.dim("\u2514\u2500")} Link click tracking enabled`);
40127
40277
  }
40128
40278
  }
40129
40279
  if (config2.eventTracking?.enabled) {
40130
- console.log(` ${pc59.green("\u2713")} Event Tracking (SNS)`);
40280
+ console.log(` ${pc60.green("\u2713")} Event Tracking (SNS)`);
40131
40281
  if (config2.eventTracking.dynamoDBHistory) {
40132
40282
  console.log(
40133
- ` ${pc59.dim("\u2514\u2500")} Message History: ${pc59.cyan(config2.eventTracking.archiveRetention || "90days")}`
40283
+ ` ${pc60.dim("\u2514\u2500")} Message History: ${pc60.cyan(config2.eventTracking.archiveRetention || "90days")}`
40134
40284
  );
40135
40285
  }
40136
40286
  }
40137
40287
  if (config2.messageArchiving?.enabled) {
40138
40288
  console.log(
40139
- ` ${pc59.green("\u2713")} Message Archiving (${config2.messageArchiving.retention})`
40289
+ ` ${pc60.green("\u2713")} Message Archiving (${config2.messageArchiving.retention})`
40140
40290
  );
40141
40291
  }
40142
40292
  if (config2.optOutManagement) {
40143
- console.log(` ${pc59.green("\u2713")} Opt-out Management`);
40293
+ console.log(` ${pc60.green("\u2713")} Opt-out Management`);
40144
40294
  }
40145
40295
  if (config2.protectConfiguration?.enabled) {
40146
40296
  const countries = config2.protectConfiguration.allowedCountries?.join(", ") || "US";
40147
- console.log(` ${pc59.green("\u2713")} Fraud Protection`);
40148
- console.log(` ${pc59.dim("\u2514\u2500")} Allowed countries: ${pc59.cyan(countries)}`);
40297
+ console.log(` ${pc60.green("\u2713")} Fraud Protection`);
40298
+ console.log(` ${pc60.dim("\u2514\u2500")} Allowed countries: ${pc60.cyan(countries)}`);
40149
40299
  if (config2.protectConfiguration.aitFiltering) {
40150
- console.log(` ${pc59.dim("\u2514\u2500")} AIT filtering: ${pc59.cyan("enabled")}`);
40300
+ console.log(` ${pc60.dim("\u2514\u2500")} AIT filtering: ${pc60.cyan("enabled")}`);
40151
40301
  }
40152
40302
  } else {
40153
- console.log(` ${pc59.dim("\u25CB")} Fraud Protection (not configured)`);
40303
+ console.log(` ${pc60.dim("\u25CB")} Fraud Protection (not configured)`);
40154
40304
  }
40155
40305
  const currentCostData = calculateSMSCosts(config2, 1e4);
40156
40306
  console.log(
40157
40307
  `
40158
- Estimated Cost: ${pc59.cyan(`~${formatCost3(currentCostData.total.monthly)}/mo`)}`
40308
+ Estimated Cost: ${pc60.cyan(`~${formatCost3(currentCostData.total.monthly)}/mo`)}`
40159
40309
  );
40160
40310
  console.log("");
40161
40311
  const phoneTypeLabels = {
@@ -40164,7 +40314,7 @@ ${pc59.bold("Current Configuration:")}
40164
40314
  "10dlc": "10DLC",
40165
40315
  "short-code": "Short code"
40166
40316
  };
40167
- upgradeAction = await clack56.select({
40317
+ upgradeAction = await clack57.select({
40168
40318
  message: "What would you like to do?",
40169
40319
  options: [
40170
40320
  {
@@ -40204,8 +40354,8 @@ ${pc59.bold("Current Configuration:")}
40204
40354
  }
40205
40355
  ]
40206
40356
  });
40207
- if (clack56.isCancel(upgradeAction)) {
40208
- clack56.cancel("Upgrade cancelled.");
40357
+ if (clack57.isCancel(upgradeAction)) {
40358
+ clack57.cancel("Upgrade cancelled.");
40209
40359
  process.exit(0);
40210
40360
  }
40211
40361
  let updatedConfig = { ...config2 };
@@ -40246,65 +40396,65 @@ ${pc59.bold("Current Configuration:")}
40246
40396
  hint: p.hint
40247
40397
  }));
40248
40398
  if (availableTypes.length === 0) {
40249
- clack56.log.warn(
40399
+ clack57.log.warn(
40250
40400
  "Already on highest phone number tier. Contact AWS for dedicated short codes."
40251
40401
  );
40252
40402
  process.exit(0);
40253
40403
  }
40254
- const selectedType = await clack56.select({
40404
+ const selectedType = await clack57.select({
40255
40405
  message: "Select new phone number type:",
40256
40406
  options: availableTypes
40257
40407
  });
40258
- if (clack56.isCancel(selectedType)) {
40259
- clack56.cancel("Upgrade cancelled.");
40408
+ if (clack57.isCancel(selectedType)) {
40409
+ clack57.cancel("Upgrade cancelled.");
40260
40410
  process.exit(0);
40261
40411
  }
40262
40412
  if (selectedType === "toll-free") {
40263
40413
  console.log(
40264
40414
  `
40265
- ${pc59.yellow("\u26A0")} ${pc59.bold("Toll-free Registration Required")}
40415
+ ${pc60.yellow("\u26A0")} ${pc60.bold("Toll-free Registration Required")}
40266
40416
  `
40267
40417
  );
40268
40418
  console.log(
40269
- pc59.dim("Toll-free numbers require carrier registration before")
40419
+ pc60.dim("Toll-free numbers require carrier registration before")
40270
40420
  );
40271
40421
  console.log(
40272
- pc59.dim("they can send messages at scale. After deployment:\n")
40422
+ pc60.dim("they can send messages at scale. After deployment:\n")
40273
40423
  );
40274
40424
  console.log(
40275
- ` 1. Run ${pc59.cyan("wraps sms register")} to start registration`
40425
+ ` 1. Run ${pc60.cyan("wraps sms register")} to start registration`
40276
40426
  );
40277
40427
  console.log(" 2. Submit your business use case information");
40278
40428
  console.log(" 3. Wait for carrier verification (1-5 business days)");
40279
40429
  console.log(
40280
- pc59.dim("\nUntil verified, sending is limited to low volume.\n")
40430
+ pc60.dim("\nUntil verified, sending is limited to low volume.\n")
40281
40431
  );
40282
- const confirmTollFree = await clack56.confirm({
40432
+ const confirmTollFree = await clack57.confirm({
40283
40433
  message: "Continue with toll-free number request?",
40284
40434
  initialValue: true
40285
40435
  });
40286
- if (clack56.isCancel(confirmTollFree) || !confirmTollFree) {
40287
- clack56.cancel("Upgrade cancelled.");
40436
+ if (clack57.isCancel(confirmTollFree) || !confirmTollFree) {
40437
+ clack57.cancel("Upgrade cancelled.");
40288
40438
  process.exit(0);
40289
40439
  }
40290
40440
  }
40291
40441
  if (selectedType === "10dlc") {
40292
40442
  console.log(
40293
40443
  `
40294
- ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40444
+ ${pc60.yellow("\u26A0")} ${pc60.bold("10DLC Campaign Registration Required")}
40295
40445
  `
40296
40446
  );
40297
- console.log(pc59.dim("10DLC requires brand and campaign registration:"));
40447
+ console.log(pc60.dim("10DLC requires brand and campaign registration:"));
40298
40448
  console.log(" \u2022 Brand registration: one-time $4 fee");
40299
40449
  console.log(" \u2022 Campaign registration: $15/mo per campaign");
40300
40450
  console.log(" \u2022 Verification takes 1-7 business days");
40301
40451
  console.log("");
40302
- const confirm10DLC = await clack56.confirm({
40452
+ const confirm10DLC = await clack57.confirm({
40303
40453
  message: "Continue with 10DLC number request?",
40304
40454
  initialValue: true
40305
40455
  });
40306
- if (clack56.isCancel(confirm10DLC) || !confirm10DLC) {
40307
- clack56.cancel("Upgrade cancelled.");
40456
+ if (clack57.isCancel(confirm10DLC) || !confirm10DLC) {
40457
+ clack57.cancel("Upgrade cancelled.");
40308
40458
  process.exit(0);
40309
40459
  }
40310
40460
  }
@@ -40329,15 +40479,15 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40329
40479
  disabled: currentPresetIdx >= 0 && idx <= currentPresetIdx ? "Current or lower tier" : void 0
40330
40480
  })).filter((p) => !p.disabled && p.value !== "custom");
40331
40481
  if (availablePresets.length === 0) {
40332
- clack56.log.warn("Already on highest preset (Enterprise)");
40482
+ clack57.log.warn("Already on highest preset (Enterprise)");
40333
40483
  process.exit(0);
40334
40484
  }
40335
- const selectedPreset = await clack56.select({
40485
+ const selectedPreset = await clack57.select({
40336
40486
  message: "Select new preset:",
40337
40487
  options: availablePresets
40338
40488
  });
40339
- if (clack56.isCancel(selectedPreset)) {
40340
- clack56.cancel("Upgrade cancelled.");
40489
+ if (clack57.isCancel(selectedPreset)) {
40490
+ clack57.cancel("Upgrade cancelled.");
40341
40491
  process.exit(0);
40342
40492
  }
40343
40493
  const presetConfig = getSMSPreset(selectedPreset);
@@ -40353,7 +40503,7 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40353
40503
  }
40354
40504
  case "event-tracking": {
40355
40505
  if (config2.eventTracking?.enabled) {
40356
- const eventAction = await clack56.select({
40506
+ const eventAction = await clack57.select({
40357
40507
  message: "What would you like to do with event tracking?",
40358
40508
  options: [
40359
40509
  {
@@ -40368,17 +40518,17 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40368
40518
  }
40369
40519
  ]
40370
40520
  });
40371
- if (clack56.isCancel(eventAction)) {
40372
- clack56.cancel("Upgrade cancelled.");
40521
+ if (clack57.isCancel(eventAction)) {
40522
+ clack57.cancel("Upgrade cancelled.");
40373
40523
  process.exit(0);
40374
40524
  }
40375
40525
  if (eventAction === "disable") {
40376
- const confirmDisable = await clack56.confirm({
40526
+ const confirmDisable = await clack57.confirm({
40377
40527
  message: "Are you sure? Existing history will remain, but new events won't be tracked.",
40378
40528
  initialValue: false
40379
40529
  });
40380
- if (clack56.isCancel(confirmDisable) || !confirmDisable) {
40381
- clack56.cancel("Event tracking not disabled.");
40530
+ if (clack57.isCancel(confirmDisable) || !confirmDisable) {
40531
+ clack57.cancel("Event tracking not disabled.");
40382
40532
  process.exit(0);
40383
40533
  }
40384
40534
  updatedConfig = {
@@ -40388,7 +40538,7 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40388
40538
  }
40389
40539
  };
40390
40540
  } else {
40391
- const retention = await clack56.select({
40541
+ const retention = await clack57.select({
40392
40542
  message: "Message history retention period:",
40393
40543
  options: [
40394
40544
  { value: "7days", label: "7 days", hint: "Minimal storage cost" },
@@ -40415,8 +40565,8 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40415
40565
  ],
40416
40566
  initialValue: config2.eventTracking.archiveRetention || "90days"
40417
40567
  });
40418
- if (clack56.isCancel(retention)) {
40419
- clack56.cancel("Upgrade cancelled.");
40568
+ if (clack57.isCancel(retention)) {
40569
+ clack57.cancel("Upgrade cancelled.");
40420
40570
  process.exit(0);
40421
40571
  }
40422
40572
  updatedConfig = {
@@ -40428,19 +40578,19 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40428
40578
  };
40429
40579
  }
40430
40580
  } else {
40431
- const enableTracking = await clack56.confirm({
40581
+ const enableTracking = await clack57.confirm({
40432
40582
  message: "Enable event tracking? (Track SMS events with history)",
40433
40583
  initialValue: true
40434
40584
  });
40435
- if (clack56.isCancel(enableTracking)) {
40436
- clack56.cancel("Upgrade cancelled.");
40585
+ if (clack57.isCancel(enableTracking)) {
40586
+ clack57.cancel("Upgrade cancelled.");
40437
40587
  process.exit(0);
40438
40588
  }
40439
40589
  if (!enableTracking) {
40440
- clack56.log.info("Event tracking not enabled.");
40590
+ clack57.log.info("Event tracking not enabled.");
40441
40591
  process.exit(0);
40442
40592
  }
40443
- const retention = await clack56.select({
40593
+ const retention = await clack57.select({
40444
40594
  message: "Message history retention period:",
40445
40595
  options: [
40446
40596
  { value: "7days", label: "7 days", hint: "Minimal storage cost" },
@@ -40463,8 +40613,8 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40463
40613
  ],
40464
40614
  initialValue: "90days"
40465
40615
  });
40466
- if (clack56.isCancel(retention)) {
40467
- clack56.cancel("Upgrade cancelled.");
40616
+ if (clack57.isCancel(retention)) {
40617
+ clack57.cancel("Upgrade cancelled.");
40468
40618
  process.exit(0);
40469
40619
  }
40470
40620
  updatedConfig = {
@@ -40483,12 +40633,12 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40483
40633
  }
40484
40634
  case "retention": {
40485
40635
  if (!config2.eventTracking?.enabled) {
40486
- clack56.log.error(
40636
+ clack57.log.error(
40487
40637
  "Event tracking is not enabled. Enable it first to change retention."
40488
40638
  );
40489
40639
  process.exit(1);
40490
40640
  }
40491
- const retention = await clack56.select({
40641
+ const retention = await clack57.select({
40492
40642
  message: "Message history retention period (event data in DynamoDB):",
40493
40643
  options: [
40494
40644
  { value: "7days", label: "7 days", hint: "Minimal storage cost" },
@@ -40507,8 +40657,8 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40507
40657
  ],
40508
40658
  initialValue: config2.eventTracking.archiveRetention || "90days"
40509
40659
  });
40510
- if (clack56.isCancel(retention)) {
40511
- clack56.cancel("Upgrade cancelled.");
40660
+ if (clack57.isCancel(retention)) {
40661
+ clack57.cancel("Upgrade cancelled.");
40512
40662
  process.exit(0);
40513
40663
  }
40514
40664
  updatedConfig = {
@@ -40526,21 +40676,21 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40526
40676
  case "link-tracking": {
40527
40677
  const enableLinkTracking = !config2.tracking?.linkTracking;
40528
40678
  if (enableLinkTracking) {
40529
- clack56.log.info(
40530
- pc59.dim(
40679
+ clack57.log.info(
40680
+ pc60.dim(
40531
40681
  "Link tracking will track clicks on URLs in your SMS messages."
40532
40682
  )
40533
40683
  );
40534
- clack56.log.info(
40535
- pc59.dim("URLs will be rewritten to go through a tracking endpoint.")
40684
+ clack57.log.info(
40685
+ pc60.dim("URLs will be rewritten to go through a tracking endpoint.")
40536
40686
  );
40537
40687
  }
40538
- const confirmed = await clack56.confirm({
40688
+ const confirmed = await clack57.confirm({
40539
40689
  message: enableLinkTracking ? "Enable link click tracking?" : "Disable link click tracking?",
40540
40690
  initialValue: enableLinkTracking
40541
40691
  });
40542
- if (clack56.isCancel(confirmed) || !confirmed) {
40543
- clack56.cancel("Upgrade cancelled.");
40692
+ if (clack57.isCancel(confirmed) || !confirmed) {
40693
+ clack57.cancel("Upgrade cancelled.");
40544
40694
  process.exit(0);
40545
40695
  }
40546
40696
  updatedConfig = {
@@ -40557,7 +40707,7 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40557
40707
  }
40558
40708
  case "archiving": {
40559
40709
  if (config2.messageArchiving?.enabled) {
40560
- const archivingAction = await clack56.select({
40710
+ const archivingAction = await clack57.select({
40561
40711
  message: "What would you like to do with message archiving?",
40562
40712
  options: [
40563
40713
  {
@@ -40572,17 +40722,17 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40572
40722
  }
40573
40723
  ]
40574
40724
  });
40575
- if (clack56.isCancel(archivingAction)) {
40576
- clack56.cancel("Upgrade cancelled.");
40725
+ if (clack57.isCancel(archivingAction)) {
40726
+ clack57.cancel("Upgrade cancelled.");
40577
40727
  process.exit(0);
40578
40728
  }
40579
40729
  if (archivingAction === "disable") {
40580
- const confirmDisable = await clack56.confirm({
40730
+ const confirmDisable = await clack57.confirm({
40581
40731
  message: "Are you sure? Existing archived messages will remain, but new messages won't be archived.",
40582
40732
  initialValue: false
40583
40733
  });
40584
- if (clack56.isCancel(confirmDisable) || !confirmDisable) {
40585
- clack56.cancel("Archiving not disabled.");
40734
+ if (clack57.isCancel(confirmDisable) || !confirmDisable) {
40735
+ clack57.cancel("Archiving not disabled.");
40586
40736
  process.exit(0);
40587
40737
  }
40588
40738
  updatedConfig = {
@@ -40593,7 +40743,7 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40593
40743
  }
40594
40744
  };
40595
40745
  } else {
40596
- const retention = await clack56.select({
40746
+ const retention = await clack57.select({
40597
40747
  message: "Message archive retention period:",
40598
40748
  options: [
40599
40749
  {
@@ -40624,8 +40774,8 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40624
40774
  ],
40625
40775
  initialValue: config2.messageArchiving.retention
40626
40776
  });
40627
- if (clack56.isCancel(retention)) {
40628
- clack56.cancel("Upgrade cancelled.");
40777
+ if (clack57.isCancel(retention)) {
40778
+ clack57.cancel("Upgrade cancelled.");
40629
40779
  process.exit(0);
40630
40780
  }
40631
40781
  updatedConfig = {
@@ -40637,19 +40787,19 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40637
40787
  };
40638
40788
  }
40639
40789
  } else {
40640
- const enableArchiving = await clack56.confirm({
40790
+ const enableArchiving = await clack57.confirm({
40641
40791
  message: "Enable message archiving? (Store full message content for viewing)",
40642
40792
  initialValue: true
40643
40793
  });
40644
- if (clack56.isCancel(enableArchiving)) {
40645
- clack56.cancel("Upgrade cancelled.");
40794
+ if (clack57.isCancel(enableArchiving)) {
40795
+ clack57.cancel("Upgrade cancelled.");
40646
40796
  process.exit(0);
40647
40797
  }
40648
40798
  if (!enableArchiving) {
40649
- clack56.log.info("Message archiving not enabled.");
40799
+ clack57.log.info("Message archiving not enabled.");
40650
40800
  process.exit(0);
40651
40801
  }
40652
- const retention = await clack56.select({
40802
+ const retention = await clack57.select({
40653
40803
  message: "Message archive retention period:",
40654
40804
  options: [
40655
40805
  { value: "7days", label: "7 days", hint: "~$1-2/mo for 10k msgs" },
@@ -40676,8 +40826,8 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40676
40826
  ],
40677
40827
  initialValue: "90days"
40678
40828
  });
40679
- if (clack56.isCancel(retention)) {
40680
- clack56.cancel("Upgrade cancelled.");
40829
+ if (clack57.isCancel(retention)) {
40830
+ clack57.cancel("Upgrade cancelled.");
40681
40831
  process.exit(0);
40682
40832
  }
40683
40833
  updatedConfig = {
@@ -40709,7 +40859,7 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40709
40859
  const currentAllowed = config2.protectConfiguration?.allowedCountries || [
40710
40860
  "US"
40711
40861
  ];
40712
- const selectedCountries = await clack56.multiselect({
40862
+ const selectedCountries = await clack57.multiselect({
40713
40863
  message: "Select countries to allow SMS delivery (all others blocked):",
40714
40864
  options: commonCountries.map((c) => ({
40715
40865
  value: c.code,
@@ -40718,16 +40868,16 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40718
40868
  initialValues: currentAllowed,
40719
40869
  required: true
40720
40870
  });
40721
- if (clack56.isCancel(selectedCountries)) {
40722
- clack56.cancel("Upgrade cancelled.");
40871
+ if (clack57.isCancel(selectedCountries)) {
40872
+ clack57.cancel("Upgrade cancelled.");
40723
40873
  process.exit(0);
40724
40874
  }
40725
- const enableAIT = await clack56.confirm({
40875
+ const enableAIT = await clack57.confirm({
40726
40876
  message: "Enable AIT (Artificially Inflated Traffic) filtering? (adds per-message cost)",
40727
40877
  initialValue: config2.protectConfiguration?.aitFiltering ?? false
40728
40878
  });
40729
- if (clack56.isCancel(enableAIT)) {
40730
- clack56.cancel("Upgrade cancelled.");
40879
+ if (clack57.isCancel(enableAIT)) {
40880
+ clack57.cancel("Upgrade cancelled.");
40731
40881
  process.exit(0);
40732
40882
  }
40733
40883
  updatedConfig = {
@@ -40745,28 +40895,28 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
40745
40895
  const newCostData = calculateSMSCosts(updatedConfig, 1e4);
40746
40896
  const costDiff = newCostData.total.monthly - currentCostData.total.monthly;
40747
40897
  console.log(`
40748
- ${pc59.bold("Cost Impact:")}`);
40898
+ ${pc60.bold("Cost Impact:")}`);
40749
40899
  console.log(
40750
- ` Current: ${pc59.cyan(`${formatCost3(currentCostData.total.monthly)}/mo`)}`
40900
+ ` Current: ${pc60.cyan(`${formatCost3(currentCostData.total.monthly)}/mo`)}`
40751
40901
  );
40752
40902
  console.log(
40753
- ` New: ${pc59.cyan(`${formatCost3(newCostData.total.monthly)}/mo`)}`
40903
+ ` New: ${pc60.cyan(`${formatCost3(newCostData.total.monthly)}/mo`)}`
40754
40904
  );
40755
40905
  if (costDiff > 0) {
40756
- console.log(` Change: ${pc59.yellow(`+${formatCost3(costDiff)}/mo`)}`);
40906
+ console.log(` Change: ${pc60.yellow(`+${formatCost3(costDiff)}/mo`)}`);
40757
40907
  } else if (costDiff < 0) {
40758
40908
  console.log(
40759
- ` Change: ${pc59.green(`-${formatCost3(Math.abs(costDiff))}/mo`)}`
40909
+ ` Change: ${pc60.green(`-${formatCost3(Math.abs(costDiff))}/mo`)}`
40760
40910
  );
40761
40911
  }
40762
40912
  console.log("");
40763
40913
  if (!(options.yes || options.preview)) {
40764
- const confirmed = await clack56.confirm({
40914
+ const confirmed = await clack57.confirm({
40765
40915
  message: "Proceed with upgrade?",
40766
40916
  initialValue: true
40767
40917
  });
40768
- if (clack56.isCancel(confirmed) || !confirmed) {
40769
- clack56.cancel("Upgrade cancelled.");
40918
+ if (clack57.isCancel(confirmed) || !confirmed) {
40919
+ clack57.cancel("Upgrade cancelled.");
40770
40920
  process.exit(0);
40771
40921
  }
40772
40922
  }
@@ -40835,8 +40985,8 @@ ${pc59.bold("Cost Impact:")}`);
40835
40985
  resourceChanges: previewResult.resourceChanges,
40836
40986
  commandName: "wraps sms upgrade"
40837
40987
  });
40838
- clack56.outro(
40839
- pc59.green("Preview complete. Run without --preview to upgrade.")
40988
+ clack57.outro(
40989
+ pc60.green("Preview complete. Run without --preview to upgrade.")
40840
40990
  );
40841
40991
  trackServiceUpgrade("sms", {
40842
40992
  region,
@@ -40941,43 +41091,43 @@ ${pc59.bold("Cost Impact:")}`);
40941
41091
  }
40942
41092
  progress.info("Connection metadata updated");
40943
41093
  console.log("\n");
40944
- clack56.log.success(pc59.green(pc59.bold("SMS infrastructure upgraded!")));
41094
+ clack57.log.success(pc60.green(pc60.bold("SMS infrastructure upgraded!")));
40945
41095
  console.log("\n");
40946
- clack56.note(
41096
+ clack57.note(
40947
41097
  [
40948
- `${pc59.bold("Phone Number:")} ${pc59.cyan(outputs.phoneNumber || "Provisioning...")}`,
40949
- `${pc59.bold("Phone Type:")} ${pc59.cyan(updatedConfig.phoneNumberType || "simulator")}`,
40950
- `${pc59.bold("Config Set:")} ${pc59.cyan(outputs.configSetName || "wraps-sms-config")}`,
40951
- `${pc59.bold("Region:")} ${pc59.cyan(outputs.region)}`,
40952
- outputs.tableName ? `${pc59.bold("History Table:")} ${pc59.cyan(outputs.tableName)}` : "",
41098
+ `${pc60.bold("Phone Number:")} ${pc60.cyan(outputs.phoneNumber || "Provisioning...")}`,
41099
+ `${pc60.bold("Phone Type:")} ${pc60.cyan(updatedConfig.phoneNumberType || "simulator")}`,
41100
+ `${pc60.bold("Config Set:")} ${pc60.cyan(outputs.configSetName || "wraps-sms-config")}`,
41101
+ `${pc60.bold("Region:")} ${pc60.cyan(outputs.region)}`,
41102
+ outputs.tableName ? `${pc60.bold("History Table:")} ${pc60.cyan(outputs.tableName)}` : "",
40953
41103
  "",
40954
- pc59.dim("IAM Role:"),
40955
- pc59.dim(` ${outputs.roleArn}`)
41104
+ pc60.dim("IAM Role:"),
41105
+ pc60.dim(` ${outputs.roleArn}`)
40956
41106
  ].filter(Boolean).join("\n"),
40957
41107
  "SMS Infrastructure"
40958
41108
  );
40959
41109
  console.log(`
40960
- ${pc59.green("\u2713")} ${pc59.bold("Upgrade complete!")}
41110
+ ${pc60.green("\u2713")} ${pc60.bold("Upgrade complete!")}
40961
41111
  `);
40962
41112
  if (upgradeAction === "phone-number") {
40963
41113
  console.log(
40964
- `Upgraded to ${pc59.cyan(updatedConfig.phoneNumberType)} number (${pc59.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
41114
+ `Upgraded to ${pc60.cyan(updatedConfig.phoneNumberType)} number (${pc60.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
40965
41115
  `
40966
41116
  );
40967
41117
  if (updatedConfig.phoneNumberType === "toll-free") {
40968
- console.log(`${pc59.bold("Next Steps:")}`);
41118
+ console.log(`${pc60.bold("Next Steps:")}`);
40969
41119
  console.log(
40970
- ` 1. Run ${pc59.cyan("wraps sms register")} to start toll-free registration`
41120
+ ` 1. Run ${pc60.cyan("wraps sms register")} to start toll-free registration`
40971
41121
  );
40972
41122
  console.log(" 2. Submit your business information and use case");
40973
41123
  console.log(" 3. Wait for carrier verification (1-5 business days)");
40974
41124
  console.log("");
40975
41125
  console.log(
40976
- pc59.dim("Until verified, your number can only send limited messages.")
41126
+ pc60.dim("Until verified, your number can only send limited messages.")
40977
41127
  );
40978
41128
  console.log("");
40979
41129
  } else if (updatedConfig.phoneNumberType === "10dlc") {
40980
- console.log(`${pc59.bold("Next Steps:")}`);
41130
+ console.log(`${pc60.bold("Next Steps:")}`);
40981
41131
  console.log(" 1. Register your brand in the AWS Console");
40982
41132
  console.log(" 2. Create a 10DLC campaign for your use case");
40983
41133
  console.log(" 3. Wait for campaign approval (1-7 business days)");
@@ -40985,16 +41135,16 @@ ${pc59.green("\u2713")} ${pc59.bold("Upgrade complete!")}
40985
41135
  }
40986
41136
  } else if (upgradeAction === "preset" && newPreset) {
40987
41137
  console.log(
40988
- `Upgraded to ${pc59.cyan(newPreset)} preset (${pc59.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
41138
+ `Upgraded to ${pc60.cyan(newPreset)} preset (${pc60.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
40989
41139
  `
40990
41140
  );
40991
41141
  } else {
40992
41142
  console.log(
40993
- `Updated configuration (${pc59.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
41143
+ `Updated configuration (${pc60.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
40994
41144
  `
40995
41145
  );
40996
41146
  }
40997
- console.log(pc59.dim(getSMSCostSummary(updatedConfig, 1e4)));
41147
+ console.log(pc60.dim(getSMSCostSummary(updatedConfig, 1e4)));
40998
41148
  const enabledFeatures = [];
40999
41149
  if (updatedConfig.tracking?.enabled) {
41000
41150
  enabledFeatures.push("tracking");
@@ -41018,7 +41168,7 @@ ${pc59.green("\u2713")} ${pc59.bold("Upgrade complete!")}
41018
41168
  action: typeof upgradeAction === "string" ? upgradeAction : void 0,
41019
41169
  duration_ms: Date.now() - startTime
41020
41170
  });
41021
- clack56.outro(pc59.green("Upgrade complete!"));
41171
+ clack57.outro(pc60.green("Upgrade complete!"));
41022
41172
  }
41023
41173
 
41024
41174
  // src/commands/sms/verify-number.ts
@@ -41037,13 +41187,13 @@ import {
41037
41187
  SendDestinationNumberVerificationCodeCommand,
41038
41188
  VerifyDestinationNumberCommand
41039
41189
  } from "@aws-sdk/client-pinpoint-sms-voice-v2";
41040
- import * as clack57 from "@clack/prompts";
41041
- import pc60 from "picocolors";
41190
+ import * as clack58 from "@clack/prompts";
41191
+ import pc61 from "picocolors";
41042
41192
  async function smsVerifyNumber(options) {
41043
41193
  const startTime = Date.now();
41044
41194
  const progress = new DeploymentProgress();
41045
41195
  if (!isJsonMode()) {
41046
- clack57.intro(pc60.bold("Wraps SMS - Verify Destination Number"));
41196
+ clack58.intro(pc61.bold("Wraps SMS - Verify Destination Number"));
41047
41197
  }
41048
41198
  const identity = await progress.execute(
41049
41199
  "Validating AWS credentials",
@@ -41053,10 +41203,10 @@ async function smsVerifyNumber(options) {
41053
41203
  const metadata = await loadConnectionMetadata(identity.accountId, region);
41054
41204
  if (!metadata?.services?.sms) {
41055
41205
  progress.stop();
41056
- clack57.log.error("No SMS infrastructure found");
41206
+ clack58.log.error("No SMS infrastructure found");
41057
41207
  console.log(
41058
41208
  `
41059
- Run ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure.
41209
+ Run ${pc61.cyan("wraps sms init")} to deploy SMS infrastructure.
41060
41210
  `
41061
41211
  );
41062
41212
  process.exit(1);
@@ -41070,19 +41220,19 @@ Run ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure.
41070
41220
  );
41071
41221
  progress.stop();
41072
41222
  if (!response.VerifiedDestinationNumbers || response.VerifiedDestinationNumbers.length === 0) {
41073
- clack57.log.info("No verified destination numbers found");
41223
+ clack58.log.info("No verified destination numbers found");
41074
41224
  console.log(
41075
41225
  `
41076
- Run ${pc60.cyan("wraps sms verify-number")} to verify a number.
41226
+ Run ${pc61.cyan("wraps sms verify-number")} to verify a number.
41077
41227
  `
41078
41228
  );
41079
41229
  } else {
41080
41230
  console.log("\n");
41081
- clack57.log.info(pc60.bold("Verified Destination Numbers:"));
41231
+ clack58.log.info(pc61.bold("Verified Destination Numbers:"));
41082
41232
  console.log("");
41083
41233
  for (const num of response.VerifiedDestinationNumbers) {
41084
- const status2 = num.Status === "VERIFIED" ? pc60.green("\u2713 Verified") : pc60.yellow("\u29D6 Pending");
41085
- console.log(` ${pc60.cyan(num.DestinationPhoneNumber)} - ${status2}`);
41234
+ const status2 = num.Status === "VERIFIED" ? pc61.green("\u2713 Verified") : pc61.yellow("\u29D6 Pending");
41235
+ console.log(` ${pc61.cyan(num.DestinationPhoneNumber)} - ${status2}`);
41086
41236
  }
41087
41237
  console.log("");
41088
41238
  }
@@ -41100,7 +41250,7 @@ Run ${pc60.cyan("wraps sms verify-number")} to verify a number.
41100
41250
  });
41101
41251
  return;
41102
41252
  }
41103
- clack57.outro(pc60.green("Done!"));
41253
+ clack58.outro(pc61.green("Done!"));
41104
41254
  return;
41105
41255
  } catch (error) {
41106
41256
  progress.stop();
@@ -41108,7 +41258,7 @@ Run ${pc60.cyan("wraps sms verify-number")} to verify a number.
41108
41258
  trackError("SMS_LIST_VERIFIED_FAILED", "sms:verify-number:list", {
41109
41259
  error: errorMessage
41110
41260
  });
41111
- clack57.log.error(`Failed to list verified numbers: ${errorMessage}`);
41261
+ clack58.log.error(`Failed to list verified numbers: ${errorMessage}`);
41112
41262
  process.exit(1);
41113
41263
  }
41114
41264
  }
@@ -41116,10 +41266,10 @@ Run ${pc60.cyan("wraps sms verify-number")} to verify a number.
41116
41266
  const phoneNumber2 = options.phoneNumber;
41117
41267
  if (!phoneNumber2) {
41118
41268
  progress.stop();
41119
- clack57.log.error("Phone number is required for deletion");
41269
+ clack58.log.error("Phone number is required for deletion");
41120
41270
  console.log(
41121
41271
  `
41122
- Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234")}
41272
+ Usage: ${pc61.cyan("wraps sms verify-number --delete --phone-number +14155551234")}
41123
41273
  `
41124
41274
  );
41125
41275
  process.exit(1);
@@ -41133,7 +41283,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
41133
41283
  const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
41134
41284
  if (!verifiedNumber?.VerifiedDestinationNumberId) {
41135
41285
  progress.stop();
41136
- clack57.log.error(`Number ${phoneNumber2} is not in verified list`);
41286
+ clack58.log.error(`Number ${phoneNumber2} is not in verified list`);
41137
41287
  process.exit(1);
41138
41288
  }
41139
41289
  await progress.execute(`Removing ${phoneNumber2}`, async () => {
@@ -41144,7 +41294,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
41144
41294
  );
41145
41295
  });
41146
41296
  progress.stop();
41147
- clack57.log.success(`Removed ${pc60.cyan(phoneNumber2)} from verified list`);
41297
+ clack58.log.success(`Removed ${pc61.cyan(phoneNumber2)} from verified list`);
41148
41298
  trackCommand("sms:verify-number:delete", {
41149
41299
  success: true,
41150
41300
  duration_ms: Date.now() - startTime
@@ -41156,7 +41306,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
41156
41306
  });
41157
41307
  return;
41158
41308
  }
41159
- clack57.outro(pc60.green("Done!"));
41309
+ clack58.outro(pc61.green("Done!"));
41160
41310
  return;
41161
41311
  } catch (error) {
41162
41312
  progress.stop();
@@ -41164,7 +41314,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
41164
41314
  trackError("SMS_DELETE_VERIFIED_FAILED", "sms:verify-number:delete", {
41165
41315
  error: errorMessage
41166
41316
  });
41167
- clack57.log.error(`Failed to delete verified number: ${errorMessage}`);
41317
+ clack58.log.error(`Failed to delete verified number: ${errorMessage}`);
41168
41318
  process.exit(1);
41169
41319
  }
41170
41320
  }
@@ -41177,7 +41327,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
41177
41327
  );
41178
41328
  }
41179
41329
  if (!phoneNumber) {
41180
- const result = await clack57.text({
41330
+ const result = await clack58.text({
41181
41331
  message: "Enter phone number to verify (E.164 format):",
41182
41332
  placeholder: "+14155551234",
41183
41333
  validate: (value) => {
@@ -41190,14 +41340,14 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
41190
41340
  return;
41191
41341
  }
41192
41342
  });
41193
- if (clack57.isCancel(result)) {
41194
- clack57.cancel("Operation cancelled.");
41343
+ if (clack58.isCancel(result)) {
41344
+ clack58.cancel("Operation cancelled.");
41195
41345
  process.exit(0);
41196
41346
  }
41197
41347
  phoneNumber = result;
41198
41348
  } else if (!isValidPhoneNumber(phoneNumber)) {
41199
41349
  progress.stop();
41200
- clack57.log.error(
41350
+ clack58.log.error(
41201
41351
  `Invalid phone number format: ${phoneNumber}. Use E.164 format (e.g., +14155551234)`
41202
41352
  );
41203
41353
  process.exit(1);
@@ -41212,7 +41362,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
41212
41362
  const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
41213
41363
  if (!verifiedNumber?.VerifiedDestinationNumberId) {
41214
41364
  progress.stop();
41215
- clack57.log.error(
41365
+ clack58.log.error(
41216
41366
  `Number ${phoneNumber} not found. Run without --code first.`
41217
41367
  );
41218
41368
  process.exit(1);
@@ -41227,12 +41377,12 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
41227
41377
  });
41228
41378
  progress.stop();
41229
41379
  console.log("\n");
41230
- clack57.log.success(
41231
- pc60.green(`Phone number ${pc60.cyan(phoneNumber)} verified!`)
41380
+ clack58.log.success(
41381
+ pc61.green(`Phone number ${pc61.cyan(phoneNumber)} verified!`)
41232
41382
  );
41233
41383
  console.log("");
41234
41384
  console.log(
41235
- `You can now send test messages to this number with ${pc60.cyan("wraps sms test")}`
41385
+ `You can now send test messages to this number with ${pc61.cyan("wraps sms test")}`
41236
41386
  );
41237
41387
  trackCommand("sms:verify-number:confirm", {
41238
41388
  success: true,
@@ -41245,23 +41395,23 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
41245
41395
  });
41246
41396
  return;
41247
41397
  }
41248
- clack57.outro(pc60.green("Verification complete!"));
41398
+ clack58.outro(pc61.green("Verification complete!"));
41249
41399
  return;
41250
41400
  } catch (error) {
41251
41401
  progress.stop();
41252
41402
  const errorMessage = error instanceof Error ? error.message : String(error);
41253
41403
  if (errorMessage.includes("Invalid verification code")) {
41254
- clack57.log.error("Invalid verification code. Please try again.");
41404
+ clack58.log.error("Invalid verification code. Please try again.");
41255
41405
  console.log(
41256
41406
  `
41257
- Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
41407
+ Run ${pc61.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
41258
41408
  `
41259
41409
  );
41260
41410
  } else {
41261
41411
  trackError("SMS_VERIFY_CODE_FAILED", "sms:verify-number:confirm", {
41262
41412
  error: errorMessage
41263
41413
  });
41264
- clack57.log.error(`Verification failed: ${errorMessage}`);
41414
+ clack58.log.error(`Verification failed: ${errorMessage}`);
41265
41415
  }
41266
41416
  process.exit(1);
41267
41417
  }
@@ -41276,7 +41426,7 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
41276
41426
  const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
41277
41427
  if (!verifiedNumber?.VerifiedDestinationNumberId) {
41278
41428
  progress.stop();
41279
- clack57.log.error(
41429
+ clack58.log.error(
41280
41430
  `Number ${phoneNumber} not found. Run without --resend first.`
41281
41431
  );
41282
41432
  process.exit(1);
@@ -41290,11 +41440,11 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
41290
41440
  );
41291
41441
  });
41292
41442
  progress.stop();
41293
- clack57.log.success(`Verification code resent to ${pc60.cyan(phoneNumber)}`);
41443
+ clack58.log.success(`Verification code resent to ${pc61.cyan(phoneNumber)}`);
41294
41444
  console.log("");
41295
41445
  console.log(
41296
41446
  `Once you receive the code, run:
41297
- ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
41447
+ ${pc61.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
41298
41448
  );
41299
41449
  trackCommand("sms:verify-number:resend", {
41300
41450
  success: true,
@@ -41307,7 +41457,7 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
41307
41457
  });
41308
41458
  return;
41309
41459
  }
41310
- clack57.outro(pc60.green("Code sent!"));
41460
+ clack58.outro(pc61.green("Code sent!"));
41311
41461
  return;
41312
41462
  } catch (error) {
41313
41463
  progress.stop();
@@ -41315,7 +41465,7 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
41315
41465
  trackError("SMS_RESEND_CODE_FAILED", "sms:verify-number:resend", {
41316
41466
  error: errorMessage
41317
41467
  });
41318
- clack57.log.error(`Failed to resend code: ${errorMessage}`);
41468
+ clack58.log.error(`Failed to resend code: ${errorMessage}`);
41319
41469
  process.exit(1);
41320
41470
  }
41321
41471
  }
@@ -41335,10 +41485,10 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
41335
41485
  });
41336
41486
  return;
41337
41487
  }
41338
- clack57.log.info(
41339
- `Number ${pc60.cyan(phoneNumber)} is already verified and ready to use!`
41488
+ clack58.log.info(
41489
+ `Number ${pc61.cyan(phoneNumber)} is already verified and ready to use!`
41340
41490
  );
41341
- clack57.outro(pc60.green("Done!"));
41491
+ clack58.outro(pc61.green("Done!"));
41342
41492
  return;
41343
41493
  }
41344
41494
  if (existingNumber?.Status === "PENDING") {
@@ -41362,15 +41512,15 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
41362
41512
  });
41363
41513
  return;
41364
41514
  }
41365
- clack57.log.info(
41366
- `Verification already in progress. New code sent to ${pc60.cyan(phoneNumber)}`
41515
+ clack58.log.info(
41516
+ `Verification already in progress. New code sent to ${pc61.cyan(phoneNumber)}`
41367
41517
  );
41368
41518
  console.log("");
41369
41519
  console.log(
41370
41520
  `Once you receive the code, run:
41371
- ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
41521
+ ${pc61.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
41372
41522
  );
41373
- clack57.outro(pc60.green("Code sent!"));
41523
+ clack58.outro(pc61.green("Code sent!"));
41374
41524
  return;
41375
41525
  }
41376
41526
  const createResponse = await progress.execute(
@@ -41391,18 +41541,18 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
41391
41541
  });
41392
41542
  progress.stop();
41393
41543
  console.log("\n");
41394
- clack57.log.success(
41395
- `Verification code sent to ${pc60.cyan(phoneNumber)} via SMS`
41544
+ clack58.log.success(
41545
+ `Verification code sent to ${pc61.cyan(phoneNumber)} via SMS`
41396
41546
  );
41397
41547
  console.log("");
41398
- clack57.note(
41548
+ clack58.note(
41399
41549
  [
41400
41550
  "1. Check your phone for the verification code",
41401
41551
  "",
41402
41552
  "2. Complete verification with:",
41403
- ` ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`,
41553
+ ` ${pc61.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`,
41404
41554
  "",
41405
- pc60.dim("The code expires in 24 hours")
41555
+ pc61.dim("The code expires in 24 hours")
41406
41556
  ].join("\n"),
41407
41557
  "Next Steps"
41408
41558
  );
@@ -41418,22 +41568,22 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
41418
41568
  });
41419
41569
  return;
41420
41570
  }
41421
- clack57.outro(pc60.green("Verification started!"));
41571
+ clack58.outro(pc61.green("Verification started!"));
41422
41572
  } catch (error) {
41423
41573
  progress.stop();
41424
41574
  const errorMessage = error instanceof Error ? error.message : String(error);
41425
41575
  if (errorMessage.includes("already exists")) {
41426
- clack57.log.error("This number is already being verified");
41576
+ clack58.log.error("This number is already being verified");
41427
41577
  console.log(
41428
41578
  `
41429
- Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
41579
+ Run ${pc61.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
41430
41580
  `
41431
41581
  );
41432
41582
  } else {
41433
41583
  trackError("SMS_CREATE_VERIFIED_FAILED", "sms:verify-number:start", {
41434
41584
  error: errorMessage
41435
41585
  });
41436
- clack57.log.error(`Failed to start verification: ${errorMessage}`);
41586
+ clack58.log.error(`Failed to start verification: ${errorMessage}`);
41437
41587
  }
41438
41588
  process.exit(1);
41439
41589
  }
@@ -41442,88 +41592,88 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
41442
41592
  // src/commands/support.ts
41443
41593
  init_esm_shims();
41444
41594
  init_events();
41445
- import * as clack58 from "@clack/prompts";
41446
- import pc61 from "picocolors";
41595
+ import * as clack59 from "@clack/prompts";
41596
+ import pc62 from "picocolors";
41447
41597
  async function support() {
41448
41598
  trackCommand("support", { success: true });
41449
- clack58.intro(pc61.bold("Get Help with Wraps"));
41599
+ clack59.intro(pc62.bold("Get Help with Wraps"));
41450
41600
  console.log();
41451
- console.log(` ${pc61.bold("Email:")} ${pc61.cyan("hey@wraps.sh")}`);
41601
+ console.log(` ${pc62.bold("Email:")} ${pc62.cyan("hey@wraps.sh")}`);
41452
41602
  console.log(
41453
- ` ${pc61.bold("GitHub:")} ${pc61.cyan("https://github.com/wraps-dev/wraps/issues")}`
41603
+ ` ${pc62.bold("GitHub:")} ${pc62.cyan("https://github.com/wraps-dev/wraps/issues")}`
41454
41604
  );
41455
- console.log(` ${pc61.bold("Docs:")} ${pc61.cyan("https://wraps.dev/docs")}`);
41605
+ console.log(` ${pc62.bold("Docs:")} ${pc62.cyan("https://wraps.dev/docs")}`);
41456
41606
  console.log();
41457
- console.log(pc61.dim(" Response time: Usually within 24 hours"));
41607
+ console.log(pc62.dim(" Response time: Usually within 24 hours"));
41458
41608
  console.log();
41459
41609
  }
41460
41610
 
41461
41611
  // src/commands/telemetry.ts
41462
41612
  init_esm_shims();
41463
41613
  init_client();
41464
- import * as clack59 from "@clack/prompts";
41465
- import pc62 from "picocolors";
41614
+ import * as clack60 from "@clack/prompts";
41615
+ import pc63 from "picocolors";
41466
41616
  async function telemetryEnable() {
41467
41617
  const client = getTelemetryClient();
41468
41618
  const override = client.enable();
41469
41619
  if (override) {
41470
- clack59.log.warn(
41620
+ clack60.log.warn(
41471
41621
  "Telemetry enabled in config, but overridden by environment"
41472
41622
  );
41473
- console.log(` Reason: ${pc62.yellow(override)}`);
41474
- console.log(` Config: ${pc62.dim(client.getConfigPath())}`);
41623
+ console.log(` Reason: ${pc63.yellow(override)}`);
41624
+ console.log(` Config: ${pc63.dim(client.getConfigPath())}`);
41475
41625
  console.log();
41476
41626
  } else {
41477
- clack59.log.success(pc62.green("Telemetry enabled"));
41478
- console.log(` Config: ${pc62.dim(client.getConfigPath())}`);
41627
+ clack60.log.success(pc63.green("Telemetry enabled"));
41628
+ console.log(` Config: ${pc63.dim(client.getConfigPath())}`);
41479
41629
  console.log(`
41480
- ${pc62.dim("Thank you for helping improve Wraps!")}
41630
+ ${pc63.dim("Thank you for helping improve Wraps!")}
41481
41631
  `);
41482
41632
  }
41483
41633
  }
41484
41634
  async function telemetryDisable() {
41485
41635
  const client = getTelemetryClient();
41486
41636
  client.disable();
41487
- clack59.log.success(pc62.green("Telemetry disabled"));
41488
- console.log(` Config: ${pc62.dim(client.getConfigPath())}`);
41637
+ clack60.log.success(pc63.green("Telemetry disabled"));
41638
+ console.log(` Config: ${pc63.dim(client.getConfigPath())}`);
41489
41639
  console.log(
41490
41640
  `
41491
- ${pc62.dim("You can re-enable with:")} wraps telemetry enable
41641
+ ${pc63.dim("You can re-enable with:")} wraps telemetry enable
41492
41642
  `
41493
41643
  );
41494
41644
  }
41495
41645
  async function telemetryStatus() {
41496
41646
  const client = getTelemetryClient();
41497
- clack59.intro(pc62.bold("Telemetry Status"));
41647
+ clack60.intro(pc63.bold("Telemetry Status"));
41498
41648
  const override = client.getEnvOverride();
41499
- const status2 = client.isEnabled() ? pc62.green("Enabled") : pc62.red("Disabled");
41649
+ const status2 = client.isEnabled() ? pc63.green("Enabled") : pc63.red("Disabled");
41500
41650
  console.log();
41501
- console.log(` ${pc62.bold("Status:")} ${status2}`);
41651
+ console.log(` ${pc63.bold("Status:")} ${status2}`);
41502
41652
  if (!client.isEnabled() && override) {
41503
- console.log(` ${pc62.bold("Reason:")} ${pc62.yellow(override)}`);
41653
+ console.log(` ${pc63.bold("Reason:")} ${pc63.yellow(override)}`);
41504
41654
  }
41505
- console.log(` ${pc62.bold("Config file:")} ${pc62.dim(client.getConfigPath())}`);
41655
+ console.log(` ${pc63.bold("Config file:")} ${pc63.dim(client.getConfigPath())}`);
41506
41656
  if (client.isEnabled()) {
41507
41657
  console.log();
41508
- console.log(pc62.bold(" How to opt-out:"));
41509
- console.log(` ${pc62.cyan("wraps telemetry disable")}`);
41658
+ console.log(pc63.bold(" How to opt-out:"));
41659
+ console.log(` ${pc63.cyan("wraps telemetry disable")}`);
41510
41660
  console.log(
41511
- ` ${pc62.dim("Or set:")} ${pc62.cyan("WRAPS_TELEMETRY_DISABLED=1")}`
41661
+ ` ${pc63.dim("Or set:")} ${pc63.cyan("WRAPS_TELEMETRY_DISABLED=1")}`
41512
41662
  );
41513
- console.log(` ${pc62.dim("Or set:")} ${pc62.cyan("DO_NOT_TRACK=1")}`);
41663
+ console.log(` ${pc63.dim("Or set:")} ${pc63.cyan("DO_NOT_TRACK=1")}`);
41514
41664
  } else {
41515
41665
  console.log();
41516
- console.log(pc62.bold(" How to opt-in:"));
41517
- console.log(` ${pc62.cyan("wraps telemetry enable")}`);
41666
+ console.log(pc63.bold(" How to opt-in:"));
41667
+ console.log(` ${pc63.cyan("wraps telemetry enable")}`);
41518
41668
  }
41519
41669
  console.log();
41520
- console.log(pc62.bold(" Debug mode:"));
41670
+ console.log(pc63.bold(" Debug mode:"));
41521
41671
  console.log(
41522
- ` ${pc62.dim("See what would be sent:")} ${pc62.cyan("WRAPS_TELEMETRY_DEBUG=1 wraps <command>")}`
41672
+ ` ${pc63.dim("See what would be sent:")} ${pc63.cyan("WRAPS_TELEMETRY_DEBUG=1 wraps <command>")}`
41523
41673
  );
41524
41674
  console.log();
41525
41675
  console.log(
41526
- ` ${pc62.dim("Learn more:")} ${pc62.cyan("https://wraps.dev/docs/telemetry")}`
41676
+ ` ${pc63.dim("Learn more:")} ${pc63.cyan("https://wraps.dev/docs/telemetry")}`
41527
41677
  );
41528
41678
  console.log();
41529
41679
  }
@@ -41532,8 +41682,8 @@ async function telemetryStatus() {
41532
41682
  init_esm_shims();
41533
41683
  import { existsSync as existsSync20, mkdirSync as mkdirSync2, writeFileSync } from "fs";
41534
41684
  import { join as join22 } from "path";
41535
- import * as clack60 from "@clack/prompts";
41536
- import pc63 from "picocolors";
41685
+ import * as clack61 from "@clack/prompts";
41686
+ import pc64 from "picocolors";
41537
41687
  var EXAMPLE_CASCADE_WORKFLOW = `import {
41538
41688
  defineWorkflow,
41539
41689
  sendEmail,
@@ -41628,30 +41778,30 @@ export default defineConfig({
41628
41778
  });
41629
41779
  `;
41630
41780
  async function workflowInit(options = {}) {
41631
- clack60.intro(pc63.bgCyan(pc63.black(" wraps workflow init ")));
41781
+ clack61.intro(pc64.bgCyan(pc64.black(" wraps workflow init ")));
41632
41782
  const wrapsDir = join22(process.cwd(), "wraps");
41633
41783
  const workflowsDir = join22(wrapsDir, "workflows");
41634
41784
  const configPath = join22(wrapsDir, "wraps.config.ts");
41635
41785
  if (existsSync20(workflowsDir)) {
41636
- clack60.log.info(
41637
- `Workflows directory already exists at ${pc63.cyan("wraps/workflows/")}`
41786
+ clack61.log.info(
41787
+ `Workflows directory already exists at ${pc64.cyan("wraps/workflows/")}`
41638
41788
  );
41639
41789
  const files = existsSync20(join22(workflowsDir, "cart-recovery.ts")) || existsSync20(join22(workflowsDir, "welcome-sequence.ts"));
41640
41790
  if (files && !options.yes) {
41641
- const shouldContinue = await clack60.confirm({
41791
+ const shouldContinue = await clack61.confirm({
41642
41792
  message: "Example files may already exist. Overwrite them?",
41643
41793
  initialValue: false
41644
41794
  });
41645
- if (clack60.isCancel(shouldContinue) || !shouldContinue) {
41646
- clack60.log.info("Skipping file creation.");
41795
+ if (clack61.isCancel(shouldContinue) || !shouldContinue) {
41796
+ clack61.log.info("Skipping file creation.");
41647
41797
  showNextSteps2();
41648
- clack60.outro("Done!");
41798
+ clack61.outro("Done!");
41649
41799
  return;
41650
41800
  }
41651
41801
  }
41652
41802
  }
41653
41803
  try {
41654
- const s = clack60.spinner();
41804
+ const s = clack61.spinner();
41655
41805
  s.start("Creating workflows directory...");
41656
41806
  mkdirSync2(workflowsDir, { recursive: true });
41657
41807
  s.stop("Created wraps/workflows/");
@@ -41669,34 +41819,34 @@ async function workflowInit(options = {}) {
41669
41819
  s.stop("Created 2 example workflows");
41670
41820
  if (!existsSync20(configPath)) {
41671
41821
  writeFileSync(configPath, EXAMPLE_CONFIG, "utf-8");
41672
- clack60.log.info(`Created ${pc63.cyan("wraps/wraps.config.ts")}`);
41822
+ clack61.log.info(`Created ${pc64.cyan("wraps/wraps.config.ts")}`);
41673
41823
  }
41674
- clack60.log.success(
41675
- `${pc63.bold("Workflows scaffolded!")} Created:
41676
- ${pc63.cyan("wraps/wraps.config.ts")} \u2014 Project config
41677
- ${pc63.cyan("wraps/workflows/cart-recovery.ts")} \u2014 Cross-channel cascade example
41678
- ${pc63.cyan("wraps/workflows/welcome-sequence.ts")} \u2014 Welcome series example`
41824
+ clack61.log.success(
41825
+ `${pc64.bold("Workflows scaffolded!")} Created:
41826
+ ${pc64.cyan("wraps/wraps.config.ts")} \u2014 Project config
41827
+ ${pc64.cyan("wraps/workflows/cart-recovery.ts")} \u2014 Cross-channel cascade example
41828
+ ${pc64.cyan("wraps/workflows/welcome-sequence.ts")} \u2014 Welcome series example`
41679
41829
  );
41680
41830
  showNextSteps2();
41681
- clack60.outro(pc63.green("Happy orchestrating!"));
41831
+ clack61.outro(pc64.green("Happy orchestrating!"));
41682
41832
  } catch (error) {
41683
- clack60.log.error(
41833
+ clack61.log.error(
41684
41834
  `Failed to scaffold workflows: ${error instanceof Error ? error.message : String(error)}`
41685
41835
  );
41686
- clack60.outro(pc63.red("Scaffolding failed."));
41836
+ clack61.outro(pc64.red("Scaffolding failed."));
41687
41837
  process.exitCode = 1;
41688
41838
  }
41689
41839
  }
41690
41840
  function showNextSteps2() {
41691
- clack60.log.info(
41692
- `${pc63.bold("Next steps:")}
41841
+ clack61.log.info(
41842
+ `${pc64.bold("Next steps:")}
41693
41843
 
41694
- 1. Edit ${pc63.cyan("wraps/wraps.config.ts")} with your org slug and domain
41695
- 2. Edit your workflows in ${pc63.cyan("wraps/workflows/")}
41696
- 3. Validate: ${pc63.cyan("wraps email workflows validate")}
41697
- 4. Push: ${pc63.cyan("wraps email workflows push")}
41844
+ 1. Edit ${pc64.cyan("wraps/wraps.config.ts")} with your org slug and domain
41845
+ 2. Edit your workflows in ${pc64.cyan("wraps/workflows/")}
41846
+ 3. Validate: ${pc64.cyan("wraps email workflows validate")}
41847
+ 4. Push: ${pc64.cyan("wraps email workflows push")}
41698
41848
 
41699
- ${pc63.dim("Docs:")} ${pc63.underline("https://wraps.dev/docs/guides/orchestration")}`
41849
+ ${pc64.dim("Docs:")} ${pc64.underline("https://wraps.dev/docs/guides/orchestration")}`
41700
41850
  );
41701
41851
  }
41702
41852
 
@@ -41891,208 +42041,211 @@ function showVersion() {
41891
42041
  process.exit(0);
41892
42042
  }
41893
42043
  function showHelp() {
41894
- clack61.intro(pc65.bold(`WRAPS CLI v${VERSION}`));
42044
+ clack62.intro(pc66.bold(`WRAPS CLI v${VERSION}`));
41895
42045
  console.log("Deploy AWS infrastructure to your account\n");
41896
42046
  console.log("Usage: wraps [service] <command> [options]\n");
41897
42047
  console.log("Services:");
41898
- console.log(` ${pc65.cyan("email")} Email infrastructure (AWS SES)`);
42048
+ console.log(` ${pc66.cyan("email")} Email infrastructure (AWS SES)`);
41899
42049
  console.log(
41900
- ` ${pc65.cyan("sms")} SMS infrastructure (AWS End User Messaging)`
42050
+ ` ${pc66.cyan("sms")} SMS infrastructure (AWS End User Messaging)`
41901
42051
  );
41902
42052
  console.log(
41903
- ` ${pc65.cyan("cdn")} CDN infrastructure (AWS S3 + CloudFront)`
42053
+ ` ${pc66.cyan("cdn")} CDN infrastructure (AWS S3 + CloudFront)`
41904
42054
  );
41905
42055
  console.log(
41906
- ` ${pc65.cyan("selfhost")} Self-hosted Wraps control plane (enterprise)`
42056
+ ` ${pc66.cyan("selfhost")} Self-hosted Wraps control plane (enterprise)`
41907
42057
  );
41908
42058
  console.log(
41909
- ` ${pc65.cyan("license")} License key management (Wraps team only)
42059
+ ` ${pc66.cyan("license")} License key management (Wraps team only)
41910
42060
  `
41911
42061
  );
41912
42062
  console.log("Email Commands:");
41913
42063
  console.log(
41914
- ` ${pc65.cyan("email init")} Deploy new email infrastructure`
42064
+ ` ${pc66.cyan("email init")} Deploy new email infrastructure`
41915
42065
  );
41916
42066
  console.log(
41917
- ` ${pc65.cyan("email check")} Check email deliverability for a domain`
42067
+ ` ${pc66.cyan("email check")} Check email deliverability for a domain`
41918
42068
  );
41919
42069
  console.log(
41920
- ` ${pc65.cyan("email connect")} Connect to existing AWS SES`
42070
+ ` ${pc66.cyan("email connect")} Connect to existing AWS SES`
41921
42071
  );
41922
42072
  console.log(
41923
- ` ${pc65.cyan("email status")} Show email infrastructure details`
42073
+ ` ${pc66.cyan("email status")} Show email infrastructure details`
41924
42074
  );
41925
- console.log(` ${pc65.cyan("email test")} Send a test email`);
41926
- console.log(` ${pc65.cyan("email verify")} Verify domain DNS records`);
42075
+ console.log(` ${pc66.cyan("email test")} Send a test email`);
42076
+ console.log(` ${pc66.cyan("email verify")} Verify domain DNS records`);
41927
42077
  console.log(
41928
- ` ${pc65.cyan("email sync")} Apply CLI updates to infrastructure`
42078
+ ` ${pc66.cyan("email sync")} Apply CLI updates to infrastructure`
41929
42079
  );
41930
- console.log(` ${pc65.cyan("email upgrade")} Add features`);
42080
+ console.log(` ${pc66.cyan("email upgrade")} Add features`);
41931
42081
  console.log(
41932
- ` ${pc65.cyan("email restore")} Restore original configuration`
42082
+ ` ${pc66.cyan("email restore")} Restore original configuration`
41933
42083
  );
41934
42084
  console.log(
41935
- ` ${pc65.cyan("email destroy")} Remove email infrastructure`
42085
+ ` ${pc66.cyan("email destroy")} Remove email infrastructure`
41936
42086
  );
41937
42087
  console.log(
41938
- ` ${pc65.cyan("email doctor")} Diagnose and clean up email infrastructure`
42088
+ ` ${pc66.cyan("email doctor")} Diagnose and clean up email infrastructure`
41939
42089
  );
41940
- console.log(` ${pc65.cyan("email domains add")} Add a domain to SES`);
41941
- console.log(` ${pc65.cyan("email domains list")} List all domains`);
41942
- console.log(` ${pc65.cyan("email domains remove")} Remove a domain`);
42090
+ console.log(` ${pc66.cyan("email domains add")} Add a domain to SES`);
42091
+ console.log(` ${pc66.cyan("email domains list")} List all domains`);
42092
+ console.log(` ${pc66.cyan("email domains remove")} Remove a domain`);
41943
42093
  console.log(
41944
- ` ${pc65.cyan("email inbound init")} Enable inbound email receiving`
42094
+ ` ${pc66.cyan("email inbound init")} Enable inbound email receiving`
41945
42095
  );
41946
- console.log(` ${pc65.cyan("email inbound status")} Show inbound email status`);
42096
+ console.log(` ${pc66.cyan("email inbound status")} Show inbound email status`);
41947
42097
  console.log(
41948
- ` ${pc65.cyan("email inbound verify")} Verify inbound DNS records`
42098
+ ` ${pc66.cyan("email inbound verify")} Verify inbound DNS records`
41949
42099
  );
41950
42100
  console.log(
41951
- ` ${pc65.cyan("email inbound test")} Send test email and verify receipt`
42101
+ ` ${pc66.cyan("email inbound test")} Send test email and verify receipt`
41952
42102
  );
41953
42103
  console.log(
41954
- ` ${pc65.cyan("email inbound destroy")} Remove inbound email infrastructure
42104
+ ` ${pc66.cyan("email inbound destroy")} Remove inbound email infrastructure
41955
42105
  `
41956
42106
  );
41957
42107
  console.log("Template Commands:");
41958
42108
  console.log(
41959
- ` ${pc65.cyan("email templates init")} Initialize templates-as-code`
42109
+ ` ${pc66.cyan("email templates init")} Initialize templates-as-code`
41960
42110
  );
41961
42111
  console.log(
41962
- ` ${pc65.cyan("email templates push")} Push templates to SES + dashboard`
42112
+ ` ${pc66.cyan("email templates push")} Push templates to SES + dashboard`
41963
42113
  );
41964
42114
  console.log(
41965
- ` ${pc65.cyan("email templates preview")} Preview templates in browser`
42115
+ ` ${pc66.cyan("email templates preview")} Preview templates in browser`
41966
42116
  );
41967
42117
  console.log(
41968
- ` ${pc65.cyan("push")} ${pc65.dim("(alias for email templates push)")}
42118
+ ` ${pc66.cyan("push")} ${pc66.dim("(alias for email templates push)")}
41969
42119
  `
41970
42120
  );
41971
42121
  console.log("Workflow Commands:");
41972
42122
  console.log(
41973
- ` ${pc65.cyan("email workflows init")} Initialize workflows-as-code`
42123
+ ` ${pc66.cyan("email workflows init")} Initialize workflows-as-code`
41974
42124
  );
41975
42125
  console.log(
41976
- ` ${pc65.cyan("email workflows validate")} Validate workflow files`
42126
+ ` ${pc66.cyan("email workflows validate")} Validate workflow files`
41977
42127
  );
41978
42128
  console.log(
41979
- ` ${pc65.cyan("email workflows push")} Push workflows to dashboard
42129
+ ` ${pc66.cyan("email workflows push")} Push workflows to dashboard
41980
42130
  `
41981
42131
  );
41982
42132
  console.log("SMS Commands:");
41983
- console.log(` ${pc65.cyan("sms init")} Deploy SMS infrastructure`);
42133
+ console.log(` ${pc66.cyan("sms init")} Deploy SMS infrastructure`);
41984
42134
  console.log(
41985
- ` ${pc65.cyan("sms status")} Show SMS infrastructure details`
42135
+ ` ${pc66.cyan("sms status")} Show SMS infrastructure details`
41986
42136
  );
41987
- console.log(` ${pc65.cyan("sms test")} Send a test SMS message`);
42137
+ console.log(` ${pc66.cyan("sms test")} Send a test SMS message`);
41988
42138
  console.log(
41989
- ` ${pc65.cyan("sms verify-number")} Verify a destination phone number`
42139
+ ` ${pc66.cyan("sms verify-number")} Verify a destination phone number`
41990
42140
  );
41991
42141
  console.log(
41992
- ` ${pc65.cyan("sms sync")} Sync infrastructure (update Lambda, etc.)`
42142
+ ` ${pc66.cyan("sms sync")} Sync infrastructure (update Lambda, etc.)`
41993
42143
  );
41994
- console.log(` ${pc65.cyan("sms upgrade")} Upgrade SMS features`);
41995
- console.log(` ${pc65.cyan("sms register")} Register toll-free number`);
42144
+ console.log(` ${pc66.cyan("sms upgrade")} Upgrade SMS features`);
42145
+ console.log(` ${pc66.cyan("sms register")} Register toll-free number`);
41996
42146
  console.log(
41997
- ` ${pc65.cyan("sms destroy")} Remove SMS infrastructure
42147
+ ` ${pc66.cyan("sms destroy")} Remove SMS infrastructure
41998
42148
  `
41999
42149
  );
42000
42150
  console.log("CDN Commands:");
42001
42151
  console.log(
42002
- ` ${pc65.cyan("cdn init")} Deploy CDN infrastructure (S3 + CloudFront)`
42152
+ ` ${pc66.cyan("cdn init")} Deploy CDN infrastructure (S3 + CloudFront)`
42003
42153
  );
42004
42154
  console.log(
42005
- ` ${pc65.cyan("cdn status")} Show CDN infrastructure details`
42155
+ ` ${pc66.cyan("cdn status")} Show CDN infrastructure details`
42006
42156
  );
42007
42157
  console.log(
42008
- ` ${pc65.cyan("cdn verify")} Check DNS and certificate status`
42158
+ ` ${pc66.cyan("cdn verify")} Check DNS and certificate status`
42009
42159
  );
42010
42160
  console.log(
42011
- ` ${pc65.cyan("cdn upgrade")} Add custom domain after cert validation`
42161
+ ` ${pc66.cyan("cdn upgrade")} Add custom domain after cert validation`
42012
42162
  );
42013
42163
  console.log(
42014
- ` ${pc65.cyan("cdn sync")} Sync infrastructure with current config`
42164
+ ` ${pc66.cyan("cdn sync")} Sync infrastructure with current config`
42015
42165
  );
42016
42166
  console.log(
42017
- ` ${pc65.cyan("cdn destroy")} Remove CDN infrastructure
42167
+ ` ${pc66.cyan("cdn destroy")} Remove CDN infrastructure
42018
42168
  `
42019
42169
  );
42020
42170
  console.log("Self-Hosted Commands:");
42021
42171
  console.log(
42022
- ` ${pc65.cyan("selfhost deploy")} Deploy Wraps API to your AWS account`
42172
+ ` ${pc66.cyan("selfhost deploy")} Deploy Wraps API to your AWS account`
42173
+ );
42174
+ console.log(
42175
+ ` ${pc66.cyan("selfhost login")} Sign in to your self-hosted Wraps instance`
42023
42176
  );
42024
42177
  console.log(
42025
- ` ${pc65.cyan("selfhost upgrade")} Rebuild and redeploy the self-hosted API`
42178
+ ` ${pc66.cyan("selfhost upgrade")} Rebuild and redeploy the self-hosted API`
42026
42179
  );
42027
42180
  console.log(
42028
- ` ${pc65.cyan("selfhost status")} Show self-hosted deployment details
42181
+ ` ${pc66.cyan("selfhost status")} Show self-hosted deployment details
42029
42182
  `
42030
42183
  );
42031
42184
  console.log("Local Development:");
42032
42185
  console.log(
42033
- ` ${pc65.cyan("console")} Start local web console
42186
+ ` ${pc66.cyan("console")} Start local web console
42034
42187
  `
42035
42188
  );
42036
42189
  console.log("Platform:");
42037
42190
  console.log(
42038
- ` ${pc65.cyan("platform")} Show platform info and pricing`
42191
+ ` ${pc66.cyan("platform")} Show platform info and pricing`
42039
42192
  );
42040
42193
  console.log(
42041
- ` ${pc65.cyan("platform connect")} Connect to Wraps Platform (events + IAM)`
42194
+ ` ${pc66.cyan("platform connect")} Connect to Wraps Platform (events + IAM)`
42042
42195
  );
42043
42196
  console.log(
42044
- ` ${pc65.cyan("platform update-role")} Update platform IAM permissions
42197
+ ` ${pc66.cyan("platform update-role")} Update platform IAM permissions
42045
42198
  `
42046
42199
  );
42047
42200
  console.log("Auth:");
42048
42201
  console.log(
42049
- ` ${pc65.cyan("auth login")} Sign in to wraps.dev (device flow)`
42202
+ ` ${pc66.cyan("auth login")} Sign in to wraps.dev (device flow)`
42050
42203
  );
42051
- console.log(` ${pc65.cyan("auth status")} Show current auth state`);
42204
+ console.log(` ${pc66.cyan("auth status")} Show current auth state`);
42052
42205
  console.log(
42053
- ` ${pc65.cyan("auth logout")} Sign out and remove stored token
42206
+ ` ${pc66.cyan("auth logout")} Sign out and remove stored token
42054
42207
  `
42055
42208
  );
42056
42209
  console.log("AWS Setup:");
42057
42210
  console.log(
42058
- ` ${pc65.cyan("aws setup")} Interactive AWS setup wizard`
42211
+ ` ${pc66.cyan("aws setup")} Interactive AWS setup wizard`
42059
42212
  );
42060
42213
  console.log(
42061
- ` ${pc65.cyan("aws doctor")} Diagnose AWS configuration issues
42214
+ ` ${pc66.cyan("aws doctor")} Diagnose AWS configuration issues
42062
42215
  `
42063
42216
  );
42064
42217
  console.log("Global Commands:");
42065
- console.log(` ${pc65.cyan("status")} Show overview of all services`);
42066
- console.log(` ${pc65.cyan("destroy")} Remove deployed infrastructure`);
42067
- console.log(` ${pc65.cyan("permissions")} Show required AWS IAM permissions`);
42068
- console.log(` ${pc65.cyan("completion")} Generate shell completion script`);
42218
+ console.log(` ${pc66.cyan("status")} Show overview of all services`);
42219
+ console.log(` ${pc66.cyan("destroy")} Remove deployed infrastructure`);
42220
+ console.log(` ${pc66.cyan("permissions")} Show required AWS IAM permissions`);
42221
+ console.log(` ${pc66.cyan("completion")} Generate shell completion script`);
42069
42222
  console.log(
42070
- ` ${pc65.cyan("telemetry")} Manage anonymous telemetry settings`
42223
+ ` ${pc66.cyan("telemetry")} Manage anonymous telemetry settings`
42071
42224
  );
42072
- console.log(` ${pc65.cyan("update")} Update CLI to latest version`);
42073
- console.log(` ${pc65.cyan("news")} Show recent Wraps updates`);
42225
+ console.log(` ${pc66.cyan("update")} Update CLI to latest version`);
42226
+ console.log(` ${pc66.cyan("news")} Show recent Wraps updates`);
42074
42227
  console.log(
42075
- ` ${pc65.cyan("support")} Get help and support contact info
42228
+ ` ${pc66.cyan("support")} Get help and support contact info
42076
42229
  `
42077
42230
  );
42078
42231
  console.log("Options:");
42079
42232
  console.log(
42080
- ` ${pc65.dim("-p, --provider")} Hosting provider (vercel, aws, railway, other)`
42081
- );
42082
- console.log(` ${pc65.dim("-r, --region")} AWS region`);
42083
- console.log(` ${pc65.dim("-d, --domain")} Domain name`);
42084
- console.log(` ${pc65.dim("--account")} AWS account ID or alias`);
42085
- console.log(` ${pc65.dim("--preset")} Configuration preset`);
42086
- console.log(` ${pc65.dim("--token")} API key or token for auth`);
42087
- console.log(` ${pc65.dim("-y, --yes")} Skip confirmation prompts`);
42088
- console.log(` ${pc65.dim("-f, --force")} Force destructive operations`);
42233
+ ` ${pc66.dim("-p, --provider")} Hosting provider (vercel, aws, railway, other)`
42234
+ );
42235
+ console.log(` ${pc66.dim("-r, --region")} AWS region`);
42236
+ console.log(` ${pc66.dim("-d, --domain")} Domain name`);
42237
+ console.log(` ${pc66.dim("--account")} AWS account ID or alias`);
42238
+ console.log(` ${pc66.dim("--preset")} Configuration preset`);
42239
+ console.log(` ${pc66.dim("--token")} API key or token for auth`);
42240
+ console.log(` ${pc66.dim("-y, --yes")} Skip confirmation prompts`);
42241
+ console.log(` ${pc66.dim("-f, --force")} Force destructive operations`);
42089
42242
  console.log(
42090
- ` ${pc65.dim("--preview")} Preview changes without deploying`
42243
+ ` ${pc66.dim("--preview")} Preview changes without deploying`
42091
42244
  );
42092
- console.log(` ${pc65.dim("-v, --version")} Show version number
42245
+ console.log(` ${pc66.dim("-v, --version")} Show version number
42093
42246
  `);
42094
42247
  console.log(
42095
- `Run ${pc65.cyan("wraps <service> <command> --help")} for more information.
42248
+ `Run ${pc66.cyan("wraps <service> <command> --help")} for more information.
42096
42249
  `
42097
42250
  );
42098
42251
  }
@@ -42114,27 +42267,27 @@ if (!primaryCommand) {
42114
42267
  const telemetry = getTelemetryClient();
42115
42268
  if (telemetry.shouldShowNotification()) {
42116
42269
  console.log();
42117
- clack61.log.info(pc65.bold("Anonymous Telemetry"));
42270
+ clack62.log.info(pc66.bold("Anonymous Telemetry"));
42118
42271
  console.log(
42119
- ` Wraps collects ${pc65.cyan("anonymous usage data")} to improve the CLI.`
42272
+ ` Wraps collects ${pc66.cyan("anonymous usage data")} to improve the CLI.`
42120
42273
  );
42121
42274
  console.log(
42122
- ` We ${pc65.bold("never")} collect: domains, AWS credentials, email content, or PII.`
42275
+ ` We ${pc66.bold("never")} collect: domains, AWS credentials, email content, or PII.`
42123
42276
  );
42124
42277
  console.log(
42125
- ` We ${pc65.bold("only")} collect: command names, success/failure, CLI version, OS.`
42278
+ ` We ${pc66.bold("only")} collect: command names, success/failure, CLI version, OS.`
42126
42279
  );
42127
42280
  console.log();
42128
- console.log(` Opt-out anytime: ${pc65.cyan("wraps telemetry disable")}`);
42129
- console.log(` Or set: ${pc65.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
42130
- console.log(` Learn more: ${pc65.cyan("https://wraps.dev/docs")}`);
42281
+ console.log(` Opt-out anytime: ${pc66.cyan("wraps telemetry disable")}`);
42282
+ console.log(` Or set: ${pc66.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
42283
+ console.log(` Learn more: ${pc66.cyan("https://wraps.dev/docs")}`);
42131
42284
  console.log();
42132
42285
  telemetry.markNotificationShown();
42133
42286
  }
42134
42287
  trackCommand("interactive:menu", { success: true, duration_ms: 0 });
42135
- clack61.intro(pc65.bold(`WRAPS CLI v${VERSION}`));
42288
+ clack62.intro(pc66.bold(`WRAPS CLI v${VERSION}`));
42136
42289
  console.log(" Deploy AWS infrastructure to your account.\n");
42137
- const action = await clack61.select({
42290
+ const action = await clack62.select({
42138
42291
  message: "What would you like to do?",
42139
42292
  options: [
42140
42293
  {
@@ -42184,13 +42337,13 @@ if (!primaryCommand) {
42184
42337
  }
42185
42338
  ]
42186
42339
  });
42187
- if (clack61.isCancel(action)) {
42340
+ if (clack62.isCancel(action)) {
42188
42341
  trackCommand("interactive:cancel", {
42189
42342
  success: true,
42190
42343
  duration_ms: Date.now() - startTime
42191
42344
  });
42192
42345
  await telemetry.shutdown();
42193
- clack61.cancel("Operation cancelled.");
42346
+ clack62.cancel("Operation cancelled.");
42194
42347
  process.exit(0);
42195
42348
  }
42196
42349
  trackCommand(`interactive:${action}`, {
@@ -42270,20 +42423,20 @@ async function run() {
42270
42423
  const telemetry = getTelemetryClient();
42271
42424
  if (telemetry.shouldShowNotification()) {
42272
42425
  console.log();
42273
- clack61.log.info(pc65.bold("Anonymous Telemetry"));
42426
+ clack62.log.info(pc66.bold("Anonymous Telemetry"));
42274
42427
  console.log(
42275
- ` Wraps collects ${pc65.cyan("anonymous usage data")} to improve the CLI.`
42428
+ ` Wraps collects ${pc66.cyan("anonymous usage data")} to improve the CLI.`
42276
42429
  );
42277
42430
  console.log(
42278
- ` We ${pc65.bold("never")} collect: domains, AWS credentials, email content, or PII.`
42431
+ ` We ${pc66.bold("never")} collect: domains, AWS credentials, email content, or PII.`
42279
42432
  );
42280
42433
  console.log(
42281
- ` We ${pc65.bold("only")} collect: command names, success/failure, CLI version, OS.`
42434
+ ` We ${pc66.bold("only")} collect: command names, success/failure, CLI version, OS.`
42282
42435
  );
42283
42436
  console.log();
42284
- console.log(` Opt-out anytime: ${pc65.cyan("wraps telemetry disable")}`);
42285
- console.log(` Or set: ${pc65.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
42286
- console.log(` Learn more: ${pc65.cyan("https://wraps.dev/docs")}`);
42437
+ console.log(` Opt-out anytime: ${pc66.cyan("wraps telemetry disable")}`);
42438
+ console.log(` Or set: ${pc66.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
42439
+ console.log(` Learn more: ${pc66.cyan("https://wraps.dev/docs")}`);
42287
42440
  console.log();
42288
42441
  telemetry.markNotificationShown();
42289
42442
  }
@@ -42367,10 +42520,10 @@ async function run() {
42367
42520
  break;
42368
42521
  case "verify": {
42369
42522
  if (!flags.domain) {
42370
- clack61.log.error("--domain flag is required");
42523
+ clack62.log.error("--domain flag is required");
42371
42524
  console.log(
42372
42525
  `
42373
- Usage: ${pc65.cyan("wraps email verify --domain yourapp.com")}
42526
+ Usage: ${pc66.cyan("wraps email verify --domain yourapp.com")}
42374
42527
  `
42375
42528
  );
42376
42529
  throw new Error("Missing required flag: --domain");
@@ -42442,12 +42595,12 @@ Usage: ${pc65.cyan("wraps email verify --domain yourapp.com")}
42442
42595
  });
42443
42596
  break;
42444
42597
  default:
42445
- clack61.log.error(
42598
+ clack62.log.error(
42446
42599
  `Unknown inbound command: ${inboundSubCommand || "(none)"}`
42447
42600
  );
42448
42601
  console.log(
42449
42602
  `
42450
- Available commands: ${pc65.cyan("init")}, ${pc65.cyan("destroy")}, ${pc65.cyan("status")}, ${pc65.cyan("verify")}, ${pc65.cyan("test")}, ${pc65.cyan("add")}, ${pc65.cyan("remove")}
42603
+ Available commands: ${pc66.cyan("init")}, ${pc66.cyan("destroy")}, ${pc66.cyan("status")}, ${pc66.cyan("verify")}, ${pc66.cyan("test")}, ${pc66.cyan("add")}, ${pc66.cyan("remove")}
42451
42604
  `
42452
42605
  );
42453
42606
  throw new Error(
@@ -42499,12 +42652,12 @@ Available commands: ${pc65.cyan("init")}, ${pc65.cyan("destroy")}, ${pc65.cyan("
42499
42652
  break;
42500
42653
  }
42501
42654
  default:
42502
- clack61.log.error(
42655
+ clack62.log.error(
42503
42656
  `Unknown reply command: ${replySubCommand || "(none)"}`
42504
42657
  );
42505
42658
  console.log(
42506
42659
  `
42507
- Available commands: ${pc65.cyan("init")}, ${pc65.cyan("rotate")}, ${pc65.cyan("status")}, ${pc65.cyan("destroy")}, ${pc65.cyan("decode")}
42660
+ Available commands: ${pc66.cyan("init")}, ${pc66.cyan("rotate")}, ${pc66.cyan("status")}, ${pc66.cyan("destroy")}, ${pc66.cyan("decode")}
42508
42661
  `
42509
42662
  );
42510
42663
  throw new Error(
@@ -42529,10 +42682,10 @@ Available commands: ${pc65.cyan("init")}, ${pc65.cyan("rotate")}, ${pc65.cyan("s
42529
42682
  break;
42530
42683
  case "verify": {
42531
42684
  if (!flags.domain) {
42532
- clack61.log.error("--domain flag is required");
42685
+ clack62.log.error("--domain flag is required");
42533
42686
  console.log(
42534
42687
  `
42535
- Usage: ${pc65.cyan("wraps email domains verify --domain yourapp.com")}
42688
+ Usage: ${pc66.cyan("wraps email domains verify --domain yourapp.com")}
42536
42689
  `
42537
42690
  );
42538
42691
  throw new Error("Missing required flag: --domain");
@@ -42542,10 +42695,10 @@ Usage: ${pc65.cyan("wraps email domains verify --domain yourapp.com")}
42542
42695
  }
42543
42696
  case "get-dkim": {
42544
42697
  if (!flags.domain) {
42545
- clack61.log.error("--domain flag is required");
42698
+ clack62.log.error("--domain flag is required");
42546
42699
  console.log(
42547
42700
  `
42548
- Usage: ${pc65.cyan("wraps email domains get-dkim --domain yourapp.com")}
42701
+ Usage: ${pc66.cyan("wraps email domains get-dkim --domain yourapp.com")}
42549
42702
  `
42550
42703
  );
42551
42704
  throw new Error("Missing required flag: --domain");
@@ -42555,10 +42708,10 @@ Usage: ${pc65.cyan("wraps email domains get-dkim --domain yourapp.com")}
42555
42708
  }
42556
42709
  case "remove": {
42557
42710
  if (!flags.domain) {
42558
- clack61.log.error("--domain flag is required");
42711
+ clack62.log.error("--domain flag is required");
42559
42712
  console.log(
42560
42713
  `
42561
- Usage: ${pc65.cyan("wraps email domains remove --domain yourapp.com --force")}
42714
+ Usage: ${pc66.cyan("wraps email domains remove --domain yourapp.com --force")}
42562
42715
  `
42563
42716
  );
42564
42717
  throw new Error("Missing required flag: --domain");
@@ -42588,12 +42741,12 @@ Usage: ${pc65.cyan("wraps email domains remove --domain yourapp.com --force")}
42588
42741
  break;
42589
42742
  }
42590
42743
  default:
42591
- clack61.log.error(
42744
+ clack62.log.error(
42592
42745
  `Unknown domains command: ${domainsSubCommand || "(none)"}`
42593
42746
  );
42594
42747
  console.log(
42595
42748
  `
42596
- Available commands: ${pc65.cyan("add")}, ${pc65.cyan("list")}, ${pc65.cyan("verify")}, ${pc65.cyan("get-dkim")}, ${pc65.cyan("remove")}, ${pc65.cyan("config")}
42749
+ Available commands: ${pc66.cyan("add")}, ${pc66.cyan("list")}, ${pc66.cyan("verify")}, ${pc66.cyan("get-dkim")}, ${pc66.cyan("remove")}, ${pc66.cyan("config")}
42597
42750
  `
42598
42751
  );
42599
42752
  throw new Error(
@@ -42635,12 +42788,12 @@ Available commands: ${pc65.cyan("add")}, ${pc65.cyan("list")}, ${pc65.cyan("veri
42635
42788
  });
42636
42789
  break;
42637
42790
  default:
42638
- clack61.log.error(
42791
+ clack62.log.error(
42639
42792
  `Unknown templates command: ${templatesSubCommand || "(none)"}`
42640
42793
  );
42641
42794
  console.log(
42642
42795
  `
42643
- Available commands: ${pc65.cyan("init")}, ${pc65.cyan("push")}, ${pc65.cyan("preview")}
42796
+ Available commands: ${pc66.cyan("init")}, ${pc66.cyan("push")}, ${pc66.cyan("preview")}
42644
42797
  `
42645
42798
  );
42646
42799
  throw new Error(
@@ -42679,12 +42832,12 @@ Available commands: ${pc65.cyan("init")}, ${pc65.cyan("push")}, ${pc65.cyan("pre
42679
42832
  });
42680
42833
  break;
42681
42834
  default:
42682
- clack61.log.error(
42835
+ clack62.log.error(
42683
42836
  `Unknown workflows command: ${workflowsSubCommand || "(none)"}`
42684
42837
  );
42685
42838
  console.log(
42686
42839
  `
42687
- Available commands: ${pc65.cyan("init")}, ${pc65.cyan("validate")}, ${pc65.cyan("push")}
42840
+ Available commands: ${pc66.cyan("init")}, ${pc66.cyan("validate")}, ${pc66.cyan("push")}
42688
42841
  `
42689
42842
  );
42690
42843
  throw new Error(
@@ -42709,10 +42862,10 @@ Available commands: ${pc65.cyan("init")}, ${pc65.cyan("validate")}, ${pc65.cyan(
42709
42862
  });
42710
42863
  break;
42711
42864
  default:
42712
- clack61.log.error(`Unknown email command: ${subCommand}`);
42865
+ clack62.log.error(`Unknown email command: ${subCommand}`);
42713
42866
  console.log(
42714
42867
  `
42715
- Run ${pc65.cyan("wraps --help")} for available commands.
42868
+ Run ${pc66.cyan("wraps --help")} for available commands.
42716
42869
  `
42717
42870
  );
42718
42871
  throw new Error(`Unknown email command: ${subCommand}`);
@@ -42737,10 +42890,10 @@ Run ${pc65.cyan("wraps --help")} for available commands.
42737
42890
  });
42738
42891
  break;
42739
42892
  default:
42740
- clack61.log.error(`Unknown license command: ${subCommand}`);
42893
+ clack62.log.error(`Unknown license command: ${subCommand}`);
42741
42894
  console.log(
42742
42895
  `
42743
- Run ${pc65.cyan("wraps --help")} for available commands.
42896
+ Run ${pc66.cyan("wraps --help")} for available commands.
42744
42897
  `
42745
42898
  );
42746
42899
  throw new Error(`Unknown license command: ${subCommand}`);
@@ -42787,11 +42940,17 @@ Run ${pc65.cyan("wraps --help")} for available commands.
42787
42940
  json: flags.json
42788
42941
  });
42789
42942
  break;
42943
+ case "login":
42944
+ await selfhostLogin({
42945
+ region: flags.region,
42946
+ json: flags.json
42947
+ });
42948
+ break;
42790
42949
  default:
42791
- clack61.log.error(`Unknown selfhost command: ${subCommand}`);
42950
+ clack62.log.error(`Unknown selfhost command: ${subCommand}`);
42792
42951
  console.log(
42793
42952
  `
42794
- Run ${pc65.cyan("wraps --help")} for available commands.
42953
+ Run ${pc66.cyan("wraps --help")} for available commands.
42795
42954
  `
42796
42955
  );
42797
42956
  throw new Error(`Unknown selfhost command: ${subCommand}`);
@@ -42871,10 +43030,10 @@ Run ${pc65.cyan("wraps --help")} for available commands.
42871
43030
  });
42872
43031
  break;
42873
43032
  default:
42874
- clack61.log.error(`Unknown sms command: ${subCommand}`);
43033
+ clack62.log.error(`Unknown sms command: ${subCommand}`);
42875
43034
  console.log(
42876
43035
  `
42877
- Run ${pc65.cyan("wraps --help")} for available commands.
43036
+ Run ${pc66.cyan("wraps --help")} for available commands.
42878
43037
  `
42879
43038
  );
42880
43039
  throw new Error(`Unknown sms command: ${subCommand}`);
@@ -42935,10 +43094,10 @@ Run ${pc65.cyan("wraps --help")} for available commands.
42935
43094
  });
42936
43095
  break;
42937
43096
  default:
42938
- clack61.log.error(`Unknown cdn command: ${subCommand}`);
43097
+ clack62.log.error(`Unknown cdn command: ${subCommand}`);
42939
43098
  console.log(
42940
43099
  `
42941
- Run ${pc65.cyan("wraps --help")} for available commands.
43100
+ Run ${pc66.cyan("wraps --help")} for available commands.
42942
43101
  `
42943
43102
  );
42944
43103
  throw new Error(`Unknown cdn command: ${subCommand}`);
@@ -42960,13 +43119,13 @@ Run ${pc65.cyan("wraps --help")} for available commands.
42960
43119
  });
42961
43120
  break;
42962
43121
  default:
42963
- clack61.log.error(
43122
+ clack62.log.error(
42964
43123
  `Unknown workflow command: ${subCommand || "(none)"}`
42965
43124
  );
42966
43125
  console.log(`
42967
- Available commands: ${pc65.cyan("init")}
43126
+ Available commands: ${pc66.cyan("init")}
42968
43127
  `);
42969
- console.log(`Run ${pc65.cyan("wraps --help")} for more information.
43128
+ console.log(`Run ${pc66.cyan("wraps --help")} for more information.
42970
43129
  `);
42971
43130
  throw new Error(
42972
43131
  `Unknown workflow command: ${subCommand || "(none)"}`
@@ -43008,14 +43167,14 @@ Available commands: ${pc65.cyan("init")}
43008
43167
  });
43009
43168
  break;
43010
43169
  default:
43011
- clack61.log.error(`Unknown platform command: ${subCommand}`);
43170
+ clack62.log.error(`Unknown platform command: ${subCommand}`);
43012
43171
  console.log(
43013
43172
  `
43014
- Available commands: ${pc65.cyan("connect")}, ${pc65.cyan("update-role")}
43173
+ Available commands: ${pc66.cyan("connect")}, ${pc66.cyan("update-role")}
43015
43174
  `
43016
43175
  );
43017
43176
  console.log(
43018
- `Run ${pc65.cyan("wraps platform")} for more information.
43177
+ `Run ${pc66.cyan("wraps platform")} for more information.
43019
43178
  `
43020
43179
  );
43021
43180
  throw new Error(`Unknown platform command: ${subCommand}`);
@@ -43040,10 +43199,10 @@ Available commands: ${pc65.cyan("connect")}, ${pc65.cyan("update-role")}
43040
43199
  await logout();
43041
43200
  break;
43042
43201
  default:
43043
- clack61.log.error(`Unknown auth command: ${subCommand || "(none)"}`);
43202
+ clack62.log.error(`Unknown auth command: ${subCommand || "(none)"}`);
43044
43203
  console.log(
43045
43204
  `
43046
- Available commands: ${pc65.cyan("login")}, ${pc65.cyan("status")}, ${pc65.cyan("logout")}
43205
+ Available commands: ${pc66.cyan("login")}, ${pc66.cyan("status")}, ${pc66.cyan("logout")}
43047
43206
  `
43048
43207
  );
43049
43208
  throw new Error(`Unknown auth command: ${subCommand || "(none)"}`);
@@ -43061,13 +43220,13 @@ Available commands: ${pc65.cyan("login")}, ${pc65.cyan("status")}, ${pc65.cyan("
43061
43220
  await doctor();
43062
43221
  break;
43063
43222
  default:
43064
- clack61.log.error(`Unknown aws command: ${subCommand}`);
43223
+ clack62.log.error(`Unknown aws command: ${subCommand}`);
43065
43224
  console.log(
43066
43225
  `
43067
- Available commands: ${pc65.cyan("setup")}, ${pc65.cyan("doctor")}
43226
+ Available commands: ${pc66.cyan("setup")}, ${pc66.cyan("doctor")}
43068
43227
  `
43069
43228
  );
43070
- console.log(`Run ${pc65.cyan("wraps --help")} for more information.
43229
+ console.log(`Run ${pc66.cyan("wraps --help")} for more information.
43071
43230
  `);
43072
43231
  throw new Error(`Unknown aws command: ${subCommand}`);
43073
43232
  }
@@ -43148,10 +43307,10 @@ Available commands: ${pc65.cyan("setup")}, ${pc65.cyan("doctor")}
43148
43307
  await telemetryStatus();
43149
43308
  break;
43150
43309
  default:
43151
- clack61.log.error(`Unknown telemetry command: ${subCommand}`);
43310
+ clack62.log.error(`Unknown telemetry command: ${subCommand}`);
43152
43311
  console.log(
43153
43312
  `
43154
- Available commands: ${pc65.cyan("enable")}, ${pc65.cyan("disable")}, ${pc65.cyan("status")}
43313
+ Available commands: ${pc66.cyan("enable")}, ${pc66.cyan("disable")}, ${pc66.cyan("status")}
43155
43314
  `
43156
43315
  );
43157
43316
  throw new Error(`Unknown telemetry command: ${subCommand}`);
@@ -43175,10 +43334,10 @@ Please specify a command for ${primaryCommand} service.
43175
43334
  showHelp();
43176
43335
  break;
43177
43336
  default:
43178
- clack61.log.error(`Unknown command: ${primaryCommand}`);
43337
+ clack62.log.error(`Unknown command: ${primaryCommand}`);
43179
43338
  console.log(
43180
43339
  `
43181
- Run ${pc65.cyan("wraps --help")} for available commands.
43340
+ Run ${pc66.cyan("wraps --help")} for available commands.
43182
43341
  `
43183
43342
  );
43184
43343
  throw new Error(`Unknown command: ${primaryCommand}`);