@myapihq/cli 1.0.70 → 1.0.72

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.
@@ -17,12 +17,20 @@ export async function checkForUpdate(currentVersion) {
17
17
  const data = await res.json();
18
18
  const latest = data.version;
19
19
  if (latest && isNewer(latest, currentVersion)) {
20
+ // Verify the tarball is actually available before attempting install —
21
+ // the registry metadata can report a new version before the tarball is uploaded.
22
+ const tarballUrl = `https://registry.npmjs.org/@myapihq/cli/-/cli-${latest}.tgz`;
23
+ try {
24
+ const check = await fetch(tarballUrl, { method: 'HEAD', signal: AbortSignal.timeout(3000) });
25
+ if (!check.ok)
26
+ return; // Tarball not ready yet — silently skip, retry next command.
27
+ }
28
+ catch {
29
+ return;
30
+ }
20
31
  info(`\n› New version available (${currentVersion} → ${latest}) — installing…`);
21
32
  try {
22
- // Use @latest so npm only resolves to a fully-published tarball, avoiding
23
- // ETARGET races where registry metadata briefly reports a version before
24
- // its tarball is available.
25
- execSync(`"${npmBin()}" install -g @myapihq/cli@latest`, { stdio: 'pipe' });
33
+ execSync(`"${npmBin()}" install -g @myapihq/cli@${latest}`, { stdio: 'pipe' });
26
34
  const config = loadConfig();
27
35
  if (config?.skills_installed) {
28
36
  await installSkills();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myapihq/cli",
3
- "version": "1.0.70",
3
+ "version": "1.0.72",
4
4
  "description": "MyAPI command-line interface",
5
5
  "type": "module",
6
6
  "files": [