@skyramp/mcp 0.2.6 → 0.2.7

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 (184) hide show
  1. package/build/commands/commandLibrary.d.ts +12 -0
  2. package/build/commands/recommendTestsAndExecuteCommand.d.ts +2 -0
  3. package/build/commands/testThisEndpointCommand.d.ts +2 -0
  4. package/build/index.d.ts +2 -0
  5. package/build/index.js +1 -2
  6. package/build/playwright/PlaywrightTraceService.d.ts +32 -0
  7. package/build/playwright/index.d.ts +3 -0
  8. package/build/playwright/registerPlaywrightTools.d.ts +8 -0
  9. package/build/playwright/registerPlaywrightTools.js +12 -11
  10. package/build/playwright/traceRecordingPrompt.d.ts +13 -0
  11. package/build/playwright/traceRecordingPrompt.js +3 -11
  12. package/build/prompts/code-reuse.d.ts +1 -0
  13. package/build/prompts/enhance-assertions/contractProviderAssertionsPrompt.d.ts +2 -0
  14. package/build/prompts/enhance-assertions/integrationAssertionsPrompt.d.ts +2 -0
  15. package/build/prompts/enhance-assertions/sharedAssertionRules.d.ts +15 -0
  16. package/build/prompts/enhance-assertions/uiAssertionsPrompt.d.ts +2 -0
  17. package/build/prompts/fix-error-prompt.d.ts +1 -0
  18. package/build/prompts/initialize-workspace/initializeWorkspacePrompt.d.ts +1 -0
  19. package/build/prompts/modularization/integration-test-modularization.d.ts +1 -0
  20. package/build/prompts/modularization/ui-test-modularization.d.ts +1 -0
  21. package/build/prompts/personas.d.ts +21 -0
  22. package/build/prompts/pom-aware-code-reuse.d.ts +1 -0
  23. package/build/prompts/startTraceCollectionPrompts.d.ts +2 -0
  24. package/build/prompts/test-maintenance/actionsInstructions.d.ts +35 -0
  25. package/build/prompts/test-maintenance/drift-analysis-prompt.d.ts +4 -0
  26. package/build/prompts/test-maintenance/driftAnalysisSections.d.ts +13 -0
  27. package/build/prompts/test-recommendation/analysisOutputPrompt.d.ts +84 -0
  28. package/build/prompts/test-recommendation/analysisOutputPrompt.test.d.ts +1 -0
  29. package/build/prompts/test-recommendation/analysisOutputPrompt.test.js +1 -0
  30. package/build/prompts/test-recommendation/diffExecutionPlan.d.ts +17 -0
  31. package/build/prompts/test-recommendation/diffExecutionPlan.js +7 -16
  32. package/build/prompts/test-recommendation/fullRepoCatalog.d.ts +7 -0
  33. package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.d.ts +1 -0
  34. package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.js +1 -0
  35. package/build/prompts/test-recommendation/promptPlan.d.ts +203 -0
  36. package/build/prompts/test-recommendation/promptPlan.test.d.ts +1 -0
  37. package/build/prompts/test-recommendation/recommendationSections.d.ts +35 -0
  38. package/build/prompts/test-recommendation/recommendationShared.d.ts +31 -0
  39. package/build/prompts/test-recommendation/registerRecommendTestsPrompt.d.ts +7 -0
  40. package/build/prompts/test-recommendation/scopeAssessment.d.ts +55 -0
  41. package/build/prompts/test-recommendation/scopeAssessment.js +2 -2
  42. package/build/prompts/test-recommendation/scopeAssessment.test.d.ts +1 -0
  43. package/build/prompts/test-recommendation/scopeAssessment.test.js +1 -0
  44. package/build/prompts/test-recommendation/test-recommendation-prompt.d.ts +6 -0
  45. package/build/prompts/test-recommendation/test-recommendation-prompt.js +4 -4
  46. package/build/prompts/test-recommendation/test-recommendation-prompt.test.d.ts +1 -0
  47. package/build/prompts/test-recommendation/test-recommendation-prompt.test.js +6 -99
  48. package/build/prompts/testbot/testbot-prompts.d.ts +11 -0
  49. package/build/prompts/testbot/testbot-prompts.js +198 -34
  50. package/build/prompts/testbot/testbot-prompts.test.d.ts +1 -0
  51. package/build/prompts/testbot/testbot-prompts.test.js +15 -73
  52. package/build/resources/analysisResources.d.ts +17 -0
  53. package/build/resources/progressResource.d.ts +2 -0
  54. package/build/resources/testbotResource.d.ts +2 -0
  55. package/build/services/AnalyticsService.d.ts +13 -0
  56. package/build/services/AnalyticsService.test.d.ts +1 -0
  57. package/build/services/AnalyticsService.test.js +86 -0
  58. package/build/services/ModularizationService.d.ts +11 -0
  59. package/build/services/ScenarioGenerationService.d.ts +37 -0
  60. package/build/services/ScenarioGenerationService.integration.test.d.ts +1 -0
  61. package/build/services/ScenarioGenerationService.integration.test.js +4 -0
  62. package/build/services/ScenarioGenerationService.test.d.ts +1 -0
  63. package/build/services/TestDiscoveryService.d.ts +128 -0
  64. package/build/services/TestDiscoveryService.test.d.ts +1 -0
  65. package/build/services/TestDiscoveryService.test.js +4 -3
  66. package/build/services/TestExecutionService.d.ts +46 -0
  67. package/build/services/TestExecutionService.test.d.ts +1 -0
  68. package/build/services/TestExecutionService.test.js +33 -25
  69. package/build/services/TestGenerationService.d.ts +56 -0
  70. package/build/services/TestGenerationService.test.d.ts +1 -0
  71. package/build/services/TestGenerationService.test.js +10 -8
  72. package/build/services/containerEnv.d.ts +14 -0
  73. package/build/tool-phase-coverage.test.d.ts +1 -0
  74. package/build/tool-phase-coverage.test.js +2 -0
  75. package/build/tool-phases.d.ts +38 -0
  76. package/build/tools/auth/loginTool.d.ts +2 -0
  77. package/build/tools/auth/logoutTool.d.ts +2 -0
  78. package/build/tools/code-refactor/codeReuseTool.d.ts +2 -0
  79. package/build/tools/code-refactor/enhanceAssertionsTool.d.ts +2 -0
  80. package/build/tools/code-refactor/modularizationTool.d.ts +2 -0
  81. package/build/tools/executeSkyrampTestTool.d.ts +2 -0
  82. package/build/tools/fixErrorTool.d.ts +2 -0
  83. package/build/tools/generate-tests/generateBatchScenarioRestTool.d.ts +45 -0
  84. package/build/tools/generate-tests/generateBatchScenarioRestTool.test.d.ts +1 -0
  85. package/build/tools/generate-tests/generateBatchScenarioRestTool.test.js +11 -9
  86. package/build/tools/generate-tests/generateContractRestTool.d.ts +31 -0
  87. package/build/tools/generate-tests/generateE2ERestTool.d.ts +13 -0
  88. package/build/tools/generate-tests/generateFuzzRestTool.d.ts +10 -0
  89. package/build/tools/generate-tests/generateIntegrationRestTool.d.ts +16 -0
  90. package/build/tools/generate-tests/generateLoadRestTool.d.ts +18 -0
  91. package/build/tools/generate-tests/generateLoadRestTool.test.d.ts +1 -0
  92. package/build/tools/generate-tests/generateMockRestTool.d.ts +64 -0
  93. package/build/tools/generate-tests/generateSmokeRestTool.d.ts +8 -0
  94. package/build/tools/generate-tests/generateUIRestTool.d.ts +14 -0
  95. package/build/tools/generate-tests/generateUIRestTool.js +1 -1
  96. package/build/tools/generate-tests/loadTestSchema.d.ts +39 -0
  97. package/build/tools/one-click/oneClickTool.d.ts +11 -0
  98. package/build/tools/submitReportTool.d.ts +384 -0
  99. package/build/tools/submitReportTool.js +144 -2
  100. package/build/tools/submitReportTool.test.d.ts +1 -0
  101. package/build/tools/submitReportTool.test.js +215 -5
  102. package/build/tools/test-management/actionsTool.d.ts +10 -0
  103. package/build/tools/test-management/analyzeChangesTool.d.ts +27 -0
  104. package/build/tools/test-management/analyzeChangesTool.js +44 -7
  105. package/build/tools/test-management/analyzeChangesTool.test.d.ts +1 -0
  106. package/build/tools/test-management/analyzeChangesTool.test.js +76 -39
  107. package/build/tools/test-management/analyzeTestHealthTool.d.ts +2 -0
  108. package/build/tools/test-management/index.d.ts +3 -0
  109. package/build/tools/test-management/index.js +0 -1
  110. package/build/tools/trace/resolveSaveStoragePath.d.ts +7 -0
  111. package/build/tools/trace/resolveSaveStoragePath.test.d.ts +1 -0
  112. package/build/tools/trace/resolveSessionPaths.d.ts +40 -0
  113. package/build/tools/trace/resolveSessionPaths.test.d.ts +1 -0
  114. package/build/tools/trace/sessionState.d.ts +2 -0
  115. package/build/tools/trace/sessionState.test.d.ts +1 -0
  116. package/build/tools/trace/startTraceCollectionTool.d.ts +2 -0
  117. package/build/tools/trace/stopTraceCollectionTool.d.ts +2 -0
  118. package/build/tools/workspace/initScanWorkspaceTool.d.ts +4 -0
  119. package/build/tools/workspace/initializeWorkspaceTool.d.ts +2 -0
  120. package/build/tools/workspace/initializeWorkspaceTool.test.d.ts +1 -0
  121. package/build/tools/workspace/initializeWorkspaceTool.test.js +134 -0
  122. package/build/types/OneClickCommands.d.ts +68 -0
  123. package/build/types/RepositoryAnalysis.d.ts +3004 -0
  124. package/build/types/TestAnalysis.d.ts +96 -0
  125. package/build/types/TestExecution.d.ts +53 -0
  126. package/build/types/TestRecommendation.d.ts +12 -0
  127. package/build/types/TestTypes.d.ts +234 -0
  128. package/build/utils/AnalysisStateManager.d.ts +182 -0
  129. package/build/utils/AnalysisStateManager.test.d.ts +1 -0
  130. package/build/utils/analyze-openapi.d.ts +1 -0
  131. package/build/utils/branchDiff.d.ts +18 -0
  132. package/build/utils/dartRouteExtractor.d.ts +45 -0
  133. package/build/utils/dartRouteExtractor.test.d.ts +1 -0
  134. package/build/utils/docker.d.ts +19 -0
  135. package/build/utils/docker.test.d.ts +1 -0
  136. package/build/utils/docker.test.js +10 -9
  137. package/build/utils/featureFlags.d.ts +37 -0
  138. package/build/utils/featureFlags.test.d.ts +1 -0
  139. package/build/utils/gitStaging.d.ts +24 -0
  140. package/build/utils/gitStaging.test.d.ts +1 -0
  141. package/build/utils/gitStaging.test.js +13 -7
  142. package/build/utils/httpDefaults.d.ts +10 -0
  143. package/build/utils/httpDefaults.test.d.ts +1 -0
  144. package/build/utils/initAgent.d.ts +36 -0
  145. package/build/utils/language-helper.d.ts +6 -0
  146. package/build/utils/logger.d.ts +11 -0
  147. package/build/utils/normalizeParams.d.ts +14 -0
  148. package/build/utils/normalizeSkyrampImports.d.ts +13 -0
  149. package/build/utils/pr-comment-parser.d.ts +31 -0
  150. package/build/utils/pr-comment-parser.test.d.ts +1 -0
  151. package/build/utils/pr-comment-parser.test.js +6 -5
  152. package/build/utils/projectMetadata.d.ts +15 -0
  153. package/build/utils/projectMetadata.test.d.ts +1 -0
  154. package/build/utils/proxy-terminal.d.ts +2 -0
  155. package/build/utils/repoScanner.d.ts +27 -0
  156. package/build/utils/repoScanner.test.d.ts +1 -0
  157. package/build/utils/routeParsers.d.ts +63 -0
  158. package/build/utils/routeParsers.test.d.ts +1 -0
  159. package/build/utils/scenarioDrafting.d.ts +71 -0
  160. package/build/utils/scenarioDrafting.test.d.ts +1 -0
  161. package/build/utils/skyrampMdContent.d.ts +5 -0
  162. package/build/utils/sourceRouteExtractor.d.ts +48 -0
  163. package/build/utils/sourceRouteExtractor.test.d.ts +1 -0
  164. package/build/utils/telemetry.d.ts +32 -0
  165. package/build/utils/telemetry.test.d.ts +1 -0
  166. package/build/utils/trace-parser.d.ts +32 -0
  167. package/build/utils/trace-parser.test.d.ts +6 -0
  168. package/build/utils/uiPageEnumerator.d.ts +146 -0
  169. package/build/utils/uiPageEnumerator.js +58 -14
  170. package/build/utils/uiPageEnumerator.test.d.ts +1 -0
  171. package/build/utils/uiPageEnumerator.test.js +223 -43
  172. package/build/utils/utils.d.ts +39 -0
  173. package/build/utils/utils.test.d.ts +1 -0
  174. package/build/utils/versions.d.ts +3 -0
  175. package/build/utils/versions.js +1 -1
  176. package/build/utils/workspaceAuth.d.ts +127 -0
  177. package/build/utils/workspaceAuth.test.d.ts +1 -0
  178. package/build/utils/workspaceAuth.test.js +25 -25
  179. package/build/workspace/index.d.ts +1 -0
  180. package/build/workspace/workspace.d.ts +390 -0
  181. package/build/workspace/workspace.test.d.ts +1 -0
  182. package/package.json +8 -3
  183. package/build/tools/test-management/uiAnalyzeChangesTool.js +0 -155
  184. package/build/tools/test-management/uiAnalyzeChangesTool.test.js +0 -147
