@andrii_kremlovskyi/playwright-traces-reader 2.3.0 → 2.5.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 (54) hide show
  1. package/README.md +42 -7
  2. package/dist/cli/formatters.d.ts +3 -1
  3. package/dist/cli/formatters.d.ts.map +1 -1
  4. package/dist/cli/formatters.js +21 -1
  5. package/dist/cli/formatters.js.map +1 -1
  6. package/dist/cli/helpers.d.ts +2 -0
  7. package/dist/cli/helpers.d.ts.map +1 -1
  8. package/dist/cli/helpers.js +28 -1
  9. package/dist/cli/helpers.js.map +1 -1
  10. package/dist/cli/json.d.ts +16 -2
  11. package/dist/cli/json.d.ts.map +1 -1
  12. package/dist/cli/json.js +18 -0
  13. package/dist/cli/json.js.map +1 -1
  14. package/dist/cli.d.ts.map +1 -1
  15. package/dist/cli.js +23 -0
  16. package/dist/cli.js.map +1 -1
  17. package/dist/docGenerator/actionTranslator.d.ts +15 -0
  18. package/dist/docGenerator/actionTranslator.d.ts.map +1 -0
  19. package/dist/docGenerator/actionTranslator.js +299 -0
  20. package/dist/docGenerator/actionTranslator.js.map +1 -0
  21. package/dist/docGenerator/copilotRenderer.d.ts +17 -0
  22. package/dist/docGenerator/copilotRenderer.d.ts.map +1 -0
  23. package/dist/docGenerator/copilotRenderer.js +247 -0
  24. package/dist/docGenerator/copilotRenderer.js.map +1 -0
  25. package/dist/docGenerator/featureLinker.d.ts +12 -0
  26. package/dist/docGenerator/featureLinker.d.ts.map +1 -0
  27. package/dist/docGenerator/featureLinker.js +117 -0
  28. package/dist/docGenerator/featureLinker.js.map +1 -0
  29. package/dist/docGenerator/index.d.ts +7 -0
  30. package/dist/docGenerator/index.d.ts.map +1 -0
  31. package/dist/docGenerator/index.js +19 -0
  32. package/dist/docGenerator/index.js.map +1 -0
  33. package/dist/docGenerator/markdownRenderer.d.ts +19 -0
  34. package/dist/docGenerator/markdownRenderer.d.ts.map +1 -0
  35. package/dist/docGenerator/markdownRenderer.js +214 -0
  36. package/dist/docGenerator/markdownRenderer.js.map +1 -0
  37. package/dist/docGenerator/types.d.ts +97 -0
  38. package/dist/docGenerator/types.d.ts.map +1 -0
  39. package/dist/docGenerator/types.js +3 -0
  40. package/dist/docGenerator/types.js.map +1 -0
  41. package/dist/docGenerator/vaultBuilder.d.ts +20 -0
  42. package/dist/docGenerator/vaultBuilder.d.ts.map +1 -0
  43. package/dist/docGenerator/vaultBuilder.js +437 -0
  44. package/dist/docGenerator/vaultBuilder.js.map +1 -0
  45. package/dist/index.d.ts +2 -2
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +2 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/parseTrace.d.ts +22 -0
  50. package/dist/parseTrace.d.ts.map +1 -1
  51. package/dist/parseTrace.js +66 -0
  52. package/dist/parseTrace.js.map +1 -1
  53. package/package.json +3 -3
  54. package/templates/skills/analyze-playwright-traces/SKILL.md +68 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrii_kremlovskyi/playwright-traces-reader",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "Parse Playwright trace files into structured data for AI agents and tooling",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -56,8 +56,8 @@
56
56
  "ts-jest",
