@empiricalrun/test-gen 0.78.0 → 0.78.2

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 (406) hide show
  1. package/CHANGELOG.md +19 -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 -4
  13. package/dist/agent/chat/exports.d.ts.map +1 -1
  14. package/dist/agent/chat/exports.js +5 -11
  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 +12 -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 +24 -13
  44. package/dist/agent/cua/pw-codegen/factory.d.ts +15 -0
  45. package/dist/agent/cua/pw-codegen/factory.d.ts.map +1 -0
  46. package/dist/agent/cua/pw-codegen/factory.js +59 -0
  47. package/dist/agent/cua/pw-codegen/index.d.ts +7 -0
  48. package/dist/agent/cua/pw-codegen/index.d.ts.map +1 -0
  49. package/dist/agent/cua/pw-codegen/index.js +14 -0
  50. package/dist/agent/cua/pw-codegen/pw-event-sink/index.d.ts +43 -0
  51. package/dist/agent/cua/pw-codegen/pw-event-sink/index.d.ts.map +1 -0
  52. package/dist/agent/cua/pw-codegen/pw-event-sink/index.js +250 -0
  53. package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.d.ts.map +1 -1
  54. package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.js +0 -3
  55. package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts +1 -1
  56. package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts.map +1 -1
  57. package/dist/agent/cua/pw-codegen/pw-pause/index.js +7 -3
  58. package/dist/agent/cua/pw-codegen/pw-pause/patch.d.ts +15 -3
  59. package/dist/agent/cua/pw-codegen/pw-pause/patch.d.ts.map +1 -1
  60. package/dist/agent/cua/pw-codegen/pw-pause/patch.js +38 -10
  61. package/dist/agent/cua/pw-codegen/version.d.ts +25 -0
  62. package/dist/agent/cua/pw-codegen/version.d.ts.map +1 -0
  63. package/dist/agent/cua/pw-codegen/version.js +86 -0
  64. package/dist/agent/index.d.ts +1 -5
  65. package/dist/agent/index.d.ts.map +1 -1
  66. package/dist/agent/index.js +1 -11
  67. package/dist/agent/master/element-annotation.d.ts +1 -1
  68. package/dist/agent/master/element-annotation.d.ts.map +1 -1
  69. package/dist/agent/master/next-action.d.ts +1 -1
  70. package/dist/agent/master/next-action.d.ts.map +1 -1
  71. package/dist/agent/master/next-action.js +1 -6
  72. package/dist/agent/master/run.d.ts +3 -2
  73. package/dist/agent/master/run.d.ts.map +1 -1
  74. package/dist/agent/master/run.js +0 -26
  75. package/dist/agent/triage/index.d.ts +4 -3
  76. package/dist/agent/triage/index.d.ts.map +1 -1
  77. package/dist/agent/triage/index.js +33 -20
  78. package/dist/artifacts/index.d.ts +1 -1
  79. package/dist/artifacts/index.d.ts.map +1 -1
  80. package/dist/artifacts/utils.d.ts +1 -1
  81. package/dist/artifacts/utils.d.ts.map +1 -1
  82. package/dist/bin/environments.d.ts +1 -1
  83. package/dist/bin/environments.d.ts.map +1 -1
  84. package/dist/bin/index.js +2 -2
  85. package/dist/bin/setup.d.ts +1 -1
  86. package/dist/bin/setup.d.ts.map +1 -1
  87. package/dist/bin/utils/fs/index.d.ts +1 -1
  88. package/dist/bin/utils/fs/index.d.ts.map +1 -1
  89. package/dist/bin/utils/platform/web/index.d.ts +2 -2
  90. package/dist/bin/utils/platform/web/index.d.ts.map +1 -1
  91. package/dist/bin/utils/platform/web/index.js +1 -1
  92. package/dist/bin/utils/scenarios/index.d.ts +1 -1
  93. package/dist/bin/utils/scenarios/index.d.ts.map +1 -1
  94. package/dist/constants/index.d.ts +0 -4
  95. package/dist/constants/index.d.ts.map +1 -1
  96. package/dist/constants/index.js +0 -6
  97. package/dist/dashboard/client.d.ts +1 -1
  98. package/dist/dashboard/client.d.ts.map +1 -1
  99. package/dist/dashboard/index.d.ts +1 -0
  100. package/dist/dashboard/index.d.ts.map +1 -1
  101. package/dist/dashboard/index.js +4 -1
  102. package/dist/dashboard/tool-response.d.ts +5 -0
  103. package/dist/dashboard/tool-response.d.ts.map +1 -0
  104. package/dist/dashboard/tool-response.js +88 -0
  105. package/dist/dashboard/totp.js +1 -1
  106. package/dist/file/server.d.ts +1 -1
  107. package/dist/file/server.d.ts.map +1 -1
  108. package/dist/file/server.js +2 -1
  109. package/dist/file-info/adapters/file-system/index.d.ts +1 -1
  110. package/dist/file-info/adapters/file-system/index.d.ts.map +1 -1
  111. package/dist/file-info/adapters/file-system/reader.d.ts +1 -1
  112. package/dist/file-info/adapters/file-system/reader.d.ts.map +1 -1
  113. package/dist/file-info/adapters/github/index.d.ts +2 -1
  114. package/dist/file-info/adapters/github/index.d.ts.map +1 -1
  115. package/dist/file-info/adapters/github/reader.d.ts +2 -1
  116. package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
  117. package/dist/recorder/index.d.ts.map +1 -1
  118. package/dist/recorder/index.js +9 -3
  119. package/dist/recorder/upload.d.ts +1 -1
  120. package/dist/recorder/upload.d.ts.map +1 -1
  121. package/dist/tools/analyse-video/index.d.ts +1 -1
  122. package/dist/tools/analyse-video/index.d.ts.map +1 -1
  123. package/dist/tools/analyse-video/index.js +20 -13
  124. package/dist/tools/create-pull-request/index.d.ts +1 -1
  125. package/dist/tools/create-pull-request/index.d.ts.map +1 -1
  126. package/dist/tools/create-pull-request/utils.d.ts +3 -2
  127. package/dist/tools/create-pull-request/utils.d.ts.map +1 -1
  128. package/dist/tools/definitions/analyse-video.d.ts +5 -37
  129. package/dist/tools/definitions/analyse-video.d.ts.map +1 -1
  130. package/dist/tools/definitions/analyse-video.js +12 -25
  131. package/dist/tools/definitions/delete-file.d.ts +5 -1
  132. package/dist/tools/definitions/delete-file.d.ts.map +1 -1
  133. package/dist/tools/definitions/delete-file.js +3 -3
  134. package/dist/tools/definitions/download-build.d.ts +2 -6
  135. package/dist/tools/definitions/download-build.d.ts.map +1 -1
  136. package/dist/tools/definitions/grep.d.ts +1 -1
  137. package/dist/tools/definitions/grep.d.ts.map +1 -1
  138. package/dist/tools/definitions/list-tests-and-projects.d.ts +2 -6
  139. package/dist/tools/definitions/list-tests-and-projects.d.ts.map +1 -1
  140. package/dist/tools/definitions/list-tests-and-projects.js +1 -1
  141. package/dist/tools/definitions/merge-conflicts.d.ts +1 -1
  142. package/dist/tools/definitions/merge-conflicts.d.ts.map +1 -1
  143. package/dist/tools/definitions/merge-conflicts.js +2 -2
  144. package/dist/tools/definitions/rename-file.d.ts +1 -1
  145. package/dist/tools/definitions/rename-file.d.ts.map +1 -1
  146. package/dist/tools/definitions/review-pull-request.d.ts +1 -1
  147. package/dist/tools/definitions/review-pull-request.d.ts.map +1 -1
  148. package/dist/tools/definitions/review-pull-request.js +1 -1
  149. package/dist/tools/definitions/run-test.d.ts +3 -15
  150. package/dist/tools/definitions/run-test.d.ts.map +1 -1
  151. package/dist/tools/definitions/safe-bash.d.ts +8 -0
  152. package/dist/tools/definitions/safe-bash.d.ts.map +1 -0
  153. package/dist/tools/definitions/safe-bash.js +32 -0
  154. package/dist/tools/definitions/str_replace_editor.d.ts +1 -1
  155. package/dist/tools/definitions/str_replace_editor.d.ts.map +1 -1
  156. package/dist/tools/definitions/test-gen-browser.d.ts +3 -15
  157. package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
  158. package/dist/tools/definitions/upgrade-packages.d.ts +4 -26
  159. package/dist/tools/definitions/upgrade-packages.d.ts.map +1 -1
  160. package/dist/tools/definitions/utils.d.ts +2 -10
  161. package/dist/tools/definitions/utils.d.ts.map +1 -1
  162. package/dist/tools/definitions/utils.js +1 -1
  163. package/dist/tools/delete-file/index.d.ts +1 -1
  164. package/dist/tools/delete-file/index.d.ts.map +1 -1
  165. package/dist/tools/delete-file/index.js +6 -2
  166. package/dist/tools/diagnosis-fetcher.d.ts +1 -1
  167. package/dist/tools/diagnosis-fetcher.d.ts.map +1 -1
  168. package/dist/tools/diagnosis-fetcher.js +92 -47
  169. package/dist/tools/download-build/index.d.ts +1 -1
  170. package/dist/tools/download-build/index.d.ts.map +1 -1
  171. package/dist/tools/executor/base.d.ts +3 -2
  172. package/dist/tools/executor/base.d.ts.map +1 -1
  173. package/dist/tools/executor/base.js +5 -8
  174. package/dist/tools/executor/index.d.ts +3 -0
  175. package/dist/tools/executor/index.d.ts.map +1 -1
  176. package/dist/tools/executor/index.js +12 -10
  177. package/dist/tools/executor/utils/checkpoint.d.ts.map +1 -1
  178. package/dist/tools/executor/utils/checkpoint.js +0 -4
  179. package/dist/tools/executor/utils/git.d.ts +7 -1
  180. package/dist/tools/executor/utils/git.d.ts.map +1 -1
  181. package/dist/tools/executor/utils/git.js +10 -3
  182. package/dist/tools/executor/utils/index.d.ts +1 -2
  183. package/dist/tools/executor/utils/index.d.ts.map +1 -1
  184. package/dist/tools/executor/utils/index.js +0 -20
  185. package/dist/tools/executor/utils/pr-description.d.ts +1 -1
  186. package/dist/tools/executor/utils/pr-description.d.ts.map +1 -1
  187. package/dist/tools/fetch-file/index.d.ts +2 -6
  188. package/dist/tools/fetch-file/index.d.ts.map +1 -1
  189. package/dist/tools/fetch-file/index.js +53 -13
  190. package/dist/tools/fetch-file/utils.d.ts +3 -0
  191. package/dist/tools/fetch-file/utils.d.ts.map +1 -0
  192. package/dist/tools/fetch-file/utils.js +136 -0
  193. package/dist/tools/fetch-session-diff/index.d.ts +1 -1
  194. package/dist/tools/fetch-session-diff/index.d.ts.map +1 -1
  195. package/dist/tools/fetch-session-diff/index.js +26 -2
  196. package/dist/tools/file-operations/create.d.ts +1 -1
  197. package/dist/tools/file-operations/create.d.ts.map +1 -1
  198. package/dist/tools/file-operations/index.d.ts +2 -1
  199. package/dist/tools/file-operations/index.d.ts.map +1 -1
  200. package/dist/tools/file-operations/insert.d.ts +1 -1
  201. package/dist/tools/file-operations/insert.d.ts.map +1 -1
  202. package/dist/tools/file-operations/replace.d.ts +1 -1
  203. package/dist/tools/file-operations/replace.d.ts.map +1 -1
  204. package/dist/tools/file-operations/replace.js +0 -1
  205. package/dist/tools/file-operations/view/index.d.ts +2 -1
  206. package/dist/tools/file-operations/view/index.d.ts.map +1 -1
  207. package/dist/tools/firecrawl-scrape/index.d.ts +9 -0
  208. package/dist/tools/firecrawl-scrape/index.d.ts.map +1 -0
  209. package/dist/tools/firecrawl-scrape/index.js +107 -0
  210. package/dist/tools/grep/index.d.ts +1 -1
  211. package/dist/tools/grep/index.d.ts.map +1 -1
  212. package/dist/tools/grep/index.js +15 -12
  213. package/dist/tools/index.d.ts +5 -24
  214. package/dist/tools/index.d.ts.map +1 -1
  215. package/dist/tools/index.js +21 -42
  216. package/dist/tools/issues-v1/create-issue.d.ts +3 -0
  217. package/dist/tools/issues-v1/create-issue.d.ts.map +1 -0
  218. package/dist/tools/{issues → issues-v1}/create-issue.js +5 -9
  219. package/dist/tools/issues-v1/index.d.ts.map +1 -0
  220. package/dist/tools/issues-v1/list-issues.d.ts +3 -0
  221. package/dist/tools/issues-v1/list-issues.d.ts.map +1 -0
  222. package/dist/tools/issues-v1/update-issue.d.ts +3 -0
  223. package/dist/tools/issues-v1/update-issue.d.ts.map +1 -0
  224. package/dist/tools/{issues → issues-v1}/update-issue.js +1 -9
  225. package/dist/tools/{issues → issues-v1}/utils.d.ts +2 -1
  226. package/dist/tools/issues-v1/utils.d.ts.map +1 -0
  227. package/dist/tools/issues-v2/create-issue.d.ts +3 -0
  228. package/dist/tools/issues-v2/create-issue.d.ts.map +1 -0
  229. package/dist/tools/issues-v2/create-issue.js +82 -0
  230. package/dist/tools/issues-v2/set-issue-description.d.ts +3 -0
  231. package/dist/tools/issues-v2/set-issue-description.d.ts.map +1 -0
  232. package/dist/tools/issues-v2/set-issue-description.js +59 -0
  233. package/dist/tools/issues-v2/update-issue.d.ts +3 -0
  234. package/dist/tools/issues-v2/update-issue.d.ts.map +1 -0
  235. package/dist/tools/issues-v2/update-issue.js +85 -0
  236. package/dist/tools/list-environments.d.ts +1 -1
  237. package/dist/tools/list-environments.d.ts.map +1 -1
  238. package/dist/tools/list-tests-and-projects/index.d.ts +1 -1
  239. package/dist/tools/list-tests-and-projects/index.d.ts.map +1 -1
  240. package/dist/tools/list-tests-and-projects/index.js +14 -4
  241. package/dist/tools/merge-conflicts/index.d.ts +1 -1
  242. package/dist/tools/merge-conflicts/index.d.ts.map +1 -1
  243. package/dist/tools/merge-conflicts/index.js +23 -10
  244. package/dist/tools/rename-file/index.d.ts +1 -1
  245. package/dist/tools/rename-file/index.d.ts.map +1 -1
  246. package/dist/tools/rename-file/index.js +0 -1
  247. package/dist/tools/review-pull-request/index.d.ts +1 -1
  248. package/dist/tools/review-pull-request/index.d.ts.map +1 -1
  249. package/dist/tools/review-pull-request/index.js +5 -4
  250. package/dist/tools/run-test.d.ts +1 -1
  251. package/dist/tools/run-test.d.ts.map +1 -1
  252. package/dist/tools/safe-bash/index.d.ts +3 -0
  253. package/dist/tools/safe-bash/index.d.ts.map +1 -0
  254. package/dist/tools/safe-bash/index.js +128 -0
  255. package/dist/tools/test-gen-browser.d.ts +1 -1
  256. package/dist/tools/test-gen-browser.d.ts.map +1 -1
  257. package/dist/tools/test-gen-browser.js +64 -21
  258. package/dist/tools/test-run-fetcher/index.d.ts +2 -2
  259. package/dist/tools/test-run-fetcher/index.d.ts.map +1 -1
  260. package/dist/tools/test-run-fetcher/index.js +67 -66
  261. package/dist/tools/trace-dot-zip/index.d.ts +1 -1
  262. package/dist/tools/trace-dot-zip/index.d.ts.map +1 -1
  263. package/dist/tools/trace-dot-zip/utils/network-trace.d.ts.map +1 -1
  264. package/dist/tools/trace-dot-zip/utils/network-trace.js +5 -10
  265. package/dist/tools/triage-summary/index.d.ts +1 -1
  266. package/dist/tools/triage-summary/index.d.ts.map +1 -1
  267. package/dist/tools/triage-summary/index.js +5 -2
  268. package/dist/tools/triage-summary/utils.d.ts +1 -1
  269. package/dist/tools/triage-summary/utils.d.ts.map +1 -1
  270. package/dist/tools/upgrade-packages/index.d.ts +1 -1
  271. package/dist/tools/upgrade-packages/index.d.ts.map +1 -1
  272. package/dist/tools/upgrade-packages/index.js +14 -8
  273. package/dist/tools/upgrade-packages/utils.d.ts +9 -5
  274. package/dist/tools/upgrade-packages/utils.d.ts.map +1 -1
  275. package/dist/tools/upgrade-packages/utils.js +56 -16
  276. package/dist/tools/utils/queue.d.ts +1 -1
  277. package/dist/tools/utils/queue.d.ts.map +1 -1
  278. package/dist/tools/utils/validate-schema.d.ts +3 -0
  279. package/dist/tools/utils/validate-schema.d.ts.map +1 -0
  280. package/dist/tools/utils/validate-schema.js +27 -0
  281. package/dist/utils/SQSClient.d.ts +1 -1
  282. package/dist/utils/SQSClient.d.ts.map +1 -1
  283. package/dist/utils/dedup/dedup-image.js +2 -2
  284. package/dist/utils/dedup/find-threshold.d.ts +1 -1
  285. package/dist/utils/dedup/find-threshold.d.ts.map +1 -1
  286. package/dist/utils/dedup/find-threshold.js +2 -2
  287. package/dist/utils/model.d.ts +1 -1
  288. package/dist/utils/model.d.ts.map +1 -1
  289. package/dist/utils/model.js +6 -10
  290. package/dist/utils/playwright-report-parser.d.ts +1 -1
  291. package/dist/utils/playwright-report-parser.d.ts.map +1 -1
  292. package/dist/utils/playwright-test-id.d.ts +8 -0
  293. package/dist/utils/playwright-test-id.d.ts.map +1 -0
  294. package/dist/utils/playwright-test-id.js +21 -0
  295. package/dist/utils/repo-tree.d.ts +1 -1
  296. package/dist/utils/repo-tree.d.ts.map +1 -1
  297. package/dist/utils/slug.d.ts.map +1 -1
  298. package/dist/utils/slug.js +15 -4
  299. package/dist/utils/url-validation.d.ts +2 -0
  300. package/dist/utils/url-validation.d.ts.map +1 -0
  301. package/dist/utils/url-validation.js +16 -0
  302. package/dist/video-core/index.d.ts +7 -24
  303. package/dist/video-core/index.d.ts.map +1 -1
  304. package/dist/video-core/index.js +32 -25
  305. package/dist/video-core/model-limits.d.ts +2 -2
  306. package/dist/video-core/model-limits.d.ts.map +1 -1
  307. package/dist/video-core/model-limits.js +9 -19
  308. package/dist/video-core/storage-manager.d.ts +2 -1
  309. package/dist/video-core/storage-manager.d.ts.map +1 -1
  310. package/dist/video-core/types.d.ts +1 -1
  311. package/dist/video-core/types.d.ts.map +1 -1
  312. package/dist/video-core/utils.d.ts +5 -7
  313. package/dist/video-core/utils.d.ts.map +1 -1
  314. package/dist/video-core/utils.js +39 -132
  315. package/package.json +10 -6
  316. package/tsconfig.tsbuildinfo +1 -1
  317. package/dist/actions/skill.d.ts +0 -21
  318. package/dist/actions/skill.d.ts.map +0 -1
  319. package/dist/actions/skill.js +0 -127
  320. package/dist/agent/chat/filesystem-cache.d.ts +0 -12
  321. package/dist/agent/chat/filesystem-cache.d.ts.map +0 -1
  322. package/dist/agent/chat/filesystem-cache.js +0 -101
  323. package/dist/agent/codegen/create-test-block.d.ts +0 -8
  324. package/dist/agent/codegen/create-test-block.d.ts.map +0 -1
  325. package/dist/agent/codegen/create-test-block.js +0 -47
  326. package/dist/agent/codegen/fix-ts-errors.d.ts +0 -12
  327. package/dist/agent/codegen/fix-ts-errors.d.ts.map +0 -1
  328. package/dist/agent/codegen/fix-ts-errors.js +0 -78
  329. package/dist/agent/codegen/lexical-scoped-vars.d.ts +0 -9
  330. package/dist/agent/codegen/lexical-scoped-vars.d.ts.map +0 -1
  331. package/dist/agent/codegen/lexical-scoped-vars.js +0 -55
  332. package/dist/agent/codegen/skills-retriever.d.ts +0 -26
  333. package/dist/agent/codegen/skills-retriever.d.ts.map +0 -1
  334. package/dist/agent/codegen/skills-retriever.js +0 -93
  335. package/dist/agent/codegen/test-update-feedback.d.ts +0 -12
  336. package/dist/agent/codegen/test-update-feedback.d.ts.map +0 -1
  337. package/dist/agent/codegen/test-update-feedback.js +0 -49
  338. package/dist/agent/codegen/types.d.ts +0 -25
  339. package/dist/agent/codegen/types.d.ts.map +0 -1
  340. package/dist/agent/codegen/types.js +0 -8
  341. package/dist/agent/codegen/update-flow.d.ts +0 -36
  342. package/dist/agent/codegen/update-flow.d.ts.map +0 -1
  343. package/dist/agent/codegen/update-flow.js +0 -259
  344. package/dist/agent/codegen/use-skill.d.ts +0 -11
  345. package/dist/agent/codegen/use-skill.d.ts.map +0 -1
  346. package/dist/agent/codegen/use-skill.js +0 -53
  347. package/dist/agent/codegen/utils.d.ts +0 -110
  348. package/dist/agent/codegen/utils.d.ts.map +0 -1
  349. package/dist/agent/codegen/utils.js +0 -376
  350. package/dist/agent/master/browser-tests/skills.spec.d.ts +0 -2
  351. package/dist/agent/master/browser-tests/skills.spec.d.ts.map +0 -1
  352. package/dist/agent/master/browser-tests/skills.spec.js +0 -112
  353. package/dist/agent/master/execute-skill-action.d.ts +0 -11
  354. package/dist/agent/master/execute-skill-action.d.ts.map +0 -1
  355. package/dist/agent/master/execute-skill-action.js +0 -23
  356. package/dist/agent/video-analysis/executor/index.d.ts +0 -5
  357. package/dist/agent/video-analysis/executor/index.d.ts.map +0 -1
  358. package/dist/agent/video-analysis/executor/index.js +0 -10
  359. package/dist/agent/video-analysis/index.d.ts +0 -7
  360. package/dist/agent/video-analysis/index.d.ts.map +0 -1
  361. package/dist/agent/video-analysis/index.js +0 -60
  362. package/dist/evals/append-create-test-agent.evals.d.ts +0 -4
  363. package/dist/evals/append-create-test-agent.evals.d.ts.map +0 -1
  364. package/dist/evals/append-create-test-agent.evals.js +0 -117
  365. package/dist/evals/fetch-pom-skills-agent.evals.d.ts +0 -4
  366. package/dist/evals/fetch-pom-skills-agent.evals.d.ts.map +0 -1
  367. package/dist/evals/fetch-pom-skills-agent.evals.js +0 -36
  368. package/dist/evals/master-agent.evals.d.ts +0 -4
  369. package/dist/evals/master-agent.evals.d.ts.map +0 -1
  370. package/dist/evals/master-agent.evals.js +0 -35
  371. package/dist/evals/type.d.ts +0 -12
  372. package/dist/evals/type.d.ts.map +0 -1
  373. package/dist/evals/type.js +0 -2
  374. package/dist/evals/update-scenario-agent.evals.d.ts +0 -4
  375. package/dist/evals/update-scenario-agent.evals.d.ts.map +0 -1
  376. package/dist/evals/update-scenario-agent.evals.js +0 -47
  377. package/dist/tools/fetch-last-successful-test-run/index.d.ts +0 -3
  378. package/dist/tools/fetch-last-successful-test-run/index.d.ts.map +0 -1
  379. package/dist/tools/fetch-last-successful-test-run/index.js +0 -60
  380. package/dist/tools/issues/create-issue.d.ts +0 -3
  381. package/dist/tools/issues/create-issue.d.ts.map +0 -1
  382. package/dist/tools/issues/index.d.ts.map +0 -1
  383. package/dist/tools/issues/list-issues.d.ts +0 -3
  384. package/dist/tools/issues/list-issues.d.ts.map +0 -1
  385. package/dist/tools/issues/metadata-schema.d.ts +0 -24
  386. package/dist/tools/issues/metadata-schema.d.ts.map +0 -1
  387. package/dist/tools/issues/metadata-schema.js +0 -22
  388. package/dist/tools/issues/update-issue.d.ts +0 -3
  389. package/dist/tools/issues/update-issue.d.ts.map +0 -1
  390. package/dist/tools/issues/utils.d.ts.map +0 -1
  391. package/dist/tools/utils/urls.d.ts +0 -5
  392. package/dist/tools/utils/urls.d.ts.map +0 -1
  393. package/dist/tools/utils/urls.js +0 -19
  394. package/dist/tools/view-failed-test-run-report/index.d.ts +0 -12
  395. package/dist/tools/view-failed-test-run-report/index.d.ts.map +0 -1
  396. package/dist/tools/view-failed-test-run-report/index.js +0 -151
  397. package/dist/video-core/agent-orchestrator.d.ts +0 -13
  398. package/dist/video-core/agent-orchestrator.d.ts.map +0 -1
  399. package/dist/video-core/agent-orchestrator.js +0 -59
  400. package/dist/video-core/xml-parser.d.ts +0 -3
  401. package/dist/video-core/xml-parser.d.ts.map +0 -1
  402. package/dist/video-core/xml-parser.js +0 -27
  403. /package/dist/tools/{issues → issues-v1}/index.d.ts +0 -0
  404. /package/dist/tools/{issues → issues-v1}/index.js +0 -0
  405. /package/dist/tools/{issues → issues-v1}/list-issues.js +0 -0
  406. /package/dist/tools/{issues → issues-v1}/utils.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"network-trace.d.ts","sourceRoot":"","sources":["../../../../src/tools/trace-dot-zip/utils/network-trace.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAUlB,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,EACJ;YACE,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,MAAM,CAAC;SAChB,GACD,SAAS,CAAC;KACf,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,8BAIxC,KAAK,KAAG,OAAO,CAAC;IACjB,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC,0BAA0B,EAAE,sBAAsB,EAAE,CAAC;CACtD,CA+KA,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAU,UAElD,KAAK,KAAG,OAAO,CAAC;IACjB,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;IAC9C,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;CAC/C,CAyEA,CAAC;AAsBF,eAAO,MAAM,0CAA0C,GACrD,UAAU,sBAAsB,EAAE,KACjC,OAAO,CAAC,sBAAsB,CAAC,EAoBjC,CAAC;AAmCF,eAAO,MAAM,iBAAiB,GAC5B,UAAU,sBAAsB,EAAE,EAClC,QAAQ,MAAM,KACb,OAAO,CAAC,sBAAsB,EAAE,CA+BlC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,0CAA0C,sBAAsB,EAAE,KACjE,sBAAsB,EA2BxB,CAAC"}
