import { A as RuleSpecializedHandlers, B as ModelRequirement, C as RuleHandlers, G as ProviderDefinition, H as ResolvedModel, J as RunnerStatsConfig, K as ProviderType, M as StopGateConfig, N as StopGateTarget, O as RuleRegistry, P as Target, S as RuleDefinition, U as ResolvedProvider, V as ResolveModelOptions, W as ModelSize, X as SetupModelDefinition, Y as SetupConfig, _ as ProjectTarget, a as AlintLinterOptions, b as RuleConfigEntry, c as DiagnosticLocation, d as IgnoreConfig, f as IntegrationsConfig, g as ProjectFileEntry, h as ProcessorDefinition, i as AlintConfigItem, j as RuleWithHandler, k as RuleSeverity, l as DirectoryTarget, m as PluginDefinition, n as AlintConfigExtends, o as Awaitable, p as LanguageDefinition, q as RunnerConfig, r as AlintConfigInput, s as DiagnosticDescriptor, t as AlintConfig, u as EnabledRule, v as ProjectTargetEntry, w as RuleInferenceUsageRecord, x as RuleContext, y as RuleCacheConfig } from "./types-Cm5Z7Fll.mjs"; import { C as SourceTarget, D as SourceTargetOrigin, E as SourceTargetOfKind, O as SourceText, S as SourceRuntime, T as SourceTargetMetadata, _ as SourceLocation, a as FunctionInfo, b as SourcePosition, c as LineRange, d as ProcessedSource, f as ProcessedSourceOrigin, g as SourceFile, h as SourceExtractOptions, i as FileTarget, l as PlannedSourceTarget, m as ProcessorPostprocessContext, n as CallSite, o as FunctionTarget, p as ProcessorContext, r as ClassTarget, s as LanguageContext, t as BaseSourceFile, u as PlannedSourceTargetOfKind, v as SourceMetadataObject, w as SourceTargetKind, x as SourceRange, y as SourceMetadataValue } from "./types-DM4idR4w.mjs"; import { n as definePlugin, r as defineRule, t as defineConfig } from "./define-DO36VJ4W.mjs"; //#region src/config/config-array.d.ts interface EffectiveAlintConfig { agent?: AlintConfigItem['agent']; language?: string; languageOptions: Record; linterOptions: Record; plugins: Record; processor?: AlintConfigItem['processor']; rules: Record; runner?: AlintConfigItem['runner']; settings: Record; } interface ResolveConfigOptions { cwd: string; } interface ResolveConfigResult { config: EffectiveAlintConfig; ignored: boolean; matched: AlintConfigItem[]; skipped: Array<{ item: AlintConfigItem; reason: string; }>; } declare function hasDiscoveryFilePatterns(input: AlintConfig): boolean; declare function matchesDiscoveryFile(filePath: string, input: AlintConfig, options: ResolveConfigOptions): boolean; declare function normalizeConfig(input: readonly AlintConfigInput[]): AlintConfigItem[]; declare function resolveConfigForDirectory(directoryPath: string, input: AlintConfig, options: ResolveConfigOptions): ResolveConfigResult; declare function resolveConfigForFile(filePath: string, input: AlintConfig, options: ResolveConfigOptions): ResolveConfigResult; declare function resolveConfigForProject(projectPath: string, input: AlintConfig, options: ResolveConfigOptions): ResolveConfigResult; //#endregion //#region src/config/stop-gate.d.ts interface ResolvedStopGateConfig { enabled: boolean; target: StopGateTarget; timeoutMs: number; } declare const maximumStopGateTimeoutMs: number; declare const defaultStopGateConfig: Readonly; declare function resolveStopGateConfig(config: AlintConfig, cwd: string): ResolvedStopGateConfig; //#endregion //#region src/core/hash.d.ts declare function stableHash(value: unknown): string; //#endregion //#region src/core/languages/registry.d.ts interface LanguageRegistry { byExtension: Map; languages: Map; } declare function registerLanguage(registry: LanguageRegistry, language: LanguageDefinition): void; //#endregion //#region src/core/languages/resolve.d.ts interface ResolveLanguageOptions { language?: string; processedLanguage?: string; } declare function resolveLanguage(file: SourceFile, registry: LanguageRegistry, options: ResolveLanguageOptions): LanguageDefinition; //#endregion //#region src/core/languages/index.d.ts declare function createBuiltInLanguageRegistry(): LanguageRegistry; //#endregion //#region src/core/types.d.ts interface AlintFailureCause { code?: string; message: string; } interface AlintFileFailure { file: { index: number; path: string; }; kind: 'extract' | 'read'; message: string; } interface AlintRuleFailure { causes: AlintFailureCause[]; job: ProgressJobRef; kind: 'cache-replay' | 'handler' | 'source-changed' | 'timeout'; message: string; } type AlintRunFailure = AlintFileFailure | AlintRuleFailure; interface Diagnostic { cached?: boolean; evidence?: unknown; filePath: string; loc?: DiagnosticLocation; message: string; model?: { providerId: string; requested?: string; resolvedId: string; }; ruleId: string; severity: 'error' | 'warn'; } interface DiagnosticProgressPayload { diagnostic: Diagnostic; job: ProgressJobRef; progress: ProgressSnapshot; } interface ExecutionCounts { cached: number; cancelled: number; completed: number; failed: number; planned: number; queued: number; running: number; /** Rules left unexecuted because they missed the cache under {@link RunOptions.cacheOnly}. */ skipped: number; } interface ExecutionProgressPayload { progress: ProgressSnapshot; } interface FileReadyPayload extends ExecutionProgressPayload { fileIndex: number; inputPath: string; jobsAdded: number; } type InferenceUsageRecord = Omit & { ruleId: string; }; interface JobEndPayload extends JobStartPayload { cache: 'hit' | 'miss'; endedAt?: number; failure?: AlintRuleFailure; state: 'cached' | 'cancelled' | 'completed' | 'failed' | 'skipped'; } interface JobQueuedPayload { job: ProgressJobRef; progress: ProgressSnapshot; } interface JobRetryPayload { attempt: number; job: ProgressJobRef; maxAttempts: number; progress: ProgressSnapshot; startedAt?: number; } interface JobStartPayload { job: ProgressJobRef; progress: ProgressSnapshot; startedAt?: number; } interface PrepareEndPayload extends PrepareStartPayload { endedAt?: number; filesTotal: number; } interface PrepareStartPayload { startedAt?: number; } interface ProgressJobRef { id: string; index: number; inputPath: string; ruleId: string; target: { identity: string; kind: ProgressTargetKind; name?: string; }; } interface ProgressReporter { onDiagnostic?: (payload: DiagnosticProgressPayload) => void; onExecuteEnd?: (payload: ExecutionProgressPayload & { endedAt?: number; }) => void; onExecuteStart?: (payload: ExecutionProgressPayload & { startedAt?: number; }) => void; onFileReady?: (payload: FileReadyPayload) => void; onJobEnd?: (payload: JobEndPayload) => void; onJobQueued?: (payload: JobQueuedPayload) => void; onJobRetry?: (payload: JobRetryPayload) => void; onJobStart?: (payload: JobStartPayload) => void; onPlanningEnd?: (payload: ExecutionProgressPayload) => void; onPrepareEnd?: (payload: PrepareEndPayload) => void; onPrepareStart?: (payload: PrepareStartPayload) => void; onRunEnd?: (payload: RunEndPayload) => void; onUsage?: (payload: UsageProgressPayload) => void; } interface ProgressSnapshot { execution: ExecutionCounts; filesPlanned: number; filesTotal: number; jobsCompleted: number; jobsStarted: number; jobsTotal: number; planningComplete: boolean; } type ProgressTargetKind = SourceTargetKind; interface RunEndPayload { diagnostics: Diagnostic[]; endedAt?: number; execution: ExecutionCounts; progress: ProgressSnapshot; startedAt?: number; usage: RunUsage; } type RunExecution = ExecutionCounts; type RunnerOptions = RunnerConfig; interface RunOptions { /** * Return only diagnostics that are already cached, without calling any model. * Rules that miss the cache are skipped, and the cache remains read-only. */ cacheOnly?: boolean; config?: AlintConfig; cwd?: string; defaultModel?: string; directories?: string[]; files?: string[]; modelOverride?: string; outputLanguage?: string; progress?: ProgressReporter; /** * Run project-scoped rules (`onTargetProject` and the project pass of `onTargetWith`). * Defaults to `true`. Pass `false` for runs that target partial subsets of a project. */ projectTargets?: boolean; runner?: RunnerOptions; setupConfig?: SetupConfig; /** * Cancels the run. Aborting stops the engine from starting further rules and cancels the * in-flight model call, so a cancelled run stops spending tokens. * * `runAlint` rejects with {@link AlintAbortError}, which carries the diagnostics gathered * before the abort. Rules that already finished keep their cache entries: cancelling never * throws away work you already paid for. */ signal?: AbortSignal; } interface RunResult { diagnostics: Diagnostic[]; execution: ExecutionCounts; usage: RunUsage; } interface RunUsage { cached?: RunUsageTotals; inputTokens: number; outputTokens: number; records: InferenceUsageRecord[]; totalTokens: number; } interface RunUsageTotals { inputTokens: number; outputTokens: number; records: InferenceUsageRecord[]; totalTokens: number; } interface UsageProgressPayload { job: ProgressJobRef; progress: ProgressSnapshot; record: InferenceUsageRecord; } //#endregion //#region src/core/preparation.d.ts /** * The `ctx.src.extract` a run hands to rules, for parsing files it was never asked to lint, which * an index builder sweeping the workspace needs. * * It resolves each file's OWN config rather than a caller's, because the language a file resolves to * is a config decision and two config groups may register different plugins. It extracts on demand * and holds nothing: source planning releases rich extractor values after compact jobs are admitted, * and a run-wide parse memo here would put that retention back. A caller keeps only what it derives. * * `getSrc` defers reading the runtime because the runtime is built around this closure. It is assigned * before any rule runs, so by the first call it is present. */ declare function createSourceExtractor(cwd: string, config: AlintConfig, getSrc: () => SourceRuntime): SourceRuntime['extract']; //#endregion //#region src/core/run.d.ts declare class AlintRunCancelledError extends Error { readonly result: RunResult; constructor(result: RunResult, cause?: unknown); } /** Cancellation error carrying the partial result gathered before the abort. */ declare class AlintAbortError extends AlintRunCancelledError { constructor(result: RunResult, options?: { cause?: unknown; }); } declare class AlintCachePersistenceError extends Error { readonly result: RunResult; constructor(result: RunResult, cause: unknown); } declare class AlintRunError extends Error { readonly failures: AlintRunFailure[]; readonly result: RunResult; constructor(message: string, result: RunResult, options?: { cause?: unknown; failures?: AlintRunFailure[]; }); } declare function runAlint(options?: RunOptions): Promise; //#endregion //#region src/core/source/identity.d.ts /** A target's identity from its position. */ declare function targetIdentity(kind: SourceTargetKind, name: string | undefined, range: SourceRange): string; /** * Swaps a target's positional identity for its name, where that name is unique among these targets. * * Caches are keyed by identity, so a function that only moved should keep the identity it had. Two * targets sharing a name cannot be told apart by name, so those keep the positional form. * * Run every function and class target through this. Miss it in one language and the same function * gets a different identity depending on which language read it. */ declare function withStableIdentities(targets: readonly SourceTarget[]): SourceTarget[]; //#endregion //#region src/core/source/runtime.d.ts interface SourceRuntimeOptions { /** * Extraction for arbitrary files, injected by the run. * * The runtime cannot do this itself: extraction resolves the file's own config, and importing * config resolution here would point the source module back at the layers built on top of it. * `runAlint` has the config in scope before it builds the runtime, so it passes the closure down. */ extract?: SourceRuntime['extract']; /** * Replaces the complete source read operation, including descriptor validation. The other * members need no override: `getText` and the slicers are pure functions over whatever * `readFile` returned, and `extract` already defaults to a throwing stub outside a run. */ readFile?: SourceRuntime['readFile']; } declare function createSourceFile(path: string, text: string): SourceFile; declare function createSourceRuntime(options?: SourceRuntimeOptions): SourceRuntime; declare function sliceLines(file: SourceFile, range: LineRange): SourceText; declare function sliceRange(file: SourceFile, range: SourceRange): SourceText; declare function withLanguage(file: SourceFile, language: string): SourceFile; //#endregion //#region src/dsl/registry.d.ts type RuleRegistryConfig = Pick & { rules: Record>; }; declare function buildRuleRegistry(config: RuleRegistryConfig): RuleRegistry; //#endregion //#region src/models/benchmark.d.ts interface BenchmarkModelsOptions { onProgress?: (progress: ModelBenchmarkProgress) => void; providerConcurrency?: Readonly>; request?: (request: ModelBenchmarkRequest) => Promise; sampleCount?: number; seed?: number; timeoutMs?: number; } interface ModelBenchmarkActive { modelId: string; modelIndex: number; phase: 'non-repeat' | 'repeat'; providerId: string; sample: number; samples: number; success: ModelBenchmarkResult['success']; warmup: boolean; } interface ModelBenchmarkMeasurement { durationMs: number; firstOutputMs?: number; outputTokens?: number; } interface ModelBenchmarkProgress { active: readonly ModelBenchmarkActive[]; modelsTotal: number; results: readonly (ModelBenchmarkResult | undefined)[]; } interface ModelBenchmarkRequest { model: ResolvedModel; prompt: string; signal: AbortSignal; } interface ModelBenchmarkResult { error?: string; modelId: string; nonRepeatMs?: number; providerId: string; repeatMs?: number; success: { attempted: number; completed: number; }; throughput?: number; } /** * Benchmarks model jobs concurrently within independent provider limits. * * Each model's repeat warm-up, measured repeats, and non-repeats remain serial so concurrent samples cannot * distort that model's cache behavior. Non-repeat prompts put their nonce before the shared corpus. */ declare function benchmarkModels(config: SetupConfig, options?: BenchmarkModelsOptions): Promise; //#endregion //#region src/models/resolve.d.ts declare function resolveModel(registry: SetupConfig, options?: ResolveModelOptions): ResolvedModel; //#endregion export { AlintAbortError, AlintCachePersistenceError, type AlintConfig, type AlintConfigExtends, type AlintConfigInput, type AlintConfigItem, type AlintFailureCause, type AlintFileFailure, type AlintLinterOptions, type AlintRuleFailure, AlintRunCancelledError, AlintRunError, type AlintRunFailure, type Awaitable, type BaseSourceFile, type BenchmarkModelsOptions, type CallSite, type ClassTarget, type Diagnostic, type DiagnosticDescriptor, type DiagnosticLocation, type DiagnosticProgressPayload, type DirectoryTarget, type EffectiveAlintConfig, type EnabledRule, type ExecutionCounts, type ExecutionProgressPayload, type FileReadyPayload, type FileTarget, type FunctionInfo, type FunctionTarget, type IgnoreConfig, type InferenceUsageRecord, type IntegrationsConfig, type JobEndPayload, type JobQueuedPayload, type JobRetryPayload, type JobStartPayload, type LanguageContext, type LanguageDefinition, type LanguageRegistry, type LineRange, type ModelBenchmarkActive, type ModelBenchmarkMeasurement, type ModelBenchmarkProgress, type ModelBenchmarkRequest, type ModelBenchmarkResult, type ModelRequirement, type ModelSize, type PlannedSourceTarget, type PlannedSourceTargetOfKind, type PluginDefinition, type PrepareEndPayload, type PrepareStartPayload, type ProcessedSource, type ProcessedSourceOrigin, type ProcessorContext, type ProcessorDefinition, type ProcessorPostprocessContext, type ProgressJobRef, type ProgressReporter, type ProgressSnapshot, type ProgressTargetKind, type ProjectFileEntry, type ProjectTarget, type ProjectTargetEntry, type ProviderDefinition, type ProviderType, type ResolveConfigResult, type ResolveLanguageOptions, type ResolveModelOptions, type ResolvedModel, type ResolvedProvider, type ResolvedStopGateConfig, type RuleCacheConfig, type RuleConfigEntry, type RuleContext, type RuleDefinition, type RuleHandlers, type RuleInferenceUsageRecord, type RuleRegistry, type RuleSeverity, type RuleSpecializedHandlers, type RuleWithHandler, type RunEndPayload, type RunExecution, type RunOptions, type RunResult, type RunUsage, type RunUsageTotals, type RunnerConfig, type RunnerStatsConfig, type SetupConfig, type SetupModelDefinition, type SourceExtractOptions, type SourceFile, type SourceLocation, type SourceMetadataObject, type SourceMetadataValue, type SourcePosition, type SourceRange, type SourceRuntime, type SourceRuntimeOptions, type SourceTarget, type SourceTargetKind, type SourceTargetMetadata, type SourceTargetOfKind, type SourceTargetOrigin, type SourceText, type StopGateConfig, type StopGateTarget, type Target, type UsageProgressPayload, benchmarkModels, buildRuleRegistry, createBuiltInLanguageRegistry, createSourceExtractor, createSourceFile, createSourceRuntime, defaultStopGateConfig, defineConfig, definePlugin, defineRule, hasDiscoveryFilePatterns, matchesDiscoveryFile, maximumStopGateTimeoutMs, normalizeConfig, registerLanguage, resolveConfigForDirectory, resolveConfigForFile, resolveConfigForProject, resolveLanguage, resolveModel, resolveStopGateConfig, runAlint, sliceLines, sliceRange, stableHash, targetIdentity, withLanguage, withStableIdentities };