ai-lens 0.8.39 → 0.8.41
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.
- package/cli/hooks.js +6 -1
- package/cli/status.js +1 -1
- package/package.json +1 -1
package/cli/hooks.js
CHANGED
|
@@ -356,10 +356,15 @@ function isCurrentAiLensHook(entry, expected) {
|
|
|
356
356
|
// Flat format (Cursor)
|
|
357
357
|
if (entry?.command != null) {
|
|
358
358
|
if (isAiLensCapturePath(entry.command)) {
|
|
359
|
+
const expectedCmd = expected?.command || '';
|
|
359
360
|
// On Windows, Cursor hooks require & prefix for PowerShell invocation.
|
|
360
361
|
// If expected has & but entry doesn't, treat as outdated so init updates it.
|
|
361
|
-
const expectedCmd = expected?.command || '';
|
|
362
362
|
if (expectedCmd.startsWith('& ') && !entry.command.startsWith('& ')) return false;
|
|
363
|
+
// On Windows, tilde is not expanded in double-quoted strings by PowerShell.
|
|
364
|
+
// If entry uses ~/ but expected uses an absolute path, treat as outdated.
|
|
365
|
+
const entryHasTilde = entry.command.includes('~/.ai-lens/');
|
|
366
|
+
const expectedHasTilde = expectedCmd.includes('~/.ai-lens/');
|
|
367
|
+
if (entryHasTilde && !expectedHasTilde) return false;
|
|
363
368
|
return true;
|
|
364
369
|
}
|
|
365
370
|
if (norm(entry.command) === norm(expected?.command || expected?.hooks?.[0]?.command || '')) return true;
|
package/cli/status.js
CHANGED
|
@@ -228,7 +228,7 @@ function checkCaptureRun(installedTools) {
|
|
|
228
228
|
// but Claude Code runs hooks via bash/cmd (no `&` prefix).
|
|
229
229
|
// On non-Windows, strip leading "& " if present (e.g. config copied from Windows) so bash doesn't background the process.
|
|
230
230
|
const isWin = process.platform === 'win32';
|
|
231
|
-
const isCursor = name === 'Cursor';
|
|
231
|
+
const isCursor = name === 'Cursor' || name.startsWith('Cursor (');
|
|
232
232
|
const usePS = isWin && isCursor;
|
|
233
233
|
let shellCommand = !isWin && command.startsWith('& ') ? command.slice(2).trim() : command;
|
|
234
234
|
// Expand ~ in the command: bash/zsh won't expand ~ inside single quotes,
|