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.
Files changed (118) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/CONTRIBUTING.md +51 -47
  3. package/README.md +26 -9
  4. package/README.zh-CN.md +22 -9
  5. package/SECURITY.md +48 -35
  6. package/dist/src/gateway/acp-client.d.ts +12 -19
  7. package/dist/src/gateway/acp-client.js +90 -65
  8. package/dist/src/gateway/acp-client.js.map +1 -1
  9. package/dist/src/gateway/acp-provider.d.ts +11 -10
  10. package/dist/src/gateway/acp-provider.js +165 -53
  11. package/dist/src/gateway/acp-provider.js.map +1 -1
  12. package/dist/src/gateway/claude-helper-client.d.ts +2 -43
  13. package/dist/src/gateway/claude-helper-client.js +1 -211
  14. package/dist/src/gateway/claude-helper-client.js.map +1 -1
  15. package/dist/src/gateway/claude-helper-protocol.d.ts +16 -74
  16. package/dist/src/gateway/claude-helper-protocol.js +99 -378
  17. package/dist/src/gateway/claude-helper-protocol.js.map +1 -1
  18. package/dist/src/gateway/claude-helper-supervisor.d.ts +56 -44
  19. package/dist/src/gateway/claude-helper-supervisor.js +265 -456
  20. package/dist/src/gateway/claude-helper-supervisor.js.map +1 -1
  21. package/dist/src/gateway/claude-helper.js +184 -210
  22. package/dist/src/gateway/claude-helper.js.map +1 -1
  23. package/dist/src/gateway/claude-peer.d.ts +20 -87
  24. package/dist/src/gateway/claude-peer.js +310 -1009
  25. package/dist/src/gateway/claude-peer.js.map +1 -1
  26. package/dist/src/gateway/claude-runtime.d.ts +13 -15
  27. package/dist/src/gateway/claude-runtime.js +14 -168
  28. package/dist/src/gateway/claude-runtime.js.map +1 -1
  29. package/dist/src/gateway/cli-copy.en.d.ts +2 -2
  30. package/dist/src/gateway/cli-copy.en.js +4 -2
  31. package/dist/src/gateway/cli-copy.en.js.map +1 -1
  32. package/dist/src/gateway/cli-copy.zh-CN.d.ts +2 -2
  33. package/dist/src/gateway/cli-copy.zh-CN.js +4 -2
  34. package/dist/src/gateway/cli-copy.zh-CN.js.map +1 -1
  35. package/dist/src/gateway/cli.d.ts +7 -2
  36. package/dist/src/gateway/cli.js +277 -575
  37. package/dist/src/gateway/cli.js.map +1 -1
  38. package/dist/src/gateway/codex-app-server.d.ts +5 -227
  39. package/dist/src/gateway/codex-app-server.js +18 -1463
  40. package/dist/src/gateway/codex-app-server.js.map +1 -1
  41. package/dist/src/gateway/codex-doctor.d.ts +36 -0
  42. package/dist/src/gateway/codex-doctor.js +127 -0
  43. package/dist/src/gateway/codex-doctor.js.map +1 -0
  44. package/dist/src/gateway/codex-local-transport.d.ts +6 -6
  45. package/dist/src/gateway/codex-local-transport.js +13 -10
  46. package/dist/src/gateway/codex-local-transport.js.map +1 -1
  47. package/dist/src/gateway/codex-stateless-transport.d.ts +114 -0
  48. package/dist/src/gateway/codex-stateless-transport.js +1108 -0
  49. package/dist/src/gateway/codex-stateless-transport.js.map +1 -0
  50. package/dist/src/gateway/config.d.ts +2 -9
  51. package/dist/src/gateway/config.js +62 -100
  52. package/dist/src/gateway/config.js.map +1 -1
  53. package/dist/src/gateway/control.d.ts +36 -90
  54. package/dist/src/gateway/control.js +465 -1123
  55. package/dist/src/gateway/control.js.map +1 -1
  56. package/dist/src/gateway/dashboard-copy.d.ts +1 -1
  57. package/dist/src/gateway/dashboard-copy.en.d.ts +8 -26
  58. package/dist/src/gateway/dashboard-copy.en.js +19 -37
  59. package/dist/src/gateway/dashboard-copy.en.js.map +1 -1
  60. package/dist/src/gateway/dashboard-copy.js +8 -26
  61. package/dist/src/gateway/dashboard-copy.js.map +1 -1
  62. package/dist/src/gateway/dashboard-copy.zh-CN.d.ts +8 -26
  63. package/dist/src/gateway/dashboard-copy.zh-CN.js +19 -37
  64. package/dist/src/gateway/dashboard-copy.zh-CN.js.map +1 -1
  65. package/dist/src/gateway/dashboard-model.d.ts +8 -22
  66. package/dist/src/gateway/dashboard-model.js +44 -130
  67. package/dist/src/gateway/dashboard-model.js.map +1 -1
  68. package/dist/src/gateway/dashboard.d.ts +0 -6
  69. package/dist/src/gateway/dashboard.js +3 -7
  70. package/dist/src/gateway/dashboard.js.map +1 -1
  71. package/dist/src/gateway/live-dashboard-app/app.js +20 -34
  72. package/dist/src/gateway/live-dashboard-command.js +2 -2
  73. package/dist/src/gateway/live-dashboard-command.js.map +1 -1
  74. package/dist/src/gateway/live-dashboard-http.d.ts +1 -1
  75. package/dist/src/gateway/live-dashboard-http.js +2 -2
  76. package/dist/src/gateway/live-dashboard-http.js.map +1 -1
  77. package/dist/src/gateway/progress-watch-machine.d.ts +1 -37
  78. package/dist/src/gateway/progress-watch-machine.js +4 -15
  79. package/dist/src/gateway/progress-watch-machine.js.map +1 -1
  80. package/dist/src/gateway/providers.d.ts +58 -191
  81. package/dist/src/gateway/providers.js +637 -2434
  82. package/dist/src/gateway/providers.js.map +1 -1
  83. package/dist/src/gateway/server.d.ts +16 -25
  84. package/dist/src/gateway/server.js +165 -240
  85. package/dist/src/gateway/server.js.map +1 -1
  86. package/dist/src/gateway/service.d.ts +149 -427
  87. package/dist/src/gateway/service.js +1639 -5662
  88. package/dist/src/gateway/service.js.map +1 -1
  89. package/dist/src/gateway/state-v2-to-v3.d.ts +23 -0
  90. package/dist/src/gateway/state-v2-to-v3.js +994 -0
  91. package/dist/src/gateway/state-v2-to-v3.js.map +1 -0
  92. package/dist/src/gateway/store.d.ts +54 -309
  93. package/dist/src/gateway/store.js +1560 -3510
  94. package/dist/src/gateway/store.js.map +1 -1
  95. package/dist/src/gateway/types.d.ts +181 -225
  96. package/dist/src/gateway/types.js +115 -251
  97. package/dist/src/gateway/types.js.map +1 -1
  98. package/docs/CONFIGURATION.md +22 -9
  99. package/docs/CONFIGURATION.zh-CN.md +21 -9
  100. package/docs/DASHBOARD.md +10 -10
  101. package/docs/DASHBOARD.zh-CN.md +3 -3
  102. package/docs/DELIVERY.md +4 -4
  103. package/docs/DELIVERY.zh-CN.md +4 -4
  104. package/docs/GATEWAY-ARCHITECTURE.md +158 -187
  105. package/package.json +1 -1
  106. package/skills/embassy-peer/SKILL.md +28 -22
  107. package/dist/src/gateway/codex-registration-generation.d.ts +0 -5
  108. package/dist/src/gateway/codex-registration-generation.js +0 -19
  109. package/dist/src/gateway/codex-registration-generation.js.map +0 -1
  110. package/dist/src/gateway/codex-registration-succession.d.ts +0 -209
  111. package/dist/src/gateway/codex-registration-succession.js +0 -588
  112. package/dist/src/gateway/codex-registration-succession.js.map +0 -1
  113. package/dist/src/gateway/compatibility.d.ts +0 -22
  114. package/dist/src/gateway/compatibility.js +0 -23
  115. package/dist/src/gateway/compatibility.js.map +0 -1
  116. package/dist/src/gateway/delivery-machine.d.ts +0 -235
  117. package/dist/src/gateway/delivery-machine.js +0 -540
  118. package/dist/src/gateway/delivery-machine.js.map +0 -1
