@elench/testkit 0.1.109 → 0.1.110
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/lib/cli/assistant/app.mjs +19 -5
- package/lib/cli/assistant/quality-signal-strip.mjs +103 -0
- package/lib/cli/assistant/transcript-text.mjs +2 -1
- package/lib/cli/assistant/view-model.mjs +79 -0
- package/node_modules/@elench/next-analysis/package.json +1 -1
- package/node_modules/@elench/testkit-bridge/package.json +2 -2
- package/node_modules/@elench/testkit-protocol/package.json +1 -1
- package/node_modules/@elench/ts-analysis/package.json +1 -1
- package/package.json +5 -5
- package/packages/testkit-bridge/node_modules/@elench/testkit-protocol/dist/index.d.ts +188 -0
- package/packages/testkit-bridge/node_modules/@elench/testkit-protocol/dist/index.d.ts.map +1 -0
- package/packages/testkit-bridge/node_modules/@elench/testkit-protocol/dist/index.js +293 -0
- package/packages/testkit-bridge/node_modules/@elench/testkit-protocol/dist/index.js.map +1 -0
- package/packages/testkit-bridge/node_modules/@elench/testkit-protocol/package.json +25 -0
- package/node_modules/es-toolkit/CHANGELOG.md +0 -801
- package/node_modules/es-toolkit/src/compat/_internal/Equals.d.ts +0 -1
- package/node_modules/es-toolkit/src/compat/_internal/IsWritable.d.ts +0 -3
- package/node_modules/es-toolkit/src/compat/_internal/MutableList.d.ts +0 -4
- package/node_modules/es-toolkit/src/compat/_internal/RejectReadonly.d.ts +0 -4
- package/node_modules/esprima/ChangeLog +0 -235
|
@@ -5,6 +5,7 @@ import { RunTreeView } from "../components/blocks/run-tree.mjs";
|
|
|
5
5
|
import { CodeBlock } from "./code-block.mjs";
|
|
6
6
|
import { getComposerDisplayModel } from "./composer.mjs";
|
|
7
7
|
import { MarkdownBlock } from "./markdown-block.mjs";
|
|
8
|
+
import { QualitySignalStrip } from "./quality-signal-strip.mjs";
|
|
8
9
|
import { buildAssistantViewModel } from "./view-model.mjs";
|
|
9
10
|
import { truncateText, wrapText } from "../terminal/layout.mjs";
|
|
10
11
|
|
|
@@ -68,6 +69,7 @@ export function AssistantApp({
|
|
|
68
69
|
onRequestClose,
|
|
69
70
|
})
|
|
70
71
|
: null,
|
|
72
|
+
createElement(HeaderChrome, { view }),
|
|
71
73
|
view.blocks.length === 0
|
|
72
74
|
? createElement(WelcomePanel, { view })
|
|
73
75
|
: createElement(Transcript, { view }),
|
|
@@ -103,6 +105,21 @@ export function AssistantApp({
|
|
|
103
105
|
);
|
|
104
106
|
}
|
|
105
107
|
|
|
108
|
+
function HeaderChrome({ view }) {
|
|
109
|
+
const provider = view.welcome.rows.find(([label]) => label === "Provider")?.[1] || "";
|
|
110
|
+
return createElement(
|
|
111
|
+
Box,
|
|
112
|
+
{ flexDirection: "column" },
|
|
113
|
+
createElement(Text, null, bold(view.title)),
|
|
114
|
+
provider ? createElement(Text, null, dim(provider)) : null,
|
|
115
|
+
createElement(QualitySignalStrip, {
|
|
116
|
+
signal: view.qualitySignal,
|
|
117
|
+
width: view.terminalWidth,
|
|
118
|
+
}),
|
|
119
|
+
createElement(Text, null, "")
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
106
123
|
function AssistantInputHandler({ assistantState, snapshot, onRequestClose }) {
|
|
107
124
|
const { exit } = useApp();
|
|
108
125
|
|
|
@@ -154,6 +171,7 @@ function AssistantInputHandler({ assistantState, snapshot, onRequestClose }) {
|
|
|
154
171
|
}
|
|
155
172
|
|
|
156
173
|
function WelcomePanel({ view }) {
|
|
174
|
+
const rows = view.welcome.rows.filter(([label]) => label !== "Provider");
|
|
157
175
|
return createElement(
|
|
158
176
|
Box,
|
|
159
177
|
{
|
|
@@ -162,10 +180,9 @@ function WelcomePanel({ view }) {
|
|
|
162
180
|
paddingLeft: 1,
|
|
163
181
|
paddingRight: 1,
|
|
164
182
|
},
|
|
165
|
-
createElement(Text, null, bold(view.title)),
|
|
166
183
|
createElement(Text, null, dim(view.welcome.subtitle)),
|
|
167
184
|
createElement(Text, null, ""),
|
|
168
|
-
...
|
|
185
|
+
...rows.map(([label, value]) => (
|
|
169
186
|
createElement(Text, { key: label }, `${padLabel(label)} ${colorWelcomeValue(label, value)}`)
|
|
170
187
|
)),
|
|
171
188
|
createElement(Text, null, ""),
|
|
@@ -180,9 +197,6 @@ function Transcript({ view }) {
|
|
|
180
197
|
return createElement(
|
|
181
198
|
Box,
|
|
182
199
|
{ flexDirection: "column" },
|
|
183
|
-
createElement(Text, null, bold(view.title)),
|
|
184
|
-
createElement(Text, null, dim(view.welcome.rows.find(([label]) => label === "Provider")?.[1] || "")),
|
|
185
|
-
createElement(Text, null, ""),
|
|
186
200
|
view.notice ? createElement(Text, null, yellow(view.notice)) : null,
|
|
187
201
|
...view.blocks.flatMap((block) => renderBlock(block, view))
|
|
188
202
|
);
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React, { createElement } from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { cyan, dim, green, red, yellow } from "../terminal/colors.mjs";
|
|
4
|
+
import { measureWidth, truncateText } from "../terminal/layout.mjs";
|
|
5
|
+
|
|
6
|
+
const LABEL_ITEM_SEPARATOR = " ";
|
|
7
|
+
const ITEM_SEPARATOR = " · ";
|
|
8
|
+
const MIN_TRUNCATED_ITEM_WIDTH = 4;
|
|
9
|
+
|
|
10
|
+
export function fitQualitySignal(signal, { width = 100 } = {}) {
|
|
11
|
+
const availableWidth = Math.max(0, Number(width) || 0);
|
|
12
|
+
const label = normalizeText(signal?.label) || "Quality signal";
|
|
13
|
+
const items = normalizeItems(signal?.items);
|
|
14
|
+
if (availableWidth <= 0) return { label: "", items: [] };
|
|
15
|
+
if (items.length === 0) {
|
|
16
|
+
return {
|
|
17
|
+
label: truncateText(label, availableWidth),
|
|
18
|
+
items: [],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
for (let count = items.length; count >= 1; count -= 1) {
|
|
23
|
+
const candidate = {
|
|
24
|
+
label,
|
|
25
|
+
items: items.slice(0, count),
|
|
26
|
+
};
|
|
27
|
+
if (measureWidth(formatQualitySignalText(candidate)) <= availableWidth) return candidate;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const firstItemWidth = availableWidth - measureWidth(label) - measureWidth(LABEL_ITEM_SEPARATOR);
|
|
31
|
+
if (firstItemWidth >= MIN_TRUNCATED_ITEM_WIDTH) {
|
|
32
|
+
return {
|
|
33
|
+
label,
|
|
34
|
+
items: [
|
|
35
|
+
{
|
|
36
|
+
...items[0],
|
|
37
|
+
text: truncateText(items[0].text, firstItemWidth),
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
label: truncateText(label, availableWidth),
|
|
45
|
+
items: [],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function formatQualitySignalText(signal) {
|
|
50
|
+
const label = normalizeText(signal?.label) || "Quality signal";
|
|
51
|
+
const items = normalizeItems(signal?.items);
|
|
52
|
+
if (items.length === 0) return label;
|
|
53
|
+
return `${label}${LABEL_ITEM_SEPARATOR}${items.map((item) => item.text).join(ITEM_SEPARATOR)}`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function QualitySignalStrip({ signal, width = 100 } = {}) {
|
|
57
|
+
const fitted = fitQualitySignal(signal, { width });
|
|
58
|
+
if (!fitted.label) return null;
|
|
59
|
+
return createElement(
|
|
60
|
+
Box,
|
|
61
|
+
{
|
|
62
|
+
height: 1,
|
|
63
|
+
flexDirection: "row",
|
|
64
|
+
},
|
|
65
|
+
createElement(
|
|
66
|
+
Text,
|
|
67
|
+
null,
|
|
68
|
+
dim(fitted.label),
|
|
69
|
+
fitted.items.length > 0 ? LABEL_ITEM_SEPARATOR : "",
|
|
70
|
+
...fitted.items.flatMap((item, index) => [
|
|
71
|
+
index > 0 ? dim(ITEM_SEPARATOR) : "",
|
|
72
|
+
colorQualitySignalItem(item),
|
|
73
|
+
])
|
|
74
|
+
)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function normalizeItems(items) {
|
|
79
|
+
return (Array.isArray(items) ? items : [])
|
|
80
|
+
.map((item) => ({
|
|
81
|
+
id: normalizeText(item?.id),
|
|
82
|
+
text: normalizeText(item?.text),
|
|
83
|
+
tone: normalizeTone(item?.tone),
|
|
84
|
+
}))
|
|
85
|
+
.filter((item) => item.text);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function normalizeText(value) {
|
|
89
|
+
return String(value ?? "").replace(/\s+/g, " ").trim();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function normalizeTone(value) {
|
|
93
|
+
if (value === "good" || value === "warning" || value === "danger" || value === "progress") return value;
|
|
94
|
+
return "neutral";
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function colorQualitySignalItem(item) {
|
|
98
|
+
if (item.tone === "good") return green(item.text);
|
|
99
|
+
if (item.tone === "warning") return yellow(item.text);
|
|
100
|
+
if (item.tone === "danger") return red(item.text);
|
|
101
|
+
if (item.tone === "progress") return cyan(item.text);
|
|
102
|
+
return item.text;
|
|
103
|
+
}
|
|
@@ -3,10 +3,11 @@ import { truncateText, wrapText } from "../terminal/layout.mjs";
|
|
|
3
3
|
import { buildAssistantViewModel } from "./view-model.mjs";
|
|
4
4
|
import { renderCodeBlockText } from "./code-block.mjs";
|
|
5
5
|
import { renderMarkdownToAnsi } from "./markdown-block.mjs";
|
|
6
|
+
import { formatQualitySignalText, fitQualitySignal } from "./quality-signal-strip.mjs";
|
|
6
7
|
|
|
7
8
|
export function renderAssistantSnapshotText(snapshot, { cwd = process.cwd(), ansi = false, width = 100 } = {}) {
|
|
8
9
|
const view = buildAssistantViewModel(snapshot || {}, { cwd, terminalWidth: width });
|
|
9
|
-
const lines = [view.title, view.welcome.rows.find(([label]) => label === "Provider")?.[1] || ""]
|
|
10
|
+
const lines = [view.title, view.welcome.rows.find(([label]) => label === "Provider")?.[1] || "", formatQualitySignalText(fitQualitySignal(view.qualitySignal, { width }))]
|
|
10
11
|
.filter(Boolean);
|
|
11
12
|
for (const block of view.blocks || []) {
|
|
12
13
|
lines.push("");
|
|
@@ -12,6 +12,7 @@ export function buildAssistantViewModel(snapshot, { cwd = process.cwd(), termina
|
|
|
12
12
|
return {
|
|
13
13
|
title: `testkit · ${repoName}`,
|
|
14
14
|
welcome: buildWelcomeModel(snapshot, { cwd, providerLabel }),
|
|
15
|
+
qualitySignal: buildQualitySignal(snapshot),
|
|
15
16
|
blocks: buildTranscriptBlocks(snapshot.messages || []),
|
|
16
17
|
composer: {
|
|
17
18
|
text: snapshot.composer || "",
|
|
@@ -25,6 +26,84 @@ export function buildAssistantViewModel(snapshot, { cwd = process.cwd(), termina
|
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
export function buildQualitySignal(snapshot = {}) {
|
|
30
|
+
const summaryRows = snapshot?.run?.summaryData?.rows || snapshot?.summaryData?.rows || [];
|
|
31
|
+
const rowValue = (label) => summaryRows.find(([key]) => key === label)?.[1] || null;
|
|
32
|
+
const latestResult = rowValue("Result");
|
|
33
|
+
const summaryFiles = rowValue("Files");
|
|
34
|
+
const plannedFiles = snapshot?.run?.totalCount ? String(snapshot.run.totalCount) : null;
|
|
35
|
+
const files = summaryFiles || plannedFiles;
|
|
36
|
+
const failed = rowValue("Failed");
|
|
37
|
+
const duration = rowValue("Duration");
|
|
38
|
+
const newRegressions = rowValue("New regressions");
|
|
39
|
+
const fixedKnown = rowValue("Fixed known");
|
|
40
|
+
const contextSelection = snapshot?.context?.selection || {};
|
|
41
|
+
const items = [];
|
|
42
|
+
|
|
43
|
+
if (files && files !== "0") {
|
|
44
|
+
items.push({
|
|
45
|
+
id: summaryFiles ? "tested-files" : "planned-files",
|
|
46
|
+
text: `${files} ${summaryFiles ? "tested" : "planned"}`,
|
|
47
|
+
tone: "neutral",
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (newRegressions && newRegressions !== "0") {
|
|
52
|
+
items.push({
|
|
53
|
+
id: "new-regressions",
|
|
54
|
+
text: `${newRegressions} new regression${newRegressions === "1" ? "" : "s"}`,
|
|
55
|
+
tone: "danger",
|
|
56
|
+
});
|
|
57
|
+
} else if (fixedKnown && fixedKnown !== "0") {
|
|
58
|
+
items.push({
|
|
59
|
+
id: "fixed-known",
|
|
60
|
+
text: `${fixedKnown} fixed known`,
|
|
61
|
+
tone: "good",
|
|
62
|
+
});
|
|
63
|
+
} else if (latestResult === "PASSED") {
|
|
64
|
+
items.push({
|
|
65
|
+
id: "no-regressions",
|
|
66
|
+
text: "no regressions",
|
|
67
|
+
tone: "good",
|
|
68
|
+
});
|
|
69
|
+
} else if (latestResult === "FAILED" && failed && failed !== "0") {
|
|
70
|
+
items.push({
|
|
71
|
+
id: "failed-files",
|
|
72
|
+
text: `${failed} failed`,
|
|
73
|
+
tone: "danger",
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (latestResult) {
|
|
78
|
+
const status = latestResult === "PASSED" ? "passed" : latestResult === "FAILED" ? "failed" : latestResult.toLowerCase();
|
|
79
|
+
items.push({
|
|
80
|
+
id: "latest-status",
|
|
81
|
+
text: duration ? `${status} in ${duration}` : status,
|
|
82
|
+
tone: latestResult === "PASSED" ? "good" : latestResult === "FAILED" ? "danger" : "neutral",
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (contextSelection.filePath) {
|
|
87
|
+
items.push({
|
|
88
|
+
id: "focus",
|
|
89
|
+
text: `focus ${path.basename(contextSelection.filePath)}`,
|
|
90
|
+
tone: "progress",
|
|
91
|
+
});
|
|
92
|
+
} else if (!latestResult) {
|
|
93
|
+
items.push({
|
|
94
|
+
id: "ready",
|
|
95
|
+
text: "ready to run",
|
|
96
|
+
tone: "progress",
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
label: "Quality signal",
|
|
102
|
+
tone: latestResult === "FAILED" ? "danger" : latestResult === "PASSED" ? "good" : "neutral",
|
|
103
|
+
items,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
28
107
|
export function buildWelcomeModel(snapshot, { cwd = process.cwd(), providerLabel = null } = {}) {
|
|
29
108
|
const summaryRows = snapshot?.run?.summaryData?.rows || snapshot?.summaryData?.rows || [];
|
|
30
109
|
const rowValue = (label) => summaryRows.find(([key]) => key === label)?.[1] || null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elench/testkit-bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.110",
|
|
4
4
|
"description": "Browser bridge helpers for testkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@elench/testkit-protocol": "0.1.
|
|
25
|
+
"@elench/testkit-protocol": "0.1.110"
|
|
26
26
|
},
|
|
27
27
|
"private": false
|
|
28
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elench/testkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.110",
|
|
4
4
|
"description": "Assistant-first CLI for running, inspecting, and debugging local testkit suites",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -89,10 +89,10 @@
|
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"@babel/code-frame": "^7.29.0",
|
|
92
|
-
"@elench/next-analysis": "0.1.
|
|
93
|
-
"@elench/testkit-bridge": "0.1.
|
|
94
|
-
"@elench/testkit-protocol": "0.1.
|
|
95
|
-
"@elench/ts-analysis": "0.1.
|
|
92
|
+
"@elench/next-analysis": "0.1.110",
|
|
93
|
+
"@elench/testkit-bridge": "0.1.110",
|
|
94
|
+
"@elench/testkit-protocol": "0.1.110",
|
|
95
|
+
"@elench/ts-analysis": "0.1.110",
|
|
96
96
|
"@oclif/core": "^4.10.6",
|
|
97
97
|
"@playwright/test": "^1.52.0",
|
|
98
98
|
"esbuild": "^0.25.11",
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
export declare const TESTKIT_BROWSER_PROTOCOL_VERSION = 1;
|
|
2
|
+
export declare const TESTKIT_COVERAGE_GRAPH_VERSION = 1;
|
|
3
|
+
export type BrowserTargetKind = "testId" | "role" | "text" | "css" | "xpath" | "component";
|
|
4
|
+
export type BrowserConfidence = "low" | "medium" | "high";
|
|
5
|
+
export type BrowserFailureState = "failing" | "healthy" | "unavailable";
|
|
6
|
+
export type BrowserCoverageState = "covered" | "missing" | "unavailable";
|
|
7
|
+
export type BridgeSurfaceImportance = "critical" | "high" | "medium" | "low";
|
|
8
|
+
export type BridgeCoverageSupportKind = "direct" | "indirect" | "mixed";
|
|
9
|
+
export type CoverageNodeKind = "page_view" | "ui_surface" | "ui_action" | "client_request" | "api_route" | "server_action" | "server_capability" | "data_capability" | "test_file";
|
|
10
|
+
export type CoverageEdgeKind = "contains" | "renders" | "triggers" | "requests" | "handles" | "delegates_to" | "covers";
|
|
11
|
+
export type CoverageEvidenceSource = "convention" | "static" | "runtime";
|
|
12
|
+
export type CoverageGraphDiagnosticLevel = "info" | "warn";
|
|
13
|
+
export interface BrowserTarget {
|
|
14
|
+
kind: BrowserTargetKind;
|
|
15
|
+
value: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
confidence?: BrowserConfidence;
|
|
18
|
+
}
|
|
19
|
+
export interface BrowserMetadata {
|
|
20
|
+
label?: string;
|
|
21
|
+
origins?: string[];
|
|
22
|
+
routes?: string[];
|
|
23
|
+
targets?: BrowserTarget[];
|
|
24
|
+
}
|
|
25
|
+
export interface BrowserMetadataDocument {
|
|
26
|
+
schemaVersion: number;
|
|
27
|
+
browser: BrowserMetadata;
|
|
28
|
+
}
|
|
29
|
+
export interface CoverageGraphNode {
|
|
30
|
+
id: string;
|
|
31
|
+
kind: CoverageNodeKind;
|
|
32
|
+
service: string;
|
|
33
|
+
label: string;
|
|
34
|
+
filePath?: string;
|
|
35
|
+
route?: string;
|
|
36
|
+
method?: string;
|
|
37
|
+
path?: string;
|
|
38
|
+
target?: BrowserTarget | null;
|
|
39
|
+
metadata?: Record<string, string | number | boolean | null>;
|
|
40
|
+
}
|
|
41
|
+
export interface CoverageGraphEdge {
|
|
42
|
+
id: string;
|
|
43
|
+
kind: CoverageEdgeKind;
|
|
44
|
+
from: string;
|
|
45
|
+
to: string;
|
|
46
|
+
confidence?: BrowserConfidence;
|
|
47
|
+
metadata?: Record<string, string | number | boolean | null>;
|
|
48
|
+
}
|
|
49
|
+
export interface CoverageEvidenceDetails {
|
|
50
|
+
requestPaths?: string[];
|
|
51
|
+
route?: string;
|
|
52
|
+
targets?: BrowserTarget[];
|
|
53
|
+
}
|
|
54
|
+
export interface CoverageEvidence {
|
|
55
|
+
id: string;
|
|
56
|
+
source: CoverageEvidenceSource;
|
|
57
|
+
confidence?: BrowserConfidence;
|
|
58
|
+
service: string;
|
|
59
|
+
suiteName: string;
|
|
60
|
+
type: string;
|
|
61
|
+
testFilePath: string;
|
|
62
|
+
coveredNodeIds: string[];
|
|
63
|
+
details?: CoverageEvidenceDetails;
|
|
64
|
+
}
|
|
65
|
+
export interface CoverageGraphDiagnostic {
|
|
66
|
+
level: CoverageGraphDiagnosticLevel;
|
|
67
|
+
code: string;
|
|
68
|
+
filePath: string;
|
|
69
|
+
service: string;
|
|
70
|
+
message: string;
|
|
71
|
+
}
|
|
72
|
+
export interface CoverageGraph {
|
|
73
|
+
schemaVersion: number;
|
|
74
|
+
nodes: CoverageGraphNode[];
|
|
75
|
+
edges: CoverageGraphEdge[];
|
|
76
|
+
evidence: CoverageEvidence[];
|
|
77
|
+
diagnostics: CoverageGraphDiagnostic[];
|
|
78
|
+
}
|
|
79
|
+
export interface BridgeProductRef {
|
|
80
|
+
name: string;
|
|
81
|
+
directory: string;
|
|
82
|
+
}
|
|
83
|
+
export interface BridgeServiceRef {
|
|
84
|
+
name: string;
|
|
85
|
+
baseUrl: string;
|
|
86
|
+
origin: string;
|
|
87
|
+
}
|
|
88
|
+
export interface BrowserMatchResponse {
|
|
89
|
+
protocolVersion: number;
|
|
90
|
+
url: string;
|
|
91
|
+
origin: string;
|
|
92
|
+
route: string;
|
|
93
|
+
matched: boolean;
|
|
94
|
+
product: BridgeProductRef;
|
|
95
|
+
service: BridgeServiceRef | null;
|
|
96
|
+
}
|
|
97
|
+
export interface BridgeRunSummary {
|
|
98
|
+
artifactAvailable: boolean;
|
|
99
|
+
generatedAt: string | null;
|
|
100
|
+
status: string | null;
|
|
101
|
+
}
|
|
102
|
+
export interface BridgeSupportingTestRef {
|
|
103
|
+
service: string;
|
|
104
|
+
suite: string;
|
|
105
|
+
type: string;
|
|
106
|
+
filePath: string;
|
|
107
|
+
label: string;
|
|
108
|
+
status?: "passed" | "failed" | "skipped" | "not_run";
|
|
109
|
+
error?: string | null;
|
|
110
|
+
}
|
|
111
|
+
export interface BridgeCoverageViaNodeRef {
|
|
112
|
+
id: string;
|
|
113
|
+
kind: CoverageNodeKind;
|
|
114
|
+
label: string;
|
|
115
|
+
route?: string;
|
|
116
|
+
method?: string;
|
|
117
|
+
path?: string;
|
|
118
|
+
}
|
|
119
|
+
export interface FailureOverlayEntry {
|
|
120
|
+
id: string;
|
|
121
|
+
kind: CoverageNodeKind;
|
|
122
|
+
label: string;
|
|
123
|
+
service: string;
|
|
124
|
+
route?: string | null;
|
|
125
|
+
targets: BrowserTarget[];
|
|
126
|
+
failedTests: BridgeSupportingTestRef[];
|
|
127
|
+
viaNodes: BridgeCoverageViaNodeRef[];
|
|
128
|
+
importance?: BridgeSurfaceImportance;
|
|
129
|
+
surfaceKind?: string | null;
|
|
130
|
+
reason?: string | null;
|
|
131
|
+
}
|
|
132
|
+
export interface CoverageOverlayEntry {
|
|
133
|
+
id: string;
|
|
134
|
+
kind: CoverageNodeKind;
|
|
135
|
+
label: string;
|
|
136
|
+
service: string;
|
|
137
|
+
route?: string | null;
|
|
138
|
+
targets: BrowserTarget[];
|
|
139
|
+
supportingTests: BridgeSupportingTestRef[];
|
|
140
|
+
viaNodes: BridgeCoverageViaNodeRef[];
|
|
141
|
+
confidence: BrowserConfidence;
|
|
142
|
+
importance?: BridgeSurfaceImportance;
|
|
143
|
+
surfaceKind?: string | null;
|
|
144
|
+
supportKind?: BridgeCoverageSupportKind;
|
|
145
|
+
reason?: string | null;
|
|
146
|
+
}
|
|
147
|
+
export interface PageOverlayResponse {
|
|
148
|
+
protocolVersion: number;
|
|
149
|
+
page: {
|
|
150
|
+
url: string;
|
|
151
|
+
origin: string;
|
|
152
|
+
route: string;
|
|
153
|
+
};
|
|
154
|
+
match: BrowserMatchResponse;
|
|
155
|
+
run: BridgeRunSummary;
|
|
156
|
+
summary: {
|
|
157
|
+
failureState: BrowserFailureState;
|
|
158
|
+
coverageState: BrowserCoverageState;
|
|
159
|
+
relatedFailureCount: number;
|
|
160
|
+
relatedCoverageCount: number;
|
|
161
|
+
coverageBreakdown?: {
|
|
162
|
+
direct: number;
|
|
163
|
+
indirect: number;
|
|
164
|
+
mixed: number;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
failures: FailureOverlayEntry[];
|
|
168
|
+
coverage: CoverageOverlayEntry[];
|
|
169
|
+
}
|
|
170
|
+
export interface BridgeErrorResponse {
|
|
171
|
+
protocolVersion: number;
|
|
172
|
+
error: {
|
|
173
|
+
code: string;
|
|
174
|
+
message: string;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
export declare function normalizeBrowserTarget(value: unknown): BrowserTarget | null;
|
|
178
|
+
export declare function normalizeBrowserMetadata(value: unknown): BrowserMetadata | null;
|
|
179
|
+
export declare function normalizeBrowserMetadataDocument(value: unknown): BrowserMetadataDocument | null;
|
|
180
|
+
export declare function normalizeCoverageGraphNode(value: unknown): CoverageGraphNode | null;
|
|
181
|
+
export declare function normalizeCoverageGraphEdge(value: unknown): CoverageGraphEdge | null;
|
|
182
|
+
export declare function normalizeCoverageEvidence(value: unknown): CoverageEvidence | null;
|
|
183
|
+
export declare function normalizeCoverageGraphDiagnostic(value: unknown): CoverageGraphDiagnostic | null;
|
|
184
|
+
export declare function normalizeCoverageGraph(value: unknown): CoverageGraph | null;
|
|
185
|
+
export declare function isPageOverlayResponse(value: unknown): value is PageOverlayResponse;
|
|
186
|
+
export declare function normalizePageOverlayResponse(value: unknown): PageOverlayResponse | null;
|
|
187
|
+
export declare function createBridgeErrorResponse(code: string, message: string): BridgeErrorResponse;
|
|
188
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAClD,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,CAAC;AAC3F,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC1D,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AACzE,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAC7E,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAExE,MAAM,MAAM,gBAAgB,GACxB,WAAW,GACX,YAAY,GACZ,WAAW,GACX,gBAAgB,GAChB,WAAW,GACX,eAAe,GACf,mBAAmB,GACnB,i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