@autohq/cli 0.1.178 → 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.
- package/dist/agent-bridge.js +1 -1
- package/dist/index.js +30 -5
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -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.
|
|
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.
|
|
21685
|
+
version: "0.1.180",
|
|
21686
21686
|
license: "SEE LICENSE IN README.md",
|
|
21687
21687
|
publishConfig: {
|
|
21688
21688
|
access: "public"
|
|
@@ -33138,7 +33138,7 @@ async function connectGithub(context, commandOptions) {
|
|
|
33138
33138
|
}
|
|
33139
33139
|
return;
|
|
33140
33140
|
}
|
|
33141
|
-
if (discovery.unavailableReason === "github_login_required") {
|
|
33141
|
+
if (discovery.unavailableReason === "github_login_required" && !commandOptions.quietGithubLoginRequiredDiscovery) {
|
|
33142
33142
|
context.writeOutput(
|
|
33143
33143
|
"Existing GitHub installations could not be discovered because this Auto user does not have a linked GitHub login."
|
|
33144
33144
|
);
|
|
@@ -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
|
-
|
|
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);
|
|
@@ -35870,6 +35872,7 @@ async function selectGithubConnection(context, project, options, apiBaseUrl) {
|
|
|
35870
35872
|
allow: project.projectId,
|
|
35871
35873
|
browser: options.browser,
|
|
35872
35874
|
openBrowser: options.openBrowser,
|
|
35875
|
+
quietGithubLoginRequiredDiscovery: true,
|
|
35873
35876
|
wait: true
|
|
35874
35877
|
});
|
|
35875
35878
|
return requireSingleConnection(context, "github", apiBaseUrl);
|
|
@@ -36029,6 +36032,13 @@ var SETUP_AUTO_LOGOS = [
|
|
|
36029
36032
|
function logoWidth(logo) {
|
|
36030
36033
|
return Math.max(...logo.map((line) => line.length));
|
|
36031
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
|
+
}
|
|
36032
36042
|
function bullet(style, text) {
|
|
36033
36043
|
return `${style.id(" -")} ${text}`;
|
|
36034
36044
|
}
|
|
@@ -36038,6 +36048,19 @@ function numbered(style, index, text) {
|
|
|
36038
36048
|
function indent(text, spaces) {
|
|
36039
36049
|
return `${" ".repeat(spaces)}${text}`;
|
|
36040
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
|
+
}
|
|
36041
36064
|
async function explainAndWait(context, input) {
|
|
36042
36065
|
context.writeOutput(context.io.style.heading(input.heading));
|
|
36043
36066
|
for (const line of input.body) {
|
|
@@ -36066,9 +36089,10 @@ async function pressEnter(context, prompt) {
|
|
|
36066
36089
|
stdin: context.stdin,
|
|
36067
36090
|
stdout: context.stdout
|
|
36068
36091
|
});
|
|
36092
|
+
const margin = wizardMargin(context.stdout.columns);
|
|
36069
36093
|
try {
|
|
36070
36094
|
await Promise.race([
|
|
36071
|
-
readline.question(context.io.style.dim(prompt)),
|
|
36095
|
+
readline.question(context.io.style.dim(indent(prompt, margin))),
|
|
36072
36096
|
new Promise((resolve3) => {
|
|
36073
36097
|
readline.once("close", resolve3);
|
|
36074
36098
|
})
|
|
@@ -36177,8 +36201,9 @@ async function askRequired(context, question) {
|
|
|
36177
36201
|
stdin: context.stdin,
|
|
36178
36202
|
stdout: context.stdout
|
|
36179
36203
|
});
|
|
36204
|
+
const margin = wizardMargin(context.stdout.columns);
|
|
36180
36205
|
try {
|
|
36181
|
-
const answer = (await readline.question(question)).trim();
|
|
36206
|
+
const answer = (await readline.question(indent(question, margin))).trim();
|
|
36182
36207
|
if (!answer) {
|
|
36183
36208
|
throw new Error("A non-empty answer is required.");
|
|
36184
36209
|
}
|