micro-models-agent 0.6.4 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (472) hide show
  1. package/README.md +286 -436
  2. package/dist/main.js +11706 -0
  3. package/dist/skills/builtin/git.md +36 -0
  4. package/dist/skills/builtin/typescript.md +35 -0
  5. package/package.json +41 -47
  6. package/dist/agent/context.d.ts +0 -73
  7. package/dist/agent/context.d.ts.map +0 -1
  8. package/dist/agent/context.js +0 -262
  9. package/dist/agent/context.js.map +0 -1
  10. package/dist/agent/error-escalation.d.ts +0 -19
  11. package/dist/agent/error-escalation.d.ts.map +0 -1
  12. package/dist/agent/error-escalation.js +0 -168
  13. package/dist/agent/error-escalation.js.map +0 -1
  14. package/dist/agent/loop.d.ts +0 -46
  15. package/dist/agent/loop.d.ts.map +0 -1
  16. package/dist/agent/loop.js +0 -1043
  17. package/dist/agent/loop.js.map +0 -1
  18. package/dist/agent/memory.d.ts +0 -40
  19. package/dist/agent/memory.d.ts.map +0 -1
  20. package/dist/agent/memory.js +0 -231
  21. package/dist/agent/memory.js.map +0 -1
  22. package/dist/agent/modes/applier.d.ts +0 -43
  23. package/dist/agent/modes/applier.d.ts.map +0 -1
  24. package/dist/agent/modes/applier.js +0 -30
  25. package/dist/agent/modes/applier.js.map +0 -1
  26. package/dist/agent/modes/registry.d.ts +0 -35
  27. package/dist/agent/modes/registry.d.ts.map +0 -1
  28. package/dist/agent/modes/registry.js +0 -169
  29. package/dist/agent/modes/registry.js.map +0 -1
  30. package/dist/agent/modes/types.d.ts +0 -61
  31. package/dist/agent/modes/types.d.ts.map +0 -1
  32. package/dist/agent/modes/types.js +0 -13
  33. package/dist/agent/modes/types.js.map +0 -1
  34. package/dist/agent/react-loop.d.ts +0 -65
  35. package/dist/agent/react-loop.d.ts.map +0 -1
  36. package/dist/agent/react-loop.js +0 -101
  37. package/dist/agent/react-loop.js.map +0 -1
  38. package/dist/agent/system-prompt.d.ts +0 -26
  39. package/dist/agent/system-prompt.d.ts.map +0 -1
  40. package/dist/agent/system-prompt.js +0 -478
  41. package/dist/agent/system-prompt.js.map +0 -1
  42. package/dist/agent/tool-executor.d.ts +0 -36
  43. package/dist/agent/tool-executor.d.ts.map +0 -1
  44. package/dist/agent/tool-executor.js +0 -346
  45. package/dist/agent/tool-executor.js.map +0 -1
  46. package/dist/agent/user-profile.d.ts +0 -26
  47. package/dist/agent/user-profile.d.ts.map +0 -1
  48. package/dist/agent/user-profile.js +0 -169
  49. package/dist/agent/user-profile.js.map +0 -1
  50. package/dist/agent/write-enforcer.d.ts +0 -7
  51. package/dist/agent/write-enforcer.d.ts.map +0 -1
  52. package/dist/agent/write-enforcer.js +0 -8
  53. package/dist/agent/write-enforcer.js.map +0 -1
  54. package/dist/cli/config.d.ts +0 -13
  55. package/dist/cli/config.d.ts.map +0 -1
  56. package/dist/cli/config.js +0 -82
  57. package/dist/cli/config.js.map +0 -1
  58. package/dist/cli/model.d.ts +0 -13
  59. package/dist/cli/model.d.ts.map +0 -1
  60. package/dist/cli/model.js +0 -170
  61. package/dist/cli/model.js.map +0 -1
  62. package/dist/cli/provider.d.ts +0 -12
  63. package/dist/cli/provider.d.ts.map +0 -1
  64. package/dist/cli/provider.js +0 -90
  65. package/dist/cli/provider.js.map +0 -1
  66. package/dist/cli/update.d.ts +0 -12
  67. package/dist/cli/update.d.ts.map +0 -1
  68. package/dist/cli/update.js +0 -69
  69. package/dist/cli/update.js.map +0 -1
  70. package/dist/cli.d.ts +0 -3
  71. package/dist/cli.d.ts.map +0 -1
  72. package/dist/cli.js +0 -310
  73. package/dist/cli.js.map +0 -1
  74. package/dist/config/config.d.ts +0 -59
  75. package/dist/config/config.d.ts.map +0 -1
  76. package/dist/config/config.js +0 -232
  77. package/dist/config/config.js.map +0 -1
  78. package/dist/config/types.d.ts +0 -122
  79. package/dist/config/types.d.ts.map +0 -1
  80. package/dist/config/types.js +0 -13
  81. package/dist/config/types.js.map +0 -1
  82. package/dist/file-loader.d.ts +0 -20
  83. package/dist/file-loader.d.ts.map +0 -1
  84. package/dist/file-loader.js +0 -121
  85. package/dist/file-loader.js.map +0 -1
  86. package/dist/index.d.ts +0 -9
  87. package/dist/index.d.ts.map +0 -1
  88. package/dist/index.js +0 -11
  89. package/dist/index.js.map +0 -1
  90. package/dist/indexer/cache.d.ts +0 -34
  91. package/dist/indexer/cache.d.ts.map +0 -1
  92. package/dist/indexer/cache.js +0 -221
  93. package/dist/indexer/cache.js.map +0 -1
  94. package/dist/indexer/code-index.d.ts +0 -27
  95. package/dist/indexer/code-index.d.ts.map +0 -1
  96. package/dist/indexer/code-index.js +0 -219
  97. package/dist/indexer/code-index.js.map +0 -1
  98. package/dist/indexer/project-map.d.ts +0 -23
  99. package/dist/indexer/project-map.d.ts.map +0 -1
  100. package/dist/indexer/project-map.js +0 -264
  101. package/dist/indexer/project-map.js.map +0 -1
  102. package/dist/llm/lmstudio-native.d.ts +0 -10
  103. package/dist/llm/lmstudio-native.d.ts.map +0 -1
  104. package/dist/llm/lmstudio-native.js +0 -179
  105. package/dist/llm/lmstudio-native.js.map +0 -1
  106. package/dist/llm/openai-compat.d.ts +0 -11
  107. package/dist/llm/openai-compat.d.ts.map +0 -1
  108. package/dist/llm/openai-compat.js +0 -161
  109. package/dist/llm/openai-compat.js.map +0 -1
  110. package/dist/llm/provider.d.ts +0 -46
  111. package/dist/llm/provider.d.ts.map +0 -1
  112. package/dist/llm/provider.js +0 -13
  113. package/dist/llm/provider.js.map +0 -1
  114. package/dist/llm/token-counter.d.ts +0 -15
  115. package/dist/llm/token-counter.d.ts.map +0 -1
  116. package/dist/llm/token-counter.js +0 -51
  117. package/dist/llm/token-counter.js.map +0 -1
  118. package/dist/logger.d.ts +0 -24
  119. package/dist/logger.d.ts.map +0 -1
  120. package/dist/logger.js +0 -156
  121. package/dist/logger.js.map +0 -1
  122. package/dist/plugins/adapters/hooks-adapter.d.ts +0 -12
  123. package/dist/plugins/adapters/hooks-adapter.d.ts.map +0 -1
  124. package/dist/plugins/adapters/hooks-adapter.js +0 -23
  125. package/dist/plugins/adapters/hooks-adapter.js.map +0 -1
  126. package/dist/plugins/builtin/lint-on-write/index.d.ts +0 -12
  127. package/dist/plugins/builtin/lint-on-write/index.d.ts.map +0 -1
  128. package/dist/plugins/builtin/lint-on-write/index.js +0 -98
  129. package/dist/plugins/builtin/lint-on-write/index.js.map +0 -1
  130. package/dist/plugins/builtin/lint-on-write/index.ts +0 -97
  131. package/dist/plugins/builtin/lint-on-write/manifest.json +0 -13
  132. package/dist/plugins/builtin/notify/index.d.ts +0 -11
  133. package/dist/plugins/builtin/notify/index.d.ts.map +0 -1
  134. package/dist/plugins/builtin/notify/index.js +0 -102
  135. package/dist/plugins/builtin/notify/index.js.map +0 -1
  136. package/dist/plugins/builtin/notify/index.ts +0 -105
  137. package/dist/plugins/builtin/notify/manifest.json +0 -16
  138. package/dist/plugins/loader.d.ts +0 -18
  139. package/dist/plugins/loader.d.ts.map +0 -1
  140. package/dist/plugins/loader.js +0 -182
  141. package/dist/plugins/loader.js.map +0 -1
  142. package/dist/plugins/manager.d.ts +0 -55
  143. package/dist/plugins/manager.d.ts.map +0 -1
  144. package/dist/plugins/manager.js +0 -190
  145. package/dist/plugins/manager.js.map +0 -1
  146. package/dist/plugins/types.d.ts +0 -76
  147. package/dist/plugins/types.d.ts.map +0 -1
  148. package/dist/plugins/types.js +0 -8
  149. package/dist/plugins/types.js.map +0 -1
  150. package/dist/repl/commands.d.ts +0 -63
  151. package/dist/repl/commands.d.ts.map +0 -1
  152. package/dist/repl/commands.js +0 -1070
  153. package/dist/repl/commands.js.map +0 -1
  154. package/dist/repl/history.d.ts +0 -32
  155. package/dist/repl/history.d.ts.map +0 -1
  156. package/dist/repl/history.js +0 -40
  157. package/dist/repl/history.js.map +0 -1
  158. package/dist/repl/index.d.ts +0 -14
  159. package/dist/repl/index.d.ts.map +0 -1
  160. package/dist/repl/index.js +0 -235
  161. package/dist/repl/index.js.map +0 -1
  162. package/dist/session/store.d.ts +0 -46
  163. package/dist/session/store.d.ts.map +0 -1
  164. package/dist/session/store.js +0 -154
  165. package/dist/session/store.js.map +0 -1
  166. package/dist/setup-wizard.d.ts +0 -3
  167. package/dist/setup-wizard.d.ts.map +0 -1
  168. package/dist/setup-wizard.js +0 -410
  169. package/dist/setup-wizard.js.map +0 -1
  170. package/dist/skills/builtin/agent-test/SKILL.md +0 -68
  171. package/dist/skills/builtin/cli-expert/SKILL.md +0 -848
  172. package/dist/skills/builtin/code-review/SKILL.md +0 -424
  173. package/dist/skills/builtin/git-expert/SKILL.md +0 -522
  174. package/dist/skills/builtin/grill-me/SKILL.md +0 -46
  175. package/dist/skills/builtin/jest-testing-expert/SKILL.md +0 -957
  176. package/dist/skills/builtin/nodejs-expert/SKILL.md +0 -192
  177. package/dist/skills/builtin/systematic-debugging/SKILL.md +0 -296
  178. package/dist/skills/builtin/test-driven-development/SKILL.md +0 -371
  179. package/dist/skills/builtin/typescript-expert/SKILL.md +0 -429
  180. package/dist/skills/builtin/web-scraping/SKILL.md +0 -422
  181. package/dist/skills/loader.d.ts +0 -49
  182. package/dist/skills/loader.d.ts.map +0 -1
  183. package/dist/skills/loader.js +0 -401
  184. package/dist/skills/loader.js.map +0 -1
  185. package/dist/styling/engine.d.ts +0 -39
  186. package/dist/styling/engine.d.ts.map +0 -1
  187. package/dist/styling/engine.js +0 -122
  188. package/dist/styling/engine.js.map +0 -1
  189. package/dist/styling/index.d.ts +0 -15
  190. package/dist/styling/index.d.ts.map +0 -1
  191. package/dist/styling/index.js +0 -40
  192. package/dist/styling/index.js.map +0 -1
  193. package/dist/styling/loader.d.ts +0 -9
  194. package/dist/styling/loader.d.ts.map +0 -1
  195. package/dist/styling/loader.js +0 -169
  196. package/dist/styling/loader.js.map +0 -1
  197. package/dist/styling/types.d.ts +0 -64
  198. package/dist/styling/types.d.ts.map +0 -1
  199. package/dist/styling/types.js +0 -12
  200. package/dist/styling/types.js.map +0 -1
  201. package/dist/subagent/chat.d.ts +0 -19
  202. package/dist/subagent/chat.d.ts.map +0 -1
  203. package/dist/subagent/chat.js +0 -279
  204. package/dist/subagent/chat.js.map +0 -1
  205. package/dist/subagent/context.d.ts +0 -9
  206. package/dist/subagent/context.d.ts.map +0 -1
  207. package/dist/subagent/context.js +0 -75
  208. package/dist/subagent/context.js.map +0 -1
  209. package/dist/subagent/definition.d.ts +0 -7
  210. package/dist/subagent/definition.d.ts.map +0 -1
  211. package/dist/subagent/definition.js +0 -26
  212. package/dist/subagent/definition.js.map +0 -1
  213. package/dist/subagent/errors.d.ts +0 -24
  214. package/dist/subagent/errors.d.ts.map +0 -1
  215. package/dist/subagent/errors.js +0 -85
  216. package/dist/subagent/errors.js.map +0 -1
  217. package/dist/subagent/validation.d.ts +0 -17
  218. package/dist/subagent/validation.d.ts.map +0 -1
  219. package/dist/subagent/validation.js +0 -83
  220. package/dist/subagent/validation.js.map +0 -1
  221. package/dist/tools/adapters/bash-to-fs.d.ts +0 -20
  222. package/dist/tools/adapters/bash-to-fs.d.ts.map +0 -1
  223. package/dist/tools/adapters/bash-to-fs.js +0 -74
  224. package/dist/tools/adapters/bash-to-fs.js.map +0 -1
  225. package/dist/tools/adapters/content-sanitizer.d.ts +0 -13
  226. package/dist/tools/adapters/content-sanitizer.d.ts.map +0 -1
  227. package/dist/tools/adapters/content-sanitizer.js +0 -73
  228. package/dist/tools/adapters/content-sanitizer.js.map +0 -1
  229. package/dist/tools/adapters/grounding-fixer.d.ts +0 -15
  230. package/dist/tools/adapters/grounding-fixer.d.ts.map +0 -1
  231. package/dist/tools/adapters/grounding-fixer.js +0 -57
  232. package/dist/tools/adapters/grounding-fixer.js.map +0 -1
  233. package/dist/tools/adapters/index.d.ts +0 -6
  234. package/dist/tools/adapters/index.d.ts.map +0 -1
  235. package/dist/tools/adapters/index.js +0 -5
  236. package/dist/tools/adapters/index.js.map +0 -1
  237. package/dist/tools/adapters/pipeline.d.ts +0 -34
  238. package/dist/tools/adapters/pipeline.d.ts.map +0 -1
  239. package/dist/tools/adapters/pipeline.js +0 -58
  240. package/dist/tools/adapters/pipeline.js.map +0 -1
  241. package/dist/tools/adapters/types.d.ts +0 -46
  242. package/dist/tools/adapters/types.d.ts.map +0 -1
  243. package/dist/tools/adapters/types.js +0 -2
  244. package/dist/tools/adapters/types.js.map +0 -1
  245. package/dist/tools/approve.d.ts +0 -27
  246. package/dist/tools/approve.d.ts.map +0 -1
  247. package/dist/tools/approve.js +0 -45
  248. package/dist/tools/approve.js.map +0 -1
  249. package/dist/tools/bash.d.ts +0 -25
  250. package/dist/tools/bash.d.ts.map +0 -1
  251. package/dist/tools/bash.js +0 -292
  252. package/dist/tools/bash.js.map +0 -1
  253. package/dist/tools/fs/copy-file.d.ts +0 -13
  254. package/dist/tools/fs/copy-file.d.ts.map +0 -1
  255. package/dist/tools/fs/copy-file.js +0 -54
  256. package/dist/tools/fs/copy-file.js.map +0 -1
  257. package/dist/tools/fs/create-dir.d.ts +0 -13
  258. package/dist/tools/fs/create-dir.d.ts.map +0 -1
  259. package/dist/tools/fs/create-dir.js +0 -44
  260. package/dist/tools/fs/create-dir.js.map +0 -1
  261. package/dist/tools/fs/delete-file.d.ts +0 -13
  262. package/dist/tools/fs/delete-file.d.ts.map +0 -1
  263. package/dist/tools/fs/delete-file.js +0 -52
  264. package/dist/tools/fs/delete-file.js.map +0 -1
  265. package/dist/tools/fs/edit-file.d.ts +0 -15
  266. package/dist/tools/fs/edit-file.d.ts.map +0 -1
  267. package/dist/tools/fs/edit-file.js +0 -95
  268. package/dist/tools/fs/edit-file.js.map +0 -1
  269. package/dist/tools/fs/file-info.d.ts +0 -13
  270. package/dist/tools/fs/file-info.d.ts.map +0 -1
  271. package/dist/tools/fs/file-info.js +0 -50
  272. package/dist/tools/fs/file-info.js.map +0 -1
  273. package/dist/tools/fs/glob-search.d.ts +0 -13
  274. package/dist/tools/fs/glob-search.d.ts.map +0 -1
  275. package/dist/tools/fs/glob-search.js +0 -112
  276. package/dist/tools/fs/glob-search.js.map +0 -1
  277. package/dist/tools/fs/grep-search.d.ts +0 -14
  278. package/dist/tools/fs/grep-search.d.ts.map +0 -1
  279. package/dist/tools/fs/grep-search.js +0 -135
  280. package/dist/tools/fs/grep-search.js.map +0 -1
  281. package/dist/tools/fs/list-dir.d.ts +0 -13
  282. package/dist/tools/fs/list-dir.d.ts.map +0 -1
  283. package/dist/tools/fs/list-dir.js +0 -74
  284. package/dist/tools/fs/list-dir.js.map +0 -1
  285. package/dist/tools/fs/move-file.d.ts +0 -13
  286. package/dist/tools/fs/move-file.d.ts.map +0 -1
  287. package/dist/tools/fs/move-file.js +0 -54
  288. package/dist/tools/fs/move-file.js.map +0 -1
  289. package/dist/tools/fs/path-utils.d.ts +0 -51
  290. package/dist/tools/fs/path-utils.d.ts.map +0 -1
  291. package/dist/tools/fs/path-utils.js +0 -103
  292. package/dist/tools/fs/path-utils.js.map +0 -1
  293. package/dist/tools/fs/read-file.d.ts +0 -13
  294. package/dist/tools/fs/read-file.d.ts.map +0 -1
  295. package/dist/tools/fs/read-file.js +0 -64
  296. package/dist/tools/fs/read-file.js.map +0 -1
  297. package/dist/tools/fs/tree.d.ts +0 -13
  298. package/dist/tools/fs/tree.d.ts.map +0 -1
  299. package/dist/tools/fs/tree.js +0 -89
  300. package/dist/tools/fs/tree.js.map +0 -1
  301. package/dist/tools/fs/types.d.ts +0 -14
  302. package/dist/tools/fs/types.d.ts.map +0 -1
  303. package/dist/tools/fs/types.js +0 -11
  304. package/dist/tools/fs/types.js.map +0 -1
  305. package/dist/tools/fs/write-file.d.ts +0 -14
  306. package/dist/tools/fs/write-file.d.ts.map +0 -1
  307. package/dist/tools/fs/write-file.js +0 -83
  308. package/dist/tools/fs/write-file.js.map +0 -1
  309. package/dist/tools/hooks.d.ts +0 -44
  310. package/dist/tools/hooks.d.ts.map +0 -1
  311. package/dist/tools/hooks.js +0 -217
  312. package/dist/tools/hooks.js.map +0 -1
  313. package/dist/tools/id-gen.d.ts +0 -4
  314. package/dist/tools/id-gen.d.ts.map +0 -1
  315. package/dist/tools/id-gen.js +0 -12
  316. package/dist/tools/id-gen.js.map +0 -1
  317. package/dist/tools/mcp.d.ts +0 -36
  318. package/dist/tools/mcp.d.ts.map +0 -1
  319. package/dist/tools/mcp.js +0 -93
  320. package/dist/tools/mcp.js.map +0 -1
  321. package/dist/tools/native/approve.d.ts +0 -11
  322. package/dist/tools/native/approve.d.ts.map +0 -1
  323. package/dist/tools/native/approve.js +0 -39
  324. package/dist/tools/native/approve.js.map +0 -1
  325. package/dist/tools/native/plan.d.ts +0 -10
  326. package/dist/tools/native/plan.d.ts.map +0 -1
  327. package/dist/tools/native/plan.js +0 -115
  328. package/dist/tools/native/plan.js.map +0 -1
  329. package/dist/tools/native/project-map.d.ts +0 -15
  330. package/dist/tools/native/project-map.d.ts.map +0 -1
  331. package/dist/tools/native/project-map.js +0 -203
  332. package/dist/tools/native/project-map.js.map +0 -1
  333. package/dist/tools/native/question.d.ts +0 -11
  334. package/dist/tools/native/question.d.ts.map +0 -1
  335. package/dist/tools/native/question.js +0 -41
  336. package/dist/tools/native/question.js.map +0 -1
  337. package/dist/tools/native/scaffold.d.ts +0 -5
  338. package/dist/tools/native/scaffold.d.ts.map +0 -1
  339. package/dist/tools/native/scaffold.js +0 -246
  340. package/dist/tools/native/scaffold.js.map +0 -1
  341. package/dist/tools/native/theme.d.ts +0 -10
  342. package/dist/tools/native/theme.d.ts.map +0 -1
  343. package/dist/tools/native/theme.js +0 -101
  344. package/dist/tools/native/theme.js.map +0 -1
  345. package/dist/tools/native/todo.d.ts +0 -10
  346. package/dist/tools/native/todo.d.ts.map +0 -1
  347. package/dist/tools/native/todo.js +0 -58
  348. package/dist/tools/native/todo.js.map +0 -1
  349. package/dist/tools/native/user-profile.d.ts +0 -10
  350. package/dist/tools/native/user-profile.d.ts.map +0 -1
  351. package/dist/tools/native/user-profile.js +0 -58
  352. package/dist/tools/native/user-profile.js.map +0 -1
  353. package/dist/tools/parse-tool-call.d.ts +0 -11
  354. package/dist/tools/parse-tool-call.d.ts.map +0 -1
  355. package/dist/tools/parse-tool-call.js +0 -87
  356. package/dist/tools/parse-tool-call.js.map +0 -1
  357. package/dist/tools/plan.d.ts +0 -40
  358. package/dist/tools/plan.d.ts.map +0 -1
  359. package/dist/tools/plan.js +0 -143
  360. package/dist/tools/plan.js.map +0 -1
  361. package/dist/tools/question.d.ts +0 -33
  362. package/dist/tools/question.d.ts.map +0 -1
  363. package/dist/tools/question.js +0 -62
  364. package/dist/tools/question.js.map +0 -1
  365. package/dist/tools/registry.d.ts +0 -37
  366. package/dist/tools/registry.d.ts.map +0 -1
  367. package/dist/tools/registry.js +0 -97
  368. package/dist/tools/registry.js.map +0 -1
  369. package/dist/tools/sanitizer.d.ts +0 -30
  370. package/dist/tools/sanitizer.d.ts.map +0 -1
  371. package/dist/tools/sanitizer.js +0 -77
  372. package/dist/tools/sanitizer.js.map +0 -1
  373. package/dist/tools/subagent.d.ts +0 -39
  374. package/dist/tools/subagent.d.ts.map +0 -1
  375. package/dist/tools/subagent.js +0 -225
  376. package/dist/tools/subagent.js.map +0 -1
  377. package/dist/tools/syntax-check.d.ts +0 -32
  378. package/dist/tools/syntax-check.d.ts.map +0 -1
  379. package/dist/tools/syntax-check.js +0 -272
  380. package/dist/tools/syntax-check.js.map +0 -1
  381. package/dist/tools/todo.d.ts +0 -28
  382. package/dist/tools/todo.d.ts.map +0 -1
  383. package/dist/tools/todo.js +0 -125
  384. package/dist/tools/todo.js.map +0 -1
  385. package/dist/tools/types.d.ts +0 -51
  386. package/dist/tools/types.d.ts.map +0 -1
  387. package/dist/tools/types.js +0 -2
  388. package/dist/tools/types.js.map +0 -1
  389. package/dist/tools/web-browse.d.ts +0 -5
  390. package/dist/tools/web-browse.d.ts.map +0 -1
  391. package/dist/tools/web-browse.js +0 -757
  392. package/dist/tools/web-browse.js.map +0 -1
  393. package/dist/tools/web-fetch.d.ts +0 -19
  394. package/dist/tools/web-fetch.d.ts.map +0 -1
  395. package/dist/tools/web-fetch.js +0 -90
  396. package/dist/tools/web-fetch.js.map +0 -1
  397. package/dist/tools/web-search.d.ts +0 -19
  398. package/dist/tools/web-search.d.ts.map +0 -1
  399. package/dist/tools/web-search.js +0 -97
  400. package/dist/tools/web-search.js.map +0 -1
  401. package/dist/ui/components/status-bar.d.ts +0 -11
  402. package/dist/ui/components/status-bar.d.ts.map +0 -1
  403. package/dist/ui/components/status-bar.js +0 -20
  404. package/dist/ui/components/status-bar.js.map +0 -1
  405. package/dist/ui/index.d.ts +0 -8
  406. package/dist/ui/index.d.ts.map +0 -1
  407. package/dist/ui/index.js +0 -9
  408. package/dist/ui/index.js.map +0 -1
  409. package/dist/ui/ink/components/App.d.ts +0 -98
  410. package/dist/ui/ink/components/App.d.ts.map +0 -1
  411. package/dist/ui/ink/components/App.js +0 -212
  412. package/dist/ui/ink/components/App.js.map +0 -1
  413. package/dist/ui/ink/components/Conversation.d.ts +0 -20
  414. package/dist/ui/ink/components/Conversation.d.ts.map +0 -1
  415. package/dist/ui/ink/components/Conversation.js +0 -15
  416. package/dist/ui/ink/components/Conversation.js.map +0 -1
  417. package/dist/ui/ink/components/MessageBlock.d.ts +0 -27
  418. package/dist/ui/ink/components/MessageBlock.d.ts.map +0 -1
  419. package/dist/ui/ink/components/MessageBlock.js +0 -41
  420. package/dist/ui/ink/components/MessageBlock.js.map +0 -1
  421. package/dist/ui/ink/components/PromptInput.d.ts +0 -25
  422. package/dist/ui/ink/components/PromptInput.d.ts.map +0 -1
  423. package/dist/ui/ink/components/PromptInput.js +0 -167
  424. package/dist/ui/ink/components/PromptInput.js.map +0 -1
  425. package/dist/ui/ink/components/SelectInput.d.ts +0 -9
  426. package/dist/ui/ink/components/SelectInput.d.ts.map +0 -1
  427. package/dist/ui/ink/components/SelectInput.js +0 -30
  428. package/dist/ui/ink/components/SelectInput.js.map +0 -1
  429. package/dist/ui/ink/components/StatusBar.d.ts +0 -14
  430. package/dist/ui/ink/components/StatusBar.d.ts.map +0 -1
  431. package/dist/ui/ink/components/StatusBar.js +0 -20
  432. package/dist/ui/ink/components/StatusBar.js.map +0 -1
  433. package/dist/ui/ink/components/StreamBlock.d.ts +0 -8
  434. package/dist/ui/ink/components/StreamBlock.d.ts.map +0 -1
  435. package/dist/ui/ink/components/StreamBlock.js +0 -15
  436. package/dist/ui/ink/components/StreamBlock.js.map +0 -1
  437. package/dist/ui/ink/components/Tags.d.ts +0 -26
  438. package/dist/ui/ink/components/Tags.d.ts.map +0 -1
  439. package/dist/ui/ink/components/Tags.js +0 -37
  440. package/dist/ui/ink/components/Tags.js.map +0 -1
  441. package/dist/ui/ink/components/ToolCallBlock.d.ts +0 -31
  442. package/dist/ui/ink/components/ToolCallBlock.d.ts.map +0 -1
  443. package/dist/ui/ink/components/ToolCallBlock.js +0 -17
  444. package/dist/ui/ink/components/ToolCallBlock.js.map +0 -1
  445. package/dist/ui/ink/renderer.d.ts +0 -69
  446. package/dist/ui/ink/renderer.d.ts.map +0 -1
  447. package/dist/ui/ink/renderer.js +0 -142
  448. package/dist/ui/ink/renderer.js.map +0 -1
  449. package/dist/ui/ink/theme.d.ts +0 -28
  450. package/dist/ui/ink/theme.d.ts.map +0 -1
  451. package/dist/ui/ink/theme.js +0 -45
  452. package/dist/ui/ink/theme.js.map +0 -1
  453. package/dist/ui/md-formatter.d.ts +0 -16
  454. package/dist/ui/md-formatter.d.ts.map +0 -1
  455. package/dist/ui/md-formatter.js +0 -448
  456. package/dist/ui/md-formatter.js.map +0 -1
  457. package/dist/ui/readline-renderer.d.ts +0 -45
  458. package/dist/ui/readline-renderer.d.ts.map +0 -1
  459. package/dist/ui/readline-renderer.js +0 -181
  460. package/dist/ui/readline-renderer.js.map +0 -1
  461. package/dist/ui/renderer.d.ts +0 -66
  462. package/dist/ui/renderer.d.ts.map +0 -1
  463. package/dist/ui/renderer.js +0 -16
  464. package/dist/ui/renderer.js.map +0 -1
  465. package/dist/ui/subagent-renderer.d.ts +0 -58
  466. package/dist/ui/subagent-renderer.d.ts.map +0 -1
  467. package/dist/ui/subagent-renderer.js +0 -100
  468. package/dist/ui/subagent-renderer.js.map +0 -1
  469. package/dist/updater.d.ts +0 -15
  470. package/dist/updater.d.ts.map +0 -1
  471. package/dist/updater.js +0 -166
  472. package/dist/updater.js.map +0 -1
