@skyramp/mcp 0.3.2 → 0.3.4
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/index.js +47 -2
- package/build/playwright/PlaywrightTraceService.d.ts +8 -0
- package/build/playwright/PlaywrightTraceService.js +1 -0
- package/build/playwright/registerPlaywrightTools.js +42 -1
- package/build/prompts/enhance-assertions/sharedAssertionRules.js +19 -0
- package/build/prompts/pom-aware-code-reuse.js +17 -8
- package/build/prompts/test-maintenance/actionsInstructions.js +2 -2
- package/build/prompts/test-recommendation/analysisOutputPrompt.js +1 -4
- package/build/prompts/test-recommendation/recommendationSections.d.ts +1 -1
- package/build/prompts/test-recommendation/recommendationSections.js +5 -5
- package/build/prompts/test-recommendation/test-recommendation-prompt.js +13 -7
- package/build/prompts/testbot/testbot-prompts.d.ts +2 -12
- package/build/prompts/testbot/testbot-prompts.js +28 -16
- package/build/recommendation/discriminators.d.ts +7 -1
- package/build/recommendation/discriminators.js +16 -3
- package/build/resources/testbotResource.js +20 -4
- package/build/services/ScenarioGenerationService.js +5 -2
- package/build/services/TestExecutionService.d.ts +13 -8
- package/build/services/TestExecutionService.js +73 -26
- package/build/services/TestGenerationService.js +24 -9
- package/build/services/containerEnv.d.ts +12 -1
- package/build/services/containerEnv.js +118 -1
- package/build/tools/executeSkyrampTestTool.d.ts +9 -0
- package/build/tools/executeSkyrampTestTool.js +20 -6
- package/build/tools/execution-video-state.d.ts +21 -0
- package/build/tools/execution-video-state.js +51 -0
- package/build/tools/generate-tests/generateBatchScenarioRestTool.js +31 -11
- package/build/tools/generate-tests/planGuard.d.ts +5 -5
- package/build/tools/generate-tests/planGuard.js +5 -17
- package/build/tools/queryProxyMocksTool.js +0 -1
- package/build/tools/submitReportTool.d.ts +83 -10
- package/build/tools/submitReportTool.js +179 -29
- package/build/tools/test-management/actionsTool.js +52 -41
- package/build/tools/test-management/analyzeChangesTool.d.ts +11 -0
- package/build/tools/test-management/analyzeChangesTool.js +37 -33
- package/build/tools/test-management/analyzeTestHealthTool.js +3 -3
- package/build/tools/test-management/registerTestPlanTool.js +113 -31
- package/build/types/TestAnalysis.d.ts +7 -3
- package/build/types/TestExecution.d.ts +14 -0
- package/build/types/TestTypes.js +3 -2
- package/build/types/TestbotPromptOptions.d.ts +34 -0
- package/build/types/TestbotPromptOptions.js +1 -0
- package/build/types/TestbotReport.d.ts +10 -0
- package/build/types/TestbotReport.js +10 -1
- package/build/types/index.d.ts +2 -0
- package/build/types/index.js +1 -0
- package/build/utils/AnalysisStateManager.d.ts +36 -2
- package/build/utils/AnalysisStateManager.js +34 -13
- package/build/utils/frontendSelectors.js +0 -1
- package/build/utils/gitStaging.d.ts +5 -0
- package/build/utils/gitStaging.js +1 -1
- package/build/utils/pom-catalog.d.ts +23 -0
- package/build/utils/pom-catalog.js +30 -0
- package/build/utils/pom-scope/pom-files.d.ts +14 -0
- package/build/utils/pom-scope/pom-files.js +32 -6
- package/build/utils/pom-scope/testIdDiscovery.d.ts +40 -0
- package/build/utils/pom-scope/testIdDiscovery.js +104 -0
- package/build/utils/reportVerification.d.ts +7 -2
- package/build/utils/reportVerification.js +9 -3
- package/build/utils/scenarioDrafting.js +7 -1
- package/build/utils/skyrampMdContent.d.ts +1 -1
- package/build/utils/skyrampMdContent.js +1 -1
- package/build/utils/urlPath.d.ts +37 -0
- package/build/utils/urlPath.js +55 -0
- package/build/utils/utils.d.ts +45 -0
- package/build/utils/utils.js +50 -0
- package/build/utils/versions.d.ts +3 -3
- package/build/utils/versions.js +1 -1
- package/build/utils/workspaceAuth.d.ts +15 -15
- package/build/utils/workspaceAuth.js +32 -17
- package/build/workspace/queryParamResolution.d.ts +93 -0
- package/build/workspace/queryParamResolution.js +201 -0
- package/build/workspace/workspace.d.ts +104 -0
- package/build/workspace/workspace.js +24 -0
- package/node_modules/playwright/ThirdPartyNotices.txt +319 -266
- package/node_modules/playwright/lib/dom-analyzer/blueprint.js +154 -27
- package/node_modules/playwright/lib/dom-analyzer/crawler.js +2 -2
- package/node_modules/playwright/lib/mcp/browser/tools/pageBlueprint.js +1 -1
- package/node_modules/playwright/lib/mcp/browser/tools/sitemap.js +6 -2
- package/node_modules/playwright/lib/mcp/skyramp/loadTraceTool.js +3 -2
- package/node_modules/playwright/lib/mcp/skyramp/resultCode.js +4 -3
- package/node_modules/playwright/lib/mcp/skyramp/skyRampImport.js +15 -3
- package/node_modules/playwright/lib/mcp/skyramp/specImport.js +781 -0
- package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +14 -3
- package/node_modules/playwright/lib/mcp/test/resultCode.test.js +2 -1
- package/node_modules/playwright/lib/mcp/test/skyRampExport.js +1 -1
- package/node_modules/playwright/lib/mcp/test/skyRampExport.test.js +30 -0
- package/node_modules/playwright/lib/transform/babelBundleImpl.js +200 -199
- package/node_modules/playwright/node_modules/playwright-core/ThirdPartyNotices.txt +3 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/.package-lock.json +3 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/adapter/aws-lambda/handler.js +16 -25
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/adapter/bun/websocket.js +3 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/adapter/lambda-edge/handler.js +20 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +16 -25
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/adapter/bun/websocket.js +3 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +20 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/client/client.js +10 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/client/utils.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/css/common.js +3 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/helper/css/index.js +9 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/base.js +8 -14
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/components.js +41 -21
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/context.js +131 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/jsx/streaming.js +9 -7
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/cache/index.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/compress/index.js +2 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/cors/index.js +2 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/etag/index.js +2 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/language/language.js +10 -32
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/method-override/index.js +5 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/serve-static/index.js +2 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/middleware/timing/timing.js +3 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/router/trie-router/node.js +9 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/body.js +12 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/buffer.js +2 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/utils/ipaddr.js +6 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/cjs/validator/validator.js +3 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/client/client.js +10 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/client/utils.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/css/common.js +3 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/helper/css/index.js +9 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/base.js +15 -15
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/components.js +42 -22
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/context.js +129 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/jsx/streaming.js +10 -8
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/bearer-auth/index.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/cache/index.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/compress/index.js +2 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/cors/index.js +2 -5
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/etag/index.js +2 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/language/language.js +10 -32
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/method-override/index.js +5 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/serve-static/index.js +2 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/middleware/timing/timing.js +3 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/router/trie-router/node.js +9 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/helper/websocket/index.d.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/base.d.ts +1 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/jsx/context.d.ts +39 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +2 -2
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/middleware/language/language.d.ts +18 -0
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/utils/body.d.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/types/utils/types.d.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/body.js +12 -4
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/buffer.js +2 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/utils/ipaddr.js +6 -1
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/validator/validator.js +3 -3
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/package.json +29 -22
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/package-lock.json +3 -3
- package/node_modules/playwright/node_modules/playwright-core/lib/generated/pollingRecorderSource.js +1 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/server/codegen/skyramp/jsonlReader.js +5 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/server/codegen/skyramp/specReader.js +781 -0
- package/node_modules/playwright/node_modules/playwright-core/lib/server/recorder/recorderApp.js +25 -6
- package/node_modules/playwright/node_modules/playwright-core/lib/server/recorder/skyramp/replayEngine.js +3 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/utils.js +2 -0
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/htmlReport/index.html +253 -27
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/recorder/assets/{codeMirrorModule-D0BjbCb7.js → codeMirrorModule-DtudTj_v.js} +1 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/recorder/assets/index-BpDwp16L.js +422 -0
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/recorder/index.html +1 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/assets/{codeMirrorModule-Bzd72-bG.js → codeMirrorModule-FNMuBzX1.js} +1 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-Co9upU5h.js +1035 -0
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/index.DXNIQ_dx.js +2 -0
- 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.CIKB3XSv.js +5 -0
- 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/node_modules/playwright-core/src/generated/pollingRecorderSource.ts +1 -1
- package/node_modules/playwright/node_modules/playwright-core/src/server/codegen/skyramp/jsonlReader.ts +4 -0
- package/node_modules/playwright/node_modules/playwright-core/src/server/codegen/skyramp/specReader.ts +1028 -0
- package/node_modules/playwright/node_modules/playwright-core/src/server/recorder/recorderApp.ts +31 -8
- package/node_modules/playwright/node_modules/playwright-core/src/server/recorder/skyramp/replayEngine.ts +1 -0
- package/node_modules/playwright/node_modules/playwright-core/src/utils.ts +1 -0
- package/node_modules/playwright/package.json +1 -1
- package/package.json +10 -6
- package/node_modules/playwright/node_modules/playwright-core/bundles/mcp/node_modules/hono/dist/tsconfig.build.tsbuildinfo +0 -1
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/recorder/assets/index-lvTRGFx-.js +0 -193
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-DzxTioTK.js +0 -809
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/index.BGc30U3S.js +0 -2
- package/node_modules/playwright/node_modules/playwright-core/lib/vite/traceViewer/uiMode.IaDrb29A.js +0 -5
|
@@ -5,13 +5,16 @@ import { ScenarioGenerationService } from "../../services/ScenarioGenerationServ
|
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import { baseSchema, AUTH_PLACEHOLDER_TOKEN, HttpMethod } from "../../types/TestTypes.js";
|
|
7
7
|
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
8
|
-
import { resolveAuthFromWorkspace,
|
|
8
|
+
import { resolveAuthFromWorkspace, getWorkspaceScopedQueryParams, mergeQueryParamsJson } from "../../utils/workspaceAuth.js";
|
|
9
|
+
import { resolveQueryParamsForPath, ensureLeadingSlash, contributesNothing } from "../../workspace/queryParamResolution.js";
|
|
10
|
+
import { deriveBasePath } from "../../utils/urlPath.js";
|
|
9
11
|
import yaml from "js-yaml";
|
|
10
12
|
import { logger } from "../../utils/logger.js";
|
|
11
13
|
import { guardScenarioApproved } from "./planGuard.js";
|
|
12
14
|
import { lintScenarioChaining } from "./scenarioLint.js";
|
|
13
15
|
import { scenarioFileNameFor } from "./scenarioFileIdentity.js";
|
|
14
16
|
import { toolError } from "../../utils/utils.js";
|
|
17
|
+
import { isRecord } from "ts-is-record";
|
|
15
18
|
function isJsonValue(v) {
|
|
16
19
|
if (v === undefined || v === null)
|
|
17
20
|
return true;
|
|
@@ -40,8 +43,7 @@ function isJsonObject(v) {
|
|
|
40
43
|
if (v === undefined || v === null)
|
|
41
44
|
return true;
|
|
42
45
|
try {
|
|
43
|
-
|
|
44
|
-
return typeof p === "object" && !Array.isArray(p) && p !== null;
|
|
46
|
+
return isRecord(JSON.parse(v));
|
|
45
47
|
}
|
|
46
48
|
catch {
|
|
47
49
|
return false;
|
|
@@ -83,7 +85,7 @@ Use this for GET request filters, search terms, pagination, sorting — any para
|
|
|
83
85
|
|
|
84
86
|
CRITICAL: For search/filter/list endpoints (e.g., GET /products/search?q=bear&limit=10), parameters MUST go here, NOT in requestBody. GET request bodies are non-standard and may be ignored or rejected by servers and frameworks.
|
|
85
87
|
|
|
86
|
-
Workspace-configured api.defaultQueryParams (if set) are merged into every step automatically — no need to repeat them here. An explicit value for the same key in a step overrides
|
|
88
|
+
Workspace-configured api.defaultQueryParams (if set) are merged into every step automatically, and any api.queryParamOverrides entry whose pathPattern matches that step's path is layered on top — no need to repeat them here. An explicit value for the same key in a step overrides both, for that step only.`),
|
|
87
89
|
responseBody: z
|
|
88
90
|
.string()
|
|
89
91
|
.optional()
|
|
@@ -253,13 +255,31 @@ Call \`skyramp_integration_test_generation\` with the returned \`scenarioFile\`
|
|
|
253
255
|
logger.warning("Could not resolve auth from workspace config");
|
|
254
256
|
}
|
|
255
257
|
}
|
|
256
|
-
|
|
258
|
+
// Workspace-declared query params (SKYR-4050, path-scoped in SKYR-4127).
|
|
259
|
+
// Loaded once here; resolved per step below, since each step has its own
|
|
260
|
+
// path and may match a different override.
|
|
261
|
+
let scopedQueryParams;
|
|
262
|
+
// The request ScenarioGenerationService actually emits is basePath +
|
|
263
|
+
// step.path, so pathPattern matching has to see that same composed path —
|
|
264
|
+
// otherwise a prefix-inclusive pattern (as the workspace.yml schema docs
|
|
265
|
+
// instruct authors to write) never matches a scenario step (SKYR-4127
|
|
266
|
+
// final review). deriveBasePath is the one definition of that prefix,
|
|
267
|
+
// shared with the service itself so the two cannot drift.
|
|
268
|
+
let basePrefix = "";
|
|
257
269
|
try {
|
|
258
270
|
const repoPath = params.outputDir || process.cwd();
|
|
259
|
-
|
|
260
|
-
if (
|
|
261
|
-
|
|
262
|
-
|
|
271
|
+
scopedQueryParams = await getWorkspaceScopedQueryParams(repoPath);
|
|
272
|
+
if (scopedQueryParams && contributesNothing(scopedQueryParams)) {
|
|
273
|
+
// Skip the merge entirely rather than setting queryParams to "{}"
|
|
274
|
+
// where the old code left it untouched (Finding 4).
|
|
275
|
+
scopedQueryParams = undefined;
|
|
276
|
+
}
|
|
277
|
+
if (scopedQueryParams) {
|
|
278
|
+
basePrefix = deriveBasePath(params.baseURL);
|
|
279
|
+
logger.info("Loaded workspace query params for scenario steps", {
|
|
280
|
+
baseKeys: Object.keys(scopedQueryParams.base),
|
|
281
|
+
overrideCount: scopedQueryParams.overrides.length,
|
|
282
|
+
basePrefix,
|
|
263
283
|
});
|
|
264
284
|
}
|
|
265
285
|
}
|
|
@@ -410,8 +430,8 @@ Call \`skyramp_integration_test_generation\` with the returned \`scenarioFile\`
|
|
|
410
430
|
method: step.method,
|
|
411
431
|
path: step.path,
|
|
412
432
|
requestBody: step.requestBody,
|
|
413
|
-
queryParams:
|
|
414
|
-
? mergeQueryParamsJson(step.queryParams,
|
|
433
|
+
queryParams: scopedQueryParams
|
|
434
|
+
? mergeQueryParamsJson(step.queryParams, resolveQueryParamsForPath(scopedQueryParams, basePrefix + ensureLeadingSlash(step.path)))
|
|
415
435
|
: step.queryParams,
|
|
416
436
|
responseBody: step.responseBody,
|
|
417
437
|
statusCode: step.statusCode,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PlanMatchQuery } from "../../utils/planMatchKeys.js";
|
|
2
2
|
export type PlanGuardQuery = PlanMatchQuery;
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
export
|
|
3
|
+
/** Re-exported for the generation tools that already import it from here.
|
|
4
|
+
* The implementation moved to utils/urlPath.ts (SKYR-4127) once workspace
|
|
5
|
+
* query-param resolution needed the same derivation — see that module for why
|
|
6
|
+
* it must not be copied. */
|
|
7
|
+
export { pathFromEndpointURL } from "../../utils/urlPath.js";
|
|
8
8
|
/**
|
|
9
9
|
* Returns null when the generation call is allowed, or a human-readable error
|
|
10
10
|
* message (for `toolError`) when it must be rejected because it doesn't match
|
|
@@ -7,23 +7,11 @@
|
|
|
7
7
|
import { resolveRunStatePath, StateManager } from "../../utils/AnalysisStateManager.js";
|
|
8
8
|
import { matchesApprovedPlan } from "../../utils/planMatchKeys.js";
|
|
9
9
|
import { TOOL_REGISTER_TEST_PLAN } from "../../toolNames.js";
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
export
|
|
15
|
-
if (!endpointURL)
|
|
16
|
-
return undefined;
|
|
17
|
-
try {
|
|
18
|
-
// new URL() percent-encodes {param} placeholders ({id} → %7Bid%7D), while
|
|
19
|
-
// register-time matchKeys are computed from raw scenario paths with braces
|
|
20
|
-
// intact — restore them or parameterized endpoints never match the plan.
|
|
21
|
-
return new URL(endpointURL).pathname.replace(/%7B/gi, "{").replace(/%7D/gi, "}");
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
return endpointURL.startsWith("/") ? endpointURL : undefined;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
10
|
+
/** Re-exported for the generation tools that already import it from here.
|
|
11
|
+
* The implementation moved to utils/urlPath.ts (SKYR-4127) once workspace
|
|
12
|
+
* query-param resolution needed the same derivation — see that module for why
|
|
13
|
+
* it must not be copied. */
|
|
14
|
+
export { pathFromEndpointURL } from "../../utils/urlPath.js";
|
|
27
15
|
/**
|
|
28
16
|
* Returns null when the generation call is allowed, or a human-readable error
|
|
29
17
|
* message (for `toolError`) when it must be rejected because it doesn't match
|
|
@@ -275,7 +275,6 @@ function startPortForward(kubeconfig, namespace, target, remotePort) {
|
|
|
275
275
|
async function queryProtocolSamples(baseUrl, protocol, pageSize, destination) {
|
|
276
276
|
const collected = [];
|
|
277
277
|
let offset = 0;
|
|
278
|
-
// eslint-disable-next-line no-constant-condition
|
|
279
278
|
while (true) {
|
|
280
279
|
const params = new URLSearchParams({
|
|
281
280
|
protocol,
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { TestType, HttpMethod } from "../types/TestTypes.js";
|
|
4
|
+
/**
|
|
5
|
+
* Filename of the report, written beside the state file. SKYR-4147: the report path is
|
|
6
|
+
* derived here rather than accepted as a parameter. The caller builds the state file and
|
|
7
|
+
* the report path from a single temp dir (testbot's `skyrampTempDir()`), so the state
|
|
8
|
+
* file's directory IS the directory the caller reads the report back from. Taking the
|
|
9
|
+
* path from the agent instead meant the agent had to retype it out of a 600-character
|
|
10
|
+
* encoded prompt URI; one wrong character wrote the report somewhere nobody reads, and
|
|
11
|
+
* the tool still reported success, throwing away the whole run without a word.
|
|
12
|
+
*
|
|
13
|
+
* Must stay in sync with testbot, which hardcodes the same string in main.ts, post.ts and
|
|
14
|
+
* eval-entry.ts — the same duplication across the two repos that already exists for
|
|
15
|
+
* `RUN_STATE_FILE_NAME` / testbot's `STATE_FILE_NAME`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const REPORT_FILE_NAME = "testbot-result.txt";
|
|
4
18
|
export declare const targetElementSchema: z.ZodObject<{
|
|
5
19
|
role: z.ZodString;
|
|
6
20
|
accessibleName: z.ZodString;
|
|
@@ -36,7 +50,7 @@ export declare const pageContextSchema: z.ZodObject<{
|
|
|
36
50
|
url: string;
|
|
37
51
|
pageHash?: string | undefined;
|
|
38
52
|
}>;
|
|
39
|
-
export declare const newTestSchema: z.ZodEffects<z.ZodObject<{
|
|
53
|
+
export declare const newTestSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
40
54
|
testId: z.ZodString;
|
|
41
55
|
testType: z.ZodNativeEnum<typeof TestType>;
|
|
42
56
|
category: z.ZodEffects<z.ZodEnum<["business_rule", "security_boundary", "data_integrity", "breaking_change", "auth", "error_handling", "workflow", "data_validation", "crud"]>, "business_rule" | "security_boundary" | "data_integrity" | "breaking_change" | "auth" | "error_handling" | "workflow" | "data_validation" | "crud", unknown>;
|
|
@@ -94,7 +108,6 @@ export declare const newTestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
94
108
|
repository?: string | undefined;
|
|
95
109
|
traceFile?: string | undefined;
|
|
96
110
|
scenarioFile?: string | undefined;
|
|
97
|
-
frontendTrace?: string | undefined;
|
|
98
111
|
targetElements?: {
|
|
99
112
|
role: string;
|
|
100
113
|
accessibleName: string;
|
|
@@ -108,6 +121,7 @@ export declare const newTestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
108
121
|
url: string;
|
|
109
122
|
pageHash?: string | undefined;
|
|
110
123
|
} | undefined;
|
|
124
|
+
frontendTrace?: string | undefined;
|
|
111
125
|
}, {
|
|
112
126
|
description: string;
|
|
113
127
|
testType: TestType;
|
|
@@ -119,7 +133,6 @@ export declare const newTestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
119
133
|
category?: unknown;
|
|
120
134
|
traceFile?: string | undefined;
|
|
121
135
|
scenarioFile?: string | undefined;
|
|
122
|
-
frontendTrace?: string | undefined;
|
|
123
136
|
targetElements?: {
|
|
124
137
|
role: string;
|
|
125
138
|
accessibleName: string;
|
|
@@ -133,6 +146,7 @@ export declare const newTestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
133
146
|
url: string;
|
|
134
147
|
pageHash?: string | undefined;
|
|
135
148
|
} | undefined;
|
|
149
|
+
frontendTrace?: string | undefined;
|
|
136
150
|
}>, {
|
|
137
151
|
description: string;
|
|
138
152
|
testType: TestType;
|
|
@@ -144,7 +158,6 @@ export declare const newTestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
144
158
|
repository?: string | undefined;
|
|
145
159
|
traceFile?: string | undefined;
|
|
146
160
|
scenarioFile?: string | undefined;
|
|
147
|
-
frontendTrace?: string | undefined;
|
|
148
161
|
targetElements?: {
|
|
149
162
|
role: string;
|
|
150
163
|
accessibleName: string;
|
|
@@ -158,6 +171,7 @@ export declare const newTestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
158
171
|
url: string;
|
|
159
172
|
pageHash?: string | undefined;
|
|
160
173
|
} | undefined;
|
|
174
|
+
frontendTrace?: string | undefined;
|
|
161
175
|
}, {
|
|
162
176
|
description: string;
|
|
163
177
|
testType: TestType;
|
|
@@ -169,7 +183,31 @@ export declare const newTestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
169
183
|
category?: unknown;
|
|
170
184
|
traceFile?: string | undefined;
|
|
171
185
|
scenarioFile?: string | undefined;
|
|
186
|
+
targetElements?: {
|
|
187
|
+
role: string;
|
|
188
|
+
accessibleName: string;
|
|
189
|
+
testId: string | null;
|
|
190
|
+
stableId: string | null;
|
|
191
|
+
contextText: string[] | null;
|
|
192
|
+
mutability?: "unknown" | "mutable" | "immutable" | undefined;
|
|
193
|
+
widgetType?: "unknown" | "custom" | "native" | undefined;
|
|
194
|
+
}[] | null | undefined;
|
|
195
|
+
pageContext?: {
|
|
196
|
+
url: string;
|
|
197
|
+
pageHash?: string | undefined;
|
|
198
|
+
} | undefined;
|
|
172
199
|
frontendTrace?: string | undefined;
|
|
200
|
+
}>, {
|
|
201
|
+
description: string;
|
|
202
|
+
testType: TestType;
|
|
203
|
+
category: "business_rule" | "security_boundary" | "data_integrity" | "breaking_change" | "auth" | "error_handling" | "workflow" | "data_validation" | "crud";
|
|
204
|
+
fileName: string;
|
|
205
|
+
endpoint: string;
|
|
206
|
+
testId: string;
|
|
207
|
+
reasoning: string;
|
|
208
|
+
repository?: string | undefined;
|
|
209
|
+
traceFile?: string | undefined;
|
|
210
|
+
scenarioFile?: string | undefined;
|
|
173
211
|
targetElements?: {
|
|
174
212
|
role: string;
|
|
175
213
|
accessibleName: string;
|
|
@@ -183,8 +221,9 @@ export declare const newTestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
183
221
|
url: string;
|
|
184
222
|
pageHash?: string | undefined;
|
|
185
223
|
} | undefined;
|
|
186
|
-
|
|
187
|
-
|
|
224
|
+
frontendTrace?: string | undefined;
|
|
225
|
+
}, unknown>;
|
|
226
|
+
export declare const additionalRecommendationSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
188
227
|
testId: z.ZodString;
|
|
189
228
|
testType: z.ZodNativeEnum<typeof TestType>;
|
|
190
229
|
category: z.ZodEffects<z.ZodEnum<["business_rule", "security_boundary", "data_integrity", "breaking_change", "auth", "error_handling", "workflow", "data_validation", "crud"]>, "business_rule" | "security_boundary" | "data_integrity" | "breaking_change" | "auth" | "error_handling" | "workflow" | "data_validation" | "crud", unknown>;
|
|
@@ -271,7 +310,6 @@ export declare const additionalRecommendationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
271
310
|
reasoning: string;
|
|
272
311
|
repository?: string | undefined;
|
|
273
312
|
scenarioName?: string | undefined;
|
|
274
|
-
frontendTrace?: string | undefined;
|
|
275
313
|
targetElements?: {
|
|
276
314
|
role: string;
|
|
277
315
|
accessibleName: string;
|
|
@@ -285,6 +323,7 @@ export declare const additionalRecommendationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
285
323
|
url: string;
|
|
286
324
|
pageHash?: string | undefined;
|
|
287
325
|
} | undefined;
|
|
326
|
+
frontendTrace?: string | undefined;
|
|
288
327
|
primaryEndpoint?: string | undefined;
|
|
289
328
|
openApiSpec?: string | undefined;
|
|
290
329
|
backendTrace?: string | undefined;
|
|
@@ -305,7 +344,6 @@ export declare const additionalRecommendationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
305
344
|
repository?: string | undefined;
|
|
306
345
|
scenarioName?: string | undefined;
|
|
307
346
|
category?: unknown;
|
|
308
|
-
frontendTrace?: string | undefined;
|
|
309
347
|
targetElements?: {
|
|
310
348
|
role: string;
|
|
311
349
|
accessibleName: string;
|
|
@@ -319,6 +357,7 @@ export declare const additionalRecommendationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
319
357
|
url: string;
|
|
320
358
|
pageHash?: string | undefined;
|
|
321
359
|
} | undefined;
|
|
360
|
+
frontendTrace?: string | undefined;
|
|
322
361
|
primaryEndpoint?: string | undefined;
|
|
323
362
|
openApiSpec?: string | undefined;
|
|
324
363
|
backendTrace?: string | undefined;
|
|
@@ -339,7 +378,6 @@ export declare const additionalRecommendationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
339
378
|
reasoning: string;
|
|
340
379
|
repository?: string | undefined;
|
|
341
380
|
scenarioName?: string | undefined;
|
|
342
|
-
frontendTrace?: string | undefined;
|
|
343
381
|
targetElements?: {
|
|
344
382
|
role: string;
|
|
345
383
|
accessibleName: string;
|
|
@@ -353,6 +391,7 @@ export declare const additionalRecommendationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
353
391
|
url: string;
|
|
354
392
|
pageHash?: string | undefined;
|
|
355
393
|
} | undefined;
|
|
394
|
+
frontendTrace?: string | undefined;
|
|
356
395
|
primaryEndpoint?: string | undefined;
|
|
357
396
|
openApiSpec?: string | undefined;
|
|
358
397
|
backendTrace?: string | undefined;
|
|
@@ -373,7 +412,40 @@ export declare const additionalRecommendationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
373
412
|
repository?: string | undefined;
|
|
374
413
|
scenarioName?: string | undefined;
|
|
375
414
|
category?: unknown;
|
|
415
|
+
targetElements?: {
|
|
416
|
+
role: string;
|
|
417
|
+
accessibleName: string;
|
|
418
|
+
testId: string | null;
|
|
419
|
+
stableId: string | null;
|
|
420
|
+
contextText: string[] | null;
|
|
421
|
+
mutability?: "unknown" | "mutable" | "immutable" | undefined;
|
|
422
|
+
widgetType?: "unknown" | "custom" | "native" | undefined;
|
|
423
|
+
}[] | null | undefined;
|
|
424
|
+
pageContext?: {
|
|
425
|
+
url: string;
|
|
426
|
+
pageHash?: string | undefined;
|
|
427
|
+
} | undefined;
|
|
376
428
|
frontendTrace?: string | undefined;
|
|
429
|
+
primaryEndpoint?: string | undefined;
|
|
430
|
+
openApiSpec?: string | undefined;
|
|
431
|
+
backendTrace?: string | undefined;
|
|
432
|
+
}>, {
|
|
433
|
+
description: string;
|
|
434
|
+
priority: "high" | "medium" | "low";
|
|
435
|
+
testType: TestType;
|
|
436
|
+
category: "business_rule" | "security_boundary" | "data_integrity" | "breaking_change" | "auth" | "error_handling" | "workflow" | "data_validation" | "crud";
|
|
437
|
+
steps: {
|
|
438
|
+
description: string;
|
|
439
|
+
path?: string | undefined;
|
|
440
|
+
method?: HttpMethod | undefined;
|
|
441
|
+
requestBody?: Record<string, any> | undefined;
|
|
442
|
+
responseBody?: Record<string, any> | undefined;
|
|
443
|
+
expectedStatusCode?: number | undefined;
|
|
444
|
+
}[];
|
|
445
|
+
testId: string;
|
|
446
|
+
reasoning: string;
|
|
447
|
+
repository?: string | undefined;
|
|
448
|
+
scenarioName?: string | undefined;
|
|
377
449
|
targetElements?: {
|
|
378
450
|
role: string;
|
|
379
451
|
accessibleName: string;
|
|
@@ -387,8 +459,9 @@ export declare const additionalRecommendationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
387
459
|
url: string;
|
|
388
460
|
pageHash?: string | undefined;
|
|
389
461
|
} | undefined;
|
|
462
|
+
frontendTrace?: string | undefined;
|
|
390
463
|
primaryEndpoint?: string | undefined;
|
|
391
464
|
openApiSpec?: string | undefined;
|
|
392
465
|
backendTrace?: string | undefined;
|
|
393
|
-
}>;
|
|
466
|
+
}, unknown>;
|
|
394
467
|
export declare function registerSubmitReportTool(server: McpServer): void;
|