backeer-opencode 0.4.0 → 0.5.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/CHANGELOG.md +25 -0
- package/README.md +57 -3
- package/bin/backeer-opencode-mcp.js +9 -0
- package/dist/backeer-permission.js +619 -53
- package/docs/live-control.md +80 -0
- package/package.json +10 -6
- package/src/config.js +4 -0
- package/src/live-bridge-client.js +52 -0
- package/src/live-bridge-config.js +48 -0
- package/src/live-bridge-events.js +80 -0
- package/src/live-bridge.js +273 -0
- package/src/live-connection.js +50 -0
- package/src/live-control-client.js +361 -0
- package/src/live-control-mcp.js +79 -0
- package/src/opencode-v2-client.js +2 -0
- package/src/opencode-v2.js +2 -4
- package/src/plugin.js +54 -46
- package/src/updates.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `backeer-opencode` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.5.1 - 2026-11-03
|
|
6
|
+
|
|
7
|
+
- Keep live tracking active during hours of agent silence; retain 15-second
|
|
8
|
+
heartbeats and detect dead transport only after 45 seconds without traffic.
|
|
9
|
+
- Retry live SSE and native V2 subscriptions every three seconds indefinitely,
|
|
10
|
+
including initial unavailability and authentication failures. Preserve explicit
|
|
11
|
+
history-gap reporting while reconnecting the transport automatically.
|
|
12
|
+
- Send disconnect/reconnect application notifications through the existing
|
|
13
|
+
Backeer mobile gateway once per aggregate connection transition. Keep pending
|
|
14
|
+
delivery bounded and avoid notifications on deliberate plugin disposal.
|
|
15
|
+
- Document a reconnecting SSH tunnel and the distinction between tool waits,
|
|
16
|
+
transport timeouts and long-running agent jobs.
|
|
17
|
+
|
|
18
|
+
## 0.5.0 - 2026-11-03
|
|
19
|
+
|
|
20
|
+
- Add optional authenticated loopback live control inside the existing OpenCode
|
|
21
|
+
process: bounded SSE replay, reconnect/gap signaling, exact-session normal
|
|
22
|
+
prompts and 24-hour instruction idempotency.
|
|
23
|
+
- Add a local stdio MCP adapter for session status, incremental reads, bounded
|
|
24
|
+
SSE waits and explicit instructions over an existing SSH tunnel.
|
|
25
|
+
- Preserve mobile approvals/questions, reject cross-project access, and keep
|
|
26
|
+
live credentials separate and owner-readable. No remote deployment or public
|
|
27
|
+
listener is enabled automatically.
|
|
28
|
+
- Document supported V1/V2 output events and observed-session discovery limits.
|
|
29
|
+
|
|
5
30
|
## 0.4.0 - 2026-10-11
|
|
6
31
|
|
|
7
32
|
- Add a V2 default definition with a stable ID, setup, event subscription,
|
package/README.md
CHANGED
|
@@ -8,8 +8,62 @@ command stream. An authorized user can choose **Allow once**, **Always allow**,
|
|
|
8
8
|
or **Reject** for permissions and can answer or reject AI questions from the
|
|
9
9
|
Backeer iOS application.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
Mobile notifications and approvals use outbound HTTPS only. The optional live
|
|
12
|
+
control feature adds an authenticated loopback-only listener inside OpenCode;
|
|
13
|
+
it needs no public port, inbound firewall rule, or separately hosted server.
|
|
14
|
+
See [Live control setup](docs/live-control.md) for the SSE/MCP connection.
|
|
15
|
+
|
|
16
|
+
## Live output and instructions
|
|
17
|
+
|
|
18
|
+
The opt-in live channel lets a local MCP client send an instruction to an exact
|
|
19
|
+
OpenCode session and follow assistant text, tool results, status and pending
|
|
20
|
+
approval metadata over SSE. It does not record the whole terminal, export
|
|
21
|
+
reasoning or authentication forms, or approve permissions. Mobile approval and
|
|
22
|
+
question replies continue through Backeer as before.
|
|
23
|
+
|
|
24
|
+
Create a separate protected live-control credential file on the OpenCode host;
|
|
25
|
+
use the same credential in an owner-only file on the MCP computer. Do not reuse
|
|
26
|
+
the Backeer ingest token. Values never belong in plugin options or chat text.
|
|
27
|
+
For example, generate a file without printing its contents:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
install -d -m 700 "$HOME/.config/opencode/secrets"
|
|
31
|
+
(set -C; umask 077; openssl rand -hex 32 > "$HOME/.config/opencode/secrets/backeer-live-token")
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
This refuses to overwrite an existing live-control file; generate it once for
|
|
35
|
+
initial setup, not during a running session. Enable the plugin with non-secret
|
|
36
|
+
options (use an actual absolute path):
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"plugins": [{
|
|
41
|
+
"package": "backeer-opencode",
|
|
42
|
+
"options": {
|
|
43
|
+
"liveBridge": {
|
|
44
|
+
"enabled": true,
|
|
45
|
+
"port": 43871,
|
|
46
|
+
"tokenFile": "/absolute/private/path/backeer-live-token"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}]
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
For side-loaded installations, the equivalent environment variables are
|
|
54
|
+
`BACKEER_LIVE_ENABLED=true`, `BACKEER_LIVE_PORT=43871`, and
|
|
55
|
+
`BACKEER_LIVE_TOKEN_FILE=/absolute/private/path/backeer-live-token`. Defaults:
|
|
56
|
+
disabled; port `43871`; token file under the existing OpenCode configuration
|
|
57
|
+
directory at `secrets/backeer-live-token`. An invalid live configuration disables
|
|
58
|
+
only the live channel, leaving existing mobile integration available. Restart
|
|
59
|
+
the intended OpenCode process after explicitly installing/enabling this version;
|
|
60
|
+
existing running sessions are not modified by this source checkout.
|
|
61
|
+
|
|
62
|
+
The matching `backeer-opencode-mcp` executable is provided in the package.
|
|
63
|
+
Connect through an existing SSH tunnel and register the local stdio executable
|
|
64
|
+
as described in [the complete setup guide](docs/live-control.md). Version 0.5.1
|
|
65
|
+
in this checkout must be installed from its built package or installer bundle
|
|
66
|
+
until it has been separately published; do not assume npm `latest` contains it.
|
|
13
67
|
|
|
14
68
|
## Requirements
|
|
15
69
|
|
|
@@ -148,7 +202,7 @@ OpenCode V2 plugin options syntax:
|
|
|
148
202
|
```
|
|
149
203
|
|
|
150
204
|
Supported options are `origin`, `tokenFile`, `permissions`, `questions`,
|
|
151
|
-
`todos`, `lifecycle`, and `logLevel`. Use `"lifecycle": false` to disable the
|
|
205
|
+
`todos`, `lifecycle`, `liveBridge`, and `logLevel`. Use `"lifecycle": false` to disable the
|
|
152
206
|
entire lifecycle group. The token itself is deliberately not a plugin option.
|
|
153
207
|
|
|
154
208
|
## Conversation feedback
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runLiveControlMcp } from "../src/live-control-mcp.js"
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
await runLiveControlMcp()
|
|
6
|
+
} catch {
|
|
7
|
+
console.error("Backeer live-control MCP failed to start. Check BACKEER_LIVE_TOKEN_FILE, its owner-only permissions, and BACKEER_LIVE_URL.")
|
|
8
|
+
process.exitCode = 1
|
|
9
|
+
}
|