micro-models-agent 0.3.0 → 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 (321) hide show
  1. package/README.md +436 -436
  2. package/dist/agent/loop.d.ts +5 -5
  3. package/dist/agent/loop.d.ts.map +1 -1
  4. package/dist/agent/loop.js +421 -246
  5. package/dist/agent/loop.js.map +1 -1
  6. package/dist/agent/system-prompt.d.ts +3 -3
  7. package/dist/agent/system-prompt.d.ts.map +1 -1
  8. package/dist/agent/system-prompt.js +383 -278
  9. package/dist/agent/system-prompt.js.map +1 -1
  10. package/dist/cli/config.d.ts +1 -1
  11. package/dist/cli/config.d.ts.map +1 -1
  12. package/dist/cli/config.js +53 -28
  13. package/dist/cli/config.js.map +1 -1
  14. package/dist/config/config.d.ts +2 -1
  15. package/dist/config/config.d.ts.map +1 -1
  16. package/dist/config/config.js +75 -54
  17. package/dist/config/config.js.map +1 -1
  18. package/dist/config/types.d.ts +3 -1
  19. package/dist/config/types.d.ts.map +1 -1
  20. package/dist/plugins/builtin/lint-on-write/index.ts +96 -96
  21. package/dist/plugins/builtin/notify/index.js +6 -6
  22. package/dist/plugins/builtin/notify/index.ts +104 -104
  23. package/dist/setup-wizard.d.ts +1 -1
  24. package/dist/setup-wizard.d.ts.map +1 -1
  25. package/dist/setup-wizard.js +137 -105
  26. package/dist/setup-wizard.js.map +1 -1
  27. package/dist/skills/builtin/agent-test/SKILL.md +68 -68
  28. package/dist/skills/builtin/grill-me/SKILL.md +46 -46
  29. package/dist/skills/builtin/web-scraping/SKILL.md +422 -422
  30. package/dist/tools/native/project-map.d.ts +2 -2
  31. package/dist/tools/native/project-map.d.ts.map +1 -1
  32. package/dist/tools/native/project-map.js +85 -57
  33. package/dist/tools/native/project-map.js.map +1 -1
  34. package/dist/tools/native/scaffold.js +113 -113
  35. package/dist/tools/web-browse.js +7 -7
  36. package/dist/ui/ink/components/App.d.ts +0 -1
  37. package/dist/ui/ink/components/App.d.ts.map +1 -1
  38. package/dist/ui/ink/components/App.js +2 -8
  39. package/dist/ui/ink/components/App.js.map +1 -1
  40. package/dist/ui/ink/components/Conversation.d.ts +1 -2
  41. package/dist/ui/ink/components/Conversation.d.ts.map +1 -1
  42. package/dist/ui/ink/components/Conversation.js +8 -2
  43. package/dist/ui/ink/components/Conversation.js.map +1 -1
  44. package/dist/ui/ink/components/MessageBlock.d.ts +13 -1
  45. package/dist/ui/ink/components/MessageBlock.d.ts.map +1 -1
  46. package/dist/ui/ink/components/MessageBlock.js +15 -27
  47. package/dist/ui/ink/components/MessageBlock.js.map +1 -1
  48. package/dist/ui/ink/components/PromptInput.d.ts +11 -0
  49. package/dist/ui/ink/components/PromptInput.d.ts.map +1 -1
  50. package/dist/ui/ink/components/PromptInput.js +18 -141
  51. package/dist/ui/ink/components/PromptInput.js.map +1 -1
  52. package/dist/ui/ink/components/SelectInput.d.ts.map +1 -1
  53. package/dist/ui/ink/components/SelectInput.js +3 -2
  54. package/dist/ui/ink/components/SelectInput.js.map +1 -1
  55. package/dist/ui/ink/components/StatusBar.d.ts.map +1 -1
  56. package/dist/ui/ink/components/StatusBar.js +14 -6
  57. package/dist/ui/ink/components/StatusBar.js.map +1 -1
  58. package/dist/ui/ink/components/StreamBlock.d.ts.map +1 -1
  59. package/dist/ui/ink/components/StreamBlock.js +3 -3
  60. package/dist/ui/ink/components/StreamBlock.js.map +1 -1
  61. package/dist/ui/ink/components/Tags.d.ts +8 -11
  62. package/dist/ui/ink/components/Tags.d.ts.map +1 -1
  63. package/dist/ui/ink/components/Tags.js +4 -16
  64. package/dist/ui/ink/components/Tags.js.map +1 -1
  65. package/dist/ui/ink/components/ToolCallBlock.d.ts +12 -0
  66. package/dist/ui/ink/components/ToolCallBlock.d.ts.map +1 -1
  67. package/dist/ui/ink/components/ToolCallBlock.js +8 -24
  68. package/dist/ui/ink/components/ToolCallBlock.js.map +1 -1
  69. package/dist/ui/ink/renderer.d.ts +0 -1
  70. package/dist/ui/ink/renderer.d.ts.map +1 -1
  71. package/dist/ui/ink/renderer.js +1 -4
  72. package/dist/ui/ink/renderer.js.map +1 -1
  73. package/package.json +47 -47
  74. package/dist/async-map.d.ts +0 -6
  75. package/dist/async-map.d.ts.map +0 -1
  76. package/dist/async-map.js +0 -16
  77. package/dist/async-map.js.map +0 -1
  78. package/dist/blog-api/types/index.d.ts +0 -2
  79. package/dist/blog-api/types/index.d.ts.map +0 -1
  80. package/dist/blog-api/types/index.js +0 -2
  81. package/dist/blog-api/types/index.js.map +0 -1
  82. package/dist/examples.d.ts +0 -22
  83. package/dist/examples.d.ts.map +0 -1
  84. package/dist/examples.js +0 -45
  85. package/dist/examples.js.map +0 -1
  86. package/dist/fibonacci.d.ts +0 -19
  87. package/dist/fibonacci.d.ts.map +0 -1
  88. package/dist/fibonacci.js +0 -61
  89. package/dist/fibonacci.js.map +0 -1
  90. package/dist/parfymerie-landing/src/App.d.ts +0 -4
  91. package/dist/parfymerie-landing/src/App.d.ts.map +0 -1
  92. package/dist/parfymerie-landing/src/App.js +0 -12
  93. package/dist/parfymerie-landing/src/App.js.map +0 -1
  94. package/dist/parfymerie-landing/src/main.d.ts +0 -2
  95. package/dist/parfymerie-landing/src/main.d.ts.map +0 -1
  96. package/dist/parfymerie-landing/src/main.js +0 -7
  97. package/dist/parfymerie-landing/src/main.js.map +0 -1
  98. package/dist/parfymerie-landing/vite.config.d.ts +0 -3
  99. package/dist/parfymerie-landing/vite.config.d.ts.map +0 -1
  100. package/dist/parfymerie-landing/vite.config.js +0 -7
  101. package/dist/parfymerie-landing/vite.config.js.map +0 -1
  102. package/dist/repl.d.ts +0 -5
  103. package/dist/repl.d.ts.map +0 -1
  104. package/dist/repl.js +0 -472
  105. package/dist/repl.js.map +0 -1
  106. package/dist/sort.d.ts +0 -8
  107. package/dist/sort.d.ts.map +0 -1
  108. package/dist/sort.js +0 -36
  109. package/dist/sort.js.map +0 -1
  110. package/dist/stack.d.ts +0 -9
  111. package/dist/stack.d.ts.map +0 -1
  112. package/dist/stack.js +0 -22
  113. package/dist/stack.js.map +0 -1
  114. package/dist/test-run.d.ts +0 -2
  115. package/dist/test-run.d.ts.map +0 -1
  116. package/dist/test-run.js +0 -13
  117. package/dist/test-run.js.map +0 -1
  118. package/dist/ui/components/diff-view.d.ts +0 -8
  119. package/dist/ui/components/diff-view.d.ts.map +0 -1
  120. package/dist/ui/components/diff-view.js +0 -25
  121. package/dist/ui/components/diff-view.js.map +0 -1
  122. package/dist/ui/double-press.d.ts +0 -9
  123. package/dist/ui/double-press.d.ts.map +0 -1
  124. package/dist/ui/double-press.js +0 -18
  125. package/dist/ui/double-press.js.map +0 -1
  126. package/dist/ui/ink/components/ActivityLog.d.ts +0 -12
  127. package/dist/ui/ink/components/ActivityLog.d.ts.map +0 -1
  128. package/dist/ui/ink/components/ActivityLog.js +0 -11
  129. package/dist/ui/ink/components/ActivityLog.js.map +0 -1
  130. package/dist/ui/ink/components/AgentStatus.d.ts +0 -13
  131. package/dist/ui/ink/components/AgentStatus.d.ts.map +0 -1
  132. package/dist/ui/ink/components/AgentStatus.js +0 -20
  133. package/dist/ui/ink/components/AgentStatus.js.map +0 -1
  134. package/dist/ui/ink/components/BottomBar.d.ts +0 -12
  135. package/dist/ui/ink/components/BottomBar.d.ts.map +0 -1
  136. package/dist/ui/ink/components/BottomBar.js +0 -22
  137. package/dist/ui/ink/components/BottomBar.js.map +0 -1
  138. package/dist/ui/ink/components/CheckboxInput.d.ts +0 -21
  139. package/dist/ui/ink/components/CheckboxInput.d.ts.map +0 -1
  140. package/dist/ui/ink/components/CheckboxInput.js +0 -36
  141. package/dist/ui/ink/components/CheckboxInput.js.map +0 -1
  142. package/dist/ui/ink/components/InputBox.d.ts +0 -25
  143. package/dist/ui/ink/components/InputBox.d.ts.map +0 -1
  144. package/dist/ui/ink/components/InputBox.js +0 -91
  145. package/dist/ui/ink/components/InputBox.js.map +0 -1
  146. package/dist/ui/ink/components/ModeSelector.d.ts +0 -8
  147. package/dist/ui/ink/components/ModeSelector.d.ts.map +0 -1
  148. package/dist/ui/ink/components/ModeSelector.js +0 -13
  149. package/dist/ui/ink/components/ModeSelector.js.map +0 -1
  150. package/dist/ui/ink/components/QuestionBox.d.ts +0 -14
  151. package/dist/ui/ink/components/QuestionBox.d.ts.map +0 -1
  152. package/dist/ui/ink/components/QuestionBox.js +0 -35
  153. package/dist/ui/ink/components/QuestionBox.js.map +0 -1
  154. package/dist/ui/ink/components/RadioInput.d.ts +0 -17
  155. package/dist/ui/ink/components/RadioInput.d.ts.map +0 -1
  156. package/dist/ui/ink/components/RadioInput.js +0 -30
  157. package/dist/ui/ink/components/RadioInput.js.map +0 -1
  158. package/dist/ui/ink/components/SliderInput.d.ts +0 -20
  159. package/dist/ui/ink/components/SliderInput.d.ts.map +0 -1
  160. package/dist/ui/ink/components/SliderInput.js +0 -40
  161. package/dist/ui/ink/components/SliderInput.js.map +0 -1
  162. package/dist/ui/ink/components/StartupScreen.d.ts +0 -19
  163. package/dist/ui/ink/components/StartupScreen.d.ts.map +0 -1
  164. package/dist/ui/ink/components/StartupScreen.js +0 -9
  165. package/dist/ui/ink/components/StartupScreen.js.map +0 -1
  166. package/dist/ui/ink/components/WelcomeScreen.d.ts +0 -10
  167. package/dist/ui/ink/components/WelcomeScreen.d.ts.map +0 -1
  168. package/dist/ui/ink/components/WelcomeScreen.js +0 -8
  169. package/dist/ui/ink/components/WelcomeScreen.js.map +0 -1
  170. package/dist/ui/ink/components/Window.d.ts +0 -30
  171. package/dist/ui/ink/components/Window.d.ts.map +0 -1
  172. package/dist/ui/ink/components/Window.js +0 -9
  173. package/dist/ui/ink/components/Window.js.map +0 -1
  174. package/dist/ui/ink/components/ui/_core.d.ts +0 -113
  175. package/dist/ui/ink/components/ui/_core.d.ts.map +0 -1
  176. package/dist/ui/ink/components/ui/_core.js +0 -83
  177. package/dist/ui/ink/components/ui/_core.js.map +0 -1
  178. package/dist/ui/ink/components/ui/autocomplete/Autocomplete.d.ts +0 -23
  179. package/dist/ui/ink/components/ui/autocomplete/Autocomplete.d.ts.map +0 -1
  180. package/dist/ui/ink/components/ui/autocomplete/Autocomplete.js +0 -56
  181. package/dist/ui/ink/components/ui/autocomplete/Autocomplete.js.map +0 -1
  182. package/dist/ui/ink/components/ui/autocomplete/index.d.ts +0 -3
  183. package/dist/ui/ink/components/ui/autocomplete/index.d.ts.map +0 -1
  184. package/dist/ui/ink/components/ui/autocomplete/index.js +0 -2
  185. package/dist/ui/ink/components/ui/autocomplete/index.js.map +0 -1
  186. package/dist/ui/ink/components/ui/badge/Badge.d.ts +0 -13
  187. package/dist/ui/ink/components/ui/badge/Badge.d.ts.map +0 -1
  188. package/dist/ui/ink/components/ui/badge/Badge.js +0 -17
  189. package/dist/ui/ink/components/ui/badge/Badge.js.map +0 -1
  190. package/dist/ui/ink/components/ui/badge/index.d.ts +0 -3
  191. package/dist/ui/ink/components/ui/badge/index.d.ts.map +0 -1
  192. package/dist/ui/ink/components/ui/badge/index.js +0 -2
  193. package/dist/ui/ink/components/ui/badge/index.js.map +0 -1
  194. package/dist/ui/ink/components/ui/divider/Divider.d.ts +0 -12
  195. package/dist/ui/ink/components/ui/divider/Divider.d.ts.map +0 -1
  196. package/dist/ui/ink/components/ui/divider/Divider.js +0 -27
  197. package/dist/ui/ink/components/ui/divider/Divider.js.map +0 -1
  198. package/dist/ui/ink/components/ui/divider/index.d.ts +0 -3
  199. package/dist/ui/ink/components/ui/divider/index.d.ts.map +0 -1
  200. package/dist/ui/ink/components/ui/divider/index.js +0 -2
  201. package/dist/ui/ink/components/ui/divider/index.js.map +0 -1
  202. package/dist/ui/ink/components/ui/header/Header.d.ts +0 -13
  203. package/dist/ui/ink/components/ui/header/Header.d.ts.map +0 -1
  204. package/dist/ui/ink/components/ui/header/Header.js +0 -33
  205. package/dist/ui/ink/components/ui/header/Header.js.map +0 -1
  206. package/dist/ui/ink/components/ui/header/index.d.ts +0 -3
  207. package/dist/ui/ink/components/ui/header/index.d.ts.map +0 -1
  208. package/dist/ui/ink/components/ui/header/index.js +0 -2
  209. package/dist/ui/ink/components/ui/header/index.js.map +0 -1
  210. package/dist/ui/ink/components/ui/json-viewer/JSONViewer.d.ts +0 -14
  211. package/dist/ui/ink/components/ui/json-viewer/JSONViewer.d.ts.map +0 -1
  212. package/dist/ui/ink/components/ui/json-viewer/JSONViewer.js +0 -144
  213. package/dist/ui/ink/components/ui/json-viewer/JSONViewer.js.map +0 -1
  214. package/dist/ui/ink/components/ui/json-viewer/index.d.ts +0 -3
  215. package/dist/ui/ink/components/ui/json-viewer/index.d.ts.map +0 -1
  216. package/dist/ui/ink/components/ui/json-viewer/index.js +0 -2
  217. package/dist/ui/ink/components/ui/json-viewer/index.js.map +0 -1
  218. package/dist/ui/ink/components/ui/key-hint/KeyHint.d.ts +0 -14
  219. package/dist/ui/ink/components/ui/key-hint/KeyHint.d.ts.map +0 -1
  220. package/dist/ui/ink/components/ui/key-hint/KeyHint.js +0 -5
  221. package/dist/ui/ink/components/ui/key-hint/KeyHint.js.map +0 -1
  222. package/dist/ui/ink/components/ui/key-hint/index.d.ts +0 -3
  223. package/dist/ui/ink/components/ui/key-hint/index.d.ts.map +0 -1
  224. package/dist/ui/ink/components/ui/key-hint/index.js +0 -2
  225. package/dist/ui/ink/components/ui/key-hint/index.js.map +0 -1
  226. package/dist/ui/ink/components/ui/markdown/Markdown.d.ts +0 -11
  227. package/dist/ui/ink/components/ui/markdown/Markdown.d.ts.map +0 -1
  228. package/dist/ui/ink/components/ui/markdown/Markdown.js +0 -129
  229. package/dist/ui/ink/components/ui/markdown/Markdown.js.map +0 -1
  230. package/dist/ui/ink/components/ui/markdown/index.d.ts +0 -3
  231. package/dist/ui/ink/components/ui/markdown/index.d.ts.map +0 -1
  232. package/dist/ui/ink/components/ui/markdown/index.js +0 -2
  233. package/dist/ui/ink/components/ui/markdown/index.js.map +0 -1
  234. package/dist/ui/ink/components/ui/scroll-area/ScrollArea.d.ts +0 -21
  235. package/dist/ui/ink/components/ui/scroll-area/ScrollArea.d.ts.map +0 -1
  236. package/dist/ui/ink/components/ui/scroll-area/ScrollArea.js +0 -42
  237. package/dist/ui/ink/components/ui/scroll-area/ScrollArea.js.map +0 -1
  238. package/dist/ui/ink/components/ui/scroll-area/index.d.ts +0 -3
  239. package/dist/ui/ink/components/ui/scroll-area/index.d.ts.map +0 -1
  240. package/dist/ui/ink/components/ui/scroll-area/index.js +0 -2
  241. package/dist/ui/ink/components/ui/scroll-area/index.js.map +0 -1
  242. package/dist/ui/ink/components/ui/select/Select.d.ts +0 -19
  243. package/dist/ui/ink/components/ui/select/Select.d.ts.map +0 -1
  244. package/dist/ui/ink/components/ui/select/Select.js +0 -73
  245. package/dist/ui/ink/components/ui/select/Select.js.map +0 -1
  246. package/dist/ui/ink/components/ui/select/index.d.ts +0 -3
  247. package/dist/ui/ink/components/ui/select/index.d.ts.map +0 -1
  248. package/dist/ui/ink/components/ui/select/index.js +0 -2
  249. package/dist/ui/ink/components/ui/select/index.js.map +0 -1
  250. package/dist/ui/ink/components/ui/spinner/Spinner.d.ts +0 -14
  251. package/dist/ui/ink/components/ui/spinner/Spinner.d.ts.map +0 -1
  252. package/dist/ui/ink/components/ui/spinner/Spinner.js +0 -16
  253. package/dist/ui/ink/components/ui/spinner/Spinner.js.map +0 -1
  254. package/dist/ui/ink/components/ui/spinner/index.d.ts +0 -3
  255. package/dist/ui/ink/components/ui/spinner/index.d.ts.map +0 -1
  256. package/dist/ui/ink/components/ui/spinner/index.js +0 -2
  257. package/dist/ui/ink/components/ui/spinner/index.js.map +0 -1
  258. package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.d.ts +0 -12
  259. package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.d.ts.map +0 -1
  260. package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.js +0 -39
  261. package/dist/ui/ink/components/ui/status-indicator/StatusIndicator.js.map +0 -1
  262. package/dist/ui/ink/components/ui/status-indicator/index.d.ts +0 -3
  263. package/dist/ui/ink/components/ui/status-indicator/index.d.ts.map +0 -1
  264. package/dist/ui/ink/components/ui/status-indicator/index.js +0 -2
  265. package/dist/ui/ink/components/ui/status-indicator/index.js.map +0 -1
  266. package/dist/ui/ink/components/ui/streaming-text/StreamingText.d.ts +0 -13
  267. package/dist/ui/ink/components/ui/streaming-text/StreamingText.d.ts.map +0 -1
  268. package/dist/ui/ink/components/ui/streaming-text/StreamingText.js +0 -22
  269. package/dist/ui/ink/components/ui/streaming-text/StreamingText.js.map +0 -1
  270. package/dist/ui/ink/components/ui/streaming-text/index.d.ts +0 -3
  271. package/dist/ui/ink/components/ui/streaming-text/index.d.ts.map +0 -1
  272. package/dist/ui/ink/components/ui/streaming-text/index.js +0 -2
  273. package/dist/ui/ink/components/ui/streaming-text/index.js.map +0 -1
  274. package/dist/ui/ink/components/ui/tabs/Tabs.d.ts +0 -20
  275. package/dist/ui/ink/components/ui/tabs/Tabs.d.ts.map +0 -1
  276. package/dist/ui/ink/components/ui/tabs/Tabs.js +0 -53
  277. package/dist/ui/ink/components/ui/tabs/Tabs.js.map +0 -1
  278. package/dist/ui/ink/components/ui/tabs/index.d.ts +0 -3
  279. package/dist/ui/ink/components/ui/tabs/index.d.ts.map +0 -1
  280. package/dist/ui/ink/components/ui/tabs/index.js +0 -2
  281. package/dist/ui/ink/components/ui/tabs/index.js.map +0 -1
  282. package/dist/ui/ink/components/ui/text-input/TextInput.d.ts +0 -22
  283. package/dist/ui/ink/components/ui/text-input/TextInput.d.ts.map +0 -1
  284. package/dist/ui/ink/components/ui/text-input/TextInput.js +0 -57
  285. package/dist/ui/ink/components/ui/text-input/TextInput.js.map +0 -1
  286. package/dist/ui/ink/components/ui/text-input/index.d.ts +0 -3
  287. package/dist/ui/ink/components/ui/text-input/index.d.ts.map +0 -1
  288. package/dist/ui/ink/components/ui/text-input/index.js +0 -2
  289. package/dist/ui/ink/components/ui/text-input/index.js.map +0 -1
  290. package/dist/ui/ink/components/ui/token-counter/TokenCounter.d.ts +0 -17
  291. package/dist/ui/ink/components/ui/token-counter/TokenCounter.d.ts.map +0 -1
  292. package/dist/ui/ink/components/ui/token-counter/TokenCounter.js +0 -38
  293. package/dist/ui/ink/components/ui/token-counter/TokenCounter.js.map +0 -1
  294. package/dist/ui/ink/components/ui/token-counter/index.d.ts +0 -3
  295. package/dist/ui/ink/components/ui/token-counter/index.d.ts.map +0 -1
  296. package/dist/ui/ink/components/ui/token-counter/index.js +0 -2
  297. package/dist/ui/ink/components/ui/token-counter/index.js.map +0 -1
  298. package/dist/ui/ink/components/ui/typewriter/Typewriter.d.ts +0 -14
  299. package/dist/ui/ink/components/ui/typewriter/Typewriter.d.ts.map +0 -1
  300. package/dist/ui/ink/components/ui/typewriter/Typewriter.js +0 -57
  301. package/dist/ui/ink/components/ui/typewriter/Typewriter.js.map +0 -1
  302. package/dist/ui/ink/components/ui/typewriter/index.d.ts +0 -3
  303. package/dist/ui/ink/components/ui/typewriter/index.d.ts.map +0 -1
  304. package/dist/ui/ink/components/ui/typewriter/index.js +0 -2
  305. package/dist/ui/ink/components/ui/typewriter/index.js.map +0 -1
  306. package/dist/ui/opentui-renderer.d.ts +0 -53
  307. package/dist/ui/opentui-renderer.d.ts.map +0 -1
  308. package/dist/ui/opentui-renderer.js +0 -463
  309. package/dist/ui/opentui-renderer.js.map +0 -1
  310. package/dist/utils/memoize.d.ts +0 -14
  311. package/dist/utils/memoize.d.ts.map +0 -1
  312. package/dist/utils/memoize.js +0 -51
  313. package/dist/utils/memoize.js.map +0 -1
  314. package/dist/utils/types.d.ts +0 -6
  315. package/dist/utils/types.d.ts.map +0 -1
  316. package/dist/utils/types.js +0 -2
  317. package/dist/utils/types.js.map +0 -1
  318. package/dist/utils.d.ts +0 -22
  319. package/dist/utils.d.ts.map +0 -1
  320. package/dist/utils.js +0 -81
  321. package/dist/utils.js.map +0 -1
