@neikyun/ciel 5.2.13 → 5.2.15
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 +24 -21
- package/package.json +1 -1
- package/scripts/postinstall.cjs +24 -7
package/bin/ciel.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Ciel CLI — bootstrap entry point
|
|
3
3
|
// Vérifie si l'initialisation est nécessaire et détecte les nouvelles plateformes.
|
|
4
4
|
|
|
5
|
-
const { existsSync, mkdirSync, writeFileSync, readFileSync, copyFileSync, readdirSync, chmodSync, unlinkSync } = require("fs");
|
|
5
|
+
const { existsSync, mkdirSync, writeFileSync, readFileSync, copyFileSync, readdirSync, chmodSync, unlinkSync, rmSync } = require("fs");
|
|
6
6
|
const { join, delimiter } = require("path");
|
|
7
7
|
|
|
8
8
|
const PKG_DIR = join(__dirname, "..");
|
|
@@ -73,8 +73,20 @@ function detectPlatforms() {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// ---- Installer une plateforme ----
|
|
76
|
+
function cleanDir(dir) {
|
|
77
|
+
if (!existsSync(dir)) return;
|
|
78
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
79
|
+
const full = join(dir, entry.name);
|
|
80
|
+
if (entry.isDirectory()) { try { rmSync(full, { recursive: true, force: true }); } catch {} }
|
|
81
|
+
else { try { unlinkSync(full); } catch {} }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
76
85
|
function installOpenCode() {
|
|
77
86
|
let total = 0;
|
|
87
|
+
cleanDir(join(targetDir, ".opencode/agents"));
|
|
88
|
+
cleanDir(join(targetDir, ".opencode/commands"));
|
|
89
|
+
cleanDir(join(targetDir, ".opencode/skills"));
|
|
78
90
|
const old = join(targetDir, ".opencode/plugins/ciel.ts");
|
|
79
91
|
if (existsSync(old)) { try { unlinkSync(old); } catch {} }
|
|
80
92
|
total += copyDir(join(ASSETS, "platforms/opencode/.opencode/agents"), join(targetDir, ".opencode/agents"));
|
|
@@ -88,34 +100,25 @@ function installOpenCode() {
|
|
|
88
100
|
return total;
|
|
89
101
|
}
|
|
90
102
|
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const cielCmd = join(ASSETS, "platforms/opencode/.opencode/commands/ciel.md");
|
|
98
|
-
if (existsSync(cielCmd)) {
|
|
99
|
-
copyFileSync(cielCmd, join(targetDir, ".claude/commands/ciel.md"));
|
|
100
|
-
total++;
|
|
103
|
+
function cleanDir(dir) {
|
|
104
|
+
if (!existsSync(dir)) return;
|
|
105
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
106
|
+
const full = join(dir, entry.name);
|
|
107
|
+
if (entry.isDirectory()) { try { rmSync(full, { recursive: true, force: true }); } catch {} }
|
|
108
|
+
else { try { unlinkSync(full); } catch {} }
|
|
101
109
|
}
|
|
102
|
-
if (existsSync(join(ASSETS, ".claude/settings.json"))) {
|
|
103
|
-
copyFileSync(join(ASSETS, ".claude/settings.json"), join(targetDir, ".claude/settings.json"));
|
|
104
|
-
}
|
|
105
|
-
if (existsSync(join(ASSETS, "CLAUDE.md"))) {
|
|
106
|
-
copyFileSync(join(ASSETS, "CLAUDE.md"), join(targetDir, "CLAUDE.md"));
|
|
107
|
-
}
|
|
108
|
-
return total;
|
|
109
|
-
}
|
|
110
|
-
if (patchOpencodeJson(targetDir)) total++;
|
|
111
|
-
return total;
|
|
112
110
|
}
|
|
113
111
|
|
|
114
112
|
function installClaude() {
|
|
115
113
|
let total = 0;
|
|
114
|
+
cleanDir(join(targetDir, ".claude/agents"));
|
|
115
|
+
cleanDir(join(targetDir, ".claude/hooks"));
|
|
116
|
+
cleanDir(join(targetDir, ".claude/commands"));
|
|
117
|
+
cleanDir(join(targetDir, ".claude/skills"));
|
|
116
118
|
total += copyDir(join(ASSETS, ".claude/agents"), join(targetDir, ".claude/agents"));
|
|
117
119
|
total += copyDir(join(ASSETS, ".claude/hooks"), join(targetDir, ".claude/hooks"));
|
|
118
120
|
total += copyDir(join(ASSETS, "commands"), join(targetDir, ".claude/commands"));
|
|
121
|
+
total += copyDir(join(ASSETS, "skills"), join(targetDir, ".claude/skills"));
|
|
119
122
|
if (existsSync(join(ASSETS, ".claude/settings.json"))) {
|
|
120
123
|
copyFileSync(join(ASSETS, ".claude/settings.json"), join(targetDir, ".claude/settings.json"));
|
|
121
124
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neikyun/ciel",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.15",
|
|
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
|
@@ -47,6 +47,20 @@ function detectCLI(name) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// ---- Installation ----
|
|
50
|
+
function cleanDir(dir) {
|
|
51
|
+
// Supprime tout le contenu d'un dossier (mais garde le dossier)
|
|
52
|
+
if (!existsSync(dir)) return;
|
|
53
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
54
|
+
const full = join(dir, entry.name);
|
|
55
|
+
if (entry.isDirectory()) {
|
|
56
|
+
const { rmSync } = require("fs");
|
|
57
|
+
try { rmSync(full, { recursive: true, force: true }); } catch {}
|
|
58
|
+
} else {
|
|
59
|
+
try { unlinkSync(full); } catch {}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
50
64
|
function copyDir(src, dest) {
|
|
51
65
|
if (!existsSync(src)) return 0;
|
|
52
66
|
let count = 0;
|
|
@@ -61,6 +75,10 @@ function copyDir(src, dest) {
|
|
|
61
75
|
|
|
62
76
|
function installOpenCode(targetDir, assets) {
|
|
63
77
|
let count = 0;
|
|
78
|
+
// Nettoyer les anciens fichiers (pour mise à jour propre)
|
|
79
|
+
cleanDir(join(targetDir, ".opencode/agents"));
|
|
80
|
+
cleanDir(join(targetDir, ".opencode/commands"));
|
|
81
|
+
cleanDir(join(targetDir, ".opencode/skills"));
|
|
64
82
|
// Nettoyer ancien plugin curl
|
|
65
83
|
const old = join(targetDir, ".opencode/plugins/ciel.ts");
|
|
66
84
|
if (existsSync(old)) { try { unlinkSync(old); count++; } catch {} }
|
|
@@ -68,7 +86,7 @@ function installOpenCode(targetDir, assets) {
|
|
|
68
86
|
count += copyDir(join(assets, "platforms/opencode/.opencode/agents"), join(targetDir, ".opencode/agents"));
|
|
69
87
|
// Copier commandes
|
|
70
88
|
count += copyDir(join(assets, "platforms/opencode/.opencode/commands"), join(targetDir, ".opencode/commands"));
|
|
71
|
-
// Copier skills
|
|
89
|
+
// Copier skills
|
|
72
90
|
count += copyDir(join(assets, "skills"), join(targetDir, ".opencode/skills"));
|
|
73
91
|
// Copier AGENTS.md
|
|
74
92
|
if (existsSync(join(assets, "platforms/opencode/AGENTS.md"))) {
|
|
@@ -95,16 +113,15 @@ function installOpenCode(targetDir, assets) {
|
|
|
95
113
|
|
|
96
114
|
function installClaude(targetDir, assets) {
|
|
97
115
|
let count = 0;
|
|
116
|
+
// Nettoyer les anciens fichiers
|
|
117
|
+
cleanDir(join(targetDir, ".claude/agents"));
|
|
118
|
+
cleanDir(join(targetDir, ".claude/hooks"));
|
|
119
|
+
cleanDir(join(targetDir, ".claude/commands"));
|
|
120
|
+
cleanDir(join(targetDir, ".claude/skills"));
|
|
98
121
|
count += copyDir(join(assets, ".claude/agents"), join(targetDir, ".claude/agents"));
|
|
99
122
|
count += copyDir(join(assets, ".claude/hooks"), join(targetDir, ".claude/hooks"));
|
|
100
123
|
count += copyDir(join(assets, "commands"), join(targetDir, ".claude/commands"));
|
|
101
124
|
count += copyDir(join(assets, "skills"), join(targetDir, ".claude/skills"));
|
|
102
|
-
// Copier ciel.md (commande principale) depuis les assets génériques OU OpenCode
|
|
103
|
-
const cielCmd = join(assets, "platforms/opencode/.opencode/commands/ciel.md");
|
|
104
|
-
if (existsSync(cielCmd)) {
|
|
105
|
-
copyFileSync(cielCmd, join(targetDir, ".claude/commands/ciel.md"));
|
|
106
|
-
count++;
|
|
107
|
-
}
|
|
108
125
|
const settings = join(assets, ".claude/settings.json");
|
|
109
126
|
if (existsSync(settings)) { copyFileSync(settings, join(targetDir, ".claude/settings.json")); count++; }
|
|
110
127
|
const claudeMd = join(assets, "CLAUDE.md");
|