@agntk/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (502) hide show
  1. package/README.md +227 -0
  2. package/dist/advanced/index.d.ts +35 -0
  3. package/dist/advanced/index.d.ts.map +1 -0
  4. package/dist/advanced/index.js +52 -0
  5. package/dist/advanced/index.js.map +1 -0
  6. package/dist/agent.d.ts +46 -0
  7. package/dist/agent.d.ts.map +1 -0
  8. package/dist/agent.js +381 -0
  9. package/dist/agent.js.map +1 -0
  10. package/dist/config/defaults.d.ts +10 -0
  11. package/dist/config/defaults.d.ts.map +1 -0
  12. package/dist/config/defaults.js +34 -0
  13. package/dist/config/defaults.js.map +1 -0
  14. package/dist/config/index.d.ts +7 -0
  15. package/dist/config/index.d.ts.map +1 -0
  16. package/dist/config/index.js +11 -0
  17. package/dist/config/index.js.map +1 -0
  18. package/dist/config/loader.d.ts +54 -0
  19. package/dist/config/loader.d.ts.map +1 -0
  20. package/dist/config/loader.js +222 -0
  21. package/dist/config/loader.js.map +1 -0
  22. package/dist/config/schema.d.ts +912 -0
  23. package/dist/config/schema.d.ts.map +1 -0
  24. package/dist/config/schema.js +119 -0
  25. package/dist/config/schema.js.map +1 -0
  26. package/dist/constants.d.ts +17 -0
  27. package/dist/constants.d.ts.map +1 -0
  28. package/dist/constants.js +23 -0
  29. package/dist/constants.js.map +1 -0
  30. package/dist/evals/assertions.d.ts +54 -0
  31. package/dist/evals/assertions.d.ts.map +1 -0
  32. package/dist/evals/assertions.js +200 -0
  33. package/dist/evals/assertions.js.map +1 -0
  34. package/dist/evals/index.d.ts +9 -0
  35. package/dist/evals/index.d.ts.map +1 -0
  36. package/dist/evals/index.js +8 -0
  37. package/dist/evals/index.js.map +1 -0
  38. package/dist/evals/runner.d.ts +34 -0
  39. package/dist/evals/runner.d.ts.map +1 -0
  40. package/dist/evals/runner.js +186 -0
  41. package/dist/evals/runner.js.map +1 -0
  42. package/dist/evals/types.d.ts +68 -0
  43. package/dist/evals/types.d.ts.map +1 -0
  44. package/dist/evals/types.js +5 -0
  45. package/dist/evals/types.js.map +1 -0
  46. package/dist/guardrails/built-ins.d.ts +48 -0
  47. package/dist/guardrails/built-ins.d.ts.map +1 -0
  48. package/dist/guardrails/built-ins.js +149 -0
  49. package/dist/guardrails/built-ins.js.map +1 -0
  50. package/dist/guardrails/index.d.ts +8 -0
  51. package/dist/guardrails/index.d.ts.map +1 -0
  52. package/dist/guardrails/index.js +7 -0
  53. package/dist/guardrails/index.js.map +1 -0
  54. package/dist/guardrails/runner.d.ts +49 -0
  55. package/dist/guardrails/runner.d.ts.map +1 -0
  56. package/dist/guardrails/runner.js +148 -0
  57. package/dist/guardrails/runner.js.map +1 -0
  58. package/dist/guardrails/types.d.ts +63 -0
  59. package/dist/guardrails/types.d.ts.map +1 -0
  60. package/dist/guardrails/types.js +22 -0
  61. package/dist/guardrails/types.js.map +1 -0
  62. package/dist/index.d.ts +31 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +35 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/memory/engine.d.ts +130 -0
  67. package/dist/memory/engine.d.ts.map +1 -0
  68. package/dist/memory/engine.js +227 -0
  69. package/dist/memory/engine.js.map +1 -0
  70. package/dist/memory/extraction.d.ts +24 -0
  71. package/dist/memory/extraction.d.ts.map +1 -0
  72. package/dist/memory/extraction.js +130 -0
  73. package/dist/memory/extraction.js.map +1 -0
  74. package/dist/memory/loader.d.ts +20 -0
  75. package/dist/memory/loader.d.ts.map +1 -0
  76. package/dist/memory/loader.js +73 -0
  77. package/dist/memory/loader.js.map +1 -0
  78. package/dist/memory/store.d.ts +42 -0
  79. package/dist/memory/store.d.ts.map +1 -0
  80. package/dist/memory/store.js +120 -0
  81. package/dist/memory/store.js.map +1 -0
  82. package/dist/memory/tools.d.ts +39 -0
  83. package/dist/memory/tools.d.ts.map +1 -0
  84. package/dist/memory/tools.js +225 -0
  85. package/dist/memory/tools.js.map +1 -0
  86. package/dist/memory/types.d.ts +46 -0
  87. package/dist/memory/types.d.ts.map +1 -0
  88. package/dist/memory/types.js +8 -0
  89. package/dist/memory/types.js.map +1 -0
  90. package/dist/memory/vectra-store.d.ts +31 -0
  91. package/dist/memory/vectra-store.d.ts.map +1 -0
  92. package/dist/memory/vectra-store.js +122 -0
  93. package/dist/memory/vectra-store.js.map +1 -0
  94. package/dist/models.d.ts +37 -0
  95. package/dist/models.d.ts.map +1 -0
  96. package/dist/models.js +131 -0
  97. package/dist/models.js.map +1 -0
  98. package/dist/observability/index.d.ts +6 -0
  99. package/dist/observability/index.d.ts.map +1 -0
  100. package/dist/observability/index.js +5 -0
  101. package/dist/observability/index.js.map +1 -0
  102. package/dist/observability/langfuse.d.ts +47 -0
  103. package/dist/observability/langfuse.d.ts.map +1 -0
  104. package/dist/observability/langfuse.js +112 -0
  105. package/dist/observability/langfuse.js.map +1 -0
  106. package/dist/observability/types.d.ts +37 -0
  107. package/dist/observability/types.d.ts.map +1 -0
  108. package/dist/observability/types.js +5 -0
  109. package/dist/observability/types.js.map +1 -0
  110. package/dist/pool/index.d.ts +7 -0
  111. package/dist/pool/index.d.ts.map +1 -0
  112. package/dist/pool/index.js +6 -0
  113. package/dist/pool/index.js.map +1 -0
  114. package/dist/pool/specialist-pool.d.ts +59 -0
  115. package/dist/pool/specialist-pool.d.ts.map +1 -0
  116. package/dist/pool/specialist-pool.js +224 -0
  117. package/dist/pool/specialist-pool.js.map +1 -0
  118. package/dist/pool/tools.d.ts +63 -0
  119. package/dist/pool/tools.d.ts.map +1 -0
  120. package/dist/pool/tools.js +83 -0
  121. package/dist/pool/tools.js.map +1 -0
  122. package/dist/pool/types.d.ts +79 -0
  123. package/dist/pool/types.d.ts.map +1 -0
  124. package/dist/pool/types.js +5 -0
  125. package/dist/pool/types.js.map +1 -0
  126. package/dist/presets/index.d.ts +5 -0
  127. package/dist/presets/index.d.ts.map +1 -0
  128. package/dist/presets/index.js +5 -0
  129. package/dist/presets/index.js.map +1 -0
  130. package/dist/presets/role-registry.d.ts +41 -0
  131. package/dist/presets/role-registry.d.ts.map +1 -0
  132. package/dist/presets/role-registry.js +213 -0
  133. package/dist/presets/role-registry.js.map +1 -0
  134. package/dist/presets/roles.d.ts +105 -0
  135. package/dist/presets/roles.d.ts.map +1 -0
  136. package/dist/presets/roles.js +207 -0
  137. package/dist/presets/roles.js.map +1 -0
  138. package/dist/presets/sub-agent-configs.d.ts +19 -0
  139. package/dist/presets/sub-agent-configs.d.ts.map +1 -0
  140. package/dist/presets/sub-agent-configs.js +71 -0
  141. package/dist/presets/sub-agent-configs.js.map +1 -0
  142. package/dist/presets/tool-preset-registry.d.ts +34 -0
  143. package/dist/presets/tool-preset-registry.d.ts.map +1 -0
  144. package/dist/presets/tool-preset-registry.js +107 -0
  145. package/dist/presets/tool-preset-registry.js.map +1 -0
  146. package/dist/presets/tools.d.ts +278 -0
  147. package/dist/presets/tools.d.ts.map +1 -0
  148. package/dist/presets/tools.js +108 -0
  149. package/dist/presets/tools.js.map +1 -0
  150. package/dist/prompts/context.d.ts +47 -0
  151. package/dist/prompts/context.d.ts.map +1 -0
  152. package/dist/prompts/context.js +187 -0
  153. package/dist/prompts/context.js.map +1 -0
  154. package/dist/prompts/template.d.ts +17 -0
  155. package/dist/prompts/template.d.ts.map +1 -0
  156. package/dist/prompts/template.js +32 -0
  157. package/dist/prompts/template.js.map +1 -0
  158. package/dist/prompts/templates.d.ts +11 -0
  159. package/dist/prompts/templates.d.ts.map +1 -0
  160. package/dist/prompts/templates.js +115 -0
  161. package/dist/prompts/templates.js.map +1 -0
  162. package/dist/reflection.d.ts +48 -0
  163. package/dist/reflection.d.ts.map +1 -0
  164. package/dist/reflection.js +91 -0
  165. package/dist/reflection.js.map +1 -0
  166. package/dist/skills/index.d.ts +6 -0
  167. package/dist/skills/index.d.ts.map +1 -0
  168. package/dist/skills/index.js +5 -0
  169. package/dist/skills/index.js.map +1 -0
  170. package/dist/skills/loader.d.ts +84 -0
  171. package/dist/skills/loader.d.ts.map +1 -0
  172. package/dist/skills/loader.js +400 -0
  173. package/dist/skills/loader.js.map +1 -0
  174. package/dist/skills/types.d.ts +66 -0
  175. package/dist/skills/types.d.ts.map +1 -0
  176. package/dist/skills/types.js +6 -0
  177. package/dist/skills/types.js.map +1 -0
  178. package/dist/streaming/data-parts.d.ts +163 -0
  179. package/dist/streaming/data-parts.d.ts.map +1 -0
  180. package/dist/streaming/data-parts.js +14 -0
  181. package/dist/streaming/data-parts.js.map +1 -0
  182. package/dist/streaming/index.d.ts +8 -0
  183. package/dist/streaming/index.d.ts.map +1 -0
  184. package/dist/streaming/index.js +10 -0
  185. package/dist/streaming/index.js.map +1 -0
  186. package/dist/streaming/transient.d.ts +136 -0
  187. package/dist/streaming/transient.d.ts.map +1 -0
  188. package/dist/streaming/transient.js +201 -0
  189. package/dist/streaming/transient.js.map +1 -0
  190. package/dist/tools/approval.d.ts +67 -0
  191. package/dist/tools/approval.d.ts.map +1 -0
  192. package/dist/tools/approval.js +113 -0
  193. package/dist/tools/approval.js.map +1 -0
  194. package/dist/tools/ast-grep/cli.d.ts +16 -0
  195. package/dist/tools/ast-grep/cli.d.ts.map +1 -0
  196. package/dist/tools/ast-grep/cli.js +198 -0
  197. package/dist/tools/ast-grep/cli.js.map +1 -0
  198. package/dist/tools/ast-grep/constants.d.ts +24 -0
  199. package/dist/tools/ast-grep/constants.d.ts.map +1 -0
  200. package/dist/tools/ast-grep/constants.js +247 -0
  201. package/dist/tools/ast-grep/constants.js.map +1 -0
  202. package/dist/tools/ast-grep/downloader.d.ts +6 -0
  203. package/dist/tools/ast-grep/downloader.d.ts.map +1 -0
  204. package/dist/tools/ast-grep/downloader.js +137 -0
  205. package/dist/tools/ast-grep/downloader.js.map +1 -0
  206. package/dist/tools/ast-grep/index.d.ts +7 -0
  207. package/dist/tools/ast-grep/index.d.ts.map +1 -0
  208. package/dist/tools/ast-grep/index.js +6 -0
  209. package/dist/tools/ast-grep/index.js.map +1 -0
  210. package/dist/tools/ast-grep/tools.d.ts +33 -0
  211. package/dist/tools/ast-grep/tools.d.ts.map +1 -0
  212. package/dist/tools/ast-grep/tools.js +140 -0
  213. package/dist/tools/ast-grep/tools.js.map +1 -0
  214. package/dist/tools/ast-grep/types.d.ts +68 -0
  215. package/dist/tools/ast-grep/types.d.ts.map +1 -0
  216. package/dist/tools/ast-grep/types.js +2 -0
  217. package/dist/tools/ast-grep/types.js.map +1 -0
  218. package/dist/tools/ast-grep/utils.d.ts +4 -0
  219. package/dist/tools/ast-grep/utils.d.ts.map +1 -0
  220. package/dist/tools/ast-grep/utils.js +55 -0
  221. package/dist/tools/ast-grep/utils.js.map +1 -0
  222. package/dist/tools/browser/index.d.ts +6 -0
  223. package/dist/tools/browser/index.d.ts.map +1 -0
  224. package/dist/tools/browser/index.js +5 -0
  225. package/dist/tools/browser/index.js.map +1 -0
  226. package/dist/tools/browser/stream.d.ts +112 -0
  227. package/dist/tools/browser/stream.d.ts.map +1 -0
  228. package/dist/tools/browser/stream.js +228 -0
  229. package/dist/tools/browser/stream.js.map +1 -0
  230. package/dist/tools/browser/tool.d.ts +144 -0
  231. package/dist/tools/browser/tool.d.ts.map +1 -0
  232. package/dist/tools/browser/tool.js +214 -0
  233. package/dist/tools/browser/tool.js.map +1 -0
  234. package/dist/tools/browser/types.d.ts +216 -0
  235. package/dist/tools/browser/types.d.ts.map +1 -0
  236. package/dist/tools/browser/types.js +146 -0
  237. package/dist/tools/browser/types.js.map +1 -0
  238. package/dist/tools/deep-reasoning/constants.d.ts +11 -0
  239. package/dist/tools/deep-reasoning/constants.d.ts.map +1 -0
  240. package/dist/tools/deep-reasoning/constants.js +35 -0
  241. package/dist/tools/deep-reasoning/constants.js.map +1 -0
  242. package/dist/tools/deep-reasoning/engine.d.ts +20 -0
  243. package/dist/tools/deep-reasoning/engine.d.ts.map +1 -0
  244. package/dist/tools/deep-reasoning/engine.js +77 -0
  245. package/dist/tools/deep-reasoning/engine.js.map +1 -0
  246. package/dist/tools/deep-reasoning/index.d.ts +5 -0
  247. package/dist/tools/deep-reasoning/index.d.ts.map +1 -0
  248. package/dist/tools/deep-reasoning/index.js +7 -0
  249. package/dist/tools/deep-reasoning/index.js.map +1 -0
  250. package/dist/tools/deep-reasoning/tools.d.ts +12 -0
  251. package/dist/tools/deep-reasoning/tools.d.ts.map +1 -0
  252. package/dist/tools/deep-reasoning/tools.js +23 -0
  253. package/dist/tools/deep-reasoning/tools.js.map +1 -0
  254. package/dist/tools/deep-reasoning/types.d.ts +66 -0
  255. package/dist/tools/deep-reasoning/types.d.ts.map +1 -0
  256. package/dist/tools/deep-reasoning/types.js +13 -0
  257. package/dist/tools/deep-reasoning/types.js.map +1 -0
  258. package/dist/tools/factory.d.ts +109 -0
  259. package/dist/tools/factory.d.ts.map +1 -0
  260. package/dist/tools/factory.js +166 -0
  261. package/dist/tools/factory.js.map +1 -0
  262. package/dist/tools/file/index.d.ts +8 -0
  263. package/dist/tools/file/index.d.ts.map +1 -0
  264. package/dist/tools/file/index.js +8 -0
  265. package/dist/tools/file/index.js.map +1 -0
  266. package/dist/tools/file/tools.d.ts +45 -0
  267. package/dist/tools/file/tools.d.ts.map +1 -0
  268. package/dist/tools/file/tools.js +206 -0
  269. package/dist/tools/file/tools.js.map +1 -0
  270. package/dist/tools/glob/cli.d.ts +8 -0
  271. package/dist/tools/glob/cli.d.ts.map +1 -0
  272. package/dist/tools/glob/cli.js +168 -0
  273. package/dist/tools/glob/cli.js.map +1 -0
  274. package/dist/tools/glob/constants.d.ts +7 -0
  275. package/dist/tools/glob/constants.d.ts.map +1 -0
  276. package/dist/tools/glob/constants.js +17 -0
  277. package/dist/tools/glob/constants.js.map +1 -0
  278. package/dist/tools/glob/index.d.ts +6 -0
  279. package/dist/tools/glob/index.d.ts.map +1 -0
  280. package/dist/tools/glob/index.js +5 -0
  281. package/dist/tools/glob/index.js.map +1 -0
  282. package/dist/tools/glob/tools.d.ts +15 -0
  283. package/dist/tools/glob/tools.d.ts.map +1 -0
  284. package/dist/tools/glob/tools.js +74 -0
  285. package/dist/tools/glob/tools.js.map +1 -0
  286. package/dist/tools/glob/types.d.ts +20 -0
  287. package/dist/tools/glob/types.d.ts.map +1 -0
  288. package/dist/tools/glob/types.js +2 -0
  289. package/dist/tools/glob/types.js.map +1 -0
  290. package/dist/tools/glob/utils.d.ts +3 -0
  291. package/dist/tools/glob/utils.d.ts.map +1 -0
  292. package/dist/tools/glob/utils.js +20 -0
  293. package/dist/tools/glob/utils.js.map +1 -0
  294. package/dist/tools/grep/cli.d.ts +4 -0
  295. package/dist/tools/grep/cli.d.ts.map +1 -0
  296. package/dist/tools/grep/cli.js +224 -0
  297. package/dist/tools/grep/cli.js.map +1 -0
  298. package/dist/tools/grep/constants.d.ts +19 -0
  299. package/dist/tools/grep/constants.d.ts.map +1 -0
  300. package/dist/tools/grep/constants.js +115 -0
  301. package/dist/tools/grep/constants.js.map +1 -0
  302. package/dist/tools/grep/downloader.d.ts +3 -0
  303. package/dist/tools/grep/downloader.d.ts.map +1 -0
  304. package/dist/tools/grep/downloader.js +164 -0
  305. package/dist/tools/grep/downloader.js.map +1 -0
  306. package/dist/tools/grep/index.d.ts +7 -0
  307. package/dist/tools/grep/index.d.ts.map +1 -0
  308. package/dist/tools/grep/index.js +6 -0
  309. package/dist/tools/grep/index.js.map +1 -0
  310. package/dist/tools/grep/tools.d.ts +19 -0
  311. package/dist/tools/grep/tools.d.ts.map +1 -0
  312. package/dist/tools/grep/tools.js +82 -0
  313. package/dist/tools/grep/tools.js.map +1 -0
  314. package/dist/tools/grep/types.d.ts +37 -0
  315. package/dist/tools/grep/types.d.ts.map +1 -0
  316. package/dist/tools/grep/types.js +2 -0
  317. package/dist/tools/grep/types.js.map +1 -0
  318. package/dist/tools/grep/utils.d.ts +4 -0
  319. package/dist/tools/grep/utils.d.ts.map +1 -0
  320. package/dist/tools/grep/utils.js +41 -0
  321. package/dist/tools/grep/utils.js.map +1 -0
  322. package/dist/tools/index.d.ts +21 -0
  323. package/dist/tools/index.d.ts.map +1 -0
  324. package/dist/tools/index.js +33 -0
  325. package/dist/tools/index.js.map +1 -0
  326. package/dist/tools/model-retry.d.ts +54 -0
  327. package/dist/tools/model-retry.d.ts.map +1 -0
  328. package/dist/tools/model-retry.js +110 -0
  329. package/dist/tools/model-retry.js.map +1 -0
  330. package/dist/tools/plan/constants.d.ts +18 -0
  331. package/dist/tools/plan/constants.d.ts.map +1 -0
  332. package/dist/tools/plan/constants.js +13 -0
  333. package/dist/tools/plan/constants.js.map +1 -0
  334. package/dist/tools/plan/index.d.ts +5 -0
  335. package/dist/tools/plan/index.d.ts.map +1 -0
  336. package/dist/tools/plan/index.js +7 -0
  337. package/dist/tools/plan/index.js.map +1 -0
  338. package/dist/tools/plan/tools.d.ts +16 -0
  339. package/dist/tools/plan/tools.d.ts.map +1 -0
  340. package/dist/tools/plan/tools.js +217 -0
  341. package/dist/tools/plan/tools.js.map +1 -0
  342. package/dist/tools/plan/types.d.ts +75 -0
  343. package/dist/tools/plan/types.d.ts.map +1 -0
  344. package/dist/tools/plan/types.js +16 -0
  345. package/dist/tools/plan/types.js.map +1 -0
  346. package/dist/tools/plan/utils.d.ts +9 -0
  347. package/dist/tools/plan/utils.d.ts.map +1 -0
  348. package/dist/tools/plan/utils.js +27 -0
  349. package/dist/tools/plan/utils.js.map +1 -0
  350. package/dist/tools/progress/index.d.ts +53 -0
  351. package/dist/tools/progress/index.d.ts.map +1 -0
  352. package/dist/tools/progress/index.js +144 -0
  353. package/dist/tools/progress/index.js.map +1 -0
  354. package/dist/tools/provider.d.ts +97 -0
  355. package/dist/tools/provider.d.ts.map +1 -0
  356. package/dist/tools/provider.js +178 -0
  357. package/dist/tools/provider.js.map +1 -0
  358. package/dist/tools/search-skills.d.ts +44 -0
  359. package/dist/tools/search-skills.d.ts.map +1 -0
  360. package/dist/tools/search-skills.js +134 -0
  361. package/dist/tools/search-skills.js.map +1 -0
  362. package/dist/tools/shell/background.d.ts +38 -0
  363. package/dist/tools/shell/background.d.ts.map +1 -0
  364. package/dist/tools/shell/background.js +229 -0
  365. package/dist/tools/shell/background.js.map +1 -0
  366. package/dist/tools/shell/constants.d.ts +10 -0
  367. package/dist/tools/shell/constants.d.ts.map +1 -0
  368. package/dist/tools/shell/constants.js +55 -0
  369. package/dist/tools/shell/constants.js.map +1 -0
  370. package/dist/tools/shell/index.d.ts +7 -0
  371. package/dist/tools/shell/index.d.ts.map +1 -0
  372. package/dist/tools/shell/index.js +5 -0
  373. package/dist/tools/shell/index.js.map +1 -0
  374. package/dist/tools/shell/tools.d.ts +22 -0
  375. package/dist/tools/shell/tools.d.ts.map +1 -0
  376. package/dist/tools/shell/tools.js +70 -0
  377. package/dist/tools/shell/tools.js.map +1 -0
  378. package/dist/tools/shell/types.d.ts +30 -0
  379. package/dist/tools/shell/types.d.ts.map +1 -0
  380. package/dist/tools/shell/types.js +10 -0
  381. package/dist/tools/shell/types.js.map +1 -0
  382. package/dist/tools/shell/utils.d.ts +7 -0
  383. package/dist/tools/shell/utils.d.ts.map +1 -0
  384. package/dist/tools/shell/utils.js +26 -0
  385. package/dist/tools/shell/utils.js.map +1 -0
  386. package/dist/tools/spawn-agent/index.d.ts +96 -0
  387. package/dist/tools/spawn-agent/index.d.ts.map +1 -0
  388. package/dist/tools/spawn-agent/index.js +168 -0
  389. package/dist/tools/spawn-agent/index.js.map +1 -0
  390. package/dist/tools/utils/errors.d.ts +21 -0
  391. package/dist/tools/utils/errors.d.ts.map +1 -0
  392. package/dist/tools/utils/errors.js +29 -0
  393. package/dist/tools/utils/errors.js.map +1 -0
  394. package/dist/tools/utils/shell.d.ts +23 -0
  395. package/dist/tools/utils/shell.d.ts.map +1 -0
  396. package/dist/tools/utils/shell.js +99 -0
  397. package/dist/tools/utils/shell.js.map +1 -0
  398. package/dist/tools/utils/tool-result.d.ts +6 -0
  399. package/dist/tools/utils/tool-result.d.ts.map +1 -0
  400. package/dist/tools/utils/tool-result.js +22 -0
  401. package/dist/tools/utils/tool-result.js.map +1 -0
  402. package/dist/types/agent.d.ts +218 -0
  403. package/dist/types/agent.d.ts.map +1 -0
  404. package/dist/types/agent.js +6 -0
  405. package/dist/types/agent.js.map +1 -0
  406. package/dist/types/index.d.ts +7 -0
  407. package/dist/types/index.d.ts.map +1 -0
  408. package/dist/types/index.js +6 -0
  409. package/dist/types/index.js.map +1 -0
  410. package/dist/types/lifecycle.d.ts +218 -0
  411. package/dist/types/lifecycle.d.ts.map +1 -0
  412. package/dist/types/lifecycle.js +99 -0
  413. package/dist/types/lifecycle.js.map +1 -0
  414. package/dist/types/streaming.d.ts +120 -0
  415. package/dist/types/streaming.d.ts.map +1 -0
  416. package/dist/types/streaming.js +6 -0
  417. package/dist/types/streaming.js.map +1 -0
  418. package/dist/usage-limits.d.ts +63 -0
  419. package/dist/usage-limits.d.ts.map +1 -0
  420. package/dist/usage-limits.js +88 -0
  421. package/dist/usage-limits.js.map +1 -0
  422. package/dist/utils/logger.d.ts +35 -0
  423. package/dist/utils/logger.d.ts.map +1 -0
  424. package/dist/utils/logger.js +149 -0
  425. package/dist/utils/logger.js.map +1 -0
  426. package/dist/workflow/builders/adapt.d.ts +20 -0
  427. package/dist/workflow/builders/adapt.d.ts.map +1 -0
  428. package/dist/workflow/builders/adapt.js +33 -0
  429. package/dist/workflow/builders/adapt.js.map +1 -0
  430. package/dist/workflow/builders/index.d.ts +8 -0
  431. package/dist/workflow/builders/index.d.ts.map +1 -0
  432. package/dist/workflow/builders/index.js +7 -0
  433. package/dist/workflow/builders/index.js.map +1 -0
  434. package/dist/workflow/builders/parallel.d.ts +25 -0
  435. package/dist/workflow/builders/parallel.d.ts.map +1 -0
  436. package/dist/workflow/builders/parallel.js +60 -0
  437. package/dist/workflow/builders/parallel.js.map +1 -0
  438. package/dist/workflow/builders/pipeline.d.ts +22 -0
  439. package/dist/workflow/builders/pipeline.d.ts.map +1 -0
  440. package/dist/workflow/builders/pipeline.js +48 -0
  441. package/dist/workflow/builders/pipeline.js.map +1 -0
  442. package/dist/workflow/builders/types.d.ts +54 -0
  443. package/dist/workflow/builders/types.d.ts.map +1 -0
  444. package/dist/workflow/builders/types.js +5 -0
  445. package/dist/workflow/builders/types.js.map +1 -0
  446. package/dist/workflow/durable-agent.d.ts +128 -0
  447. package/dist/workflow/durable-agent.d.ts.map +1 -0
  448. package/dist/workflow/durable-agent.js +323 -0
  449. package/dist/workflow/durable-agent.js.map +1 -0
  450. package/dist/workflow/durable-tool.d.ts +103 -0
  451. package/dist/workflow/durable-tool.d.ts.map +1 -0
  452. package/dist/workflow/durable-tool.js +173 -0
  453. package/dist/workflow/durable-tool.js.map +1 -0
  454. package/dist/workflow/hooks.d.ts +318 -0
  455. package/dist/workflow/hooks.d.ts.map +1 -0
  456. package/dist/workflow/hooks.js +629 -0
  457. package/dist/workflow/hooks.js.map +1 -0
  458. package/dist/workflow/index.d.ts +17 -0
  459. package/dist/workflow/index.d.ts.map +1 -0
  460. package/dist/workflow/index.js +24 -0
  461. package/dist/workflow/index.js.map +1 -0
  462. package/dist/workflow/schedulers.d.ts +231 -0
  463. package/dist/workflow/schedulers.d.ts.map +1 -0
  464. package/dist/workflow/schedulers.js +250 -0
  465. package/dist/workflow/schedulers.js.map +1 -0
  466. package/dist/workflow/team/create-team.d.ts +34 -0
  467. package/dist/workflow/team/create-team.d.ts.map +1 -0
  468. package/dist/workflow/team/create-team.js +242 -0
  469. package/dist/workflow/team/create-team.js.map +1 -0
  470. package/dist/workflow/team/index.d.ts +9 -0
  471. package/dist/workflow/team/index.d.ts.map +1 -0
  472. package/dist/workflow/team/index.js +8 -0
  473. package/dist/workflow/team/index.js.map +1 -0
  474. package/dist/workflow/team/machines.d.ts +152 -0
  475. package/dist/workflow/team/machines.d.ts.map +1 -0
  476. package/dist/workflow/team/machines.js +197 -0
  477. package/dist/workflow/team/machines.js.map +1 -0
  478. package/dist/workflow/team/task-board.d.ts +47 -0
  479. package/dist/workflow/team/task-board.d.ts.map +1 -0
  480. package/dist/workflow/team/task-board.js +111 -0
  481. package/dist/workflow/team/task-board.js.map +1 -0
  482. package/dist/workflow/team/tools.d.ts +66 -0
  483. package/dist/workflow/team/tools.d.ts.map +1 -0
  484. package/dist/workflow/team/tools.js +100 -0
  485. package/dist/workflow/team/tools.js.map +1 -0
  486. package/dist/workflow/team/types.d.ts +109 -0
  487. package/dist/workflow/team/types.d.ts.map +1 -0
  488. package/dist/workflow/team/types.js +5 -0
  489. package/dist/workflow/team/types.js.map +1 -0
  490. package/dist/workflow/templates.d.ts +71 -0
  491. package/dist/workflow/templates.d.ts.map +1 -0
  492. package/dist/workflow/templates.js +132 -0
  493. package/dist/workflow/templates.js.map +1 -0
  494. package/dist/workflow/utils.d.ts +29 -0
  495. package/dist/workflow/utils.d.ts.map +1 -0
  496. package/dist/workflow/utils.js +84 -0
  497. package/dist/workflow/utils.js.map +1 -0
  498. package/dist/wrappers/best-of-n.d.ts +69 -0
  499. package/dist/wrappers/best-of-n.d.ts.map +1 -0
  500. package/dist/wrappers/best-of-n.js +242 -0
  501. package/dist/wrappers/best-of-n.js.map +1 -0
  502. package/package.json +101 -0
