@cotal-ai/cli 0.183.1 → 0.184.1
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.js +6 -6
- package/dist/command.js.map +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +10 -6
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/backup-read.d.ts.map +1 -1
- package/dist/commands/backup-read.js +7 -3
- package/dist/commands/backup-read.js.map +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +22 -11
- package/dist/commands/backup.js.map +1 -1
- package/dist/commands/doctor.js +25 -7
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +18 -16
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/endpoint-authoring.d.ts.map +1 -1
- package/dist/commands/endpoint-authoring.js +13 -4
- package/dist/commands/endpoint-authoring.js.map +1 -1
- package/dist/commands/ext.d.ts.map +1 -1
- package/dist/commands/ext.js +6 -2
- package/dist/commands/ext.js.map +1 -1
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +3 -3
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/meshes-add.d.ts.map +1 -1
- package/dist/commands/meshes-add.js +16 -5
- package/dist/commands/meshes-add.js.map +1 -1
- package/dist/commands/meshes-wizard.d.ts.map +1 -1
- package/dist/commands/meshes-wizard.js +5 -4
- package/dist/commands/meshes-wizard.js.map +1 -1
- package/dist/commands/models.d.ts.map +1 -1
- package/dist/commands/models.js +21 -2
- package/dist/commands/models.js.map +1 -1
- package/dist/commands/persona-remote.d.ts.map +1 -1
- package/dist/commands/persona-remote.js +15 -11
- package/dist/commands/persona-remote.js.map +1 -1
- package/dist/commands/service-actions.d.ts.map +1 -1
- package/dist/commands/service-actions.js +6 -5
- package/dist/commands/service-actions.js.map +1 -1
- package/dist/commands/service-registry.d.ts.map +1 -1
- package/dist/commands/service-registry.js +32 -17
- package/dist/commands/service-registry.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +10 -9
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/space-registration.d.ts +2 -2
- package/dist/commands/space-registration.d.ts.map +1 -1
- package/dist/commands/space-registration.js +52 -37
- package/dist/commands/space-registration.js.map +1 -1
- package/dist/commands/space.d.ts.map +1 -1
- package/dist/commands/space.js +5 -6
- package/dist/commands/space.js.map +1 -1
- package/dist/commands/spawn-flags.d.ts +7 -1
- package/dist/commands/spawn-flags.d.ts.map +1 -1
- package/dist/commands/spawn-flags.js +1 -1
- package/dist/commands/spawn-flags.js.map +1 -1
- package/dist/commands/spawn-managed-launch.d.ts.map +1 -1
- package/dist/commands/spawn-managed-launch.js +6 -6
- package/dist/commands/spawn-managed-launch.js.map +1 -1
- package/dist/commands/spawn-preview.d.ts +3 -2
- package/dist/commands/spawn-preview.d.ts.map +1 -1
- package/dist/commands/spawn-preview.js +10 -20
- package/dist/commands/spawn-preview.js.map +1 -1
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +32 -60
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/stack-down.d.ts +2 -0
- package/dist/commands/stack-down.d.ts.map +1 -1
- package/dist/commands/stack-down.js +20 -9
- package/dist/commands/stack-down.js.map +1 -1
- package/dist/commands/stack-up.d.ts +4 -0
- package/dist/commands/stack-up.d.ts.map +1 -1
- package/dist/commands/stack-up.js +33 -9
- package/dist/commands/stack-up.js.map +1 -1
- package/dist/commands/stack-user-auth.d.ts +1 -1
- package/dist/commands/stack-user-auth.d.ts.map +1 -1
- package/dist/commands/stack-user-auth.js +3 -2
- package/dist/commands/stack-user-auth.js.map +1 -1
- package/dist/commands/status.js +3 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/team-boot-controller.d.ts.map +1 -1
- package/dist/commands/team-boot-controller.js +11 -4
- package/dist/commands/team-boot-controller.js.map +1 -1
- package/dist/commands/team-channel-remove.d.ts +2 -2
- package/dist/commands/up-args.d.ts +1 -3
- package/dist/commands/up-args.d.ts.map +1 -1
- package/dist/commands/up-args.js +15 -12
- package/dist/commands/up-args.js.map +1 -1
- package/dist/commands/up-detach.d.ts +8 -2
- package/dist/commands/up-detach.d.ts.map +1 -1
- package/dist/commands/up-detach.js +21 -14
- package/dist/commands/up-detach.js.map +1 -1
- package/dist/commands/up-stores.js +1 -1
- package/dist/commands/up-stores.js.map +1 -1
- package/dist/commands/up-target.d.ts.map +1 -1
- package/dist/commands/up-target.js +6 -4
- package/dist/commands/up-target.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +40 -16
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update-release.d.ts +1 -0
- package/dist/commands/update-release.d.ts.map +1 -1
- package/dist/commands/update-release.js +17 -6
- package/dist/commands/update-release.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +16 -10
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/use.d.ts.map +1 -1
- package/dist/commands/use.js +5 -4
- package/dist/commands/use.js.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +3 -0
- package/dist/commands/watch.js.map +1 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +2 -2
- package/dist/commands/whoami.js.map +1 -1
- package/dist/lib/agent-skills.d.ts +2 -0
- package/dist/lib/agent-skills.d.ts.map +1 -1
- package/dist/lib/agent-skills.js +23 -6
- package/dist/lib/agent-skills.js.map +1 -1
- package/dist/lib/backup-artifact.d.ts +2 -1
- package/dist/lib/backup-artifact.d.ts.map +1 -1
- package/dist/lib/backup-artifact.js +15 -2
- package/dist/lib/backup-artifact.js.map +1 -1
- package/dist/lib/channel-flags.d.ts +1 -0
- package/dist/lib/channel-flags.d.ts.map +1 -1
- package/dist/lib/channel-flags.js +9 -1
- package/dist/lib/channel-flags.js.map +1 -1
- package/dist/lib/choose-target.d.ts +4 -1
- package/dist/lib/choose-target.d.ts.map +1 -1
- package/dist/lib/choose-target.js +11 -3
- package/dist/lib/choose-target.js.map +1 -1
- package/dist/lib/credential-authority.d.ts.map +1 -1
- package/dist/lib/credential-authority.js +3 -6
- package/dist/lib/credential-authority.js.map +1 -1
- package/dist/lib/extension-stage.js +2 -2
- package/dist/lib/extension-stage.js.map +1 -1
- package/dist/lib/launch-modes.d.ts +15 -0
- package/dist/lib/launch-modes.d.ts.map +1 -0
- package/dist/lib/launch-modes.js +29 -0
- package/dist/lib/launch-modes.js.map +1 -0
- package/dist/lib/missing-flags.d.ts +1 -2
- package/dist/lib/missing-flags.d.ts.map +1 -1
- package/dist/lib/missing-flags.js +1 -2
- package/dist/lib/missing-flags.js.map +1 -1
- package/dist/lib/npm-invocation.d.ts +2 -0
- package/dist/lib/npm-invocation.d.ts.map +1 -1
- package/dist/lib/npm-invocation.js +217 -33
- package/dist/lib/npm-invocation.js.map +1 -1
- package/dist/lib/restore-listener-spawn.d.ts +27 -0
- package/dist/lib/restore-listener-spawn.d.ts.map +1 -0
- package/dist/lib/restore-listener-spawn.js +118 -0
- package/dist/lib/restore-listener-spawn.js.map +1 -0
- package/dist/lib/restore.d.ts.map +1 -1
- package/dist/lib/restore.js +6 -1
- package/dist/lib/restore.js.map +1 -1
- package/dist/lib/service-definitions.d.ts.map +1 -1
- package/dist/lib/service-definitions.js +9 -2
- package/dist/lib/service-definitions.js.map +1 -1
- package/dist/lib/service-preset-target.d.ts +3 -1
- package/dist/lib/service-preset-target.d.ts.map +1 -1
- package/dist/lib/service-preset-target.js +16 -10
- package/dist/lib/service-preset-target.js.map +1 -1
- package/dist/lib/spawn-defaults.d.ts +5 -3
- package/dist/lib/spawn-defaults.d.ts.map +1 -1
- package/dist/lib/spawn-defaults.js +38 -9
- package/dist/lib/spawn-defaults.js.map +1 -1
- package/dist/lib/store-dir.d.ts.map +1 -1
- package/dist/lib/store-dir.js +6 -4
- package/dist/lib/store-dir.js.map +1 -1
- package/dist/lib/team-additive-attempt.d.ts +5 -5
- package/dist/lib/team-channel-removal.d.ts +2 -2
- package/dist/lib/team-fresh.d.ts +2 -2
- package/dist/lib/up-broker-address.d.ts +2 -0
- package/dist/lib/up-broker-address.d.ts.map +1 -1
- package/dist/lib/up-broker-address.js +6 -0
- package/dist/lib/up-broker-address.js.map +1 -1
- package/dist/lib/update-connector-config.d.ts +4 -3
- package/dist/lib/update-connector-config.d.ts.map +1 -1
- package/dist/lib/update-connector-config.js +22 -5
- package/dist/lib/update-connector-config.js.map +1 -1
- package/dist/lib/update-manager-install-linux.d.ts +2 -1
- package/dist/lib/update-manager-install-linux.d.ts.map +1 -1
- package/dist/lib/update-manager-install-linux.js +20 -4
- package/dist/lib/update-manager-install-linux.js.map +1 -1
- package/dist/seed/paths.d.ts +3 -0
- package/dist/seed/paths.d.ts.map +1 -1
- package/dist/seed/paths.js +4 -1
- package/dist/seed/paths.js.map +1 -1
- package/dist/telemetry.d.ts +5 -4
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +34 -7
- package/dist/telemetry.js.map +1 -1
- package/package.json +5 -5
|
@@ -20,18 +20,20 @@ export function checkPublicExchangePort(raw) {
|
|
|
20
20
|
export function preparedUpRoot(value) {
|
|
21
21
|
if (!value)
|
|
22
22
|
throw new CommandFailure("refused", "USAGE_INVALID", "--root needs an existing prepared project directory; an empty value is not the current folder");
|
|
23
|
-
let root;
|
|
23
|
+
let root, hasControlDirectory;
|
|
24
24
|
try {
|
|
25
25
|
root = realpathSync(resolve(value));
|
|
26
26
|
if (!statSync(root).isDirectory())
|
|
27
27
|
throw new Error("not a directory");
|
|
28
|
-
|
|
29
|
-
if (!cotal.isDirectory() || cotal.isSymbolicLink())
|
|
30
|
-
throw new Error("not a private project directory");
|
|
28
|
+
hasControlDirectory = lstatSync(join(root, ".cotal")).isDirectory();
|
|
31
29
|
}
|
|
32
30
|
catch {
|
|
33
31
|
throw unavailableUpRoot(resolve(value));
|
|
34
32
|
}
|
|
33
|
+
if (!hasControlDirectory)
|
|
34
|
+
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", `the .cotal entry in ${root} is not a project directory; nothing was started or changed`, {
|
|
35
|
+
target: { root }, remedy: "use --root to name another prepared project, or restore this project's .cotal directory before retrying",
|
|
36
|
+
});
|
|
35
37
|
if (canonicalRoot(root) === canonicalRoot(homedir()) || canonicalRoot(join(root, ".cotal")) === canonicalRoot(homeCotalDir()))
|
|
36
38
|
throw new CommandFailure("refused", "CONFLICT", "--root names the machine's home store, not a prepared project; no stack was started there", { target: { root }, remedy: "prepare the space in a project folder with `cotal space create <space> --root <dir>`" });
|
|
37
39
|
return root;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"up-target.js","sourceRoot":"","sources":["../../src/commands/up-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC/M,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,4EAA4E;AAC5E,MAAM,UAAU,uBAAuB,CAAC,GAAuB;IAC7D,IAAI,GAA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CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,kCAAkC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1J,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAA8B,MAAM,sBAAsB,CAAC;AAajF,OAAO,EAWL,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EA8CL,KAAK,eAAe,EAUrB,MAAM,qBAAqB,CAAC;AAgC7B,OAAO,EAAqE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAK/H,OAAO,EAcL,KAAK,eAAe,EAErB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAA8B,MAAM,sBAAsB,CAAC;AAajF,OAAO,EAWL,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EA8CL,KAAK,eAAe,EAUrB,MAAM,qBAAqB,CAAC;AAgC7B,OAAO,EAAqE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAK/H,OAAO,EAcL,KAAK,eAAe,EAErB,MAAM,mBAAmB,CAAC;AAqF3B,OAAO,EAAE,KAAK,iBAAiB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE7K,OAAO,EAAE,KAAK,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE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CAAC,CAInK;AA2DD;;;gCAGgC;AAChC,wBAAsB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAU/D;AAkBD;2FAC2F;AAC3F,wBAAsB,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,eAAe,EAAE,aAAa,UAAQ,EAAE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDtK;AAgiDD,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/commands/up.js
CHANGED
|
@@ -39,9 +39,10 @@ import { extensionNames, preflightRuntime } from "../ext-loader.js";
|
|
|
39
39
|
import { completingFlagValue } from "../lib/completion.js";
|
|
40
40
|
import { metadataPositionals } from "../lib/command-path.js";
|
|
41
41
|
import { isManagerCommittedRestore, markPreparedRestoreDegraded, heldRestoreAttempt, heldClaim, movedFolderRefusal, prepareRestore, restoreArtifactPath, restoreLaunch, preservedSourceState, rehydratePreparedRestore, journaledMaxFileStore, rearmUnboundRestore, replacePreparedDeadRestoreListener, } from "../lib/restore.js";
|
|
42
|
+
import { freezeSmokeRestoreListener, spawnMarkedListener, unreadableUnboundRestoreRefusal } from "../lib/restore-listener-spawn.js";
|
|
42
43
|
import { attemptProcessesGone } from "../lib/isolated-broker.js";
|
|
43
44
|
import { assertEndpointUnreachable } from "../lib/endpoint-cut.js";
|
|
44
|
-
import { freshStackServer, legacyUpRetry, retryStackAddress, serverWithFreePort } from "../lib/up-broker-address.js";
|
|
45
|
+
import { freshStackServer, legacyUpRetry, retryRecordedStackAddress, retryStackAddress, serverWithFreePort } from "../lib/up-broker-address.js";
|
|
45
46
|
import { pendingRestores, pendingOrdinaryResumes } from "./up-pending.js";
|
|
46
47
|
import { parseMaxFileStore, parseAuthTimeout, parseMaxPayload, assertManagerPayload, parseAccountResolver, authTimeoutArgs, refuseRunningElsewhere, refuseRecordsElsewhere, resolveTransport, assertTlsIntentServed, assertTlsAddressServed, tlsAddress, liveListenerRequiresTls, assertServesDialHost, reopenLastStore, refuseMissingNamedStore, checkStartStore, } from "./up-transport.js";
|
|
47
48
|
import { reconcileHostAndServer } from "./up-host.js";
|
|
@@ -354,6 +355,12 @@ function removeEmptyRecords(path) {
|
|
|
354
355
|
}
|
|
355
356
|
}
|
|
356
357
|
const NO_MANAGER_DURING_RECOVERY = "--no-manager is refused while this root has a maintenance attempt to recover - a resume needs a manager to commit the preserved inventory; recover it (`cotal up` alone) or roll it back first";
|
|
358
|
+
function unfinishedPreservedStop(root, space) {
|
|
359
|
+
return new CommandFailure("refused", "LIFECYCLE_BLOCKED", "the preserved stop committed but has not finished; nothing was started", {
|
|
360
|
+
target: { root, space, state: "cut-committed" },
|
|
361
|
+
remedy: `from ${codeSpan(shellWord(root))}, finish the stop with \`cotal down --preserve-state\`, then resume with \`cotal up\``,
|
|
362
|
+
});
|
|
363
|
+
}
|
|
357
364
|
function retainedStartupPresentationRefusal(root) {
|
|
358
365
|
return new CommandFailure("refused", "UNSUPPORTED", "this startup uses the retained native launcher, which has no structured or plain receipt; nothing was started", { target: { root }, remedy: "use a fresh prepared root with static auth, --open, or plain-loopback --user-auth for the controller-owned stack, or omit --json/--plain" });
|
|
359
366
|
}
|
|
@@ -512,8 +519,12 @@ async function runUp(args, invokedFrom, inheritedLock, onAdopt, freshTeamBoot =
|
|
|
512
519
|
// manager half. The manager half is why the FLAG specifically cannot apply. A settled active
|
|
513
520
|
// restore of this root's own controller stack has nothing left to commit; it takes the
|
|
514
521
|
// controller stack route below, which applies --no-manager as an ordinary start does.
|
|
515
|
-
|
|
522
|
+
const brokerOnlyJournal = values["no-manager"] ? readMaintenanceJournal(root) : undefined;
|
|
523
|
+
if (brokerOnlyJournal && !admittedStackRestore(root)) {
|
|
524
|
+
if (brokerOnlyJournal.state === "cut-committed" && !cutController(brokerOnlyJournal.cut))
|
|
525
|
+
throw unfinishedPreservedStop(root, brokerOnlyJournal.space);
|
|
516
526
|
throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", NO_MANAGER_DURING_RECOVERY, { target: { root } });
|
|
527
|
+
}
|
|
517
528
|
// Refuse first-enable IdP failures and explicit pin conflicts before even recovery's lock
|
|
518
529
|
// creates its layout. Existing recovery keeps its own recorded startup and trust checks.
|
|
519
530
|
const stackSpace = values.space ?? folderSpace();
|
|
@@ -794,6 +805,8 @@ async function runUp(args, invokedFrom, inheritedLock, onAdopt, freshTeamBoot =
|
|
|
794
805
|
throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", `cotal up is refused: backup attempt ${attempt} stopped before it finished and still holds this root; nothing was changed`, { target: { root, attemptId: attempt }, remedy: `release it with \`cotal backup recover ${attempt} --yes\`, then run \`cotal up\`` });
|
|
795
806
|
}
|
|
796
807
|
else if (journal) {
|
|
808
|
+
if (journal.state === "cut-committed" && !controllerCut)
|
|
809
|
+
throw unfinishedPreservedStop(root, journal.space);
|
|
797
810
|
throw new Error(`cotal up is refused while maintenance state is ${journal.state}; follow the recorded recovery`);
|
|
798
811
|
}
|
|
799
812
|
// The re-entries run INSIDE this block, under the lock the journal was just written with, and
|
|
@@ -1016,7 +1029,9 @@ async function runUp(args, invokedFrom, inheritedLock, onAdopt, freshTeamBoot =
|
|
|
1016
1029
|
try {
|
|
1017
1030
|
const stackServer = values.server ?? readStackJournal(meshRoot)?.journal.server ?? localMeshesForRoot(meshRoot).find((m) => m.space === stackSpace)?.server ?? await unrecordedStackServer(meshRoot, stackSpace, values.host);
|
|
1018
1031
|
return await stackUp({ maintenanceLock: stackLock, root: meshRoot, space: stackSpace, server: stackServer, transport, runtime: values.runtime ?? "pty", noManager, managerSeatCap, ...(stackMode ? { mode: stackMode } : {}), ...(values.idp ? { idp: values.idp } : {}), ...(values.host ? { host: values.host } : {}), ...(values["store-dir"] ? { storeDir: values["store-dir"] } : {}), ...(values["rotate-sys"] ? { rotateSys: true } : {}), ...(values["recreate-membership-store"] ? { recreateMembershipStore: true } : {}), ...(values["recreate-issued-stores"] !== undefined ? { recreateIssuedStores: resolve(values["recreate-issued-stores"]) } : {}), ...(maxFileStore !== undefined ? { maxFileStore } : {}), ...(logFile !== undefined ? { logFile } : {}), ...(logfileSizeLimit !== undefined ? { logfileSizeLimit } : {}), ...(logfileMaxNum !== undefined ? { logfileMaxNum } : {}), ...(authTimeout !== undefined ? { authTimeout } : {}), ...(maxPayload !== undefined ? { maxPayload } : {}), ...(accountResolver !== undefined ? { accountResolver } : {}), ...(maxSessions !== undefined ? { maxSessions } : {}), ...(values.channels ? { channels: values.channels } : {}), ...(values.__invokedRoot ? { invokedRoot: values.__invokedRoot } : {}), foreground: values.foreground === true, presentation,
|
|
1019
|
-
|
|
1032
|
+
simpleTargetedStartup: Object.entries(args.values).every(([key, value]) => value === undefined ||
|
|
1033
|
+
["space", "root", "detach", "foreground", "no-manager", "plain", "json", "__invokedRoot", "__folderNamed"].includes(key)),
|
|
1034
|
+
managerName, retryAtRecordedAddress: () => retryRecordedStackAddress(args.raw, invokedFrom), retryAtAnotherAddress: (host) => retryStackAddress(args.raw, invokedFrom, stackServer, host),
|
|
1020
1035
|
}, native);
|
|
1021
1036
|
}
|
|
1022
1037
|
finally {
|
|
@@ -1153,7 +1168,8 @@ async function runUp(args, invokedFrom, inheritedLock, onAdopt, freshTeamBoot =
|
|
|
1153
1168
|
// So EVERY helper below that journals under this lock takes it as a parameter, on both the restore
|
|
1154
1169
|
// and the ordinary side: the two ADOPT paths (proven-restore and proven-ordinary listeners, which
|
|
1155
1170
|
// recover by adopting an already-live listener rather than spawning a competitor), the spawn-path
|
|
1156
|
-
// listener binds (detached and foreground, restore and ordinary), the
|
|
1171
|
+
// listener binds (detached and foreground, restore and ordinary), the unbound restore spawn mark,
|
|
1172
|
+
// the dead-listener replacement,
|
|
1157
1173
|
// `completeResumeActivation` and the manager-commit / activation / degraded writers it calls.
|
|
1158
1174
|
//
|
|
1159
1175
|
// Read that list as a rule, not an inventory. The trap is that a call site with no lock ARGUMENT
|
|
@@ -1299,14 +1315,19 @@ async function runUp(args, invokedFrom, inheritedLock, onAdopt, freshTeamBoot =
|
|
|
1299
1315
|
replacePreparedDeadRestoreListener(restoredAttempt, startupLock);
|
|
1300
1316
|
}
|
|
1301
1317
|
else if (restoredAttempt) {
|
|
1302
|
-
// No listener is bound
|
|
1303
|
-
//
|
|
1304
|
-
//
|
|
1305
|
-
//
|
|
1306
|
-
const naming =
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
if (naming.
|
|
1318
|
+
// No listener is bound. An interrupted spawn may still be opening the restored store, so a
|
|
1319
|
+
// process naming the attempt must be gone. When command lines cannot be read, the attempt's
|
|
1320
|
+
// spawn mark and the published pid's creation-time pin decide. A recorded spawn with no
|
|
1321
|
+
// published pid refuses. A pin that does not match is a reused pid and does not block.
|
|
1322
|
+
const naming = process.env.COTAL_SMOKE_UNREADABLE_PROCESSES === "1"
|
|
1323
|
+
? { kind: "unreadable", why: "process command lines were not read" }
|
|
1324
|
+
: processesNaming(restoredAttempt.attemptId);
|
|
1325
|
+
if (naming.kind === "unreadable") {
|
|
1326
|
+
const refusal = unreadableUnboundRestoreRefusal(restoredAttempt.root, restoredAttempt.attemptId, restoredAttempt.serverName, naming.why);
|
|
1327
|
+
if (refusal)
|
|
1328
|
+
throw new Error(refusal);
|
|
1329
|
+
}
|
|
1330
|
+
if (naming.kind === "pids" && naming.pids.length)
|
|
1310
1331
|
throw new Error(`restore attempt ${resumeAttempt} re-entry has no bound listener proof, and process ${naming.pids.join(", ")} started for it still runs; stop it, then run \`${displayCmd()} up\` again; preserving recovery state`);
|
|
1311
1332
|
if (await isReachable(restoredAttempt.server))
|
|
1312
1333
|
throw new Error(`restore attempt ${resumeAttempt} refuses the occupied foreign listener at ${restoredAttempt.server}`);
|
|
@@ -1504,7 +1525,7 @@ async function runUp(args, invokedFrom, inheritedLock, onAdopt, freshTeamBoot =
|
|
|
1504
1525
|
if (belowPresenceSafeBroker(v.version) && v.presenceFileBacked)
|
|
1505
1526
|
console.error(c.yellow(`! nats-server ${v.version} is below 2.14.5 and the presence bucket of "${held.space}" is file-backed: it can latch after a stall and close the mesh to new joins (#1356); put a nats-server 2.14.5 or newer on PATH (it wins over the bundled one)`));
|
|
1506
1527
|
if (await fileMembershipStore(server, held.space, reconcileCreds))
|
|
1507
|
-
throw membershipConversionRefusal(held.space,
|
|
1528
|
+
throw membershipConversionRefusal(held.space, `${stopAdvice()}; then retry the original start from its original folder with \`--recreate-membership-store\``);
|
|
1508
1529
|
for (const r of await reconcileSpaceMemoryBuckets({ servers: server, space: held.space, creds: reconcileCreds }))
|
|
1509
1530
|
console.log(c.dim(r.recreated
|
|
1510
1531
|
? ` re-created ${r.stream}: it is Memory-backed and was lost when the broker restarted`
|
|
@@ -1725,6 +1746,7 @@ async function runUp(args, invokedFrom, inheritedLock, onAdopt, freshTeamBoot =
|
|
|
1725
1746
|
resumeAttempt,
|
|
1726
1747
|
resumeCommit: commitTokenHandoff(cotalRoot(), (restored?.managerCommit ?? ordinaryAttempt?.managerCommit) !== undefined, startupLock),
|
|
1727
1748
|
boundListener,
|
|
1749
|
+
heldLock: startupLock,
|
|
1728
1750
|
...(quietRestore ? { quietBoot: true } : {}),
|
|
1729
1751
|
});
|
|
1730
1752
|
// Transport policy is committed inside startMeshDetached before delivery launch (S5+S9).
|
|
@@ -1818,11 +1840,12 @@ async function runUp(args, invokedFrom, inheritedLock, onAdopt, freshTeamBoot =
|
|
|
1818
1840
|
console.log(c.dim("Press Ctrl-C to stop.\n"));
|
|
1819
1841
|
const listenerStartedAt = new Date().toISOString();
|
|
1820
1842
|
// Keep the POSIX broker out of the terminal's process group for manager-first teardown on Ctrl-C.
|
|
1821
|
-
const child = spawnBroker(bin, natsArgs, { cwd: cotalRoot(), stdio: "inherit", detached: process.platform !== "win32", windowsHide: false });
|
|
1822
|
-
|
|
1843
|
+
const child = spawnMarkedListener(cotalRoot(), restored, () => spawnBroker(bin, natsArgs, { cwd: cotalRoot(), stdio: "inherit", detached: process.platform !== "win32", windowsHide: false }), startupLock);
|
|
1844
|
+
freezeSmokeRestoreListener(child);
|
|
1845
|
+
await recordSpawnedListener(child, listenerStartedAt, boundListener, startupLock);
|
|
1823
1846
|
const foreground = holdForegroundListener({ child, server, space, executable: natsServer, log: brokerOutput, resuming: resumeAttempt !== undefined, restored, releaseStartupLock });
|
|
1824
1847
|
try {
|
|
1825
|
-
await awaitSpawnedListener({ child, executable: natsServer, server, space, creds: setup?.creds, tls: transport.kind === "tls-required", log: brokerOutput, boundListener });
|
|
1848
|
+
await awaitSpawnedListener({ child, executable: natsServer, server, space, creds: setup?.creds, tls: transport.kind === "tls-required", log: brokerOutput, boundListener, heldLock: startupLock });
|
|
1826
1849
|
foreground.listenerReady();
|
|
1827
1850
|
await foreground.waitForRestoreStop();
|
|
1828
1851
|
// A DAEMON THAT DIES UNDER THIS RUNNING BROKER IS RESTARTED HERE (#2469). It exits on its own once
|
|
@@ -1891,6 +1914,7 @@ async function runUp(args, invokedFrom, inheritedLock, onAdopt, freshTeamBoot =
|
|
|
1891
1914
|
noManager,
|
|
1892
1915
|
onDeliveryExit,
|
|
1893
1916
|
isStopping: foreground.isStopping,
|
|
1917
|
+
heldLock: startupLock,
|
|
1894
1918
|
}));
|
|
1895
1919
|
await foreground.waitForRestoreStop();
|
|
1896
1920
|
if (noManager && setup && controlPlane)
|