@cotal-ai/cli 0.50.1 → 0.51.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/command.d.ts.map +1 -1
- package/dist/command.js +24 -1
- package/dist/command.js.map +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +18 -1
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +114 -5
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/endpoints.d.ts.map +1 -1
- package/dist/commands/endpoints.js +2 -1
- package/dist/commands/endpoints.js.map +1 -1
- package/dist/commands/join.d.ts.map +1 -1
- package/dist/commands/join.js +25 -0
- package/dist/commands/join.js.map +1 -1
- package/dist/commands/meshes-add.d.ts +2 -54
- package/dist/commands/meshes-add.d.ts.map +1 -1
- package/dist/commands/meshes-add.js +20 -105
- package/dist/commands/meshes-add.js.map +1 -1
- package/dist/commands/meshes.d.ts.map +1 -1
- package/dist/commands/meshes.js +5 -2
- package/dist/commands/meshes.js.map +1 -1
- package/dist/commands/service.d.ts +17 -0
- package/dist/commands/service.d.ts.map +1 -0
- package/dist/commands/service.js +541 -0
- package/dist/commands/service.js.map +1 -0
- package/dist/commands/spawn.d.ts +44 -2
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +292 -45
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +11 -4
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.d.ts +50 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +284 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +71 -13
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +26 -5
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/use.js +1 -1
- package/dist/commands/use.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/manifest/apply.d.ts.map +1 -1
- package/dist/lib/manifest/apply.js +2 -0
- package/dist/lib/manifest/apply.js.map +1 -1
- package/dist/lib/manifest/model.d.ts +2 -0
- package/dist/lib/manifest/model.d.ts.map +1 -1
- package/dist/lib/manifest/prepare.d.ts +2 -0
- package/dist/lib/manifest/prepare.d.ts.map +1 -1
- package/dist/lib/manifest/prepare.js +1 -0
- package/dist/lib/manifest/prepare.js.map +1 -1
- package/dist/lib/manifest/resolve.js +1 -0
- package/dist/lib/manifest/resolve.js.map +1 -1
- package/dist/lib/manifest/schema.d.ts +2 -0
- package/dist/lib/manifest/schema.d.ts.map +1 -1
- package/dist/lib/manifest/schema.js +2 -0
- package/dist/lib/manifest/schema.js.map +1 -1
- package/dist/lib/restore.d.ts +3 -0
- package/dist/lib/restore.d.ts.map +1 -1
- package/dist/lib/restore.js +17 -0
- package/dist/lib/restore.js.map +1 -1
- package/dist/lib/seat-admission.d.ts +51 -0
- package/dist/lib/seat-admission.d.ts.map +1 -0
- package/dist/lib/seat-admission.js +81 -0
- package/dist/lib/seat-admission.js.map +1 -0
- package/dist/lib/seat-capture.d.ts +47 -0
- package/dist/lib/seat-capture.d.ts.map +1 -0
- package/dist/lib/seat-capture.js +195 -0
- package/dist/lib/seat-capture.js.map +1 -0
- package/dist/lib/seat-restore.d.ts +39 -0
- package/dist/lib/seat-restore.d.ts.map +1 -0
- package/dist/lib/seat-restore.js +249 -0
- package/dist/lib/seat-restore.js.map +1 -0
- package/dist/lib/seat-resume.d.ts +24 -0
- package/dist/lib/seat-resume.d.ts.map +1 -0
- package/dist/lib/seat-resume.js +127 -0
- package/dist/lib/seat-resume.js.map +1 -0
- package/package.json +5 -5
- package/dist/lib/join-target.d.ts +0 -173
- package/dist/lib/join-target.d.ts.map +0 -1
- package/dist/lib/join-target.js +0 -335
- package/dist/lib/join-target.js.map +0 -1
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { chmodSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { accessSync, constants, existsSync } from "node:fs";
|
|
4
|
+
import { arch, cpus, homedir, totalmem } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { commandIsCotalSupervisor, findMesh, localProcessPath, MANAGER_PIDFILE, parsePid, probeLiveness, readProcessCommand, spaceKey, spaceSegment, } from "@cotal-ai/workspace";
|
|
7
|
+
import { selfArgv } from "../lib/self-exec.js";
|
|
8
|
+
import { resolveRuntimeSpace } from "../lib/status.js";
|
|
9
|
+
import { c } from "../ui.js";
|
|
10
|
+
/**
|
|
11
|
+
* `cotal service` — run the workstation's manager as a user service, so it survives logout
|
|
12
|
+
* and reboot. The manager is the only daemon this installs; the broker and every other
|
|
13
|
+
* component keep their existing lifecycle. The unit's ExecStart is this CLI's own argv plus
|
|
14
|
+
* the `supervise` subcommand, so the supervised process is the same one the operator would
|
|
15
|
+
* run by hand (`selfArgv()` refuses when this process is not the cotal entry).
|
|
16
|
+
*
|
|
17
|
+
* Linux installs a systemd user unit under `~/.config/systemd/user/`, one per mesh
|
|
18
|
+
* (`cotal-manager@<spaceKey>.service`); macOS installs a launchd agent plist under
|
|
19
|
+
* `~/Library/LaunchAgents/`. Any other platform, or an absent systemd/launchd, throws with a
|
|
20
|
+
* message naming what is missing. No fallback.
|
|
21
|
+
*
|
|
22
|
+
* Every file written here starts with the {@link MARKER} provenance comment; `uninstall`
|
|
23
|
+
* refuses to remove a file without it, so an operator-written unit is never destroyed.
|
|
24
|
+
*/
|
|
25
|
+
/** The provenance header every file this command writes carries; uninstall checks it. */
|
|
26
|
+
const MARKER = "installed by `cotal service install`";
|
|
27
|
+
/** The directory the RUNNING user manager searches for units. Resolved from the manager's own
|
|
28
|
+
* environment (`systemctl --user show-environment`), never from this process's env: a
|
|
29
|
+
* shell-only XDG/HOME override (or a sudo/su shell) would write the unit where no manager ever
|
|
30
|
+
* looks, producing a unit that can be written but never enabled. A REACHABLE systemctl that
|
|
31
|
+
* cannot reach the user bus is a hard refusal, not a fallback: guessing a directory in that
|
|
32
|
+
* state would report an install status about a unit no manager could ever load. */
|
|
33
|
+
function userUnitDir() {
|
|
34
|
+
const env = systemctl(["show-environment"]);
|
|
35
|
+
if (env.status === 0) {
|
|
36
|
+
const vars = new Map(env.output.split("\n").map((l) => {
|
|
37
|
+
const i = l.indexOf("=");
|
|
38
|
+
return i < 0 ? [l, ""] : [l.slice(0, i), l.slice(i + 1).trim()];
|
|
39
|
+
}));
|
|
40
|
+
const xdg = vars.get("XDG_CONFIG_HOME");
|
|
41
|
+
if (xdg)
|
|
42
|
+
return join(xdg, "systemd", "user");
|
|
43
|
+
const home = vars.get("HOME");
|
|
44
|
+
if (home)
|
|
45
|
+
return join(home, ".config", "systemd", "user");
|
|
46
|
+
throw new Error(`the systemd user manager reported no XDG_CONFIG_HOME and no HOME in its environment - cannot determine the user unit directory`);
|
|
47
|
+
}
|
|
48
|
+
throw new Error(`the systemd user session is not reachable (\`systemctl --user show-environment\` -> ${env.output || "no output"}) - cannot determine the user unit directory`);
|
|
49
|
+
}
|
|
50
|
+
const launchAgentsDir = () => join(process.env.HOME ?? homedir(), "Library", "LaunchAgents");
|
|
51
|
+
/** The systemd user unit name for a mesh (one unit per mesh; `<spaceKey>` is case-safe). */
|
|
52
|
+
export const systemdUnitName = (mesh) => `cotal-manager@${spaceKey(mesh)}.service`;
|
|
53
|
+
/** The launchd agent label for a mesh. */
|
|
54
|
+
export const launchdLabel = (mesh) => `ai.cotal.manager.${spaceKey(mesh)}`;
|
|
55
|
+
/** Make a path safe as the value of a systemd unit setting. systemd expands `%` specifiers
|
|
56
|
+
* (`%h`, `%n`, …) in EVERY value it reads from a unit, including `WorkingDirectory`,
|
|
57
|
+
* `EnvironmentFile=` paths and `ExecStart=` arguments; an unescaped `%` is a silent rewrite of
|
|
58
|
+
* the path (a root named `root%name` becomes `root<unit-name>`, the unit fails at CHDIR with
|
|
59
|
+
* status 200 while install reported success). `%%` is the literal-percent escape systemd
|
|
60
|
+
* defines for unit setting values (verified on this host for mid-string and trailing `%`).
|
|
61
|
+
* Only `%` is touched: this is the specifier escape, not shell quoting. */
|
|
62
|
+
const escapeSystemdSpecifiers = (value) => value.replaceAll("%", "%%");
|
|
63
|
+
/** `/dev/kvm` presence and access. `denied` means it exists but this user cannot use it. */
|
|
64
|
+
function kvmState() {
|
|
65
|
+
try {
|
|
66
|
+
accessSync("/dev/kvm", constants.R_OK | constants.W_OK);
|
|
67
|
+
return "present";
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return existsSync("/dev/kvm") ? "denied" : "absent";
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export function hostFacts() {
|
|
74
|
+
return {
|
|
75
|
+
arch: arch(),
|
|
76
|
+
// The operating system, not the hostname: a hostname names a network node (on cloud hosts it
|
|
77
|
+
// is infrastructure metadata), it is not OS information, and publishing it in a status feed
|
|
78
|
+
// leaks deployment details that nothing here needs.
|
|
79
|
+
os: process.platform,
|
|
80
|
+
cpuCount: cpus().length,
|
|
81
|
+
memoryBytes: totalmem(),
|
|
82
|
+
kvm: process.platform === "linux" ? kvmState() : "absent",
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** One command run, never throwing: the caller decides what a non-zero status means. */
|
|
86
|
+
function run(cmd, args) {
|
|
87
|
+
const r = spawnSync(cmd, args, { encoding: "utf8", timeout: 60_000 });
|
|
88
|
+
return { status: r.status, output: `${r.stdout ?? ""}${r.stderr ?? ""}`.trim() };
|
|
89
|
+
}
|
|
90
|
+
/** The mesh a `service` subcommand acts on: `--mesh <name>`, else this folder's runtime space. */
|
|
91
|
+
function meshOf(values) {
|
|
92
|
+
return values.mesh ?? resolveRuntimeSpace(process.cwd());
|
|
93
|
+
}
|
|
94
|
+
/** The manager's pid + attribution for an explicit root, mirroring `managerRecordState`
|
|
95
|
+
* (which resolves its root from cwd); `service status` must judge the unit's recorded root,
|
|
96
|
+
* not whatever folder the operator is standing in. */
|
|
97
|
+
function managerHealthFor(root, mesh) {
|
|
98
|
+
const pidPath = localProcessPath(MANAGER_PIDFILE, { root, space: mesh });
|
|
99
|
+
if (!existsSync(pidPath))
|
|
100
|
+
return { state: "absent" };
|
|
101
|
+
const raw = readFileSync(pidPath, "utf8").trim();
|
|
102
|
+
if (raw === "")
|
|
103
|
+
return { state: "absent" };
|
|
104
|
+
const pid = parsePid(raw);
|
|
105
|
+
if (pid === undefined)
|
|
106
|
+
return { state: "unattributable" };
|
|
107
|
+
const liveness = probeLiveness(pid);
|
|
108
|
+
if (liveness !== "alive")
|
|
109
|
+
return { state: liveness, pid };
|
|
110
|
+
const cmd = readProcessCommand(pid);
|
|
111
|
+
if (cmd.kind !== "command")
|
|
112
|
+
return { state: "alive", pid };
|
|
113
|
+
return { state: commandIsCotalSupervisor(cmd.command) ? "alive" : "foreign", pid };
|
|
114
|
+
}
|
|
115
|
+
/** `systemctl --user …`; a missing binary or a user session that cannot be reached is a
|
|
116
|
+
* hard refusal naming what is missing (no fallback). */
|
|
117
|
+
function systemctl(args) {
|
|
118
|
+
const probe = run("systemctl", ["--user", ...args]);
|
|
119
|
+
if (probe.status === null && !probe.output)
|
|
120
|
+
throw new Error(`systemd user session is not available on this machine: \`systemctl --user ${args.join(" ")}\` could not run (is systemctl installed?)`);
|
|
121
|
+
if (probe.status === null)
|
|
122
|
+
throw new Error(`\`systemctl --user ${args.join(" ")}\` could not run: ${probe.output}`);
|
|
123
|
+
return probe;
|
|
124
|
+
}
|
|
125
|
+
function assertSystemdUser() {
|
|
126
|
+
if (process.platform !== "linux")
|
|
127
|
+
throw new Error(`\`cotal service\` needs systemd user units (Linux) or launchd agents (macOS); this is ${process.platform}`);
|
|
128
|
+
const probe = run("systemctl", ["--user", "is-system-running"]);
|
|
129
|
+
if (probe.status === null)
|
|
130
|
+
throw new Error(`systemd user session is not available: ${probe.output || "`systemctl --user` could not run (is systemctl installed?)"}`);
|
|
131
|
+
if (probe.status !== 0 && !/^(degraded|running)$/m.test(probe.output))
|
|
132
|
+
throw new Error(`systemd user session is not usable: \`systemctl --user is-system-running\` -> ${probe.output}`);
|
|
133
|
+
}
|
|
134
|
+
function assertLaunchd() {
|
|
135
|
+
if (process.platform !== "darwin")
|
|
136
|
+
throw new Error(`\`cotal service\` needs launchd agents (macOS) or systemd user units (Linux); this is ${process.platform}`);
|
|
137
|
+
const probe = run("launchctl", ["version"]);
|
|
138
|
+
if (probe.status !== 0)
|
|
139
|
+
throw new Error(`launchd is not usable: \`launchctl version\` -> ${probe.output || "not found"}`);
|
|
140
|
+
}
|
|
141
|
+
function humanBytes(n) {
|
|
142
|
+
const gib = n / (1024 ** 3);
|
|
143
|
+
return Number.isInteger(gib) ? `${gib} GiB` : `${gib.toFixed(1)} GiB`;
|
|
144
|
+
}
|
|
145
|
+
/** systemd state for one unit: `inactive`/`not-found` handled without throwing. */
|
|
146
|
+
function systemdUnitStatus(unit) {
|
|
147
|
+
const active = systemctl(["is-active", unit]);
|
|
148
|
+
const state = active.status === 0 ? active.output : active.output || "inactive";
|
|
149
|
+
const enabledProbe = systemctl(["is-enabled", unit]);
|
|
150
|
+
const enabled = enabledProbe.status === 0 ? true : /disabled/.test(enabledProbe.output) ? false : "unknown";
|
|
151
|
+
return { state: state === "not-found" ? "not-found" : state, enabled };
|
|
152
|
+
}
|
|
153
|
+
/** Read the provenance fields a unit/plist carries. */
|
|
154
|
+
/** Read the provenance fields a unit/plist carries. The marker must be a WHOLE LINE at the
|
|
155
|
+
* very start of the file, exactly as this command writes it: a substring anywhere else (a
|
|
156
|
+
* Description= that quotes the phrase, a comment mid-file) is how an operator-written unit
|
|
157
|
+
* comes to look owned, and looking owned is what uninstall keys on. */
|
|
158
|
+
function readUnitFields(path, meshPrefix, rootPrefix, markerLine) {
|
|
159
|
+
const lines = readFileSync(path, "utf8").split("\n");
|
|
160
|
+
const mesh = lines.find((l) => l.startsWith(meshPrefix))?.slice(meshPrefix.length).trim();
|
|
161
|
+
const root = lines.find((l) => l.startsWith(rootPrefix))?.slice(rootPrefix.length).trim();
|
|
162
|
+
return { mesh, root, marked: lines[0] === markerLine };
|
|
163
|
+
}
|
|
164
|
+
export async function service(args) {
|
|
165
|
+
const [sub, ...rest] = args.positionals;
|
|
166
|
+
const values = args.values;
|
|
167
|
+
// A mesh name becomes a filename and an environment value; a newline breaks both (a split unit
|
|
168
|
+
// record, a two-line EnvironmentFile entry). Refuse rather than encode.
|
|
169
|
+
if (values.mesh !== undefined && /[\r\n]/.test(values.mesh))
|
|
170
|
+
throw new Error(`--mesh must be a single-line name (contains a line break)`);
|
|
171
|
+
if (sub === "install") {
|
|
172
|
+
if (rest.length)
|
|
173
|
+
throw new Error("usage: cotal service install [--mesh <name>] [--linger]");
|
|
174
|
+
if (values.json)
|
|
175
|
+
throw new Error("--json is for `service status`");
|
|
176
|
+
return install(values);
|
|
177
|
+
}
|
|
178
|
+
if (sub === "status") {
|
|
179
|
+
if (rest.length)
|
|
180
|
+
throw new Error("usage: cotal service status [--mesh <name>] [--json]");
|
|
181
|
+
if (values.linger)
|
|
182
|
+
throw new Error("--linger is for `service install`");
|
|
183
|
+
return status(values);
|
|
184
|
+
}
|
|
185
|
+
if (sub === "uninstall") {
|
|
186
|
+
if (rest.length)
|
|
187
|
+
throw new Error("usage: cotal service uninstall [--mesh <name>]");
|
|
188
|
+
if (values.json)
|
|
189
|
+
throw new Error("--json is for `service status`");
|
|
190
|
+
if (values.linger)
|
|
191
|
+
throw new Error("--linger is for `service install`");
|
|
192
|
+
return uninstall(values);
|
|
193
|
+
}
|
|
194
|
+
throw new Error("usage: cotal service <install [--mesh <name>] [--linger] | status [--mesh <name>] [--json] | uninstall [--mesh <name>]>");
|
|
195
|
+
}
|
|
196
|
+
/** The per-install private state root: `<unit dir>/cotal-service/<spaceKey>/`. A private
|
|
197
|
+
* COTAL_HOME keeps the service manager off the login user's `~/.cotal` (mesh registry, current
|
|
198
|
+
* pointer, onboard marker resolve under it), and XDG_CONFIG_HOME under the same directory keeps
|
|
199
|
+
* the pre-seeded connector store beside it. */
|
|
200
|
+
const serviceStateDir = (unitDir, mesh) => join(unitDir, "cotal-service", spaceKey(mesh));
|
|
201
|
+
/** The 0600 EnvironmentFile a unit loads: per-mesh facts never ride ExecStart argv (command
|
|
202
|
+
* lines are a publication surface on a multi-user host). */
|
|
203
|
+
const envFileName = (mesh) => `cotal-manager@${spaceKey(mesh)}.env`;
|
|
204
|
+
function writeEnvFile(mesh, server, stateDir) {
|
|
205
|
+
const path = join(stateDir, envFileName(mesh));
|
|
206
|
+
const body = [
|
|
207
|
+
`# ${MARKER}`,
|
|
208
|
+
`COTAL_SPACE=${mesh}`,
|
|
209
|
+
// The REGISTERED server, never a default: a mesh on a non-default port would otherwise boot
|
|
210
|
+
// its unit into a permanent crash loop on the supervise target mismatch.
|
|
211
|
+
`COTAL_SERVER=${server}`,
|
|
212
|
+
`COTAL_HOME=${stateDir}`,
|
|
213
|
+
`XDG_CONFIG_HOME=${join(stateDir, "config")}`,
|
|
214
|
+
// Seeding ran synchronously in the installer; the unit must never start a lazy seed (a
|
|
215
|
+
// manager stopped mid-seed leaves a crash cursor every later manager refuses on).
|
|
216
|
+
`COTAL_SKIP_CONNECTOR_SEED=1`,
|
|
217
|
+
``,
|
|
218
|
+
].join("\n");
|
|
219
|
+
writeFileSync(path, body, { mode: 0o600 });
|
|
220
|
+
chmodSync(path, 0o600);
|
|
221
|
+
return path;
|
|
222
|
+
}
|
|
223
|
+
/** Seed connectors SYNCHRONOUSLY into the service's private config root, exactly the way the
|
|
224
|
+
* boot gate does, before the unit is enabled. A failure refuses the install: a deferred seed
|
|
225
|
+
* is how a service manager ends up running lazy seeding under supervision. */
|
|
226
|
+
function preseedService(stateDir) {
|
|
227
|
+
const env = {
|
|
228
|
+
...process.env,
|
|
229
|
+
XDG_CONFIG_HOME: join(stateDir, "config"),
|
|
230
|
+
COTAL_HOME: stateDir,
|
|
231
|
+
// A source-checkout writer is normally refused so it cannot migrate the operator-global
|
|
232
|
+
// store; here the target IS the private store this installer just created, which is the
|
|
233
|
+
// sandboxed case the opt-in names.
|
|
234
|
+
COTAL_ALLOW_CHECKOUT_SEED: "1",
|
|
235
|
+
};
|
|
236
|
+
const [node, ...entry] = selfArgv();
|
|
237
|
+
const r = spawnSync(node, [...entry, "ext", "seed"], { encoding: "utf8", env, timeout: 10 * 60_000 });
|
|
238
|
+
if (r.status !== 0)
|
|
239
|
+
throw new Error(`connector pre-seed failed (a service unit must not start a lazy seed; a stopped seed leaves a crash cursor later managers refuse on): ${(r.stdout ?? "")}${r.stderr ?? ""}`.trim());
|
|
240
|
+
console.log(c.dim(`• connectors pre-seeded under ${join(stateDir, "config")}`));
|
|
241
|
+
}
|
|
242
|
+
/** Copy the mesh's registry entry into the service's private COTAL_HOME so the supervised
|
|
243
|
+
* manager resolves the mesh exactly as an operator session would. Without the snapshot a
|
|
244
|
+
* private home is an empty registry, and `supervise` would refuse the space as unknown no
|
|
245
|
+
* matter what the EnvironmentFile says. Only the named mesh's entry is copied, never the
|
|
246
|
+
* whole registry (other meshes are not this unit's business). VALIDATES FIRST and writes
|
|
247
|
+
* nothing on a miss: the caller has not materialized any state yet, and an absent mesh must
|
|
248
|
+
* refuse before a 20-second pre-seed leaves a directory uninstall cannot name. */
|
|
249
|
+
function snapshotMeshEntry(mesh, stateDir) {
|
|
250
|
+
const entry = findMesh(mesh);
|
|
251
|
+
if (!entry)
|
|
252
|
+
throw new Error(`no mesh named "${mesh}" is registered - bring it up (\`cotal up\`) or register it (\`cotal meshes add\`) before \`cotal service install\``);
|
|
253
|
+
const dir = join(stateDir, "meshes");
|
|
254
|
+
mkdirSync(dir, { recursive: true });
|
|
255
|
+
writeFileSync(join(dir, `${spaceSegment(mesh)}.json`), JSON.stringify(entry, null, 2));
|
|
256
|
+
}
|
|
257
|
+
function install(values) {
|
|
258
|
+
const mesh = meshOf(values);
|
|
259
|
+
// The REGISTERED mesh's root and server, not this process's cwd: `--mesh` is legal from any
|
|
260
|
+
// directory, and a unit bound to whatever folder the operator stood in would write pidfiles
|
|
261
|
+
// and logs into a root that is not the mesh's. findMesh is the validation gate; an unregistered
|
|
262
|
+
// mesh refuses HERE, before any state is materialized.
|
|
263
|
+
const entry = findMesh(mesh);
|
|
264
|
+
if (!entry)
|
|
265
|
+
throw new Error(`no mesh named "${mesh}" is registered - bring it up (\`cotal up\`) or register it (\`cotal meshes add\`) before \`cotal service install\``);
|
|
266
|
+
const root = entry.root;
|
|
267
|
+
const server = entry.server;
|
|
268
|
+
// The manager is a singleton per space. Installing over a live one (typically `up --detach`'s)
|
|
269
|
+
// would put the unit in a crash-restart loop against a lease it can never take, so refuse with
|
|
270
|
+
// the exact remedy before anything is written.
|
|
271
|
+
const incumbent = managerHealthFor(root, mesh);
|
|
272
|
+
if (incumbent.state === "alive")
|
|
273
|
+
throw new Error(`a manager for mesh "${mesh}" is already running (pid ${incumbent.pid}, started by \`cotal up\` or by hand) - stop it first: \`cotal down manager\``);
|
|
274
|
+
if (incumbent.state === "unknown" || incumbent.state === "unattributable")
|
|
275
|
+
throw new Error(`the recorded manager for mesh "${mesh}" cannot be attributed (${incumbent.state}) - resolve \`${localProcessPath(MANAGER_PIDFILE, { root, space: mesh })}\` before installing the service`);
|
|
276
|
+
// BEFORE anything is written: a re-exec that silently does not happen would report a
|
|
277
|
+
// healthy service over nothing, so the argv is proven here, not at unit start. The mesh
|
|
278
|
+
// facts do NOT ride this argv (see the EnvironmentFile below).
|
|
279
|
+
const exec = [...selfArgv(), "supervise"];
|
|
280
|
+
if (process.platform === "linux") {
|
|
281
|
+
assertSystemdUser();
|
|
282
|
+
const unit = systemdUnitName(mesh);
|
|
283
|
+
const dir = userUnitDir();
|
|
284
|
+
const path = join(dir, unit);
|
|
285
|
+
const stateDir = serviceStateDir(dir, mesh);
|
|
286
|
+
// Validate FIRST, materialize after: an unregistered mesh (or a failed pre-seed) must not
|
|
287
|
+
// leave a state directory that no unit file names, because uninstall works from the unit.
|
|
288
|
+
snapshotMeshEntry(mesh, stateDir);
|
|
289
|
+
preseedService(stateDir);
|
|
290
|
+
const envFile = writeEnvFile(mesh, server, stateDir);
|
|
291
|
+
const body = [
|
|
292
|
+
`# ${MARKER}`,
|
|
293
|
+
`# cotal-mesh: ${mesh}`,
|
|
294
|
+
`# cotal-root: ${root}`,
|
|
295
|
+
`# Restart=always/20s: measured for manager units in production - a manager exits`
|
|
296
|
+
+ ` for reasons that are not failures (broker restarts, host suspend), so on-failure/5s`
|
|
297
|
+
+ ` thrashes while always/20s converges.`,
|
|
298
|
+
`[Unit]`,
|
|
299
|
+
`Description=Cotal manager for mesh ${mesh}`,
|
|
300
|
+
``,
|
|
301
|
+
`[Service]`,
|
|
302
|
+
`Type=simple`,
|
|
303
|
+
// Every value below is a path systemd will re-read: specifiers must be escaped or the
|
|
304
|
+
// unit fails at CHDIR/EXEC with status 200 over a path systemd itself rewrote.
|
|
305
|
+
`WorkingDirectory=${escapeSystemdSpecifiers(root)}`,
|
|
306
|
+
`EnvironmentFile=${escapeSystemdSpecifiers(envFile)}`,
|
|
307
|
+
`ExecStart=${exec.map((t) => escapeSystemdSpecifiers(t.includes(" ") ? JSON.stringify(t) : t)).join(" ")}`,
|
|
308
|
+
`Restart=always`,
|
|
309
|
+
`RestartSec=20s`,
|
|
310
|
+
``,
|
|
311
|
+
`[Install]`,
|
|
312
|
+
`WantedBy=default.target`,
|
|
313
|
+
``,
|
|
314
|
+
].join("\n");
|
|
315
|
+
mkdirSync(dir, { recursive: true });
|
|
316
|
+
if (existsSync(path) && !readUnitFields(path, "# cotal-mesh:", "# cotal-root:", `# ${MARKER}`).marked)
|
|
317
|
+
throw new Error(`${path} already exists and was not written by \`cotal service install\` - remove it by hand if you want this command to own it`);
|
|
318
|
+
writeFileSync(path, body);
|
|
319
|
+
systemctl(["daemon-reload"]);
|
|
320
|
+
const started = systemctl(["enable", "--now", unit]);
|
|
321
|
+
if (started.status !== 0)
|
|
322
|
+
throw new Error(`enabling ${unit} failed: ${started.output}`);
|
|
323
|
+
linger(values, mesh);
|
|
324
|
+
console.log(c.green(`✓ service installed: ${unit}`) + c.dim(` - manager for mesh "${mesh}" under ${root} (env ${envFile})`));
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
if (process.platform === "darwin") {
|
|
328
|
+
assertLaunchd();
|
|
329
|
+
const label = launchdLabel(mesh);
|
|
330
|
+
const dir = launchAgentsDir();
|
|
331
|
+
const path = join(dir, `${label}.plist`);
|
|
332
|
+
const stateDir = serviceStateDir(dir, mesh);
|
|
333
|
+
// Same validate-first rule as the Linux arm.
|
|
334
|
+
snapshotMeshEntry(mesh, stateDir);
|
|
335
|
+
preseedService(stateDir);
|
|
336
|
+
const envFile = writeEnvFile(mesh, server, stateDir);
|
|
337
|
+
const esc = (t) => t.replace(/&/g, "&").replace(/</g, "<");
|
|
338
|
+
const body = [
|
|
339
|
+
`<!-- ${MARKER} -->`,
|
|
340
|
+
`<!-- cotal-mesh: ${mesh} -->`,
|
|
341
|
+
`<!-- cotal-root: ${root} -->`,
|
|
342
|
+
`<?xml version="1.0" encoding="UTF-8"?>`,
|
|
343
|
+
`<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">`,
|
|
344
|
+
`<plist version="1.0">`,
|
|
345
|
+
`<dict>`,
|
|
346
|
+
` <key>Label</key><string>${label}</string>`,
|
|
347
|
+
` <key>ProgramArguments</key>`,
|
|
348
|
+
` <array>`,
|
|
349
|
+
...exec.map((t) => ` <string>${esc(t)}</string>`),
|
|
350
|
+
` </array>`,
|
|
351
|
+
` <key>WorkingDirectory</key><string>${esc(root)}</string>`,
|
|
352
|
+
` <key>EnvironmentVariables</key>`,
|
|
353
|
+
`<dict>`,
|
|
354
|
+
` <key>COTAL_SPACE</key><string>${esc(mesh)}</string>`,
|
|
355
|
+
` <key>COTAL_SERVER</key><string>${esc(server)}</string>`,
|
|
356
|
+
` <key>COTAL_HOME</key><string>${esc(stateDir)}</string>`,
|
|
357
|
+
` <key>XDG_CONFIG_HOME</key><string>${esc(join(stateDir, "config"))}</string>`,
|
|
358
|
+
` <key>COTAL_SKIP_CONNECTOR_SEED</key><string>1</string>`,
|
|
359
|
+
`</dict>`,
|
|
360
|
+
` <key>RunAtLoad</key><true/>`,
|
|
361
|
+
` <key>KeepAlive</key><true/>`,
|
|
362
|
+
` <key>ThrottleInterval</key><integer>20</integer>`,
|
|
363
|
+
`</dict>`,
|
|
364
|
+
`</plist>`,
|
|
365
|
+
``,
|
|
366
|
+
].join("\n");
|
|
367
|
+
mkdirSync(dir, { recursive: true });
|
|
368
|
+
if (existsSync(path) && !readUnitFields(path, "<!-- cotal-mesh:", "<!-- cotal-root:", `<!-- ${MARKER} -->`).marked)
|
|
369
|
+
throw new Error(`${path} already exists and was not written by \`cotal service install\` - remove it by hand if you want this command to own it`);
|
|
370
|
+
writeFileSync(path, body);
|
|
371
|
+
void envFile;
|
|
372
|
+
const loaded = run("launchctl", ["load", "-w", path]);
|
|
373
|
+
if (loaded.status !== 0)
|
|
374
|
+
throw new Error(`loading ${path} failed: ${loaded.output}`);
|
|
375
|
+
console.log(c.green(`✓ service installed: ${label}`) + c.dim(` - manager for mesh "${mesh}" under ${root}`));
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
throw new Error(`\`cotal service\` is not supported on ${process.platform} - it needs systemd user units (Linux) or launchd agents (macOS)`);
|
|
379
|
+
}
|
|
380
|
+
/** Linger only when asked, never silently; report an already-lingering user instead of touching it. */
|
|
381
|
+
function linger(values, mesh) {
|
|
382
|
+
const current = run("loginctl", ["show-user", String(process.getuid?.() ?? ""), "--property=Linger", "--value"]);
|
|
383
|
+
const enabled = current.status === 0 && current.output.trim() === "yes";
|
|
384
|
+
if (values.linger) {
|
|
385
|
+
if (enabled) {
|
|
386
|
+
console.log(c.dim(`• lingering already enabled for this user`));
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
const on = run("loginctl", ["enable-linger", String(process.getuid?.() ?? "")]);
|
|
390
|
+
if (on.status !== 0)
|
|
391
|
+
throw new Error(`enabling linger failed: ${on.output}`);
|
|
392
|
+
console.log(c.dim(`• lingering enabled - the user manager now starts at boot`));
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
if (enabled)
|
|
396
|
+
console.log(c.yellow(`! lingering is already enabled for this user (the service survives logout with or without it)`));
|
|
397
|
+
else
|
|
398
|
+
console.log(c.dim(`• the service stops at this user's last logout - pass --linger to keep it running (and start it at boot)`));
|
|
399
|
+
void mesh;
|
|
400
|
+
}
|
|
401
|
+
function readStatus(values) {
|
|
402
|
+
const mesh = meshOf(values);
|
|
403
|
+
const out = { installed: false, mesh };
|
|
404
|
+
if (process.platform === "linux") {
|
|
405
|
+
const unit = systemdUnitName(mesh);
|
|
406
|
+
const path = join(userUnitDir(), unit);
|
|
407
|
+
if (!existsSync(path))
|
|
408
|
+
return out;
|
|
409
|
+
const fields = readUnitFields(path, "# cotal-mesh:", "# cotal-root:", `# ${MARKER}`);
|
|
410
|
+
// The mesh field is REQUIRED, never synthesized: a unit with no recorded mesh is not
|
|
411
|
+
// provably this command's, so status does not present one as its own either.
|
|
412
|
+
if (!fields.mesh)
|
|
413
|
+
throw new Error(`${path} carries no recorded mesh - it was not written by \`cotal service install\`; reinstall it under the mesh it should serve before removing or reading it as a service`);
|
|
414
|
+
const state = systemdUnitStatus(unit);
|
|
415
|
+
return {
|
|
416
|
+
installed: true,
|
|
417
|
+
mesh: fields.mesh,
|
|
418
|
+
...(fields.root ? { root: fields.root } : {}),
|
|
419
|
+
unit: { name: unit, state: state.state, enabled: state.enabled },
|
|
420
|
+
...(fields.root ? { manager: managerHealthFor(fields.root, fields.mesh) } : {}),
|
|
421
|
+
linger: run("loginctl", ["show-user", String(process.getuid?.() ?? ""), "--property=Linger", "--value"]).output.trim() === "yes",
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
if (process.platform === "darwin") {
|
|
425
|
+
const label = launchdLabel(mesh);
|
|
426
|
+
const path = join(launchAgentsDir(), `${label}.plist`);
|
|
427
|
+
if (!existsSync(path))
|
|
428
|
+
return out;
|
|
429
|
+
const fields = readUnitFields(path, "<!-- cotal-mesh:", "<!-- cotal-root:", `<!-- ${MARKER} -->`);
|
|
430
|
+
// Same required-recorded-mesh rule as the Linux arm.
|
|
431
|
+
if (!fields.mesh)
|
|
432
|
+
throw new Error(`${path} carries no recorded mesh - it was not written by \`cotal service install\`; reinstall it under the mesh it should serve before removing or reading it as a service`);
|
|
433
|
+
const listed = run("launchctl", ["list", label]);
|
|
434
|
+
const pid = Number(listed.output.split("\t")[0]);
|
|
435
|
+
return {
|
|
436
|
+
installed: true,
|
|
437
|
+
mesh: fields.mesh,
|
|
438
|
+
...(fields.root ? { root: fields.root } : {}),
|
|
439
|
+
unit: { name: label, state: listed.status === 0 ? (Number.isInteger(pid) && pid > 0 ? "running" : "loaded") : "not-loaded", enabled: listed.status === 0 },
|
|
440
|
+
...(fields.root ? { manager: managerHealthFor(fields.root, fields.mesh) } : {}),
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
throw new Error(`\`cotal service\` is not supported on ${process.platform}`);
|
|
444
|
+
}
|
|
445
|
+
function status(values) {
|
|
446
|
+
const s = readStatus(values);
|
|
447
|
+
const facts = hostFacts();
|
|
448
|
+
if (values.json) {
|
|
449
|
+
console.log(JSON.stringify({ ...s, host: facts }, null, 2));
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
console.log(c.bold("cotal service status"));
|
|
453
|
+
if (!s.installed) {
|
|
454
|
+
console.log(c.dim(` service not installed for mesh "${s.mesh}" - install with: cotal service install --mesh ${s.mesh}`));
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
const unit = s.unit;
|
|
458
|
+
console.log(` ${"unit".padEnd(16)} ${unit.name}`);
|
|
459
|
+
console.log(` ${"unit state".padEnd(16)} ${unit.state === "active" ? c.green(unit.state) : c.yellow(unit.state)}`);
|
|
460
|
+
console.log(` ${"enabled".padEnd(16)} ${unit.enabled === true ? c.green("yes") : unit.enabled === false ? c.red("no") : c.dim("unknown")}`);
|
|
461
|
+
if (s.root)
|
|
462
|
+
console.log(` ${"root".padEnd(16)} ${s.root}`);
|
|
463
|
+
const mgr = s.manager;
|
|
464
|
+
console.log(` ${"manager".padEnd(16)} ${mgr.state === "alive" ? c.green(`running (pid ${mgr.pid})`) : c.yellow(mgr.state)}`);
|
|
465
|
+
if (s.linger !== undefined)
|
|
466
|
+
console.log(` ${"linger".padEnd(16)} ${s.linger ? c.green("enabled") : c.dim("disabled")}`);
|
|
467
|
+
}
|
|
468
|
+
console.log(` ${"arch".padEnd(16)} ${facts.arch}`);
|
|
469
|
+
console.log(` ${"os".padEnd(16)} ${facts.os}`);
|
|
470
|
+
console.log(` ${"/dev/kvm".padEnd(16)} ${facts.kvm === "present" ? c.green("present") : c.yellow(facts.kvm)}`);
|
|
471
|
+
console.log(` ${"cpus".padEnd(16)} ${facts.cpuCount}`);
|
|
472
|
+
console.log(` ${"memory".padEnd(16)} ${humanBytes(facts.memoryBytes)}`);
|
|
473
|
+
}
|
|
474
|
+
function uninstall(values) {
|
|
475
|
+
const mesh = meshOf(values);
|
|
476
|
+
if (process.platform === "linux") {
|
|
477
|
+
assertSystemdUser();
|
|
478
|
+
const unit = systemdUnitName(mesh);
|
|
479
|
+
const dir = userUnitDir();
|
|
480
|
+
const path = join(dir, unit);
|
|
481
|
+
if (!existsSync(path))
|
|
482
|
+
throw new Error(`no service unit for mesh "${mesh}" at ${path} - nothing installed by \`cotal service install\``);
|
|
483
|
+
const fields = readUnitFields(path, "# cotal-mesh:", "# cotal-root:", `# ${MARKER}`);
|
|
484
|
+
if (!fields.marked)
|
|
485
|
+
throw new Error(`${path} was not written by \`cotal service install\` (no provenance header) - this command refuses to remove operator-managed units`);
|
|
486
|
+
// Provenance keys on the marker PLUS a recorded mesh equal to the one named, never the unit
|
|
487
|
+
// name alone and never a substitution: a unit whose recorded mesh is MISSING is not
|
|
488
|
+
// provably this command's (the marker line is two lines of text anyone can write), so it is
|
|
489
|
+
// a hard refusal, the same rule `status` applies. The mesh is the identity an explicit
|
|
490
|
+
// `--mesh` pins, so uninstall works from any directory: the unit's own records name the root
|
|
491
|
+
// it serves, and a cwd-walked root here would refuse the very remedy this command's errors
|
|
492
|
+
// hand out. A mesh mismatch is still a hard refusal.
|
|
493
|
+
if (!fields.mesh)
|
|
494
|
+
throw new Error(`${path} carries no recorded mesh - it was not written by \`cotal service install\` (the marker alone is not ownership); this command refuses to remove it`);
|
|
495
|
+
if (fields.mesh !== mesh)
|
|
496
|
+
throw new Error(`${path} was installed for mesh "${fields.mesh}", not "${mesh}" - uninstall the unit under its own mesh name: \`cotal service uninstall --mesh ${fields.mesh}\``);
|
|
497
|
+
const stopped = systemctl(["disable", "--now", unit]);
|
|
498
|
+
if (stopped.status !== 0)
|
|
499
|
+
throw new Error(`disabling ${unit} failed: ${stopped.output}`);
|
|
500
|
+
rmSync(path);
|
|
501
|
+
rmSync(serviceStateDir(dir, fields.mesh), { recursive: true, force: true });
|
|
502
|
+
systemctl(["daemon-reload"]);
|
|
503
|
+
systemctl(["reset-failed", unit]);
|
|
504
|
+
const lingerOn = run("loginctl", ["show-user", String(process.getuid?.() ?? ""), "--property=Linger", "--value"]).output.trim() === "yes";
|
|
505
|
+
console.log(c.green(`✓ service removed: ${unit}`));
|
|
506
|
+
if (lingerOn)
|
|
507
|
+
console.log(c.dim(`• lingering is still enabled for this user - turn it off with \`loginctl disable-linger\` if you no longer want it`));
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
if (process.platform === "darwin") {
|
|
511
|
+
assertLaunchd();
|
|
512
|
+
const label = launchdLabel(mesh);
|
|
513
|
+
const dir = launchAgentsDir();
|
|
514
|
+
const path = join(dir, `${label}.plist`);
|
|
515
|
+
if (!existsSync(path))
|
|
516
|
+
throw new Error(`no launchd agent for mesh "${mesh}" at ${path} - nothing installed by \`cotal service install\``);
|
|
517
|
+
const fields = readUnitFields(path, "<!-- cotal-mesh:", "<!-- cotal-root:", `<!-- ${MARKER} -->`);
|
|
518
|
+
if (!fields.marked)
|
|
519
|
+
throw new Error(`${path} was not written by \`cotal service install\` (no provenance header) - this command refuses to remove operator-managed units`);
|
|
520
|
+
// Same mesh-pinned provenance rule as the Linux arm: the recorded mesh must be present and
|
|
521
|
+
// equal; a missing record is a refusal, not a substitution.
|
|
522
|
+
if (!fields.mesh)
|
|
523
|
+
throw new Error(`${path} carries no recorded mesh - it was not written by \`cotal service install\` (the marker alone is not ownership); this command refuses to remove it`);
|
|
524
|
+
if (fields.mesh !== mesh)
|
|
525
|
+
throw new Error(`${path} was installed for mesh "${fields.mesh}", not "${mesh}" - uninstall the unit under its own mesh name: \`cotal service uninstall --mesh ${fields.mesh}\``);
|
|
526
|
+
const unloaded = run("launchctl", ["unload", "-w", path]);
|
|
527
|
+
if (unloaded.status !== 0)
|
|
528
|
+
throw new Error(`unloading ${path} failed: ${unloaded.output}`);
|
|
529
|
+
rmSync(path);
|
|
530
|
+
rmSync(serviceStateDir(dir, fields.mesh), { recursive: true, force: true });
|
|
531
|
+
console.log(c.green(`✓ service removed: ${label}`));
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
throw new Error(`\`cotal service\` is not supported on ${process.platform}`);
|
|
535
|
+
}
|
|
536
|
+
export function serviceComplete(argv) {
|
|
537
|
+
if (argv.length <= 1)
|
|
538
|
+
return { items: ["install", "status", "uninstall"].map((value) => ({ value })), directive: "nofiles" };
|
|
539
|
+
return { items: [], directive: "nofiles" };
|
|
540
|
+
}
|
|
541
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/commands/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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