@plune-ai/cairn 0.4.2 → 0.6.0
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/README.md +55 -261
- package/dist/agent/graph.d.ts +41 -0
- package/dist/agent/graph.d.ts.map +1 -1
- package/dist/agent/graph.js +110 -8
- package/dist/agent/graph.js.map +1 -1
- package/dist/agent/index.d.ts +34 -0
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +238 -54
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/summary.d.ts +11 -0
- package/dist/agent/summary.d.ts.map +1 -1
- package/dist/agent/summary.js +10 -0
- package/dist/agent/summary.js.map +1 -1
- package/dist/analyze/index.d.ts +2 -0
- package/dist/analyze/index.d.ts.map +1 -1
- package/dist/analyze/index.js +1 -0
- package/dist/analyze/index.js.map +1 -1
- package/dist/api/adversarial.d.ts +38 -0
- package/dist/api/adversarial.d.ts.map +1 -0
- package/dist/api/adversarial.js +175 -0
- package/dist/api/adversarial.js.map +1 -0
- package/dist/api/cases.d.ts +105 -0
- package/dist/api/cases.d.ts.map +1 -0
- package/dist/api/cases.js +256 -0
- package/dist/api/cases.js.map +1 -0
- package/dist/api/coverage.d.ts +51 -0
- package/dist/api/coverage.d.ts.map +1 -0
- package/dist/api/coverage.js +80 -0
- package/dist/api/coverage.js.map +1 -0
- package/dist/api/openapi.d.ts +84 -0
- package/dist/api/openapi.d.ts.map +1 -0
- package/dist/api/openapi.js +119 -0
- package/dist/api/openapi.js.map +1 -0
- package/dist/api/runner.d.ts +58 -0
- package/dist/api/runner.d.ts.map +1 -0
- package/dist/api/runner.js +285 -0
- package/dist/api/runner.js.map +1 -0
- package/dist/api/scenario-runner.d.ts +22 -0
- package/dist/api/scenario-runner.d.ts.map +1 -0
- package/dist/api/scenario-runner.js +132 -0
- package/dist/api/scenario-runner.js.map +1 -0
- package/dist/api/scenarios.d.ts +31 -0
- package/dist/api/scenarios.d.ts.map +1 -0
- package/dist/api/scenarios.js +71 -0
- package/dist/api/scenarios.js.map +1 -0
- package/dist/api/testcase-docs.d.ts +12 -0
- package/dist/api/testcase-docs.d.ts.map +1 -0
- package/dist/api/testcase-docs.js +22 -0
- package/dist/api/testcase-docs.js.map +1 -0
- package/dist/artifacts/index.d.ts +23 -0
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +61 -1
- package/dist/artifacts/index.js.map +1 -1
- package/dist/artifacts/report.d.ts +29 -0
- package/dist/artifacts/report.d.ts.map +1 -1
- package/dist/artifacts/report.js +96 -0
- package/dist/artifacts/report.js.map +1 -1
- package/dist/artifacts/testcase-md.d.ts +27 -0
- package/dist/artifacts/testcase-md.d.ts.map +1 -1
- package/dist/artifacts/testcase-md.js +61 -0
- package/dist/artifacts/testcase-md.js.map +1 -1
- package/dist/browser/backends/playwright-lib.d.ts +12 -0
- package/dist/browser/backends/playwright-lib.d.ts.map +1 -1
- package/dist/browser/backends/playwright-lib.js +48 -3
- package/dist/browser/backends/playwright-lib.js.map +1 -1
- package/dist/browser/recovery.d.ts +42 -0
- package/dist/browser/recovery.d.ts.map +1 -0
- package/dist/browser/recovery.js +62 -0
- package/dist/browser/recovery.js.map +1 -0
- package/dist/browser/types.d.ts +7 -0
- package/dist/browser/types.d.ts.map +1 -1
- package/dist/checklist/index.d.ts +7 -0
- package/dist/checklist/index.d.ts.map +1 -1
- package/dist/checklist/index.js +14 -0
- package/dist/checklist/index.js.map +1 -1
- package/dist/ci/github.d.ts +83 -0
- package/dist/ci/github.d.ts.map +1 -0
- package/dist/ci/github.js +104 -0
- package/dist/ci/github.js.map +1 -0
- package/dist/ci/index.d.ts +14 -0
- package/dist/ci/index.d.ts.map +1 -0
- package/dist/ci/index.js +35 -0
- package/dist/ci/index.js.map +1 -0
- package/dist/ci/inputs.d.ts +93 -0
- package/dist/ci/inputs.d.ts.map +1 -0
- package/dist/ci/inputs.js +100 -0
- package/dist/ci/inputs.js.map +1 -0
- package/dist/ci/run.d.ts +51 -0
- package/dist/ci/run.d.ts.map +1 -0
- package/dist/ci/run.js +207 -0
- package/dist/ci/run.js.map +1 -0
- package/dist/ci/summary.d.ts +42 -0
- package/dist/ci/summary.d.ts.map +1 -0
- package/dist/ci/summary.js +45 -0
- package/dist/ci/summary.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +65 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/codegen/index.d.ts +13 -1
- package/dist/codegen/index.d.ts.map +1 -1
- package/dist/codegen/index.js +75 -0
- package/dist/codegen/index.js.map +1 -1
- package/dist/codegen/journey-setup.d.ts +14 -0
- package/dist/codegen/journey-setup.d.ts.map +1 -0
- package/dist/codegen/journey-setup.js +69 -0
- package/dist/codegen/journey-setup.js.map +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +9 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/profiles.d.ts +6 -0
- package/dist/config/profiles.d.ts.map +1 -1
- package/dist/config/profiles.js +13 -0
- package/dist/config/profiles.js.map +1 -1
- package/dist/config/schema.d.ts +6 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/core/modalities/api.d.ts +27 -0
- package/dist/core/modalities/api.d.ts.map +1 -0
- package/dist/core/modalities/api.js +321 -0
- package/dist/core/modalities/api.js.map +1 -0
- package/dist/core/modalities/explore.d.ts.map +1 -1
- package/dist/core/modalities/explore.js +19 -1
- package/dist/core/modalities/explore.js.map +1 -1
- package/dist/core/registry.d.ts.map +1 -1
- package/dist/core/registry.js +4 -1
- package/dist/core/registry.js.map +1 -1
- package/dist/design/critique.d.ts +86 -0
- package/dist/design/critique.d.ts.map +1 -0
- package/dist/design/critique.js +62 -0
- package/dist/design/critique.js.map +1 -0
- package/dist/design/index.d.ts +2 -0
- package/dist/design/index.d.ts.map +1 -1
- package/dist/design/index.js +1 -0
- package/dist/design/index.js.map +1 -1
- package/dist/design/schema.d.ts +74 -0
- package/dist/design/schema.d.ts.map +1 -1
- package/dist/design/schema.js +22 -0
- package/dist/design/schema.js.map +1 -1
- package/dist/design/style.d.ts +18 -0
- package/dist/design/style.d.ts.map +1 -0
- package/dist/design/style.js +34 -0
- package/dist/design/style.js.map +1 -0
- package/dist/documentarian/index.d.ts +53 -0
- package/dist/documentarian/index.d.ts.map +1 -0
- package/dist/documentarian/index.js +135 -0
- package/dist/documentarian/index.js.map +1 -0
- package/dist/eval/coverage.d.ts +49 -0
- package/dist/eval/coverage.d.ts.map +1 -0
- package/dist/eval/coverage.js +60 -0
- package/dist/eval/coverage.js.map +1 -0
- package/dist/eval/gap-cases.d.ts +21 -0
- package/dist/eval/gap-cases.d.ts.map +1 -0
- package/dist/eval/gap-cases.js +27 -0
- package/dist/eval/gap-cases.js.map +1 -0
- package/dist/eval/legend.d.ts +3 -3
- package/dist/eval/legend.js +3 -3
- package/dist/eval/pilot.d.ts +4 -1
- package/dist/eval/pilot.d.ts.map +1 -1
- package/dist/eval/pilot.js +9 -2
- package/dist/eval/pilot.js.map +1 -1
- package/dist/flow/crawl.d.ts +66 -0
- package/dist/flow/crawl.d.ts.map +1 -0
- package/dist/flow/crawl.js +0 -0
- package/dist/flow/crawl.js.map +1 -0
- package/dist/flow/journey.d.ts +25 -0
- package/dist/flow/journey.d.ts.map +1 -0
- package/dist/flow/journey.js +51 -0
- package/dist/flow/journey.js.map +1 -0
- package/dist/flow/setup.d.ts +85 -0
- package/dist/flow/setup.d.ts.map +1 -0
- package/dist/flow/setup.js +65 -0
- package/dist/flow/setup.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/knowledge/index.d.ts +30 -4
- package/dist/knowledge/index.d.ts.map +1 -1
- package/dist/knowledge/index.js +80 -22
- package/dist/knowledge/index.js.map +1 -1
- package/dist/llm/index.d.ts +2 -2
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +1 -1
- package/dist/llm/index.js.map +1 -1
- package/dist/llm/routing.d.ts.map +1 -1
- package/dist/llm/routing.js +8 -2
- package/dist/llm/routing.js.map +1 -1
- package/dist/llm/schema-lint.d.ts +9 -0
- package/dist/llm/schema-lint.d.ts.map +1 -0
- package/dist/llm/schema-lint.js +42 -0
- package/dist/llm/schema-lint.js.map +1 -0
- package/dist/llm/structured.d.ts +22 -0
- package/dist/llm/structured.d.ts.map +1 -1
- package/dist/llm/structured.js +42 -0
- package/dist/llm/structured.js.map +1 -1
- package/dist/mcp/server.d.ts +9 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +49 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +149 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +138 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/observe/parse-aria.d.ts.map +1 -1
- package/dist/observe/parse-aria.js +11 -2
- package/dist/observe/parse-aria.js.map +1 -1
- package/dist/project/index.d.ts +70 -0
- package/dist/project/index.d.ts.map +1 -0
- package/dist/project/index.js +173 -0
- package/dist/project/index.js.map +1 -0
- package/dist/prompts/local/identify-elements.d.ts +1 -1
- package/dist/prompts/local/identify-elements.d.ts.map +1 -1
- package/dist/prompts/local/identify-elements.js +5 -2
- package/dist/prompts/local/identify-elements.js.map +1 -1
- package/dist/prompts/local/index.d.ts.map +1 -1
- package/dist/prompts/local/index.js +8 -0
- package/dist/prompts/local/index.js.map +1 -1
- package/dist/prompts/local/pilot-review.d.ts +1 -1
- package/dist/prompts/local/pilot-review.d.ts.map +1 -1
- package/dist/prompts/local/pilot-review.js +2 -1
- package/dist/prompts/local/pilot-review.js.map +1 -1
- package/dist/prompts/local/qa-case-critique.d.ts +8 -0
- package/dist/prompts/local/qa-case-critique.d.ts.map +1 -0
- package/dist/prompts/local/qa-case-critique.js +34 -0
- package/dist/prompts/local/qa-case-critique.js.map +1 -0
- package/dist/prompts/local/qa-gap-cases.d.ts +7 -0
- package/dist/prompts/local/qa-gap-cases.d.ts.map +1 -0
- package/dist/prompts/local/qa-gap-cases.js +22 -0
- package/dist/prompts/local/qa-gap-cases.js.map +1 -0
- package/dist/prompts/local/qa-journey-from-flow.d.ts +7 -0
- package/dist/prompts/local/qa-journey-from-flow.d.ts.map +1 -0
- package/dist/prompts/local/qa-journey-from-flow.js +29 -0
- package/dist/prompts/local/qa-journey-from-flow.js.map +1 -0
- package/dist/prompts/local/qa-setup-planner.d.ts +6 -0
- package/dist/prompts/local/qa-setup-planner.d.ts.map +1 -0
- package/dist/prompts/local/qa-setup-planner.js +28 -0
- package/dist/prompts/local/qa-setup-planner.js.map +1 -0
- package/dist/prompts/local/qa-testcase-from-ui.d.ts +1 -1
- package/dist/prompts/local/qa-testcase-from-ui.d.ts.map +1 -1
- package/dist/prompts/local/qa-testcase-from-ui.js +2 -0
- package/dist/prompts/local/qa-testcase-from-ui.js.map +1 -1
- package/dist/safety/guardrails.d.ts +36 -0
- package/dist/safety/guardrails.d.ts.map +1 -0
- package/dist/safety/guardrails.js +60 -0
- package/dist/safety/guardrails.js.map +1 -0
- package/dist/tui/hooks/use-runs.d.ts.map +1 -1
- package/dist/tui/hooks/use-runs.js +4 -1
- package/dist/tui/hooks/use-runs.js.map +1 -1
- package/dist/tui/screens/runs-list-screen.d.ts.map +1 -1
- package/dist/tui/screens/runs-list-screen.js +3 -1
- package/dist/tui/screens/runs-list-screen.js.map +1 -1
- package/dist/tui/screens/summary-screen.d.ts.map +1 -1
- package/dist/tui/screens/summary-screen.js +1 -1
- package/dist/tui/screens/summary-screen.js.map +1 -1
- package/dist/tui/types.d.ts +7 -1
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/validate/index.d.ts +7 -3
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +22 -3
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/runner.d.ts +61 -1
- package/dist/validate/runner.d.ts.map +1 -1
- package/dist/validate/runner.js +67 -4
- package/dist/validate/runner.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { resolveConfig } from "../core/config.js";
|
|
3
|
+
import { runExploration, runDesign, runAutomate } from "../agent/index.js";
|
|
4
|
+
import { readInputFile } from "../fs/run-dir.js";
|
|
5
|
+
import { resolveStyleText } from "../design/style.js";
|
|
6
|
+
/**
|
|
7
|
+
* MCP tool layer (#49). Each tool is a THIN adapter over the shared core: validate input → reuse
|
|
8
|
+
* `resolveConfig` (config / routing / cost) → call the SAME `runExploration` / `runDesign` the CLI
|
|
9
|
+
* calls → return a compact structured result. No new generation logic lives here.
|
|
10
|
+
*
|
|
11
|
+
* Core is injected via {@link ToolDeps} so the handlers are unit-testable without a browser or LLM.
|
|
12
|
+
*/
|
|
13
|
+
/** Tool input shape (zod raw shape) — a subset of the `cairn explore` / `design` flags. */
|
|
14
|
+
export const TOOL_INPUT_SHAPE = {
|
|
15
|
+
url: z.string().describe("Page URL to generate tests for"),
|
|
16
|
+
session: z.string().optional().describe("Saved session name (.auth/<name>.storageState.json) for authenticated targets"),
|
|
17
|
+
checklist: z.string().optional().describe("Path to a checklist file (md/text) that guides what to test"),
|
|
18
|
+
style: z.string().optional().describe("Planning style or house-style pack (happy | negative | coverage | a pack name/path)"),
|
|
19
|
+
routing: z.string().optional().describe("Role-routing preset: fast (Groq worker) | volume (OpenRouter worker) | volume-fast (Anthropic codegen — faster, recommended when OpenRouter codegen overruns timeouts)"),
|
|
20
|
+
backend: z.string().optional().describe("Browser backend: lib (in-process, default) | cli"),
|
|
21
|
+
channel: z.string().optional().describe("System browser channel, e.g. chrome (drives installed Chrome; helps OAuth)"),
|
|
22
|
+
flow: z.boolean().optional().describe("Follow in-app navigation across pages → multi-page journey cases"),
|
|
23
|
+
maxPages: z.number().int().positive().optional().describe("Max pages to crawl with flow (default 3)"),
|
|
24
|
+
setup: z.boolean().optional().describe("For journeys (flow): plan starting-state setup (fixture / API seed)"),
|
|
25
|
+
gaps: z.boolean().optional().describe("Suggest cases for the top untested surface"),
|
|
26
|
+
critique: z.boolean().optional().describe("Design-time self-critique pass (prune weak cases + top up technique gaps)"),
|
|
27
|
+
fresh: z.boolean().optional().describe("Ignore prior-run experience for this URL (full set, no delta)"),
|
|
28
|
+
intoProject: z.boolean().optional().describe("explore only: write specs into an existing Playwright project's testDir (detect playwright.config.*) instead of runs/<id>/tests"),
|
|
29
|
+
projectDir: z.string().optional().describe("Explicit project dir for intoProject (detection searches from cwd upward when omitted)"),
|
|
30
|
+
};
|
|
31
|
+
export const ToolInputSchema = z.object(TOOL_INPUT_SHAPE);
|
|
32
|
+
export const defaultDeps = { resolveConfig, runExploration, runDesign, runAutomate };
|
|
33
|
+
/** Compact a validation report into pass/fail/flaky counts (shared by explore + automate). */
|
|
34
|
+
function compactValidation(v) {
|
|
35
|
+
if (!v)
|
|
36
|
+
return undefined;
|
|
37
|
+
return {
|
|
38
|
+
greenRatio: v.greenRatio,
|
|
39
|
+
passed: v.results.filter((x) => x.status === "passed").length,
|
|
40
|
+
failed: v.results.filter((x) => x.status === "failed").length,
|
|
41
|
+
flaky: v.flakyCount,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Map tool input → the shared `ExploreInput` exactly like `exploreModality` does (config reused). */
|
|
45
|
+
async function buildExploreInput(input, deps) {
|
|
46
|
+
const config = deps.resolveConfig({ backend: input.backend, routing: input.routing, channel: input.channel });
|
|
47
|
+
const checklistText = input.checklist ? await readInputFile(input.checklist, "Checklist") : undefined;
|
|
48
|
+
const styleText = input.style ? await resolveStyleText(input.style) : undefined;
|
|
49
|
+
return {
|
|
50
|
+
url: input.url,
|
|
51
|
+
config,
|
|
52
|
+
sessionName: input.session,
|
|
53
|
+
checklistText,
|
|
54
|
+
style: input.style,
|
|
55
|
+
styleText,
|
|
56
|
+
fresh: input.fresh,
|
|
57
|
+
critique: input.critique,
|
|
58
|
+
flow: input.flow,
|
|
59
|
+
maxPages: input.flow ? (input.maxPages ?? 3) : undefined,
|
|
60
|
+
setup: input.setup,
|
|
61
|
+
gaps: input.gaps,
|
|
62
|
+
intoProject: input.intoProject,
|
|
63
|
+
projectDir: input.projectDir,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** Compact, LLM-friendly view of a generated case (drops nothing essential, keeps the payload small). */
|
|
67
|
+
function compactCases(cases) {
|
|
68
|
+
return cases.map((c) => ({
|
|
69
|
+
id: c.id,
|
|
70
|
+
title: c.title,
|
|
71
|
+
technique: c.technique,
|
|
72
|
+
type: c.type,
|
|
73
|
+
priority: c.priority,
|
|
74
|
+
execution: c.execution,
|
|
75
|
+
steps: c.steps,
|
|
76
|
+
expected: c.expected,
|
|
77
|
+
elementRefs: c.elementRefs,
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
export async function exploreTool(input, deps = defaultDeps) {
|
|
81
|
+
const r = await deps.runExploration(await buildExploreInput(input, deps));
|
|
82
|
+
return {
|
|
83
|
+
runId: r.runId,
|
|
84
|
+
runDir: r.runDir,
|
|
85
|
+
pageSemantics: r.analysis.pageSemantics,
|
|
86
|
+
testCases: compactCases(r.testCases),
|
|
87
|
+
validation: compactValidation(r.validation),
|
|
88
|
+
scores: r.scores.map((s) => ({ name: s.name, value: s.value, comment: s.comment })),
|
|
89
|
+
pilot: r.pilot ? { verdict: r.pilot.verdict, reason: r.pilot.reason, guidance: r.pilot.guidance } : undefined,
|
|
90
|
+
cost: r.cost,
|
|
91
|
+
testCaseFiles: r.testCaseFiles,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export async function designTool(input, deps = defaultDeps) {
|
|
95
|
+
const r = await deps.runDesign(await buildExploreInput(input, deps));
|
|
96
|
+
return {
|
|
97
|
+
runId: r.runId,
|
|
98
|
+
runDir: r.runDir,
|
|
99
|
+
pageSemantics: r.analysis.pageSemantics,
|
|
100
|
+
testCases: compactCases(r.testCases),
|
|
101
|
+
scores: r.scores.map((s) => ({ name: s.name, value: s.value, comment: s.comment })),
|
|
102
|
+
cost: r.cost,
|
|
103
|
+
testCaseFiles: r.testCaseFiles,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Input for the `automate` tool — the second half of the decoupled flow. Unlike explore/design (whose
|
|
108
|
+
* input is a `url`), automate's input is a previous run that already holds ready ATC cases.
|
|
109
|
+
*/
|
|
110
|
+
export const AUTOMATE_INPUT_SHAPE = {
|
|
111
|
+
run: z.string().describe("Run folder with ready ATC cases: runs/<id>, a bare <id>, or an absolute path"),
|
|
112
|
+
validate: z.boolean().optional().describe("Run the generated tests after codegen (requires a session)"),
|
|
113
|
+
session: z.string().optional().describe("Saved session name for validation"),
|
|
114
|
+
routing: z.string().optional().describe("Role-routing preset: fast (Groq worker) | volume (OpenRouter worker) | volume-fast (Anthropic codegen — faster, recommended when OpenRouter codegen overruns timeouts)"),
|
|
115
|
+
channel: z.string().optional().describe("System browser channel for validation, e.g. chrome"),
|
|
116
|
+
intoProject: z.boolean().optional().describe("Write specs into an existing Playwright project's testDir (detect playwright.config.*) instead of the run's tests/"),
|
|
117
|
+
projectDir: z.string().optional().describe("Explicit project dir for intoProject (detection searches from cwd upward when omitted)"),
|
|
118
|
+
};
|
|
119
|
+
export const AutomateInputSchema = z.object(AUTOMATE_INPUT_SHAPE);
|
|
120
|
+
export async function automateTool(input, deps = defaultDeps) {
|
|
121
|
+
const config = deps.resolveConfig({ routing: input.routing, channel: input.channel });
|
|
122
|
+
const r = await deps.runAutomate({
|
|
123
|
+
runDir: input.run,
|
|
124
|
+
config,
|
|
125
|
+
validate: input.validate,
|
|
126
|
+
sessionName: input.session,
|
|
127
|
+
intoProject: input.intoProject,
|
|
128
|
+
projectDir: input.projectDir,
|
|
129
|
+
});
|
|
130
|
+
return {
|
|
131
|
+
runDir: r.runDir,
|
|
132
|
+
specFiles: r.specFiles,
|
|
133
|
+
projectTestDir: r.projectTestDir,
|
|
134
|
+
validation: compactValidation(r.validation),
|
|
135
|
+
cost: r.cost,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+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e/parse-aria.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA6CtD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"parse-aria.d.ts","sourceRoot":"","sources":["../../src/observe/parse-aria.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA6CtD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAgC5D"}
|
|
@@ -54,8 +54,17 @@ export function parseAriaSnapshot(aria) {
|
|
|
54
54
|
if (!line.startsWith("- "))
|
|
55
55
|
continue;
|
|
56
56
|
const content = line.slice(2).trim();
|
|
57
|
-
if (content.startsWith("/"))
|
|
58
|
-
|
|
57
|
+
if (content.startsWith("/")) {
|
|
58
|
+
// Property line (/url, /checked, /disabled…). Capture /url onto the preceding element (its link)
|
|
59
|
+
// so crawl can dedup links by (name, href) — #102. Other properties are skipped.
|
|
60
|
+
const last = out[out.length - 1];
|
|
61
|
+
if (content.startsWith("/url") && last) {
|
|
62
|
+
const u = content.slice(4).replace(/^:\s*/, "").replace(/^"|"$/g, "").trim();
|
|
63
|
+
if (u)
|
|
64
|
+
last.url = u;
|
|
65
|
+
}
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
59
68
|
const role = content.match(/^([a-zA-Z][\w-]*)/)?.[1];
|
|
60
69
|
if (!role || role === "text")
|
|
61
70
|
continue; // text node or unparseable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-aria.js","sourceRoot":"","sources":["../../src/observe/parse-aria.ts"],"names":[],"mappings":"AAEA,+DAA+D;AAC/D,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,QAAQ;IACR,MAAM;IACN,SAAS;IACT,UAAU;IACV,OAAO;IACP,UA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C,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;gBACvC,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC7E,IAAI,CAAC;oBAAE,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;YACtB,CAAC;YACD,SAAS;QACX,CAAC;QAED,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,MAAM;YAAE,SAAS,CAAC,2BAA2B;QAEnE,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,8FAA8F;QAC9F,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3D,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC,IAAI,CAAC,CAAC;QACP,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,SAAS,IAAI,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;IACrG,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { FileBlob } from "../codegen/index.js";
|
|
2
|
+
/** Playwright config filenames, in the order Playwright itself resolves them. */
|
|
3
|
+
export declare const PW_CONFIG_NAMES: readonly ["playwright.config.ts", "playwright.config.js", "playwright.config.mjs", "playwright.config.cjs"];
|
|
4
|
+
/** A spec filename: `<name>.spec.ts` or `<name>.test.ts` (the infix Cairn writes). */
|
|
5
|
+
export type SpecSuffix = ".spec.ts" | ".test.ts";
|
|
6
|
+
export interface ProjectTarget {
|
|
7
|
+
/** Absolute directory the project's runner discovers specs in (where Cairn writes). */
|
|
8
|
+
testDir: string;
|
|
9
|
+
/** Spec-filename suffix derived from the project's `testMatch` (default `.spec.ts`). */
|
|
10
|
+
specSuffix: SpecSuffix;
|
|
11
|
+
/** Absolute path to the detected `playwright.config.*` (undefined when a bare dir was given). */
|
|
12
|
+
configPath?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Does this generated file look like a runnable spec (vs a POM/helper that keeps its name)? */
|
|
15
|
+
export declare function isSpecFile(name: string): boolean;
|
|
16
|
+
/** Walk up from `startDir` (inclusive) to the filesystem root, returning the nearest Playwright config. */
|
|
17
|
+
export declare function findPlaywrightConfig(startDir: string): Promise<string | undefined>;
|
|
18
|
+
/**
|
|
19
|
+
* Best-effort parse of `testDir` + spec suffix from a Playwright config's SOURCE TEXT.
|
|
20
|
+
* `testDir` → absolute (resolved against the config's dir); a missing/non-literal value falls back to
|
|
21
|
+
* the Playwright default (the config's own directory). The suffix is `.test.ts` only when `testMatch`
|
|
22
|
+
* clearly targets `.test.` and not `.spec.`; otherwise the conventional `.spec.ts`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseConfigConventions(configText: string, configDir: string): {
|
|
25
|
+
testDir: string;
|
|
26
|
+
specSuffix: SpecSuffix;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Resolve where to write specs for an existing Playwright project.
|
|
30
|
+
* - `dir` given → search it (and up) for a config; if none, treat `dir` itself as the testDir
|
|
31
|
+
* (the explicit `--into-project ./e2e` request is honored even without a config).
|
|
32
|
+
* - no `dir` → search from `cwd` upward; returns undefined when no config exists (caller falls back
|
|
33
|
+
* to the greenfield `runs/` behavior, with a clear message — no regression).
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveProjectTarget(opts: {
|
|
36
|
+
cwd?: string;
|
|
37
|
+
dir?: string;
|
|
38
|
+
}): Promise<ProjectTarget | undefined>;
|
|
39
|
+
export interface PlannedFile {
|
|
40
|
+
/** Final relative path under the testDir (POSIX separators). */
|
|
41
|
+
rel: string;
|
|
42
|
+
content: string;
|
|
43
|
+
/** Set when a collision forced a rename (original generated path) — surfaced for logging. */
|
|
44
|
+
renamedFrom?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Pure placement planner (#51): map generated files → final relative paths under the project testDir,
|
|
48
|
+
* normalizing the spec suffix and dodging collisions. `isTaken(rel)` reports paths already present
|
|
49
|
+
* (pre-existing project files) so an existing spec is NEVER overwritten — Cairn renames its own file
|
|
50
|
+
* instead. Deterministic and side-effect-free for unit testing.
|
|
51
|
+
*/
|
|
52
|
+
export declare function planPlacement(files: FileBlob[], specSuffix: SpecSuffix, isTaken: (relPosix: string) => boolean): PlannedFile[];
|
|
53
|
+
export interface EjectResult {
|
|
54
|
+
/** Absolute paths written into the project's testDir. */
|
|
55
|
+
written: string[];
|
|
56
|
+
/** Collisions Cairn dodged by renaming its own file (original → final relative path). */
|
|
57
|
+
renamed: {
|
|
58
|
+
from: string;
|
|
59
|
+
to: string;
|
|
60
|
+
}[];
|
|
61
|
+
testDir: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Eject a generated suite into the project's testDir (#51): collision-safe, non-destructive — it
|
|
65
|
+
* never deletes or overwrites a pre-existing file (unlike the greenfield `writeSuite`, which cleans
|
|
66
|
+
* its run-private `tests/` on every attempt). Subdirectories in generated paths (e.g. POM `pages/`)
|
|
67
|
+
* are preserved; only the spec infix is normalized to the project's convention.
|
|
68
|
+
*/
|
|
69
|
+
export declare function ejectSuiteToProject(files: FileBlob[], target: ProjectTarget): Promise<EjectResult>;
|
|
70
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","s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rC,WAAW,EAAE,CAaf;AAWD,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yFAAyF;IACzF,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAsBxG"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* INT-03 (#51) — plug into existing Playwright projects.
|
|
3
|
+
*
|
|
4
|
+
* Detect a host project's Playwright setup (`playwright.config.{ts,js,mjs,cjs}`) and resolve the
|
|
5
|
+
* conventions Cairn must respect when EJECTING generated specs into it instead of the greenfield
|
|
6
|
+
* `runs/<id>/tests` folder: the `testDir` the project's runner discovers, and the spec-filename
|
|
7
|
+
* suffix (`.spec.ts` vs `.test.ts`) implied by `testMatch`.
|
|
8
|
+
*
|
|
9
|
+
* Leaf module — depends only on node fs/path (and the codegen `FileBlob` type). Detection is opt-in
|
|
10
|
+
* (the `--into-project` flag); without it nothing here runs and the greenfield path is unchanged.
|
|
11
|
+
*
|
|
12
|
+
* Config parsing is best-effort (text regex, not evaluation): a TS/JS/ESM config can't be imported
|
|
13
|
+
* cheaply and safely, so we read the well-known keys from source. A missed key falls back to the
|
|
14
|
+
* Playwright default (testDir = the config's own directory; suffix = `.spec.ts`).
|
|
15
|
+
*/
|
|
16
|
+
import { stat, readFile, mkdir, writeFile, access } from "node:fs/promises";
|
|
17
|
+
import { dirname, join, resolve, parse as parsePath } from "node:path";
|
|
18
|
+
/** Playwright config filenames, in the order Playwright itself resolves them. */
|
|
19
|
+
export const PW_CONFIG_NAMES = [
|
|
20
|
+
"playwright.config.ts",
|
|
21
|
+
"playwright.config.js",
|
|
22
|
+
"playwright.config.mjs",
|
|
23
|
+
"playwright.config.cjs",
|
|
24
|
+
];
|
|
25
|
+
/** Matches any Playwright spec/test filename so its infix+extension can be normalized to the project suffix. */
|
|
26
|
+
const SPEC_FILE_RE = /\.(spec|test)\.(c|m)?[jt]sx?$/i;
|
|
27
|
+
/** Does this generated file look like a runnable spec (vs a POM/helper that keeps its name)? */
|
|
28
|
+
export function isSpecFile(name) {
|
|
29
|
+
return SPEC_FILE_RE.test(name);
|
|
30
|
+
}
|
|
31
|
+
/** Walk up from `startDir` (inclusive) to the filesystem root, returning the nearest Playwright config. */
|
|
32
|
+
export async function findPlaywrightConfig(startDir) {
|
|
33
|
+
let dir = resolve(startDir);
|
|
34
|
+
for (;;) {
|
|
35
|
+
for (const name of PW_CONFIG_NAMES) {
|
|
36
|
+
const candidate = join(dir, name);
|
|
37
|
+
try {
|
|
38
|
+
await access(candidate);
|
|
39
|
+
return candidate;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// not here — try the next name / parent
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const parent = dirname(dir);
|
|
46
|
+
if (parent === dir)
|
|
47
|
+
return undefined; // reached the root
|
|
48
|
+
dir = parent;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Best-effort parse of `testDir` + spec suffix from a Playwright config's SOURCE TEXT.
|
|
53
|
+
* `testDir` → absolute (resolved against the config's dir); a missing/non-literal value falls back to
|
|
54
|
+
* the Playwright default (the config's own directory). The suffix is `.test.ts` only when `testMatch`
|
|
55
|
+
* clearly targets `.test.` and not `.spec.`; otherwise the conventional `.spec.ts`.
|
|
56
|
+
*/
|
|
57
|
+
export function parseConfigConventions(configText, configDir) {
|
|
58
|
+
// testDir: '...' / testDir: "..." / testDir: `...` (string literals only — best effort)
|
|
59
|
+
const testDirRel = /testDir\s*:\s*(['"`])([^'"`]+)\1/.exec(configText)?.[2];
|
|
60
|
+
const testDir = testDirRel ? resolve(configDir, testDirRel) : resolve(configDir);
|
|
61
|
+
// testMatch can be a string, RegExp, or array (single- or multi-line). We only flip to `.test.ts`
|
|
62
|
+
// when the value clearly mentions `test` and NOT `spec` — a safe, conservative read of a ~160-char
|
|
63
|
+
// window after the key (default stays `.spec.ts`). Anything ambiguous keeps the convention.
|
|
64
|
+
let specSuffix = ".spec.ts";
|
|
65
|
+
const keyIdx = configText.search(/testMatch\s*:/);
|
|
66
|
+
if (keyIdx >= 0) {
|
|
67
|
+
const window = configText.slice(keyIdx, keyIdx + 160);
|
|
68
|
+
const mentionsTest = /\.test\.|\btest\b/i.test(window);
|
|
69
|
+
const mentionsSpec = /\.spec\.|\bspec\b/i.test(window);
|
|
70
|
+
if (mentionsTest && !mentionsSpec)
|
|
71
|
+
specSuffix = ".test.ts";
|
|
72
|
+
}
|
|
73
|
+
return { testDir, specSuffix };
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Resolve where to write specs for an existing Playwright project.
|
|
77
|
+
* - `dir` given → search it (and up) for a config; if none, treat `dir` itself as the testDir
|
|
78
|
+
* (the explicit `--into-project ./e2e` request is honored even without a config).
|
|
79
|
+
* - no `dir` → search from `cwd` upward; returns undefined when no config exists (caller falls back
|
|
80
|
+
* to the greenfield `runs/` behavior, with a clear message — no regression).
|
|
81
|
+
*/
|
|
82
|
+
export async function resolveProjectTarget(opts) {
|
|
83
|
+
const startDir = resolve(opts.dir ?? opts.cwd ?? process.cwd());
|
|
84
|
+
const configPath = await findPlaywrightConfig(startDir);
|
|
85
|
+
if (configPath) {
|
|
86
|
+
const text = await readFile(configPath, "utf8").catch(() => "");
|
|
87
|
+
const { testDir, specSuffix } = parseConfigConventions(text, dirname(configPath));
|
|
88
|
+
return { testDir, specSuffix, configPath };
|
|
89
|
+
}
|
|
90
|
+
if (opts.dir) {
|
|
91
|
+
// Explicit target dir without a config: write there with the default suffix.
|
|
92
|
+
return { testDir: resolve(opts.dir), specSuffix: ".spec.ts" };
|
|
93
|
+
}
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
/** Normalize a generated filename to the project's spec suffix; non-spec files (POM/helpers) keep their name. */
|
|
97
|
+
function applySuffix(rel, suffix) {
|
|
98
|
+
if (!isSpecFile(rel))
|
|
99
|
+
return rel;
|
|
100
|
+
return rel.replace(SPEC_FILE_RE, suffix);
|
|
101
|
+
}
|
|
102
|
+
/** Insert a `.cairn`/`.cairn-N` disambiguator before the spec infix or extension to dodge a collision. */
|
|
103
|
+
function disambiguate(rel, attempt) {
|
|
104
|
+
const tag = attempt === 1 ? "cairn" : `cairn-${attempt - 1}`;
|
|
105
|
+
if (SPEC_FILE_RE.test(rel)) {
|
|
106
|
+
// foo.spec.ts → foo.cairn.spec.ts
|
|
107
|
+
return rel.replace(SPEC_FILE_RE, (m) => `.${tag}${m}`);
|
|
108
|
+
}
|
|
109
|
+
const p = parsePath(rel);
|
|
110
|
+
const dir = p.dir ? `${p.dir}/` : "";
|
|
111
|
+
return `${dir}${p.name}.${tag}${p.ext}`;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Pure placement planner (#51): map generated files → final relative paths under the project testDir,
|
|
115
|
+
* normalizing the spec suffix and dodging collisions. `isTaken(rel)` reports paths already present
|
|
116
|
+
* (pre-existing project files) so an existing spec is NEVER overwritten — Cairn renames its own file
|
|
117
|
+
* instead. Deterministic and side-effect-free for unit testing.
|
|
118
|
+
*/
|
|
119
|
+
export function planPlacement(files, specSuffix, isTaken) {
|
|
120
|
+
const used = new Set();
|
|
121
|
+
const taken = (rel) => used.has(rel) || isTaken(rel);
|
|
122
|
+
const out = [];
|
|
123
|
+
for (const f of files) {
|
|
124
|
+
const normalized = applySuffix(f.path.replace(/\\/g, "/"), specSuffix);
|
|
125
|
+
let rel = normalized;
|
|
126
|
+
let attempt = 0;
|
|
127
|
+
while (taken(rel))
|
|
128
|
+
rel = disambiguate(normalized, ++attempt);
|
|
129
|
+
used.add(rel);
|
|
130
|
+
out.push({ rel, content: f.content, ...(rel !== normalized ? { renamedFrom: f.path } : {}) });
|
|
131
|
+
}
|
|
132
|
+
return out;
|
|
133
|
+
}
|
|
134
|
+
async function pathExists(p) {
|
|
135
|
+
try {
|
|
136
|
+
await stat(p);
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Eject a generated suite into the project's testDir (#51): collision-safe, non-destructive — it
|
|
145
|
+
* never deletes or overwrites a pre-existing file (unlike the greenfield `writeSuite`, which cleans
|
|
146
|
+
* its run-private `tests/` on every attempt). Subdirectories in generated paths (e.g. POM `pages/`)
|
|
147
|
+
* are preserved; only the spec infix is normalized to the project's convention.
|
|
148
|
+
*/
|
|
149
|
+
export async function ejectSuiteToProject(files, target) {
|
|
150
|
+
await mkdir(target.testDir, { recursive: true });
|
|
151
|
+
const used = new Set(); // names placed within THIS batch (avoid intra-batch collisions)
|
|
152
|
+
const written = [];
|
|
153
|
+
const renamed = [];
|
|
154
|
+
for (const f of files) {
|
|
155
|
+
const normalized = applySuffix(f.path.replace(/\\/g, "/"), target.specSuffix);
|
|
156
|
+
// A path is free when it is neither used in this batch nor already present on disk — so a
|
|
157
|
+
// pre-existing project file is never overwritten; Cairn disambiguates its own file instead.
|
|
158
|
+
let rel = normalized;
|
|
159
|
+
let attempt = 0;
|
|
160
|
+
while (used.has(rel) || (await pathExists(resolve(target.testDir, rel)))) {
|
|
161
|
+
rel = disambiguate(normalized, ++attempt);
|
|
162
|
+
}
|
|
163
|
+
used.add(rel);
|
|
164
|
+
const abs = resolve(target.testDir, rel);
|
|
165
|
+
await mkdir(dirname(abs), { recursive: true });
|
|
166
|
+
await writeFile(abs, f.content, "utf8");
|
|
167
|
+
written.push(abs);
|
|
168
|
+
if (rel !== normalized)
|
|
169
|
+
renamed.push({ from: f.path, to: rel });
|
|
170
|
+
}
|
|
171
|
+
return { written, renamed, testDir: target.testDir };
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/project/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAGvE,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,sBAAsB;IACtB,sBAAsB;IACtB,uBAAuB;IACvB,uBAAuB;CACf,CAAC;AAcX,gHAAgH;AAChH,MAAM,YAAY,GAAG,gCAAgC,CAAC;AAEtD,gGAAgG;AAChG,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,2GAA2G;AAC3G,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,QAAgB;IACzD,IAAI,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5B,SAAS,CAAC;QACR,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;YACnC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAClC,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;gBACxB,OAAO,SAAS,CAAC;YACnB,CAAC;YAAC,MAAM,CAAC;gBACP,wCAAwC;YAC1C,CAAC;QACH,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,SAAS,CAAC,CAAC,mBAAmB;QACzD,GAAG,GAAG,MAAM,CAA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EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Page analysis prompt (identifyElements). New (not from qa-skills).
|
|
3
3
|
* The vision image is passed as a separate content block; this is the text part.
|
|
4
4
|
*/
|
|
5
|
-
export declare const IDENTIFY_ELEMENTS = "You are an experienced QA engineer. Analyze the web page.\n\nARIA snapshot:\n{{ariaYaml}}\n\nDetected elements (ref \u00B7 role \u00B7 name):\n{{elements}}\n\nTasks:\n1. pageSemantics \u2014 briefly (1\u20132 sentences) describe what this screen is and its main purpose.\n2. primaryRefs \u2014 pick the refs of the most test-worthy elements. Use ONLY refs from the provided
|
|
5
|
+
export declare const IDENTIFY_ELEMENTS = "You are an experienced QA engineer. Analyze the web page.\n\nARIA snapshot:\n{{ariaYaml}}\n\nDetected elements (ref \u00B7 role \u00B7 name):\n{{elements}}\n\n{{goal}}\n\nTasks:\n1. pageSemantics \u2014 briefly (1\u20132 sentences) describe what this screen is and its main purpose.\n2. primaryRefs \u2014 pick the refs of the most test-worthy elements (when a GOAL is given above,\n prioritize elements relevant to it). Use ONLY refs from the provided list \u2014 do not invent new\n ones or change them.\n3. viewSwitchers \u2014 refs of view switchers: tabs, wizard steps, filter/mode toggles, form switchers \u2014\n whose click OPENS DIFFERENT content (rather than performing an action). Only from the provided list; empty if none.\n\nReturn structured output.";
|
|
6
6
|
//# sourceMappingURL=identify-elements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identify-elements.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/identify-elements.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"identify-elements.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/identify-elements.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,uwBAkBJ,CAAC"}
|
|
@@ -10,10 +10,13 @@ ARIA snapshot:
|
|
|
10
10
|
Detected elements (ref · role · name):
|
|
11
11
|
{{elements}}
|
|
12
12
|
|
|
13
|
+
{{goal}}
|
|
14
|
+
|
|
13
15
|
Tasks:
|
|
14
16
|
1. pageSemantics — briefly (1–2 sentences) describe what this screen is and its main purpose.
|
|
15
|
-
2. primaryRefs — pick the refs of the most test-worthy elements
|
|
16
|
-
list — do not invent new
|
|
17
|
+
2. primaryRefs — pick the refs of the most test-worthy elements (when a GOAL is given above,
|
|
18
|
+
prioritize elements relevant to it). Use ONLY refs from the provided list — do not invent new
|
|
19
|
+
ones or change them.
|
|
17
20
|
3. viewSwitchers — refs of view switchers: tabs, wizard steps, filter/mode toggles, form switchers —
|
|
18
21
|
whose click OPENS DIFFERENT content (rather than performing an action). Only from the provided list; empty if none.
|
|
19
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identify-elements.js","sourceRoot":"","sources":["../../../src/prompts/local/identify-elements.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG
|
|
1
|
+
{"version":3,"file":"identify-elements.js","sourceRoot":"","sources":["../../../src/prompts/local/identify-elements.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;0BAkBP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/index.ts"],"names":[],"mappings":"AAYA,iFAAiF;AACjF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAYhD,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { QA_TESTCASE_FROM_UI } from "./qa-testcase-from-ui.js";
|
|
2
2
|
import { QA_MANUAL_TEST_DESIGNER } from "./qa-manual-test-designer.js";
|
|
3
|
+
import { QA_CASE_CRITIQUE } from "./qa-case-critique.js";
|
|
4
|
+
import { QA_JOURNEY_FROM_FLOW } from "./qa-journey-from-flow.js";
|
|
5
|
+
import { QA_SETUP_PLANNER } from "./qa-setup-planner.js";
|
|
6
|
+
import { QA_GAP_CASES } from "./qa-gap-cases.js";
|
|
3
7
|
import { QA_PLAYWRIGHT_TS_WRITER } from "./qa-playwright-ts-writer.js";
|
|
4
8
|
import { IDENTIFY_ELEMENTS } from "./identify-elements.js";
|
|
5
9
|
import { JUDGE_TEST_CASES } from "./judge-test-cases.js";
|
|
@@ -9,6 +13,10 @@ import { PILOT_REVIEW } from "./pilot-review.js";
|
|
|
9
13
|
export const LOCAL_PROMPTS = {
|
|
10
14
|
"qa-testcase-from-ui": QA_TESTCASE_FROM_UI,
|
|
11
15
|
"qa-manual-test-designer": QA_MANUAL_TEST_DESIGNER,
|
|
16
|
+
"qa-case-critique": QA_CASE_CRITIQUE,
|
|
17
|
+
"qa-journey-from-flow": QA_JOURNEY_FROM_FLOW,
|
|
18
|
+
"qa-setup-planner": QA_SETUP_PLANNER,
|
|
19
|
+
"qa-gap-cases": QA_GAP_CASES,
|
|
12
20
|
"qa-playwright-ts-writer": QA_PLAYWRIGHT_TS_WRITER,
|
|
13
21
|
"identify-elements": IDENTIFY_ELEMENTS,
|
|
14
22
|
"judge-test-cases": JUDGE_TEST_CASES,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/local/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;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a,GAA2B;IACnD,qBAAqB,EAAE,mBAAmB;IAC1C,yBAAyB,EAAE,uBAAuB;IAClD,kBAAkB,EAAE,gBAAgB;IACpC,sBAAsB,EAAE,oBAAoB;IAC5C,kBAAkB,EAAE,gBAAgB;IACpC,cAAc,EAAE,YAAY;IAC5B,yBAAyB,EAAE,uBAAuB;IAClD,mBAAmB,EAAE,iBAAiB;IACtC,kBAAkB,EAAE,gBAAgB;IACpC,0BAA0B,EAAE,wBAAwB;IACpD,cAAc,EAAE,YAAY;CAC7B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Pilot supervisor prompt (idea from explorbot): holistic run verdict. */
|
|
2
|
-
export declare const PILOT_REVIEW = "You are the Pilot supervisor of a QA run. Review the result and issue a holistic verdict.\n\nPage: {{pageSemantics}}\nValidation: {{validation}}\nTest cases:\n{{cases}}\n\nReturn:\n- verdict: \"pass\" (run is sufficient and high-quality) | \"needs-work\" (gaps exist but not critical) | \"fail\" (serious problems);\n- reason: ONE sentence \u2014 the main basis for the verdict;\n- guidance: ONE concrete next step to improve.";
|
|
2
|
+
export declare const PILOT_REVIEW = "You are the Pilot supervisor of a QA run. Review the result and issue a holistic verdict.\n\nPage: {{pageSemantics}}\nValidation: {{validation}}\nTest cases:\n{{cases}}\n\nReturn:\n- verdict: \"pass\" (run is sufficient and high-quality) | \"needs-work\" (gaps exist but not critical) | \"fail\" (serious problems);\n- reason: ONE sentence \u2014 the main basis for the verdict;\n- guidance: ONE concrete next step to improve;\n- entity: the NAME of the entity this run created or edited (e.g. the record/item title), or \"\" if the run was read-only and created nothing. Do NOT invent a name \u2014 use only what the cases above actually reference.";
|
|
3
3
|
//# sourceMappingURL=pilot-review.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pilot-review.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/pilot-review.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"pilot-review.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/pilot-review.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,eAAO,MAAM,YAAY,8oBAW8L,CAAC"}
|
|
@@ -9,5 +9,6 @@ Test cases:
|
|
|
9
9
|
Return:
|
|
10
10
|
- verdict: "pass" (run is sufficient and high-quality) | "needs-work" (gaps exist but not critical) | "fail" (serious problems);
|
|
11
11
|
- reason: ONE sentence — the main basis for the verdict;
|
|
12
|
-
- guidance: ONE concrete next step to improve
|
|
12
|
+
- guidance: ONE concrete next step to improve;
|
|
13
|
+
- entity: the NAME of the entity this run created or edited (e.g. the record/item title), or "" if the run was read-only and created nothing. Do NOT invent a name — use only what the cases above actually reference.`;
|
|
13
14
|
//# sourceMappingURL=pilot-review.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pilot-review.js","sourceRoot":"","sources":["../../../src/prompts/local/pilot-review.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"pilot-review.js","sourceRoot":"","sources":["../../../src/prompts/local/pilot-review.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;uNAW2L,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #82 — design-time self-critique prompt. A SEPARATE, cheap worker-tier pass that reviews the
|
|
3
|
+
* first design set: it PRUNES weak cases and TOPS UP under-represented techniques. It does NOT
|
|
4
|
+
* redesign and does NOT touch the methodology / assertion-safety rules — those live in
|
|
5
|
+
* `qa-testcase-from-ui` and `qa-manual-test-designer` and stay fixed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const QA_CASE_CRITIQUE = "You are a senior QA reviewer doing a SECOND pass over an already-designed set of UI test cases.\nWrite everything (titles, steps, expected) in {{language}} \u2014 do not mix languages.\n\nCurrent test cases (id \u00B7 [technique/type] \u00B7 title \u2192 expected):\n{{cases}}\n\nUnder-represented 29119-4 techniques on this page (cover these if the page genuinely supports them \u2014 do NOT invent cases the page can't back):\n{{underrepresented}}\n\nReal element refs you may reference (use ONLY these \u2014 never invent refs):\n{{elements}}\n\nDo TWO things:\n1. PRUNE \u2014 list the ids of cases to DROP, each with a one-line reason. Drop a case ONLY if it is:\n - trivial (asserts nothing meaningful, e.g. \"page loads\"),\n - contradictory with another case (e.g. two cases expect opposite states of the same toggle from a clean start), or\n - not verifiable (its \"expected\" cannot be objectively checked).\n When in doubt, KEEP the case \u2014 pruning is conservative.\n2. TOP UP \u2014 add NEW cases ONLY for the under-represented techniques above, where the page supports them.\n Each new case follows the SAME rules as the original design:\n - one logical check (one expected), independent, starting from a clean page;\n - read-only by default \u2014 for destructive/irreversible controls only check visibility, never perform the action;\n - real element labels in steps; elementRefs taken ONLY from the refs listed above.\n Add nothing if the techniques cannot be honestly covered \u2014 an empty top-up is a valid answer.\n\nEach new case has: title, technique (one of the under-represented ones), kind (\"static\"|\"active\"),\ntype (\"Positive\"|\"Negative\"), execution (\"auto\"|\"manual\"), preconditions, steps, expected, priority, elementRefs.";
|
|
8
|
+
//# sourceMappingURL=qa-case-critique.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qa-case-critique.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-case-critique.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,8vDA0BqF,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #82 — design-time self-critique prompt. A SEPARATE, cheap worker-tier pass that reviews the
|
|
3
|
+
* first design set: it PRUNES weak cases and TOPS UP under-represented techniques. It does NOT
|
|
4
|
+
* redesign and does NOT touch the methodology / assertion-safety rules — those live in
|
|
5
|
+
* `qa-testcase-from-ui` and `qa-manual-test-designer` and stay fixed.
|
|
6
|
+
*/
|
|
7
|
+
export const QA_CASE_CRITIQUE = `You are a senior QA reviewer doing a SECOND pass over an already-designed set of UI test cases.
|
|
8
|
+
Write everything (titles, steps, expected) in {{language}} — do not mix languages.
|
|
9
|
+
|
|
10
|
+
Current test cases (id · [technique/type] · title → expected):
|
|
11
|
+
{{cases}}
|
|
12
|
+
|
|
13
|
+
Under-represented 29119-4 techniques on this page (cover these if the page genuinely supports them — do NOT invent cases the page can't back):
|
|
14
|
+
{{underrepresented}}
|
|
15
|
+
|
|
16
|
+
Real element refs you may reference (use ONLY these — never invent refs):
|
|
17
|
+
{{elements}}
|
|
18
|
+
|
|
19
|
+
Do TWO things:
|
|
20
|
+
1. PRUNE — list the ids of cases to DROP, each with a one-line reason. Drop a case ONLY if it is:
|
|
21
|
+
- trivial (asserts nothing meaningful, e.g. "page loads"),
|
|
22
|
+
- contradictory with another case (e.g. two cases expect opposite states of the same toggle from a clean start), or
|
|
23
|
+
- not verifiable (its "expected" cannot be objectively checked).
|
|
24
|
+
When in doubt, KEEP the case — pruning is conservative.
|
|
25
|
+
2. TOP UP — add NEW cases ONLY for the under-represented techniques above, where the page supports them.
|
|
26
|
+
Each new case follows the SAME rules as the original design:
|
|
27
|
+
- one logical check (one expected), independent, starting from a clean page;
|
|
28
|
+
- read-only by default — for destructive/irreversible controls only check visibility, never perform the action;
|
|
29
|
+
- real element labels in steps; elementRefs taken ONLY from the refs listed above.
|
|
30
|
+
Add nothing if the techniques cannot be honestly covered — an empty top-up is a valid answer.
|
|
31
|
+
|
|
32
|
+
Each new case has: title, technique (one of the under-represented ones), kind ("static"|"active"),
|
|
33
|
+
type ("Positive"|"Negative"), execution ("auto"|"manual"), preconditions, steps, expected, priority, elementRefs.`;
|
|
34
|
+
//# sourceMappingURL=qa-case-critique.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qa-case-critique.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-case-critique.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;kHA0BkF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #61 — gap-case suggester. Given the observed-but-untested interactive elements, propose test cases
|
|
3
|
+
* that close the gaps. Worker-tier. Output is treated as SUGGESTIONS (gap- id prefix). Does not touch
|
|
4
|
+
* the design methodology — it reuses the same case shape, scoped to the untested surface.
|
|
5
|
+
*/
|
|
6
|
+
export declare const QA_GAP_CASES = "You are a QA engineer reviewing test COVERAGE. Below are interactive elements that were observed on the app but are NOT referenced by any existing test case \u2014 the coverage gaps.\nWrite all titles, steps, expected in {{language}} \u2014 do not mix languages.\n\nPage purpose:\n{{pageSemantics}}\n\nUntested elements (ref \u00B7 role \u00B7 name \u00B7 page \u2014 why it matters). In elementRefs use ONLY these refs:\n{{gaps}}\n\nSuggest focused test cases that close these gaps. For each case: title, technique (29119-4), kind (\"static\"|\"active\"), type (\"Positive\"|\"Negative\"), execution (\"auto\"|\"manual\"), preconditions, steps (real labels), expected (verifiable), priority, elementRefs (only from the list above).\n\nRULES:\n- Read-only by default: assert visibility/state. For destructive/irreversible controls (Delete, Submit that writes, Log out) only assert VISIBLE \u2014 never perform the action.\n- One logical check per case; independent; start from a clean page.\n- Only reference the untested refs above \u2014 do not invent elements or re-test already-covered ones.\n- These are SUGGESTIONS to fill coverage gaps; keep them concrete and runnable.";
|
|
7
|
+
//# sourceMappingURL=qa-gap-cases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qa-gap-cases.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-gap-cases.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,YAAY,6pCAeuD,CAAC"}
|