@@ -1,97 +1,97 @@
1
- import { execSync } from 'node:child_process';
2
- import { existsSync, readFileSync, writeFileSync } from 'node:fs';
3
- import { join } from 'node:path';
4
- import type { AgentPlugin, PluginContext } from '../../types.js';
5
-
6
- /**
7
- * Плагин lint-on-write.
8
- *
9
- * После каждого write_file/edit_file запускает линтер
10
- * и добавляет ошибки в tool result (модель видит их сразу).
11
- *
12
- * Линтер определяется автоматически (eslint → biome → prettier).
13
- *
14
- * @module plugins/builtin/lint-on-write
15
- */
16
-
17
- const LINTER_DETECT_COMMANDS = [
18
- { name: 'eslint', cmd: 'npx eslint --version' },
19
- { name: 'biome', cmd: 'npx @biomejs/biome --version' },
20
- { name: 'prettier', cmd: 'npx prettier --version' },
21
- ];
22
-
23
- function detectLinter(cwd: string, cacheFile: string): string | null {
24
- const cachePath = join(cwd, cacheFile);
25
- if (existsSync(cachePath)) {
26
- try {
27
- const cached = readFileSync(cachePath, 'utf-8').trim();
28
- if (cached) return cached;
29
- } catch { /* ignore */ }
30
- }
31
- for (const { name, cmd } of LINTER_DETECT_COMMANDS) {
32
- try {
33
- execSync(cmd, { cwd, timeout: 5000, windowsHide: true, stdio: 'pipe' });
34
- try { writeFileSync(cachePath, name, 'utf-8'); } catch { /* ignore */ }
35
- return name;
36
- } catch { /* not found */ }
37
- }
38
- return null;
39
- }
40
-
41
- function runLinter(linter: string, filePath: string, cwd: string): string | null {
42
- try {
43
- let cmd: string;
44
- switch (linter) {
45
- case 'eslint': cmd = `npx eslint "${filePath}" --format compact`; break;
46
- case 'biome': cmd = `npx @biomejs/biome check "${filePath}"`; break;
47
- case 'prettier': cmd = `npx prettier --check "${filePath}"`; break;
48
- default: return null;
49
- }
50
- execSync(cmd, { cwd, timeout: 15000, windowsHide: true, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] });
51
- return null;
52
- } catch (e: any) {
53
- const output = e.stdout?.toString() || e.stderr?.toString() || '';
54
- return output ? output.slice(0, 1000) : null;
55
- }
56
- }
57
-
58
- // Module-level linter cache
59
- let cachedLinter: string | null = null;
60
-
61
- export default function createLintOnWrite(): AgentPlugin {
62
- return {
63
- name: 'lint-on-write',
64
- version: '1.0.0',
65
- description: 'Auto-run linter after write_file/edit_file',
66
- onActivate(ctx: PluginContext) {
67
- ctx.logger.info('lint-on-write: active (linter detected on first file write)');
68
- },
69
- on(_event: string, _handler: any) { /* via PluginManager.on() */ },
70
- onDeactivate() { cachedLinter = null; },
71
- getPromptSection() {
72
- return '## Lint-on-Write Plugin\nAfter writing/editing .ts/.tsx/.js/.jsx files, lint errors (if any) are automatically appended to the tool result.';
73
- },
74
- };
75
- }
76
-
77
- /**
78
- * Обработчик tool:after — вызывается через PluginManager.on().
79
- * Экспортируется для регистрации в loop.ts.
80
- */
81
- export function handleToolAfter(
82
- toolName: string,
83
- args: Record<string, unknown>,
84
- _result: { stdout: string; stderr: string; exitCode: number },
85
- cwd: string,
86
- cacheFile: string,
87
- ): string | null {
88
- if (toolName !== 'write_file' && toolName !== 'edit_file') return null;
89
- const filePath = String(args.path ?? '');
90
- if (!filePath || !/\.(ts|tsx|js|jsx|mjs|cjs)$/.test(filePath)) return null;
91
-
92
- const linter = cachedLinter ?? detectLinter(cwd, cacheFile);
93
- if (!linter) return null;
94
- cachedLinter = linter;
95
-
96
- return runLinter(linter, filePath, cwd);
1
+ import { execSync } from 'node:child_process';
2
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import type { AgentPlugin, PluginContext } from '../../types.js';
5
+
6
+ /**
7
+ * Плагин lint-on-write.
8
+ *
9
+ * После каждого write_file/edit_file запускает линтер
10
+ * и добавляет ошибки в tool result (модель видит их сразу).
11
+ *
12
+ * Линтер определяется автоматически (eslint → biome → prettier).
13
+ *
14
+ * @module plugins/builtin/lint-on-write
15
+ */
16
+
17
+ const LINTER_DETECT_COMMANDS = [
18
+ { name: 'eslint', cmd: 'npx eslint --version' },
19
+ { name: 'biome', cmd: 'npx @biomejs/biome --version' },
20
+ { name: 'prettier', cmd: 'npx prettier --version' },
21
+ ];
22
+
23
+ function detectLinter(cwd: string, cacheFile: string): string | null {
24
+ const cachePath = join(cwd, cacheFile);
25
+ if (existsSync(cachePath)) {
26
+ try {
27
+ const cached = readFileSync(cachePath, 'utf-8').trim();
28
+ if (cached) return cached;
29
+ } catch { /* ignore */ }
30
+ }
31
+ for (const { name, cmd } of LINTER_DETECT_COMMANDS) {
32
+ try {
33
+ execSync(cmd, { cwd, timeout: 5000, windowsHide: true, stdio: 'pipe' });
34
+ try { writeFileSync(cachePath, name, 'utf-8'); } catch { /* ignore */ }
35
+ return name;
36
+ } catch { /* not found */ }
37
+ }
38
+ return null;
39
+ }
40
+
41
+ function runLinter(linter: string, filePath: string, cwd: string): string | null {
42
+ try {
43
+ let cmd: string;
44
+ switch (linter) {
45
+ case 'eslint': cmd = `npx eslint "${filePath}" --format compact`; break;
46
+ case 'biome': cmd = `npx @biomejs/biome check "${filePath}"`; break;
47
+ case 'prettier': cmd = `npx prettier --check "${filePath}"`; break;
48
+ default: return null;
49
+ }
50
+ execSync(cmd, { cwd, timeout: 15000, windowsHide: true, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] });
51
+ return null;
52
+ } catch (e: any) {
53
+ const output = e.stdout?.toString() || e.stderr?.toString() || '';
54
+ return output ? output.slice(0, 1000) : null;
55
+ }
56
+ }
57
+
58
+ // Module-level linter cache
59
+ let cachedLinter: string | null = null;
60
+
61
+ export default function createLintOnWrite(): AgentPlugin {
62
+ return {
63
+ name: 'lint-on-write',
64
+ version: '1.0.0',
65
+ description: 'Auto-run linter after write_file/edit_file',
66
+ onActivate(ctx: PluginContext) {
67
+ ctx.logger.info('lint-on-write: active (linter detected on first file write)');
68
+ },
69
+ on(_event: string, _handler: any) { /* via PluginManager.on() */ },
70
+ onDeactivate() { cachedLinter = null; },
71
+ getPromptSection() {
72
+ return '## Lint-on-Write Plugin\nAfter writing/editing .ts/.tsx/.js/.jsx files, lint errors (if any) are automatically appended to the tool result.';
73
+ },
74
+ };
75
+ }
76
+
77
+ /**
78
+ * Обработчик tool:after — вызывается через PluginManager.on().
79
+ * Экспортируется для регистрации в loop.ts.
80
+ */
81
+ export function handleToolAfter(
82
+ toolName: string,
83
+ args: Record<string, unknown>,
84
+ _result: { stdout: string; stderr: string; exitCode: number },
85
+ cwd: string,
86
+ cacheFile: string,
87
+ ): string | null {
88
+ if (toolName !== 'write_file' && toolName !== 'edit_file') return null;
89
+ const filePath = String(args.path ?? '');
90
+ if (!filePath || !/\.(ts|tsx|js|jsx|mjs|cjs)$/.test(filePath)) return null;
91
+
92
+ const linter = cachedLinter ?? detectLinter(cwd, cacheFile);
93
+ if (!linter) return null;
94
+ cachedLinter = linter;
95
+
96
+ return runLinter(linter, filePath, cwd);
97
97
  }
