@yasserkhanorg/impact-gate 2.0.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/LICENSE +168 -0
- package/README.md +520 -0
- package/dist/adapters/cypress.d.ts +10 -0
- package/dist/adapters/cypress.d.ts.map +1 -0
- package/dist/adapters/cypress.js +86 -0
- package/dist/adapters/framework_adapter.d.ts +41 -0
- package/dist/adapters/framework_adapter.d.ts.map +1 -0
- package/dist/adapters/framework_adapter.js +152 -0
- package/dist/adapters/playwright.d.ts +10 -0
- package/dist/adapters/playwright.d.ts.map +1 -0
- package/dist/adapters/playwright.js +86 -0
- package/dist/adapters/pytest.d.ts +10 -0
- package/dist/adapters/pytest.d.ts.map +1 -0
- package/dist/adapters/pytest.js +96 -0
- package/dist/adapters/supertest.d.ts +12 -0
- package/dist/adapters/supertest.d.ts.map +1 -0
- package/dist/adapters/supertest.js +85 -0
- package/dist/agent/api_catalog.d.ts +11 -0
- package/dist/agent/api_catalog.d.ts.map +1 -0
- package/dist/agent/api_catalog.js +210 -0
- package/dist/agent/config.d.ts +193 -0
- package/dist/agent/config.d.ts.map +1 -0
- package/dist/agent/config.js +875 -0
- package/dist/agent/feedback.d.ts +91 -0
- package/dist/agent/feedback.d.ts.map +1 -0
- package/dist/agent/feedback.js +323 -0
- package/dist/agent/git.d.ts +19 -0
- package/dist/agent/git.d.ts.map +1 -0
- package/dist/agent/git.js +257 -0
- package/dist/agent/handoff.d.ts +22 -0
- package/dist/agent/handoff.d.ts.map +1 -0
- package/dist/agent/handoff.js +180 -0
- package/dist/agent/llm_agents_flow.d.ts +15 -0
- package/dist/agent/llm_agents_flow.d.ts.map +1 -0
- package/dist/agent/llm_agents_flow.js +434 -0
- package/dist/agent/native_flow.d.ts +6 -0
- package/dist/agent/native_flow.d.ts.map +1 -0
- package/dist/agent/native_flow.js +179 -0
- package/dist/agent/pipeline.d.ts +7 -0
- package/dist/agent/pipeline.d.ts.map +1 -0
- package/dist/agent/pipeline.js +260 -0
- package/dist/agent/pipeline_types.d.ts +54 -0
- package/dist/agent/pipeline_types.d.ts.map +1 -0
- package/dist/agent/pipeline_types.js +4 -0
- package/dist/agent/pipeline_utils.d.ts +12 -0
- package/dist/agent/pipeline_utils.d.ts.map +1 -0
- package/dist/agent/pipeline_utils.js +156 -0
- package/dist/agent/plan.d.ts +170 -0
- package/dist/agent/plan.d.ts.map +1 -0
- package/dist/agent/plan.js +86 -0
- package/dist/agent/playwright_report.d.ts +8 -0
- package/dist/agent/playwright_report.d.ts.map +1 -0
- package/dist/agent/playwright_report.js +126 -0
- package/dist/agent/process_runner.d.ts +10 -0
- package/dist/agent/process_runner.d.ts.map +1 -0
- package/dist/agent/process_runner.js +92 -0
- package/dist/agent/spec_generator.d.ts +5 -0
- package/dist/agent/spec_generator.d.ts.map +1 -0
- package/dist/agent/spec_generator.js +253 -0
- package/dist/agent/test_path.d.ts +2 -0
- package/dist/agent/test_path.d.ts.map +1 -0
- package/dist/agent/test_path.js +23 -0
- package/dist/agent/traceability_capture.d.ts +18 -0
- package/dist/agent/traceability_capture.d.ts.map +1 -0
- package/dist/agent/traceability_capture.js +313 -0
- package/dist/agent/traceability_ingest.d.ts +21 -0
- package/dist/agent/traceability_ingest.d.ts.map +1 -0
- package/dist/agent/traceability_ingest.js +237 -0
- package/dist/agent/types.d.ts +42 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +4 -0
- package/dist/agent/utils.d.ts +13 -0
- package/dist/agent/utils.d.ts.map +1 -0
- package/dist/agent/utils.js +152 -0
- package/dist/agent/validation_runner.d.ts +5 -0
- package/dist/agent/validation_runner.d.ts.map +1 -0
- package/dist/agent/validation_runner.js +77 -0
- package/dist/agentic/fix_loop.d.ts +26 -0
- package/dist/agentic/fix_loop.d.ts.map +1 -0
- package/dist/agentic/fix_loop.js +96 -0
- package/dist/agentic/playwright_runner.d.ts +43 -0
- package/dist/agentic/playwright_runner.d.ts.map +1 -0
- package/dist/agentic/playwright_runner.js +165 -0
- package/dist/agentic/runner.d.ts +27 -0
- package/dist/agentic/runner.d.ts.map +1 -0
- package/dist/agentic/runner.js +210 -0
- package/dist/agentic/types.d.ts +62 -0
- package/dist/agentic/types.d.ts.map +1 -0
- package/dist/agentic/types.js +4 -0
- package/dist/agents/coverage-evaluator.d.ts +8 -0
- package/dist/agents/coverage-evaluator.d.ts.map +1 -0
- package/dist/agents/coverage-evaluator.js +41 -0
- package/dist/agents/cross-impact.d.ts +13 -0
- package/dist/agents/cross-impact.d.ts.map +1 -0
- package/dist/agents/cross-impact.js +140 -0
- package/dist/agents/executor.d.ts +8 -0
- package/dist/agents/executor.d.ts.map +1 -0
- package/dist/agents/executor.js +75 -0
- package/dist/agents/explorer.d.ts +12 -0
- package/dist/agents/explorer.d.ts.map +1 -0
- package/dist/agents/explorer.js +43 -0
- package/dist/agents/generator.d.ts +8 -0
- package/dist/agents/generator.d.ts.map +1 -0
- package/dist/agents/generator.js +77 -0
- package/dist/agents/healer.d.ts +8 -0
- package/dist/agents/healer.d.ts.map +1 -0
- package/dist/agents/healer.js +31 -0
- package/dist/agents/impact-analyst.d.ts +8 -0
- package/dist/agents/impact-analyst.d.ts.map +1 -0
- package/dist/agents/impact-analyst.js +38 -0
- package/dist/agents/regression-advisor.d.ts +8 -0
- package/dist/agents/regression-advisor.d.ts.map +1 -0
- package/dist/agents/regression-advisor.js +116 -0
- package/dist/agents/strategist.d.ts +9 -0
- package/dist/agents/strategist.d.ts.map +1 -0
- package/dist/agents/strategist.js +92 -0
- package/dist/agents/test-designer.d.ts +8 -0
- package/dist/agents/test-designer.d.ts.map +1 -0
- package/dist/agents/test-designer.js +111 -0
- package/dist/anthropic_provider.d.ts +65 -0
- package/dist/anthropic_provider.d.ts.map +1 -0
- package/dist/anthropic_provider.js +334 -0
- package/dist/api.d.ts +48 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +151 -0
- package/dist/base_provider.d.ts +109 -0
- package/dist/base_provider.d.ts.map +1 -0
- package/dist/base_provider.js +203 -0
- package/dist/budget_ledger.d.ts +28 -0
- package/dist/budget_ledger.d.ts.map +1 -0
- package/dist/budget_ledger.js +62 -0
- package/dist/cache/cached_provider.d.ts +49 -0
- package/dist/cache/cached_provider.d.ts.map +1 -0
- package/dist/cache/cached_provider.js +91 -0
- package/dist/cache/response_cache.d.ts +79 -0
- package/dist/cache/response_cache.d.ts.map +1 -0
- package/dist/cache/response_cache.js +177 -0
- package/dist/cli/commands/analyze.d.ts +3 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +77 -0
- package/dist/cli/commands/bootstrap.d.ts +3 -0
- package/dist/cli/commands/bootstrap.d.ts.map +1 -0
- package/dist/cli/commands/bootstrap.js +109 -0
- package/dist/cli/commands/cost_report.d.ts +3 -0
- package/dist/cli/commands/cost_report.d.ts.map +1 -0
- package/dist/cli/commands/cost_report.js +115 -0
- package/dist/cli/commands/crew.d.ts +3 -0
- package/dist/cli/commands/crew.d.ts.map +1 -0
- package/dist/cli/commands/crew.js +255 -0
- package/dist/cli/commands/feedback.d.ts +3 -0
- package/dist/cli/commands/feedback.d.ts.map +1 -0
- package/dist/cli/commands/feedback.js +39 -0
- package/dist/cli/commands/finalize.d.ts +3 -0
- package/dist/cli/commands/finalize.d.ts.map +1 -0
- package/dist/cli/commands/finalize.js +41 -0
- package/dist/cli/commands/gate.d.ts +3 -0
- package/dist/cli/commands/gate.d.ts.map +1 -0
- package/dist/cli/commands/gate.js +89 -0
- package/dist/cli/commands/generate.d.ts +4 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +108 -0
- package/dist/cli/commands/heal.d.ts +3 -0
- package/dist/cli/commands/heal.d.ts.map +1 -0
- package/dist/cli/commands/heal.js +60 -0
- package/dist/cli/commands/impact.d.ts +4 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +33 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +169 -0
- package/dist/cli/commands/llm_health.d.ts +2 -0
- package/dist/cli/commands/llm_health.d.ts.map +1 -0
- package/dist/cli/commands/llm_health.js +22 -0
- package/dist/cli/commands/plan.d.ts +4 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +120 -0
- package/dist/cli/commands/plan_crew.d.ts +17 -0
- package/dist/cli/commands/plan_crew.d.ts.map +1 -0
- package/dist/cli/commands/plan_crew.js +316 -0
- package/dist/cli/commands/traceability.d.ts +4 -0
- package/dist/cli/commands/traceability.d.ts.map +1 -0
- package/dist/cli/commands/traceability.js +77 -0
- package/dist/cli/commands/train.d.ts +3 -0
- package/dist/cli/commands/train.d.ts.map +1 -0
- package/dist/cli/commands/train.js +391 -0
- package/dist/cli/defaults.d.ts +35 -0
- package/dist/cli/defaults.d.ts.map +1 -0
- package/dist/cli/defaults.js +172 -0
- package/dist/cli/errors.d.ts +27 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/errors.js +57 -0
- package/dist/cli/parse_args.d.ts +6 -0
- package/dist/cli/parse_args.d.ts.map +1 -0
- package/dist/cli/parse_args.js +257 -0
- package/dist/cli/types.d.ts +87 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +4 -0
- package/dist/cli/usage.d.ts +2 -0
- package/dist/cli/usage.d.ts.map +1 -0
- package/dist/cli/usage.js +109 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +194 -0
- package/dist/crew/context.d.ts +55 -0
- package/dist/crew/context.d.ts.map +1 -0
- package/dist/crew/context.js +36 -0
- package/dist/crew/orchestrator.d.ts +50 -0
- package/dist/crew/orchestrator.d.ts.map +1 -0
- package/dist/crew/orchestrator.js +329 -0
- package/dist/crew/protocol.d.ts +46 -0
- package/dist/crew/protocol.d.ts.map +1 -0
- package/dist/crew/protocol.js +4 -0
- package/dist/crew/provider.d.ts +17 -0
- package/dist/crew/provider.d.ts.map +1 -0
- package/dist/crew/provider.js +36 -0
- package/dist/crew/sanitize.d.ts +3 -0
- package/dist/crew/sanitize.d.ts.map +1 -0
- package/dist/crew/sanitize.js +31 -0
- package/dist/crew/types.d.ts +52 -0
- package/dist/crew/types.d.ts.map +1 -0
- package/dist/crew/types.js +4 -0
- package/dist/crew/workflows.d.ts +52 -0
- package/dist/crew/workflows.d.ts.map +1 -0
- package/dist/crew/workflows.js +36 -0
- package/dist/custom_provider.d.ts +20 -0
- package/dist/custom_provider.d.ts.map +1 -0
- package/dist/custom_provider.js +277 -0
- package/dist/engine/ai_enrichment.d.ts +44 -0
- package/dist/engine/ai_enrichment.d.ts.map +1 -0
- package/dist/engine/ai_enrichment.js +267 -0
- package/dist/engine/diff_loader.d.ts +11 -0
- package/dist/engine/diff_loader.d.ts.map +1 -0
- package/dist/engine/diff_loader.js +63 -0
- package/dist/engine/impact_engine.d.ts +72 -0
- package/dist/engine/impact_engine.d.ts.map +1 -0
- package/dist/engine/impact_engine.js +298 -0
- package/dist/engine/plan_builder.d.ts +11 -0
- package/dist/engine/plan_builder.d.ts.map +1 -0
- package/dist/engine/plan_builder.js +599 -0
- package/dist/esm/adapters/cypress.js +49 -0
- package/dist/esm/adapters/framework_adapter.js +114 -0
- package/dist/esm/adapters/playwright.js +49 -0
- package/dist/esm/adapters/pytest.js +59 -0
- package/dist/esm/adapters/supertest.js +48 -0
- package/dist/esm/agent/api_catalog.js +199 -0
- package/dist/esm/agent/config.js +872 -0
- package/dist/esm/agent/feedback.js +317 -0
- package/dist/esm/agent/git.js +252 -0
- package/dist/esm/agent/handoff.js +177 -0
- package/dist/esm/agent/llm_agents_flow.js +421 -0
- package/dist/esm/agent/native_flow.js +175 -0
- package/dist/esm/agent/pipeline.js +256 -0
- package/dist/esm/agent/pipeline_types.js +3 -0
- package/dist/esm/agent/pipeline_utils.js +146 -0
- package/dist/esm/agent/plan.js +83 -0
- package/dist/esm/agent/playwright_report.js +123 -0
- package/dist/esm/agent/process_runner.js +83 -0
- package/dist/esm/agent/spec_generator.js +249 -0
- package/dist/esm/agent/test_path.js +20 -0
- package/dist/esm/agent/traceability_capture.js +310 -0
- package/dist/esm/agent/traceability_ingest.js +234 -0
- package/dist/esm/agent/types.js +3 -0
- package/dist/esm/agent/utils.js +138 -0
- package/dist/esm/agent/validation_runner.js +73 -0
- package/dist/esm/agentic/fix_loop.js +91 -0
- package/dist/esm/agentic/playwright_runner.js +161 -0
- package/dist/esm/agentic/runner.js +207 -0
- package/dist/esm/agentic/types.js +3 -0
- package/dist/esm/agents/coverage-evaluator.js +37 -0
- package/dist/esm/agents/cross-impact.js +136 -0
- package/dist/esm/agents/executor.js +71 -0
- package/dist/esm/agents/explorer.js +39 -0
- package/dist/esm/agents/generator.js +73 -0
- package/dist/esm/agents/healer.js +27 -0
- package/dist/esm/agents/impact-analyst.js +34 -0
- package/dist/esm/agents/regression-advisor.js +112 -0
- package/dist/esm/agents/strategist.js +88 -0
- package/dist/esm/agents/test-designer.js +107 -0
- package/dist/esm/anthropic_provider.js +326 -0
- package/dist/esm/api.js +143 -0
- package/dist/esm/base_provider.js +198 -0
- package/dist/esm/budget_ledger.js +58 -0
- package/dist/esm/cache/cached_provider.js +85 -0
- package/dist/esm/cache/response_cache.js +140 -0
- package/dist/esm/cli/commands/analyze.js +74 -0
- package/dist/esm/cli/commands/bootstrap.js +106 -0
- package/dist/esm/cli/commands/cost_report.js +112 -0
- package/dist/esm/cli/commands/crew.js +252 -0
- package/dist/esm/cli/commands/feedback.js +36 -0
- package/dist/esm/cli/commands/finalize.js +38 -0
- package/dist/esm/cli/commands/gate.js +86 -0
- package/dist/esm/cli/commands/generate.js +105 -0
- package/dist/esm/cli/commands/heal.js +57 -0
- package/dist/esm/cli/commands/impact.js +30 -0
- package/dist/esm/cli/commands/init.js +133 -0
- package/dist/esm/cli/commands/llm_health.js +19 -0
- package/dist/esm/cli/commands/plan.js +117 -0
- package/dist/esm/cli/commands/plan_crew.js +309 -0
- package/dist/esm/cli/commands/traceability.js +73 -0
- package/dist/esm/cli/commands/train.js +355 -0
- package/dist/esm/cli/defaults.js +165 -0
- package/dist/esm/cli/errors.js +52 -0
- package/dist/esm/cli/parse_args.js +251 -0
- package/dist/esm/cli/types.js +3 -0
- package/dist/esm/cli/usage.js +106 -0
- package/dist/esm/cli.js +192 -0
- package/dist/esm/crew/context.js +32 -0
- package/dist/esm/crew/orchestrator.js +325 -0
- package/dist/esm/crew/protocol.js +3 -0
- package/dist/esm/crew/provider.js +33 -0
- package/dist/esm/crew/sanitize.js +27 -0
- package/dist/esm/crew/types.js +3 -0
- package/dist/esm/crew/workflows.js +33 -0
- package/dist/esm/custom_provider.js +273 -0
- package/dist/esm/engine/ai_enrichment.js +264 -0
- package/dist/esm/engine/diff_loader.js +59 -0
- package/dist/esm/engine/impact_engine.js +291 -0
- package/dist/esm/engine/plan_builder.js +593 -0
- package/dist/esm/index.js +72 -0
- package/dist/esm/knowledge/api_surface.js +408 -0
- package/dist/esm/knowledge/cluster_utils.js +60 -0
- package/dist/esm/knowledge/context_loader.js +85 -0
- package/dist/esm/knowledge/failure_history.js +121 -0
- package/dist/esm/knowledge/kg_bridge.js +381 -0
- package/dist/esm/knowledge/kg_types.js +3 -0
- package/dist/esm/knowledge/route_families.js +393 -0
- package/dist/esm/knowledge/spec_index.js +122 -0
- package/dist/esm/logger.js +115 -0
- package/dist/esm/mcp-server.js +621 -0
- package/dist/esm/metrics/prometheus.js +149 -0
- package/dist/esm/model_router.js +59 -0
- package/dist/esm/ollama_provider.js +301 -0
- package/dist/esm/openai_provider.js +243 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/pipeline/orchestrator.js +228 -0
- package/dist/esm/pipeline/spec_verifier.js +75 -0
- package/dist/esm/pipeline/stage0_preprocess.js +102 -0
- package/dist/esm/pipeline/stage1_impact.js +140 -0
- package/dist/esm/pipeline/stage2_coverage.js +153 -0
- package/dist/esm/pipeline/stage3_generation.js +284 -0
- package/dist/esm/pipeline/stage4_heal.js +288 -0
- package/dist/esm/progress.js +112 -0
- package/dist/esm/prompts/coverage.js +57 -0
- package/dist/esm/prompts/cross-impact.js +53 -0
- package/dist/esm/prompts/generation.js +297 -0
- package/dist/esm/prompts/generation_profile.js +147 -0
- package/dist/esm/prompts/heal.js +91 -0
- package/dist/esm/prompts/impact.js +63 -0
- package/dist/esm/prompts/json_extract.js +36 -0
- package/dist/esm/prompts/strategist.js +61 -0
- package/dist/esm/prompts/test-designer.js +92 -0
- package/dist/esm/provider_factory.js +366 -0
- package/dist/esm/provider_interface.js +23 -0
- package/dist/esm/provider_utils.js +96 -0
- package/dist/esm/qa-agent/cli.js +205 -0
- package/dist/esm/qa-agent/orchestrator.js +120 -0
- package/dist/esm/qa-agent/phase1/runner.js +139 -0
- package/dist/esm/qa-agent/phase1/scope.js +126 -0
- package/dist/esm/qa-agent/phase2/agent_browser.js +95 -0
- package/dist/esm/qa-agent/phase2/agent_loop.js +351 -0
- package/dist/esm/qa-agent/phase2/exploration_state.js +97 -0
- package/dist/esm/qa-agent/phase2/tools.js +386 -0
- package/dist/esm/qa-agent/phase2/vision.js +75 -0
- package/dist/esm/qa-agent/phase3/feedback.js +34 -0
- package/dist/esm/qa-agent/phase3/reporter.js +145 -0
- package/dist/esm/qa-agent/phase3/spec_generator.js +62 -0
- package/dist/esm/qa-agent/phase3/verdict.js +66 -0
- package/dist/esm/qa-agent/safe_env.js +23 -0
- package/dist/esm/qa-agent/types.js +3 -0
- package/dist/esm/reporters/junit.js +86 -0
- package/dist/esm/reporters/reporter.js +3 -0
- package/dist/esm/reporters/sarif.js +132 -0
- package/dist/esm/resilience/circuit_breaker.js +78 -0
- package/dist/esm/resilience/retry.js +56 -0
- package/dist/esm/sanitize.js +66 -0
- package/dist/esm/training/enricher.js +345 -0
- package/dist/esm/training/kg_scanner.js +115 -0
- package/dist/esm/training/merger.js +204 -0
- package/dist/esm/training/scanner.js +923 -0
- package/dist/esm/training/types.js +6 -0
- package/dist/esm/training/validator.js +254 -0
- package/dist/esm/validation/guardrails.js +101 -0
- package/dist/esm/validation/output_schema.js +80 -0
- package/dist/esm/version.js +33 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +169 -0
- package/dist/knowledge/api_surface.d.ts +37 -0
- package/dist/knowledge/api_surface.d.ts.map +1 -0
- package/dist/knowledge/api_surface.js +418 -0
- package/dist/knowledge/cluster_utils.d.ts +28 -0
- package/dist/knowledge/cluster_utils.d.ts.map +1 -0
- package/dist/knowledge/cluster_utils.js +67 -0
- package/dist/knowledge/context_loader.d.ts +13 -0
- package/dist/knowledge/context_loader.d.ts.map +1 -0
- package/dist/knowledge/context_loader.js +90 -0
- package/dist/knowledge/failure_history.d.ts +39 -0
- package/dist/knowledge/failure_history.d.ts.map +1 -0
- package/dist/knowledge/failure_history.js +128 -0
- package/dist/knowledge/kg_bridge.d.ts +31 -0
- package/dist/knowledge/kg_bridge.d.ts.map +1 -0
- package/dist/knowledge/kg_bridge.js +388 -0
- package/dist/knowledge/kg_types.d.ts +75 -0
- package/dist/knowledge/kg_types.d.ts.map +1 -0
- package/dist/knowledge/kg_types.js +4 -0
- package/dist/knowledge/route_families.d.ts +98 -0
- package/dist/knowledge/route_families.d.ts.map +1 -0
- package/dist/knowledge/route_families.js +410 -0
- package/dist/knowledge/spec_index.d.ts +18 -0
- package/dist/knowledge/spec_index.d.ts.map +1 -0
- package/dist/knowledge/spec_index.js +128 -0
- package/dist/logger.d.ts +31 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +119 -0
- package/dist/mcp-server.d.ts +68 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +629 -0
- package/dist/metrics/prometheus.d.ts +37 -0
- package/dist/metrics/prometheus.d.ts.map +1 -0
- package/dist/metrics/prometheus.js +153 -0
- package/dist/model_router.d.ts +28 -0
- package/dist/model_router.d.ts.map +1 -0
- package/dist/model_router.js +63 -0
- package/dist/ollama_provider.d.ts +65 -0
- package/dist/ollama_provider.d.ts.map +1 -0
- package/dist/ollama_provider.js +309 -0
- package/dist/openai_provider.d.ts +23 -0
- package/dist/openai_provider.d.ts.map +1 -0
- package/dist/openai_provider.js +251 -0
- package/dist/pipeline/orchestrator.d.ts +33 -0
- package/dist/pipeline/orchestrator.d.ts.map +1 -0
- package/dist/pipeline/orchestrator.js +231 -0
- package/dist/pipeline/spec_verifier.d.ts +20 -0
- package/dist/pipeline/spec_verifier.d.ts.map +1 -0
- package/dist/pipeline/spec_verifier.js +79 -0
- package/dist/pipeline/stage0_preprocess.d.ts +31 -0
- package/dist/pipeline/stage0_preprocess.d.ts.map +1 -0
- package/dist/pipeline/stage0_preprocess.js +105 -0
- package/dist/pipeline/stage1_impact.d.ts +19 -0
- package/dist/pipeline/stage1_impact.d.ts.map +1 -0
- package/dist/pipeline/stage1_impact.js +143 -0
- package/dist/pipeline/stage2_coverage.d.ts +19 -0
- package/dist/pipeline/stage2_coverage.d.ts.map +1 -0
- package/dist/pipeline/stage2_coverage.js +156 -0
- package/dist/pipeline/stage3_generation.d.ts +43 -0
- package/dist/pipeline/stage3_generation.d.ts.map +1 -0
- package/dist/pipeline/stage3_generation.js +287 -0
- package/dist/pipeline/stage4_heal.d.ts +62 -0
- package/dist/pipeline/stage4_heal.d.ts.map +1 -0
- package/dist/pipeline/stage4_heal.js +294 -0
- package/dist/progress.d.ts +22 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +116 -0
- package/dist/prompts/coverage.d.ts +39 -0
- package/dist/prompts/coverage.d.ts.map +1 -0
- package/dist/prompts/coverage.js +61 -0
- package/dist/prompts/cross-impact.d.ts +23 -0
- package/dist/prompts/cross-impact.d.ts.map +1 -0
- package/dist/prompts/cross-impact.js +57 -0
- package/dist/prompts/generation.d.ts +25 -0
- package/dist/prompts/generation.d.ts.map +1 -0
- package/dist/prompts/generation.js +302 -0
- package/dist/prompts/generation_profile.d.ts +29 -0
- package/dist/prompts/generation_profile.d.ts.map +1 -0
- package/dist/prompts/generation_profile.js +151 -0
- package/dist/prompts/heal.d.ts +23 -0
- package/dist/prompts/heal.d.ts.map +1 -0
- package/dist/prompts/heal.js +95 -0
- package/dist/prompts/impact.d.ts +31 -0
- package/dist/prompts/impact.d.ts.map +1 -0
- package/dist/prompts/impact.js +67 -0
- package/dist/prompts/json_extract.d.ts +14 -0
- package/dist/prompts/json_extract.d.ts.map +1 -0
- package/dist/prompts/json_extract.js +39 -0
- package/dist/prompts/strategist.d.ts +25 -0
- package/dist/prompts/strategist.d.ts.map +1 -0
- package/dist/prompts/strategist.js +65 -0
- package/dist/prompts/test-designer.d.ts +35 -0
- package/dist/prompts/test-designer.d.ts.map +1 -0
- package/dist/prompts/test-designer.js +96 -0
- package/dist/provider_factory.d.ts +104 -0
- package/dist/provider_factory.d.ts.map +1 -0
- package/dist/provider_factory.js +371 -0
- package/dist/provider_interface.d.ts +365 -0
- package/dist/provider_interface.d.ts.map +1 -0
- package/dist/provider_interface.js +28 -0
- package/dist/provider_utils.d.ts +39 -0
- package/dist/provider_utils.d.ts.map +1 -0
- package/dist/provider_utils.js +103 -0
- package/dist/qa-agent/cli.d.ts +3 -0
- package/dist/qa-agent/cli.d.ts.map +1 -0
- package/dist/qa-agent/cli.js +207 -0
- package/dist/qa-agent/orchestrator.d.ts +3 -0
- package/dist/qa-agent/orchestrator.d.ts.map +1 -0
- package/dist/qa-agent/orchestrator.js +123 -0
- package/dist/qa-agent/phase1/runner.d.ts +3 -0
- package/dist/qa-agent/phase1/runner.d.ts.map +1 -0
- package/dist/qa-agent/phase1/runner.js +142 -0
- package/dist/qa-agent/phase1/scope.d.ts +6 -0
- package/dist/qa-agent/phase1/scope.d.ts.map +1 -0
- package/dist/qa-agent/phase1/scope.js +129 -0
- package/dist/qa-agent/phase2/agent_browser.d.ts +35 -0
- package/dist/qa-agent/phase2/agent_browser.d.ts.map +1 -0
- package/dist/qa-agent/phase2/agent_browser.js +99 -0
- package/dist/qa-agent/phase2/agent_loop.d.ts +3 -0
- package/dist/qa-agent/phase2/agent_loop.d.ts.map +1 -0
- package/dist/qa-agent/phase2/agent_loop.js +357 -0
- package/dist/qa-agent/phase2/exploration_state.d.ts +12 -0
- package/dist/qa-agent/phase2/exploration_state.d.ts.map +1 -0
- package/dist/qa-agent/phase2/exploration_state.js +109 -0
- package/dist/qa-agent/phase2/tools.d.ts +28 -0
- package/dist/qa-agent/phase2/tools.d.ts.map +1 -0
- package/dist/qa-agent/phase2/tools.js +390 -0
- package/dist/qa-agent/phase2/vision.d.ts +3 -0
- package/dist/qa-agent/phase2/vision.d.ts.map +1 -0
- package/dist/qa-agent/phase2/vision.js +78 -0
- package/dist/qa-agent/phase3/feedback.d.ts +3 -0
- package/dist/qa-agent/phase3/feedback.d.ts.map +1 -0
- package/dist/qa-agent/phase3/feedback.js +37 -0
- package/dist/qa-agent/phase3/reporter.d.ts +3 -0
- package/dist/qa-agent/phase3/reporter.d.ts.map +1 -0
- package/dist/qa-agent/phase3/reporter.js +148 -0
- package/dist/qa-agent/phase3/spec_generator.d.ts +3 -0
- package/dist/qa-agent/phase3/spec_generator.d.ts.map +1 -0
- package/dist/qa-agent/phase3/spec_generator.js +65 -0
- package/dist/qa-agent/phase3/verdict.d.ts +3 -0
- package/dist/qa-agent/phase3/verdict.d.ts.map +1 -0
- package/dist/qa-agent/phase3/verdict.js +69 -0
- package/dist/qa-agent/safe_env.d.ts +3 -0
- package/dist/qa-agent/safe_env.d.ts.map +1 -0
- package/dist/qa-agent/safe_env.js +26 -0
- package/dist/qa-agent/types.d.ts +130 -0
- package/dist/qa-agent/types.d.ts.map +1 -0
- package/dist/qa-agent/types.js +4 -0
- package/dist/reporters/junit.d.ts +6 -0
- package/dist/reporters/junit.d.ts.map +1 -0
- package/dist/reporters/junit.js +89 -0
- package/dist/reporters/reporter.d.ts +42 -0
- package/dist/reporters/reporter.d.ts.map +1 -0
- package/dist/reporters/reporter.js +4 -0
- package/dist/reporters/sarif.d.ts +7 -0
- package/dist/reporters/sarif.d.ts.map +1 -0
- package/dist/reporters/sarif.js +135 -0
- package/dist/resilience/circuit_breaker.d.ts +36 -0
- package/dist/resilience/circuit_breaker.d.ts.map +1 -0
- package/dist/resilience/circuit_breaker.js +82 -0
- package/dist/resilience/retry.d.ts +11 -0
- package/dist/resilience/retry.d.ts.map +1 -0
- package/dist/resilience/retry.js +59 -0
- package/dist/sanitize.d.ts +15 -0
- package/dist/sanitize.d.ts.map +1 -0
- package/dist/sanitize.js +71 -0
- package/dist/training/enricher.d.ts +17 -0
- package/dist/training/enricher.d.ts.map +1 -0
- package/dist/training/enricher.js +350 -0
- package/dist/training/kg_scanner.d.ts +13 -0
- package/dist/training/kg_scanner.d.ts.map +1 -0
- package/dist/training/kg_scanner.js +118 -0
- package/dist/training/merger.d.ts +15 -0
- package/dist/training/merger.d.ts.map +1 -0
- package/dist/training/merger.js +208 -0
- package/dist/training/scanner.d.ts +36 -0
- package/dist/training/scanner.d.ts.map +1 -0
- package/dist/training/scanner.js +932 -0
- package/dist/training/types.d.ts +117 -0
- package/dist/training/types.d.ts.map +1 -0
- package/dist/training/types.js +9 -0
- package/dist/training/validator.d.ts +21 -0
- package/dist/training/validator.d.ts.map +1 -0
- package/dist/training/validator.js +262 -0
- package/dist/validation/guardrails.d.ts +31 -0
- package/dist/validation/guardrails.d.ts.map +1 -0
- package/dist/validation/guardrails.js +112 -0
- package/dist/validation/output_schema.d.ts +67 -0
- package/dist/validation/output_schema.d.ts.map +1 -0
- package/dist/validation/output_schema.js +84 -0
- package/dist/version.d.ts +6 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +36 -0
- package/package.json +126 -0
- package/schemas/flow-decision.schema.json +83 -0
- package/schemas/gap.schema.json +18 -0
- package/schemas/impact.schema.json +455 -0
- package/schemas/plan.schema.json +491 -0
- package/schemas/route-families.schema.json +137 -0
- package/schemas/subsystem-risk-map.schema.json +62 -0
- package/schemas/traceability-input.schema.json +122 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
|
+
// See LICENSE.txt for license information.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.GeneratorAgent = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Generator Agent — wraps pipeline stage3 (test generation) in the Agent interface.
|
|
8
|
+
* Enhanced to accept TestCase[] from the Test Designer in addition to flat scenariosToAdd.
|
|
9
|
+
*/
|
|
10
|
+
const stage3_generation_js_1 = require("../pipeline/stage3_generation.js");
|
|
11
|
+
/**
|
|
12
|
+
* Enrich FlowDecisions with TestDesign data from the crew context.
|
|
13
|
+
* Converts structured TestCase[] into scenariosToAdd strings that the
|
|
14
|
+
* existing generation prompt can consume.
|
|
15
|
+
*/
|
|
16
|
+
function enrichDecisionsWithTestDesigns(ctx) {
|
|
17
|
+
if (ctx.testDesigns.length === 0) {
|
|
18
|
+
return ctx.impactedFlows;
|
|
19
|
+
}
|
|
20
|
+
const designsByFlow = new Map(ctx.testDesigns.map((td) => [td.flowId, td]));
|
|
21
|
+
return ctx.impactedFlows.map((decision) => {
|
|
22
|
+
const design = designsByFlow.get(decision.flowId);
|
|
23
|
+
if (!design || design.testCases.length === 0) {
|
|
24
|
+
return decision;
|
|
25
|
+
}
|
|
26
|
+
// Convert structured test cases to scenario descriptions for the generator prompt
|
|
27
|
+
const designedScenarios = design.testCases.map((tc) => {
|
|
28
|
+
const steps = tc.steps.join(' → ');
|
|
29
|
+
return `[${tc.type}] ${tc.name}: ${steps} → Expected: ${tc.expectedOutcome}`;
|
|
30
|
+
});
|
|
31
|
+
// Merge with any existing scenarios, preferring designed ones
|
|
32
|
+
const existingScenarios = decision.scenariosToAdd || [];
|
|
33
|
+
const mergedScenarios = [...designedScenarios, ...existingScenarios];
|
|
34
|
+
return {
|
|
35
|
+
...decision,
|
|
36
|
+
scenariosToAdd: mergedScenarios,
|
|
37
|
+
// Intentionally promote run_existing → add_scenarios when the test-designer
|
|
38
|
+
// produced new test cases. This ensures designed tests are generated even if
|
|
39
|
+
// impact-analyst thought existing coverage was sufficient. The test-designer
|
|
40
|
+
// only runs for flows the strategist deemed worth testing.
|
|
41
|
+
action: decision.action === 'run_existing' && designedScenarios.length > 0
|
|
42
|
+
? 'add_scenarios'
|
|
43
|
+
: decision.action,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
class GeneratorAgent {
|
|
48
|
+
constructor() {
|
|
49
|
+
this.role = 'generator';
|
|
50
|
+
}
|
|
51
|
+
async execute(_task, ctx) {
|
|
52
|
+
const warnings = [];
|
|
53
|
+
const enrichedDecisions = enrichDecisionsWithTestDesigns(ctx);
|
|
54
|
+
const actionable = enrichedDecisions.filter((d) => d.action === 'create_spec' || d.action === 'add_scenarios');
|
|
55
|
+
if (actionable.length === 0) {
|
|
56
|
+
warnings.push('Generator: no actionable decisions for generation.');
|
|
57
|
+
return { role: this.role, status: 'partial', output: [], warnings };
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const result = await (0, stage3_generation_js_1.runGenerationStage)(enrichedDecisions, ctx.apiSurface, ctx.testsRoot, { provider: ctx.providerOverride });
|
|
61
|
+
ctx.generatedSpecs.push(...result.generated);
|
|
62
|
+
warnings.push(...result.warnings);
|
|
63
|
+
return {
|
|
64
|
+
role: this.role,
|
|
65
|
+
status: result.generatedCount > 0 ? 'success' : 'partial',
|
|
66
|
+
output: result,
|
|
67
|
+
warnings,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
72
|
+
warnings.push(`Generator failed: ${message}`);
|
|
73
|
+
return { role: this.role, status: 'failed', output: null, warnings };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.GeneratorAgent = GeneratorAgent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Agent, AgentTask, AgentResult } from '../crew/protocol.js';
|
|
2
|
+
import type { CrewContext } from '../crew/context.js';
|
|
3
|
+
import type { AgentRole } from '../crew/types.js';
|
|
4
|
+
export declare class HealerAgent implements Agent {
|
|
5
|
+
readonly role: AgentRole;
|
|
6
|
+
execute(_task: AgentTask, ctx: CrewContext): Promise<AgentResult>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=healer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healer.d.ts","sourceRoot":"","sources":["../../src/agents/healer.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAEhD,qBAAa,WAAY,YAAW,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAY;IAE9B,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;CAwB1E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
|
+
// See LICENSE.txt for license information.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.HealerAgent = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Healer Agent — wraps pipeline stage4 (test healing) in the Agent interface.
|
|
8
|
+
*/
|
|
9
|
+
const stage4_heal_js_1 = require("../pipeline/stage4_heal.js");
|
|
10
|
+
class HealerAgent {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.role = 'healer';
|
|
13
|
+
}
|
|
14
|
+
async execute(_task, ctx) {
|
|
15
|
+
const warnings = [];
|
|
16
|
+
const healTargets = (0, stage4_heal_js_1.resolveHealTargets)(ctx.testsRoot, { generatedSpecs: ctx.generatedSpecs }, ctx.impactedFlows);
|
|
17
|
+
if (healTargets.length === 0) {
|
|
18
|
+
warnings.push('Healer: no heal targets found.');
|
|
19
|
+
return { role: this.role, status: 'partial', output: null, warnings };
|
|
20
|
+
}
|
|
21
|
+
const result = await (0, stage4_heal_js_1.runHealStage)(ctx.testsRoot, healTargets, { mcp: true });
|
|
22
|
+
warnings.push(...result.warnings);
|
|
23
|
+
return {
|
|
24
|
+
role: this.role,
|
|
25
|
+
status: result.healSuccess > 0 ? 'success' : 'partial',
|
|
26
|
+
output: result,
|
|
27
|
+
warnings,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.HealerAgent = HealerAgent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Agent, AgentTask, AgentResult } from '../crew/protocol.js';
|
|
2
|
+
import type { CrewContext } from '../crew/context.js';
|
|
3
|
+
import type { AgentRole } from '../crew/types.js';
|
|
4
|
+
export declare class ImpactAnalystAgent implements Agent {
|
|
5
|
+
readonly role: AgentRole;
|
|
6
|
+
execute(_task: AgentTask, ctx: CrewContext): Promise<AgentResult>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=impact-analyst.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impact-analyst.d.ts","sourceRoot":"","sources":["../../src/agents/impact-analyst.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAEhD,qBAAa,kBAAmB,YAAW,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAoB;IAEtC,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;CAiC1E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
|
+
// See LICENSE.txt for license information.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.ImpactAnalystAgent = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Impact Analyst Agent — wraps pipeline stage1 (impact analysis) in the Agent interface.
|
|
8
|
+
*/
|
|
9
|
+
const stage1_impact_js_1 = require("../pipeline/stage1_impact.js");
|
|
10
|
+
class ImpactAnalystAgent {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.role = 'impact-analyst';
|
|
13
|
+
}
|
|
14
|
+
async execute(_task, ctx) {
|
|
15
|
+
const warnings = [];
|
|
16
|
+
if (ctx.familyGroups.length === 0) {
|
|
17
|
+
warnings.push('Impact analyst: no family groups to analyze.');
|
|
18
|
+
return { role: this.role, status: 'partial', output: [], warnings };
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const result = await (0, stage1_impact_js_1.runImpactStage)(ctx.familyGroups, ctx.manifest, ctx.specIndex, ctx.apiSurface, ctx.context, { provider: ctx.providerOverride });
|
|
22
|
+
ctx.impactedFlows.push(...result.decisions);
|
|
23
|
+
warnings.push(...result.warnings);
|
|
24
|
+
return {
|
|
25
|
+
role: this.role,
|
|
26
|
+
status: result.decisions.length > 0 ? 'success' : 'partial',
|
|
27
|
+
output: result.decisions,
|
|
28
|
+
warnings,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
33
|
+
warnings.push(`Impact analyst failed: ${message}`);
|
|
34
|
+
return { role: this.role, status: 'failed', output: null, warnings };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.ImpactAnalystAgent = ImpactAnalystAgent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Agent, AgentTask, AgentResult } from '../crew/protocol.js';
|
|
2
|
+
import type { CrewContext } from '../crew/context.js';
|
|
3
|
+
import type { AgentRole } from '../crew/types.js';
|
|
4
|
+
export declare class RegressionAdvisorAgent implements Agent {
|
|
5
|
+
readonly role: AgentRole;
|
|
6
|
+
execute(_task: AgentTask, ctx: CrewContext): Promise<AgentResult>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=regression-advisor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regression-advisor.d.ts","sourceRoot":"","sources":["../../src/agents/regression-advisor.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAC,SAAS,EAAiB,MAAM,kBAAkB,CAAC;AAUhE,qBAAa,sBAAuB,YAAW,KAAK;IAChD,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAwB;IAE1C,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;CA0G1E"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
|
+
// See LICENSE.txt for license information.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.RegressionAdvisorAgent = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Regression Advisor Agent — identifies historically regression-prone areas
|
|
8
|
+
* using traceability data and advises the Strategist on risk scores.
|
|
9
|
+
* Mostly deterministic (traceability data analysis), with optional LLM enrichment.
|
|
10
|
+
*/
|
|
11
|
+
const feedback_js_1 = require("../agent/feedback.js");
|
|
12
|
+
const FLAKY_RISK_MULTIPLIER = 15;
|
|
13
|
+
const LOW_PRECISION_RISK_MULTIPLIER = 30;
|
|
14
|
+
const PATTERN_RISK_SCORE = 30;
|
|
15
|
+
const PATTERN_RISK_ADDITIVE = 20;
|
|
16
|
+
const MAX_RISK_SCORE = 100;
|
|
17
|
+
const MIN_PRECISION_THRESHOLD = 0.5;
|
|
18
|
+
const MIN_CALIBRATION_SAMPLES = 3;
|
|
19
|
+
class RegressionAdvisorAgent {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.role = 'regression-advisor';
|
|
22
|
+
}
|
|
23
|
+
async execute(_task, ctx) {
|
|
24
|
+
const warnings = [];
|
|
25
|
+
const risks = [];
|
|
26
|
+
// Analyze calibration data for historical failure patterns
|
|
27
|
+
const calibration = (0, feedback_js_1.readCalibration)(ctx.testsRoot);
|
|
28
|
+
const flakyData = (0, feedback_js_1.readFlakyTests)(ctx.testsRoot);
|
|
29
|
+
// Build risk from flaky test data
|
|
30
|
+
if (flakyData && flakyData.tests.length > 0) {
|
|
31
|
+
const flakyByFamily = new Map();
|
|
32
|
+
for (const test of flakyData.tests) {
|
|
33
|
+
// Use subsystem field as family identifier
|
|
34
|
+
if (test.subsystem) {
|
|
35
|
+
flakyByFamily.set(test.subsystem, (flakyByFamily.get(test.subsystem) || 0) + 1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
for (const [familyId, count] of flakyByFamily) {
|
|
39
|
+
const isImpacted = ctx.familyGroups.some((g) => g.familyId === familyId);
|
|
40
|
+
if (isImpacted) {
|
|
41
|
+
risks.push({
|
|
42
|
+
familyId,
|
|
43
|
+
filePattern: '*',
|
|
44
|
+
riskScore: Math.min(MAX_RISK_SCORE, count * FLAKY_RISK_MULTIPLIER),
|
|
45
|
+
reason: `${count} flaky test(s) historically in this family`,
|
|
46
|
+
historicalFailures: count,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Build risk from calibration data (subsystem-level precision/recall)
|
|
52
|
+
if (calibration && calibration.bySubsystem) {
|
|
53
|
+
for (const [subsystem, metrics] of Object.entries(calibration.bySubsystem)) {
|
|
54
|
+
const isImpacted = ctx.familyGroups.some((g) => g.familyId === subsystem);
|
|
55
|
+
if (!isImpacted)
|
|
56
|
+
continue;
|
|
57
|
+
// Low precision means many false positives — the subsystem is noisy
|
|
58
|
+
if (metrics.precision < MIN_PRECISION_THRESHOLD && metrics.samples >= MIN_CALIBRATION_SAMPLES) {
|
|
59
|
+
const existing = risks.find((r) => r.familyId === subsystem);
|
|
60
|
+
const lowPrecisionScore = Math.round((1 - metrics.precision) * LOW_PRECISION_RISK_MULTIPLIER);
|
|
61
|
+
if (existing) {
|
|
62
|
+
existing.riskScore = Math.min(MAX_RISK_SCORE, existing.riskScore + lowPrecisionScore);
|
|
63
|
+
existing.reason += `; low calibration precision (${(metrics.precision * 100).toFixed(0)}%)`;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
risks.push({
|
|
67
|
+
familyId: subsystem,
|
|
68
|
+
filePattern: '*',
|
|
69
|
+
riskScore: lowPrecisionScore,
|
|
70
|
+
reason: `Low calibration precision (${(metrics.precision * 100).toFixed(0)}%) — historically noisy subsystem`,
|
|
71
|
+
historicalFailures: metrics.samples,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Analyze changed files for known regression-prone patterns
|
|
78
|
+
for (const group of ctx.familyGroups) {
|
|
79
|
+
const hasApiChange = group.files.some((f) => f.path.includes('/api/') || f.path.includes('/actions/') || f.path.includes('/reducers/'));
|
|
80
|
+
const hasAuthChange = group.files.some((f) => f.path.includes('auth') || f.path.includes('login') || f.path.includes('session'));
|
|
81
|
+
const hasDBChange = group.files.some((f) => f.path.includes('/store/') || f.path.includes('/model/') || f.path.includes('migration'));
|
|
82
|
+
if (hasApiChange || hasAuthChange || hasDBChange) {
|
|
83
|
+
const existing = risks.find((r) => r.familyId === group.familyId);
|
|
84
|
+
const patterns = [
|
|
85
|
+
hasApiChange && 'API changes',
|
|
86
|
+
hasAuthChange && 'auth changes',
|
|
87
|
+
hasDBChange && 'data model changes',
|
|
88
|
+
].filter(Boolean).join(', ');
|
|
89
|
+
if (existing) {
|
|
90
|
+
existing.riskScore = Math.min(MAX_RISK_SCORE, existing.riskScore + PATTERN_RISK_ADDITIVE);
|
|
91
|
+
existing.reason += `; regression-prone patterns: ${patterns}`;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
risks.push({
|
|
95
|
+
familyId: group.familyId,
|
|
96
|
+
filePattern: group.files.map((f) => f.path).join(', '),
|
|
97
|
+
riskScore: PATTERN_RISK_SCORE,
|
|
98
|
+
reason: `Regression-prone file patterns detected: ${patterns}`,
|
|
99
|
+
historicalFailures: 0,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
ctx.regressionRisks.push(...risks);
|
|
105
|
+
if (risks.length === 0) {
|
|
106
|
+
warnings.push('Regression advisor: no historical risk data found.');
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
role: this.role,
|
|
110
|
+
status: risks.length > 0 ? 'success' : 'partial',
|
|
111
|
+
output: risks,
|
|
112
|
+
warnings,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.RegressionAdvisorAgent = RegressionAdvisorAgent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Agent, AgentTask, AgentResult } from '../crew/protocol.js';
|
|
2
|
+
import type { CrewContext } from '../crew/context.js';
|
|
3
|
+
import type { AgentRole } from '../crew/types.js';
|
|
4
|
+
export declare class StrategistAgent implements Agent {
|
|
5
|
+
readonly role: AgentRole;
|
|
6
|
+
execute(_task: AgentTask, ctx: CrewContext): Promise<AgentResult>;
|
|
7
|
+
private buildDefaultStrategy;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=strategist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategist.d.ts","sourceRoot":"","sources":["../../src/agents/strategist.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAC,SAAS,EAA8B,MAAM,kBAAkB,CAAC;AAS7E,qBAAa,eAAgB,YAAW,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAgB;IAElC,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAkEvE,OAAO,CAAC,oBAAoB;CAa/B"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
|
+
// See LICENSE.txt for license information.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.StrategistAgent = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Strategist Agent — designs overall test strategy from impact analysis,
|
|
8
|
+
* cross-impact data, and regression risk.
|
|
9
|
+
*/
|
|
10
|
+
const provider_js_1 = require("../crew/provider.js");
|
|
11
|
+
const strategist_js_1 = require("../prompts/strategist.js");
|
|
12
|
+
const VALID_APPROACHES = new Set(['full-test', 'smoke-test', 'skip', 'manual-review']);
|
|
13
|
+
const VALID_CATEGORIES = new Set([
|
|
14
|
+
'happy-path', 'edge-case', 'boundary', 'negative',
|
|
15
|
+
'state-transition', 'race-condition', 'permission', 'accessibility', 'performance',
|
|
16
|
+
]);
|
|
17
|
+
const VALID_RISK = new Set(['high', 'medium', 'low', 'none']);
|
|
18
|
+
class StrategistAgent {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.role = 'strategist';
|
|
21
|
+
}
|
|
22
|
+
async execute(_task, ctx) {
|
|
23
|
+
const warnings = [];
|
|
24
|
+
if (ctx.impactedFlows.length === 0) {
|
|
25
|
+
warnings.push('Strategist: no impacted flows to strategize.');
|
|
26
|
+
return { role: this.role, status: 'partial', output: [], warnings };
|
|
27
|
+
}
|
|
28
|
+
const prompt = (0, strategist_js_1.buildStrategistPrompt)({
|
|
29
|
+
impactedFlows: ctx.impactedFlows,
|
|
30
|
+
crossImpacts: ctx.crossImpacts,
|
|
31
|
+
regressionRisks: ctx.regressionRisks,
|
|
32
|
+
});
|
|
33
|
+
try {
|
|
34
|
+
const provider = await (0, provider_js_1.getCrewProvider)(ctx.providerOverride, ctx.budgetUSD, {
|
|
35
|
+
agentRole: 'strategist',
|
|
36
|
+
modelRoutingProviderType: ctx.modelRoutingProviderType,
|
|
37
|
+
modelRoutingOverrides: ctx.modelRoutingOverrides,
|
|
38
|
+
budgetLedger: ctx.budgetLedger,
|
|
39
|
+
});
|
|
40
|
+
const response = await provider.generateText(prompt, {
|
|
41
|
+
maxTokens: 4000,
|
|
42
|
+
temperature: 0,
|
|
43
|
+
timeout: 45000,
|
|
44
|
+
systemPrompt: 'Return only valid JSON. Do not include markdown fences unless necessary.',
|
|
45
|
+
});
|
|
46
|
+
const parsed = (0, strategist_js_1.parseStrategistResponse)(response.text);
|
|
47
|
+
if (!parsed || parsed.strategy.length === 0) {
|
|
48
|
+
warnings.push('Strategist: LLM returned no strategy.');
|
|
49
|
+
// Fall back to default strategy
|
|
50
|
+
ctx.strategyEntries.push(...this.buildDefaultStrategy(ctx));
|
|
51
|
+
return { role: this.role, status: 'partial', output: ctx.strategyEntries, warnings };
|
|
52
|
+
}
|
|
53
|
+
const entries = parsed.strategy.map((s) => ({
|
|
54
|
+
flowId: s.flowId,
|
|
55
|
+
flowName: s.flowName,
|
|
56
|
+
priority: (['P0', 'P1', 'P2'].includes(s.priority) ? s.priority : 'P2'),
|
|
57
|
+
approach: VALID_APPROACHES.has(s.approach) ? s.approach : 'full-test',
|
|
58
|
+
rationale: s.rationale || '',
|
|
59
|
+
testCategories: (s.testCategories || []).filter((c) => VALID_CATEGORIES.has(c)),
|
|
60
|
+
crossImpactRisk: VALID_RISK.has(s.crossImpactRisk) ? s.crossImpactRisk : 'none',
|
|
61
|
+
}));
|
|
62
|
+
ctx.strategyEntries.push(...entries);
|
|
63
|
+
return {
|
|
64
|
+
role: this.role,
|
|
65
|
+
status: 'success',
|
|
66
|
+
output: entries,
|
|
67
|
+
usage: provider.getUsageStats(),
|
|
68
|
+
warnings,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
73
|
+
warnings.push(`Strategist LLM failed: ${message}. Using default strategy.`);
|
|
74
|
+
ctx.strategyEntries.push(...this.buildDefaultStrategy(ctx));
|
|
75
|
+
return { role: this.role, status: 'partial', output: ctx.strategyEntries, warnings };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
buildDefaultStrategy(ctx) {
|
|
79
|
+
return ctx.impactedFlows
|
|
80
|
+
.filter((f) => f.action !== 'cannot_determine')
|
|
81
|
+
.map((f) => ({
|
|
82
|
+
flowId: f.flowId,
|
|
83
|
+
flowName: f.flowName,
|
|
84
|
+
priority: f.priority,
|
|
85
|
+
approach: (f.action === 'create_spec' || f.action === 'add_scenarios' ? 'full-test' : 'smoke-test'),
|
|
86
|
+
rationale: 'Default strategy based on impact action.',
|
|
87
|
+
testCategories: ['happy-path', 'edge-case'],
|
|
88
|
+
crossImpactRisk: 'none',
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.StrategistAgent = StrategistAgent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Agent, AgentTask, AgentResult } from '../crew/protocol.js';
|
|
2
|
+
import type { CrewContext } from '../crew/context.js';
|
|
3
|
+
import type { AgentRole } from '../crew/types.js';
|
|
4
|
+
export declare class TestDesignerAgent implements Agent {
|
|
5
|
+
readonly role: AgentRole;
|
|
6
|
+
execute(_task: AgentTask, ctx: CrewContext): Promise<AgentResult>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=test-designer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-designer.d.ts","sourceRoot":"","sources":["../../src/agents/test-designer.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAC,SAAS,EAAoD,MAAM,kBAAkB,CAAC;AASnG,qBAAa,iBAAkB,YAAW,KAAK;IAC3C,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAmB;IAErC,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;CAwG1E"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
|
+
// See LICENSE.txt for license information.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TestDesignerAgent = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Test Designer Agent — designs structured test cases across 9 categories.
|
|
8
|
+
* Takes strategist output + API surface + existing specs and produces TestDesign[].
|
|
9
|
+
*/
|
|
10
|
+
const provider_js_1 = require("../crew/provider.js");
|
|
11
|
+
const spec_index_js_1 = require("../knowledge/spec_index.js");
|
|
12
|
+
const test_designer_js_1 = require("../prompts/test-designer.js");
|
|
13
|
+
const MAX_TEST_CASES_PER_FLOW = 15;
|
|
14
|
+
const VALID_TYPES = new Set([
|
|
15
|
+
'happy-path', 'edge-case', 'boundary', 'negative',
|
|
16
|
+
'state-transition', 'race-condition', 'permission', 'accessibility', 'performance',
|
|
17
|
+
]);
|
|
18
|
+
class TestDesignerAgent {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.role = 'test-designer';
|
|
21
|
+
}
|
|
22
|
+
async execute(_task, ctx) {
|
|
23
|
+
const warnings = [];
|
|
24
|
+
if (ctx.strategyEntries.length === 0) {
|
|
25
|
+
warnings.push('Test designer: no strategy entries to design tests for.');
|
|
26
|
+
return { role: this.role, status: 'partial', output: [], warnings };
|
|
27
|
+
}
|
|
28
|
+
// Only design tests for flows with full-test or smoke-test approach
|
|
29
|
+
const designable = ctx.strategyEntries.filter((s) => s.approach === 'full-test' || s.approach === 'smoke-test');
|
|
30
|
+
if (designable.length === 0) {
|
|
31
|
+
warnings.push('Test designer: all flows are skip or manual-review.');
|
|
32
|
+
return { role: this.role, status: 'partial', output: [], warnings };
|
|
33
|
+
}
|
|
34
|
+
let provider;
|
|
35
|
+
try {
|
|
36
|
+
provider = await (0, provider_js_1.getCrewProvider)(ctx.providerOverride, ctx.budgetUSD, {
|
|
37
|
+
agentRole: 'test-designer',
|
|
38
|
+
modelRoutingProviderType: ctx.modelRoutingProviderType,
|
|
39
|
+
modelRoutingOverrides: ctx.modelRoutingOverrides,
|
|
40
|
+
budgetLedger: ctx.budgetLedger,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
45
|
+
warnings.push(`Test designer provider unavailable: ${message}`);
|
|
46
|
+
return { role: this.role, status: 'failed', output: [], warnings };
|
|
47
|
+
}
|
|
48
|
+
const designs = [];
|
|
49
|
+
for (const strategy of designable) {
|
|
50
|
+
const flow = ctx.impactedFlows.find((f) => f.flowId === strategy.flowId);
|
|
51
|
+
if (!flow) {
|
|
52
|
+
warnings.push(`Test designer: strategy entry '${strategy.flowId}' has no matching flow.`);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const familySpecs = (0, spec_index_js_1.getSpecsForFamily)(ctx.specIndex, flow.routeFamily, flow.featureId);
|
|
56
|
+
const relevantCrossImpacts = ctx.crossImpacts.filter((ci) => ci.sourceFamily === flow.routeFamily || ci.affectedFamily === flow.routeFamily);
|
|
57
|
+
const prompt = (0, test_designer_js_1.buildTestDesignerPrompt)({
|
|
58
|
+
flow,
|
|
59
|
+
strategy,
|
|
60
|
+
apiSurface: ctx.apiSurface,
|
|
61
|
+
existingSpecs: familySpecs,
|
|
62
|
+
crossImpacts: relevantCrossImpacts,
|
|
63
|
+
});
|
|
64
|
+
try {
|
|
65
|
+
const response = await provider.generateText(prompt, {
|
|
66
|
+
maxTokens: 4000,
|
|
67
|
+
temperature: 0.1,
|
|
68
|
+
timeout: 60000,
|
|
69
|
+
systemPrompt: 'Return only valid JSON. Do not include markdown fences unless necessary.',
|
|
70
|
+
});
|
|
71
|
+
const parsed = (0, test_designer_js_1.parseTestDesignerResponse)(response.text);
|
|
72
|
+
if (!parsed || parsed.testDesign.testCases.length === 0) {
|
|
73
|
+
warnings.push(`Test designer: no test cases returned for flow ${strategy.flowId}.`);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const validatedCases = parsed.testDesign.testCases
|
|
77
|
+
.filter((tc) => tc.name && tc.steps && tc.steps.length > 0)
|
|
78
|
+
.map((tc) => ({
|
|
79
|
+
name: tc.name,
|
|
80
|
+
type: VALID_TYPES.has(tc.type) ? tc.type : 'happy-path',
|
|
81
|
+
preconditions: Array.isArray(tc.preconditions) ? tc.preconditions : [],
|
|
82
|
+
steps: Array.isArray(tc.steps) ? tc.steps : [],
|
|
83
|
+
expectedOutcome: tc.expectedOutcome || '',
|
|
84
|
+
priority: (['P0', 'P1', 'P2'].includes(tc.priority) ? tc.priority : 'P2'),
|
|
85
|
+
rationale: tc.rationale || '',
|
|
86
|
+
}))
|
|
87
|
+
.slice(0, MAX_TEST_CASES_PER_FLOW);
|
|
88
|
+
if (validatedCases.length > 0) {
|
|
89
|
+
designs.push({
|
|
90
|
+
flowId: strategy.flowId,
|
|
91
|
+
flowName: strategy.flowName,
|
|
92
|
+
testCases: validatedCases,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
98
|
+
warnings.push(`Test designer failed for flow ${strategy.flowId}: ${message}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
ctx.testDesigns.push(...designs);
|
|
102
|
+
return {
|
|
103
|
+
role: this.role,
|
|
104
|
+
status: designs.length > 0 ? 'success' : 'partial',
|
|
105
|
+
output: designs,
|
|
106
|
+
usage: provider.getUsageStats(),
|
|
107
|
+
warnings,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.TestDesignerAgent = TestDesignerAgent;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { AnthropicConfig, GenerateOptions, ImageInput, LLMResponse, ProviderCapabilities } from './provider_interface.js';
|
|
2
|
+
import { BaseProvider } from './base_provider.js';
|
|
3
|
+
/**
|
|
4
|
+
* Anthropic Provider - Claude AI models
|
|
5
|
+
*
|
|
6
|
+
* Features:
|
|
7
|
+
* - Highest quality AI (98% accuracy in testing)
|
|
8
|
+
* - Vision support (analyze screenshots, compare UI)
|
|
9
|
+
* - Fast response times (<1 second)
|
|
10
|
+
* - 200K token context window
|
|
11
|
+
* - Prompt caching (reduces costs by 90% on repeated prompts)
|
|
12
|
+
*
|
|
13
|
+
* Costs (Claude Sonnet 4.5):
|
|
14
|
+
* - Input: $3 per 1M tokens
|
|
15
|
+
* - Output: $15 per 1M tokens
|
|
16
|
+
* - Cached input: $0.30 per 1M tokens
|
|
17
|
+
* - Estimated: ~$30-80/month for autonomous testing
|
|
18
|
+
*
|
|
19
|
+
* Use cases:
|
|
20
|
+
* - Vision tasks (screenshot comparison)
|
|
21
|
+
* - Complex failure diagnosis
|
|
22
|
+
* - High-stakes production testing
|
|
23
|
+
* - When quality is paramount
|
|
24
|
+
*
|
|
25
|
+
* Models:
|
|
26
|
+
* - claude-sonnet-4-5-20250929 (recommended - best balance)
|
|
27
|
+
* - claude-opus-4-5-20251101 (highest quality, slower, more expensive)
|
|
28
|
+
* - claude-haiku-4-0-20250430 (fastest, cheapest, lower quality)
|
|
29
|
+
*/
|
|
30
|
+
export declare class AnthropicProvider extends BaseProvider {
|
|
31
|
+
name: string;
|
|
32
|
+
private client;
|
|
33
|
+
private model;
|
|
34
|
+
capabilities: ProviderCapabilities;
|
|
35
|
+
constructor(config: AnthropicConfig);
|
|
36
|
+
generateText(prompt: string, options?: GenerateOptions): Promise<LLMResponse>;
|
|
37
|
+
analyzeImage(images: ImageInput[], prompt: string, options?: GenerateOptions): Promise<LLMResponse>;
|
|
38
|
+
streamText(prompt: string, options?: GenerateOptions): AsyncGenerator<string, void, unknown>;
|
|
39
|
+
private extractTextFromResponse;
|
|
40
|
+
/**
|
|
41
|
+
* SECURITY: Type-safe usage extraction
|
|
42
|
+
* Avoids unsafe `as any` casts
|
|
43
|
+
*/
|
|
44
|
+
private extractUsageFromResponse;
|
|
45
|
+
/**
|
|
46
|
+
* SECURITY: Extract status code safely
|
|
47
|
+
*/
|
|
48
|
+
private extractStatusCode;
|
|
49
|
+
/**
|
|
50
|
+
* Check if API key is valid and service is accessible
|
|
51
|
+
*/
|
|
52
|
+
checkHealth(): Promise<{
|
|
53
|
+
healthy: boolean;
|
|
54
|
+
message: string;
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Helper to check Anthropic setup
|
|
59
|
+
*/
|
|
60
|
+
export declare function checkAnthropicSetup(apiKey: string): Promise<{
|
|
61
|
+
valid: boolean;
|
|
62
|
+
message: string;
|
|
63
|
+
estimatedMonthlyCost: string;
|
|
64
|
+
}>;
|
|
65
|
+
//# sourceMappingURL=anthropic_provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic_provider.d.ts","sourceRoot":"","sources":["../src/anthropic_provider.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACR,eAAe,EACf,eAAe,EACf,UAAU,EACV,WAAW,EACX,oBAAoB,EACvB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAehD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;IAC/C,IAAI,SAAe;IACnB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,KAAK,CAAS;IAEtB,YAAY,EAAE,oBAAoB,CAShC;gBAEU,MAAM,EAAE,eAAe;IA4B7B,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IA6D7E,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAgHlG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC;IA4CnG,OAAO,CAAC,uBAAuB;IAU/B;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAchC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAWzB;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC;CAyBpE;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/D,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,MAAM,CAAC;CAChC,CAAC,CAyBD"}
|