@copado/agentia-cli 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (394) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +3290 -2095
  3. package/dist/commands/ai/agent/ask.js +4 -4
  4. package/dist/commands/ai/agent/chat.js +4 -4
  5. package/dist/commands/auth/get.js +21 -1
  6. package/dist/commands/auth/set.js +13 -0
  7. package/dist/commands/auth/unset.js +37 -0
  8. package/dist/commands/cicd/cloud/commit.js +2 -2
  9. package/dist/commands/cicd/cloud/promote.js +19 -5
  10. package/dist/commands/cicd/credential/auth/status.js +38 -0
  11. package/dist/commands/cicd/credential/auth/web/login.js +54 -0
  12. package/dist/commands/cicd/credential/create.js +2 -2
  13. package/dist/commands/cicd/credential/list.js +15 -19
  14. package/dist/commands/cicd/credential/open.js +30 -0
  15. package/dist/commands/cicd/credential/update.js +11 -14
  16. package/dist/commands/cicd/data/commit/create.js +2 -2
  17. package/dist/commands/cicd/data/commit/list.js +2 -2
  18. package/dist/commands/cicd/data/dataset-file/content.js +2 -2
  19. package/dist/commands/cicd/data/dataset-file/list.js +2 -2
  20. package/dist/commands/cicd/data/filter/add.js +2 -2
  21. package/dist/commands/cicd/data/filter/delete.js +2 -2
  22. package/dist/commands/cicd/data/filter/list.js +2 -2
  23. package/dist/commands/cicd/data/filter/update.js +2 -2
  24. package/dist/commands/cicd/data/formula/create.js +2 -2
  25. package/dist/commands/cicd/data/formula/list.js +2 -2
  26. package/dist/commands/cicd/data/formula/update.js +2 -2
  27. package/dist/commands/cicd/data/records/match.js +2 -2
  28. package/dist/commands/cicd/data/records/search.js +2 -2
  29. package/dist/commands/cicd/data/sobject/fields.js +2 -2
  30. package/dist/commands/cicd/data/sobject/relationships.js +2 -2
  31. package/dist/commands/cicd/data/sync/apply.js +2 -2
  32. package/dist/commands/cicd/data/sync/preview-updates.js +2 -2
  33. package/dist/commands/cicd/data/template/convert-old.js +2 -2
  34. package/dist/commands/cicd/data/template/create.js +2 -2
  35. package/dist/commands/cicd/data/template/delete.js +2 -2
  36. package/dist/commands/cicd/data/template/get-detail.js +2 -2
  37. package/dist/commands/cicd/data/template/get.js +2 -2
  38. package/dist/commands/cicd/data/template/list.js +2 -2
  39. package/dist/commands/cicd/data/template/open.js +2 -2
  40. package/dist/commands/cicd/data/template/save-detail.js +2 -2
  41. package/dist/commands/cicd/environment/auth/status.js +36 -15
  42. package/dist/commands/cicd/environment/auth/web/login.js +22 -6
  43. package/dist/commands/cicd/environment/create.js +2 -2
  44. package/dist/commands/cicd/environment/get.js +2 -2
  45. package/dist/commands/cicd/environment/list.js +2 -2
  46. package/dist/commands/cicd/environment/open.js +8 -24
  47. package/dist/commands/cicd/environment/update.js +2 -2
  48. package/dist/commands/cicd/extension/create.js +2 -2
  49. package/dist/commands/cicd/extension/install.js +2 -2
  50. package/dist/commands/cicd/extension/package.js +2 -2
  51. package/dist/commands/cicd/extension/publish.js +2 -2
  52. package/dist/commands/cicd/extension/uninstall.js +2 -2
  53. package/dist/commands/cicd/extension/validate.js +2 -2
  54. package/dist/commands/cicd/extension-configuration/get.js +24 -0
  55. package/dist/commands/cicd/extension-configuration/list.js +49 -0
  56. package/dist/commands/cicd/extension-configuration/open.js +38 -0
  57. package/dist/commands/cicd/function/defaults.js +2 -2
  58. package/dist/commands/cicd/function/delete.js +2 -2
  59. package/dist/commands/cicd/function/get.js +2 -2
  60. package/dist/commands/cicd/function/list.js +2 -2
  61. package/dist/commands/cicd/function/open.js +2 -2
  62. package/dist/commands/cicd/function/result/get.js +2 -2
  63. package/dist/commands/cicd/function/result/log/get.js +2 -2
  64. package/dist/commands/cicd/function/run-local.js +2 -2
  65. package/dist/commands/cicd/function/run.js +2 -2
  66. package/dist/commands/cicd/function/upsert.js +2 -2
  67. package/dist/commands/cicd/health-check.js +2 -2
  68. package/dist/commands/cicd/job/get.js +2 -2
  69. package/dist/commands/cicd/job/kill.js +2 -2
  70. package/dist/commands/cicd/job/list.js +2 -2
  71. package/dist/commands/cicd/job/log/get.js +2 -2
  72. package/dist/commands/cicd/job/open.js +2 -2
  73. package/dist/commands/cicd/job/pause.js +2 -2
  74. package/dist/commands/cicd/job/result-file/get.js +2 -2
  75. package/dist/commands/cicd/job/result-file/list.js +2 -2
  76. package/dist/commands/cicd/job/resume.js +2 -2
  77. package/dist/commands/cicd/job/run.js +2 -2
  78. package/dist/commands/cicd/metadata/content/compare.js +2 -2
  79. package/dist/commands/cicd/metadata/content/get.js +3 -3
  80. package/dist/commands/cicd/metadata/dependency/list.js +45 -22
  81. package/dist/commands/cicd/metadata/explore.js +81 -0
  82. package/dist/commands/cicd/metadata/index/compare.js +2 -2
  83. package/dist/commands/cicd/metadata/list.js +5 -5
  84. package/dist/commands/cicd/metadata/refresh/deleted.js +3 -3
  85. package/dist/commands/cicd/metadata/refresh/run.js +4 -4
  86. package/dist/commands/cicd/metadata/refresh/status.js +4 -4
  87. package/dist/commands/cicd/notification/configure.js +2 -2
  88. package/dist/commands/cicd/notification/get.js +2 -2
  89. package/dist/commands/cicd/pipeline/automation/activate.js +39 -0
  90. package/dist/commands/cicd/pipeline/automation/create.js +33 -0
  91. package/dist/commands/cicd/pipeline/automation/deactivate.js +39 -0
  92. package/dist/commands/cicd/pipeline/automation/delete.js +45 -0
  93. package/dist/commands/cicd/pipeline/automation/get.js +32 -0
  94. package/dist/commands/cicd/pipeline/automation/list.js +38 -0
  95. package/dist/commands/cicd/pipeline/automation/open.js +38 -0
  96. package/dist/commands/cicd/pipeline/automation/update.js +38 -0
  97. package/dist/commands/cicd/pipeline/connection/create.js +2 -2
  98. package/dist/commands/cicd/pipeline/connection/delete.js +2 -2
  99. package/dist/commands/cicd/pipeline/connection/list.js +2 -2
  100. package/dist/commands/cicd/pipeline/connection/open.js +2 -2
  101. package/dist/commands/cicd/pipeline/connection/update.js +2 -2
  102. package/dist/commands/cicd/pipeline/create.js +2 -2
  103. package/dist/commands/cicd/pipeline/get.js +2 -2
  104. package/dist/commands/cicd/pipeline/list.js +2 -2
  105. package/dist/commands/cicd/pipeline/open.js +2 -2
  106. package/dist/commands/cicd/pipeline/quality-gate/activate.js +39 -0
  107. package/dist/commands/cicd/pipeline/quality-gate/create.js +34 -0
  108. package/dist/commands/cicd/pipeline/quality-gate/deactivate.js +39 -0
  109. package/dist/commands/cicd/pipeline/quality-gate/delete.js +45 -0
  110. package/dist/commands/cicd/pipeline/quality-gate/get.js +32 -0
  111. package/dist/commands/cicd/pipeline/quality-gate/list.js +34 -0
  112. package/dist/commands/cicd/pipeline/quality-gate/open.js +38 -0
  113. package/dist/commands/cicd/pipeline/quality-gate/update.js +38 -0
  114. package/dist/commands/cicd/pipeline/stage-connection/create.js +2 -2
  115. package/dist/commands/cicd/pipeline/stage-connection/delete.js +2 -2
  116. package/dist/commands/cicd/pipeline/stage-connection/list.js +2 -2
  117. package/dist/commands/cicd/pipeline/stage-connection/open.js +2 -2
  118. package/dist/commands/cicd/pipeline/stage-connection/update.js +2 -2
  119. package/dist/commands/cicd/pipeline/update.js +2 -2
  120. package/dist/commands/cicd/project/create.js +2 -2
  121. package/dist/commands/cicd/project/default/get.js +2 -2
  122. package/dist/commands/cicd/project/default/set.js +2 -2
  123. package/dist/commands/cicd/project/default/unset.js +2 -2
  124. package/dist/commands/cicd/project/delete.js +2 -2
  125. package/dist/commands/cicd/project/get.js +2 -2
  126. package/dist/commands/cicd/project/list.js +2 -2
  127. package/dist/commands/cicd/project/open.js +2 -2
  128. package/dist/commands/cicd/project/update.js +2 -2
  129. package/dist/commands/cicd/promotion/conflict/get.js +2 -2
  130. package/dist/commands/cicd/promotion/conflict/list.js +2 -2
  131. package/dist/commands/cicd/promotion/conflict/resolve.js +2 -2
  132. package/dist/commands/cicd/promotion/conflict/unresolve.js +2 -2
  133. package/dist/commands/cicd/promotion/get.js +2 -2
  134. package/dist/commands/cicd/promotion/job-step/update.js +2 -2
  135. package/dist/commands/cicd/promotion/list.js +2 -2
  136. package/dist/commands/cicd/promotion/open.js +2 -2
  137. package/dist/commands/cicd/promotion/queue/list.js +28 -0
  138. package/dist/commands/cicd/promotion/queue/remove.js +37 -0
  139. package/dist/commands/cicd/promotion/run.js +2 -2
  140. package/dist/commands/cicd/repository/auth/https/configure.js +2 -2
  141. package/dist/commands/cicd/repository/auth/oauth/login.js +2 -2
  142. package/dist/commands/cicd/repository/auth/setup.js +2 -2
  143. package/dist/commands/cicd/repository/auth/ssh/configure.js +2 -2
  144. package/dist/commands/cicd/repository/create.js +2 -2
  145. package/dist/commands/cicd/repository/delete.js +2 -2
  146. package/dist/commands/cicd/repository/get.js +2 -2
  147. package/dist/commands/cicd/repository/list.js +2 -2
  148. package/dist/commands/cicd/repository/open.js +2 -2
  149. package/dist/commands/cicd/repository/reset.js +2 -2
  150. package/dist/commands/cicd/repository/update.js +2 -2
  151. package/dist/commands/cicd/repository/validate.js +2 -2
  152. package/dist/commands/cicd/stage/create.js +2 -2
  153. package/dist/commands/cicd/stage/delete.js +2 -2
  154. package/dist/commands/cicd/stage/get.js +2 -2
  155. package/dist/commands/cicd/stage/list.js +2 -2
  156. package/dist/commands/cicd/stage/open.js +2 -2
  157. package/dist/commands/cicd/stage/update.js +2 -2
  158. package/dist/commands/cicd/template/defaults.js +2 -2
  159. package/dist/commands/cicd/template/delete.js +2 -2
  160. package/dist/commands/cicd/template/get.js +2 -2
  161. package/dist/commands/cicd/template/list.js +2 -2
  162. package/dist/commands/cicd/template/upsert.js +2 -2
  163. package/dist/commands/cicd/user/get.js +2 -2
  164. package/dist/commands/cicd/work/ahead-behind.js +2 -2
  165. package/dist/commands/cicd/work/create.js +3 -2
  166. package/dist/commands/cicd/work/delete.js +2 -2
  167. package/dist/commands/cicd/work/deployment-step/create.js +2 -2
  168. package/dist/commands/cicd/work/deployment-step/delete.js +2 -2
  169. package/dist/commands/cicd/work/deployment-step/list.js +2 -2
  170. package/dist/commands/cicd/work/deployment-step/reorder.js +2 -2
  171. package/dist/commands/cicd/work/deployment-step/salesforce-flows.js +2 -2
  172. package/dist/commands/cicd/work/deployment-step/types.js +2 -2
  173. package/dist/commands/cicd/work/deployment-step/update.js +2 -2
  174. package/dist/commands/cicd/work/done.js +2 -2
  175. package/dist/commands/cicd/work/environment-sync.js +10 -9
  176. package/dist/commands/cicd/work/get.js +2 -2
  177. package/dist/commands/cicd/work/list.js +2 -2
  178. package/dist/commands/cicd/work/open.js +2 -2
  179. package/dist/commands/cicd/work/promote.js +2 -2
  180. package/dist/commands/cicd/work/publish.js +2 -2
  181. package/dist/commands/cicd/work/push.js +2 -2
  182. package/dist/commands/cicd/work/set.js +8 -6
  183. package/dist/commands/cicd/work/status.js +2 -2
  184. package/dist/commands/cicd/work/submit.js +5 -4
  185. package/dist/commands/cicd/work/test/apex.js +2 -2
  186. package/dist/commands/cicd/work/test.js +2 -2
  187. package/dist/commands/cicd/work/update.js +3 -2
  188. package/dist/commands/help-agent.js +15 -0
  189. package/dist/commands/help.js +38 -0
  190. package/dist/commands/history/clear.js +42 -0
  191. package/dist/commands/history/list.js +50 -0
  192. package/dist/commands/plugins/install.js +2 -5
  193. package/dist/commands/setup/skills/create.js +28 -2
  194. package/dist/commands/setup/skills/list.js +55 -0
  195. package/dist/commands/setup/skills/update.js +36 -3
  196. package/dist/commands/setup.js +3 -3
  197. package/dist/commands/support.js +15 -0
  198. package/dist/commands/testing/browser/execute.js +49 -0
  199. package/dist/commands/testing/browser/history.js +49 -0
  200. package/dist/commands/testing/browser/inspect.js +35 -0
  201. package/dist/commands/testing/browser/recorder.js +52 -0
  202. package/dist/commands/testing/browser/reports.js +33 -0
  203. package/dist/commands/testing/browser/screenshot.js +27 -0
  204. package/dist/commands/testing/browser/set-options.js +35 -0
  205. package/dist/commands/testing/browser/start.js +51 -0
  206. package/dist/commands/testing/browser/status.js +26 -0
  207. package/dist/commands/testing/browser/stop.js +34 -0
  208. package/dist/commands/testing/browser/view.js +35 -0
  209. package/dist/commands/testing/data-table/create.js +1 -2
  210. package/dist/commands/testing/data-table/delete.js +1 -2
  211. package/dist/commands/testing/data-table/export.js +2 -6
  212. package/dist/commands/testing/data-table/get.js +2 -4
  213. package/dist/commands/testing/data-table/list.js +1 -2
  214. package/dist/commands/testing/data-table/update.js +3 -4
  215. package/dist/commands/testing/job/create.js +26 -22
  216. package/dist/commands/testing/job/delete.js +2 -2
  217. package/dist/commands/testing/job/files/download.js +73 -0
  218. package/dist/commands/testing/job/files/list.js +43 -0
  219. package/dist/commands/testing/job/{upload.js → files/upload.js} +13 -9
  220. package/dist/commands/testing/job/get.js +2 -2
  221. package/dist/commands/testing/job/list.js +1 -1
  222. package/dist/commands/testing/job/refs.js +4 -4
  223. package/dist/commands/testing/job/run.js +134 -1
  224. package/dist/commands/testing/{build → job/runs}/abort.js +10 -8
  225. package/dist/commands/testing/job/runs/get.js +42 -0
  226. package/dist/commands/testing/{build → job/runs}/list.js +19 -10
  227. package/dist/commands/testing/{logs.js → job/runs/logs.js} +9 -6
  228. package/dist/commands/testing/{build → job/runs}/search.js +9 -7
  229. package/dist/commands/testing/job/schedule/get.js +5 -11
  230. package/dist/commands/testing/job/schedule/remove.js +3 -3
  231. package/dist/commands/testing/job/schedule/set.js +3 -3
  232. package/dist/commands/testing/job/update.js +22 -65
  233. package/dist/commands/testing/project/create.js +1 -17
  234. package/dist/commands/testing/project/get.js +0 -1
  235. package/dist/commands/testing/project/list.js +2 -2
  236. package/dist/commands/testing/project/permission/set.js +3 -7
  237. package/dist/commands/testing/project/permission/update.js +2 -2
  238. package/dist/commands/testing/robot/create.js +22 -25
  239. package/dist/commands/testing/robot/get.js +1 -1
  240. package/dist/commands/testing/robot/list.js +3 -3
  241. package/dist/commands/testing/robot/update.js +3 -3
  242. package/dist/commands/testing/user-parameter/create.js +3 -9
  243. package/dist/commands/testing/user-parameter/update.js +1 -7
  244. package/dist/commands/testing/variable/create.js +4 -9
  245. package/dist/commands/testing/variable/list.js +3 -3
  246. package/dist/commands/testing/variable/update.js +5 -12
  247. package/dist/help.js +17 -0
  248. package/dist/hooks/init/cicd-connection.js +59 -0
  249. package/dist/lib/agentia-command.js +69 -6
  250. package/dist/lib/ai-types.js +2 -1
  251. package/dist/lib/cicd-command.js +3 -0
  252. package/dist/lib/cicd-connection.js +22 -0
  253. package/dist/lib/cicd-gateway.js +2 -1
  254. package/dist/lib/claude-mcp-config.js +15 -0
  255. package/dist/lib/command-history-sanitization.js +9 -0
  256. package/dist/lib/command-history.js +11 -0
  257. package/dist/lib/command-output-buffer.js +6 -1
  258. package/dist/lib/credential-sync.js +1 -2
  259. package/dist/lib/defaults-store.js +6 -1
  260. package/dist/lib/dependency-from-changes.js +3 -1
  261. package/dist/lib/dependency-source-context.js +3 -0
  262. package/dist/lib/environment-auth-status.js +2 -1
  263. package/dist/lib/environment-auth.js +2 -1
  264. package/dist/lib/environment-credential-flags.js +3 -1
  265. package/dist/lib/environment-credential-operations.js +8 -2
  266. package/dist/lib/environment-types.js +3 -1
  267. package/dist/lib/extension-configuration-ops.js +4 -0
  268. package/dist/lib/extension-configuration-sanitize.js +7 -0
  269. package/dist/lib/extension-configuration-types.js +8 -0
  270. package/dist/lib/help-agent-command.js +3 -0
  271. package/dist/lib/help-agent-interaction-history.js +10 -0
  272. package/dist/lib/help-agent-session.js +3 -0
  273. package/dist/lib/http-proxy.js +13 -0
  274. package/dist/lib/mcp/ai-tools.js +3 -3
  275. package/dist/lib/mcp/command-id.js +2 -0
  276. package/dist/lib/mcp/pipeline-automation-quality-tools.js +452 -0
  277. package/dist/lib/mcp/result.js +41 -3
  278. package/dist/lib/mcp/server.js +73 -3
  279. package/dist/lib/mcp/testing-browser-tools.js +194 -0
  280. package/dist/lib/mcp/testing-tools.js +242 -552
  281. package/dist/lib/mcp/tool-annotations.js +59 -30
  282. package/dist/lib/mcp/tools.js +202 -66
  283. package/dist/lib/mcp/work-tools.js +18 -4
  284. package/dist/lib/metadata-explore.js +8 -0
  285. package/dist/lib/network-error.js +8 -0
  286. package/dist/lib/pipeline-automation-flags.js +12 -0
  287. package/dist/lib/pipeline-automation-ops.js +9 -0
  288. package/dist/lib/pipeline-automation-types.js +18 -0
  289. package/dist/lib/pipeline-lifecycle-id.js +3 -0
  290. package/dist/lib/pipeline-quality-gate-flags.js +12 -0
  291. package/dist/lib/pipeline-quality-gate-ops.js +9 -0
  292. package/dist/lib/pipeline-quality-gate-types.js +17 -0
  293. package/dist/lib/plugin-host/ai.js +2 -1
  294. package/dist/lib/plugin-skills.js +22 -0
  295. package/dist/lib/plugin-trust/gate.js +1 -2
  296. package/dist/lib/project-root.js +3 -1
  297. package/dist/lib/promotion-queue.js +5 -0
  298. package/dist/lib/promotion-run.js +2 -1
  299. package/dist/lib/runtime.js +1 -1
  300. package/dist/lib/salesforce-tooling-check.js +6 -0
  301. package/dist/lib/skill-packs.js +7 -0
  302. package/dist/lib/support-ai-context.js +11 -0
  303. package/dist/lib/support-ai-stream-parser.js +4 -0
  304. package/dist/lib/support-ai.js +9 -0
  305. package/dist/lib/testing-archive.js +9 -0
  306. package/dist/lib/testing-browser-command.js +6 -0
  307. package/dist/lib/testing-browser-operations.js +17 -0
  308. package/dist/lib/testing-browser-requests.js +11 -0
  309. package/dist/lib/testing-browser-robot.js +9 -0
  310. package/dist/lib/testing-browser-session.js +14 -0
  311. package/dist/lib/testing-browser-state.js +17 -0
  312. package/dist/lib/testing-browser-stream.js +7 -0
  313. package/dist/lib/testing-browser-types.js +3 -0
  314. package/dist/lib/testing-browser-viewer-key.js +7 -0
  315. package/dist/lib/testing-data-table.js +39 -0
  316. package/dist/lib/testing-execution.js +22 -0
  317. package/dist/lib/testing-flags.js +6 -2
  318. package/dist/lib/testing-gateway.js +5 -1
  319. package/dist/lib/testing-operations.js +9 -4
  320. package/dist/lib/testing-sanitization.js +3 -1
  321. package/dist/lib/testing-secret-input.js +2 -1
  322. package/dist/lib/testing-types.js +24 -3
  323. package/dist/lib/work-environment-sync.js +3 -1
  324. package/dist/lib/work-flags.js +6 -1
  325. package/dist/lib/work-local-development-flow.js +4 -0
  326. package/dist/lib/work-promote.js +2 -1
  327. package/dist/lib/work-submit-wait.js +3 -1
  328. package/oclif.manifest.json +8841 -7469
  329. package/package.json +45 -5
  330. package/templates/skills/agentia-ai/SKILL.md +9 -6
  331. package/templates/skills/agentia-ai/references/ai-agents.md +21 -3
  332. package/templates/skills/agentia-cicd/SKILL.md +8 -5
  333. package/templates/skills/agentia-cicd/references/environments-and-credentials.md +35 -13
  334. package/templates/skills/agentia-cicd/references/extensions.md +3 -0
  335. package/templates/skills/agentia-cicd/references/pipelines.md +36 -2
  336. package/templates/skills/agentia-cicd/references/promotions.md +10 -1
  337. package/templates/skills/agentia-cicd/references/work.md +20 -5
  338. package/templates/skills/agentia-metadata/SKILL.md +146 -0
  339. package/templates/skills/agentia-metadata/references/metadata-dependency.md +70 -0
  340. package/templates/skills/agentia-metadata/references/metadata-explore.md +146 -0
  341. package/templates/skills/agentia-testing/SKILL.md +12 -7
  342. package/templates/skills/agentia-testing/references/browser-testing.md +93 -0
  343. package/templates/skills/agentia-testing/references/flow-automation.md +112 -0
  344. package/templates/skills/agentia-testing/references/qforce.md +88 -0
  345. package/templates/skills/agentia-testing/references/qweb.md +103 -0
  346. package/templates/skills/agentia-testing/references/tests.md +31 -23
  347. package/dist/commands/testing/build/get.js +0 -38
  348. package/dist/commands/testing/build/latest.js +0 -40
  349. package/dist/commands/testing/build/logs.js +0 -47
  350. package/dist/commands/testing/build/run.js +0 -26
  351. package/dist/commands/testing/create.js +0 -2
  352. package/dist/commands/testing/job/download.js +0 -54
  353. package/dist/commands/testing/job/files.js +0 -34
  354. package/dist/commands/testing/live/continue.js +0 -21
  355. package/dist/commands/testing/live/execute.js +0 -43
  356. package/dist/commands/testing/live/history.js +0 -35
  357. package/dist/commands/testing/live/inspect.js +0 -30
  358. package/dist/commands/testing/live/interrupt.js +0 -21
  359. package/dist/commands/testing/live/recorder.js +0 -134
  360. package/dist/commands/testing/live/reports.js +0 -31
  361. package/dist/commands/testing/live/screenshot.js +0 -25
  362. package/dist/commands/testing/live/set-options.js +0 -28
  363. package/dist/commands/testing/live/start.js +0 -53
  364. package/dist/commands/testing/live/status.js +0 -27
  365. package/dist/commands/testing/live/stop.js +0 -38
  366. package/dist/commands/testing/live/view.js +0 -36
  367. package/dist/commands/testing/run.js +0 -26
  368. package/dist/commands/testing/status.js +0 -45
  369. package/dist/commands/testing/test/create.js +0 -2
  370. package/dist/commands/testing/test/logs.js +0 -2
  371. package/dist/commands/testing/test/run.js +0 -26
  372. package/dist/commands/testing/test/status.js +0 -2
  373. package/dist/commands/testing/test/update.js +0 -2
  374. package/dist/commands/testing/update.js +0 -65
  375. package/dist/lib/mcp/testing-live-tools.js +0 -215
  376. package/dist/lib/testing-data-command.js +0 -8
  377. package/dist/lib/testing-data-core.js +0 -20
  378. package/dist/lib/testing-data-export.js +0 -6
  379. package/dist/lib/testing-data-import.js +0 -6
  380. package/dist/lib/testing-data-io.js +0 -12
  381. package/dist/lib/testing-data-operations.js +0 -10
  382. package/dist/lib/testing-data-types.js +0 -4
  383. package/dist/lib/testing-live-command.js +0 -6
  384. package/dist/lib/testing-live-endpoints.js +0 -6
  385. package/dist/lib/testing-live-history.js +0 -7
  386. package/dist/lib/testing-live-operations.js +0 -19
  387. package/dist/lib/testing-live-recorder.js +0 -9
  388. package/dist/lib/testing-live-robot.js +0 -9
  389. package/dist/lib/testing-live-state.js +0 -5
  390. package/dist/lib/testing-live-types.js +0 -3
  391. package/dist/lib/testing-run-command.js +0 -3
  392. package/dist/lib/testing-schedule.js +0 -5
  393. package/dist/lib/testing-session.js +0 -5
  394. package/dist/lib/testing-watch.js +0 -4
