@empiricalrun/test-gen 0.78.0 → 0.78.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/actions/index.d.ts +0 -1
  3. package/dist/actions/index.d.ts.map +1 -1
  4. package/dist/actions/index.js +0 -10
  5. package/dist/agent/base/index.d.ts +28 -19
  6. package/dist/agent/base/index.d.ts.map +1 -1
  7. package/dist/agent/base/index.js +25 -14
  8. package/dist/agent/browsing/run.d.ts +1 -1
  9. package/dist/agent/browsing/run.d.ts.map +1 -1
  10. package/dist/agent/chat/agent-loop.d.ts +5 -5
  11. package/dist/agent/chat/agent-loop.d.ts.map +1 -1
  12. package/dist/agent/chat/exports.d.ts +3 -3
  13. package/dist/agent/chat/exports.d.ts.map +1 -1
  14. package/dist/agent/chat/exports.js +5 -9
  15. package/dist/agent/chat/index.d.ts +4 -3
  16. package/dist/agent/chat/index.d.ts.map +1 -1
  17. package/dist/agent/chat/index.js +10 -5
  18. package/dist/agent/chat/models.d.ts +1 -1
  19. package/dist/agent/chat/models.d.ts.map +1 -1
  20. package/dist/agent/chat/models.js +3 -3
  21. package/dist/agent/chat/prompt/pw-utils-docs.d.ts +1 -1
  22. package/dist/agent/chat/prompt/pw-utils-docs.d.ts.map +1 -1
  23. package/dist/agent/chat/prompt/pw-utils-docs.js +42 -0
  24. package/dist/agent/chat/prompt/repo.d.ts +2 -2
  25. package/dist/agent/chat/prompt/repo.d.ts.map +1 -1
  26. package/dist/agent/chat/prompt/repo.js +2 -2
  27. package/dist/agent/chat/state.d.ts +14 -19
  28. package/dist/agent/chat/state.d.ts.map +1 -1
  29. package/dist/agent/chat/state.js +10 -45
  30. package/dist/agent/chat/utils.d.ts +5 -5
  31. package/dist/agent/chat/utils.d.ts.map +1 -1
  32. package/dist/agent/cli.d.ts +2 -2
  33. package/dist/agent/cli.d.ts.map +1 -1
  34. package/dist/agent/cli.js +5 -6
  35. package/dist/agent/code-review/index.d.ts +4 -3
  36. package/dist/agent/code-review/index.d.ts.map +1 -1
  37. package/dist/agent/code-review/index.js +10 -4
  38. package/dist/agent/code-review/types.d.ts +2 -35
  39. package/dist/agent/code-review/types.d.ts.map +1 -1
  40. package/dist/agent/code-review/types.js +4 -11
  41. package/dist/agent/cua/index.d.ts +1 -1
  42. package/dist/agent/cua/index.d.ts.map +1 -1
  43. package/dist/agent/cua/index.js +13 -5
  44. package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.d.ts.map +1 -1
  45. package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.js +0 -3
  46. package/dist/agent/cua/pw-codegen/pw-pause/index.js +1 -1
  47. package/dist/agent/index.d.ts +1 -5
  48. package/dist/agent/index.d.ts.map +1 -1
  49. package/dist/agent/index.js +1 -11
  50. package/dist/agent/master/element-annotation.d.ts +1 -1
  51. package/dist/agent/master/element-annotation.d.ts.map +1 -1
  52. package/dist/agent/master/next-action.d.ts +1 -1
  53. package/dist/agent/master/next-action.d.ts.map +1 -1
  54. package/dist/agent/master/next-action.js +1 -6
  55. package/dist/agent/master/run.d.ts +3 -2
  56. package/dist/agent/master/run.d.ts.map +1 -1
  57. package/dist/agent/master/run.js +0 -26
  58. package/dist/agent/triage/index.d.ts +4 -3
  59. package/dist/agent/triage/index.d.ts.map +1 -1
  60. package/dist/agent/triage/index.js +31 -20
  61. package/dist/artifacts/index.d.ts +1 -1
  62. package/dist/artifacts/index.d.ts.map +1 -1
  63. package/dist/artifacts/utils.d.ts +1 -1
  64. package/dist/artifacts/utils.d.ts.map +1 -1
  65. package/dist/bin/environments.d.ts +1 -1
  66. package/dist/bin/environments.d.ts.map +1 -1
  67. package/dist/bin/index.js +2 -2
  68. package/dist/bin/setup.d.ts +1 -1
  69. package/dist/bin/setup.d.ts.map +1 -1
  70. package/dist/bin/utils/fs/index.d.ts +1 -1
  71. package/dist/bin/utils/fs/index.d.ts.map +1 -1
  72. package/dist/bin/utils/platform/web/index.d.ts +2 -2
  73. package/dist/bin/utils/platform/web/index.d.ts.map +1 -1
  74. package/dist/bin/utils/platform/web/index.js +1 -1
  75. package/dist/bin/utils/scenarios/index.d.ts +1 -1
  76. package/dist/bin/utils/scenarios/index.d.ts.map +1 -1
  77. package/dist/constants/index.d.ts +0 -4
  78. package/dist/constants/index.d.ts.map +1 -1
  79. package/dist/constants/index.js +0 -6
  80. package/dist/dashboard/client.d.ts +1 -1
  81. package/dist/dashboard/client.d.ts.map +1 -1
  82. package/dist/dashboard/index.d.ts +1 -0
  83. package/dist/dashboard/index.d.ts.map +1 -1
  84. package/dist/dashboard/index.js +4 -1
  85. package/dist/dashboard/tool-response.d.ts +5 -0
  86. package/dist/dashboard/tool-response.d.ts.map +1 -0
  87. package/dist/dashboard/tool-response.js +88 -0
  88. package/dist/dashboard/totp.js +1 -1
  89. package/dist/file/server.d.ts +1 -1
  90. package/dist/file/server.d.ts.map +1 -1
  91. package/dist/file/server.js +2 -1
  92. package/dist/file-info/adapters/file-system/index.d.ts +1 -1
  93. package/dist/file-info/adapters/file-system/index.d.ts.map +1 -1
  94. package/dist/file-info/adapters/file-system/reader.d.ts +1 -1
  95. package/dist/file-info/adapters/file-system/reader.d.ts.map +1 -1
  96. package/dist/file-info/adapters/github/index.d.ts +2 -1
  97. package/dist/file-info/adapters/github/index.d.ts.map +1 -1
  98. package/dist/file-info/adapters/github/reader.d.ts +2 -1
  99. package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
  100. package/dist/recorder/index.d.ts.map +1 -1
  101. package/dist/recorder/index.js +2 -1
  102. package/dist/recorder/upload.d.ts +1 -1
  103. package/dist/recorder/upload.d.ts.map +1 -1
  104. package/dist/tools/analyse-video/index.d.ts +1 -1
  105. package/dist/tools/analyse-video/index.d.ts.map +1 -1
  106. package/dist/tools/analyse-video/index.js +20 -13
  107. package/dist/tools/create-pull-request/index.d.ts +1 -1
  108. package/dist/tools/create-pull-request/index.d.ts.map +1 -1
  109. package/dist/tools/create-pull-request/utils.d.ts +2 -1
  110. package/dist/tools/create-pull-request/utils.d.ts.map +1 -1
  111. package/dist/tools/definitions/analyse-video.d.ts +9 -19
  112. package/dist/tools/definitions/analyse-video.d.ts.map +1 -1
  113. package/dist/tools/definitions/analyse-video.js +12 -25
  114. package/dist/tools/definitions/delete-file.d.ts +9 -1
  115. package/dist/tools/definitions/delete-file.d.ts.map +1 -1
  116. package/dist/tools/definitions/delete-file.js +3 -3
  117. package/dist/tools/definitions/download-build.d.ts +1 -1
  118. package/dist/tools/definitions/download-build.d.ts.map +1 -1
  119. package/dist/tools/definitions/grep.d.ts +1 -1
  120. package/dist/tools/definitions/grep.d.ts.map +1 -1
  121. package/dist/tools/definitions/list-tests-and-projects.d.ts +1 -1
  122. package/dist/tools/definitions/list-tests-and-projects.d.ts.map +1 -1
  123. package/dist/tools/definitions/list-tests-and-projects.js +1 -1
  124. package/dist/tools/definitions/merge-conflicts.d.ts +1 -1
  125. package/dist/tools/definitions/merge-conflicts.d.ts.map +1 -1
  126. package/dist/tools/definitions/merge-conflicts.js +2 -2
  127. package/dist/tools/definitions/rename-file.d.ts +1 -1
  128. package/dist/tools/definitions/rename-file.d.ts.map +1 -1
  129. package/dist/tools/definitions/review-pull-request.d.ts +1 -1
  130. package/dist/tools/definitions/review-pull-request.d.ts.map +1 -1
  131. package/dist/tools/definitions/review-pull-request.js +1 -1
  132. package/dist/tools/definitions/run-test.d.ts +1 -1
  133. package/dist/tools/definitions/run-test.d.ts.map +1 -1
  134. package/dist/tools/definitions/str_replace_editor.d.ts +1 -1
  135. package/dist/tools/definitions/str_replace_editor.d.ts.map +1 -1
  136. package/dist/tools/definitions/test-gen-browser.d.ts +1 -1
  137. package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
  138. package/dist/tools/definitions/upgrade-packages.d.ts +1 -1
  139. package/dist/tools/definitions/upgrade-packages.d.ts.map +1 -1
  140. package/dist/tools/definitions/utils.js +1 -1
  141. package/dist/tools/delete-file/index.d.ts +1 -1
  142. package/dist/tools/delete-file/index.d.ts.map +1 -1
  143. package/dist/tools/delete-file/index.js +6 -2
  144. package/dist/tools/diagnosis-fetcher.d.ts +1 -1
  145. package/dist/tools/diagnosis-fetcher.d.ts.map +1 -1
  146. package/dist/tools/diagnosis-fetcher.js +92 -47
  147. package/dist/tools/download-build/index.d.ts +1 -1
  148. package/dist/tools/download-build/index.d.ts.map +1 -1
  149. package/dist/tools/executor/base.d.ts +3 -2
  150. package/dist/tools/executor/base.d.ts.map +1 -1
  151. package/dist/tools/executor/base.js +5 -8
  152. package/dist/tools/executor/index.d.ts +3 -0
  153. package/dist/tools/executor/index.d.ts.map +1 -1
  154. package/dist/tools/executor/index.js +10 -10
  155. package/dist/tools/executor/utils/checkpoint.d.ts.map +1 -1
  156. package/dist/tools/executor/utils/checkpoint.js +0 -4
  157. package/dist/tools/executor/utils/git.d.ts +7 -1
  158. package/dist/tools/executor/utils/git.d.ts.map +1 -1
  159. package/dist/tools/executor/utils/git.js +10 -3
  160. package/dist/tools/executor/utils/index.d.ts +1 -2
  161. package/dist/tools/executor/utils/index.d.ts.map +1 -1
  162. package/dist/tools/executor/utils/index.js +0 -20
  163. package/dist/tools/executor/utils/pr-description.d.ts +1 -1
  164. package/dist/tools/executor/utils/pr-description.d.ts.map +1 -1
  165. package/dist/tools/fetch-file/index.d.ts +1 -1
  166. package/dist/tools/fetch-file/index.d.ts.map +1 -1
  167. package/dist/tools/fetch-file/index.js +53 -13
  168. package/dist/tools/fetch-file/utils.d.ts +3 -0
  169. package/dist/tools/fetch-file/utils.d.ts.map +1 -0
  170. package/dist/tools/fetch-file/utils.js +136 -0
  171. package/dist/tools/fetch-session-diff/index.d.ts +1 -1
  172. package/dist/tools/fetch-session-diff/index.d.ts.map +1 -1
  173. package/dist/tools/fetch-session-diff/index.js +26 -2
  174. package/dist/tools/file-operations/create.d.ts +1 -1
  175. package/dist/tools/file-operations/create.d.ts.map +1 -1
  176. package/dist/tools/file-operations/index.d.ts +2 -1
  177. package/dist/tools/file-operations/index.d.ts.map +1 -1
  178. package/dist/tools/file-operations/insert.d.ts +1 -1
  179. package/dist/tools/file-operations/insert.d.ts.map +1 -1
  180. package/dist/tools/file-operations/replace.d.ts +1 -1
  181. package/dist/tools/file-operations/replace.d.ts.map +1 -1
  182. package/dist/tools/file-operations/replace.js +0 -1
  183. package/dist/tools/file-operations/view/index.d.ts +2 -1
  184. package/dist/tools/file-operations/view/index.d.ts.map +1 -1
  185. package/dist/tools/grep/index.d.ts +1 -1
  186. package/dist/tools/grep/index.d.ts.map +1 -1
  187. package/dist/tools/grep/index.js +15 -12
  188. package/dist/tools/index.d.ts +3 -24
  189. package/dist/tools/index.d.ts.map +1 -1
  190. package/dist/tools/index.js +13 -42
  191. package/dist/tools/issues-v1/create-issue.d.ts +3 -0
  192. package/dist/tools/issues-v1/create-issue.d.ts.map +1 -0
  193. package/dist/tools/{issues → issues-v1}/create-issue.js +5 -9
  194. package/dist/tools/issues-v1/index.d.ts.map +1 -0
  195. package/dist/tools/issues-v1/list-issues.d.ts +3 -0
  196. package/dist/tools/issues-v1/list-issues.d.ts.map +1 -0
  197. package/dist/tools/issues-v1/update-issue.d.ts +3 -0
  198. package/dist/tools/issues-v1/update-issue.d.ts.map +1 -0
  199. package/dist/tools/{issues → issues-v1}/update-issue.js +1 -9
  200. package/dist/tools/{issues → issues-v1}/utils.d.ts +2 -1
  201. package/dist/tools/issues-v1/utils.d.ts.map +1 -0
  202. package/dist/tools/issues-v2/create-issue.d.ts +3 -0
  203. package/dist/tools/issues-v2/create-issue.d.ts.map +1 -0
  204. package/dist/tools/issues-v2/create-issue.js +86 -0
  205. package/dist/tools/issues-v2/update-issue.d.ts +3 -0
  206. package/dist/tools/issues-v2/update-issue.d.ts.map +1 -0
  207. package/dist/tools/issues-v2/update-issue.js +87 -0
  208. package/dist/tools/list-environments.d.ts +1 -1
  209. package/dist/tools/list-environments.d.ts.map +1 -1
  210. package/dist/tools/list-tests-and-projects/index.d.ts +1 -1
  211. package/dist/tools/list-tests-and-projects/index.d.ts.map +1 -1
  212. package/dist/tools/list-tests-and-projects/index.js +14 -4
  213. package/dist/tools/merge-conflicts/index.d.ts +1 -1
  214. package/dist/tools/merge-conflicts/index.d.ts.map +1 -1
  215. package/dist/tools/merge-conflicts/index.js +23 -10
  216. package/dist/tools/rename-file/index.d.ts +1 -1
  217. package/dist/tools/rename-file/index.d.ts.map +1 -1
  218. package/dist/tools/rename-file/index.js +0 -1
  219. package/dist/tools/review-pull-request/index.d.ts +1 -1
  220. package/dist/tools/review-pull-request/index.d.ts.map +1 -1
  221. package/dist/tools/review-pull-request/index.js +5 -4
  222. package/dist/tools/run-test.d.ts +1 -1
  223. package/dist/tools/run-test.d.ts.map +1 -1
  224. package/dist/tools/test-gen-browser.d.ts +1 -1
  225. package/dist/tools/test-gen-browser.d.ts.map +1 -1
  226. package/dist/tools/test-gen-browser.js +55 -19
  227. package/dist/tools/test-run-fetcher/index.d.ts +2 -2
  228. package/dist/tools/test-run-fetcher/index.d.ts.map +1 -1
  229. package/dist/tools/test-run-fetcher/index.js +67 -66
  230. package/dist/tools/trace-dot-zip/index.d.ts +1 -1
  231. package/dist/tools/trace-dot-zip/index.d.ts.map +1 -1
  232. package/dist/tools/trace-dot-zip/utils/network-trace.d.ts.map +1 -1
  233. package/dist/tools/trace-dot-zip/utils/network-trace.js +5 -10
  234. package/dist/tools/triage-summary/index.d.ts +1 -1
  235. package/dist/tools/triage-summary/index.d.ts.map +1 -1
  236. package/dist/tools/triage-summary/index.js +5 -2
  237. package/dist/tools/triage-summary/utils.d.ts +1 -1
  238. package/dist/tools/triage-summary/utils.d.ts.map +1 -1
  239. package/dist/tools/upgrade-packages/index.d.ts +1 -1
  240. package/dist/tools/upgrade-packages/index.d.ts.map +1 -1
  241. package/dist/tools/upgrade-packages/index.js +14 -8
  242. package/dist/tools/upgrade-packages/utils.d.ts +9 -5
  243. package/dist/tools/upgrade-packages/utils.d.ts.map +1 -1
  244. package/dist/tools/upgrade-packages/utils.js +56 -16
  245. package/dist/tools/utils/queue.d.ts +1 -1
  246. package/dist/tools/utils/queue.d.ts.map +1 -1
  247. package/dist/tools/utils/validate-schema.d.ts +3 -0
  248. package/dist/tools/utils/validate-schema.d.ts.map +1 -0
  249. package/dist/tools/utils/validate-schema.js +22 -0
  250. package/dist/utils/SQSClient.d.ts +1 -1
  251. package/dist/utils/SQSClient.d.ts.map +1 -1
  252. package/dist/utils/dedup/dedup-image.js +2 -2
  253. package/dist/utils/dedup/find-threshold.d.ts +1 -1
  254. package/dist/utils/dedup/find-threshold.d.ts.map +1 -1
  255. package/dist/utils/dedup/find-threshold.js +2 -2
  256. package/dist/utils/model.d.ts +1 -1
  257. package/dist/utils/model.d.ts.map +1 -1
  258. package/dist/utils/model.js +4 -3
  259. package/dist/utils/playwright-report-parser.d.ts +1 -1
  260. package/dist/utils/playwright-report-parser.d.ts.map +1 -1
  261. package/dist/utils/playwright-test-id.d.ts +8 -0
  262. package/dist/utils/playwright-test-id.d.ts.map +1 -0
  263. package/dist/utils/playwright-test-id.js +21 -0
  264. package/dist/utils/repo-tree.d.ts +1 -1
  265. package/dist/utils/repo-tree.d.ts.map +1 -1
  266. package/dist/utils/slug.d.ts.map +1 -1
  267. package/dist/utils/slug.js +15 -4
  268. package/dist/utils/url-validation.d.ts +2 -0
  269. package/dist/utils/url-validation.d.ts.map +1 -0
  270. package/dist/utils/url-validation.js +16 -0
  271. package/dist/video-core/index.d.ts +7 -24
  272. package/dist/video-core/index.d.ts.map +1 -1
  273. package/dist/video-core/index.js +32 -25
  274. package/dist/video-core/model-limits.d.ts +2 -2
  275. package/dist/video-core/model-limits.d.ts.map +1 -1
  276. package/dist/video-core/model-limits.js +9 -19
  277. package/dist/video-core/storage-manager.d.ts +2 -1
  278. package/dist/video-core/storage-manager.d.ts.map +1 -1
  279. package/dist/video-core/types.d.ts +1 -1
  280. package/dist/video-core/types.d.ts.map +1 -1
  281. package/dist/video-core/utils.d.ts +5 -7
  282. package/dist/video-core/utils.d.ts.map +1 -1
  283. package/dist/video-core/utils.js +39 -132
  284. package/package.json +8 -4
  285. package/tsconfig.tsbuildinfo +1 -1
  286. package/dist/actions/skill.d.ts +0 -21
  287. package/dist/actions/skill.d.ts.map +0 -1
  288. package/dist/actions/skill.js +0 -127
  289. package/dist/agent/chat/filesystem-cache.d.ts +0 -12
  290. package/dist/agent/chat/filesystem-cache.d.ts.map +0 -1
  291. package/dist/agent/chat/filesystem-cache.js +0 -101
  292. package/dist/agent/codegen/create-test-block.d.ts +0 -8
  293. package/dist/agent/codegen/create-test-block.d.ts.map +0 -1
  294. package/dist/agent/codegen/create-test-block.js +0 -47
  295. package/dist/agent/codegen/fix-ts-errors.d.ts +0 -12
  296. package/dist/agent/codegen/fix-ts-errors.d.ts.map +0 -1
  297. package/dist/agent/codegen/fix-ts-errors.js +0 -78
  298. package/dist/agent/codegen/lexical-scoped-vars.d.ts +0 -9
  299. package/dist/agent/codegen/lexical-scoped-vars.d.ts.map +0 -1
  300. package/dist/agent/codegen/lexical-scoped-vars.js +0 -55
  301. package/dist/agent/codegen/skills-retriever.d.ts +0 -26
  302. package/dist/agent/codegen/skills-retriever.d.ts.map +0 -1
  303. package/dist/agent/codegen/skills-retriever.js +0 -93
  304. package/dist/agent/codegen/test-update-feedback.d.ts +0 -12
  305. package/dist/agent/codegen/test-update-feedback.d.ts.map +0 -1
  306. package/dist/agent/codegen/test-update-feedback.js +0 -49
  307. package/dist/agent/codegen/types.d.ts +0 -25
  308. package/dist/agent/codegen/types.d.ts.map +0 -1
  309. package/dist/agent/codegen/types.js +0 -8
  310. package/dist/agent/codegen/update-flow.d.ts +0 -36
  311. package/dist/agent/codegen/update-flow.d.ts.map +0 -1
  312. package/dist/agent/codegen/update-flow.js +0 -259
  313. package/dist/agent/codegen/use-skill.d.ts +0 -11
  314. package/dist/agent/codegen/use-skill.d.ts.map +0 -1
  315. package/dist/agent/codegen/use-skill.js +0 -53
  316. package/dist/agent/codegen/utils.d.ts +0 -110
  317. package/dist/agent/codegen/utils.d.ts.map +0 -1
  318. package/dist/agent/codegen/utils.js +0 -376
  319. package/dist/agent/master/browser-tests/skills.spec.d.ts +0 -2
  320. package/dist/agent/master/browser-tests/skills.spec.d.ts.map +0 -1
  321. package/dist/agent/master/browser-tests/skills.spec.js +0 -112
  322. package/dist/agent/master/execute-skill-action.d.ts +0 -11
  323. package/dist/agent/master/execute-skill-action.d.ts.map +0 -1
  324. package/dist/agent/master/execute-skill-action.js +0 -23
  325. package/dist/agent/video-analysis/executor/index.d.ts +0 -5
  326. package/dist/agent/video-analysis/executor/index.d.ts.map +0 -1
  327. package/dist/agent/video-analysis/executor/index.js +0 -10
  328. package/dist/agent/video-analysis/index.d.ts +0 -7
  329. package/dist/agent/video-analysis/index.d.ts.map +0 -1
  330. package/dist/agent/video-analysis/index.js +0 -60
  331. package/dist/evals/append-create-test-agent.evals.d.ts +0 -4
  332. package/dist/evals/append-create-test-agent.evals.d.ts.map +0 -1
  333. package/dist/evals/append-create-test-agent.evals.js +0 -117
  334. package/dist/evals/fetch-pom-skills-agent.evals.d.ts +0 -4
  335. package/dist/evals/fetch-pom-skills-agent.evals.d.ts.map +0 -1
  336. package/dist/evals/fetch-pom-skills-agent.evals.js +0 -36
  337. package/dist/evals/master-agent.evals.d.ts +0 -4
  338. package/dist/evals/master-agent.evals.d.ts.map +0 -1
  339. package/dist/evals/master-agent.evals.js +0 -35
  340. package/dist/evals/type.d.ts +0 -12
  341. package/dist/evals/type.d.ts.map +0 -1
  342. package/dist/evals/type.js +0 -2
  343. package/dist/evals/update-scenario-agent.evals.d.ts +0 -4
  344. package/dist/evals/update-scenario-agent.evals.d.ts.map +0 -1
  345. package/dist/evals/update-scenario-agent.evals.js +0 -47
  346. package/dist/tools/fetch-last-successful-test-run/index.d.ts +0 -3
  347. package/dist/tools/fetch-last-successful-test-run/index.d.ts.map +0 -1
  348. package/dist/tools/fetch-last-successful-test-run/index.js +0 -60
  349. package/dist/tools/issues/create-issue.d.ts +0 -3
  350. package/dist/tools/issues/create-issue.d.ts.map +0 -1
  351. package/dist/tools/issues/index.d.ts.map +0 -1
  352. package/dist/tools/issues/list-issues.d.ts +0 -3
  353. package/dist/tools/issues/list-issues.d.ts.map +0 -1
  354. package/dist/tools/issues/metadata-schema.d.ts +0 -24
  355. package/dist/tools/issues/metadata-schema.d.ts.map +0 -1
  356. package/dist/tools/issues/metadata-schema.js +0 -22
  357. package/dist/tools/issues/update-issue.d.ts +0 -3
  358. package/dist/tools/issues/update-issue.d.ts.map +0 -1
  359. package/dist/tools/issues/utils.d.ts.map +0 -1
  360. package/dist/tools/utils/urls.d.ts +0 -5
  361. package/dist/tools/utils/urls.d.ts.map +0 -1
  362. package/dist/tools/utils/urls.js +0 -19
  363. package/dist/tools/view-failed-test-run-report/index.d.ts +0 -12
  364. package/dist/tools/view-failed-test-run-report/index.d.ts.map +0 -1
  365. package/dist/tools/view-failed-test-run-report/index.js +0 -151
  366. package/dist/video-core/agent-orchestrator.d.ts +0 -13
  367. package/dist/video-core/agent-orchestrator.d.ts.map +0 -1
  368. package/dist/video-core/agent-orchestrator.js +0 -59
  369. package/dist/video-core/xml-parser.d.ts +0 -3
  370. package/dist/video-core/xml-parser.d.ts.map +0 -1
  371. package/dist/video-core/xml-parser.js +0 -27
  372. /package/dist/tools/{issues → issues-v1}/index.d.ts +0 -0
  373. /package/dist/tools/{issues → issues-v1}/index.js +0 -0
  374. /package/dist/tools/{issues → issues-v1}/list-issues.js +0 -0
  375. /package/dist/tools/{issues → issues-v1}/utils.js +0 -0
