@neikyun/ciel 5.2.14 → 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 -16
- package/package.json +1 -1
- package/scripts/postinstall.cjs +24 -1
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,29 +100,25 @@ function installOpenCode() {
|
|
|
88
100
|
return total;
|
|
89
101
|
}
|
|
90
102
|
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (existsSync(join(ASSETS, ".claude/settings.json"))) {
|
|
98
|
-
copyFileSync(join(ASSETS, ".claude/settings.json"), join(targetDir, ".claude/settings.json"));
|
|
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 {} }
|
|
99
109
|
}
|
|
100
|
-
if (existsSync(join(ASSETS, "CLAUDE.md"))) {
|
|
101
|
-
copyFileSync(join(ASSETS, "CLAUDE.md"), join(targetDir, "CLAUDE.md"));
|
|
102
|
-
}
|
|
103
|
-
return total;
|
|
104
|
-
}
|
|
105
|
-
if (patchOpencodeJson(targetDir)) total++;
|
|
106
|
-
return total;
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
function installClaude() {
|
|
110
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"));
|
|
111
118
|
total += copyDir(join(ASSETS, ".claude/agents"), join(targetDir, ".claude/agents"));
|
|
112
119
|
total += copyDir(join(ASSETS, ".claude/hooks"), join(targetDir, ".claude/hooks"));
|
|
113
120
|
total += copyDir(join(ASSETS, "commands"), join(targetDir, ".claude/commands"));
|
|
121
|
+
total += copyDir(join(ASSETS, "skills"), join(targetDir, ".claude/skills"));
|
|
114
122
|
if (existsSync(join(ASSETS, ".claude/settings.json"))) {
|
|
115
123
|
copyFileSync(join(ASSETS, ".claude/settings.json"), join(targetDir, ".claude/settings.json"));
|
|
116
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,6 +113,11 @@ 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"));
|