autopilot-code 0.9.0 → 1.0.0

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/README.md CHANGED
@@ -15,6 +15,62 @@ A repo is considered autopilot-enabled when it contains:
15
15
 
16
16
  - `.autopilot/autopilot.json` with `enabled: true`
17
17
 
18
+ ## Quick Start
19
+
20
+ ### Choosing an Agent
21
+
22
+ Autopilot supports multiple agent types:
23
+
24
+ **opencode** (recommended): Full-featured agent with extensive code understanding
25
+ ```json
26
+ {
27
+ "agent": "opencode"
28
+ }
29
+ ```
30
+
31
+ **claude**: Fast, targeted code changes
32
+ ```json
33
+ {
34
+ "agent": "claude"
35
+ }
36
+ ```
37
+
38
+ ### Runner Configuration
39
+
40
+ **IMPORTANT**: The new Python runner is now the default. The legacy bash script is deprecated and will be removed in a future version.
41
+
42
+ The new runner provides enhanced progress tracking and session continuity:
43
+
44
+ ```json
45
+ {
46
+ "useNewRunner": true,
47
+ "enablePlanningStep": true
48
+ }
49
+ ```
50
+
51
+ **Deprecation Timeline**:
52
+ - **Current release**: New runner is default, deprecation warnings added
53
+ - **+1 minor release**: More prominent warnings for legacy runner
54
+ - **+1 major release**: Bash script will be removed entirely
55
+
56
+ If you see a deprecation warning, it means you're using the legacy bash runner. To migrate, remove `"useNewRunner": false` from your config (or set to `true`).
57
+
58
+ ### Understanding Step Labels
59
+
60
+ When using the new runner, issues progress through these labels:
61
+
62
+ - `autopilot:planning` - Creating implementation plan
63
+ - `autopilot:implementing` - Writing code
64
+ - `autopilot:pr-created` - Pull request created
65
+ - `autopilot:waiting-checks` - Waiting for CI
66
+ - `autopilot:fixing-checks` - Fixing failing CI
67
+ - `autopilot:merging` - Merging PR
68
+
69
+ To create these labels in your repository:
70
+ ```bash
71
+ autopilot setup-labels --repo owner/repo
72
+ ```
73
+
18
74
  Example:
19
75
 
