retestkit 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/.claude/commands/openspec/apply.md +23 -0
  2. package/.claude/commands/openspec/archive.md +27 -0
  3. package/.claude/commands/openspec/proposal.md +28 -0
  4. package/.gemini/commands/openspec/apply.toml +21 -0
  5. package/.gemini/commands/openspec/archive.toml +25 -0
  6. package/.gemini/commands/openspec/proposal.toml +26 -0
  7. package/.github/prompts/openspec-apply.prompt.md +22 -0
  8. package/.github/prompts/openspec-archive.prompt.md +26 -0
  9. package/.github/prompts/openspec-proposal.prompt.md +27 -0
  10. package/.github/workflows/release.yml +33 -0
  11. package/.kilocode/workflows/openspec-apply.md +17 -0
  12. package/.kilocode/workflows/openspec-archive.md +21 -0
  13. package/.kilocode/workflows/openspec-proposal.md +22 -0
  14. package/.mcp.json +23 -0
  15. package/.opencode/command/openspec-apply.md +25 -0
  16. package/.opencode/command/openspec-archive.md +28 -0
  17. package/.opencode/command/openspec-proposal.md +30 -0
  18. package/.roo/commands/openspec-apply.md +20 -0
  19. package/.roo/commands/openspec-archive.md +24 -0
  20. package/.roo/commands/openspec-proposal.md +25 -0
  21. package/.vscode/mcp.json +23 -0
  22. package/AGENTS.md +18 -0
  23. package/CLAUDE.md +18 -0
  24. package/LICENSE +65 -0
  25. package/README.md +303 -0
  26. package/dist/config.d.ts +4 -0
  27. package/dist/config.d.ts.map +1 -0
  28. package/dist/config.js +27 -0
  29. package/dist/config.js.map +1 -0
  30. package/dist/elicitation/index.d.ts +17 -0
  31. package/dist/elicitation/index.d.ts.map +1 -0
  32. package/dist/elicitation/index.js +118 -0
  33. package/dist/elicitation/index.js.map +1 -0
  34. package/dist/elicitation/types.d.ts +35 -0
  35. package/dist/elicitation/types.d.ts.map +1 -0
  36. package/dist/elicitation/types.js +39 -0
  37. package/dist/elicitation/types.js.map +1 -0
  38. package/dist/index.d.ts +3 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +76 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/lifecycle/index.d.ts +31 -0
  43. package/dist/lifecycle/index.d.ts.map +1 -0
  44. package/dist/lifecycle/index.js +61 -0
  45. package/dist/lifecycle/index.js.map +1 -0
  46. package/dist/logger.d.ts +21 -0
  47. package/dist/logger.d.ts.map +1 -0
  48. package/dist/logger.js +182 -0
  49. package/dist/logger.js.map +1 -0
  50. package/dist/playwright-client/index.d.ts +29 -0
  51. package/dist/playwright-client/index.d.ts.map +1 -0
  52. package/dist/playwright-client/index.js +288 -0
  53. package/dist/playwright-client/index.js.map +1 -0
  54. package/dist/playwright-client/types.d.ts +44 -0
  55. package/dist/playwright-client/types.d.ts.map +1 -0
  56. package/dist/playwright-client/types.js +49 -0
  57. package/dist/playwright-client/types.js.map +1 -0
  58. package/dist/progress/index.d.ts +39 -0
  59. package/dist/progress/index.d.ts.map +1 -0
  60. package/dist/progress/index.js +106 -0
  61. package/dist/progress/index.js.map +1 -0
  62. package/dist/progress/types.d.ts +24 -0
  63. package/dist/progress/types.d.ts.map +1 -0
  64. package/dist/progress/types.js +2 -0
  65. package/dist/progress/types.js.map +1 -0
  66. package/dist/prompts/index.d.ts +19 -0
  67. package/dist/prompts/index.d.ts.map +1 -0
  68. package/dist/prompts/index.js +207 -0
  69. package/dist/prompts/index.js.map +1 -0
  70. package/dist/prompts/loader.d.ts +20 -0
  71. package/dist/prompts/loader.d.ts.map +1 -0
  72. package/dist/prompts/loader.js +47 -0
  73. package/dist/prompts/loader.js.map +1 -0
  74. package/dist/resources/index.d.ts +27 -0
  75. package/dist/resources/index.d.ts.map +1 -0
  76. package/dist/resources/index.js +186 -0
  77. package/dist/resources/index.js.map +1 -0
  78. package/dist/resources/subscriptions.d.ts +10 -0
  79. package/dist/resources/subscriptions.d.ts.map +1 -0
  80. package/dist/resources/subscriptions.js +23 -0
  81. package/dist/resources/subscriptions.js.map +1 -0
  82. package/dist/sampling/index.d.ts +11 -0
  83. package/dist/sampling/index.d.ts.map +1 -0
  84. package/dist/sampling/index.js +201 -0
  85. package/dist/sampling/index.js.map +1 -0
  86. package/dist/sampling/prompts.d.ts +56 -0
  87. package/dist/sampling/prompts.d.ts.map +1 -0
  88. package/dist/sampling/prompts.js +124 -0
  89. package/dist/sampling/prompts.js.map +1 -0
  90. package/dist/sampling/types.d.ts +57 -0
  91. package/dist/sampling/types.d.ts.map +1 -0
  92. package/dist/sampling/types.js +2 -0
  93. package/dist/sampling/types.js.map +1 -0
  94. package/dist/schemas/config.d.ts +40 -0
  95. package/dist/schemas/config.d.ts.map +1 -0
  96. package/dist/schemas/config.js +30 -0
  97. package/dist/schemas/config.js.map +1 -0
  98. package/dist/security/index.d.ts +38 -0
  99. package/dist/security/index.d.ts.map +1 -0
  100. package/dist/security/index.js +281 -0
  101. package/dist/security/index.js.map +1 -0
  102. package/dist/server.d.ts +9 -0
  103. package/dist/server.d.ts.map +1 -0
  104. package/dist/server.js +142 -0
  105. package/dist/server.js.map +1 -0
  106. package/dist/test-utils/index.d.ts +6 -0
  107. package/dist/test-utils/index.d.ts.map +1 -0
  108. package/dist/test-utils/index.js +6 -0
  109. package/dist/test-utils/index.js.map +1 -0
  110. package/dist/test-utils/mock-context.d.ts +64 -0
  111. package/dist/test-utils/mock-context.d.ts.map +1 -0
  112. package/dist/test-utils/mock-context.js +347 -0
  113. package/dist/test-utils/mock-context.js.map +1 -0
  114. package/dist/test-utils/mock-playwright-client.d.ts +62 -0
  115. package/dist/test-utils/mock-playwright-client.d.ts.map +1 -0
  116. package/dist/test-utils/mock-playwright-client.js +315 -0
  117. package/dist/test-utils/mock-playwright-client.js.map +1 -0
  118. package/dist/tools/index.d.ts +4 -0
  119. package/dist/tools/index.d.ts.map +1 -0
  120. package/dist/tools/index.js +8 -0
  121. package/dist/tools/index.js.map +1 -0
  122. package/dist/tools/webtest/crawl.d.ts +46 -0
  123. package/dist/tools/webtest/crawl.d.ts.map +1 -0
  124. package/dist/tools/webtest/crawl.js +678 -0
  125. package/dist/tools/webtest/crawl.js.map +1 -0
  126. package/dist/tools/webtest/discover-features.d.ts +30 -0
  127. package/dist/tools/webtest/discover-features.d.ts.map +1 -0
  128. package/dist/tools/webtest/discover-features.js +343 -0
  129. package/dist/tools/webtest/discover-features.js.map +1 -0
  130. package/dist/tools/webtest/discover-flows.d.ts +29 -0
  131. package/dist/tools/webtest/discover-flows.d.ts.map +1 -0
  132. package/dist/tools/webtest/discover-flows.js +341 -0
  133. package/dist/tools/webtest/discover-flows.js.map +1 -0
  134. package/dist/tools/webtest/generate-tests.d.ts +54 -0
  135. package/dist/tools/webtest/generate-tests.d.ts.map +1 -0
  136. package/dist/tools/webtest/generate-tests.js +364 -0
  137. package/dist/tools/webtest/generate-tests.js.map +1 -0
  138. package/dist/tools/webtest/index.d.ts +8 -0
  139. package/dist/tools/webtest/index.d.ts.map +1 -0
  140. package/dist/tools/webtest/index.js +8 -0
  141. package/dist/tools/webtest/index.js.map +1 -0
  142. package/dist/tools/webtest/run-test-case.d.ts +28 -0
  143. package/dist/tools/webtest/run-test-case.d.ts.map +1 -0
  144. package/dist/tools/webtest/run-test-case.js +420 -0
  145. package/dist/tools/webtest/run-test-case.js.map +1 -0
  146. package/dist/tools/webtest/schemas.d.ts +175 -0
  147. package/dist/tools/webtest/schemas.d.ts.map +1 -0
  148. package/dist/tools/webtest/schemas.js +156 -0
  149. package/dist/tools/webtest/schemas.js.map +1 -0
  150. package/dist/tools/webtest/start-analysis.d.ts +16 -0
  151. package/dist/tools/webtest/start-analysis.d.ts.map +1 -0
  152. package/dist/tools/webtest/start-analysis.js +137 -0
  153. package/dist/tools/webtest/start-analysis.js.map +1 -0
  154. package/dist/transports/http.d.ts +8 -0
  155. package/dist/transports/http.d.ts.map +1 -0
  156. package/dist/transports/http.js +9 -0
  157. package/dist/transports/http.js.map +1 -0
  158. package/dist/transports/index.d.ts +14 -0
  159. package/dist/transports/index.d.ts.map +1 -0
  160. package/dist/transports/index.js +20 -0
  161. package/dist/transports/index.js.map +1 -0
  162. package/dist/transports/stdio.d.ts +4 -0
  163. package/dist/transports/stdio.d.ts.map +1 -0
  164. package/dist/transports/stdio.js +6 -0
  165. package/dist/transports/stdio.js.map +1 -0
  166. package/dist/types/capabilities.d.ts +18 -0
  167. package/dist/types/capabilities.d.ts.map +1 -0
  168. package/dist/types/capabilities.js +35 -0
  169. package/dist/types/capabilities.js.map +1 -0
  170. package/dist/types/context.d.ts +20 -0
  171. package/dist/types/context.d.ts.map +1 -0
  172. package/dist/types/context.js +2 -0
  173. package/dist/types/context.js.map +1 -0
  174. package/dist/types/tool.d.ts +10 -0
  175. package/dist/types/tool.d.ts.map +1 -0
  176. package/dist/types/tool.js +2 -0
  177. package/dist/types/tool.js.map +1 -0
  178. package/dist/workspace/index.d.ts +99 -0
  179. package/dist/workspace/index.d.ts.map +1 -0
  180. package/dist/workspace/index.js +648 -0
  181. package/dist/workspace/index.js.map +1 -0
  182. package/dist/workspace/markdown.d.ts +50 -0
  183. package/dist/workspace/markdown.d.ts.map +1 -0
  184. package/dist/workspace/markdown.js +210 -0
  185. package/dist/workspace/markdown.js.map +1 -0
  186. package/dist/workspace/types.d.ts +173 -0
  187. package/dist/workspace/types.d.ts.map +1 -0
  188. package/dist/workspace/types.js +2 -0
  189. package/dist/workspace/types.js.map +1 -0
  190. package/openspec/AGENTS.md +456 -0
  191. package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/proposal.md +33 -0
  192. package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/specs/webtest-resources/spec.md +27 -0
  193. package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/specs/webtest-tools/spec.md +304 -0
  194. package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/tasks.md +43 -0
  195. package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/design.md +209 -0
  196. package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/proposal.md +41 -0
  197. package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/specs/mcp-server-core/spec.md +183 -0
  198. package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/tasks.md +112 -0
  199. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/design.md +333 -0
  200. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/proposal.md +66 -0
  201. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/mcp-server-core/spec.md +129 -0
  202. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-lifecycle/spec.md +138 -0
  203. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-logging/spec.md +211 -0
  204. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-prompts/spec.md +157 -0
  205. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-resources/spec.md +213 -0
  206. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-sampling/spec.md +257 -0
  207. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-tools/spec.md +501 -0
  208. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/tasks.md +264 -0
  209. package/openspec/changes/archive/2025-12-18-allow-analysis-of-incomplete-crawls/proposal.md +24 -0
  210. package/openspec/changes/archive/2025-12-18-allow-analysis-of-incomplete-crawls/specs/webtest-tools/spec.md +80 -0
  211. package/openspec/changes/archive/2025-12-18-allow-analysis-of-incomplete-crawls/tasks.md +8 -0
  212. package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/design.md +90 -0
  213. package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/proposal.md +28 -0
  214. package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/specs/webtest-sampling/spec.md +90 -0
  215. package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/tasks.md +33 -0
  216. package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/design.md +558 -0
  217. package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/proposal.md +119 -0
  218. package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/specs/webtest-resources/spec.md +109 -0
  219. package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/specs/webtest-tools/spec.md +121 -0
  220. package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/tasks.md +133 -0
  221. package/openspec/changes/extract-prompts-to-markdown/design.md +86 -0
  222. package/openspec/changes/extract-prompts-to-markdown/proposal.md +50 -0
  223. package/openspec/changes/extract-prompts-to-markdown/specs/webtest-prompts/spec.md +74 -0
  224. package/openspec/changes/extract-prompts-to-markdown/tasks.md +40 -0
  225. package/openspec/changes/refactor-webtest-naming/design.md +95 -0
  226. package/openspec/changes/refactor-webtest-naming/proposal.md +66 -0
  227. package/openspec/changes/refactor-webtest-naming/specs/webtest-prompts/spec.md +79 -0
  228. package/openspec/changes/refactor-webtest-naming/specs/webtest-resources/spec.md +80 -0
  229. package/openspec/changes/refactor-webtest-naming/specs/webtest-sampling/spec.md +122 -0
  230. package/openspec/changes/refactor-webtest-naming/specs/webtest-tools/spec.md +113 -0
  231. package/openspec/changes/refactor-webtest-naming/tasks.md +119 -0
  232. package/openspec/changes/rename-package-to-retest/proposal.md +52 -0
  233. package/openspec/changes/rename-package-to-retest/specs/mcp-server-core/spec.md +53 -0
  234. package/openspec/changes/rename-package-to-retest/specs/retest-lifecycle/spec.md +68 -0
  235. package/openspec/changes/rename-package-to-retest/specs/retest-logging/spec.md +35 -0
  236. package/openspec/changes/rename-package-to-retest/specs/retest-prompts/spec.md +159 -0
  237. package/openspec/changes/rename-package-to-retest/specs/retest-resources/spec.md +251 -0
  238. package/openspec/changes/rename-package-to-retest/specs/retest-sampling/spec.md +99 -0
  239. package/openspec/changes/rename-package-to-retest/specs/retest-tools/spec.md +295 -0
  240. package/openspec/changes/rename-package-to-retest/tasks.md +71 -0
  241. package/openspec/project.md +31 -0
  242. package/openspec/specs/mcp-server-core/spec.md +178 -0
  243. package/openspec/specs/webtest-lifecycle/spec.md +136 -0
  244. package/openspec/specs/webtest-logging/spec.md +209 -0
  245. package/openspec/specs/webtest-prompts/spec.md +155 -0
  246. package/openspec/specs/webtest-resources/spec.md +248 -0
  247. package/openspec/specs/webtest-sampling/spec.md +344 -0
  248. package/openspec/specs/webtest-tools/spec.md +282 -0
  249. package/package.json +54 -0
  250. package/release.config.js +9 -0
  251. package/src/config.test.ts +96 -0
  252. package/src/config.ts +32 -0
  253. package/src/elicitation/index.test.ts +399 -0
  254. package/src/elicitation/index.ts +171 -0
  255. package/src/elicitation/types.ts +68 -0
  256. package/src/index.ts +83 -0
  257. package/src/lifecycle/index.test.ts +260 -0
  258. package/src/lifecycle/index.ts +101 -0
  259. package/src/logger.redaction.test.ts +322 -0
  260. package/src/logger.test.ts +123 -0
  261. package/src/logger.ts +229 -0
  262. package/src/playwright-client/index.ts +392 -0
  263. package/src/playwright-client/types.ts +99 -0
  264. package/src/progress/index.test.ts +327 -0
  265. package/src/progress/index.ts +170 -0
  266. package/src/progress/types.ts +25 -0
  267. package/src/prompts/index.test.ts +451 -0
  268. package/src/prompts/index.ts +246 -0
  269. package/src/prompts/loader.test.ts +100 -0
  270. package/src/prompts/loader.ts +59 -0
  271. package/src/prompts/templates/mcp/webtest-crawl.md +7 -0
  272. package/src/prompts/templates/mcp/webtest-discover-flows.md +11 -0
  273. package/src/prompts/templates/mcp/webtest-discover.md +12 -0
  274. package/src/prompts/templates/mcp/webtest-full-workflow.md +12 -0
  275. package/src/prompts/templates/mcp/webtest-generate-tests.md +11 -0
  276. package/src/prompts/templates/mcp/webtest-run-test.md +11 -0
  277. package/src/prompts/templates/mcp/webtest-start.md +8 -0
  278. package/src/prompts/templates/sampling/crawl-action.md +35 -0
  279. package/src/prompts/templates/sampling/feature-discovery.md +27 -0
  280. package/src/prompts/templates/sampling/flow-discovery.md +29 -0
  281. package/src/prompts/templates/sampling/page-content-wrapper.md +5 -0
  282. package/src/prompts/templates/sampling/system-prefix.md +12 -0
  283. package/src/prompts/templates/sampling/test-evaluation.md +17 -0
  284. package/src/prompts/templates/sampling/test-generation.md +31 -0
  285. package/src/resources/index.ts +250 -0
  286. package/src/resources/subscriptions.ts +37 -0
  287. package/src/sampling/index.test.ts +414 -0
  288. package/src/sampling/index.ts +286 -0
  289. package/src/sampling/prompts.ts +194 -0
  290. package/src/sampling/types.ts +60 -0
  291. package/src/schemas/config.ts +39 -0
  292. package/src/security/index.test.ts +441 -0
  293. package/src/security/index.ts +361 -0
  294. package/src/security/security-scenarios.test.ts +468 -0
  295. package/src/server.ts +211 -0
  296. package/src/test-utils/index.ts +6 -0
  297. package/src/test-utils/mock-context.ts +426 -0
  298. package/src/test-utils/mock-playwright-client.ts +422 -0
  299. package/src/tools/index.ts +11 -0
  300. package/src/tools/webtest/crawl.test.ts +834 -0
  301. package/src/tools/webtest/crawl.ts +901 -0
  302. package/src/tools/webtest/discover-features.ts +412 -0
  303. package/src/tools/webtest/discover-flows.ts +408 -0
  304. package/src/tools/webtest/generate-tests.test.ts +532 -0
  305. package/src/tools/webtest/generate-tests.ts +425 -0
  306. package/src/tools/webtest/index.ts +7 -0
  307. package/src/tools/webtest/integration.test.ts +536 -0
  308. package/src/tools/webtest/run-test-case.test.ts +659 -0
  309. package/src/tools/webtest/run-test-case.ts +508 -0
  310. package/src/tools/webtest/schemas.ts +201 -0
  311. package/src/tools/webtest/start-analysis.test.ts +151 -0
  312. package/src/tools/webtest/start-analysis.ts +158 -0
  313. package/src/transports/http.ts +19 -0
  314. package/src/transports/index.ts +30 -0
  315. package/src/transports/stdio.ts +7 -0
  316. package/src/types/capabilities.test.ts +193 -0
  317. package/src/types/capabilities.ts +50 -0
  318. package/src/types/context.ts +21 -0
  319. package/src/types/tool.ts +11 -0
  320. package/src/workspace/index.ts +945 -0
  321. package/src/workspace/markdown.ts +272 -0
  322. package/src/workspace/types.ts +186 -0
  323. package/tests/integration/server.test.ts +89 -0
  324. package/tests/integration/tools.test.ts +99 -0
  325. package/tsconfig.json +20 -0
  326. package/vitest.config.ts +9 -0
  327. package/vitest.integration.config.ts +10 -0
