@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,102 @@
1
+ /**
2
+ * Interactive prompts for the CLI, built on node:readline with no dependency:
3
+ * `select` (arrow keys), `multiselect` (space to toggle), `confirm` and
4
+ * `text`. Typing in a list filters it.
5
+ *
6
+ * Prompts are drawn on stderr, so a command's own output on stdout can still
7
+ * be piped (`propmaster next-id | pbcopy` asks, then prints only the ID).
8
+ *
9
+ * With no one to answer (stdin or stderr isn't a terminal, or CI is set) a
10
+ * prompt never waits: it throws NotInteractiveError naming the flag to pass
11
+ * instead. Ctrl+C or Escape throws PromptCancelledError.
12
+ */
13
+ export interface PromptInput extends NodeJS.EventEmitter {
14
+ isTTY?: boolean;
15
+ isRaw?: boolean;
16
+ setRawMode?(mode: boolean): unknown;
17
+ resume(): unknown;
18
+ pause(): unknown;
19
+ }
20
+ export interface PromptOutput {
21
+ write(chunk: string): unknown;
22
+ isTTY?: boolean;
23
+ columns?: number;
24
+ }
25
+ export interface PromptIO {
26
+ input: PromptInput;
27
+ output: PromptOutput;
28
+ env?: NodeJS.ProcessEnv;
29
+ }
30
+ /** A prompt had no one to answer it. `flag` is what to pass instead. */
31
+ export declare class NotInteractiveError extends Error {
32
+ readonly question: string;
33
+ readonly flag: string;
34
+ constructor(question: string, flag: string);
35
+ }
36
+ /** The user pressed Ctrl+C or Escape. */
37
+ export declare class PromptCancelledError extends Error {
38
+ constructor();
39
+ }
40
+ export interface Choice<T> {
41
+ value: T;
42
+ label: string;
43
+ /** Dimmed text after the label. */
44
+ hint?: string;
45
+ /** Shown but can't be picked; a string says why. */
46
+ disabled?: boolean | string;
47
+ /** More text that typing matches (the label and value always match; the hint doesn't). */
48
+ search?: string;
49
+ }
50
+ interface Common {
51
+ message: string;
52
+ /** The flag that answers this prompt, for the error when there's no terminal (e.g. `--client <name>`). */
53
+ flag: string;
54
+ }
55
+ export interface SelectOptions<T> extends Common {
56
+ choices: Choice<T>[];
57
+ /** The value the cursor starts on. */
58
+ default?: T;
59
+ /** Rows shown at once (default 10); the list scrolls. */
60
+ pageSize?: number;
61
+ }
62
+ export interface MultiselectOptions<T> extends Common {
63
+ choices: Choice<T>[];
64
+ /** Values selected to start with. */
65
+ defaults?: T[];
66
+ /** At least one must be picked (default true). */
67
+ required?: boolean;
68
+ pageSize?: number;
69
+ }
70
+ export interface ConfirmOptions extends Common {
71
+ /** What Enter answers (default false). */
72
+ default?: boolean;
73
+ }
74
+ export interface TextOptions extends Common {
75
+ /** What Enter answers with nothing typed. */
76
+ default?: string;
77
+ /** Dimmed example shown while nothing is typed. */
78
+ placeholder?: string;
79
+ /** An error message for a value that won't do, else undefined. */
80
+ validate?: (value: string) => string | undefined;
81
+ }
82
+ /** stdin for keys, stderr for drawing. */
83
+ export declare function defaultIO(): PromptIO;
84
+ /** Whether there's someone to answer a prompt: both ends are terminals and CI isn't set. */
85
+ export declare function isInteractive(io?: PromptIO): boolean;
86
+ /** `text` cut to `width` visible characters, escape codes kept. */
87
+ export declare function truncate(text: string, width: number): string;
88
+ /**
89
+ * How well `choice` matches `filter`, lower is better: 0 label starts with
90
+ * it, 1 label or value contains it, 2 only `search` does; -1 no match.
91
+ */
92
+ export declare function matchRank(filter: string, choice: Choice<unknown>): number;
93
+ /** One of `choices`, picked with the arrow keys and Enter. */
94
+ export declare function select<T>(options: SelectOptions<T>, io?: PromptIO): Promise<T>;
95
+ /** Any of `choices`: space toggles, Enter confirms. Returns values in the choices' order. */
96
+ export declare function multiselect<T>(options: MultiselectOptions<T>, io?: PromptIO): Promise<T[]>;
97
+ /** Yes or no: y, n, or Enter for the default. */
98
+ export declare function confirm(options: ConfirmOptions, io?: PromptIO): Promise<boolean>;
99
+ /** Free text, checked by `validate` on Enter. */
100
+ export declare function text(options: TextOptions, io?: PromptIO): Promise<string>;
101
+ export {};
102
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/cli/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,MAAM,WAAW,WAAY,SAAQ,MAAM,CAAC,YAAY;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACpC,MAAM,IAAI,OAAO,CAAC;IAClB,KAAK,IAAI,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IACzB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAC3B;AAED,wEAAwE;AACxE,qBAAa,mBAAoB,SAAQ,KAAK;IAEtC,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM;IAFzB,YACa,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EAIx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G,SAAS,CAAC;CACpD;AAED,0CAA0C;AAC1C,wBAAgB,SAAS,IAAI,QAAQ,CAEpC;AAMD,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,EAAE,GAAE,QAAsB,GAAG,OAAO,CAIjE;AAcD,mEAAmE;AACnE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAkB5D;AAqED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAQzE;AA4FD,8DAA8D;AAC9D,wBAAsB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,QAAsB,GAAG,OAAO,CAAC,CAAC,CAAC,CAoBjG;AAED,6FAA6F;AAC7F,wBAAsB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,QAAsB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CA0C7G;AAED,iDAAiD;AACjD,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,GAAE,QAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,CAgBnG;AAED,iDAAiD;AACjD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,GAAE,QAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+B5F"}
@@ -0,0 +1,346 @@
1
+ /**
2
+ * Interactive prompts for the CLI, built on node:readline with no dependency:
3
+ * `select` (arrow keys), `multiselect` (space to toggle), `confirm` and
4
+ * `text`. Typing in a list filters it.
5
+ *
6
+ * Prompts are drawn on stderr, so a command's own output on stdout can still
7
+ * be piped (`propmaster next-id | pbcopy` asks, then prints only the ID).
8
+ *
9
+ * With no one to answer (stdin or stderr isn't a terminal, or CI is set) a
10
+ * prompt never waits: it throws NotInteractiveError naming the flag to pass
11
+ * instead. Ctrl+C or Escape throws PromptCancelledError.
12
+ */
13
+ import * as readline from 'node:readline';
14
+ import { createStyle, colorEnabled, stripAnsi } from './style.js';
15
+ /** A prompt had no one to answer it. `flag` is what to pass instead. */
16
+ export class NotInteractiveError extends Error {
17
+ question;
18
+ flag;
19
+ constructor(question, flag) {
20
+ super(`${question}: no terminal to ask in. Pass ${flag}.`);
21
+ this.question = question;
22
+ this.flag = flag;
23
+ this.name = 'NotInteractiveError';
24
+ }
25
+ }
26
+ /** The user pressed Ctrl+C or Escape. */
27
+ export class PromptCancelledError extends Error {
28
+ constructor() {
29
+ super('Cancelled.');
30
+ this.name = 'PromptCancelledError';
31
+ }
32
+ }
33
+ /** stdin for keys, stderr for drawing. */
34
+ export function defaultIO() {
35
+ return { input: process.stdin, output: process.stderr, env: process.env };
36
+ }
37
+ function truthy(value) {
38
+ return value !== undefined && value !== '' && value !== '0' && value.toLowerCase() !== 'false';
39
+ }
40
+ /** Whether there's someone to answer a prompt: both ends are terminals and CI isn't set. */
41
+ export function isInteractive(io = defaultIO()) {
42
+ const env = io.env ?? process.env;
43
+ if (truthy(env.CI))
44
+ return false;
45
+ return io.input.isTTY === true && io.output.isTTY === true && typeof io.input.setRawMode === 'function';
46
+ }
47
+ /** `text` cut to `width` visible characters, escape codes kept. */
48
+ export function truncate(text, width) {
49
+ if (stripAnsi(text).length <= width)
50
+ return text;
51
+ let visible = 0;
52
+ let out = '';
53
+ // eslint-disable-next-line no-control-regex
54
+ const parts = text.split(/(\x1b\[[0-9;?]*[A-Za-z])/);
55
+ for (const part of parts) {
56
+ if (part.startsWith('\x1b[')) {
57
+ out += part;
58
+ continue;
59
+ }
60
+ for (const ch of part) {
61
+ if (visible >= width - 1)
62
+ return `${out}…\x1b[0m`;
63
+ out += ch;
64
+ visible++;
65
+ }
66
+ }
67
+ return out;
68
+ }
69
+ /**
70
+ * Runs one prompt: draws `render()`, feeds keys to `onKey` until it returns
71
+ * `{ done }`, then replaces the prompt with `summary(value)`.
72
+ */
73
+ function run(io, render, onKey, summary, cancelled) {
74
+ const { input, output } = io;
75
+ return new Promise((resolve, reject) => {
76
+ let lines = 0;
77
+ const width = () => Math.max(20, (output.columns || 80) - 1);
78
+ const draw = (rows) => {
79
+ const up = lines > 0 ? `\x1b[${lines}A` : '';
80
+ output.write(`${up}\r\x1b[0J${rows.map((r) => truncate(r, width())).join('\n')}\n`);
81
+ lines = rows.length;
82
+ };
83
+ const wasRaw = input.isRaw === true;
84
+ const finish = () => {
85
+ input.removeListener('keypress', handler);
86
+ input.setRawMode?.(wasRaw);
87
+ input.pause();
88
+ output.write('\x1b[?25h');
89
+ };
90
+ const handler = (str, key = {}) => {
91
+ if ((key.ctrl && key.name === 'c') || key.name === 'escape') {
92
+ draw([cancelled]);
93
+ finish();
94
+ reject(new PromptCancelledError());
95
+ return;
96
+ }
97
+ let step;
98
+ try {
99
+ step = onKey(str, key);
100
+ }
101
+ catch (error) {
102
+ finish();
103
+ reject(error);
104
+ return;
105
+ }
106
+ if (step) {
107
+ draw([summary(step.done)]);
108
+ finish();
109
+ resolve(step.done);
110
+ }
111
+ else {
112
+ draw(render());
113
+ }
114
+ };
115
+ readline.emitKeypressEvents(input);
116
+ input.setRawMode?.(true);
117
+ input.on('keypress', handler);
118
+ input.resume();
119
+ output.write('\x1b[?25l');
120
+ draw(render());
121
+ });
122
+ }
123
+ function styleOf(io) {
124
+ return createStyle(colorEnabled(io.output, io.env ?? process.env));
125
+ }
126
+ function printable(str, key) {
127
+ return str !== undefined && str.length === 1 && !key.ctrl && !key.meta && str >= ' ' && str !== '\x7f';
128
+ }
129
+ /**
130
+ * How well `choice` matches `filter`, lower is better: 0 label starts with
131
+ * it, 1 label or value contains it, 2 only `search` does; -1 no match.
132
+ */
133
+ export function matchRank(filter, choice) {
134
+ if (filter === '')
135
+ return 0;
136
+ const f = filter.toLowerCase();
137
+ const label = choice.label.toLowerCase();
138
+ if (label.startsWith(f))
139
+ return 0;
140
+ if (label.includes(f) || String(choice.value).toLowerCase().includes(f))
141
+ return 1;
142
+ if (choice.search?.toLowerCase().includes(f))
143
+ return 2;
144
+ return -1;
145
+ }
146
+ /** A scrolling, filterable list shared by select and multiselect. */
147
+ class ListState {
148
+ choices;
149
+ pageSize;
150
+ filter = '';
151
+ cursor = 0;
152
+ offset = 0;
153
+ constructor(choices, pageSize, start) {
154
+ this.choices = choices;
155
+ this.pageSize = pageSize;
156
+ this.cursor = Math.max(0, start);
157
+ this.scroll();
158
+ }
159
+ /** The choices matching the filter, best matches first (stable within a rank). */
160
+ get visible() {
161
+ if (!this.filter)
162
+ return this.choices;
163
+ return this.choices
164
+ .map((choice) => ({ choice, rank: matchRank(this.filter, choice) }))
165
+ .filter((m) => m.rank >= 0)
166
+ .sort((a, b) => a.rank - b.rank)
167
+ .map((m) => m.choice);
168
+ }
169
+ get current() {
170
+ return this.visible[this.cursor];
171
+ }
172
+ /** Handles movement and filtering; true when the key was used. */
173
+ key(str, key, typing) {
174
+ const count = this.visible.length;
175
+ if (key.name === 'up')
176
+ this.cursor = count ? (this.cursor - 1 + count) % count : 0;
177
+ else if (key.name === 'down' || (key.name === 'tab' && !key.shift))
178
+ this.cursor = count ? (this.cursor + 1) % count : 0;
179
+ else if (key.name === 'home')
180
+ this.cursor = 0;
181
+ else if (key.name === 'end')
182
+ this.cursor = Math.max(0, count - 1);
183
+ else if (key.name === 'pageup')
184
+ this.cursor = Math.max(0, this.cursor - this.pageSize);
185
+ else if (key.name === 'pagedown')
186
+ this.cursor = Math.min(Math.max(0, count - 1), this.cursor + this.pageSize);
187
+ else if (key.name === 'backspace' && this.filter)
188
+ this.setFilter(this.filter.slice(0, -1));
189
+ else if (typing && printable(str, key))
190
+ this.setFilter(this.filter + str);
191
+ else
192
+ return false;
193
+ this.scroll();
194
+ return true;
195
+ }
196
+ setFilter(filter) {
197
+ this.filter = filter;
198
+ this.cursor = 0;
199
+ this.offset = 0;
200
+ }
201
+ scroll() {
202
+ if (this.cursor < this.offset)
203
+ this.offset = this.cursor;
204
+ if (this.cursor >= this.offset + this.pageSize)
205
+ this.offset = this.cursor - this.pageSize + 1;
206
+ }
207
+ rows(s, mark) {
208
+ const visible = this.visible;
209
+ if (!visible.length)
210
+ return [s.dim(` no match for "${this.filter}"`)];
211
+ const page = visible.slice(this.offset, this.offset + this.pageSize);
212
+ const rows = page.map((choice, i) => {
213
+ const current = this.offset + i === this.cursor;
214
+ const pointer = current ? s.cyan('❯') : ' ';
215
+ const why = typeof choice.disabled === 'string' ? ` (${choice.disabled})` : '';
216
+ const label = choice.disabled ? s.dim(`${choice.label}${why}`) : current ? s.cyan(choice.label) : choice.label;
217
+ const hint = choice.hint ? ` ${s.dim(choice.hint)}` : '';
218
+ return `${pointer} ${mark(choice, current)}${label}${hint}`;
219
+ });
220
+ const above = this.offset;
221
+ const below = visible.length - this.offset - page.length;
222
+ if (above > 0)
223
+ rows.unshift(s.dim(` ↑ ${above} more`));
224
+ if (below > 0)
225
+ rows.push(s.dim(` ↓ ${below} more`));
226
+ return rows;
227
+ }
228
+ }
229
+ function header(s, message, extra) {
230
+ return `${s.cyan('?')} ${s.bold(message)} ${extra}`;
231
+ }
232
+ function done(s, message, answer) {
233
+ return `${s.green('✔')} ${s.bold(message)} ${answer}`;
234
+ }
235
+ function cancelLine(s, message) {
236
+ return `${s.red('✖')} ${s.bold(message)} ${s.dim('cancelled')}`;
237
+ }
238
+ // ─── Prompts ────────────────────────────────────────────────────────────────
239
+ /** One of `choices`, picked with the arrow keys and Enter. */
240
+ export async function select(options, io = defaultIO()) {
241
+ if (!options.choices.length)
242
+ throw new Error(`select "${options.message}": no choices`);
243
+ if (!isInteractive(io))
244
+ throw new NotInteractiveError(options.message, options.flag);
245
+ const s = styleOf(io);
246
+ const start = options.default === undefined ? 0 : options.choices.findIndex((c) => c.value === options.default);
247
+ const list = new ListState(options.choices, options.pageSize ?? 10, start);
248
+ return run(io, () => [header(s, options.message, list.filter ? s.cyan(list.filter) : s.dim('↑/↓ move · enter pick · type to filter')), ...list.rows(s, () => '')], (str, key) => {
249
+ if (key.name === 'return' || key.name === 'enter') {
250
+ const choice = list.current;
251
+ return choice && !choice.disabled ? { done: choice } : undefined;
252
+ }
253
+ list.key(str, key, true);
254
+ return undefined;
255
+ }, (choice) => done(s, options.message, s.cyan(choice.label)), cancelLine(s, options.message)).then((choice) => choice.value);
256
+ }
257
+ /** Any of `choices`: space toggles, Enter confirms. Returns values in the choices' order. */
258
+ export async function multiselect(options, io = defaultIO()) {
259
+ if (!options.choices.length)
260
+ throw new Error(`multiselect "${options.message}": no choices`);
261
+ if (!isInteractive(io))
262
+ throw new NotInteractiveError(options.message, options.flag);
263
+ const s = styleOf(io);
264
+ const required = options.required ?? true;
265
+ const picked = new Set(options.defaults ?? []);
266
+ const list = new ListState(options.choices, options.pageSize ?? 10, 0);
267
+ let error = '';
268
+ return run(io, () => [
269
+ header(s, options.message, list.filter ? s.cyan(list.filter) : s.dim('space select · enter confirm · type to filter')),
270
+ ...list.rows(s, (choice) => (picked.has(choice.value) ? s.green('◉ ') : s.dim('◯ '))),
271
+ ...(error ? [s.red(` ✖ ${error}`)] : []),
272
+ ], (str, key) => {
273
+ error = '';
274
+ if (key.name === 'return' || key.name === 'enter') {
275
+ const values = options.choices.filter((c) => picked.has(c.value)).map((c) => c.value);
276
+ if (required && !values.length) {
277
+ error = 'Pick at least one (space selects).';
278
+ return undefined;
279
+ }
280
+ return { done: values };
281
+ }
282
+ if (key.name === 'space') {
283
+ const choice = list.current;
284
+ if (choice && !choice.disabled) {
285
+ if (picked.has(choice.value))
286
+ picked.delete(choice.value);
287
+ else
288
+ picked.add(choice.value);
289
+ }
290
+ return undefined;
291
+ }
292
+ list.key(str, key, true);
293
+ return undefined;
294
+ }, (values) => {
295
+ const labels = options.choices.filter((c) => values.includes(c.value)).map((c) => c.label);
296
+ return done(s, options.message, labels.length ? s.cyan(labels.join(', ')) : s.dim('none'));
297
+ }, cancelLine(s, options.message));
298
+ }
299
+ /** Yes or no: y, n, or Enter for the default. */
300
+ export async function confirm(options, io = defaultIO()) {
301
+ if (!isInteractive(io))
302
+ throw new NotInteractiveError(options.message, options.flag);
303
+ const s = styleOf(io);
304
+ const fallback = options.default ?? false;
305
+ return run(io, () => [header(s, options.message, s.dim(fallback ? '(Y/n)' : '(y/N)'))], (str, key) => {
306
+ if (key.name === 'return' || key.name === 'enter')
307
+ return { done: fallback };
308
+ if (str?.toLowerCase() === 'y')
309
+ return { done: true };
310
+ if (str?.toLowerCase() === 'n')
311
+ return { done: false };
312
+ return undefined;
313
+ }, (value) => done(s, options.message, s.cyan(value ? 'Yes' : 'No')), cancelLine(s, options.message));
314
+ }
315
+ /** Free text, checked by `validate` on Enter. */
316
+ export async function text(options, io = defaultIO()) {
317
+ if (!isInteractive(io))
318
+ throw new NotInteractiveError(options.message, options.flag);
319
+ const s = styleOf(io);
320
+ let value = '';
321
+ let error = '';
322
+ return run(io, () => {
323
+ const shown = value ? s.cyan(value) : s.dim(options.placeholder ?? '');
324
+ const fallback = options.default !== undefined && !value ? s.dim(` (${options.default})`) : '';
325
+ return [`${header(s, options.message, '›')} ${shown}${s.cyan('▌')}${fallback}`, ...(error ? [s.red(` ✖ ${error}`)] : [])];
326
+ }, (str, key) => {
327
+ if (key.name === 'return' || key.name === 'enter') {
328
+ const answer = value === '' && options.default !== undefined ? options.default : value;
329
+ const problem = options.validate?.(answer);
330
+ if (problem) {
331
+ error = problem;
332
+ return undefined;
333
+ }
334
+ return { done: answer };
335
+ }
336
+ error = '';
337
+ if (key.name === 'backspace')
338
+ value = value.slice(0, -1);
339
+ else if (key.ctrl && key.name === 'u')
340
+ value = '';
341
+ else if (printable(str, key))
342
+ value += str;
343
+ return undefined;
344
+ }, (answer) => done(s, options.message, answer ? s.cyan(answer) : s.dim('(empty)')), cancelLine(s, options.message));
345
+ }
346
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/cli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AAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG;YAAE,KAAK,GAAG,EAAE,CAAC;aAC7C,IAAI,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC;YAAE,KAAK,IAAI,GAAG,CAAC;QAC3C,OAAO,SAAS,CAAC;IACrB,CAAC,EACD,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAChF,UAAU,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CACjC,CAAC;AACN,CAAC"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * QA standards: a team's own testing rules, in two halves.
3
+ *
4
+ * - Pages: Markdown files in `standards/`, written by the team. The MCP server
5
+ * hands them to agents (the `standards` tool and `standards://` resources),
6
+ * so they are read before tests are written.
7
+ * - Rules: `propmaster.standards.json`, checked by `propmaster check` (and so
8
+ * `lint:tests`, `check_tests` and doctor) as `standard:<id>` violations.
9
+ * Each rule is an error or a warning and can point at the page that
10
+ * explains it.
11
+ */
12
+ import type { FoundTest, Violation } from './check-tests.js';
13
+ export declare const STANDARDS_FILE = "propmaster.standards.json";
14
+ export declare const DEFAULT_PAGES_DIR = "standards";
15
+ export declare const RULE_TYPES: readonly ['required-tag', 'title-pattern', 'describe-pattern', 'banned-call', 'banned-pattern', 'max-steps', 'min-steps', 'requirements-doc'];
16
+ export type RuleType = (typeof RULE_TYPES)[number];
17
+ export interface StandardRule {
18
+ /** Short kebab-case name: violations are reported as `standard:<id>`. */
19
+ id: string;
20
+ type: RuleType;
21
+ /** `error` (default) fails the check; `warn` is reported only. */
22
+ level?: 'error' | 'warn';
23
+ /** The page that explains the rule, relative to the pages folder (`tagging.md`, `tagging.md#owners`). */
24
+ page?: string;
25
+ /** Replaces the default message. */
26
+ message?: string;
27
+ /** Only test files under these paths (e.g. `tests/e2e/`). Default: every test file. */
28
+ files?: string[];
29
+ /** Not test files under these paths. */
30
+ exclude?: string[];
31
+ /** required-tag: a tag on the test or its describe must match. title-pattern / describe-pattern / banned-pattern: the text to match. A RegExp source. */
32
+ pattern?: string;
33
+ /** required-tag: an example shown in the message, e.g. `@owner-payments`. */
34
+ example?: string;
35
+ /** banned-call: calls not allowed, e.g. `page.waitForTimeout`, `test.only`. */
36
+ calls?: string[];
37
+ /** max-steps / min-steps. */
38
+ max?: number;
39
+ min?: number;
40
+ }
41
+ export interface Standards {
42
+ /** The pages folder, relative to the project root. */
43
+ pages: string;
44
+ rules: StandardRule[];
45
+ }
46
+ export interface LoadedStandards {
47
+ standards: Standards | null;
48
+ /** Problems with the file itself: each fails the check. */
49
+ problems: string[];
50
+ }
51
+ /** Loads and validates `propmaster.standards.json`. No file: `standards: null`, no problems. */
52
+ export declare function loadStandards(root: string): LoadedStandards;
53
+ /** Checks a parsed standards file. `root`, when given, is used to check that pages exist. */
54
+ export declare function validateStandards(raw: unknown, root?: string): LoadedStandards;
55
+ /** Source with comments and string contents blanked out (same length, newlines kept), so code searches skip them. */
56
+ export declare function maskNonCode(src: string, skipNonCode: (src: string, i: number) => number): string;
57
+ export interface FoundDescribe {
58
+ index: number;
59
+ title: string;
60
+ options: string | null;
61
+ /** The span of its argument list: tests inside it are between these offsets. */
62
+ open: number;
63
+ close: number;
64
+ }
65
+ /** Tags in an options argument (`{ tag: ['@a', '@b'] }` or `{ tag: '@a' }`) and in a title. */
66
+ export declare function tagsOf(options: string | null, title: string): string[];
67
+ /** The `/** ... *\/` comment right before `index`, if any. */
68
+ export declare function precedingDoc(src: string, index: number): string | null;
69
+ export interface StandardsInput {
70
+ file: string;
71
+ src: string;
72
+ tests: FoundTest[];
73
+ describes: FoundDescribe[];
74
+ lineOf: (index: number) => number;
75
+ masked: string;
76
+ }
77
+ /** Checks one test file against the rules. Returns errors and warnings. */
78
+ export declare function checkStandards(standards: Standards, input: StandardsInput): {
79
+ errors: Violation[];
80
+ warnings: Violation[];
81
+ };
82
+ export interface StandardsPage {
83
+ /** File name in the pages folder, e.g. `tagging.md`. */
84
+ file: string;
85
+ /** Its first `# heading`, else the file name. */
86
+ title: string;
87
+ /** Its first paragraph. */
88
+ summary: string;
89
+ }
90
+ /** The pages in the standards folder (`.md` files, sorted, README first). */
91
+ export declare function listPages(root: string, folder?: string): StandardsPage[];
92
+ /** A page's text, or undefined when there's no such page. Only files directly in the pages folder. */
93
+ export declare function readPage(root: string, file: string, folder?: string): string | undefined;
94
+ export declare const SAMPLE_STANDARDS: {
95
+ pages: string;
96
+ rules: ({
97
+ id: string;
98
+ type: "required-tag";
99
+ pattern: string;
100
+ example: string;
101
+ page: string;
102
+ calls?: undefined;
103
+ max?: undefined;
104
+ level?: undefined;
105
+ } | {
106
+ id: string;
107
+ type: "required-tag";
108
+ pattern: string;
109
+ example: string;
110
+ level: "warn";
111
+ page: string;
112
+ calls?: undefined;
113
+ max?: undefined;
114
+ } | {
115
+ example?: undefined;
116
+ id: string;
117
+ type: "title-pattern";
118
+ pattern: string;
119
+ level: "warn";
120
+ page: string;
121
+ calls?: undefined;
122
+ max?: undefined;
123
+ } | {
124
+ example?: undefined;
125
+ pattern?: undefined;
126
+ id: string;
127
+ type: "banned-call";
128
+ calls: string[];
129
+ page: string;
130
+ max?: undefined;
131
+ level?: undefined;
132
+ } | {
133
+ example?: undefined;
134
+ pattern?: undefined;
135
+ calls?: undefined;
136
+ id: string;
137
+ type: "max-steps";
138
+ max: number;
139
+ level: "warn";
140
+ page: string;
141
+ } | {
142
+ example?: undefined;
143
+ pattern?: undefined;
144
+ calls?: undefined;
145
+ max?: undefined;
146
+ id: string;
147
+ type: "requirements-doc";
148
+ level: "warn";
149
+ page: string;
150
+ })[];
151
+ };
152
+ export declare const SAMPLE_PAGES: Record<string, string>;
153
+ /** Writes the sample standards file and pages. Never overwrites; returns what was written and what already existed. */
154
+ export declare function initStandards(root: string): {
155
+ written: string[];
156
+ skipped: string[];
157
+ };
158
+ /** `propmaster standards ...` */
159
+ export declare function runStandards(argv: string[], root: string, log?: (line?: string) => void): number;
160
+ //# sourceMappingURL=standards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standards.d.ts","sourceRoot":"","sources":["../../../src/cli/standards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7D,eAAO,MAAM,cAAc,8BAA8B,CAAC;AAC1D,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAE7C,eAAO,MAAM,UAAU,YAAI,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,CAAU,CAAC;AACxK,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,MAAM,WAAW,YAAY;IACzB,yEAAyE;IACzE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,yGAAyG;IACzG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,yJAAyJ;IACzJ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,6BAA6B;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GA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