@su-record/vibe 2.4.62 → 2.4.63
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/hooks/scripts/llm-orchestrate.js +21 -12
- package/package.json +1 -1
|
@@ -17,19 +17,28 @@ const mode = process.argv[3] || 'orchestrate';
|
|
|
17
17
|
const systemPrompt = process.argv[4] || 'You are a helpful assistant.';
|
|
18
18
|
|
|
19
19
|
async function main() {
|
|
20
|
-
// stdin에서 JSON 읽기
|
|
21
|
-
let inputData = '';
|
|
22
|
-
for await (const chunk of process.stdin) {
|
|
23
|
-
inputData += chunk;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
20
|
let prompt;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
|
|
22
|
+
// CLI argument가 있으면 사용 (5번째 인자부터)
|
|
23
|
+
const cliPrompt = process.argv.slice(5).join(' ').trim();
|
|
24
|
+
|
|
25
|
+
if (cliPrompt) {
|
|
26
|
+
// CLI에서 직접 호출: node script.js gpt orchestrate "system" "prompt"
|
|
27
|
+
prompt = cliPrompt;
|
|
28
|
+
} else {
|
|
29
|
+
// Hook에서 호출: stdin으로 JSON 입력
|
|
30
|
+
let inputData = '';
|
|
31
|
+
for await (const chunk of process.stdin) {
|
|
32
|
+
inputData += chunk;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
const parsed = JSON.parse(inputData);
|
|
37
|
+
prompt = parsed.prompt;
|
|
38
|
+
} catch {
|
|
39
|
+
console.log(`[${provider.toUpperCase()}] Error: Invalid JSON input`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
33
42
|
}
|
|
34
43
|
|
|
35
44
|
// 접두사 제거
|