@skyramp/mcp 0.3.8 → 0.4.0-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 (229) hide show
  1. package/build/commands/commandLibrary.d.ts +1 -1
  2. package/build/commands/commandLibrary.js +3 -3
  3. package/build/commands/recommendTestsAndExecuteCommand.d.ts +1 -1
  4. package/build/commands/recommendTestsAndExecuteCommand.js +35 -20
  5. package/build/commands/testThisEndpointCommand.js +35 -19
  6. package/build/index.js +9 -3
  7. package/build/playwright/blueprintDigest.d.ts +15 -0
  8. package/build/playwright/blueprintDigest.js +152 -0
  9. package/build/playwright/blueprintDigestStore.d.ts +31 -0
  10. package/build/playwright/blueprintDigestStore.js +117 -0
  11. package/build/playwright/registerPlaywrightTools.js +60 -12
  12. package/build/playwright/traceRecordingPrompt.js +8 -7
  13. package/build/prompts/enhance-assertions/sharedAssertionRules.js +9 -8
  14. package/build/prompts/enhance-assertions/uiAssertionsPrompt.js +24 -2
  15. package/build/prompts/promptAssets.d.ts +20 -0
  16. package/build/prompts/promptAssets.js +55 -0
  17. package/build/prompts/sut-setup/modes/dockerComposePrompt.js +19 -5
  18. package/build/prompts/test-maintenance/actionsInstructions.d.ts +4 -0
  19. package/build/prompts/test-maintenance/actionsInstructions.js +14 -2
  20. package/build/prompts/test-maintenance/drift-analysis-prompt.d.ts +0 -10
  21. package/build/prompts/test-maintenance/drift-analysis-prompt.js +2 -11
  22. package/build/prompts/test-maintenance/uiDriftAnalysisSections.js +8 -4
  23. package/build/prompts/test-recommendation/diffExecutionPlan.d.ts +5 -22
  24. package/build/prompts/test-recommendation/diffExecutionPlan.js +37 -465
  25. package/build/prompts/test-recommendation/recommendationSections.d.ts +7 -17
  26. package/build/prompts/test-recommendation/recommendationSections.js +67 -309
  27. package/build/prompts/test-recommendation/recommendationShared.d.ts +19 -47
  28. package/build/prompts/test-recommendation/recommendationShared.js +49 -155
  29. package/build/prompts/test-recommendation/registerRecommendTestsPrompt.d.ts +0 -5
  30. package/build/prompts/test-recommendation/registerRecommendTestsPrompt.js +10 -153
  31. package/build/prompts/test-recommendation/test-recommendation-prompt.d.ts +2 -29
  32. package/build/prompts/test-recommendation/test-recommendation-prompt.js +32 -457
  33. package/build/prompts/testbot/planDeclarations.d.ts +6 -0
  34. package/build/prompts/testbot/planDeclarations.js +9 -0
  35. package/build/prompts/testbot/testbot-prompts.d.ts +8 -0
  36. package/build/prompts/testbot/testbot-prompts.js +256 -381
  37. package/build/recommendation/answers.d.ts +35 -0
  38. package/build/recommendation/answers.js +96 -0
  39. package/build/recommendation/registerPlan.d.ts +49 -0
  40. package/build/recommendation/registerPlan.js +117 -0
  41. package/build/recommendation/runVerifiers.d.ts +10 -0
  42. package/build/recommendation/runVerifiers.js +49 -0
  43. package/build/recommendation/subjectStep.d.ts +42 -0
  44. package/build/recommendation/subjectStep.js +86 -0
  45. package/build/recommendation/types.d.ts +163 -0
  46. package/build/recommendation/types.js +20 -0
  47. package/build/recommendation/verifierContracts.d.ts +382 -0
  48. package/build/recommendation/verifierContracts.js +263 -0
  49. package/build/recommendation/verifiers/changedFile.d.ts +2 -0
  50. package/build/recommendation/verifiers/changedFile.js +82 -0
  51. package/build/recommendation/verifiers/citedPath.d.ts +12 -0
  52. package/build/recommendation/verifiers/citedPath.js +35 -0
  53. package/build/recommendation/verifiers/coverage.d.ts +7 -0
  54. package/build/recommendation/verifiers/coverage.js +617 -0
  55. package/build/recommendation/verifiers/deliveredMatchesPlan.d.ts +11 -0
  56. package/build/recommendation/verifiers/deliveredMatchesPlan.js +33 -0
  57. package/build/recommendation/verifiers/endpointGrounded.d.ts +17 -0
  58. package/build/recommendation/verifiers/endpointGrounded.js +128 -0
  59. package/build/recommendation/verifiers/existingCoverage.d.ts +6 -0
  60. package/build/recommendation/verifiers/existingCoverage.js +51 -0
  61. package/build/recommendation/verifiers/expectedOutcome.d.ts +31 -0
  62. package/build/recommendation/verifiers/expectedOutcome.js +105 -0
  63. package/build/recommendation/verifiers/removedElementGuarded.d.ts +2 -0
  64. package/build/recommendation/verifiers/removedElementGuarded.js +57 -0
  65. package/build/recommendation/verifiers/reportedCategory.d.ts +26 -0
  66. package/build/recommendation/verifiers/reportedCategory.js +84 -0
  67. package/build/recommendation/verifiers/screenRoute.d.ts +10 -0
  68. package/build/recommendation/verifiers/screenRoute.js +118 -0
  69. package/build/recommendation/verifiers/statedDifference.d.ts +6 -0
  70. package/build/recommendation/verifiers/statedDifference.js +140 -0
  71. package/build/recommendation/verifiers/uiElementGrounded.d.ts +7 -0
  72. package/build/recommendation/verifiers/uiElementGrounded.js +318 -0
  73. package/build/resources/analysisResources.js +1 -114
  74. package/build/resources/testbotResource.js +23 -13
  75. package/build/services/ModularizationService.js +2 -1
  76. package/build/services/TestDiscoveryService.d.ts +3 -72
  77. package/build/services/TestDiscoveryService.js +10 -303
  78. package/build/services/containerEnv.d.ts +1 -1
  79. package/build/services/containerEnv.js +12 -0
  80. package/build/skills/fixTestImportErrorsSkill.d.ts +13 -0
  81. package/build/skills/fixTestImportErrorsSkill.js +20 -0
  82. package/build/toolNames.d.ts +1 -0
  83. package/build/toolNames.js +1 -0
  84. package/build/tools/code-refactor/enhanceAssertionsTool.js +3 -3
  85. package/build/tools/code-refactor/modularizationTool.js +2 -1
  86. package/build/tools/executeSkyrampTestTool.d.ts +80 -0
  87. package/build/tools/executeSkyrampTestTool.js +246 -19
  88. package/build/tools/generate-tests/generateBatchScenarioRestTool.js +6 -0
  89. package/build/tools/generate-tests/generateContractRestTool.js +3 -3
  90. package/build/tools/generate-tests/planGuard.d.ts +2 -2
  91. package/build/tools/generate-tests/planGuard.js +78 -18
  92. package/build/tools/one-click/oneClickTool.d.ts +0 -1
  93. package/build/tools/one-click/oneClickTool.js +0 -5
  94. package/build/tools/submitReportTool.d.ts +48 -42
  95. package/build/tools/submitReportTool.js +576 -193
  96. package/build/tools/test-management/actionsTool.js +72 -4
  97. package/build/tools/test-management/analyzeChangesTool.d.ts +144 -48
  98. package/build/tools/test-management/analyzeChangesTool.js +212 -1219
  99. package/build/tools/test-management/analyzeTestHealthTool.js +13 -24
  100. package/build/tools/test-management/index.d.ts +1 -0
  101. package/build/tools/test-management/index.js +1 -0
  102. package/build/tools/test-management/registerTestPlanTool.d.ts +795 -172
  103. package/build/tools/test-management/registerTestPlanTool.js +609 -542
  104. package/build/tools/test-management/resolveScreenTool.d.ts +75 -0
  105. package/build/tools/test-management/resolveScreenTool.js +289 -0
  106. package/build/types/BlueprintDigest.d.ts +34 -0
  107. package/build/types/BlueprintDigest.js +1 -0
  108. package/build/types/RepositoryAnalysis.d.ts +20 -1559
  109. package/build/types/RepositoryAnalysis.js +2 -58
  110. package/build/types/StepMethod.d.ts +40 -0
  111. package/build/types/StepMethod.js +77 -0
  112. package/build/types/TestAnalysis.d.ts +12 -0
  113. package/build/types/TestExecution.d.ts +4 -0
  114. package/build/types/TestRecommendation.d.ts +24 -24
  115. package/build/types/TestRecommendation.js +91 -89
  116. package/build/types/TestbotPromptOptions.d.ts +0 -4
  117. package/build/types/TestbotReport.d.ts +64 -2
  118. package/build/utils/AnalysisStateManager.d.ts +79 -113
  119. package/build/utils/AnalysisStateManager.js +147 -57
  120. package/build/utils/assertion-verify/api-shared-lints.js +1 -1
  121. package/build/utils/assertion-verify/metrics.js +85 -36
  122. package/build/utils/assertion-verify/ui-lints.d.ts +0 -5
  123. package/build/utils/assertion-verify/ui-lints.js +32 -0
  124. package/build/utils/branchDiff.d.ts +63 -31
  125. package/build/utils/branchDiff.js +242 -94
  126. package/build/utils/containedPath.d.ts +18 -0
  127. package/build/utils/containedPath.js +73 -0
  128. package/build/utils/dartRouteExtractor.d.ts +18 -34
  129. package/build/utils/dartRouteExtractor.js +101 -173
  130. package/build/utils/featureFlags.d.ts +12 -0
  131. package/build/utils/featureFlags.js +14 -0
  132. package/build/utils/frontendSelectors.d.ts +48 -27
  133. package/build/utils/frontendSelectors.js +241 -80
  134. package/build/utils/pathMatching.d.ts +2 -4
  135. package/build/utils/pathMatching.js +2 -4
  136. package/build/utils/planMatchKeys.d.ts +38 -47
  137. package/build/utils/planMatchKeys.js +143 -81
  138. package/build/utils/rebaselineSnapshots.d.ts +24 -0
  139. package/build/utils/rebaselineSnapshots.js +65 -0
  140. package/build/utils/removedUiElements.d.ts +22 -0
  141. package/build/utils/removedUiElements.js +106 -0
  142. package/build/utils/reportVerification.d.ts +2 -6
  143. package/build/utils/reportVerification.js +61 -2
  144. package/build/utils/screenRoutes.d.ts +66 -0
  145. package/build/utils/screenRoutes.js +727 -0
  146. package/build/utils/sourceRouteExtractor.js +320 -112
  147. package/build/utils/testFileClassification.d.ts +11 -2
  148. package/build/utils/testFileClassification.js +44 -2
  149. package/build/utils/testFixtures.d.ts +5 -0
  150. package/build/utils/testFixtures.js +13 -0
  151. package/build/utils/utils.d.ts +0 -1
  152. package/build/utils/utils.js +0 -11
  153. package/build/utils/versions.d.ts +3 -3
  154. package/build/utils/versions.js +1 -1
  155. package/build/workspace/workspace.d.ts +12 -12
  156. package/node_modules/playwright/lib/mcp/skyramp/assertHiddenTool.js +56 -0
  157. package/node_modules/playwright/lib/mcp/skyramp/assertTool.js +2 -1
  158. package/node_modules/playwright/lib/mcp/skyramp/loadTraceTool.js +10 -0
  159. package/node_modules/playwright/lib/mcp/skyramp/skyRampImport.js +4 -1
  160. package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +160 -1
  161. package/node_modules/playwright/lib/mcp/test/skyRampExport.js +4 -2
  162. package/node_modules/playwright/node_modules/playwright-core/lib/server/codegen/skyramp/jsonlReader.js +1 -0
  163. package/node_modules/playwright/node_modules/playwright-core/lib/server/recorder/recorderSignalProcessor.js +2 -0
  164. package/node_modules/playwright/node_modules/playwright-core/lib/server/recorder.js +5 -1
  165. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/{index.-Id052Lr.js → index.B7KbSQcC.js} +1 -1
  166. package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/index.html +1 -1
  167. package/node_modules/playwright/node_modules/playwright-core/package.json +1 -1
  168. package/node_modules/playwright/node_modules/playwright-core/src/server/codegen/skyramp/jsonlReader.ts +1 -1
  169. package/node_modules/playwright/node_modules/playwright-core/src/server/recorder/recorderSignalProcessor.ts +7 -0
  170. package/node_modules/playwright/node_modules/playwright-core/src/server/recorder.ts +6 -1
  171. package/node_modules/playwright/package.json +1 -1
  172. package/package.json +4 -3
  173. package/plugin/.claude-plugin/plugin.json +8 -0
  174. package/plugin/plugin.json +6 -0
  175. package/plugin/prompts/declaring-a-plan.md +20 -0
  176. package/plugin/prompts/generate-tests/context-fetching.md +4 -0
  177. package/plugin/prompts/generate-tests/execution-plan.md +63 -0
  178. package/plugin/prompts/generate-tests/generation.md +108 -0
  179. package/plugin/prompts/generate-tests/path-parameters.md +1 -0
  180. package/plugin/prompts/generate-tests/reasoning-protocol.md +17 -0
  181. package/plugin/prompts/generate-tests/tool-workflow-variants.md +61 -0
  182. package/plugin/prompts/generate-tests/tool-workflows.md +65 -0
  183. package/plugin/prompts/plan-tests.md +42 -0
  184. package/plugin/prompts/testbot-task1.md +82 -0
  185. package/plugin/skills/fix-test-import-errors/SKILL.md +98 -0
  186. package/build/prompts/test-recommendation/analysisOutputPrompt.d.ts +0 -84
  187. package/build/prompts/test-recommendation/analysisOutputPrompt.js +0 -369
  188. package/build/prompts/test-recommendation/fullRepoCatalog.d.ts +0 -7
  189. package/build/prompts/test-recommendation/fullRepoCatalog.js +0 -283
  190. package/build/prompts/test-recommendation/scopeAssessment.d.ts +0 -81
  191. package/build/prompts/test-recommendation/scopeAssessment.js +0 -359
  192. package/build/recommendation/budgeters/diversityBalancedBudgeter.d.ts +0 -7
  193. package/build/recommendation/budgeters/diversityBalancedBudgeter.js +0 -105
  194. package/build/recommendation/budgeters/fixedNBudgeter.d.ts +0 -7
  195. package/build/recommendation/budgeters/fixedNBudgeter.js +0 -11
  196. package/build/recommendation/budgeters/shared.d.ts +0 -32
  197. package/build/recommendation/budgeters/shared.js +0 -246
  198. package/build/recommendation/discriminators.d.ts +0 -37
  199. package/build/recommendation/discriminators.js +0 -379
  200. package/build/recommendation/diversity.d.ts +0 -47
  201. package/build/recommendation/diversity.js +0 -101
  202. package/build/recommendation/planRanker.d.ts +0 -65
  203. package/build/recommendation/planRanker.js +0 -83
  204. package/build/recommendation/testFixtures.d.ts +0 -25
  205. package/build/recommendation/testFixtures.js +0 -45
  206. package/build/types/FrontendIntegration.d.ts +0 -28
  207. package/build/types/FrontendIntegration.js +0 -22
  208. package/build/types/Recommendation.d.ts +0 -146
  209. package/build/types/Recommendation.js +0 -74
  210. package/build/utils/changedRoutes.d.ts +0 -29
  211. package/build/utils/changedRoutes.js +0 -87
  212. package/build/utils/frontendIntegration.d.ts +0 -9
  213. package/build/utils/frontendIntegration.js +0 -243
  214. package/build/utils/importerHop.d.ts +0 -135
  215. package/build/utils/importerHop.js +0 -489
  216. package/build/utils/pathAffinityClassification.d.ts +0 -49
  217. package/build/utils/pathAffinityClassification.js +0 -180
  218. package/build/utils/pythonMountPrefixes.d.ts +0 -25
  219. package/build/utils/pythonMountPrefixes.js +0 -347
  220. package/build/utils/repoScanner.d.ts +0 -34
  221. package/build/utils/repoScanner.js +0 -300
  222. package/build/utils/routeParsers.d.ts +0 -95
  223. package/build/utils/routeParsers.js +0 -951
  224. package/build/utils/scenarioDrafting.d.ts +0 -92
  225. package/build/utils/scenarioDrafting.js +0 -951
  226. package/build/utils/subjectEndpoints.d.ts +0 -19
  227. package/build/utils/subjectEndpoints.js +0 -98
  228. package/build/utils/uiPageEnumerator.d.ts +0 -172
  229. package/build/utils/uiPageEnumerator.js +0 -474
