backeer-codex 0.11.0 → 0.12.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/.codex-plugin/plugin.json +1 -1
- package/README.md +44 -2
- package/dist/opencode.mjs +554 -75
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skills/backeer/SKILL.md +77 -5
- package/src/installer.mjs +35 -10
- package/src/opencode.mjs +15 -6
- package/src/version.mjs +1 -0
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "backeer-codex",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"description": "Backeer approvals, lifecycle notifications and chat-scoped OpenCode connections.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Backeer"
|
package/skills/backeer/SKILL.md
CHANGED
|
@@ -19,6 +19,7 @@ Commands:
|
|
|
19
19
|
- `opencode connections`: list saved OpenCode connections without exposing token files or values.
|
|
20
20
|
- `opencode setup`: guide setup in an interactive terminal. Reuse a saved connection or discover an existing bridge, then select a current session by number. Session choices are not saved in profiles. Never asks for a raw token or password.
|
|
21
21
|
- `opencode verify <name> "<exact session title>"`: read-only end-to-end project/session/SSE verification; sends no model instruction and closes its temporary stream.
|
|
22
|
+
- `opencode report <name>`: one read-only report of loaded versions, feature compatibility, native owners, stream and request latency.
|
|
22
23
|
- `opencode diagnose <name>`: read-only diagnosis for one saved connection; no SSH, credential or remote session changes.
|
|
23
24
|
- `opencode discover`: return safe discovered candidates and actionable setup diagnostics without printing credentials or private token file paths.
|
|
24
25
|
- `opencode add <name> <loopback-url> <token-file> <remote-project-directory>`: save a connection with an existing protected live-control token file. Requires the user's intended server/project, not a guessed target. Does not alter SSH configuration, start a tunnel or create a session.
|
|
@@ -43,13 +44,13 @@ Use `connection_setup` for a guided flow when the user needs help choosing a con
|
|
|
43
44
|
|
|
44
45
|
On a connection failure call `diagnose_connection` with exactly one connection name or this chat's bindingId. Explain its safe diagnostic and next step rather than repeatedly returning a generic error. A refused loopback connection means the local endpoint/tunnel is unavailable; it does not prove an OpenCode bug. The plugin retries SSE every three seconds but does not create an SSH tunnel. Never change SSH or credentials as an automatic repair.
|
|
45
46
|
|
|
46
|
-
Reads during temporary transport failures can return buffered events with `verified: false`. Identify them as previously received output; keep the binding/cursor, and verify the exact session with `session_status` after reconnection. Do not send a new instruction, automatically retry a POST, or acknowledge a replay gap while verification is pending. Different bindings keep independent
|
|
47
|
+
Reads during temporary transport failures can return buffered events with `verified: false`. Identify them as previously received output; keep the binding/cursor, and verify the exact session with `session_status` after reconnection. Do not send a new instruction, automatically retry a POST, or acknowledge a replay gap while verification is pending. Different bindings keep independent projections and unread cursors while compatible bindings in one MCP process share a project SSE transport, including two chats observing the same session.
|
|
47
48
|
|
|
48
49
|
Tree tracking requires a remote bridge advertising `capabilities.sessionTree` (Backeer OpenCode 0.12.0+) and the updated local adapter (Backeer Codex 0.9.0+). If unsupported, explain that the remote bridge must be updated; do not silently fall back to parent-only output or an unfiltered project stream. The binding's root and event scope are fixed until explicitly disconnected/reconnected. Existing and newly created descendants are followed through verified native `parentID` relationships, including nested subagents; unrelated sessions and fork provenance are not task ancestry.
|
|
49
50
|
|
|
50
51
|
Backeer OpenCode 0.12.0 automatically answers native filesystem permission actions (`read`, `edit`, `glob`, `grep`, V1 `list`, `external_directory`) with OpenCode's Always allow decision. This runs in the owning OpenCode process, including for subagents, independently of mobile notifications. Do not submit a second answer through a chat instruction or ordinary question tool. From Backeer OpenCode 0.12.1, successful automatic approvals also send an informational mobile push when permission notifications and the mobile token are enabled. The configured native TUI owner runs mobile notification handling independently of the live SSE switch or project pin. Other permission types use their existing approval flow. OpenCode owns the saved approval patterns; the Codex launcher's separate permission settings are not changed by this feature.
|
|
51
52
|
|
|
52
|
-
Label output with its source `sessionID` and available agent/title rather than presenting every child's output as the parent. Check `session_status` for the tree's member states, active/waiting counts and failed outcomes. A child's or parent's idle event alone does not establish that all work is complete; unknown states remain unverified. If `tree.complete` is false, disclose the incomplete snapshot and retry status after recovery; do not infer completion from its partial counts. A `session_tree_unavailable` gap means ancestry could not be verified for some output; disclose the gap and follow the normal status/explicit-cursor recovery procedure. Keep waiting when descendants are active or waiting. Instructions
|
|
53
|
+
Label output with its source `sessionID` and available agent/title rather than presenting every child's output as the parent. Check `session_status` for the tree's member states, active/waiting counts and failed outcomes. A child's or parent's idle event alone does not establish that all work is complete; unknown states remain unverified. If `tree.complete` is false, disclose the incomplete snapshot and retry status after recovery; do not infer completion from its partial counts. A `session_tree_unavailable` gap means ancestry could not be verified for some output; disclose the gap and follow the normal status/explicit-cursor recovery procedure. Keep waiting when descendants are active or waiting. Instructions target the selected root. For an ordinary child question authorized by the user, pass its exact source as targetSessionId to list_questions and answer_question on the same binding. The manager and bridge freshly verify its native parent ancestry and form revision. Never route a child answer through the root or use ordinary forms to approve permissions/authentication. Tree tracking covers OpenCode child sessions, not opaque agents inside a separate Codex process. V2 assistant text still arrives as completed, redacted text units, not raw token deltas.
|
|
53
54
|
|
|
54
55
|
Profiles are local to each computer. This local stdio plugin works in a host with a local executor (such as Codex Desktop); ordinary ChatGPT web/mobile chats do not automatically inherit this computer's plugin or SSH tunnel.
|
|
55
56
|
|
|
@@ -120,9 +121,9 @@ permissions and errors wake the tool immediately, even during native verificatio
|
|
|
120
121
|
children are active, waiting or unknown. `coverageComplete` is about known scope,
|
|
121
122
|
not task completion. An interruption must never be presented as completion.
|
|
122
123
|
|
|
123
|
-
On a question alert, read pending questions for that exact source.
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
On a question alert, read pending questions for that exact source. From Codex 0.12.0 / OpenCode 0.15.0, ordinary child questions can use the same
|
|
125
|
+
binding with an explicit targetSessionId from the alert. Read and answer that
|
|
126
|
+
exact child form after user authorization; never send its answer to the parent.
|
|
126
127
|
Filesystem permissions still auto-allow in their native owner; report them as
|
|
127
128
|
informational when already settled, without sending another decision.
|
|
128
129
|
|
|
@@ -143,3 +144,74 @@ messages may show a live short summary when supported by the host; do not promis
|
|
|
143
144
|
a continuously updating UI if the host does not render progress notifications.
|
|
144
145
|
Native OpenCode child sessions are covered. Opaque internal Codex agents need
|
|
145
146
|
provider-side agent events and are not recovered from parent summaries.
|
|
147
|
+
|
|
148
|
+
## Slow native APIs (Codex 0.11.1 / OpenCode 0.14.2)
|
|
149
|
+
|
|
150
|
+
`native_session_api_timeout` (HTTP 504) means a native session read exceeded its
|
|
151
|
+
budget, while `native_session_api_unavailable` (503) means an unreachable or
|
|
152
|
+
unverified source. Both are retryable reads, not proof of deletion. Keep the
|
|
153
|
+
same session/binding and disclose the interruption. Never replay instructions
|
|
154
|
+
or change request IDs merely because a read timed out.
|
|
155
|
+
|
|
156
|
+
Native-owner reads allow 10 seconds, aggregated snapshots 30 seconds, local
|
|
157
|
+
HTTP/SSE handshakes 45 seconds, and liveness checks 3 seconds. Reconnect cadence
|
|
158
|
+
remains 3 seconds. `verify_connection` defaults to 30 seconds per check, and
|
|
159
|
+
explicit shorter caller deadlines still apply. Inventory and tree members
|
|
160
|
+
are verified with bounded parallel reads, without dropping ownership checks.
|
|
161
|
+
Update and load both bridge 0.14.2+ and adapter 0.11.1+ when older timeouts are
|
|
162
|
+
still active; don't repeatedly diagnose unchanged outages or silently reduce
|
|
163
|
+
tree scope to get past a timeout.
|
|
164
|
+
|
|
165
|
+
## Reliability and direct tools (Codex 0.12.0 / OpenCode 0.15.0)
|
|
166
|
+
|
|
167
|
+
Use `connection_report` for one connection or this binding. It separates the
|
|
168
|
+
running local adapter, embedded bridge client and remote loaded version. Remote
|
|
169
|
+
installation on disk is unknown unless separately verified. Unsupported protocol
|
|
170
|
+
majors fail closed; missing optional features remain explicitly unavailable.
|
|
171
|
+
A reachable listener is not proof that its native session API is working.
|
|
172
|
+
OpenCode's `backeer-opencode status` CLI, `/backeer-status` TUI command and
|
|
173
|
+
“Backeer: Bağlantı raporu” palette entry display local state without a model call.
|
|
174
|
+
The TUI entry requires the package's TUI plugin to be loaded.
|
|
175
|
+
|
|
176
|
+
Activity is projected from SSE events. Full native reconciliation happens on
|
|
177
|
+
connection/reconnection, membership changes, uncertain coverage, terminal
|
|
178
|
+
verification and a periodic 30-second freshness check, rather than every update.
|
|
179
|
+
Use `changesOnly: true` with watch_activity after the first card. Merge `delta`
|
|
180
|
+
into the previous card; suppress an unchanged card while still showing urgent
|
|
181
|
+
alerts and delivery updates. Use activity_status for a full view as needed.
|
|
182
|
+
Unknown ancestry and expired buffers stay explicit gaps. Never acknowledge one
|
|
183
|
+
without a fresh complete status check. Compatible bindings share one SSE per
|
|
184
|
+
endpoint/project/credential within an MCP process; each retains independent
|
|
185
|
+
scope, activity, raw/detail cursors, history-gap acknowledgement and cancellation.
|
|
186
|
+
Different processes still have independent transports. This is not a global
|
|
187
|
+
subscription shared across all desktop chats.
|
|
188
|
+
|
|
189
|
+
For requested output use `tail_output` (default last 50 retained lines),
|
|
190
|
+
`read_errors` or `tool_result` by exact retained eventId. Optional sessionId
|
|
191
|
+
narrows to an exact descendant; it never widens the binding. Source references,
|
|
192
|
+
clipping, partial first lines and retention expiry are explicit. These tools do
|
|
193
|
+
not consume other read cursors. Use read_details with eventId/offset/nextOffset
|
|
194
|
+
for full retained source text. Buffered reads during native outages are marked
|
|
195
|
+
verified:false and must not be described as newly verified live output.
|
|
196
|
+
|
|
197
|
+
After send_instruction, keep its requestId and receipt. `accepted` means native
|
|
198
|
+
admission, not execution or completion. Use `instruction_status` for the exact
|
|
199
|
+
receipt: delivery is unknown/queued/delivered/cancelled. Native V2 inbox events
|
|
200
|
+
update delivery, including compact activity delivery updates. Execution/outcome
|
|
201
|
+
in this receipt belongs to the session, not necessarily this one instruction.
|
|
202
|
+
Never automatically resend, change delivery mode, or invent per-message task
|
|
203
|
+
completion. Legacy native APIs can report unknown delivery.
|
|
204
|
+
|
|
205
|
+
With durableCommands, protected append-only transition records preserve request
|
|
206
|
+
signatures and receipts across owner/plugin restarts. Prompt/answer text and
|
|
207
|
+
credentials are not stored. Reusing an accepted ID returns its receipt; an
|
|
208
|
+
interrupted reservation remains command_delivery_uncertain and is never replayed
|
|
209
|
+
automatically. Never delete reservations as a repair. A missing receipt after
|
|
210
|
+
migration or on another owner is not proof that delivery never happened.
|
|
211
|
+
The new guarantee starts with requests recorded by the updated bridge.
|
|
212
|
+
|
|
213
|
+
Read-only native failures enter a per-owner circuit after three failures and
|
|
214
|
+
allow one recovery probe after 10 seconds. Writes are never retried by this
|
|
215
|
+
mechanism. The existing 3/10/30/45-second liveness/native/aggregate/client budgets
|
|
216
|
+
remain separate. Request latency and response-byte metrics are observations,
|
|
217
|
+
not an estimate of billed model tokens.
|
package/src/installer.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
1
2
|
import fs from "node:fs/promises";
|
|
2
3
|
import os from "node:os";
|
|
3
4
|
import path from "node:path";
|
|
@@ -106,16 +107,40 @@ export async function installPlugin(options = {}) {
|
|
|
106
107
|
// leave new files behind while reporting that the installation failed.
|
|
107
108
|
const marketplace = await readMarketplace(paths.marketplaceFile);
|
|
108
109
|
validateMarketplace(paths.marketplaceFile, marketplace);
|
|
109
|
-
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
const
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
110
|
+
const source = options.packageRoot || PACKAGE_ROOT;
|
|
111
|
+
// Construct a complete replacement before touching the installed directory.
|
|
112
|
+
// Rename removes obsolete files and avoids mixing two package versions.
|
|
113
|
+
const suffix = randomUUID();
|
|
114
|
+
const staging = `${paths.pluginDirectory}.stage-${suffix}`;
|
|
115
|
+
const previous = `${paths.pluginDirectory}.previous-${suffix}`;
|
|
116
|
+
const originalRegistry = await fs.readFile(paths.marketplaceFile).catch(error => {
|
|
117
|
+
if (error.code === "ENOENT") return undefined;
|
|
118
|
+
throw error;
|
|
119
|
+
});
|
|
120
|
+
let movedOld = false, committed = false, registryWritten = false;
|
|
121
|
+
let marketplaceName;
|
|
122
|
+
try {
|
|
123
|
+
await copyPlugin(source, staging);
|
|
124
|
+
const wsRoot = path.dirname(require.resolve("ws/package.json"));
|
|
125
|
+
await fs.cp(wsRoot, path.join(staging, "node_modules", "ws"), { recursive: true, force: true });
|
|
126
|
+
try { await fs.rename(paths.pluginDirectory, previous); movedOld = true; }
|
|
127
|
+
catch (error) { if (error.code !== "ENOENT") throw error; }
|
|
128
|
+
await fs.rename(staging, paths.pluginDirectory); committed = true;
|
|
129
|
+
marketplaceName = await writeMarketplace(paths.marketplaceFile, marketplace); registryWritten = true;
|
|
130
|
+
if (options.installWithCodex !== false) await (options.runInstall || runCodexInstall)(marketplaceName);
|
|
131
|
+
} catch (error) {
|
|
132
|
+
if (committed) await fs.rm(paths.pluginDirectory, { recursive: true, force: true });
|
|
133
|
+
if (movedOld) await fs.rename(previous, paths.pluginDirectory);
|
|
134
|
+
if (registryWritten) {
|
|
135
|
+
if (originalRegistry) {
|
|
136
|
+
const rollback = `${paths.marketplaceFile}.${suffix}.rollback`;
|
|
137
|
+
await fs.writeFile(rollback, originalRegistry, { mode: 0o600 });
|
|
138
|
+
await fs.rename(rollback, paths.marketplaceFile);
|
|
139
|
+
} else await fs.rm(paths.marketplaceFile, { force: true });
|
|
140
|
+
}
|
|
141
|
+
throw error;
|
|
142
|
+
} finally { await fs.rm(staging, { recursive: true, force: true }); }
|
|
143
|
+
if (movedOld) await fs.rm(previous, { recursive: true, force: true });
|
|
119
144
|
return { ...paths, marketplaceName };
|
|
120
145
|
}
|
|
121
146
|
|
package/src/opencode.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VERSION } from "./version.mjs";
|
|
1
2
|
import path from "node:path";
|
|
2
3
|
import { createInterface } from "node:readline/promises";
|
|
3
4
|
import { loadConnectionProfiles, saveConnectionProfiles, connectionProfile } from "backeer-opencode/live-profiles";
|
|
@@ -74,7 +75,7 @@ export async function runOpenCodeCLI(args, { env = process.env, output = process
|
|
|
74
75
|
const file = connectionsFile(env);
|
|
75
76
|
const [command = "connections", ...values] = args;
|
|
76
77
|
const discovery = discoveryDefaults(env);
|
|
77
|
-
if (command === "mcp" && values.length === 0) return runManagedLiveMcp({ profilesFile: file, discovery });
|
|
78
|
+
if (command === "mcp" && values.length === 0) return runManagedLiveMcp({ profilesFile: file, discovery, adapterVersion: VERSION });
|
|
78
79
|
if (["setup", "discover"].includes(command) && values.length === 0) {
|
|
79
80
|
let prompt;
|
|
80
81
|
if (command === "setup" && !ask) {
|
|
@@ -82,7 +83,7 @@ export async function runOpenCodeCLI(args, { env = process.env, output = process
|
|
|
82
83
|
prompt = createInterface({ input, output });
|
|
83
84
|
ask = question => prompt.question(question);
|
|
84
85
|
}
|
|
85
|
-
const manager = new LiveSessionManager({ profilesFile: file, discovery });
|
|
86
|
+
const manager = new LiveSessionManager({ profilesFile: file, discovery, adapterVersion: VERSION });
|
|
86
87
|
try {
|
|
87
88
|
if (command === "setup") return await setupOpenCode(manager, { ask, output });
|
|
88
89
|
const result = await manager.discover();
|
|
@@ -91,15 +92,23 @@ export async function runOpenCodeCLI(args, { env = process.env, output = process
|
|
|
91
92
|
} finally { prompt?.close(); await manager.close(); }
|
|
92
93
|
}
|
|
93
94
|
if (command === "verify" && values.length === 2) {
|
|
94
|
-
const manager = new LiveSessionManager({ profilesFile: file });
|
|
95
|
+
const manager = new LiveSessionManager({ profilesFile: file, adapterVersion: VERSION });
|
|
95
96
|
try {
|
|
96
97
|
const result = await manager.verifyConnection({ connection: values[0], sessionTitle: values[1] });
|
|
97
98
|
output.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
98
99
|
return result;
|
|
99
100
|
} finally { await manager.close(); }
|
|
100
101
|
}
|
|
102
|
+
if (command === "report" && values.length === 1) {
|
|
103
|
+
const manager = new LiveSessionManager({ profilesFile: file, adapterVersion: VERSION });
|
|
104
|
+
try {
|
|
105
|
+
const result = await manager.report({ connection: values[0] });
|
|
106
|
+
output.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
107
|
+
return result;
|
|
108
|
+
} finally { await manager.close(); }
|
|
109
|
+
}
|
|
101
110
|
if (command === "diagnose" && values.length === 1) {
|
|
102
|
-
const manager = new LiveSessionManager({ profilesFile: file });
|
|
111
|
+
const manager = new LiveSessionManager({ profilesFile: file, adapterVersion: VERSION });
|
|
103
112
|
try {
|
|
104
113
|
const result = await manager.diagnose({ connection: values[0] });
|
|
105
114
|
output.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
@@ -128,10 +137,10 @@ export async function runOpenCodeCLI(args, { env = process.env, output = process
|
|
|
128
137
|
return;
|
|
129
138
|
}
|
|
130
139
|
if (command === "sessions" && (values.length === 1 || (values.length === 2 && values[1] === "--include-subagents"))) {
|
|
131
|
-
const manager = new LiveSessionManager({ profilesFile: file });
|
|
140
|
+
const manager = new LiveSessionManager({ profilesFile: file, adapterVersion: VERSION });
|
|
132
141
|
try { output.write(`${JSON.stringify(await manager.listSessions(values[0], { includeChildren: values.length === 2 }), null, 2)}\n`); }
|
|
133
142
|
finally { await manager.close(); }
|
|
134
143
|
return;
|
|
135
144
|
}
|
|
136
|
-
throw new Error("Usage: backeer-codex opencode [setup|discover|diagnose <name>|verify <name> <exact-session-title>|connections|add <name> <loopback-url> <token-file> <remote-project-directory>|remove <name>|sessions <name> [--include-subagents]|mcp]");
|
|
145
|
+
throw new Error("Usage: backeer-codex opencode [setup|discover|report <name>|diagnose <name>|verify <name> <exact-session-title>|connections|add <name> <loopback-url> <token-file> <remote-project-directory>|remove <name>|sessions <name> [--include-subagents]|mcp]");
|
|
137
146
|
}
|
package/src/version.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = "0.12.0";
|