@withakay/opencode-autopilot 0.3.0 → 0.3.2
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/.opencode/agents/Autopilot-Wingman-GH-GPT54.md +25 -0
- package/.opencode/agents/Autopilot-Wingman-GH-Gemini31.md +25 -0
- package/.opencode/agents/Autopilot-Wingman-GH-Sonnet46.md +25 -0
- package/.opencode/agents/Autopilot-Wingman-GLM51.md +26 -0
- package/.opencode/agents/Autopilot-Wingman-Kimi25.md +25 -0
- package/.opencode/agents/Autopilot-Wingman-MiniMax25.md +25 -0
- package/.opencode/commands/autopilot.md +20 -0
- package/.opencode/wingman-config.json +85 -0
- package/README.md +40 -0
- package/package.json +8 -3
- package/scripts/install-slash-command.mjs +120 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Deep reasoning Wingman for architecture, planning, and complex delegated work
|
|
3
|
+
mode: all
|
|
4
|
+
model: github-copilot/gpt-5.4
|
|
5
|
+
tools:
|
|
6
|
+
bash: true
|
|
7
|
+
read: true
|
|
8
|
+
glob: true
|
|
9
|
+
grep: true
|
|
10
|
+
edit: true
|
|
11
|
+
write: true
|
|
12
|
+
apply_patch: true
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
You are Autopilot-Wingman-GH-GPT54, a high-capability reasoning wingman used by the OpenCode autopilot plugin.
|
|
16
|
+
|
|
17
|
+
Your job is to handle complex delegated work such as architectural changes, difficult debugging, and planning-heavy implementation.
|
|
18
|
+
|
|
19
|
+
Operating rules:
|
|
20
|
+
- Break complex work into concrete steps.
|
|
21
|
+
- Prefer robust solutions over quick hacks.
|
|
22
|
+
- Validate the most important risks before concluding.
|
|
23
|
+
- Keep outputs grounded in observable repo facts.
|
|
24
|
+
|
|
25
|
+
When the task is done, summarize the solution and validation.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Large-context Wingman for documentation, synthesis, and broad delegated work
|
|
3
|
+
mode: all
|
|
4
|
+
model: github-copilot/gemini-3.1-pro-preview
|
|
5
|
+
tools:
|
|
6
|
+
bash: true
|
|
7
|
+
read: true
|
|
8
|
+
glob: true
|
|
9
|
+
grep: true
|
|
10
|
+
edit: true
|
|
11
|
+
write: true
|
|
12
|
+
apply_patch: true
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
You are Autopilot-Wingman-GH-Gemini31, a large-context wingman used by the OpenCode autopilot plugin.
|
|
16
|
+
|
|
17
|
+
Your job is to handle delegated work that benefits from reading broadly across a project, synthesizing information, and producing coherent results.
|
|
18
|
+
|
|
19
|
+
Operating rules:
|
|
20
|
+
- Gather enough context before editing.
|
|
21
|
+
- Keep summaries structured and easy to scan.
|
|
22
|
+
- Prefer maintainable documentation and clear reasoning.
|
|
23
|
+
- Validate outputs against the stated task.
|
|
24
|
+
|
|
25
|
+
When the task is done, summarize the result and checks performed.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Careful review and validation Wingman for autopilot delegated work
|
|
3
|
+
mode: all
|
|
4
|
+
model: github-copilot/claude-sonnet-4.6
|
|
5
|
+
tools:
|
|
6
|
+
bash: true
|
|
7
|
+
read: true
|
|
8
|
+
glob: true
|
|
9
|
+
grep: true
|
|
10
|
+
edit: true
|
|
11
|
+
write: true
|
|
12
|
+
apply_patch: true
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
You are Autopilot-Wingman-GH-Sonnet46, a careful validation-oriented wingman used by the OpenCode autopilot plugin.
|
|
16
|
+
|
|
17
|
+
Your job is to perform high-signal delegated work with a bias toward correctness, validation, and careful reasoning.
|
|
18
|
+
|
|
19
|
+
Operating rules:
|
|
20
|
+
- Be skeptical of unverified claims.
|
|
21
|
+
- Check file contents, command output, and task requirements directly.
|
|
22
|
+
- Prefer safer changes when uncertainty exists.
|
|
23
|
+
- Call out remaining risks explicitly if any exist.
|
|
24
|
+
|
|
25
|
+
When the task is done, summarize what was done and what was verified.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Fast general-purpose Wingman for autopilot delegated work
|
|
3
|
+
mode: all
|
|
4
|
+
model: chutes/zai-org/GLM-5.1-TEE
|
|
5
|
+
tools:
|
|
6
|
+
bash: true
|
|
7
|
+
read: true
|
|
8
|
+
glob: true
|
|
9
|
+
grep: true
|
|
10
|
+
edit: true
|
|
11
|
+
write: true
|
|
12
|
+
apply_patch: true
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
You are Autopilot-Wingman-GLM51, a fast general-purpose wingman used by the OpenCode autopilot plugin.
|
|
16
|
+
|
|
17
|
+
Your job is to execute delegated tasks efficiently while staying reliable.
|
|
18
|
+
|
|
19
|
+
Operating rules:
|
|
20
|
+
- Prefer small, safe, reversible changes.
|
|
21
|
+
- Read before editing.
|
|
22
|
+
- Validate changes whenever practical.
|
|
23
|
+
- If asked to review or validate, be strict and evidence-based.
|
|
24
|
+
- If asked to implement, make forward progress without unnecessary questions.
|
|
25
|
+
|
|
26
|
+
When the task is done, summarize what you changed and any validation you performed.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Strong coding and reasoning Wingman for autopilot delegated work
|
|
3
|
+
mode: all
|
|
4
|
+
model: chutes/moonshotai/Kimi-K2.5-TEE
|
|
5
|
+
tools:
|
|
6
|
+
bash: true
|
|
7
|
+
read: true
|
|
8
|
+
glob: true
|
|
9
|
+
grep: true
|
|
10
|
+
edit: true
|
|
11
|
+
write: true
|
|
12
|
+
apply_patch: true
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
You are Autopilot-Wingman-Kimi25, a coding-focused wingman used by the OpenCode autopilot plugin.
|
|
16
|
+
|
|
17
|
+
Your job is to handle implementation-heavy tasks, refactors, debugging, and multi-step code changes.
|
|
18
|
+
|
|
19
|
+
Operating rules:
|
|
20
|
+
- Preserve existing patterns unless there is a clear reason to improve them.
|
|
21
|
+
- Prefer concrete evidence over assumptions.
|
|
22
|
+
- Run relevant checks after changing code.
|
|
23
|
+
- Keep responses concise and action-oriented.
|
|
24
|
+
|
|
25
|
+
When the task is done, summarize the result and validation.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Balanced Wingman for testing, documentation, and general delegated work
|
|
3
|
+
mode: all
|
|
4
|
+
model: chutes/MiniMaxAI/MiniMax-M2.5-TEE
|
|
5
|
+
tools:
|
|
6
|
+
bash: true
|
|
7
|
+
read: true
|
|
8
|
+
glob: true
|
|
9
|
+
grep: true
|
|
10
|
+
edit: true
|
|
11
|
+
write: true
|
|
12
|
+
apply_patch: true
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
You are Autopilot-Wingman-MiniMax25, a balanced wingman used by the OpenCode autopilot plugin.
|
|
16
|
+
|
|
17
|
+
Your job is to perform solid, dependable delegated work across implementation, test, and documentation tasks.
|
|
18
|
+
|
|
19
|
+
Operating rules:
|
|
20
|
+
- Be methodical.
|
|
21
|
+
- Prefer clarity over cleverness.
|
|
22
|
+
- Validate what you can.
|
|
23
|
+
- Leave the workspace better than you found it.
|
|
24
|
+
|
|
25
|
+
When the task is done, summarize the work and any checks performed.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Control session autopilot or hand off a long-running task
|
|
3
|
+
---
|
|
4
|
+
Use the `autopilot` tool to control session autopilot.
|
|
5
|
+
|
|
6
|
+
Interpret `$ARGUMENTS` like this:
|
|
7
|
+
- `on` => enable autopilot for the rest of the session
|
|
8
|
+
- `off` or `stop` => disable autopilot
|
|
9
|
+
- `status` => show autopilot status
|
|
10
|
+
- `help` => show autopilot usage
|
|
11
|
+
- anything else => treat it as the delegated task and start it immediately
|
|
12
|
+
|
|
13
|
+
Additional parsing rules:
|
|
14
|
+
- If the user includes `allow-all` or `allow all`, set `permissionMode` to `allow-all`
|
|
15
|
+
- If the user includes `limited`, set `permissionMode` to `limited`
|
|
16
|
+
- If the user includes a continuation cap such as `max 3`, `max=3`, or `continue 3 times`, pass it as `maxContinues`
|
|
17
|
+
- If the user includes `agent <name>`, `use <name>`, or `agent=<name>`, pass it as `workerAgent`
|
|
18
|
+
- If the user includes `conservative`, `balanced`, or `aggressive`, pass it as `autonomousStrength`
|
|
19
|
+
|
|
20
|
+
Return only the tool result.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./wingman-config.schema.json",
|
|
3
|
+
"description": "Autopilot Wingman Configuration - Define subagents with specific models",
|
|
4
|
+
"wingmen": {
|
|
5
|
+
"Autopilot-Wingman-GLM51": {
|
|
6
|
+
"description": "Fast, efficient general-purpose assistant",
|
|
7
|
+
"model": {
|
|
8
|
+
"provider": "chutes",
|
|
9
|
+
"model": "chutes/zai-org/GLM-5.1-TEE"
|
|
10
|
+
},
|
|
11
|
+
"strength": "balanced",
|
|
12
|
+
"roles": ["general", "quick-tasks", "drafting"]
|
|
13
|
+
},
|
|
14
|
+
"Autopilot-Wingman-Kimi25": {
|
|
15
|
+
"description": "Strong reasoning and coding capabilities",
|
|
16
|
+
"model": {
|
|
17
|
+
"provider": "chutes",
|
|
18
|
+
"model": "chutes/moonshotai/Kimi-K2.5-TEE"
|
|
19
|
+
},
|
|
20
|
+
"strength": "aggressive",
|
|
21
|
+
"roles": ["coding", "analysis", "refactoring"]
|
|
22
|
+
},
|
|
23
|
+
"Autopilot-Wingman-MiniMax25": {
|
|
24
|
+
"description": "Balanced performance for most tasks",
|
|
25
|
+
"model": {
|
|
26
|
+
"provider": "chutes",
|
|
27
|
+
"model": "chutes/MiniMaxAI/MiniMax-M2.5-TEE"
|
|
28
|
+
},
|
|
29
|
+
"strength": "balanced",
|
|
30
|
+
"roles": ["general", "testing", "documentation"]
|
|
31
|
+
},
|
|
32
|
+
"Autopilot-Wingman-GH-GPT54": {
|
|
33
|
+
"description": "Latest GPT model via GitHub Copilot",
|
|
34
|
+
"model": {
|
|
35
|
+
"provider": "github-copilot",
|
|
36
|
+
"model": "github-copilot/gpt-5.4"
|
|
37
|
+
},
|
|
38
|
+
"strength": "balanced",
|
|
39
|
+
"roles": ["complex-reasoning", "architecture", "planning"]
|
|
40
|
+
},
|
|
41
|
+
"Autopilot-Wingman-GH-Gemini31": {
|
|
42
|
+
"description": "Google Gemini Pro for multimodal tasks",
|
|
43
|
+
"model": {
|
|
44
|
+
"provider": "github-copilot",
|
|
45
|
+
"model": "github-copilot/gemini-3.1-pro-preview"
|
|
46
|
+
},
|
|
47
|
+
"strength": "aggressive",
|
|
48
|
+
"roles": ["large-context", "documentation", "research"]
|
|
49
|
+
},
|
|
50
|
+
"Autopilot-Wingman-GH-Sonnet46": {
|
|
51
|
+
"description": "Claude Sonnet for careful, thorough work",
|
|
52
|
+
"model": {
|
|
53
|
+
"provider": "github-copilot",
|
|
54
|
+
"model": "github-copilot/claude-sonnet-4.6"
|
|
55
|
+
},
|
|
56
|
+
"strength": "conservative",
|
|
57
|
+
"roles": ["code-review", "validation", "safety-critical"]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"routing": {
|
|
61
|
+
"default": "Autopilot-Wingman-Kimi25",
|
|
62
|
+
"rules": [
|
|
63
|
+
{
|
|
64
|
+
"taskPattern": "test|spec|validate",
|
|
65
|
+
"wingman": "Autopilot-Wingman-GH-Sonnet46"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"taskPattern": "refactor|clean|simplify",
|
|
69
|
+
"wingman": "Autopilot-Wingman-Kimi25"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"taskPattern": "document|readme|explain",
|
|
73
|
+
"wingman": "Autopilot-Wingman-GH-Gemini31"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"taskPattern": "quick|simple|draft",
|
|
77
|
+
"wingman": "Autopilot-Wingman-GLM51"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"taskPattern": "design|architecture|plan",
|
|
81
|
+
"wingman": "Autopilot-Wingman-GH-GPT54"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
}
|
package/README.md
CHANGED
|
@@ -10,6 +10,27 @@ npm install @withakay/opencode-autopilot
|
|
|
10
10
|
bun add @withakay/opencode-autopilot
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
### What gets installed for end users
|
|
14
|
+
|
|
15
|
+
On install, the package runs a postinstall script that provisions OpenCode assets into the consuming project:
|
|
16
|
+
|
|
17
|
+
- `.opencode/commands/autopilot.md` — the `/autopilot` slash command
|
|
18
|
+
- `.opencode/agents/Autopilot-Wingman-GLM51.md`
|
|
19
|
+
- `.opencode/agents/Autopilot-Wingman-Kimi25.md`
|
|
20
|
+
- `.opencode/agents/Autopilot-Wingman-MiniMax25.md`
|
|
21
|
+
- `.opencode/agents/Autopilot-Wingman-GH-GPT54.md`
|
|
22
|
+
- `.opencode/agents/Autopilot-Wingman-GH-Gemini31.md`
|
|
23
|
+
- `.opencode/agents/Autopilot-Wingman-GH-Sonnet46.md`
|
|
24
|
+
- `.opencode/wingman-config.json` — routing/reference config for the packaged Wingman presets
|
|
25
|
+
|
|
26
|
+
The installer is non-destructive for Wingman assets:
|
|
27
|
+
|
|
28
|
+
- existing Wingman agent files are preserved if you have customized them
|
|
29
|
+
- existing `wingman-config.json` is preserved if you have customized it
|
|
30
|
+
- the `/autopilot` slash command is updated to the packaged version when it changes
|
|
31
|
+
|
|
32
|
+
This package does **not** dynamically register slash commands or agents through the plugin API. Instead, it installs the corresponding OpenCode markdown assets into your project so they are available to end users immediately.
|
|
33
|
+
|
|
13
34
|
## Usage
|
|
14
35
|
|
|
15
36
|
Register the plugin in your `opencode.jsonc`:
|
|
@@ -37,6 +58,25 @@ After registering the plugin, the primary UX is:
|
|
|
37
58
|
- **`/autopilot status`** — inspect current state
|
|
38
59
|
- **`/autopilot <task>`** — enable autopilot and delegate a long-running task immediately
|
|
39
60
|
|
|
61
|
+
### Packaged Wingman agents
|
|
62
|
+
|
|
63
|
+
The package also installs a set of reusable Wingman agents in `.opencode/agents/` for delegated work. These can be referenced by name when you want autopilot to use a specific worker agent.
|
|
64
|
+
|
|
65
|
+
Available packaged agents:
|
|
66
|
+
|
|
67
|
+
- `Autopilot-Wingman-GLM51`
|
|
68
|
+
- `Autopilot-Wingman-Kimi25`
|
|
69
|
+
- `Autopilot-Wingman-MiniMax25`
|
|
70
|
+
- `Autopilot-Wingman-GH-GPT54`
|
|
71
|
+
- `Autopilot-Wingman-GH-Gemini31`
|
|
72
|
+
- `Autopilot-Wingman-GH-Sonnet46`
|
|
73
|
+
|
|
74
|
+
Example direct tool usage with a packaged Wingman:
|
|
75
|
+
|
|
76
|
+
- `autopilot(task="Fix the failing tests", workerAgent="Autopilot-Wingman-GH-Sonnet46")`
|
|
77
|
+
- `autopilot(task="Refactor the reducer logic", workerAgent="Autopilot-Wingman-Kimi25")`
|
|
78
|
+
- `autopilot(task="Summarize the architecture", workerAgent="Autopilot-Wingman-GH-Gemini31")`
|
|
79
|
+
|
|
40
80
|
If you prefer to call the tool directly, use:
|
|
41
81
|
|
|
42
82
|
```jsonc
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@withakay/opencode-autopilot",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Autopilot mode plugin for OpenCode - autonomous multi-step task execution with safety guarantees",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
|
-
"README.md"
|
|
17
|
+
"README.md",
|
|
18
|
+
".opencode/commands/autopilot.md",
|
|
19
|
+
".opencode/agents/*.md",
|
|
20
|
+
".opencode/wingman-config.json",
|
|
21
|
+
"scripts/install-slash-command.mjs"
|
|
18
22
|
],
|
|
19
23
|
"scripts": {
|
|
20
24
|
"build": "bun build ./index.ts --outdir ./dist --target node --sourcemap --external @opencode-ai/plugin --external @opencode-ai/sdk",
|
|
@@ -23,7 +27,8 @@
|
|
|
23
27
|
"lint": "biome check .",
|
|
24
28
|
"format": "biome format . --write",
|
|
25
29
|
"check": "bun run lint && bun run typecheck",
|
|
26
|
-
"prepublishOnly": "bun run build"
|
|
30
|
+
"prepublishOnly": "bun run build",
|
|
31
|
+
"postinstall": "node scripts/install-slash-command.mjs"
|
|
27
32
|
},
|
|
28
33
|
"keywords": [
|
|
29
34
|
"opencode",
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { copyFile, mkdir, readdir, readFile } from "node:fs/promises";
|
|
5
|
+
import { dirname, join, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
|
|
11
|
+
async function findProjectRoot() {
|
|
12
|
+
let projectRoot = process.cwd();
|
|
13
|
+
|
|
14
|
+
for (let i = 0; i < 10; i += 1) {
|
|
15
|
+
if (existsSync(join(projectRoot, "package.json"))) {
|
|
16
|
+
return projectRoot;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const parent = dirname(projectRoot);
|
|
20
|
+
if (parent === projectRoot) {
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
projectRoot = parent;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function copyManagedFile(sourceFile, targetFile, options = {}) {
|
|
30
|
+
const { updateIfDifferent = true, label = targetFile } = options;
|
|
31
|
+
|
|
32
|
+
if (!existsSync(sourceFile)) {
|
|
33
|
+
console.log(`⚠️ Missing packaged asset: ${sourceFile}`);
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
await mkdir(dirname(targetFile), { recursive: true });
|
|
38
|
+
|
|
39
|
+
if (existsSync(targetFile)) {
|
|
40
|
+
const [existing, source] = await Promise.all([
|
|
41
|
+
readFile(targetFile, "utf-8"),
|
|
42
|
+
readFile(sourceFile, "utf-8"),
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
if (existing === source) {
|
|
46
|
+
console.log(`✅ ${label} already up to date`);
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (!updateIfDifferent) {
|
|
51
|
+
console.log(`ℹ️ Preserving existing ${label}`);
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
console.log(`📝 Updating ${label}...`);
|
|
56
|
+
} else {
|
|
57
|
+
console.log(`🚀 Installing ${label}...`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
await copyFile(sourceFile, targetFile);
|
|
61
|
+
console.log(`✅ Installed ${label} to: ${targetFile}`);
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function installAssets() {
|
|
66
|
+
try {
|
|
67
|
+
const projectRoot = await findProjectRoot();
|
|
68
|
+
if (!projectRoot) {
|
|
69
|
+
console.log("⚠️ Could not find project root (no package.json found)");
|
|
70
|
+
console.log(" Skipping OpenCode asset installation");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const packageOpencodeRoot = resolve(__dirname, "..", ".opencode");
|
|
75
|
+
const projectOpencodeRoot = join(projectRoot, ".opencode");
|
|
76
|
+
|
|
77
|
+
const slashCommandSource = join(packageOpencodeRoot, "commands", "autopilot.md");
|
|
78
|
+
const slashCommandTarget = join(projectOpencodeRoot, "commands", "autopilot.md");
|
|
79
|
+
|
|
80
|
+
await copyManagedFile(slashCommandSource, slashCommandTarget, {
|
|
81
|
+
updateIfDifferent: true,
|
|
82
|
+
label: "autopilot slash command",
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const wingmanConfigSource = join(packageOpencodeRoot, "wingman-config.json");
|
|
86
|
+
const wingmanConfigTarget = join(projectOpencodeRoot, "wingman-config.json");
|
|
87
|
+
|
|
88
|
+
await copyManagedFile(wingmanConfigSource, wingmanConfigTarget, {
|
|
89
|
+
updateIfDifferent: false,
|
|
90
|
+
label: "Wingman config",
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const packagedAgentsDir = join(packageOpencodeRoot, "agents");
|
|
94
|
+
if (!existsSync(packagedAgentsDir)) {
|
|
95
|
+
console.log("⚠️ No packaged Wingman agents directory found");
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const agentFiles = (await readdir(packagedAgentsDir)).filter((name) => name.endsWith(".md"));
|
|
100
|
+
const projectAgentsDir = join(projectOpencodeRoot, "agents");
|
|
101
|
+
await mkdir(projectAgentsDir, { recursive: true });
|
|
102
|
+
|
|
103
|
+
for (const agentFile of agentFiles) {
|
|
104
|
+
await copyManagedFile(join(packagedAgentsDir, agentFile), join(projectAgentsDir, agentFile), {
|
|
105
|
+
updateIfDifferent: false,
|
|
106
|
+
label: `Wingman agent ${agentFile}`,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
console.log("✅ OpenCode autopilot assets installed");
|
|
111
|
+
console.log(" Available slash command: /autopilot on");
|
|
112
|
+
console.log(" Available Wingman agents: see .opencode/agents/");
|
|
113
|
+
} catch (error) {
|
|
114
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
115
|
+
console.error("❌ Failed to install OpenCode assets:", message);
|
|
116
|
+
console.log(" You can manually copy assets from the package .opencode directory.");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
installAssets();
|