backeer-opencode 0.1.4 → 0.2.0
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 +19 -0
- package/README.md +60 -9
- package/dist/backeer-permission.js +553 -7
- package/package.json +2 -2
- package/src/config.js +45 -0
- package/src/lifecycle-controller.js +205 -0
- package/src/lifecycle-publishers.js +187 -0
- package/src/management.js +51 -5
- package/src/plugin.js +21 -1
- package/src/updates.js +136 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `backeer-opencode` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.2.0 - 2026-09-01
|
|
6
|
+
|
|
7
|
+
- Notify when an OpenCode assistant run completes successfully.
|
|
8
|
+
- Notify terminal session errors with redacted diagnostic summaries.
|
|
9
|
+
- Warn once when a session reaches its third retry attempt.
|
|
10
|
+
- Notify once per version when an OpenCode update is available.
|
|
11
|
+
- Add granular lifecycle configuration and lifecycle state to `/backeer status`.
|
|
12
|
+
- Use stable lifecycle event IDs and the completion sound for successful runs.
|
|
13
|
+
|
|
14
|
+
## 0.1.5 - 2026-09-01
|
|
15
|
+
|
|
16
|
+
- Check the NPM registry for a newer Backeer plugin version once per day.
|
|
17
|
+
- Notify the OpenCode agent once per session when an update is available.
|
|
18
|
+
- Add `/backeer update-check` for an explicit registry check.
|
|
19
|
+
- Add `/backeer update` to delegate an exact-version installation and
|
|
20
|
+
verification workflow to the OpenCode agent.
|
|
21
|
+
- Require the agent workflow to preserve the token and avoid `@latest` cache
|
|
22
|
+
ambiguity.
|
|
23
|
+
|
|
5
24
|
## 0.1.4 - 2026-09-01
|
|
6
25
|
|
|
7
26
|
- Add `/backeer` and `/backeer status` for an in-session integration report.
|
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# Backeer for OpenCode
|
|
2
2
|
|
|
3
3
|
`backeer-opencode` connects OpenCode to Backeer. It sends mobile notifications
|
|
4
|
-
for permission requests, questions,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
for permission requests, questions, completed todo lists, completed assistant
|
|
5
|
+
runs, session failures, prolonged retries, and OpenCode updates. While a
|
|
6
|
+
permission is pending, it also consumes an authenticated Backeer command stream
|
|
7
|
+
so an authorized user can answer **Allow once**, **Always allow**, or **Reject**
|
|
8
|
+
from the Backeer iOS application.
|
|
8
9
|
|
|
9
10
|
The plugin uses outbound HTTPS only. It does not start a server or require an
|
|
10
11
|
inbound firewall rule.
|
|
@@ -109,6 +110,13 @@ environment variables are supported:
|
|
|
109
110
|
| `BACKEER_NOTIFY_PERMISSIONS` | Set to `false` to disable permission notifications and remote replies |
|
|
110
111
|
| `BACKEER_NOTIFY_QUESTIONS` | Set to `false` to disable question notifications |
|
|
111
112
|
| `BACKEER_NOTIFY_TODOS` | Set to `false` to disable todo-completion notifications |
|
|
113
|
+
| `BACKEER_NOTIFY_LIFECYCLE` | Set to `false` to disable every lifecycle notification |
|
|
114
|
+
| `BACKEER_NOTIFY_SESSION_COMPLETED` | Set to `false` to disable successful-run notifications |
|
|
115
|
+
| `BACKEER_NOTIFY_SESSION_ERRORS` | Set to `false` to disable session-error notifications |
|
|
116
|
+
| `BACKEER_NOTIFY_SESSION_RETRIES` | Set to `false` to disable retry warnings |
|
|
117
|
+
| `BACKEER_NOTIFY_OPENCODE_UPDATES` | Set to `false` to disable OpenCode update notifications |
|
|
118
|
+
| `BACKEER_SESSION_COMPLETION_MIN_SECONDS` | Minimum run duration; defaults to `0` (every completion) |
|
|
119
|
+
| `BACKEER_RETRY_ATTEMPT_THRESHOLD` | First retry attempt that triggers a warning; defaults to `3` |
|
|
112
120
|
| `BACKEER_LOG_LEVEL` | `info` (default), `error`, `debug`, or `silent` |
|
|
113
121
|
|
|
114
122
|
For npm installations, non-secret options can also be supplied through the
|
|
@@ -122,7 +130,16 @@ OpenCode plugin tuple syntax:
|
|
|
122
130
|
{
|
|
123
131
|
"permissions": true,
|
|
124
132
|
"questions": true,
|
|
125
|
-
"todos": true
|
|
133
|
+
"todos": true,
|
|
134
|
+
"lifecycle": {
|
|
135
|
+
"enabled": true,
|
|
136
|
+
"completed": true,
|
|
137
|
+
"errors": true,
|
|
138
|
+
"retries": true,
|
|
139
|
+
"updates": true,
|
|
140
|
+
"completionMinSeconds": 0,
|
|
141
|
+
"retryAttemptThreshold": 3
|
|
142
|
+
}
|
|
126
143
|
}
|
|
127
144
|
]
|
|
128
145
|
]
|
|
@@ -130,7 +147,8 @@ OpenCode plugin tuple syntax:
|
|
|
130
147
|
```
|
|
131
148
|
|
|
132
149
|
Supported options are `origin`, `tokenFile`, `permissions`, `questions`,
|
|
133
|
-
`todos`, and `logLevel`.
|
|
150
|
+
`todos`, `lifecycle`, and `logLevel`. Use `"lifecycle": false` to disable the
|
|
151
|
+
entire lifecycle group. The token itself is deliberately not a plugin option.
|
|
134
152
|
|
|
135
153
|
## Console feedback
|
|
136
154
|
|
|
@@ -140,6 +158,9 @@ The plugin writes compact, single-line status messages instead of raw HTTP logs:
|
|
|
140
158
|
◆ Backeer Permission request sent
|
|
141
159
|
◆ Backeer Question sent
|
|
142
160
|
◆ Backeer Todo completion sent
|
|
161
|
+
◆ Backeer Task completion sent
|
|
162
|
+
◆ Backeer Retry warning sent
|
|
163
|
+
◆ Backeer Task failure sent
|
|
143
164
|
✓ Backeer Decision applied: Always allow
|
|
144
165
|
! Backeer Connection interrupted — retrying
|
|
145
166
|
```
|
|
@@ -156,14 +177,16 @@ The plugin registers a `/backeer` command inside OpenCode:
|
|
|
156
177
|
```text
|
|
157
178
|
/backeer
|
|
158
179
|
/backeer status
|
|
180
|
+
/backeer update-check
|
|
181
|
+
/backeer update
|
|
159
182
|
/backeer token
|
|
160
183
|
/backeer token-file /absolute/path/to/a/protected-token-file
|
|
161
184
|
```
|
|
162
185
|
|
|
163
186
|
The status report shows the plugin version, gateway reachability, token source,
|
|
164
|
-
notification switches, command-stream state, pending
|
|
165
|
-
It never displays the token. Gateway reachability
|
|
166
|
-
credential.
|
|
187
|
+
notification switches and lifecycle thresholds, command-stream state, pending
|
|
188
|
+
permissions, and log level. It never displays the token. Gateway reachability
|
|
189
|
+
does not validate the source credential.
|
|
167
190
|
|
|
168
191
|
`/backeer token` displays safe rotation instructions. Never paste a raw token
|
|
169
192
|
into slash-command arguments because OpenCode may retain command text in session
|
|
@@ -173,6 +196,19 @@ atomically copies it to the configured token location, applies mode `0600`, and
|
|
|
173
196
|
activates it immediately without restarting OpenCode. The source file is not
|
|
174
197
|
removed.
|
|
175
198
|
|
|
199
|
+
The plugin checks the NPM registry at most once every 24 hours. When a newer
|
|
200
|
+
version exists, it adds one synthetic update notice to each OpenCode session so
|
|
201
|
+
the agent can inform the user. The notice never authorizes installation by
|
|
202
|
+
itself.
|
|
203
|
+
|
|
204
|
+
`/backeer update-check` performs an explicit check. `/backeer update` is the
|
|
205
|
+
user authorization point: it gives the OpenCode agent an exact-version install
|
|
206
|
+
command, requires verification of both the global version pin and package
|
|
207
|
+
cache, and forbids reading or changing the Backeer token. The agent does not
|
|
208
|
+
terminate the active OpenCode process; restart OpenCode after a successful
|
|
209
|
+
update. Exact versions are used instead of `@latest` to avoid stale OpenCode
|
|
210
|
+
package caches.
|
|
211
|
+
|
|
176
212
|
## Events and decisions
|
|
177
213
|
|
|
178
214
|
The plugin publishes:
|
|
@@ -183,6 +219,21 @@ The plugin publishes:
|
|
|
183
219
|
| `question.asked` | Notification-only question card |
|
|
184
220
|
| `question.v2.asked` | Notification-only question card, including plan-mode questions |
|
|
185
221
|
| `todo.updated` | One notification when a non-empty list transitions to fully completed |
|
|
222
|
+
| `message.updated` + `session.status`/`session.idle` | One notification for each successfully completed assistant run |
|
|
223
|
+
| `session.error` | Critical failure notification with a redacted error summary |
|
|
224
|
+
| `session.status` (`retry`) | One warning when the configured retry threshold is reached |
|
|
225
|
+
| `installation.update-available` | One notification per available OpenCode version |
|
|
226
|
+
|
|
227
|
+
Completion requires a completed, error-free assistant message in the current
|
|
228
|
+
busy cycle. An idle event caused by a pending permission or question is not
|
|
229
|
+
reported as successful. Repeated idle callbacks, retry callbacks, error events,
|
|
230
|
+
and update events use stable correlation IDs so they do not create duplicate
|
|
231
|
+
push notifications.
|
|
232
|
+
|
|
233
|
+
Lifecycle payloads intentionally omit command arguments, model output, file
|
|
234
|
+
paths and diffs, stack traces, HTTP response bodies, and response headers. Error
|
|
235
|
+
messages are length-limited and redact common credentials, URL queries, and
|
|
236
|
+
filesystem paths before leaving the OpenCode host.
|
|
186
237
|
|
|
187
238
|
Permission commands are delivered at least once. The plugin caches terminal
|
|
188
239
|
acknowledgements and resends the same acknowledgement on redelivery without
|