headroom-opencode 0.41.0 → 0.43.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/README.md CHANGED
@@ -11,6 +11,25 @@ OpenCode integration helpers for Headroom. The package supports two integration
11
11
  npm install headroom-opencode
12
12
  ```
13
13
 
14
+ ## Building from source
15
+
16
+ Tsup 9 requires Node.js `^22.18.0 || ^24.11.0 || >=26.0.0`. The current locked
17
+ graph also includes ini 7, which requires `^22.22.2 || ^24.15.0 || >=26.0.0`.
18
+ These are development-install requirements; the published plugin and its host
19
+ retain their own runtime requirements. Node.js 24.22.2 is a verified choice
20
+ for this dependency graph. From `plugins/opencode`, run:
21
+
22
+ ```bash
23
+ npm ci
24
+ npm test
25
+ npm run typecheck
26
+ npm run build
27
+ npm run build:standalone
28
+ ```
29
+
30
+ For a reproducible real OpenCode 2.x → proxy → local SSE upstream check, see
31
+ [the transport runtime proof](RUNTIME_PROOF.md). It records the tested scope and limitations.
32
+
14
33
  ## Provider Config Helpers
15
34
 
16
35
  Use these helpers when you need to generate OpenCode config that routes a `headroom` provider through a running Headroom proxy.
@@ -57,7 +76,7 @@ The default export is `{ id: "headroom", server, setup }`. OpenCode 1.x calls `s
57
76
 
58
77
  On 2.x, setup returns a cleanup that releases the transport, so hot reloads do not stack interceptors.
59
78
 
60
- OpenCode 2.x keeps its own reference to `fetch` from before plugins load, so patching `fetch` alone does not catch its model traffic. On 2.x the plugin also rewrites each remote model that uses the OpenAI chat-completions or responses format so that it points at the proxy. Headers name the real upstream, as the transport does. Models on other formats (Anthropic messages, Google) are left alone. `headroom wrap opencode` routes native Anthropic and OpenAI through the proxy separately, via their `baseURL`.
79
+ OpenCode 2.x keeps its own reference to `fetch` from before plugins load, so patching `fetch` alone does not catch its model traffic. For models with a resolved `baseURL`, the plugin also rewrites OpenAI chat-completions, Responses, and Anthropic Messages traffic so that it points at the proxy — including GitHub Copilot's Claude models. Anthropic Messages base URLs with a path prefix (for example a gateway rooted at `/api/...`) stay on their own base URL, because the proxy's Messages route ignores the original-path header and cannot preserve that prefix. Headers name the real upstream and request path, as the transport does, and authentication settings are retained. Local, excluded, and unsupported-protocol models are left alone. `headroom wrap opencode` routes native Anthropic and OpenAI through the proxy separately, via their `baseURL`.
61
80
 
62
81
  To keep a provider off the proxy, list its host. An entry matches the host and all of its subdomains, and `.example.com` / `*.example.com` are accepted as spellings of `example.com`:
63
82