@skyramp/mcp 0.4.1 → 0.4.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (543) hide show
  1. package/build/adapters/jestAdapter.js +23 -5
  2. package/build/adapters/mochaAdapter.js +7 -1
  3. package/build/adapters/playwrightAdapter.js +3 -1
  4. package/build/adapters/pytestAdapter.js +14 -3
  5. package/build/commands/localDevTestChangesCommand.js +1 -0
  6. package/build/commands/recommendTestsAndExecuteCommand.js +5 -6
  7. package/build/commands/testThisEndpointCommand.js +16 -4
  8. package/build/index.js +34 -4
  9. package/build/playwright/blueprintDigest.js +28 -7
  10. package/build/playwright/registerPlaywrightTools.js +33 -28
  11. package/build/playwright/traceRecordingPrompt.js +9 -2
  12. package/build/prompts/code-reuse.js +95 -29
  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 +3 -1
  17. package/build/prompts/local-dev/local-dev-prompts.d.ts +1 -1
  18. package/build/prompts/local-dev/local-dev-prompts.js +30 -3
  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 +88 -2
  26. package/build/prompts/shared-helper-policy.js +145 -11
  27. package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.js +1 -1
  28. package/build/prompts/sut-setup/modes/dockerComposePrompt.js +1 -1
  29. package/build/prompts/sut-setup/shared.d.ts +4 -1
  30. package/build/prompts/sut-setup/shared.js +2 -2
  31. package/build/prompts/test-maintenance/actionsInstructions.d.ts +19 -11
  32. package/build/prompts/test-maintenance/actionsInstructions.js +47 -26
  33. package/build/prompts/test-maintenance/drift-analysis-prompt.js +3 -2
  34. package/build/prompts/test-maintenance/driftAnalysisSections.js +5 -3
  35. package/build/prompts/test-maintenance/driftAnalysisShared.js +4 -2
  36. package/build/prompts/test-maintenance/uiDriftAnalysisSections.js +7 -4
  37. package/build/prompts/test-recommendation/recommendationSections.js +19 -8
  38. package/build/prompts/test-recommendation/registerRecommendTestsPrompt.js +5 -2
  39. package/build/prompts/test-recommendation/test-recommendation-prompt.js +10 -7
  40. package/build/prompts/testbot/testbot-prompts.js +123 -55
  41. package/build/recommendation/answers.js +18 -9
  42. package/build/recommendation/pullRequestText.js +1 -1
  43. package/build/recommendation/registerPlan.js +31 -17
  44. package/build/recommendation/subjectStep.d.ts +8 -10
  45. package/build/recommendation/subjectStep.js +17 -16
  46. package/build/recommendation/types.d.ts +71 -17
  47. package/build/recommendation/types.js +9 -15
  48. package/build/recommendation/verifierContracts.d.ts +7 -3
  49. package/build/recommendation/verifierContracts.js +8 -4
  50. package/build/recommendation/verifiers/changedFile.js +11 -13
  51. package/build/recommendation/verifiers/citedPath.d.ts +8 -0
  52. package/build/recommendation/verifiers/citedPath.js +16 -2
  53. package/build/recommendation/verifiers/coverage.d.ts +2 -2
  54. package/build/recommendation/verifiers/coverage.js +190 -134
  55. package/build/recommendation/verifiers/defects.js +56 -16
  56. package/build/recommendation/verifiers/deliveredMatchesPlan.d.ts +7 -1
  57. package/build/recommendation/verifiers/deliveredMatchesPlan.js +28 -14
  58. package/build/recommendation/verifiers/endpointGrounded.js +14 -8
  59. package/build/recommendation/verifiers/existingCoverage.d.ts +6 -0
  60. package/build/recommendation/verifiers/existingCoverage.js +30 -21
  61. package/build/recommendation/verifiers/expectedOutcome.js +17 -8
  62. package/build/recommendation/verifiers/expectedValueSourced.js +54 -43
  63. package/build/recommendation/verifiers/issueTraceability.d.ts +5 -0
  64. package/build/recommendation/verifiers/issueTraceability.js +64 -7
  65. package/build/recommendation/verifiers/removedElementGuarded.js +19 -11
  66. package/build/recommendation/verifiers/reportedCategory.js +9 -4
  67. package/build/recommendation/verifiers/requirementSourced.js +34 -21
  68. package/build/recommendation/verifiers/screenRoute.js +15 -10
  69. package/build/recommendation/verifiers/statedDifference.js +15 -8
  70. package/build/recommendation/verifiers/uiElementGrounded.js +50 -16
  71. package/build/resources/analysisResources.js +7 -3
  72. package/build/resources/progressResource.js +4 -2
  73. package/build/resources/sutSetupResource.js +20 -2
  74. package/build/resources/testbotResource.js +19 -1
  75. package/build/services/AnalyticsService.js +3 -1
  76. package/build/services/ScenarioGenerationService.js +5 -5
  77. package/build/services/TestDiscoveryService.js +21 -5
  78. package/build/services/TestExecutionService.js +63 -21
  79. package/build/services/TestGenerationService.d.ts +1 -1
  80. package/build/services/TestGenerationService.js +43 -24
  81. package/build/skills/enhanceAssertionsSkill.d.ts +45 -0
  82. package/build/skills/enhanceAssertionsSkill.js +103 -0
  83. package/build/skills/fixTestImportErrorsSkill.d.ts +2 -2
  84. package/build/skills/fixTestImportErrorsSkill.js +2 -2
  85. package/build/skills/skillFiles.d.ts +38 -0
  86. package/build/skills/skillFiles.js +94 -0
  87. package/build/skills/validateAssertionAlignmentSkill.d.ts +34 -0
  88. package/build/skills/validateAssertionAlignmentSkill.js +59 -0
  89. package/build/tool-phases.js +4 -0
  90. package/build/tools/auth/loginTool.js +3 -1
  91. package/build/tools/auth/logoutTool.js +3 -1
  92. package/build/tools/code-refactor/alignAssertionsTool.d.ts +2 -0
  93. package/build/tools/code-refactor/alignAssertionsTool.js +51 -0
  94. package/build/tools/code-refactor/assertion-state.d.ts +1 -1
  95. package/build/tools/code-refactor/assertion-state.js +1 -1
  96. package/build/tools/code-refactor/assertionOperations.d.ts +44 -0
  97. package/build/tools/code-refactor/assertionOperations.js +82 -0
  98. package/build/tools/code-refactor/assertionSkillTools.d.ts +3 -0
  99. package/build/tools/code-refactor/assertionSkillTools.js +86 -0
  100. package/build/tools/code-refactor/codeReuseTool.js +27 -3
  101. package/build/tools/code-refactor/enhanceAssertionsTool.js +19 -83
  102. package/build/tools/code-refactor/gate-markers.d.ts +51 -0
  103. package/build/tools/code-refactor/gate-markers.js +95 -0
  104. package/build/tools/code-refactor/retrofit-state.d.ts +3 -1
  105. package/build/tools/code-refactor/retrofit-state.js +44 -2
  106. package/build/tools/code-refactor/reuse-outcome.d.ts +23 -1
  107. package/build/tools/code-refactor/reuse-outcome.js +36 -13
  108. package/build/tools/code-refactor/reuse-state.d.ts +90 -16
  109. package/build/tools/code-refactor/reuse-state.js +191 -61
  110. package/build/tools/code-refactor/utils-verify-gates.d.ts +4 -0
  111. package/build/tools/code-refactor/utils-verify-gates.js +252 -27
  112. package/build/tools/code-refactor/verify-gates.d.ts +15 -1
  113. package/build/tools/code-refactor/verify-gates.js +36 -4
  114. package/build/tools/enrichTestWithMocksTool.d.ts +1 -1
  115. package/build/tools/enrichTestWithMocksTool.js +9 -5
  116. package/build/tools/executeSkyrampTestTool.d.ts +22 -1
  117. package/build/tools/executeSkyrampTestTool.js +571 -271
  118. package/build/tools/execution-video-state.js +1 -1
  119. package/build/tools/fixErrorTool.js +5 -6
  120. package/build/tools/generate-tests/batchMockGenerationTool.js +1 -1
  121. package/build/tools/generate-tests/generateBatchScenarioRestTool.js +114 -73
  122. package/build/tools/generate-tests/generateContractRestTool.js +34 -16
  123. package/build/tools/generate-tests/generateE2ERestTool.d.ts +1 -0
  124. package/build/tools/generate-tests/generateE2ERestTool.js +9 -1
  125. package/build/tools/generate-tests/generateIntegrationRestTool.js +22 -7
  126. package/build/tools/generate-tests/generateMockRestTool.js +3 -1
  127. package/build/tools/generate-tests/generateUIRestTool.d.ts +2 -0
  128. package/build/tools/generate-tests/generateUIRestTool.js +11 -2
  129. package/build/tools/generate-tests/loadTestSchema.js +1 -3
  130. package/build/tools/generate-tests/planGuard.js +6 -3
  131. package/build/tools/generate-tests/scenarioFileIdentity.js +4 -1
  132. package/build/tools/generate-tests/scenarioLint.js +17 -5
  133. package/build/tools/generate-tests/trace-reuse-guard.js +5 -2
  134. package/build/tools/generateEnrichedIntegrationTestTool.js +9 -3
  135. package/build/tools/one-click/oneClickTool.js +3 -1
  136. package/build/tools/preflightMockCheckTool.js +23 -7
  137. package/build/tools/runExistingTestsTool.d.ts +1 -1
  138. package/build/tools/runExistingTestsTool.js +43 -21
  139. package/build/tools/submitReportTool.d.ts +51 -12
  140. package/build/tools/submitReportTool.js +860 -161
  141. package/build/tools/test-management/actionsTool.js +210 -51
  142. package/build/tools/test-management/analyzeChangesTool.d.ts +4 -5
  143. package/build/tools/test-management/analyzeChangesTool.js +127 -68
  144. package/build/tools/test-management/analyzeTestHealthTool.js +35 -13
  145. package/build/tools/test-management/registerTestPlanTool.d.ts +44 -34
  146. package/build/tools/test-management/registerTestPlanTool.js +255 -111
  147. package/build/tools/test-management/resolveScreenTool.js +33 -9
  148. package/build/tools/trace/startTraceCollectionTool.js +3 -1
  149. package/build/tools/trace/stopTraceCollectionTool.js +41 -5
  150. package/build/tools/verifyTestDependenciesTool.d.ts +3 -0
  151. package/build/tools/verifyTestDependenciesTool.js +54 -0
  152. package/build/tools/workspace/initScanWorkspaceTool.js +9 -3
  153. package/build/tools/workspace/initializeWorkspaceTool.js +3 -1
  154. package/build/types/AssertionOutcome.d.ts +1 -1
  155. package/build/types/EnhanceType.d.ts +6 -0
  156. package/build/types/EnhanceType.js +1 -0
  157. package/build/types/ExternalTestExecution.d.ts +2 -2
  158. package/build/types/RepositoryAnalysis.d.ts +0 -40
  159. package/build/types/ReuseOutcome.d.ts +96 -4
  160. package/build/types/ReuseOutcome.js +16 -0
  161. package/build/types/StepMethod.js +20 -6
  162. package/build/types/TestAnalysis.d.ts +10 -2
  163. package/build/types/TestExecution.d.ts +45 -0
  164. package/build/types/TestRecommendation.d.ts +1 -1
  165. package/build/types/TestRecommendation.js +4 -1
  166. package/build/types/TestTypes.d.ts +13 -0
  167. package/build/types/TestTypes.js +34 -3
  168. package/build/types/TestbotPromptOptions.d.ts +9 -1
  169. package/build/types/TestbotReport.d.ts +45 -9
  170. package/build/utils/AnalysisStateManager.d.ts +137 -27
  171. package/build/utils/AnalysisStateManager.js +227 -43
  172. package/build/utils/assertion-verify/api-shared-lints.js +34 -16
  173. package/build/utils/assertion-verify/metrics.js +39 -6
  174. package/build/utils/assertion-verify/ui-lints.js +4 -2
  175. package/build/utils/branchDiff.js +47 -12
  176. package/build/utils/canonicalJson.js +3 -1
  177. package/build/utils/dartRouteExtractor.js +36 -7
  178. package/build/utils/fixAttempts.d.ts +26 -0
  179. package/build/utils/fixAttempts.js +109 -0
  180. package/build/utils/frontendSelectors.js +23 -4
  181. package/build/utils/generatedTestRecord.d.ts +19 -0
  182. package/build/utils/generatedTestRecord.js +61 -0
  183. package/build/utils/gitStaging.js +7 -2
  184. package/build/utils/initAgent.js +26 -6
  185. package/build/utils/language-helper.js +39 -45
  186. package/build/utils/pathMatching.js +2 -1
  187. package/build/utils/pathSignatures.js +6 -2
  188. package/build/utils/planMatchKeys.d.ts +2 -2
  189. package/build/utils/planMatchKeys.js +20 -14
  190. package/build/utils/pom-catalog-parse.js +7 -2
  191. package/build/utils/pom-scope/import-expansion.js +6 -1
  192. package/build/utils/pom-scope/index.js +50 -12
  193. package/build/utils/pom-scope/scoring.js +13 -3
  194. package/build/utils/pom-scope/selector-extractor.js +16 -3
  195. package/build/utils/pom-scope/strip.d.ts +8 -0
  196. package/build/utils/pom-scope/strip.js +238 -0
  197. package/build/utils/pom-scope/testIdDiscovery.js +14 -2
  198. package/build/utils/pom-verify/__fixtures__/af-style/asset-list.page.d.ts +1 -1
  199. package/build/utils/pom-verify/__fixtures__/af-style/asset-list.page.js +4 -2
  200. package/build/utils/pom-verify/__fixtures__/af-style/report.iframe.page.js +3 -1
  201. package/build/utils/pom-verify/__fixtures__/af-style/workflow-footer.page.js +3 -1
  202. package/build/utils/pom-verify/bindings.js +5 -1
  203. package/build/utils/pom-verify/calls.js +9 -2
  204. package/build/utils/pom-verify/verify.js +27 -5
  205. package/build/utils/pr-comment-parser.js +20 -7
  206. package/build/utils/proxy-terminal.d.ts +19 -1
  207. package/build/utils/proxy-terminal.js +346 -21
  208. package/build/utils/removedUiElements.js +1 -1
  209. package/build/utils/reportLanguage.js +35 -7
  210. package/build/utils/reportVerification.d.ts +14 -8
  211. package/build/utils/reportVerification.js +19 -19
  212. package/build/utils/repositorySlug.d.ts +32 -0
  213. package/build/utils/repositorySlug.js +77 -0
  214. package/build/utils/reuseRouting.js +6 -2
  215. package/build/utils/runSerialized.d.ts +3 -0
  216. package/build/utils/runSerialized.js +39 -0
  217. package/build/utils/screenRoutes.js +74 -18
  218. package/build/utils/sourceRouteExtractor.js +13 -6
  219. package/build/utils/telemetry.d.ts +1 -0
  220. package/build/utils/telemetry.js +8 -5
  221. package/build/utils/testDependencyPolicy.d.ts +9 -0
  222. package/build/utils/testDependencyPolicy.js +788 -0
  223. package/build/utils/testExecutionRecord.d.ts +90 -0
  224. package/build/utils/testExecutionRecord.js +267 -0
  225. package/build/utils/testFileClassification.js +3 -1
  226. package/build/utils/trace-parser.js +62 -14
  227. package/build/utils/urlPath.js +3 -1
  228. package/build/utils/utils-verify/action-key.d.ts +4 -0
  229. package/build/utils/utils-verify/action-key.js +2 -2
  230. package/build/utils/utils-verify/allow.d.ts +122 -3
  231. package/build/utils/utils-verify/allow.js +146 -21
  232. package/build/utils/utils-verify/body-reach.d.ts +120 -0
  233. package/build/utils/utils-verify/body-reach.js +335 -0
  234. package/build/utils/utils-verify/call-sites.d.ts +6 -1
  235. package/build/utils/utils-verify/call-sites.js +72 -8
  236. package/build/utils/utils-verify/delivered-imports.d.ts +43 -0
  237. package/build/utils/utils-verify/delivered-imports.js +84 -0
  238. package/build/utils/utils-verify/fixed-sleep.d.ts +96 -0
  239. package/build/utils/utils-verify/fixed-sleep.js +461 -0
  240. package/build/utils/utils-verify/in-house.d.ts +93 -0
  241. package/build/utils/utils-verify/in-house.js +719 -0
  242. package/build/utils/utils-verify/incumbent.d.ts +3 -0
  243. package/build/utils/utils-verify/incumbent.js +75 -0
  244. package/build/utils/utils-verify/index.d.ts +1 -0
  245. package/build/utils/utils-verify/index.js +1 -0
  246. package/build/utils/utils-verify/language-spec.d.ts +26 -10
  247. package/build/utils/utils-verify/language-spec.js +217 -20
  248. package/build/utils/utils-verify/locate.d.ts +26 -0
  249. package/build/utils/utils-verify/locate.js +125 -23
  250. package/build/utils/utils-verify/module-name.d.ts +40 -0
  251. package/build/utils/utils-verify/module-name.js +98 -0
  252. package/build/utils/utils-verify/parse.d.ts +46 -6
  253. package/build/utils/utils-verify/parse.js +176 -38
  254. package/build/utils/utils-verify/retrofit-equivalence.d.ts +5 -0
  255. package/build/utils/utils-verify/retrofit-equivalence.js +4 -2
  256. package/build/utils/utils-verify/stage.d.ts +5 -0
  257. package/build/utils/utils-verify/stage.js +47 -2
  258. package/build/utils/utils-verify/status-once.d.ts +62 -0
  259. package/build/utils/utils-verify/status-once.js +207 -0
  260. package/build/utils/utils-verify/typecheck.d.ts +61 -0
  261. package/build/utils/utils-verify/typecheck.js +338 -0
  262. package/build/utils/utils-verify/verify.d.ts +76 -1
  263. package/build/utils/utils-verify/verify.js +516 -44
  264. package/build/utils/versions.d.ts +3 -3
  265. package/build/utils/versions.js +1 -1
  266. package/build/utils/workspaceAuth.js +107 -37
  267. package/build/workspace/queryParamResolution.js +11 -4
  268. package/build/workspace/workspace.js +7 -7
  269. package/node_modules/playwright/ThirdPartyNotices.txt +19 -19
  270. package/node_modules/playwright/lib/mcp/skyramp/assertTool.js +8 -2
  271. package/node_modules/playwright/lib/mcp/skyramp/common/cssValue.js +87 -0
  272. package/node_modules/playwright/lib/mcp/skyramp/loadTraceTool.js +31 -0
  273. package/node_modules/playwright/lib/mcp/skyramp/skyRampImport.js +3 -0
  274. package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +181 -15
  275. package/node_modules/playwright/lib/mcp/test/skyRampExport.js +24 -0
  276. package/node_modules/playwright/lib/transform/babelBundleImpl.js +2353 -190
  277. package/node_modules/playwright/node_modules/playwright-core/ThirdPartyNotices.txt +62 -34
  278. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/.package-lock.json +72 -41
  279. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/@hono/node-server/dist/serve-static.js +1 -1
  280. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/@hono/node-server/dist/serve-static.mjs +1 -1
  281. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/@hono/node-server/package.json +2 -2
  282. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/README.md +16 -1
  283. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/index.js +4 -20
  284. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/read.js +17 -17
  285. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/json.js +60 -32
  286. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/raw.js +3 -3
  287. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/text.js +3 -3
  288. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/types/urlencoded.js +16 -20
  289. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/lib/utils.js +18 -16
  290. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/LICENSE +22 -0
  291. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/README.md +71 -0
  292. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +46 -0
  293. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/dist/index.js +176 -0
  294. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -0
  295. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/node_modules/content-type/package.json +52 -0
  296. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/body-parser/package.json +23 -10
  297. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/CHANGELOG.md +21 -14
  298. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/isObject.d.ts +1 -1
  299. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/package.json +6 -7
  300. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/es-object-atoms/tsconfig.json +1 -0
  301. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/index.js +266 -45
  302. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/lib/schemes.js +9 -4
  303. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/lib/utils.js +396 -92
  304. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/package.json +1 -1
  305. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
  306. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/equal.test.js +31 -3
  307. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/fixtures/uri-js-parse.json +2 -0
  308. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
  309. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
  310. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
  311. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
  312. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/parse.test.js +7 -3
  313. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
  314. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
  315. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
  316. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/security-normalization.test.js +101 -0
  317. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/security.test.js +301 -3
  318. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
  319. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
  320. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hasown/CHANGELOG.md +7 -0
  321. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hasown/index.d.ts +0 -1
  322. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hasown/package.json +4 -5
  323. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/client/client.js +30 -16
  324. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/client/utils.js +4 -1
  325. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/context.js +32 -13
  326. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/accepts/accepts.js +36 -2
  327. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/proxy/index.js +4 -0
  328. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/ssg/ssg.js +1 -1
  329. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/ssg/utils.js +30 -10
  330. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/streaming/sse.js +5 -4
  331. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/hono-base.js +10 -8
  332. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/base.js +44 -23
  333. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/components.js +25 -26
  334. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/context.js +5 -5
  335. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/dom/render.js +2 -0
  336. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/dom/server.js +5 -1
  337. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/hooks/index.js +16 -13
  338. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +3 -3
  339. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/streaming.js +4 -5
  340. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/cache/index.js +103 -8
  341. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/compress/index.js +5 -0
  342. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/cors/index.js +17 -14
  343. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/csrf/index.js +1 -1
  344. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/etag/digest.js +47 -1
  345. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/etag/index.js +7 -4
  346. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +9 -4
  347. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +9 -4
  348. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/language/language.js +10 -6
  349. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +90 -0
  350. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +3 -1
  351. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +16 -7
  352. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/request.js +20 -13
  353. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/linear-router/router.js +7 -2
  354. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/pattern-router/router.js +3 -9
  355. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +65 -59
  356. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +71 -128
  357. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +14 -5
  358. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/trie-router/node.js +47 -70
  359. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/trie-router/router.js +3 -11
  360. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/utils.js +27 -0
  361. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router.js +1 -1
  362. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/accept.js +1 -1
  363. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/body.js +21 -3
  364. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/cookie.js +4 -3
  365. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/ipaddr.js +5 -3
  366. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/stream.js +12 -3
  367. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/url.js +19 -11
  368. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/client/client.js +30 -16
  369. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/client/utils.js +4 -1
  370. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/context.js +32 -13
  371. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/accepts/accepts.js +36 -2
  372. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/proxy/index.js +4 -0
  373. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/ssg/ssg.js +1 -1
  374. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/ssg/utils.js +30 -10
  375. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/streaming/sse.js +5 -4
  376. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/hono-base.js +10 -8
  377. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/base.js +41 -23
  378. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/components.js +26 -27
  379. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/context.js +6 -6
  380. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/dom/render.js +2 -0
  381. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/dom/server.js +5 -1
  382. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/hooks/index.js +16 -13
  383. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/intrinsic-element/components.js +4 -4
  384. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/streaming.js +5 -6
  385. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/cache/index.js +103 -8
  386. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/compress/index.js +5 -0
  387. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/cors/index.js +17 -14
  388. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/csrf/index.js +1 -1
  389. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/etag/digest.js +47 -1
  390. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/etag/index.js +7 -4
  391. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/jwk/jwk.js +9 -4
  392. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/jwt/jwt.js +9 -4
  393. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/language/language.js +10 -6
  394. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/method-not-allowed/index.js +68 -0
  395. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/pretty-json/index.js +3 -1
  396. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +16 -7
  397. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/request.js +21 -14
  398. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/linear-router/router.js +7 -2
  399. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/pattern-router/router.js +3 -9
  400. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/reg-exp-router/node.js +61 -58
  401. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/reg-exp-router/router.js +77 -129
  402. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/reg-exp-router/trie.js +14 -5
  403. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/trie-router/node.js +47 -70
  404. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/trie-router/router.js +3 -11
  405. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/utils.js +5 -0
  406. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router.js +1 -1
  407. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +9 -0
  408. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/client/types.d.ts +1 -1
  409. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/context.d.ts +6 -2
  410. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/hono-base.d.ts +4 -3
  411. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/base.d.ts +7 -2
  412. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/dom/index.d.ts +5 -5
  413. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +2 -2
  414. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/dom/server.d.ts +5 -5
  415. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/hooks/index.d.ts +8 -6
  416. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/index.d.ts +5 -5
  417. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/cache/index.d.ts +6 -4
  418. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/combine/index.d.ts +1 -1
  419. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/cors/index.d.ts +1 -1
  420. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +2 -2
  421. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +2 -0
  422. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +2 -0
  423. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +49 -0
  424. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +3 -3
  425. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +4 -1
  426. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +2 -1
  427. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/trie-router/node.d.ts +1 -2
  428. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/trie-router/router.d.ts +0 -1
  429. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router/utils.d.ts +1 -0
  430. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/router.d.ts +1 -1
  431. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/utils/headers.d.ts +2 -2
  432. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/utils/url.d.ts +5 -0
  433. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/accept.js +1 -1
  434. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/body.js +21 -3
  435. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/cookie.js +5 -4
  436. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/ipaddr.js +5 -3
  437. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/stream.js +12 -3
  438. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/url.js +17 -10
  439. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/package.json +11 -4
  440. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/README.md +173 -143
  441. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/address-error.d.ts +11 -0
  442. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/address-error.js.map +1 -1
  443. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/common.d.ts +49 -0
  444. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/common.js +79 -4
  445. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/common.js.map +1 -1
  446. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv4.d.ts +78 -5
  447. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv4.js +119 -24
  448. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv4.js.map +1 -1
  449. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv6.d.ts +151 -10
  450. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv6.js +316 -90
  451. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/ipv6.js.map +1 -1
  452. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
  453. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v4/constants.js +45 -2
  454. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  455. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
  456. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v6/constants.js +50 -3
  457. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  458. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/ip-address/package.json +6 -4
  459. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/.github/THREAT_MODEL.md +3 -3
  460. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/CHANGELOG.md +26 -0
  461. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/README.md +19 -1
  462. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/dist/qs.js +25 -25
  463. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/eslint.config.mjs +1 -1
  464. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/lib/parse.js +16 -6
  465. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/lib/stringify.js +23 -8
  466. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/lib/utils.js +57 -11
  467. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/package.json +8 -7
  468. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/test/parse.js +419 -0
  469. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/test/stringify.js +317 -0
  470. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/qs/test/utils.js +206 -0
  471. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/CHANGELOG.md +10 -0
  472. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/README.md +1 -1
  473. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/index.js +5 -2
  474. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/package.json +10 -10
  475. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/side-channel/test/index.js +16 -0
  476. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/index.js +8 -18
  477. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/LICENSE +22 -0
  478. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/README.md +71 -0
  479. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/dist/index.d.ts +46 -0
  480. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/dist/index.js +176 -0
  481. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -0
  482. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/node_modules/content-type/package.json +52 -0
  483. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/type-is/package.json +9 -5
  484. package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/package-lock.json +72 -41
  485. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/.package-lock.json +6 -6
  486. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/brace-expansion/README.md +23 -1
  487. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/brace-expansion/index.js +265 -86
  488. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/brace-expansion/package.json +1 -1
  489. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/README.md +173 -143
  490. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/address-error.d.ts +11 -0
  491. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/address-error.js.map +1 -1
  492. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/common.d.ts +49 -0
  493. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/common.js +79 -4
  494. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/common.js.map +1 -1
  495. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv4.d.ts +78 -5
  496. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv4.js +119 -24
  497. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv4.js.map +1 -1
  498. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv6.d.ts +151 -10
  499. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv6.js +316 -90
  500. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/ipv6.js.map +1 -1
  501. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
  502. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v4/constants.js +45 -2
  503. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  504. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
  505. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v6/constants.js +50 -3
  506. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  507. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/ip-address/package.json +6 -4
  508. package/node_modules/playwright/node_modules/playwright-core/bundles/utils/package-lock.json +6 -6
  509. package/node_modules/playwright/node_modules/playwright-core/lib/cli/program.js +18 -9
  510. package/node_modules/playwright/node_modules/playwright-core/lib/mcpBundleImpl/index.js +47 -47
  511. package/node_modules/playwright/node_modules/playwright-core/lib/server/codegen/skyramp/jsonlReader.js +3 -0
  512. package/node_modules/playwright/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +42 -0
  513. package/node_modules/playwright/node_modules/playwright-core/lib/utilsBundleImpl/index.js +121 -121
  514. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/{index.B7KbSQcC.js → index.BAkLd5DX.js} +1 -1
  515. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/index.html +1 -1
  516. package/node_modules/playwright/node_modules/playwright-core/package.json +1 -1
  517. package/node_modules/playwright/node_modules/playwright-core/src/cli/program.ts +31 -9
  518. package/node_modules/playwright/node_modules/playwright-core/src/server/codegen/skyramp/jsonlReader.ts +1 -0
  519. package/node_modules/playwright/node_modules/playwright-core/src/server/recorder/recorderRunner.ts +57 -1
  520. package/node_modules/playwright/package.json +2 -2
  521. package/package.json +7 -6
  522. package/plugin/prompts/code-reuse/hand-off.md +30 -0
  523. package/plugin/prompts/generate-tests/generation.md +1 -1
  524. package/plugin/prompts/plan-tests.md +14 -14
  525. package/plugin/prompts/testbot-task1.md +4 -2
  526. package/plugin/skills/enhance-assertions/SKILL.md +25 -0
  527. package/plugin/skills/enhance-assertions/reference/contract.md +51 -0
  528. package/plugin/skills/enhance-assertions/reference/integration.md +58 -0
  529. package/plugin/skills/enhance-assertions/reference/shared-rules.md +220 -0
  530. package/plugin/skills/enhance-assertions/reference/ui.md +373 -0
  531. package/plugin/skills/fix-test-import-errors/SKILL.md +44 -50
  532. package/plugin/skills/validate-assertion-alignment-post-execution/SKILL.md +32 -0
  533. package/plugin/skills/validate-assertion-alignment-post-execution/reference/checks.md +44 -0
  534. package/plugin/skills/validate-assertion-alignment-post-execution/reference/evidence.md +47 -0
  535. package/build/prompts/enhance-assertions/contractProviderAssertionsPrompt.d.ts +0 -2
  536. package/build/prompts/enhance-assertions/contractProviderAssertionsPrompt.js +0 -29
  537. package/build/prompts/enhance-assertions/integrationAssertionsPrompt.d.ts +0 -2
  538. package/build/prompts/enhance-assertions/integrationAssertionsPrompt.js +0 -36
  539. package/build/prompts/enhance-assertions/sharedAssertionRules.d.ts +0 -16
  540. package/build/prompts/enhance-assertions/sharedAssertionRules.js +0 -284
  541. package/build/prompts/enhance-assertions/uiAssertionsPrompt.d.ts +0 -2
  542. package/build/prompts/enhance-assertions/uiAssertionsPrompt.js +0 -388
  543. package/node_modules/playwright/node_modules/playwright-core/.DS_Store +0 -0
