@skyramp/mcp 0.4.1 → 0.4.2-rc.2

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 (583) hide show
  1. package/build/commands/localDevTestChangesCommand.js +2 -1
  2. package/build/commands/recommendTestsAndExecuteCommand.js +15 -7
  3. package/build/commands/testThisEndpointCommand.js +35 -6
  4. package/build/execution/wrapperConfig.d.ts +56 -0
  5. package/build/execution/wrapperConfig.js +155 -0
  6. package/build/index.js +40 -10
  7. package/build/playwright/blueprintDigest.js +28 -7
  8. package/build/playwright/registerPlaywrightTools.js +47 -28
  9. package/build/playwright/traceExportStore.d.ts +22 -0
  10. package/build/playwright/traceExportStore.js +81 -0
  11. package/build/playwright/traceRecordingPrompt.js +11 -3
  12. package/build/prompts/code-reuse.js +118 -49
  13. package/build/prompts/fix-error-prompt.d.ts +9 -1
  14. package/build/prompts/fix-error-prompt.js +31 -28
  15. package/build/prompts/local-dev/local-dev-plan.d.ts +3 -0
  16. package/build/prompts/local-dev/local-dev-plan.js +8 -23
  17. package/build/prompts/local-dev/local-dev-prompts.d.ts +1 -1
  18. package/build/prompts/local-dev/local-dev-prompts.js +31 -4
  19. package/build/prompts/modularization/integration-test-modularization.js +13 -6
  20. package/build/prompts/modularization/ui-test-modularization.js +1 -1
  21. package/build/prompts/personas.js +1 -1
  22. package/build/prompts/pom-aware-code-reuse.js +7 -9
  23. package/build/prompts/reuse-hand-off.d.ts +64 -0
  24. package/build/prompts/reuse-hand-off.js +130 -0
  25. package/build/prompts/shared-helper-policy.d.ts +124 -2
  26. package/build/prompts/shared-helper-policy.js +178 -12
  27. package/build/prompts/startTraceCollectionPrompts.js +1 -1
  28. package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.js +7 -8
  29. package/build/prompts/sut-setup/modes/dockerComposePrompt.js +1 -1
  30. package/build/prompts/sut-setup/shared.d.ts +4 -1
  31. package/build/prompts/sut-setup/shared.js +6 -4
  32. package/build/prompts/test-maintenance/actionsInstructions.d.ts +19 -11
  33. package/build/prompts/test-maintenance/actionsInstructions.js +47 -26
  34. package/build/prompts/test-maintenance/drift-analysis-prompt.d.ts +16 -8
  35. package/build/prompts/test-maintenance/drift-analysis-prompt.js +93 -38
  36. package/build/prompts/test-maintenance/driftAnalysisSections.js +5 -3
  37. package/build/prompts/test-maintenance/driftAnalysisShared.js +4 -2
  38. package/build/prompts/test-maintenance/uiDriftAnalysisSections.js +8 -5
  39. package/build/prompts/test-recommendation/recommendationSections.js +19 -8
  40. package/build/prompts/test-recommendation/recommendationShared.d.ts +1 -1
  41. package/build/prompts/test-recommendation/recommendationShared.js +0 -1
  42. package/build/prompts/test-recommendation/registerRecommendTestsPrompt.js +5 -2
  43. package/build/prompts/test-recommendation/test-recommendation-prompt.js +10 -7
  44. package/build/prompts/testbot/testbot-prompts.js +133 -63
  45. package/build/recommendation/answers.js +18 -9
  46. package/build/recommendation/pullRequestText.js +1 -1
  47. package/build/recommendation/registerPlan.js +31 -17
  48. package/build/recommendation/subjectStep.d.ts +8 -10
  49. package/build/recommendation/subjectStep.js +17 -16
  50. package/build/recommendation/types.d.ts +71 -17
  51. package/build/recommendation/types.js +9 -15
  52. package/build/recommendation/verifierContracts.d.ts +7 -3
  53. package/build/recommendation/verifierContracts.js +8 -4
  54. package/build/recommendation/verifiers/changedFile.js +11 -13
  55. package/build/recommendation/verifiers/citedPath.d.ts +8 -0
  56. package/build/recommendation/verifiers/citedPath.js +16 -2
  57. package/build/recommendation/verifiers/coverage.d.ts +2 -2
  58. package/build/recommendation/verifiers/coverage.js +190 -134
  59. package/build/recommendation/verifiers/defects.js +56 -16
  60. package/build/recommendation/verifiers/deliveredMatchesPlan.d.ts +7 -1
  61. package/build/recommendation/verifiers/deliveredMatchesPlan.js +28 -14
  62. package/build/recommendation/verifiers/endpointGrounded.js +14 -8
  63. package/build/recommendation/verifiers/existingCoverage.d.ts +6 -0
  64. package/build/recommendation/verifiers/existingCoverage.js +30 -21
  65. package/build/recommendation/verifiers/expectedOutcome.js +17 -8
  66. package/build/recommendation/verifiers/expectedValueSourced.js +54 -43
  67. package/build/recommendation/verifiers/issueTraceability.d.ts +5 -0
  68. package/build/recommendation/verifiers/issueTraceability.js +64 -7
  69. package/build/recommendation/verifiers/removedElementGuarded.js +19 -11
  70. package/build/recommendation/verifiers/reportedCategory.js +9 -4
  71. package/build/recommendation/verifiers/requirementSourced.js +34 -21
  72. package/build/recommendation/verifiers/screenRoute.js +15 -10
  73. package/build/recommendation/verifiers/statedDifference.js +15 -8
  74. package/build/recommendation/verifiers/uiElementGrounded.js +50 -16
  75. package/build/resources/analysisResources.js +7 -3
  76. package/build/resources/progressResource.js +4 -2
  77. package/build/resources/sutSetupResource.js +20 -2
  78. package/build/resources/testbotResource.js +19 -1
  79. package/build/services/AnalyticsService.js +3 -1
  80. package/build/services/ScenarioGenerationService.js +5 -5
  81. package/build/services/TestDiscoveryService.js +53 -9
  82. package/build/services/TestExecutionService.js +63 -21
  83. package/build/services/TestGenerationService.d.ts +1 -1
  84. package/build/services/TestGenerationService.js +43 -24
  85. package/build/skills/enhanceAssertionsSkill.d.ts +45 -0
  86. package/build/skills/enhanceAssertionsSkill.js +103 -0
  87. package/build/skills/fixTestImportErrorsSkill.d.ts +2 -2
  88. package/build/skills/fixTestImportErrorsSkill.js +2 -2
  89. package/build/skills/runTestSkill.d.ts +6 -0
  90. package/build/skills/runTestSkill.js +17 -0
  91. package/build/skills/skillFiles.d.ts +38 -0
  92. package/build/skills/skillFiles.js +94 -0
  93. package/build/skills/validateAssertionAlignmentSkill.d.ts +34 -0
  94. package/build/skills/validateAssertionAlignmentSkill.js +59 -0
  95. package/build/tool-phases.js +4 -1
  96. package/build/tools/auth/loginTool.js +3 -1
  97. package/build/tools/auth/logoutTool.js +3 -1
  98. package/build/tools/budgetExcuse.d.ts +15 -0
  99. package/build/tools/budgetExcuse.js +113 -0
  100. package/build/tools/code-refactor/alignAssertionsTool.d.ts +2 -0
  101. package/build/tools/code-refactor/alignAssertionsTool.js +51 -0
  102. package/build/tools/code-refactor/assertion-state.d.ts +1 -1
  103. package/build/tools/code-refactor/assertion-state.js +1 -1
  104. package/build/tools/code-refactor/assertionOperations.d.ts +44 -0
  105. package/build/tools/code-refactor/assertionOperations.js +82 -0
  106. package/build/tools/code-refactor/assertionSkillTools.d.ts +3 -0
  107. package/build/tools/code-refactor/assertionSkillTools.js +86 -0
  108. package/build/tools/code-refactor/codeReuseTool.js +27 -3
  109. package/build/tools/code-refactor/enhanceAssertionsTool.js +19 -83
  110. package/build/tools/code-refactor/gate-markers.d.ts +51 -0
  111. package/build/tools/code-refactor/gate-markers.js +95 -0
  112. package/build/tools/code-refactor/retrofit-state.d.ts +3 -1
  113. package/build/tools/code-refactor/retrofit-state.js +44 -2
  114. package/build/tools/code-refactor/reuse-outcome.d.ts +23 -1
  115. package/build/tools/code-refactor/reuse-outcome.js +36 -13
  116. package/build/tools/code-refactor/reuse-state.d.ts +90 -16
  117. package/build/tools/code-refactor/reuse-state.js +191 -61
  118. package/build/tools/code-refactor/utils-verify-gates.d.ts +4 -0
  119. package/build/tools/code-refactor/utils-verify-gates.js +269 -30
  120. package/build/tools/code-refactor/verify-gates.d.ts +15 -1
  121. package/build/tools/code-refactor/verify-gates.js +36 -4
  122. package/build/tools/enrichTestWithMocksTool.d.ts +1 -1
  123. package/build/tools/enrichTestWithMocksTool.js +9 -5
  124. package/build/tools/executeSkyrampTestTool.d.ts +118 -48
  125. package/build/tools/executeSkyrampTestTool.js +998 -372
  126. package/build/tools/execution-video-state.js +1 -1
  127. package/build/tools/fixErrorTool.js +5 -6
  128. package/build/tools/generate-tests/batchMockGenerationTool.js +1 -1
  129. package/build/tools/generate-tests/generateBatchScenarioRestTool.js +114 -73
  130. package/build/tools/generate-tests/generateContractRestTool.js +34 -16
  131. package/build/tools/generate-tests/generateE2ERestTool.d.ts +1 -0
  132. package/build/tools/generate-tests/generateE2ERestTool.js +9 -1
  133. package/build/tools/generate-tests/generateIntegrationRestTool.js +22 -7
  134. package/build/tools/generate-tests/generateMockRestTool.js +3 -1
  135. package/build/tools/generate-tests/generateUIRestTool.d.ts +2 -0
  136. package/build/tools/generate-tests/generateUIRestTool.js +11 -2
  137. package/build/tools/generate-tests/loadTestSchema.js +1 -3
  138. package/build/tools/generate-tests/planGuard.js +6 -3
  139. package/build/tools/generate-tests/scenarioFileIdentity.js +4 -1
  140. package/build/tools/generate-tests/scenarioLint.js +17 -5
  141. package/build/tools/generate-tests/trace-reuse-guard.js +5 -2
  142. package/build/tools/generateEnrichedIntegrationTestTool.js +9 -3
  143. package/build/tools/one-click/oneClickTool.js +3 -1
  144. package/build/tools/preflightMockCheckTool.js +23 -7
  145. package/build/tools/submitReportTool.d.ts +51 -12
  146. package/build/tools/submitReportTool.js +988 -161
  147. package/build/tools/test-management/actionsTool.js +241 -51
  148. package/build/tools/test-management/analyzeChangesTool.d.ts +8 -9
  149. package/build/tools/test-management/analyzeChangesTool.js +127 -68
  150. package/build/tools/test-management/analyzeTestHealthTool.d.ts +0 -11
  151. package/build/tools/test-management/analyzeTestHealthTool.js +42 -76
  152. package/build/tools/test-management/registerTestPlanTool.d.ts +44 -34
  153. package/build/tools/test-management/registerTestPlanTool.js +255 -111
  154. package/build/tools/test-management/resolveScreenTool.js +33 -9
  155. package/build/tools/test-management/testsOwedBeforeRun.d.ts +28 -0
  156. package/build/tools/test-management/testsOwedBeforeRun.js +53 -0
  157. package/build/tools/trace/startTraceCollectionTool.js +3 -1
  158. package/build/tools/trace/stopTraceCollectionTool.js +42 -6
  159. package/build/tools/verifyTestDependenciesTool.d.ts +3 -0
  160. package/build/tools/verifyTestDependenciesTool.js +54 -0
  161. package/build/tools/workspace/initScanWorkspaceTool.js +9 -3
  162. package/build/tools/workspace/initializeWorkspaceTool.js +3 -1
  163. package/build/types/AssertionOutcome.d.ts +1 -1
  164. package/build/types/EnhanceType.d.ts +6 -0
  165. package/build/types/EnhanceType.js +1 -0
  166. package/build/types/RepositoryAnalysis.d.ts +32 -72
  167. package/build/types/ReuseOutcome.d.ts +100 -7
  168. package/build/types/ReuseOutcome.js +16 -0
  169. package/build/types/StepMethod.js +20 -6
  170. package/build/types/TestAnalysis.d.ts +10 -2
  171. package/build/types/TestExecution.d.ts +45 -0
  172. package/build/types/TestRecommendation.d.ts +1 -1
  173. package/build/types/TestRecommendation.js +4 -1
  174. package/build/types/TestTypes.d.ts +16 -0
  175. package/build/types/TestTypes.js +40 -3
  176. package/build/types/TestbotPromptOptions.d.ts +9 -1
  177. package/build/types/TestbotReport.d.ts +45 -9
  178. package/build/utils/AnalysisStateManager.d.ts +137 -34
  179. package/build/utils/AnalysisStateManager.js +228 -44
  180. package/build/utils/assertion-verify/api-shared-lints.js +34 -16
  181. package/build/utils/assertion-verify/metrics.js +39 -6
  182. package/build/utils/assertion-verify/ui-lints.js +4 -2
  183. package/build/utils/branchDiff.js +47 -12
  184. package/build/utils/canonicalJson.js +3 -1
  185. package/build/utils/connectionErrors.d.ts +10 -0
  186. package/build/utils/connectionErrors.js +10 -0
  187. package/build/utils/dartRouteExtractor.js +36 -7
  188. package/build/utils/fixAttempts.d.ts +26 -0
  189. package/build/utils/fixAttempts.js +109 -0
  190. package/build/utils/frontendSelectors.js +23 -4
  191. package/build/utils/generatedTestRecord.d.ts +19 -0
  192. package/build/utils/generatedTestRecord.js +61 -0
  193. package/build/utils/gitStaging.js +7 -2
  194. package/build/utils/initAgent.js +26 -6
  195. package/build/utils/language-helper.js +60 -45
  196. package/build/utils/pathMatching.js +2 -1
  197. package/build/utils/pathSignatures.js +6 -2
  198. package/build/utils/planMatchKeys.d.ts +2 -2
  199. package/build/utils/planMatchKeys.js +20 -14
  200. package/build/utils/pom-catalog-parse.js +7 -2
  201. package/build/utils/pom-scope/import-expansion.js +6 -1
  202. package/build/utils/pom-scope/index.js +50 -12
  203. package/build/utils/pom-scope/scoring.js +13 -3
  204. package/build/utils/pom-scope/selector-extractor.js +16 -3
  205. package/build/utils/pom-scope/strip.d.ts +8 -0
  206. package/build/utils/pom-scope/strip.js +238 -0
  207. package/build/utils/pom-scope/testIdDiscovery.js +14 -2
  208. package/build/utils/pom-verify/__fixtures__/af-style/asset-list.page.d.ts +1 -1
  209. package/build/utils/pom-verify/__fixtures__/af-style/asset-list.page.js +4 -2
  210. package/build/utils/pom-verify/__fixtures__/af-style/report.iframe.page.js +3 -1
  211. package/build/utils/pom-verify/__fixtures__/af-style/workflow-footer.page.js +3 -1
  212. package/build/utils/pom-verify/bindings.js +5 -1
  213. package/build/utils/pom-verify/calls.js +9 -2
  214. package/build/utils/pom-verify/verify.js +27 -5
  215. package/build/utils/pr-comment-parser.js +20 -7
  216. package/build/utils/progress.d.ts +1 -1
  217. package/build/utils/progress.js +1 -1
  218. package/build/utils/proxy-terminal.d.ts +19 -1
  219. package/build/utils/proxy-terminal.js +346 -21
  220. package/build/utils/rebaselineSnapshots.d.ts +1 -1
  221. package/build/utils/rebaselineSnapshots.js +6 -16
  222. package/build/utils/removedUiElements.js +1 -1
  223. package/build/utils/reportLanguage.js +35 -7
  224. package/build/utils/reportVerification.d.ts +14 -8
  225. package/build/utils/reportVerification.js +19 -19
  226. package/build/utils/repositorySlug.d.ts +32 -0
  227. package/build/utils/repositorySlug.js +77 -0
  228. package/build/utils/reuseRouting.d.ts +10 -0
  229. package/build/utils/reuseRouting.js +21 -2
  230. package/build/utils/runContextGauge.d.ts +27 -0
  231. package/build/utils/runContextGauge.js +181 -0
  232. package/build/utils/runSerialized.d.ts +3 -0
  233. package/build/utils/runSerialized.js +39 -0
  234. package/build/utils/screenRoutes.js +74 -18
  235. package/build/utils/skyrampMdContent.d.ts +1 -1
  236. package/build/utils/skyrampMdContent.js +1 -1
  237. package/build/utils/skyrampSdkVersion.d.ts +9 -0
  238. package/build/utils/skyrampSdkVersion.js +16 -0
  239. package/build/utils/sourceRouteExtractor.js +13 -6
  240. package/build/utils/telemetry.d.ts +1 -0
  241. package/build/utils/telemetry.js +8 -5
  242. package/build/utils/testDependencyPolicy.d.ts +9 -0
  243. package/build/utils/testDependencyPolicy.js +809 -0
  244. package/build/utils/testExecutionRecord.d.ts +94 -0
  245. package/build/utils/testExecutionRecord.js +269 -0
  246. package/build/utils/testFileClassification.d.ts +8 -0
  247. package/build/utils/testFileClassification.js +39 -4
  248. package/build/utils/trace-parser.js +62 -14
  249. package/build/utils/urlPath.js +3 -1
  250. package/build/utils/utils-verify/action-key.d.ts +46 -0
  251. package/build/utils/utils-verify/action-key.js +120 -38
  252. package/build/utils/utils-verify/action-sites.d.ts +32 -0
  253. package/build/utils/utils-verify/action-sites.js +202 -0
  254. package/build/utils/utils-verify/allow.d.ts +122 -3
  255. package/build/utils/utils-verify/allow.js +146 -21
  256. package/build/utils/utils-verify/body-reach.d.ts +120 -0
  257. package/build/utils/utils-verify/body-reach.js +333 -0
  258. package/build/utils/utils-verify/call-sites.d.ts +31 -7
  259. package/build/utils/utils-verify/call-sites.js +80 -13
  260. package/build/utils/utils-verify/delivered-imports.d.ts +43 -0
  261. package/build/utils/utils-verify/delivered-imports.js +84 -0
  262. package/build/utils/utils-verify/fixed-sleep.d.ts +96 -0
  263. package/build/utils/utils-verify/fixed-sleep.js +461 -0
  264. package/build/utils/utils-verify/in-house.d.ts +93 -0
  265. package/build/utils/utils-verify/in-house.js +719 -0
  266. package/build/utils/utils-verify/incumbent.d.ts +3 -0
  267. package/build/utils/utils-verify/incumbent.js +75 -0
  268. package/build/utils/utils-verify/index.d.ts +2 -0
  269. package/build/utils/utils-verify/index.js +2 -0
  270. package/build/utils/utils-verify/language-spec.d.ts +51 -10
  271. package/build/utils/utils-verify/language-spec.js +232 -21
  272. package/build/utils/utils-verify/locate.d.ts +26 -0
  273. package/build/utils/utils-verify/locate.js +125 -23
  274. package/build/utils/utils-verify/module-name.d.ts +40 -0
  275. package/build/utils/utils-verify/module-name.js +98 -0
  276. package/build/utils/utils-verify/parse.d.ts +56 -7
  277. package/build/utils/utils-verify/parse.js +195 -40
  278. package/build/utils/utils-verify/retrofit-equivalence.d.ts +5 -0
  279. package/build/utils/utils-verify/retrofit-equivalence.js +4 -2
  280. package/build/utils/utils-verify/stage.d.ts +5 -0
  281. package/build/utils/utils-verify/stage.js +47 -2
  282. package/build/utils/utils-verify/status-once.d.ts +62 -0
  283. package/build/utils/utils-verify/status-once.js +207 -0
  284. package/build/utils/utils-verify/typecheck.d.ts +61 -0
  285. package/build/utils/utils-verify/typecheck.js +338 -0
  286. package/build/utils/utils-verify/verify.d.ts +79 -3
  287. package/build/utils/utils-verify/verify.js +531 -61
  288. package/build/utils/versions.d.ts +3 -3
  289. package/build/utils/versions.js +1 -1
  290. package/build/utils/workspaceAuth.js +107 -37
  291. package/build/workspace/queryParamResolution.js +11 -4
  292. package/build/workspace/workspace.d.ts +72 -52
  293. package/build/workspace/workspace.js +19 -15
  294. package/node_modules/playwright/ThirdPartyNotices.txt +19 -19
  295. package/node_modules/playwright/lib/mcp/skyramp/assertTool.js +8 -2
  296. package/node_modules/playwright/lib/mcp/skyramp/common/cssValue.js +87 -0
  297. package/node_modules/playwright/lib/mcp/skyramp/loadTraceTool.js +31 -0
  298. package/node_modules/playwright/lib/mcp/skyramp/skyRampImport.js +3 -0
  299. package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +181 -15
  300. package/node_modules/playwright/lib/mcp/test/skyRampExport.js +24 -0
  301. package/node_modules/playwright/lib/transform/babelBundleImpl.js +2353 -190
  302. package/node_modules/playwright/node_modules/playwright-core/ThirdPartyNotices.txt +62 -34
  303. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/.package-lock.json +72 -41
  304. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/@hono/node-server/dist/serve-static.js +1 -1
  305. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/@hono/node-server/dist/serve-static.mjs +1 -1
  306. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/@hono/node-server/package.json +2 -2
  307. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/README.md +16 -1
  308. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/index.js +4 -20
  309. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/read.js +17 -17
  310. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/json.js +60 -32
  311. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/raw.js +3 -3
  312. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/text.js +3 -3
  313. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/urlencoded.js +16 -20
  314. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/utils.js +18 -16
  315. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/LICENSE +22 -0
  316. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/README.md +71 -0
  317. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +46 -0
  318. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/dist/index.js +176 -0
  319. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -0
  320. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/package.json +52 -0
  321. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/package.json +23 -10
  322. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/CHANGELOG.md +21 -14
  323. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/isObject.d.ts +1 -1
  324. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/package.json +6 -7
  325. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/tsconfig.json +1 -0
  326. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/index.js +266 -45
  327. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/lib/schemes.js +9 -4
  328. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/lib/utils.js +396 -92
  329. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/package.json +1 -1
  330. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
  331. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/equal.test.js +31 -3
  332. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/fixtures/uri-js-parse.json +2 -0
  333. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
  334. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
  335. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
  336. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
  337. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/parse.test.js +7 -3
  338. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
  339. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
  340. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
  341. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/security-normalization.test.js +101 -0
  342. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/security.test.js +301 -3
  343. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
  344. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
  345. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hasown/CHANGELOG.md +7 -0
  346. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hasown/index.d.ts +0 -1
  347. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hasown/package.json +4 -5
  348. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/client/client.js +30 -16
  349. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/client/utils.js +4 -1
  350. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/context.js +32 -13
  351. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/accepts/accepts.js +36 -2
  352. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/proxy/index.js +4 -0
  353. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/ssg/ssg.js +1 -1
  354. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/ssg/utils.js +30 -10
  355. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/streaming/sse.js +5 -4
  356. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/hono-base.js +10 -8
  357. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/base.js +44 -23
  358. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/components.js +25 -26
  359. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/context.js +5 -5
  360. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/dom/render.js +2 -0
  361. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/dom/server.js +5 -1
  362. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/hooks/index.js +16 -13
  363. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +3 -3
  364. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/streaming.js +4 -5
  365. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/cache/index.js +103 -8
  366. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/compress/index.js +5 -0
  367. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/cors/index.js +17 -14
  368. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/csrf/index.js +1 -1
  369. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/etag/digest.js +47 -1
  370. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/etag/index.js +7 -4
  371. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +9 -4
  372. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +9 -4
  373. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/language/language.js +10 -6
  374. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +90 -0
  375. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +3 -1
  376. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +16 -7
  377. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/request.js +20 -13
  378. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/linear-router/router.js +7 -2
  379. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/pattern-router/router.js +3 -9
  380. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +65 -59
  381. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +71 -128
  382. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +14 -5
  383. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/trie-router/node.js +47 -70
  384. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/trie-router/router.js +3 -11
  385. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/utils.js +27 -0
  386. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router.js +1 -1
  387. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/accept.js +1 -1
  388. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/body.js +21 -3
  389. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/cookie.js +4 -3
  390. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/ipaddr.js +5 -3
  391. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/stream.js +12 -3
  392. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/url.js +19 -11
  393. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/client/client.js +30 -16
  394. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/client/utils.js +4 -1
  395. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/context.js +32 -13
  396. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/accepts/accepts.js +36 -2
  397. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/proxy/index.js +4 -0
  398. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/ssg/ssg.js +1 -1
  399. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/ssg/utils.js +30 -10
  400. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/streaming/sse.js +5 -4
  401. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/hono-base.js +10 -8
  402. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/base.js +41 -23
  403. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/components.js +26 -27
  404. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/context.js +6 -6
  405. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/dom/render.js +2 -0
  406. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/dom/server.js +5 -1
  407. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/hooks/index.js +16 -13
  408. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/intrinsic-element/components.js +4 -4
  409. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/streaming.js +5 -6
  410. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/cache/index.js +103 -8
  411. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/compress/index.js +5 -0
  412. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/cors/index.js +17 -14
  413. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/csrf/index.js +1 -1
  414. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/etag/digest.js +47 -1
  415. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/etag/index.js +7 -4
  416. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/jwk/jwk.js +9 -4
  417. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/jwt/jwt.js +9 -4
  418. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/language/language.js +10 -6
  419. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/method-not-allowed/index.js +68 -0
  420. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/pretty-json/index.js +3 -1
  421. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +16 -7
  422. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/request.js +21 -14
  423. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/linear-router/router.js +7 -2
  424. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/pattern-router/router.js +3 -9
  425. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/reg-exp-router/node.js +61 -58
  426. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/reg-exp-router/router.js +77 -129
  427. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/reg-exp-router/trie.js +14 -5
  428. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/trie-router/node.js +47 -70
  429. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/trie-router/router.js +3 -11
  430. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/utils.js +5 -0
  431. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router.js +1 -1
  432. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +9 -0
  433. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/client/types.d.ts +1 -1
  434. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/context.d.ts +6 -2
  435. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/hono-base.d.ts +4 -3
  436. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/base.d.ts +7 -2
  437. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/dom/index.d.ts +5 -5
  438. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +2 -2
  439. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/dom/server.d.ts +5 -5
  440. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/hooks/index.d.ts +8 -6
  441. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/index.d.ts +5 -5
  442. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/cache/index.d.ts +6 -4
  443. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/combine/index.d.ts +1 -1
  444. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/cors/index.d.ts +1 -1
  445. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +2 -2
  446. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +2 -0
  447. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +2 -0
  448. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +49 -0
  449. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +3 -3
  450. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +4 -1
  451. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +2 -1
  452. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/trie-router/node.d.ts +1 -2
  453. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/trie-router/router.d.ts +0 -1
  454. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/utils.d.ts +1 -0
  455. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router.d.ts +1 -1
  456. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/utils/headers.d.ts +2 -2
  457. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/utils/url.d.ts +5 -0
  458. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/accept.js +1 -1
  459. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/body.js +21 -3
  460. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/cookie.js +5 -4
  461. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/ipaddr.js +5 -3
  462. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/stream.js +12 -3
  463. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/url.js +17 -10
  464. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/package.json +11 -4
  465. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/README.md +173 -143
  466. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/address-error.d.ts +11 -0
  467. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/address-error.js.map +1 -1
  468. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/common.d.ts +49 -0
  469. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/common.js +79 -4
  470. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/common.js.map +1 -1
  471. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv4.d.ts +78 -5
  472. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv4.js +119 -24
  473. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv4.js.map +1 -1
  474. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv6.d.ts +151 -10
  475. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv6.js +316 -90
  476. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv6.js.map +1 -1
  477. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
  478. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v4/constants.js +45 -2
  479. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  480. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
  481. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v6/constants.js +50 -3
  482. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  483. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/package.json +6 -4
  484. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/.github/THREAT_MODEL.md +3 -3
  485. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/CHANGELOG.md +26 -0
  486. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/README.md +19 -1
  487. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/dist/qs.js +25 -25
  488. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/eslint.config.mjs +1 -1
  489. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/lib/parse.js +16 -6
  490. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/lib/stringify.js +23 -8
  491. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/lib/utils.js +57 -11
  492. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/package.json +8 -7
  493. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/test/parse.js +419 -0
  494. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/test/stringify.js +317 -0
  495. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/test/utils.js +206 -0
  496. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/CHANGELOG.md +10 -0
  497. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/README.md +1 -1
  498. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/index.js +5 -2
  499. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/package.json +10 -10
  500. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/test/index.js +16 -0
  501. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/index.js +8 -18
  502. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/LICENSE +22 -0
  503. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/README.md +71 -0
  504. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/dist/index.d.ts +46 -0
  505. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/dist/index.js +176 -0
  506. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -0
  507. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/package.json +52 -0
  508. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/package.json +9 -5
  509. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/package-lock.json +72 -41
  510. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/.package-lock.json +6 -6
  511. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/brace-expansion/README.md +23 -1
  512. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/brace-expansion/index.js +265 -86
  513. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/brace-expansion/package.json +1 -1
  514. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/README.md +173 -143
  515. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/address-error.d.ts +11 -0
  516. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/address-error.js.map +1 -1
  517. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/common.d.ts +49 -0
  518. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/common.js +79 -4
  519. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/common.js.map +1 -1
  520. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv4.d.ts +78 -5
  521. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv4.js +119 -24
  522. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv4.js.map +1 -1
  523. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv6.d.ts +151 -10
  524. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv6.js +316 -90
  525. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv6.js.map +1 -1
  526. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
  527. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v4/constants.js +45 -2
  528. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  529. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
  530. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v6/constants.js +50 -3
  531. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  532. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/package.json +6 -4
  533. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/package-lock.json +6 -6
  534. package/node_modules/playwright/node_modules/playwright-core/lib/cli/program.js +18 -9
  535. package/node_modules/playwright/node_modules/playwright-core/lib/mcpBundleImpl/index.js +47 -47
  536. package/node_modules/playwright/node_modules/playwright-core/lib/server/codegen/skyramp/jsonlReader.js +3 -0
  537. package/node_modules/playwright/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +42 -0
  538. package/node_modules/playwright/node_modules/playwright-core/lib/utilsBundleImpl/index.js +121 -121
  539. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/{index.B7KbSQcC.js → index.BAkLd5DX.js} +1 -1
  540. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/index.html +1 -1
  541. package/node_modules/playwright/node_modules/playwright-core/package.json +1 -1
  542. package/node_modules/playwright/node_modules/playwright-core/src/cli/program.ts +31 -9
  543. package/node_modules/playwright/node_modules/playwright-core/src/server/codegen/skyramp/jsonlReader.ts +1 -0
  544. package/node_modules/playwright/node_modules/playwright-core/src/server/recorder/recorderRunner.ts +57 -1
  545. package/node_modules/playwright/package.json +2 -2
  546. package/package.json +7 -6
  547. package/plugin/prompts/code-reuse/hand-off.md +30 -0
  548. package/plugin/prompts/generate-tests/generation.md +1 -1
  549. package/plugin/prompts/plan-tests.md +14 -14
  550. package/plugin/prompts/testbot-task1.md +2 -2
  551. package/plugin/skills/enhance-assertions/SKILL.md +25 -0
  552. package/plugin/skills/enhance-assertions/reference/contract.md +51 -0
  553. package/plugin/skills/enhance-assertions/reference/integration.md +58 -0
  554. package/plugin/skills/enhance-assertions/reference/shared-rules.md +220 -0
  555. package/plugin/skills/enhance-assertions/reference/ui.md +373 -0
  556. package/plugin/skills/fix-test-import-errors/SKILL.md +45 -50
  557. package/plugin/skills/run-test/SKILL.md +16 -0
  558. package/plugin/skills/validate-assertion-alignment-post-execution/SKILL.md +32 -0
  559. package/plugin/skills/validate-assertion-alignment-post-execution/reference/checks.md +44 -0
  560. package/plugin/skills/validate-assertion-alignment-post-execution/reference/evidence.md +47 -0
  561. package/build/adapters/jestAdapter.d.ts +0 -14
  562. package/build/adapters/jestAdapter.js +0 -113
  563. package/build/adapters/mochaAdapter.d.ts +0 -13
  564. package/build/adapters/mochaAdapter.js +0 -87
  565. package/build/adapters/playwrightAdapter.d.ts +0 -17
  566. package/build/adapters/playwrightAdapter.js +0 -182
  567. package/build/adapters/pytestAdapter.d.ts +0 -15
  568. package/build/adapters/pytestAdapter.js +0 -108
  569. package/build/prompts/enhance-assertions/contractProviderAssertionsPrompt.d.ts +0 -2
  570. package/build/prompts/enhance-assertions/contractProviderAssertionsPrompt.js +0 -29
  571. package/build/prompts/enhance-assertions/integrationAssertionsPrompt.d.ts +0 -2
  572. package/build/prompts/enhance-assertions/integrationAssertionsPrompt.js +0 -36
  573. package/build/prompts/enhance-assertions/sharedAssertionRules.d.ts +0 -16
  574. package/build/prompts/enhance-assertions/sharedAssertionRules.js +0 -284
  575. package/build/prompts/enhance-assertions/uiAssertionsPrompt.d.ts +0 -2
  576. package/build/prompts/enhance-assertions/uiAssertionsPrompt.js +0 -388
  577. package/build/tools/runExistingTestsTool.d.ts +0 -138
  578. package/build/tools/runExistingTestsTool.js +0 -644
  579. package/build/types/ExternalTestExecution.d.ts +0 -67
  580. package/build/types/ExternalTestExecution.js +0 -8
  581. package/build/workspace/testSuites.d.ts +0 -20
  582. package/build/workspace/testSuites.js +0 -17
  583. package/node_modules/playwright/node_modules/playwright-core/.DS_Store +0 -0
