import type { FormatId, YarnBerryFormatId } from '../format-contract.js'; import type { Graph, OverrideConstraint, TarballKey } from './graph.js'; import type { DiagnosticCode } from './diagnostics.js'; import type { PackumentVersion } from './registry.js'; export type TargetRequest = Readonly<{ format: YarnBerryFormatId; managerVersion?: string; cacheKey?: string; }> | Readonly<{ format: Exclude; managerVersion?: string; }>; export type TargetInput = FormatId | TargetRequest; export type PinnedTargetRequest = TargetRequest & Readonly<{ managerVersion: string; }>; export type Verification = 'unverified' | 'graph-validated' | 'integrity-verified' | 'producer-verified' | 'frozen-verified'; export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun' | 'deno' | 'lockgraph'; export interface PmConfigEvidence { readonly kind: 'pm-config'; readonly manager: Exclude; readonly version: string; readonly source: string; readonly surface: 'overrides'; readonly coverage: 'complete'; readonly overrides: readonly OverrideConstraint[]; } export interface PackageManifestEvidence { readonly kind: 'package-manifests'; readonly authority: 'full-packument' | 'version-manifest' | 'tarball-manifest'; readonly manifests: Readonly>; } export interface TargetOracleEvidence { readonly kind: 'target-oracle'; readonly graph: Graph; readonly target: PinnedTargetRequest; readonly verification: Exclude; readonly platform: string; } export interface EvidenceInputMap { readonly 'pm-config': PmConfigEvidence; readonly 'package-manifests': PackageManifestEvidence; readonly 'target-oracle': TargetOracleEvidence; } export type EvidenceInput = EvidenceInputMap[keyof EvidenceInputMap]; export type ProjectEvidenceInput = Exclude; export type ManifestCoverage = 'partial' | 'complete'; export type RequirementStatus = 'satisfied' | 'unsatisfied' | 'unassessed'; export interface RequirementAssessment { readonly key: string; readonly status: RequirementStatus; readonly reasons: readonly DiagnosticCode[]; } export type ConversionContract = 'snapshot' | 'policy' | 'install'; export interface ConversionAssessment { readonly status: RequirementStatus; readonly contract: ConversionContract; readonly target: TargetRequest; readonly manifestCoverage: ManifestCoverage; readonly requirements: readonly RequirementAssessment[]; }