@nice-code/commander 0.105.0 → 0.106.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/build/cli.cjs +171 -41
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +171 -42
- package/build/cli.mjs.map +1 -1
- package/build/client/assets/{index-DnkcXn4a.js → index-RGFhhnpd.js} +2 -2
- package/build/client/assets/{index-DnkcXn4a.js.map → index-RGFhhnpd.js.map} +1 -1
- package/build/client/index.html +1 -1
- package/build/{main-C5HqmZgp.mjs → main-1B7viLr8.mjs} +9 -4
- package/build/{main-C5HqmZgp.mjs.map → main-1B7viLr8.mjs.map} +1 -1
- package/build/{main-vXl0q1X7.cjs → main-BHPsC_5Q.cjs} +8 -3
- package/build/main-BHPsC_5Q.cjs.map +1 -0
- package/package.json +6 -6
- package/build/main-vXl0q1X7.cjs.map +0 -1
package/build/client/index.html
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
* { box-sizing: border-box; }
|
|
26
26
|
</style>
|
|
27
|
-
<script type="module" crossorigin src="/assets/index-
|
|
27
|
+
<script type="module" crossorigin src="/assets/index-RGFhhnpd.js"></script>
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/assets/index-DLZZdohI.css">
|
|
29
29
|
</head>
|
|
30
30
|
<body>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as createRealmServerEngine, B as overrideFingerprint, C as commanderRuntimeError, D as resolveCommanderDataDir, E as ensureStateDir, F as createMemoryStorageAdapter_json, G as withDependencies, H as loadCommanderConfigFile, I as wsAcceptorCarrier, J as recordDaemonAlive, K as savedFilterId, L as validateCommanderConfig, M as serveChannel, N as createDefaultServeLogger, O as findDaemonProcesses, P as RuntimeCoordinate, R as effectiveEnv, S as commanderStatusRealm, T as commanderStatePaths, U as orderByDependency, V as hashCanonical, W as stopSetWithDependencies, X as writeInstanceRecord, Y as removeInstanceRecord, a as parseLogsClientMessage, b as COMMANDER_TICKET_PROTOCOL_PREFIX, c as identifyEndpointOwner, d as countOverrides, f as readEnvOverrides, i as runTaskPool, j as httpAcceptorCarrier, k as createRealmAcceptor, l as signalStray, m as commanderControlDomain, n as readSavedFilters, o as ancestors, p as commanderChannel, q as readInstanceRecord, r as writeSavedFilters, s as createPortInspector, t as mutateSavedFilters, u as applyEnvMutation, w as commanderPackageVersion, z as envVarViews } from "./cli.mjs";
|
|
2
2
|
import { cp, readFile, realpath, rm, stat } from "node:fs/promises";
|
|
3
3
|
import { extname, isAbsolute, join, normalize, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { createNiceProcess, openProcessLedger, readProcessStartStamp, signalProcessGroup, taskkillTree } from "@nice-code/process";
|
|
@@ -2181,6 +2181,8 @@ async function startCommanderDaemon(argv) {
|
|
|
2181
2181
|
const daemonLog = new RotatingLog(paths.daemonLogDir, "daemon");
|
|
2182
2182
|
const log = (line) => daemonLog.write(`${(/* @__PURE__ */ new Date()).toISOString()} ${line}`);
|
|
2183
2183
|
log(`boot pid=${process.pid} runtime=${process.version} config=${file.configPath}`);
|
|
2184
|
+
const peers = await findDaemonProcesses(configArg, argValue(argv, "--data-dir") ?? dataDir);
|
|
2185
|
+
if (peers.length > 0) throw new Error(`another nice-commander daemon (pid ${peers.map((peer) => peer.pid).join(", ")}) already serves this config — stop it first (\`nice-commander shutdown\`).`);
|
|
2184
2186
|
await scavengeDeadDaemons(dataDir, resolved.configKey, log);
|
|
2185
2187
|
const servesOwnClient = await pinClientBundle(paths.stateDir).catch((error) => {
|
|
2186
2188
|
log(`client bundle not pinned (serving it live): ${error.message}`);
|
|
@@ -2420,6 +2422,9 @@ async function startCommanderDaemon(argv) {
|
|
|
2420
2422
|
log(`config reload failed (last-good kept): ${reloadErrors.join("; ")}`);
|
|
2421
2423
|
}
|
|
2422
2424
|
});
|
|
2425
|
+
const removeOwnRecord = async () => {
|
|
2426
|
+
if ((await readInstanceRecord(paths.instanceRecordPath))?.pid === process.pid) await removeInstanceRecord(paths.instanceRecordPath);
|
|
2427
|
+
};
|
|
2423
2428
|
let shutdownInFlight = null;
|
|
2424
2429
|
shutdown = () => {
|
|
2425
2430
|
shutdownInFlight ??= (async () => {
|
|
@@ -2428,7 +2433,7 @@ async function startCommanderDaemon(argv) {
|
|
|
2428
2433
|
watcher = null;
|
|
2429
2434
|
const { errors: stopErrors } = await supervisor.shutdown();
|
|
2430
2435
|
for (const line of stopErrors) log(`stop error: ${line}`);
|
|
2431
|
-
await
|
|
2436
|
+
await removeOwnRecord();
|
|
2432
2437
|
plane.close();
|
|
2433
2438
|
logsPlane.close();
|
|
2434
2439
|
wss.close();
|
|
@@ -2452,7 +2457,7 @@ async function startCommanderDaemon(argv) {
|
|
|
2452
2457
|
if (signalCount === 2) {
|
|
2453
2458
|
log(`${signal} again: escalating to force`);
|
|
2454
2459
|
supervisor.forceStopAll().finally(() => {
|
|
2455
|
-
|
|
2460
|
+
removeOwnRecord().finally(() => process.exit(1));
|
|
2456
2461
|
});
|
|
2457
2462
|
return;
|
|
2458
2463
|
}
|
|
@@ -2481,4 +2486,4 @@ async function runCommanderDaemon(argv) {
|
|
|
2481
2486
|
//#endregion
|
|
2482
2487
|
export { runCommanderDaemon };
|
|
2483
2488
|
|
|
2484
|
-
//# sourceMappingURL=main-
|
|
2489
|
+
//# sourceMappingURL=main-1B7viLr8.mjs.map
|