@@ -1,205 +1,828 @@
1
1
  import { z } from "zod";
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
- import { HttpMethod, TestType } from "../../types/TestTypes.js";
4
- import { Candidate, DiscriminatorKind } from "../../types/Recommendation.js";
5
- import { ChangedRoute } from "../../utils/changedRoutes.js";
6
- declare const registerCandidateSchema: z.ZodObject<{
7
- scenarioName: z.ZodString;
3
+ import { StateManager, UnifiedAnalysisState } from "../../utils/AnalysisStateManager.js";
4
+ import { TestType } from "../../types/TestTypes.js";
5
+ import { PlanResult } from "../../recommendation/registerPlan.js";
6
+ import { ObjectionAnswer, PlanChange, PlanInput, VerifyContext } from "../../recommendation/types.js";
7
+ /** The whole run's state file: the primary repository at the root, every related
8
+ * repository under `relatedRepos`. */
9
+ type RunState = Awaited<ReturnType<StateManager<UnifiedAnalysisState>["readFullState"]>>;
10
+ export declare const declarationFieldsSchema: z.ZodObject<{
11
+ changedFile: z.ZodOptional<z.ZodString>;
12
+ changes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
+ asserts: z.ZodString;
14
+ stepUnderTest: z.ZodOptional<z.ZodNumber>;
15
+ expected: z.ZodObject<{
16
+ outcome: z.ZodEnum<["fail", "pass"]>;
17
+ why: z.ZodString;
18
+ }, "strict", z.ZodTypeAny, {
19
+ outcome: "pass" | "fail";
20
+ why: string;
21
+ }, {
22
+ outcome: "pass" | "fail";
23
+ why: string;
24
+ }>;
25
+ differsFrom: z.ZodOptional<z.ZodArray<z.ZodObject<{
26
+ plannedTestId: z.ZodString;
27
+ difference: z.ZodString;
28
+ }, "strict", z.ZodTypeAny, {
29
+ plannedTestId: string;
30
+ difference: string;
31
+ }, {
32
+ plannedTestId: string;
33
+ difference: string;
34
+ }>, "many">>;
35
+ existingTests: z.ZodOptional<z.ZodArray<z.ZodObject<{
36
+ file: z.ZodString;
37
+ differsBy: z.ZodString;
38
+ }, "strict", z.ZodTypeAny, {
39
+ file: string;
40
+ differsBy: string;
41
+ }, {
42
+ file: string;
43
+ differsBy: string;
44
+ }>, "many">>;
45
+ startState: z.ZodOptional<z.ZodString>;
46
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
+ step: z.ZodNumber;
48
+ file: z.ZodString;
49
+ }, "strict", z.ZodTypeAny, {
50
+ file: string;
51
+ step: number;
52
+ }, {
53
+ file: string;
54
+ step: number;
55
+ }>, "many">>;
56
+ screenEvidence: z.ZodOptional<z.ZodObject<{
57
+ file: z.ZodString;
58
+ }, "strict", z.ZodTypeAny, {
59
+ file: string;
60
+ }, {
61
+ file: string;
62
+ }>>;
63
+ elements: z.ZodOptional<z.ZodNullable<z.ZodObject<{
64
+ pageUrl: z.ZodOptional<z.ZodString>;
65
+ items: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
66
+ role: z.ZodString;
67
+ accessibleName: z.ZodString;
68
+ testId: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null, string | null | undefined>;
69
+ stableId: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null, string | null | undefined>;
70
+ contextText: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null, string[] | null | undefined>;
71
+ mutability: z.ZodOptional<z.ZodEnum<["mutable", "immutable", "unknown"]>>;
72
+ widgetType: z.ZodOptional<z.ZodEnum<["native", "custom", "unknown"]>>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ role: string;
75
+ accessibleName: string;
76
+ testId: string | null;
77
+ stableId: string | null;
78
+ contextText: string[] | null;
79
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
80
+ widgetType?: "unknown" | "custom" | "native" | undefined;
81
+ }, {
82
+ role: string;
83
+ accessibleName: string;
84
+ testId?: string | null | undefined;
85
+ stableId?: string | null | undefined;
86
+ contextText?: string[] | null | undefined;
87
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
88
+ widgetType?: "unknown" | "custom" | "native" | undefined;
89
+ }>, "many">>>;
90
+ }, "strict", z.ZodTypeAny, {
91
+ items?: {
92
+ role: string;
93
+ accessibleName: string;
94
+ testId: string | null;
95
+ stableId: string | null;
96
+ contextText: string[] | null;
97
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
98
+ widgetType?: "unknown" | "custom" | "native" | undefined;
99
+ }[] | null | undefined;
100
+ pageUrl?: string | undefined;
101
+ }, {
102
+ items?: {
103
+ role: string;
104
+ accessibleName: string;
105
+ testId?: string | null | undefined;
106
+ stableId?: string | null | undefined;
107
+ contextText?: string[] | null | undefined;
108
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
109
+ widgetType?: "unknown" | "custom" | "native" | undefined;
110
+ }[] | null | undefined;
111
+ pageUrl?: string | undefined;
112
+ }>>>;
113
+ }, "strip", z.ZodTypeAny, {
114
+ expected: {
115
+ outcome: "pass" | "fail";
116
+ why: string;
117
+ };
118
+ asserts: string;
119
+ existingTests?: {
120
+ file: string;
121
+ differsBy: string;
122
+ }[] | undefined;
123
+ changedFile?: string | undefined;
124
+ changes?: string[] | undefined;
125
+ routes?: {
126
+ file: string;
127
+ step: number;
128
+ }[] | undefined;
129
+ elements?: {
130
+ items?: {
131
+ role: string;
132
+ accessibleName: string;
133
+ testId: string | null;
134
+ stableId: string | null;
135
+ contextText: string[] | null;
136
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
137
+ widgetType?: "unknown" | "custom" | "native" | undefined;
138
+ }[] | null | undefined;
139
+ pageUrl?: string | undefined;
140
+ } | null | undefined;
141
+ stepUnderTest?: number | undefined;
142
+ differsFrom?: {
143
+ plannedTestId: string;
144
+ difference: string;
145
+ }[] | undefined;
146
+ startState?: string | undefined;
147
+ screenEvidence?: {
148
+ file: string;
149
+ } | undefined;
150
+ }, {
151
+ expected: {
152
+ outcome: "pass" | "fail";
153
+ why: string;
154
+ };
155
+ asserts: string;
156
+ existingTests?: {
157
+ file: string;
158
+ differsBy: string;
159
+ }[] | undefined;
160
+ changedFile?: string | undefined;
161
+ changes?: string[] | undefined;
162
+ routes?: {
163
+ file: string;
164
+ step: number;
165
+ }[] | undefined;
166
+ elements?: {
167
+ items?: {
168
+ role: string;
169
+ accessibleName: string;
170
+ testId?: string | null | undefined;
171
+ stableId?: string | null | undefined;
172
+ contextText?: string[] | null | undefined;
173
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
174
+ widgetType?: "unknown" | "custom" | "native" | undefined;
175
+ }[] | null | undefined;
176
+ pageUrl?: string | undefined;
177
+ } | null | undefined;
178
+ stepUnderTest?: number | undefined;
179
+ differsFrom?: {
180
+ plannedTestId: string;
181
+ difference: string;
182
+ }[] | undefined;
183
+ startState?: string | undefined;
184
+ screenEvidence?: {
185
+ file: string;
186
+ } | undefined;
187
+ }>;
188
+ /** Move a declaration field written one level too high into `declarations`.
189
+ * MEASURED: about one planned test in five did this across 141 eval planned tests, and
190
+ * every stray planned test-level key was a declaration field. A field in BOTH places
191
+ * with different values stays put, so `.strict()` refuses it by name. */
192
+ export declare function hoistDeclarationFields(value: unknown): unknown;
193
+ declare const registerPlannedTestSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
194
+ scenarioName: z.ZodEffects<z.ZodString, string, string>;
195
+ repository: z.ZodOptional<z.ZodString>;
8
196
  description: z.ZodString;
