@neikyun/ciel 5.2.11 → 5.2.13
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 -1
- package/package.json +1 -1
- package/scripts/postinstall.cjs +20 -50
package/bin/ciel.js
CHANGED
|
@@ -75,11 +75,11 @@ function detectPlatforms() {
|
|
|
75
75
|
// ---- Installer une plateforme ----
|
|
76
76
|
function installOpenCode() {
|
|
77
77
|
let total = 0;
|
|
78
|
-
// Nettoyer ancien plugin curl
|
|
79
78
|
const old = join(targetDir, ".opencode/plugins/ciel.ts");
|
|
80
79
|
if (existsSync(old)) { try { unlinkSync(old); } catch {} }
|
|
81
80
|
total += copyDir(join(ASSETS, "platforms/opencode/.opencode/agents"), join(targetDir, ".opencode/agents"));
|
|
82
81
|
total += copyDir(join(ASSETS, "platforms/opencode/.opencode/commands"), join(targetDir, ".opencode/commands"));
|
|
82
|
+
total += copyDir(join(ASSETS, "skills"), join(targetDir, ".opencode/skills"));
|
|
83
83
|
if (existsSync(join(ASSETS, "platforms/opencode/AGENTS.md"))) {
|
|
84
84
|
copyFileSync(join(ASSETS, "platforms/opencode/AGENTS.md"), join(targetDir, "AGENTS.md"));
|
|
85
85
|
total++;
|
|
@@ -88,6 +88,29 @@ function installOpenCode() {
|
|
|
88
88
|
return total;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
function installClaude() {
|
|
92
|
+
let total = 0;
|
|
93
|
+
total += copyDir(join(ASSETS, ".claude/agents"), join(targetDir, ".claude/agents"));
|
|
94
|
+
total += copyDir(join(ASSETS, ".claude/hooks"), join(targetDir, ".claude/hooks"));
|
|
95
|
+
total += copyDir(join(ASSETS, "commands"), join(targetDir, ".claude/commands"));
|
|
96
|
+
total += copyDir(join(ASSETS, "skills"), join(targetDir, ".claude/skills"));
|
|
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++;
|
|
101
|
+
}
|
|
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
|
+
}
|
|
113
|
+
|
|
91
114
|
function installClaude() {
|
|
92
115
|
let total = 0;
|
|
93
116
|
total += copyDir(join(ASSETS, ".claude/agents"), join(targetDir, ".claude/agents"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neikyun/ciel",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.13",
|
|
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
|
@@ -68,6 +68,8 @@ function installOpenCode(targetDir, assets) {
|
|
|
68
68
|
count += copyDir(join(assets, "platforms/opencode/.opencode/agents"), join(targetDir, ".opencode/agents"));
|
|
69
69
|
// Copier commandes
|
|
70
70
|
count += copyDir(join(assets, "platforms/opencode/.opencode/commands"), join(targetDir, ".opencode/commands"));
|
|
71
|
+
// Copier skills (OpenCode supporte aussi les skills)
|
|
72
|
+
count += copyDir(join(assets, "skills"), join(targetDir, ".opencode/skills"));
|
|
71
73
|
// Copier AGENTS.md
|
|
72
74
|
if (existsSync(join(assets, "platforms/opencode/AGENTS.md"))) {
|
|
73
75
|
copyFileSync(join(assets, "platforms/opencode/AGENTS.md"), join(targetDir, "AGENTS.md"));
|
|
@@ -96,6 +98,13 @@ function installClaude(targetDir, assets) {
|
|
|
96
98
|
count += copyDir(join(assets, ".claude/agents"), join(targetDir, ".claude/agents"));
|
|
97
99
|
count += copyDir(join(assets, ".claude/hooks"), join(targetDir, ".claude/hooks"));
|
|
98
100
|
count += copyDir(join(assets, "commands"), join(targetDir, ".claude/commands"));
|
|
101
|
+
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
|
+
}
|
|
99
108
|
const settings = join(assets, ".claude/settings.json");
|
|
100
109
|
if (existsSync(settings)) { copyFileSync(settings, join(targetDir, ".claude/settings.json")); count++; }
|
|
101
110
|
const claudeMd = join(assets, "CLAUDE.md");
|
|
@@ -113,6 +122,12 @@ async function main() {
|
|
|
113
122
|
const platforms = detectPlatforms(targetDir);
|
|
114
123
|
const assetsDir = resolveAssets();
|
|
115
124
|
|
|
125
|
+
// TOUJOURS chercher les CLI, même si des plateformes sont déjà détectées
|
|
126
|
+
const hasClaudeCLI = detectCLI("claude");
|
|
127
|
+
const hasOpenCodeCLI = detectCLI("opencode");
|
|
128
|
+
if (hasClaudeCLI && !platforms.includes("Claude Code")) platforms.push("Claude Code");
|
|
129
|
+
if (hasOpenCodeCLI && !platforms.includes("OpenCode")) platforms.push("OpenCode");
|
|
130
|
+
|
|
116
131
|
// Toujours afficher le message Ciel (sur stderr pour être visible via npm)
|
|
117
132
|
console.error(`\n ${bold("✦ Ciel v" + CIEL_VERSION)}`);
|
|
118
133
|
|
|
@@ -122,56 +137,11 @@ async function main() {
|
|
|
122
137
|
}
|
|
123
138
|
|
|
124
139
|
if (platforms.length === 0) {
|
|
125
|
-
// Aucune plateforme détectée
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
console.error(` ${yellow("~")} Aucune plateforme détectée.`);
|
|
131
|
-
console.error(` Installez ${cyan("opencode")} ou ${cyan("claude")} puis relancez.`);
|
|
132
|
-
console.error(` Ou: ${green("npx ciel init")}\n`);
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Proposer de configurer les CLIs détectées
|
|
137
|
-
let creer = !process.stdin.isTTY;
|
|
138
|
-
if (process.stdin.isTTY) {
|
|
139
|
-
const detected = [hasOpenCode && "OpenCode", hasClaude && "Claude Code"].filter(Boolean).join(" + ");
|
|
140
|
-
try {
|
|
141
|
-
const readline = require("readline");
|
|
142
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
143
|
-
creer = await new Promise(r => rl.question(` ${yellow("?")} Configurer Ciel pour ${cyan(detected)} ? ${green("(Y/n)")} `, a => { rl.close(); r(a.trim().toLowerCase() !== "n"); }));
|
|
144
|
-
} catch { creer = true; }
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (!creer) {
|
|
148
|
-
console.error(` ${cyan("→")} Annulé. Utilisez ${green("npx ciel init")} plus tard.\n`);
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Configurer les plateformes détectées
|
|
153
|
-
if (hasOpenCode) {
|
|
154
|
-
const cfgPath = join(targetDir, "opencode.json");
|
|
155
|
-
if (!existsSync(cfgPath)) {
|
|
156
|
-
const cfg = { $schema: "https://opencode.ai/config.json", plugin: ["@neikyun/ciel"] };
|
|
157
|
-
writeFileSync(cfgPath, JSON.stringify(cfg, null, 2) + "\n", "utf-8");
|
|
158
|
-
console.error(` ${green("✓")} opencode.json créé`);
|
|
159
|
-
}
|
|
160
|
-
platforms.push("OpenCode");
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (hasClaude) {
|
|
164
|
-
const claudeDir = join(targetDir, ".claude");
|
|
165
|
-
if (!existsSync(claudeDir)) {
|
|
166
|
-
mkdirSync(claudeDir, { recursive: true });
|
|
167
|
-
}
|
|
168
|
-
const settingsPath = join(claudeDir, "settings.json");
|
|
169
|
-
if (!existsSync(settingsPath)) {
|
|
170
|
-
writeFileSync(settingsPath, JSON.stringify({}, null, 2) + "\n", "utf-8");
|
|
171
|
-
console.error(` ${green("✓")} .claude/settings.json créé`);
|
|
172
|
-
}
|
|
173
|
-
platforms.push("Claude Code");
|
|
174
|
-
}
|
|
140
|
+
// Aucune plateforme détectée (ni config, ni CLI)
|
|
141
|
+
console.error(` ${yellow("~")} Aucune plateforme détectée.`);
|
|
142
|
+
console.error(` Installez ${cyan("opencode")} ou ${cyan("claude")} puis relancez.`);
|
|
143
|
+
console.error(` Ou: ${green("npx ciel init")}\n`);
|
|
144
|
+
return;
|
|
175
145
|
}
|
|
176
146
|
|
|
177
147
|
// Demander confirmation (sauter si non-TTY)
|