1
+ {"version":3,"file":"network-trace.d.ts","sourceRoot":"","sources":["../../../../src/tools/trace-dot-zip/utils/network-trace.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAUlB,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,EACJ;YACE,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,MAAM,CAAC;SAChB,GACD,SAAS,CAAC;KACf,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,8BAIxC,KAAK,KAAG,OAAO,CAAC;IACjB,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC,0BAA0B,EAAE,sBAAsB,EAAE,CAAC;CACtD,CA+KA,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAU,UAElD,KAAK,KAAG,OAAO,CAAC;IACjB,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;IAC9C,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;CAC/C,CAkEA,CAAC;AAsBF,eAAO,MAAM,0CAA0C,GACrD,UAAU,sBAAsB,EAAE,KACjC,OAAO,CAAC,sBAAsB,CAAC,EAoBjC,CAAC;AAmCF,eAAO,MAAM,iBAAiB,GAC5B,UAAU,sBAAsB,EAAE,EAClC,QAAQ,MAAM,KACb,OAAO,CAAC,sBAAsB,EAAE,CA+BlC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,0CAA0C,sBAAsB,EAAE,KACjE,sBAAsB,EA2BxB,CAAC"}
@@ -147,10 +147,10 @@ const generateNetworkTraceFromZipUrl = async ({ url, }) => {
147
147
  const hasValidResponseStatus = !!parsedNetworkTrace?.snapshot?.response?.status;
148
148
  const responseStatus = Number(parsedNetworkTrace?.snapshot?.response?.status);
149
149
  allNetworkCalls.push(parsedNetworkTrace);
150
- // only failures & redirects for detailed analysis
150
+ // only failures for detailed analysis
151
151
  if (hasValidResponseStatus &&
152
- (responseStatus === 308 ||
153
- (400 <= responseStatus && responseStatus < 600))) {
152
+ 400 <= responseStatus &&
153
+ responseStatus < 600) {
154
154
  relevantNetworkCalls.push(parsedNetworkTrace);
155
155
  }
156
156
  });
