@withakay/opencode-autopilot 0.1.1 → 0.2.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
@@ -1,6 +1,6 @@
1
1
  # @withakay/opencode-autopilot
2
2
 
3
- Autopilot mode plugin for OpenCode — autonomous multi-step task execution with safety guarantees.
3
+ Autopilot plugin for OpenCode — session-scoped autonomy defaults plus optional delegated long-running work.
4
4
 
5
5
  ## Installation
6
6
 
@@ -22,49 +22,70 @@ Register the plugin in your `opencode.jsonc`:
22
22
  }
23
23
  ```
24
24
 
25
- The plugin registers five tools:
25
+ The plugin registers a single `autopilot` control tool:
26
26
 
27
- - **`autopilot_start`** — Arm autopilot mode for the current session
28
- - **`autopilot_status`** — Show autopilot status for the current session
29
- - **`autopilot_stop`** — Stop autopilot mode for the current session
30
- - **`autopilot_help`** — Show usage instructions
31
- - **`autopilot_prompt`** — Get the control agent prompt (call at session start)
27
+ - **`autopilot`** — Turn autopilot on or off, show status, or start a delegated task
32
28
 
33
- ### Control Agent
29
+ ### Slash command entry point
34
30
 
35
- Create an agent in `opencode.jsonc` to control the plugin:
31
+ OpenCode custom slash commands live in `.opencode/commands/`. This repo includes `/autopilot` at `.opencode/commands/autopilot.md`.
32
+
33
+ After registering the plugin, the primary UX is:
34
+
35
+ - **`/autopilot on`** — enable autopilot for the rest of the session
36
+ - **`/autopilot off`** — disable autopilot
37
+ - **`/autopilot status`** — inspect current state
38
+ - **`/autopilot <task>`** — enable autopilot and delegate a long-running task immediately
39
+
40
+ If you prefer to call the tool directly, use:
36
41
 
37
42
  ```jsonc
38
43
  {
39
- "agent": {
40
- "autopilot": {
41
- "description": "Control agent for autopilot plugin",
42
- "mode": "primary",
43
- "temperature": 0,
44
- "tools": {
45
- "autopilot_start": true,
46
- "autopilot_status": true,
47
- "autopilot_stop": true,
48
- "autopilot_help": true,
49
- "autopilot_prompt": true
50
- }
51
- }
44
+ "tool": {
45
+ "autopilot": true
52
46
  }
53
47
  }
54
48
  ```
55
49
 
56
- The agent should call `autopilot_prompt` at the start of each session to get its operating instructions.
50
+ Examples:
51
+
52
+ - `autopilot(action="on")`
53
+ - `autopilot(action="status")`
54
+ - `autopilot(task="Fix the failing tests", workerAgent="build-high")`
55
+ - `autopilot(action="on", autonomousStrength="aggressive")`
56
+
57
+ ### Optional orchestrator agent
58
+
59
+ Autopilot no longer requires a dedicated control agent, but delegated work still runs through a configured agent (`general` by default). You can think of that agent as the orchestrator or overwatch worker that keeps a long-running task moving after `/autopilot <task>`.
60
+
61
+ ### Autonomous Strength Modes
57
62
 
58
- Then switch to the Autopilot agent and send your task.
63
+ Control how strongly autopilot biases toward autonomous decision-making:
64
+
65
+ - **`conservative`** — Soft guidance to prefer defaults; asks when unsure (similar to previous behavior)
66
+ - **`balanced`** (default) — Stronger bias toward selecting recommended/safe defaults with minimal user interaction
67
+ - **`aggressive`** — Always pick recommended/safe defaults for routine choices; only escalate high-impact decisions (data deletion, major refactors) or security/safety risks
68
+
69
+ The autonomous strength affects the system prompt guidance injected into the agent's context. Aggressive mode includes explicit rules to select recommended defaults without asking, while conservative mode provides softer suggestions.
59
70
 
60
71
  ### Permission Modes
61
72
 
62
73
  - **`limited`** (default) — Auto-denies all permission requests; blocks on first denial
63
74
  - **`allow-all`** — Auto-allows all permission requests
64
75
 
76
+ ### Question handling
77
+
78
+ OpenCode currently exposes direct permission interception but not a general question-timeout hook through the plugin API. This plugin therefore:
79
+
80
+ - auto-handles permission prompts according to the selected permission mode
81
+ - injects system prompt guidance based on the autonomous strength setting to bias the agent toward recommended defaults
82
+ - still escalates to the user when no safe default exists or for high-impact decisions
83
+
84
+ The autonomous strength parameter controls how strongly this guidance is worded. In aggressive mode, the system prompt explicitly instructs the agent to always select recommended/safe defaults for routine choices (file paths, variable names, configurations) without asking the user.
85
+
65
86
  ## Architecture
66
87
 
67
- The plugin implements an OODA (Observe-Orient-Decide-Act) control loop with a formal state machine.
88
+ The plugin implements a session-scoped autonomy layer plus a delegated-task continuation loop with a formal state machine.
68
89
 
69
90
  ### State Machine Phases
70
91
 
@@ -137,7 +158,7 @@ src/
137
158
  index.ts, event-handler.ts, permission.ts,
138
159
  system-transform.ts, chat-message.ts, tool-after.ts
139
160
  tools/ # Tool definitions
140
- index.ts, help.ts, start.ts, status.ts, stop.ts
161
+ index.ts, autopilot.ts, usage.ts
141
162
  __tests__/ # All test files
142
163
  helpers.ts, reducer.test.ts, events.test.ts,
143
164
  effects.test.ts, prompts.test.ts, plugin.test.ts,