pi-ui-extend 1.0.41 → 1.0.45

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 (236) hide show
  1. package/README.md +50 -13
  2. package/dist/app/app.d.ts +13 -0
  3. package/dist/app/app.js +158 -8
  4. package/dist/app/cli/install.js +2 -2
  5. package/dist/app/commands/command-controller.d.ts +4 -0
  6. package/dist/app/commands/command-controller.js +11 -0
  7. package/dist/app/commands/command-git-actions.d.ts +25 -0
  8. package/dist/app/commands/command-git-actions.js +381 -0
  9. package/dist/app/commands/command-host.d.ts +4 -0
  10. package/dist/app/commands/command-host.js +5 -2
  11. package/dist/app/commands/command-model-actions.d.ts +1 -0
  12. package/dist/app/commands/command-model-actions.js +57 -35
  13. package/dist/app/commands/command-navigation-actions.d.ts +1 -0
  14. package/dist/app/commands/command-navigation-actions.js +16 -3
  15. package/dist/app/commands/command-registry.d.ts +2 -0
  16. package/dist/app/commands/command-registry.js +15 -1
  17. package/dist/app/commands/command-session-actions.js +9 -3
  18. package/dist/app/commands/reload-context-inventory.d.ts +11 -0
  19. package/dist/app/commands/reload-context-inventory.js +70 -0
  20. package/dist/app/extensions/extension-actions-controller.d.ts +1 -0
  21. package/dist/app/extensions/extension-actions-controller.js +6 -0
  22. package/dist/app/extensions/subagent-catalog-state.d.ts +9 -0
  23. package/dist/app/extensions/subagent-catalog-state.js +23 -0
  24. package/dist/app/input/autocomplete-controller.js +61 -34
  25. package/dist/app/input/input-action-controller.d.ts +2 -0
  26. package/dist/app/input/input-action-controller.js +8 -1
  27. package/dist/app/input/input-controller.d.ts +2 -1
  28. package/dist/app/input/input-controller.js +7 -2
  29. package/dist/app/input/prompt-enhancer-controller.js +53 -35
  30. package/dist/app/input/voice-controller.d.ts +41 -45
  31. package/dist/app/input/voice-controller.js +351 -419
  32. package/dist/app/model/model-usage-controller.js +17 -7
  33. package/dist/app/model/model-usage-status.d.ts +4 -1
  34. package/dist/app/model/model-usage-status.js +270 -46
  35. package/dist/app/popup/menu-items-controller.d.ts +13 -3
  36. package/dist/app/popup/menu-items-controller.js +37 -21
  37. package/dist/app/popup/popup-action-controller.d.ts +12 -2
  38. package/dist/app/popup/popup-action-controller.js +77 -24
  39. package/dist/app/popup/popup-menu-controller.d.ts +36 -14
  40. package/dist/app/popup/popup-menu-controller.js +239 -69
  41. package/dist/app/rendering/dcp-stats.d.ts +9 -4
  42. package/dist/app/rendering/dcp-stats.js +40 -425
  43. package/dist/app/rendering/editor-panels.js +10 -4
  44. package/dist/app/rendering/popup-menu-renderer.d.ts +3 -5
  45. package/dist/app/rendering/popup-menu-renderer.js +42 -37
  46. package/dist/app/rendering/render-controller.js +23 -2
  47. package/dist/app/rendering/status-line-renderer.d.ts +5 -0
  48. package/dist/app/rendering/status-line-renderer.js +41 -5
  49. package/dist/app/rendering/tab-line-renderer.js +26 -20
  50. package/dist/app/runtime.d.ts +12 -1
  51. package/dist/app/runtime.js +120 -12
  52. package/dist/app/screen/mouse-controller.d.ts +2 -0
  53. package/dist/app/screen/mouse-controller.js +17 -7
  54. package/dist/app/screen/status-controller.d.ts +4 -0
  55. package/dist/app/screen/status-controller.js +5 -0
  56. package/dist/app/session/lazy-session-manager.js +34 -0
  57. package/dist/app/session/session-event-controller.d.ts +1 -0
  58. package/dist/app/session/session-event-controller.js +10 -1
  59. package/dist/app/session/session-history.d.ts +1 -0
  60. package/dist/app/session/session-history.js +12 -1
  61. package/dist/app/session/session-lifecycle-controller.d.ts +7 -1
  62. package/dist/app/session/session-lifecycle-controller.js +16 -1
  63. package/dist/app/session/tabs-controller.d.ts +26 -1
  64. package/dist/app/session/tabs-controller.js +454 -147
  65. package/dist/app/subagents/subagents-files.js +60 -1
  66. package/dist/app/subagents/subagents-model.d.ts +1 -0
  67. package/dist/app/subagents/subagents-model.js +18 -2
  68. package/dist/app/subagents/subagents-widget-controller.d.ts +1 -0
  69. package/dist/app/subagents/subagents-widget-controller.js +6 -0
  70. package/dist/app/types.d.ts +16 -1
  71. package/dist/app/workspace/workspace-actions-controller.js +10 -2
  72. package/dist/app/workspace/workspace-undo.d.ts +1 -0
  73. package/dist/app/workspace/workspace-undo.js +1 -0
  74. package/dist/bundled-extensions/question/index.js +9 -1
  75. package/dist/bundled-extensions/question/remote.d.ts +4 -0
  76. package/dist/bundled-extensions/question/remote.js +33 -0
  77. package/dist/bundled-extensions/telegram-connector/bot.d.ts +43 -0
  78. package/dist/bundled-extensions/telegram-connector/bot.js +166 -0
  79. package/dist/bundled-extensions/telegram-connector/config.d.ts +8 -0
  80. package/dist/bundled-extensions/telegram-connector/config.js +87 -0
  81. package/dist/bundled-extensions/telegram-connector/coordinator.d.ts +66 -0
  82. package/dist/bundled-extensions/telegram-connector/coordinator.js +413 -0
  83. package/dist/bundled-extensions/telegram-connector/index.d.ts +3 -0
  84. package/dist/bundled-extensions/telegram-connector/index.js +195 -0
  85. package/dist/bundled-extensions/terminal-bell/index.d.ts +0 -8
  86. package/dist/bundled-extensions/terminal-bell/index.js +0 -76
  87. package/dist/bundled-extensions/workspace-undo/index.d.ts +26 -0
  88. package/dist/bundled-extensions/workspace-undo/index.js +191 -0
  89. package/dist/config.d.ts +21 -2
  90. package/dist/config.js +159 -32
  91. package/dist/default-pix-config.js +25 -5
  92. package/dist/schemas/index.d.ts +1 -0
  93. package/dist/schemas/index.js +1 -0
  94. package/dist/schemas/pi-tools-suite-schema.d.ts +88 -62
  95. package/dist/schemas/pi-tools-suite-schema.js +54 -83
  96. package/dist/schemas/pix-schema.d.ts +19 -2
  97. package/dist/schemas/pix-schema.js +47 -5
  98. package/dist/schemas/tasks-schema.d.ts +18 -0
  99. package/dist/schemas/tasks-schema.js +41 -0
  100. package/docs/concurrency.md +9 -1
  101. package/docs/desktop-mvp.md +22 -6
  102. package/docs/desktop-task-manager.md +148 -84
  103. package/docs/release.md +30 -6
  104. package/external/pi-tools-suite/README.md +197 -84
  105. package/external/pi-tools-suite/docs/evals.md +1 -1
  106. package/external/pi-tools-suite/docs/session-recovery.md +47 -14
  107. package/external/pi-tools-suite/docs/subagent-model-pools.md +48 -30
  108. package/external/pi-tools-suite/docs/ui-qa-subagent.md +440 -0
  109. package/external/pi-tools-suite/package.json +6 -1
  110. package/external/pi-tools-suite/src/antigravity-auth/auth-store.ts +2 -1
  111. package/external/pi-tools-suite/src/antigravity-auth/constants.ts +9 -3
  112. package/external/pi-tools-suite/src/antigravity-auth/headers.ts +41 -3
  113. package/external/pi-tools-suite/src/antigravity-auth/models.ts +94 -21
  114. package/external/pi-tools-suite/src/antigravity-auth/oauth.ts +5 -17
  115. package/external/pi-tools-suite/src/antigravity-auth/payload.ts +72 -7
  116. package/external/pi-tools-suite/src/antigravity-auth/stream.ts +13 -1
  117. package/external/pi-tools-suite/src/async-subagents/agents/frontier-review.md +23 -0
  118. package/external/pi-tools-suite/src/async-subagents/agents/implement.md +1 -1
  119. package/external/pi-tools-suite/src/async-subagents/agents/presets.jsonc +16 -0
  120. package/external/pi-tools-suite/src/async-subagents/agents/research.md +5 -3
  121. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/browser.mjs +346 -0
  122. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/desktop.mjs +1038 -0
  123. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/tui.mjs +759 -0
  124. package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/scripts/browser-qa-runner.mjs +32 -23
  125. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/chrome-devtools/chrome-devtools-provider.mjs +895 -0
  126. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/linux/linux-atspi.py +494 -0
  127. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/macos/macos-accessibility.swift +1085 -0
  128. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/native-terminal/bridge-client.mjs +50 -0
  129. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/native-terminal/native-terminal-host.mjs +501 -0
  130. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/windows/windows-uia.ps1 +454 -0
  131. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-auth.md +114 -0
  132. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-chrome-devtools.md +91 -0
  133. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-playwright.md +145 -0
  134. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser.md +82 -0
  135. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-linux.md +26 -0
  136. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-macos.md +29 -0
  137. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-windows.md +23 -0
  138. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop.md +54 -0
  139. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui-native-terminal.md +59 -0
  140. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui-pty.md +37 -0
  141. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui.md +60 -0
  142. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/scripts/ui-qa-runner.mjs +535 -0
  143. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa.md +75 -0
  144. package/external/pi-tools-suite/src/async-subagents/commands.ts +15 -71
  145. package/external/pi-tools-suite/src/async-subagents/core/activity.ts +33 -0
  146. package/external/pi-tools-suite/src/async-subagents/core/agent-catalog.ts +5 -4
  147. package/external/pi-tools-suite/src/async-subagents/core/agent-strategy.ts +1 -1
  148. package/external/pi-tools-suite/src/async-subagents/core/agents-dir.ts +8 -5
  149. package/external/pi-tools-suite/src/async-subagents/core/browser-qa.ts +16 -2
  150. package/external/pi-tools-suite/src/async-subagents/core/config.ts +160 -327
  151. package/external/pi-tools-suite/src/async-subagents/core/model-selection.ts +2 -1
  152. package/external/pi-tools-suite/src/async-subagents/core/registry.ts +158 -33
  153. package/external/pi-tools-suite/src/async-subagents/core/routing.ts +21 -5
  154. package/external/pi-tools-suite/src/async-subagents/core/spawn.ts +40 -26
  155. package/external/pi-tools-suite/src/async-subagents/core/state.ts +40 -0
  156. package/external/pi-tools-suite/src/async-subagents/core/types.ts +7 -0
  157. package/external/pi-tools-suite/src/async-subagents/core/ultrawork-auto.ts +51 -45
  158. package/external/pi-tools-suite/src/async-subagents/index.ts +69 -5
  159. package/external/pi-tools-suite/src/async-subagents/lib.ts +16 -9
  160. package/external/pi-tools-suite/src/async-subagents/tools/spawn.ts +8 -5
  161. package/external/pi-tools-suite/src/async-subagents/tools/subagents.ts +5 -4
  162. package/external/pi-tools-suite/src/async-subagents/types.ts +1 -0
  163. package/external/pi-tools-suite/src/coding-discipline/index.ts +90 -59
  164. package/external/pi-tools-suite/src/config.ts +55 -1
  165. package/external/pi-tools-suite/src/context-gateway/accounting-log.ts +282 -0
  166. package/external/pi-tools-suite/src/context-gateway/config.ts +77 -3
  167. package/external/pi-tools-suite/src/context-gateway/efficiency.ts +414 -0
  168. package/external/pi-tools-suite/src/context-gateway/enforcement.ts +222 -0
  169. package/external/pi-tools-suite/src/context-gateway/index.ts +206 -19
  170. package/external/pi-tools-suite/src/context-gateway/storeless-capabilities.ts +7 -7
  171. package/external/pi-tools-suite/src/context-gateway/telemetry.ts +101 -28
  172. package/external/pi-tools-suite/src/context-gateway/types.ts +16 -3
  173. package/external/pi-tools-suite/src/context-inventory.ts +99 -0
  174. package/external/pi-tools-suite/src/dcp/auto-compress-budget.ts +39 -4
  175. package/external/pi-tools-suite/src/dcp/auto-compress.ts +128 -49
  176. package/external/pi-tools-suite/src/dcp/commands.ts +32 -156
  177. package/external/pi-tools-suite/src/dcp/compress-tool.ts +177 -46
  178. package/external/pi-tools-suite/src/dcp/compression-blocks.ts +6 -58
  179. package/external/pi-tools-suite/src/dcp/compression-preview.ts +9 -0
  180. package/external/pi-tools-suite/src/dcp/compression-progress.ts +22 -0
  181. package/external/pi-tools-suite/src/dcp/config.ts +114 -17
  182. package/external/pi-tools-suite/src/dcp/conversation-index.ts +36 -9
  183. package/external/pi-tools-suite/src/dcp/diagnostics.ts +41 -0
  184. package/external/pi-tools-suite/src/dcp/fresh-tool-results.ts +38 -0
  185. package/external/pi-tools-suite/src/dcp/index.ts +338 -66
  186. package/external/pi-tools-suite/src/dcp/journal.ts +126 -4
  187. package/external/pi-tools-suite/src/dcp/progress-controller.ts +2 -1
  188. package/external/pi-tools-suite/src/dcp/prompts.ts +83 -192
  189. package/external/pi-tools-suite/src/dcp/protected-continuity.ts +175 -0
  190. package/external/pi-tools-suite/src/dcp/pruner-candidates.ts +93 -3
  191. package/external/pi-tools-suite/src/dcp/pruner-message-ids.ts +6 -10
  192. package/external/pi-tools-suite/src/dcp/pruner-nudge.ts +36 -33
  193. package/external/pi-tools-suite/src/dcp/pruner-tools.ts +6 -3
  194. package/external/pi-tools-suite/src/dcp/pruner.ts +1 -0
  195. package/external/pi-tools-suite/src/dcp/routine-pressure.ts +86 -0
  196. package/external/pi-tools-suite/src/dcp/state.ts +9 -0
  197. package/external/pi-tools-suite/src/dcp/statistics.d.ts +8 -0
  198. package/external/pi-tools-suite/src/dcp/statistics.js +156 -0
  199. package/external/pi-tools-suite/src/default-pi-tools-suite-config.ts +78 -22
  200. package/external/pi-tools-suite/src/index.ts +7 -1
  201. package/external/pi-tools-suite/src/lib/project.ts +36 -1
  202. package/external/pi-tools-suite/src/model-tools/index.ts +10 -7
  203. package/external/pi-tools-suite/src/repo-discovery/index.ts +304 -4
  204. package/external/pi-tools-suite/src/resource-registry/index.ts +2551 -0
  205. package/external/pi-tools-suite/src/session-recovery/index.ts +17 -0
  206. package/external/pi-tools-suite/src/shell-command-policy.ts +219 -0
  207. package/external/pi-tools-suite/src/todo/index.ts +21 -0
  208. package/external/pi-tools-suite/src/todo/todo.ts +19 -1
  209. package/external/pi-tools-suite/src/tool-descriptions.ts +47 -19
  210. package/package.json +10 -9
  211. package/schemas/pi-tools-suite.json +466 -287
  212. package/schemas/pix.json +129 -11
  213. package/schemas/tasks.json +131 -0
  214. package/skills/simplify/SKILL.md +33 -5
  215. package/docs/desktop-markdown-media.md +0 -77
  216. package/external/pi-tools-suite/docs/browser-qa-subagent.md +0 -177
  217. package/external/pi-tools-suite/docs/dcp-emergency-current-turn.md +0 -102
  218. package/external/pi-tools-suite/src/async-subagents/agents/browser-qa.md +0 -598
  219. package/external/pi-tools-suite/src/async-subagents/async-subagents.sample.jsonc +0 -54
  220. package/external/pi-tools-suite/src/skill-installer/index.ts +0 -333
  221. package/skills/playwright-cli/SKILL.md +0 -420
  222. package/skills/playwright-cli/references/element-attributes.md +0 -23
  223. package/skills/playwright-cli/references/playwright-tests.md +0 -50
  224. package/skills/playwright-cli/references/request-mocking.md +0 -87
  225. package/skills/playwright-cli/references/running-code.md +0 -241
  226. package/skills/playwright-cli/references/session-management.md +0 -273
  227. package/skills/playwright-cli/references/spec-driven-testing.md +0 -311
  228. package/skills/playwright-cli/references/storage-state.md +0 -290
  229. package/skills/playwright-cli/references/test-generation.md +0 -142
  230. package/skills/playwright-cli/references/tracing.md +0 -154
  231. package/skills/playwright-cli/references/video-recording.md +0 -147
  232. package/skills/spec-lite/SKILL.md +0 -140
  233. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/examples/qa-auth.example.jsonc +0 -0
  234. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/examples/qa-flow.example.jsonc +0 -0
  235. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/vendor/fflate.LICENSE +0 -0
  236. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/vendor/fflate.mjs +0 -0
