opencode-apex 0.2.0 → 0.2.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 +85 -44
- package/LICENSE +21 -0
- package/README.md +299 -149
- package/browser/endpoint.ts +4 -1
- package/browser.ts +2 -1
- package/core/compat.ts +12 -4
- package/core/config.ts +14 -3
- package/core/crypto.ts +2 -1
- package/core/rpc.ts +1 -1
- package/core/server-endpoint.ts +1 -1
- package/core/tools-run.ts +7 -7
- package/docs/ADVISOR.md +129 -71
- package/docs/BROWSER.md +185 -158
- package/docs/CONFIG.md +145 -55
- package/docs/EVENTS.md +206 -89
- package/docs/GUARD.md +142 -104
- package/docs/REDACT.md +143 -89
- package/docs/TROUBLESHOOTING.md +225 -189
- package/events.ts +28 -22
- package/index.ts +9 -2
- package/opencode-apex.jsonc +150 -132
- package/package.json +32 -6
- package/redact.ts +5 -4
- package/skills/apex-callbacks/SKILL.md +129 -123
package/CHANGELOG.md
CHANGED
|
@@ -1,61 +1,102 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
All notable changes to `opencode-apex`. Format based on
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/); versioning follows [SemVer](https://semver.org/).
|
|
5
|
+
|
|
6
|
+
## [0.2.2] — 2026-10-23
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- The guard's built-in rules for `apex-advisor` were dropped: the validated config always
|
|
11
|
+
carries `guard.agents: {}`, and a shallow merge replaced the defaults. `agents` is now
|
|
12
|
+
merged per agent.
|
|
13
|
+
- `{{payload}}` (the whole payload as JSON) was not substituted in prompt templates. The
|
|
14
|
+
default template uses it, so its prompts came out with the literal placeholder.
|
|
15
|
+
- `apex_list_subscriptions` now also lists the subscriptions from config (`readonly: true`),
|
|
16
|
+
as its description already said.
|
|
17
|
+
- The `apex_subscribe` tool described `agent` as a filter. It is the agent the target session
|
|
18
|
+
is switched to before delivery.
|
|
19
|
+
- The `redact.process` RPC ignored `redact.allowlist`.
|
|
20
|
+
- `~/` was not expanded in `browser.profile` or in `redact.key: "file:~/…"`.
|
|
21
|
+
- Config files with syntax errors were applied partially without any notice. apex now logs
|
|
22
|
+
`config syntax errors in <file> (… @ line N)`.
|
|
23
|
+
- The `browser_target` tool description claimed a `profile` needs no remote debugging. It
|
|
24
|
+
does: apex reads that profile's `DevToolsActivePort`.
|
|
25
|
+
- The template `opencode-apex.jsonc` was invalid JSONC: a multi-line string was silently
|
|
26
|
+
cut. Its `in` filter example also used a wildcard that `in` doesn't support.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- Runtime messages of `tools.run`, server discovery, compatibility warnings and the events
|
|
31
|
+
tool descriptions are now in English.
|
|
32
|
+
- The documentation is now in English and written for readers new to OpenCode plugins and RPC.
|
|
33
|
+
It states that apex is **OpenCode V2 only (≥ 2.1)**.
|
|
34
|
+
- Added an MIT license, and repository metadata pointing to
|
|
35
|
+
https://github.com/aorizondo/opencode-apex.
|
|
36
|
+
|
|
37
|
+
## [0.2.1] — 2026-10-23
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- The version-mismatch warning recommended `opencode plugin update`. In OpenCode 2.1 that
|
|
42
|
+
command only handles TUI plugins, and for server plugins it answers `Plugin is not
|
|
43
|
+
configured`. The warning now gives the procedure that works: stop OpenCode, delete
|
|
44
|
+
`~/.cache/opencode/npm/opencode-apex@*`, start it again.
|
|
45
|
+
|
|
3
46
|
## [0.2.0] — 2026-10-23
|
|
4
47
|
|
|
5
|
-
|
|
6
|
-
|
|
48
|
+
Automations that survive OpenCode V2 unloading plugins: everything comes in through the
|
|
49
|
+
server's RPC.
|
|
7
50
|
|
|
8
51
|
### Breaking
|
|
9
52
|
|
|
10
|
-
- **
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- `apex_set_callback_url`
|
|
15
|
-
|
|
16
|
-
- `apex.status`
|
|
53
|
+
- **Plain HTTP listener removed** (`events.listener`, port 4599). OpenCode unloads a project's
|
|
54
|
+
plugins after 60 minutes without session activity, and the listener closed with the plugin.
|
|
55
|
+
The key is now ignored with a warning. Callbacks come in through `apex/events.ingest`;
|
|
56
|
+
webhooks come in through a relay (n8n or a small daemon) that calls that RPC.
|
|
57
|
+
- `apex_set_callback_url` now sets the **server's public URL**, for senders on other machines
|
|
58
|
+
(a tunnel or reverse proxy to the server's base URL). It used to set the listener's URL.
|
|
59
|
+
- `apex.status` returns `endpoint` instead of `callback`.
|
|
17
60
|
|
|
18
61
|
### Fixed
|
|
19
62
|
|
|
20
|
-
- **
|
|
21
|
-
|
|
22
|
-
- **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- **
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- **
|
|
30
|
-
`@opencode/plugin` 2.1
|
|
63
|
+
- **The `apex` RPC was never registered on OpenCode ≥ 2.1.** The definition used `name`, but
|
|
64
|
+
V2 indexes RPCs by `id`, so every call returned `rpc.unavailable`.
|
|
65
|
+
- **State shared across projects.** The module is imported once per process, yet the main
|
|
66
|
+
session, the ingest handler and the dedup cache were module-level variables. One project
|
|
67
|
+
could deliver events into another project's session, and unloading one project broke
|
|
68
|
+
ingest for the others. The state is now per project.
|
|
69
|
+
- **Binding to another project's session.** OpenCode's event bus is global, so every apex
|
|
70
|
+
instance also bound to new sessions of *other* projects. Events from other projects are
|
|
71
|
+
now ignored.
|
|
72
|
+
- **Did not load on OpenCode 2.1.** apex pinned `effect` 4.0.0-rc.112, while
|
|
73
|
+
`@opencode/plugin` 2.1 uses 4.0.1 (`Schema.isStartsWith is not a function`).
|
|
31
74
|
|
|
32
75
|
### Added
|
|
33
76
|
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
-
|
|
77
|
+
- **`apex/tools.run` RPC.** An external program runs one OpenCode tool (built-in, plugin or
|
|
78
|
+
MCP), with no model involved.
|
|
79
|
+
- Configured in `events.tools`: `allow`, `deny`, the `agent` whose permissions apply, and
|
|
37
80
|
`timeoutMs`.
|
|
38
|
-
-
|
|
39
|
-
- **
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
`opencode serve --port`.
|
|
44
|
-
- **
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
- `
|
|
51
|
-
`@opencode/plugin`.
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
desalinean (ver docs/TROUBLESHOOTING.md).
|
|
57
|
-
- Tests `test/events.test.ts` y scripts `npm test`, `npm run typecheck` y `npm run check:install`.
|
|
81
|
+
- Runs in a hidden per-project runner session (agent `apex-runner`).
|
|
82
|
+
- **Server discovery:** the `apex_callback_endpoint` tool and the `server.info` RPC.
|
|
83
|
+
- They return the base URL, the project's RPC URLs, Basic auth and *where* to read the
|
|
84
|
+
password (never the password itself), plus curl examples.
|
|
85
|
+
- The base URL comes from `events.server.url`, then the background service record (matched
|
|
86
|
+
by pid), then `opencode serve --port`.
|
|
87
|
+
- **The `apex-callbacks` skill ships with the package** and registers itself. It covers
|
|
88
|
+
stateful watchers, systemd/cron, the webhook relay and n8n, and `tools.run`.
|
|
89
|
+
- **Staying compatible with OpenCode releases.**
|
|
90
|
+
- `effect` is no longer a direct dependency: it is an optional peer, satisfied by
|
|
91
|
+
`@opencode/plugin`'s copy.
|
|
92
|
+
- `@opencode/plugin` and `@opencode/plugin-browser` use `^2.1.1`.
|
|
93
|
+
- Load-time warning (`core/compat.ts`) when there are two copies of `effect`, or when
|
|
94
|
+
OpenCode is newer than the installed `@opencode/plugin`.
|
|
95
|
+
- `prepublishOnly` installs the package the way OpenCode does and fails if the
|
|
96
|
+
dependencies drift (see docs/TROUBLESHOOTING.md).
|
|
97
|
+
- Tests in `test/events.test.ts`, and the `npm test`, `npm run typecheck` and
|
|
98
|
+
`npm run check:install` scripts.
|
|
58
99
|
|
|
59
100
|
## [0.1.0]
|
|
60
101
|
|
|
61
|
-
|
|
102
|
+
First published version.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Antonio Orizondo Leyva
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|