@@ -0,0 +1,94 @@
1
+ import { type TestExecutionData, type TestExecutionRecord, type TestExecutionResult } from "../types/TestExecution.js";
2
+ import type { TestType } from "../types/TestTypes.js";
3
+ import { type UnifiedAnalysisState } from "./AnalysisStateManager.js";
4
+ /**
5
+ * The serialization key for a run's state file: one queue per FILE, not per
6
+ * spelling. `./state.json`, its absolute path, and a symlink to it are read and
7
+ * written as one file, so they must wait on one another — two spellings in
8
+ * two queues could both pass the cap check. The real path when the file
9
+ * exists, else the resolved absolute path.
10
+ */
11
+ export declare function stateFileKey(stateFile: string): string;
12
+ /**
13
+ * The one path every read and write of a run's state file should use: the real
14
+ * path when the file exists, else the resolved absolute path. StateManager
15
+ * writes atomically by renaming a temp file over the target, which REPLACES a
16
+ * symlink instead of updating what it points to — so a write through a link
17
+ * would fork the state into two files with two counters. Reading and writing
18
+ * the real path keeps one file.
19
+ */
20
+ export declare function canonicalStateFilePath(stateFile: string): string;
21
+ /**
22
+ * The cap pinned at the run's root, if a valid one is there. Read from the
23
+ * ROOT on purpose: the pin is run-wide and a related repository's section
24
+ * never carries a copy, so reading it from the section would hand every
25
+ * related-repo file "no pin" and let a later prompt value widen its budget.
26
+ */
27
+ export declare function readPinnedMaxFixAttempts(stateFile: string): Promise<number | undefined>;
28
+ /** Characters of output kept in a run-state execution record. Head and tail
29
+ * are kept around a marker so both the setup and the failing assertion
30
+ * survive; the full text stays in the tool response. */
31
+ export declare const EXECUTION_RECORD_OUTPUT_LIMIT = 12000;
32
+ /** Bound `output` to the record limit, keeping its head and tail. */
33
+ export declare function boundExecutionOutput(output: string, limit?: number): {
34
+ output: string;
35
+ truncated: boolean;
36
+ };
37
+ /** Bound the error list the same way output is bounded: cap the count, then
38
+ * cap each entry's length (head only — an error's cause is at the front). */
39
+ export declare function boundExecutionErrors(errors: string[]): string[];
40
+ /** No real process exit code is ever negative, so -1 is unambiguous as "none
41
+ * produced" (a timeout kill or a thrown error before the process exited). */
42
+ export declare const NO_EXIT_CODE = -1;
43
+ /** The run-state record for one skyramp_execute_test result. `previous` is the
44
+ * file's earlier record in this run, if any, so re-runs are counted. */
45
+ export declare function executionRecordFrom(result: TestExecutionData, testType: TestType, phase: "before" | "after", previous?: TestExecutionRecord, countRun?: boolean, fileHash?: string): TestExecutionRecord;
46
+ /** The repository sections a run's state file holds: the primary at the root
47
+ * plus every related repo. Used to name them when a caller's `repository`
48
+ * matches none, so the fix is to correct the slug, not to drop the stateFile. */
49
+ export declare function stateSectionsOf(stateFile: string): Promise<string[]>;
50
+ /**
51
+ * Read one repository's section — for the file's execution record and as the
52
+ * fail-closed check on the `repository` argument (the cap itself comes from the
53
+ * root, see readPinnedMaxFixAttempts) — failing in a way the caller can act
54
+ * on: a stateFile that does not exist, one that cannot be parsed, or one with
55
+ * no section for `repo` (named against the sections that do exist) each throw
56
+ * with a distinct message. Never returns null.
57
+ */
58
+ export declare function readRepoSectionOrThrow(stateFile: string, repo: string): Promise<UnifiedAnalysisState>;
59
+ /**
60
+ * Reserve one execution attempt BEFORE the run (SKYR-4460): the file's run
61
+ * counters advance now, and the run's attempt cap is pinned at the state
62
+ * root (run-wide, whichever section this call writes) on first use. Reserving first means a state write that fails after the run,
63
+ * or a read that fails before it, can never hand the file a free attempt —
64
+ * the caller fails closed on a throw here instead of proceeding on zero.
65
+ * Until the result lands the record reads `Unknown` ("execution was expected
66
+ * but no result was recorded"), whatever the previous run's status was, so a
67
+ * run that dies before persisting leaves an honest record. The whole
68
+ * read-modify-write is serialized on the state file, like the persist below:
69
+ * two calls for different files in the same run would otherwise overwrite
70
+ * each other's section. Returns the count of final-phase runs BEFORE this one
71
+ * and the cap this run enforces.
72
+ */
73
+ export declare function reserveTestExecutionAttempt(stateFile: string, repo: string, testType: TestType, phase: "before" | "after", testFile: string, cap: number, fileHash: string): Promise<{
74
+ priorAfterRuns: number;
75
+ cap: number;
76
+ }>;
77
+ /**
78
+ * Read-modify-write one execution result into a run's state file: the
79
+ * per-file testExecutions record (every file, keyed by canonical path — see
80
+ * executionRecordFrom), plus the maintained-test executionBefore/After row
81
+ * when `testFile` has one. No-op when the repo section doesn't exist yet.
82
+ * Returns what was written, so the caller can say what was not.
83
+ *
84
+ * Extracted from skyramp_execute_test's own state-write block so the
85
+ * behavior that makes a file's result available to the post-execution
86
+ * alignment step is directly testable against a real state file, not only
87
+ * through the tool's full request/response path.
88
+ */
89
+ export declare function persistTestExecutionResult(stateFile: string, repo: string, testType: TestType, phase: "before" | "after", result: TestExecutionResult, options?: {
90
+ reserved?: boolean;
91
+ }): Promise<{
92
+ saved: boolean;
93
+ matchedExistingTest: boolean;
94
+ }>;
@@ -0,0 +1,269 @@
1
+ import { TestExecutionStatus, } from "../types/TestExecution.js";
2
+ import { StateManager, } from "./AnalysisStateManager.js";
3
+ import { canonicalTestPath } from "../tools/code-refactor/assertion-state.js";
4
+ import { runSerialized } from "./runSerialized.js";
5
+ import { parseMaxFixAttemptsArg } from "./fixAttempts.js";
6
+ import * as fs from "fs";
7
+ import * as path from "path";
8
+ /**
9
+ * The serialization key for a run's state file: one queue per FILE, not per
10
+ * spelling. `./state.json`, its absolute path, and a symlink to it are read and
11
+ * written as one file, so they must wait on one another — two spellings in
12
+ * two queues could both pass the cap check. The real path when the file
13
+ * exists, else the resolved absolute path.
14
+ */
15
+ export function stateFileKey(stateFile) {
16
+ return `state:${canonicalStateFilePath(stateFile)}`;
17
+ }
18
+ /**
19
+ * The one path every read and write of a run's state file should use: the real
20
+ * path when the file exists, else the resolved absolute path. StateManager
21
+ * writes atomically by renaming a temp file over the target, which REPLACES a
22
+ * symlink instead of updating what it points to — so a write through a link
23
+ * would fork the state into two files with two counters. Reading and writing
24
+ * the real path keeps one file.
25
+ */
26
+ export function canonicalStateFilePath(stateFile) {
27
+ const resolved = path.resolve(stateFile);
28
+ try {
29
+ return fs.realpathSync.native(resolved);
30
+ }
31
+ catch {
32
+ // Not there yet (or unreadable): the resolved path is the best identity.
33
+ return resolved;
34
+ }
35
+ }
36
+ /**
37
+ * The cap pinned at the run's root, if a valid one is there. Read from the
38
+ * ROOT on purpose: the pin is run-wide and a related repository's section
39
+ * never carries a copy, so reading it from the section would hand every
40
+ * related-repo file "no pin" and let a later prompt value widen its budget.
41
+ */
42
+ export async function readPinnedMaxFixAttempts(stateFile) {
43
+ const root = await StateManager.fromStatePath(stateFile).readData();
44
+ return parseMaxFixAttemptsArg(root?.maxFixAttempts, "stateFile");
45
+ }
46
+ /** Characters of output kept in a run-state execution record. Head and tail
47
+ * are kept around a marker so both the setup and the failing assertion
48
+ * survive; the full text stays in the tool response. */
49
+ export const EXECUTION_RECORD_OUTPUT_LIMIT = 12_000;
50
+ const TRUNCATION_MARKER = (dropped) => `\n… [${dropped} characters omitted] …\n`;
51
+ /** Bound `output` to the record limit, keeping its head and tail. */
52
+ export function boundExecutionOutput(output, limit = EXECUTION_RECORD_OUTPUT_LIMIT) {
53
+ if (output.length <= limit)
54
+ return { output, truncated: false };
55
+ const half = Math.floor(limit / 2);
56
+ return {
57
+ output: output.slice(0, half) +
58
+ TRUNCATION_MARKER(output.length - 2 * half) +
59
+ output.slice(output.length - half),
60
+ truncated: true,
61
+ };
62
+ }
63
+ /** Max errors kept in a record, and the max length of any one of them — a
64
+ * parser that goes wild on unstructured output must not make `errors`
65
+ * unbounded the way `output` deliberately isn't. */
66
+ const EXECUTION_RECORD_MAX_ERRORS = 20;
67
+ const EXECUTION_RECORD_MAX_ERROR_LENGTH = 2_000;
68
+ /** Bound the error list the same way output is bounded: cap the count, then
69
+ * cap each entry's length (head only — an error's cause is at the front). */
70
+ export function boundExecutionErrors(errors) {
71
+ const kept = errors.slice(0, EXECUTION_RECORD_MAX_ERRORS);
72
+ const bounded = kept.map((e) => e.length > EXECUTION_RECORD_MAX_ERROR_LENGTH
73
+ ? `${e.slice(0, EXECUTION_RECORD_MAX_ERROR_LENGTH)}… [truncated]`
74
+ : e);
75
+ if (errors.length > EXECUTION_RECORD_MAX_ERRORS) {
76
+ bounded.push(`… [${errors.length - EXECUTION_RECORD_MAX_ERRORS} more error(s) omitted]`);
77
+ }
78
+ return bounded;
79
+ }
80
+ /** No real process exit code is ever negative, so -1 is unambiguous as "none
81
+ * produced" (a timeout kill or a thrown error before the process exited). */
82
+ export const NO_EXIT_CODE = -1;
83
+ /** The run-state record for one skyramp_execute_test result. `previous` is the
84
+ * file's earlier record in this run, if any, so re-runs are counted. */
85
+ export function executionRecordFrom(result, testType, phase, previous, countRun = true, fileHash) {
86
+ const { output, truncated } = boundExecutionOutput(result.output ?? "");
87
+ const step = countRun ? 1 : 0;
88
+ // The hash travels with the run: set at reservation, kept by the result write.
89
+ const hash = fileHash ?? previous?.fileHash;
90
+ return {
91
+ ...(hash ? { fileHash: hash } : {}),
92
+ testType,
93
+ phase,
94
+ status: result.status,
95
+ executedAt: result.executedAt,
96
+ duration: result.duration,
97
+ exitCode: result.exitCode ?? NO_EXIT_CODE,
98
+ errors: boundExecutionErrors(result.errors),
99
+ output,
100
+ outputTruncated: truncated,
101
+ runs: (previous?.runs ?? 0) + step,
102
+ afterRuns: (previous?.afterRuns ?? 0) + (phase === "after" ? step : 0),
103
+ };
104
+ }
105
+ /** The repository sections a run's state file holds: the primary at the root
106
+ * plus every related repo. Used to name them when a caller's `repository`
107
+ * matches none, so the fix is to correct the slug, not to drop the stateFile. */
108
+ export async function stateSectionsOf(stateFile) {
109
+ const full = await StateManager.fromStatePath(stateFile).readFullState();
110
+ if (!full)
111
+ return [];
112
+ return [
113
+ full.metadata.repository,
114
+ ...Object.keys(full.relatedRepos ?? {}),
115
+ ].filter((r) => typeof r === "string" && r.length > 0);
116
+ }
117
+ /**
118
+ * Read one repository's section — for the file's execution record and as the
119
+ * fail-closed check on the `repository` argument (the cap itself comes from the
120
+ * root, see readPinnedMaxFixAttempts) — failing in a way the caller can act
121
+ * on: a stateFile that does not exist, one that cannot be parsed, or one with
122
+ * no section for `repo` (named against the sections that do exist) each throw
123
+ * with a distinct message. Never returns null.
124
+ */
125
+ export async function readRepoSectionOrThrow(stateFile, repo) {
126
+ if (!fs.existsSync(canonicalStateFilePath(stateFile))) {
127
+ throw new Error(`stateFile ${stateFile} does not exist`);
128
+ }
129
+ const stateData = await StateManager.fromStatePath(stateFile).readRepoData(repo);
130
+ if (stateData)
131
+ return stateData;
132
+ const sections = await stateSectionsOf(stateFile);
133
+ throw new Error(`stateFile ${stateFile} has no section for repository "${repo}"` +
134
+ (sections.length
135
+ ? `; it holds: ${sections.join(", ")}. Correct the repository argument`
136
+ : `; it holds no analysis yet — run skyramp_analyze_changes for it first`));
137
+ }
138
+ /**
139
+ * Reserve one execution attempt BEFORE the run (SKYR-4460): the file's run
140
+ * counters advance now, and the run's attempt cap is pinned at the state
141
+ * root (run-wide, whichever section this call writes) on first use. Reserving first means a state write that fails after the run,
142
+ * or a read that fails before it, can never hand the file a free attempt —
143
+ * the caller fails closed on a throw here instead of proceeding on zero.
144
+ * Until the result lands the record reads `Unknown` ("execution was expected
145
+ * but no result was recorded"), whatever the previous run's status was, so a
146
+ * run that dies before persisting leaves an honest record. The whole
147
+ * read-modify-write is serialized on the state file, like the persist below:
148
+ * two calls for different files in the same run would otherwise overwrite
149
+ * each other's section. Returns the count of final-phase runs BEFORE this one
150
+ * and the cap this run enforces.
151
+ */
152
+ export async function reserveTestExecutionAttempt(stateFile, repo, testType, phase, testFile, cap,
153
+ // The sha256 of the file being executed. The caller hashes it before
154
+ // reserving (the file must exist to run), so a reservation always has one.
155
+ fileHash) {
156
+ return runSerialized(stateFileKey(stateFile), async () => {
157
+ const stateData = await readRepoSectionOrThrow(stateFile, repo);
158
+ const manager = StateManager.fromStatePath(stateFile);
159
+ // The pin is RUN-wide, so it lives at the root whichever section this call
160
+ // writes: a multi-repo run otherwise pins each section separately and two
161
+ // files from one prompt can run under two caps. Pin on first use; an
162
+ // invalid pinned value (a hand-edited 0, a half-written 11) is replaced
163
+ // rather than carried into "attempt 1 of 0".
164
+ const root = (await manager.readData()) ?? {};
165
+ const pinned = parseMaxFixAttemptsArg(root.maxFixAttempts, "stateFile") ?? cap;
166
+ if (root.maxFixAttempts !== pinned) {
167
+ await manager.appendData({ ...root, maxFixAttempts: pinned });
168
+ }
169
+ // The section write below must not carry its own copy: when this section
170
+ // IS the root, the root's value is carried forward (ROOT_FIELDS_OWNED_ELSEWHERE);
171
+ // when it is a related section, the field does not belong there.
172
+ delete stateData.maxFixAttempts;
173
+ const key = canonicalTestPath(testFile);
174
+ const previous = stateData.testExecutions?.[key];
175
+ const placeholder = {
176
+ status: TestExecutionStatus.Unknown,
177
+ executedAt: new Date().toISOString(),
178
+ duration: 0,
179
+ errors: [],
180
+ warnings: [],
181
+ output: "",
182
+ exitCode: NO_EXIT_CODE,
183
+ };
184
+ const inFlight = executionRecordFrom(placeholder, testType, phase, previous, true, fileHash);
185
+ // The record is "the latest run", so the run in flight replaces the last
186
+ // completed one — but what that run was is kept beside it: a process that
187
+ // dies here (the case reserving first exists for) leaves a record that
188
+ // still says what the file last did. A maintained test's baseline OUTPUT
189
+ // lives on in existingTests[].executionBefore, which an "after"
190
+ // reservation never touches.
191
+ if (previous && previous.status !== TestExecutionStatus.Unknown) {
192
+ inFlight.previousRun = {
193
+ status: previous.status,
194
+ phase: previous.phase,
195
+ executedAt: previous.executedAt,
196
+ exitCode: previous.exitCode,
197
+ };
198
+ }
199
+ else if (previous?.previousRun) {
200
+ inFlight.previousRun = previous.previousRun;
201
+ }
202
+ stateData.testExecutions = {
203
+ ...(stateData.testExecutions ?? {}),
204
+ [key]: inFlight,
205
+ };
206
+ // A maintained test's before/after status is read by the report from its
207
+ // existingTests row, not from the record above. The row for THIS phase is
208
+ // set to the same in-flight Unknown, so a run that dies (or whose result
209
+ // write fails) cannot leave the previous Pass/Fail there to be published as
210
+ // this run's outcome. The other phase's row — the baseline output, for an
211
+ // "after" reservation — is untouched.
212
+ // Canonical on both sides: the row was written by analysis, the argument
213
+ // by the agent, and `/repo/tests/./x.py` or a symlink spelling is one file.
214
+ const row = stateData.existingTests?.find((t) => canonicalTestPath(t.testFile) === key);
215
+ if (row) {
216
+ const rowPlaceholder = { ...placeholder, testFile };
217
+ if (phase === "before")
218
+ row.executionBefore = rowPlaceholder;
219
+ else
220
+ row.executionAfter = rowPlaceholder;
221
+ }
222
+ await manager.updateRepoData(stateData, { repo });
223
+ return {
224
+ priorAfterRuns: previous?.afterRuns ?? 0,
225
+ cap: pinned,
226
+ };
227
+ });
228
+ }
229
+ /**
230
+ * Read-modify-write one execution result into a run's state file: the
231
+ * per-file testExecutions record (every file, keyed by canonical path — see
232
+ * executionRecordFrom), plus the maintained-test executionBefore/After row
233
+ * when `testFile` has one. No-op when the repo section doesn't exist yet.
234
+ * Returns what was written, so the caller can say what was not.
235
+ *
236
+ * Extracted from skyramp_execute_test's own state-write block so the
237
+ * behavior that makes a file's result available to the post-execution
238
+ * alignment step is directly testable against a real state file, not only
239
+ * through the tool's full request/response path.
240
+ */
241
+ export async function persistTestExecutionResult(stateFile, repo, testType, phase, result, options = {}) {
242
+ // Serialized on the state file: the section is read whole and written whole,
243
+ // so two files' results landing at once would drop one of them.
244
+ return runSerialized(stateFileKey(stateFile), async () => {
245
+ const { testFile } = result;
246
+ const stateManager = StateManager.fromStatePath(stateFile);
247
+ const stateData = await stateManager.readRepoData(repo);
248
+ if (!stateData)
249
+ return { saved: false, matchedExistingTest: false };
250
+ const testIndex = stateData.existingTests?.findIndex((t) => canonicalTestPath(t.testFile) === canonicalTestPath(testFile)) ?? -1;
251
+ if (testIndex >= 0) {
252
+ if (phase === "before") {
253
+ stateData.existingTests[testIndex].executionBefore = result;
254
+ }
255
+ else {
256
+ stateData.existingTests[testIndex].executionAfter = result;
257
+ }
258
+ }
259
+ const key = canonicalTestPath(testFile);
260
+ stateData.testExecutions = {
261
+ ...(stateData.testExecutions ?? {}),
262
+ [key]: executionRecordFrom(result, testType, phase, stateData.testExecutions?.[key],
263
+ // A reserved attempt already advanced the counters before the run.
264
+ !options.reserved),
265
+ };
266
+ await stateManager.updateRepoData(stateData, { repo });
267
+ return { saved: true, matchedExistingTest: testIndex >= 0 };
268
+ });
269
+ }
@@ -14,6 +14,14 @@ export declare function isDiscoveredTestFile(filePath: string): boolean;
14
14
  * `isDiscoveredTestFile`'s rule, which also counts `tests/`, a page-object
