@standards-kit/conform 0.1.0 → 0.1.3

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.
Files changed (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +143 -0
  3. package/dist/{chunk-P7TIZJ4C.js → chunk-DXIYZR62.js} +2 -2
  4. package/dist/chunk-DXIYZR62.js.map +1 -0
  5. package/dist/{chunk-KHO6NIAI.js → chunk-PZ2NVKI7.js} +7 -7
  6. package/dist/chunk-PZ2NVKI7.js.map +1 -0
  7. package/dist/cli.d.ts +2 -0
  8. package/dist/cli.js +14 -14
  9. package/dist/cli.js.map +1 -1
  10. package/dist/code/index.d.ts +11 -0
  11. package/dist/code/tools/base.d.ts +51 -0
  12. package/dist/code/tools/comment-utils.d.ts +17 -0
  13. package/dist/code/tools/coverage-run.d.ts +37 -0
  14. package/dist/code/tools/disable-comments.d.ts +42 -0
  15. package/dist/code/tools/eslint.d.ts +99 -0
  16. package/dist/code/tools/gitleaks.d.ts +42 -0
  17. package/dist/code/tools/index.d.ts +13 -0
  18. package/dist/code/tools/knip.d.ts +20 -0
  19. package/dist/code/tools/naming.d.ts +64 -0
  20. package/dist/code/tools/pipaudit.d.ts +24 -0
  21. package/dist/code/tools/pnpmaudit.d.ts +36 -0
  22. package/dist/code/tools/ruff.d.ts +46 -0
  23. package/dist/code/tools/tsc.d.ts +57 -0
  24. package/dist/code/tools/ty.d.ts +34 -0
  25. package/dist/code/tools/vulture.d.ts +32 -0
  26. package/dist/core/index.d.ts +7 -0
  27. package/dist/core/loader.d.ts +42 -0
  28. package/dist/core/registry.d.ts +17 -0
  29. package/dist/core/schema.d.ts +1829 -0
  30. package/dist/core/types.d.ts +95 -0
  31. package/dist/{src-KZRTG3EU.js → core-KB2W6SE2.js} +3 -3
  32. package/dist/dependencies/index.d.ts +13 -0
  33. package/dist/dependencies/mappings.d.ts +17 -0
  34. package/dist/dependencies/output.d.ts +12 -0
  35. package/dist/dependencies/types.d.ts +34 -0
  36. package/dist/index.d.ts +21 -0
  37. package/dist/index.js +9 -5
  38. package/dist/index.js.map +1 -1
  39. package/dist/infra/arn.d.ts +16 -0
  40. package/dist/infra/checkers/cloudwatch.d.ts +8 -0
  41. package/dist/infra/checkers/dynamodb.d.ts +8 -0
  42. package/dist/infra/checkers/ec2.d.ts +13 -0
  43. package/dist/infra/checkers/ecs.d.ts +13 -0
  44. package/dist/infra/checkers/elasticache.d.ts +13 -0
  45. package/dist/infra/checkers/elb.d.ts +13 -0
  46. package/dist/infra/checkers/gcp/artifactregistry.d.ts +5 -0
  47. package/dist/infra/checkers/gcp/cloudrun.d.ts +5 -0
  48. package/dist/infra/checkers/gcp/iam.d.ts +5 -0
  49. package/dist/infra/checkers/gcp/index.d.ts +17 -0
  50. package/dist/infra/checkers/gcp/secretmanager.d.ts +5 -0
  51. package/dist/infra/checkers/iam.d.ts +8 -0
  52. package/dist/infra/checkers/index.d.ts +26 -0
  53. package/dist/infra/checkers/lambda.d.ts +8 -0
  54. package/dist/infra/checkers/rds.d.ts +13 -0
  55. package/dist/infra/checkers/s3.d.ts +8 -0
  56. package/dist/infra/checkers/secretsmanager.d.ts +8 -0
  57. package/dist/infra/checkers/sns.d.ts +8 -0
  58. package/dist/infra/checkers/sqs.d.ts +8 -0
  59. package/dist/infra/checkers/types.d.ts +28 -0
  60. package/dist/infra/gcp.d.ts +18 -0
  61. package/dist/infra/generate.d.ts +74 -0
  62. package/dist/infra/index.d.ts +59 -0
  63. package/dist/infra/manifest.d.ts +58 -0
  64. package/dist/infra/output.d.ts +8 -0
  65. package/dist/infra/scan.d.ts +25 -0
  66. package/dist/infra/schemas.d.ts +806 -0
  67. package/dist/infra/types.d.ts +8 -0
  68. package/dist/{infra-UXM5XQX3.js → infra-ZQRXX7AW.js} +3 -3
  69. package/dist/infra-ZQRXX7AW.js.map +1 -0
  70. package/dist/mcp/index.d.ts +7 -0
  71. package/dist/mcp/server.d.ts +18 -0
  72. package/dist/mcp/standards/fetcher.d.ts +29 -0
  73. package/dist/mcp/standards/index.d.ts +4 -0
  74. package/dist/mcp/standards/matcher.d.ts +22 -0
  75. package/dist/mcp/standards/parser.d.ts +46 -0
  76. package/dist/mcp/standards/types.d.ts +32 -0
  77. package/dist/mcp/tools/get-guideline.d.ts +26 -0
  78. package/dist/mcp/tools/get-ruleset.d.ts +26 -0
  79. package/dist/mcp/tools/get-standards.d.ts +27 -0
  80. package/dist/mcp/tools/index.d.ts +4 -0
  81. package/dist/mcp/tools/list-guidelines.d.ts +25 -0
  82. package/dist/{mcp-O5O7XVFG.js → mcp-WXYRFNEV.js} +3 -3
  83. package/dist/mcp-WXYRFNEV.js.map +1 -0
  84. package/dist/output/index.d.ts +14 -0
  85. package/dist/process/commands/check-branch.d.ts +13 -0
  86. package/dist/process/commands/check-commit.d.ts +14 -0
  87. package/dist/process/commands/index.d.ts +2 -0
  88. package/dist/process/index.d.ts +11 -0
  89. package/dist/process/scan/index.d.ts +5 -0
  90. package/dist/process/scan/remote-fetcher.d.ts +18 -0
  91. package/dist/process/scan/scanner.d.ts +6 -0
  92. package/dist/process/scan/types.d.ts +57 -0
  93. package/dist/process/scan/validators.d.ts +37 -0
  94. package/dist/process/sync/applier.d.ts +10 -0
  95. package/dist/process/sync/differ.d.ts +7 -0
  96. package/dist/process/sync/fetcher.d.ts +14 -0
  97. package/dist/process/sync/index.d.ts +9 -0
  98. package/dist/process/sync/types.d.ts +131 -0
  99. package/dist/process/sync/validator.d.ts +22 -0
  100. package/dist/process/tools/backups.d.ts +32 -0
  101. package/dist/process/tools/base.d.ts +52 -0
  102. package/dist/process/tools/branches.d.ts +41 -0
  103. package/dist/process/tools/changesets.d.ts +53 -0
  104. package/dist/process/tools/ci.d.ts +57 -0
  105. package/dist/process/tools/codeowners.d.ts +68 -0
  106. package/dist/process/tools/commits.d.ts +39 -0
  107. package/dist/process/tools/coverage.d.ts +57 -0
  108. package/dist/process/tools/docs-helpers.d.ts +44 -0
  109. package/dist/process/tools/docs.d.ts +38 -0
  110. package/dist/process/tools/forbidden-files.d.ts +40 -0
  111. package/dist/process/tools/hooks.d.ts +39 -0
  112. package/dist/process/tools/index.d.ts +14 -0
  113. package/dist/process/tools/pr.d.ts +59 -0
  114. package/dist/process/tools/repo.d.ts +65 -0
  115. package/dist/process/tools/tickets.d.ts +42 -0
  116. package/dist/projects/detector.d.ts +16 -0
  117. package/dist/projects/index.d.ts +4 -0
  118. package/dist/projects/templates.d.ts +15 -0
  119. package/dist/projects/tier-loader.d.ts +14 -0
  120. package/dist/projects/types.d.ts +76 -0
  121. package/dist/{registry-V65CC7IN.js → registry-7CDIMOLZ.js} +2 -2
  122. package/dist/{scan-EELS42BP.js → scan-IKEHLZXV.js} +4 -4
  123. package/dist/{scan-EELS42BP.js.map → scan-IKEHLZXV.js.map} +1 -1
  124. package/dist/{sync-RLYBGYNY.js → sync-XV6XBLVZ.js} +3 -3
  125. package/dist/{sync-RLYBGYNY.js.map → sync-XV6XBLVZ.js.map} +1 -1
  126. package/dist/validate/guidelines.d.ts +18 -0
  127. package/dist/validate/index.d.ts +5 -0
  128. package/dist/validate/tier.d.ts +14 -0
  129. package/dist/validate/types.d.ts +56 -0
  130. package/dist/{validate-AABLVQJS.js → validate-DKEJICCK.js} +3 -3
  131. package/dist/validate-DKEJICCK.js.map +1 -0
  132. package/package.json +26 -19
  133. package/dist/chunk-KHO6NIAI.js.map +0 -1
  134. package/dist/chunk-P7TIZJ4C.js.map +0 -1
  135. package/dist/infra-UXM5XQX3.js.map +0 -1
  136. package/dist/mcp-O5O7XVFG.js.map +0 -1
  137. package/dist/validate-AABLVQJS.js.map +0 -1
  138. /package/dist/{registry-V65CC7IN.js.map → core-KB2W6SE2.js.map} +0 -0
  139. /package/dist/{src-KZRTG3EU.js.map → registry-7CDIMOLZ.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/validate/guidelines.ts","../src/validate/tier.ts","../src/validate/types.ts"],"sourcesContent":["/**\n * Validate guideline markdown files against the frontmatter schema\n */\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\nimport chalk from \"chalk\";\nimport matter from \"gray-matter\";\n\nimport { frontmatterSchema } from \"../mcp/standards/index.js\";\nimport { ExitCode } from \"@standards-kit/core\";\n\n/** Single file validation error */\nexport interface GuidelineValidationError {\n file: string;\n errors: string[];\n}\n\n/** Overall validation result */\nexport interface GuidelineValidationResult {\n valid: boolean;\n validCount: number;\n invalidCount: number;\n errors: GuidelineValidationError[];\n}\n\n/** Format text output for validation result */\nfunction formatTextOutput(result: GuidelineValidationResult): string {\n if (result.valid) {\n return chalk.green(`✓ All ${result.validCount} guideline(s) valid`);\n }\n const lines = [chalk.red(`✗ Found ${result.invalidCount} invalid guideline(s)`), \"\"];\n for (const err of result.errors) {\n lines.push(chalk.red(` ${err.file}:`));\n for (const e of err.errors) {\n lines.push(chalk.red(` - ${e}`));\n }\n }\n return lines.join(\"\\n\");\n}\n\n/** Validate a directory of guideline files */\nexport function validateGuidelinesDir(dirPath: string): GuidelineValidationResult {\n const files = fs.readdirSync(dirPath).filter((f) => f.endsWith(\".md\"));\n const result: GuidelineValidationResult = {\n valid: true,\n validCount: 0,\n invalidCount: 0,\n errors: [],\n };\n\n for (const file of files) {\n const filePath = path.join(dirPath, file);\n const content = fs.readFileSync(filePath, \"utf-8\");\n const { data } = matter(content);\n\n const parseResult = frontmatterSchema.safeParse(data);\n if (parseResult.success) {\n result.validCount++;\n } else {\n result.valid = false;\n result.invalidCount++;\n result.errors.push({\n file,\n errors: parseResult.error.errors.map((e) => `${e.path.join(\".\")}: ${e.message}`),\n });\n }\n }\n\n return result;\n}\n\n/** Output error and exit */\nfunction exitWithError(error: string, format: string): never {\n if (format === \"json\") {\n process.stdout.write(`${JSON.stringify({ valid: false, error }, null, 2)}\\n`);\n } else {\n console.error(chalk.red(`✗ ${error}`));\n }\n process.exit(ExitCode.CONFIG_ERROR);\n}\n\n/** Resolve and validate directory path */\nfunction resolveAndValidatePath(dirPath: string, format: string): string {\n const resolvedPath = path.isAbsolute(dirPath) ? dirPath : path.resolve(process.cwd(), dirPath);\n\n if (!fs.existsSync(resolvedPath)) {\n exitWithError(`Path does not exist: ${resolvedPath}`, format);\n }\n\n const stats = fs.statSync(resolvedPath);\n if (!stats.isDirectory()) {\n exitWithError(`Path is not a directory: ${resolvedPath}`, format);\n }\n\n return resolvedPath;\n}\n\n/** Run the validate guidelines command */\nexport async function runValidateGuidelines(\n dirPath: string,\n options: { format: string }\n): Promise<void> {\n const resolvedPath = resolveAndValidatePath(dirPath, options.format);\n const result = validateGuidelinesDir(resolvedPath);\n\n if (options.format === \"json\") {\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n } else {\n process.stdout.write(`${formatTextOutput(result)}\\n`);\n }\n\n process.exit(result.valid ? ExitCode.SUCCESS : ExitCode.CONFIG_ERROR);\n}\n","import { execSync } from \"node:child_process\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\nimport TOML from \"@iarna/toml\";\nimport chalk from \"chalk\";\nimport * as yaml from \"js-yaml\";\n\nimport { findConfigFile, getProjectRoot } from \"@standards-kit/core\";\nimport {\n type RepoMetadata,\n type Tier,\n type TierSourceDetail,\n VALID_TIERS,\n type ValidateTierOptions,\n type ValidateTierResult,\n} from \"./types.js\";\n\n/** Default tier when not specified */\nconst DEFAULT_TIER: Tier = \"internal\";\n\n/** Extends section from standards.toml */\ninterface ExtendsConfig {\n registry?: string;\n rulesets?: string[];\n}\n\n/** Raw standards.toml structure (just what we need) */\ninterface RawConfig {\n extends?: ExtendsConfig;\n}\n\n/** Result of loading repo-metadata.yaml with detailed source info */\ninterface LoadMetadataResult {\n metadata: RepoMetadata | null;\n sourceDetail: TierSourceDetail;\n parseError?: string;\n}\n\n/**\n * Find the git repository root directory\n */\nfunction findGitRoot(startDir: string): string | null {\n try {\n const gitRoot = execSync(\"git rev-parse --show-toplevel\", {\n cwd: startDir,\n encoding: \"utf-8\",\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n }).trim();\n return gitRoot;\n } catch {\n return null;\n }\n}\n\n/**\n * Read file content, returns null if file doesn't exist or can't be read\n */\nfunction readFileContent(filePath: string): string | null {\n if (!fs.existsSync(filePath)) {\n return null;\n }\n try {\n return fs.readFileSync(filePath, \"utf-8\");\n } catch {\n return null;\n }\n}\n\n/**\n * Parse YAML content into RepoMetadata\n */\nfunction parseYamlContent(content: string): LoadMetadataResult {\n try {\n const parsed: unknown = yaml.load(content);\n // yaml.load returns undefined for empty content, null for \"null\"\n if (parsed === undefined || parsed === null) {\n return { metadata: null, sourceDetail: \"default (file empty)\" };\n }\n return { metadata: parsed as RepoMetadata, sourceDetail: \"repo-metadata.yaml\" };\n } catch (error) {\n const parseError = error instanceof Error ? error.message : String(error);\n return { metadata: null, sourceDetail: \"default (parse error)\", parseError };\n }\n}\n\n/**\n * Load and parse repo-metadata.yaml with detailed error tracking\n */\nfunction loadRepoMetadata(projectRoot: string): LoadMetadataResult {\n const metadataPath = path.join(projectRoot, \"repo-metadata.yaml\");\n const content = readFileContent(metadataPath);\n\n if (content === null) {\n return { metadata: null, sourceDetail: \"default (file not found)\" };\n }\n if (!content.trim()) {\n return { metadata: null, sourceDetail: \"default (file empty)\" };\n }\n\n return parseYamlContent(content);\n}\n\n/**\n * Load and parse standards.toml to get extends section\n */\nfunction loadExtendsConfig(configPath: string): ExtendsConfig | null {\n try {\n const content = fs.readFileSync(configPath, \"utf-8\");\n const parsed = TOML.parse(content) as RawConfig;\n return parsed.extends ?? null;\n } catch {\n return null;\n }\n}\n\n/** Result of getTier with detailed info */\ninterface GetTierResult {\n tier: Tier;\n source: \"repo-metadata.yaml\" | \"default\";\n sourceDetail: TierSourceDetail;\n invalidValue?: string;\n}\n\n/**\n * Get tier from repo-metadata.yaml with validation\n */\nfunction getTier(metadataResult: LoadMetadataResult): GetTierResult {\n const { metadata, sourceDetail } = metadataResult;\n\n // If metadata loading failed, return with the detailed reason\n if (!metadata) {\n return { tier: DEFAULT_TIER, source: \"default\", sourceDetail };\n }\n\n // Metadata exists but tier key is missing\n if (metadata.tier === undefined) {\n return { tier: DEFAULT_TIER, source: \"default\", sourceDetail: \"default (tier not specified)\" };\n }\n\n const tier = metadata.tier;\n\n // Check if tier value is valid\n if (!VALID_TIERS.includes(tier)) {\n return {\n tier: DEFAULT_TIER,\n source: \"default\",\n sourceDetail: \"default (invalid value)\",\n invalidValue: String(tier),\n };\n }\n\n return { tier, source: \"repo-metadata.yaml\", sourceDetail: \"repo-metadata.yaml\" };\n}\n\n/**\n * Check if rulesets include a tier-matching ruleset\n */\nfunction findMatchingRulesets(rulesets: string[], tier: Tier): string[] {\n const suffix = `-${tier}`;\n return rulesets.filter((ruleset) => ruleset.endsWith(suffix));\n}\n\n/**\n * Resolve the config path from options\n */\nfunction resolveConfigPath(options: ValidateTierOptions): string | null {\n if (options.config) {\n const absolutePath = path.resolve(options.config);\n return fs.existsSync(absolutePath) ? absolutePath : null;\n }\n return findConfigFile();\n}\n\n/**\n * Create result for missing config\n */\nfunction createNotFoundResult(): ValidateTierResult {\n return {\n valid: false,\n tier: DEFAULT_TIER,\n tierSource: \"default\",\n rulesets: [],\n expectedPattern: `*-${DEFAULT_TIER}`,\n matchedRulesets: [],\n error: \"No standards.toml found\",\n };\n}\n\n/** Options for building the result */\ninterface BuildResultOptions {\n tier: Tier;\n source: \"repo-metadata.yaml\" | \"default\";\n sourceDetail: TierSourceDetail;\n rulesets: string[];\n matchedRulesets: string[];\n invalidTierValue?: string;\n hasEmptyRulesets?: boolean;\n registryUrl?: string;\n warnings?: string[];\n parseError?: string;\n}\n\n/**\n * Build the validation result\n */\nfunction buildResult(options: BuildResultOptions): ValidateTierResult {\n const {\n tier,\n source,\n sourceDetail,\n rulesets,\n matchedRulesets,\n invalidTierValue,\n hasEmptyRulesets,\n registryUrl,\n parseError,\n } = options;\n const warnings: string[] = options.warnings ?? [];\n\n const expectedPattern = `*-${tier}`;\n const valid = rulesets.length === 0 || matchedRulesets.length > 0;\n\n // Add warning for invalid tier value\n if (invalidTierValue) {\n warnings.push(\n `Invalid tier '${invalidTierValue}' in repo-metadata.yaml. Valid values are: ${VALID_TIERS.join(\", \")}`\n );\n }\n\n // Add warning for parse error\n if (parseError) {\n warnings.push(`Failed to parse repo-metadata.yaml: ${parseError}`);\n }\n\n // Add warning for empty rulesets with registry configured\n if (hasEmptyRulesets && registryUrl) {\n warnings.push(\n `[extends] is configured with registry '${registryUrl}' but rulesets is empty - no standards will be inherited`\n );\n }\n\n return {\n valid,\n tier,\n tierSource: source,\n tierSourceDetail: sourceDetail,\n rulesets,\n expectedPattern,\n matchedRulesets,\n error: valid\n ? undefined\n : `No ruleset matching pattern '${expectedPattern}' found. Rulesets: [${rulesets.join(\", \")}]`,\n invalidTierValue,\n hasEmptyRulesets,\n registryUrl,\n warnings: warnings.length > 0 ? warnings : undefined,\n };\n}\n\n/**\n * Validate that project tier matches its rulesets.\n * This is the programmatic API exported for library consumers.\n */\nexport function validateTierRuleset(options: ValidateTierOptions = {}): ValidateTierResult {\n const configPath = resolveConfigPath(options);\n if (!configPath) {\n return createNotFoundResult();\n }\n\n // Try to find repo-metadata.yaml from git root first, fall back to config directory\n const configDir = getProjectRoot(configPath);\n const gitRoot = findGitRoot(configDir);\n const metadataSearchPath = gitRoot ?? configDir;\n\n const metadataResult = loadRepoMetadata(metadataSearchPath);\n const { tier, source, sourceDetail, invalidValue } = getTier(metadataResult);\n\n const extendsConfig = loadExtendsConfig(configPath);\n const rulesets = extendsConfig?.rulesets ?? [];\n const matchedRulesets = rulesets.length > 0 ? findMatchingRulesets(rulesets, tier) : [];\n\n // Detect empty rulesets with registry configured\n const hasEmptyRulesets = extendsConfig !== null && rulesets.length === 0;\n const registryUrl = extendsConfig?.registry;\n\n return buildResult({\n tier,\n source,\n sourceDetail,\n rulesets,\n matchedRulesets,\n invalidTierValue: invalidValue,\n hasEmptyRulesets,\n registryUrl,\n parseError: metadataResult.parseError,\n });\n}\n\n/** Format warnings section */\nfunction formatWarnings(warnings: string[] | undefined): string[] {\n if (!warnings || warnings.length === 0) {\n return [];\n }\n const lines = warnings.map((w) => chalk.yellow(`⚠ Warning: ${w}`));\n lines.push(\"\"); // Empty line after warnings\n return lines;\n}\n\n/** Format the rulesets message based on configuration */\nfunction formatRulesetsMessage(result: ValidateTierResult): string {\n if (result.matchedRulesets.length > 0) {\n return ` Matching rulesets: ${result.matchedRulesets.join(\", \")}`;\n }\n if (result.hasEmptyRulesets) {\n return \" No rulesets specified (no tier constraint)\";\n }\n return \" No extends configured (no tier constraint)\";\n}\n\n/** Format the failed validation section */\nfunction formatFailedValidation(result: ValidateTierResult, sourceDisplay: string): string[] {\n const lines = [\n chalk.red(\"✗ Tier validation failed\"),\n ` Tier: ${result.tier} (source: ${sourceDisplay})`,\n ` Expected pattern: ${result.expectedPattern}`,\n ` Rulesets: [${result.rulesets.join(\", \")}]`,\n ];\n if (result.error) {\n lines.push(chalk.red(` Error: ${result.error}`));\n }\n if (result.invalidTierValue) {\n lines.push(\"\");\n lines.push(\n chalk.cyan(\n ` Hint: Update repo-metadata.yaml to use a valid tier value: ${VALID_TIERS.join(\", \")}`\n )\n );\n }\n return lines;\n}\n\n/**\n * Format tier validation result as text\n */\nexport function formatTierResultText(result: ValidateTierResult): string {\n const lines: string[] = formatWarnings(result.warnings);\n const sourceDisplay = result.tierSourceDetail ?? result.tierSource;\n\n if (result.valid) {\n lines.push(chalk.green(\"✓ Tier validation passed\"));\n lines.push(` Tier: ${result.tier} (source: ${sourceDisplay})`);\n lines.push(formatRulesetsMessage(result));\n } else {\n lines.push(...formatFailedValidation(result, sourceDisplay));\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Format tier validation result as JSON\n */\nexport function formatTierResultJson(result: ValidateTierResult): string {\n return JSON.stringify(result, null, 2);\n}\n","/**\n * Valid project tiers\n */\nexport type Tier = \"production\" | \"internal\" | \"prototype\";\n\n/**\n * Valid tier values as a constant array for validation and export\n */\nexport const VALID_TIERS: readonly Tier[] = [\"production\", \"internal\", \"prototype\"];\n\n/**\n * Parsed repo-metadata.yaml structure\n */\nexport interface RepoMetadata {\n tier?: Tier;\n}\n\n/**\n * Detailed tier source indicating why a default was used\n */\nexport type TierSourceDetail =\n | \"repo-metadata.yaml\" // Tier was read from file\n | \"default\" // Generic default (for backwards compatibility)\n | \"default (file not found)\" // File doesn't exist\n | \"default (file empty)\" // File exists but is empty\n | \"default (parse error)\" // File exists but YAML is invalid\n | \"default (tier not specified)\" // File valid but no tier key\n | \"default (invalid value)\"; // File has tier but value is invalid\n\n/**\n * Options for the tier validation command\n */\nexport interface ValidateTierOptions {\n /** Path to standards.toml config file */\n config?: string;\n /** Output format */\n format?: \"text\" | \"json\";\n}\n\n/**\n * Result of tier validation\n */\nexport interface ValidateTierResult {\n /** Whether validation passed */\n valid: boolean;\n /** Project tier from repo-metadata.yaml (defaults to \"internal\") */\n tier: Tier;\n /** Source of tier value */\n tierSource: \"repo-metadata.yaml\" | \"default\";\n /** Detailed source of tier value with reason for default */\n tierSourceDetail?: TierSourceDetail;\n /** Rulesets from standards.toml extends section */\n rulesets: string[];\n /** Expected ruleset suffix pattern */\n expectedPattern: string;\n /** Matched rulesets (those that satisfy the tier requirement) */\n matchedRulesets: string[];\n /** Error message if invalid */\n error?: string;\n /** Invalid tier value that was rejected (for error messages) */\n invalidTierValue?: string;\n /** Whether extends is configured but has empty rulesets */\n hasEmptyRulesets?: boolean;\n /** Registry URL if extends is configured */\n registryUrl?: string;\n /** Warnings about configuration */\n warnings?: string[];\n}\n"],"mappings":";;;;;;;;;;;;AAGA,YAAY,QAAQ;AACpB,YAAY,UAAU;AAEtB,OAAO,WAAW;AAClB,OAAO,YAAY;AAoBnB,SAAS,iBAAiB,QAA2C;AACnE,MAAI,OAAO,OAAO;AAChB,WAAO,MAAM,MAAM,cAAS,OAAO,UAAU,qBAAqB;AAAA,EACpE;AACA,QAAM,QAAQ,CAAC,MAAM,IAAI,gBAAW,OAAO,YAAY,uBAAuB,GAAG,EAAE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