import type { Manifest, SourceDiff } from './types.js';
/** WIKI.md sources 字段定义的 4 个 bucket */
export type SourceCategory = 'code' | 'doc' | 'raw' | 'data';
export interface DiscoveredSource {
    /** Path relative to repoDir, posix-style */
    readonly path: string;
    /** Which sources bucket the file belongs to */
    readonly category: SourceCategory;
    /** sha256 hex; computed lazily by callers (use hashSource) */
    readonly hash?: string;
}
export interface SourcesConfig {
    /** Globs per bucket; absent bucket = empty array */
    readonly code: readonly string[];
    readonly doc: readonly string[];
    readonly raw: readonly string[];
    readonly data: readonly string[];
}
/**
 * 从 WIKI.md 顶部 frontmatter 抽 sources 配置。
 *
 * 容错：
 *   - WIKI.md 不存在 → 返默认（空配置）
 *   - frontmatter 缺失 / sources 字段缺失 → 返默认
 *   - 类型不对（非数组 / 非字符串）→ 跳过该 bucket
 */
export declare function readSourcesConfig(repoDir: string): SourcesConfig;
interface ParsedPattern {
    /** Anchor directory relative to repoDir (no trailing slash) */
    readonly base: string;
    /** Should match recursively? (true if pattern contains ** ) */
    readonly recursive: boolean;
    /** Optional file extension filter (e.g. ".ts"); '' for all files */
    readonly extension: string;
    /** Original pattern (for debug) */
    readonly raw: string;
}
/**
 * Parse a simple glob pattern into base + recursion + extension filter.
 *
 * Examples:
 *   "src/**\/*.ts"  → base=src,  recursive=true,  ext=.ts
 *   "src/**"        → base=src,  recursive=true,  ext=''
 *   "docs/*.md"     → base=docs, recursive=false, ext=.md
 *   "README.md"     → base=.,    recursive=false, ext=.md  (treated as flat single)
 *
 * Unsupported patterns (e.g. with `{}`) are passed through but won't match anything.
 */
export declare function parsePattern(pattern: string): ParsedPattern;
/**
 * Walk filesystem from `repoDir/<base>` and collect files that match the pattern.
 *
 * - Skips dotfiles starting with `.` UNLESS the base itself starts with `.`
 *   (e.g. wiki/.raw/** — user wants those).
 * - Always skips node_modules / .git anywhere in the tree.
 *
 * Returns paths relative to repoDir, posix-normalized.
 */
export declare function expandPattern(repoDir: string, pattern: string): string[];
export interface DiscoverResult {
    /** Discovered sources with hashes */
    readonly sources: readonly DiscoveredSource[];
    /** Patterns that returned 0 files (warning candidates) */
    readonly emptyPatterns: readonly string[];
}
/**
 * Discover all sources from WIKI.md config + hash them.
 *
 * Buckets are merged; if the same path is matched by multiple buckets, the first
 * winning bucket (in code → doc → data → raw order) is used.
 *
 * Caller is responsible for I/O fault tolerance — this throws on individual hash
 * failures only via `tryHashFile` semantics (skip).
 */
export declare function discoverSources(repoDir: string): DiscoverResult;
/**
 * Compute diff between current discovered sources and saved manifest.
 *
 * Wraps diffSources() with a typed input so callers don't have to remember
 * the DiffInputSource shape.
 */
export declare function diffAgainstManifest(sources: readonly DiscoveredSource[], manifest: Manifest): SourceDiff;
export {};
//# sourceMappingURL=sources.d.ts.map