@cotal-ai/cli 0.68.0 → 0.70.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/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +2 -2
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/describe.d.ts.map +1 -1
- package/dist/commands/describe.js +2 -2
- package/dist/commands/describe.js.map +1 -1
- package/dist/commands/down.d.ts +0 -23
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +8 -217
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/endpoints.d.ts.map +1 -1
- package/dist/commands/endpoints.js +4 -5
- package/dist/commands/endpoints.js.map +1 -1
- package/dist/commands/ext.d.ts.map +1 -1
- package/dist/commands/ext.js +4 -1
- package/dist/commands/ext.js.map +1 -1
- package/dist/commands/join.d.ts.map +1 -1
- package/dist/commands/join.js +3 -3
- package/dist/commands/join.js.map +1 -1
- package/dist/commands/meshes.d.ts.map +1 -1
- package/dist/commands/meshes.js +5 -3
- package/dist/commands/meshes.js.map +1 -1
- package/dist/commands/mint.d.ts.map +1 -1
- package/dist/commands/mint.js +8 -2
- package/dist/commands/mint.js.map +1 -1
- package/dist/commands/service.d.ts.map +1 -1
- package/dist/commands/service.js +30 -46
- package/dist/commands/service.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +19 -6
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +99 -65
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +40 -37
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +31 -25
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/up.d.ts +0 -2
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +139 -199
- package/dist/commands/up.js.map +1 -1
- package/dist/console/commands.d.ts.map +1 -1
- package/dist/console/commands.js +2 -3
- package/dist/console/commands.js.map +1 -1
- package/dist/console/ui/Detail.d.ts +1 -1
- package/dist/console/ui/Detail.d.ts.map +1 -1
- package/dist/console/ui/Detail.js +2 -2
- package/dist/console/ui/Detail.js.map +1 -1
- package/dist/console/ui/Dm.d.ts.map +1 -1
- package/dist/console/ui/Dm.js +7 -6
- package/dist/console/ui/Dm.js.map +1 -1
- package/dist/console/ui/Feed.d.ts.map +1 -1
- package/dist/console/ui/Feed.js +4 -3
- package/dist/console/ui/Feed.js.map +1 -1
- package/dist/console/ui/NeedsYou.d.ts +1 -1
- package/dist/console/ui/NeedsYou.d.ts.map +1 -1
- package/dist/console/ui/NeedsYou.js +3 -2
- package/dist/console/ui/NeedsYou.js.map +1 -1
- package/dist/console/ui/Roster.d.ts +1 -1
- package/dist/console/ui/Roster.d.ts.map +1 -1
- package/dist/console/ui/Roster.js +3 -2
- package/dist/console/ui/Roster.js.map +1 -1
- package/dist/console/ui/SpacePicker.d.ts +1 -1
- package/dist/console/ui/SpacePicker.d.ts.map +1 -1
- package/dist/console/ui/SpacePicker.js +1 -1
- package/dist/console/ui/SpacePicker.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/control.d.ts +1 -13
- package/dist/lib/control.d.ts.map +1 -1
- package/dist/lib/control.js +6 -43
- package/dist/lib/control.js.map +1 -1
- package/dist/lib/delivery-proc.d.ts +11 -15
- package/dist/lib/delivery-proc.d.ts.map +1 -1
- package/dist/lib/delivery-proc.js +48 -30
- package/dist/lib/delivery-proc.js.map +1 -1
- package/dist/lib/local-process-stop.d.ts +29 -0
- package/dist/lib/local-process-stop.d.ts.map +1 -0
- package/dist/lib/local-process-stop.js +196 -0
- package/dist/lib/local-process-stop.js.map +1 -0
- package/dist/lib/manager-proc.d.ts +21 -19
- package/dist/lib/manager-proc.d.ts.map +1 -1
- package/dist/lib/manager-proc.js +63 -113
- package/dist/lib/manager-proc.js.map +1 -1
- package/dist/lib/manifest/ledger.js +1 -1
- package/dist/lib/manifest/live.d.ts.map +1 -1
- package/dist/lib/manifest/live.js +2 -4
- package/dist/lib/manifest/live.js.map +1 -1
- package/dist/lib/manifest/prepare.d.ts.map +1 -1
- package/dist/lib/manifest/prepare.js +2 -2
- package/dist/lib/manifest/prepare.js.map +1 -1
- package/dist/lib/self-exec.d.ts +1 -1
- package/dist/lib/self-exec.js +1 -1
- package/dist/lib/status.d.ts +14 -9
- package/dist/lib/status.d.ts.map +1 -1
- package/dist/lib/status.js +24 -45
- package/dist/lib/status.js.map +1 -1
- package/dist/lib/teardown-spare.js +3 -3
- package/dist/lib/teardown-spare.js.map +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +2 -2
- package/dist/render.js.map +1 -1
- package/dist/ui.d.ts +9 -9
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +16 -18
- package/dist/ui.js.map +1 -1
- package/dist/view/mesh-view.js +1 -1
- package/dist/view/mesh-view.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/** Stopping one recorded local process: the stop `cotal down` runs for every component, and the
|
|
2
|
+
* one every manager and delivery teardown shares through `stopManager` and `stopDelivery`. */
|
|
3
|
+
import { closeSync, existsSync, linkSync, openSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { randomBytes } from "node:crypto";
|
|
5
|
+
import { identityLegacyWarning, identityRefusal, identityUncertaintyRefusal, localProcessPath, parsePid, probeLiveness, readPidfile, readProcessCommand, removePidPair, stopReservationPath, verifyIdentityPin, } from "@cotal-ai/workspace";
|
|
6
|
+
import { c } from "../ui.js";
|
|
7
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
8
|
+
export function processRecorded(component, context) {
|
|
9
|
+
return existsSync(localProcessPath(component.pidFile, context)) || (component.artifacts ?? []).map((artifact) => localProcessPath(artifact, context)).some(existsSync);
|
|
10
|
+
}
|
|
11
|
+
/** Take a stop reservation at `marker` for this process, refusing while another live stop holds it.
|
|
12
|
+
* The caller removes `marker` when its stop is over. */
|
|
13
|
+
function reserveStop(name, marker) {
|
|
14
|
+
let markerFd;
|
|
15
|
+
for (;;) {
|
|
16
|
+
// ATOMIC publish (the pid-slot pattern): fill a private temp inode with our pid FIRST, then
|
|
17
|
+
// `link(2)` it as the marker - a no-overwrite atomic op. A contender therefore never observes an
|
|
18
|
+
// empty marker mid-publish; the old `openSync(marker,"wx")` then `writeFileSync` left exactly
|
|
19
|
+
// that window, and a reader in it saw owner=undefined and reclaimed a LIVE owner's reservation
|
|
20
|
+
// (mutual exclusion defeated). The published name and the held fd both keep the inode alive.
|
|
21
|
+
const temp = `${marker}.${process.pid}.${randomBytes(4).toString("hex")}`;
|
|
22
|
+
try {
|
|
23
|
+
markerFd = openSync(temp, "wx", 0o600);
|
|
24
|
+
writeFileSync(markerFd, String(process.pid));
|
|
25
|
+
linkSync(temp, marker); // EEXIST here = the marker is already held
|
|
26
|
+
rmSync(temp, { force: true });
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
if (markerFd !== undefined) {
|
|
31
|
+
closeSync(markerFd);
|
|
32
|
+
markerFd = undefined;
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
rmSync(temp, { force: true });
|
|
36
|
+
}
|
|
37
|
+
catch { /* never created, or already gone */ }
|
|
38
|
+
if (e.code !== "EEXIST")
|
|
39
|
+
throw e;
|
|
40
|
+
let owner;
|
|
41
|
+
try {
|
|
42
|
+
owner = parsePid(readFileSync(marker, "utf8"));
|
|
43
|
+
}
|
|
44
|
+
catch (readErr) {
|
|
45
|
+
if (readErr.code === "ENOENT")
|
|
46
|
+
continue; // holder released between publish-refusal and read
|
|
47
|
+
throw readErr;
|
|
48
|
+
}
|
|
49
|
+
// The atomic publish above is what closes the race: a LIVE `down` holding the marker always
|
|
50
|
+
// wrote its own POSITIVE pid into it (no empty/partial window), so a live holder is always a
|
|
51
|
+
// valid pid that is alive/EPERM/unknown - and THOSE we never reclaim (that is the mutual
|
|
52
|
+
// exclusion). An UNATTRIBUTABLE marker (empty / 0 / negative / garbled) therefore cannot
|
|
53
|
+
// represent a live holder; it is a stale or crashed reservation, and reclaiming it is both safe
|
|
54
|
+
// and required so a crashed `down` never wedges the next one. So: reclaim an unattributable
|
|
55
|
+
// owner or a valid pid PROVEN dead (ESRCH); refuse only a valid pid that is alive or whose
|
|
56
|
+
// liveness we cannot confirm.
|
|
57
|
+
if (owner !== undefined && probeLiveness(owner) !== "dead")
|
|
58
|
+
throw new Error(`${name} is already being stopped by another process (pid ${owner})`);
|
|
59
|
+
rmSync(marker, { force: true });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
closeSync(markerFd);
|
|
63
|
+
}
|
|
64
|
+
/** Stop one recorded process and await its actual exit before the next dependency is stopped. */
|
|
65
|
+
export async function stopLocalProcess(component, context, options = {}) {
|
|
66
|
+
const pidPath = localProcessPath(component.pidFile, context);
|
|
67
|
+
const found = processRecorded(component, context);
|
|
68
|
+
const rawPid = readPidfile(pidPath);
|
|
69
|
+
if (rawPid === undefined)
|
|
70
|
+
return found;
|
|
71
|
+
if (rawPid.startsWith("removing:")) {
|
|
72
|
+
const owner = parsePid(rawPid.slice("removing:".length));
|
|
73
|
+
throw new Error(owner && probeLiveness(owner) === "alive"
|
|
74
|
+
? `${component.name} extension removal is in progress (pid ${owner})`
|
|
75
|
+
: `${component.name} has a stale extension-removal reservation at ${pidPath} - remove that file and retry`);
|
|
76
|
+
}
|
|
77
|
+
const pid = parsePid(rawPid);
|
|
78
|
+
const marker = stopReservationPath(pidPath);
|
|
79
|
+
reserveStop(component.name, marker);
|
|
80
|
+
let stopped = false;
|
|
81
|
+
let authorized = false;
|
|
82
|
+
try {
|
|
83
|
+
if (pid === undefined) {
|
|
84
|
+
// An EMPTY pidfile is a pre-protocol husk (no process behind it) and is safe to clear. Any
|
|
85
|
+
// OTHER unattributable content (garbled, fractional, out-of-range - anything `parsePid`
|
|
86
|
+
// rejects) may still front a LIVE process we cannot identify or signal; removing it would
|
|
87
|
+
// orphan that process while reporting a clean stop (the signer-orphan this slice must not do).
|
|
88
|
+
// Refuse loud and preserve it.
|
|
89
|
+
if (rawPid === "") {
|
|
90
|
+
console.log(c.dim(`${component.label} had an empty pidfile.`));
|
|
91
|
+
stopped = true; // husk cleared in `finally`
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
throw new Error(`${component.label} has an unattributable pidfile at ${pidPath} (${JSON.stringify(rawPid)}) - it may still front a running process; refusing to remove it or report a clean stop. Stop that process and remove the file manually.`);
|
|
95
|
+
}
|
|
96
|
+
// Attribution before the pin (#1528): it also catches a reused pid behind a legacy record, which
|
|
97
|
+
// the pin would let through to the signal. A command that cannot be read proves nothing.
|
|
98
|
+
if (component.isOwnCommand) {
|
|
99
|
+
const command = readProcessCommand(pid);
|
|
100
|
+
if (command.kind === "command" && !component.isOwnCommand(command.command)) {
|
|
101
|
+
console.error(`! recorded ${component.label} pid ${pid} is alive but is running \`${command.command}\`, which is not a ${component.label} - not signalling it; removing the stale record instead.`);
|
|
102
|
+
stopped = true;
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// #969 OPEN-VERIFY-TERMINATE: identity before signal, the same rule the auth helper applies. This
|
|
107
|
+
// is the path every manager and delivery stop takes, and the one `cotal down` uses for the BROKER,
|
|
108
|
+
// the web dashboard and every extension component, so all of them share one identity rule.
|
|
109
|
+
const identity = verifyIdentityPin(pidPath);
|
|
110
|
+
if (identity.kind === "mismatch")
|
|
111
|
+
throw identityRefusal(component.label, pidPath, identity.record, identity.liveToken);
|
|
112
|
+
if (identity.kind === "legacy" && options.owns) {
|
|
113
|
+
// A readable command that is not this component's means the record outlived its process and
|
|
114
|
+
// the pid was reused. Signalling it would kill an unrelated process; the stale record goes.
|
|
115
|
+
const cmd = readProcessCommand(pid);
|
|
116
|
+
if (cmd.kind === "command" && !options.owns(cmd.command)) {
|
|
117
|
+
console.error(`! ${component.label} pid ${pid} is alive but is running \`${cmd.command}\`, which is not the ${component.label} - not signalling it; removing the stale record instead.`);
|
|
118
|
+
stopped = true;
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (identity.kind === "legacy")
|
|
123
|
+
console.error(identityLegacyWarning(component.label, pidPath));
|
|
124
|
+
else if (identity.kind !== "match" && identity.kind !== "gone")
|
|
125
|
+
throw identityUncertaintyRefusal(component.label, pidPath, identity);
|
|
126
|
+
// The beforeSignal hook authorizes an action against a LIVE exact process. A pinned record whose
|
|
127
|
+
// process is already ESRCH-gone needs no spare capability or destructive intent because no signal
|
|
128
|
+
// will be sent. Clear that stale record directly, preserving the hook's documented placement
|
|
129
|
+
// immediately before SIGTERM and avoiding a false "identity is not pinned" refusal on cleanup.
|
|
130
|
+
if (identity.kind === "gone") {
|
|
131
|
+
console.log(c.dim(`${component.label} (pid ${pid}) was not running.`));
|
|
132
|
+
stopped = true;
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
authorized = true;
|
|
136
|
+
options.beforeSignal?.({
|
|
137
|
+
target: identity.kind === "match" ? identity.record : { pid },
|
|
138
|
+
stopper: { pid: process.pid, marker },
|
|
139
|
+
});
|
|
140
|
+
try {
|
|
141
|
+
process.kill(pid, "SIGTERM");
|
|
142
|
+
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
// ONLY an ESRCH proves the process is already gone (safe to clear). EPERM (exists, another
|
|
145
|
+
// user's) or any other errno (EIO, argument errors, unknown) means we could NOT confirm death
|
|
146
|
+
// - reporting it stopped and removing its record would orphan a live process. Fail loud, keep
|
|
147
|
+
// the record. A two-state "not alive => gone" is exactly the bug: `unknown` is not `dead`.
|
|
148
|
+
if (e.code === "ESRCH") {
|
|
149
|
+
console.log(c.dim(`${component.label} (pid ${pid}) was not running.`));
|
|
150
|
+
stopped = true;
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
throw new Error(`could not signal ${component.label} (pid ${pid}) (${e.code ?? "unknown error"}) - refusing to report it stopped or remove its record; stop it manually`);
|
|
154
|
+
}
|
|
155
|
+
// Wait for CONFIRMED death (ESRCH), escalating to SIGKILL; `unknown`/`alive` both keep us
|
|
156
|
+
// waiting, and if death is never confirmed the record is preserved (never deleted on a guess).
|
|
157
|
+
const graceDeadline = Date.now() + 15_000;
|
|
158
|
+
while (probeLiveness(pid) !== "dead" && Date.now() < graceDeadline)
|
|
159
|
+
await sleep(100);
|
|
160
|
+
if (probeLiveness(pid) !== "dead") {
|
|
161
|
+
try {
|
|
162
|
+
process.kill(pid, "SIGKILL");
|
|
163
|
+
}
|
|
164
|
+
catch { /* raced to exit */ }
|
|
165
|
+
const hardDeadline = Date.now() + 3_000;
|
|
166
|
+
while (probeLiveness(pid) !== "dead" && Date.now() < hardDeadline)
|
|
167
|
+
await sleep(100);
|
|
168
|
+
}
|
|
169
|
+
if (probeLiveness(pid) !== "dead")
|
|
170
|
+
throw new Error(`${component.label} (pid ${pid}) did not exit, or its death could not be confirmed; its pidfile was preserved`);
|
|
171
|
+
stopped = true;
|
|
172
|
+
console.log(c.green(`✓ stopped ${component.label} (pid ${pid})`));
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
finally {
|
|
176
|
+
// Remove the pidfile ONLY when we confirmed a clean stop: `stopped` is set exclusively on an
|
|
177
|
+
// ESRCH-proven death (already-gone, or a confirmed exit). Every other exit from the try above is
|
|
178
|
+
// a throw that must PRESERVE the record - an unattributable pidfile, a process we could not
|
|
179
|
+
// signal, or a death we could not confirm (`unknown`). The old `|| !isAlive(pid)` clause treated
|
|
180
|
+
// `unknown` as gone and deleted a live process's record; it is gone.
|
|
181
|
+
// The pin goes with the pidfile (#969), and only while the pidfile still names the stopped pid: a
|
|
182
|
+
// publish that committed a successor meanwhile is left whole (#1238).
|
|
183
|
+
try {
|
|
184
|
+
if (stopped)
|
|
185
|
+
removePidPair(pidPath, rawPid);
|
|
186
|
+
else if (authorized)
|
|
187
|
+
options.afterFailedSignal?.();
|
|
188
|
+
}
|
|
189
|
+
finally {
|
|
190
|
+
// A cleanup that throws still ends this stop: a reservation left behind refuses every other
|
|
191
|
+
// stop of this component for as long as this process lives.
|
|
192
|
+
rmSync(marker, { force: true });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=local-process-stop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-process-stop.js","sourceRoot":"","sources":["../../src/lib/local-process-stop.ts"],"names":[],"mappings":"AAAA;+FAC+F;AAC/F,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzG,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,qBAAqB,EAAE,eAAe,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,EAC7G,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,mBAAmB,EAAE,iBAAiB,GAEvF,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAEhF,MAAM,UAAU,eAAe,CAAC,SAAuB,EAAE,OAA4B;IACnF,OAAO,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,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export declare const managerLogDisplayPath: (space: string, root?: string) => st
|
|
|
16
16
|
/** Exported so the delivery cutover preflight can NAME the pid it refused on: an error that says
|
|
17
17
|
* "cannot be attributed" without saying which pid is not actionable. READ-resolving, so it also
|
|
18
18
|
* names a pre-segmentation `manager.pid` when that is the record actually on disk. */
|
|
19
|
-
export declare const MANAGER_PID_PATH: (space?: string) => string;
|
|
19
|
+
export declare const MANAGER_PID_PATH: (space?: string, root?: string) => string;
|
|
20
20
|
/** The recorded manager's state. THREE-VALUED liveness plus absent, because collapsing it to a
|
|
21
21
|
* boolean is what made this dangerous. Both collapses are silent and both are wrong:
|
|
22
22
|
* `!== "dead"` -> an `unknown` reports UP forever; no retry clears it and nothing starts.
|
|
@@ -37,6 +37,8 @@ export interface ManagerRecord {
|
|
|
37
37
|
state: ManagerRecordState;
|
|
38
38
|
/** The recorded pid, when the file held one. */
|
|
39
39
|
pid?: number;
|
|
40
|
+
/** The record's content, when it is not a pid (present on `unattributable`). */
|
|
41
|
+
content?: string;
|
|
40
42
|
/** The live process's command line, when it was readable (present on `alive` and `foreign`). */
|
|
41
43
|
command?: string;
|
|
42
44
|
}
|
|
@@ -48,7 +50,7 @@ export interface ManagerRecord {
|
|
|
48
50
|
* argument, and it is the same one the liveness probe makes: absence of evidence must fail toward
|
|
49
51
|
* the old behaviour (trust the record), because the opposite error starts a second manager on top
|
|
50
52
|
* of a live one. */
|
|
51
|
-
export declare function managerRecordState(probe?: LivenessProbe, readCommand?: CommandReader, space?: string): ManagerRecord;
|
|
53
|
+
export declare function managerRecordState(probe?: LivenessProbe, readCommand?: CommandReader, space?: string, root?: string): ManagerRecord;
|
|
52
54
|
/** {@link managerRecordState}'s verdict alone, for the callers that only branch on it. */
|
|
53
55
|
export declare function managerLiveness(probe?: LivenessProbe, readCommand?: CommandReader, space?: string): ManagerRecordState;
|
|
54
56
|
/** One line describing what was found behind the record, for a caller that has to explain itself. */
|
|
@@ -105,21 +107,21 @@ export declare function ensureManager(o?: ManagerStartOpts, probe?: LivenessProb
|
|
|
105
107
|
* another user's process or by kernel policy, so the branch that handles it is otherwise unreachable
|
|
106
108
|
* from a test. Production passes nothing. */
|
|
107
109
|
export type SignalFn = (pid: number, signal: NodeJS.Signals) => void;
|
|
108
|
-
/**
|
|
109
|
-
export
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
110
|
+
/** The manager as `cotal down` registers it: its pidfile, and the records that die with its process. */
|
|
111
|
+
export declare const MANAGER_PROCESS: {
|
|
112
|
+
kind: "local-process";
|
|
113
|
+
name: string;
|
|
114
|
+
label: string;
|
|
115
|
+
order: number;
|
|
116
|
+
pidFile: string;
|
|
117
|
+
artifacts: string[];
|
|
118
|
+
};
|
|
119
|
+
/** Stop the space's manager. This is the one manager stop: `cotal down`, every `cotal up` teardown and
|
|
120
|
+
* the delivery cutover preflight run it, so each holds the stop reservation, refuses a concurrent stop,
|
|
121
|
+
* and escalates a wedged manager to SIGKILL. A default stop signals only a manager that published the
|
|
122
|
+
* capability to spare its managed agents, and reports the agents it left; `withAgents` arms their reap
|
|
123
|
+
* instead. Throws, with the records kept, when the stop is refused or the death is not confirmed. */
|
|
124
|
+
export declare function stopManager(space?: string, { withAgents }?: {
|
|
125
|
+
withAgents?: boolean | undefined;
|
|
126
|
+
}): Promise<boolean>;
|
|
125
127
|
//# sourceMappingURL=manager-proc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager-proc.d.ts","sourceRoot":"","sources":["../../src/lib/manager-proc.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"manager-proc.d.ts","sourceRoot":"","sources":["../../src/lib/manager-proc.ts"],"names":[],"mappings":"AAOA,OAAO,EAKL,KAAK,aA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KAAK,IAAI,CAAC;AAErE,wGAAwG;AACxG,eAAO,MAAM,eAAe;;;;;;;CAOJ,CAAC;AAEzB;;;;sGAIsG;AACtG,wBAAsB,WAAW,CAAC,KAAK,GAAE,MAAsB,EAAE,EAAE,UAAkB,EAAE;;CAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAiC9G"}
|
package/dist/lib/manager-proc.js
CHANGED
|
@@ -5,7 +5,10 @@ import { DEFAULT_SERVER } from "@cotal-ai/core";
|
|
|
5
5
|
import { selfArgv } from "./self-exec.js";
|
|
6
6
|
import { resolveRuntimeSpace } from "./status.js";
|
|
7
7
|
import { cotalRoot } from "./paths.js";
|
|
8
|
-
import { canonicalLocalProcessPath, commandIsCotalSupervisor, localProcessPath, parsePid, probeLiveness, readPidfile, readProcessCommand, reclaimDeadPreUpgradeRecord, MANAGER_DELIVERY_AWARE_MARKER, MANAGER_LOGFILE, MANAGER_PIDFILE,
|
|
8
|
+
import { assertManagerCanSpare, armManagerShutdownIntent, disarmManagerShutdownIntent, canonicalLocalProcessPath, commandIsCotalSupervisor, localProcessPath, parsePid, probeLiveness, readPidfile, readProcessCommand, reclaimDeadPreUpgradeRecord, MANAGER_DELIVERY_AWARE_MARKER, MANAGER_LOGFILE, MANAGER_PIDFILE, MANAGER_SHUTDOWN_INTENT, MANAGER_SPARE_CAPABILITY, parsePositiveIntegerFlag, verifyIdentityPin, writePidPair, } from "@cotal-ai/workspace";
|
|
9
|
+
import { c } from "../ui.js";
|
|
10
|
+
import { stopLocalProcess } from "./local-process-stop.js";
|
|
11
|
+
import { listManagerSeatsForSpare, printLegacyManagerSpareUncertainty, printSparedAgents } from "./teardown-spare.js";
|
|
9
12
|
/** The `--max-sessions` value a live `cotal supervise` argv is actually serving.
|
|
10
13
|
*
|
|
11
14
|
* The manager reads that flag only at start. A refresh that records a different number while this
|
|
@@ -54,7 +57,7 @@ export const managerLogDisplayPath = (space, root = cotalRoot()) => relative(roo
|
|
|
54
57
|
/** Exported so the delivery cutover preflight can NAME the pid it refused on: an error that says
|
|
55
58
|
* "cannot be attributed" without saying which pid is not actionable. READ-resolving, so it also
|
|
56
59
|
* names a pre-segmentation `manager.pid` when that is the record actually on disk. */
|
|
57
|
-
export const MANAGER_PID_PATH = (space = folderSpace()) => localProcessPath(MANAGER_PIDFILE,
|
|
60
|
+
export const MANAGER_PID_PATH = (space = folderSpace(), root = cotalRoot()) => localProcessPath(MANAGER_PIDFILE, { root, space });
|
|
58
61
|
const PID_PATH = MANAGER_PID_PATH;
|
|
59
62
|
/** Sibling marker of `manager.pid`: written by THIS build's manager (which no longer hosts Plane-3 —
|
|
60
63
|
* the server-side delivery daemon does). Its presence beside a live `manager.pid` proves the manager is
|
|
@@ -71,8 +74,8 @@ const DELIVERY_AWARE_MARKER = (space = folderSpace()) => localProcessPath(MANAGE
|
|
|
71
74
|
* argument, and it is the same one the liveness probe makes: absence of evidence must fail toward
|
|
72
75
|
* the old behaviour (trust the record), because the opposite error starts a second manager on top
|
|
73
76
|
* of a live one. */
|
|
74
|
-
export function managerRecordState(probe = probeLiveness, readCommand = readProcessCommand, space = folderSpace()) {
|
|
75
|
-
const raw = readPidfile(PID_PATH(space));
|
|
77
|
+
export function managerRecordState(probe = probeLiveness, readCommand = readProcessCommand, space = folderSpace(), root = cotalRoot()) {
|
|
78
|
+
const raw = readPidfile(PID_PATH(space, root));
|
|
76
79
|
if (!raw)
|
|
77
80
|
return { state: "absent" }; // no record, or a pre-protocol husk: nothing is behind it
|
|
78
81
|
const pid = parsePid(raw);
|
|
@@ -81,7 +84,7 @@ export function managerRecordState(probe = probeLiveness, readCommand = readProc
|
|
|
81
84
|
// that record may front a live process nobody can identify. `absent` means no pidfile (or an
|
|
82
85
|
// empty husk); corrupt content is its own state and every action path must refuse on it.
|
|
83
86
|
if (pid === undefined)
|
|
84
|
-
return { state: "unattributable" };
|
|
87
|
+
return { state: "unattributable", content: raw };
|
|
85
88
|
const liveness = probe(pid);
|
|
86
89
|
if (liveness !== "alive")
|
|
87
90
|
return { state: liveness, pid };
|
|
@@ -221,11 +224,11 @@ export function assertManagerRecordReplaceable(probe = probeLiveness, readComman
|
|
|
221
224
|
if (state === "foreign")
|
|
222
225
|
console.error(`! ${describeManagerRecord(record)} - that is not a manager, so the record is stale (its process exited and the pid was reused). Replacing it.`);
|
|
223
226
|
if (state === "unattributable")
|
|
224
|
-
throw new Error(`the manager pidfile at ${p} holds content that is not a pid (${JSON.stringify(
|
|
227
|
+
throw new Error(`the manager pidfile at ${p} holds content that is not a pid (${JSON.stringify(record.content)}).\n` +
|
|
225
228
|
`Refusing to start a manager over it: that record may front a live process nobody can identify, and overwriting it would orphan the process while reporting a healthy control plane.\n` +
|
|
226
229
|
`NEXT: find and stop that process, then remove \`${p}\` by hand.`);
|
|
227
230
|
if (state === "unknown")
|
|
228
|
-
throw new Error(`the recorded manager pid (${
|
|
231
|
+
throw new Error(`the recorded manager pid (${record.pid}) cannot be attributed: the kernel answered neither "running" nor "no such process" (a seccomp filter or LSM policy does this inside some sandboxes).\n` +
|
|
229
232
|
`Refusing to start a manager over it: it may still be running and bound to the control plane.\n` +
|
|
230
233
|
`NEXT: verify with \`ps -p <pid>\`. If it is gone, remove \`${p}\` and re-run.`);
|
|
231
234
|
}
|
|
@@ -242,112 +245,59 @@ export function ensureManager(o = {}, probe = probeLiveness, readCommand = readP
|
|
|
242
245
|
const pid = startManagerDetached(o);
|
|
243
246
|
return { running: true, started: true, pid };
|
|
244
247
|
}
|
|
245
|
-
/**
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
// start does not inherit a pin for a process that no longer exists (#969), unless a successor was
|
|
271
|
-
// published meanwhile (#1238).
|
|
272
|
-
const clear = () => {
|
|
273
|
-
rmSync(marker, { force: true });
|
|
274
|
-
removePidPair(p, raw);
|
|
275
|
-
};
|
|
276
|
-
const pid = parsePid(raw);
|
|
277
|
-
if (pid === undefined) {
|
|
278
|
-
// An EMPTY pidfile is a pre-protocol husk with nothing behind it, and clearing it is safe. ANY
|
|
279
|
-
// OTHER unattributable content (garbled, fractional, out of range) may still front a LIVE
|
|
280
|
-
// process we cannot identify or signal, so removing it would orphan that process while
|
|
281
|
-
// reporting a clean stop. The contract at the top of pid.ts says such content is never a pid to
|
|
282
|
-
// delete a record against; this is that rule at the destructive end, matching down.ts:298-311
|
|
283
|
-
// and stopAuthService, which already refuse. My first version cleared it.
|
|
284
|
-
if (raw === "") {
|
|
285
|
-
clear();
|
|
286
|
-
return "already-gone";
|
|
287
|
-
}
|
|
288
|
-
throw new Error(`the manager pidfile at ${p} is unattributable (${JSON.stringify(raw)}): it may still front a running process nobody can identify.\n` +
|
|
289
|
-
`Refusing to remove it or report a clean stop; the delivery-aware marker is preserved with it.\n` +
|
|
290
|
-
`NEXT: find and stop that process, then remove the file by hand.`);
|
|
291
|
-
}
|
|
292
|
-
const before = probe(pid);
|
|
293
|
-
if (before === "dead") {
|
|
294
|
-
clear();
|
|
295
|
-
return "already-gone";
|
|
296
|
-
}
|
|
297
|
-
// A LIVE pid that is provably NOT a manager is never signalled. The record outlived its process
|
|
298
|
-
// and the number was reused, so SIGTERM here would kill an unrelated process — the exact
|
|
299
|
-
// destructive shape the rest of this function refuses on doubt, reached through certainty. The
|
|
300
|
-
// record is removed because it is provably stale, and what was found is printed: an operator who
|
|
301
|
-
// is told only "already gone" will not know their pidfile was pointing at a stranger.
|
|
302
|
-
if (before === "alive") {
|
|
303
|
-
const cmd = readCommand(pid);
|
|
304
|
-
if (cmd.kind === "command" && !commandIsCotalSupervisor(cmd.command)) {
|
|
305
|
-
console.error(`! recorded manager pid ${pid} is alive but is running \`${cmd.command}\`, which is not a manager - not signalling it; removing the stale record instead.`);
|
|
306
|
-
clear();
|
|
307
|
-
return "already-gone";
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
if (before === "unknown")
|
|
311
|
-
throw new Error(`refusing to stop manager pid ${pid}: its liveness cannot be determined (the kernel answered neither "running" nor "no such process"; a seccomp filter or LSM policy does this).\n` +
|
|
312
|
-
`The pidfile and delivery-aware marker are LEFT IN PLACE: deleting them would orphan a process that may still be bound to the control plane.\n` +
|
|
313
|
-
`NEXT: verify with \`ps -p ${pid}\`, then stop it yourself or remove \`${p}\` if it is gone.`);
|
|
314
|
-
// #969 OPEN-VERIFY-TERMINATE: establish target identity BEFORE any signal. A pinned record whose
|
|
315
|
-
// live process carries a DIFFERENT start means the pid was reused and fronts an unrelated process
|
|
316
|
-
// (attribution above cannot catch a reused pid that happens to run a supervisor-shaped command);
|
|
317
|
-
// a torn or unreadable pin cannot prove identity either. A legacy record warns and proceeds so an
|
|
318
|
-
// upgraded CLI can stop a manager launched before pins existed. A MATCH is fully verified.
|
|
319
|
-
const identity = verifyIdentityPin(p);
|
|
320
|
-
if (identity.kind === "mismatch")
|
|
321
|
-
throw identityRefusal("the manager", p, identity.record, identity.liveToken);
|
|
322
|
-
if (identity.kind === "legacy")
|
|
323
|
-
console.error(identityLegacyWarning("the manager", p));
|
|
324
|
-
else if (identity.kind !== "match" && identity.kind !== "gone")
|
|
325
|
-
throw identityUncertaintyRefusal("the manager", p, identity);
|
|
326
|
-
try {
|
|
327
|
-
send(pid, "SIGTERM");
|
|
328
|
-
}
|
|
329
|
-
catch (e) {
|
|
330
|
-
const code = e.code;
|
|
331
|
-
if (code === "ESRCH") {
|
|
332
|
-
clear(); // died between the probe and the signal, which is an ordinary race and genuinely gone
|
|
333
|
-
return "already-gone";
|
|
334
|
-
}
|
|
335
|
-
throw new Error(`refusing to stop manager pid ${pid}: the signal was rejected (${code ?? "unknown error"}).\n` +
|
|
336
|
-
`EPERM here means the process belongs to another user, so it is running and NOT ours to stop. The pidfile and marker are LEFT IN PLACE.\n` +
|
|
337
|
-
`NEXT: stop it as its owner, or remove \`${p}\` if you are certain it is gone.`);
|
|
248
|
+
/** The manager as `cotal down` registers it: its pidfile, and the records that die with its process. */
|
|
249
|
+
export const MANAGER_PROCESS = {
|
|
250
|
+
kind: "local-process",
|
|
251
|
+
name: "manager",
|
|
252
|
+
label: "manager",
|
|
253
|
+
order: 10,
|
|
254
|
+
pidFile: MANAGER_PIDFILE,
|
|
255
|
+
artifacts: [MANAGER_DELIVERY_AWARE_MARKER, MANAGER_SHUTDOWN_INTENT, MANAGER_SPARE_CAPABILITY],
|
|
256
|
+
};
|
|
257
|
+
/** Stop the space's manager. This is the one manager stop: `cotal down`, every `cotal up` teardown and
|
|
258
|
+
* the delivery cutover preflight run it, so each holds the stop reservation, refuses a concurrent stop,
|
|
259
|
+
* and escalates a wedged manager to SIGKILL. A default stop signals only a manager that published the
|
|
260
|
+
* capability to spare its managed agents, and reports the agents it left; `withAgents` arms their reap
|
|
261
|
+
* instead. Throws, with the records kept, when the stop is refused or the death is not confirmed. */
|
|
262
|
+
export async function stopManager(space = folderSpace(), { withAgents = false } = {}) {
|
|
263
|
+
const context = ctx(space);
|
|
264
|
+
let spared;
|
|
265
|
+
let spareSeats;
|
|
266
|
+
let legacyManagerSpareUnverified = false;
|
|
267
|
+
if (!withAgents && existsSync(PID_PATH(space))) {
|
|
268
|
+
const pin = verifyIdentityPin(PID_PATH(space));
|
|
269
|
+
if (pin.kind === "legacy")
|
|
270
|
+
legacyManagerSpareUnverified = true;
|
|
271
|
+
else if (pin.kind === "match")
|
|
272
|
+
spared = await listManagerSeatsForSpare(context);
|
|
338
273
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
274
|
+
const found = await stopLocalProcess(MANAGER_PROCESS, context, {
|
|
275
|
+
owns: commandIsCotalSupervisor,
|
|
276
|
+
beforeSignal: (attempt) => {
|
|
277
|
+
if (attempt.target.token === undefined) {
|
|
278
|
+
// Upgrade compatibility follows the shared identity contract: a live pre-pin record
|
|
279
|
+
// is signalled after the warning emitted by stopLocalProcess. A default stop cannot verify
|
|
280
|
+
// the newer spare capability. Destructive down uses the helper's reduced-guarantee
|
|
281
|
+
// pid + reservation-inode handoff. A present pin still takes the fully identity-bound
|
|
282
|
+
// paths below, and a mismatching pin was already refused before this hook.
|
|
283
|
+
if (!withAgents)
|
|
284
|
+
console.error(c.dim("could not verify that this legacy manager can spare its managed agents; signalling it for upgrade compatibility"));
|
|
285
|
+
}
|
|
286
|
+
if (withAgents)
|
|
287
|
+
armManagerShutdownIntent(context, attempt);
|
|
288
|
+
else if (attempt.target.token !== undefined)
|
|
289
|
+
spareSeats = assertManagerCanSpare(context, undefined, attempt.target);
|
|
290
|
+
},
|
|
291
|
+
// Disarmed by the attempt that armed it, inside its reservation: a stop refused the reservation
|
|
292
|
+
// never reaches this, so it cannot remove the intent of the stop that holds it.
|
|
293
|
+
afterFailedSignal: withAgents ? () => disarmManagerShutdownIntent(context) : undefined,
|
|
294
|
+
});
|
|
295
|
+
for (const artifact of MANAGER_PROCESS.artifacts)
|
|
296
|
+
rmSync(localProcessPath(artifact, context), { force: true });
|
|
297
|
+
if (legacyManagerSpareUnverified)
|
|
298
|
+
printLegacyManagerSpareUncertainty();
|
|
299
|
+
else if (spared)
|
|
300
|
+
printSparedAgents(spared, spareSeats);
|
|
301
|
+
return found;
|
|
352
302
|
}
|
|
353
303
|
//# sourceMappingURL=manager-proc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager-proc.js","sourceRoot":"","sources":["../../src/lib/manager-proc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,o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AI,UAAU;gBAAE,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;iBACtD,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS;gBAAE,UAAU,GAAG,qBAAqB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACtH,CAAC;QACD,gGAAgG;QAChG,gFAAgF;QAChF,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;KACvF,CAAC,CAAC;IACH,KAAK,MAAM,QAAQ,IAAI,eAAe,CAAC,SAAS;QAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/G,IAAI,4BAA4B;QAAE,kCAAkC,EAAE,CAAC;SAClE,IAAI,MAAM;QAAE,iBAAiB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACvD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -28,7 +28,7 @@ const LedgerAgentSchema = z.strictObject({
|
|
|
28
28
|
/** The manifest agent key (`agents:` name) — display + the stable key a re-apply matches a declared
|
|
29
29
|
* agent against (the spawned name may collision-number, so it can't be that key). */
|
|
30
30
|
requested: z.string().regex(TOKEN, "requested name must be a path-safe token ([A-Za-z0-9_-])"),
|
|
31
|
-
/** The manager-reply SPAWNED name (collision-numbered, e.g. `
|
|
31
|
+
/** The manager-reply SPAWNED name (collision-numbered, e.g. `socrates_2`) — what creds are filed
|
|
32
32
|
* under; the cred path derives from THIS, never the manifest key. */
|
|
33
33
|
name: z.string().regex(TOKEN, "agent name must be a path-safe token ([A-Za-z0-9_-])"),
|
|
34
34
|
/** The spawned agent's nkey id — the immutable identity `down -f` matches before stopping. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../../src/lib/manifest/live.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../../src/lib/manifest/live.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,EAAqC,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGzI,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;sFACkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;6BAEyB;IACzB,IAAI,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/F;AAID;4EAC4E;AAC5E,wBAAsB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CAuBzE;AAED;6DAC6D;AAC7D,wBAAsB,YAAY,CAAC,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CASzE;AAED;;0FAE0F;AAC1F,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,aAAa,EAAE,SAAS,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAY9F;AAED;;6FAE6F;AAC7F,wBAAsB,aAAa,CAAC,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO1F;AAED;;;;;;;iCAOiC;AACjC,wBAAsB,WAAW,CAAC,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC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