agent-switchboard 0.1.29 → 0.2.1

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 (93) hide show
  1. package/README.md +94 -46
  2. package/dist/agents/codex.d.ts +0 -9
  3. package/dist/agents/codex.js +9 -3
  4. package/dist/agents/codex.js.map +1 -1
  5. package/dist/commands/distribution.js +1 -1
  6. package/dist/commands/distribution.js.map +1 -1
  7. package/dist/commands/inventory.js +1 -1
  8. package/dist/commands/inventory.js.map +1 -1
  9. package/dist/commands/library.d.ts +1 -1
  10. package/dist/commands/library.js +3 -3
  11. package/dist/commands/library.js.map +1 -1
  12. package/dist/config/application-config.d.ts +14 -3
  13. package/dist/config/application-config.js +61 -6
  14. package/dist/config/application-config.js.map +1 -1
  15. package/dist/config/mcp-config.d.ts +7 -0
  16. package/dist/config/mcp-config.js +25 -0
  17. package/dist/config/mcp-config.js.map +1 -1
  18. package/dist/config/schemas.d.ts +828 -273
  19. package/dist/config/schemas.js +62 -18
  20. package/dist/config/schemas.js.map +1 -1
  21. package/dist/hooks/distribution.js +3 -1
  22. package/dist/hooks/distribution.js.map +1 -1
  23. package/dist/hooks/library.d.ts +1 -1
  24. package/dist/hooks/library.js +3 -3
  25. package/dist/hooks/library.js.map +1 -1
  26. package/dist/index.js +323 -67
  27. package/dist/index.js.map +1 -1
  28. package/dist/library/distribute-bundle.d.ts +3 -0
  29. package/dist/library/distribute-bundle.js +4 -0
  30. package/dist/library/distribute-bundle.js.map +1 -1
  31. package/dist/library/distribute.d.ts +1 -0
  32. package/dist/library/distribute.js +2 -0
  33. package/dist/library/distribute.js.map +1 -1
  34. package/dist/library/sources.d.ts +3 -2
  35. package/dist/library/sources.js +16 -17
  36. package/dist/library/sources.js.map +1 -1
  37. package/dist/library/state.d.ts +6 -6
  38. package/dist/library/state.js +15 -15
  39. package/dist/library/state.js.map +1 -1
  40. package/dist/marketplace/plugin-loader.d.ts +3 -0
  41. package/dist/marketplace/plugin-loader.js +53 -2
  42. package/dist/marketplace/plugin-loader.js.map +1 -1
  43. package/dist/marketplace/reader.d.ts +22 -0
  44. package/dist/marketplace/reader.js +122 -17
  45. package/dist/marketplace/reader.js.map +1 -1
  46. package/dist/marketplace/schemas.d.ts +48 -12
  47. package/dist/marketplace/schemas.js +4 -1
  48. package/dist/marketplace/schemas.js.map +1 -1
  49. package/dist/marketplace/source-loader.d.ts +6 -6
  50. package/dist/marketplace/source-loader.js +8 -8
  51. package/dist/marketplace/source-loader.js.map +1 -1
  52. package/dist/plugins/index.d.ts +57 -0
  53. package/dist/plugins/index.js +304 -0
  54. package/dist/plugins/index.js.map +1 -0
  55. package/dist/rules/composer.js +4 -4
  56. package/dist/rules/composer.js.map +1 -1
  57. package/dist/rules/inventory.js +1 -1
  58. package/dist/rules/inventory.js.map +1 -1
  59. package/dist/rules/library.d.ts +1 -1
  60. package/dist/rules/library.js +19 -3
  61. package/dist/rules/library.js.map +1 -1
  62. package/dist/rules/schema.d.ts +3 -3
  63. package/dist/rules/schema.js +1 -1
  64. package/dist/rules/schema.js.map +1 -1
  65. package/dist/rules/state.js +12 -12
  66. package/dist/rules/state.js.map +1 -1
  67. package/dist/skills/distribution.js +11 -5
  68. package/dist/skills/distribution.js.map +1 -1
  69. package/dist/skills/inventory.js +1 -1
  70. package/dist/skills/inventory.js.map +1 -1
  71. package/dist/skills/library.d.ts +1 -1
  72. package/dist/skills/library.js +3 -3
  73. package/dist/skills/library.js.map +1 -1
  74. package/dist/subagents/distribution.js +4 -2
  75. package/dist/subagents/distribution.js.map +1 -1
  76. package/dist/subagents/inventory.js +1 -1
  77. package/dist/subagents/inventory.js.map +1 -1
  78. package/dist/subagents/library.d.ts +1 -1
  79. package/dist/subagents/library.js +3 -3
  80. package/dist/subagents/library.js.map +1 -1
  81. package/dist/ui/library-selector.d.ts +1 -1
  82. package/dist/ui/library-selector.js +7 -7
  83. package/dist/ui/library-selector.js.map +1 -1
  84. package/dist/ui/plugin-ui.d.ts +3 -0
  85. package/dist/ui/plugin-ui.js +77 -0
  86. package/dist/ui/plugin-ui.js.map +1 -0
  87. package/dist/ui/rule-ui.d.ts +1 -1
  88. package/dist/ui/rule-ui.js +4 -4
  89. package/dist/ui/rule-ui.js.map +1 -1
  90. package/dist/util/cli.d.ts +1 -0
  91. package/dist/util/cli.js +2 -1
  92. package/dist/util/cli.js.map +1 -1
  93. package/package.json +1 -1