@@ -2,24 +2,21 @@ import { generateSkyrampHeader, SKYRAMP_UTILS_HEADER } from "../utils/utils.js";
2
2
  import { isUtilsReuseEnabled } from "../utils/featureFlags.js";
3
3
  import { isModularizeFirstTarget, isPomAwareTarget, } from "../utils/reuseRouting.js";
4
4
  import { getPomAwareCodeReusePrompt } from "./pom-aware-code-reuse.js";
5
- import { NO_SHADOWING_RULE, selectHelperPolicy, } from "./shared-helper-policy.js";
5
+ import { NO_SHADOWING_RULE, SELECTOR_OWNING_MODULE_RULE, selectHelperPolicy, } from "./shared-helper-policy.js";
6
+ import { UTILS_LANGUAGE_SPECS } from "../utils/utils-verify/language-spec.js";
7
+ /** The prescribed module name comes from the verifier's language table, which is the
8
+ * ONE declaration of it: the instruction the agent reads and the name the verify pass
9
+ * demands cannot drift apart. Java is stated here because utils reuse is disabled for
10
+ * it, so the verifier has no entry to read. */
6
11
  const LANGUAGE_MAP = {
7
- python: {
8
- extension: "py",
9
- fileName: "SkyrampUtils.py",
10
- },
12
+ ...Object.fromEntries(Object.entries(UTILS_LANGUAGE_SPECS).map(([language, spec]) => [
13
+ language,
14
+ { extension: spec.extensions[0].slice(1), fileName: spec.fileName },
15
+ ])),
11
16
  java: {
12
17
  extension: "java",
13
18
  fileName: "SkyrampUtils.java",
14
19
  },
15
- javascript: {
16
- extension: "js",
17
- fileName: "skyrampUtils.js",
18
- },
19
- typescript: {
20
- extension: "ts",
21
- fileName: "skyrampUtils.ts",
22
- },
23
20
  };
