@dotsetlabs/bellwether 0.10.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/CHANGELOG.md +291 -0
- package/LICENSE +21 -0
- package/README.md +739 -0
- package/dist/auth/credentials.d.ts +64 -0
- package/dist/auth/credentials.js +218 -0
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.js +6 -0
- package/dist/auth/keychain.d.ts +64 -0
- package/dist/auth/keychain.js +268 -0
- package/dist/baseline/ab-testing.d.ts +80 -0
- package/dist/baseline/ab-testing.js +236 -0
- package/dist/baseline/ai-compatibility-scorer.d.ts +95 -0
- package/dist/baseline/ai-compatibility-scorer.js +606 -0
- package/dist/baseline/calibration.d.ts +77 -0
- package/dist/baseline/calibration.js +136 -0
- package/dist/baseline/category-matching.d.ts +85 -0
- package/dist/baseline/category-matching.js +289 -0
- package/dist/baseline/change-impact-analyzer.d.ts +98 -0
- package/dist/baseline/change-impact-analyzer.js +592 -0
- package/dist/baseline/comparator.d.ts +64 -0
- package/dist/baseline/comparator.js +916 -0
- package/dist/baseline/confidence.d.ts +55 -0
- package/dist/baseline/confidence.js +122 -0
- package/dist/baseline/converter.d.ts +61 -0
- package/dist/baseline/converter.js +585 -0
- package/dist/baseline/dependency-analyzer.d.ts +89 -0
- package/dist/baseline/dependency-analyzer.js +567 -0
- package/dist/baseline/deprecation-tracker.d.ts +133 -0
- package/dist/baseline/deprecation-tracker.js +322 -0
- package/dist/baseline/diff.d.ts +55 -0
- package/dist/baseline/diff.js +1584 -0
- package/dist/baseline/documentation-scorer.d.ts +205 -0
- package/dist/baseline/documentation-scorer.js +466 -0
- package/dist/baseline/embeddings.d.ts +118 -0
- package/dist/baseline/embeddings.js +251 -0
- package/dist/baseline/error-analyzer.d.ts +198 -0
- package/dist/baseline/error-analyzer.js +721 -0
- package/dist/baseline/evaluation/evaluator.d.ts +42 -0
- package/dist/baseline/evaluation/evaluator.js +323 -0
- package/dist/baseline/evaluation/expanded-dataset.d.ts +45 -0
- package/dist/baseline/evaluation/expanded-dataset.js +1164 -0
- package/dist/baseline/evaluation/golden-dataset.d.ts +58 -0
- package/dist/baseline/evaluation/golden-dataset.js +717 -0
- package/dist/baseline/evaluation/index.d.ts +15 -0
- package/dist/baseline/evaluation/index.js +15 -0
- package/dist/baseline/evaluation/types.d.ts +186 -0
- package/dist/baseline/evaluation/types.js +8 -0
- package/dist/baseline/external-dependency-detector.d.ts +181 -0
- package/dist/baseline/external-dependency-detector.js +524 -0
- package/dist/baseline/golden-output.d.ts +162 -0
- package/dist/baseline/golden-output.js +636 -0
- package/dist/baseline/health-scorer.d.ts +174 -0
- package/dist/baseline/health-scorer.js +451 -0
- package/dist/baseline/incremental-checker.d.ts +97 -0
- package/dist/baseline/incremental-checker.js +174 -0
- package/dist/baseline/index.d.ts +31 -0
- package/dist/baseline/index.js +42 -0
- package/dist/baseline/migration-generator.d.ts +137 -0
- package/dist/baseline/migration-generator.js +554 -0
- package/dist/baseline/migrations.d.ts +60 -0
- package/dist/baseline/migrations.js +197 -0
- package/dist/baseline/performance-tracker.d.ts +214 -0
- package/dist/baseline/performance-tracker.js +577 -0
- package/dist/baseline/pr-comment-generator.d.ts +117 -0
- package/dist/baseline/pr-comment-generator.js +546 -0
- package/dist/baseline/response-fingerprint.d.ts +127 -0
- package/dist/baseline/response-fingerprint.js +728 -0
- package/dist/baseline/response-schema-tracker.d.ts +129 -0
- package/dist/baseline/response-schema-tracker.js +420 -0
- package/dist/baseline/risk-scorer.d.ts +54 -0
- package/dist/baseline/risk-scorer.js +434 -0
- package/dist/baseline/saver.d.ts +89 -0
- package/dist/baseline/saver.js +554 -0
- package/dist/baseline/scenario-generator.d.ts +151 -0
- package/dist/baseline/scenario-generator.js +905 -0
- package/dist/baseline/schema-compare.d.ts +86 -0
- package/dist/baseline/schema-compare.js +557 -0
- package/dist/baseline/schema-evolution.d.ts +189 -0
- package/dist/baseline/schema-evolution.js +467 -0
- package/dist/baseline/semantic.d.ts +203 -0
- package/dist/baseline/semantic.js +908 -0
- package/dist/baseline/synonyms.d.ts +60 -0
- package/dist/baseline/synonyms.js +386 -0
- package/dist/baseline/telemetry.d.ts +165 -0
- package/dist/baseline/telemetry.js +294 -0
- package/dist/baseline/test-pruner.d.ts +120 -0
- package/dist/baseline/test-pruner.js +387 -0
- package/dist/baseline/types.d.ts +449 -0
- package/dist/baseline/types.js +5 -0
- package/dist/baseline/version.d.ts +138 -0
- package/dist/baseline/version.js +206 -0
- package/dist/cache/index.d.ts +5 -0
- package/dist/cache/index.js +5 -0
- package/dist/cache/response-cache.d.ts +151 -0
- package/dist/cache/response-cache.js +287 -0
- package/dist/ci/index.d.ts +60 -0
- package/dist/ci/index.js +342 -0
- package/dist/cli/commands/auth.d.ts +12 -0
- package/dist/cli/commands/auth.js +352 -0
- package/dist/cli/commands/badge.d.ts +3 -0
- package/dist/cli/commands/badge.js +74 -0
- package/dist/cli/commands/baseline-accept.d.ts +15 -0
- package/dist/cli/commands/baseline-accept.js +178 -0
- package/dist/cli/commands/baseline-migrate.d.ts +12 -0
- package/dist/cli/commands/baseline-migrate.js +164 -0
- package/dist/cli/commands/baseline.d.ts +14 -0
- package/dist/cli/commands/baseline.js +449 -0
- package/dist/cli/commands/beta.d.ts +10 -0
- package/dist/cli/commands/beta.js +231 -0
- package/dist/cli/commands/check.d.ts +11 -0
- package/dist/cli/commands/check.js +820 -0
- package/dist/cli/commands/cloud/badge.d.ts +3 -0
- package/dist/cli/commands/cloud/badge.js +74 -0
- package/dist/cli/commands/cloud/diff.d.ts +6 -0
- package/dist/cli/commands/cloud/diff.js +79 -0
- package/dist/cli/commands/cloud/history.d.ts +6 -0
- package/dist/cli/commands/cloud/history.js +102 -0
- package/dist/cli/commands/cloud/link.d.ts +9 -0
- package/dist/cli/commands/cloud/link.js +119 -0
- package/dist/cli/commands/cloud/login.d.ts +7 -0
- package/dist/cli/commands/cloud/login.js +499 -0
- package/dist/cli/commands/cloud/projects.d.ts +6 -0
- package/dist/cli/commands/cloud/projects.js +44 -0
- package/dist/cli/commands/cloud/shared.d.ts +7 -0
- package/dist/cli/commands/cloud/shared.js +42 -0
- package/dist/cli/commands/cloud/teams.d.ts +8 -0
- package/dist/cli/commands/cloud/teams.js +169 -0
- package/dist/cli/commands/cloud/upload.d.ts +8 -0
- package/dist/cli/commands/cloud/upload.js +181 -0
- package/dist/cli/commands/contract.d.ts +11 -0
- package/dist/cli/commands/contract.js +280 -0
- package/dist/cli/commands/discover.d.ts +3 -0
- package/dist/cli/commands/discover.js +82 -0
- package/dist/cli/commands/eval.d.ts +9 -0
- package/dist/cli/commands/eval.js +187 -0
- package/dist/cli/commands/explore.d.ts +11 -0
- package/dist/cli/commands/explore.js +437 -0
- package/dist/cli/commands/feedback.d.ts +9 -0
- package/dist/cli/commands/feedback.js +174 -0
- package/dist/cli/commands/golden.d.ts +12 -0
- package/dist/cli/commands/golden.js +407 -0
- package/dist/cli/commands/history.d.ts +10 -0
- package/dist/cli/commands/history.js +202 -0
- package/dist/cli/commands/init.d.ts +9 -0
- package/dist/cli/commands/init.js +219 -0
- package/dist/cli/commands/interview.d.ts +3 -0
- package/dist/cli/commands/interview.js +903 -0
- package/dist/cli/commands/link.d.ts +10 -0
- package/dist/cli/commands/link.js +169 -0
- package/dist/cli/commands/login.d.ts +7 -0
- package/dist/cli/commands/login.js +499 -0
- package/dist/cli/commands/preset.d.ts +33 -0
- package/dist/cli/commands/preset.js +297 -0
- package/dist/cli/commands/profile.d.ts +33 -0
- package/dist/cli/commands/profile.js +286 -0
- package/dist/cli/commands/registry.d.ts +11 -0
- package/dist/cli/commands/registry.js +146 -0
- package/dist/cli/commands/shared.d.ts +79 -0
- package/dist/cli/commands/shared.js +196 -0
- package/dist/cli/commands/teams.d.ts +8 -0
- package/dist/cli/commands/teams.js +169 -0
- package/dist/cli/commands/test.d.ts +9 -0
- package/dist/cli/commands/test.js +500 -0
- package/dist/cli/commands/upload.d.ts +8 -0
- package/dist/cli/commands/upload.js +223 -0
- package/dist/cli/commands/validate-config.d.ts +6 -0
- package/dist/cli/commands/validate-config.js +35 -0
- package/dist/cli/commands/verify.d.ts +11 -0
- package/dist/cli/commands/verify.js +283 -0
- package/dist/cli/commands/watch.d.ts +12 -0
- package/dist/cli/commands/watch.js +253 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +178 -0
- package/dist/cli/interactive.d.ts +47 -0
- package/dist/cli/interactive.js +216 -0
- package/dist/cli/output/terminal-reporter.d.ts +19 -0
- package/dist/cli/output/terminal-reporter.js +104 -0
- package/dist/cli/output.d.ts +226 -0
- package/dist/cli/output.js +438 -0
- package/dist/cli/utils/env.d.ts +5 -0
- package/dist/cli/utils/env.js +14 -0
- package/dist/cli/utils/progress.d.ts +59 -0
- package/dist/cli/utils/progress.js +206 -0
- package/dist/cli/utils/server-context.d.ts +10 -0
- package/dist/cli/utils/server-context.js +36 -0
- package/dist/cloud/auth.d.ts +144 -0
- package/dist/cloud/auth.js +374 -0
- package/dist/cloud/client.d.ts +24 -0
- package/dist/cloud/client.js +65 -0
- package/dist/cloud/http-client.d.ts +38 -0
- package/dist/cloud/http-client.js +215 -0
- package/dist/cloud/index.d.ts +23 -0
- package/dist/cloud/index.js +25 -0
- package/dist/cloud/mock-client.d.ts +107 -0
- package/dist/cloud/mock-client.js +545 -0
- package/dist/cloud/types.d.ts +515 -0
- package/dist/cloud/types.js +15 -0
- package/dist/config/defaults.d.ts +160 -0
- package/dist/config/defaults.js +169 -0
- package/dist/config/loader.d.ts +24 -0
- package/dist/config/loader.js +122 -0
- package/dist/config/template.d.ts +42 -0
- package/dist/config/template.js +647 -0
- package/dist/config/validator.d.ts +2112 -0
- package/dist/config/validator.js +658 -0
- package/dist/constants/cloud.d.ts +107 -0
- package/dist/constants/cloud.js +110 -0
- package/dist/constants/core.d.ts +521 -0
- package/dist/constants/core.js +556 -0
- package/dist/constants/testing.d.ts +1283 -0
- package/dist/constants/testing.js +1568 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.js +10 -0
- package/dist/contract/index.d.ts +6 -0
- package/dist/contract/index.js +5 -0
- package/dist/contract/validator.d.ts +177 -0
- package/dist/contract/validator.js +574 -0
- package/dist/cost/index.d.ts +6 -0
- package/dist/cost/index.js +5 -0
- package/dist/cost/tracker.d.ts +134 -0
- package/dist/cost/tracker.js +313 -0
- package/dist/discovery/discovery.d.ts +16 -0
- package/dist/discovery/discovery.js +173 -0
- package/dist/discovery/types.d.ts +51 -0
- package/dist/discovery/types.js +2 -0
- package/dist/docs/agents.d.ts +3 -0
- package/dist/docs/agents.js +995 -0
- package/dist/docs/contract.d.ts +51 -0
- package/dist/docs/contract.js +1681 -0
- package/dist/docs/generator.d.ts +4 -0
- package/dist/docs/generator.js +4 -0
- package/dist/docs/html-reporter.d.ts +9 -0
- package/dist/docs/html-reporter.js +757 -0
- package/dist/docs/index.d.ts +10 -0
- package/dist/docs/index.js +11 -0
- package/dist/docs/junit-reporter.d.ts +18 -0
- package/dist/docs/junit-reporter.js +210 -0
- package/dist/docs/report.d.ts +14 -0
- package/dist/docs/report.js +44 -0
- package/dist/docs/sarif-reporter.d.ts +19 -0
- package/dist/docs/sarif-reporter.js +335 -0
- package/dist/docs/shared.d.ts +35 -0
- package/dist/docs/shared.js +162 -0
- package/dist/docs/templates.d.ts +12 -0
- package/dist/docs/templates.js +76 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.js +6 -0
- package/dist/errors/retry.d.ts +92 -0
- package/dist/errors/retry.js +323 -0
- package/dist/errors/types.d.ts +321 -0
- package/dist/errors/types.js +584 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +32 -0
- package/dist/interview/dependency-resolver.d.ts +11 -0
- package/dist/interview/dependency-resolver.js +32 -0
- package/dist/interview/interviewer.d.ts +232 -0
- package/dist/interview/interviewer.js +1939 -0
- package/dist/interview/mock-response-generator.d.ts +7 -0
- package/dist/interview/mock-response-generator.js +102 -0
- package/dist/interview/orchestrator.d.ts +237 -0
- package/dist/interview/orchestrator.js +1296 -0
- package/dist/interview/rate-limiter.d.ts +15 -0
- package/dist/interview/rate-limiter.js +55 -0
- package/dist/interview/response-validator.d.ts +10 -0
- package/dist/interview/response-validator.js +132 -0
- package/dist/interview/schema-inferrer.d.ts +8 -0
- package/dist/interview/schema-inferrer.js +71 -0
- package/dist/interview/schema-test-generator.d.ts +71 -0
- package/dist/interview/schema-test-generator.js +834 -0
- package/dist/interview/smart-value-generator.d.ts +155 -0
- package/dist/interview/smart-value-generator.js +554 -0
- package/dist/interview/stateful-test-runner.d.ts +19 -0
- package/dist/interview/stateful-test-runner.js +106 -0
- package/dist/interview/types.d.ts +561 -0
- package/dist/interview/types.js +2 -0
- package/dist/llm/anthropic.d.ts +41 -0
- package/dist/llm/anthropic.js +355 -0
- package/dist/llm/client.d.ts +123 -0
- package/dist/llm/client.js +42 -0
- package/dist/llm/factory.d.ts +38 -0
- package/dist/llm/factory.js +145 -0
- package/dist/llm/fallback.d.ts +140 -0
- package/dist/llm/fallback.js +379 -0
- package/dist/llm/index.d.ts +18 -0
- package/dist/llm/index.js +15 -0
- package/dist/llm/ollama.d.ts +37 -0
- package/dist/llm/ollama.js +330 -0
- package/dist/llm/openai.d.ts +25 -0
- package/dist/llm/openai.js +320 -0
- package/dist/llm/token-budget.d.ts +161 -0
- package/dist/llm/token-budget.js +395 -0
- package/dist/logging/logger.d.ts +70 -0
- package/dist/logging/logger.js +130 -0
- package/dist/metrics/collector.d.ts +106 -0
- package/dist/metrics/collector.js +547 -0
- package/dist/metrics/index.d.ts +7 -0
- package/dist/metrics/index.js +7 -0
- package/dist/metrics/prometheus.d.ts +20 -0
- package/dist/metrics/prometheus.js +241 -0
- package/dist/metrics/types.d.ts +209 -0
- package/dist/metrics/types.js +5 -0
- package/dist/persona/builtins.d.ts +54 -0
- package/dist/persona/builtins.js +219 -0
- package/dist/persona/index.d.ts +8 -0
- package/dist/persona/index.js +8 -0
- package/dist/persona/loader.d.ts +30 -0
- package/dist/persona/loader.js +190 -0
- package/dist/persona/types.d.ts +144 -0
- package/dist/persona/types.js +5 -0
- package/dist/persona/validation.d.ts +94 -0
- package/dist/persona/validation.js +332 -0
- package/dist/prompts/index.d.ts +5 -0
- package/dist/prompts/index.js +5 -0
- package/dist/prompts/templates.d.ts +180 -0
- package/dist/prompts/templates.js +431 -0
- package/dist/registry/client.d.ts +49 -0
- package/dist/registry/client.js +191 -0
- package/dist/registry/index.d.ts +7 -0
- package/dist/registry/index.js +6 -0
- package/dist/registry/types.d.ts +140 -0
- package/dist/registry/types.js +6 -0
- package/dist/scenarios/evaluator.d.ts +43 -0
- package/dist/scenarios/evaluator.js +206 -0
- package/dist/scenarios/index.d.ts +10 -0
- package/dist/scenarios/index.js +9 -0
- package/dist/scenarios/loader.d.ts +20 -0
- package/dist/scenarios/loader.js +285 -0
- package/dist/scenarios/types.d.ts +153 -0
- package/dist/scenarios/types.js +8 -0
- package/dist/security/index.d.ts +17 -0
- package/dist/security/index.js +18 -0
- package/dist/security/payloads.d.ts +61 -0
- package/dist/security/payloads.js +268 -0
- package/dist/security/security-tester.d.ts +42 -0
- package/dist/security/security-tester.js +582 -0
- package/dist/security/types.d.ts +166 -0
- package/dist/security/types.js +8 -0
- package/dist/transport/base-transport.d.ts +59 -0
- package/dist/transport/base-transport.js +38 -0
- package/dist/transport/http-transport.d.ts +67 -0
- package/dist/transport/http-transport.js +238 -0
- package/dist/transport/mcp-client.d.ts +141 -0
- package/dist/transport/mcp-client.js +496 -0
- package/dist/transport/sse-transport.d.ts +88 -0
- package/dist/transport/sse-transport.js +316 -0
- package/dist/transport/stdio-transport.d.ts +43 -0
- package/dist/transport/stdio-transport.js +238 -0
- package/dist/transport/types.d.ts +125 -0
- package/dist/transport/types.js +16 -0
- package/dist/utils/concurrency.d.ts +123 -0
- package/dist/utils/concurrency.js +213 -0
- package/dist/utils/formatters.d.ts +16 -0
- package/dist/utils/formatters.js +37 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/jsonpath.d.ts +87 -0
- package/dist/utils/jsonpath.js +326 -0
- package/dist/utils/markdown.d.ts +113 -0
- package/dist/utils/markdown.js +265 -0
- package/dist/utils/network.d.ts +14 -0
- package/dist/utils/network.js +17 -0
- package/dist/utils/sanitize.d.ts +92 -0
- package/dist/utils/sanitize.js +191 -0
- package/dist/utils/semantic.d.ts +194 -0
- package/dist/utils/semantic.js +1051 -0
- package/dist/utils/smart-truncate.d.ts +94 -0
- package/dist/utils/smart-truncate.js +361 -0
- package/dist/utils/timeout.d.ts +153 -0
- package/dist/utils/timeout.js +205 -0
- package/dist/utils/yaml-parser.d.ts +58 -0
- package/dist/utils/yaml-parser.js +86 -0
- package/dist/validation/index.d.ts +32 -0
- package/dist/validation/index.js +32 -0
- package/dist/validation/semantic-test-generator.d.ts +50 -0
- package/dist/validation/semantic-test-generator.js +176 -0
- package/dist/validation/semantic-types.d.ts +66 -0
- package/dist/validation/semantic-types.js +94 -0
- package/dist/validation/semantic-validator.d.ts +38 -0
- package/dist/validation/semantic-validator.js +340 -0
- package/dist/verification/index.d.ts +6 -0
- package/dist/verification/index.js +5 -0
- package/dist/verification/types.d.ts +133 -0
- package/dist/verification/types.js +5 -0
- package/dist/verification/verifier.d.ts +30 -0
- package/dist/verification/verifier.js +309 -0
- package/dist/version.d.ts +19 -0
- package/dist/version.js +48 -0
- package/dist/workflow/auto-generator.d.ts +27 -0
- package/dist/workflow/auto-generator.js +513 -0
- package/dist/workflow/discovery.d.ts +40 -0
- package/dist/workflow/discovery.js +195 -0
- package/dist/workflow/executor.d.ts +82 -0
- package/dist/workflow/executor.js +611 -0
- package/dist/workflow/index.d.ts +10 -0
- package/dist/workflow/index.js +10 -0
- package/dist/workflow/loader.d.ts +24 -0
- package/dist/workflow/loader.js +194 -0
- package/dist/workflow/state-tracker.d.ts +98 -0
- package/dist/workflow/state-tracker.js +424 -0
- package/dist/workflow/types.d.ts +337 -0
- package/dist/workflow/types.js +5 -0
- package/package.json +94 -0
- package/schemas/bellwether-check.schema.json +651 -0
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Baseline types for drift detection.
|
|
3
|
+
*/
|
|
4
|
+
import type { ToolProfile } from '../interview/types.js';
|
|
5
|
+
import type { ResponseFingerprint, InferredSchema, ErrorPattern } from './response-fingerprint.js';
|
|
6
|
+
/**
|
|
7
|
+
* Re-export ErrorPattern for use by other modules.
|
|
8
|
+
*/
|
|
9
|
+
export type { ErrorPattern };
|
|
10
|
+
import type { SecurityFingerprint, SecurityDiff } from '../security/types.js';
|
|
11
|
+
import type { ResponseSchemaEvolution, SchemaEvolutionDiff } from './response-schema-tracker.js';
|
|
12
|
+
import type { DocumentationScoreSummary, DocumentationScoreChange } from './documentation-scorer.js';
|
|
13
|
+
/**
|
|
14
|
+
* Confidence level for statistical metrics.
|
|
15
|
+
* Used to indicate reliability of performance baselines.
|
|
16
|
+
*/
|
|
17
|
+
export type ConfidenceLevel = 'high' | 'medium' | 'low';
|
|
18
|
+
/**
|
|
19
|
+
* Severity of a change.
|
|
20
|
+
* Used consistently throughout the codebase for change classification.
|
|
21
|
+
*
|
|
22
|
+
* - 'none': No change detected
|
|
23
|
+
* - 'info': Minor change (description updates, new optional params)
|
|
24
|
+
* - 'warning': Moderate change (new error patterns, response structure shifts)
|
|
25
|
+
* - 'breaking': Critical change (removed tools, changed required params, type changes)
|
|
26
|
+
*/
|
|
27
|
+
export type ChangeSeverity = 'none' | 'info' | 'warning' | 'breaking';
|
|
28
|
+
/**
|
|
29
|
+
* Aspect of tool behavior that changed.
|
|
30
|
+
*/
|
|
31
|
+
export type BehaviorAspect = 'response_format' | 'response_structure' | 'response_schema_evolution' | 'error_handling' | 'error_pattern' | 'security' | 'performance' | 'schema' | 'description';
|
|
32
|
+
/**
|
|
33
|
+
* A single behavioral assertion about a tool.
|
|
34
|
+
*/
|
|
35
|
+
export interface BehavioralAssertion {
|
|
36
|
+
tool: string;
|
|
37
|
+
aspect: BehaviorAspect;
|
|
38
|
+
assertion: string;
|
|
39
|
+
evidence?: string;
|
|
40
|
+
isPositive: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A change detected between baselines.
|
|
44
|
+
*/
|
|
45
|
+
export interface BehaviorChange {
|
|
46
|
+
tool: string;
|
|
47
|
+
aspect: BehaviorAspect;
|
|
48
|
+
before: string;
|
|
49
|
+
after: string;
|
|
50
|
+
/** Severity level of the change (unified with ChangeSeverity) */
|
|
51
|
+
severity: ChangeSeverity;
|
|
52
|
+
description: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Changes detected for a single tool.
|
|
56
|
+
*/
|
|
57
|
+
export interface ToolDiff {
|
|
58
|
+
tool: string;
|
|
59
|
+
changes: BehaviorChange[];
|
|
60
|
+
schemaChanged: boolean;
|
|
61
|
+
descriptionChanged: boolean;
|
|
62
|
+
/** Whether response structure changed (check mode) */
|
|
63
|
+
responseStructureChanged: boolean;
|
|
64
|
+
/** Whether error patterns changed (check mode) */
|
|
65
|
+
errorPatternsChanged: boolean;
|
|
66
|
+
/** Whether response schema evolution changed (check mode) */
|
|
67
|
+
responseSchemaEvolutionChanged: boolean;
|
|
68
|
+
/** Whether security findings changed (check mode --security) */
|
|
69
|
+
securityChanged: boolean;
|
|
70
|
+
/** Schema evolution diff details (when schema evolution changed) */
|
|
71
|
+
schemaEvolutionDiff?: SchemaEvolutionDiff;
|
|
72
|
+
previous?: ToolProfile;
|
|
73
|
+
current?: ToolProfile;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Complete diff between two baselines.
|
|
77
|
+
*/
|
|
78
|
+
export interface BehavioralDiff {
|
|
79
|
+
toolsAdded: string[];
|
|
80
|
+
toolsRemoved: string[];
|
|
81
|
+
toolsModified: ToolDiff[];
|
|
82
|
+
behaviorChanges: BehaviorChange[];
|
|
83
|
+
severity: ChangeSeverity;
|
|
84
|
+
breakingCount: number;
|
|
85
|
+
warningCount: number;
|
|
86
|
+
infoCount: number;
|
|
87
|
+
summary: string;
|
|
88
|
+
/** Version compatibility information for the compared baselines */
|
|
89
|
+
versionCompatibility?: VersionCompatibilityInfo;
|
|
90
|
+
/** Performance regression report (when performance data available) */
|
|
91
|
+
performanceReport?: PerformanceRegressionReport;
|
|
92
|
+
/** Security diff report (when security testing was performed) */
|
|
93
|
+
securityReport?: SecurityDiff;
|
|
94
|
+
/** Schema evolution report (when schema evolution data available) */
|
|
95
|
+
schemaEvolutionReport?: SchemaEvolutionReport;
|
|
96
|
+
/** Error trend report (when comparing error patterns) */
|
|
97
|
+
errorTrendReport?: ErrorTrendReport;
|
|
98
|
+
/** Documentation score comparison report */
|
|
99
|
+
documentationScoreReport?: DocumentationScoreChange;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Performance regression report summary in diff.
|
|
103
|
+
*/
|
|
104
|
+
export interface PerformanceRegressionReport {
|
|
105
|
+
/** Tools with performance regression */
|
|
106
|
+
regressions: PerformanceRegression[];
|
|
107
|
+
/** Total tools with regressions */
|
|
108
|
+
regressionCount: number;
|
|
109
|
+
/** Total tools with improved performance */
|
|
110
|
+
improvementCount: number;
|
|
111
|
+
/** Overall has regressions beyond threshold */
|
|
112
|
+
hasRegressions: boolean;
|
|
113
|
+
/** Confidence-related changes */
|
|
114
|
+
confidenceChanges?: PerformanceConfidenceChange[];
|
|
115
|
+
/** Tools with low confidence (unreliable baselines) */
|
|
116
|
+
lowConfidenceTools?: string[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A single tool's performance regression.
|
|
120
|
+
*/
|
|
121
|
+
export interface PerformanceRegression {
|
|
122
|
+
/** Tool name */
|
|
123
|
+
toolName: string;
|
|
124
|
+
/** Previous p50 latency */
|
|
125
|
+
previousP50Ms: number;
|
|
126
|
+
/** Current p50 latency */
|
|
127
|
+
currentP50Ms: number;
|
|
128
|
+
/** Regression percentage (positive = slower) */
|
|
129
|
+
regressionPercent: number;
|
|
130
|
+
/** Whether this exceeds the threshold */
|
|
131
|
+
exceedsThreshold: boolean;
|
|
132
|
+
/** Previous confidence level (if available) */
|
|
133
|
+
previousConfidence?: 'high' | 'medium' | 'low';
|
|
134
|
+
/** Current confidence level */
|
|
135
|
+
currentConfidence?: 'high' | 'medium' | 'low';
|
|
136
|
+
/** Whether regression is statistically reliable (based on confidence) */
|
|
137
|
+
isReliable: boolean;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Schema evolution report summary in diff.
|
|
141
|
+
* Tracks schema stability changes across tools.
|
|
142
|
+
*/
|
|
143
|
+
export interface SchemaEvolutionReport {
|
|
144
|
+
/** Tools with schema evolution issues */
|
|
145
|
+
toolsWithIssues: SchemaEvolutionIssue[];
|
|
146
|
+
/** Total tools with unstable schemas */
|
|
147
|
+
unstableCount: number;
|
|
148
|
+
/** Total tools with stable schemas */
|
|
149
|
+
stableCount: number;
|
|
150
|
+
/** Total tools with schema structure changes */
|
|
151
|
+
structureChangedCount: number;
|
|
152
|
+
/** Whether any tools have breaking schema changes */
|
|
153
|
+
hasBreakingChanges: boolean;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* A single tool's schema evolution issue.
|
|
157
|
+
*/
|
|
158
|
+
export interface SchemaEvolutionIssue {
|
|
159
|
+
/** Tool name */
|
|
160
|
+
toolName: string;
|
|
161
|
+
/** Whether schema became unstable */
|
|
162
|
+
becameUnstable: boolean;
|
|
163
|
+
/** Fields added */
|
|
164
|
+
fieldsAdded: string[];
|
|
165
|
+
/** Fields removed */
|
|
166
|
+
fieldsRemoved: string[];
|
|
167
|
+
/** Whether this is a breaking change */
|
|
168
|
+
isBreaking: boolean;
|
|
169
|
+
/** Human-readable summary */
|
|
170
|
+
summary: string;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Error trend report comparing error patterns across baselines.
|
|
174
|
+
* Identifies new, resolved, increasing, and decreasing error categories.
|
|
175
|
+
*/
|
|
176
|
+
export interface ErrorTrendReport {
|
|
177
|
+
/** Error trends by category */
|
|
178
|
+
trends: ErrorTrend[];
|
|
179
|
+
/** Whether error behavior significantly changed */
|
|
180
|
+
significantChange: boolean;
|
|
181
|
+
/** Summary of changes */
|
|
182
|
+
summary: string;
|
|
183
|
+
/** Categories with increasing errors */
|
|
184
|
+
increasingCategories: string[];
|
|
185
|
+
/** Categories with decreasing errors */
|
|
186
|
+
decreasingCategories: string[];
|
|
187
|
+
/** New error categories */
|
|
188
|
+
newCategories: string[];
|
|
189
|
+
/** Resolved error categories */
|
|
190
|
+
resolvedCategories: string[];
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* A single error trend entry.
|
|
194
|
+
*/
|
|
195
|
+
export interface ErrorTrend {
|
|
196
|
+
/** Error category */
|
|
197
|
+
category: string;
|
|
198
|
+
/** Count in previous baseline */
|
|
199
|
+
previousCount: number;
|
|
200
|
+
/** Count in current baseline */
|
|
201
|
+
currentCount: number;
|
|
202
|
+
/** Trend direction */
|
|
203
|
+
trend: 'increasing' | 'decreasing' | 'stable' | 'new' | 'resolved';
|
|
204
|
+
/** Significance of the trend */
|
|
205
|
+
significance: 'high' | 'medium' | 'low';
|
|
206
|
+
/** Change percentage */
|
|
207
|
+
changePercent: number;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Version compatibility information included in diff results.
|
|
211
|
+
*/
|
|
212
|
+
export interface VersionCompatibilityInfo {
|
|
213
|
+
/** Whether the versions are compatible for comparison */
|
|
214
|
+
compatible: boolean;
|
|
215
|
+
/** Warning message if versions differ */
|
|
216
|
+
warning: string | null;
|
|
217
|
+
/** Source baseline format version */
|
|
218
|
+
sourceVersion: string;
|
|
219
|
+
/** Target baseline format version */
|
|
220
|
+
targetVersion: string;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Tool fingerprint for comparison.
|
|
224
|
+
*/
|
|
225
|
+
export interface ToolFingerprint {
|
|
226
|
+
name: string;
|
|
227
|
+
description: string;
|
|
228
|
+
schemaHash: string;
|
|
229
|
+
/** Full input schema for the tool (preserved for cloud upload) */
|
|
230
|
+
inputSchema?: Record<string, unknown>;
|
|
231
|
+
assertions: BehavioralAssertion[];
|
|
232
|
+
securityNotes: string[];
|
|
233
|
+
limitations: string[];
|
|
234
|
+
/** Fingerprint of the tool's response structure */
|
|
235
|
+
responseFingerprint?: ResponseFingerprint;
|
|
236
|
+
/** Inferred JSON schema of the tool's output */
|
|
237
|
+
inferredOutputSchema?: InferredSchema;
|
|
238
|
+
/** Normalized error patterns observed during testing */
|
|
239
|
+
errorPatterns?: ErrorPattern[];
|
|
240
|
+
/** Whether this tool is deprecated */
|
|
241
|
+
deprecated?: boolean;
|
|
242
|
+
/** When the tool was marked as deprecated */
|
|
243
|
+
deprecatedAt?: Date;
|
|
244
|
+
/** Deprecation notice/message for consumers */
|
|
245
|
+
deprecationNotice?: string;
|
|
246
|
+
/** Planned removal date for the tool */
|
|
247
|
+
removalDate?: Date;
|
|
248
|
+
/** Suggested replacement tool name */
|
|
249
|
+
replacementTool?: string;
|
|
250
|
+
/** Baseline p50 latency in milliseconds */
|
|
251
|
+
baselineP50Ms?: number;
|
|
252
|
+
/** Baseline p95 latency in milliseconds */
|
|
253
|
+
baselineP95Ms?: number;
|
|
254
|
+
/** Baseline success rate (0-1) */
|
|
255
|
+
baselineSuccessRate?: number;
|
|
256
|
+
/** When this tool was last tested */
|
|
257
|
+
lastTestedAt?: Date;
|
|
258
|
+
/** Hash of the input schema at last test time */
|
|
259
|
+
inputSchemaHashAtTest?: string;
|
|
260
|
+
/** Security testing fingerprint with findings and risk score */
|
|
261
|
+
securityFingerprint?: SecurityFingerprint;
|
|
262
|
+
/** Semantic type inferences for parameters (discovered during check) */
|
|
263
|
+
semanticInferences?: SemanticInferenceRecord[];
|
|
264
|
+
/** Response schema evolution tracking for consistency analysis */
|
|
265
|
+
responseSchemaEvolution?: ResponseSchemaEvolution;
|
|
266
|
+
/** Statistical confidence metrics for performance baselines */
|
|
267
|
+
performanceConfidence?: PerformanceConfidence;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Record of a semantic type inference for a parameter.
|
|
271
|
+
* Stored in baseline to track inferred types across runs.
|
|
272
|
+
*/
|
|
273
|
+
export interface SemanticInferenceRecord {
|
|
274
|
+
/** Parameter name */
|
|
275
|
+
paramName: string;
|
|
276
|
+
/** Inferred semantic type */
|
|
277
|
+
inferredType: string;
|
|
278
|
+
/** Confidence level (0-1) */
|
|
279
|
+
confidence: number;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Server fingerprint for baseline comparison.
|
|
283
|
+
*/
|
|
284
|
+
export interface ServerFingerprint {
|
|
285
|
+
name: string;
|
|
286
|
+
version: string;
|
|
287
|
+
protocolVersion: string;
|
|
288
|
+
capabilities: string[];
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Mode used to create the baseline.
|
|
292
|
+
* Baselines are only created from check mode (deterministic, no LLM).
|
|
293
|
+
* Explore mode results are for documentation only and don't create baselines.
|
|
294
|
+
*/
|
|
295
|
+
export type BaselineMode = 'check';
|
|
296
|
+
/**
|
|
297
|
+
* Baseline for an MCP server.
|
|
298
|
+
*/
|
|
299
|
+
export interface BehavioralBaseline {
|
|
300
|
+
/** Format version using semantic versioning (e.g., "1.0.0") */
|
|
301
|
+
version: string;
|
|
302
|
+
createdAt: Date;
|
|
303
|
+
mode?: BaselineMode;
|
|
304
|
+
serverCommand: string;
|
|
305
|
+
server: ServerFingerprint;
|
|
306
|
+
tools: ToolFingerprint[];
|
|
307
|
+
summary: string;
|
|
308
|
+
assertions: BehavioralAssertion[];
|
|
309
|
+
workflowSignatures?: WorkflowSignature[];
|
|
310
|
+
integrityHash: string;
|
|
311
|
+
/** Drift acceptance metadata - present when drift was intentionally accepted */
|
|
312
|
+
acceptance?: DriftAcceptance;
|
|
313
|
+
/** Documentation quality score summary */
|
|
314
|
+
documentationScore?: DocumentationScoreSummary;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Workflow signature for baseline tracking.
|
|
318
|
+
*/
|
|
319
|
+
export interface WorkflowSignature {
|
|
320
|
+
id: string;
|
|
321
|
+
name: string;
|
|
322
|
+
toolSequence: string[];
|
|
323
|
+
succeeded: boolean;
|
|
324
|
+
summary?: string;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Options for baseline comparison.
|
|
328
|
+
*/
|
|
329
|
+
export interface CompareOptions {
|
|
330
|
+
ignoreSchemaChanges?: boolean;
|
|
331
|
+
ignoreDescriptionChanges?: boolean;
|
|
332
|
+
/** Ignore changes in response structure fingerprints */
|
|
333
|
+
ignoreResponseStructureChanges?: boolean;
|
|
334
|
+
/** Ignore changes in error patterns */
|
|
335
|
+
ignoreErrorPatternChanges?: boolean;
|
|
336
|
+
/** Ignore changes in security findings */
|
|
337
|
+
ignoreSecurityChanges?: boolean;
|
|
338
|
+
minimumSeverity?: ChangeSeverity;
|
|
339
|
+
tools?: string[];
|
|
340
|
+
/** Force comparison even if baseline versions are incompatible */
|
|
341
|
+
ignoreVersionMismatch?: boolean;
|
|
342
|
+
/** Performance regression threshold (0-1, e.g., 0.10 = 10% slower) */
|
|
343
|
+
performanceThreshold?: number;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Metadata about baseline drift acceptance.
|
|
347
|
+
* Tracks when and why drift was intentionally accepted.
|
|
348
|
+
*/
|
|
349
|
+
export interface DriftAcceptance {
|
|
350
|
+
/** When the drift was accepted */
|
|
351
|
+
acceptedAt: Date;
|
|
352
|
+
/** Who accepted the drift (optional, for audit trail) */
|
|
353
|
+
acceptedBy?: string;
|
|
354
|
+
/** Reason for accepting the drift */
|
|
355
|
+
reason?: string;
|
|
356
|
+
/** The diff that was accepted */
|
|
357
|
+
acceptedDiff: AcceptedDiff;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Snapshot of the diff that was accepted.
|
|
361
|
+
* Used to verify that the accepted drift matches current state.
|
|
362
|
+
*/
|
|
363
|
+
export interface AcceptedDiff {
|
|
364
|
+
/** Tools that were added */
|
|
365
|
+
toolsAdded: string[];
|
|
366
|
+
/** Tools that were removed */
|
|
367
|
+
toolsRemoved: string[];
|
|
368
|
+
/** Tools that were modified */
|
|
369
|
+
toolsModified: string[];
|
|
370
|
+
/** Overall severity at time of acceptance */
|
|
371
|
+
severity: ChangeSeverity;
|
|
372
|
+
/** Counts at time of acceptance */
|
|
373
|
+
breakingCount: number;
|
|
374
|
+
warningCount: number;
|
|
375
|
+
infoCount: number;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Configuration for severity thresholds.
|
|
379
|
+
* Allows customizing how changes are classified and reported.
|
|
380
|
+
*/
|
|
381
|
+
export interface SeverityConfig {
|
|
382
|
+
/**
|
|
383
|
+
* Minimum severity level to include in reports.
|
|
384
|
+
* Changes below this threshold are filtered out.
|
|
385
|
+
* @default 'none'
|
|
386
|
+
*/
|
|
387
|
+
minimumSeverity?: ChangeSeverity;
|
|
388
|
+
/**
|
|
389
|
+
* Severity level at which to fail CI checks.
|
|
390
|
+
* Exit code 0 for changes below this threshold.
|
|
391
|
+
* @default 'breaking'
|
|
392
|
+
*/
|
|
393
|
+
failOnSeverity?: ChangeSeverity;
|
|
394
|
+
/**
|
|
395
|
+
* Suppress warning-level changes from output.
|
|
396
|
+
* @default false
|
|
397
|
+
*/
|
|
398
|
+
suppressWarnings?: boolean;
|
|
399
|
+
/**
|
|
400
|
+
* Custom severity overrides per aspect.
|
|
401
|
+
* Allows downgrading/upgrading severity for specific change types.
|
|
402
|
+
* Use 'none' to completely ignore changes for an aspect.
|
|
403
|
+
*/
|
|
404
|
+
aspectOverrides?: Partial<Record<BehaviorAspect, ChangeSeverity>>;
|
|
405
|
+
}
|
|
406
|
+
export type { SecurityFingerprint, SecurityDiff } from '../security/types.js';
|
|
407
|
+
export type { ResponseSchemaEvolution, SchemaEvolutionDiff, SchemaVersion, SchemaTypeChange, } from './response-schema-tracker.js';
|
|
408
|
+
export type { HttpStatusCategory, ErrorSeverity, EnhancedErrorAnalysis, ErrorAnalysisSummary, } from './error-analyzer.js';
|
|
409
|
+
export type { DocumentationScore, DocumentationScoreSummary, DocumentationScoreChange, DocumentationIssue, DocumentationGrade, DocumentationComponents, ToolDocumentationScore, } from './documentation-scorer.js';
|
|
410
|
+
/**
|
|
411
|
+
* Performance confidence metrics for a tool.
|
|
412
|
+
* Indicates statistical validity of performance baselines.
|
|
413
|
+
*/
|
|
414
|
+
export interface PerformanceConfidence {
|
|
415
|
+
/** Number of samples used to calculate metrics (happy_path tests only) */
|
|
416
|
+
sampleCount: number;
|
|
417
|
+
/** Number of successful happy_path samples (tool executed without error) */
|
|
418
|
+
successfulSamples: number;
|
|
419
|
+
/** Number of validation tests that correctly rejected invalid input */
|
|
420
|
+
validationSamples: number;
|
|
421
|
+
/** Total tests run including validation tests */
|
|
422
|
+
totalTests: number;
|
|
423
|
+
/** Standard deviation of latency samples (ms) */
|
|
424
|
+
standardDeviation: number;
|
|
425
|
+
/** Coefficient of variation (stdDev / mean) - lower is more consistent */
|
|
426
|
+
coefficientOfVariation: number;
|
|
427
|
+
/** Confidence level based on sample count and CV */
|
|
428
|
+
confidenceLevel: ConfidenceLevel;
|
|
429
|
+
/** Recommendation if confidence is low */
|
|
430
|
+
recommendation?: string;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Performance confidence change between baselines.
|
|
434
|
+
*/
|
|
435
|
+
export interface PerformanceConfidenceChange {
|
|
436
|
+
/** Tool name */
|
|
437
|
+
toolName: string;
|
|
438
|
+
/** Previous confidence level */
|
|
439
|
+
previousLevel?: ConfidenceLevel;
|
|
440
|
+
/** Current confidence level */
|
|
441
|
+
currentLevel: ConfidenceLevel;
|
|
442
|
+
/** Whether confidence improved */
|
|
443
|
+
improved: boolean;
|
|
444
|
+
/** Whether confidence degraded */
|
|
445
|
+
degraded: boolean;
|
|
446
|
+
/** Human-readable summary */
|
|
447
|
+
summary: string;
|
|
448
|
+
}
|
|
449
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Baseline versioning using CLI package version.
|
|
3
|
+
*
|
|
4
|
+
* Compatibility Rules:
|
|
5
|
+
* - Same CLI major version = COMPATIBLE (can compare baselines)
|
|
6
|
+
* - Different CLI major version = INCOMPATIBLE (requires migration)
|
|
7
|
+
*
|
|
8
|
+
* This aligns with semantic versioning: major version changes signal
|
|
9
|
+
* breaking changes, including baseline format changes.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Get the current CLI version for baseline creation.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getBaselineVersion(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Parsed semantic version components.
|
|
17
|
+
*/
|
|
18
|
+
export interface FormatVersion {
|
|
19
|
+
/** Major version - breaking changes require new major version */
|
|
20
|
+
major: number;
|
|
21
|
+
/** Minor version - additive/backwards-compatible changes */
|
|
22
|
+
minor: number;
|
|
23
|
+
/** Patch version - bug fixes */
|
|
24
|
+
patch: number;
|
|
25
|
+
/** Original raw version string */
|
|
26
|
+
raw: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Result of a version compatibility check.
|
|
30
|
+
*/
|
|
31
|
+
export interface VersionCompatibility {
|
|
32
|
+
/** Whether the versions are compatible for comparison */
|
|
33
|
+
compatible: boolean;
|
|
34
|
+
/** Warning message if versions differ (null if identical) */
|
|
35
|
+
warning: string | null;
|
|
36
|
+
/** Source baseline version */
|
|
37
|
+
sourceVersion: string;
|
|
38
|
+
/** Target baseline version */
|
|
39
|
+
targetVersion: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Error thrown when baseline versions are incompatible.
|
|
43
|
+
*/
|
|
44
|
+
export declare class BaselineVersionError extends Error {
|
|
45
|
+
readonly sourceVersion: string;
|
|
46
|
+
readonly targetVersion: string;
|
|
47
|
+
constructor(message: string, sourceVersion: string, targetVersion: string);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Parse a version string into its semantic components.
|
|
51
|
+
*
|
|
52
|
+
* Handles:
|
|
53
|
+
* - Full semver: "1.0.0" -> { major: 1, minor: 0, patch: 0 }
|
|
54
|
+
* - Partial semver: "1.0" -> { major: 1, minor: 0, patch: 0 }
|
|
55
|
+
* - Legacy numeric: 1 -> { major: 1, minor: 0, patch: 0 }
|
|
56
|
+
*
|
|
57
|
+
* @param version - Version string or number to parse
|
|
58
|
+
* @returns Parsed version components
|
|
59
|
+
*/
|
|
60
|
+
export declare function parseVersion(version: string | number | undefined): FormatVersion;
|
|
61
|
+
/**
|
|
62
|
+
* Check if two versions are compatible for baseline comparison.
|
|
63
|
+
*
|
|
64
|
+
* Versions are compatible if they share the same major version.
|
|
65
|
+
*
|
|
66
|
+
* @param v1 - First version
|
|
67
|
+
* @param v2 - Second version
|
|
68
|
+
* @returns true if compatible, false otherwise
|
|
69
|
+
*/
|
|
70
|
+
export declare function areVersionsCompatible(v1: FormatVersion, v2: FormatVersion): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Compare two versions and return -1, 0, or 1.
|
|
73
|
+
*
|
|
74
|
+
* @param v1 - First version
|
|
75
|
+
* @param v2 - Second version
|
|
76
|
+
* @returns -1 if v1 < v2, 0 if equal, 1 if v1 > v2
|
|
77
|
+
*/
|
|
78
|
+
export declare function compareVersions(v1: FormatVersion, v2: FormatVersion): -1 | 0 | 1;
|
|
79
|
+
/**
|
|
80
|
+
* Get a warning message for version differences, or null if versions are identical.
|
|
81
|
+
*
|
|
82
|
+
* @param v1 - First version (source/baseline)
|
|
83
|
+
* @param v2 - Second version (target/current)
|
|
84
|
+
* @returns Warning message or null
|
|
85
|
+
*/
|
|
86
|
+
export declare function getCompatibilityWarning(v1: FormatVersion, v2: FormatVersion): string | null;
|
|
87
|
+
/**
|
|
88
|
+
* Check version compatibility and return detailed result.
|
|
89
|
+
*
|
|
90
|
+
* @param sourceVersion - Version of the source/baseline
|
|
91
|
+
* @param targetVersion - Version of the target/current
|
|
92
|
+
* @returns Compatibility result with details
|
|
93
|
+
*/
|
|
94
|
+
export declare function checkVersionCompatibility(sourceVersion: string | number | undefined, targetVersion: string | number | undefined): VersionCompatibility;
|
|
95
|
+
/**
|
|
96
|
+
* Assert that two versions are compatible, throwing an error if not.
|
|
97
|
+
*
|
|
98
|
+
* @param sourceVersion - Version of the source/baseline
|
|
99
|
+
* @param targetVersion - Version of the target/current
|
|
100
|
+
* @throws BaselineVersionError if versions are incompatible
|
|
101
|
+
*/
|
|
102
|
+
export declare function assertVersionCompatibility(sourceVersion: string | number | undefined, targetVersion: string | number | undefined): void;
|
|
103
|
+
/**
|
|
104
|
+
* Format a version for display.
|
|
105
|
+
*
|
|
106
|
+
* @param version - Version to format
|
|
107
|
+
* @returns Formatted version string like "v1.0.0"
|
|
108
|
+
*/
|
|
109
|
+
export declare function formatVersion(version: string | number | undefined): string;
|
|
110
|
+
/**
|
|
111
|
+
* Check if a version is the current CLI version.
|
|
112
|
+
*
|
|
113
|
+
* @param version - Version to check
|
|
114
|
+
* @returns true if version matches current CLI version
|
|
115
|
+
*/
|
|
116
|
+
export declare function isCurrentVersion(version: string | number | undefined): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Check if a version is older than the current CLI version.
|
|
119
|
+
*
|
|
120
|
+
* @param version - Version to check
|
|
121
|
+
* @returns true if version is older than current
|
|
122
|
+
*/
|
|
123
|
+
export declare function isOlderVersion(version: string | number | undefined): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Check if a version is newer than the current CLI version.
|
|
126
|
+
*
|
|
127
|
+
* @param version - Version to check
|
|
128
|
+
* @returns true if version is newer than current
|
|
129
|
+
*/
|
|
130
|
+
export declare function isNewerVersion(version: string | number | undefined): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Check if a baseline version requires migration (different major version).
|
|
133
|
+
*
|
|
134
|
+
* @param version - Version to check
|
|
135
|
+
* @returns true if baseline needs migration to be compatible
|
|
136
|
+
*/
|
|
137
|
+
export declare function requiresMigration(version: string | number | undefined): boolean;
|
|
138
|
+
//# sourceMappingURL=version.d.ts.map
|