@cannbot-ai/install-helper 1.1.15 → 1.1.16

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/dist/index.js CHANGED
@@ -5191,6 +5191,10 @@ async function uninstallCommand(names, options) {
5191
5191
  skills.push(skill.id);
5192
5192
  continue;
5193
5193
  }
5194
+ if (isRecordedSkill(name)) {
5195
+ skills.push(name);
5196
+ continue;
5197
+ }
5194
5198
  if (readRecord(name)) {
5195
5199
  plugins.push(name);
5196
5200
  continue;
@@ -5200,6 +5204,19 @@ async function uninstallCommand(names, options) {
5200
5204
  await uninstallPlugins(plugins, options.yes || false);
5201
5205
  await uninstallSkillsByName(skills, tool, level);
5202
5206
  }
5207
+ function isRecordedSkill(skillId) {
5208
+ const record = readSkillRecord();
5209
+ for (const toolName of Object.keys(record)) {
5210
+ for (const levelName of Object.keys(record[toolName])) {
5211
+ for (const installPath of Object.keys(record[toolName][levelName])) {
5212
+ if (record[toolName][levelName][installPath].skills?.includes(skillId)) {
5213
+ return true;
5214
+ }
5215
+ }
5216
+ }
5217
+ }
5218
+ return false;
5219
+ }
5203
5220
  async function uninstallAll(tool, level, yes) {
5204
5221
  const installPath = level === "project" ? process.cwd() : getConfigRoot(tool, level);
5205
5222
  const installedSkills = getInstalledSkills(tool, level, installPath, !yes);