agent-embassy 1.0.0 → 1.2.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 (73) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +50 -5
  3. package/README.zh-CN.md +32 -5
  4. package/SECURITY.md +26 -2
  5. package/assets/live-dashboard/app.css +14 -5
  6. package/dist/src/gateway/claude-helper-protocol.d.ts +3 -0
  7. package/dist/src/gateway/claude-helper-protocol.js +15 -1
  8. package/dist/src/gateway/claude-helper-protocol.js.map +1 -1
  9. package/dist/src/gateway/claude-helper-supervisor.d.ts +2 -0
  10. package/dist/src/gateway/claude-helper-supervisor.js +25 -1
  11. package/dist/src/gateway/claude-helper-supervisor.js.map +1 -1
  12. package/dist/src/gateway/cli-copy.en.d.ts +1 -0
  13. package/dist/src/gateway/cli-copy.en.js +1 -0
  14. package/dist/src/gateway/cli-copy.en.js.map +1 -1
  15. package/dist/src/gateway/cli-copy.zh-CN.d.ts +1 -0
  16. package/dist/src/gateway/cli-copy.zh-CN.js +1 -0
  17. package/dist/src/gateway/cli-copy.zh-CN.js.map +1 -1
  18. package/dist/src/gateway/cli.d.ts +1 -1
  19. package/dist/src/gateway/cli.js +20 -7
  20. package/dist/src/gateway/cli.js.map +1 -1
  21. package/dist/src/gateway/codex-app-server.js +6 -2
  22. package/dist/src/gateway/codex-app-server.js.map +1 -1
  23. package/dist/src/gateway/codex-local-transport.d.ts +13 -0
  24. package/dist/src/gateway/codex-local-transport.js +21 -2
  25. package/dist/src/gateway/codex-local-transport.js.map +1 -1
  26. package/dist/src/gateway/config.js +5 -3
  27. package/dist/src/gateway/config.js.map +1 -1
  28. package/dist/src/gateway/control.d.ts +11 -1
  29. package/dist/src/gateway/control.js +48 -14
  30. package/dist/src/gateway/control.js.map +1 -1
  31. package/dist/src/gateway/dashboard-copy.d.ts +1 -1
  32. package/dist/src/gateway/dashboard-copy.en.d.ts +6 -0
  33. package/dist/src/gateway/dashboard-copy.en.js +11 -5
  34. package/dist/src/gateway/dashboard-copy.en.js.map +1 -1
  35. package/dist/src/gateway/dashboard-copy.js +6 -0
  36. package/dist/src/gateway/dashboard-copy.js.map +1 -1
  37. package/dist/src/gateway/dashboard-copy.zh-CN.d.ts +6 -0
  38. package/dist/src/gateway/dashboard-copy.zh-CN.js +11 -5
  39. package/dist/src/gateway/dashboard-copy.zh-CN.js.map +1 -1
  40. package/dist/src/gateway/dashboard-model.d.ts +4 -2
  41. package/dist/src/gateway/dashboard-model.js +6 -0
  42. package/dist/src/gateway/dashboard-model.js.map +1 -1
  43. package/dist/src/gateway/dashboard.js +5 -3
  44. package/dist/src/gateway/dashboard.js.map +1 -1
  45. package/dist/src/gateway/live-dashboard-app/app.js +48 -10
  46. package/dist/src/gateway/live-dashboard-command.js +10 -0
  47. package/dist/src/gateway/live-dashboard-command.js.map +1 -1
  48. package/dist/src/gateway/live-dashboard-http.d.ts +3 -0
  49. package/dist/src/gateway/live-dashboard-http.js +13 -0
  50. package/dist/src/gateway/live-dashboard-http.js.map +1 -1
  51. package/dist/src/gateway/live-dashboard-stream.js +26 -25
  52. package/dist/src/gateway/live-dashboard-stream.js.map +1 -1
  53. package/dist/src/gateway/provenance-envelope.d.ts +16 -0
  54. package/dist/src/gateway/provenance-envelope.js +80 -0
  55. package/dist/src/gateway/provenance-envelope.js.map +1 -0
  56. package/dist/src/gateway/providers.d.ts +43 -16
  57. package/dist/src/gateway/providers.js +688 -61
  58. package/dist/src/gateway/providers.js.map +1 -1
  59. package/dist/src/gateway/server.d.ts +2 -0
  60. package/dist/src/gateway/server.js +9 -3
  61. package/dist/src/gateway/server.js.map +1 -1
  62. package/dist/src/gateway/service.d.ts +102 -10
  63. package/dist/src/gateway/service.js +1309 -54
  64. package/dist/src/gateway/service.js.map +1 -1
  65. package/dist/src/gateway/store.d.ts +39 -3
  66. package/dist/src/gateway/store.js +528 -26
  67. package/dist/src/gateway/store.js.map +1 -1
  68. package/dist/src/gateway/types.d.ts +90 -5
  69. package/dist/src/gateway/types.js +6 -0
  70. package/dist/src/gateway/types.js.map +1 -1
  71. package/docs/GATEWAY-ARCHITECTURE.md +98 -11
  72. package/package.json +3 -2
  73. package/skills/embassy-peer/SKILL.md +15 -1
