prompt-skill-armory 0.4.7 → 0.4.9

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.
Files changed (2) hide show
  1. package/cli.cjs +27 -16
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -69,6 +69,24 @@ function findProfiles() {
69
69
  return out
70
70
  }
71
71
 
72
+ /** Create a standard web profile so the installer works on a fresh machine. */
73
+ function ensureProfile() {
74
+ if (!existsSync(profilesDir)) mkdirSync(profilesDir, { recursive: true })
75
+ const web = join(profilesDir, 'web')
76
+ mkdirSync(join(web, 'node_modules'), { recursive: true })
77
+ const manifestPath = join(web, 'package.json')
78
+ if (!existsSync(manifestPath)) {
79
+ writeFileSync(manifestPath, JSON.stringify({
80
+ name: 'dsh-profile-web',
81
+ private: true,
82
+ dependencies: {},
83
+ dsh: { profile: { bundles: ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-web-app'] } },
84
+ }, null, 2))
85
+ console.log(` ✓ created profile ${web}`)
86
+ }
87
+ return web
88
+ }
89
+
72
90
  /** Copy one bundled package into a profile's @deepseek-ai scope. */
73
91
  function installPackage(pkg, profileDir) {
74
92
  const scopedDir = join(profileDir, 'node_modules', '@deepseek-ai')
@@ -96,19 +114,12 @@ function addBundle(profileDir) {
96
114
  }
97
115
  }
98
116
 
99
- /** Mount the client panel via the profile's cordis.patch.yml. */
117
+ /** Mount the client panel via the profile's cordis.patch.yml.
118
+ * No longer automatic: the web-app bundle (shipped with the client / harness)
119
+ * already composes ui-switchblade; adding it again to a profile patch causes
120
+ * a duplicate loader entry. Kept as a no-op for backwards safety. */
100
121
  function mountClientPanel(profileDir) {
101
- const patchPath = join(profileDir, 'cordis.patch.yml')
102
- const existing = existsSync(patchPath) ? readFileSync(patchPath, 'utf8') : '[]'
103
- if (existing.includes('ui-switchblade')) {
104
- console.log(` · ui-switchblade already mounted in ${patchPath}`)
105
- return
106
- }
107
- const mount = `# Prompt-SkillArmory: mount the Web panel (client half).\n- insert:\n - id: ui-switchblade\n name: '@deepseek-ai/dsh-client-ui-switchblade'\n`
108
- // Append after the existing patch list (or start fresh if it was just `[]`).
109
- const base = existing.trim() === '[]' ? '' : existing.replace(/\s*$/, '\n')
110
- writeFileSync(patchPath, `${base}${mount}`)
111
- console.log(` ✓ mounted ui-switchblade in ${patchPath}`)
122
+ void profileDir
112
123
  }
113
124
 
114
125
  function main() {
@@ -126,11 +137,11 @@ function main() {
126
137
  process.exit(1)
127
138
  }
128
139
 
129
- const profiles = findProfiles()
140
+ let profiles = findProfiles()
130
141
  if (profiles.length === 0) {
131
- console.error(` no dsh profiles found under ${profilesDir}`)
132
- console.error(' (start dsh once so the profile is created, then re-run this)')
133
- process.exit(1)
142
+ console.log(' no existing profiles creating a web profile…')
143
+ const created = ensureProfile()
144
+ profiles = [created]
134
145
  }
135
146
 
136
147
  for (const profileDir of profiles) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prompt-skill-armory",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "description": "One-command installer for Prompt-SkillArmory (prompts + skills manager) into a DeepSeek Harness web profile",
5
5
  "type": "module",
6
6
  "bin": {