playwright-intelligence-engine 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +229 -229
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/core/version.d.ts +3 -3
- package/dist/index.js +81 -24
- package/package.json +76 -76
- package/src/authoring/author.ts +81 -81
- package/src/authoring/generation-contract.ts +283 -283
- package/src/authoring/hybrid-author.ts +115 -115
- package/src/authoring/index.ts +7 -7
- package/src/authoring/llm-author.ts +282 -282
- package/src/authoring/naming/name-plan.ts +28 -28
- package/src/authoring/naming/name-planner.ts +339 -339
- package/src/authoring/naming/naming-linter.ts +292 -292
- package/src/cli/index.ts +1238 -1172
- package/src/collectors/git-diff-collector.ts +190 -190
- package/src/core/version.ts +25 -25
- package/src/diagnostics/diagnostic-report.ts +204 -204
- package/src/diagnostics/failure-classifier.ts +701 -701
- package/src/evaluation/repository-runner.ts +197 -197
- package/src/gate/quality.ts +101 -101
- package/src/generator/architecture-generator.ts +582 -582
- package/src/generator/assertion-quality-gate.ts +88 -88
- package/src/generator/candidate-writer.ts +288 -288
- package/src/generator/test-generator.ts +52 -52
- package/src/index.ts +107 -107
- package/src/intelligence/evidence-bundle.ts +300 -300
- package/src/intelligence/generation-agent.ts +561 -561
- package/src/intelligence/generation-verifier.ts +1115 -1115
- package/src/intelligence/locator-disambiguation-engine.ts +331 -331
- package/src/intelligence/project-intelligence.ts +140 -140
- package/src/intelligence/repository-profile.ts +796 -796
- package/src/intelligence/trace-proposal-workflow.ts +318 -318
- package/src/intelligence/workflow-planner.ts +966 -966
- package/src/mcp/server.ts +970 -970
- package/src/perception/app-model.ts +32 -32
- package/src/perception/crawler.ts +263 -263
- package/src/perception/index.ts +3 -3
- package/src/repair/assertion-hasher.ts +386 -386
- package/src/repair/diff-allowlist.ts +612 -612
- package/src/repair/intent-validator.ts +761 -761
- package/src/repair/repair-planner.ts +467 -467
- package/src/repair/statement-patcher.ts +544 -544
- package/src/reproduce/interactive-workflow-runner.ts +828 -828
- package/src/sandbox/execution-runner.ts +408 -408
- package/src/selector/abstention-policy.ts +175 -175
- package/src/selector/candidate-extractor.ts +343 -343
- package/src/selector/repair-candidate-ranker.ts +92 -92
- package/src/selector/selector-scorer.ts +344 -344
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { planArchitecture, toClassName } from './architecture-generator.js';
|
|
2
|
-
|
|
3
|
-
export interface GeneratedStep {
|
|
4
|
-
action: 'click' | 'fill' | 'press' | 'navigate' | 'assert-visible' | 'assert-text' | 'assert-count' | 'assert-value';
|
|
5
|
-
role?: string | undefined;
|
|
6
|
-
name?: string | undefined;
|
|
7
|
-
selector?: string | undefined;
|
|
8
|
-
value?: string | undefined;
|
|
9
|
-
placeholder?: string | undefined;
|
|
10
|
-
expectedText?: string | undefined;
|
|
11
|
-
expectedCount?: number | undefined;
|
|
12
|
-
expectedValue?: string | undefined;
|
|
13
|
-
frame?: string | undefined;
|
|
14
|
-
frameSelector?: string | undefined;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface GeneratedSuiteOutput {
|
|
18
|
-
pageObjectName: string;
|
|
19
|
-
pageObjectCode: string;
|
|
20
|
-
specCode: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export class TestGenerator {
|
|
24
|
-
/**
|
|
25
|
-
* Generates production-grade TypeScript Playwright Page Object and Spec code adhering to enterprise standards.
|
|
26
|
-
* Delegates to ArchitectureGenerator to guarantee single source of truth and semantic naming.
|
|
27
|
-
*/
|
|
28
|
-
public static generateSuite(
|
|
29
|
-
featureName: string,
|
|
30
|
-
steps: GeneratedStep[],
|
|
31
|
-
baseUrl = 'https://example.com'
|
|
32
|
-
): GeneratedSuiteOutput {
|
|
33
|
-
const rawClassName = toClassName(featureName);
|
|
34
|
-
const className = rawClassName.endsWith('Page') ? rawClassName : `${rawClassName}Page`;
|
|
35
|
-
|
|
36
|
-
const plan = planArchitecture({
|
|
37
|
-
featureName,
|
|
38
|
-
mode: 'greenfield',
|
|
39
|
-
baseUrl,
|
|
40
|
-
steps,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const pageFile = plan.files.find((f) => f.relativePath.endsWith('Page.ts'));
|
|
44
|
-
const specFile = plan.files.find((f) => f.relativePath.endsWith('.spec.ts'));
|
|
45
|
-
|
|
46
|
-
return {
|
|
47
|
-
pageObjectName: className,
|
|
48
|
-
pageObjectCode: pageFile?.content ?? '',
|
|
49
|
-
specCode: specFile?.content ?? '',
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
import { planArchitecture, toClassName } from './architecture-generator.js';
|
|
2
|
+
|
|
3
|
+
export interface GeneratedStep {
|
|
4
|
+
action: 'click' | 'fill' | 'press' | 'navigate' | 'assert-visible' | 'assert-text' | 'assert-count' | 'assert-value';
|
|
5
|
+
role?: string | undefined;
|
|
6
|
+
name?: string | undefined;
|
|
7
|
+
selector?: string | undefined;
|
|
8
|
+
value?: string | undefined;
|
|
9
|
+
placeholder?: string | undefined;
|
|
10
|
+
expectedText?: string | undefined;
|
|
11
|
+
expectedCount?: number | undefined;
|
|
12
|
+
expectedValue?: string | undefined;
|
|
13
|
+
frame?: string | undefined;
|
|
14
|
+
frameSelector?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface GeneratedSuiteOutput {
|
|
18
|
+
pageObjectName: string;
|
|
19
|
+
pageObjectCode: string;
|
|
20
|
+
specCode: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class TestGenerator {
|
|
24
|
+
/**
|
|
25
|
+
* Generates production-grade TypeScript Playwright Page Object and Spec code adhering to enterprise standards.
|
|
26
|
+
* Delegates to ArchitectureGenerator to guarantee single source of truth and semantic naming.
|
|
27
|
+
*/
|
|
28
|
+
public static generateSuite(
|
|
29
|
+
featureName: string,
|
|
30
|
+
steps: GeneratedStep[],
|
|
31
|
+
baseUrl = 'https://example.com'
|
|
32
|
+
): GeneratedSuiteOutput {
|
|
33
|
+
const rawClassName = toClassName(featureName);
|
|
34
|
+
const className = rawClassName.endsWith('Page') ? rawClassName : `${rawClassName}Page`;
|
|
35
|
+
|
|
36
|
+
const plan = planArchitecture({
|
|
37
|
+
featureName,
|
|
38
|
+
mode: 'greenfield',
|
|
39
|
+
baseUrl,
|
|
40
|
+
steps,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const pageFile = plan.files.find((f) => f.relativePath.endsWith('Page.ts'));
|
|
44
|
+
const specFile = plan.files.find((f) => f.relativePath.endsWith('.spec.ts'));
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
pageObjectName: className,
|
|
48
|
+
pageObjectCode: pageFile?.content ?? '',
|
|
49
|
+
specCode: specFile?.content ?? '',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
// Core Types & Schemas
|
|
2
|
-
export * from './core/version.js';
|
|
3
|
-
export * from './core/types/diagnostic-context.js';
|
|
4
|
-
export * from './core/types/repair-evidence.js';
|
|
5
|
-
export * from './core/errors/engine-errors.js';
|
|
6
|
-
|
|
7
|
-
// Trace Ingestion
|
|
8
|
-
export * from './trace/archive-reader.js';
|
|
9
|
-
export * from './trace/version-detector.js';
|
|
10
|
-
export * from './trace/trace-parser.js';
|
|
11
|
-
export * from './trace/snapshot-resolver.js';
|
|
12
|
-
export * from './trace/adapters/trace-adapter.js';
|
|
13
|
-
export * from './trace/adapters/adapter-registry.js';
|
|
14
|
-
export * from './trace/adapters/v8-adapter.js';
|
|
15
|
-
export * from './trace/adapters/v9-adapter.js';
|
|
16
|
-
export * from './trace/adapters/v10-adapter.js';
|
|
17
|
-
export * from './trace/adapters/unknown-adapter.js';
|
|
18
|
-
|
|
19
|
-
// Diagnostics
|
|
20
|
-
export * from './diagnostics/failure-classifier.js';
|
|
21
|
-
export * from './diagnostics/evidence-correlator.js';
|
|
22
|
-
export * from './diagnostics/diagnostic-report.js';
|
|
23
|
-
export * from './diagnostics/diagnostic-contract.js';
|
|
24
|
-
export * from './diagnostics/failure-category.js';
|
|
25
|
-
export * from './diagnostics/external-failure-evidence.js';
|
|
26
|
-
|
|
27
|
-
// Selector Intelligence & Abstention
|
|
28
|
-
export * from './selector/candidate-extractor.js';
|
|
29
|
-
export * from './selector/selector-scorer.js';
|
|
30
|
-
export * from './selector/abstention-policy.js';
|
|
31
|
-
export * from './selector/repair-candidate-ranker.js';
|
|
32
|
-
export * from './intelligence/locator-disambiguation-engine.js';
|
|
33
|
-
|
|
34
|
-
// AST Repair & Verification
|
|
35
|
-
export * from './repair/ast-patcher.js';
|
|
36
|
-
export * from './repair/statement-patcher.js';
|
|
37
|
-
export * from './repair/assertion-hasher.js';
|
|
38
|
-
export * from './repair/diff-allowlist.js';
|
|
39
|
-
export * from './repair/intent-validator.js';
|
|
40
|
-
export * from './repair/repair-planner.js';
|
|
41
|
-
export * from './repair/repair-workflow.js';
|
|
42
|
-
export * from './repair/approval-service.js';
|
|
43
|
-
export * from './repair/workspace-promoter.js';
|
|
44
|
-
export * from './repair/repair-operations.js';
|
|
45
|
-
export * from './repair/verification-gates.js';
|
|
46
|
-
export * from './repair/safe-operation-compiler.js';
|
|
47
|
-
export * from './collectors/git-diff-collector.js';
|
|
48
|
-
export * from './collectors/network-collector.js';
|
|
49
|
-
export * from './collectors/static-ast-collector.js';
|
|
50
|
-
export * from './repair/browser-operation-executor.js';
|
|
51
|
-
export * from './repair/source-mapper.js';
|
|
52
|
-
|
|
53
|
-
// Selector Verification & Live Reproduction
|
|
54
|
-
export * from './selector/live-locator-verifier.js';
|
|
55
|
-
export * from './reproduce/direct-browser-investigator.js';
|
|
56
|
-
export * from './reproduce/diagnostic-rerunner.js';
|
|
57
|
-
export * from './reproduce/interactive-workflow-runner.js';
|
|
58
|
-
|
|
59
|
-
// Sandbox & Worktree Management
|
|
60
|
-
export * from './sandbox/dependency-strategy.js';
|
|
61
|
-
export * from './sandbox/worktree-manager.js';
|
|
62
|
-
export * from './sandbox/execution-runner.js';
|
|
63
|
-
|
|
64
|
-
// Memory & Generation
|
|
65
|
-
export * from './memory/stability-ledger.js';
|
|
66
|
-
export * from './generator/test-generator.js';
|
|
67
|
-
export * from './generator/architecture-generator.js';
|
|
68
|
-
export * from './generator/assertion-quality-gate.js';
|
|
69
|
-
export * from './generator/candidate-writer.js';
|
|
70
|
-
export * from './authoring/index.js';
|
|
71
|
-
export * from './gate/index.js';
|
|
72
|
-
export * from './perception/index.js';
|
|
73
|
-
export * from './config/project-config.js';
|
|
74
|
-
export * from './intelligence/llm-proposal.js';
|
|
75
|
-
export * from './intelligence/model-provider.js';
|
|
76
|
-
export * from './intelligence/model-contract.js';
|
|
77
|
-
export * from './intelligence/evidence-bundle.js';
|
|
78
|
-
export * from './intelligence/repair-agent.js';
|
|
79
|
-
export * from './intelligence/trace-proposal-workflow.js';
|
|
80
|
-
export * from './intelligence/verified-llm-repair-workflow.js';
|
|
81
|
-
export * from './intelligence/autonomous-repair-workflow.js';
|
|
82
|
-
export * from './intelligence/generation-agent.js';
|
|
83
|
-
export * from './intelligence/generation-verifier.js';
|
|
84
|
-
export * from './intelligence/repository-profile.js';
|
|
85
|
-
export * from './intelligence/project-intelligence.js';
|
|
86
|
-
export * from './intelligence/failure-clustering.js';
|
|
87
|
-
export * from './intelligence/suite-intelligence.js';
|
|
88
|
-
export * from './intelligence/business-intent.js';
|
|
89
|
-
export * from './intelligence/test-intelligence.js';
|
|
90
|
-
export * from './intelligence/workflow-planner.js';
|
|
91
|
-
export * from './integrations/ci-summary.js';
|
|
92
|
-
export * from './integrations/quality-gate.js';
|
|
93
|
-
export * from './integrations/playwright-report-adapter.js';
|
|
94
|
-
export * from './integrations/sarif-report.js';
|
|
95
|
-
export * from './governance/audit-log.js';
|
|
96
|
-
export * from './governance/workflow-audit.js';
|
|
97
|
-
export * from './governance/team-dashboard.js';
|
|
98
|
-
export * from './repair/workflow-plan.js';
|
|
99
|
-
export * from './evaluation/repository-inspector.js';
|
|
100
|
-
export * from './evaluation/repository-runner.js';
|
|
101
|
-
export * from './evaluation/evaluation-scorecard.js';
|
|
102
|
-
|
|
103
|
-
// Framework & MCP
|
|
104
|
-
export * from './framework/config-adapter.js';
|
|
105
|
-
export * from './mcp/server.js';
|
|
106
|
-
export * from './cli/index.js';
|
|
107
|
-
|
|
1
|
+
// Core Types & Schemas
|
|
2
|
+
export * from './core/version.js';
|
|
3
|
+
export * from './core/types/diagnostic-context.js';
|
|
4
|
+
export * from './core/types/repair-evidence.js';
|
|
5
|
+
export * from './core/errors/engine-errors.js';
|
|
6
|
+
|
|
7
|
+
// Trace Ingestion
|
|
8
|
+
export * from './trace/archive-reader.js';
|
|
9
|
+
export * from './trace/version-detector.js';
|
|
10
|
+
export * from './trace/trace-parser.js';
|
|
11
|
+
export * from './trace/snapshot-resolver.js';
|
|
12
|
+
export * from './trace/adapters/trace-adapter.js';
|
|
13
|
+
export * from './trace/adapters/adapter-registry.js';
|
|
14
|
+
export * from './trace/adapters/v8-adapter.js';
|
|
15
|
+
export * from './trace/adapters/v9-adapter.js';
|
|
16
|
+
export * from './trace/adapters/v10-adapter.js';
|
|
17
|
+
export * from './trace/adapters/unknown-adapter.js';
|
|
18
|
+
|
|
19
|
+
// Diagnostics
|
|
20
|
+
export * from './diagnostics/failure-classifier.js';
|
|
21
|
+
export * from './diagnostics/evidence-correlator.js';
|
|
22
|
+
export * from './diagnostics/diagnostic-report.js';
|
|
23
|
+
export * from './diagnostics/diagnostic-contract.js';
|
|
24
|
+
export * from './diagnostics/failure-category.js';
|
|
25
|
+
export * from './diagnostics/external-failure-evidence.js';
|
|
26
|
+
|
|
27
|
+
// Selector Intelligence & Abstention
|
|
28
|
+
export * from './selector/candidate-extractor.js';
|
|
29
|
+
export * from './selector/selector-scorer.js';
|
|
30
|
+
export * from './selector/abstention-policy.js';
|
|
31
|
+
export * from './selector/repair-candidate-ranker.js';
|
|
32
|
+
export * from './intelligence/locator-disambiguation-engine.js';
|
|
33
|
+
|
|
34
|
+
// AST Repair & Verification
|
|
35
|
+
export * from './repair/ast-patcher.js';
|
|
36
|
+
export * from './repair/statement-patcher.js';
|
|
37
|
+
export * from './repair/assertion-hasher.js';
|
|
38
|
+
export * from './repair/diff-allowlist.js';
|
|
39
|
+
export * from './repair/intent-validator.js';
|
|
40
|
+
export * from './repair/repair-planner.js';
|
|
41
|
+
export * from './repair/repair-workflow.js';
|
|
42
|
+
export * from './repair/approval-service.js';
|
|
43
|
+
export * from './repair/workspace-promoter.js';
|
|
44
|
+
export * from './repair/repair-operations.js';
|
|
45
|
+
export * from './repair/verification-gates.js';
|
|
46
|
+
export * from './repair/safe-operation-compiler.js';
|
|
47
|
+
export * from './collectors/git-diff-collector.js';
|
|
48
|
+
export * from './collectors/network-collector.js';
|
|
49
|
+
export * from './collectors/static-ast-collector.js';
|
|
50
|
+
export * from './repair/browser-operation-executor.js';
|
|
51
|
+
export * from './repair/source-mapper.js';
|
|
52
|
+
|
|
53
|
+
// Selector Verification & Live Reproduction
|
|
54
|
+
export * from './selector/live-locator-verifier.js';
|
|
55
|
+
export * from './reproduce/direct-browser-investigator.js';
|
|
56
|
+
export * from './reproduce/diagnostic-rerunner.js';
|
|
57
|
+
export * from './reproduce/interactive-workflow-runner.js';
|
|
58
|
+
|
|
59
|
+
// Sandbox & Worktree Management
|
|
60
|
+
export * from './sandbox/dependency-strategy.js';
|
|
61
|
+
export * from './sandbox/worktree-manager.js';
|
|
62
|
+
export * from './sandbox/execution-runner.js';
|
|
63
|
+
|
|
64
|
+
// Memory & Generation
|
|
65
|
+
export * from './memory/stability-ledger.js';
|
|
66
|
+
export * from './generator/test-generator.js';
|
|
67
|
+
export * from './generator/architecture-generator.js';
|
|
68
|
+
export * from './generator/assertion-quality-gate.js';
|
|
69
|
+
export * from './generator/candidate-writer.js';
|
|
70
|
+
export * from './authoring/index.js';
|
|
71
|
+
export * from './gate/index.js';
|
|
72
|
+
export * from './perception/index.js';
|
|
73
|
+
export * from './config/project-config.js';
|
|
74
|
+
export * from './intelligence/llm-proposal.js';
|
|
75
|
+
export * from './intelligence/model-provider.js';
|
|
76
|
+
export * from './intelligence/model-contract.js';
|
|
77
|
+
export * from './intelligence/evidence-bundle.js';
|
|
78
|
+
export * from './intelligence/repair-agent.js';
|
|
79
|
+
export * from './intelligence/trace-proposal-workflow.js';
|
|
80
|
+
export * from './intelligence/verified-llm-repair-workflow.js';
|
|
81
|
+
export * from './intelligence/autonomous-repair-workflow.js';
|
|
82
|
+
export * from './intelligence/generation-agent.js';
|
|
83
|
+
export * from './intelligence/generation-verifier.js';
|
|
84
|
+
export * from './intelligence/repository-profile.js';
|
|
85
|
+
export * from './intelligence/project-intelligence.js';
|
|
86
|
+
export * from './intelligence/failure-clustering.js';
|
|
87
|
+
export * from './intelligence/suite-intelligence.js';
|
|
88
|
+
export * from './intelligence/business-intent.js';
|
|
89
|
+
export * from './intelligence/test-intelligence.js';
|
|
90
|
+
export * from './intelligence/workflow-planner.js';
|
|
91
|
+
export * from './integrations/ci-summary.js';
|
|
92
|
+
export * from './integrations/quality-gate.js';
|
|
93
|
+
export * from './integrations/playwright-report-adapter.js';
|
|
94
|
+
export * from './integrations/sarif-report.js';
|
|
95
|
+
export * from './governance/audit-log.js';
|
|
96
|
+
export * from './governance/workflow-audit.js';
|
|
97
|
+
export * from './governance/team-dashboard.js';
|
|
98
|
+
export * from './repair/workflow-plan.js';
|
|
99
|
+
export * from './evaluation/repository-inspector.js';
|
|
100
|
+
export * from './evaluation/repository-runner.js';
|
|
101
|
+
export * from './evaluation/evaluation-scorecard.js';
|
|
102
|
+
|
|
103
|
+
// Framework & MCP
|
|
104
|
+
export * from './framework/config-adapter.js';
|
|
105
|
+
export * from './mcp/server.js';
|
|
106
|
+
export * from './cli/index.js';
|
|
107
|
+
|