simplify3x-connect 0.0.0-stage → 0.28.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 (363) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -3
  3. package/dist/acText.d.ts +12 -0
  4. package/dist/acText.d.ts.map +1 -0
  5. package/dist/acText.js +44 -0
  6. package/dist/acText.js.map +1 -0
  7. package/dist/adapters/factory.d.ts +25 -0
  8. package/dist/adapters/factory.d.ts.map +1 -0
  9. package/dist/adapters/factory.js +55 -0
  10. package/dist/adapters/factory.js.map +1 -0
  11. package/dist/adapters/http.d.ts +62 -0
  12. package/dist/adapters/http.d.ts.map +1 -0
  13. package/dist/adapters/http.js +138 -0
  14. package/dist/adapters/http.js.map +1 -0
  15. package/dist/adapters/remoteMcp/adapter.d.ts +112 -0
  16. package/dist/adapters/remoteMcp/adapter.d.ts.map +1 -0
  17. package/dist/adapters/remoteMcp/adapter.js +259 -0
  18. package/dist/adapters/remoteMcp/adapter.js.map +1 -0
  19. package/dist/adapters/simplifyqa/adapter.d.ts +1390 -0
  20. package/dist/adapters/simplifyqa/adapter.d.ts.map +1 -0
  21. package/dist/adapters/simplifyqa/adapter.js +9126 -0
  22. package/dist/adapters/simplifyqa/adapter.js.map +1 -0
  23. package/dist/adapters/simplifyqa/apiFailureReason.d.ts +11 -0
  24. package/dist/adapters/simplifyqa/apiFailureReason.d.ts.map +1 -0
  25. package/dist/adapters/simplifyqa/apiFailureReason.js +35 -0
  26. package/dist/adapters/simplifyqa/apiFailureReason.js.map +1 -0
  27. package/dist/adapters/simplifyqa/desktopConditions.d.ts +50 -0
  28. package/dist/adapters/simplifyqa/desktopConditions.d.ts.map +1 -0
  29. package/dist/adapters/simplifyqa/desktopConditions.js +95 -0
  30. package/dist/adapters/simplifyqa/desktopConditions.js.map +1 -0
  31. package/dist/adapters/simplifyqa/executionFailures.d.ts +59 -0
  32. package/dist/adapters/simplifyqa/executionFailures.d.ts.map +1 -0
  33. package/dist/adapters/simplifyqa/executionFailures.js +641 -0
  34. package/dist/adapters/simplifyqa/executionFailures.js.map +1 -0
  35. package/dist/adapters/simplifyqa/failureCategory.d.ts +26 -0
  36. package/dist/adapters/simplifyqa/failureCategory.d.ts.map +1 -0
  37. package/dist/adapters/simplifyqa/failureCategory.js +208 -0
  38. package/dist/adapters/simplifyqa/failureCategory.js.map +1 -0
  39. package/dist/adapters/simplifyqa/failureReport.d.ts +50 -0
  40. package/dist/adapters/simplifyqa/failureReport.d.ts.map +1 -0
  41. package/dist/adapters/simplifyqa/failureReport.js +383 -0
  42. package/dist/adapters/simplifyqa/failureReport.js.map +1 -0
  43. package/dist/adapters/simplifyqa/failureTypes.d.ts +193 -0
  44. package/dist/adapters/simplifyqa/failureTypes.d.ts.map +1 -0
  45. package/dist/adapters/simplifyqa/failureTypes.js +8 -0
  46. package/dist/adapters/simplifyqa/failureTypes.js.map +1 -0
  47. package/dist/adapters/simplifyqa/flow.d.ts +58 -0
  48. package/dist/adapters/simplifyqa/flow.d.ts.map +1 -0
  49. package/dist/adapters/simplifyqa/flow.js +335 -0
  50. package/dist/adapters/simplifyqa/flow.js.map +1 -0
  51. package/dist/adapters/simplifyqa/functionMatch.d.ts +53 -0
  52. package/dist/adapters/simplifyqa/functionMatch.d.ts.map +1 -0
  53. package/dist/adapters/simplifyqa/functionMatch.js +110 -0
  54. package/dist/adapters/simplifyqa/functionMatch.js.map +1 -0
  55. package/dist/adapters/simplifyqa/heal/apply.d.ts +59 -0
  56. package/dist/adapters/simplifyqa/heal/apply.d.ts.map +1 -0
  57. package/dist/adapters/simplifyqa/heal/apply.js +213 -0
  58. package/dist/adapters/simplifyqa/heal/apply.js.map +1 -0
  59. package/dist/adapters/simplifyqa/heal/diagnose.d.ts +24 -0
  60. package/dist/adapters/simplifyqa/heal/diagnose.d.ts.map +1 -0
  61. package/dist/adapters/simplifyqa/heal/diagnose.js +211 -0
  62. package/dist/adapters/simplifyqa/heal/diagnose.js.map +1 -0
  63. package/dist/adapters/simplifyqa/heal/index.d.ts +37 -0
  64. package/dist/adapters/simplifyqa/heal/index.d.ts.map +1 -0
  65. package/dist/adapters/simplifyqa/heal/index.js +83 -0
  66. package/dist/adapters/simplifyqa/heal/index.js.map +1 -0
  67. package/dist/adapters/simplifyqa/heal/plan.d.ts +67 -0
  68. package/dist/adapters/simplifyqa/heal/plan.d.ts.map +1 -0
  69. package/dist/adapters/simplifyqa/heal/plan.js +338 -0
  70. package/dist/adapters/simplifyqa/heal/plan.js.map +1 -0
  71. package/dist/adapters/simplifyqa/heal/store.d.ts +10 -0
  72. package/dist/adapters/simplifyqa/heal/store.d.ts.map +1 -0
  73. package/dist/adapters/simplifyqa/heal/store.js +40 -0
  74. package/dist/adapters/simplifyqa/heal/store.js.map +1 -0
  75. package/dist/adapters/simplifyqa/mapLimit.d.ts +3 -0
  76. package/dist/adapters/simplifyqa/mapLimit.d.ts.map +1 -0
  77. package/dist/adapters/simplifyqa/mapLimit.js +14 -0
  78. package/dist/adapters/simplifyqa/mapLimit.js.map +1 -0
  79. package/dist/adapters/simplifyqa/mapper.d.ts +159 -0
  80. package/dist/adapters/simplifyqa/mapper.d.ts.map +1 -0
  81. package/dist/adapters/simplifyqa/mapper.js +1767 -0
  82. package/dist/adapters/simplifyqa/mapper.js.map +1 -0
  83. package/dist/adapters/simplifyqa/planTree.d.ts +31 -0
  84. package/dist/adapters/simplifyqa/planTree.d.ts.map +1 -0
  85. package/dist/adapters/simplifyqa/planTree.js +110 -0
  86. package/dist/adapters/simplifyqa/planTree.js.map +1 -0
  87. package/dist/adapters/simplifyqa/searchEngine.d.ts +254 -0
  88. package/dist/adapters/simplifyqa/searchEngine.d.ts.map +1 -0
  89. package/dist/adapters/simplifyqa/searchEngine.js +1248 -0
  90. package/dist/adapters/simplifyqa/searchEngine.js.map +1 -0
  91. package/dist/adapters/simplifyqa/searchRegistry.d.ts +117 -0
  92. package/dist/adapters/simplifyqa/searchRegistry.d.ts.map +1 -0
  93. package/dist/adapters/simplifyqa/searchRegistry.js +1664 -0
  94. package/dist/adapters/simplifyqa/searchRegistry.js.map +1 -0
  95. package/dist/adapters/simplifyqa/searchResolve.d.ts +84 -0
  96. package/dist/adapters/simplifyqa/searchResolve.d.ts.map +1 -0
  97. package/dist/adapters/simplifyqa/searchResolve.js +319 -0
  98. package/dist/adapters/simplifyqa/searchResolve.js.map +1 -0
  99. package/dist/adapters/simplifyqa/stepDiagnostics.d.ts +25 -0
  100. package/dist/adapters/simplifyqa/stepDiagnostics.d.ts.map +1 -0
  101. package/dist/adapters/simplifyqa/stepDiagnostics.js +89 -0
  102. package/dist/adapters/simplifyqa/stepDiagnostics.js.map +1 -0
  103. package/dist/adapters/simplifyqa/stepRules.d.ts +91 -0
  104. package/dist/adapters/simplifyqa/stepRules.d.ts.map +1 -0
  105. package/dist/adapters/simplifyqa/stepRules.js +228 -0
  106. package/dist/adapters/simplifyqa/stepRules.js.map +1 -0
  107. package/dist/adapters/types.d.ts +514 -0
  108. package/dist/adapters/types.d.ts.map +1 -0
  109. package/dist/adapters/types.js +2 -0
  110. package/dist/adapters/types.js.map +1 -0
  111. package/dist/adapters/walnut/actionTypes.d.ts +16 -0
  112. package/dist/adapters/walnut/actionTypes.d.ts.map +1 -0
  113. package/dist/adapters/walnut/actionTypes.js +178 -0
  114. package/dist/adapters/walnut/actionTypes.js.map +1 -0
  115. package/dist/adapters/walnut/adapter.d.ts +235 -0
  116. package/dist/adapters/walnut/adapter.d.ts.map +1 -0
  117. package/dist/adapters/walnut/adapter.js +1120 -0
  118. package/dist/adapters/walnut/adapter.js.map +1 -0
  119. package/dist/adapters/walnut/mapper.d.ts +55 -0
  120. package/dist/adapters/walnut/mapper.d.ts.map +1 -0
  121. package/dist/adapters/walnut/mapper.js +364 -0
  122. package/dist/adapters/walnut/mapper.js.map +1 -0
  123. package/dist/cli.d.ts +3 -0
  124. package/dist/cli.d.ts.map +1 -0
  125. package/dist/cli.js +38 -0
  126. package/dist/cli.js.map +1 -0
  127. package/dist/config.d.ts +109 -0
  128. package/dist/config.d.ts.map +1 -0
  129. package/dist/config.js +272 -0
  130. package/dist/config.js.map +1 -0
  131. package/dist/connection.d.ts +105 -0
  132. package/dist/connection.d.ts.map +1 -0
  133. package/dist/connection.js +255 -0
  134. package/dist/connection.js.map +1 -0
  135. package/dist/domain/heal.d.ts +163 -0
  136. package/dist/domain/heal.d.ts.map +1 -0
  137. package/dist/domain/heal.js +55 -0
  138. package/dist/domain/heal.js.map +1 -0
  139. package/dist/domain/types.d.ts +1328 -0
  140. package/dist/domain/types.d.ts.map +1 -0
  141. package/dist/domain/types.js +8 -0
  142. package/dist/domain/types.js.map +1 -0
  143. package/dist/domain/validate.d.ts +3 -0
  144. package/dist/domain/validate.d.ts.map +1 -0
  145. package/dist/domain/validate.js +67 -0
  146. package/dist/domain/validate.js.map +1 -0
  147. package/dist/drafts/apiPatch.d.ts +9 -0
  148. package/dist/drafts/apiPatch.d.ts.map +1 -0
  149. package/dist/drafts/apiPatch.js +27 -0
  150. package/dist/drafts/apiPatch.js.map +1 -0
  151. package/dist/drafts/bulk.d.ts +24 -0
  152. package/dist/drafts/bulk.d.ts.map +1 -0
  153. package/dist/drafts/bulk.js +44 -0
  154. package/dist/drafts/bulk.js.map +1 -0
  155. package/dist/drafts/duplicate.d.ts +12 -0
  156. package/dist/drafts/duplicate.d.ts.map +1 -0
  157. package/dist/drafts/duplicate.js +59 -0
  158. package/dist/drafts/duplicate.js.map +1 -0
  159. package/dist/drafts/store.d.ts +91 -0
  160. package/dist/drafts/store.d.ts.map +1 -0
  161. package/dist/drafts/store.js +244 -0
  162. package/dist/drafts/store.js.map +1 -0
  163. package/dist/gateway.d.ts +37 -0
  164. package/dist/gateway.d.ts.map +1 -0
  165. package/dist/gateway.js +71 -0
  166. package/dist/gateway.js.map +1 -0
  167. package/dist/httpMain.d.ts +3 -0
  168. package/dist/httpMain.d.ts.map +1 -0
  169. package/dist/httpMain.js +20 -0
  170. package/dist/httpMain.js.map +1 -0
  171. package/dist/index.d.ts +3 -0
  172. package/dist/index.d.ts.map +1 -0
  173. package/dist/index.js +46 -0
  174. package/dist/index.js.map +1 -0
  175. package/dist/initAgents.d.ts +2 -0
  176. package/dist/initAgents.d.ts.map +1 -0
  177. package/dist/initAgents.js +508 -0
  178. package/dist/initAgents.js.map +1 -0
  179. package/dist/log.d.ts +17 -0
  180. package/dist/log.d.ts.map +1 -0
  181. package/dist/log.js +49 -0
  182. package/dist/log.js.map +1 -0
  183. package/dist/mcpResult.d.ts +39 -0
  184. package/dist/mcpResult.d.ts.map +1 -0
  185. package/dist/mcpResult.js +19 -0
  186. package/dist/mcpResult.js.map +1 -0
  187. package/dist/mount.d.ts +33 -0
  188. package/dist/mount.d.ts.map +1 -0
  189. package/dist/mount.js +213 -0
  190. package/dist/mount.js.map +1 -0
  191. package/dist/paramTokens.d.ts +18 -0
  192. package/dist/paramTokens.d.ts.map +1 -0
  193. package/dist/paramTokens.js +50 -0
  194. package/dist/paramTokens.js.map +1 -0
  195. package/dist/projectStore.d.ts +5 -0
  196. package/dist/projectStore.d.ts.map +1 -0
  197. package/dist/projectStore.js +60 -0
  198. package/dist/projectStore.js.map +1 -0
  199. package/dist/requestConnection.d.ts +22 -0
  200. package/dist/requestConnection.d.ts.map +1 -0
  201. package/dist/requestConnection.js +50 -0
  202. package/dist/requestConnection.js.map +1 -0
  203. package/dist/serve.d.ts +10 -0
  204. package/dist/serve.d.ts.map +1 -0
  205. package/dist/serve.js +37 -0
  206. package/dist/serve.js.map +1 -0
  207. package/dist/server.d.ts +41 -0
  208. package/dist/server.d.ts.map +1 -0
  209. package/dist/server.js +370 -0
  210. package/dist/server.js.map +1 -0
  211. package/dist/tools/actionCatalog.d.ts +24 -0
  212. package/dist/tools/actionCatalog.d.ts.map +1 -0
  213. package/dist/tools/actionCatalog.js +56 -0
  214. package/dist/tools/actionCatalog.js.map +1 -0
  215. package/dist/tools/attachment.tools.d.ts +15 -0
  216. package/dist/tools/attachment.tools.d.ts.map +1 -0
  217. package/dist/tools/attachment.tools.js +104 -0
  218. package/dist/tools/attachment.tools.js.map +1 -0
  219. package/dist/tools/backlog.tools.d.ts +13 -0
  220. package/dist/tools/backlog.tools.d.ts.map +1 -0
  221. package/dist/tools/backlog.tools.js +690 -0
  222. package/dist/tools/backlog.tools.js.map +1 -0
  223. package/dist/tools/connection.tools.d.ts +16 -0
  224. package/dist/tools/connection.tools.d.ts.map +1 -0
  225. package/dist/tools/connection.tools.js +120 -0
  226. package/dist/tools/connection.tools.js.map +1 -0
  227. package/dist/tools/defects.tools.d.ts +7 -0
  228. package/dist/tools/defects.tools.d.ts.map +1 -0
  229. package/dist/tools/defects.tools.js +108 -0
  230. package/dist/tools/defects.tools.js.map +1 -0
  231. package/dist/tools/discovery.tools.d.ts +23 -0
  232. package/dist/tools/discovery.tools.d.ts.map +1 -0
  233. package/dist/tools/discovery.tools.js +1746 -0
  234. package/dist/tools/discovery.tools.js.map +1 -0
  235. package/dist/tools/executionPlan.tools.d.ts +14 -0
  236. package/dist/tools/executionPlan.tools.d.ts.map +1 -0
  237. package/dist/tools/executionPlan.tools.js +184 -0
  238. package/dist/tools/executionPlan.tools.js.map +1 -0
  239. package/dist/tools/failure.tools.d.ts +14 -0
  240. package/dist/tools/failure.tools.d.ts.map +1 -0
  241. package/dist/tools/failure.tools.js +65 -0
  242. package/dist/tools/failure.tools.js.map +1 -0
  243. package/dist/tools/formulas.tools.d.ts +7 -0
  244. package/dist/tools/formulas.tools.d.ts.map +1 -0
  245. package/dist/tools/formulas.tools.js +84 -0
  246. package/dist/tools/formulas.tools.js.map +1 -0
  247. package/dist/tools/functionReuse.d.ts +77 -0
  248. package/dist/tools/functionReuse.d.ts.map +1 -0
  249. package/dist/tools/functionReuse.js +384 -0
  250. package/dist/tools/functionReuse.js.map +1 -0
  251. package/dist/tools/gapAnalysis.tools.d.ts +31 -0
  252. package/dist/tools/gapAnalysis.tools.d.ts.map +1 -0
  253. package/dist/tools/gapAnalysis.tools.js +287 -0
  254. package/dist/tools/gapAnalysis.tools.js.map +1 -0
  255. package/dist/tools/heal.tools.d.ts +20 -0
  256. package/dist/tools/heal.tools.d.ts.map +1 -0
  257. package/dist/tools/heal.tools.js +268 -0
  258. package/dist/tools/heal.tools.js.map +1 -0
  259. package/dist/tools/impactAnalysis.tools.d.ts +17 -0
  260. package/dist/tools/impactAnalysis.tools.d.ts.map +1 -0
  261. package/dist/tools/impactAnalysis.tools.js +352 -0
  262. package/dist/tools/impactAnalysis.tools.js.map +1 -0
  263. package/dist/tools/markdown.d.ts +13 -0
  264. package/dist/tools/markdown.d.ts.map +1 -0
  265. package/dist/tools/markdown.js +145 -0
  266. package/dist/tools/markdown.js.map +1 -0
  267. package/dist/tools/objects.tools.d.ts +7 -0
  268. package/dist/tools/objects.tools.d.ts.map +1 -0
  269. package/dist/tools/objects.tools.js +458 -0
  270. package/dist/tools/objects.tools.js.map +1 -0
  271. package/dist/tools/pipeline.tools.d.ts +11 -0
  272. package/dist/tools/pipeline.tools.d.ts.map +1 -0
  273. package/dist/tools/pipeline.tools.js +100 -0
  274. package/dist/tools/pipeline.tools.js.map +1 -0
  275. package/dist/tools/preference.tools.d.ts +15 -0
  276. package/dist/tools/preference.tools.d.ts.map +1 -0
  277. package/dist/tools/preference.tools.js +114 -0
  278. package/dist/tools/preference.tools.js.map +1 -0
  279. package/dist/tools/privileges.tools.d.ts +65 -0
  280. package/dist/tools/privileges.tools.d.ts.map +1 -0
  281. package/dist/tools/privileges.tools.js +186 -0
  282. package/dist/tools/privileges.tools.js.map +1 -0
  283. package/dist/tools/project.tools.d.ts +13 -0
  284. package/dist/tools/project.tools.d.ts.map +1 -0
  285. package/dist/tools/project.tools.js +199 -0
  286. package/dist/tools/project.tools.js.map +1 -0
  287. package/dist/tools/query.tools.d.ts +23 -0
  288. package/dist/tools/query.tools.d.ts.map +1 -0
  289. package/dist/tools/query.tools.js +368 -0
  290. package/dist/tools/query.tools.js.map +1 -0
  291. package/dist/tools/recording.tools.d.ts +58 -0
  292. package/dist/tools/recording.tools.d.ts.map +1 -0
  293. package/dist/tools/recording.tools.js +1050 -0
  294. package/dist/tools/recording.tools.js.map +1 -0
  295. package/dist/tools/recordingNames.d.ts +3 -0
  296. package/dist/tools/recordingNames.d.ts.map +1 -0
  297. package/dist/tools/recordingNames.js +16 -0
  298. package/dist/tools/recordingNames.js.map +1 -0
  299. package/dist/tools/report.tools.d.ts +12 -0
  300. package/dist/tools/report.tools.d.ts.map +1 -0
  301. package/dist/tools/report.tools.js +104 -0
  302. package/dist/tools/report.tools.js.map +1 -0
  303. package/dist/tools/run.tools.d.ts +25 -0
  304. package/dist/tools/run.tools.d.ts.map +1 -0
  305. package/dist/tools/run.tools.js +1295 -0
  306. package/dist/tools/run.tools.js.map +1 -0
  307. package/dist/tools/schemas.d.ts +860 -0
  308. package/dist/tools/schemas.d.ts.map +1 -0
  309. package/dist/tools/schemas.js +220 -0
  310. package/dist/tools/schemas.js.map +1 -0
  311. package/dist/tools/storySync.tools.d.ts +167 -0
  312. package/dist/tools/storySync.tools.d.ts.map +1 -0
  313. package/dist/tools/storySync.tools.js +678 -0
  314. package/dist/tools/storySync.tools.js.map +1 -0
  315. package/dist/tools/suiteManage.tools.d.ts +14 -0
  316. package/dist/tools/suiteManage.tools.d.ts.map +1 -0
  317. package/dist/tools/suiteManage.tools.js +112 -0
  318. package/dist/tools/suiteManage.tools.js.map +1 -0
  319. package/dist/tools/tasks.tools.d.ts +7 -0
  320. package/dist/tools/tasks.tools.d.ts.map +1 -0
  321. package/dist/tools/tasks.tools.js +101 -0
  322. package/dist/tools/tasks.tools.js.map +1 -0
  323. package/dist/tools/tcEditPublisher.d.ts +29 -0
  324. package/dist/tools/tcEditPublisher.d.ts.map +1 -0
  325. package/dist/tools/tcEditPublisher.js +61 -0
  326. package/dist/tools/tcEditPublisher.js.map +1 -0
  327. package/dist/tools/testCaseLint.d.ts +5 -0
  328. package/dist/tools/testCaseLint.d.ts.map +1 -0
  329. package/dist/tools/testCaseLint.js +112 -0
  330. package/dist/tools/testCaseLint.js.map +1 -0
  331. package/dist/tools/testPlan.tools.d.ts +12 -0
  332. package/dist/tools/testPlan.tools.d.ts.map +1 -0
  333. package/dist/tools/testPlan.tools.js +104 -0
  334. package/dist/tools/testPlan.tools.js.map +1 -0
  335. package/dist/tools/testcase.tools.d.ts +86 -0
  336. package/dist/tools/testcase.tools.d.ts.map +1 -0
  337. package/dist/tools/testcase.tools.js +1591 -0
  338. package/dist/tools/testcase.tools.js.map +1 -0
  339. package/dist/tools/testdata.tools.d.ts +7 -0
  340. package/dist/tools/testdata.tools.d.ts.map +1 -0
  341. package/dist/tools/testdata.tools.js +636 -0
  342. package/dist/tools/testdata.tools.js.map +1 -0
  343. package/dist/tools/xlsx.d.ts +8 -0
  344. package/dist/tools/xlsx.d.ts.map +1 -0
  345. package/dist/tools/xlsx.js +113 -0
  346. package/dist/tools/xlsx.js.map +1 -0
  347. package/dist/vendor/actionSignatures.d.ts +117 -0
  348. package/dist/vendor/actionSignatures.d.ts.map +1 -0
  349. package/dist/vendor/actionSignatures.js +420 -0
  350. package/dist/vendor/actionSignatures.js.map +1 -0
  351. package/dist/vendor/logger.d.ts +43 -0
  352. package/dist/vendor/logger.d.ts.map +1 -0
  353. package/dist/vendor/logger.js +184 -0
  354. package/dist/vendor/logger.js.map +1 -0
  355. package/dist/version.d.ts +10 -0
  356. package/dist/version.d.ts.map +1 -0
  357. package/dist/version.js +10 -0
  358. package/dist/version.js.map +1 -0
  359. package/dist/versionName.d.ts +21 -0
  360. package/dist/versionName.d.ts.map +1 -0
  361. package/dist/versionName.js +48 -0
  362. package/dist/versionName.js.map +1 -0
  363. package/package.json +62 -6