@@ -1,45 +1,59 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.fetchDiagnosisReportTool = void 0;
7
- const path_1 = __importDefault(require("path"));
8
4
  const zod_1 = require("zod");
9
- const slug_1 = require("../utils/slug");
5
+ const playwright_report_parser_1 = require("../utils/playwright-report-parser");
10
6
  const DiagnosisSchema = zod_1.z.object({
11
- diagnosisUrl: zod_1.z
7
+ diagnosisId: zod_1.z
12
8
  .string()
13
- .describe("The full URL of the diagnosis (e.g. https://dash.empirical.run/shopflo-tests/diagnosis/split-cod-place-the-order--byynrPjCml57)"),
9
+ .describe("12 character random string that identifies a failing test case in a test run"),
14
10
  });
15
11
  exports.fetchDiagnosisReportTool = {
16
12
  schema: {
17
13
  name: "fetchDiagnosisDetails",
18
- description: "Fetch details about a test case diagnosis using its URL or slug. Returns diagnosis data including test metadata, error details, and file path. Use fileViewTool separately to read the actual test source code if needed.",
14
+ description: `Fetch details about a failed test case using its URL or slug.
15
+ This tool returns error stack, failing line, across multiple retries (generally, 3) for the
16
+ test case in a particular test run (identified by an id, like #3450).
17
+
18
+ ## How to use this tool?
19
+ - The input to this tool is a diagnosis identifier, which is random 12 character string (e.g byynrPjCml57).
20
+ Internally, this string is generated by nanoid.
21
+
22
+ - To get this diagnosis id, you can interpret incoming URLs that contain this id.
23
+
24
+ ### URL format 1
25
+
26
+ https://dash.empirical.run/<project-name>/test-runs/34548?detail=ULRHHNwiGZ2W
27
+
28
+ In the above, the test run id is #34548 and the diagnosis id is "ULRHHNwiGZ2W"
29
+
30
+ ### URL format 2
31
+
32
+ https://dash.empirical.run/<project-name>/diagnosis/slug-of-test-case-name--ULRHHNwiGZ2W
33
+
34
+ In the above, the diagnosis id is after the double hyphen, which is "ULRHHNwiGZ2W"
35
+
36
+ ## Related tools
37
+ - You can use the file view tool to read the actual test source code, or helper methods that
38
+ are imported in the test to get a complete sense of what the test case was testing.
39
+ - You can also fetch the entire test run report, which contains a list of failed test cases.`,
19
40
  parameters: DiagnosisSchema,
20
41
  },
21
42
  needsBrowser: false,
22
43
  isInlineTool: true,
23
- execute: async ({ input, repoPath, apiClient }) => {
24
- const { diagnosisUrl } = input;
25
- let slug;
26
- try {
27
- slug = (0, slug_1.extractSlugFromDiagnosisUrl)(diagnosisUrl);
28
- }
29
- catch (error) {
30
- return {
31
- isError: true,
32
- result: `Invalid diagnosis URL - could not extract slug: ${error instanceof Error ? error.message : String(error)}`,
33
- };
34
- }
44
+ execute: async ({ input, apiClient }) => {
45
+ const { diagnosisId } = input;
35
46
  let data = null;
36
47
  if (!apiClient) {
37
48
  throw new Error("Dashboard API client is not available.");
38
49
  }
39
50
  try {
40
- data = await apiClient.request(`/api/diagnosis/${slug}/detailed`, {
51
+ data = await apiClient.request(`/api/diagnosis/${diagnosisId}/detailed`, {
41
52
  method: "GET",
42
53
  });
54
+ if (!data || !data.data) {
55
+ throw new Error("No API response from /api/diagnosis/<slug>/detailed");
56
+ }
43
57
  }
44
58
  catch (error) {
45
59
  return {
@@ -48,37 +62,33 @@ exports.fetchDiagnosisReportTool = {
48
62
  };
49
63
  }
50
64
  const { test_case, diagnosis } = data.data;
51
- const project = diagnosis?.test_project || "unknown";
52
- const repoName = path_1.default.basename(repoPath);
53
- const cleanErrorStack = diagnosis?.failed_run_metadata?.stack?.replace(`"/runner/_work/${repoName}/${repoName}/source-repo/"`, "");
54
- // Format the response as markdown
65
+ const project = diagnosis.test_project || "unknown";
66
+ const retries = diagnosis.retry_details?.retries;
67
+ const retryInfo = retries?.reduce((acc, current) => {
68
+ return `${acc}\n\n## Retry ${current.retryIndex}\n\n${JSON.stringify(current, null, 2)}`;
69
+ }, "");
70
+ const lastSuccessRunForProject = await getDataForLastSuccessfulRuns(test_case);
71
+ let lastSuccessRunInfo = "No successful runs found.";
72
+ if (Object.keys(lastSuccessRunForProject).length > 0) {
73
+ lastSuccessRunInfo = Object.entries(lastSuccessRunForProject).reduce((acc, current) => {
74
+ const [project, value] = current;
75
+ return `${acc}\n\n## Playwright project: ${project}\n\n${JSON.stringify(value, null, 2)}`;
76
+ }, "");
77
+ }
55
78
  const markdownResponse = `
56
- # Test Case Diagnosis
57
-
58
- ## Test Case Information
59
- - **Test Case Name**: ${test_case.name}
60
- - **Test Suite**: ${test_case.suites}
61
- - **File Path**: tests/${test_case.file_path}
62
- - **Project**: ${project}
63
-
64
- ## What Happened in the Test Run
65
-
66
- ### Failure Details
67
- - **Failing Line**: ${diagnosis?.failing_line || "No failing line available"}
79
+ # Test Case Information
80
+ - **Name**: ${test_case.name}
81
+ - **Test suite** (Describe blocks): ${test_case.suites}
82
+ - **File path**: tests/${test_case.file_path}
83
+ - **Playwright project**: ${project}
68
84
 
69
- #### Error Stack
70
- \`\`\`
71
- ${cleanErrorStack || "No error stack available"}
72
- \`\`\`
85
+ # What happened in this test run
73
86
 
74
- #### Error Summary
75
- ${diagnosis?.error_stack_summary?.content || "No error summary available"}
87
+ ${retryInfo}
76
88
 
77
- #### Visual Analysis
78
- ${diagnosis?.visual_diff_summary?.summary || "No visual analysis available"}
89
+ # Last successful runs
79
90
 
80
- #### Merged Summary
81
- ${diagnosis?.merged_summary?.content || "No merged summary available"}
91
+ ${lastSuccessRunInfo}
82
92
  `;
83
93
  return {
84
94
  result: markdownResponse,
@@ -86,3 +96,38 @@ ${diagnosis?.merged_summary?.content || "No merged summary available"}
86
96
  };
87
97
  },
88
98
  };
99
+ async function getDataForLastSuccessfulRuns(testCase) {
100
+ const lastSuccessfulRun = testCase.metadata?.last_successful_run;
101
+ const runData = {};
102
+ const projectPromises = Object.entries(lastSuccessfulRun ?? {}).map(async ([project, testCaseMetaData]) => {
103
+ if (!testCaseMetaData.summary_url)
104
+ return { project, success: false, data: null };
105
+ try {
106
+ const testCaseData = await (0, playwright_report_parser_1.fetchAndFindTestCase)(testCaseMetaData.summary_url, {
107
+ name: testCase.name,
108
+ suites: testCase.suites,
109
+ file_path: testCase.file_path,
110
+ });
111
+ return {
112
+ project,
113
+ success: true,
114
+ data: {
115
+ ...testCaseMetaData,
116
+ test_case: testCaseData,
117
+ },
118
+ };
119
+ }
120
+ catch {
121
+ return { project, success: false, data: null };
122
+ }
123
+ });
124
+ const results = await Promise.allSettled(projectPromises);
125
+ for (const result of results) {
126
+ if (result.status === "fulfilled" &&
127
+ result.value.success &&
128
+ result.value.data) {
129
+ runData[result.value.project] = result.value.data;
130
+ }
131
+ }
132
+ return runData;
133
+ }
@@ -1,3 +1,3 @@
1
- import type { Tool } from "@empiricalrun/shared-types";
1
+ import type { Tool } from "@empiricalrun/shared-types/chat-agent";
2
2
  export declare const downloadBuildTool: Tool;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/download-build/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,4BAA4B,CAAC;AAQpE,eAAO,MAAM,iBAAiB,EAAE,IA4B/B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/download-build/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,uCAAuC,CAAC;AAQ/E,eAAO,MAAM,iBAAiB,EAAE,IA4B/B,CAAC"}
@@ -1,6 +1,7 @@
1
- import { TraceClient } from "@empiricalrun/llm";
1
+ import type { TraceClient } from "@empiricalrun/llm";
2
2
  import { PendingToolCall, ToolResult } from "@empiricalrun/llm/chat";
3
- import type { ChatSessionInfo, IDashboardAPIClient, Logger, MessageCheckpoint, Tool, ToolExecute } from "@empiricalrun/shared-types";
3
+ import type { IDashboardAPIClient } from "@empiricalrun/shared-types/api/base";
4
+ import type { ChatSessionInfo, Logger, MessageCheckpoint, Tool, ToolExecute } from "@empiricalrun/shared-types/chat-agent";
4
5
  export type BaseToolExecutorProps = {
5
6
  tools: Array<Tool>;
6
7
  chatSession: ChatSessionInfo | {
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/tools/executor/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EACV,eAAe,EAEf,mBAAm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EACR,SAAS,EACT,KAAK,EACL,YAAY,EACZ,oBAAoB,EACpB,MAAM,GACP,EAAE,qBAAqB;IAuBlB,OAAO,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;QACnD,WAAW,EAAE,UAAU,EAAE,CAAC;QAC1B,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAAC;KACtC,CAAC;CAsGH"}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseToolExecutor = void 0;
4
4
  const artifacts_1 = require("../../artifacts");
5
5
  const file_operations_1 = require("../file-operations");
6
- const utils_1 = require("./utils");
6
+ const validate_schema_1 = require("../utils/validate-schema");
7
7
  const checkpoint_1 = require("./utils/checkpoint");
8
8
  const LOGGER = {
9
9
  info: (msg, meta) => console.log(`[info] ${msg}`, meta || ""),
@@ -78,16 +78,13 @@ class BaseToolExecutor {
78
78
  ? toolExecutor
79
79
  : toolExecutor.execute;
80
80
  if (toolInputSchema) {
81
- const validationErroToolresult = (0, utils_1.validateToolInput)(toolCall, toolInputSchema);
82
- if (validationErroToolresult) {
83
- toolResults.push(validationErroToolresult);
84
- span?.end({ output: validationErroToolresult });
81
+ const validationErrorToolresult = (0, validate_schema_1.validateToolInput)(toolCall, toolInputSchema);
82
+ if (validationErrorToolresult) {
83
+ toolResults.push(validationErrorToolresult);
84
+ span?.end({ output: validationErrorToolresult });
85
85
  continue;
86
86
  }
87
87
  }
88
- else {
89
- console.log(`No schema found for tool ${toolCall.name}. Skipping validation.`);
90
- }
91
88
  try {
92
89
  const result = await executeFn({
93
90
  input: toolCall.input,
@@ -1,4 +1,7 @@
1
1
  import { BaseToolExecutor, BaseToolExecutorProps } from "./base";
2
+ export type { BaseToolExecutorProps } from "./base";
3
+ export { BaseToolExecutor } from "./base";
4
+ export { gitPushChanges } from "./utils/git";
2
5
  export declare class ToolExecutor extends BaseToolExecutor {
3
6
  constructor(params: Omit<BaseToolExecutorProps, "tools">);
4
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/executor/index.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAEjE,qBAAa,YAAa,SAAQ,gBAAgB;gBACpC,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC;CAgCzD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/executor/index.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAEjE,YAAY,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,qBAAa,YAAa,SAAQ,gBAAgB;gBACpC,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC;CA8BzD"}
@@ -1,17 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ToolExecutor = void 0;
3
+ exports.ToolExecutor = exports.gitPushChanges = exports.BaseToolExecutor = void 0;
4
4
  const analyse_video_1 = require("../analyse-video");
5
5
  const create_pull_request_1 = require("../create-pull-request");
6
6
  const delete_file_1 = require("../delete-file");
7
7
  const diagnosis_fetcher_1 = require("../diagnosis-fetcher");
8
8
  const download_build_1 = require("../download-build");
9
9
  const fetch_file_1 = require("../fetch-file");
10
- const fetch_last_successful_test_run_1 = require("../fetch-last-successful-test-run");
11
10
  const fetch_session_diff_1 = require("../fetch-session-diff");
12
11
  const file_operations_1 = require("../file-operations");
13
12
  const grep_1 = require("../grep");
14
- const issues_1 = require("../issues");
13
+ const issues_v1_1 = require("../issues-v1");
15
14
  const list_environments_1 = require("../list-environments");
16
15
  const list_tests_and_projects_1 = require("../list-tests-and-projects");
17
16
  const merge_conflicts_1 = require("../merge-conflicts");
@@ -23,22 +22,25 @@ const test_run_fetcher_1 = require("../test-run-fetcher");
23
22
  const trace_dot_zip_1 = require("../trace-dot-zip");
24
23
  const triage_summary_1 = require("../triage-summary");
25
24
  const upgrade_packages_1 = require("../upgrade-packages");
26
- const view_failed_test_run_report_1 = require("../view-failed-test-run-report");
27
25
  const base_1 = require("./base");
26
+ var base_2 = require("./base");
27
+ Object.defineProperty(exports, "BaseToolExecutor", { enumerable: true, get: function () { return base_2.BaseToolExecutor; } });
28
+ var git_1 = require("./utils/git");
29
+ Object.defineProperty(exports, "gitPushChanges", { enumerable: true, get: function () { return git_1.gitPushChanges; } });
28
30
  class ToolExecutor extends base_1.BaseToolExecutor {
29
31
  constructor(params) {
30
32
  // Found for "Tool Executor Tools List" and add any new tools to the list
31
33
  const tools = [
32
34
  grep_1.grepTool,
33
35
  run_test_1.runTestTool,
34
- test_run_fetcher_1.fetchTestRunReportTool,
36
+ test_run_fetcher_1.fetchTestRunDetailsTool,
35
37
  diagnosis_fetcher_1.fetchDiagnosisReportTool,
36
38
  test_gen_browser_1.generateTestWithBrowserAgent,
37
39
  create_pull_request_1.createPullRequestTool,
38
40
  merge_conflicts_1.mergeConflictsTool,
39
41
  list_environments_1.listEnvironmentsTool,
40
- issues_1.listIssuesTool,
41
- issues_1.createIssueTool,
42
+ issues_v1_1.listIssuesTool,
43
+ issues_v1_1.createIssueTool,
42
44
  download_build_1.downloadBuildTool,
43
45
  upgrade_packages_1.upgradePackagesTool,
44
46
  fetch_file_1.fetchFileTool,
@@ -46,9 +48,7 @@ class ToolExecutor extends base_1.BaseToolExecutor {
46
48
  delete_file_1.deleteFileTool,
47
49
  rename_file_1.renameFileTool,
48
50
  trace_dot_zip_1.traceDotZipTool,
49
- view_failed_test_run_report_1.viewFailedTestRunReportTool,
50
- issues_1.updateIssueTool,
51
- fetch_last_successful_test_run_1.fetchLastSuccessfulTestRunTool,
51
+ issues_v1_1.updateIssueTool,
52
52
  triage_summary_1.sendTriageSummaryTool,
53
53
  list_tests_and_projects_1.listProjectsTool,
54
54
  fetch_session_diff_1.fetchSessionDiffTool,
@@ -1 +1 @@
1
- {"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../../../src/tools/executor/utils/checkpoint.ts"],"names":[],"mappings":"AAIA,wBAAgB,sBAAsB,CAAC,EACrC,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,GAAG,IAAI,CA2BhB"}
1
+ {"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../../../src/tools/executor/utils/checkpoint.ts"],"names":[],"mappings":"AAEA,wBAAgB,sBAAsB,CAAC,EACrC,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,GAAG,IAAI,CAwBhB"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createCommitCheckpoint = createCommitCheckpoint;
4
- const child_process_1 = require("child_process");
5
4
  const git_1 = require("./git");
6
5
  function createCommitCheckpoint({ branchName, repoPath, }) {
7
6
  const filesChanged = (0, git_1.getStagedFiles)(repoPath);
@@ -21,9 +20,6 @@ function createCommitCheckpoint({ branchName, repoPath, }) {
21
20
  const commitMessage = commitMessages.join(", ");
22
21
  // Files are already staged by individual tools, just commit
23
22
  const commitSha = (0, git_1.commitAsBotUser)(commitMessage, repoPath);
24
- if (commitSha) {
25
- (0, child_process_1.execSync)(`git push origin ${branchName}`, { cwd: repoPath });
26
- }
27
23
  return commitSha;
28
24
  }
29
25
  return null;
@@ -1,4 +1,6 @@
1
- import { IDashboardAPIClient } from "@empiricalrun/shared-types";
1
+ import { IDashboardAPIClient } from "@empiricalrun/shared-types/api/base";
2
+ export declare const GIT_USER_NAME = "empiricalrun[bot]";
3
+ export declare const GIT_USER_EMAIL = "180257021+empiricalrun[bot]@users.noreply.github.com";
2
4
  export declare function getGitDiff(filepath: string, cwd: string): string;
3
5
  export declare function getGitDiffStaged(filepath: string, cwd: string): string;
4
6
  export declare function getGitDiffForStagedOrUnstaged(filepath: string, cwd: string): string;
@@ -24,4 +26,8 @@ export declare function mergePullRequest({ repoName, prNumber, apiClient, }: {
24
26
  prNumber: number;
25
27
  apiClient: IDashboardAPIClient;
26
28
  }): Promise<boolean>;
29
+ export declare function gitPushChanges({ branch, workingDirectory, }: {
30
+ branch: string;
31
+ workingDirectory: string;
32
+ }): void;
27
33
  //# sourceMappingURL=git.d.ts.map
@@ -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,CAC7B,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,IAAI,CAkBf;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,mBAO1D;AAED,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAE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  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GIT_USER_EMAIL = exports.GIT_USER_NAME = void 0;
3
4
  exports.getGitDiff = getGitDiff;
4
5
  exports.getGitDiffStaged = getGitDiffStaged;
5
6
  exports.getGitDiffForStagedOrUnstaged = getGitDiffForStagedOrUnstaged;
@@ -12,9 +13,10 @@ exports.stageAndCommitFilesAsBotUser = stageAndCommitFilesAsBotUser;
12
13
  exports.getStagedFiles = getStagedFiles;
13
14
  exports.getFilesChanged = getFilesChanged;
14
15
  exports.mergePullRequest = mergePullRequest;
16
+ exports.gitPushChanges = gitPushChanges;
15
17
  const child_process_1 = require("child_process");
16
- const GIT_USER_NAME = "empiricalrun[bot]";
17
- const GIT_USER_EMAIL = "180257021+empiricalrun[bot]@users.noreply.github.com";
18
+ exports.GIT_USER_NAME = "empiricalrun[bot]";
19
+ exports.GIT_USER_EMAIL = "180257021+empiricalrun[bot]@users.noreply.github.com";
18
20
  function getGitDiff(filepath, cwd) {
19
21
  const diff = (0, child_process_1.execSync)(`git diff ${filepath}`, {
20
22
  encoding: "utf-8",
@@ -77,7 +79,7 @@ function commitAsBotUser(commitMessage, cwd) {
77
79
  return null;
78
80
  }
79
81
  const commitMessageWithSkipCi = `${commitMessage} [skip ci]`;
80
- (0, child_process_1.execSync)(`git -c user.name="${GIT_USER_NAME}" -c user.email="${GIT_USER_EMAIL}" commit -m "${commitMessageWithSkipCi}"`, { cwd });
82
+ (0, child_process_1.execSync)(`git -c user.name="${exports.GIT_USER_NAME}" -c user.email="${exports.GIT_USER_EMAIL}" commit -m "${commitMessageWithSkipCi}"`, { cwd });
81
83
  const commitSha = (0, child_process_1.execSync)("git rev-parse HEAD", {
82
84
  encoding: "utf-8",
83
85
  cwd,
@@ -179,3 +181,8 @@ async function mergePullRequest({ repoName, prNumber, apiClient, }) {
179
181
  return false;
180
182
  }
181
183
  }
184
+ function gitPushChanges({ branch, workingDirectory, }) {
185
+ (0, child_process_1.execSync)(`git push origin ${branch}`, {
186
+ cwd: workingDirectory,
187
+ });
188
+ }
@@ -1,4 +1,4 @@
1
- import { IDashboardAPIClient, PendingToolCall, ToolResult } from "@empiricalrun/shared-types";
1
+ import { IDashboardAPIClient } from "@empiricalrun/shared-types/api/base";
2
2
  export interface GitHubRepoInfo {
3
3
  owner: string;
4
4
  repo: string;
@@ -75,5 +75,4 @@ export declare function findOrCreatePullRequest({ owner, repo, branchName, title
75
75
  pr: PullRequestInfo;
76
76
  isNew: boolean;
77
77
  }>;
78
- export declare function validateToolInput<T>(toolCall: PendingToolCall, schema: T): ToolResult | null;
79
78
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/executor/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,UAAU,EACX,MAAM,4BAA4B,CAAC;AAEpC,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,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AAC,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,CAqBnD"}
@@ -7,7 +7,6 @@ exports.getMergeableStateDescription = getMergeableStateDescription;
7
7
  exports.createPullRequest = createPullRequest;
8
8
  exports.updatePullRequest = updatePullRequest;
9
9
  exports.findOrCreatePullRequest = findOrCreatePullRequest;
10
- exports.validateToolInput = validateToolInput;
11
10
  function parseGitHubUrl(url) {
12
11
  const githubIndex = url.indexOf("github.com");
13
12
  if (githubIndex === -1) {
@@ -121,22 +120,3 @@ async function findOrCreatePullRequest({ owner, repo, branchName, title, body, b
121
120
  });
122
121
  return { pr: newPR, isNew: true };
123
122
  }
124
- function validateToolInput(toolCall, schema) {
125
- const { name: toolName, input } = toolCall;
126
- const strictSchema = schema._def?.typeName === "ZodObject"
127
- ? schema.strict()
128
- : schema;
129
- const validation = strictSchema.safeParse(input);
130
- if (!validation.success) {
131
- const errorMessage = [
132
- `Schema validation failed for tool "${toolName}".`,
133
- `\nValidation errors: ${JSON.stringify(validation.error.issues, null, 2)}`,
134
- ].join("\n");
135
- return {
136
- isError: true,
137
- result: errorMessage,
138
- artifacts: null,
139
- };
140
- }
141
- return null;
142
- }
@@ -1,4 +1,4 @@
1
- import type { ChatSessionInfo } from "@empiricalrun/shared-types";
1
+ import type { ChatSessionInfo } from "@empiricalrun/shared-types/chat-agent";
2
2
  export declare function generateSessionMetadata(chatSession: ChatSessionInfo | null): string;
3
3
  export declare function addMetadataToPRDescription(description: string, chatSession: ChatSessionInfo | null | undefined): string;
4
4
  //# sourceMappingURL=pr-description.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pr-description.d.ts","sourceRoot":"","sources":["../../../../src/tools/executor/utils/pr-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,eAAe,GAAG,IAAI,GAClC,MAAM,CASR;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAC9C,MAAM,CAWR"}
1
+ {"version":3,"file":"pr-description.d.ts","sourceRoot":"","sources":["../../../../src/tools/executor/utils/pr-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAE7E,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,eAAe,GAAG,IAAI,GAClC,MAAM,CASR;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAC9C,MAAM,CAWR"}
@@ -1,4 +1,4 @@
1
- import { Tool } from "@empiricalrun/shared-types";
1
+ import { Tool } from "@empiricalrun/shared-types/chat-agent";
2
2
  import { z } from "zod";
3
3
  declare const fetchFileSchema: z.ZodObject<{
4
4
  url: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/fetch-file/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,QAAA,MAAM,eAAe;;;;;;EAEnB,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAyF/D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/fetch-file/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAGL,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,QAAA,MAAM,eAAe;;;;;;EAEnB,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAoI/D,CAAC"}
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetchFileTool = void 0;
4
4
  const zod_1 = require("zod");
5
+ const url_validation_1 = require("../../utils/url-validation");
6
+ const utils_1 = require("./utils");
5
7
  const SUPPORTED_IMAGE_TYPES = [
6
8
  "image/png",
7
9
  "image/jpeg",
@@ -16,7 +18,7 @@ exports.fetchFileTool = {
16
18
  schema: {
17
19
  name: "fetchFile",
18
20
  description: `Use this tool to fetch file data from any valid URL that responds with an image (PNG, JPEG, GIF, WebP) or markdown file.
19
- For images, it returns the image in base64 format for you to view or analyze. For markdown files, it returns the text content for you to read and process.
21
+ For images, it returns the image in base64 format for you to view or analyse. For markdown files, it returns the text content for you to read and process.
20
22
 
21
23
  ## Caveats
22
24
  1. This will not work to fetch markdown files from a repo due to access control issues. Use file view tools for that.
@@ -30,20 +32,32 @@ time of test failures. Both of these are available in the attachments section of
30
32
  },
31
33
  needsBrowser: false,
32
34
  isInlineTool: true,
33
- execute: async ({ input }) => {
35
+ execute: async ({ input, logger, }) => {
34
36
  const { url } = input;
37
+ logger.info("Starting file fetch", {
38
+ tool: "fetchFileTool",
39
+ url,
40
+ });
35
41
  try {
36
- const response = await fetch(url);
37
- if (!response.ok) {
38
- console.error(`Failed to fetch file from ${url}: ${response.statusText}`);
42
+ const headResponse = await (0, url_validation_1.validateUrlAccess)(url);
43
+ if (!headResponse.ok) {
44
+ logger.error("Failed to fetch file", {
45
+ tool: "fetchFileTool",
46
+ url,
47
+ statusText: headResponse.statusText,
48
+ });
39
49
  return {
40
- result: `Failed to fetch file from ${url}: ${response.statusText}`,
50
+ result: `Failed to fetch file from ${url}: ${headResponse.statusText}`,
41
51
  isError: true,
42
52
  };
43
53
  }
44
- const contentType = response.headers.get("content-type");
54
+ const contentType = headResponse.headers.get("content-type");
45
55
  if (!contentType) {
46
56
  const errorMessage = `No content type header found. URL must return an image or markdown file.`;
57
+ logger.warn("No content type header found", {
58
+ tool: "fetchFileTool",
59
+ url,
60
+ });
47
61
  return {
48
62
  result: errorMessage,
49
63
  isError: true,
@@ -51,17 +65,33 @@ time of test failures. Both of these are available in the attachments section of
51
65
  }
52
66
  const isImage = SUPPORTED_IMAGE_TYPES.some((type) => contentType.startsWith(type));
53
67
  const isText = SUPPORTED_TEXT_TYPES.some((type) => contentType.startsWith(type));
68
+ const isVideo = contentType.startsWith("video");
54
69
  if (!isImage && !isText) {
55
- const errorMessage = `Invalid content type: ${contentType}. URL must return an image (PNG, JPEG, GIF, WebP) or markdown file.`;
56
- console.error(errorMessage);
70
+ const errorMessage = isVideo
71
+ ? `This tool does not support content type: ${contentType}. Try analyseVideo tool instead for video files.`
72
+ : `Invalid content type: ${contentType}. URL must return an image (PNG, JPEG, GIF, WebP) or markdown file.`;
73
+ logger.warn("Unsupported content type", {
74
+ tool: "fetchFileTool",
75
+ url,
76
+ contentType,
77
+ isVideo,
78
+ });
57
79
  return {
58
80
  result: errorMessage,
59
81
  isError: true,
60
82
  };
61
83
  }
84
+ const contentResponse = await fetch(url);
62
85
  if (isImage) {
63
- const buffer = await response.arrayBuffer();
64
- const base64 = Buffer.from(buffer).toString("base64");
86
+ const buffer = await contentResponse.arrayBuffer();
87
+ const processedBuffer = await (0, utils_1.downscaleImageIfNeeded)(buffer, logger);
88
+ const base64 = Buffer.from(processedBuffer).toString("base64");
89
+ logger.info("Successfully fetched image file", {
90
+ tool: "fetchFileTool",
91
+ url,
92
+ contentType,
93
+ size: processedBuffer.byteLength,
94
+ });
65
95
  return {
66
96
  result: [
67
97
  {
@@ -74,7 +104,13 @@ time of test failures. Both of these are available in the attachments section of
74
104
  }
75
105
  else {
76
106
  // Handle text/markdown files
77
- const text = await response.text();
107
+ const text = await contentResponse.text();
108
+ logger.info("Successfully fetched text file", {
109
+ tool: "fetchFileTool",
110
+ url,
111
+ contentType,
112
+ size: text.length,
113
+ });
78
114
  return {
79
115
  result: [
80
116
  {
@@ -87,7 +123,11 @@ time of test failures. Both of these are available in the attachments section of
87
123
  }
88
124
  }
89
125
  catch (error) {
90
- console.error("Error fetching file", error);
126
+ logger.error("Error fetching file", {
127
+ tool: "fetchFileTool",
128
+ url,
129
+ error,
130
+ });
91
131
  return {
92
132
  result: `Error fetching file: ${error}`,
93
133
  isError: true,
@@ -0,0 +1,3 @@
1
+ import { Logger } from "@empiricalrun/shared-types/chat-agent";
2
+ export declare function downscaleImageIfNeeded(buffer: ArrayBuffer, logger: Logger): Promise<ArrayBuffer>;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/fetch-file/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AA6I/D,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,CAWtB"}