@@ -1,7 +1,7 @@
1
1
  import { type CompatibilityAttestation, type CompatibilitySurface } from "./compatibility.js";
2
2
  import type { GatewayConfig } from "./config.js";
3
3
  import { type ProgressWatchMachine, type ProgressWatchOutcome } from "./progress-watch-machine.js";
4
- import { type DeliveryState, type EnqueueMessageInput, type EnqueueMessageResult, type EnqueueNativeIngressInput, type EnqueueNativeReplyInput, type GatewayPrivateRouteInspection, type GatewayPublicSnapshot, type GatewayStoreDependencies, type InFlightMessageProgressState, type ObserveConnectorInput, type ObserveRouteInput, type PrivateEndpointIdentity, type PrivateRouteBinding, type RebindStaleRouteInput, type RegisterRouteInput, type RequeueInFlightMessageResult, type SettleMessageInput, type SettleMessageResult, type TerminalMessageSettlement, type TransientQueuedMessage } from "./types.js";
4
+ import { type DeliveryState, type EnqueueMessageInput, type EnqueueMessageResult, type EnqueueNativeIngressInput, type EnqueueNativeReplyInput, type GatewayPrivateRouteInspection, type GatewayPublicSnapshot, type GatewayStoreDependencies, type InFlightMessageProgressState, type ObserveConnectorInput, type ObserveRouteInput, type PrivateEndpointIdentity, type PrivateRouteBinding, type ReanchorCodexRoutesInput, type ReanchorCodexRoutesResult, type RebindStaleRouteInput, type RegisterRouteInput, type RequeueInFlightMessageResult, type RemoveStaleCodexOrphanInput, type RemoveStaleCodexOrphanResult, type SettleMessageInput, type SettleMessageResult, type StaleCodexOrphanRemovalAuthority, type StaleCodexOrphanRemovalCommitProofInput, type TerminalMessageSettlement, type TransientQueuedMessage } from "./types.js";
5
5
  export declare const GATEWAY_MAX_STATE_FILE_BYTES: number;