@@ -1,478 +0,0 @@
1
- import { readFileSync, existsSync } from "node:fs";
2
- import { resolve } from "node:path";
3
- import * as os from "node:os";
4
- import { loadAllMemoryDetailed } from "./memory.js";
5
- import { loadProfileSummary } from "./user-profile.js";
6
- import { getOrBuildProjectMap } from "../indexer/cache.js";
7
- import { loadAgentsMd, listSkillsWithDescriptions, formatSkillsBlock, invalidateSkillCaches, } from "../skills/loader.js";
8
- import { logInfo, logDebug } from "../logger.js";
9
- import { ALL_DEFINITIONS } from "../tools/registry.js";
10
- /**
11
- * Build system prompt for the LLM agent.
12
- *
13
- * System prompt is assembled from multiple blocks:
14
- * - Core agent behavior instructions
15
- * - Project info (package.json, dependencies)
16
- * - Project tech stack
17
- * - Installed skills
18
- * - User profile (agent observations)
19
- * - Agent memory (long-term knowledge)
20
- * - Safe behavior rules
21
- *
22
- * System prompt is cached: when context is unchanged,
23
- * it is not rebuilt (invalidation by hash).
24
- *
25
- * @module agent/system-prompt
26
- */
27
- // ─── Tool format ──────────────────────────────────────
28
- // System prompt block describing the tool calling format
29
- const TOOL_FORMAT = generateToolFormatString(ALL_DEFINITIONS);
30
- function generateToolFormatString(defs) {
31
- const lines = [
32
- "CRITICAL: Use filesystem tools for file operations — they are more reliable than bash.",
33
- "",
34
- "To call a tool, output EXACTLY this format (on its own line):",
35
- "",
36
- '<tool_call>{"name":"tool_name","arguments":{...}}</tool_call>',
37
- "",
38
- ];
39
- const toolExamples = {
40
- subagent: [
41
- '{"name":"subagent","arguments":{"task":"Create src/db.ts: sqlite connection","existingFiles":"package.json"}}',
42
- '{"name":"subagent","arguments":{"task":"Run tsc --noEmit to check types"}}',
43
- ],
44
- bash: [
45
- '{"name":"bash","arguments":{"cmd":"npm test"}}',
46
- '{"name":"bash","arguments":{"cmd":"git status"}}',
47
- ],
48
- read_file: [
49
- '{"name":"read_file","arguments":{"path":"src/index.ts"}}',
50
- '{"name":"read_file","arguments":{"path":"src/index.ts","offset":50,"limit":100}}',
51
- ],
52
- write_file: [
53
- '{"name":"write_file","arguments":{"path":"src/utils.ts","content":"export function foo() { return 1; }"}}',
54
- ],
55
- edit_file: [
56
- '{"name":"edit_file","arguments":{"path":"src/index.ts","old_string":"old text","new_string":"new text"}}',
57
- ],
58
- list_dir: [
59
- '{"name":"list_dir","arguments":{}}',
60
- '{"name":"list_dir","arguments":{"path":"src"}}',
61
- ],
62
- web_search: [
63
- '{"name":"web_search","arguments":{"query":"weather in Minsk","maxResults":5}}',
64
- ],
65
- web_fetch: [
66
- '{"name":"web_fetch","arguments":{"url":"https://example.com"}}',
67
- ],
68
- web_browse: [
69
- '{"name":"web_browse","arguments":{"action":"navigate","url":"https://example.com"}}',
70
- '{"name":"web_browse","arguments":{"action":"scrape","url":"https://example.com/catalog"}}',
71
- '{"name":"web_browse","arguments":{"action":"click","selector":"button.submit"}}',
72
- '{"name":"web_browse","arguments":{"action":"screenshot"}}',
73
- ],
74
- plan: [
75
- '{"name":"plan","arguments":{"action":"create","name":"Todo App","steps":["Step 1","Step 2"]}}',
76
- '{"name":"plan","arguments":{"action":"done","step":1}}',
77
- ],
78
- todo: [
79
- '{"name":"todo","arguments":{"action":"add","text":"Implement feature X"}}',
80
- ],
81
- question: [
82
- '{"name":"question","arguments":{"question":"What color?","choices":["Red","Blue"]}}',
83
- ],
84
- approve: ['{"name":"approve","arguments":{"action":"Delete file foo.ts"}}'],
85
- user_profile: ['{"name":"user_profile","arguments":{"action":"show"}}'],
86
- theme: [
87
- '{"name":"theme","arguments":{"action":"list"}}',
88
- '{"name":"theme","arguments":{"action":"switch","name":"dark"}}',
89
- ],
90
- project_map: [
91
- '{"name":"project_map","arguments":{"action":"list"}}',
92
- '{"name":"project_map","arguments":{"action":"info","path":"src/App.tsx"}}',
93
- ],
94
- scaffold: [
95
- '{"name":"scaffold","arguments":{"template":"vite-react-ts","dir":"my-app"}}',
96
- ],
97
- create_dir: [],
98
- delete_file: [],
99
- copy_file: [],
100
- move_file: [],
101
- file_info: [],
102
- glob_search: [],
103
- grep_search: [],
104
- tree: [],
105
- };
106
- for (const def of defs) {
107
- const name = def.function.name;
108
- const desc = def.function.description;
109
- const examples = toolExamples[name] || [];
110
- lines.push(`## ${name} — ${desc}`);
111
- for (const ex of examples) {
112
- lines.push(` ${ex}`);
113
- }
114
- lines.push("");
115
- }
116
- lines.push("NEVER output tool calls in any other format. ALWAYS use <tool_call> tags.");
117
- return lines.join("\n");
118
- }
119
- // ─── Conversation flow ──────────────────────────────────
120
- // System prompt block explaining how the dialog cycle works
121
- const CONVERSATION_FLOW = `## How This Works (IMPORTANT — read this carefully)
122
-
123
- You are in a loop. Each turn works like this:
124
-
125
- 1. User sends a message
126
- 2. You respond with TEXT and/or TOOL CALLS
127
- 3. Tool results appear — then it is YOUR TURN AGAIN
128
- 4. Repeat until the task is done
129
-
130
- ### What you see after a tool executes:
131
-
132
- You will see a message like:
133
- [tool result: "Written 42 bytes (3 lines) to src/index.ts"]
134
-
135
- This is NOT the end. You MUST continue:
136
- - If more files need work → call the next tool
137
- - If the task is done → write a summary to the user
138
- - If there was an error → explain it and fix it
139
-
140
- ### Example conversation:
141
-
142
- User: "Create a file src/utils.ts with a hello function"
143
-
144
- You:
145
- <tool_call>{"name":"write_file","arguments":{"path":"src/utils.ts","content":"export function hello() { return 'world'; }"}}</tool_call>
146
-
147
- [Tool result: "Written 52 bytes (1 lines) to src/utils.ts"]
148
-
149
- You:
150
- File src/utils.ts created successfully. It exports a hello() function that returns 'world'.
151
-
152
- ---
153
-
154
- NEVER stop after a tool call. ALWAYS continue with either another tool call or a text reply.`;
155
- const R = {
156
- fs_tools: `Use filesystem tools for file operations (read_file, write_file, edit_file, list_dir, glob_search, grep_search, tree). Use bash ONLY for non-file commands (npm, git, etc).`,
157
- user_language: `Always respond in the user's language (Russian or English). Do NOT mix languages in one response — pick ONE and stick with it.`,
158
- check_result: `CRITICAL: After every tool call, CHECK the result (exit code + output).
159
- If exit code != 0, DO NOT claim success — tell the user about the error.
160
- Verify files were created before saying "done".`,
161
- no_empty: `NEVER return an empty response. After receiving a tool result, you MUST either:
162
- a) Call another tool (if more work is needed), OR
163
- b) Write a text response to the user (summarize what was done, report errors, ask questions).
164
- Staying silent after a tool result is always wrong.`,
165
- valid_json: `The JSON inside <tool_call> must be VALID JSON. Escape " inside values as \\".
166
- For grep_search patterns: escape regex special chars with \\ (e.g. \\. for literal dot, \\( for literal paren).
167
- Do NOT put quotes inside the pattern — it searches for literal quote characters.`,
168
- large_files: `For large files (>500 lines), prefer grep_search to find specific content:
169
- {"name":"grep_search","arguments":{"pattern":"function","include":"*.ts"}}
170
- Only use read_file with offset/limit when you need to SEE the full file context.
171
- Do NOT call read_file multiple times on the same file sequentially — use grep first.`,
172
- // ── Base/Pro only ──
173
- planning_skills: `SKILLS AND PLANNING: For complex tasks (3+ steps):
174
- a. AUTOMATICALLY load relevant skills by mentioning them: "@nodejs-expert @typescript-expert"
175
- b. Do NOT ask the user — just load and start working
176
- c. Create a plan with SPECIFIC STEP NAMES: plan({action:"create", name:"TodoApp", steps:["Create package.json and install deps", "Create src/App.tsx", "Create src/main.tsx", "Verify with tsc --noEmit"]})
177
- d. For each step: use subagent to create the file, then mark step done: plan({action:"done", step:1})
178
- e. Do NOT use write_file directly when a plan is active — delegate to subagents
179
- f. ONE FILE PER STEP — never combine multiple files in one step`,
180
- simple_tasks: `FOR SIMPLE TASKS (1-2 steps): Just do it, no plan needed. Use common sense.`,
181
- never_just_talk_common: `NEVER JUST TALK — ALWAYS ACT. Do NOT say "write skills in the next message" or similar waiting phrases. If skills are loaded, START WORKING IMMEDIATELY.`,
182
- skills_loaded: `When skills are already loaded in your context, you MUST use filesystem tools (write_file, create_dir, etc.) for file operations. Do NOT ask the user to load skills again.`,
183
- user_profile_common: `USER PROFILE: The ## User Profile block contains observations about the user (name, stack, style). Use it silently — never mention or comment on it to the user. Do NOT proactively ask for the user's name or personal details. Never call user_profile, list_dir, tree, or any other tool just for exploration — only use tools when there is actual work to do.`,
184
- no_list_dir_common: `NEVER call list_dir or tree just to "see what's in the project". Use glob_search or grep_search instead — they give more useful results. Only use list_dir when a user explicitly asks to see a directory listing.`,
185
- off_topic_common: `OFF-TOPIC QUESTIONS: If the user asks something unrelated to coding (jokes, space, cooking, etc.), answer briefly and warmly — 1-2 sentences. Do NOT refuse or say "I'm a coding assistant". Just answer, then naturally offer to return to work.`,
186
- one_file_common: `ONE FILE AT A TIME: When creating multiple files: a) Write the FIRST file completely, b) Wait for syntax check result, c) If error → fix it before continuing, d) Only then write the NEXT file. NEVER write multiple files in one response — small models lose track.`,
187
- subagents_common: `SUBAGENTS — strict delegation for multi-file projects:
188
- ABSOLUTE RULE: 1 FILE = 1 SUBAGENT CALL. No exceptions.
189
- - Every file in the plan gets its OWN subagent call.
190
- - NEVER combine multiple files in one subagent task.
191
- - If plan has 5 files → 5 separate subagent calls.
192
- - Task description MUST include the FULL path: "Create ONLY src/db.ts" not just "db.ts".
193
- CRITICAL RULES FOR SUBAGENT:
194
- - Subagent MUST create ONLY what is in the task description. Do NOT create extra files.
195
- - If task says "Create src/db.ts" — create ONLY src/db.ts. Nothing else.
196
- - NEVER let subagent "help" by creating additional files beyond the task scope.
197
- - After subagent completes, parent checks what was created and verifies it matches the plan.
198
- Example: subagent({task:"Create ONLY src/db.ts with sqlite connection", existingFiles:"src/types.ts"})
199
- Do NOT use subagent for:
200
- - Editing existing files (use edit_file directly)
201
- - Bash commands like npm install, git, etc. (use bash tool)
202
- Each subagent gets fresh context. Parent only tracks results (summary). After all subagents — verify with tsc --noEmit.`,
203
- check_before_install: `CHECK BEFORE INSTALLING: Read the project dependency file. If the package is already listed — do not install it.`,
204
- file_extensions: `FILE EXTENSIONS MATTER: .tsx for TypeScript, .jsx for plain JavaScript. Check existing files to determine which stack the project uses.`,
205
- user_answers: `USER ANSWERS: When you see "User answered: X" in the conversation, this is the user's response to your question. Use it and proceed. NEVER ask the same question again.`,
206
- project_map_common: `PROJECT MAP FIRST: ALWAYS check the ## Project Map section in your context BEFORE reading any files. The map shows ALL files in the project with their paths. If a file is not in the map — it doesn't exist. Do NOT guess file paths — use the map. If the map shows files inside a subdirectory (e.g. my-project/src/App.tsx), that's where the actual project lives — work inside that subdirectory.`,
207
- subagent_context_common: `SUBAGENT CONTEXT: When calling subagent, ALWAYS pass:
208
- - existingFiles: files already created in this session (prevents duplicates)
209
- - The task description should say "Create ONLY file X" — not "Create file X and related files"
210
- Example: subagent({task:"Create ONLY src/api.ts with Express CRUD", existingFiles:"src/db.ts,src/types.ts"})
211
- The subagent will see the project context and should NOT create files beyond what's in the task.`,
212
- web_tools: `WEB TOOLS STRATEGY:
213
- a. For data extraction (products, listings, cards): use web_browse(action:"scrape") — ONE call navigates, scrolls, discovers, and extracts.
214
- b. For simple pages (blogs, docs, API): use web_fetch — lightweight, no browser needed.
215
- c. For interactive pages (login, forms, search): navigate → click/type → wait → scrape.
216
- d. Retry scrape with a custom pattern if the default misses content: {pattern:"product|card|item"}.`,
217
- // ── Fast mode only ──
218
- execute_directly: `Execute tasks directly. Simple tasks (1-2 steps): just do it without commentary. Complex tasks: break into steps and execute ONE FILE AT A TIME. Write first file → check syntax → fix if needed → then next file.`,
219
- never_just_talk_fast: `NEVER JUST TALK — ALWAYS ACT. Do NOT say "write" or similar waiting phrases. START WORKING IMMEDIATELY.`,
220
- user_profile_fast: `USER PROFILE: The ## User Profile block contains observations about the user (name, stack, style). Use it silently — never mention or comment on it to the user. Do NOT proactively ask for the user's name or personal details. Never call tools just for exploration.`,
221
- no_list_dir_fast: `NEVER call list_dir or tree just to "see what's in the project". Use glob_search or grep_search instead. Only use list_dir when explicitly asked.`,
222
- off_topic_fast: `OFF-TOPIC QUESTIONS: Answer briefly and warmly (1-2 sentences). Do NOT refuse. Then offer to return to work.`,
223
- one_file_fast: `ONE FILE AT A TIME: When creating multiple files, complete each file fully before starting the next. NEVER write multiple files in one response.`,
224
- subagents_fast: `SUBAGENTS: 1 FILE = 1 SUBAGENT CALL. Every file gets its own subagent. NEVER combine multiple files in one task. Task MUST include FULL path (e.g. "Create ONLY src/db.ts"). Subagent MUST create ONLY what is in the task — no extra files. Do NOT use subagent for bash or edits.`,
225
- project_map_fast: `PROJECT MAP FIRST: ALWAYS check the ## Project Map section in your context BEFORE reading any files. The map shows ALL files in the project with their paths. If a file is not in the map — it doesn't exist. Do NOT guess file paths — use the map. If the map shows files inside a subdirectory, that's where the actual project lives — work inside that subdirectory.`,
226
- subagent_context_fast: `SUBAGENT CONTEXT: When calling subagent, pass existingFiles and use "Create ONLY" in task. Example: subagent({task:"Create ONLY X.ts with debounce function", existingFiles:"Y.ts"})`,
227
- };
228
- function composeRules(keys) {
229
- return "Rules:\n" + keys.map((k, i) => `${i + 1}. ${R[k]}`).join("\n");
230
- }
231
- const RULES_COMMON = composeRules([
232
- "fs_tools",
233
- "user_language",
234
- "check_result",
235
- "no_empty",
236
- "valid_json",
237
- "large_files",
238
- "planning_skills",
239
- "simple_tasks",
240
- "never_just_talk_common",
241
- "skills_loaded",
242
- "user_profile_common",
243
- "no_list_dir_common",
244
- "off_topic_common",
245
- "one_file_common",
246
- "subagents_common",
247
- "check_before_install",
248
- "file_extensions",
249
- "user_answers",
250
- "project_map_common",
251
- "subagent_context_common",
252
- "web_tools",
253
- ]);
254
- const RULES_FAST = composeRules([
255
- "fs_tools",
256
- "user_language",
257
- "check_result",
258
- "no_empty",
259
- "valid_json",
260
- "large_files",
261
- "execute_directly",
262
- "never_just_talk_fast",
263
- "user_profile_fast",
264
- "no_list_dir_fast",
265
- "off_topic_fast",
266
- "one_file_fast",
267
- "subagents_fast",
268
- "check_before_install",
269
- "file_extensions",
270
- "user_answers",
271
- "project_map_fast",
272
- "subagent_context_fast",
273
- "web_tools",
274
- ]);
275
- const POWERSHELL_EXAMPLES = `Examples (PowerShell):
276
- <tool_call>{"name":"bash","arguments":{"cmd":"dir"}}</tool_call>
277
- <tool_call>{"name":"bash","arguments":{"cmd":"Get-Content src\\\\index.ts"}}</tool_call>
278
- <tool_call>{"name":"bash","arguments":{"cmd":"npm test"}}</tool_call>
279
- <tool_call>{"name":"bash","arguments":{"cmd":"Set-Content -Path file.md -Value 'Hello World'"}}</tool_call>`;
280
- const POWERSHELL_RULES = `PowerShell specifics:
281
- - NEVER use && in commands — PowerShell doesn't support it. Use ; instead, or make separate bash calls.
282
- WRONG: cd my-app && npm install
283
- RIGHT: npm install (run from my-app directory)
284
- RIGHT: Set-Location my-app; npm install
285
- - Use Get-ChildItem (NOT dir /s) to list files recursively.
286
- WRONG: dir /s src (PowerShell interprets /s as a path, not a flag)
287
- RIGHT: Get-ChildItem -Recurse src
288
- - Create/write files: Set-Content -Path file.md -Value "content"
289
- - Append to file: Add-Content -Path file.md -Value "line"
290
- - Read files: Get-Content file.md
291
- - List directory: Get-ChildItem (or dir)
292
- - List directory recursively: Get-ChildItem -Recurse
293
- - Create directories: New-Item -ItemType Directory -Force -Path "folder"
294
- - NEVER use: echo -e, cat (use Get-Content), mkdir -p, cp, mv, sed (PowerShell has different syntax)
295
- - NEVER use single quotes for strings with \\n, \\t — use DOUBLE quotes: "line1\\nline2"
296
- - Paths use backslashes: src\\index.ts
297
- - Check file exists: Test-Path file.md
298
- - Install deps: npm install (NOT npm i)
299
- - Run dev: npm run dev (NOT npx tsx watch)
300
- - Run status checks: git status (works fine, no special syntax needed)`;
301
- const UNIX_EXAMPLES = `Examples (Linux/macOS):
302
- <tool_call>{"name":"bash","arguments":{"cmd":"ls -la"}}</tool_call>
303
- <tool_call>{"name":"bash","arguments":{"cmd":"cat src/index.ts"}}</tool_call>
304
- <tool_call>{"name":"bash","arguments":{"cmd":"npm test"}}</tool_call>
305
- <tool_call>{"name":"bash","arguments":{"cmd":"echo 'Hello World' > file.md"}}</tool_call>`;
306
- const UNIX_RULES = `Unix specifics:
307
- - Create/write files: echo "content" > file.md
308
- - Read files: cat file.md
309
- - List directory: ls -la
310
- - Paths use forward slashes: src/index.ts
311
- - Check file exists: test -f file.md`;
312
- // ─── System prompt cache ────────────────────────────────
313
- // Caches the assembled prompt by key (cwd + mode + skills)
314
- const systemPromptCache = new Map();
315
- /** Invalidate system prompt cache (called when config changes) */
316
- export function invalidateSystemPromptCache() {
317
- systemPromptCache.clear();
318
- invalidateSkillCaches();
319
- }
320
- /**
321
- * Assembles system prompt from all blocks.
322
- *
323
- * Algorithm:
324
- * 1. Check cache by key (cwd + mode + skill names)
325
- * 2. Build header (agent name, description)
326
- * 3. Platform-dependent blocks (PowerShell/Unix examples + rules)
327
- * 4. System info (date, OS, path, project)
328
- * 5. Agent memory + user profile
329
- * 6. Project map (indexer)
330
- * 7. Instructions from AGENTS.md
331
- * 8. Available skills hint
332
- * 9. Current mode block (fast/pro/base)
333
- * 10. Loaded skill content
334
- *
335
- * @param extraSkills - additional skills from user prompt
336
- * @param mode - working mode (fast/pro/base)
337
- * @returns Assembled system prompt string
338
- */
339
- export function buildSystemPrompt(extraSkills, mode, flags) {
340
- const start = performance.now();
341
- // Cache key: current directory + mode + skill names (sorted)
342
- const key = `${process.cwd()}:${mode || "base"}:${extraSkills
343
- ?.map((s) => s.name)
344
- .sort()
345
- .join(",") || ""}`;
346
- const cached = systemPromptCache.get(key);
347
- if (cached) {
348
- logDebug("SYSTEM", "buildSystemPrompt: cache hit");
349
- return cached;
350
- }
351
- logDebug("SYSTEM", "buildSystemPrompt: building from scratch");
352
- const isWin = os.platform() === "win32";
353
- const platformName = isWin ? "Windows" : os.platform();
354
- let osVersion = platformName;
355
- try {
356
- osVersion += ` (${os.version()})`;
357
- }
358
- catch {
359
- /* ignore */
360
- }
361
- const now = new Date();
362
- const dateStr = now.toLocaleDateString("en-US", {
363
- year: "numeric",
364
- month: "long",
365
- day: "numeric",
366
- weekday: "long",
367
- });
368
- const timeStr = now.toLocaleTimeString("en-US");
369
- let projectName = "unknown";
370
- const pkgPath = resolve(process.cwd(), "package.json");
371
- if (existsSync(pkgPath)) {
372
- try {
373
- const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
374
- // Читаем ТОЛЬКО имя проекта — никакие другие поля package.json
375
- // не должны попадать в system prompt (возможны токены, apiKey и т.д.)
376
- if (typeof pkg.name === "string" && pkg.name) {
377
- projectName = pkg.name;
378
- }
379
- }
380
- catch {
381
- /* ignore */
382
- }
383
- }
384
- const rules = mode === "fast" ? RULES_FAST : RULES_COMMON;
385
- const platformBlock = isWin
386
- ? [
387
- TOOL_FORMAT,
388
- CONVERSATION_FLOW,
389
- POWERSHELL_EXAMPLES,
390
- rules,
391
- POWERSHELL_RULES,
392
- ].join("\n\n")
393
- : [TOOL_FORMAT, CONVERSATION_FLOW, UNIX_EXAMPLES, rules, UNIX_RULES].join("\n\n");
394
- const header = `You are Micro Models Agent (MMA), an AI coding assistant.
395
- You help with software engineering tasks in the project directory.`;
396
- const sysInfo = [
397
- "",
398
- "## System",
399
- `Date: ${dateStr}`,
400
- `Time: ${timeStr}`,
401
- `OS: ${osVersion}`,
402
- `Node.js: ${process.version}`,
403
- `CWD: ${process.cwd()}`,
404
- `Project: ${projectName}`,
405
- "",
406
- ].join("\n");
407
- // ─── Memory and user profile ──────────────────────────
408
- const memory = loadAllMemoryDetailed();
409
- const userProfile = loadProfileSummary();
410
- // ─── Project map (from indexer) ───────────────────────
411
- let projectMap = "";
412
- try {
413
- const { formatted, fromCache } = getOrBuildProjectMap(process.cwd());
414
- if (formatted) {
415
- projectMap = `\n## Project Map${fromCache ? " (cached)" : ""}\n${formatted}`;
416
- }
417
- }
418
- catch {
419
- /* ignore */
420
- }
421
- // ─── Project instructions (AGENTS.md) ─────────────────
422
- const agentsMd = flags?.dev ? null : loadAgentsMd(process.cwd());
423
- const agentsBlock = agentsMd
424
- ? `\n## Project Instructions (AGENTS.md)\n${agentsMd}`
425
- : "";
426
- // ─── Available skills hint ────────────────────────────
427
- const allSkills = listSkillsWithDescriptions();
428
- const truncateDesc = (d, max = 100) => d.length <= max ? d : d.slice(0, max - 1) + "…";
429
- const skillsHint = allSkills.length > 0
430
- ? `\n## Available Skills (${allSkills.length})\nSkills contain ready-made workflows, best practices, and step-by-step guides.\nFor complex tasks (3+ steps): mention @skill-name in your response — skills will be auto-loaded into context.\nDo NOT put @skill-name inside tool_call. Just mention them naturally in your text.\nWorkflow:\n 1. User asks: "Create a REST API"\n 2. You: "I'll use @typescript-expert @nodejs-expert for this task." (skills auto-load on next turn)\n 3. You create plan BASED ON skill guidance: plan create REST API ...\n 4. You execute plan step by step\n\nAvailable skills:\n${allSkills
431
- .map((s) => s.description
432
- ? ` @${s.name} — ${truncateDesc(s.description)}`
433
- : ` @${s.name}`)
434
- .join("\n")}`
435
- : "";
436
- // ─── Mode block ──────────────────────────────────────
437
- const modeBlock = mode === "fast"
438
- ? `\n## Mode: Fast\n\u26a1 Fast mode \u2014 execute tasks directly without planning or loading skills. Skills are not available in this mode. Proceed immediately.`
439
- : mode === "pro"
440
- ? `\n## Mode: Pro\n\ud83d\udd0d Pro mode — @grill-me skill is pre-loaded. Before starting any task, you MUST first read and run the grill-me skill instructions to clarify requirements. Use it to refine the task before execution. Minimum context window: 64000.`
441
- : "";
442
- // ─── Final prompt assembly ───────────────────────────
443
- const base = mode === "fast"
444
- ? [
445
- header,
446
- platformBlock,
447
- sysInfo,
448
- memory,
449
- userProfile,
450
- projectMap,
451
- agentsBlock,
452
- modeBlock,
453
- ]
454
- .filter(Boolean)
455
- .join("\n")
456
- : [
457
- header,
458
- platformBlock,
459
- sysInfo,
460
- memory,
461
- userProfile,
462
- projectMap,
463
- agentsBlock,
464
- skillsHint,
465
- modeBlock,
466
- ]
467
- .filter(Boolean)
468
- .join("\n");
469
- const result = base +
470
- (extraSkills && extraSkills.length > 0 && mode !== "fast"
471
- ? "\n\n" + formatSkillsBlock(extraSkills)
472
- : "");
473
- const elapsed = (performance.now() - start).toFixed(0);
474
- logInfo("SYSTEM", `buildSystemPrompt: ${result.length} chars in ${elapsed}ms`);
475
- systemPromptCache.set(key, result);
476
- return result;
477
- }
478
- //# sourceMappingURL=system-prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,0BAA0B,EAC1B,iBAAiB,EACjB,qBAAqB,GAEtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAW,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD;;;;;;;;;;;;;;;;GAgBG;AAEH,yDAAyD;AACzD,yDAAyD;AACzD,MAAM,WAAW,GAAG,wBAAwB,CAAC,eAAe,CAAC,CAAC;AAE9D,SAAS,wBAAwB,CAAC,IAAsB;IACtD,MAAM,KAAK,GAAa;QACtB,wFAAwF;QACxF,EAAE;QACF,+DAA+D;QAC/D,EAAE;QACF,+DAA+D;QAC/D,EAAE;KACH,CAAC;IAEF,MAAM,YAAY,GAA6B;QAC7C,QAAQ,EAAE;YACR,+GAA+G;YAC/G,4EAA4E;SAC7E;QACD,IAAI,EAAE;YACJ,gDAAgD;YAChD,kDAAkD;SACnD;QACD,SAAS,EAAE;YACT,0DAA0D;YAC1D,kFAAkF;SACnF;QACD,UAAU,EAAE;YACV,2GAA2G;SAC5G;QACD,SAAS,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C,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,36 +0,0 @@
1
- import type { ToolHandler, ToolResult, ToolContext, ParsedToolCall } from "../tools/types.js";
2
- /** Обрезка вывода инструмента для экономии токенов */
3
- export declare function truncateOutput(toolName: string, output: string, exitCode: number): string;
4
- /** Результат выполнения ToolExecutor */
5
- export interface ExecutorResult {
6
- result: ToolResult;
7
- /** Время выполнения в секундах */
8
- elapsed: number;
9
- }
10
- export declare class ToolExecutor {
11
- private handlers;
12
- /** Повторяющиеся ошибки: hash → { count, lastStderr } */
13
- private recentErrors;
14
- /** Регистрация обработчика инструмента */
15
- register(handler: ToolHandler): void;
16
- /** Регистрация нескольких обработчиков */
17
- registerAll(handlers: ToolHandler[]): void;
18
- /** Проверка существования обработчика */
19
- has(name: string): boolean;
20
- /** Получение обработчика по имени */
21
- get(name: string): ToolHandler | undefined;
22
- /** Получение определений всех инструментов для LLM */
23
- getDefinitions(): import("../tools/registry.js").ToolDefinition[];
24
- /** Pre-flight проверка существования пути для FS-тулов */
25
- private preFlightCheck;
26
- /**
27
- * Выполнение tool call через пайплайн.
28
- *
29
- * @param call - инструментальный вызов из LLM
30
- * @param context - контекст выполнения (cwd, renderer и т.д.)
31
- * @param hookCmd - строка для хуков (bash command или tool name + args)
32
- * @returns результат выполнения с обрезанным выводом
33
- */
34
- execute(call: ParsedToolCall, context: ToolContext, hookCmd: string): Promise<ExecutorResult>;
35
- }
36
- //# sourceMappingURL=tool-executor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-executor.d.ts","sourceRoot":"","sources":["../../src/agent/tool-executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,cAAc,EACf,MAAM,mBAAmB,CAAC;AAmH3B,sDAAsD;AACtD,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,MAAM,CASR;AAED,wCAAwC;AACxC,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,UAAU,CAAC;IACnB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AA2BD,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAuC;IACvD,yDAAyD;IACzD,OAAO,CAAC,YAAY,CACR;IAEZ,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAIpC,0CAA0C;IAC1C,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAM1C,yCAAyC;IACzC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,qCAAqC;IACrC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAI1C,sDAAsD;IACtD,cAAc;IAId,0DAA0D;IAC1D,OAAO,CAAC,cAAc;IA8CtB;;;;;;;OAOG;IACG,OAAO,CACX,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,cAAc,CAAC;CA8K3B"}