@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,127 +0,0 @@
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.skillActionGenerator = exports.testCaseSkills = exports.SKILL_USAGE = void 0;
7
- exports.extractSkillFromArgs = extractSkillFromArgs;
8
- const promises_1 = __importDefault(require("fs/promises"));
9
- const api_1 = __importDefault(require("tsx/cjs/api"));
10
- const use_skill_1 = require("../agent/codegen/use-skill");
11
- const web_1 = require("../bin/utils/platform/web");
12
- exports.SKILL_USAGE = "skill_usage";
13
- class TestCaseSkills {
14
- skills;
15
- constructor(skills) {
16
- this.skills = skills;
17
- }
18
- getAvailableSkills() {
19
- return this.skills;
20
- }
21
- updateSkills(skills) {
22
- this.skills = skills;
23
- }
24
- }
25
- exports.testCaseSkills = new TestCaseSkills([]);
26
- function extractSkillFromArgs(args) {
27
- const availableSkills = exports.testCaseSkills.getAvailableSkills();
28
- const { skill } = args;
29
- const [skillDetails] = availableSkills.filter((skillDetails) => skillDetails.testStep === skill);
30
- return { skillDetails };
31
- }
32
- const skillActionGenerator = (page, options) => {
33
- const availableSkills = exports.testCaseSkills.getAvailableSkills();
34
- return {
35
- execute: async ({ args, trace }) => {
36
- const { skill, action } = args;
37
- const [skillDetails] = availableSkills.filter((skillDetails) => skillDetails.testStep === skill);
38
- if (!skillDetails) {
39
- throw new Error(`No skill found for ${skill}`);
40
- }
41
- const skillFilePath = skillDetails.filePath;
42
- // This assumes repoDir is process.cwd()
43
- const [lastDir] = process.cwd().split("/").reverse();
44
- const dir = `${process.cwd()}/${lastDir}`;
45
- const module = await api_1.default.require(`./${skillFilePath}`, dir);
46
- const skillFile = await promises_1.default.readFile(skillFilePath, "utf-8");
47
- const imports = Object.keys(module);
48
- const code = await (0, use_skill_1.generateSkillUsageCode)({
49
- task: action,
50
- sampleUsageMethod: skillDetails.usageExample,
51
- importPathForSkill: skillFilePath,
52
- scopeVariablesMapStr: JSON.stringify(options.stateVariables || {}, null, 2),
53
- pageVariableName: page.name,
54
- skillMethodDefinition: skillFile,
55
- trace,
56
- });
57
- console.log("Usage code generated", code);
58
- const stateVarKeys = Object.keys(options.stateVariables || {});
59
- const newVariablesSpan = trace?.span({
60
- name: "new-state-variables",
61
- });
62
- const newVariables = (0, web_1.getVariableDeclarationsFromCode)(code);
63
- newVariablesSpan?.end({
64
- output: {
65
- newVariables,
66
- },
67
- });
68
- const exec = new Function(page.name, ...imports, ...stateVarKeys,
69
- // assuming all POMs are async methods and the LLM should respond with await keyword
70
- `
71
- return (async () => {
72
- ${code}
73
- return {
74
- ${newVariables.join(",")}
75
- }
76
- })()`);
77
- // extract the state variables after execution
78
- const newStateVariables = await exec(page.pwPageInstance, ...imports.map((i) => module[i]), ...stateVarKeys.map((s) => options.stateVariables[s]));
79
- options.setStateVariables({
80
- ...options.stateVariables,
81
- ...newStateVariables,
82
- });
83
- return {
84
- locator: code,
85
- };
86
- },
87
- template: (args, options) => {
88
- const code = `${options.locator}`;
89
- const skill = args.skill;
90
- const [skillDetails] = availableSkills.filter((skillDetails) => skillDetails.testStep === skill);
91
- return {
92
- code,
93
- importPath: skillDetails?.filePath,
94
- };
95
- },
96
- name: exports.SKILL_USAGE,
97
- schema: {
98
- type: "function",
99
- function: {
100
- name: exports.SKILL_USAGE,
101
- description: "Ability to use already defined skills in the form of page object models to execute a particular task.",
102
- parameters: {
103
- type: "object",
104
- properties: {
105
- reason: {
106
- type: "string",
107
- description: "Explain how this action will help to complete the task. The reason should align with the task provided",
108
- },
109
- action: {
110
- type: "string",
111
- description: "Explain the action for which this skill needs to be used. Mention all details about the action so that it could be used by the skill",
112
- },
113
- skill: {
114
- type: "string",
115
- enum: availableSkills.map((skill) => skill.testStep),
116
- description: `skill to use. Choose one of the available skills: ${availableSkills
117
- .map((skill) => skill.testStep)
118
- .join(", ")}`,
119
- },
120
- },
121
- required: ["reason", "action", "skill"],
122
- },
123
- },
124
- },
125
- };
126
- };
127
- exports.skillActionGenerator = skillActionGenerator;
@@ -1,12 +0,0 @@
1
- import { LLMCache } from "@empiricalrun/llm/chat";
2
- export declare class FilesystemLLMCache implements LLMCache {
3
- private cacheDir;
4
- constructor(cacheDir?: string);
5
- private ensureCacheDir;
6
- private getCacheFilePath;
7
- get(key: string): Promise<string | null>;
8
- set(key: string, value: string): Promise<void>;
9
- clear(): Promise<void>;
10
- size(): Promise<number>;
11
- }
12
- //# sourceMappingURL=filesystem-cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filesystem-cache.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/filesystem-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAKlD,qBAAa,kBAAmB,YAAW,QAAQ;IACjD,OAAO,CAAC,QAAQ,CAAS;gBAEb,QAAQ,CAAC,EAAE,MAAM;YAIf,cAAc;IAQ5B,OAAO,CAAC,gBAAgB;IAKlB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAWxC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IActB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;CAS9B"}
@@ -1,101 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.FilesystemLLMCache = void 0;
37
- const crypto = __importStar(require("crypto"));
38
- const fs = __importStar(require("fs/promises"));
39
- const path = __importStar(require("path"));
40
- class FilesystemLLMCache {
41
- cacheDir;
42
- constructor(cacheDir) {
43
- this.cacheDir = cacheDir || path.join(process.cwd(), ".llm-cache");
44
- }
45
- async ensureCacheDir() {
46
- try {
47
- await fs.access(this.cacheDir);
48
- }
49
- catch {
50
- await fs.mkdir(this.cacheDir, { recursive: true });
51
- }
52
- }
53
- getCacheFilePath(key) {
54
- const hash = crypto.createHash("sha256").update(key).digest("hex");
55
- return path.join(this.cacheDir, `${hash}.json`);
56
- }
57
- async get(key) {
58
- try {
59
- await this.ensureCacheDir();
60
- const filePath = this.getCacheFilePath(key);
61
- const data = await fs.readFile(filePath, "utf-8");
62
- return data;
63
- }
64
- catch {
65
- return null;
66
- }
67
- }
68
- async set(key, value) {
69
- try {
70
- await this.ensureCacheDir();
71
- const filePath = this.getCacheFilePath(key);
72
- await fs.writeFile(filePath, value, "utf-8");
73
- }
74
- catch (error) {
75
- console.warn("Failed to write to LLM cache:", error);
76
- }
77
- }
78
- async clear() {
79
- try {
80
- await this.ensureCacheDir();
81
- const files = await fs.readdir(this.cacheDir);
82
- await Promise.all(files
83
- .filter((file) => file.endsWith(".json"))
84
- .map((file) => fs.unlink(path.join(this.cacheDir, file))));
85
- }
86
- catch (error) {
87
- console.warn("Failed to clear LLM cache:", error);
88
- }
89
- }
90
- async size() {
91
- try {
92
- await this.ensureCacheDir();
93
- const files = await fs.readdir(this.cacheDir);
94
- return files.filter((file) => file.endsWith(".json")).length;
95
- }
96
- catch {
97
- return 0;
98
- }
99
- }
100
- }
101
- exports.FilesystemLLMCache = FilesystemLLMCache;
@@ -1,8 +0,0 @@
1
- import { TraceClient } from "@empiricalrun/llm";
2
- import type { TestCase } from "@empiricalrun/shared-types";
3
- export declare function createEmptyTestCaseBlock({ testCase, file, trace, }: {
4
- testCase: TestCase;
5
- file: string;
6
- trace?: TraceClient;
7
- }): Promise<string | undefined>;
8
- //# sourceMappingURL=create-test-block.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-test-block.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/create-test-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAa3D,wBAAsB,wBAAwB,CAAC,EAC7C,QAAQ,EACR,IAAI,EACJ,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,+BAsCA"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createEmptyTestCaseBlock = createEmptyTestCaseBlock;
4
- const llm_1 = require("@empiricalrun/llm");
5
- const logger_1 = require("../../bin/logger");
6
- const context_1 = require("../../bin/utils/context");
7
- const web_1 = require("../../bin/utils/platform/web");
8
- const constants_1 = require("../../constants");
9
- const promptTemplate_0 = "{{#section \"system\"}}\nYou are a software test engineer who is given a task to write an empty test block.\nBased on the inputs you need to create an empty playwright test block with correctly imported fixture.\n\nThe test will contain a test name which you will need to use to build the empty test case block.\n\nYou will be provided with current tests, fixtures and page object models for you to use and create test case block as\nper the task provided to you.\n\nBefore responding you need to ensure that the code change is minimal and the change is reusable across tests. You need\nto ensure the code follows DRY principle.\n\nHere is the list of current tests and fixtures:\n\n{{testFiles}}\n\nHere is the list of current page object models:\n\n{{pageFiles}}\n{{/section}}\n\n{{#section \"user\"}}\nFollowing is the test scenario for which you need to write the empty test case block:\ntest name:\n{{scenarioName}}\n\ntask:\ncreate an empty test case block for the following test steps:\n{{scenario}}\n\ntest file path: {{scenarioFile}}\n\n------\n\nYou also need to ensure that the empty test case block has a starting page to begin test.\n\nIn order to identify the right page with which the test should start, follow the steps:\n- based on the similarities with other test cases mentioned in the file, identify the right page fixture to be imported\n- Read the page fixture methods step by step. Identify whether the fixture handles navigating to a page.\n- Identify whether other tests using the page fixture had to add separate steps for navigation or not\n- Based on the above analysis there will be following cases and choose either for the given test scenario:\n-- Case 1: if the test case scenario provided inside the task mentions about page navigation, then use that page\nnavigation. skip other cases if this case is satisfied.\n-- Case 2: refer other test cases which import similar fixtures and infer the first page navigation of this test case.\nYou should prefer tests which are in the same file. Tests within same file have higher overlaps in first page\nnavigation.\n- Once the page fixture is decided, look for userContext fixture in files. If its available then add \"userContext\" to\nthe test case block\n\n\n\nFollow these instructions before responding with output:\n- Read the code line by line and achieve the task provided to you\n- Read the dependencies of the code block by scanning through file paths and file provided to you. refer the same file\npath while responding with update\n- Focus only on the test case provided and associated JS methods called from the test case.\n- Respond only with the new empty test case block to be created and nothing else.\n- DO NOT respond with any backticks or markdown syntax\n- If \"userContext\" fixture is available in fixtures file, ensure importing that fixture in the test case block.\n- Provide a reason based on the test steps provided to you on why you chose the fixture or page.goto statement. The\nreason should be one of the list steps provided to you and mention why the case was chosen\n{{/section}}";
10
- async function createEmptyTestCaseBlock({ testCase, file, trace, }) {
11
- const logger = new logger_1.CustomLogger({ useReporter: false });
12
- logger.log("Creating new test block");
13
- const context = await (0, context_1.contextForGeneration)(file);
14
- const promptSpan = trace?.span({
15
- name: "build-create-empty-test-case-prompt",
16
- });
17
- const prompt = (0, llm_1.compilePrompt)(promptTemplate_0, {
18
- testFiles: context.codePrompt,
19
- pageFiles: context.pomPrompt,
20
- scenarioName: testCase.name,
21
- scenario: testCase.steps.join("\n"),
22
- scenarioFile: file,
23
- });
24
- promptSpan?.end({ output: { prompt } });
25
- const llm = new llm_1.LLM({
26
- trace,
27
- provider: constants_1.DEFAULT_MODEL_PROVIDER,
28
- defaultModel: constants_1.DEFAULT_MODEL,
29
- providerApiKey: constants_1.MODEL_API_KEYS[constants_1.DEFAULT_MODEL_PROVIDER],
30
- });
31
- const firstShotMessage = await llm.createChatCompletion({
32
- messages: prompt,
33
- modelParameters: {
34
- ...constants_1.DEFAULT_MODEL_PARAMETERS,
35
- },
36
- });
37
- const markdownRemoverSpan = trace?.span({
38
- name: "remove-markdown-span",
39
- });
40
- let response = firstShotMessage?.content || "";
41
- markdownRemoverSpan?.end({ output: { response } });
42
- const { testBlock } = (0, web_1.getTypescriptTestBlock)({
43
- scenarioName: testCase.name,
44
- content: response,
45
- });
46
- return testBlock;
47
- }
@@ -1,12 +0,0 @@
1
- import { TraceClient } from "@empiricalrun/llm";
2
- import type { TestCase } from "@empiricalrun/shared-types";
3
- import { CustomLogger } from "../../bin/logger";
4
- export declare function validateAndFixTypescriptErrors({ trace, logger, file, pomCode, nonSpecFileCode, testCase, }: {
5
- trace?: TraceClient;
6
- logger?: CustomLogger;
7
- file: string;
8
- pomCode: string;
9
- nonSpecFileCode: string;
10
- testCase: TestCase;
11
- }): Promise<void>;
12
- //# sourceMappingURL=fix-ts-errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fix-ts-errors.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/fix-ts-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUhD,wBAAsB,8BAA8B,CAAC,EACnD,KAAK,EACL,MAA2B,EAC3B,IAAI,EACJ,OAAO,EACP,eAAe,EACf,QAAQ,GACT,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,QAAQ,CAAC;CACpB,iBAsEA"}
@@ -1,78 +0,0 @@
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.validateAndFixTypescriptErrors = validateAndFixTypescriptErrors;
7
- const llm_1 = require("@empiricalrun/llm");
8
- const fs_1 = __importDefault(require("fs"));
9
- const logger_1 = require("../../bin/logger");
10
- const web_1 = require("../../bin/utils/platform/web");
11
- const constants_1 = require("../../constants");
12
- const promptTemplate_0 = "{{#section \"system\"}}\nYou are a software engineer who is given a task to fix semantic and syntactical errors in a typescript file\n'{{scenarioFile}}' provided to you.\nYou will be provided with fixtures and page object models to use and fix errors.\n\nHere is the list of fixtures available:\n\n{{fixtureFiles}}\n\nHere is the list of current page object models available to you:\n\n{{pageFiles}}\n\nUse the above files to fix the errors.\n\nFollow these guidelines before responding with output\n- Ensure there are no type issues in the given {{scenarioFile}} file\n- For the given file respond with only the code\n- Do not respond with markdown syntax or backticks\n- Do not modify anything else apart from the code required to fix typescript error\n- Do not modify any other scenarios apart from the provided scenario name\n- Do not respond with any explanation. Respond only with the updated code.\n{{/section}}\n\n{{#section \"user\"}}\n'{{scenarioFile}}' with scenario name '{{scenarioName}}', has following typescript errors which you need to fix:\n{{errors}}\n\nHere is the content of the '{{scenarioFile}}':\n\n{{fileContent}}\n{{/section}}";
13
- async function validateAndFixTypescriptErrors({ trace, logger = new logger_1.CustomLogger(), file, pomCode, nonSpecFileCode, testCase, }) {
14
- const validateTypesSpan = trace?.span({ name: "detect-type-errors-in-file" });
15
- logger.log("Validating types...");
16
- let errors = (0, web_1.validateTypescript)(file);
17
- validateTypesSpan?.end({ output: { errors } });
18
- if (!errors.length) {
19
- logger.success("Found no type issues!");
20
- }
21
- const maxIteration = 2;
22
- let counter = 0;
23
- while (errors.length > 0) {
24
- const fileContent = fs_1.default.readFileSync(file, "utf-8");
25
- counter += 1;
26
- if (counter > maxIteration) {
27
- trace?.event({ name: "code-fix-iteration-max-out" });
28
- logger.error([
29
- `Unable to fix typescript errors. Please review ${file} manually and fix the typescript errors.`,
30
- `View [trace](${trace?.getTraceUrl()})`,
31
- ].join("\n"));
32
- break;
33
- }
34
- trace?.event({ name: "Found errors fixing" });
35
- logger.warn("Found few errors while validating types. Trying to fix errors...");
36
- errors.forEach((e) => console.warn(e));
37
- const promptSpan = trace?.span({ name: "fix-type-errors-prompt" });
38
- const instruction = (0, llm_1.compilePrompt)(promptTemplate_0, {
39
- pageFiles: pomCode || "",
40
- fixtureFiles: nonSpecFileCode || "",
41
- scenarioFile: file,
42
- errors: errors,
43
- fileContent: fileContent,
44
- scenarioName: testCase.name,
45
- });
46
- promptSpan?.end({ output: { instruction } });
47
- const llm = new llm_1.LLM({
48
- trace,
49
- provider: constants_1.DEFAULT_MODEL_PROVIDER,
50
- defaultModel: constants_1.DEFAULT_MODEL,
51
- providerApiKey: constants_1.MODEL_API_KEYS[constants_1.DEFAULT_MODEL_PROVIDER],
52
- });
53
- const message = await llm.createChatCompletion({
54
- messages: instruction,
55
- modelParameters: {
56
- ...constants_1.DEFAULT_MODEL_PARAMETERS,
57
- },
58
- });
59
- const response = message?.content || "";
60
- const readWriteFileSpan = trace?.span({ name: "write-to-file" });
61
- fs_1.default.writeFileSync(file, response, "utf-8");
62
- readWriteFileSpan?.end({ output: { response } });
63
- trace?.event({ name: "lint-file" });
64
- await (0, web_1.lintErrors)(file);
65
- const validateTypesSpan = trace?.span({
66
- name: "detect-type-errors-in-file",
67
- input: {
68
- filePath: file,
69
- content: response,
70
- },
71
- });
72
- errors = (0, web_1.validateTypescript)(file);
73
- validateTypesSpan?.end({ output: { errors } });
74
- if (!errors.length) {
75
- logger.success("Found no type issues!");
76
- }
77
- }
78
- }
@@ -1,9 +0,0 @@
1
- import { TraceClient } from "@empiricalrun/llm";
2
- import type { TestGenConfigOptions } from "@empiricalrun/shared-types";
3
- export declare function getLexicalScopedVars({ trace, file, referencePoint, options, }: {
4
- trace?: TraceClient;
5
- file: string;
6
- referencePoint: string;
7
- options?: TestGenConfigOptions;
8
- }): Promise<string[]>;
9
- //# sourceMappingURL=lexical-scoped-vars.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lexical-scoped-vars.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/lexical-scoped-vars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AASvE,wBAAsB,oBAAoB,CAAC,EACzC,KAAK,EACL,IAAI,EACJ,cAAc,EACd,OAAO,GACR,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,qBAoDA"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLexicalScopedVars = getLexicalScopedVars;
4
- const llm_1 = require("@empiricalrun/llm");
5
- const constants_1 = require("../../constants");
6
- const promptTemplate_0 = "{{#section \"system\"}}\nYou are a software engineer tasked with analysing Typescript code to identify all variables available in the lexical\nscope at a specific reference point within a file. You will be given a file that contains multiple Playwright tests or\npage object models, along with a reference point inside the file. Your goal is to evaluate the list of all variables\navailable in the lexical scope at that reference point.\n\nTo accomplish this, you need to evaluate the Abstract Syntax Tree (AST) and accumulate all variables that are in the\nlexical scope, which includes:\n1. Variables declared within the test before the reference point.\n2. Arguments of the function.\n3. Variables defined in the parent scope. Identify all variables available in the lexical scope at a specific execution\nreference point within a file, considering only those variables that have been declared and assigned prior to the\nexecution of this point in the code.\n4. Global variables defined in the file.\n\nBefore responding:\n- Ignore variables imported from the `\"./pages\"` path.\n- keep in mind temporal dead zone phenomenon before responding with variables\n{{/section}}\n\n{{#section \"user\"}}\nFile:\n{{testFile}}\n\nReference point:\n{{referencePoint}}\n{{/section}}";
7
- async function getLexicalScopedVars({ trace, file, referencePoint, options, }) {
8
- const fetchLexicalScopedVarsSpan = trace?.span({
9
- name: "lexical-scoped-vars",
10
- });
11
- const messages = (0, llm_1.compilePrompt)(promptTemplate_0, {
12
- testFile: file || "",
13
- referencePoint: referencePoint || "",
14
- });
15
- const llm = new llm_1.LLM({
16
- trace: fetchLexicalScopedVarsSpan,
17
- provider: options?.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER,
18
- defaultModel: options?.model || "o3-mini-2025-01-31",
19
- providerApiKey: constants_1.MODEL_API_KEYS[options?.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER],
20
- });
21
- const message = await llm.createChatCompletion({
22
- messages,
23
- modelParameters: {
24
- max_completion_tokens: constants_1.DEFAULT_O1_MODEL_PARAMETERS.max_completion_tokens,
25
- },
26
- responseFormat: {
27
- type: "json_schema",
28
- json_schema: {
29
- name: "reasoning_with_variables",
30
- strict: true,
31
- schema: {
32
- type: "object",
33
- properties: {
34
- reason: {
35
- type: "string",
36
- description: "The reason or explanation.",
37
- },
38
- variables: {
39
- type: "array",
40
- description: "A list of variables.",
41
- items: {
42
- type: "string",
43
- },
44
- },
45
- },
46
- required: ["reason", "variables"],
47
- additionalProperties: false,
48
- },
49
- },
50
- },
51
- });
52
- const response = JSON.parse(message?.content || "{}");
53
- fetchLexicalScopedVarsSpan?.end({ output: { response } });
54
- return response.variables;
55
- }
@@ -1,26 +0,0 @@
1
- import { TraceClient } from "@empiricalrun/llm";
2
- import type { TestCase, TestGenConfigOptions } from "@empiricalrun/shared-types";
3
- export declare const fetchPomSkills: ({ testCase, pomFiles, options, trace, }: {
4
- testCase: TestCase;
5
- pomFiles?: string;
6
- trace?: TraceClient;
7
- options?: TestGenConfigOptions;
8
- }) => Promise<{
9
- testStep: string;
10
- filePath: string;
11
- usageExample: string;
12
- reason: string;
13
- methodName: string;
14
- }[]>;
15
- export declare function getAppropriateSkills({ testCase, options, trace, }: {
16
- testCase: TestCase;
17
- options?: TestGenConfigOptions;
18
- trace?: TraceClient;
19
- }): Promise<{
20
- testStep: string;
21
- filePath: string;
22
- usageExample: string;
23
- reason: string;
24
- methodName: string;
25
- }[]>;
26
- //# sourceMappingURL=skills-retriever.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skills-retriever.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/skills-retriever.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACV,QAAQ,EACR,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAmBpC,eAAO,MAAM,cAAc,GAAU,yCAKlC;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC;;;;;;IAoDA,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,EACzC,QAAQ,EACR,OAAO,EACP,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;;;;;;KA6BA"}
@@ -1,93 +0,0 @@
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.fetchPomSkills = void 0;
7
- exports.getAppropriateSkills = getAppropriateSkills;
8
- const llm_1 = require("@empiricalrun/llm");
9
- const fs_1 = __importDefault(require("fs"));
10
- const logger_1 = require("../../bin/logger");
11
- const context_1 = require("../../bin/utils/context");
12
- const fs_2 = require("../../bin/utils/fs");
13
- const constants_1 = require("../../constants");
14
- const promptTemplate_0 = "{{#section \"system\"}}\nYou are provided with usage examples of page object models of a Playwright test\nrepository and you are given a task to update the usage example of the page object\nmodels with the usage of them in tests. \n\nYou need to ensure all the pre-requisites of calling the method is also mentioned\nin the usage example. Use the tests code for same\n\n{{/section}}\n\n{{#section \"user\"}}\nUsage examples of page object models:\n\n{{response}}\n\nTests files:\n\n{{codePrompt}}\n\n\nBefore responding: \n- ensure responding in the same format as provided to you in the usage example of page object models.\n- respond only with the methods and not any test block\n- respond with the same format provided to you in task. <subtask></subtask>, <reason></reason>, <file_import_path></file_import_path>, <usage_example></usage_example> and\n<method_name></method_name>\n- do not respond with test blocks or page or fixture extraction as its already available at the time of execution\n- do not respond with backticks or markdown at all \n- do not respond with import statements and assume the imports are already available at the time of execution\n{{/section}}\n";
15
- const promptTemplate_1 = "{{#section \"system\"}}\nYou are a software test engineer who is given a goal to pick re-usable page object model methods for a given UI\nautomation test.\n\nYou will be provided with a test scenario as task and also the page object model methods available in the automation\ntest repository. The page object models acts as skills to execute a particular sub task of a given task.\n\nYou need to break down the task into sub tasks and identify which sub_task can be solved with the help of page object\nmodel methods. Once identified, you need to return with an usage API example for same. You need to pick methods only\nfrom the provided page object models.\n\nHere is the list of current page object models:\n\n{{pageFiles}}\n\n{{/section}}\n\n{{#section \"user\"}}\nFollowing is the test scenario for which you need to figure out the skills:\n\n**Task:**\n{{scenario}}\n\nBefore responding follow the instructions:\n- You need to break down the task into subtask and respond with the code of sub tasks for which there are methods\nexposed from page object models\n- Only use methods that are explicitly defined and exported in the provided page object models. Do not create, infer, or\nassume any methods or code that are not exported from the page object model files.\n- Do not respond with any methods or code that are not available in the list of page object models.\n- Ensure there are no type issues in the code generated.\n- Do not respond with markdown syntax or backticks.\n- Respond only with the code\n- Read steps one by one and generate the test code\n- Do not write any extra code than instructed in the steps\n- You need to respond with `<subtask></subtask>`, `<reason></reason>`, `<file_import_path></file_import_path>`, `\n<usage_example></usage_example>` and `<method_name></method_name>`\n- You should respond with methods exported from the page object models\n- Do not respond with any import statements.\n- Do not respond with sub_task for which there is no explicit method found\n- Always pick the page object model method matching the task provided. If there is no matching method, then ignore it.\nDo not attempt to generate or use any non existent methods for such instances.\n- Respond with the usage_example so that it can be directly copy pasted inside the test\n- Do not set the parameters for the method. Keep it as is with the interface parameters\n{{/section}}";
16
- const utils_1 = require("./utils");
17
- const fetchPomSkills = async ({ testCase, pomFiles, options, trace, }) => {
18
- const fetchSkillsUsingPOMFilesSpan = trace?.span({
19
- name: "fetch-pom-skills",
20
- input: {
21
- pomFiles,
22
- testCase,
23
- },
24
- });
25
- const promptSpan = fetchSkillsUsingPOMFilesSpan?.span({
26
- name: "fetch-pom-skills-prompt",
27
- });
28
- const prompt = (0, llm_1.compilePrompt)(promptTemplate_1, {
29
- pageFiles: pomFiles,
30
- scenarioName: testCase.name,
31
- scenario: testCase.steps.join("\n"),
32
- });
33
- promptSpan?.end({ output: { prompt } });
34
- const llm = new llm_1.LLM({
35
- trace: fetchSkillsUsingPOMFilesSpan,
36
- provider: options?.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER,
37
- defaultModel: options?.model || constants_1.DEFAULT_MODEL,
38
- providerApiKey: constants_1.MODEL_API_KEYS[options?.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER],
39
- });
40
- const firstShotMessage = await llm.createChatCompletion({
41
- messages: prompt,
42
- traceName: "fetch-pom-skills-llm",
43
- modelParameters: {
44
- ...constants_1.DEFAULT_MODEL_PARAMETERS,
45
- ...options?.modelParameters,
46
- },
47
- });
48
- let response = firstShotMessage?.content || "";
49
- const { codePrompt } = await (0, context_1.contextForGeneration)();
50
- const updatedUsageExampleMessage = await llm.createChatCompletion({
51
- messages: (0, llm_1.compilePrompt)(promptTemplate_0, {
52
- response,
53
- codePrompt,
54
- }),
55
- traceName: "fetch-pom-skills-usage-eg-update-llm",
56
- modelParameters: {
57
- ...constants_1.DEFAULT_MODEL_PARAMETERS,
58
- ...options?.modelParameters,
59
- },
60
- });
61
- const skills = (0, utils_1.extractTestStepsSuggestions)(updatedUsageExampleMessage?.content || "");
62
- fetchSkillsUsingPOMFilesSpan?.end({ output: { skills } });
63
- return skills;
64
- };
65
- exports.fetchPomSkills = fetchPomSkills;
66
- async function getAppropriateSkills({ testCase, options, trace, }) {
67
- const logger = new logger_1.CustomLogger({ useReporter: false });
68
- logger.log("getting skill set for the repository");
69
- const filter = await (0, context_1.createGitIgnoreFileFilter)();
70
- const pomFiles = await (0, fs_2.generatePromptFromDirectory)("./pages", filter);
71
- const fetchSkillsSpan = trace?.span({
72
- name: "get-appropriate-skills",
73
- input: {
74
- testCase,
75
- },
76
- });
77
- const skills = await (0, exports.fetchPomSkills)({
78
- testCase,
79
- pomFiles,
80
- trace: fetchSkillsSpan,
81
- options,
82
- });
83
- const validateSkillsSpan = fetchSkillsSpan?.span({
84
- name: "validate-skills",
85
- input: {
86
- skills,
87
- },
88
- });
89
- const validatedSkills = skills.filter((skill) => fs_1.default.existsSync(skill.filePath));
90
- validateSkillsSpan?.end({ output: { validatedSkills } });
91
- fetchSkillsSpan?.end({ output: { validatedSkills } });
92
- return validatedSkills;
93
- }
@@ -1,12 +0,0 @@
1
- import { TraceClient } from "@empiricalrun/llm";
2
- import { ChatCompletionMessageParam } from "openai/resources/index.mjs";
3
- export declare function applyTestUpdateFeedbacks({ trace, oldPrompt, feedbacks, agentResponse, }: {
4
- oldPrompt: ChatCompletionMessageParam[];
5
- agentResponse: string;
6
- feedbacks: {
7
- filePath: string | undefined;
8
- errorMessage: string;
9
- }[];
10
- trace?: TraceClient;
11
- }): Promise<import("./types").CodeUpdate[]>;
12
- //# sourceMappingURL=test-update-feedback.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-update-feedback.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/test-update-feedback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAKxE,wBAAsB,wBAAwB,CAAC,EAC7C,KAAK,EACL,SAAS,EACT,SAAS,EACT,aAAa,GACd,EAAE;IACD,SAAS,EAAE,0BAA0B,EAAE,CAAC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,YAAY,EAAE,MAAM,CAAC;KACtB,EAAE,CAAC;IACJ,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,2CA4CA"}