@autohq/cli 0.1.139 → 0.1.141

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.
@@ -26268,7 +26268,7 @@ Object.assign(lookup, {
26268
26268
  // package.json
26269
26269
  var package_default = {
26270
26270
  name: "@autohq/cli",
26271
- version: "0.1.139",
26271
+ version: "0.1.141",
26272
26272
  license: "SEE LICENSE IN README.md",
26273
26273
  publishConfig: {
26274
26274
  access: "public"
package/dist/index.js CHANGED
@@ -21204,7 +21204,7 @@ var init_package = __esm({
21204
21204
  "package.json"() {
21205
21205
  package_default = {
21206
21206
  name: "@autohq/cli",
21207
- version: "0.1.139",
21207
+ version: "0.1.141",
21208
21208
  license: "SEE LICENSE IN README.md",
21209
21209
  publishConfig: {
21210
21210
  access: "public"
@@ -21456,21 +21456,9 @@ function readLocalAgentAuthoringStatuses(input) {
21456
21456
  input?.directory ?? join3(process.cwd(), ".auto"),
21457
21457
  "agents"
21458
21458
  );
21459
- let entries;
21460
- try {
21461
- entries = readdirSync2(agentsDirectory).filter(
21462
- (entry) => AGENT_FILE_EXTENSIONS.includes(
21463
- extname(
21464
- entry
21465
- ).toLowerCase()
21466
- )
21467
- ).sort((left, right) => left.localeCompare(right));
21468
- } catch {
21469
- return [];
21470
- }
21471
- return entries.map((entry) => {
21472
- const path2 = join3(agentsDirectory, entry);
21473
- const fallbackName = basename2(entry, extname(entry));
21459
+ const paths = agentAuthoringFiles(agentsDirectory);
21460
+ return paths.map((path2) => {
21461
+ const fallbackName = basename2(path2, extname(path2));
21474
21462
  try {
21475
21463
  const result = compileAgentFile(path2);
21476
21464
  return {
@@ -21495,14 +21483,32 @@ function readLocalAgentAuthoringStatuses(input) {
21495
21483
  }
21496
21484
  });
21497
21485
  }
21498
- function importedAgentAuthoringPaths(paths) {
21499
- const imported = /* @__PURE__ */ new Set();
21500
- for (const path2 of paths) {
21501
- for (const document of readDocuments(path2)) {
21502
- discoverImports(document, path2, [], imported);
21486
+ function validateAgentFragmentFile(path2) {
21487
+ validateAgentFragmentDocument(readSingleDocument(path2), path2, []);
21488
+ }
21489
+ function agentAuthoringFiles(directory) {
21490
+ let entries;
21491
+ try {
21492
+ entries = readdirSync2(directory, { withFileTypes: true });
21493
+ } catch {
21494
+ return [];
21495
+ }
21496
+ const files = [];
21497
+ for (const entry of entries) {
21498
+ const path2 = join3(directory, entry.name);
21499
+ if (entry.isDirectory()) {
21500
+ files.push(...agentAuthoringFiles(path2));
21501
+ continue;
21502
+ }
21503
+ if (entry.isFile() && AGENT_FILE_EXTENSIONS.includes(
21504
+ extname(
21505
+ entry.name
21506
+ ).toLowerCase()
21507
+ )) {
21508
+ files.push(path2);
21503
21509
  }
21504
21510
  }
21505
- return imported;
21511
+ return files.sort((left, right) => left.localeCompare(right));
21506
21512
  }
21507
21513
  function resolveAgentAuthoringPath(input) {
21508
21514
  const candidate = resolve(input.agent);
@@ -21523,27 +21529,6 @@ function resolveAgentAuthoringPath(input) {
21523
21529
  `Agent authoring file not found for "${input.agent}" under ${agentsDirectory}`
21524
21530
  );
21525
21531
  }
21526
- function discoverImports(document, path2, stack, imported) {
21527
- const resolvedPath = resolve(path2);
21528
- if (stack.includes(resolvedPath)) {
21529
- throw new Error(
21530
- `Agent import cycle detected: ${[...stack, resolvedPath].join(" -> ")}`
21531
- );
21532
- }
21533
- if (!isRecord(document)) {
21534
- return;
21535
- }
21536
- for (const importPath of importPaths(document)) {
21537
- const resolvedImport = resolveImportPath(importPath, resolvedPath);
21538
- imported.add(resolvedImport);
21539
- discoverImports(
21540
- readSingleDocument(resolvedImport),
21541
- resolvedImport,
21542
- [...stack, resolvedPath],
21543
- imported
21544
- );
21545
- }
21546
- }
21547
21532
  function compileAgentDocument(document, path2, stack, context) {
21548
21533
  const resolvedPath = resolve(path2);
21549
21534
  if (stack.includes(resolvedPath)) {
@@ -21583,6 +21568,29 @@ function compileAgentDocument(document, path2, stack, context) {
21583
21568
  []
21584
21569
  );
21585
21570
  }
21571
+ function validateAgentFragmentDocument(document, path2, stack) {
21572
+ const resolvedPath = resolve(path2);
21573
+ if (stack.includes(resolvedPath)) {
21574
+ throw new Error(
21575
+ `Agent import cycle detected: ${[...stack, resolvedPath].join(" -> ")}`
21576
+ );
21577
+ }
21578
+ if (!isRecord(document)) {
21579
+ throw new Error(`Invalid agent fragment file ${path2}: expected object`);
21580
+ }
21581
+ for (const imported of importPaths(document).map(
21582
+ (importPath) => resolveImportPath(importPath, resolvedPath)
21583
+ )) {
21584
+ validateAgentFragmentDocument(readSingleDocument(imported), imported, [
21585
+ ...stack,
21586
+ resolvedPath
21587
+ ]);
21588
+ }
21589
+ for (const removal of removalDirectives(document, resolvedPath)) {
21590
+ assertSupportedRemovalTarget(removal.target);
21591
+ }
21592
+ authoringDocumentApplyShape(document, resolvedPath);
21593
+ }
21586
21594
  function readSingleDocument(path2) {
21587
21595
  const documents = readDocuments(path2);
21588
21596
  if (documents.length !== 1) {
@@ -21594,7 +21602,12 @@ function readSingleDocument(path2) {
21594
21602
  }
21595
21603
  function readDocuments(path2) {
21596
21604
  const source = readFileSync3(path2, "utf8");
21597
- return parseYamlDocuments(source).filter((document) => document.contents !== null).map((document) => document.toJSON());
21605
+ const documents = parseYamlDocuments(source);
21606
+ const parseError = documents.flatMap((document) => document.errors).at(0);
21607
+ if (parseError) {
21608
+ throw new Error(parseError.message);
21609
+ }
21610
+ return documents.filter((document) => document.contents !== null).map((document) => document.toJSON());
21598
21611
  }
21599
21612
  function importPaths(document) {
21600
21613
  const value = document.imports ?? document.import;
@@ -21682,6 +21695,11 @@ function finalizeAgentApplyShape(document, path2) {
21682
21695
  spec.environment = environment.metadata.name;
21683
21696
  resources.push(environment);
21684
21697
  }
21698
+ if (isRecord(spec.identity)) {
21699
+ const identity2 = inlineIdentityResource(spec.identity, next, path2);
21700
+ spec.identity = identity2.metadata.name;
21701
+ resources.push(identity2);
21702
+ }
21685
21703
  if (Array.isArray(spec.triggers)) {
21686
21704
  spec.triggers = spec.triggers.map((trigger) => {
21687
21705
  if (!isRecord(trigger) || !("name" in trigger)) {
@@ -21719,6 +21737,34 @@ function inlineEnvironmentResource(document, path2) {
21719
21737
  spec: parsed.data.spec
21720
21738
  };
21721
21739
  }
21740
+ function inlineIdentityResource(document, agentDocument, path2) {
21741
+ const metadata = {};
21742
+ const spec = {};
21743
+ for (const [key, value] of Object.entries(document)) {
21744
+ if (value === void 0) {
21745
+ continue;
21746
+ }
21747
+ if (AGENT_METADATA_FIELDS.has(key)) {
21748
+ metadata[key] = value;
21749
+ continue;
21750
+ }
21751
+ spec[key] = value;
21752
+ }
21753
+ if (metadata.name === void 0 && isRecord(agentDocument.metadata) && typeof agentDocument.metadata.name === "string") {
21754
+ metadata.name = agentDocument.metadata.name;
21755
+ }
21756
+ const parsed = IdentityApplyRequestSchema.safeParse({ metadata, spec });
21757
+ if (!parsed.success) {
21758
+ throw new Error(
21759
+ `Invalid inline identity in ${path2}: ${parsed.error.message}`
21760
+ );
21761
+ }
21762
+ return {
21763
+ kind: RESOURCE_KIND_IDENTITY,
21764
+ metadata: parsed.data.metadata,
21765
+ spec: parsed.data.spec
21766
+ };
21767
+ }
21722
21768
  function assertNoDuplicateFacadeField(input) {
21723
21769
  if (input.targetValue !== void 0) {
21724
21770
  throw new Error(
@@ -21818,9 +21864,15 @@ function applyRemoval(value, removal) {
21818
21864
  return next;
21819
21865
  }
21820
21866
  default:
21821
- throw new Error(
21822
- `Unsupported agent remove target "${removal.target}"; supported targets are tools, triggers`
21823
- );
21867
+ assertSupportedRemovalTarget(removal.target);
21868
+ return next;
21869
+ }
21870
+ }
21871
+ function assertSupportedRemovalTarget(target) {
21872
+ if (target !== "tools" && target !== "triggers") {
21873
+ throw new Error(
21874
+ `Unsupported agent remove target "${target}"; supported targets are tools, triggers`
21875
+ );
21824
21876
  }
21825
21877
  }
21826
21878
  function mergeValues2(base, override, path2) {
@@ -21968,6 +22020,8 @@ function readProjectApplyRequest(options) {
21968
22020
  }
21969
22021
  const directory = options.directory ?? join4(process.cwd(), ".auto");
21970
22022
  assertNoLegacySessionFiles(directory);
22023
+ assertNoStandaloneResourceFiles(directory);
22024
+ assertValidFragmentFiles(directory);
21971
22025
  const files = applyFiles(directory);
21972
22026
  if (files.length === 0) {
21973
22027
  throw new Error(`No resource files found in ${directory}`);
@@ -21998,7 +22052,7 @@ function isAllowedDirectoryResourceKind(directoryKind, resource, generatedFromAg
21998
22052
  if (resource.kind === directoryKind) {
21999
22053
  return true;
22000
22054
  }
22001
- return directoryKind === RESOURCE_KIND_SESSION && resource.kind === RESOURCE_KIND_ENVIRONMENT && generatedFromAgent;
22055
+ return directoryKind === RESOURCE_KIND_SESSION && (resource.kind === RESOURCE_KIND_ENVIRONMENT || resource.kind === RESOURCE_KIND_IDENTITY) && generatedFromAgent;
22002
22056
  }
22003
22057
  function dedupeGeneratedResources(records) {
22004
22058
  const recordsByKey = /* @__PURE__ */ new Map();
@@ -22018,7 +22072,7 @@ function dedupeGeneratedResources(records) {
22018
22072
  }
22019
22073
  if (stableResource(resource) !== stableResource(existing.resource)) {
22020
22074
  throw new Error(
22021
- `Conflicting generated resource "${key}" from agent authoring. Inline environment definitions must be identical when they share a name.`
22075
+ `Conflicting generated resource "${key}" from agent authoring. Inline generated resources must be identical when they share a name.`
22022
22076
  );
22023
22077
  }
22024
22078
  }
@@ -22075,29 +22129,17 @@ function mcpOAuthSessionToolConnectionsFromAppliedResources(resources) {
22075
22129
  });
22076
22130
  }
22077
22131
  function applyFiles(root) {
22078
- const files = [];
22079
- for (const kind of PROJECT_APPLY_RESOURCE_KINDS) {
22080
- const kindFiles = [];
22081
- const path2 = join4(root, primaryApplyDirectory(kind));
22082
- let entries;
22083
- try {
22084
- entries = readdirSync3(path2, { withFileTypes: true });
22085
- } catch {
22086
- continue;
22087
- }
22088
- kindFiles.push(...resourceApplyFiles(path2, entries));
22089
- const importedFiles = kind === RESOURCE_KIND_SESSION ? importedAgentAuthoringPaths(kindFiles) : /* @__PURE__ */ new Set();
22090
- const appliedFiles = kind === RESOURCE_KIND_SESSION ? kindFiles.filter(
22091
- (path3) => !importedFiles.has(resolve2(path3)) && !isSharedAgentAuthoringFile(root, path3)
22092
- ) : kindFiles;
22093
- files.push(...appliedFiles.map((path3) => ({ kind, path: path3 })));
22132
+ const agentsRoot = join4(root, primaryApplyDirectory(RESOURCE_KIND_SESSION));
22133
+ let entries;
22134
+ try {
22135
+ entries = readdirSync3(agentsRoot, { withFileTypes: true });
22136
+ } catch {
22137
+ return [];
22094
22138
  }
22095
- return files;
22096
- }
22097
- function isSharedAgentAuthoringFile(root, path2) {
22098
- const agentsSharedRoot = resolve2(root, "agents", "shared");
22099
- const resolvedPath = resolve2(path2);
22100
- return resolvedPath.startsWith(`${agentsSharedRoot}/`);
22139
+ return resourceApplyFiles(agentsRoot, entries).map((path2) => ({
22140
+ kind: RESOURCE_KIND_SESSION,
22141
+ path: path2
22142
+ }));
22101
22143
  }
22102
22144
  function assertNoLegacySessionFiles(root) {
22103
22145
  const path2 = join4(root, "sessions");
@@ -22115,6 +22157,53 @@ function assertNoLegacySessionFiles(root) {
22115
22157
  `Legacy .auto/sessions files are no longer supported. Move ${files.length === 1 ? "this file" : "these files"} to .auto/agents and use the root-level Agent facade format: ${files.join(", ")}`
22116
22158
  );
22117
22159
  }
22160
+ function assertNoStandaloneResourceFiles(root) {
22161
+ for (const { directory, kind, guidance } of [
22162
+ {
22163
+ directory: "environments",
22164
+ kind: RESOURCE_KIND_ENVIRONMENT,
22165
+ guidance: "Define environments inline in .auto/agents YAML, using fragment imports under .auto/fragments/environments for reused runtimes."
22166
+ },
22167
+ {
22168
+ directory: "identities",
22169
+ kind: RESOURCE_KIND_IDENTITY,
22170
+ guidance: "Define identities inline on the owning .auto/agents YAML file."
22171
+ }
22172
+ ]) {
22173
+ const path2 = join4(root, directory);
22174
+ let entries;
22175
+ try {
22176
+ entries = readdirSync3(path2, { withFileTypes: true });
22177
+ } catch {
22178
+ continue;
22179
+ }
22180
+ const files = resourceApplyFiles(path2, entries);
22181
+ if (files.length === 0) {
22182
+ continue;
22183
+ }
22184
+ throw new Error(
22185
+ `Standalone .auto/${directory} ${kind} resources are no longer supported. ${guidance} Move ${files.length === 1 ? "this file" : "these files"}: ${files.join(", ")}`
22186
+ );
22187
+ }
22188
+ }
22189
+ function assertValidFragmentFiles(root) {
22190
+ const fragmentsRoot = join4(root, "fragments");
22191
+ let entries;
22192
+ try {
22193
+ entries = readdirSync3(fragmentsRoot, { withFileTypes: true });
22194
+ } catch {
22195
+ return;
22196
+ }
22197
+ for (const path2 of resourceApplyFiles(fragmentsRoot, entries)) {
22198
+ try {
22199
+ validateAgentFragmentFile(path2);
22200
+ } catch (error51) {
22201
+ throw new Error(
22202
+ `Invalid fragment file ${path2}: ${error51 instanceof Error ? error51.message : String(error51)}`
22203
+ );
22204
+ }
22205
+ }
22206
+ }
22118
22207
  function mcpOAuthSessionToolConnectionsFromSessionTools(input) {
22119
22208
  return Object.entries(input.tools).flatMap(([alias, tool]) => {
22120
22209
  if (tool.kind !== "mcp_remote" || tool.disabled || tool.auth.kind !== "mcp_oauth") {
@@ -22133,7 +22222,12 @@ function readApplyDocumentFile(path2) {
22133
22222
  const source = readFileSync4(path2, "utf8");
22134
22223
  let documents;
22135
22224
  try {
22136
- documents = parseYamlDocuments2(source).filter((document) => document.contents !== null).map((document) => document.toJSON());
22225
+ const parsedDocuments = parseYamlDocuments2(source);
22226
+ const parseError = parsedDocuments.flatMap((document) => document.errors).at(0);
22227
+ if (parseError) {
22228
+ throw parseError;
22229
+ }
22230
+ documents = parsedDocuments.filter((document) => document.contents !== null).map((document) => document.toJSON());
22137
22231
  } catch (error51) {
22138
22232
  throw new Error(
22139
22233
  `Invalid apply file: ${error51 instanceof Error ? error51.message : String(error51)}`
@@ -22146,6 +22240,7 @@ function readApplyDocumentFile(path2) {
22146
22240
  const system = ProjectApplySystemConfigSchema.safeParse(documents[0]);
22147
22241
  if (system.success) {
22148
22242
  const resources = system.data.spec.resources;
22243
+ assertNoExplicitStandaloneResources(resources, path2);
22149
22244
  return {
22150
22245
  ...system.data.spec,
22151
22246
  resourceRecords: resources.map((resource) => ({
@@ -22168,30 +22263,20 @@ function readApplyDocumentFile(path2) {
22168
22263
  };
22169
22264
  }
22170
22265
  function readApplyDocument(document, path2) {
22171
- const candidate = applyCandidate(document);
22172
- if (candidate.kind === RESOURCE_KIND_SESSION) {
22173
- const result = compileAgentDocumentValue(document, path2);
22174
- return result.resources.map((resource) => ({
22175
- resource,
22176
- generatedFromAgent: resource !== result.resource
22177
- }));
22178
- }
22179
- const parsed = APPLY_SCHEMAS[candidate.kind].safeParse(candidate.value);
22180
- if (!parsed.success) {
22181
- throw new Error(
22182
- `Invalid ${candidate.kind} resource: ${parsed.error.message}`
22183
- );
22184
- }
22185
- return [
22186
- {
22187
- resource: {
22188
- kind: candidate.kind,
22189
- metadata: parsed.data.metadata,
22190
- spec: parsed.data.spec
22191
- },
22192
- generatedFromAgent: false
22266
+ assertAgentAuthoringDocument(document, path2);
22267
+ const result = compileAgentDocumentValue(document, path2);
22268
+ return result.resources.map((resource) => ({
22269
+ resource,
22270
+ generatedFromAgent: resource !== result.resource
22271
+ }));
22272
+ }
22273
+ function assertNoExplicitStandaloneResources(resources, path2) {
22274
+ for (const resource of resources) {
22275
+ if (resource.kind !== RESOURCE_KIND_ENVIRONMENT && resource.kind !== RESOURCE_KIND_IDENTITY) {
22276
+ continue;
22193
22277
  }
22194
- ];
22278
+ throw standaloneResourceError(resource.kind, path2);
22279
+ }
22195
22280
  }
22196
22281
  function readApplyAssets(resources, projectRoot) {
22197
22282
  const assets = {};
@@ -22306,30 +22391,42 @@ function applyFileProjectRoot(file2) {
22306
22391
  function isInside(path2, parent) {
22307
22392
  return path2.startsWith(`${parent}/`);
22308
22393
  }
22309
- function applyCandidate(document) {
22394
+ function assertAgentAuthoringDocument(document, path2) {
22310
22395
  if (!isRecord2(document) || !("kind" in document)) {
22311
- return { kind: RESOURCE_KIND_SESSION, value: document };
22396
+ return;
22312
22397
  }
22313
22398
  if (document.kind === "session") {
22314
22399
  throw new Error(
22315
22400
  'Legacy resource kind "session" is no longer supported. Use .auto/agents with the root-level Agent facade format.'
22316
22401
  );
22317
22402
  }
22318
- if (!PROJECT_APPLY_RESOURCE_KINDS.includes(
22319
- document.kind
22320
- )) {
22403
+ if (document.kind === RESOURCE_KIND_ENVIRONMENT || document.kind === RESOURCE_KIND_IDENTITY) {
22404
+ throw standaloneResourceError(document.kind, path2);
22405
+ }
22406
+ if (document.kind !== RESOURCE_KIND_SESSION) {
22321
22407
  throw new Error(
22322
- `Unsupported apply resource kind "${String(document.kind)}"; supported kinds are ${PROJECT_APPLY_RESOURCE_KINDS.map((kind2) => `"${kind2}"`).join(", ")}`
22408
+ `Unsupported apply resource kind "${String(document.kind)}"; supported kind is "${RESOURCE_KIND_SESSION}"`
22323
22409
  );
22324
22410
  }
22325
- const kind = document.kind;
22326
- return {
22327
- kind,
22328
- value: {
22329
- metadata: document.metadata,
22330
- spec: document.spec
22331
- }
22332
- };
22411
+ const parsed = SessionApplyRequestSchema.safeParse({
22412
+ metadata: document.metadata,
22413
+ spec: document.spec
22414
+ });
22415
+ if (parsed.success) {
22416
+ throw new Error(
22417
+ `Legacy agent resource envelopes are no longer supported in ${path2}. Use the root-level Agent facade format under .auto/agents.`
22418
+ );
22419
+ }
22420
+ }
22421
+ function standaloneResourceError(kind, path2) {
22422
+ if (kind === RESOURCE_KIND_ENVIRONMENT) {
22423
+ return new Error(
22424
+ `Standalone environment resources are no longer supported in ${path2}. Define environments inline in .auto/agents YAML, using fragment imports under .auto/fragments/environments for reused runtimes.`
22425
+ );
22426
+ }
22427
+ return new Error(
22428
+ `Standalone identity resources are no longer supported in ${path2}. Define identities inline on the owning .auto/agents YAML file.`
22429
+ );
22333
22430
  }
22334
22431
  function primaryApplyDirectory(kind) {
22335
22432
  return APPLY_DIRECTORIES[kind];
@@ -22353,22 +22450,15 @@ function resourceApplyFiles(directory, entries) {
22353
22450
  }
22354
22451
  return files.sort((left, right) => left.localeCompare(right));
22355
22452
  }
22356
- var APPLY_DIRECTORIES, APPLY_SCHEMAS, ALLOWED_AVATAR_EXTENSIONS;
22453
+ var APPLY_DIRECTORIES, ALLOWED_AVATAR_EXTENSIONS;
22357
22454
  var init_files = __esm({
22358
22455
  "src/commands/apply/files.ts"() {
22359
22456
  "use strict";
22360
22457
  init_src();
22361
22458
  init_authoring();
22362
22459
  APPLY_DIRECTORIES = {
22363
- environment: "environments",
22364
- identity: "identities",
22365
22460
  agent: "agents"
22366
22461
  };
22367
- APPLY_SCHEMAS = {
22368
- environment: EnvironmentApplyRequestSchema,
22369
- identity: IdentityApplyRequestSchema,
22370
- [RESOURCE_KIND_SESSION]: SessionApplyRequestSchema
22371
- };
22372
22462
  ALLOWED_AVATAR_EXTENSIONS = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png"]);
22373
22463
  }
22374
22464
  });
@@ -22750,6 +22840,11 @@ import { join as join5 } from "path";
22750
22840
  import { parseAllDocuments as parseYamlDocuments3, stringify as stringify3 } from "yaml";
22751
22841
  async function editResource(input) {
22752
22842
  const reference = parseProjectResourceReference(input.resource);
22843
+ if (reference.kind !== RESOURCE_KIND_SESSION) {
22844
+ throw new Error(
22845
+ `Resource kind "${reference.kind}" can no longer be edited directly. Edit .auto/agents YAML instead; identities and environments are authored inline on agents.`
22846
+ );
22847
+ }
22753
22848
  const editor = resolveEditor({
22754
22849
  canFallbackToVi: input.canFallbackToVi,
22755
22850
  env: input.env,
@@ -26211,14 +26306,17 @@ function agentAuthoringHeaderLabel(status) {
26211
26306
  return `local ok, ${status.imports} imports, ${status.removals} removals`;
26212
26307
  }
26213
26308
  function editableResourceForSelection(input) {
26214
- if (!isApplyResourceSection(input.activeSection)) {
26215
- return null;
26216
- }
26309
+ if (input.activeSection !== "sessions") return null;
26310
+ const selected = input.selectedSession;
26311
+ return selected ? { kind: "agent", name: selected.metadata.name } : null;
26312
+ }
26313
+ function inspectableResourceForSelection(input) {
26314
+ if (!isApplyResourceSection(input.activeSection)) return null;
26217
26315
  const definition = PROJECT_RESOURCE_TUI_DEFINITIONS_BY_SECTION.get(
26218
26316
  input.activeSection
26219
26317
  );
26220
26318
  const selected = selectedNamedResourceForSection(input);
26221
- return definition && selected ? { kind: definition.kind, name: selected.metadata.name } : null;
26319
+ return definition && selected ? { kind: definition.kind, name: selected.metadata.name, spec: null } : null;
26222
26320
  }
26223
26321
  function HomeView({ apiUrl, notice, returnToSession }) {
26224
26322
  const client = useApiClient();
@@ -26383,32 +26481,32 @@ function HomeView({ apiUrl, notice, returnToSession }) {
26383
26481
  const selectedEnvironment = environments[environmentIndex];
26384
26482
  const selectedIdentity = identities[identityIndex];
26385
26483
  const selectedInspectableResource = useMemo3(() => {
26386
- const selectedEditable = editableResourceForSelection({
26484
+ const selectedInspectable = inspectableResourceForSelection({
26387
26485
  activeSection,
26388
26486
  selectedEnvironment,
26389
26487
  selectedIdentity,
26390
26488
  selectedSession
26391
26489
  });
26392
- if (!selectedEditable) {
26490
+ if (!selectedInspectable) {
26393
26491
  return null;
26394
26492
  }
26395
26493
  switch (activeSection) {
26396
26494
  case "sessions":
26397
26495
  return selectedSession ? {
26398
- kind: selectedEditable.kind,
26399
- name: selectedEditable.name,
26496
+ kind: selectedInspectable.kind,
26497
+ name: selectedInspectable.name,
26400
26498
  spec: selectedSession.spec
26401
26499
  } : null;
26402
26500
  case "environments":
26403
26501
  return selectedEnvironment ? {
26404
- kind: selectedEditable.kind,
26405
- name: selectedEditable.name,
26502
+ kind: selectedInspectable.kind,
26503
+ name: selectedInspectable.name,
26406
26504
  spec: selectedEnvironment.spec
26407
26505
  } : null;
26408
26506
  case "identities":
26409
26507
  return selectedIdentity ? {
26410
- kind: selectedEditable.kind,
26411
- name: selectedEditable.name,
26508
+ kind: selectedInspectable.kind,
26509
+ name: selectedInspectable.name,
26412
26510
  spec: selectedIdentity.spec
26413
26511
  } : null;
26414
26512
  default:
@@ -31666,7 +31764,7 @@ Docs and help: auto --help
31666
31764
  `;
31667
31765
 
31668
31766
  // src/commands/onboard/skill-content.generated.ts
31669
- var onboardingSkillMarkdown = "# Intent\n\nYou are onboarding a user onto auto. Achieve three goals, in roughly this order, as rapidly as the user's pace allows:\n\n1. **Educate** \u2014 teach the user what auto is and how it works, and get them genuinely excited about it.\n2. **Magic moment** \u2014 get a tailor-made, deployed, proactive workflow live that solves a *real* problem for them, and have them witness it working end to end.\n3. **Self-sufficiency** \u2014 leave them with the building blocks (mental model, CI/CD, a self-improvement loop) to iterate on their auto system rapidly and safely on their own.\n\n# Background\n\n**What is auto?**\n\nauto lets you program software factories the same way you program CI/CD.\n\nCompose agents and triggers into workflows using simple YAML files, and deploy them into the cloud on merge.\n\nYou can use auto to build simple (but effective) automations:\n\n- Ticket / feedback triage and resolution\n- Automated incident / bug response\n- Custom tailored code review agents\n\nYou can also use auto to push the frontier of agentic labor:\n\n- Organized fleets of agents on long-horizon tasks\n- Multi-agent autoresearch / optimization loops\n- Agentic BDR and outbound lead engines\n- \u221E more ideas we've yet to dream up\n\nAnything that can be described in a standard operating procedure can be translated into a \"chart\" of agents and triggers in auto \u2014 the only limit is your imagination.\n\n# Reference material\n\nThis skill ships with documentation and worked examples. Read them before you onboard anyone; cite and copy from them as you go.\n\n| Path | What it covers |\n| --- | --- |\n| `docs/index.md` | The mental model: resources, events, triggers, runs. Start here. |\n| `docs/resource-model.md` | The `.auto/` directory, resource envelopes, and `auto apply` semantics. |\n| `docs/sessions-and-triggers.md` | Agents, the trigger/event/routing vocabulary, filters, and PR checks. |\n| `docs/environments-and-profiles.md` | Sandbox images, setup steps and caching, and reusable agent profiles. |\n| `docs/tools-and-connections.md` | MCP tools, chat tools, provider connections, secrets, and the runtime tool surface agents see. |\n| `docs/cli.md` | The `auto` CLI command reference. |\n| `docs/ci-cd.md` | Service accounts and GitHub Actions for apply-on-merge. |\n| `examples/index.md` | Prose outline of every example \u2014 read this to know what's on the shelf. |\n| `examples/` | Complete, copyable `.auto/` directories \u2014 one per workflow archetype, each with a README explaining the moving parts. |\n\nIf these relative paths are not available (for example this playbook was printed by `auto onboard --agent` rather than installed as a skill directory), fetch the same content from the skills mirror: `npx skills add auto-dot-sh/skills`, or browse https://github.com/auto-dot-sh/skills.\n\n# Operating principles\n\nHold these throughout the onboarding:\n\n- **Trust live command output over this document.** The CLI evolves; run `auto --help` early and whenever in doubt, and when a command's real output disagrees with anything written here, trust the command output over this document and adapt.\n- **Converse, don't lecture.** Short messages, one question at a time, and adapt your vocabulary to the user's technical level. The pitch should take seconds, not paragraphs.\n- **Ask before changing anything outside `.auto/`.** The onboarding's write surface is the `.auto/` directory (plus the CI workflow in Beat 7, which ships as a PR). Any other file in the user's repo gets touched only with their explicit go-ahead.\n- **Warn before browsers open, and surface the link either way.** `auto auth login`, `auto connect`, and `auto agents connect` open a browser window *and* print the authorization URL. Give a one-sentence heads-up first (\"this will open your browser to install the GitHub App\") so it doesn't feel like something hijacked their machine. If the browser doesn't pop (some environments can't open one), don't leave the user hunting through command output \u2014 repeat the printed authorization URL back to them on its own line as a clickable fallback, one provider at a time, and tell them plainly to click it.\n- **Signal before going quiet.** Deep repo exploration and waiting on async runs both involve silence. Say what you're about to do and roughly how long it will take.\n- **Enlist the user as the second pair of hands.** They trigger the inputs you can't (tagging a bot in Slack, commenting on a PR) and verify the outputs you can't see (a Slack message arriving). Make those asks explicit and specific.\n- **Hand off, don't hint.** When the user needs to do something, spell it out the *first* time \u2014 before they have to ask. Name the exact trigger (which label, which channel, which command), where to click, and what they'll see when it works. \"Label the issue whenever you're ready\" assumes they can see what's in your head and the YAML you wrote; a numbered \"in Linear: create an issue \u2192 add the `auto-triage` label \u2192 that label is the trigger\" does not. If you catch yourself about to post a one-line \"go ahead and \u2026\", expand it.\n- **Set expectations once, then stay quiet.** When you start watching an async run, tell the user up front roughly how long it takes and what \"normal\" looks like (\"the coder run provisions a sandbox first \u2014 expect a quiet couple of minutes\"), then hold until something *they'd care about* changes. Don't narrate every monitor tick or re-report the same event from a second watcher \u2014 a stream of \"still queued / still running / no news\" reads as noise, not reassurance.\n- **Expect trouble; own the troubleshooting.** OAuth flows fail, secrets get mistyped, webhooks misfire. When something breaks, diagnose it with the CLI (`auto runs list`, `auto runs show`, `auto runs conversation`, `auto apply --dry-run`) rather than asking the user to debug.\n- **Asynchronous means asynchronous.** Triggered runs take time to spawn and act. Tell the user when a wait is expected, and tail run state rather than declaring failure early.\n- **Never fabricate success.** Verify each step actually worked (the apply plan, the trigger receipt, the run conversation) before telling the user it did.\n- **Celebrate real wins.** When a workflow completes end to end for the first time, mark the moment \u2014 emoji, a pun, a little flourish. This should feel fun.\n\n# Procedure\n\nWork through the following beats in order. They are a roadmap, not a script \u2014 skip or reorder when the user's situation clearly calls for it (for example, a user who already has an account and connections can jump straight to Beat 3).\n\n## Beat 0: Learn auto\n\nBefore talking to the user, make sure you have a working command of the system: read `docs/index.md` for the mental model, skim the rest of `docs/`, and look through `examples/` to internalize what complete workflows look like. You will be drawing on the examples heavily in Beats 3-5.\n\n## Beat 1: Establish rapport\n\n**Your very first message after launching is a plain-language pitch, not a form.** Two or three sentences on what auto is and where it's valuable, then *one* opening question. Do **not** open with `AskUserQuestion` or a multiple-choice menu \u2014 that skips the *Educate* goal and makes the onboarding feel like a config wizard. Lead with words; reach for `AskUserQuestion` only once you're past the pitch and genuinely offering discrete choices (e.g. the hero workflow in Beat 3).\n\nAfter the pitch, shift into lightly interviewing the user. You want to learn:\n\n1. **Who they are and their professional context.**\n - Hobbyist, or evaluating auto for a real business?\n - How technical are they? Engineer, or a more managerial / operational role?\n2. **Where the work that matters most to them happens.**\n - Do they have a GitHub account / organization? Is there a repo that would make a good home for their auto system \u2014 better yet, are you running inside it right now?\n - Do they work out of Slack day-to-day, and could they install auto there?\n - What else is in their operating loop? Linear, Datadog, Sentry, PostHog, Notion, Telegram, internal webhooks, and so on.\n\nKeep this light \u2014 a few questions, not a survey. You're gathering enough signal to propose workflows that will land.\n\n## Beat 2: Get up to speed\n\nIf you are running inside a repo the user has indicated is their focus, tell them you're going to explore it for a few minutes (and that you'll go quiet while a research agent reads the repo) \u2014 then **dispatch a subagent to do the deep read in parallel** rather than reading file-by-file in the main thread. This keeps the conversation responsive and your own context clean, and it forces real exploration instead of leaning on whatever `CLAUDE.md` / `AGENTS.md` happened to load.\n\nSpawn one general-purpose / Explore subagent (or a small fan-out of them for a large monorepo) and have it read **both**:\n\n- **The repo:** what the project does, how the team works (CI, review culture, issue-tracker and chat integrations), the conventions written down in `CLAUDE.md`/`AGENTS.md`/`docs/`, and \u2014 most importantly \u2014 where the recurring, automatable toil is.\n- **This skill's `docs/` and `examples/`**, so the ideas it returns are already expressed in auto's vocabulary (agents, triggers, profiles) and mapped to a concrete archetype.\n\nHave the subagent return a structured shortlist: for each candidate workflow, a one-line description, the matching archetype, the trigger/event that would fire it, and the *specific evidence in this repo* that the toil is real (a file, a workflow, a documented rule, a past incident). That shortlist is the raw material for Beat 3.\n\nWhen the agent returns, don't just move on \u2014 **surface 1-2 concrete observations to the user** (\"you renumber migrations by hand and a missed renumber caused a prod outage; your `postman/collection.json` updates are marked NOT OPTIONAL\") so they see the exploration paid off and trust that your pitches are grounded in *their* code. If `CLAUDE.md` already told you something, say so and confirm it against the repo rather than presenting it as discovery.\n\n## Beat 3: Present some options\n\nCombine what you know about the user, their goals, and their codebase, and brainstorm at least three workflows they could deploy *today*. Anchor on the archetypes in `examples/index.md` \u2014 code review, issue triage, incident response, chat assistant, scheduled digest, an orchestrated agent fleet, a research/optimization loop, an outbound lead engine \u2014 but tailor each pitch to their actual stack and pain points (\"a review agent that enforces *your* `docs/style.md`\", not \"a code review bot\"). The archetypes are anchors, not a menu: if the user's situation suggests a useful workflow that matches none of them, it is absolutely fair game \u2014 pitch it. Calibrate ambition to the user: the simple automations land the magic moment fastest, while the frontier examples (fleet, research loop) make better second acts unless the user is clearly hungry for them.\n\nPresent the options as a question, one line each on what the workflow would do for them, and let them pick \u2014 including the option to propose their own idea instead. The winner becomes the hero use case.\n\n## Beat 4: Setup & smoke test\n\nGet the user from zero to a deployed, *hollow* version of the hero workflow \u2014 a shell that proves every input and output is wired up before you invest in the real logic. In practice:\n\n1. **Install the CLI**: `npm install -g @autohq/cli` (requires Node 20+). Verify with `auto --version`.\n2. **Sign in**: `auto auth login` (heads-up: opens a browser; account creation happens there too). You're blocked on the user completing the flow either way, so wait for them \u2014 don't busy yourself with other work mid-sign-in, which only confuses things. When you're driving from a terminal with no browser, `auto auth login --device` prints a code the user enters in their browser.\n3. **Create the org and project**: `auto orgs create` / `auto projects create`. Ask the user what they want to name them \u2014 don't pick names for them.\n4. **Connect providers**: `auto connections list --available` to see what's offered, then `auto connect <provider>` for each one the workflow needs (heads-up: browser again). GitHub connects as an App installation; Slack and Linear as OAuth grants.\n5. **Scaffold `.auto/`**: create the directory in their repo and draft the minimal resources \u2014 an environment, a profile, any tool definitions, and an agent with the workflow's trigger. Copy from the matching example and strip it down.\n6. **Apply**: `auto apply --dry-run` first, show the user the plan, then `auto apply`.\n\nThen run the smoke test. Its exact shape depends on the use case, but the goal is always the same: verify that the trigger fires and the agent's output surfaces reach the user. A workflow almost always involves some communication channel, so a good smoke test \"breaks the fourth wall\" \u2014 have the hollow agent send the user a hello in Slack (or wherever they live).\n\nEnlist the user, and **hand off, don't hint** (see the operating principle): when you ask them to fire the input only they can fire, give the full, numbered steps the first time \u2014 *which* label on *which* issue, *which* channel to create, the exact command to run, and what they'll see when it lands. Don't post \"go ahead and label the issue\" and assume they know a label is the trigger; that one-liner is what makes a user ask \"wait, what exactly do I do?\". Right after `auto apply`, before you start watching, tell them in plain words what just deployed and what their next action is. Then **set expectations once** \u2014 \"the run takes a minute or two to spawn; I'll tell you when it acts\" \u2014 and watch progress yourself with `auto runs list` and `auto attach <run-id>` (live stream; `auto runs conversation <run-id>` for a snapshot), surfacing only meaningful changes rather than every tick. Troubleshoot until the smoke test passes.\n\nIf a channel install is blocked \u2014 for example the Slack workspace requires admin approval \u2014 don't stall the onboarding on it. Pick an output surface the user can verify without the channel (a PR comment, a GitHub check, the run transcript via `auto runs conversation`), continue the beats, and circle back to realize the channel identity once the approval lands.\n\n## Beat 5: Build the real thing\n\nWith inputs and outputs proven, flesh the workflow out to its real form in `.auto/` \u2014 the full profile instructions, the real prompt, the filters and routing that make it production-shaped. Tell the user what you're changing, then apply it.\n\nTest end to end: trigger the workflow for real, follow the run, and enlist the user again for out-of-band inputs and output verification. Iterate until you've witnessed one complete, successful run of the real workflow.\n\nThen celebrate. This is the magic moment \u2014 act like it. \u{1F389}\n\n## Beat 6: Bring the user up to speed\n\nWalk the user through what you built, piece by piece: which environment, profile, tools, agent, and triggers you composed, how an event flows through them to become a run, and where each file lives in `.auto/`. Show short snippets from the actual files rather than describing them abstractly.\n\nThen ask: anything they want to dig into further, or shall we set up CI/CD?\n\n## Beat 7: Set up CI/CD\n\nMake merges to their default branch the deployment mechanism for their auto system (this is the \"program software factories like CI/CD\" promise made literal). Following `docs/ci-cd.md`:\n\n1. Create a service account: have the *user* run `auto service-account create ci-apply --preset applier` in their own terminal (and a second `--preset read-only` account for PR dry-runs if they want plan-on-PR). The token prints exactly once and goes straight into a repo secret \u2014 it must never be pasted into the conversation, and if you run the command yourself it lands in your transcript.\n2. Add a GitHub Actions workflow that runs `auto apply --dry-run` on pull requests and `auto apply` on pushes to the default branch.\n3. Tell the user exactly which secret to create where in their repo settings (the service-account token, shown once at creation).\n4. Open a PR containing `.auto/` and the new workflow, and ask the user to merge it.\n\nWhen the merge lands, verify the apply ran cleanly in Actions, and congratulate them \u2014 their factory now ships itself.\n\n## Beat 8: Set up a self-improvement loop\n\nTell the user there's one last step we've found high-leverage: a workflow that watches their auto system itself \u2014 sweeping recent runs for failures, bottlenecks, and drift, and proposing improvements. Explain that it's just another auto workflow, fully theirs to tune.\n\nIf they're in, copy `examples/self-improvement/` and tailor it to their setup (their channel, their agents, their cadence). Since CI/CD is now live, do **not** run `auto apply` yourself \u2014 open a PR and let them merge it. That's the new normal, and modeling it is the point.\n\n## Beat 9: Conclusion\n\nTell the user they're all set: a live workflow, CI/CD for their auto system, and a loop that helps it improve. Recap in two or three lines what now exists. Offer to help them build or optimize additional workflows \u2014 Beat 3's runner-up ideas are natural next candidates.\n";
31767
+ var onboardingSkillMarkdown = "# Intent\n\nYou are onboarding a user onto auto. Achieve three goals, in roughly this order, as rapidly as the user's pace allows:\n\n1. **Educate** \u2014 teach the user what auto is and how it works, and get them genuinely excited about it.\n2. **Magic moment** \u2014 get a tailor-made, deployed, proactive workflow live that solves a *real* problem for them, and have them witness it working end to end.\n3. **Self-sufficiency** \u2014 leave them with the building blocks (mental model, CI/CD, a self-improvement loop) to iterate on their auto system rapidly and safely on their own.\n\n# Background\n\n**What is auto?**\n\nauto lets you program software factories the same way you program CI/CD.\n\nCompose agents and triggers into workflows using simple YAML files, and deploy them into the cloud on merge.\n\nYou can use auto to build simple (but effective) automations:\n\n- Ticket / feedback triage and resolution\n- Automated incident / bug response\n- Custom tailored code review agents\n\nYou can also use auto to push the frontier of agentic labor:\n\n- Organized fleets of agents on long-horizon tasks\n- Multi-agent autoresearch / optimization loops\n- Agentic BDR and outbound lead engines\n- \u221E more ideas we've yet to dream up\n\nAnything that can be described in a standard operating procedure can be translated into a \"chart\" of agents and triggers in auto \u2014 the only limit is your imagination.\n\n# Reference material\n\nThis skill ships with documentation and worked examples. Read them before you onboard anyone; cite and copy from them as you go.\n\n| Path | What it covers |\n| --- | --- |\n| `docs/index.md` | The mental model: resources, events, triggers, runs. Start here. |\n| `docs/resource-model.md` | The `.auto/agents` directory, inline identities/environments, imports, and `auto apply` semantics. |\n| `docs/sessions-and-triggers.md` | Agents, the trigger/event/routing vocabulary, filters, and PR checks. |\n| `docs/environments-and-profiles.md` | Sandbox images, setup steps and caching, environment fragments, and durable agent prompts. |\n| `docs/tools-and-connections.md` | MCP tools, chat tools, provider connections, secrets, and the runtime tool surface agents see. |\n| `docs/cli.md` | The `auto` CLI command reference. |\n| `docs/ci-cd.md` | Service accounts and GitHub Actions for apply-on-merge. |\n| `examples/index.md` | Prose outline of every example \u2014 read this to know what's on the shelf. |\n| `examples/` | Complete, copyable `.auto/` directories \u2014 one per workflow archetype, each with a README explaining the moving parts. |\n\nIf these relative paths are not available (for example this playbook was printed by `auto onboard --agent` rather than installed as a skill directory), fetch the same content from the skills mirror: `npx skills add auto-dot-sh/skills`, or browse https://github.com/auto-dot-sh/skills.\n\n# Operating principles\n\nHold these throughout the onboarding:\n\n- **Trust live command output over this document.** The CLI evolves; run `auto --help` early and whenever in doubt, and when a command's real output disagrees with anything written here, trust the command output over this document and adapt.\n- **Converse, don't lecture.** Short messages, one question at a time, and adapt your vocabulary to the user's technical level. The pitch should take seconds, not paragraphs.\n- **Ask before changing anything outside `.auto/`.** The onboarding's write surface is the `.auto/` directory (plus the CI workflow in Beat 7, which ships as a PR). Any other file in the user's repo gets touched only with their explicit go-ahead.\n- **Warn before browsers open, and surface the link either way.** `auto auth login`, `auto connect`, and `auto agents connect` open a browser window *and* print the authorization URL. Give a one-sentence heads-up first (\"this will open your browser to install the GitHub App\") so it doesn't feel like something hijacked their machine. If the browser doesn't pop (some environments can't open one), don't leave the user hunting through command output \u2014 repeat the printed authorization URL back to them on its own line as a clickable fallback, one provider at a time, and tell them plainly to click it.\n- **Signal before going quiet.** Deep repo exploration and waiting on async runs both involve silence. Say what you're about to do and roughly how long it will take.\n- **Enlist the user as the second pair of hands.** They trigger the inputs you can't (tagging a bot in Slack, commenting on a PR) and verify the outputs you can't see (a Slack message arriving). Make those asks explicit and specific.\n- **Hand off, don't hint.** When the user needs to do something, spell it out the *first* time \u2014 before they have to ask. Name the exact trigger (which label, which channel, which command), where to click, and what they'll see when it works. \"Label the issue whenever you're ready\" assumes they can see what's in your head and the YAML you wrote; a numbered \"in Linear: create an issue \u2192 add the `auto-triage` label \u2192 that label is the trigger\" does not. If you catch yourself about to post a one-line \"go ahead and \u2026\", expand it.\n- **Set expectations once, then stay quiet.** When you start watching an async run, tell the user up front roughly how long it takes and what \"normal\" looks like (\"the coder run provisions a sandbox first \u2014 expect a quiet couple of minutes\"), then hold until something *they'd care about* changes. Don't narrate every monitor tick or re-report the same event from a second watcher \u2014 a stream of \"still queued / still running / no news\" reads as noise, not reassurance.\n- **Expect trouble; own the troubleshooting.** OAuth flows fail, secrets get mistyped, webhooks misfire. When something breaks, diagnose it with the CLI (`auto runs list`, `auto runs show`, `auto runs conversation`, `auto apply --dry-run`) rather than asking the user to debug.\n- **Asynchronous means asynchronous.** Triggered runs take time to spawn and act. Tell the user when a wait is expected, and tail run state rather than declaring failure early.\n- **Never fabricate success.** Verify each step actually worked (the apply plan, the trigger receipt, the run conversation) before telling the user it did.\n- **Celebrate real wins.** When a workflow completes end to end for the first time, mark the moment \u2014 emoji, a pun, a little flourish. This should feel fun.\n\n# Procedure\n\nWork through the following beats in order. They are a roadmap, not a script \u2014 skip or reorder when the user's situation clearly calls for it (for example, a user who already has an account and connections can jump straight to Beat 3).\n\n## Beat 0: Learn auto\n\nBefore talking to the user, make sure you have a working command of the system: read `docs/index.md` for the mental model, skim the rest of `docs/`, and look through `examples/` to internalize what complete workflows look like. You will be drawing on the examples heavily in Beats 3-5.\n\n## Beat 1: Establish rapport\n\n**Your very first message after launching is a plain-language pitch, not a form.** Two or three sentences on what auto is and where it's valuable, then *one* opening question. Do **not** open with `AskUserQuestion` or a multiple-choice menu \u2014 that skips the *Educate* goal and makes the onboarding feel like a config wizard. Lead with words; reach for `AskUserQuestion` only once you're past the pitch and genuinely offering discrete choices (e.g. the hero workflow in Beat 3).\n\nAfter the pitch, shift into lightly interviewing the user. You want to learn:\n\n1. **Who they are and their professional context.**\n - Hobbyist, or evaluating auto for a real business?\n - How technical are they? Engineer, or a more managerial / operational role?\n2. **Where the work that matters most to them happens.**\n - Do they have a GitHub account / organization? Is there a repo that would make a good home for their auto system \u2014 better yet, are you running inside it right now?\n - Do they work out of Slack day-to-day, and could they install auto there?\n - What else is in their operating loop? Linear, Datadog, Sentry, PostHog, Notion, Telegram, internal webhooks, and so on.\n\nKeep this light \u2014 a few questions, not a survey. You're gathering enough signal to propose workflows that will land.\n\n## Beat 2: Get up to speed\n\nIf you are running inside a repo the user has indicated is their focus, tell them you're going to explore it for a few minutes (and that you'll go quiet while a research agent reads the repo) \u2014 then **dispatch a subagent to do the deep read in parallel** rather than reading file-by-file in the main thread. This keeps the conversation responsive and your own context clean, and it forces real exploration instead of leaning on whatever `CLAUDE.md` / `AGENTS.md` happened to load.\n\nSpawn one general-purpose / Explore subagent (or a small fan-out of them for a large monorepo) and have it read **both**:\n\n- **The repo:** what the project does, how the team works (CI, review culture, issue-tracker and chat integrations), the conventions written down in `CLAUDE.md`/`AGENTS.md`/`docs/`, and \u2014 most importantly \u2014 where the recurring, automatable toil is.\n- **This skill's `docs/` and `examples/`**, so the ideas it returns are already expressed in auto's vocabulary (agents, triggers, inline tools, and fragments) and mapped to a concrete archetype.\n\nHave the subagent return a structured shortlist: for each candidate workflow, a one-line description, the matching archetype, the trigger/event that would fire it, and the *specific evidence in this repo* that the toil is real (a file, a workflow, a documented rule, a past incident). That shortlist is the raw material for Beat 3.\n\nWhen the agent returns, don't just move on \u2014 **surface 1-2 concrete observations to the user** (\"you renumber migrations by hand and a missed renumber caused a prod outage; your `postman/collection.json` updates are marked NOT OPTIONAL\") so they see the exploration paid off and trust that your pitches are grounded in *their* code. If `CLAUDE.md` already told you something, say so and confirm it against the repo rather than presenting it as discovery.\n\n## Beat 3: Present some options\n\nCombine what you know about the user, their goals, and their codebase, and brainstorm at least three workflows they could deploy *today*. Anchor on the archetypes in `examples/index.md` \u2014 code review, issue triage, incident response, chat assistant, scheduled digest, an orchestrated agent fleet, a research/optimization loop, an outbound lead engine \u2014 but tailor each pitch to their actual stack and pain points (\"a review agent that enforces *your* `docs/style.md`\", not \"a code review bot\"). The archetypes are anchors, not a menu: if the user's situation suggests a useful workflow that matches none of them, it is absolutely fair game \u2014 pitch it. Calibrate ambition to the user: the simple automations land the magic moment fastest, while the frontier examples (fleet, research loop) make better second acts unless the user is clearly hungry for them.\n\nPresent the options as a question, one line each on what the workflow would do for them, and let them pick \u2014 including the option to propose their own idea instead. The winner becomes the hero use case.\n\n## Beat 4: Setup & smoke test\n\nGet the user from zero to a deployed, *hollow* version of the hero workflow \u2014 a shell that proves every input and output is wired up before you invest in the real logic. In practice:\n\n1. **Install the CLI**: `npm install -g @autohq/cli` (requires Node 20+). Verify with `auto --version`.\n2. **Sign in**: `auto auth login` (heads-up: opens a browser; account creation happens there too). You're blocked on the user completing the flow either way, so wait for them \u2014 don't busy yourself with other work mid-sign-in, which only confuses things. When you're driving from a terminal with no browser, `auto auth login --device` prints a code the user enters in their browser.\n3. **Create the org and project**: `auto orgs create` / `auto projects create`. Ask the user what they want to name them \u2014 don't pick names for them.\n4. **Connect providers**: `auto connections list --available` to see what's offered, then `auto connect <provider>` for each one the workflow needs (heads-up: browser again). GitHub connects as an App installation; Slack and Linear as OAuth grants.\n5. **Scaffold `.auto/`**: create the directory in their repo and draft the minimal agent files \u2014 an agent with the workflow's prompt, tools, inline identity, triggers, and any environment fragment it imports. Copy from the matching example and strip it down.\n6. **Apply**: `auto apply --dry-run` first, show the user the plan, then `auto apply`.\n\nThen run the smoke test. Its exact shape depends on the use case, but the goal is always the same: verify that the trigger fires and the agent's output surfaces reach the user. A workflow almost always involves some communication channel, so a good smoke test \"breaks the fourth wall\" \u2014 have the hollow agent send the user a hello in Slack (or wherever they live).\n\nEnlist the user, and **hand off, don't hint** (see the operating principle): when you ask them to fire the input only they can fire, give the full, numbered steps the first time \u2014 *which* label on *which* issue, *which* channel to create, the exact command to run, and what they'll see when it lands. Don't post \"go ahead and label the issue\" and assume they know a label is the trigger; that one-liner is what makes a user ask \"wait, what exactly do I do?\". Right after `auto apply`, before you start watching, tell them in plain words what just deployed and what their next action is. Then **set expectations once** \u2014 \"the run takes a minute or two to spawn; I'll tell you when it acts\" \u2014 and watch progress yourself with `auto runs list` and `auto attach <run-id>` (live stream; `auto runs conversation <run-id>` for a snapshot), surfacing only meaningful changes rather than every tick. Troubleshoot until the smoke test passes.\n\nIf a channel install is blocked \u2014 for example the Slack workspace requires admin approval \u2014 don't stall the onboarding on it. Pick an output surface the user can verify without the channel (a PR comment, a GitHub check, the run transcript via `auto runs conversation`), continue the beats, and circle back to realize the channel identity once the approval lands.\n\n## Beat 5: Build the real thing\n\nWith inputs and outputs proven, flesh the workflow out to its real form in `.auto/` \u2014 the full agent system prompt, the real initial prompt, the filters and routing that make it production-shaped. Tell the user what you're changing, then apply it.\n\nTest end to end: trigger the workflow for real, follow the run, and enlist the user again for out-of-band inputs and output verification. Iterate until you've witnessed one complete, successful run of the real workflow.\n\nThen celebrate. This is the magic moment \u2014 act like it. \u{1F389}\n\n## Beat 6: Bring the user up to speed\n\nWalk the user through what you built, piece by piece: which agent files, environment fragments, inline identity, tools, and triggers you composed, how an event flows through them to become a run, and where each file lives in `.auto/`. Show short snippets from the actual files rather than describing them abstractly.\n\nThen ask: anything they want to dig into further, or shall we set up CI/CD?\n\n## Beat 7: Set up CI/CD\n\nMake merges to their default branch the deployment mechanism for their auto system (this is the \"program software factories like CI/CD\" promise made literal). Following `docs/ci-cd.md`:\n\n1. Create a service account: have the *user* run `auto service-account create ci-apply --preset applier` in their own terminal (and a second `--preset read-only` account for PR dry-runs if they want plan-on-PR). The token prints exactly once and goes straight into a repo secret \u2014 it must never be pasted into the conversation, and if you run the command yourself it lands in your transcript.\n2. Add a GitHub Actions workflow that runs `auto apply --dry-run` on pull requests and `auto apply` on pushes to the default branch.\n3. Tell the user exactly which secret to create where in their repo settings (the service-account token, shown once at creation).\n4. Open a PR containing `.auto/` and the new workflow, and ask the user to merge it.\n\nWhen the merge lands, verify the apply ran cleanly in Actions, and congratulate them \u2014 their factory now ships itself.\n\n## Beat 8: Set up a self-improvement loop\n\nTell the user there's one last step we've found high-leverage: a workflow that watches their auto system itself \u2014 sweeping recent runs for failures, bottlenecks, and drift, and proposing improvements. Explain that it's just another auto workflow, fully theirs to tune.\n\nIf they're in, copy `examples/self-improvement/` and tailor it to their setup (their channel, their agents, their cadence). Since CI/CD is now live, do **not** run `auto apply` yourself \u2014 open a PR and let them merge it. That's the new normal, and modeling it is the point.\n\n## Beat 9: Conclusion\n\nTell the user they're all set: a live workflow, CI/CD for their auto system, and a loop that helps it improve. Recap in two or three lines what now exists. Offer to help them build or optimize additional workflows \u2014 Beat 3's runner-up ideas are natural next candidates.\n";
31670
31768
 
31671
31769
  // src/commands/onboard/commands.ts
31672
31770
  function registerOnboardCommands(program, context) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.139",
3
+ "version": "0.1.141",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"