@orchagent/cli 0.3.38 → 0.3.39

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.
@@ -9,6 +9,7 @@ exports.checkGitAvailable = checkGitAvailable;
9
9
  exports.runEnvironmentChecks = runEnvironmentChecks;
10
10
  const child_process_1 = require("child_process");
11
11
  const package_json_1 = __importDefault(require("../../../../package.json"));
12
+ const update_notifier_1 = require("../../update-notifier");
12
13
  const REQUIRED_NODE_MAJOR = 18;
13
14
  /**
14
15
  * Check if Node.js version is 18+.
@@ -40,8 +41,9 @@ async function checkNodeVersion() {
40
41
  async function checkCliVersion() {
41
42
  const installedVersion = package_json_1.default.version;
42
43
  try {
43
- // Fetch latest version from npm registry
44
- const response = await fetch('https://registry.npmjs.org/@orchagent/cli/latest', { signal: AbortSignal.timeout(5000) });
44
+ // Fetch latest version from the same dist-tags endpoint the update banner uses,
45
+ // so both always agree on the latest version (fixes D-1 inconsistency).
46
+ const response = await fetch(update_notifier_1.DIST_TAGS_URL, { signal: AbortSignal.timeout(5000) });
45
47
  if (!response.ok) {
46
48
  return {
47
49
  category: 'environment',
@@ -52,7 +54,9 @@ async function checkCliVersion() {
52
54
  };
53
55
  }
54
56
  const data = (await response.json());
55
- const latestVersion = data.version;
57
+ const latestVersion = data.latest;
58
+ // Sync the update-notifier cache so the banner shows the same version
59
+ (0, update_notifier_1.writeCache)(latestVersion);
56
60
  if (installedVersion === latestVersion) {
57
61
  return {
58
62
  category: 'environment',
@@ -18,6 +18,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
18
18
  return (mod && mod.__esModule) ? mod : { "default": mod };
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.DIST_TAGS_URL = void 0;
22
+ exports.writeCache = writeCache;
21
23
  exports.checkForUpdates = checkForUpdates;
22
24
  exports.printUpdateNotification = printUpdateNotification;
23
25
  const https_1 = __importDefault(require("https"));
@@ -30,6 +32,8 @@ const CACHE_DIR = path_1.default.join(os_1.default.homedir(), '.orchagent');
30
32
  const CACHE_PATH = path_1.default.join(CACHE_DIR, 'update-check.json');
31
33
  const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000; // 24 hours
32
34
  const REQUEST_TIMEOUT_MS = 5000;
35
+ /** npm dist-tags endpoint — single source of truth for latest version. */
36
+ exports.DIST_TAGS_URL = `https://registry.npmjs.org/-/package/${PACKAGE_NAME}/dist-tags`;
33
37
  // ── Cache I/O ──────────────────────────────────────────────────────────
34
38
  function readCache() {
35
39
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchagent/cli",
3
- "version": "0.3.38",
3
+ "version": "0.3.39",
4
4
  "description": "Command-line interface for the orchagent AI agent marketplace",
5
5
  "license": "MIT",
6
6
  "author": "orchagent <hello@orchagent.io>",