@autohq/cli 0.1.84 → 0.1.86

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.
@@ -21784,9 +21784,15 @@ var SESSION_RUN_DISPATCH_COMMAND_KINDS = [
21784
21784
  "stop"
21785
21785
  ];
21786
21786
  var SESSION_RUN_PERSISTED_COMMAND_KINDS = [
21787
- ...SESSION_RUN_COMMAND_KINDS,
21787
+ "message",
21788
+ "pause",
21789
+ "resume",
21790
+ "interrupt",
21791
+ "cancel",
21792
+ "stop",
21788
21793
  "start",
21789
- "startWithMessage"
21794
+ "startWithMessage",
21795
+ "answer"
21790
21796
  ];
21791
21797
  var SESSION_RUN_LIFECYCLE_COMMAND_KINDS = [
21792
21798
  "pause",
package/dist/index.js CHANGED
@@ -17660,9 +17660,15 @@ var init_session_run_commands = __esm({
17660
17660
  "stop"
17661
17661
  ];
17662
17662
  SESSION_RUN_PERSISTED_COMMAND_KINDS = [
17663
- ...SESSION_RUN_COMMAND_KINDS,
17663
+ "message",
17664
+ "pause",
17665
+ "resume",
17666
+ "interrupt",
17667
+ "cancel",
17668
+ "stop",
17664
17669
  "start",
17665
- "startWithMessage"
17670
+ "startWithMessage",
17671
+ "answer"
17666
17672
  ];
17667
17673
  SESSION_RUN_LIFECYCLE_COMMAND_KINDS = [
17668
17674
  "pause",
@@ -21127,7 +21133,7 @@ var init_package = __esm({
21127
21133
  "package.json"() {
21128
21134
  package_default = {
21129
21135
  name: "@autohq/cli",
21130
- version: "0.1.84",
21136
+ version: "0.1.86",
21131
21137
  license: "SEE LICENSE IN README.md",
21132
21138
  publishConfig: {
21133
21139
  access: "public"
@@ -29147,7 +29153,7 @@ var onboardingSkillMarkdown = `# Onboard your user to auto
29147
29153
 
29148
29154
  You are a coding agent running inside the user's repository. Your job is to
29149
29155
  take them from zero to a working auto deployment in one conversation, with
29150
- the least possible friction. Follow the five beats in order, and run every
29156
+ the least possible friction. Follow the six beats in order, and run every
29151
29157
  waiting step in parallel with your own work.
29152
29158
 
29153
29159
  ## Ground rules
@@ -29199,7 +29205,8 @@ get me into your Slack." Then, without waiting:
29199
29205
  Build a repo dossier while the clicks happen. Explore the codebase and git
29200
29206
  history for:
29201
29207
 
29202
- - Stack and layout: languages, frameworks, build and test setup, CI config.
29208
+ - Stack and layout: languages, frameworks, build and test setup, CI and
29209
+ deploy workflows (Beat 6 wires into these).
29203
29210
  - How the team works: PR conventions, review patterns, branch and release
29204
29211
  habits, merge frequency.
29205
29212
  - Tools referenced: issue tracker keys in commits and branches, chat or
@@ -29280,6 +29287,102 @@ one workflow. Then:
29280
29287
  5. Apply with \`auto apply\` and confirm the trigger is active. Route the
29281
29288
  workflow's reports to the Slack channel from Beat 2.
29282
29289
 
29290
+ ## Beat 6: Wire CI to apply on merge
29291
+
29292
+ Every apply so far ran from this terminal under the user's own login. Its
29293
+ durable home is CI: a dry-run plan as a check on every PR, and the real
29294
+ apply when changes merge \u2014 \`.auto/\` ships the same way the code does. Do
29295
+ this once the GitHub App is connected and the first apply has succeeded.
29296
+
29297
+ 1. CI authenticates as a service account, never as the user. Create two \u2014
29298
+ the \`applier\` token lives only on the merge path, while the \`read-only\`
29299
+ token is exposed to PR-triggered runs: it can produce the dry-run plan
29300
+ but cannot perform a real apply, and it stays revocable on its own. Pipe
29301
+ each token straight into a GitHub secret so it never touches your
29302
+ transcript or disk \u2014 with \`pipefail\` and \`jq -re\` so a failed create
29303
+ cannot silently store an empty secret:
29304
+
29305
+ \`\`\`sh
29306
+ set -o pipefail
29307
+ auto service-account create github-actions-auto-apply \\
29308
+ --preset applier --json \\
29309
+ | jq -re .token | gh secret set AUTO_APPLY_SERVICE_ACCOUNT_TOKEN
29310
+ auto service-account create github-actions-auto-apply-dry-run \\
29311
+ --preset read-only --json \\
29312
+ | jq -re .token | gh secret set AUTO_APPLY_DRY_RUN_SERVICE_ACCOUNT_TOKEN
29313
+ \`\`\`
29314
+
29315
+ Confirm both pipelines exited 0 and \`gh secret list\` shows both names
29316
+ before moving on. If deploys go through a GitHub environment, scope the
29317
+ apply secret to it (\`gh secret set --env\`).
29318
+ 2. Fit into the deploy process you mapped in Beat 3. If a workflow already
29319
+ ships merges, splice two steps in after its deploy succeeds \u2014 plan
29320
+ (\`auto apply --dry-run\`), then \`auto apply\` \u2014 reusing its checkout and
29321
+ Node setup. If nothing deploys from CI yet, add the standalone workflow
29322
+ below. Either way, keep the PR dry-run check: it shows reviewers the
29323
+ exact create/update/archive plan their merge will execute.
29324
+ 3. Workflow files live outside \`.auto/\`, so show the user the file and get
29325
+ a yes; commit it on the same branch as the \`.auto/\` resources.
29326
+
29327
+ \`\`\`yaml
29328
+ name: Auto Apply
29329
+
29330
+ # Both triggers assume the default branch is main; swap in the repo's
29331
+ # actual default branch before committing.
29332
+ on:
29333
+ pull_request:
29334
+ branches: [main]
29335
+ push:
29336
+ branches: [main]
29337
+
29338
+ permissions:
29339
+ contents: read
29340
+
29341
+ concurrency:
29342
+ group: auto-apply-\${{ github.event.pull_request.number || github.ref }}
29343
+ cancel-in-progress: \${{ github.event_name == 'pull_request' }}
29344
+
29345
+ jobs:
29346
+ plan:
29347
+ runs-on: ubuntu-latest
29348
+ timeout-minutes: 10
29349
+ steps:
29350
+ - uses: actions/checkout@v4
29351
+ - uses: actions/setup-node@v4
29352
+ with:
29353
+ node-version: lts/*
29354
+ - run: npx -y --package=@autohq/cli auto apply --dry-run
29355
+ env:
29356
+ AUTO_API_TOKEN: \${{ secrets.AUTO_APPLY_DRY_RUN_SERVICE_ACCOUNT_TOKEN }}
29357
+
29358
+ apply:
29359
+ if: \${{ github.event_name == 'push' }}
29360
+ needs: plan
29361
+ runs-on: ubuntu-latest
29362
+ timeout-minutes: 10
29363
+ steps:
29364
+ - uses: actions/checkout@v4
29365
+ - uses: actions/setup-node@v4
29366
+ with:
29367
+ node-version: lts/*
29368
+ - run: npx -y --package=@autohq/cli auto apply
29369
+ env:
29370
+ AUTO_API_TOKEN: \${{ secrets.AUTO_APPLY_SERVICE_ACCOUNT_TOKEN }}
29371
+ \`\`\`
29372
+
29373
+ Adapt it to the repo: the default branch name, the team's Node setup or
29374
+ pinned tool versions, and set \`AUTO_API_BASE_URL\` only if the project runs
29375
+ against a non-default Auto host. \`pull_request\` runs from forks do not
29376
+ receive secrets; if fork PRs are routine here, run the dry-run from a
29377
+ \`pull_request_target\` workflow that checks out workflow code from the base
29378
+ branch and only \`.auto/\` from the PR head.
29379
+
29380
+ After the PR merges, watch the first run and confirm its plan reports the
29381
+ resources you already applied as unchanged. From then on, \`.auto/\` on the
29382
+ default branch is the source of truth \u2014 directory apply prunes resources
29383
+ that are no longer declared, so the team changes agents by PR, not by
29384
+ terminal.
29385
+
29283
29386
  ## Workflow playbook
29284
29387
 
29285
29388
  Candidates, strongest signals, and what confirms fit:
@@ -29305,15 +29408,20 @@ out loud when proposing.
29305
29408
  the install is approved, and have the concierge retry.
29306
29409
  - Sign-in stalls: the user may not have an invite yet; point them at the
29307
29410
  auto site and pause gracefully rather than failing.
29411
+ - \`gh secret set\` fails (no repo admin rights, gh not authenticated):
29412
+ leave the CI workflow in the PR anyway and hand the user the two
29413
+ create-and-pipe commands from Beat 6 to run themselves. Tokens are shown
29414
+ once and must never be pasted into the conversation.
29308
29415
  - A command disagrees with this document: the command is right. Re-read
29309
29416
  \`auto --help\` and adapt.
29310
29417
 
29311
29418
  ## What you leave behind
29312
29419
 
29313
29420
  - \`.auto/\` committed on a branch with a PR the user can merge: the
29314
- concierge and workflow session YAML plus \`context.md\` (the distilled
29315
- dossier). Write the PR description for teammates \u2014 it doubles as the
29316
- announcement that this repo now has an auto agent.
29421
+ concierge and workflow session YAML, the CI apply workflow from Beat 6,
29422
+ plus \`context.md\` (the distilled dossier). Write the PR description for
29423
+ teammates \u2014 it doubles as the announcement that this repo now has an
29424
+ auto agent.
29317
29425
  - With the user's opt-in, an AGENTS.md section that tells every future
29318
29426
  coding agent in this repo that auto exists, what is deployed, and how to
29319
29427
  add workflows.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.84",
3
+ "version": "0.1.86",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"