@tyvm/knowhow 0.0.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 (492) hide show
  1. package/.vscode/launch.json +14 -0
  2. package/CONFIG.md +336 -0
  3. package/README.md +49 -0
  4. package/autodoc/chat.mdx +20 -0
  5. package/autodoc/cli.mdx +11 -0
  6. package/autodoc/plugins/asana.mdx +47 -0
  7. package/autodoc/plugins/downloader/downloader.mdx +38 -0
  8. package/autodoc/plugins/downloader/plugin.mdx +37 -0
  9. package/autodoc/plugins/downloader/types.mdx +42 -0
  10. package/autodoc/plugins/embedding.mdx +41 -0
  11. package/autodoc/plugins/figma.mdx +45 -0
  12. package/autodoc/plugins/github.mdx +40 -0
  13. package/autodoc/plugins/jira.mdx +46 -0
  14. package/autodoc/plugins/language.mdx +37 -0
  15. package/autodoc/plugins/linear.mdx +35 -0
  16. package/autodoc/plugins/notion.mdx +38 -0
  17. package/autodoc/plugins/plugins.mdx +59 -0
  18. package/autodoc/plugins/types.mdx +51 -0
  19. package/autodoc/plugins/vim.mdx +39 -0
  20. package/autodoc/tools/addInternalTools.mdx +1 -0
  21. package/autodoc/tools/agentCall.mdx +1 -0
  22. package/autodoc/tools/asana/definitions.mdx +10 -0
  23. package/autodoc/tools/asana/index.mdx +12 -0
  24. package/autodoc/tools/askHuman.mdx +1 -0
  25. package/autodoc/tools/callPlugin.mdx +1 -0
  26. package/autodoc/tools/embeddingSearch.mdx +1 -0
  27. package/autodoc/tools/execCommand.mdx +1 -0
  28. package/autodoc/tools/fileSearch.mdx +1 -0
  29. package/autodoc/tools/finalAnswer.mdx +1 -0
  30. package/autodoc/tools/github/definitions.mdx +6 -0
  31. package/autodoc/tools/github/index.mdx +8 -0
  32. package/autodoc/tools/index.mdx +14 -0
  33. package/autodoc/tools/lintFile.mdx +7 -0
  34. package/autodoc/tools/list.mdx +16 -0
  35. package/autodoc/tools/modifyFile.mdx +7 -0
  36. package/autodoc/tools/patch.mdx +9 -0
  37. package/autodoc/tools/readBlocks.mdx +1 -0
  38. package/autodoc/tools/readFile.mdx +1 -0
  39. package/autodoc/tools/scanFile.mdx +1 -0
  40. package/autodoc/tools/textSearch.mdx +6 -0
  41. package/autodoc/tools/types/fileblock.mdx +1 -0
  42. package/autodoc/tools/visionTool.mdx +1 -0
  43. package/autodoc/tools/writeFile.mdx +1 -0
  44. package/jest.config.js +18 -0
  45. package/package.json +89 -0
  46. package/src/agents/base/base.ts +619 -0
  47. package/src/agents/base/prompt.ts +26 -0
  48. package/src/agents/configurable/ConfigAgent.ts +23 -0
  49. package/src/agents/developer/developer.ts +69 -0
  50. package/src/agents/index.ts +8 -0
  51. package/src/agents/interface.ts +11 -0
  52. package/src/agents/patcher/codebase.md +27 -0
  53. package/src/agents/patcher/patcher.ts +110 -0
  54. package/src/agents/researcher/researcher.ts +109 -0
  55. package/src/agents/tools/addInternalTools.ts +21 -0
  56. package/src/agents/tools/agentCall.ts +18 -0
  57. package/src/agents/tools/aiClient.ts +36 -0
  58. package/src/agents/tools/asana/definitions.ts +199 -0
  59. package/src/agents/tools/asana/index.ts +108 -0
  60. package/src/agents/tools/askHuman.ts +8 -0
  61. package/src/agents/tools/callPlugin.ts +4 -0
  62. package/src/agents/tools/embeddingSearch.ts +5 -0
  63. package/src/agents/tools/execCommand.ts +26 -0
  64. package/src/agents/tools/fileSearch.ts +33 -0
  65. package/src/agents/tools/finalAnswer.ts +4 -0
  66. package/src/agents/tools/github/definitions.ts +89 -0
  67. package/src/agents/tools/github/index.ts +67 -0
  68. package/src/agents/tools/googleSearch.ts +242 -0
  69. package/src/agents/tools/index.ts +24 -0
  70. package/src/agents/tools/language/definitions.ts +97 -0
  71. package/src/agents/tools/language/index.ts +19 -0
  72. package/src/agents/tools/lintFile.ts +17 -0
  73. package/src/agents/tools/list.ts +514 -0
  74. package/src/agents/tools/loadWebpage.ts +129 -0
  75. package/src/agents/tools/modifyFile.ts +53 -0
  76. package/src/agents/tools/patch.ts +672 -0
  77. package/src/agents/tools/readBlocks.ts +41 -0
  78. package/src/agents/tools/readFile.ts +39 -0
  79. package/src/agents/tools/scanFile.ts +16 -0
  80. package/src/agents/tools/textSearch.ts +21 -0
  81. package/src/agents/tools/types/fileblock.ts +5 -0
  82. package/src/agents/tools/visionTool.ts +5 -0
  83. package/src/agents/tools/writeFile.ts +46 -0
  84. package/src/agents/vim/vim.ts +153 -0
  85. package/src/ai.ts +167 -0
  86. package/src/chat.ts +412 -0
  87. package/src/cli.ts +85 -0
  88. package/src/clients/anthropic.ts +399 -0
  89. package/src/clients/gemini.ts +486 -0
  90. package/src/clients/http.ts +107 -0
  91. package/src/clients/index.ts +183 -0
  92. package/src/clients/knowhow.ts +33 -0
  93. package/src/clients/openai.ts +253 -0
  94. package/src/clients/types.ts +91 -0
  95. package/src/clients/xai.ts +132 -0
  96. package/src/config.ts +211 -0
  97. package/src/conversion.ts +140 -0
  98. package/src/dataset/diffs/README.md +12 -0
  99. package/src/dataset/diffs/debug-errors.ts +29 -0
  100. package/src/dataset/diffs/debug.ts +64 -0
  101. package/src/dataset/diffs/generate.ts +71 -0
  102. package/src/dataset/diffs/jsonl.ts +54 -0
  103. package/src/dataset/diffs/test.ts +193 -0
  104. package/src/embeddings.ts +411 -0
  105. package/src/hashes.ts +67 -0
  106. package/src/index.ts +376 -0
  107. package/src/login.ts +78 -0
  108. package/src/microphone.ts +136 -0
  109. package/src/modules/index.ts +37 -0
  110. package/src/modules/types.ts +48 -0
  111. package/src/plugins/asana.ts +134 -0
  112. package/src/plugins/downloader/downloader.ts +204 -0
  113. package/src/plugins/downloader/plugin.ts +85 -0
  114. package/src/plugins/downloader/types.ts +85 -0
  115. package/src/plugins/embedding.ts +42 -0
  116. package/src/plugins/figma.ts +137 -0
  117. package/src/plugins/github.ts +153 -0
  118. package/src/plugins/jira.ts +104 -0
  119. package/src/plugins/language.ts +100 -0
  120. package/src/plugins/linear.ts +219 -0
  121. package/src/plugins/notion.ts +170 -0
  122. package/src/plugins/plugins.ts +56 -0
  123. package/src/plugins/types.ts +5 -0
  124. package/src/plugins/url.ts +63 -0
  125. package/src/plugins/vim.ts +73 -0
  126. package/src/prompts/BasicCodeDocumenter.ts +1 -0
  127. package/src/prompts/BasicProjectDocumenter.ts +1 -0
  128. package/src/prompts/EmbeddingSeachHelper.ts +1 -0
  129. package/src/prompts/index.ts +9 -0
  130. package/src/server/index.ts +14 -0
  131. package/src/services/AgentService.ts +98 -0
  132. package/src/services/EmbeddingService.ts +410 -0
  133. package/src/services/EventService.ts +20 -0
  134. package/src/services/GitHub.ts +60 -0
  135. package/src/services/KnowhowClient.ts +113 -0
  136. package/src/services/Mcp.ts +270 -0
  137. package/src/services/McpServer.ts +119 -0
  138. package/src/services/McpWebsocketTransport.ts +64 -0
  139. package/src/services/S3.ts +126 -0
  140. package/src/services/Tools.ts +65 -0
  141. package/src/services/flags.ts +52 -0
  142. package/src/services/index.ts +8 -0
  143. package/src/types.ts +225 -0
  144. package/src/utils/index.ts +108 -0
  145. package/src/worker.ts +80 -0
  146. package/tests/integration/figma.test.ts +70 -0
  147. package/tests/integration/fileblocks/readwrite.test.ts +95 -0
  148. package/tests/integration/patching/input.txt +145 -0
  149. package/tests/integration/patching/output.txt +145 -0
  150. package/tests/integration/patching/patch.txt +15 -0
  151. package/tests/integration/patching/unseen.txt +80 -0
  152. package/tests/integration/patching.test.ts +136 -0
  153. package/tests/languagePlugin.test.ts +74 -0
  154. package/tests/patching/corrupted.test.ts +78 -0
  155. package/tests/patching/imports.patch.txt +11 -0
  156. package/tests/patching/imports.test.ts +43 -0
  157. package/tests/patching/imports.txt +11 -0
  158. package/tests/patching/interface.patch.txt +15 -0
  159. package/tests/patching/interface.txt +7 -0
  160. package/tests/test.spec.ts +132 -0
  161. package/ts_build/src/agents/base/base.d.ts +88 -0
  162. package/ts_build/src/agents/base/base.js +464 -0
  163. package/ts_build/src/agents/base/base.js.map +1 -0
  164. package/ts_build/src/agents/base/prompt.d.ts +1 -0
  165. package/ts_build/src/agents/base/prompt.js +30 -0
  166. package/ts_build/src/agents/base/prompt.js.map +1 -0
  167. package/ts_build/src/agents/configurable/ConfigAgent.d.ts +10 -0
  168. package/ts_build/src/agents/configurable/ConfigAgent.js +25 -0
  169. package/ts_build/src/agents/configurable/ConfigAgent.js.map +1 -0
  170. package/ts_build/src/agents/configurable/OpenAIAgent.d.ts +0 -0
  171. package/ts_build/src/agents/configurable/OpenAIAgent.js +1 -0
  172. package/ts_build/src/agents/configurable/OpenAIAgent.js.map +1 -0
  173. package/ts_build/src/agents/developer/developer.d.ts +9 -0
  174. package/ts_build/src/agents/developer/developer.js +69 -0
  175. package/ts_build/src/agents/developer/developer.js.map +1 -0
  176. package/ts_build/src/agents/index.d.ts +7 -0
  177. package/ts_build/src/agents/index.js +38 -0
  178. package/ts_build/src/agents/index.js.map +1 -0
  179. package/ts_build/src/agents/interface.d.ts +10 -0
  180. package/ts_build/src/agents/interface.js +3 -0
  181. package/ts_build/src/agents/interface.js.map +1 -0
  182. package/ts_build/src/agents/patcher/patcher.d.ts +9 -0
  183. package/ts_build/src/agents/patcher/patcher.js +106 -0
  184. package/ts_build/src/agents/patcher/patcher.js.map +1 -0
  185. package/ts_build/src/agents/researcher/researcher.d.ts +9 -0
  186. package/ts_build/src/agents/researcher/researcher.js +107 -0
  187. package/ts_build/src/agents/researcher/researcher.js.map +1 -0
  188. package/ts_build/src/agents/tools/addInternalTools.d.ts +5 -0
  189. package/ts_build/src/agents/tools/addInternalTools.js +18 -0
  190. package/ts_build/src/agents/tools/addInternalTools.js.map +1 -0
  191. package/ts_build/src/agents/tools/agentCall.d.ts +1 -0
  192. package/ts_build/src/agents/tools/agentCall.js +21 -0
  193. package/ts_build/src/agents/tools/agentCall.js.map +1 -0
  194. package/ts_build/src/agents/tools/aiClient.d.ts +6 -0
  195. package/ts_build/src/agents/tools/aiClient.js +25 -0
  196. package/ts_build/src/agents/tools/aiClient.js.map +1 -0
  197. package/ts_build/src/agents/tools/asana/definitions.d.ts +202 -0
  198. package/ts_build/src/agents/tools/asana/definitions.js +197 -0
  199. package/ts_build/src/agents/tools/asana/definitions.js.map +1 -0
  200. package/ts_build/src/agents/tools/asana/index.d.ts +8 -0
  201. package/ts_build/src/agents/tools/asana/index.js +98 -0
  202. package/ts_build/src/agents/tools/asana/index.js.map +1 -0
  203. package/ts_build/src/agents/tools/askHuman.d.ts +1 -0
  204. package/ts_build/src/agents/tools/askHuman.js +15 -0
  205. package/ts_build/src/agents/tools/askHuman.js.map +1 -0
  206. package/ts_build/src/agents/tools/callPlugin.d.ts +1 -0
  207. package/ts_build/src/agents/tools/callPlugin.js +9 -0
  208. package/ts_build/src/agents/tools/callPlugin.js.map +1 -0
  209. package/ts_build/src/agents/tools/client.d.ts +5 -0
  210. package/ts_build/src/agents/tools/client.js +21 -0
  211. package/ts_build/src/agents/tools/client.js.map +1 -0
  212. package/ts_build/src/agents/tools/embeddingSearch.d.ts +1 -0
  213. package/ts_build/src/agents/tools/embeddingSearch.js +9 -0
  214. package/ts_build/src/agents/tools/embeddingSearch.js.map +1 -0
  215. package/ts_build/src/agents/tools/execCommand.d.ts +1 -0
  216. package/ts_build/src/agents/tools/execCommand.js +25 -0
  217. package/ts_build/src/agents/tools/execCommand.js.map +1 -0
  218. package/ts_build/src/agents/tools/fileSearch.d.ts +1 -0
  219. package/ts_build/src/agents/tools/fileSearch.js +31 -0
  220. package/ts_build/src/agents/tools/fileSearch.js.map +1 -0
  221. package/ts_build/src/agents/tools/finalAnswer.d.ts +1 -0
  222. package/ts_build/src/agents/tools/finalAnswer.js +8 -0
  223. package/ts_build/src/agents/tools/finalAnswer.js.map +1 -0
  224. package/ts_build/src/agents/tools/github/definitions.d.ts +47 -0
  225. package/ts_build/src/agents/tools/github/definitions.js +86 -0
  226. package/ts_build/src/agents/tools/github/definitions.js.map +1 -0
  227. package/ts_build/src/agents/tools/github/index.d.ts +789 -0
  228. package/ts_build/src/agents/tools/github/index.js +56 -0
  229. package/ts_build/src/agents/tools/github/index.js.map +1 -0
  230. package/ts_build/src/agents/tools/googleSearch.d.ts +93 -0
  231. package/ts_build/src/agents/tools/googleSearch.js +117 -0
  232. package/ts_build/src/agents/tools/googleSearch.js.map +1 -0
  233. package/ts_build/src/agents/tools/googleSearchTypes.d.ts +74 -0
  234. package/ts_build/src/agents/tools/googleSearchTypes.js +3 -0
  235. package/ts_build/src/agents/tools/googleSearchTypes.js.map +1 -0
  236. package/ts_build/src/agents/tools/index.d.ts +24 -0
  237. package/ts_build/src/agents/tools/index.js +41 -0
  238. package/ts_build/src/agents/tools/index.js.map +1 -0
  239. package/ts_build/src/agents/tools/language/definitions.d.ts +89 -0
  240. package/ts_build/src/agents/tools/language/definitions.js +95 -0
  241. package/ts_build/src/agents/tools/language/definitions.js.map +1 -0
  242. package/ts_build/src/agents/tools/language/index.d.ts +4 -0
  243. package/ts_build/src/agents/tools/language/index.js +22 -0
  244. package/ts_build/src/agents/tools/language/index.js.map +1 -0
  245. package/ts_build/src/agents/tools/lintFile.d.ts +1 -0
  246. package/ts_build/src/agents/tools/lintFile.js +22 -0
  247. package/ts_build/src/agents/tools/lintFile.js.map +1 -0
  248. package/ts_build/src/agents/tools/list.d.ts +2 -0
  249. package/ts_build/src/agents/tools/list.js +505 -0
  250. package/ts_build/src/agents/tools/list.js.map +1 -0
  251. package/ts_build/src/agents/tools/loadWebpage.d.ts +8 -0
  252. package/ts_build/src/agents/tools/loadWebpage.js +97 -0
  253. package/ts_build/src/agents/tools/loadWebpage.js.map +1 -0
  254. package/ts_build/src/agents/tools/modifyFile.d.ts +2 -0
  255. package/ts_build/src/agents/tools/modifyFile.js +74 -0
  256. package/ts_build/src/agents/tools/modifyFile.js.map +1 -0
  257. package/ts_build/src/agents/tools/patch.d.ts +21 -0
  258. package/ts_build/src/agents/tools/patch.js +443 -0
  259. package/ts_build/src/agents/tools/patch.js.map +1 -0
  260. package/ts_build/src/agents/tools/readBlocks.d.ts +2 -0
  261. package/ts_build/src/agents/tools/readBlocks.js +59 -0
  262. package/ts_build/src/agents/tools/readBlocks.js.map +1 -0
  263. package/ts_build/src/agents/tools/readFile.d.ts +1 -0
  264. package/ts_build/src/agents/tools/readFile.js +46 -0
  265. package/ts_build/src/agents/tools/readFile.js.map +1 -0
  266. package/ts_build/src/agents/tools/scanFile.d.ts +1 -0
  267. package/ts_build/src/agents/tools/scanFile.js +36 -0
  268. package/ts_build/src/agents/tools/scanFile.js.map +1 -0
  269. package/ts_build/src/agents/tools/textSearch.d.ts +1 -0
  270. package/ts_build/src/agents/tools/textSearch.js +22 -0
  271. package/ts_build/src/agents/tools/textSearch.js.map +1 -0
  272. package/ts_build/src/agents/tools/types/fileblock.d.ts +5 -0
  273. package/ts_build/src/agents/tools/types/fileblock.js +3 -0
  274. package/ts_build/src/agents/tools/types/fileblock.js.map +1 -0
  275. package/ts_build/src/agents/tools/visionTool.d.ts +1 -0
  276. package/ts_build/src/agents/tools/visionTool.js +9 -0
  277. package/ts_build/src/agents/tools/visionTool.js.map +1 -0
  278. package/ts_build/src/agents/tools/writeFile.d.ts +2 -0
  279. package/ts_build/src/agents/tools/writeFile.js +61 -0
  280. package/ts_build/src/agents/tools/writeFile.js.map +1 -0
  281. package/ts_build/src/agents/vim/vim.d.ts +14 -0
  282. package/ts_build/src/agents/vim/vim.js +171 -0
  283. package/ts_build/src/agents/vim/vim.js.map +1 -0
  284. package/ts_build/src/ai.d.ts +10 -0
  285. package/ts_build/src/ai.js +102 -0
  286. package/ts_build/src/ai.js.map +1 -0
  287. package/ts_build/src/chat.d.ts +13 -0
  288. package/ts_build/src/chat.js +319 -0
  289. package/ts_build/src/chat.js.map +1 -0
  290. package/ts_build/src/cli.d.ts +2 -0
  291. package/ts_build/src/cli.js +98 -0
  292. package/ts_build/src/cli.js.map +1 -0
  293. package/ts_build/src/clients/anthropic.d.ts +31 -0
  294. package/ts_build/src/clients/anthropic.js +344 -0
  295. package/ts_build/src/clients/anthropic.js.map +1 -0
  296. package/ts_build/src/clients/gemini.d.ts +20 -0
  297. package/ts_build/src/clients/gemini.js +347 -0
  298. package/ts_build/src/clients/gemini.js.map +1 -0
  299. package/ts_build/src/clients/http.d.ts +12 -0
  300. package/ts_build/src/clients/http.js +91 -0
  301. package/ts_build/src/clients/http.js.map +1 -0
  302. package/ts_build/src/clients/index.d.ts +47 -0
  303. package/ts_build/src/clients/index.js +143 -0
  304. package/ts_build/src/clients/index.js.map +1 -0
  305. package/ts_build/src/clients/knowhow.d.ts +10 -0
  306. package/ts_build/src/clients/knowhow.js +24 -0
  307. package/ts_build/src/clients/knowhow.js.map +1 -0
  308. package/ts_build/src/clients/openai.d.ts +20 -0
  309. package/ts_build/src/clients/openai.js +221 -0
  310. package/ts_build/src/clients/openai.js.map +1 -0
  311. package/ts_build/src/clients/types.d.ts +89 -0
  312. package/ts_build/src/clients/types.js +3 -0
  313. package/ts_build/src/clients/types.js.map +1 -0
  314. package/ts_build/src/clients/xai.d.ts +22 -0
  315. package/ts_build/src/clients/xai.js +108 -0
  316. package/ts_build/src/clients/xai.js.map +1 -0
  317. package/ts_build/src/config.d.ts +9 -0
  318. package/ts_build/src/config.js +216 -0
  319. package/ts_build/src/config.js.map +1 -0
  320. package/ts_build/src/conversion.d.ts +7 -0
  321. package/ts_build/src/conversion.js +114 -0
  322. package/ts_build/src/conversion.js.map +1 -0
  323. package/ts_build/src/dataset/diffs/debug-errors.d.ts +1 -0
  324. package/ts_build/src/dataset/diffs/debug-errors.js +28 -0
  325. package/ts_build/src/dataset/diffs/debug-errors.js.map +1 -0
  326. package/ts_build/src/dataset/diffs/debug.d.ts +1 -0
  327. package/ts_build/src/dataset/diffs/debug.js +50 -0
  328. package/ts_build/src/dataset/diffs/debug.js.map +1 -0
  329. package/ts_build/src/dataset/diffs/generate.d.ts +1 -0
  330. package/ts_build/src/dataset/diffs/generate.js +70 -0
  331. package/ts_build/src/dataset/diffs/generate.js.map +1 -0
  332. package/ts_build/src/dataset/diffs/jsonl.d.ts +1 -0
  333. package/ts_build/src/dataset/diffs/jsonl.js +47 -0
  334. package/ts_build/src/dataset/diffs/jsonl.js.map +1 -0
  335. package/ts_build/src/dataset/diffs/test.d.ts +1 -0
  336. package/ts_build/src/dataset/diffs/test.js +114 -0
  337. package/ts_build/src/dataset/diffs/test.js.map +1 -0
  338. package/ts_build/src/embeddings.d.ts +19 -0
  339. package/ts_build/src/embeddings.js +322 -0
  340. package/ts_build/src/embeddings.js.map +1 -0
  341. package/ts_build/src/hashes.d.ts +6 -0
  342. package/ts_build/src/hashes.js +78 -0
  343. package/ts_build/src/hashes.js.map +1 -0
  344. package/ts_build/src/index.d.ts +14 -0
  345. package/ts_build/src/index.js +258 -0
  346. package/ts_build/src/index.js.map +1 -0
  347. package/ts_build/src/login.d.ts +2 -0
  348. package/ts_build/src/login.js +63 -0
  349. package/ts_build/src/login.js.map +1 -0
  350. package/ts_build/src/microphone.d.ts +9 -0
  351. package/ts_build/src/microphone.js +131 -0
  352. package/ts_build/src/microphone.js.map +1 -0
  353. package/ts_build/src/modules/index.d.ts +3 -0
  354. package/ts_build/src/modules/index.js +34 -0
  355. package/ts_build/src/modules/index.js.map +1 -0
  356. package/ts_build/src/modules/types.d.ts +37 -0
  357. package/ts_build/src/modules/types.js +3 -0
  358. package/ts_build/src/modules/types.js.map +1 -0
  359. package/ts_build/src/plugins/asana.d.ts +16 -0
  360. package/ts_build/src/plugins/asana.js +114 -0
  361. package/ts_build/src/plugins/asana.js.map +1 -0
  362. package/ts_build/src/plugins/downloader/downloader.d.ts +12 -0
  363. package/ts_build/src/plugins/downloader/downloader.js +174 -0
  364. package/ts_build/src/plugins/downloader/downloader.js.map +1 -0
  365. package/ts_build/src/plugins/downloader/index.d.ts +3 -0
  366. package/ts_build/src/plugins/downloader/index.js +41 -0
  367. package/ts_build/src/plugins/downloader/index.js.map +1 -0
  368. package/ts_build/src/plugins/downloader/plugin.d.ts +8 -0
  369. package/ts_build/src/plugins/downloader/plugin.js +83 -0
  370. package/ts_build/src/plugins/downloader/plugin.js.map +1 -0
  371. package/ts_build/src/plugins/downloader/types.d.ts +82 -0
  372. package/ts_build/src/plugins/downloader/types.js +79 -0
  373. package/ts_build/src/plugins/downloader/types.js.map +1 -0
  374. package/ts_build/src/plugins/embedding.d.ts +5 -0
  375. package/ts_build/src/plugins/embedding.js +28 -0
  376. package/ts_build/src/plugins/embedding.js.map +1 -0
  377. package/ts_build/src/plugins/figma.d.ts +20 -0
  378. package/ts_build/src/plugins/figma.js +94 -0
  379. package/ts_build/src/plugins/figma.js.map +1 -0
  380. package/ts_build/src/plugins/github.d.ts +1223 -0
  381. package/ts_build/src/plugins/github.js +115 -0
  382. package/ts_build/src/plugins/github.js.map +1 -0
  383. package/ts_build/src/plugins/jira.d.ts +15 -0
  384. package/ts_build/src/plugins/jira.js +94 -0
  385. package/ts_build/src/plugins/jira.js.map +1 -0
  386. package/ts_build/src/plugins/language.d.ts +8 -0
  387. package/ts_build/src/plugins/language.js +69 -0
  388. package/ts_build/src/plugins/language.js.map +1 -0
  389. package/ts_build/src/plugins/linear.d.ts +23 -0
  390. package/ts_build/src/plugins/linear.js +184 -0
  391. package/ts_build/src/plugins/linear.js.map +1 -0
  392. package/ts_build/src/plugins/notion.d.ts +32 -0
  393. package/ts_build/src/plugins/notion.js +131 -0
  394. package/ts_build/src/plugins/notion.js.map +1 -0
  395. package/ts_build/src/plugins/plugins.d.ts +11 -0
  396. package/ts_build/src/plugins/plugins.js +51 -0
  397. package/ts_build/src/plugins/plugins.js.map +1 -0
  398. package/ts_build/src/plugins/types.d.ts +5 -0
  399. package/ts_build/src/plugins/types.js +3 -0
  400. package/ts_build/src/plugins/types.js.map +1 -0
  401. package/ts_build/src/plugins/url.d.ts +8 -0
  402. package/ts_build/src/plugins/url.js +50 -0
  403. package/ts_build/src/plugins/url.js.map +1 -0
  404. package/ts_build/src/plugins/vim.d.ts +11 -0
  405. package/ts_build/src/plugins/vim.js +63 -0
  406. package/ts_build/src/plugins/vim.js.map +1 -0
  407. package/ts_build/src/prompts/BasicCodeDocumenter.d.ts +2 -0
  408. package/ts_build/src/prompts/BasicCodeDocumenter.js +4 -0
  409. package/ts_build/src/prompts/BasicCodeDocumenter.js.map +1 -0
  410. package/ts_build/src/prompts/BasicProjectDocumenter.d.ts +2 -0
  411. package/ts_build/src/prompts/BasicProjectDocumenter.js +4 -0
  412. package/ts_build/src/prompts/BasicProjectDocumenter.js.map +1 -0
  413. package/ts_build/src/prompts/EmbeddingSeachHelper.d.ts +2 -0
  414. package/ts_build/src/prompts/EmbeddingSeachHelper.js +4 -0
  415. package/ts_build/src/prompts/EmbeddingSeachHelper.js.map +1 -0
  416. package/ts_build/src/prompts/index.d.ts +13 -0
  417. package/ts_build/src/prompts/index.js +15 -0
  418. package/ts_build/src/prompts/index.js.map +1 -0
  419. package/ts_build/src/server/index.d.ts +1 -0
  420. package/ts_build/src/server/index.js +17 -0
  421. package/ts_build/src/server/index.js.map +1 -0
  422. package/ts_build/src/services/AgentService.d.ts +14 -0
  423. package/ts_build/src/services/AgentService.js +87 -0
  424. package/ts_build/src/services/AgentService.js.map +1 -0
  425. package/ts_build/src/services/EmbeddingService.d.ts +39 -0
  426. package/ts_build/src/services/EmbeddingService.js +307 -0
  427. package/ts_build/src/services/EmbeddingService.js.map +1 -0
  428. package/ts_build/src/services/EventService.d.ts +9 -0
  429. package/ts_build/src/services/EventService.js +20 -0
  430. package/ts_build/src/services/EventService.js.map +1 -0
  431. package/ts_build/src/services/GitHub.d.ts +11 -0
  432. package/ts_build/src/services/GitHub.js +52 -0
  433. package/ts_build/src/services/GitHub.js.map +1 -0
  434. package/ts_build/src/services/KnowhowClient.d.ts +18 -0
  435. package/ts_build/src/services/KnowhowClient.js +85 -0
  436. package/ts_build/src/services/KnowhowClient.js.map +1 -0
  437. package/ts_build/src/services/Mcp.d.ts +377 -0
  438. package/ts_build/src/services/Mcp.js +221 -0
  439. package/ts_build/src/services/Mcp.js.map +1 -0
  440. package/ts_build/src/services/McpServer.d.ts +19 -0
  441. package/ts_build/src/services/McpServer.js +104 -0
  442. package/ts_build/src/services/McpServer.js.map +1 -0
  443. package/ts_build/src/services/McpWebsocketTransport.d.ts +13 -0
  444. package/ts_build/src/services/McpWebsocketTransport.js +59 -0
  445. package/ts_build/src/services/McpWebsocketTransport.js.map +1 -0
  446. package/ts_build/src/services/S3.d.ts +9 -0
  447. package/ts_build/src/services/S3.js +116 -0
  448. package/ts_build/src/services/S3.js.map +1 -0
  449. package/ts_build/src/services/Tools.d.ts +19 -0
  450. package/ts_build/src/services/Tools.js +51 -0
  451. package/ts_build/src/services/Tools.js.map +1 -0
  452. package/ts_build/src/services/flags.d.ts +13 -0
  453. package/ts_build/src/services/flags.js +48 -0
  454. package/ts_build/src/services/flags.js.map +1 -0
  455. package/ts_build/src/services/index.d.ts +8 -0
  456. package/ts_build/src/services/index.js +38 -0
  457. package/ts_build/src/services/index.js.map +1 -0
  458. package/ts_build/src/terminal.d.ts +1 -0
  459. package/ts_build/src/terminal.js +35 -0
  460. package/ts_build/src/terminal.js.map +1 -0
  461. package/ts_build/src/types.d.ts +181 -0
  462. package/ts_build/src/types.js +94 -0
  463. package/ts_build/src/types.js.map +1 -0
  464. package/ts_build/src/utils/index.d.ts +24 -0
  465. package/ts_build/src/utils/index.js +116 -0
  466. package/ts_build/src/utils/index.js.map +1 -0
  467. package/ts_build/src/worker.d.ts +1 -0
  468. package/ts_build/src/worker.js +68 -0
  469. package/ts_build/src/worker.js.map +1 -0
  470. package/ts_build/tests/integration/figma.test.d.ts +1 -0
  471. package/ts_build/tests/integration/figma.test.js +47 -0
  472. package/ts_build/tests/integration/figma.test.js.map +1 -0
  473. package/ts_build/tests/integration/fileblocks/readwrite.test.d.ts +1 -0
  474. package/ts_build/tests/integration/fileblocks/readwrite.test.js +95 -0
  475. package/ts_build/tests/integration/fileblocks/readwrite.test.js.map +1 -0
  476. package/ts_build/tests/integration/patching.test.d.ts +1 -0
  477. package/ts_build/tests/integration/patching.test.js +117 -0
  478. package/ts_build/tests/integration/patching.test.js.map +1 -0
  479. package/ts_build/tests/languagePlugin.test.d.ts +1 -0
  480. package/ts_build/tests/languagePlugin.test.js +78 -0
  481. package/ts_build/tests/languagePlugin.test.js.map +1 -0
  482. package/ts_build/tests/patching/corrupted.test.d.ts +1 -0
  483. package/ts_build/tests/patching/corrupted.test.js +53 -0
  484. package/ts_build/tests/patching/corrupted.test.js.map +1 -0
  485. package/ts_build/tests/patching/imports.test.d.ts +1 -0
  486. package/ts_build/tests/patching/imports.test.js +61 -0
  487. package/ts_build/tests/patching/imports.test.js.map +1 -0
  488. package/ts_build/tests/test.spec.d.ts +1 -0
  489. package/ts_build/tests/test.spec.js +101 -0
  490. package/ts_build/tests/test.spec.js.map +1 -0
  491. package/tsconfig.json +31 -0
  492. package/tslint.json +11 -0
