@cotal-ai/cli 0.171.3 → 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.
@@ -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,CAAC;AAEF,UAAU,aAAa;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,GA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E,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;
@@ -1068,7 +1069,7 @@ function latestVersion(rt) {
1068
1069
  try {
1069
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"]);
1070
1071
  if (result.status !== 0)
1071
- return { ok: false, error: failure(result) };
1072
+ return { ok: false, error: failure(result), npmResult: result };
1072
1073
  try {
1073
1074
  return { ok: true, version: parseNpmVersion(result.stdout) };
1074
1075
  }
@@ -1080,6 +1081,49 @@ function latestVersion(rt) {
1080
1081
  rmSync(cache, { recursive: true, force: true, maxRetries: 3 });
1081
1082
  }
1082
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
+ }
1083
1127
  /** Resolve installed first-party surfaces in a disposable prefix, including their npm dependencies. */
1084
1128
  function checkInstalledClosure(version, rt) {
1085
1129
  const names = [...new Set(rt.extensions().filter(entry => entry.pkg.startsWith("@cotal-ai/")).map(entry => entry.pkg))];
@@ -1090,8 +1134,12 @@ function checkInstalledClosure(version, rt) {
1090
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}`)]);
1091
1135
  if (result.signal)
1092
1136
  throw new DependencyCheckInterrupted(`npm dependency check was terminated by ${result.signal}`);
1093
- if (result.status !== 0)
1094
- 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
+ }
1095
1143
  }
1096
1144
  finally {
1097
1145
  rmSync(staging, { recursive: true, force: true, maxRetries: 3 });
@@ -1255,6 +1303,8 @@ class ReleaseDateExcluded extends Error {
1255
1303
  }
1256
1304
  class DependencyCheckInterrupted extends Error {
1257
1305
  }
1306
+ class DependencyCheckNoSpace extends Error {
1307
+ }
1258
1308
  class RegistryUnavailable extends Error {
1259
1309
  }
1260
1310
  const NETWORK_ERROR_CODE = /^(?:ENETUNREACH|EHOSTUNREACH|ENETDOWN|EHOSTDOWN|ECONNRESET|ECONNREFUSED|ECONNABORTED|ETIMEDOUT|ESOCKETTIMEDOUT|EAI_AGAIN|ENOTFOUND)$/;
@@ -1372,6 +1422,11 @@ async function upgradeAndReconcile(targetVersion, current, rt, target) {
1372
1422
  rt.err(c.red(`✗ ${message(e)}. No installed packages were replaced. Run \`cotal update --self\` again.`));
1373
1423
  return 1;
1374
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
+ }
1375
1430
  if (e instanceof ReleaseDateExcluded) {
1376
1431
  recordUpdateDeferral(targetVersion, "npm date filter excludes the release");
1377
1432
  rt.err(c.red(`✗ ${message(e)}. No global install was attempted.`));
@@ -1434,7 +1489,7 @@ async function upgradeAndReconcile(targetVersion, current, rt, target) {
1434
1489
  }
1435
1490
  let releaseGlobal;
1436
1491
  try {
1437
- 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"));
1438
1493
  }
1439
1494
  catch (e) {
1440
1495
  rt.err(c.red(`✗ could not reserve npm's global root for update: ${message(e)}`));
@@ -1445,7 +1500,7 @@ async function upgradeAndReconcile(targetVersion, current, rt, target) {
1445
1500
  try {
1446
1501
  const installed = rt.globalVersion?.(root);
1447
1502
  if (installed && compareSemver(installed, current) > 0 && compareSemver(installed, targetVersion) >= 0) {
1448
- const entry = rt.verifyGlobalEntry(root, installed);
1503
+ const entry = (rt.verifyUpdatedEntry ?? rt.verifyGlobalEntry)(root, installed);
1449
1504
  releaseGlobal();
1450
1505
  rt.out(`Another update installed cotal-ai@${installed}; rechecking the installed CLI`);
1451
1506
  const child = rt.spawn(rt.nodePath, [entry, "update", "--self", ...targetArgv(target), ...(target["stop-agents"] === true ? ["--stop-agents"] : [])], rt.env, true);