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.
Files changed (145) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/CONTRIBUTING.md +122 -0
  3. package/LICENSE +21 -0
  4. package/README.md +185 -0
  5. package/README.zh-CN.md +185 -0
  6. package/SECURITY.md +224 -0
  7. package/assets/live-dashboard/app.css +1610 -0
  8. package/assets/mark-seal.svg +7 -0
  9. package/assets/mark.svg +7 -0
  10. package/assets/social-preview.png +0 -0
  11. package/assets/vendor/react/LICENSE +21 -0
  12. package/assets/vendor/react/react-dom.production.min.js +267 -0
  13. package/assets/vendor/react/react.production.min.js +31 -0
  14. package/dist/src/errors.d.ts +5 -0
  15. package/dist/src/errors.js +11 -0
  16. package/dist/src/errors.js.map +1 -0
  17. package/dist/src/gateway/claude-compatibility-scratch.d.ts +18 -0
  18. package/dist/src/gateway/claude-compatibility-scratch.js +158 -0
  19. package/dist/src/gateway/claude-compatibility-scratch.js.map +1 -0
  20. package/dist/src/gateway/claude-helper-client.d.ts +43 -0
  21. package/dist/src/gateway/claude-helper-client.js +212 -0
  22. package/dist/src/gateway/claude-helper-client.js.map +1 -0
  23. package/dist/src/gateway/claude-helper-protocol.d.ts +172 -0
  24. package/dist/src/gateway/claude-helper-protocol.js +373 -0
  25. package/dist/src/gateway/claude-helper-protocol.js.map +1 -0
  26. package/dist/src/gateway/claude-helper-supervisor.d.ts +74 -0
  27. package/dist/src/gateway/claude-helper-supervisor.js +497 -0
  28. package/dist/src/gateway/claude-helper-supervisor.js.map +1 -0
  29. package/dist/src/gateway/claude-helper.d.ts +1 -0
  30. package/dist/src/gateway/claude-helper.js +269 -0
  31. package/dist/src/gateway/claude-helper.js.map +1 -0
  32. package/dist/src/gateway/claude-peer.d.ts +273 -0
  33. package/dist/src/gateway/claude-peer.js +2359 -0
  34. package/dist/src/gateway/claude-peer.js.map +1 -0
  35. package/dist/src/gateway/claude-runtime.d.ts +40 -0
  36. package/dist/src/gateway/claude-runtime.js +302 -0
  37. package/dist/src/gateway/claude-runtime.js.map +1 -0
  38. package/dist/src/gateway/cli-copy.d.ts +8 -0
  39. package/dist/src/gateway/cli-copy.en.d.ts +13 -0
  40. package/dist/src/gateway/cli-copy.en.js +43 -0
  41. package/dist/src/gateway/cli-copy.en.js.map +1 -0
  42. package/dist/src/gateway/cli-copy.js +19 -0
  43. package/dist/src/gateway/cli-copy.js.map +1 -0
  44. package/dist/src/gateway/cli-copy.zh-CN.d.ts +13 -0
  45. package/dist/src/gateway/cli-copy.zh-CN.js +43 -0
  46. package/dist/src/gateway/cli-copy.zh-CN.js.map +1 -0
  47. package/dist/src/gateway/cli.d.ts +44 -0
  48. package/dist/src/gateway/cli.js +969 -0
  49. package/dist/src/gateway/cli.js.map +1 -0
  50. package/dist/src/gateway/codex-app-server.d.ts +310 -0
  51. package/dist/src/gateway/codex-app-server.js +1746 -0
  52. package/dist/src/gateway/codex-app-server.js.map +1 -0
  53. package/dist/src/gateway/codex-local-transport.d.ts +81 -0
  54. package/dist/src/gateway/codex-local-transport.js +617 -0
  55. package/dist/src/gateway/codex-local-transport.js.map +1 -0
  56. package/dist/src/gateway/codex-registration-generation.d.ts +5 -0
  57. package/dist/src/gateway/codex-registration-generation.js +19 -0
  58. package/dist/src/gateway/codex-registration-generation.js.map +1 -0
  59. package/dist/src/gateway/codex-registration-succession.d.ts +209 -0
  60. package/dist/src/gateway/codex-registration-succession.js +588 -0
  61. package/dist/src/gateway/codex-registration-succession.js.map +1 -0
  62. package/dist/src/gateway/compatibility.d.ts +70 -0
  63. package/dist/src/gateway/compatibility.js +252 -0
  64. package/dist/src/gateway/compatibility.js.map +1 -0
  65. package/dist/src/gateway/config.d.ts +24 -0
  66. package/dist/src/gateway/config.js +130 -0
  67. package/dist/src/gateway/config.js.map +1 -0
  68. package/dist/src/gateway/control.d.ts +308 -0
  69. package/dist/src/gateway/control.js +1573 -0
  70. package/dist/src/gateway/control.js.map +1 -0
  71. package/dist/src/gateway/dashboard-copy.d.ts +7 -0
  72. package/dist/src/gateway/dashboard-copy.en.d.ts +506 -0
  73. package/dist/src/gateway/dashboard-copy.en.js +507 -0
  74. package/dist/src/gateway/dashboard-copy.en.js.map +1 -0
  75. package/dist/src/gateway/dashboard-copy.js +516 -0
  76. package/dist/src/gateway/dashboard-copy.js.map +1 -0
  77. package/dist/src/gateway/dashboard-copy.zh-CN.d.ts +506 -0
  78. package/dist/src/gateway/dashboard-copy.zh-CN.js +507 -0
  79. package/dist/src/gateway/dashboard-copy.zh-CN.js.map +1 -0
  80. package/dist/src/gateway/dashboard-model.d.ts +207 -0
  81. package/dist/src/gateway/dashboard-model.js +720 -0
  82. package/dist/src/gateway/dashboard-model.js.map +1 -0
  83. package/dist/src/gateway/dashboard.d.ts +26 -0
  84. package/dist/src/gateway/dashboard.js +941 -0
  85. package/dist/src/gateway/dashboard.js.map +1 -0
  86. package/dist/src/gateway/delivery-machine.d.ts +235 -0
  87. package/dist/src/gateway/delivery-machine.js +540 -0
  88. package/dist/src/gateway/delivery-machine.js.map +1 -0
  89. package/dist/src/gateway/instance-lease.d.ts +21 -0
  90. package/dist/src/gateway/instance-lease.js +549 -0
  91. package/dist/src/gateway/instance-lease.js.map +1 -0
  92. package/dist/src/gateway/live-dashboard-app/app.js +2914 -0
  93. package/dist/src/gateway/live-dashboard-assets.d.ts +10 -0
  94. package/dist/src/gateway/live-dashboard-assets.js +73 -0
  95. package/dist/src/gateway/live-dashboard-assets.js.map +1 -0
  96. package/dist/src/gateway/live-dashboard-bootstrap.d.ts +36 -0
  97. package/dist/src/gateway/live-dashboard-bootstrap.js +176 -0
  98. package/dist/src/gateway/live-dashboard-bootstrap.js.map +1 -0
  99. package/dist/src/gateway/live-dashboard-command.d.ts +54 -0
  100. package/dist/src/gateway/live-dashboard-command.js +324 -0
  101. package/dist/src/gateway/live-dashboard-command.js.map +1 -0
  102. package/dist/src/gateway/live-dashboard-http.d.ts +41 -0
  103. package/dist/src/gateway/live-dashboard-http.js +445 -0
  104. package/dist/src/gateway/live-dashboard-http.js.map +1 -0
  105. package/dist/src/gateway/live-dashboard-protocol.d.ts +38 -0
  106. package/dist/src/gateway/live-dashboard-protocol.js +156 -0
  107. package/dist/src/gateway/live-dashboard-protocol.js.map +1 -0
  108. package/dist/src/gateway/live-dashboard-server.d.ts +33 -0
  109. package/dist/src/gateway/live-dashboard-server.js +130 -0
  110. package/dist/src/gateway/live-dashboard-server.js.map +1 -0
  111. package/dist/src/gateway/live-dashboard-stream.d.ts +46 -0
  112. package/dist/src/gateway/live-dashboard-stream.js +233 -0
  113. package/dist/src/gateway/live-dashboard-stream.js.map +1 -0
  114. package/dist/src/gateway/live-dashboard.d.ts +31 -0
  115. package/dist/src/gateway/live-dashboard.js +190 -0
  116. package/dist/src/gateway/live-dashboard.js.map +1 -0
  117. package/dist/src/gateway/locale.d.ts +4 -0
  118. package/dist/src/gateway/locale.js +10 -0
  119. package/dist/src/gateway/locale.js.map +1 -0
  120. package/dist/src/gateway/progress-watch-machine.d.ts +97 -0
  121. package/dist/src/gateway/progress-watch-machine.js +172 -0
  122. package/dist/src/gateway/progress-watch-machine.js.map +1 -0
  123. package/dist/src/gateway/providers.d.ts +287 -0
  124. package/dist/src/gateway/providers.js +2451 -0
  125. package/dist/src/gateway/providers.js.map +1 -0
  126. package/dist/src/gateway/server.d.ts +57 -0
  127. package/dist/src/gateway/server.js +264 -0
  128. package/dist/src/gateway/server.js.map +1 -0
  129. package/dist/src/gateway/service.d.ts +449 -0
  130. package/dist/src/gateway/service.js +4831 -0
  131. package/dist/src/gateway/service.js.map +1 -0
  132. package/dist/src/gateway/store.d.ts +340 -0
  133. package/dist/src/gateway/store.js +4047 -0
  134. package/dist/src/gateway/store.js.map +1 -0
  135. package/dist/src/gateway/types.d.ts +514 -0
  136. package/dist/src/gateway/types.js +414 -0
  137. package/dist/src/gateway/types.js.map +1 -0
  138. package/dist/src/mutex.d.ts +4 -0
  139. package/dist/src/mutex.js +23 -0
  140. package/dist/src/mutex.js.map +1 -0
  141. package/docs/DESIGN.md +134 -0
  142. package/docs/GATEWAY-ARCHITECTURE.md +858 -0
  143. package/package.json +80 -0
  144. package/skills/embassy-peer/SKILL.md +198 -0
  145. 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;