vipcare 0.3.21 → 0.3.23
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/lib/card.js +5 -1
- package/lib/synthesizer.js +14 -3
- package/package.json +1 -1
package/lib/card.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
|
+
import os from 'os';
|
|
2
3
|
import path from 'path';
|
|
3
4
|
import { loadProfile } from './profile.js';
|
|
4
5
|
|
|
@@ -13,7 +14,10 @@ export function extractVipData(content) {
|
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
export function generateCards(profiles, outputPath
|
|
17
|
+
export function generateCards(profiles, outputPath) {
|
|
18
|
+
if (!outputPath) {
|
|
19
|
+
outputPath = path.join(os.homedir(), '.vip', 'cards', 'index.html');
|
|
20
|
+
}
|
|
17
21
|
const cards = [];
|
|
18
22
|
|
|
19
23
|
for (const p of profiles) {
|
package/lib/synthesizer.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { execFileSync } from 'child_process';
|
|
1
|
+
import { execFileSync, spawnSync } from 'child_process';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import path from 'path';
|
|
2
5
|
import { checkTool, loadConfig } from './config.js';
|
|
3
6
|
import { PROFILE_SYSTEM_PROMPT, CHANGE_DETECTION_PROMPT } from './templates.js';
|
|
4
7
|
|
|
@@ -31,13 +34,21 @@ function copilotAvailable() {
|
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
function callClaudeCli(prompt, timeout = 120000) {
|
|
34
|
-
|
|
37
|
+
// Pipe prompt via stdin to avoid OS arg length limits on long prompts
|
|
38
|
+
const result = spawnSync('claude', ['--print'], {
|
|
39
|
+
input: prompt,
|
|
35
40
|
encoding: 'utf-8',
|
|
36
41
|
timeout,
|
|
37
42
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
38
43
|
maxBuffer: 1024 * 1024 * 10,
|
|
39
44
|
});
|
|
40
|
-
|
|
45
|
+
if (result.error) {
|
|
46
|
+
throw new Error(result.error.message);
|
|
47
|
+
}
|
|
48
|
+
if (result.status !== 0) {
|
|
49
|
+
throw new Error(result.stderr?.trim() || 'Claude CLI failed');
|
|
50
|
+
}
|
|
51
|
+
return result.stdout.trim();
|
|
41
52
|
}
|
|
42
53
|
|
|
43
54
|
async function callAnthropicApi(prompt) {
|