@neikyun/ciel 5.2.10 → 5.2.11
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/bin/ciel.js +16 -4
- package/package.json +1 -1
- package/scripts/postinstall.cjs +10 -5
package/bin/ciel.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
// Vérifie si l'initialisation est nécessaire et détecte les nouvelles plateformes.
|
|
4
4
|
|
|
5
5
|
const { existsSync, mkdirSync, writeFileSync, readFileSync, copyFileSync, readdirSync, chmodSync, unlinkSync } = require("fs");
|
|
6
|
-
const { join } = require("path");
|
|
7
|
-
const { execSync } = require("child_process");
|
|
6
|
+
const { join, delimiter } = require("path");
|
|
8
7
|
|
|
9
8
|
const PKG_DIR = join(__dirname, "..");
|
|
10
9
|
const PKG = JSON.parse(readFileSync(join(PKG_DIR, "package.json"), "utf-8"));
|
|
@@ -17,6 +16,19 @@ const c = (code, s) => process.stderr.isTTY ? `\x1b[${code}m${s}\x1b[0m` : s;
|
|
|
17
16
|
const green = (s) => c(32, s);
|
|
18
17
|
const cyan = (s) => c(36, s);
|
|
19
18
|
|
|
19
|
+
// Cherche un exécutable dans le PATH (fiable cross-platform, pas besoin de shell)
|
|
20
|
+
function searchPath(name) {
|
|
21
|
+
const pathExt = (process.env.PATHEXT || "").split(";");
|
|
22
|
+
if (!pathExt[0]) pathExt.push("", ".exe", ".cmd", ".bat", ".com");
|
|
23
|
+
const pathDirs = (process.env.PATH || "").split(delimiter);
|
|
24
|
+
for (const dir of pathDirs) {
|
|
25
|
+
for (const ext of pathExt) {
|
|
26
|
+
if (existsSync(join(dir, name + ext))) return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
20
32
|
// ---- Helpers ----
|
|
21
33
|
function copyDir(src, dest) {
|
|
22
34
|
if (!existsSync(src)) return 0;
|
|
@@ -52,8 +64,8 @@ function detectPlatforms() {
|
|
|
52
64
|
const hasClaude = existsSync(join(targetDir, ".claude/settings.json")) || existsSync(join(targetDir, ".claude"));
|
|
53
65
|
|
|
54
66
|
// Détection CLI
|
|
55
|
-
const hasOC_CLI = (
|
|
56
|
-
const hasClaude_CLI = (
|
|
67
|
+
const hasOC_CLI = searchPath("opencode");
|
|
68
|
+
const hasClaude_CLI = searchPath("claude");
|
|
57
69
|
|
|
58
70
|
if (hasOC || hasOC_CLI) platforms.push("OpenCode");
|
|
59
71
|
if (hasClaude || hasClaude_CLI) platforms.push("Claude Code");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neikyun/ciel",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.11",
|
|
4
4
|
"description": "Ciel — Deep-reasoning pipeline for LLM-assisted development. OpenCode plugin + multi-platform CLI (OpenCode, Claude Code, more).",
|
|
5
5
|
"main": "./dist/plugin/index.js",
|
|
6
6
|
"types": "./dist/plugin/index.d.ts",
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -34,11 +34,16 @@ function resolveAssets() {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function detectCLI(name) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
// Cherche l'exécutable dans le PATH directement (fiable cross-platform)
|
|
38
|
+
const pathExt = process.env.PATHEXT ? process.env.PATHEXT.split(";") : ["", ".exe", ".cmd", ".bat", ".com"];
|
|
39
|
+
const pathDirs = (process.env.PATH || "").split(require("path").delimiter);
|
|
40
|
+
for (const dir of pathDirs) {
|
|
41
|
+
for (const ext of pathExt) {
|
|
42
|
+
const fullPath = require("path").join(dir, name + ext);
|
|
43
|
+
if (existsSync(fullPath)) return true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return false;
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
// ---- Installation ----
|