@autohq/cli 0.1.179 → 0.1.180

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.
@@ -26572,7 +26572,7 @@ Object.assign(lookup, {
26572
26572
  // package.json
26573
26573
  var package_default = {
26574
26574
  name: "@autohq/cli",
26575
- version: "0.1.179",
26575
+ version: "0.1.180",
26576
26576
  license: "SEE LICENSE IN README.md",
26577
26577
  publishConfig: {
26578
26578
  access: "public"
package/dist/index.js CHANGED
@@ -21682,7 +21682,7 @@ var init_package = __esm({
21682
21682
  "package.json"() {
21683
21683
  package_default = {
21684
21684
  name: "@autohq/cli",
21685
- version: "0.1.179",
21685
+ version: "0.1.180",
21686
21686
  license: "SEE LICENSE IN README.md",
21687
21687
  publishConfig: {
21688
21688
  access: "public"
@@ -35673,7 +35673,9 @@ init_login();
35673
35673
  var SETUP_STATUS_POLL_INTERVAL_MS = 5e3;
35674
35674
  var SETUP_STATUS_HINT_EVERY_POLLS = 12;
35675
35675
  var SETUP_STATUS_MAX_CONSECUTIVE_ERRORS = 12;
35676
- async function setupAction(context, options) {
35676
+ var WIZARD_MARGIN = 2;
35677
+ async function setupAction(rawContext, options) {
35678
+ const context = withWizardMargin(rawContext);
35677
35679
  const apiBaseUrl = apiUrlFromOptions(context, options);
35678
35680
  const client = createContextApiClient(context);
35679
35681
  await showPitchAndWait(context);
@@ -36030,6 +36032,13 @@ var SETUP_AUTO_LOGOS = [
36030
36032
  function logoWidth(logo) {
36031
36033
  return Math.max(...logo.map((line) => line.length));
36032
36034
  }
36035
+ function wizardMargin(columns) {
36036
+ if (columns === void 0) {
36037
+ return 0;
36038
+ }
36039
+ const largestLogoWidth = logoWidth(SETUP_AUTO_LOGOS[0]);
36040
+ return largestLogoWidth + WIZARD_MARGIN <= columns ? WIZARD_MARGIN : 0;
36041
+ }
36033
36042
  function bullet(style, text) {
36034
36043
  return `${style.id(" -")} ${text}`;
36035
36044
  }
@@ -36039,6 +36048,19 @@ function numbered(style, index, text) {
36039
36048
  function indent(text, spaces) {
36040
36049
  return `${" ".repeat(spaces)}${text}`;
36041
36050
  }
36051
+ function withWizardMargin(context) {
36052
+ const margin = wizardMargin(context.stdout.columns);
36053
+ if (margin === 0) {
36054
+ return context;
36055
+ }
36056
+ return {
36057
+ ...context,
36058
+ writeOutput: (message) => context.writeOutput(indentBlock(message, margin))
36059
+ };
36060
+ }
36061
+ function indentBlock(text, spaces) {
36062
+ return text.split("\n").map((line) => line.length === 0 ? line : indent(line, spaces)).join("\n");
36063
+ }
36042
36064
  async function explainAndWait(context, input) {
36043
36065
  context.writeOutput(context.io.style.heading(input.heading));
36044
36066
  for (const line of input.body) {
@@ -36067,9 +36089,10 @@ async function pressEnter(context, prompt) {
36067
36089
  stdin: context.stdin,
36068
36090
  stdout: context.stdout
36069
36091
  });
36092
+ const margin = wizardMargin(context.stdout.columns);
36070
36093
  try {
36071
36094
  await Promise.race([
36072
- readline.question(context.io.style.dim(prompt)),
36095
+ readline.question(context.io.style.dim(indent(prompt, margin))),
36073
36096
  new Promise((resolve3) => {
36074
36097
  readline.once("close", resolve3);
36075
36098
  })
@@ -36178,8 +36201,9 @@ async function askRequired(context, question) {
36178
36201
  stdin: context.stdin,
36179
36202
  stdout: context.stdout
36180
36203
  });
36204
+ const margin = wizardMargin(context.stdout.columns);
36181
36205
  try {
36182
- const answer = (await readline.question(question)).trim();
36206
+ const answer = (await readline.question(indent(question, margin))).trim();
36183
36207
  if (!answer) {
36184
36208
  throw new Error("A non-empty answer is required.");
36185
36209
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.179",
3
+ "version": "0.1.180",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"