@empiricalrun/test-gen 0.75.0 → 0.77.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 (254) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/agent/base/index.d.ts +32 -21
  3. package/dist/agent/base/index.d.ts.map +1 -1
  4. package/dist/agent/base/index.js +100 -57
  5. package/dist/agent/browsing/run.d.ts +1 -2
  6. package/dist/agent/browsing/run.d.ts.map +1 -1
  7. package/dist/agent/browsing/run.js +3 -9
  8. package/dist/agent/browsing/utils.d.ts +2 -9
  9. package/dist/agent/browsing/utils.d.ts.map +1 -1
  10. package/dist/agent/browsing/utils.js +5 -109
  11. package/dist/agent/chat/agent-loop.d.ts +8 -7
  12. package/dist/agent/chat/agent-loop.d.ts.map +1 -1
  13. package/dist/agent/chat/agent-loop.js +7 -18
  14. package/dist/agent/chat/exports.d.ts +9 -6
  15. package/dist/agent/chat/exports.d.ts.map +1 -1
  16. package/dist/agent/chat/exports.js +11 -13
  17. package/dist/agent/chat/index.d.ts +6 -10
  18. package/dist/agent/chat/index.d.ts.map +1 -1
  19. package/dist/agent/chat/index.js +117 -196
  20. package/dist/agent/chat/models.d.ts +0 -2
  21. package/dist/agent/chat/models.d.ts.map +1 -1
  22. package/dist/agent/chat/models.js +12 -26
  23. package/dist/agent/chat/prompt/pw-utils-docs.d.ts +1 -1
  24. package/dist/agent/chat/prompt/pw-utils-docs.d.ts.map +1 -1
  25. package/dist/agent/chat/prompt/pw-utils-docs.js +52 -0
  26. package/dist/agent/chat/prompt/repo.d.ts.map +1 -1
  27. package/dist/agent/chat/prompt/repo.js +11 -22
  28. package/dist/agent/chat/prompt/test-case-def.d.ts +2 -0
  29. package/dist/agent/chat/prompt/test-case-def.d.ts.map +1 -0
  30. package/dist/agent/chat/prompt/test-case-def.js +44 -0
  31. package/dist/agent/chat/state.d.ts +8 -8
  32. package/dist/agent/chat/state.d.ts.map +1 -1
  33. package/dist/agent/chat/state.js +17 -47
  34. package/dist/agent/chat/utils.d.ts +4 -5
  35. package/dist/agent/chat/utils.d.ts.map +1 -1
  36. package/dist/agent/chat/utils.js +15 -9
  37. package/dist/agent/cli.d.ts +11 -0
  38. package/dist/agent/cli.d.ts.map +1 -0
  39. package/dist/agent/cli.js +213 -0
  40. package/dist/agent/code-review/executor/index.d.ts +5 -0
  41. package/dist/agent/code-review/executor/index.d.ts.map +1 -0
  42. package/dist/agent/code-review/executor/index.js +13 -0
  43. package/dist/agent/code-review/index.d.ts +12 -0
  44. package/dist/agent/code-review/index.d.ts.map +1 -0
  45. package/dist/agent/code-review/index.js +159 -0
  46. package/dist/agent/code-review/parser.d.ts +5 -0
  47. package/dist/agent/code-review/parser.d.ts.map +1 -0
  48. package/dist/agent/code-review/parser.js +70 -0
  49. package/dist/agent/code-review/types.d.ts +36 -0
  50. package/dist/agent/code-review/types.d.ts.map +1 -0
  51. package/dist/agent/code-review/types.js +13 -0
  52. package/dist/agent/cua/index.d.ts.map +1 -1
  53. package/dist/agent/cua/index.js +18 -2
  54. package/dist/agent/cua/model.d.ts.map +1 -1
  55. package/dist/agent/cua/model.js +4 -1
  56. package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts.map +1 -1
  57. package/dist/agent/index.d.ts +10 -0
  58. package/dist/agent/index.d.ts.map +1 -0
  59. package/dist/agent/index.js +19 -0
  60. package/dist/agent/triage/index.d.ts +7 -0
  61. package/dist/agent/triage/index.d.ts.map +1 -0
  62. package/dist/agent/triage/index.js +103 -0
  63. package/dist/agent/video-analysis/executor/index.d.ts +5 -0
  64. package/dist/agent/video-analysis/executor/index.d.ts.map +1 -0
  65. package/dist/agent/video-analysis/executor/index.js +10 -0
  66. package/dist/agent/video-analysis/index.d.ts +7 -0
  67. package/dist/agent/video-analysis/index.d.ts.map +1 -0
  68. package/dist/agent/video-analysis/index.js +60 -0
  69. package/dist/artifacts/index.d.ts +1 -1
  70. package/dist/artifacts/index.d.ts.map +1 -1
  71. package/dist/artifacts/index.js +3 -1
  72. package/dist/artifacts/utils.d.ts.map +1 -1
  73. package/dist/bin/index.js +68 -23
  74. package/dist/constants/index.d.ts +14 -0
  75. package/dist/constants/index.d.ts.map +1 -1
  76. package/dist/constants/index.js +33 -1
  77. package/dist/file/server.d.ts +1 -3
  78. package/dist/file/server.d.ts.map +1 -1
  79. package/dist/file/server.js +0 -13
  80. package/dist/file-info/adapters/file-system/index.d.ts.map +1 -1
  81. package/dist/file-info/adapters/file-system/reader.d.ts.map +1 -1
  82. package/dist/file-info/adapters/file-system/reader.js +8 -1
  83. package/dist/file-info/adapters/github/index.d.ts.map +1 -1
  84. package/dist/file-info/adapters/github/index.js +1 -2
  85. package/dist/file-info/adapters/github/reader.d.ts +4 -9
  86. package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
  87. package/dist/file-info/adapters/github/reader.js +166 -134
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/tools/analyse-video/index.d.ts +5 -0
  90. package/dist/tools/analyse-video/index.d.ts.map +1 -0
  91. package/dist/tools/analyse-video/index.js +50 -0
  92. package/dist/tools/create-pull-request/index.d.ts.map +1 -0
  93. package/dist/tools/{definitions/commit-and-create-pr.js → create-pull-request/index.js} +28 -1
  94. package/dist/tools/create-pull-request/utils.d.ts +21 -0
  95. package/dist/tools/create-pull-request/utils.d.ts.map +1 -0
  96. package/dist/tools/create-pull-request/utils.js +83 -0
  97. package/dist/tools/definitions/{fetch-video-analysis.d.ts → analyse-video.d.ts} +17 -12
  98. package/dist/tools/definitions/analyse-video.d.ts.map +1 -0
  99. package/dist/tools/definitions/analyse-video.js +60 -0
  100. package/dist/tools/definitions/review-pull-request.d.ts +3 -0
  101. package/dist/tools/definitions/review-pull-request.d.ts.map +1 -0
  102. package/dist/tools/definitions/review-pull-request.js +16 -0
  103. package/dist/tools/definitions/str_replace_editor.d.ts +1 -0
  104. package/dist/tools/definitions/str_replace_editor.d.ts.map +1 -1
  105. package/dist/tools/definitions/str_replace_editor.js +4 -1
  106. package/dist/tools/definitions/test-gen-browser.d.ts +0 -3
  107. package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
  108. package/dist/tools/definitions/test-gen-browser.js +33 -8
  109. package/dist/tools/delete-file/index.d.ts.map +1 -1
  110. package/dist/tools/delete-file/index.js +1 -19
  111. package/dist/tools/executor/base.d.ts +32 -0
  112. package/dist/tools/executor/base.d.ts.map +1 -0
  113. package/dist/tools/executor/base.js +114 -0
  114. package/dist/tools/executor/index.d.ts +3 -22
  115. package/dist/tools/executor/index.d.ts.map +1 -1
  116. package/dist/tools/executor/index.js +13 -92
  117. package/dist/tools/executor/utils/checkpoint.d.ts +1 -1
  118. package/dist/tools/executor/utils/checkpoint.d.ts.map +1 -1
  119. package/dist/tools/executor/utils/checkpoint.js +6 -2
  120. package/dist/tools/executor/utils/git.d.ts +2 -2
  121. package/dist/tools/executor/utils/git.d.ts.map +1 -1
  122. package/dist/tools/executor/utils/git.js +7 -3
  123. package/dist/tools/executor/utils/index.d.ts.map +1 -1
  124. package/dist/tools/executor/utils/index.js +1 -1
  125. package/dist/tools/fetch-session-diff/index.d.ts +3 -0
  126. package/dist/tools/fetch-session-diff/index.d.ts.map +1 -0
  127. package/dist/tools/fetch-session-diff/index.js +46 -0
  128. package/dist/tools/file-operations/create.d.ts.map +1 -1
  129. package/dist/tools/file-operations/create.js +1 -4
  130. package/dist/tools/file-operations/index.d.ts +2 -1
  131. package/dist/tools/file-operations/index.d.ts.map +1 -1
  132. package/dist/tools/file-operations/index.js +4 -1
  133. package/dist/tools/file-operations/insert.d.ts +1 -2
  134. package/dist/tools/file-operations/insert.d.ts.map +1 -1
  135. package/dist/tools/file-operations/insert.js +1 -4
  136. package/dist/tools/file-operations/replace.d.ts.map +1 -1
  137. package/dist/tools/file-operations/replace.js +1 -4
  138. package/dist/tools/grep/index.d.ts.map +1 -1
  139. package/dist/tools/grep/index.js +18 -11
  140. package/dist/tools/index.d.ts +28 -2
  141. package/dist/tools/index.d.ts.map +1 -1
  142. package/dist/tools/index.js +52 -33
  143. package/dist/tools/merge-conflicts/index.d.ts.map +1 -1
  144. package/dist/tools/merge-conflicts/index.js +1 -1
  145. package/dist/tools/rename-file/index.js +1 -1
  146. package/dist/tools/review-pull-request/index.d.ts +3 -0
  147. package/dist/tools/review-pull-request/index.d.ts.map +1 -0
  148. package/dist/tools/review-pull-request/index.js +89 -0
  149. package/dist/tools/run-test.d.ts.map +1 -1
  150. package/dist/tools/run-test.js +25 -3
  151. package/dist/tools/test-gen-browser.d.ts.map +1 -1
  152. package/dist/tools/test-gen-browser.js +51 -47
  153. package/dist/tools/test-run-fetcher/index.d.ts.map +1 -1
  154. package/dist/tools/test-run-fetcher/index.js +4 -14
  155. package/dist/tools/utils/urls.d.ts +5 -0
  156. package/dist/tools/utils/urls.d.ts.map +1 -0
  157. package/dist/tools/utils/urls.js +19 -0
  158. package/dist/tools/view-failed-test-run-report/index.d.ts.map +1 -1
  159. package/dist/tools/view-failed-test-run-report/index.js +3 -15
  160. package/dist/utils/artifact-paths.d.ts +20 -0
  161. package/dist/utils/artifact-paths.d.ts.map +1 -0
  162. package/dist/utils/artifact-paths.js +16 -0
  163. package/dist/utils/dedup-image-fs.d.ts +2 -16
  164. package/dist/utils/dedup-image-fs.d.ts.map +1 -1
  165. package/dist/utils/dedup-image-fs.js +12 -16
  166. package/dist/utils/dedup-image.d.ts +1 -14
  167. package/dist/utils/dedup-image.d.ts.map +1 -1
  168. package/dist/utils/dedup-image.js +7 -62
  169. package/dist/{tools/fetch-video-analysis/local-ffmpeg-client.d.ts → utils/ffmpeg/index.d.ts} +9 -6
  170. package/dist/utils/ffmpeg/index.d.ts.map +1 -0
  171. package/dist/utils/ffmpeg/index.js +415 -0
  172. package/dist/utils/file.d.ts +1 -0
  173. package/dist/utils/file.d.ts.map +1 -1
  174. package/dist/utils/file.js +45 -1
  175. package/dist/utils/find-threshold.d.ts +8 -0
  176. package/dist/utils/find-threshold.d.ts.map +1 -0
  177. package/dist/utils/find-threshold.js +55 -0
  178. package/dist/utils/hash.d.ts +2 -0
  179. package/dist/utils/hash.d.ts.map +1 -0
  180. package/dist/utils/hash.js +24 -0
  181. package/dist/utils/model.d.ts +1 -1
  182. package/dist/utils/model.d.ts.map +1 -1
  183. package/dist/utils/model.js +7 -5
  184. package/dist/utils/repo-tree.d.ts +0 -1
  185. package/dist/utils/repo-tree.d.ts.map +1 -1
  186. package/dist/utils/repo-tree.js +2 -14
  187. package/dist/utils/slug.js +1 -1
  188. package/dist/video-core/agent-orchestrator.d.ts +14 -0
  189. package/dist/video-core/agent-orchestrator.d.ts.map +1 -0
  190. package/dist/video-core/agent-orchestrator.js +78 -0
  191. package/dist/video-core/analysis-server.d.ts +24 -0
  192. package/dist/video-core/analysis-server.d.ts.map +1 -0
  193. package/dist/video-core/analysis-server.js +398 -0
  194. package/dist/video-core/analysis-viewer.html +1374 -0
  195. package/dist/video-core/index.d.ts +44 -0
  196. package/dist/video-core/index.d.ts.map +1 -0
  197. package/dist/video-core/index.js +204 -0
  198. package/dist/video-core/model-limits.d.ts +4 -0
  199. package/dist/video-core/model-limits.d.ts.map +1 -0
  200. package/dist/video-core/model-limits.js +67 -0
  201. package/dist/video-core/storage-manager.d.ts +5 -0
  202. package/dist/video-core/storage-manager.d.ts.map +1 -0
  203. package/dist/video-core/storage-manager.js +55 -0
  204. package/dist/video-core/types.d.ts +13 -0
  205. package/dist/video-core/types.d.ts.map +1 -0
  206. package/dist/video-core/types.js +2 -0
  207. package/dist/video-core/utils.d.ts +25 -0
  208. package/dist/video-core/utils.d.ts.map +1 -0
  209. package/dist/video-core/utils.js +211 -0
  210. package/dist/video-core/xml-parser.d.ts +3 -0
  211. package/dist/video-core/xml-parser.d.ts.map +1 -0
  212. package/dist/video-core/xml-parser.js +27 -0
  213. package/package.json +5 -6
  214. package/tsconfig.tsbuildinfo +1 -1
  215. package/dist/agent/chat/prompt/index.d.ts +0 -5
  216. package/dist/agent/chat/prompt/index.d.ts.map +0 -1
  217. package/dist/agent/chat/prompt/index.js +0 -189
  218. package/dist/agent/chat/utils/tool-calls.d.ts +0 -21
  219. package/dist/agent/chat/utils/tool-calls.d.ts.map +0 -1
  220. package/dist/agent/chat/utils/tool-calls.js +0 -64
  221. package/dist/agent/code-review/prompt.d.ts +0 -2
  222. package/dist/agent/code-review/prompt.d.ts.map +0 -1
  223. package/dist/agent/code-review/prompt.js +0 -19
  224. package/dist/agent/diagnosis-agent/index.d.ts +0 -11
  225. package/dist/agent/diagnosis-agent/index.d.ts.map +0 -1
  226. package/dist/agent/diagnosis-agent/index.js +0 -88
  227. package/dist/agent/diagnosis-agent/strict-mode-violation.d.ts +0 -10
  228. package/dist/agent/diagnosis-agent/strict-mode-violation.d.ts.map +0 -1
  229. package/dist/agent/diagnosis-agent/strict-mode-violation.js +0 -30
  230. package/dist/tools/commit-and-create-pr/index.d.ts.map +0 -1
  231. package/dist/tools/commit-and-create-pr/index.js +0 -83
  232. package/dist/tools/definitions/commit-and-create-pr.d.ts +0 -3
  233. package/dist/tools/definitions/commit-and-create-pr.d.ts.map +0 -1
  234. package/dist/tools/definitions/fetch-video-analysis.d.ts.map +0 -1
  235. package/dist/tools/definitions/fetch-video-analysis.js +0 -61
  236. package/dist/tools/fetch-video-analysis/index.d.ts +0 -5
  237. package/dist/tools/fetch-video-analysis/index.d.ts.map +0 -1
  238. package/dist/tools/fetch-video-analysis/index.js +0 -138
  239. package/dist/tools/fetch-video-analysis/local-ffmpeg-client.d.ts.map +0 -1
  240. package/dist/tools/fetch-video-analysis/local-ffmpeg-client.js +0 -247
  241. package/dist/tools/fetch-video-analysis/open-ai.d.ts +0 -6
  242. package/dist/tools/fetch-video-analysis/open-ai.d.ts.map +0 -1
  243. package/dist/tools/fetch-video-analysis/open-ai.js +0 -37
  244. package/dist/tools/fetch-video-analysis/utils.d.ts +0 -13
  245. package/dist/tools/fetch-video-analysis/utils.d.ts.map +0 -1
  246. package/dist/tools/fetch-video-analysis/utils.js +0 -98
  247. package/dist/tools/fetch-video-analysis/video-analysis.d.ts +0 -7
  248. package/dist/tools/fetch-video-analysis/video-analysis.d.ts.map +0 -1
  249. package/dist/tools/fetch-video-analysis/video-analysis.js +0 -54
  250. package/dist/tools/file-operations/shared/git-helper.d.ts +0 -4
  251. package/dist/tools/file-operations/shared/git-helper.d.ts.map +0 -1
  252. package/dist/tools/file-operations/shared/git-helper.js +0 -29
  253. package/eslint.config.mjs +0 -43
  254. /package/dist/tools/{commit-and-create-pr → create-pull-request}/index.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../../src/tools/executor/utils/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAMjE,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAMhE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAMtE;AAED,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAaR;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAe1E;AAED,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAMnE;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,WAcjE;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,mBAO1D;AAED,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAE/D;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,aAAa,EACb,KAAK,EACL,QAAQ,GACT,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,EAAE,CAAC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AC,QAAQ,EAAE,MAAM,mBAO1D;AAED,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAE/D;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,aAAa,EACb,KAAK,EACL,QAAQ,GACT,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,GAAG,IAAI,CAGhB;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,EAAE,CA6CxD;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAUrD;AAED,wBAAsB,gBAAgB,CAAC,EACrC,QAAQ,EACR,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,mBAAmB,CAAC;CAChC,oBA8BA"}
