mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
Bumps the npm-minor-patch group with 12 updates in the /docs directory: | Package | From | To | | --- | --- | --- | | [fumadocs-core](https://github.com/fuma-nama/fumadocs) | `16.10.3` | `16.11.1` | | [fumadocs-mdx](https://github.com/fuma-nama/fumadocs) | `15.0.12` | `15.1.0` | | [fumadocs-twoslash](https://github.com/fuma-nama/fumadocs) | `3.1.15` | `3.3.0` | | [fumadocs-ui](https://github.com/fuma-nama/fumadocs) | `16.10.3` | `16.11.1` | | [next](https://github.com/vercel/next.js) | `16.2.6` | `16.2.10` | | [react](https://github.com/facebook/react/tree/HEAD/packages/react) | `19.2.4` | `19.2.7` | | [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `19.2.14` | `19.2.17` | | [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) | `19.2.4` | `19.2.7` | | [recharts](https://github.com/recharts/recharts) | `3.8.1` | `3.9.2` | | [@tailwindcss/postcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-postcss) | `4.2.2` | `4.3.2` | | [@types/mdx](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mdx) | `2.0.13` | `2.0.14` | | [postcss](https://github.com/postcss/postcss) | `8.5.15` | `8.5.16` | Bumps the npm-minor-patch group with 1 update in the /plugins/openclaw directory: [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest). Bumps the npm-minor-patch group with 2 updates in the /plugins/opencode directory: [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) and @opencode-ai/plugin. Bumps the npm-minor-patch group with 3 updates in the /sdk/typescript directory: [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest), [@anthropic-ai/sdk](https://github.com/anthropics/anthropic-sdk-typescript) and [dotenv](https://github.com/motdotla/dotenv). Updates `fumadocs-core` from 16.10.3 to 16.11.1 <details> <summary>Commits</summary> <ul> <li><a href=" |
||
|---|---|---|
| .. | ||
| hook-shim | ||
| src | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsup.config.ts | ||
| vitest.config.ts | ||
headroom-opencode
OpenCode integration helpers for Headroom. The package supports two integration paths:
- Provider config helpers used by
headroom wrap opencodeand persistent installs. - A native OpenCode plugin that installs Headroom transport interception and exposes the retrieve tool.
Install
npm install headroom-opencode
Provider Config Helpers
Use these helpers when you need to generate OpenCode config that routes a headroom provider through a running Headroom proxy.
import {
buildOpencodeConfigContent,
createHeadroomProvider,
} from "headroom-opencode";
const provider = createHeadroomProvider({ proxyPort: 8787 });
const config = buildOpencodeConfigContent({
proxyPort: 8787,
defaultModel: "claude-sonnet-4-6",
});
console.log(provider.provider.headroom.npm);
console.log(config.model);
The generated provider uses @ai-sdk/openai-compatible and points model requests at http://127.0.0.1:<port>/v1.
Native OpenCode Plugin
Use HeadroomPlugin when OpenCode should intercept provider traffic in-process and expose Headroom tooling from a plugin.
import { HeadroomPlugin } from "headroom-opencode";
export default async function plugin(input) {
return HeadroomPlugin(input, {
proxyUrl: process.env.HEADROOM_PROXY_URL ?? "http://127.0.0.1:8787",
});
}
HeadroomPlugin:
- installs Headroom transport interception for OpenCode provider traffic.
- exposes the
headroom_retrievetool. - publishes
HEADROOM_PROXY_URLin the plugin output env. - defaults to
http://127.0.0.1:8787when no proxy URL is supplied.
Retrieve Tool
import { createHeadroomRetrieveTool } from "headroom-opencode";
const retrieve = createHeadroomRetrieveTool({
proxyBaseUrl: "http://127.0.0.1:8787",
});
const result = await retrieve.execute({
hash: "0123456789abcdef01234567",
});
The tool calls /v1/retrieve/<hash> on the Headroom proxy.
Compression Helper
import { compressWithHeadroom } from "headroom-opencode";
const result = await compressWithHeadroom(
[{ role: "user", content: "Summarize this file" }],
{ model: "gpt-4o", proxyUrl: "http://127.0.0.1:8787" },
);
console.log(`Saved ${result.tokensSaved} tokens`);
Models
| Model | Context | Output |
|---|---|---|
claude-sonnet-4-6 |
200K | 16K |
claude-opus-4-6 |
200K | 16K |
claude-haiku-4-5-20251001 |
200K | 8K |
gpt-4o |
128K | 16K |
gpt-4.1 |
1M | 32K |
The provider config exposes these as headroom/<model> and defaults to headroom/claude-sonnet-4-6.
Environment
| Variable | Used by | Description |
|---|---|---|
HEADROOM_PROXY_URL |
Native plugin | Proxy URL used by HeadroomPlugin |
OPENCODE_CONFIG_CONTENT |
OpenCode wrapper | Generated OpenCode provider, model, and MCP config |
License
Apache-2.0