testeiya 0.2.1 → 0.3.1-0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +309 -171
  3. package/dist/prompt/context.js +79 -0
  4. package/dist/prompt/context.js.map +1 -0
  5. package/dist/prompt/index.js +60 -0
  6. package/dist/prompt/index.js.map +1 -0
  7. package/dist/prompt/print.js +30 -0
  8. package/dist/prompt/print.js.map +1 -0
  9. package/dist/prompt/project-info.js +2 -0
  10. package/dist/prompt/project-info.js.map +1 -0
  11. package/{src/prompt/system-prompt.ts → dist/prompt/system-prompt.js} +38 -25
  12. package/dist/prompt/system-prompt.js.map +1 -0
  13. package/dist/prompt/testomatio.js +264 -0
  14. package/dist/prompt/testomatio.js.map +1 -0
  15. package/dist/prompt/tools.js +70 -0
  16. package/dist/prompt/tools.js.map +1 -0
  17. package/dist/prompt/vocab.js +8 -0
  18. package/dist/prompt/vocab.js.map +1 -0
  19. package/dist/src/args.js +207 -0
  20. package/dist/src/args.js.map +1 -0
  21. package/dist/src/cli.js +114 -0
  22. package/dist/src/cli.js.map +1 -0
  23. package/dist/src/doctor.js +171 -0
  24. package/dist/src/doctor.js.map +1 -0
  25. package/dist/src/env.js +93 -0
  26. package/dist/src/env.js.map +1 -0
  27. package/dist/src/mcp-extension.js +9 -0
  28. package/dist/src/mcp-extension.js.map +1 -0
  29. package/dist/src/mcp.js +139 -0
  30. package/dist/src/mcp.js.map +1 -0
  31. package/dist/src/model.js +71 -0
  32. package/dist/src/model.js.map +1 -0
  33. package/dist/src/models.js +38 -0
  34. package/dist/src/models.js.map +1 -0
  35. package/dist/src/output.js +194 -0
  36. package/dist/src/output.js.map +1 -0
  37. package/dist/src/result.js +41 -0
  38. package/dist/src/result.js.map +1 -0
  39. package/dist/src/run.js +295 -0
  40. package/dist/src/run.js.map +1 -0
  41. package/dist/src/session.js +98 -0
  42. package/dist/src/session.js.map +1 -0
  43. package/dist/src/sessions.js +72 -0
  44. package/dist/src/sessions.js.map +1 -0
  45. package/dist/src/skills.js +88 -0
  46. package/dist/src/skills.js.map +1 -0
  47. package/dist/vendor/mcp.js +14801 -0
  48. package/mcp-tools.json +2967 -0
  49. package/package.json +34 -43
  50. package/prompt/context.ts +101 -0
  51. package/prompt/index.ts +102 -0
  52. package/prompt/print.ts +32 -0
  53. package/prompt/project-info.ts +30 -0
  54. package/prompt/system-prompt.ts +187 -0
  55. package/{src/prompt → prompt}/testomatio.ts +120 -9
  56. package/prompt/tools.ts +72 -0
  57. package/prompt/vocab.ts +7 -0
  58. package/skills/codeceptjs/ci-fix-tests/SKILL.md +7 -8
  59. package/skills/codeceptjs/codeceptjs-auth/SKILL.md +47 -64
  60. package/skills/codeceptjs/codeceptjs-exploration/SKILL.md +56 -47
  61. package/skills/codeceptjs/codeceptjs-fundamentals/SKILL.md +144 -106
  62. package/skills/codeceptjs/codeceptjs-run-analysis/SKILL.md +50 -57
  63. package/skills/codeceptjs/debugging-codeceptjs-tests/SKILL.md +88 -196
  64. package/skills/codeceptjs/migrate-codeceptjs-4/SKILL.md +4 -5
  65. package/skills/codeceptjs/migrate-cypress-to-codeceptjs/SKILL.md +25 -36
  66. package/skills/codeceptjs/migrate-protractor-to-codeceptjs/SKILL.md +23 -36
  67. package/skills/codeceptjs/migrate-selenium-java-to-codeceptjs/SKILL.md +23 -36
  68. package/skills/codeceptjs/migrate-testcafe-to-codeceptjs/SKILL.md +23 -35
  69. package/skills/codeceptjs/refactoring-codeceptjs-tests/SKILL.md +50 -53
  70. package/skills/codeceptjs/writing-codeceptjs-tests/SKILL.md +87 -191
  71. package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/SKILL.md +1 -1
  72. package/{skills.lock.json → skills/skills.lock.json} +43 -36
  73. package/skills/skills.yaml +34 -0
  74. package/skills/testomatio/explorbot/explorbot-fundamentals/SKILL.md +49 -61
  75. package/skills/testomatio/explorbot/explorbot-fundamentals/references/no-install.md +36 -0
  76. package/skills/testomatio/explorbot/explorbot-plan/SKILL.md +20 -7
  77. package/skills/testomatio/explorbot/explorbot-setup/SKILL.md +41 -289
  78. package/skills/testomatio/qa-process/qa-explain-behavior/SKILL.md +111 -0
  79. package/skills/testomatio/qa-process/qa-explain-behavior/references/answer-shapes.md +116 -0
  80. package/skills/testomatio/qa-process/qa-explain-behavior/references/examples.md +157 -0
  81. package/skills/testomatio/qa-process/qa-lead-strategy-advisor/SKILL.md +91 -0
  82. package/skills/testomatio/qa-process/qa-lead-strategy-advisor/references/output-format.md +71 -0
  83. package/skills/testomatio/qa-process/testing-workflow/SKILL.md +227 -0
  84. package/skills/testomatio/test-automation/qa-data-seeder/SKILL.md +83 -0
  85. package/skills/testomatio/test-automation/run-tests-with-testomatio-reporter/SKILL.md +5 -3
  86. package/skills/testomatio/test-automation/setup-change-aware-pr-testing/SKILL.md +190 -0
  87. package/skills/testomatio/test-automation/setup-ci-automation/SKILL.md +76 -0
  88. package/skills/testomatio/test-management/qa-split-testing-levels-pyramid/SKILL.md +55 -0
  89. package/skills/testomatio/test-management/qa-sprint-report-by-testomatio/SKILL.md +220 -0
  90. package/skills/testomatio/test-management/qa-sprint-report-by-testomatio/references/qa-sprint-report.md +126 -0
  91. package/skills/testomatio/test-management/qa-test-code-coverage/SKILL.md +1 -1
  92. package/skills/testomatio/test-management/qa-thinking/SKILL.md +25 -25
  93. package/skills/testomatio/test-management/testomatio-mcp/SKILL.md +14 -1
  94. package/skills/testomatio/test-management/testomatio-mcp/references/MCP_SETUP.md +8 -0
  95. package/assets/testeiya-logo-dark.svg +0 -16
  96. package/assets/testeiya-logo.svg +0 -15
  97. package/models.catalog.json +0 -6963
  98. package/skills/playwright-best-practices-skill/LICENSE.md +0 -7
  99. package/skills/playwright-best-practices-skill/README.md +0 -147
  100. package/skills/testeiya/README.md +0 -29
  101. package/skills/testeiya/answer-formatting/SKILL.md +0 -30
  102. package/skills/testeiya/check-cucumber/SKILL.md +0 -200
  103. package/skills/testeiya/check-tests/SKILL.md +0 -260
  104. package/skills/testeiya/manual-run-assistant/SKILL.md +0 -61
  105. package/skills/testeiya/testomatio-docs/INDEX.md +0 -175
  106. package/skills/testeiya/testomatio-docs/SKILL.md +0 -102
  107. package/skills/testeiya/testomatio-docs/docs/advanced/ai-powered-features/ai-agents.md +0 -144
  108. package/skills/testeiya/testomatio-docs/docs/advanced/ai-powered-features/ai-powered-features.md +0 -531
  109. package/skills/testeiya/testomatio-docs/docs/advanced/ai-powered-features/ai-requirements.md +0 -437
  110. package/skills/testeiya/testomatio-docs/docs/advanced/api-access/index.md +0 -191
  111. package/skills/testeiya/testomatio-docs/docs/advanced/branches-folder/index.md +0 -277
  112. package/skills/testeiya/testomatio-docs/docs/advanced/bulk-edit-folder/bulk-edit-demos.mdx +0 -39
  113. package/skills/testeiya/testomatio-docs/docs/advanced/bulk-edit-folder/bulk-edit-on-suite-and-test-level.md +0 -122
  114. package/skills/testeiya/testomatio-docs/docs/advanced/bulk-edit-folder/what-is-bulk-edit.md +0 -170
  115. package/skills/testeiya/testomatio-docs/docs/advanced/jira-plugin/branches.md +0 -53
  116. package/skills/testeiya/testomatio-docs/docs/advanced/jira-plugin/index.mdx +0 -98
  117. package/skills/testeiya/testomatio-docs/docs/advanced/jira-plugin/jira-issue.md +0 -151
  118. package/skills/testeiya/testomatio-docs/docs/advanced/jira-plugin/runs-and-reports.md +0 -377
  119. package/skills/testeiya/testomatio-docs/docs/advanced/jira-plugin/work-in-jira.md +0 -267
  120. package/skills/testeiya/testomatio-docs/docs/advanced/living-doc/index.md +0 -138
  121. package/skills/testeiya/testomatio-docs/docs/advanced/milestones/index.md +0 -220
  122. package/skills/testeiya/testomatio-docs/docs/advanced/shortcuts/index.md +0 -48
  123. package/skills/testeiya/testomatio-docs/docs/advanced/tags-labels/labels-and-custom-fields.md +0 -201
  124. package/skills/testeiya/testomatio-docs/docs/advanced/tags-labels/tags-or-labels.md +0 -94
  125. package/skills/testeiya/testomatio-docs/docs/advanced/tags-labels/tags.md +0 -243
  126. package/skills/testeiya/testomatio-docs/docs/advanced/test-artifacts/index.md +0 -135
  127. package/skills/testeiya/testomatio-docs/docs/advanced/tql/index.md +0 -394
  128. package/skills/testeiya/testomatio-docs/docs/getting-started/index.md +0 -290
  129. package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/azure.md +0 -96
  130. package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/bamboo.md +0 -94
  131. package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/bitbucket.md +0 -106
  132. package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/circle.md +0 -115
  133. package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/github.md +0 -120
  134. package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/gitlab.md +0 -88
  135. package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/index.mdx +0 -151
  136. package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/jenkins.md +0 -121
  137. package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/teamcity.md +0 -96
  138. package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/azure.md +0 -31
  139. package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/clickup.md +0 -54
  140. package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/confluence.md +0 -34
  141. package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/github.md +0 -31
  142. package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/gitlab.md +0 -93
  143. package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/index.md +0 -131
  144. package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/jira.md +0 -164
  145. package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/linear.md +0 -29
  146. package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/shortcut.md +0 -67
  147. package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/youtrack.md +0 -94
  148. package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/azure-devops.md +0 -53
  149. package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/email.md +0 -71
  150. package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/jira.md +0 -52
  151. package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/ms-teams.md +0 -60
  152. package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/rules.md +0 -267
  153. package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/slack.md +0 -82
  154. package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/telegram.md +0 -73
  155. package/skills/testeiya/testomatio-docs/docs/integrations/scim-provisioning/index.mdx +0 -207
  156. package/skills/testeiya/testomatio-docs/docs/integrations/scim-provisioning/okta.md +0 -204
  157. package/skills/testeiya/testomatio-docs/docs/integrations/single-sign-on/azure.md +0 -95
  158. package/skills/testeiya/testomatio-docs/docs/integrations/single-sign-on/google.md +0 -75
  159. package/skills/testeiya/testomatio-docs/docs/integrations/single-sign-on/index.mdx +0 -33
  160. package/skills/testeiya/testomatio-docs/docs/integrations/single-sign-on/okta.md +0 -108
  161. package/skills/testeiya/testomatio-docs/docs/integrations/single-sign-on/saml.md +0 -66
  162. package/skills/testeiya/testomatio-docs/docs/legal/compliance/gdpr.md +0 -95
  163. package/skills/testeiya/testomatio-docs/docs/legal/compliance/index.mdx +0 -94
  164. package/skills/testeiya/testomatio-docs/docs/legal/compliance/privacy.md +0 -26
  165. package/skills/testeiya/testomatio-docs/docs/legal/compliance/terms.md +0 -32
  166. package/skills/testeiya/testomatio-docs/docs/legal/security/index.mdx +0 -242
  167. package/skills/testeiya/testomatio-docs/docs/legal/security/jira.md +0 -140
  168. package/skills/testeiya/testomatio-docs/docs/legal/security/subprocessors.md +0 -76
  169. package/skills/testeiya/testomatio-docs/docs/management/company/administration.md +0 -363
  170. package/skills/testeiya/testomatio-docs/docs/management/company/audit-log.md +0 -41
  171. package/skills/testeiya/testomatio-docs/docs/management/company/plan-features-comparison.md +0 -240
  172. package/skills/testeiya/testomatio-docs/docs/management/company/subscriptions.md +0 -326
  173. package/skills/testeiya/testomatio-docs/docs/management/company/trials.md +0 -75
  174. package/skills/testeiya/testomatio-docs/docs/management/company/users-and-permissions/accountant.md +0 -49
  175. package/skills/testeiya/testomatio-docs/docs/management/company/users-and-permissions/index.mdx +0 -285
  176. package/skills/testeiya/testomatio-docs/docs/management/company/users-and-permissions/read-only-user.md +0 -67
  177. package/skills/testeiya/testomatio-docs/docs/management/company/users-and-permissions/teams.md +0 -138
  178. package/skills/testeiya/testomatio-docs/docs/management/project/settings.md +0 -87
  179. package/skills/testeiya/testomatio-docs/docs/management/project/templates.md +0 -546
  180. package/skills/testeiya/testomatio-docs/docs/project/analytics/index.md +0 -326
  181. package/skills/testeiya/testomatio-docs/docs/project/import-export/export-tests/classical-tests-markdown-format.md +0 -386
  182. package/skills/testeiya/testomatio-docs/docs/project/import-export/export-tests/download-manual-tests-as-files.md +0 -378
  183. package/skills/testeiya/testomatio-docs/docs/project/import-export/export-tests/export-to-obsidian.md +0 -112
  184. package/skills/testeiya/testomatio-docs/docs/project/import-export/export-tests/export-to-spreadsheet.md +0 -127
  185. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/auto-import.md +0 -63
  186. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-Allure-TestOps.md +0 -49
  187. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-QTest.md +0 -41
  188. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-Qase.md +0 -39
  189. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-Zephyr.md +0 -37
  190. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-csv-xlsx.md +0 -117
  191. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-cucumber.md +0 -93
  192. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-qmetry.md +0 -44
  193. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-source-code.md +0 -117
  194. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-testcaselabs.md +0 -44
  195. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-testmo.md +0 -47
  196. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-testrail.md +0 -82
  197. package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-xray.md +0 -55
  198. package/skills/testeiya/testomatio-docs/docs/project/plans/index.md +0 -334
  199. package/skills/testeiya/testomatio-docs/docs/project/pulse/index.md +0 -104
  200. package/skills/testeiya/testomatio-docs/docs/project/runs/archive-runs-and-groups.md +0 -176
  201. package/skills/testeiya/testomatio-docs/docs/project/runs/custom-statuses.md +0 -195
  202. package/skills/testeiya/testomatio-docs/docs/project/runs/environments.md +0 -203
  203. package/skills/testeiya/testomatio-docs/docs/project/runs/managing-runs.md +0 -455
  204. package/skills/testeiya/testomatio-docs/docs/project/runs/merge-strategies.md +0 -137
  205. package/skills/testeiya/testomatio-docs/docs/project/runs/reports.md +0 -329
  206. package/skills/testeiya/testomatio-docs/docs/project/runs/rungroups.md +0 -342
  207. package/skills/testeiya/testomatio-docs/docs/project/runs/running-automated-tests.md +0 -256
  208. package/skills/testeiya/testomatio-docs/docs/project/runs/running-manual-and-automated-tests.md +0 -331
  209. package/skills/testeiya/testomatio-docs/docs/project/runs/running-tests-manually.md +0 -633
  210. package/skills/testeiya/testomatio-docs/docs/project/runs/temporary-tests-notes.md +0 -223
  211. package/skills/testeiya/testomatio-docs/docs/project/steps-snippets/snippets.md +0 -68
  212. package/skills/testeiya/testomatio-docs/docs/project/steps-snippets/steps.md +0 -181
  213. package/skills/testeiya/testomatio-docs/docs/project/tests/bdd-test-case-editor.md +0 -98
  214. package/skills/testeiya/testomatio-docs/docs/project/tests/classical-test-case-editor.md +0 -354
  215. package/skills/testeiya/testomatio-docs/docs/project/tests/classical-vs-bdd.md +0 -169
  216. package/skills/testeiya/testomatio-docs/docs/project/tests/copy-and-move-your-tests.md +0 -156
  217. package/skills/testeiya/testomatio-docs/docs/project/tests/other-features-for-test-case-design.md +0 -412
  218. package/skills/testeiya/testomatio-docs/docs/project/tests/test-case-creation-and-editing.md +0 -527
  219. package/skills/testeiya/testomatio-docs/docs/support/index.md +0 -75
  220. package/skills/testeiya/testomatio-docs/docs/test-reporting/artifacts.md +0 -388
  221. package/skills/testeiya/testomatio-docs/docs/test-reporting/cli.md +0 -215
  222. package/skills/testeiya/testomatio-docs/docs/test-reporting/configuration.md +0 -247
  223. package/skills/testeiya/testomatio-docs/docs/test-reporting/frameworks.md +0 -490
  224. package/skills/testeiya/testomatio-docs/docs/test-reporting/functions.md +0 -144
  225. package/skills/testeiya/testomatio-docs/docs/test-reporting/index.mdx +0 -48
  226. package/skills/testeiya/testomatio-docs/docs/test-reporting/junit.md +0 -248
  227. package/skills/testeiya/testomatio-docs/docs/test-reporting/logger.md +0 -138
  228. package/skills/testeiya/testomatio-docs/docs/test-reporting/php.md +0 -77
  229. package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/bitbucket.md +0 -72
  230. package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/csv.md +0 -23
  231. package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/debug.md +0 -18
  232. package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/github.md +0 -63
  233. package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/gitlab.md +0 -29
  234. package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/html.md +0 -80
  235. package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/index.mdx +0 -57
  236. package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/testomatio.md +0 -331
  237. package/skills/testeiya/testomatio-docs/docs/test-reporting/python.md +0 -229
  238. package/skills/testeiya/testomatio-docs/docs/test-reporting/workflows.md +0 -325
  239. package/skills/testeiya/testomatio-docs/docs/tutorials/Interacting-via-API.md +0 -159
  240. package/skills/testeiya/testomatio-docs/docs/tutorials/Manual-Testing-Classic.md +0 -164
  241. package/skills/testeiya/testomatio-docs/docs/tutorials/Set-Up-Read-Only-Access.md +0 -85
  242. package/skills/testeiya/testomatio-docs/docs/tutorials/Using-AI-in-Testing.md +0 -163
  243. package/skills/testeiya/testomatio-docs/docs/tutorials/Working-with-Jira.md +0 -125
  244. package/skills/testeiya/testomatio-docs/docs/tutorials/java.md +0 -478
  245. package/skills/testeiya/testomatio-docs/docs/tutorials/playwright.md +0 -207
  246. package/skills/testeiya/testomatio-docs/docs/tutorials/webdriver.md +0 -218
  247. package/skills/testeiya/testomatio-docs/docs.lock.json +0 -6
  248. package/skills/testeiya/testomatio-reporter/SKILL.md +0 -307
  249. package/skills/testomatio/test-automation/setup-pr-testing/SKILL.md +0 -199
  250. package/skills.yaml +0 -21
  251. package/src/ai-debug.ts +0 -188
  252. package/src/api/agent-get.ts +0 -22
  253. package/src/api/agent-start.ts +0 -384
  254. package/src/api/client-log.ts +0 -29
  255. package/src/api/context.ts +0 -332
  256. package/src/api/debug-layout.ts +0 -47
  257. package/src/api/debug-report.ts +0 -29
  258. package/src/api/debug-snapshot.ts +0 -30
  259. package/src/api/debug-stream.ts +0 -52
  260. package/src/api/files-delete.ts +0 -184
  261. package/src/api/files-read.ts +0 -41
  262. package/src/api/files-rename.ts +0 -99
  263. package/src/api/files-tree.ts +0 -292
  264. package/src/api/files-write.ts +0 -41
  265. package/src/api/mcp.ts +0 -603
  266. package/src/api/memory.ts +0 -69
  267. package/src/api/open-external.ts +0 -39
  268. package/src/api/playwright-cli.ts +0 -606
  269. package/src/api/providers.ts +0 -457
  270. package/src/api/read-env-token.ts +0 -33
  271. package/src/api/sessions.ts +0 -79
  272. package/src/api/settings.ts +0 -120
  273. package/src/api/skills.ts +0 -58
  274. package/src/api/testomatio-attachment.ts +0 -89
  275. package/src/api/testomatio-auth.ts +0 -284
  276. package/src/api/testomatio-proxy.ts +0 -197
  277. package/src/api/testomatio-run-stats.ts +0 -81
  278. package/src/api/testomatio-target.ts +0 -225
  279. package/src/api/testomatio-transcription.ts +0 -82
  280. package/src/api/workspace-search.ts +0 -96
  281. package/src/api/workspace-sync.ts +0 -151
  282. package/src/api/workspace.ts +0 -165
  283. package/src/app-server.ts +0 -556
  284. package/src/bridge.ts +0 -251
  285. package/src/check-tests.ts +0 -156
  286. package/src/cli.ts +0 -17
  287. package/src/commands.ts +0 -244
  288. package/src/config.ts +0 -183
  289. package/src/connection.ts +0 -658
  290. package/src/context-store.ts +0 -265
  291. package/src/debug-bus.ts +0 -405
  292. package/src/extensions/tool-gate.ts +0 -220
  293. package/src/extensions/webui/ask-channel.ts +0 -52
  294. package/src/extensions/webui/index.ts +0 -184
  295. package/src/extensions/webui/tools/ask-question.ts +0 -88
  296. package/src/extensions/webui/tools/query-result.ts +0 -79
  297. package/src/extensions/webui/tools/render-chart.ts +0 -53
  298. package/src/extensions/webui/tools/render-item.ts +0 -61
  299. package/src/extensions/webui/tools/render-list.ts +0 -170
  300. package/src/extensions/webui/tools/render-result.ts +0 -85
  301. package/src/extensions/webui/tools/render-tree.ts +0 -71
  302. package/src/extensions/webui/tools/ui-widget.ts +0 -54
  303. package/src/extensions/webui/tools/widget-result.ts +0 -13
  304. package/src/extensions/webui/widget-channel.ts +0 -50
  305. package/src/file-log.ts +0 -196
  306. package/src/git-tracked.ts +0 -68
  307. package/src/gitignore.ts +0 -53
  308. package/src/json-store.ts +0 -43
  309. package/src/load-env.ts +0 -70
  310. package/src/loader-style.ts +0 -96
  311. package/src/main.ts +0 -140
  312. package/src/mcp-catalog.ts +0 -96
  313. package/src/models-catalog.ts +0 -72
  314. package/src/permissions.ts +0 -120
  315. package/src/project-dir.ts +0 -189
  316. package/src/project-info.ts +0 -108
  317. package/src/prompt/app-ui.ts +0 -59
  318. package/src/prompt/browser.ts +0 -27
  319. package/src/prompt/index.ts +0 -62
  320. package/src/prompt/tools.ts +0 -27
  321. package/src/server-info.ts +0 -62
  322. package/src/session-factory.ts +0 -442
  323. package/src/session-store.ts +0 -115
  324. package/src/shell-env.ts +0 -45
  325. package/src/skills.ts +0 -163
  326. package/src/sync-snapshot.ts +0 -140
  327. package/src/telemetry.ts +0 -239
  328. package/src/testomatio-auth.ts +0 -299
  329. package/src/testomatio.ts +0 -98
  330. package/src/theme.ts +0 -30
  331. package/src/user-env.ts +0 -94
  332. package/src/welcome.ts +0 -194
  333. package/src/workspace/safe-path.ts +0 -85
  334. package/src/workspace/test-md.ts +0 -70
  335. package/src/workspace-model.ts +0 -440
  336. package/testeiya.config.json +0 -14
  337. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/authentication-flows.md +0 -0
  338. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/authentication.md +0 -0
  339. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/clock-mocking.md +0 -0
  340. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/mobile-testing.md +0 -0
  341. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/multi-context.md +0 -0
  342. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/multi-user.md +0 -0
  343. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/network-advanced.md +0 -0
  344. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/third-party.md +0 -0
  345. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/architecture/pom-vs-fixtures.md +0 -0
  346. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/architecture/test-architecture.md +0 -0
  347. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/architecture/when-to-mock.md +0 -0
  348. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/browser-apis/browser-apis.md +0 -0
  349. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/browser-apis/iframes.md +0 -0
  350. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/browser-apis/service-workers.md +0 -0
  351. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/browser-apis/websockets.md +0 -0
  352. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/annotations.md +0 -0
  353. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/assertions-waiting.md +0 -0
  354. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/configuration.md +0 -0
  355. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/fixtures-hooks.md +0 -0
  356. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/global-setup.md +0 -0
  357. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/locators.md +0 -0
  358. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/page-object-model.md +0 -0
  359. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/projects-dependencies.md +0 -0
  360. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/test-data.md +0 -0
  361. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/test-suite-structure.md +0 -0
  362. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/test-tags.md +0 -0
  363. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/debugging/console-errors.md +0 -0
  364. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/debugging/debugging.md +0 -0
  365. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/debugging/error-testing.md +0 -0
  366. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/debugging/flaky-tests.md +0 -0
  367. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/frameworks/angular.md +0 -0
  368. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/frameworks/nextjs.md +0 -0
  369. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/frameworks/react.md +0 -0
  370. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/frameworks/vue.md +0 -0
  371. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/ci-cd.md +0 -0
  372. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/docker.md +0 -0
  373. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/github-actions.md +0 -0
  374. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/gitlab.md +0 -0
  375. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/other-providers.md +0 -0
  376. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/parallel-sharding.md +0 -0
  377. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/performance.md +0 -0
  378. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/reporting.md +0 -0
  379. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/test-coverage.md +0 -0
  380. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/accessibility.md +0 -0
  381. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/api-testing.md +0 -0
  382. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/browser-extensions.md +0 -0
  383. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/canvas-webgl.md +0 -0
  384. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/component-testing.md +0 -0
  385. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/drag-drop.md +0 -0
  386. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/electron.md +0 -0
  387. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/file-operations.md +0 -0
  388. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/file-upload-download.md +0 -0
  389. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/forms-validation.md +0 -0
  390. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/graphql-testing.md +0 -0
  391. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/i18n.md +0 -0
  392. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/performance-testing.md +0 -0
  393. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/security-testing.md +0 -0
  394. /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/visual-regression.md +0 -0
  395. /package/skills/{playwright-cli → playwright/playwright-cli}/SKILL.md +0 -0
  396. /package/skills/{playwright-cli → playwright/playwright-cli}/references/element-attributes.md +0 -0
  397. /package/skills/{playwright-cli → playwright/playwright-cli}/references/playwright-tests.md +0 -0
  398. /package/skills/{playwright-cli → playwright/playwright-cli}/references/request-mocking.md +0 -0
  399. /package/skills/{playwright-cli → playwright/playwright-cli}/references/running-code.md +0 -0
  400. /package/skills/{playwright-cli → playwright/playwright-cli}/references/session-management.md +0 -0
  401. /package/skills/{playwright-cli → playwright/playwright-cli}/references/storage-state.md +0 -0
  402. /package/skills/{playwright-cli → playwright/playwright-cli}/references/test-generation.md +0 -0
  403. /package/skills/{playwright-cli → playwright/playwright-cli}/references/tracing.md +0 -0
  404. /package/skills/{playwright-cli → playwright/playwright-cli}/references/video-recording.md +0 -0
