@vfarcic/dot-ai 1.0.3 → 1.1.0

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 (228) hide show
  1. package/README.md +1 -0
  2. package/dist/core/ai-provider.interface.d.ts +12 -8
  3. package/dist/core/ai-provider.interface.d.ts.map +1 -1
  4. package/dist/core/artifacthub.d.ts +1 -1
  5. package/dist/core/artifacthub.d.ts.map +1 -1
  6. package/dist/core/base-vector-service.d.ts +22 -9
  7. package/dist/core/base-vector-service.d.ts.map +1 -1
  8. package/dist/core/base-vector-service.js +106 -37
  9. package/dist/core/capabilities.d.ts.map +1 -1
  10. package/dist/core/capabilities.js +5 -2
  11. package/dist/core/capability-operations.d.ts +55 -7
  12. package/dist/core/capability-operations.d.ts.map +1 -1
  13. package/dist/core/capability-operations.js +1 -3
  14. package/dist/core/capability-scan-workflow.d.ts +64 -8
  15. package/dist/core/capability-scan-workflow.d.ts.map +1 -1
  16. package/dist/core/capability-scan-workflow.js +14 -13
  17. package/dist/core/capability-tools.d.ts +1 -1
  18. package/dist/core/capability-tools.d.ts.map +1 -1
  19. package/dist/core/capability-tools.js +1 -1
  20. package/dist/core/capability-vector-service.d.ts +3 -4
  21. package/dist/core/capability-vector-service.d.ts.map +1 -1
  22. package/dist/core/capability-vector-service.js +2 -2
  23. package/dist/core/command-executor.d.ts +3 -4
  24. package/dist/core/command-executor.d.ts.map +1 -1
  25. package/dist/core/command-executor.js +8 -4
  26. package/dist/core/crd-availability.d.ts +3 -5
  27. package/dist/core/crd-availability.d.ts.map +1 -1
  28. package/dist/core/crd-availability.js +8 -18
  29. package/dist/core/deploy-operation.d.ts +6 -5
  30. package/dist/core/deploy-operation.d.ts.map +1 -1
  31. package/dist/core/deploy-operation.js +16 -10
  32. package/dist/core/discovery.d.ts +6 -14
  33. package/dist/core/discovery.d.ts.map +1 -1
  34. package/dist/core/discovery.js +35 -51
  35. package/dist/core/embedding-service.d.ts.map +1 -1
  36. package/dist/core/embedding-service.js +1 -1
  37. package/dist/core/error-handling.d.ts +13 -13
  38. package/dist/core/error-handling.d.ts.map +1 -1
  39. package/dist/core/error-handling.js +2 -3
  40. package/dist/core/generic-session-manager.d.ts +2 -2
  41. package/dist/core/generic-session-manager.d.ts.map +1 -1
  42. package/dist/core/helm-types.d.ts +5 -5
  43. package/dist/core/helm-types.d.ts.map +1 -1
  44. package/dist/core/index.d.ts +4 -11
  45. package/dist/core/index.d.ts.map +1 -1
  46. package/dist/core/index.js +8 -14
  47. package/dist/core/knowledge-types.d.ts +114 -0
  48. package/dist/core/knowledge-types.d.ts.map +1 -0
  49. package/dist/core/knowledge-types.js +10 -0
  50. package/dist/core/memory.d.ts +12 -12
  51. package/dist/core/memory.d.ts.map +1 -1
  52. package/dist/core/mermaid-tools.d.ts +24 -1
  53. package/dist/core/mermaid-tools.d.ts.map +1 -1
  54. package/dist/core/mermaid-tools.js +10 -8
  55. package/dist/core/packaging.d.ts +23 -1
  56. package/dist/core/packaging.d.ts.map +1 -1
  57. package/dist/core/pattern-operations.d.ts +32 -9
  58. package/dist/core/pattern-operations.d.ts.map +1 -1
  59. package/dist/core/pattern-operations.js +17 -22
  60. package/dist/core/pattern-vector-service.d.ts +3 -4
  61. package/dist/core/pattern-vector-service.d.ts.map +1 -1
  62. package/dist/core/pattern-vector-service.js +2 -2
  63. package/dist/core/platform-utils.d.ts +2 -2
  64. package/dist/core/platform-utils.d.ts.map +1 -1
  65. package/dist/core/plugin-manager.d.ts +6 -2
  66. package/dist/core/plugin-manager.d.ts.map +1 -1
  67. package/dist/core/plugin-manager.js +9 -16
  68. package/dist/core/plugin-registry.d.ts +59 -0
  69. package/dist/core/plugin-registry.d.ts.map +1 -0
  70. package/dist/core/plugin-registry.js +80 -0
  71. package/dist/core/policy-operations.d.ts +101 -21
  72. package/dist/core/policy-operations.d.ts.map +1 -1
  73. package/dist/core/policy-operations.js +45 -47
  74. package/dist/core/policy-vector-service.d.ts +3 -4
  75. package/dist/core/policy-vector-service.d.ts.map +1 -1
  76. package/dist/core/policy-vector-service.js +2 -2
  77. package/dist/core/providers/host-provider.d.ts +1 -1
  78. package/dist/core/providers/host-provider.d.ts.map +1 -1
  79. package/dist/core/providers/host-provider.js +2 -2
  80. package/dist/core/providers/provider-debug-utils.d.ts +2 -2
  81. package/dist/core/providers/provider-debug-utils.d.ts.map +1 -1
  82. package/dist/core/providers/tool-utils.d.ts +10 -2
  83. package/dist/core/providers/tool-utils.d.ts.map +1 -1
  84. package/dist/core/providers/tool-utils.js +2 -2
  85. package/dist/core/providers/vercel-provider.d.ts.map +1 -1
  86. package/dist/core/providers/vercel-provider.js +29 -23
  87. package/dist/core/resource-tools.d.ts +29 -1
  88. package/dist/core/resource-tools.d.ts.map +1 -1
  89. package/dist/core/resource-vector-service.d.ts +3 -4
  90. package/dist/core/resource-vector-service.d.ts.map +1 -1
  91. package/dist/core/resource-vector-service.js +2 -2
  92. package/dist/core/schema.d.ts +15 -14
  93. package/dist/core/schema.d.ts.map +1 -1
  94. package/dist/core/schema.js +32 -34
  95. package/dist/core/shared-prompt-loader.d.ts +1 -1
  96. package/dist/core/shared-prompt-loader.d.ts.map +1 -1
  97. package/dist/core/solution-cr.js +1 -1
  98. package/dist/core/solution-utils.d.ts +22 -3
  99. package/dist/core/solution-utils.d.ts.map +1 -1
  100. package/dist/core/solution-utils.js +1 -1
  101. package/dist/core/telemetry/client.d.ts +0 -6
  102. package/dist/core/telemetry/client.d.ts.map +1 -1
  103. package/dist/core/telemetry/client.js +6 -17
  104. package/dist/core/telemetry/config.js +1 -1
  105. package/dist/core/telemetry/index.d.ts +1 -1
  106. package/dist/core/telemetry/index.d.ts.map +1 -1
  107. package/dist/core/telemetry/index.js +1 -2
  108. package/dist/core/tracing/tool-tracing.d.ts +1 -1
  109. package/dist/core/tracing/tool-tracing.d.ts.map +1 -1
  110. package/dist/core/unified-creation-session.d.ts +15 -8
  111. package/dist/core/unified-creation-session.d.ts.map +1 -1
  112. package/dist/core/unified-creation-session.js +19 -19
  113. package/dist/core/unified-creation-types.d.ts +2 -2
  114. package/dist/core/unified-creation-types.d.ts.map +1 -1
  115. package/dist/core/visualization.d.ts +1 -1
  116. package/dist/core/visualization.d.ts.map +1 -1
  117. package/dist/core/workflow.d.ts +8 -5
  118. package/dist/core/workflow.d.ts.map +1 -1
  119. package/dist/evaluation/dataset-analyzer.d.ts +13 -7
  120. package/dist/evaluation/dataset-analyzer.d.ts.map +1 -1
  121. package/dist/evaluation/dataset-analyzer.js +1 -1
  122. package/dist/evaluation/datasets/loader.d.ts +2 -2
  123. package/dist/evaluation/datasets/loader.d.ts.map +1 -1
  124. package/dist/evaluation/eval-runner.js +7 -5
  125. package/dist/evaluation/evaluators/base-comparative.d.ts +1 -1
  126. package/dist/evaluation/evaluators/base-comparative.d.ts.map +1 -1
  127. package/dist/evaluation/evaluators/base-comparative.js +4 -3
  128. package/dist/evaluation/evaluators/base.d.ts +5 -5
  129. package/dist/evaluation/evaluators/base.d.ts.map +1 -1
  130. package/dist/evaluation/evaluators/capability-comparative.js +1 -1
  131. package/dist/evaluation/platform-synthesizer.d.ts.map +1 -1
  132. package/dist/interfaces/mcp.d.ts.map +1 -1
  133. package/dist/interfaces/mcp.js +26 -15
  134. package/dist/interfaces/openapi-generator.d.ts +116 -12
  135. package/dist/interfaces/openapi-generator.d.ts.map +1 -1
  136. package/dist/interfaces/openapi-generator.js +490 -199
  137. package/dist/interfaces/rest-api.d.ts +28 -6
  138. package/dist/interfaces/rest-api.d.ts.map +1 -1
  139. package/dist/interfaces/rest-api.js +436 -245
  140. package/dist/interfaces/rest-registry.d.ts +4 -4
  141. package/dist/interfaces/rest-registry.d.ts.map +1 -1
  142. package/dist/interfaces/rest-registry.js +6 -5
  143. package/dist/interfaces/rest-route-registry.d.ts +165 -0
  144. package/dist/interfaces/rest-route-registry.d.ts.map +1 -0
  145. package/dist/interfaces/rest-route-registry.js +230 -0
  146. package/dist/interfaces/routes/index.d.ts +22 -0
  147. package/dist/interfaces/routes/index.d.ts.map +1 -0
  148. package/dist/interfaces/routes/index.js +347 -0
  149. package/dist/interfaces/schemas/common.d.ts +177 -0
  150. package/dist/interfaces/schemas/common.d.ts.map +1 -0
  151. package/dist/interfaces/schemas/common.js +102 -0
  152. package/dist/interfaces/schemas/events.d.ts +131 -0
  153. package/dist/interfaces/schemas/events.d.ts.map +1 -0
  154. package/dist/interfaces/schemas/events.js +66 -0
  155. package/dist/interfaces/schemas/index.d.ts +21 -0
  156. package/dist/interfaces/schemas/index.d.ts.map +1 -0
  157. package/dist/interfaces/schemas/index.js +138 -0
  158. package/dist/interfaces/schemas/knowledge.d.ts +210 -0
  159. package/dist/interfaces/schemas/knowledge.d.ts.map +1 -0
  160. package/dist/interfaces/schemas/knowledge.js +117 -0
  161. package/dist/interfaces/schemas/logs.d.ts +82 -0
  162. package/dist/interfaces/schemas/logs.d.ts.map +1 -0
  163. package/dist/interfaces/schemas/logs.js +46 -0
  164. package/dist/interfaces/schemas/prompts.d.ts +191 -0
  165. package/dist/interfaces/schemas/prompts.d.ts.map +1 -0
  166. package/dist/interfaces/schemas/prompts.js +91 -0
  167. package/dist/interfaces/schemas/resources.d.ts +378 -0
  168. package/dist/interfaces/schemas/resources.d.ts.map +1 -0
  169. package/dist/interfaces/schemas/resources.js +173 -0
  170. package/dist/interfaces/schemas/sessions.d.ts +90 -0
  171. package/dist/interfaces/schemas/sessions.d.ts.map +1 -0
  172. package/dist/interfaces/schemas/sessions.js +56 -0
  173. package/dist/interfaces/schemas/tools.d.ts +194 -0
  174. package/dist/interfaces/schemas/tools.d.ts.map +1 -0
  175. package/dist/interfaces/schemas/tools.js +101 -0
  176. package/dist/interfaces/schemas/visualization.d.ts +373 -0
  177. package/dist/interfaces/schemas/visualization.d.ts.map +1 -0
  178. package/dist/interfaces/schemas/visualization.js +134 -0
  179. package/dist/mcp/server.js +5 -4
  180. package/dist/tools/answer-question.d.ts +1 -1
  181. package/dist/tools/answer-question.d.ts.map +1 -1
  182. package/dist/tools/answer-question.js +9 -8
  183. package/dist/tools/deploy-manifests.d.ts +4 -2
  184. package/dist/tools/deploy-manifests.d.ts.map +1 -1
  185. package/dist/tools/deploy-manifests.js +10 -6
  186. package/dist/tools/generate-manifests.d.ts.map +1 -1
  187. package/dist/tools/generate-manifests.js +28 -20
  188. package/dist/tools/index.d.ts +1 -0
  189. package/dist/tools/index.d.ts.map +1 -1
  190. package/dist/tools/index.js +6 -1
  191. package/dist/tools/manage-knowledge.d.ts +77 -0
  192. package/dist/tools/manage-knowledge.d.ts.map +1 -0
  193. package/dist/tools/manage-knowledge.js +573 -0
  194. package/dist/tools/operate-analysis.d.ts +31 -2
  195. package/dist/tools/operate-analysis.d.ts.map +1 -1
  196. package/dist/tools/operate-execution.d.ts +2 -3
  197. package/dist/tools/operate-execution.d.ts.map +1 -1
  198. package/dist/tools/operate-execution.js +7 -7
  199. package/dist/tools/operate.d.ts +7 -2
  200. package/dist/tools/operate.d.ts.map +1 -1
  201. package/dist/tools/operate.js +2 -2
  202. package/dist/tools/organizational-data.d.ts +30 -4
  203. package/dist/tools/organizational-data.d.ts.map +1 -1
  204. package/dist/tools/organizational-data.js +24 -19
  205. package/dist/tools/project-setup/discovery.d.ts.map +1 -1
  206. package/dist/tools/project-setup/generate-scope.d.ts +1 -1
  207. package/dist/tools/project-setup/generate-scope.d.ts.map +1 -1
  208. package/dist/tools/project-setup/types.d.ts +1 -0
  209. package/dist/tools/project-setup/types.d.ts.map +1 -1
  210. package/dist/tools/prompts.d.ts +28 -2
  211. package/dist/tools/prompts.d.ts.map +1 -1
  212. package/dist/tools/query.d.ts +17 -3
  213. package/dist/tools/query.d.ts.map +1 -1
  214. package/dist/tools/query.js +1 -7
  215. package/dist/tools/recommend.d.ts +24 -6
  216. package/dist/tools/recommend.d.ts.map +1 -1
  217. package/dist/tools/recommend.js +18 -15
  218. package/dist/tools/remediate.d.ts +12 -3
  219. package/dist/tools/remediate.d.ts.map +1 -1
  220. package/dist/tools/remediate.js +22 -14
  221. package/dist/tools/version.d.ts +19 -5
  222. package/dist/tools/version.d.ts.map +1 -1
  223. package/dist/tools/version.js +106 -54
  224. package/package.json +11 -5
  225. package/prompts/knowledge-ask.md +29 -0
  226. package/dist/core/vector-db-service.d.ts +0 -108
  227. package/dist/core/vector-db-service.d.ts.map +0 -1
  228. package/dist/core/vector-db-service.js +0 -647
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-manager.d.ts","sourceRoot":"","sources":["../../src/core/plugin-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EACL,YAAY,EAEZ,gBAAgB,EAChB,cAAc,EACf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAW/D;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAE1E;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;aAG3B,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;gBADrE,OAAO,EAAE,MAAM,EACC,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAKxE;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwC;IAChE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA4C;IAC9E,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkC;IAE/D,2CAA2C;IAC3C,OAAO,CAAC,cAAc,CAAsB;IAE5C,6BAA6B;IAC7B,OAAO,CAAC,oBAAoB,CAA8C;IAE1E,oCAAoC;I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GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACnC,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,CAAC;IAiB1B;;;;;;;;;OASG;IACH,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,YAAY,GAAG,YAAY;IAuDjE;;OAEG;IACH,wBAAwB,IAAI,MAAM,EAAE;IAIpC;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAI/D;;OAEG;IACH,uBAAuB,IAAI,gBAAgB,EAAE;IAI7C;;OAEG;IACH,QAAQ,IAAI;QACV,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACrE,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC3B,yBAAyB,EAAE,OAAO,CAAC;KACpC;IAgBD;;OAEG;IACH,OAAO,CAAC,eAAe;CAOxB"}
@@ -362,21 +362,13 @@ class PluginManager {
362
362
  return this.toolToPlugin.get(toolName);
363
363
  }
