backeer-opencode 0.4.0 → 0.5.2

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,41 @@
2
2
 
3
3
  All notable changes to `backeer-opencode` are documented here.
4
4
 
5
+ ## 0.5.2 - 2026-11-03
6
+
7
+ - Cancel unread HTTP error bodies so repeated failed requests release their
8
+ transport resources without exposing remote error contents.
9
+ - Keep intentional shutdown in the closed state, await initial cursor setup,
10
+ and discard late handshake responses instead of reviving a closed client.
11
+ - Add four regression tests for error-body cleanup and shutdown races.
12
+ - Update the development-only brace-expansion dependency to its compatible
13
+ security patch. Production dependencies are unchanged.
14
+
15
+ ## 0.5.1 - 2026-11-03
16
+
17
+ - Keep live tracking active during hours of agent silence; retain 15-second
18
+ heartbeats and detect dead transport only after 45 seconds without traffic.
19
+ - Retry live SSE and native V2 subscriptions every three seconds indefinitely,
20
+ including initial unavailability and authentication failures. Preserve explicit
21
+ history-gap reporting while reconnecting the transport automatically.
22
+ - Send disconnect/reconnect application notifications through the existing
23
+ Backeer mobile gateway once per aggregate connection transition. Keep pending
24
+ delivery bounded and avoid notifications on deliberate plugin disposal.
25
+ - Document a reconnecting SSH tunnel and the distinction between tool waits,
26
+ transport timeouts and long-running agent jobs.
27
+
28
+ ## 0.5.0 - 2026-11-03
29
+
30
+ - Add optional authenticated loopback live control inside the existing OpenCode
31
+ process: bounded SSE replay, reconnect/gap signaling, exact-session normal
32
+ prompts and 24-hour instruction idempotency.
33
+ - Add a local stdio MCP adapter for session status, incremental reads, bounded
34
+ SSE waits and explicit instructions over an existing SSH tunnel.
35
+ - Preserve mobile approvals/questions, reject cross-project access, and keep
36
+ live credentials separate and owner-readable. No remote deployment or public
37
+ listener is enabled automatically.
38
+ - Document supported V1/V2 output events and observed-session discovery limits.
39
+
5
40
  ## 0.4.0 - 2026-10-11
6
41
 
7
42
  - 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
- The plugin uses outbound HTTPS only. It does not start a server or require an
12
- inbound firewall rule.
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.2
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
+ }