@@ -1,13 +1,16 @@
1
1
  /* eslint-disable unicorn/text-encoding-identifier-case -- CRT file APIs require the literal utf-8 enum. */
2
2
  import { z } from 'zod';
3
- import { prepareTestingData, TESTING_DATA_MAX_CELL_BYTES, TESTING_DATA_MAX_COLUMNS, TESTING_DATA_MAX_ROWS, } from '../testing-data-core.js';
4
- import { createTestingDataTable, deleteTestingDataTable, getTestingDataTable, listTestingDataTables, updateTestingDataTable, } from '../testing-data-operations.js';
5
- import { abortTestingBuild, buildTestingGitStorageUpdate, countTestingBuilds, createTestingJob, createTestingProject, createTestingRobot, createTestingUserParameter, createTestingVariable, deleteTestingJob, deleteTestingProject, deleteTestingRobot, deleteTestingUserParameter, deleteTestingVariable, downloadTestingJobFiles, getTestingBuild, getTestingBuildLogs, getTestingJob, getTestingJobRefs, getTestingProject, getTestingProjectPermission, getTestingRobot, getTestingUserParameter, getTestingVariable, latestTestingBuilds, listTestingBuilds, listTestingJobFiles, listTestingJobs, listTestingProjectPermissions, listTestingProjects, listTestingRobots, listTestingUserParameters, listTestingVariables, normalizeTestingRemotePath, runTestingBuild, searchTestingBuilds, setTestingProjectPermission, updateTestingJob, updateTestingProject, updateTestingRobot, updateTestingUserParameter, updateTestingVariable, uploadTestingJobFiles, waitForTestingBuildResult, } from '../testing-operations.js';
3
+ import { createTestingDataTable, deleteTestingDataTable, getTestingDataTable, listTestingDataTables, TESTING_DATA_MAX_CELL_BYTES, TESTING_DATA_MAX_COLUMNS, TESTING_DATA_MAX_ROWS, updateTestingDataTable, } from '../testing-data-table.js';
4
+ import { abortTestingBuild, countTestingBuilds, executeTestingBuildRun, getTestingBuild, getTestingBuildLogs, listTestingBuilds, searchTestingBuilds, } from '../testing-execution.js';
5
+ import { buildTestingRunOptions } from '../testing-flags.js';
6
+ import { createTestingJob, createTestingProject, createTestingRobot, createTestingUserParameter, createTestingVariable, deleteTestingJob, deleteTestingProject, deleteTestingRobot, deleteTestingUserParameter, deleteTestingVariable, downloadTestingJobFiles, getTestingJob, getTestingJobRefs, getTestingJobScheduleStatus, getTestingProject, getTestingProjectPermission, getTestingRobot, getTestingUserParameter, getTestingVariable, listTestingJobFiles, listTestingJobs, listTestingProjectPermissions, listTestingProjects, listTestingRobots, listTestingUserParameters, listTestingVariables, removeTestingJobSchedule, setTestingJobSchedule, setTestingProjectPermission, updateTestingJob, updateTestingProject, updateTestingRobot, updateTestingUserParameter, updateTestingVariable, uploadTestingJobFiles, } from '../testing-operations.js';
6
7
  import { sanitizeTestingOutput } from '../testing-sanitization.js';
