agent-embassy 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/CONTRIBUTING.md +122 -0
- package/LICENSE +21 -0
- package/README.md +185 -0
- package/README.zh-CN.md +185 -0
- package/SECURITY.md +224 -0
- package/assets/live-dashboard/app.css +1610 -0
- package/assets/mark-seal.svg +7 -0
- package/assets/mark.svg +7 -0
- package/assets/social-preview.png +0 -0
- package/assets/vendor/react/LICENSE +21 -0
- package/assets/vendor/react/react-dom.production.min.js +267 -0
- package/assets/vendor/react/react.production.min.js +31 -0
- package/dist/src/errors.d.ts +5 -0
- package/dist/src/errors.js +11 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/gateway/claude-compatibility-scratch.d.ts +18 -0
- package/dist/src/gateway/claude-compatibility-scratch.js +158 -0
- package/dist/src/gateway/claude-compatibility-scratch.js.map +1 -0
- package/dist/src/gateway/claude-helper-client.d.ts +43 -0
- package/dist/src/gateway/claude-helper-client.js +212 -0
- package/dist/src/gateway/claude-helper-client.js.map +1 -0
- package/dist/src/gateway/claude-helper-protocol.d.ts +172 -0
- package/dist/src/gateway/claude-helper-protocol.js +373 -0
- package/dist/src/gateway/claude-helper-protocol.js.map +1 -0
- package/dist/src/gateway/claude-helper-supervisor.d.ts +74 -0
- package/dist/src/gateway/claude-helper-supervisor.js +497 -0
- package/dist/src/gateway/claude-helper-supervisor.js.map +1 -0
- package/dist/src/gateway/claude-helper.d.ts +1 -0
- package/dist/src/gateway/claude-helper.js +269 -0
- package/dist/src/gateway/claude-helper.js.map +1 -0
- package/dist/src/gateway/claude-peer.d.ts +273 -0
- package/dist/src/gateway/claude-peer.js +2359 -0
- package/dist/src/gateway/claude-peer.js.map +1 -0
- package/dist/src/gateway/claude-runtime.d.ts +40 -0
- package/dist/src/gateway/claude-runtime.js +302 -0
- package/dist/src/gateway/claude-runtime.js.map +1 -0
- package/dist/src/gateway/cli-copy.d.ts +8 -0
- package/dist/src/gateway/cli-copy.en.d.ts +13 -0
- package/dist/src/gateway/cli-copy.en.js +43 -0
- package/dist/src/gateway/cli-copy.en.js.map +1 -0
- package/dist/src/gateway/cli-copy.js +19 -0
- package/dist/src/gateway/cli-copy.js.map +1 -0
- package/dist/src/gateway/cli-copy.zh-CN.d.ts +13 -0
- package/dist/src/gateway/cli-copy.zh-CN.js +43 -0
- package/dist/src/gateway/cli-copy.zh-CN.js.map +1 -0
- package/dist/src/gateway/cli.d.ts +44 -0
- package/dist/src/gateway/cli.js +969 -0
- package/dist/src/gateway/cli.js.map +1 -0
- package/dist/src/gateway/codex-app-server.d.ts +310 -0
- package/dist/src/gateway/codex-app-server.js +1746 -0
- package/dist/src/gateway/codex-app-server.js.map +1 -0
- package/dist/src/gateway/codex-local-transport.d.ts +81 -0
- package/dist/src/gateway/codex-local-transport.js +617 -0
- package/dist/src/gateway/codex-local-transport.js.map +1 -0
- package/dist/src/gateway/codex-registration-generation.d.ts +5 -0
- package/dist/src/gateway/codex-registration-generation.js +19 -0
- package/dist/src/gateway/codex-registration-generation.js.map +1 -0
- package/dist/src/gateway/codex-registration-succession.d.ts +209 -0
- package/dist/src/gateway/codex-registration-succession.js +588 -0
- package/dist/src/gateway/codex-registration-succession.js.map +1 -0
- package/dist/src/gateway/compatibility.d.ts +70 -0
- package/dist/src/gateway/compatibility.js +252 -0
- package/dist/src/gateway/compatibility.js.map +1 -0
- package/dist/src/gateway/config.d.ts +24 -0
- package/dist/src/gateway/config.js +130 -0
- package/dist/src/gateway/config.js.map +1 -0
- package/dist/src/gateway/control.d.ts +308 -0
- package/dist/src/gateway/control.js +1573 -0
- package/dist/src/gateway/control.js.map +1 -0
- package/dist/src/gateway/dashboard-copy.d.ts +7 -0
- package/dist/src/gateway/dashboard-copy.en.d.ts +506 -0
- package/dist/src/gateway/dashboard-copy.en.js +507 -0
- package/dist/src/gateway/dashboard-copy.en.js.map +1 -0
- package/dist/src/gateway/dashboard-copy.js +516 -0
- package/dist/src/gateway/dashboard-copy.js.map +1 -0
- package/dist/src/gateway/dashboard-copy.zh-CN.d.ts +506 -0
- package/dist/src/gateway/dashboard-copy.zh-CN.js +507 -0
- package/dist/src/gateway/dashboard-copy.zh-CN.js.map +1 -0
- package/dist/src/gateway/dashboard-model.d.ts +207 -0
- package/dist/src/gateway/dashboard-model.js +720 -0
- package/dist/src/gateway/dashboard-model.js.map +1 -0
- package/dist/src/gateway/dashboard.d.ts +26 -0
- package/dist/src/gateway/dashboard.js +941 -0
- package/dist/src/gateway/dashboard.js.map +1 -0
- package/dist/src/gateway/delivery-machine.d.ts +235 -0
- package/dist/src/gateway/delivery-machine.js +540 -0
- package/dist/src/gateway/delivery-machine.js.map +1 -0
- package/dist/src/gateway/instance-lease.d.ts +21 -0
- package/dist/src/gateway/instance-lease.js +549 -0
- package/dist/src/gateway/instance-lease.js.map +1 -0
- package/dist/src/gateway/live-dashboard-app/app.js +2914 -0
- package/dist/src/gateway/live-dashboard-assets.d.ts +10 -0
- package/dist/src/gateway/live-dashboard-assets.js +73 -0
- package/dist/src/gateway/live-dashboard-assets.js.map +1 -0
- package/dist/src/gateway/live-dashboard-bootstrap.d.ts +36 -0
- package/dist/src/gateway/live-dashboard-bootstrap.js +176 -0
- package/dist/src/gateway/live-dashboard-bootstrap.js.map +1 -0
- package/dist/src/gateway/live-dashboard-command.d.ts +54 -0
- package/dist/src/gateway/live-dashboard-command.js +324 -0
- package/dist/src/gateway/live-dashboard-command.js.map +1 -0
- package/dist/src/gateway/live-dashboard-http.d.ts +41 -0
- package/dist/src/gateway/live-dashboard-http.js +445 -0
- package/dist/src/gateway/live-dashboard-http.js.map +1 -0
- package/dist/src/gateway/live-dashboard-protocol.d.ts +38 -0
- package/dist/src/gateway/live-dashboard-protocol.js +156 -0
- package/dist/src/gateway/live-dashboard-protocol.js.map +1 -0
- package/dist/src/gateway/live-dashboard-server.d.ts +33 -0
- package/dist/src/gateway/live-dashboard-server.js +130 -0
- package/dist/src/gateway/live-dashboard-server.js.map +1 -0
- package/dist/src/gateway/live-dashboard-stream.d.ts +46 -0
- package/dist/src/gateway/live-dashboard-stream.js +233 -0
- package/dist/src/gateway/live-dashboard-stream.js.map +1 -0
- package/dist/src/gateway/live-dashboard.d.ts +31 -0
- package/dist/src/gateway/live-dashboard.js +190 -0
- package/dist/src/gateway/live-dashboard.js.map +1 -0
- package/dist/src/gateway/locale.d.ts +4 -0
- package/dist/src/gateway/locale.js +10 -0
- package/dist/src/gateway/locale.js.map +1 -0
- package/dist/src/gateway/progress-watch-machine.d.ts +97 -0
- package/dist/src/gateway/progress-watch-machine.js +172 -0
- package/dist/src/gateway/progress-watch-machine.js.map +1 -0
- package/dist/src/gateway/providers.d.ts +287 -0
- package/dist/src/gateway/providers.js +2451 -0
- package/dist/src/gateway/providers.js.map +1 -0
- package/dist/src/gateway/server.d.ts +57 -0
- package/dist/src/gateway/server.js +264 -0
- package/dist/src/gateway/server.js.map +1 -0
- package/dist/src/gateway/service.d.ts +449 -0
- package/dist/src/gateway/service.js +4831 -0
- package/dist/src/gateway/service.js.map +1 -0
- package/dist/src/gateway/store.d.ts +340 -0
- package/dist/src/gateway/store.js +4047 -0
- package/dist/src/gateway/store.js.map +1 -0
- package/dist/src/gateway/types.d.ts +514 -0
- package/dist/src/gateway/types.js +414 -0
- package/dist/src/gateway/types.js.map +1 -0
- package/dist/src/mutex.d.ts +4 -0
- package/dist/src/mutex.js +23 -0
- package/dist/src/mutex.js.map +1 -0
- package/docs/DESIGN.md +134 -0
- package/docs/GATEWAY-ARCHITECTURE.md +858 -0
- package/package.json +80 -0
- package/skills/embassy-peer/SKILL.md +198 -0
- package/skills/embassy-peer/agents/openai.yaml +4 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { type CompatibilityCertificationDepth, type CompatibilityTier, type CompatibilitySurface } from "./compatibility.js";
|
|
2
|
+
import type { AlertSeverity, CompatibilityState, ConnectorHealth, DeliveryState, GatewayProvider, GatewayPublicSnapshot, MessageDirection, PublicAvailablePeerState, RouteCounters, RouteState } from "./types.js";
|
|
3
|
+
export declare const DASHBOARD_MODEL_LIMITS: Readonly<{
|
|
4
|
+
readonly connectors: 16;
|
|
5
|
+
readonly availablePeers: 64;
|
|
6
|
+
readonly routes: 128;
|
|
7
|
+
readonly pairs: 64;
|
|
8
|
+
readonly messages: 50;
|
|
9
|
+
readonly messageEvents: 60;
|
|
10
|
+
readonly progressWatches: 64;
|
|
11
|
+
readonly progressWatchEvents: 64;
|
|
12
|
+
readonly activityEvents: 64;
|
|
13
|
+
readonly alerts: 32;
|
|
14
|
+
}>;
|
|
15
|
+
export type DashboardTone = "good" | "info" | "warning" | "danger" | "quiet";
|
|
16
|
+
export type DashboardNextAction = "discover_claude" | "select_claude" | "pair_routes" | "restore_claude" | "repair_claude_inventory" | "register_codex" | "restore_codex" | "none";
|
|
17
|
+
export type DashboardExchangeParty = Readonly<{
|
|
18
|
+
kind: "claude" | "codex";
|
|
19
|
+
status: "ready" | "busy" | "waiting" | "missing" | "attention";
|
|
20
|
+
total: number;
|
|
21
|
+
ready: number;
|
|
22
|
+
selectable?: number | undefined;
|
|
23
|
+
countIsLowerBound: boolean;
|
|
24
|
+
primaryAlias?: string | undefined;
|
|
25
|
+
nextAction: DashboardNextAction;
|
|
26
|
+
}>;
|
|
27
|
+
export type DashboardAttentionItem = Readonly<{
|
|
28
|
+
kind: "alert" | "route" | "connector" | "broker" | "watch";
|
|
29
|
+
code?: string | undefined;
|
|
30
|
+
severity: AlertSeverity;
|
|
31
|
+
timestamp?: string | undefined;
|
|
32
|
+
provider?: GatewayProvider | undefined;
|
|
33
|
+
alias?: string | undefined;
|
|
34
|
+
host?: string | undefined;
|
|
35
|
+
guidance: "reobserve_claude" | "reobserve_codex" | "claude_not_observed" | "codex_stale" | "connector_offline" | "route_stale" | "queue_stalled" | "unconfirmed" | "degraded" | "codex_succession_busy" | "codex_succession_recovery" | "progress_watch" | "generic";
|
|
36
|
+
}>;
|
|
37
|
+
export type DashboardProgressWatchRow = Readonly<{
|
|
38
|
+
conversationIdSuffix: string;
|
|
39
|
+
ownerAlias: string;
|
|
40
|
+
workerAlias: string;
|
|
41
|
+
phase: "quiet" | "episode";
|
|
42
|
+
capability: "conversation" | "route";
|
|
43
|
+
lastActivityAt: string;
|
|
44
|
+
nextActionAt: string;
|
|
45
|
+
idleMs: number;
|
|
46
|
+
idleForMs: number;
|
|
47
|
+
dueInMs: number;
|
|
48
|
+
nudgeCount: 0 | 1 | 2;
|
|
49
|
+
workerReportedComplete: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
export type DashboardProgressWatchEventRow = Readonly<{
|
|
52
|
+
sequence: number;
|
|
53
|
+
timestamp: string;
|
|
54
|
+
conversationIdSuffix: string;
|
|
55
|
+
ownerAlias: string;
|
|
56
|
+
workerAlias: string;
|
|
57
|
+
kind: "opened" | "nudge" | "worker_reported_complete" | "capability_degraded" | "done" | "unresponsive" | "endpoint_retired" | "disabled";
|
|
58
|
+
nudgeNumber?: 1 | 2 | undefined;
|
|
59
|
+
}>;
|
|
60
|
+
export type DashboardMessageEvent = Readonly<{
|
|
61
|
+
sequence: number;
|
|
62
|
+
timestamp?: string | undefined;
|
|
63
|
+
state: DeliveryState;
|
|
64
|
+
latencyMs?: number | undefined;
|
|
65
|
+
safeErrorCode?: string | undefined;
|
|
66
|
+
conversationIdSuffix?: string | undefined;
|
|
67
|
+
steer?: true | undefined;
|
|
68
|
+
}>;
|
|
69
|
+
export type DashboardMessageGroup = Readonly<{
|
|
70
|
+
direction: MessageDirection;
|
|
71
|
+
sourceAlias: string;
|
|
72
|
+
targetAlias: string;
|
|
73
|
+
messageIdSuffix?: string | undefined;
|
|
74
|
+
conversationIdSuffix?: string | undefined;
|
|
75
|
+
state: DeliveryState;
|
|
76
|
+
timestamp?: string | undefined;
|
|
77
|
+
latencyMs?: number | undefined;
|
|
78
|
+
bytes: number;
|
|
79
|
+
safeErrorCode?: string | undefined;
|
|
80
|
+
steer?: true | undefined;
|
|
81
|
+
events: readonly DashboardMessageEvent[];
|
|
82
|
+
}>;
|
|
83
|
+
export type DashboardActivityEventRow = Readonly<{
|
|
84
|
+
sequence: number;
|
|
85
|
+
timestamp: string;
|
|
86
|
+
kind: "discovery" | "selection" | "registration" | "pairing" | "watch";
|
|
87
|
+
action: "discovery_refreshed" | "claude_selected" | "claude_unselected" | "codex_registered" | "codex_succeeded" | "codex_unregistered" | "routes_paired" | "routes_unpaired" | "watch_ended";
|
|
88
|
+
outcome: "accepted" | "rejected";
|
|
89
|
+
aliases: readonly string[];
|
|
90
|
+
safeErrorCode?: string | undefined;
|
|
91
|
+
}>;
|
|
92
|
+
export type DashboardPeerRow = Readonly<{
|
|
93
|
+
alias: string;
|
|
94
|
+
host: string;
|
|
95
|
+
state: PublicAvailablePeerState;
|
|
96
|
+
compatibility: CompatibilityState;
|
|
97
|
+
validated: boolean;
|
|
98
|
+
selected: boolean;
|
|
99
|
+
selectable: boolean;
|
|
100
|
+
selectionGuidance?: "alias_collision" | "session_collision" | "discovery_incomplete" | "incompatible" | "offline" | undefined;
|
|
101
|
+
lastSeenAt?: string | undefined;
|
|
102
|
+
safeErrorCode?: string | undefined;
|
|
103
|
+
}>;
|
|
104
|
+
export type DashboardRouteRow = Readonly<{
|
|
105
|
+
alias: string;
|
|
106
|
+
provider: GatewayProvider;
|
|
107
|
+
host: string;
|
|
108
|
+
enabled: boolean;
|
|
109
|
+
state: RouteState;
|
|
110
|
+
compatibility: CompatibilityState;
|
|
111
|
+
queueDepth: number;
|
|
112
|
+
oldestQueuedAt?: string | undefined;
|
|
113
|
+
queueAgeMs?: number | undefined;
|
|
114
|
+
counters: RouteCounters;
|
|
115
|
+
lastSeenAt?: string | undefined;
|
|
116
|
+
safeErrorCode?: string | undefined;
|
|
117
|
+
}>;
|
|
118
|
+
export type DashboardPairRow = Readonly<{
|
|
119
|
+
claudeAlias: string;
|
|
120
|
+
codexAlias: string;
|
|
121
|
+
host: string;
|
|
122
|
+
state: "ready" | "degraded" | "unavailable";
|
|
123
|
+
counters: RouteCounters;
|
|
124
|
+
}>;
|
|
125
|
+
export type DashboardGraphFacts = Readonly<{
|
|
126
|
+
pairCount: number;
|
|
127
|
+
readyPairCount: number;
|
|
128
|
+
pairCountIsLowerBound: boolean;
|
|
129
|
+
unpairedReadyClaude: number;
|
|
130
|
+
unpairedReadyCodex: number;
|
|
131
|
+
}>;
|
|
132
|
+
export type DashboardConnectorRow = Readonly<{
|
|
133
|
+
provider: GatewayProvider;
|
|
134
|
+
host: string;
|
|
135
|
+
health: ConnectorHealth;
|
|
136
|
+
compatibility: CompatibilityState;
|
|
137
|
+
protocol?: string | undefined;
|
|
138
|
+
protocolVersion?: string | undefined;
|
|
139
|
+
lastSeenAt?: string | undefined;
|
|
140
|
+
safeErrorCode?: string | undefined;
|
|
141
|
+
}>;
|
|
142
|
+
export type DashboardCompatibilityCheckRow = Readonly<{
|
|
143
|
+
surface: CompatibilitySurface;
|
|
144
|
+
version: string;
|
|
145
|
+
tier: CompatibilityTier;
|
|
146
|
+
checkedAt: string;
|
|
147
|
+
certificationDepth?: CompatibilityCertificationDepth | undefined;
|
|
148
|
+
certificationOutcome?: "pass" | "fail" | undefined;
|
|
149
|
+
certifiedAt?: string | undefined;
|
|
150
|
+
certificationSafeErrorCode?: string | undefined;
|
|
151
|
+
failedProbe?: string | undefined;
|
|
152
|
+
safeErrorCode?: string | undefined;
|
|
153
|
+
}>;
|
|
154
|
+
export type DashboardOmissions = Readonly<{
|
|
155
|
+
connectors: number;
|
|
156
|
+
availablePeers: number;
|
|
157
|
+
routes: number;
|
|
158
|
+
pairs: number;
|
|
159
|
+
progressWatches: number;
|
|
160
|
+
upstreamProgressWatchEvents: number;
|
|
161
|
+
progressWatchEvents: number;
|
|
162
|
+
upstreamMessageEvents: number;
|
|
163
|
+
messageGroups: number;
|
|
164
|
+
messageEvents: number;
|
|
165
|
+
upstreamAlerts: number;
|
|
166
|
+
attentionItems: number;
|
|
167
|
+
upstreamActivityEvents: number;
|
|
168
|
+
activityEvents: number;
|
|
169
|
+
}>;
|
|
170
|
+
export type DashboardViewModel = Readonly<{
|
|
171
|
+
schemaVersion: 1;
|
|
172
|
+
generatedAt?: string | undefined;
|
|
173
|
+
inboundMode: "paired" | "open";
|
|
174
|
+
health: ConnectorHealth;
|
|
175
|
+
overall: "ready" | "setup" | "attention";
|
|
176
|
+
exchange: Readonly<{
|
|
177
|
+
claude: DashboardExchangeParty;
|
|
178
|
+
codex: DashboardExchangeParty;
|
|
179
|
+
queuedMessages: number;
|
|
180
|
+
queueCountIsLowerBound: boolean;
|
|
181
|
+
oldestQueueAgeMs?: number | undefined;
|
|
182
|
+
oldestQueuedAt?: string | undefined;
|
|
183
|
+
}>;
|
|
184
|
+
attention: readonly DashboardAttentionItem[];
|
|
185
|
+
transit: Readonly<{
|
|
186
|
+
queuedMessages: number;
|
|
187
|
+
activeDeliveries: number;
|
|
188
|
+
queueCountIsLowerBound: boolean;
|
|
189
|
+
activeCountIsLowerBound: boolean;
|
|
190
|
+
oldestQueueAgeMs?: number | undefined;
|
|
191
|
+
oldestQueuedAt?: string | undefined;
|
|
192
|
+
}>;
|
|
193
|
+
activity: readonly DashboardMessageGroup[];
|
|
194
|
+
brokerActivity: readonly DashboardActivityEventRow[];
|
|
195
|
+
peers: readonly DashboardPeerRow[];
|
|
196
|
+
routes: readonly DashboardRouteRow[];
|
|
197
|
+
pairs: readonly DashboardPairRow[];
|
|
198
|
+
watches: readonly DashboardProgressWatchRow[];
|
|
199
|
+
watchEvents: readonly DashboardProgressWatchEventRow[];
|
|
200
|
+
graph: DashboardGraphFacts;
|
|
201
|
+
connectors: readonly DashboardConnectorRow[];
|
|
202
|
+
compatibilityChecks: readonly DashboardCompatibilityCheckRow[];
|
|
203
|
+
accounting: GatewayPublicSnapshot["accounting"];
|
|
204
|
+
deadlinePressure?: GatewayPublicSnapshot["deadlinePressure"];
|
|
205
|
+
omissions: DashboardOmissions;
|
|
206
|
+
}>;
|
|
207
|
+
export declare function buildDashboardViewModel(snapshot: GatewayPublicSnapshot): DashboardViewModel;
|