@@ -1,142 +0,0 @@
1
- # Test Generation
2
-
3
- Generate Playwright test code automatically as you interact with the browser.
4
-
5
- ## How It Works
6
-
7
- Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
8
- This code appears in the output and can be copied directly into your test files.
9
-
10
- ## Example Workflow
11
-
12
- ```bash
13
- # Choose a unique name, record it as owned by this task, and start the session.
14
- SESSION="testgen-login-$(date +%s)-$$"
15
- playwright-cli -s="$SESSION" open https://example.com/login
16
-
17
- # Take a snapshot to see elements
18
- playwright-cli -s="$SESSION" snapshot
19
- # Output shows: e1 [textbox "Email"], e2 [textbox "Password"], e3 [button "Sign In"]
20
-
21
- # Fill form fields - generates code automatically
22
- playwright-cli -s="$SESSION" fill e1 "user@example.com"
23
- # Ran Playwright code:
24
- # await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
25
-
26
- playwright-cli -s="$SESSION" fill e2 "password123"
27
- # Ran Playwright code:
28
- # await page.getByRole('textbox', { name: 'Password' }).fill('password123');
29
-
30
- playwright-cli -s="$SESSION" click e3
31
- # Ran Playwright code:
32
- # await page.getByRole('button', { name: 'Sign In' }).click();
33
-
34
- # Mandatory on success and errors.
35
- playwright-cli -s="$SESSION" close
36
- playwright-cli list # verify $SESSION is absent
37
- ```
38
-
39
- ## Building a Test File
40
-
41
- Collect the generated code into a Playwright test:
42
-
43
- ```typescript
44
- import { test, expect } from '@playwright/test';
45
-
46
- test('login flow', async ({ page }) => {
47
- // Generated code from playwright-cli session:
48
- await page.goto('https://example.com/login');
49
- await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
50
- await page.getByRole('textbox', { name: 'Password' }).fill('password123');
51
- await page.getByRole('button', { name: 'Sign In' }).click();
52
-
53
- // Add assertions
54
- await expect(page).toHaveURL(/.*dashboard/);
55
- });
56
- ```
57
-
58
- ## Best Practices
59
-
60
- ### 1. Use Semantic Locators
61
-
62
- The generated code uses role-based locators when possible, which are more resilient:
63
-
64
- ```typescript
65
- // Generated (good - semantic)
66
- await page.getByRole('button', { name: 'Submit' }).click();
67
-
68
- // Avoid (fragile - CSS selectors)
69
- await page.locator('#submit-btn').click();
70
- ```
71
-
72
- ### 2. Explore Before Recording
73
-
74
- Take snapshots to understand the page structure before recording actions:
75
-
76
- ```bash
77
- SESSION="testgen-explore-$(date +%s)-$$"
78
- playwright-cli -s="$SESSION" open https://example.com
79
- playwright-cli -s="$SESSION" snapshot
80
- # Review the element structure
81
- playwright-cli -s="$SESSION" click e5
82
- playwright-cli -s="$SESSION" close
83
- playwright-cli list # verify $SESSION is absent
84
- ```
85
-
86
- ### 3. Add Assertions Manually
87
-
88
- Generated code captures actions but not assertions. Add expectations in your test using one of the recommended matchers:
89
-
90
- - `toBeVisible()` — element is rendered and visible
91
- - `toHaveText(text)` — element text content matches
92
- - `toHaveValue(value) / toBeEmpty()` — input/select value matches
93
- - `toBeChecked() / toBeUnchecked()` — checkbox state matches
94
- - `toMatchAriaSnapshot(snapshot)` — page (or locator) matches a partial accessibility snapshot
95
-
96
- Use `playwright-cli generate-locator <target>` to produce the locator expression for the assertion, and the snapshot/eval commands to capture the expected value.
97
-
98
- When asserting text content, make sure that generated locator does not contain text from the element itself. `getByTestId()` or `getByLabel()` usually work well with asserting text. When locator is text-based, prefer `toBeVisible()` instead.
99
-
100
- Snapshot to be matched does not have to contain all the information - only capture what's necessary for the assertion. You can use regular expressions for unstable values.
101
-
102
- ```bash
103
- # Get a stable locator for an element ref to use in the assertion
104
- playwright-cli --raw generate-locator e5
105
- # getByRole('button', { name: 'Submit' })
106
-
107
- # Capture expected text content for toHaveText
108
- playwright-cli --raw eval "el => el.textContent" e5
109
-
110
- # Capture expected input value for toHaveValue/toBeEmpty
111
- playwright-cli --raw eval "el => el.value" e5
112
-
113
- # Capture expected aria snapshot for toMatchAriaSnapshot/toBeChecked
114
- # (whole page, or use a ref to scope to a region)
115
- playwright-cli --raw snapshot
116
- playwright-cli --raw snapshot e5
117
- ```
118
-
119
- ```typescript
120
- // Generated action
121
- await page.getByRole('button', { name: 'Submit' }).click();
122
-
123
- // Manual assertions using the outputs above:
124
- await expect(page.getByRole('alert', { name: 'Success' })).toBeVisible();
125
- await expect(page.getByTestId('main-header')).toHaveText('Welcome, user');
126
- await expect(page.getByRole('textbox', { name: 'Email' })).toHaveValue('user@example.com');
127
- await expect(page.getByRole('checkbox', { name: 'Enable notifications' })).toBeChecked();
128
-
129
- // toMatchAriaSnapshot on the whole page, finds a matching region
130
- await expect(page).toMatchAriaSnapshot(`
131
- - heading "Welcome, user"
132
- - link /\\d+ new messages?/
133
- - button "Sign out"
134
- `);
135
-
136
- // toMatchAriaSnapshot scoped to a region
137
- await expect(page.getByRole('navigation')).toMatchAriaSnapshot(`
138
- - link "Home"
139
- - link /\\d+ new messages?/
140
- - link "Profile"
141
- `);
142
- ```
@@ -1,154 +0,0 @@
1
- # Tracing
2
-
3
- Capture detailed execution traces for debugging and analysis. Traces include DOM snapshots, screenshots, network activity, and console logs.
4
-
5
- ## Basic Usage
6
-
7
- ```bash
8
- SESSION="trace-basic-$(date +%s)-$$" # record as owned before first command
9
- # Start trace recording
10
- playwright-cli -s="$SESSION" tracing-start
11
-
12
- # Perform actions
13
- playwright-cli -s="$SESSION" open https://example.com
14
- playwright-cli -s="$SESSION" click e1
15
- playwright-cli -s="$SESSION" fill e2 "test"
16
-
17
- # Stop trace recording
18
- playwright-cli -s="$SESSION" tracing-stop
19
- playwright-cli -s="$SESSION" close
20
- playwright-cli list # verify $SESSION is absent
21
- ```
22
-
23
- ## Trace Output Files
24
-
25
- When you start tracing, Playwright creates a `traces/` directory with several files:
26
-
27
- ### `trace-{timestamp}.trace`
28
-
29
- **Action log** - The main trace file containing:
30
- - Every action performed (clicks, fills, navigations)
31
- - DOM snapshots before and after each action
32
- - Screenshots at each step
33
- - Timing information
34
- - Console messages
35
- - Source locations
36
-
37
- ### `trace-{timestamp}.network`
38
-
39
- **Network log** - Complete network activity:
40
- - All HTTP requests and responses
41
- - Request headers and bodies
42
- - Response headers and bodies
43
- - Timing (DNS, connect, TLS, TTFB, download)
44
- - Resource sizes
45
- - Failed requests and errors
46
-
47
- ### `resources/`
48
-
49
- **Resources directory** - Cached resources:
50
- - Images, fonts, stylesheets, scripts
51
- - Response bodies for replay
52
- - Assets needed to reconstruct page state
53
-
54
- ## What Traces Capture
55
-
56
- | Category | Details |
57
- |----------|---------|
58
- | **Actions** | Clicks, fills, hovers, keyboard input, navigations |
59
- | **DOM** | Full DOM snapshot before/after each action |
60
- | **Screenshots** | Visual state at each step |
61
- | **Network** | All requests, responses, headers, bodies, timing |
62
- | **Console** | All console.log, warn, error messages |
63
- | **Timing** | Precise timing for each operation |
64
-
65
- ## Use Cases
66
-
67
- ### Debugging Failed Actions
68
-
69
- ```bash
70
- SESSION="trace-failure-$(date +%s)-$$"
71
- playwright-cli -s="$SESSION" tracing-start
72
- playwright-cli -s="$SESSION" open https://app.example.com
73
-
74
- # This click fails - why?
75
- playwright-cli -s="$SESSION" click e5
76
-
77
- playwright-cli -s="$SESSION" tracing-stop
78
- playwright-cli -s="$SESSION" close
79
- playwright-cli list # verify $SESSION is absent
80
- # Open trace to see DOM state when click was attempted
81
- ```
82
-
83
- ### Analyzing Performance
84
-
85
- ```bash
86
- SESSION="trace-performance-$(date +%s)-$$"
87
- playwright-cli -s="$SESSION" tracing-start
88
- playwright-cli -s="$SESSION" open https://slow-site.com
89
- playwright-cli -s="$SESSION" tracing-stop
90
- playwright-cli -s="$SESSION" close
91
- playwright-cli list # verify $SESSION is absent
92
-
93
- # View network waterfall to identify slow resources
94
- ```
95
-
96
- ### Capturing Evidence
97
-
98
- ```bash
99
- # Record a complete user flow for documentation
100
- SESSION="trace-evidence-$(date +%s)-$$"
101
- playwright-cli -s="$SESSION" tracing-start
102
-
103
- playwright-cli -s="$SESSION" open https://app.example.com/checkout
104
- playwright-cli -s="$SESSION" fill e1 "4111111111111111"
105
- playwright-cli -s="$SESSION" fill e2 "12/25"
106
- playwright-cli -s="$SESSION" fill e3 "123"
107
- playwright-cli -s="$SESSION" click e4
108
-
109
- playwright-cli -s="$SESSION" tracing-stop
110
- playwright-cli -s="$SESSION" close
111
- playwright-cli list # verify $SESSION is absent
112
- # Trace shows exact sequence of events
113
- ```
114
-
115
- ## Trace vs Video vs Screenshot
116
-
117
- | Feature | Trace | Video | Screenshot |
118
- |---------|-------|-------|------------|
119
- | **Format** | .trace file | .webm video | .png/.jpeg image |
120
- | **DOM inspection** | Yes | No | No |
121
- | **Network details** | Yes | No | No |
122
- | **Step-by-step replay** | Yes | Continuous | Single frame |
123
- | **File size** | Medium | Large | Small |
124
- | **Best for** | Debugging | Demos | Quick capture |
125
-
126
- ## Best Practices
127
-
128
- ### 1. Start Tracing Before the Problem
129
-
130
- ```bash
131
- # Trace the entire flow, not just the failing step
132
- SESSION="trace-flow-$(date +%s)-$$"
133
- playwright-cli -s="$SESSION" tracing-start
134
- playwright-cli -s="$SESSION" open https://example.com
135
- # ... all steps leading to the issue ...
136
- playwright-cli -s="$SESSION" tracing-stop
137
- playwright-cli -s="$SESSION" close
138
- playwright-cli list # verify $SESSION is absent
139
- ```
140
-
141
- ### 2. Clean Up Old Traces
142
-
143
- Traces can consume significant disk space:
144
-
145
- ```bash
146
- # Remove traces older than 7 days
147
- find .playwright-cli/traces -mtime +7 -delete
148
- ```
149
-
150
- ## Limitations
151
-
152
- - Traces add overhead to automation
153
- - Large traces can consume significant disk space
154
- - Some dynamic content may not replay perfectly
@@ -1,147 +0,0 @@
1
- # Video Recording
2
-
3
- Capture browser automation sessions as video for debugging, documentation, or verification. Produces WebM (VP8/VP9 codec).
4
-
5
- ## Basic Recording
6
-
7
- ```bash
8
- # Choose a unique name and record it as owned before opening.
9
- SESSION="video-demo-$(date +%s)-$$"
10
- # Open browser first
11
- playwright-cli -s="$SESSION" open
12
-
13
- # Start recording
14
- playwright-cli -s="$SESSION" video-start demo.webm
15
-
16
- # Add a chapter marker for section transitions
17
- playwright-cli -s="$SESSION" video-chapter "Getting Started" --description="Opening the homepage" --duration=2000
18
-
19
- # Navigate and perform actions
20
- playwright-cli -s="$SESSION" goto https://example.com
21
- playwright-cli -s="$SESSION" snapshot
22
- playwright-cli -s="$SESSION" click e1
23
-
24
- # Add another chapter
25
- playwright-cli -s="$SESSION" video-chapter "Filling Form" --description="Entering test data" --duration=2000
26
- playwright-cli -s="$SESSION" fill e2 "test input"
27
-
28
- # Stop and save
29
- playwright-cli -s="$SESSION" video-stop
30
- playwright-cli -s="$SESSION" close
31
- playwright-cli list # verify $SESSION is absent
32
- ```
33
-
34
- ## Best Practices
35
-
36
- ### 1. Use Descriptive Filenames
37
-
38
- ```bash
39
- # Include context in filename
40
- playwright-cli video-start recordings/login-flow-2024-01-15.webm
41
- playwright-cli video-start recordings/checkout-test-run-42.webm
42
- ```
43
-
44
- ### 2. Record entire hero scripts.
45
-
46
- When recording a video for the user or as a proof of work, it is best to create a code snippet and execute it with run-code.
47
- It allows pulling appropriate pauses between the actions and annotating the video. There are new Playwright APIs for that.
48
-
49
- 1) Perform scenario using CLI and take note of all locators and actions. You'll need those locators to request their bounding boxes for highlight.
50
- 2) Create a file with the intended script for video (below). Use pressSequentially w/ delay for nice typing, make reasonable pauses.
51
- 3) In the task-owned unique session, use `playwright-cli -s="$SESSION" run-code --filename your-script.js`, then close that exact session and verify it is absent from `playwright-cli list`, including on errors.
52
-
53
- **Important**: Overlays are `pointer-events: none` — they do not interfere with page interactions. You can safely keep sticky overlays visible while clicking, filling, or performing any actions on the page.
54
-
55
- ```js
56
- async page => {
57
- await page.screencast.start({ path: 'video.webm', size: { width: 1280, height: 800 } });
58
- await page.goto('https://demo.playwright.dev/todomvc');
59
-
60
- // Show a chapter card — blurs the page and shows a dialog.
61
- // Blocks until duration expires, then auto-removes.
62
- // Use this for simple use cases, but always feel free to hand-craft your own beautiful
63
- // overlay via await page.screencast.showOverlay().
64
- await page.screencast.showChapter('Adding Todo Items', {
65
- description: 'We will add several items to the todo list.',
66
- duration: 2000,
67
- });
68
-
69
- // Perform action
70
- await page.getByRole('textbox', { name: 'What needs to be done?' }).pressSequentially('Walk the dog', { delay: 60 });
71
- await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');
72
- await page.waitForTimeout(1000);
73
-
74
- // Show next chapter
75
- await page.screencast.showChapter('Verifying Results', {
76
- description: 'Checking the item appeared in the list.',
77
- duration: 2000,
78
- });
79
-
80
- // Add a sticky annotation that stays while you perform actions.
81
- // Overlays are pointer-events: none, so they won't block clicks.
82
- const annotation = await page.screencast.showOverlay(`
83
- <div style="position: absolute; top: 8px; right: 8px;
84
- padding: 6px 12px; background: rgba(0,0,0,0.7);
85
- border-radius: 8px; font-size: 13px; color: white;">
86
- ✓ Item added successfully
87
- </div>
88
- `);
89
-
90
- // Perform more actions while the annotation is visible
91
- await page.getByRole('textbox', { name: 'What needs to be done?' }).pressSequentially('Buy groceries', { delay: 60 });
92
- await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');
93
- await page.waitForTimeout(1500);
94
-
95
- // Remove the annotation when done
96
- await annotation.dispose();
97
-
98
- // You can also highlight relevant locators and provide contextual annotations.
99
- const bounds = await page.getByText('Walk the dog').boundingBox();
100
- await page.screencast.showOverlay(`
101
- <div style="position: absolute;
102
- top: ${bounds.y}px;
103
- left: ${bounds.x}px;
104
- width: ${bounds.width}px;
105
- height: ${bounds.height}px;
106
- border: 1px solid red;">
107
- </div>
108
- <div style="position: absolute;
109
- top: ${bounds.y + bounds.height + 5}px;
110
- left: ${bounds.x + bounds.width / 2}px;
111
- transform: translateX(-50%);
112
- padding: 6px;
113
- background: #808080;
114
- border-radius: 10px;
115
- font-size: 14px;
116
- color: white;">Check it out, it is right above this text
117
- </div>
118
- `, { duration: 2000 });
119
-
120
- await page.screencast.stop();
121
- }
122
- ```
123
-
124
- Embrace creativity, overlays are powerful.
125
-
126
- ### Overlay API Summary
127
-
128
- | Method | Use Case |
129
- |--------|----------|
130
- | `page.screencast.showChapter(title, { description?, duration?, styleSheet? })` | Full-screen chapter card with blurred backdrop — ideal for section transitions |
131
- | `page.screencast.showOverlay(html, { duration? })` | Custom HTML overlay — use for callouts, labels, highlights |
132
- | `disposable.dispose()` | Remove a sticky overlay added without duration |
133
- | `page.screencast.hideOverlays()` / `page.screencast.showOverlays()` | Temporarily hide/show all overlays |
134
-
135
- ## Tracing vs Video
136
-
137
- | Feature | Video | Tracing |
138
- |---------|-------|---------|
139
- | Output | WebM file | Trace file (viewable in Trace Viewer) |
140
- | Shows | Visual recording | DOM snapshots, network, console, actions |
141
- | Use case | Demos, documentation | Debugging, analysis |
142
- | Size | Larger | Smaller |
143
-
144
- ## Limitations
145
-
146
- - Recording adds slight overhead to automation
147
- - Large recordings can consume significant disk space
@@ -1,140 +0,0 @@
1
- ---
2
- name: spec-lite
3
- description: Use this skill for creating, updating, or checking lightweight specs for existing code, risky changes, public behavior, bug fixes, or spec-code drift. Use it before or during non-trivial changes that touch security, data, persistence, public APIs, CLI/UI contracts, integrations, concurrency, architecture, or user-visible behavior with edge cases. Do not use it for trivial local edits.
4
- argument-hint: "behavior, change, bug, or spec path to document/check"
5
- ---
6
-
7
- # Spec Lite
8
-
9
- Use the lightest spec process that preserves correctness. The goal is to make behavior and risk explicit without turning every change into a heavyweight design process.
10
-
11
- ## Core rules
12
-
13
- - Do not change production code unless the user explicitly asks for implementation.
14
- - Specs describe either current behavior or intended behavior; label which one clearly.
15
- - Do not invent behavior. If evidence is missing or ambiguous, mark uncertainty explicitly.
16
- - Prefer compact specs over exhaustive documents.
17
- - Load only relevant files, tests, schemas, docs, migrations, entrypoints, and existing specs.
18
- - Do not load all specs by default.
19
- - Keep the spec close to the codebase convention when a specs directory, ADR folder, or feature-doc pattern already exists.
20
-
21
- ## When to create or update a spec
22
-
23
- Create or update a lightweight spec when the work affects any of these areas:
24
-
25
- - security, privacy, auth, or permissions;
26
- - data, schemas, migrations, persistence, or file formats;
27
- - public APIs, CLI behavior, UI contracts, events, or other external contracts;
28
- - external integrations;
29
- - payments, destructive operations, or irreversible workflows;
30
- - background jobs, concurrency, cancellation, retries, or async behavior;
31
- - cross-cutting architecture;
32
- - user-visible behavior with non-trivial edge cases;
33
- - bug fixes where expected behavior, compatibility, or regression risk is unclear;
34
- - suspected drift between existing specs/docs/tests and code.
35
-
36
- Do not require a spec for trivial local edits, mechanical renames, formatting-only changes, or obvious one-file fixes with no broader behavior impact.
37
-
38
- ## As-is spec workflow
39
-
40
- Use this workflow for existing code or spec-code drift checks:
41
-
42
- 1. Identify the narrow behavior or contract to document.
43
- 2. Inspect relevant code, tests, docs, schemas, migrations, and entrypoints.
44
- 3. Identify current behavior and known gaps.
45
- 4. Mark claims using evidence labels:
46
- - confirmed by code;
47
- - confirmed by tests;
48
- - confirmed by docs;
49
- - inferred;
50
- - unknown.
51
- 5. Create or update a compact as-is spec.
52
- 6. If drift is found, report it separately from confirmed behavior.
53
-
54
- ## Change spec workflow
55
-
56
- Use this workflow before risky implementation:
57
-
58
- 1. Define the goal.
59
- 2. Define scope and non-goals.
60
- 3. State expected behavior.
61
- 4. List affected contracts.
62
- 5. List risks, compatibility concerns, and migration concerns if any.
63
- 6. Define a verification path.
64
- 7. Then implement only the scoped change, if implementation was requested.
65
-
66
- ## Spec template
67
-
68
- Use this template by default. Remove sections that are genuinely irrelevant, but keep `Type`, `Goal`, `Behavior`, `Related files`, `Verification`, and `Evidence` when possible.
69
-
70
- ```markdown
71
- # Spec: <name>
72
-
73
- ## Type
74
-
75
- As-is | Change
76
-
77
- ## Goal
78
-
79
- ...
80
-
81
- ## Scope
82
-
83
- ...
84
-
85
- ## Non-goals
86
-
87
- ...
88
-
89
- ## Behavior
90
-
91
- ...
92
-
93
- ## Contracts
94
-
95
- Inputs, outputs, APIs, CLI, UI, events, files, schemas.
96
-
97
- ## Invariants
98
-
99
- ...
100
-
101
- ## Edge cases
102
-
103
- ...
104
-
105
- ## Side effects
106
-
107
- ...
108
-
109
- ## Related files
110
-
111
- ...
112
-
113
- ## Verification
114
-
115
- ...
116
-
117
- ## Risks / unknowns
118
-
119
- ...
120
-
121
- ## Evidence
122
-
123
- - Confirmed by code:
124
- - Confirmed by tests:
125
- - Confirmed by docs:
126
- - Inferred:
127
- - Unknown:
128
- ```
129
-
130
- ## Output guidance
131
-
132
- When the user asks only for a spec, write or update the spec and summarize:
133
-
134
- - spec path;
135
- - whether it is as-is or change-oriented;
136
- - strongest evidence sources;
137
- - important unknowns or drift;
138
- - whether production code was left untouched.
139
-
140
- When the user asks for implementation too, keep the spec scoped and practical, then implement only after the expected behavior and verification path are clear.