opencode-pilot 0.23.0 → 0.23.1

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.
@@ -5,7 +5,7 @@
5
5
  "ghcr.io/devcontainers/features/git:1": {},
6
6
  "ghcr.io/devcontainers/features/github-cli:1": {}
7
7
  },
8
- "postCreateCommand": "sudo apt-get update && sudo apt-get install -y bats ripgrep && npm install -g opencode-ai@latest",
8
+ "postCreateCommand": "sudo apt-get update && sudo apt-get install -y ripgrep && npm install -g opencode-ai@latest",
9
9
  "customizations": {
10
10
  "vscode": {
11
11
  "extensions": [
@@ -29,7 +29,7 @@ jobs:
29
29
 
30
30
  - name: Verify JavaScript syntax
31
31
  run: |
32
- for file in plugin/*.js; do
32
+ for file in plugin/*.js service/*.js; do
33
33
  echo "Checking $file..."
34
34
  node --check "$file"
35
35
  done
package/CONTRIBUTING.md CHANGED
@@ -1,4 +1,4 @@
1
- # Contributing to opencode-ntfy
1
+ # Contributing to opencode-pilot
2
2
 
3
3
  Thanks for your interest in contributing!
4
4
 
@@ -6,84 +6,75 @@ Thanks for your interest in contributing!
6
6
 
7
7
  1. Clone the repository:
8
8
  ```bash
9
- git clone https://github.com/athal7/opencode-ntfy.git
10
- cd opencode-ntfy
9
+ git clone https://github.com/athal7/opencode-pilot.git
10
+ cd opencode-pilot
11
11
  ```
12
12
 
13
- 2. Install the plugin locally for testing:
13
+ 2. Install dependencies:
14
14
  ```bash
15
- ./install.sh
16
- ```
17
-
18
- 3. Set required environment variables:
19
- ```bash
20
- export NTFY_TOPIC=your-test-topic
15
+ npm install
21
16
  ```
22
17
 
23
18
  ## Running Tests
24
19
 
25
- Run the full test suite:
26
20
  ```bash
27
- ./test/run_tests.bash
21
+ npm test # Unit tests
22
+ npm run test:integration # Integration tests
23
+ npm run test:all # All tests
28
24
  ```
29
25
 
30
- The test suite includes:
31
- - **File structure tests** - Verify all plugin files exist
32
- - **Syntax validation** - Run `node --check` on all JS files
33
- - **Export structure tests** - Verify expected functions are exported
34
- - **Integration tests** - Test plugin loads in OpenCode without hanging (requires opencode CLI)
26
+ Tests use the Node.js built-in test runner (`node:test`) with `node:assert`.
35
27
 
36
28
  ## Writing Tests
37
29
 
38
- Tests live in `test/` using bash test helpers from `test_helper.bash`.
30
+ Tests live in `test/unit/` and `test/integration/`. Each test file follows this pattern:
39
31
 
40
- Example test:
41
- ```bash
42
- test_my_feature() {
43
- # Use assertions from test_helper.bash
44
- assert_file_exists "$PLUGIN_DIR/myfile.js"
45
- assert_contains "$output" "expected string"
46
- }
47
-
48
- # Register and run
49
- run_test "my_feature" "test_my_feature"
50
- ```
32
+ ```js
33
+ import { test, describe } from 'node:test';
34
+ import assert from 'node:assert';
51
35
 
52
- For JavaScript unit tests, use Node.js inline:
53
- ```bash
54
- test_function_works() {
55
- node --input-type=module -e "
56
- import { myFunction } from '../plugin/module.js';
57
- if (myFunction() !== 'expected') throw new Error('Failed');
58
- console.log('PASS');
59
- " || return 1
60
- }
36
+ describe('myModule', () => {
37
+ test('does the thing', () => {
38
+ assert.strictEqual(actual, expected);
39
+ });
40
+ });
61
41
  ```
62
42
 
63
43
  ## Code Style
64
44
 
65
45
  - Use ES modules (`import`/`export`)
66
46
  - Use `async`/`await` for async operations
67
- - Log with `[opencode-ntfy]` prefix
47
+ - Log with `[opencode-pilot]` prefix
68
48
  - Handle errors gracefully (log, don't crash OpenCode)
69
- - No external dependencies (use Node.js built-ins only)
49
+ - No external dependencies beyond what's in `package.json`
70
50
 
71
- ## Plugin Architecture
51
+ ## Project Architecture
72
52
 
73
53
  ```
74
54
  plugin/
75
- ├── index.js # Main entry point, event handlers
76
- ├── notifier.js # ntfy HTTP client
77
- ├── callback.js # HTTP callback server for interactive responses
78
- ├── hostname.js # Callback host discovery (Tailscale, env, localhost)
79
- └── nonces.js # Single-use nonces for callback authentication
55
+ └── index.js # OpenCode plugin entry point (auto-starts daemon)
56
+ service/
57
+ ├── server.js # HTTP server and polling orchestration
58
+ ├── poll-service.js # Polling lifecycle management
59
+ ├── poller.js # MCP tool polling
60
+ ├── actions.js # Session creation and template expansion
61
+ ├── readiness.js # Evaluate item readiness (labels, deps, priority)
62
+ ├── worktree.js # Git worktree management
63
+ ├── repo-config.js # Repository discovery and config
64
+ ├── logger.js # Debug logging
65
+ ├── utils.js # Shared utilities
66
+ ├── version.js # Package version detection
67
+ └── presets/
68
+ ├── index.js # Preset loader
69
+ ├── github.yaml # GitHub source presets
70
+ └── linear.yaml # Linear source presets
80
71
  ```
81
72
 
82
73
  ## Submitting Changes
83
74
 
84
75
  1. Create a feature branch: `git checkout -b my-feature`
85
76
  2. Make your changes
86
- 3. Run tests: `./test/run_tests.bash`
77
+ 3. Run tests: `npm test`
87
78
  4. Commit with a clear message following conventional commits:
88
79
  - `feat(#1): add idle notifications`
89
80
  - `fix(#3): handle network timeout`
@@ -91,12 +82,10 @@ plugin/
91
82
 
92
83
  ## Releasing
93
84
 
94
- Releases are automated via GitHub Actions. To create a release:
95
-
96
- 1. Tag the commit: `git tag v1.0.0`
97
- 2. Push the tag: `git push origin v1.0.0`
85
+ Releases are automated via [semantic-release](https://github.com/semantic-release/semantic-release) on merge to `main`. The CI pipeline will:
98
86
 
99
- The release workflow will:
100
87
  1. Run tests
101
- 2. Create a tarball
102
- 3. Create a GitHub release with release notes
88
+ 2. Determine the next version from commit messages
89
+ 3. Publish to npm
90
+ 4. Create a GitHub release
91
+ 5. Update the Homebrew formula
@@ -1,8 +1,8 @@
1
1
  class OpencodePilot < Formula
2
2
  desc "Automation daemon for OpenCode - polls GitHub/Linear issues and spawns sessions"
3
3
  homepage "https://github.com/athal7/opencode-pilot"
4
- url "https://github.com/athal7/opencode-pilot/archive/refs/tags/v0.22.0.tar.gz"
5
- sha256 "b4437190cab6bff8c03ab93b6d70c8de7ccb3e396decc36b460d53f3ee482dde"
4
+ url "https://github.com/athal7/opencode-pilot/archive/refs/tags/v0.23.0.tar.gz"
5
+ sha256 "1d245b1ea0ec5db353b5558fe2dbb59de727983775464ea61d807cdbd8061087"
6
6
  license "MIT"
7
7
 
8
8
  depends_on "node"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-pilot",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "type": "module",
5
5
  "main": "plugin/index.js",
6
6
  "description": "Automation daemon for OpenCode - polls for work and spawns sessions",