@wraps.dev/cli 2.25.0 → 2.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  > Deploy email, SMS, and CDN infrastructure to your AWS account.
4
4
 
5
+ **AI agents:** fetch [wraps.dev/llms-full.txt](https://wraps.dev/llms-full.txt) for the complete documentation in one file, or [wraps.dev/llms.txt](https://wraps.dev/llms.txt) for an agent-oriented index.
6
+
5
7
  ## What It Creates
6
8
 
7
9
  ### Email (`wraps email init`)
Binary file
package/dist/cli.js CHANGED
@@ -822,7 +822,7 @@ function pulumiErrorToWrapsError(code, iamAction, service, resourceName, resourc
822
822
  );
823
823
  }
824
824
  }
825
- var WrapsError, errors;
825
+ var WrapsError, CREDENTIAL_OPTIONS, errors;
826
826
  var init_errors = __esm({
827
827
  "src/utils/shared/errors.ts"() {
828
828
  "use strict";
@@ -838,11 +838,12 @@ var init_errors = __esm({
838
838
  this.name = "WrapsError";
839
839
  }
840
840
  };
841
+ CREDENTIAL_OPTIONS = "Wraps couldn't find working AWS credentials. Any of these work:\n\nAWS SSO:\n aws configure sso\n aws sso login\n\nIAM access keys:\n aws configure\n\nEnvironment variables:\n export AWS_ACCESS_KEY_ID=<your-key>\n export AWS_SECRET_ACCESS_KEY=<your-secret>\n\nExisting profile:\n export AWS_PROFILE=<profile-name>";
841
842
  errors = {
842
843
  noAWSCredentials: () => new WrapsError(
843
844
  "AWS credentials not found",
844
845
  "NO_AWS_CREDENTIALS",
845
- "Run: aws configure\nOr set AWS_PROFILE environment variable",
846
+ CREDENTIAL_OPTIONS,
846
847
  "https://wraps.dev/docs/guides/aws-setup"
847
848
  ),
848
849
  stackExists: (stackName) => new WrapsError(
@@ -966,7 +967,7 @@ Or configure a new profile:
966
967
  credentialsFileMissing: () => new WrapsError(
967
968
  "AWS credentials file not found",
968
969
  "CREDENTIALS_FILE_MISSING",
969
- "Configure AWS credentials:\n aws configure\n\nOr set environment variables:\n export AWS_ACCESS_KEY_ID=<your-key>\n export AWS_SECRET_ACCESS_KEY=<your-secret>",
970
+ CREDENTIAL_OPTIONS,
970
971
  "https://wraps.dev/docs/guides/aws-setup/permissions"
971
972
  ),
972
973
  accessKeyInvalid: () => new WrapsError(
@@ -1191,22 +1192,27 @@ async function validateAWSCredentials() {
1191
1192
  async function validateAWSCredentialsWithDetails() {
1192
1193
  const state = await detectAWSState();
1193
1194
  const warnings = [];
1194
- if (state.sso.configured && state.sso.tokenStatus?.expired) {
1195
- const profile = state.sso.activeProfile?.name;
1196
- throw errors.ssoSessionExpired(profile);
1197
- }
1198
- if (state.sso.configured && state.sso.tokenStatus?.valid && state.sso.tokenStatus.minutesRemaining !== null && state.sso.tokenStatus.minutesRemaining < 15) {
1199
- const minutes = state.sso.tokenStatus.minutesRemaining;
1200
- const loginCmd = getSSOLoginCommand(state.sso.activeProfile?.name);
1201
- warnings.push(
1202
- `SSO session expires in ${minutes} minute${minutes !== 1 ? "s" : ""}. Run "${loginCmd}" to refresh.`
1203
- );
1204
- }
1205
- const currentProfile = getCurrentProfile();
1206
- if (currentProfile && currentProfile !== "default") {
1207
- const availableProfiles = getConfiguredProfiles();
1208
- if (!availableProfiles.includes(currentProfile)) {
1209
- throw errors.profileNotFound(currentProfile, availableProfiles);
1195
+ const hasStaticEnvCredentials = Boolean(
1196
+ process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY
1197
+ );
1198
+ if (!hasStaticEnvCredentials) {
1199
+ if (state.sso.configured && state.sso.tokenStatus?.expired) {
1200
+ const profile = state.sso.activeProfile?.name;
1201
+ throw errors.ssoSessionExpired(profile);
1202
+ }
1203
+ if (state.sso.configured && state.sso.tokenStatus?.valid && state.sso.tokenStatus.minutesRemaining !== null && state.sso.tokenStatus.minutesRemaining < 15) {
1204
+ const minutes = state.sso.tokenStatus.minutesRemaining;
1205
+ const loginCmd = getSSOLoginCommand(state.sso.activeProfile?.name);
1206
+ warnings.push(
1207
+ `SSO session expires in ${minutes} minute${minutes !== 1 ? "s" : ""}. Run "${loginCmd}" to refresh.`
1208
+ );
1209
+ }
1210
+ const currentProfile = getCurrentProfile();
1211
+ if (currentProfile && currentProfile !== "default") {
1212
+ const availableProfiles = getConfiguredProfiles();
1213
+ if (!availableProfiles.includes(currentProfile)) {
1214
+ throw errors.profileNotFound(currentProfile, availableProfiles);
1215
+ }
1210
1216
  }
1211
1217
  }
1212
1218
  const sts = new STSClient2({ region: "us-east-1" });
@@ -13020,6 +13026,11 @@ async function init(options) {
13020
13026
  );
13021
13027
  }
13022
13028
  const progress = new DeploymentProgress();
13029
+ const identity = await progress.execute(
13030
+ "Validating AWS credentials",
13031
+ async () => validateAWSCredentials()
13032
+ );
13033
+ progress.info(`Connected to AWS account: ${pc12.cyan(identity.accountId)}`);
13023
13034
  const wasAutoInstalled = await progress.execute(
13024
13035
  "Checking Pulumi CLI installation",
13025
13036
  async () => await ensurePulumiInstalled()
@@ -13027,11 +13038,6 @@ async function init(options) {
13027
13038
  if (wasAutoInstalled) {
13028
13039
  progress.info("Pulumi CLI was automatically installed");
13029
13040
  }
13030
- const identity = await progress.execute(
13031
- "Validating AWS credentials",
13032
- async () => validateAWSCredentials()
13033
- );
13034
- progress.info(`Connected to AWS account: ${pc12.cyan(identity.accountId)}`);
13035
13041
  let provider = options.provider;
13036
13042
  if (!provider) {
13037
13043
  provider = await promptProvider();
@@ -24088,13 +24094,6 @@ async function init2(options) {
24088
24094
  );
24089
24095
  }
24090
24096
  const progress = new DeploymentProgress();
24091
- const wasAutoInstalled = await progress.execute(
24092
- "Checking Pulumi CLI installation",
24093
- async () => await ensurePulumiInstalled()
24094
- );
24095
- if (wasAutoInstalled) {
24096
- progress.info("Pulumi CLI was automatically installed");
24097
- }
24098
24097
  const credentialResult = await progress.execute(
24099
24098
  "Validating AWS credentials",
24100
24099
  async () => validateAWSCredentialsWithDetails()
@@ -24109,6 +24108,13 @@ async function init2(options) {
24109
24108
  `Using credentials from: ${pc29.dim(credentialResult.credentialSource)}`
24110
24109
  );
24111
24110
  }
24111
+ const wasAutoInstalled = await progress.execute(
24112
+ "Checking Pulumi CLI installation",
24113
+ async () => await ensurePulumiInstalled()
24114
+ );
24115
+ if (wasAutoInstalled) {
24116
+ progress.info("Pulumi CLI was automatically installed");
24117
+ }
24112
24118
  let provider = options.provider;
24113
24119
  if (!provider) {
24114
24120
  provider = options.quick ? "other" : await promptProvider();
@@ -40213,6 +40219,11 @@ async function init3(options) {
40213
40219
  clack55.intro(pc58.bold("Wraps SMS Infrastructure Setup"));
40214
40220
  }
40215
40221
  const progress = new DeploymentProgress();
40222
+ const identity = await progress.execute(
40223
+ "Validating AWS credentials",
40224
+ async () => validateAWSCredentials()
40225
+ );
40226
+ progress.info(`Connected to AWS account: ${pc58.cyan(identity.accountId)}`);
40216
40227
  const wasAutoInstalled = await progress.execute(
40217
40228
  "Checking Pulumi CLI installation",
40218
40229
  async () => await ensurePulumiInstalled()
@@ -40220,11 +40231,6 @@ async function init3(options) {
40220
40231
  if (wasAutoInstalled) {
40221
40232
  progress.info("Pulumi CLI was automatically installed");
40222
40233
  }
40223
- const identity = await progress.execute(
40224
- "Validating AWS credentials",
40225
- async () => validateAWSCredentials()
40226
- );
40227
- progress.info(`Connected to AWS account: ${pc58.cyan(identity.accountId)}`);
40228
40234
  const provider = options.provider || await promptProvider();
40229
40235
  const region = options.region || await promptRegion(await getAWSRegion());
40230
40236
  let vercelConfig;
@@ -42757,6 +42763,9 @@ async function support() {
42757
42763
  ` ${pc65.bold("GitHub:")} ${pc65.cyan("https://github.com/wraps-dev/wraps/issues")}`
42758
42764
  );
42759
42765
  console.log(` ${pc65.bold("Docs:")} ${pc65.cyan("https://wraps.dev/docs")}`);
42766
+ console.log(
42767
+ ` ${pc65.bold("AI docs:")} ${pc65.cyan("https://wraps.dev/llms-full.txt")} ${pc65.dim("(complete docs, one file)")}`
42768
+ );
42760
42769
  console.log();
42761
42770
  console.log(pc65.dim(" Response time: Usually within 24 hours"));
42762
42771
  console.log();
@@ -43408,7 +43417,10 @@ function showHelp() {
43408
43417
  console.log(` ${pc69.dim("-v, --version")} Show version number
43409
43418
  `);
43410
43419
  console.log(
43411
- `Run ${pc69.cyan("wraps <service> <command> --help")} for more information.
43420
+ `Run ${pc69.cyan("wraps <service> <command> --help")} for more information.`
43421
+ );
43422
+ console.log(
43423
+ `AI agents: complete docs at ${pc69.cyan("https://wraps.dev/llms-full.txt")}
43412
43424
  `
43413
43425
  );
43414
43426
  }