antechamber 0.0.0-stage → 0.1.1
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 +166 -0
- package/LICENSE +22 -0
- package/README.md +316 -2
- package/bin/opencode-antechamber +18 -0
- package/bin/opencode-pi +3 -0
- package/dist/agent-dir.d.ts +6 -0
- package/dist/agent-dir.js +21 -0
- package/dist/agent-name.d.ts +24 -0
- package/dist/agent-name.js +110 -0
- package/dist/approvals.d.ts +86 -0
- package/dist/approvals.js +520 -0
- package/dist/catalog.d.ts +88 -0
- package/dist/catalog.js +118 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +86 -0
- package/dist/commands/context.d.ts +26 -0
- package/dist/commands/context.js +89 -0
- package/dist/commands/doctor.d.ts +13 -0
- package/dist/commands/doctor.js +92 -0
- package/dist/commands/help.d.ts +1 -0
- package/dist/commands/help.js +15 -0
- package/dist/commands/serve.d.ts +8 -0
- package/dist/commands/serve.js +29 -0
- package/dist/commands/setup.d.ts +14 -0
- package/dist/commands/setup.js +137 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.js +40 -0
- package/dist/http.d.ts +18 -0
- package/dist/http.js +168 -0
- package/dist/lifecycle.d.ts +43 -0
- package/dist/lifecycle.js +138 -0
- package/dist/misc-routes.d.ts +8 -0
- package/dist/misc-routes.js +119 -0
- package/dist/pi-event-translation.d.ts +79 -0
- package/dist/pi-event-translation.js +643 -0
- package/dist/pi-rpc.d.ts +74 -0
- package/dist/pi-rpc.js +291 -0
- package/dist/pidfd.d.ts +2 -0
- package/dist/pidfd.js +28 -0
- package/dist/question-forms.d.ts +30 -0
- package/dist/question-forms.js +46 -0
- package/dist/route-services.d.ts +26 -0
- package/dist/route-services.js +33 -0
- package/dist/routes-v1.d.ts +4 -0
- package/dist/routes-v1.js +346 -0
- package/dist/routes-v2.d.ts +4 -0
- package/dist/routes-v2.js +477 -0
- package/dist/server.d.ts +28 -0
- package/dist/server.js +113 -0
- package/dist/session-commands.d.ts +83 -0
- package/dist/session-commands.js +332 -0
- package/dist/session-diff.d.ts +14 -0
- package/dist/session-diff.js +152 -0
- package/dist/session-history.d.ts +35 -0
- package/dist/session-history.js +421 -0
- package/dist/session-hosts.d.ts +3 -0
- package/dist/session-hosts.js +188 -0
- package/dist/session-store.d.ts +103 -0
- package/dist/session-store.js +339 -0
- package/dist/session-tree.d.ts +58 -0
- package/dist/session-tree.js +287 -0
- package/dist/sessions.d.ts +175 -0
- package/dist/sessions.js +1124 -0
- package/dist/sse.d.ts +19 -0
- package/dist/sse.js +92 -0
- package/dist/subagents.d.ts +64 -0
- package/dist/subagents.js +625 -0
- package/dist/thinking-levels.d.ts +17 -0
- package/dist/thinking-levels.js +24 -0
- package/dist/todo-bridge.d.ts +26 -0
- package/dist/todo-bridge.js +100 -0
- package/dist/tool-map.d.ts +32 -0
- package/dist/tool-map.js +349 -0
- package/dist/types.d.ts +350 -0
- package/dist/types.js +6 -0
- package/dist/v2.d.ts +190 -0
- package/dist/v2.js +560 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +13 -0
- package/extensions/omo-dag/README.md +159 -0
- package/extensions/omo-dag/docs/DESIGN.md +105 -0
- package/extensions/omo-dag/icon.svg +1 -0
- package/extensions/omo-dag/package.json +33 -0
- package/extensions/omo-dag/panel/index.html +179 -0
- package/extensions/omo-dag/panel/main.js +176 -0
- package/extensions/omo-dag/service/main.js +378 -0
- package/package.json +77 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project uses [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.1] - 2026-10-14
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Sessions now report `cost` (USD) from OmO's per-message usage, live and from
|
|
15
|
+
history, on v1 session payloads and v2 session reads. Subagent sessions carry
|
|
16
|
+
their own cost, so OpenChamber's work-status panel shows the session total
|
|
17
|
+
with its session/subagents breakdown.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- `/compact` now shows progress and its result. The session turns busy while
|
|
22
|
+
OmO compacts, and the summary appears as a `/compact` turn with a summary
|
|
23
|
+
reply, live and after reload. The compact RPC now waits up to OmO's own
|
|
24
|
+
30-minute compaction budget instead of giving up after 60 seconds, which left
|
|
25
|
+
the compaction running unseen until a later abort reported it cancelled.
|
|
26
|
+
- Reverting no longer adds a "Conversation reverted. Files were not changed."
|
|
27
|
+
card to the transcript; OpenChamber's own reverted-message dock (driven by
|
|
28
|
+
`session.revert`) already shows the state.
|
|
29
|
+
- Sessions opened with a slash command (for example `/skill:plan Build the
|
|
30
|
+
importer`) now get a generated title. OmO skips titling slash-led prompts, so
|
|
31
|
+
the adapter passes the command's arguments as the native `sessionTitlePrompt`.
|
|
32
|
+
|
|
33
|
+
## [0.1.0] - 2026-10-14
|
|
34
|
+
|
|
35
|
+
First standalone release under the `antechamber` name.
|
|
36
|
+
|
|
37
|
+
### Renamed
|
|
38
|
+
|
|
39
|
+
This project was previously published as `openchamber-pi-connector`. The
|
|
40
|
+
rename affects:
|
|
41
|
+
|
|
42
|
+
- Package and CLI binary: `openchamber-pi-connector` / `opencode-pi` to
|
|
43
|
+
`antechamber` (`dist/cli.js`, bin name `antechamber`).
|
|
44
|
+
- Launcher script: `bin/opencode-antechamber` is the new OpenChamber launcher;
|
|
45
|
+
`bin/opencode-pi` is kept as a deprecated shim that forwards to it, so
|
|
46
|
+
existing `settings.opencodeBinary` values keep working.
|
|
47
|
+
- Environment variables: all settings now read the `ANTECHAMBER_` prefix
|
|
48
|
+
first (for example `ANTECHAMBER_PI_BINARY`, `ANTECHAMBER_STATE_DIR`,
|
|
49
|
+
`ANTECHAMBER_AGENT`, `ANTECHAMBER_IDLE_TIMEOUT_MS`, `ANTECHAMBER_MAX_LIVE`,
|
|
50
|
+
`ANTECHAMBER_DEBUG`). The previous `OCPI_` prefix is still accepted as a
|
|
51
|
+
deprecated fallback; migrate at your own pace.
|
|
52
|
+
- State directory: defaults to `~/.config/antechamber`. If that directory
|
|
53
|
+
doesn't exist yet but the legacy `~/.config/openchamber-pi-connector`
|
|
54
|
+
does, the legacy directory is used automatically so existing session
|
|
55
|
+
registries keep working across the upgrade. Move the directory manually
|
|
56
|
+
once you're ready to drop the fallback.
|
|
57
|
+
- No action needed for most users: both the binary and environment variable
|
|
58
|
+
fallbacks mean an existing OpenChamber `settings.json` pointing at
|
|
59
|
+
`opencode-pi` keeps working unchanged.
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
|
|
63
|
+
- OmO is now the default backend: antechamber spawns `omo` unless
|
|
64
|
+
`ANTECHAMBER_PI_BINARY` says otherwise, and the agent directory follows
|
|
65
|
+
OmO's resolution (`OMO_CODING_AGENT_DIR` > `SENPI_CODING_AGENT_DIR` >
|
|
66
|
+
`PI_CODING_AGENT_DIR`, default `~/.omo/agent`; `~/.pi/agent` when the backend
|
|
67
|
+
is `pi`). A standard OmO install is advertised as the `OmO` agent without
|
|
68
|
+
setting `ANTECHAMBER_AGENT`. Plain pi remains available as an opt-in,
|
|
69
|
+
best-effort backend (`ANTECHAMBER_PI_BINARY=pi`).
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
|
|
73
|
+
- OmO Graph, an OpenChamber extension in `extensions/omo-dag`. It draws the
|
|
74
|
+
OmO sub-agents behind the open session as a live graph:
|
|
75
|
+
- cards are grouped in waves and show each sub-agent's state, duration,
|
|
76
|
+
agent and model;
|
|
77
|
+
- hovering a card highlights its input and output edges;
|
|
78
|
+
- clicking a card opens the sub-agent's session.
|
|
79
|
+
|
|
80
|
+
The extension is built by `npm run build`, is covered by `npm test`,
|
|
81
|
+
typecheck and lint, and ships in the npm package. It reads OmO's task store
|
|
82
|
+
and the session registry read-only, through an OpenChamber-managed local
|
|
83
|
+
service.
|
|
84
|
+
- `antechamber setup` ends by printing the bundled OmO Graph extension folder
|
|
85
|
+
to add in OpenChamber (Settings → Extensions → Add → Folder), and every
|
|
86
|
+
GitHub release attaches `antechamber-omo-graph.zip`, installable from
|
|
87
|
+
OpenChamber by URL
|
|
88
|
+
(`https://github.com/eliottness/antechamber/releases/latest/download/antechamber-omo-graph.zip`).
|
|
89
|
+
- npm-first installation with `antechamber setup`: settings discovery,
|
|
90
|
+
isolated profiles, executable selection, timestamped backups, idempotency,
|
|
91
|
+
dry-run plans, and optional systemd user drop-ins with explicit restart.
|
|
92
|
+
- Read-only `antechamber doctor` diagnostics with text/JSON output, backend
|
|
93
|
+
checks, agent/state directory checks, OpenChamber wiring and pidfd capability.
|
|
94
|
+
- Explicit `serve`, `setup`, `doctor`, `version`, and `help` commands. Package
|
|
95
|
+
versions now come from `package.json`; the OpenChamber `--version` probe
|
|
96
|
+
keeps advertising `opencode v2.0.18`.
|
|
97
|
+
- Public npm publication configuration with provenance and an executable
|
|
98
|
+
built CLI, plus installation, upgrade and rollback documentation.
|
|
99
|
+
- Tag-driven release workflow: a `vX.Y.Z` tag runs the checks, publishes to
|
|
100
|
+
npm with provenance (trusted publishing or `NPM_TOKEN`) and creates the
|
|
101
|
+
GitHub release from this file. See [docs/releasing.md](docs/releasing.md).
|
|
102
|
+
- Security hardening: optional HTTP Basic auth (`OPENCODE_SERVER_PASSWORD`),
|
|
103
|
+
`Origin` checks for unauthenticated servers, a non-loopback-bind guard, and
|
|
104
|
+
request/SSE/search limits. See [docs/configuration.md](docs/configuration.md#security).
|
|
105
|
+
- OpenCode v2 API support (`@opencode-ai/sdk/v2`), alongside the original v1
|
|
106
|
+
surface, covering the endpoints OpenChamber >= 2.0.4 depends on.
|
|
107
|
+
- [OmO](https://github.com/omo-ai) backend support (a pi-compatible
|
|
108
|
+
coding-agent distribution, aka senpi / oh-my-pi), including OmO-specific
|
|
109
|
+
session-tree fork/revert/unrevert, subagent and task cards, todo bridging,
|
|
110
|
+
and thinking-level mapping.
|
|
111
|
+
- Session fork, revert, and unrevert backed by the agent's native session
|
|
112
|
+
tree rather than a filesystem snapshot.
|
|
113
|
+
- Subagent and task cards rendered as native OpenChamber tool parts.
|
|
114
|
+
- Approval and question bridging through the agent's extension-UI protocol.
|
|
115
|
+
- Thinking-level selection surfaced through OpenChamber's model picker.
|
|
116
|
+
- Shell run cards (user-invoked `!command` execution) with cancellation.
|
|
117
|
+
- Session diff endpoint returning a unified patch independent of
|
|
118
|
+
OpenChamber's own git integration.
|
|
119
|
+
- Session persistence and revival across connector restarts.
|
|
120
|
+
- Idle session reaping and a configurable cap on concurrent live agent
|
|
121
|
+
processes (lifecycle caps).
|
|
122
|
+
|
|
123
|
+
### Fixed
|
|
124
|
+
|
|
125
|
+
- Slash commands sent through `POST /session/:id/command` (for example
|
|
126
|
+
`/skill:<name> ...`) now reuse OpenChamber's client `messageID`, so the user
|
|
127
|
+
message no longer appears twice in the chat.
|
|
128
|
+
- With a server password configured, requests carrying a non-loopback
|
|
129
|
+
`Origin` (forwarded by OpenChamber's proxy for LAN browsers and the desktop
|
|
130
|
+
app) are no longer rejected with 403; the password is the boundary.
|
|
131
|
+
- Turn statistics now use the native assistant stop reason independently of
|
|
132
|
+
usage, normalize tool-call finishes, and preserve tokens, cost, errors, and
|
|
133
|
+
response-model attribution in v1 and v2 history. Restored messages retain
|
|
134
|
+
their provider-to-append duration when valid timestamps are available.
|
|
135
|
+
- Native session titles replace provisional first-message titles and persist
|
|
136
|
+
through reload and revival. Explicit user titles win over delayed native
|
|
137
|
+
generation; scans read the latest native name even beyond the transcript
|
|
138
|
+
head limit. Both OmO and Senpi client capability variables now advertise
|
|
139
|
+
`auto_title_sessions` and `question` while preserving inherited capabilities.
|
|
140
|
+
Historical title generation for old unnamed sessions is deferred to a
|
|
141
|
+
follow-up; existing native names are restored without adding a conversation
|
|
142
|
+
turn.
|
|
143
|
+
- Busy prompts now carry native steer/follow-up admission behavior and stable
|
|
144
|
+
client message IDs instead of waiting behind a running turn until the RPC
|
|
145
|
+
timeout. v1 defaults to steering; v2 validates and honors steer/queue delivery,
|
|
146
|
+
publishes inbox acceptance and consumption, and restores durable pending
|
|
147
|
+
input without duplicating consumed user cards or changing assistant parents.
|
|
148
|
+
- Structured `ask_user_question` requests now remain visible after a
|
|
149
|
+
nonblocking tool finishes. OpenChamber 1.24.2 receives v1 question
|
|
150
|
+
events and lists; OpenChamber 2.x receives native forms, including
|
|
151
|
+
multiselect, custom text, partial answers, comments, and cancellation.
|
|
152
|
+
Replies use correlated native acknowledgments rather than sending a
|
|
153
|
+
duplicate prompt.
|
|
154
|
+
- Pending native questions hydrate on session revival with stable public
|
|
155
|
+
IDs and refreshed connection IDs. Dormant-session dangling-question
|
|
156
|
+
scanning without revival is deliberately omitted: those questions enter
|
|
157
|
+
lists only after revival. Native repeated-crash recovery limitations
|
|
158
|
+
remain; no native recovery code is changed.
|
|
159
|
+
|
|
160
|
+
### History
|
|
161
|
+
|
|
162
|
+
Everything before this release lived under the `openchamber-pi-connector`
|
|
163
|
+
name, originally authored by qingzhu521 (xiuli.qz) as a minimal pi-backed
|
|
164
|
+
OpenCode-API adapter for OpenChamber, and MIT-licensed. This fork retained
|
|
165
|
+
that license and extended the project substantially; see the README's
|
|
166
|
+
Credits section.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 openchamber-pi contributors
|
|
4
|
+
Copyright (c) 2026 antechamber contributors
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,3 +1,317 @@
|
|
|
1
|
-
#
|
|
1
|
+
# antechamber
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A local OpenCode-compatible HTTP/SSE server that lets [OpenChamber](https://github.com/openchamber/openchamber) drive [OmO](https://github.com/code-yeongyu/oh-my-openagent) instead of OpenCode. Plain [pi](https://github.com/badlogic/pi-mono) also works as an opt-in backend.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/eliottness/antechamber/actions/workflows/ci.yml)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
|
|
8
|
+
## What it is
|
|
9
|
+
|
|
10
|
+
OpenChamber only speaks the OpenCode HTTP/SSE API. OmO (and pi, which it
|
|
11
|
+
builds on) are headless agents with their own RPC protocol (JSONL over stdio). antechamber sits
|
|
12
|
+
between them: it implements the subset of the OpenCode API that OpenChamber
|
|
13
|
+
actually uses, and translates every call into an OmO RPC session.
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
OpenChamber (UI) --OpenCode API (HTTP/SSE)--> antechamber --JSONL/stdio--> omo --mode rpc
|
|
17
|
+
(one process per session)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
No fork of OpenChamber or pi is required. Point OpenChamber at antechamber as
|
|
21
|
+
an **external OpenCode server** and sessions run on OmO.
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
- Session create/list/rename/archive/delete, prompt streaming (text and
|
|
26
|
+
reasoning deltas), and abort, mapped onto pi/OmO RPC sessions.
|
|
27
|
+
- Tool calls rendered as native OpenChamber tool parts (bash, write, edit,
|
|
28
|
+
and so on), including subagent/task cards.
|
|
29
|
+
- Approvals and questions bridged through pi's extension-UI protocol.
|
|
30
|
+
- Todo list bridging from pi/OmO's todo tool to OpenChamber's task panel.
|
|
31
|
+
- Fork, revert, and unrevert backed by the agent's session tree, not a
|
|
32
|
+
filesystem snapshot. Reverting changes conversation context only; it never
|
|
33
|
+
touches files on disk.
|
|
34
|
+
- Session diff endpoint (unified patch) independent of OpenChamber's own git
|
|
35
|
+
integration.
|
|
36
|
+
- Session persistence and revival across connector restarts, with explicit
|
|
37
|
+
ownership tracking for detached task-host processes it spawned.
|
|
38
|
+
- Idle reaping and a live-process cap (`ANTECHAMBER_MAX_LIVE`) so long-running
|
|
39
|
+
deployments don't accumulate agent processes.
|
|
40
|
+
- An optional OpenChamber extension, **OmO Graph**, that draws the OmO
|
|
41
|
+
sub-agents behind the open session as a live, clickable graph (see
|
|
42
|
+
[OpenChamber extension](#openchamber-extension-omo-graph)).
|
|
43
|
+
|
|
44
|
+
## Supported backends
|
|
45
|
+
|
|
46
|
+
| Backend | Status |
|
|
47
|
+
|---|---|
|
|
48
|
+
| [OmO](https://github.com/code-yeongyu/oh-my-openagent) (`omo`, package `omo-ai`) | **default and supported**: titles, steering, subagent cards, structured questions, and private task-host teardown are built and tested against it |
|
|
49
|
+
| [pi](https://github.com/badlogic/pi-mono) (`@earendil-works/pi-coding-agent`) | opt-in, best effort: set `ANTECHAMBER_PI_BINARY=pi`; OmO-specific features are unavailable |
|
|
50
|
+
|
|
51
|
+
antechamber spawns `omo` from `PATH` unless `ANTECHAMBER_PI_BINARY` names
|
|
52
|
+
another executable (see [docs/configuration.md](docs/configuration.md)).
|
|
53
|
+
|
|
54
|
+
## Compatibility
|
|
55
|
+
|
|
56
|
+
| OpenChamber | API | Status |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| >= 2.0.4 | v2 (`@opencode-ai/sdk/v2`) | primary target; antechamber advertises `opencode v2.0.18` on `--version` |
|
|
59
|
+
| 1.24.x | v1 | supported |
|
|
60
|
+
| other versions | - | not tested |
|
|
61
|
+
|
|
62
|
+
OpenChamber changes which OpenCode API calls it makes between releases. If a
|
|
63
|
+
feature breaks on a newer OpenChamber, run `npm run smoke` to see which check
|
|
64
|
+
failed, then open an issue with the output. See
|
|
65
|
+
[docs/api-surface.md](docs/api-surface.md) for the exact endpoints antechamber
|
|
66
|
+
implements.
|
|
67
|
+
|
|
68
|
+
## Quick start
|
|
69
|
+
|
|
70
|
+
Needs Node.js 22+ and OmO's `omo` command on PATH (`bun add -g omo-ai`).
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm i -g antechamber
|
|
74
|
+
# or: bun add -g antechamber
|
|
75
|
+
antechamber doctor
|
|
76
|
+
antechamber setup
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The first npm publication (0.1.0) is part of the
|
|
80
|
+
[release process](docs/releasing.md). If it is not on the registry yet, use
|
|
81
|
+
[From source](#from-source) below.
|
|
82
|
+
|
|
83
|
+
`setup` updates OpenChamber's `opencodeBinary`, preserves all other settings,
|
|
84
|
+
and backs up an existing settings file before changing it. Restart OpenChamber
|
|
85
|
+
after setup. Preview changes with `antechamber setup --dry-run`.
|
|
86
|
+
|
|
87
|
+
Optionally, add the bundled [OmO Graph extension](#openchamber-extension-omo-graph):
|
|
88
|
+
`setup` ends by printing its folder
|
|
89
|
+
(`$(npm root -g)/antechamber/extensions/omo-dag`). In OpenChamber, open
|
|
90
|
+
**Settings → Extensions → Add → Folder**, paste that path, and approve the two
|
|
91
|
+
permissions it asks for. The folder is updated in place by `npm update -g`.
|
|
92
|
+
|
|
93
|
+
For an isolated OpenChamber instance, leaving your main settings untouched:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
antechamber setup --profile ~/.config/antechamber-openchamber
|
|
97
|
+
# setup prints the command for this profile:
|
|
98
|
+
OPENCHAMBER_DATA_DIR=~/.config/antechamber-openchamber openchamber serve --port 57124
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
For a systemd-managed OpenChamber, also capture the shell's PATH and the
|
|
102
|
+
absolute OmO executable in a user service drop-in:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
antechamber setup --systemd
|
|
106
|
+
# default unit: openchamber.service; another unit: --systemd my-openchamber.service
|
|
107
|
+
systemctl --user daemon-reload && systemctl --user restart openchamber.service
|
|
108
|
+
# or explicitly let setup run those commands:
|
|
109
|
+
antechamber setup --systemd --restart
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`--pi-binary /absolute/path/to/omo` overrides backend discovery for the drop-in.
|
|
113
|
+
Other drop-ins setting `ANTECHAMBER_*` or `OCPI_*` produce a warning: later
|
|
114
|
+
files can override the generated configuration. `setup` never runs systemctl
|
|
115
|
+
unless `--restart` is passed.
|
|
116
|
+
|
|
117
|
+
OpenChamber spawns whatever `settings.opencodeBinary` points at as
|
|
118
|
+
`serve --hostname H --port P`, waits for the stdout line
|
|
119
|
+
`opencode server listening on <url>`, then health-checks `/global/health`.
|
|
120
|
+
The installed `antechamber` bin implements this contract itself, including the
|
|
121
|
+
`--version` compatibility probe. `bin/opencode-antechamber` is only needed for
|
|
122
|
+
source checkouts; `bin/opencode-pi` remains a deprecated compatibility shim.
|
|
123
|
+
|
|
124
|
+
You can also run antechamber directly, outside of OpenChamber's managed
|
|
125
|
+
lifecycle:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
antechamber --port 4096 --host 127.0.0.1 --directory /path/to/project
|
|
129
|
+
# or, OpenCode-compatible:
|
|
130
|
+
antechamber serve --hostname 127.0.0.1 --port 4096
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Commands
|
|
134
|
+
|
|
135
|
+
| Command | Purpose / options |
|
|
136
|
+
|---|---|
|
|
137
|
+
| `antechamber serve` | OpenCode-compatible server; `--hostname`/`--host`, `--port`, `--directory`. Bare `antechamber` also starts the server. |
|
|
138
|
+
| `antechamber setup` | Configure OpenChamber; `--settings <file>`, `--profile <dir>`, `--binary <path>`, `--dry-run`, `--systemd [unit]`, `--pi-binary <path>`, `--restart`. |
|
|
139
|
+
| `antechamber doctor` | Read-only Node, backend, agent/state directories, teardown, OpenChamber and auth checks; `--json`, `--settings <file>`, `--profile <dir>`. Exits 1 on any FAIL; warnings do not fail. |
|
|
140
|
+
| `antechamber version` | Package version plus OpenCode API contract version. `--version`/`-v` deliberately print exactly `opencode v2.0.18` for OpenChamber. |
|
|
141
|
+
| `antechamber help` | Usage and options; also `--help`/`-h`. |
|
|
142
|
+
|
|
143
|
+
## Upgrade, uninstall and rollback
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
npm update -g antechamber
|
|
147
|
+
# or: bun add -g antechamber
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Restart OpenChamber, or `systemctl --user restart openchamber.service` for a
|
|
151
|
+
managed service. Run `antechamber doctor` again. If the executable moved,
|
|
152
|
+
rerun `antechamber setup`.
|
|
153
|
+
|
|
154
|
+
To roll back wiring, copy the backup printed by setup over the settings file:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
cp /path/settings.json.bak-antechamber-YYYYMMDDHHMMSS /path/settings.json
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
If you used `--systemd`, restore the printed `antechamber.conf` backup, or
|
|
161
|
+
remove only that generated drop-in if there was no previous file. Then run
|
|
162
|
+
`systemctl --user daemon-reload` and restart OpenChamber/the service. Restore
|
|
163
|
+
the old `opencodeBinary` before uninstalling:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
npm uninstall -g antechamber
|
|
167
|
+
# or: bun remove -g antechamber
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## From source
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
git clone https://github.com/eliottness/antechamber.git
|
|
174
|
+
cd antechamber
|
|
175
|
+
npm ci
|
|
176
|
+
npm run build
|
|
177
|
+
node dist/cli.js doctor
|
|
178
|
+
node dist/cli.js setup --binary "$PWD/bin/opencode-antechamber"
|
|
179
|
+
# isolated alternative:
|
|
180
|
+
node dist/cli.js setup --profile ~/.config/antechamber-openchamber \
|
|
181
|
+
--binary "$PWD/bin/opencode-antechamber"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
The source launcher requires the built `dist/cli.js`. Pull updates, run
|
|
185
|
+
`npm ci && npm run build`, and restart OpenChamber.
|
|
186
|
+
|
|
187
|
+
`npm run build` also builds the OmO Graph extension; `setup` prints its folder
|
|
188
|
+
(`$PWD/extensions/omo-dag`) to add in **Settings → Extensions → Add → Folder**.
|
|
189
|
+
|
|
190
|
+
## OpenChamber extension: OmO Graph
|
|
191
|
+
|
|
192
|
+
`extensions/omo-dag` is an OpenChamber extension that ships with antechamber
|
|
193
|
+
and is built by `npm run build`. With the default OmO backend, it adds a rail panel
|
|
194
|
+
showing the open session's orchestrator and every sub-agent OmO launched,
|
|
195
|
+
grouped in waves:
|
|
196
|
+
|
|
197
|
+
- each card shows the sub-agent's live state, duration, agent and model;
|
|
198
|
+
- hovering a card highlights its input and output edges;
|
|
199
|
+
- clicking a card opens that sub-agent's session.
|
|
200
|
+
|
|
201
|
+
It reads OmO's task store and antechamber's session registry read-only,
|
|
202
|
+
through a small local service that OpenChamber starts.
|
|
203
|
+
|
|
204
|
+
Install it from OpenChamber's **Settings → Extensions → Add**, using whichever
|
|
205
|
+
source fits where OpenChamber runs:
|
|
206
|
+
|
|
207
|
+
| OpenChamber runs | Add | Value |
|
|
208
|
+
|---|---|---|
|
|
209
|
+
| on the machine where antechamber is installed | **Folder** | the path `antechamber setup` prints: `$(npm root -g)/antechamber/extensions/omo-dag` for npm installs, `<checkout>/extensions/omo-dag` after `npm run build` from source |
|
|
210
|
+
| anywhere (remote host, browser-only access) | **URL** | `https://github.com/eliottness/antechamber/releases/latest/download/antechamber-omo-graph.zip` (attached to every GitHub release) |
|
|
211
|
+
| anywhere, offline | **ZIP file** | that same `antechamber-omo-graph.zip`, downloaded, or built with `npm run build && npm run pack:extension -- antechamber-omo-graph.zip` |
|
|
212
|
+
|
|
213
|
+
Then approve its two permissions (follow sessions, run the local service) and
|
|
214
|
+
open it from the rail icon. Don't install it from the repository's Git URL:
|
|
215
|
+
OpenChamber clones the repository root, which is antechamber itself, not the
|
|
216
|
+
extension, and refuses it as an invalid manifest. Details:
|
|
217
|
+
[extensions/omo-dag/README.md](extensions/omo-dag/README.md).
|
|
218
|
+
|
|
219
|
+
## Configuration
|
|
220
|
+
|
|
221
|
+
All settings are environment variables prefixed `ANTECHAMBER_`. The
|
|
222
|
+
deprecated `OCPI_` prefix is still accepted as a fallback for existing
|
|
223
|
+
deployments. Full reference, defaults, and units: [docs/configuration.md](docs/configuration.md).
|
|
224
|
+
|
|
225
|
+
| Variable | Purpose |
|
|
226
|
+
|---|---|
|
|
227
|
+
| `ANTECHAMBER_PI_BINARY` | agent executable to spawn (default `omo`; set to `pi` for plain pi) |
|
|
228
|
+
| `ANTECHAMBER_PI_ARGS` | extra whitespace-split args passed to that binary |
|
|
229
|
+
| `ANTECHAMBER_STATE_DIR` | session registry directory |
|
|
230
|
+
| `ANTECHAMBER_AGENT` | agent name override advertised to OpenChamber |
|
|
231
|
+
| `ANTECHAMBER_IDLE_TIMEOUT_MS` | idle session reap timeout |
|
|
232
|
+
| `ANTECHAMBER_MAX_LIVE` | cap on concurrent live agent processes |
|
|
233
|
+
| `ANTECHAMBER_DEBUG` / `ANTECHAMBER_DEBUG_LOG` | request/event debug logging |
|
|
234
|
+
|
|
235
|
+
## Security
|
|
236
|
+
|
|
237
|
+
antechamber is a local development tool: by default it binds to loopback
|
|
238
|
+
with no authentication, and it can run arbitrary shell commands on behalf of
|
|
239
|
+
the agent. Treat it the same way you'd treat a local dev server with shell
|
|
240
|
+
access, not a service to expose on a network.
|
|
241
|
+
|
|
242
|
+
Hardening controls (full reference in [docs/configuration.md](docs/configuration.md#security)):
|
|
243
|
+
|
|
244
|
+
- Optional HTTP Basic auth, matching OpenCode's own contract:
|
|
245
|
+
`OPENCODE_SERVER_PASSWORD` (plus `OPENCODE_SERVER_USERNAME`, default
|
|
246
|
+
`opencode`).
|
|
247
|
+
- Without a password, requests carrying a non-loopback browser `Origin` are
|
|
248
|
+
rejected unless listed in `ANTECHAMBER_ALLOWED_ORIGINS`.
|
|
249
|
+
- Binding to a non-loopback host requires a password, `ANTECHAMBER_ALLOW_INSECURE=1`,
|
|
250
|
+
or the `--insecure-no-auth` flag.
|
|
251
|
+
- Request bodies are capped by `ANTECHAMBER_MAX_BODY_BYTES` (default 10 MiB);
|
|
252
|
+
SSE subscribers, file search and agent RPC frames have fixed bounds.
|
|
253
|
+
|
|
254
|
+
## Platform notes
|
|
255
|
+
|
|
256
|
+
Linux is the primary supported platform. OmO's private task-host teardown
|
|
257
|
+
(killing detached supervisor processes antechamber spawned) needs Linux
|
|
258
|
+
pidfds (`os.pidfd_open`, Linux 5.3+) and `python3` on PATH; Node has no pidfd
|
|
259
|
+
API. On other platforms that teardown step is skipped with one warning instead
|
|
260
|
+
of crashing; antechamber never falls back to signalling numeric PIDs. macOS is untested.
|
|
261
|
+
|
|
262
|
+
## Limitations / non-goals
|
|
263
|
+
|
|
264
|
+
- Not a reimplementation of OpenChamber's own platform features (scheduler,
|
|
265
|
+
relay, goals). Those stay in OpenChamber.
|
|
266
|
+
- Not a way to use pi/OmO as an LLM provider inside OpenCode. pi/OmO are full
|
|
267
|
+
agents with their own loop; antechamber adapts at the session-protocol
|
|
268
|
+
level, not the model level.
|
|
269
|
+
- Some OpenCode routes have no pi/OmO equivalent and are stubbed or return
|
|
270
|
+
`400`/`501` (OAuth-based provider auth, MCP connect/disconnect, session
|
|
271
|
+
share). See [docs/api-surface.md](docs/api-surface.md) for the exact list.
|
|
272
|
+
|
|
273
|
+
## Development
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
npm run typecheck
|
|
277
|
+
npm test
|
|
278
|
+
npm run build
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
The smoke scripts (`npm run smoke`, `npm run omo-smoke`, `npm run probe`,
|
|
282
|
+
`npm run model-smoke`, `npm run v2-smoke`) drive a real `omo` (or `pi`)
|
|
283
|
+
process end to end and cost model tokens; they are not part of `npm test`
|
|
284
|
+
and are not run in CI. See [docs/development.md](docs/development.md).
|
|
285
|
+
|
|
286
|
+
Releases are cut by pushing a `vX.Y.Z` tag; CI then runs the checks,
|
|
287
|
+
publishes to npm with provenance and creates the GitHub release from the
|
|
288
|
+
CHANGELOG. See [docs/releasing.md](docs/releasing.md).
|
|
289
|
+
|
|
290
|
+
## Docs
|
|
291
|
+
|
|
292
|
+
- [docs/architecture.md](docs/architecture.md) - design and session-model mapping
|
|
293
|
+
- [docs/api-surface.md](docs/api-surface.md) - OpenCode endpoints implemented, stubbed, or unsupported
|
|
294
|
+
- [docs/configuration.md](docs/configuration.md) - full environment variable reference
|
|
295
|
+
- [docs/development.md](docs/development.md) - source layout, testing, smoke scripts
|
|
296
|
+
- [docs/backends/omo.md](docs/backends/omo.md) - OmO backend details (agent name, task hosts, transcripts)
|
|
297
|
+
- [docs/releasing.md](docs/releasing.md) - versioning, tag-driven npm and GitHub releases
|
|
298
|
+
|
|
299
|
+
- [extensions/omo-dag/README.md](extensions/omo-dag/README.md) - the OmO Graph OpenChamber extension ([design](extensions/omo-dag/docs/DESIGN.md))
|
|
300
|
+
|
|
301
|
+
## Credits
|
|
302
|
+
|
|
303
|
+
antechamber began as a fork of
|
|
304
|
+
[openchamber-pi-connector](https://github.com/qingzhu521/openchamber-pi-connector)
|
|
305
|
+
by qingzhu521 (xiuli.qz), released under the MIT license, and was substantially
|
|
306
|
+
extended from there (OpenCode v2 API support, OmO support, session fork/revert,
|
|
307
|
+
subagent and task cards, approvals, todos, thinking levels, shell runs, diffs,
|
|
308
|
+
session persistence, lifecycle caps, and more).
|
|
309
|
+
|
|
310
|
+
Also relies on [OpenChamber](https://github.com/openchamber/openchamber),
|
|
311
|
+
[OmO](https://github.com/code-yeongyu/oh-my-openagent) by code-yeongyu, and
|
|
312
|
+
[pi](https://github.com/badlogic/pi-mono) by badlogic / earendil.
|
|
313
|
+
|
|
314
|
+
## License
|
|
315
|
+
|
|
316
|
+
MIT. See [LICENSE](./LICENSE), which retains the original
|
|
317
|
+
openchamber-pi-connector copyright notice alongside the antechamber one.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# OpenChamber launcher: point `settings.opencodeBinary` (or $OPENCODE_BINARY)
|
|
3
|
+
# at this file. OpenChamber runs `<binary> serve --hostname H --port P` and
|
|
4
|
+
# `<binary> --version`; anything else is rejected.
|
|
5
|
+
# Requires a build (`npm run build`) so that dist/cli.js exists.
|
|
6
|
+
set -eu
|
|
7
|
+
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
8
|
+
CLI="$SCRIPT_DIR/../dist/cli.js"
|
|
9
|
+
if [ ! -f "$CLI" ]; then
|
|
10
|
+
echo "opencode-antechamber: $CLI not found; run 'npm run build' first" >&2
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
case "${1:-}" in
|
|
14
|
+
serve) shift; exec node "$CLI" serve "$@" ;;
|
|
15
|
+
--version|-v) exec node "$CLI" --version ;;
|
|
16
|
+
esac
|
|
17
|
+
echo "opencode-antechamber: unsupported command '${1:-}' (only 'serve' and '--version' are implemented)" >&2
|
|
18
|
+
exit 1
|
package/bin/opencode-pi
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Root directory of the coding agent's state. Mirrors OmO's own resolution
|
|
3
|
+
* (OMO_ > SENPI_ > PI_CODING_AGENT_DIR, default ~/.omo/agent); a plain pi
|
|
4
|
+
* backend defaults to pi's ~/.pi/agent instead.
|
|
5
|
+
*/
|
|
6
|
+
export declare function piAgentDir(env?: NodeJS.ProcessEnv, home?: string): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { homedir } from "node:os";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { isPlainPi } from "./config.js";
|
|
4
|
+
function expandLeadingTilde(path, home) {
|
|
5
|
+
if (path === "~")
|
|
6
|
+
return home;
|
|
7
|
+
if (path.startsWith("~/") || path.startsWith("~\\"))
|
|
8
|
+
return join(home, path.slice(2));
|
|
9
|
+
return path;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Root directory of the coding agent's state. Mirrors OmO's own resolution
|
|
13
|
+
* (OMO_ > SENPI_ > PI_CODING_AGENT_DIR, default ~/.omo/agent); a plain pi
|
|
14
|
+
* backend defaults to pi's ~/.pi/agent instead.
|
|
15
|
+
*/
|
|
16
|
+
export function piAgentDir(env = process.env, home = homedir()) {
|
|
17
|
+
const configured = [env.OMO_CODING_AGENT_DIR, env.SENPI_CODING_AGENT_DIR, env.PI_CODING_AGENT_DIR].find((value) => typeof value === "string" && value.trim() !== "");
|
|
18
|
+
if (configured !== undefined)
|
|
19
|
+
return expandLeadingTilde(configured.trim(), home);
|
|
20
|
+
return isPlainPi(env) ? join(home, ".pi", "agent") : join(home, ".omo", "agent");
|
|
21
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent-name detection: the adapter reports one OpenCode "agent" to the UI.
|
|
3
|
+
* Resolution order (<agent dir> is piAgentDir(), ~/.omo/agent by default):
|
|
4
|
+
* 1. ANTECHAMBER_AGENT env override
|
|
5
|
+
* 2. <agent dir>/../oh-my-pi.jsonc → orchestrator.agentName
|
|
6
|
+
* 3. <agent dir>/../omo.jsonc exists (an OmO install) → "OmO"
|
|
7
|
+
* 4. <agent dir>/settings.json packages containing oh-my-pi → "oh-my-pi"
|
|
8
|
+
* 5. "build" (plain pi)
|
|
9
|
+
* The result is memoized: config changes require an adapter restart.
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
12
|
+
export declare function detectAgentName(env?: NodeJS.ProcessEnv, home?: string, fs?: {
|
|
13
|
+
readonly existsSync: typeof existsSync;
|
|
14
|
+
readonly readFileSync: typeof readFileSync;
|
|
15
|
+
}): string;
|
|
16
|
+
export declare function getAgentName(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Agent names the adapter publishes to OpenChamber's picker. pi has exactly one
|
|
19
|
+
* agent. The resolved pi name is published first so OpenChamber chooses it for
|
|
20
|
+
* new sessions; `build` remains a compatibility alias for existing sessions.
|
|
21
|
+
* Both names run the same pi agent — the requested agent name is not forwarded
|
|
22
|
+
* to pi. When pi's name already is `build` the list collapses to one.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getExposedAgentNames(): string[];
|