15
15
  * directory and `test_orders.py`. The maintenance tool wants this narrow one. */
16
16
  export declare function isTestFile(filePath: string): boolean;
17
+ /** The file's own NAME says it is a test — `login.spec.ts`, `orders.test.js`,
18
+ * `test_orders.py`, `UserDAOTest.java`. Almost entirely a NAME rule: a helper,
19
+ * a fixture, a page object or a config sitting in `e2e/` or `cypress/support/`
20
+ * is not a test and cannot be run as one. The one exception is `__tests__/`,
21
+ * Jest's convention that everything inside it is a test whatever it is called.
22
+ * Exported for callers that must not act on a file merely because of where it
23
+ * lives. */
24
+ export declare function hasTestFileName(filePath: string): boolean;
17
25
  /** Whether a path is a test file, by directory or by name. Read by the route
18
26
  * checks: a route declared in a mock server or a spec fixture is not a surface
19
27
  * anyone serves. */
@@ -76,14 +76,49 @@ const TEST_ROOT_DIR = /(^|[\\/])(tests?|__tests__|__mocks__|e2e|cypress|testing)
76
76
  * `TEST_FILE_PATTERNS` rows it resembles — any extension, and `.`, `_` or `-`
77
77
  * before `test` — so no row above can stand in for it. */