20
76
  ```json
@@ -47,7 +103,8 @@ Example:
47
103
 
48
104
  Notes:
49
105
  - `repo` must be the GitHub `owner/name`.
50
- - `agent` (optional, default `"none"`): set to `"opencode"` to enable OpenCode integration after claiming issues.
106
+ - `agent` (optional, default `"opencode"`): set to `"opencode"` or `"claude"` to choose which coding agent to use.
107
+ - `useNewRunner` (optional, default `true`): enable the new runner with step labels and session continuity. The legacy bash runner is deprecated and will be removed in a future version.
51
108
  - `autoMerge` (optional, default `true`): if `true`, autopilot will automatically merge PRs after checks pass.
52
109
  - `mergeMethod` (optional, default `"squash"`): merge strategy to use. Options: `"squash"`, `"merge"`, or `"rebase"`.
53
110
  - `allowedMergeUsers` (required when `autoMerge=true`): list of GitHub usernames allowed to auto-merge. The runner verifies the authenticated GitHub user is in this list before merging.
@@ -57,7 +114,8 @@ Notes:
57
114
  - `conflictResolutionMaxAttempts` (optional, default `3`): maximum number of attempts to resolve merge conflicts.
58
115
  - `autoFixChecks` (optional, default `true`): if `true`, autopilot will attempt to automatically fix failing CI checks.
59
116
  - `autoFixChecksMaxAttempts` (optional, default `3`): maximum number of attempts to fix failing checks.
60
- - `heartbeatMaxAgeSecs` controls how long an in-progress issue can go without a heartbeat before it's considered stale.
117
+ - `enablePlanningStep` (optional, default `true`): if `true`, add an explicit planning phase before implementation (requires `useNewRunner: true`).
118
+ - `agentPath` (optional): custom path to agent executable (defaults to searching PATH).
61
119
 
62
120
  ## Workflow (labels)
63
121
  Autopilot uses labels as a kanban state machine:
package/dist/cli.js CHANGED
@@ -548,4 +548,63 @@ program
548
548
  .action(() => {
549
549
  logsSystemdService();
550
550
  });
551
+ program
552
+ .command("setup-labels")
553
+ .description("Create required GitHub labels for autopilot workflow")
554
+ .option("--repo <owner/repo>", "Repository in owner/repo format")
555
+ .action((opts) => {
556
+ if (!opts.repo) {
557
+ const cwd = process.cwd();
558
+ const repoName = getRepoName(cwd);
559
+ if (!repoName) {
560
+ console.error("No --repo option provided and could not detect repo from current directory.");
561
+ console.error("Usage: autopilot setup-labels --repo owner/repo");
562
+ process.exit(1);
563
+ }
564
+ opts.repo = repoName;
565
+ }
566
+ const labels = [
567
+ { name: "autopilot:todo", color: "7057ff", description: "Ready to be picked up by autopilot" },
568
+ { name: "autopilot:in-progress", color: "0075ca", description: "Claimed by autopilot" },
569
+ { name: "autopilot:blocked", color: "d93f0b", description: "Needs human input or missing heartbeat" },
570
+ { name: "autopilot:done", color: "3fb950", description: "Completed" },
571
+ { name: "autopilot:backlog", color: "d4c5f9", description: "Captured, not ready" },
572
+ { name: "autopilot:planning", color: "5319e7", description: "Creating implementation plan" },
573
+ { name: "autopilot:implementing", color: "1f883d", description: "Writing code" },
574
+ { name: "autopilot:pr-created", color: "fbca04", description: "Pull request created" },
575
+ { name: "autopilot:waiting-checks", color: "0e8a16", description: "Waiting for CI checks" },
576
+ { name: "autopilot:fixing-checks", color: "cfd3d7", description: "Fixing failing CI checks" },
577
+ { name: "autopilot:merging", color: "bfd4f2", description: "Merging pull request" }
578
+ ];
579
+ console.log(`Creating labels for ${opts.repo}...`);
580
+ labels.forEach(label => {
581
+ const args = [
582
+ "api",
583
+ "--method",
584
+ "POST",
585
+ "-H",
586
+ "Accept: application/vnd.github+json",
587
+ "repos/${opts.repo}/labels",
588
+ "-f",
589
+ `name=${label.name}`,
590
+ "-f",
591
+ `color=${label.color}`,
592
+ "-f",
593
+ `description=${label.description}`
594
+ ];
595
+ const res = (0, node_child_process_1.spawnSync)("gh", args, { stdio: "pipe" });
596
+ if (res.status === 0) {
597
+ console.log(`✅ Created: ${label.name}`);
598
+ }
599
+ else if (res.stderr && res.stderr.toString().includes("Label already exists")) {
600
+ console.log(`ℹ️ Exists: ${label.name}`);
601
+ }
602
+ else {
603
+ console.error(`❌ Failed to create ${label.name}`);
604
+ if (res.stderr)
605
+ console.error(res.stderr.toString());
606
+ }
607
+ });
608
+ console.log("\n✅ Label setup complete!");
609
+ });
551
610
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autopilot-code",
3
- "version": "0.9.0",
3
+ "version": "1.0.0",
4
4
  "private": false,
5
5
  "description": "Repo-issue–driven autopilot runner",
6
6
  "license": "MIT",
@@ -765,6 +765,16 @@ def run_issue(cfg: RepoConfig, issue_number: int) -> bool:
765
765
  Uses either the new Python runner or legacy bash script
766
766
  based on configuration.
767
767
  """
768
+ use_new_runner = cfg.config.get("useNewRunner", True)
769
+
770
+ if not use_new_runner:
771
+ import logging
772
+ logger = logging.getLogger(__name__)
773
+ logger.warning(
774
+ "Legacy bash runner is deprecated and will be removed in a future version. "
775
+ "Please migrate to new runner by removing 'useNewRunner: false' from config."
776
+ )
777
+
768
778
  if cfg.use_new_runner:
769
779
  return run_issue_new(cfg, issue_number)
770
780
  else:
@@ -1,4 +1,15 @@
1
1
  #!/usr/bin/env bash
2
+ # =============================================================================
3
+ # DEPRECATED: This script is deprecated and will be removed in a future version.
4
+ #
5
+ # The functionality has been replaced by Python IssueRunner module at:
6
+ # scripts/issue_runner/
7
+ #
8
+ # To use the new runner, ensure "useNewRunner" is not set to false in your
9
+ # autopilot.json config (it defaults to true).
10
+ #
11
+ # This script is maintained only for backward compatibility.
12
+ # =============================================================================
2
13
  set -euo pipefail
3
14
 
4
15
  REPO_DIR="$1"
@@ -1,18 +1,29 @@
1
1
  {
2
2
  "enabled": true,
3
- "repo": "bakkensoftware/TicketToolbox",
3
+ "repo": "owner/repo",
4
4
  "agent": "opencode",
5
- "allowedMergeUsers": ["github-username"],
5
+ "useNewRunner": true,
6
+ "autoMerge": true,
7
+ "mergeMethod": "squash",
8
+ "allowedMergeUsers": [],
6
9
  "issueLabels": {
7
10
  "queue": ["autopilot:todo"],
8
- "blocked": "autopilot:blocked",
9
11
  "inProgress": "autopilot:in-progress",
12
+ "blocked": "autopilot:blocked",
10
13
  "done": "autopilot:done"
11
14
  },
15
+ "stepLabels": {
16
+ "planning": "autopilot:planning",
17
+ "implementing": "autopilot:implementing",
18
+ "prCreated": "autopilot:pr-created",
19
+ "waitingChecks": "autopilot:waiting-checks",
20
+ "fixingChecks": "autopilot:fixing-checks",
21
+ "merging": "autopilot:merging"
22
+ },
12
23
  "priorityLabels": ["p0", "p1", "p2"],
13
24
  "minPriority": null,
14
- "maxParallel": 2,
15
25
  "ignoreIssueLabels": ["autopilot:backlog"],
26
+ "maxParallel": 2,
16
27
  "branchPrefix": "autopilot/",
17
28
  "allowedBaseBranch": "main",
18
29
  "autoResolveConflicts": true,
@@ -20,5 +31,6 @@
20
31
  "autoFixChecks": true,
21
32
  "autoFixChecksMaxAttempts": 3,
22
33
  "autoUpdate": true,
23
- "enablePlanningStep": true
34
+ "enablePlanningStep": true,
35
+ "agentPath": ""
24
36
  }