@@ -0,0 +1,558 @@
1
+ # Design: Markdown Artifacts Architecture
2
+
3
+ ## Overview
4
+
5
+ This document describes the architectural approach for converting all JSON artifacts to markdown format while preserving programmatic access through YAML frontmatter.
6
+
7
+ ## Core Design Decisions
8
+
9
+ ### 1. YAML Frontmatter as Structured Data Layer
10
+
11
+ All markdown artifacts that require programmatic access will use YAML frontmatter delimited by `---`:
12
+
13
+ ```markdown
14
+ ---
15
+ # Structured data here (parseable)
16
+ key: value
17
+ nested:
18
+ field: data
19
+ ---
20
+
21
+ # Human-Readable Content
22
+
23
+ Content formatted for reading...
24
+ ```
25
+
26
+ **Rationale**:
27
+ - Standard pattern used by static site generators, documentation tools
28
+ - Well-supported parsing libraries in Node.js (`gray-matter`, `yaml`)
29
+ - Separates machine-readable from human-readable content
30
+ - Maintains single source of truth (no sync between .json and .md)
31
+
32
+ ### 2. Artifact-Specific Formats
33
+
34
+ #### 2.1 Workspace Index (`index.md`)
35
+
36
+ ```markdown
37
+ ---
38
+ analysisId: "uuid"
39
+ createdAt: "2025-01-15T10:30:00Z"
40
+ url: "https://example.com"
41
+ focus: "checkout flow"
42
+ status: "in_progress" | "completed"
43
+ limits:
44
+ maxSteps: 100
45
+ maxPages: 20
46
+ maxMinutes: 30
47
+ allowedDomains:
48
+ - "example.com"
49
+ crawls:
50
+ - id: "crawl-001"
51
+ status: "completed"
52
+ pagesDiscovered: 15
53
+ createdAt: "2025-01-15T10:31:00Z"
54
+ analysis:
55
+ createdAt: "2025-01-15T10:45:00Z"
56
+ appAnalysisUri: "webtest://uuid/analysis/app-analysis.md"
57
+ tests:
58
+ createdAt: "2025-01-15T10:50:00Z"
59
+ testsUri: "webtest://uuid/tests/tests.md"
60
+ testCount: 12
61
+ runs:
62
+ - id: "run-001"
63
+ testCaseId: "test-001"
64
+ status: "passed"
65
+ createdAt: "2025-01-15T11:00:00Z"
66
+ ---
67
+
68
+ # Analysis Workspace
69
+
70
+ **Target**: https://example.com
71
+ **Focus**: checkout flow
72
+ **Status**: In Progress
73
+ **Created**: January 15, 2025 at 10:30 AM
74
+
75
+ ## Configuration
76
+
77
+ | Setting | Value |
78
+ |---------|-------|
79
+ | Max Steps | 100 |
80
+ | Max Pages | 20 |
81
+ | Max Minutes | 30 |
82
+ | Allowed Domains | example.com |
83
+
84
+ ## Crawls
85
+
86
+ ### crawl-001
87
+ - **Status**: Completed
88
+ - **Pages**: 15 discovered
89
+ - **Started**: 10:31 AM
90
+
91
+ ## Analysis
92
+
93
+ Analysis completed at 10:45 AM.
94
+ - [View Analysis Report](./analysis/app-analysis.md)
95
+
96
+ ## Tests
97
+
98
+ 12 test cases generated at 10:50 AM.
99
+ - [View Test Cases](./tests/tests.md)
100
+
101
+ ## Test Runs
102
+
103
+ | Run | Test | Status | Time |
104
+ |-----|------|--------|------|
105
+ | run-001 | test-001 | Passed | 11:00 AM |
106
+ ```
107
+
108
+ #### 2.2 Crawl Index (`crawls/{id}/index.md`)
109
+
110
+ ```markdown
111
+ ---
112
+ crawlId: "uuid"
113
+ analysisId: "parent-uuid"
114
+ status: "completed" | "in_progress" | "cancelled" | "limits_reached"
115
+ goal: "Explore the checkout flow"
116
+ createdAt: "2025-01-15T10:31:00Z"
117
+ completedAt: "2025-01-15T10:44:00Z"
118
+ budget:
119
+ maxSteps: 100
120
+ stepsUsed: 45
121
+ maxPages: 20
122
+ pagesDiscovered: 15
123
+ maxMinutes: 30
124
+ minutesElapsed: 13
125
+ pages:
126
+ - id: "page-001"
127
+ url: "https://example.com/"
128
+ title: "Home"
129
+ capturedAt: "2025-01-15T10:31:05Z"
130
+ - id: "page-002"
131
+ url: "https://example.com/products"
132
+ title: "Products"
133
+ capturedAt: "2025-01-15T10:32:10Z"
134
+ actionHistory:
135
+ - step: 1
136
+ tool: "browser_click"
137
+ element: "Products link"
138
+ result: "success"
139
+ loopDetection:
140
+ urlVisitCounts:
141
+ "https://example.com/": 2
142
+ recentActions: []
143
+ domSignatures: []
144
+ ---
145
+
146
+ # Crawl Report
147
+
148
+ **Goal**: Explore the checkout flow
149
+ **Status**: Completed
150
+ **Duration**: 13 minutes (10:31 AM - 10:44 AM)
151
+
152
+ ## Budget Usage
153
+
154
+ | Metric | Used | Limit | % |
155
+ |--------|------|-------|---|
156
+ | Steps | 45 | 100 | 45% |
157
+ | Pages | 15 | 20 | 75% |
158
+ | Time | 13m | 30m | 43% |
159
+
160
+ ## Pages Discovered
161
+
162
+ | # | Page | URL | Captured |
163
+ |---|------|-----|----------|
164
+ | 1 | Home | https://example.com/ | 10:31:05 |
165
+ | 2 | Products | https://example.com/products | 10:32:10 |
166
+ ...
167
+
168
+ ## Action History
169
+
170
+ 1. **Click** Products link → success
171
+ 2. **Click** Add to Cart button → success
172
+ ...
173
+ ```
174
+
175
+ #### 2.3 Checkpoint (`crawls/{id}/checkpoint.md`)
176
+
177
+ ```markdown
178
+ ---
179
+ crawlId: "uuid"
180
+ step: 45
181
+ savedAt: "2025-01-15T10:40:00Z"
182
+ currentUrl: "https://example.com/cart"
183
+ currentPageId: "page-012"
184
+ visitedUrls:
185
+ - "https://example.com/"
186
+ - "https://example.com/products"
187
+ - "https://example.com/cart"
188
+ actionHistory:
189
+ - step: 43
190
+ tool: "browser_click"
191
+ args:
192
+ ref: "btn-123"
193
+ result: "success"
194
+ loopDetection:
195
+ urlVisitCounts:
196
+ "https://example.com/": 2
197
+ recentActions:
198
+ - "browser_click:{\"ref\":\"btn-123\"}"
199
+ domSignatures:
200
+ - "hash-abc"
201
+ - "hash-def"
202
+ goalProgress: "Added item to cart, navigating to checkout"
203
+ ---
204
+
205
+ # Crawl Checkpoint
206
+
207
+ **Step**: 45
208
+ **Saved**: 10:40 AM
209
+ **Current URL**: https://example.com/cart
210
+
211
+ ## Progress
212
+
213
+ Added item to cart, navigating to checkout
214
+
215
+ ## Recent Actions
216
+
217
+ | Step | Action | Result |
218
+ |------|--------|--------|
219
+ | 43 | Click btn-123 | Success |
220
+ | 44 | Navigate cart | Success |
221
+ | 45 | Snapshot | Success |
222
+
223
+ ## Loop Detection State
224
+
225
+ - URL `/` visited 2 times
226
+ - Recent action signatures tracked: 3
227
+ - DOM signatures in window: 2
228
+ ```
229
+
230
+ #### 2.4 Page Snapshot (`pages/{id}/snapshot.md`)
231
+
232
+ ```markdown
233
+ ---
234
+ pageId: "page-001"
235
+ url: "https://example.com/"
236
+ title: "Example Store - Home"
237
+ capturedAt: "2025-01-15T10:31:05Z"
238
+ domSignature: "hash-abc123"
239
+ snapshot:
240
+ role: "WebArea"
241
+ name: "Example Store - Home"
242
+ children:
243
+ - role: "navigation"
244
+ name: "Main navigation"
245
+ children:
246
+ - role: "link"
247
+ name: "Home"
248
+ ref: "nav-home"
249
+ - role: "link"
250
+ name: "Products"
251
+ ref: "nav-products"
252
+ - role: "main"
253
+ name: ""
254
+ children:
255
+ - role: "heading"
256
+ name: "Welcome to Example Store"
257
+ level: 1
258
+ ---
259
+
260
+ # Page Snapshot: Example Store - Home
261
+
262
+ **URL**: https://example.com/
263
+ **Captured**: 10:31:05 AM
264
+ **DOM Signature**: hash-abc123
265
+
266
+ ## Accessibility Tree
267
+
268
+ ```
269
+ WebArea "Example Store - Home"
270
+ ├── navigation "Main navigation"
271
+ │ ├── link "Home" [ref: nav-home]
272
+ │ └── link "Products" [ref: nav-products]
273
+ └── main
274
+ └── heading "Welcome to Example Store" (h1)
275
+ ```
276
+
277
+ ## Interactive Elements
278
+
279
+ | Element | Type | Ref |
280
+ |---------|------|-----|
281
+ | Home | link | nav-home |
282
+ | Products | link | nav-products |
283
+ ```
284
+
285
+ #### 2.5 Flows (`analysis/flows.md`)
286
+
287
+ Instead of separate `flows.json`, embed flows in `app-analysis.md` or create a dedicated `flows.md`:
288
+
289
+ ```markdown
290
+ ---
291
+ flows:
292
+ - id: "flow-checkout"
293
+ name: "Checkout Flow"
294
+ entryPoint: "https://example.com/cart"
295
+ description: "Complete purchase from cart to confirmation"
296
+ steps:
297
+ - "View cart contents"
298
+ - "Click proceed to checkout"
299
+ - "Enter shipping info"
300
+ - "Select payment method"
301
+ - "Confirm order"
302
+ - id: "flow-search"
303
+ name: "Product Search"
304
+ entryPoint: "https://example.com/"
305
+ description: "Search and filter products"
306
+ steps:
307
+ - "Enter search term"
308
+ - "Apply filters"
309
+ - "View results"
310
+ ---
311
+
312
+ # User Flows
313
+
314
+ ## Checkout Flow
315
+
316
+ **ID**: flow-checkout
317
+ **Entry Point**: /cart
318
+ **Description**: Complete purchase from cart to confirmation
319
+
320
+ ### Steps
321
+
322
+ 1. View cart contents
323
+ 2. Click proceed to checkout
324
+ 3. Enter shipping info
325
+ 4. Select payment method
326
+ 5. Confirm order
327
+
328
+ ---
329
+
330
+ ## Product Search
331
+
332
+ **ID**: flow-search
333
+ **Entry Point**: /
334
+ **Description**: Search and filter products
335
+
336
+ ### Steps
337
+
338
+ 1. Enter search term
339
+ 2. Apply filters
340
+ 3. View results
341
+ ```
342
+
343
+ #### 2.6 Test Definitions (`tests/tests.md`)
344
+
345
+ Consolidate `tests.json` and `tests.md` into single file:
346
+
347
+ ```markdown
348
+ ---
349
+ generatedAt: "2025-01-15T10:50:00Z"
350
+ strategy: "comprehensive"
351
+ coverage:
352
+ flowsCovered:
353
+ - "flow-checkout"
354
+ - "flow-search"
355
+ estimatedCoverage: "85%"
356
+ tests:
357
+ - id: "test-checkout-happy"
358
+ name: "Checkout Happy Path"
359
+ category: "happy_path"
360
+ purpose: "Verify complete checkout flow works"
361
+ preconditions:
362
+ - "User has items in cart"
363
+ - "User is not logged in"
364
+ steps:
365
+ - stepNumber: 1
366
+ action: "click"
367
+ element: "Proceed to Checkout button"
368
+ target: "checkout-btn"
369
+ expected: "Shipping form appears"
370
+ - stepNumber: 2
371
+ action: "fill"
372
+ element: "Shipping form"
373
+ value: "Test address data"
374
+ expected: "Form accepts input"
375
+ expectedOutcomes:
376
+ - "Order confirmation page displayed"
377
+ - "Order number generated"
378
+ tags:
379
+ - "checkout"
380
+ - "critical"
381
+ ---
382
+
383
+ # Generated Test Cases
384
+
385
+ **Generated**: January 15, 2025 at 10:50 AM
386
+ **Strategy**: Comprehensive
387
+ **Coverage**: 85% (2 flows)
388
+
389
+ ## Test Summary
390
+
391
+ | ID | Name | Category | Tags |
392
+ |----|------|----------|------|
393
+ | test-checkout-happy | Checkout Happy Path | Happy Path | checkout, critical |
394
+
395
+ ---
396
+
397
+ ## test-checkout-happy: Checkout Happy Path
398
+
399
+ **Category**: Happy Path
400
+ **Purpose**: Verify complete checkout flow works
401
+
402
+ ### Preconditions
403
+
404
+ - User has items in cart
405
+ - User is not logged in
406
+
407
+ ### Steps
408
+
409
+ | # | Action | Element | Expected |
410
+ |---|--------|---------|----------|
411
+ | 1 | Click | Proceed to Checkout button | Shipping form appears |
412
+ | 2 | Fill | Shipping form | Form accepts input |
413
+
414
+ ### Expected Outcomes
415
+
416
+ - Order confirmation page displayed
417
+ - Order number generated
418
+ ```
419
+
420
+ #### 2.7 Test Run Report (`runs/{id}/report.md`)
421
+
422
+ ```markdown
423
+ ---
424
+ runId: "run-001"
425
+ analysisId: "parent-uuid"
426
+ testCaseId: "test-checkout-happy"
427
+ testCaseName: "Checkout Happy Path"
428
+ status: "passed" | "failed" | "cancelled"
429
+ startedAt: "2025-01-15T11:00:00Z"
430
+ completedAt: "2025-01-15T11:02:30Z"
431
+ durationMs: 150000
432
+ steps:
433
+ - stepNumber: 1
434
+ status: "passed"
435
+ action: "click"
436
+ element: "Proceed to Checkout button"
437
+ expected: "Shipping form appears"
438
+ actual: "Shipping form displayed"
439
+ evidence:
440
+ screenshotUri: "webtest://uuid/runs/run-001/steps/1/screenshot.png"
441
+ snapshotUri: "webtest://uuid/runs/run-001/steps/1/snapshot.md"
442
+ - stepNumber: 2
443
+ status: "passed"
444
+ action: "fill"
445
+ element: "Shipping form"
446
+ expected: "Form accepts input"
447
+ actual: "Form filled successfully"
448
+ summary:
449
+ totalSteps: 2
450
+ passedSteps: 2
451
+ failedSteps: 0
452
+ ---
453
+
454
+ # Test Run Report
455
+
456
+ **Test**: Checkout Happy Path (test-checkout-happy)
457
+ **Status**: PASSED
458
+ **Duration**: 2m 30s
459
+ **Run ID**: run-001
460
+
461
+ ## Summary
462
+
463
+ | Metric | Value |
464
+ |--------|-------|
465
+ | Total Steps | 2 |
466
+ | Passed | 2 |
467
+ | Failed | 0 |
468
+ | Success Rate | 100% |
469
+
470
+ ## Step Results
471
+
472
+ ### Step 1: Click Proceed to Checkout button
473
+
474
+ **Status**: PASSED
475
+ **Expected**: Shipping form appears
476
+ **Actual**: Shipping form displayed
477
+
478
+ Evidence:
479
+ - [Screenshot](./steps/1/screenshot.png)
480
+ - [Snapshot](./steps/1/snapshot.md)
481
+
482
+ ---
483
+
484
+ ### Step 2: Fill Shipping form
485
+
486
+ **Status**: PASSED
487
+ **Expected**: Form accepts input
488
+ **Actual**: Form filled successfully
489
+
490
+ Evidence:
491
+ - [Screenshot](./steps/2/screenshot.png)
492
+ - [Snapshot](./steps/2/snapshot.md)
493
+ ```
494
+
495
+ ### 3. Workspace Manager Changes
496
+
497
+ The `WorkspaceManager` in `src/workspace/index.ts` needs these modifications:
498
+
499
+ ```typescript
500
+ // New helper for markdown with frontmatter
501
+ async function writeMarkdownWithFrontmatter(
502
+ filePath: string,
503
+ frontmatter: Record<string, unknown>,
504
+ content: string
505
+ ): Promise<void> {
506
+ const yaml = YAML.stringify(frontmatter);
507
+ const markdown = `---\n${yaml}---\n\n${content}`;
508
+ await writeFile(filePath, markdown, 'utf-8');
509
+ }
510
+
511
+ // New helper to read frontmatter
512
+ async function readMarkdownFrontmatter<T>(filePath: string): Promise<T> {
513
+ const content = await readFile(filePath, 'utf-8');
514
+ const { data } = matter(content);
515
+ return data as T;
516
+ }
517
+ ```
518
+
519
+ ### 4. Resource Manager Changes
520
+
521
+ Update `src/resources/index.ts` to:
522
+ - Map `.md` extensions for former JSON resources
523
+ - Return `text/markdown` MIME type
524
+ - Parse frontmatter when returning structured content
525
+
526
+ ### 5. Tool Output Changes
527
+
528
+ Each tool's return value updates:
529
+ - `webtest_init`: Return `statusUri` as `index.md`
530
+ - `webtest_crawl_app`: Return `crawlIndexUri` as `index.md`
531
+ - `webtest_analyze_app`: Remove `flowsUri` (embedded in analysis), or update to `flows.md`
532
+ - `webtest_generate_tests`: Return single `testsUri` pointing to `tests.md`
533
+ - `webtest_run_tests`: Return `reportUri` as `report.md`
534
+
535
+ ## Implementation Sequence
536
+
537
+ 1. **Add markdown utilities** - frontmatter read/write helpers
538
+ 2. **Update workspace index** - migrate to `.md` format
539
+ 3. **Update crawl index** - migrate to `.md` format
540
+ 4. **Update checkpoint** - migrate to `.md` format
541
+ 5. **Update page snapshot** - migrate to `.md` format with tree visualization
542
+ 6. **Consolidate flows** - embed in analysis or create `flows.md`
543
+ 7. **Consolidate test definitions** - single `tests.md` file
544
+ 8. **Update test run report** - migrate to `report.md`
545
+ 9. **Update resource manager** - handle new paths and MIME types
546
+ 10. **Update tool outputs** - reference new file paths
547
+
548
+ ## Dependencies
549
+
550
+ - `gray-matter` - Parse YAML frontmatter from markdown
551
+ - `yaml` - Serialize objects to YAML (already likely present)
552
+
553
+ ## Testing Strategy
554
+
555
+ 1. **Unit tests**: Frontmatter read/write utilities
556
+ 2. **Integration tests**: Full workflow produces valid markdown
557
+ 3. **Snapshot tests**: Verify markdown output format stability
558
+ 4. **Manual testing**: Browse workspace folder, verify readability
@@ -0,0 +1,119 @@
1
+ # Proposal: Use Markdown for All Artifacts
2
+
3
+ ## Change ID
4
+ `use-markdown-artifacts`
5
+
6
+ ## Status
7
+ Draft
8
+
9
+ ## Problem Statement
10
+
11
+ Currently, the testing-mcp server stores and exposes artifacts using a mix of formats:
12
+ - **Markdown (`.md`)**: Analysis reports, test case documentation
13
+ - **JSON (`.json`)**: Workspace indexes, crawl indexes, flows data, test definitions, test run reports, checkpoints, snapshots
14
+
15
+ This creates friction for consumers who want human-readable artifacts:
16
+ 1. **Index files** (workspace, crawl, test run) are JSON - hard to read without tooling
17
+ 2. **Flows data** is JSON - not directly usable for documentation or review
18
+ 3. **Test definitions** have both `.json` and `.md` but tools return the JSON path as primary
19
+ 4. **Test run results** are JSON only - no human-readable report
20
+ 5. **Checkpoints** are JSON - difficult to debug crawl state
21
+ 6. **Snapshots** are JSON - accessibility trees not easily inspectable
22
+
23
+ The user wants **all artifacts** to be stored and handed over as readable markdown files, making the workspace self-documenting and easy to inspect without specialized tools.
24
+
25
+ ## Proposed Solution
26
+
27
+ Convert all JSON-based artifacts to markdown format while preserving structured data through YAML frontmatter where needed. This creates a consistent, human-readable workspace.
28
+
29
+ ### Artifact Format Changes
30
+
31
+ | Artifact | Current | Proposed |
32
+ |----------|---------|----------|
33
+ | Workspace index | `index.json` | `index.md` with YAML frontmatter |
34
+ | Crawl index | `crawls/{id}/index.json` | `crawls/{id}/index.md` with YAML frontmatter |
35
+ | Crawl checkpoint | `checkpoint.json` | `checkpoint.md` with YAML frontmatter |
36
+ | Page snapshot | `pages/{id}/snapshot.json` | `pages/{id}/snapshot.md` (formatted tree) |
37
+ | Analysis flows | `analysis/flows.json` | `analysis/flows.md` (embedded in analysis or separate) |
38
+ | Test definitions | `tests/tests.json` + `tests.md` | `tests/tests.md` only (with YAML frontmatter for structured data) |
39
+ | Test run index | `runs/{id}/index.json` | `runs/{id}/report.md` with YAML frontmatter |
40
+ | Test step snapshot | `steps/{n}/snapshot.json` | `steps/{n}/snapshot.md` |
41
+
42
+ ### YAML Frontmatter for Structured Data
43
+
44
+ For artifacts that require programmatic access (workspace index, crawl index, test runs), use YAML frontmatter to embed structured data:
45
+
46
+ ```markdown
47
+ ---
48
+ analysisId: abc-123
49
+ createdAt: 2025-01-15T10:30:00Z
50
+ url: https://example.com
51
+ status: completed
52
+ crawls:
53
+ - id: crawl-001
54
+ status: completed
55
+ pagesDiscovered: 15
56
+ ---
57
+
58
+ # Analysis Workspace
59
+
60
+ **Target URL**: https://example.com
61
+ **Created**: January 15, 2025 at 10:30 AM
62
+ **Status**: Completed
63
+
64
+ ## Crawls
65
+
66
+ ### Crawl: crawl-001
67
+ - **Status**: Completed
68
+ - **Pages Discovered**: 15
69
+ ...
70
+ ```
71
+
72
+ ### Benefits
73
+
74
+ 1. **Self-documenting workspace**: Any developer can browse the workspace folder and understand state
75
+ 2. **Version control friendly**: Markdown diffs are readable in PRs
76
+ 3. **No tooling required**: Standard text editors can view all artifacts
77
+ 4. **Consistent format**: One format (markdown) for all human-facing artifacts
78
+ 5. **Programmatic access preserved**: YAML frontmatter can be parsed when needed
79
+
80
+ ## Scope
81
+
82
+ ### In Scope
83
+ - Workspace index format change
84
+ - Crawl index format change
85
+ - Checkpoint format change
86
+ - Page snapshot format change
87
+ - Flows output format change
88
+ - Test definition format consolidation
89
+ - Test run report format change
90
+ - Test step snapshot format change
91
+ - Resource URI updates (`.json` → `.md`)
92
+ - Tool output URI/path updates
93
+
94
+ ### Out of Scope
95
+ - Binary artifacts (screenshots remain PNG/JPEG)
96
+ - DOM HTML (remains `.html`)
97
+ - Backward compatibility migration (clean break)
98
+
99
+ ## Affected Specs
100
+
101
+ 1. **webtest-resources**: Update resource URIs from `.json` to `.md`, update MIME types
102
+ 2. **webtest-tools**: Update tool outputs to reference `.md` files
103
+
104
+ ## Risks and Mitigations
105
+
106
+ | Risk | Mitigation |
107
+ |------|------------|
108
+ | YAML frontmatter parsing complexity | Use well-established libraries (gray-matter, yaml) |
109
+ | Larger file sizes for structured data | Markdown is still compact; compression available if needed |
110
+ | Breaking existing clients | This is a breaking change; document in release notes |
111
+ | Snapshot readability for large trees | Use collapsible sections or truncation with full data in frontmatter |
112
+
113
+ ## Success Criteria
114
+
115
+ 1. All workspace artifacts are `.md` files (except binary screenshots and HTML DOM)
116
+ 2. Workspace folder is browsable and understandable without any tools
117
+ 3. Structured data remains accessible via YAML frontmatter parsing
118
+ 4. All tool outputs reference markdown file paths
119
+ 5. All resource URIs use `.md` extension for converted artifacts