78
78
  const TEST_FILE_NAME = /[._-](test|spec)\.[a-z]+$|(^|[\\/])test_[^\\/]*$/i;
79
+ /** The file's own NAME says it is a test — `login.spec.ts`, `orders.test.js`,
80
+ * `test_orders.py`, `UserDAOTest.java`. Almost entirely a NAME rule: a helper,
81
+ * a fixture, a page object or a config sitting in `e2e/` or `cypress/support/`
82
+ * is not a test and cannot be run as one. The one exception is `__tests__/`,
83
+ * Jest's convention that everything inside it is a test whatever it is called.
84
+ * Exported for callers that must not act on a file merely because of where it
85
+ * lives. */
86
+ export function hasTestFileName(filePath) {
87
+ return (
88
+ // Discovery's own name rule, applied to the basename so it admits no
89
+ // directory. It carries the framework spellings the regexes below miss:
90
+ // `UserDAOTest.java`, `orders_smoke.py`, `checkout_e2e.ts`.
91
+ TEST_FILE_PATTERNS.some((p) => p.test(path.basename(filePath))) ||
92
+ TEST_FILE_NAME.test(filePath) ||
93
+ CAMEL_TEST_FILE_NAME.test(filePath) ||
94
+ // Surefire's default includes are `Test*.java` as well as `*Test.java`, and
95
+ // Failsafe's are `*IT.java`. CAMEL_TEST_FILE_NAME needs a lowercase
96
+ // character before the suffix, so the acronym spelling (`APIIT.java`) and
97
+ // the prefix spelling (`TestOrder.java`) both fall through it.
98
+ /(^|[\\/])Test[A-Z][A-Za-z0-9]*\.(java|kt|kts|scala)$/.test(filePath) ||
99
+ /[A-Za-z0-9]IT\.(java|kt|kts|scala)$/.test(filePath) ||
100
+ // mocha's default spec glob is `./test/*.js` — one directory level, and no
101
+ // name rule at all, so `test/app.js` is a test to mocha.
102
+ /(^|[\\/])test[\\/][^\\/]+\.(js|cjs|mjs)$/.test(filePath) ||
103
+ // `login.e2e.ts` and Cypress's own `login.cy.ts` — the dot forms
104
+ // TEST_FILE_NAME does not carry. `.cy.` is to Cypress what `.spec.` is to
105
+ // Playwright.
106
+ /\.(cy|e2e)\.[a-z]+$/i.test(filePath) ||
107
+ // Jest's convention: everything under `__tests__/` is a test, whatever it
108
+ // is called. The only directory that means that on its own.
109
+ /(^|[\\/])__tests__[\\/]/.test(filePath));
110
+ }
79
111
  /** The CamelCase spellings, which carry no separator before `Test`.
80
- * Case-SENSITIVE and must stay so: with `i` it also matches `Latest.java` and
81
- * `Manifest.cs`, ordinary source files. That is why the case-insensitive
82
- * `*Test.java` / `*Tests.cs` rows above cannot serve here. */
112
+ * Case-SENSITIVE and must stay so: with `i` it also matches `Latest.java`,
113
+ * `Audit.java`, `Edit.cs` and `Digit.ts`, ordinary source files. That is why
114
+ * the case-insensitive `*Test.java` / `*Tests.cs` rows above cannot serve
115
+ * here. */
83
116
  const CAMEL_TEST_FILE_NAME = /[a-z0-9](Tests?|IT)\.[A-Za-z0-9]+$/;