@@ -0,0 +1,139 @@
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { createRequire } from "node:module";
3
+ import { join } from "node:path";
4
+ import { pathToFileURL } from "node:url";
5
+ import { PACKAGE_ROOT, PI_STATE_DIR } from "./env.js";
6
+ const require_ = createRequire(import.meta.url);
7
+ export const SERVER = "testomatio";
8
+ /**
9
+ * Promoted to their own tools instead of going through the proxy: the reads the
10
+ * skills reach for constantly. @testomatio/mcp exposes 90 tools and registering
11
+ * them all would cost roughly 15k tokens of system prompt, which is the bloat
12
+ * the proxy exists to avoid. Everything else stays reachable through `mcp`.
13
+ */
14
+ export const DIRECT_TOOLS = [
15
+ "tests_list",
16
+ "tests_get",
17
+ "tests_search",
18
+ "suites_list",
19
+ "suites_get",
20
+ "runs_list",
21
+ "runs_get",
22
+ "testruns_list",
23
+ "plans_list",
24
+ "plans_get",
25
+ "labels_list",
26
+ ];
27
+ /**
28
+ * The Testomat.io MCP server needs a project id as well as a token — a token on
29
+ * its own does not identify a project to it. Without one the agent still reaches
30
+ * the project through `check-tests` and REST, which need only the token, so the
31
+ * prompt says exactly that instead of naming tools that are not there.
32
+ */
33
+ export function tmsAccess() {
34
+ if (hasMcp())
35
+ return "mcp-proxy";
36
+ return "cli-only";
37
+ }
38
+ export function hasTestomatio() {
39
+ return Boolean(process.env.TESTOMATIO);
40
+ }
41
+ export function hasMcp() {
42
+ return Boolean(process.env.TESTOMATIO && projectId());
43
+ }
44
+ function projectId() {
45
+ return process.env.TESTOMATIO_PROJECT_ID ?? "";
46
+ }
47
+ /**
48
+ * An in-memory server definition built from the environment. Deliberately not
49
+ * discovered from the checkout: a CI clone must not be able to point the agent
50
+ * at an MCP server of its own.
51
+ */
52
+ export function mcpConfig() {
53
+ const args = [
54
+ require_.resolve("@testomatio/mcp/index.js"),
55
+ "--token",
56
+ process.env.TESTOMATIO ?? "",
57
+ "--project",
58
+ projectId(),
59
+ ];
60
+ const env = {};
61
+ if (process.env.TESTOMATIO_URL)
62
+ env.TESTOMATIO_BASE_URL = process.env.TESTOMATIO_URL;
63
+ return {
64
+ mcpServers: {
65
+ [SERVER]: {
66
+ command: process.execPath,
67
+ args,
68
+ env,
69
+ lifecycle: "lazy",
70
+ directTools: DIRECT_TOOLS,
71
+ },
72
+ },
73
+ };
74
+ }
75
+ export function metadataCachePath() {
76
+ return join(PI_STATE_DIR, "mcp-cache.json");
77
+ }
78
+ /**
79
+ * The MCP adapter, bundled at build time (see scripts/vendor-entry.ts). The
80
+ * specifier is built at runtime so it is never resolved at compile time — the
81
+ * bundle only exists after a build.
82
+ */
83
+ export function vendorBundle() {
84
+ return pathToFileURL(join(PACKAGE_ROOT, "dist", "vendor", "mcp.js")).href;
85
+ }
86
+ /**
87
+ * Direct tools are registered from the adapter's metadata cache, which does not
88
+ * exist on a fresh CI runner — so a first run would degrade to proxy-only. The
89
+ * tool metadata ships with this package as mcp-tools.json (generated from
90
+ * @testomatio/mcp's own definitions), and this writes it as a cache entry.
91
+ *
92
+ * The entry is keyed by a hash of the resolved server definition, so the hash
93
+ * comes from the adapter's own bundled code rather than a copy of its logic — a
94
+ * mismatch would silently invalidate the seed. A failure here is not fatal: the
95
+ * run continues proxy-only, which still works.
96
+ */
97
+ export async function seedMetadataCache(config) {
98
+ const cachePath = metadataCachePath();
99
+ if (existsSync(cachePath))
100
+ return;
101
+ const tools = readSeedTools();
102
+ if (tools.length === 0)
103
+ return;
104
+ const hash = await computeServerHash(config.mcpServers[SERVER]);
105
+ if (!hash)
106
+ return;
107
+ const cache = {
108
+ version: 1,
109
+ servers: {
110
+ [SERVER]: {
111
+ configHash: hash,
112
+ tools,
113
+ resources: [],
114
+ cachedAt: Date.now(),
115
+ },
116
+ },
117
+ };
118
+ mkdirSync(PI_STATE_DIR, { recursive: true });
119
+ writeFileSync(cachePath, `${JSON.stringify(cache, null, 2)}\n`, "utf8");
120
+ }
121
+ function readSeedTools() {
122
+ const path = join(PACKAGE_ROOT, "mcp-tools.json");
123
+ try {
124
+ return JSON.parse(readFileSync(path, "utf8"));
125
+ }
126
+ catch {
127
+ return [];
128
+ }
129
+ }
130
+ async function computeServerHash(definition) {
131
+ try {
132
+ const vendor = (await import(vendorBundle()));
133
+ return vendor.computeServerHash(definition);
134
+ }
135
+ catch {
136
+ return null;
137
+ }
138
+ }
139
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/mcp.ts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AG,EAAE;aACrB;SACF;KACF,CAAC;IACF,SAAS,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,aAAa,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,aAAa;IACpB,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAClD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,iBAAiB,CAAC,UAAmB;IAClD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC,CAE3C,CAAC;QACF,OAAO,MAAM,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,71 @@
1
+ /** Provider key env vars the CLI picks up from the environment. */
2
+ export const PROVIDER_KEYS = [
3
+ { provider: "openrouter", env: "OPENROUTER_API_KEY" },
4
+ { provider: "anthropic", env: "ANTHROPIC_API_KEY" },
5
+ { provider: "openai", env: "OPENAI_API_KEY" },
6
+ { provider: "google", env: "GEMINI_API_KEY" },
7
+ ];
8
+ /** Bad usage — the caller prints the message and exits 2, never prompting. */
9
+ export class UsageError extends Error {
10
+ }
11
+ /**
12
+ * --model, then TESTEIYA_MODEL, then the model a resumed session was running.
13
+ * CI often has no model configured, so TESTEIYA_MODEL is the channel there. The
14
+ * desktop app's `~/.testeiya/config.json` is not consulted — a CI run must not
15
+ * depend on a choice made in someone's GUI. Anything unresolvable throws, so a
16
+ * run never falls through to a prompt.
17
+ */
18
+ export function resolveModel(runtime, explicit, saved) {
19
+ const candidate = explicit || process.env.TESTEIYA_MODEL;
20
+ let parsed = null;
21
+ if (candidate) {
22
+ parsed = splitModelId(candidate);
23
+ if (!parsed) {
24
+ throw new UsageError(`a model must be <provider>/<model-id>, got "${candidate}"`);
25
+ }
26
+ }
27
+ if (!parsed && saved)
28
+ parsed = { provider: saved.provider, id: saved.modelId };
29
+ if (!parsed) {
30
+ throw new UsageError("no model — pass --model <provider>/<id> or set TESTEIYA_MODEL");
31
+ }
32
+ const model = runtime.getModel(parsed.provider, parsed.id);
33
+ if (!model) {
34
+ throw new UsageError(`unknown model "${parsed.id}" for provider "${parsed.provider}"`);
35
+ }
36
+ return requireAuth(runtime, model);
37
+ }
38
+ /** Hand the runtime whichever provider keys the environment resolved. */
39
+ export async function applyEnvKeys(runtime) {
40
+ for (const { provider, env } of PROVIDER_KEYS) {
41
+ const key = process.env[env];
42
+ if (!key)
43
+ continue;
44
+ if (runtime.hasConfiguredAuth(provider))
45
+ continue;
46
+ await runtime.setRuntimeApiKey(provider, key);
47
+ }
48
+ }
49
+ // Without this the run reaches pi's own credential error, which points at a
50
+ // `/login` command this CLI does not have and at paths inside node_modules.
51
+ function requireAuth(runtime, model) {
52
+ if (runtime.hasConfiguredAuth(model.provider))
53
+ return model;
54
+ const known = PROVIDER_KEYS.find((k) => k.provider === model.provider);
55
+ let how = `save a key for "${model.provider}" in ~/.testeiya/auth.json`;
56
+ if (known)
57
+ how = `set ${known.env} in the environment or ~/.testeiya/.env`;
58
+ throw new UsageError(`no API key for ${model.provider} (model ${model.id}) — ${how}`);
59
+ }
60
+ // Splits on the FIRST slash — OpenRouter model ids contain slashes themselves.
61
+ function splitModelId(value) {
62
+ const slash = value.indexOf("/");
63
+ if (slash <= 0)
64
+ return null;
65
+ const provider = value.slice(0, slash);
66
+ const id = value.slice(slash + 1);
67
+ if (!id)
68
+ return null;
69
+ return { provider,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KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACvC,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IACrB,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { createRuntime } from "./session.js";
2
+ export async function runModels(pattern, json) {
3
+ const runtime = await createRuntime();
4
+ // Providers with a key, from the SDK catalog. getAvailable() probes the
5
+ // network for every provider and one bad response takes the whole list down.
6
+ const available = runtime
7
+ .getProviders()
8
+ .filter((provider) => runtime.hasConfiguredAuth(provider.id))
9
+ .flatMap((provider) => runtime.getModels(provider.id));
10
+ const ids = available
11
+ .map((model) => `${model.provider}/${model.id}`)
12
+ .filter((id) => !pattern || id.toLowerCase().includes(pattern.toLowerCase()))
13
+ .sort();
14
+ if (json) {
15
+ process.stdout.write(`${JSON.stringify({ models: ids }, null, 2)}\n`);
16
+ return 0;
17
+ }
18
+ if (ids.length === 0) {
19
+ if (available.length > 0) {
20
+ process.stdout.write(` no model matches "${pattern}"\n`);
21
+ return 1;
22
+ }
23
+ process.stdout.write(" no provider key found — see: testeiya doctor\n");
24
+ return 1;
25
+ }
26
+ let provider = "";
27
+ for (const id of ids) {
28
+ const current = id.slice(0, id.indexOf("/"));
29
+ if (current !== provider) {
30
+ provider = current;
31
+ process.stdout.write(`\n ${provider}\n`);
32
+ }
33
+ process.stdout.write(` ${id}\n`);
34
+ }
35
+ process.stdout.write("\n Pass one with --model, or set TESTEIYA_MODEL.\n");
36
+ return 0;
37
+ }
38
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1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OAAO,CAAC,CAAC;QACX,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACzE,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,MAAM,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7C,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;YACzB,QAAQ,GAAG,OAAO,CAAC;YACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,QAAQ,IAAI,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;IAC5E,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,194 @@
1
+ import { spawn } from "node:child_process";
2
+ import { access, constants, readFile, writeFile } from "node:fs/promises";
3
+ import { dirname, resolve } from "node:path";
4
+ const GH_SCHEME = "gh:";
5
+ /**
6
+ * Where the report goes. Only known schemes are recognised: a generic
7
+ * `<word>:` test would swallow `C:\reports\out.md` on Windows.
8
+ */
9
+ export function parseDestinations(values, json) {
10
+ const destinations = [];
11
+ for (const value of values) {
12
+ const destination = parseOne(value.trim());
13
+ if (typeof destination === "string")
14
+ return destination;
15
+ destinations.push(destination);
16
+ }
17
+ if (destinations.filter((d) => d.kind === "markdown").length > 1) {
18
+ return "only one markdown --output — the agent writes that file itself";
19
+ }
20
+ if (json)
21
+ destinations.push({ kind: "json" });
22
+ if (destinations.length === 0)
23
+ destinations.push({ kind: "stdout" });
24
+ return destinations;
25
+ }
26
+ /** The file the agent is told to write, if any. */
27
+ export function markdownPath(destinations) {
28
+ for (const destination of destinations) {
29
+ if (destination.kind === "markdown")
30
+ return destination.path;
31
+ }
32
+ return undefined;
33
+ }
34
+ /**
35
+ * Check every destination before the run starts. A ten-minute run that then
36
+ * cannot post is the worst outcome, so this spends no tokens to find out.
37
+ */
38
+ export async function preflight(destinations) {
39
+ for (const destination of destinations) {
40
+ const path = filePath(destination);
41
+ if (path) {
42
+ const dir = dirname(resolve(path));
43
+ const writable = await access(dir, constants.W_OK).then(pass, fail);
44
+ if (!writable)
45
+ return `cannot write to ${dir}`;
46
+ }
47
+ if (destination.kind !== "gh")
48
+ continue;
49
+ const gh = await run("gh", ["--version"]);
50
+ if (gh.code !== 0)
51
+ return "gh is not installed — see https://cli.github.com";
52
+ const pr = await resolvePullRequest(destination.pr);
53
+ if (!pr)
54
+ return "no pull request for this branch — pass gh:pr#<number>";
55
+ destination.pr = pr;
56
+ }
57
+ return null;
58
+ }
59
+ /** Route the finished report. Returns a message when a destination failed. */
60
+ export async function deliver(destinations, envelope, footer) {
61
+ for (const destination of destinations) {
62
+ const failure = await deliverOne(destination, envelope, footer);
63
+ if (failure)
64
+ return failure;
65
+ }
66
+ return null;
67
+ }
68
+ /**
69
+ * The comment as posted. The footer is how a thread stays a thread: it tells
70
+ * the reader what to type to answer this comment.
71
+ */
72
+ export function commentBody(report, footer) {
73
+ if (!footer?.trim())
74
+ return report;
75
+ return `${report.trimEnd()}\n\n${footer.trim()}\n`;
76
+ }
77
+ async function deliverOne(destination, envelope, footer) {
78
+ if (destination.kind === "markdown")
79
+ return null;
80
+ if (destination.kind === "json") {
81
+ const body = `${JSON.stringify(envelope, null, 2)}\n`;
82
+ if (!destination.path) {
83
+ process.stdout.write(body);
84
+ return null;
85
+ }
86
+ const written = await writeFile(destination.path, body, "utf8").then(pass, fail);
87
+ if (!written)
88
+ return `could not write ${destination.path}`;
89
+ return null;
90
+ }
91
+ if (!envelope.report)
92
+ return null;
93
+ if (destination.kind === "stdout") {
94
+ process.stdout.write(envelope.report);
95
+ return null;
96
+ }
97
+ const result = await run("gh", ["pr", "comment", String(destination.pr), "--body-file", "-"], {
98
+ stdin: commentBody(envelope.report, footer),
99
+ });
100
+ if (result.code !== 0)
101
+ return `gh pr comment failed: ${result.stderr.trim() || result.code}`;
102
+ return null;
103
+ }
104
+ function parseOne(value) {
105
+ if (!value)
106
+ return "empty --output";
107
+ if (value.startsWith(GH_SCHEME))
108
+ return parseGithub(value.slice(GH_SCHEME.length));
109
+ if (value.endsWith(".json"))
110
+ return { kind: "json", path: value };
111
+ return { kind: "markdown", path: value };
112
+ }
113
+ function parseGithub(target) {
114
+ if (target === "pr" || target === "pr-comment")
115
+ return { kind: "gh" };
116
+ if (target.startsWith("pr#")) {
117
+ const number = Number(target.slice(3));
118
+ if (Number.isInteger(number) && number > 0)
119
+ return { kind: "gh", pr: number };
120
+ }
121
+ return `unknown output "gh:${target}" — use gh:pr-comment or gh:pr#123`;
122
+ }
123
+ function filePath(destination) {
124
+ if (destination.kind === "markdown")
125
+ return destination.path;
126
+ if (destination.kind === "json")
127
+ return destination.path;
128
+ return undefined;
129
+ }
130
+ async function resolvePullRequest(explicit) {
131
+ if (explicit)
132
+ return explicit;
133
+ const fromEvent = await pullRequestFromEvent();
134
+ if (fromEvent)
135
+ return fromEvent;
136
+ const fromRef = pullRequestFromRef();
137
+ if (fromRef)
138
+ return fromRef;
139
+ const view = await run("gh", ["pr", "view", "--json", "number", "-q", ".number"]);
140
+ if (view.code !== 0)
141
+ return null;
142
+ return positive(view.stdout.trim());
143
+ }
144
+ // GitHub Actions describes the event it triggered on in a file, and that is the
145
+ // only place a `pull_request_target` run states its number.
146
+ async function pullRequestFromEvent() {
147
+ const path = process.env.GITHUB_EVENT_PATH;
148
+ if (!path)
149
+ return null;
150
+ const raw = await readFile(path, "utf8").catch(() => "");
151
+ if (!raw)
152
+ return null;
153
+ let event;
154
+ try {
155
+ event = JSON.parse(raw);
156
+ }
157
+ catch {
158
+ return null;
159
+ }
160
+ return event.pull_request?.number ?? event.issue?.number ?? null;
161
+ }
162
+ function pullRequestFromRef() {
163
+ const ref = process.env.GITHUB_REF ?? "";
164
+ if (!ref.startsWith("refs/pull/"))
165
+ return null;
166
+ return positive(ref.split("/")[2] ?? "");
167
+ }
168
+ function positive(value) {
169
+ const number = Number(value);
170
+ if (Number.isInteger(number) && number > 0)
171
+ return number;
172
+ return null;
173
+ }
174
+ function run(command, args, options) {
175
+ return new Promise((done) => {
176
+ const child = spawn(command, args, { stdio: ["pipe", "pipe", "pipe"] });
177
+ let stdout = "";
178
+ let stderr = "";
179
+ child.stdout.on("data", (chunk) => (stdout += chunk));
180
+ child.stderr.on("data", (chunk) => (stderr += chunk));
181
+ child.on("error", (err) => done({ code: 127, stdout, stderr: err.message }));
182
+ child.on("close", (code) => done({ code: code ?? 1, stdout, stderr }));
183
+ if (options?.stdin)
184
+ child.stdin.write(options.stdin);
185
+ child.stdin.end();
186
+ });
187
+ }
188
+ function pass() {
189
+ return true;
190
+ }
191
+ function fail() {
192
+ return false;
193
+ }
194
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,SAAS,GAAG,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAgB,EAAE,IAAc;IAChE,MAAM,YAAY,GAAkB,EAAE,CAAC;IACvC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3C,IAAI,OAAO,WAAW,KAAK,QAAQ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AAC;AAED,SAAS,IAAI;IACX,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,IAAI;IACX,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { Type } from "typebox";
2
+ export function createSetResultTool(runtime) {
3
+ return {
4
+ name: "set_result",
5
+ label: "Set run result",
6
+ description: "Set the outcome of this non-interactive run, which becomes the process " +
7
+ "exit code. Call once with status 'fail' when the verdict is negative — " +
8
+ "regressions found, a quality gate unmet, tests broken, or the task could " +
9
+ "not be completed. Do not call it on success: the run passes by default. " +
10
+ "This does not end the run; finish your work and write your report as usual.",
11
+ parameters: Type.Object({
12
+ status: Type.Union([Type.Literal("pass"), Type.Literal("fail")], {
13
+ description: "'fail' exits the process with code 1; 'pass' with code 0.",
14
+ }),
15
+ reason: Type.String({
16
+ description: "One line explaining the verdict, shown to whoever runs the command " +
17
+ "(e.g. '3 of 12 checkout tests have no assertions').",
18
+ }),
19
+ }),
20
+ async execute(_toolCallId, params) {
21
+ const p = params;
22
+ runtime.status = p.status;
23
+ runtime.reason = p.reason;
24
+ return {
25
+ content: [
26
+ {
27
+ type: "text",
28
+ text: `Recorded: ${p.status}. The command will exit ${exitFor(p.status)}.`,
29
+ },
30
+ ],
31
+ details: p,
32
+ };
33
+ },
34
+ };
35
+ }
36
+ function exitFor(status) {
37
+ if (status === "fail")
38
+ return 1;
39
+ return 0;
40
+ }
41
+ //# sourceMappingURL=result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,MAAM,UAAU,mBAAmB,CAAC,OAAkB;IACpD,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,yEAAyE;YACzE,yEAAyE;YACzE,2EAA2E;YAC3E,0EAA0E;YAC1E,6EAA6E;QAC/E,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC;YACtB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE;gBAC/D,WAAW,EAAE,2DAA2D;aACzE,CAAC;YACF,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;gBAClB,WAAW,EACT,qEAAqE;oBACrE,qDAAqD;aACxD,CAAC;SACH,CAAC;QACF,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM;YAC/B,MAAM,CAAC,GAAG,MAAqD,CAAC;YAChE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;YAC1B,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;YAC1B,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,aAAa,CAAC,CAAC,MAAM,2BAA2B,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG;qBAC3E;iBACF;gBACD,OAAO,EAAE,CAAC;aACX,CAAC;QACJ,CAAC;KACgB,CAAC;AACtB,CAAC;AAED,SAAS,OAAO,CAAC,MAAuB;IACtC,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,CAAC;AACX,CAAC"}