agent-embassy 1.6.1 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +9 -9
- package/README.zh-CN.md +9 -9
- package/SECURITY.md +34 -77
- package/dist/src/gateway/acp-client.d.ts +117 -0
- package/dist/src/gateway/acp-client.js +382 -0
- package/dist/src/gateway/acp-client.js.map +1 -0
- package/dist/src/gateway/acp-provider.d.ts +65 -0
- package/dist/src/gateway/acp-provider.js +163 -0
- package/dist/src/gateway/acp-provider.js.map +1 -0
- package/dist/src/gateway/claude-helper-protocol.d.ts +3 -1
- package/dist/src/gateway/claude-helper-protocol.js +15 -5
- package/dist/src/gateway/claude-helper-protocol.js.map +1 -1
- package/dist/src/gateway/claude-helper-supervisor.d.ts +3 -1
- package/dist/src/gateway/claude-helper-supervisor.js +16 -2
- package/dist/src/gateway/claude-helper-supervisor.js.map +1 -1
- package/dist/src/gateway/claude-helper.js +4 -3
- package/dist/src/gateway/claude-helper.js.map +1 -1
- package/dist/src/gateway/claude-peer.d.ts +1 -1
- package/dist/src/gateway/claude-peer.js +11 -13
- package/dist/src/gateway/claude-peer.js.map +1 -1
- package/dist/src/gateway/claude-runtime.d.ts +0 -20
- package/dist/src/gateway/claude-runtime.js +6 -127
- 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 +3 -1
- package/dist/src/gateway/cli-copy.en.js +5 -2
- package/dist/src/gateway/cli-copy.en.js.map +1 -1
- package/dist/src/gateway/cli-copy.js +2 -0
- package/dist/src/gateway/cli-copy.js.map +1 -1
- package/dist/src/gateway/cli-copy.zh-CN.d.ts +3 -1
- package/dist/src/gateway/cli-copy.zh-CN.js +5 -2
- package/dist/src/gateway/cli-copy.zh-CN.js.map +1 -1
- package/dist/src/gateway/cli.d.ts +2 -2
- package/dist/src/gateway/cli.js +73 -6
- package/dist/src/gateway/cli.js.map +1 -1
- package/dist/src/gateway/codex-app-server.d.ts +5 -74
- package/dist/src/gateway/codex-app-server.js +9 -599
- package/dist/src/gateway/codex-app-server.js.map +1 -1
- package/dist/src/gateway/codex-doctor.d.ts +33 -0
- package/dist/src/gateway/codex-doctor.js +148 -0
- package/dist/src/gateway/codex-doctor.js.map +1 -0
- package/dist/src/gateway/codex-local-transport.d.ts +13 -26
- package/dist/src/gateway/codex-local-transport.js +31 -76
- package/dist/src/gateway/codex-local-transport.js.map +1 -1
- package/dist/src/gateway/compatibility.d.ts +6 -66
- package/dist/src/gateway/compatibility.js +14 -296
- package/dist/src/gateway/compatibility.js.map +1 -1
- package/dist/src/gateway/config.d.ts +9 -0
- package/dist/src/gateway/config.js +6 -2
- package/dist/src/gateway/config.js.map +1 -1
- package/dist/src/gateway/control.d.ts +16 -1
- package/dist/src/gateway/control.js +128 -59
- 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 +19 -44
- package/dist/src/gateway/dashboard-copy.en.js +42 -67
- package/dist/src/gateway/dashboard-copy.en.js.map +1 -1
- package/dist/src/gateway/dashboard-copy.js +19 -44
- package/dist/src/gateway/dashboard-copy.js.map +1 -1
- package/dist/src/gateway/dashboard-copy.zh-CN.d.ts +19 -44
- package/dist/src/gateway/dashboard-copy.zh-CN.js +42 -67
- package/dist/src/gateway/dashboard-copy.zh-CN.js.map +1 -1
- package/dist/src/gateway/dashboard-model.d.ts +41 -76
- package/dist/src/gateway/dashboard-model.js +167 -257
- package/dist/src/gateway/dashboard-model.js.map +1 -1
- package/dist/src/gateway/dashboard.d.ts +0 -3
- package/dist/src/gateway/dashboard.js +77 -76
- package/dist/src/gateway/dashboard.js.map +1 -1
- package/dist/src/gateway/deepseek-detect.d.ts +7 -6
- package/dist/src/gateway/deepseek-detect.js +31 -115
- package/dist/src/gateway/deepseek-detect.js.map +1 -1
- package/dist/src/gateway/live-dashboard-app/app.js +175 -621
- package/dist/src/gateway/live-dashboard-command.js +2 -4
- package/dist/src/gateway/live-dashboard-command.js.map +1 -1
- package/dist/src/gateway/live-dashboard-http.d.ts +1 -2
- package/dist/src/gateway/live-dashboard-http.js +14 -15
- package/dist/src/gateway/live-dashboard-http.js.map +1 -1
- package/dist/src/gateway/progress-watch-machine.d.ts +1 -4
- package/dist/src/gateway/progress-watch-machine.js.map +1 -1
- package/dist/src/gateway/provenance-envelope.d.ts +3 -2
- package/dist/src/gateway/provenance-envelope.js +44 -11
- package/dist/src/gateway/provenance-envelope.js.map +1 -1
- package/dist/src/gateway/providers.d.ts +19 -85
- package/dist/src/gateway/providers.js +132 -835
- package/dist/src/gateway/providers.js.map +1 -1
- package/dist/src/gateway/server.d.ts +8 -9
- package/dist/src/gateway/server.js +63 -99
- package/dist/src/gateway/server.js.map +1 -1
- package/dist/src/gateway/service.d.ts +48 -51
- package/dist/src/gateway/service.js +748 -540
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/gateway/store.d.ts +20 -29
- package/dist/src/gateway/store.js +306 -838
- package/dist/src/gateway/store.js.map +1 -1
- package/dist/src/gateway/types.d.ts +63 -54
- package/dist/src/gateway/types.js +51 -91
- package/dist/src/gateway/types.js.map +1 -1
- package/docs/CONFIGURATION.md +11 -10
- package/docs/CONFIGURATION.zh-CN.md +10 -9
- package/docs/DASHBOARD.md +4 -38
- package/docs/DASHBOARD.zh-CN.md +4 -2
- package/docs/GATEWAY-ARCHITECTURE.md +61 -119
- package/package.json +1 -1
- package/skills/embassy-peer/SKILL.md +6 -6
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import type { Duplex } from "node:stream";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Closed App Server method surface used by the gateway.
|
|
4
4
|
*
|
|
5
5
|
* `turn/steer` is exposed only through the exact Claude-to-Codex `STEER:`
|
|
6
6
|
* contract. It queues input at the attested next tool-call boundary and never
|
|
7
7
|
* authorizes an interrupt or a generic/public JSON-RPC escape hatch.
|
|
8
8
|
*/
|
|
9
|
-
export declare const CODEX_APP_SERVER_V1_METHODS: readonly ["
|
|
10
|
-
export declare const CODEX_PROBE_MODEL_PREFERENCE: readonly ["gpt-5.6-luna"];
|
|
11
|
-
export declare const CODEX_PROBE_EFFORT: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra"];
|
|
12
|
-
export declare const CODEX_WRITE_PROBE_INPUT: "Reply with exactly OK. Do not use tools.";
|
|
13
|
-
/** Exact App Server builds whose writable v2 schema was reviewed. */
|
|
14
|
-
export declare const CODEX_APP_SERVER_WRITABLE_VERSIONS: readonly ["0.147.0"];
|
|
9
|
+
export declare const CODEX_APP_SERVER_V1_METHODS: readonly ["thread/loaded/list", "thread/resume", "thread/unsubscribe", "turn/start", "turn/steer", "turn/interrupt"];
|
|
15
10
|
export type CodexAppServerV1Method = (typeof CODEX_APP_SERVER_V1_METHODS)[number];
|
|
16
11
|
export type CodexRouteStatus = "unknown" | "not_loaded" | "idle" | "starting" | "active" | "waiting_approval" | "interrupting" | "system_error" | "uncertain" | "stale";
|
|
17
12
|
export type CodexConnectorConnectionState = "connecting" | "ready" | "closed" | "faulted";
|
|
@@ -19,24 +14,9 @@ export type CodexRouteIdentity = {
|
|
|
19
14
|
endpointGeneration: string;
|
|
20
15
|
threadId: string;
|
|
21
16
|
};
|
|
22
|
-
/**
|
|
23
|
-
* Version/generation evidence supplied by the attach-only transport owner.
|
|
24
|
-
* App Server's initialize result does not currently negotiate a protocol
|
|
25
|
-
* version, so writable construction requires a separately attested tested
|
|
26
|
-
* schema and write surface.
|
|
27
|
-
* The attestation expires with any endpoint generation or binary change.
|
|
28
|
-
*/
|
|
17
|
+
/** Exact generation evidence supplied by the attach-only transport owner. */
|
|
29
18
|
export type CodexEndpointCompatibilityAttestation = {
|
|
30
|
-
appServerVersion: string;
|
|
31
19
|
endpointGeneration: string;
|
|
32
|
-
protocol: "app-server-v2-stable";
|
|
33
|
-
/** Schema candidate; only separately attested write coverage may enable writes. */
|
|
34
|
-
observedSchemaCandidate?: true;
|
|
35
|
-
steering: {
|
|
36
|
-
method: "turn/steer";
|
|
37
|
-
requestSchema: "expected-turn-id-text-v1";
|
|
38
|
-
deliveryBoundary: "next-tool-call-boundary";
|
|
39
|
-
};
|
|
40
20
|
};
|
|
41
21
|
/**
|
|
42
22
|
* Compare-and-swap guard for every route operation. A caller must obtain a
|
|
@@ -46,7 +26,6 @@ export type CodexRouteGuard = CodexRouteIdentity & {
|
|
|
46
26
|
activeTurnId: string | null;
|
|
47
27
|
revision: number;
|
|
48
28
|
status: CodexRouteStatus;
|
|
49
|
-
writableReady: boolean;
|
|
50
29
|
};
|
|
51
30
|
/** Safe dashboard/controller projection. It deliberately omits provider IDs. */
|
|
52
31
|
export type CodexConnectorObservation = {
|
|
@@ -56,13 +35,10 @@ export type CodexConnectorObservation = {
|
|
|
56
35
|
queueDepth: number;
|
|
57
36
|
requestInFlight: boolean;
|
|
58
37
|
routeStatus: CodexRouteStatus;
|
|
59
|
-
writableReady: boolean;
|
|
60
|
-
writeBlockCode: CodexWriteBlockCode | null;
|
|
61
38
|
};
|
|
62
|
-
export type CodexWriteBlockCode = "WRITES_DISABLED";
|
|
63
39
|
export type CodexTurnOutcome = "completed" | "failed" | "interrupted";
|
|
64
40
|
export type CodexDeliveryOutcome = CodexTurnOutcome | "abandoned" | "ambiguous" | "expired";
|
|
65
|
-
export type CodexConnectorEventKind = "connection_ready" | "connection_closed" | "protocol_fault" | "request_started" | "thread_observed" | "thread_resumed" | "thread_unsubscribed" | "route_status_changed" | "
|
|
41
|
+
export type CodexConnectorEventKind = "connection_ready" | "connection_closed" | "protocol_fault" | "request_started" | "thread_observed" | "thread_resumed" | "thread_unsubscribed" | "route_status_changed" | "message_queued" | "queued_messages_cancelled" | "turn_starting" | "turn_started" | "turn_steered" | "turn_interrupt_requested" | "turn_completed" | "approval_waiting" | "server_request_ignored" | "server_warning";
|
|
66
42
|
export type CodexConnectorEventDetails = {
|
|
67
43
|
droppedMessages?: number;
|
|
68
44
|
errorCode?: CodexConnectorErrorCode;
|
|
@@ -81,23 +57,7 @@ export type CodexConnectorEvent = CodexConnectorObservation & {
|
|
|
81
57
|
kind: CodexConnectorEventKind;
|
|
82
58
|
timestamp: string;
|
|
83
59
|
};
|
|
84
|
-
export type CodexConnectorErrorCode = "INVALID_CONFIGURATION" | "INVALID_ROUTE" | "STALE_ENDPOINT" | "ROUTE_CAS_MISMATCH" | "ROUTE_NOT_READY" | "THREAD_NOT_OBSERVED" | "ROUTE_BUSY" | "TURN_NOT_OWNED" | "
|
|
85
|
-
export type CodexWriteCompatibilityProbeErrorCode = "CODEX_WRITE_PROBE_CAPACITY_EXHAUSTED" | "CODEX_WRITE_PROBE_MODEL_PIN_UNAVAILABLE" | "CODEX_WRITE_PROBE_MODEL_REROUTED" | "CODEX_WRITE_PROBE_THREAD_SETUP_FAILED" | "CODEX_WRITE_PROBE_TOOL_ACTIVITY_OBSERVED" | "CODEX_WRITE_PROBE_TIMEOUT" | "CODEX_WRITE_PROBE_CLEANUP_UNCONFIRMED" | "CODEX_WRITE_PROBE_RATE_LIMIT_CONSTRAINED";
|
|
86
|
-
export type CodexWriteCompatibilityProbeResult = {
|
|
87
|
-
archivedThreadCount: 1;
|
|
88
|
-
outcome: "pass";
|
|
89
|
-
settingsEchoObserved: boolean;
|
|
90
|
-
tokenCount: number;
|
|
91
|
-
} | {
|
|
92
|
-
archivedThreadCount?: 1;
|
|
93
|
-
outcome: "fail";
|
|
94
|
-
safeErrorCode: CodexWriteCompatibilityProbeErrorCode;
|
|
95
|
-
settingsEchoObserved: boolean;
|
|
96
|
-
tokenCount?: number;
|
|
97
|
-
};
|
|
98
|
-
export declare function codexWriteProbeFailure(safeErrorCode: CodexWriteCompatibilityProbeErrorCode, evidence?: Partial<Pick<CodexWriteCompatibilityProbeResult, "archivedThreadCount" | "settingsEchoObserved" | "tokenCount">>): Extract<CodexWriteCompatibilityProbeResult, {
|
|
99
|
-
outcome: "fail";
|
|
100
|
-
}>;
|
|
60
|
+
export type CodexConnectorErrorCode = "INVALID_CONFIGURATION" | "INVALID_ROUTE" | "STALE_ENDPOINT" | "ROUTE_CAS_MISMATCH" | "ROUTE_NOT_READY" | "THREAD_NOT_OBSERVED" | "ROUTE_BUSY" | "TURN_NOT_OWNED" | "INPUT_INVALID" | "QUEUE_FULL" | "MESSAGE_DUPLICATE" | "MESSAGE_CAPACITY" | "METHOD_NOT_ALLOWED" | "CONNECTOR_CLOSED" | "REQUEST_TIMEOUT" | "RPC_REJECTED" | "RESULT_SCHEMA_MISMATCH" | "TRANSPORT_WRITE_FAILED" | "TRANSPORT_CLOSED" | "PROTOCOL_ERROR";
|
|
101
61
|
export declare class CodexConnectorError extends Error {
|
|
102
62
|
readonly ambiguous: boolean;
|
|
103
63
|
readonly code: CodexConnectorErrorCode;
|
|
@@ -169,17 +129,9 @@ export type CodexAppServerConnectorOptions = {
|
|
|
169
129
|
onEvent?: (event: CodexConnectorEvent) => void;
|
|
170
130
|
onTurnResult?: (result: CodexTransientTurnResult) => void;
|
|
171
131
|
requestTimeoutMs?: number;
|
|
172
|
-
/** Enables only the closed disposable-thread probe API and its notifications. */
|
|
173
|
-
writeCompatibilityProbe?: true;
|
|
174
132
|
turnWatchdogMs?: number;
|
|
175
133
|
route: CodexRouteIdentity;
|
|
176
134
|
transport: CodexAppServerTransport;
|
|
177
|
-
/** Immutable outer authorization; monitor-only connectors set this false. */
|
|
178
|
-
writesEnabled: boolean;
|
|
179
|
-
};
|
|
180
|
-
export type CodexWriteCompatibilityProbeInput = {
|
|
181
|
-
cwd: string;
|
|
182
|
-
forbiddenThreadIds: readonly string[];
|
|
183
135
|
};
|
|
184
136
|
export type CodexMessageInput = {
|
|
185
137
|
deadlineAt: string;
|
|
@@ -233,8 +185,6 @@ export declare class CodexAppServerConnector {
|
|
|
233
185
|
private nextRequestId;
|
|
234
186
|
private ownsActiveTurn;
|
|
235
187
|
private readonly pending;
|
|
236
|
-
private probeAttempted;
|
|
237
|
-
private probeRuntime;
|
|
238
188
|
private readonly queue;
|
|
239
189
|
private revision;
|
|
240
190
|
private routeStatus;
|
|
@@ -245,7 +195,6 @@ export declare class CodexAppServerConnector {
|
|
|
245
195
|
private turnWatchdogTimer;
|
|
246
196
|
private readonly unlisten;
|
|
247
197
|
private readonly clientInfo;
|
|
248
|
-
private readonly compatibility;
|
|
249
198
|
private readonly maxDeadlineMs;
|
|
250
199
|
private readonly maxFrameBytes;
|
|
251
200
|
private readonly maxInputBytes;
|
|
@@ -259,8 +208,6 @@ export declare class CodexAppServerConnector {
|
|
|
259
208
|
private readonly turnWatchdogMs;
|
|
260
209
|
private readonly route;
|
|
261
210
|
private readonly transport;
|
|
262
|
-
private readonly writeCompatibilityProbe;
|
|
263
|
-
private readonly writesEnabled;
|
|
264
211
|
private constructor();
|
|
265
212
|
observation(): CodexConnectorObservation;
|
|
266
213
|
guard(): CodexRouteGuard;
|
|
@@ -280,18 +227,6 @@ export declare class CodexAppServerConnector {
|
|
|
280
227
|
*/
|
|
281
228
|
interruptOwnedTurn(guard: CodexRouteGuard): Promise<CodexConnectorObservation>;
|
|
282
229
|
close(): Promise<void>;
|
|
283
|
-
/**
|
|
284
|
-
* Run the one fixed disposable-thread write probe. The method never exposes
|
|
285
|
-
* JSON-RPC, native IDs, content, or route state, and every failure settles as
|
|
286
|
-
* a safe result so compatibility discovery cannot take down the broker.
|
|
287
|
-
*/
|
|
288
|
-
runWriteCompatibilityProbe(input: CodexWriteCompatibilityProbeInput): Promise<CodexWriteCompatibilityProbeResult>;
|
|
289
|
-
private selectProbeModel;
|
|
290
|
-
private probeCleanupThreadId;
|
|
291
|
-
private validateProbeThread;
|
|
292
|
-
private waitForProbeTurn;
|
|
293
|
-
private settleProbeRuntime;
|
|
294
|
-
private settleProbeConnectionLoss;
|
|
295
230
|
private initialize;
|
|
296
231
|
private validateMessage;
|
|
297
232
|
private enqueue;
|
|
@@ -306,9 +241,6 @@ export declare class CodexAppServerConnector {
|
|
|
306
241
|
private assertGuard;
|
|
307
242
|
private assertReady;
|
|
308
243
|
private assertNoRequest;
|
|
309
|
-
private currentWriteBlockCode;
|
|
310
|
-
private isWritableReady;
|
|
311
|
-
private assertWritableReady;
|
|
312
244
|
/**
|
|
313
245
|
* Refresh the exact thread on this same connection immediately before a
|
|
314
246
|
* `turn/start`. This confirms the registered task is still the observed idle
|
|
@@ -325,7 +257,6 @@ export declare class CodexAppServerConnector {
|
|
|
325
257
|
private handlePayload;
|
|
326
258
|
private handleNotification;
|
|
327
259
|
private handleServerRequest;
|
|
328
|
-
private handleProbeNotification;
|
|
329
260
|
private handleCompletedItem;
|
|
330
261
|
private clearTransientReply;
|
|
331
262
|
private settleDelivery;
|