84
117
  /** Whether a path is a test file, by directory or by name. Read by the route
85
118
  * checks: a route declared in a mock server or a spec fixture is not a surface
86
119
  * anyone serves. */
87
120
  export function isTestPath(file) {
88
- return TEST_ROOT_DIR.test(file) || TEST_FILE_NAME.test(file) || CAMEL_TEST_FILE_NAME.test(file);
121
+ return (TEST_ROOT_DIR.test(file) ||
122
+ TEST_FILE_NAME.test(file) ||
123
+ CAMEL_TEST_FILE_NAME.test(file));
89
124
  }
@@ -9,7 +9,12 @@ import { walkDir } from "./fileWalk.js";
9
9
  const FLOW_GAP_MS = 30_000;
10
10
  // Redact-only headers: scrub these from traces but don't treat them as extractable auth headers.
11
11
  // set-cookie carries session tokens; auth-token / client-secret / access-token are generic secrets.
12
- const REDACT_ONLY_HEADERS = new Set(["set-cookie", "auth-token", "client-secret", "access-token"]);
12
+ const REDACT_ONLY_HEADERS = new Set([
13
+ "set-cookie",
14
+ "auth-token",
15
+ "client-secret",
16
+ "access-token",
17
+ ]);
13
18
  // Build redaction check from the shared KNOWN_AUTH_HEADERS set (workspaceAuth.ts) plus