24
21
  function genericNearDupExample(testFile) {
25
22
  return `### Worked example
@@ -52,18 +49,16 @@ export async function uploadFileToRFI(page, fileName, tabName) {
52
49
  }
53
50
  \`\`\`
54
51
 
55
- These ARE near-duplicates. Same primitive sequence; the only material difference is the \`.first()\` qualifier on the locator. \`tabName\` is unused in the body — recorder noise, drop it. Correct merge:
52
+ These ARE near-duplicates. Same primitive sequence; the only material difference is the \`.first()\` qualifier on the locator. \`tabName\` is unused in the body — recorder noise, drop it. The \`waitForTimeout\` lines are recorder noise too: a fixed sleep is not a structural wait, and in a shared helper every importer pays it on every run. The \`waitForResponse\` correlation and the \`filechooser\` event already cover this step, so the merged helper waits on those; where a step has no such signal, wait on the element the next line touches. Correct merge:
56
53
 
57
54
  \`\`\`ts
58
55
  export async function uploadFileViaChooser(page: Page, fileName: string) {
59
- await page.waitForTimeout(1500);
60
56
  const responsePromise = page.waitForResponse("**/api/files/upload**");
61
57
  const fileUploadPromise = page.waitForEvent("filechooser");
62
58
  await page.getByText("Choose a file").first().click();
63
59
  const fileChooser = await fileUploadPromise;
64
60
  await fileChooser.setFiles(fileName);
65
61
  await responsePromise;
66
- await page.waitForTimeout(1500);
67
62
  }
68
63
  \`\`\`
69
64
 
@@ -101,6 +96,11 @@ export function getCodeReusePrompt(testFile, language, framework, scopedPoms, te
101
96
  // file. STEP 5b seeds the utils file from the current test's own helpers so
102
97
  // this run's output carries it and later tests import instead of re-defining.
103
98
  const seedsUtils = modularizeFirst;
99
+ // The name is prescribed in LANGUAGE_MAP and, until the verify pass checked it,
100
+ // nothing held a run to it: testplan-run-9 delivered `skyrampUiUtils.ts` on one
101
+ // fixture and `skyrampUtils.ts` on another, for the same role on one repository.
102
+ // Stated once and rendered at both places that create the file.
103
+ const moduleNameRule = `**THE MODULE'S NAME IS NOT A CHOICE.** The shared module for ${lang} is \`${fileName}\`, and a module you create carries exactly that name — a later run against this repository then finds and extends it instead of writing a second module beside it under another name. A module that ALREADY EXISTS keeps the name it has: never rename it, whatever it is called, because tests you cannot see import it. Only where \`${fileName}\` is already large may a SECOND module carry another name.`;
104
104
  // Naming, equivalence and assertion rules for helpers headed to the shared
105
105
  // file are the helper policy's — selected once by test type, stated once.
106
106
  const policy = selectHelperPolicy(testType);
@@ -115,13 +115,31 @@ export function getCodeReusePrompt(testFile, language, framework, scopedPoms, te
115
115
  ? `**IF NO OTHER SKYRAMP-GENERATED TEST FILES ARE FOUND, SKIP DIRECTLY TO STEP 5b — do not process STEP 4b or STEP 5.**`
116
116
  : `**STOP HERE IF NO OTHER SKYRAMP-GENERATED TEST FILES FOUND**
117
117
  **IF NO OTHER SKYRAMP-GENERATED TEST FILES ARE FOUND, SKIP TO STEP 6 - DO NOT CREATE ANY UTILS FILES.**`;
118
+ // The repository's own browser helper modules. UI only, and only on the seeded
119
+ // (utils reuse on, page-object reuse off) flow: a browser test and the helpers it
120
+ // calls drive one library, so the verifier's action key compares a step to the
121
+ // customer's helper; the API side has no such key and is a separate change.
122
+ const inHouseBrowser = seedsUtils && policy.kind === "browser";
123
+ const inHouseDiscoveryStep = inHouseBrowser
124
+ ? inHouseDiscovery(testFile, fileName)
125
+ : "";
126
+ const inHouseMatchStep = inHouseBrowser
127
+ ? inHouseMatch(testFile, fileName, policy)
128
+ : "";
129
+ const inHouseSeedRule = inHouseBrowser
130
+ ? `
131
+ **IF STEP 2b FOUND A QUALIFYING IN-HOUSE MODULE, SKIP THIS STEP.** STEP 3b already placed each of this test's helpers: replaced by a call to one of theirs, or added to their module in their style. A helper STEP 3b left local (their matching helper's key is undefined) stays local in ${testFile} — it is not moved into \`${fileName}\`, and \`${fileName}\` is not created beside their module. Where a \`${fileName}\` from an earlier run already sits beside their module, leave it as it is. This step runs only when STEP 2b found no qualifying module.
132
+ `
133
+ : "";
118
134
  const seedStepBlock = seedsUtils
119
135
  ? `## STEP 5b: MOVE THIS TEST'S OWN HELPERS INTO \`${fileName}\`
120
136
 
121
- skyramp_modularization already ran on ${testFile} and extracted its steps into named helper functions. Those helpers belong in the shared \`${fileName}\` so later tests import them instead of re-defining them.
122
-
137
+ skyramp_modularization already ran on ${testFile} and extracted its steps into named helper functions. Those helpers belong in a shared module${inHouseBrowser ? " — the repository's own browser helper module when STEP 2b found one (STEP 3b), otherwise" : ", "} \`${fileName}\`${inHouseBrowser ? " —" : ","} so later tests import them instead of re-defining them.
138
+ ${inHouseSeedRule}
123
139
  ${pyImportRuleLine(fileName)}
124
140
 
141
+ ${moduleNameRule}
142
+
125
143
  For each helper function still defined locally in ${testFile} (i.e. not already merged by STEP 4b):
126
144
  1. **CREATE** \`${fileName}\` if it does not exist, with the standard header:
127
145
  \`\`\`${ext}
@@ -148,7 +166,7 @@ This step MOVES helpers that skyramp_modularization already created — it does
148
166
  // helper — reuse degrades to a no-op in any mixed directory. Explicit test-type
149
167
  // gate, not \`seedsUtils\`: the rule is stated in API terms.
150
168
  const inlineRequestRule = testType === "integration"
151
- ? `**INLINE REQUEST BLOCKS ARE CALL SITES, NOT HELPERS.** A request step written inline — one \`client.send_request(...)\` / \`client.sendRequest(...)\` call plus its status-code assertion, not wrapped in a function — is never something to move or author a helper from. But when a helper for the SAME method+path already exists, the block is that helper's near-duplicate (judge it by the API near-duplicate criteria in STEP 4b: same method+path and call structure; differences limited to body literals, \`data_override\` values, or expected status): REPLACE the block with a call to the helper, passing the block's own literals as arguments, and lift any literal the helper does not yet take to a parameter DEFAULTED to the helper's current value (existing call sites unchanged). KEEP the block's response variable — \`<same variable> = <helper>(...)\` — so the assertions that read it afterwards are unchanged. A value the block wraps in \`uniqueSuffix(...)\` or routes through \`data_override\` where the helper uses a plain literal (or vice versa) is a LITERAL difference, not a structural one — pass the expression as the argument. A block whose request differs structurally (extra step, different method or path) stays as it is.`
169
+ ? `**INLINE REQUEST BLOCKS ARE CALL SITES, NOT HELPERS.** A request step written inline — one \`client.send_request(...)\` / \`client.sendRequest(...)\` call plus its status-code assertion, not wrapped in a function — is never something to move or author a helper from. But when a helper for the SAME method+path already exists, the block is that helper's near-duplicate (judge it by the API near-duplicate criteria in STEP 4b: same method+path and call structure; differences limited to ${policy.liftableLiterals}): REPLACE the block with a call to the helper, passing the block's own literals as arguments — the status its assertion expected becomes the call's status argument, and that assertion is DELETED, not kept beside the call (the helper asserts it) — and lift anything the helper does not yet take — the block's BODY and the query parameters it sends included, not only the scalars inside them — to a parameter DEFAULTED to the helper's current value, so every existing call site sends what it sent before. The expected status is the one exception to that default: a helper that pins a literal status lifts it to a parameter with NO default, and every existing call site of that helper is updated to pass the literal it pinned. KEEP the block's response variable — \`<same variable> = <helper>(...)\` — so the assertions that read it afterwards are unchanged. A value the block wraps in \`uniqueSuffix(...)\` or routes through \`data_override\` where the helper uses a plain literal (or vice versa) is a LITERAL difference, not a structural one — pass the expression as the argument. A block whose request differs structurally (extra step, different method or path) stays as it is.`
152
170
  : "";
153
171
  // Its own step, placed after 5b: the agent routinely satisfies ${testFile} in STEP 3
154
172
  // and jumps straight to verification, never entering STEP 4 — so a sibling rule parked
@@ -169,7 +187,7 @@ ${pyImportRuleLine(fileName)} (this applies to the import you add to the SIBLING
169
187
  `
170
188
  : "";
171
189
  const finalReminderScope = seedsUtils
172
- ? `**ONLY MOVE HELPERS THAT ALREADY EXIST IN TEST FILES — NEVER AUTHOR NEW ONES**`
190
+ ? `**ONLY MOVE HELPERS THAT ALREADY EXIST IN TEST FILES — NEVER AUTHOR NEW ONES**${inHouseBrowser ? " (adding one of THIS test's helpers to the repository's own module in STEP 3b is a move, not authoring; an inline step with no matching helper of theirs stays inline)" : ""}`
173
191
  : `**ONLY MOVE EXISTING HELPERS FROM OTHER TEST FILES**`;
174
192
  const decisionTreeTail = seedsUtils
175
193
  ? `3. Found other test files with only repetitive patterns? → Step 5b (seed utils from this test's own helpers)
@@ -181,7 +199,7 @@ ${pyImportRuleLine(fileName)} (this applies to the import you add to the SIBLING
181
199
  5. Other test files identical to current? → SKIP to Step 6, NO utils file`;
182
200
  const precondition = modularizeFirst
183
201
  ? `
184
- **PRECONDITION — check your own tool-call history, not the file**: this flow moves the helpers skyramp_modularization created into \`${fileName}\` (STEP 5b). If you have NOT called skyramp_modularization on ${testFile} in this run, STOP: call it now with \`testFile\` set to ${testFile}, \`testType: "${testType}"\`, and \`isTraceBased: true\`, apply its instructions, then call skyramp_reuse_code again with the same arguments as this call. If you HAVE called it and the file still defines no helper functions, that is a legitimate outcome — proceed; STEP 5b will simply have nothing to move.
202
+ **PRECONDITION — check your own tool-call history, not the file**: this flow moves the helpers skyramp_modularization created into \`${fileName}\` (STEP 5b)${inHouseBrowser ? " — or into the repository's own browser helper module when it has one (STEP 3b)" : ""}. If you have NOT called skyramp_modularization on ${testFile} in this run, STOP: call it now with \`testFile\` set to ${testFile}, \`testType: "${testType}"\`, and \`isTraceBased: true\`, apply its instructions, then call skyramp_reuse_code again with the same arguments as this call. If you HAVE called it and the file still defines no helper functions, that is a legitimate outcome — proceed; STEP 5b will simply have nothing to move.
185
203
  `
186
204
  : "";
187
205
  return `# CODE REUSE - 6 CLEAR STEPS
@@ -214,7 +232,7 @@ Use the Grep tool to search for files containing "${SKYRAMP_UTILS_HEADER}":
214
232
  - Output mode: "files_with_matches"
215
233
  **CRITICAL: Only look for util files with header ${SKYRAMP_UTILS_HEADER}** - exclude test files (files with "test", "spec", ".test.", ".spec." in the name).
216
234
  Read the matching non-test files and check if any helpers can be reused in ${testFile}.
217
-
235
+ ${inHouseDiscoveryStep}
218
236
  ## STEP 3: USE EXISTING HELPERS FROM UTILS SOURCE FILES FOUND IN STEP 2
219
237
  If helpers exist in util file that can be reused in ${testFile} without modifying them${inlineRequestRule ? " — or, for API request helpers, by EXTENDING them with defaulted parameters as the rules below allow" : ""}:
220
238
  - Import them into ${testFile}
@@ -223,8 +241,7 @@ ${inlineRequestRule
223
241
  ? `- ${inlineRequestRule} This applies to every request step still inline in ${testFile} that matches a utils helper.
224
242
  `
225
243
  : ""}- Test that ${testFile} still works without any errors and logical is same as original test file.
226
- ${utilsMergeRule}
227
-
244
+ ${utilsMergeRule}${inHouseMatchStep}
228
245
  ## STEP 4: FIND LOCAL HELPERS IN OTHER SKYRAMP-GENERATED TEST FILES
229
246
 
230
247
  You are looking for sibling test files generated by Skyramp's codegen. They start with the comment line \`${codegenMarker}…\` (note: the version suffix is what distinguishes them from the SkyrampUtils header). The substring \`${SKYRAMP_UTILS_HEADER}\` is contained in that line, so:
@@ -300,7 +317,7 @@ For each helper defined locally in ${testFile}:
300
317
  - **Conservative bias**: a wrong merge breaks both tests; a missed merge leaves a duplicate. When in doubt, do NOT merge.
301
318
  - **No "cleanup"**: the merged body must mirror the original primitive sequence — same waits, same correlation patterns, same order. This is not refactoring.
302
319
  ${pyImportRuleLine(fileName)}
303
- - **Typed parameters (TypeScript)**: the merged helper types every parameter (\`page: Page\`, values by their type); add \`import type { Page } from '@playwright/test'\` to the utils file if it is missing. Never \`page: any\` or an untyped \`page\` — that fails a repo that type-checks its tests under \`noImplicitAny\`.
320
+ - **Typed parameters (TypeScript)**: the merged helper types every parameter (\`page: Page\`, values by their type); add \`import type { Page } from '@playwright/test'\` to the utils file if it is missing. Never \`page: any\`, \`page: unknown\`, or an untyped \`page\` — an untyped one fails a repo that type-checks its tests under \`noImplicitAny\`, and \`unknown\` fails at its first use under every setting.
304
321
  - **Don't merge with helpers already in \`${fileName}\`**: those are STEP 3's territory. STEP 4b is strictly cross-test merge between sibling Skyramp-generated test files.
305
322
 
306
323
  ---
@@ -328,7 +345,7 @@ ${pyImportRuleLine(fileName)}
328
345
  \`\`\`${ext}
329
346
  ${generateSkyrampHeader(lang)}
330
347
  \`\`\`
331
- **CRITICAL: IF \`${fileName}\` is already big, create a new file with a different name and add the header to the new file.**
348
+ ${moduleNameRule}
332
349
  2. **COPY** those local helper functions from original test source files to \`${fileName}\` without modifying them${seedsUtils ? ` — with ONE exception, checked BEFORE the copy: ${policy.assertionRule} Relocate a trailing excluded assertion into the owning test's body first; the copy that lands in \`${fileName}\` carries none.${policy.moveRule ? ` ${policy.moveRule}` : ""}` : ""}
333
350
  3. **DELETE** those local helper functions from test source files (REMOVE THEM COMPLETELY) WITHOUT ANY OTHER CHANGES.
334
351
  4. **IMPORT** those local helper functions from \`${fileName}\` back into test source files WITHOUT MAKING ANY OTHER CHANGE.
@@ -357,14 +374,14 @@ ${finalReminderScope}
357
374
 
358
375
  **IMPORTANT NOTES:**
359
376
  - The process is designed to REUSE existing helper functions, not create new ones
360
- - ${seedsUtils ? `If no existing helpers are found in utils or sibling tests, STEP 5b still moves this test's own helpers into \`${fileName}\` and imports them back — that is the expected first-run outcome, not a no-op` : "If no existing helpers are found, the test file should remain unchanged"}
377
+ - ${seedsUtils ? `If no existing helpers are found in utils or sibling tests, STEP 5b still moves this test's own helpers into \`${fileName}\` and imports them back — that is the expected first-run outcome, not a no-op${inHouseBrowser ? "; when STEP 2b found the repository's own browser helper module, STEP 3b does that placement into THEIR module instead and STEP 5b is skipped" : ""}` : "If no existing helpers are found, the test file should remain unchanged"}
361
378
  - Code reuse is about moving existing, working helper functions between files
362
379
  - Never create helper functions based on patterns you see in the current test file
363
380
  - Helper functions must have explicit function signatures/definitions
364
381
  - Repetitive inline test code is NOT a helper function
365
382
 
366
383
  **DECISION TREE:**
367
- 1. Found existing utils file with helpers? → Import and use them (Step 3)
384
+ ${inHouseBrowser ? "0. STEP 2b found a qualifying in-house browser helper module? → call its helpers and add this test's helpers to it (Step 3b); Step 5b is skipped and no `" + fileName + "` is created\n" : ""}1. Found existing utils file with helpers? → Import and use them (Step 3)
368
385
  2. Found other test files with ACTUAL helper functions? → Move to utils (Step 5)
369
386
  ${decisionTreeTail}
370
387
 
@@ -374,9 +391,58 @@ ${
374
391
  // Gated with the debt it describes: with SkyrampUtils reuse off nothing refuses, and
375
392
  // this text would send the agent to spend a call being told the feature is disabled.
376
393
  isUtilsReuseEnabled()
377
- ? `**MANDATORY FINAL STEP — VERIFY**: once every edit above is written, call skyramp_reuse_code again with the SAME testFile, language, framework and testType and \`verify: true\`. It stages the shared utils file for the output commit and checks its invariants (for API helpers: one helper per method+path, status-code-only assertions, method+resource names; for browser helpers: actions and structural waits only, intent names). Resolve anything it reports and re-verify; finish only when it reports PASSED. It passes immediately when no utils file was written. skyramp_enhance_assertions and skyramp_execute_test refuse this test until that verify pass has run.\n`
394
+ ? `**MANDATORY FINAL STEP — VERIFY**: once every edit above is written, call skyramp_reuse_code again with the SAME testFile, language, framework and testType and \`verify: true\`. It stages the shared utils file for the output commit and checks its invariants (for API helpers: one helper per method+path, status-code-only assertions, method+resource names; for browser helpers: actions and structural waits only, intent names).${inHouseBrowser
395
+ ? ` It also checks every in-house module this test imports: each imported name must exist there with an argument count its signature accepts, and every change this run made to their module must add a helper or add a defaulted parameter — anything else is refused and you restore it. On that call pass \`inHouse: { filesRead: [...], declined: [{ file, helper, reason }, ...] }\` — every file STEP 2b read, and every helper STEP 3b read and did not call, with the reason. These are your declarations and the report labels them as such.`
396
+ : ""} Resolve anything it reports and re-verify; finish only when it reports PASSED. It passes immediately when no utils file was written${inHouseBrowser ? " and no in-house module is imported" : ""}. skyramp_enhance_assertions and skyramp_execute_test refuse this test until that verify pass has run.\n`
378
397
  : ""}
379
398
 
380
399
  SUMMARIZE THE CODE REUSE PROCESS AND THE RESULTS.
381
400
  `;
382
401
  }
402
+ /**
403
+ * STEP 2b — find the repository's own browser helper modules. The agent searches;
404
+ * the search is a sample, and the report carries that cost: every file read is
405
+ * declared on the verify call. No fixed list of file names and no language filter,
406
+ * so a module nobody enumerated is still found; a module not written for Playwright
407
+ * is then reported as unreadable rather than filtered out in silence.
408
+ */
409
+ function inHouseDiscovery(testFile, fileName) {
410
+ return `
411
+ ## STEP 2b: FIND THE REPOSITORY'S OWN BROWSER HELPER MODULES
412
+
413
+ The header grep in STEP 2 finds only modules Skyramp wrote. The repository may already hold browser helpers of its own — a module the team wrote, carrying no Skyramp header — and a test that ignores it ends with two helper layers for the same steps. Find them.
414
+
415
+ 1. **Search the directory of ${testFile} and each of its parent directories up to the repository root.** Use Grep for Playwright locator and action calls (\`getBy\`, \`.locator(\`, \`page.\`, \`.click(\`, \`.fill(\`) in files that are NOT test files. Do NOT limit the search to a fixed list of file or directory names (\`pages/\`, \`helpers/\`, \`*.page.ts\` are hints, not the search), and do NOT limit it to one extension or language. Exclude \`node_modules\`, \`${fileName}\` and every other file carrying the \`${SKYRAMP_UTILS_HEADER}\` header (STEP 2 owns those), and test files — by BASENAME only: a basename ending in \`.spec.ts\`, \`.spec.js\`, \`.test.ts\`, \`.test.js\` is a test; a directory called \`tests/\` is not.
416
+ 2. **Read every candidate.** ${SELECTOR_OWNING_MODULE_RULE} A module written for a browser library other than Playwright shares no vocabulary with this test: read it, record it, and report it as unreadable — do not call it and do not extend it.
417
+ 3. **Catalog each qualifying module** to chat before changing anything: for each helper its name, **whether the module exports it UNDER THAT NAME** (an \`export\` on the definition, or an unaliased entry in an \`export { … }\` list of its own bindings — a default export and an aliased one export something else, and a helper this test cannot import is one it cannot call), its parameters (with defaults), what it returns, and its ACTION KEY — the sequence of Playwright actions it performs, in body order, each as the verb plus the locator chain it is called on (\`fill page.getByTestId("email"); click page.getByRole("button", { name: "Sign in" })\`). Argument VALUES are not part of the key, with two exceptions that ARE: a \`goto\` target and a \`dragTo\` destination — where a navigation goes and where a drag lands are the identity of those steps, so a helper that opens another page never matches. The key is UNDEFINED for a helper whose locator is not built from plain string literals — a variable, a template literal, a regex, a parameter; record it as undefined.
418
+ 4. **Record every file the search read** — qualifying or not — as a repository-relative path. You pass this list to the verify call at the end (\`inHouse.filesRead\`). A file you did not read is not on it.
419
+
420
+ **Which module to extend when there is more than one:** the module the tests in this directory already import; of those, the one holding the helpers STEP 3b matches; otherwise the module nearest to ${testFile}.
421
+
422
+ **Decision:** no qualifying module → continue to STEP 3 as written; STEP 3b and the in-house rule in STEP 5b then have nothing to do. One or more → continue to STEP 3, then STEP 3b.
423
+ `;
424
+ }
425
+ /**
426
+ * STEP 3b — match each step to the customer's helpers by the action key, call
427
+ * theirs where the keys agree, and add to their module where nothing does. The
428
+ * two edits their file may receive are stated here and enforced by the verify
429
+ * call's additive gate; the header rule is stated because the old verify text told
430
+ * the agent the opposite.
431
+ */
432
+ function inHouseMatch(testFile, fileName, policy) {
433
+ return `
434
+ ## STEP 3b: CALL THE REPOSITORY'S OWN HELPERS, AND ADD TO THEIR MODULE WHAT IT LACKS
435
+
436
+ Run this step only if STEP 2b found a qualifying module. Match every helper skyramp_modularization extracted in ${testFile} AND every action sequence still inline in it; ADD to their module only for the extracted helpers — an inline step with no match stays inline, as modularization left it (single-use steps are not helpers).
437
+
438
+ **Match by the action key, not by name or by intent.** Compute the key of the step exactly as STEP 2b computed the helpers' keys, and compare:
439
+
440
+ - **Keys equal → call their helper.** Replace the step (or delete the local helper and replace its calls) with a call to their helper, passing this test's values as arguments where their signature takes them. Where their helper hardcodes a value this test needs to differ (a filled text, an option label) and takes no parameter for it, ADD a parameter to their helper — APPENDED AFTER its existing parameters, never inserted among them, which would shift every caller they already have onto the wrong argument — whose DEFAULT is exactly the literal it replaces, and pass this test's value — every existing caller keeps its behaviour, and the verify call checks that with the default substituted back the helper reads as it did at HEAD. That is the ONLY edit an existing helper of theirs may receive.
441
+ - **Their key is undefined** (a variable, template-literal or regex locator) **→ do not call it and do not extend it.** Leave the step as it is and record the helper with the reason (\`inHouse.declined\` on the verify call).
442
+ - **No key matches (an extracted helper) → add it to THEIR module.** Move its body into their module written in that file's own style: its naming convention, its parameter style (positional, options object, defaults), the browser API and the import forms it already uses; delete the local definition and import it, keeping the call sites. It carries the action sequence and structural waits only — a value assertion stays in ${testFile} right after the call (${policy.assertionRule}). Do not add a helper whose key equals a helper the module already holds; call that one. Do not import the Skyramp runtime into their file.
443
+
444
+ **Never change what an existing helper of theirs does** — no edited body, no renamed helper, no removed line, no parameter without a default. **Never write the \`${SKYRAMP_UTILS_HEADER}\` header into their file.** It stays their file; the verify call compares it against HEAD and refuses any other change, and you undo it.
445
+
446
+ A step their helper covers is NOT moved into \`${fileName}\` in STEP 5b. Record, for the verify call, each helper of theirs you read and did not call, with the reason.
447
+ `;
448
+ }
@@ -1 +1,9 @@
1
- export declare function getFixErrorsPrompt(): string;
1
+ import { ProgrammingLanguage } from "../types/TestTypes.js";
2
+ interface FixErrorsPromptParams {
3
+ testFile: string;
4
+ language: `${ProgrammingLanguage}`;
5
+ framework: string;
6
+ }
7
+ /** Render the repair skill for clients that do not load the plugin. */
8
+ export declare function getFixErrorsPrompt(params: FixErrorsPromptParams): string;
9
+ export {};
@@ -1,29 +1,32 @@
1
- export function getFixErrorsPrompt() {
2
- return `
3
- **Fix errors in refactored code.**
4
-
5
- 1. **Parameter Passing:** Identify functions using variables from outside scope (like 'page' object). Pass these as parameters.
6
- 2. **Validate Correctness:** Ensure code is free of reference errors, undefined variables, runtime issues.
7
- 3. **Import Paths:** Ensure import paths are correct and there are no circular imports.
8
- 4. **Import Validation:** Ensure all remaining imports are necessary and no missing imports cause reference errors.
9
- 5. **Unused Import Cleanup:** Verify that unused imports were properly removed without breaking functionality.
10
- 6. **UI State Management:** Check for UI state conflicts, modal interference, or element interaction issues.
11
- 7. **Sequential Operations:** Ensure UI operations don't interfere with each other when called in sequence.
12
-
13
- **IMPORT ERROR DEBUGGING:**
14
- - Check for missing imports that cause undefined reference errors
15
- - Verify that import removal didn't break existing functionality
16
- - Ensure all imported modules are actually available in the project
17
- - Confirm that import syntax is correct for the target language
18
-
19
- **CRITICAL CONSTRAINTS:**
20
- - DO NOT CREATE/UPDATE package.json or requirements.txt or pom.xml or build.gradle file
21
- - NEVER create dependency management files, even when linting errors suggest missing dependencies
22
- - Focus on fixing code errors within existing files only
23
-
24
- **KEY: Variables not defined within function scope MUST be passed as parameters.**
25
- **UI KEY: Helper functions that perform UI operations must be self-contained and not leave modals/dialogs open.**
26
- **IMPORT KEY: All imports must be either used in the code or properly removed.**
27
- **DEPENDENCY KEY: DO NOT create package.json, requirements.txt, or any dependency files regardless of linting errors.**
28
- `;
1
+ import { FIX_TEST_IMPORT_ERRORS_SKILL } from "../skills/fixTestImportErrorsSkill.js";
2
+ import { readSkillBody, section, sliceBetween } from "../skills/skillFiles.js";
3
+ import { ProgrammingLanguage } from "../types/TestTypes.js";
4
+ /** Render the repair skill for clients that do not load the plugin. */
5
+ export function getFixErrorsPrompt(params) {
6
+ let languageHeading;
7
+ switch (params.language) {
8
+ case ProgrammingLanguage.PYTHON:
9
+ languageHeading = "### Python";
10
+ break;
11
+ case ProgrammingLanguage.JAVASCRIPT:
12
+ case ProgrammingLanguage.TYPESCRIPT:
13
+ languageHeading = "### JavaScript and TypeScript";
14
+ break;
15
+ case ProgrammingLanguage.JAVA:
16
+ languageHeading = "### Java";
17
+ break;
18
+ default:
19
+ throw new Error(`Unsupported repair language: ${params.language}`);
20
+ }
21
+ const skill = readSkillBody(FIX_TEST_IMPORT_ERRORS_SKILL);
22
+ const instructions = [
23
+ sliceBetween(skill, "## Workflow", "## Steps for"),
24
+ // Match the whole heading: "Java" must not select "JavaScript".
25
+ section(skill, `${languageHeading}\n`),
26
+ section(skill, "## Execution guidance"),
27
+ ].join("\n\n");
28
+ const values = [params.testFile, params.language, params.framework];
29
+ // Replace once: dollar signs in a supplied path must not become placeholders.
30
+ // Named shell variables in the Java example are left intact.
31
+ return instructions.replace(/\$([012])(?!\d)/g, (_match, index) => values[Number(index)]);
29
32
  }
@@ -17,6 +17,9 @@ export declare const GRPC_SERVICE_NAME_GUIDANCE = "the bare service name as decl
17
17
  export declare const ASSERTION_API_GUIDANCE = "Use the SDK helper for all field-level assertions: Python `skyramp.get_response_value(response, \"json.path\")`, TypeScript `getResponseValue(response, \"json.path\")`. The helper supports dot-path notation for nested access (e.g., `\"data.items[0].name\"`). Do NOT use dict/attribute access on the response variable (`response[\"field\"]`, `response.field`) or `json.loads(response.response_body)`";
18
18
  export interface LocalDevPlanCtx {
19
19
  repositoryPath: string;
20
+ /** `owner/repo` of the checkout at repositoryPath. skyramp_analyze_changes and
21
+ * skyramp_execute_test both name their repository on every call. */
22
+ repository: string;
20
23
  baseCommit: string;
21
24
  maxRecommendations: number;
22
25
  maxGenerate: number;
@@ -25,6 +25,7 @@ export const localDevPlan = new PromptPlan()
25
25
  })
26
26
  .step("ANALYZE_DIFF", "Analyze branch diff", (ctx) => `Call \`skyramp_analyze_changes\` with:
27
27
  - \`repositoryPath\`: "${ctx.repositoryPath}"
28
+ - \`repository\`: "${ctx.repository}"
28
29
  - \`scope\`: "branch_diff"
29
30
  - \`baseBranch\`: "${ctx.baseCommit}"
30
31
  - \`includeUncommitted\`: true
@@ -297,7 +298,7 @@ This injects import statements from the generated mock files — no data duplica
297
298
  - \`testType\`: "integration", "contract", or "ui" (match the scenario table)
298
299
  - \`enhanceType\`: "generation"
299
300
 
300
- The tool returns instructions — it does NOT edit the file automatically. Apply every returned instruction yourself: read the test file and add the suggested assertions. For assertions on server-generated IDs (e.g., account IDs, order IDs), prefer a domain prefix check (e.g., \`.startswith("acc_")\`) over \`is not None\` when the application uses a known ID format.`)
301
+ The tool returns instructions — it does NOT edit the file automatically. Apply every returned instruction yourself: read the test file and add the suggested assertions.`)
301
302
  .step("CROSS_REFERENCE", "Cross-reference scenarios vs test files", (_ctx) => `Compare the scenario table from Phase 2 against the generated test files:
302
303
 
303
304
  1. For each generated scenario, verify a corresponding test file exists with the correct SCENARIO_NAME or generated test name.
@@ -388,6 +389,7 @@ skyramp_execute_test({
388
389
  language: "<from workspace config>",
389
390
  testType: "<'integration' or 'contract' — match the scenario table>",
390
391
  workspacePath: "${ctx.repositoryPath}",
392
+ repository: "${ctx.repository}",
391
393
  token: "",
392
394
  })
393
395
  \`\`\`
@@ -1,4 +1,4 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { type Service } from "../../workspace/workspace.js";
3
- export declare function getLocalDevPrompt(baseCommit: string, repositoryPath: string, sandboxWorkerUrl?: string, maxRecommendations?: number, maxGenerate?: number, services?: Service[], stateOutputFile?: string, servicesToMock?: string[], realServices?: string[], mockProtocols?: string[], proxyKubeconfig?: string, proxyNamespace?: string): string;
3
+ export declare function getLocalDevPrompt(baseCommit: string, repositoryPath: string, repository: string, sandboxWorkerUrl?: string, maxRecommendations?: number, maxGenerate?: number, services?: Service[], stateOutputFile?: string, servicesToMock?: string[], realServices?: string[], mockProtocols?: string[], proxyKubeconfig?: string, proxyNamespace?: string): string;
4
4
  export declare function registerLocalDevPrompt(server: McpServer): void;
@@ -3,7 +3,9 @@ import * as path from "path";
3
3
  import { logger } from "../../utils/logger.js";
4
4
  import { AnalyticsService } from "../../services/AnalyticsService.js";
5
5
  import { buildServiceContext, escapeXml, readWorkspaceServices, } from "../prompt-utils.js";
6
- import { localDevPlan, GRPC_SERVICE_NAME_GUIDANCE, ASSERTION_API_GUIDANCE } from "./local-dev-plan.js";
6
+ import { localDevPlan, GRPC_SERVICE_NAME_GUIDANCE, ASSERTION_API_GUIDANCE, } from "./local-dev-plan.js";
7
+ import { tryRepositorySlug } from "../../utils/repositorySlug.js";
8
+ import { setPrimaryRepository } from "../../utils/AnalysisStateManager.js";
7
9
  const LOCAL_DEV_MAX_RECOMMENDATIONS = 8;
8
10
  const LOCAL_DEV_MAX_TESTS_TO_GENERATE = 5;
9
11
  /**
@@ -37,7 +39,7 @@ function buildServiceRoutingBlock(servicesToMock, realServices, mockProtocols) {
37
39
  lines.push("</SERVICE_ROUTING>");
38
40
  return lines.join("\n");
39
41
  }
40
- export function getLocalDevPrompt(baseCommit, repositoryPath, sandboxWorkerUrl, maxRecommendations = LOCAL_DEV_MAX_RECOMMENDATIONS, maxGenerate = LOCAL_DEV_MAX_TESTS_TO_GENERATE, services, stateOutputFile, servicesToMock, realServices, mockProtocols, proxyKubeconfig, proxyNamespace) {
42
+ export function getLocalDevPrompt(baseCommit, repositoryPath, repository, sandboxWorkerUrl, maxRecommendations = LOCAL_DEV_MAX_RECOMMENDATIONS, maxGenerate = LOCAL_DEV_MAX_TESTS_TO_GENERATE, services, stateOutputFile, servicesToMock, realServices, mockProtocols, proxyKubeconfig, proxyNamespace) {
41
43
  maxGenerate = Math.min(Math.max(maxGenerate, 0), maxRecommendations);
42
44
  const serviceContext = services?.length ? buildServiceContext(services) : "";
43
45
  // Proxy access lets the workflow query a running Skyramp worker proxy for real
@@ -101,6 +103,7 @@ ${sandboxWorkerBlock ? sandboxWorkerBlock + "\n" : ""}${serviceContext ? service
101
103
  // ── Render the plan phases ────────────────────────────────────────────────
102
104
  const ctx = {
103
105
  repositoryPath,
106
+ repository,
104
107
  baseCommit,
105
108
  maxRecommendations,
106
109
  maxGenerate,
@@ -167,13 +170,37 @@ export function registerLocalDevPrompt(server) {
167
170
  },
168
171
  }, async (args) => {
169
172
  const services = await readWorkspaceServices(args.repositoryPath);
173
+ // skyramp_analyze_changes and skyramp_execute_test both name their repository
174
+ // on every call. This is a local checkout, so read it off the origin remote.
175
+ const repository = await tryRepositorySlug(args.repositoryPath);
176
+ if (!repository) {
177
+ return {
178
+ messages: [
179
+ {
180
+ role: "user",
181
+ content: {
182
+ type: "text",
183
+ text: `Cannot read owner/repo from the origin remote of ${args.repositoryPath}. The Skyramp tools name the repository on every call, so add an origin remote to this checkout and retry.`,
184
+ },
185
+ },
186
+ ],
187
+ };
188
+ }
189
+ // Rendering the prompt is where this run declares its primary checkout, the
190
+ // same as the testbot entry point. Set, not set-if-unset: one server can
191
+ // render a second run for a different checkout, and keeping the first would
192
+ // route the second one as a related repository of it.
193
+ setPrimaryRepository({
194
+ repositoryPath: args.repositoryPath,
195
+ repo: repository,
196
+ });
170
197
  const parseCsv = (v) => v
171
198
  ? v
172
199
  .split(",")
173
200
  .map((s) => s.trim())
174
201
  .filter(Boolean)
175
202
  : undefined;
176
- const prompt = getLocalDevPrompt(args.baseCommit, args.repositoryPath, args.sandboxWorkerUrl, args.maxRecommendations, args.maxGenerate, services.length ? services : undefined, args.stateOutputFile, parseCsv(args.servicesToMock), parseCsv(args.realServices), parseCsv(args.mockProtocols), args.proxyKubeconfig, args.proxyNamespace);
203
+ const prompt = getLocalDevPrompt(args.baseCommit, args.repositoryPath, repository, args.sandboxWorkerUrl, args.maxRecommendations, args.maxGenerate, services.length ? services : undefined, args.stateOutputFile, parseCsv(args.servicesToMock), parseCsv(args.realServices), parseCsv(args.mockProtocols), args.proxyKubeconfig, args.proxyNamespace);
177
204
  AnalyticsService.pushMCPToolEvent("skyramp_local_dev_prompt", undefined, {}).catch(() => { });
178
205
  return {
179
206
  messages: [
@@ -49,13 +49,16 @@ expect(response1.status).toBe(200);
49
49
  const response2 = await fetch("/api/users/2");
50
50
  expect(response2.status).toBe(200);
51
51
 
52
- // Correct helper (EXACT copy + parameters${p.utilsReuse ? "; the expected status is a defaulted parameter per HELPER SHAPE" : ""}):
52
+ // Correct helper (EXACT copy + parameters${p.utilsReuse ? "; the expected status is a parameter with NO default per HELPER SHAPE — each call passes it, and the test body does not assert it again" : ""}):
53
53
  ${p.utilsReuse
54
- ? `async function getUser(userId: number, expectedStatus = 200) {
54
+ ? `async function getUser(userId: number, expectedStatus: number) {
55
55
  const response = await fetch(\`/api/users/\${userId}\`);
56
56
  expect(response.status).toBe(expectedStatus);
57
57
  return response;
58
- }`
58
+ }
59
+ // Call sites: the status each one expects, stated once, here.
60
+ const response1 = await getUser(1, 200);
61
+ const response2 = await getUser(2, 200);`
59
62
  : `async function getUser(userId: number) {
60
63
  const response = await fetch(\`/api/users/\${userId}\`);
61
64
  expect(response.status).toBe(200);
@@ -101,12 +104,16 @@ If ANY answer is "no", DO NOT submit - fix the modularization first.`)
101
104
  function sharedHelperShape(p) {
102
105
  return `**HELPER SHAPE (one helper per request step from Step ${_plan.labels.IDENTIFY}):**
103
106
  - ${API_HELPERS.namingRule}
104
- - **PARAMETERS**: pass in the client/session object, plus every value the step reads from a previous step's response (IDs used in paths or bodies), plus every body value this scenario varies or its assertions reference (names, prices, quantities, percentages). Values that never vary and that no assertion reads may stay hardcoded — do not invent parameters nothing passes differently.
105
- - **SCENARIO VALUES GO THROUGH \`data_override\`, NOT THE BODY STRING**: apply each parameterized body value via the request's \`data_override\` map (that is what it is for) and leave the raw body string as generated. A scenario literal edited into the body string makes this helper unmergeable with the same step from another test.
107
+ - **PARAMETERS**: pass in the client/session object, plus every value the step reads from a previous step's response (IDs used in paths or bodies), plus every body value this scenario varies or its assertions reference (names, prices, quantities, percentages). Values that never vary and that no assertion reads may stay hardcoded — do not invent parameters nothing passes differently. The body is the one exception: it is reachable from the signature whether or not this scenario varies it (see the body rule below).
108
+ - **SCENARIO VALUES GO THROUGH \`data_override\`, NOT THE BODY STRING**: apply each parameterized body value via the request's \`data_override\` map (that is what it is for) and leave the raw body string as generated. A scenario literal edited into the body string makes this helper unmergeable with the same step from another test. The generated body is this helper's STARTING POINT, not a fixed value — the body rule below says what must be able to change about it.
106
109
  - **RETURN** the response object so later steps can chain and assert from it.
107
110
  - ${API_HELPERS.assertionRule} ${ASSERTION_BOUNDARY_RULE_EXTRACT}
108
111
  - Helpers are module-level named functions in ${p.filePath}; the test body becomes a sequence of helper calls plus this scenario's assertions, in the original order.
109
- - Keep everything else EXACTLY the same.`;
112
+ - Keep everything else EXACTLY the same.
113
+
114
+ ${API_HELPERS.bodyShapeRule}
115
+
116
+ ${API_HELPERS.optionsShapeRule}`;
110
117
  }
111
118
  function repetitionParameterRules() {
112
119
  return `**PARAMETER CONVERSION RULES:**
@@ -138,7 +138,7 @@ await addItem(page, "item3");
138
138
  \`\`\``)
139
139
  .step("USE", "CALL HELPERS WITH EXACT SAME VALUES", () => `Use the EXACT same values from the original test when calling helpers.`)
140
140
  .step("VERIFY", "VERIFY - CRITICAL CHECKS", (p) => `**BUGS TO AVOID:**
141
- - [ ] **EVERY PARAMETER IS TYPED (TypeScript)** - \`page: Page\` with \`import type { Page } from '@playwright/test'\` once at the top of the file; other parameters by their value type (\`name: string\`, \`quantity: number\`). An untyped parameter fails a repo that type-checks its tests under \`noImplicitAny\`. JavaScript files carry no annotations.
141
+ - [ ] **EVERY PARAMETER IS TYPED (TypeScript)** - \`page: Page\` with \`import type { Page } from '@playwright/test'\` once at the top of the file; other parameters by their value type (\`name: string\`, \`quantity: number\`). An untyped parameter fails a repo that type-checks its tests under \`noImplicitAny\`; a parameter typed \`unknown\` fails at its first use under every setting, and \`any\` checks nothing — use the real type. JavaScript files carry no annotations.
142
142
  - [ ] **Return types are optional** - inferred returns are fine under strict mode; if you write one, it is the real type, never \`any\`
143
143
  - [ ] **ALL field mappings verified** - EVERY \`.fill()\` uses the correct parameter. Check field gets quantity parameter, NOT hardcoded
144
144
  - [ ] **No duplicate helpers** - Consolidate similar helpers (e.g., one createOrder vs createSimpleOrder + createOrderWithItems)
@@ -20,5 +20,5 @@ export const SKYRAMP_QA_PERSONA = `You are acting as a Skyramp QA Automation Eng
20
20
  * avoid duplicating it in every tool description.
21
21
  */
22
22
  export function getPersonaPrefix() {
23
- return isTestbotEnabled() ? '' : `${SKYRAMP_QA_PERSONA}\n\n`;
23
+ return isTestbotEnabled() ? "" : `${SKYRAMP_QA_PERSONA}\n\n`;
24
24
  }
@@ -1,12 +1,16 @@
1
1
  import { generateSkyrampHeader, SKYRAMP_UTILS_HEADER } from "../utils/utils.js";
2
2
  import { resolvePomCatalogPath } from "../utils/pom-catalog.js";
3
+ import { UTILS_LANGUAGE_SPECS } from "../utils/utils-verify/language-spec.js";
4
+ import { SELECTOR_OWNING_MODULE_RULE } from "./shared-helper-policy.js";
3
5
  export function getPomAwareCodeReusePrompt(testFile, language = "typescript", scopedPoms) {
4
6
  // Resolved here, not left to the agent: the catalog only survives to the next
5
7
  // run if it lands where delivery stages it (SKYR-4141).
6
8
  const catalogPath = resolvePomCatalogPath(testFile);
7
9
  const isJs = language.toLowerCase() === "javascript";
8
10
  const ext = isJs ? "js" : "ts";
9
- const utilsFile = isJs ? "skyrampUtils.js" : "skyrampUtils.ts";
11
+ // Same one declaration the standard path reads, so the two prompts and the verify
12
+ // pass cannot name three different files.
13
+ const utilsFile = UTILS_LANGUAGE_SPECS[isJs ? "javascript" : "typescript"].fileName;
10
14
  const codegenMarker = "// Generated by Skyramp v";
11
15
  const headerLang = isJs ? "javascript" : "typescript";
12
16
  const scopedActive = scopedPoms && scopedPoms.tier1.length + scopedPoms.tier2.length > 0;
@@ -44,13 +48,7 @@ Use the Glob tool to search for POM files starting from the directory containing
44
48
  - Pattern 7: \`**/{test,tests,e2e,playwright}/**/{lib,utils,helpers,support}/**/*.{ts,js}\`
45
49
  - Pattern 8: \`**/{testUtils,test-utils,testHelpers,test-helpers}.{ts,js}\`
46
50
 
47
- **A reuse target does not have to be a class.** Patterns 7–8 catch selector-owning helper
48
- libraries — modules exporting free functions like \`bookFirstEvent(page)\` whose bodies contain
49
- the selector literals. A helper module qualifies only if its functions OWN selectors; a module
50
- whose functions take selectors as parameters (generic interaction utilities) owns nothing and is
51
- not a reuse target. Playwright fixture factories wired into the repo's own \`test\` object
52
- (\`test.extend\`-style) are NOT substitutable either — using them requires replacing the Skyramp
53
- runtime imports, which rule 3a forbids.
51
+ ${SELECTOR_OWNING_MODULE_RULE} (See rule 3a below.) Patterns 7–8 are what catch such libraries.
54
52
 
55
53
  Exclude test/spec files by **basename only** — never match on the directory path. POM layers commonly live under a \`tests/\` directory (e.g. \`tests/ui-testing/pages/\`), and path-matching would wrongly drop every POM. A file is excluded only if its **basename** ends in \`.spec.ts\`, \`.spec.js\`, \`.test.ts\`, or \`.test.js\`. Do NOT exclude on the bare substrings \`test\` or \`spec\`: they falsely match legitimate POMs (e.g. \`searchJobInspectorPage.js\` contains "spec") and directory names (\`tests/\`).
56
54
  Also exclude \`node_modules\`.
@@ -559,7 +557,7 @@ For each helper defined locally in ${testFile}:
559
557
 
560
558
  - **Conservative bias**: a wrong merge breaks both tests; a missed merge leaves a duplicate. When in doubt, do NOT merge.
561
559
  - **No "cleanup"**: the merged body must mirror the original primitive sequence — same waits, same correlation patterns, same order. This is not refactoring.
562
- - **Typed parameters (TypeScript)**: the merged helper types every parameter (\`page: Page\`, values by their type); add \`import type { Page } from '@playwright/test'\` if the file lacks it. Never \`page: any\` or an untyped \`page\`.
560
+ - **Typed parameters (TypeScript)**: the merged helper types every parameter (\`page: Page\`, values by their type); add \`import type { Page } from '@playwright/test'\` if the file lacks it. Never \`page: any\`, \`page: unknown\`, or an untyped \`page\`.
563
561
  - **Don't merge with helpers already in \`${utilsFile}\`**: those are STEP 3's territory. STEP 4b is strictly cross-test merge between sibling Skyramp-generated test files.
564
562
 
565
563
  ---
@@ -0,0 +1,64 @@
1
+ import { TestType } from "../types/TestTypes.js";
2
+ import { type UtilsLanguage } from "../utils/utils-verify/index.js";
3
+ /**
4
+ * The generation-call clause that asks for codeReuse, language-conditional in
5
+ * words, as the testbot prompt appends it to its integration generation step
6
+ * when utils reuse is on.
7
+ *
8
+ * States the RULE, not one exception. Naming Java as the only language left out
9
+ * is false — code reuse covers three languages and discovery records seventeen —
10
+ * and an agent in a Go repository reads "unset for Java", concludes Go is not
11
+ * excepted, and asks for a reuse pass that can move no helpers for Go.
12
+ */
13
+ export declare const CODE_REUSE_GENERATION_CLAUSE: string;
14
+ /**
15
+ * Whether the maintenance step can actually rewrite a test of this type. Its
16
+ * REGENERATE strategy names the integration and contract generators only and
17
+ * forbids skyramp_ui_test_generation, which needs a recorded trace this tool does
18
+ * not have. A browser test's REGENERATE is therefore advice to the developer: no
19
+ * call here rewrites the file, so nothing may be armed against it — a hand-off
20
+ * would refuse the execution of a file the plan never told anyone to rewrite.
21
+ */
22
+ export declare function isMaintenanceRegenerable(testType: TestType): boolean;
23
+ /**
24
+ * What the regenerate instruction asks of the generation call, as words for the
25
+ * summary (`clause`) and as the arguments the structured plan carries (`args`),
26
+ * from one decision. Undefined when the call must not ask for code reuse: utils
27
+ * reuse off, or a test type that is not a modularize-first target — contract, for
28
+ * one, whose generator accepts neither `codeReuse` nor `modularizeCode`. For a
29
+ * modularize-first type: the resolved clause and arguments for a language with a
30
+ * utils spec; the leave-unset clause and no arguments for Java; the generic clause
31
+ * and no arguments when the language is not cataloged.
32
+ */
33
+ export declare function regenerateCodeReuse(testType: TestType,
34
+ /** Optional because the discovery catalog does not always carry one: an
35
+ * uncataloged but real test file is accepted deliberately, and its language is
36
+ * unknown. The clause is omitted in that case. */
37
+ language: string | undefined): {
38
+ clause: string;
39
+ args?: {
40
+ codeReuse: true;
41
+ modularizeCode: false;
42
+ };
43
+ } | undefined;
44
+ /**
45
+ * Whether a test of this type and language owes the modularize → reuse pair.
46
+ * Routing (isModularizeFirstTarget) says which flows modularize first; the utils
47
+ * spec says which languages have a payable reuse half — recordReuseHandOff writes
48
+ * nothing for a language without one (Java), so instructing the pair there would
49
+ * be a debt nothing tracks.
50
+ */
51
+ export declare function isModularizeFirstHandOffTarget(testType: TestType,
52
+ /** Optional because generation's own `language` param is: the predicate is the
53
+ * thing that decides an absent or unsupported language owes nothing. */
54
+ language: string | undefined): language is UtilsLanguage;
55
+ /** The argument clause of the skyramp_reuse_code call the agent is told to make. */
56
+ export declare function reuseCodeArgsClause(language: string | undefined, testType: TestType, framework: string): string;
57
+ export declare function buildModularizeFirstNextSteps(params: {
58
+ testType: TestType;
59
+ /** Narrowed by isModularizeFirstHandOffTarget, which both callers apply
60
+ * first: a language with no utils spec never reaches these steps. */
61
+ language: UtilsLanguage;
62
+ framework: string;
63
+ enhanceFirst: boolean;
64
+ }): string;