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,340 @@
|
|
|
1
|
+
import { type CompatibilityAttestation, type CompatibilitySurface } from "./compatibility.js";
|
|
2
|
+
import type { GatewayConfig } from "./config.js";
|
|
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";
|
|
5
|
+
export declare const GATEWAY_MAX_STATE_FILE_BYTES: number;
|
|
6
|
+
export type OpenProgressWatchInput = Readonly<{
|
|
7
|
+
conversationId: string;
|
|
8
|
+
ownerAlias: string;
|
|
9
|
+
workerAlias: string;
|
|
10
|
+
idleMs: number;
|
|
11
|
+
}>;
|
|
12
|
+
export type ProgressWatchAction = Readonly<{
|
|
13
|
+
type: "send_nudge";
|
|
14
|
+
conversationId: string;
|
|
15
|
+
ownerAlias: string;
|
|
16
|
+
workerAlias: string;
|
|
17
|
+
nudgeNumber: 1 | 2;
|
|
18
|
+
}> | Readonly<{
|
|
19
|
+
type: "notify_capability_degraded";
|
|
20
|
+
conversationId: string;
|
|
21
|
+
ownerAlias: string;
|
|
22
|
+
workerAlias: string;
|
|
23
|
+
}> | Readonly<{
|
|
24
|
+
type: "settled";
|
|
25
|
+
conversationId: string;
|
|
26
|
+
ownerAlias: string;
|
|
27
|
+
workerAlias: string;
|
|
28
|
+
outcome: ProgressWatchOutcome;
|
|
29
|
+
}>;
|
|
30
|
+
export type SettleQueuedMessageInput = {
|
|
31
|
+
messageId: string;
|
|
32
|
+
state: Extract<DeliveryState, "failed" | "expired" | "cancelled" | "abandoned">;
|
|
33
|
+
safeErrorCode?: string;
|
|
34
|
+
};
|
|
35
|
+
export type SettleQueuedMessageResult = {
|
|
36
|
+
status: "settled";
|
|
37
|
+
settlement: TerminalMessageSettlement;
|
|
38
|
+
} | {
|
|
39
|
+
status: "not_queued";
|
|
40
|
+
};
|
|
41
|
+
export type AffectedInFlightMessageInspection = Readonly<{
|
|
42
|
+
messageId: string;
|
|
43
|
+
deadlineAt: string;
|
|
44
|
+
}>;
|
|
45
|
+
export type RouteInFlightSettlementInput = Readonly<{
|
|
46
|
+
messageId: string;
|
|
47
|
+
state: SettleMessageInput["state"];
|
|
48
|
+
safeErrorCode?: string;
|
|
49
|
+
}>;
|
|
50
|
+
export type ReplaceClaudeSelectionInput = Readonly<{
|
|
51
|
+
replacement: RegisterRouteInput;
|
|
52
|
+
inFlightSettlements?: readonly RouteInFlightSettlementInput[];
|
|
53
|
+
}>;
|
|
54
|
+
export type GatewayPairInput = Readonly<{
|
|
55
|
+
claudeAlias: string;
|
|
56
|
+
codexAlias: string;
|
|
57
|
+
}>;
|
|
58
|
+
export type UnpairRoutesInput = GatewayPairInput & Readonly<{
|
|
59
|
+
inFlightSettlements?: readonly RouteInFlightSettlementInput[];
|
|
60
|
+
}>;
|
|
61
|
+
export type UnpairRoutesResult = Readonly<{
|
|
62
|
+
settlements: readonly TerminalMessageSettlement[];
|
|
63
|
+
claudeRouteUnreferenced: boolean;
|
|
64
|
+
}>;
|
|
65
|
+
export declare const codexSuccessionJournalStages: readonly ["prepared", "publication_armed", "published", "activated", "recovery_forbidden"];
|
|
66
|
+
export type CodexSuccessionJournalStage = (typeof codexSuccessionJournalStages)[number];
|
|
67
|
+
export type CodexSuccessionStoreIdentity = Readonly<{
|
|
68
|
+
alias: string;
|
|
69
|
+
threadId: string;
|
|
70
|
+
hostId: string;
|
|
71
|
+
/** Opaque exact ownership/listener generation; never interpreted as a path. */
|
|
72
|
+
generation: string;
|
|
73
|
+
/** Existing private route metadata only; never publicly projected. */
|
|
74
|
+
binding: PrivateRouteBinding;
|
|
75
|
+
}>;
|
|
76
|
+
type CodexSuccessionJournal = Readonly<{
|
|
77
|
+
schemaVersion: 1;
|
|
78
|
+
stage: CodexSuccessionJournalStage;
|
|
79
|
+
old: CodexSuccessionStoreIdentity;
|
|
80
|
+
new: CodexSuccessionStoreIdentity;
|
|
81
|
+
safeErrorCode?: string;
|
|
82
|
+
}>;
|
|
83
|
+
export type PrepareCodexSuccessionInput = Readonly<{
|
|
84
|
+
old: CodexSuccessionStoreIdentity;
|
|
85
|
+
new: CodexSuccessionStoreIdentity;
|
|
86
|
+
}>;
|
|
87
|
+
export type ExactCodexSuccessionInput = Readonly<{
|
|
88
|
+
oldGeneration: string;
|
|
89
|
+
newGeneration: string;
|
|
90
|
+
}>;
|
|
91
|
+
export type ClearCodexSuccessionInput = ExactCodexSuccessionInput & Readonly<{
|
|
92
|
+
/** Required once the durable arm exists; ignored only before arming. */
|
|
93
|
+
publicationAbsenceConfirmed?: true;
|
|
94
|
+
}>;
|
|
95
|
+
export type ActivateCodexSuccessionInput = ExactCodexSuccessionInput & Readonly<{
|
|
96
|
+
state: "idle" | "busy" | "awaiting_approval";
|
|
97
|
+
}>;
|
|
98
|
+
export type ForbidCodexSuccessionRecoveryInput = ExactCodexSuccessionInput & Readonly<{
|
|
99
|
+
safeErrorCode: string;
|
|
100
|
+
}>;
|
|
101
|
+
export type CodexSuccessionRecoveryAuthority = Readonly<{
|
|
102
|
+
authority: "none";
|
|
103
|
+
}> | Readonly<{
|
|
104
|
+
authority: "old" | "new";
|
|
105
|
+
journal: CodexSuccessionJournal;
|
|
106
|
+
}>;
|
|
107
|
+
export type CodexSuccessionBarrierInspection = Readonly<{
|
|
108
|
+
codexRouteCount: number;
|
|
109
|
+
queueCount: number;
|
|
110
|
+
inFlightCount: number;
|
|
111
|
+
transientBodyCount: number;
|
|
112
|
+
codexQueueDepth: number;
|
|
113
|
+
clean: boolean;
|
|
114
|
+
}>;
|
|
115
|
+
export declare class GatewayStore {
|
|
116
|
+
readonly config: GatewayConfig;
|
|
117
|
+
rootDir: string;
|
|
118
|
+
private readonly now;
|
|
119
|
+
private readonly randomId;
|
|
120
|
+
private readonly afterStateFileRename;
|
|
121
|
+
private readonly mutex;
|
|
122
|
+
private readonly transientBodies;
|
|
123
|
+
private state;
|
|
124
|
+
private lockHandle;
|
|
125
|
+
private lockToken;
|
|
126
|
+
/**
|
|
127
|
+
* Startup admission may exercise migrated state in memory, but it must not
|
|
128
|
+
* strand an older binary by rewriting the durable schema before every
|
|
129
|
+
* provider and control-socket readiness check has passed.
|
|
130
|
+
*/
|
|
131
|
+
private persistenceDeferred;
|
|
132
|
+
constructor(config: GatewayConfig, dependencies?: GatewayStoreDependencies);
|
|
133
|
+
get stateFilePath(): string;
|
|
134
|
+
initialize(options?: Readonly<{
|
|
135
|
+
deferPersistence?: boolean;
|
|
136
|
+
}>): Promise<void>;
|
|
137
|
+
/** Commit a successfully admitted startup exactly once. */
|
|
138
|
+
commitInitialization(): Promise<void>;
|
|
139
|
+
close(): Promise<void>;
|
|
140
|
+
observeConnector(input: ObserveConnectorInput): Promise<void>;
|
|
141
|
+
markConnectorOffline(identity: PrivateEndpointIdentity, safeErrorCode?: string, inFlightSettlements?: readonly RouteInFlightSettlementInput[]): Promise<TerminalMessageSettlement[]>;
|
|
142
|
+
registerRoute(input: RegisterRouteInput): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Replace the complete selected-Claude set with one exact live session in a
|
|
145
|
+
* single durable mutation. Work owned by every retired selection settles by
|
|
146
|
+
* the same evidence-aware rules as explicit unselection; no public snapshot
|
|
147
|
+
* can observe a two-selection intermediate state.
|
|
148
|
+
*/
|
|
149
|
+
replaceClaudeSelection(input: ReplaceClaudeSelectionInput): Promise<TerminalMessageSettlement[]>;
|
|
150
|
+
observeRoute(input: ObserveRouteInput): Promise<void>;
|
|
151
|
+
invalidateRoute(binding: PrivateRouteBinding, safeErrorCode?: string, inFlightSettlements?: readonly RouteInFlightSettlementInput[]): Promise<TerminalMessageSettlement[]>;
|
|
152
|
+
/**
|
|
153
|
+
* Replaces only an already-invalidated binding. Codex must retain the exact
|
|
154
|
+
* task handle. Claude must retain its exact session UUID and ownership lease;
|
|
155
|
+
* an authorized discovery may also atomically adopt that UUID's latest live
|
|
156
|
+
* display name. Names alone are never rebind authority.
|
|
157
|
+
*/
|
|
158
|
+
rebindStaleRoute(input: RebindStaleRouteInput): Promise<void>;
|
|
159
|
+
disableRoute(alias: string, ownerLease: string, inFlightSettlements?: readonly RouteInFlightSettlementInput[]): Promise<TerminalMessageSettlement[]>;
|
|
160
|
+
unregisterRoute(alias: string, ownerLease: string, inFlightSettlements?: readonly RouteInFlightSettlementInput[]): Promise<TerminalMessageSettlement[]>;
|
|
161
|
+
/**
|
|
162
|
+
* Move one owned route to its provider's latest live display name without
|
|
163
|
+
* changing the logical provider route binding. Historical normalized events
|
|
164
|
+
* retain the name that was true when they were emitted; active metadata is
|
|
165
|
+
* rewritten so subsequent settlement and dispatch use only the latest name.
|
|
166
|
+
*/
|
|
167
|
+
renameRoute(alias: string, newAlias: string, ownerLease: string): Promise<void>;
|
|
168
|
+
resolveRoute(alias: string): Promise<PrivateRouteBinding>;
|
|
169
|
+
/**
|
|
170
|
+
* Controller-internal ownership lookup used for explicit reactivation and
|
|
171
|
+
* unregister after restart. Callers must never return this value through a
|
|
172
|
+
* control response, dashboard projection, log, or normalized event.
|
|
173
|
+
*/
|
|
174
|
+
inspectPrivateRoute(alias: string): Promise<GatewayPrivateRouteInspection | undefined>;
|
|
175
|
+
/**
|
|
176
|
+
* Controller-internal inventory used to preserve exact Codex registration
|
|
177
|
+
* identities across restart. Native task handles never cross the control
|
|
178
|
+
* protocol or enter a public projection.
|
|
179
|
+
*/
|
|
180
|
+
inspectPrivateCodexRoutes(): Promise<GatewayPrivateRouteInspection[]>;
|
|
181
|
+
/**
|
|
182
|
+
* Bounded, metadata-only barrier observation for the succession controller.
|
|
183
|
+
* No route, message, conversation, or listener identifier is returned.
|
|
184
|
+
*/
|
|
185
|
+
inspectCodexSuccessionBarrier(alias: string): Promise<CodexSuccessionBarrierInspection>;
|
|
186
|
+
/** Begin one exact, same-host Codex registration succession. */
|
|
187
|
+
prepareCodexSuccession(input: PrepareCodexSuccessionInput): Promise<void>;
|
|
188
|
+
/** Durably closes the rollback-to-old boundary before registry publication. */
|
|
189
|
+
armCodexSuccessionPublication(input: ExactCodexSuccessionInput): Promise<void>;
|
|
190
|
+
/** Record that the exact new registry generation is externally visible. */
|
|
191
|
+
markCodexSuccessionPublished(input: ExactCodexSuccessionInput): Promise<void>;
|
|
192
|
+
/**
|
|
193
|
+
* Atomically replace the sole old Codex route with the exact journaled new
|
|
194
|
+
* private binding. No route gap is ever persisted.
|
|
195
|
+
*/
|
|
196
|
+
activateCodexSuccession(input: ActivateCodexSuccessionInput): Promise<void>;
|
|
197
|
+
/** Record an armed-or-later failure for fail-closed restart authority. */
|
|
198
|
+
forbidCodexSuccessionRecovery(input: ForbidCodexSuccessionRecoveryInput): Promise<void>;
|
|
199
|
+
/** Clear before arming, or after positive proof that an arm was unpublished. */
|
|
200
|
+
clearCodexSuccession(input: ClearCodexSuccessionInput): Promise<void>;
|
|
201
|
+
/** Complete an activated or restart-canonicalized new generation. */
|
|
202
|
+
completeCodexSuccession(input: ExactCodexSuccessionInput): Promise<void>;
|
|
203
|
+
/** Controller-private restart authority; omitted from every public view. */
|
|
204
|
+
inspectCodexSuccessionRecoveryAuthority(): Promise<CodexSuccessionRecoveryAuthority>;
|
|
205
|
+
/**
|
|
206
|
+
* Controller-internal inventory used only for exact-UUID Claude restoration
|
|
207
|
+
* and explicit offline unselection. The result is bounded by maxRoutes and
|
|
208
|
+
* must never cross the control protocol or enter a public projection.
|
|
209
|
+
*/
|
|
210
|
+
inspectPrivateClaudeRoutes(): Promise<GatewayPrivateRouteInspection[]>;
|
|
211
|
+
/** Create one explicit, durable Claude↔Codex consent edge. */
|
|
212
|
+
pairRoutes(input: GatewayPairInput): Promise<{
|
|
213
|
+
created: boolean;
|
|
214
|
+
}>;
|
|
215
|
+
/** Bounded metadata-only graph inventory for controller inference. */
|
|
216
|
+
inspectPairs(): Promise<GatewayPairInput[]>;
|
|
217
|
+
/** Open one durable owner-ended watch on an exact consent edge. */
|
|
218
|
+
openProgressWatch(input: OpenProgressWatchInput): Promise<{
|
|
219
|
+
created: boolean;
|
|
220
|
+
watch: ProgressWatchMachine;
|
|
221
|
+
}>;
|
|
222
|
+
inspectProgressWatches(): Promise<ProgressWatchMachine[]>;
|
|
223
|
+
inspectCompatibilityAttestation(surface: CompatibilitySurface, version: string): Promise<CompatibilityAttestation | undefined>;
|
|
224
|
+
inspectCompatibilityAttestations(): Promise<CompatibilityAttestation[]>;
|
|
225
|
+
recordCompatibilityAttestation(attestation: CompatibilityAttestation): Promise<void>;
|
|
226
|
+
touchProgressWatch(input: Readonly<{
|
|
227
|
+
conversationId: string;
|
|
228
|
+
actorAlias: string;
|
|
229
|
+
workerReportedComplete?: true;
|
|
230
|
+
}>): Promise<boolean>;
|
|
231
|
+
touchProgressWatchesForAlias(alias: string): Promise<number>;
|
|
232
|
+
settleProgressWatch(input: Readonly<{
|
|
233
|
+
conversationId: string;
|
|
234
|
+
outcome: ProgressWatchOutcome;
|
|
235
|
+
ownerAlias?: string;
|
|
236
|
+
}>): Promise<boolean>;
|
|
237
|
+
/** Advance every due watch once under one durable store mutation. */
|
|
238
|
+
advanceDueProgressWatches(): Promise<ProgressWatchAction[]>;
|
|
239
|
+
nextProgressWatchActionAt(): Promise<string | undefined>;
|
|
240
|
+
deferProgressWatchNudge(conversationId: string, retryDelayMs?: number): Promise<boolean>;
|
|
241
|
+
hasPair(input: GatewayPairInput): Promise<boolean>;
|
|
242
|
+
inspectAffectedPairInFlightMessages(input: GatewayPairInput): Promise<AffectedInFlightMessageInspection[]>;
|
|
243
|
+
/**
|
|
244
|
+
* Remove exactly one consent edge and settle only work owned by that edge.
|
|
245
|
+
* Adjacent pairs, terminal token metadata, and unrelated messages survive.
|
|
246
|
+
*/
|
|
247
|
+
unpairRoutes(input: UnpairRoutesInput): Promise<UnpairRoutesResult>;
|
|
248
|
+
/**
|
|
249
|
+
* Controller-internal inventory used to prepare an exact, evidence-aware
|
|
250
|
+
* terminal plan before a route mutation. Message bodies and route handles
|
|
251
|
+
* never cross this boundary. The route mutation validates the returned set
|
|
252
|
+
* again so a stale or incomplete plan cannot partially settle the ledger.
|
|
253
|
+
*/
|
|
254
|
+
inspectAffectedInFlightMessages(aliases: readonly string[]): Promise<AffectedInFlightMessageInspection[]>;
|
|
255
|
+
enqueueMessage(input: EnqueueMessageInput): Promise<EnqueueMessageResult>;
|
|
256
|
+
/**
|
|
257
|
+
* Accept one message from a caller-attested native Claude peer without
|
|
258
|
+
* registering or persisting that peer as a route. The exact private binding
|
|
259
|
+
* is used only to prove a live same-host connector generation for this call.
|
|
260
|
+
*/
|
|
261
|
+
enqueueNativeIngress(input: EnqueueNativeIngressInput): Promise<EnqueueMessageResult>;
|
|
262
|
+
/**
|
|
263
|
+
* Queue a correlated Codex reply for a caller-attested transient Claude
|
|
264
|
+
* peer. The service owns conversation correlation and the live dispatch
|
|
265
|
+
* capability; the store retains only bounded public-alias metadata.
|
|
266
|
+
*/
|
|
267
|
+
enqueueNativeReply(input: EnqueueNativeReplyInput): Promise<EnqueueMessageResult>;
|
|
268
|
+
dequeueMessage(targetAlias?: string, mode?: "any" | "steer_only"): Promise<TransientQueuedMessage | undefined>;
|
|
269
|
+
/**
|
|
270
|
+
* Atomically terminalizes every message whose delivery deadline is due.
|
|
271
|
+
* Returned settlements are emitted only by the mutation that removed the
|
|
272
|
+
* message, so callers can release service-owned capabilities exactly once.
|
|
273
|
+
*
|
|
274
|
+
* @deprecated GatewayService must arbitrate deadlines through the delivery
|
|
275
|
+
* reducer because only the service owns transport-write evidence. Retained
|
|
276
|
+
* temporarily as a store-level recovery/test primitive; production service
|
|
277
|
+
* code must not call it.
|
|
278
|
+
*/
|
|
279
|
+
expireDueMessages(now?: Date): Promise<TerminalMessageSettlement[]>;
|
|
280
|
+
settleMessage(input: SettleMessageInput): Promise<SettleMessageResult>;
|
|
281
|
+
requeueInFlightMessage(messageId: string, body: string): Promise<RequeueInFlightMessageResult>;
|
|
282
|
+
markMessageProgress(messageId: string, progress: InFlightMessageProgressState): Promise<void>;
|
|
283
|
+
/**
|
|
284
|
+
* Atomically terminalize one queued message and return the authoritative
|
|
285
|
+
* settlement produced by the winning mutation. A later contender observes
|
|
286
|
+
* `not_queued` and must not infer or publish another terminal outcome. At
|
|
287
|
+
* or beyond the delivery deadline, expiry is authoritative regardless of
|
|
288
|
+
* the caller's requested terminal state.
|
|
289
|
+
*/
|
|
290
|
+
settleQueuedMessage(input: SettleQueuedMessageInput): Promise<SettleQueuedMessageResult>;
|
|
291
|
+
/** @deprecated Prefer settleQueuedMessage so callers retain terminal proof. */
|
|
292
|
+
cancelQueuedMessage(messageId: string): Promise<boolean>;
|
|
293
|
+
publicSnapshot(): Promise<GatewayPublicSnapshot>;
|
|
294
|
+
private mutate;
|
|
295
|
+
private requireState;
|
|
296
|
+
private journal;
|
|
297
|
+
private requireExactSuccession;
|
|
298
|
+
private assertSuccessionLedgerEmpty;
|
|
299
|
+
private requireCodexRouteForIdentity;
|
|
300
|
+
private requireJournalRoute;
|
|
301
|
+
private requireAnyJournalRoute;
|
|
302
|
+
private assertNewSuccessionIdentityAvailable;
|
|
303
|
+
private replaceCodexRouteForSuccession;
|
|
304
|
+
private assertAllowedIdentity;
|
|
305
|
+
private requireCompatibleObservedEndpoint;
|
|
306
|
+
private validateRouteInput;
|
|
307
|
+
private requireOwnedRoute;
|
|
308
|
+
private requireAvailableRoute;
|
|
309
|
+
private requirePairRoutes;
|
|
310
|
+
private requireExactPair;
|
|
311
|
+
private validateTransientNativeClaudePeer;
|
|
312
|
+
private enqueueResolvedMessage;
|
|
313
|
+
private consumeRateLimit;
|
|
314
|
+
private recordRejection;
|
|
315
|
+
private appendEvent;
|
|
316
|
+
/** Commit watch activity only after every message-admission check succeeds. */
|
|
317
|
+
private applyProgressWatchMessageActivity;
|
|
318
|
+
private progressWatchDueTransition;
|
|
319
|
+
private commitProgressWatchNudge;
|
|
320
|
+
private appendProgressWatchEvent;
|
|
321
|
+
private settleProgressWatchesForAliases;
|
|
322
|
+
private settleProgressWatchesForPair;
|
|
323
|
+
private finishMetadata;
|
|
324
|
+
private validateAffectedInFlightSettlements;
|
|
325
|
+
private validateAffectedPairInFlightSettlements;
|
|
326
|
+
private terminateAffectedMessages;
|
|
327
|
+
private terminateAffectedPairMessages;
|
|
328
|
+
private prune;
|
|
329
|
+
private recoverAfterRestart;
|
|
330
|
+
private recoverCodexSuccessionAfterRestart;
|
|
331
|
+
private aggregateHealth;
|
|
332
|
+
private prepareOwnedDirectory;
|
|
333
|
+
private assertOwnedPrivate;
|
|
334
|
+
private readPrivateFile;
|
|
335
|
+
private acquireLock;
|
|
336
|
+
releaseControllerLock(): Promise<void>;
|
|
337
|
+
private loadStateFile;
|
|
338
|
+
private persist;
|
|
339
|
+
}
|
|
340
|
+
export {};
|