9
197
  category: z.ZodEnum<["new_endpoint", "bug_caught", "requirement_conflict", "business_rule", "security_boundary", "data_integrity", "breaking_change", "auth", "error_handling", "workflow", "data_validation", "crud"]>;
10
- priority: z.ZodEnum<["high", "medium", "low"]>;
11
- testType: z.ZodEffects<z.ZodNativeEnum<typeof TestType>, TestType, TestType>;
12
- steps: z.ZodArray<z.ZodObject<{
198
+ testType: z.ZodEnum<[TestType.CONTRACT, TestType.INTEGRATION, TestType.E2E, TestType.UI]>;
199
+ steps: z.ZodArray<z.ZodEffects<z.ZodObject<{
13
200
  order: z.ZodNumber;
14
- method: z.ZodNativeEnum<typeof HttpMethod>;
15
- path: z.ZodString;
16
- description: z.ZodString;
17
- interactionType: z.ZodEnum<["success", "error", "edge-case"]>;
18
- requestBody: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
19
- queryParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
20
- responseBody: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny, "many">]>>;
21
- expectedStatusCode: z.ZodNumber;
22
- expectedResponseFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
23
- bodyMustInclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
24
- chainsFrom: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
25
- sourceStep: z.ZodNumber;
26
- sourceField: z.ZodString;
27
- sourceLocation: z.ZodEnum<["body", "header", "cookie"]>;
28
- targetParam: z.ZodString;
29
- targetLocation: z.ZodEnum<["path", "body", "query", "header", "cookie"]>;
30
- }, "strip", z.ZodTypeAny, {
31
- sourceStep: number;
32
- sourceField: string;
33
- sourceLocation: "body" | "header" | "cookie";
34
- targetParam: string;
35
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
36
- }, {
37
- sourceStep: number;
38
- sourceField: string;
39
- sourceLocation: "body" | "header" | "cookie";
40
- targetParam: string;
41
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
42
- }>, z.ZodArray<z.ZodObject<{
43
- sourceStep: z.ZodNumber;
44
- sourceField: z.ZodString;
45
- sourceLocation: z.ZodEnum<["body", "header", "cookie"]>;
46
- targetParam: z.ZodString;
47
- targetLocation: z.ZodEnum<["path", "body", "query", "header", "cookie"]>;
48
- }, "strip", z.ZodTypeAny, {
49
- sourceStep: number;
50
- sourceField: string;
51
- sourceLocation: "body" | "header" | "cookie";
52
- targetParam: string;
53
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
54
- }, {
55
- sourceStep: number;
56
- sourceField: string;
57
- sourceLocation: "body" | "header" | "cookie";
58
- targetParam: string;
59
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
60
- }>, "many">]>>;
201
+ method: z.ZodEffects<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "TRACE", "CONNECT", "assert", "click", "drag", "drag-hold", "hover", "inspect", "navigate", "press", "release", "tap", "type", "wait", "OPERATION"]>, "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "type" | "TRACE" | "CONNECT" | "assert" | "click" | "drag" | "drag-hold" | "hover" | "inspect" | "navigate" | "press" | "release" | "tap" | "wait" | "OPERATION", unknown>;
202
+ path: z.ZodEffects<z.ZodString, string, string>;
203
+ description: z.ZodOptional<z.ZodString>;
204
+ interactionType: z.ZodOptional<z.ZodString>;
205
+ requestBody: z.ZodOptional<z.ZodUnknown>;
206
+ queryParams: z.ZodOptional<z.ZodUnknown>;
207
+ omits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
208
+ expectedStatusCode: z.ZodOptional<z.ZodNumber>;
61
209
  }, "strip", z.ZodTypeAny, {
62
210
  path: string;
63
- method: HttpMethod;
64
- description: string;
211
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "type" | "TRACE" | "CONNECT" | "assert" | "click" | "drag" | "drag-hold" | "hover" | "inspect" | "navigate" | "press" | "release" | "tap" | "wait" | "OPERATION";
65
212
  order: number;
66
- interactionType: "error" | "success" | "edge-case";
67
- expectedStatusCode: number;
68
- queryParams?: Record<string, any> | undefined;
69
- requestBody?: Record<string, any> | undefined;
70
- responseBody?: any[] | Record<string, any> | undefined;
71
- expectedResponseFields?: string[] | undefined;
72
- chainsFrom?: {
73
- sourceStep: number;
74
- sourceField: string;
75
- sourceLocation: "body" | "header" | "cookie";
76
- targetParam: string;
77
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
78
- } | {
79
- sourceStep: number;
80
- sourceField: string;
81
- sourceLocation: "body" | "header" | "cookie";
82
- targetParam: string;
83
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
84
- }[] | undefined;
85
- bodyMustInclude?: string[] | undefined;
213
+ description?: string | undefined;
214
+ queryParams?: unknown;
215
+ interactionType?: string | undefined;
216
+ requestBody?: unknown;
217
+ expectedStatusCode?: number | undefined;
218
+ omits?: string[] | undefined;
86
219
  }, {
87
220
  path: string;
88
- method: HttpMethod;
89
- description: string;
90
221
  order: number;
91
- interactionType: "error" | "success" | "edge-case";
92
- expectedStatusCode: number;
93
- queryParams?: Record<string, any> | undefined;
94
- requestBody?: Record<string, any> | undefined;
95
- responseBody?: any[] | Record<string, any> | undefined;
96
- expectedResponseFields?: string[] | undefined;
97
- chainsFrom?: {
98
- sourceStep: number;
99
- sourceField: string;
100
- sourceLocation: "body" | "header" | "cookie";
101
- targetParam: string;
102
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
103
- } | {
104
- sourceStep: number;
105
- sourceField: string;
106
- sourceLocation: "body" | "header" | "cookie";
107
- targetParam: string;
108
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
109
- }[] | undefined;
110
- bodyMustInclude?: string[] | undefined;
222
+ method?: unknown;
223
+ description?: string | undefined;
224
+ queryParams?: unknown;
225
+ interactionType?: string | undefined;
226
+ requestBody?: unknown;
227
+ expectedStatusCode?: number | undefined;
228
+ omits?: string[] | undefined;
229
+ }>, {
230
+ path: string;
231
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "type" | "TRACE" | "CONNECT" | "assert" | "click" | "drag" | "drag-hold" | "hover" | "inspect" | "navigate" | "press" | "release" | "tap" | "wait" | "OPERATION";
232
+ order: number;
233
+ description?: string | undefined;
234
+ queryParams?: unknown;
235
+ interactionType?: string | undefined;
236
+ requestBody?: unknown;
237
+ expectedStatusCode?: number | undefined;
238
+ omits?: string[] | undefined;
239
+ }, {
240
+ path: string;
241
+ order: number;
242
+ method?: unknown;
243
+ description?: string | undefined;
244
+ queryParams?: unknown;
245
+ interactionType?: string | undefined;
246
+ requestBody?: unknown;
247
+ expectedStatusCode?: number | undefined;
248
+ omits?: string[] | undefined;
111
249
  }>, "many">;
