Skip to content

Commit 07e4c23

Browse files
committed
refactor!: convert from CLI to OpenCode plugin
BREAKING CHANGE: Complete rewrite from standalone TypeScript CLI to OpenCode plugin architecture. - Add three autonomous agents: opencoder, opencoder-planner, opencoder-builder - Add postinstall.mjs to copy agents to ~/.config/opencode/agents/ - Remove all TypeScript CLI modules and test files - Remove OpenCode SDK dependency (agents use OpenCode directly) - Remove configuration system, ideas queue, and metrics tracking - Simplify CI/CD for plugin workflow with npm publish - Rename package from 'opencoder' to 'opencode-plugin-opencoder' - Reset version to 0.1.0 for fresh start as plugin Signed-off-by: leocavalcante <[email protected]>
1 parent b1b3e51 commit 07e4c23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+739
-14805
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,6 @@ on:
77
branches: [main]
88

99
jobs:
10-
build:
11-
strategy:
12-
matrix:
13-
os: [ubuntu-latest, macos-latest]
14-
runs-on: ${{ matrix.os }}
15-
16-
steps:
17-
- uses: actions/checkout@v4
18-
19-
- name: Setup Bun
20-
uses: oven-sh/setup-bun@v2
21-
with:
22-
bun-version: latest
23-
24-
- name: Install dependencies
25-
run: bun install
26-
27-
- name: Build
28-
run: bun run build
29-
30-
- name: Run tests
31-
run: bun test
32-
3310
lint:
3411
runs-on: ubuntu-latest
3512
steps:
@@ -44,32 +21,24 @@ jobs:
4421
run: bun install
4522

4623
- name: Check formatting and lint
47-
run: bunx biome check src/ tests/
24+
run: bunx biome check src/
4825

49-
coverage:
26+
test-postinstall:
5027
runs-on: ubuntu-latest
5128
steps:
5229
- uses: actions/checkout@v4
5330

54-
- name: Setup Bun
55-
uses: oven-sh/setup-bun@v2
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
5633
with:
57-
bun-version: latest
34+
node-version: '20'
5835

59-
- name: Install dependencies
60-
run: bun install
61-
62-
- name: Generate coverage report
63-
run: bun test --coverage --coverage-reporter=text --coverage-reporter=lcov
36+
- name: Test postinstall script
37+
run: node postinstall.mjs
6438

65-
- name: Display coverage summary
66-
run: cat coverage/coverage.txt || echo "Coverage report not available"
67-
68-
- name: Upload coverage to Codecov
69-
uses: codecov/codecov-action@v4
70-
with:
71-
files: ./coverage/lcov.info
72-
flags: unittests
73-
name: codecov-umbrella
74-
fail_ci_if_error: false
75-
verbose: true
39+
- name: Verify agents were installed
40+
run: |
41+
test -f ~/.config/opencode/agents/opencoder.md
42+
test -f ~/.config/opencode/agents/opencoder-planner.md
43+
test -f ~/.config/opencode/agents/opencoder-builder.md
44+
echo "All agents installed successfully"

.github/workflows/release.yml

Lines changed: 17 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,8 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
build:
13-
strategy:
14-
matrix:
15-
include:
16-
- os: ubuntu-latest
17-
target: bun-linux-x64
18-
artifact: opencoder-linux-x64
19-
- os: ubuntu-latest
20-
target: bun-linux-arm64
21-
artifact: opencoder-linux-arm64
22-
- os: macos-latest
23-
target: bun-darwin-x64
24-
artifact: opencoder-darwin-x64
25-
- os: macos-latest
26-
target: bun-darwin-arm64
27-
artifact: opencoder-darwin-arm64
28-
runs-on: ${{ matrix.os }}
29-
12+
publish:
13+
runs-on: ubuntu-latest
3014
steps:
3115
- uses: actions/checkout@v4
3216

@@ -35,49 +19,27 @@ jobs:
3519
with:
3620
bun-version: latest
3721

22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
registry-url: 'https://registry.npmjs.org'
27+
3828
- name: Install dependencies
3929
run: bun install
4030

41-
- name: Build release
42-
run: bun build --compile --minify --target=${{ matrix.target }} src/index.ts --outfile ${{ matrix.artifact }}
43-
44-
- name: Calculate checksum (Linux)
45-
if: runner.os == 'Linux'
46-
run: sha256sum ${{ matrix.artifact }} > ${{ matrix.artifact }}.sha256
47-
48-
- name: Calculate checksum (macOS)
49-
if: runner.os == 'macOS'
50-
run: shasum -a 256 ${{ matrix.artifact }} > ${{ matrix.artifact }}.sha256
31+
- name: Run linter
32+
run: bunx biome check src/
5133

52-
- name: Upload artifact
53-
uses: actions/upload-artifact@v4
54-
with:
55-
name: ${{ matrix.artifact }}
56-
path: |
57-
${{ matrix.artifact }}
58-
${{ matrix.artifact }}.sha256
59-
60-
release:
61-
needs: build
62-
runs-on: ubuntu-latest
63-
steps:
64-
- name: Download all artifacts
65-
uses: actions/download-artifact@v4
66-
with:
67-
path: artifacts
68-
merge-multiple: true
34+
- name: Test postinstall script
35+
run: node postinstall.mjs
6936

70-
- name: Create checksums.txt
71-
working-directory: artifacts
72-
run: cat *.sha256 > checksums.txt
37+
- name: Publish to npm
38+
run: npm publish --access public
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7341

74-
- name: Create release
42+
- name: Create GitHub Release
7543
uses: softprops/action-gh-release@v2
7644
with:
77-
files: |
78-
artifacts/opencoder-linux-x64
79-
artifacts/opencoder-linux-arm64
80-
artifacts/opencoder-darwin-x64
81-
artifacts/opencoder-darwin-arm64
82-
artifacts/checksums.txt
8345
generate_release_notes: true

.gitignore

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
1-
# OpenCoder state and logs (config.json is user-managed)
2-
.opencode/opencoder/state.json
3-
.opencode/opencoder/current_plan.md
4-
.opencode/opencoder/metrics.json
5-
.opencode/opencoder/logs/
6-
.opencode/opencoder/history/
7-
.opencode/opencoder/alerts.log
8-
9-
# Bun
1+
# Dependencies
102
node_modules/
113
bun.lockb
124

13-
# Build artifacts
14-
opencoder
15-
opencoder-*
16-
opencoder.exe
17-
dist/
18-
19-
# Zig build artifacts (legacy)
20-
.zig-cache/
21-
zig-out/
22-
235
# IDE and editor files
246
.vscode/
257
.idea/
@@ -32,13 +14,5 @@ zig-out/
3214
.env
3315
.env.local
3416

35-
# Coverage reports
36-
coverage/
37-
38-
# Testing artifacts
39-
test-results/
40-
41-
# Debug files
42-
*.dSYM/
43-
*.pdb
44-
*.map
17+
# OpenCode
18+
.opencode/

0 commit comments

Comments
 (0)