@@ -0,0 +1,1390 @@
1
+ import type { ConnectedQaConfig } from '../../config.js';
2
+ import type { MakeClientOptions } from '../http.js';
3
+ import type { ListResult, ProjectInfo, ProjectPrivileges } from '../types.js';
4
+ import type { ActionDef, CloudRunner, CopyTestdataResult, DatasetInfo, DefaultIteration, DefectQuery, DefectSummary, EntityRef, EnvInfo, Epic, EpicInput, EpicQuery, EpicSummary, EpicUpdate, Feature, FeatureInput, FeatureQuery, FeatureSummary, FeatureUpdate, Formula, FormulaCall, FunctionQuery, FunctionSummary, QaFunction, JournalOp, JournalView, LocalAgent, Locator, MemberOp, MobileDevice, ModuleCreateInput, ModuleDeleteResult, ModuleDetail, ModuleSaved, ModuleSummary, ModuleUpdateInput, ObjectQuery, ProjectSummary, QaObject, ReleaseQuery, ReleaseSummary, RunOptions, RunRef, RunStatus, RunTarget, SaveGeneratedIterations, SaveGeneratedIterationsResult, SavedRef, SprintQuery, SprintSummary, BacklogDeleteResult, BacklogKind, ReportFile, ReportKind, Story, StoryInput, StoryQuery, StorySummary, StoryUpdate, Suite, SuiteSummary, TaskQuery, TaskSummary, TcQuery, TcSummary, TestCase, UserQuery, UserSummary, VersionDeleteInput, VersionDeleteResult, ScheduleAction, ScheduleInfo, ScheduleOptions, ScheduleRef, ScheduleUpdate, TestdataRows } from '../../domain/types.js';
5
+ import { type FnCandidate, type MinConfidence } from './functionMatch.js';
6
+ import { type SqaQueryRequest, type SqaQueryResult } from './searchEngine.js';
7
+ import type { HealApplyMode, HealPlan, HealProposeInput, HealReport } from '../../domain/heal.js';
8
+ import type { HealFacts } from './heal/plan.js';
9
+ /** Test seam identical to WalnutAdapter's — swap transport, keep real headers. */
10
+ export type SimplifyQaTransport = Pick<MakeClientOptions, 'fetchImpl' | 'FormDataImpl' | 'BlobImpl'>;
11
+ /**
12
+ * Normalise a formula expression to the engine's CANONICAL form, where EVERY function call — including
13
+ * nested ones — is prefixed with `=`. The agent's parser (`FormulaNodeConverter`) only matches `=FUNC(...)`,
14
+ * and that is also what the UI's formula builder stores (`FormulaNode.toString()` emits `=` on every node).
15
+ * Callers (and the AI) naturally write Excel-style nesting WITHOUT the inner `=` — e.g.
16
+ * `=CONCATENATE(ALPHABET(3),NUMERIC(3))` — which the engine rejects ("No valid function found") and which,
17
+ * when stored, breaks the Test Data UI + execution. This rewrites it to
18
+ * `=CONCATENATE(=ALPHABET(3),=NUMERIC(3))`.
19
+ *
20
+ * Only an identifier directly followed by `(` becomes a function (so bare words and `{{paramId}}` refs are
21
+ * untouched), and content inside double quotes is left verbatim (so string literals like
22
+ * `CONCATENATE("Total(x)")` are not mangled). A function that already has a leading `=` is not doubled.
23
+ */
24
+ export declare function normalizeFormulaExpression(expr: string): string;
25
+ /** The engine matches function names CASE-SENSITIVELY against its enum ("CONCATENATE"), while a
26
+ * recorder / AI naturally writes "concatenate" or "First_Name" — which the engine rejects with
27
+ * "No valid function found". Rewrite every `name(` to the canonical spelling; quoted text is left
28
+ * untouched and unknown names are left as written (the validity check below reports them). */
29
+ export declare function canonicalizeFormulaNames(expr: string, knownUpper: ReadonlySet<string>): string;
30
+ /** The backend catalog declares some engine formulas with NO parameters, so a model guesses the
31
+ * arguments (the classic `=TODAY(ddmmyyyy)`). Fill in what the ENGINE accepts — only for blank
32
+ * entries, so a real backend/custom definition always wins. */
33
+ export declare function withEngineArgHints(f: Formula): Formula;
34
+ /** Extract every function name (an identifier directly followed by `(`) from a formula expression, skipping
35
+ * content inside double quotes so string literals like `"Total(x)"` are not treated as calls. */
36
+ export declare function extractFunctionNames(expr: string): string[];
37
+ /** A named item a suite depends on (schedule, pipeline, execution plan, test plan). */
38
+ export type SuiteRef = {
39
+ id: string;
40
+ code?: string;
41
+ name?: string;
42
+ };
43
+ export type SuiteBlockers = {
44
+ schedules: SuiteRef[];
45
+ pipelines: SuiteRef[];
46
+ executionPlans: SuiteRef[];
47
+ testPlans: SuiteRef[];
48
+ };
49
+ /** Execution settings `PUT /tm/suites/settings/:id` accepts (UAT updateSuiteSettingsBodyValidation). */
50
+ export type SuiteSettings = {
51
+ autoDefectLog?: boolean;
52
+ autoReExecCount?: number;
53
+ autoReExecTriggerOn?: string;
54
+ newBrowserSession?: boolean;
55
+ terminateOnFailure?: boolean;
56
+ minimumContainerCount?: number;
57
+ maximumContainerCount?: number;
58
+ };
59
+ /** The execution doc's `globalConfiguration` for a SUITE run. The suite's Settings panel stores the
60
+ * auto re-execution count / trigger, new-browser-session and terminate-on-failure as SUITE FIELDS;
61
+ * carrying only `rawSuite.globalConfiguration` (usually absent) made every MCP-started run use 0
62
+ * re-executions even though Settings showed 2. Explicit run opts win, then the suite fields. */
63
+ export declare function suiteRunGlobalConfig(rawSuite: Record<string, any>, opts?: {
64
+ terminateOnFailure?: boolean | undefined;
65
+ maxConcurrent?: number | undefined;
66
+ }): Record<string, unknown>;
67
+ /** Read-back shape of a suite's Settings panel (execution type + execution/auto-defect settings). */
68
+ export type SuiteSettingsView = {
69
+ id: string;
70
+ code?: string | undefined;
71
+ name?: string | undefined;
72
+ executionType?: string | undefined;
73
+ autoReExecCount: number;
74
+ autoDefectLog: boolean;
75
+ autoReExecTriggerOn?: string | undefined;
76
+ newBrowserSession: boolean;
77
+ terminateOnFailure: boolean;
78
+ minimumContainerCount?: number | null | undefined;
79
+ maximumContainerCount?: number | null | undefined;
80
+ };
81
+ /** Execution-plan fields the MCP can set (UAT createEpBody / updateEpBody). `environment` is a name or
82
+ * key, sent as `environmentType`. */
83
+ export type ExecutionPlanInput = {
84
+ name: string;
85
+ plannedStartDate: string;
86
+ plannedEndDate: string;
87
+ environment: string;
88
+ releaseId?: number | null;
89
+ iterationId?: number | null;
90
+ teamIds?: number[];
91
+ planners?: number[];
92
+ autoReExecCount?: number;
93
+ autoReExecTriggerOn?: string;
94
+ autoDefectLog?: boolean;
95
+ newBrowserSession?: boolean;
96
+ terminateOnFailure?: boolean;
97
+ };
98
+ /** What to add to a plan: test cases and/or every live test case of suites, optionally assigned. */
99
+ export type PlanEntryInput = {
100
+ tcIds?: string[];
101
+ suiteIds?: string[];
102
+ assignTo?: string;
103
+ assignDate?: string;
104
+ };
105
+ /** One plan entry, as shown before removing it. */
106
+ export type PlanEntryRef = {
107
+ id: string;
108
+ code: string;
109
+ tcName: string;
110
+ assignedTo?: number;
111
+ };
112
+ /** What a plan run started: the new execution id, the test cases sent, and those left out (with why). */
113
+ export type PlanRunRef = {
114
+ runId: string;
115
+ started: string[];
116
+ skipped: Array<{
117
+ code: string;
118
+ reason: string;
119
+ }>;
120
+ };
121
+ /** Refused suite delete: something still uses it (the caller lists `blockers`). */
122
+ export declare class SuiteBlockedError extends Error {
123
+ readonly suite: SuiteRef;
124
+ readonly blockers: SuiteBlockers;
125
+ constructor(suite: SuiteRef, blockers: SuiteBlockers);
126
+ }
127
+ /** A pipeline the MCP can create (createPipelinesValidations). `parentId` is the test case or suite. */
128
+ export type PipelineInput = {
129
+ name: string;
130
+ pipelineType: 'TC' | 'SU';
131
+ parentId: string;
132
+ releaseId?: string;
133
+ sprintId?: string;
134
+ mode: 'local' | 'remote' | 'cloud';
135
+ agentId?: string;
136
+ environment?: string;
137
+ browser?: string;
138
+ description?: string;
139
+ };
140
+ export type PipelineUpdate = {
141
+ name?: string;
142
+ description?: string;
143
+ releaseId?: string;
144
+ sprintId?: string;
145
+ environment?: string;
146
+ agentId?: string;
147
+ mode?: 'local' | 'remote' | 'cloud';
148
+ };
149
+ /**
150
+ * SimplifyQaAdapter — DIRECT-to-backend REST driver for SimplifyQA, mirroring WalnutAdapter's
151
+ * design. Reads (list/get for projects/testcases/suites/stories/modules/releases/sprints/objects)
152
+ * hit the SimplifyQA backend REST directly via a `QaHttp` bound to `cfg.baseUrl`. Anything not yet
153
+ * ported (writes, testdata, run dispatch, marketplace, and the recording surface) delegates to
154
+ * the LOCAL AGENT's `/mcp` (`cfg.url`) via a lazily-built RemoteMcpAdapter — same "graceful hop"
155
+ * pattern walnut uses for recording. When the hop is not configured, unported ops surface a clear
156
+ * error instead of failing silently.
157
+ *
158
+ * This class deliberately does not `implements ProviderAdapter` (walnut trick): the factory casts
159
+ * it, and tools that call ported methods get direct REST; tools that call unported methods get
160
+ * the hop (or a clear error). Each porting step replaces one more delegation with a direct call.
161
+ */
162
+ export type ActionCatalogEntry = {
163
+ id: number;
164
+ objectRequired: boolean;
165
+ objectTemplate?: number | undefined;
166
+ displayName?: string | undefined;
167
+ /** Backend camelCase action name (e.g. "launchApplication"); display name is separate. */
168
+ name?: string | undefined;
169
+ /** Technology this action belongs to (WEB / ANDROID / API / DATABASE / …), from its objectTemplate. */
170
+ technology?: string | undefined;
171
+ /** Plugin `@Deprecated` row (uniqueId starts with `deprecated-`) — never resolve a step BY NAME to one. */
172
+ deprecated?: boolean | undefined;
173
+ };
174
+ export declare class SimplifyQaAdapter {
175
+ private readonly cfg;
176
+ private readonly http;
177
+ private agentHop;
178
+ private formulaCache;
179
+ private sqaEngine;
180
+ private backlogDefaultsCache;
181
+ private userIdPromise;
182
+ constructor(cfg: ConnectedQaConfig, transport?: SimplifyQaTransport);
183
+ private accessOk;
184
+ /** Resolves when the user has a role in the selected project. Only success is remembered: a
185
+ * refusal or a failed lookup is re-checked on the next call (fail closed meanwhile). */
186
+ private projectAccess;
187
+ private checkProjectAccess;
188
+ private headers;
189
+ /** Public session context for MCP viewer/recorder windows that need to authenticate the sqa-ui
190
+ * they load. cfg itself stays private; this getter is the one seam through which tc_edit_open
191
+ * and record tools can forward token + baseUrl + projectId to Electron without asking the LLM. */
192
+ getSessionContext(): Promise<{
193
+ token: string;
194
+ baseUrl: string;
195
+ projectId?: string;
196
+ userId?: string;
197
+ }>;
198
+ private requireProjectId;
199
+ /** A search payload. Soft-deleted rows are ALWAYS excluded, as the AI assistant's reads do:
200
+ * `deleted:false` is set here and a caller's own `deleted` entry is dropped, never sent. */
201
+ private searchBody;
202
+ private engine;
203
+ private newEngine;
204
+ /** With no project selected, collections that are not project-scoped (projects, users, teams …)
205
+ * and the catalog are still readable; anything project-scoped asks for a project first. */
206
+ private engineFor;
207
+ /** `projects` + `member:true` (not a stored field) → `id in <your role projects>`, plus your role
208
+ * per project for the rows. Returns null when you have no role anywhere, so the caller can answer
209
+ * without a search. */
210
+ private applyMemberFilter;
211
+ /** `users` + where projectIds = <id>: the MEMBERS of that project. A user row carries no project,
212
+ * so membership is read from project_user_role (GET /pm/projectuserrole?projectId=) and turned
213
+ * into `id in [...]`; each row gets `roleId` + `roleName` in that project. Allowed only for an
214
+ * admin or a member of that project (the endpoint itself does not check). Returns null when the
215
+ * request is not a project-members query. */
216
+ private applyProjectMembersFilter;
217
+ /** Is the caller an admin (userType holds "admin")? Read from the user's own row — the token does
218
+ * not carry it — and reused for a minute, so an admin <-> non-admin change shows up quickly. */
219
+ private adminCache;
220
+ private static readonly ADMIN_TTL_MS;
221
+ private isCallerAdmin;
222
+ /** users / projects: for an admin the backend returns the whole account, so say that instead of
223
+ * the registry's "only those who share a project with you". undefined = keep the registry note. */
224
+ private adminVisibilityNote;
225
+ /** `allProjects:true` on a release-like collection (releases, sprints, epics, features — rows that
226
+ * belong to projects through `projectIds` or a release): search / count across every project you
227
+ * have a role in, without switching. A `projectId`/`projectIds` filter narrows to those of your
228
+ * projects; it can never widen past them. Admins included — "my projects", as in the UI. */
229
+ private applyAllProjects;
230
+ /** "Default Business Unit", as the SimplifyQA header shows it: not a stored record (id null) but
231
+ * the label for YOUR projects that have no business unit. Added to a plain business-unit list /
232
+ * count when you have such a project; `related` on id "default" lists those projects. Returns
233
+ * null when the request is not one of these. */
234
+ private defaultBusinessUnit;
235
+ /** Adds `roleId` + `roleName` (your role in that project) to member:true project rows. A failed
236
+ * role-name lookup leaves `roleName` out; the rows are still returned. */
237
+ private withRoles;
238
+ /**
239
+ * ONE generic read surface over every SQA collection. Backs the `sqa_query` tool:
240
+ * catalog -> collections, fields, relations, descriptions
241
+ * custom_fields -> custom fields for a collection (label -> key -> customFields.<key>)
242
+ * search -> compiled searchFields + rows
243
+ * get -> one row, optionally expanding steps/versions/members
244
+ * related -> follow a relation (story -> testcases, testcase -> defects, ...)
245
+ *
246
+ * Always injects `deleted:false` and the active project; never exposes deleted rows.
247
+ */
248
+ sqaQuery(input: SqaQueryRequest): Promise<SqaQueryResult>;
249
+ /** Validates baseUrl + token + (optional) project by running the same list_projects search the
250
+ * Java `infoResult` uses to resolve the project name — no separate /info endpoint on SQA.
251
+ * `counts` is a best-effort row count per entity type (test cases/suites/stories/objects), read
252
+ * from each `/search` endpoint's own `totalCount` (see searchTotalCount) — mirrors what Walnut's
253
+ * info() already returns via its own `counts`. */
254
+ info(): Promise<ProjectInfo>;
255
+ /** Projects the caller can access. Three code paths in priority order:
256
+ *
257
+ * 1. Config-supplied `QA_MCP_USER_ID` (explicit override) → user-scoped two-step via
258
+ * `/pm/projectuserrole`.
259
+ * 2. Session JWT with a `userId` claim → same two-step.
260
+ * 3. `GET /pm/auth/me` — resolves the user from the token itself (works for API keys, which
261
+ * are encrypted JWTs the client cannot decode) → same two-step.
262
+ * 4. None of the above (e.g. an older deployment without /me) → direct `/pm/project/search`,
263
+ * paged to the end. The backend scopes by token owner where it can (tenant-wide for admins);
264
+ * `totalCount` uses `rows.length` (backend's top-level count is unreliable).
265
+ *
266
+ * The two-step avoids both problems: correct user scoping AND an accurate count. */
267
+ listProjects(): Promise<ListResult<ProjectSummary>>;
268
+ /** projectId → roleId for every project `userId` has a role in. */
269
+ private memberRoles;
270
+ /** projectId|userId → resolved privileges. A role changes rarely; a recording preflight should not
271
+ * cost three round trips every time the agent asks. Instance-scoped, so switchProject drops it. */
272
+ private privilegesCache;
273
+ private static readonly PRIVILEGES_TTL_MS;
274
+ /**
275
+ * What the caller may do in a project — the SAME resolution the backend's
276
+ * `checkPrivilegesForApi` runs, so a positive answer here is exactly the answer the write
277
+ * endpoints will give:
278
+ *
279
+ * 1. `/pm/auth/me` → the user behind the token (an expired/invalid token fails here).
280
+ * 2. `/pm/projectuserrole?userId=` → the roleId this user holds in the project (no row = no access).
281
+ * 3. `/pm/roles/search` for that role → its `privileges[]`.
282
+ *
283
+ * `tokenValid:false` = the token is dead; `hasRole:false` = live token, no role in this project.
284
+ * Both are answers, not errors, so the caller can report them instead of crashing.
285
+ */
286
+ getProjectPrivileges(projectId?: string): Promise<ProjectPrivileges>;
287
+ private listProjectsForUser;
288
+ /** Best-effort row count for an entity `/search` endpoint — posts a minimal (limit 1) project-scoped
289
+ * search and reads the `totalCount` the backend returns alongside `data` (the same envelope shape
290
+ * every /search endpoint in this codebase uses, confirmed via the real sqa-ui
291
+ * `{ totalCount: number, data: [...] }` response typing). Never throws — counts are a nice-to-have
292
+ * for project_info, not worth failing the whole call over; any failure (or a missing totalCount)
293
+ * falls back to 0 / the returned row count. */
294
+ private searchTotalCount;
295
+ private listProjectsDirect;
296
+ /** Decode the `userId` claim from the SQA JWT payload WITHOUT verifying the signature. Backend
297
+ * re-verifies on every call; this only needs the id for `/pm/projectuserrole`. Returns undefined
298
+ * on any parse failure or when the token isn't a JWT. */
299
+ private jwtUserId;
300
+ listTestCases(q: TcQuery): Promise<ListResult<TcSummary>>;
301
+ /** "me" → the caller's own numeric id (see ensureUserId); numeric string → number; anything
302
+ * else → undefined. Callers should have resolved a name to a numeric id via `list_users`. */
303
+ private resolveUserFilter;
304
+ /**
305
+ * The caller's numeric SQA userId, resolved from whatever we already have:
306
+ * 1. `QA_MCP_USER_ID` (explicit override — kept for old deployments and read-only setups),
307
+ * 2. a `userId` claim on a session JWT,
308
+ * 3. `GET /pm/auth/me` (works for API keys; one call per adapter instance, cached).
309
+ * Returns undefined when none work — callers then fall back to unscoped behaviour rather than
310
+ * failing the tool. A failed lookup is not cached: the project-access check fails closed on it,
311
+ * so one network blip must not refuse every call until a reconnect.
312
+ */
313
+ private ensureUserId;
314
+ /** This user's UI preferences (`GET /pm/preference/:userId`). The COLUMN preferences of the list
315
+ * views live here as arrays of visible fields: `epicFilter`, `featureFilter`, `userstoryFilter`,
316
+ * `defectFilter`, … Updating them is exactly what the UI's column-preference tick does. */
317
+ getUserPreferences(): Promise<Record<string, unknown>>;
318
+ /** Partial preference update (`PUT /pm/preference/:userId`) — send only the keys you change. */
319
+ updateUserPreferences(patch: Record<string, unknown>): Promise<Record<string, unknown>>;
320
+ /** Field catalogue of an entity's list view (`fieldType=allFields`) — e.g. entity 1 = Epic,
321
+ * 2 = Feature, 3 = User Story. Used to resolve a column label ("Created On") to its key/shape. */
322
+ listViewFields(entityId: number, fieldType?: string): Promise<Array<Record<string, unknown>>>;
323
+ /** `GET /pm/auth/me` → `{ userDetails: { id, username, email, … }, userPreference, … }`.
324
+ * Only `userDetails.id` is read: the payload also carries an agent token and the full
325
+ * preference/privilege set, which must never be logged or persisted. */
326
+ private fetchUserIdFromMe;
327
+ /** Neutral test case, steps included. Accepts numeric id or business code (`TC_123`).
328
+ * `versionId` overrides which version's steps to load — omit to accept the TC's currently-
329
+ * selected version. When the resolved version differs from the doc's current selection, we
330
+ * also patch `currentVersionId` on the returned tc so callers can render "showing version X". */
331
+ getTestCase(id: string, versionId?: string): Promise<TestCase>;
332
+ private fetchRawTestcase;
333
+ private fetchStepsCollection;
334
+ private hydrateFunctionNames;
335
+ /** For every step with an objectRef, resolve the object's display name (`disname`) via
336
+ * /tm/object/search (batched by distinct objectId). Mutates `objectRef.name` in place. Mirrors the
337
+ * FE's `defaultFieldsMap.get('objectId').map` behavior used by the Excel export
338
+ * (tcfn.service.js:2876) so the tool surface matches the UI.
339
+ *
340
+ * An id that does NOT come back from the search (deleted, or never existed) is flagged
341
+ * `objectRef.missing = true` — this must NOT be silently indistinguishable from "the object
342
+ * exists but has no disname set" (see the "show me the objects in this test case" incident:
343
+ * falling back to the bare id with no signal made a genuinely-deleted object's step look
344
+ * identical to a normal one). Only a hard failure of the search call itself (network/auth) skips
345
+ * this — we can't tell missing-from-deleted apart from missing-from-can't-check in that case. */
346
+ /** Object display names / thumbnails are what make a step renderable AND what the function matcher
347
+ * compares (`action|object name`). Takes anything with `steps` so a FUNCTION's steps can be hydrated
348
+ * exactly like a test case's. */
349
+ private hydrateObjectNames;
350
+ listSuites(): Promise<ListResult<SuiteSummary>>;
351
+ getSuite(id: string): Promise<Suite>;
352
+ listStories(q: StoryQuery): Promise<ListResult<StorySummary>>;
353
+ getStory(id: string): Promise<Story>;
354
+ /** A US_XXX business key → the numeric userstoryId via `/pm/userstory/search`. Numeric passes
355
+ * through. SQA's GET-by-id parseInts the path, so a raw key would 404. */
356
+ private resolveStoryNumericId;
357
+ /** `POST /pm/defect/search` — same searchFields protocol as userstory/testcase search. */
358
+ listDefects(q: DefectQuery): Promise<ListResult<DefectSummary>>;
359
+ /** `POST /pm/task/search` — same searchFields protocol as defect/userstory search. */
360
+ listTasks(q: TaskQuery): Promise<ListResult<TaskSummary>>;
361
+ /** Fetch the project's default `state` and `priority` for a backlog entity.
362
+ * parentId: 1 = Epic, 2 = Feature, 3 = User Story. Two-source resolution, in order:
363
+ *
364
+ * 1. `/pm/fields/:parentId?fieldType=defaultFld` — pick the field value marked `isDefault: true`;
365
+ * fall back to the first non-archived value (seed ships with `isDefault: false` everywhere
366
+ * until a customer configures one).
367
+ * 2. If either state or priority is still missing, hit the entity's `/search` endpoint for one
368
+ * existing row in the project and steal its state / priority. Real data is a more reliable
369
+ * signal than the fields config, which is customer-scoped for Epic/Feature (parentIds 1/2)
370
+ * and can be missing entirely on customers that pre-date the seeding step.
371
+ *
372
+ * Returns the value's `.key` (uppercase enum like `PROPOSED`, `MEDIUM`) — that is what the entity
373
+ * row stores; the field metadata declares `keyname: "key"` / `type: "KEY"` and the SQA UI binding
374
+ * (see epic-form.component.html: `keyname="key" type="KEY" [displayKeys]="{'field':'value'}"`) confirms
375
+ * key is stored, `.value` is only for display. Both sources are wrapped in try/catch: a transient
376
+ * upstream error must not block create; the backend surfaces its own error if invalid. */
377
+ private getBacklogDefaults;
378
+ createStory(input: StoryInput): Promise<SavedRef>;
379
+ updateStory(id: string, patch: StoryUpdate): Promise<SavedRef>;
380
+ /** Attach ONE file to an epic / feature / user story. The backend has no standalone upload
381
+ * endpoint: the UI uploads files WITH the entity save (multipart `epicObj`/`featureObj`/
382
+ * `userstoryObj` + `filename1`), so this re-saves the item with its existing fields + attachments
383
+ * and the new file. Reads the attachments back and returns them. */
384
+ addAttachment(input: {
385
+ entityType: 'epic' | 'feature' | 'userstory';
386
+ itemId: string;
387
+ fileName: string;
388
+ contentType?: string | undefined;
389
+ data: Uint8Array;
390
+ }): Promise<{
391
+ id?: string;
392
+ name: string;
393
+ attachments: Array<Record<string, unknown>>;
394
+ }>;
395
+ /** Attachments of an epic / feature / user story (`/pm/attachment/:id/:parentType`). */
396
+ entityAttachments(entityType: 'epic' | 'feature' | 'userstory', id: string): Promise<Array<Record<string, unknown>>>;
397
+ /** Remove one attachment (by id or stored/original name) from an epic / feature / user story.
398
+ * Mirrors the UI: mark the row `deleted:true` and re-save the item (multipart, no file part). */
399
+ removeAttachment(input: {
400
+ entityType: 'epic' | 'feature' | 'userstory';
401
+ itemId: string;
402
+ attachment: string;
403
+ }): Promise<{
404
+ removed: boolean;
405
+ attachments: Array<Record<string, unknown>>;
406
+ }>;
407
+ listEpics(q: EpicQuery): Promise<ListResult<EpicSummary>>;
408
+ getEpic(id: string): Promise<Epic>;
409
+ createEpic(input: EpicInput): Promise<SavedRef>;
410
+ updateEpic(id: string, patch: EpicUpdate): Promise<SavedRef>;
411
+ /** EP_XXX business key → numeric epic id via `/pm/epic/search`. Numeric passes through. */
412
+ private resolveEpicNumericId;
413
+ listFeatures(q: FeatureQuery): Promise<ListResult<FeatureSummary>>;
414
+ getFeature(id: string): Promise<Feature>;
415
+ createFeature(input: FeatureInput): Promise<SavedRef>;
416
+ updateFeature(id: string, patch: FeatureUpdate): Promise<SavedRef>;
417
+ /** FT_XXX business key → numeric feature id via `/pm/feature/search`. Numeric passes through. */
418
+ private resolveFeatureNumericId;
419
+ /** Pages internally until the server returns a short page (or the total is reached) — the tool
420
+ * has no limit/offset of its own and always wants the WHOLE project tree; `searchBody`'s default
421
+ * page size (100) previously truncated any project with more modules than that silently. */
422
+ listModules(): Promise<ListResult<ModuleSummary>>;
423
+ /** GET /pm/module/:id — server returns an array; empty array → NotFound. */
424
+ getModule(id: string): Promise<ModuleDetail>;
425
+ /** POST /pm/module — server validates: name+isRoot+projectId required; parentId ignored when
426
+ * isRoot:true. Duplicate name per project is rejected server-side. When `input.children` is
427
+ * present, walks the subtree depth-first: creates the root, then each child under the id
428
+ * returned for its parent. `childIds:[]` matches the working UI payload byte-for-byte.
429
+ * Backend has no tx endpoint: on mid-walk failure the returned tree carries `failedAt`, and
430
+ * every node BEFORE that point is already persisted. */
431
+ createModule(input: ModuleCreateInput): Promise<ModuleSaved>;
432
+ private checkChildLinked;
433
+ /** Depth-first walk of a subtree. Stops at the first failure — everything already POSTed stays
434
+ * (no rollback endpoint upstream) and the failure is bubbled back on the root via `failedAt`. */
435
+ private createSubtree;
436
+ private postOneModule;
437
+ updateModule(id: string, patch: ModuleUpdateInput): Promise<SavedRef>;
438
+ private reparentModule;
439
+ /** PDF reports for one execution — the same `/reports/pdfV2/*` endpoints the SimplifyQA UI downloads
440
+ * from, so content and format match the UI. The path values (`type`/`executionType`/`executionStyle`)
441
+ * come from the execution doc, exactly as the UI takes them from its `displayDataExecution`.
442
+ * Protected-parameter masking is done by the report service itself — nothing is re-rendered here. */
443
+ downloadReports(input: {
444
+ runId: string;
445
+ kinds: ReportKind[];
446
+ outDir: string;
447
+ }): Promise<{
448
+ scope: 'testcase' | 'suite';
449
+ runLabel: string;
450
+ files: ReportFile[];
451
+ notes: string[];
452
+ }>;
453
+ /** PATCH /pm/{epic|feature|userstory|defect|task} with `{ids, projectId, isDelete}`. Epic / feature /
454
+ * story / defect are two-phase (`isDelete:false` returns the per-id dependency rows, and `isDelete:true`
455
+ * silently skips ids that still have dependents, returning those rows again). Task has no dry-run and
456
+ * no dependency check. `deleted` is therefore decided by the response shape: dependency rows come
457
+ * back as an ARRAY, a real delete does not. */
458
+ deleteBacklogItem(input: {
459
+ kind: BacklogKind;
460
+ id: string;
461
+ confirm?: boolean;
462
+ }): Promise<BacklogDeleteResult>;
463
+ /** PATCH /pm/module — two-phase per module.controller.js:94. `confirm:false` returns the per-id
464
+ * dependency footprint (test cases, functions, params, objects, defects, user stories). `confirm:true`
465
+ * triggers the actual delete: server drops only ids with EMPTY dependencies; ids with references are
466
+ * silently skipped — we still return that list so the caller can act on it.
467
+ * ponytail: one method, `confirm` flag; mirrors the backend's two-call contract. */
468
+ deleteModule(input: {
469
+ ids: string[];
470
+ projectId: string;
471
+ confirm?: boolean;
472
+ }): Promise<ModuleDeleteResult>;
473
+ /** PUT /tm/tcfnversion/delete — soft-delete ONE version of a TC or FN. Two-phase per
474
+ * tcfnversion.service.js:30 — `isDelete:false` (or `isDelete:true` with non-empty deps) →
475
+ * returns the dependency array unchanged; `isDelete:true` with EMPTY deps → soft-deletes the
476
+ * tcfn_version row + its steps + testdata + testdata iterations.
477
+ *
478
+ * ponytail: one method, `confirm` flag. Response shape decides `deleted`: if every dep row is
479
+ * fully empty (all `*Arr` are `{}` maps), the server actually deleted; otherwise it refused
480
+ * and just handed back the deps. We do not assume — we inspect. */
481
+ deleteVersion(input: VersionDeleteInput): Promise<VersionDeleteResult>;
482
+ /** `list_releases` has no limit/offset of its own — it always wants the WHOLE visible set — so
483
+ * page internally past `searchBody`'s default 100 instead of silently truncating (same fix as
484
+ * listModules). */
485
+ listReleases(q: ReleaseQuery): Promise<ListResult<ReleaseSummary>>;
486
+ /** Same unconditional-pagination fix as listReleases — `list_sprints` has no limit/offset either. */
487
+ listSprints(q: SprintQuery): Promise<ListResult<SprintSummary>>;
488
+ /** POST /pm/users/search — the customer's users (router mounted at `/pm/users`, plural — see
489
+ * project-management/express-app.js:181). Backend auto-scopes non-admin callers to users in
490
+ * their assigned projects. Optional `projectId` narrows to that project's members; optional
491
+ * `search` is a case-insensitive regex over `name`. */
492
+ listUsers(q: UserQuery): Promise<ListResult<UserSummary>>;
493
+ /** Resolve a mixed list of user references (numeric id, email, or full name) to numeric user ids.
494
+ * Used for Watch Lists (the UI's email button stores `mailersList.users` as ids). */
495
+ resolveUserIds(refs: Array<string | number>): Promise<number[]>;
496
+ /** Add users to an epic/feature/story WATCH LIST (`mailersList.users`) — exactly what the UI's
497
+ * email button saves. Existing watchers are preserved; the item is re-read to confirm. */
498
+ addWatchListUsers(input: {
499
+ entityType: 'epic' | 'feature' | 'userstory';
500
+ itemId: string;
501
+ users: Array<string | number>;
502
+ }): Promise<{
503
+ users: number[];
504
+ mailersList: Record<string, unknown>;
505
+ }>;
506
+ /** Link an epic/feature/story to another backlog item (defect, epic, feature, story, task) with a
507
+ * chosen LINK TYPE — the UI's Linkages section. The link is stored in the source item's
508
+ * `linkedIssues` array (the same field the form saves) and read back from /pm/linkages. */
509
+ linkBacklogItem(input: {
510
+ sourceType: 'epic' | 'feature' | 'userstory';
511
+ sourceId: string;
512
+ destType: 'epic' | 'feature' | 'userstory' | 'defect' | 'task';
513
+ destId: string;
514
+ linkType: string;
515
+ }): Promise<{
516
+ linkTypeKey: string;
517
+ destinationCode?: string;
518
+ linkedIssues: Array<Record<string, unknown>>;
519
+ }>;
520
+ /** Create a PROJECT (`POST /pm/project`). The UI's new-project form sends a name, description and
521
+ * the member `users` plus a defaults block; the backend accepts the minimal shape, so start there
522
+ * and let the backend fill its own defaults. */
523
+ createProject(input: {
524
+ name: string;
525
+ description?: string | undefined;
526
+ users?: number[] | undefined;
527
+ }): Promise<SavedRef>;
528
+ /** `GET /pm/project/:id` — read a project back (used to confirm a create). */
529
+ getProjectById(id: string): Promise<Record<string, any>>;
530
+ /** Soft-delete a project — the admin Project screen's delete (`PATCH /pm/project { ids }`). */
531
+ deleteProject(id: string): Promise<{
532
+ deleted: boolean;
533
+ }>;
534
+ /** Members of a project as [{id, userId, roleId}] (GET /pm/projectuserrole?projectId=).
535
+ * `id` is the project_user_role ROW id — the project update matches existing rows by it. */
536
+ listProjectMembers(projectId: string): Promise<Array<{
537
+ id?: number;
538
+ userId: number;
539
+ roleId: number;
540
+ }>>;
541
+ /** The user whose EMAIL matches exactly (case-insensitive), or null (POST /pm/users/search). */
542
+ findUserByEmail(email: string): Promise<{
543
+ id: number;
544
+ code?: string;
545
+ name?: string;
546
+ email?: string;
547
+ } | null>;
548
+ /** Invite (= create) a user and, when a project+role is given, assign them to it in the same call.
549
+ * POST /pm/users — the UI's "Invite User" form body. The backend sends the invitation email. */
550
+ inviteUser(input: {
551
+ email: string;
552
+ name?: string | undefined;
553
+ roleId?: number | undefined;
554
+ projectId?: string | undefined;
555
+ }): Promise<{
556
+ id: number;
557
+ code?: string;
558
+ }>;
559
+ /** Add members to a project: merge with the existing list and PUT the full list back. */
560
+ addProjectMembers(projectId: string, members: Array<{
561
+ userId: number;
562
+ roleId: number;
563
+ }>): Promise<{
564
+ added: number[];
565
+ updated: number[];
566
+ total: number;
567
+ }>;
568
+ /** Remove members from a project (PUT the remaining list + `removedUsers`). */
569
+ removeProjectMembers(projectId: string, userIds: number[]): Promise<{
570
+ removed: number[];
571
+ total: number;
572
+ }>;
573
+ /** PUT /pm/project/<id> carrying the FULL member list (the project form's update payload). */
574
+ private putProjectUsers;
575
+ getObject(id: string, opts?: {
576
+ enrichNames?: boolean;
577
+ }): Promise<QaObject>;
578
+ private enrichObjectNames;
579
+ private resolveParameterNames;
580
+ /** Report page for one run: a TESTCASE run is addressed by the TEST CASE id as `parentId` (its own executionItemId
581
+ * is empty for API/DB runs), a SUITE run by the suite id. */
582
+ private runReportUrl;
583
+ productUrlFor(entity: EntityRef): string;
584
+ private hop;
585
+ /** Recording tool schemas from the SQA agent — mirrored so the recording passthrough can register
586
+ * them. No agent configured → `[]`, so no recording tools get registered. */
587
+ listAgentTools(): Promise<Array<{
588
+ name: string;
589
+ description?: string;
590
+ inputSchema?: Record<string, unknown>;
591
+ }>>;
592
+ /** Forward a recording-tool call to the agent /mcp. Same behavior as walnut. */
593
+ callRaw(name: string, args: Record<string, unknown>): Promise<unknown>;
594
+ /** The database keeps a module as its numeric id; a prompt may give its NAME. Resolve a name (or code) to the id —
595
+ * never let a non-numeric value become 0, which silently saves the test case into the root module. */
596
+ private resolveModuleId;
597
+ /** Pin every function-call step so the saved call is self-contained: fill the function's NEWEST
598
+ * version id (SQA's `fnVersionId`) plus its code/name when the caller supplied only an id or FN-code
599
+ * ("use FN-64"). Save-time, best-effort: a failed lookup leaves the step exactly as authored, so this
600
+ * can never block a save. Mirrors the identity `journal_modify insert_nested` pins. */
601
+ private pinFunctionCalls;
602
+ /**
603
+ * A test case authored from FUNCTION CALLS has no step technology of its own — each call inherits
604
+ * the FUNCTION's `fnType` (WEB / API / ANDROID / IOS / DATABASE / MAINFRAME / …). Without this the
605
+ * TC was saved as WEB (deriveTcType's default), so a suite of API or mobile functions silently
606
+ * became a browser test case.
607
+ *
608
+ * Resolves each call's function once, stamps the technology on the call's step (so the wire rows
609
+ * agree) and sets it on the test case. A draft that mixes technologies is rejected: SQA stores ONE
610
+ * tcType per test case.
611
+ */
612
+ private resolveFunctionTechnologies;
613
+ /** Two-step create: (1) resolve every `${name}` token in the steps to a project-scoped parameter id
614
+ * (get-or-create) plus, for AUTOMATION, each step's actionId + objectId, (2) POST /tm/testcase
615
+ * multipart with the assembled `testcaseObj`. */
616
+ createTestCase(tc: TestCase): Promise<SavedRef>;
617
+ /** Same shape as create, but with `tcfnObj.id` set. */
618
+ updateTestCase(id: string, tc: TestCase): Promise<SavedRef>;
619
+ /** The backend deletes a step only when it receives it with `deleted:true`; a step that is simply
620
+ * absent from the payload is left untouched. So a step removed from the draft (remove_step) has to be
621
+ * sent back explicitly as deleted, otherwise the save "succeeds" and the step is still there.
622
+ * Only applies when the draft was hydrated from this test case (its steps carry `sourceId`), so a
623
+ * hand-built draft with no source ids can never wipe the stored steps. Best-effort: a failed lookup
624
+ * leaves the payload as it was. */
625
+ private appendRemovedSteps;
626
+ /** Snapshot the CURRENT server state of a testcase under a NEW version name — same TC id,
627
+ * new `tcfn_version` row with cloned steps. Backed by `PUT /tm/testcase` with
628
+ * `operation:"SAVENEWVERSION"` (see tcfn.service.js:115/242/355 for the branches). The steps
629
+ * we fetch from the collection are re-POSTed with their `id` stripped so the backend inserts
630
+ * fresh rows attached to the new version. When `tdCopy` is true, the source version's
631
+ * testdata iterations are cloned across environments via `verData.selVersionId`.
632
+ *
633
+ * Not a mapper roundtrip: we resend the raw tcfnObj/steps we just fetched, so any fields the
634
+ * neutral `TestCase` type doesn't carry (custom fields, mailers, exec platform, ...) are
635
+ * preserved verbatim — the point of a version is "freeze what's there now". */
636
+ saveAsNewVersion(id: string, opts: {
637
+ versionName: string;
638
+ tdCopy?: boolean;
639
+ sourceVersionId?: string;
640
+ tc?: TestCase;
641
+ }): Promise<SavedRef>;
642
+ /** STEPSTOFN — mirrors the FE "Save as function" flow (create-new-fn-modal.component.ts:88-197):
643
+ * pick a subset of the TC's steps, retype to FN, POST /tm/function multipart with the
644
+ * `functionObj` payload. Backend re-assigns step ids/versionId under the newly created FN version.
645
+ *
646
+ * ponytail: file attachments (STEP_ATTACMENTS / STEP_COMAPAREFILES multipart entries) are NOT
647
+ * forwarded — MCP callers don't ship blobs. Add if a real caller needs them.
648
+ * ponytail: sub-step flattening (FE lines 124-127) is skipped — `/tm/testcase/steps` returns
649
+ * flat top-level rows; nested FN expansions aren't in that read. Handle if that changes. */
650
+ saveStepsAsFunction(tcId: string, opts: {
651
+ stepSeqs: number[];
652
+ name: string;
653
+ moduleId: number;
654
+ copyTestData?: boolean;
655
+ executionType?: 'AUTOMATION' | 'MANUAL';
656
+ versionId?: string | undefined;
657
+ }): Promise<SavedRef>;
658
+ /** Look up the freshly-created FN's version id — STEPSTOFN's response inlines the FN but not its
659
+ * version, and the replace-in-TC step needs `fnVersionId`. Mirrors the FE
660
+ * (`create-new-fn-modal.component.ts:getFnVersion`): search `tcfnversion` by parentType=FN
661
+ * ordered by createdAt asc, take the first. */
662
+ private fetchFnVersionId;
663
+ /** Second half of extract-to-function-and-replace-in-source (FE
664
+ * `testcase.component.ts:createNewFns → onSave`): after the FN exists, PUT the source TC with the
665
+ * extracted step rows marked `deleted:true` and a synthetic FUNCTION + FUNCTION_END pair inserted
666
+ * at the first extracted position. The backend automatically:
667
+ * - drops testdata columns for params only the deleted steps referenced (allParameters skips
668
+ * `step.deleted:true` at tcfn.service.js:411)
669
+ * - injects a per-env FN cell into every TC iteration row using the FN's default iteration
670
+ * (tcfn.service.js:1032-1085) — so testdata rewiring is free.
671
+ *
672
+ * ponytail: refuses DUO / SYNCON test cases and picks that span control-flow or nested FN
673
+ * brackets. Those cases (v2) need parallel mirroring into the other execution-type array and
674
+ * bracket-aware validation — out of scope for the first pass. */
675
+ replaceStepsWithFunctionCall(tcId: string, opts: {
676
+ extractedSeqs: number[];
677
+ functionId: string;
678
+ fnVersionId: string;
679
+ fnModuleId: number;
680
+ technologyType: string;
681
+ versionId?: string | undefined;
682
+ }): Promise<SavedRef>;
683
+ /** Swap a contiguous run of a TC's steps for a call to an EXISTING function (no new function is
684
+ * created). Resolves what the replace needs from the function itself: its newest version, its module
685
+ * and — from the picked steps — the technology. Same backend effect as the FE "Save & Replace". */
686
+ replaceStepsWithExistingFunction(tcId: string, opts: {
687
+ functionId: string;
688
+ stepSeqs: number[];
689
+ versionId?: string | undefined;
690
+ }): Promise<SavedRef>;
691
+ /** One-shot extract-to-function-and-replace. Chains STEPSTOFN → fetch fn version id → replace in
692
+ * source TC. If step 2 or 3 fails after step 1 succeeded, the caller sees the fn id in the error
693
+ * so they can retry or clean up the phantom function. */
694
+ extractStepsAsFunctionAndReplace(tcId: string, opts: {
695
+ stepSeqs: number[];
696
+ name: string;
697
+ moduleId: number;
698
+ copyTestData?: boolean;
699
+ executionType?: 'AUTOMATION' | 'MANUAL';
700
+ versionId?: string | undefined;
701
+ }): Promise<SavedRef & {
702
+ fnId: string;
703
+ fnVersionId: string;
704
+ }>;
705
+ /** Soft-delete. `/tm/testcase/delete` returns HTTP 200 either way — its `data` is `true` on real
706
+ * delete, or an array of dependency records when the TC is still referenced by a defect, suite,
707
+ * execution plan, scenario, workflow, pipeline, or scheduler (nothing was deleted). Inspect the
708
+ * shape and throw so the tool surfaces it as a failure instead of a fake success. */
709
+ deleteTestCase(id: string): Promise<void>;
710
+ /** Clone a testcase in place (same project + module) with all steps, versions, testdata,
711
+ * parameters, object refs, and nested function calls carried over. Backed by the SQA native
712
+ * the FE in-editor "Save as new TC" dialog — `PUT /tm/testcase` with `operation:SAVEASNEWTC`.
713
+ * Same-project only (no cross-project copy — use the FE tree menu for that). Clones ONE
714
+ * source version. `tdCopy:true` clones the source's testdata iterations across every env;
715
+ * `tdCopy:false` copies only the column structure (one empty ITR-1 per env, values fall back
716
+ * to project-level parameter defaultValue if any). Mirrors the FE's "COPY TEST DATA" modal. */
717
+ cloneTestCase(id: string, newTitle: string, opts: {
718
+ tdCopy: boolean;
719
+ sourceVersionId?: string;
720
+ }): Promise<SavedRef>;
721
+ listFunctions(q: FunctionQuery): Promise<ListResult<FunctionSummary>>;
722
+ /** parameterId → name for the whole project, fetched once. The matcher compares parameter NAMES
723
+ * because the ids differ between a function and a recording of the same flow. */
724
+ private fnParamNames;
725
+ private parameterNameMap;
726
+ /**
727
+ * Functions whose WHOLE BODY already appears inside this test case.
728
+ *
729
+ * Matched on the identifiers a step is made of — actionId, objectId, stepType, technologyType and
730
+ * the parameter NAMES it consumes — not on display names. Candidates come from ONE query on the
731
+ * steps collection (`POST /tm/testcase/steps` filtered to type=FN), so a project with hundreds of
732
+ * functions is not walked one by one; only the shortlisted bodies are fetched and verified.
733
+ *
734
+ * Returns longest-first, non-overlapping candidates with the exact `seq`s to replace.
735
+ */
736
+ functionCandidatesFor(tcId: string, opts?: {
737
+ versionId?: string | undefined;
738
+ minConfidence?: MinConfidence | undefined;
739
+ }): Promise<FnCandidate[]>;
740
+ /** One retry for a transient backend blip (the SQA API intermittently answers GOAWAY / drops a
741
+ * connection). Used only on per-function lookups, where a miss used to silently drop a candidate. */
742
+ private retryOnce;
743
+ getFunction(id: string): Promise<QaFunction>;
744
+ /** Stamp the backend's human action name onto steps whose `actionType` is a raw numeric action id.
745
+ * Hydrated steps carry `actionType = String(actionId)` so a save round-trips exactly, but anything
746
+ * comparing a saved step to a freshly RECORDED one (which carries the display name, e.g. "Type Text")
747
+ * can never match a bare "106". Best-effort: an unavailable catalog leaves the id untouched. */
748
+ private resolveActionNames;
749
+ /** Steps for one FN version. Unlike TC docs, the FN doc from `/tm/function/:id/:projectId`
750
+ * doesn't carry a versionId inline — callers resolve the target versionId (usually the newest,
751
+ * from `fetchFunctionVersionRows`) and pass it here. */
752
+ private fetchFunctionStepsForVersion;
753
+ /** The function's version rows, newest-first. */
754
+ private fetchFunctionVersionRows;
755
+ /** Soft-delete a function. `/tm/function/delete` returns HTTP 200 either way — its `data` is
756
+ * `true` on real delete, or an array of dependency records when the FN is still referenced by a
757
+ * TC / FN / workflow (nothing was deleted). Inspect the shape and throw so the tool surfaces it
758
+ * as a failure instead of a fake success. */
759
+ deleteFunction(id: string): Promise<void>;
760
+ /** Save-as-new-function — same-project only. Mirrors FE's in-editor "Save as new function"
761
+ * dialog: `PUT /tm/function` with `operation:SAVEASNEWFN`. Clones ONE source version.
762
+ * `tdCopy:true` clones testdata; `tdCopy:false` copies structure only (empty ITR-1 per env). */
763
+ cloneFunction(id: string, newTitle: string, opts: {
764
+ tdCopy: boolean;
765
+ sourceVersionId?: string;
766
+ }): Promise<SavedRef>;
767
+ /** Snapshot the CURRENT server state of a function under a NEW version name — same FN id, new
768
+ * `tcfn_version` row with cloned steps. Mirrors `saveAsNewVersion` (see there for the shape
769
+ * rationale) with `type:'FN'` and the multipart route `PUT /tm/function` / key `functionObj`.
770
+ * Source-version resolution goes through the FN's `/tm/function/version/:id/:pid` list — the
771
+ * FN doc has no inline versionId. */
772
+ saveAsNewFunctionVersion(id: string, opts: {
773
+ versionName: string;
774
+ tdCopy?: boolean;
775
+ sourceVersionId?: string;
776
+ }): Promise<SavedRef>;
777
+ /** A story the caller named must actually link. Silently saving the test case WITHOUT its story (the old
778
+ * behaviour, on any lookup failure) left generated test cases unlinked with no hint why — so fail loudly and
779
+ * let the caller fix the reference. */
780
+ private resolveStoryNumericIdOrNull;
781
+ /** Resolve every param name referenced by the TC to a SQA parameter id via get-or-create.
782
+ * Sources: (a) `${name}` tokens in every step's description (manual + automation), and
783
+ * (b) keys of every automation step's `recordedParam` (action-argument names like
784
+ * "packageName", "activity", "keys"). Name-uniqueness is project-wide on the backend, so
785
+ * get-or-create means every TC using `${appUrl}` (or the same "packageName" recorded param)
786
+ * links to the same parameter row.
787
+ *
788
+ * A KEY THAT IS ALL DIGITS IS NOT A NAME — it is an already-bound parameter ID (a step read
789
+ * from the backend and re-added carries `recordedParam: {"7001": "sub_ln"}`). It is mapped to
790
+ * itself and NEVER get-or-created; creating a parameter literally named "7001" is how a copied
791
+ * step lost its original parameter and bound the wrong one. */
792
+ private resolveParamIds;
793
+ /** Current project's parameters by id → access type ("LOCAL" / "RUNTIME") from /tm/parameter/search.
794
+ * Best-effort: on failure the map is empty and the step keeps the access type it already declares. */
795
+ private resolveParameterAccessById;
796
+ /** POST /tm/action/search → action catalog. Cached per adapter instance: the catalog is
797
+ * customer-wide and rarely changes during a session. Keys (all pointing at the same row):
798
+ * `<lowercase name>`, `id::<n>`, `uniq::<plugin uniqueId>`, `dis::<display name>`, and
799
+ * `TECH::<lowercase name>` — the last one exists because a name like "click" is registered for
800
+ * BOTH WEB and ANDROID, and healing must never swap one technology's action for another's. */
801
+ private actionCatalogCache;
802
+ /** Populated by actionCatalog() on each fetch. Surfaced in resolveAutomationSteps error messages
803
+ * so a user hitting "no SQA action named X" can see what the fetch actually returned. */
804
+ private actionCatalogFetchDiag;
805
+ private actionCatalog;
806
+ /** Which positional argument slots of each action are Runtime (store) slots, from the backend's own action rows
807
+ * (`parameters[].runtimeParameter`). A SEPARATE, failure-tolerant fetch — the main catalog request is left exactly as
808
+ * it was, so a backend build that rejects the extra column cannot break saving. Any failure → empty map → callers
809
+ * fall back to what the step itself declares. Keyed like the catalog: `uniq::<db-17>`, `id::<n>`, lowercase name. */
810
+ private actionSlotCache;
811
+ private actionRuntimeSlots;
812
+ /** Names of a DATABASE step's recordedParam entries that are the action's Runtime (store) slot: what the step declares
813
+ * in `runtimeParameters`, plus — when the step does not say — the entries that sit in a Runtime slot of its action AND
814
+ * carry no value (a store target has none; a real input always does, so an input is never mistaken for one). */
815
+ private runtimeSlotNames;
816
+ private resolveObjectId;
817
+ /** Rewrite `from` → `to` in a step's description + objectRef.name after the backend renamed its
818
+ * object. Skips matches already followed by a `_N` suffix so a re-run never double-suffixes. */
819
+ private applyObjectRename;
820
+ /** For every automation step, resolve `actionId` (from action name + technology) and
821
+ * `objectId` (via createObjectSeq get-or-create) so the mapper can emit a valid step. Runs
822
+ * once per save, aligned by step index. */
823
+ private resolveAutomationSteps;
824
+ /** The object's own parameter data: `attrIds` = the `{{id}}` tokens in its attribute values (what the backend writes to a
825
+ * step's `objectParameterIds`), `parameterId` = the object's parameter list (merged into the step's `parameterIds`).
826
+ * Null when it cannot be read — callers then change nothing. */
827
+ private fetchObjectParams;
828
+ /** After a step's object was swapped for another, the step's object-derived parameter ids must be the NEW object's:
829
+ * `objectParameterIds` become the new object's, the new object's parameters are added, and the old object's are dropped
830
+ * unless the step still uses them (a recorded value). Leaves a step alone when the object did not change or an
831
+ * object cannot be read — it never makes things worse than before. */
832
+ private reconcileObjectParams;
833
+ /** Case-insensitive project-scoped exact-name lookup. Backend duplicate-name check uses Mongo
834
+ * collation strength:2, so a case-sensitive search here misses params stored under different
835
+ * casing — the next POST then trips "Duplicate Name Error". Returns null when not found. */
836
+ private findParameterId;
837
+ /** Case-insensitive project-scoped lookup of an existing object by `disname` (the UI's Name).
838
+ * Lets tc_draft_update pass `objectRef:{name}` for an already-defined object without also
839
+ * supplying locators — mirrors what a user picking from the Object Repository dropdown does. */
840
+ private findObjectIdByName;
841
+ private getOrCreateParameter;
842
+ createSuite(s: Suite): Promise<SavedRef>;
843
+ /** Fetch raw suite, apply add/remove/reorder ops in memory, then PUT the whole doc back with a
844
+ * STRICT allow-listed payload (the SQA update validator rejects unknown keys on both suite-level
845
+ * and testCases[] entries). */
846
+ updateSuiteMembers(id: string, ops: MemberOp[]): Promise<Suite>;
847
+ /** What deleting a suite would hit. SimplifyQA's own dry run (`isDelete:false` — it deletes nothing)
848
+ * reports schedules and pipelines; its test-plan and workflow checks never match and it never checks
849
+ * execution plans, so the MCP looks those up itself. No write is made. */
850
+ suiteDeletePreview(id: string): Promise<{
851
+ suite: SuiteRef;
852
+ blockers: SuiteBlockers;
853
+ }>;
854
+ /** Soft-delete a suite — only when nothing uses it, and proven by re-reading: SimplifyQA answers 200
855
+ * even when it skipped the suite (`isDelete:true` deletes only unblocked ids). */
856
+ deleteSuite(id: string): Promise<void>;
857
+ /** Rename / re-describe a suite: full-document PUT from a fresh read, with its updateVersion. The
858
+ * members are sent back unchanged and `tcChanged:false`, so test data is not re-saved.
859
+ * `executionType` is the suite's Execution Type (LOCAL / REMOTE / CLOUD / STACK) and maps to the
860
+ * backend's `lastSelectedExecutionType` column. */
861
+ updateSuite(id: string, patch: {
862
+ name?: string;
863
+ description?: string;
864
+ executionType?: string;
865
+ }): Promise<SavedRef>;
866
+ /** Execution settings via `PUT /tm/suites/settings/:id` — the validator's required fields from a
867
+ * fresh read, the caller's changes, and updateVersion. Fields not sent stay as they are. */
868
+ updateSuiteSettings(id: string, settings: SuiteSettings): Promise<SavedRef>;
869
+ /** Read the suite's Settings panel: the auto re-execution count / trigger, auto-defect flag and
870
+ * execution type — exactly what the UI shows, so a value can be CONFIRMED after a write or after a
871
+ * client restart (settings live in the backend, not in the session). */
872
+ getSuiteSettings(id: string): Promise<SuiteSettingsView>;
873
+ /** `POST /tm/executionplan` with exactly the fields its validator allows (unknown keys are rejected).
874
+ * The environment is given by name or key and sent as its key; an unknown one is refused. */
875
+ createExecutionPlan(input: ExecutionPlanInput): Promise<SavedRef & {
876
+ code?: string;
877
+ }>;
878
+ /** Full update (`PUT /tm/executionplan`) from a fresh read: the stored fields the validator allows,
879
+ * the caller's changes, and updateVersion. Never the partial `PUT /:id` (no version lock, and its
880
+ * privilege check is skipped without projectId). Refused while the plan is in review/approval. */
881
+ updateExecutionPlan(id: string, patch: Partial<ExecutionPlanInput>): Promise<SavedRef>;
882
+ /** What deleting a plan would do — its entry count and any schedule that runs it. No write. */
883
+ executionPlanDeletePreview(id: string): Promise<{
884
+ plan: SuiteRef;
885
+ entries: number;
886
+ schedules: SuiteRef[];
887
+ }>;
888
+ /** `PATCH /tm/executionplan {ids, projectId}` — only when no schedule runs the plan, then re-read to
889
+ * prove it is gone. SimplifyQA itself checks nothing before deleting a plan. */
890
+ deleteExecutionPlan(id: string): Promise<void>;
891
+ /** Add test cases (or every live test case of a suite) to a plan, built exactly like the SimplifyQA UI's
892
+ * source browser (source-browser.component.ts buildAddToPlanPayload): a test case is
893
+ * `sourceType:'testcase', sourceId:0`; a suite's test cases are `sourceType:'suite', sourceId, sourceName`
894
+ * with the suite row's platform and version. Everything is checked BEFORE anything is posted; a test
895
+ * case already in the plan for the same assignee is skipped, not duplicated. */
896
+ addPlanEntries(planId: string, input: PlanEntryInput): Promise<{
897
+ added: string[];
898
+ skipped: Array<{
899
+ code: string;
900
+ reason: string;
901
+ }>;
902
+ }>;
903
+ /** The plan's entries for these test cases — what removing them would delete. No write. */
904
+ planEntriesRemovePreview(planId: string, tcIds: string[]): Promise<{
905
+ plan: SuiteRef;
906
+ entries: PlanEntryRef[];
907
+ }>;
908
+ /** `PATCH /tm/execplantestcases {ids, execPlanId, executionId}` — this also deletes the entries' run
909
+ * history in SimplifyQA. SimplifyQA swallows its own errors (always 200), so the entries are re-read
910
+ * afterwards and any still present are reported, never hidden. */
911
+ removePlanEntries(planId: string, tcIds: string[]): Promise<{
912
+ removed: number;
913
+ notRemoved: string[];
914
+ }>;
915
+ /** Run a plan LOCALLY exactly as the SimplifyQA UI does (execute tab + execution-popup-modal 'PLAN'):
916
+ * find the plan's shell execution, mark it INPROGRESS, then `POST /exec/execution` with a copy of it
917
+ * (`type:'EXECUTIONPLAN'`, `childExecution`, `parentExecutionId`) whose items are the assigned,
918
+ * non-blocked AUTOMATION entries matched to the shell's items. Every refusal happens before the
919
+ * first write. `POST /tm/execplantestcases/execute` (dead code) is never used. */
920
+ startExecutionPlanRun(planId: string, opts: {
921
+ agentId?: string;
922
+ }): Promise<PlanRunRef>;
923
+ /** Every live entry of a plan (the search has no privilege check; scoped to the active project). */
924
+ private listPlanEntries;
925
+ /** A live test case of the ACTIVE project with what a plan entry requires (module, execution type). */
926
+ private readOwnTestcase;
927
+ /** A live plan of the ACTIVE project (the project-scoped GET returns nothing otherwise). With
928
+ * `writable`, also refuse a plan the SimplifyQA UI shows read-only (in review / approval). */
929
+ private readOwnPlan;
930
+ /** Environment name or key → its key, from the project's environment list. Unknown → refused. */
931
+ private environmentKey;
932
+ /** A live suite of the ACTIVE project, or a clear refusal — checked before every suite write. */
933
+ private readOwnSuite;
934
+ /** `{id, code, name}` for ids on a /search endpoint — best-effort: the ids alone if the lookup fails. */
935
+ private refsByIds;
936
+ /** A concurrency conflict becomes a plain instruction — never an automatic retry. */
937
+ private rethrowWrite;
938
+ /** A schedule — the scheduler form's body (scheduler-form.component.ts:363-388, +tz on create). TC:
939
+ * the browser as its platform; SU: one platform per technology in the suite (suitePlatform). An execution
940
+ * plan is refused: the Scheduler UI offers only test case and suite (its EP option is commented out). */
941
+ createSchedule(target: RunTarget, opts: ScheduleOptions): Promise<ScheduleRef>;
942
+ listSchedules(): Promise<ScheduleInfo[]>;
943
+ /** A live schedule of the ACTIVE project, read fresh. */
944
+ private readOwnSchedule;
945
+ /** Full-document PUT built from the allow-list (never the stored `tz`), with updateVersion. */
946
+ private putSchedule;
947
+ updateSchedule(scheduleId: string, changes: ScheduleUpdate): Promise<ScheduleRef>;
948
+ controlSchedule(scheduleId: string, action: ScheduleAction): Promise<ScheduleRef>;
949
+ /** What a delete would remove — no write. */
950
+ scheduleDeletePreview(scheduleId: string): Promise<{
951
+ id: string;
952
+ code?: string;
953
+ name?: string;
954
+ target: string;
955
+ }>;
956
+ /** `PATCH /sh/scheduler` takes a bare id array. */
957
+ deleteSchedule(scheduleId: string): Promise<void>;
958
+ /** A live test-plan folder of the ACTIVE project, read fresh. */
959
+ private readOwnTestPlan;
960
+ /** `POST /tm/scenario` — a root folder, or a sub-folder of `parentId` (which must be ours). */
961
+ createTestPlan(input: {
962
+ name: string;
963
+ parentId?: string;
964
+ }): Promise<SavedRef & {
965
+ code?: string;
966
+ }>;
967
+ /** Rename — the PUT always carries `projectId` (without it SimplifyQA upserts an orphan folder). */
968
+ renameTestPlan(id: string, name: string): Promise<SavedRef>;
969
+ /** Add suites / test cases. SimplifyQA appends without de-duplicating, so ones already in the folder
970
+ * are skipped here; nothing new → no write. Each suite / test case must be in the active project. */
971
+ addToTestPlan(id: string, input: {
972
+ suiteIds?: string[];
973
+ tcIds?: string[];
974
+ }): Promise<{
975
+ added: string[];
976
+ skipped: Array<{
977
+ code: string;
978
+ reason: string;
979
+ }>;
980
+ }>;
981
+ /** `PATCH /tm/scenario/testcase/:id` — removes ONE test case from the folder. The UI sends the
982
+ * folder's OWN entry (`selectedTc`) as a JSON STRING plus `leafNode`; anything less and SimplifyQA
983
+ * matches the wrong entry, which is why this used to be refused. The plan is re-read to confirm. */
984
+ removeTestcaseFromTestPlan(id: string, tcId: string, versionId?: string): Promise<{
985
+ removed: string;
986
+ remaining: number[];
987
+ }>;
988
+ /** `PATCH /tm/scenario/suite/:id` — removes one suite; it must be in the folder. */
989
+ removeSuiteFromTestPlan(id: string, suiteId: string): Promise<void>;
990
+ /** Delete preview: the folder and EVERY folder below it (SimplifyQA deletes recursively). No write. */
991
+ testPlanDeletePreview(id: string): Promise<{
992
+ plan: SuiteRef;
993
+ subFolders: SuiteRef[];
994
+ }>;
995
+ deleteTestPlan(id: string): Promise<void>;
996
+ /** A live pipeline of the ACTIVE project, read fresh. */
997
+ private readOwnPipeline;
998
+ /** `POST /pl/pipelines` with the validator's fields (createPipelinesValidations). Release and sprint
999
+ * are required by the backend; a suite pipeline gets one platform per technology in the suite (suitePlatform). */
1000
+ createPipeline(input: PipelineInput): Promise<SavedRef & {
1001
+ code?: string;
1002
+ }>;
1003
+ /** Full-document `PUT /pl/pipelines/:id` built from the allow-list, with updateVersion. */
1004
+ updatePipeline(id: string, patch: PipelineUpdate): Promise<SavedRef>;
1005
+ pipelineDeletePreview(id: string): Promise<SuiteRef>;
1006
+ /** `PATCH /pl/pipelines` takes a bare id array (the controller reads `req.body` as the ids). */
1007
+ deletePipeline(id: string): Promise<void>;
1008
+ /** `POST /pl/exec/start/:id` — never the broken `/pl/pipelines/pipelineExecution/:id`. */
1009
+ startPipeline(id: string): Promise<{
1010
+ runId: string;
1011
+ code?: string;
1012
+ }>;
1013
+ /** A SAFE summary of a pipeline execution. The raw record carries the execution's own access token
1014
+ * (`authkey`) and internal fields, so only these named fields are returned — never the raw doc. */
1015
+ getPipelineRun(execId: string): Promise<Record<string, unknown>>;
1016
+ stopPipelineRun(execId: string): Promise<void>;
1017
+ private fetchRawSuite;
1018
+ /** Mirrors sqa-ui `buildExecutionPlatform` (suites.component.ts:779) so MCP-added TCs save with
1019
+ * the same per-row platform the UI would set — otherwise the suite trips the "select execution
1020
+ * platform" warning at run time. Special types self-identify; WEB falls back to Chrome so
1021
+ * suite_run doesn't send `platform: []`; mobile with no bound device stays empty (UI does same). */
1022
+ private buildExecutionPlatformForEntry;
1023
+ /** Assemble the strict allow-listed suite entry for an ADD op. Required fields per the SQA
1024
+ * validator: testcaseId, code, seq (set by the caller), version, versionId, tcType. */
1025
+ private buildSuiteEntryFromTestcase;
1026
+ /** name (UPPERCASE) → objecttemplateId. Rarely changes; cached per adapter instance like
1027
+ * formulaCache. Populated from `POST /tm/objectTemplate/search` (confirmed endpoint,
1028
+ * api-endpoints.ts `object.search`'s sibling `objectTemplate.search`). */
1029
+ private objectTemplateCache;
1030
+ private objectTemplatesByName;
1031
+ private resolveObjectTemplateId;
1032
+ /** template id → TECHNOLOGY (inverse of the name map). Action catalog rows carry only
1033
+ * `objectTemplate`, so this is what scopes an action to its technology — names like "click"
1034
+ * exist for WEB and ANDROID and MUST NOT be treated as interchangeable. Best-effort: a failed
1035
+ * template fetch yields an empty map and the catalog keeps its name-only keys. */
1036
+ private objectTemplateTechById;
1037
+ /** `POST /tm/object/search` — objects visible in the current project. `q.query` free-text searches
1038
+ * `disname` — the UI's "Name" column (confirmed against the real sqa-ui Object Repository grid;
1039
+ * `description` is a separate, optional field and is NOT what users mean by an object's name). */
1040
+ searchObjects(q: ObjectQuery): Promise<QaObject[]>;
1041
+ /**
1042
+ * Create a new object — `POST /tm/object`, plain JSON (NOT multipart, unlike testcase/suite writes;
1043
+ * confirmed against the real sqa-ui ObjectService.saveNewObject). `o.objectType` is REQUIRED: it
1044
+ * resolves to the object's `objecttemplateId` — structural, and (per updateObject's contract) not
1045
+ * editable after creation. `moduleId` auto-resolves to the project's "Default Module" (matching the
1046
+ * real UI's `object.component.ts` `openForm()`, which pre-selects it for every new object) — best
1047
+ * effort, never blocks creation if no such module exists or the lookup fails.
1048
+ */
1049
+ createObject(o: QaObject): Promise<QaObject>;
1050
+ /** The current project's module literally named "Default Module" (case-insensitive) — mirrors the
1051
+ * real sqa-ui `object.component.ts` `openForm()` auto-selection. Best-effort: returns undefined
1052
+ * (never throws) when no such module exists or the lookup fails, so object creation still proceeds
1053
+ * without a module rather than being blocked by this convenience. */
1054
+ private resolveDefaultModuleId;
1055
+ /**
1056
+ * Soft-delete — `PATCH /tm/object` (NOT POST .../delete like testcase/suite; confirmed against the
1057
+ * real sqa-ui ObjectService.deleteObject), body `{ids, projectId, isDelete:true}`.
1058
+ *
1059
+ * DEPENDENCY-CHECKED first: the SAME route with `isDelete:false` is a DRY RUN that returns, per
1060
+ * object, which test cases / functions / workflows still reference it (`tcArr`/`fnArr`/`wfArr`, each
1061
+ * keyed by projectId → an array of referencing ids — mirrors the real UI's
1062
+ * deleteDependencyForObject flow, object.component.html/.ts). If anything still references it, the
1063
+ * delete is refused rather than silently breaking those test cases; only a dependency-free object
1064
+ * gets the real `isDelete:true` call.
1065
+ */
1066
+ /** `PATCH /tm/object` with `isDelete:false` — the SAME dependency-check pre-flight the real
1067
+ * product UI fires before its own delete-confirm modal (object.component.ts onClickTableDelete):
1068
+ * a read-only probe, no restore/undelete side effect. Split out from deleteObject so a caller
1069
+ * (object_delete's preview step) can show this BEFORE asking the user to confirm, not just
1070
+ * discover it as a thrown error after the fact. */
1071
+ checkObjectDependencies(id: string): Promise<{
1072
+ tcCount: number;
1073
+ fnCount: number;
1074
+ wfCount: number;
1075
+ }>;
1076
+ deleteObject(id: string): Promise<void>;
1077
+ /**
1078
+ * Update an object — `PUT /tm/object/:id`, plain JSON (NOT multipart, unlike testcase/suite writes;
1079
+ * confirmed against the real sqa-ui ObjectService.update). The backend expects the FULL document
1080
+ * back, so this reads the current one first and echoes every field it doesn't touch
1081
+ * (disname/description/objecttemplateId/parameterId/moduleId/technology/updateVersion — the
1082
+ * optimistic-concurrency token the real form also round-trips).
1083
+ *
1084
+ * `changes.locators` UPSERTS by locator name into the existing attribute list — an entry with a
1085
+ * matching name gets its value/unique updated in place, everything else on the object is left alone,
1086
+ * and a name with no existing match is appended as a new locator.
1087
+ *
1088
+ * `technology` (object type) and `objecttemplateId` are DELIBERATELY never taken from `changes` —
1089
+ * they are always echoed back from the existing doc. Both are structural (they determine which
1090
+ * attribute set is even valid for this object), so editing them here — outside the create flow — is
1091
+ * out of scope; changing them means creating a new object, not "updating" this one.
1092
+ */
1093
+ /** Edit a project-level parameter (Local <-> Runtime, default value, description). The backend validates the WHOLE body and
1094
+ * reads `paramAttributes.*` unconditionally, so this sends the complete current definition with the change applied - then
1095
+ * re-reads it and throws if the change did not take (the rule for every edit here: never report an edit that did not land). */
1096
+ updateParameter(ref: string, changes: {
1097
+ type?: 'Local' | 'Runtime';
1098
+ defaultValue?: string;
1099
+ description?: string;
1100
+ }): Promise<{
1101
+ id: string;
1102
+ name: string;
1103
+ type: string;
1104
+ defaultValue: string;
1105
+ changed: string[];
1106
+ }>;
1107
+ updateObject(id: string, changes: {
1108
+ name?: string;
1109
+ locators?: Locator[];
1110
+ description?: string;
1111
+ /** Replace the object's bound parameters by NAME (resolved via /tm/parameter/search, same
1112
+ * lookup findParameterId uses for TC steps). Unresolved names throw naming all of them and
1113
+ * the valid options, rather than silently saving a partial/empty list. */
1114
+ parameterNames?: string[];
1115
+ /** Resolve to moduleId via listModules — the caller supplies a name, never an id. */
1116
+ moduleName?: string;
1117
+ /** NAME of the locator to make the object's DEFAULT — one in `locators` or one already on the object, so an
1118
+ * existing locator can be made the default without resending its value. Throws when no locator has the name. */
1119
+ defaultLocator?: string;
1120
+ }, opts?: {
1121
+ enrichNames?: boolean;
1122
+ }): Promise<QaObject>;
1123
+ actionsCatalog(platform?: string): Promise<ActionDef[]>;
1124
+ /** Fetch the default (template) iteration row for a TC. Fills gaps from the raw TC:
1125
+ * - versionId: falls back through versionId → selectedVersionId → versionsDetails.id → versions[0].id
1126
+ * - executionType (required by the backend Mongo filter): read from raw TC, default AUTOMATION
1127
+ * - environmentType: caller value wins; else /pm/fields/8 first configured env; else 'general' */
1128
+ getDefaultIteration(q: {
1129
+ tcId: string;
1130
+ versionId?: string;
1131
+ environmentType?: string;
1132
+ includeProtected?: boolean;
1133
+ entityType?: 'TC' | 'FN' | undefined;
1134
+ }): Promise<DefaultIteration>;
1135
+ /** Persist N generated iteration rows. Rebuilds the name → paramId map from a fresh template
1136
+ * fetch — no cache, because a stale id would silently write to the wrong parameter. */
1137
+ saveGeneratedIterations(payload: SaveGeneratedIterations): Promise<SaveGeneratedIterationsResult>;
1138
+ /** The backend `testdata` definition row for a TC / FUNCTION / SUITE (the row that owns iterations). */
1139
+ private testdataDefinitionRow;
1140
+ private testdataIterationRows;
1141
+ private testdataRowsFor;
1142
+ /** Suite-level testdata read. This is a SEPARATE store from the member test cases' own testdata. */
1143
+ getSuiteTestdata(q: {
1144
+ suiteId: string;
1145
+ environmentType?: string;
1146
+ }): Promise<TestdataRows>;
1147
+ /** Copy one suite-level iteration row into a NEW row and save it at the SUITE level only.
1148
+ * Member test cases are never touched. */
1149
+ copySuiteTestdataIteration(q: {
1150
+ suiteId: string;
1151
+ environmentType: string;
1152
+ from?: string;
1153
+ name?: string;
1154
+ }): Promise<{
1155
+ iterationId: string;
1156
+ name: string;
1157
+ rows: TestdataRows;
1158
+ }>;
1159
+ /** Delete testdata iteration rows by name or id at TC / FUNCTION / SUITE level. The default row is refused. */
1160
+ deleteTestdataIterations(q: {
1161
+ entityType: 'TC' | 'FN' | 'SU';
1162
+ id: string;
1163
+ environmentType: string;
1164
+ iterations: string[];
1165
+ }): Promise<{
1166
+ deleted: string[];
1167
+ rows: TestdataRows;
1168
+ }>;
1169
+ /** Copy the default-iteration values of one TC onto another, matching parameters BY NAME. * Used by tc_automate: a manual TC converted to automated must carry the manual TC's testdata,
1170
+ * not the values that happened to be typed during the recording. Protected source values are read
1171
+ * unmasked internally so they can be copied — they are never returned to the model.
1172
+ * A source parameter with an EMPTY seed is skipped, so a value the recording generated for a
1173
+ * field the manual TC never filled is left in place. */
1174
+ copyTestdata(q: {
1175
+ fromTcId: string;
1176
+ toTcId: string;
1177
+ environmentType?: string;
1178
+ }): Promise<CopyTestdataResult>;
1179
+ /** Patch cells of a test case's DEFAULT testdata iteration by PARAMETER NAME — value and/or formula.
1180
+ * The recorder-window Save writes these itself (persistMcpTestdata); this method exists for the
1181
+ * journal-fallback save, so a recording's formulas are not lost when the window is unavailable.
1182
+ * Patches the default row ONLY (never appends an iteration — that is saveGeneratedIterations), and
1183
+ * never overwrites a formula the user already set. */
1184
+ patchTestdataCells(input: {
1185
+ tcId: string;
1186
+ cells: Array<{
1187
+ paramName: string;
1188
+ value: string;
1189
+ formulaValue?: string | undefined;
1190
+ }>;
1191
+ versionId?: string | undefined;
1192
+ environmentType?: string | undefined;
1193
+ /** Replace an EXISTING formula. Default false keeps the journal-fallback behaviour (never clobber
1194
+ * what the user set in the recorder window); tc_update_testdata passes true. */
1195
+ overwriteFormula?: boolean | undefined;
1196
+ }): Promise<{
1197
+ patched: number;
1198
+ skipped: string[];
1199
+ }>;
1200
+ /** Environment key: caller wins; else fetch the project's configured envs and pick the first;
1201
+ * else 'general' (matches the SQA UI fallback). */
1202
+ private resolveEnvironment;
1203
+ /** Parameter name + protected-flag lookup. Null when the parameter is deleted or cross-project. */
1204
+ private fetchParameterMeta;
1205
+ /** List every formula the current project can use — DEFAULT (customer-wide prefabs) unioned with
1206
+ * CUSTOM entries scoped to the customer or this project. The backend endpoint already returns the
1207
+ * union when called with `projectId`; we just normalise the doc shape and derive `scope` from
1208
+ * (type + projectId). Cached per adapter instance. */
1209
+ listFormulas(): Promise<Formula[]>;
1210
+ /** Serialises calls to the agent's formula engine: its controller keeps shared state (one plugin session and a
1211
+ * busy flag), so two concurrent requests collide (the second gets an error). */
1212
+ private formulaAgentQueue;
1213
+ /** Evaluate one formula call and return { value, expression }. The formula is evaluated by the AGENT's formula
1214
+ * engine (`POST /formula/convert`) — the engine the UI and the executor use — so every catalog formula,
1215
+ * nested expression and custom formula works, with no list of supported formulas kept here. The stored
1216
+ * `expression` is positional (`=NAME("a","b")`), exactly what the SQA UI writes and the executor re-evaluates. */
1217
+ evaluateFormula(call: FormulaCall, ctx?: {
1218
+ technologyType?: string;
1219
+ }): Promise<{
1220
+ value: string;
1221
+ expression: string;
1222
+ }>;
1223
+ /** POST the expression to the agent's `/formula/convert` (same origin as `QA_MCP_URL`). `unreachable` means no
1224
+ * usable answer from the agent (not configured / refused / timed out), as opposed to the agent answering that
1225
+ * the formula itself is wrong. */
1226
+ private evaluateViaAgent;
1227
+ /** The old evaluation path — backend `/tm/customFormula`, which only knows LEGACY_ROUTE_FORMULAS. Fallback only. */
1228
+ private evaluateViaBackendRoute;
1229
+ /** The technology of the test case / function the data is for (custom formulas need it), or undefined. */
1230
+ private formulaTechnology;
1231
+ /** Real status of a run — reads step-level results direct from SQA REST because the desktop agent's
1232
+ * get_run only returns queue state (often stale). For a SUITE run, returns per-TC rollup
1233
+ * (`children[]`) instead of step details — a suite doc's `type` field flags it. start/stop still
1234
+ * hop for v1. */
1235
+ getRun(runId: string): Promise<RunStatus>;
1236
+ private fetchExecDoc;
1237
+ private fetchStepResults;
1238
+ getSuiteChildRun(suiteRunId: string, child: {
1239
+ testcaseId: string;
1240
+ versionId?: string | undefined;
1241
+ stepId?: string | undefined;
1242
+ }): Promise<RunStatus>;
1243
+ /** Whole-execution failure analysis (executionFailures.ts) for TC-123 / SU-123 / PL-123 or one
1244
+ * named execution. */
1245
+ getExecutionFailures(input: import('./failureTypes.js').ExecutionFailureInput): Promise<import('./failureTypes.js').ExecutionFailureContext>;
1246
+ /** A failure screenshot as base64 (see executionFailures.fetchFailureImage). */
1247
+ fetchFailureImage(absoluteUrl: string, maxBytes: number): Promise<{
1248
+ data: string;
1249
+ mimeType: string;
1250
+ } | null>;
1251
+ /** The failure-analysis card + evidence text and the top causes' screenshots (failureReport.ts). */
1252
+ getFailureReport(input: import('./failureTypes.js').ExecutionFailureInput & {
1253
+ includeImages?: boolean;
1254
+ }): Promise<import('./failureReport.js').FailureReport>;
1255
+ private baseUrl;
1256
+ /** Most recent execution runId for a SUITE or TC — same `/exec/execution/search` the /reports UI's
1257
+ * current-executions view drives, filtered by `type` + the entity's numeric id, sorted id desc,
1258
+ * limit 1. `childExecution:false` + the `parentExecutionCopy nor` clause together drop suite-child
1259
+ * TC rows, so a TC lookup returns its LATEST STANDALONE run, not the child spawned inside a suite. */
1260
+ private getLatestRunFor;
1261
+ getLatestSuiteRun(suiteId: string): Promise<string | null>;
1262
+ getLatestTestcaseRun(tcId: string): Promise<string | null>;
1263
+ /** Top-N recent runs — one HTTP call, same standalone-only filters as `getLatestRunFor`. For each
1264
+ * SUITE row the exec doc's `executionItems[]` already carries per-TC status, so the tally is
1265
+ * computed inline (no extra call per run). TC rows omit the tally counters. Sorted newest-first
1266
+ * by `id` (execution ids are monotonic). Bounded — callers should cap `limit` at the tool layer
1267
+ * so a runaway request can't pull thousands of rows. */
1268
+ listRecentRuns(type: 'SUITE' | 'TC', id: string, limit: number): Promise<import('../../domain/types.js').RunSummary[]>;
1269
+ /** Targeted name lookup for a single project by numeric id — the whole-list `listProjects`
1270
+ * is paged (default 100) and API-key scoping can hide the selected project, which left
1271
+ * callers with an empty projectName. */
1272
+ private lookupProjectName;
1273
+ /** The database links a run to its release / sprint by numeric id. An empty value means "none"; a NAME must never be
1274
+ * turned into 0 (the run would silently not be linked) — say so and let the caller pass the id. */
1275
+ private idOrZero;
1276
+ startRun(target: RunTarget, opts: RunOptions): Promise<RunRef>;
1277
+ /**
1278
+ * Read the created execution back and make sure the backend stored the mode (and, for REMOTE, the
1279
+ * agent) the caller asked for. Every hop — agent `start_run`, a cached config, a backend rewrite —
1280
+ * used to be able to turn a REMOTE run into a LOCAL one silently, which only surfaced later as
1281
+ * "LOCAL-SERIAL" in the report. Fail at dispatch instead. Best-effort: a read failure (mock, older
1282
+ * backend, transient 5xx) never blocks a run that the POST already accepted.
1283
+ */
1284
+ private assertRunMode;
1285
+ stopRun(runId: string): Promise<void>;
1286
+ /** SUITE dispatch. Mirrors `startRun` above (which handles TC) — same `/exec/execution` endpoint,
1287
+ * same LOCAL-agent fast-fail, same project-name / environment resolution. What differs is on the
1288
+ * wire: `type: 'SUITE'`, `executionType` sourced from `suite.suiteType`, `mode` defaulting to
1289
+ * `suite.executionType`, a populated `globalConfiguration` block, and one `executionItems` entry
1290
+ * PER member — each carrying the suite row's persisted `versionId` / `stepId` / `platform` / `seq`
1291
+ * (NOT a re-derived random step id). See sqa-ui execution-popup-modal.component.ts:621-1105 SU
1292
+ * branch for the authoritative UI builder; every field below traces back to a line there. */
1293
+ private startSuiteRun;
1294
+ /** GET the agent /mcp with a 1s timeout. Any HTTP response (incl. 4xx from an MCP server rejecting
1295
+ * a naked GET) proves the process is up; connect/DNS/timeout errors mean it is down. Replaces
1296
+ * the customer-wide `machineRegistration` round trip when all we needed was "is LOCAL possible?". */
1297
+ probeLocalAgent(): Promise<boolean>;
1298
+ /** Live probe, never cached — every dispatch re-checks. A single 1s attempt misreported a busy-but-up
1299
+ * agent as offline (the "agent offline mid-chain" report), so: 3s per attempt, one retry, and the
1300
+ * failure reason is returned so callers can say WHY instead of a bare "not reachable". */
1301
+ probeLocalAgentDetailed(): Promise<{
1302
+ up: boolean;
1303
+ url?: string;
1304
+ reason?: string;
1305
+ }>;
1306
+ listCloudRunners(): Promise<CloudRunner[]>;
1307
+ /** Gather every identifier this process can claim: bare hostname, non-loopback MAC addresses,
1308
+ * non-loopback IPs. Cached per-adapter — network interfaces do not change mid-session. */
1309
+ private localIdsCache;
1310
+ private getLocalIdentifiers;
1311
+ /** Does a machineRegistration row belong to the machine this MCP is running on?
1312
+ * A single positive match on hostname, MAC, or IP is enough — the local agent registers with
1313
+ * ALL of these, but the surviving match on the SQA row depends on OS quirks (Windows writes a
1314
+ * padded hostname, macOS writes `foo.local`, IPs shift on Wi-Fi handoff). Any one match is
1315
+ * proof enough; we don't try to reconcile the others. */
1316
+ private isThisMachine;
1317
+ listLocalAgents(): Promise<LocalAgent[]>;
1318
+ /** Mobile devices for the project — the union of:
1319
+ * (a) the LOCAL roster from `/tm/mobileDevices/search` (adb-visible reals, emulators,
1320
+ * simulators registered via the desktop agent) — same source the UI's "Real Devices /
1321
+ * Emulators / Simulators" tabs read; `active` is a last-known connection flag stale by
1322
+ * design (the desktop agent writes it, a 7s-stale cron flips it back).
1323
+ * (b) the CLOUD roster from whichever farm the project has integrated — probed in the same
1324
+ * order as the UI (`execution-popup-modal-v2.component.ts:198-204`): LambdaTest,
1325
+ * BrowserStack, SauceLabs, SimplifyQA Device Farm. First provider that answers with a
1326
+ * non-empty list wins (matches the UI's `mobileIntergation.type` single-provider model —
1327
+ * one cloud provider per project). Cloud rows carry `deviceType:'CLOUD_DEVICE'` and a
1328
+ * `cloudDeviceType` tag so `tc_run` knows which farm to submit to.
1329
+ * A failure fetching one source doesn't kill the other — the tool logs and returns whatever
1330
+ * it could resolve. */
1331
+ listMobileDevices(platform: 'ANDROID' | 'IOS'): Promise<MobileDevice[]>;
1332
+ private fetchLocalMobileDevices;
1333
+ /** Probe cloud farms in the UI's order and return the first non-empty match. One provider per
1334
+ * project (the UI's `mobileIntergation.type` model), so no need to merge across farms. Every
1335
+ * fetch is wrapped so a 404/401 from one provider doesn't kill the whole list. */
1336
+ private fetchCloudMobileDevices;
1337
+ private fetchSauceLabsMobileDevices;
1338
+ private fetchBrowserStackMobileDevices;
1339
+ private fetchLambdaTestMobileDevices;
1340
+ private fetchDeviceFarmMobileDevices;
1341
+ /**
1342
+ * Pick THE ACTING USER'S OWN agent — never row [0] of a shared-tenant roster (which would
1343
+ * silently dispatch a local run to a teammate's box, and the run would sit queued until TTL
1344
+ * because it lands in a Redis key that no local agent on the caller's machine polls).
1345
+ *
1346
+ * SQA's `machineRegistration` row carries no owner_user_id column (unlike walnut, which matches
1347
+ * the JWT `id` claim to `owner_user_id`), so we identify "your" agent by physical identity:
1348
+ * hostname, MAC address, or IP — any one match against `os.networkInterfaces()` on the box this
1349
+ * MCP is running on. When exactly one row is "this machine", pick it regardless of the DB
1350
+ * `active` flag (that flag is stale by design — see listLocalAgents for the executionQueue bug).
1351
+ *
1352
+ * ponytail: multi-identifier heuristic. Upgrade to owner-user-id match if the backend adds that
1353
+ * column to machineRegistration (mirror walnut's `resolveLocalAgentCredential` at that point).
1354
+ */
1355
+ private resolveLocalAgentId;
1356
+ /** REMOTE dispatches to ANOTHER machine's desktop agent — must pin a specific credentialId (auto-pick
1357
+ * across machines is the exact silent-misroute this exists to prevent). Enforces:
1358
+ * (1) preferred is present, (2) it exists in the roster, (3) it is NOT this machine. A "remote" run
1359
+ * aimed at this box would execute on the same agent LOCAL uses, so its report would read REMOTE
1360
+ * while the work happened here — reject it and let the caller choose LOCAL or another machine. */
1361
+ private resolveRemoteAgentId;
1362
+ private detectExecutionOS;
1363
+ private buildRunPlatform;
1364
+ /** Direct REST — same endpoint `resolveEnvironment` uses. Works without an agent hop.
1365
+ * `key` is what testdata iterations store as `environmentType`; `id` is the uuid used by run dispatch. */
1366
+ listEnvironments(): Promise<EnvInfo[]>;
1367
+ listDatasets(tcId?: string): Promise<DatasetInfo[]>;
1368
+ private agentUnreachable;
1369
+ readJournal(tcId: string): Promise<JournalView>;
1370
+ editJournal(tcId: string, ops: JournalOp[]): Promise<JournalView>;
1371
+ private stepsView;
1372
+ /** Agent-free step edit: read the test case, apply remove / update / move by step number, renumber, and
1373
+ * save through updateTestCase (which sends removed steps back with `deleted:true`, as the UI does). */
1374
+ private editStepsDirect;
1375
+ /** `heal_propose` on the product server: replay + DOM evidence + proposals. Read-only — it never
1376
+ * writes, so a failed proposal cannot leave a half-healed test case behind. Healing is
1377
+ * browser-bound, so it needs the local agent (QA_MCP_URL), not just the REST base URL. */
1378
+ proposeHeal(input: HealProposeInput): Promise<unknown>;
1379
+ /** Everything the pure planner needs, read live (objects, actions, steps, failing iterations). */
1380
+ getHealFacts(tcId: string, opts?: {
1381
+ runId?: string | undefined;
1382
+ }): Promise<HealFacts>;
1383
+ applyHealPlan(plan: HealPlan, opts?: {
1384
+ mode?: HealApplyMode | undefined;
1385
+ }): Promise<HealReport>;
1386
+ /** Patch cells of the FAILING iterations only, via the existing test-data endpoints:
1387
+ * POST /tm/testdata/searchItr (read) → POST /tm/testdata/updateItr (write that one row). */
1388
+ private patchHealTestData;
1389
+ }
1390
+ //# sourceMappingURL=adapter.d.ts.map