@within-7/minto 0.3.9 → 0.4.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 (383) hide show
  1. package/dist/Tool.js.map +2 -2
  2. package/dist/commands/agents/AgentsCommand.js +461 -657
  3. package/dist/commands/agents/AgentsCommand.js.map +2 -2
  4. package/dist/commands/agents/types.js +1 -0
  5. package/dist/commands/agents/types.js.map +2 -2
  6. package/dist/commands/agents/utils/fileOperations.js +96 -36
  7. package/dist/commands/agents/utils/fileOperations.js.map +3 -3
  8. package/dist/commands/agents/utils/index.js +3 -1
  9. package/dist/commands/agents/utils/index.js.map +2 -2
  10. package/dist/commands/context.js +54 -23
  11. package/dist/commands/context.js.map +2 -2
  12. package/dist/commands/ctx_viz.js +1 -1
  13. package/dist/commands/effort.js +87 -0
  14. package/dist/commands/effort.js.map +7 -0
  15. package/dist/commands/export.js +684 -94
  16. package/dist/commands/export.js.map +2 -2
  17. package/dist/commands/ide.js +18 -0
  18. package/dist/commands/ide.js.map +7 -0
  19. package/dist/commands/language.js +19 -46
  20. package/dist/commands/language.js.map +2 -2
  21. package/dist/commands/mcp-interactive.js +425 -217
  22. package/dist/commands/mcp-interactive.js.map +2 -2
  23. package/dist/commands/memory.js +168 -0
  24. package/dist/commands/memory.js.map +7 -0
  25. package/dist/commands/model.js +457 -65
  26. package/dist/commands/model.js.map +2 -2
  27. package/dist/commands/outputStyle.js +64 -0
  28. package/dist/commands/outputStyle.js.map +7 -0
  29. package/dist/commands/permissions.js +75 -49
  30. package/dist/commands/permissions.js.map +2 -2
  31. package/dist/commands/plugin/utils.js +33 -1
  32. package/dist/commands/plugin/utils.js.map +2 -2
  33. package/dist/commands/plugin.js +891 -185
  34. package/dist/commands/plugin.js.map +3 -3
  35. package/dist/commands/refreshCommands.js +2 -0
  36. package/dist/commands/refreshCommands.js.map +2 -2
  37. package/dist/commands/resume.js +1 -1
  38. package/dist/commands/resume.js.map +1 -1
  39. package/dist/commands/review.js +51 -0
  40. package/dist/commands/review.js.map +7 -0
  41. package/dist/commands/sandbox.js +168 -70
  42. package/dist/commands/sandbox.js.map +2 -2
  43. package/dist/commands/setup.js +593 -107
  44. package/dist/commands/setup.js.map +2 -2
  45. package/dist/commands/stats.js +188 -131
  46. package/dist/commands/stats.js.map +2 -2
  47. package/dist/commands/status.js +75 -13
  48. package/dist/commands/status.js.map +2 -2
  49. package/dist/commands/terminalSetup.js +6 -0
  50. package/dist/commands/terminalSetup.js.map +2 -2
  51. package/dist/commands/undo.js +146 -174
  52. package/dist/commands/undo.js.map +2 -2
  53. package/dist/commands/vim.js +22 -0
  54. package/dist/commands/vim.js.map +7 -0
  55. package/dist/commands.js +12 -0
  56. package/dist/commands.js.map +2 -2
  57. package/dist/components/Help.js +165 -32
  58. package/dist/components/Help.js.map +2 -2
  59. package/dist/components/HighlightedCode.js +1 -0
  60. package/dist/components/HighlightedCode.js.map +2 -2
  61. package/dist/components/InfoPanel/InfoPanel.js +123 -0
  62. package/dist/components/InfoPanel/InfoPanel.js.map +7 -0
  63. package/dist/components/InfoPanel/index.js +5 -0
  64. package/dist/components/InfoPanel/index.js.map +7 -0
  65. package/dist/components/InfoPanel/types.js +1 -0
  66. package/dist/components/InfoPanel/types.js.map +7 -0
  67. package/dist/components/ModelSelector/BrandTextInput.js +43 -0
  68. package/dist/components/ModelSelector/BrandTextInput.js.map +7 -0
  69. package/dist/components/ModelSelector/ModelSelector.js +590 -565
  70. package/dist/components/ModelSelector/ModelSelector.js.map +2 -2
  71. package/dist/components/ModelSelector/WizardContainer.js +45 -0
  72. package/dist/components/ModelSelector/WizardContainer.js.map +7 -0
  73. package/dist/components/ModelSelector/index.js +1 -3
  74. package/dist/components/ModelSelector/index.js.map +2 -2
  75. package/dist/components/PromptInput.js +26 -11
  76. package/dist/components/PromptInput.js.map +2 -2
  77. package/dist/components/PulseLabel.js +44 -0
  78. package/dist/components/PulseLabel.js.map +7 -0
  79. package/dist/components/RequestStatusIndicator.js +1 -1
  80. package/dist/components/RequestStatusIndicator.js.map +1 -1
  81. package/dist/components/SimpleSelector/SimpleSelector.js +154 -0
  82. package/dist/components/SimpleSelector/SimpleSelector.js.map +7 -0
  83. package/dist/components/SimpleSelector/index.js +5 -0
  84. package/dist/components/SimpleSelector/index.js.map +7 -0
  85. package/dist/components/SimpleSelector/types.js +1 -0
  86. package/dist/components/SimpleSelector/types.js.map +7 -0
  87. package/dist/components/Spinner.js +12 -42
  88. package/dist/components/Spinner.js.map +3 -3
  89. package/dist/components/StartupStatus.js +57 -0
  90. package/dist/components/StartupStatus.js.map +7 -0
  91. package/dist/components/StatusOverlayContent.js +21 -0
  92. package/dist/components/StatusOverlayContent.js.map +7 -0
  93. package/dist/components/SubagentBlock.js +43 -6
  94. package/dist/components/SubagentBlock.js.map +2 -2
  95. package/dist/components/TabbedListView/ScrollableList.js +31 -5
  96. package/dist/components/TabbedListView/ScrollableList.js.map +2 -2
  97. package/dist/components/TabbedListView/TabBar.js +13 -8
  98. package/dist/components/TabbedListView/TabBar.js.map +2 -2
  99. package/dist/components/TabbedListView/TabbedListView.js +123 -48
  100. package/dist/components/TabbedListView/TabbedListView.js.map +2 -2
  101. package/dist/components/TodoPanel.js +1 -1
  102. package/dist/components/TodoPanel.js.map +1 -1
  103. package/dist/components/ToolUseLoader.js +5 -0
  104. package/dist/components/ToolUseLoader.js.map +2 -2
  105. package/dist/components/TrustDialog.js +0 -2
  106. package/dist/components/TrustDialog.js.map +2 -2
  107. package/dist/components/messages/TaskInModuleView.js +1 -1
  108. package/dist/components/messages/TaskInModuleView.js.map +2 -2
  109. package/dist/components/messages/TaskToolMessage.js +1 -1
  110. package/dist/components/messages/TaskToolMessage.js.map +2 -2
  111. package/dist/components/messages/UserPromptMessage.js +6 -1
  112. package/dist/components/messages/UserPromptMessage.js.map +2 -2
  113. package/dist/constants/modelCapabilities.js +103 -18
  114. package/dist/constants/modelCapabilities.js.map +2 -2
  115. package/dist/constants/product.js +2 -0
  116. package/dist/constants/product.js.map +2 -2
  117. package/dist/constants/prompts/agentPrompt.js +30 -0
  118. package/dist/constants/prompts/agentPrompt.js.map +7 -0
  119. package/dist/constants/prompts/codeConventions.js +27 -0
  120. package/dist/constants/prompts/codeConventions.js.map +7 -0
  121. package/dist/constants/prompts/doingTasks.js +15 -0
  122. package/dist/constants/prompts/doingTasks.js.map +7 -0
  123. package/dist/constants/prompts/envInfo.js +17 -0
  124. package/dist/constants/prompts/envInfo.js.map +7 -0
  125. package/dist/constants/prompts/executingWithCare.js +17 -0
  126. package/dist/constants/prompts/executingWithCare.js.map +7 -0
  127. package/dist/constants/prompts/identity.js +10 -0
  128. package/dist/constants/prompts/identity.js.map +7 -0
  129. package/dist/constants/prompts/index.js +78 -0
  130. package/dist/constants/prompts/index.js.map +7 -0
  131. package/dist/constants/prompts/taskManagement.js +60 -0
  132. package/dist/constants/prompts/taskManagement.js.map +7 -0
  133. package/dist/constants/prompts/toneAndStyle.js +62 -0
  134. package/dist/constants/prompts/toneAndStyle.js.map +7 -0
  135. package/dist/constants/prompts/toolUsagePolicy.js +38 -0
  136. package/dist/constants/prompts/toolUsagePolicy.js.map +7 -0
  137. package/dist/constants/prompts.js +5 -176
  138. package/dist/constants/prompts.js.map +2 -2
  139. package/dist/constants/providerRegistry.js +235 -0
  140. package/dist/constants/providerRegistry.js.map +7 -0
  141. package/dist/constants/providers.js +35 -0
  142. package/dist/constants/providers.js.map +7 -0
  143. package/dist/context/PermissionContext.js +0 -1
  144. package/dist/context/PermissionContext.js.map +2 -2
  145. package/dist/context.js +87 -31
  146. package/dist/context.js.map +2 -2
  147. package/dist/core/backupHook.js +29 -0
  148. package/dist/core/backupHook.js.map +7 -0
  149. package/dist/core/config/defaults.js +11 -2
  150. package/dist/core/config/defaults.js.map +2 -2
  151. package/dist/core/config/schema.js +21 -3
  152. package/dist/core/config/schema.js.map +2 -2
  153. package/dist/core/costTracker.js +18 -16
  154. package/dist/core/costTracker.js.map +2 -2
  155. package/dist/core/index.js +0 -1
  156. package/dist/core/index.js.map +2 -2
  157. package/dist/core/tokenStatsManager.js +22 -4
  158. package/dist/core/tokenStatsManager.js.map +2 -2
  159. package/dist/cost-tracker.js +0 -16
  160. package/dist/cost-tracker.js.map +2 -2
  161. package/dist/entrypoints/bootstrap.js +3 -1
  162. package/dist/entrypoints/bootstrap.js.map +2 -2
  163. package/dist/entrypoints/cli.js +81 -68
  164. package/dist/entrypoints/cli.js.map +2 -2
  165. package/dist/hooks/useAgentTokenStats.js +1 -1
  166. package/dist/hooks/useAgentTokenStats.js.map +2 -2
  167. package/dist/hooks/useAgentTranscripts.js +2 -1
  168. package/dist/hooks/useAgentTranscripts.js.map +2 -2
  169. package/dist/hooks/useBackgroundShells.js +29 -0
  170. package/dist/hooks/useBackgroundShells.js.map +7 -0
  171. package/dist/hooks/useCanUseTool.js +1 -1
  172. package/dist/hooks/useCanUseTool.js.map +2 -2
  173. package/dist/hooks/useDeferredLoading.js +64 -0
  174. package/dist/hooks/useDeferredLoading.js.map +7 -0
  175. package/dist/hooks/useHookStatus.js +1 -1
  176. package/dist/hooks/useHookStatus.js.map +2 -2
  177. package/dist/hooks/useSessionTracking.js +55 -0
  178. package/dist/hooks/useSessionTracking.js.map +7 -0
  179. package/dist/hooks/useTerminalSize.js +21 -0
  180. package/dist/hooks/useTerminalSize.js.map +2 -2
  181. package/dist/hooks/useTextInput.js +1 -0
  182. package/dist/hooks/useTextInput.js.map +2 -2
  183. package/dist/hooks/useUnifiedCompletion.js +3 -2
  184. package/dist/hooks/useUnifiedCompletion.js.map +2 -2
  185. package/dist/i18n/locales/en.js +299 -1
  186. package/dist/i18n/locales/en.js.map +2 -2
  187. package/dist/i18n/locales/zh-CN.js +300 -2
  188. package/dist/i18n/locales/zh-CN.js.map +2 -2
  189. package/dist/i18n/types.js.map +1 -1
  190. package/dist/messages.js +41 -17
  191. package/dist/messages.js.map +2 -2
  192. package/dist/permissions.js +94 -1
  193. package/dist/permissions.js.map +2 -2
  194. package/dist/query.js +27 -19
  195. package/dist/query.js.map +2 -2
  196. package/dist/screens/REPL.js +83 -74
  197. package/dist/screens/REPL.js.map +2 -2
  198. package/dist/services/adapters/responsesAPI.js +6 -0
  199. package/dist/services/adapters/responsesAPI.js.map +2 -2
  200. package/dist/services/agentTeams/index.js +35 -0
  201. package/dist/services/agentTeams/index.js.map +7 -0
  202. package/dist/services/agentTeams/mailbox.js +114 -0
  203. package/dist/services/agentTeams/mailbox.js.map +7 -0
  204. package/dist/services/agentTeams/teamManager.js +149 -0
  205. package/dist/services/agentTeams/teamManager.js.map +7 -0
  206. package/dist/services/agentTeams/teamTaskStore.js +114 -0
  207. package/dist/services/agentTeams/teamTaskStore.js.map +7 -0
  208. package/dist/services/agentTeams/teammateSpawner.js +80 -0
  209. package/dist/services/agentTeams/teammateSpawner.js.map +7 -0
  210. package/dist/services/checkpointManager.js +16 -3
  211. package/dist/services/checkpointManager.js.map +2 -2
  212. package/dist/services/claude.js +19 -1728
  213. package/dist/services/claude.js.map +3 -3
  214. package/dist/services/customCommands.js +30 -8
  215. package/dist/services/customCommands.js.map +2 -2
  216. package/dist/services/gpt5ConnectionTest.js +4 -2
  217. package/dist/services/gpt5ConnectionTest.js.map +2 -2
  218. package/dist/services/hookExecutor.js +411 -127
  219. package/dist/services/hookExecutor.js.map +2 -2
  220. package/dist/services/llm/anthropicProvider.js +807 -0
  221. package/dist/services/llm/anthropicProvider.js.map +7 -0
  222. package/dist/services/llm/dispatch.js +218 -0
  223. package/dist/services/llm/dispatch.js.map +7 -0
  224. package/dist/services/llm/index.js +44 -0
  225. package/dist/services/llm/index.js.map +7 -0
  226. package/dist/services/llm/mintoContext.js +69 -0
  227. package/dist/services/llm/mintoContext.js.map +7 -0
  228. package/dist/services/llm/openaiProvider.js +622 -0
  229. package/dist/services/llm/openaiProvider.js.map +7 -0
  230. package/dist/services/llm/types.js +157 -0
  231. package/dist/services/llm/types.js.map +7 -0
  232. package/dist/services/mcpClient.js +183 -33
  233. package/dist/services/mcpClient.js.map +2 -2
  234. package/dist/services/notifier.js +14 -0
  235. package/dist/services/notifier.js.map +2 -2
  236. package/dist/services/oauth.js +4 -2
  237. package/dist/services/oauth.js.map +2 -2
  238. package/dist/services/openai.js +66 -56
  239. package/dist/services/openai.js.map +3 -3
  240. package/dist/services/outputStyles.js +102 -21
  241. package/dist/services/outputStyles.js.map +2 -2
  242. package/dist/services/plugins/lspServers.js +1 -1
  243. package/dist/services/plugins/lspServers.js.map +2 -2
  244. package/dist/services/plugins/pluginRuntime.js +2 -1
  245. package/dist/services/plugins/pluginRuntime.js.map +2 -2
  246. package/dist/services/plugins/pluginValidation.js +10 -3
  247. package/dist/services/plugins/pluginValidation.js.map +2 -2
  248. package/dist/services/plugins/skillMarketplace.js +20 -9
  249. package/dist/services/plugins/skillMarketplace.js.map +2 -2
  250. package/dist/services/sentry.js +1 -1
  251. package/dist/services/sentry.js.map +2 -2
  252. package/dist/services/sessionMemory.js +16 -3
  253. package/dist/services/sessionMemory.js.map +2 -2
  254. package/dist/services/systemReminder.js +367 -9
  255. package/dist/services/systemReminder.js.map +2 -2
  256. package/dist/services/taskStore.js +19 -0
  257. package/dist/services/taskStore.js.map +2 -2
  258. package/dist/tools/ArchitectTool/ArchitectTool.js.map +1 -1
  259. package/dist/tools/AskUserQuestionTool/AskUserQuestionTool.js.map +1 -1
  260. package/dist/tools/BashOutputTool/BashOutputTool.js.map +1 -1
  261. package/dist/tools/BashTool/BashTool.js +28 -0
  262. package/dist/tools/BashTool/BashTool.js.map +2 -2
  263. package/dist/tools/FileEditTool/FileEditTool.js +8 -1
  264. package/dist/tools/FileEditTool/FileEditTool.js.map +2 -2
  265. package/dist/tools/FileReadTool/FileReadTool.js +14 -0
  266. package/dist/tools/FileReadTool/FileReadTool.js.map +2 -2
  267. package/dist/tools/FileWriteTool/FileWriteTool.js +10 -1
  268. package/dist/tools/FileWriteTool/FileWriteTool.js.map +2 -2
  269. package/dist/tools/GlobTool/GlobTool.js.map +1 -1
  270. package/dist/tools/GrepTool/GrepTool.js.map +1 -1
  271. package/dist/tools/KillShellTool/KillShellTool.js.map +1 -1
  272. package/dist/tools/ListMcpResourcesTool/ListMcpResourcesTool.js.map +2 -2
  273. package/dist/tools/LspTool/LspTool.js +11 -2
  274. package/dist/tools/LspTool/LspTool.js.map +2 -2
  275. package/dist/tools/MCPTool/MCPTool.js.map +1 -1
  276. package/dist/tools/MemoryReadTool/MemoryReadTool.js +2 -1
  277. package/dist/tools/MemoryReadTool/MemoryReadTool.js.map +2 -2
  278. package/dist/tools/MemoryWriteTool/MemoryWriteTool.js +2 -1
  279. package/dist/tools/MemoryWriteTool/MemoryWriteTool.js.map +2 -2
  280. package/dist/tools/MultiEditTool/MultiEditTool.js +7 -0
  281. package/dist/tools/MultiEditTool/MultiEditTool.js.map +2 -2
  282. package/dist/tools/NotebookEditTool/NotebookEditTool.js +2 -0
  283. package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +2 -2
  284. package/dist/tools/NotebookReadTool/NotebookReadTool.js.map +1 -1
  285. package/dist/tools/PlanModeTool/EnterPlanModeTool.js +8 -2
  286. package/dist/tools/PlanModeTool/EnterPlanModeTool.js.map +2 -2
  287. package/dist/tools/PlanModeTool/ExitPlanModeTool.js +2 -0
  288. package/dist/tools/PlanModeTool/ExitPlanModeTool.js.map +2 -2
  289. package/dist/tools/ReadMcpResourceTool/ReadMcpResourceTool.js.map +1 -1
  290. package/dist/tools/SlashCommandTool/SlashCommandTool.js +174 -18
  291. package/dist/tools/SlashCommandTool/SlashCommandTool.js.map +3 -3
  292. package/dist/tools/TaskCreateTool/TaskCreateTool.js.map +1 -1
  293. package/dist/tools/TaskGetTool/TaskGetTool.js.map +1 -1
  294. package/dist/tools/TaskListTool/TaskListTool.js.map +1 -1
  295. package/dist/tools/TaskOutputTool/TaskOutputTool.js.map +1 -1
  296. package/dist/tools/TaskStopTool/TaskStopTool.js.map +1 -1
  297. package/dist/tools/TaskTool/TaskTool.js +84 -11
  298. package/dist/tools/TaskTool/TaskTool.js.map +2 -2
  299. package/dist/tools/TaskTool/prompt.js +12 -6
  300. package/dist/tools/TaskTool/prompt.js.map +2 -2
  301. package/dist/tools/TaskUpdateTool/TaskUpdateTool.js.map +1 -1
  302. package/dist/tools/ThinkTool/ThinkTool.js.map +1 -1
  303. package/dist/tools/TodoWriteTool/TodoWriteTool.js.map +1 -1
  304. package/dist/tools/URLFetcherTool/URLFetcherTool.js.map +1 -1
  305. package/dist/tools/WebSearchTool/WebSearchTool.js.map +1 -1
  306. package/dist/tools/WebSearchTool/searchProviders.js +2 -1
  307. package/dist/tools/WebSearchTool/searchProviders.js.map +2 -2
  308. package/dist/tools/lsTool/lsTool.js.map +2 -2
  309. package/dist/tools/lsTool/prompt.js.map +1 -1
  310. package/dist/tools.js +14 -3
  311. package/dist/tools.js.map +2 -2
  312. package/dist/types/PermissionMode.js +21 -1
  313. package/dist/types/PermissionMode.js.map +2 -2
  314. package/dist/types/agentTeams.js +1 -0
  315. package/dist/types/agentTeams.js.map +7 -0
  316. package/dist/types/hooks.js +8 -2
  317. package/dist/types/hooks.js.map +2 -2
  318. package/dist/types/plugin.js +3 -5
  319. package/dist/types/plugin.js.map +2 -2
  320. package/dist/utils/agentHookExecutor.js +1 -4
  321. package/dist/utils/agentHookExecutor.js.map +2 -2
  322. package/dist/utils/agentLoader.js +91 -15
  323. package/dist/utils/agentLoader.js.map +2 -2
  324. package/dist/utils/agentMemory.js.map +2 -2
  325. package/dist/utils/animationManager.js +1 -1
  326. package/dist/utils/animationManager.js.map +2 -2
  327. package/dist/utils/ask.js +1 -1
  328. package/dist/utils/async.js +5 -1
  329. package/dist/utils/async.js.map +2 -2
  330. package/dist/utils/autoCompactCore.js +60 -0
  331. package/dist/utils/autoCompactCore.js.map +2 -2
  332. package/dist/utils/claudeCodeSync.js +439 -0
  333. package/dist/utils/claudeCodeSync.js.map +7 -0
  334. package/dist/utils/config.js +27 -151
  335. package/dist/utils/config.js.map +2 -2
  336. package/dist/utils/configSchema.js +227 -0
  337. package/dist/utils/configSchema.js.map +7 -0
  338. package/dist/utils/debugLogger.js.map +2 -2
  339. package/dist/utils/env.js +4 -3
  340. package/dist/utils/env.js.map +2 -2
  341. package/dist/utils/envConfig.js +34 -0
  342. package/dist/utils/envConfig.js.map +3 -3
  343. package/dist/utils/execFileNoThrow.js +2 -1
  344. package/dist/utils/execFileNoThrow.js.map +2 -2
  345. package/dist/utils/gpt5.js +146 -0
  346. package/dist/utils/gpt5.js.map +7 -0
  347. package/dist/utils/hookManager.js +374 -140
  348. package/dist/utils/hookManager.js.map +2 -2
  349. package/dist/utils/markdown.js +47 -0
  350. package/dist/utils/markdown.js.map +2 -2
  351. package/dist/utils/marketplaceManager.js +80 -43
  352. package/dist/utils/marketplaceManager.js.map +2 -2
  353. package/dist/utils/memoizeWithTTL.js +25 -0
  354. package/dist/utils/memoizeWithTTL.js.map +7 -0
  355. package/dist/utils/messages.js +2 -2
  356. package/dist/utils/messages.js.map +2 -2
  357. package/dist/utils/model.js +34 -9
  358. package/dist/utils/model.js.map +2 -2
  359. package/dist/utils/pluginInstaller.js +68 -29
  360. package/dist/utils/pluginInstaller.js.map +2 -2
  361. package/dist/utils/pluginLoader.js +249 -57
  362. package/dist/utils/pluginLoader.js.map +2 -2
  363. package/dist/utils/repoFetcher.js +110 -0
  364. package/dist/utils/repoFetcher.js.map +7 -0
  365. package/dist/utils/safeFetch.js +45 -0
  366. package/dist/utils/safeFetch.js.map +7 -0
  367. package/dist/utils/skillLoader.js +77 -12
  368. package/dist/utils/skillLoader.js.map +2 -2
  369. package/dist/utils/streamingState.js +52 -0
  370. package/dist/utils/streamingState.js.map +7 -0
  371. package/dist/utils/stringSubstitution.js +4 -5
  372. package/dist/utils/stringSubstitution.js.map +2 -2
  373. package/dist/utils/style.js +6 -3
  374. package/dist/utils/style.js.map +2 -2
  375. package/dist/utils/teamConfig.js +162 -16
  376. package/dist/utils/teamConfig.js.map +2 -2
  377. package/dist/utils/terminal.js +1 -1
  378. package/dist/utils/terminal.js.map +2 -2
  379. package/dist/utils/toolRiskClassification.js +0 -6
  380. package/dist/utils/toolRiskClassification.js.map +2 -2
  381. package/dist/version.js +2 -2
  382. package/dist/version.js.map +1 -1
  383. package/package.json +7 -6
