@eidra-umain/greenlight 0.1.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 +391 -0
- package/dist/browser/browser.d.ts +24 -0
- package/dist/browser/browser.d.ts.map +1 -0
- package/dist/browser/browser.js +44 -0
- package/dist/browser/browser.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +140 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/run.d.ts +9 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +277 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/config.d.ts +48 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +107 -0
- package/dist/config.js.map +1 -0
- package/dist/globals.d.ts +21 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/globals.js +24 -0
- package/dist/globals.js.map +1 -0
- package/dist/parser/loader.d.ts +7 -0
- package/dist/parser/loader.d.ts.map +1 -0
- package/dist/parser/loader.js +43 -0
- package/dist/parser/loader.js.map +1 -0
- package/dist/parser/schema.d.ts +42 -0
- package/dist/parser/schema.d.ts.map +1 -0
- package/dist/parser/schema.js +33 -0
- package/dist/parser/schema.js.map +1 -0
- package/dist/parser/steps.d.ts +13 -0
- package/dist/parser/steps.d.ts.map +1 -0
- package/dist/parser/steps.js +44 -0
- package/dist/parser/steps.js.map +1 -0
- package/dist/parser/variables.d.ts +18 -0
- package/dist/parser/variables.d.ts.map +1 -0
- package/dist/parser/variables.js +44 -0
- package/dist/parser/variables.js.map +1 -0
- package/dist/pilot/a11y-parser.d.ts +26 -0
- package/dist/pilot/a11y-parser.d.ts.map +1 -0
- package/dist/pilot/a11y-parser.js +195 -0
- package/dist/pilot/a11y-parser.js.map +1 -0
- package/dist/pilot/assertions.d.ts +30 -0
- package/dist/pilot/assertions.d.ts.map +1 -0
- package/dist/pilot/assertions.js +219 -0
- package/dist/pilot/assertions.js.map +1 -0
- package/dist/pilot/checkbox.d.ts +12 -0
- package/dist/pilot/checkbox.d.ts.map +1 -0
- package/dist/pilot/checkbox.js +104 -0
- package/dist/pilot/checkbox.js.map +1 -0
- package/dist/pilot/executor.d.ts +17 -0
- package/dist/pilot/executor.d.ts.map +1 -0
- package/dist/pilot/executor.js +462 -0
- package/dist/pilot/executor.js.map +1 -0
- package/dist/pilot/form-fields.d.ts +34 -0
- package/dist/pilot/form-fields.d.ts.map +1 -0
- package/dist/pilot/form-fields.js +139 -0
- package/dist/pilot/form-fields.js.map +1 -0
- package/dist/pilot/llm.d.ts +49 -0
- package/dist/pilot/llm.d.ts.map +1 -0
- package/dist/pilot/llm.js +188 -0
- package/dist/pilot/llm.js.map +1 -0
- package/dist/pilot/locator.d.ts +58 -0
- package/dist/pilot/locator.d.ts.map +1 -0
- package/dist/pilot/locator.js +248 -0
- package/dist/pilot/locator.js.map +1 -0
- package/dist/pilot/message-builder.d.ts +31 -0
- package/dist/pilot/message-builder.d.ts.map +1 -0
- package/dist/pilot/message-builder.js +112 -0
- package/dist/pilot/message-builder.js.map +1 -0
- package/dist/pilot/network.d.ts +23 -0
- package/dist/pilot/network.d.ts.map +1 -0
- package/dist/pilot/network.js +92 -0
- package/dist/pilot/network.js.map +1 -0
- package/dist/pilot/pilot.d.ts +27 -0
- package/dist/pilot/pilot.d.ts.map +1 -0
- package/dist/pilot/pilot.js +249 -0
- package/dist/pilot/pilot.js.map +1 -0
- package/dist/pilot/prompts.d.ts +8 -0
- package/dist/pilot/prompts.d.ts.map +1 -0
- package/dist/pilot/prompts.js +163 -0
- package/dist/pilot/prompts.js.map +1 -0
- package/dist/pilot/providers/anthropic.d.ts +6 -0
- package/dist/pilot/providers/anthropic.d.ts.map +1 -0
- package/dist/pilot/providers/anthropic.js +45 -0
- package/dist/pilot/providers/anthropic.js.map +1 -0
- package/dist/pilot/providers/gemini.d.ts +6 -0
- package/dist/pilot/providers/gemini.d.ts.map +1 -0
- package/dist/pilot/providers/gemini.js +55 -0
- package/dist/pilot/providers/gemini.js.map +1 -0
- package/dist/pilot/providers/index.d.ts +10 -0
- package/dist/pilot/providers/index.d.ts.map +1 -0
- package/dist/pilot/providers/index.js +25 -0
- package/dist/pilot/providers/index.js.map +1 -0
- package/dist/pilot/providers/openai-compatible.d.ts +7 -0
- package/dist/pilot/providers/openai-compatible.d.ts.map +1 -0
- package/dist/pilot/providers/openai-compatible.js +34 -0
- package/dist/pilot/providers/openai-compatible.js.map +1 -0
- package/dist/pilot/providers/types.d.ts +12 -0
- package/dist/pilot/providers/types.d.ts.map +1 -0
- package/dist/pilot/providers/types.js +2 -0
- package/dist/pilot/providers/types.js.map +1 -0
- package/dist/pilot/response-parser.d.ts +31 -0
- package/dist/pilot/response-parser.d.ts.map +1 -0
- package/dist/pilot/response-parser.js +188 -0
- package/dist/pilot/response-parser.js.map +1 -0
- package/dist/pilot/state.d.ts +19 -0
- package/dist/pilot/state.d.ts.map +1 -0
- package/dist/pilot/state.js +67 -0
- package/dist/pilot/state.js.map +1 -0
- package/dist/pilot/trace.d.ts +16 -0
- package/dist/pilot/trace.d.ts.map +1 -0
- package/dist/pilot/trace.js +117 -0
- package/dist/pilot/trace.js.map +1 -0
- package/dist/planner/hasher.d.ts +14 -0
- package/dist/planner/hasher.d.ts.map +1 -0
- package/dist/planner/hasher.js +21 -0
- package/dist/planner/hasher.js.map +1 -0
- package/dist/planner/plan-generator.d.ts +23 -0
- package/dist/planner/plan-generator.d.ts.map +1 -0
- package/dist/planner/plan-generator.js +56 -0
- package/dist/planner/plan-generator.js.map +1 -0
- package/dist/planner/plan-runner.d.ts +16 -0
- package/dist/planner/plan-runner.d.ts.map +1 -0
- package/dist/planner/plan-runner.js +375 -0
- package/dist/planner/plan-runner.js.map +1 -0
- package/dist/planner/plan-store.d.ts +22 -0
- package/dist/planner/plan-store.d.ts.map +1 -0
- package/dist/planner/plan-store.js +71 -0
- package/dist/planner/plan-store.js.map +1 -0
- package/dist/planner/plan-types.d.ts +64 -0
- package/dist/planner/plan-types.d.ts.map +1 -0
- package/dist/planner/plan-types.js +7 -0
- package/dist/planner/plan-types.js.map +1 -0
- package/dist/reporter/types.d.ts +130 -0
- package/dist/reporter/types.d.ts.map +1 -0
- package/dist/reporter/types.js +5 -0
- package/dist/reporter/types.js.map +1 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +23 -0
- package/dist/types.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for cached heuristic test plans.
|
|
3
|
+
* A heuristic plan is a concrete, element-bound action sequence
|
|
4
|
+
* derived from a successful discovery run, replayable without LLM calls.
|
|
5
|
+
*/
|
|
6
|
+
/** How to locate an element during cached plan replay. */
|
|
7
|
+
export interface HeuristicSelector {
|
|
8
|
+
/** ARIA role from the a11y tree (for ref-based resolution). */
|
|
9
|
+
role?: string;
|
|
10
|
+
/** Accessible name from the a11y tree. */
|
|
11
|
+
name?: string;
|
|
12
|
+
/** CSS DOM selector extracted from the element (for text-based fallback resolution). */
|
|
13
|
+
css?: string;
|
|
14
|
+
/** Zero-based index when multiple elements match the same role+name. */
|
|
15
|
+
nth?: number;
|
|
16
|
+
}
|
|
17
|
+
/** A single concrete step in a heuristic plan. */
|
|
18
|
+
export interface HeuristicStep {
|
|
19
|
+
/** The original natural-language step text. */
|
|
20
|
+
originalStep: string;
|
|
21
|
+
/** The action type (click, type, select, scroll, navigate, press, wait, assert). */
|
|
22
|
+
action: string;
|
|
23
|
+
/** Element selector — undefined for actions without a target (navigate, press, assert, etc.). */
|
|
24
|
+
selector?: HeuristicSelector;
|
|
25
|
+
/** Value: text to type, URL to navigate, key to press, scroll direction, etc. */
|
|
26
|
+
value?: string;
|
|
27
|
+
/** For autocomplete actions: the specific suggestion to select. */
|
|
28
|
+
option?: string;
|
|
29
|
+
/** For remember actions: the variable name to store the captured value. */
|
|
30
|
+
rememberAs?: string;
|
|
31
|
+
/** Assertion details for assert actions. */
|
|
32
|
+
assertion?: {
|
|
33
|
+
type: string;
|
|
34
|
+
expected: string;
|
|
35
|
+
};
|
|
36
|
+
/** For compare assertions: the comparison metadata. */
|
|
37
|
+
compare?: {
|
|
38
|
+
variable: string;
|
|
39
|
+
operator: string;
|
|
40
|
+
};
|
|
41
|
+
/** Page state after the step executed, for drift detection. */
|
|
42
|
+
postStepFingerprint: {
|
|
43
|
+
url: string;
|
|
44
|
+
title: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** A complete cached plan for one test case. */
|
|
48
|
+
export interface HeuristicPlan {
|
|
49
|
+
/** Slugified suite name (used as directory). */
|
|
50
|
+
suiteSlug: string;
|
|
51
|
+
/** Slugified test case name (used as filename). */
|
|
52
|
+
testSlug: string;
|
|
53
|
+
/** SHA-256 hash of the test case's effective definition (resolved steps). */
|
|
54
|
+
sourceHash: string;
|
|
55
|
+
/** LLM model used during the discovery run. */
|
|
56
|
+
model: string;
|
|
57
|
+
/** ISO 8601 timestamp of plan generation. */
|
|
58
|
+
generatedAt: string;
|
|
59
|
+
/** GreenLight version that generated the plan. */
|
|
60
|
+
greenlightVersion: string;
|
|
61
|
+
/** The concrete steps to replay. */
|
|
62
|
+
steps: HeuristicStep[];
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=plan-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-types.d.ts","sourceRoot":"","sources":["../../src/planner/plan-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IACjC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wFAAwF;IACxF,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC7B,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAA;IACpB,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAA;IACd,iGAAiG;IACjG,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,4CAA4C;IAC5C,SAAS,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C,uDAAuD;IACvD,OAAO,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,+DAA+D;IAC/D,mBAAmB,EAAE;QACpB,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;KACb,CAAA;CACD;AAED,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC7B,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAA;IACjB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAA;IAChB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;IAClB,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAA;IACnB,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,CAAA;IACzB,oCAAoC;IACpC,KAAK,EAAE,aAAa,EAAE,CAAA;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-types.js","sourceRoot":"","sources":["../../src/planner/plan-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared result and state types used across the Pilot, Runner, and Reporters.
|
|
3
|
+
*/
|
|
4
|
+
/** An annotated node from the accessibility tree with a stable element ref. */
|
|
5
|
+
export interface A11yNode {
|
|
6
|
+
ref: string;
|
|
7
|
+
role: string;
|
|
8
|
+
name: string;
|
|
9
|
+
level?: number;
|
|
10
|
+
url?: string;
|
|
11
|
+
children?: A11yNode[];
|
|
12
|
+
raw: string;
|
|
13
|
+
}
|
|
14
|
+
/** Complete page state captured at a point in time. */
|
|
15
|
+
export interface PageState {
|
|
16
|
+
/** Accessibility tree snapshot with element refs assigned. */
|
|
17
|
+
a11yTree: A11yNode[];
|
|
18
|
+
/** Raw aria snapshot text from Playwright. */
|
|
19
|
+
a11yRaw: string;
|
|
20
|
+
/** All visible text on the page (document.body.innerText). */
|
|
21
|
+
visibleText?: string;
|
|
22
|
+
/** Base64-encoded PNG screenshot of the viewport (only on post-action captures). */
|
|
23
|
+
screenshot?: string;
|
|
24
|
+
/** Current page URL. */
|
|
25
|
+
url: string;
|
|
26
|
+
/** Current page title. */
|
|
27
|
+
title: string;
|
|
28
|
+
/** Console messages since last capture. */
|
|
29
|
+
consoleLogs: ConsoleEntry[];
|
|
30
|
+
}
|
|
31
|
+
/** A single browser console message. */
|
|
32
|
+
export interface ConsoleEntry {
|
|
33
|
+
type: string;
|
|
34
|
+
text: string;
|
|
35
|
+
}
|
|
36
|
+
/** How an element was resolved — stored in heuristic plans for cached replay. */
|
|
37
|
+
export interface ResolvedSelector {
|
|
38
|
+
/** ARIA role from the a11y tree (for ref-based resolution). */
|
|
39
|
+
role?: string;
|
|
40
|
+
/** Accessible name from the a11y tree. */
|
|
41
|
+
name?: string;
|
|
42
|
+
/** CSS DOM selector extracted from the element (for text-based fallback). */
|
|
43
|
+
css?: string;
|
|
44
|
+
/** Zero-based index when multiple elements match the same role+name. */
|
|
45
|
+
nth?: number;
|
|
46
|
+
}
|
|
47
|
+
/** Result of executing a single action in the browser. */
|
|
48
|
+
export interface ExecutionResult {
|
|
49
|
+
/** Whether the action completed successfully. */
|
|
50
|
+
success: boolean;
|
|
51
|
+
/** Duration in milliseconds. */
|
|
52
|
+
duration: number;
|
|
53
|
+
/** Error message if the action failed. */
|
|
54
|
+
error?: string;
|
|
55
|
+
/** Selector info for the element that was acted upon (used by plan recorder). */
|
|
56
|
+
resolvedSelector?: ResolvedSelector;
|
|
57
|
+
/** For remember actions: the captured value. */
|
|
58
|
+
rememberedValue?: string;
|
|
59
|
+
}
|
|
60
|
+
/** Per-phase timing breakdown for a step. */
|
|
61
|
+
export interface StepTiming {
|
|
62
|
+
/** Time to capture page state (a11y tree + screenshot) in ms. */
|
|
63
|
+
capture: number;
|
|
64
|
+
/** Time for the LLM to return an action in ms. */
|
|
65
|
+
llm: number;
|
|
66
|
+
/** Time to execute the action in the browser in ms. */
|
|
67
|
+
execute: number;
|
|
68
|
+
/** Time to capture post-action state in ms. */
|
|
69
|
+
postCapture: number;
|
|
70
|
+
}
|
|
71
|
+
/** Result of a single step within a test case. */
|
|
72
|
+
export interface StepResult {
|
|
73
|
+
/** The plain-English step text. */
|
|
74
|
+
step: string;
|
|
75
|
+
/** The action the LLM chose. */
|
|
76
|
+
action: Action | null;
|
|
77
|
+
/** Pass or fail. */
|
|
78
|
+
status: "passed" | "failed";
|
|
79
|
+
/** Total duration for this step (LLM + execution) in ms. */
|
|
80
|
+
duration: number;
|
|
81
|
+
/** Per-phase timing breakdown. */
|
|
82
|
+
timing?: StepTiming;
|
|
83
|
+
/** Post-action screenshot (base64 PNG). */
|
|
84
|
+
screenshot?: string;
|
|
85
|
+
/** Error message if the step failed. */
|
|
86
|
+
error?: string;
|
|
87
|
+
}
|
|
88
|
+
/** Result of running a full test case (all steps). */
|
|
89
|
+
export interface TestCaseResult {
|
|
90
|
+
/** Test case name. */
|
|
91
|
+
name: string;
|
|
92
|
+
/** Overall status — failed if any step failed. */
|
|
93
|
+
status: "passed" | "failed";
|
|
94
|
+
/** Per-step results. */
|
|
95
|
+
steps: StepResult[];
|
|
96
|
+
/** Total duration in ms. */
|
|
97
|
+
duration: number;
|
|
98
|
+
/** Execution mode: "discovery" (LLM-driven) or "cached" (heuristic plan replay). */
|
|
99
|
+
mode?: "discovery" | "cached";
|
|
100
|
+
/** Whether the cached plan drifted from the actual application state. */
|
|
101
|
+
drifted?: boolean;
|
|
102
|
+
}
|
|
103
|
+
/** A structured action returned by the LLM for a single step. */
|
|
104
|
+
export interface Action {
|
|
105
|
+
/** The action type (click, type, select, scroll, navigate, wait, assert). */
|
|
106
|
+
action: string;
|
|
107
|
+
/** Element ref from the a11y tree (e.g. "e5"). */
|
|
108
|
+
ref?: string;
|
|
109
|
+
/** Visible text to target when the element is not in the a11y tree. */
|
|
110
|
+
text?: string;
|
|
111
|
+
/** Value to type, URL to navigate to, option to select, etc. */
|
|
112
|
+
value?: string;
|
|
113
|
+
/** For autocomplete actions: the specific suggestion to select (defaults to first if omitted). */
|
|
114
|
+
option?: string;
|
|
115
|
+
/** Assertion details for assert actions. */
|
|
116
|
+
assertion?: {
|
|
117
|
+
type: string;
|
|
118
|
+
expected: string;
|
|
119
|
+
};
|
|
120
|
+
/** For remember actions: the variable name to store the captured value. */
|
|
121
|
+
rememberAs?: string;
|
|
122
|
+
/** For compare assertions: reference to a remembered variable and operator. */
|
|
123
|
+
compare?: {
|
|
124
|
+
/** The remembered variable name to compare against. */
|
|
125
|
+
variable: string;
|
|
126
|
+
/** Comparison operator. */
|
|
127
|
+
operator: "less_than" | "greater_than" | "equal" | "not_equal" | "less_or_equal" | "greater_or_equal";
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/reporter/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,QAAQ;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,C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A4C;IAC5C,SAAS,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,QAAQ,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE;QACT,uDAAuD;QACvD,QAAQ,EAAE,MAAM,CAAA;QAChB,2BAA2B;QAC3B,QAAQ,EAAE,WAAW,GAAG,cAAc,GAAG,OAAO,GAAG,WAAW,GAAG,eAAe,GAAG,kBAAkB,CAAA;KACrG,CAAA;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/reporter/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types used across all GreenLight modules.
|
|
3
|
+
*/
|
|
4
|
+
/** Viewport dimensions for the browser. */
|
|
5
|
+
export interface Viewport {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}
|
|
9
|
+
/** Supported LLM provider identifiers. */
|
|
10
|
+
export type Provider = "openrouter" | "openai" | "gemini" | "claude";
|
|
11
|
+
/** Per-role model configuration (planner vs pilot can use different models). */
|
|
12
|
+
export interface ModelConfig {
|
|
13
|
+
planner: string;
|
|
14
|
+
pilot: string;
|
|
15
|
+
}
|
|
16
|
+
/** Runtime configuration resolved from CLI args + suite config. */
|
|
17
|
+
export interface RunConfig {
|
|
18
|
+
/** Path(s) to suite YAML files. */
|
|
19
|
+
suiteFiles: string[];
|
|
20
|
+
/** Filter: only run test cases matching this name. */
|
|
21
|
+
testFilter?: string;
|
|
22
|
+
/** Override the suite's base_url. */
|
|
23
|
+
baseUrl?: string;
|
|
24
|
+
/** Output format. */
|
|
25
|
+
reporter: "cli" | "json" | "html";
|
|
26
|
+
/** Path to write report file (stdout if omitted). */
|
|
27
|
+
outputPath?: string;
|
|
28
|
+
/** Run browser in headed (visible) mode. */
|
|
29
|
+
headed: boolean;
|
|
30
|
+
/** Number of test cases to run in parallel. */
|
|
31
|
+
parallel: number;
|
|
32
|
+
/** Per-step timeout in milliseconds. */
|
|
33
|
+
timeout: number;
|
|
34
|
+
/** Browser viewport dimensions. */
|
|
35
|
+
viewport: Viewport;
|
|
36
|
+
/** LLM model identifier or per-role config. */
|
|
37
|
+
model: string | ModelConfig;
|
|
38
|
+
/** LLM provider to use. */
|
|
39
|
+
provider: Provider;
|
|
40
|
+
/** Base URL for the LLM API (optional override). */
|
|
41
|
+
llmBaseUrl?: string;
|
|
42
|
+
/** Force a full discovery run, ignoring cached plans. */
|
|
43
|
+
discover: boolean;
|
|
44
|
+
/** Behavior on plan drift: "fail" (default) or "rerun" with LLM. */
|
|
45
|
+
onDrift: "fail" | "rerun";
|
|
46
|
+
}
|
|
47
|
+
/** Resolve a model string or ModelConfig into a full ModelConfig. */
|
|
48
|
+
export declare function resolveModelConfig(model: string | ModelConfig): ModelConfig;
|
|
49
|
+
/** Default configuration values. */
|
|
50
|
+
export declare const DEFAULTS: Pick<RunConfig, "reporter" | "headed" | "parallel" | "timeout" | "viewport" | "model" | "provider" | "discover" | "onDrift">;
|
|
51
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,2CAA2C;AAC3C,MAAM,WAAW,QAAQ;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACd;AAED,0CAA0C;AAC1C,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEpE,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACb;AAED,mEAAmE;AACnE,MAAM,WAAW,SAAS;IACzB,mCAAmC;IACnC,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,qBAAqB;IACrB,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;IACjC,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,4CAA4C;IAC5C,MAAM,EAAE,OAAO,CAAA;IACf,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAA;IACf,mCAAmC;IACnC,QAAQ,EAAE,QAAQ,CAAA;IAClB,+CAA+C;IAC/C,KAAK,EAAE,MAAM,GAAG,WAAW,CAAA;IAC3B,2BAA2B;IAC3B,QAAQ,EAAE,QAAQ,CAAA;IAClB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yDAAyD;IACzD,QAAQ,EAAE,OAAO,CAAA;IACjB,oEAAoE;IACpE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB;AAED,qEAAqE;AACrE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,WAAW,CAK3E;AAED,oCAAoC;AACpC,eAAO,MAAM,QAAQ,EAAE,IAAI,CAC1B,SAAS,EACP,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,GACV,OAAO,GACP,UAAU,GACV,UAAU,GACV,SAAS,CAWX,CAAA"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types used across all GreenLight modules.
|
|
3
|
+
*/
|
|
4
|
+
/** Resolve a model string or ModelConfig into a full ModelConfig. */
|
|
5
|
+
export function resolveModelConfig(model) {
|
|
6
|
+
if (typeof model === "string") {
|
|
7
|
+
return { planner: model, pilot: model };
|
|
8
|
+
}
|
|
9
|
+
return model;
|
|
10
|
+
}
|
|
11
|
+
/** Default configuration values. */
|
|
12
|
+
export const DEFAULTS = {
|
|
13
|
+
reporter: "cli",
|
|
14
|
+
headed: false,
|
|
15
|
+
parallel: 1,
|
|
16
|
+
timeout: 30_000,
|
|
17
|
+
viewport: { width: 1280, height: 720 },
|
|
18
|
+
model: "anthropic/claude-sonnet-4",
|
|
19
|
+
provider: "openrouter",
|
|
20
|
+
discover: false,
|
|
21
|
+
onDrift: "fail",
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiDH,qEAAqE;AACrE,MAAM,UAAU,kBAAkB,CAAC,KAA2B;IAC7D,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACxC,CAAC;IACD,OAAO,KAAK,CAAA;AACb,CAAC;AAED,oCAAoC;AACpC,MAAM,CAAC,MAAM,QAAQ,GAWjB;IACH,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;IACtC,KAAK,EAAE,2BAA2B;IAClC,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,MAAM;CACf,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eidra-umain/greenlight",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AI-driven E2E testing tool — write tests as plain English, no selectors or glue code",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "umain.com",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/cli/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/cli/index.js",
|
|
11
|
+
"./*": "./dist/*"
|
|
12
|
+
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"greenlight": "dist/cli/index.js"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"e2e",
|
|
22
|
+
"testing",
|
|
23
|
+
"ai",
|
|
24
|
+
"llm",
|
|
25
|
+
"playwright",
|
|
26
|
+
"natural-language",
|
|
27
|
+
"accessibility",
|
|
28
|
+
"automation",
|
|
29
|
+
"end-to-end"
|
|
30
|
+
],
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/eidra-umain/greenlight"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc",
|
|
37
|
+
"dev": "tsc --watch",
|
|
38
|
+
"greenlight": "node dist/cli/index.js",
|
|
39
|
+
"lint": "eslint src/",
|
|
40
|
+
"lint:fix": "eslint src/ --fix",
|
|
41
|
+
"format": "prettier --write .",
|
|
42
|
+
"format:check": "prettier --check .",
|
|
43
|
+
"prepublishOnly": "npm run build",
|
|
44
|
+
"test": "vitest run",
|
|
45
|
+
"test:watch": "vitest"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"commander": "^13.0.0",
|
|
49
|
+
"dotenv": "^17.3.1",
|
|
50
|
+
"playwright": "^1.58.2",
|
|
51
|
+
"yaml": "^2.8.2",
|
|
52
|
+
"zod": "^4.3.6"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@eslint/js": "^10.0.1",
|
|
56
|
+
"@types/node": "^22.0.0",
|
|
57
|
+
"eslint": "^10.0.3",
|
|
58
|
+
"eslint-config-prettier": "^10.1.8",
|
|
59
|
+
"prettier": "^3.8.1",
|
|
60
|
+
"typescript": "^5.7.0",
|
|
61
|
+
"typescript-eslint": "^8.57.0",
|
|
62
|
+
"vitest": "^4.1.0"
|
|
63
|
+
}
|
|
64
|
+
}
|