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,287 @@
|
|
|
1
|
+
import { ClaudePeerAdapter, type ClaudePeerInboundProgress, type ClaudePeerRegistryPublicationOutcome } from "./claude-peer.js";
|
|
2
|
+
import type { AttestedClaudePeerRuntime } from "./claude-runtime.js";
|
|
3
|
+
import { type ClaudeCompatibilityScratchFactory } from "./claude-compatibility-scratch.js";
|
|
4
|
+
import { type CompatibilityAttestation, type CompatibilityCertification, type CompatibilityProbeResult, type CompatibilitySurfaceObservation } from "./compatibility.js";
|
|
5
|
+
import { type CodexConnectorObservation } from "./codex-app-server.js";
|
|
6
|
+
import type { LocalCodexTransportFactory } from "./codex-local-transport.js";
|
|
7
|
+
import type { GatewayDeliveryNoticeMode } from "./config.js";
|
|
8
|
+
import type { ClaudeNativeHelperFactory } from "./claude-helper-client.js";
|
|
9
|
+
import { type DashboardLocale } from "./locale.js";
|
|
10
|
+
import type { GatewayAdapterCallbacks, GatewayAdapterDiscoverySnapshot, GatewayAdapterDispatchResult, GatewayAdapterRouteState, GatewayAdapterStart, GatewayProviderAdapter } from "./service.js";
|
|
11
|
+
import type { PrivateEndpointIdentity, PrivateRouteBinding } from "./types.js";
|
|
12
|
+
type ClaudePeerFactory = (runtime: AttestedClaudePeerRuntime, locale: DashboardLocale, deliveryNotices: GatewayDeliveryNoticeMode) => ClaudePeerAdapter;
|
|
13
|
+
export type LocalClaudeGatewayProviderOptions = {
|
|
14
|
+
/** Exact result of attestClaudePeerRuntime; paths are never rediscovered. */
|
|
15
|
+
runtime: AttestedClaudePeerRuntime;
|
|
16
|
+
hostId?: "this-mac";
|
|
17
|
+
/** Locale for bounded notices written into native Claude sessions. */
|
|
18
|
+
locale?: DashboardLocale;
|
|
19
|
+
/** Gateway-authored user-frame policy; native receipt status is unchanged. */
|
|
20
|
+
deliveryNotices?: GatewayDeliveryNoticeMode;
|
|
21
|
+
discoveryPollMs?: number;
|
|
22
|
+
maxPendingMessages?: number;
|
|
23
|
+
now?: () => number;
|
|
24
|
+
/** Production-only real-PID advertisement helpers. Omit in child/test hosts. */
|
|
25
|
+
nativeHelpers?: Readonly<{
|
|
26
|
+
maxHelpers: number;
|
|
27
|
+
factory?: ClaudeNativeHelperFactory;
|
|
28
|
+
}>;
|
|
29
|
+
/** Deterministic test seam. Production callers must omit this. */
|
|
30
|
+
peerFactory?: ClaudePeerFactory;
|
|
31
|
+
/** Deterministic test seam. Production starts one bounded local scratch. */
|
|
32
|
+
compatibilityScratchFactory?: ClaudeCompatibilityScratchFactory;
|
|
33
|
+
};
|
|
34
|
+
export type ClaudeNativeCodexSuccessionBarrier = Readonly<{
|
|
35
|
+
generation: string;
|
|
36
|
+
activeGenerationMatched: boolean;
|
|
37
|
+
ingressQuiesced: boolean;
|
|
38
|
+
monitorFrozen: boolean;
|
|
39
|
+
discoveryInFlight: boolean;
|
|
40
|
+
pendingOutboundReceipts: number;
|
|
41
|
+
pendingInboundReceipts: number;
|
|
42
|
+
rejectedInboundSettlements: number;
|
|
43
|
+
clean: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
export type CodexRouteSuccessionBarrier = Readonly<{
|
|
46
|
+
routePresent: boolean;
|
|
47
|
+
connection: CodexConnectorObservation["connection"] | "absent";
|
|
48
|
+
routeStatus: CodexConnectorObservation["routeStatus"] | "absent";
|
|
49
|
+
queueDepth: number;
|
|
50
|
+
hasActiveTurn: boolean;
|
|
51
|
+
requestInFlight: boolean;
|
|
52
|
+
routeCreationInFlight: boolean;
|
|
53
|
+
routeReleaseInFlight: boolean;
|
|
54
|
+
pendingReplyCorrelations: number;
|
|
55
|
+
pendingCallbacks: number;
|
|
56
|
+
clean: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
export declare class LocalClaudeGatewayProvider implements GatewayProviderAdapter {
|
|
59
|
+
readonly identity: PrivateEndpointIdentity;
|
|
60
|
+
readonly protocol = "claude-peer";
|
|
61
|
+
readonly protocolVersion: string;
|
|
62
|
+
private readonly peer;
|
|
63
|
+
private readonly runtimeVersion;
|
|
64
|
+
private readonly maxPending;
|
|
65
|
+
private readonly discoveryPollMs;
|
|
66
|
+
private readonly now;
|
|
67
|
+
private readonly selectedStateRoots;
|
|
68
|
+
private readonly nativeHelpers;
|
|
69
|
+
private readonly compatibilityScratchFactory;
|
|
70
|
+
private readonly discovered;
|
|
71
|
+
private readonly selected;
|
|
72
|
+
/** Exact live same-UID sessions observed through native inbound frames. */
|
|
73
|
+
private readonly nativeInbound;
|
|
74
|
+
/** Exact listener owner for every receipt capability handed to the service. */
|
|
75
|
+
private readonly nativeInboundReceiptOwners;
|
|
76
|
+
private readonly selectedObservations;
|
|
77
|
+
/** Invalidates any discovery that overlaps a dispatch on this route. */
|
|
78
|
+
private readonly selectedDispatchEpoch;
|
|
79
|
+
/**
|
|
80
|
+
* A dispatch invalidates the pre-dispatch registry observation. The first
|
|
81
|
+
* subsequent successful discovery must therefore be published even when
|
|
82
|
+
* the native peer completed between polls and is idle again.
|
|
83
|
+
*/
|
|
84
|
+
private readonly selectedObservationDirty;
|
|
85
|
+
private readonly pendingByProviderId;
|
|
86
|
+
private readonly providerIdByGatewayId;
|
|
87
|
+
/** Includes the pre-write reservation through exact terminal settlement. */
|
|
88
|
+
private readonly pendingTargetByGatewayId;
|
|
89
|
+
/** Provider-owned terminal rejections that never enter the service queue. */
|
|
90
|
+
private readonly rejectedNativeInbound;
|
|
91
|
+
private discoveryInFlight;
|
|
92
|
+
private monitorTimer;
|
|
93
|
+
/** Invocation-ordered registry mutations; the tail itself never rejects. */
|
|
94
|
+
private nativeCodexRegistrationTail;
|
|
95
|
+
private callbacks;
|
|
96
|
+
private activeNativeCodexListener;
|
|
97
|
+
private preparedNativeCodexListener;
|
|
98
|
+
private nativeCodexPreparationInFlight;
|
|
99
|
+
private retiredNativeCodexListener;
|
|
100
|
+
/** Fences discovery callbacks and monitor restarts across listener rotation. */
|
|
101
|
+
private nativeCodexSuccessionFreeze;
|
|
102
|
+
private compatibilityCertificationInFlight;
|
|
103
|
+
private initialized;
|
|
104
|
+
private closed;
|
|
105
|
+
constructor(options: LocalClaudeGatewayProviderOptions);
|
|
106
|
+
compatibilitySurface(): CompatibilitySurfaceObservation;
|
|
107
|
+
runCompatibilityProbes(): Promise<readonly CompatibilityProbeResult[]>;
|
|
108
|
+
runCompatibilityCertification(input: Readonly<{
|
|
109
|
+
controllerStateRoot: string;
|
|
110
|
+
routeHandle?: string;
|
|
111
|
+
withTurn: boolean;
|
|
112
|
+
}>): Promise<CompatibilityCertification>;
|
|
113
|
+
initialize(callbacks: GatewayAdapterCallbacks): Promise<GatewayAdapterStart>;
|
|
114
|
+
discoverClaudePeers(): Promise<GatewayAdapterDiscoverySnapshot>;
|
|
115
|
+
assertWorkspaceDisjoint(routeHandle: string, stateRoot: string): Promise<void>;
|
|
116
|
+
selectRoute(input: {
|
|
117
|
+
alias: string;
|
|
118
|
+
routeHandle: string;
|
|
119
|
+
}): Promise<{
|
|
120
|
+
routeHandle: string;
|
|
121
|
+
state: GatewayAdapterRouteState;
|
|
122
|
+
}>;
|
|
123
|
+
resolveReplyAddress(address: string): Promise<{
|
|
124
|
+
routeHandle: string;
|
|
125
|
+
}>;
|
|
126
|
+
advertiseNativeCodexPeer(input: {
|
|
127
|
+
alias: string;
|
|
128
|
+
cwd: string;
|
|
129
|
+
}): Promise<void>;
|
|
130
|
+
currentNativeCodexPeerGeneration(alias: string): string;
|
|
131
|
+
/** Child-host initialization seam before its immutable advertisement exists. */
|
|
132
|
+
currentUnadvertisedNativeCodexPeerGeneration(): string;
|
|
133
|
+
prepareNativeCodexPeerGeneration(input: {
|
|
134
|
+
alias: string;
|
|
135
|
+
cwd: string;
|
|
136
|
+
generation: string;
|
|
137
|
+
currentGeneration?: string;
|
|
138
|
+
}): Promise<void>;
|
|
139
|
+
quiesceNativeCodexPeerGeneration(generation: string): Promise<void>;
|
|
140
|
+
observeNativeCodexSuccessionBarrier(generation: string): Promise<ClaudeNativeCodexSuccessionBarrier>;
|
|
141
|
+
publishPreparedNativeCodexPeer(input: {
|
|
142
|
+
currentGeneration: string;
|
|
143
|
+
preparedGeneration: string;
|
|
144
|
+
}): Promise<ClaudePeerRegistryPublicationOutcome>;
|
|
145
|
+
activatePreparedNativeCodexPeerGeneration(generation: string): Promise<void>;
|
|
146
|
+
cleanupPreparedNativeCodexPeerGeneration(generation: string): Promise<void>;
|
|
147
|
+
resumeNativeCodexPeerGeneration(generation: string): Promise<void>;
|
|
148
|
+
rollbackPreparedNativeCodexPeerGeneration(input: {
|
|
149
|
+
preparedGeneration: string;
|
|
150
|
+
resumeGeneration: string;
|
|
151
|
+
}): Promise<void>;
|
|
152
|
+
retireNativeCodexPeerGeneration(input: {
|
|
153
|
+
retiredGeneration: string;
|
|
154
|
+
protectedActiveGeneration: string;
|
|
155
|
+
}): Promise<void>;
|
|
156
|
+
purgeNativeCodexPeerGenerationReplyCapabilities(generation: string): Promise<number>;
|
|
157
|
+
unadvertiseNativeCodexPeer(alias: string): Promise<void>;
|
|
158
|
+
updateNativeCodexPeerStatus(alias: string, status: "idle" | "busy" | "waiting"): Promise<void>;
|
|
159
|
+
updateNativeInboundStatus(receiptHandle: string, status: "held" | "delivered" | "denied" | "expired", diagnosticCode?: string): Promise<void>;
|
|
160
|
+
notifyNativeInboundProgress(receiptHandle: string, progress: ClaudePeerInboundProgress): Promise<void>;
|
|
161
|
+
releaseNativeInboundReceipt(receiptHandle: string): Promise<boolean>;
|
|
162
|
+
quiesceNativeInbound(): Promise<void>;
|
|
163
|
+
dispatch(input: {
|
|
164
|
+
sourceAlias?: string;
|
|
165
|
+
binding: PrivateRouteBinding;
|
|
166
|
+
authorization: "selected_route" | "native_reply";
|
|
167
|
+
messageId: string;
|
|
168
|
+
text: string;
|
|
169
|
+
expectsReply: boolean;
|
|
170
|
+
deadlineAt: string;
|
|
171
|
+
}): Promise<GatewayAdapterDispatchResult>;
|
|
172
|
+
releaseRoute(routeHandle: string): Promise<void>;
|
|
173
|
+
close(): Promise<void>;
|
|
174
|
+
private assertReady;
|
|
175
|
+
private serializeNativeCodexRegistration;
|
|
176
|
+
private nativeCodexRegistration;
|
|
177
|
+
private requireActiveNativeCodexListener;
|
|
178
|
+
private requireNativeCodexListenerGeneration;
|
|
179
|
+
private requireNativeInboundReceiptOwner;
|
|
180
|
+
private ownsNativeCodexListener;
|
|
181
|
+
private onListenerMessage;
|
|
182
|
+
private rejectNativeInboundReceipt;
|
|
183
|
+
private settleRejectedNativeInbound;
|
|
184
|
+
private ownsNativeCodexListenerGeneration;
|
|
185
|
+
private waitForRejectedNativeInboundRetry;
|
|
186
|
+
private releaseRejectedNativeInbound;
|
|
187
|
+
private trackClaudeMessage;
|
|
188
|
+
private abandonClaudeTracking;
|
|
189
|
+
private onReceipt;
|
|
190
|
+
private recordClaudeWriteEvidence;
|
|
191
|
+
private finishClaudeMessage;
|
|
192
|
+
private emitDelivery;
|
|
193
|
+
private refreshClaudeDiscovery;
|
|
194
|
+
private refreshClaudeDiscoveryOnce;
|
|
195
|
+
private emitClaudeRouteObservation;
|
|
196
|
+
private hasPendingClaudeReceipt;
|
|
197
|
+
private scheduleClaudeMonitor;
|
|
198
|
+
}
|
|
199
|
+
export declare function createLocalClaudeGatewayProvider(options: LocalClaudeGatewayProviderOptions): LocalClaudeGatewayProvider;
|
|
200
|
+
export type LocalCodexGatewayProviderOptions = {
|
|
201
|
+
factory: LocalCodexTransportFactory;
|
|
202
|
+
cleanupPollMs?: number;
|
|
203
|
+
cleanupTimeoutMs?: number;
|
|
204
|
+
recoveryInitialMs?: number;
|
|
205
|
+
recoveryMaxMs?: number;
|
|
206
|
+
maxCallbackEvents?: number;
|
|
207
|
+
maxRoutes?: number;
|
|
208
|
+
maxReplyBytes?: number;
|
|
209
|
+
now?: () => Date;
|
|
210
|
+
};
|
|
211
|
+
export declare class LocalCodexGatewayProvider implements GatewayProviderAdapter {
|
|
212
|
+
readonly identity: PrivateEndpointIdentity;
|
|
213
|
+
readonly protocol: string;
|
|
214
|
+
readonly protocolVersion: string;
|
|
215
|
+
private readonly factory;
|
|
216
|
+
private readonly maxCallbacks;
|
|
217
|
+
private readonly maxRoutes;
|
|
218
|
+
private readonly maxReplyBytes;
|
|
219
|
+
private readonly cleanupPollMs;
|
|
220
|
+
private readonly cleanupTimeoutMs;
|
|
221
|
+
private readonly recoveryInitialMs;
|
|
222
|
+
private readonly recoveryMaxMs;
|
|
223
|
+
private readonly now;
|
|
224
|
+
private readonly routes;
|
|
225
|
+
private readonly routeCreations;
|
|
226
|
+
private readonly routeReleases;
|
|
227
|
+
private readonly routeRecoveryAttempts;
|
|
228
|
+
private readonly routeRecoveryTimers;
|
|
229
|
+
private readonly routeRecoveries;
|
|
230
|
+
private readonly routesRequiringRecovery;
|
|
231
|
+
private readonly expectsReply;
|
|
232
|
+
private readonly compatibilityCertifyingRoutes;
|
|
233
|
+
private readonly compatibilityTurns;
|
|
234
|
+
private readonly callbackQueue;
|
|
235
|
+
private callbackScheduled;
|
|
236
|
+
private callbacks;
|
|
237
|
+
private compatibilityAttested;
|
|
238
|
+
private initialized;
|
|
239
|
+
private closing;
|
|
240
|
+
private closed;
|
|
241
|
+
constructor(options: LocalCodexGatewayProviderOptions);
|
|
242
|
+
compatibilitySurface(): CompatibilitySurfaceObservation;
|
|
243
|
+
acceptCompatibilityAttestation(attestation: CompatibilityAttestation): void;
|
|
244
|
+
runCompatibilityProbes(): Promise<readonly CompatibilityProbeResult[]>;
|
|
245
|
+
runCompatibilityCertification(input: Readonly<{
|
|
246
|
+
controllerStateRoot: string;
|
|
247
|
+
routeHandle?: string;
|
|
248
|
+
withTurn: boolean;
|
|
249
|
+
}>): Promise<CompatibilityCertification>;
|
|
250
|
+
initialize(callbacks: GatewayAdapterCallbacks): Promise<GatewayAdapterStart>;
|
|
251
|
+
selectRoute(input: {
|
|
252
|
+
alias: string;
|
|
253
|
+
routeHandle: string;
|
|
254
|
+
}): Promise<{
|
|
255
|
+
routeHandle: string;
|
|
256
|
+
state: GatewayAdapterRouteState;
|
|
257
|
+
}>;
|
|
258
|
+
observeRouteSuccessionBarrier(routeHandle: string): CodexRouteSuccessionBarrier;
|
|
259
|
+
dispatch(input: {
|
|
260
|
+
binding: PrivateRouteBinding;
|
|
261
|
+
authorization: "selected_route" | "native_reply";
|
|
262
|
+
messageId: string;
|
|
263
|
+
text: string;
|
|
264
|
+
expectsReply: boolean;
|
|
265
|
+
deadlineAt: string;
|
|
266
|
+
steer?: true;
|
|
267
|
+
}): Promise<GatewayAdapterDispatchResult>;
|
|
268
|
+
releaseRoute(routeHandle: string): Promise<void>;
|
|
269
|
+
private releaseRouteInternal;
|
|
270
|
+
close(): Promise<void>;
|
|
271
|
+
private assertReady;
|
|
272
|
+
private ensureRoute;
|
|
273
|
+
private createRoute;
|
|
274
|
+
private onConnectorEvent;
|
|
275
|
+
private scheduleRouteRecovery;
|
|
276
|
+
private recoverRoute;
|
|
277
|
+
private cancelRouteRecovery;
|
|
278
|
+
private onTurnResult;
|
|
279
|
+
private queueRouteObservation;
|
|
280
|
+
private enqueueCodexCallback;
|
|
281
|
+
private drainOneCallback;
|
|
282
|
+
private drainCallbackQueue;
|
|
283
|
+
private closeRoute;
|
|
284
|
+
private waitForOwnedTurnToSettle;
|
|
285
|
+
}
|
|
286
|
+
export declare function createLocalCodexGatewayProvider(options: LocalCodexGatewayProviderOptions): LocalCodexGatewayProvider;
|
|
287
|
+
export {};
|