playwright-intelligence-engine 0.0.0-stage → 2.0.1
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/LICENSE +191 -0
- package/README.md +229 -3
- package/bin/pw-intel.js +37 -0
- package/dist/authoring/author.d.ts +83 -0
- package/dist/authoring/author.d.ts.map +1 -0
- package/dist/authoring/generation-contract.d.ts +90 -0
- package/dist/authoring/generation-contract.d.ts.map +1 -0
- package/dist/authoring/hybrid-author.d.ts +6 -0
- package/dist/authoring/hybrid-author.d.ts.map +1 -0
- package/dist/authoring/index.d.ts +7 -0
- package/dist/authoring/index.d.ts.map +1 -0
- package/dist/authoring/llm-author.d.ts +28 -0
- package/dist/authoring/llm-author.d.ts.map +1 -0
- package/dist/authoring/naming/index.d.ts +4 -0
- package/dist/authoring/naming/index.d.ts.map +1 -0
- package/dist/authoring/naming/name-plan.d.ts +45 -0
- package/dist/authoring/naming/name-plan.d.ts.map +1 -0
- package/dist/authoring/naming/name-planner.d.ts +25 -0
- package/dist/authoring/naming/name-planner.d.ts.map +1 -0
- package/dist/authoring/naming/naming-linter.d.ts +20 -0
- package/dist/authoring/naming/naming-linter.d.ts.map +1 -0
- package/dist/authoring/template-author.d.ts +6 -0
- package/dist/authoring/template-author.d.ts.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/collectors/collector-interface.d.ts +7 -0
- package/dist/collectors/collector-interface.d.ts.map +1 -0
- package/dist/collectors/environment-collector.d.ts +12 -0
- package/dist/collectors/environment-collector.d.ts.map +1 -0
- package/dist/collectors/error-collector.d.ts +18 -0
- package/dist/collectors/error-collector.d.ts.map +1 -0
- package/dist/collectors/git-diff-collector.d.ts +20 -0
- package/dist/collectors/git-diff-collector.d.ts.map +1 -0
- package/dist/collectors/live-browser-collector.d.ts +45 -0
- package/dist/collectors/live-browser-collector.d.ts.map +1 -0
- package/dist/collectors/network-collector.d.ts +28 -0
- package/dist/collectors/network-collector.d.ts.map +1 -0
- package/dist/collectors/static-ast-collector.d.ts +32 -0
- package/dist/collectors/static-ast-collector.d.ts.map +1 -0
- package/dist/collectors/trace-collector.d.ts +12 -0
- package/dist/collectors/trace-collector.d.ts.map +1 -0
- package/dist/config/project-config.d.ts +33 -0
- package/dist/config/project-config.d.ts.map +1 -0
- package/dist/core/errors/engine-errors.d.ts +34 -0
- package/dist/core/errors/engine-errors.d.ts.map +1 -0
- package/dist/core/types/diagnostic-context.d.ts +151 -0
- package/dist/core/types/diagnostic-context.d.ts.map +1 -0
- package/dist/core/types/repair-evidence.d.ts +56 -0
- package/dist/core/types/repair-evidence.d.ts.map +1 -0
- package/dist/core/version.d.ts +13 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/diagnostics/diagnostic-contract.d.ts +52 -0
- package/dist/diagnostics/diagnostic-contract.d.ts.map +1 -0
- package/dist/diagnostics/diagnostic-report.d.ts +11 -0
- package/dist/diagnostics/diagnostic-report.d.ts.map +1 -0
- package/dist/diagnostics/evidence-correlator.d.ts +22 -0
- package/dist/diagnostics/evidence-correlator.d.ts.map +1 -0
- package/dist/diagnostics/external-failure-evidence.d.ts +18 -0
- package/dist/diagnostics/external-failure-evidence.d.ts.map +1 -0
- package/dist/diagnostics/failure-category.d.ts +4 -0
- package/dist/diagnostics/failure-category.d.ts.map +1 -0
- package/dist/diagnostics/failure-classifier.d.ts +58 -0
- package/dist/diagnostics/failure-classifier.d.ts.map +1 -0
- package/dist/evaluation/evaluation-scorecard.d.ts +72 -0
- package/dist/evaluation/evaluation-scorecard.d.ts.map +1 -0
- package/dist/evaluation/repository-inspector.d.ts +21 -0
- package/dist/evaluation/repository-inspector.d.ts.map +1 -0
- package/dist/evaluation/repository-runner.d.ts +24 -0
- package/dist/evaluation/repository-runner.d.ts.map +1 -0
- package/dist/evidence/evidence-model.d.ts +88 -0
- package/dist/evidence/evidence-model.d.ts.map +1 -0
- package/dist/evidence/evidence-normalizer.d.ts +19 -0
- package/dist/evidence/evidence-normalizer.d.ts.map +1 -0
- package/dist/evidence/evidence-redactor.d.ts +37 -0
- package/dist/evidence/evidence-redactor.d.ts.map +1 -0
- package/dist/framework/config-adapter.d.ts +28 -0
- package/dist/framework/config-adapter.d.ts.map +1 -0
- package/dist/gate/index.d.ts +21 -0
- package/dist/gate/index.d.ts.map +1 -0
- package/dist/gate/oracle.d.ts +26 -0
- package/dist/gate/oracle.d.ts.map +1 -0
- package/dist/gate/quality.d.ts +27 -0
- package/dist/gate/quality.d.ts.map +1 -0
- package/dist/gate/safety.d.ts +28 -0
- package/dist/gate/safety.d.ts.map +1 -0
- package/dist/generator/architecture-generator.d.ts +55 -0
- package/dist/generator/architecture-generator.d.ts.map +1 -0
- package/dist/generator/assertion-quality-gate.d.ts +18 -0
- package/dist/generator/assertion-quality-gate.d.ts.map +1 -0
- package/dist/generator/candidate-writer.d.ts +34 -0
- package/dist/generator/candidate-writer.d.ts.map +1 -0
- package/dist/generator/test-generator.d.ts +26 -0
- package/dist/generator/test-generator.d.ts.map +1 -0
- package/dist/governance/audit-log.d.ts +23 -0
- package/dist/governance/audit-log.d.ts.map +1 -0
- package/dist/governance/governance-policy.d.ts +24 -0
- package/dist/governance/governance-policy.d.ts.map +1 -0
- package/dist/governance/team-dashboard.d.ts +51 -0
- package/dist/governance/team-dashboard.d.ts.map +1 -0
- package/dist/governance/workflow-audit.d.ts +13 -0
- package/dist/governance/workflow-audit.d.ts.map +1 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20318 -0
- package/dist/integrations/ci-summary.d.ts +14 -0
- package/dist/integrations/ci-summary.d.ts.map +1 -0
- package/dist/integrations/playwright-report-adapter.d.ts +22 -0
- package/dist/integrations/playwright-report-adapter.d.ts.map +1 -0
- package/dist/integrations/quality-gate.d.ts +35 -0
- package/dist/integrations/quality-gate.d.ts.map +1 -0
- package/dist/integrations/sarif-report.d.ts +48 -0
- package/dist/integrations/sarif-report.d.ts.map +1 -0
- package/dist/intelligence/autonomous-repair-workflow.d.ts +31 -0
- package/dist/intelligence/autonomous-repair-workflow.d.ts.map +1 -0
- package/dist/intelligence/business-intent.d.ts +58 -0
- package/dist/intelligence/business-intent.d.ts.map +1 -0
- package/dist/intelligence/evidence-bundle.d.ts +364 -0
- package/dist/intelligence/evidence-bundle.d.ts.map +1 -0
- package/dist/intelligence/failure-clustering.d.ts +38 -0
- package/dist/intelligence/failure-clustering.d.ts.map +1 -0
- package/dist/intelligence/generation-agent.d.ts +120 -0
- package/dist/intelligence/generation-agent.d.ts.map +1 -0
- package/dist/intelligence/generation-verifier.d.ts +151 -0
- package/dist/intelligence/generation-verifier.d.ts.map +1 -0
- package/dist/intelligence/llm-proposal.d.ts +377 -0
- package/dist/intelligence/llm-proposal.d.ts.map +1 -0
- package/dist/intelligence/locator-disambiguation-engine.d.ts +38 -0
- package/dist/intelligence/locator-disambiguation-engine.d.ts.map +1 -0
- package/dist/intelligence/model-contract.d.ts +86 -0
- package/dist/intelligence/model-contract.d.ts.map +1 -0
- package/dist/intelligence/model-provider.d.ts +75 -0
- package/dist/intelligence/model-provider.d.ts.map +1 -0
- package/dist/intelligence/project-intelligence.d.ts +22 -0
- package/dist/intelligence/project-intelligence.d.ts.map +1 -0
- package/dist/intelligence/repair-agent.d.ts +46 -0
- package/dist/intelligence/repair-agent.d.ts.map +1 -0
- package/dist/intelligence/repository-profile.d.ts +131 -0
- package/dist/intelligence/repository-profile.d.ts.map +1 -0
- package/dist/intelligence/suite-intelligence.d.ts +59 -0
- package/dist/intelligence/suite-intelligence.d.ts.map +1 -0
- package/dist/intelligence/test-intelligence.d.ts +44 -0
- package/dist/intelligence/test-intelligence.d.ts.map +1 -0
- package/dist/intelligence/trace-proposal-workflow.d.ts +30 -0
- package/dist/intelligence/trace-proposal-workflow.d.ts.map +1 -0
- package/dist/intelligence/verified-llm-repair-workflow.d.ts +21 -0
- package/dist/intelligence/verified-llm-repair-workflow.d.ts.map +1 -0
- package/dist/intelligence/workflow-planner.d.ts +278 -0
- package/dist/intelligence/workflow-planner.d.ts.map +1 -0
- package/dist/mcp/server.d.ts +32 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/memory/stability-ledger.d.ts +46 -0
- package/dist/memory/stability-ledger.d.ts.map +1 -0
- package/dist/perception/app-model.d.ts +55 -0
- package/dist/perception/app-model.d.ts.map +1 -0
- package/dist/perception/crawler.d.ts +18 -0
- package/dist/perception/crawler.d.ts.map +1 -0
- package/dist/perception/index.d.ts +3 -0
- package/dist/perception/index.d.ts.map +1 -0
- package/dist/repair/approval-service.d.ts +139 -0
- package/dist/repair/approval-service.d.ts.map +1 -0
- package/dist/repair/assertion-hasher.d.ts +62 -0
- package/dist/repair/assertion-hasher.d.ts.map +1 -0
- package/dist/repair/ast-patcher.d.ts +36 -0
- package/dist/repair/ast-patcher.d.ts.map +1 -0
- package/dist/repair/browser-operation-executor.d.ts +27 -0
- package/dist/repair/browser-operation-executor.d.ts.map +1 -0
- package/dist/repair/diff-allowlist.d.ts +74 -0
- package/dist/repair/diff-allowlist.d.ts.map +1 -0
- package/dist/repair/intent-validator.d.ts +157 -0
- package/dist/repair/intent-validator.d.ts.map +1 -0
- package/dist/repair/repair-operations.d.ts +40 -0
- package/dist/repair/repair-operations.d.ts.map +1 -0
- package/dist/repair/repair-planner.d.ts +98 -0
- package/dist/repair/repair-planner.d.ts.map +1 -0
- package/dist/repair/repair-workflow.d.ts +42 -0
- package/dist/repair/repair-workflow.d.ts.map +1 -0
- package/dist/repair/safe-operation-compiler.d.ts +15 -0
- package/dist/repair/safe-operation-compiler.d.ts.map +1 -0
- package/dist/repair/source-mapper.d.ts +19 -0
- package/dist/repair/source-mapper.d.ts.map +1 -0
- package/dist/repair/statement-patcher.d.ts +75 -0
- package/dist/repair/statement-patcher.d.ts.map +1 -0
- package/dist/repair/verification-gates.d.ts +25 -0
- package/dist/repair/verification-gates.d.ts.map +1 -0
- package/dist/repair/workflow-plan.d.ts +35 -0
- package/dist/repair/workflow-plan.d.ts.map +1 -0
- package/dist/repair/workspace-promoter.d.ts +43 -0
- package/dist/repair/workspace-promoter.d.ts.map +1 -0
- package/dist/reproduce/diagnostic-rerunner.d.ts +40 -0
- package/dist/reproduce/diagnostic-rerunner.d.ts.map +1 -0
- package/dist/reproduce/direct-browser-investigator.d.ts +41 -0
- package/dist/reproduce/direct-browser-investigator.d.ts.map +1 -0
- package/dist/reproduce/interactive-workflow-runner.d.ts +43 -0
- package/dist/reproduce/interactive-workflow-runner.d.ts.map +1 -0
- package/dist/sandbox/dependency-strategy.d.ts +45 -0
- package/dist/sandbox/dependency-strategy.d.ts.map +1 -0
- package/dist/sandbox/execution-runner.d.ts +81 -0
- package/dist/sandbox/execution-runner.d.ts.map +1 -0
- package/dist/sandbox/worktree-manager.d.ts +51 -0
- package/dist/sandbox/worktree-manager.d.ts.map +1 -0
- package/dist/selector/abstention-policy.d.ts +34 -0
- package/dist/selector/abstention-policy.d.ts.map +1 -0
- package/dist/selector/candidate-extractor.d.ts +71 -0
- package/dist/selector/candidate-extractor.d.ts.map +1 -0
- package/dist/selector/live-locator-verifier.d.ts +28 -0
- package/dist/selector/live-locator-verifier.d.ts.map +1 -0
- package/dist/selector/repair-candidate-ranker.d.ts +10 -0
- package/dist/selector/repair-candidate-ranker.d.ts.map +1 -0
- package/dist/selector/selector-scorer.d.ts +43 -0
- package/dist/selector/selector-scorer.d.ts.map +1 -0
- package/dist/trace/adapters/adapter-registry.d.ts +18 -0
- package/dist/trace/adapters/adapter-registry.d.ts.map +1 -0
- package/dist/trace/adapters/trace-adapter.d.ts +21 -0
- package/dist/trace/adapters/trace-adapter.d.ts.map +1 -0
- package/dist/trace/adapters/unknown-adapter.d.ts +10 -0
- package/dist/trace/adapters/unknown-adapter.d.ts.map +1 -0
- package/dist/trace/adapters/v10-adapter.d.ts +10 -0
- package/dist/trace/adapters/v10-adapter.d.ts.map +1 -0
- package/dist/trace/adapters/v4-adapter.d.ts +11 -0
- package/dist/trace/adapters/v4-adapter.d.ts.map +1 -0
- package/dist/trace/adapters/v8-adapter.d.ts +10 -0
- package/dist/trace/adapters/v8-adapter.d.ts.map +1 -0
- package/dist/trace/adapters/v9-adapter.d.ts +10 -0
- package/dist/trace/adapters/v9-adapter.d.ts.map +1 -0
- package/dist/trace/archive-reader.d.ts +44 -0
- package/dist/trace/archive-reader.d.ts.map +1 -0
- package/dist/trace/snapshot-resolver.d.ts +55 -0
- package/dist/trace/snapshot-resolver.d.ts.map +1 -0
- package/dist/trace/trace-parser.d.ts +50 -0
- package/dist/trace/trace-parser.d.ts.map +1 -0
- package/dist/trace/version-detector.d.ts +20 -0
- package/dist/trace/version-detector.d.ts.map +1 -0
- package/package.json +76 -6
- package/skills/README.md +20 -0
- package/skills/pie-failure-investigation/SKILL.md +16 -0
- package/skills/pie-quality-engineer/SKILL.md +66 -0
- package/skills/pie-release-readiness/SKILL.md +22 -0
- package/skills/pie-repair-review/SKILL.md +21 -0
- package/skills/pie-trace-to-repair/SKILL.md +35 -0
- package/src/authoring/author.ts +81 -0
- package/src/authoring/generation-contract.ts +283 -0
- package/src/authoring/hybrid-author.ts +115 -0
- package/src/authoring/index.ts +7 -0
- package/src/authoring/llm-author.ts +282 -0
- package/src/authoring/naming/index.ts +4 -0
- package/src/authoring/naming/name-plan.ts +28 -0
- package/src/authoring/naming/name-planner.ts +339 -0
- package/src/authoring/naming/naming-linter.ts +292 -0
- package/src/authoring/template-author.ts +39 -0
- package/src/cli/index.ts +1172 -0
- package/src/collectors/collector-interface.ts +8 -0
- package/src/collectors/environment-collector.ts +103 -0
- package/src/collectors/error-collector.ts +177 -0
- package/src/collectors/git-diff-collector.ts +190 -0
- package/src/collectors/live-browser-collector.ts +412 -0
- package/src/collectors/network-collector.ts +90 -0
- package/src/collectors/static-ast-collector.ts +226 -0
- package/src/collectors/trace-collector.ts +66 -0
- package/src/config/project-config.ts +114 -0
- package/src/core/errors/engine-errors.ts +90 -0
- package/src/core/types/diagnostic-context.ts +94 -0
- package/src/core/types/repair-evidence.ts +45 -0
- package/src/core/version.ts +25 -0
- package/src/diagnostics/diagnostic-contract.ts +79 -0
- package/src/diagnostics/diagnostic-report.ts +204 -0
- package/src/diagnostics/evidence-correlator.ts +117 -0
- package/src/diagnostics/external-failure-evidence.ts +72 -0
- package/src/diagnostics/failure-category.ts +40 -0
- package/src/diagnostics/failure-classifier.ts +701 -0
- package/src/evaluation/evaluation-scorecard.ts +198 -0
- package/src/evaluation/repository-inspector.ts +143 -0
- package/src/evaluation/repository-runner.ts +197 -0
- package/src/evidence/evidence-model.ts +76 -0
- package/src/evidence/evidence-normalizer.ts +322 -0
- package/src/evidence/evidence-redactor.ts +218 -0
- package/src/framework/config-adapter.ts +131 -0
- package/src/gate/index.ts +43 -0
- package/src/gate/oracle.ts +69 -0
- package/src/gate/quality.ts +101 -0
- package/src/gate/safety.ts +94 -0
- package/src/generator/architecture-generator.ts +582 -0
- package/src/generator/assertion-quality-gate.ts +88 -0
- package/src/generator/candidate-writer.ts +288 -0
- package/src/generator/test-generator.ts +52 -0
- package/src/governance/audit-log.ts +115 -0
- package/src/governance/governance-policy.ts +72 -0
- package/src/governance/team-dashboard.ts +189 -0
- package/src/governance/workflow-audit.ts +72 -0
- package/src/index.ts +107 -0
- package/src/integrations/ci-summary.ts +37 -0
- package/src/integrations/playwright-report-adapter.ts +173 -0
- package/src/integrations/quality-gate.ts +95 -0
- package/src/integrations/sarif-report.ts +110 -0
- package/src/intelligence/autonomous-repair-workflow.ts +139 -0
- package/src/intelligence/business-intent.ts +163 -0
- package/src/intelligence/evidence-bundle.ts +300 -0
- package/src/intelligence/failure-clustering.ts +134 -0
- package/src/intelligence/generation-agent.ts +561 -0
- package/src/intelligence/generation-verifier.ts +1115 -0
- package/src/intelligence/llm-proposal.ts +519 -0
- package/src/intelligence/locator-disambiguation-engine.ts +331 -0
- package/src/intelligence/model-contract.ts +205 -0
- package/src/intelligence/model-provider.ts +348 -0
- package/src/intelligence/project-intelligence.ts +140 -0
- package/src/intelligence/repair-agent.ts +297 -0
- package/src/intelligence/repository-profile.ts +796 -0
- package/src/intelligence/suite-intelligence.ts +305 -0
- package/src/intelligence/test-intelligence.ts +136 -0
- package/src/intelligence/trace-proposal-workflow.ts +318 -0
- package/src/intelligence/verified-llm-repair-workflow.ts +48 -0
- package/src/intelligence/workflow-planner.ts +966 -0
- package/src/mcp/server.ts +970 -0
- package/src/memory/stability-ledger.ts +243 -0
- package/src/perception/app-model.ts +32 -0
- package/src/perception/crawler.ts +263 -0
- package/src/perception/index.ts +3 -0
- package/src/repair/approval-service.ts +541 -0
- package/src/repair/assertion-hasher.ts +386 -0
- package/src/repair/ast-patcher.ts +223 -0
- package/src/repair/browser-operation-executor.ts +263 -0
- package/src/repair/diff-allowlist.ts +612 -0
- package/src/repair/intent-validator.ts +761 -0
- package/src/repair/repair-operations.ts +65 -0
- package/src/repair/repair-planner.ts +467 -0
- package/src/repair/repair-workflow.ts +241 -0
- package/src/repair/safe-operation-compiler.ts +68 -0
- package/src/repair/source-mapper.ts +156 -0
- package/src/repair/statement-patcher.ts +544 -0
- package/src/repair/verification-gates.ts +46 -0
- package/src/repair/workflow-plan.ts +59 -0
- package/src/repair/workspace-promoter.ts +313 -0
- package/src/reproduce/diagnostic-rerunner.ts +287 -0
- package/src/reproduce/direct-browser-investigator.ts +208 -0
- package/src/reproduce/interactive-workflow-runner.ts +828 -0
- package/src/sandbox/dependency-strategy.ts +215 -0
- package/src/sandbox/execution-runner.ts +408 -0
- package/src/sandbox/worktree-manager.ts +287 -0
- package/src/selector/abstention-policy.ts +175 -0
- package/src/selector/candidate-extractor.ts +343 -0
- package/src/selector/live-locator-verifier.ts +139 -0
- package/src/selector/repair-candidate-ranker.ts +92 -0
- package/src/selector/selector-scorer.ts +344 -0
- package/src/trace/adapters/adapter-registry.ts +49 -0
- package/src/trace/adapters/trace-adapter.ts +28 -0
- package/src/trace/adapters/unknown-adapter.ts +50 -0
- package/src/trace/adapters/v10-adapter.ts +39 -0
- package/src/trace/adapters/v4-adapter.ts +31 -0
- package/src/trace/adapters/v8-adapter.ts +42 -0
- package/src/trace/adapters/v9-adapter.ts +39 -0
- package/src/trace/archive-reader.ts +246 -0
- package/src/trace/snapshot-resolver.ts +308 -0
- package/src/trace/trace-parser.ts +467 -0
- package/src/trace/version-detector.ts +81 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2026 Playwright Intelligence Engine Contributors
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
|
191
|
+
|
package/README.md
CHANGED
|
@@ -1,3 +1,229 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# Playwright Intelligence Engine (`pw-intel`)
|
|
2
|
+
|
|
3
|
+
> Fast, verification-first failure diagnosis, autonomous self-healing, and test generation for Microsoft Playwright suites.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/playwright-intelligence-engine)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://nodejs.org/)
|
|
8
|
+
[](https://playwright.dev/)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. Installation
|
|
13
|
+
|
|
14
|
+
Run without installing via `npx`:
|
|
15
|
+
```bash
|
|
16
|
+
npx pw-intel --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or install in your project:
|
|
20
|
+
```bash
|
|
21
|
+
npm install --save-dev playwright-intelligence-engine
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or install globally:
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g playwright-intelligence-engine
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
*(Both `pw-intel` and `playwright-intelligence-engine` commands are available).*
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 2. Project Setup & LLM Configuration
|
|
34
|
+
|
|
35
|
+
Initialize PIE in your Playwright repository:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx pw-intel init
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Providing your LLM API Key (Optional)
|
|
42
|
+
|
|
43
|
+
> **Note:** Failure diagnosis, trace analysis, and AST test repairs run **100% offline and locally** without an LLM key.
|
|
44
|
+
> An API key is only needed if you want AI-assisted test generation (`pw-intel generate-agent`).
|
|
45
|
+
|
|
46
|
+
You can configure an LLM key in any of three ways:
|
|
47
|
+
|
|
48
|
+
#### Option A: During `init`
|
|
49
|
+
```bash
|
|
50
|
+
npx pw-intel init --api-key sk-your-openai-or-deepseek-key --model gpt-4o
|
|
51
|
+
```
|
|
52
|
+
*This automatically creates `.env` and adds it to your `.gitignore`.*
|
|
53
|
+
|
|
54
|
+
#### Option B: Environment Variable
|
|
55
|
+
```bash
|
|
56
|
+
export OPENAI_API_KEY="sk-..."
|
|
57
|
+
# or
|
|
58
|
+
export PIE_LLM_API_KEY="sk-..."
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Option C: In `.env`
|
|
62
|
+
Create `.env` in your project root:
|
|
63
|
+
```ini
|
|
64
|
+
PIE_LLM_API_KEY=sk-...
|
|
65
|
+
PIE_LLM_MODEL=gpt-4o
|
|
66
|
+
PIE_LLM_ENDPOINT=https://api.openai.com/v1/chat/completions
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Verify your setup at any time:
|
|
70
|
+
```bash
|
|
71
|
+
npx pw-intel doctor
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 3. How to Use
|
|
77
|
+
|
|
78
|
+
### 🔍 A. Diagnose a Failing Test
|
|
79
|
+
Ingest a Playwright trace archive (`trace.zip`) to find the exact root cause:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npx pw-intel diagnose ./test-results/trace.zip
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Output example:**
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"category": "LOCATOR_DRIFT",
|
|
89
|
+
"confidence": 0.94,
|
|
90
|
+
"action": "click",
|
|
91
|
+
"failingSelector": "#checkout-btn-v1",
|
|
92
|
+
"suggestedSelector": "button:has-text(\"Proceed to Checkout\")",
|
|
93
|
+
"targetFile": "e2e/pages/CartPage.ts",
|
|
94
|
+
"evidence": "Element ID changed dynamically; stable accessible role match found."
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
If the failure was caused by a backend crash (HTTP 500) or expired authentication (HTTP 401), PIE flags it immediately and abstains from modifying locators.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
### 🔧 B. Autonomous Test Repair (Safe Worktrees)
|
|
103
|
+
Repair a broken test or Page Object without risking your active Git branch:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# 1. Plan and test the repair in an isolated Git worktree:
|
|
107
|
+
npx pw-intel autonomous-repair ./test-results/trace.zip --execute
|
|
108
|
+
|
|
109
|
+
# 2. Check the cryptographic proposal:
|
|
110
|
+
npx pw-intel approve <proposalId>
|
|
111
|
+
|
|
112
|
+
# 3. Promote the verified fix atomically to your workspace:
|
|
113
|
+
npx pw-intel promote --token <approvalToken>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**The Safety Guarantee:**
|
|
117
|
+
- PIE **never** deletes or weakens your assertions (`expect(...)`).
|
|
118
|
+
- PIE **never** alters test inputs or reorders user actions.
|
|
119
|
+
- All repairs are executed and proven passing in a background worktree before promotion.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### 🚀 C. Generate Tests from Requirements
|
|
124
|
+
Generate complete Playwright test suites and Page Objects that conform to your repository's conventions:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
npx pw-intel generate-agent ./requirements.json --mode brownfield --write --verify
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Arguments:**
|
|
131
|
+
- `--mode brownfield`: Reuses existing fixtures, auth states, and Page Objects without generating duplicate login steps.
|
|
132
|
+
- `--mode greenfield`: Scaffolds a new end-to-end testing architecture from scratch.
|
|
133
|
+
- `--write`: Saves the generated files to disk.
|
|
134
|
+
- `--verify`: Runs TypeScript typecheck and Playwright discovery to ensure generated code compiles.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### 🧪 D. Reproduce a Spec with Live Instrumentation
|
|
139
|
+
Rerun a flaky test with live DOM snapshots, network capture, and console logs:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npx pw-intel reproduce tests/checkout.spec.ts
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### 📊 E. CI/CD Quality Gate & SARIF Reporting
|
|
148
|
+
Convert Playwright test results into GitHub Actions annotations and SARIF security/flakiness reports:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npx pw-intel ci-report ./test-results/results.json --sarif-out ./pie-results.sarif
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 4. Cursor / Claude Code IDE Integration (MCP Server)
|
|
157
|
+
|
|
158
|
+
PIE includes a built-in Model Context Protocol (MCP) server so AI coding assistants can diagnose traces and fix tests directly inside your IDE.
|
|
159
|
+
|
|
160
|
+
### For Cursor / Windsurf
|
|
161
|
+
Add to `.cursor/mcp.json`:
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"mcpServers": {
|
|
165
|
+
"playwright-intelligence": {
|
|
166
|
+
"command": "npx",
|
|
167
|
+
"args": ["-y", "playwright-intelligence-engine", "mcp"]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### For Claude Desktop / Claude Code
|
|
174
|
+
Add to `claude_desktop_config.json`:
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"mcpServers": {
|
|
178
|
+
"pw-intel": {
|
|
179
|
+
"command": "npx",
|
|
180
|
+
"args": ["-y", "playwright-intelligence-engine", "mcp"]
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Available MCP Tools:**
|
|
187
|
+
- `diagnose_trace`: Diagnoses Playwright traces and provides root causes.
|
|
188
|
+
- `repair_page_object`: Stages isolated repairs with cryptographic approval tokens.
|
|
189
|
+
- `generate_playwright_test`: Generates tests matching your repository's conventions.
|
|
190
|
+
- `ingest_playwright_report`: Analyzes test run failures and flakiness.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 5. CLI Command Cheat Sheet
|
|
195
|
+
|
|
196
|
+
| Command | Usage | Description |
|
|
197
|
+
| :--- | :--- | :--- |
|
|
198
|
+
| `init` | `pw-intel init [--api-key <k>]` | Initializes `.pie/config.json` & optional LLM credentials |
|
|
199
|
+
| `doctor` | `pw-intel doctor` | Verifies Node, Git, Playwright & LLM readiness |
|
|
200
|
+
| `diagnose` | `pw-intel diagnose <trace.zip>` | Ingests trace and outputs causal root cause |
|
|
201
|
+
| `autonomous-repair` | `pw-intel autonomous-repair <trace.zip> --execute` | Verifies repair in an isolated Git worktree |
|
|
202
|
+
| `approve` | `pw-intel approve <proposalId>` | Authorizes a verified repair proposal |
|
|
203
|
+
| `promote` | `pw-intel promote --token <token>` | Applies authorized fix atomically to active code |
|
|
204
|
+
| `generate-agent` | `pw-intel generate-agent <reqs.json> --write` | Generates tests matching project conventions |
|
|
205
|
+
| `reproduce` | `pw-intel reproduce <spec.ts>` | Reruns spec with live DOM and network capture |
|
|
206
|
+
| `ci-report` | `pw-intel ci-report <results.json>` | Generates CI annotations and SARIF report |
|
|
207
|
+
| `mcp` | `pw-intel mcp` | Starts the Model Context Protocol stdio server |
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 6. Detailed Documentation
|
|
212
|
+
|
|
213
|
+
- [CLI Reference Guide](docs/CLI_REFERENCE.md)
|
|
214
|
+
- [System Architecture](docs/ARCHITECTURE.md)
|
|
215
|
+
- [Benchmark Methodology & Results](docs/BENCHMARK.md)
|
|
216
|
+
- [Intent Invariants & Verification Guarantees](docs/INTENT_INVARIANTS.md)
|
|
217
|
+
- [MCP Server Setup](docs/MCP_INTEGRATION.md)
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Community & Contributing
|
|
222
|
+
|
|
223
|
+
Contributions, feedback, and bug reports are warmly welcome! If Playwright Intelligence Engine saves you debugging time or helps stabilize your test suite, please consider giving it a ⭐ on [GitHub](https://github.com/lst2121/playwright-intelligence-engine).
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
Apache-2.0. See [LICENSE](LICENSE) for details.
|
package/bin/pw-intel.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
// Automatically load local .env if present
|
|
6
|
+
try {
|
|
7
|
+
const envCandidates = [
|
|
8
|
+
path.resolve(process.cwd(), '.env'),
|
|
9
|
+
path.resolve(path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, '$1')), '..', '.env')
|
|
10
|
+
];
|
|
11
|
+
for (const envPath of envCandidates) {
|
|
12
|
+
if (fs.existsSync(envPath)) {
|
|
13
|
+
const lines = fs.readFileSync(envPath, 'utf8').split('\n');
|
|
14
|
+
for (const line of lines) {
|
|
15
|
+
const trimmed = line.trim();
|
|
16
|
+
if (!trimmed || trimmed.startsWith('#')) continue;
|
|
17
|
+
const eqIdx = trimmed.indexOf('=');
|
|
18
|
+
if (eqIdx > 0) {
|
|
19
|
+
const k = trimmed.slice(0, eqIdx).trim();
|
|
20
|
+
const v = trimmed.slice(eqIdx + 1).trim().replace(/^['"]|['"]$/g, '');
|
|
21
|
+
if (!process.env[k]) {
|
|
22
|
+
process.env[k] = v;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
} catch {}
|
|
30
|
+
|
|
31
|
+
import { runCli } from '../dist/index.js';
|
|
32
|
+
|
|
33
|
+
runCli(process.argv).catch((err) => {
|
|
34
|
+
console.error('Fatal CLI Error:', err);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
});
|
|
37
|
+
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { ArchitectureMode } from '../generator/architecture-generator.js';
|
|
2
|
+
import type { GeneratedStep } from '../generator/test-generator.js';
|
|
3
|
+
import type { RepositoryConventionProfile, PageObjectExemplar } from '../intelligence/repository-profile.js';
|
|
4
|
+
import type { NamePlan } from './naming/name-plan.js';
|
|
5
|
+
import type { FullGenerationProposal } from './generation-contract.js';
|
|
6
|
+
export type AuthorKind = 'template' | 'hybrid' | 'llm';
|
|
7
|
+
export interface CandidateFile {
|
|
8
|
+
relativePath: string;
|
|
9
|
+
content: string;
|
|
10
|
+
purpose?: string | undefined;
|
|
11
|
+
action?: 'CREATE' | 'MODIFY' | 'SKIP_EXISTING' | undefined;
|
|
12
|
+
rationale?: string | undefined;
|
|
13
|
+
evidenceReferences?: string[] | undefined;
|
|
14
|
+
scenarioIds?: string[] | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface CandidateChange {
|
|
17
|
+
files: CandidateFile[];
|
|
18
|
+
symbols: NamePlan;
|
|
19
|
+
rationale: string;
|
|
20
|
+
authorKind: AuthorKind;
|
|
21
|
+
featureName: string;
|
|
22
|
+
slug: string;
|
|
23
|
+
mode: ArchitectureMode;
|
|
24
|
+
status?: 'GENERATE' | 'NEEDS_INPUT' | 'ABSTAIN' | undefined;
|
|
25
|
+
fullCodeAuthoring?: boolean | undefined;
|
|
26
|
+
usedFallback?: boolean | undefined;
|
|
27
|
+
proposal?: FullGenerationProposal | undefined;
|
|
28
|
+
assumptions?: string[] | undefined;
|
|
29
|
+
requiredClarifications?: string[] | undefined;
|
|
30
|
+
validationErrors?: string[] | undefined;
|
|
31
|
+
}
|
|
32
|
+
export interface FullCodeGenerationInput {
|
|
33
|
+
featureName: string;
|
|
34
|
+
mode: ArchitectureMode;
|
|
35
|
+
baseUrl?: string | undefined;
|
|
36
|
+
requirements?: string | undefined;
|
|
37
|
+
steps?: GeneratedStep[] | undefined;
|
|
38
|
+
profile?: RepositoryConventionProfile | undefined;
|
|
39
|
+
existingFiles?: string[] | undefined;
|
|
40
|
+
exemplars?: PageObjectExemplar[] | undefined;
|
|
41
|
+
contextPacket?: unknown;
|
|
42
|
+
workflowPlan?: unknown;
|
|
43
|
+
explorationBundle?: unknown;
|
|
44
|
+
scenarios?: unknown;
|
|
45
|
+
existingFileSnapshots?: Array<{
|
|
46
|
+
path: string;
|
|
47
|
+
content: string;
|
|
48
|
+
hash?: string | undefined;
|
|
49
|
+
}> | undefined;
|
|
50
|
+
allowedEvidenceIds?: string[] | undefined;
|
|
51
|
+
feedback?: string[] | undefined;
|
|
52
|
+
}
|
|
53
|
+
export interface FullCodeGenerationProvider {
|
|
54
|
+
generate(input: FullCodeGenerationInput): Promise<unknown>;
|
|
55
|
+
}
|
|
56
|
+
export interface AuthorInput {
|
|
57
|
+
featureName: string;
|
|
58
|
+
mode: ArchitectureMode;
|
|
59
|
+
baseUrl?: string | undefined;
|
|
60
|
+
requirements?: string | undefined;
|
|
61
|
+
steps?: GeneratedStep[] | undefined;
|
|
62
|
+
profile?: RepositoryConventionProfile | undefined;
|
|
63
|
+
existingFiles?: string[] | undefined;
|
|
64
|
+
exemplars?: PageObjectExemplar[] | undefined;
|
|
65
|
+
contextPacket?: unknown;
|
|
66
|
+
workflowPlan?: unknown;
|
|
67
|
+
explorationBundle?: unknown;
|
|
68
|
+
scenarios?: unknown;
|
|
69
|
+
existingFileSnapshots?: Array<{
|
|
70
|
+
path: string;
|
|
71
|
+
content: string;
|
|
72
|
+
hash?: string | undefined;
|
|
73
|
+
}> | undefined;
|
|
74
|
+
allowedEvidenceIds?: string[] | undefined;
|
|
75
|
+
requireEvidenceReferences?: boolean | undefined;
|
|
76
|
+
fullCodeProvider?: FullCodeGenerationProvider | undefined;
|
|
77
|
+
feedback?: string[] | undefined;
|
|
78
|
+
}
|
|
79
|
+
export interface Author {
|
|
80
|
+
readonly kind: AuthorKind;
|
|
81
|
+
propose(input: AuthorInput): Promise<CandidateChange>;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=author.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"author.d.ts","sourceRoot":"","sources":["../../src/authoring/author.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC7G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEvE,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,eAAe,GAAG,SAAS,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,OAAO,EAAE,QAAQ,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,MAAM,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AE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CACvD"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GeneratedFileProposalSchema: z.ZodObject<{
|
|
3
|
+
path: z.ZodString;
|
|
4
|
+
action: z.ZodEnum<{
|
|
5
|
+
create: "create";
|
|
6
|
+
modify: "modify";
|
|
7
|
+
}>;
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
rationale: z.ZodString;
|
|
10
|
+
evidenceReferences: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
11
|
+
scenarioIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export type GeneratedFileProposal = z.infer<typeof GeneratedFileProposalSchema>;
|
|
14
|
+
export declare const GenerationAssumptionSchema: z.ZodObject<{
|
|
15
|
+
description: z.ZodString;
|
|
16
|
+
impact: z.ZodEnum<{
|
|
17
|
+
high: "high";
|
|
18
|
+
low: "low";
|
|
19
|
+
medium: "medium";
|
|
20
|
+
}>;
|
|
21
|
+
evidenceAvailable: z.ZodBoolean;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
export type GenerationAssumption = z.infer<typeof GenerationAssumptionSchema>;
|
|
24
|
+
export declare const GeneratedTestMatrixEntrySchema: z.ZodObject<{
|
|
25
|
+
scenarioId: z.ZodString;
|
|
26
|
+
title: z.ZodString;
|
|
27
|
+
category: z.ZodString;
|
|
28
|
+
testFile: z.ZodString;
|
|
29
|
+
coveredAssertions: z.ZodArray<z.ZodString>;
|
|
30
|
+
evidenceReferences: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
export type GeneratedTestMatrixEntry = z.infer<typeof GeneratedTestMatrixEntrySchema>;
|
|
33
|
+
export declare const FullGenerationProposalSchema: z.ZodObject<{
|
|
34
|
+
schemaVersion: z.ZodDefault<z.ZodLiteral<"1.0">>;
|
|
35
|
+
status: z.ZodEnum<{
|
|
36
|
+
ABSTAIN: "ABSTAIN";
|
|
37
|
+
GENERATE: "GENERATE";
|
|
38
|
+
NEEDS_INPUT: "NEEDS_INPUT";
|
|
39
|
+
}>;
|
|
40
|
+
summary: z.ZodString;
|
|
41
|
+
files: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
42
|
+
path: z.ZodString;
|
|
43
|
+
action: z.ZodEnum<{
|
|
44
|
+
create: "create";
|
|
45
|
+
modify: "modify";
|
|
46
|
+
}>;
|
|
47
|
+
content: z.ZodString;
|
|
48
|
+
rationale: z.ZodString;
|
|
49
|
+
evidenceReferences: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
50
|
+
scenarioIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
51
|
+
}, z.core.$strict>>>;
|
|
52
|
+
testMatrix: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
53
|
+
scenarioId: z.ZodString;
|
|
54
|
+
title: z.ZodString;
|
|
55
|
+
category: z.ZodString;
|
|
56
|
+
testFile: z.ZodString;
|
|
57
|
+
coveredAssertions: z.ZodArray<z.ZodString>;
|
|
58
|
+
evidenceReferences: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
59
|
+
}, z.core.$strict>>>;
|
|
60
|
+
assumptions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
61
|
+
description: z.ZodString;
|
|
62
|
+
impact: z.ZodEnum<{
|
|
63
|
+
high: "high";
|
|
64
|
+
low: "low";
|
|
65
|
+
medium: "medium";
|
|
66
|
+
}>;
|
|
67
|
+
evidenceAvailable: z.ZodBoolean;
|
|
68
|
+
}, z.core.$strict>>>;
|
|
69
|
+
requiredClarifications: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
70
|
+
evidenceReferences: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
export type FullGenerationProposal = z.infer<typeof FullGenerationProposalSchema>;
|
|
73
|
+
export interface ProposalValidationOptions {
|
|
74
|
+
allowedEvidenceIds?: Set<string> | undefined;
|
|
75
|
+
protectedPaths?: Set<string> | undefined;
|
|
76
|
+
existingFiles?: Set<string> | undefined;
|
|
77
|
+
requireEvidenceReferences?: boolean | undefined;
|
|
78
|
+
maxFileBytes?: number | undefined;
|
|
79
|
+
}
|
|
80
|
+
export interface ProposalValidationResult {
|
|
81
|
+
isValid: boolean;
|
|
82
|
+
proposal?: FullGenerationProposal | undefined;
|
|
83
|
+
errors: string[];
|
|
84
|
+
warnings: string[];
|
|
85
|
+
}
|
|
86
|
+
export declare function normalizeProposalPath(filePath: string): string;
|
|
87
|
+
export declare function isSafeRelativeProposalPath(filePath: string): boolean;
|
|
88
|
+
export declare function validateFullGenerationProposal(raw: unknown, options?: ProposalValidationOptions): ProposalValidationResult;
|
|
89
|
+
export declare function buildTierL2SystemPrompt(): string;
|
|
90
|
+
//# sourceMappingURL=generation-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generation-contract.d.ts","sourceRoot":"","sources":["../../src/authoring/generation-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,2BAA2B;;;;;;;;;;kBAO7B,CAAC;AAEZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,0BAA0B;;;;;;;;kBAI5B,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,8BAA8B;;;;;;;kBAOhC,CAAC;AAEZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authoring/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
|