@@ -1,12 +1,58 @@
1
+ import { type ChildProcess } from "node:child_process";
1
2
  import type { AttestedClaudePeerRuntime } from "./claude-runtime.js";
2
- import { type ClaudeNativeHelperFactory } from "./claude-helper-client.js";
3
3
  import type { GatewayDeliveryNoticeMode } from "./config.js";
4
4
  import type { DashboardLocale } from "./locale.js";
5
- import type { ClaudeNativeCodexSuccessionBarrier } from "./providers.js";
6
5
  import type { GatewayAdapterCallbacks, GatewayAdapterDispatchResult } from "./service.js";
7
- import { type GatewayProvider, type PrivateEndpointIdentity, type PrivateRouteBinding } from "./types.js";
6
+ import { type GatewayProvider, type LogicalRouteBinding } from "./types.js";
7
+ import { type ClaudeNativeHelperCommand, type ClaudeNativeHelperEvent, type ClaudeNativeHelperRegistration, type ClaudeNativeHelperResult } from "./claude-helper-protocol.js";
8
+ export type ClaudeNativeHelperClientCallbacks = Readonly<{
9
+ onEvent: (event: ClaudeNativeHelperEvent) => void;
10
+ onExit: (event: Readonly<{
11
+ code: number | null;
12
+ signal: NodeJS.Signals | null;
13
+ }>) => void;
14
+ }>;
15
+ export type ClaudeNativeHelperClientStartOptions = Readonly<{
16
+ entryPath?: string;
17
+ runtime: AttestedClaudePeerRuntime;
18
+ hostId: "this-mac";
19
+ locale: DashboardLocale;
20
+ deliveryNotices: GatewayDeliveryNoticeMode;
21
+ maxPendingMessages: number;
22
+ registration: ClaudeNativeHelperRegistration;
23
+ callbacks: ClaudeNativeHelperClientCallbacks;
24
+ }>;
25
+ export interface ClaudeNativeHelperClientLike {
26
+ readonly pid: number;
27
+ readonly registration: ClaudeNativeHelperRegistration;
28
+ generation: string;
29
+ request(command: ClaudeNativeHelperCommand, timeoutMs?: number): Promise<ClaudeNativeHelperResult>;
30
+ close(): Promise<void>;
31
+ forceClose(): Promise<void>;
32
+ }
33
+ export type ClaudeNativeHelperFactory = (options: ClaudeNativeHelperClientStartOptions) => Promise<ClaudeNativeHelperClientLike>;
34
+ export declare class ClaudeNativeHelperClient implements ClaudeNativeHelperClientLike {
35
+ #private;
36
+ readonly child: ChildProcess;
37
+ readonly callbacks: ClaudeNativeHelperClientCallbacks;
38
+ readonly pid: number;
39
+ readonly registration: ClaudeNativeHelperRegistration;
40
+ generation: string;
41
+ private constructor();
42
+ static start(options: ClaudeNativeHelperClientStartOptions): Promise<ClaudeNativeHelperClient>;
43
+ request(command: ClaudeNativeHelperCommand, timeoutMs?: number): Promise<ClaudeNativeHelperResult>;
44
+ close(): Promise<void>;
45
+ forceClose(): Promise<void>;
46
+ }
47
+ export declare const createClaudeNativeHelper: ClaudeNativeHelperFactory;
48
+ export type ClaudeNativeHelperPreparedDispatch = Readonly<{
49
+ frameBytes: number;
50
+ sha256: string;
51
+ perform: () => Promise<GatewayAdapterDispatchResult>;
52
+ cancel: () => Promise<void>;
53
+ }>;
8
54
  export type ClaudeNativeHelperSupervisorOptions = Readonly<{
9
- identity: PrivateEndpointIdentity;
55
+ identity: Pick<LogicalRouteBinding, "provider" | "hostId">;
10
56
  runtime: AttestedClaudePeerRuntime;
11
57
  locale: DashboardLocale;
12
58
  deliveryNotices: GatewayDeliveryNoticeMode;
@@ -17,63 +63,29 @@ export type ClaudeNativeHelperSupervisorOptions = Readonly<{
17
63
  }>;
18
64
  export declare class ClaudeNativeHelperSupervisor {
19
65
  #private;
66
+ readonly options: ClaudeNativeHelperSupervisorOptions;
20
67
  constructor(options: ClaudeNativeHelperSupervisorOptions);
21
68
  get size(): number;
22
- advertise(input: Readonly<{
23
- alias: string;
24
- sourceProvider: GatewayProvider;
25
- cwd: string;
26
- }>): Promise<void>;
27
- currentGeneration(alias: string): string;
69
+ advertise(input: ClaudeNativeHelperRegistration): Promise<void>;
28
70
  updateStatus(alias: string, status: "idle" | "busy" | "waiting"): Promise<void>;
29
71
  unadvertise(alias: string): Promise<void>;
30
- dispatch(input: Readonly<{
72
+ prepareDispatch(input: Readonly<{
31
73
  sourceAlias: string;
32
74
  sourceProvider: GatewayProvider;
33
75
  targetAlias: string;
34
76
  conversationId: string;
35
77
  selectedAlias?: string;
36
78
  stateRoot?: string;
37
- binding: PrivateRouteBinding;
79
+ binding: LogicalRouteBinding;
38
80
  authorization: "selected_route" | "native_reply";
39
81
  messageId: string;
40
82
  text: string;
41
83
  expectsReply: boolean;
42
84
  deadlineAt: string;
43
85
  progressWatchActive?: true;
44
- }>): Promise<GatewayAdapterDispatchResult>;
45
- releaseRoute(routeHandle: string): Promise<void>;
86
+ }>): Promise<ClaudeNativeHelperPreparedDispatch>;
46
87
  updateInboundStatus(receiptHandle: string, status: "held" | "delivered" | "denied" | "expired", diagnosticCode?: string): Promise<void>;
47
- notifyInboundProgress(receiptHandle: string, progress: Readonly<{
48
- kind: "stall";
49
- reason: "ROUTE_BUSY" | "ROUTE_UNAVAILABLE" | "CODEX_ROUTE_STALE" | "AWAITING_EXTERNAL_APPROVAL";
50
- queuedForMs: number;
51
- }>): Promise<void>;
88
+ notifyInboundProgress(receiptHandle: string, progress: import("./claude-peer.js").ClaudePeerInboundProgress): Promise<void>;
52
89
  releaseInboundReceipt(receiptHandle: string): Promise<boolean>;
53
- quiesceAll(): Promise<void>;
54
- quiesceGeneration(generation: string): Promise<void>;
55
- observeBarrier(generation: string): Promise<ClaudeNativeCodexSuccessionBarrier>;
56
- prepareGeneration(input: Readonly<{
57
- alias: string;
58
- cwd: string;
59
- generation: string;
60
- currentGeneration: string;
61
- }>): Promise<void>;
62
- publishPrepared(input: Readonly<{
63
- currentGeneration: string;
64
- preparedGeneration: string;
65
- }>): Promise<"published" | "not_published" | "unknown">;
66
- activatePrepared(generation: string): Promise<void>;
67
- cleanupPrepared(generation: string): Promise<void>;
68
- resumeGeneration(generation: string): Promise<void>;
69
- rollbackPrepared(input: Readonly<{
70
- preparedGeneration: string;
71
- resumeGeneration: string;
72
- }>): Promise<void>;
73
- retireGeneration(input: Readonly<{
74
- retiredGeneration: string;
75
- protectedActiveGeneration: string;
76
- }>): Promise<void>;
77
- purgeGenerationReplies(generation: string): Promise<number>;
78
90
  close(): Promise<void>;
79
91
  }