@@ -0,0 +1,7 @@
1
+ export * from "./base/base";
2
+ export * from "./configurable/ConfigAgent";
3
+ export * from "./developer/developer";
4
+ export * from "./patcher/patcher";
5
+ export * from "./researcher/researcher";
6
+ export * as tools from "./tools";
7
+ export { includedTools } from "./tools/list";
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.includedTools = exports.tools = void 0;
30
+ __exportStar(require("./base/base"), exports);
31
+ __exportStar(require("./configurable/ConfigAgent"), exports);
32
+ __exportStar(require("./developer/developer"), exports);
33
+ __exportStar(require("./patcher/patcher"), exports);
34
+ __exportStar(require("./researcher/researcher"), exports);
35
+ exports.tools = __importStar(require("./tools"));
36
+ var list_1 = require("./tools/list");
37
+ Object.defineProperty(exports, "includedTools", { enumerable: true, get: function () { return list_1.includedTools; } });
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,6DAA2C;AAC3C,wDAAsC;AACtC,oDAAkC;AAClC,0DAAwC;AAExC,iDAAiC;AACjC,qCAA6C;AAApC,qGAAA,aAAa,OAAA"}
@@ -0,0 +1,10 @@
1
+ import { Message } from "../clients/types";
2
+ export interface IAgent {
3
+ name: string;
4
+ description: string;
5
+ call: (userInput: string, messages?: Message[]) => Promise<string>;
6
+ getModel(): string;
7
+ getProvider(): string;
8
+ setModel(model: string): void;
9
+ setProvider(provider: string): void;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/agents/interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { Message } from "../../clients/types";
2
+ import { BaseAgent } from "../base/base";
3
+ export declare class PatchingAgent extends BaseAgent {
4
+ name: string;
5
+ description: string;
6
+ constructor();
7
+ getInitialMessages(userInput: string): Promise<Message[]>;
8
+ }
9
+ export declare const Patcher: PatchingAgent;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Patcher = exports.PatchingAgent = void 0;
4
+ const base_1 = require("../base/base");
5
+ const prompt_1 = require("../base/prompt");
6
+ const ai_1 = require("../../ai");
7
+ const example = `
8
+ Index: ./src/agents/base/base.ts
9
+ ===================================================================
10
+ --- ./src/agents/base/base.ts
11
+ +++ ./src/agents/base/base.ts
12
+ @@ -186,9 +186,14 @@
13
+ startIndex: number,
14
+ endIndex: number
15
+ ) {
16
+ const toCompress = messages.slice(startIndex, endIndex);
17
+ - const toCompressPrompt = \`Summarize what this agent was tasked with, what has been tried so far, and what we're about to do next. This summary will become the agent's only memory of the past, all other messages will be dropped: \n\n\${JSON.stringify(
18
+ + const toCompressPrompt = \`Summarize:
19
+ + 1. Initial Request - what this agent was tasked with.
20
+ + 2. Progress - what has been tried so far,
21
+ + 3. Next Steps - what we're about to do next to continue the user's original request.
22
+ +
23
+ + This summary will become the agent's only memory of the past, all other messages will be dropped: \n\n\${JSON.stringify(
24
+ toCompress
25
+ )}\`;
26
+
27
+ const model = this.getModel();
28
+ @@ -202,9 +207,12 @@
29
+ },
30
+ ],
31
+ });
32
+
33
+ + const systemMesasges = toCompress.filter((m) => m.role === "system");
34
+ +
35
+ const newMessages = [
36
+ + ...systemMesasges,
37
+ ...response.choices.map((c) => c.message),
38
+ ...messages.slice(endIndex),
39
+ ];
40
+
41
+ `;
42
+ const systemReminder = `# Patch Tool Rules:
43
+ Here's an example of a correctly formatted patch:
44
+ ${example}
45
+
46
+ Be sure to preserve sytanx, delete the correct lines of code, and insert new lines of code in the correct locations.
47
+
48
+ The user's patch tool needs CORRECT patches that apply cleanly against the current contents of the file!
49
+ Think carefully and make sure you include and mark all lines that need to be removed or changed as \`-\` lines.
50
+ Make sure you mark all new or modified lines with \`+\`.
51
+ Don't leave out any lines or the diff patch won't apply correctly.
52
+
53
+ Indentation matters in the diffs!
54
+
55
+ Start a new hunk for each section of the file that needs changes.
56
+
57
+ Only output hunks that specify changes with \`+\` or \`-\` lines.
58
+ Skip any hunks that are entirely unchanging \` \` lines.
59
+
60
+ Output hunks in whatever order makes the most sense.
61
+ Hunks don't need to be in any particular order.
62
+
63
+ Hunks should have a context of 3 lines before and after the change, which match exactly from the source.
64
+
65
+ When editing a function, method, loop, etc use a hunk to replace the *entire* code block.
66
+ Delete the entire existing version with \`-\` lines and then add a new, updated version with \`+\` lines.
67
+ This will help you generate correct code and correct diffs.
68
+
69
+ To move code within a file, use 2 hunks: 1 to delete it from its current location, 1 to insert it in the new location.
70
+
71
+ You should attempt to apply one hunk at a time, as an error in one hunk can cause the entire patch to fail to apply.
72
+ `;
73
+ class PatchingAgent extends base_1.BaseAgent {
74
+ name = "Patcher";
75
+ description = `This agent is prepared to work on the codebase by leveraging patches`;
76
+ constructor() {
77
+ super();
78
+ this.disableTool("sendVimInput");
79
+ this.disableTool("openFileInVim");
80
+ this.setModelPreferences([
81
+ { model: ai_1.Models.anthropic.Sonnet4, provider: "anthropic" },
82
+ {
83
+ model: ai_1.Models.openai.GPT_41,
84
+ provider: "openai",
85
+ },
86
+ ]);
87
+ }
88
+ async getInitialMessages(userInput) {
89
+ return [
90
+ {
91
+ role: "system",
92
+ content: `${prompt_1.BASE_PROMPT}
93
+
94
+ ${systemReminder}
95
+
96
+ Specialization: Patcher Agent, ${this.description}
97
+ IF you fail twice to patch a file, you may switch using writeFileChunk to rewrite the whole file.
98
+ `,
99
+ },
100
+ { role: "user", content: userInput },
101
+ ];
102
+ }
103
+ }
104
+ exports.PatchingAgent = PatchingAgent;
105
+ exports.Patcher = new PatchingAgent();
106
+ //# sourceMappingURL=patcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patcher.js","sourceRoot":"","sources":["../../../../src/agents/patcher/patcher.ts"],"names":[],"mappings":";;;AACA,uCAAyC;AACzC,2CAA6C;AAC7C,iCAAkC;AAElC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCf,CAAC;AAEF,MAAM,cAAc,GAAG;;EAErB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BR,CAAC;AAEF,MAAa,aAAc,SAAQ,gBAAS;IAC1C,IAAI,GAAG,SAAS,CAAC;IACjB,WAAW,GAAG,sEAAsE,CAAC;IAErF;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QACjC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QAElC,IAAI,CAAC,mBAAmB,CAAC;YACvB,EAAE,KAAK,EAAE,WAAM,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE;YAC1D;gBACE,KAAK,EAAE,WAAM,CAAC,MAAM,CAAC,MAAM;gBAC3B,QAAQ,EAAE,QAAQ;aACnB;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,SAAiB;QACxC,OAAO;YACL;gBACE,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,GAAG,oBAAW;;UAErB,cAAc;;yCAEiB,IAAI,CAAC,WAAW;;SAEhD;aACF;YAED,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;SACxB,CAAC;IACjB,CAAC;CACF;AAlCD,sCAkCC;AAEY,QAAA,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Message } from "../../clients/types";
2
+ import { BaseAgent } from "../base/base";
3
+ export declare class ResearcherAgent extends BaseAgent {
4
+ name: string;
5
+ description: string;
6
+ constructor();
7
+ getInitialMessages(userInput: string): Promise<Message[]>;
8
+ }
9
+ export declare const Researcher: ResearcherAgent;
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Researcher = exports.ResearcherAgent = void 0;
4
+ const ai_1 = require("../../ai");
5
+ const base_1 = require("../base/base");
6
+ class ResearcherAgent extends base_1.BaseAgent {
7
+ name = "Researcher";
8
+ description = `This agent is prepared to research a request using the tools available to them. Great for finding answers to questions about the codebase`;
9
+ constructor() {
10
+ super();
11
+ this.setModel(ai_1.Models.google.Gemini_20_Flash);
12
+ this.setProvider("google");
13
+ this.disableTool("patchFile");
14
+ }
15
+ async getInitialMessages(userInput) {
16
+ return [
17
+ {
18
+ role: "system",
19
+ content: `
20
+ # Researcher Agent
21
+
22
+ You are a sophisticated research agent designed to investigate and provide comprehensive context for user requests. Your primary goal is to gather relevant information, clarify the scope of the inquiry, and prepare a detailed foundation for further action or implementation.
23
+
24
+ ## Core Responsibilities:
25
+
26
+ 1. Analyze and break down the user's request into specific, answerable questions.
27
+ 2. Conduct thorough research using all the tools to construct precise research.
28
+ 3. Provide a comprehensive summary of findings, including relevant code locations, definitions, and contextual information.
29
+
30
+ ## Research Process:
31
+
32
+ Follow these steps for each research task:
33
+
34
+ 1. **Term and Concept Identification:**
35
+ - Identify key terms and concepts in the request.
36
+ - Use available tools to find and provide clear definitions for unfamiliar terms.
37
+ - This step is crucial for understanding the full scope of the request.
38
+
39
+ 2. **Request Breakdown:**
40
+ - Break down the request into specific, answerable questions.
41
+ - Prioritize questions that will lead to a comprehensive understanding of the task.
42
+
43
+ 3. **Information Gathering:**
44
+ - For each question, use appropriate tools to find relevant information.
45
+ - Prioritize finding:
46
+ - Main implementation files
47
+ - Related models or data structures
48
+ - Associated services or utilities
49
+ - Relevant configuration files
50
+ - Provide file paths and brief descriptions of their roles in the system.
51
+
52
+ 4. **Summarization:**
53
+ - Summarize findings for each question.
54
+ - Cite specific file paths or code snippets where applicable.
55
+
56
+ 5. **Synthesis:**
57
+ - Synthesize the information to provide a comprehensive overview of the request's scope and implications.
58
+
59
+ ## Scope Clarification:
60
+
61
+ After initial research, clearly outline:
62
+ - The apparent scope of the request based on findings
63
+ - Any ambiguities or areas needing further clarification
64
+ - Potential implications or dependencies not explicitly mentioned in the original request
65
+
66
+ ## Tool Usage and Transparency:
67
+
68
+ - For each research step, briefly mention which tools you're using and why.
69
+
70
+ ## Iterative Refinement:
71
+
72
+ - After initial research, if the scope or requirements remain unclear, propose follow-up questions or areas for further investigation.
73
+ - Be prepared to iterate on your research based on additional input or clarifications.
74
+
75
+ ## Final Answer Format:
76
+
77
+ When calling finalAnswer, provide a structured summary including:
78
+ 1. Initial Request: Restate the original task or question.
79
+ 2. Key Terms and Definitions: List important terms and their definitions.
80
+ 3. Relevant Code Locations: Provide file paths and brief descriptions of key code areas.
81
+ 4. Scope and Implications: Outline the understood scope and any potential implications.
82
+ 5. Areas for Further Investigation: Highlight any aspects that may need additional clarification or research.
83
+
84
+ ## Important Guidelines:
85
+
86
+ - Use all available search tools to ensure a robust set of references.
87
+ - Do not perform modifications; focus solely on research and information gathering.
88
+ - Aim for thoroughness and accuracy in your findings.
89
+ - Call finalAnswer after completing your research, but do not exceed 5 rounds of research without calling finalAnswer.
90
+ - You cannot request feedback from the user during your research process.
91
+
92
+ Remember, your role is to provide a comprehensive foundation of information to facilitate further action or implementation by other agents or developers.
93
+ Expect to use the tools, read files, etc. to construct a precise detailed analysis.
94
+ `,
95
+ },
96
+ {
97
+ role: "user",
98
+ content: `The user has asked: ${userInput}
99
+ Do not do more than 5 rounds of research without calling finalAnswer.
100
+ `,
101
+ },
102
+ ];
103
+ }
104
+ }
105
+ exports.ResearcherAgent = ResearcherAgent;
106
+ exports.Researcher = new ResearcherAgent();
107
+ //# sourceMappingURL=researcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"researcher.js","sourceRoot":"","sources":["../../../../src/agents/researcher/researcher.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAElC,uCAAyC;AAEzC,MAAa,eAAgB,SAAQ,gBAAS;IAC5C,IAAI,GAAG,YAAY,CAAC;IACpB,WAAW,GAAG,2IAA2I,CAAC;IAE1J;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,CAAC,WAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAC7C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAE3B,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,SAAiB;QACxC,OAAO;YACL;gBACE,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2EhB;aACM;YAED;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,uBAAuB,SAAS;;SAExC;aACF;SACW,CAAC;IACjB,CAAC;CACF;AAtGD,0CAsGC;AAEY,QAAA,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function addInternalTools(fns: {
2
+ [fnName: string]: (...args: any) => any;
3
+ }): {
4
+ [fnName: string]: (...args: any) => any;
5
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addInternalTools = void 0;
4
+ function addInternalTools(fns) {
5
+ const callParallel = (fnsToCall) => {
6
+ const promises = fnsToCall.map((param) => {
7
+ const name = param.recipient_name.split(".").pop();
8
+ const fn = fns[name];
9
+ const args = Object.values(param.parameters);
10
+ return fn(...args);
11
+ });
12
+ return Promise.all(promises);
13
+ };
14
+ fns["multi_tool_use.parallel"] = callParallel;
15
+ return fns;
16
+ }
17
+ exports.addInternalTools = addInternalTools;
18
+ //# sourceMappingURL=addInternalTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addInternalTools.js","sourceRoot":"","sources":["../../../../src/agents/tools/addInternalTools.ts"],"names":[],"mappings":";;;AACA,SAAgB,gBAAgB,CAAC,GAEhC;IACC,MAAM,YAAY,GAAG,CACnB,SAAwD,EACxD,EAAE;QACF,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACvC,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YACnD,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;YACrB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAC7C,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,GAAG,CAAC,yBAAyB,CAAC,GAAG,YAAY,CAAC;IAE9C,OAAO,GAAG,CAAC;AACb,CAAC;AAnBD,4CAmBC"}
@@ -0,0 +1 @@
1
+ export declare function agentCall(agentName: string, userInput: string): Promise<unknown>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.agentCall = void 0;
4
+ const EventService_1 = require("../../services/EventService");
5
+ const plugins_1 = require("../../plugins/plugins");
6
+ const config_1 = require("../../config");
7
+ async function agentCall(agentName, userInput) {
8
+ return new Promise(async (resolve, reject) => {
9
+ const config = await (0, config_1.getConfig)();
10
+ const pluginText = await plugins_1.Plugins.callMany(config.plugins, userInput);
11
+ const fullPrompt = `${userInput} \n ${pluginText}`;
12
+ EventService_1.Events.emit("agents:call", {
13
+ name: agentName,
14
+ query: fullPrompt,
15
+ resolve,
16
+ reject,
17
+ });
18
+ });
19
+ }
20
+ exports.agentCall = agentCall;
21
+ //# sourceMappingURL=agentCall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentCall.js","sourceRoot":"","sources":["../../../../src/agents/tools/agentCall.ts"],"names":[],"mappings":";;;AACA,8DAAqD;AACrD,mDAAgD;AAChD,yCAAyC;AAElC,KAAK,UAAU,SAAS,CAAC,SAAiB,EAAE,SAAiB;IAClE,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,GAAE,CAAC;QACjC,MAAM,UAAU,GAAG,MAAM,iBAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACrE,MAAM,UAAU,GAAG,GAAG,SAAS,OAAO,UAAU,EAAE,CAAC;QACnD,qBAAM,CAAC,IAAI,CAAC,aAAa,EAAE;YACzB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,UAAU;YACjB,OAAO;YACP,MAAM;SACP,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAZD,8BAYC"}
@@ -0,0 +1,6 @@
1
+ import { CompletionOptions, CompletionResponse, EmbeddingOptions, EmbeddingResponse } from "../../clients/types";
2
+ export declare function createAiCompletion(provider: string, options: CompletionOptions): Promise<CompletionResponse>;
3
+ export declare function createEmbedding(provider: string, options: EmbeddingOptions): Promise<EmbeddingResponse>;
4
+ export declare function listModelsForProvider(provider: string): Promise<string[]>;
5
+ export declare function listAllModels(): Promise<Record<string, string[]>>;
6
+ export declare function listAllProviders(): Promise<string[]>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listAllProviders = exports.listAllModels = exports.listModelsForProvider = exports.createEmbedding = exports.createAiCompletion = void 0;
4
+ const clients_1 = require("../../clients");
5
+ function createAiCompletion(provider, options) {
6
+ return clients_1.Clients.createCompletion(provider, options);
7
+ }
8
+ exports.createAiCompletion = createAiCompletion;
9
+ function createEmbedding(provider, options) {
10
+ return clients_1.Clients.createEmbedding(provider, options);
11
+ }
12
+ exports.createEmbedding = createEmbedding;
13
+ async function listModelsForProvider(provider) {
14
+ return clients_1.Clients.getRegisteredModels(provider);
15
+ }
16
+ exports.listModelsForProvider = listModelsForProvider;
17
+ async function listAllModels() {
18
+ return clients_1.Clients.listAllModels();
19
+ }
20
+ exports.listAllModels = listAllModels;
21
+ async function listAllProviders() {
22
+ return clients_1.Clients.listAllProviders();
23
+ }
24
+ exports.listAllProviders = listAllProviders;
25
+ //# sourceMappingURL=aiClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aiClient.js","sourceRoot":"","sources":["../../../../src/agents/tools/aiClient.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AASxC,SAAgB,kBAAkB,CAChC,QAAgB,EAChB,OAA0B;IAE1B,OAAO,iBAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AALD,gDAKC;AAED,SAAgB,eAAe,CAC7B,QAAgB,EAChB,OAAyB;IAEzB,OAAO,iBAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AALD,0CAKC;AAEM,KAAK,UAAU,qBAAqB,CACzC,QAAgB;IAEhB,OAAO,iBAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC/C,CAAC;AAJD,sDAIC;AAEM,KAAK,UAAU,aAAa;IACjC,OAAO,iBAAO,CAAC,aAAa,EAAE,CAAC;AACjC,CAAC;AAFD,sCAEC;AAEM,KAAK,UAAU,gBAAgB;IACpC,OAAO,iBAAO,CAAC,gBAAgB,EAAE,CAAC;AACpC,CAAC;AAFD,4CAEC"}
@@ -0,0 +1,202 @@
1
+ export declare const definitions: ({
2
+ type: string;
3
+ function: {
4
+ name: string;
5
+ description: string;
6
+ parameters: {
7
+ type: string;
8
+ positional: boolean;
9
+ properties: {
10
+ projectId: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ taskName: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ taskNotes: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ taskId?: undefined;
23
+ updates?: undefined;
24
+ searchTerm?: undefined;
25
+ project?: undefined;
26
+ };
27
+ required: string[];
28
+ };
29
+ returns: {
30
+ type: string;
31
+ description: string;
32
+ };
33
+ };
34
+ } | {
35
+ type: string;
36
+ function: {
37
+ name: string;
38
+ description: string;
39
+ parameters: {
40
+ type: string;
41
+ positional: boolean;
42
+ properties: {
43
+ taskId: {
44
+ type: string;
45
+ description: string;
46
+ };
47
+ updates: {
48
+ type: string;
49
+ description: string;
50
+ };
51
+ projectId?: undefined;
52
+ taskName?: undefined;
53
+ taskNotes?: undefined;
54
+ searchTerm?: undefined;
55
+ project?: undefined;
56
+ };
57
+ required: string[];
58
+ };
59
+ returns: {
60
+ type: string;
61
+ description: string;
62
+ };
63
+ };
64
+ } | {
65
+ type: string;
66
+ function: {
67
+ name: string;
68
+ description: string;
69
+ parameters: {
70
+ type: string;
71
+ positional: boolean;
72
+ properties: {
73
+ searchTerm: {
74
+ type: string;
75
+ description: string;
76
+ };
77
+ projectId?: undefined;
78
+ taskName?: undefined;
79
+ taskNotes?: undefined;
80
+ taskId?: undefined;
81
+ updates?: undefined;
82
+ project?: undefined;
83
+ };
84
+ required: string[];
85
+ };
86
+ returns: {
87
+ type: string;
88
+ description: string;
89
+ };
90
+ };
91
+ } | {
92
+ type: string;
93
+ function: {
94
+ name: string;
95
+ description: string;
96
+ parameters: {
97
+ type: string;
98
+ positional: boolean;
99
+ properties: {
100
+ projectId?: undefined;
101
+ taskName?: undefined;
102
+ taskNotes?: undefined;
103
+ taskId?: undefined;
104
+ updates?: undefined;
105
+ searchTerm?: undefined;
106
+ project?: undefined;
107
+ };
108
+ required: any[];
109
+ };
110
+ returns: {
111
+ type: string;
112
+ description: string;
113
+ };
114
+ };
115
+ } | {
116
+ type: string;
117
+ function: {
118
+ name: string;
119
+ description: string;
120
+ parameters: {
121
+ type: string;
122
+ positional: boolean;
123
+ properties: {
124
+ taskId: {
125
+ type: string;
126
+ description: string;
127
+ };
128
+ projectId?: undefined;
129
+ taskName?: undefined;
130
+ taskNotes?: undefined;
131
+ updates?: undefined;
132
+ searchTerm?: undefined;
133
+ project?: undefined;
134
+ };
135
+ required: string[];
136
+ };
137
+ returns: {
138
+ type: string;
139
+ description: string;
140
+ };
141
+ };
142
+ } | {
143
+ type: string;
144
+ function: {
145
+ name: string;
146
+ description: string;
147
+ parameters: {
148
+ type: string;
149
+ positional: boolean;
150
+ properties: {
151
+ project: {
152
+ type: string;
153
+ description: string;
154
+ };
155
+ projectId?: undefined;
156
+ taskName?: undefined;
157
+ taskNotes?: undefined;
158
+ taskId?: undefined;
159
+ updates?: undefined;
160
+ searchTerm?: undefined;
161
+ };
162
+ required: any[];
163
+ };
164
+ returns: {
165
+ type: string;
166
+ description: string;
167
+ };
168
+ };
169
+ } | {
170
+ type: string;
171
+ function: {
172
+ name: string;
173
+ description: string;
174
+ parameters: {
175
+ type: string;
176
+ positional: boolean;
177
+ properties: {
178
+ taskId: {
179
+ type: string;
180
+ description: string;
181
+ };
182
+ taskName: {
183
+ type: string;
184
+ description: string;
185
+ };
186
+ taskNotes: {
187
+ type: string;
188
+ description: string;
189
+ };
190
+ projectId?: undefined;
191
+ updates?: undefined;
192
+ searchTerm?: undefined;
193
+ project?: undefined;
194
+ };
195
+ required: string[];
196
+ };
197
+ returns: {
198
+ type: string;
199
+ description: string;
200
+ };
201
+ };
202
+ })[];