@@ -5,23 +5,48 @@ import {
5
5
  statSync,
6
6
  writeFileSync
7
7
  } from "fs";
8
- import { join, basename } from "path";
8
+ import { debug as debugLogger } from "./debugLogger.js";
9
+ import { join, resolve, basename } from "path";
9
10
  import { homedir } from "os";
10
11
  import matter from "gray-matter";
12
+ import { validatePluginDirectory } from "../services/plugins/pluginValidation.js";
11
13
  import {
12
14
  PluginManifestSchema,
13
15
  PluginError,
14
16
  PluginErrorCode
15
17
  } from "../types/plugin.js";
16
18
  import { getCwd } from "./state.js";
19
+ let extraPluginDirs = [];
20
+ function addExtraPluginDir(dir) {
21
+ const resolved = resolve(dir);
22
+ if (!extraPluginDirs.includes(resolved)) {
23
+ extraPluginDirs.push(resolved);
24
+ }
25
+ }
26
+ function getManagedPluginsDir() {
27
+ if (process.platform === "darwin") {
28
+ return "/Library/Application Support/Minto/managed-plugins";
29
+ }
30
+ return "/etc/minto/managed-plugins";
31
+ }
17
32
  function getPluginDirectories() {
18
33
  const cwd = getCwd();
19
34
  const home = homedir();
20
35
  return [
36
+ getManagedPluginsDir(),
37
+ // Managed (enterprise, read-only, lowest)
38
+ join(home, ".claude", "plugins"),
39
+ // User global (legacy)
21
40
  join(home, ".minto", "plugins"),
22
41
  // User global
23
- join(cwd, ".minto", "plugins")
24
- // Project (highest priority)
42
+ join(cwd, ".claude", "plugins"),
43
+ // Project (legacy)
44
+ join(cwd, ".minto", "plugins"),
45
+ // Project
46
+ join(cwd, ".minto", "plugins.local"),
47
+ // Project local (gitignored)
48
+ ...extraPluginDirs
49
+ // CLI --plugin-dir (highest priority)
25
50
  ];
26
51
  }