6
6
  export type OpenProgressWatchInput = Readonly<{
7
7
  conversationId: string;
@@ -138,7 +138,9 @@ export declare class GatewayStore {
138
138
  commitInitialization(): Promise<void>;
139
139
  close(): Promise<void>;
140
140
  observeConnector(input: ObserveConnectorInput): Promise<void>;
141
- markConnectorOffline(identity: PrivateEndpointIdentity, safeErrorCode?: string, inFlightSettlements?: readonly RouteInFlightSettlementInput[]): Promise<TerminalMessageSettlement[]>;
141
+ markConnectorOffline(identity: PrivateEndpointIdentity, safeErrorCode?: string, inFlightSettlements?: readonly RouteInFlightSettlementInput[], options?: Readonly<{
142
+ preserveQueued?: boolean;
143
+ }>): Promise<TerminalMessageSettlement[]>;
142
144
  registerRoute(input: RegisterRouteInput): Promise<void>;
143
145
  /**
144
146
  * Replace the complete selected-Claude set with one exact live session in a
@@ -156,6 +158,17 @@ export declare class GatewayStore {
156
158
  * display name. Names alone are never rebind authority.
157
159
  */
158
160
  rebindStaleRoute(input: RebindStaleRouteInput): Promise<void>;
161
+ /**
162
+ * Atomically re-anchor only the exact Codex tasks proved present on a newly
163
+ * compatible App Server generation. Omitted stale tasks stay untouched.
164
+ */
165
+ reanchorCodexRoutes(input: ReanchorCodexRoutesInput): Promise<ReanchorCodexRoutesResult>;
166
+ /**
167
+ * Dashboard recovery primitive for one abandoned Codex registration. The
168
+ * alias is only authority to request evaluation; durable state must prove
169
+ * the task is empty, stale, expired, and on a dead or superseded generation.
170
+ */
171
+ removeStaleCodexOrphan(input: RemoveStaleCodexOrphanInput): Promise<RemoveStaleCodexOrphanResult>;
159
172
  disableRoute(alias: string, ownerLease: string, inFlightSettlements?: readonly RouteInFlightSettlementInput[]): Promise<TerminalMessageSettlement[]>;
160
173
  unregisterRoute(alias: string, ownerLease: string, inFlightSettlements?: readonly RouteInFlightSettlementInput[]): Promise<TerminalMessageSettlement[]>;
161
174
  /**
@@ -172,6 +185,23 @@ export declare class GatewayStore {
172
185
  * control response, dashboard projection, log, or normalized event.
173
186
  */
174
187
  inspectPrivateRoute(alias: string): Promise<GatewayPrivateRouteInspection | undefined>;
188
+ /**
189
+ * Read-only preflight for service-side provider cleanup. Removal repeats the
190
+ * identical proof atomically so no intervening state change can authorize it.
191
+ */
192
+ inspectStaleCodexOrphan(alias: string): Promise<PrivateRouteBinding>;
193
+ /**
194
+ * Capture the exact pre-mutation authority needed to reconcile a possible
195
+ * post-rename orphan-removal commit. This value remains controller-private.
196
+ */
197
+ inspectStaleCodexOrphanRemovalAuthority(alias: string): Promise<StaleCodexOrphanRemovalAuthority>;
198
+ /**
199
+ * Fail-closed reconciliation for one exact removal whose durable rename may
200
+ * have committed before a directory-sync error. The latest private journal
201
+ * row, monotonic predecessor, alias absence, and native authority absence
202
+ * must all corroborate the same mutation.
203
+ */
204
+ wasStaleCodexOrphanRemovalCommitted(input: StaleCodexOrphanRemovalCommitProofInput): Promise<boolean>;
175
205
  /**
176
206
  * Controller-internal inventory used to preserve exact Codex registration
177
207
  * identities across restart. Native task handles never cross the control
@@ -266,6 +296,8 @@ export declare class GatewayStore {
266
296
  */
267
297
  enqueueNativeReply(input: EnqueueNativeReplyInput): Promise<EnqueueMessageResult>;
268
298
  dequeueMessage(targetAlias?: string, mode?: "any" | "steer_only"): Promise<TransientQueuedMessage | undefined>;
299
+ /** Controller-private shutdown inventory; full IDs never cross control output. */
300
+ inspectQueuedMessageIds(): Promise<string[]>;
269
301
  /**
270
302
  * Atomically terminalizes every message whose delivery deadline is due.
271
303
  * Returned settlements are emitted only by the mutation that removed the
@@ -278,7 +310,7 @@ export declare class GatewayStore {
278
310
  */
279
311
  expireDueMessages(now?: Date): Promise<TerminalMessageSettlement[]>;
280
312
  settleMessage(input: SettleMessageInput): Promise<SettleMessageResult>;
281
- requeueInFlightMessage(messageId: string, body: string): Promise<RequeueInFlightMessageResult>;
313
+ requeueInFlightMessage(messageId: string, body: string, safeErrorCode?: string): Promise<RequeueInFlightMessageResult>;
282
314
  markMessageProgress(messageId: string, progress: InFlightMessageProgressState): Promise<void>;
283
315
  /**
284
316
  * Atomically terminalize one queued message and return the authoritative
@@ -305,6 +337,7 @@ export declare class GatewayStore {
305
337
  private requireCompatibleObservedEndpoint;
306
338
  private validateRouteInput;
307
339
  private requireOwnedRoute;
340
+ private requireStaleCodexOrphan;
308
341
  private requireAvailableRoute;
309
342
  private requirePairRoutes;
310
343
  private requireExactPair;
@@ -313,6 +346,9 @@ export declare class GatewayStore {
313
346
  private consumeRateLimit;
314
347
  private recordRejection;
315
348
  private appendEvent;
349
+ private pruneRetainedEventBodies;
350
+ private appendCodexEndpointRefreshEvent;
351
+ private appendCodexOrphanRemovalEvent;
316
352
  /** Commit watch activity only after every message-admission check succeeds. */
317
353
  private applyProgressWatchMessageActivity;
318
354
  private progressWatchDueTransition;