agent-embassy 3.0.0 → 3.1.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/CONTRIBUTING.md +4 -2
  3. package/README.md +26 -7
  4. package/SECURITY.md +17 -4
  5. package/dist/src/gateway/claude-helper-supervisor.js +36 -9
  6. package/dist/src/gateway/claude-helper-supervisor.js.map +1 -1
  7. package/dist/src/gateway/claude-helper.js.map +1 -1
  8. package/dist/src/gateway/claude-peer.js +1 -1
  9. package/dist/src/gateway/claude-peer.js.map +1 -1
  10. package/dist/src/gateway/cli.d.ts +2 -3
  11. package/dist/src/gateway/cli.js +135 -106
  12. package/dist/src/gateway/cli.js.map +1 -1
  13. package/dist/src/gateway/config.js +1 -1
  14. package/dist/src/gateway/config.js.map +1 -1
  15. package/dist/src/gateway/control.d.ts +23 -5
  16. package/dist/src/gateway/control.js +41 -11
  17. package/dist/src/gateway/control.js.map +1 -1
  18. package/dist/src/gateway/peer-protocol.d.ts +5 -0
  19. package/dist/src/gateway/peer-protocol.js +9 -0
  20. package/dist/src/gateway/peer-protocol.js.map +1 -1
  21. package/dist/src/gateway/providers.d.ts +4 -3
  22. package/dist/src/gateway/providers.js +33 -30
  23. package/dist/src/gateway/providers.js.map +1 -1
  24. package/dist/src/gateway/server.d.ts +1 -2
  25. package/dist/src/gateway/server.js +1 -4
  26. package/dist/src/gateway/server.js.map +1 -1
  27. package/dist/src/gateway/service.d.ts +6 -8
  28. package/dist/src/gateway/service.js +313 -252
  29. package/dist/src/gateway/service.js.map +1 -1
  30. package/dist/src/gateway/status-view.d.ts +2 -50
  31. package/dist/src/gateway/status-view.js +66 -70
  32. package/dist/src/gateway/status-view.js.map +1 -1
  33. package/dist/src/gateway/store.d.ts +4 -1
  34. package/dist/src/gateway/store.js +12 -11
  35. package/dist/src/gateway/store.js.map +1 -1
  36. package/dist/src/gateway/types.d.ts +17 -4
  37. package/dist/src/gateway/types.js +27 -36
  38. package/dist/src/gateway/types.js.map +1 -1
  39. package/docs/CONFIGURATION.md +3 -3
  40. package/docs/GATEWAY-ARCHITECTURE.md +27 -21
  41. package/package.json +1 -1
  42. package/skills/embassy-peer/SKILL.md +7 -5
  43. package/dist/src/gateway/claude-helper-client.d.ts +0 -2
  44. package/dist/src/gateway/claude-helper-client.js +0 -2
  45. package/dist/src/gateway/claude-helper-client.js.map +0 -1
@@ -7,7 +7,6 @@ export const isGatewayProvider = (value) => typeof value === "string" && gateway
7
7
  export function directionId(sourceProvider, targetProvider) {
8
8
  return `${sourceProvider}_to_${targetProvider}`;
9
9
  }