@@ -48,7 +48,10 @@ export declare const pluginEntrySchema: z.ZodObject<{
48
48
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
49
49
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
50
50
  hooks: z.ZodOptional<z.ZodUnknown>;
51
- mcpServers: z.ZodOptional<z.ZodUnknown>;
51
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
52
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
53
+ ref: z.ZodOptional<z.ZodString>;
54
+ sha: z.ZodOptional<z.ZodString>;
52
55
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
53
56
  name: z.ZodString;
54
57
  source: z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -76,7 +79,10 @@ export declare const pluginEntrySchema: z.ZodObject<{
76
79
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
77
80
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
78
81
  hooks: z.ZodOptional<z.ZodUnknown>;
79
- mcpServers: z.ZodOptional<z.ZodUnknown>;
82
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
83
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
84
+ ref: z.ZodOptional<z.ZodString>;
85
+ sha: z.ZodOptional<z.ZodString>;
80
86
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
81
87
  name: z.ZodString;
82
88
  source: z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -104,7 +110,10 @@ export declare const pluginEntrySchema: z.ZodObject<{
104
110
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
105
111
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
106
112
  hooks: z.ZodOptional<z.ZodUnknown>;
107
- mcpServers: z.ZodOptional<z.ZodUnknown>;
113
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
114
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
115
+ ref: z.ZodOptional<z.ZodString>;
116
+ sha: z.ZodOptional<z.ZodString>;
108
117
  }, z.ZodTypeAny, "passthrough">>;
109
118
  export declare const marketplaceOwnerSchema: z.ZodObject<{
110
119
  name: z.ZodString;
@@ -169,7 +178,10 @@ export declare const marketplaceManifestSchema: z.ZodObject<{
169
178
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
170
179
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
171
180
  hooks: z.ZodOptional<z.ZodUnknown>;
172
- mcpServers: z.ZodOptional<z.ZodUnknown>;
181
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
182
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
183
+ ref: z.ZodOptional<z.ZodString>;
184
+ sha: z.ZodOptional<z.ZodString>;
173
185
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
174
186
  name: z.ZodString;
175
187
  source: z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -197,7 +209,10 @@ export declare const marketplaceManifestSchema: z.ZodObject<{
197
209
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
198
210
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
199
211
  hooks: z.ZodOptional<z.ZodUnknown>;
200
- mcpServers: z.ZodOptional<z.ZodUnknown>;
212
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
213
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
214
+ ref: z.ZodOptional<z.ZodString>;
215
+ sha: z.ZodOptional<z.ZodString>;
201
216
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
202
217
  name: z.ZodString;
203
218
  source: z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -225,7 +240,10 @@ export declare const marketplaceManifestSchema: z.ZodObject<{
225
240
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
226
241
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
227
242
  hooks: z.ZodOptional<z.ZodUnknown>;
228
- mcpServers: z.ZodOptional<z.ZodUnknown>;
243
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
244
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
245
+ ref: z.ZodOptional<z.ZodString>;
246
+ sha: z.ZodOptional<z.ZodString>;
229
247
  }, z.ZodTypeAny, "passthrough">>, "many">>;
230
248
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
231
249
  name: z.ZodString;
@@ -273,7 +291,10 @@ export declare const marketplaceManifestSchema: z.ZodObject<{
273
291
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
274
292
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
275
293
  hooks: z.ZodOptional<z.ZodUnknown>;
276
- mcpServers: z.ZodOptional<z.ZodUnknown>;
294
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
295
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
296
+ ref: z.ZodOptional<z.ZodString>;
297
+ sha: z.ZodOptional<z.ZodString>;
277
298
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
278
299
  name: z.ZodString;
279
300
  source: z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -301,7 +322,10 @@ export declare const marketplaceManifestSchema: z.ZodObject<{
301
322
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
302
323
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
303
324
  hooks: z.ZodOptional<z.ZodUnknown>;
304
- mcpServers: z.ZodOptional<z.ZodUnknown>;
325
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
326
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
327
+ ref: z.ZodOptional<z.ZodString>;
328
+ sha: z.ZodOptional<z.ZodString>;
305
329
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
306
330
  name: z.ZodString;
307
331
  source: z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -329,7 +353,10 @@ export declare const marketplaceManifestSchema: z.ZodObject<{
329
353
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
330
354
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
331
355
  hooks: z.ZodOptional<z.ZodUnknown>;
332
- mcpServers: z.ZodOptional<z.ZodUnknown>;
356
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
357
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
358
+ ref: z.ZodOptional<z.ZodString>;
359
+ sha: z.ZodOptional<z.ZodString>;
333
360
  }, z.ZodTypeAny, "passthrough">>, "many">>;
334
361
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
335
362
  name: z.ZodString;
@@ -377,7 +404,10 @@ export declare const marketplaceManifestSchema: z.ZodObject<{
377
404
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
378
405
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
379
406
  hooks: z.ZodOptional<z.ZodUnknown>;
380
- mcpServers: z.ZodOptional<z.ZodUnknown>;
407
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
408
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
409
+ ref: z.ZodOptional<z.ZodString>;
410
+ sha: z.ZodOptional<z.ZodString>;
381
411
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
382
412
  name: z.ZodString;
383
413
  source: z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -405,7 +435,10 @@ export declare const marketplaceManifestSchema: z.ZodObject<{
405
435
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
406
436
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
407
437
  hooks: z.ZodOptional<z.ZodUnknown>;
408
- mcpServers: z.ZodOptional<z.ZodUnknown>;
438
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
439
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
440
+ ref: z.ZodOptional<z.ZodString>;
441
+ sha: z.ZodOptional<z.ZodString>;
409
442
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
410
443
  name: z.ZodString;
411
444
  source: z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -433,7 +466,10 @@ export declare const marketplaceManifestSchema: z.ZodObject<{
433
466
  commands: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
434
467
  agents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
435
468
  hooks: z.ZodOptional<z.ZodUnknown>;
436
- mcpServers: z.ZodOptional<z.ZodUnknown>;
469
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
470
+ lspServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
471
+ ref: z.ZodOptional<z.ZodString>;
472
+ sha: z.ZodOptional<z.ZodString>;
437
473
  }, z.ZodTypeAny, "passthrough">>, "many">>;
438
474
  }, z.ZodTypeAny, "passthrough">>;
439
475
  export declare const pluginManifestSchema: z.ZodObject<{
@@ -21,7 +21,10 @@ export const pluginEntrySchema = z
21
21
  commands: z.union([z.string(), z.array(z.string())]).optional(),
22
22
  agents: z.union([z.string(), z.array(z.string())]).optional(),
23
23
  hooks: z.unknown().optional(),
24
- mcpServers: z.unknown().optional(),
24
+ mcpServers: z.record(z.unknown()).optional(),
25
+ lspServers: z.record(z.unknown()).optional(),
26
+ ref: z.string().optional(),
27
+ sha: z.string().optional(),
25
28
  })
26
29
  .passthrough();
27
30
  export const marketplaceOwnerSchema = z
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/marketplace/schemas.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,GAAG,EAAE,CAAC,C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M,oBAAoB,GAAG,CAAC;KAClC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/D,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7D,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC7B,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC;KACD,WAAW,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Marketplace-aware source loading. For each configured source, detects whether
3
- * it's a Claude Code marketplace or a flat library directory, and loads the
3
+ * it's a Claude Code marketplace or a standalone plugin directory, and loads the
4
4
  * appropriate components from each.
5
5
  */
6
6
  import type { CommandEntry } from '../commands/library.js';
@@ -14,17 +14,17 @@ export interface MarketplaceSourceEntries {
14
14
  hooks: HookEntry[];
15
15
  }
16
16
  /**
17
- * Load library entries from all configured sources, handling both flat directory
18
- * sources and marketplace sources transparently.
17
+ * Load library entries from all configured sources, handling both standalone
18
+ * plugin sources and marketplace sources transparently.
19
19
  *
20
- * For flat sources: returns `{ namespace, basePath, isMarketplace: false }` so the
21
- * caller can load from `basePath/<type>/`.
20
+ * For plugin sources: returns `{ namespace, basePath }` so the caller can load
21
+ * from `basePath/<type>/`.
22
22
  *
23
23
  * For marketplace sources: parses the marketplace, loads all plugin components,
24
24
  * and returns them directly.
25
25
  */
26
26
  export declare function loadEntriesFromSources(): {
27
- flatSources: Array<{
27
+ pluginSources: Array<{
28
28
  namespace: string;
29
29
  basePath: string;
30
30
  }>;
@@ -1,24 +1,24 @@
1
1
  /**
2
2
  * Marketplace-aware source loading. For each configured source, detects whether
3
- * it's a Claude Code marketplace or a flat library directory, and loads the
3
+ * it's a Claude Code marketplace or a standalone plugin directory, and loads the
4
4
  * appropriate components from each.
5
5
  */
6
6
  import { getSourcesRecord } from '../library/sources.js';
7
7
  import { loadPluginComponents } from './plugin-loader.js';
8
8
  import { isMarketplace, readMarketplace } from './reader.js';
9
9
  /**
10
- * Load library entries from all configured sources, handling both flat directory
11
- * sources and marketplace sources transparently.
10
+ * Load library entries from all configured sources, handling both standalone
11
+ * plugin sources and marketplace sources transparently.
12
12
  *
13
- * For flat sources: returns `{ namespace, basePath, isMarketplace: false }` so the
14
- * caller can load from `basePath/<type>/`.
13
+ * For plugin sources: returns `{ namespace, basePath }` so the caller can load
14
+ * from `basePath/<type>/`.
15
15
  *
16
16
  * For marketplace sources: parses the marketplace, loads all plugin components,
17
17
  * and returns them directly.
18
18
  */
19
19
  export function loadEntriesFromSources() {
20
20
  const sources = getSourcesRecord();
21
- const flatSources = [];
21
+ const pluginSources = [];
22
22
  const marketplaceEntries = {
23
23
  commands: [],
24
24
  agents: [],
@@ -37,9 +37,9 @@ export function loadEntriesFromSources() {
37
37
  }
38
38
  }
39
39
  else {
40
- flatSources.push({ namespace, basePath });
40
+ pluginSources.push({ namespace, basePath });
41
41
  }
42
42
  }
43
- return { flatSources, marketplaceEntries };
43
+ return { pluginSources, marketplaceEntries };
44
44
  }
45
45
  //# sourceMappingURL=source-loader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-loader.js","sourceRoot":"","sources":["../../src/marketplace/source-loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH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ACrD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Plugin index: discovers all plugins from configured sources and builds a
3
+ * lookup table mapping pluginId -> component IDs for each library type.
4
+ *
5
+ * Two kinds of sources are indexed:
6
+ * - **Marketplace sources**: contain `.claude-plugin/marketplace.json`.
7
+ * Each plugin entry in the manifest becomes a PluginDescriptor.
8
+ * - **Plugin sources**: everything else. May optionally have
9
+ * `.claude-plugin/plugin.json` for metadata; component directories
10
+ * (commands/, agents/, skills/, hooks/, rules/, .mcp.json) are scanned
11
+ * regardless.
12
+ */
13
+ import type { McpServer } from '../config/schemas.js';
14
+ import type { ConfigScope } from '../config/scope.js';
15
+ import type { RuleSnippet } from '../rules/library.js';
16
+ export type PluginComponentSection = 'commands' | 'agents' | 'skills' | 'hooks' | 'rules' | 'mcp';
17
+ export interface PluginComponents {
18
+ commands: string[];
19
+ agents: string[];
20
+ skills: string[];
21
+ hooks: string[];
22
+ rules: string[];
23
+ mcp: string[];
24
+ }
25
+ export interface PluginMeta {
26
+ description?: string;
27
+ version?: string;
28
+ owner?: string;
29
+ sourcePath: string;
30
+ sourceKind: 'marketplace' | 'plugin';
31
+ /** Namespace of the source this plugin came from (for @source disambiguation) */
32
+ sourceName: string;
33
+ }
34
+ export interface PluginDescriptor {
35
+ id: string;
36
+ meta: PluginMeta;
37
+ components: PluginComponents;
38
+ }
39
+ export interface PluginMcpServer {
40
+ pluginId: string;
41
+ serverId: string;
42
+ server: McpServer;
43
+ }
44
+ export interface PluginRuleSnippet extends RuleSnippet {
45
+ pluginId: string;
46
+ }
47
+ export interface PluginIndex {
48
+ plugins: PluginDescriptor[];
49
+ mcpServers: PluginMcpServer[];
50
+ ruleSnippets: PluginRuleSnippet[];
51
+ /** Look up a plugin by ID */
52
+ get(pluginId: string): PluginDescriptor | undefined;
53
+ /** Expand a list of plugin IDs into per-section component IDs */
54
+ expand(pluginIds: string[]): PluginComponents;
55
+ }
56
+ export declare function clearPluginIndexCache(): void;
57
+ export declare function buildPluginIndex(_scope?: ConfigScope): PluginIndex;
@@ -0,0 +1,304 @@
1
+ /**
2
+ * Plugin index: discovers all plugins from configured sources and builds a
3
+ * lookup table mapping pluginId -> component IDs for each library type.
4
+ *
5
+ * Two kinds of sources are indexed:
6
+ * - **Marketplace sources**: contain `.claude-plugin/marketplace.json`.
7
+ * Each plugin entry in the manifest becomes a PluginDescriptor.
8
+ * - **Plugin sources**: everything else. May optionally have
9
+ * `.claude-plugin/plugin.json` for metadata; component directories
10
+ * (commands/, agents/, skills/, hooks/, rules/, .mcp.json) are scanned
11
+ * regardless.
12
+ */
13
+ import fs from 'node:fs';
14
+ import path from 'node:path';
15
+ import { getSourcesRecord } from '../library/sources.js';
16
+ import { loadPluginComponents } from '../marketplace/plugin-loader.js';
17
+ import { isMarketplace, readMarketplace } from '../marketplace/reader.js';
18
+ import { parseRuleMarkdown } from '../rules/parser.js';
19
+ // ── Helpers ────────────────────────────────────────────────────────
20
+ function isMarkdownFile(name) {
21
+ const ext = path.extname(name).toLowerCase();
22
+ return ext === '.md' || ext === '.markdown';
23
+ }
24
+ function toId(fileName) {
25
+ return path.basename(fileName, path.extname(fileName));
26
+ }
27
+ function loadRulesFromPluginDir(pluginDir, namespace) {
28
+ const rulesDir = path.join(pluginDir, 'rules');
29
+ if (!fs.existsSync(rulesDir) || !fs.statSync(rulesDir).isDirectory()) {
30
+ return { ids: [], snippets: [], pluginId: namespace };
31
+ }
32
+ const ids = [];
33
+ const snippets = [];
34
+ const entries = fs.readdirSync(rulesDir, { withFileTypes: true });
35
+ for (const entry of entries) {
36
+ if (!entry.isFile() || !isMarkdownFile(entry.name))
37
+ continue;
38
+ const absolutePath = path.join(rulesDir, entry.name);
39
+ const rawContent = fs.readFileSync(absolutePath, 'utf-8');
40
+ try {
41
+ const parsed = parseRuleMarkdown(rawContent);
42
+ const bareId = toId(entry.name);
43
+ const id = `${namespace}:${bareId}`;
44
+ ids.push(id);
45
+ snippets.push({
46
+ id,
47
+ bareId,
48
+ namespace,
49
+ source: rulesDir,
50
+ filePath: absolutePath,
51
+ metadata: parsed.metadata,
52
+ content: parsed.content,
53
+ pluginId: namespace,
54
+ });
55
+ }
56
+ catch {
57
+ // Skip unparseable rule files
58
+ }
59
+ }
60
+ return { ids, snippets, pluginId: namespace };
61
+ }
62
+ function loadMcpFromPluginDir(pluginDir, namespace) {
63
+ const mcpJsonPath = path.join(pluginDir, '.mcp.json');
64
+ const ids = [];
65
+ const servers = [];
66
+ if (!fs.existsSync(mcpJsonPath))
67
+ return { ids, servers };
68
+ try {
69
+ const raw = JSON.parse(fs.readFileSync(mcpJsonPath, 'utf-8'));
70
+ const entries = typeof raw === 'object' && raw !== null ? raw : {};
71
+ for (const [name, serverDef] of Object.entries(entries)) {
72
+ if (typeof serverDef !== 'object' || serverDef === null)
73
+ continue;
74
+ const serverId = `${namespace}:${name}`;
75
+ ids.push(serverId);
76
+ servers.push({
77
+ pluginId: namespace,
78
+ serverId,
79
+ server: serverDef,
80
+ });
81
+ }
82
+ }
83
+ catch {
84
+ // Skip unparseable mcp.json
85
+ }
86
+ return { ids, servers };
87
+ }
88
+ function loadPluginComponentIds(basePath, namespace, type) {
89
+ const dir = path.join(basePath, type);
90
+ if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory())
91
+ return [];
92
+ const ids = [];
93
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
94
+ if (entry.isFile() && isMarkdownFile(entry.name)) {
95
+ ids.push(`${namespace}:${toId(entry.name)}`);
96
+ }
97
+ }
98
+ return ids;
99
+ }
100
+ function loadPluginSkillIds(basePath, namespace) {
101
+ const dir = path.join(basePath, 'skills');
102
+ if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory())
103
+ return [];
104
+ const ids = [];
105
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
106
+ if (entry.isDirectory() && fs.existsSync(path.join(dir, entry.name, 'SKILL.md'))) {
107
+ ids.push(`${namespace}:${entry.name}`);
108
+ }
109
+ }
110
+ return ids;
111
+ }
112
+ function loadPluginHookIds(basePath, namespace) {
113
+ const dir = path.join(basePath, 'hooks');
114
+ if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory())
115
+ return [];
116
+ const ids = [];
117
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
118
+ if (entry.isDirectory() && fs.existsSync(path.join(dir, entry.name, 'hook.json'))) {
119
+ ids.push(`${namespace}:${entry.name}`);
120
+ }
121
+ else if (entry.isFile() && path.extname(entry.name).toLowerCase() === '.json') {
122
+ ids.push(`${namespace}:${toId(entry.name)}`);
123
+ }
124
+ }
125
+ return ids;
126
+ }
127
+ function loadPluginRuleIds(basePath, namespace) {
128
+ const dir = path.join(basePath, 'rules');
129
+ if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory())
130
+ return [];
131
+ const ids = [];
132
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
133
+ if (entry.isFile() && isMarkdownFile(entry.name)) {
134
+ ids.push(`${namespace}:${toId(entry.name)}`);
135
+ }
136
+ }
137
+ return ids;
138
+ }
139
+ // ── Index builder ──────────────────────────────────────────────────
140
+ function buildFromMarketplace(sourceName, basePath, allPlugins, allMcpServers, allRuleSnippets) {
141
+ const result = readMarketplace(basePath);
142
+ for (const plugin of result.plugins) {
143
+ const components = loadPluginComponents(plugin);
144
+ const namespace = plugin.name;
145
+ const commandIds = components.commands.map((c) => c.id);
146
+ const agentIds = components.agents.map((a) => a.id);
147
+ const skillIds = components.skills.map((s) => s.id);
148
+ const hookIds = components.hooks.map((h) => h.id);
149
+ const rulesResult = loadRulesFromPluginDir(plugin.localPath, namespace);
150
+ const mcpResult = loadMcpFromPluginDir(plugin.localPath, namespace);
151
+ // Also pick up mcpServers declared in the marketplace entry / plugin.json
152
+ if (plugin.mcpServers) {
153
+ for (const [name, serverDef] of Object.entries(plugin.mcpServers)) {
154
+ if (typeof serverDef !== 'object' || serverDef === null)
155
+ continue;
156
+ const serverId = `${namespace}:${name}`;
157
+ if (!mcpResult.ids.includes(serverId)) {
158
+ mcpResult.ids.push(serverId);
159
+ mcpResult.servers.push({
160
+ pluginId: namespace,
161
+ serverId,
162
+ server: serverDef,
163
+ });
164
+ }
165
+ }
166
+ }
167
+ allMcpServers.push(...mcpResult.servers);
168
+ allRuleSnippets.push(...rulesResult.snippets);
169
+ allPlugins.push({
170
+ id: namespace,
171
+ meta: {
172
+ description: plugin.description,
173
+ version: plugin.version,
174
+ owner: result.owner.name,
175
+ sourcePath: plugin.localPath,
176
+ sourceKind: 'marketplace',
177
+ sourceName,
178
+ },
179
+ components: {
180
+ commands: commandIds,
181
+ agents: agentIds,
182
+ skills: skillIds,
183
+ hooks: hookIds,
184
+ rules: rulesResult.ids,
185
+ mcp: mcpResult.ids,
186
+ },
187
+ });
188
+ }
189
+ }
190
+ function buildFromPlugin(namespace, basePath, allPlugins, allMcpServers, allRuleSnippets) {
191
+ const commandIds = loadPluginComponentIds(basePath, namespace, 'commands');
192
+ const agentIds = loadPluginComponentIds(basePath, namespace, 'agents');
193
+ const skillIds = loadPluginSkillIds(basePath, namespace);
194
+ const hookIds = loadPluginHookIds(basePath, namespace);
195
+ const ruleIds = loadPluginRuleIds(basePath, namespace);
196
+ const mcpResult = loadMcpFromPluginDir(basePath, namespace);
197
+ allMcpServers.push(...mcpResult.servers);
198
+ const rulesResult = loadRulesFromPluginDir(basePath, namespace);
199
+ allRuleSnippets.push(...rulesResult.snippets);
200
+ const hasAny = commandIds.length > 0 ||
201
+ agentIds.length > 0 ||
202
+ skillIds.length > 0 ||
203
+ hookIds.length > 0 ||
204
+ ruleIds.length > 0 ||
205
+ mcpResult.ids.length > 0;
206
+ if (!hasAny)
207
+ return;
208
+ let description;
209
+ let version;
210
+ const manifestPath = path.join(basePath, '.claude-plugin', 'plugin.json');
211
+ if (fs.existsSync(manifestPath)) {
212
+ try {
213
+ const raw = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
214
+ description = raw.description;
215
+ version = raw.version;
216
+ }
217
+ catch {
218
+ // ignore unparseable manifest
219
+ }
220
+ }
221
+ allPlugins.push({
222
+ id: namespace,
223
+ meta: {
224
+ description,
225
+ version,
226
+ sourcePath: basePath,
227
+ sourceKind: 'plugin',
228
+ sourceName: namespace,
229
+ },
230
+ components: {
231
+ commands: commandIds,
232
+ agents: agentIds,
233
+ skills: skillIds,
234
+ hooks: hookIds,
235
+ rules: ruleIds,
236
+ mcp: mcpResult.ids,
237
+ },
238
+ });
239
+ }
240
+ // ── Public API ─────────────────────────────────────────────────────
241
+ let cachedIndex = null;
242
+ export function clearPluginIndexCache() {
243
+ cachedIndex = null;
244
+ }
245
+ export function buildPluginIndex(_scope) {
246
+ if (cachedIndex)
247
+ return cachedIndex;
248
+ const plugins = [];
249
+ const mcpServers = [];
250
+ const ruleSnippets = [];
251
+ const sources = getSourcesRecord();
252
+ for (const [namespace, basePath] of Object.entries(sources)) {
253
+ if (isMarketplace(basePath)) {
254
+ buildFromMarketplace(namespace, basePath, plugins, mcpServers, ruleSnippets);
255
+ }
256
+ else {
257
+ buildFromPlugin(namespace, basePath, plugins, mcpServers, ruleSnippets);
258
+ }
259
+ }
260
+ const byId = new Map(plugins.map((p) => [p.id, p]));
261
+ const index = {
262
+ plugins,
263
+ mcpServers,
264
+ ruleSnippets,
265
+ get(pluginId) {
266
+ // Direct match first
267
+ const direct = byId.get(pluginId);
268
+ if (direct)
269
+ return direct;
270
+ // Support `name@source` disambiguation syntax
271
+ const atIdx = pluginId.lastIndexOf('@');
272
+ if (atIdx > 0) {
273
+ const name = pluginId.slice(0, atIdx);
274
+ const source = pluginId.slice(atIdx + 1);
275
+ const candidate = byId.get(name);
276
+ if (candidate && candidate.meta.sourceName === source)
277
+ return candidate;
278
+ }
279
+ return undefined;
280
+ },
281
+ expand(pluginIds) {
282
+ const result = {
283
+ commands: [],
284
+ agents: [],
285
+ skills: [],
286
+ hooks: [],
287
+ rules: [],
288
+ mcp: [],
289
+ };
290
+ for (const pid of pluginIds) {
291
+ const descriptor = this.get(pid);
292
+ if (!descriptor)
293
+ continue;
294
+ for (const section of ['commands', 'agents', 'skills', 'hooks', 'rules', 'mcp']) {
295
+ result[section].push(...descriptor.components[section]);
296
+ }
297
+ }
298
+ return result;
299
+ },
300
+ };
301
+ cachedIndex = index;
302
+ return index;
303
+ }
304
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAiDvD,sEAAsE;AAEtE,SAAS,cAAc,CAAC,IAAY;IAClC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IAC7C,OAAO,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,WAAW,CAAC;AAC9C,CAAC;AAED,SAAS,IAAI,CAAC,QAAgB;IAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,sBAAsB,CAC7B,SAAiB,EACjB,SAAiB;IAEjB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI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