@@ -74,11 +74,15 @@ function commitAsBotUser(commitMessage, cwd) {
74
74
  cwd,
75
75
  });
76
76
  if (!status) {
77
- return false;
77
+ return null;
78
78
  }
79
79
  const commitMessageWithSkipCi = `${commitMessage} [skip ci]`;
80
80
  (0, child_process_1.execSync)(`git -c user.name="${GIT_USER_NAME}" -c user.email="${GIT_USER_EMAIL}" commit -m "${commitMessageWithSkipCi}"`, { cwd });
81
- return true;
81
+ const commitSha = (0, child_process_1.execSync)("git rev-parse HEAD", {
82
+ encoding: "utf-8",
83
+ cwd,
84
+ }).trim();
85
+ return commitSha;
82
86
  }
83
87
  async function getCurrentBranchName(repoPath) {
84
88
  const branchName = (0, child_process_1.execSync)("git branch --show-current", {
@@ -93,7 +97,7 @@ async function pullBranch(branchName, cwd) {
93
97
  }
94
98
  function stageAndCommitFilesAsBotUser({ commitMessage, files, repoPath, }) {
95
99
  (0, child_process_1.execSync)(`git add ${files.join(" ")}`, { cwd: repoPath });
96
- commitAsBotUser(commitMessage, repoPath);
100
+ return commitAsBotUser(commitMessage, repoPath);
97
101
  }
98
102
  function getStagedFiles(cwd) {
99
103
  const output = (0, child_process_1.execSync)("git diff --cached --name-status", {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/executor/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAiB1D;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IAC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J,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,mBAAmB,CAAC;CAChC,GAAG,OAAO,CAAC,eAAe,CAAC,CAoB3B;AAED,wBAAsB,iBAAiB,CAAC,EACtC,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,mBAAmB,CAAC;CAChC,GAAG,OAAO,CAAC,eAAe,CAAC,CAS3B;AAED,wBAAsB,uBAAuB,CAAC,EAC5C,KAAK,EACL,IAAI,EACJ,UAAU,EACV,KAAK,EACL,IAAI,EACJ,MAAM,EACN,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,mBAAmB,CAAC;CAChC,GAAG,OAAO,CAAC;IAAE,EAAE,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAoBnD"}
@@ -70,7 +70,7 @@ function getMergeableStateDescription(state) {
70
70
  return `The pull request has mergeable state: ${state}.`;
71
71
  }
72
72
  }
73
- async function createPullRequest({ owner, repo, title, head, base = "main", body, labels, apiClient, }) {
73
+ async function createPullRequest({ owner, repo, title, head, base, body, labels, apiClient, }) {
74
74
  const createPrBody = {
75
75
  title,
76
76
  head,
@@ -0,0 +1,3 @@
1
+ import { Tool } from "@empiricalrun/shared-types";
2
+ export declare const fetchSessionDiffTool: Tool;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/fetch-session-diff/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,4BAA4B,CAAC;AAO9D,eAAO,MAAM,oBAAoB,EAAE,IA0ClC,CAAC"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchSessionDiffTool = void 0;
4
+ const zod_1 = require("zod");
5
+ const SessionDiffInputSchema = zod_1.z.object({
6
+ url: zod_1.z.string().describe(`The URL of the chat session.`),
7
+ });
8
+ exports.fetchSessionDiffTool = {
9
+ schema: {
10
+ name: "fetchSessionDiff",
11
+ description: `Extracts the session url and returns the code diff for the session along with pull request title and description, if available.`,
12
+ parameters: SessionDiffInputSchema,
13
+ },
14
+ needsBrowser: false,
15
+ isInlineTool: true,
16
+ execute: async ({ input, apiClient }) => {
17
+ try {
18
+ const sessionUrl = input.url;
19
+ if (!sessionUrl) {
20
+ return {
21
+ isError: true,
22
+ result: "No session URL provided",
23
+ };
24
+ }
25
+ if (!apiClient) {
26
+ throw new Error("Dashboard API client is not available.");
27
+ }
28
+ const sessionId = sessionUrl.split("/").pop();
29
+ const sessionDiffApiUrl = `/api/chat-sessions/${sessionId}/diff?is_line_annotated=true`;
30
+ const sessionDiff = await apiClient.request(sessionDiffApiUrl, {
31
+ method: "GET",
32
+ });
33
+ return {
34
+ isError: false,
35
+ result: JSON.stringify(sessionDiff, null, 2),
36
+ };
37
+ }
38
+ catch (error) {
39
+ console.error("Error fetching session diff", error);
40
+ return {
41
+ isError: true,
42
+ result: error instanceof Error ? error.message : String(error),
43
+ };
44
+ }
45
+ },
46
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/tools/file-operations/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAO1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,iBAAe,kBAAkB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,GAAG,OAAO,CAAC,UAAU,CAAC,CA0DtB;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/tools/file-operations/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAO1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,iBAAe,kBAAkB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,GAAG,OAAO,CAAC,UAAU,CAAC,CAuDtB;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -8,7 +8,6 @@ const child_process_1 = require("child_process");
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const path_1 = __importDefault(require("path"));
10
10
  const web_1 = require("../../bin/utils/platform/web");
11
- const git_helper_1 = require("./shared/git-helper");
12
11
  async function fileCreateExecutor({ input, filePath, absoluteFilePath, repoDir, collectArtifacts, }) {
13
12
  if (input.file_text === undefined || input.file_text === null) {
14
13
  return {
@@ -45,13 +44,11 @@ the required directories recursively for the new file.`,
45
44
  fs_1.default.writeFileSync(absoluteFilePath, input.file_text);
46
45
  // Stage the file
47
46
  (0, child_process_1.execSync)(`git add "${filePath}"`, { cwd: repoDir });
48
- // Collect git patch artifact
49
- await (0, git_helper_1.collectGitPatchArtifact)(filePath, repoDir, "create", collectArtifacts);
50
47
  let tscResult = await (0, web_1.runTypescriptCompiler)(repoDir);
51
48
  if (!tscResult.success) {
52
49
  return {
53
50
  result: `File ${filePath} has been created. However, type checks are failing with errors:\n\n${tscResult.errors.join("\n")}`,
54
- isError: true,
51
+ isError: false,
55
52
  };
56
53
  }
57
54
  else {
@@ -11,5 +11,6 @@ declare function strReplaceEditorExecutor({ input, repoPath, collectArtifacts, a
11
11
  apiClient?: IDashboardAPIClient;
12
12
  }): Promise<ToolResult>;
13
13
  declare const textEditorTools: Tool[];
14
- export { strReplaceEditorExecutor, textEditorTools };
14
+ declare const viewOnlyTools: Tool[];
15
+ export { strReplaceEditorExecutor, textEditorTools, viewOnlyTools };
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/file-operations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,IAAI,EAEJ,UAAU,EACX,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD;;;GAGG;AACH,iBAAe,wBAAwB,CAAC,EACtC,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,SAAS,GACV,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC,GAAG,OAAO,CAAC,UAAU,CAAC,CAoDtB;AA+ED,QAAA,MAAM,eAAe,EAAE,IAAI,EAK1B,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/file-operations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,IAAI,EAEJ,UAAU,EACX,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD;;;GAGG;AACH,iBAAe,wBAAwB,CAAC,EACtC,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,SAAS,GACV,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC,GAAG,OAAO,CAAC,UAAU,CAAC,CAoDtB;AAgFD,QAAA,MAAM,eAAe,EAAE,IAAI,EAK1B,CAAC;AAEF,QAAA,MAAM,aAAa,EAAE,IAAI,EAAmB,CAAC;AAE7C,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.textEditorTools = void 0;
6
+ exports.viewOnlyTools = exports.textEditorTools = void 0;
7
7
  exports.strReplaceEditorExecutor = strReplaceEditorExecutor;
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const str_replace_editor_1 = require("../definitions/str_replace_editor");
@@ -127,6 +127,7 @@ const stringInsertTool = {
127
127
  command: "insert",
128
128
  path: input.path,
129
129
  insert_line: input.insert_line,
130
+ insert_text: input.insert_text,
130
131
  new_str: input.new_str,
131
132
  },
132
133
  repoPath,
@@ -141,3 +142,5 @@ const textEditorTools = [
141
142
  stringInsertTool,
142
143
  ];
143
144
  exports.textEditorTools = textEditorTools;
145
+ const viewOnlyTools = [fileViewTool];
146
+ exports.viewOnlyTools = viewOnlyTools;
@@ -1,11 +1,10 @@
1
1
  import { CollectArtifacts, ToolResult } from "@empiricalrun/shared-types";
2
2
  import { StrReplaceInputParams } from "./shared/helpers";
3
- declare function fileInsertExecutor({ input, filePath, absoluteFilePath, repoDir, collectArtifacts, }: {
3
+ export declare function fileInsertExecutor({ input, filePath, absoluteFilePath, repoDir, collectArtifacts, }: {
4
4
  input: StrReplaceInputParams;
5
5
  filePath: string;
6
6
  absoluteFilePath: string;
7
7
  repoDir: string;
8
8
  collectArtifacts?: CollectArtifacts;
9
9
  }): Promise<ToolResult>;
10
- export { fileInsertExecutor };
11
10
  //# sourceMappingURL=insert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../../src/tools/file-operations/insert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAM1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,iBAAe,kBAAkB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,GAAG,OAAO,CAAC,UAAU,CAAC,CAwDtB;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../../src/tools/file-operations/insert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAM1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,wBAAsB,kBAAkB,CAAC,EACvC,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,GAAG,OAAO,CAAC,UAAU,CAAC,CAqDtB"}
@@ -7,7 +7,6 @@ exports.fileInsertExecutor = fileInsertExecutor;
7
7
  const child_process_1 = require("child_process");
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const web_1 = require("../../bin/utils/platform/web");
10
- const git_helper_1 = require("./shared/git-helper");
11
10
  async function fileInsertExecutor({ input, filePath, absoluteFilePath, repoDir, collectArtifacts, }) {
12
11
  if (!fs_1.default.existsSync(absoluteFilePath)) {
13
12
  return {
@@ -46,13 +45,11 @@ async function fileInsertExecutor({ input, filePath, absoluteFilePath, repoDir,
46
45
  fs_1.default.writeFileSync(absoluteFilePath, lines.join("\n"));
47
46
  // Stage the file
48
47
  (0, child_process_1.execSync)(`git add "${filePath}"`, { cwd: repoDir });
49
- // Collect git patch artifact
50
- await (0, git_helper_1.collectGitPatchArtifact)(filePath, repoDir, "insert", collectArtifacts);
51
48
  let tscResult = await (0, web_1.runTypescriptCompiler)(repoDir);
52
49
  if (!tscResult.success) {
53
50
  return {
54
51
  result: `Insertion in file ${filePath} was applied. However, type checks are failing with errors:\n${tscResult.errors.join("\n")}`,
55
- isError: true,
52
+ isError: false,
56
53
  };
57
54
  }
58
55
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"replace.d.ts","sourceRoot":"","sources":["../../../src/tools/file-operations/replace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAM1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAG9D,iBAAe,sBAAsB,CAAC,EACpC,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,GAAG,OAAO,CAAC,UAAU,CAAC,CAoFtB;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
1
+ {"version":3,"file":"replace.d.ts","sourceRoot":"","sources":["../../../src/tools/file-operations/replace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAM1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAG9D,iBAAe,sBAAsB,CAAC,EACpC,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,GAAG,OAAO,CAAC,UAAU,CAAC,CA4EtB;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
@@ -7,7 +7,6 @@ exports.fileStrReplaceExecutor = fileStrReplaceExecutor;
7
7
  const child_process_1 = require("child_process");
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const web_1 = require("../../bin/utils/platform/web");
10
- const git_helper_1 = require("./shared/git-helper");
11
10
  const helpers_1 = require("./shared/helpers");
12
11
  async function fileStrReplaceExecutor({ input, filePath, absoluteFilePath, repoDir, collectArtifacts, }) {
13
12
  if (!fs_1.default.existsSync(absoluteFilePath)) {
@@ -64,13 +63,11 @@ async function fileStrReplaceExecutor({ input, filePath, absoluteFilePath, repoD
64
63
  fs_1.default.writeFileSync(absoluteFilePath, newContent);
65
64
  // Stage the file
66
65
  (0, child_process_1.execSync)(`git add "${filePath}"`, { cwd: repoDir });
67
- // Collect git patch artifact
68
- await (0, git_helper_1.collectGitPatchArtifact)(filePath, repoDir, "replace", collectArtifacts);
69
66
  let tscResult = await (0, web_1.runTypescriptCompiler)(repoDir);
70
67
  if (!tscResult.success) {
71
68
  return {
72
69
  result: `Edits to file ${filePath} have been applied. However, type checks are failing with errors:\n\n${tscResult.errors.join("\n")}`,
73
- isError: true,
70
+ isError: false,
74
71
  };
75
72
  }
76
73
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/grep/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,4BAA4B,CAAC;AA+HnE,eAAO,MAAM,QAAQ,EAAE,IAUtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/grep/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,IAAI,EAAc,MAAM,4BAA4B,CAAC;AAkI3E,eAAO,MAAM,QAAQ,EAAE,IActB,CAAC"}
@@ -8,7 +8,7 @@ const child_process_1 = require("child_process");
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const util_1 = require("util");
10
10
  const zod_1 = require("zod");
11
- const repo_tree_1 = require("../../utils/repo-tree");
11
+ const constants_1 = require("../../constants");
12
12
  const grep_1 = require("../definitions/grep");
13
13
  const ripgrep_1 = require("./ripgrep");
14
14
  const GrepInputSchema = zod_1.z.object({
@@ -24,18 +24,18 @@ const GrepInputSchema = zod_1.z.object({
24
24
  .optional()
25
25
  .describe("File pattern to search in (e.g., '*.ts' for TypeScript files)"),
26
26
  });
27
- async function usingSystemGrep(input, repoPath) {
27
+ async function usingSystemGrep(input, repoPath, logger) {
28
28
  try {
29
29
  const dir = path_1.default.join(repoPath, input.directory || "");
30
30
  // Create exclude pattern for grep
31
- const excludePatterns = repo_tree_1.DEFAULT_EXCLUDE.map((pattern) => typeof pattern === "string" ? pattern : pattern.source)
31
+ const excludePatterns = constants_1.DEFAULT_EXCLUDE.map((pattern) => typeof pattern === "string" ? pattern : pattern.source)
32
32
  .map((pattern) => `--exclude-dir="${pattern}"`)
33
33
  .join(" ");
34
34
  // Using -n to show line numbers in output
35
35
  let cmd = `grep -rin ${excludePatterns} "${input.pattern}" ${dir}`;
36
36
  if (input.filePattern) {
37
37
  // For file pattern searches, we'll use find with exclusions
38
- const excludeFind = repo_tree_1.DEFAULT_EXCLUDE.map((pattern) => typeof pattern === "string" ? pattern : pattern.source)
38
+ const excludeFind = constants_1.DEFAULT_EXCLUDE.map((pattern) => typeof pattern === "string" ? pattern : pattern.source)
39
39
  .map((pattern) => `-not -path "*/${pattern}/*"`)
40
40
  .join(" ");
41
41
  // Modified command to ensure filepath is included in the output
@@ -65,14 +65,15 @@ async function usingSystemGrep(input, repoPath) {
65
65
  }
66
66
  }
67
67
  catch (error) {
68
- console.error("Error executing grep", error);
68
+ logger?.error("Error executing grep", error) ||
69
+ console.error("Error executing grep", error);
69
70
  return {
70
71
  isError: true,
71
72
  result: error instanceof Error ? error.message : String(error),
72
73
  };
73
74
  }
74
75
  }
75
- async function usingRipgrep(input, repoPath) {
76
+ async function usingRipgrep(input, repoPath, logger) {
76
77
  try {
77
78
  const dir = path_1.default.join(repoPath, input.directory || "");
78
79
  const escapedPattern = input.pattern
@@ -109,7 +110,8 @@ All paths are relative to the current working directory.`;
109
110
  };
110
111
  }
111
112
  catch (error) {
112
- console.error("Error executing ripgrep", error);
113
+ logger?.error("Error executing ripgrep", error) ||
114
+ console.error("Error executing ripgrep", error);
113
115
  return {
114
116
  isError: true,
115
117
  result: error instanceof ripgrep_1.RipGrepError ? error.message : String(error),
@@ -118,13 +120,18 @@ All paths are relative to the current working directory.`;
118
120
  }
119
121
  exports.grepTool = {
120
122
  ...grep_1.grepTool,
121
- execute: async ({ input, repoPath }) => {
123
+ execute: async ({ input, repoPath, logger }) => {
122
124
  if ((0, ripgrep_1.isRgAvailable)()) {
123
- return usingRipgrep(input, repoPath);
125
+ return usingRipgrep(input, repoPath, logger);
124
126
  }
125
127
  else {
126
- console.warn("ripgrep is not available, falling back to system grep.");
127
- return usingSystemGrep(input, repoPath);
128
+ if (logger) {
129
+ logger.warn("ripgrep is not available, falling back to system grep.");
130
+ }
131
+ else {
132
+ console.warn("ripgrep is not available, falling back to system grep.");
133
+ }
134
+ return usingSystemGrep(input, repoPath, logger);
128
135
  }
129
136
  },
130
137
  };
@@ -1,9 +1,35 @@
1
1
  import { PendingToolCall, ServicePayload, SupportedChatModels, Tool, ToolDefinition } from "@empiricalrun/shared-types";
2
+ import { createPullRequestTool } from "./create-pull-request";
3
+ import { analyseVideo } from "./definitions/analyse-video";
4
+ import { deleteFileTool } from "./definitions/delete-file";
5
+ import { downloadBuildTool } from "./definitions/download-build";
6
+ import { grepTool } from "./definitions/grep";
7
+ import { mergeConflictsTool } from "./definitions/merge-conflicts";
8
+ import { renameFileTool } from "./definitions/rename-file";
9
+ import { reviewPullRequestTool } from "./definitions/review-pull-request";
10
+ import { runTestTool } from "./definitions/run-test";
11
+ import { generateTestWithBrowserAgent } from "./definitions/test-gen-browser";
12
+ import { upgradePackagesTool } from "./definitions/upgrade-packages";
13
+ import { fetchDiagnosisReportTool } from "./diagnosis-fetcher";
14
+ import { fetchFileTool } from "./fetch-file";
15
+ import { fetchLastSuccessfulTestRunTool } from "./fetch-last-successful-test-run";
16
+ import { fetchSessionDiffTool } from "./fetch-session-diff";
17
+ import { createIssueTool, listIssuesTool, updateIssueTool } from "./issues";
18
+ import { listEnvironmentsTool } from "./list-environments";
19
+ import { fetchTestRunReportTool } from "./test-run-fetcher";
20
+ import { traceDotZipTool } from "./trace-dot-zip";
21
+ import { sendTriageSummaryTool } from "./triage-summary";
22
+ import { viewFailedTestRunReportTool } from "./view-failed-test-run-report";
2
23
  type ToolOrToolDefinition = Tool | ToolDefinition;
24
+ export declare const commonTools: ToolOrToolDefinition[];
25
+ export declare const testGenerationTools: ToolOrToolDefinition[];
26
+ export declare const triageOnlyTools: ToolOrToolDefinition[];
27
+ export { createIssueTool, createPullRequestTool, deleteFileTool, downloadBuildTool, fetchDiagnosisReportTool, fetchFileTool, fetchLastSuccessfulTestRunTool, fetchSessionDiffTool, fetchTestRunReportTool, analyseVideo, generateTestWithBrowserAgent, grepTool, listEnvironmentsTool, listIssuesTool, mergeConflictsTool, renameFileTool, reviewPullRequestTool, runTestTool, sendTriageSummaryTool, traceDotZipTool, updateIssueTool, upgradePackagesTool, viewFailedTestRunReportTool, };
3
28
  export declare const allToolsDefinitions: ToolOrToolDefinition[];
4
- export declare function availableTools(model?: SupportedChatModels, isTriage?: boolean, featureFlags?: string[]): Array<ToolDefinition | Tool>;
29
+ export declare function hasBuiltInTextEditor(model: SupportedChatModels): boolean;
30
+ export declare function textEditorToolsForModel(model: SupportedChatModels): ToolOrToolDefinition[];
31
+ export declare function textViewToolsForModel(model: SupportedChatModels): ToolOrToolDefinition[];
5
32
  export declare function toolsNeedBrowser(toolCalls: PendingToolCall[]): boolean;
6
33
  export declare function nameForTelemetry(toolCall: PendingToolCall): string;
7
34
  export declare function sendToolRequestToRemoteQueue(payload: ServicePayload): Promise<void>;
8
- export {};
9
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,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AoB,CAAC,KAAK,EAAE,mBAAmB,WAE9D;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,mBAAmB,GACzB,oBAAoB,EAAE,CAExB;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,mBAAmB,GACzB,oBAAoB,EAAE,CAExB;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,eAAe,EAAE,WAM5D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAQlE;AAED,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,cAAc,iBAoBzE"}
@@ -1,37 +1,63 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.allToolsDefinitions = void 0;
4
- exports.availableTools = availableTools;
3
+ exports.allToolsDefinitions = exports.viewFailedTestRunReportTool = exports.upgradePackagesTool = exports.updateIssueTool = exports.traceDotZipTool = exports.sendTriageSummaryTool = exports.runTestTool = exports.reviewPullRequestTool = exports.renameFileTool = exports.mergeConflictsTool = exports.listIssuesTool = exports.listEnvironmentsTool = exports.grepTool = exports.generateTestWithBrowserAgent = exports.analyseVideo = exports.fetchTestRunReportTool = exports.fetchSessionDiffTool = exports.fetchLastSuccessfulTestRunTool = exports.fetchFileTool = exports.fetchDiagnosisReportTool = exports.downloadBuildTool = exports.deleteFileTool = exports.createPullRequestTool = exports.createIssueTool = exports.triageOnlyTools = exports.testGenerationTools = exports.commonTools = void 0;
4
+ exports.hasBuiltInTextEditor = hasBuiltInTextEditor;
5
+ exports.textEditorToolsForModel = textEditorToolsForModel;
6
+ exports.textViewToolsForModel = textViewToolsForModel;
5
7
  exports.toolsNeedBrowser = toolsNeedBrowser;
6
8
  exports.nameForTelemetry = nameForTelemetry;
7
9
  exports.sendToolRequestToRemoteQueue = sendToolRequestToRemoteQueue;
8
- const chat_1 = require("@empiricalrun/llm/chat");
9
10
  const SQSClient_1 = require("../utils/SQSClient");
10
- const commit_and_create_pr_1 = require("./definitions/commit-and-create-pr");
11
+ const create_pull_request_1 = require("./create-pull-request");
12
+ Object.defineProperty(exports, "createPullRequestTool", { enumerable: true, get: function () { return create_pull_request_1.createPullRequestTool; } });
13
+ const analyse_video_1 = require("./definitions/analyse-video");
14
+ Object.defineProperty(exports, "analyseVideo", { enumerable: true, get: function () { return analyse_video_1.analyseVideo; } });
11
15
  const delete_file_1 = require("./definitions/delete-file");
16
+ Object.defineProperty(exports, "deleteFileTool", { enumerable: true, get: function () { return delete_file_1.deleteFileTool; } });
12
17
  const download_build_1 = require("./definitions/download-build");
13
- const fetch_video_analysis_1 = require("./definitions/fetch-video-analysis");
18
+ Object.defineProperty(exports, "downloadBuildTool", { enumerable: true, get: function () { return download_build_1.downloadBuildTool; } });
14
19
  const grep_1 = require("./definitions/grep");
20
+ Object.defineProperty(exports, "grepTool", { enumerable: true, get: function () { return grep_1.grepTool; } });
15
21
  const list_tests_and_projects_1 = require("./definitions/list-tests-and-projects");
16
22
  const merge_conflicts_1 = require("./definitions/merge-conflicts");
23
+ Object.defineProperty(exports, "mergeConflictsTool", { enumerable: true, get: function () { return merge_conflicts_1.mergeConflictsTool; } });
17
24
  const rename_file_1 = require("./definitions/rename-file");
25
+ Object.defineProperty(exports, "renameFileTool", { enumerable: true, get: function () { return rename_file_1.renameFileTool; } });
26
+ const review_pull_request_1 = require("./definitions/review-pull-request");
27
+ Object.defineProperty(exports, "reviewPullRequestTool", { enumerable: true, get: function () { return review_pull_request_1.reviewPullRequestTool; } });
18
28
  const run_test_1 = require("./definitions/run-test");
29
+ Object.defineProperty(exports, "runTestTool", { enumerable: true, get: function () { return run_test_1.runTestTool; } });
19
30
  const str_replace_editor_1 = require("./definitions/str_replace_editor");
20
31
  const test_gen_browser_1 = require("./definitions/test-gen-browser");
32
+ Object.defineProperty(exports, "generateTestWithBrowserAgent", { enumerable: true, get: function () { return test_gen_browser_1.generateTestWithBrowserAgent; } });
21
33
  const upgrade_packages_1 = require("./definitions/upgrade-packages");
34
+ Object.defineProperty(exports, "upgradePackagesTool", { enumerable: true, get: function () { return upgrade_packages_1.upgradePackagesTool; } });
22
35
  const diagnosis_fetcher_1 = require("./diagnosis-fetcher");
36
+ Object.defineProperty(exports, "fetchDiagnosisReportTool", { enumerable: true, get: function () { return diagnosis_fetcher_1.fetchDiagnosisReportTool; } });
23
37
  const fetch_file_1 = require("./fetch-file");
38
+ Object.defineProperty(exports, "fetchFileTool", { enumerable: true, get: function () { return fetch_file_1.fetchFileTool; } });
24
39
  const fetch_last_successful_test_run_1 = require("./fetch-last-successful-test-run");
40
+ Object.defineProperty(exports, "fetchLastSuccessfulTestRunTool", { enumerable: true, get: function () { return fetch_last_successful_test_run_1.fetchLastSuccessfulTestRunTool; } });
41
+ const fetch_session_diff_1 = require("./fetch-session-diff");
42
+ Object.defineProperty(exports, "fetchSessionDiffTool", { enumerable: true, get: function () { return fetch_session_diff_1.fetchSessionDiffTool; } });
25
43
  const issues_1 = require("./issues");
44
+ Object.defineProperty(exports, "createIssueTool", { enumerable: true, get: function () { return issues_1.createIssueTool; } });
45
+ Object.defineProperty(exports, "listIssuesTool", { enumerable: true, get: function () { return issues_1.listIssuesTool; } });
46
+ Object.defineProperty(exports, "updateIssueTool", { enumerable: true, get: function () { return issues_1.updateIssueTool; } });
26
47
  const list_environments_1 = require("./list-environments");
48
+ Object.defineProperty(exports, "listEnvironmentsTool", { enumerable: true, get: function () { return list_environments_1.listEnvironmentsTool; } });
27
49
  const test_run_fetcher_1 = require("./test-run-fetcher");
50
+ Object.defineProperty(exports, "fetchTestRunReportTool", { enumerable: true, get: function () { return test_run_fetcher_1.fetchTestRunReportTool; } });
28
51
  const trace_dot_zip_1 = require("./trace-dot-zip");
52
+ Object.defineProperty(exports, "traceDotZipTool", { enumerable: true, get: function () { return trace_dot_zip_1.traceDotZipTool; } });
29
53
  const triage_summary_1 = require("./triage-summary");
54
+ Object.defineProperty(exports, "sendTriageSummaryTool", { enumerable: true, get: function () { return triage_summary_1.sendTriageSummaryTool; } });
30
55
  const queue_1 = require("./utils/queue");
31
56
  const view_failed_test_run_report_1 = require("./view-failed-test-run-report");
57
+ Object.defineProperty(exports, "viewFailedTestRunReportTool", { enumerable: true, get: function () { return view_failed_test_run_report_1.viewFailedTestRunReportTool; } });
32
58
  // TODO: Keep this list in sync with the ToolExecutor
33
59
  // Search for "Tool Executor Tools List"
34
- const commonTools = [
60
+ exports.commonTools = [
35
61
  run_test_1.runTestTool,
36
62
  grep_1.grepTool,
37
63
  diagnosis_fetcher_1.fetchDiagnosisReportTool,
@@ -39,52 +65,45 @@ const commonTools = [
39
65
  download_build_1.downloadBuildTool,
40
66
  fetch_file_1.fetchFileTool,
41
67
  trace_dot_zip_1.traceDotZipTool,
68
+ list_tests_and_projects_1.listProjectsTool,
69
+ list_tests_and_projects_1.listTestsForProjectTool,
42
70
  ];
43
- const testGenerationTools = [
71
+ exports.testGenerationTools = [
44
72
  test_gen_browser_1.generateTestWithBrowserAgent,
45
- commit_and_create_pr_1.createPullRequestTool,
73
+ create_pull_request_1.createPullRequestTool,
46
74
  merge_conflicts_1.mergeConflictsTool,
47
75
  delete_file_1.deleteFileTool,
48
76
  rename_file_1.renameFileTool,
49
77
  upgrade_packages_1.upgradePackagesTool,
50
78
  test_run_fetcher_1.fetchTestRunReportTool,
51
79
  ];
52
- const triageOnlyTools = [
80
+ exports.triageOnlyTools = [
53
81
  issues_1.listIssuesTool,
54
82
  issues_1.createIssueTool,
55
83
  issues_1.updateIssueTool,
56
84
  view_failed_test_run_report_1.viewFailedTestRunReportTool,
57
- fetch_video_analysis_1.fetchVideoAnalysis,
85
+ analyse_video_1.analyseVideo,
58
86
  fetch_last_successful_test_run_1.fetchLastSuccessfulTestRunTool,
59
87
  triage_summary_1.sendTriageSummaryTool,
88
+ review_pull_request_1.reviewPullRequestTool,
60
89
  ];
61
90
  exports.allToolsDefinitions = [
62
- ...commonTools,
63
- ...testGenerationTools,
64
- ...triageOnlyTools,
91
+ ...exports.commonTools,
92
+ ...exports.testGenerationTools,
93
+ ...exports.triageOnlyTools,
94
+ // Individual tools that were in removed arrays
95
+ fetch_session_diff_1.fetchSessionDiffTool,
65
96
  list_tests_and_projects_1.listProjectsTool,
66
97
  list_tests_and_projects_1.listTestsForProjectTool,
67
98
  ];
68
- function availableTools(model, isTriage, featureFlags) {
69
- let tools = [...commonTools];
70
- if (isTriage) {
71
- let triageTools = [...triageOnlyTools];
72
- tools = [...tools, ...triageTools];
73
- }
74
- else {
75
- tools = [...tools, ...testGenerationTools];
76
- // Also add fetchVideoAnalysis to normal agent if feature flag is enabled
77
- if (!isTriage && featureFlags?.includes("useVideoAnalysis")) {
78
- // Avoid duplicate if already present
79
- if (!tools.some((tool) => tool.schema.name === "fetchVideoAnalysis")) {
80
- tools.push(fetch_video_analysis_1.fetchVideoAnalysis);
81
- }
82
- }
83
- }
84
- if (model && (0, chat_1.getProviderForModel)(model) !== "claude") {
85
- tools.push(...Object.values(str_replace_editor_1.textEditorTools));
86
- }
87
- return tools;
99
+ function hasBuiltInTextEditor(model) {
100
+ return model.includes("claude") && !model.includes("haiku");
101
+ }
102
+ function textEditorToolsForModel(model) {
103
+ return !hasBuiltInTextEditor(model) ? Object.values(str_replace_editor_1.textEditorTools) : [];
104
+ }
105
+ function textViewToolsForModel(model) {
106
+ return !hasBuiltInTextEditor(model) ? Object.values(str_replace_editor_1.textViewTools) : [];
88
107
  }
89
108
  function toolsNeedBrowser(toolCalls) {
90
109
  return toolCalls.some((toolCall) => exports.allToolsDefinitions.find((t) => t.schema.name === toolCall.name)
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/merge-conflicts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AA2CvD,eAAO,MAAM,kBAAkB,EAAE,IAiDhC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/merge-conflicts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AA8CvD,eAAO,MAAM,kBAAkB,EAAE,IAiDhC,CAAC"}
@@ -11,7 +11,7 @@ const merge_conflicts_1 = require("../definitions/merge-conflicts");
11
11
  const git_1 = require("../executor/utils/git");
12
12
  function runMergeMain(repoPath) {
13
13
  try {
14
- (0, child_process_1.execSync)("git merge --no-ff origin/main", { stdio: "pipe", cwd: repoPath });
14
+ (0, child_process_1.execSync)("git merge --no-ff origin/main -m 'Merge remote-tracking branch origin/main [skip ci]'", { stdio: "pipe", cwd: repoPath });
15
15
  return "CLEAN";
16
16
  }
17
17
  catch (error) {
@@ -69,7 +69,7 @@ exports.renameFileTool = {
69
69
  if (!tscResult.success) {
70
70
  return {
71
71
  result: `File renamed from '${input.oldPath}' to '${input.newPath}'. However, type checks are failing with errors:\n\n${tscResult.errors.join("\n")}`,
72
- isError: true,
72
+ isError: false,
73
73
  };
74
74
  }
75
75
  return {
@@ -0,0 +1,3 @@
1
+ import { Tool } from "@empiricalrun/shared-types";
2
+ export declare const reviewPullRequestTool: Tool;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/review-pull-request/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,4BAA4B,CAAC;AAU9D,eAAO,MAAM,qBAAqB,EAAE,IAiGnC,CAAC"}