@skyramp/mcp 0.2.6 → 0.2.150-rc.mntnc
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.
- package/build/commands/commandLibrary.d.ts +12 -0
- package/build/commands/recommendTestsAndExecuteCommand.d.ts +2 -0
- package/build/commands/testThisEndpointCommand.d.ts +2 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +6 -4
- package/build/playwright/PlaywrightTraceService.d.ts +32 -0
- package/build/playwright/index.d.ts +3 -0
- package/build/playwright/registerPlaywrightTools.d.ts +8 -0
- package/build/playwright/registerPlaywrightTools.js +12 -11
- package/build/playwright/traceRecordingPrompt.d.ts +13 -0
- package/build/playwright/traceRecordingPrompt.js +3 -11
- package/build/prompts/code-reuse.d.ts +1 -0
- package/build/prompts/enhance-assertions/contractProviderAssertionsPrompt.d.ts +2 -0
- package/build/prompts/enhance-assertions/integrationAssertionsPrompt.d.ts +2 -0
- package/build/prompts/enhance-assertions/sharedAssertionRules.d.ts +15 -0
- package/build/prompts/enhance-assertions/uiAssertionsPrompt.d.ts +2 -0
- package/build/prompts/enhance-assertions/uiAssertionsPrompt.js +24 -5
- package/build/prompts/fix-error-prompt.d.ts +1 -0
- package/build/prompts/initialize-workspace/initializeWorkspacePrompt.d.ts +1 -0
- package/build/prompts/modularization/integration-test-modularization.d.ts +1 -0
- package/build/prompts/modularization/ui-test-modularization.d.ts +1 -0
- package/build/prompts/personas.d.ts +21 -0
- package/build/prompts/pom-aware-code-reuse.d.ts +1 -0
- package/build/prompts/startTraceCollectionPrompts.d.ts +2 -0
- package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.d.ts +2 -0
- package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.js +114 -0
- package/build/prompts/sut-setup/modes/dockerComposePrompt.d.ts +2 -0
- package/build/prompts/sut-setup/modes/dockerComposePrompt.js +292 -0
- package/build/prompts/sut-setup/shared.d.ts +39 -0
- package/build/prompts/sut-setup/shared.js +132 -0
- package/build/prompts/test-maintenance/actionsInstructions.d.ts +35 -0
- package/build/prompts/test-maintenance/drift-analysis-prompt.d.ts +4 -0
- package/build/prompts/test-maintenance/driftAnalysisSections.d.ts +13 -0
- package/build/prompts/test-maintenance/driftAnalysisSections.js +9 -3
- package/build/prompts/test-recommendation/analysisOutputPrompt.d.ts +84 -0
- package/build/prompts/test-recommendation/analysisOutputPrompt.js +1 -1
- package/build/prompts/test-recommendation/analysisOutputPrompt.test.d.ts +1 -0
- package/build/prompts/test-recommendation/analysisOutputPrompt.test.js +1 -0
- package/build/prompts/test-recommendation/diffExecutionPlan.d.ts +17 -0
- package/build/prompts/test-recommendation/diffExecutionPlan.js +7 -16
- package/build/prompts/test-recommendation/fullRepoCatalog.d.ts +7 -0
- package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.d.ts +1 -0
- package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.js +1 -0
- package/build/prompts/test-recommendation/promptPlan.d.ts +203 -0
- package/build/prompts/test-recommendation/promptPlan.test.d.ts +1 -0
- package/build/prompts/test-recommendation/recommendationSections.d.ts +35 -0
- package/build/prompts/test-recommendation/recommendationShared.d.ts +31 -0
- package/build/prompts/test-recommendation/registerRecommendTestsPrompt.d.ts +7 -0
- package/build/prompts/test-recommendation/scopeAssessment.d.ts +55 -0
- package/build/prompts/test-recommendation/scopeAssessment.js +2 -2
- package/build/prompts/test-recommendation/scopeAssessment.test.d.ts +1 -0
- package/build/prompts/test-recommendation/scopeAssessment.test.js +1 -0
- package/build/prompts/test-recommendation/test-recommendation-prompt.d.ts +6 -0
- package/build/prompts/test-recommendation/test-recommendation-prompt.js +4 -4
- package/build/prompts/test-recommendation/test-recommendation-prompt.test.d.ts +1 -0
- package/build/prompts/test-recommendation/test-recommendation-prompt.test.js +6 -99
- package/build/prompts/testbot/testbot-prompts.d.ts +11 -0
- package/build/prompts/testbot/testbot-prompts.js +213 -42
- package/build/prompts/testbot/testbot-prompts.test.d.ts +1 -0
- package/build/prompts/testbot/testbot-prompts.test.js +15 -117
- package/build/resources/analysisResources.d.ts +17 -0
- package/build/resources/progressResource.d.ts +2 -0
- package/build/resources/sutSetupResource.d.ts +2 -0
- package/build/resources/sutSetupResource.js +45 -0
- package/build/resources/testbotResource.d.ts +2 -0
- package/build/resources/testbotResource.js +1 -1
- package/build/services/AnalyticsService.d.ts +13 -0
- package/build/services/AnalyticsService.test.d.ts +1 -0
- package/build/services/AnalyticsService.test.js +86 -0
- package/build/services/ModularizationService.d.ts +11 -0
- package/build/services/ScenarioGenerationService.d.ts +37 -0
- package/build/services/ScenarioGenerationService.integration.test.d.ts +1 -0
- package/build/services/ScenarioGenerationService.integration.test.js +4 -0
- package/build/services/ScenarioGenerationService.test.d.ts +1 -0
- package/build/services/TestDiscoveryService.d.ts +128 -0
- package/build/services/TestDiscoveryService.js +22 -12
- package/build/services/TestDiscoveryService.test.d.ts +1 -0
- package/build/services/TestDiscoveryService.test.js +4 -3
- package/build/services/TestExecutionService.d.ts +55 -0
- package/build/services/TestExecutionService.js +158 -26
- package/build/services/TestExecutionService.test.d.ts +1 -0
- package/build/services/TestExecutionService.test.js +339 -25
- package/build/services/TestGenerationService.d.ts +56 -0
- package/build/services/TestGenerationService.test.d.ts +1 -0
- package/build/services/TestGenerationService.test.js +10 -8
- package/build/services/containerEnv.d.ts +14 -0
- package/build/tool-phase-coverage.test.d.ts +1 -0
- package/build/tool-phase-coverage.test.js +2 -0
- package/build/tool-phases.d.ts +38 -0
- package/build/tools/auth/loginTool.d.ts +2 -0
- package/build/tools/auth/logoutTool.d.ts +2 -0
- package/build/tools/code-refactor/codeReuseTool.d.ts +2 -0
- package/build/tools/code-refactor/enhanceAssertionsTool.d.ts +2 -0
- package/build/tools/code-refactor/modularizationTool.d.ts +2 -0
- package/build/tools/executeSkyrampTestTool.d.ts +2 -0
- package/build/tools/executeSkyrampTestTool.js +17 -4
- package/build/tools/fixErrorTool.d.ts +2 -0
- package/build/tools/generate-tests/generateBatchScenarioRestTool.d.ts +45 -0
- package/build/tools/generate-tests/generateBatchScenarioRestTool.js +1 -1
- package/build/tools/generate-tests/generateBatchScenarioRestTool.test.d.ts +1 -0
- package/build/tools/generate-tests/generateBatchScenarioRestTool.test.js +11 -9
- package/build/tools/generate-tests/generateContractRestTool.d.ts +31 -0
- package/build/tools/generate-tests/generateE2ERestTool.d.ts +13 -0
- package/build/tools/generate-tests/generateFuzzRestTool.d.ts +10 -0
- package/build/tools/generate-tests/generateIntegrationRestTool.d.ts +16 -0
- package/build/tools/generate-tests/generateLoadRestTool.d.ts +18 -0
- package/build/tools/generate-tests/generateLoadRestTool.test.d.ts +1 -0
- package/build/tools/generate-tests/generateMockRestTool.d.ts +64 -0
- package/build/tools/generate-tests/generateSmokeRestTool.d.ts +8 -0
- package/build/tools/generate-tests/generateUIRestTool.d.ts +14 -0
- package/build/tools/generate-tests/generateUIRestTool.js +1 -1
- package/build/tools/generate-tests/loadTestSchema.d.ts +39 -0
- package/build/tools/one-click/oneClickTool.d.ts +11 -0
- package/build/tools/submitReportTool.d.ts +384 -0
- package/build/tools/submitReportTool.js +225 -37
- package/build/tools/submitReportTool.test.d.ts +1 -0
- package/build/tools/submitReportTool.test.js +479 -55
- package/build/tools/test-management/actionsTool.d.ts +10 -0
- package/build/tools/test-management/actionsTool.js +10 -0
- package/build/tools/test-management/analyzeChangesTool.d.ts +26 -0
- package/build/tools/test-management/analyzeChangesTool.js +128 -48
- package/build/tools/test-management/analyzeChangesTool.test.d.ts +1 -0
- package/build/tools/test-management/analyzeChangesTool.test.js +80 -73
- package/build/tools/test-management/analyzeTestHealthTool.d.ts +2 -0
- package/build/tools/test-management/analyzeTestHealthTool.js +6 -3
- package/build/tools/test-management/index.d.ts +3 -0
- package/build/tools/test-management/index.js +0 -1
- package/build/tools/trace/resolveSaveStoragePath.d.ts +7 -0
- package/build/tools/trace/resolveSaveStoragePath.test.d.ts +1 -0
- package/build/tools/trace/resolveSessionPaths.d.ts +40 -0
- package/build/tools/trace/resolveSessionPaths.test.d.ts +1 -0
- package/build/tools/trace/sessionState.d.ts +2 -0
- package/build/tools/trace/sessionState.test.d.ts +1 -0
- package/build/tools/trace/startTraceCollectionTool.d.ts +2 -0
- package/build/tools/trace/stopTraceCollectionTool.d.ts +2 -0
- package/build/tools/workspace/initScanWorkspaceTool.d.ts +4 -0
- package/build/tools/workspace/initializeWorkspaceTool.d.ts +2 -0
- package/build/tools/workspace/initializeWorkspaceTool.test.d.ts +1 -0
- package/build/tools/workspace/initializeWorkspaceTool.test.js +134 -0
- package/build/types/OneClickCommands.d.ts +68 -0
- package/build/types/RepositoryAnalysis.d.ts +3004 -0
- package/build/types/TestAnalysis.d.ts +97 -0
- package/build/types/TestExecution.d.ts +63 -0
- package/build/types/TestExecution.js +11 -1
- package/build/types/TestRecommendation.d.ts +12 -0
- package/build/types/TestTypes.d.ts +234 -0
- package/build/types/TestbotReport.d.ts +68 -0
- package/build/types/TestbotReport.js +1 -0
- package/build/types/index.d.ts +4 -0
- package/build/types/index.js +3 -0
- package/build/utils/AnalysisStateManager.d.ts +182 -0
- package/build/utils/AnalysisStateManager.js +10 -1
- package/build/utils/AnalysisStateManager.test.d.ts +1 -0
- package/build/utils/analyze-openapi.d.ts +1 -0
- package/build/utils/branchDiff.d.ts +18 -0
- package/build/utils/dartRouteExtractor.d.ts +45 -0
- package/build/utils/dartRouteExtractor.test.d.ts +1 -0
- package/build/utils/docker.d.ts +19 -0
- package/build/utils/docker.test.d.ts +1 -0
- package/build/utils/docker.test.js +10 -9
- package/build/utils/featureFlags.d.ts +37 -0
- package/build/utils/featureFlags.test.d.ts +1 -0
- package/build/utils/gitStaging.d.ts +24 -0
- package/build/utils/gitStaging.test.d.ts +1 -0
- package/build/utils/gitStaging.test.js +13 -7
- package/build/utils/httpDefaults.d.ts +10 -0
- package/build/utils/httpDefaults.test.d.ts +1 -0
- package/build/utils/initAgent.d.ts +36 -0
- package/build/utils/language-helper.d.ts +6 -0
- package/build/utils/logger.d.ts +11 -0
- package/build/utils/normalizeParams.d.ts +14 -0
- package/build/utils/normalizeSkyrampImports.d.ts +13 -0
- package/build/utils/pr-comment-parser.d.ts +31 -0
- package/build/utils/pr-comment-parser.test.d.ts +1 -0
- package/build/utils/pr-comment-parser.test.js +6 -5
- package/build/utils/projectMetadata.d.ts +15 -0
- package/build/utils/projectMetadata.test.d.ts +1 -0
- package/build/utils/proxy-terminal.d.ts +2 -0
- package/build/utils/repoScanner.d.ts +27 -0
- package/build/utils/repoScanner.test.d.ts +1 -0
- package/build/utils/routeParsers.d.ts +53 -0
- package/build/utils/routeParsers.js +31 -38
- package/build/utils/routeParsers.test.d.ts +1 -0
- package/build/utils/scenarioDrafting.d.ts +71 -0
- package/build/utils/scenarioDrafting.js +23 -1
- package/build/utils/scenarioDrafting.test.d.ts +1 -0
- package/build/utils/skyrampMdContent.d.ts +5 -0
- package/build/utils/sourceRouteExtractor.d.ts +48 -0
- package/build/utils/sourceRouteExtractor.test.d.ts +1 -0
- package/build/utils/telemetry.d.ts +32 -0
- package/build/utils/telemetry.test.d.ts +1 -0
- package/build/utils/trace-parser.d.ts +32 -0
- package/build/utils/trace-parser.test.d.ts +6 -0
- package/build/utils/uiPageEnumerator.d.ts +146 -0
- package/build/utils/uiPageEnumerator.js +58 -14
- package/build/utils/uiPageEnumerator.test.d.ts +1 -0
- package/build/utils/uiPageEnumerator.test.js +223 -43
- package/build/utils/utils.d.ts +45 -0
- package/build/utils/utils.js +10 -0
- package/build/utils/utils.test.d.ts +1 -0
- package/build/utils/versions.d.ts +3 -0
- package/build/utils/versions.js +1 -1
- package/build/utils/workspaceAuth.d.ts +127 -0
- package/build/utils/workspaceAuth.test.d.ts +1 -0
- package/build/utils/workspaceAuth.test.js +25 -25
- package/build/workspace/index.d.ts +1 -0
- package/build/workspace/workspace.d.ts +390 -0
- package/build/workspace/workspace.test.d.ts +1 -0
- package/node_modules/playwright/LICENSE +202 -0
- package/node_modules/playwright/NOTICE +5 -0
- package/node_modules/playwright/README.md +168 -0
- package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +13 -9
- package/node_modules/playwright/lib/mcp/test/skyRampExport.js +4 -3
- package/node_modules/playwright/node_modules/playwright-core/LICENSE +202 -0
- package/node_modules/playwright/node_modules/playwright-core/NOTICE +5 -0
- package/node_modules/playwright/node_modules/playwright-core/ThirdPartyNotices.txt +23 -126
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/assets/{codeMirrorModule-B0JOjboO.js → codeMirrorModule-B5kqh2EV.js} +1 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/assets/{defaultSettingsView-1anWeyDf.js → defaultSettingsView-CZ9npQ3N.js} +79 -79
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/{index.Cc5029a3.js → index.BCnxj-_b.js} +1 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/index.html +2 -2
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/{uiMode.Wo5yvvVh.js → uiMode.1Ym0Ivn8.js} +1 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +2 -2
- package/node_modules/playwright/node_modules/playwright-core/package.json +1 -1
- package/node_modules/playwright/package.json +1 -1
- package/package.json +16 -4
- package/build/tools/test-management/uiAnalyzeChangesTool.js +0 -155
- package/build/tools/test-management/uiAnalyzeChangesTool.test.js +0 -147
- package/node_modules/playwright/node_modules/playwright-core/.DS_Store +0 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/.bin/node-which +0 -52
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/.bin/is-docker +0 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/.bin/mime +0 -46
- package/node_modules/playwright/node_modules/playwright-core/bundles/utils/node_modules/.bin/yaml +0 -11
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/index.CP3Y8Zsb.js +0 -2
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
executionBefore?: TestExecutionResult;
|
|
96
|
+
executionAfter?: TestExecutionResult;
|
|
97
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for Test Execution
|
|
3
|
+
*
|
|
4
|
+
* These types define the structure for test execution results
|
|
5
|
+
*/
|
|
6
|
+
/** Execution outcome for a test run recorded in the maintenance report. */
|
|
7
|
+
export declare enum TestExecutionStatus {
|
|
8
|
+
Pass = "Pass",
|
|
9
|
+
Fail = "Fail",
|
|
10
|
+
Error = "Error",
|
|
11
|
+
/** Deliberately not executed — VERIFY/IGNORE actions or DELETE (file removed). */
|
|
12
|
+
Skipped = "Skipped",
|
|
13
|
+
/** Execution was expected (UPDATE/REGENERATE) but no result was recorded. */
|
|
14
|
+
Unknown = "Unknown"
|
|
15
|
+
}
|
|
16
|
+
export interface TestExecutionData {
|
|
17
|
+
status: TestExecutionStatus;
|
|
18
|
+
executedAt: string;
|
|
19
|
+
duration: number;
|
|
20
|
+
errors: string[];
|
|
21
|
+
warnings: string[];
|
|
22
|
+
output?: string;
|
|
23
|
+
exitCode?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface TestExecutionResult extends TestExecutionData {
|
|
26
|
+
testFile: string;
|
|
27
|
+
videoPath?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface BatchExecutionResult {
|
|
30
|
+
totalTests: number;
|
|
31
|
+
passed: number;
|
|
32
|
+
failed: number;
|
|
33
|
+
crashed: number;
|
|
34
|
+
totalDuration: number;
|
|
35
|
+
results: TestExecutionResult[];
|
|
36
|
+
}
|
|
37
|
+
export interface TestExecutionOptions {
|
|
38
|
+
testFile: string;
|
|
39
|
+
workspacePath: string;
|
|
40
|
+
language: string;
|
|
41
|
+
testType: string;
|
|
42
|
+
token?: string;
|
|
43
|
+
timeout?: number;
|
|
44
|
+
playwrightSaveStoragePath?: string;
|
|
45
|
+
useHostNetwork?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Progress callback for reporting execution status
|
|
49
|
+
*/
|
|
50
|
+
export interface ExecutionProgress {
|
|
51
|
+
phase: "docker-check" | "docker-pull" | "preparing" | "executing" | "processing";
|
|
52
|
+
message: string;
|
|
53
|
+
percent: number;
|
|
54
|
+
details?: {
|
|
55
|
+
cached?: boolean;
|
|
56
|
+
pullProgress?: {
|
|
57
|
+
current?: number;
|
|
58
|
+
total?: number;
|
|
59
|
+
layer?: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export type ProgressCallback = (progress: ExecutionProgress) => Promise<void>;
|
|
@@ -3,4 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These types define the structure for test execution results
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
/** Execution outcome for a test run recorded in the maintenance report. */
|
|
7
|
+
export var TestExecutionStatus;
|
|
8
|
+
(function (TestExecutionStatus) {
|
|
9
|
+
TestExecutionStatus["Pass"] = "Pass";
|
|
10
|
+
TestExecutionStatus["Fail"] = "Fail";
|
|
11
|
+
TestExecutionStatus["Error"] = "Error";
|
|
12
|
+
/** Deliberately not executed — VERIFY/IGNORE actions or DELETE (file removed). */
|
|
13
|
+
TestExecutionStatus["Skipped"] = "Skipped";
|
|
14
|
+
/** Execution was expected (UPDATE/REGENERATE) but no result was recorded. */
|
|
15
|
+
TestExecutionStatus["Unknown"] = "Unknown";
|
|
16
|
+
})(TestExecutionStatus || (TestExecutionStatus = {}));
|
|
@@ -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,68 @@
|
|
|
1
|
+
import type { DriftAction } from "./TestAnalysis.js";
|
|
2
|
+
import type { TestExecutionStatus } from "./TestExecution.js";
|
|
3
|
+
import type { HttpMethod, TestType } from "./TestTypes.js";
|
|
4
|
+
/**
|
|
5
|
+
* Shape of the JSON report written by skyramp_submit_report and read by testbot
|
|
6
|
+
* for rendering as Markdown. All fields mirror the corresponding Zod schemas in
|
|
7
|
+
* submitReportTool.ts — keep the two in sync.
|
|
8
|
+
*/
|
|
9
|
+
export interface TestbotReport {
|
|
10
|
+
businessCaseAnalysis: string;
|
|
11
|
+
newTestsCreated: {
|
|
12
|
+
testId: string;
|
|
13
|
+
testType: TestType;
|
|
14
|
+
endpoint: string;
|
|
15
|
+
fileName: string;
|
|
16
|
+
reasoning: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
scenarioFile?: string;
|
|
19
|
+
traceFile?: string;
|
|
20
|
+
frontendTrace?: string;
|
|
21
|
+
}[];
|
|
22
|
+
/** Omitted when no existing tests were found (agent omits the field). */
|
|
23
|
+
testMaintenance?: {
|
|
24
|
+
testType: TestType;
|
|
25
|
+
endpoint: string;
|
|
26
|
+
fileName: string;
|
|
27
|
+
description: string;
|
|
28
|
+
action: DriftAction;
|
|
29
|
+
beforeStatus: TestExecutionStatus;
|
|
30
|
+
beforeDetails: string;
|
|
31
|
+
afterStatus: TestExecutionStatus;
|
|
32
|
+
afterDetails: string;
|
|
33
|
+
}[];
|
|
34
|
+
testResults: {
|
|
35
|
+
testType: TestType;
|
|
36
|
+
endpoint: string;
|
|
37
|
+
status: "Pass" | "Fail" | "Skipped";
|
|
38
|
+
details: string;
|
|
39
|
+
videoPath?: string;
|
|
40
|
+
}[];
|
|
41
|
+
additionalRecommendations?: {
|
|
42
|
+
testId: string;
|
|
43
|
+
testType: TestType;
|
|
44
|
+
category?: string;
|
|
45
|
+
primaryEndpoint?: string;
|
|
46
|
+
scenarioName?: string;
|
|
47
|
+
steps: {
|
|
48
|
+
method?: HttpMethod;
|
|
49
|
+
path?: string;
|
|
50
|
+
description: string;
|
|
51
|
+
expectedStatusCode?: number;
|
|
52
|
+
requestBody?: Record<string, unknown>;
|
|
53
|
+
responseBody?: Record<string, unknown>;
|
|
54
|
+
}[];
|
|
55
|
+
description: string;
|
|
56
|
+
priority: "high" | "medium" | "low";
|
|
57
|
+
reasoning: string;
|
|
58
|
+
openApiSpec?: string;
|
|
59
|
+
backendTrace?: string;
|
|
60
|
+
frontendTrace?: string;
|
|
61
|
+
}[];
|
|
62
|
+
issuesFound: {
|
|
63
|
+
description: string;
|
|
64
|
+
severity?: "critical" | "high" | "medium" | "low";
|
|
65
|
+
}[];
|
|
66
|
+
nextSteps: string[];
|
|
67
|
+
commitMessage: string;
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
+
}
|