@skyramp/mcp 0.4.2-rc.1 → 0.4.2-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/commands/localDevTestChangesCommand.js +1 -1
- package/build/commands/recommendTestsAndExecuteCommand.js +10 -1
- package/build/commands/testThisEndpointCommand.js +19 -2
- package/build/execution/wrapperConfig.d.ts +56 -0
- package/build/execution/wrapperConfig.js +155 -0
- package/build/index.js +6 -6
- package/build/playwright/registerPlaywrightTools.js +14 -0
- package/build/playwright/traceExportStore.d.ts +22 -0
- package/build/playwright/traceExportStore.js +81 -0
- package/build/playwright/traceRecordingPrompt.js +2 -1
- package/build/prompts/code-reuse.js +24 -21
- package/build/prompts/local-dev/local-dev-plan.js +6 -23
- package/build/prompts/local-dev/local-dev-prompts.js +1 -1
- package/build/prompts/shared-helper-policy.d.ts +36 -0
- package/build/prompts/shared-helper-policy.js +33 -1
- package/build/prompts/startTraceCollectionPrompts.js +1 -1
- package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.js +6 -7
- package/build/prompts/sut-setup/shared.d.ts +1 -1
- package/build/prompts/sut-setup/shared.js +5 -3
- package/build/prompts/test-maintenance/drift-analysis-prompt.d.ts +16 -8
- package/build/prompts/test-maintenance/drift-analysis-prompt.js +90 -36
- package/build/prompts/test-maintenance/uiDriftAnalysisSections.js +1 -1
- package/build/prompts/test-recommendation/recommendationShared.d.ts +1 -1
- package/build/prompts/test-recommendation/recommendationShared.js +0 -1
- package/build/prompts/testbot/testbot-prompts.js +11 -9
- package/build/services/TestDiscoveryService.js +32 -4
- package/build/skills/runTestSkill.d.ts +6 -0
- package/build/skills/runTestSkill.js +17 -0
- package/build/tool-phases.js +0 -1
- package/build/tools/budgetExcuse.d.ts +15 -0
- package/build/tools/budgetExcuse.js +113 -0
- package/build/tools/code-refactor/utils-verify-gates.js +17 -3
- package/build/tools/executeSkyrampTestTool.d.ts +97 -48
- package/build/tools/executeSkyrampTestTool.js +775 -449
- package/build/tools/submitReportTool.js +128 -0
- package/build/tools/test-management/actionsTool.js +31 -0
- package/build/tools/test-management/analyzeChangesTool.d.ts +4 -4
- package/build/tools/test-management/analyzeTestHealthTool.d.ts +0 -11
- package/build/tools/test-management/analyzeTestHealthTool.js +7 -63
- package/build/tools/test-management/testsOwedBeforeRun.d.ts +28 -0
- package/build/tools/test-management/testsOwedBeforeRun.js +53 -0
- package/build/tools/trace/stopTraceCollectionTool.js +1 -1
- package/build/types/RepositoryAnalysis.d.ts +32 -32
- package/build/types/ReuseOutcome.d.ts +4 -3
- package/build/types/TestExecution.d.ts +2 -2
- package/build/types/TestTypes.d.ts +3 -0
- package/build/types/TestTypes.js +6 -0
- package/build/utils/AnalysisStateManager.d.ts +0 -7
- package/build/utils/AnalysisStateManager.js +1 -1
- package/build/utils/connectionErrors.d.ts +10 -0
- package/build/utils/connectionErrors.js +10 -0
- package/build/utils/language-helper.js +24 -3
- package/build/utils/progress.d.ts +1 -1
- package/build/utils/progress.js +1 -1
- package/build/utils/rebaselineSnapshots.d.ts +1 -1
- package/build/utils/rebaselineSnapshots.js +6 -16
- package/build/utils/reuseRouting.d.ts +10 -0
- package/build/utils/reuseRouting.js +15 -0
- package/build/utils/runContextGauge.d.ts +27 -0
- package/build/utils/runContextGauge.js +181 -0
- package/build/utils/skyrampMdContent.d.ts +1 -1
- package/build/utils/skyrampMdContent.js +1 -1
- package/build/utils/skyrampSdkVersion.d.ts +9 -0
- package/build/utils/skyrampSdkVersion.js +16 -0
- package/build/utils/testDependencyPolicy.js +21 -0
- package/build/utils/testExecutionRecord.d.ts +5 -1
- package/build/utils/testExecutionRecord.js +3 -1
- package/build/utils/testFileClassification.d.ts +8 -0
- package/build/utils/testFileClassification.js +36 -3
- package/build/utils/utils-verify/action-key.d.ts +42 -0
- package/build/utils/utils-verify/action-key.js +118 -36
- package/build/utils/utils-verify/action-sites.d.ts +32 -0
- package/build/utils/utils-verify/action-sites.js +202 -0
- package/build/utils/utils-verify/body-reach.js +2 -4
- package/build/utils/utils-verify/call-sites.d.ts +25 -6
- package/build/utils/utils-verify/call-sites.js +8 -5
- package/build/utils/utils-verify/index.d.ts +1 -0
- package/build/utils/utils-verify/index.js +1 -0
- package/build/utils/utils-verify/language-spec.d.ts +25 -0
- package/build/utils/utils-verify/language-spec.js +16 -2
- package/build/utils/utils-verify/parse.d.ts +10 -1
- package/build/utils/utils-verify/parse.js +19 -2
- package/build/utils/utils-verify/verify.d.ts +3 -2
- package/build/utils/utils-verify/verify.js +16 -18
- package/build/workspace/workspace.d.ts +72 -52
- package/build/workspace/workspace.js +12 -8
- package/package.json +1 -1
- package/plugin/prompts/testbot-task1.md +0 -2
- package/plugin/skills/fix-test-import-errors/SKILL.md +2 -1
- package/plugin/skills/run-test/SKILL.md +16 -0
- package/build/adapters/jestAdapter.d.ts +0 -14
- package/build/adapters/jestAdapter.js +0 -131
- package/build/adapters/mochaAdapter.d.ts +0 -13
- package/build/adapters/mochaAdapter.js +0 -93
- package/build/adapters/playwrightAdapter.d.ts +0 -17
- package/build/adapters/playwrightAdapter.js +0 -184
- package/build/adapters/pytestAdapter.d.ts +0 -15
- package/build/adapters/pytestAdapter.js +0 -119
- package/build/tools/runExistingTestsTool.d.ts +0 -138
- package/build/tools/runExistingTestsTool.js +0 -666
- package/build/types/ExternalTestExecution.d.ts +0 -67
- package/build/types/ExternalTestExecution.js +0 -8
- package/build/workspace/testSuites.d.ts +0 -20
- package/build/workspace/testSuites.js +0 -17
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
import { WorkspaceConfig } from "../workspace/workspace.js";
|
|
3
|
-
import { ParsedExternalRun } from "../types/ExternalTestExecution.js";
|
|
4
|
-
import { SUPPORTED_FRAMEWORKS } from "../workspace/frameworks.js";
|
|
5
|
-
/** Test-run lifecycle resolved from a service's workspace.yml runtimeDetails. */
|
|
6
|
-
export interface ResolvedRunConfig {
|
|
7
|
-
serviceName: string;
|
|
8
|
-
framework: Framework;
|
|
9
|
-
testRunCommand: string;
|
|
10
|
-
testEnv?: Record<string, string>;
|
|
11
|
-
/** Repo-relative globs this suite owns; empty/absent means it accepts any selector. */
|
|
12
|
-
pathGlobs?: string[];
|
|
13
|
-
}
|
|
14
|
-
type Framework = (typeof SUPPORTED_FRAMEWORKS)[number];
|
|
15
|
-
/** Binds a framework to its pure parse/buildArgs pair + how its report is
|
|
16
|
-
* obtained. The generic IO shell {@link runExternalSuite} is the only place
|
|
17
|
-
* that spawns a process; adding a framework is a new ReaderSpec + registry entry. */
|
|
18
|
-
interface ReaderSpec {
|
|
19
|
-
framework: Framework;
|
|
20
|
-
/** Where the machine-readable report lands: a temp file, or the process stdout. */
|
|
21
|
-
outputVia: "file" | "stdout";
|
|
22
|
-
/** Env var pointing the reporter at the temp report path (e.g. Playwright). */
|
|
23
|
-
reportEnvVar?: string;
|
|
24
|
-
buildArgs(input: {
|
|
25
|
-
selectors: string[];
|
|
26
|
-
mode: "confirm" | "verify";
|
|
27
|
-
project?: string;
|
|
28
|
-
reportPath: string;
|
|
29
|
-
}): string[];
|
|
30
|
-
parse(report: unknown, opts: {
|
|
31
|
-
truncated: boolean;
|
|
32
|
-
}): ParsedExternalRun;
|
|
33
|
-
}
|
|
34
|
-
/** True when a framework has an execution reader (playwright/pytest/jest/vitest/mocha). */
|
|
35
|
-
export declare function frameworkHasReader(framework?: string): boolean;
|
|
36
|
-
/** Extract the last complete top-level JSON object from a stdout blob that may
|
|
37
|
-
* carry interleaved non-JSON (e.g. a test's console.log before mocha's json
|
|
38
|
-
* reporter dumps its object). Scans brace depth while respecting string/escape
|
|
39
|
-
* context so braces inside strings do not miscount. Throws if none found. */
|
|
40
|
-
export declare function extractLastJsonObject(s: string): string;
|
|
41
|
-
export interface RunExistingTestsParams {
|
|
42
|
-
workspacePath: string;
|
|
43
|
-
service?: string;
|
|
44
|
-
testSelectors?: string[];
|
|
45
|
-
mode?: "confirm" | "verify";
|
|
46
|
-
project?: string;
|
|
47
|
-
stateFile?: string;
|
|
48
|
-
repository: string;
|
|
49
|
-
timeoutMs?: number;
|
|
50
|
-
maxTests?: number;
|
|
51
|
-
}
|
|
52
|
-
export interface PlaywrightRunOpts {
|
|
53
|
-
workspacePath: string;
|
|
54
|
-
selectors: string[];
|
|
55
|
-
mode: "confirm" | "verify";
|
|
56
|
-
project?: string;
|
|
57
|
-
timeoutMs?: number;
|
|
58
|
-
truncated: boolean;
|
|
59
|
-
}
|
|
60
|
-
/** Injectable IO seam so the orchestration in {@link runExternalTests} is unit
|
|
61
|
-
* testable without a real workspace file or Playwright process. */
|
|
62
|
-
export interface RunExistingTestsDeps {
|
|
63
|
-
readConfig: (workspacePath: string) => Promise<WorkspaceConfig>;
|
|
64
|
-
runner: (cfg: ResolvedRunConfig, opts: PlaywrightRunOpts) => Promise<ParsedExternalRun>;
|
|
65
|
-
now: () => string;
|
|
66
|
-
}
|
|
67
|
-
/** The routed suite list: every runnable suite to execute, plus the suites that
|
|
68
|
-
* were skipped (with a reason). A suite is runnable when its framework has a
|
|
69
|
-
* registered reader (its testRunCommand is required non-empty by the schema). */
|
|
70
|
-
export interface RunConfigResolution {
|
|
71
|
-
runs: ResolvedRunConfig[];
|
|
72
|
-
skips: {
|
|
73
|
-
service: string;
|
|
74
|
-
reason: string;
|
|
75
|
-
}[];
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Resolves the runnable suites from workspace.yml (SKYR-4002). Enumerates every
|
|
79
|
-
* (service, suite) via resolveSuites; a suite is runnable when its framework has
|
|
80
|
-
* a registered reader (Playwright, pytest, jest, vitest, Mocha) — testRunCommand
|
|
81
|
-
* is required non-empty by the schema. Suites whose framework has no reader become
|
|
82
|
-
* skips-with-reason (never a throw). Every runnable suite runs. Throws only for an
|
|
83
|
-
* explicitly-named unknown service.
|
|
84
|
-
*/
|
|
85
|
-
export declare function resolveRunConfig(config: WorkspaceConfig, opts?: {
|
|
86
|
-
service?: string;
|
|
87
|
-
}): RunConfigResolution;
|
|
88
|
-
/** Selectors partitioned into those this suite owns and those it does not. */
|
|
89
|
-
export interface SelectorRouting {
|
|
90
|
-
kept: string[];
|
|
91
|
-
dropped: string[];
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Partitions `selectors` into the ones this suite owns and the ones it does not,
|
|
95
|
-
* using the suite's own `pathGlobs` from workspace.yml.
|
|
96
|
-
*
|
|
97
|
-
* One repo commonly hosts several runners (mocha for a core package, vitest for
|
|
98
|
-
* app packages, Playwright for e2e), and handing a runner another runner's spec is
|
|
99
|
-
* not a test failure — it is a loader crash that yields no report at all. Which
|
|
100
|
-
* suite owns which paths is a fact about the repo, so it is recorded as config the
|
|
101
|
-
* user can read and correct, rather than guessed at run time. Run 30297865488 is
|
|
102
|
-
* the cautionary case: routing on a guessed framework tag sent Ghost's Playwright
|
|
103
|
-
* specs away from the Playwright suite, and nothing ran.
|
|
104
|
-
*
|
|
105
|
-
* A suite with no globs owns everything. That is deliberate: absent globs means
|
|
106
|
-
* the suite is unscoped, not that it owns nothing, and narrowing on no
|
|
107
|
-
* information would silently shrink the run.
|
|
108
|
-
*/
|
|
109
|
-
export declare function routeSelectorsToSuite(input: {
|
|
110
|
-
selectors: string[];
|
|
111
|
-
/** The suite's repo-relative globs; absent/empty means it accepts every selector. */
|
|
112
|
-
pathGlobs?: string[];
|
|
113
|
-
/** Absolute test-file paths from analyze_changes, used to canonicalize a selector. */
|
|
114
|
-
knownTestFiles?: string[];
|
|
115
|
-
workspacePath: string;
|
|
116
|
-
}): SelectorRouting;
|
|
117
|
-
/** Combines per-suite runs into one ParsedExternalRun for the tool's summary
|
|
118
|
-
* text: sums counts, concatenates results, ANDs environmentHealthy, joins the
|
|
119
|
-
* unhealthy details. */
|
|
120
|
-
export declare function aggregateRuns(parsed: ParsedExternalRun[]): ParsedExternalRun;
|
|
121
|
-
/**
|
|
122
|
-
* Generic IO shell for every framework reader: append the reporter + scoped
|
|
123
|
-
* selectors to the suite's `testRunCommand`, spawn it via bash (so a wrapper
|
|
124
|
-
* entrypoint's `exec "$@"` receives the flags), read the machine-readable
|
|
125
|
-
* report (temp file or captured stdout), and hand it to `spec.parse`. A missing
|
|
126
|
-
* or unparseable report is the exit-code rung: `environmentHealthy:false` with
|
|
127
|
-
* the stderr tail — never PR signal, never throws.
|
|
128
|
-
*/
|
|
129
|
-
export declare function runExternalSuite(spec: ReaderSpec, cfg: ResolvedRunConfig, opts: PlaywrightRunOpts): Promise<ParsedExternalRun>;
|
|
130
|
-
export declare function runPlaywright(cfg: ResolvedRunConfig, opts: PlaywrightRunOpts): Promise<ParsedExternalRun>;
|
|
131
|
-
/**
|
|
132
|
-
* Orchestrates an external test run: resolve config → apply maxTests cap → run →
|
|
133
|
-
* persist a record to the state file. Pure of MCP/registration concerns and
|
|
134
|
-
* fully injectable for tests.
|
|
135
|
-
*/
|
|
136
|
-
export declare function runExternalTests(params: RunExistingTestsParams, deps?: RunExistingTestsDeps): Promise<ParsedExternalRun>;
|
|
137
|
-
export declare function registerRunExistingTestsTool(server: McpServer): void;
|
|
138
|
-
export {};
|