@guanlin4924/devflow-pi 0.1.93 → 0.1.95

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 (369) hide show
  1. package/README.md +10 -10
  2. package/node_modules/@playwright/test/LICENSE +202 -0
  3. package/node_modules/@playwright/test/NOTICE +5 -0
  4. package/node_modules/@playwright/test/README.md +318 -0
  5. package/node_modules/@playwright/test/cli.js +19 -0
  6. package/node_modules/@playwright/test/index.d.ts +18 -0
  7. package/node_modules/@playwright/test/index.js +17 -0
  8. package/node_modules/@playwright/test/index.mjs +18 -0
  9. package/node_modules/@playwright/test/package.json +35 -0
  10. package/node_modules/@playwright/test/reporter.d.ts +17 -0
  11. package/node_modules/@playwright/test/reporter.js +17 -0
  12. package/node_modules/@playwright/test/reporter.mjs +17 -0
  13. package/node_modules/playwright/LICENSE +202 -0
  14. package/node_modules/playwright/NOTICE +5 -0
  15. package/node_modules/playwright/README.md +318 -0
  16. package/node_modules/playwright/ThirdPartyNotices.txt +14 -0
  17. package/node_modules/playwright/cli.js +19 -0
  18. package/node_modules/playwright/index.d.ts +17 -0
  19. package/node_modules/playwright/index.js +17 -0
  20. package/node_modules/playwright/index.mjs +18 -0
  21. package/node_modules/playwright/jsx-runtime.js +42 -0
  22. package/node_modules/playwright/jsx-runtime.mjs +21 -0
  23. package/node_modules/playwright/lib/agents/agentParser.js +89 -0
  24. package/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
  25. package/node_modules/playwright/lib/agents/generateAgents.js +395 -0
  26. package/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
  27. package/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
  28. package/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
  29. package/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
  30. package/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +56 -0
  31. package/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
  32. package/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +74 -0
  33. package/node_modules/playwright/lib/cli/reportActions.js +78 -0
  34. package/node_modules/playwright/lib/cli/testActions.js +214 -0
  35. package/node_modules/playwright/lib/common/index.js +2923 -0
  36. package/node_modules/playwright/lib/common/index.js.txt +34 -0
  37. package/node_modules/playwright/lib/errorContext.js +129 -0
  38. package/node_modules/playwright/lib/globals.js +58 -0
  39. package/node_modules/playwright/lib/index.js +815 -0
  40. package/node_modules/playwright/lib/isomorphic.js +260 -0
  41. package/node_modules/playwright/lib/isomorphic.js.txt +9 -0
  42. package/node_modules/playwright/lib/loader/loaderProcessEntry.js +34 -0
  43. package/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt +9 -0
  44. package/node_modules/playwright/lib/matchers/expect.js +13490 -0
  45. package/node_modules/playwright/lib/matchers/expect.js.LICENSE +640 -0
  46. package/node_modules/playwright/lib/matchers/expect.js.txt +67 -0
  47. package/node_modules/playwright/lib/mcp/test/browserBackend.js +135 -0
  48. package/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
  49. package/node_modules/playwright/lib/mcp/test/plannerTools.js +150 -0
  50. package/node_modules/playwright/lib/mcp/test/seed.js +82 -0
  51. package/node_modules/playwright/lib/mcp/test/streams.js +44 -0
  52. package/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
  53. package/node_modules/playwright/lib/mcp/test/testContext.js +306 -0
  54. package/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
  55. package/node_modules/playwright/lib/mcp/test/testTools.js +98 -0
  56. package/node_modules/playwright/lib/package.js +47 -0
  57. package/node_modules/playwright/lib/program.js +241 -0
  58. package/node_modules/playwright/lib/runner/index.js +8527 -0
  59. package/node_modules/playwright/lib/runner/index.js.txt +61 -0
  60. package/node_modules/playwright/lib/transform/babelBundle.js +72274 -0
  61. package/node_modules/playwright/lib/transform/babelBundle.js.LICENSE +2384 -0
  62. package/node_modules/playwright/lib/transform/babelBundle.js.txt +325 -0
  63. package/node_modules/playwright/lib/transform/esmLoader.js +8054 -0
  64. package/node_modules/playwright/lib/transform/esmLoader.js.LICENSE +355 -0
  65. package/node_modules/playwright/lib/transform/esmLoader.js.txt +60 -0
  66. package/node_modules/playwright/lib/util.js +373 -0
  67. package/node_modules/playwright/lib/worker/workerProcessEntry.js +1861 -0
  68. package/node_modules/playwright/lib/worker/workerProcessEntry.js.txt +19 -0
  69. package/node_modules/playwright/package.json +55 -0
  70. package/node_modules/playwright/test.d.ts +18 -0
  71. package/node_modules/playwright/test.js +24 -0
  72. package/node_modules/playwright/test.mjs +35 -0
  73. package/node_modules/playwright/types/test.d.ts +11074 -0
  74. package/node_modules/playwright/types/testReporter.d.ts +950 -0
  75. package/node_modules/playwright-core/LICENSE +202 -0
  76. package/node_modules/playwright-core/NOTICE +5 -0
  77. package/node_modules/playwright-core/README.md +3 -0
  78. package/node_modules/playwright-core/ThirdPartyNotices.txt +13 -0
  79. package/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
  80. package/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
  81. package/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
  82. package/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
  83. package/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
  84. package/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
  85. package/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
  86. package/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
  87. package/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
  88. package/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
  89. package/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
  90. package/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
  91. package/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
  92. package/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
  93. package/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
  94. package/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
  95. package/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
  96. package/node_modules/playwright-core/browsers.json +52 -0
  97. package/node_modules/playwright-core/cli.js +21 -0
  98. package/node_modules/playwright-core/index.d.ts +17 -0
  99. package/node_modules/playwright-core/index.js +17 -0
  100. package/node_modules/playwright-core/index.mjs +28 -0
  101. package/node_modules/playwright-core/lib/bootstrap.js +88 -0
  102. package/node_modules/playwright-core/lib/coreBundle.js +75813 -0
  103. package/node_modules/playwright-core/lib/entry/cliDaemon.js +5 -0
  104. package/node_modules/playwright-core/lib/entry/dashboardApp.js +3 -0
  105. package/node_modules/playwright-core/lib/entry/mcp.js +10 -0
  106. package/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +3 -0
  107. package/node_modules/playwright-core/lib/package.js +50 -0
  108. package/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
  109. package/node_modules/playwright-core/lib/server/electron/loader.js +116 -0
  110. package/node_modules/playwright-core/lib/serverRegistry.js +1939 -0
  111. package/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +65 -0
  112. package/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +141 -0
  113. package/node_modules/playwright-core/lib/tools/cli-client/cli.js +6 -0
  114. package/node_modules/playwright-core/lib/tools/cli-client/help.json +721 -0
  115. package/node_modules/playwright-core/lib/tools/cli-client/minimist.js +128 -0
  116. package/node_modules/playwright-core/lib/tools/cli-client/output.js +351 -0
  117. package/node_modules/playwright-core/lib/tools/cli-client/program.js +418 -0
  118. package/node_modules/playwright-core/lib/tools/cli-client/registry.js +180 -0
  119. package/node_modules/playwright-core/lib/tools/cli-client/session.js +259 -0
  120. package/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
  121. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/SKILL.md +425 -0
  122. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/element-attributes.md +23 -0
  123. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md +39 -0
  124. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/request-mocking.md +87 -0
  125. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/running-code.md +241 -0
  126. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/session-management.md +225 -0
  127. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/storage-state.md +275 -0
  128. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/test-generation.md +433 -0
  129. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/tracing.md +139 -0
  130. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/video-recording.md +143 -0
  131. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/SKILL.md +136 -0
  132. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +144 -0
  133. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/migration.md +89 -0
  134. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/react.md +69 -0
  135. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
  136. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/vue.md +77 -0
  137. package/node_modules/playwright-core/lib/tools/skills/playwright-trace/SKILL.md +174 -0
  138. package/node_modules/playwright-core/lib/tools/utils/extension.js +112 -0
  139. package/node_modules/playwright-core/lib/tools/utils/socketConnection.js +108 -0
  140. package/node_modules/playwright-core/lib/utilsBundle.js +85357 -0
  141. package/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +1890 -0
  142. package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
  143. package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule-CQ8RZGBm.js +32 -0
  144. package/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  145. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
  146. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
  147. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
  148. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
  149. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
  150. package/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
  151. package/node_modules/playwright-core/lib/vite/dashboard/index.html +29 -0
  152. package/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +24 -0
  153. package/node_modules/playwright-core/lib/vite/htmlReport/index.html +16 -0
  154. package/node_modules/playwright-core/lib/vite/htmlReport/report.css +2 -0
  155. package/node_modules/playwright-core/lib/vite/htmlReport/report.js +32 -0
  156. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
  157. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-CVQWJZAA.js +32 -0
  158. package/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  159. package/node_modules/playwright-core/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
  160. package/node_modules/playwright-core/lib/vite/recorder/assets/index-hrlLqLtq.js +129 -0
  161. package/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
  162. package/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
  163. package/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BbkfBe3n.js +32 -0
  164. package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-Ds6CBOo0.js +182 -0
  165. package/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
  166. package/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-DywYcAf8.js +7 -0
  167. package/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
  168. package/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  169. package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.Bqk9acqE.css +1 -0
  170. package/node_modules/playwright-core/lib/vite/traceViewer/index.B4cLoZK3.js +1 -0
  171. package/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
  172. package/node_modules/playwright-core/lib/vite/traceViewer/index.html +44 -0
  173. package/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
  174. package/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
  175. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
  176. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +10 -0
  177. package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +4 -0
  178. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CU5KtEkS.js +5 -0
  179. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CyMfwkXJ.css +1 -0
  180. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +18 -0
  181. package/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
  182. package/node_modules/playwright-core/lib/webp_codec.LICENSE +173 -0
  183. package/node_modules/playwright-core/lib/webp_codec.wasm +0 -0
  184. package/node_modules/playwright-core/lib/xdg-open +1267 -0
  185. package/node_modules/playwright-core/package.json +34 -0
  186. package/node_modules/playwright-core/types/protocol.d.ts +24645 -0
  187. package/node_modules/playwright-core/types/structs.d.ts +52 -0
  188. package/node_modules/playwright-core/types/types.d.ts +26632 -0
  189. package/package.json +12 -2
  190. package/plugins/devflow-core/extensions/devflow-core.ts +518 -40
  191. package/plugins/devflow-core/runtime/hooks/context_sync_gate.py +3 -3
  192. package/plugins/devflow-core/runtime/hooks/hook_common.py +334 -11
  193. package/plugins/devflow-core/runtime/hooks/index_gate.py +29 -16
  194. package/plugins/devflow-core/runtime/hooks/start.py +13 -13
  195. package/plugins/devflow-core/skills/wireframe-proposal/SKILL.md +2 -2
  196. package/plugins/devflow-core/skills/wireframe-validate/SKILL.md +4 -4
  197. package/plugins/devflow-core/skills/workflow-orchestrator/SKILL.md +19 -19
  198. package/plugins/devflow-core/skills/workflow-orchestrator/agents/openai.yaml +2 -2
  199. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/acceptance_test_runner.py +412 -76
  200. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/advance_state.rb +60 -9
  201. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/api_test_matrix.py +2 -2
  202. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/approval_pins.py +433 -0
  203. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/approval_store.py +137 -0
  204. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/architecture_assessment.rb +1 -1
  205. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/architecture_brief.rb +1 -1
  206. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/architecture_feasibility.rb +1 -1
  207. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/business_invalidation.rb +5 -5
  208. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/business_model_commit.rb +4 -4
  209. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/business_model_validate.py +1 -1
  210. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/business_source_resolver.rb +4 -4
  211. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/checker_adapter.rb +7 -7
  212. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/control_io.rb +51 -7
  213. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/cross_track_consistency_check.rb +1 -1
  214. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/dsl_coverage.py +87 -0
  215. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/dsl_v1.py +318 -0
  216. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/environment_profile.py +134 -0
  217. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/execution_contract.rb +7 -6
  218. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/execution_surface.py +138 -0
  219. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/gate_runtime.rb +3 -3
  220. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/init_state.rb +5 -5
  221. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/init_workflow.rb +5 -5
  222. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/inspect_state.rb +13 -13
  223. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/machine_evidence.rb +3 -3
  224. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/manage_lessons.rb +7 -7
  225. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/parallel_recover.rb +2 -2
  226. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/parallel_run.rb +3 -3
  227. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/phase_ownership.rb +6 -6
  228. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/playwright_adapter.py +515 -0
  229. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/repair_control_plane.rb +1 -1
  230. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/requirement_coverage.rb +1 -1
  231. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/requirement_graph.rb +3 -3
  232. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/review_preflight.py +3 -3
  233. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/review_run.py +18 -18
  234. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/runtime_context_collector.rb +3 -3
  235. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/session_rollover.rb +4 -4
  236. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/static_runtime_context_collector.rb +2 -2
  237. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/sync_artifacts.rb +5 -5
  238. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/tc_hash.py +132 -0
  239. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/tdd_evidence.py +3 -3
  240. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/test_command_policy.py +104 -10
  241. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/test_task_binding_check.py +3 -3
  242. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/update_triage_route.rb +3 -3
  243. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/validate_state.rb +19 -6
  244. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/wireframe_commit.rb +5 -5
  245. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/wireframe_validate.py +1 -1
  246. package/plugins/devflow-core/skills/workflow-orchestrator/templates/acceptance-remediation.yaml +12 -12
  247. package/plugins/devflow-core/skills/workflow-orchestrator/templates/feature-development.yaml +201 -222
  248. package/plugins/devflow-core/skills/workflow-pipeline/SKILL.md +6 -4
  249. package/plugins/devflow-core/skills/workflow-pipeline/references/pipeline-flow.md +68 -140
  250. package/plugins/devflow-core/skills/workflow-project-context/SKILL.md +14 -14
  251. package/plugins/devflow-core/skills/workflow-project-context/assets/agents-md-template.md +7 -7
  252. package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-backend-spec-template.md +4 -4
  253. package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-frontend-spec-template.md +4 -4
  254. package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-navigation-template.md +1 -1
  255. package/plugins/devflow-core/skills/workflow-project-context/assets/context-domain-index-template.md +4 -4
  256. package/plugins/devflow-core/skills/workflow-project-context/assets/context-spec-index-template.md +10 -10
  257. package/plugins/devflow-core/skills/workflow-project-context/assets/execution-contract-template.md +2 -2
  258. package/plugins/devflow-core/skills/workflow-project-context/assets/navigation-index-template.md +18 -18
  259. package/plugins/devflow-core/skills/workflow-project-context/assets/project-initialization-template.md +32 -32
  260. package/plugins/devflow-core/skills/workflow-project-context/assets/rules-index-template.md +30 -30
  261. package/plugins/devflow-core/skills/workflow-project-context/assets/state-template.md +7 -7
  262. package/plugins/devflow-core/skills/workflow-project-context/references/navigation-guide.md +37 -37
  263. package/plugins/devflow-core/skills/workflow-project-context/scripts/validate_initialization.py +16 -16
  264. package/plugins/devflow-core/skills/workflow-project-context/scripts/validate_initialization_database.py +1 -1
  265. package/plugins/devflow-design/skills/workflow-api-call-guide/SKILL.md +4 -4
  266. package/plugins/devflow-design/skills/workflow-api-contract/SKILL.md +8 -8
  267. package/plugins/devflow-design/skills/workflow-api-supplement/SKILL.md +5 -5
  268. package/plugins/devflow-design/skills/workflow-architecture-feasibility/SKILL.md +1 -1
  269. package/plugins/devflow-design/skills/workflow-backend-tech-spec/SKILL.md +39 -39
  270. package/plugins/devflow-design/skills/workflow-backend-tech-spec/assets/backend-spec-template.md +10 -10
  271. package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/affected-module-exploration.md +2 -2
  272. package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/code-explore-guide.md +1 -1
  273. package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/project-rule-contract.md +20 -20
  274. package/plugins/devflow-design/skills/workflow-design-rule-pack/SKILL.md +8 -8
  275. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/index.md +3 -3
  276. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/accessibility.md +2 -2
  277. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/component-library.md +2 -2
  278. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/design-systems.md +1 -1
  279. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/responsive-grid.md +2 -2
  280. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/stack-guidelines.md +6 -6
  281. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/ux-patterns.md +2 -2
  282. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tokens/project-tokens.md +1 -1
  283. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/SKILL.md +12 -12
  284. package/plugins/devflow-design/skills/workflow-design-rule-pack/scripts/install.py +2 -2
  285. package/plugins/devflow-design/skills/workflow-feature-breakdown/SKILL.md +30 -30
  286. package/plugins/devflow-design/skills/workflow-feature-breakdown/assets/output-template.md +2 -2
  287. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/SKILL.md +41 -41
  288. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/assets/frontend-spec-template.md +15 -15
  289. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/affected-module-exploration.md +2 -2
  290. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/project-rule-contract.md +25 -25
  291. package/plugins/devflow-design/skills/workflow-integration-verify/SKILL.md +13 -13
  292. package/plugins/devflow-design/skills/workflow-ui-spec/SKILL.md +23 -23
  293. package/plugins/devflow-design/skills/workflow-ui-spec/assets/ui-spec-template.md +3 -3
  294. package/plugins/devflow-implementation/agents/implementation-worker.md +2 -2
  295. package/plugins/devflow-implementation/skills/workflow-bug-fix/SKILL.md +9 -9
  296. package/plugins/devflow-implementation/skills/workflow-bug-fix/references/lesson-format.md +2 -2
  297. package/plugins/devflow-implementation/skills/workflow-bug-fix/references/root-cause-ladder.md +1 -1
  298. package/plugins/devflow-implementation/skills/workflow-change-plan/SKILL.md +17 -17
  299. package/plugins/devflow-implementation/skills/workflow-change-plan/references/code-conventions.md +1 -1
  300. package/plugins/devflow-implementation/skills/workflow-change-plan/references/output-template.md +3 -3
  301. package/plugins/devflow-implementation/skills/workflow-change-plan/references/project-rule-contract.md +16 -16
  302. package/plugins/devflow-implementation/skills/workflow-execute-phase/SKILL.md +38 -38
  303. package/plugins/devflow-implementation/skills/workflow-execute-phase/references/execute-phase.md +4 -2
  304. package/plugins/devflow-intel/agents/project-scout.md +1 -1
  305. package/plugins/devflow-intel/extensions/devflow-intel.ts +20 -19
  306. package/plugins/devflow-intel/skills/code-index-query/SKILL.md +6 -6
  307. package/plugins/devflow-intel/skills/workflow-code-index/SKILL.md +12 -12
  308. package/plugins/devflow-intel/skills/workflow-code-index/references/discovery.md +2 -2
  309. package/plugins/devflow-intel/skills/workflow-code-index/references/query-guide.md +1 -1
  310. package/plugins/devflow-intel/skills/workflow-code-index/scripts/code_index.py +31 -12
  311. package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/discovery.py +2 -2
  312. package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/scanner.py +4 -1
  313. package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/project_binding_check.py +4 -4
  314. package/plugins/devflow-intel/skills/workflow-context-sync/SKILL.md +14 -14
  315. package/plugins/devflow-intel/skills/workflow-context-sync/scripts/context_sync_cursor.py +2 -2
  316. package/plugins/devflow-intel/skills/workflow-update-navigation/SKILL.md +26 -26
  317. package/plugins/devflow-intel/skills/workflow-update-navigation/references/incremental-update-guide.md +2 -2
  318. package/plugins/devflow-quality/runtime/playwright/devflow-test-dsl-v1.schema.json +872 -0
  319. package/plugins/devflow-quality/runtime/playwright/playwright.config.mjs +46 -0
  320. package/plugins/devflow-quality/runtime/playwright/reporter.mjs +311 -0
  321. package/plugins/devflow-quality/runtime/playwright/runner.spec.mjs +1308 -0
  322. package/plugins/devflow-quality/runtime/playwright/runtime-manifest.json +11 -0
  323. package/plugins/devflow-quality/skills/code-review/SKILL.md +12 -12
  324. package/plugins/devflow-quality/skills/code-review/references/spec-checklist.md +1 -1
  325. package/plugins/devflow-quality/skills/workflow-acceptance-test-design/SKILL.md +11 -8
  326. package/plugins/devflow-quality/skills/workflow-gen-test-guide/SKILL.md +6 -6
  327. package/plugins/devflow-quality/skills/workflow-gen-test-guide/legacy/SKILL.md +14 -14
  328. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/SKILL.md +82 -69
  329. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/api-mainflow-rules.md +20 -15
  330. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/codebase-discovery.md +12 -10
  331. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/intermediate-format.md +115 -192
  332. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/mainflow-selection.md +27 -23
  333. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/project-dsl-contract.md +78 -153
  334. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/ui-mainflow-rules.md +36 -83
  335. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/compile_dsl.py +497 -556
  336. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/discover_codebases.py +2 -2
  337. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/export_legacy_testagent.py +647 -0
  338. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/normalize_case_payloads.py +10 -3
  339. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/validate_case_payloads.py +165 -275
  340. package/plugins/devflow-quality/skills/workflow-human-acceptance/SKILL.md +61 -0
  341. package/plugins/devflow-quality/skills/workflow-release-closeout/SKILL.md +18 -18
  342. package/plugins/devflow-quality/skills/workflow-run-acceptance-tests/SKILL.md +20 -14
  343. package/plugins/devflow-requirements/skills/requirement-feasibility-review/SKILL.md +1 -1
  344. package/plugins/devflow-requirements/skills/workflow-demand-clarify/SKILL.md +10 -10
  345. package/plugins/devflow-requirements/skills/workflow-domain-modeling/SKILL.md +25 -25
  346. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/SKILL.md +49 -49
  347. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/assets/baseline-template.md +22 -22
  348. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/antipatterns.md +3 -3
  349. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/challenge-review-guide.md +3 -3
  350. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/project-context-guide.md +11 -11
  351. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/questioning.md +1 -1
  352. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/requirement-review-checklist.md +4 -4
  353. package/plugins/devflow-requirements/skills/workflow-requirement-triage/SKILL.md +16 -16
  354. package/plugins/devflow-requirements/skills/workflow-wayfinder/SKILL.md +6 -6
  355. package/src/approval-store.ts +340 -0
  356. package/src/cli.ts +15 -0
  357. package/src/constants.ts +1 -1
  358. package/src/doctor.ts +259 -2
  359. package/src/initialization-store.ts +51 -3
  360. package/src/paths.ts +12 -1
  361. package/src/project-context.ts +60 -15
  362. package/src/project-documents.ts +61 -61
  363. package/src/project-initializer.ts +9 -8
  364. package/src/project-layout.ts +217 -0
  365. package/src/runtime.ts +3 -3
  366. package/templates/commands/start.md +4 -4
  367. package/templates/omp/AGENTS.md +1 -1
  368. package/templates/omp/hook-config.json +13 -7
  369. package/templates/omp/index-policy.json +8 -8
