@ctliz/agent-intercom-codex 0.11.0-connect.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/.codex-plugin/plugin.json +39 -0
- package/.mcp.json +10 -0
- package/COPYRIGHT +6 -0
- package/LICENSE +661 -0
- package/LICENSE_TRANSITION.md +25 -0
- package/README.md +572 -0
- package/THIRD_PARTY_NOTICES.md +17 -0
- package/assets/logo-generated.png +0 -0
- package/assets/logo.svg +22 -0
- package/boss-control-outbox.ts +195 -0
- package/broker/access-credential.ts +76 -0
- package/broker/access-registry.ts +464 -0
- package/broker/audit.ts +60 -0
- package/broker/authorization.ts +54 -0
- package/broker/boss-adapter.ts +531 -0
- package/broker/boss-control-ledger.ts +306 -0
- package/broker/broker.ts +2327 -0
- package/broker/client.ts +1111 -0
- package/broker/framing.ts +87 -0
- package/broker/ownership.ts +61 -0
- package/broker/paths.ts +161 -0
- package/broker/spawn.ts +453 -0
- package/codex/app-server-client.ts +562 -0
- package/codex/boss-client.ts +34 -0
- package/codex/bridge-config.ts +282 -0
- package/codex/bridge-daemon.ts +913 -0
- package/codex/clipboard.ts +142 -0
- package/codex/coi.ts +802 -0
- package/codex/contact.ts +54 -0
- package/codex/mcp-protocol.ts +248 -0
- package/codex/runtime.ts +488 -0
- package/codex/server.ts +60 -0
- package/codex/team.ts +249 -0
- package/codex/tui-input.ts +174 -0
- package/config.ts +195 -0
- package/dist/bridge-daemon.mjs +3781 -0
- package/dist/broker.mjs +3012 -0
- package/dist/build-info.json +12 -0
- package/dist/codex-server.mjs +2890 -0
- package/dist/coi.mjs +4686 -0
- package/durable-json.ts +25 -0
- package/licenses/MIT-pi-intercom.txt +21 -0
- package/outbound-outbox.ts +116 -0
- package/package.json +89 -0
- package/protocol-v4/contract.ts +27 -0
- package/provider/protected-service.ts +162 -0
- package/provider/provider.mjs +34 -0
- package/scripts/build-info.mjs +58 -0
- package/scripts/build.mjs +55 -0
- package/skills/codex-intercom/SKILL.md +104 -0
- package/tsconfig.json +16 -0
- package/types.ts +225 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# License Transition
|
|
2
|
+
|
|
3
|
+
This repository changed its current project license from MIT to the GNU Affero General
|
|
4
|
+
Public License v3.0 or later (`AGPL-3.0-or-later`) on 2026-07-14.
|
|
5
|
+
|
|
6
|
+
## Boundary
|
|
7
|
+
|
|
8
|
+
- Final MIT commit: [`e3d30d3`](https://github.com/dataforxyz/agent-intercom-codex/commit/e3d30d3)
|
|
9
|
+
- Final MIT tag: [`mit-final`](https://github.com/dataforxyz/agent-intercom-codex/tree/mit-final)
|
|
10
|
+
- First AGPL commit: [`dbcd107`](https://github.com/dataforxyz/agent-intercom-codex/commit/dbcd107)
|
|
11
|
+
- First AGPL tag: [`agpl-transition`](https://github.com/dataforxyz/agent-intercom-codex/tree/agpl-transition)
|
|
12
|
+
- First versioned AGPL release: `v0.3.0`
|
|
13
|
+
|
|
14
|
+
The transition is prospective. It does not revoke or alter rights granted for copies
|
|
15
|
+
already received under MIT. Current and future versions derived from the AGPL side of
|
|
16
|
+
the boundary are distributed under `AGPL-3.0-or-later`.
|
|
17
|
+
|
|
18
|
+
No earlier npm release is being retroactively changed. Git snapshots and packages built
|
|
19
|
+
from commits at or before `mit-final` remain under their original MIT terms.
|
|
20
|
+
|
|
21
|
+
## Third-party material
|
|
22
|
+
|
|
23
|
+
Portions derived from Nico Bailon's original `pi-intercom` retain their original MIT
|
|
24
|
+
notices. See [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) and
|
|
25
|
+
[`licenses/MIT-pi-intercom.txt`](licenses/MIT-pi-intercom.txt).
|
package/README.md
ADDED
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
# Codex Intercom
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<img src="./assets/logo.svg" alt="Codex Intercom SVG logo" width="96" height="96">
|
|
5
|
+
<img src="./assets/logo-generated.png" alt="Codex Intercom generated PNG logo" width="96" height="96">
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
**Agent Intercom** is a cross-harness, same-machine messaging system for coding agents. Its Pi, Codex, Claude Code, and OpenCode adapters share one local broker and protocol, so sessions can discover and message each other regardless of which harness they run in.
|
|
9
|
+
|
|
10
|
+
| Harness | Repository |
|
|
11
|
+
|---|---|
|
|
12
|
+
| Core / Protocol | [`agent-intercom-core`](https://github.com/ctliz/agent-intercom-core) |
|
|
13
|
+
| Pi | [`agent-intercom-pi`](https://github.com/ctliz/agent-intercom-pi) |
|
|
14
|
+
| Codex | [`agent-intercom-codex`](https://github.com/ctliz/agent-intercom-codex) |
|
|
15
|
+
| Claude Code | [`agent-intercom-claude`](https://github.com/ctliz/agent-intercom-claude) |
|
|
16
|
+
| OpenCode | [`agent-intercom-opencode`](https://github.com/ctliz/agent-intercom-opencode) |
|
|
17
|
+
| Fleet lifecycle | [`agent-intercom-orchestrator`](https://github.com/ctliz/agent-intercom-orchestrator) |
|
|
18
|
+
|
|
19
|
+
## Maintenance & Upstream Provenance
|
|
20
|
+
|
|
21
|
+
- **Maintained by `ctliz`**: This distribution is maintained independently by [ctliz](https://github.com/ctliz).
|
|
22
|
+
- **Upstream Heritage**: Agent Intercom grew from [Nico Bailon's original `pi-intercom`](https://github.com/nicobailon/pi-intercom) and the upstream [`dataforxyz/agent-intercom-*`](https://github.com/dataforxyz/agent-intercom-codex) repositories. This project is not officially endorsed by or affiliated with upstream organizations.
|
|
23
|
+
- **Package Namespace**: The canonical npm namespace is `@ctliz/*`. The historical `@dataforxyz/*` namespace was used up to and including `connect.1` and is retained only as provenance and as a migration-detection input; it is never treated as a current or healthy installation. The **Agent Intercom** branding and the `intercom_*` API surface are unchanged.
|
|
24
|
+
|
|
25
|
+
## Protocol v4 & Broker-Enforced Scope
|
|
26
|
+
|
|
27
|
+
Agent Intercom protocol v4 introduces **broker-enforced scope routing** via `AGENT_INTERCOM_SCOPE_ID`:
|
|
28
|
+
|
|
29
|
+
- **Registration**: The client submits its `scopeId` once in the top-level registration payload.
|
|
30
|
+
- **Broker Enforcement**: The shared local broker stores the scope in its private `ConnectedSession` record and enforces same-scope discovery (`intercom_list`), naming, and prefix matching.
|
|
31
|
+
- **Cross-Scope Routing**: Cross-scope messaging is fail-closed; communication across different scopes is permitted only when addressing an explicit full session ID.
|
|
32
|
+
- **UX Routing Isolation**: Scope is designed for same-OS-user workflow isolation (e.g. per-project or per-workspace agent teams), **not** as a cryptographic security principal, tenant boundary, or authentication credential.
|
|
33
|
+
- **Leak-Free**: The raw `scopeId` value never enters `SessionInfo`, list payloads, lifecycle events, frontend displays, or execution logs.
|
|
34
|
+
- **Standalone First**: `AGENT_INTERCOM_SCOPE_ID` is a general shell/IDE/service launcher contract. Agent Intercom works completely standalone in any terminal, tmux window, or script; TmuxDeck is optional visual tooling.
|
|
35
|
+
|
|
36
|
+
## Origin and thanks
|
|
37
|
+
|
|
38
|
+
Agent Intercom grew from [Nico Bailon's original `pi-intercom`](https://github.com/nicobailon/pi-intercom). A sincere thank you to Nico and the original contributors for creating the Pi extension and the foundation this cross-harness family builds on.
|
|
39
|
+
|
|
40
|
+
This repository contains the Codex adapter. It gives Codex sessions native intercom tools and wakeable workers while remaining fully interoperable with the other Agent Intercom harnesses.
|
|
41
|
+
|
|
42
|
+
The bundled client and broker use strict intercom protocol v4. A send is only
|
|
43
|
+
reported as delivered after the receiving adapter acknowledges it. Unfinished
|
|
44
|
+
outbound sends are persisted under the shared intercom runtime directory and
|
|
45
|
+
replayed with their original IDs after reconnect, making retries safe with
|
|
46
|
+
receiver deduplication. Incompatible older local brokers fail closed without
|
|
47
|
+
killing, downgrading, or creating second islands.
|
|
48
|
+
|
|
49
|
+
The project has two related pieces:
|
|
50
|
+
|
|
51
|
+
- `codex-intercom-mcp`: an MCP server that exposes intercom tools inside a
|
|
52
|
+
normal Codex session.
|
|
53
|
+
- `coi`: a wakeable Codex sidecar launcher. It starts a Codex app-server,
|
|
54
|
+
registers an intercom identity, and starts Codex turns when another session
|
|
55
|
+
sends it work.
|
|
56
|
+
|
|
57
|
+
Use plain MCP when you only need tools inside an already-active Codex turn. Use
|
|
58
|
+
`coi` when you want another session to wake the worker automatically or when
|
|
59
|
+
you want the host-level **Alt+I** and **Alt+M** shortcuts. Codex's MCP interface can
|
|
60
|
+
provide intercom tools, but it cannot add custom keybindings to the Codex TUI.
|
|
61
|
+
|
|
62
|
+
## Status
|
|
63
|
+
|
|
64
|
+
Preview. This is the Codex adapter in the cross-harness Agent Intercom family.
|
|
65
|
+
|
|
66
|
+
Plain Codex MCP sessions do not receive Pi-style unsolicited visible turns.
|
|
67
|
+
Incoming messages are queued while the MCP server is running; call
|
|
68
|
+
`intercom_pending` to read them. Wake-on-message workflows require `coi` or the
|
|
69
|
+
app-server bridge.
|
|
70
|
+
|
|
71
|
+
When an external intercom turn completes, `coi` refreshes the attached remote
|
|
72
|
+
TUI by resuming the same thread. The inbound message and final response then
|
|
73
|
+
appear in the already-open terminal instead of existing only in the saved
|
|
74
|
+
transcript. This refresh happens after the turn is idle so Codex does not reopen
|
|
75
|
+
in a phantom `Working` state. Retryable app-server stream errors are reported as reconnecting without terminating the sidecar, allowing Codex's own retry to complete. Orchestrated `fresh: true` launches remove the saved `coi` thread state before registration.
|
|
76
|
+
|
|
77
|
+
The additive Stage-B `boss-run-v1` adapter contracts are present but dormant.
|
|
78
|
+
Ordinary local and remote-access communication continues to use the existing
|
|
79
|
+
protocol-v4 behavior when Boss metadata is omitted. The legacy broker does not
|
|
80
|
+
advertise or bind Boss participants until a protected provider supplies all of
|
|
81
|
+
the required broker identity, credential-registry, authority-transition, and
|
|
82
|
+
participant-health predicates. Boss-scoped discovery and routing fail closed
|
|
83
|
+
across ordinary sessions and other Boss runs. The `boss_participant` and
|
|
84
|
+
`boss_reviewer` launch-profile markers make production Codex launches fail
|
|
85
|
+
with `PROVIDER_AUTHORITY_UNAVAILABLE`: this adapter has no broker-owned,
|
|
86
|
+
artifact-attested provider executable and therefore never resolves protected
|
|
87
|
+
launches through caller `PATH`. Their non-spawning parser validators still
|
|
88
|
+
reject disabled approvals and `danger-full-access`, and reviewers remain
|
|
89
|
+
read-only. The markers do not install or advertise a restricted operation client.
|
|
90
|
+
Restricted Boss operation clients are not advertised or exported yet. They
|
|
91
|
+
remain unavailable until the protected broker can provision both the binding
|
|
92
|
+
and transport through a non-caller-forgeable factory.
|
|
93
|
+
|
|
94
|
+
## Install
|
|
95
|
+
|
|
96
|
+
For normal use, install the package so the command-line entry points are on
|
|
97
|
+
`PATH`:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
git clone --depth 1 --branch v0.11.0-connect.2 https://github.com/ctliz/agent-intercom-codex.git
|
|
101
|
+
cd agent-intercom-codex && npm ci && npm link
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
> The public npm package `@ctliz/agent-intercom-codex` is **not yet published**. GitHub at the exact connect tag is the only supported install path for this release.
|
|
105
|
+
|
|
106
|
+
This provides:
|
|
107
|
+
|
|
108
|
+
- `codex-intercom-mcp`
|
|
109
|
+
- `codex-intercom-bridge`
|
|
110
|
+
- `coi`
|
|
111
|
+
|
|
112
|
+
Then add the MCP server to Codex:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
codex mcp add codex-intercom -- codex-intercom-mcp
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Optional MCP identity variables can be attached at registration time:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
codex mcp add codex-planner \
|
|
122
|
+
--env CODEX_INTERCOM_NAME=planner \
|
|
123
|
+
--env CODEX_INTERCOM_SESSION_ID=codex-planner \
|
|
124
|
+
--env CODEX_INTERCOM_MODEL=codex \
|
|
125
|
+
-- codex-intercom-mcp
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Per-command environment variables passed to `codex exec` are not forwarded into
|
|
129
|
+
the MCP server process. Configure identity on the MCP server entry when you need
|
|
130
|
+
stable names or IDs.
|
|
131
|
+
|
|
132
|
+
To let a Pi manager create Codex workers with owned systemd cgroups, leases, model/effort selection, logs, and verified cleanup, install the companion Pi packages:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
pi install git:github.com/ctliz/agent-intercom-pi@v0.11.0-connect.2
|
|
136
|
+
pi install git:github.com/ctliz/agent-intercom-orchestrator@v0.11.0-connect.2
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Restart Pi or run `/reload`, then call `agent_fleet({ action: "doctor" })`. The orchestrator invokes the installed `coi` command, or a separately configured minimal wrapper such as `coim`; it does not replace this Codex adapter.
|
|
140
|
+
|
|
141
|
+
## Plugin Use
|
|
142
|
+
|
|
143
|
+
This repo also includes Codex plugin metadata:
|
|
144
|
+
|
|
145
|
+
- `.codex-plugin/plugin.json`
|
|
146
|
+
- `.mcp.json`
|
|
147
|
+
- `skills/codex-intercom/SKILL.md`
|
|
148
|
+
|
|
149
|
+
The plugin packages the MCP server and the optional intercom skill. It is useful
|
|
150
|
+
when you want Codex to install and manage the intercom integration as a plugin.
|
|
151
|
+
For a deliberately minimal profile, prefer direct MCP configuration with
|
|
152
|
+
`codex-intercom-mcp`; that lets you disable plugins and skills while keeping the
|
|
153
|
+
intercom tools.
|
|
154
|
+
|
|
155
|
+
## Tools
|
|
156
|
+
|
|
157
|
+
- `intercom_whoami`: show this session's intercom ID, name, cwd, and model.
|
|
158
|
+
- `intercom_team`: show the current manager and live coworkers owned by that manager.
|
|
159
|
+
- `intercom_status`: show connection status and pending message counts.
|
|
160
|
+
- `intercom_list`: list local Pi, Codex, Claude Code, and OpenCode sessions in your scope (protocol v4 is same-scope; cross-scope contact requires an exact full session ID).
|
|
161
|
+
- `intercom_set_summary`: publish a short discoverable status.
|
|
162
|
+
- `intercom_send`: send a non-blocking message.
|
|
163
|
+
- `intercom_ask`: send a question and wait for the target's reply.
|
|
164
|
+
- `intercom_pending`: read queued inbound messages and unresolved asks.
|
|
165
|
+
- `intercom_reply`: reply to a pending inbound ask; use `to` plus `which: "oldest" | "latest"` if one sender has multiple unresolved asks.
|
|
166
|
+
|
|
167
|
+
Pending output never exposes protocol message IDs. Keep at most one unresolved `intercom_ask` to the same recipient; the broker rejects a second ask and recommends `intercom_send` for a non-blocking follow-up. Use `intercom_send`—not `intercom_ask`—for assignments and progress/status checkpoints.
|
|
168
|
+
|
|
169
|
+
Persistent Codex bridges and plain MCP runtimes automatically reconnect their stable Intercom identity after a broker restart, so a live worker does not need to be respawned merely to become reachable again.
|
|
170
|
+
|
|
171
|
+
Example:
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
intercom_team({})
|
|
175
|
+
// Manager: manager-id [connected]
|
|
176
|
+
// You: worker-a
|
|
177
|
+
// Coworkers: reviewer target=reviewer (claude, challenger, running) [connected]
|
|
178
|
+
|
|
179
|
+
intercom_ask({
|
|
180
|
+
to: "worker-a",
|
|
181
|
+
message: "Please inspect the failing test and reply with the likely cause.",
|
|
182
|
+
timeout_ms: 45000
|
|
183
|
+
})
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Blocking asks default to a short bounded wait and reject waits over 120 seconds.
|
|
187
|
+
For longer work, use `intercom_send` and check later with `intercom_pending`.
|
|
188
|
+
|
|
189
|
+
## Wakeable Workers With `coi`
|
|
190
|
+
|
|
191
|
+
`coi` starts a per-agent Codex app-server socket, registers an intercom sidecar
|
|
192
|
+
for that socket, creates or resumes the sidecar's app-server thread, then
|
|
193
|
+
launches an interactive Codex UI attached to the same socket and thread.
|
|
194
|
+
|
|
195
|
+
Start a named worker:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
coi --name worker-a --id worker-a
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
If you launch wakeable workers often, a shell alias keeps `coi` distinct from a
|
|
202
|
+
plain `codex` session:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
alias codex-intercom='coi'
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Then run `codex-intercom --name worker-a --id worker-a`. The alias is optional;
|
|
209
|
+
the important part is launching through `coi`, because the wrapper owns the
|
|
210
|
+
app-server sidecar that wakes on incoming work and the terminal integration
|
|
211
|
+
that provides **Alt+I** and **Alt+M**. Starting `codex` directly with only the MCP server
|
|
212
|
+
still provides intercom tools, but not those host-level behaviors.
|
|
213
|
+
|
|
214
|
+
Useful flags:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
coi --name api-worker --id api-worker
|
|
218
|
+
coi --cwd /path/to/project --instructions "Reply tersely. Ask before destructive changes."
|
|
219
|
+
coi --no-tui --name background-worker --id background-worker
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Everything not recognized as a sidecar flag is passed through to
|
|
223
|
+
`codex resume --remote`, so normal Codex flags still work. Prompt arguments are
|
|
224
|
+
placed after the resumed sidecar thread ID.
|
|
225
|
+
|
|
226
|
+
While the `coi` TUI is open, press **Alt+I** to copy a short handoff snippet for
|
|
227
|
+
the current intercom session. As in `pi-intercom`, the snippet uses the unique
|
|
228
|
+
session name when possible and falls back to the stable intercom session ID.
|
|
229
|
+
The shortcut is provided by the `coi` launcher; plain MCP-only Codex sessions do
|
|
230
|
+
not have a plugin API for custom TUI actions.
|
|
231
|
+
|
|
232
|
+
Press **Alt+M** to insert the Codex intercom session-picker request. Codex will
|
|
233
|
+
call `intercom_list`, show the available sessions, ask which peer and message
|
|
234
|
+
you want, then use `intercom_send`. Codex does not expose native slash-command
|
|
235
|
+
or overlay registration, so `coi` provides this assisted flow instead of
|
|
236
|
+
claiming a native `/intercom` command. The equivalent MCP tools remain
|
|
237
|
+
available directly in every Codex session.
|
|
238
|
+
|
|
239
|
+
| Action | Codex surface |
|
|
240
|
+
|---|---|
|
|
241
|
+
| Choose a session and send | **Alt+M** in `coi` |
|
|
242
|
+
| Copy this session's contact target | **Alt+I** in `coi` |
|
|
243
|
+
| Find an orchestrator-owned manager or coworker | `intercom_team` |
|
|
244
|
+
| Script or ask directly | `intercom_list`, `intercom_send`, `intercom_ask` |
|
|
245
|
+
|
|
246
|
+
The shortcut uses native clipboard helpers locally and OSC 52 for SSH sessions.
|
|
247
|
+
If clipboard access fails, `coi` inserts the snippet into the Codex composer.
|
|
248
|
+
Disable the PTY-backed shortcut with `--no-intercom-shortcut` or
|
|
249
|
+
`CODEX_INTERCOM_SHORTCUT=0`. The optional `node-pty` dependency is only loaded
|
|
250
|
+
when the shortcut is enabled in an interactive terminal; if it is unavailable,
|
|
251
|
+
`coi` launches the normal Codex TUI without the shortcut.
|
|
252
|
+
|
|
253
|
+
`coi` also applies Codex runtime flags such as `--sandbox`,
|
|
254
|
+
`--ask-for-approval`, and `--add-dir` to wake-triggered sidecar turns. For
|
|
255
|
+
example, `coi --name worker-a --id worker-a --sandbox workspace-write` lets
|
|
256
|
+
intercom-woken turns write inside the worker workspace instead of falling back
|
|
257
|
+
to read-only.
|
|
258
|
+
|
|
259
|
+
The sidecar inherits `CODEX_HOME`, which makes it useful with a normal Codex
|
|
260
|
+
home or a dedicated minimal home.
|
|
261
|
+
|
|
262
|
+
Every packaged executable writes one machine-searchable identity line to stderr
|
|
263
|
+
before application startup:
|
|
264
|
+
|
|
265
|
+
```text
|
|
266
|
+
[agent-intercom-build] package=@ctliz/agent-intercom-codex version=0.11.0-connect.2 target=coi sourceSha256=<64-hex-source-identity>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
`dist/build-info.json` records the same deterministic runtime-source identity.
|
|
270
|
+
Use the line from the actual process journal—not the current file path or
|
|
271
|
+
mtime—to prove which bundle a remote worker loaded. Test-only changes do not
|
|
272
|
+
alter the identity; any runtime, build-script, package, or pinned-dependency
|
|
273
|
+
change does.
|
|
274
|
+
|
|
275
|
+
## Minimal Wakeable Profile
|
|
276
|
+
|
|
277
|
+
A minimal profile is useful for workers that should stay focused on code and
|
|
278
|
+
coordination. It reduces prompt/tool surface area by isolating the worker from
|
|
279
|
+
your normal Codex config, memories, plugins, browser surfaces, image generation,
|
|
280
|
+
and extra skills. Keep goals and multi-agent support on so the worker can track
|
|
281
|
+
the task and delegate subtasks.
|
|
282
|
+
|
|
283
|
+
Create a dedicated Codex home:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
export CODEX_MIN_HOME="$HOME/.codex-min-intercom"
|
|
287
|
+
mkdir -p "$CODEX_MIN_HOME"
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
`$CODEX_MIN_HOME/config.toml`:
|
|
291
|
+
|
|
292
|
+
```toml
|
|
293
|
+
model = "gpt-5.5"
|
|
294
|
+
web_search = "disabled"
|
|
295
|
+
|
|
296
|
+
[features]
|
|
297
|
+
apps = false
|
|
298
|
+
memories = false
|
|
299
|
+
web_search = false
|
|
300
|
+
web_search_cached = false
|
|
301
|
+
web_search_request = false
|
|
302
|
+
|
|
303
|
+
# Keep the core coding-agent surface.
|
|
304
|
+
goals = true
|
|
305
|
+
multi_agent = true
|
|
306
|
+
shell_tool = true
|
|
307
|
+
unified_exec = true
|
|
308
|
+
auto_compaction = true
|
|
309
|
+
tool_call_mcp_elicitation = true
|
|
310
|
+
|
|
311
|
+
# Disable optional/distraction-heavy surfaces.
|
|
312
|
+
browser_use = false
|
|
313
|
+
browser_use_external = false
|
|
314
|
+
browser_use_full_cdp_access = false
|
|
315
|
+
in_app_browser = false
|
|
316
|
+
computer_use = false
|
|
317
|
+
image_generation = false
|
|
318
|
+
plugins = false
|
|
319
|
+
plugin_sharing = false
|
|
320
|
+
tool_suggest = false
|
|
321
|
+
skill_mcp_dependency_install = false
|
|
322
|
+
hooks = false
|
|
323
|
+
workspace_dependencies = false
|
|
324
|
+
|
|
325
|
+
[mcp_servers.codex-intercom]
|
|
326
|
+
command = "codex-intercom-mcp"
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
After the first launch, Codex may populate system skills under the alternate
|
|
330
|
+
home. To keep the profile minimal without deleting anything, list the skill
|
|
331
|
+
paths:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
find "$CODEX_MIN_HOME/skills" -name SKILL.md -print
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
For each skill you want disabled, add a config entry:
|
|
338
|
+
|
|
339
|
+
```toml
|
|
340
|
+
[[skills.config]]
|
|
341
|
+
path = "/absolute/path/from/find/SKILL.md"
|
|
342
|
+
enabled = false
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
There is no required alias name. A short alias such as `cim` keeps the minimal
|
|
346
|
+
worker easy to launch:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
cim() {
|
|
350
|
+
local home="${CODEX_MIN_HOME:-$HOME/.codex-min-intercom}"
|
|
351
|
+
local yolo="${CODEX_YOLO:-1}"
|
|
352
|
+
case "${1:-}" in
|
|
353
|
+
yolo|--yolo|on) shift; yolo=1 ;;
|
|
354
|
+
safe|--safe|off) shift; yolo=0 ;;
|
|
355
|
+
esac
|
|
356
|
+
local args=(--name codex-min)
|
|
357
|
+
[ "$yolo" = 1 ] && args+=(--dangerously-bypass-approvals-and-sandbox)
|
|
358
|
+
CODEX_HOME="$home" coi "${args[@]}" "$@"
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
This alias intentionally defaults the minimal worker to yolo mode: no approval
|
|
363
|
+
prompts and no filesystem sandbox. Use it only for workers you trust with the
|
|
364
|
+
current machine account, or remove the bypass flag when you want a safer
|
|
365
|
+
workspace-scoped worker. Use `cim safe ...` or set `CODEX_YOLO=0` to launch
|
|
366
|
+
without the bypass flag.
|
|
367
|
+
|
|
368
|
+
Use it like:
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
cim --name worker-a --id worker-a
|
|
372
|
+
cim --name reviewer --id reviewer --instructions "Review only; do not edit files."
|
|
373
|
+
cim --no-tui --name background-worker --id background-worker
|
|
374
|
+
cim safe --name safe-worker --id safe-worker --sandbox workspace-write
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
If you are developing this repository from a checkout instead of installing the
|
|
378
|
+
package, build and link it:
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
npm install
|
|
382
|
+
npm run build
|
|
383
|
+
npm link
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Or point an alias directly at the checkout:
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
cim() {
|
|
390
|
+
local home="${CODEX_MIN_HOME:-$HOME/.codex-min-intercom}"
|
|
391
|
+
local repo="${CODEX_INTERCOM_REPO:-/absolute/path/to/agent-intercom-codex}"
|
|
392
|
+
local yolo="${CODEX_YOLO:-1}"
|
|
393
|
+
case "${1:-}" in
|
|
394
|
+
yolo|--yolo|on) shift; yolo=1 ;;
|
|
395
|
+
safe|--safe|off) shift; yolo=0 ;;
|
|
396
|
+
esac
|
|
397
|
+
local args=(--name codex-min)
|
|
398
|
+
[ "$yolo" = 1 ] && args+=(--dangerously-bypass-approvals-and-sandbox)
|
|
399
|
+
CODEX_HOME="$home" node "$repo/dist/coi.mjs" "${args[@]}" "$@"
|
|
400
|
+
}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
## Manager And Worker Pattern
|
|
404
|
+
|
|
405
|
+
Use one Codex session as the manager and one or more `coi` sessions as wakeable
|
|
406
|
+
workers. The manager keeps the task shaped, feeds work to workers, watches for
|
|
407
|
+
drift, and decides when the work is ready to finish.
|
|
408
|
+
|
|
409
|
+
Example worker launch in `tmux`:
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
tmux new-session -d -s worker-a 'cd /path/to/project && cim --name worker-a --id worker-a'
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
Then ask the worker from the manager session:
|
|
416
|
+
|
|
417
|
+
```typescript
|
|
418
|
+
intercom_ask({
|
|
419
|
+
to: "worker-a",
|
|
420
|
+
message: "Please create a goal for the task, inspect the handoff, and report your first plan.",
|
|
421
|
+
timeout_ms: 45000
|
|
422
|
+
})
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
Recommended manager prompt:
|
|
426
|
+
|
|
427
|
+
```text
|
|
428
|
+
Start a wakeable worker in tmux using the minimal intercom alias:
|
|
429
|
+
|
|
430
|
+
tmux new-session -d -s <worker-id> 'cd <repo> && cim --name <worker-id> --id <worker-id>'
|
|
431
|
+
|
|
432
|
+
Give the worker a FEAT.md-style handoff:
|
|
433
|
+
|
|
434
|
+
# FEAT: <short task name>
|
|
435
|
+
Objective: <what must be true when done>
|
|
436
|
+
Context: <repo, branch, issue, constraints, important files>
|
|
437
|
+
Approach: <suggested first steps, but allow the worker to adjust>
|
|
438
|
+
Verification: <commands/tests/checks that should pass>
|
|
439
|
+
Definition of done: <clear finish criteria>
|
|
440
|
+
Coordination: create a goal, use subagents when useful, keep the manager updated through intercom, ask before risky or broad changes, and keep work in a branch/worktree when appropriate.
|
|
441
|
+
|
|
442
|
+
Tell the worker to create and maintain its own goal, use agents for parallel investigation or review, and report blockers early. As manager, keep sending focused follow-up work through intercom, keep the worker on task, and handle PR or final handoff when the implementation is ready.
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
For non-blocking delegation, use `intercom_send` and check back later. For a
|
|
446
|
+
decision the manager needs before continuing, use `intercom_ask`.
|
|
447
|
+
|
|
448
|
+
## App-Server Bridge
|
|
449
|
+
|
|
450
|
+
Use `codex-intercom-bridge` when you want one process to publish one or more
|
|
451
|
+
configured virtual Codex workers without launching an interactive TUI for each
|
|
452
|
+
worker.
|
|
453
|
+
|
|
454
|
+
Create a bridge config:
|
|
455
|
+
|
|
456
|
+
```json
|
|
457
|
+
{
|
|
458
|
+
"statePath": "/path/to/intercom/codex-bridge-state.json",
|
|
459
|
+
"agents": [
|
|
460
|
+
{
|
|
461
|
+
"id": "codex-worker",
|
|
462
|
+
"name": "codex-worker",
|
|
463
|
+
"cwd": "/path/to/project",
|
|
464
|
+
"model": "gpt-5.5",
|
|
465
|
+
"instructions": "Reply concisely. Ask before making destructive changes."
|
|
466
|
+
}
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
Start it:
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
codex-intercom-bridge --config "$HOME/.config/codex-intercom/bridge.json"
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
Then other local sessions can target `codex-worker` with `intercom_send` or
|
|
478
|
+
`intercom_ask`. The bridge stores each worker's app-server `threadId` in
|
|
479
|
+
`statePath`, so later messages continue the same Codex thread.
|
|
480
|
+
|
|
481
|
+
By default, bridge turns run with `approvalPolicy: "never"` and read-only,
|
|
482
|
+
network-disabled sandboxing. Override `approvalPolicy` or `sandboxPolicy` in
|
|
483
|
+
the agent config only when you explicitly want a background worker to have more
|
|
484
|
+
authority.
|
|
485
|
+
|
|
486
|
+
## Development
|
|
487
|
+
|
|
488
|
+
Clone and run from source:
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
git clone https://github.com/ctliz/agent-intercom-codex.git
|
|
492
|
+
cd agent-intercom-codex
|
|
493
|
+
npm install
|
|
494
|
+
npm run build
|
|
495
|
+
npm test
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
For MCP development, register the TypeScript source directly:
|
|
499
|
+
|
|
500
|
+
```bash
|
|
501
|
+
codex mcp add codex-intercom-dev -- npx --no-install tsx ./codex/server.ts
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
Use either the built install or the dev install in a given Codex profile.
|
|
505
|
+
Running both at the same time can register duplicate intercom MCP tools.
|
|
506
|
+
|
|
507
|
+
## Agent Intercom Compatibility
|
|
508
|
+
|
|
509
|
+
`agent-intercom-pi` is the Pi-native adapter with overlays, inline rendering,
|
|
510
|
+
and Pi `triggerTurn` delivery. This repository, `agent-intercom-codex`, is the
|
|
511
|
+
Codex MCP/plugin adapter plus wake-on-message Codex app-server sidecars. The
|
|
512
|
+
Claude Code and OpenCode adapters join the same broker and appear in the same
|
|
513
|
+
session list.
|
|
514
|
+
|
|
515
|
+
All four repositories vendor the compatible local broker/client protocol so any
|
|
516
|
+
adapter can start the broker and communicate across harness boundaries.
|
|
517
|
+
|
|
518
|
+
## Releasing
|
|
519
|
+
|
|
520
|
+
Releases are automated from version tags. Update `package.json`, the lockfile when
|
|
521
|
+
present, and `CHANGELOG.md` on `main`, then push an annotated tag that exactly
|
|
522
|
+
matches the package version:
|
|
523
|
+
|
|
524
|
+
```bash
|
|
525
|
+
git tag -a vX.Y.Z -m "vX.Y.Z"
|
|
526
|
+
git push origin vX.Y.Z
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
The release workflow verifies that the tag points into `main`, runs typecheck,
|
|
530
|
+
tests, and the build, publishes the public npm package with trusted OIDC
|
|
531
|
+
provenance, and creates the GitHub Release. Existing npm versions and GitHub
|
|
532
|
+
Releases are skipped safely when a workflow is rerun.
|
|
533
|
+
|
|
534
|
+
## Compatibility, Migration & Rollback
|
|
535
|
+
|
|
536
|
+
- **Single Shared Broker**: The broker-capable adapters on the machine — `pi`, `claude`, `codex`, and `opencode` — connect to one local broker over a Unix domain socket (`~/.pi/agent/intercom/broker.sock` or `$PI_CODING_AGENT_DIR/intercom/broker.sock`).
|
|
537
|
+
- **Coordinated Upgrade Set**: Protocol v4 changes broker negotiation, so the broker-capable adapters that are *actually installed and enabled on this machine* must be upgraded together in one maintenance window. Adapters you do not use do not need to be installed to satisfy the upgrade. `@ctliz/agent-intercom-core` is an internal dependency that arrives with the adapters and is never installed or upgraded on its own.
|
|
538
|
+
- **Orchestrator is Optional**: `agent-intercom-orchestrator` is an optional Linux/systemd lifecycle component. It does not implement or start a Broker and is not part of the Broker compatibility set. Omitting it — for example on macOS, or when using TmuxDeck — is a fully supported configuration and is **not** a mixed or unsupported state. If it is installed on a supported Linux host, or on WSL with a systemd user manager enabled, update it together with the adapters it manages.
|
|
539
|
+
- **Fail-Closed Legacy Handling**: An incompatible legacy (v3) broker or client fails closed. It is rejected at negotiation and never killed, never downgraded, and never allowed to form a second broker island.
|
|
540
|
+
- **Rollback**: Rolling back covers only the components that were actually installed on this machine before the upgrade. Restore the exact specs and lockfiles you backed up, then reload the affected agent sessions. Roll Orchestrator back only if it was installed to begin with. There is no published pre-v4 tag under `ctliz`, so a pre-upgrade backup of the exact installed specs/locks is the supported rollback material. Leaving some installed broker-capable adapters on the old protocol while others are upgraded is an unsupported mixed state.
|
|
541
|
+
|
|
542
|
+
## License
|
|
543
|
+
|
|
544
|
+
The current project is licensed under the [GNU Affero General Public License
|
|
545
|
+
v3.0 or later](LICENSE) (`AGPL-3.0-or-later`). If you modify this software and
|
|
546
|
+
make the modified version available to users over a network, the AGPL requires
|
|
547
|
+
you to offer those users the corresponding source code.
|
|
548
|
+
|
|
549
|
+
Portions derived from the original MIT-licensed `pi-intercom` project retain
|
|
550
|
+
their original notices. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) and
|
|
551
|
+
[licenses/MIT-pi-intercom.txt](licenses/MIT-pi-intercom.txt). Versions already
|
|
552
|
+
published under MIT remain available under their original terms. See
|
|
553
|
+
[LICENSE_TRANSITION.md](LICENSE_TRANSITION.md) for the exact commit and tag boundary.
|
|
554
|
+
|
|
555
|
+
## Upgrading from `connect.1` to `connect.2`
|
|
556
|
+
|
|
557
|
+
`connect.2` renames the package namespace from `@dataforxyz/*` to `@ctliz/*`. The two namespaces are different packages to npm. Pi Git package installations deduplicate by repository URL without ref, but running agent sessions continue to execute legacy code in memory, and npm or global installs along with binary links can coexist and conflict. Operators must stop active sessions, clean active install surfaces, and follow remove-before-install — side-by-side installation is not supported.
|
|
558
|
+
|
|
559
|
+
1. Back up the exact specs, lock files, and settings of every installed component.
|
|
560
|
+
2. Stop or close the installed broker-capable adapters.
|
|
561
|
+
3. Remove the old `@dataforxyz/*` specs, packages, and binary links that are actually installed.
|
|
562
|
+
4. Assert the old identity is gone from the **active install surfaces of the current OS user**: Pi settings and extension specs, resolved managed install roots, actual `node_modules` installations, and conflicting binary links that the current `PATH` would resolve. Do not scan or delete unrelated source checkouts, historical documentation, or other users' files — a `@dataforxyz/*` string in an unrelated development clone is not an installation.
|
|
563
|
+
5. Install the `@ctliz/*` `connect.2` exact tags for the components you actually use (v0.11.0-connect.2).
|
|
564
|
+
6. Reload or restart, then verify exactly one broker is running.
|
|
565
|
+
|
|
566
|
+
**Classification rule.** Migration-aware `connect.2` setup and update tooling must classify an old-namespace-only install surface as `MIGRATION_REQUIRED`, and the simultaneous presence of both namespaces as a duplicate/dual-load hard error that refuses setup, update, and further installation. This tooling does not exist for every platform and adapter combination; where it is not available, apply the same two rules manually against the surfaces in step 4. Do not assume every adapter emits this code automatically.
|
|
567
|
+
|
|
568
|
+
**Rollback** reverses this and covers only the components that were installed on this machine before the upgrade: remove the `@ctliz/*` packages, then restore the backed-up exact `@dataforxyz/*` specs and locks. Roll Orchestrator back only if it was installed to begin with.
|
|
569
|
+
|
|
570
|
+
The `connect.1` tags, source commits, and published release assets are immutable and are not modified by this migration. Release notes may carry an explicit erratum, which corrects the description only and never moves a tag or replaces an asset.
|
|
571
|
+
|
|
572
|
+
These packages are not published on the npm registry yet; install from the GitHub tags shown above.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
## pi-intercom
|
|
4
|
+
|
|
5
|
+
Portions of this repository are derived from [Nico Bailon's original
|
|
6
|
+
`pi-intercom`](https://github.com/nicobailon/pi-intercom) and work contributed
|
|
7
|
+
to that project.
|
|
8
|
+
|
|
9
|
+
The original work was made available under the MIT License. Its copyright and
|
|
10
|
+
permission notice are reproduced in [`licenses/MIT-pi-intercom.txt`](licenses/MIT-pi-intercom.txt).
|
|
11
|
+
Those notices must be retained with copies or substantial portions of the
|
|
12
|
+
original MIT-licensed material.
|
|
13
|
+
|
|
14
|
+
The current repository, including later modifications and the combined work,
|
|
15
|
+
is distributed under the GNU Affero General Public License v3.0 or later as
|
|
16
|
+
stated in [`LICENSE`](LICENSE). Previously published MIT-licensed versions
|
|
17
|
+
remain available under the terms under which they were released.
|
|
Binary file
|
package/assets/logo.svg
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title id="title">Codex Intercom logo</title>
|
|
3
|
+
<desc id="desc">Two connected speech panels with a code prompt mark.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="bg" x1="10" x2="54" y1="8" y2="58" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop offset="0" stop-color="#2563eb"/>
|
|
7
|
+
<stop offset="1" stop-color="#14b8a6"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="panel" x1="17" x2="49" y1="18" y2="45" gradientUnits="userSpaceOnUse">
|
|
10
|
+
<stop offset="0" stop-color="#ffffff"/>
|
|
11
|
+
<stop offset="1" stop-color="#dbeafe"/>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
</defs>
|
|
14
|
+
<rect width="64" height="64" rx="14" fill="url(#bg)"/>
|
|
15
|
+
<path d="M18 22c0-3.31 2.69-6 6-6h14c3.31 0 6 2.69 6 6v8c0 3.31-2.69 6-6 6H27.5L20 42v-6.34A6 6 0 0 1 18 31V22Z" fill="url(#panel)" opacity=".96"/>
|
|
16
|
+
<path d="M27 31c0-3.31 2.69-6 6-6h7c3.31 0 6 2.69 6 6v7c0 3.31-2.69 6-6 6h-3.75L30 49v-5.08A6 6 0 0 1 27 38v-7Z" fill="#0f172a" opacity=".9"/>
|
|
17
|
+
<path d="M28 25.5 24.5 29 28 32.5M35 25.5l3.5 3.5L35 32.5" fill="none" stroke="#2563eb" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.8"/>
|
|
18
|
+
<path d="M34 33.5h7" fill="none" stroke="#5eead4" stroke-linecap="round" stroke-width="2.6"/>
|
|
19
|
+
<circle cx="20" cy="50" r="2.6" fill="#bfdbfe"/>
|
|
20
|
+
<circle cx="44" cy="14" r="2.6" fill="#99f6e4"/>
|
|
21
|
+
<path d="M22.4 48.9 30 43.9M42.4 15.6 37.6 18.4" fill="none" stroke="#ffffff" stroke-linecap="round" stroke-width="1.8" opacity=".72"/>
|
|
22
|
+
</svg>
|