@@ -165,13 +165,8 @@ const generateNetworkTraceFromZipUrl = async ({ url, }) => {
165
165
  const sequenceCalls = allNetworkCalls.filter((c) => {
166
166
  const hasValidResponseStatus = !!c.snapshot.response.status;
167
167
  const status = Number(c.snapshot.response.status);
168
- return (hasValidResponseStatus &&
169
- ((400 <= status && status < 600) ||
170
- status === 307 ||
171
- status === 308 ||
172
- status === 301 ||
173
- status === 302));
174
- // excluding: 304 (cached), 2xx success
168
+ return hasValidResponseStatus && 400 <= status && status < 600;
169
+ // excluding: 304 (cached), 2xx success, 3xx redirects
175
170
  });
176
171
  const networkCallSequence = (0, exports.buildNetworkCallSequence)(sequenceCalls);
177
172
  const formattedFailedCalls = failedCalls.map(formatNetworkFailure);
@@ -1,3 +1,3 @@
1
- import { Tool } from "@empiricalrun/shared-types";
1
+ import { Tool } from "@empiricalrun/shared-types/chat-agent";
2
2
  export declare const sendTriageSummaryTool: Tool;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/triage-summary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,4BAA4B,CAAC;AAmB9D,eAAO,MAAM,qBAAqB,EAAE,IA6CnC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/triage-summary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAEL,MAAM,uCAAuC,CAAC;AAmB/C,eAAO,MAAM,qBAAqB,EAAE,IA0DnC,CAAC"}
@@ -19,7 +19,7 @@ exports.sendTriageSummaryTool = {
19
19
  },
20
20
  needsBrowser: false,
21
21
  isInlineTool: true,
22
- execute: async ({ input, apiClient, chatSession }) => {
22
+ execute: async ({ input, apiClient, chatSession, logger, }) => {
23
23
  try {
24
24
  const triagedIssuesList = input.issues;
25
25
  if (!triagedIssuesList) {
@@ -41,7 +41,10 @@ exports.sendTriageSummaryTool = {
41
41
  };
42
42
  }
43
43
  catch (error) {
44
- console.error("Error sending triage summary to slack", error);
44
+ logger.error("Error sending triage summary to slack", {
45
+ tool: "sendTriageSummaryTool",
46
+ error,
47
+ });
45
48
  return {
46
49
  isError: true,
47
50
  result: error instanceof Error ? error.message : String(error),
@@ -1,4 +1,4 @@
1
- import { IDashboardAPIClient } from "@empiricalrun/shared-types";
1
+ import { IDashboardAPIClient } from "@empiricalrun/shared-types/api/base";
2
2
  import { TriagedIssue } from "./types";
3
3
  export declare const triggerSlackMessageWithTriageSummary: (issues: TriagedIssue[], apiClient: IDashboardAPIClient, chatSessionId: number) => Promise<string>;
4
4
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/triage-summary/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,oCAAoC,GAC/C,QAAQ,YAAY,EAAE,EACtB,WAAW,mBAAmB,EAC9B,eAAe,MAAM,KACpB,OAAO,CAAC,MAAM,CAahB,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/triage-summary/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,oCAAoC,GAC/C,QAAQ,YAAY,EAAE,EACtB,WAAW,mBAAmB,EAC9B,eAAe,MAAM,KACpB,OAAO,CAAC,MAAM,CAahB,CAAC"}
@@ -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 upgradePackagesTool: Tool;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAoBvD,eAAO,MAAM,mBAAmB,EAAE,IA8HjC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAmBlE,eAAO,MAAM,mBAAmB,EAAE,IAqIjC,CAAC"}
@@ -14,13 +14,13 @@ const pr_description_1 = require("../executor/utils/pr-description");
14
14
  const utils_2 = require("./utils");
15
15
  exports.upgradePackagesTool = {
16
16
  ...upgrade_packages_1.upgradePackagesTool,
17
- execute: async ({ input, repoPath, apiClient, chatSession }) => {
17
+ execute: async ({ input, repoPath, apiClient, chatSession, logger }) => {
18
18
  const { packages: packagesToUpdate } = input;
19
19
  try {
20
- const repoName = path_1.default.basename(repoPath);
21
20
  const branchName = await (0, git_1.getCurrentBranchName)(repoPath);
22
21
  const packageJsonPath = path_1.default.join(repoPath, "package.json");
23
22
  const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, "utf-8"));
23
+ const repoName = packageJson.name;
24
24
  const changes = [];
25
25
  for (let { name: pkgName, version } of packagesToUpdate) {
26
26
  const isDevDep = !!packageJson.devDependencies?.[pkgName];
@@ -30,11 +30,12 @@ exports.upgradePackagesTool = {
30
30
  pkgName,
31
31
  version,
32
32
  isDevDep,
33
+ logger: logger,
33
34
  });
34
35
  changes.push(updatedPackage);
35
36
  }
36
37
  catch (err) {
37
- console.error(`Failed to upgrade ${pkgName}:`, err);
38
+ logger.error("Failed to upgrade package", { pkgName, error: err });
38
39
  return {
39
40
  result: `Failed to upgrade ${pkgName}: ${err.message}`,
40
41
  isError: true,
@@ -83,9 +84,14 @@ exports.upgradePackagesTool = {
83
84
  if (!pr.number) {
84
85
  throw new Error("Failed to create PR");
85
86
  }
86
- shouldMerge = await (0, utils_2.shouldMergePR)({ repoName, prNumber, apiClient });
87
+ shouldMerge = await (0, utils_2.shouldMergePR)({
88
+ repoName,
89
+ prNumber,
90
+ apiClient,
91
+ logger: logger,
92
+ });
87
93
  if (shouldMerge) {
88
- console.log("All changes are patch updates, proceeding with merge");
94
+ logger.info("All changes are patch updates, proceeding with merge");
89
95
  merged = await (0, git_1.mergePullRequest)({
90
96
  repoName,
91
97
  prNumber,
@@ -93,11 +99,11 @@ exports.upgradePackagesTool = {
93
99
  });
94
100
  }
95
101
  else {
96
- console.log(`PR #${prNumber} created but not merged - contains non-patch updates`);
102
+ logger.info("PR created but not merged - contains non-patch updates", { prNumber });
97
103
  }
98
104
  }
99
105
  catch (error) {
100
- console.error("Failed to handle PR operations:", error);
106
+ logger.error("Failed to handle PR operations", { error });
101
107
  const prLink = prNumber
102
108
  ? ` PR: https://github.com/empirical-run/${repoName}/pull/${prNumber}`
103
109
  : "";
@@ -118,7 +124,7 @@ exports.upgradePackagesTool = {
118
124
  };
119
125
  }
120
126
  catch (error) {
121
- console.error("Failed to upgrade packages:", error);
127
+ logger.error("Failed to upgrade packages", { error });
122
128
  return {
123
129
  result: `Failed to upgrade packages: ${error.message}`,
124
130
  isError: true,
@@ -1,22 +1,26 @@
1
- import { IDashboardAPIClient } from "@empiricalrun/shared-types";
1
+ import { IDashboardAPIClient } from "@empiricalrun/shared-types/api/base";
2
+ import { Logger } from "@empiricalrun/shared-types/chat-agent";
2
3
  export declare function isPatchUpdate(currentVersion: string | undefined, newVersion: string | undefined): boolean;
3
- export declare function getLatestVersion(packageName: string): Promise<any>;
4
- export declare function parsePackageJsonDiff({ diff, }: {
4
+ export declare function getLatestVersion(packageName: string, logger: Logger): Promise<any>;
5
+ export declare function parsePackageJsonDiff({ diff, logger, }: {
5
6
  diff: string;
7
+ logger: Logger;
6
8
  }): Record<string, {
7
9
  old?: string;
8
10
  new?: string;
9
11
  }>;
10
- export declare function shouldMergePR({ repoName, prNumber, apiClient, }: {
12
+ export declare function shouldMergePR({ repoName, prNumber, apiClient, logger, }: {
11
13
  repoName: string;
12
14
  prNumber: number;
13
15
  apiClient: IDashboardAPIClient;
16
+ logger: Logger;
14
17
  }): Promise<boolean>;
15
- export declare function upgradeAndStagePackage({ repoPath, pkgName, version, isDevDep, }: {
18
+ export declare function upgradeAndStagePackage({ repoPath, pkgName, version, isDevDep, logger, }: {
16
19
  repoPath: string;
17
20
  pkgName: string;
18
21
  version?: string;
19
22
  isDevDep: boolean;
23
+ logger: Logger;
20
24
  }): Promise<{
21
25
  name: string;
22
26
  version: any;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,wBAAgB,aAAa,CAC3B,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAWT;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,gBAkBzD;AA4BD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAuBjD;AAED,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,mBAAmB,CAAC;CAChC,oBA8BA;AAED,wBAAsB,sBAAsB,CAAC,EAC3C,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;;;GAcA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAG/D,wBAAgB,aAAa,CAC3B,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAWT;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBA0BzE;AAkCD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,MAAM,GACP,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA0BjD;AAED,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,mBAAmB,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CAChB,oBAkDA;AAED,wBAAsB,sBAAsB,CAAC,EAC3C,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;;;GAqBA"}
@@ -16,7 +16,7 @@ function isPatchUpdate(currentVersion, newVersion) {
16
16
  const next = newVersion.replace(/^[\^~]/, "").split(".");
17
17
  return (current[0] === next[0] && current[1] === next[1] && current[2] !== next[2]);
18
18
  }
19
- async function getLatestVersion(packageName) {
19
+ async function getLatestVersion(packageName, logger) {
20
20
  const url = `https://registry.npmjs.org/${packageName}/latest`;
21
21
  try {
22
22
  const response = await fetch(url);
@@ -27,15 +27,23 @@ async function getLatestVersion(packageName) {
27
27
  throw new Error(errorMsg);
28
28
  }
29
29
  const packageInfo = await response.json();
30
- console.log(`Latest version of ${packageName}: ${packageInfo.version}`);
30
+ logger.info(`Latest version of ${packageName}: ${packageInfo.version}`, {
31
+ tool: "upgradePackages",
32
+ packageName,
33
+ version: packageInfo.version,
34
+ });
31
35
  return packageInfo.version;
32
36
  }
33
37
  catch (error) {
34
- console.error(`Error fetching package info: ${error.message}`);
38
+ logger.error(`Error fetching package info: ${error.message}`, {
39
+ tool: "upgradePackages",
40
+ packageName,
41
+ error,
42
+ });
35
43
  throw error;
36
44
  }
37
45
  }
38
- async function getGitDiffForPackageJson({ repoName, prNumber, apiClient, }) {
46
+ async function getGitDiffForPackageJson({ repoName, prNumber, apiClient, logger, }) {
39
47
  const files = await apiClient.callGitHubProxy({
40
48
  method: "GET",
41
49
  url: `/repos/empirical-run/${repoName}/pulls/${prNumber}/files`,
@@ -45,12 +53,16 @@ async function getGitDiffForPackageJson({ repoName, prNumber, apiClient, }) {
45
53
  }
46
54
  const packageJsonChanges = files.find((file) => file.filename === "package.json");
47
55
  if (!packageJsonChanges) {
48
- console.log("No package.json changes found in PR");
56
+ logger.info("No package.json changes found in PR", {
57
+ tool: "upgradePackages",
58
+ repoName,
59
+ prNumber,
60
+ });
49
61
  return null;
50
62
  }
51
63
  return packageJsonChanges.patch;
52
64
  }
53
- function parsePackageJsonDiff({ diff, }) {
65
+ function parsePackageJsonDiff({ diff, logger, }) {
54
66
  const patchLines = diff.split("\n");
55
67
  const changes = {};
56
68
  for (let i = 0; i < patchLines.length; i++) {
@@ -60,7 +72,10 @@ function parsePackageJsonDiff({ diff, }) {
60
72
  if (match) {
61
73
  const [, pkg, version] = match;
62
74
  if (!pkg) {
63
- console.warn("No package name found in line:", line);
75
+ logger.warn("No package name found in line:", {
76
+ tool: "upgradePackages",
77
+ line,
78
+ });
64
79
  continue;
65
80
  }
66
81
  const changeType = line.startsWith("+") ? "new" : "old";
@@ -72,38 +87,63 @@ function parsePackageJsonDiff({ diff, }) {
72
87
  }
73
88
  return changes;
74
89
  }
75
- async function shouldMergePR({ repoName, prNumber, apiClient, }) {
90
+ async function shouldMergePR({ repoName, prNumber, apiClient, logger, }) {
76
91
  const gitDiff = await getGitDiffForPackageJson({
77
92
  repoName,
78
93
  prNumber,
79
94
  apiClient,
95
+ logger,
80
96
  });
81
97
  if (!gitDiff) {
82
- console.log("No package.json changes found, skipping merge");
98
+ logger.info("No package.json changes found, skipping merge", {
99
+ tool: "upgradePackages",
100
+ repoName,
101
+ prNumber,
102
+ });
83
103
  return false;
84
104
  }
85
- const changes = parsePackageJsonDiff({ diff: gitDiff });
105
+ const changes = parsePackageJsonDiff({ diff: gitDiff, logger });
86
106
  if (Object.keys(changes).length === 0) {
87
- console.log("No package.json changes found, skipping merge");
107
+ logger.info("No package.json changes found, skipping merge", {
108
+ tool: "upgradePackages",
109
+ repoName,
110
+ prNumber,
111
+ });
88
112
  return false;
89
113
  }
90
114
  let allPatchUpdates = true;
91
115
  for (const [pkg, versions] of Object.entries(changes)) {
92
116
  const { old: oldVersion, new: newVersion } = versions;
93
117
  if (!isPatchUpdate(oldVersion, newVersion)) {
94
- console.log(`${pkg}: ${oldVersion} -> ${newVersion} is not a patch update`);
118
+ logger.info(`${pkg}: ${oldVersion} -> ${newVersion} is not a patch update`, {
119
+ tool: "upgradePackages",
120
+ package: pkg,
121
+ oldVersion,
122
+ newVersion,
123
+ });
95
124
  allPatchUpdates = false;
96
125
  }
97
126
  else {
98
- console.log(`${pkg}: ${oldVersion} -> ${newVersion} is a patch update`);
127
+ logger.info(`${pkg}: ${oldVersion} -> ${newVersion} is a patch update`, {
128
+ tool: "upgradePackages",
129
+ package: pkg,
130
+ oldVersion,
131
+ newVersion,
132
+ });
99
133
  }
100
134
  }
101
135
  return allPatchUpdates;
102
136
  }
103
- async function upgradeAndStagePackage({ repoPath, pkgName, version, isDevDep, }) {
104
- const pkgVersion = version ?? (await getLatestVersion(pkgName));
137
+ async function upgradeAndStagePackage({ repoPath, pkgName, version, isDevDep, logger, }) {
138
+ const pkgVersion = version ?? (await getLatestVersion(pkgName, logger));
105
139
  (0, child_process_1.execSync)(`npm i ${pkgName}@${pkgVersion} ${isDevDep ? "--save-dev" : "--save"}`, { cwd: repoPath });
106
- console.log(`Updated package: ${pkgName} version to ${pkgVersion} in ${repoPath}`);
140
+ logger.info(`Updated package: ${pkgName} version to ${pkgVersion} in ${repoPath}`, {
141
+ tool: "upgradePackages",
142
+ pkgName,
143
+ pkgVersion,
144
+ repoPath,
145
+ isDevDep,
146
+ });
107
147
  (0, child_process_1.execSync)("git add package.json package-lock.json", { cwd: repoPath });
108
148
  return {
109
149
  name: pkgName,
@@ -1,4 +1,4 @@
1
- import { PendingToolCall } from "@empiricalrun/shared-types";
1
+ import { PendingToolCall } from "@empiricalrun/shared-types/chat-agent";
2
2
  export declare function appendSuffixToQueueUrl(queueUrl: string, suffix: string): string;
3
3
  export declare function replaceRegionInUrl(url: string, newRegion: string): string;
4
4
  export declare function getQueueUrl(toolCalls: PendingToolCall[], needsBrowser: boolean): string;
@@ -1 +1 @@
1
- {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAKR;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzE;AAkBD,wBAAgB,WAAW,CACzB,SAAS,EAAE,eAAe,EAAE,EAC5B,YAAY,EAAE,OAAO,GACpB,MAAM,CAeR"}
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAKR;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzE;AAkBD,wBAAgB,WAAW,CACzB,SAAS,EAAE,eAAe,EAAE,EAC5B,YAAY,EAAE,OAAO,GACpB,MAAM,CAeR"}
@@ -0,0 +1,3 @@
1
+ import { PendingToolCall, ToolResult } from "@empiricalrun/shared-types/chat-agent";
2
+ export declare function validateToolInput<T>(toolCall: PendingToolCall, schema: T): ToolResult | null;
3
+ //# sourceMappingURL=validate-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-schema.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/validate-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACX,MAAM,uCAAuC,CAAC;AAG/C,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,CAAC,GACR,UAAU,GAAG,IAAI,CA2BnB"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateToolInput = validateToolInput;
4
+ const zod_1 = require("zod");
5
+ function validateToolInput(toolCall, schema) {
6
+ const { name: toolName, input } = toolCall;
7
+ // Zod v4: Objects use "strip" mode by default (strips unknown keys silently)
8
+ // Apply .strict() to reject unknown keys for tool validation
9
+ let validationSchema = schema;
10
+ // Check if this is a ZodObject and apply strict mode
11
+ if (validationSchema instanceof zod_1.ZodObject) {
12
+ validationSchema = validationSchema.strict();
13
+ }
14
+ const validation = validationSchema.safeParse(input);
15
+ if (!validation.success) {
16
+ const errorMessage = [
17
+ `Schema validation failed for tool "${toolName}".`,
18
+ `\nValidation errors: ${JSON.stringify(validation.error.issues, null, 2)}`,
19
+ ].join("\n");
20
+ return {
21
+ isError: true,
22
+ result: errorMessage,
23
+ artifacts: null,
24
+ };
25
+ }
26
+ return null;
27
+ }
@@ -1,4 +1,4 @@
1
- import { ServicePayload } from "@empiricalrun/shared-types";
1
+ import { ServicePayload } from "@empiricalrun/shared-types/tool-execute-service";
2
2
  export declare class SQSClient {
3
3
  private region;
4
4
  private accessKeyId;
@@ -1 +1 @@
1
- {"version":3,"file":"SQSClient.d.ts","sourceRoot":"","sources":["../../src/utils/SQSClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAC,CAAS;gBAG5B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EACvB,YAAY,CAAC,EAAE,MAAM;YAQT,MAAM;YAON,UAAU;YAkBV,eAAe;YAgBf,IAAI;IASZ,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAyG5E"}
1
+ {"version":3,"file":"SQSClient.d.ts","sourceRoot":"","sources":["../../src/utils/SQSClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAC,CAAS;gBAG5B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EACvB,YAAY,CAAC,EAAE,MAAM;YAQT,MAAM;YAON,UAAU;YAkBV,eAAe;YAgBf,IAAI;IASZ,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAyG5E"}
@@ -16,8 +16,8 @@ async function deduplicateImages({ base64Images, threshold, logPrefix = "dedup-i
16
16
  previousImage = currentImage.image;
17
17
  continue;
18
18
  }
19
- const similarity = await (0, find_threshold_1.findSimilarityPercentage)(previousImage, currentImage.image);
20
- if (similarity < threshold) {
19
+ const diffFraction = await (0, find_threshold_1.findDiffFraction)(previousImage, currentImage.image);
20
+ if (diffFraction > threshold) {
21
21
  uniqueImages.push(currentImage);
22
22
  previousImage = currentImage.image;
23
23
  }
@@ -1,2 +1,2 @@
1
- export declare function findSimilarityPercentage(base64Image1: string, base64Image2: string): Promise<number>;
1
+ export declare function findDiffFraction(base64Image1: string, base64Image2: string): Promise<number>;
2
2
  //# sourceMappingURL=find-threshold.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"find-threshold.d.ts","sourceRoot":"","sources":["../../../src/utils/dedup/find-threshold.ts"],"names":[],"mappings":"AAsCA,wBAAsB,wBAAwB,CAC5C,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CASjB"}
1
+ {"version":3,"file":"find-threshold.d.ts","sourceRoot":"","sources":["../../../src/utils/dedup/find-threshold.ts"],"names":[],"mappings":"AAsCA,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CASjB"}
@@ -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.findSimilarityPercentage = findSimilarityPercentage;
6
+ exports.findDiffFraction = findDiffFraction;
7
7
  const pixelmatch_1 = __importDefault(require("pixelmatch"));
8
8
  const sharp_1 = __importDefault(require("sharp"));
9
9
  async function compareImageBuffers(buffer1, buffer2, pixelmatchThreshold) {
@@ -29,7 +29,7 @@ async function compareImageBuffers(buffer1, buffer2, pixelmatchThreshold) {
29
29
  const diffFraction = diffPixels / totalPixels;
30
30
  return { diffPixels, totalPixels, diffFraction };
31
31
  }
32
- async function findSimilarityPercentage(base64Image1, base64Image2) {
32
+ async function findDiffFraction(base64Image1, base64Image2) {
33
33
  try {
34
34
  const buffer1 = Buffer.from(base64Image1, "base64");
35
35
  const buffer2 = Buffer.from(base64Image2, "base64");
@@ -1,3 +1,3 @@
1
- import { SupportedChatModels } from "@empiricalrun/shared-types";
1
+ import { SupportedChatModels } from "@empiricalrun/shared-types/chat-agent";
2
2
  export declare const CLI_ARGS_TO_MODEL_MAP: Record<string, SupportedChatModels>;
3
3
  //# sourceMappingURL=model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/utils/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAoBrE,CAAC"}
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/utils/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAcrE,CAAC"}
@@ -4,17 +4,13 @@ exports.CLI_ARGS_TO_MODEL_MAP = void 0;
4
4
  exports.CLI_ARGS_TO_MODEL_MAP = {
5
5
  "claude-4": "claude-sonnet-4-20250514",
6
6
  "claude-4-5": "claude-sonnet-4-5-20250929",
7
- "claude-opus-4": "claude-opus-4-20250514",
8
- "claude-sonnet-4": "claude-sonnet-4-20250514",
9
- "claude-sonnet-4-5": "claude-sonnet-4-5-20250929",
10
- "claude-haiku": "claude-3-5-haiku-20241022",
11
- "claude-haiku-3-5": "claude-3-5-haiku-20241022",
12
- gemini: "gemini-2.5-pro",
7
+ "claude-opus": "claude-opus-4-5-20251101",
8
+ "claude-sonnet": "claude-sonnet-4-5-20250929",
9
+ "claude-haiku": "claude-haiku-4-5-20251001",
13
10
  "gemini-2.5": "gemini-2.5-pro",
14
11
  "gemini-2.5-pro": "gemini-2.5-pro",
15
- o3: "o3-2025-04-16",
16
- "o3-2025-04-16": "o3-2025-04-16",
12
+ "gemini-3": "gemini-3-pro-preview",
13
+ "gemini-3-pro": "gemini-3-pro-preview",
17
14
  "gpt-5": "gpt-5-2025-08-07",
18
- "o4-mini": "o4-mini-2025-04-16",
19
- "o4-mini-2025-04-16": "o4-mini-2025-04-16",
15
+ "gpt-5.2": "gpt-5.2-2025-12-11",
20
16
  };
@@ -1,4 +1,4 @@
1
- import { HtmlReportData, HtmlReportFile, HtmlReportTest, PlaywrightMatchingTest, PlaywrightTestReport } from "@empiricalrun/shared-types";
1
+ import { HtmlReportData, HtmlReportFile, HtmlReportTest, PlaywrightMatchingTest, PlaywrightTestReport } from "@empiricalrun/shared-types/playwright-utils";
2
2
  import type { JSONReport } from "playwright/types/testReporter";
3
3
  export declare function parsePlaywrightTestReport(jsonReport: JSONReport): PlaywrightTestReport;
4
4
  export declare const findTestInReport: (reportJson: HtmlReportFile, targetTest: PlaywrightMatchingTest, allFiles: HtmlReportData["files"]) => HtmlReportTest | null;
@@ -1 +1 @@
1
- {"version":3,"file":"playwright-report-parser.d.ts","sourceRoot":"","sources":["../../src/utils/playwright-report-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,UAAU,EAGX,MAAM,+BAA+B,CAAC;AAqEvC,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,UAAU,GACrB,oBAAoB,CAuBtB;AAED,eAAO,MAAM,gBAAgB,GAC3B,YAAY,cAAc,EAC1B,YAAY,sBAAsB,EAClC,UAAU,cAAc,CAAC,OAAO,CAAC,0BAwBlC,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,sBAAsB,EAAE,EAC/B,YAAY,EAAE,YAAY,GACzB,sBAAsB,GAAG,IAAI,CAgB/B;AAED,wBAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAqBjC;AAED,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,UAAU,EACvB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CASxC"}
1
+ {"version":3,"file":"playwright-report-parser.d.ts","sourceRoot":"","sources":["../../src/utils/playwright-report-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EACV,UAAU,EAGX,MAAM,+BAA+B,CAAC;AAqEvC,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,UAAU,GACrB,oBAAoB,CAuBtB;AAED,eAAO,MAAM,gBAAgB,GAC3B,YAAY,cAAc,EAC1B,YAAY,sBAAsB,EAClC,UAAU,cAAc,CAAC,OAAO,CAAC,0BAwBlC,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,sBAAsB,EAAE,EAC/B,YAAY,EAAE,YAAY,GACzB,sBAAsB,GAAG,IAAI,CAgB/B;AAED,wBAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAqBjC;AAED,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,UAAU,EACvB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CASxC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Recreates Playwright test ID
3
+ * @param relativeFilePath - File path relative to project testDir
4
+ * @param projectId - Project ID from playwright config
5
+ * @param titles - Array of test titles [describe1, describe2, ..., testName]
6
+ */
7
+ export declare function generatePlaywrightTestId(relativeFilePath: string, projectId: string, titles: string[]): string;
8
+ //# sourceMappingURL=playwright-test-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playwright-test-id.d.ts","sourceRoot":"","sources":["../../src/utils/playwright-test-id.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,gBAAgB,EAAE,MAAM,EACxB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EAAE,GACf,MAAM,CAUR"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.generatePlaywrightTestId = generatePlaywrightTestId;
7
+ const crypto_1 = __importDefault(require("crypto"));
8
+ /**
9
+ * Recreates Playwright test ID
10
+ * @param relativeFilePath - File path relative to project testDir
11
+ * @param projectId - Project ID from playwright config
12
+ * @param titles - Array of test titles [describe1, describe2, ..., testName]
13
+ */
14
+ function generatePlaywrightTestId(relativeFilePath, projectId, titles) {
15
+ const toPosix = (filePath) => filePath.split("\\").join("/");
16
+ const sha1 = (input) => crypto_1.default.createHash("sha1").update(input).digest("hex");
17
+ const fileId = sha1(toPosix(relativeFilePath)).slice(0, 20);
18
+ const testIdExpression = `[project=${projectId}]${toPosix(relativeFilePath)}\x1e${titles.join("\x1e")}`;
19
+ const testId = fileId + "-" + sha1(testIdExpression).slice(0, 20);
20
+ return testId;
21
+ }
@@ -1,3 +1,3 @@
1
- import { FileInfo } from "@empiricalrun/shared-types";
1
+ import { FileInfo } from "@empiricalrun/shared-types/test-gen";
2
2
  export declare function generateAsciiTree(root: FileInfo, options?: {}): string;
3
3
  //# sourceMappingURL=repo-tree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repo-tree.d.ts","sourceRoot":"","sources":["../../src/utils/repo-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAGtD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,KAAK,UAqF7D"}
1
+ {"version":3,"file":"repo-tree.d.ts","sourceRoot":"","sources":["../../src/utils/repo-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAG/D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,KAAK,UAqF7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"slug.d.ts","sourceRoot":"","sources":["../../src/utils/slug.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,uBAAuB,GAAU,MAAM,MAAM,oBAOzD,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,KAAG,MASrC,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,cAAc,MAAM,KAAG,MAMlE,CAAC"}
1
+ {"version":3,"file":"slug.d.ts","sourceRoot":"","sources":["../../src/utils/slug.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,uBAAuB,GAAU,MAAM,MAAM,oBAOzD,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,KAAG,MASrC,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,cAAc,MAAM,KAAG,MAoBlE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractSlugFromDiagnosisUrl = exports.slugify = exports.asyncGenerateRandomSlug = void 0;
4
- // @ts-ignore
4
+ const url_1 = require("url");
5
5
  let customAlphabet;
6
6
  const loadNanoid = async () => {
7
7
  const { customAlphabet: importedCustomAlphabet } = await import("nanoid");
@@ -43,10 +43,21 @@ const slugify = (str) => {
43
43
  };
44
44
  exports.slugify = slugify;
45
45
  const extractSlugFromDiagnosisUrl = (diagnosisUrl) => {
46
+ // New formats (unified list and detail page)
47
+ const parsedUrl = url_1.URL.parse(diagnosisUrl);
48
+ const detailParamValue = parsedUrl?.searchParams.get("detail");
49
+ if (detailParamValue) {
50
+ const slug = detailParamValue.split("--").pop();
51
+ if (slug) {
52
+ return slug;
53
+ }
54
+ }
55
+ // Fallback to old format (/diagnosis/ path)
46
56
  const slug = diagnosisUrl.split("--").pop();
47
- if (!diagnosisUrl.includes("--") || !slug) {
48
- throw new Error("Invalid diagnosis URL - could not extract slug");
57
+ if (slug) {
58
+ return slug;
49
59
  }
50
- return slug;
60
+ // Unknown URL format
61
+ throw new Error("Invalid diagnosis URL - could not extract slug");
51
62
  };
52
63
  exports.extractSlugFromDiagnosisUrl = extractSlugFromDiagnosisUrl;
@@ -0,0 +1,2 @@
1
+ export declare function validateUrlAccess(url: string): Promise<Response>;
2
+ //# sourceMappingURL=url-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-validation.d.ts","sourceRoot":"","sources":["../../src/utils/url-validation.ts"],"names":[],"mappings":"AACA,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAatE"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateUrlAccess = validateUrlAccess;
4
+ // Some hosts do not allow HEAD requests, so we fall back to GET.
5
+ async function validateUrlAccess(url) {
6
+ try {
7
+ const headResponse = await fetch(url, { method: "HEAD" });
8
+ if (headResponse.ok) {
9
+ return headResponse;
10
+ }
11
+ return await fetch(url, { method: "GET" });
12
+ }
13
+ catch (error) {
14
+ return new Response(`Network error accessing URL: ${error instanceof Error ? error.message : String(error)}`, { status: 500 });
15
+ }
16
+ }