364
364
  /**
365
- * Invoke a tool on its plugin
365
+ * Invoke a tool on a specific plugin (explicit routing)
366
+ *
367
+ * PRD #359: Unified plugin invocation with explicit plugin specification.
368
+ * Use this when you know which plugin provides the tool, avoiding
369
+ * ambiguity when multiple plugins might have tools with the same name.
366
370
  */
367
- async invokeTool(toolName, args, state = {}, sessionId) {
368
- const pluginName = this.toolToPlugin.get(toolName);
369
- if (!pluginName) {
370
- return {
371
- sessionId: sessionId || '',
372
- success: false,
373
- error: {
374
- code: 'TOOL_NOT_FOUND',
375
- message: `Tool '${toolName}' not found in any plugin`,
376
- },
377
- state,
378
- };
379
- }
371
+ async invokeToolOnPlugin(pluginName, toolName, args, state = {}, sessionId) {
380
372
  const client = this.plugins.get(pluginName);
381
373
  if (!client) {
382
374
  return {
@@ -410,7 +402,8 @@ class PluginManager {
410
402
  plugin: this.getToolPlugin(toolName),
411
403
  });
412
404
  try {
413
- const response = await this.invokeTool(toolName, input);
405
+ const pluginName = this.getToolPlugin(toolName);
406
+ const response = await this.invokeToolOnPlugin(pluginName, toolName, input);
414
407
  if (response.success) {
415
408
  // PRD #343: Return only the data field to AI, not the full JSON wrapper
416
409
  // This saves tokens and provides cleaner output matching raw command output
@@ -433,7 +426,7 @@ class PluginManager {
433
426
  catch (err) {
434
427
  // Catch invoke exceptions to prevent tool-loop crashes
435
428
  const message = err instanceof Error ? err.message : String(err);
436
- this.logger.error('Plugin invokeTool failed with exception', new Error(message), {
429
+ this.logger.error('Plugin invokeToolOnPlugin failed with exception', new Error(message), {
437
430
  tool: toolName,
438
431
  plugin: this.getToolPlugin(toolName),
439
432
  });
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Plugin Registry - Unified Plugin Tool Invocation
3
+ *
4
+ * PRD #359: Provides a single, consistent way to invoke plugin tools from anywhere
5
+ * in the codebase. Replaces scattered plugin manager passing and module-level setters.
6
+ *
7
+ * Usage:
8
+ * // At startup (src/mcp/server.ts):
9
+ * initializePluginRegistry(pluginManager);
10
+ *
11
+ * // Anywhere in the codebase:
12
+ * const response = await invokePluginTool('agentic-tools', 'vector_search', { ... });
13
+ */
14
+ import type { PluginManager } from './plugin-manager';
15
+ import type { InvokeResponse } from './plugin-types';
16
+ /**
17
+ * Initialize the plugin registry with a PluginManager instance.
18
+ * Must be called once at startup before any plugin tool invocations.
19
+ */
20
+ export declare function initializePluginRegistry(pm: PluginManager): void;
21
+ /**
22
+ * Get the PluginManager instance.
23
+ * Returns null if not initialized.
24
+ */
25
+ export declare function getPluginManager(): PluginManager | null;
26
+ /**
27
+ * Check if the plugin registry is initialized.
28
+ */
29
+ export declare function isPluginInitialized(): boolean;
30
+ /**
31
+ * Invoke a tool on a specific plugin.
32
+ *
33
+ * @param plugin - The plugin name (e.g., 'agentic-tools')
34
+ * @param tool - The tool name (e.g., 'vector_search', 'kubectl_get_resource_json')
35
+ * @param args - Tool arguments
36
+ * @returns InvokeResponse with success/error status and result
37
+ * @throws Error if plugin registry is not initialized
38
+ *
39
+ * @example
40
+ * // Invoke a vector tool
41
+ * const response = await invokePluginTool('agentic-tools', 'vector_search', {
42
+ * collection: 'capabilities',
43
+ * embedding: [...],
44
+ * limit: 10
45
+ * });
46
+ *
47
+ * // Invoke a kubectl tool
48
+ * const response = await invokePluginTool('agentic-tools', 'kubectl_get_resource_json', {
49
+ * resource: 'namespace/kube-system',
50
+ * field: 'metadata'
51
+ * });
52
+ */
53
+ export declare function invokePluginTool(plugin: string, tool: string, args: Record<string, unknown>): Promise<InvokeResponse>;
54
+ /**
55
+ * Reset the plugin registry (for testing only).
56
+ * @internal
57
+ */
58
+ export declare function resetPluginRegistry(): void;
59
+ //# sourceMappingURL=plugin-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-registry.d.ts","sourceRoot":"","sources":["../../src/core/plugin-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAOrD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,aAAa,GAAG,IAAI,CAEhE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,IAAI,CAEvD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CAKzB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ /**
3
+ * Plugin Registry - Unified Plugin Tool Invocation
4
+ *
5
+ * PRD #359: Provides a single, consistent way to invoke plugin tools from anywhere
6
+ * in the codebase. Replaces scattered plugin manager passing and module-level setters.
7
+ *
8
+ * Usage:
9
+ * // At startup (src/mcp/server.ts):
10
+ * initializePluginRegistry(pluginManager);
11
+ *
12
+ * // Anywhere in the codebase:
13
+ * const response = await invokePluginTool('agentic-tools', 'vector_search', { ... });
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.initializePluginRegistry = initializePluginRegistry;
17
+ exports.getPluginManager = getPluginManager;
18
+ exports.isPluginInitialized = isPluginInitialized;
19
+ exports.invokePluginTool = invokePluginTool;
20
+ exports.resetPluginRegistry = resetPluginRegistry;
21
+ /**
22
+ * Global plugin manager instance (set once at startup)
23
+ */
24
+ let pluginManager = null;
25
+ /**
26
+ * Initialize the plugin registry with a PluginManager instance.
27
+ * Must be called once at startup before any plugin tool invocations.
28
+ */
29
+ function initializePluginRegistry(pm) {
30
+ pluginManager = pm;
31
+ }
32
+ /**
33
+ * Get the PluginManager instance.
34
+ * Returns null if not initialized.
35
+ */
36
+ function getPluginManager() {
37
+ return pluginManager;
38
+ }
39
+ /**
40
+ * Check if the plugin registry is initialized.
41
+ */
42
+ function isPluginInitialized() {
43
+ return pluginManager !== null;
44
+ }
45
+ /**
46
+ * Invoke a tool on a specific plugin.
47
+ *
48
+ * @param plugin - The plugin name (e.g., 'agentic-tools')
49
+ * @param tool - The tool name (e.g., 'vector_search', 'kubectl_get_resource_json')
50
+ * @param args - Tool arguments
51
+ * @returns InvokeResponse with success/error status and result
52
+ * @throws Error if plugin registry is not initialized
53
+ *
54
+ * @example
55
+ * // Invoke a vector tool
56
+ * const response = await invokePluginTool('agentic-tools', 'vector_search', {
57
+ * collection: 'capabilities',
58
+ * embedding: [...],
59
+ * limit: 10
60
+ * });
61
+ *
62
+ * // Invoke a kubectl tool
63
+ * const response = await invokePluginTool('agentic-tools', 'kubectl_get_resource_json', {
64
+ * resource: 'namespace/kube-system',
65
+ * field: 'metadata'
66
+ * });
67
+ */
68
+ async function invokePluginTool(plugin, tool, args) {
69
+ if (!pluginManager) {
70
+ throw new Error('Plugin registry not initialized. Call initializePluginRegistry() at startup.');
71
+ }
72
+ return pluginManager.invokeToolOnPlugin(plugin, tool, args);
73
+ }
74
+ /**
75
+ * Reset the plugin registry (for testing only).
76
+ * @internal
77
+ */
78
+ function resetPluginRegistry() {
79
+ pluginManager = null;
80
+ }
@@ -6,51 +6,131 @@
6
6
  */
7
7
  import { Logger } from './error-handling';
8
8
  import { PolicyVectorService } from './policy-vector-service';
9
- import type { PluginManager } from './plugin-manager';
9
+ /**
10
+ * Kyverno policy metadata
11
+ */
12
+ interface KyvernoPolicyInfo {
13
+ name: string;
14
+ labels?: Record<string, string>;
15
+ creationTimestamp?: string;
16
+ }
17
+ /**
18
+ * Kyverno delete result
19
+ */
20
+ interface KyvernoDeleteResult {
21
+ successful: Array<{
22
+ policyId?: string;
23
+ deletedAt: string;
24
+ }>;
25
+ failed: Array<{
26
+ policyId?: string;
27
+ error: string;
28
+ }>;
29
+ total: number;
30
+ }
31
+ /**
32
+ * Policy operation result
33
+ */
34
+ interface PolicyOperationResult {
35
+ success: boolean;
36
+ operation?: string;
37
+ dataType?: string;
38
+ message?: string;
39
+ error?: string;
40
+ data?: unknown;
41
+ deletedKyvernoPolicies?: KyvernoDeleteResult;
42
+ requiresConfirmation?: boolean;
43
+ confirmationMessage?: string;
44
+ confirmation?: string | {
45
+ question: string;
46
+ options: string[];
47
+ };
48
+ note?: string;
49
+ deletedPolicyIntent?: {
50
+ id: string;
51
+ description: string;
52
+ };
53
+ deletedPolicyIntents?: unknown[];
54
+ deletedCount?: number;
55
+ workflow?: unknown;
56
+ storage?: unknown;
57
+ policyIntents?: unknown[];
58
+ policyIntent?: unknown;
59
+ totalCount?: number;
60
+ searchResults?: unknown[];
61
+ kyvernoCleanup?: unknown;
62
+ kyvernoPolicies?: unknown;
63
+ }
64
+ /**
65
+ * Policy delete arguments
66
+ */
67
+ interface PolicyDeleteArgs {
68
+ operation?: string;
69
+ dataType?: string;
70
+ id?: string;
71
+ response?: string;
72
+ }
73
+ /**
74
+ * Policy operation arguments
75
+ */
76
+ interface PolicyOperationArgs {
77
+ sessionId?: string;
78
+ response?: string;
79
+ id?: string;
80
+ limit?: number;
81
+ step?: string;
82
+ [key: string]: unknown;
83
+ }
84
+ /**
85
+ * Validation result from connection checks
86
+ */
87
+ interface ValidationCheckResult {
88
+ success: boolean;
89
+ error?: string;
90
+ }
10
91
  /**
11
92
  * Get initialized policy service
12
93
  */
13
94
  export declare function getPolicyService(): Promise<PolicyVectorService>;
14
95
  /**
15
96
  * Find Kyverno policies by policy intent ID using label selector
16
- * PRD #343: pluginManager required for kubectl operations
97
+ * PRD #359: Uses unified plugin registry
17
98
  */
18
- export declare function findKyvernoPoliciesByPolicyId(policyId: string, logger: Logger, requestId: string, pluginManager: PluginManager): Promise<any[]>;
99
+ export declare function findKyvernoPoliciesByPolicyId(policyId: string, logger: Logger, requestId: string): Promise<KyvernoPolicyInfo[]>;
19
100
  /**
20
101
  * Find all Kyverno policies that have policy-intent/id labels
21
- * PRD #343: pluginManager required for kubectl operations
102
+ * PRD #359: Uses unified plugin registry
22
103
  */
23
- export declare function findAllKyvernoPoliciesForPolicyIntents(logger: Logger, requestId: string, pluginManager: PluginManager): Promise<any[]>;
104
+ export declare function findAllKyvernoPoliciesForPolicyIntents(logger: Logger, requestId: string): Promise<Array<KyvernoPolicyInfo & {
105
+ policyId?: string;
106
+ }>>;
24
107
  /**
25
108
  * Delete Kyverno policies by policy intent ID using label selector
26
- * PRD #343: pluginManager required for kubectl operations
109
+ * PRD #359: Uses unified plugin registry
27
110
  */
28
- export declare function deleteKyvernoPoliciesByPolicyId(policyId: string, logger: Logger, requestId: string, pluginManager: PluginManager): Promise<any>;
111
+ export declare function deleteKyvernoPoliciesByPolicyId(policyId: string, logger: Logger, requestId: string): Promise<KyvernoDeleteResult>;
29
112
  /**
30
113
  * Delete all Kyverno policies that have policy-intent/id labels
31
- * PRD #343: pluginManager required for kubectl operations
114
+ * PRD #359: Uses unified plugin registry
32
115
  */
33
- export declare function deleteAllKyvernoPoliciesForPolicyIntents(logger: Logger, requestId: string, pluginManager: PluginManager): Promise<any>;
116
+ export declare function deleteAllKyvernoPoliciesForPolicyIntents(logger: Logger, requestId: string): Promise<KyvernoDeleteResult>;
34
117
  /**
35
118
  * Handle individual policy delete with Kyverno cleanup
36
- * PRD #343: pluginManager required for kubectl operations
119
+ * PRD #359: Uses unified plugin registry
37
120
  */
38
- export declare function handlePolicyDelete(policyId: string, policyService: any, args: any, logger: Logger, requestId: string, pluginManager: PluginManager): Promise<any>;
121
+ export declare function handlePolicyDelete(policyId: string, policyService: PolicyVectorService, args: PolicyDeleteArgs, logger: Logger, requestId: string): Promise<PolicyOperationResult>;
39
122
  /**
40
123
  * Handle deleteAll policies with batch Kyverno cleanup
41
- * PRD #343: pluginManager required for kubectl operations
124
+ * PRD #359: Uses unified plugin registry
42
125
  */
43
- export declare function handlePolicyDeleteAll(policyService: any, args: any, logger: Logger, pluginManager: PluginManager, requestId: string): Promise<any>;
126
+ export declare function handlePolicyDeleteAll(policyService: PolicyVectorService, args: PolicyDeleteArgs & {
127
+ response?: string;
128
+ }, logger: Logger, requestId: string): Promise<PolicyOperationResult>;
44
129
  /**
45
130
  * Main policy operations handler - delegates to specific operation functions
46
131
  * Requires shared validation utilities to be passed as parameters to avoid circular imports
47
- * PRD #343: pluginManager required for kubectl operations via plugin system
132
+ * PRD #359: Uses unified plugin registry for kubectl operations
48
133
  */
49
- export declare function handlePolicyOperation(operation: string, args: any, logger: Logger, requestId: string, validateVectorDBConnection: (vectorService: PolicyVectorService, logger: Logger, requestId: string) => Promise<{
50
- success: boolean;
51
- error?: any;
52
- }>, validateEmbeddingService: (logger: Logger, requestId: string) => Promise<{
53
- success: boolean;
54
- error?: any;
55
- }>, pluginManager?: PluginManager): Promise<any>;
134
+ export declare function handlePolicyOperation(operation: string, args: PolicyOperationArgs, logger: Logger, requestId: string, validateVectorDBConnection: (vectorService: PolicyVectorService, logger: Logger, requestId: string) => Promise<ValidationCheckResult>, validateEmbeddingService: (logger: Logger, requestId: string) => Promise<ValidationCheckResult>): Promise<PolicyOperationResult>;
135
+ export {};
56
136
  //# sourceMappingURL=policy-operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"policy-operations.d.ts","sourceRoot":"","sources":["../../src/core/policy-operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA8C,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAarE;AA+BD;;;GAGG;AACH,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,GAAG,EAAE,CAAC,CAiChB;AAED;;;GAGG;AACH,wBAAsB,sCAAsC,CAC1D,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,GAAG,EAAE,CAAC,CA+BhB;AAED;;;GAGG;AACH,wBAAsB,+BAA+B,CACnD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,GAAG,CAAC,CAkCd;AAED;;;GAGG;AACH,wBAAsB,wCAAwC,CAC5D,MAAM,EAAE,MAAM,EACd,SAAS,EAAE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AAED;;;GAGG;AACH,wBAAsB,+BAA+B,CACnD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAkC9B;AAED;;;GAGG;AACH,wBAAsB,wCAAwC,CAC5D,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,CAAC,CA+B9B;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,mBAAmB,EAClC,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC,CAyEhC;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,aAAa,EAAE,mBAAmB,EAClC,IAAI,EAAE,gBAAgB,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9C,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC,CA6EhC;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,0BAA0B,EAAE,CAAC,aAAa,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,EACrI,wBAAwB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,GAC9F,OAAO,CAAC,qBAAqB,CAAC,CAgRhC"}
@@ -16,12 +16,10 @@ exports.handlePolicyDeleteAll = handlePolicyDeleteAll;
16
16
  exports.handlePolicyOperation = handlePolicyOperation;
17
17
  const error_handling_1 = require("./error-handling");
18
18
  const policy_vector_service_1 = require("./policy-vector-service");
19
- const vector_db_service_1 = require("./vector-db-service");
20
19
  const unified_creation_session_1 = require("./unified-creation-session");
20
+ const plugin_registry_1 = require("./plugin-registry");
21
21
  const validation_1 = require("./constants/validation");
22
22
  const constants_1 = require("./constants");
23
- // Note: validateVectorDBConnection and validateEmbeddingService are shared utilities
24
- // that remain in the main organizational-data.ts file as they're used by multiple domains
25
23
  /**
26
24
  * Get initialized policy service
27
25
  */
@@ -41,9 +39,10 @@ async function getPolicyService() {
41
39
  /**
42
40
  * Execute kubectl command via plugin
43
41
  * PRD #343: All kubectl operations go through plugin
42
+ * PRD #359: Uses unified plugin registry
44
43
  */
45
- async function executeKubectlViaPlugin(pluginManager, args) {
46
- const response = await pluginManager.invokeTool('kubectl_exec_command', { args });
44
+ async function executeKubectlViaPlugin(args) {
45
+ const response = await (0, plugin_registry_1.invokePluginTool)('agentic-tools', 'kubectl_exec_command', { args });
47
46
  if (response.success) {
48
47
  if (typeof response.result === 'object' && response.result !== null) {
49
48
  const result = response.result;
@@ -68,15 +67,15 @@ async function executeKubectlViaPlugin(pluginManager, args) {
68
67
  }
69
68
  /**
70
69
  * Find Kyverno policies by policy intent ID using label selector
71
- * PRD #343: pluginManager required for kubectl operations
70
+ * PRD #359: Uses unified plugin registry
72
71
  */
73
- async function findKyvernoPoliciesByPolicyId(policyId, logger, requestId, pluginManager) {
72
+ async function findKyvernoPoliciesByPolicyId(policyId, logger, requestId) {
74
73
  try {
75
74
  logger.info('Searching for Kyverno policies by policy ID', {
76
75
  requestId,
77
76
  policyId
78
77
  });
79
- const output = await executeKubectlViaPlugin(pluginManager, ['get', 'clusterpolicy', '-l', `policy-intent/id=${policyId}`, '-o', 'json']);
78
+ const output = await executeKubectlViaPlugin(['get', 'clusterpolicy', '-l', `policy-intent/id=${policyId}`, '-o', 'json']);
80
79
  const parsedOutput = JSON.parse(output || '{"items": []}');
81
80
  const policies = parsedOutput.items || [];
82
81
  logger.info('Found Kyverno policies for policy intent', {
@@ -86,7 +85,7 @@ async function findKyvernoPoliciesByPolicyId(policyId, logger, requestId, plugin
86
85
  policyNames: policies.map((p) => p.metadata?.name)
87
86
  });
88
87
  return policies.map((p) => ({
89
- name: p.metadata?.name,
88
+ name: p.metadata?.name || '',
90
89
  labels: p.metadata?.labels,
91
90
  creationTimestamp: p.metadata?.creationTimestamp
92
91
  }));
@@ -102,14 +101,14 @@ async function findKyvernoPoliciesByPolicyId(policyId, logger, requestId, plugin
102
101
  }
103
102
  /**
104
103
  * Find all Kyverno policies that have policy-intent/id labels
105
- * PRD #343: pluginManager required for kubectl operations
104
+ * PRD #359: Uses unified plugin registry
106
105
  */
107
- async function findAllKyvernoPoliciesForPolicyIntents(logger, requestId, pluginManager) {
106
+ async function findAllKyvernoPoliciesForPolicyIntents(logger, requestId) {
108
107
  try {
109
108
  logger.info('Searching for all Kyverno policies with policy-intent labels', {
110
109
  requestId
111
110
  });
112
- const output = await executeKubectlViaPlugin(pluginManager, ['get', 'clusterpolicy', '-l', 'policy-intent/id', '-o', 'json']);
111
+ const output = await executeKubectlViaPlugin(['get', 'clusterpolicy', '-l', 'policy-intent/id', '-o', 'json']);
113
112
  const parsedOutput = JSON.parse(output || '{"items": []}');
114
113
  const policies = parsedOutput.items || [];
115
114
  logger.info('Found all Kyverno policies for policy intents', {
@@ -118,7 +117,7 @@ async function findAllKyvernoPoliciesForPolicyIntents(logger, requestId, pluginM
118
117
  policyNames: policies.map((p) => p.metadata?.name)
119
118
  });
120
119
  return policies.map((p) => ({
121
- name: p.metadata?.name,
120
+ name: p.metadata?.name || '',
122
121
  policyId: p.metadata?.labels?.['policy-intent/id'],
123
122
  labels: p.metadata?.labels,
124
123
  creationTimestamp: p.metadata?.creationTimestamp
@@ -134,15 +133,15 @@ async function findAllKyvernoPoliciesForPolicyIntents(logger, requestId, pluginM
134
133
  }
135
134
  /**
136
135
  * Delete Kyverno policies by policy intent ID using label selector
137
- * PRD #343: pluginManager required for kubectl operations
136
+ * PRD #359: Uses unified plugin registry
138
137
  */
139
- async function deleteKyvernoPoliciesByPolicyId(policyId, logger, requestId, pluginManager) {
138
+ async function deleteKyvernoPoliciesByPolicyId(policyId, logger, requestId) {
140
139
  try {
141
140
  logger.info('Deleting Kyverno policies by policy ID', {
142
141
  requestId,
143
142
  policyId
144
143
  });
145
- const output = await executeKubectlViaPlugin(pluginManager, ['delete', 'clusterpolicy', '-l', `policy-intent/id=${policyId}`]);
144
+ const output = await executeKubectlViaPlugin(['delete', 'clusterpolicy', '-l', `policy-intent/id=${policyId}`]);
146
145
  logger.info('Kyverno policies deleted successfully', {
147
146
  requestId,
148
147
  policyId,
@@ -169,14 +168,14 @@ async function deleteKyvernoPoliciesByPolicyId(policyId, logger, requestId, plug
169
168
  }
170
169
  /**
171
170
  * Delete all Kyverno policies that have policy-intent/id labels
172
- * PRD #343: pluginManager required for kubectl operations
171
+ * PRD #359: Uses unified plugin registry
173
172
  */
174
- async function deleteAllKyvernoPoliciesForPolicyIntents(logger, requestId, pluginManager) {
173
+ async function deleteAllKyvernoPoliciesForPolicyIntents(logger, requestId) {
175
174
  try {
176
175
  logger.info('Deleting all Kyverno policies with policy-intent labels', {
177
176
  requestId
178
177
  });
179
- const output = await executeKubectlViaPlugin(pluginManager, ['delete', 'clusterpolicy', '-l', 'policy-intent/id']);
178
+ const output = await executeKubectlViaPlugin(['delete', 'clusterpolicy', '-l', 'policy-intent/id']);
180
179
  logger.info('All Kyverno policies deleted successfully', {
181
180
  requestId,
182
181
  output
@@ -201,9 +200,9 @@ async function deleteAllKyvernoPoliciesForPolicyIntents(logger, requestId, plugi
201
200
  }
202
201
  /**
203
202
  * Handle individual policy delete with Kyverno cleanup
204
- * PRD #343: pluginManager required for kubectl operations
203
+ * PRD #359: Uses unified plugin registry
205
204
  */
206
- async function handlePolicyDelete(policyId, policyService, args, logger, requestId, pluginManager) {
205
+ async function handlePolicyDelete(policyId, policyService, args, logger, requestId) {
207
206
  try {
208
207
  // Check if policy intent exists
209
208
  const existingPolicyIntent = await policyService.getPolicyIntent(policyId);
@@ -217,7 +216,7 @@ async function handlePolicyDelete(policyId, policyService, args, logger, request
217
216
  };
218
217
  }
219
218
  // Check if there are deployed Kyverno policies with this policy ID
220
- const kyvernoPolicies = await findKyvernoPoliciesByPolicyId(policyId, logger, requestId, pluginManager);
219
+ const kyvernoPolicies = await findKyvernoPoliciesByPolicyId(policyId, logger, requestId);
221
220
  if (kyvernoPolicies.length > 0 && !args.response) {
222
221
  // Show confirmation prompt for Kyverno cleanup
223
222
  return {
@@ -240,7 +239,7 @@ async function handlePolicyDelete(policyId, policyService, args, logger, request
240
239
  const response = args.response.trim();
241
240
  if (response === '1' || response.toLowerCase().includes('delete everything')) {
242
241
  // Delete Kyverno policies from cluster
243
- kyvernoCleanupResults = await deleteKyvernoPoliciesByPolicyId(policyId, logger, requestId, pluginManager);
242
+ kyvernoCleanupResults = await deleteKyvernoPoliciesByPolicyId(policyId, logger, requestId);
244
243
  }
245
244
  }
246
245
  // Always delete the policy intent from Vector DB
@@ -272,9 +271,9 @@ async function handlePolicyDelete(policyId, policyService, args, logger, request
272
271
  }
273
272
  /**
274
273
  * Handle deleteAll policies with batch Kyverno cleanup
275
- * PRD #343: pluginManager required for kubectl operations
274
+ * PRD #359: Uses unified plugin registry
276
275
  */
277
- async function handlePolicyDeleteAll(policyService, args, logger, pluginManager, requestId) {
276
+ async function handlePolicyDeleteAll(policyService, args, logger, requestId) {
278
277
  try {
279
278
  // Get all policy intents
280
279
  const allPolicyIntents = await policyService.getAllPolicyIntents();
@@ -288,7 +287,7 @@ async function handlePolicyDeleteAll(policyService, args, logger, pluginManager,
288
287
  };
289
288
  }
290
289
  // Find all deployed Kyverno policies for all policy intents
291
- const allKyvernoPolicies = await findAllKyvernoPoliciesForPolicyIntents(logger, requestId, pluginManager);
290
+ const allKyvernoPolicies = await findAllKyvernoPoliciesForPolicyIntents(logger, requestId);
292
291
  if (allKyvernoPolicies.length > 0 && !args.response) {
293
292
  // Show confirmation prompt for batch Kyverno cleanup
294
293
  return {
@@ -311,7 +310,7 @@ async function handlePolicyDeleteAll(policyService, args, logger, pluginManager,
311
310
  const response = args.response.trim();
312
311
  if (response === '1' || response.toLowerCase().includes('delete everything')) {
313
312
  // Delete all Kyverno policies from cluster
314
- kyvernoCleanupResults = await deleteAllKyvernoPoliciesForPolicyIntents(logger, requestId, pluginManager);
313
+ kyvernoCleanupResults = await deleteAllKyvernoPoliciesForPolicyIntents(logger, requestId);
315
314
  }
316
315
  }
317
316
  // Always delete all policy intents from Vector DB
@@ -347,9 +346,9 @@ async function handlePolicyDeleteAll(policyService, args, logger, pluginManager,
347
346
  /**
348
347
  * Main policy operations handler - delegates to specific operation functions
349
348
  * Requires shared validation utilities to be passed as parameters to avoid circular imports
350
- * PRD #343: pluginManager required for kubectl operations via plugin system
349
+ * PRD #359: Uses unified plugin registry for kubectl operations
351
350
  */
352
- async function handlePolicyOperation(operation, args, logger, requestId, validateVectorDBConnection, validateEmbeddingService, pluginManager) {
351
+ async function handlePolicyOperation(operation, args, logger, requestId, validateVectorDBConnection, validateEmbeddingService) {
353
352
  // Get policy service and validate Vector DB connection
354
353
  const policyService = await getPolicyService();
355
354
  const connectionCheck = await validateVectorDBConnection(policyService, logger, requestId);
@@ -376,7 +375,7 @@ async function handlePolicyOperation(operation, args, logger, requestId, validat
376
375
  };
377
376
  }
378
377
  }
379
- const sessionManager = new unified_creation_session_1.UnifiedCreationSessionManager('policy', undefined, pluginManager);
378
+ const sessionManager = new unified_creation_session_1.UnifiedCreationSessionManager('policy');
380
379
  switch (operation) {
381
380
  case 'create': {
382
381
  let workflowStep;
@@ -388,12 +387,12 @@ async function handlePolicyOperation(operation, args, logger, requestId, validat
388
387
  });
389
388
  if (args.response) {
390
389
  // Process user response and move to next step
391
- const updatedSession = sessionManager.processResponse(args.sessionId, args.response, args);
390
+ const updatedSession = sessionManager.processResponse(args.sessionId, args.response);
392
391
  workflowStep = await sessionManager.getNextWorkflowStep(updatedSession, args);
393
392
  }
394
393
  else {
395
394
  // Just get current step without processing response
396
- const session = sessionManager.loadSession(args.sessionId, args);
395
+ const session = sessionManager.loadSession(args.sessionId);
397
396
  if (!session) {
398
397
  throw error_handling_1.ErrorHandler.createError(error_handling_1.ErrorCategory.VALIDATION, error_handling_1.ErrorSeverity.HIGH, `Session not found: ${args.sessionId}`, {
399
398
  operation: 'policy_workflow_continue',
@@ -429,27 +428,26 @@ async function handlePolicyOperation(operation, args, logger, requestId, validat
429
428
  // Always check if workflow is complete and store policy in Vector DB
430
429
  let storageInfo = {};
431
430
  const isComplete = !('nextStep' in workflowStep) || !workflowStep.nextStep; // Complete when no next step
432
- const hasPolicy = !!workflowStep.data?.policy;
431
+ const workflowData = workflowStep.data;
432
+ const hasPolicy = !!workflowData?.policy;
433
433
  logger.info('Checking workflow completion', {
434
434
  requestId,
435
435
  nextStep: ('nextStep' in workflowStep) ? workflowStep.nextStep : 'complete',
436
436
  hasPolicy,
437
- policyId: workflowStep.data?.policy?.id
437
+ policyId: workflowData?.policy?.id
438
438
  });
439
439
  if (isComplete && hasPolicy) {
440
440
  try {
441
- await policyService.storePolicyIntent(workflowStep.data.policy);
442
- const vectorDBConfig = new vector_db_service_1.VectorDBService({ collectionName: 'policies' }).getConfig();
441
+ await policyService.storePolicyIntent(workflowData.policy);
443
442
  storageInfo = {
444
443
  stored: true,
445
- vectorDbUrl: vectorDBConfig.url,
446
- collectionName: vectorDBConfig.collectionName,
447
- policyId: workflowStep.data.policy.id
444
+ collectionName: 'policies',
445
+ policyId: workflowData.policy.id
448
446
  };
449
447
  logger.info('Policy stored in Vector DB successfully', {
450
448
  requestId,
451
- policyId: workflowStep.data.policy.id,
452
- description: workflowStep.data.policy.description.substring(0, 50) + (workflowStep.data.policy.description.length > 50 ? '...' : '')
449
+ policyId: workflowData.policy.id,
450
+ description: workflowData.policy.description.substring(0, 50) + (workflowData.policy.description.length > 50 ? '...' : '')
453
451
  });
454
452
  }
455
453
  catch (error) {
@@ -457,11 +455,11 @@ async function handlePolicyOperation(operation, args, logger, requestId, validat
457
455
  storageInfo = {
458
456
  stored: false,
459
457
  error: errorMessage,
460
- policyId: workflowStep.data.policy.id
458
+ policyId: workflowData.policy.id
461
459
  };
462
460
  logger.error('Failed to store policy in Vector DB', error instanceof Error ? error : new Error(String(error)), {
463
461
  requestId,
464
- policyId: workflowStep.data.policy.id
462
+ policyId: workflowData.policy.id
465
463
  });
466
464
  }
467
465
  }
@@ -556,16 +554,16 @@ async function handlePolicyOperation(operation, args, logger, requestId, validat
556
554
  error: validation_1.VALIDATION_MESSAGES.MISSING_PARAMETER('id')
557
555
  };
558
556
  }
559
- if (!pluginManager) {
557
+ if (!(0, plugin_registry_1.isPluginInitialized)()) {
560
558
  throw new Error('Plugin system not available. Policy delete requires agentic-tools plugin for kubectl operations.');
561
559
  }
562
- return await handlePolicyDelete(args.id, policyService, args, logger, requestId, pluginManager);
560
+ return await handlePolicyDelete(args.id, policyService, args, logger, requestId);
563
561
  }
564
562
  case 'deleteAll': {
565
- if (!pluginManager) {
563
+ if (!(0, plugin_registry_1.isPluginInitialized)()) {
566
564
  throw new Error('Plugin system not available. Policy deleteAll requires agentic-tools plugin for kubectl operations.');
567
565
  }
568
- return await handlePolicyDeleteAll(policyService, args, logger, pluginManager, requestId);
566
+ return await handlePolicyDeleteAll(policyService, args, logger, requestId);
569
567
  }
570
568
  default:
571
569
  return {