@autohq/cli 0.1.174 → 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.
@@ -21149,6 +21149,10 @@ var ConnectionsToolAuthSchema = external_exports.object({
21149
21149
  kind: external_exports.literal("connections"),
21150
21150
  connections: external_exports.array(ProviderConnectionReferenceSchema).min(1)
21151
21151
  });
21152
+ var ConnectionBackedToolSchema = ProviderConnectionReferenceSchema.extend({
21153
+ kind: external_exports.literal("connection"),
21154
+ description: external_exports.string().trim().min(1).optional()
21155
+ });
21152
21156
  var ToolAliasSchema = ResourceNameSchema.refine(
21153
21157
  (value2) => value2 !== "workspace",
21154
21158
  {
@@ -21227,6 +21231,7 @@ var GithubToolSchema = external_exports.object({
21227
21231
  });
21228
21232
  var ToolSpecSchema = external_exports.discriminatedUnion("kind", [
21229
21233
  RemoteMcpToolSchema,
21234
+ ConnectionBackedToolSchema,
21230
21235
  LocalToolSchema
21231
21236
  ]);
21232
21237
  var AgentToolConnectRequestSchema = external_exports.object({
@@ -21270,6 +21275,10 @@ var AgentToolConnectCompleteResponseSchema = external_exports.object({
21270
21275
  var InlineAgentToolSchema = RemoteMcpToolSchema.extend({
21271
21276
  disabled: external_exports.boolean().optional()
21272
21277
  }).or(
21278
+ ConnectionBackedToolSchema.extend({
21279
+ disabled: external_exports.boolean().optional()
21280
+ })
21281
+ ).or(
21273
21282
  LocalToolSchema.and(
21274
21283
  external_exports.object({
21275
21284
  disabled: external_exports.boolean().optional()
@@ -22385,7 +22394,7 @@ var SessionRecordSchema = external_exports.object({
22385
22394
  external_exports.object({
22386
22395
  source: external_exports.literal("inline"),
22387
22396
  alias: ToolAliasSchema,
22388
- spec: RemoteMcpToolSchema.or(LocalToolSchema).or(GithubToolSchema)
22397
+ spec: RemoteMcpToolSchema.or(ConnectionBackedToolSchema).or(LocalToolSchema).or(GithubToolSchema)
22389
22398
  })
22390
22399
  ),
22391
22400
  input: JsonValueSchema2,
@@ -26563,7 +26572,7 @@ Object.assign(lookup, {
26563
26572
  // package.json
26564
26573
  var package_default = {
26565
26574
  name: "@autohq/cli",
26566
- version: "0.1.174",
26575
+ version: "0.1.176",
26567
26576
  license: "SEE LICENSE IN README.md",
26568
26577
  publishConfig: {
26569
26578
  access: "public"
package/dist/index.js CHANGED
@@ -17766,7 +17766,7 @@ function remoteMcpToolSchema(input) {
17766
17766
  ]).default({ kind: "none" })
17767
17767
  });
17768
17768
  }
17769
- var REMOTE_MCP_TRANSPORTS, LOCAL_TOOL_IMPLEMENTATIONS, SecretReferenceSchema, NoToolAuthSchema, McpOAuthToolAuthSchema, ConnectionToolAuthSchema, ConnectionsToolAuthSchema, ToolAliasSchema, RemoteMcpToolSchema, LocalAutoToolSchema, LocalPingToolSchema, LocalChatToolSchema, LocalToolSchema, GithubToolSchema, ToolSpecSchema, AgentToolConnectRequestSchema, AgentToolConnectResponseSchema, AgentToolConnectCompleteResponseSchema, InlineAgentToolSchema, AgentToolRefSchema, AgentToolsSchema;
17769
+ var REMOTE_MCP_TRANSPORTS, LOCAL_TOOL_IMPLEMENTATIONS, SecretReferenceSchema, NoToolAuthSchema, McpOAuthToolAuthSchema, ConnectionToolAuthSchema, ConnectionsToolAuthSchema, ConnectionBackedToolSchema, ToolAliasSchema, RemoteMcpToolSchema, LocalAutoToolSchema, LocalPingToolSchema, LocalChatToolSchema, LocalToolSchema, GithubToolSchema, ToolSpecSchema, AgentToolConnectRequestSchema, AgentToolConnectResponseSchema, AgentToolConnectCompleteResponseSchema, InlineAgentToolSchema, AgentToolRefSchema, AgentToolsSchema;
17770
17770
  var init_tools = __esm({
17771
17771
  "../../packages/schemas/src/tools.ts"() {
17772
17772
  "use strict";
@@ -17794,6 +17794,10 @@ var init_tools = __esm({
17794
17794
  kind: external_exports.literal("connections"),
17795
17795
  connections: external_exports.array(ProviderConnectionReferenceSchema).min(1)
17796
17796
  });
17797
+ ConnectionBackedToolSchema = ProviderConnectionReferenceSchema.extend({
17798
+ kind: external_exports.literal("connection"),
17799
+ description: external_exports.string().trim().min(1).optional()
17800
+ });
17797
17801
  ToolAliasSchema = ResourceNameSchema.refine(
17798
17802
  (value) => value !== "workspace",
17799
17803
  {
@@ -17836,6 +17840,7 @@ var init_tools = __esm({
17836
17840
  });
17837
17841
  ToolSpecSchema = external_exports.discriminatedUnion("kind", [
17838
17842
  RemoteMcpToolSchema,
17843
+ ConnectionBackedToolSchema,
17839
17844
  LocalToolSchema
17840
17845
  ]);
17841
17846
  AgentToolConnectRequestSchema = external_exports.object({
@@ -17879,6 +17884,10 @@ var init_tools = __esm({
17879
17884
  InlineAgentToolSchema = RemoteMcpToolSchema.extend({
17880
17885
  disabled: external_exports.boolean().optional()
17881
17886
  }).or(
17887
+ ConnectionBackedToolSchema.extend({
17888
+ disabled: external_exports.boolean().optional()
17889
+ })
17890
+ ).or(
17882
17891
  LocalToolSchema.and(
17883
17892
  external_exports.object({
17884
17893
  disabled: external_exports.boolean().optional()
@@ -19160,7 +19169,7 @@ var init_sessions = __esm({
19160
19169
  external_exports.object({
19161
19170
  source: external_exports.literal("inline"),
19162
19171
  alias: ToolAliasSchema,
19163
- spec: RemoteMcpToolSchema.or(LocalToolSchema).or(GithubToolSchema)
19172
+ spec: RemoteMcpToolSchema.or(ConnectionBackedToolSchema).or(LocalToolSchema).or(GithubToolSchema)
19164
19173
  })
19165
19174
  ),
19166
19175
  input: JsonValueSchema,
@@ -21673,7 +21682,7 @@ var init_package = __esm({
21673
21682
  "package.json"() {
21674
21683
  package_default = {
21675
21684
  name: "@autohq/cli",
21676
- version: "0.1.174",
21685
+ version: "0.1.176",
21677
21686
  license: "SEE LICENSE IN README.md",
21678
21687
  publishConfig: {
21679
21688
  access: "public"
@@ -24875,10 +24884,10 @@ function token(t, width = 80) {
24875
24884
  case "list": {
24876
24885
  const list = t;
24877
24886
  return `${list.items.map((item) => {
24878
- const bullet = list.ordered ? chalk.dim(" 1.") : chalk.dim(" \u2022");
24887
+ const bullet2 = list.ordered ? chalk.dim(" 1.") : chalk.dim(" \u2022");
24879
24888
  const text = inline(item.text);
24880
24889
  const nested = item.tokens.filter((st) => st.type !== "text").map((st) => token(st, width)).join("");
24881
- return `${bullet} ${text}${nested ? `
24890
+ return `${bullet2} ${text}${nested ? `
24882
24891
  ${nested}` : ""}`;
24883
24892
  }).join("\n")}
24884
24893
  `;
@@ -27452,9 +27461,9 @@ function YamlLine({ line }) {
27452
27461
  if (!match) {
27453
27462
  return /* @__PURE__ */ jsx13(Text13, { children: /* @__PURE__ */ jsx13(Text13, { dimColor: true, children: line }) });
27454
27463
  }
27455
- const [, indent, key, rest] = match;
27464
+ const [, indent2, key, rest] = match;
27456
27465
  return /* @__PURE__ */ jsxs11(Text13, { children: [
27457
- /* @__PURE__ */ jsx13(Text13, { children: indent }),
27466
+ /* @__PURE__ */ jsx13(Text13, { children: indent2 }),
27458
27467
  /* @__PURE__ */ jsx13(Text13, { color: "cyan", children: key }),
27459
27468
  /* @__PURE__ */ jsx13(YamlValue, { value: rest })
27460
27469
  ] });
@@ -35582,6 +35591,7 @@ function registerSessionCommands(program, context) {
35582
35591
  // src/commands/setup/actions.ts
35583
35592
  init_browser();
35584
35593
  init_file();
35594
+ init_style();
35585
35595
  init_login();
35586
35596
  var SETUP_STATUS_POLL_INTERVAL_MS = 5e3;
35587
35597
  var SETUP_STATUS_HINT_EVERY_POLLS = 12;
@@ -35626,6 +35636,15 @@ async function setupAction(context, options) {
35626
35636
  context.writeOutput("");
35627
35637
  context.writeOutput(`Opened PR #${response.pullRequest.number}.`);
35628
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
+ });
35629
35648
  if (options.browser !== false) {
35630
35649
  (options.openBrowser ?? openBrowser)(response.pullRequest.url);
35631
35650
  }
@@ -35649,19 +35668,11 @@ async function setupAction(context, options) {
35649
35668
  context.writeOutput("Tag `@auto.onboarding` in Slack to begin.");
35650
35669
  }
35651
35670
  async function showPitchAndWait(context) {
35652
- context.writeOutput(setupPitchText());
35671
+ context.writeOutput(setupPitchText(context.io.style));
35653
35672
  if (!context.io.canPrompt()) {
35654
35673
  throw new Error("`auto setup` requires an interactive terminal.");
35655
35674
  }
35656
- const readline = createCliReadline({
35657
- stdin: context.stdin,
35658
- stdout: context.stdout
35659
- });
35660
- try {
35661
- await readline.question("Press Enter to continue with setup.");
35662
- } finally {
35663
- readline.close();
35664
- }
35675
+ await pressEnter(context, "Press Enter to continue with setup.");
35665
35676
  }
35666
35677
  async function ensureAuthenticated(context, options, apiBaseUrl) {
35667
35678
  const config2 = readConfig(context.configPath);
@@ -35729,7 +35740,9 @@ async function createInitialProject(context, apiBaseUrl) {
35729
35740
  const client = createContextApiClient(context);
35730
35741
  const organizations = (await client.listOrganizations({ apiBaseUrl })).organizations;
35731
35742
  if (organizations.length === 0) {
35743
+ writeOrganizationExplainer(context);
35732
35744
  const organizationName = await askRequired(context, "Organization name: ");
35745
+ writeProjectExplainer(context);
35733
35746
  const projectName2 = await askRequired(context, "Project name: ");
35734
35747
  const created2 = await client.createOrganization({
35735
35748
  organizationName,
@@ -35751,6 +35764,7 @@ async function createInitialProject(context, apiBaseUrl) {
35751
35764
  render: organizationLabel
35752
35765
  });
35753
35766
  setActiveOrganization(context, organization.organizationId);
35767
+ writeProjectExplainer(context);
35754
35768
  const projectName = await askRequired(context, "Project name: ");
35755
35769
  const created = await client.createProject({ projectName, apiBaseUrl });
35756
35770
  setActiveProject(context, {
@@ -35763,13 +35777,20 @@ async function selectGithubConnection(context, project, options, apiBaseUrl) {
35763
35777
  const existing = await activeConnections(context, "github", apiBaseUrl);
35764
35778
  if (existing.length === 0) {
35765
35779
  context.writeOutput("");
35766
- context.writeOutput(
35767
- "Next, connect GitHub. Heads-up: this opens your browser to install or authorize the GitHub App."
35768
- );
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
+ });
35769
35789
  await connectProviderAction(context, "github", {
35770
35790
  apiBaseUrl,
35771
35791
  allow: project.projectId,
35772
35792
  browser: options.browser,
35793
+ openBrowser: options.openBrowser,
35773
35794
  wait: true
35774
35795
  });
35775
35796
  return requireSingleConnection(context, "github", apiBaseUrl);
@@ -35786,13 +35807,20 @@ async function selectSlackConnection(context, project, options, apiBaseUrl) {
35786
35807
  const existing = await activeConnections(context, "slack", apiBaseUrl);
35787
35808
  if (existing.length === 0) {
35788
35809
  context.writeOutput("");
35789
- context.writeOutput(
35790
- "Now connect Slack. Heads-up: this opens your browser for Slack OAuth."
35791
- );
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
+ });
35792
35819
  await connectProviderAction(context, "slack", {
35793
35820
  apiBaseUrl,
35794
35821
  allow: project.projectId,
35795
35822
  browser: options.browser,
35823
+ openBrowser: options.openBrowser,
35796
35824
  wait: true
35797
35825
  });
35798
35826
  return requireSingleConnection(context, "slack", apiBaseUrl);
@@ -35831,33 +35859,131 @@ async function selectRepository(context, github, explicitRepo) {
35831
35859
  "GitHub repository to install Auto in (owner/repo): "
35832
35860
  );
35833
35861
  }
35834
- function setupPitchText() {
35862
+ function setupPitchText(style = plainStyle) {
35835
35863
  return [
35836
- "auto lets you program software factories the same way you program CI/CD.",
35864
+ ...autoLogo(style),
35865
+ "",
35866
+ style.heading(
35867
+ "auto lets you program software factories the same way you program CI/CD."
35868
+ ),
35837
35869
  "",
35838
- "Compose agents and triggers into workflows using simple YAML files, and deploy them into the cloud on merge.",
35870
+ indent(
35871
+ "Compose agents and triggers into workflows using simple YAML files, and deploy them into the cloud on merge.",
35872
+ 2
35873
+ ),
35839
35874
  "",
35840
- "Simple workflows you can build with auto:",
35841
- "- Ticket / feedback triage and resolution",
35842
- "- Automated incident / bug response",
35843
- "- Custom tailored code review agents",
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"),
35844
35879
  "",
35845
- "Frontier workflows auto can help you explore:",
35846
- "- Organized fleets of agents on long-horizon tasks",
35847
- "- Multi-agent autoresearch / optimization loops",
35848
- "- Agentic BDR and outbound lead engines",
35849
- "- More ideas we have not dreamed up yet",
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"),
35850
35885
  "",
35851
- "Before you continue, have two things ready:",
35852
- "1. A GitHub repository where Auto can add a `.auto/` directory.",
35853
- "2. A Slack workspace where Auto can install its Slack connection.",
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
+ ),
35854
35897
  "",
35855
- "If you do not already have a repo and Slack workspace ready to go, create them before continuing.",
35898
+ indent(
35899
+ "If you do not already have a repo and Slack workspace ready to go, create them before continuing.",
35900
+ 2
35901
+ ),
35856
35902
  "",
35857
- "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.",
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
+ ),
35858
35906
  ""
35859
35907
  ].join("\n");
35860
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
+ }
35861
35987
  async function activeConnections(context, provider, apiBaseUrl) {
35862
35988
  const response = await createContextApiClient(context).listConnections({
35863
35989
  provider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.174",
3
+ "version": "0.1.176",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"