agent-embassy 1.2.0 → 1.4.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 +41 -0
- package/CONTRIBUTING.md +50 -16
- package/README.md +57 -25
- package/README.zh-CN.md +45 -23
- package/SECURITY.md +68 -48
- package/dist/src/gateway/claude-helper-protocol.d.ts +1 -0
- package/dist/src/gateway/claude-helper-protocol.js +4 -2
- package/dist/src/gateway/claude-helper-protocol.js.map +1 -1
- package/dist/src/gateway/claude-helper-supervisor.d.ts +1 -0
- package/dist/src/gateway/claude-helper-supervisor.js +3 -1
- package/dist/src/gateway/claude-helper-supervisor.js.map +1 -1
- package/dist/src/gateway/claude-runtime.d.ts +0 -2
- package/dist/src/gateway/claude-runtime.js +6 -17
- package/dist/src/gateway/claude-runtime.js.map +1 -1
- package/dist/src/gateway/cli-copy.d.ts +1 -1
- package/dist/src/gateway/cli-copy.en.d.ts +4 -1
- package/dist/src/gateway/cli-copy.en.js +7 -3
- package/dist/src/gateway/cli-copy.en.js.map +1 -1
- package/dist/src/gateway/cli-copy.js +3 -0
- package/dist/src/gateway/cli-copy.js.map +1 -1
- package/dist/src/gateway/cli-copy.zh-CN.d.ts +4 -1
- package/dist/src/gateway/cli-copy.zh-CN.js +7 -3
- package/dist/src/gateway/cli-copy.zh-CN.js.map +1 -1
- package/dist/src/gateway/cli.d.ts +2 -5
- package/dist/src/gateway/cli.js +41 -67
- package/dist/src/gateway/cli.js.map +1 -1
- package/dist/src/gateway/codex-app-server.d.ts +2 -8
- package/dist/src/gateway/codex-app-server.js +36 -62
- package/dist/src/gateway/codex-app-server.js.map +1 -1
- package/dist/src/gateway/codex-local-transport.d.ts +4 -10
- package/dist/src/gateway/codex-local-transport.js +13 -16
- package/dist/src/gateway/codex-local-transport.js.map +1 -1
- package/dist/src/gateway/compatibility.d.ts +0 -27
- package/dist/src/gateway/compatibility.js +1 -101
- package/dist/src/gateway/compatibility.js.map +1 -1
- package/dist/src/gateway/config.d.ts +1 -4
- package/dist/src/gateway/config.js +0 -10
- package/dist/src/gateway/config.js.map +1 -1
- package/dist/src/gateway/control.d.ts +2 -21
- package/dist/src/gateway/control.js +7 -36
- package/dist/src/gateway/control.js.map +1 -1
- package/dist/src/gateway/dashboard-copy.d.ts +1 -1
- package/dist/src/gateway/dashboard-copy.en.d.ts +21 -8
- package/dist/src/gateway/dashboard-copy.en.js +40 -27
- package/dist/src/gateway/dashboard-copy.en.js.map +1 -1
- package/dist/src/gateway/dashboard-copy.js +21 -8
- package/dist/src/gateway/dashboard-copy.js.map +1 -1
- package/dist/src/gateway/dashboard-copy.zh-CN.d.ts +21 -8
- package/dist/src/gateway/dashboard-copy.zh-CN.js +40 -27
- package/dist/src/gateway/dashboard-copy.zh-CN.js.map +1 -1
- package/dist/src/gateway/dashboard-model.d.ts +4 -9
- package/dist/src/gateway/dashboard-model.js +159 -46
- package/dist/src/gateway/dashboard-model.js.map +1 -1
- package/dist/src/gateway/dashboard.js +27 -16
- package/dist/src/gateway/dashboard.js.map +1 -1
- package/dist/src/gateway/instance-lease.d.ts +2 -3
- package/dist/src/gateway/instance-lease.js +17 -140
- package/dist/src/gateway/instance-lease.js.map +1 -1
- package/dist/src/gateway/live-dashboard-app/app.js +62 -63
- package/dist/src/gateway/live-dashboard-command.d.ts +5 -1
- package/dist/src/gateway/live-dashboard-command.js +8 -6
- package/dist/src/gateway/live-dashboard-command.js.map +1 -1
- package/dist/src/gateway/live-dashboard-http.d.ts +0 -4
- package/dist/src/gateway/live-dashboard-http.js +20 -94
- package/dist/src/gateway/live-dashboard-http.js.map +1 -1
- package/dist/src/gateway/live-dashboard-protocol.d.ts +1 -5
- package/dist/src/gateway/live-dashboard-protocol.js +0 -42
- package/dist/src/gateway/live-dashboard-protocol.js.map +1 -1
- package/dist/src/gateway/live-dashboard-server.d.ts +2 -2
- package/dist/src/gateway/live-dashboard-server.js +18 -4
- package/dist/src/gateway/live-dashboard-server.js.map +1 -1
- package/dist/src/gateway/live-dashboard.d.ts +3 -6
- package/dist/src/gateway/live-dashboard.js +6 -42
- package/dist/src/gateway/live-dashboard.js.map +1 -1
- package/dist/src/gateway/progress-watch-machine.d.ts +6 -5
- package/dist/src/gateway/progress-watch-machine.js +6 -6
- package/dist/src/gateway/progress-watch-machine.js.map +1 -1
- package/dist/src/gateway/provenance-envelope.d.ts +1 -0
- package/dist/src/gateway/provenance-envelope.js +11 -4
- package/dist/src/gateway/provenance-envelope.js.map +1 -1
- package/dist/src/gateway/providers.d.ts +2 -21
- package/dist/src/gateway/providers.js +21 -261
- package/dist/src/gateway/providers.js.map +1 -1
- package/dist/src/gateway/server.js +0 -3
- package/dist/src/gateway/server.js.map +1 -1
- package/dist/src/gateway/service.d.ts +5 -15
- package/dist/src/gateway/service.js +101 -265
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/gateway/store.d.ts +9 -21
- package/dist/src/gateway/store.js +360 -140
- package/dist/src/gateway/store.js.map +1 -1
- package/dist/src/gateway/types.d.ts +1 -6
- package/dist/src/gateway/types.js.map +1 -1
- package/docs/CONFIGURATION.md +102 -0
- package/docs/CONFIGURATION.zh-CN.md +72 -0
- package/docs/DASHBOARD.md +103 -0
- package/docs/DASHBOARD.zh-CN.md +47 -0
- package/docs/DELIVERY.md +84 -0
- package/docs/DELIVERY.zh-CN.md +53 -0
- package/docs/GATEWAY-ARCHITECTURE.md +249 -153
- package/package.json +8 -4
- package/skills/embassy-peer/SKILL.md +25 -10
- package/dist/src/gateway/claude-compatibility-scratch.d.ts +0 -18
- package/dist/src/gateway/claude-compatibility-scratch.js +0 -158
- package/dist/src/gateway/claude-compatibility-scratch.js.map +0 -1
- package/dist/src/gateway/live-dashboard-bootstrap.d.ts +0 -36
- package/dist/src/gateway/live-dashboard-bootstrap.js +0 -176
- package/dist/src/gateway/live-dashboard-bootstrap.js.map +0 -1
- package/docs/DESIGN.md +0 -134
|
@@ -133,7 +133,6 @@ export type QueuedMessageMetadata = {
|
|
|
133
133
|
bytes: number;
|
|
134
134
|
/** Bounded same-user durable payload; absent only on pre-v1.2 rows. */
|
|
135
135
|
body?: string;
|
|
136
|
-
hopCount: number;
|
|
137
136
|
/** This message was admitted by the exact durable consent edge. */
|
|
138
137
|
pair?: true;
|
|
139
138
|
/** Target authority was transient and must never be reconstructed after restart. */
|
|
@@ -176,7 +175,6 @@ export type NormalizedMessageEvent = {
|
|
|
176
175
|
bytes: number;
|
|
177
176
|
/** Retained payload; oldest values are evicted without removing metadata. */
|
|
178
177
|
body?: string;
|
|
179
|
-
hopCount: number;
|
|
180
178
|
steer?: true;
|
|
181
179
|
latencyMs?: number;
|
|
182
180
|
safeErrorCode?: string;
|
|
@@ -356,7 +354,6 @@ export type PublicProgressWatchSnapshot = {
|
|
|
356
354
|
nextActionAt: string;
|
|
357
355
|
idleMs: number;
|
|
358
356
|
nudgeCount: 0 | 1 | 2;
|
|
359
|
-
workerReportedComplete: boolean;
|
|
360
357
|
};
|
|
361
358
|
export type PublicProgressWatchEventSnapshot = {
|
|
362
359
|
sequence: number;
|
|
@@ -364,7 +361,7 @@ export type PublicProgressWatchEventSnapshot = {
|
|
|
364
361
|
conversationIdSuffix: string;
|
|
365
362
|
ownerAlias: string;
|
|
366
363
|
workerAlias: string;
|
|
367
|
-
kind: "opened" | "nudge" | "worker_reported_complete" | "capability_degraded" | "done" | "unresponsive" | "endpoint_retired" | "disabled";
|
|
364
|
+
kind: "opened" | "replaced" | "nudge" | "worker_reported_complete" | "capability_degraded" | "conversation_rebound" | "done" | "unresponsive" | "pair_removed" | "endpoint_retired" | "disabled";
|
|
368
365
|
nudgeNumber?: 1 | 2;
|
|
369
366
|
};
|
|
370
367
|
export type GatewayPublicSnapshot = {
|
|
@@ -491,7 +488,6 @@ export type EnqueueMessageInput = {
|
|
|
491
488
|
/** Last eight opaque characters of the controller-owned conversation ID. */
|
|
492
489
|
conversationIdSuffix?: string;
|
|
493
490
|
deadlineAt?: string;
|
|
494
|
-
hopCount?: number;
|
|
495
491
|
steer?: true;
|
|
496
492
|
/**
|
|
497
493
|
* Controller-derived watch intent committed in the same mutation as the
|
|
@@ -587,7 +583,6 @@ export type GatewayStoreLimits = {
|
|
|
587
583
|
/** Bounded historical event-body bytes; omitted configs use 1 MiB. */
|
|
588
584
|
maxRetainedBodyBytes?: number;
|
|
589
585
|
messageDeadlineMs: number;
|
|
590
|
-
maxHopCount: number;
|
|
591
586
|
rateLimitPerRoute: number;
|
|
592
587
|
rateWindowMs: number;
|
|
593
588
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/gateway/types.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC;AAI7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAU,CAAC;AAI/D,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS;IACT,YAAY;IACZ,SAAS;IACT,UAAU;IACV,cAAc;CACN,CAAC;AAIX,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,SAAS;IACT,YAAY;IACZ,cAAc;IACd,SAAS;CACD,CAAC;AAIX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO;IACP,MAAM;IACN,MAAM;IACN,mBAAmB;IACnB,SAAS;IACT,cAAc;IACd,UAAU;CACF,CAAC;AAIX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,iBAAiB;IACjB,oBAAoB;CACZ,CAAC;AAKX,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,iBAAiB;IACjB,iBAAiB;CACT,CAAC;AAIX,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,QAAQ;IACR,WAAW;IACX,aAAa;IACb,mBAAmB;IACnB,MAAM;IACN,WAAW;IACX,aAAa;IACb,QAAQ;IACR,WAAW;IACX,SAAS;IACT,WAAW;IACX,WAAW;I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CAAC,IAAI,EAAE,CACnC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,MAAM,kBAAkB,GAAG,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC;IAC3D,IACE,cAAc,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE;QAC7C,SAAS,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;QACrD,SAAS,CAAC,UAAU,CAAC,UAAU;YAC7B,kBAAkB,GAAG,UAAU,CAAC,MAAM,GAAG,QAAQ,CAAC;IACtD,CAAC,CAAC,EACF,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,IAAI,UAAU,CAAC,2CAA2C,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Configuration and compatibility
|
|
2
|
+
|
|
3
|
+
Embassy is configured through environment variables read when each command
|
|
4
|
+
starts. This document collects every variable, the compatibility contract with
|
|
5
|
+
Claude Code and the Codex App Server, managed-binary resolution rules, and
|
|
6
|
+
the addressing model. There is no configuration file; all values are env vars
|
|
7
|
+
or CLI flags.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Common configuration
|
|
12
|
+
|
|
13
|
+
| Variable | Default | Purpose |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| `EMBASSY_STATE_DIR` | `$XDG_STATE_HOME/agent-embassy`, or `$HOME/.local/state/agent-embassy` when `XDG_STATE_HOME` is unset | Private state, control socket, and dashboard; an override must be absolute and does not relocate the fixed host-wide lease |
|
|
16
|
+
| `EMBASSY_CLAUDE_BIN` | `$HOME/.local/bin/claude`, resolved to the pinned version target | Absolute Claude Code launcher path; `PATH` is not searched |
|
|
17
|
+
| `EMBASSY_STEERING_ENABLED` | `1` | Global Claude-to-Codex `STEER:` kill switch; set exactly `0` to treat every Claude-to-Codex body as an ordinary Codex-bound queued message; Claude-bound mailbox timing is unchanged |
|
|
18
|
+
| `EMBASSY_DELIVERY_NOTICES` | `merged` | Claude sender notice policy: `merged` keeps stalls and folds terminal diagnostics into native status; `verbose` emits both; `quiet` emits no gateway user-frame notices |
|
|
19
|
+
| `EMBASSY_TRACKING_ENABLED` | `1` | Global progress-watch kill switch; set exactly `0` to reject `--track`, `--idle-minutes`, `untrack`, and the `TRACK:`/`DONE:` body prefixes. Any value other than `1` or `0` is a configuration error |
|
|
20
|
+
| `EMBASSY_LOCALE` | `en` | CLI output language, exactly `en` or `zh-CN`. The `--lang` flag overrides it for the invocation that carries it; an unset or empty value means `en`, and any other value is an argument error |
|
|
21
|
+
| `EMBASSY_HOSTS` | `this-mac` | Comma-separated list of 1 through 32 unique lowercase host aliases. **The v1 launcher accepts only the single exact value `this-mac`**: any other list — including a longer one that contains `this-mac` — fails `embassy serve` closed with `GATEWAY_REMOTE_PROVIDER_DISABLED`. The variable exists for the deferred remote-consulate work and has no useful setting today |
|
|
22
|
+
|
|
23
|
+
The live dashboard is available directly at `http://127.0.0.1:41961/` while
|
|
24
|
+
its foreground companion runs. Its port is a per-invocation CLI choice, not an
|
|
25
|
+
environment setting: pass `--port <n>` with an integer from 1024 through 65535
|
|
26
|
+
to `embassy dashboard --live` when another stable port is needed. Up to four
|
|
27
|
+
concurrent live views — across windows, tabs, or browsers — can use that URL
|
|
28
|
+
while the foreground process runs; a fifth stream is refused until one closes.
|
|
29
|
+
A port collision fails with
|
|
30
|
+
`LIVE_DASHBOARD_PORT_IN_USE`, points to `--port`, and never falls back to an
|
|
31
|
+
ephemeral or alternate port.
|
|
32
|
+
|
|
33
|
+
## Advanced bounds
|
|
34
|
+
|
|
35
|
+
These variables retain conservative defaults:
|
|
36
|
+
|
|
37
|
+
| Variable | Default |
|
|
38
|
+
| --- | ---: |
|
|
39
|
+
| `EMBASSY_MAX_ROUTES` | `128` |
|
|
40
|
+
| `EMBASSY_MAX_PAIRS` | `128` |
|
|
41
|
+
| `EMBASSY_MAX_WATCHES` | `32` |
|
|
42
|
+
| `EMBASSY_EVENT_CAPACITY` / `EMBASSY_EVENT_TTL_MS` | `500` / `86400000` |
|
|
43
|
+
| `EMBASSY_DEDUPE_CAPACITY` / `EMBASSY_DEDUPE_TTL_MS` | `2000` / `300000` |
|
|
44
|
+
| `EMBASSY_MAX_QUEUE_MESSAGES` / `EMBASSY_MAX_QUEUE_PER_ROUTE` | `100` / `20` |
|
|
45
|
+
| `EMBASSY_MAX_IN_FLIGHT` | `16` |
|
|
46
|
+
| `EMBASSY_MAX_QUEUE_BYTES` / `EMBASSY_MAX_MESSAGE_BYTES` | `1048576` / `16384` |
|
|
47
|
+
| `EMBASSY_MESSAGE_DEADLINE_MS` | `14400000` |
|
|
48
|
+
| `EMBASSY_RATE_LIMIT` / `EMBASSY_RATE_WINDOW_MS` | `30` / `60000` |
|
|
49
|
+
|
|
50
|
+
`EMBASSY_MAX_PAIRS` is the bound behind the README's "128 pairs by default"; its
|
|
51
|
+
range is 1 through 256. `EMBASSY_MAX_WATCHES` bounds concurrent progress watches
|
|
52
|
+
and is capped at 256. `EMBASSY_MAX_ROUTES` accepts 2 through 256. Every value in
|
|
53
|
+
this table is validated at startup, and an out-of-range or non-integer setting
|
|
54
|
+
fails closed with `INVALID_GATEWAY_CONFIGURATION` rather than being clamped.
|
|
55
|
+
|
|
56
|
+
The stall notice is not separately configurable. It fires at
|
|
57
|
+
`min(floor(EMBASSY_MESSAGE_DEADLINE_MS / 2), 120000)` milliseconds, so under the
|
|
58
|
+
default four-hour deadline a pending delivery is reported at two minutes, not
|
|
59
|
+
two hours.
|
|
60
|
+
|
|
61
|
+
A CLI initiator receives the full `conv_` token in its result, and every routed recipient receives the same token in the inbound provenance envelope and reply hint. The token is a memory-only participant-scoped locator, not an authority credential: every `reply` rechecks caller identity, conversation membership, and the live route. The token no longer exists after a broker restart; it must likewise never be retried or reconstructed after route retirement or identity succession.
|
|
62
|
+
|
|
63
|
+
The public launcher accepts only host `this-mac`; remote connectors remain a future capability. `register-codex` therefore takes an optional `--host <id>`, but `this-mac` is the only value the broker will admit, and the alias must end in `@<id>` to match. `--host` is also mutually exclusive with `--succeeds`, which always inherits the succeeded alias's host.
|
|
64
|
+
|
|
65
|
+
## Claude Code's own setting: `crossSessionInbound`
|
|
66
|
+
|
|
67
|
+
`crossSessionInbound` is Claude Code's native setting for cross-session
|
|
68
|
+
messaging: it decides whether a Claude session accepts, holds, or refuses
|
|
69
|
+
messages arriving from another session. Embassy needs it enabled on the
|
|
70
|
+
session you select as a Codex-to-Claude destination, and it cannot override
|
|
71
|
+
that decision. Configure it in Claude Code, not in Embassy.
|
|
72
|
+
|
|
73
|
+
This is the one prerequisite you must actively toggle, and it is the most
|
|
74
|
+
common first-run failure — because it fails *late*. Quickstart step 3
|
|
75
|
+
(`select-claude`) prints `"accepted":true` whether or not the setting is
|
|
76
|
+
enabled: selection only creates Embassy's own permission edge and never
|
|
77
|
+
consults Claude's native inbound policy. The refusal appears at step 4, when
|
|
78
|
+
the send reaches the Claude end. If registration and selection both succeeded
|
|
79
|
+
but your first `send-to-claude` does not arrive, check `crossSessionInbound` on
|
|
80
|
+
the destination session before suspecting the route.
|
|
81
|
+
|
|
82
|
+
## Compatibility contract
|
|
83
|
+
|
|
84
|
+
Embassy speaks two provider surfaces that are not documented as stable third-party APIs. Compatibility is automatic and exact-pinned, not an operator workflow. This release accepts only:
|
|
85
|
+
|
|
86
|
+
- the Claude Code 2.1.226 launcher/runtime and peer protocol 1;
|
|
87
|
+
- already-running Claude peer sessions whose explicit reviewed version is 2.1.224, 2.1.225, or 2.1.226 and whose peer protocol is 1; and
|
|
88
|
+
- Codex App Server 0.147.0.
|
|
89
|
+
|
|
90
|
+
An unknown provider version or peer protocol, a required-schema failure, or an endpoint generation that fails fresh validation closes the affected surface. The broker owns bounded read-only compatibility validation as part of provider startup: it checks the configured launcher or managed installation, exact version, registry/control-socket shape, initialization and listing schemas, and protocol constants. These checks do not route a user message or start a model turn. Runtime parsing remains strict on every record, frame, and response.
|
|
91
|
+
|
|
92
|
+
Every replacement Codex App Server endpoint generation starts monitor-only. Embassy performs a fresh initialize and `thread/loaded/list` check on that generation, then re-anchors a retained route only when its exact private task identity is found once. Writes remain fenced until the controller activates that exact generation. A version or schema mismatch, missing task, duplicate task, or unclean transition leaves the route stale and write-disabled rather than retargeting it.
|
|
93
|
+
|
|
94
|
+
The managed Codex installation is resolved by exact path and version; a `codex` elsewhere on `PATH` is neither used nor modified. Claude is resolved from `EMBASSY_CLAUDE_BIN` or the official per-user launcher, never by searching `PATH`. Provider updates require an Embassy release that explicitly reviews and pins the new version.
|
|
95
|
+
|
|
96
|
+
## Addressing
|
|
97
|
+
|
|
98
|
+
Claude sessions are addressed by their current `name@host` or by a user-supplied native session UUID. The UUID is the stable logical identity; the current name is a live lookup alias. After a rename, the old name stops resolving immediately while a selected UUID-bound route continues to work under the new name. A rename becomes visible at the session's next status transition — typically its next turn boundary — because Claude Code rewrites the session's registry record on those transitions, not at the moment of the rename; Embassy reflects the record, never the rename itself.
|
|
99
|
+
|
|
100
|
+
Names, old names, PIDs, registry paths, process generations, and socket generations never become alternate identity keys. Embassy refuses to guess when two live sessions share a current name.
|
|
101
|
+
|
|
102
|
+
Codex routes use an explicit `codex-*` alias and the task's inherited thread identity. The private thread ID is never accepted as a command-line argument or printed. Compatible managed App Server generation changes and broker restarts can both re-anchor the exact loaded task automatically; a normal restart needs no manual registration. If boot reactivation cannot find that task exactly once, the route remains stale with `REOBSERVATION_REQUIRED`. Once the task is observable, recover it by rerunning `embassy register-codex --alias <same-alias>` from that exact Codex task without unregistering first. Never supply or reconstruct its thread ID. If the task no longer exists, the live dashboard can remove the retained registration only after the broker proves it stale on a dead endpoint generation.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# 配置与兼容性
|
|
2
|
+
|
|
3
|
+
Embassy 通过各命令启动时读取的环境变量进行配置。本文档汇集了所有变量、与 Claude Code 和 Codex App Server 的兼容性约定、托管二进制文件解析规则,以及寻址模型。没有配置文件;所有值均为环境变量或 CLI 标志。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 常用配置
|
|
8
|
+
|
|
9
|
+
| 变量 | 默认值 | 用途 |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `EMBASSY_STATE_DIR` | `$XDG_STATE_HOME/agent-embassy`,当 `XDG_STATE_HOME` 未设置时为 `$HOME/.local/state/agent-embassy` | 私有状态、控制套接字和仪表盘;覆盖值必须为绝对路径,且不会迁移固定的主机级租约 |
|
|
12
|
+
| `EMBASSY_CLAUDE_BIN` | `$HOME/.local/bin/claude`,解析到固定版本目标 | Claude Code 启动器的绝对路径;不搜索 `PATH` |
|
|
13
|
+
| `EMBASSY_STEERING_ENABLED` | `1` | 全局 Claude→Codex `STEER:` 停用开关;精确设为 `0` 后,所有 Claude→Codex 正文都按朝向 Codex 的普通排队消息处理;朝向 Claude 的邮箱写入时机不受影响 |
|
|
14
|
+
| `EMBASSY_DELIVERY_NOTICES` | `merged` | Claude 发送方通知策略:`merged` 保留停滞通知并把终局诊断合并到原生状态;`verbose` 同时发送两者;`quiet` 不发送任何网关用户帧通知 |
|
|
15
|
+
| `EMBASSY_TRACKING_ENABLED` | `1` | 全局进度监视停用开关;精确设为 `0` 后,`--track`、`--idle-minutes`、`untrack` 以及 `TRACK:`/`DONE:` 正文前缀都会被拒绝。取值只能是 `1` 或 `0`,其他值均为配置错误 |
|
|
16
|
+
| `EMBASSY_LOCALE` | `en` | CLI 输出语言,精确取值 `en` 或 `zh-CN`。`--lang` 标志会覆盖当次调用;未设置或为空表示 `en`,其他任何取值都是参数错误 |
|
|
17
|
+
| `EMBASSY_HOSTS` | `this-mac` | 以逗号分隔的 1 到 32 个唯一小写主机别名。**v1 启动器只接受单个精确值 `this-mac`**:任何其他列表——包括包含 `this-mac` 的更长列表——都会让 `embassy serve` 以 `GATEWAY_REMOTE_PROVIDER_DISABLED` 关闭失败。该变量是为推迟的远程领事馆功能预留的,目前没有可用的设置 |
|
|
18
|
+
|
|
19
|
+
当前台实时仪表盘组件运行时,可直接通过 `http://127.0.0.1:41961/` 访问。端口是单次命令的 CLI 选择,而不是环境设置;如需另一个稳定端口,请向 `embassy dashboard --live` 传入 `--port <n>`,其中整数范围为 1024 到 65535。当前台进程运行时,该 URL 最多支持四个并发实时视图(可分布在窗口、标签页或浏览器中);在其中一个关闭前,第五条流会被拒绝。端口冲突会以 `LIVE_DASHBOARD_PORT_IN_USE` 失败并提示使用 `--port`;Embassy 绝不会回退到临时或其他端口。
|
|
20
|
+
|
|
21
|
+
## 高级边界
|
|
22
|
+
|
|
23
|
+
以下变量保留保守的默认值:
|
|
24
|
+
|
|
25
|
+
| 变量 | 默认值 |
|
|
26
|
+
| --- | ---: |
|
|
27
|
+
| `EMBASSY_MAX_ROUTES` | `128` |
|
|
28
|
+
| `EMBASSY_MAX_PAIRS` | `128` |
|
|
29
|
+
| `EMBASSY_MAX_WATCHES` | `32` |
|
|
30
|
+
| `EMBASSY_EVENT_CAPACITY` / `EMBASSY_EVENT_TTL_MS` | `500` / `86400000` |
|
|
31
|
+
| `EMBASSY_DEDUPE_CAPACITY` / `EMBASSY_DEDUPE_TTL_MS` | `2000` / `300000` |
|
|
32
|
+
| `EMBASSY_MAX_QUEUE_MESSAGES` / `EMBASSY_MAX_QUEUE_PER_ROUTE` | `100` / `20` |
|
|
33
|
+
| `EMBASSY_MAX_IN_FLIGHT` | `16` |
|
|
34
|
+
| `EMBASSY_MAX_QUEUE_BYTES` / `EMBASSY_MAX_MESSAGE_BYTES` | `1048576` / `16384` |
|
|
35
|
+
| `EMBASSY_MESSAGE_DEADLINE_MS` | `14400000` |
|
|
36
|
+
| `EMBASSY_RATE_LIMIT` / `EMBASSY_RATE_WINDOW_MS` | `30` / `60000` |
|
|
37
|
+
|
|
38
|
+
`EMBASSY_MAX_PAIRS` 就是 README 中"默认上限 128 个配对"背后的那个变量,取值范围为 1 到 256。`EMBASSY_MAX_WATCHES` 限制并发进度监视数量,硬上限为 256。`EMBASSY_MAX_ROUTES` 接受 2 到 256。本表中的每个值都在启动时校验;超出范围或非整数的设置会以 `INVALID_GATEWAY_CONFIGURATION` 关闭失败,而不是被截断到边界。
|
|
39
|
+
|
|
40
|
+
停滞通知本身不可单独配置。它在 `min(floor(EMBASSY_MESSAGE_DEADLINE_MS / 2), 120000)` 毫秒时触发,因此在默认的四小时截止时间下,待投递消息会在两分钟时被报告,而不是两小时。
|
|
41
|
+
|
|
42
|
+
初始发送方从 CLI 结果获得完整 `conv_` 令牌,接收方则从入站消息的来源封装和回复提示中获得同一个令牌。令牌是内存中的参与方范围定位符,不是权限凭据:每次 `reply` 都会重新检查调用方身份、参与关系和实时路由。代理重启后令牌不再存在;路由失效或身份转交后,也不得重试或重构旧令牌。
|
|
43
|
+
|
|
44
|
+
公开发布的启动器仅接受主机 `this-mac`;远程连接器仍是未来功能。因此 `register-codex` 提供可选的 `--host <id>`,但代理只会接纳 `this-mac`,而且别名必须以 `@<id>` 结尾才能匹配。`--host` 与 `--succeeds` 互斥,后者始终继承被接替别名的主机。
|
|
45
|
+
|
|
46
|
+
## Claude Code 自身的设置:`crossSessionInbound`
|
|
47
|
+
|
|
48
|
+
`crossSessionInbound` 是 Claude Code 的原生跨会话消息设置:它决定一个 Claude 会话接受、挂起还是拒绝来自其他会话的消息。Embassy 需要在你选择作为 Codex→Claude 目的地的会话上启用此设置,且无法覆盖该决定。请在 Claude Code 中配置它,而不是在 Embassy 中。
|
|
49
|
+
|
|
50
|
+
这是你唯一必须主动开启的前置条件,也是最常见的首次运行故障——因为它**失败得很晚**。快速开始的第 3 步(`select-claude`)无论该设置是否启用都会打印 `"accepted":true`:选择只创建 Embassy 自己的权限边,从不查询 Claude 的原生入站策略。拒绝要到第 4 步、消息抵达 Claude 端时才出现。如果注册与选择都成功,但你的第一条 `send-to-claude` 没有送达,请先检查目的地会话上的 `crossSessionInbound`,再去怀疑路由。
|
|
51
|
+
|
|
52
|
+
## 兼容性约定
|
|
53
|
+
|
|
54
|
+
Embassy 使用两个未被记录为稳定第三方 API 的提供方接口。兼容性检查是自动且精确固定版本的机制,不是操作员工作流。本版本只接纳:
|
|
55
|
+
|
|
56
|
+
- Claude Code 2.1.226 启动器/运行时与对等协议 1;
|
|
57
|
+
- 已经运行、明确版本为 2.1.224、2.1.225 或 2.1.226,且使用对等协议 1 的已审查 Claude 对等会话;以及
|
|
58
|
+
- Codex App Server 0.147.0。
|
|
59
|
+
|
|
60
|
+
未知的提供方版本或对等协议、必需结构验证失败,或未通过新一轮验证的端点代际,都会使受影响的表面关闭。代理在提供方启动过程中自行执行有界的只读兼容性验证:检查配置的启动器或托管安装、精确版本、注册表/控制套接字结构、初始化与列表响应结构,以及协议常量。这些检查不会路由用户消息,也不会启动模型回合。运行时仍会严格解析每条记录、帧和响应。
|
|
61
|
+
|
|
62
|
+
每个替代 Codex App Server 端点代际都从仅监控状态开始。Embassy 会在该代际上重新执行初始化和 `thread/loaded/list` 检查,只有精确的私有任务身份恰好出现一次时才重新锚定保留路由。在控制器激活这个精确代际之前,写入始终保持封锁。版本或结构不匹配、任务缺失、任务重复或转换不干净,都会让路由保持陈旧且禁止写入,而不是改投其他任务。
|
|
63
|
+
|
|
64
|
+
托管的 Codex 安装通过精确路径和版本解析;`PATH` 上其他位置的 `codex` 不会被使用或修改。Claude 从 `EMBASSY_CLAUDE_BIN` 或官方的用户级启动器解析,从不搜索 `PATH`。提供方升级后,必须等待明确审查并固定新版本的 Embassy 发布版。
|
|
65
|
+
|
|
66
|
+
## 寻址
|
|
67
|
+
|
|
68
|
+
Claude 会话通过其当前的 `name@host` 或用户提供的原生会话 UUID 寻址。UUID 是稳定的逻辑标识;当前名称是实时查找别名。重命名后,旧名称立即停止解析,而已选择的 UUID 绑定路由在新名称下继续有效。重命名会在该会话的下一次状态切换(通常是下一个轮次边界)时才对外可见——因为 Claude Code 在状态切换时整体重写会话注册表记录,而非在重命名的瞬间;Embassy 反映的是注册表记录,而非重命名操作本身。
|
|
69
|
+
|
|
70
|
+
名称、旧名称、PID、注册表路径、进程生成号和套接字生成号绝不会成为替代身份键。当两个在线会话共享同一当前名称时,Embassy 拒绝猜测。
|
|
71
|
+
|
|
72
|
+
Codex 路由使用显式的 `codex-*` 别名和任务继承的线程标识。私有线程 ID 从不被接受为命令行参数,也从不被打印。兼容的托管 App Server 端点代际变更与代理重启都能自动重新锚定精确的已加载任务;正常重启不需要手动重新注册。如果启动时重新激活无法恰好一次找到该任务,路由会以 `REOBSERVATION_REQUIRED` 保持陈旧。该任务恢复可观察后,请从精确 Codex 任务内使用同一别名再次运行 `embassy register-codex --alias <同一别名>`,且不要先注销。切勿提供或重构线程 ID。如果该任务已不存在,实时仪表盘只有在代理证明该注册陈旧且所属端点代际已失效后,才能移除该保留注册。
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Dashboards
|
|
2
|
+
|
|
3
|
+
Embassy ships two dashboard surfaces: a metadata-only static file pair and a
|
|
4
|
+
live streaming companion that may also show bounded retained message bodies.
|
|
5
|
+
This document covers both: the static snapshot model and the live companion's
|
|
6
|
+
tabs, request controls, bounded actions, and security caveat.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Static dashboard
|
|
11
|
+
|
|
12
|
+
Open `gateway-dashboard.html` inside the configured state directory. It gives a metadata-only view of connector health, available and selected Claude peers, the registered Codex route, recent delivery states, queue depth, latency, and safe alerts.
|
|
13
|
+
|
|
14
|
+
Interpret queue and delivery by direction. Codex-bound ordinary work can wait
|
|
15
|
+
for the task to become idle. Claude-bound work does not wait for Claude idle:
|
|
16
|
+
after routing and pre-write checks it enters Claude's native mailbox
|
|
17
|
+
immediately, and `transport_written` settles that direction as `delivered`.
|
|
18
|
+
The mailbox boundary does not mean Claude read or consumed the body.
|
|
19
|
+
|
|
20
|
+
Every publish writes the language pair — `gateway-dashboard.html` and `gateway-dashboard.zh-CN.html` — side by side in the state directory, and each page carries an in-page link to the other. That link is the only way to switch the static language; `--lang` is a flag of the live companion, not of `refresh-dashboard`.
|
|
21
|
+
|
|
22
|
+
A static page is a point-in-time snapshot and never refreshes itself. Run `embassy refresh-dashboard` and reload to see newer state, or run `embassy dashboard --live` for a streaming view.
|
|
23
|
+
|
|
24
|
+
The static dashboard is deliberately a file rather than a web application. Anything already running as your OS user can read it, so place `EMBASSY_STATE_DIR` outside agent workspaces if that distinction matters to you.
|
|
25
|
+
|
|
26
|
+
## Live dashboard
|
|
27
|
+
|
|
28
|
+
With `embassy serve` already running in another terminal, start the companion in a third:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
embassy dashboard --live
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`embassy dashboard --live` starts a separate foreground companion process that
|
|
35
|
+
uses a five-tab browser view (overview, deliveries, routes, activity,
|
|
36
|
+
diagnostics) to stream broker state, including bounded retained bodies in
|
|
37
|
+
delivery detail. It reaches the broker over the same private control socket
|
|
38
|
+
every other command uses, so it reports the gateway as unavailable when
|
|
39
|
+
nothing is serving. The companion is not part of `embassy serve`, which
|
|
40
|
+
remains socket-only with no TCP or HTTP listener.
|
|
41
|
+
|
|
42
|
+
The companion binds exact `127.0.0.1` on stable port `41961` by default and is
|
|
43
|
+
available directly at `http://127.0.0.1:41961/`. To choose another stable port
|
|
44
|
+
for one invocation, pass `--port <n>` with an integer from 1024 through 65535:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
embassy dashboard --live --port 41962
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The command auto-opens a browser and its ready result prints the same
|
|
51
|
+
bookmarkable dashboard URL. Up to four concurrent live views—across windows,
|
|
52
|
+
tabs, or browsers—can use that URL while the foreground process runs; a fifth
|
|
53
|
+
stream is refused until one closes. If the port is already occupied, startup fails with
|
|
54
|
+
`LIVE_DASHBOARD_PORT_IN_USE`, tells the operator to choose another with
|
|
55
|
+
`--port`, and does not select an ephemeral or alternate port.
|
|
56
|
+
|
|
57
|
+
There is no fragment capability, cookie, login, per-browser session, or
|
|
58
|
+
bootstrap file. The intended posture is one operator and software already
|
|
59
|
+
trusted under that operator's macOS UID. The HTTP listener deliberately does
|
|
60
|
+
not authenticate a process or OS user, so this remains a trusted
|
|
61
|
+
single-user-machine assumption rather than a same-UID enforcement mechanism.
|
|
62
|
+
Any local software that can reach or spoof loopback can read the live view,
|
|
63
|
+
including retained bodies, and submit its bounded actions.
|
|
64
|
+
|
|
65
|
+
The exact Host header is checked on every request. Navigation GETs may omit
|
|
66
|
+
Origin, but every POST requires the exact Origin plus
|
|
67
|
+
`X-Embassy-Request: 1`. `OPTIONS` is not accepted and no CORS headers are sent.
|
|
68
|
+
These checks constrain browser cross-origin requests; they do not authenticate
|
|
69
|
+
local software. There are no generic control or provider routes, telemetry, or
|
|
70
|
+
external assets. The only mutation route accepts exact pair, unpair,
|
|
71
|
+
refresh-discovery, and stale-Codex-registration-removal actions, requires an
|
|
72
|
+
explicit in-page confirmation, rejects bodies over 1 KiB, and is limited to
|
|
73
|
+
six actions per minute. Removal names only a public `codex-*` alias; the broker
|
|
74
|
+
accepts it only when the registration is stale and its endpoint generation is
|
|
75
|
+
dead. No task ID or endpoint generation enters the browser contract. The
|
|
76
|
+
browser client keeps only a display-preference key
|
|
77
|
+
(active tab and language) in `localStorage`.
|
|
78
|
+
The browser cannot create or live-unregister tasks, send, reply, approve,
|
|
79
|
+
interrupt, change settings, or invoke arbitrary broker/provider methods. It receives a sanitized
|
|
80
|
+
snapshot via same-origin `fetch`; after each bounded action it reads
|
|
81
|
+
a fresh snapshot. A snapshot observation may settle already-due
|
|
82
|
+
lifecycle deliveries before projecting state.
|
|
83
|
+
|
|
84
|
+
An automatically exact-version-and-generation-gated App Server endpoint
|
|
85
|
+
refresh appears in Activity as an automatic event, distinct from operator
|
|
86
|
+
actions. Diagnostics reports a safe version, schema, or generation failure
|
|
87
|
+
code when a replacement is incompatible, while a missing or duplicate exact
|
|
88
|
+
task remains stale. Compatibility remains passive status: the dashboard has no
|
|
89
|
+
compatibility action or override. The dashboard never exposes the
|
|
90
|
+
retained task ID or either endpoint generation, and endpoint recovery never
|
|
91
|
+
replays a message body.
|
|
92
|
+
|
|
93
|
+
An optional `--lang en|zh-CN` flag selects the display language. It belongs to
|
|
94
|
+
the live companion only; the static pair is always written in both languages
|
|
95
|
+
and switched by the in-page link.
|
|
96
|
+
|
|
97
|
+
**Caveat.** The loopback listener does not identify the caller's process or
|
|
98
|
+
UID. Run it only on a trusted single-user machine: local processes, other local
|
|
99
|
+
users, root, and browser extensions able to reach or spoof loopback may read
|
|
100
|
+
and act on everything the live dashboard exposes.
|
|
101
|
+
|
|
102
|
+
The static `gateway-dashboard.html` and `gateway-dashboard.zh-CN.html` files
|
|
103
|
+
remain the inert offline floor: mode 0600, no script, no network.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 仪表盘
|
|
2
|
+
|
|
3
|
+
Embassy 提供两种仪表盘界面:一对仅包含元数据的静态文件,以及一个还可以显示有界保留消息正文的实时流式组件。本文档涵盖两者:静态快照模型,以及实时组件的选项卡、请求控制、有限操作和安全注意事项。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 静态仪表盘
|
|
8
|
+
|
|
9
|
+
在配置的状态目录下打开 `gateway-dashboard.html`。它提供了一个纯元数据视图,包括连接器健康状态、可用和已选择的 Claude 对等方、已注册的 Codex 路由、近期投递状态、队列深度、延迟和安全告警。
|
|
10
|
+
|
|
11
|
+
请按方向理解队列与投递。朝向 Codex 的普通工作可以等待任务空闲;朝向 Claude 的工作不等待 Claude 空闲:通过路由与写前检查后,它会立即进入 Claude 的原生邮箱,而 `transport_written` 会把该方向结算为 `delivered`。这个邮箱边界不表示 Claude 已读取或消费正文。
|
|
12
|
+
|
|
13
|
+
每次发布都会在状态目录下并排写入语言对——`gateway-dashboard.html` 和 `gateway-dashboard.zh-CN.html`,且每个页面都包含指向另一个页面的页内链接。该链接是静态版本切换语言的唯一方式;`--lang` 是实时组件的标志,而非 `refresh-dashboard` 的标志。
|
|
14
|
+
|
|
15
|
+
静态页面是时间点快照,不会自动刷新。运行 `embassy refresh-dashboard` 并重新加载页面以查看最新状态,或运行 `embassy dashboard --live` 获取流式视图。
|
|
16
|
+
|
|
17
|
+
静态仪表盘被有意设计为文件而非 Web 应用。以你的 OS 用户身份运行的任何程序都能读取它,因此如果这种区分对你有意义,请将 `EMBASSY_STATE_DIR` 放在代理工作区之外。
|
|
18
|
+
|
|
19
|
+
## 实时仪表盘
|
|
20
|
+
|
|
21
|
+
在另一个终端中 `embassy serve` 已经运行的情况下,在第三个终端中启动组件:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
embassy dashboard --live
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`embassy dashboard --live` 启动一个独立的前台组件进程,以五个选项卡(总览、投递、路由、活动、诊断)流式呈现代理状态,并在投递详情中显示有界保留的正文。它通过与其他命令相同的私有控制套接字连接代理,因此在没有服务运行时会报告网关不可用。该组件不是 `embassy serve` 的一部分;后者仍然是纯套接字的,没有 TCP 或 HTTP 监听器。
|
|
28
|
+
|
|
29
|
+
组件默认精确绑定 `127.0.0.1` 上的稳定端口 `41961`,可直接通过 `http://127.0.0.1:41961/` 访问。如需为单次启动选择另一个稳定端口,请传入 1024 到 65535 之间的整数:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
embassy dashboard --live --port 41962
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
命令会自动打开浏览器,ready 结果也会打印同一个可收藏的仪表盘 URL。当前台进程运行时,该 URL 最多支持四个并发实时视图(可分布在窗口、标签页或浏览器中);在其中一个关闭前,第五条流会被拒绝。若端口已被占用,启动会以 `LIVE_DASHBOARD_PORT_IN_USE` 失败,并提示操作员用 `--port` 选择其他端口。Embassy 不会自动选择临时或其他端口。
|
|
36
|
+
|
|
37
|
+
这里没有 URL 片段令牌、Cookie、登录、逐浏览器会话或引导文件。预期姿态是一名操作员,以及已经受信任、以该操作员 macOS UID 运行的软件。HTTP 监听器有意不认证进程或 OS 用户,因此这是可信单用户机器的假设,而不是强制执行同 UID 的机制。任何能够访问或伪造 loopback 的本地软件都可以读取实时视图(包括保留的正文)并提交其有限操作。
|
|
38
|
+
|
|
39
|
+
每个请求都会检查精确的 Host 头。导航 GET 可以缺少 Origin,但每个 POST 都要求精确的 Origin 与 `X-Embassy-Request: 1`。服务器不接受 `OPTIONS`,也不发送 CORS 头。这些检查约束浏览器的跨来源请求,但不认证本地软件。没有通用控制或提供方路由、遥测或外部资源。唯一的变更路由只接受配对、取消配对、刷新发现结果和移除陈旧 Codex 注册四种精确操作;每次都要求页内明确确认,正文上限为 1 KiB,并限制为每分钟六次。移除操作只携带公开的 `codex-*` 别名;仅当代理确认注册已陈旧且其端点代际已失效时才会接受。任务 ID 与端点代际不会进入浏览器契约。浏览器客户端仅在 `localStorage` 中保存一个显示偏好键(当前选项卡与语言)。浏览器不能创建或注销在线任务、发送、回复、审批、中断、更改设置,也不能调用任意代理或提供方方法。它通过同源 `fetch` 接收快照,并在每次有限操作后重新读取最新快照。一次快照观测可能会在投射状态之前结算已到期的生命周期投递。
|
|
40
|
+
|
|
41
|
+
经过自动精确版本与代际门控的 App Server 端点刷新会作为自动事件出现在“活动”中,并与操作员操作明确区分。替代端点不兼容时,“诊断”会报告安全的版本、结构或代际失败代码;精确任务缺失或重复时,路由保持陈旧。兼容性在仪表盘中只作为被动状态:这里没有兼容性操作或覆盖机制。仪表盘绝不暴露保留的任务 ID 或任一端点代际,端点恢复也绝不重放消息正文。
|
|
42
|
+
|
|
43
|
+
可选的 `--lang en|zh-CN` 标志用于选择显示语言。它仅属于实时组件;静态版本始终以两种语言写入,通过页内链接切换。
|
|
44
|
+
|
|
45
|
+
**注意事项。** loopback 监听器不识别调用方的进程或 UID。请仅在可信的单用户机器上运行:能够访问或伪造 loopback 的本地进程、其他本地用户、root 和浏览器扩展都可能读取并操作实时仪表盘所暴露的一切内容。
|
|
46
|
+
|
|
47
|
+
静态的 `gateway-dashboard.html` 和 `gateway-dashboard.zh-CN.html` 文件仍然是惰性的离线底线:mode 0600,无脚本,无网络。
|
package/docs/DELIVERY.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Delivery semantics
|
|
2
|
+
|
|
3
|
+
Embassy tracks every accepted message from CLI acceptance through terminal
|
|
4
|
+
settlement. This document collects the delivery model in one place: queue
|
|
5
|
+
behavior, evidence states, failure handling, retry policy, and the delivery
|
|
6
|
+
tokens that let a sender follow a message to settlement. The material is the
|
|
7
|
+
authoritative reference for what "delivered" does and does not mean inside
|
|
8
|
+
Embassy.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
- **Timing is directional.** After routing and pre-write checks, a Claude-bound body is written immediately to Claude's native mailbox regardless of its observed busy or idle state. Claude being busy is never a reason to hold that write in Embassy's queue. A Codex-bound ordinary body instead waits for the task to become available. An exact leading `STEER:` body from Claude to Codex may be admitted to the active turn at its next tool-call boundary. Embassy never interrupts or injects text mid-generation; a cleanly unavailable boundary falls back to the normal queue. At most three steering messages remain queued per route, with the oldest settled as `cancelled/STEER_QUEUE_SUPERSEDED` when a fourth is accepted.
|
|
13
|
+
|
|
14
|
+
- **Acceptance is not completion.** Initial CLI acceptance returns a conversation token and a delivery token. For Claude-bound delivery, `transport_written` means the native mailbox write completed and is the terminal `delivered` boundary; Embassy does not wait for evidence that Claude later read or consumed the body. Toward Codex, `delivered` means the App Server accepted the turn. Neither boundary means a model read, understood, or completed the work.
|
|
15
|
+
|
|
16
|
+
- **Recipients get provenance and a reply path.** Immediately before the provider write, Embassy puts every routed body inside one broker-owned `<cross-session-message>` textual frame. Its first element is an `<embassy-reply-hint>` with the full conversation token, the recipient's exact alias, and the corresponding `embassy reply` command. A recipient may continue with that exact token, but caller identity, conversation membership, and current route policy are rechecked at reply time.
|
|
17
|
+
|
|
18
|
+
- **Evidence has three shapes.** `delivered` means the direction's terminal provider boundary was observed. A confirmed Claude mailbox write reaches that boundary immediately. `unconfirmed` means Embassy cannot prove the required terminal boundary despite partial dispatch evidence; it is not a later downgrade from a confirmed Claude mailbox write. `ambiguous` means the write outcome itself is unknown. All three are terminal, and neither `unconfirmed` nor `ambiguous` is a retry authorization — inspect the recipient instead, because a resend can duplicate the message.
|
|
19
|
+
|
|
20
|
+
- **Native failures.** A Claude-originated route or delivery failure settles as native `expired`; its native acknowledgement always retains the normalized safe code in the reason field. The default `merged` notice mode keeps the early stall frame but suppresses the duplicate terminal `<gateway-delivery-diagnostic>` user frame. `verbose` restores that readable diagnostic frame; `quiet` suppresses all gateway-authored user-frame notices, including stalls, while native status and dashboard truth remain. No notice contains a path, native identifier, exception, or message body. `denied` is reserved for a real user or policy refusal and is not authored by Embassy v1. `held` and transport-written are progress, never success.
|
|
21
|
+
- **Native held is attempt-then-ack.** For Claude→Codex ingress, Embassy first attempts the exact immediate dispatch. A terminal result observed before the one-second prompt boundary produces only its terminal acknowledgement. Native `held` is sent only when the body actually remains queued (including a busy route or clean provider deferral) or dispatch is still nonterminal at that boundary; the terminal acknowledgement follows later. Claude's rendered “approved and released” notice means only that the paired-consent gateway accepted and released the body to the recipient queue. It does not mean a model read it, and it does not imply human approval.
|
|
22
|
+
|
|
23
|
+
- **Retries are conservative.** Undispatched Codex-bound messages remain queued while the task is busy or temporarily unavailable. A Claude-bound body may remain queued only for a pre-write route failure or temporary unavailability, never merely because Claude is observed busy. Re-running `register-codex` replaces a closed or faulted App Server connector and wakes held Codex-bound work when the recovered route is idle. An explicit clean adapter deferral can return the same body to the queue. A Claude route that merely stops appearing in discovery is no longer invalidated on its own: its queued mail stays addressed to that session, and a write to a dead session socket fails fast with its exact safe code instead. A confirmed delivery failure settles; an ambiguous write is never retried automatically.
|
|
24
|
+
|
|
25
|
+
- **Bounded by design.** Bodies, queues, rate windows, deduplication tables, deadlines, and transient conversations all have fixed limits.
|
|
26
|
+
|
|
27
|
+
- **Progress watches are independent evidence.** An opt-in watch may outlive an opener that expired before delivery, so a worker can remain unaware of the original assignment even while thread activity keeps the watch healthy. Owners should check the opener's `delivery-status` separately before assuming the assignment text arrived.
|
|
28
|
+
|
|
29
|
+
- **Restarts keep queued mail.** Queued bodies persist under bounded retention and re-send exactly once when their route is re-observed. In-flight-at-crash messages settle ambiguous — never silently lost, never double-sent. Delivery tokens remain memory-only. A prior Claude binding remains stored but stale; after an authorized complete live discovery, an exact unique stored UUID reactivates automatically; explicit `select-claude` remains the optional fallback. No pending reply or conversation capability survives.
|
|
30
|
+
|
|
31
|
+
Accepted messages are tracked toward terminal delivery while the broker and provider connections remain healthy. The dashboard distinguishes acceptance, progress, delivery, expiry, failure, ambiguity, and abandonment.
|
|
32
|
+
|
|
33
|
+
## Provenance framing and recipient replies
|
|
34
|
+
|
|
35
|
+
The store, queue, classification, deduplication, rate limiting, and 16 KiB
|
|
36
|
+
acceptance limit all operate on the raw body. At the last provider
|
|
37
|
+
boundary, Embassy deterministically composes exactly one authoritative textual
|
|
38
|
+
frame:
|
|
39
|
+
|
|
40
|
+
- Toward Codex, the outer `cross-session-message` carries the exact verified
|
|
41
|
+
source alias in `from-name` and the full token in `conversation`.
|
|
42
|
+
- Toward Claude, the outer frame uses only Claude Code's canonical bounded
|
|
43
|
+
`from-name`. A source alias longer than 64 characters gets a deterministic
|
|
44
|
+
64-character display label; the first reply hint retains the exact alias in
|
|
45
|
+
`from-alias`. Claude's outer frame does not carry `conversation` because that
|
|
46
|
+
attribute is not part of its canonical parser.
|
|
47
|
+
- In both directions, the first `embassy-reply-hint` carries `conversation`,
|
|
48
|
+
`reply-as`, and the exact stdin-based reply command. `reply-as` is the
|
|
49
|
+
recipient's alias, never the sender's. The hint states that caller,
|
|
50
|
+
conversation, and route policy are rechecked.
|
|
51
|
+
|
|
52
|
+
The full `conv_` conversation token is a transient participant-scoped locator,
|
|
53
|
+
not enough authority by itself. The recipient can use the delivered full token, while the
|
|
54
|
+
broker still validates inherited caller identity, current conversation
|
|
55
|
+
membership, and current route policy. Never reconstruct a token from
|
|
56
|
+
the suffix exposed by metadata-only views.
|
|
57
|
+
|
|
58
|
+
This is Claude-compatible textual framing, not general XML, a cryptographic
|
|
59
|
+
signature, or proof that the body is safe. Embassy composes the genuine outer
|
|
60
|
+
frame and hint from validated broker metadata. In the untrusted raw body only,
|
|
61
|
+
it case-insensitively neutralizes boundary-shaped opening or closing occurrences
|
|
62
|
+
of `cross-session-message` and `embassy-reply-hint` by inserting `\` immediately
|
|
63
|
+
after their leading `<`. The rest of the body remains byte-for-byte text.
|
|
64
|
+
Native Claude wrappers received inside a body are therefore untrusted nested
|
|
65
|
+
text beneath Embassy's single authoritative outer frame.
|
|
66
|
+
|
|
67
|
+
The full conversation token travels only in the accepted control result and
|
|
68
|
+
transient provider payload; the composed envelope itself is payload-only.
|
|
69
|
+
Aliases retain their existing sanitized public-metadata behavior. The full
|
|
70
|
+
token is never persisted, journaled, logged, snapshotted, placed in a receipt,
|
|
71
|
+
or rendered on either dashboard. A framing, metadata, or size failure happens
|
|
72
|
+
before the provider write and settles as a clean failure; it is never
|
|
73
|
+
classified as an ambiguous write or replayed.
|
|
74
|
+
|
|
75
|
+
## Delivery tokens
|
|
76
|
+
|
|
77
|
+
Every accepted `send-to-claude`, `send-to-codex`, and `reply` returns a delivery token: `dlv_` followed by exactly 24 base64url characters. It addresses one bounded in-memory tracker and is not a provider receipt handle.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
embassy delivery-status --token dlv_<token>
|
|
81
|
+
embassy wait-delivery --token dlv_<token>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`delivery-status` reads the tracker once. `wait-delivery` polls until the tracker is terminal or the delivery deadline passes. It exits `0` only for `delivered`, `6` for any other terminal state (`unconfirmed`, `expired`, `failed`, `ambiguous`, or `cancelled`), `3` for an unknown token, and `4` for a local wait timeout — which is not a terminal state and does not authorize a resend. Tokens are memory-only: after a restart, a prior token reports `found: false`.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# 投递语义
|
|
2
|
+
|
|
3
|
+
Embassy 跟踪每条被接受的消息,从 CLI 接受到终态结算的全过程。本文档将投递模型汇集于一处:队列行为、证据状态、失败处理、重试策略,以及让发送方跟踪消息直至结算的投递令牌。这是 Embassy 中 `delivered` 含义与不含义的权威参考。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
- **投递时机因方向而异。** 通过路由与写前检查后,朝向 Claude 的正文会立即写入 Claude 的原生邮箱,无论观测到 Claude 正繁忙还是空闲;Claude 繁忙绝不是在 Embassy 队列中暂扣这次写入的理由。朝向 Codex 的普通正文则会等待任务可用。仅 Claude→Codex 方向中正文以精确 `STEER:` 开头的消息,可以在当前轮次的下一个工具调用边界被接纳。Embassy 绝不会中断轮次或在生成过程中注入文本;若边界明确不可用,消息会回到普通队列。每条路由最多保留三条排队中的转向消息;第四条被接受时,最旧的一条会结算为 `cancelled/STEER_QUEUE_SUPERSEDED`。
|
|
8
|
+
|
|
9
|
+
- **接受不等于完成。** CLI 初始接受返回一个对话令牌和一个投递令牌。对于朝向 Claude 的投递,`transport_written` 表示原生邮箱写入完成,并且就是终局 `delivered` 边界;Embassy 不会等待 Claude 后续读取或消费正文的证据。朝向 Codex 时,`delivered` 表示 App Server 接受了该轮次。这两个边界都不表示模型已读取、理解或完成工作。
|
|
10
|
+
|
|
11
|
+
- **接收方获得来源和回复能力。** 每条实际路由到提供方的消息都带有 Embassy 在写入边界生成的单一 `<cross-session-message>` 文本封装:已经验证的发送方别名,以及含完整 `conv_` 令牌、精确接收方别名和对应 `embassy reply` 命令的首个 `<embassy-reply-hint>` 元素。接收方可以只使用该提示继续对话;每次回复仍会重新检查调用方身份、对话参与关系和当前路由。
|
|
12
|
+
|
|
13
|
+
- **证据有三种形态。** `delivered` 表示观测到了该方向的终端提供方边界;已经确认的 Claude 邮箱写入会立即到达这个边界。`unconfirmed` 表示虽有部分分派证据,Embassy 仍无法证明所需终端边界;它不是已确认 Claude 邮箱写入后的降级状态。`ambiguous` 表示写入结果本身未知。三者均为终态,`unconfirmed` 和 `ambiguous` 都不构成重试授权——请检查接收方,因为重发可能导致消息重复。
|
|
14
|
+
|
|
15
|
+
- **原生失败。** Claude 发起的路由或投递失败会结算为原生 `expired`;其原生确认始终在 reason 字段中保留规范化安全代码。默认的 `merged` 通知模式保留早期停滞帧,但抑制重复的终局 `<gateway-delivery-diagnostic>` 用户帧。`verbose` 会恢复该可读诊断帧;`quiet` 会抑制所有由网关生成的用户帧通知(包括停滞通知),但仍保留原生状态和仪表盘事实。任何通知都不包含路径、原生标识符、异常或消息体。`denied` 保留用于真实的用户或策略拒绝,Embassy v1 不会生成该状态。`held` 和已完成传输写入是进度状态,不是成功状态。
|
|
16
|
+
- **原生 held 采用“先尝试、后确认”。** 对 Claude→Codex 入站消息,Embassy 会先尝试精确的立即投递。在一秒提示边界前观察到终局结果时,只发送终局确认。仅当正文确实仍在排队(包括路由繁忙或提供方明确推迟)或到达该边界时投递仍未终结,才发送原生 `held`;终局确认随后发送。Claude 显示的“已批准并释放”通知只表示具备配对同意的网关已接受正文并将其释放到接收方队列;它不表示模型已读取,也不表示有人类批准。
|
|
17
|
+
|
|
18
|
+
- **保守重试。** 尚未分派、朝向 Codex 的消息会在任务忙碌或暂时不可用期间保持排队。朝向 Claude 的正文只有在写前路由失败或暂时不可用时才可能排队,绝不会仅因观测到 Claude 繁忙而排队。重新运行 `register-codex` 会替换已关闭或故障的 App Server 连接器,并在恢复后的路由空闲时唤醒朝向 Codex 的挂起工作。显式的干净适配器延迟可以将同一消息体退回队列。仅仅从发现结果中消失的 Claude 路由不再被自动作废:其排队邮件仍指向该会话;改为在写入已失效的会话套接字时,带着精确的安全代码快速失败。已确认的投递失败会结算;不明确的写入结果绝不会被自动重试。
|
|
19
|
+
|
|
20
|
+
- **有界设计。** 消息体、队列、速率窗口、去重表、截止时间和临时对话都有固定的上限。
|
|
21
|
+
|
|
22
|
+
- **进度监视是独立证据。** 选择启用的监视可能比一条在投递前已过期的开启消息存续更久,因此即使线程活动让监视保持健康,工作方仍可能从未看到原始任务。所有者在假定任务文本已到达之前,应单独检查开启消息的 `delivery-status`。
|
|
23
|
+
|
|
24
|
+
- **重启保留排队邮件。** 排队中的消息体按有界策略持久化,并在路由被重新观察到时恰好重发一次。崩溃时在途的消息结算为 ambiguous — 绝不悄然丢失,也绝不重复发送。投递令牌仍仅存于内存。先前的 Claude 绑定仍被存储但处于过期状态;经授权的完整实时发现后,精确唯一的存储 UUID 会自动重新激活;显式运行 `select-claude` 仍是可选的后备方式。待处理的回复或对话能力均不保留。
|
|
25
|
+
|
|
26
|
+
已接受的消息在代理和提供方连接保持健康的情况下被跟踪至终态投递。仪表盘区分接受、进行中、已投递、过期、失败、不明确和废弃等状态。
|
|
27
|
+
|
|
28
|
+
## 来源封装与对话回复
|
|
29
|
+
|
|
30
|
+
Embassy 的存储、队列、`STEER:` 分类、去重、速率限制和 16 KiB 接纳边界都作用于原始正文。只有在最后的提供方写入边界,Embassy 才会确定性地添加一次权威文本封装。因此,干净的写前重试会得到字节级一致、且不会重复嵌套的封装。
|
|
31
|
+
|
|
32
|
+
双向封装共享一个由代理拥有的外层 `<cross-session-message>` 标记和首个 `<embassy-reply-hint>` 元素,但遵循各接收方的固定协议:
|
|
33
|
+
|
|
34
|
+
- **朝向 Codex:** 外层的 `from-name` 包含已经验证的精确来源别名,`conversation` 包含完整对话令牌。
|
|
35
|
+
- **朝向 Claude:** 外层只使用 Claude Code 规范解析器接受的有界 `from-name`。来源别名超过 64 个字符时会得到确定性的 64 字符显示标签,首个回复提示则通过 `from-alias` 保留精确别名。Claude 的外层封装不带 `conversation`,因为该属性不属于其规范解析格式。
|
|
36
|
+
- **两个方向:** 首个 `embassy-reply-hint` 都带有 `conversation`、`reply-as` 和从标准输入读取正文的精确回复命令。`reply-as` 始终是接收方别名,不是发送方别名;提示会明确说明调用方、对话参与关系和路由仍会重新检查。
|
|
37
|
+
|
|
38
|
+
这个格式是与 Claude Code 兼容的文本框架和模型可见的来源边界,不是通用 XML、密码学签名,也不能证明正文安全。Embassy 先用已经验证的代理元数据组成真实外层和提示;随后仅在不可信原始正文内,对大小写不敏感且形似边界的 `cross-session-message` 与 `embassy-reply-hint` 起止标记进行中和:在其前导 `<` 后立即插入 `\`。其余正文保持原样。正文内已有的 Claude 原生封装因此只是 Embassy 单一权威外层之下的不可信嵌套文本。
|
|
39
|
+
|
|
40
|
+
对话令牌是临时的参与方范围定位符,单独持有它并不足以取得权限。接收方可以使用收到的完整令牌,但代理仍会验证继承的调用方身份、当前对话参与关系、路由状态和入站策略。切勿根据仅含元数据的视图所显示的后缀重构令牌。
|
|
41
|
+
|
|
42
|
+
完整对话令牌只会进入初始发送方的临时 CLI 接纳结果和接收方的临时提供方投递负载;合成后的来源封装只进入后者。已经验证的别名仍遵循现有的公开元数据规则。完整令牌从不被持久化、写入路由日志、记录到普通日志、快照化、放入回执,或呈现在任一仪表盘上。封装、元数据或大小检查失败会在提供方写入之前干净地终局失败;这绝不会被归类为不明确写入,也不会重放。代理重启、身份转交或对话失效后,旧令牌不可恢复,也不得猜测。
|
|
43
|
+
|
|
44
|
+
## 投递令牌
|
|
45
|
+
|
|
46
|
+
每次被接受的 `send-to-claude`、`send-to-codex` 和 `reply` 都会返回一个投递令牌:`dlv_` 后跟恰好 24 个 base64url 字符。它指向一个有界的内存跟踪器,不是提供方回执句柄。
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
embassy delivery-status --token dlv_<token>
|
|
50
|
+
embassy wait-delivery --token dlv_<token>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`delivery-status` 读取跟踪器一次。`wait-delivery` 轮询直至跟踪器到达终态或投递截止时间到期。仅在 `delivered` 时以退出码 `0` 退出,任何其他终态(`unconfirmed`、`expired`、`failed`、`ambiguous` 或 `cancelled`)以退出码 `6` 退出,令牌未知时以 `3` 退出,本地等待超时以 `4` 退出——超时不是终态,不构成重发授权。令牌仅存于内存:重启后,先前的令牌会报告 `found: false`。
|