@@ -22,12 +22,12 @@ function sendNotification(title, body) {
22
22
  // Write temp .ps1 file to avoid $ escaping issues in shell
23
23
  const safeTitle = title.replace(/'/g, "''");
24
24
  const safeBody = body.replace(/'/g, "''");
25
- const psScript = `Add-Type -AssemblyName System.Windows.Forms
26
- $n = New-Object System.Windows.Forms.NotifyIcon
27
- $n.Icon = [System.Drawing.SystemIcons]::Information
28
- $n.Visible = $true
29
- $n.ShowBalloonTip(5000, '${safeTitle}', '${safeBody}', [System.Windows.Forms.ToolTipIcon]::Info)
30
- Start-Sleep -Seconds 2
25
+ const psScript = `Add-Type -AssemblyName System.Windows.Forms
26
+ $n = New-Object System.Windows.Forms.NotifyIcon
27
+ $n.Icon = [System.Drawing.SystemIcons]::Information
28
+ $n.Visible = $true
29
+ $n.ShowBalloonTip(5000, '${safeTitle}', '${safeBody}', [System.Windows.Forms.ToolTipIcon]::Info)
30
+ Start-Sleep -Seconds 2
31
31
  $n.Dispose()`;
32
32
  const tmpFile = join(tmpdir(), `mma-notify-${Date.now()}.ps1`);
33
33
  writeFileSync(tmpFile, psScript, 'utf-8');
@@ -1,105 +1,105 @@
1
- import { execSync } from 'node:child_process';
2
- import { writeFileSync, unlinkSync } from 'node:fs';
3
- import { join } from 'node:path';
4
- import { tmpdir } from 'node:os';
5
- import { platform } from 'node:os';
6
- import type { AgentPlugin, PluginContext } from '../../types.js';
7
-
8
- /**
9
- * Плагин notify — OS desktop-уведомления.
10
- *
11
- * Отправляет toast-уведомление при:
12
- * - agent:done — задача выполнена
13
- * - tool:blocked — агент заблокирован
14
- * - tool:after (question) — агент ждёт ответа
15
- *
16
- * Zero-dependency: shell-out по платформе.
17
- *
18
- * @module plugins/builtin/notify
19
- */
20
-
21
- function sendNotification(title: string, body: string): void {
22
- const p = platform();
23
- try {
24
- if (p === 'win32') {
25
- // Write temp .ps1 file to avoid $ escaping issues in shell
26
- const safeTitle = title.replace(/'/g, "''");
27
- const safeBody = body.replace(/'/g, "''");
28
- const psScript = `Add-Type -AssemblyName System.Windows.Forms
29
- $n = New-Object System.Windows.Forms.NotifyIcon
30
- $n.Icon = [System.Drawing.SystemIcons]::Information
31
- $n.Visible = $true
32
- $n.ShowBalloonTip(5000, '${safeTitle}', '${safeBody}', [System.Windows.Forms.ToolTipIcon]::Info)
33
- Start-Sleep -Seconds 2
34
- $n.Dispose()`;
35
- const tmpFile = join(tmpdir(), `mma-notify-${Date.now()}.ps1`);
36
- writeFileSync(tmpFile, psScript, 'utf-8');
37
- try {
38
- execSync(`powershell -ExecutionPolicy Bypass -File "${tmpFile}"`, {
39
- timeout: 8000,
40
- windowsHide: true,
41
- stdio: 'pipe',
42
- });
43
- } finally {
44
- try { unlinkSync(tmpFile); } catch { /* ignore */ }
45
- }
46
- } else if (p === 'darwin') {
47
- execSync(`osascript -e 'display notification "${body.replace(/"/g, '\\"')}" with title "${title.replace(/"/g, '\\"')}"'`, {
48
- timeout: 5000,
49
- stdio: 'pipe',
50
- });
51
- } else {
52
- // Linux
53
- execSync(`notify-send "${title.replace(/"/g, '\\"')}" "${body.replace(/"/g, '\\"')}"`, {
54
- timeout: 5000,
55
- stdio: 'pipe',
56
- });
57
- }
58
- } catch {
59
- // Best-effort
60
- }
61
- }
62
-
63
- export default function createNotify(): AgentPlugin {
64
- let ctx: PluginContext | null = null;
65
- let config = { onDone: true, onBlocked: true, onQuestion: true };
66
-
67
- return {
68
- name: 'notify',
69
- version: '1.0.0',
70
- description: 'OS desktop notifications for agent events',
71
-
72
- onActivate(pluginCtx: PluginContext) {
73
- ctx = pluginCtx;
74
- if (pluginCtx.config) {
75
- config = { ...config, ...pluginCtx.config as Record<string, unknown> } as typeof config;
76
- }
77
- pluginCtx.logger.info(`notify: active (done=${config.onDone}, blocked=${config.onBlocked}, question=${config.onQuestion})`);
78
- },
79
-
80
- onDeactivate() {
81
- ctx = null;
82
- },
83
-
84
- getPromptSection() {
85
- return '## Notify Plugin\nDesktop notifications are enabled. You don\'t need to notify the user about completion — it happens automatically.';
86
- },
87
- };
88
- }
89
-
90
- /**
91
- * Обработчики событий — вызываются извне через PluginManager.on().
92
- */
93
- export function handleAgentDone(): void {
94
- sendNotification('MMA', 'Agent finished the task');
95
- }
96
-
97
- export function handleToolBlocked(toolName: string, _args: unknown): void {
98
- sendNotification('MMA', `Tool blocked: ${toolName}`);
99
- }
100
-
101
- export function handleToolAfter(toolName: string, _args: unknown, result: { exitCode: number }): void {
102
- if (toolName === 'question') {
103
- sendNotification('MMA', 'Agent needs your answer');
104
- }
1
+ import { execSync } from 'node:child_process';
2
+ import { writeFileSync, unlinkSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { tmpdir } from 'node:os';
5
+ import { platform } from 'node:os';
6
+ import type { AgentPlugin, PluginContext } from '../../types.js';
7
+
8
+ /**
9
+ * Плагин notify — OS desktop-уведомления.
10
+ *
11
+ * Отправляет toast-уведомление при:
12
+ * - agent:done — задача выполнена
13
+ * - tool:blocked — агент заблокирован
14
+ * - tool:after (question) — агент ждёт ответа
15
+ *
16
+ * Zero-dependency: shell-out по платформе.
17
+ *
18
+ * @module plugins/builtin/notify
19
+ */
20
+
21
+ function sendNotification(title: string, body: string): void {
22
+ const p = platform();
23
+ try {
24
+ if (p === 'win32') {
25
+ // Write temp .ps1 file to avoid $ escaping issues in shell
26
+ const safeTitle = title.replace(/'/g, "''");
27
+ const safeBody = body.replace(/'/g, "''");
28
+ const psScript = `Add-Type -AssemblyName System.Windows.Forms
29
+ $n = New-Object System.Windows.Forms.NotifyIcon
30
+ $n.Icon = [System.Drawing.SystemIcons]::Information
31
+ $n.Visible = $true
32
+ $n.ShowBalloonTip(5000, '${safeTitle}', '${safeBody}', [System.Windows.Forms.ToolTipIcon]::Info)
33
+ Start-Sleep -Seconds 2
34
+ $n.Dispose()`;
35
+ const tmpFile = join(tmpdir(), `mma-notify-${Date.now()}.ps1`);
36
+ writeFileSync(tmpFile, psScript, 'utf-8');
37
+ try {
38
+ execSync(`powershell -ExecutionPolicy Bypass -File "${tmpFile}"`, {
39
+ timeout: 8000,
40
+ windowsHide: true,
41
+ stdio: 'pipe',
42
+ });
43
+ } finally {
44
+ try { unlinkSync(tmpFile); } catch { /* ignore */ }
45
+ }
46
+ } else if (p === 'darwin') {
47
+ execSync(`osascript -e 'display notification "${body.replace(/"/g, '\\"')}" with title "${title.replace(/"/g, '\\"')}"'`, {
48
+ timeout: 5000,
49
+ stdio: 'pipe',
50
+ });
51
+ } else {
52
+ // Linux
53
+ execSync(`notify-send "${title.replace(/"/g, '\\"')}" "${body.replace(/"/g, '\\"')}"`, {
54
+ timeout: 5000,
55
+ stdio: 'pipe',
56
+ });
57
+ }
58
+ } catch {
59
+ // Best-effort
60
+ }
61
+ }
62
+
63
+ export default function createNotify(): AgentPlugin {
64
+ let ctx: PluginContext | null = null;
65
+ let config = { onDone: true, onBlocked: true, onQuestion: true };
66
+
67
+ return {
68
+ name: 'notify',
69
+ version: '1.0.0',
70
+ description: 'OS desktop notifications for agent events',
71
+
72
+ onActivate(pluginCtx: PluginContext) {
73
+ ctx = pluginCtx;
74
+ if (pluginCtx.config) {
75
+ config = { ...config, ...pluginCtx.config as Record<string, unknown> } as typeof config;
76
+ }
77
+ pluginCtx.logger.info(`notify: active (done=${config.onDone}, blocked=${config.onBlocked}, question=${config.onQuestion})`);
78
+ },
79
+
80
+ onDeactivate() {
81
+ ctx = null;
82
+ },
83
+
84
+ getPromptSection() {
85
+ return '## Notify Plugin\nDesktop notifications are enabled. You don\'t need to notify the user about completion — it happens automatically.';
86
+ },
87
+ };
88
+ }
89
+
90
+ /**
91
+ * Обработчики событий — вызываются извне через PluginManager.on().
92
+ */
93
+ export function handleAgentDone(): void {
94
+ sendNotification('MMA', 'Agent finished the task');
95
+ }
96
+
97
+ export function handleToolBlocked(toolName: string, _args: unknown): void {
98
+ sendNotification('MMA', `Tool blocked: ${toolName}`);
99
+ }
100
+
101
+ export function handleToolAfter(toolName: string, _args: unknown, result: { exitCode: number }): void {
102
+ if (toolName === 'question') {
103
+ sendNotification('MMA', 'Agent needs your answer');
104
+ }
105
105
  }
@@ -1,3 +1,3 @@
1
- import type { AppConfig } from './config/types.js';
1
+ import type { AppConfig } from "./config/types.js";
2
2
  export declare function runSetupWizard(force?: boolean): Promise<AppConfig>;
3
3
  //# sourceMappingURL=setup-wizard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup-wizard.d.ts","sourceRoot":"","sources":["../src/setup-wizard.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAuWnD,wBAAsB,cAAc,CAAC,KAAK,UAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CA+DtE"}
1
+ {"version":3,"file":"setup-wizard.d.ts","sourceRoot":"","sources":["../src/setup-wizard.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAqbnD,wBAAsB,cAAc,CAAC,KAAK,UAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAgFtE"}