@autohq/cli 0.1.175 → 0.1.176
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 +155 -38
- 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.176",
|
|
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.176",
|
|
21686
21686
|
license: "SEE LICENSE IN README.md",
|
|
21687
21687
|
publishConfig: {
|
|
21688
21688
|
access: "public"
|
|
@@ -24884,10 +24884,10 @@ function token(t, width = 80) {
|
|
|
24884
24884
|
case "list": {
|
|
24885
24885
|
const list = t;
|
|
24886
24886
|
return `${list.items.map((item) => {
|
|
24887
|
-
const
|
|
24887
|
+
const bullet2 = list.ordered ? chalk.dim(" 1.") : chalk.dim(" \u2022");
|
|
24888
24888
|
const text = inline(item.text);
|
|
24889
24889
|
const nested = item.tokens.filter((st) => st.type !== "text").map((st) => token(st, width)).join("");
|
|
24890
|
-
return `${
|
|
24890
|
+
return `${bullet2} ${text}${nested ? `
|
|
24891
24891
|
${nested}` : ""}`;
|
|
24892
24892
|
}).join("\n")}
|
|
24893
24893
|
`;
|
|
@@ -27461,9 +27461,9 @@ function YamlLine({ line }) {
|
|
|
27461
27461
|
if (!match) {
|
|
27462
27462
|
return /* @__PURE__ */ jsx13(Text13, { children: /* @__PURE__ */ jsx13(Text13, { dimColor: true, children: line }) });
|
|
27463
27463
|
}
|
|
27464
|
-
const [,
|
|
27464
|
+
const [, indent2, key, rest] = match;
|
|
27465
27465
|
return /* @__PURE__ */ jsxs11(Text13, { children: [
|
|
27466
|
-
/* @__PURE__ */ jsx13(Text13, { children:
|
|
27466
|
+
/* @__PURE__ */ jsx13(Text13, { children: indent2 }),
|
|
27467
27467
|
/* @__PURE__ */ jsx13(Text13, { color: "cyan", children: key }),
|
|
27468
27468
|
/* @__PURE__ */ jsx13(YamlValue, { value: rest })
|
|
27469
27469
|
] });
|
|
@@ -35591,6 +35591,7 @@ function registerSessionCommands(program, context) {
|
|
|
35591
35591
|
// src/commands/setup/actions.ts
|
|
35592
35592
|
init_browser();
|
|
35593
35593
|
init_file();
|
|
35594
|
+
init_style();
|
|
35594
35595
|
init_login();
|
|
35595
35596
|
var SETUP_STATUS_POLL_INTERVAL_MS = 5e3;
|
|
35596
35597
|
var SETUP_STATUS_HINT_EVERY_POLLS = 12;
|
|
@@ -35635,6 +35636,15 @@ async function setupAction(context, options) {
|
|
|
35635
35636
|
context.writeOutput("");
|
|
35636
35637
|
context.writeOutput(`Opened PR #${response.pullRequest.number}.`);
|
|
35637
35638
|
if (response.pullRequest.url) {
|
|
35639
|
+
await explainBrowserStep(context, {
|
|
35640
|
+
browser: options.browser,
|
|
35641
|
+
heading: "Review the onboarding PR",
|
|
35642
|
+
body: [
|
|
35643
|
+
"Auto will open the pull request it just created.",
|
|
35644
|
+
"Reviewing and merging this PR adds the onboarding agent to `.auto/`; GitHub Sync applies it after merge."
|
|
35645
|
+
],
|
|
35646
|
+
prompt: "Press Enter to open the PR."
|
|
35647
|
+
});
|
|
35638
35648
|
if (options.browser !== false) {
|
|
35639
35649
|
(options.openBrowser ?? openBrowser)(response.pullRequest.url);
|
|
35640
35650
|
}
|
|
@@ -35658,19 +35668,11 @@ async function setupAction(context, options) {
|
|
|
35658
35668
|
context.writeOutput("Tag `@auto.onboarding` in Slack to begin.");
|
|
35659
35669
|
}
|
|
35660
35670
|
async function showPitchAndWait(context) {
|
|
35661
|
-
context.writeOutput(setupPitchText());
|
|
35671
|
+
context.writeOutput(setupPitchText(context.io.style));
|
|
35662
35672
|
if (!context.io.canPrompt()) {
|
|
35663
35673
|
throw new Error("`auto setup` requires an interactive terminal.");
|
|
35664
35674
|
}
|
|
35665
|
-
|
|
35666
|
-
stdin: context.stdin,
|
|
35667
|
-
stdout: context.stdout
|
|
35668
|
-
});
|
|
35669
|
-
try {
|
|
35670
|
-
await readline.question("Press Enter to continue with setup.");
|
|
35671
|
-
} finally {
|
|
35672
|
-
readline.close();
|
|
35673
|
-
}
|
|
35675
|
+
await pressEnter(context, "Press Enter to continue with setup.");
|
|
35674
35676
|
}
|
|
35675
35677
|
async function ensureAuthenticated(context, options, apiBaseUrl) {
|
|
35676
35678
|
const config2 = readConfig(context.configPath);
|
|
@@ -35738,7 +35740,9 @@ async function createInitialProject(context, apiBaseUrl) {
|
|
|
35738
35740
|
const client = createContextApiClient(context);
|
|
35739
35741
|
const organizations = (await client.listOrganizations({ apiBaseUrl })).organizations;
|
|
35740
35742
|
if (organizations.length === 0) {
|
|
35743
|
+
writeOrganizationExplainer(context);
|
|
35741
35744
|
const organizationName = await askRequired(context, "Organization name: ");
|
|
35745
|
+
writeProjectExplainer(context);
|
|
35742
35746
|
const projectName2 = await askRequired(context, "Project name: ");
|
|
35743
35747
|
const created2 = await client.createOrganization({
|
|
35744
35748
|
organizationName,
|
|
@@ -35760,6 +35764,7 @@ async function createInitialProject(context, apiBaseUrl) {
|
|
|
35760
35764
|
render: organizationLabel
|
|
35761
35765
|
});
|
|
35762
35766
|
setActiveOrganization(context, organization.organizationId);
|
|
35767
|
+
writeProjectExplainer(context);
|
|
35763
35768
|
const projectName = await askRequired(context, "Project name: ");
|
|
35764
35769
|
const created = await client.createProject({ projectName, apiBaseUrl });
|
|
35765
35770
|
setActiveProject(context, {
|
|
@@ -35772,13 +35777,20 @@ async function selectGithubConnection(context, project, options, apiBaseUrl) {
|
|
|
35772
35777
|
const existing = await activeConnections(context, "github", apiBaseUrl);
|
|
35773
35778
|
if (existing.length === 0) {
|
|
35774
35779
|
context.writeOutput("");
|
|
35775
|
-
context
|
|
35776
|
-
|
|
35777
|
-
|
|
35780
|
+
await explainBrowserStep(context, {
|
|
35781
|
+
browser: options.browser,
|
|
35782
|
+
heading: "Connect GitHub",
|
|
35783
|
+
body: [
|
|
35784
|
+
"Auto will open GitHub so you can install or authorize the GitHub App.",
|
|
35785
|
+
"This lets Auto open the onboarding PR and, after you merge it, deploy `.auto/` resources from the repository."
|
|
35786
|
+
],
|
|
35787
|
+
prompt: "Press Enter to open GitHub."
|
|
35788
|
+
});
|
|
35778
35789
|
await connectProviderAction(context, "github", {
|
|
35779
35790
|
apiBaseUrl,
|
|
35780
35791
|
allow: project.projectId,
|
|
35781
35792
|
browser: options.browser,
|
|
35793
|
+
openBrowser: options.openBrowser,
|
|
35782
35794
|
wait: true
|
|
35783
35795
|
});
|
|
35784
35796
|
return requireSingleConnection(context, "github", apiBaseUrl);
|
|
@@ -35795,13 +35807,20 @@ async function selectSlackConnection(context, project, options, apiBaseUrl) {
|
|
|
35795
35807
|
const existing = await activeConnections(context, "slack", apiBaseUrl);
|
|
35796
35808
|
if (existing.length === 0) {
|
|
35797
35809
|
context.writeOutput("");
|
|
35798
|
-
context
|
|
35799
|
-
|
|
35800
|
-
|
|
35810
|
+
await explainBrowserStep(context, {
|
|
35811
|
+
browser: options.browser,
|
|
35812
|
+
heading: "Connect Slack",
|
|
35813
|
+
body: [
|
|
35814
|
+
"Auto will open Slack OAuth so the onboarding agent can talk to you in your workspace.",
|
|
35815
|
+
"After the setup PR is merged and applied, you will tag `@auto.onboarding` there to begin."
|
|
35816
|
+
],
|
|
35817
|
+
prompt: "Press Enter to open Slack."
|
|
35818
|
+
});
|
|
35801
35819
|
await connectProviderAction(context, "slack", {
|
|
35802
35820
|
apiBaseUrl,
|
|
35803
35821
|
allow: project.projectId,
|
|
35804
35822
|
browser: options.browser,
|
|
35823
|
+
openBrowser: options.openBrowser,
|
|
35805
35824
|
wait: true
|
|
35806
35825
|
});
|
|
35807
35826
|
return requireSingleConnection(context, "slack", apiBaseUrl);
|
|
@@ -35840,33 +35859,131 @@ async function selectRepository(context, github, explicitRepo) {
|
|
|
35840
35859
|
"GitHub repository to install Auto in (owner/repo): "
|
|
35841
35860
|
);
|
|
35842
35861
|
}
|
|
35843
|
-
function setupPitchText() {
|
|
35862
|
+
function setupPitchText(style = plainStyle) {
|
|
35844
35863
|
return [
|
|
35845
|
-
|
|
35864
|
+
...autoLogo(style),
|
|
35846
35865
|
"",
|
|
35847
|
-
|
|
35866
|
+
style.heading(
|
|
35867
|
+
"auto lets you program software factories the same way you program CI/CD."
|
|
35868
|
+
),
|
|
35848
35869
|
"",
|
|
35849
|
-
|
|
35850
|
-
|
|
35851
|
-
|
|
35852
|
-
|
|
35870
|
+
indent(
|
|
35871
|
+
"Compose agents and triggers into workflows using simple YAML files, and deploy them into the cloud on merge.",
|
|
35872
|
+
2
|
|
35873
|
+
),
|
|
35853
35874
|
"",
|
|
35854
|
-
"
|
|
35855
|
-
"
|
|
35856
|
-
"
|
|
35857
|
-
"
|
|
35858
|
-
"- More ideas we have not dreamed up yet",
|
|
35875
|
+
style.label("Simple workflows you can build with auto:"),
|
|
35876
|
+
bullet(style, "Ticket / feedback triage and resolution"),
|
|
35877
|
+
bullet(style, "Automated incident / bug response"),
|
|
35878
|
+
bullet(style, "Custom tailored code review agents"),
|
|
35859
35879
|
"",
|
|
35860
|
-
"
|
|
35861
|
-
"
|
|
35862
|
-
"
|
|
35880
|
+
style.label("Frontier workflows auto can help you explore:"),
|
|
35881
|
+
bullet(style, "Organized fleets of agents on long-horizon tasks"),
|
|
35882
|
+
bullet(style, "Multi-agent autoresearch / optimization loops"),
|
|
35883
|
+
bullet(style, "Agentic BDR and outbound lead engines"),
|
|
35884
|
+
bullet(style, "More ideas we have not dreamed up yet"),
|
|
35863
35885
|
"",
|
|
35864
|
-
"
|
|
35886
|
+
style.label("Before you continue, have two things ready:"),
|
|
35887
|
+
numbered(
|
|
35888
|
+
style,
|
|
35889
|
+
1,
|
|
35890
|
+
"A GitHub repository where Auto can add a `.auto/` directory."
|
|
35891
|
+
),
|
|
35892
|
+
numbered(
|
|
35893
|
+
style,
|
|
35894
|
+
2,
|
|
35895
|
+
"A Slack workspace where Auto can install its Slack connection."
|
|
35896
|
+
),
|
|
35865
35897
|
"",
|
|
35866
|
-
|
|
35898
|
+
indent(
|
|
35899
|
+
"If you do not already have a repo and Slack workspace ready to go, create them before continuing.",
|
|
35900
|
+
2
|
|
35901
|
+
),
|
|
35902
|
+
"",
|
|
35903
|
+
style.dim(
|
|
35904
|
+
"Auto is in early alpha, and you are one of the very first users. If anything feels confusing, breaks, or sparks an idea, please tell us. That feedback directly shapes the product."
|
|
35905
|
+
),
|
|
35867
35906
|
""
|
|
35868
35907
|
].join("\n");
|
|
35869
35908
|
}
|
|
35909
|
+
function autoLogo(style) {
|
|
35910
|
+
return [
|
|
35911
|
+
style.id(" _ "),
|
|
35912
|
+
style.id(" __ _ _ _| |_ ___ "),
|
|
35913
|
+
style.id(" / _` | | | | __/ _ \\ "),
|
|
35914
|
+
style.id("| (_| | |_| | || (_) |"),
|
|
35915
|
+
style.id(" \\__,_|\\__,_|\\__\\___/ ")
|
|
35916
|
+
];
|
|
35917
|
+
}
|
|
35918
|
+
function bullet(style, text) {
|
|
35919
|
+
return `${style.id(" -")} ${text}`;
|
|
35920
|
+
}
|
|
35921
|
+
function numbered(style, index, text) {
|
|
35922
|
+
return `${style.id(` ${index}.`)} ${text}`;
|
|
35923
|
+
}
|
|
35924
|
+
function indent(text, spaces) {
|
|
35925
|
+
return `${" ".repeat(spaces)}${text}`;
|
|
35926
|
+
}
|
|
35927
|
+
async function explainAndWait(context, input) {
|
|
35928
|
+
context.writeOutput(context.io.style.heading(input.heading));
|
|
35929
|
+
for (const line of input.body) {
|
|
35930
|
+
context.writeOutput(indent(line, 2));
|
|
35931
|
+
}
|
|
35932
|
+
await pressEnter(context, input.prompt);
|
|
35933
|
+
}
|
|
35934
|
+
async function explainBrowserStep(context, input) {
|
|
35935
|
+
if (input.browser !== false) {
|
|
35936
|
+
await explainAndWait(context, input);
|
|
35937
|
+
return;
|
|
35938
|
+
}
|
|
35939
|
+
context.writeOutput(context.io.style.heading(input.heading));
|
|
35940
|
+
for (const line of input.body) {
|
|
35941
|
+
context.writeOutput(indent(line, 2));
|
|
35942
|
+
}
|
|
35943
|
+
}
|
|
35944
|
+
async function pressEnter(context, prompt) {
|
|
35945
|
+
if (!context.io.canPrompt()) {
|
|
35946
|
+
throw new Error("`auto setup` requires an interactive terminal.");
|
|
35947
|
+
}
|
|
35948
|
+
if (isReadableEnded(context.stdin)) {
|
|
35949
|
+
return;
|
|
35950
|
+
}
|
|
35951
|
+
const readline = createCliReadline({
|
|
35952
|
+
stdin: context.stdin,
|
|
35953
|
+
stdout: context.stdout
|
|
35954
|
+
});
|
|
35955
|
+
try {
|
|
35956
|
+
await Promise.race([
|
|
35957
|
+
readline.question(context.io.style.dim(prompt)),
|
|
35958
|
+
new Promise((resolve3) => {
|
|
35959
|
+
readline.once("close", resolve3);
|
|
35960
|
+
})
|
|
35961
|
+
]);
|
|
35962
|
+
} finally {
|
|
35963
|
+
readline.close();
|
|
35964
|
+
}
|
|
35965
|
+
}
|
|
35966
|
+
function isReadableEnded(stream) {
|
|
35967
|
+
return "readableEnded" in stream && stream.readableEnded === true;
|
|
35968
|
+
}
|
|
35969
|
+
function writeOrganizationExplainer(context) {
|
|
35970
|
+
context.writeOutput("");
|
|
35971
|
+
context.writeOutput(context.io.style.heading("Create your organization"));
|
|
35972
|
+
context.writeOutput(
|
|
35973
|
+
"An organization is the workspace for your team, projects, provider connections, and shared Auto resources."
|
|
35974
|
+
);
|
|
35975
|
+
context.writeOutput(
|
|
35976
|
+
"Enter an organization name. You can always change it later."
|
|
35977
|
+
);
|
|
35978
|
+
}
|
|
35979
|
+
function writeProjectExplainer(context) {
|
|
35980
|
+
context.writeOutput("");
|
|
35981
|
+
context.writeOutput(context.io.style.heading("Create your project"));
|
|
35982
|
+
context.writeOutput(
|
|
35983
|
+
"A project is where Auto stores this repository's agents, triggers, connections, sessions, and secrets."
|
|
35984
|
+
);
|
|
35985
|
+
context.writeOutput("Enter a project name. You can always change it later.");
|
|
35986
|
+
}
|
|
35870
35987
|
async function activeConnections(context, provider, apiBaseUrl) {
|
|
35871
35988
|
const response = await createContextApiClient(context).listConnections({
|
|
35872
35989
|
provider,
|