@orderful/droid 0.27.3 → 0.27.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @orderful/droid
2
2
 
3
+ ## 0.27.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c5bd82e`](https://github.com/Orderful/droid/commit/c5bd82e96202bd13fa71e57e45b5b2039ad95e6b) Thanks [@frytyler](https://github.com/frytyler)! - Add filesystem sync migration to fix untracked installations
8
+
9
+ **New migration (v0.27.4):**
10
+
11
+ Scans installed skills on the filesystem and adds any that aren't tracked in config. This is a one-time cleanup to fix inconsistencies from the v0.27.x migration series.
12
+
13
+ **What it does:**
14
+ - Scans `~/.claude/skills/` and `~/.config/opencode/skills/`
15
+ - Identifies installed skills missing from config
16
+ - Adds them with correct versions from bundled tool manifests
17
+ - Only processes known droid tool skills (ignores custom directories)
18
+
19
+ **Impact:**
20
+
21
+ Tools that were physically installed but not tracked (like `brain` and `comments`) will now show as properly installed with checkmarks in the TUI.
22
+
3
23
  ## 0.27.3
4
24
 
5
25
  ### Patch Changes
package/dist/bin/droid.js CHANGED
@@ -642,9 +642,60 @@ function createConfigSkillNameMigration(version2) {
642
642
  }
643
643
  };
644
644
  }
645
+ function createFilesystemSyncMigration(version2) {
646
+ return {
647
+ version: version2,
648
+ description: "Sync config with actually installed skills on filesystem",
649
+ up: () => {
650
+ const config = loadConfig();
651
+ const originalPlatform = config.platform;
652
+ let configChanged = false;
653
+ for (const platformKey of ["claude-code" /* ClaudeCode */, "opencode" /* OpenCode */]) {
654
+ if (!config.platforms[platformKey]) continue;
655
+ const skillsPath = getSkillsPath(platformKey);
656
+ if (!existsSync4(skillsPath)) continue;
657
+ config.platform = platformKey;
658
+ const trackedTools = getPlatformTools(config);
659
+ let platformChanged = false;
660
+ const bundledTools = getBundledTools();
661
+ const allToolNames = new Set(
662
+ bundledTools.flatMap(
663
+ (tool) => tool.includes.skills.map((s) => s.name)
664
+ )
665
+ );
666
+ const installedDirs = readdirSync3(skillsPath, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name);
667
+ for (const dirName of installedDirs) {
668
+ if (!allToolNames.has(dirName)) continue;
669
+ if (trackedTools[dirName]) continue;
670
+ let version3 = "0.0.0";
671
+ const matchingTool = bundledTools.find(
672
+ (tool) => tool.includes.skills.some((s) => s.name === dirName && s.required)
673
+ );
674
+ if (matchingTool) {
675
+ version3 = matchingTool.version;
676
+ }
677
+ trackedTools[dirName] = {
678
+ version: version3,
679
+ installed_at: (/* @__PURE__ */ new Date()).toISOString()
680
+ };
681
+ platformChanged = true;
682
+ configChanged = true;
683
+ }
684
+ if (platformChanged) {
685
+ setPlatformTools(config, trackedTools);
686
+ }
687
+ }
688
+ config.platform = originalPlatform;
689
+ if (configChanged) {
690
+ saveConfig(config);
691
+ }
692
+ }
693
+ };
694
+ }
645
695
  var PACKAGE_MIGRATIONS = [
646
696
  createPlatformSyncMigration("0.25.0"),
647
- createConfigSkillNameMigration("0.27.2")
697
+ createConfigSkillNameMigration("0.27.2"),
698
+ createFilesystemSyncMigration("0.27.4")
648
699
  ];
649
700
  var TOOL_MIGRATIONS = {
650
701
  brain: [createConfigDirMigration("droid-brain", "0.2.3")],
package/dist/index.js CHANGED
@@ -615,9 +615,60 @@ function createConfigSkillNameMigration(version) {
615
615
  }
616
616
  };
617
617
  }
