prompt-skill-armory 0.5.1 → 0.5.3
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/cli.cjs +15 -7
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -132,14 +132,17 @@ function addBundle(profileDir) {
|
|
|
132
132
|
*/
|
|
133
133
|
function mountClientPanel(profileDir) {
|
|
134
134
|
const patchPath = join(profileDir, 'cordis.patch.yml')
|
|
135
|
-
const existing = existsSync(patchPath) ? readFileSync(patchPath, 'utf8') : '
|
|
136
|
-
|
|
135
|
+
const existing = existsSync(patchPath) ? readFileSync(patchPath, 'utf8') : ''
|
|
136
|
+
const cleanBase = '# Your patch layer for this dsh profile.\n[]\n'
|
|
137
|
+
const mount = `# Prompt-SkillArmory client panel.\n- insert:\n - id: ui-switchblade\n name: '@deepseek-ai/dsh-client-ui-switchblade'\n`
|
|
138
|
+
// Idempotent ONLY when the patch is already exactly our clean format.
|
|
139
|
+
const canonical = `${cleanBase}${mount}`
|
|
140
|
+
if (existing.replace(/\r/g, '') === canonical) {
|
|
137
141
|
console.log(` · ui-switchblade already mounted in ${patchPath}`)
|
|
138
142
|
return
|
|
139
143
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
writeFileSync(patchPath, `${base}${mount}`)
|
|
144
|
+
// Otherwise (missing, empty, or malformed from an older installer) rewrite.
|
|
145
|
+
writeFileSync(patchPath, canonical)
|
|
143
146
|
console.log(` ✓ mounted ui-switchblade in ${patchPath}`)
|
|
144
147
|
}
|
|
145
148
|
|
|
@@ -159,9 +162,14 @@ function main() {
|
|
|
159
162
|
}
|
|
160
163
|
|
|
161
164
|
let profiles = findProfiles()
|
|
165
|
+
const ensured = ensureProfile() // always ensure web + desktop exist
|
|
166
|
+
// merge: prefer existing, add any newly ensured
|
|
167
|
+
for (const dir of ensured) {
|
|
168
|
+
if (!profiles.includes(dir)) profiles.push(dir)
|
|
169
|
+
}
|
|
162
170
|
if (profiles.length === 0) {
|
|
163
|
-
console.
|
|
164
|
-
|
|
171
|
+
console.error(' ✖ no profiles available')
|
|
172
|
+
process.exit(1)
|
|
165
173
|
}
|
|
166
174
|
|
|
167
175
|
for (const profileDir of profiles) {
|