@cotal-ai/cli 0.171.4 → 0.172.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.
Files changed (85) hide show
  1. package/dist/command.d.ts.map +1 -1
  2. package/dist/command.js +54 -21
  3. package/dist/command.js.map +1 -1
  4. package/dist/commands/down.d.ts.map +1 -1
  5. package/dist/commands/down.js +19 -6
  6. package/dist/commands/down.js.map +1 -1
  7. package/dist/commands/ext.d.ts +1 -1
  8. package/dist/commands/ext.d.ts.map +1 -1
  9. package/dist/commands/ext.js +70 -13
  10. package/dist/commands/ext.js.map +1 -1
  11. package/dist/commands/help.js +2 -2
  12. package/dist/commands/help.js.map +1 -1
  13. package/dist/commands/service-actions.d.ts.map +1 -1
  14. package/dist/commands/service-actions.js +22 -12
  15. package/dist/commands/service-actions.js.map +1 -1
  16. package/dist/commands/space-registration.d.ts.map +1 -1
  17. package/dist/commands/space-registration.js +9 -3
  18. package/dist/commands/space-registration.js.map +1 -1
  19. package/dist/commands/space.d.ts.map +1 -1
  20. package/dist/commands/space.js +40 -29
  21. package/dist/commands/space.js.map +1 -1
  22. package/dist/commands/spawn.js +1 -1
  23. package/dist/commands/spawn.js.map +1 -1
  24. package/dist/commands/stack-down.d.ts.map +1 -1
  25. package/dist/commands/stack-down.js +5 -4
  26. package/dist/commands/stack-down.js.map +1 -1
  27. package/dist/commands/stack-up.d.ts +5 -0
  28. package/dist/commands/stack-up.d.ts.map +1 -1
  29. package/dist/commands/stack-up.js +46 -20
  30. package/dist/commands/stack-up.js.map +1 -1
  31. package/dist/commands/status.d.ts +2 -1
  32. package/dist/commands/status.d.ts.map +1 -1
  33. package/dist/commands/status.js +50 -28
  34. package/dist/commands/status.js.map +1 -1
  35. package/dist/commands/up.d.ts +1 -1
  36. package/dist/commands/up.d.ts.map +1 -1
  37. package/dist/commands/up.js +34 -22
  38. package/dist/commands/up.js.map +1 -1
  39. package/dist/commands/update.d.ts +6 -5
  40. package/dist/commands/update.d.ts.map +1 -1
  41. package/dist/commands/update.js +281 -39
  42. package/dist/commands/update.js.map +1 -1
  43. package/dist/commands/whoami.d.ts.map +1 -1
  44. package/dist/commands/whoami.js +2 -1
  45. package/dist/commands/whoami.js.map +1 -1
  46. package/dist/lib/broker-service.d.ts +6 -4
  47. package/dist/lib/broker-service.d.ts.map +1 -1
  48. package/dist/lib/broker-service.js +36 -6
  49. package/dist/lib/broker-service.js.map +1 -1
  50. package/dist/lib/extension-stage.d.ts +1 -1
  51. package/dist/lib/extension-stage.d.ts.map +1 -1
  52. package/dist/lib/extension-stage.js +26 -11
  53. package/dist/lib/extension-stage.js.map +1 -1
  54. package/dist/lib/restore.d.ts +3 -2
  55. package/dist/lib/restore.d.ts.map +1 -1
  56. package/dist/lib/restore.js +12 -10
  57. package/dist/lib/restore.js.map +1 -1
  58. package/dist/lib/self-exec.d.ts +2 -0
  59. package/dist/lib/self-exec.d.ts.map +1 -1
  60. package/dist/lib/self-exec.js +5 -1
  61. package/dist/lib/self-exec.js.map +1 -1
  62. package/dist/lib/service-preset-target.d.ts +2 -1
  63. package/dist/lib/service-preset-target.d.ts.map +1 -1
  64. package/dist/lib/service-preset-target.js +11 -2
  65. package/dist/lib/service-preset-target.js.map +1 -1
  66. package/dist/lib/service-systemd.d.ts +3 -3
  67. package/dist/lib/service-systemd.d.ts.map +1 -1
  68. package/dist/lib/service-systemd.js +6 -6
  69. package/dist/lib/service-systemd.js.map +1 -1
  70. package/dist/lib/up-report.d.ts.map +1 -1
  71. package/dist/lib/up-report.js +9 -6
  72. package/dist/lib/up-report.js.map +1 -1
  73. package/dist/lib/update-pending.d.ts +1 -0
  74. package/dist/lib/update-pending.d.ts.map +1 -1
  75. package/dist/lib/update-pending.js +4 -3
  76. package/dist/lib/update-pending.js.map +1 -1
  77. package/dist/lib/version.d.ts +1 -0
  78. package/dist/lib/version.d.ts.map +1 -1
  79. package/dist/lib/version.js +2 -2
  80. package/dist/lib/version.js.map +1 -1
  81. package/dist/seed/reconcile.d.ts +2 -0
  82. package/dist/seed/reconcile.d.ts.map +1 -1
  83. package/dist/seed/reconcile.js +30 -11
  84. package/dist/seed/reconcile.js.map +1 -1
  85. package/package.json +4 -4
