@cotal-ai/cli 0.171.2 → 0.171.4

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 (126) hide show
  1. package/dist/command.d.ts.map +1 -1
  2. package/dist/command.js +142 -85
  3. package/dist/command.js.map +1 -1
  4. package/dist/commands/agents.js +7 -7
  5. package/dist/commands/agents.js.map +1 -1
  6. package/dist/commands/app-identity.d.ts +6 -0
  7. package/dist/commands/app-identity.d.ts.map +1 -1
  8. package/dist/commands/app-identity.js +4 -4
  9. package/dist/commands/app-identity.js.map +1 -1
  10. package/dist/commands/backup-maintenance.js +1 -1
  11. package/dist/commands/backup-maintenance.js.map +1 -1
  12. package/dist/commands/down.d.ts.map +1 -1
  13. package/dist/commands/down.js +7 -5
  14. package/dist/commands/down.js.map +1 -1
  15. package/dist/commands/ext.d.ts.map +1 -1
  16. package/dist/commands/ext.js +9 -4
  17. package/dist/commands/ext.js.map +1 -1
  18. package/dist/commands/help.d.ts.map +1 -1
  19. package/dist/commands/help.js +2 -13
  20. package/dist/commands/help.js.map +1 -1
  21. package/dist/commands/history-clear.d.ts.map +1 -1
  22. package/dist/commands/history-clear.js +18 -2
  23. package/dist/commands/history-clear.js.map +1 -1
  24. package/dist/commands/join.js +7 -2
  25. package/dist/commands/join.js.map +1 -1
  26. package/dist/commands/manager-service.d.ts +1 -1
  27. package/dist/commands/manager-service.d.ts.map +1 -1
  28. package/dist/commands/manager-service.js +9 -4
  29. package/dist/commands/manager-service.js.map +1 -1
  30. package/dist/commands/reset-space-apply.d.ts.map +1 -1
  31. package/dist/commands/reset-space-apply.js +2 -1
  32. package/dist/commands/reset-space-apply.js.map +1 -1
  33. package/dist/commands/reset-store-apply.d.ts +6 -0
  34. package/dist/commands/reset-store-apply.d.ts.map +1 -1
  35. package/dist/commands/reset-store-apply.js +22 -2
  36. package/dist/commands/reset-store-apply.js.map +1 -1
  37. package/dist/commands/service-registry.d.ts.map +1 -1
  38. package/dist/commands/service-registry.js +2 -0
  39. package/dist/commands/service-registry.js.map +1 -1
  40. package/dist/commands/space.d.ts +1 -0
  41. package/dist/commands/space.d.ts.map +1 -1
  42. package/dist/commands/space.js +5 -1
  43. package/dist/commands/space.js.map +1 -1
  44. package/dist/commands/spawn.d.ts +7 -2
  45. package/dist/commands/spawn.d.ts.map +1 -1
  46. package/dist/commands/spawn.js +115 -30
  47. package/dist/commands/spawn.js.map +1 -1
  48. package/dist/commands/stack-down.d.ts.map +1 -1
  49. package/dist/commands/stack-down.js +7 -8
  50. package/dist/commands/stack-down.js.map +1 -1
  51. package/dist/commands/stack-up.d.ts +3 -1
  52. package/dist/commands/stack-up.d.ts.map +1 -1
  53. package/dist/commands/stack-up.js +19 -8
  54. package/dist/commands/stack-up.js.map +1 -1
  55. package/dist/commands/status.d.ts +12 -1
  56. package/dist/commands/status.d.ts.map +1 -1
  57. package/dist/commands/status.js +89 -34
  58. package/dist/commands/status.js.map +1 -1
  59. package/dist/commands/up.d.ts.map +1 -1
  60. package/dist/commands/up.js +47 -22
  61. package/dist/commands/up.js.map +1 -1
  62. package/dist/commands/update.d.ts +1 -0
  63. package/dist/commands/update.d.ts.map +1 -1
  64. package/dist/commands/update.js +87 -31
  65. package/dist/commands/update.js.map +1 -1
  66. package/dist/ext-loader.d.ts +1 -1
  67. package/dist/ext-loader.d.ts.map +1 -1
  68. package/dist/ext-loader.js +3 -3
  69. package/dist/ext-loader.js.map +1 -1
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +3 -1
  72. package/dist/index.js.map +1 -1
  73. package/dist/lib/local-process-stop.d.ts +2 -0
  74. package/dist/lib/local-process-stop.d.ts.map +1 -1
  75. package/dist/lib/local-process-stop.js +1 -0
  76. package/dist/lib/local-process-stop.js.map +1 -1
  77. package/dist/lib/manager-proc.d.ts +2 -1
  78. package/dist/lib/manager-proc.d.ts.map +1 -1
  79. package/dist/lib/manager-proc.js +8 -2
  80. package/dist/lib/manager-proc.js.map +1 -1
  81. package/dist/lib/nats-bin.d.ts +1 -0
  82. package/dist/lib/nats-bin.d.ts.map +1 -1
  83. package/dist/lib/nats-bin.js +1 -0
  84. package/dist/lib/nats-bin.js.map +1 -1
  85. package/dist/lib/persona-files.d.ts +1 -1
  86. package/dist/lib/persona-files.d.ts.map +1 -1
  87. package/dist/lib/persona-files.js +10 -2
  88. package/dist/lib/persona-files.js.map +1 -1
  89. package/dist/lib/registry-errors.d.ts +2 -1
  90. package/dist/lib/registry-errors.d.ts.map +1 -1
  91. package/dist/lib/registry-errors.js +3 -2
  92. package/dist/lib/registry-errors.js.map +1 -1
  93. package/dist/lib/restore.d.ts +4 -3
  94. package/dist/lib/restore.d.ts.map +1 -1
  95. package/dist/lib/restore.js +12 -10
  96. package/dist/lib/restore.js.map +1 -1
  97. package/dist/lib/self-exec.d.ts.map +1 -1
  98. package/dist/lib/self-exec.js +8 -2
  99. package/dist/lib/self-exec.js.map +1 -1
  100. package/dist/lib/service-adapters.d.ts +1 -1
  101. package/dist/lib/service-adapters.d.ts.map +1 -1
  102. package/dist/lib/service-adapters.js +2 -2
  103. package/dist/lib/service-adapters.js.map +1 -1
  104. package/dist/lib/service-census.d.ts +5 -5
  105. package/dist/lib/service-install-intent.d.ts +2 -2
  106. package/dist/lib/service-instances.d.ts +2 -2
  107. package/dist/lib/service-presets.d.ts +1 -1
  108. package/dist/lib/service-presets.d.ts.map +1 -1
  109. package/dist/lib/service-presets.js +4 -4
  110. package/dist/lib/service-presets.js.map +1 -1
  111. package/dist/lib/service-supervision.d.ts +1 -1
  112. package/dist/lib/service-systemd-attempt-read.d.ts +3 -3
  113. package/dist/lib/service-uninstall-intent.d.ts +2 -2
  114. package/dist/lib/stack-journal.d.ts +11 -6
  115. package/dist/lib/stack-journal.d.ts.map +1 -1
  116. package/dist/lib/stack-journal.js +16 -9
  117. package/dist/lib/stack-journal.js.map +1 -1
  118. package/dist/lib/team-agent-removal.d.ts +1 -1
  119. package/dist/lib/version.d.ts +2 -0
  120. package/dist/lib/version.d.ts.map +1 -1
  121. package/dist/lib/version.js +26 -10
  122. package/dist/lib/version.js.map +1 -1
  123. package/dist/seed/reconcile.d.ts.map +1 -1
  124. package/dist/seed/reconcile.js +5 -2
  125. package/dist/seed/reconcile.js.map +1 -1
  126. package/package.json +12 -4
