@stage-labs/metro 0.1.0-beta.90 → 0.1.0-beta.91

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stage-labs/metro",
3
- "version": "0.1.0-beta.90",
3
+ "version": "0.1.0-beta.91",
4
4
  "description": "The metro command line. Sign in once per machine, then hand your MCP connector list to Claude Code without the credentials touching disk, argv or shell history.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -39,16 +39,31 @@ export function pluginServers(rows: LocalConnectorRow[], base: string): Record<s
39
39
  return out;
40
40
  }
41
41
 
42
+ const SEARCH_DEPTH = 5;
43
+
44
+ function pluginRootsUnder(dir: string, depth: number, out: string[]): void {
45
+ if (depth < 0 || out.length >= 8) return;
46
+ let entries;
47
+ try {
48
+ entries = readdirSync(dir, { withFileTypes: true });
49
+ } catch {
50
+ return;
51
+ }
52
+ if (entries.some((e) => e.name === 'bin' && e.isDirectory()) && existsSync(join(dir, MARKER))) {
53
+ out.push(dir);
54
+ return;
55
+ }
56
+ for (const entry of entries)
57
+ if (entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules')
58
+ pluginRootsUnder(join(dir, entry.name), depth - 1, out);
59
+ }
60
+
42
61
  export function installedPluginFiles(dir = claudeDir()): string[] {
43
- const root = join(dir, 'plugins', 'marketplaces');
62
+ const root = join(dir, 'plugins');
44
63
  if (!existsSync(root)) return [];
45
- const out: string[] = [];
46
- for (const entry of readdirSync(root, { withFileTypes: true })) {
47
- if (!entry.isDirectory()) continue;
48
- const plugin = join(root, entry.name, 'plugin');
49
- if (existsSync(join(plugin, MARKER))) out.push(join(plugin, FILE));
50
- }
51
- return out;
64
+ const roots: string[] = [];
65
+ pluginRootsUnder(root, SEARCH_DEPTH, roots);
66
+ return roots.map((found) => join(found, FILE));
52
67
  }
53
68
 
54
69
  const readOrNull = (path: string): string | null => {
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.1.0-beta.90"
2
+ "version": "0.1.0-beta.91"
3
3
  }