7
- import { getTestingJobSchedule, removeTestingJobSchedule, setTestingJobSchedule, } from '../testing-schedule.js';
8
- import { normalizeTestingId, TESTING_BUILD_STATUSES, TESTING_CONSOLE_COLORS, TESTING_JOB_PARALLEL_MODES, TESTING_JOB_SUITE_TYPES, TESTING_PROJECT_EXECUTORS, TESTING_PROJECT_TYPES, TESTING_RECORD_BUILD_OPTIONS, TESTING_ROBOT_REPORTING, TESTING_ROBOT_RUN_ENVIRONMENTS, TESTING_ROBOT_TYPES, TESTING_RUN_TYPES, TESTING_VARIABLE_TYPES, } from '../testing-types.js';
8
+ import { TESTING_BUILD_STATUSES, TESTING_CONSOLE_COLORS, TESTING_JOB_PARALLEL_MODES, TESTING_JOB_SUITE_TYPES, TESTING_RECORD_BUILD_OPTIONS, TESTING_ROBOT_ACCEPTED_RUN_ENVIRONMENTS, TESTING_ROBOT_REPORTING, TESTING_ROBOT_REPORTING_DESCRIPTION, TESTING_ROBOT_RUN_ENVIRONMENT_DESCRIPTION, TESTING_ROBOT_TYPE_DESCRIPTION, TESTING_ROBOT_TYPES, TESTING_RUN_TYPES, TESTING_VARIABLE_TYPES, } from '../testing-types.js';
9
9
  import { safelyHandleTool } from './result.js';