@@ -78,6 +78,7 @@ export interface UpdateRuntime {
78
78
  claimGlobalUpdate(root: string, onWait?: () => void): () => void;
79
79
  /** Read the selected global package again after acquiring its update reservation. */
80
80
  globalVersion?(root: string): string | undefined;
81
+ verifyUpdatedEntry?(root: string, version: string): string;
81
82
  selfArgv(): string[];
82
83
  /** Whether this CLI runs from a source checkout, where `--self` installs a separate global copy. */
83
84
  checkout(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAyBL,KAAK,kBAAkB,EAOxB,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAE,kBAAkB,EAAoB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAc,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAUpE,OAAO,EAUL,KAAK,UAAU,EAEhB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAwC,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACjH,OAAO,EAAuB,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAIhG,OAAO,EAA+C,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC5G,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK1E;;2DAE2D;AAC3D,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AAEnE,eAAO,MAAM,WAAW,EAAE,SAAS,QAAQ,EAS1C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G;AACrG,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAa5F;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAgB/E"}
@@ -1,6 +1,8 @@
1
1
  import { spawn, spawnSync } from "node:child_process";
2
+ import { lookup } from "node:dns/promises";
2
3
  import { existsSync, lstatSync, mkdtempSync, readdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
3
4
  import { homedir, tmpdir } from "node:os";
5
+ import { isIP, SocketAddress } from "node:net";
4
6
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
5
7
  import { globalConfigDir } from "@cotal-ai/core";
6
8
  import { CommandFailure, isCommandFailure, jsonFlag, plainFlag, presentationOf, protectedLocalDirectory, renderReport, writeResult, cmdSpawnSpec, beginGlobalUpdateChild, processGroupMembers, processStartToken, claimUpdateClosureAccess, updateClosureOwner, homeCotalDir, readUpdateRecovery, clearUpdateRecovery, writeUpdateRecovery, readUpdateSettings, recordUpdateCompletion, recordUpdateDeferral, recordUpdateRefusal, recordUpdateReplacement, setUpdateSetting, bindExtensionPeers, claimGlobalNpmUpdateLock, launcherInstallRoot, logicalExecutionEntry, loadExtensionsManifest, provenance, SEEDED_EXTENSIONS, targetFlags, resolveControlTarget, recoveryDisposition, liveUpdateClosureOwner, recoveryProcessStartToken, observeUnownedRecovery, } from "@cotal-ai/workspace";
@@ -87,7 +89,7 @@ export const updateRuntime = {
87
89
  extensions: () => loadExtensionsManifest().extensions,
88
90
  verifyExtension: verifyCurrentExtension,
89
91
  claimUpdatePass: () => claimExtensionUpdatePass(),
90
- claimGlobalUpdate: (root, onWait) => claimGlobalNpmUpdateLock(root, { waitMs: 10 * 60_000, onWait }),
92
+ claimGlobalUpdate: (root, onWait) => claimGlobalNpmUpdateLock(root, { waitMs: 10 * 60_000, renew: true, onWait }),
91
93
  globalVersion: (root) => {
92
94
  const path = join(root, "cotal-ai", "package.json");
93
95
  if (!existsSync(path))
@@ -496,6 +498,10 @@ export async function executeUpdate(self, rt = updateRuntime, target = {}) {
496
498
  if (!latest.ok) {
497
499
  if (rt.env.COTAL_AUTO_UPDATE === "1")
498
500
  recordUpdateDeferral(current, "waiting for registry availability", true);
501
+ else if (latest.npmResult && await npmProxyRefused(latest.npmResult, rt.env)) {
502
+ rt.err("The npm proxy refused the connection (ECONNREFUSED). The update did not start. Check HTTP_PROXY and HTTPS_PROXY, then retry.");
503
+ return 1;
504
+ }
499
505
  rt.out("The registry cannot be reached; nothing was changed.");
500
506
  return 0;
501
507
  }
@@ -505,23 +511,12 @@ export async function executeUpdate(self, rt = updateRuntime, target = {}) {
505
511
  rt.generationWaited = true;
506
512
  return code;
507
513
  }
508
- if (latest.ok && rt.isCurrent?.()) {
509
- try {
510
- const custody = await rt.reportRunningManager(target);
511
- rt.out("No newer CLI version; installed package closure is current. No connector reconciliation was run.");
512
- if (custody === "legacy")
513
- rt.out("A later update will require stopping the agents listed above before replacing packages.");
514
- if (rt.env.COTAL_AUTO_UPDATE === "1")
515
- recordUpdateCompletion(current, "up to date", true);
516
- reportVersion(current, latest.version, rt, false);
517
- return 0;
518
- }
519
- catch (error) {
520
- if (rt.env.COTAL_AUTO_UPDATE === "1")
521
- recordUpdateDeferral(current, "waiting for agents to stop");
522
- rt.err(c.red(`✗ running manager continuity check: ${refusal(error)}`));
523
- return 1;
524
- }
514
+ if (rt.isCurrent?.()) {
515
+ rt.out("No newer CLI version; installed package closure is current. No connector reconciliation was run.");
516
+ if (rt.env.COTAL_AUTO_UPDATE === "1")
517
+ recordUpdateCompletion(current, "up to date", true);
518
+ reportVersion(current, latest.version, rt, false);
519
+ return 0;
525
520
  }
526
521
  return reconcileCurrent(current, rt, target, (reconciled, deferred) => {
527
522
  if (rt.env.COTAL_AUTO_UPDATE === "1") {
@@ -627,10 +622,8 @@ async function reconcileCurrent(current, rt, target, finish) {
627
622
  rt.err(c.red(`✗ could not read installed extensions: ${message(e)}`));
628
623
  return finish(false);
629
624
  }
630
- if (!entries.length) {
625
+ if (!entries.length)
631
626
  rt.out(c.dim("operator extensions: none installed"));
632
- return finish(ok);
633
- }
634
627
  for (const entry of entries) {
635
628
  if (!entry.pkg.startsWith("@cotal-ai/")) {
636
629
  rt.out(c.dim(`${entry.pkg}@${entry.version} - not auto-updated in v1 (recorded spec: ${entry.spec})`));
@@ -675,6 +668,9 @@ async function reconcileCurrent(current, rt, target, finish) {
675
668
  }
676
669
  rt.out(c.green(`✓ ${entry.pkg}@${current}`) + c.dim(` - current generation (recorded spec: ${entry.spec})`));
677
670
  }
671
+ if (ok && rt.env.COTAL_AUTO_UPDATE !== "1") {
672
+ rt.out("Cotal updates the managed pi connector, not your standalone pi extension. If you copied it, wait for the update to succeed, then reinstall `@cotal-ai/pi` at the version shown by `cotal --version` and repeat the copy. See https://docs.cotal.ai/docs/connect-pi/#load-the-extension-into-your-own-host");
673
+ }
678
674
  return finish(ok);
679
675
  }
680
676
  finally {
@@ -721,15 +717,20 @@ export async function isStoppedLocalMesh(target) {
721
717
  return false;
722
718
  return assertEndpointUnreachable(target.server).then(() => true, () => false);
723
719
  }
724
- /** A prepared controller that completed ordinary down is cold only while its own instance records
725
- * prove every process gone, no supervisor may serve it, and its recorded broker has no listener.
720
+ /** A prepared controller that completed down or failed to start any member is cold only while its
721
+ * own instance records prove every process gone, no supervisor may serve it, and its broker has no listener.
726
722
  * The target resolver refuses before returning a MeshTarget for this lifecycle. */
727
723
  async function stoppedController(d, server) {
728
724
  if (typeof d.space !== "string" || typeof d.root !== "string" || !d.stopped ||
729
725
  d.rootMissing === true || d.unsettled !== undefined || d.home !== undefined || d.stackSpace !== undefined)
730
726
  return false;
731
727
  const journal = readStackJournal(d.root)?.journal;
732
- if (!journal || journal.space !== d.space || journal.operation.kind !== "down" || journal.operation.phase !== "completed")
728
+ if (!journal || journal.space !== d.space)
729
+ return false;
730
+ const completedDown = journal.operation.kind === "down" && journal.operation.phase === "completed";
731
+ const failedStart = journal.operation.kind === "up" && journal.operation.phase === "failed" &&
732
+ journal.members.every(member => (member.state === "failed" || member.state === "not-attempted") && !member.process && !member.replacement);
733
+ if (!completedDown && !failedStart)
733
734
  return false;
734
735
  if (server !== undefined && brokerUrlKey(server) !== brokerUrlKey(journal.server))
735
736
  return false;
@@ -739,10 +740,11 @@ async function stoppedController(d, server) {
739
740
  return false;
740
741
  if (instances.some((row) => !["stopped", "failed"].includes(row.record.value.state) || !processGone(observeServiceProcess(row.record.value))))
741
742
  return false;
742
- stackScopeRefusals(journal, `\`cotal update --space ${d.space}\``);
743
743
  if (supervisorMayServe(d.space))
744
744
  return false;
745
- return assertEndpointUnreachable(journal.server).then(() => true, () => false);
745
+ const brokerStopped = await assertEndpointUnreachable(journal.server).then(() => true, () => false);
746
+ stackScopeRefusals(journal, `\`cotal update --space ${d.space}\``, { brokerStopped });
747
+ return brokerStopped;
746
748
  }
747
749
  /** The refusal sentence this command prints. A {@link MeshTargetError} arrives RAW here — the
748
750
  * control resolver rethrows the codes it does not absorb before the connect helper can wrap them —
@@ -1067,7 +1069,7 @@ function latestVersion(rt) {
1067
1069
  try {
1068
1070
  const result = rt.npm(["view", "cotal-ai@latest", "version", "--json", "--cache", cache, "--logs-max=0", "--update-notifier=false", "--fetch-retries=0", "--fetch-timeout=15000"]);
1069
1071
  if (result.status !== 0)
1070
- return { ok: false, error: failure(result) };
1072
+ return { ok: false, error: failure(result), npmResult: result };
1071
1073
  try {
1072
1074
  return { ok: true, version: parseNpmVersion(result.stdout) };
1073
1075
  }
@@ -1079,6 +1081,49 @@ function latestVersion(rt) {
1079
1081
  rmSync(cache, { recursive: true, force: true, maxRetries: 3 });
1080
1082
  }
1081
1083
  }
1084
+ /** npm gives a generic proxy hint even for direct failures. Match the refused socket instead. */
1085
+ async function npmProxyRefused(result, env) {
1086
+ const httpsProxy = env.https_proxy || env.HTTPS_PROXY;
1087
+ const httpProxy = env.http_proxy || env.HTTP_PROXY;
1088
+ if ((!httpsProxy && !httpProxy) || result.status === null || result.error)
1089
+ return false;
1090
+ let error;
1091
+ try {
1092
+ error = JSON.parse(result.stdout)?.error;
1093
+ }
1094
+ catch {
1095
+ return false;
1096
+ }
1097
+ if (error?.code !== "ECONNREFUSED" || typeof error.summary !== "string")
1098
+ return false;
1099
+ const refused = /^(?:FetchError: )?request to (\S+) failed, reason: connect ECONNREFUSED (\S+):(\d+)$/.exec(error.summary);
1100
+ if (!refused)
1101
+ return false;
1102
+ const [, request, address, port] = refused;
1103
+ const registry = URL.parse(request);
1104
+ if (!registry || (registry.protocol !== "https:" && registry.protocol !== "http:") || !isIP(address))
1105
+ return false;
1106
+ const setting = httpsProxy || (registry.protocol === "http:" ? httpProxy : undefined);
1107
+ const proxy = setting ? URL.parse(setting) : null;
1108
+ if (!proxy || (proxy.protocol !== "http:" && proxy.protocol !== "https:"))
1109
+ return false;
1110
+ const portOf = (url) => url.port || (url.protocol === "https:" ? "443" : "80");
1111
+ if (portOf(proxy) !== port)
1112
+ return false;
1113
+ const normalize = (ip) => isIP(ip) === 6 ? new SocketAddress({ address: ip, family: "ipv6" }).address : ip;
1114
+ const matches = async (url) => {
1115
+ const host = url.hostname.replace(/^\[|\]$/g, "");
1116
+ const addresses = isIP(host) ? [host] : (await lookup(host, { all: true })).map(item => item.address);
1117
+ return addresses.some(ip => normalize(ip) === normalize(address));
1118
+ };
1119
+ try {
1120
+ // If the registry could have refused the same socket directly, do not blame the proxy.
1121
+ return await matches(proxy) && (portOf(registry) !== port || !await matches(registry));
1122
+ }
1123
+ catch {
1124
+ return false;
1125
+ }
1126
+ }
1082
1127
  /** Resolve installed first-party surfaces in a disposable prefix, including their npm dependencies. */
1083
1128
  function checkInstalledClosure(version, rt) {
1084
1129
  const names = [...new Set(rt.extensions().filter(entry => entry.pkg.startsWith("@cotal-ai/")).map(entry => entry.pkg))];
@@ -1089,8 +1134,12 @@ function checkInstalledClosure(version, rt) {
1089
1134
  const result = rt.npm(["install", "--prefix", staging, "--cache", join(staging, ".npm-cache"), "--logs-max=0", "--update-notifier=false", "--ignore-scripts", "--package-lock=false", "--no-audit", "--no-fund", "--fetch-retries=2", "--fetch-retry-mintimeout=1000", "--fetch-retry-maxtimeout=2000", "--fetch-timeout=15000", "--prefer-online", ...names.map(name => `${name}@${version}`)]);
1090
1135
  if (result.signal)
1091
1136
  throw new DependencyCheckInterrupted(`npm dependency check was terminated by ${result.signal}`);
1092
- if (result.status !== 0)
1093
- throw releaseReadError(result, `installed extension dependency closure is unavailable: ${failure(result)}`);
1137
+ if (result.status !== 0) {
1138
+ const detail = `installed extension dependency closure is unavailable: ${failure(result)}`;
1139
+ if (/^npm (?:error|ERR!) code ENOSPC\s*$/m.test(result.stderr))
1140
+ throw new DependencyCheckNoSpace(detail);
1141
+ throw releaseReadError(result, detail);
1142
+ }
1094
1143
  }
1095
1144
  finally {
1096
1145
  rmSync(staging, { recursive: true, force: true, maxRetries: 3 });
@@ -1254,6 +1303,8 @@ class ReleaseDateExcluded extends Error {
1254
1303
  }
1255
1304
  class DependencyCheckInterrupted extends Error {
1256
1305
  }
1306
+ class DependencyCheckNoSpace extends Error {
1307
+ }
1257
1308
  class RegistryUnavailable extends Error {
1258
1309
  }
1259
1310
  const NETWORK_ERROR_CODE = /^(?:ENETUNREACH|EHOSTUNREACH|ENETDOWN|EHOSTDOWN|ECONNRESET|ECONNREFUSED|ECONNABORTED|ETIMEDOUT|ESOCKETTIMEDOUT|EAI_AGAIN|ENOTFOUND)$/;
@@ -1371,6 +1422,11 @@ async function upgradeAndReconcile(targetVersion, current, rt, target) {
1371
1422
  rt.err(c.red(`✗ ${message(e)}. No installed packages were replaced. Run \`cotal update --self\` again.`));
1372
1423
  return 1;
1373
1424
  }
1425
+ if (e instanceof DependencyCheckNoSpace) {
1426
+ recordUpdateDeferral(targetVersion, "temporary filesystem is out of space", true);
1427
+ rt.err(c.red(`✗ ${message(e)}. No global install was attempted. Free space on the temporary filesystem, then run \`cotal update --self\` again.`));
1428
+ return 1;
1429
+ }
1374
1430
  if (e instanceof ReleaseDateExcluded) {
1375
1431
  recordUpdateDeferral(targetVersion, "npm date filter excludes the release");
1376
1432
  rt.err(c.red(`✗ ${message(e)}. No global install was attempted.`));
@@ -1433,7 +1489,7 @@ async function upgradeAndReconcile(targetVersion, current, rt, target) {
1433
1489
  }
1434
1490
  let releaseGlobal;
1435
1491
  try {
1436
- releaseGlobal = rt.claimGlobalUpdate(root, () => rt.out("Waiting up to 10 minutes for another updater to release npm's global root"));
1492
+ releaseGlobal = rt.claimGlobalUpdate(root, () => rt.out("Waiting for another updater to release npm's global root"));
1437
1493
  }
1438
1494
  catch (e) {
1439
1495
  rt.err(c.red(`✗ could not reserve npm's global root for update: ${message(e)}`));
@@ -1444,7 +1500,7 @@ async function upgradeAndReconcile(targetVersion, current, rt, target) {
1444
1500
  try {
1445
1501
  const installed = rt.globalVersion?.(root);
1446
1502
  if (installed && compareSemver(installed, current) > 0 && compareSemver(installed, targetVersion) >= 0) {
1447
- const entry = rt.verifyGlobalEntry(root, installed);
1503
+ const entry = (rt.verifyUpdatedEntry ?? rt.verifyGlobalEntry)(root, installed);
1448
1504
  releaseGlobal();
1449
1505
  rt.out(`Another update installed cotal-ai@${installed}; rechecking the installed CLI`);
1450
1506
  const child = rt.spawn(rt.nodePath, [entry, "update", "--self", ...targetArgv(target), ...(target["stop-agents"] === true ? ["--stop-agents"] : [])], rt.env, true);