backeer-opencode 0.1.2 → 0.1.4

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 CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to `backeer-opencode` are documented here.
4
4
 
5
+ ## 0.1.4 - 2026-09-01
6
+
7
+ - Add `/backeer` and `/backeer status` for an in-session integration report.
8
+ - Add secure, immediate token rotation with `/backeer token-file PATH`.
9
+ - Keep raw tokens out of slash-command arguments, session messages, and logs.
10
+ - Keep the management command available when notifications are disabled by a
11
+ missing token.
12
+
13
+ ## 0.1.3 - 2026-09-01
14
+
15
+ - Split configuration, logging, HTTP, SSE, event publishing, and permission
16
+ command handling into focused source modules.
17
+ - Keep the npm plugin entrypoint backward-compatible with a default export only.
18
+ - Add an esbuild-generated, dependency-free bundle for legacy side-loaded
19
+ installations.
20
+
5
21
  ## 0.1.2 - 2026-09-01
6
22
 
7
23
  - Replace raw HTTP log lines with compact Backeer console status messages.
package/README.md CHANGED
@@ -149,6 +149,30 @@ connection errors are suppressed for 30 seconds. Normal `info` output omits HTTP
149
149
  status codes and internal errors; set `BACKEER_LOG_LEVEL=debug` when technical
150
150
  details are needed. Set it to `error` for failures only or `silent` for no output.
151
151
 
152
+ ## OpenCode command
153
+
154
+ The plugin registers a `/backeer` command inside OpenCode:
155
+
156
+ ```text
157
+ /backeer
158
+ /backeer status
159
+ /backeer token
160
+ /backeer token-file /absolute/path/to/a/protected-token-file
161
+ ```
162
+
163
+ The status report shows the plugin version, gateway reachability, token source,
164
+ notification switches, command-stream state, pending permissions, and log level.
165
+ It never displays the token. Gateway reachability does not validate the source
166
+ credential.
167
+
168
+ `/backeer token` displays safe rotation instructions. Never paste a raw token
169
+ into slash-command arguments because OpenCode may retain command text in session
170
+ history. To rotate from inside OpenCode, first place the new token in an absolute
171
+ file readable only by its owner (`chmod 600`), then use `token-file`. The plugin
172
+ atomically copies it to the configured token location, applies mode `0600`, and
173
+ activates it immediately without restarting OpenCode. The source file is not
174
+ removed.
175
+
152
176
  ## Events and decisions
153
177
 
154
178
  The plugin publishes:
@@ -174,6 +198,26 @@ npm run pack:check
174
198
  npm run publish:check
175
199
  ```
176
200
 
201
+ ## Development architecture
202
+
203
+ The npm plugin runs from the modular source in `src`. Configuration, console
204
+ reporting, HTTP transport, SSE consumption, event publishing, permission command
205
+ handling, and OpenCode event routing are kept in separate modules. The package
206
+ root continues to expose only the default OpenCode plugin entrypoint.
207
+
208
+ The legacy side-loaded installer still deploys one dependency-free file. Build
209
+ that generated artifact before running the installer directly from a source
210
+ checkout:
211
+
212
+ ```sh
213
+ npm install
214
+ npm run build
215
+ node bin/backeer-opencode.js
216
+ ```
217
+
218
+ `npm test`, `npm pack`, and `npm publish` build the side-loaded artifact
219
+ automatically. Do not edit `dist/backeer-permission.js` by hand.
220
+
177
221
  ## Publishing
178
222
 
179
223
  Maintainers can publish a release after authenticating the `Backeer` npm
@@ -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, "src", "index.js")
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")