backeer-opencode 0.1.1 → 0.1.3
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/CHANGELOG.md +16 -0
- package/README.md +40 -2
- package/bin/backeer-opencode.js +1 -1
- package/dist/backeer-permission.js +730 -0
- package/package.json +9 -2
- package/src/config.js +56 -0
- package/src/event-publishers.js +214 -0
- package/src/http.js +87 -0
- package/src/index.js +1 -716
- package/src/permission-controller.js +183 -0
- package/src/plugin.js +143 -0
- package/src/reporter.js +60 -0
- package/src/sse.js +139 -0
- package/src/utilities.js +25 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `backeer-opencode` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.1.3 - 2026-09-01
|
|
6
|
+
|
|
7
|
+
- Split configuration, logging, HTTP, SSE, event publishing, and permission
|
|
8
|
+
command handling into focused source modules.
|
|
9
|
+
- Keep the npm plugin entrypoint backward-compatible with a default export only.
|
|
10
|
+
- Add an esbuild-generated, dependency-free bundle for legacy side-loaded
|
|
11
|
+
installations.
|
|
12
|
+
|
|
13
|
+
## 0.1.2 - 2026-09-01
|
|
14
|
+
|
|
15
|
+
- Replace raw HTTP log lines with compact Backeer console status messages.
|
|
16
|
+
- Add restrained TTY colors with `NO_COLOR` support.
|
|
17
|
+
- Suppress repeated connection errors for 30 seconds.
|
|
18
|
+
- Add `BACKEER_LOG_LEVEL` and the `logLevel` plugin option.
|
|
19
|
+
- Keep technical HTTP and error details in debug mode only.
|
|
20
|
+
|
|
5
21
|
## 0.1.1 - 2026-09-01
|
|
6
22
|
|
|
7
23
|
- Add `backeer-opencode configure` for hidden interactive token entry.
|
package/README.md
CHANGED
|
@@ -109,6 +109,7 @@ environment variables are supported:
|
|
|
109
109
|
| `BACKEER_NOTIFY_PERMISSIONS` | Set to `false` to disable permission notifications and remote replies |
|
|
110
110
|
| `BACKEER_NOTIFY_QUESTIONS` | Set to `false` to disable question notifications |
|
|
111
111
|
| `BACKEER_NOTIFY_TODOS` | Set to `false` to disable todo-completion notifications |
|
|
112
|
+
| `BACKEER_LOG_LEVEL` | `info` (default), `error`, `debug`, or `silent` |
|
|
112
113
|
|
|
113
114
|
For npm installations, non-secret options can also be supplied through the
|
|
114
115
|
OpenCode plugin tuple syntax:
|
|
@@ -128,8 +129,25 @@ OpenCode plugin tuple syntax:
|
|
|
128
129
|
}
|
|
129
130
|
```
|
|
130
131
|
|
|
131
|
-
Supported options are `origin`, `tokenFile`, `permissions`, `questions`,
|
|
132
|
-
`todos`. The token itself is deliberately not a plugin option.
|
|
132
|
+
Supported options are `origin`, `tokenFile`, `permissions`, `questions`,
|
|
133
|
+
`todos`, and `logLevel`. The token itself is deliberately not a plugin option.
|
|
134
|
+
|
|
135
|
+
## Console feedback
|
|
136
|
+
|
|
137
|
+
The plugin writes compact, single-line status messages instead of raw HTTP logs:
|
|
138
|
+
|
|
139
|
+
```text
|
|
140
|
+
◆ Backeer Permission request sent
|
|
141
|
+
◆ Backeer Question sent
|
|
142
|
+
◆ Backeer Todo completion sent
|
|
143
|
+
✓ Backeer Decision applied: Always allow
|
|
144
|
+
! Backeer Connection interrupted — retrying
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
TTY output uses restrained status colors and respects `NO_COLOR`. Repeated
|
|
148
|
+
connection errors are suppressed for 30 seconds. Normal `info` output omits HTTP
|
|
149
|
+
status codes and internal errors; set `BACKEER_LOG_LEVEL=debug` when technical
|
|
150
|
+
details are needed. Set it to `error` for failures only or `silent` for no output.
|
|
133
151
|
|
|
134
152
|
## Events and decisions
|
|
135
153
|
|
|
@@ -156,6 +174,26 @@ npm run pack:check
|
|
|
156
174
|
npm run publish:check
|
|
157
175
|
```
|
|
158
176
|
|
|
177
|
+
## Development architecture
|
|
178
|
+
|
|
179
|
+
The npm plugin runs from the modular source in `src`. Configuration, console
|
|
180
|
+
reporting, HTTP transport, SSE consumption, event publishing, permission command
|
|
181
|
+
handling, and OpenCode event routing are kept in separate modules. The package
|
|
182
|
+
root continues to expose only the default OpenCode plugin entrypoint.
|
|
183
|
+
|
|
184
|
+
The legacy side-loaded installer still deploys one dependency-free file. Build
|
|
185
|
+
that generated artifact before running the installer directly from a source
|
|
186
|
+
checkout:
|
|
187
|
+
|
|
188
|
+
```sh
|
|
189
|
+
npm install
|
|
190
|
+
npm run build
|
|
191
|
+
node bin/backeer-opencode.js
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
`npm test`, `npm pack`, and `npm publish` build the side-loaded artifact
|
|
195
|
+
automatically. Do not edit `dist/backeer-permission.js` by hand.
|
|
196
|
+
|
|
159
197
|
## Publishing
|
|
160
198
|
|
|
161
199
|
Maintainers can publish a release after authenticating the `Backeer` npm
|
package/bin/backeer-opencode.js
CHANGED
|
@@ -173,7 +173,7 @@ const configDirectory = resolve(arguments_.configDir ?? defaultConfigDirectory()
|
|
|
173
173
|
const pluginDirectory = join(configDirectory, "plugins")
|
|
174
174
|
const secretPath = join(configDirectory, "secrets", "backeer-ingest-token")
|
|
175
175
|
const packageDirectory = resolve(dirname(fileURLToPath(import.meta.url)), "..")
|
|
176
|
-
const sourcePath = join(packageDirectory, "
|
|
176
|
+
const sourcePath = join(packageDirectory, "dist", "backeer-permission.js")
|
|
177
177
|
// Keep the legacy filename so upgrading an existing Backeer installation
|
|
178
178
|
// replaces it instead of loading two copies of the same plugin.
|
|
179
179
|
const installedPath = join(pluginDirectory, "backeer-permission.js")
|