import type { CapabilityAdapterBinding, CapabilityUnsupportedTarget, CompileTarget, EvidenceRecord, FrontierLangDocument, FrontierUniversalAstEnvelope, FrontierSourceLanguage, LanguageImportResult, NativeAstLossRecord, NativeAstNode, NativeAstRecord, NativeSourceNode, SemanticMergeCandidateRecord, SemanticMergeReadiness, SemanticIndexRecord, SemanticNode, SemanticPatchBundle, SourceMapMappingRecord, SourceMapRecord, SourcePreservationLevel, SourcePreservationRecord, SourceSpan, UniversalAstLayerMap, UniversalAstLayerRecord } from '@shapeshift-labs/frontier-lang-kernel'; import type { Diagnostic } from '@shapeshift-labs/frontier-lang-checker'; import type { EmitTypeScriptOptions, TypeScriptAstModule, TypeScriptDocumentSourceMapResult, TypeScriptGeneratedSourceMapResult } from '@shapeshift-labs/frontier-lang-typescript'; import type { EmitJavaScriptOptions, EmitJavaScriptWithSourceMapResult, JavaScriptAstModule, JavaScriptSourceMapResult } from '@shapeshift-labs/frontier-lang-javascript'; import type { EmitRustOptions, EmitRustWithSourceMapResult, RustAstModule, RustSourceMapResult } from '@shapeshift-labs/frontier-lang-rust'; import type { EmitPythonOptions, EmitPythonWithSourceMapResult, PythonAstModule, PythonSourceMapResult } from '@shapeshift-labs/frontier-lang-python'; import type { CAstHeader, CSourceMapResult, EmitCHeaderOptions, EmitCHeaderWithSourceMapResult } from '@shapeshift-labs/frontier-lang-c'; import type { FrontierCompileTarget, FrontierCompileEmitOptions, FrontierTargetAst, FrontierTargetSourceMapResult, FrontierTargetDocumentSourceMapResult, FrontierCompileOptions, FrontierCompileResult, CapabilityResolution } from './compile.js'; import type { NativeImportTaxonomyKind, NativeImportKnownLossKind, NativeImportRegionTaxonomyKind, NativeImportLossSummaryOptions, NativeImportFeatureEvidenceRisk, NativeImportFeatureEvidencePolicy, NativeImportFeatureEvidenceIssue, NativeImportFeatureEvidenceSummary, NativeImportLossSummary, NativeImportReadinessClassification, NativeImportLanguageProfile } from './native-import-losses.js'; import type { NativeParserAstFormatKind, NativeParserAstFormatProfile, NativeParserAstFormatCoverage, NativeParserAstFormatMatrix, NativeParserAstFormatMatrixOptions } from './native-parser-formats.js'; import type { NativeParserFeatureCategory, NativeParserFeatureCoverageStatus, NativeParserFeatureCoverage, NativeParserFeatureCoverageMap, NativeParserFeatureMergeAssessment, NativeParserFeatureParserRow, NativeParserFeatureLanguageSummary, NativeParserFeatureMatrix, NativeParserFeatureMatrixOptions, NativeParserFeatureMatrixQuery, NativeParserFeatureMatrixQueryResult, NativeImporterAdapterCoverageAggregate } from './native-parser-features.js'; import type { NativeImportCoverageLanguage, NativeImportCoverageMatrix, NativeImportCoverageMatrixOptions } from './native-import-coverage.js'; import type { ProjectionTargetLossClass, ProjectionSourceProjectionCoverage, ProjectionTargetCoverageEntry, ProjectionTargetLanguageCoverage, ProjectionTargetLossMatrix, ProjectionTargetLossMatrixOptions } from './projection-coverage.js'; import type { UniversalCapabilityLanguageRow, UniversalCapabilityMatrix, UniversalCapabilityMatrixOptions } from './universal-capability.js'; import type { NativeImportContractSource, NativeImportSourcePreservationRecordSummary, NativeImportSourcePreservationContract, NativeImportAdapterCoverageRecordSummary, NativeImportAdapterCoverageContract, NativeImportRegionSummary, NativeImportSourceMapSummary, NativeImportReadinessContract, NativeImportResultContract, NativeImportResultContractOptions } from './native-import-contracts.js'; import type { NativeSourceTokenKind, NativeSourcePreservedToken, NativeSourcePreservedDirective, NativeSourcePreservation, CreateNativeSourcePreservationOptions } from './source-preservation.js'; import type { SemanticImportOwnershipRegion, SemanticImportSidecarSymbol, SemanticImportRegionTaxonomySummary, SemanticImportPatchHint, SemanticImportSidecarImportEntry, SemanticImportSidecarSourcePreservationRecord, SemanticImportSidecarUniversalAstLayerSummary, SemanticImportSidecarProofSpecSummary, SemanticImportSidecarParadigmSemanticsSummary, SemanticImportSidecar, SemanticImportSidecarOptions } from './semantic-sidecar.js'; import type { NativeSourceChangeKind, NativeSourceChangeProjectionEndpoint, NativeSourceChangeProjectionSourceMapLink, NativeSourceChangeProjectionMetadata, NativeSourceChangeProjectionSummary, NativeSourceChangeSymbol, NativeSourceChangeRegion, NativeSourceChangeSummary, DiffNativeSourceImportsOptions, DiffNativeSourcesOptions, NativeSourceChangeSet } from './native-diff.js'; import type { SemanticSliceInput, CreateSemanticSliceOptions, SemanticSliceSourceMapLink, SemanticSliceSourceFile, SemanticSliceExpectedAssertion, SemanticSlice, TestSemanticSliceOptions, SemanticSliceTestAssertion, SemanticSliceTestResult } from './semantic-slice.js'; import type { NativeProjectImportAdmission } from './native-project-admission.js'; import type { NativeImporterAdapterExactness, NativeImporterAdapterSemanticCoverage, NativeImporterAdapterCoverageSnapshot, NativeImporterAdapterCoverageObserved, NativeImporterAdapterCoverageCapabilityRow, NativeImporterAdapterCoverageCapabilityEvidence, NativeImporterAdapterCoverageSummary, NativeImporterAdapterCoverageInput } from './adapter-coverage.js'; import type { NativeImporterAdapterDiagnostic, ImportNativeSourceOptions, NativeSourceImportResult, ExternalSemanticIndexFormat, ImportExternalSemanticIndexOptions, ExternalSemanticIndexImportSummary, ExternalSemanticIndexImportResult, NativeImporterAdapterParseInput, NativeImporterAdapterParseResult, NativeImporterAdapter, NativeImporterAdapterSummary, RunNativeImporterAdapterOptions, NativeImporterAdapterImportResult } from './import-adapter-core.js'; import type { JavaScriptNativeImporterAdapterOptions, TypeScriptCompilerNativeImporterAdapterOptions, PythonAstNativeImporterAdapterOptions, RustSynNativeImporterAdapterOptions, ClangAstNativeImporterAdapterOptions, GoAstNativeImporterAdapterOptions } from './import-adapter-options-native.js'; import type { JavaAstNativeImporterAdapterOptions, KotlinPsiNativeImporterAdapterOptions, CSharpRoslynNativeImporterAdapterOptions, SwiftSyntaxNativeImporterAdapterOptions, TreeSitterNativeImporterAdapterOptions } from './import-adapter-options-platform.js'; import type { NativeTargetProjectionAdapterCoverageInput, NativeTargetProjectionAdapterSummary, NativeTargetProjectionAdapterInput, NativeTargetProjectionAdapterResult, NativeTargetProjectionAdapter, NativeTargetProjectionAdapterResolverInput, NativeTargetProjectionResult } from './target-adapters.js'; import type { NativeImportRoundtripReadinessStatus, NativeImportRoundtripReadinessOptions, NativeImportRoundtripReadinessClassification } from './roundtrip.js'; import type { NativeProjectModuleResolutionOptions } from './native-project-module-resolution.js'; import type { NativeProjectSymbolGraphSourceFileRecord, NativeProjectSymbolGraphSourceSpanRecord } from './native-project-source-evidence.js'; import type { NativeProjectSymbolGraphJsxElementRecord, NativeProjectSymbolGraphJsxPropRecord } from './native-project-jsx-graph.js'; import type { NativeProjectSymbolGraphCompilerSymbolRecord, NativeProjectSymbolGraphCompilerTypeRecord, NativeProjectSymbolGraphRuntimeRegionRecord, NativeProjectSymbolGraphScopeBindingRecord, NativeProjectSymbolGraphScopeReferenceRecord } from './native-project-compiler-scope.js'; import type { NativeProjectSymbolGraphExportAssignmentRecord, NativeProjectSymbolGraphModuleDeclarationRecord } from './native-project-module-declarations.js'; import type { NativeProjectSymbolGraphCssModuleImportBindingRecord, NativeProjectSymbolGraphCssModuleUseSiteBlockerRecord, NativeProjectSymbolGraphCssModuleUseSiteGraphRecord, NativeProjectSymbolGraphCssModuleUseSiteRecord } from './native-project-css-modules.js'; export interface NativeProjectSourceInput extends ImportNativeSourceOptions { readonly adapter?: NativeImporterAdapter | string; readonly adapterOptions?: Record; readonly adapterMetadata?: Record; } export interface ImportNativeProjectOptions { readonly id?: string; readonly name?: string; readonly language?: FrontierSourceLanguage | 'mixed'; readonly projectRoot?: string; readonly documentId?: string; readonly documentName?: string; readonly documentMetadata?: Record; readonly universalAstId?: string; readonly universalAstMetadata?: Record; readonly semanticIndexId?: string; readonly patchId?: string; readonly author?: string; readonly metadata?: Record; readonly moduleResolution?: NativeProjectModuleResolutionOptions; readonly tsconfig?: NativeProjectModuleResolutionOptions; readonly adapterOptions?: Record; readonly adapterMetadata?: Record; readonly adapters?: readonly NativeImporterAdapter[]; readonly adapterResolver?: (source: NativeProjectSourceInput, adapters: readonly NativeImporterAdapter[]) => NativeImporterAdapter | undefined; readonly sources: readonly NativeProjectSourceInput[]; } export type NativeProjectSymbolGraphRemainingField = string; export interface NativeProjectSymbolGraphFileHashRecord { readonly id: string; readonly documentId: string; readonly sourcePath?: string; readonly language?: FrontierSourceLanguage | string; readonly sourceHash: string; readonly algorithm?: string; readonly value: string; readonly factId?: string; } export interface NativeProjectSymbolGraphModuleEdgeRecord { readonly id: string; readonly sourceDocumentId: string; readonly targetSymbolId: string; readonly predicate: 'imports' | 'exports' | string; readonly edgeKind?: 'import' | 'export' | 're-export' | string; readonly sourcePath?: string; readonly sourceHash?: string; readonly moduleSpecifier?: string; readonly resolvedModulePath?: string; readonly targetDocumentId?: string; readonly resolvedTargetSymbolId?: string; readonly reExportResolved?: boolean; readonly reExportResolutionKind?: 'export-star' | 're-export-identity' | string; readonly reExportIdentityId?: string; readonly reExportRelationId?: string; readonly reExportSourcePath?: string; readonly reExportModuleSpecifier?: string; readonly reExportTargetSourcePath?: string; readonly reExportTargetDocumentId?: string; readonly resolutionKind?: 'relative-source' | 'relative-missing' | 'alias-source' | 'alias-missing' | 'path-alias-source' | 'path-alias-missing' | 'base-url-source' | 'base-url-missing' | 'package-source' | 'package-missing' | 'package-external' | 'package-import-source' | 'package-import-missing' | 'package-import-external' | string; readonly resolutionPathVariant?: 'exact' | 'extension-substitution' | 'extensionless' | 'index' | string; readonly packageName?: string; readonly packageSubpath?: string; readonly packageExportKey?: string; readonly packageExportCondition?: string; readonly packageExportTarget?: string; readonly packageRuntimeCondition?: 'import' | 'require' | string; readonly packageRuntimeConditionEvidenceSource?: 'edge-kind' | 'source-extension' | 'package-type' | 'conflict' | string; readonly packageRuntimeConditionEdgeKind?: string; readonly packageRuntimeConditionCandidates?: readonly string[]; readonly packageRuntimeConditionReasonCode?: string; readonly packageEnvironmentCondition?: string; readonly packageEnvironmentConditionEvidenceSource?: 'edge-metadata' | 'module-resolution' | string; readonly packageEnvironmentConditionCandidates?: readonly string[]; readonly packageEnvironmentConditionReasonCode?: string; readonly packageType?: 'module' | 'commonjs' | string; readonly packageWorkspaceRootAmbiguous?: boolean; readonly packageWorkspaceRoots?: readonly string[]; readonly packageResolutionReasonCode?: string; readonly packageImportKey?: string; readonly packageImportCondition?: string; readonly packageImportTarget?: string; readonly importKind?: string; readonly commonJs?: boolean; readonly interopHelper?: string; readonly dynamicImport?: boolean; readonly dynamicImportSpecifierKind?: 'literal' | 'identifier' | 'template' | 'member' | 'call' | 'binary' | 'conditional' | string; readonly dynamicImportExpressionText?: string; readonly dynamicImportExpressionHash?: string; readonly dynamicImportStaticSpecifierEvidence?: boolean; readonly dynamicImportRuntimeResolutionClaim?: false; readonly dynamicImportResolutionProofRequired?: boolean; readonly hostDependency?: boolean; readonly hostDependencyKind?: 'import-meta-url' | string; readonly hostDependencyBase?: 'import.meta.url' | string; readonly hostDependencyExpressionText?: string; readonly hostDependencyExpressionHash?: string; readonly hostDependencyStaticSpecifierEvidence?: boolean; readonly hostDependencyRuntimeResolutionClaim?: false; readonly hostDependencyResolutionProofRequired?: boolean; readonly hasImportAttributes?: boolean; readonly importAttributeCount?: number; readonly importAttributeKeys?: readonly string[]; readonly importAttributeHash?: string; readonly importAttributes?: readonly { readonly key: string; readonly value: string }[]; readonly exportKind?: string; readonly importedName?: string; readonly exportedName?: string; readonly localName?: string; readonly namespace?: string; readonly exportStar?: boolean; readonly isTypeOnly?: boolean; readonly isReExport?: boolean; readonly publicContract?: boolean; readonly evidenceIds?: readonly string[]; } export interface NativeProjectSymbolGraphReExportIdentityRecord { readonly kind?: 'frontier.lang.reExportIdentity' | string; readonly version?: 1; readonly id: string; readonly sourceDocumentId?: string; readonly sourcePath?: string; readonly sourceHash?: string; readonly moduleSpecifier?: string; readonly hasImportAttributes?: boolean; readonly importAttributeCount?: number; readonly importAttributeKeys?: readonly string[]; readonly importAttributeHash?: string; readonly importAttributes?: readonly { readonly key: string; readonly value: string }[]; readonly exportedName?: string; readonly importedName?: string; readonly localName?: string; readonly namespace?: string; readonly isTypeOnly?: boolean; readonly isExportStar?: boolean; readonly symbolId?: string; readonly originSymbolId?: string; readonly exportedSymbolId?: string; readonly localSymbolId?: string; readonly relationId?: string; readonly ownershipRegionId?: string; readonly ownershipRegionKey?: string; readonly publicContract?: boolean; readonly factId?: string; } export interface NativeProjectSymbolGraphPublicContractRegionRecord { readonly id: string; readonly key?: string; readonly regionKind?: string; readonly granularity?: string; readonly language?: FrontierSourceLanguage | string; readonly documentId?: string; readonly sourcePath?: string; readonly sourceHash?: string; readonly symbolId?: string; readonly symbolName?: string; readonly symbolKind?: string; readonly apiSurfaceKind?: string; readonly signatureHash?: string; readonly contractHash?: string; readonly nativeAstNodeId?: string; readonly sourceSpan?: SourceSpan; readonly precision?: string; readonly publicContract?: boolean; readonly exportedName?: string; readonly moduleSpecifier?: string; readonly edgeKind?: string; readonly factId?: string; } export interface NativeProjectSymbolGraphSummary { readonly kind: 'frontier.lang.projectSymbolGraph'; readonly version: 1; readonly projectRoot?: string; readonly sourceCount: number; readonly documentCount: number; readonly symbolCount: number; readonly occurrenceCount: number; readonly relationCount: number; readonly factCount: number; readonly fileHashes: readonly NativeProjectSymbolGraphFileHashRecord[]; readonly sourceFileRecords: readonly NativeProjectSymbolGraphSourceFileRecord[]; readonly sourceSpanRecords: readonly NativeProjectSymbolGraphSourceSpanRecord[]; readonly importEdges: readonly NativeProjectSymbolGraphModuleEdgeRecord[]; readonly exportEdges: readonly NativeProjectSymbolGraphModuleEdgeRecord[]; readonly reExportIdentities: readonly NativeProjectSymbolGraphReExportIdentityRecord[]; readonly publicContractRegions: readonly NativeProjectSymbolGraphPublicContractRegionRecord[]; readonly moduleDeclarationRecords: readonly NativeProjectSymbolGraphModuleDeclarationRecord[]; readonly exportAssignmentRecords: readonly NativeProjectSymbolGraphExportAssignmentRecord[]; readonly compilerSymbolRecords: readonly NativeProjectSymbolGraphCompilerSymbolRecord[]; readonly compilerTypeRecords: readonly NativeProjectSymbolGraphCompilerTypeRecord[]; readonly runtimeRegionRecords: readonly NativeProjectSymbolGraphRuntimeRegionRecord[]; readonly scopeBindingRecords: readonly NativeProjectSymbolGraphScopeBindingRecord[]; readonly scopeReferenceRecords: readonly NativeProjectSymbolGraphScopeReferenceRecord[]; readonly jsxElementRecords: readonly NativeProjectSymbolGraphJsxElementRecord[]; readonly jsxPropRecords: readonly NativeProjectSymbolGraphJsxPropRecord[]; readonly cssModuleImportBindings: readonly NativeProjectSymbolGraphCssModuleImportBindingRecord[]; readonly cssModuleUseSites: readonly NativeProjectSymbolGraphCssModuleUseSiteRecord[]; readonly cssModuleUseSiteBlockers: readonly NativeProjectSymbolGraphCssModuleUseSiteBlockerRecord[]; readonly cssModuleUseSiteGraphs: readonly NativeProjectSymbolGraphCssModuleUseSiteGraphRecord[]; readonly remainingFields: readonly NativeProjectSymbolGraphRemainingField[]; } export interface NativeProjectSourcePreservationSummary { readonly total: number; readonly exactSourceAvailable: number; readonly sourceBytes: number; readonly tokens: number; readonly trivia: number; readonly directives: number; readonly truncated: boolean; readonly ids: readonly string[]; } export interface NativeProjectImportResultMetadata extends Record { readonly sourceCount?: number; readonly sourcePaths?: readonly string[]; readonly importResultContract?: NativeImportResultContract; readonly projectAdmission?: NativeProjectImportAdmission; readonly semanticMergeAdmission?: NativeProjectImportAdmission; readonly nativeImportLossSummary?: NativeImportLossSummary; readonly sourcePreservationSummary?: NativeProjectSourcePreservationSummary; readonly semanticMergeReadiness?: SemanticMergeReadiness; readonly readinessReasons?: readonly string[]; readonly regionSummary?: NativeImportRegionSummary; readonly sourceMapSummary?: NativeImportSourceMapSummary; readonly adapterCoverageSummary?: NativeImportAdapterCoverageContract; readonly projectSymbolGraph?: NativeProjectSymbolGraphSummary; } export interface NativeProjectImportResult { readonly kind: 'frontier.lang.projectImportResult'; readonly version: 1; readonly id: string; readonly language: FrontierSourceLanguage | 'mixed'; readonly projectRoot?: string; readonly imports: readonly NativeSourceImportResult[]; readonly document: FrontierLangDocument; readonly patch: SemanticPatchBundle; readonly nativeSources: readonly NativeSourceNode[]; readonly semanticIndex?: SemanticIndexRecord; readonly universalAst: FrontierUniversalAstEnvelope; readonly sourceMaps: readonly SourceMapRecord[]; readonly losses: readonly NativeAstLossRecord[]; readonly evidence: readonly EvidenceRecord[]; readonly mergeCandidates: readonly SemanticMergeCandidateRecord[]; readonly projectSymbolGraph?: NativeProjectSymbolGraphSummary; readonly metadata?: NativeProjectImportResultMetadata; } export type NativeSourceProjectionMode = 'preserved-source' | 'native-source-stubs'; export interface ProjectNativeImportToSourceOptions { readonly id?: string; readonly language?: FrontierSourceLanguage | string; readonly sourcePath?: string; readonly expectedSourceHash?: string; readonly sourceText?: string; readonly preservedSourceText?: string; readonly exactSourceText?: string; readonly sourceHash?: string; readonly verifySourceHash?: boolean; readonly preferPreservedSource?: boolean; readonly stubBanner?: string | false; readonly evidenceId?: string; readonly parser?: string; readonly semanticStatus?: string; readonly nativeSource?: NativeSourceNode; readonly nativeAst?: NativeAstRecord; readonly semanticIndex?: SemanticIndexRecord; readonly metadata?: Record; } export interface NativeSourceProjectionDeclaration { readonly name: string; readonly kind: string; readonly symbolId?: string; readonly nativeAstNodeId?: string; readonly sourceSpan?: SourceSpan; readonly ownershipRegionId?: string; readonly metadata?: Record; } export interface NativeSourceProjectionResult { readonly kind: 'frontier.lang.nativeSourceProjection'; readonly version: 1; readonly id: string; readonly language: FrontierSourceLanguage | string; readonly sourcePath?: string; readonly sourceHash?: string; readonly mode: NativeSourceProjectionMode; readonly sourceText: string; readonly outputHash: string; readonly declarations: readonly NativeSourceProjectionDeclaration[]; readonly losses: readonly NativeAstLossRecord[]; readonly lossSummary: NativeImportLossSummary; readonly readiness: NativeImportReadinessClassification; readonly evidence: readonly EvidenceRecord[]; readonly metadata: Record; } export type NativeSourceCompileOutputMode = NativeSourceProjectionMode | 'target-stubs' | 'target-adapter'; export interface CompileNativeSourceOptions extends ProjectNativeImportToSourceOptions { readonly target?: FrontierCompileTarget | string; readonly adapters?: readonly NativeImporterAdapter[]; readonly targetAdapters?: readonly NativeTargetProjectionAdapter[]; readonly targetAdapter?: NativeTargetProjectionAdapter | string; readonly targetAdapterResolver?: ( input: NativeTargetProjectionAdapterResolverInput, adapters: readonly NativeTargetProjectionAdapter[] ) => NativeTargetProjectionAdapter | undefined; readonly targetAdapterOptions?: Record; readonly targetAdapterMetadata?: Record; readonly languages?: readonly NativeImportLanguageProfile[]; readonly generatedAt?: number; readonly emitOnBlocked?: boolean; readonly emitSourceMap?: boolean; readonly targetPath?: string; readonly targetHash?: string; readonly sourceMapId?: string; readonly projectionId?: string; readonly projectionEvidenceId?: string; readonly compileEvidenceId?: string; readonly evidence?: readonly EvidenceRecord[]; readonly losses?: readonly NativeAstLossRecord[]; } export interface NativeSourceCompileResult { readonly kind: 'frontier.lang.nativeSourceCompileResult'; readonly version: 1; readonly id: string; readonly ok: boolean; readonly target: FrontierCompileTarget | string; readonly language: FrontierSourceLanguage | string; readonly sourcePath?: string; readonly output: string; readonly outputHash: string; readonly outputMode: NativeSourceCompileOutputMode; readonly sourceMap?: SourceMapRecord; readonly sourceMaps: readonly SourceMapRecord[]; readonly importResult: NativeSourceImportResult; readonly projection: NativeSourceProjectionResult; readonly targetProjection?: NativeTargetProjectionResult; readonly targetCoverage: ProjectionTargetCoverageEntry; readonly projectionMatrix: ProjectionTargetLossMatrix; readonly losses: readonly NativeAstLossRecord[]; readonly lossSummary: NativeImportLossSummary; readonly readiness: NativeImportReadinessClassification; readonly evidence: readonly EvidenceRecord[]; readonly metadata: Record; }