27
52
  function discoverPluginPaths() {
@@ -39,8 +64,13 @@ function discoverPluginPaths() {
39
64
  ".minto-plugin",
40
65
  "plugin.json"
41
66
  );
67
+ const claudeManifestPath = join(
68
+ pluginPath,
69
+ ".claude-plugin",
70
+ "plugin.json"
71
+ );
42
72
  const rootManifestPath = join(pluginPath, "plugin.json");
43
- if (!existsSync(mintoManifestPath) && !existsSync(rootManifestPath))
73
+ if (!existsSync(mintoManifestPath) && !existsSync(claudeManifestPath) && !existsSync(rootManifestPath))
44
74
  continue;
45
75
  pluginPaths.set(entry, pluginPath);
46
76
  }
@@ -50,35 +80,35 @@ function discoverPluginPaths() {
50
80
  return pluginPaths;
51
81
  }
52
82
  function loadManifest(pluginPath) {
53
- const mintoPluginManifest = join(pluginPath, ".minto-plugin", "plugin.json");
54
- const rootManifest = join(pluginPath, "plugin.json");
55
- let manifestPath = null;
56
- if (existsSync(mintoPluginManifest)) {
57
- manifestPath = mintoPluginManifest;
58
- } else if (existsSync(rootManifest)) {
59
- manifestPath = rootManifest;
60
- }
61
- if (!manifestPath) {
83
+ const candidates = [
84
+ join(pluginPath, ".minto-plugin", "plugin.json"),
85
+ join(pluginPath, ".claude-plugin", "plugin.json"),
86
+ join(pluginPath, "plugin.json")
87
+ ];
88
+ const existing = candidates.filter((p) => existsSync(p));
89
+ if (existing.length === 0) {
62
90
  throw new PluginError(
63
91
  `Plugin manifest not found. Tried:
64
- - ${mintoPluginManifest}
65
- - ${rootManifest}`,
92
+ ${candidates.map((p) => ` - ${p}`).join("\n")}`,
66
93
  PluginErrorCode.MANIFEST_NOT_FOUND
67
94
  );
68
95
  }
69
- try {
70
- const manifestContent = readFileSync(manifestPath, "utf-8");
71
- const manifestData = JSON.parse(manifestContent);
72
- const manifest = PluginManifestSchema.parse(manifestData);
73
- return manifest;
74
- } catch (error) {
75
- throw new PluginError(
76
- `Invalid plugin manifest at ${manifestPath}: ${error instanceof Error ? error.message : String(error)}`,
77
- PluginErrorCode.MANIFEST_INVALID,
78
- void 0,
79
- error
80
- );
96
+ let lastError = null;
97
+ for (const manifestPath of existing) {
98
+ try {
99
+ const manifestContent = readFileSync(manifestPath, "utf-8");
100
+ const manifestData = JSON.parse(manifestContent);
101
+ return PluginManifestSchema.parse(manifestData);
102
+ } catch (error) {
103
+ lastError = error;
104
+ }
81
105
  }
106
+ throw new PluginError(
107
+ `Invalid plugin manifest at ${existing[0]}: ${lastError instanceof Error ? lastError.message : String(lastError)}`,
108
+ PluginErrorCode.MANIFEST_INVALID,
109
+ void 0,
110
+ lastError
111
+ );
82
112
  }
83
113
  function loadAgents(pluginPath, manifest) {
84
114
  const agents = [];
@@ -86,7 +116,7 @@ function loadAgents(pluginPath, manifest) {
86
116
  for (const agentPath of manifest.agents || []) {
87
117
  const fullPath = join(pluginPath, agentPath);
88
118
  if (!existsSync(fullPath)) {
89
- console.warn(`Agent file not found: ${fullPath}`);
119
+ debugLogger.warn("PLUGIN_LOADER", `Agent file not found: ${fullPath}`);
90
120
  continue;
91
121
  }
92
122
  try {
@@ -105,7 +135,10 @@ function loadAgents(pluginPath, manifest) {
105
135
  pluginName: manifest.name
106
136
  });
107
137
  } catch (error) {
108
- console.error(`Error loading agent ${agentPath}:`, error);
138
+ debugLogger.warn(
139
+ "PLUGIN_LOADER",
140
+ `Error loading agent ${agentPath}: ${error instanceof Error ? error.message : String(error)}`
141
+ );
109
142
  }
110
143
  }
111
144
  if (existsSync(agentsDir) && statSync(agentsDir).isDirectory()) {
@@ -129,7 +162,10 @@ function loadAgents(pluginPath, manifest) {
129
162
  pluginName: manifest.name
130
163
  });
131
164
  } catch (error) {
132
- console.error(`Error loading agent ${file}:`, error);
165
+ debugLogger.warn(
166
+ "PLUGIN_LOADER",
167
+ `Error loading agent ${file}: ${error instanceof Error ? error.message : String(error)}`
168
+ );
133
169
  }
134
170
  }
135
171
  }
@@ -141,7 +177,7 @@ function loadCommands(pluginPath, manifest) {
141
177
  for (const commandPath of manifest.commands || []) {
142
178
  const fullPath = join(pluginPath, commandPath);
143
179
  if (!existsSync(fullPath)) {
144
- console.warn(`Command file not found: ${fullPath}`);
180
+ debugLogger.warn("PLUGIN_LOADER", `Command file not found: ${fullPath}`);
145
181
  continue;
146
182
  }
147
183
  try {
@@ -164,7 +200,10 @@ function loadCommands(pluginPath, manifest) {
164
200
  pluginName: manifest.name
165
201
  });
166
202
  } catch (error) {
167
- console.error(`Error loading command ${commandPath}:`, error);
203
+ debugLogger.warn(
204
+ "PLUGIN_LOADER",
205
+ `Error loading command ${commandPath}: ${error instanceof Error ? error.message : String(error)}`
206
+ );
168
207
  }
169
208
  }
170
209
  if (existsSync(commandsDir) && statSync(commandsDir).isDirectory()) {
@@ -192,7 +231,10 @@ function loadCommands(pluginPath, manifest) {
192
231
  pluginName: manifest.name
193
232
  });
194
233
  } catch (error) {
195
- console.error(`Error loading command ${file}:`, error);
234
+ debugLogger.warn(
235
+ "PLUGIN_LOADER",
236
+ `Error loading command ${file}: ${error instanceof Error ? error.message : String(error)}`
237
+ );
196
238
  }
197
239
  }
198
240
  }
@@ -204,7 +246,7 @@ function loadSkills(pluginPath, manifest) {
204
246
  for (const skillPath of manifest.skills || []) {
205
247
  const fullPath = join(pluginPath, skillPath);
206
248
  if (!existsSync(fullPath)) {
207
- console.warn(`Skill file not found: ${fullPath}`);
249
+ debugLogger.warn("PLUGIN_LOADER", `Skill file not found: ${fullPath}`);
208
250
  continue;
209
251
  }
210
252
  try {
@@ -222,7 +264,10 @@ function loadSkills(pluginPath, manifest) {
222
264
  source: "plugin"
223
265
  });
224
266
  } catch (error) {
225
- console.error(`Error loading skill ${skillPath}:`, error);
267
+ debugLogger.warn(
268
+ "PLUGIN_LOADER",
269
+ `Error loading skill ${skillPath}: ${error instanceof Error ? error.message : String(error)}`
270
+ );
226
271
  }
227
272
  }
228
273
  if (existsSync(skillsDir) && statSync(skillsDir).isDirectory()) {
@@ -247,7 +292,10 @@ function loadSkills(pluginPath, manifest) {
247
292
  source: "plugin"
248
293
  });
249
294
  } catch (error) {
250
- console.error(`Error loading skill from ${skillMdPath}:`, error);
295
+ debugLogger.warn(
296
+ "PLUGIN_LOADER",
297
+ `Error loading skill from ${skillMdPath}: ${error instanceof Error ? error.message : String(error)}`
298
+ );
251
299
  }
252
300
  }
253
301
  } else if (entry.isFile() && entry.name.endsWith(".md")) {
@@ -268,7 +316,10 @@ function loadSkills(pluginPath, manifest) {
268
316
  source: "plugin"
269
317
  });
270
318
  } catch (error) {
271
- console.error(`Error loading skill ${entry.name}:`, error);
319
+ debugLogger.warn(
320
+ "PLUGIN_LOADER",
321
+ `Error loading skill ${entry.name}: ${error instanceof Error ? error.message : String(error)}`
322
+ );
272
323
  }
273
324
  }
274
325
  }
@@ -286,7 +337,10 @@ function loadHooks(pluginPath, manifest) {
286
337
  const content = readFileSync(hooksJsonPath, "utf-8");
287
338
  const hooksConfig = JSON.parse(content);
288
339
  if (!hooksConfig.hooks || typeof hooksConfig.hooks !== "object") {
289
- console.warn(`Invalid hooks.json in ${pluginPath}: missing "hooks" field`);
340
+ debugLogger.warn(
341
+ "PLUGIN_LOADER",
342
+ `Invalid hooks.json in ${pluginPath}: missing "hooks" field`
343
+ );
290
344
  return hooks;
291
345
  }
292
346
  for (const [eventName, matchers] of Object.entries(
@@ -304,8 +358,7 @@ function loadHooks(pluginPath, manifest) {
304
358
  matcher: matcher.matcher,
305
359
  type: hookDef.type || "command",
306
360
  command: hookDef.command,
307
- message: hookDef.prompt,
308
- // Claude Code uses "prompt", we use "message" internally
361
+ prompt: hookDef.prompt,
309
362
  blocking: hookDef.type === "prompt",
310
363
  timeout: hookDef.timeout || 60
311
364
  },
@@ -317,17 +370,22 @@ function loadHooks(pluginPath, manifest) {
317
370
  }
318
371
  }
319
372
  } catch (error) {
320
- console.error(`Error loading hooks from ${hooksJsonPath}:`, error);
373
+ debugLogger.warn(
374
+ "PLUGIN_LOADER",
375
+ `Error loading hooks from ${hooksJsonPath}: ${error instanceof Error ? error.message : String(error)}`
376
+ );
321
377
  }
322
378
  return hooks;
323
379
  }
324
380
  function expandEnvVars(value, pluginPath) {
325
381
  let expanded = value.replace(/\$\{MINTO_PLUGIN_ROOT\}/g, pluginPath);
326
382
  expanded = expanded.replace(/\$MINTO_PLUGIN_ROOT(?![A-Za-z_])/g, pluginPath);
383
+ expanded = expanded.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g, pluginPath);
384
+ expanded = expanded.replace(/\$CLAUDE_PLUGIN_ROOT(?![A-Za-z_])/g, pluginPath);
327
385
  expanded = expanded.replace(
328
386
  /\$\{([^}:]+)(?::-([^}]*))?\}/g,
329
387
  (match, varName, defaultValue) => {
330
- if (varName === "MINTO_PLUGIN_ROOT") {
388
+ if (varName === "MINTO_PLUGIN_ROOT" || varName === "CLAUDE_PLUGIN_ROOT") {
331
389
  return match;
332
390
  }
333
391
  return process.env[varName] || defaultValue || "";
@@ -378,7 +436,10 @@ function loadMCPServers(pluginPath, manifest) {
378
436
  mcpJsonServers = parsed.mcpServers;
379
437
  }
380
438
  } catch (error) {
381
- console.error(`Error loading .mcp.json from ${pluginPath}:`, error);
439
+ debugLogger.warn(
440
+ "PLUGIN_LOADER",
441
+ `Error loading .mcp.json from ${pluginPath}: ${error instanceof Error ? error.message : String(error)}`
442
+ );
382
443
  }
383
444
  }
384
445
  let inlineServers = {};
@@ -391,13 +452,15 @@ function loadMCPServers(pluginPath, manifest) {
391
452
  const expandedConfig = expandServerConfig(config, pluginPath);
392
453
  const serverType = expandedConfig.type || "stdio";
393
454
  if (serverType === "stdio" && !expandedConfig.command) {
394
- console.warn(
455
+ debugLogger.warn(
456
+ "PLUGIN_LOADER",
395
457
  `MCP server "${name}" in ${manifest.name} is missing required "command" field for stdio type`
396
458
  );
397
459
  continue;
398
460
  }
399
461
  if ((serverType === "http" || serverType === "sse") && !expandedConfig.url) {
400
- console.warn(
462
+ debugLogger.warn(
463
+ "PLUGIN_LOADER",
401
464
  `MCP server "${name}" in ${manifest.name} is missing required "url" field for ${serverType} type`
402
465
  );
403
466
  continue;
@@ -414,17 +477,87 @@ function loadMCPServers(pluginPath, manifest) {
414
477
  pluginName: manifest.name
415
478
  });
416
479
  } catch (error) {
417
- console.error(
418
- `Error loading MCP server "${name}" from ${manifest.name}:`,
419
- error
480
+ debugLogger.warn(
481
+ "PLUGIN_LOADER",
482
+ `Error loading MCP server "${name}" from ${manifest.name}: ${error instanceof Error ? error.message : String(error)}`
420
483
  );
421
484
  }
422
485
  }
423
486
  return mcpServers;
424
487
  }
488
+ function loadLSPServers(pluginPath, manifest) {
489
+ const lspServers = [];
490
+ const lspJsonPath = join(pluginPath, ".lsp.json");
491
+ let lspJsonServers = {};
492
+ if (existsSync(lspJsonPath)) {
493
+ try {
494
+ const content = readFileSync(lspJsonPath, "utf-8");
495
+ const parsed = JSON.parse(content);
496
+ if (parsed.lspServers && typeof parsed.lspServers === "object") {
497
+ lspJsonServers = parsed.lspServers;
498
+ } else if (typeof parsed === "object" && !Array.isArray(parsed)) {
499
+ lspJsonServers = parsed;
500
+ }
501
+ } catch (error) {
502
+ debugLogger.warn(
503
+ "PLUGIN_LOADER",
504
+ `Error loading .lsp.json from ${pluginPath}: ${error instanceof Error ? error.message : String(error)}`
505
+ );
506
+ }
507
+ }
508
+ const manifestData = manifest;
509
+ let inlineServers = {};
510
+ if (manifestData.lspServers && typeof manifestData.lspServers === "object" && !Array.isArray(manifestData.lspServers)) {
511
+ inlineServers = manifestData.lspServers;
512
+ }
513
+ const allServers = { ...lspJsonServers, ...inlineServers };
514
+ for (const [name, config] of Object.entries(allServers)) {
515
+ try {
516
+ const expandedConfig = expandServerConfig(config, pluginPath);
517
+ if (!expandedConfig.command) {
518
+ debugLogger.warn(
519
+ "PLUGIN_LOADER",
520
+ `LSP server "${name}" in ${manifest.name} is missing required "command" field`
521
+ );
522
+ continue;
523
+ }
524
+ lspServers.push({
525
+ name,
526
+ filePath: existsSync(lspJsonPath) ? lspJsonPath : join(pluginPath, "plugin.json"),
527
+ config: {
528
+ command: expandedConfig.command,
529
+ args: expandedConfig.args || [],
530
+ env: expandedConfig.env || {},
531
+ filePatterns: expandedConfig.filePatterns,
532
+ languages: expandedConfig.languages,
533
+ initializationOptions: expandedConfig.initializationOptions
534
+ },
535
+ pluginName: manifest.name
536
+ });
537
+ } catch (error) {
538
+ debugLogger.warn(
539
+ "PLUGIN_LOADER",
540
+ `Error loading LSP server "${name}" from ${manifest.name}: ${error instanceof Error ? error.message : String(error)}`
541
+ );
542
+ }
543
+ }
544
+ return lspServers;
545
+ }
425
546
  function determinePluginSource(pluginPath) {
426
547
  const home = homedir();
427
548
  const cwd = getCwd();
549
+ const ccSyncPath = join(pluginPath, ".cc-sync.json");
550
+ if (existsSync(ccSyncPath)) {
551
+ try {
552
+ const ccMeta = JSON.parse(readFileSync(ccSyncPath, "utf-8"));
553
+ return {
554
+ type: "claude-code",
555
+ marketplace: ccMeta.marketplace || "",
556
+ name: ccMeta.name || basename(pluginPath)
557
+ };
558
+ } catch {
559
+ }
560
+ }
428
561
  const marketplaceMetaPath = join(pluginPath, ".marketplace-meta.json");
429
562
  if (existsSync(marketplaceMetaPath)) {
430
563
  try {
@@ -438,22 +571,63 @@ function determinePluginSource(pluginPath) {
438
571
  };
439
572
  }
440
573
  } catch (error) {
441
- console.warn(
442
- `Failed to read marketplace metadata from ${marketplaceMetaPath}:`,
443
- error
574
+ debugLogger.warn(
575
+ "PLUGIN_LOADER",
576
+ `Failed to read marketplace metadata from ${marketplaceMetaPath}: ${error instanceof Error ? error.message : String(error)}`
444
577
  );
445
578
  }
446
579
  }
447
- if (pluginPath.startsWith(join(home, ".minto", "plugins"))) {
580
+ const managedDir = getManagedPluginsDir();
581
+ if (pluginPath.startsWith(managedDir)) {
582
+ return { type: "local", path: "managed" };
583
+ } else if (pluginPath.startsWith(join(home, ".minto", "plugins"))) {
448
584
  return { type: "local", path: "user-global" };
585
+ } else if (pluginPath.startsWith(join(cwd, ".minto", "plugins.local"))) {
586
+ return { type: "local", path: "local" };
449
587
  } else if (pluginPath.startsWith(join(cwd, ".minto", "plugins"))) {
450
588
  return { type: "local", path: "project" };
451
589
  } else {
452
590
  return { type: "local", path: pluginPath };
453
591
  }
454
592
  }
593
+ function loadPluginSettings(pluginPath) {
594
+ const settingsPaths = [
595
+ join(pluginPath, ".minto-plugin", "settings.json"),
596
+ join(pluginPath, ".claude-plugin", "settings.json"),
597
+ join(pluginPath, "settings.json")
598
+ ];
599
+ for (const settingsPath of settingsPaths) {
600
+ if (!existsSync(settingsPath)) continue;
601
+ try {
602
+ const content = readFileSync(settingsPath, "utf-8");
603
+ const parsed = JSON.parse(content);
604
+ if (parsed.agent && typeof parsed.agent === "object") {
605
+ return parsed.agent;
606
+ }
607
+ return parsed;
608
+ } catch (error) {
609
+ debugLogger.warn(
610
+ "PLUGIN_LOADER",
611
+ `Failed to parse plugin settings from ${settingsPath}: ${error instanceof Error ? error.message : String(error)}`
612
+ );
613
+ }
614
+ }
615
+ return null;
616
+ }
455
617
  function loadPlugin(pluginPath) {
456
618
  const manifest = loadManifest(pluginPath);
619
+ try {
620
+ const validation = validatePluginDirectory(pluginPath);
621
+ if (validation.warnings.length > 0) {
622
+ for (const warning of validation.warnings) {
623
+ debugLogger.warn(
624
+ "PLUGIN_LOADER",
625
+ `Plugin "${manifest.name}": ${warning}`
626
+ );
627
+ }
628
+ }
629
+ } catch {
630
+ }
457
631
  const source = determinePluginSource(pluginPath);
458
632
  const pluginConfig = loadPluginConfig(pluginPath);
459
633
  const agents = loadAgents(pluginPath, manifest);
@@ -461,6 +635,8 @@ function loadPlugin(pluginPath) {
461
635
  const skills = loadSkills(pluginPath, manifest);
462
636
  const hooks = loadHooks(pluginPath, manifest);
463
637
  const mcpServers = loadMCPServers(pluginPath, manifest);
638
+ const lspServers = loadLSPServers(pluginPath, manifest);
639
+ const settings = loadPluginSettings(pluginPath);
464
640
  return {
465
641
  manifest,
466
642
  name: manifest.name,
@@ -471,8 +647,10 @@ function loadPlugin(pluginPath) {
471
647
  skills,
472
648
  hooks,
473
649
  mcpServers,
650
+ lspServers,
474
651
  enabled: pluginConfig.enabled,
475
- config: pluginConfig.config
652
+ config: pluginConfig.config,
653
+ settings
476
654
  };
477
655
  }
478
656
  function loadAllPlugins() {
@@ -484,9 +662,15 @@ function loadAllPlugins() {
484
662
  plugins.push(plugin);
485
663
  } catch (error) {
486
664
  if (error instanceof PluginError) {
487
- console.error(`Error loading plugin ${name}:`, error.message);
665
+ debugLogger.warn(
666
+ "PLUGIN_LOADER",
667
+ `Error loading plugin ${name}: ${error.message}`
668
+ );
488
669
  } else {
489
- console.error(`Unexpected error loading plugin ${name}:`, error);
670
+ debugLogger.warn(
671
+ "PLUGIN_LOADER",
672
+ `Unexpected error loading plugin ${name}: ${error instanceof Error ? error.message : String(error)}`
673
+ );
490
674
  }
491
675
  }
492
676
  }
@@ -499,7 +683,10 @@ function getPlugin(name) {
499
683
  try {
500
684
  return loadPlugin(pluginPath);
501
685
  } catch (error) {
502
- console.error(`Error loading plugin ${name}:`, error);
686
+ debugLogger.warn(
687
+ "PLUGIN_LOADER",
688
+ `Error loading plugin ${name}: ${error instanceof Error ? error.message : String(error)}`
689
+ );
503
690
  return void 0;
504
691
  }
505
692
  }
@@ -532,7 +719,10 @@ function loadPluginConfig(pluginPath) {
532
719
  config: data.config || {}
533
720
  };
534
721
  } catch (error) {
535
- console.error(`Error loading plugin config from ${configPath}:`, error);
722
+ debugLogger.warn(
723
+ "PLUGIN_LOADER",
724
+ `Error loading plugin config from ${configPath}: ${error instanceof Error ? error.message : String(error)}`
725
+ );
536
726
  return { enabled: true, config: {} };
537
727
  }
538
728
  }
@@ -597,12 +787,14 @@ function updatePluginConfig(pluginName, config) {
597
787
  savePluginConfig(plugin.location, plugin.enabled, config);
598
788
  }
599
789
  export {
790
+ addExtraPluginDir,
600
791
  disablePlugin,
601
792
  enablePlugin,
602
793
  getPlugin,
603
794
  listPlugins,
604
795
  loadAllPlugins,
605
796
  loadPlugin,
797
+ loadPluginSettings,
606
798
  togglePluginEnabled,
607
799
  updatePluginConfig
608
800
  };