10
- export const messageDirections = Object.freeze(gatewayProviders.flatMap((sourceProvider) => gatewayProviders.map((targetProvider) => directionId(sourceProvider, targetProvider))));
11
10
  export function parseDirection(value) {
12
11
  if (typeof value !== "string")
13
12
  return undefined;
@@ -35,6 +34,32 @@ export const gatewayPublicSnapshotLimits = Object.freeze({
35
34
  });
36
35
  export const GATEWAY_PUBLIC_SNAPSHOT_BYTE_BUDGET = 240 * 1024;
37
36
  export const CONNECTOR_OBSERVATION_STALE_AFTER_MS = 35_000;
37
+ /**
38
+ * Connector words. A connector reporting `CONNECTOR_OBSERVATION_STALE` has
39
+ * nothing wrong with it: no route of that provider was observed inside the
40
+ * broker's window. That is `stale`, not `degraded`, and the difference is the
41
+ * point — an idle Mac with no registered Codex task must not read as broken.
42
+ */
43
+ export function connectorWord(connector) {
44
+ if (connector.health === "healthy" || connector.health === "connecting")
45
+ return "ok";
46
+ if (connector.health === "offline")
47
+ return "offline";
48
+ return connector.safeErrorCode === "CONNECTOR_OBSERVATION_STALE" ? "stale" : "degraded";
49
+ }
50
+ const severityRank = (word) => word === "degraded" || word === "offline" ? 0 : word === "stale" ? 1 : 2;
51
+ /**
52
+ * The overall word is informational and derived from the two connectors a
53
+ * message actually travels through. A shell peer never contributes: its
54
+ * mailbox is pull-only, so "nobody is awaiting it" is a fact about the
55
+ * operator's other terminal, not about the broker.
56
+ */
57
+ export function gatewayHealthWord(connectors) {
58
+ const routed = connectors.filter((connector) => connector.provider === "claude" || connector.provider === "codex");
59
+ if (routed.length === 0)
60
+ return "offline";
61
+ return routed.map(connectorWord).reduce((worst, word) => severityRank(word) < severityRank(worst) ? word : worst, "ok");
62
+ }
38
63
  export const publicAvailablePeerStates = [
39
64
  "idle",
40
65
  "busy",
@@ -57,6 +82,7 @@ export const gatewayActivityActions = [
57
82
  "codex_unregistered",
58
83
  "claude_route_installed",
59
84
  "claude_route_retired",
85
+ "route_retired",
60
86
  ];
61
87
  export const deadlinePressureBucketNames = [
62
88
  "under_1m",
@@ -65,8 +91,6 @@ export const deadlinePressureBucketNames = [
65
91
  "15m_to_60m",
66
92
  "over_60m",
67
93
  ];
68
- const PUBLIC_ALIAS_PATTERN = /^[a-z][a-z0-9_-]{0,31}@[a-z0-9](?:[a-z0-9.-]{0,61}[a-z0-9])?$/;
69
- const PUBLIC_HOST_PATTERN = /^[a-z0-9](?:[a-z0-9.-]{0,61}[a-z0-9])?$/;
70
94
  const PUBLIC_SAFE_CODE_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
71
95
  function publicRecord(value) {
72
96
  return value !== null && typeof value === "object" && !Array.isArray(value)
@@ -77,42 +101,9 @@ function exactPublicKeys(value, required, optional = []) {
77
101
  return required.every((key) => Object.hasOwn(value, key)) &&
78
102
  keys.every((key) => required.includes(key) || optional.includes(key));
79
103
  }
80
- function publicTimestamp(value) {
81
- return typeof value === "string" && value.length >= 20 && value.length <= 35 && Number.isFinite(Date.parse(value));
82
- }
83
104
  function nonNegative(value) {
84
105
  return Number.isSafeInteger(value) && Number(value) >= 0;
85
106
  }
86
- export function isPublicAvailablePeerSnapshot(value) {
87
- const candidate = publicRecord(value);
88
- if (candidate === undefined ||
89
- !exactPublicKeys(candidate, ["alias", "provider", "host", "state", "validated", "routed"], ["lastSeenAt", "safeErrorCode"]) ||
90
- typeof candidate.alias !== "string" ||
91
- !PUBLIC_ALIAS_PATTERN.test(candidate.alias) ||
92
- typeof candidate.host !== "string" ||
93
- !PUBLIC_HOST_PATTERN.test(candidate.host) ||
94
- !candidate.alias.endsWith(`@${candidate.host}`) ||
95
- candidate.provider !== "claude" ||
96
- typeof candidate.state !== "string" ||
97
- !publicAvailablePeerStates.includes(candidate.state) ||
98
- typeof candidate.validated !== "boolean" ||
99
- typeof candidate.routed !== "boolean")
100
- return false;
101
- return (candidate.lastSeenAt === undefined || publicTimestamp(candidate.lastSeenAt)) &&
102
- (candidate.safeErrorCode === undefined ||
103
- (typeof candidate.safeErrorCode === "string" && PUBLIC_SAFE_CODE_PATTERN.test(candidate.safeErrorCode)));
104
- }
105
- export function arePublicAvailablePeerSnapshots(value, maximumRows = gatewayPublicSnapshotLimits.availablePeers) {
106
- if (!Array.isArray(value) ||
107
- !Number.isSafeInteger(maximumRows) ||
108
- maximumRows < 0 ||
109
- value.length > maximumRows ||
110
- !value.every(isPublicAvailablePeerSnapshot)) {
111
- return false;
112
- }
113
- const aliases = value.map((peer) => `${peer.provider}\0${peer.alias}`);
114
- return new Set(aliases).size === aliases.length;
115
- }
116
107
  export function isPublicRegistryObservationSnapshot(value) {
117
108
  const candidate = publicRecord(value);
118
109
  if (candidate === undefined ||
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/gateway/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAErE,MAAM,CAAC,MAAM,kCAAkC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAkE,CAAC,CAAC;AACvL,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAE/F,MAAM,CAAC,MAAM,WAAW,GA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AAC;IACrB,MAAM,IAAI,UAAU,CAAC,2CAA2C,CAAC,CAAC;AACpE,CAAC"}
@@ -46,7 +46,7 @@ Examples throughout this documentation write aliases as `name@your-host`;
46
46
  substitute your own host — the `hostId` on the broker's ready line — wherever
47
47
  `your-host` appears. The commands that name a route this machine owns —
48
48
  `register-codex` (including `--succeeds`), `unregister-codex`, `register-peer`,
49
- `unregister-peer` and `await` — refuse an alias naming any other host, and say
49
+ `unregister-peer`, `await` and `retire` — refuse an alias naming any other host, and say
50
50
  which host this machine uses and the file that came from. `send` is not
51
51
  restricted this way: its `--to` and `--from` may name a federated peer on
52
52
  another host.
@@ -207,8 +207,8 @@ These variables retain conservative defaults:
207
207
  | `EMBASSY_MESSAGE_DEADLINE_MS` | `14400000` |
208
208
  | `EMBASSY_RATE_LIMIT` / `EMBASSY_RATE_WINDOW_MS` | `30` / `60000` |
209
209
 
210
- `EMBASSY_MAX_ROUTES` accepts 2 through 256. Every value in
211
- this table is validated at startup, and an out-of-range or non-integer setting
210
+ `EMBASSY_MAX_ROUTES` accepts 2 through 128 and also sets the tracked advertisement-helper cap.
211
+ Every value in this table is validated at startup, and an out-of-range or non-integer setting
212
212
  fails closed with `INVALID_GATEWAY_CONFIGURATION` rather than being clamped.
213
213
 
214
214
  The stall notice is not separately configurable. It fires at
@@ -81,9 +81,9 @@ tolerated because Embassy never consumes them; malformed required fields and
81
81
  records whose peer protocol is not 1 remain isolated and counted. Version
82
82
  metadata describes what was observed but grants no runtime authority.
83
83
 
84
- For the lowest-impedance native path, the gateway publishes one process-owned
85
- registry record whose name is visibly prefixed `codex-` and which carries the
86
- supported explicit versioned Embassy-advertisement marker. The listener remains
84
+ For the lowest-impedance native path, each supervised advertisement helper publishes
85
+ one process-owned registry record for a local non-Claude route (`codex-*` or `peer-*`) with
86
+ the supported explicit versioned Embassy-advertisement marker. The listener remains
87
87
  gateway-owned and does not claim to be a Claude model session; the marker, not
88
88
  the name prefix alone, distinguishes Embassy's advertisement. The record uses
89
89
  the validated native peer shape so Claude's own `ListAgents` and
@@ -91,16 +91,15 @@ the validated native peer shape so Claude's own `ListAgents` and
91
91
 
92
92
  Consequences:
93
93
 
94
- - Native Claude `ListAgents` discovers real Claude sessions plus the one
95
- explicitly marked `codex-*` gateway peer.
94
+ - Native Claude `ListAgents` discovers real Claude sessions plus the
95
+ explicitly marked local `codex-*` and `peer-*` gateway peers, one per advertisement helper.
96
+ Federated mirrors are excluded from local helper advertisement.
96
97
  - The gateway discovers compatible real Claude sessions as transient
97
98
  candidates, but publishes only sanitized aliases and state. A send from a
98
99
  registered Codex task addresses a session by its current name or its UUID,
99
100
  and the broker installs that session's logical route on this first use.
100
101
  Per-message consent stays native: delivery lands in the
101
102
  Claude session's own `crossSessionInbound` policy and approval flow.
102
- - Codex aliases are discovered through the gateway CLI/skill, not through
103
- `ListAgents`.
104
103
  - A gateway-owned anonymous callback UDS can receive a correlated reply. It
105
104
  does not need, and must not create, a Claude registry record.
106
105
 
@@ -158,7 +157,7 @@ a separately authorized operator action (see [Validation boundary](#validation-b
158
157
  | Delivery receipt/status lifecycle | **Implemented**, deterministic synthetic tests cover stable-UUID native receipt re-resolution, the merged/verbose/quiet Claude notice policy, one bounded stall notice with pending age where enabled, opaque private-v5 correlation handles, restart continuity, the closed status/terminal schema, and one-shot/bounded-wait CLI behavior |
159
158
  | Broker-owned cross-provider provenance framing | **Implemented**, deterministic tests cover exact Codex and Claude wire shapes, bounded long-alias attribution, recipient reply hints, reserved-tag neutralization, single wrapping across clean retries, and pre-write failure |
160
159
  | Operator/agent client CLI and package binary | **Implemented**, deterministic private-UDS tests cover the closed command family, inherited provider identity, bounded stdin-only bodies, normalized output, and ambiguous no-retry behavior |
161
- | Repo-shipped cross-provider skill | **Implemented** as a repo-scoped workflow over the client CLI; it is not installed into either provider's global configuration |
160
+ | Repo-shipped cross-provider skill | **Implemented** as a packaged workflow over the client CLI; the operator copies it into each agent's skill directory, with no automatic installation |
162
161
  | Foreground local broker launcher and provider assembly | **Implemented** as `embassy serve`; local-host-only with native messaging enabled |
163
162
 
164
163
  Synthetic tests do not scan `~/.claude`, connect `/tmp/cc-socks`, attach to a
@@ -259,8 +258,8 @@ pane also carries the bounded ledger's retained message bodies, so its output
259
258
  is as sensitive as the messages themselves.
260
259
  The thin skill/CLI exposes the same safe alias list to either provider.
261
260
 
262
- That pane has two forms of the same snapshot. Piped, or with `--json`, it is
263
- the snapshot verbatim — the form every script and the skill read. On a
261
+ That pane has two forms of the same snapshot. Piped, or with `--json`, it emits
262
+ `{ok,command,result}` with the snapshot under `result` (routes at `.result.routes`). On a
264
263
  terminal it is rendered by `status-view.ts`, a pure function of the snapshot
265
264
  and the reader's clock: it derives one of four plain words per connector
266
265
  (`ok`, `stale`, `degraded`, `offline`) and pairs every word that is not `ok`
@@ -335,8 +334,8 @@ gateway publishes a process-owned native registry entry per task, accepts
335
334
  Claude's native `SendMessage`, starts an App Server turn, and returns the
336
335
  final reply.
337
336
 
338
- 1. The gateway advertises one process-owned `codex-*` record per registered
339
- task in Claude's native registry. The broker owns the advertisement,
337
+ 1. The gateway advertises each local registered task through a marked `codex-*`
338
+ record; shell routes similarly use `peer-*` records. The broker owns the advertisement,
340
339
  callback socket, state, queue, and dispatch; provider process lifecycle is
341
340
  not persisted as route authority.
342
341
  2. A real Claude session uses native `ListAgents` and `SendMessage`; the
@@ -573,13 +572,20 @@ controller-owned mode-0700 state directory. The socket and state files are
573
572
  mode 0600. Frames are size-bounded and closed against unknown keys, methods,
574
573
  versions, and enum values.
575
574
 
576
- The closed version 3 method family is exactly these fourteen methods:
575
+ The closed version 4 method family is exactly these fifteen methods:
577
576
 
578
577
  - `health` and `list_snapshot`, a safe public snapshot;
579
578
  - `observe_snapshot`, a read-only projection that may settle already-due
580
579
  delivery deadlines before projecting;
581
580
  - `register_codex` and `unregister_codex` — explicit Codex registration with
582
581
  atomic `--succeeds` replacement, and owner unregister;
582
+ - `retire_route` (CLI `embassy retire --alias <local-alias@local-host>`), the
583
+ explicit OS-boundary exception to owner unregister: any
584
+ same-UID control client may atomically remove any local Claude, Codex, or
585
+ shell-peer route and requires no route credential; the request accepts only the
586
+ local alias (no token, force, or remote option), refuses a federated mirror
587
+ with `FEDERATED_ROUTE_READ_ONLY`, and returns settlement counts
588
+ `{cancelled,ambiguous,unconfirmed}`;
583
589
  - `delivery_status`, a lookup by an opaque correlation handle retained only in
584
590
  bounded private v5 state;
585
591
  - `send`, whose direction follows the inherited principal — who is sending —
@@ -600,17 +606,17 @@ The closed version 3 method family is exactly these fourteen methods:
600
606
  rate rows, and journal entries), excluded from the federation catalog, and
601
607
  retired by the broker's own clock, so it cannot survive a restart or be
602
608
  restored on another node. Removal — by `unregister_peer` or by that clock —
603
- takes the same rows out of the live state in the same write, so nothing of
604
- it is written afterwards either; a retirement that fails is retried twice,
609
+ takes the same attributable rows and bodies out of live state in the same write;
610
+ aggregate counters still advance and are not erased. A retirement that fails is retried twice,
605
611
  five seconds apart, then left to the next restart. The clock is guarded by
606
612
  the registration's identity, so a durable route that later takes the same
607
613
  alias is never retired by it. `embassy check` uses one.
608
614
 
609
615
  The installed binary is `embassy`, and it is the only installed binary. Its
610
- seventeen implemented commands are
616
+ eighteen implemented commands are
611
617
  `serve`, `service`, `health`, `status`, `watch`, `check`, `delivery-status`,
612
618
  `wait-delivery`, `refresh`, `register-codex`, `unregister-codex`, `send`,
613
- `reply`, `register-peer`, `unregister-peer`, `await`, and
619
+ `reply`, `retire`, `register-peer`, `unregister-peer`, `await`, and
614
620
  `peer-stdio`. `reply --conversation <token> --alias <own-alias>` is a
615
621
  deprecated alias for `send --conversation <token> --from <own-alias>`: it
616
622
  builds the same `send` request and is kept only until the reply hints already
@@ -618,9 +624,9 @@ delivered in older envelopes have aged out. Message bodies are non-empty
618
624
  UTF-8 from standard input only, with a 16 KiB ceiling; they are never accepted
619
625
  in an argument or file. The client emits one bounded normalized JSON line, and
620
626
  for every broker-protocol command it never returns a thread ID,
621
- provider-native ID, path, or address, and only `status` and `watch` return
622
- message bodies the snapshot's own. There are three deliberate
623
- exceptions, each of them about something the operator alone is looking at.
627
+ provider-native ID, path, or address. `status` and `watch` return retained snapshot
628
+ bodies; `await` returns one framed mailbox message and acknowledges only after
629
+ stdout flushes. Other deliberate output exceptions follow.
624
630
  `service` reports its own plist path, its log path, and any program path in
625
631
  the plist that is no longer on disk, because managing local files is what it
626
632
  does. `status` on a terminal, `watch`, and `check` render for a person instead
@@ -813,7 +819,7 @@ mismatch is refused rather than adapted to:
813
819
  | Surface | Version | On mismatch |
814
820
  | --- | --- | --- |
815
821
  | Private state schema (`gateway-state.json`) | 5 | An older or unknown schema refuses with `GATEWAY_STATE_SCHEMA_UNSUPPORTED`; reset only, never rewritten |
816
- | Private control protocol (CLI ↔ broker) | 3 | `CONTROL_VERSION_MISMATCH` at the client; keep the CLI and broker on one installation. A method the broker does not implement is `UNKNOWN_METHOD`, and the CLI says to rebuild or update the client |
822
+ | Private control protocol (CLI ↔ broker) | 4 | `CONTROL_VERSION_MISMATCH` at the client; keep the CLI and broker on one installation. A method the broker does not implement is `UNKNOWN_METHOD`, and the CLI says to rebuild or update the client |
817
823
  | Federation peer protocol (`peer-stdio`) | 2 | `PEER_PROTOCOL_MISMATCH` on that node's mirrored routes and in `embassy status` |
818
824
  | Native Claude helper IPC protocol | 2 | Internal to one installation; the helper and broker ship together |
819
825
  | Public snapshot schema (`embassy status --json`) | 2 | Unchanged across the 3.0 line |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-embassy",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "A local gateway for bidirectional messaging between Claude Code sessions and Codex tasks.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -5,9 +5,9 @@ description: Operate Embassy through current name@host or Claude session-UUID se
5
5
 
6
6
  # Embassy Peer Gateway
7
7
 
8
- Use only the installed `embassy` CLI. Treat it as the sole facade over the private, local Embassy control socket. Keep this skill repo-scoped; do not install, copy, or modify provider configuration.
8
+ Use only the installed `embassy` CLI. Treat it as the sole facade over the private, local Embassy control socket. This skill is repo-shipped and packaged for the operator to copy into each agent's skill directory; Embassy does not install it automatically. The agent must not install or copy skills, or modify provider configuration.
9
9
 
10
- Every `@your-host` below is a placeholder: substitute this machine's own host — the `hostId` on the broker's ready line. `register-codex`, `unregister-codex`, `register-peer`, `unregister-peer` and `await` refuse an alias naming another host and state the one this machine uses; `send` and `reply` accept a federated peer's host, so check those aliases yourself.
10
+ Every `@your-host` below is a placeholder: substitute this machine's own host — the `hostId` on the broker's ready line. `register-codex`, `unregister-codex`, `register-peer`, `unregister-peer`, `await` and `retire` refuse an alias naming another host and state the one this machine uses; `send` and `reply` accept a federated peer's host, so check those aliases yourself.
11
11
 
12
12
  Registration, send, reply, await, receipt, and unregister operations require the exact principal accepted by that command: inherited Codex identity, inherited Claude identity, or a shell-peer alias plus token. Stop on a missing or conflicting required principal; never choose one on the caller's behalf. There is no separate grant to create or revoke: the permission to message is the OS boundary — reaching the same-UID private control socket on this host, or on a host configured in `nodes.json` — plus the exact alias, and every routed body carries the broker's envelope naming its verified sender. Send only the message the user asked for, to the route the user named.
13
13
 
@@ -17,7 +17,7 @@ If `CALLER_IDENTITY_CONFLICT` reports both inherited identities, strip only the
17
17
 
18
18
  Address a Claude session by its latest `name@host` or by a user-supplied native session UUID. The UUID is the stable identity; the name is only the current live index. The gateway stores no historical names, so an old name stops resolving immediately after a rename. An optional private `nodes.json` names the local host for federation; absent, the local host is named by its own hostname and there are no peers. Where present, configured allowlisted Embassy nodes exchange bounded public route catalogs and destination-owned handoffs over fixed attach-only SSH. Ask the user to choose a selector when it is ambiguous.
19
19
 
20
- Run `embassy status --json` to read the current snapshot. Always pass `--json`: without it, and with a terminal on stdout, `status` renders a human summary instead of the snapshot you parse. `status` is read-only and never rescans. Run `embassy refresh` when passive live discovery is authorized. Claude Code's native `ListAgents` includes genuine Claude sessions plus each explicitly advertised `codex-*` Embassy peer.
20
+ Run `embassy status --json` to read the current snapshot. Always pass `--json`: without it, and with a terminal on stdout, `status` renders a human summary instead of the snapshot you parse. `status` is read-only and never rescans. Run `embassy refresh` when passive live discovery is authorized. Claude Code's native `ListAgents` includes genuine Claude sessions plus each explicitly advertised `codex-*` or `peer-*` Embassy peer.
21
21
 
22
22
  Read the status snapshot's `availablePeers` as sanitized current-name candidates. Native records carrying Embassy's supported explicit versioned advertisement marker are excluded because they are not Claude destinations; a genuine unmarked Claude session remains visible even when its name starts with `codex-*`. Send straight to the name shown there: the gateway installs a discovered Claude session's route on its first use, so there is no step between reading a name and messaging it. A name currently shared by two live sessions is refused with `PEER_ALIAS_COLLISION`; report it and ask the user which session to rename, never retry against a guess.
23
23
 
@@ -46,7 +46,7 @@ List the public snapshot:
46
46
  embassy status --json
47
47
  ```
48
48
 
49
- The result is the same normalized line it has always been: `schemaVersion`, `generatedAt`, `health`, `connectors`, `availablePeers`, `routes`, `activityEvents`, `messages` (with retained bodies), `accounting`, `alerts`, and `truncation`. Never parse the human rendering; it is for the operator's terminal and its layout is not a contract.
49
+ The successful JSON line is `{ok,command,result}`. The snapshot is under `result`: `schemaVersion`, `generatedAt`, `health`, `connectors`, `availablePeers`, `routes`, `activityEvents`, `messages` (with retained bodies), `accounting`, `alerts`, and `truncation`; read routes as `.result.routes`. Never parse the human rendering; it is for the operator's terminal and its layout is not a contract.
50
50
 
51
51
  Rescan for Claude sessions:
52
52
 
@@ -142,6 +142,8 @@ removes incident conversation, reply, or native capabilities,
142
142
  cancels queued/reserved work, settles armed work `ambiguous`, and settles
143
143
  accepted work `unconfirmed`.
144
144
 
145
+ Only when the user explicitly asks to retire a route, use the explicit OS-boundary exception `embassy retire --alias codex-reviewer@your-host`: it requires no route credential and atomically removes any local Claude, Codex, or shell-peer route, accepts no token, force, or remote option, refuses a federated mirror with `FEDERATED_ROUTE_READ_ONLY`, and prints settlement counts `{cancelled,ambiguous,unconfirmed}`; unregister still requires the exact principal stated above.
146
+
145
147
  ## Send a message
146
148
 
147
149
  Pass a non-empty UTF-8 body through standard input. Never place message text in a gateway argument or a temporary file.
@@ -228,7 +230,7 @@ Do not synthesize `STEER:`, use it from Codex to Claude, approve permissions, wi
228
230
  - Keep the gateway local, single-user, and non-hosted.
229
231
  - Keep the shipped launcher local-host-only.
230
232
  - Never read provider credentials, authentication state, history, settings, registries, raw sockets, or Keychain entries.
231
- - Publish only each registered `codex-*` peer record owned by the gateway and remove it on shutdown.
233
+ - Publish only the gateway-owned marked record for each local non-Claude route (`codex-*` or `peer-*`); it is released when the route is released, and shutdown joins pending helper creations before completing cleanup.
232
234
  - Never print or copy discovered provider-native identifiers, callback addresses, raw message bodies, tool data, or stderr into skill output or an agent-created file. A user-supplied Claude session UUID may be passed unchanged as an explicit selector, but do not echo it in the normalized result. The gateway may retain the UUID in its closed, mode-0600 private route-binding state.
233
235
  - Never modify Claude or Codex permissions, hooks, plugins, agents, MCP configuration, or settings.
234
236
  - Return only the CLI's concise public outcome: selectors, normalized state, a public conversation token, or an opaque delivery correlation handle when present.
@@ -1,2 +0,0 @@
1
- export { ClaudeNativeHelperClient, createClaudeNativeHelper } from "./claude-helper-supervisor.js";
2
- export type { ClaudeNativeHelperClientCallbacks, ClaudeNativeHelperClientLike, ClaudeNativeHelperClientStartOptions, ClaudeNativeHelperFactory } from "./claude-helper-supervisor.js";
@@ -1,2 +0,0 @@
1
- export { ClaudeNativeHelperClient, createClaudeNativeHelper } from "./claude-helper-supervisor.js";
2
- //# sourceMappingURL=claude-helper-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude-helper-client.js","sourceRoot":"","sources":["../../../src/gateway/claude-helper-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC"}