@codemieai/code 0.0.44 → 0.0.46

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 (408) hide show
  1. package/dist/agents/core/BaseAgentAdapter.d.ts +9 -1
  2. package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
  3. package/dist/agents/core/BaseAgentAdapter.js +31 -3
  4. package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
  5. package/dist/agents/core/metrics/types.d.ts +0 -6
  6. package/dist/agents/core/metrics/types.d.ts.map +1 -1
  7. package/dist/agents/core/session/BaseSessionAdapter.d.ts +0 -6
  8. package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
  9. package/dist/agents/core/types.d.ts +83 -0
  10. package/dist/agents/core/types.d.ts.map +1 -1
  11. package/dist/agents/plugins/claude/claude.plugin-installer.d.ts +0 -11
  12. package/dist/agents/plugins/claude/claude.plugin-installer.d.ts.map +1 -1
  13. package/dist/agents/plugins/claude/claude.plugin-installer.js +0 -32
  14. package/dist/agents/plugins/claude/claude.plugin-installer.js.map +1 -1
  15. package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
  16. package/dist/agents/plugins/claude/claude.plugin.js +10 -1
  17. package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
  18. package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -1
  19. package/dist/agents/plugins/claude/claude.session.js +1 -28
  20. package/dist/agents/plugins/claude/claude.session.js.map +1 -1
  21. package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
  22. package/dist/agents/plugins/claude/plugin/README.md +1 -14
  23. package/dist/agents/plugins/claude/plugin/hooks/hooks.json +10 -5
  24. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/SKILL.md +206 -0
  25. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-agent.md +45 -0
  26. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-claude-md-snippet.md +40 -0
  27. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-command.md +30 -0
  28. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-hooks.json +23 -0
  29. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-skill.md +48 -0
  30. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-agent.md +145 -0
  31. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-claude-md-snippet.md +126 -0
  32. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-command.md +170 -0
  33. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-hooks.json +46 -0
  34. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-skill.md +144 -0
  35. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/sample-report.md +223 -0
  36. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/references/best-practices.md +510 -0
  37. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/references/component-checklists.md +413 -0
  38. package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/scripts/scan-repo.sh +162 -0
  39. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -1
  40. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +3 -78
  41. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
  42. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts.map +1 -1
  43. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js +7 -16
  44. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js.map +1 -1
  45. package/dist/agents/plugins/claude/sounds-installer.d.ts +1 -1
  46. package/dist/agents/plugins/claude/sounds-installer.d.ts.map +1 -1
  47. package/dist/agents/plugins/claude/sounds-installer.js +1 -4
  48. package/dist/agents/plugins/claude/sounds-installer.js.map +1 -1
  49. package/dist/agents/plugins/codemie-code.plugin.d.ts +1 -4
  50. package/dist/agents/plugins/codemie-code.plugin.d.ts.map +1 -1
  51. package/dist/agents/plugins/codemie-code.plugin.js +26 -81
  52. package/dist/agents/plugins/codemie-code.plugin.js.map +1 -1
  53. package/dist/agents/plugins/gemini/gemini.plugin.d.ts.map +1 -1
  54. package/dist/agents/plugins/gemini/gemini.plugin.js +10 -0
  55. package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -1
  56. package/dist/agents/plugins/gemini/gemini.session-adapter.d.ts +1 -8
  57. package/dist/agents/plugins/gemini/gemini.session-adapter.d.ts.map +1 -1
  58. package/dist/agents/plugins/gemini/gemini.session-adapter.js +2 -30
  59. package/dist/agents/plugins/gemini/gemini.session-adapter.js.map +1 -1
  60. package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.d.ts.map +1 -1
  61. package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.js +2 -8
  62. package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.js.map +1 -1
  63. package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.d.ts.map +1 -1
  64. package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.js +0 -7
  65. package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.js.map +1 -1
  66. package/dist/agents/plugins/opencode/index.d.ts +1 -1
  67. package/dist/agents/plugins/opencode/index.d.ts.map +1 -1
  68. package/dist/agents/plugins/opencode/index.js.map +1 -1
  69. package/dist/agents/plugins/opencode/opencode-message-types.d.ts +2 -22
  70. package/dist/agents/plugins/opencode/opencode-message-types.d.ts.map +1 -1
  71. package/dist/agents/plugins/opencode/opencode-message-types.js.map +1 -1
  72. package/dist/agents/plugins/opencode/opencode.session.d.ts.map +1 -1
  73. package/dist/agents/plugins/opencode/opencode.session.js +5 -30
  74. package/dist/agents/plugins/opencode/opencode.session.js.map +1 -1
  75. package/dist/agents/plugins/opencode/opencode.sqlite-reader.d.ts.map +1 -1
  76. package/dist/agents/plugins/opencode/opencode.sqlite-reader.js +0 -2
  77. package/dist/agents/plugins/opencode/opencode.sqlite-reader.js.map +1 -1
  78. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts +0 -8
  79. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts.map +1 -1
  80. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js +8 -97
  81. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js.map +1 -1
  82. package/dist/cli/commands/analytics/aggregator.d.ts +0 -8
  83. package/dist/cli/commands/analytics/aggregator.d.ts.map +1 -1
  84. package/dist/cli/commands/analytics/aggregator.js +5 -100
  85. package/dist/cli/commands/analytics/aggregator.js.map +1 -1
  86. package/dist/cli/commands/analytics/data-loader.d.ts +0 -7
  87. package/dist/cli/commands/analytics/data-loader.d.ts.map +1 -1
  88. package/dist/cli/commands/analytics/data-loader.js +3 -10
  89. package/dist/cli/commands/analytics/data-loader.js.map +1 -1
  90. package/dist/cli/commands/analytics/exporter.d.ts.map +1 -1
  91. package/dist/cli/commands/analytics/exporter.js +0 -12
  92. package/dist/cli/commands/analytics/exporter.js.map +1 -1
  93. package/dist/cli/commands/analytics/formatter.d.ts.map +1 -1
  94. package/dist/cli/commands/analytics/formatter.js +0 -9
  95. package/dist/cli/commands/analytics/formatter.js.map +1 -1
  96. package/dist/cli/commands/analytics/types.d.ts +0 -17
  97. package/dist/cli/commands/analytics/types.d.ts.map +1 -1
  98. package/dist/cli/commands/assistants/chat/historyLoader.d.ts +22 -0
  99. package/dist/cli/commands/assistants/chat/historyLoader.d.ts.map +1 -0
  100. package/dist/cli/commands/assistants/chat/historyLoader.js +80 -0
  101. package/dist/cli/commands/assistants/chat/historyLoader.js.map +1 -0
  102. package/dist/cli/commands/assistants/{chat.d.ts → chat/index.d.ts} +1 -1
  103. package/dist/cli/commands/assistants/chat/index.d.ts.map +1 -0
  104. package/dist/cli/commands/assistants/{chat.js → chat/index.js} +54 -45
  105. package/dist/cli/commands/assistants/chat/index.js.map +1 -0
  106. package/dist/cli/commands/assistants/chat/types.d.ts +27 -0
  107. package/dist/cli/commands/assistants/chat/types.d.ts.map +1 -0
  108. package/dist/cli/commands/assistants/chat/types.js +5 -0
  109. package/dist/cli/commands/assistants/chat/types.js.map +1 -0
  110. package/dist/cli/commands/assistants/chat/utils.d.ts +12 -0
  111. package/dist/cli/commands/assistants/chat/utils.d.ts.map +1 -0
  112. package/dist/cli/commands/assistants/chat/utils.js +24 -0
  113. package/dist/cli/commands/assistants/chat/utils.js.map +1 -0
  114. package/dist/cli/commands/assistants/constants.d.ts +1 -0
  115. package/dist/cli/commands/assistants/constants.d.ts.map +1 -1
  116. package/dist/cli/commands/assistants/constants.js.map +1 -1
  117. package/dist/cli/commands/assistants/index.js +2 -2
  118. package/dist/cli/commands/assistants/index.js.map +1 -1
  119. package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js +1 -1
  120. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js +1 -1
  121. package/dist/cli/commands/assistants/setup/index.js +4 -4
  122. package/dist/cli/commands/assistants/setup/index.js.map +1 -1
  123. package/dist/cli/commands/assistants/setup/selection/index.d.ts +1 -1
  124. package/dist/cli/commands/assistants/setup/selection/index.d.ts.map +1 -1
  125. package/dist/cli/commands/assistants/setup/selection/index.js +5 -3
  126. package/dist/cli/commands/assistants/setup/selection/index.js.map +1 -1
  127. package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts.map +1 -1
  128. package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js +7 -1
  129. package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js.map +1 -1
  130. package/dist/cli/commands/assistants/setup/selection/types.d.ts +2 -0
  131. package/dist/cli/commands/assistants/setup/selection/types.d.ts.map +1 -1
  132. package/dist/cli/commands/assistants/setup/selection/ui.d.ts.map +1 -1
  133. package/dist/cli/commands/assistants/setup/selection/ui.js +15 -4
  134. package/dist/cli/commands/assistants/setup/selection/ui.js.map +1 -1
  135. package/dist/cli/commands/hook.d.ts.map +1 -1
  136. package/dist/cli/commands/hook.js +22 -6
  137. package/dist/cli/commands/hook.js.map +1 -1
  138. package/dist/cli/commands/plugin.d.ts +16 -0
  139. package/dist/cli/commands/plugin.d.ts.map +1 -0
  140. package/dist/cli/commands/plugin.js +210 -0
  141. package/dist/cli/commands/plugin.js.map +1 -0
  142. package/dist/cli/commands/setup.js +1 -1
  143. package/dist/cli/commands/skill.d.ts.map +1 -1
  144. package/dist/cli/commands/skill.js +3 -1
  145. package/dist/cli/commands/skill.js.map +1 -1
  146. package/dist/cli/commands/sound.d.ts +3 -0
  147. package/dist/cli/commands/sound.d.ts.map +1 -0
  148. package/dist/cli/commands/sound.js +87 -0
  149. package/dist/cli/commands/sound.js.map +1 -0
  150. package/dist/cli/commands/test-metrics.js +3 -5
  151. package/dist/cli/commands/test-metrics.js.map +1 -1
  152. package/dist/cli/index.js +4 -0
  153. package/dist/cli/index.js.map +1 -1
  154. package/dist/env/types.d.ts +8 -0
  155. package/dist/env/types.d.ts.map +1 -1
  156. package/dist/env/types.js.map +1 -1
  157. package/dist/plugins/core/index.d.ts +13 -0
  158. package/dist/plugins/core/index.d.ts.map +1 -0
  159. package/dist/plugins/core/index.js +15 -0
  160. package/dist/plugins/core/index.js.map +1 -0
  161. package/dist/plugins/core/manifest-parser.d.ts +28 -0
  162. package/dist/plugins/core/manifest-parser.d.ts.map +1 -0
  163. package/dist/plugins/core/manifest-parser.js +137 -0
  164. package/dist/plugins/core/manifest-parser.js.map +1 -0
  165. package/dist/plugins/core/plugin-cache.d.ts +65 -0
  166. package/dist/plugins/core/plugin-cache.d.ts.map +1 -0
  167. package/dist/plugins/core/plugin-cache.js +170 -0
  168. package/dist/plugins/core/plugin-cache.js.map +1 -0
  169. package/dist/plugins/core/plugin-loader.d.ts +21 -0
  170. package/dist/plugins/core/plugin-loader.d.ts.map +1 -0
  171. package/dist/plugins/core/plugin-loader.js +55 -0
  172. package/dist/plugins/core/plugin-loader.js.map +1 -0
  173. package/dist/plugins/core/plugin-resolver.d.ts +33 -0
  174. package/dist/plugins/core/plugin-resolver.d.ts.map +1 -0
  175. package/dist/plugins/core/plugin-resolver.js +118 -0
  176. package/dist/plugins/core/plugin-resolver.js.map +1 -0
  177. package/dist/plugins/core/types.d.ts +183 -0
  178. package/dist/plugins/core/types.d.ts.map +1 -0
  179. package/dist/plugins/core/types.js +22 -0
  180. package/dist/plugins/core/types.js.map +1 -0
  181. package/dist/plugins/loaders/agents-loader.d.ts +19 -0
  182. package/dist/plugins/loaders/agents-loader.d.ts.map +1 -0
  183. package/dist/plugins/loaders/agents-loader.js +92 -0
  184. package/dist/plugins/loaders/agents-loader.js.map +1 -0
  185. package/dist/plugins/loaders/hooks-loader.d.ts +27 -0
  186. package/dist/plugins/loaders/hooks-loader.d.ts.map +1 -0
  187. package/dist/plugins/loaders/hooks-loader.js +94 -0
  188. package/dist/plugins/loaders/hooks-loader.js.map +1 -0
  189. package/dist/plugins/loaders/mcp-loader.d.ts +24 -0
  190. package/dist/plugins/loaders/mcp-loader.d.ts.map +1 -0
  191. package/dist/plugins/loaders/mcp-loader.js +86 -0
  192. package/dist/plugins/loaders/mcp-loader.js.map +1 -0
  193. package/dist/plugins/loaders/skills-loader.d.ts +30 -0
  194. package/dist/plugins/loaders/skills-loader.d.ts.map +1 -0
  195. package/dist/plugins/loaders/skills-loader.js +167 -0
  196. package/dist/plugins/loaders/skills-loader.js.map +1 -0
  197. package/dist/providers/plugins/bedrock/bedrock.template.js +1 -1
  198. package/dist/providers/plugins/jwt/jwt.setup-steps.js +1 -1
  199. package/dist/providers/plugins/jwt/jwt.template.js +1 -1
  200. package/dist/providers/plugins/litellm/litellm.template.js +1 -1
  201. package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.js +10 -0
  202. package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.js.map +1 -1
  203. package/dist/providers/plugins/sso/proxy/proxy-types.d.ts +3 -0
  204. package/dist/providers/plugins/sso/proxy/proxy-types.d.ts.map +1 -1
  205. package/dist/providers/plugins/sso/session/SessionSyncer.d.ts.map +1 -1
  206. package/dist/providers/plugins/sso/session/SessionSyncer.js +2 -3
  207. package/dist/providers/plugins/sso/session/SessionSyncer.js.map +1 -1
  208. package/dist/providers/plugins/sso/session/processors/conversations/apiClient.d.ts +21 -0
  209. package/dist/providers/plugins/sso/session/processors/conversations/apiClient.d.ts.map +1 -0
  210. package/dist/providers/plugins/sso/session/processors/conversations/apiClient.js +159 -0
  211. package/dist/providers/plugins/sso/session/processors/conversations/apiClient.js.map +1 -0
  212. package/dist/providers/plugins/sso/session/processors/conversations/constants.d.ts +24 -0
  213. package/dist/providers/plugins/sso/session/processors/conversations/constants.d.ts.map +1 -0
  214. package/dist/providers/plugins/sso/session/processors/conversations/constants.js +36 -0
  215. package/dist/providers/plugins/sso/session/processors/conversations/constants.js.map +1 -0
  216. package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.d.ts +19 -0
  217. package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.d.ts.map +1 -0
  218. package/dist/providers/plugins/sso/session/processors/conversations/{conversation-sync-processor.js → syncProcessor.js} +48 -33
  219. package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.js.map +1 -0
  220. package/dist/providers/plugins/sso/session/processors/conversations/{conversation-types.d.ts → types.d.ts} +14 -2
  221. package/dist/providers/plugins/sso/session/processors/conversations/types.d.ts.map +1 -0
  222. package/dist/providers/plugins/sso/session/processors/conversations/types.js +14 -0
  223. package/dist/providers/plugins/sso/session/processors/conversations/types.js.map +1 -0
  224. package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.d.ts.map +1 -1
  225. package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.js +16 -17
  226. package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.js.map +1 -1
  227. package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.d.ts +6 -5
  228. package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.d.ts.map +1 -1
  229. package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js +40 -39
  230. package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js.map +1 -1
  231. package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.d.ts.map +1 -1
  232. package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js +2 -6
  233. package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js.map +1 -1
  234. package/dist/providers/plugins/sso/session/processors/metrics/metrics-types.d.ts +74 -31
  235. package/dist/providers/plugins/sso/session/processors/metrics/metrics-types.d.ts.map +1 -1
  236. package/dist/providers/plugins/sso/sso.template.js +1 -1
  237. package/dist/{agents/codemie-code/skills → skills}/core/SkillDiscovery.d.ts +10 -0
  238. package/dist/skills/core/SkillDiscovery.d.ts.map +1 -0
  239. package/dist/{agents/codemie-code/skills → skills}/core/SkillDiscovery.js +64 -7
  240. package/dist/skills/core/SkillDiscovery.js.map +1 -0
  241. package/dist/skills/core/SkillManager.d.ts.map +1 -0
  242. package/dist/{agents/codemie-code/skills → skills}/core/SkillManager.js +15 -10
  243. package/dist/skills/core/SkillManager.js.map +1 -0
  244. package/dist/{agents/codemie-code/skills → skills}/core/types.d.ts +3 -25
  245. package/dist/skills/core/types.d.ts.map +1 -0
  246. package/dist/skills/core/types.js.map +1 -0
  247. package/dist/{agents/codemie-code/skills → skills}/index.d.ts +3 -3
  248. package/dist/skills/index.d.ts.map +1 -0
  249. package/dist/{agents/codemie-code/skills → skills}/index.js +2 -2
  250. package/dist/skills/index.js.map +1 -0
  251. package/dist/skills/sync/SkillSync.d.ts.map +1 -0
  252. package/dist/{agents/codemie-code/skills → skills}/sync/SkillSync.js +5 -3
  253. package/dist/skills/sync/SkillSync.js.map +1 -0
  254. package/dist/{agents/codemie-code/skills → skills}/utils/content-loader.d.ts +2 -12
  255. package/dist/skills/utils/content-loader.d.ts.map +1 -0
  256. package/dist/{agents/codemie-code/skills → skills}/utils/content-loader.js +3 -8
  257. package/dist/skills/utils/content-loader.js.map +1 -0
  258. package/dist/skills/utils/pattern-matcher.d.ts.map +1 -0
  259. package/dist/skills/utils/pattern-matcher.js.map +1 -0
  260. package/dist/utils/extensions-scan.d.ts +27 -0
  261. package/dist/utils/extensions-scan.d.ts.map +1 -0
  262. package/dist/utils/extensions-scan.js +182 -0
  263. package/dist/utils/extensions-scan.js.map +1 -0
  264. package/dist/utils/frontmatter.d.ts.map +1 -0
  265. package/dist/utils/frontmatter.js.map +1 -0
  266. package/package.json +1 -1
  267. package/dist/agents/codemie-code/agent.d.ts +0 -129
  268. package/dist/agents/codemie-code/agent.d.ts.map +0 -1
  269. package/dist/agents/codemie-code/agent.js +0 -1106
  270. package/dist/agents/codemie-code/agent.js.map +0 -1
  271. package/dist/agents/codemie-code/config.d.ts +0 -40
  272. package/dist/agents/codemie-code/config.d.ts.map +0 -1
  273. package/dist/agents/codemie-code/config.js +0 -293
  274. package/dist/agents/codemie-code/config.js.map +0 -1
  275. package/dist/agents/codemie-code/filters.d.ts +0 -91
  276. package/dist/agents/codemie-code/filters.d.ts.map +0 -1
  277. package/dist/agents/codemie-code/filters.js +0 -328
  278. package/dist/agents/codemie-code/filters.js.map +0 -1
  279. package/dist/agents/codemie-code/index.d.ts +0 -93
  280. package/dist/agents/codemie-code/index.d.ts.map +0 -1
  281. package/dist/agents/codemie-code/index.js +0 -359
  282. package/dist/agents/codemie-code/index.js.map +0 -1
  283. package/dist/agents/codemie-code/modes/contextAwarePlanning.d.ts +0 -87
  284. package/dist/agents/codemie-code/modes/contextAwarePlanning.d.ts.map +0 -1
  285. package/dist/agents/codemie-code/modes/contextAwarePlanning.js +0 -957
  286. package/dist/agents/codemie-code/modes/contextAwarePlanning.js.map +0 -1
  287. package/dist/agents/codemie-code/modes/planMode.d.ts +0 -116
  288. package/dist/agents/codemie-code/modes/planMode.d.ts.map +0 -1
  289. package/dist/agents/codemie-code/modes/planMode.js +0 -537
  290. package/dist/agents/codemie-code/modes/planMode.js.map +0 -1
  291. package/dist/agents/codemie-code/prompts.d.ts +0 -47
  292. package/dist/agents/codemie-code/prompts.d.ts.map +0 -1
  293. package/dist/agents/codemie-code/prompts.js +0 -207
  294. package/dist/agents/codemie-code/prompts.js.map +0 -1
  295. package/dist/agents/codemie-code/skills/core/SkillDiscovery.d.ts.map +0 -1
  296. package/dist/agents/codemie-code/skills/core/SkillDiscovery.js.map +0 -1
  297. package/dist/agents/codemie-code/skills/core/SkillManager.d.ts.map +0 -1
  298. package/dist/agents/codemie-code/skills/core/SkillManager.js.map +0 -1
  299. package/dist/agents/codemie-code/skills/core/types.d.ts.map +0 -1
  300. package/dist/agents/codemie-code/skills/core/types.js.map +0 -1
  301. package/dist/agents/codemie-code/skills/index.d.ts.map +0 -1
  302. package/dist/agents/codemie-code/skills/index.js.map +0 -1
  303. package/dist/agents/codemie-code/skills/sync/SkillSync.d.ts.map +0 -1
  304. package/dist/agents/codemie-code/skills/sync/SkillSync.js.map +0 -1
  305. package/dist/agents/codemie-code/skills/utils/content-loader.d.ts.map +0 -1
  306. package/dist/agents/codemie-code/skills/utils/content-loader.js.map +0 -1
  307. package/dist/agents/codemie-code/skills/utils/frontmatter.d.ts.map +0 -1
  308. package/dist/agents/codemie-code/skills/utils/frontmatter.js.map +0 -1
  309. package/dist/agents/codemie-code/skills/utils/pattern-matcher.d.ts.map +0 -1
  310. package/dist/agents/codemie-code/skills/utils/pattern-matcher.js.map +0 -1
  311. package/dist/agents/codemie-code/storage/todoStorage.d.ts +0 -78
  312. package/dist/agents/codemie-code/storage/todoStorage.d.ts.map +0 -1
  313. package/dist/agents/codemie-code/storage/todoStorage.js +0 -225
  314. package/dist/agents/codemie-code/storage/todoStorage.js.map +0 -1
  315. package/dist/agents/codemie-code/tokenUtils.d.ts +0 -108
  316. package/dist/agents/codemie-code/tokenUtils.d.ts.map +0 -1
  317. package/dist/agents/codemie-code/tokenUtils.js +0 -220
  318. package/dist/agents/codemie-code/tokenUtils.js.map +0 -1
  319. package/dist/agents/codemie-code/toolMetadata.d.ts +0 -15
  320. package/dist/agents/codemie-code/toolMetadata.d.ts.map +0 -1
  321. package/dist/agents/codemie-code/toolMetadata.js +0 -316
  322. package/dist/agents/codemie-code/toolMetadata.js.map +0 -1
  323. package/dist/agents/codemie-code/tools/assistant-invocation.d.ts +0 -47
  324. package/dist/agents/codemie-code/tools/assistant-invocation.d.ts.map +0 -1
  325. package/dist/agents/codemie-code/tools/assistant-invocation.js +0 -129
  326. package/dist/agents/codemie-code/tools/assistant-invocation.js.map +0 -1
  327. package/dist/agents/codemie-code/tools/index.d.ts +0 -111
  328. package/dist/agents/codemie-code/tools/index.d.ts.map +0 -1
  329. package/dist/agents/codemie-code/tools/index.js +0 -424
  330. package/dist/agents/codemie-code/tools/index.js.map +0 -1
  331. package/dist/agents/codemie-code/tools/planning.d.ts +0 -54
  332. package/dist/agents/codemie-code/tools/planning.d.ts.map +0 -1
  333. package/dist/agents/codemie-code/tools/planning.js +0 -226
  334. package/dist/agents/codemie-code/tools/planning.js.map +0 -1
  335. package/dist/agents/codemie-code/types.d.ts +0 -459
  336. package/dist/agents/codemie-code/types.d.ts.map +0 -1
  337. package/dist/agents/codemie-code/types.js +0 -59
  338. package/dist/agents/codemie-code/types.js.map +0 -1
  339. package/dist/agents/codemie-code/ui/autocomplete.d.ts +0 -98
  340. package/dist/agents/codemie-code/ui/autocomplete.d.ts.map +0 -1
  341. package/dist/agents/codemie-code/ui/autocomplete.js +0 -145
  342. package/dist/agents/codemie-code/ui/autocomplete.js.map +0 -1
  343. package/dist/agents/codemie-code/ui/keyHandlers.d.ts +0 -112
  344. package/dist/agents/codemie-code/ui/keyHandlers.d.ts.map +0 -1
  345. package/dist/agents/codemie-code/ui/keyHandlers.js +0 -415
  346. package/dist/agents/codemie-code/ui/keyHandlers.js.map +0 -1
  347. package/dist/agents/codemie-code/ui/mentions.d.ts +0 -86
  348. package/dist/agents/codemie-code/ui/mentions.d.ts.map +0 -1
  349. package/dist/agents/codemie-code/ui/mentions.js +0 -122
  350. package/dist/agents/codemie-code/ui/mentions.js.map +0 -1
  351. package/dist/agents/codemie-code/ui/progressTracker.d.ts +0 -125
  352. package/dist/agents/codemie-code/ui/progressTracker.d.ts.map +0 -1
  353. package/dist/agents/codemie-code/ui/progressTracker.js +0 -343
  354. package/dist/agents/codemie-code/ui/progressTracker.js.map +0 -1
  355. package/dist/agents/codemie-code/ui/terminalCodes.d.ts +0 -38
  356. package/dist/agents/codemie-code/ui/terminalCodes.d.ts.map +0 -1
  357. package/dist/agents/codemie-code/ui/terminalCodes.js +0 -42
  358. package/dist/agents/codemie-code/ui/terminalCodes.js.map +0 -1
  359. package/dist/agents/codemie-code/ui/todoPanel.d.ts +0 -112
  360. package/dist/agents/codemie-code/ui/todoPanel.d.ts.map +0 -1
  361. package/dist/agents/codemie-code/ui/todoPanel.js +0 -321
  362. package/dist/agents/codemie-code/ui/todoPanel.js.map +0 -1
  363. package/dist/agents/codemie-code/ui.d.ts +0 -180
  364. package/dist/agents/codemie-code/ui.d.ts.map +0 -1
  365. package/dist/agents/codemie-code/ui.js +0 -1345
  366. package/dist/agents/codemie-code/ui.js.map +0 -1
  367. package/dist/agents/codemie-code/utils/progressionEnforcer.d.ts +0 -87
  368. package/dist/agents/codemie-code/utils/progressionEnforcer.d.ts.map +0 -1
  369. package/dist/agents/codemie-code/utils/progressionEnforcer.js +0 -293
  370. package/dist/agents/codemie-code/utils/progressionEnforcer.js.map +0 -1
  371. package/dist/agents/codemie-code/utils/todoParser.d.ts +0 -41
  372. package/dist/agents/codemie-code/utils/todoParser.d.ts.map +0 -1
  373. package/dist/agents/codemie-code/utils/todoParser.js +0 -305
  374. package/dist/agents/codemie-code/utils/todoParser.js.map +0 -1
  375. package/dist/agents/codemie-code/utils/todoValidator.d.ts +0 -65
  376. package/dist/agents/codemie-code/utils/todoValidator.d.ts.map +0 -1
  377. package/dist/agents/codemie-code/utils/todoValidator.js +0 -249
  378. package/dist/agents/codemie-code/utils/todoValidator.js.map +0 -1
  379. package/dist/agents/codemie-code/validators/planValidator.d.ts +0 -94
  380. package/dist/agents/codemie-code/validators/planValidator.d.ts.map +0 -1
  381. package/dist/agents/codemie-code/validators/planValidator.js +0 -281
  382. package/dist/agents/codemie-code/validators/planValidator.js.map +0 -1
  383. package/dist/agents/plugins/claude/plugin/hooks/hooks.windows.json +0 -98
  384. package/dist/agents/plugins/claude/plugin/sounds/play-random-sound.ps1 +0 -112
  385. package/dist/agents/plugins/claude/plugin/sounds/play-random-sound.sh +0 -58
  386. package/dist/agents/plugins/gemini/session/utils/token-aggregator.d.ts +0 -26
  387. package/dist/agents/plugins/gemini/session/utils/token-aggregator.d.ts.map +0 -1
  388. package/dist/agents/plugins/gemini/session/utils/token-aggregator.js +0 -38
  389. package/dist/agents/plugins/gemini/session/utils/token-aggregator.js.map +0 -1
  390. package/dist/cli/commands/assistants/chat.d.ts.map +0 -1
  391. package/dist/cli/commands/assistants/chat.js.map +0 -1
  392. package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.d.ts +0 -26
  393. package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.d.ts.map +0 -1
  394. package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.js +0 -146
  395. package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.js.map +0 -1
  396. package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts +0 -22
  397. package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts.map +0 -1
  398. package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.js.map +0 -1
  399. package/dist/providers/plugins/sso/session/processors/conversations/conversation-types.d.ts.map +0 -1
  400. package/dist/providers/plugins/sso/session/processors/conversations/conversation-types.js +0 -7
  401. package/dist/providers/plugins/sso/session/processors/conversations/conversation-types.js.map +0 -1
  402. /package/dist/{agents/codemie-code/skills → skills}/core/SkillManager.d.ts +0 -0
  403. /package/dist/{agents/codemie-code/skills → skills}/core/types.js +0 -0
  404. /package/dist/{agents/codemie-code/skills → skills}/sync/SkillSync.d.ts +0 -0
  405. /package/dist/{agents/codemie-code/skills → skills}/utils/pattern-matcher.d.ts +0 -0
  406. /package/dist/{agents/codemie-code/skills → skills}/utils/pattern-matcher.js +0 -0
  407. /package/dist/{agents/codemie-code/skills/utils → utils}/frontmatter.d.ts +0 -0
  408. /package/dist/{agents/codemie-code/skills/utils → utils}/frontmatter.js +0 -0
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Plugin Resolver
3
+ *
4
+ * Discovers plugins from multiple sources, resolves enabled/disabled state,
5
+ * and returns an ordered list of loaded plugins. Higher-priority sources
6
+ * win when the same plugin exists in multiple locations.
7
+ */
8
+ import { join, basename } from 'path';
9
+ import { existsSync } from 'fs';
10
+ import { readdir } from 'fs/promises';
11
+ import { logger } from '../../utils/logger.js';
12
+ import { getCodemiePath } from '../../utils/paths.js';
13
+ import { loadPlugin } from './plugin-loader.js';
14
+ /**
15
+ * Resolve all plugins from all sources
16
+ *
17
+ * Discovery sources (in priority order):
18
+ * 1. CLI flag directories (--plugin-dir) — highest priority
19
+ * 2. Project plugins (.codemie/plugins/) — team-shared
20
+ * 3. User cache (~/.codemie/plugins/cache/) — personal installs
21
+ * 4. Settings dirs (from config plugins.dirs) — managed
22
+ *
23
+ * @param options - Resolution options
24
+ * @returns Array of loaded plugins, deduplicated (highest priority wins)
25
+ */
26
+ export async function resolvePlugins(options = {}) {
27
+ const { cliDirs = [], cwd = process.cwd(), settings = {} } = options;
28
+ const disabledSet = new Set(settings.disabled || []);
29
+ const enabledSet = settings.enabled ? new Set(settings.enabled) : null;
30
+ // Discover from all sources
31
+ const sources = [
32
+ { dirs: cliDirs, source: 'local', priority: 400 },
33
+ { dirs: await getProjectPluginDirs(cwd), source: 'project', priority: 300 },
34
+ { dirs: await getUserPluginDirs(), source: 'user', priority: 200 },
35
+ { dirs: settings.dirs || [], source: 'local', priority: 100 },
36
+ ];
37
+ // Load all plugins from all sources
38
+ const pluginMap = new Map();
39
+ for (const { dirs, source, priority: _priority } of sources) {
40
+ for (const dir of dirs) {
41
+ try {
42
+ const isEnabled = determineEnabled(dir, enabledSet, disabledSet);
43
+ const plugin = await loadPlugin(dir, source, isEnabled);
44
+ const name = plugin.manifest.name;
45
+ // Higher priority source wins (first encountered wins since we iterate highest first)
46
+ if (!pluginMap.has(name)) {
47
+ pluginMap.set(name, plugin);
48
+ }
49
+ else {
50
+ logger.debug(`[plugin] Skipping duplicate plugin "${name}" from ${dir} (already loaded from higher priority source)`);
51
+ }
52
+ }
53
+ catch (error) {
54
+ logger.debug(`[plugin] Failed to load plugin from ${dir}: ${error instanceof Error ? error.message : String(error)}`);
55
+ }
56
+ }
57
+ }
58
+ const plugins = Array.from(pluginMap.values());
59
+ logger.debug(`[plugin] Resolved ${plugins.length} plugins (${plugins.filter(p => p.enabled).length} enabled)`);
60
+ return plugins;
61
+ }
62
+ /**
63
+ * Get project-level plugin directories
64
+ *
65
+ * Scans .codemie/plugins/ for subdirectories, each treated as a plugin root.
66
+ */
67
+ async function getProjectPluginDirs(cwd) {
68
+ const projectPluginsDir = join(cwd, '.codemie', 'plugins');
69
+ if (!existsSync(projectPluginsDir)) {
70
+ return [];
71
+ }
72
+ try {
73
+ const entries = await readdir(projectPluginsDir, { withFileTypes: true });
74
+ return entries
75
+ .filter(entry => entry.isDirectory())
76
+ .map(entry => join(projectPluginsDir, entry.name));
77
+ }
78
+ catch {
79
+ return [];
80
+ }
81
+ }
82
+ /**
83
+ * Get user-level plugin directories from cache
84
+ */
85
+ async function getUserPluginDirs() {
86
+ const cacheDir = getCodemiePath('plugins', 'cache');
87
+ if (!existsSync(cacheDir)) {
88
+ return [];
89
+ }
90
+ try {
91
+ const entries = await readdir(cacheDir, { withFileTypes: true });
92
+ return entries
93
+ .filter(entry => entry.isDirectory())
94
+ .map(entry => join(cacheDir, entry.name));
95
+ }
96
+ catch (error) {
97
+ logger.debug(`[plugin] Failed to read user plugin cache: ${error instanceof Error ? error.message : String(error)}`);
98
+ return [];
99
+ }
100
+ }
101
+ /**
102
+ * Determine if a plugin directory should be enabled
103
+ */
104
+ function determineEnabled(dir, enabledSet, disabledSet) {
105
+ // Extract plugin name from directory for matching
106
+ const dirName = basename(dir);
107
+ // Explicit disabled takes precedence
108
+ if (disabledSet.has(dirName)) {
109
+ return false;
110
+ }
111
+ // If enabledSet exists, only enable explicitly listed plugins
112
+ if (enabledSet) {
113
+ return enabledSet.has(dirName);
114
+ }
115
+ // Default: enabled
116
+ return true;
117
+ }
118
+ //# sourceMappingURL=plugin-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-resolver.js","sourceRoot":"","sources":["../../../src/plugins/core/plugin-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAiBhD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,UAAiC,EAAE;IAEnC,MAAM,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IACrE,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEvE,4BAA4B;IAC5B,MAAM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O,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QACjE,OAAO,OAAO;aACX,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;aACpC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,8CAA8C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACrH,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CACvB,GAAW,EACX,UAA8B,EAC9B,WAAwB;IAExB,kDAAkD;IAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAE9B,qCAAqC;IACrC,IAAI,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,8DAA8D;IAC9D,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,mBAAmB;IACnB,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,183 @@
1
+ /**
2
+ * Plugin System Types
3
+ *
4
+ * Defines interfaces for the native plugin system following the Anthropic
5
+ * Claude Code plugin format (.claude-plugin/plugin.json, skills/, commands/, etc.)
6
+ */
7
+ import type { HooksConfiguration } from '../../hooks/types.js';
8
+ /**
9
+ * Author information for a plugin
10
+ */
11
+ export interface PluginAuthor {
12
+ name: string;
13
+ email?: string;
14
+ url?: string;
15
+ }
16
+ /**
17
+ * MCP server configuration from a plugin
18
+ */
19
+ export interface McpConfig {
20
+ mcpServers: Record<string, McpServerConfig>;
21
+ }
22
+ /**
23
+ * Individual MCP server configuration
24
+ */
25
+ export interface McpServerConfig {
26
+ command: string;
27
+ args?: string[];
28
+ env?: Record<string, string>;
29
+ cwd?: string;
30
+ }
31
+ /**
32
+ * LSP server configuration from a plugin
33
+ */
34
+ export interface LspConfig {
35
+ lspServers: Record<string, LspServerConfig>;
36
+ }
37
+ /**
38
+ * Individual LSP server configuration
39
+ */
40
+ export interface LspServerConfig {
41
+ command: string;
42
+ args?: string[];
43
+ env?: Record<string, string>;
44
+ languages?: string[];
45
+ }
46
+ /**
47
+ * Plugin manifest as defined in .claude-plugin/plugin.json
48
+ *
49
+ * Follows the Anthropic Claude Code plugin format.
50
+ */
51
+ export interface PluginManifest {
52
+ /** Plugin name (required, kebab-case) */
53
+ name: string;
54
+ /** Semantic version */
55
+ version?: string;
56
+ /** Human-readable description */
57
+ description?: string;
58
+ /** Author information */
59
+ author?: PluginAuthor;
60
+ /** Plugin homepage URL */
61
+ homepage?: string;
62
+ /** Source repository URL */
63
+ repository?: string;
64
+ /** License identifier (e.g., 'MIT', 'Apache-2.0') */
65
+ license?: string;
66
+ /** Search keywords */
67
+ keywords?: string[];
68
+ /** Commands directory path override(s) */
69
+ commands?: string | string[];
70
+ /** Agents directory path override(s) */
71
+ agents?: string | string[];
72
+ /** Skills directory path override(s) */
73
+ skills?: string | string[];
74
+ /** Hooks config path(s) or inline config */
75
+ hooks?: string | string[] | HooksConfiguration;
76
+ /** MCP servers config path(s) or inline config */
77
+ mcpServers?: string | string[] | McpConfig;
78
+ /** LSP servers config path(s) or inline config */
79
+ lspServers?: string | string[] | LspConfig;
80
+ /** Output style path overrides */
81
+ outputStyles?: string | string[];
82
+ }
83
+ /**
84
+ * A skill discovered from a plugin's skills/ or commands/ directory
85
+ */
86
+ export interface PluginSkill {
87
+ /** Name of the parent plugin */
88
+ pluginName: string;
89
+ /** Original skill name from SKILL.md frontmatter */
90
+ skillName: string;
91
+ /** Namespaced name: "plugin-name:skill-name" */
92
+ namespacedName: string;
93
+ /** Absolute path to the skill file */
94
+ filePath: string;
95
+ /** Raw file content (markdown body after frontmatter) */
96
+ content: string;
97
+ /** Parsed frontmatter metadata */
98
+ metadata: Record<string, unknown>;
99
+ }
100
+ /**
101
+ * A command discovered from a plugin's commands/ directory
102
+ */
103
+ export interface PluginCommand {
104
+ /** Name of the parent plugin */
105
+ pluginName: string;
106
+ /** Original command name */
107
+ commandName: string;
108
+ /** Namespaced name: "plugin-name:command-name" */
109
+ namespacedName: string;
110
+ /** Absolute path to the command file */
111
+ filePath: string;
112
+ /** Raw file content */
113
+ content: string;
114
+ /** Parsed frontmatter metadata */
115
+ metadata: Record<string, unknown>;
116
+ }
117
+ /**
118
+ * An agent discovered from a plugin's agents/ directory
119
+ */
120
+ export interface PluginAgent {
121
+ /** Name of the parent plugin */
122
+ pluginName: string;
123
+ /** Original agent name */
124
+ agentName: string;
125
+ /** Namespaced name: "plugin-name:agent-name" */
126
+ namespacedName: string;
127
+ /** Absolute path to the agent file */
128
+ filePath: string;
129
+ /** Raw file content */
130
+ content: string;
131
+ /** Parsed frontmatter metadata */
132
+ metadata: Record<string, unknown>;
133
+ }
134
+ /**
135
+ * Source of where a plugin was found/installed
136
+ */
137
+ export type PluginSource = 'local' | 'user' | 'project';
138
+ /**
139
+ * A fully loaded and resolved plugin with all its components
140
+ */
141
+ export interface LoadedPlugin {
142
+ /** Parsed manifest from plugin.json */
143
+ manifest: PluginManifest;
144
+ /** Absolute path to the plugin root directory */
145
+ rootDir: string;
146
+ /** Where the plugin was found/installed */
147
+ source: PluginSource;
148
+ /** Whether this plugin is enabled */
149
+ enabled: boolean;
150
+ /** Discovered skills with namespace prefix */
151
+ skills: PluginSkill[];
152
+ /** Discovered commands with namespace prefix */
153
+ commands: PluginCommand[];
154
+ /** Discovered agents with namespace prefix */
155
+ agents: PluginAgent[];
156
+ /** Merged hooks configuration (or null if none) */
157
+ hooks: HooksConfiguration | null;
158
+ /** Merged MCP server configuration (or null if none) */
159
+ mcpServers: McpConfig | null;
160
+ }
161
+ /**
162
+ * Plugin settings stored in config
163
+ */
164
+ export interface PluginSettings {
165
+ /** Explicitly enabled plugin names */
166
+ enabled?: string[];
167
+ /** Explicitly disabled plugin names */
168
+ disabled?: string[];
169
+ /** Additional plugin directories to scan */
170
+ dirs?: string[];
171
+ }
172
+ /**
173
+ * Error codes for plugin operations
174
+ */
175
+ export declare enum PluginErrorCode {
176
+ MANIFEST_NOT_FOUND = "MANIFEST_NOT_FOUND",
177
+ MANIFEST_INVALID = "MANIFEST_INVALID",
178
+ PLUGIN_NOT_FOUND = "PLUGIN_NOT_FOUND",
179
+ PLUGIN_ALREADY_INSTALLED = "PLUGIN_ALREADY_INSTALLED",
180
+ INSTALL_FAILED = "INSTALL_FAILED",
181
+ LOAD_FAILED = "LOAD_FAILED"
182
+ }
183
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/core/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAM/D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC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AAG,SAAS,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uCAAuC;IACvC,QAAQ,EAAE,cAAc,CAAC;IAEzB,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAEhB,2CAA2C;IAC3C,MAAM,EAAE,YAAY,CAAC;IAErB,qCAAqC;IACrC,OAAO,EAAE,OAAO,CAAC;IAEjB,8CAA8C;IAC9C,MAAM,EAAE,WAAW,EAAE,CAAC;IAEtB,gDAAgD;IAChD,QAAQ,EAAE,aAAa,EAAE,CAAC;IAE1B,8CAA8C;IAC9C,MAAM,EAAE,WAAW,EAAE,CAAC;IAEtB,mDAAmD;IACnD,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEjC,wDAAwD;IACxD,UAAU,EAAE,SAAS,GAAG,IAAI,CAAC;CAC9B;AAMD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAMD;;GAEG;AACH,oBAAY,eAAe;IACzB,kBAAkB,uBAAuB;IACzC,gBAAgB,qBAAqB;IACrC,gBAAgB,qBAAqB;IACrC,wBAAwB,6BAA6B;IACrD,cAAc,mBAAmB;IACjC,WAAW,gBAAgB;CAC5B"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Plugin System Types
3
+ *
4
+ * Defines interfaces for the native plugin system following the Anthropic
5
+ * Claude Code plugin format (.claude-plugin/plugin.json, skills/, commands/, etc.)
6
+ */
7
+ // ============================================================================
8
+ // Plugin Errors
9
+ // ============================================================================
10
+ /**
11
+ * Error codes for plugin operations
12
+ */
13
+ export var PluginErrorCode;
14
+ (function (PluginErrorCode) {
15
+ PluginErrorCode["MANIFEST_NOT_FOUND"] = "MANIFEST_NOT_FOUND";
16
+ PluginErrorCode["MANIFEST_INVALID"] = "MANIFEST_INVALID";
17
+ PluginErrorCode["PLUGIN_NOT_FOUND"] = "PLUGIN_NOT_FOUND";
18
+ PluginErrorCode["PLUGIN_ALREADY_INSTALLED"] = "PLUGIN_ALREADY_INSTALLED";
19
+ PluginErrorCode["INSTALL_FAILED"] = "INSTALL_FAILED";
20
+ PluginErrorCode["LOAD_FAILED"] = "LOAD_FAILED";
21
+ })(PluginErrorCode || (PluginErrorCode = {}));
22
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plugins/core/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2OH,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,4DAAyC,CAAA;IACzC,wDAAqC,CAAA;IACrC,wDAAqC,CAAA;IACrC,wEAAqD,CAAA;IACrD,oDAAiC,CAAA;IACjC,8CAA2B,CAAA;AAC7B,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Plugin Agents Loader
3
+ *
4
+ * Discovers agent definitions from a plugin's agents/ directory.
5
+ * Each agent is namespaced with the plugin name.
6
+ */
7
+ import type { PluginAgent, PluginManifest } from '../core/types.js';
8
+ /**
9
+ * Discover agents from a plugin directory
10
+ *
11
+ * Looks for *.md files in the plugin's agents/ directory (or custom paths from manifest).
12
+ * Each agent is namespaced as "plugin-name:agent-name".
13
+ *
14
+ * @param pluginDir - Absolute path to the plugin root
15
+ * @param manifest - Parsed plugin manifest
16
+ * @returns Array of discovered plugin agents
17
+ */
18
+ export declare function discoverPluginAgents(pluginDir: string, manifest: PluginManifest): Promise<PluginAgent[]>;
19
+ //# sourceMappingURL=agents-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents-loader.d.ts","sourceRoot":"","sources":["../../../src/plugins/loaders/agents-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEpE;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,EAAE,CAAC,CAiCxB"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Plugin Agents Loader
3
+ *
4
+ * Discovers agent definitions from a plugin's agents/ directory.
5
+ * Each agent is namespaced with the plugin name.
6
+ */
7
+ import { readFile } from 'fs/promises';
8
+ import { join, basename } from 'path';
9
+ import fg from 'fast-glob';
10
+ import { logger } from '../../utils/logger.js';
11
+ import { parseFrontmatter, hasFrontmatter } from '../../utils/frontmatter.js';
12
+ /**
13
+ * Discover agents from a plugin directory
14
+ *
15
+ * Looks for *.md files in the plugin's agents/ directory (or custom paths from manifest).
16
+ * Each agent is namespaced as "plugin-name:agent-name".
17
+ *
18
+ * @param pluginDir - Absolute path to the plugin root
19
+ * @param manifest - Parsed plugin manifest
20
+ * @returns Array of discovered plugin agents
21
+ */
22
+ export async function discoverPluginAgents(pluginDir, manifest) {
23
+ const agentsDirs = resolveAgentDirs(pluginDir, manifest.agents);
24
+ const agents = [];
25
+ for (const dir of agentsDirs) {
26
+ try {
27
+ const files = await fg('*.md', {
28
+ cwd: dir,
29
+ absolute: true,
30
+ caseSensitiveMatch: false,
31
+ deep: 1,
32
+ ignore: ['**/node_modules/**', '**/.git/**'],
33
+ onlyFiles: true,
34
+ });
35
+ for (const filePath of files) {
36
+ try {
37
+ const agent = await parsePluginAgentFile(filePath, manifest.name);
38
+ if (agent) {
39
+ agents.push(agent);
40
+ }
41
+ }
42
+ catch (error) {
43
+ logger.debug(`[plugin] Failed to parse agent ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
44
+ }
45
+ }
46
+ }
47
+ catch {
48
+ // Directory doesn't exist — skip silently
49
+ }
50
+ }
51
+ return agents;
52
+ }
53
+ /**
54
+ * Parse a single agent .md file into a PluginAgent
55
+ */
56
+ async function parsePluginAgentFile(filePath, pluginName) {
57
+ const fileContent = await readFile(filePath, 'utf-8');
58
+ let metadata = {};
59
+ let content;
60
+ if (hasFrontmatter(fileContent)) {
61
+ const parsed = parseFrontmatter(fileContent, filePath);
62
+ metadata = parsed.metadata;
63
+ content = parsed.content;
64
+ }
65
+ else {
66
+ content = fileContent.trim();
67
+ }
68
+ // Derive agent name from metadata or filename (without .md extension)
69
+ const agentName = metadata.name || basename(filePath, '.md');
70
+ if (!agentName) {
71
+ return null;
72
+ }
73
+ return {
74
+ pluginName,
75
+ agentName,
76
+ namespacedName: `${pluginName}:${agentName}`,
77
+ filePath,
78
+ content,
79
+ metadata,
80
+ };
81
+ }
82
+ /**
83
+ * Resolve agent directories from manifest field or defaults
84
+ */
85
+ function resolveAgentDirs(pluginDir, agentsField) {
86
+ if (!agentsField) {
87
+ return [join(pluginDir, 'agents')];
88
+ }
89
+ const paths = Array.isArray(agentsField) ? agentsField : [agentsField];
90
+ return paths.map(p => join(pluginDir, p));
91
+ }
92
+ //# sourceMappingURL=agents-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents-loader.js","sourceRoot":"","sources":["../../../src/plugins/loaders/agents-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG9E;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,QAAwB;IAExB,M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,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACvD,QAAQ,GAAG,MAAM,CAAC,QAAmC,CAAC;QACtD,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC3B,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAED,sEAAsE;IACtE,MAAM,SAAS,GAAI,QAAQ,CAAC,IAAe,IAAI,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEzE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,UAAU;QACV,SAAS;QACT,cAAc,EAAE,GAAG,UAAU,IAAI,SAAS,EAAE;QAC5C,QAAQ;QACR,OAAO;QACP,QAAQ;KACT,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CACvB,SAAiB,EACjB,WAA0C;IAE1C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACvE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Plugin Hooks Loader
3
+ *
4
+ * Discovers and merges hooks configuration from plugins.
5
+ * Supports both hooks/hooks.json files and inline manifest hooks config.
6
+ */
7
+ import type { HooksConfiguration } from '../../hooks/types.js';
8
+ import type { PluginManifest } from '../core/types.js';
9
+ /**
10
+ * Load hooks configuration from a plugin
11
+ *
12
+ * @param pluginDir - Absolute path to the plugin root
13
+ * @param manifest - Parsed plugin manifest
14
+ * @returns HooksConfiguration or null if no hooks found
15
+ */
16
+ export declare function loadPluginHooks(pluginDir: string, manifest: PluginManifest): Promise<HooksConfiguration | null>;
17
+ /**
18
+ * Merge plugin hooks into an existing hooks configuration
19
+ *
20
+ * Plugin hooks are appended to each event's matcher array (lower priority than profile hooks).
21
+ *
22
+ * @param base - Existing hooks configuration (from profile or defaults)
23
+ * @param pluginHooks - Hooks from a plugin
24
+ * @returns Merged hooks configuration
25
+ */
26
+ export declare function mergeHooks(base: HooksConfiguration, pluginHooks: HooksConfiguration): HooksConfiguration;
27
+ //# sourceMappingURL=hooks-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks-loader.d.ts","sourceRoot":"","sources":["../../../src/plugins/loaders/hooks-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,kBAAkB,EAAe,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CA4BpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,kBAAkB,GAC9B,kBAAkB,CAapB"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Plugin Hooks Loader
3
+ *
4
+ * Discovers and merges hooks configuration from plugins.
5
+ * Supports both hooks/hooks.json files and inline manifest hooks config.
6
+ */
7
+ import { readFile } from 'fs/promises';
8
+ import { join } from 'path';
9
+ import { existsSync } from 'fs';
10
+ import { logger } from '../../utils/logger.js';
11
+ import { expandPluginRoot } from '../core/manifest-parser.js';
12
+ /**
13
+ * Load hooks configuration from a plugin
14
+ *
15
+ * @param pluginDir - Absolute path to the plugin root
16
+ * @param manifest - Parsed plugin manifest
17
+ * @returns HooksConfiguration or null if no hooks found
18
+ */
19
+ export async function loadPluginHooks(pluginDir, manifest) {
20
+ const hooksField = manifest.hooks;
21
+ // Inline hooks configuration in manifest
22
+ if (hooksField && typeof hooksField === 'object' && !Array.isArray(hooksField)) {
23
+ return hooksField;
24
+ }
25
+ // Path(s) to hooks config files
26
+ const hooksPaths = resolveHooksPaths(pluginDir, hooksField);
27
+ for (const hooksPath of hooksPaths) {
28
+ if (!existsSync(hooksPath))
29
+ continue;
30
+ try {
31
+ const raw = await readFile(hooksPath, 'utf-8');
32
+ const parsed = JSON.parse(raw);
33
+ // Expand ${CLAUDE_PLUGIN_ROOT} in command strings
34
+ return expandHooksCommands(parsed, pluginDir);
35
+ }
36
+ catch (error) {
37
+ logger.debug(`[plugin] Failed to parse hooks from ${hooksPath}: ${error instanceof Error ? error.message : String(error)}`);
38
+ }
39
+ }
40
+ return null;
41
+ }
42
+ /**
43
+ * Merge plugin hooks into an existing hooks configuration
44
+ *
45
+ * Plugin hooks are appended to each event's matcher array (lower priority than profile hooks).
46
+ *
47
+ * @param base - Existing hooks configuration (from profile or defaults)
48
+ * @param pluginHooks - Hooks from a plugin
49
+ * @returns Merged hooks configuration
50
+ */
51
+ export function mergeHooks(base, pluginHooks) {
52
+ const merged = { ...base };
53
+ const events = Object.keys(pluginHooks);
54
+ for (const event of events) {
55
+ const pluginMatchers = pluginHooks[event];
56
+ if (!pluginMatchers || pluginMatchers.length === 0)
57
+ continue;
58
+ const baseMatchers = merged[event] || [];
59
+ merged[event] = [...baseMatchers, ...pluginMatchers];
60
+ }
61
+ return merged;
62
+ }
63
+ /**
64
+ * Resolve hooks file paths from manifest field or defaults
65
+ */
66
+ function resolveHooksPaths(pluginDir, hooksField) {
67
+ if (!hooksField || typeof hooksField === 'object') {
68
+ // Default: check hooks/hooks.json
69
+ return [join(pluginDir, 'hooks', 'hooks.json')];
70
+ }
71
+ const paths = Array.isArray(hooksField) ? hooksField : [hooksField];
72
+ return paths.map(p => join(pluginDir, p));
73
+ }
74
+ /**
75
+ * Expand ${CLAUDE_PLUGIN_ROOT} in all hook command strings
76
+ */
77
+ function expandHooksCommands(hooks, pluginDir) {
78
+ const result = {};
79
+ const events = Object.keys(hooks);
80
+ for (const event of events) {
81
+ const matchers = hooks[event];
82
+ if (!matchers)
83
+ continue;
84
+ result[event] = matchers.map((matcher) => ({
85
+ ...matcher,
86
+ hooks: matcher.hooks.map(hook => ({
87
+ ...hook,
88
+ ...(hook.command && { command: expandPluginRoot(hook.command, pluginDir) }),
89
+ })),
90
+ }));
91
+ }
92
+ return result;
93
+ }
94
+ //# sourceMappingURL=hooks-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks-loader.js","sourceRoot":"","sources":["../../../src/plugins/loaders/hooks-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAI9D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,SAAiB,EACjB,QAAwB;IAExB,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC;IAElC,yCAAyC;IACzC,IAAI,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/E,OAAO,UAAgC,CAAC;IAC1C,CAAC;IAED,gCAAgC;IAChC,MAAM,UAAU,GAAG,iBAAiB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAE5D,KAA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ugins.
5
+ * MCP servers are namespaced to avoid conflicts between plugins.
6
+ */
7
+ import type { McpConfig, PluginManifest } from '../core/types.js';
8
+ /**
9
+ * Load MCP server configuration from a plugin
10
+ *
11
+ * @param pluginDir - Absolute path to the plugin root
12
+ * @param manifest - Parsed plugin manifest
13
+ * @returns McpConfig with namespaced server names, or null if none found
14
+ */
15
+ export declare function loadPluginMcpServers(pluginDir: string, manifest: PluginManifest): Promise<McpConfig | null>;
16
+ /**
17
+ * Merge plugin MCP config into an existing MCP configuration
18
+ *
19
+ * @param base - Existing MCP config
20
+ * @param pluginMcp - MCP config from a plugin (already namespaced)
21
+ * @returns Merged MCP config
22
+ */
23
+ export declare function mergeMcpConfigs(base: McpConfig, pluginMcp: McpConfig): McpConfig;
24
+ //# sourceMappingURL=mcp-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-loader.d.ts","sourceRoot":"","sources":["../../../src/plugins/loaders/mcp-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,SAAS,EAAmB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEnF;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CA2B3B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAG,SAAS,CAOhF"}