@@ -0,0 +1,96 @@
1
+ import { TestExecutionResult } from "./TestExecution.js";
2
+ export declare enum RecommendationPriority {
3
+ High = "high",
4
+ Medium = "medium",
5
+ Low = "low"
6
+ }
7
+ export declare enum IssueSeverity {
8
+ Low = "low",
9
+ Medium = "medium",
10
+ High = "high",
11
+ Critical = "critical"
12
+ }
13
+ export declare enum DriftChangeType {
14
+ EndpointAdded = "endpoint_added",
15
+ EndpointRemoved = "endpoint_removed",
16
+ EndpointRenamed = "endpoint_renamed",
17
+ EndpointModified = "endpoint_modified",
18
+ AuthenticationChanged = "authentication_changed",
19
+ SchemaChanges = "schema_changes",
20
+ RouteChanged = "route_changed",
21
+ RouteAdded = "route_added",
22
+ RouteRemoved = "route_removed",
23
+ UiComponentAdded = "ui_component_added",
24
+ UiComponentRemoved = "ui_component_removed",
25
+ UiComponentModified = "ui_component_modified",
26
+ UiComponentRestructured = "ui_component_restructured",
27
+ DependencyChanged = "dependency_changed",
28
+ FunctionChanged = "function_changed",
29
+ ClassChanged = "class_changed",
30
+ BreakingChange = "breaking_change",
31
+ CodeChange = "code_change"
32
+ }
33
+ export interface DriftChange {
34
+ type: DriftChangeType;
35
+ file: string;
36
+ description: string;
37
+ severity: IssueSeverity;
38
+ details?: string;
39
+ }
40
+ export interface AffectedFiles {
41
+ files: string[];
42
+ }
43
+ /** Origin of a test file — whether it was generated by Skyramp or is user/third-party maintained. */
44
+ export declare enum TestSource {
45
+ Skyramp = "skyramp",
46
+ External = "external"
47
+ }
48
+ /** Drift action assigned by the LLM health assessment for an existing test. */
49
+ export declare enum DriftAction {
50
+ Update = "UPDATE",
51
+ Regenerate = "REGENERATE",
52
+ Delete = "DELETE",
53
+ Verify = "VERIFY",
54
+ Ignore = "IGNORE"
55
+ }
56
+ /** Estimated effort to apply a drift UPDATE action. */
57
+ export declare enum EstimatedWork {
58
+ Small = "Small",
59
+ Medium = "Medium",
60
+ Large = "Large"
61
+ }
62
+ /** Normalized internal recommendation built from LLM-supplied args.recommendations. */
63
+ export interface DriftRecommendation {
64
+ testFile: string;
65
+ action: DriftAction;
66
+ priority: RecommendationPriority;
67
+ rationale: string;
68
+ estimatedWork: EstimatedWork;
69
+ updateInstructions: string;
70
+ renamedEndpoints: Array<{
71
+ oldPath: string;
72
+ newPath: string;
73
+ method: string;
74
+ }>;
75
+ /** Computed during instruction building — suggested renamed file path if applicable. */
76
+ _suggestedNewFile?: string;
77
+ }
78
+ /**
79
+ * Complete test analysis result that combines discovery, drift, execution, and health data
80
+ */
81
+ export interface TestAnalysisResult {
82
+ testFile: string;
83
+ testType: string;
84
+ language: string;
85
+ framework: string;
86
+ apiSchema?: string;
87
+ apiEndpoint?: string;
88
+ /** Origin of this test. Defaults to TestSource.Skyramp for backwards compatibility
89
+ * with existing state files. */
90
+ source?: TestSource;
91
+ drift?: {
92
+ changes: DriftChange[];
93
+ affectedFiles: AffectedFiles;
94
+ };
95
+ execution?: TestExecutionResult;
96
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Types for Test Execution
3
+ *
4
+ * These types define the structure for test execution results
5
+ */
6
+ export interface TestExecutionData {
7
+ passed: boolean;
8
+ executedAt: string;
9
+ duration: number;
10
+ errors: string[];
11
+ warnings: string[];
12
+ crashed: boolean;
13
+ output?: string;
14
+ exitCode?: number;
15
+ }
16
+ export interface TestExecutionResult extends TestExecutionData {
17
+ testFile: string;
18
+ }
19
+ export interface BatchExecutionResult {
20
+ totalTests: number;
21
+ passed: number;
22
+ failed: number;
23
+ crashed: number;
24
+ totalDuration: number;
25
+ results: TestExecutionResult[];
26
+ }
27
+ export interface TestExecutionOptions {
28
+ testFile: string;
29
+ workspacePath: string;
30
+ language: string;
31
+ testType: string;
32
+ token?: string;
33
+ timeout?: number;
34
+ playwrightSaveStoragePath?: string;
35
+ useHostNetwork?: boolean;
36
+ }
37
+ /**
38
+ * Progress callback for reporting execution status
39
+ */
40
+ export interface ExecutionProgress {
41
+ phase: "docker-check" | "docker-pull" | "preparing" | "executing" | "processing";
42
+ message: string;
43
+ percent: number;
44
+ details?: {
45
+ cached?: boolean;
46
+ pullProgress?: {
47
+ current?: number;
48
+ total?: number;
49
+ layer?: string;
50
+ };
51
+ };
52
+ }
53
+ export type ProgressCallback = (progress: ExecutionProgress) => Promise<void>;
@@ -0,0 +1,12 @@
1
+ /** Internal scenario-scoring tier — UPPERCASE, includes CRITICAL. */
2
+ export type PriorityTier = "CRITICAL" | "HIGH" | "MEDIUM" | "LOW";
3
+ /** All categories including internal ones. */
4
+ export declare const SCENARIO_CATEGORIES: readonly ["new_endpoint", "bug_caught", "business_rule", "security_boundary", "data_integrity", "breaking_change", "auth", "error_handling", "workflow", "data_validation", "crud"];
5
+ export type ScenarioCategory = typeof SCENARIO_CATEGORIES[number];
6
+ /** Categories valid for tool submissions (excludes internal-only categories). */
7
+ export declare const TEST_CATEGORIES: readonly ["business_rule", "security_boundary", "data_integrity", "breaking_change", "auth", "error_handling", "workflow", "data_validation", "crud"];
8
+ export type TestCategory = typeof TEST_CATEGORIES[number];
9
+ /** Priority assignment for each category. */
10
+ export declare const CATEGORY_PRIORITY: Record<ScenarioCategory, PriorityTier>;
11
+ /** Map internal-only categories to their external equivalent for tool submission. */
12
+ export declare function externalCategory(cat: ScenarioCategory): TestCategory;
@@ -0,0 +1,234 @@
1
+ import { z } from "zod";
2
+ export declare const SESSION_STORAGE_FILENAME = "skyramp_session_storage.json";
3
+ export declare const AUTH_PLACEHOLDER_TOKEN = "SKYRAMP_PLACEHOLDER_TOKEN";
4
+ export declare enum ProgrammingLanguage {
5
+ PYTHON = "python",
6
+ TYPESCRIPT = "typescript",
7
+ JAVASCRIPT = "javascript",
8
+ JAVA = "java"
9
+ }
10
+ export declare enum TestType {
11
+ SMOKE = "smoke",
12
+ FUZZ = "fuzz",
13
+ CONTRACT = "contract",
14
+ LOAD = "load",
15
+ INTEGRATION = "integration",
16
+ E2E = "e2e",
17
+ UI = "ui",
18
+ MOCK = "mock"
19
+ }
20
+ export declare enum HttpMethod {
21
+ GET = "GET",
22
+ POST = "POST",
23
+ PUT = "PUT",
24
+ DELETE = "DELETE",
25
+ PATCH = "PATCH",
26
+ HEAD = "HEAD",
27
+ OPTIONS = "OPTIONS"
28
+ }
29
+ export declare enum RuntimeEnvironment {
30
+ LOCAL = "local",
31
+ DOCKER = "docker",
32
+ KUBERNETES = "kubernetes"
33
+ }
34
+ export interface TestConfig {
35
+ testType: TestType;
36
+ toolName: string;
37
+ description: string;
38
+ additionalFields?: Record<string, z.ZodSchema>;
39
+ }
40
+ export declare const languageSchema: z.ZodObject<{
41
+ language: z.ZodNativeEnum<typeof ProgrammingLanguage>;
42
+ framework: z.ZodString;
43
+ }, "strip", z.ZodTypeAny, {
44
+ language: ProgrammingLanguage;
45
+ framework: string;
46
+ }, {
47
+ language: ProgrammingLanguage;
48
+ framework: string;
49
+ }>;
50
+ export declare const baseSchema: z.ZodObject<{
51
+ deployDashboard: z.ZodDefault<z.ZodBoolean>;
52
+ runtime: z.ZodDefault<z.ZodNativeEnum<typeof RuntimeEnvironment>>;
53
+ dockerNetwork: z.ZodDefault<z.ZodString>;
54
+ dockerWorkerPort: z.ZodDefault<z.ZodNumber>;
55
+ k8sNamespace: z.ZodDefault<z.ZodString>;
56
+ k8sConfig: z.ZodDefault<z.ZodString>;
57
+ k8sContext: z.ZodDefault<z.ZodString>;
58
+ authHeader: z.ZodDefault<z.ZodString>;
59
+ authScheme: z.ZodDefault<z.ZodString>;
60
+ insecure: z.ZodDefault<z.ZodBoolean>;
61
+ output: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
62
+ outputDir: z.ZodString;
63
+ force: z.ZodDefault<z.ZodBoolean>;
64
+ mockPort: z.ZodDefault<z.ZodNumber>;
65
+ optionalFields: z.ZodDefault<z.ZodBoolean>;
66
+ prompt: z.ZodString;
67
+ language: z.ZodNativeEnum<typeof ProgrammingLanguage>;
68
+ framework: z.ZodString;
69
+ }, "strip", z.ZodTypeAny, {
70
+ language: ProgrammingLanguage;
71
+ framework: string;
72
+ deployDashboard: boolean;
73
+ runtime: RuntimeEnvironment;
74
+ dockerNetwork: string;
75
+ dockerWorkerPort: number;
76
+ k8sNamespace: string;
77
+ k8sConfig: string;
78
+ k8sContext: string;
79
+ authHeader: string;
80
+ authScheme: string;
81
+ insecure: boolean;
82
+ outputDir: string;
83
+ force: boolean;
84
+ mockPort: number;
85
+ optionalFields: boolean;
86
+ prompt: string;
87
+ output?: string | undefined;
88
+ }, {
89
+ language: ProgrammingLanguage;
90
+ framework: string;
91
+ outputDir: string;
92
+ prompt: string;
93
+ deployDashboard?: boolean | undefined;
94
+ runtime?: RuntimeEnvironment | undefined;
95
+ dockerNetwork?: string | undefined;
96
+ dockerWorkerPort?: number | undefined;
97
+ k8sNamespace?: string | undefined;
98
+ k8sConfig?: string | undefined;
99
+ k8sContext?: string | undefined;
100
+ authHeader?: string | undefined;
101
+ authScheme?: string | undefined;
102
+ insecure?: boolean | undefined;
103
+ output?: string | undefined;
104
+ force?: boolean | undefined;
105
+ mockPort?: number | undefined;
106
+ optionalFields?: boolean | undefined;
107
+ }>;
108
+ export declare const basePlaywrightSchema: z.ZodObject<{
109
+ playwrightInput: z.ZodString;
110
+ playwrightStoragePath: z.ZodOptional<z.ZodString>;
111
+ playwrightSaveStoragePath: z.ZodOptional<z.ZodString>;
112
+ playwrightViewportSize: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["", "hd", "full-hd", "2k"]>, z.ZodString]>>;
113
+ browser: z.ZodDefault<z.ZodEnum<["chromium", "firefox", "webkit"]>>;
114
+ device: z.ZodDefault<z.ZodString>;
115
+ }, "strip", z.ZodTypeAny, {
116
+ playwrightInput: string;
117
+ playwrightViewportSize: string;
118
+ browser: "chromium" | "firefox" | "webkit";
119
+ device: string;
120
+ playwrightStoragePath?: string | undefined;
121
+ playwrightSaveStoragePath?: string | undefined;
122
+ }, {
123
+ playwrightInput: string;
124
+ playwrightStoragePath?: string | undefined;
125
+ playwrightSaveStoragePath?: string | undefined;
126
+ playwrightViewportSize?: string | undefined;
127
+ browser?: "chromium" | "firefox" | "webkit" | undefined;
128
+ device?: string | undefined;
129
+ }>;
130
+ export declare const baseTraceSchema: z.ZodObject<{
131
+ deployDashboard: z.ZodDefault<z.ZodBoolean>;
132
+ runtime: z.ZodDefault<z.ZodNativeEnum<typeof RuntimeEnvironment>>;
133
+ dockerNetwork: z.ZodDefault<z.ZodString>;
134
+ dockerWorkerPort: z.ZodDefault<z.ZodNumber>;
135
+ k8sNamespace: z.ZodDefault<z.ZodString>;
136
+ k8sConfig: z.ZodDefault<z.ZodString>;
137
+ k8sContext: z.ZodDefault<z.ZodString>;
138
+ authHeader: z.ZodDefault<z.ZodString>;
139
+ authScheme: z.ZodDefault<z.ZodString>;
140
+ insecure: z.ZodDefault<z.ZodBoolean>;
141
+ output: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
142
+ outputDir: z.ZodString;
143
+ force: z.ZodDefault<z.ZodBoolean>;
144
+ mockPort: z.ZodDefault<z.ZodNumber>;
145
+ optionalFields: z.ZodDefault<z.ZodBoolean>;
146
+ prompt: z.ZodString;
147
+ language: z.ZodNativeEnum<typeof ProgrammingLanguage>;
148
+ framework: z.ZodString;
149
+ trace: z.ZodString;
150
+ include: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
151
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
152
+ }, "strip", z.ZodTypeAny, {
153
+ language: ProgrammingLanguage;
154
+ framework: string;
155
+ deployDashboard: boolean;
156
+ runtime: RuntimeEnvironment;
157
+ dockerNetwork: string;
158
+ dockerWorkerPort: number;
159
+ k8sNamespace: string;
160
+ k8sConfig: string;
161
+ k8sContext: string;
162
+ authHeader: string;
163
+ authScheme: string;
164
+ insecure: boolean;
165
+ outputDir: string;
166
+ force: boolean;
167
+ mockPort: number;
168
+ optionalFields: boolean;
169
+ prompt: string;
170
+ trace: string;
171
+ include: string[];
172
+ exclude: string[];
173
+ output?: string | undefined;
174
+ }, {
175
+ language: ProgrammingLanguage;
176
+ framework: string;
177
+ outputDir: string;
178
+ prompt: string;
179
+ trace: string;
180
+ deployDashboard?: boolean | undefined;
181
+ runtime?: RuntimeEnvironment | undefined;
182
+ dockerNetwork?: string | undefined;
183
+ dockerWorkerPort?: number | undefined;
184
+ k8sNamespace?: string | undefined;
185
+ k8sConfig?: string | undefined;
186
+ k8sContext?: string | undefined;
187
+ authHeader?: string | undefined;
188
+ authScheme?: string | undefined;
189
+ insecure?: boolean | undefined;
190
+ output?: string | undefined;
191
+ force?: boolean | undefined;
192
+ mockPort?: number | undefined;
193
+ optionalFields?: boolean | undefined;
194
+ include?: string[] | undefined;
195
+ exclude?: string[] | undefined;
196
+ }>;
197
+ export declare const baseTestSchema: {
198
+ deployDashboard: z.ZodDefault<z.ZodBoolean>;
199
+ runtime: z.ZodDefault<z.ZodNativeEnum<typeof RuntimeEnvironment>>;
200
+ dockerNetwork: z.ZodDefault<z.ZodString>;
201
+ dockerWorkerPort: z.ZodDefault<z.ZodNumber>;
202
+ k8sNamespace: z.ZodDefault<z.ZodString>;
203
+ k8sConfig: z.ZodDefault<z.ZodString>;
204
+ k8sContext: z.ZodDefault<z.ZodString>;
205
+ authHeader: z.ZodDefault<z.ZodString>;
206
+ authScheme: z.ZodDefault<z.ZodString>;
207
+ insecure: z.ZodDefault<z.ZodBoolean>;
208
+ output: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
209
+ outputDir: z.ZodString;
210
+ force: z.ZodDefault<z.ZodBoolean>;
211
+ mockPort: z.ZodDefault<z.ZodNumber>;
212
+ optionalFields: z.ZodDefault<z.ZodBoolean>;
213
+ prompt: z.ZodString;
214
+ language: z.ZodNativeEnum<typeof ProgrammingLanguage>;
215
+ framework: z.ZodString;
216
+ endpointURL: z.ZodString;
217
+ method: z.ZodDefault<z.ZodUnion<[z.ZodNativeEnum<typeof HttpMethod>, z.ZodLiteral<"">]>>;
218
+ apiSchema: z.ZodDefault<z.ZodString>;
219
+ pathParams: z.ZodDefault<z.ZodString>;
220
+ queryParams: z.ZodDefault<z.ZodString>;
221
+ formParams: z.ZodDefault<z.ZodString>;
222
+ requestData: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
223
+ responseStatusCode: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
224
+ };
225
+ export declare const codeRefactoringSchema: z.ZodObject<{
226
+ codeReuse: z.ZodDefault<z.ZodBoolean>;
227
+ modularizeCode: z.ZodDefault<z.ZodBoolean>;
228
+ }, "strip", z.ZodTypeAny, {
229
+ codeReuse: boolean;
230
+ modularizeCode: boolean;
231
+ }, {
232
+ codeReuse?: boolean | undefined;
233
+ modularizeCode?: boolean | undefined;
234
+ }>;
@@ -0,0 +1,182 @@
1
+ import { TestAnalysisResult } from "../types/TestAnalysis.js";
2
+ import { RepositoryAnalysis, AnalysisScope } from "../types/RepositoryAnalysis.js";
3
+ import { PRTestContext } from "./pr-comment-parser.js";
4
+ import { ParsedDiffEndpoint } from "./routeParsers.js";
5
+ import type { CandidateUiPage } from "./uiPageEnumerator.js";
6
+ export type { CandidateUiPage } from "./uiPageEnumerator.js";
7
+ export declare function setTestsRepoDir(dir: string | undefined): void;
8
+ export declare function getTestsRepoDir(): string | undefined;
9
+ export declare function registerSession(sessionId: string, stateFilePath: string): void;
10
+ export declare function getSessionFilePath(sessionId: string): string | undefined;
11
+ export declare function getRegisteredSessions(): ReadonlyMap<string, string>;
12
+ export declare function storeSessionData(sessionId: string, data: any): void;
13
+ export declare function getSessionData(sessionId: string): any | undefined;
14
+ export declare function hasSessionData(sessionId: string): boolean;
15
+ /**
16
+ * Normalize a loaded RecommendationState: if the LLM saved a raw
17
+ * RepositoryAnalysis at the root (without the wrapper), detect it
18
+ * and wrap it properly.
19
+ */
20
+ export declare function normalizeRecommendationState(data: RecommendationState): RecommendationState;
21
+ /**
22
+ * State types supported by the manager
23
+ */
24
+ export type StateType = "analysis" | "recommendation";
25
+ /**
26
+ * State data for test maintenance workflow (discovery, drift, execution, health)
27
+ */
28
+ export interface TestAnalysisState {
29
+ tests: TestAnalysisResult[];
30
+ }
31
+ /**
32
+ * State data for test recommendation workflow (analyze repo, recommend tests)
33
+ */
34
+ export interface RecommendationState {
35
+ repositoryPath: string;
36
+ analysisScope?: AnalysisScope;
37
+ analysis: RepositoryAnalysis;
38
+ prContext?: PRTestContext;
39
+ }
40
+ /**
41
+ * Map of test type → numeric score (e.g., priority, relevance, confidence).
42
+ */
43
+ type TestTypeScores = Record<string, number>;
44
+ /**
45
+ * Map of test type → grouping/label information used by downstream tools.
46
+ */
47
+ type TestTypeMapping = Record<string, string | string[]>;
48
+ /**
49
+ * UI-specific analysis context populated when the diff contains frontend files.
50
+ *
51
+ * Computed deterministically by `skyramp_analyze_changes` (via `isFrontendFile`
52
+ * in scopeAssessment.ts). Persisted so downstream consumers —
53
+ * `skyramp_analyze_test_health`'s UI drift detection, recommendation prompt
54
+ * rendering, etc. — don't have to re-derive the classification.
55
+ *
56
+ * Absent on backend-only PRs (no frontend files in the diff).
57
+ */
58
+ export interface UiAnalysisContext {
59
+ /**
60
+ * Subset of `repositoryAnalysis.diff.changedFiles` that classified as
61
+ * frontend by `isFrontendFile()`. Empty when no frontend files changed —
62
+ * callers can derive `hasFrontendChanges` from `changedFrontendFiles.length > 0`.
63
+ */
64
+ changedFrontendFiles: string[];
65
+ /**
66
+ * Candidate pages the testbot agent should capture blueprints for, enumerated
67
+ * by the strategy ladder in `uiPageEnumerator.ts` (framework route grep,
68
+ * source-grounded routes, root fallback). Each entry carries the candidate
69
+ * URL plus the strategy + source files that surfaced it. May be empty when
70
+ * the workspace has no resolvable frontend baseUrl — caller should fall back
71
+ * to the agent's prose-driven enumeration.
72
+ */
73
+ candidateUiPages: CandidateUiPage[];
74
+ }
75
+ /**
76
+ * Unified state data combining test discovery + endpoint scanning
77
+ * Used by the unified test-management workflow
78
+ */
79
+ export interface UnifiedAnalysisState {
80
+ existingTests: TestAnalysisResult[];
81
+ repositoryAnalysis?: any;
82
+ testTypeScores?: TestTypeScores;
83
+ testTypeMapping?: TestTypeMapping;
84
+ analysisScope: AnalysisScope;
85
+ newEndpoints: ParsedDiffEndpoint[];
86
+ /**
87
+ * UI-specific state populated when the diff contains frontend files.
88
+ * Absent on backend-only PRs.
89
+ */
90
+ uiContext?: UiAnalysisContext;
91
+ }
92
+ /**
93
+ * State file metadata
94
+ */
95
+ interface StateMetadata {
96
+ sessionId: string;
97
+ stateType: StateType;
98
+ repositoryPath?: string;
99
+ createdAt: string;
100
+ updatedAt: string;
101
+ step?: string;
102
+ }
103
+ /**
104
+ * State file format - data fields at root level with metadata
105
+ * Example: { tests: [...], metadata: {...} }
106
+ * Example: { repositoryPath: "...", analysis: {...}, mapping: {...}, metadata: {...} }
107
+ */
108
+ type StateFile<T> = T & {
109
+ metadata: StateMetadata;
110
+ };
111
+ /**
112
+ * Generic State Manager for persisting workflow data
113
+ * Reduces token usage by storing intermediate results in filesystem
114
+ *
115
+ * Supports two state types:
116
+ * - analysis: Test maintenance workflow (discovery, drift, execution, health)
117
+ * - recommendation: Test recommendation workflow (analyze repo, map tests, recommendations)
118
+ */
119
+ export declare class StateManager<T = any> {
120
+ private stateFile;
121
+ private sessionId;
122
+ private stateType;
123
+ /**
124
+ * Create a new state manager
125
+ * @param stateType Type of state (analysis, recommendation)
126
+ * @param sessionId Unique session identifier (defaults to UUID)
127
+ * @param stateDir Directory to store state files (defaults to /tmp)
128
+ */
129
+ constructor(stateType?: StateType, sessionId?: string, stateDir?: string, stateFilePath?: string);
130
+ /**
131
+ * Create state manager from a sessionId (resolves the state file path internally)
132
+ */
133
+ static fromSessionId<T = any>(sessionId: string, stateType?: StateType, stateDir?: string): StateManager<T>;
134
+ /**
135
+ * Create state manager from existing state file path
136
+ */
137
+ static fromStatePath<T = any>(stateFilePath: string): StateManager<T>;
138
+ /**
139
+ * Read data from state file (excludes metadata)
140
+ */
141
+ readData(): Promise<T | null>;
142
+ /**
143
+ * Read full state including metadata
144
+ */
145
+ readFullState(): Promise<StateFile<T> | null>;
146
+ /**
147
+ * Write data to state file
148
+ * Data fields are spread at root level alongside metadata
149
+ */
150
+ writeData(data: T, options?: {
151
+ repositoryPath?: string;
152
+ step?: string;
153
+ }): Promise<void>;
154
+ getStatePath(): string;
155
+ getSessionId(): string;
156
+ getStateType(): StateType;
157
+ exists(): boolean;
158
+ delete(): Promise<void>;
159
+ getSize(): Promise<number>;
160
+ getSizeFormatted(): Promise<string>;
161
+ /**
162
+ * Cleanup old state files
163
+ * @param maxAgeHours Maximum age in hours
164
+ * @param stateDir Directory to clean (defaults to /tmp)
165
+ * @param stateTypes Which state types to clean (defaults to all)
166
+ * @returns Number of files deleted
167
+ */
168
+ static cleanupOldFiles(maxAgeHours?: number, stateDir?: string, stateTypes?: StateType[]): Promise<number>;
169
+ /**
170
+ * List all state files in directory
171
+ * @param stateDir Directory to search (defaults to /tmp)
172
+ * @param stateTypes Which state types to list (defaults to all)
173
+ */
174
+ static listStateFiles(stateDir?: string, stateTypes?: StateType[]): Promise<Array<{
175
+ sessionId: string;
176
+ stateType: StateType;
177
+ path: string;
178
+ size: number;
179
+ createdAt: Date;
180
+ modifiedAt: Date;
181
+ }>>;
182
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare function analyzeOpenAPIWithGivenEndpoint(apiSchemaInput: string, uriInput: string, pathParamsInput: string): Promise<string | null>;
@@ -0,0 +1,18 @@
1
+ export interface BranchDiffData {
2
+ currentBranch: string;
3
+ baseBranch: string;
4
+ changedFiles: string[];
5
+ /** Full unified diff content. */
6
+ diffContent: string;
7
+ diffStat: string;
8
+ /** Files newly created in this branch (--- /dev/null in diff header). Relative paths. */
9
+ newFiles: string[];
10
+ /** Files deleted in this branch (+++ /dev/null in diff header). Relative paths. */
11
+ deletedFiles: string[];
12
+ }
13
+ /**
14
+ * Extract every file path mentioned in a unified-diff `diff --git` header.
15
+ * Always uses the `b/` form so renames return the new path.
16
+ */
17
+ export declare function parseChangedFilesFromDiff(rawDiff: string): string[];
18
+ export declare function computeBranchDiff(repositoryPath: string, providedBaseBranch?: string): Promise<BranchDiffData>;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Dart route extraction for Flutter apps using the `go_router` package.
3
+ *
4
+ * Walks the repo's Dart sources looking for GoRoute declarations with
5
+ * string-literal `path:` arguments:
6
+ *
7
+ * GoRoute(path: '/login', builder: (ctx, st) => LoginScreen())
8
+ * GoRoute(path: "/profile/:id", builder: ...)
9
+ *
10
+ * Why regex (not a Dart compiler): Dart parsers (analyzer, dart-analyzer
11
+ * package) require a Dart SDK install. Regex on the GoRoute string-literal-path
12
+ * subset gives ~95% coverage of real customer apps with zero install cost.
13
+ * Constants like `path: _kHome` are deliberately skipped — emitting them
14
+ * as a URL `_kHome` would mislead the agent worse than dropping them.
15
+ *
16
+ * Each route also carries metadata to support diff-matching in the caller
17
+ * (findCandidatePagesByDartRoute):
18
+ *
19
+ * - `screenWidgets`: identifiers referenced as builder/pageBuilder targets,
20
+ * e.g. `AuthorsScreen`. Resolved through the file's imports to absolute
21
+ * paths in `screenFiles`.
22
+ * - `screenFiles`: the imported source files those identifiers come from.
23
+ * - `isRedirectOnly`: true if the GoRoute has `redirect:` but no
24
+ * `builder:` or `pageBuilder:` — these don't render UI, just redirect.
25
+ *
26
+ * Scope choices for slice 1:
27
+ * - GoRouter only (`MaterialApp.routes` and `auto_route` deferred)
28
+ * - String-literal `path:` only (no constant resolution)
29
+ * - Nested GoRoutes emit each declaration verbatim — the absolute parent
30
+ * plus relative children. Caller may compose them later.
31
+ */
32
+ /** A route declaration discovered in Dart source. */
33
+ export interface DartRoute {
34
+ /** URL path string from the GoRoute(path: ...) declaration (verbatim). */
35
+ path: string;
36
+ /** Dart file the declaration was found in (absolute path). */
37
+ declaredIn: string;
38
+ /** Widget identifiers referenced from builder:/pageBuilder: (e.g. `AuthorsScreen`). */
39
+ screenWidgets: string[];
40
+ /** Resolved absolute paths for screenWidgets via the file's imports. */
41
+ screenFiles: string[];
42
+ /** True when GoRoute has `redirect:` but no `builder:`/`pageBuilder:` — no UI. */
43
+ isRedirectOnly: boolean;
44
+ }
45
+ export declare function extractDartRoutes(repositoryPath: string): DartRoute[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Pull a Docker image by name.
3
+ *
4
+ * When `dockerPlatform` is provided, pulls with that exact platform — no
5
+ * fallback logic runs. Use this for images whose platform is known ahead
6
+ * of time (e.g. executor is amd64-only).
7
+ *
8
+ * When `dockerPlatform` is omitted, uses the host architecture and falls
9
+ * back to linux/amd64 if the arm64 pull fails or the image doesn't land
10
+ * locally (Docker Desktop quirk on Apple Silicon).
11
+ */
12
+ export declare function pullDockerImage(imageName: string, dockerPlatform?: string): Promise<void>;
13
+ /**
14
+ * Check if a Docker image exists locally for the given reference (repo:tag or digest).
15
+ * Uses image inspect (daemon name resolution), not listImages tag scanning.
16
+ * Returns true if found, false if the image is not present (404).
17
+ * Throws for any other error (e.g. Docker daemon unreachable) so callers can skip pulling.
18
+ */
19
+ export declare function dockerImageExistsLocally(imageName: string): Promise<boolean>;
@@ -0,0 +1 @@
1
+ export {};