14
19
  // the redact-only extras. Uses exact matching — KNOWN_AUTH_HEADERS covers all known variants.
15
20
  function isSensitiveHeader(name) {
@@ -29,7 +34,11 @@ function groupIntoFlows(entries) {
29
34
  if (curr - prev > FLOW_GAP_MS) {
30
35
  const first = new Date(current[0].timestamp).getTime();
31
36
  const last = new Date(current[current.length - 1].timestamp).getTime();
32
- flows.push({ flowId: `flow-${flowIdx++}`, entries: current, durationMs: last - first });
37
+ flows.push({
38
+ flowId: `flow-${flowIdx++}`,
39
+ entries: current,
40
+ durationMs: last - first,
41
+ });
33
42
  current = [];
34
43
  }
35
44
  current.push(sorted[i]);
@@ -37,7 +46,11 @@ function groupIntoFlows(entries) {
37
46
  if (current.length > 0) {
38
47
  const first = new Date(current[0].timestamp).getTime();
39
48
  const last = new Date(current[current.length - 1].timestamp).getTime();
40
- flows.push({ flowId: `flow-${flowIdx}`, entries: current, durationMs: last - first });
49
+ flows.push({
50
+ flowId: `flow-${flowIdx}`,
51
+ entries: current,
52
+ durationMs: last - first,
53
+ });
41
54
  }
42
55
  return flows;
43
56
  }
@@ -52,20 +65,34 @@ function parseSkyrampTrace(data) {
52
65
  return data.map((entry) => {
53
66
  const rawQp = entry.QueryParams || entry.queryParams;
54
67
  let queryParams;
55
- if (rawQp && typeof rawQp === "object" && !Array.isArray(rawQp) && Object.keys(rawQp).length > 0) {
68
+ if (rawQp &&
69
+ typeof rawQp === "object" &&
70
+ !Array.isArray(rawQp) &&
71
+ Object.keys(rawQp).length > 0) {
56
72
  queryParams = {};
57
73
  for (const [k, v] of Object.entries(rawQp)) {
58
74
  queryParams[k] = Array.isArray(v) ? v.map(String) : [String(v)];
59
75
  }
60
76
  }
61
77
  return {
62
- method: (entry.method || entry.Method || entry.request?.method || "GET").toUpperCase(),
78
+ method: (entry.method ||
79
+ entry.Method ||
80
+ entry.request?.method ||
81
+ "GET").toUpperCase(),
63
82
  path: entry.path || entry.Path || entry.url || entry.request?.url || "/",
64
- statusCode: entry.statusCode || entry.StatusCode || entry.status || entry.response?.status || 0,
65
- requestHeaders: entry.request?.headers ? sanitizeHeaders(entry.request.headers) : undefined,
83
+ statusCode: entry.statusCode ||
84
+ entry.StatusCode ||
85
+ entry.status ||
86
+ entry.response?.status ||
87
+ 0,
88
+ requestHeaders: entry.request?.headers
89
+ ? sanitizeHeaders(entry.request.headers)
90
+ : undefined,
66
91
  requestBody: summarizeBody(entry.request?.body ?? entry.requestBody ?? entry.RequestBody),
67
92
  queryParams,
68
- responseHeaders: entry.response?.headers ? sanitizeHeaders(entry.response.headers) : undefined,
93
+ responseHeaders: entry.response?.headers
94
+ ? sanitizeHeaders(entry.response.headers)
95
+ : undefined,
69
96
  responseBody: summarizeBody(entry.response?.body ?? entry.responseBody ?? entry.ResponseBody),
70
97
  timestamp: entry.timestamp || entry.Timestamp || entry.request?.timestamp || "",
71
98
  };
@@ -165,7 +192,18 @@ export async function parseTraceFile(filePath) {
165
192
  const userFlows = groupIntoFlows(entries);
166
193
  return { entries, userFlows, format };
167
194
  }
168
- const SKIP_DIRS = new Set(["node_modules", ".git", "dist", "build", ".next", ".nuxt", "coverage", "__pycache__", ".venv", "venv"]);
195
+ const SKIP_DIRS = new Set([
196
+ "node_modules",
197
+ ".git",
198
+ "dist",
199
+ "build",
200
+ ".next",
201
+ ".nuxt",
202
+ "coverage",
203
+ "__pycache__",
204
+ ".venv",
205
+ "venv",
206
+ ]);
169
207
  /** Known test-artifact directories where testbot-generated traces are written. */
170
208
  const TRACE_SCAN_DIRS = [".skyramp", "tests", "test", "e2e", "playwright"];
171
209
  /**
@@ -173,7 +211,10 @@ const TRACE_SCAN_DIRS = [".skyramp", "tests", "test", "e2e", "playwright"];
173
211
  * levels below `dir` (maxDepth 0 = only files directly in `dir`).
174
212
  */
175
213
  function scanDir(dir, predicate, maxDepth, results) {
176
- const opts = { maxDepth, shouldSkipDir: (entry) => SKIP_DIRS.has(entry.name) };
214
+ const opts = {
215
+ maxDepth,
216
+ shouldSkipDir: (entry) => SKIP_DIRS.has(entry.name),
217
+ };
177
218
  for (const [entry, full] of walkDir(dir, opts)) {
178
219
  if (predicate(entry.name))
179
220
  results.push(full);
@@ -201,7 +242,13 @@ function scanTraceArtifactDirs(repositoryPath, predicate, results) {
201
242
  export function discoverTraceFiles(repositoryPath) {
202
243
  const found = [];
203
244
  // Fixed-name candidates at repo root
204
- for (const name of ["skyramp_traces.json", "traces.json", "trace.json", "traces.har", "trace.har"]) {
245
+ for (const name of [
246
+ "skyramp_traces.json",
247
+ "traces.json",
248
+ "trace.json",
249
+ "traces.har",
250
+ "trace.har",
251
+ ]) {
205
252
  const full = `${repositoryPath}/${name}`;
206
253
  if (fs.existsSync(full))
207
254
  found.push(full);
@@ -221,9 +268,10 @@ export function discoverTraceFiles(repositoryPath) {
221
268
  export function discoverPlaywrightZips(repositoryPath) {
222
269
  const found = [];
223
270
  // Match: *playwright*.zip OR *_trace.zip (skyramp_export_zip output) OR trace.zip
224
- const isPlaywrightZip = (name) => /\.zip$/i.test(name) && (/playwright/i.test(name) ||
225
- /_trace\.zip$/i.test(name) ||
226
- name.toLowerCase() === "trace.zip");
271
+ const isPlaywrightZip = (name) => /\.zip$/i.test(name) &&
272
+ (/playwright/i.test(name) ||
273
+ /_trace\.zip$/i.test(name) ||
274
+ name.toLowerCase() === "trace.zip");
227
275
  scanTraceArtifactDirs(repositoryPath, isPlaywrightZip, found);
228
276
  return [...new Set(found)].sort();
229
277
  }
@@ -27,7 +27,9 @@ export function pathFromEndpointURL(endpointURL) {
27
27
  if (!endpointURL)
28
28
  return undefined;
29
29
  try {
30
- return new URL(endpointURL).pathname.replace(/%7B/gi, "{").replace(/%7D/gi, "}");
30
+ return new URL(endpointURL).pathname
31
+ .replace(/%7B/gi, "{")
32
+ .replace(/%7D/gi, "}");
31
33
  }
32
34
  catch {
33
35
  return endpointURL.startsWith("/") ? endpointURL : undefined;
@@ -25,3 +25,49 @@ import type { UtilsLanguage } from "./language-spec.js";
25
25
  * helper in either language gets the same key.
26
26
  */
27
27
  export declare function actionKeyOf(body: string, language?: UtilsLanguage): string | undefined;
28
+ /** The keys of every step, in order, or `undefined` when there is no step or a
29
+ * step has no key — the sequence `actionKeyOf` joins, kept as steps for a caller
30
+ * that matches step by step (a key is not split back: a selector may carry the
31
+ * separator). */
32
+ export declare function actionStepKeys(steps: ActionStep[]): string[] | undefined;
33
+ /** One Playwright action in a body, in source order — the unit `actionKeyOf` joins. */
34
+ export interface ActionStep {
35
+ /** The step's key (`verb chain [target]`), or `undefined` when this action cannot
36
+ * be read: its locator is not built from plain string literals, or its arguments
37
+ * do not balance. A helper with one such step has no key; a spec's other steps
38
+ * are still read, so an unreadable step is a boundary no matched run crosses. */
39
+ key?: string;
40
+ /** 1-based line of the action verb. */
41
+ line: number;
42
+ /** The source between the previous action's closing `)` (or the start of the
43
+ * body) and this action's chain: what stands between two consecutive actions.
44
+ * Comments are as the caller left them; string contents are kept. Empty for
45
+ * the first step. See `betweenActionsIsTransparent`. */
46
+ gapBefore: string;
47
+ /** The source after this action's closing `)` up to the next action's chain, or
48
+ * to the end of the body for the last step — the next step's `gapBefore`. */
49
+ gapAfter: string;
50
+ }
51
+ /**
52
+ * Every action in `body`, in order, each keyed as `actionKeyOf` keys it. Where
53
+ * `actionKeyOf` answers "what does this helper do" with one string, this answers
54
+ * "which actions, where, and what sits between them" — what a scan for an inline
55
+ * copy of a helper's sequence needs. Lines survive the Python and alias rewrites:
56
+ * neither adds or removes a newline.
57
+ */
58
+ export declare function actionStepsOf(body: string, language?: UtilsLanguage): ActionStep[];
59
+ /** `click empty-cart-btn; fill qty` → `click \`empty-cart-btn\`; fill \`qty\`` — the
60
+ * key as the agent reads it, selectors quoted so a `#id` never reads as prose. */
61
+ export declare function describeActionKey(key: string): string;
62
+ /** Index of the `)` that closes the `(` at `open`, on a string-blanked copy. */
63
+ export declare function matchingClose(structure: string, open: number): number;
64
+ /** Whitespace and braces dropped outside string literals, `'` normalised to `"` —
65
+ * the spelling a locator chain has inside a key. */
66
+ export declare function normalizeChain(text: string): string;
67
+ /** String contents replaced by spaces, delimiters kept, same length. */
68
+ export declare function blankStringContents(text: string): string;
69
+ /** The statements of a fragment as `[start, end)` spans on `structure` (a
70
+ * string-blanked copy): each cut where valueEnd cuts — a `;` at depth 0, or a line
71
+ * end at depth 0 that the next line does not continue with `.` — so a
72
+ * Prettier-wrapped chain is one statement, not one per line. */
73
+ export declare function statementSpans(structure: string): [number, number][];