opencode-agy-bridge 0.1.0 → 0.2.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.
- package/README.md +93 -14
- package/package.json +7 -4
- package/plugin.js +2 -0
- package/provider.js +2 -0
package/README.md
CHANGED
|
@@ -21,26 +21,44 @@ opencode TUI
|
|
|
21
21
|
2. **Node.js ≥ 18** or **Bun ≥ 1.0**.
|
|
22
22
|
3. **OpenCode** `>= 1.15.x` (uses Vercel AI SDK v3).
|
|
23
23
|
|
|
24
|
-
## Installation
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
### 1. Automatic Installation (Recommended)
|
|
27
|
+
|
|
28
|
+
If you are using OpenCode's built-in plugin manager, **you do not need to run any commands** in your terminal. OpenCode can automatically fetch and install the package from npm if you specify the package name with its version in your `opencode.json` configuration file.
|
|
29
|
+
|
|
30
|
+
See the [Configuration](#configuration) section below for details.
|
|
31
|
+
|
|
32
|
+
### 2. Manual Global Installation
|
|
33
|
+
|
|
34
|
+
If you prefer to install it globally yourself using a package manager:
|
|
25
35
|
|
|
26
36
|
```bash
|
|
27
|
-
|
|
37
|
+
# Using npm
|
|
38
|
+
npm install -g opencode-agy-bridge
|
|
39
|
+
|
|
40
|
+
# Using Bun
|
|
41
|
+
bun install -g opencode-agy-bridge
|
|
42
|
+
|
|
43
|
+
# Using pnpm
|
|
44
|
+
pnpm add -g opencode-agy-bridge
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 3. Local Development Installation
|
|
48
|
+
|
|
49
|
+
If you prefer to build from source:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
git clone https://github.com/raultov/opencode-agy-bridge.git
|
|
28
53
|
cd opencode-agy-bridge
|
|
29
54
|
|
|
30
55
|
# Using Bun (recommended)
|
|
31
56
|
bun install
|
|
32
57
|
bun run build
|
|
33
|
-
bun test # verify
|
|
34
|
-
|
|
35
|
-
# Or using pnpm
|
|
36
|
-
pnpm install
|
|
37
|
-
pnpm run build
|
|
38
|
-
pnpm test
|
|
58
|
+
bun test # verify all tests pass
|
|
39
59
|
|
|
40
|
-
# Or using npm
|
|
41
|
-
|
|
42
|
-
npm run build
|
|
43
|
-
npm test
|
|
60
|
+
# Or using pnpm/npm
|
|
61
|
+
pnpm install && pnpm run build && pnpm test
|
|
44
62
|
```
|
|
45
63
|
|
|
46
64
|
## Features
|
|
@@ -49,7 +67,68 @@ npm test
|
|
|
49
67
|
|
|
50
68
|
## Configuration
|
|
51
69
|
|
|
52
|
-
Add to your `~/.config/opencode/opencode.json
|
|
70
|
+
Add the plugin and provider to your `~/.config/opencode/opencode.json` configuration file:
|
|
71
|
+
|
|
72
|
+
### For Automatic Installation (Hands-free)
|
|
73
|
+
|
|
74
|
+
Just add the package directly with the desired version tag. OpenCode will download and resolve it automatically from npm:
|
|
75
|
+
|
|
76
|
+
```jsonc
|
|
77
|
+
{
|
|
78
|
+
"plugin": [
|
|
79
|
+
// ...your existing plugins...
|
|
80
|
+
"opencode-agy-bridge@0.2.1"
|
|
81
|
+
],
|
|
82
|
+
"provider": {
|
|
83
|
+
// ...your existing providers...
|
|
84
|
+
"agy": {
|
|
85
|
+
"npm": "opencode-agy-bridge/provider",
|
|
86
|
+
"name": "Google Antigravity (via agy CLI)",
|
|
87
|
+
"options": {
|
|
88
|
+
"binary": "agy",
|
|
89
|
+
"timeoutMs": 300000
|
|
90
|
+
},
|
|
91
|
+
"models": {
|
|
92
|
+
"antigravity": {
|
|
93
|
+
"name": "Antigravity (server-selected Gemini)"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### For Manual Global Installation
|
|
102
|
+
|
|
103
|
+
```jsonc
|
|
104
|
+
{
|
|
105
|
+
"plugin": [
|
|
106
|
+
// ...your existing plugins...
|
|
107
|
+
"opencode-agy-bridge"
|
|
108
|
+
],
|
|
109
|
+
"provider": {
|
|
110
|
+
// ...your existing providers...
|
|
111
|
+
"agy": {
|
|
112
|
+
"npm": "opencode-agy-bridge/provider",
|
|
113
|
+
"name": "Google Antigravity (via agy CLI)",
|
|
114
|
+
"options": {
|
|
115
|
+
"binary": "agy",
|
|
116
|
+
"timeoutMs": 300000
|
|
117
|
+
},
|
|
118
|
+
"models": {
|
|
119
|
+
"antigravity": {
|
|
120
|
+
"name": "Antigravity (server-selected Gemini)"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
> [!NOTE]
|
|
129
|
+
> If OpenCode has trouble resolving the global module name directly, you can replace the module names with their absolute paths pointing to your global `node_modules` folder (e.g., `"/usr/local/lib/node_modules/opencode-agy-bridge/dist/plugin.js"` for the plugin and `"/usr/local/lib/node_modules/opencode-agy-bridge/dist/provider.js"` for the provider).
|
|
130
|
+
|
|
131
|
+
### For Local Development / Manual Installation
|
|
53
132
|
|
|
54
133
|
```jsonc
|
|
55
134
|
{
|
|
@@ -127,7 +206,7 @@ npm test
|
|
|
127
206
|
The project includes two GitHub Actions workflows:
|
|
128
207
|
|
|
129
208
|
- **CI (`ci.yml`):** Runs on push and pull requests to `main` or `master` to compile the project and execute all unit tests using Bun.
|
|
130
|
-
- **Release (`release.yml`):** Runs when a new
|
|
209
|
+
- **Release (`release.yml`):** Runs automatically when a new version tag matching `v*` (e.g., `v0.2.1`) is pushed to the repository. It automatically installs dependencies, builds, tests, and publishes the package to the public npm registry.
|
|
131
210
|
|
|
132
211
|
Note that both `npm` and `pnpm` share the same public registry (`registry.npmjs.org`), so a single publish step makes the package installable by both package managers.
|
|
133
212
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-agy-bridge",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"main": "./plugin.js",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"description": "OpenCode plugin + provider that routes LLM prompts to agy (Google Antigravity CLI)",
|
|
7
8
|
"exports": {
|
|
8
|
-
".": "./dist/
|
|
9
|
-
"./
|
|
9
|
+
".": "./dist/plugin.js",
|
|
10
|
+
"./provider": "./dist/provider.js"
|
|
10
11
|
},
|
|
11
12
|
"files": [
|
|
12
|
-
"dist"
|
|
13
|
+
"dist",
|
|
14
|
+
"plugin.js",
|
|
15
|
+
"provider.js"
|
|
13
16
|
],
|
|
14
17
|
"scripts": {
|
|
15
18
|
"build": "tsc",
|
package/plugin.js
ADDED
package/provider.js
ADDED