618
+ function createFilesystemSyncMigration(version) {
619
+ return {
620
+ version,
621
+ description: "Sync config with actually installed skills on filesystem",
622
+ up: () => {
623
+ const config = loadConfig();
624
+ const originalPlatform = config.platform;
625
+ let configChanged = false;
626
+ for (const platformKey of ["claude-code" /* ClaudeCode */, "opencode" /* OpenCode */]) {
627
+ if (!config.platforms[platformKey]) continue;
628
+ const skillsPath = getSkillsPath(platformKey);
629
+ if (!existsSync4(skillsPath)) continue;
630
+ config.platform = platformKey;
631
+ const trackedTools = getPlatformTools(config);
632
+ let platformChanged = false;
633
+ const bundledTools = getBundledTools();
634
+ const allToolNames = new Set(
635
+ bundledTools.flatMap(
636
+ (tool) => tool.includes.skills.map((s) => s.name)
637
+ )
638
+ );
639
+ const installedDirs = readdirSync3(skillsPath, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name);
640
+ for (const dirName of installedDirs) {
641
+ if (!allToolNames.has(dirName)) continue;
642
+ if (trackedTools[dirName]) continue;
643
+ let version2 = "0.0.0";
644
+ const matchingTool = bundledTools.find(
645
+ (tool) => tool.includes.skills.some((s) => s.name === dirName && s.required)
646
+ );
647
+ if (matchingTool) {
648
+ version2 = matchingTool.version;
649
+ }
650
+ trackedTools[dirName] = {
651
+ version: version2,
652
+ installed_at: (/* @__PURE__ */ new Date()).toISOString()
653
+ };
654
+ platformChanged = true;
655
+ configChanged = true;
656
+ }
657
+ if (platformChanged) {
658
+ setPlatformTools(config, trackedTools);
659
+ }
660
+ }
661
+ config.platform = originalPlatform;
662
+ if (configChanged) {
663
+ saveConfig(config);
664
+ }
665
+ }
666
+ };
667
+ }
618
668
  var PACKAGE_MIGRATIONS = [
619
669
  createPlatformSyncMigration("0.25.0"),
620
- createConfigSkillNameMigration("0.27.2")
670
+ createConfigSkillNameMigration("0.27.2"),
671
+ createFilesystemSyncMigration("0.27.4")
621
672
  ];
622
673
  var TOOL_MIGRATIONS = {
623
674
  brain: [createConfigDirMigration("droid-brain", "0.2.3")],
@@ -1 +1 @@
1
- {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/lib/migrations.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,SAAS,CAAC;AAmOjB;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,CAE/D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAc/D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC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gBAAgB,EAAE,MAAM,GACvB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAStC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG;IAC5D,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAyDA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orderful/droid",
3
- "version": "0.27.3",
3
+ "version": "0.27.4",
4
4
  "description": "AI workflow toolkit for sharing skills, commands, and agents across the team",
5
5
  "type": "module",
6
6
  "bin": {
@@ -211,6 +211,80 @@ function createConfigSkillNameMigration(version: string): Migration {
211
211
  };
212
212
  }
213
213
 
214
+ /**
215
+ * Sync config with filesystem - add any installed skills that aren't tracked
216
+ * This is a one-time cleanup migration to fix config inconsistencies from v0.27.x
217
+ */
218
+ function createFilesystemSyncMigration(version: string): Migration {
219
+ return {
220
+ version,
221
+ description: 'Sync config with actually installed skills on filesystem',
222
+ up: () => {
223
+ const config = loadConfig();
224
+ const originalPlatform = config.platform;
225
+ let configChanged = false;
226
+
227
+ // Check both platforms
228
+ for (const platformKey of [Platform.ClaudeCode, Platform.OpenCode]) {
229
+ if (!config.platforms[platformKey]) continue;
230
+
231
+ const skillsPath = getSkillsPath(platformKey);
232
+ if (!existsSync(skillsPath)) continue;
233
+
234
+ config.platform = platformKey;
235
+ const trackedTools = getPlatformTools(config);
236
+ let platformChanged = false;
237
+
238
+ // Get all tool names from manifests
239
+ const bundledTools = getBundledTools();
240
+ const allToolNames = new Set(
241
+ bundledTools.flatMap((tool) =>
242
+ tool.includes.skills.map((s) => s.name),
243
+ ),
244
+ );
245
+
246
+ // Scan filesystem for installed skills
247
+ const installedDirs = readdirSync(skillsPath, { withFileTypes: true })
248
+ .filter((dirent) => dirent.isDirectory())
249
+ .map((dirent) => dirent.name);
250
+
251
+ for (const dirName of installedDirs) {
252
+ // Skip if not a known tool skill
253
+ if (!allToolNames.has(dirName)) continue;
254
+
255
+ // Skip if already tracked
256
+ if (trackedTools[dirName]) continue;
257
+
258
+ // Try to get version from bundled tool
259
+ let version = '0.0.0';
260
+ const matchingTool = bundledTools.find((tool) =>
261
+ tool.includes.skills.some((s) => s.name === dirName && s.required),
262
+ );
263
+ if (matchingTool) {
264
+ version = matchingTool.version;
265
+ }
266
+
267
+ trackedTools[dirName] = {
268
+ version,
269
+ installed_at: new Date().toISOString(),
270
+ };
271
+ platformChanged = true;
272
+ configChanged = true;
273
+ }
274
+
275
+ if (platformChanged) {
276
+ setPlatformTools(config, trackedTools);
277
+ }
278
+ }
279
+
280
+ config.platform = originalPlatform;
281
+ if (configChanged) {
282
+ saveConfig(config);
283
+ }
284
+ },
285
+ };
286
+ }
287
+
214
288
  /**
215
289
  * Registry of package-level migrations
216
290
  * These run when the @orderful/droid npm package updates
@@ -220,6 +294,7 @@ function createConfigSkillNameMigration(version: string): Migration {
220
294
  const PACKAGE_MIGRATIONS: Migration[] = [
221
295
  createPlatformSyncMigration('0.25.0'),
222
296
  createConfigSkillNameMigration('0.27.2'),
297
+ createFilesystemSyncMigration('0.27.4'),
223
298
  ];
224
299
 
225
300
  /**