@kaitranntt/ccs 7.28.1 → 7.28.2
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.
|
@@ -26,6 +26,18 @@
|
|
|
26
26
|
|
|
27
27
|
const { spawnSync } = require('child_process');
|
|
28
28
|
|
|
29
|
+
// ============================================================================
|
|
30
|
+
// PLATFORM DETECTION
|
|
31
|
+
// ============================================================================
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Windows platform flag - used for shell option in spawnSync calls.
|
|
35
|
+
* On Windows, globally installed CLI tools via npm/pnpm are .cmd/.bat files,
|
|
36
|
+
* which require shell: true to execute properly.
|
|
37
|
+
* @see https://github.com/kaitranntt/ccs/issues/378
|
|
38
|
+
*/
|
|
39
|
+
const isWindows = process.platform === 'win32';
|
|
40
|
+
|
|
29
41
|
// ============================================================================
|
|
30
42
|
// CONFIGURATION - Edit these for prompt engineering
|
|
31
43
|
// ============================================================================
|
|
@@ -154,7 +166,6 @@ process.stdin.on('error', () => {
|
|
|
154
166
|
*/
|
|
155
167
|
function isCliAvailable(cmd) {
|
|
156
168
|
try {
|
|
157
|
-
const isWindows = process.platform === 'win32';
|
|
158
169
|
const whichCmd = isWindows ? 'where.exe' : 'which';
|
|
159
170
|
|
|
160
171
|
const result = spawnSync(whichCmd, [cmd], {
|
|
@@ -292,6 +303,7 @@ function tryGeminiSearch(query, timeoutSec = DEFAULT_TIMEOUT_SEC) {
|
|
|
292
303
|
timeout: timeoutMs,
|
|
293
304
|
maxBuffer: 1024 * 1024 * 2,
|
|
294
305
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
306
|
+
shell: isWindows,
|
|
295
307
|
}
|
|
296
308
|
);
|
|
297
309
|
|
|
@@ -358,6 +370,7 @@ function tryOpenCodeSearch(query, timeoutSec = DEFAULT_TIMEOUT_SEC) {
|
|
|
358
370
|
timeout: timeoutMs,
|
|
359
371
|
maxBuffer: 1024 * 1024 * 2,
|
|
360
372
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
373
|
+
shell: isWindows,
|
|
361
374
|
}
|
|
362
375
|
);
|
|
363
376
|
|
|
@@ -417,6 +430,7 @@ function tryGrokSearch(query, timeoutSec = DEFAULT_TIMEOUT_SEC) {
|
|
|
417
430
|
timeout: timeoutMs,
|
|
418
431
|
maxBuffer: 1024 * 1024 * 2,
|
|
419
432
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
433
|
+
shell: isWindows,
|
|
420
434
|
});
|
|
421
435
|
|
|
422
436
|
if (spawnResult.error) {
|