agent-embassy 1.9.5 → 3.0.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/CHANGELOG.md +87 -0
- package/CONTRIBUTING.md +19 -34
- package/README.md +110 -221
- package/SECURITY.md +55 -89
- package/dist/src/errors.d.ts +10 -1
- package/dist/src/errors.js +3 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/gateway/claude-helper-protocol.d.ts +9 -12
- package/dist/src/gateway/claude-helper-protocol.js +15 -13
- package/dist/src/gateway/claude-helper-protocol.js.map +1 -1
- package/dist/src/gateway/claude-helper-supervisor.d.ts +2 -6
- package/dist/src/gateway/claude-helper-supervisor.js +10 -9
- package/dist/src/gateway/claude-helper-supervisor.js.map +1 -1
- package/dist/src/gateway/claude-helper.js +18 -10
- package/dist/src/gateway/claude-helper.js.map +1 -1
- package/dist/src/gateway/claude-peer.d.ts +0 -3
- package/dist/src/gateway/claude-peer.js +6 -18
- package/dist/src/gateway/claude-peer.js.map +1 -1
- package/dist/src/gateway/cli.d.ts +18 -13
- package/dist/src/gateway/cli.js +942 -298
- package/dist/src/gateway/cli.js.map +1 -1
- package/dist/src/gateway/codex-local-transport.d.ts +1 -1
- package/dist/src/gateway/codex-local-transport.js +2 -2
- package/dist/src/gateway/codex-local-transport.js.map +1 -1
- package/dist/src/gateway/codex-socket-holder.d.ts +26 -0
- package/dist/src/gateway/codex-socket-holder.js +76 -0
- package/dist/src/gateway/codex-socket-holder.js.map +1 -0
- package/dist/src/gateway/codex-stateless-transport.js +1 -1
- package/dist/src/gateway/codex-stateless-transport.js.map +1 -1
- package/dist/src/gateway/config.d.ts +5 -13
- package/dist/src/gateway/config.js +7 -19
- package/dist/src/gateway/config.js.map +1 -1
- package/dist/src/gateway/control.d.ts +55 -108
- package/dist/src/gateway/control.js +95 -222
- package/dist/src/gateway/control.js.map +1 -1
- package/dist/src/gateway/federation-nodes.d.ts +29 -3
- package/dist/src/gateway/federation-nodes.js +200 -15
- package/dist/src/gateway/federation-nodes.js.map +1 -1
- package/dist/src/gateway/peer-client.d.ts +4 -3
- package/dist/src/gateway/peer-client.js +22 -13
- package/dist/src/gateway/peer-client.js.map +1 -1
- package/dist/src/gateway/peer-protocol.d.ts +8 -11
- package/dist/src/gateway/peer-protocol.js +5 -12
- package/dist/src/gateway/peer-protocol.js.map +1 -1
- package/dist/src/gateway/provenance-envelope.d.ts +0 -1
- package/dist/src/gateway/provenance-envelope.js +4 -19
- package/dist/src/gateway/provenance-envelope.js.map +1 -1
- package/dist/src/gateway/providers.d.ts +10 -7
- package/dist/src/gateway/providers.js +21 -28
- package/dist/src/gateway/providers.js.map +1 -1
- package/dist/src/gateway/server.d.ts +4 -14
- package/dist/src/gateway/server.js +33 -59
- package/dist/src/gateway/server.js.map +1 -1
- package/dist/src/gateway/service-agent.d.ts +187 -0
- package/dist/src/gateway/service-agent.js +758 -0
- package/dist/src/gateway/service-agent.js.map +1 -0
- package/dist/src/gateway/service.d.ts +117 -32
- package/dist/src/gateway/service.js +525 -576
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/gateway/status-view.d.ts +167 -0
- package/dist/src/gateway/status-view.js +488 -0
- package/dist/src/gateway/status-view.js.map +1 -0
- package/dist/src/gateway/store.d.ts +103 -21
- package/dist/src/gateway/store.js +473 -547
- package/dist/src/gateway/store.js.map +1 -1
- package/dist/src/gateway/types.d.ts +51 -102
- package/dist/src/gateway/types.js +15 -52
- package/dist/src/gateway/types.js.map +1 -1
- package/docs/CONFIGURATION.md +194 -59
- package/docs/DELIVERY.md +11 -11
- package/docs/GATEWAY-ARCHITECTURE.md +286 -394
- package/package.json +4 -12
- package/skills/embassy-peer/SKILL.md +72 -92
- package/skills/embassy-peer/agents/openai.yaml +1 -1
- package/README.zh-CN.md +0 -269
- package/assets/live-dashboard/app.css +0 -1619
- package/assets/vendor/react/LICENSE +0 -21
- package/assets/vendor/react/react-dom.production.min.js +0 -267
- package/assets/vendor/react/react.production.min.js +0 -31
- package/dist/src/gateway/acp-client.d.ts +0 -110
- package/dist/src/gateway/acp-client.js +0 -407
- package/dist/src/gateway/acp-client.js.map +0 -1
- package/dist/src/gateway/acp-provider.d.ts +0 -66
- package/dist/src/gateway/acp-provider.js +0 -275
- package/dist/src/gateway/acp-provider.js.map +0 -1
- package/dist/src/gateway/cli-copy.d.ts +0 -8
- package/dist/src/gateway/cli-copy.en.d.ts +0 -17
- package/dist/src/gateway/cli-copy.en.js +0 -58
- package/dist/src/gateway/cli-copy.en.js.map +0 -1
- package/dist/src/gateway/cli-copy.js +0 -22
- package/dist/src/gateway/cli-copy.js.map +0 -1
- package/dist/src/gateway/cli-copy.zh-CN.d.ts +0 -17
- package/dist/src/gateway/cli-copy.zh-CN.js +0 -58
- package/dist/src/gateway/cli-copy.zh-CN.js.map +0 -1
- package/dist/src/gateway/codex-doctor.d.ts +0 -36
- package/dist/src/gateway/codex-doctor.js +0 -127
- package/dist/src/gateway/codex-doctor.js.map +0 -1
- package/dist/src/gateway/dashboard-copy.d.ts +0 -7
- package/dist/src/gateway/dashboard-copy.en.d.ts +0 -504
- package/dist/src/gateway/dashboard-copy.en.js +0 -505
- package/dist/src/gateway/dashboard-copy.en.js.map +0 -1
- package/dist/src/gateway/dashboard-copy.js +0 -514
- package/dist/src/gateway/dashboard-copy.js.map +0 -1
- package/dist/src/gateway/dashboard-copy.zh-CN.d.ts +0 -504
- package/dist/src/gateway/dashboard-copy.zh-CN.js +0 -505
- package/dist/src/gateway/dashboard-copy.zh-CN.js.map +0 -1
- package/dist/src/gateway/dashboard-model.d.ts +0 -343
- package/dist/src/gateway/dashboard-model.js +0 -1061
- package/dist/src/gateway/dashboard-model.js.map +0 -1
- package/dist/src/gateway/dashboard.d.ts +0 -20
- package/dist/src/gateway/dashboard.js +0 -874
- package/dist/src/gateway/dashboard.js.map +0 -1
- package/dist/src/gateway/deepseek-detect.d.ts +0 -14
- package/dist/src/gateway/deepseek-detect.js +0 -41
- package/dist/src/gateway/deepseek-detect.js.map +0 -1
- package/dist/src/gateway/live-dashboard-app/app.js +0 -2385
- package/dist/src/gateway/live-dashboard-assets.d.ts +0 -10
- package/dist/src/gateway/live-dashboard-assets.js +0 -74
- package/dist/src/gateway/live-dashboard-assets.js.map +0 -1
- package/dist/src/gateway/live-dashboard-command.d.ts +0 -58
- package/dist/src/gateway/live-dashboard-command.js +0 -334
- package/dist/src/gateway/live-dashboard-command.js.map +0 -1
- package/dist/src/gateway/live-dashboard-http.d.ts +0 -39
- package/dist/src/gateway/live-dashboard-http.js +0 -383
- package/dist/src/gateway/live-dashboard-http.js.map +0 -1
- package/dist/src/gateway/live-dashboard-protocol.d.ts +0 -34
- package/dist/src/gateway/live-dashboard-protocol.js +0 -114
- package/dist/src/gateway/live-dashboard-protocol.js.map +0 -1
- package/dist/src/gateway/live-dashboard-server.d.ts +0 -33
- package/dist/src/gateway/live-dashboard-server.js +0 -144
- package/dist/src/gateway/live-dashboard-server.js.map +0 -1
- package/dist/src/gateway/live-dashboard-stream.d.ts +0 -46
- package/dist/src/gateway/live-dashboard-stream.js +0 -234
- package/dist/src/gateway/live-dashboard-stream.js.map +0 -1
- package/dist/src/gateway/live-dashboard.d.ts +0 -28
- package/dist/src/gateway/live-dashboard.js +0 -154
- package/dist/src/gateway/live-dashboard.js.map +0 -1
- package/dist/src/gateway/locale.d.ts +0 -4
- package/dist/src/gateway/locale.js +0 -10
- package/dist/src/gateway/locale.js.map +0 -1
- package/dist/src/gateway/progress-watch-machine.d.ts +0 -45
- package/dist/src/gateway/progress-watch-machine.js +0 -70
- package/dist/src/gateway/progress-watch-machine.js.map +0 -1
- package/dist/src/gateway/state-v2-to-v3.d.ts +0 -24
- package/dist/src/gateway/state-v2-to-v3.js +0 -1034
- package/dist/src/gateway/state-v2-to-v3.js.map +0 -1
- package/docs/CONFIGURATION.zh-CN.md +0 -93
- package/docs/DASHBOARD.md +0 -98
- package/docs/DASHBOARD.zh-CN.md +0 -49
- package/docs/DELIVERY.zh-CN.md +0 -55
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
[English](README.md) · [简体中文](README.zh-CN.md)
|
|
2
|
-
|
|
3
1
|
<p align="center">
|
|
4
|
-
<img src="https://raw.githubusercontent.com/YuanpingSong/embassy/main/assets/social-preview.png" alt="Embassy — a local gateway for
|
|
2
|
+
<img src="https://raw.githubusercontent.com/YuanpingSong/embassy/main/assets/social-preview.png" alt="Embassy — a local gateway for messaging between Claude Code sessions and Codex CLI tasks" width="720">
|
|
5
3
|
</p>
|
|
6
4
|
|
|
7
5
|
# Embassy
|
|
@@ -12,287 +10,178 @@
|
|
|
12
10
|
[](LICENSE)
|
|
13
11
|
[](package.json)
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install -g agent-embassy
|
|
19
|
-
```
|
|
13
|
+
Embassy is a small local broker that lets a [Claude Code](https://code.claude.com) session and a [Codex](https://chatgpt.com/codex) CLI task on the same Mac message each other by name, with a receipt for every delivery. It is personal software — one person, one macOS account, agents you already trust to run as that user — and an unofficial project, not affiliated with or endorsed by Anthropic or OpenAI.
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
Code session with peer protocol 1. Embassy derives the external registry and
|
|
23
|
-
peer-socket roots from the current OS user; it does not inspect Claude's
|
|
24
|
-
launcher or configuration. Codex routes require **a managed Codex App Server
|
|
25
|
-
standalone install** (created by the ChatGPT desktop app, or by the official
|
|
26
|
-
installer `curl -fsSL
|
|
27
|
-
https://chatgpt.com/codex/install.sh | sh` followed by `codex app-server
|
|
28
|
-
daemon start` — the daemon alone does not provision the layout). A missing
|
|
29
|
-
Claude registry degrades only Claude while the broker and other providers stay
|
|
30
|
-
available. pnpm users: pin the version (`pnpm install -g
|
|
31
|
-
agent-embassy@latest` can resolve stale metadata; prefer an explicit
|
|
32
|
-
version) and ensure `PNPM_HOME/bin` is on PATH in non-interactive shells.
|
|
15
|
+
## Install
|
|
33
16
|
|
|
34
17
|
```bash
|
|
35
|
-
embassy
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Or from source: `git clone https://github.com/YuanpingSong/embassy && cd embassy && npm ci && npm run build && npm link`.
|
|
39
|
-
|
|
40
|
-
Embassy is built for one person, one macOS account, and agents you already trust to run as that user. It is an unofficial community project and is not affiliated with or endorsed by Anthropic or OpenAI.
|
|
41
|
-
|
|
42
|
-
## Quickstart
|
|
43
|
-
|
|
44
|
-
**Requirements:** macOS and Node.js 20+. Claude routes require peer protocol 1; Codex routes require Desktop configured to use its managed standalone App Server. DeepSeek is optional and launches from `DSH_HOME` (default `~/.dsh`) through the checkout's `demo:acp` script; Grok Build is optional and launches the release-pinned ACP package. A shell peer needs only the local CLI and its one-time token. The release-owned [support matrix](support/provider-support-matrix.json) records the exact tested provider artifacts and capabilities; it is release evidence, never a runtime allowlist:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
~/.codex/packages/standalone/current/codex app-server daemon start
|
|
48
|
-
/usr/bin/open --env CODEX_APP_SERVER_USE_LOCAL_DAEMON=1 -a ChatGPT
|
|
18
|
+
npm install -g agent-embassy
|
|
19
|
+
embassy service install
|
|
49
20
|
```
|
|
50
21
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Desktop attaches to the managed standalone App Server when it launches. If the daemon restarts while Desktop is already open, waiting alone does not reconnect that app process: fully quit Desktop, rerun `/usr/bin/open --env CODEX_APP_SERVER_USE_LOCAL_DAEMON=1 -a ChatGPT`, and reopen the exact task.
|
|
54
|
-
|
|
55
|
-
Runtime delivery is best effort. Version and build strings are unverified metadata and never grant or withhold routing authority. Consent plus exact logical route/session identity authorizes an attempt; the current per-operation transport and correlated evidence determine its honest result. Unsupported or changed interfaces therefore fail with provider-local safe codes instead of an online compatibility tier. Embassy still validates the trust boundary: exact owned or executed artifacts and state paths, generations of artifacts it actually uses, strict consumed protocol fields, Claude peer protocol 1, bounded queues, and no replay after an ambiguous write.
|
|
22
|
+
`service install` runs the broker as your user's launchd agent: it starts at login, restarts after a crash, and logs to `~/Library/Logs/agent-embassy/broker.log`. Prefer a process you start by hand? Run `embassy serve` in a terminal and leave it running instead. You need macOS, Node.js 20+, Claude Code (with its [`crossSessionInbound`](docs/CONFIGURATION.md#claude-codes-own-setting-crosssessioninbound) setting enabled on any session that should receive mail), and Codex CLI with the managed standalone App Server — the official installer `curl -fsSL https://chatgpt.com/codex/install.sh | sh`, then `codex app-server daemon start`. From source: `git clone https://github.com/YuanpingSong/embassy && cd embassy && npm ci && npm run build && npm link`.
|
|
56
23
|
|
|
57
|
-
|
|
24
|
+
Every alias below ends in `@your-host`. Replace `your-host` with this machine's host — the `hostId` on the broker's ready line (in the log, under launchd); name the wrong host and the CLI says which one this machine uses.
|
|
58
25
|
|
|
59
|
-
|
|
26
|
+
## Your first message in four commands
|
|
60
27
|
|
|
61
|
-
|
|
28
|
+
**1. Register the Codex task.** Ask your Codex agent to run this as a shell step in its current turn; it must run inside the task so it inherits the task's identity. You should see `"accepted":true`.
|
|
62
29
|
|
|
63
30
|
```bash
|
|
64
|
-
embassy
|
|
31
|
+
embassy register-codex --alias codex-reviewer@your-host
|
|
65
32
|
```
|
|
66
33
|
|
|
67
|
-
|
|
34
|
+
**2. Read what the broker sees.** The `sessions` block lists your live Claude Code sessions by name. If it is empty, start a Claude Code session and run `embassy refresh`, then look again.
|
|
68
35
|
|
|
69
36
|
```bash
|
|
70
|
-
embassy health
|
|
71
37
|
embassy status
|
|
72
38
|
```
|
|
73
39
|
|
|
74
|
-
`status`
|
|
75
|
-
that list is empty, start a Claude Code session and run
|
|
76
|
-
`embassy refresh-dashboard`, which refreshes discovery; the next `status`
|
|
77
|
-
should show it.
|
|
78
|
-
|
|
79
|
-
### 2. Register the Codex task
|
|
80
|
-
|
|
81
|
-
Ask your Codex agent to run this as a shell step in its current turn — the command must run inside the task so it inherits the task's identity:
|
|
40
|
+
**3. Send.** From the Codex task, body on stdin, to the name `status` showed. The session's route installs on its first use — there is no step between reading a name and messaging it. You get a `conv_` conversation token and a `dlv_` delivery token back.
|
|
82
41
|
|
|
83
42
|
```bash
|
|
84
|
-
embassy
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
You should see `"accepted":true`. The `codex-` prefix is required for Claude discovery. To retire the task later, run `embassy unregister-codex --alias codex-reviewer@this-mac` from inside that same task.
|
|
88
|
-
|
|
89
|
-
Registration records the exact inherited task identity and performs no App Server I/O. Every delivery opens a fresh attested local transport, initializes it, resumes that exact task with history excluded, and authorizes the body write once. App Server and Desktop restarts therefore do not require re-registration or re-anchoring; a current unavailable or unobservable task keeps the logical route and consent edge while the attempt reports an exact safe code. Embassy never retargets by alias or replays an ambiguously written body.
|
|
90
|
-
|
|
91
|
-
### Optional: register a universal shell peer
|
|
92
|
-
|
|
93
|
-
A local shell harness can join as a `peer-*` route without a plugin, stable shell, daemon, PID binding, token file, or Keychain entry:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
embassy register-peer --alias peer-reviewer@this-mac
|
|
43
|
+
embassy send --from codex-reviewer@your-host --to advisor@your-host --expects-reply <<'MSG'
|
|
44
|
+
Please review the current approach and identify the main risk.
|
|
45
|
+
MSG
|
|
97
46
|
```
|
|
98
47
|
|
|
99
|
-
|
|
48
|
+
**4. Answer by conversation.** Every delivered body arrives inside one broker-owned `<cross-session-message>` frame naming the attested sender (on a federated hop, the sender is named by the sending node — see [SECURITY.md](SECURITY.md)), and its first `<embassy-reply-hint>` carries the full `conv_` token and this exact command; the recipient runs it with the answer on stdin.
|
|
100
49
|
|
|
101
50
|
```bash
|
|
102
|
-
embassy
|
|
103
|
-
|
|
104
|
-
|
|
51
|
+
embassy send --conversation conv_<token> --from advisor@your-host <<'MSG'
|
|
52
|
+
The main risk is the double-write window; gate it behind the flag.
|
|
53
|
+
MSG
|
|
105
54
|
```
|
|
106
55
|
|
|
107
|
-
`
|
|
56
|
+
The same `send` runs from a Claude Code session, inheriting that session's identity, and the other direction needs no Embassy command at all: a Claude session finds `codex-reviewer` with its native `ListAgents` tool and messages it with `SendMessage`. `--to <session-uuid>` addresses a Claude session by its UUID. When two live sessions share a name, the send is refused with `PEER_ALIAS_COLLISION` rather than delivered to a guess — rename one and retry. A Claude session's reply to a `--expects-reply` send is routed back to the Codex task by itself.
|
|
108
57
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
Pick one name from `availablePeers`:
|
|
58
|
+
## After any Claude Code or Codex CLI update
|
|
112
59
|
|
|
113
60
|
```bash
|
|
114
|
-
embassy
|
|
61
|
+
embassy check
|
|
115
62
|
```
|
|
116
63
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
You should see `"accepted":true`. Registration and selection together form a pair — this Claude session and this Codex task can now exchange messages through Embassy.
|
|
120
|
-
|
|
121
|
-
To connect any two routes from different providers, name both ends explicitly with `embassy pair --from <alias> --to <alias>`; many edges can coexist. The command must run under an inherited endpoint identity that belongs to the requested edge. The live dashboard offers the same bounded, confirmed operation to the local operator.
|
|
64
|
+
`check` is the upstream-drift tripwire. It registers an ephemeral shell peer of its own — kept out of the durable state document and the federation catalog, expiring on its own; its only trace is the native advertisement to Claude sessions, released with it, and a broker that dies mid-check can leave that record until the alias is next registered and released — sends one marked message through the ordinary send path to the most recently observed registered Codex task (observed within ten minutes; a task never observed is not eligible), waits for `delivered`, awaits the echo on its own mailbox, releases the registration, and prints every hop with its timing; any failing hop exits non-zero with the safe code that explains it. `--to <alias>` picks a target and `--timeout <s>` bounds each wait. The peer answers because the shipped [skill](skills/embassy-peer/SKILL.md) tells it to — a message whose verified sender starts with `peer-check-` and whose body starts `[embassy check` is echoed in one line; either half alone is ordinary untrusted text. It costs the peer one model turn, so it is a deliberate command, not something to poll.
|
|
122
65
|
|
|
123
|
-
|
|
66
|
+
```text
|
|
67
|
+
embassy check 50066f60 → codex-reviewer@this-mac
|
|
124
68
|
|
|
125
|
-
|
|
69
|
+
ok register peer-check-b0c963c9@this-mac (ephemeral, 2 min) 6 ms
|
|
70
|
+
ok send accepted, conversation …89abcdef 15 ms
|
|
71
|
+
ok delivered the peer's transport accepted it 256 ms
|
|
72
|
+
ok reply codex-reviewer@this-mac echoed 50066f60 1407 ms
|
|
73
|
+
ok cleanup temporary check identity removed
|
|
126
74
|
|
|
127
|
-
|
|
128
|
-
embassy send-to-claude \
|
|
129
|
-
--from codex-reviewer@this-mac \
|
|
130
|
-
--to advisor@this-mac \
|
|
131
|
-
--expects-reply <<'MSG'
|
|
132
|
-
Please review the current approach and identify the main risk.
|
|
133
|
-
MSG
|
|
75
|
+
check passed
|
|
134
76
|
```
|
|
135
77
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
`send-to-codex` is the CLI form of that same direction, for a Claude session that prefers an explicit command. It takes the same flags and reads the body from stdin, and it must run inside the Claude session so it inherits that session's reply identity:
|
|
78
|
+
Install the skill where each agent discovers skills — Codex tasks can then be prompted with `$embassy-peer`, and Claude Code finds it as a user skill:
|
|
139
79
|
|
|
140
80
|
```bash
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
--to codex-reviewer@this-mac \
|
|
144
|
-
--expects-reply <<'MSG'
|
|
145
|
-
Summarize the migration risks you found.
|
|
146
|
-
MSG
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### 5. Follow up
|
|
150
|
-
|
|
151
|
-
Either participant can continue the conversation with `reply`. The initiating
|
|
152
|
-
CLI receives the full `conv_` token in its accepted result; the recipient gets
|
|
153
|
-
the same token and an exact reply command in the broker-owned message marker:
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
embassy reply \
|
|
157
|
-
--conversation conv_<token> \
|
|
158
|
-
--alias codex-reviewer@this-mac <<'MSG'
|
|
159
|
-
Please expand on the migration risk.
|
|
160
|
-
MSG
|
|
81
|
+
cp -R "$(npm root -g)/agent-embassy/skills/embassy-peer" ~/.codex/skills/
|
|
82
|
+
cp -R "$(npm root -g)/agent-embassy/skills/embassy-peer" ~/.claude/skills/
|
|
161
83
|
```
|
|
162
84
|
|
|
163
|
-
|
|
164
|
-
`<cross-session-message>` textual frame. It identifies the verified sender
|
|
165
|
-
alias and begins with an `<embassy-reply-hint>` containing the full conversation
|
|
166
|
-
token, the recipient's exact alias, and the corresponding `embassy reply`
|
|
167
|
-
command. Use only that delivered full token and alias; never guess one from a
|
|
168
|
-
suffix or substitute the sender's alias. The CLI still rechecks the caller,
|
|
169
|
-
conversation membership, and current route policy, so the hint is
|
|
170
|
-
not a permission bypass.
|
|
171
|
-
|
|
172
|
-
The frame is a clear provenance marker, not a cryptographic signature or a
|
|
173
|
-
claim that the body is trustworthy. Embassy neutralizes nested occurrences of
|
|
174
|
-
its reserved framing tags in the untrusted body before provider delivery;
|
|
175
|
-
arbitrary same-user code and all message text remain untrusted input.
|
|
85
|
+
## Shell-peer fallback
|
|
176
86
|
|
|
177
|
-
|
|
87
|
+
Any local harness that can run the CLI can join as a `peer-*` route — no plugin, daemon, PID binding, token file, or Keychain entry — and it is the supported fallback channel when native Codex delivery is unavailable. `embassy register-peer --alias peer-reviewer@your-host` prints a `peer_` token exactly once; keep it in the agent's context, never in argv, and pass it as the first stdin line of every later peer command with `--token-stdin` (the remaining stdin bytes are the body; `--emit-env` exists only for a harness that really does keep one stable shell). `embassy await --alias peer-reviewer@your-host --token-stdin` long-polls the mailbox in bounded 30-second iterations — one waiter per route, 16 in total — writes the complete framed message to stdout, and acknowledges only after stdout has flushed. A missing acknowledgement settles `unconfirmed`; uncertainty after the write was armed settles `ambiguous`; neither is replayed.
|
|
178
88
|
|
|
179
|
-
|
|
180
|
-
(overview, deliveries, routes, activity, diagnostics) at
|
|
181
|
-
`http://127.0.0.1:41961/` by default. To choose another stable port for that
|
|
182
|
-
invocation, run `embassy dashboard --live --port <n>` with an integer from 1024
|
|
183
|
-
through 65535. Up to four concurrent live views — across windows, tabs, or
|
|
184
|
-
browsers — can use that URL while the foreground companion runs; a fifth stream
|
|
185
|
-
is refused until one closes. If the port is occupied, startup fails explicitly,
|
|
186
|
-
points to `--port`, and never falls back to another port. See
|
|
187
|
-
[Dashboard](docs/DASHBOARD.md) for details.
|
|
89
|
+
## Federation
|
|
188
90
|
|
|
189
|
-
The
|
|
91
|
+
`nodes.json` in the state directory is optional. The broker writes it on first boot, naming this machine by its own hostname with an empty peer list, and from then on that file — not the hostname — is the broker's durable identity. To reach a second machine, add its OpenSSH `Host` alias to `nodes`, keep `host` exactly as written, and restart: the brokers exchange body-free route catalogs and destination-owned handoffs over `ssh <node> embassy peer-stdio`, your SSH configuration owns keys and users, and Embassy opens no listener. Remote routes appear as `alias@host` mirrors. Details in [Configuration](docs/CONFIGURATION.md).
|
|
190
92
|
|
|
191
|
-
|
|
93
|
+
## Observability
|
|
192
94
|
|
|
193
|
-
|
|
95
|
+
`embassy status` is the one command for "what is going on". It is read-only — it never rescans; `embassy refresh` does — and prints prose in a terminal but the unchanged JSON snapshot when piped or with `--json`, so `embassy status --json | jq .routes` and every script keep working. `--recent <n>` (1–100, default 10) sizes the message list.
|
|
194
96
|
|
|
195
97
|
```text
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
98
|
+
embassy 3.0.0 broker ok · pid 41213 · snapshot just now
|
|
99
|
+
state dir /Users/you/.local/state/agent-embassy
|
|
100
|
+
sessions scanned 3s ago
|
|
101
|
+
|
|
102
|
+
connectors
|
|
103
|
+
claude ok
|
|
104
|
+
codex ok
|
|
105
|
+
|
|
106
|
+
sessions
|
|
107
|
+
session state route last seen
|
|
108
|
+
advisor@this-mac busy routed 3s ago
|
|
109
|
+
|
|
110
|
+
routes
|
|
111
|
+
alias provider state queue last seen
|
|
112
|
+
advisor@this-mac claude busy 2 discovered 3s
|
|
113
|
+
codex-reviewer@this-mac codex idle 0 12s ago
|
|
114
|
+
|
|
115
|
+
recent (3 of 3)
|
|
116
|
+
12s ago advisor@this-mac → codex-reviewer@this-mac queued
|
|
117
|
+
2m ago codex-reviewer@this-mac → advisor@this-mac delivered 210 ms
|
|
118
|
+
The risk is the double-write window; I would gate it behind…
|
|
119
|
+
5m ago advisor@this-mac → codex-reviewer@this-mac delivered 61 ms
|
|
120
|
+
Please review the migration risk before the freeze.
|
|
204
121
|
```
|
|
205
122
|
|
|
206
|
-
|
|
123
|
+
When something is wrong it says the safe code **and** what to do about it, and one quiet corner never makes the whole broker look broken:
|
|
207
124
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
-
|
|
227
|
-
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
125
|
+
```text
|
|
126
|
+
embassy 3.0.0 broker degraded · pid 41213 · snapshot just now
|
|
127
|
+
state dir /Users/you/.local/state/agent-embassy
|
|
128
|
+
sessions scanned 3s ago
|
|
129
|
+
|
|
130
|
+
connectors
|
|
131
|
+
claude ok
|
|
132
|
+
codex degraded MANAGED_CODEX_UNAVAILABLE
|
|
133
|
+
Either a process outside Embassy holds the managed Codex control socket — quit it — or the managed App Server standalone layout is missing, which starting the daemon alone does not create: follow the Codex prerequisite in the README (the official installer, then the daemon).
|
|
134
|
+
peer-release@this-mac stale (token or await loop gone)
|
|
135
|
+
2 message(s) waiting: run `embassy await --alias peer-release@this-mac --token-stdin` in the shell holding its token, or `embassy unregister-peer --alias peer-release@this-mac --token-stdin`.
|
|
136
|
+
|
|
137
|
+
sessions
|
|
138
|
+
session state route last seen
|
|
139
|
+
advisor@this-mac busy routed 3s ago
|
|
140
|
+
|
|
141
|
+
routes
|
|
142
|
+
alias provider state queue last seen
|
|
143
|
+
advisor@this-mac claude busy 2 discovered 3s
|
|
144
|
+
codex-reviewer@this-mac codex stale 1 30m ago
|
|
145
|
+
peer-release@this-mac peer idle 2 never
|
|
146
|
+
codex-reviewer@this-mac: That Codex task is gone. Run `embassy register-codex --alias <new-alias> --succeeds <this alias>` from the new task, or `embassy unregister-codex --alias <this alias>` from the old one.
|
|
147
|
+
|
|
148
|
+
recent (3 of 3)
|
|
149
|
+
12s ago advisor@this-mac → codex-reviewer@this-mac queued
|
|
150
|
+
2m ago codex-reviewer@this-mac → advisor@this-mac delivered 210 ms
|
|
151
|
+
The risk is the double-write window; I would gate it behind…
|
|
152
|
+
5m ago advisor@this-mac → codex-reviewer@this-mac delivered 61 ms
|
|
153
|
+
Please review the migration risk before the freeze.
|
|
154
|
+
|
|
155
|
+
alerts
|
|
156
|
+
PEER_TUNNEL_UNAVAILABLE studio 45s ago
|
|
157
|
+
The SSH tunnel to that node is down; check the node is reachable and its broker is running.
|
|
238
158
|
```
|
|
239
159
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
## Commands
|
|
243
|
-
|
|
244
|
-
| Command | Run by | Purpose |
|
|
245
|
-
| --- | --- | --- |
|
|
246
|
-
| `serve` | operator | Start the foreground broker and dashboard |
|
|
247
|
-
| `health` / `status` | operator | Check liveness and inspect the sanitized snapshot |
|
|
248
|
-
| `refresh-dashboard` | operator | Refresh provider discovery and regenerate both static dashboard files |
|
|
249
|
-
| `convert-state-v2-to-v3` | operator, broker stopped | Back up and convert the configured private state to native v3 without starting providers or the broker |
|
|
250
|
-
| `dashboard --live [--lang en\|zh-CN] [--port <n>]` | operator | Start the live dashboard companion with bounded route-consent actions; requires a running `embassy serve` |
|
|
251
|
-
| `delivery-status` | either provider | Read one delivery tracker with `embassy delivery-status --token dlv_<token>` |
|
|
252
|
-
| `wait-delivery` | either provider | Wait for that tracker to settle, up to the delivery deadline |
|
|
253
|
-
| `untrack` | either provider | Close one active progress watch: `embassy untrack --conversation conv_<token>` |
|
|
254
|
-
| `register-codex` / `unregister-codex` | Codex task | Advertise or retire that exact task; both take `--alias <codex-alias>`, and `embassy register-codex --alias codex-successor@this-mac --succeeds codex-reviewer@this-mac` hands the registration to a different task |
|
|
255
|
-
| `register-peer` / `unregister-peer` | shell harness | Register or retire a `peer-*` route; registration emits its raw token once, while authenticated calls use `--token-stdin` (or the optional stable-shell env form) |
|
|
256
|
-
| `await` | registered shell peer | Long-poll the peer mailbox in bounded 30-second iterations; one waiter per route, 16 globally, with acknowledgement only after stdout flush |
|
|
257
|
-
| `pair` / `unpair` | endpoint participant | Add or remove one cross-provider edge by naming both ends: `embassy pair --from advisor@this-mac --to grok-main@this-mac`; the inherited caller must belong to the edge |
|
|
258
|
-
| `select-claude` / `unselect-claude` | operator or Codex task | One-task shorthand for `pair`/`unpair`, taking `--alias <name@host>` or `--session <uuid>`: resolves the Codex end only when it is unambiguous (inherited or sole registered task), otherwise fails closed |
|
|
259
|
-
| `send-to-claude` | registered Codex task | Send one bounded message to a paired Claude session: `--from <codex-alias> --to <claude-alias>`, body on stdin, optional `--expects-reply` and `--track [--idle-minutes <n>]` |
|
|
260
|
-
| `send-to-codex` | Claude session | Same flags and stdin body, using the inherited native reply identity |
|
|
261
|
-
| `reply` | conversation-token holder | Continue an active conversation with the full token returned to the initiator or delivered in the recipient's broker-owned reply hint: `--conversation conv_<token> --alias <your-alias>`, body on stdin, optional `--track [--idle-minutes <n>]` |
|
|
262
|
-
|
|
263
|
-
`--track` opens a progress watch over the conversation; `--idle-minutes <n>`
|
|
264
|
-
sets the idle interval for bounded liveness nudges (1–1440, default 5, rejected
|
|
265
|
-
without `--track`). If the watch ultimately times out, Embassy records it only
|
|
266
|
-
in watch history and emits no runtime stall alert. Close a watch with `untrack`,
|
|
267
|
-
or by replying with a leading `DONE:`. See [Delivery](docs/DELIVERY.md).
|
|
160
|
+
`embassy watch` tails the broker until Ctrl-C: each new message and each settlement at most once (`accepted → delivered (61 ms)`), stamped with the local time, plus route installs and retirements as a secondary line; `--json` streams the same events as JSONL. At most once, not exactly once — a transition that passes entirely between two one-second polls is never seen, and rows that left the retained window before the tail reached them are announced as a one-line note. `embassy --help` lists all seventeen commands.
|
|
268
161
|
|
|
269
162
|
## Safety in one minute
|
|
270
163
|
|
|
271
|
-
- **
|
|
272
|
-
- **
|
|
273
|
-
- **
|
|
274
|
-
- **
|
|
275
|
-
|
|
276
|
-
|
|
164
|
+
- **The OS boundary is the permission.** Reaching the same-UID private control socket on this host — or on a host in your `nodes.json` — plus an exact alias is what lets a process message. There is no separate grant to hand out or revoke, because none could stop code already running as your user; a Claude session's route installs on its first use, and a Codex task registers explicitly only because Embassy must record its inherited identity. `embassy serve` binds no TCP port and serves no HTTP.
|
|
165
|
+
- **Every routed body carries the provenance envelope naming the sender.** It is a marker for the receiving model, not a signature: treat every delivered body as untrusted input. Native permissions stay native — Embassy answers no Codex approval and cannot override Claude's `crossSessionInbound`.
|
|
166
|
+
- **Bounded by design.** Queues, bodies (16 KiB), conversations, rate windows, and deadlines are bounded, and an ambiguous write is never replayed. `delivered` means the provider boundary was crossed — toward Codex the App Server accepted the turn; toward Claude the native mailbox write completed (`transport_written`) — never that a model read it; `unconfirmed` and `ambiguous` mean the evidence is missing and are terminal. Claude-bound bodies are written immediately, busy or idle; Codex-bound bodies queue until the task is idle, and only an exact leading `STEER:` from Claude may enter the active turn at its next tool-call boundary.
|
|
167
|
+
- **Bodies are retained locally and yours.** Message bodies and their opaque delivery token/status persist in the broker's private mode-0600 state under bounded retention, and what `status` prints is a status snapshot that includes retained message bodies: `embassy status` shows retained bodies; treat its output as sensitive as the messages themselves.
|
|
168
|
+
|
|
169
|
+
See [SECURITY.md](SECURITY.md) for the boundary in depth and how to report a vulnerability.
|
|
277
170
|
|
|
278
|
-
|
|
171
|
+
<!-- tested-with: filled by the PM after the cutover drill -->
|
|
279
172
|
|
|
280
|
-
##
|
|
173
|
+
## Upgrading from 2.x
|
|
281
174
|
|
|
282
|
-
|
|
283
|
-
- **Not a hosted service.** Personal, same-machine, same-OS-account software.
|
|
284
|
-
- **Not a permission bypass — but it is a new path.** Neither agent gains a tool it did not already have, and Embassy grants, relaxes, and answers nothing. It does, however, connect two products that previously could not exchange text at all. That path is the product; treat it with the respect you would give any new input channel.
|
|
285
|
-
- **Not official.** Not affiliated with or endorsed by Anthropic or OpenAI.
|
|
175
|
+
Version 3 accepts only fresh private state. Stop Embassy, move `gateway-state.json` aside, start 3.0, and re-register Codex tasks; Claude routes reinstall themselves on first use, and `nodes.json` is written for you if absent. The full [private state reset](docs/CONFIGURATION.md#private-state-reset) and every change are in the [changelog](CHANGELOG.md).
|
|
286
176
|
|
|
287
177
|
## Documentation
|
|
288
178
|
|
|
289
179
|
| Document | What it covers |
|
|
290
180
|
| --- | --- |
|
|
291
|
-
| [Architecture](docs/GATEWAY-ARCHITECTURE.md) |
|
|
181
|
+
| [Architecture](docs/GATEWAY-ARCHITECTURE.md) | Topology, adapters, control plane, federation, protocol versions, and the OS-boundary permission model |
|
|
292
182
|
| [Delivery](docs/DELIVERY.md) | Delivery semantics, tokens, settlement states, and retry rules |
|
|
293
|
-
| [Configuration](docs/CONFIGURATION.md) | Environment variables,
|
|
294
|
-
| [
|
|
295
|
-
| [Security policy](SECURITY.md) | How to report a vulnerability, and the boundary in depth |
|
|
183
|
+
| [Configuration](docs/CONFIGURATION.md) | Environment variables, `nodes.json`, the launchd service, and addressing |
|
|
184
|
+
| [Security policy](SECURITY.md) | The boundary in depth, and how to report a vulnerability |
|
|
296
185
|
| [Contributing](CONTRIBUTING.md) | Where changes go, and how to run the deterministic suite |
|
|
297
186
|
| [Changelog](CHANGELOG.md) | What each release contains |
|
|
298
187
|
| [Agent skill](skills/embassy-peer/SKILL.md) | The workflow an agent follows to operate Embassy |
|