@rlabs-inc/memory 0.3.9 → 0.3.10
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/README.md +3 -0
- package/package.json +1 -1
- package/src/core/curator.ts +9 -3
- package/src/core/manager.ts +10 -1
package/README.md
CHANGED
|
@@ -336,6 +336,9 @@ This isn't just about remembering facts. It's about preserving:
|
|
|
336
336
|
|
|
337
337
|
## Changelog
|
|
338
338
|
|
|
339
|
+
### v0.3.10
|
|
340
|
+
- **Improvement**: Use `which claude` for universal CLI path discovery - works with any installation method (native, homebrew, npm)
|
|
341
|
+
|
|
339
342
|
### v0.3.9
|
|
340
343
|
- **Fix**: Claude Code v2.0.76+ changed `--output-format json` from single object to array of events. Updated curator and manager to handle both formats with backwards compatibility.
|
|
341
344
|
|
package/package.json
CHANGED
package/src/core/curator.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { CuratedMemory, CurationResult, CurationTrigger } from '../types/me
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Get the correct Claude CLI command path
|
|
13
|
-
*
|
|
13
|
+
* Uses `which` for universal discovery across installation methods
|
|
14
14
|
*/
|
|
15
15
|
function getClaudeCommand(): string {
|
|
16
16
|
// 1. Check for explicit override
|
|
@@ -19,13 +19,19 @@ function getClaudeCommand(): string {
|
|
|
19
19
|
return envCommand
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
// 2.
|
|
22
|
+
// 2. Use `which` to find claude in PATH (universal - works with native, homebrew, npm, etc.)
|
|
23
|
+
const result = Bun.spawnSync(['which', 'claude'])
|
|
24
|
+
if (result.exitCode === 0) {
|
|
25
|
+
return result.stdout.toString().trim()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// 3. Legacy fallback - hardcoded native install path
|
|
23
29
|
const claudeLocal = join(homedir(), '.claude', 'local', 'claude')
|
|
24
30
|
if (existsSync(claudeLocal)) {
|
|
25
31
|
return claudeLocal
|
|
26
32
|
}
|
|
27
33
|
|
|
28
|
-
//
|
|
34
|
+
// 4. Last resort - assume it's in PATH
|
|
29
35
|
return 'claude'
|
|
30
36
|
}
|
|
31
37
|
|
package/src/core/manager.ts
CHANGED
|
@@ -11,15 +11,24 @@ import type { CurationResult } from '../types/memory.ts'
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Get the Claude CLI command path
|
|
14
|
-
*
|
|
14
|
+
* Uses `which` for universal discovery across installation methods
|
|
15
15
|
*/
|
|
16
16
|
function getClaudeCommand(): string {
|
|
17
|
+
// 1. Check for explicit override
|
|
17
18
|
const envCommand = process.env.CURATOR_COMMAND
|
|
18
19
|
if (envCommand) return envCommand
|
|
19
20
|
|
|
21
|
+
// 2. Use `which` to find claude in PATH (universal - works with native, homebrew, npm, etc.)
|
|
22
|
+
const result = Bun.spawnSync(['which', 'claude'])
|
|
23
|
+
if (result.exitCode === 0) {
|
|
24
|
+
return result.stdout.toString().trim()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 3. Legacy fallback - hardcoded native install path
|
|
20
28
|
const claudeLocal = join(homedir(), '.claude', 'local', 'claude')
|
|
21
29
|
if (existsSync(claudeLocal)) return claudeLocal
|
|
22
30
|
|
|
31
|
+
// 4. Last resort
|
|
23
32
|
return 'claude'
|
|
24
33
|
}
|
|
25
34
|
|