@cotal-ai/manager 0.166.2 → 0.167.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/dist/console/session-bundle.js +2 -0
- package/dist/manager-timeout.d.ts +5 -0
- package/dist/manager-timeout.d.ts.map +1 -0
- package/dist/manager-timeout.js +11 -0
- package/dist/manager-timeout.js.map +1 -0
- package/dist/manager.d.ts +162 -243
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +213 -1732
- package/dist/manager.js.map +1 -1
- package/dist/retirement.d.ts +221 -0
- package/dist/retirement.d.ts.map +1 -0
- package/dist/retirement.js +480 -0
- package/dist/retirement.js.map +1 -0
- package/dist/seat-custody.d.ts +100 -0
- package/dist/seat-custody.d.ts.map +1 -0
- package/dist/seat-custody.js +320 -0
- package/dist/seat-custody.js.map +1 -0
- package/dist/serve-plane.d.ts +228 -0
- package/dist/serve-plane.d.ts.map +1 -0
- package/dist/serve-plane.js +664 -0
- package/dist/serve-plane.js.map +1 -0
- package/dist/session-recovery.d.ts +115 -0
- package/dist/session-recovery.d.ts.map +1 -0
- package/dist/session-recovery.js +350 -0
- package/dist/session-recovery.js.map +1 -0
- package/package.json +12 -12
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { copyPersonaEndpoints, DEV_OWNER, identityFromCreds, inspectCredHealth, principalKey, rejectionText, } from "@cotal-ai/core";
|
|
3
|
+
import { agentLifecycleSecretFilePaths, agentSecretKeyForFile, retainConnectorSeat } from "@cotal-ai/workspace";
|
|
4
|
+
import { isCustodialRuntime, requireRuntimeReap, RuntimeReapUnproven } from "./runtime/index.js";
|
|
5
|
+
import { readSeatRecord, removeReleasedSeatReference, removeSeatRecord, writeSeatRecord } from "./resume.js";
|
|
6
|
+
import { casStaticSlot, readStaticSlot } from "./static-lifecycle.js";
|
|
7
|
+
import { RESTART_WORK_EXIT_MS, withTimeout } from "./manager-timeout.js";
|
|
8
|
+
/** Seat custody references, successor records, and identity-checked recovery for one manager. */
|
|
9
|
+
export class SeatCustody {
|
|
10
|
+
deps;
|
|
11
|
+
constructor(deps) {
|
|
12
|
+
this.deps = deps;
|
|
13
|
+
}
|
|
14
|
+
/** Re-record the custody reference of a managed agent's CURRENT handle on its active slot: a
|
|
15
|
+
* same-lifecycle restart or a resume binds a new custody under the old uid, and the successor's
|
|
16
|
+
* reap must address the live one. Static auth only; a runtime without durable custody records
|
|
17
|
+
* nothing (there is nothing to reap by reference). */
|
|
18
|
+
async recordSlotRuntime(a) {
|
|
19
|
+
if (a.handle.reference === undefined)
|
|
20
|
+
return;
|
|
21
|
+
await this.recordSlotCustody(a, a.handle.reference);
|
|
22
|
+
}
|
|
23
|
+
/** Record one custody reference on an agent's ACTIVE slot. Split from {@link recordSlotRuntime}
|
|
24
|
+
* so a restart or a resume can record the reference it RESERVED before spawning, while no
|
|
25
|
+
* handle exists yet. Static auth only; a runtime without durable custody reserves nothing.
|
|
26
|
+
* Throws when the slot does not take the reference: a slot left on the previous one reaps that
|
|
27
|
+
* seat, already gone, so a successor would retire the lifecycle over the new one. */
|
|
28
|
+
async recordSlotCustody(a, runtime) {
|
|
29
|
+
if (!this.deps.staticAuth())
|
|
30
|
+
return;
|
|
31
|
+
try {
|
|
32
|
+
await this.deps.withLifecycleExecutor({ owner: DEV_OWNER, actor: a.id, lifecycleUid: a.lifecycleUid, alias: a.name }, async (t) => {
|
|
33
|
+
const slot = await readStaticSlot(t, DEV_OWNER, a.name);
|
|
34
|
+
if (slot === undefined || slot.row.lifecycleUid !== a.lifecycleUid || slot.row.phase !== "active")
|
|
35
|
+
throw new Error(`the slot is ${slot === undefined ? "absent" : `${slot.row.phase} at uid ${slot.row.lifecycleUid}`}`);
|
|
36
|
+
if (slot.row.runtime?.kind === runtime.kind && slot.row.runtime.id === runtime.id)
|
|
37
|
+
return;
|
|
38
|
+
await casStaticSlot(t, { ...slot.row, runtime }, slot.revision);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
throw new Error(`could not record the custody reference ${runtime.kind}:${runtime.id} on the static slot of "${a.name}": ${rejectionText(e)}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/** Mint the custody reference for a seat this manager is about to spawn, BEFORE the processes
|
|
46
|
+
* exist. Absent for a runtime with no durable custody (there is nothing a successor could reap
|
|
47
|
+
* by reference), which is the only case that still spawns unreserved. */
|
|
48
|
+
reserveCustody(runtime) {
|
|
49
|
+
return isCustodialRuntime(runtime) ? runtime.reserve() : undefined;
|
|
50
|
+
}
|
|
51
|
+
/** Spawn under a reserved reference and prove the runtime honoured it. A runtime that minted its
|
|
52
|
+
* own id instead would leave every durable record addressing a seat that does not exist, so the
|
|
53
|
+
* mismatch tears the new seat down and throws rather than returning an unaddressable handle. */
|
|
54
|
+
async spawnCustodied(runtime, name, spec, cwd, reserved) {
|
|
55
|
+
const holder = retainConnectorSeat(this.deps.instanceId(), name);
|
|
56
|
+
const handle = runtime.spawn(name, spec, cwd, reserved);
|
|
57
|
+
this.deps.watchConnectorHolder(handle, holder);
|
|
58
|
+
if (reserved === undefined)
|
|
59
|
+
return handle;
|
|
60
|
+
const got = handle.reference;
|
|
61
|
+
if (got?.kind === reserved.kind && got.id === reserved.id)
|
|
62
|
+
return handle;
|
|
63
|
+
// A live seat now exists under a reference no durable row names, and the rollback will reap the
|
|
64
|
+
// RESERVED one, which addresses nothing. `handle.stop` cannot close this: it is fire-and-forget
|
|
65
|
+
// over the seat socket and swallows its own errors, so it proves nothing about the process. Reap
|
|
66
|
+
// the reference the runtime ACTUALLY used - that path verifies identity and proves the exit -
|
|
67
|
+
// and carry what the proof said into the throw, so a mismatch never reports a disposal it did
|
|
68
|
+
// not make.
|
|
69
|
+
let disposal;
|
|
70
|
+
if (got === undefined) {
|
|
71
|
+
try {
|
|
72
|
+
handle.stop({ graceful: false });
|
|
73
|
+
}
|
|
74
|
+
catch { /* reported below */ }
|
|
75
|
+
disposal = "the handle carries no reference, so nothing could reap it by identity and only a best-effort stop was issued";
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
try {
|
|
79
|
+
const evidence = await requireRuntimeReap(runtime, got);
|
|
80
|
+
disposal = `the spawned seat was reaped (${evidence.detail})`;
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
// Two unrelated failures used to share one sentence here, and the difference is the part the
|
|
84
|
+
// reader has to act on. A runtime that cannot reap at all left nothing behind to find. An
|
|
85
|
+
// UNPROVEN reap may have left a live seat under a reference no durable row names, which is
|
|
86
|
+
// the one case where somebody has to go looking, so it says so and names what to look for.
|
|
87
|
+
disposal =
|
|
88
|
+
e instanceof RuntimeReapUnproven
|
|
89
|
+
? `the spawned seat was NOT proved gone and may still be running as ${e.reference.kind}:${e.reference.id} (${e.message})`
|
|
90
|
+
: `the spawned seat could NOT be reaped: ${rejectionText(e)}`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
throw new Error(`runtime "${runtime.kind}" reserved custody ${reserved.kind}:${reserved.id} for "${name}" but spawned ` +
|
|
94
|
+
`${got ? `${got.kind}:${got.id}` : "a handle with no reference"}; the recorded reference would address no seat, so ${disposal}`);
|
|
95
|
+
}
|
|
96
|
+
/** Persist what a successor needs to take this seat back if this process ends without stopping
|
|
97
|
+
* it: a supervised seat, which a successor restarts (#4094), and a seat on a runtime that can adopt
|
|
98
|
+
* it by reference, which a successor adopts while it still runs (#4095). Static meshes only: a
|
|
99
|
+
* successor finds the seat through its active slot row, and only a static mesh keeps one. Throws
|
|
100
|
+
* when a supervised seat's entry could not be resumed, because a policy this host cannot keep
|
|
101
|
+
* across a manager restart is one it cannot enforce. */
|
|
102
|
+
recordSeat(a) {
|
|
103
|
+
if (!this.deps.staticAuth())
|
|
104
|
+
return;
|
|
105
|
+
const policy = a.restart?.policy;
|
|
106
|
+
const runtime = this.deps.runtimeFor(a.handle.kind);
|
|
107
|
+
const adoptable = a.handle.reference !== undefined && typeof runtime.adopt === "function";
|
|
108
|
+
if (!policy && !adoptable)
|
|
109
|
+
return;
|
|
110
|
+
const agent = this.deps.resumeEntryOf(a);
|
|
111
|
+
if (policy) {
|
|
112
|
+
const unresumable = this.deps.inventoryReferenceError(agent);
|
|
113
|
+
if (unresumable)
|
|
114
|
+
throw new Error(`a successor manager could not restart it: ${unresumable}`);
|
|
115
|
+
}
|
|
116
|
+
writeSeatRecord(this.deps.workspaceRoot(), { version: "cotal-seat-record/v1", instanceId: this.deps.instanceId(), ...(policy ? { supervise: policy } : {}), crashes: a.restart?.crashes ?? [], agent });
|
|
117
|
+
}
|
|
118
|
+
/** Bring a running seat's record up to date after its credential or restart count changed. A
|
|
119
|
+
* record that cannot be rewritten is removed, so a successor retires the seat rather than taking
|
|
120
|
+
* it back from a stale one. */
|
|
121
|
+
refreshSeatRecord(a) {
|
|
122
|
+
try {
|
|
123
|
+
this.recordSeat(a);
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
console.error(`! ${a.name}: its seat record could not be updated (${rejectionText(error)}); a manager restart now retires it`);
|
|
127
|
+
this.dropSeatRecord(a);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
dropSeatRecord(a) {
|
|
131
|
+
try {
|
|
132
|
+
removeSeatRecord(this.deps.workspaceRoot(), this.deps.space(), a.name, a.lifecycleUid);
|
|
133
|
+
removeReleasedSeatReference(this.deps.workspaceRoot(), this.deps.space(), a.name, a.lifecycleUid);
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
console.error(`! ${a.name}: its seat record could not be removed: ${rejectionText(error)}`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/** The seat record behind one active slot this instance owns, when it describes that exact
|
|
140
|
+
* incarnation on this runtime. Anything else is left to the ordinary terminal. */
|
|
141
|
+
seatRecordFor(row) {
|
|
142
|
+
let record;
|
|
143
|
+
try {
|
|
144
|
+
record = readSeatRecord(this.deps.workspaceRoot(), this.deps.space(), row.alias);
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
console.error(`! ${row.alias}: ${rejectionText(error)}; the lifecycle is retired, not restarted`);
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
if (record === undefined)
|
|
151
|
+
return undefined;
|
|
152
|
+
const identity = record.agent.identity;
|
|
153
|
+
if (identity.mode !== "static" || identity.id !== row.actor || identity.lifecycleUid !== row.lifecycleUid)
|
|
154
|
+
return undefined;
|
|
155
|
+
if (record.instanceId !== this.deps.instanceId() || record.agent.space !== this.deps.space())
|
|
156
|
+
return undefined;
|
|
157
|
+
let runtimeMatches = record.agent.launch.runtime === row.runtime?.kind;
|
|
158
|
+
if (row.runtime === undefined) {
|
|
159
|
+
// Non-custodial backends such as pty record no slot reference. A custodial backend still
|
|
160
|
+
// requires one, and an unavailable backend must refuse rather than select a replacement.
|
|
161
|
+
const runtime = this.deps.runtimeFor(record.agent.launch.runtime);
|
|
162
|
+
runtimeMatches = runtime.kind === record.agent.launch.runtime && !isCustodialRuntime(runtime);
|
|
163
|
+
}
|
|
164
|
+
if (!runtimeMatches) {
|
|
165
|
+
console.error(`! ${row.alias}: its seat ran on runtime "${record.agent.launch.runtime}" and its slot names "${row.runtime?.kind ?? "none"}"; the lifecycle is retired, not restarted`);
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
return record;
|
|
169
|
+
}
|
|
170
|
+
/** Take back a seat that outlived its manager (#4095): the runtime reattaches to the exact seat
|
|
171
|
+
* the slot names, and this manager holds it under the record's identity and launch, with no
|
|
172
|
+
* relaunch. Returns why it could not, and the caller then retires the lifecycle, which reaps the
|
|
173
|
+
* seat by the same reference. */
|
|
174
|
+
async adoptSeat(row, record) {
|
|
175
|
+
const entry = record.agent;
|
|
176
|
+
if (entry.identity.mode !== "static")
|
|
177
|
+
return "its record is not a static identity";
|
|
178
|
+
if (row.runtime === undefined)
|
|
179
|
+
return "its slot names no seat";
|
|
180
|
+
const runtime = this.deps.runtimeFor(row.runtime.kind);
|
|
181
|
+
if (typeof runtime.adopt !== "function")
|
|
182
|
+
return `runtime "${runtime.kind}" cannot adopt a seat`;
|
|
183
|
+
// The credential is the manager's own lifecycle-keyed file, and its seed renews it.
|
|
184
|
+
const credsPath = resolve(entry.identity.credential.path);
|
|
185
|
+
if (credsPath !== resolve(agentLifecycleSecretFilePaths(this.deps.workspaceRoot(), this.deps.space(), entry.name, entry.identity.lifecycleUid).creds))
|
|
186
|
+
return `its credential reference ${credsPath} is not this lifecycle's manager-owned path`;
|
|
187
|
+
const stored = await this.deps.secrets().get(agentSecretKeyForFile(credsPath, this.deps.space()));
|
|
188
|
+
if (stored === undefined)
|
|
189
|
+
return "its credential is not in the secret store";
|
|
190
|
+
let seed;
|
|
191
|
+
try {
|
|
192
|
+
const identity = identityFromCreds(stored);
|
|
193
|
+
if (identity.id !== entry.identity.id)
|
|
194
|
+
return `its credential is identity ${identity.id}, not ${entry.identity.id}`;
|
|
195
|
+
seed = identity.seed;
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
return `its credential is unreadable: ${rejectionText(error)}`;
|
|
199
|
+
}
|
|
200
|
+
let adopted;
|
|
201
|
+
try {
|
|
202
|
+
adopted = runtime.adopt(row.runtime);
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
return `the seat ${row.runtime.kind}:${row.runtime.id} could not be adopted: ${rejectionText(error)}`;
|
|
206
|
+
}
|
|
207
|
+
const managed = {
|
|
208
|
+
name: entry.name,
|
|
209
|
+
role: entry.role,
|
|
210
|
+
agent: entry.launch.connector,
|
|
211
|
+
id: entry.identity.id,
|
|
212
|
+
seed,
|
|
213
|
+
...(entry.identity.issued ? { issued: entry.identity.issued } : {}),
|
|
214
|
+
lifecycleUid: entry.identity.lifecycleUid,
|
|
215
|
+
secretPaths: { creds: entry.identity.credential.path },
|
|
216
|
+
spawner: entry.spawner,
|
|
217
|
+
authorityParent: entry.authorityParent,
|
|
218
|
+
startedAt: Date.parse(entry.startedAt),
|
|
219
|
+
// The runtime names an adopted handle by what it holds; the record names the seat.
|
|
220
|
+
handle: { ...adopted, name: entry.name },
|
|
221
|
+
launch: {
|
|
222
|
+
runtime: entry.launch.runtime,
|
|
223
|
+
source: entry.launch.source,
|
|
224
|
+
cwd: entry.launch.cwd,
|
|
225
|
+
model: entry.launch.model,
|
|
226
|
+
variant: entry.launch.variant,
|
|
227
|
+
subscribe: entry.launch.subscribe,
|
|
228
|
+
allowSubscribe: entry.launch.allowSubscribe,
|
|
229
|
+
allowPublish: entry.launch.allowPublish,
|
|
230
|
+
capabilities: entry.launch.capabilities,
|
|
231
|
+
...(entry.launch.endpoints?.length ? { endpoints: copyPersonaEndpoints(entry.launch.endpoints) } : {}),
|
|
232
|
+
events: entry.launch.events,
|
|
233
|
+
eventPayloads: this.deps.eventPayloadsWithheld() ? false : entry.launch.eventPayloads,
|
|
234
|
+
shareTools: entry.launch.shareTools,
|
|
235
|
+
forkSource: entry.launch.forkSource,
|
|
236
|
+
...(entry.launch.resumed ? { resumed: entry.launch.resumed } : {}),
|
|
237
|
+
sessionId: entry.launch.sessionId,
|
|
238
|
+
unresolvedLaunchOptionKeys: entry.launch.unresolvedLaunchOptionKeys,
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
this.deps.registerAgent(entry.name, managed);
|
|
242
|
+
this.deps.watchExit(managed);
|
|
243
|
+
console.error(`! ${entry.name}: adopted the seat its previous manager left (${row.runtime.kind}:${row.runtime.id})`);
|
|
244
|
+
await this.deps.bindOnceSeat(managed);
|
|
245
|
+
// A credential that came close to its expiry while no manager ran is renewed now, not at the
|
|
246
|
+
// next pass.
|
|
247
|
+
const health = inspectCredHealth(stored).state;
|
|
248
|
+
if (health === "near-expiry" || health === "expired")
|
|
249
|
+
await this.deps.renewManagedStaticCred(managed).catch((error) => console.error(`! managed cred renewal ${entry.name}: ${rejectionText(error)} - the agent dies loud at this cred's expiry unless it is reminted`));
|
|
250
|
+
return undefined;
|
|
251
|
+
}
|
|
252
|
+
/** Restart a supervised seat whose manager ended without stopping it (#4094), as one restart of
|
|
253
|
+
* its own policy. It goes through the resume launch, so the seat comes back under the same name,
|
|
254
|
+
* lifecycle uid, credential, persona and cwd, and a pending turn addressed to it is served to it.
|
|
255
|
+
* Returns why it could not, and the caller then retires the lifecycle. */
|
|
256
|
+
async restartSupervisedSeat(row, record) {
|
|
257
|
+
const policy = record.supervise;
|
|
258
|
+
if (policy === undefined)
|
|
259
|
+
return "its spawn carried no restart policy";
|
|
260
|
+
const now = Date.now();
|
|
261
|
+
const crashes = [...record.crashes.filter((at) => now - at < policy.windowMs), now];
|
|
262
|
+
if (crashes.length > policy.restarts)
|
|
263
|
+
return `its supervise restart budget is spent (${crashes.length} deaths in ${policy.windowMs / 1000}s, ${policy.restarts} allowed)`;
|
|
264
|
+
// Ordinary reap proves only the runtime's seat process/window gone. A durable work-closure
|
|
265
|
+
// proof must also cover detached tools. No reference means unknown, not an empty execution.
|
|
266
|
+
if (row.runtime === undefined)
|
|
267
|
+
return "prior local work has no durable custody reference; automatic restart refused";
|
|
268
|
+
const runtime = this.deps.runtimeFor(row.runtime.kind);
|
|
269
|
+
if (!runtime.reapWork)
|
|
270
|
+
return `runtime "${runtime.kind}" cannot prove prior local work ended after a manager crash; automatic restart refused`;
|
|
271
|
+
try {
|
|
272
|
+
await withTimeout(runtime.reapWork(row.runtime), RESTART_WORK_EXIT_MS, `prior local work was not proved ended within ${RESTART_WORK_EXIT_MS}ms`);
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
return `prior local work could not be closed; automatic restart refused: ${rejectionText(error)}`;
|
|
276
|
+
}
|
|
277
|
+
await this.deps.endpoint().waitForPresenceSnapshot();
|
|
278
|
+
// Readiness counts only a heartbeat newer than any the dead seat left, as an in-place restart does.
|
|
279
|
+
const principal = principalKey(DEV_OWNER, row.actor).key;
|
|
280
|
+
const joinedAfter = this.deps.endpoint().getRoster()
|
|
281
|
+
.filter((p) => p.card.id === principal && p.lifecycleUid === row.lifecycleUid)
|
|
282
|
+
.reduce((max, p) => Math.max(max, p.ts), 0) + 1;
|
|
283
|
+
const reply = await this.deps.resumeSupervisedAgent(record.agent, { policy, crashes, joinedAfter });
|
|
284
|
+
const live = this.deps.agentFor(row.alias);
|
|
285
|
+
if (reply.ok) {
|
|
286
|
+
console.error(`! ${row.alias}: restarted under the same lifecycle after its manager stopped (${crashes.length}/${policy.restarts})`);
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
// An uncertain readiness keeps the seat managed and watched, as any launch does.
|
|
290
|
+
if (live?.lifecycleUid === row.lifecycleUid) {
|
|
291
|
+
console.error(`! ${row.alias}: restarted after its manager stopped, but readiness is uncertain: ${reply.error}`);
|
|
292
|
+
return undefined;
|
|
293
|
+
}
|
|
294
|
+
return `its restart failed: ${reply.error}`;
|
|
295
|
+
}
|
|
296
|
+
/** The terminal's process step: an orphan (no live handle in THIS process) is reaped by the custody
|
|
297
|
+
* reference the slot recorded, before its footprint goes. A successor must never retire a
|
|
298
|
+
* lifecycle and free its alias while the predecessor's seat process is still running outside
|
|
299
|
+
* every manager. The runtime verifies the process identity against its own record and proves the
|
|
300
|
+
* exit; a runtime that cannot reap refuses by name and the lifecycle stays terminalizing. A row
|
|
301
|
+
* with no recorded reference has nothing this manager can address. */
|
|
302
|
+
async reapOrphanSeat(a) {
|
|
303
|
+
if (a.runtime === undefined) {
|
|
304
|
+
// No reference reached this terminal. Under a custodying runtime that is either a row written
|
|
305
|
+
// before the reservation existed, or a caller that dropped the reference on the way here.
|
|
306
|
+
// Do not name the slot row: the row may well hold a reference this caller never read, and
|
|
307
|
+
// a diagnostic that guesses which is which sends the reader the wrong way.
|
|
308
|
+
if (isCustodialRuntime(this.deps.requiredRuntime()))
|
|
309
|
+
console.error(`static retirement ${a.name}: no custody reference reached this terminal, though runtime "${this.deps.requiredRuntime().kind}" custodies its seats; any seat it launched is not addressable from here`);
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
// An unproven reap throws from here rather than printing, so it propagates into
|
|
313
|
+
// driveStaticRetirement's catch, which records the failure and HOLDS the name. That is the whole
|
|
314
|
+
// point of refusing: the alias must not be freed while a seat nobody proved gone may still run.
|
|
315
|
+
const runtime = this.deps.runtimeFor(a.runtime.kind);
|
|
316
|
+
const evidence = await requireRuntimeReap(runtime, a.runtime);
|
|
317
|
+
console.error(`static retirement ${a.name}: orphan seat process ${evidence.detail}`);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
//# sourceMappingURL=seat-custody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-custody.js","sourceRoot":"","sources":["../src/seat-custody.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,oBAAoB,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa,GAEnG,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAkC,MAAM,oBAAoB,CAAC;AAGjI,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAyBzE,iGAAiG;AACjG,MAAM,OAAO,WAAW;IACO;IAA7B,YAA6B,IAAqB;QAArB,SAAI,GAAJ,IAAI,CAAiB;IAAG,CAAC;IAEtD;;;2DAGuD;IACvD,KAAK,CAAC,iBAAiB,CAAC,CAAe;QACrC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS;Y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G,CAAC,YAAY,EAAE,CAAC;YAC5C,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,sEAAsE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;YACjH,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,uBAAuB,KAAK,CAAC,KAAK,EAAE,CAAC;IAC9C,CAAC;IAED;;;;;2EAKuE;IACvE,KAAK,CAAC,cAAc,CAAC,CAA+C;QAClE,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC5B,8FAA8F;YAC9F,0FAA0F;YAC1F,0FAA0F;YAC1F,2EAA2E;YAC3E,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;gBACjD,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,IAAI,iEAAiE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,0EAA0E,CAAC,CAAC;YACxN,OAAO;QACT,CAAC;QACD,gFAAgF;QAChF,iGAAiG;QACjG,gGAAgG;QAChG,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrD,MAAM,QAAQ,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QAC9D,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,IAAI,yBAAyB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACvF,CAAC;CACF"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { type KV } from "@nats-io/kv";
|
|
2
|
+
import type { NatsConnection } from "@nats-io/transport-node";
|
|
3
|
+
import { type Identity, type SpaceAuth, type EpServeGrant, type EpServeHandle, type EpCommandDef, type dialerFor } from "@cotal-ai/core";
|
|
4
|
+
import { type ManagerConnectorStatus } from "./manager-service-contract.js";
|
|
5
|
+
import { ManagerSessionPlane, type SessionServing } from "./session/index.js";
|
|
6
|
+
import type { ManagerOptions } from "./manager.js";
|
|
7
|
+
type ServiceServe = {
|
|
8
|
+
handle: EpServeHandle;
|
|
9
|
+
nc: NatsConnection;
|
|
10
|
+
identity: Identity;
|
|
11
|
+
grant: EpServeGrant;
|
|
12
|
+
creds?: string;
|
|
13
|
+
};
|
|
14
|
+
type SessionLedgerConnection = {
|
|
15
|
+
nc: NatsConnection;
|
|
16
|
+
creds?: string;
|
|
17
|
+
};
|
|
18
|
+
type ExecutorStores = {
|
|
19
|
+
recordsKv: KV;
|
|
20
|
+
authKv: KV;
|
|
21
|
+
nc: NatsConnection;
|
|
22
|
+
};
|
|
23
|
+
/** Current manager authority and shared renewal state, read when an operation runs. */
|
|
24
|
+
export interface ServePlaneDeps {
|
|
25
|
+
auth(): SpaceAuth | undefined;
|
|
26
|
+
remoteAuthority(): Pick<NonNullable<ManagerOptions["remoteAuthority"]>, "identities" | "goalWriterCreds" | "sessionLedgerCreds" | "serveCreds" | "serveGrant" | "mintSessionServing"> | undefined;
|
|
27
|
+
space(): string;
|
|
28
|
+
servers(): string | undefined;
|
|
29
|
+
workspaceRoot(): string;
|
|
30
|
+
managerInstanceId(): string;
|
|
31
|
+
managerServeIdentity(): Identity;
|
|
32
|
+
leaseStopping(): boolean;
|
|
33
|
+
remoteBundleRenewal(): Promise<void> | undefined;
|
|
34
|
+
maxSessions(): number | undefined;
|
|
35
|
+
serviceServe(): ServiceServe | undefined;
|
|
36
|
+
setServiceServe(value: ServiceServe | undefined): void;
|
|
37
|
+
sessionLedgerIdentity(): Identity | undefined;
|
|
38
|
+
setSessionLedgerIdentity(value: Identity | undefined): void;
|
|
39
|
+
sessionLedgerCreds(): string | undefined;
|
|
40
|
+
setSessionLedgerCreds(value: string | undefined): void;
|
|
41
|
+
sessionLedgerConn(): SessionLedgerConnection | undefined;
|
|
42
|
+
setSessionLedgerConn(value: SessionLedgerConnection | undefined): void;
|
|
43
|
+
sessionPlane(): ManagerSessionPlane | undefined;
|
|
44
|
+
setSessionPlane(value: ManagerSessionPlane | undefined): void;
|
|
45
|
+
sessionKeyRenewTimer(): ReturnType<typeof setInterval> | undefined;
|
|
46
|
+
setSessionKeyRenewTimer(value: ReturnType<typeof setInterval> | undefined): void;
|
|
47
|
+
connectorStatuses(): readonly ManagerConnectorStatus[];
|
|
48
|
+
setGoalWriterIdentity(value: Identity): void;
|
|
49
|
+
setGoalWriterCreds(value: string | undefined): void;
|
|
50
|
+
remoteStandingBudgetMs: number;
|
|
51
|
+
dial: (opts: Parameters<ReturnType<typeof dialerFor>>[0]) => Promise<NatsConnection>;
|
|
52
|
+
dialRemoteStanding: (opts: Parameters<ReturnType<typeof dialerFor>>[0], deadline: number) => Promise<NatsConnection>;
|
|
53
|
+
trackTransport: (nc: NatsConnection) => void;
|
|
54
|
+
discardServeCandidate: (nc: NatsConnection, handle?: EpServeHandle) => Promise<void>;
|
|
55
|
+
managerServiceDefs: () => EpCommandDef[];
|
|
56
|
+
omitClassCommands: () => readonly string[] | undefined;
|
|
57
|
+
resolveTarget: (target: {
|
|
58
|
+
owner: string;
|
|
59
|
+
actor: string;
|
|
60
|
+
}) => {
|
|
61
|
+
lifecycleUid: string;
|
|
62
|
+
mappingRevision: number;
|
|
63
|
+
} | undefined;
|
|
64
|
+
withEndpointServeExecutor: <T>(fn: (kvs: ExecutorStores) => Promise<T>) => Promise<T>;
|
|
65
|
+
withOpenServeConnection: <T>(fn: (kvs: ExecutorStores) => Promise<T>) => Promise<T>;
|
|
66
|
+
boundedReconnect: (label: string, attempt: () => Promise<boolean>, expired?: boolean) => Promise<boolean>;
|
|
67
|
+
renewRemoteBeforeRedial: (label: string, read: () => string | undefined) => Promise<void>;
|
|
68
|
+
scheduleServeRenewal: (creds: string) => void;
|
|
69
|
+
stop: () => Promise<void>;
|
|
70
|
+
healFrozenRegistrationGate: (authKv: KV, instanceId: string, auth: SpaceAuth, recordsKv: KV) => Promise<void>;
|
|
71
|
+
mintAndStageGoalWriter: (authKv: KV) => Promise<string>;
|
|
72
|
+
retireConnection: (nc: NatsConnection) => Promise<void>;
|
|
73
|
+
withTimeout: <T>(task: Promise<T>, ms: number, message: string) => Promise<T>;
|
|
74
|
+
remoteStandingTimeLeft: (deadline: number) => number;
|
|
75
|
+
openMeshUnverifiedEviction: (holders: readonly string[]) => never;
|
|
76
|
+
openMeshFrozenGateRefusal: (error: unknown, instanceId: string) => unknown;
|
|
77
|
+
}
|
|
78
|
+
/** Registers and recovers the manager control service and its dedicated session authority. */
|
|
79
|
+
export declare class ServePlane {
|
|
80
|
+
private readonly deps;
|
|
81
|
+
/** Maps credentialId → the nkey that credential was minted for, for the live per-session
|
|
82
|
+
* SERVING credentials. The §13.1 ledger row records the holder principal, and the row is written
|
|
83
|
+
* at stage time (after the mint), so the two steps need this one hop. Entries are dropped at
|
|
84
|
+
* revoke; a session that never staged drops its entry when the manager exits. */
|
|
85
|
+
private readonly sessionServingKeys;
|
|
86
|
+
constructor(deps: ServePlaneDeps);
|
|
87
|
+
private get auth();
|
|
88
|
+
private get remoteAuthority();
|
|
89
|
+
private get space();
|
|
90
|
+
private get servers();
|
|
91
|
+
private get workspaceRoot();
|
|
92
|
+
private get managerInstanceId();
|
|
93
|
+
private get managerServeIdentity();
|
|
94
|
+
private get leaseStopping();
|
|
95
|
+
private get remoteBundleRenewal();
|
|
96
|
+
private get maxSessions();
|
|
97
|
+
private get serviceServe();
|
|
98
|
+
private set serviceServe(value);
|
|
99
|
+
private get sessionLedgerIdentity();
|
|
100
|
+
private set sessionLedgerIdentity(value);
|
|
101
|
+
private get sessionLedgerCreds();
|
|
102
|
+
private set sessionLedgerCreds(value);
|
|
103
|
+
private get sessionLedgerConn();
|
|
104
|
+
private set sessionLedgerConn(value);
|
|
105
|
+
private get sessionPlane();
|
|
106
|
+
private set sessionPlane(value);
|
|
107
|
+
private get sessionKeyRenewTimer();
|
|
108
|
+
private set sessionKeyRenewTimer(value);
|
|
109
|
+
private get connectorStatuses();
|
|
110
|
+
/** #2073: dial the manager's ONE control-plane connection and serve its typed command surface on
|
|
111
|
+
* it. Shared by the
|
|
112
|
+
* initial registration AND the closed-connection recovery path ({@link onServeConnectionClosed}),
|
|
113
|
+
* so there is one place that dials and serves this endpoint. Attaches {@link
|
|
114
|
+
* onServeConnectionClosed} as the close handler in both cases: a closed serve connection is
|
|
115
|
+
* always a fault this manager acts on, never a bare log line. */
|
|
116
|
+
dialServeConnection(state: {
|
|
117
|
+
nc: NatsConnection;
|
|
118
|
+
identity: Identity;
|
|
119
|
+
grant: EpServeGrant;
|
|
120
|
+
creds?: string;
|
|
121
|
+
}, readCreds?: () => string, deadline?: number): Promise<{
|
|
122
|
+
nc: NatsConnection;
|
|
123
|
+
handle: EpServeHandle;
|
|
124
|
+
}>;
|
|
125
|
+
/** #2073: re-mint the SAME `endpoint-serve` identity through the SAME scoped one-shot executor and
|
|
126
|
+
* §13.1 mint fence `renewDaemonCreds`'s serve branch uses - never a second copy of that mint. Used
|
|
127
|
+
* by both the periodic renewal pass and the closed-connection recovery path below, so a
|
|
128
|
+
* superseded instance's re-mint fails the SAME gate CAS in both places and lands in the exit
|
|
129
|
+
* path rather than needing a second epoch check. */
|
|
130
|
+
remintServeCreds(s: {
|
|
131
|
+
identity: Identity;
|
|
132
|
+
grant: EpServeGrant;
|
|
133
|
+
}): Promise<string>;
|
|
134
|
+
/** #2073: a closed serve connection is a FAULT the manager acts on, not a log line: this is the
|
|
135
|
+
* control plane a report showed staying dead for hours while the process kept its liveness
|
|
136
|
+
* lease and answered nothing (#2073). `stop()` sets `leaseStopping` BEFORE it tears down this
|
|
137
|
+
* connection, so a close landing from OUR OWN graceful teardown returns here at once. Any other
|
|
138
|
+
* close re-dials with the current credential (a transport blip needs nothing new), re-mints
|
|
139
|
+
* through the existing serve branch when the credential itself has expired, and re-serves on the
|
|
140
|
+
* new connection - bounded by {@link STATIC_RECONCILE_RETRY_DELAYS_MS}. Exhausting every attempt
|
|
141
|
+
* releases this process's lease and exits loud (without `withAgents`, so seats stay up, the path
|
|
142
|
+
* `supervise`'s signal handler already uses) so a restart can serve: a manager that holds the
|
|
143
|
+
* lease and answers nothing is the worst of the three states this issue named, and holding the
|
|
144
|
+
* connection open under unbounded reconnects (the transport-drop case) never reaches this method
|
|
145
|
+
* at all - `nc.closed()` does not resolve until the client itself gives up. */
|
|
146
|
+
onServeConnectionClosed(err: Error | undefined, closed: NatsConnection): Promise<void>;
|
|
147
|
+
/** Register the manager as an ordinary v0.4 `service` endpoint and serve its typed
|
|
148
|
+
* command surface on the ep rails - the manager's ONLY control door. On an AUTH mesh
|
|
149
|
+
* the whole credential path is the SAME one an ordinary endpoint traverses (the enforcement
|
|
150
|
+
* test that keeps "ordinary" honest): provision the §13.1 issuance gate, drive the
|
|
151
|
+
* registration BARRIER's gate CAS, then release the serve credential only on the mint FENCE's
|
|
152
|
+
* revision-pinned CAS win - all over the scoped one-shot executor ({@link
|
|
153
|
+
* withEndpointServeExecutor}), never a seed-signed shortcut. Holding the signing seed only
|
|
154
|
+
* AUTHORIZES the reserved single-label name (`manager`, operator name authority, DEV_OWNER).
|
|
155
|
+
* On an OPEN mesh the same gate/registration/serve-grant ceremony runs over bare one-shot
|
|
156
|
+
* connections and NO credential is ever minted: there is no credential system to issue from,
|
|
157
|
+
* so the gate legitimately keeps an empty `epcred` family (the §13.1 fence is issuance-only)
|
|
158
|
+
* and the serve connection is bare - the broker enforces nothing on an open mesh, exactly the
|
|
159
|
+
* old open-mesh ctl trust ("open = single-trusted-host"). */
|
|
160
|
+
registerManagerService(): Promise<void>;
|
|
161
|
+
/** Mint the standing `session-ledger` credential and STAGE it into this instance's
|
|
162
|
+
* §13.1 revocation family (`epcred.<e>.<iid>`), over the passed executor's `authKv`, following the
|
|
163
|
+
* {@link mintAndStageGoalWriter} pattern under the same open-and-commit fence.
|
|
164
|
+
*
|
|
165
|
+
* This credential carries the DEDICATED sessions-bucket ledger rows and no session rail at all.
|
|
166
|
+
* It therefore takes no epoch pin: §13.6 makes it the durable revocation authority that must
|
|
167
|
+
* outlive the serving endpoint, so scoping it to one serving epoch would defeat its purpose. The
|
|
168
|
+
* epoch lives where it belongs, on the per-session serving credentials, which are minted per
|
|
169
|
+
* redemption into this same family. Because `mintCreds` stamps a random `issuance:` tag on
|
|
170
|
+
* `session-ledger` (`userTags`), re-minting the SAME nkey on renewal or restart signs distinct
|
|
171
|
+
* bytes and stages a distinct ledger row (per-JWT `credentialId` digest) even within one
|
|
172
|
+
* second. */
|
|
173
|
+
mintAndStageSessionLedger(authKv: KV): Promise<string>;
|
|
174
|
+
/** #2073: dial the session-ledger's ONE standing connection - shared by the initial start and the
|
|
175
|
+
* closed-connection recovery ({@link onSessionLedgerConnectionClosed}), the same shape {@link
|
|
176
|
+
* dialGoalWriter} uses for its rail. The KV/JetStream clients the session plane opened from the
|
|
177
|
+
* connection at start stay bound to it for this incarnation's life; a redial refreshes the
|
|
178
|
+
* standing authenticator connection the credential renewal presents onto (mirroring `sw.creds`),
|
|
179
|
+
* which is what a closed-connection fault on this rail needs restored. */
|
|
180
|
+
dialSessionLedgerConnection(sw: {
|
|
181
|
+
nc: NatsConnection;
|
|
182
|
+
creds?: string;
|
|
183
|
+
}, identity: Identity): Promise<void>;
|
|
184
|
+
/** #2073: the session-ledger rail's closed-connection fault, the same bounded shape {@link
|
|
185
|
+
* onGoalWriterConnectionClosed} uses: re-dial with the current credential, re-mint through the
|
|
186
|
+
* existing session-ledger renewal branch when the credential itself has expired, then re-attach.
|
|
187
|
+
* Exhaustion logs and leaves the credential to the next renewal pass; it never exits the process
|
|
188
|
+
* (brief step 4: only the serve rail is the control plane the report lost). */
|
|
189
|
+
onSessionLedgerConnectionClosed(err: Error | undefined): Promise<void>;
|
|
190
|
+
/** Stand up the ONE §13.6 session plane on its own standing connection. Mode-dual,
|
|
191
|
+
* mirroring {@link startGoalWriter}: an AUTH mesh presents the scoped `session-ledger` cred
|
|
192
|
+
* already minted + family-staged inside registration's run block ({@link mintAndStageSessionLedger});
|
|
193
|
+
* an OPEN mesh uses a bare connection (no credential system to mint from). The connection presents
|
|
194
|
+
* the CURRENT credential on every (re)connect, so a half-TTL renewal is adopted without reconnecting.
|
|
195
|
+
*
|
|
196
|
+
* The offer SIGNER is a per-incarnation in-memory keypair: the static collapsed path mints AND
|
|
197
|
+
* redeems the offer in one call ({@link ManagerSessionPlane.establishAttach}), so the manager
|
|
198
|
+
* self-signs and self-verifies its own §13.6 grants and the keypair never leaves the process - a
|
|
199
|
+
* holder never verifies the signature (it presents the grant back over the rail; the broker's
|
|
200
|
+
* per-session caller cred is the holder's real fence). The plane's ledger lives in the DEDICATED
|
|
201
|
+
* sessions bucket (createEndpointStreams provisioned it at registration). */
|
|
202
|
+
startSessionPlane(): Promise<void>;
|
|
203
|
+
/**
|
|
204
|
+
* The per-session SERVING credential seam (SPEC 13.6): the manager mints, gate-stages,
|
|
205
|
+
* connects and revokes ONE credential per live session, replacing a standing credential that held
|
|
206
|
+
* `eps.manager.*.<epoch>.{in,out}` and so reached every live session's bytes at its epoch.
|
|
207
|
+
*
|
|
208
|
+
* Each session gets its OWN nkey identity, so the §13.1 barrier's evict-by-holderPrincipal reaches
|
|
209
|
+
* it individually, and each is staged into `epcred.manager.<instanceId>` - the SAME family the
|
|
210
|
+
* ledger and goal-writer creds join. That is how manager takeover still kills a deposed manager's
|
|
211
|
+
* sessions: the barrier enumerates the family, revokes every row, and evicts every holder, so the
|
|
212
|
+
* per-session creds die with the incarnation exactly as the standing one did, with the blast
|
|
213
|
+
* radius of a leaked credential cut from "every session at this epoch" to "one dead session".
|
|
214
|
+
*
|
|
215
|
+
* OPEN MESH: no credential system exists to mint from, so the seam mints nothing and opens a bare
|
|
216
|
+
* connection. That is not a degraded auth path - an open mesh has no broker enforcement at all -
|
|
217
|
+
* and it is still per-session: the connection and the ledger row are still one-per-session, so
|
|
218
|
+
* teardown behaves identically in both modes.
|
|
219
|
+
*/
|
|
220
|
+
sessionServingCredentials(): SessionServing;
|
|
221
|
+
/** Tear the session plane down (best-effort, both exit paths): end every live bridge with the
|
|
222
|
+
* honest `manager-restart` reason (this incarnation is going away; any successor takes a new epoch
|
|
223
|
+
* and refuses these grants), then drain each session's own connection and retire the ledger
|
|
224
|
+
* connection ({@link retireConnection}). */
|
|
225
|
+
stopSessionPlane(): Promise<void>;
|
|
226
|
+
}
|
|
227
|
+
export {};
|
|
228
|
+
//# sourceMappingURL=serve-plane.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-plane.d.ts","sourceRoot":"","sources":["../src/serve-plane.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,EAAE,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EASL,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAC5D,KAAK,SAAS,EAC1C,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAA4E,KAAK,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACtJ,OAAO,EAAE,mBAAmB,EAAuB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,KAAK,YAAY,GAAG;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,EAAE,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,YAAY,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC3H,KAAK,uBAAuB,GAAG;IAAE,EAAE,EAAE,cAAc,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACtE,KAAK,cAAc,GAAG;IAAE,SAAS,EAAE,EAAE,CAAC;IAAC,MAAM,EAAE,EAAE,CAAC;IAAC,EAAE,EAAE,cA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