feat: add --spec-version option to tier-check (#176)

* feat: add --spec-version option to tier-check

* refactor: share resolveSpecVersion between CLI and tier-check

Move resolveSpecVersion to src/scenarios/index.ts so tier-check can
reuse it instead of duplicating the validation logic.

---------

Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
This commit is contained in:
Anthony 2026-03-25 15:53:26 +01:00 • committed by GitHub
commit 1c48a30ff6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -227,6 +227,15 @@ export const ALL_SPEC_VERSIONS: SpecVersion[] = [
'extension'
];
export function resolveSpecVersion(value: string): SpecVersion {
if (ALL_SPEC_VERSIONS.includes(value as SpecVersion)) {
return value as SpecVersion;
}
console.error(`Unknown spec version: ${value}`);
console.error(`Valid versions: ${ALL_SPEC_VERSIONS.join(', ')}`);
process.exit(1);
}
export function listScenariosForSpec(version: SpecVersion): string[] {
return scenariosList
.filter((s) => s.specVersions.includes(version))