57
57
  {
58
58
  "tsconfig": {
59
- "module": "commonjs",
60
- "moduleResolution": "node",
59
+ "module": "Node16",
60
+ "moduleResolution": "Node16",
61
61
  "esModuleInterop": true,
62
62
  "types": [
63
63
  "node",
@@ -113,6 +113,35 @@ npx playwright-traces-reader failures <reportRootPath>
113
113
  npx playwright-traces-reader summary <tracePath>
114
114
  ```
115
115
 
116
+ ### Vault analysis files
117
+
118
+ Reports may have an associated markdown analysis file stored in the dashboard vault. When `search-reports` or `prepare-report` returns a report descriptor, the `analysisFile` field indicates whether a vault `.md` file exists for that report. If `analysisFile` is `null`, no analysis file is available.
119
+
120
+ Use `vault-read` to retrieve the content of an analysis file by name:
121
+
122
+ ```bash
123
+ npx playwright-traces-reader vault-read <analysisFile>
124
+ ```
125
+
126
+ - `--base-url <url>` points to the local `playwright-reports` hub. Default: `http://127.0.0.1:9333`.
127
+ - `-f, --format <format>` controls output format: `json` or `text` (default: `text`).
128
+
129
+ Text format outputs the raw markdown content directly. JSON format wraps it in an envelope:
130
+
131
+ ```json
132
+ { "schemaVersion": 1, "command": "vault-read", "filename": "...", "content": "..." }
133
+ ```
134
+
135
+ Typical flow: discover a report, then read its analysis file if one exists.
136
+
137
+ ```bash
138
+ npx playwright-traces-reader search-reports "UAT EU" --latest --limit 1
139
+ # → check analysisFile field in the response
140
+ npx playwright-traces-reader vault-read <analysisFile>
141
+ ```
142
+
143
+ The agent cannot access vault files directly with `read_file` because they are stored outside the workspace. Always use `vault-read` through the terminal to retrieve vault content.
144
+
116
145
  ### Report-level analysis
117
146
 
118
147
  Use `failures` when the user wants all unique failing tests in a report.
@@ -136,6 +165,38 @@ What it returns:
136
165
  - repeated failing-request and repeated correlated-issue patterns across unique non-skipped failures
137
166
  - enough information to follow up with `summary <tracePath>` for one selected failure
138
167
 
168
+ ### Finding traces for any test
169
+
170
+ Use `find-traces` when the user wants to locate trace paths for a specific test — including passed tests — by name.
171
+
172
+ ```bash
173
+ npx playwright-traces-reader find-traces /path/to/playwright-report "test name pattern"
174
+ ```
175
+
176
+ The `<grep>` argument is a case-insensitive substring matched against the full test title (file path + describe blocks + test name). Special characters in test names (brackets, quotes, parentheses, non-Latin scripts) are handled safely — paste any fragment directly.
177
+
178
+ Use `--outcome` to filter by test outcome:
179
+
180
+ ```bash
181
+ npx playwright-traces-reader find-traces /path/to/playwright-report "checkout" --outcome expected
182
+ npx playwright-traces-reader find-traces /path/to/playwright-report "checkout" --outcome flaky
183
+ ```
184
+
185
+ Outcome values: `expected` (passed), `unexpected` (failed), `flaky`, `skipped`.
186
+
187
+ What it returns:
188
+
189
+ - all matching tests with their trace paths, including all retries
190
+ - test-level outcome from `report.json`
191
+ - trace SHA1 and absolute trace path for direct use with `summary <tracePath>`
192
+
193
+ Typical follow-up:
194
+
195
+ ```bash
196
+ npx playwright-traces-reader find-traces /path/to/playwright-report "login" --outcome expected
197
+ npx playwright-traces-reader summary <tracePath> --report /path/to/playwright-report
198
+ ```
199
+
139
200
  ### Single-trace summary
140
201
 
141
202
  Use `summary` when the user wants one complete summary for a specific trace.
@@ -299,15 +360,15 @@ npx playwright-traces-reader init-skills
299
360
  1. If the user gave no report identifier at all, start with the local `playwright-report/` directory.
300
361
  2. If the report path is unknown but the user did provide metadata, date, or recency hints, use `search-reports` and then `prepare-report` first.
301
362
  3. Identify whether the task is report-level or single-trace.
302
- 4. Choose the narrowest parser command that answers the question.
303
- 5. Use the default JSON output for agent reasoning or follow-up processing.
304
- 6. Use `--format text` when the user wants a direct terminal-style summary.
305
- 7. Do not fall back to library APIs unless the requested workflow is not covered by a supported command.
363
+ 4. If the user wants to analyze a specific test by name (including passed tests), use `find-traces` to locate its trace path first.
364
+ 5. Choose the narrowest parser command that answers the question.
365
+ 6. Use the default JSON output for agent reasoning or follow-up processing.
366
+ 7. Use `--format text` when the user wants a direct terminal-style summary.
367
+ 8. Do not fall back to library APIs unless the requested workflow is not covered by a supported command.
306
368
 
307
369
  ## Output Guidance
308
370
 
309
371
  - All CLI JSON outputs use versioned envelopes.
310
- - See `CLI_JSON_CONTRACTS.md` in the package for payload structure.
311
372
  - For screenshots, the JSON output contains file metadata, not image understanding.
312
373
 
313
374
  ## Example Prompts This Skill Covers
@@ -317,8 +378,5 @@ npx playwright-traces-reader init-skills
317
378
  - Find checkout reports from `2026-04-01` through `2026-04-03` and prepare the newest one.
318
379
  - Resolve this `reportRef` and summarize the failing trace.
319
380
  - Use the reports hub at `http://127.0.0.1:9333` to find the most recent smoke run.
320
-
321
- ## More Documentation
322
-
323
- - Use the CLI reference for detailed command docs: `CLI_REFERENCE.md`
324
- - Use the library integration guide only for in-process integrations such as `playwright-reports`: `LIBRARY_INTEGRATION.md`
381
+ - Find the trace for my passed "login" test and show me its summary.
382
+ - Show me traces for all flaky tests matching "checkout".