opencode-pilot 0.2.1 → 0.3.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/examples/config.yaml
CHANGED
|
@@ -24,7 +24,7 @@ tools:
|
|
|
24
24
|
# SOURCES - What to poll (generic MCP tool references)
|
|
25
25
|
# =============================================================================
|
|
26
26
|
sources:
|
|
27
|
-
# GitHub issues assigned to me
|
|
27
|
+
# GitHub issues assigned to me
|
|
28
28
|
- name: my-issues
|
|
29
29
|
tool:
|
|
30
30
|
mcp: github
|
|
@@ -33,7 +33,7 @@ sources:
|
|
|
33
33
|
q: "is:issue assignee:@me state:open"
|
|
34
34
|
item:
|
|
35
35
|
id: "{html_url}"
|
|
36
|
-
prompt:
|
|
36
|
+
prompt: worktree
|
|
37
37
|
agent: plan
|
|
38
38
|
|
|
39
39
|
# GitHub PRs needing review
|
|
@@ -48,7 +48,7 @@ sources:
|
|
|
48
48
|
prompt: review
|
|
49
49
|
agent: plan
|
|
50
50
|
|
|
51
|
-
# Linear issues
|
|
51
|
+
# Linear issues
|
|
52
52
|
# NOTE: Replace teamId and assigneeId with your actual Linear UUIDs
|
|
53
53
|
# Find these via: linear_list_teams and check user IDs in team members
|
|
54
54
|
- name: linear-work
|
|
@@ -62,5 +62,5 @@ sources:
|
|
|
62
62
|
item:
|
|
63
63
|
id: "linear:{id}"
|
|
64
64
|
working_dir: ~/code/myproject
|
|
65
|
-
prompt:
|
|
65
|
+
prompt: worktree
|
|
66
66
|
agent: plan
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Work on this issue:
|
|
2
|
+
|
|
3
|
+
{title}
|
|
4
|
+
|
|
5
|
+
{body}
|
|
6
|
+
|
|
7
|
+
First, create a git worktree for this work:
|
|
8
|
+
1. Create branch `issue-{number}` if it doesn't exist
|
|
9
|
+
2. Create a worktree at `../$(basename $PWD)-issue-{number}`
|
|
10
|
+
3. Switch to that worktree directory
|
|
11
|
+
|
|
12
|
+
Follow TDD: write failing tests first, then implement. Create a PR when complete.
|
package/package.json
CHANGED
package/plugin/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// The plugin checks if the daemon is running and starts it if needed.
|
|
5
5
|
|
|
6
6
|
import { existsSync, readFileSync } from 'fs'
|
|
7
|
+
import { spawn } from 'child_process'
|
|
7
8
|
import { join } from 'path'
|
|
8
9
|
import { homedir } from 'os'
|
|
9
10
|
import YAML from 'yaml'
|
|
@@ -33,7 +34,7 @@ function getPort() {
|
|
|
33
34
|
/**
|
|
34
35
|
* OpenCode plugin that auto-starts the daemon if not running
|
|
35
36
|
*/
|
|
36
|
-
export const PilotPlugin = async (
|
|
37
|
+
export const PilotPlugin = async () => {
|
|
37
38
|
const port = getPort()
|
|
38
39
|
|
|
39
40
|
try {
|
|
@@ -46,11 +47,15 @@ export const PilotPlugin = async ({ $ }) => {
|
|
|
46
47
|
return {}
|
|
47
48
|
}
|
|
48
49
|
} catch {
|
|
49
|
-
// Not running, start it
|
|
50
|
+
// Not running, start it as detached background process
|
|
50
51
|
try {
|
|
51
|
-
|
|
52
|
+
const child = spawn('npx', ['opencode-pilot', 'start'], {
|
|
53
|
+
detached: true,
|
|
54
|
+
stdio: 'ignore',
|
|
55
|
+
})
|
|
56
|
+
child.unref()
|
|
52
57
|
} catch {
|
|
53
|
-
// Ignore start errors
|
|
58
|
+
// Ignore start errors
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
61
|
|