sequant 1.6.0 → 1.6.1

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.
@@ -19,7 +19,7 @@ export async function doctorCommand() {
19
19
  message: `Outdated: ${versionResult.currentVersion} → ${versionResult.latestVersion} available`,
20
20
  });
21
21
  // Show remediation steps
22
- console.log(chalk.yellow(` ⚠️ ${getVersionWarning(versionResult.currentVersion, versionResult.latestVersion)}`));
22
+ console.log(chalk.yellow(` ⚠️ ${getVersionWarning(versionResult.currentVersion, versionResult.latestVersion, versionResult.isLocalInstall)}`));
23
23
  console.log("");
24
24
  }
25
25
  else {
@@ -742,7 +742,7 @@ export async function runCommand(issues, options) {
742
742
  try {
743
743
  const versionResult = await checkVersionCached();
744
744
  if (versionResult.isOutdated && versionResult.latestVersion) {
745
- console.log(chalk.yellow(` ⚠️ ${getVersionWarning(versionResult.currentVersion, versionResult.latestVersion)}`));
745
+ console.log(chalk.yellow(` ⚠️ ${getVersionWarning(versionResult.currentVersion, versionResult.latestVersion, versionResult.isLocalInstall)}`));
746
746
  console.log("");
747
747
  }
748
748
  }
@@ -12,6 +12,7 @@ export interface VersionCheckResult {
12
12
  currentVersion: string;
13
13
  latestVersion: string | null;
14
14
  isOutdated: boolean;
15
+ isLocalInstall?: boolean;
15
16
  error?: string;
16
17
  }
17
18
  /**
@@ -26,6 +27,17 @@ export declare function getCachePath(): string;
26
27
  * Get the current version from package.json
27
28
  */
28
29
  export declare function getCurrentVersion(): string;
30
+ /**
31
+ * Check if running from a local node_modules install (vs npx cache)
32
+ *
33
+ * Local installs are in: <project>/node_modules/sequant/
34
+ * npx installs are in: ~/.npm/_npx/<hash>/node_modules/sequant/
35
+ *
36
+ * This matters because:
37
+ * - Local installs should be updated with: npm update sequant
38
+ * - npx installs should be updated with: npx sequant@latest
39
+ */
40
+ export declare function isLocalNodeModulesInstall(): boolean;
29
41
  /**
30
42
  * Read the version cache
31
43
  */
@@ -53,8 +65,11 @@ export declare function compareVersions(a: string, b: string): number;
53
65
  export declare function isOutdated(currentVersion: string, latestVersion: string): boolean;
54
66
  /**
55
67
  * Get the version warning message
68
+ *
69
+ * For local node_modules installs, recommends `npm update sequant`
70
+ * For npx usage, recommends `npx sequant@latest`
56
71
  */
57
- export declare function getVersionWarning(currentVersion: string, latestVersion: string): string;
72
+ export declare function getVersionWarning(currentVersion: string, latestVersion: string, isLocal?: boolean): string;
58
73
  /**
59
74
  * Check version freshness (thorough - for doctor command)
60
75
  * Always fetches from npm registry
@@ -54,6 +54,25 @@ export function getCurrentVersion() {
54
54
  return "0.0.0";
55
55
  }
56
56
  }
57
+ /**
58
+ * Check if running from a local node_modules install (vs npx cache)
59
+ *
60
+ * Local installs are in: <project>/node_modules/sequant/
61
+ * npx installs are in: ~/.npm/_npx/<hash>/node_modules/sequant/
62
+ *
63
+ * This matters because:
64
+ * - Local installs should be updated with: npm update sequant
65
+ * - npx installs should be updated with: npx sequant@latest
66
+ */
67
+ export function isLocalNodeModulesInstall() {
68
+ // Check if our path contains node_modules/sequant but NOT in .npm/_npx
69
+ const normalizedPath = __dirname.replace(/\\/g, "/");
70
+ // Running from local node_modules (not npx cache)
71
+ const inNodeModules = normalizedPath.includes("/node_modules/sequant");
72
+ const inNpxCache = normalizedPath.includes("/.npm/_npx/") ||
73
+ normalizedPath.includes("\\.npm\\_npx\\");
74
+ return inNodeModules && !inNpxCache;
75
+ }
57
76
  /**
58
77
  * Read the version cache
59
78
  */
@@ -158,10 +177,19 @@ export function isOutdated(currentVersion, latestVersion) {
158
177
  }
159
178
  /**
160
179
  * Get the version warning message
180
+ *
181
+ * For local node_modules installs, recommends `npm update sequant`
182
+ * For npx usage, recommends `npx sequant@latest`
161
183
  */
162
- export function getVersionWarning(currentVersion, latestVersion) {
184
+ export function getVersionWarning(currentVersion, latestVersion, isLocal) {
185
+ const isLocalInstall = isLocal ?? isLocalNodeModulesInstall();
186
+ if (isLocalInstall) {
187
+ return `sequant ${latestVersion} is available (you have ${currentVersion})
188
+ Run: npm update sequant
189
+ Note: You have sequant as a local dependency. npx uses your node_modules version.`;
190
+ }
163
191
  return `sequant ${latestVersion} is available (you have ${currentVersion})
164
- Run: npx sequant@latest or npm update sequant`;
192
+ Run: npx sequant@latest`;
165
193
  }
166
194
  /**
167
195
  * Check version freshness (thorough - for doctor command)
@@ -169,12 +197,14 @@ export function getVersionWarning(currentVersion, latestVersion) {
169
197
  */
170
198
  export async function checkVersionThorough() {
171
199
  const currentVersion = getCurrentVersion();
200
+ const isLocal = isLocalNodeModulesInstall();
172
201
  const latestVersion = await fetchLatestVersion();
173
202
  if (!latestVersion) {
174
203
  return {
175
204
  currentVersion,
176
205
  latestVersion: null,
177
206
  isOutdated: false,
207
+ isLocalInstall: isLocal,
178
208
  error: "Could not fetch latest version",
179
209
  };
180
210
  }
@@ -184,6 +214,7 @@ export async function checkVersionThorough() {
184
214
  currentVersion,
185
215
  latestVersion,
186
216
  isOutdated: isOutdated(currentVersion, latestVersion),
217
+ isLocalInstall: isLocal,
187
218
  };
188
219
  }
189
220
  /**
@@ -192,6 +223,7 @@ export async function checkVersionThorough() {
192
223
  */
193
224
  export async function checkVersionCached() {
194
225
  const currentVersion = getCurrentVersion();
226
+ const isLocal = isLocalNodeModulesInstall();
195
227
  // Check cache first
196
228
  const cache = readCache();
197
229
  if (cache && isCacheFresh(cache)) {
@@ -199,6 +231,7 @@ export async function checkVersionCached() {
199
231
  currentVersion,
200
232
  latestVersion: cache.latestVersion,
201
233
  isOutdated: isOutdated(currentVersion, cache.latestVersion),
234
+ isLocalInstall: isLocal,
202
235
  };
203
236
  }
204
237
  // Fetch new version (with timeout)
@@ -210,12 +243,14 @@ export async function checkVersionCached() {
210
243
  currentVersion,
211
244
  latestVersion: cache.latestVersion,
212
245
  isOutdated: isOutdated(currentVersion, cache.latestVersion),
246
+ isLocalInstall: isLocal,
213
247
  };
214
248
  }
215
249
  return {
216
250
  currentVersion,
217
251
  latestVersion: null,
218
252
  isOutdated: false,
253
+ isLocalInstall: isLocal,
219
254
  };
220
255
  }
221
256
  // Update cache
@@ -224,5 +259,6 @@ export async function checkVersionCached() {
224
259
  currentVersion,
225
260
  latestVersion,
226
261
  isOutdated: isOutdated(currentVersion, latestVersion),
262
+ isLocalInstall: isLocal,
227
263
  };
228
264
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sequant",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Quantize your development workflow - Sequential AI phases with quality gates",
5
5
  "type": "module",
6
6
  "bin": {