agent-embassy 1.7.0 → 1.8.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 +32 -0
- package/CONTRIBUTING.md +51 -47
- package/README.md +26 -9
- package/README.zh-CN.md +22 -9
- package/SECURITY.md +48 -35
- package/dist/src/gateway/acp-client.d.ts +12 -19
- package/dist/src/gateway/acp-client.js +90 -65
- package/dist/src/gateway/acp-client.js.map +1 -1
- package/dist/src/gateway/acp-provider.d.ts +11 -10
- package/dist/src/gateway/acp-provider.js +165 -53
- package/dist/src/gateway/acp-provider.js.map +1 -1
- package/dist/src/gateway/claude-helper-client.d.ts +2 -43
- package/dist/src/gateway/claude-helper-client.js +1 -211
- package/dist/src/gateway/claude-helper-client.js.map +1 -1
- package/dist/src/gateway/claude-helper-protocol.d.ts +16 -74
- package/dist/src/gateway/claude-helper-protocol.js +99 -378
- package/dist/src/gateway/claude-helper-protocol.js.map +1 -1
- package/dist/src/gateway/claude-helper-supervisor.d.ts +56 -44
- package/dist/src/gateway/claude-helper-supervisor.js +265 -456
- package/dist/src/gateway/claude-helper-supervisor.js.map +1 -1
- package/dist/src/gateway/claude-helper.js +184 -210
- package/dist/src/gateway/claude-helper.js.map +1 -1
- package/dist/src/gateway/claude-peer.d.ts +20 -87
- package/dist/src/gateway/claude-peer.js +310 -1009
- package/dist/src/gateway/claude-peer.js.map +1 -1
- package/dist/src/gateway/claude-runtime.d.ts +13 -15
- package/dist/src/gateway/claude-runtime.js +14 -168
- package/dist/src/gateway/claude-runtime.js.map +1 -1
- package/dist/src/gateway/cli-copy.en.d.ts +2 -2
- package/dist/src/gateway/cli-copy.en.js +4 -2
- package/dist/src/gateway/cli-copy.en.js.map +1 -1
- package/dist/src/gateway/cli-copy.zh-CN.d.ts +2 -2
- package/dist/src/gateway/cli-copy.zh-CN.js +4 -2
- package/dist/src/gateway/cli-copy.zh-CN.js.map +1 -1
- package/dist/src/gateway/cli.d.ts +7 -2
- package/dist/src/gateway/cli.js +277 -575
- package/dist/src/gateway/cli.js.map +1 -1
- package/dist/src/gateway/codex-app-server.d.ts +5 -227
- package/dist/src/gateway/codex-app-server.js +18 -1463
- package/dist/src/gateway/codex-app-server.js.map +1 -1
- package/dist/src/gateway/codex-doctor.d.ts +36 -0
- package/dist/src/gateway/codex-doctor.js +127 -0
- package/dist/src/gateway/codex-doctor.js.map +1 -0
- package/dist/src/gateway/codex-local-transport.d.ts +6 -6
- package/dist/src/gateway/codex-local-transport.js +13 -10
- package/dist/src/gateway/codex-local-transport.js.map +1 -1
- package/dist/src/gateway/codex-stateless-transport.d.ts +114 -0
- package/dist/src/gateway/codex-stateless-transport.js +1108 -0
- package/dist/src/gateway/codex-stateless-transport.js.map +1 -0
- package/dist/src/gateway/config.d.ts +2 -9
- package/dist/src/gateway/config.js +62 -100
- package/dist/src/gateway/config.js.map +1 -1
- package/dist/src/gateway/control.d.ts +36 -90
- package/dist/src/gateway/control.js +465 -1123
- 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 +8 -26
- package/dist/src/gateway/dashboard-copy.en.js +19 -37
- package/dist/src/gateway/dashboard-copy.en.js.map +1 -1
- package/dist/src/gateway/dashboard-copy.js +8 -26
- package/dist/src/gateway/dashboard-copy.js.map +1 -1
- package/dist/src/gateway/dashboard-copy.zh-CN.d.ts +8 -26
- package/dist/src/gateway/dashboard-copy.zh-CN.js +19 -37
- package/dist/src/gateway/dashboard-copy.zh-CN.js.map +1 -1
- package/dist/src/gateway/dashboard-model.d.ts +8 -22
- package/dist/src/gateway/dashboard-model.js +44 -130
- package/dist/src/gateway/dashboard-model.js.map +1 -1
- package/dist/src/gateway/dashboard.d.ts +0 -6
- package/dist/src/gateway/dashboard.js +3 -7
- package/dist/src/gateway/dashboard.js.map +1 -1
- package/dist/src/gateway/live-dashboard-app/app.js +20 -34
- package/dist/src/gateway/live-dashboard-command.js +2 -2
- package/dist/src/gateway/live-dashboard-command.js.map +1 -1
- package/dist/src/gateway/live-dashboard-http.d.ts +1 -1
- package/dist/src/gateway/live-dashboard-http.js +2 -2
- package/dist/src/gateway/live-dashboard-http.js.map +1 -1
- package/dist/src/gateway/progress-watch-machine.d.ts +1 -37
- package/dist/src/gateway/progress-watch-machine.js +4 -15
- package/dist/src/gateway/progress-watch-machine.js.map +1 -1
- package/dist/src/gateway/providers.d.ts +58 -191
- package/dist/src/gateway/providers.js +637 -2434
- package/dist/src/gateway/providers.js.map +1 -1
- package/dist/src/gateway/server.d.ts +16 -25
- package/dist/src/gateway/server.js +165 -240
- package/dist/src/gateway/server.js.map +1 -1
- package/dist/src/gateway/service.d.ts +149 -427
- package/dist/src/gateway/service.js +1639 -5662
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/gateway/state-v2-to-v3.d.ts +23 -0
- package/dist/src/gateway/state-v2-to-v3.js +994 -0
- package/dist/src/gateway/state-v2-to-v3.js.map +1 -0
- package/dist/src/gateway/store.d.ts +54 -309
- package/dist/src/gateway/store.js +1560 -3510
- package/dist/src/gateway/store.js.map +1 -1
- package/dist/src/gateway/types.d.ts +181 -225
- package/dist/src/gateway/types.js +115 -251
- package/dist/src/gateway/types.js.map +1 -1
- package/docs/CONFIGURATION.md +22 -9
- package/docs/CONFIGURATION.zh-CN.md +21 -9
- package/docs/DASHBOARD.md +10 -10
- package/docs/DASHBOARD.zh-CN.md +3 -3
- package/docs/DELIVERY.md +4 -4
- package/docs/DELIVERY.zh-CN.md +4 -4
- package/docs/GATEWAY-ARCHITECTURE.md +158 -187
- package/package.json +1 -1
- package/skills/embassy-peer/SKILL.md +28 -22
- package/dist/src/gateway/codex-registration-generation.d.ts +0 -5
- package/dist/src/gateway/codex-registration-generation.js +0 -19
- package/dist/src/gateway/codex-registration-generation.js.map +0 -1
- package/dist/src/gateway/codex-registration-succession.d.ts +0 -209
- package/dist/src/gateway/codex-registration-succession.js +0 -588
- package/dist/src/gateway/codex-registration-succession.js.map +0 -1
- package/dist/src/gateway/compatibility.d.ts +0 -22
- package/dist/src/gateway/compatibility.js +0 -23
- package/dist/src/gateway/compatibility.js.map +0 -1
- package/dist/src/gateway/delivery-machine.d.ts +0 -235
- package/dist/src/gateway/delivery-machine.js +0 -540
- package/dist/src/gateway/delivery-machine.js.map +0 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type LocalCodexTransportDependencies, type LocalCodexTransportErrorCode, type LocalCodexTransportFactory, type LocalCodexTransportFactoryOptions } from "./codex-local-transport.js";
|
|
2
|
+
type TurnOutcome = "completed" | "failed" | "interrupted";
|
|
3
|
+
type ReplyCode = "REPLY_TOO_LARGE" | "REPLY_UNAVAILABLE" | null;
|
|
4
|
+
export type StatelessCodexRoute = Readonly<{
|
|
5
|
+
alias: string;
|
|
6
|
+
hostId: string;
|
|
7
|
+
registrationId: string;
|
|
8
|
+
threadId: string;
|
|
9
|
+
}>;
|
|
10
|
+
export type StatelessCodexWriteEvidence = Readonly<{
|
|
11
|
+
attemptId: string;
|
|
12
|
+
kind: "codex_turn_start" | "codex_turn_steer";
|
|
13
|
+
bodyBytes: number;
|
|
14
|
+
frameBytes: number;
|
|
15
|
+
sha256: string;
|
|
16
|
+
}>;
|
|
17
|
+
type StatelessCodexOperationCommon = Readonly<{
|
|
18
|
+
attemptId: string;
|
|
19
|
+
deadlineAt: string;
|
|
20
|
+
route: StatelessCodexRoute;
|
|
21
|
+
authorizeWrite: (evidence: StatelessCodexWriteEvidence) => Promise<boolean>;
|
|
22
|
+
/** Already provenance-framed by the broker; never emitted as evidence. */
|
|
23
|
+
text: string;
|
|
24
|
+
}>;
|
|
25
|
+
export type StatelessCodexActiveSteerInput = Readonly<{
|
|
26
|
+
attemptId: string;
|
|
27
|
+
deadlineAt: string;
|
|
28
|
+
text: string;
|
|
29
|
+
authorizeWrite: (evidence: StatelessCodexWriteEvidence) => Promise<boolean>;
|
|
30
|
+
}>;
|
|
31
|
+
type ActiveSteerResultCommon = Readonly<{
|
|
32
|
+
attemptId: string;
|
|
33
|
+
}>;
|
|
34
|
+
export type StatelessCodexActiveSteerResult = (ActiveSteerResultCommon & Readonly<{
|
|
35
|
+
phase: "clean";
|
|
36
|
+
state: "deferred" | "failed";
|
|
37
|
+
safeErrorCode: StatelessCodexSafeErrorCode;
|
|
38
|
+
}>) | (ActiveSteerResultCommon & Readonly<{
|
|
39
|
+
phase: "armed";
|
|
40
|
+
state: "ambiguous";
|
|
41
|
+
safeErrorCode: StatelessCodexSafeErrorCode;
|
|
42
|
+
}>) | (ActiveSteerResultCommon & Readonly<{
|
|
43
|
+
phase: "terminal";
|
|
44
|
+
state: "terminal";
|
|
45
|
+
outcome: "delivered";
|
|
46
|
+
replyCode: "REPLY_UNAVAILABLE";
|
|
47
|
+
replyText: null;
|
|
48
|
+
}>);
|
|
49
|
+
export type StatelessCodexAcceptedOperation = Readonly<{
|
|
50
|
+
attemptId: string;
|
|
51
|
+
/** Ephemeral exact App Server evidence. Never persist or log this ID. */
|
|
52
|
+
turnId: string;
|
|
53
|
+
steer: (input: StatelessCodexActiveSteerInput) => Promise<StatelessCodexActiveSteerResult>;
|
|
54
|
+
}>;
|
|
55
|
+
export type StatelessCodexOperationInput = StatelessCodexOperationCommon & Readonly<{
|
|
56
|
+
kind: "start";
|
|
57
|
+
onAccepted: (accepted: StatelessCodexAcceptedOperation) => Promise<void>;
|
|
58
|
+
/** Exact-operation lifecycle only; never sends an App Server interrupt. */
|
|
59
|
+
signal?: AbortSignal;
|
|
60
|
+
}>;
|
|
61
|
+
export type StatelessCodexSafeErrorCode = LocalCodexTransportErrorCode | "ACCEPTANCE_UNCONFIRMED" | "APPROVAL_REQUIRED" | "INPUT_INVALID" | "MESSAGE_EXPIRED" | "PROTOCOL_ERROR" | "REQUEST_TIMEOUT" | "RESULT_SCHEMA_MISMATCH" | "ROUTE_BUSY" | "RPC_REJECTED" | "THREAD_NOT_OBSERVED" | "TRANSPORT_CLOSED" | "TRANSPORT_WRITE_FAILED" | "WRITE_AUTHORIZATION_DENIED" | "WRITE_AUTHORIZATION_UNCERTAIN";
|
|
62
|
+
type ResultCommon = Readonly<{
|
|
63
|
+
attemptId: string;
|
|
64
|
+
cleanupConfirmed: boolean;
|
|
65
|
+
}>;
|
|
66
|
+
export type StatelessCodexOperationResult = (ResultCommon & Readonly<{
|
|
67
|
+
phase: "clean";
|
|
68
|
+
state: "deferred" | "failed";
|
|
69
|
+
safeErrorCode: StatelessCodexSafeErrorCode;
|
|
70
|
+
}>) | (ResultCommon & Readonly<{
|
|
71
|
+
phase: "armed";
|
|
72
|
+
state: "ambiguous";
|
|
73
|
+
safeErrorCode: StatelessCodexSafeErrorCode;
|
|
74
|
+
}>) | (ResultCommon & Readonly<{
|
|
75
|
+
phase: "accepted";
|
|
76
|
+
state: "unconfirmed";
|
|
77
|
+
safeErrorCode: StatelessCodexSafeErrorCode;
|
|
78
|
+
}>) | (ResultCommon & Readonly<{
|
|
79
|
+
phase: "terminal";
|
|
80
|
+
state: "terminal";
|
|
81
|
+
outcome: "delivered" | TurnOutcome;
|
|
82
|
+
replyCode: ReplyCode;
|
|
83
|
+
replyText: string | null;
|
|
84
|
+
}>);
|
|
85
|
+
export type StatelessCodexObservation = Readonly<{
|
|
86
|
+
state: "idle" | "busy" | "awaiting_approval" | "unobserved";
|
|
87
|
+
safeErrorCode?: "CODEX_OBSERVER_PROTOCOL_ERROR" | "CODEX_OBSERVER_UNAVAILABLE" | "THREAD_NOT_OBSERVED";
|
|
88
|
+
}>;
|
|
89
|
+
export type StatelessCodexOperationTransport = Readonly<{
|
|
90
|
+
execute: (input: StatelessCodexOperationInput) => Promise<StatelessCodexOperationResult>;
|
|
91
|
+
/** Independent display evidence. It never prepares or performs a semantic write. */
|
|
92
|
+
observe: (route: StatelessCodexRoute, signal?: AbortSignal) => Promise<StatelessCodexObservation>;
|
|
93
|
+
}>;
|
|
94
|
+
export type StatelessCodexOperationTransportOptions = Readonly<{
|
|
95
|
+
local?: Omit<LocalCodexTransportFactoryOptions, "hostId">;
|
|
96
|
+
maxDeadlineMs?: number;
|
|
97
|
+
maxFrameBytes?: number;
|
|
98
|
+
maxInputBytes?: number;
|
|
99
|
+
maxReplyBytes?: number;
|
|
100
|
+
now?: () => Date;
|
|
101
|
+
requestTimeoutMs?: number;
|
|
102
|
+
turnTimeoutMs?: number;
|
|
103
|
+
}>;
|
|
104
|
+
export type StatelessCodexOperationTransportDependencies = Readonly<{
|
|
105
|
+
createFactory?: (options: LocalCodexTransportFactoryOptions) => Promise<LocalCodexTransportFactory>;
|
|
106
|
+
localDependencies?: LocalCodexTransportDependencies;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Construct an inert stateless Codex operation runner. Construction performs
|
|
110
|
+
* no provider I/O. Every execute independently re-attests the current managed
|
|
111
|
+
* installation, owns one proxy/connection, and closes it before returning.
|
|
112
|
+
*/
|
|
113
|
+
export declare function createStatelessCodexOperationTransport(options?: StatelessCodexOperationTransportOptions, dependencies?: StatelessCodexOperationTransportDependencies): StatelessCodexOperationTransport;
|
|
114
|
+
export {};
|