10
- import { registerTestingLiveMcpTools, testingLiveMcpHandlers } from './testing-live-tools.js';
10
+ import { registerTestingLiveMcpTools, testingBrowserMcpHandlers } from './testing-browser-tools.js';
11
+ const projectIdSchema = z.number().int().positive().describe('CRT project ID.');
12
+ const jobIdSchema = z.number().int().positive().describe('CRT job ID.');
13
+ const optionalJobIdSchema = z.number().int().positive().optional().describe('CRT job ID.');
11
14
  const gitStorageSchema = {
12
15
  gitBranch: z.string().optional().describe('Git branch to use for a Git-backed CRT job.'),
13
16
  gitDomainCredential: z.string().optional().describe('CRT domain credential ID for Git repository access.'),
@@ -17,50 +20,14 @@ const gitStorageSchema = {
17
20
  gitUseCallerCredentials: z.boolean().optional().describe('Use caller credentials for Git repository access.'),
18
21
  gitUsername: z.string().optional().describe('Git username for repository access. Prefer domain credentials.'),
19
22
  };
20
- function parseParameter(spec) {
21
- const separator = spec.indexOf('=');
22
- const key = separator === -1 ? spec.trim() : spec.slice(0, separator).trim();
23
- if (separator === -1 || key.length === 0) {
24
- throw new Error(`Invalid execution parameter: ${spec}. Use KEY=VALUE.`);
25
- }
26
- return { key, value: spec.slice(separator + 1) };
27
- }
28
- function runOptions(args) {
29
- if (args.branch !== undefined && args.tag !== undefined) {
30
- throw new Error('Use either branch or tag, not both.');
31
- }
32
- if (args.rerunFailed !== undefined && args.rerunFailedFromLatest === true) {
33
- throw new Error('Use either rerunFailed or rerunFailedFromLatest, not both.');
34
- }
35
- return {
36
- branch: args.branch,
37
- consoleColors: args.consoleColors,
38
- consoleWidth: args.consoleWidth,
39
- dataTables: args.datatable,
40
- doc: args.doc,
41
- dryRun: args.dryRun,
42
- exclude: args.exclude,
43
- exitOnError: args.exitOnError,
44
- exitOnFailure: args.exitOnFailure,
45
- include: args.include,
46
- jobId: args.job,
47
- metadata: args.metadata,
48
- name: args.name,
49
- parameters: (args.param ?? []).map((param) => parseParameter(param)),
50
- projectId: args.project,
51
- record: args.record,
52
- rerunFailedFromLatest: args.rerunFailedFromLatest === true ? true : undefined,
53
- rerunFailedId: args.rerunFailed,
54
- runEmptySuite: args.runEmptySuite,
55
- runType: args.runType,
56
- setTags: args.setTag,
57
- skip: args.skip,
58
- skipOnFailure: args.skipOnFailure,
59
- suites: args.suite,
60
- tag: args.tag,
61
- tests: args.test,
62
- variables: args.variable,
63
- };
23
+ const jobScreenSchema = {
24
+ screenDepth: z.number().int().positive().optional().describe('Screen color depth.'),
25
+ screenHeight: z.number().int().positive().optional().describe('Screen height.'),
26
+ screenWidth: z.number().int().positive().optional().describe('Screen width.'),
27
+ };
28
+ function requireConfirm(confirm, action) {
29
+ if (confirm !== true)
30
+ throw new Error(`${action} requires confirm: true.`);
64
31
  }
65
32
  async function testingProjectList(args = {}) {
66
33
  return { result: await listTestingProjects({ name: args.name }) };
@@ -68,11 +35,8 @@ async function testingProjectList(args = {}) {
68
35
  async function testingProjectCreate(args) {
69
36
  return {
70
37
  result: await createTestingProject({
71
- dashboardId: args.dashboardId,
72
38
  description: args.description,
73
39
  name: args.name,
74
- projectExecutor: args.executor,
75
- projectType: args.type,
76
40
  }),
77
41
  };
78
42
  }
@@ -100,8 +64,7 @@ async function testingProjectPermissionSet(args) {
100
64
  };
101
65
  }
102
66
  async function testingProjectDelete(args) {
103
- if (args.confirm !== true)
104
- throw new Error('Project deletion requires confirm: true.');
67
+ requireConfirm(args.confirm, 'Project deletion');
105
68
  return { result: await deleteTestingProject({ projectId: args.id }) };
106
69
  }
107
70
  async function testingRobotList(args) {
@@ -111,41 +74,16 @@ async function testingRobotGet(args) {
111
74
  return { result: await getTestingRobot({ projectId: args.project, robotId: args.id }) };
112
75
  }
113
76
  async function testingRobotDelete(args) {
114
- if (args.confirm !== true)
115
- throw new Error('Robot deletion requires confirm: true.');
77
+ requireConfirm(args.confirm, 'Robot deletion');
116
78
  return { result: await deleteTestingRobot({ projectId: args.project, robotId: args.id }) };
117
79
  }
118
80
  async function testingRobotCreate(args) {
119
- if (args.kind !== undefined && args.runEnvironment !== undefined) {
120
- throw new Error('Use either kind or runEnvironment, not both.');
121
- }
122
- return {
123
- result: await createTestingRobot({
124
- description: args.description,
125
- fwVersion: args.fwVersion,
126
- kind: args.runEnvironment ?? args.kind,
127
- label: args.label,
128
- name: args.name,
129
- os: args.os,
130
- projectId: args.project,
131
- reporting: args.reporting,
132
- robotType: args.robotType,
133
- }),
134
- };
81
+ const { project: projectId, ...rest } = args;
82
+ return { result: await createTestingRobot({ ...rest, projectId }) };
135
83
  }
136
84
  async function testingRobotUpdate(args) {
137
- return {
138
- result: await updateTestingRobot({
139
- description: args.description,
140
- fwVersion: args.fwVersion,
141
- label: args.label,
142
- name: args.name,
143
- projectId: args.project,
144
- reporting: args.reporting,
145
- robotId: args.id,
146
- robotType: args.robotType,
147
- }),
148
- };
85
+ const { id: robotId, project: projectId, ...rest } = args;
86
+ return { result: await updateTestingRobot({ ...rest, projectId, robotId }) };
149
87
  }
150
88
  async function testingJobList(args) {
151
89
  return { result: await listTestingJobs({ name: args.name, projectId: args.project }) };
@@ -154,78 +92,37 @@ async function testingJobGet(args) {
154
92
  return { result: await getTestingJob({ jobId: args.id, projectId: args.project }) };
155
93
  }
156
94
  async function testingJobUpdate(args) {
157
- if (args.showVideoParams === true && args.hideVideoParams === true) {
158
- throw new Error('Use either showVideoParams or hideVideoParams, not both.');
159
- }
160
- const screenValues = [args.screenDepth, args.screenHeight, args.screenWidth];
161
- const screenSupplied = screenValues.filter((value) => value !== undefined);
162
- if (screenSupplied.length > 0 && screenSupplied.length !== screenValues.length) {
163
- throw new Error('Provide screenWidth, screenHeight, and screenDepth together.');
164
- }
95
+ const { gitDomainCredential: domainCredentialId, id: jobId, parallelMode: parallelExecution, project: projectId, robot: robotId, ...rest } = args;
165
96
  return {
166
97
  result: await updateTestingJob({
167
- analytics: args.caseDurationChangeDetection === undefined
168
- ? undefined
169
- : { caseDurationChangeDetection: args.caseDurationChangeDetection },
170
- description: args.description,
171
- domainCredentialId: args.gitDomainCredential,
172
- jobId: args.id,
173
- name: args.name,
174
- parallelExecution: args.parallelMode,
175
- projectId: args.project,
176
- robotId: args.robot,
177
- screen: screenSupplied.length === 0
178
- ? undefined
179
- : { depth: args.screenDepth, height: args.screenHeight, width: args.screenWidth },
180
- showVideoParams: args.showVideoParams === true ? true : args.hideVideoParams === true ? false : undefined,
181
- storage: buildTestingGitStorageUpdate({
182
- gitBranch: args.gitBranch,
183
- gitPassword: args.gitPassword,
184
- gitTag: args.gitTag,
185
- gitUrl: args.gitUrl,
186
- gitUseCallerCredentials: args.gitUseCallerCredentials,
187
- gitUsername: args.gitUsername,
188
- }),
189
- suiteType: args.suiteType,
190
- timeout: args.timeout,
98
+ ...rest,
99
+ domainCredentialId,
100
+ jobId,
101
+ parallelExecution,
102
+ projectId,
103
+ robotId,
104
+ screenMissingMessage: 'Provide screenWidth, screenHeight, and screenDepth together.',
191
105
  }),
192
106
  };
193
107
  }
194
108
  async function testingJobDelete(args) {
195
- if (args.confirm !== true)
196
- throw new Error('Job deletion requires confirm: true.');
109
+ requireConfirm(args.confirm, 'Job deletion');
197
110
  return { result: await deleteTestingJob({ jobId: args.id, projectId: args.project }) };
198
111
  }
199
112
  async function testingJobScheduleGet(args) {
200
- const schedule = await getTestingJobSchedule({ jobId: args.job, projectId: args.project });
201
- return { result: { configured: schedule !== undefined, jobId: args.job, projectId: args.project, schedule } };
113
+ return { result: await getTestingJobScheduleStatus({ jobId: args.job, projectId: args.project }) };
202
114
  }
203
115
  async function testingJobScheduleSet(args) {
204
- return {
205
- result: await setTestingJobSchedule({
206
- cron: args.cron,
207
- jobId: args.job,
208
- projectId: args.project,
209
- record: args.record,
210
- timezone: args.timezone,
211
- }),
212
- };
116
+ const { job: jobId, project: projectId, ...rest } = args;
117
+ return { result: await setTestingJobSchedule({ ...rest, jobId, projectId }) };
213
118
  }
214
119
  async function testingJobScheduleRemove(args) {
215
- if (args.confirm !== true)
216
- throw new Error('Schedule removal requires confirm: true.');
120
+ requireConfirm(args.confirm, 'Schedule removal');
217
121
  return { result: await removeTestingJobSchedule({ jobId: args.job, projectId: args.project }) };
218
122
  }
219
123
  async function testingDataTableList(args) {
220
- return {
221
- result: await listTestingDataTables({
222
- fields: args.fields,
223
- jobId: args.job,
224
- name: args.name,
225
- projectId: args.project,
226
- version: args.revision,
227
- }),
228
- };
124
+ const { job: jobId, project: projectId, revision: version, ...rest } = args;
125
+ return { result: await listTestingDataTables({ ...rest, jobId, projectId, version }) };
229
126
  }
230
127
  async function testingDataTableGet(args) {
231
128
  return {
@@ -238,15 +135,16 @@ async function testingDataTableGet(args) {
238
135
  };
239
136
  }
240
137
  async function testingDataTableCreate(args) {
241
- if (args.confirm !== true)
242
- throw new Error('Data-table creation requires confirm: true.');
138
+ requireConfirm(args.confirm, 'Data-table creation');
243
139
  return {
244
140
  result: await createTestingDataTable({
245
141
  body: {
246
142
  ...(args.aiGenerated === undefined ? {} : { aiGenerated: args.aiGenerated }),
247
- data: prepareTestingData(args.data, args.header ?? 'row'),
143
+ data: args.data,
248
144
  ...(args.defaultRow === undefined ? {} : { defaultRow: args.defaultRow }),
145
+ header: args.header ?? 'row',
249
146
  name: args.name,
147
+ prepare: true,
250
148
  ...(args.topics === undefined ? {} : { topics: args.topics }),
251
149
  },
252
150
  jobId: args.job,
@@ -255,19 +153,15 @@ async function testingDataTableCreate(args) {
255
153
  };
256
154
  }
257
155
  async function testingDataTableUpdate(args) {
258
- if (args.confirm !== true)
259
- throw new Error('Data-table update requires confirm: true.');
260
- const body = {
261
- ...(args.aiGenerated === undefined ? {} : { aiGenerated: args.aiGenerated }),
262
- ...(args.data === undefined ? {} : { data: prepareTestingData(args.data, args.header ?? 'row') }),
263
- ...(args.defaultRow === undefined ? {} : { defaultRow: args.defaultRow }),
264
- ...(args.topics === undefined ? {} : { topics: args.topics }),
265
- };
266
- if (Object.keys(body).length === 0)
267
- throw new Error('Data-table update requires at least one field.');
156
+ requireConfirm(args.confirm, 'Data-table update');
268
157
  return {
269
158
  result: await updateTestingDataTable({
270
- body,
159
+ body: {
160
+ ...(args.aiGenerated === undefined ? {} : { aiGenerated: args.aiGenerated }),
161
+ ...(args.data === undefined ? {} : { data: args.data, header: args.header ?? 'row', prepare: true }),
162
+ ...(args.defaultRow === undefined ? {} : { defaultRow: args.defaultRow }),
163
+ ...(args.topics === undefined ? {} : { topics: args.topics }),
164
+ },
271
165
  jobId: args.job,
272
166
  projectId: args.project,
273
167
  tableId: args.id,
@@ -275,51 +169,31 @@ async function testingDataTableUpdate(args) {
275
169
  };
276
170
  }
277
171
  async function testingDataTableDelete(args) {
278
- if (args.confirm !== true)
279
- throw new Error('Data-table deletion requires confirm: true.');
280
- return {
281
- result: await deleteTestingDataTable({
282
- jobId: args.job,
283
- projectId: args.project,
284
- tableId: args.id,
285
- }),
286
- };
172
+ requireConfirm(args.confirm, 'Data-table deletion');
173
+ return { result: await deleteTestingDataTable({ jobId: args.job, projectId: args.project, tableId: args.id }) };
287
174
  }
288
175
  async function testingJobCreate(args) {
289
- const screenValues = [args.screenDepth, args.screenHeight, args.screenWidth];
290
- if (screenValues.some((value) => value !== undefined) && screenValues.includes(undefined)) {
291
- throw new Error('Provide screenWidth, screenHeight, and screenDepth together.');
292
- }
176
+ const { gitDomainCredential: gitDomainCredentialId, parallelMode: parallelExecution, project: projectId, robot: robotId, ...rest } = args;
293
177
  return {
294
178
  result: await createTestingJob({
295
- analytics: args.caseDurationChangeDetection === undefined
296
- ? undefined
297
- : { caseDurationChangeDetection: args.caseDurationChangeDetection },
298
- description: args.description,
299
- dryRun: args.dryRun,
300
- gitBranch: args.gitBranch,
301
- gitDomainCredentialId: args.gitDomainCredential,
302
- gitPassword: args.gitPassword,
303
- gitTag: args.gitTag,
304
- gitUrl: args.gitUrl,
305
- gitUseCallerCredentials: args.gitUseCallerCredentials,
306
- gitUsername: args.gitUsername,
307
- name: args.name,
308
- parallelExecution: args.parallelMode,
309
- projectId: args.project,
310
- robotId: args.robot,
311
- screen: args.screenWidth === undefined
312
- ? undefined
313
- : { depth: args.screenDepth, height: args.screenHeight, width: args.screenWidth },
314
- showVideoParams: args.showVideoParams,
315
- suiteType: args.suiteType,
316
- timeout: args.timeout,
317
- validation: args.validation,
179
+ ...rest,
180
+ gitDomainCredentialId,
181
+ parallelExecution,
182
+ projectId,
183
+ robotId,
184
+ screenMissingMessage: 'Provide screenWidth, screenHeight, and screenDepth together.',
318
185
  }),
319
186
  };
320
187
  }
321
188
  async function testingJobFiles(args) {
322
- return { result: await listTestingJobFiles({ jobId: args.job, projectId: args.project }) };
189
+ return {
190
+ result: await listTestingJobFiles({
191
+ branch: args.branch,
192
+ jobId: args.job,
193
+ projectId: args.project,
194
+ sharedCredentials: args.sharedCredentials,
195
+ }),
196
+ };
323
197
  }
324
198
  async function testingJobRefs(args) {
325
199
  return {
@@ -331,197 +205,89 @@ async function testingJobRefs(args) {
331
205
  };
332
206
  }
333
207
  async function testingJobUpload(args) {
334
- const operations = args.operations.map((operation) => ({
335
- encoding: operation.encoding,
336
- op: operation.op,
337
- path: normalizeTestingRemotePath(operation.path),
338
- value: operation.value,
339
- }));
340
- for (const operation of operations) {
341
- if (operation.op === 'remove' && operation.value !== undefined) {
342
- throw new Error('Remove operations must not include value.');
343
- }
344
- if (operation.op !== 'remove' && operation.value === undefined) {
345
- throw new Error(`${operation.op} operations require value.`);
346
- }
347
- }
208
+ const { authorEmail, authorName, job: jobId, project: projectId, ...rest } = args;
348
209
  return {
349
210
  result: await uploadTestingJobFiles({
350
- author: args.authorName === undefined && args.authorEmail === undefined
211
+ ...rest,
212
+ author: authorName === undefined && authorEmail === undefined
351
213
  ? undefined
352
- : { email: args.authorEmail ?? 'agentia@copado.com', name: args.authorName ?? 'Agentia CLI' },
353
- branch: args.branch,
354
- commitMessage: args.commitMessage,
355
- dryRun: args.dryRun,
356
- jobId: args.job,
357
- operations,
358
- parentCommitHash: args.parentCommitHash,
359
- projectId: args.project,
214
+ : { email: authorEmail ?? 'agentia@copado.com', name: authorName ?? 'Agentia CLI' },
215
+ jobId,
216
+ projectId,
360
217
  }),
361
218
  };
362
219
  }
363
220
  async function testingJobDownload(args) {
221
+ const { file: files, job: jobId, project: projectId, ...rest } = args;
222
+ return { result: await downloadTestingJobFiles({ ...rest, files, jobId, projectId }) };
223
+ }
224
+ async function testingBuildRun(args) {
225
+ const options = buildTestingRunOptions(args);
364
226
  return {
365
- result: await downloadTestingJobFiles({
366
- branch: args.branch,
367
- files: args.file,
368
- jobId: args.job,
369
- outputDir: args.outputDir,
370
- projectId: args.project,
227
+ result: await executeTestingBuildRun({
228
+ ...options,
229
+ streamLogs: args.streamLogs,
230
+ strictDataDrivenWait: true,
231
+ timeout: args.timeout,
232
+ wait: args.waitForResult === true || args.streamLogs === true,
233
+ waitForResult: args.waitForResult,
371
234
  }),
372
235
  };
373
236
  }
374
- async function testingBuildRun(args) {
375
- if ((args.datatable?.length ?? 0) > 0 && (args.waitForResult === true || args.streamLogs === true)) {
376
- throw new Error('Data-driven MCP runs start a batch and cannot wait or stream logs.');
377
- }
378
- const options = runOptions(args);
379
- const run = await runTestingBuild(options);
380
- if (args.waitForResult !== true && args.streamLogs !== true)
381
- return { result: run };
382
- const buildId = normalizeTestingId(run.build);
383
- if (buildId === undefined)
384
- throw new Error('CRT did not return a build ID for the started run.');
385
- const wait = await waitForTestingBuildResult({
386
- ...options,
387
- buildId,
388
- sensitiveValues: options.parameters?.filter((parameter) => parameter.sensitive === true).map((parameter) => parameter.value ?? ''),
389
- streamLogs: args.streamLogs,
390
- timeoutMs: (args.timeout ?? 60) * 60_000,
391
- });
392
- return { result: { ...run, finalBuild: wait.build, wait } };
393
- }
394
237
  async function testingBuildList(args) {
395
238
  if (args.count === true) {
396
239
  if (args.job === undefined)
397
240
  throw new Error('count requires job.');
398
241
  return { result: { count: await countTestingBuilds({ jobId: args.job, projectId: args.project }) } };
399
242
  }
400
- return {
401
- result: await listTestingBuilds({
402
- jobId: args.job,
403
- page: args.page,
404
- pageSize: args.pageSize,
405
- projectId: args.project,
406
- resultSize: args.resultSize ?? 'compact',
407
- status: args.status,
408
- }),
409
- };
243
+ const { job: jobId, project: projectId, resultSize = 'compact', ...rest } = args;
244
+ return { result: await listTestingBuilds({ ...rest, jobId, projectId, resultSize }) };
410
245
  }
411
246
  async function testingBuildGet(args) {
412
247
  return {
413
- result: await getTestingBuild({
414
- buildId: args.build,
415
- full: args.full,
416
- jobId: args.job,
417
- projectId: args.project,
418
- }),
419
- };
420
- }
421
- async function testingBuildLatest(args) {
422
- return {
423
- result: await latestTestingBuilds({
424
- projectId: args.project,
425
- resultSize: args.resultSize ?? 'compact',
426
- status: args.status,
427
- }),
248
+ result: await getTestingBuild({ buildId: args.build, full: args.full, jobId: args.job, projectId: args.project }),
428
249
  };
429
250
  }
430
251
  async function testingBuildSearch(args) {
431
- return {
432
- result: await searchTestingBuilds({
433
- count: args.count,
434
- from: args.from,
435
- jobId: args.job,
436
- order: args.order,
437
- page: args.page,
438
- pageSize: args.pageSize,
439
- projectId: args.project,
440
- robots: args.robot,
441
- runTypes: args.runType,
442
- sort: args.sort,
443
- statuses: args.status,
444
- to: args.to,
445
- }),
446
- };
252
+ const { job: jobId, project: projectId, robot: robots, runType: runTypes, status: statuses, ...rest } = args;
253
+ return { result: await searchTestingBuilds({ ...rest, jobId, projectId, robots, runTypes, statuses }) };
447
254
  }
448
255
  async function testingBuildLogs(args) {
256
+ const { build: buildId, job: jobId, project: projectId, ...rest } = args;
449
257
  return {
450
- result: sanitizeTestingOutput(await getTestingBuildLogs({
451
- buildId: args.build,
452
- container: args.container,
453
- jobId: args.job,
454
- limitBytes: args.limitBytes,
455
- output: args.output,
456
- pretty: args.pretty,
457
- projectId: args.project,
458
- sinceSeconds: args.sinceSeconds,
459
- tailLines: args.tailLines,
460
- timestamps: args.timestamps,
461
- })),
258
+ result: sanitizeTestingOutput(await getTestingBuildLogs({ ...rest, buildId, jobId, projectId }), {
259
+ preserveLogKeys: true,
260
+ }),
462
261
  };
463
262
  }
464
263
  async function testingBuildAbort(args) {
465
- if (args.confirm !== true)
466
- throw new Error('Build abort requires confirm: true.');
467
- return {
468
- result: await abortTestingBuild({
469
- buildId: args.build,
470
- jobId: args.job,
471
- projectId: args.project,
472
- }),
473
- };
264
+ requireConfirm(args.confirm, 'Build abort');
265
+ return { result: await abortTestingBuild({ buildId: args.build, jobId: args.job, projectId: args.project }) };
474
266
  }
475
267
  async function testingVariableList(args) {
476
- return {
477
- result: await listTestingVariables({
478
- jobId: args.job,
479
- key: args.key,
480
- projectId: args.project,
481
- robotId: args.robot,
482
- sensitive: args.sensitive,
483
- type: args.type,
484
- userSpecific: args.userSpecific,
485
- }),
486
- };
268
+ const { job: jobId, project: projectId, robot: robotId, ...rest } = args;
269
+ return { result: await listTestingVariables({ ...rest, jobId, projectId, robotId }) };
487
270
  }
488
271
  async function testingVariableGet(args) {
489
272
  return { result: await getTestingVariable({ projectId: args.project, variableId: args.id }) };
490
273
  }
491
274
  async function testingVariableCreate(args) {
492
- return {
493
- result: await createTestingVariable({
494
- description: args.description,
495
- jobId: args.job,
496
- key: args.key,
497
- projectId: args.project,
498
- robotId: args.robot,
499
- sensitive: args.sensitive,
500
- type: args.type,
501
- userSpecific: args.userSpecific,
502
- value: args.value,
503
- }),
504
- };
275
+ const { job: jobId, project: projectId, robot: robotId, ...rest } = args;
276
+ return { result: await createTestingVariable({ ...rest, jobId, projectId, robotId }) };
505
277
  }
506
278
  async function testingVariableUpdate(args) {
507
- if (args.sensitive === true && args.notSensitive === true) {
508
- throw new Error('Use either sensitive or notSensitive, not both.');
509
- }
279
+ const { id: variableId, project: projectId, ...rest } = args;
510
280
  return {
511
281
  result: await updateTestingVariable({
512
- description: args.description,
513
- key: args.key,
514
- projectId: args.project,
515
- sensitive: args.sensitive === true ? true : args.notSensitive === true ? false : undefined,
516
- type: args.type,
517
- value: args.value,
518
- variableId: args.id,
282
+ ...rest,
283
+ projectId,
284
+ sensitiveConflictMessage: 'Use either sensitive or notSensitive, not both.',
285
+ variableId,
519
286
  }),
520
287
  };
521
288
  }
522
289
  async function testingVariableDelete(args) {
523
- if (args.confirm !== true)
524
- throw new Error('Variable deletion requires confirm: true.');
290
+ requireConfirm(args.confirm, 'Variable deletion');
525
291
  return { result: await deleteTestingVariable({ projectId: args.project, variableId: args.id }) };
526
292
  }
527
293
  async function testingUserParameterList(args) {
@@ -531,38 +297,22 @@ async function testingUserParameterGet(args) {
531
297
  return { result: await getTestingUserParameter({ parameterId: args.id }) };
532
298
  }
533
299
  async function testingUserParameterCreate(args) {
534
- return {
535
- result: await createTestingUserParameter({
536
- description: args.description,
537
- key: args.key,
538
- sensitive: args.sensitive,
539
- unique: args.unique,
540
- value: args.value,
541
- }),
542
- };
300
+ return { result: await createTestingUserParameter(args) };
543
301
  }
544
302
  async function testingUserParameterUpdate(args) {
545
- return {
546
- result: await updateTestingUserParameter({
547
- description: args.description,
548
- key: args.key,
549
- parameterId: args.id,
550
- unique: args.unique,
551
- value: args.value,
552
- }),
553
- };
303
+ const { id: parameterId, ...rest } = args;
304
+ return { result: await updateTestingUserParameter({ ...rest, parameterId }) };
554
305
  }
555
306
  async function testingUserParameterDelete(args) {
556
- if (args.confirm !== true)
557
- throw new Error('User-parameter deletion requires confirm: true.');
307
+ requireConfirm(args.confirm, 'User-parameter deletion');
558
308
  return { result: await deleteTestingUserParameter({ parameterId: args.id }) };
559
309
  }
560
310
  const buildListSchema = {
561
311
  count: z.boolean().optional().describe('Return only the build count; requires job.'),
562
- job: z.number().int().positive().optional().describe('CRT job/test ID.'),
312
+ job: optionalJobIdSchema,
563
313
  page: z.number().int().positive().optional().describe('Build page number.'),
564
314
  pageSize: z.number().int().positive().optional().describe('Build page size.'),
565
- project: z.number().int().positive().describe('CRT project ID.'),
315
+ project: projectIdSchema,
566
316
  resultSize: z.enum(['compact']).optional().describe('CRT result size.'),
567
317
  status: z.enum(TESTING_BUILD_STATUSES).optional().describe('Build status filter.'),
568
318
  };
@@ -572,21 +322,28 @@ const uploadSchema = {
572
322
  branch: z.string().optional().describe('Optional CRT branch name.'),
573
323
  commitMessage: z.string().optional().describe('Commit message for CRT file history.'),
574
324
  dryRun: z.boolean().optional().describe('Return a sanitized plan without making a network mutation.'),
575
- job: z.number().int().positive().describe('CRT job/test ID.'),
576
- operations: z.array(z.object({
325
+ job: jobIdSchema,
326
+ operations: z
327
+ .array(z.object({
577
328
  encoding: z.enum(['utf-8', 'base64']).optional(),
578
329
  op: z.enum(['add', 'replace', 'remove']),
579
330
  path: z.string().min(1),
580
331
  value: z.string().max(1_048_576).optional(),
581
- })).min(1).max(100).describe('Bounded structured file operations; local paths and stdin are not available in MCP.'),
332
+ }))
333
+ .min(1)
334
+ .max(100)
335
+ .describe('Bounded structured file operations; local paths and stdin are not available in MCP.'),
582
336
  parentCommitHash: z.string().optional().describe('Expected parent commit hash.'),
583
- project: z.number().int().positive().describe('CRT project ID.'),
337
+ project: projectIdSchema,
584
338
  };
585
339
  const runOptionSchema = {
586
340
  branch: z.string().optional().describe('Git branch/ref to use for this run. Mutually exclusive with tag.'),
587
341
  consoleColors: z.enum(TESTING_CONSOLE_COLORS).optional().describe('Robot Framework console color mode.'),
588
342
  consoleWidth: z.number().int().positive().optional().describe('Robot Framework console width.'),
589
- datatable: z.array(z.string()).optional().describe('Data-driven TABLE_ID:DATASETS selections.'),
343
+ datatable: z
344
+ .array(z.string())
345
+ .optional()
346
+ .describe('Data-driven TABLE_ID:DATASETS selections. Batch runs cannot wait or stream logs.'),
590
347
  doc: z.string().optional().describe('Top-level Robot Framework suite documentation.'),
591
348
  dryRun: z.boolean().optional().describe('Validate Robot Framework data without executing library keywords.'),
592
349
  exclude: z.array(z.string()).optional().describe('Robot Framework tags to exclude from this run.'),
@@ -604,30 +361,32 @@ const runOptionSchema = {
604
361
  setTag: z.array(z.string()).optional().describe('Tags to set on every executed test.'),
605
362
  skip: z.array(z.string()).optional().describe('Tags for tests to skip.'),
606
363
  skipOnFailure: z.array(z.string()).optional().describe('Tags whose failing tests should be skipped.'),
607
- streamLogs: z.boolean().optional().describe('Poll logs while waiting and return them once; MCP never streams chunks.'),
364
+ streamLogs: z
365
+ .boolean()
366
+ .optional()
367
+ .describe('Wait for the run and return the finished log once. MCP never streams chunks. Implies a wait, and is rejected for data-driven runs.'),
608
368
  suite: z.array(z.string()).optional().describe('Robot Framework suites to select.'),
609
369
  tag: z.string().optional().describe('Git tag to use for this run. Mutually exclusive with branch.'),
610
370
  test: z.array(z.string()).optional().describe('Robot Framework tests/tasks to select.'),
611
371
  timeout: z.number().int().positive().optional().describe('Maximum wait time in minutes.'),
612
372
  variable: z.array(z.string()).optional().describe('Robot Framework variables.'),
613
- waitForResult: z.boolean().optional().describe('Poll until the build reaches a terminal result.'),
614
- };
615
- const buildRunSchema = {
616
- job: z.number().int().positive().describe('CRT job/test ID.'),
617
- project: z.number().int().positive().describe('CRT project ID.'),
618
- ...runOptionSchema,
373
+ waitForResult: z
374
+ .boolean()
375
+ .optional()
376
+ .describe('Poll until the build reaches a terminal result. Omitted means do not wait. The CLI waits by default; this tool does not. Rejected for data-driven runs.'),
619
377
  };
378
+ const buildRunSchema = { job: jobIdSchema, project: projectIdSchema, ...runOptionSchema };
620
379
  const testingDataMatrixSchema = z
621
380
  .array(z.array(z.string().max(TESTING_DATA_MAX_CELL_BYTES)).max(TESTING_DATA_MAX_COLUMNS))
622
381
  .max(TESTING_DATA_MAX_ROWS);
623
382
  const buildLogSchema = {
624
383
  build: z.number().int().positive().describe('CRT build/run ID.'),
625
384
  container: z.string().optional().describe('Specific CRT log stream/container.'),
626
- job: z.number().int().positive().describe('CRT job/test ID.'),
385
+ job: jobIdSchema,
627
386
  limitBytes: z.number().int().positive().optional().describe('Maximum log bytes to fetch.'),
628
387
  output: z.string().optional().describe('Output file for logs.'),
629
388
  pretty: z.boolean().optional().describe('Request readable log formatting.'),
630
- project: z.number().int().positive().describe('CRT project ID.'),
389
+ project: projectIdSchema,
631
390
  sinceSeconds: z.number().int().nonnegative().optional().describe('Fetch logs from the last N seconds.'),
632
391
  tailLines: z.number().int().nonnegative().optional().describe('Return only the last N lines.'),
633
392
  timestamps: z.boolean().optional().describe('Add timestamps to log lines.'),
@@ -635,7 +394,7 @@ const buildLogSchema = {
635
394
  export const agentiaMcpTestingToolHandlers = {
636
395
  testingBuildAbort,
637
396
  testingBuildGet,
638
- testingBuildLatest,
397
+ testingBuildLatest: testingBuildList,
639
398
  testingBuildList,
640
399
  testingBuildLogs,
641
400
  testingBuildRun,
@@ -686,7 +445,7 @@ export const agentiaMcpTestingToolHandlers = {
686
445
  testingVariableGet,
687
446
  testingVariableList,
688
447
  testingVariableUpdate,
689
- ...testingLiveMcpHandlers,
448
+ ...testingBrowserMcpHandlers,
690
449
  };
691
450
  export function registerAgentiaMcpTestingTools(server) {
692
451
  server.registerTool('agentia_testing_project_list', {
@@ -697,11 +456,8 @@ export function registerAgentiaMcpTestingTools(server) {
697
456
  server.registerTool('agentia_testing_project_create', {
698
457
  description: 'Create a Copado Robotic Testing project.',
699
458
  inputSchema: {
700
- dashboardId: z.number().int().positive().optional().describe('Optional CRT dashboard ID.'),
701
459
  description: z.string().optional().describe('Project description.'),
702
- executor: z.enum(TESTING_PROJECT_EXECUTORS).optional().describe('Project execution backend.'),
703
460
  name: z.string().describe('Project name.'),
704
- type: z.enum(TESTING_PROJECT_TYPES).optional().describe('CRT project type.'),
705
461
  },
706
462
  title: 'Agentia Testing Project Create',
707
463
  }, (args) => safelyHandleTool(() => testingProjectCreate(args)));
@@ -721,18 +477,18 @@ export function registerAgentiaMcpTestingTools(server) {
721
477
  }, (args) => safelyHandleTool(() => testingProjectUpdate(args)));
722
478
  server.registerTool('agentia_testing_project_permission_list', {
723
479
  description: 'List assignments for a Copado Robotic Testing project.',
724
- inputSchema: { project: z.number().int().positive().describe('CRT project ID.') },
480
+ inputSchema: { project: projectIdSchema },
725
481
  title: 'Agentia Testing Project Permission List',
726
482
  }, (args) => safelyHandleTool(() => testingProjectPermissionList(args)));
727
483
  server.registerTool('agentia_testing_project_permission_get', {
728
484
  description: "Get the caller's permission on a Copado Robotic Testing project.",
729
- inputSchema: { project: z.number().int().positive().describe('CRT project ID.') },
485
+ inputSchema: { project: projectIdSchema },
730
486
  title: 'Agentia Testing Project Permission Get',
731
487
  }, (args) => safelyHandleTool(() => testingProjectPermissionGet(args)));
732
488
  const permissionMutationSchema = {
733
489
  edit: z.boolean().optional().describe('Grant edit access.'),
734
490
  group: z.number().int().positive().optional().describe('Platform group ID; exclusive with user.'),
735
- project: z.number().int().positive().describe('CRT project ID.'),
491
+ project: projectIdSchema,
736
492
  user: z.number().int().positive().optional().describe('Platform user ID; exclusive with group.'),
737
493
  view: z.boolean().optional().describe('Grant view access.'),
738
494
  };
@@ -748,23 +504,17 @@ export function registerAgentiaMcpTestingTools(server) {
748
504
  }, (args) => safelyHandleTool(() => testingProjectPermissionSet(args)));
749
505
  server.registerTool('agentia_testing_project_delete', {
750
506
  description: 'Delete a Copado Robotic Testing project.',
751
- inputSchema: {
752
- confirm: z.boolean().describe('Must be true to confirm project deletion.'),
753
- id: z.number().int().positive().describe('CRT project ID.'),
754
- },
507
+ inputSchema: { confirm: z.boolean().describe('Must be true to confirm project deletion.'), id: projectIdSchema },
755
508
  title: 'Agentia Testing Project Delete',
756
509
  }, (args) => safelyHandleTool(() => testingProjectDelete(args)));
757
510
  server.registerTool('agentia_testing_robot_list', {
758
511
  description: 'List Copado Robotic Testing robots.',
759
- inputSchema: { project: z.number().int().positive().describe('CRT project ID.') },
512
+ inputSchema: { project: projectIdSchema },
760
513
  title: 'Agentia Testing Robot List',
761
514
  }, (args) => safelyHandleTool(() => testingRobotList(args)));
762
515
  server.registerTool('agentia_testing_robot_get', {
763
516
  description: 'Get a Copado Robotic Testing robot from the project robot list.',
764
- inputSchema: {
765
- id: z.string().describe('CRT robot ID.'),
766
- project: z.number().int().positive().describe('CRT project ID.'),
767
- },
517
+ inputSchema: { id: z.string().describe('CRT robot ID.'), project: projectIdSchema },
768
518
  title: 'Agentia Testing Robot Get',
769
519
  }, (args) => safelyHandleTool(() => testingRobotGet(args)));
770
520
  server.registerTool('agentia_testing_robot_delete', {
@@ -772,7 +522,7 @@ export function registerAgentiaMcpTestingTools(server) {
772
522
  inputSchema: {
773
523
  confirm: z.boolean().describe('Must be true to confirm robot deletion.'),
774
524
  id: z.string().describe('CRT robot ID.'),
775
- project: z.number().int().positive().describe('CRT project ID.'),
525
+ project: projectIdSchema,
776
526
  },
777
527
  title: 'Agentia Testing Robot Delete',
778
528
  }, (args) => safelyHandleTool(() => testingRobotDelete(args)));
@@ -781,14 +531,15 @@ export function registerAgentiaMcpTestingTools(server) {
781
531
  inputSchema: {
782
532
  description: z.string().optional().describe('Robot description.'),
783
533
  fwVersion: z.string().optional().describe('Robot framework version.'),
784
- kind: z.enum(TESTING_ROBOT_RUN_ENVIRONMENTS).optional().describe('Robot run environment.'),
785
534
  label: z.string().optional().describe('Robot label.'),
786
535
  name: z.string().describe('Robot name.'),
787
- os: z.string().optional().describe('Robot operating system.'),
788
- project: z.number().int().positive().describe('CRT project ID.'),
789
- reporting: z.enum(TESTING_ROBOT_REPORTING).optional().describe('Testing result retention.'),
790
- robotType: z.enum(TESTING_ROBOT_TYPES).optional().describe('CRT robot type.'),
791
- runEnvironment: z.enum(TESTING_ROBOT_RUN_ENVIRONMENTS).optional().describe('Robot execution environment.'),
536
+ project: projectIdSchema,
537
+ reporting: z.enum(TESTING_ROBOT_REPORTING).optional().describe(TESTING_ROBOT_REPORTING_DESCRIPTION),
538
+ robotType: z.enum(TESTING_ROBOT_TYPES).optional().describe(TESTING_ROBOT_TYPE_DESCRIPTION),
539
+ runEnvironment: z
540
+ .enum(TESTING_ROBOT_ACCEPTED_RUN_ENVIRONMENTS)
541
+ .optional()
542
+ .describe(TESTING_ROBOT_RUN_ENVIRONMENT_DESCRIPTION),
792
543
  },
793
544
  title: 'Agentia Testing Robot Create',
794
545
  }, (args) => safelyHandleTool(() => testingRobotCreate(args)));
@@ -800,72 +551,66 @@ export function registerAgentiaMcpTestingTools(server) {
800
551
  id: z.string().describe('CRT robot ID.'),
801
552
  label: z.string().optional().describe('New robot label.'),
802
553
  name: z.string().optional().describe('New robot name.'),
803
- project: z.number().int().positive().describe('CRT project ID.'),
804
- reporting: z.enum(TESTING_ROBOT_REPORTING).optional().describe('Testing result retention.'),
805
- robotType: z.enum(TESTING_ROBOT_TYPES).optional().describe('CRT robot type.'),
554
+ project: projectIdSchema,
555
+ reporting: z.enum(TESTING_ROBOT_REPORTING).optional().describe(TESTING_ROBOT_REPORTING_DESCRIPTION),
556
+ robotType: z.enum(TESTING_ROBOT_TYPES).optional().describe(TESTING_ROBOT_TYPE_DESCRIPTION),
806
557
  },
807
558
  title: 'Agentia Testing Robot Update',
808
559
  }, (args) => safelyHandleTool(() => testingRobotUpdate(args)));
809
560
  server.registerTool('agentia_testing_job_list', {
810
- description: 'List Copado Robotic Testing jobs/tests.',
561
+ description: 'List Copado Robotic Testing jobs.',
811
562
  inputSchema: {
812
- name: z.string().optional().describe('Case-insensitive exact job/test name filter.'),
813
- project: z.number().int().positive().describe('CRT project ID.'),
563
+ name: z.string().optional().describe('Case-insensitive exact job name filter.'),
564
+ project: projectIdSchema,
814
565
  },
815
566
  title: 'Agentia Testing Job List',
816
567
  }, (args) => safelyHandleTool(() => testingJobList(args)));
817
568
  server.registerTool('agentia_testing_job_get', {
818
- description: 'Get a Copado Robotic Testing job/test from the project job list.',
819
- inputSchema: {
820
- id: z.string().describe('CRT job/test ID.'),
821
- project: z.number().int().positive().describe('CRT project ID.'),
822
- },
569
+ description: 'Get a Copado Robotic Testing job from the project job list.',
570
+ inputSchema: { id: z.string().describe('CRT job ID.'), project: projectIdSchema },
823
571
  title: 'Agentia Testing Job Get',
824
572
  }, (args) => safelyHandleTool(() => testingJobGet(args)));
825
573
  server.registerTool('agentia_testing_job_update', {
826
- description: 'Update Copado Robotic Testing job/test metadata or Git storage.',
574
+ description: 'Update Copado Robotic Testing job metadata or Git storage.',
827
575
  inputSchema: {
828
576
  caseDurationChangeDetection: z.boolean().optional().describe('Enable or disable duration analytics.'),
829
- description: z.string().optional().describe('Job/test description.'),
577
+ description: z.string().optional().describe('Job description.'),
830
578
  ...gitStorageSchema,
831
- hideVideoParams: z.boolean().optional().describe('Hide video parameters.'),
832
- id: z.number().int().positive().describe('CRT job/test ID.'),
833
- name: z.string().optional().describe('Job/test name.'),
579
+ id: jobIdSchema,
580
+ name: z.string().optional().describe('Job name.'),
834
581
  parallelMode: z.enum(TESTING_JOB_PARALLEL_MODES).optional().describe('Parallel execution mode.'),
835
- project: z.number().int().positive().describe('CRT project ID.'),
582
+ project: projectIdSchema,
836
583
  robot: z.number().int().positive().optional().describe('CRT robot ID.'),
837
- screenDepth: z.number().int().positive().optional().describe('Screen color depth.'),
838
- screenHeight: z.number().int().positive().optional().describe('Screen height.'),
839
- screenWidth: z.number().int().positive().optional().describe('Screen width.'),
840
- showVideoParams: z.boolean().optional().describe('Show video parameters.'),
584
+ ...jobScreenSchema,
585
+ showVideoParams: z
586
+ .boolean()
587
+ .optional()
588
+ .describe('Enable or disable video streaming and recording capabilities when running the test job.'),
841
589
  suiteType: z.enum(TESTING_JOB_SUITE_TYPES).optional().describe('CRT suite/job type.'),
842
590
  timeout: z.string().optional().describe('Build timeout, for example 10m.'),
843
591
  },
844
592
  title: 'Agentia Testing Job Update',
845
593
  }, (args) => safelyHandleTool(() => testingJobUpdate(args)));
846
594
  server.registerTool('agentia_testing_job_delete', {
847
- description: 'Delete a Copado Robotic Testing job/test.',
595
+ description: 'Delete a Copado Robotic Testing job.',
848
596
  inputSchema: {
849
597
  confirm: z.boolean().describe('Must be true to confirm job deletion.'),
850
- id: z.number().int().positive().describe('CRT job/test ID.'),
851
- project: z.number().int().positive().describe('CRT project ID.'),
598
+ id: jobIdSchema,
599
+ project: projectIdSchema,
852
600
  },
853
601
  title: 'Agentia Testing Job Delete',
854
602
  }, (args) => safelyHandleTool(() => testingJobDelete(args)));
855
603
  server.registerTool('agentia_testing_job_schedule_get', {
856
604
  description: 'Get a Copado Robotic Testing job schedule.',
857
- inputSchema: {
858
- job: z.number().int().positive().describe('CRT job/test ID.'),
859
- project: z.number().int().positive().describe('CRT project ID.'),
860
- },
605
+ inputSchema: { job: jobIdSchema, project: projectIdSchema },
861
606
  title: 'Agentia Testing Job Schedule Get',
862
607
  }, (args) => safelyHandleTool(() => testingJobScheduleGet(args)));
863
608
  server.registerTool('agentia_testing_job_schedule_set', {
864
609
  description: 'Create or update a Copado Robotic Testing job schedule.',
865
610
  inputSchema: {
866
611
  cron: z.string().min(1).describe('Cron expression.'),
867
- job: z.number().int().positive().describe('CRT job/test ID.'),
868
- project: z.number().int().positive().describe('CRT project ID.'),
612
+ job: jobIdSchema,
613
+ project: projectIdSchema,
869
614
  record: z.enum(TESTING_RECORD_BUILD_OPTIONS).optional().describe('Scheduled run recording mode.'),
870
615
  timezone: z.string().optional().describe('Schedule timezone.'),
871
616
  },
@@ -875,8 +620,8 @@ export function registerAgentiaMcpTestingTools(server) {
875
620
  description: 'Remove a Copado Robotic Testing job schedule.',
876
621
  inputSchema: {
877
622
  confirm: z.boolean().describe('Must be true to confirm schedule removal.'),
878
- job: z.number().int().positive().describe('CRT job/test ID.'),
879
- project: z.number().int().positive().describe('CRT project ID.'),
623
+ job: jobIdSchema,
624
+ project: projectIdSchema,
880
625
  },
881
626
  title: 'Agentia Testing Job Schedule Remove',
882
627
  }, (args) => safelyHandleTool(() => testingJobScheduleRemove(args)));
@@ -884,9 +629,9 @@ export function registerAgentiaMcpTestingTools(server) {
884
629
  description: 'List Copado Robotic Testing data tables.',
885
630
  inputSchema: {
886
631
  fields: z.string().optional().describe('Comma-separated response fields.'),
887
- job: z.number().int().positive().optional().describe('CRT job/test ID filter.'),
632
+ job: optionalJobIdSchema,
888
633
  name: z.string().optional().describe('Exact table name filter.'),
889
- project: z.number().int().positive().describe('CRT project ID.'),
634
+ project: projectIdSchema,
890
635
  revision: z.string().optional().describe('Table revision/version filter.'),
891
636
  },
892
637
  title: 'Agentia Testing Data Table List',
@@ -895,8 +640,8 @@ export function registerAgentiaMcpTestingTools(server) {
895
640
  description: 'Get a Copado Robotic Testing data table.',
896
641
  inputSchema: {
897
642
  id: z.number().int().positive().describe('CRT data-table ID.'),
898
- job: z.number().int().positive().optional().describe('CRT job/test ID filter.'),
899
- project: z.number().int().positive().describe('CRT project ID.'),
643
+ job: optionalJobIdSchema,
644
+ project: projectIdSchema,
900
645
  revision: z.string().optional().describe('Table revision/version.'),
901
646
  },
902
647
  title: 'Agentia Testing Data Table Get',
@@ -909,9 +654,9 @@ export function registerAgentiaMcpTestingTools(server) {
909
654
  data: testingDataMatrixSchema.min(1).describe('Rows with a header row followed by datasets.'),
910
655
  defaultRow: z.number().int().positive().optional().describe('Default dataset row.'),
911
656
  header: z.enum(['row', 'column']).optional().describe('Input header orientation.'),
912
- job: z.number().int().positive().optional().describe('Optional CRT job/test ID scope.'),
657
+ job: optionalJobIdSchema,
913
658
  name: z.string().min(1).describe('Data-table name.'),
914
- project: z.number().int().positive().describe('CRT project ID.'),
659
+ project: projectIdSchema,
915
660
  topics: z.array(z.string()).optional().describe('Topic tags.'),
916
661
  },
917
662
  title: 'Agentia Testing Data Table Create',
@@ -925,8 +670,8 @@ export function registerAgentiaMcpTestingTools(server) {
925
670
  defaultRow: z.number().int().positive().optional().describe('Default dataset row.'),
926
671
  header: z.enum(['row', 'column']).optional().describe('Input header orientation.'),
927
672
  id: z.number().int().positive().describe('CRT data-table ID.'),
928
- job: z.number().int().positive().optional().describe('Optional CRT job/test ID scope.'),
929
- project: z.number().int().positive().describe('CRT project ID.'),
673
+ job: optionalJobIdSchema,
674
+ project: projectIdSchema,
930
675
  topics: z.array(z.string()).optional().describe('Replacement topic tags.'),
931
676
  },
932
677
  title: 'Agentia Testing Data Table Update',
@@ -936,25 +681,26 @@ export function registerAgentiaMcpTestingTools(server) {
936
681
  inputSchema: {
937
682
  confirm: z.boolean().describe('Must be true to confirm deletion.'),
938
683
  id: z.number().int().positive().describe('CRT data-table ID.'),
939
- job: z.number().int().positive().optional().describe('Optional CRT job/test ID scope.'),
940
- project: z.number().int().positive().describe('CRT project ID.'),
684
+ job: optionalJobIdSchema,
685
+ project: projectIdSchema,
941
686
  },
942
687
  title: 'Agentia Testing Data Table Delete',
943
688
  }, (args) => safelyHandleTool(() => testingDataTableDelete(args)));
944
689
  server.registerTool('agentia_testing_job_create', {
945
- description: 'Create a Copado Robotic Testing job/test from uploaded files or Git storage.',
690
+ description: 'Create a Copado Robotic Testing job from uploaded files or Git storage.',
946
691
  inputSchema: {
947
692
  caseDurationChangeDetection: z.boolean().optional().describe('Enable or disable duration analytics.'),
948
- description: z.string().optional().describe('Job/test description.'),
693
+ description: z.string().optional().describe('Job description.'),
949
694
  dryRun: z.boolean().optional().describe('Return a sanitized creation plan without network mutation.'),
950
- name: z.string().describe('Job/test name.'),
695
+ name: z.string().describe('Job name.'),
951
696
  parallelMode: z.enum(TESTING_JOB_PARALLEL_MODES).optional().describe('Parallel execution mode.'),
952
- project: z.number().int().positive().describe('CRT project ID.'),
697
+ project: projectIdSchema,
953
698
  robot: z.string().describe('CRT robot ID.'),
954
- screenDepth: z.number().int().positive().optional().describe('Screen color depth.'),
955
- screenHeight: z.number().int().positive().optional().describe('Screen height.'),
956
- screenWidth: z.number().int().positive().optional().describe('Screen width.'),
957
- showVideoParams: z.boolean().optional().describe('Show or hide video parameters.'),
699
+ ...jobScreenSchema,
700
+ showVideoParams: z
701
+ .boolean()
702
+ .optional()
703
+ .describe('Enable or disable video streaming and recording capabilities when running the test job.'),
958
704
  suiteType: z.enum(TESTING_JOB_SUITE_TYPES).optional().describe('CRT suite/job type.'),
959
705
  timeout: z.string().optional().describe('Build timeout, for example 10m.'),
960
706
  validation: z.boolean().optional().describe('Ask CRT to validate the created job.'),
@@ -963,111 +709,99 @@ export function registerAgentiaMcpTestingTools(server) {
963
709
  title: 'Agentia Testing Job Create',
964
710
  }, (args) => safelyHandleTool(() => testingJobCreate(args)));
965
711
  server.registerTool('agentia_testing_job_run', {
966
- description: 'Run a Copado Robotic Testing job/test.',
712
+ description: 'Run a Copado Robotic Testing job. Does not wait unless waitForResult or streamLogs is set. Data-driven runs reject waiting.',
967
713
  inputSchema: buildRunSchema,
968
714
  title: 'Agentia Testing Job Run',
969
715
  }, (args) => safelyHandleTool(() => testingBuildRun(args)));
970
- server.registerTool('agentia_testing_job_files', {
971
- description: 'List files for a Copado Robotic Testing job/test.',
716
+ server.registerTool('agentia_testing_job_files_list', {
717
+ description: 'List files for a Copado Robotic Testing job.',
972
718
  inputSchema: {
973
- job: z.number().int().positive().describe('CRT job/test ID.'),
974
- project: z.number().int().positive().describe('CRT project ID.'),
719
+ branch: z.string().optional().describe('Optional CRT branch name.'),
720
+ job: jobIdSchema,
721
+ project: projectIdSchema,
722
+ sharedCredentials: z.boolean().optional().describe('Use shared stored Git credentials.'),
975
723
  },
976
- title: 'Agentia Testing Job Files',
724
+ title: 'Agentia Testing Job Files List',
977
725
  }, (args) => safelyHandleTool(() => testingJobFiles(args)));
978
726
  server.registerTool('agentia_testing_job_refs', {
979
- description: 'List Git branches and tags for a Copado Robotic Testing job/test.',
727
+ description: 'List Git branches and tags for a Copado Robotic Testing job.',
980
728
  inputSchema: {
981
- job: z.number().int().positive().describe('CRT job/test ID.'),
982
- project: z.number().int().positive().describe('CRT project ID.'),
729
+ job: jobIdSchema,
730
+ project: projectIdSchema,
983
731
  sharedCredentials: z.boolean().optional().describe('Use shared stored Git credentials.'),
984
732
  },
985
733
  title: 'Agentia Testing Job Refs',
986
734
  }, (args) => safelyHandleTool(() => testingJobRefs(args)));
987
- server.registerTool('agentia_testing_job_upload', {
988
- description: 'Upload file operations to a Copado Robotic Testing job/test.',
735
+ server.registerTool('agentia_testing_job_files_upload', {
736
+ description: 'Upload file operations to a Copado Robotic Testing job.',
989
737
  inputSchema: uploadSchema,
990
- title: 'Agentia Testing Job Upload',
738
+ title: 'Agentia Testing Job Files Upload',
991
739
  }, (args) => safelyHandleTool(() => testingJobUpload(args)));
992
- server.registerTool('agentia_testing_job_download', {
993
- description: 'Download files from a Copado Robotic Testing job/test.',
740
+ server.registerTool('agentia_testing_job_files_download', {
741
+ description: 'Download files from a Copado Robotic Testing job.',
994
742
  inputSchema: {
995
743
  branch: z.string().optional().describe('Optional CRT branch name.'),
996
744
  file: z.array(z.string()).describe('Remote CRT file paths.'),
997
- job: z.number().int().positive().describe('CRT job/test ID.'),
745
+ job: jobIdSchema,
998
746
  outputDir: z.string().optional().describe('Output directory for downloaded files.'),
999
- project: z.number().int().positive().describe('CRT project ID.'),
747
+ project: projectIdSchema,
1000
748
  },
1001
- title: 'Agentia Testing Job Download',
749
+ title: 'Agentia Testing Job Files Download',
1002
750
  }, (args) => safelyHandleTool(() => testingJobDownload(args)));
1003
- server.registerTool('agentia_testing_build_run', {
1004
- description: 'Run a Copado Robotic Testing job/test.',
1005
- inputSchema: buildRunSchema,
1006
- title: 'Agentia Testing Build Run',
1007
- }, (args) => safelyHandleTool(() => testingBuildRun(args)));
1008
- server.registerTool('agentia_testing_build_list', {
1009
- description: 'List Copado Robotic Testing builds/runs.',
751
+ server.registerTool('agentia_testing_job_runs_list', {
752
+ description: 'List Copado Robotic Testing job runs.',
1010
753
  inputSchema: buildListSchema,
1011
- title: 'Agentia Testing Build List',
754
+ title: 'Agentia Testing Job Runs List',
1012
755
  }, (args) => safelyHandleTool(() => testingBuildList(args)));
1013
- server.registerTool('agentia_testing_build_get', {
1014
- description: 'Get a Copado Robotic Testing build/run.',
756
+ server.registerTool('agentia_testing_job_runs_get', {
757
+ description: 'Get the result of a Copado Robotic Testing job run.',
1015
758
  inputSchema: {
1016
759
  build: z.number().int().positive().describe('CRT build/run ID.'),
1017
760
  full: z.boolean().optional().describe('Fetch the full build result.'),
1018
- job: z.number().int().positive().describe('CRT job/test ID.'),
1019
- project: z.number().int().positive().describe('CRT project ID.'),
761
+ job: jobIdSchema,
762
+ project: projectIdSchema,
1020
763
  },
1021
- title: 'Agentia Testing Build Get',
764
+ title: 'Agentia Testing Job Runs Get',
1022
765
  }, (args) => safelyHandleTool(() => testingBuildGet(args)));
1023
- server.registerTool('agentia_testing_build_latest', {
1024
- description: 'List the latest Copado Robotic Testing builds/runs.',
1025
- inputSchema: {
1026
- project: z.number().int().positive().describe('CRT project ID.'),
1027
- resultSize: z.enum(['compact']).optional().describe('CRT result size.'),
1028
- status: z.enum(TESTING_BUILD_STATUSES).optional().describe('Build status filter.'),
1029
- },
1030
- title: 'Agentia Testing Build Latest',
1031
- }, (args) => safelyHandleTool(() => testingBuildLatest(args)));
1032
- server.registerTool('agentia_testing_build_search', {
1033
- description: 'Search Copado Robotic Testing build metrics.',
766
+ server.registerTool('agentia_testing_job_runs_search', {
767
+ description: 'Search Copado Robotic Testing job run metrics.',
1034
768
  inputSchema: {
1035
769
  count: z.boolean().optional().describe('Return only the filtered count.'),
1036
770
  from: z.string().optional().describe('Start date or epoch filter.'),
1037
- job: z.number().int().positive().describe('CRT job/test ID.'),
771
+ job: jobIdSchema,
1038
772
  order: z.enum(['asc', 'desc']).optional().describe('Sort order.'),
1039
773
  page: z.number().int().positive().optional().describe('Result page.'),
1040
774
  pageSize: z.number().int().positive().optional().describe('Result page size.'),
1041
- project: z.number().int().positive().describe('CRT project ID.'),
775
+ project: projectIdSchema,
1042
776
  robot: z.array(z.string()).optional().describe('Robot ID filters.'),
1043
777
  runType: z.array(z.enum(TESTING_RUN_TYPES)).optional().describe('Run type filters.'),
1044
778
  sort: z.enum(['date', 'duration', 'id', 'status']).optional().describe('Sort field.'),
1045
779
  status: z.array(z.string()).optional().describe('Status filters.'),
1046
780
  to: z.string().optional().describe('End date or epoch filter.'),
1047
781
  },
1048
- title: 'Agentia Testing Build Search',
782
+ title: 'Agentia Testing Job Runs Search',
1049
783
  }, (args) => safelyHandleTool(() => testingBuildSearch(args)));
1050
- server.registerTool('agentia_testing_build_logs', {
1051
- description: 'Get logs for a Copado Robotic Testing build/run.',
784
+ server.registerTool('agentia_testing_job_runs_logs', {
785
+ description: 'Get logs for a Copado Robotic Testing job run.',
1052
786
  inputSchema: buildLogSchema,
1053
- title: 'Agentia Testing Build Logs',
787
+ title: 'Agentia Testing Job Runs Logs',
1054
788
  }, (args) => safelyHandleTool(() => testingBuildLogs(args)));
1055
- server.registerTool('agentia_testing_build_abort', {
1056
- description: 'Abort a Copado Robotic Testing build/run.',
789
+ server.registerTool('agentia_testing_job_runs_abort', {
790
+ description: 'Abort a Copado Robotic Testing job run.',
1057
791
  inputSchema: {
1058
792
  build: z.number().int().positive().describe('CRT build/run ID.'),
1059
793
  confirm: z.boolean().describe('Must be true to confirm the abort.'),
1060
- job: z.number().int().positive().describe('CRT job/test ID.'),
1061
- project: z.number().int().positive().describe('CRT project ID.'),
794
+ job: jobIdSchema,
795
+ project: projectIdSchema,
1062
796
  },
1063
- title: 'Agentia Testing Build Abort',
797
+ title: 'Agentia Testing Job Runs Abort',
1064
798
  }, (args) => safelyHandleTool(() => testingBuildAbort(args)));
1065
799
  server.registerTool('agentia_testing_variable_list', {
1066
800
  description: 'List Copado Robotic Testing variables/secrets.',
1067
801
  inputSchema: {
1068
- job: z.number().int().positive().optional().describe('Job/test ID filter.'),
802
+ job: optionalJobIdSchema,
1069
803
  key: z.string().optional().describe('Exact variable key filter.'),
1070
- project: z.number().int().positive().describe('CRT project ID.'),
804
+ project: projectIdSchema,
1071
805
  robot: z.number().int().positive().optional().describe('Robot ID filter.'),
1072
806
  sensitive: z.boolean().optional().describe('Sensitive status filter.'),
1073
807
  type: z.enum(TESTING_VARIABLE_TYPES).optional().describe('Variable type filter.'),
@@ -1077,19 +811,16 @@ export function registerAgentiaMcpTestingTools(server) {
1077
811
  }, (args) => safelyHandleTool(() => testingVariableList(args)));
1078
812
  server.registerTool('agentia_testing_variable_get', {
1079
813
  description: 'Get a Copado Robotic Testing variable/secret with value redaction.',
1080
- inputSchema: {
1081
- id: z.string().describe('CRT variable/secret ID.'),
1082
- project: z.number().int().positive().describe('CRT project ID.'),
1083
- },
814
+ inputSchema: { id: z.string().describe('CRT variable/secret ID.'), project: projectIdSchema },
1084
815
  title: 'Agentia Testing Variable Get',
1085
816
  }, (args) => safelyHandleTool(() => testingVariableGet(args)));
1086
817
  server.registerTool('agentia_testing_variable_create', {
1087
818
  description: 'Create a Copado Robotic Testing variable/secret.',
1088
819
  inputSchema: {
1089
820
  description: z.string().optional().describe('Variable description.'),
1090
- job: z.number().int().positive().optional().describe('CRT job/test ID scope.'),
821
+ job: optionalJobIdSchema,
1091
822
  key: z.string().describe('Variable key.'),
1092
- project: z.number().int().positive().describe('CRT project ID.'),
823
+ project: projectIdSchema,
1093
824
  robot: z.number().int().positive().optional().describe('CRT robot ID scope.'),
1094
825
  sensitive: z.boolean().optional().describe('Mark variable as sensitive.'),
1095
826
  type: z.enum(TESTING_VARIABLE_TYPES).optional().describe('Variable type.'),
@@ -1105,7 +836,7 @@ export function registerAgentiaMcpTestingTools(server) {
1105
836
  id: z.string().describe('CRT variable/secret ID.'),
1106
837
  key: z.string().optional().describe('Variable key.'),
1107
838
  notSensitive: z.boolean().optional().describe('Mark variable as not sensitive.'),
1108
- project: z.number().int().positive().describe('CRT project ID.'),
839
+ project: projectIdSchema,
1109
840
  sensitive: z.boolean().optional().describe('Mark variable as sensitive.'),
1110
841
  type: z.enum(TESTING_VARIABLE_TYPES).optional().describe('Variable type.'),
1111
842
  value: z.string().max(1_048_576).optional().describe('Structured variable value; redacted from output.'),
@@ -1117,7 +848,7 @@ export function registerAgentiaMcpTestingTools(server) {
1117
848
  inputSchema: {
1118
849
  confirm: z.boolean().describe('Must be true to confirm variable deletion.'),
1119
850
  id: z.string().describe('CRT variable/secret ID.'),
1120
- project: z.number().int().positive().describe('CRT project ID.'),
851
+ project: projectIdSchema,
1121
852
  },
1122
853
  title: 'Agentia Testing Variable Delete',
1123
854
  }, (args) => safelyHandleTool(() => testingVariableDelete(args)));
@@ -1165,47 +896,6 @@ export function registerAgentiaMcpTestingTools(server) {
1165
896
  },
1166
897
  title: 'Agentia Testing User Parameter Delete',
1167
898
  }, (args) => safelyHandleTool(() => testingUserParameterDelete(args)));
1168
- server.registerTool('agentia_testing_create', {
1169
- description: 'Create a Copado Robotic Testing test from uploaded files or Git storage.',
1170
- inputSchema: {
1171
- caseDurationChangeDetection: z.boolean().optional().describe('Enable or disable duration analytics.'),
1172
- description: z.string().optional().describe('Test description.'),
1173
- dryRun: z.boolean().optional().describe('Return a sanitized creation plan without network mutation.'),
1174
- name: z.string().describe('Test name.'),
1175
- parallelMode: z.enum(TESTING_JOB_PARALLEL_MODES).optional().describe('Parallel execution mode.'),
1176
- project: z.number().int().positive().describe('CRT project ID.'),
1177
- robot: z.string().describe('CRT robot ID.'),
1178
- screenDepth: z.number().int().positive().optional().describe('Screen color depth.'),
1179
- screenHeight: z.number().int().positive().optional().describe('Screen height.'),
1180
- screenWidth: z.number().int().positive().optional().describe('Screen width.'),
1181
- showVideoParams: z.boolean().optional().describe('Show or hide video parameters.'),
1182
- suiteType: z.enum(TESTING_JOB_SUITE_TYPES).optional().describe('CRT suite/job type.'),
1183
- timeout: z.string().optional().describe('Build timeout, for example 10m.'),
1184
- validation: z.boolean().optional().describe('Ask CRT to validate the created job.'),
1185
- ...gitStorageSchema,
1186
- },
1187
- title: 'Agentia Testing Create',
1188
- }, (args) => safelyHandleTool(() => testingJobCreate(args)));
1189
- server.registerTool('agentia_testing_update', {
1190
- description: 'Update a Copado Robotic Testing test by uploading file operations.',
1191
- inputSchema: uploadSchema,
1192
- title: 'Agentia Testing Update',
1193
- }, (args) => safelyHandleTool(() => testingJobUpload(args)));
1194
- server.registerTool('agentia_testing_run', {
1195
- description: 'Run a Copado Robotic Testing test.',
1196
- inputSchema: buildRunSchema,
1197
- title: 'Agentia Testing Run',
1198
- }, (args) => safelyHandleTool(() => testingBuildRun(args)));
1199
- server.registerTool('agentia_testing_status', {
1200
- description: 'List Copado Robotic Testing run status.',
1201
- inputSchema: buildListSchema,
1202
- title: 'Agentia Testing Status',
1203
- }, (args) => safelyHandleTool(() => testingBuildList(args)));
1204
- server.registerTool('agentia_testing_logs', {
1205
- description: 'Get logs for a Copado Robotic Testing run.',
1206
- inputSchema: buildLogSchema,
1207
- title: 'Agentia Testing Logs',
1208
- }, (args) => safelyHandleTool(() => testingBuildLogs(args)));
1209
899
  registerTestingLiveMcpTools(server);
1210
900
  }
1211
901
  //# sourceMappingURL=testing-tools.js.map