@@ -0,0 +1,82 @@
1
+ import { tool } from 'ai';
2
+ import { z } from 'zod';
3
+ import { createLogger } from '@agntk/logger';
4
+ import { getToolConfig } from '../../config/index.js';
5
+ import { runRg } from './cli.js';
6
+ import { formatGrepResult } from './utils.js';
7
+ import { success, error } from '../utils/tool-result.js';
8
+ const log = createLogger('@agntk/core:grep');
9
+ // Get config values with fallbacks
10
+ function getGrepConfig() {
11
+ const config = getToolConfig('grep');
12
+ return {
13
+ timeout: config.timeout ?? 60_000,
14
+ maxContext: config.maxContext ?? 10,
15
+ };
16
+ }
17
+ const grepInputSchema = z.object({
18
+ pattern: z.string().describe('Regex pattern to search for in file contents'),
19
+ include: z
20
+ .string()
21
+ .optional()
22
+ .describe('File pattern to include (e.g., "*.ts", "*.{js,jsx}")'),
23
+ path: z
24
+ .string()
25
+ .optional()
26
+ .describe('Directory to search in. Defaults to current working directory.'),
27
+ context: z
28
+ .number()
29
+ .optional()
30
+ .describe('Number of context lines to show around matches'),
31
+ caseSensitive: z
32
+ .boolean()
33
+ .optional()
34
+ .describe('Enable case-sensitive matching (default: smart case)'),
35
+ wholeWord: z
36
+ .boolean()
37
+ .optional()
38
+ .describe('Match whole words only'),
39
+ });
40
+ export const grepTool = tool({
41
+ description: 'Fast content search. ' +
42
+ 'Uses ripgrep when available, falls back to grep. ' +
43
+ 'Supports regex patterns and file filtering. ' +
44
+ 'Returns file paths with line numbers and matching content.',
45
+ inputSchema: grepInputSchema,
46
+ execute: async (args) => {
47
+ const config = getGrepConfig();
48
+ log.debug('grep execute', { pattern: args.pattern, path: args.path, include: args.include });
49
+ try {
50
+ const result = await runRg({
51
+ pattern: args.pattern,
52
+ paths: args.path ? [args.path] : undefined,
53
+ globs: args.include ? [args.include] : undefined,
54
+ context: Math.min(args.context ?? 2, config.maxContext),
55
+ caseSensitive: args.caseSensitive,
56
+ wholeWord: args.wholeWord,
57
+ timeout: config.timeout,
58
+ });
59
+ if (result.error) {
60
+ log.warn('grep error', { pattern: args.pattern, error: result.error });
61
+ return error(result.error);
62
+ }
63
+ const output = formatGrepResult(result);
64
+ log.info('grep complete', { pattern: args.pattern, matches: result.totalMatches, files: result.filesSearched });
65
+ return success({
66
+ output,
67
+ matches: result.matches,
68
+ totalMatches: result.totalMatches,
69
+ filesSearched: result.filesSearched,
70
+ truncated: result.truncated,
71
+ });
72
+ }
73
+ catch (err) {
74
+ log.error('grep failed', { pattern: args.pattern, error: err });
75
+ return error(err instanceof Error ? err.message : String(err));
76
+ }
77
+ },
78
+ });
79
+ export function createGrepTool() {
80
+ return { grep: grepTool };
81
+ }
82
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../src/tools/grep/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,CAAC,EAAE,MAA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AAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;YAEhH,OAAO,OAAO,CAAC;gBACb,MAAM;gBACN,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,aAAa,EAAE,MAAM,CAAC,aAAa;gBACnC,SAAS,EAAE,MAAM,CAAC,SAAS;aAC5B,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;YAChE,OAAO,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc;IAC5B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,37 @@
1
+ export interface GrepMatch {
2
+ file: string;
3
+ line: number;
4
+ column?: number;
5
+ text: string;
6
+ }
7
+ export interface GrepResult {
8
+ matches: GrepMatch[];
9
+ totalMatches: number;
10
+ filesSearched: number;
11
+ truncated: boolean;
12
+ error?: string;
13
+ }
14
+ export interface GrepOptions {
15
+ pattern: string;
16
+ paths?: string[];
17
+ globs?: string[];
18
+ excludeGlobs?: string[];
19
+ context?: number;
20
+ maxDepth?: number;
21
+ maxFilesize?: string;
22
+ maxCount?: number;
23
+ maxColumns?: number;
24
+ caseSensitive?: boolean;
25
+ wholeWord?: boolean;
26
+ fixedStrings?: boolean;
27
+ multiline?: boolean;
28
+ hidden?: boolean;
29
+ noIgnore?: boolean;
30
+ fileType?: string[];
31
+ timeout?: number;
32
+ }
33
+ export interface CountResult {
34
+ file: string;
35
+ count: number;
36
+ }
37
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/grep/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/tools/grep/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { GrepResult, CountResult } from './types.js';
2
+ export declare function formatGrepResult(result: GrepResult): string;
3
+ export declare function formatCountResult(results: CountResult[]): string;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/grep/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,WAAW,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAiC3D;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,CAehE"}
@@ -0,0 +1,41 @@
1
+ export function formatGrepResult(result) {
2
+ if (result.error) {
3
+ return `Error: ${result.error}`;
4
+ }
5
+ if (result.matches.length === 0) {
6
+ return 'No matches found';
7
+ }
8
+ const lines = [];
9
+ lines.push(`Found ${result.totalMatches} match(es) in ${result.filesSearched} file(s)`);
10
+ if (result.truncated) {
11
+ lines.push('[Output truncated due to size limit]');
12
+ }
13
+ lines.push('');
14
+ const byFile = new Map();
15
+ for (const match of result.matches) {
16
+ const existing = byFile.get(match.file) || [];
17
+ existing.push(match);
18
+ byFile.set(match.file, existing);
19
+ }
20
+ for (const [file, matches] of byFile) {
21
+ lines.push(file);
22
+ for (const match of matches) {
23
+ lines.push(` ${match.line}: ${match.text.trim()}`);
24
+ }
25
+ lines.push('');
26
+ }
27
+ return lines.join('\n');
28
+ }
29
+ export function formatCountResult(results) {
30
+ if (results.length === 0) {
31
+ return 'No matches found';
32
+ }
33
+ const total = results.reduce((sum, r) => sum + r.count, 0);
34
+ const lines = [`Found ${total} match(es) in ${results.length} file(s):`, ''];
35
+ const sorted = [...results].sort((a, b) => b.count - a.count);
36
+ for (const { file, count } of sorted) {
37
+ lines.push(` ${count.toString().padStart(6)}: ${file}`);
38
+ }
39
+ return lines.join('\n');
40
+ }
41
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/tools/grep/utils.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB,CAAC,MAAkB;IACjD,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAED,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,YAAY,iBAAiB,MAAM,CAAC,aAAa,UAAU,CAAC,CAAC;IACxF,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;IACrD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,MAAM,MAAM,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC9C,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC9C,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM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 *
4
+ * Central export for tool factory, provider, and utilities.
5
+ */
6
+ export { ToolFactory, defaultToolFactory, mergeToolSets, filterTools, excludeTools, getToolNames, type ToolDependencies, type ToolSet, type ToolCreator, } from './factory.js';
7
+ export { globTool, createGlobTool, runRgFiles, formatGlobResult, type GlobOptions, type GlobResult, type FileMatch, } from './glob/index.js';
8
+ export { grepTool, createGrepTool, runRg, runRgCount, formatGrepResult, formatCountResult, downloadAndInstallRipgrep, type GrepOptions, type GrepMatch, type GrepResult, type CountResult, } from './grep/index.js';
9
+ export { astGrepSearchTool, astGrepReplaceTool, createAstGrepTools, runSg, ensureAstGrepBinary, formatSearchResult, formatReplaceResult, type CliLanguage, type CliMatch, type SgResult, type SearchMatch, } from './ast-grep/index.js';
10
+ export { createShellTool, shellTool, executeShellCommand, addToAllowlist, clearAllowlist, getAllowlist, SHELL_DESCRIPTION, DEFAULT_TIMEOUT, MAX_TIMEOUT, INTERACTIVE_COMMANDS, type ShellInput, type ShellResult, } from './shell/index.js';
11
+ export { createPlanTool, createValidationTool, runTypeCheck, runTestCommand, MAX_PLAN_STEPS, DELEGATION_THRESHOLD, PLAN_DESCRIPTION, VALIDATION_DESCRIPTION, AVAILABLE_AGENTS, type Plan, type PlanStep, type PlanToolConfig, type ScopeAssessment, type PendingDecision, type PlanInput, type ValidationInput, type ValidationResult, } from './plan/index.js';
12
+ export { createDeepReasoningTool, DeepReasoningEngine, configureDeepReasoning, isDeepReasoningEnabled, getDeepReasoningEngine, resetDeepReasoningEngine, DEEP_REASONING_DESCRIPTION, UNRESTRICTED_MODE_DESCRIPTION, DEFAULT_MAX_HISTORY, DEFAULT_MAX_BRANCH_SIZE, type ThoughtData, type ReasoningResult, type DeepReasoningConfig, type DeepReasoningInput, } from './deep-reasoning/index.js';
13
+ export { createFileReadTool, createFileWriteTool, createFileEditTool, createFileCreateTool, createFileTools, } from './file/index.js';
14
+ export { createSpawnAgentTool } from './spawn-agent/index.js';
15
+ export { ModelRetry, wrapToolWithRetry, wrapAllToolsWithRetry, } from './model-retry.js';
16
+ export { createSearchSkillsTool, clearSkillsCache, type SearchSkillsToolConfig } from './search-skills.js';
17
+ export { createMemoryTools, type MemoryToolsOptions } from '../memory/tools.js';
18
+ export type { MemoryStore, MemoryConfig } from '../memory/types.js';
19
+ export { MarkdownMemoryStore } from '../memory/store.js';
20
+ export { createBrowserTool, browserTool, executeBrowserCommand, buildCommand, isBrowserCliAvailable, resetCliAvailability, browserInputSchema, BROWSER_ACTIONS, BROWSER_TOOL_DESCRIPTION, type BrowserInput, type BrowserAction, type BrowserResult, type BrowserConfig, } from './browser/index.js';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,WAAW,GACjB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,QAAQ,EACR,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,GACf,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,QAAQ,EACR,cAAc,EACd,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,eAAe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AAiB,CAAC;AAGtD,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,wBAAwB,EACxB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,WAAW,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @agntk/core - Tools Module
3
+ *
4
+ * Central export for tool factory, provider, and utilities.
5
+ */
6
+ // Factory
7
+ export { ToolFactory, defaultToolFactory, mergeToolSets, filterTools, excludeTools, getToolNames, } from './factory.js';
8
+ // Glob Tool
9
+ export { globTool, createGlobTool, runRgFiles, formatGlobResult, } from './glob/index.js';
10
+ // Grep Tool
11
+ export { grepTool, createGrepTool, runRg, runRgCount, formatGrepResult, formatCountResult, downloadAndInstallRipgrep, } from './grep/index.js';
12
+ // AST-Grep Tool
13
+ export { astGrepSearchTool, astGrepReplaceTool, createAstGrepTools, runSg, ensureAstGrepBinary, formatSearchResult, formatReplaceResult, } from './ast-grep/index.js';
14
+ // Shell Tool
15
+ export { createShellTool, shellTool, executeShellCommand, addToAllowlist, clearAllowlist, getAllowlist, SHELL_DESCRIPTION, DEFAULT_TIMEOUT, MAX_TIMEOUT, INTERACTIVE_COMMANDS, } from './shell/index.js';
16
+ // Plan Tool
17
+ export { createPlanTool, createValidationTool, runTypeCheck, runTestCommand, MAX_PLAN_STEPS, DELEGATION_THRESHOLD, PLAN_DESCRIPTION, VALIDATION_DESCRIPTION, AVAILABLE_AGENTS, } from './plan/index.js';
18
+ // Deep Reasoning Tool
19
+ export { createDeepReasoningTool, DeepReasoningEngine, configureDeepReasoning, isDeepReasoningEnabled, getDeepReasoningEngine, resetDeepReasoningEngine, DEEP_REASONING_DESCRIPTION, UNRESTRICTED_MODE_DESCRIPTION, DEFAULT_MAX_HISTORY, DEFAULT_MAX_BRANCH_SIZE, } from './deep-reasoning/index.js';
20
+ // File Tools
21
+ export { createFileReadTool, createFileWriteTool, createFileEditTool, createFileCreateTool, createFileTools, } from './file/index.js';
22
+ // Spawn Agent Tool
23
+ export { createSpawnAgentTool } from './spawn-agent/index.js';
24
+ // Model Retry
25
+ export { ModelRetry, wrapToolWithRetry, wrapAllToolsWithRetry, } from './model-retry.js';
26
+ // Search Skills Tool
27
+ export { createSearchSkillsTool, clearSkillsCache } from './search-skills.js';
28
+ // Memory Tools
29
+ export { createMemoryTools } from '../memory/tools.js';
30
+ export { MarkdownMemoryStore } from '../memory/store.js';
31
+ // Browser Tool
32
+ export { createBrowserTool, browserTool, executeBrowserCommand, buildCommand, isBrowserCliAvailable, resetCliAvailability, browserInputSchema, BROWSER_ACTIONS, BROWSER_TOOL_DESCRIPTION, } from './browser/index.js';
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,UAAU;AACV,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,GAIb,MAAM,WAAW,CAAC;AAEnB,YAAY;AACZ,OAAO,EACL,QAAQ,EACR,cAAc,EACd,UAAU,EACV,gBAAgB,GAIjB,MAAM,QAAQ,CAAC;AAEhB,YAAY;AACZ,OAAO,EACL,QAAQ,EACR,cAAc,EACd,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,GAK1B,MAAM,QAAQ,CAAC;AAEhB,gBAAgB;AAChB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GAKpB,MAAM,YAAY,CAAC;AAEpB,aAAa;AACb,OAAO,EACL,eAAe,EACf,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,oBAAoB,GAGrB,MAAM,SAAS,CAAC;AAEjB,YAAY;AACZ,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,GASjB,MAAM,QAAQ,CAAC;AAEhB,sBAAsB;AACtB,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,6BAA6B,EAC7B,mBAAmB,EACnB,uBAAuB,GAKxB,MAAM,kBAAkB,CAAC;AAE1B,aAAa;AACb,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,GAChB,MAAM,QAAQ,CAAC;AAEhB,mBAAmB;AACnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,cAAc;AACd,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,qBAAqB;AACrB,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAA+B,MAAM,iBAAiB,CAAC;AAExG,eAAe;AACf,OAAO,EAAE,iBAAiB,EAA2B,MAAM,iBAAiB,CAAC;AAE7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAe;AACf,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,wBAAwB,GAKzB,MAAM,WAAW,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @agntk/core - Model Retry
3
+ *
4
+ * Error class and tool wrapper for LLM-retryable tool errors.
5
+ * When a tool throws ModelRetry, the error message is fed back to
6
+ * the model as corrective instructions, allowing it to retry with
7
+ * better parameters.
8
+ */
9
+ /**
10
+ * Throw this error from a tool execute function to instruct the LLM
11
+ * to retry with corrective guidance.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * execute: async ({ query }) => {
16
+ * if (query.length < 3) {
17
+ * throw new ModelRetry('Query too short. Provide at least 3 characters.');
18
+ * }
19
+ * // ...
20
+ * }
21
+ * ```
22
+ */
23
+ export declare class ModelRetry extends Error {
24
+ readonly name = "ModelRetry";
25
+ constructor(message: string);
26
+ }
27
+ interface ToolLike {
28
+ description?: string;
29
+ inputSchema?: unknown;
30
+ execute?: Function;
31
+ [key: string]: unknown;
32
+ }
33
+ /**
34
+ * Wraps a tool's execute function to catch ModelRetry errors and
35
+ * return corrective instructions to the model instead of failing.
36
+ *
37
+ * After maxRetries consecutive ModelRetry errors, the last error
38
+ * message is returned as a final failure.
39
+ *
40
+ * @param tool - An AI SDK tool definition
41
+ * @param maxRetries - Maximum retries per invocation (default: 3)
42
+ * @returns A new tool with retry-aware execution
43
+ */
44
+ export declare function wrapToolWithRetry<T extends ToolLike>(toolDef: T, maxRetries?: number): T;
45
+ /**
46
+ * Wrap all tools in a tool set with retry handling.
47
+ *
48
+ * @param tools - Record of tool name to tool definition
49
+ * @param maxRetries - Maximum retries per tool per invocation
50
+ * @returns New tools record with retry-aware execution
51
+ */
52
+ export declare function wrapAllToolsWithRetry<T extends Record<string, ToolLike>>(tools: T, maxRetries?: number): T;
53
+ export {};
54
+ //# sourceMappingURL=model-retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-retry.d.ts","sourceRoot":"","sources":["../../src/tools/model-retry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH;;;;;;;;;;;;;GAaG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,SAAkB,IAAI,gBAAgB;gBAE1B,OAAO,EAAE,MAAM;CAG5B;AAQD,UAAU,QAAQ;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,QAAQ,EAClD,OAAO,EAAE,CAAC,EACV,UAAU,GAAE,MAA4B,GACvC,CAAC,CAkDH;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EACtE,KAAK,EAAE,CAAC,EACR,UAAU,GAAE,MAA4B,GACvC,CAAC,CAQH"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * @agntk/core - Model Retry
3
+ *
4
+ * Error class and tool wrapper for LLM-retryable tool errors.
5
+ * When a tool throws ModelRetry, the error message is fed back to
6
+ * the model as corrective instructions, allowing it to retry with
7
+ * better parameters.
8
+ */
9
+ import { createLogger } from '@agntk/logger';
10
+ const log = createLogger('@agntk/core:model-retry');
11
+ // ============================================================================
12
+ // ModelRetry Error
13
+ // ============================================================================
14
+ /**
15
+ * Throw this error from a tool execute function to instruct the LLM
16
+ * to retry with corrective guidance.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * execute: async ({ query }) => {
21
+ * if (query.length < 3) {
22
+ * throw new ModelRetry('Query too short. Provide at least 3 characters.');
23
+ * }
24
+ * // ...
25
+ * }
26
+ * ```
27
+ */
28
+ export class ModelRetry extends Error {
29
+ name = 'ModelRetry';
30
+ constructor(message) {
31
+ super(message);
32
+ }
33
+ }
34
+ // ============================================================================
35
+ // wrapToolWithRetry
36
+ // ============================================================================
37
+ const DEFAULT_MAX_RETRIES = 3;
38
+ /**
39
+ * Wraps a tool's execute function to catch ModelRetry errors and
40
+ * return corrective instructions to the model instead of failing.
41
+ *
42
+ * After maxRetries consecutive ModelRetry errors, the last error
43
+ * message is returned as a final failure.
44
+ *
45
+ * @param tool - An AI SDK tool definition
46
+ * @param maxRetries - Maximum retries per invocation (default: 3)
47
+ * @returns A new tool with retry-aware execution
48
+ */
49
+ export function wrapToolWithRetry(toolDef, maxRetries = DEFAULT_MAX_RETRIES) {
50
+ const originalExecute = toolDef.execute;
51
+ if (!originalExecute)
52
+ return toolDef;
53
+ let retryCount = 0;
54
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
+ const wrappedExecute = async (...args) => {
56
+ try {
57
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
58
+ const result = await originalExecute(...args);
59
+ retryCount = 0; // Reset on success
60
+ return result;
61
+ }
62
+ catch (err) {
63
+ if (err instanceof ModelRetry) {
64
+ retryCount++;
65
+ log.info('ModelRetry caught', {
66
+ message: err.message,
67
+ retryCount,
68
+ maxRetries,
69
+ });
70
+ if (retryCount > maxRetries) {
71
+ retryCount = 0;
72
+ return JSON.stringify({
73
+ success: false,
74
+ error: `Tool failed after ${String(maxRetries)} retries: ${err.message}`,
75
+ retryExhausted: true,
76
+ });
77
+ }
78
+ // Return corrective instructions to the model
79
+ return JSON.stringify({
80
+ success: false,
81
+ error: err.message,
82
+ retryable: true,
83
+ retriesRemaining: maxRetries - retryCount,
84
+ instruction: `Please retry with corrected parameters. ${err.message}`,
85
+ });
86
+ }
87
+ // Non-retryable errors pass through
88
+ throw err;
89
+ }
90
+ };
91
+ return {
92
+ ...toolDef,
93
+ execute: wrappedExecute,
94
+ };
95
+ }
96
+ /**
97
+ * Wrap all tools in a tool set with retry handling.
98
+ *
99
+ * @param tools - Record of tool name to tool definition
100
+ * @param maxRetries - Maximum retries per tool per invocation
101
+ * @returns New tools record with retry-aware execution
102
+ */
103
+ export function wrapAllToolsWithRetry(tools, maxRetries = DEFAULT_MAX_RETRIES) {
104
+ const wrapped = {};
105
+ for (const [name, toolDef] of Object.entries(tools)) {
106
+ wrapped[name] = wrapToolWithRetry(toolDef, maxRetries);
107
+ }
108
+ return wrapped;
109
+ }
110
+ //# sourceMappingURL=model-retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3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UAAU,GAAG,CAAC,CAAC;oBACf,OAAO,IAAI,CAAC,SAAS,CAAC;wBACpB,OAAO,EAAE,KAAK;wBACd,KAAK,EAAE,qBAAqB,MAAM,CAAC,UAAU,CAAC,aAAa,GAAG,CAAC,OAAO,EAAE;wBACxE,cAAc,EAAE,IAAI;qBACrB,CAAC,CAAC;gBACL,CAAC;gBAED,8CAA8C;gBAC9C,OAAO,IAAI,CAAC,SAAS,CAAC;oBACpB,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,GAAG,CAAC,OAAO;oBAClB,SAAS,EAAE,IAAI;oBACf,gBAAgB,EAAE,UAAU,GAAG,UAAU;oBACzC,WAAW,EAAE,2CAA2C,GAAG,CAAC,OAAO,EAAE;iBACtE,CAAC,CAAC;YACL,CAAC;YAED,oCAAoC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,GAAG,OAAO;QACV,OAAO,EAAE,cAAc;KACnB,CAAC;AACT,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAQ,EACR,aAAqB,mBAAmB;IAExC,MAAM,OAAO,GAA6B,EAAE,CAAC;IAE7C,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,OAAY,CAAC;AACtB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Plan tool constants
3
+ */
4
+ export declare const MAX_PLAN_STEPS = 100;
5
+ export declare const DELEGATION_THRESHOLD = 5;
6
+ export declare const PLAN_DESCRIPTION = "Create and track a task checklist. Actions: create (title + steps), decide (for large plans: delegate or proceed), update_status, add_step, add_note, view. For plans with 5+ steps, you MUST call decide before continuing. LIMIT: Max 100 steps.";
7
+ export declare const VALIDATION_DESCRIPTION = "Validate code after making changes. Checks TypeScript types, runs tests, and verifies quality.";
8
+ export declare const AVAILABLE_AGENTS: readonly [{
9
+ readonly role: "coder";
10
+ readonly specialization: "Production-quality code, reading codebases, testing, debugging, git operations";
11
+ }, {
12
+ readonly role: "researcher";
13
+ readonly specialization: "Web search, documentation retrieval, fact verification, synthesizing information";
14
+ }, {
15
+ readonly role: "analyst";
16
+ readonly specialization: "Data analysis, pattern recognition, statistical reasoning, presenting findings";
17
+ }];
18
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/plan/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,gBAAgB,uPAA2R,CAAC;AAEzT,eAAO,MAAM,sBAAsB,mGAAmG,CAAC;AAEvI,eAAO,MAAM,gBAAgB;;;;;;;;;EAInB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Plan tool constants
3
+ */
4
+ export const MAX_PLAN_STEPS = 100;
5
+ export const DELEGATION_THRESHOLD = 5;
6
+ export const PLAN_DESCRIPTION = `Create and track a task checklist. Actions: create (title + steps), decide (for large plans: delegate or proceed), update_status, add_step, add_note, view. For plans with ${DELEGATION_THRESHOLD}+ steps, you MUST call decide before continuing. LIMIT: Max ${MAX_PLAN_STEPS} steps.`;
7
+ export const VALIDATION_DESCRIPTION = 'Validate code after making changes. Checks TypeScript types, runs tests, and verifies quality.';
8
+ export const AVAILABLE_AGENTS = [
9
+ { role: 'coder', specialization: 'Production-quality code, reading codebases, testing, debugging, git operations' },
10
+ { role: 'researcher', specialization: 'Web search, documentation retrieval, fact verification, synthesizing information' },
11
+ { role: 'analyst', specialization: 'Data analysis, pattern recognition, statistical reasoning, presenting findings' },
12
+ ];
13
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/tools/plan/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,8KAA8K,oBAAoB,+DAA+D,cAAc,SAAS,CAAC;AAEzT,MAAM,CAAC,MAAM,sBAAsB,GAAG,gGAAgG,CAAC;AAEvI,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,gFAAgF,EAAE;IACnH,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,EAAE,kFAAkF,EAAE;IAC1H,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,gFAAgF,EAAE;CAC7G,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { createPlanTool, createValidationTool, } from './tools.js';
2
+ export { runTypeCheck, runTestCommand } from './utils.js';
3
+ export type { Plan, PlanStep, PlanToolConfig, ScopeAssessment, PendingDecision, PlanInput, ValidationInput, ValidationResult, } from './types.js';
4
+ export { MAX_PLAN_STEPS, DELEGATION_THRESHOLD, PLAN_DESCRIPTION, VALIDATION_DESCRIPTION, AVAILABLE_AGENTS, } from './constants.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/plan/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGvD,YAAY,EACV,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,eAAe,EACf,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ // Tool exports
2
+ export { createPlanTool, createValidationTool, } from './tools.js';
3
+ // Utility exports
4
+ export { runTypeCheck, runTestCommand } from './utils.js';
5
+ // Constant exports
6
+ export { MAX_PLAN_STEPS, DELEGATION_THRESHOLD, PLAN_DESCRIPTION, VALIDATION_DESCRIPTION, AVAILABLE_AGENTS, } from './constants.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/plan/index.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAEjB,kBAAkB;AAClB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAcvD,mBAAmB;AACnB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type PlanToolConfig } from './types.js';
2
+ export declare function createPlanTool(config?: PlanToolConfig): import("ai").Tool<{
3
+ action: "create" | "decide" | "update_status" | "add_note" | "add_step" | "view";
4
+ steps?: string[] | undefined;
5
+ title?: string | undefined;
6
+ status?: "pending" | "blocked" | "completed" | "in_progress" | undefined;
7
+ decision?: "delegate" | "proceed" | undefined;
8
+ stepName?: string | undefined;
9
+ note?: string | undefined;
10
+ }, string>;
11
+ export declare function createValidationTool(): import("ai").Tool<{
12
+ checkTypes?: boolean | undefined;
13
+ runTests?: boolean | undefined;
14
+ filesChanged?: string[] | undefined;
15
+ }, string>;
16
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/plan/tools.ts"],"names":[],"mappings":"AAWA,OAAO,EAIL,KAAK,cAAc,EAIpB,MAAM,SAAS,CAAC;AAiBjB,wBAAgB,cAAc,CAAC,MAAM,GAAE,cAAmB;;;;;;;;WAyLzD;AAED,wBAAgB,oBAAoB;;;;WA8BnC"}