@@ -0,0 +1,418 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var program_exports = {};
30
+ __export(program_exports, {
31
+ calculateSha1: () => calculateSha1,
32
+ program: () => program
33
+ });
34
+ module.exports = __toCommonJS(program_exports);
35
+ var import_child_process = require("child_process");
36
+ var import_crypto = __toESM(require("crypto"));
37
+ var import_os = __toESM(require("os"));
38
+ var import_path = __toESM(require("path"));
39
+ var import_channelSessions = require("./channelSessions");
40
+ var import_output = require("./output");
41
+ var import_registry = require("./registry");
42
+ var import_session = require("./session");
43
+ var import_package = require("../../package");
44
+ var import_serverRegistry = require("../../serverRegistry");
45
+ var import_minimist = require("./minimist");
46
+ const globalOptions = [
47
+ "json",
48
+ "raw",
49
+ "session"
50
+ ];
51
+ const booleanOptions = [
52
+ "all",
53
+ "g",
54
+ "help",
55
+ "json",
56
+ "raw",
57
+ "version"
58
+ ];
59
+ async function program(options) {
60
+ const clientInfo = (0, import_registry.createClientInfo)();
61
+ const help = require((0, import_package.libPath)("tools", "cli-client", "help.json"));
62
+ const argv = process.argv.slice(2);
63
+ const boolean = [...help.booleanOptions, ...booleanOptions];
64
+ const args = (0, import_minimist.minimist)(argv, { boolean, string: ["_"] });
65
+ if (args.s) {
66
+ args.session = args.s;
67
+ delete args.s;
68
+ }
69
+ if (args.g) {
70
+ args.global = true;
71
+ delete args.g;
72
+ }
73
+ const output = args.json ? new import_output.JsonOutput() : new import_output.TextOutput();
74
+ const commandName = args._?.[0];
75
+ if (args.version || args.v) {
76
+ output.version(options?.embedderVersion ?? clientInfo.version);
77
+ process.exit(0);
78
+ }
79
+ const command = commandName && help.commands[commandName];
80
+ if (args.help || args.h || !commandName) {
81
+ if (command) {
82
+ output.help(command.help);
83
+ } else {
84
+ const lines = ["playwright-cli - run playwright mcp commands from terminal"];
85
+ if (process.env.CLAUDECODE || process.env.COPILOT_CLI)
86
+ lines.push(`Agent skill: ${import_path.default.relative(process.cwd(), (0, import_package.libPath)("tools", "skills", "playwright-cli", "SKILL.md"))}`);
87
+ lines.push(help.global);
88
+ output.help(lines.join("\n\n"));
89
+ }
90
+ process.exit(0);
91
+ }
92
+ if (!command)
93
+ output.errorUnknownCommand(commandName, help.global);
94
+ validateFlags(args, command, output);
95
+ validateArgs(args, command, output);
96
+ const registry = await import_registry.Registry.load();
97
+ const sessionName = (0, import_registry.resolveSessionName)(args.session);
98
+ switch (commandName) {
99
+ case "list": {
100
+ const data = await collectList(registry, clientInfo, !!args.all);
101
+ output.list(data);
102
+ return;
103
+ }
104
+ case "close-all": {
105
+ const entries = registry.entries(clientInfo);
106
+ const closed = [];
107
+ for (const entry of entries) {
108
+ await new import_session.Session(entry).stop();
109
+ closed.push(entry.config.name);
110
+ }
111
+ output.closeAll(closed);
112
+ return;
113
+ }
114
+ case "delete-data": {
115
+ const entry = registry.entry(clientInfo, sessionName);
116
+ if (!entry) {
117
+ output.deleteData(sessionName, { existed: false, deletedUserDataDir: false });
118
+ return;
119
+ }
120
+ const result = await new import_session.Session(entry).deleteData();
121
+ output.deleteData(sessionName, result);
122
+ return;
123
+ }
124
+ case "kill-all": {
125
+ const pids = await killAllDaemons();
126
+ output.killAll(pids);
127
+ return;
128
+ }
129
+ case "open": {
130
+ const { pid } = await startSession(sessionName, registry, clientInfo, args, "open");
131
+ const newEntry = await registry.loadEntry(clientInfo, sessionName);
132
+ const params = args._.slice(1);
133
+ const toolText = await runInSessionOrStop(newEntry, clientInfo, { _: ["goto", ...params.length ? params : ["about:blank"]] }, output);
134
+ output.open(sessionName, pid, toolText);
135
+ return;
136
+ }
137
+ case "attach": {
138
+ const attachTarget = args._[1];
139
+ const targetCount = (attachTarget ? 1 : 0) + (args.cdp ? 1 : 0) + (args.endpoint ? 1 : 0) + (args.extension ? 1 : 0);
140
+ if (targetCount > 1)
141
+ output.errorAttachConflict();
142
+ if (attachTarget)
143
+ args.endpoint = attachTarget;
144
+ const extensionChannel = typeof args.extension === "string" ? args.extension : void 0;
145
+ if (extensionChannel) {
146
+ args.browser = extensionChannel;
147
+ args.extension = true;
148
+ }
149
+ const cdpChannel = typeof args.cdp === "string" && (0, import_channelSessions.isKnownChannel)(args.cdp) ? args.cdp : void 0;
150
+ const targetName = attachTarget ?? cdpChannel ?? extensionChannel ?? args.endpoint ?? args.cdp;
151
+ if (!targetName)
152
+ output.errorAttachNoTarget();
153
+ const attachSessionName = (0, import_registry.explicitSessionName)(args.session) ?? attachTarget ?? cdpChannel ?? extensionChannel ?? sessionName;
154
+ args.session = attachSessionName;
155
+ const { pid } = await startSession(attachSessionName, registry, clientInfo, args, "attach");
156
+ const newEntry = await registry.loadEntry(clientInfo, attachSessionName);
157
+ const toolText = await runInSessionOrStop(newEntry, clientInfo, { _: ["snapshot"], filename: "<auto>" }, output);
158
+ output.attach(attachSessionName, pid, targetName, toolText);
159
+ return;
160
+ }
161
+ case "close": {
162
+ const closeEntry = registry.entry(clientInfo, sessionName);
163
+ const { wasOpen } = closeEntry ? await new import_session.Session(closeEntry).stop() : { wasOpen: false };
164
+ output.close(sessionName, wasOpen);
165
+ return;
166
+ }
167
+ case "detach": {
168
+ const detachEntry = registry.entry(clientInfo, sessionName);
169
+ if (detachEntry && !detachEntry.config.attached)
170
+ output.errorDetachNotAttached(sessionName);
171
+ const { wasOpen } = detachEntry ? await new import_session.Session(detachEntry).stop() : { wasOpen: false };
172
+ output.detach(sessionName, wasOpen);
173
+ return;
174
+ }
175
+ case "install":
176
+ if (args.global && !args.skills)
177
+ output.errorInstallGlobalRequiresSkills();
178
+ await runInitWorkspace(args, output);
179
+ output.installed();
180
+ return;
181
+ case "install-browser":
182
+ await installBrowser();
183
+ output.installed();
184
+ return;
185
+ case "show": {
186
+ const daemonScript = (0, import_package.libPath)("entry", "dashboardApp.js");
187
+ const daemonArgs = [
188
+ daemonScript,
189
+ `--workspaceDir=${clientInfo.workspaceDir ?? ""}`
190
+ ];
191
+ const explicit = (0, import_registry.explicitSessionName)(args.session);
192
+ if (explicit)
193
+ daemonArgs.push(`--sessionName=${explicit}`);
194
+ if (args.port !== void 0)
195
+ daemonArgs.push(`--port=${args.port}`);
196
+ if (args.host !== void 0)
197
+ daemonArgs.push(`--host=${args.host}`);
198
+ if (args.kill) {
199
+ daemonArgs.push(`--kill`);
200
+ const child2 = (0, import_child_process.spawn)(process.execPath, daemonArgs, { stdio: "ignore" });
201
+ await new Promise((resolve) => child2.on("exit", () => resolve()));
202
+ return;
203
+ }
204
+ if (args.annotate) {
205
+ const entry = registry.entry(clientInfo, sessionName);
206
+ if (!entry)
207
+ output.errorBrowserNotOpenForTool(sessionName);
208
+ args.raw = true;
209
+ const text = await runInSession(entry, clientInfo, args, output);
210
+ output.toolResult(text);
211
+ return;
212
+ }
213
+ const foreground = args.port !== void 0;
214
+ const child = (0, import_child_process.spawn)(process.execPath, daemonArgs, {
215
+ detached: !foreground,
216
+ stdio: foreground ? "inherit" : ["pipe", "pipe", "ignore"],
217
+ windowsHide: true
218
+ });
219
+ if (foreground) {
220
+ await new Promise((resolve) => child.on("exit", () => resolve()));
221
+ return;
222
+ }
223
+ const timer = setTimeout(() => child.stdin.destroy(), 6e4);
224
+ child.unref();
225
+ let daemonPid;
226
+ try {
227
+ await new Promise((resolve, reject) => {
228
+ let outLog = "";
229
+ child.stdout.on("data", (data) => {
230
+ outLog += data.toString();
231
+ const match = outLog.match(/Dashboard is running pid=(\d+)/);
232
+ if (match) {
233
+ daemonPid = Number(match[1]);
234
+ resolve();
235
+ }
236
+ });
237
+ child.once("exit", (code, signal) => reject(new Error(`Dashboard daemon exited (code=${code}, signal=${signal}) before signaling READY${outLog ? "\n" + outLog : ""}`)));
238
+ });
239
+ } finally {
240
+ clearTimeout(timer);
241
+ child.removeAllListeners("exit");
242
+ child.stdin.destroy();
243
+ child.stdout.destroy();
244
+ }
245
+ output.show(sessionName, daemonPid);
246
+ return;
247
+ }
248
+ default: {
249
+ const entry = registry.entry(clientInfo, sessionName);
250
+ if (!entry)
251
+ output.errorBrowserNotOpenForTool(sessionName);
252
+ if (command.raw)
253
+ args.raw = true;
254
+ const text = await runInSession(entry, clientInfo, args, output);
255
+ output.toolResult(text);
256
+ }
257
+ }
258
+ }
259
+ async function startSession(sessionName, registry, clientInfo, args, mode) {
260
+ const entry = registry.entry(clientInfo, sessionName);
261
+ if (entry)
262
+ await new import_session.Session(entry).stop();
263
+ return await import_session.Session.startDaemon(clientInfo, args, mode);
264
+ }
265
+ async function runInSession(entry, clientInfo, args, output) {
266
+ const raw = !!args.raw;
267
+ for (const globalOption of globalOptions)
268
+ delete args[globalOption];
269
+ const session = new import_session.Session(entry);
270
+ const result = await session.run(clientInfo, args, { raw, json: output.json });
271
+ if (result.isError)
272
+ process.exitCode = 1;
273
+ return result.text;
274
+ }
275
+ async function runInSessionOrStop(entry, clientInfo, args, output) {
276
+ try {
277
+ return await runInSession(entry, clientInfo, args, output);
278
+ } catch (e) {
279
+ await new import_session.Session(entry).stop().catch(() => {
280
+ });
281
+ throw e;
282
+ }
283
+ }
284
+ async function runInitWorkspace(args, output) {
285
+ const cliPath = (0, import_package.libPath)("entry", "cliDaemon.js");
286
+ const daemonArgs = [
287
+ cliPath,
288
+ "--init-workspace",
289
+ ...args.skills ? [args.global ? "--init-skills-global" : "--init-skills", String(args.skills)] : []
290
+ ];
291
+ await new Promise((resolve, reject) => {
292
+ const child = (0, import_child_process.spawn)(process.execPath, daemonArgs, {
293
+ stdio: output.installStdio(),
294
+ cwd: process.cwd()
295
+ });
296
+ child.on("close", (code) => {
297
+ if (code === 0)
298
+ resolve();
299
+ else
300
+ reject(new Error(`Workspace initialization failed with exit code ${code}`));
301
+ });
302
+ });
303
+ }
304
+ async function installBrowser() {
305
+ const argv = process.argv.map((arg) => arg === "install-browser" ? "install" : arg);
306
+ const { libCli } = require("../../coreBundle.js");
307
+ const { program: program2 } = require("../../utilsBundle.js");
308
+ if (!program2.version())
309
+ libCli.decorateProgram(program2);
310
+ program2.parse(argv);
311
+ }
312
+ const daemonProcessPatterns = ["run-mcp-server", "run-cli-server", "cli-daemon", "cliDaemon.js", "dashboardApp.js"];
313
+ async function killAllDaemons() {
314
+ const platform = import_os.default.platform();
315
+ const pidFilterEnv = process.env.PWTEST_KILL_ALL_PID_FILTER_FOR_TEST;
316
+ const pidFilter = pidFilterEnv ? new Set(pidFilterEnv.split(",").map((p) => parseInt(p, 10)).filter((n) => !isNaN(n))) : void 0;
317
+ const killed = [];
318
+ try {
319
+ if (platform === "win32") {
320
+ const clauses = [`(${daemonProcessPatterns.map((p) => `$_.CommandLine -like '*${p}*'`).join(" -or ")})`];
321
+ if (pidFilter)
322
+ clauses.push(`(${[...pidFilter].map((p) => `$_.ProcessId -eq ${p}`).join(" -or ")})`);
323
+ const whereClause = clauses.join(" -and ");
324
+ const result = (0, import_child_process.execSync)(
325
+ `powershell -NoProfile -NonInteractive -Command "Get-CimInstance Win32_Process | Where-Object { ${whereClause} } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue; $_.ProcessId }"`,
326
+ { encoding: "utf-8" }
327
+ );
328
+ const pids = result.split("\n").map((line) => line.trim()).filter((line) => /^\d+$/.test(line));
329
+ for (const pid of pids)
330
+ killed.push(parseInt(pid, 10));
331
+ } else {
332
+ const result = (0, import_child_process.execSync)("ps auxww", { encoding: "utf-8" });
333
+ const lines = result.split("\n");
334
+ for (const line of lines) {
335
+ if (daemonProcessPatterns.some((p) => line.includes(p))) {
336
+ const parts = line.trim().split(/\s+/);
337
+ const pid = parts[1];
338
+ if (pid && /^\d+$/.test(pid)) {
339
+ const numericPid = parseInt(pid, 10);
340
+ if (pidFilter && !pidFilter.has(numericPid))
341
+ continue;
342
+ try {
343
+ process.kill(numericPid, "SIGKILL");
344
+ killed.push(numericPid);
345
+ } catch {
346
+ }
347
+ }
348
+ }
349
+ }
350
+ }
351
+ } catch (e) {
352
+ }
353
+ return killed;
354
+ }
355
+ async function collectList(registry, clientInfo, all) {
356
+ const browsers = [];
357
+ const entries = registry.entryMap();
358
+ const serverEntries = await import_serverRegistry.serverRegistry.list();
359
+ const key = (0, import_registry.clientKey)(clientInfo);
360
+ for (const [workspaceKey, list] of entries) {
361
+ if (!all && workspaceKey !== key)
362
+ continue;
363
+ for (const entry of list) {
364
+ const session = new import_session.Session(entry);
365
+ const canConnect = await session.canConnect();
366
+ if (!canConnect) {
367
+ await session.deleteSessionConfig();
368
+ continue;
369
+ }
370
+ const config = session.config;
371
+ const channel = config.browser?.launchOptions.channel ?? config.browser?.browserName;
372
+ browsers.push({
373
+ name: session.name,
374
+ workspace: workspaceKey,
375
+ status: canConnect ? "open" : "closed",
376
+ browserType: channel,
377
+ userDataDir: config.browser?.userDataDir ?? null,
378
+ headed: config.browser ? !config.browser.launchOptions.headless : void 0,
379
+ persistent: !!config.cli.persistent,
380
+ attached: !!config.attached,
381
+ compatible: session.isCompatible(clientInfo),
382
+ version: config.version
383
+ });
384
+ }
385
+ }
386
+ if (!all)
387
+ return { all, browsers };
388
+ const servers = [...serverEntries.values()].flat();
389
+ return { all, browsers, servers, channelSessions: await (0, import_channelSessions.listChannelSessions)() };
390
+ }
391
+ function validateFlags(args, command, output) {
392
+ const unknownFlags = [];
393
+ for (const key of Object.keys(args)) {
394
+ if (key === "_")
395
+ continue;
396
+ if (globalOptions.includes(key))
397
+ continue;
398
+ if (!(key in command.flags))
399
+ unknownFlags.push(key);
400
+ }
401
+ if (unknownFlags.length)
402
+ output.errorUnknownOption(unknownFlags, command.help);
403
+ }
404
+ function validateArgs(args, command, output) {
405
+ const positional = args._.slice(1);
406
+ if (positional.length > command.args.length && !command.variadicArg)
407
+ output.errorTooManyArguments(command.args.length, positional.length, command.help);
408
+ }
409
+ function calculateSha1(buffer) {
410
+ const hash = import_crypto.default.createHash("sha1");
411
+ hash.update(buffer);
412
+ return hash.digest("hex");
413
+ }
414
+ // Annotate the CommonJS export names for ESM import in node:
415
+ 0 && (module.exports = {
416
+ calculateSha1,
417
+ program
418
+ });
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var registry_exports = {};
30
+ __export(registry_exports, {
31
+ Registry: () => Registry,
32
+ baseDaemonDir: () => baseDaemonDir,
33
+ clientKey: () => clientKey,
34
+ createClientInfo: () => createClientInfo,
35
+ explicitSessionName: () => explicitSessionName,
36
+ resolveSessionName: () => resolveSessionName
37
+ });
38
+ module.exports = __toCommonJS(registry_exports);
39
+ var import_crypto = __toESM(require("crypto"));
40
+ var import_fs = __toESM(require("fs"));
41
+ var import_os = __toESM(require("os"));
42
+ var import_path = __toESM(require("path"));
43
+ var import_package = require("../../package");
44
+ function clientKey(clientInfo) {
45
+ return clientInfo.workspaceDir || clientInfo.workspaceDirHash;
46
+ }
47
+ class Registry {
48
+ constructor(files) {
49
+ this._files = files;
50
+ }
51
+ entry(clientInfo, sessionName) {
52
+ const key = clientKey(clientInfo);
53
+ const entries = this._files.get(key) || [];
54
+ return entries.find((entry) => entry.config.name === sessionName);
55
+ }
56
+ entries(clientInfo) {
57
+ return this._files.get(clientKey(clientInfo)) || [];
58
+ }
59
+ entryMap() {
60
+ return this._files;
61
+ }
62
+ async loadEntry(clientInfo, sessionName) {
63
+ const entry = await Registry._loadSessionEntry(clientInfo.daemonProfilesDir, sessionName + ".session");
64
+ if (!entry)
65
+ throw new Error(`Could not start the session "${sessionName}"`);
66
+ const key = clientKey(clientInfo);
67
+ let list = this._files.get(key);
68
+ if (!list) {
69
+ list = [];
70
+ this._files.set(key, list);
71
+ }
72
+ const oldIndex = list.findIndex((e) => e.config.name === sessionName);
73
+ if (oldIndex !== -1)
74
+ list.splice(oldIndex, 1);
75
+ list.push(entry);
76
+ return entry;
77
+ }
78
+ static async _loadSessionEntry(daemonDir, file) {
79
+ try {
80
+ const fileName = import_path.default.join(daemonDir, file);
81
+ const data = await import_fs.default.promises.readFile(fileName, "utf-8");
82
+ const config = JSON.parse(data);
83
+ if (!config.name)
84
+ config.name = import_path.default.basename(file, ".session");
85
+ if (!config.timestamp)
86
+ config.timestamp = 0;
87
+ return { file: fileName, config, daemonDir };
88
+ } catch {
89
+ return void 0;
90
+ }
91
+ }
92
+ static async load() {
93
+ const sessions = /* @__PURE__ */ new Map();
94
+ const hashDirs = await import_fs.default.promises.readdir(baseDaemonDir()).catch(() => []);
95
+ for (const workspaceDirHash of hashDirs) {
96
+ const daemonDir = import_path.default.join(baseDaemonDir(), workspaceDirHash);
97
+ const stat = await import_fs.default.promises.stat(daemonDir);
98
+ if (!stat.isDirectory())
99
+ continue;
100
+ const files = await import_fs.default.promises.readdir(daemonDir).catch(() => []);
101
+ for (const file of files) {
102
+ if (!file.endsWith(".session"))
103
+ continue;
104
+ const entry = await Registry._loadSessionEntry(daemonDir, file);
105
+ if (!entry)
106
+ continue;
107
+ const key = entry.config.workspaceDir || workspaceDirHash;
108
+ let list = sessions.get(key);
109
+ if (!list) {
110
+ list = [];
111
+ sessions.set(key, list);
112
+ }
113
+ list.push(entry);
114
+ }
115
+ }
116
+ return new Registry(sessions);
117
+ }
118
+ }
119
+ function computeBaseDaemonDir() {
120
+ if (process.env.PWTEST_DAEMON_SESSION_DIR)
121
+ return process.env.PWTEST_DAEMON_SESSION_DIR;
122
+ let localCacheDir;
123
+ if (process.platform === "linux")
124
+ localCacheDir = process.env.XDG_CACHE_HOME || import_path.default.join(import_os.default.homedir(), ".cache");
125
+ if (process.platform === "darwin")
126
+ localCacheDir = import_path.default.join(import_os.default.homedir(), "Library", "Caches");
127
+ if (process.platform === "win32")
128
+ localCacheDir = process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local");
129
+ if (!localCacheDir)
130
+ throw new Error("Unsupported platform: " + process.platform);
131
+ return import_path.default.join(localCacheDir, "ms-playwright", "daemon");
132
+ }
133
+ let _baseDaemonDir;
134
+ function baseDaemonDir() {
135
+ return _baseDaemonDir ??= computeBaseDaemonDir();
136
+ }
137
+ function createClientInfo() {
138
+ const workspaceDir = findWorkspaceDir(process.cwd());
139
+ const version = process.env.PLAYWRIGHT_CLI_VERSION_FOR_TEST || import_package.packageJSON.version;
140
+ const hash = import_crypto.default.createHash("sha1");
141
+ hash.update(workspaceDir || import_package.packageRoot);
142
+ const workspaceDirHash = hash.digest("hex").substring(0, 16);
143
+ return {
144
+ version,
145
+ workspaceDir,
146
+ workspaceDirHash,
147
+ daemonProfilesDir: daemonProfilesDir(workspaceDirHash),
148
+ homeDir: import_os.default.homedir()
149
+ };
150
+ }
151
+ function findWorkspaceDir(startDir) {
152
+ let dir = startDir;
153
+ for (let i = 0; i < 10; i++) {
154
+ if (import_fs.default.existsSync(import_path.default.join(dir, ".playwright")))
155
+ return dir;
156
+ const parentDir = import_path.default.dirname(dir);
157
+ if (parentDir === dir)
158
+ break;
159
+ dir = parentDir;
160
+ }
161
+ return void 0;
162
+ }
163
+ const daemonProfilesDir = (workspaceDirHash) => {
164
+ return import_path.default.join(baseDaemonDir(), workspaceDirHash);
165
+ };
166
+ function explicitSessionName(sessionName) {
167
+ return sessionName || process.env.PLAYWRIGHT_CLI_SESSION;
168
+ }
169
+ function resolveSessionName(sessionName) {
170
+ return explicitSessionName(sessionName) || "default";
171
+ }
172
+ // Annotate the CommonJS export names for ESM import in node:
173
+ 0 && (module.exports = {
174
+ Registry,
175
+ baseDaemonDir,
176
+ clientKey,
177
+ createClientInfo,
178
+ explicitSessionName,
179
+ resolveSessionName
180
+ });