@@ -5,7 +5,7 @@ import { type PreparedManifest } from "../lib/manifest/index.js";
5
5
  import { type ExistingStorePin, type StackUpNative } from "./stack-up.js";
6
6
  import { type PreparedRestore } from "../lib/restore.js";
7
7
  /** What a guarded restore returned, for `backup restore` to report as its own receipt. `up --restore`
8
- * never sets a sink and its output is unchanged. Delivered only after the native activation wrote
8
+ * never sets a sink and prints its own startup receipt. Delivered only after the native activation wrote
9
9
  * the active journal; every earlier failure still throws through the same restore guards. */
10
10
  export interface RestoreStartupResult {
11
11
  attemptId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AAsBA,OAAO,EAaL,KAAK,eAAe,EA+BpB,KAAK,YAAY,EAEjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAOL,KAAK,OAAO,EA+DZ,KAAK,SAAS,EAyBd,KAAK,eAAe,EAwCrB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAA+E,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAclI,OAAO,EAA4C,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAa3G,OAAO,EAYL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAEnB,MAAM,eAAe,CAAC;AAuBvB,OAAO,EAsBL,KAAK,eAAe,EAErB,MAAM,mBAAmB,CAAC;AAS3B;;8FAE8F;AAC9F,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE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AAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsD3F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEnF;AAED;;;;;;;;;;GAUG;AACH,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAExC;;mCAEmC;AACnC,eAAO,MAAM,oBAAoB,GAAI,GAAG,SAAS,EAAE,YAAY,UAAU,KAAG,IAAoC,CAAC"}
@@ -10,7 +10,7 @@ import { basename, dirname, isAbsolute, join, resolve } from "node:path";
10
10
  import { isReachable, dialerFor, DEFAULT_SERVER, DEFAULT_SPACE, SERVICE_AUTHORITY_MAX_BYTES, SERVICE_CALLER_PAYLOAD_FLOOR, CONTRACT_ARTIFACT_MAX_BYTES, MANAGER_START_PAYLOAD_FLOOR, createSpaceAuth, serverConfig, openServerConfig, validateTlsMaterial, credsProblem, mintCreds, mintLifecycleUid, DEV_OWNER, mintConnectionEvictorCreds, mintMembershipObserverCreds, newIdentity, setupSpaceStreams, removeIssuedStoresBeforeRetention, IssuedStoreBeforeRetentionError, IssuedStoreRecreateRefusal, reconcileSpaceMemoryBuckets, membershipStoreDefinition, LEGACY_MEMBERSHIP_MAX_BYTES, MEMBERSHIP_MAX_VALUE_SIZE, ttlBuckets, standaloneConnectOpts, requireBrokerFloor, parseServerVersion, presenceBucket, spaceDeletionStreams, isJetStreamMissing, seedChannelRegistry, ensureDefaultDeliveryClass, UndecodableRegistryEntry, LEASE_TTL_MS, EpEnvelopeError, mkSecretDir, openPrivateAppend, writeSecretFile, } from "@cotal-ai/core";
11
11
  import { JetStreamApiCodes, jetstreamManager, StorageType } from "@nats-io/jetstream";
12
12
  import { Kvm } from "@nats-io/kv";
13
- import { assertManagerName, readManagerName, readManagerSeatCap, recordManagerName, parseSeatCapFlag, seatCapText, CommandFailure, codeSpan, commandFailureReport, failureEnvelope, writeEnvelope, isCommandFailure, protectedLocalDirectory, jsonFlag, plainFlag, renderReport, assertSingleSpaceBroker, assertUserAuthInfo, authDir, brokerAddressForDisplay, brokerPolicyPath, getSoleSpaceAuth, soleSpaceOf, getSpaceAuth, hasUserAuthState, listSpaceAccounts, preloadSpaceAccounts, putSpaceAuth, brokerAddressKey, canonicalRoot, rootPathProblem, rootControlProblem, clearCurrent, findMesh, findPreparedSpace, homeCotalDir, legacyStackOtherHome, stackHomeRemedy, getCurrent, loadMeshes, preparedSpaceAt, removePreparedSpace, localMeshesForRoot, keepsRegistration, oneLine, presentationOf, writeResult, connectionEvictorCredsKey, membershipConfigPath, membershipObserverCredsKey, membershipRwCredsKey, MEMBERSHIP_CONFIG_KIND, MEMBERSHIP_RW_CREDS_KIND, WEB_CREDS_KIND, webCredsKey, parsePositiveIntegerFlag, recordMesh, retainedLegacyBroker, meshesForRoot, removeMesh, rotateSystemCreds, setAdoptedCurrent, staleSystemCreds, SYSTEM_CREDS_FILES, userAuthStateDir, userAuthSpacesOnDisk, workspaceSecretStore, acquireMaintenanceLock, assertStoreIdentity, assessMaintenanceClaim, assessRestoreClaim, beginOrdinaryResume, bindOrdinaryResumeListener, consumeRetiredMaintenance, markOrdinaryResumeActive, markOrdinaryResumeDegraded, replaceDeadOrdinaryResumeListener, localProcessOwnerStatus, readMaintenanceJournal, rootNamesNoSpace, readMaintenanceResumeDocument, readStoreIdentity, recordOrdinaryResumeManagerCommit, releaseMaintenanceLock, retireOrdinaryResume, settleTokenHandoff, sweepTokenHandoff, writeTokenHandoff, sameStoreIdentity, cutController, readBrokerPolicy, writeBrokerPolicy, brokerAccountResolver, removePidPair, writePidPair, verifyIdentityPin, processesNaming, isLoopbackHost, connectUserControlOrThrow, userViewAuth, recordOperationSpace, recordsElsewhereError, recordOperationWarning, retainSystemSigningSeed, restoreLeftOut, SPACE_NAME_MAX, spaceNameTooLong, NATS_PIDFILE, MANAGER_PIDFILE, DELIVERY_PIDFILE, AUTH_PIDFILE, localProcessPath, UNTRUSTED_CERTIFICATE, exitCode, canonicalLocalProcessPath, DELIVERY_LOGFILE, terminalWidth, } from "@cotal-ai/workspace";
13
+ import { assertManagerName, processStopped, readManagerName, readManagerSeatCap, recordManagerName, parseSeatCapFlag, seatCapText, CommandFailure, codeSpan, commandFailureReport, failureEnvelope, writeEnvelope, isCommandFailure, protectedLocalDirectory, jsonFlag, plainFlag, renderReport, assertSingleSpaceBroker, assertUserAuthInfo, authDir, brokerAddressForDisplay, brokerPolicyPath, getSoleSpaceAuth, soleSpaceOf, getSpaceAuth, hasUserAuthState, listSpaceAccounts, preloadSpaceAccounts, putSpaceAuth, brokerAddressKey, canonicalRoot, rootPathProblem, rootControlProblem, clearCurrent, findMesh, findPreparedSpace, homeCotalDir, legacyStackOtherHome, stackHomeRemedy, getCurrent, loadMeshes, preparedSpaceAt, removePreparedSpace, localMeshesForRoot, keepsRegistration, oneLine, presentationOf, writeResult, connectionEvictorCredsKey, membershipConfigPath, membershipObserverCredsKey, membershipRwCredsKey, MEMBERSHIP_CONFIG_KIND, MEMBERSHIP_RW_CREDS_KIND, WEB_CREDS_KIND, webCredsKey, parsePositiveIntegerFlag, recordMesh, retainedLegacyBroker, meshesForRoot, removeMesh, rotateSystemCreds, setAdoptedCurrent, staleSystemCreds, SYSTEM_CREDS_FILES, userAuthStateDir, userAuthSpacesOnDisk, workspaceSecretStore, acquireMaintenanceLock, assertStoreIdentity, assessMaintenanceClaim, assessRestoreClaim, beginOrdinaryResume, bindOrdinaryResumeListener, consumeRetiredMaintenance, markOrdinaryResumeActive, markOrdinaryResumeDegraded, replaceDeadOrdinaryResumeListener, localProcessOwnerStatus, readMaintenanceJournal, rootNamesNoSpace, readMaintenanceResumeDocument, readStoreIdentity, recordOrdinaryResumeManagerCommit, releaseMaintenanceLock, retireOrdinaryResume, settleTokenHandoff, sweepTokenHandoff, writeTokenHandoff, sameStoreIdentity, cutController, readBrokerPolicy, writeBrokerPolicy, brokerAccountResolver, removePidPair, writePidPair, verifyIdentityPin, processesNaming, isLoopbackHost, connectUserControlOrThrow, userViewAuth, recordOperationSpace, recordsElsewhereError, recordOperationWarning, retainSystemSigningSeed, restoreLeftOut, SPACE_NAME_MAX, spaceNameTooLong, NATS_PIDFILE, MANAGER_PIDFILE, DELIVERY_PIDFILE, AUTH_PIDFILE, localProcessPath, UNTRUSTED_CERTIFICATE, exitCode, canonicalLocalProcessPath, DELIVERY_LOGFILE, terminalWidth, } from "@cotal-ai/workspace";
14
14
  import { FlagValueRefusal } from "../lib/flag-value-refusal.js";
15
15
  import { ensureAuthService, resolveAuthProvider, stopAuthService } from "../lib/auth-proc.js";
16
16
  import { resolveSpace } from "../lib/status.js";
@@ -158,6 +158,8 @@ function assertIssuedBackupDirArgument(raw) {
158
158
  * re-entry supplies its recorded mode explicitly rather than inheriting the new public default. */
159
159
  export function validateUpArguments(args) {
160
160
  presentationOf(args.values);
161
+ if (typeof args.values.file === "string" && !args.values.file.trim())
162
+ throw new CommandFailure("refused", "USAGE_INVALID", "--file is empty, so it names no manifest; nothing was started or written", { remedy: "name a manifest with --file <cotal.yaml>, or omit --file to start the folder's stack" });
161
163
  if (args.values.restore === "")
162
164
  throw new CommandFailure("refused", "USAGE_INVALID", "--restore is empty, so it names no backup folder; nothing was started or written", { remedy: "pass the backup folder as --restore <dir>, or omit --restore to start without restoring", selfContained: true });
163
165
  // A `.cotal` that is a link, or leads nowhere, is refused before anything reads through it.
@@ -1635,6 +1637,10 @@ async function runUp(args, inheritedLock, onAdopt, freshTeamBoot = false, restor
1635
1637
  startupLock = undefined;
1636
1638
  };
1637
1639
  try {
1640
+ // A suspended pinned broker still holds this root's store, even at a different requested port.
1641
+ const brokerPin = verifyIdentityPin(cotalPath(NATS_PIDFILE));
1642
+ if (brokerPin.kind === "match" && processStopped(brokerPin.record.pid))
1643
+ throw new CommandFailure("refused", "TARGET_UNAVAILABLE", `the stack's broker, pid ${brokerPin.record.pid}, is suspended and cannot answer; no broker was launched`, { target: { root: cotalRoot(), pid: brokerPin.record.pid }, remedy: `resume it with ${codeSpan(`kill -CONT ${brokerPin.record.pid}`)} and run ${codeSpan(`${displayCmd()} up`)} again` });
1638
1644
  // Gated on the ATTEMPT, not on holding the lock. The lock is now always held, and this refuses
1639
1645
  // whenever a journal exists — which is precisely the state a resume re-entry is in, so gating
1640
1646
  // it on the lock would refuse the very resume the lock is here to protect.
@@ -2101,7 +2107,7 @@ async function runUp(args, inheritedLock, onAdopt, freshTeamBoot = false, restor
2101
2107
  }
2102
2108
  refuseRegisteredAddress(server, space, `start this one at another address with \`cotal up --server nats://${host}:<port>\``);
2103
2109
  }
2104
- await assertBrokerAddressFree(server, "cotal up");
2110
+ await assertBrokerAddressFree(server, `${displayCmd()} up${values.host === undefined ? "" : ` --host ${shellWord(host)}`}`, host);
2105
2111
  // A repair keeps its own store rules above, and a resume or restore names its store.
2106
2112
  if (!resumeAttempt && !repairing) {
2107
2113
  if (values["store-dir"] === undefined)
@@ -2111,6 +2117,7 @@ async function runUp(args, inheritedLock, onAdopt, freshTeamBoot = false, restor
2111
2117
  checkStartStore(values["store-dir"], values.space ?? folderSpace());
2112
2118
  }
2113
2119
  const restored = resumeAttempt ? pendingRestores.get(resumeAttempt) : undefined;
2120
+ const quietRestore = restored !== undefined && restoreSinks.has(restored.attemptId);
2114
2121
  const boundListener = restored ? {
2115
2122
  serverName: restored.serverName,
2116
2123
  serverNonce: restored.serverNonce,
@@ -2124,7 +2131,6 @@ async function runUp(args, inheritedLock, onAdopt, freshTeamBoot = false, restor
2124
2131
  } : undefined;
2125
2132
  if (values.detach) {
2126
2133
  // A `backup restore` owns its own receipt: the native launcher's progress lines stay off stdout.
2127
- const quietRestore = restored !== undefined && restoreSinks.has(restored.attemptId);
2128
2134
  // The receipt names its space before the launch prints anything, as every report does. A start that
2129
2135
  // refuses the space reports that on stderr under its own `Mesh:` heading, so those checks run
2130
2136
  // first; the launch below repeats them and finds them settled.
@@ -2193,20 +2199,8 @@ async function runUp(args, inheritedLock, onAdopt, freshTeamBoot = false, restor
2193
2199
  if (!authService || !controlPlane)
2194
2200
  process.exitCode = 1;
2195
2201
  await completeResumeActivation(resumeAttempt, controlPlane && authService, !authService ? "normal listener started but the user-auth service is unavailable" : "normal listener started but the control plane is degraded", server, startupLock);
2196
- // `backup restore` prints its own receipt; `up --restore` names the attempt and its next step here.
2197
- if (restored && !quietRestore) {
2198
- console.log(c.green(`✓ restored the backup ${restored.selection === "registry" ? "registry" : "in full"} as restore attempt ${restored.attemptId}`));
2199
- const composition = restoreComposition(restored.space, restored.restoredStreams, restored.mode);
2200
- console.log(c.dim(`restored: ${composition.restoredWords}; recreated empty: ${composition.emptyWords}`));
2201
- if (composition.note)
2202
- console.log(c.yellow(composition.note));
2203
- const cleanupRoot = values.__invokedRoot && values.__invokedRoot !== canonicalRoot(restored.root) ? restored.root : undefined;
2204
- for (const line of leftOutNotes(restored.attemptId, restored.selection, restoreOnlyCopy(restored.root, restored.attemptId), cleanupRoot))
2205
- console.log(c.yellow(line));
2206
- const journal = readMaintenanceJournal(restored.root);
2207
- if (journal && "restore" in journal && journal.restore.attemptId === restored.attemptId)
2208
- console.log(c.dim(`next: ${restoreNextStep(journal.state, restored.attemptId, restoreLeftOut(journal), cleanupRoot)}`));
2209
- }
2202
+ if (restored && !quietRestore)
2203
+ printRestoreReceipt(restored, values.__invokedRoot);
2210
2204
  if (!quietRestore) {
2211
2205
  const managerRecord = managerRecordState(receiptSpace);
2212
2206
  console.log(`\n${renderReport({ sections: [{ title: "Next", blocks: detachedNext({ ...detached, controlPlane, ...(managerRecord.state === "unattributable" ? { unattributableManager: managerRecord.path, noManager } : {}) }, receiptSpace) }] }, "rich", process.stdout)}`);
@@ -2473,6 +2467,8 @@ async function runUp(args, inheritedLock, onAdopt, freshTeamBoot = false, restor
2473
2467
  throw new Error("smoke-injected failure after restore listener readiness");
2474
2468
  await completeResumeActivation(resumeAttempt, controlPlane !== undefined && authService, !authService ? "normal listener started but the user-auth service is unavailable" : "normal listener started but the control plane is degraded", server, startupLock);
2475
2469
  activationFinished = true;
2470
+ if (restored && !quietRestore)
2471
+ printRestoreReceipt(restored, values.__invokedRoot);
2476
2472
  }
2477
2473
  releaseStartupLock();
2478
2474
  await new Promise(() => { });
@@ -2481,6 +2477,21 @@ async function runUp(args, inheritedLock, onAdopt, freshTeamBoot = false, restor
2481
2477
  releaseStartupLock();
2482
2478
  }
2483
2479
  }
2480
+ /** The human receipt for a completed `up --restore`. `backup restore` prints its own receipt. */
2481
+ function printRestoreReceipt(restored, invokedRoot) {
2482
+ console.log(c.green(`✓ restored the backup ${restored.selection === "registry" ? "registry" : "in full"} as restore attempt ${restored.attemptId}`));
2483
+ const composition = restoreComposition(restored.space, restored.restoredStreams, restored.mode);
2484
+ console.log(c.dim(`restored: ${composition.restoredWords}; recreated empty: ${composition.emptyWords}`));
2485
+ if (composition.note)
2486
+ console.log(c.yellow(composition.note));
2487
+ const cleanupRoot = invokedRoot && invokedRoot !== canonicalRoot(restored.root) ? restored.root : undefined;
2488
+ const cmd = displayCmd();
2489
+ for (const line of leftOutNotes(restored.attemptId, restored.selection, restoreOnlyCopy(restored.root, restored.attemptId), cleanupRoot, cmd))
2490
+ console.log(c.yellow(line));
2491
+ const journal = readMaintenanceJournal(restored.root);
2492
+ if (journal && "restore" in journal && journal.restore.attemptId === restored.attemptId)
2493
+ console.log(c.dim(`next: ${restoreNextStep(journal.state, restored.attemptId, restoreLeftOut(journal), cleanupRoot, cmd)}`));
2494
+ }
2484
2495
  /** The address of a prepared stack that neither a journal nor a registration records, as after a
2485
2496
  * damaged journal was removed once `down` had dropped the registration. Its saved broker definition
2486
2497
  * names it. With none, a root that holds this space's trust or a store from an earlier start refuses
@@ -3615,7 +3626,7 @@ async function upManifest(file, opts) {
3615
3626
  stderrLine("✗ ", `${brokerAddressForDisplay(server) ?? "selected address"} already has a broker - a fresh boot will not adopt it. Stop the owned stack or select another address; team deploy supports only all-new channel cards, not agent apply.`, c.red);
3616
3627
  process.exit(1);
3617
3628
  }
3618
- await assertBrokerAddressFree(server, `cotal up -f ${file}`);
3629
+ await assertBrokerAddressFree(server, `${displayCmd()} up -f ${shellWord(file)}`, host);
3619
3630
  // Connectors + their required binaries must exist before any mutation (no fallback).
3620
3631
  const conn = await preflightConnectors(prepared);
3621
3632
  if (conn) {
@@ -4188,12 +4199,13 @@ opts) {
4188
4199
  /** Refuse a broker address another program holds without answering NATS, such as a web server, as
4189
4200
  * the controller stack refuses it. nats-server would exit on its bind with only a log line, and the
4190
4201
  * readiness probe would wait on that program instead. `command` is the start the remedy reruns. */
4191
- async function assertBrokerAddressFree(server, command) {
4192
- const bindError = await listenerBindError(server);
4202
+ async function assertBrokerAddressFree(server, command, bindHost) {
4203
+ const bindError = await listenerBindError(server, bindHost);
4193
4204
  if (bindError === undefined || bindError === "timeout" || bindError.code !== "EADDRINUSE")
4194
4205
  return;
4195
- const { host, port } = brokerListenAddress(server), address = new URL(server);
4196
- const { says, frees } = addressHolder("the broker address", host, port);
4206
+ const { host: dialHost, port } = brokerListenAddress(server), address = new URL(server);
4207
+ const host = bindHost ?? dialHost;
4208
+ const { says, frees } = await addressHolder("the broker address", host, port);
4197
4209
  throw new CommandFailure("refused", "CONFLICT", `${says} (bind failed: address already in use); no broker was launched`, {
4198
4210
  target: { root: cotalRoot(), server, bindError: bindError.code },
4199
4211
  remedy: `start it at another address with ${codeSpan(`${command} --server ${address.protocol}//${address.hostname}:<port>`)}, or ${frees} and run ${codeSpan(command)} again`,