112
- discriminator: z.ZodOptional<z.ZodObject<{
113
- kind: z.ZodNativeEnum<typeof DiscriminatorKind>;
114
- changedCodeAnchor: z.ZodString;
115
- }, "strip", z.ZodTypeAny, {
116
- kind: DiscriminatorKind;
117
- changedCodeAnchor: string;
250
+ declarations: z.ZodOptional<z.ZodEffects<z.ZodObject<{
251
+ changedFile: z.ZodOptional<z.ZodString>;
252
+ changes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
253
+ asserts: z.ZodString;
254
+ stepUnderTest: z.ZodOptional<z.ZodNumber>;
255
+ expected: z.ZodObject<{
256
+ outcome: z.ZodEnum<["fail", "pass"]>;
257
+ why: z.ZodString;
258
+ }, "strict", z.ZodTypeAny, {
259
+ outcome: "pass" | "fail";
260
+ why: string;
261
+ }, {
262
+ outcome: "pass" | "fail";
263
+ why: string;
264
+ }>;
265
+ differsFrom: z.ZodOptional<z.ZodArray<z.ZodObject<{
266
+ plannedTestId: z.ZodString;
267
+ difference: z.ZodString;
268
+ }, "strict", z.ZodTypeAny, {
269
+ plannedTestId: string;
270
+ difference: string;
271
+ }, {
272
+ plannedTestId: string;
273
+ difference: string;
274
+ }>, "many">>;
275
+ existingTests: z.ZodOptional<z.ZodArray<z.ZodObject<{
276
+ file: z.ZodString;
277
+ differsBy: z.ZodString;
278
+ }, "strict", z.ZodTypeAny, {
279
+ file: string;
280
+ differsBy: string;
281
+ }, {
282
+ file: string;
283
+ differsBy: string;
284
+ }>, "many">>;
285
+ startState: z.ZodOptional<z.ZodString>;
286
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
287
+ step: z.ZodNumber;
288
+ file: z.ZodString;
289
+ }, "strict", z.ZodTypeAny, {
290
+ file: string;
291
+ step: number;
292
+ }, {
293
+ file: string;
294
+ step: number;
295
+ }>, "many">>;
296
+ screenEvidence: z.ZodOptional<z.ZodObject<{
297
+ file: z.ZodString;
298
+ }, "strict", z.ZodTypeAny, {
299
+ file: string;
300
+ }, {
301
+ file: string;
302
+ }>>;
303
+ elements: z.ZodOptional<z.ZodNullable<z.ZodObject<{
304
+ pageUrl: z.ZodOptional<z.ZodString>;
305
+ items: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
306
+ role: z.ZodString;
307
+ accessibleName: z.ZodString;
308
+ testId: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null, string | null | undefined>;
309
+ stableId: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null, string | null | undefined>;
310
+ contextText: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null, string[] | null | undefined>;
311
+ mutability: z.ZodOptional<z.ZodEnum<["mutable", "immutable", "unknown"]>>;
312
+ widgetType: z.ZodOptional<z.ZodEnum<["native", "custom", "unknown"]>>;
313
+ }, "strip", z.ZodTypeAny, {
314
+ role: string;
315
+ accessibleName: string;
316
+ testId: string | null;
317
+ stableId: string | null;
318
+ contextText: string[] | null;
319
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
320
+ widgetType?: "unknown" | "custom" | "native" | undefined;
321
+ }, {
322
+ role: string;
323
+ accessibleName: string;
324
+ testId?: string | null | undefined;
325
+ stableId?: string | null | undefined;
326
+ contextText?: string[] | null | undefined;
327
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
328
+ widgetType?: "unknown" | "custom" | "native" | undefined;
329
+ }>, "many">>>;
330
+ }, "strict", z.ZodTypeAny, {
331
+ items?: {
332
+ role: string;
333
+ accessibleName: string;
334
+ testId: string | null;
335
+ stableId: string | null;
336
+ contextText: string[] | null;
337
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
338
+ widgetType?: "unknown" | "custom" | "native" | undefined;
339
+ }[] | null | undefined;
340
+ pageUrl?: string | undefined;
341
+ }, {
342
+ items?: {
343
+ role: string;
344
+ accessibleName: string;
345
+ testId?: string | null | undefined;
346
+ stableId?: string | null | undefined;
347
+ contextText?: string[] | null | undefined;
348
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
349
+ widgetType?: "unknown" | "custom" | "native" | undefined;
350
+ }[] | null | undefined;
351
+ pageUrl?: string | undefined;
352
+ }>>>;
353
+ }, "strict", z.ZodTypeAny, {
354
+ expected: {
355
+ outcome: "pass" | "fail";
356
+ why: string;
357
+ };
358
+ asserts: string;
359
+ existingTests?: {
360
+ file: string;
361
+ differsBy: string;
362
+ }[] | undefined;
363
+ changedFile?: string | undefined;
364
+ changes?: string[] | undefined;
365
+ routes?: {
366
+ file: string;
367
+ step: number;
368
+ }[] | undefined;
369
+ elements?: {
370
+ items?: {
371
+ role: string;
372
+ accessibleName: string;
373
+ testId: string | null;
374
+ stableId: string | null;
375
+ contextText: string[] | null;
376
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
377
+ widgetType?: "unknown" | "custom" | "native" | undefined;
378
+ }[] | null | undefined;
379
+ pageUrl?: string | undefined;
380
+ } | null | undefined;
381
+ stepUnderTest?: number | undefined;
382
+ differsFrom?: {
383
+ plannedTestId: string;
384
+ difference: string;
385
+ }[] | undefined;
386
+ startState?: string | undefined;
387
+ screenEvidence?: {
388
+ file: string;
389
+ } | undefined;
118
390
  }, {
119
- kind: DiscriminatorKind;
120
- changedCodeAnchor: string;
391
+ expected: {
392
+ outcome: "pass" | "fail";
393
+ why: string;
394
+ };
395
+ asserts: string;
396
+ existingTests?: {
397
+ file: string;
398
+ differsBy: string;
399
+ }[] | undefined;
400
+ changedFile?: string | undefined;
401
+ changes?: string[] | undefined;
402
+ routes?: {
403
+ file: string;
404
+ step: number;
405
+ }[] | undefined;
406
+ elements?: {
407
+ items?: {
408
+ role: string;
409
+ accessibleName: string;
410
+ testId?: string | null | undefined;
411
+ stableId?: string | null | undefined;
412
+ contextText?: string[] | null | undefined;
413
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
414
+ widgetType?: "unknown" | "custom" | "native" | undefined;
415
+ }[] | null | undefined;
416
+ pageUrl?: string | undefined;
417
+ } | null | undefined;
418
+ stepUnderTest?: number | undefined;
419
+ differsFrom?: {
420
+ plannedTestId: string;
421
+ difference: string;
422
+ }[] | undefined;
423
+ startState?: string | undefined;
424
+ screenEvidence?: {
425
+ file: string;
426
+ } | undefined;
427
+ }>, {
428
+ expected: {
429
+ outcome: "pass" | "fail";
430
+ why: string;
431
+ };
432
+ asserts: string;
433
+ existingTests?: {
434
+ file: string;
435
+ differsBy: string;
436
+ }[] | undefined;
437
+ changedFile?: string | undefined;
438
+ changes?: string[] | undefined;
439
+ routes?: {
440
+ file: string;
441
+ step: number;
442
+ }[] | undefined;
443
+ elements?: {
444
+ items?: {
445
+ role: string;
446
+ accessibleName: string;
447
+ testId: string | null;
448
+ stableId: string | null;
449
+ contextText: string[] | null;
450
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
451
+ widgetType?: "unknown" | "custom" | "native" | undefined;
452
+ }[] | null | undefined;
453
+ pageUrl?: string | undefined;
454
+ } | null | undefined;
455
+ stepUnderTest?: number | undefined;
456
+ differsFrom?: {
457
+ plannedTestId: string;
458
+ difference: string;
459
+ }[] | undefined;
460
+ startState?: string | undefined;
461
+ screenEvidence?: {
462
+ file: string;
463
+ } | undefined;
464
+ }, {
465
+ expected: {
466
+ outcome: "pass" | "fail";
467
+ why: string;
468
+ };
469
+ asserts: string;
470
+ existingTests?: {
471
+ file: string;
472
+ differsBy: string;
473
+ }[] | undefined;
474
+ changedFile?: string | undefined;
475
+ changes?: string[] | undefined;
476
+ routes?: {
477
+ file: string;
478
+ step: number;
479
+ }[] | undefined;
480
+ elements?: {
481
+ items?: {
482
+ role: string;
483
+ accessibleName: string;
484
+ testId?: string | null | undefined;
485
+ stableId?: string | null | undefined;
486
+ contextText?: string[] | null | undefined;
487
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
488
+ widgetType?: "unknown" | "custom" | "native" | undefined;
489
+ }[] | null | undefined;
490
+ pageUrl?: string | undefined;
491
+ } | null | undefined;
492
+ stepUnderTest?: number | undefined;
493
+ differsFrom?: {
494
+ plannedTestId: string;
495
+ difference: string;
496
+ }[] | undefined;
497
+ startState?: string | undefined;
498
+ screenEvidence?: {
499
+ file: string;
500
+ } | undefined;
121
501
  }>>;
