backeer-codex 0.2.1 → 0.4.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "backeer-codex",
3
- "version": "0.2.1",
4
- "description": "Approve Codex permission requests from Backeer and receive task lifecycle notifications.",
3
+ "version": "0.4.0",
4
+ "description": "Backeer approvals, lifecycle notifications and chat-scoped OpenCode connections.",
5
5
  "author": {
6
6
  "name": "Backeer"
7
7
  },
@@ -15,8 +15,8 @@
15
15
  "skills": "./skills/",
16
16
  "interface": {
17
17
  "displayName": "Backeer Codex",
18
- "shortDescription": "Remote Codex approvals and lifecycle alerts.",
19
- "longDescription": "Backeer Codex securely forwards approval requests and task completion events to Backeer without exposing source credentials to the iOS application.",
18
+ "shortDescription": "Approvals and OpenCode links",
19
+ "longDescription": "Keep Backeer approvals and notifications, and connect each Codex chat to an exact existing OpenCode session over an authenticated local SSH tunnel.",
20
20
  "developerName": "Backeer",
21
21
  "category": "Productivity",
22
22
  "capabilities": [
package/README.md CHANGED
@@ -11,6 +11,90 @@ It provides:
11
11
  - Optional failed-tool notifications (disabled by default).
12
12
  - `status`, `doctor`, `test`, and interactive token configuration commands.
13
13
  - Safe fallback to the normal Codex permission prompt when Backeer is unavailable or not configured.
14
+ - Saved OpenCode connections and an independent exact-session binding for each chat, with live SSE output.
15
+
16
+ ## OpenCode connection per chat
17
+
18
+ ### Guided first setup (0.4.0)
19
+
20
+ In chat, ask **“Connect to OpenCode.”** If no profile is saved, the plugin first
21
+ discovers the configured/default loopback endpoint and known protected token
22
+ files. It learns the project from the authenticated bridge, lets you select the
23
+ intended connection and saves its short name. Main session titles are shown for
24
+ selection; subagents stay hidden unless requested. Connect by exact title without
25
+ copying an ID. Duplicate titles require an ID from the current list. No automatic
26
+ newest-session choice or fallback is made.
27
+
28
+ For terminal setup, run `backeer-codex opencode setup`. For diagnostics, use
29
+ `backeer-codex opencode discover`. Both reuse existing credentials and SSH
30
+ tunnels; no server, port-range scan, vault extraction, SSH edit or raw-token
31
+ prompt is added. If the new computer lacks a tunnel or protected token file,
32
+ setup explains that prerequisite. Custom ports/files can be selected explicitly.
33
+
34
+ Profiles store connection metadata and a token file reference, **never a session
35
+ ID**. IDs are fetched live and kept only in immutable chat bindings. Deleted
36
+ sessions fail closed; the 0.7.0 remote bridge also excludes archived sessions.
37
+ Closing a terminal does not necessarily delete its persisted session. An old
38
+ binding never follows a replacement ID with the same title: refresh and select
39
+ the new target explicitly.
40
+
41
+ `npm run check:package` checks the exact publish file list for private files,
42
+ credential patterns and fixed real session IDs before publication. Public
43
+ packages expose code, not credentials kept in external protected files. This
44
+ check is an additional safeguard, not a guarantee that all flaws are absent.
45
+
46
+ The bundled local MCP server uses the existing Backeer OpenCode bridge through
47
+ your existing SSH tunnel (Termius forwarding is supported). No extra hosted
48
+ server, public port or OpenAI API key is required. Install the **0.6.0 or newer**
49
+ bridge in the intended OpenCode project; legacy single-connection tools remain
50
+ compatible, but managed connections require its project verification metadata.
51
+
52
+ Configure each computer once using the existing protected **live-control** token
53
+ file, which is distinct from the mobile ingest credential:
54
+
55
+ ```sh
56
+ backeer-codex opencode add dev http://127.0.0.1:43871 /absolute/private/live-control.token /srv/project
57
+ backeer-codex opencode connections
58
+ backeer-codex opencode sessions dev
59
+ ```
60
+
61
+ Then tell Codex in a new chat: **“Connect this chat to dev, session ses_….”**
62
+ The tools validate the project and session, then return a unique binding for
63
+ that chat. Other chats can select different sessions without changing it. Each
64
+ binding has its own stream/cursor, including when multiple chats follow the same
65
+ session. Commands require that binding; no global default or automatic fallback
66
+ exists. Prompt delivery keeps the existing request-ID deduplication rules.
67
+
68
+ `mcp.json` registers `scripts/opencode-mcp.mjs` when the updated plugin is enabled.
69
+ Node must be available to the host. An alternative manual stdio command is
70
+ `backeer-codex opencode mcp`; do not register both copies unnecessarily. Profiles
71
+ default to `~/.config/backeer-codex/opencode-connections.json`; override with
72
+ `BACKEER_LIVE_PROFILES_FILE` or `BACKEER_CODEX_CONFIG_DIR`. Missing profiles do
73
+ not prevent MCP startup: `list_connections` returns an empty list. No token is
74
+ embedded in the package, MCP registration or chat. Existing approvals and mobile
75
+ notification settings are kept separate and unchanged.
76
+
77
+ SSE heartbeats keep hours-long quiet work connected. Transport failures retry
78
+ every three seconds indefinitely; a bounded tool wait ending does not stop SSE.
79
+ Disconnecting a binding releases its local resources without stopping OpenCode.
80
+ At most 16 local bindings can be open per MCP process. Bindings intentionally
81
+ live in memory: after restarting the app/MCP process, reconnect to the same
82
+ existing session. This does not restart its work. Replay gaps are explicit.
83
+
84
+ The plugin does not create SSH tunnels or change SSH permissions. Keep the saved
85
+ tunnel running; a dropped tunnel is handled by SSE reconnection once it returns.
86
+ On Windows, token ownership/ACL is checked using built-in PowerShell; allow only
87
+ the current owner, SYSTEM and Administrators. Local profiles and tunnel setup
88
+ are per device. A normal ChatGPT browser/mobile chat cannot run this local stdio
89
+ plugin without a compatible local executor.
90
+
91
+ ### Build the two source projects
92
+
93
+ Keep the sibling `opencode-plugin` checkout beside `backeer-codex`, then run
94
+ `npm ci`, `npm run check`, and `npm test` in this directory. `npm pack` bundles
95
+ the shared OpenCode client and MCP dependencies in `dist/opencode.mjs`; installed
96
+ plugins do not need the sibling checkout or development dependencies. The
97
+ existing `backeer-codex install` flow includes this bundle and `mcp.json`.
14
98
 
15
99
  ## Approval behavior and limitations
16
100
 
@@ -89,7 +173,7 @@ backeer-codex test
89
173
 
90
174
  The source token is stored in `~/.config/backeer-codex/config.json` with mode `0600`. `BACKEER_INGEST_TOKEN` and `BACKEER_GATEWAY_URL` environment variables override the file without being written to disk.
91
175
 
92
- After enabling or updating the plugin, use `/hooks` in Codex to review and trust the Backeer hook definition.
176
+ If lifecycle hooks need trust review, use **Settings > Hooks** or **Review hooks** in the desktop app, or `/hooks` inside the Codex CLI. This command does not belong in remote OpenCode or a system shell and is not required for OpenCode connection setup.
93
177
 
94
178
  ## Privacy and security
95
179
 
@@ -0,0 +1,260 @@
1
+ zod@4.6.7 (MIT)
2
+ MIT License
3
+
4
+ Copyright (c) 2025 Colin McDonnell
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
23
+
24
+
25
+ ---
26
+
27
+ @modelcontextprotocol/sdk@1.32.2 (MIT)
28
+ MIT License
29
+
30
+ Copyright (c) 2024 Anthropic, PBC
31
+
32
+ Permission is hereby granted, free of charge, to any person obtaining a copy
33
+ of this software and associated documentation files (the "Software"), to deal
34
+ in the Software without restriction, including without limitation the rights
35
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36
+ copies of the Software, and to permit persons to whom the Software is
37
+ furnished to do so, subject to the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be included in all
40
+ copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
47
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
+ SOFTWARE.
49
+
50
+
51
+ ---
52
+
53
+ zod-to-json-schema@3.25.2 (ISC)
54
+ ISC License
55
+
56
+ Copyright (c) 2020, Stefan Terdell
57
+
58
+ Permission to use, copy, modify, and/or distribute this software for any
59
+ purpose with or without fee is hereby granted, provided that the above
60
+ copyright notice and this permission notice appear in all copies.
61
+
62
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
63
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
64
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
65
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
66
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
67
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
68
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
69
+
70
+ ---
71
+
72
+ ajv@8.20.0 (MIT)
73
+ The MIT License (MIT)
74
+
75
+ Copyright (c) 2015-2021 Evgeny Poberezkin
76
+
77
+ Permission is hereby granted, free of charge, to any person obtaining a copy
78
+ of this software and associated documentation files (the "Software"), to deal
79
+ in the Software without restriction, including without limitation the rights
80
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
81
+ copies of the Software, and to permit persons to whom the Software is
82
+ furnished to do so, subject to the following conditions:
83
+
84
+ The above copyright notice and this permission notice shall be included in all
85
+ copies or substantial portions of the Software.
86
+
87
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
88
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
90
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
91
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
92
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
93
+ SOFTWARE.
94
+
95
+
96
+
97
+ ---
98
+
99
+ fast-deep-equal@3.1.3 (MIT)
100
+ MIT License
101
+
102
+ Copyright (c) 2017 Evgeny Poberezkin
103
+
104
+ Permission is hereby granted, free of charge, to any person obtaining a copy
105
+ of this software and associated documentation files (the "Software"), to deal
106
+ in the Software without restriction, including without limitation the rights
107
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
108
+ copies of the Software, and to permit persons to whom the Software is
109
+ furnished to do so, subject to the following conditions:
110
+
111
+ The above copyright notice and this permission notice shall be included in all
112
+ copies or substantial portions of the Software.
113
+
114
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
115
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
116
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
117
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
118
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
119
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
120
+ SOFTWARE.
121
+
122
+
123
+ ---
124
+
125
+ json-schema-traverse@1.0.0 (MIT)
126
+ MIT License
127
+
128
+ Copyright (c) 2017 Evgeny Poberezkin
129
+
130
+ Permission is hereby granted, free of charge, to any person obtaining a copy
131
+ of this software and associated documentation files (the "Software"), to deal
132
+ in the Software without restriction, including without limitation the rights
133
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
134
+ copies of the Software, and to permit persons to whom the Software is
135
+ furnished to do so, subject to the following conditions:
136
+
137
+ The above copyright notice and this permission notice shall be included in all
138
+ copies or substantial portions of the Software.
139
+
140
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
141
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
142
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
143
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
144
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
145
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
146
+ SOFTWARE.
147
+
148
+
149
+ ---
150
+
151
+ fast-uri@3.1.9 (BSD-3-Clause)
152
+ Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae
153
+ Copyright (c) 2021-present The Fastify team <https://github.com/fastify/fastify#team>
154
+ All rights reserved.
155
+
156
+ Redistribution and use in source and binary forms, with or without
157
+ modification, are permitted provided that the following conditions are met:
158
+ * Redistributions of source code must retain the above copyright
159
+ notice, this list of conditions and the following disclaimer.
160
+ * Redistributions in binary form must reproduce the above copyright
161
+ notice, this list of conditions and the following disclaimer in the
162
+ documentation and/or other materials provided with the distribution.
163
+ * The names of any contributors may not be used to endorse or promote
164
+ products derived from this software without specific prior written
165
+ permission.
166
+
167
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
168
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
169
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
170
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
171
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
172
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
173
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
174
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
175
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
176
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
177
+
178
+ * * *
179
+
180
+ The complete list of contributors can be found at:
181
+ - https://github.com/garycourt/uri-js/graphs/contributors
182
+
183
+ ---
184
+
185
+ ajv-formats@3.0.1 (MIT)
186
+ MIT License
187
+
188
+ Copyright (c) 2020 Evgeny Poberezkin
189
+
190
+ Permission is hereby granted, free of charge, to any person obtaining a copy
191
+ of this software and associated documentation files (the "Software"), to deal
192
+ in the Software without restriction, including without limitation the rights
193
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
194
+ copies of the Software, and to permit persons to whom the Software is
195
+ furnished to do so, subject to the following conditions:
196
+
197
+ The above copyright notice and this permission notice shall be included in all
198
+ copies or substantial portions of the Software.
199
+
200
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
201
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
202
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
203
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
204
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
205
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
206
+ SOFTWARE.
207
+
208
+
209
+ ---
210
+
211
+ ajv@8.20.0 (MIT)
212
+ The MIT License (MIT)
213
+
214
+ Copyright (c) 2015-2021 Evgeny Poberezkin
215
+
216
+ Permission is hereby granted, free of charge, to any person obtaining a copy
217
+ of this software and associated documentation files (the "Software"), to deal
218
+ in the Software without restriction, including without limitation the rights
219
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
220
+ copies of the Software, and to permit persons to whom the Software is
221
+ furnished to do so, subject to the following conditions:
222
+
223
+ The above copyright notice and this permission notice shall be included in all
224
+ copies or substantial portions of the Software.
225
+
226
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
227
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
228
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
229
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
230
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
231
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
232
+ SOFTWARE.
233
+
234
+
235
+
236
+ ---
237
+
238
+ json-schema-traverse@1.0.0 (MIT)
239
+ MIT License
240
+
241
+ Copyright (c) 2017 Evgeny Poberezkin
242
+
243
+ Permission is hereby granted, free of charge, to any person obtaining a copy
244
+ of this software and associated documentation files (the "Software"), to deal
245
+ in the Software without restriction, including without limitation the rights
246
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
247
+ copies of the Software, and to permit persons to whom the Software is
248
+ furnished to do so, subject to the following conditions:
249
+
250
+ The above copyright notice and this permission notice shall be included in all
251
+ copies or substantial portions of the Software.
252
+
253
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
254
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
255
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
256
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
257
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
258
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
259
+ SOFTWARE.
260
+