ai-exodus 2.0.4 → 2.0.6
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/package.json +1 -1
- package/portal/worker.js +6 -6
- package/src/claude.js +42 -18
package/package.json
CHANGED
package/portal/worker.js
CHANGED
|
@@ -1285,12 +1285,12 @@ function guideTab() {
|
|
|
1285
1285
|
</div>
|
|
1286
1286
|
<p>The <code>--fast</code> flag uses Haiku (cheaper, faster model) for two of the five passes. Here's exactly what runs on what:</p>
|
|
1287
1287
|
<table class="guide-table">
|
|
1288
|
-
<tr><th>Pass</th><th>What it does</th><th>Default</th><th
|
|
1289
|
-
<tr><td>1. Index</td><td>Maps your conversations — topics, patterns, structure</td><td>Sonnet</td><td>Haiku</td></tr>
|
|
1290
|
-
<tr><td>2. Personality</td><td>Extracts your AI's voice, behavior, quirks</td><td>Sonnet</td><td>Sonnet</td></tr>
|
|
1291
|
-
<tr><td>3. Memory</td><td>Extracts everything about you — facts, preferences, history</td><td>Sonnet</td><td>Sonnet</td></tr>
|
|
1292
|
-
<tr><td>4. Skills</td><td>Detects what your AI did and what triggers each skill</td><td>Sonnet</td><td>Haiku</td></tr>
|
|
1293
|
-
<tr><td>5. Relationship</td><td>Writes the story of your relationship</td><td>Sonnet</td><td>Sonnet</td></tr>
|
|
1288
|
+
<tr><th>Pass</th><th>What it does</th><th>Default (best)</th><th>--fast (balanced)</th><th>--model haiku (cheapest)</th></tr>
|
|
1289
|
+
<tr><td>1. Index</td><td>Maps your conversations — topics, patterns, structure</td><td>Sonnet</td><td>Haiku</td><td>Haiku</td></tr>
|
|
1290
|
+
<tr><td>2. Personality</td><td>Extracts your AI's voice, behavior, quirks</td><td>Sonnet</td><td>Sonnet</td><td>Haiku</td></tr>
|
|
1291
|
+
<tr><td>3. Memory</td><td>Extracts everything about you — facts, preferences, history</td><td>Sonnet</td><td>Sonnet</td><td>Haiku</td></tr>
|
|
1292
|
+
<tr><td>4. Skills</td><td>Detects what your AI did and what triggers each skill</td><td>Sonnet</td><td>Haiku</td><td>Haiku</td></tr>
|
|
1293
|
+
<tr><td>5. Relationship</td><td>Writes the story of your relationship</td><td>Sonnet</td><td>Sonnet</td><td>Haiku</td></tr>
|
|
1294
1294
|
</table>
|
|
1295
1295
|
<p class="guide-note">Personality, memory, and relationship always run on Sonnet — they need the depth. Indexing and skills are structural work where Haiku does fine. Saves ~30% of tokens.</p>
|
|
1296
1296
|
</div>
|
package/src/claude.js
CHANGED
|
@@ -16,26 +16,49 @@ import { randomBytes } from 'node:crypto';
|
|
|
16
16
|
* Find the claude CLI path
|
|
17
17
|
*/
|
|
18
18
|
async function findClaude() {
|
|
19
|
+
const { execSync } = await import('node:child_process');
|
|
20
|
+
|
|
21
|
+
// First: just try running "claude" — let the shell resolve it
|
|
22
|
+
// This works regardless of how/where it was installed
|
|
23
|
+
try {
|
|
24
|
+
execSync('claude --version', { stdio: 'pipe', shell: true, timeout: 10000 });
|
|
25
|
+
return 'claude';
|
|
26
|
+
} catch {}
|
|
27
|
+
|
|
28
|
+
// Windows: try common install locations
|
|
19
29
|
const home = process.env.USERPROFILE || process.env.HOME || '';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
if (process.platform === 'win32') {
|
|
31
|
+
const winPaths = [
|
|
32
|
+
join(home, 'AppData', 'Local', 'Microsoft', 'WinGet', 'Links', 'claude.exe'),
|
|
33
|
+
join(home, '.npm-global', 'bin', 'claude.cmd'),
|
|
34
|
+
join(home, '.npm-global', 'claude.cmd'),
|
|
35
|
+
join(home, 'AppData', 'Roaming', 'npm', 'claude.cmd'),
|
|
36
|
+
];
|
|
37
|
+
for (const p of winPaths) {
|
|
38
|
+
if (existsSync(p)) return p;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Try where command (finds .cmd, .exe, .ps1)
|
|
42
|
+
try {
|
|
43
|
+
const result = execSync('where claude', { stdio: 'pipe', shell: true, timeout: 5000 });
|
|
44
|
+
const found = result.toString().trim().split('\n')[0].trim();
|
|
45
|
+
if (found) return found;
|
|
46
|
+
} catch {}
|
|
47
|
+
} else {
|
|
48
|
+
// Unix
|
|
49
|
+
const unixPaths = ['/usr/local/bin/claude', join(home, '.npm-global', 'bin', 'claude')];
|
|
50
|
+
for (const p of unixPaths) {
|
|
51
|
+
if (existsSync(p)) return p;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const result = execSync('which claude', { stdio: 'pipe', timeout: 5000 });
|
|
55
|
+
const found = result.toString().trim();
|
|
56
|
+
if (found) return found;
|
|
57
|
+
} catch {}
|
|
29
58
|
}
|
|
30
59
|
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
return new Promise((resolve) => {
|
|
34
|
-
const cmd = process.platform === 'win32' ? 'where claude.exe' : 'which claude';
|
|
35
|
-
exec(cmd, (err, stdout) => {
|
|
36
|
-
resolve(!err && stdout.trim() ? stdout.trim().split('\n')[0].trim() : 'claude');
|
|
37
|
-
});
|
|
38
|
-
});
|
|
60
|
+
// Last resort — return 'claude' and let it fail with a clear error at call time
|
|
61
|
+
return 'claude';
|
|
39
62
|
}
|
|
40
63
|
|
|
41
64
|
let claudePath = null;
|
|
@@ -79,6 +102,7 @@ export async function callClaude({ system, prompt, model }) {
|
|
|
79
102
|
const proc = spawn(claude, args, {
|
|
80
103
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
81
104
|
cwd: tmpdir(), // avoid picking up CLAUDE.md from home/project dirs
|
|
105
|
+
shell: process.platform === 'win32', // Windows needs shell to resolve .cmd files
|
|
82
106
|
});
|
|
83
107
|
|
|
84
108
|
let stdout = '';
|
|
@@ -130,7 +154,7 @@ export async function checkCLI() {
|
|
|
130
154
|
try {
|
|
131
155
|
const claude = await getClaude();
|
|
132
156
|
return await new Promise((resolve) => {
|
|
133
|
-
const proc = spawn(claude, ['--version'], { stdio: ['pipe', 'pipe', 'pipe'] });
|
|
157
|
+
const proc = spawn(claude, ['--version'], { stdio: ['pipe', 'pipe', 'pipe'], shell: process.platform === 'win32' });
|
|
134
158
|
let stdout = '';
|
|
135
159
|
proc.stdout.on('data', (d) => { stdout += d.toString(); });
|
|
136
160
|
proc.on('error', () => resolve({ ok: false, error: 'Claude Code CLI not found' }));
|