122
- }, "strip", z.ZodTypeAny, {
502
+ }, "strict", z.ZodTypeAny, {
123
503
  description: string;
124
- priority: "high" | "medium" | "low";
125
- testType: TestType;
504
+ testType: TestType.CONTRACT | TestType.INTEGRATION | TestType.E2E | TestType.UI;
126
505
  scenarioName: string;
127
506
  category: "new_endpoint" | "bug_caught" | "requirement_conflict" | "business_rule" | "security_boundary" | "data_integrity" | "breaking_change" | "auth" | "error_handling" | "workflow" | "data_validation" | "crud";
128
507
  steps: {
129
508
  path: string;
130
- method: HttpMethod;
131
- description: string;
509
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "type" | "TRACE" | "CONNECT" | "assert" | "click" | "drag" | "drag-hold" | "hover" | "inspect" | "navigate" | "press" | "release" | "tap" | "wait" | "OPERATION";
132
510
  order: number;
133
- interactionType: "error" | "success" | "edge-case";
134
- expectedStatusCode: number;
135
- queryParams?: Record<string, any> | undefined;
136
- requestBody?: Record<string, any> | undefined;
137
- responseBody?: any[] | Record<string, any> | undefined;
138
- expectedResponseFields?: string[] | undefined;
139
- chainsFrom?: {
140
- sourceStep: number;
141
- sourceField: string;
142
- sourceLocation: "body" | "header" | "cookie";
143
- targetParam: string;
144
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
145
- } | {
146
- sourceStep: number;
147
- sourceField: string;
148
- sourceLocation: "body" | "header" | "cookie";
149
- targetParam: string;
150
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
151
- }[] | undefined;
152
- bodyMustInclude?: string[] | undefined;
511
+ description?: string | undefined;
512
+ queryParams?: unknown;
513
+ interactionType?: string | undefined;
514
+ requestBody?: unknown;
515
+ expectedStatusCode?: number | undefined;
516
+ omits?: string[] | undefined;
153
517
  }[];
154
- discriminator?: {
155
- kind: DiscriminatorKind;
156
- changedCodeAnchor: string;
518
+ repository?: string | undefined;
519
+ declarations?: {
520
+ expected: {
521
+ outcome: "pass" | "fail";
522
+ why: string;
523
+ };
524
+ asserts: string;
525
+ existingTests?: {
526
+ file: string;
527
+ differsBy: string;
528
+ }[] | undefined;
529
+ changedFile?: string | undefined;
530
+ changes?: string[] | undefined;
531
+ routes?: {
532
+ file: string;
533
+ step: number;
534
+ }[] | undefined;
535
+ elements?: {
536
+ items?: {
537
+ role: string;
538
+ accessibleName: string;
539
+ testId: string | null;
540
+ stableId: string | null;
541
+ contextText: string[] | null;
542
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
543
+ widgetType?: "unknown" | "custom" | "native" | undefined;
544
+ }[] | null | undefined;
545
+ pageUrl?: string | undefined;
546
+ } | null | undefined;
547
+ stepUnderTest?: number | undefined;
548
+ differsFrom?: {
549
+ plannedTestId: string;
550
+ difference: string;
551
+ }[] | undefined;
552
+ startState?: string | undefined;
553
+ screenEvidence?: {
554
+ file: string;
555
+ } | undefined;
157
556
  } | undefined;
158
557
  }, {
159
558
  description: string;
160
- priority: "high" | "medium" | "low";
161
- testType: TestType;
559
+ testType: TestType.CONTRACT | TestType.INTEGRATION | TestType.E2E | TestType.UI;
162
560
  scenarioName: string;
163
561
  category: "new_endpoint" | "bug_caught" | "requirement_conflict" | "business_rule" | "security_boundary" | "data_integrity" | "breaking_change" | "auth" | "error_handling" | "workflow" | "data_validation" | "crud";
164
562
  steps: {
165
563
  path: string;
166
- method: HttpMethod;
167
- description: string;
168
564
  order: number;
169
- interactionType: "error" | "success" | "edge-case";
170
- expectedStatusCode: number;
171
- queryParams?: Record<string, any> | undefined;
172
- requestBody?: Record<string, any> | undefined;
173
- responseBody?: any[] | Record<string, any> | undefined;
174
- expectedResponseFields?: string[] | undefined;
175
- chainsFrom?: {
176
- sourceStep: number;
177
- sourceField: string;
178
- sourceLocation: "body" | "header" | "cookie";
179
- targetParam: string;
180
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
181
- } | {
182
- sourceStep: number;
183
- sourceField: string;
184
- sourceLocation: "body" | "header" | "cookie";
185
- targetParam: string;
186
- targetLocation: "path" | "body" | "header" | "cookie" | "query";
187
- }[] | undefined;
188
- bodyMustInclude?: string[] | undefined;
565
+ method?: unknown;
566
+ description?: string | undefined;
567
+ queryParams?: unknown;
568
+ interactionType?: string | undefined;
569
+ requestBody?: unknown;
570
+ expectedStatusCode?: number | undefined;
571
+ omits?: string[] | undefined;
189
572
  }[];
190
- discriminator?: {
191
- kind: DiscriminatorKind;
192
- changedCodeAnchor: string;
573
+ repository?: string | undefined;
574
+ declarations?: {
575
+ expected: {
576
+ outcome: "pass" | "fail";
577
+ why: string;
578
+ };
579
+ asserts: string;
580
+ existingTests?: {
581
+ file: string;
582
+ differsBy: string;
583
+ }[] | undefined;
584
+ changedFile?: string | undefined;
585
+ changes?: string[] | undefined;
586
+ routes?: {
587
+ file: string;
588
+ step: number;
589
+ }[] | undefined;
590
+ elements?: {
591
+ items?: {
592
+ role: string;
593
+ accessibleName: string;
594
+ testId?: string | null | undefined;
595
+ stableId?: string | null | undefined;
596
+ contextText?: string[] | null | undefined;
597
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
598
+ widgetType?: "unknown" | "custom" | "native" | undefined;
599
+ }[] | null | undefined;
600
+ pageUrl?: string | undefined;
601
+ } | null | undefined;
602
+ stepUnderTest?: number | undefined;
603
+ differsFrom?: {
604
+ plannedTestId: string;
605
+ difference: string;
606
+ }[] | undefined;
607
+ startState?: string | undefined;
608
+ screenEvidence?: {
609
+ file: string;
610
+ } | undefined;
193
611
  } | undefined;
194
- }>;
195
- type RegisterCandidateInput = z.infer<typeof registerCandidateSchema>;
196
- /** Build the agent-submitted candidates. Discriminator claims are verified
197
- * later, by {@link applyDiscriminatorClaims}, once the merge has settled which
198
- * scenario each name resolves to. Exported for the direct unit test in
199
- * registerTestPlanTool.test.ts — a candidate that does not survive selection
200
- * never reaches the persisted plan, so its subjectEndpoints fill is not
201
- * observable through the tool's output, and testing here avoids coupling the
202
- * fill to what selection happens to keep. */
203
- export declare function buildAgentCandidates(candidates: RegisterCandidateInput[], changedRoutes: ChangedRoute[]): Candidate[];
612
+ }>, {
613
+ description: string;
614
+ testType: TestType.CONTRACT | TestType.INTEGRATION | TestType.E2E | TestType.UI;
615
+ scenarioName: string;
616
+ category: "new_endpoint" | "bug_caught" | "requirement_conflict" | "business_rule" | "security_boundary" | "data_integrity" | "breaking_change" | "auth" | "error_handling" | "workflow" | "data_validation" | "crud";
617
+ steps: {
618
+ path: string;
619
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "type" | "TRACE" | "CONNECT" | "assert" | "click" | "drag" | "drag-hold" | "hover" | "inspect" | "navigate" | "press" | "release" | "tap" | "wait" | "OPERATION";
620
+ order: number;
621
+ description?: string | undefined;
622
+ queryParams?: unknown;
623
+ interactionType?: string | undefined;
624
+ requestBody?: unknown;
625
+ expectedStatusCode?: number | undefined;
626
+ omits?: string[] | undefined;
627
+ }[];
628
+ repository?: string | undefined;
629
+ declarations?: {
630
+ expected: {
631
+ outcome: "pass" | "fail";
632
+ why: string;
633
+ };
634
+ asserts: string;
635
+ existingTests?: {
636
+ file: string;
637
+ differsBy: string;
638
+ }[] | undefined;
639
+ changedFile?: string | undefined;
640
+ changes?: string[] | undefined;
641
+ routes?: {
642
+ file: string;
643
+ step: number;
644
+ }[] | undefined;
645
+ elements?: {
646
+ items?: {
647
+ role: string;
648
+ accessibleName: string;
649
+ testId: string | null;
650
+ stableId: string | null;
651
+ contextText: string[] | null;
652
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
653
+ widgetType?: "unknown" | "custom" | "native" | undefined;
654
+ }[] | null | undefined;
655
+ pageUrl?: string | undefined;
656
+ } | null | undefined;
657
+ stepUnderTest?: number | undefined;
658
+ differsFrom?: {
659
+ plannedTestId: string;
660
+ difference: string;
661
+ }[] | undefined;
662
+ startState?: string | undefined;
663
+ screenEvidence?: {
664
+ file: string;
665
+ } | undefined;
666
+ } | undefined;
667
+ }, {
668
+ description: string;
669
+ testType: TestType.CONTRACT | TestType.INTEGRATION | TestType.E2E | TestType.UI;
670
+ scenarioName: string;
671
+ category: "new_endpoint" | "bug_caught" | "requirement_conflict" | "business_rule" | "security_boundary" | "data_integrity" | "breaking_change" | "auth" | "error_handling" | "workflow" | "data_validation" | "crud";
672
+ steps: {
673
+ path: string;
674
+ order: number;
675
+ method?: unknown;
676
+ description?: string | undefined;
677
+ queryParams?: unknown;
678
+ interactionType?: string | undefined;
679
+ requestBody?: unknown;
680
+ expectedStatusCode?: number | undefined;
681
+ omits?: string[] | undefined;
682
+ }[];
683
+ repository?: string | undefined;
684
+ declarations?: {
685
+ expected: {
686
+ outcome: "pass" | "fail";
687
+ why: string;
688
+ };
689
+ asserts: string;
690
+ existingTests?: {
691
+ file: string;
692
+ differsBy: string;
693
+ }[] | undefined;
694
+ changedFile?: string | undefined;
695
+ changes?: string[] | undefined;
696
+ routes?: {
697
+ file: string;
698
+ step: number;
699
+ }[] | undefined;
700
+ elements?: {
701
+ items?: {
702
+ role: string;
703
+ accessibleName: string;
704
+ testId?: string | null | undefined;
705
+ stableId?: string | null | undefined;
706
+ contextText?: string[] | null | undefined;
707
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
708
+ widgetType?: "unknown" | "custom" | "native" | undefined;
709
+ }[] | null | undefined;
710
+ pageUrl?: string | undefined;
711
+ } | null | undefined;
712
+ stepUnderTest?: number | undefined;
713
+ differsFrom?: {
714
+ plannedTestId: string;
715
+ difference: string;
716
+ }[] | undefined;
717
+ startState?: string | undefined;
718
+ screenEvidence?: {
719
+ file: string;
720
+ } | undefined;
721
+ } | undefined;
722
+ }>, {
723
+ description: string;
724
+ testType: TestType.CONTRACT | TestType.INTEGRATION | TestType.E2E | TestType.UI;
725
+ scenarioName: string;
726
+ category: "new_endpoint" | "bug_caught" | "requirement_conflict" | "business_rule" | "security_boundary" | "data_integrity" | "breaking_change" | "auth" | "error_handling" | "workflow" | "data_validation" | "crud";
727
+ steps: {
728
+ path: string;
729
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "type" | "TRACE" | "CONNECT" | "assert" | "click" | "drag" | "drag-hold" | "hover" | "inspect" | "navigate" | "press" | "release" | "tap" | "wait" | "OPERATION";
730
+ order: number;
731
+ description?: string | undefined;
732
+ queryParams?: unknown;
733
+ interactionType?: string | undefined;
734
+ requestBody?: unknown;
735
+ expectedStatusCode?: number | undefined;
736
+ omits?: string[] | undefined;
737
+ }[];
738
+ repository?: string | undefined;
739
+ declarations?: {
740
+ expected: {
741
+ outcome: "pass" | "fail";
742
+ why: string;
743
+ };
744
+ asserts: string;
745
+ existingTests?: {
746
+ file: string;
747
+ differsBy: string;
748
+ }[] | undefined;
749
+ changedFile?: string | undefined;
750
+ changes?: string[] | undefined;
751
+ routes?: {
752
+ file: string;
753
+ step: number;
754
+ }[] | undefined;
755
+ elements?: {
756
+ items?: {
757
+ role: string;
758
+ accessibleName: string;
759
+ testId: string | null;
760
+ stableId: string | null;
761
+ contextText: string[] | null;
762
+ mutability?: "unknown" | "mutable" | "immutable" | undefined;
763
+ widgetType?: "unknown" | "custom" | "native" | undefined;
764
+ }[] | null | undefined;
765
+ pageUrl?: string | undefined;
766
+ } | null | undefined;
767
+ stepUnderTest?: number | undefined;
768
+ differsFrom?: {
769
+ plannedTestId: string;
770
+ difference: string;
771
+ }[] | undefined;
772
+ startState?: string | undefined;
773
+ screenEvidence?: {
774
+ file: string;
775
+ } | undefined;
776
+ } | undefined;
777
+ }, unknown>;
778
+ type RegisterPlannedTestInput = z.infer<typeof registerPlannedTestSchema>;
779
+ export interface RegisterTestPlanParams {
780
+ stateFile?: string;
781
+ changes?: PlanChange[];
782
+ plannedTests?: RegisterPlannedTestInput[];
783
+ answers?: ObjectionAnswer[];
784
+ }
785
+ /** Map the schema-validated input onto a `PlanInput`. `subjectEndpoints` is
786
+ * deliberately not resolved: every verifier derives the subject from `steps`
787
+ * through one helper. The planned test id IS the scenario name, so an objection
788
+ * names the plan entry in the words the agent wrote for it. */
789
+ export declare function buildRegistration(params: RegisterTestPlanParams, registrationNumber: number): PlanInput;
790
+ /**
791
+ * Whether a cited repository file EXISTS inside the checkout. Reads no content,
792
+ * and never throws: a bad citation is an objection, not a crashed tool.
793
+ *
794
+ * CONFINEMENT IS THIS FUNCTION'S JOB. The sibling verifier's string check misses
795
+ * `file://` and `http://` URLs, a drive-relative `C:routes.rb` and a
796
+ * percent-encoded `..`, so the containment in `containedPath` is the only thing
797
+ * between an agent-written path and a read outside the checkout.
798
+ *
799
+ * CASE IS THE FILESYSTEM'S RULE: a case-only misspelling passes on a
800
+ * case-insensitive checkout and is not found on a case-sensitive one. CI is the
801
+ * case-sensitive one, so that is the answer a real run gets.
802
+ */
803
+ export declare function makeCitedFileCheck(state: RunState): (relativePath: string) => boolean;
804
+ /**
805
+ * The route patterns that render a changed frontend file, across every repository
806
+ * of the run.
807
+ *
808
+ * Built like {@link makeCitedFileCheck}: one resolver per checkout, asked in turn,
809
+ * so a planned test does not have to say which repository its file lives in. The
810
+ * scan is lazy inside each resolver and reused across planned tests, so a plan with
811
+ * ten UI tests reads a repository once.
812
+ *
813
+ * A repository that CAN speak for the file wins: `undefined` from a resolver means
814
+ * "not my file, or not a framework I read", so it is skipped, and the first
815
+ * definite answer is returned. Every resolver saying `undefined` is the answer the
816
+ * check stays silent on.
817
+ */
818
+ export declare function makeScreenRouteResolver(state: RunState): (relativePath: string) => string[] | undefined;
819
+ /** Every fact the verifiers check against, gathered once per registration. */
820
+ export declare function buildVerifyContext(state: RunState): Promise<VerifyContext>;
821
+ /**
822
+ * What the agent reads back. Every objection carries its id so it can be answered,
823
+ * and the text says the plan is stored either way — a objections list without that
824
+ * line reads as a rejection and invites a needless second registration.
825
+ */
826
+ export declare function renderPlanResult(result: PlanResult): string;
204
827
  export declare function registerRegisterTestPlanTool(server: McpServer): void;
205
828
  export {};