@inluxc/propmaster 0.0.0-stage → 1.0.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 (444) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +696 -2
  3. package/dist/src/annotations/index.d.ts +11 -0
  4. package/dist/src/annotations/index.d.ts.map +1 -0
  5. package/dist/src/annotations/index.js +11 -0
  6. package/dist/src/annotations/index.js.map +1 -0
  7. package/dist/src/annotations/recorder.d.ts +57 -0
  8. package/dist/src/annotations/recorder.d.ts.map +1 -0
  9. package/dist/src/annotations/recorder.js +100 -0
  10. package/dist/src/annotations/recorder.js.map +1 -0
  11. package/dist/src/annotations/truncation.d.ts +34 -0
  12. package/dist/src/annotations/truncation.d.ts.map +1 -0
  13. package/dist/src/annotations/truncation.js +54 -0
  14. package/dist/src/annotations/truncation.js.map +1 -0
  15. package/dist/src/auth/apply.d.ts +15 -0
  16. package/dist/src/auth/apply.d.ts.map +1 -0
  17. package/dist/src/auth/apply.js +21 -0
  18. package/dist/src/auth/apply.js.map +1 -0
  19. package/dist/src/auth/setup.d.ts +56 -0
  20. package/dist/src/auth/setup.d.ts.map +1 -0
  21. package/dist/src/auth/setup.js +79 -0
  22. package/dist/src/auth/setup.js.map +1 -0
  23. package/dist/src/auth/state-file.d.ts +8 -0
  24. package/dist/src/auth/state-file.d.ts.map +1 -0
  25. package/dist/src/auth/state-file.js +13 -0
  26. package/dist/src/auth/state-file.js.map +1 -0
  27. package/dist/src/auth/token-manager.d.ts +61 -0
  28. package/dist/src/auth/token-manager.d.ts.map +1 -0
  29. package/dist/src/auth/token-manager.js +200 -0
  30. package/dist/src/auth/token-manager.js.map +1 -0
  31. package/dist/src/cli/banner.d.ts +23 -0
  32. package/dist/src/cli/banner.d.ts.map +1 -0
  33. package/dist/src/cli/banner.js +67 -0
  34. package/dist/src/cli/banner.js.map +1 -0
  35. package/dist/src/cli/check-tests.d.ts +143 -0
  36. package/dist/src/cli/check-tests.d.ts.map +1 -0
  37. package/dist/src/cli/check-tests.js +541 -0
  38. package/dist/src/cli/check-tests.js.map +1 -0
  39. package/dist/src/cli/coverage.d.ts +14 -0
  40. package/dist/src/cli/coverage.d.ts.map +1 -0
  41. package/dist/src/cli/coverage.js +97 -0
  42. package/dist/src/cli/coverage.js.map +1 -0
  43. package/dist/src/cli/doctor.d.ts +82 -0
  44. package/dist/src/cli/doctor.d.ts.map +1 -0
  45. package/dist/src/cli/doctor.js +656 -0
  46. package/dist/src/cli/doctor.js.map +1 -0
  47. package/dist/src/cli/env.d.ts +76 -0
  48. package/dist/src/cli/env.d.ts.map +1 -0
  49. package/dist/src/cli/env.js +344 -0
  50. package/dist/src/cli/env.js.map +1 -0
  51. package/dist/src/cli/failures.d.ts +29 -0
  52. package/dist/src/cli/failures.d.ts.map +1 -0
  53. package/dist/src/cli/failures.js +114 -0
  54. package/dist/src/cli/failures.js.map +1 -0
  55. package/dist/src/cli/fixture-catalog.d.ts +83 -0
  56. package/dist/src/cli/fixture-catalog.d.ts.map +1 -0
  57. package/dist/src/cli/fixture-catalog.js +773 -0
  58. package/dist/src/cli/fixture-catalog.js.map +1 -0
  59. package/dist/src/cli/fixture.d.ts +149 -0
  60. package/dist/src/cli/fixture.d.ts.map +1 -0
  61. package/dist/src/cli/fixture.js +742 -0
  62. package/dist/src/cli/fixture.js.map +1 -0
  63. package/dist/src/cli/flaky.d.ts +25 -0
  64. package/dist/src/cli/flaky.d.ts.map +1 -0
  65. package/dist/src/cli/flaky.js +96 -0
  66. package/dist/src/cli/flaky.js.map +1 -0
  67. package/dist/src/cli/generate.d.ts +37 -0
  68. package/dist/src/cli/generate.d.ts.map +1 -0
  69. package/dist/src/cli/generate.js +230 -0
  70. package/dist/src/cli/generate.js.map +1 -0
  71. package/dist/src/cli/init.d.ts +36 -0
  72. package/dist/src/cli/init.d.ts.map +1 -0
  73. package/dist/src/cli/init.js +1039 -0
  74. package/dist/src/cli/init.js.map +1 -0
  75. package/dist/src/cli/json-edit.d.ts +58 -0
  76. package/dist/src/cli/json-edit.d.ts.map +1 -0
  77. package/dist/src/cli/json-edit.js +250 -0
  78. package/dist/src/cli/json-edit.js.map +1 -0
  79. package/dist/src/cli/layout.d.ts +31 -0
  80. package/dist/src/cli/layout.d.ts.map +1 -0
  81. package/dist/src/cli/layout.js +175 -0
  82. package/dist/src/cli/layout.js.map +1 -0
  83. package/dist/src/cli/mcp-setup.d.ts +141 -0
  84. package/dist/src/cli/mcp-setup.d.ts.map +1 -0
  85. package/dist/src/cli/mcp-setup.js +548 -0
  86. package/dist/src/cli/mcp-setup.js.map +1 -0
  87. package/dist/src/cli/organize.d.ts +136 -0
  88. package/dist/src/cli/organize.d.ts.map +1 -0
  89. package/dist/src/cli/organize.js +467 -0
  90. package/dist/src/cli/organize.js.map +1 -0
  91. package/dist/src/cli/prompts.d.ts +102 -0
  92. package/dist/src/cli/prompts.d.ts.map +1 -0
  93. package/dist/src/cli/prompts.js +346 -0
  94. package/dist/src/cli/prompts.js.map +1 -0
  95. package/dist/src/cli/standards.d.ts +160 -0
  96. package/dist/src/cli/standards.d.ts.map +1 -0
  97. package/dist/src/cli/standards.js +389 -0
  98. package/dist/src/cli/standards.js.map +1 -0
  99. package/dist/src/cli/style.d.ts +28 -0
  100. package/dist/src/cli/style.d.ts.map +1 -0
  101. package/dist/src/cli/style.js +57 -0
  102. package/dist/src/cli/style.js.map +1 -0
  103. package/dist/src/config/env-loader.d.ts +33 -0
  104. package/dist/src/config/env-loader.d.ts.map +1 -0
  105. package/dist/src/config/env-loader.js +72 -0
  106. package/dist/src/config/env-loader.js.map +1 -0
  107. package/dist/src/config/index.d.ts +10 -0
  108. package/dist/src/config/index.d.ts.map +1 -0
  109. package/dist/src/config/index.js +10 -0
  110. package/dist/src/config/index.js.map +1 -0
  111. package/dist/src/config/loader.d.ts +66 -0
  112. package/dist/src/config/loader.d.ts.map +1 -0
  113. package/dist/src/config/loader.js +810 -0
  114. package/dist/src/config/loader.js.map +1 -0
  115. package/dist/src/config/schema.d.ts +596 -0
  116. package/dist/src/config/schema.d.ts.map +1 -0
  117. package/dist/src/config/schema.js +9 -0
  118. package/dist/src/config/schema.js.map +1 -0
  119. package/dist/src/containers/container-manager.d.ts +157 -0
  120. package/dist/src/containers/container-manager.d.ts.map +1 -0
  121. package/dist/src/containers/container-manager.js +627 -0
  122. package/dist/src/containers/container-manager.js.map +1 -0
  123. package/dist/src/coverage/code-coverage.d.ts +89 -0
  124. package/dist/src/coverage/code-coverage.d.ts.map +1 -0
  125. package/dist/src/coverage/code-coverage.js +395 -0
  126. package/dist/src/coverage/code-coverage.js.map +1 -0
  127. package/dist/src/coverage/inventory.d.ts +80 -0
  128. package/dist/src/coverage/inventory.d.ts.map +1 -0
  129. package/dist/src/coverage/inventory.js +417 -0
  130. package/dist/src/coverage/inventory.js.map +1 -0
  131. package/dist/src/coverage/languages.d.ts +34 -0
  132. package/dist/src/coverage/languages.d.ts.map +1 -0
  133. package/dist/src/coverage/languages.js +156 -0
  134. package/dist/src/coverage/languages.js.map +1 -0
  135. package/dist/src/coverage/report.d.ts +128 -0
  136. package/dist/src/coverage/report.d.ts.map +1 -0
  137. package/dist/src/coverage/report.js +472 -0
  138. package/dist/src/coverage/report.js.map +1 -0
  139. package/dist/src/errors.d.ts +164 -0
  140. package/dist/src/errors.d.ts.map +1 -0
  141. package/dist/src/errors.js +267 -0
  142. package/dist/src/errors.js.map +1 -0
  143. package/dist/src/fixtures/amqp.fixture.d.ts +163 -0
  144. package/dist/src/fixtures/amqp.fixture.d.ts.map +1 -0
  145. package/dist/src/fixtures/amqp.fixture.js +494 -0
  146. package/dist/src/fixtures/amqp.fixture.js.map +1 -0
  147. package/dist/src/fixtures/appium.fixture.d.ts +112 -0
  148. package/dist/src/fixtures/appium.fixture.d.ts.map +1 -0
  149. package/dist/src/fixtures/appium.fixture.js +309 -0
  150. package/dist/src/fixtures/appium.fixture.js.map +1 -0
  151. package/dist/src/fixtures/aws.d.ts +44 -0
  152. package/dist/src/fixtures/aws.d.ts.map +1 -0
  153. package/dist/src/fixtures/aws.js +93 -0
  154. package/dist/src/fixtures/aws.js.map +1 -0
  155. package/dist/src/fixtures/cassandra.fixture.d.ts +179 -0
  156. package/dist/src/fixtures/cassandra.fixture.d.ts.map +1 -0
  157. package/dist/src/fixtures/cassandra.fixture.js +489 -0
  158. package/dist/src/fixtures/cassandra.fixture.js.map +1 -0
  159. package/dist/src/fixtures/clickhouse.fixture.d.ts +171 -0
  160. package/dist/src/fixtures/clickhouse.fixture.d.ts.map +1 -0
  161. package/dist/src/fixtures/clickhouse.fixture.js +514 -0
  162. package/dist/src/fixtures/clickhouse.fixture.js.map +1 -0
  163. package/dist/src/fixtures/database.fixture.d.ts +63 -0
  164. package/dist/src/fixtures/database.fixture.d.ts.map +1 -0
  165. package/dist/src/fixtures/database.fixture.js +407 -0
  166. package/dist/src/fixtures/database.fixture.js.map +1 -0
  167. package/dist/src/fixtures/dynamodb.fixture.d.ts +243 -0
  168. package/dist/src/fixtures/dynamodb.fixture.d.ts.map +1 -0
  169. package/dist/src/fixtures/dynamodb.fixture.js +580 -0
  170. package/dist/src/fixtures/dynamodb.fixture.js.map +1 -0
  171. package/dist/src/fixtures/graphql.fixture.d.ts +107 -0
  172. package/dist/src/fixtures/graphql.fixture.d.ts.map +1 -0
  173. package/dist/src/fixtures/graphql.fixture.js +158 -0
  174. package/dist/src/fixtures/graphql.fixture.js.map +1 -0
  175. package/dist/src/fixtures/grpc.fixture.d.ts +167 -0
  176. package/dist/src/fixtures/grpc.fixture.d.ts.map +1 -0
  177. package/dist/src/fixtures/grpc.fixture.js +635 -0
  178. package/dist/src/fixtures/grpc.fixture.js.map +1 -0
  179. package/dist/src/fixtures/inbox.fixture.d.ts +136 -0
  180. package/dist/src/fixtures/inbox.fixture.d.ts.map +1 -0
  181. package/dist/src/fixtures/inbox.fixture.js +239 -0
  182. package/dist/src/fixtures/inbox.fixture.js.map +1 -0
  183. package/dist/src/fixtures/index.d.ts +174 -0
  184. package/dist/src/fixtures/index.d.ts.map +1 -0
  185. package/dist/src/fixtures/index.js +370 -0
  186. package/dist/src/fixtures/index.js.map +1 -0
  187. package/dist/src/fixtures/kafka-driver.d.ts +108 -0
  188. package/dist/src/fixtures/kafka-driver.d.ts.map +1 -0
  189. package/dist/src/fixtures/kafka-driver.js +113 -0
  190. package/dist/src/fixtures/kafka-driver.js.map +1 -0
  191. package/dist/src/fixtures/kafka.fixture.d.ts +75 -0
  192. package/dist/src/fixtures/kafka.fixture.d.ts.map +1 -0
  193. package/dist/src/fixtures/kafka.fixture.js +188 -0
  194. package/dist/src/fixtures/kafka.fixture.js.map +1 -0
  195. package/dist/src/fixtures/mock-server.fixture.d.ts +142 -0
  196. package/dist/src/fixtures/mock-server.fixture.d.ts.map +1 -0
  197. package/dist/src/fixtures/mock-server.fixture.js +271 -0
  198. package/dist/src/fixtures/mock-server.fixture.js.map +1 -0
  199. package/dist/src/fixtures/mongodb.fixture.d.ts +121 -0
  200. package/dist/src/fixtures/mongodb.fixture.d.ts.map +1 -0
  201. package/dist/src/fixtures/mongodb.fixture.js +258 -0
  202. package/dist/src/fixtures/mongodb.fixture.js.map +1 -0
  203. package/dist/src/fixtures/neo4j.fixture.d.ts +72 -0
  204. package/dist/src/fixtures/neo4j.fixture.d.ts.map +1 -0
  205. package/dist/src/fixtures/neo4j.fixture.js +202 -0
  206. package/dist/src/fixtures/neo4j.fixture.js.map +1 -0
  207. package/dist/src/fixtures/openapi.fixture.d.ts +101 -0
  208. package/dist/src/fixtures/openapi.fixture.d.ts.map +1 -0
  209. package/dist/src/fixtures/openapi.fixture.js +266 -0
  210. package/dist/src/fixtures/openapi.fixture.js.map +1 -0
  211. package/dist/src/fixtures/optional-package.d.ts +54 -0
  212. package/dist/src/fixtures/optional-package.d.ts.map +1 -0
  213. package/dist/src/fixtures/optional-package.js +79 -0
  214. package/dist/src/fixtures/optional-package.js.map +1 -0
  215. package/dist/src/fixtures/otp.fixture.d.ts +60 -0
  216. package/dist/src/fixtures/otp.fixture.d.ts.map +1 -0
  217. package/dist/src/fixtures/otp.fixture.js +101 -0
  218. package/dist/src/fixtures/otp.fixture.js.map +1 -0
  219. package/dist/src/fixtures/realtime.fixture.d.ts +205 -0
  220. package/dist/src/fixtures/realtime.fixture.d.ts.map +1 -0
  221. package/dist/src/fixtures/realtime.fixture.js +606 -0
  222. package/dist/src/fixtures/realtime.fixture.js.map +1 -0
  223. package/dist/src/fixtures/redis.fixture.d.ts +55 -0
  224. package/dist/src/fixtures/redis.fixture.d.ts.map +1 -0
  225. package/dist/src/fixtures/redis.fixture.js +209 -0
  226. package/dist/src/fixtures/redis.fixture.js.map +1 -0
  227. package/dist/src/fixtures/s3.fixture.d.ts +126 -0
  228. package/dist/src/fixtures/s3.fixture.d.ts.map +1 -0
  229. package/dist/src/fixtures/s3.fixture.js +296 -0
  230. package/dist/src/fixtures/s3.fixture.js.map +1 -0
  231. package/dist/src/fixtures/search.fixture.d.ts +178 -0
  232. package/dist/src/fixtures/search.fixture.d.ts.map +1 -0
  233. package/dist/src/fixtures/search.fixture.js +472 -0
  234. package/dist/src/fixtures/search.fixture.js.map +1 -0
  235. package/dist/src/fixtures/sqs.fixture.d.ts +172 -0
  236. package/dist/src/fixtures/sqs.fixture.d.ts.map +1 -0
  237. package/dist/src/fixtures/sqs.fixture.js +428 -0
  238. package/dist/src/fixtures/sqs.fixture.js.map +1 -0
  239. package/dist/src/index.d.ts +43 -0
  240. package/dist/src/index.d.ts.map +1 -0
  241. package/dist/src/index.js +48 -0
  242. package/dist/src/index.js.map +1 -0
  243. package/dist/src/mcp/guards.d.ts +21 -0
  244. package/dist/src/mcp/guards.d.ts.map +1 -0
  245. package/dist/src/mcp/guards.js +118 -0
  246. package/dist/src/mcp/guards.js.map +1 -0
  247. package/dist/src/mcp/project-tools.d.ts +14 -0
  248. package/dist/src/mcp/project-tools.d.ts.map +1 -0
  249. package/dist/src/mcp/project-tools.js +252 -0
  250. package/dist/src/mcp/project-tools.js.map +1 -0
  251. package/dist/src/mcp/protocol.d.ts +116 -0
  252. package/dist/src/mcp/protocol.d.ts.map +1 -0
  253. package/dist/src/mcp/protocol.js +199 -0
  254. package/dist/src/mcp/protocol.js.map +1 -0
  255. package/dist/src/mcp/server.d.ts +43 -0
  256. package/dist/src/mcp/server.d.ts.map +1 -0
  257. package/dist/src/mcp/server.js +244 -0
  258. package/dist/src/mcp/server.js.map +1 -0
  259. package/dist/src/mcp/test-tools.d.ts +65 -0
  260. package/dist/src/mcp/test-tools.d.ts.map +1 -0
  261. package/dist/src/mcp/test-tools.js +380 -0
  262. package/dist/src/mcp/test-tools.js.map +1 -0
  263. package/dist/src/mcp/tools.d.ts +49 -0
  264. package/dist/src/mcp/tools.d.ts.map +1 -0
  265. package/dist/src/mcp/tools.js +726 -0
  266. package/dist/src/mcp/tools.js.map +1 -0
  267. package/dist/src/network-error.d.ts +11 -0
  268. package/dist/src/network-error.d.ts.map +1 -0
  269. package/dist/src/network-error.js +34 -0
  270. package/dist/src/network-error.js.map +1 -0
  271. package/dist/src/openapi/contract.d.ts +98 -0
  272. package/dist/src/openapi/contract.d.ts.map +1 -0
  273. package/dist/src/openapi/contract.js +407 -0
  274. package/dist/src/openapi/contract.js.map +1 -0
  275. package/dist/src/openapi/generate.d.ts +89 -0
  276. package/dist/src/openapi/generate.d.ts.map +1 -0
  277. package/dist/src/openapi/generate.js +607 -0
  278. package/dist/src/openapi/generate.js.map +1 -0
  279. package/dist/src/openapi/load.d.ts +8 -0
  280. package/dist/src/openapi/load.d.ts.map +1 -0
  281. package/dist/src/openapi/load.js +26 -0
  282. package/dist/src/openapi/load.js.map +1 -0
  283. package/dist/src/package-manager.d.ts +58 -0
  284. package/dist/src/package-manager.d.ts.map +1 -0
  285. package/dist/src/package-manager.js +137 -0
  286. package/dist/src/package-manager.js.map +1 -0
  287. package/dist/src/reporter/history.d.ts +85 -0
  288. package/dist/src/reporter/history.d.ts.map +1 -0
  289. package/dist/src/reporter/history.js +147 -0
  290. package/dist/src/reporter/history.js.map +1 -0
  291. package/dist/src/reporter/index.d.ts +59 -0
  292. package/dist/src/reporter/index.d.ts.map +1 -0
  293. package/dist/src/reporter/index.js +201 -0
  294. package/dist/src/reporter/index.js.map +1 -0
  295. package/dist/src/reporter/last-run.d.ts +88 -0
  296. package/dist/src/reporter/last-run.d.ts.map +1 -0
  297. package/dist/src/reporter/last-run.js +133 -0
  298. package/dist/src/reporter/last-run.js.map +1 -0
  299. package/dist/src/reporter/quarantine.d.ts +62 -0
  300. package/dist/src/reporter/quarantine.d.ts.map +1 -0
  301. package/dist/src/reporter/quarantine.js +148 -0
  302. package/dist/src/reporter/quarantine.js.map +1 -0
  303. package/dist/src/secrets/index.d.ts +4 -0
  304. package/dist/src/secrets/index.d.ts.map +1 -0
  305. package/dist/src/secrets/index.js +3 -0
  306. package/dist/src/secrets/index.js.map +1 -0
  307. package/dist/src/secrets/provider.interface.d.ts +30 -0
  308. package/dist/src/secrets/provider.interface.d.ts.map +1 -0
  309. package/dist/src/secrets/provider.interface.js +2 -0
  310. package/dist/src/secrets/provider.interface.js.map +1 -0
  311. package/dist/src/secrets/providers/aws.provider.d.ts +33 -0
  312. package/dist/src/secrets/providers/aws.provider.d.ts.map +1 -0
  313. package/dist/src/secrets/providers/aws.provider.js +88 -0
  314. package/dist/src/secrets/providers/aws.provider.js.map +1 -0
  315. package/dist/src/secrets/providers/azure.provider.d.ts +26 -0
  316. package/dist/src/secrets/providers/azure.provider.d.ts.map +1 -0
  317. package/dist/src/secrets/providers/azure.provider.js +71 -0
  318. package/dist/src/secrets/providers/azure.provider.js.map +1 -0
  319. package/dist/src/secrets/providers/env-file.provider.d.ts +29 -0
  320. package/dist/src/secrets/providers/env-file.provider.d.ts.map +1 -0
  321. package/dist/src/secrets/providers/env-file.provider.js +56 -0
  322. package/dist/src/secrets/providers/env-file.provider.js.map +1 -0
  323. package/dist/src/secrets/providers/gitlab.provider.d.ts +26 -0
  324. package/dist/src/secrets/providers/gitlab.provider.d.ts.map +1 -0
  325. package/dist/src/secrets/providers/gitlab.provider.js +67 -0
  326. package/dist/src/secrets/providers/gitlab.provider.js.map +1 -0
  327. package/dist/src/secrets/providers/index.d.ts +52 -0
  328. package/dist/src/secrets/providers/index.d.ts.map +1 -0
  329. package/dist/src/secrets/providers/index.js +81 -0
  330. package/dist/src/secrets/providers/index.js.map +1 -0
  331. package/dist/src/secrets/providers/openbao.provider.d.ts +28 -0
  332. package/dist/src/secrets/providers/openbao.provider.d.ts.map +1 -0
  333. package/dist/src/secrets/providers/openbao.provider.js +29 -0
  334. package/dist/src/secrets/providers/openbao.provider.js.map +1 -0
  335. package/dist/src/secrets/providers/vault-compatible.d.ts +140 -0
  336. package/dist/src/secrets/providers/vault-compatible.d.ts.map +1 -0
  337. package/dist/src/secrets/providers/vault-compatible.js +405 -0
  338. package/dist/src/secrets/providers/vault-compatible.js.map +1 -0
  339. package/dist/src/secrets/providers/vault.provider.d.ts +27 -0
  340. package/dist/src/secrets/providers/vault.provider.d.ts.map +1 -0
  341. package/dist/src/secrets/providers/vault.provider.js +23 -0
  342. package/dist/src/secrets/providers/vault.provider.js.map +1 -0
  343. package/dist/src/secrets/secrets-manager.d.ts +67 -0
  344. package/dist/src/secrets/secrets-manager.d.ts.map +1 -0
  345. package/dist/src/secrets/secrets-manager.js +255 -0
  346. package/dist/src/secrets/secrets-manager.js.map +1 -0
  347. package/dist/src/steps/amqp.steps.d.ts +37 -0
  348. package/dist/src/steps/amqp.steps.d.ts.map +1 -0
  349. package/dist/src/steps/amqp.steps.js +86 -0
  350. package/dist/src/steps/amqp.steps.js.map +1 -0
  351. package/dist/src/steps/appium.steps.d.ts +53 -0
  352. package/dist/src/steps/appium.steps.d.ts.map +1 -0
  353. package/dist/src/steps/appium.steps.js +109 -0
  354. package/dist/src/steps/appium.steps.js.map +1 -0
  355. package/dist/src/steps/aws.steps.d.ts +47 -0
  356. package/dist/src/steps/aws.steps.d.ts.map +1 -0
  357. package/dist/src/steps/aws.steps.js +116 -0
  358. package/dist/src/steps/aws.steps.js.map +1 -0
  359. package/dist/src/steps/browser.steps.d.ts +54 -0
  360. package/dist/src/steps/browser.steps.d.ts.map +1 -0
  361. package/dist/src/steps/browser.steps.js +102 -0
  362. package/dist/src/steps/browser.steps.js.map +1 -0
  363. package/dist/src/steps/cassandra.steps.d.ts +32 -0
  364. package/dist/src/steps/cassandra.steps.d.ts.map +1 -0
  365. package/dist/src/steps/cassandra.steps.js +81 -0
  366. package/dist/src/steps/cassandra.steps.js.map +1 -0
  367. package/dist/src/steps/clickhouse.steps.d.ts +30 -0
  368. package/dist/src/steps/clickhouse.steps.d.ts.map +1 -0
  369. package/dist/src/steps/clickhouse.steps.js +73 -0
  370. package/dist/src/steps/clickhouse.steps.js.map +1 -0
  371. package/dist/src/steps/database.steps.d.ts +43 -0
  372. package/dist/src/steps/database.steps.d.ts.map +1 -0
  373. package/dist/src/steps/database.steps.js +79 -0
  374. package/dist/src/steps/database.steps.js.map +1 -0
  375. package/dist/src/steps/dynamodb.steps.d.ts +32 -0
  376. package/dist/src/steps/dynamodb.steps.d.ts.map +1 -0
  377. package/dist/src/steps/dynamodb.steps.js +89 -0
  378. package/dist/src/steps/dynamodb.steps.js.map +1 -0
  379. package/dist/src/steps/graphql.steps.d.ts +60 -0
  380. package/dist/src/steps/graphql.steps.d.ts.map +1 -0
  381. package/dist/src/steps/graphql.steps.js +76 -0
  382. package/dist/src/steps/graphql.steps.js.map +1 -0
  383. package/dist/src/steps/grpc.steps.d.ts +29 -0
  384. package/dist/src/steps/grpc.steps.d.ts.map +1 -0
  385. package/dist/src/steps/grpc.steps.js +68 -0
  386. package/dist/src/steps/grpc.steps.js.map +1 -0
  387. package/dist/src/steps/inbox.steps.d.ts +30 -0
  388. package/dist/src/steps/inbox.steps.d.ts.map +1 -0
  389. package/dist/src/steps/inbox.steps.js +72 -0
  390. package/dist/src/steps/inbox.steps.js.map +1 -0
  391. package/dist/src/steps/index.d.ts +43 -0
  392. package/dist/src/steps/index.d.ts.map +1 -0
  393. package/dist/src/steps/index.js +26 -0
  394. package/dist/src/steps/index.js.map +1 -0
  395. package/dist/src/steps/kafka.steps.d.ts +56 -0
  396. package/dist/src/steps/kafka.steps.d.ts.map +1 -0
  397. package/dist/src/steps/kafka.steps.js +61 -0
  398. package/dist/src/steps/kafka.steps.js.map +1 -0
  399. package/dist/src/steps/mock-server.steps.d.ts +21 -0
  400. package/dist/src/steps/mock-server.steps.d.ts.map +1 -0
  401. package/dist/src/steps/mock-server.steps.js +45 -0
  402. package/dist/src/steps/mock-server.steps.js.map +1 -0
  403. package/dist/src/steps/mongodb.steps.d.ts +107 -0
  404. package/dist/src/steps/mongodb.steps.d.ts.map +1 -0
  405. package/dist/src/steps/mongodb.steps.js +117 -0
  406. package/dist/src/steps/mongodb.steps.js.map +1 -0
  407. package/dist/src/steps/openapi.steps.d.ts +49 -0
  408. package/dist/src/steps/openapi.steps.d.ts.map +1 -0
  409. package/dist/src/steps/openapi.steps.js +113 -0
  410. package/dist/src/steps/openapi.steps.js.map +1 -0
  411. package/dist/src/steps/otp.steps.d.ts +43 -0
  412. package/dist/src/steps/otp.steps.d.ts.map +1 -0
  413. package/dist/src/steps/otp.steps.js +83 -0
  414. package/dist/src/steps/otp.steps.js.map +1 -0
  415. package/dist/src/steps/realtime.steps.d.ts +40 -0
  416. package/dist/src/steps/realtime.steps.d.ts.map +1 -0
  417. package/dist/src/steps/realtime.steps.js +116 -0
  418. package/dist/src/steps/realtime.steps.js.map +1 -0
  419. package/dist/src/steps/redis.steps.d.ts +54 -0
  420. package/dist/src/steps/redis.steps.d.ts.map +1 -0
  421. package/dist/src/steps/redis.steps.js +89 -0
  422. package/dist/src/steps/redis.steps.js.map +1 -0
  423. package/dist/src/steps/search.steps.d.ts +23 -0
  424. package/dist/src/steps/search.steps.d.ts.map +1 -0
  425. package/dist/src/steps/search.steps.js +54 -0
  426. package/dist/src/steps/search.steps.js.map +1 -0
  427. package/dist/src/test-data/factory.d.ts +82 -0
  428. package/dist/src/test-data/factory.d.ts.map +1 -0
  429. package/dist/src/test-data/factory.js +116 -0
  430. package/dist/src/test-data/factory.js.map +1 -0
  431. package/dist/src/test-data/index.d.ts +4 -0
  432. package/dist/src/test-data/index.d.ts.map +1 -0
  433. package/dist/src/test-data/index.js +4 -0
  434. package/dist/src/test-data/index.js.map +1 -0
  435. package/dist/src/test-data/registry.d.ts +37 -0
  436. package/dist/src/test-data/registry.d.ts.map +1 -0
  437. package/dist/src/test-data/registry.js +51 -0
  438. package/dist/src/test-data/registry.js.map +1 -0
  439. package/dist/src/test-data/tracking.d.ts +47 -0
  440. package/dist/src/test-data/tracking.d.ts.map +1 -0
  441. package/dist/src/test-data/tracking.js +166 -0
  442. package/dist/src/test-data/tracking.js.map +1 -0
  443. package/environments.json +263 -0
  444. package/package.json +299 -5
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Loads an OpenAPI document as a plain object, from a local JSON/YAML file or
3
+ * a URL. Used by the tooling (generator, MCP server); the fixture hands the
4
+ * spec to openapi-client-axios instead.
5
+ */
6
+ export type OpenApiDocument = Record<string, unknown>;
7
+ export declare function loadOpenApiDocument(specPath: string, root?: string): Promise<OpenApiDocument>;
8
+ //# sourceMappingURL=load.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/openapi/load.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEtD,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,GAAE,MAAsB,GAAG,OAAO,CAAC,eAAe,CAAC,CAalH"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Loads an OpenAPI document as a plain object, from a local JSON/YAML file or
3
+ * a URL. Used by the tooling (generator, MCP server); the fixture hands the
4
+ * spec to openapi-client-axios instead.
5
+ */
6
+ import { loadOptional } from '../fixtures/optional-package.js';
7
+ import { isRemoteSpec, resolveSpecDefinition } from '../fixtures/openapi.fixture.js';
8
+ export async function loadOpenApiDocument(specPath, root = process.cwd()) {
9
+ if (!isRemoteSpec(specPath))
10
+ return (await resolveSpecDefinition(specPath, root));
11
+ const response = await fetch(specPath);
12
+ if (!response.ok)
13
+ throw new Error(`Couldn't fetch the OpenAPI spec from ${specPath}: HTTP ${response.status}`);
14
+ const text = await response.text();
15
+ try {
16
+ return JSON.parse(text);
17
+ }
18
+ catch {
19
+ const yaml = await loadOptional('js-yaml', 'openApiClient (YAML specs)');
20
+ const parsed = yaml.load(text);
21
+ if (!parsed || typeof parsed !== 'object')
22
+ throw new Error(`${specPath} doesn't contain an OpenAPI document`);
23
+ return parsed;
24
+ }
25
+ }
26
+ //# sourceMappingURL=load.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load.js","sourceRoot":"","sources":["../../../src/openapi/load.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAIrF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAgB,EAAE,IAAI,GAAW,OAAO,CAAC,GAAG,EAAE;IACpF,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;QAAE,OAAO,CAAC,MAAM,qBAAqB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAA+B,CAAC;IAChH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,QAAQ,UAAU,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/G,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAoB,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACL,MAAM,IAAI,GAAG,MAAM,YAAY,CAA2B,SAAS,EAAE,4BAA4B,CAAC,CAAC;QACnG,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,sCAAsC,CAAC,CAAC;QAC9G,OAAO,MAAyB,CAAC;IACrC,CAAC;AACL,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The project's package manager (npm, pnpm, Yarn or Bun), and the commands to
3
+ * print for it: installing a driver, running a package.json script, running
4
+ * an installed tool. Commands Propmaster prints for you to run use these, so
5
+ * a Bun project is told `bun add -d pg`, not `npm install --save-dev pg`.
6
+ *
7
+ * Bun is also a runtime for the tests: `bunx --bun playwright test` runs them
8
+ * on Bun (Playwright 1.65 and Bun 1.4.3 or later), and `bunx playwright test`
9
+ * on Node.js. Older versions are warned about (bunRuntimeProblem).
10
+ */
11
+ export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun';
12
+ /** The package manager that started this process (`npm_config_user_agent`, e.g. `bun/1.3.12 ...`), if any. */
13
+ export declare function packageManagerFromAgent(env?: NodeJS.ProcessEnv): PackageManager | undefined;
14
+ /** The project's package manager, from its lock file; npm when it has none. */
15
+ export declare function packageManager(root: string): PackageManager;
16
+ /**
17
+ * For a project that's being created: its lock file when it has one, else
18
+ * the command that started this process (`bunx propmaster init` → bun).
19
+ * Only `init` asks this: anywhere else, a folder without a lock file is npm,
20
+ * however Propmaster was started.
21
+ */
22
+ export declare function packageManagerForNewProject(root: string, env?: NodeJS.ProcessEnv): PackageManager;
23
+ /**
24
+ * The folder of `name` in the project's node_modules (or a parent's), the
25
+ * way Node.js looks for it; undefined when the project doesn't have it.
26
+ * Don't ask the module resolver instead: in a folder with no node_modules,
27
+ * Bun resolves packages from its global cache (auto-install), so a package
28
+ * the project never installed would count as installed.
29
+ */
30
+ export declare function installedPackageDir(root: string, name: string): string | undefined;
31
+ /** The command that installs (as dev dependencies) or removes `packages`. */
32
+ export declare function packageCommand(pm: PackageManager, action: 'install' | 'uninstall', packages: string[]): string[];
33
+ /** The command that runs a package.json script with arguments: `npm run x -- a`, `bun run x a`, `pnpm x a`, `yarn x a`. */
34
+ export declare function scriptCommand(pm: PackageManager, script: string, args?: string[]): string[];
35
+ /** The command that runs an installed tool: `npx`, `bunx`, `pnpm exec`, `yarn`. */
36
+ export declare function execCommand(pm: PackageManager, bin: string, args?: string[]): string[];
37
+ /** Rebuilds a package whose install script didn't run. Bun skips the scripts of packages it doesn't trust: `bun pm trust` runs them and trusts the package from then on. */
38
+ export declare function rebuildCommand(pm: PackageManager, packages: string[]): string[];
39
+ /**
40
+ * `text` with its npm commands written for `pm`: `npm run x -- a` → `bun run x a`,
41
+ * `npx tool` → `bunx tool`, `npm install --save-dev p` → `bun add -d p`,
42
+ * `npm install` → `bun install`. Unchanged for npm.
43
+ */
44
+ export declare function adaptCommands(text: string, pm: PackageManager): string;
45
+ /** The oldest Bun that runs Playwright Test: the one Playwright's own CI uses. */
46
+ export declare const MIN_BUN = "1.4.3";
47
+ /** The first Playwright with a test runner that runs on Bun. */
48
+ export declare const MIN_PLAYWRIGHT_FOR_BUN = "1.65.0";
49
+ /** The Bun version this process runs on, or undefined on Node.js. */
50
+ export declare function bunVersion(): string | undefined;
51
+ /** Compares dotted versions: negative, zero or positive. Pre-release suffixes are ignored. */
52
+ export declare function compareVersions(a: string, b: string): number;
53
+ /**
54
+ * What's wrong with running Playwright Test on this Bun and Playwright, or
55
+ * undefined when both are recent enough.
56
+ */
57
+ export declare function bunRuntimeProblem(bun: string, playwright: string | undefined): string | undefined;
58
+ //# sourceMappingURL=package-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../src/package-manager.ts"],"names":[],"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E;AAChE,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAE/C,qEAAqE;AACrE,wBAAgB,UAAU,IAAI,MAAM,GAAG,SAAS,CAE/C;AAED,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAK5D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAQjG"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * The project's package manager (npm, pnpm, Yarn or Bun), and the commands to
3
+ * print for it: installing a driver, running a package.json script, running
4
+ * an installed tool. Commands Propmaster prints for you to run use these, so
5
+ * a Bun project is told `bun add -d pg`, not `npm install --save-dev pg`.
6
+ *
7
+ * Bun is also a runtime for the tests: `bunx --bun playwright test` runs them
8
+ * on Bun (Playwright 1.65 and Bun 1.4.3 or later), and `bunx playwright test`
9
+ * on Node.js. Older versions are warned about (bunRuntimeProblem).
10
+ */
11
+ import * as fs from 'node:fs';
12
+ import * as path from 'node:path';
13
+ /** Lock files, in the order they're checked. */
14
+ const LOCK_FILES = [
15
+ ['pnpm-lock.yaml', 'pnpm'],
16
+ ['yarn.lock', 'yarn'],
17
+ ['bun.lock', 'bun'],
18
+ ['bun.lockb', 'bun'],
19
+ ['package-lock.json', 'npm'],
20
+ ];
21
+ /** The package manager that started this process (`npm_config_user_agent`, e.g. `bun/1.3.12 ...`), if any. */
22
+ export function packageManagerFromAgent(env = process.env) {
23
+ const name = /^(npm|pnpm|yarn|bun)\//.exec(env.npm_config_user_agent ?? '')?.[1];
24
+ return name;
25
+ }
26
+ /** The project's package manager, from its lock file; npm when it has none. */
27
+ export function packageManager(root) {
28
+ for (const [file, pm] of LOCK_FILES)
29
+ if (fs.existsSync(path.join(root, file)))
30
+ return pm;
31
+ return 'npm';
32
+ }
33
+ /**
34
+ * For a project that's being created: its lock file when it has one, else
35
+ * the command that started this process (`bunx propmaster init` → bun).
36
+ * Only `init` asks this: anywhere else, a folder without a lock file is npm,
37
+ * however Propmaster was started.
38
+ */
39
+ export function packageManagerForNewProject(root, env = process.env) {
40
+ for (const [file, pm] of LOCK_FILES)
41
+ if (fs.existsSync(path.join(root, file)))
42
+ return pm;
43
+ return packageManagerFromAgent(env) ?? 'npm';
44
+ }
45
+ /**
46
+ * The folder of `name` in the project's node_modules (or a parent's), the
47
+ * way Node.js looks for it; undefined when the project doesn't have it.
48
+ * Don't ask the module resolver instead: in a folder with no node_modules,
49
+ * Bun resolves packages from its global cache (auto-install), so a package
50
+ * the project never installed would count as installed.
51
+ */
52
+ export function installedPackageDir(root, name) {
53
+ let dir = path.resolve(root);
54
+ for (;;) {
55
+ const candidate = path.join(dir, 'node_modules', ...name.split('/'));
56
+ if (fs.existsSync(path.join(candidate, 'package.json')))
57
+ return candidate;
58
+ const parent = path.dirname(dir);
59
+ if (parent === dir)
60
+ return undefined;
61
+ dir = parent;
62
+ }
63
+ }
64
+ /** The command that installs (as dev dependencies) or removes `packages`. */
65
+ export function packageCommand(pm, action, packages) {
66
+ const verbs = {
67
+ npm: [['install', '--save-dev'], ['uninstall']],
68
+ pnpm: [['add', '-D'], ['remove']],
69
+ yarn: [['add', '-D'], ['remove']],
70
+ bun: [['add', '-d'], ['remove']],
71
+ };
72
+ return [pm, ...verbs[pm][action === 'install' ? 0 : 1], ...packages];
73
+ }
74
+ /** The command that runs a package.json script with arguments: `npm run x -- a`, `bun run x a`, `pnpm x a`, `yarn x a`. */
75
+ export function scriptCommand(pm, script, args = []) {
76
+ if (pm === 'npm')
77
+ return ['npm', 'run', script, ...(args.length ? ['--', ...args] : [])];
78
+ if (pm === 'bun')
79
+ return ['bun', 'run', script, ...args];
80
+ return [pm, script, ...args];
81
+ }
82
+ /** The command that runs an installed tool: `npx`, `bunx`, `pnpm exec`, `yarn`. */
83
+ export function execCommand(pm, bin, args = []) {
84
+ const prefix = { npm: ['npx'], bun: ['bunx'], pnpm: ['pnpm', 'exec'], yarn: ['yarn'] };
85
+ return [...prefix[pm], bin, ...args];
86
+ }
87
+ /** Rebuilds a package whose install script didn't run. Bun skips the scripts of packages it doesn't trust: `bun pm trust` runs them and trusts the package from then on. */
88
+ export function rebuildCommand(pm, packages) {
89
+ return pm === 'bun' ? ['bun', 'pm', 'trust', ...packages] : [pm, 'rebuild', ...packages];
90
+ }
91
+ /**
92
+ * `text` with its npm commands written for `pm`: `npm run x -- a` → `bun run x a`,
93
+ * `npx tool` → `bunx tool`, `npm install --save-dev p` → `bun add -d p`,
94
+ * `npm install` → `bun install`. Unchanged for npm.
95
+ */
96
+ export function adaptCommands(text, pm) {
97
+ if (pm === 'npm')
98
+ return text;
99
+ return text
100
+ .replace(/\bnpm run ([\w:.-]+)(?: --(?= ))?/g, (_m, script) => scriptCommand(pm, script).join(' '))
101
+ .replace(/\bnpm install --save-dev\b/g, packageCommand(pm, 'install', []).join(' '))
102
+ .replace(/\bnpm install\b/g, `${pm} install`)
103
+ .replace(/\bnpx (?=[\w@])/g, `${execCommand(pm, '').join(' ').trimEnd()} `);
104
+ }
105
+ /** The oldest Bun that runs Playwright Test: the one Playwright's own CI uses. */
106
+ export const MIN_BUN = '1.4.3';
107
+ /** The first Playwright with a test runner that runs on Bun. */
108
+ export const MIN_PLAYWRIGHT_FOR_BUN = '1.65.0';
109
+ /** The Bun version this process runs on, or undefined on Node.js. */
110
+ export function bunVersion() {
111
+ return process.versions.bun;
112
+ }
113
+ /** Compares dotted versions: negative, zero or positive. Pre-release suffixes are ignored. */
114
+ export function compareVersions(a, b) {
115
+ const pa = a.split('-')[0].split('.').map((n) => parseInt(n, 10) || 0);
116
+ const pb = b.split('-')[0].split('.').map((n) => parseInt(n, 10) || 0);
117
+ for (let i = 0; i < 3; i++)
118
+ if ((pa[i] ?? 0) !== (pb[i] ?? 0))
119
+ return (pa[i] ?? 0) - (pb[i] ?? 0);
120
+ return 0;
121
+ }
122
+ /**
123
+ * What's wrong with running Playwright Test on this Bun and Playwright, or
124
+ * undefined when both are recent enough.
125
+ */
126
+ export function bunRuntimeProblem(bun, playwright) {
127
+ const problems = [];
128
+ if (compareVersions(bun, MIN_BUN) < 0)
129
+ problems.push(`Bun ${bun} is older than ${MIN_BUN}, the first version Playwright Test runs on (\`bun upgrade\`)`);
130
+ if (playwright && compareVersions(playwright, MIN_PLAYWRIGHT_FOR_BUN) < 0) {
131
+ problems.push(`@playwright/test ${playwright} doesn't run on Bun: it needs ${MIN_PLAYWRIGHT_FOR_BUN} or later`);
132
+ }
133
+ if (!problems.length)
134
+ return undefined;
135
+ return `${problems.join('; ')}. Upgrade, or run \`bunx playwright test\` without --bun to run the tests on Node.js.`;
136
+ }
137
+ //# sourceMappingURL=package-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-manager.js","sourceRoot":"","sources":["../../src/package-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,gDAAgD;AAChD,MAAM,UAAU,GAAoC;IAChD,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAC1B,CAAC,WAAW,EAAE,MAAM,CAAC;IACrB,CAAC,UAAU,EAAE,KAAK,CAAC;IACnB,CAAC,WAAW,EAAE,KAAK,CAAC;IACpB,CAAC,mBAAmB,EAAE,KAAK,CAAC;CAC/B,CAAC;AAEF,8GAA8G;AAC9G,MAAM,UAAU,uBAAuB,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;IACxE,MAAM,IAAI,GAAG,wBAAwB,CAAC,IAAI,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACjF,OAAO,IAAkC,CAAC;AAC9C,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,cAAc,CAAC,IAAY;IACvC,KAAK,MAAM,CAAC,IAA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B,WAAW,CAAC,CAAC;IACpH,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IACvC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,uFAAuF,CAAC;AACzH,CAAC"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Test history: one record per run, kept in a JSON file that CI carries from
3
+ * run to run (a cache or an artifact), and the flake ranking built from it.
4
+ *
5
+ * A test is identified by its TestCaseID, else by file and title. Its
6
+ * outcome in a run is `passed`, `flaky` (failed, then passed on a retry),
7
+ * `failed` or `skipped`.
8
+ */
9
+ export declare const DEFAULT_HISTORY_FILE = ".propmaster/test-history.json";
10
+ export declare const DEFAULT_MAX_RUNS = 100;
11
+ export type TestOutcome = 'passed' | 'flaky' | 'failed' | 'skipped';
12
+ export interface HistoryTest {
13
+ /** TestCaseID, or `file › title` for a test without one. */
14
+ id: string;
15
+ title: string;
16
+ file: string;
17
+ project: string;
18
+ outcome: TestOutcome;
19
+ /** Retries used (0 when it passed first time). */
20
+ retries: number;
21
+ /** Milliseconds, summed over every attempt. */
22
+ duration: number;
23
+ /** On the quarantine list during this run. */
24
+ quarantined?: true;
25
+ }
26
+ export interface HistoryRun {
27
+ /** Unique per run: the CI run (and job), else a random ID. */
28
+ id: string;
29
+ startedAt: string;
30
+ commit?: string;
31
+ branch?: string;
32
+ /** The run's status before quarantine: passed, failed, timedout, interrupted. */
33
+ status: string;
34
+ tests: HistoryTest[];
35
+ }
36
+ export interface HistoryFile {
37
+ version: 1;
38
+ runs: HistoryRun[];
39
+ }
40
+ /** Reads a history file; a missing or empty one is an empty history. */
41
+ export declare function readHistory(file: string): HistoryFile;
42
+ /** Adds a run and keeps the newest `maxRuns`. Writes through a temporary file, so a killed run can't leave half a file. */
43
+ export declare function appendRun(file: string, run: HistoryRun, maxRuns?: number): HistoryFile;
44
+ /** Every run in the given files and directories (their *.json files), each run once, oldest first. */
45
+ export declare function readHistories(paths: string[]): HistoryRun[];
46
+ /** Commit, branch and a run ID from the CI system's variables, else from git. */
47
+ export declare function runContext(env?: NodeJS.ProcessEnv): {
48
+ id: string;
49
+ commit?: string;
50
+ branch?: string;
51
+ };
52
+ export interface FlakyRow {
53
+ id: string;
54
+ title: string;
55
+ file: string;
56
+ projects: string[];
57
+ /** Runs in the window where it ran (not skipped). */
58
+ runs: number;
59
+ passed: number;
60
+ flaky: number;
61
+ failed: number;
62
+ /** (flaky + failed) / runs, for a test that passed at least once. */
63
+ flakeRate: number;
64
+ /** Never passed in the window: broken rather than flaky. */
65
+ alwaysFails: boolean;
66
+ /** Outcomes, oldest first: ✓ passed, ~ flaky, ✗ failed. */
67
+ recent: string;
68
+ lastUnstable?: {
69
+ startedAt: string;
70
+ commit?: string;
71
+ };
72
+ quarantined: boolean;
73
+ }
74
+ /**
75
+ * Ranks the tests of the newest `window` runs by flake rate. A test that
76
+ * passes on a retry counts as flaky; a test that fails in some runs and
77
+ * passes in others counts too. Tests that only ever passed are left out.
78
+ */
79
+ export declare function flakyReport(runs: HistoryRun[], options?: {
80
+ window?: number;
81
+ quarantined?: ReadonlySet<string>;
82
+ }): FlakyRow[];
83
+ /** The report as text: a table, newest outcomes on the right. */
84
+ export declare function formatReport(rows: FlakyRow[], runCount: number): string;
85
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/reporter/history.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,eAAO,MAAM,oBAAoB,kCAAkC,CAAC;AACpE,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEpE,MAAM,WAAW,WAAW;IACxB,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EA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E,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,WAAW,EAAE,OAAO,CAAC;IACrB,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,WAAW,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAO,GAAG,QAAQ,EAAE,CAqChI;AAED,iEAAiE;AACjE,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAcvE"}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Test history: one record per run, kept in a JSON file that CI carries from
3
+ * run to run (a cache or an artifact), and the flake ranking built from it.
4
+ *
5
+ * A test is identified by its TestCaseID, else by file and title. Its
6
+ * outcome in a run is `passed`, `flaky` (failed, then passed on a retry),
7
+ * `failed` or `skipped`.
8
+ */
9
+ import { execFileSync } from 'node:child_process';
10
+ import { randomBytes } from 'node:crypto';
11
+ import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'node:fs';
12
+ import { dirname, join } from 'node:path';
13
+ export const DEFAULT_HISTORY_FILE = '.propmaster/test-history.json';
14
+ export const DEFAULT_MAX_RUNS = 100;
15
+ /** Reads a history file; a missing or empty one is an empty history. */
16
+ export function readHistory(file) {
17
+ if (!existsSync(file))
18
+ return { version: 1, runs: [] };
19
+ const text = readFileSync(file, 'utf8').trim();
20
+ if (!text)
21
+ return { version: 1, runs: [] };
22
+ let data;
23
+ try {
24
+ data = JSON.parse(text);
25
+ }
26
+ catch (error) {
27
+ throw new Error(`${file} isn't valid JSON: ${error.message}`);
28
+ }
29
+ if (!Array.isArray(data.runs))
30
+ throw new Error(`${file} isn't a test history (no "runs" array)`);
31
+ return { version: 1, runs: data.runs };
32
+ }
33
+ /** Adds a run and keeps the newest `maxRuns`. Writes through a temporary file, so a killed run can't leave half a file. */
34
+ export function appendRun(file, run, maxRuns = DEFAULT_MAX_RUNS) {
35
+ const history = readHistory(file);
36
+ const runs = [...history.runs.filter((r) => r.id !== run.id), run]
37
+ .sort((a, b) => a.startedAt.localeCompare(b.startedAt))
38
+ .slice(-Math.max(1, maxRuns));
39
+ const next = { version: 1, runs };
40
+ mkdirSync(dirname(file), { recursive: true });
41
+ const tmp = `${file}.${process.pid}.tmp`;
42
+ writeFileSync(tmp, `${JSON.stringify(next)}\n`);
43
+ renameSync(tmp, file);
44
+ return next;
45
+ }
46
+ /** Every run in the given files and directories (their *.json files), each run once, oldest first. */
47
+ export function readHistories(paths) {
48
+ const files = paths.flatMap((p) => {
49
+ if (existsSync(p) && statSync(p).isDirectory()) {
50
+ return readdirSync(p).filter((f) => f.endsWith('.json')).map((f) => join(p, f));
51
+ }
52
+ return [p];
53
+ });
54
+ const runs = new Map();
55
+ for (const file of files)
56
+ for (const run of readHistory(file).runs)
57
+ runs.set(run.id, run);
58
+ return [...runs.values()].sort((a, b) => a.startedAt.localeCompare(b.startedAt));
59
+ }
60
+ const git = (args) => {
61
+ try {
62
+ return execFileSync('git', args, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], timeout: 2000 }).trim() || undefined;
63
+ }
64
+ catch {
65
+ return undefined;
66
+ }
67
+ };
68
+ /** Commit, branch and a run ID from the CI system's variables, else from git. */
69
+ export function runContext(env = process.env) {
70
+ const commit = env.GITHUB_SHA ?? env.CI_COMMIT_SHA ?? env.BUILD_SOURCEVERSION ?? env.CIRCLE_SHA1 ?? env.BITBUCKET_COMMIT ?? env.GIT_COMMIT ?? git(['rev-parse', 'HEAD']);
71
+ const branch = env.GITHUB_HEAD_REF || env.GITHUB_REF_NAME || env.CI_COMMIT_REF_NAME || env.CIRCLE_BRANCH || env.BITBUCKET_BRANCH
72
+ || env.BUILD_SOURCEBRANCHNAME || env.BRANCH_NAME || env.GIT_BRANCH || git(['rev-parse', '--abbrev-ref', 'HEAD']);
73
+ const ci = env.GITHUB_RUN_ID ? `github-${env.GITHUB_RUN_ID}-${env.GITHUB_RUN_ATTEMPT ?? 1}-${env.GITHUB_JOB ?? ''}`
74
+ : env.CI_JOB_ID ? `gitlab-${env.CI_JOB_ID}`
75
+ : env.BUILD_BUILDID ? `azure-${env.BUILD_BUILDID}-${env.SYSTEM_JOBID ?? ''}`
76
+ : env.CIRCLE_WORKFLOW_JOB_ID ? `circleci-${env.CIRCLE_WORKFLOW_JOB_ID}`
77
+ : env.BITBUCKET_BUILD_NUMBER ? `bitbucket-${env.BITBUCKET_BUILD_NUMBER}-${env.BITBUCKET_STEP_UUID ?? ''}`
78
+ : env.BUILD_TAG ?? undefined;
79
+ const shard = env.PW_SHARD ? `-shard${env.PW_SHARD}` : '';
80
+ return { id: `${ci ?? `local-${Date.now()}-${randomBytes(3).toString('hex')}`}${shard}`, commit, branch };
81
+ }
82
+ /**
83
+ * Ranks the tests of the newest `window` runs by flake rate. A test that
84
+ * passes on a retry counts as flaky; a test that fails in some runs and
85
+ * passes in others counts too. Tests that only ever passed are left out.
86
+ */
87
+ export function flakyReport(runs, options = {}) {
88
+ const recentRuns = runs.slice(-(options.window ?? runs.length));
89
+ const rows = new Map();
90
+ for (const run of recentRuns) {
91
+ // One mark per test per run, the worst across its projects.
92
+ const perRun = new Map();
93
+ for (const t of run.tests) {
94
+ if (t.outcome === 'skipped')
95
+ continue;
96
+ perRun.set(t.id, [...(perRun.get(t.id) ?? []), t]);
97
+ }
98
+ for (const [id, tests] of perRun) {
99
+ const row = rows.get(id) ?? {
100
+ id, title: tests[0].title, file: tests[0].file, projects: [], runs: 0, passed: 0, flaky: 0, failed: 0,
101
+ flakeRate: 0, alwaysFails: false, recent: '', quarantined: false, marks: [],
102
+ };
103
+ for (const t of tests)
104
+ if (!row.projects.includes(t.project))
105
+ row.projects.push(t.project);
106
+ const outcome = tests.some((t) => t.outcome === 'failed') ? 'failed' : tests.some((t) => t.outcome === 'flaky') ? 'flaky' : 'passed';
107
+ row.runs++;
108
+ row[outcome]++;
109
+ row.marks.push(outcome === 'passed' ? '✓' : outcome === 'flaky' ? '~' : '✗');
110
+ if (outcome !== 'passed')
111
+ row.lastUnstable = { startedAt: run.startedAt, commit: run.commit };
112
+ row.title = tests[0].title;
113
+ rows.set(id, row);
114
+ }
115
+ }
116
+ const quarantined = options.quarantined ?? new Set();
117
+ return [...rows.values()]
118
+ .map(({ marks, ...row }) => ({
119
+ ...row,
120
+ alwaysFails: row.passed + row.flaky === 0,
121
+ flakeRate: row.passed + row.flaky === 0 ? 0 : (row.flaky + row.failed) / row.runs,
122
+ recent: marks.slice(-20).join(''),
123
+ quarantined: quarantined.has(row.id),
124
+ projects: row.projects.sort(),
125
+ }))
126
+ .filter((row) => row.flaky + row.failed > 0)
127
+ .sort((a, b) => Number(a.alwaysFails) - Number(b.alwaysFails) || b.flakeRate - a.flakeRate || (b.flaky + b.failed) - (a.flaky + a.failed) || a.id.localeCompare(b.id));
128
+ }
129
+ /** The report as text: a table, newest outcomes on the right. */
130
+ export function formatReport(rows, runCount) {
131
+ if (runCount === 0)
132
+ return 'No test history yet: add the Propmaster reporter to playwright.config.ts and run the tests.';
133
+ if (rows.length === 0)
134
+ return `No flaky or failing tests in the last ${runCount} run(s).`;
135
+ const lines = rows.map((r) => {
136
+ const rate = r.alwaysFails ? 'fails' : `${Math.round(r.flakeRate * 100)}%`;
137
+ const tag = r.quarantined ? ' [quarantined]' : '';
138
+ return [rate.padStart(5), `${r.flaky}`.padStart(5), `${r.failed}`.padStart(6), `${r.runs}`.padStart(4), ` ${r.recent.padEnd(20)}`, ` ${r.id}${tag}${r.id === r.title ? '' : ` ${r.title}`}`].join(' ');
139
+ });
140
+ return [
141
+ `Flaky and failing tests, last ${runCount} run(s). Rate: runs that were flaky or failed, of the runs where it ran.`,
142
+ '',
143
+ ' Rate Flaky Failed Runs History (✓ passed, ~ flaky, ✗ failed)',
144
+ ...lines,
145
+ ].join('\n');
146
+ }
147
+ //# sourceMappingURL=history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/reporter/history.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,+BAA+B,CAAC;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAmCpC,wEAAwE;AACxE,MAAM,UAAU,WAAW,CAAC,IAAY;IACpC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IACvD,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC3C,IAAI,IAA0B,CAAC;IAC/B,IAAI,CAAC;QACD,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAyB,CAAC;IACpD,CAAC;IAAC,OAAO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C,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9M,CAAC,CAAC,CAAC;IACH,OAAO;QACH,iCAAiC,QAAQ,0EAA0E;QACnH,EAAE;QACF,iEAAiE;QACjE,GAAG,KAAK;KACX,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The Propmaster reporter: test history and quarantine.
3
+ *
4
+ * // playwright.config.ts
5
+ * reporter: [['list'], ['@inluxc/propmaster/reporter']],
6
+ *
7
+ * After every run it adds a record (each test's outcome, retries and
8
+ * duration, with the commit and branch) to `.propmaster/test-history.json`.
9
+ * Carry that file between CI runs (a cache or an artifact) and
10
+ * `npx propmaster flaky` ranks the tests by flake rate.
11
+ *
12
+ * It also writes `.propmaster/last-run.json`: the failed and flaky tests of
13
+ * that run with the step that failed, the error and the trace
14
+ * (`npx propmaster failures`, and the MCP tools run_tests and last_failures).
15
+ *
16
+ * When every failure of a run is a test listed in `quarantine.json`, it turns
17
+ * the run's status into passed, so a known-flaky test doesn't block merges.
18
+ * Quarantined tests still run and show in every report.
19
+ */
20
+ import type { FullConfig, FullResult, Reporter, Suite, TestCase, TestError } from '@playwright/test/reporter';
21
+ import { type TestOutcome } from './history.js';
22
+ export interface PropmasterReporterOptions {
23
+ /** The Bun version the run is on, undefined on Node.js (tests replace it). */
24
+ bunVersion?: () => string | undefined;
25
+ /** History file, relative to the config file (default `.propmaster/test-history.json`, or PW_TEST_HISTORY); `false` for none. */
26
+ history?: string | false;
27
+ /** Runs to keep in the history (default 100). */
28
+ maxRuns?: number;
29
+ /** Quarantine file, relative to the config file (default `quarantine.json`, or PW_QUARANTINE_FILE); `false` to ignore quarantine. */
30
+ quarantine?: string | false;
31
+ /** Last-run file (failures with their errors), relative to the config file (default `.propmaster/last-run.json`, or PW_LAST_RUN_FILE); `false` for none. */
32
+ lastRun?: string | false;
33
+ /** Write a summary of flaky and quarantined tests to the GitHub Actions job summary when it's available (default true). */
34
+ summary?: boolean;
35
+ }
36
+ /** A test's outcome in history terms. */
37
+ export declare function outcomeOf(test: Pick<TestCase, 'outcome'>): TestOutcome;
38
+ export default class PropmasterReporter implements Reporter {
39
+ private readonly options;
40
+ private config;
41
+ private suite;
42
+ private startedAt;
43
+ private errors;
44
+ private runErrors;
45
+ private quarantine;
46
+ private quarantineError;
47
+ constructor(options?: PropmasterReporterOptions);
48
+ printsToStdio(): boolean;
49
+ private get baseDir();
50
+ onBegin(config: FullConfig, suite: Suite): void;
51
+ onError(error: TestError): void;
52
+ onEnd(result: FullResult): Promise<{
53
+ status?: FullResult['status'];
54
+ } | undefined>;
55
+ private writeHistory;
56
+ private writeLastRun;
57
+ private writeSummary;
58
+ }
59
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reporter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC9G,OAAO,EAAmF,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAKjI,MAAM,WAAW,yBAAyB;IACtC,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACtC,iIAAiI;IACjI,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACzB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qIAAqI;IACrI,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,4JAA4J;IAC5J,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACzB,2HAA2H;IAC3H,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,yCAAyC;AACzC,wBAAgB,SAA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