import { ProvenanceConfig } from './types'; /** * Validates app-code / area / project codes against a safe character allowlist. * Prevents path-traversal characters from flowing into directory names. * Allowlist: A-Z, 0-9, underscore, hyphen — max 16 characters. */ export declare function validateCode(value: string, label: string): void; /** * Resolves a path and asserts it remains under the given root directory. * Throws on any path that escapes the root via `..` or absolute segments. */ export declare function safePath(root: string, ...parts: string[]): string; /** * Resolve the project code from either DEO id_format or legacy defaultAppCode */ export declare function resolveProjectCode(config: ProvenanceConfig): string; /** * Resolve the area/subproject code */ export declare function resolveAreaCode(config: ProvenanceConfig, override?: string): string; /** * Get the next sequence number for a given project/area, reading both DEO v1 `id` and legacy `decision_id` */ export declare function getNextSequenceNumber(decisionsPath: string, projectCode: string, areaCode: string): string; /** * Get the next risk sequence number for a given area (RA- prefix) */ export declare function getNextRiskSequenceNumber(risksPath: string, appCode: string, area: string): string; /** * Generate a DEO v1 decision ID (7-digit hierarchical format) */ export declare function generateDecisionId(projectCode: string, areaCode: string, sequence: string): string; /** * Generate a risk ID (canonical RA- prefix) */ export declare function generateRiskId(appCode: string, area: string, sequence: string): string; /** * Get the next simple 6-digit sequence number for any artifact type stored * in per-folder structure (PREFIX-XXXXXX/artifact.json or flat *.json) */ export declare function getNextSimpleSequenceNumber(dir: string, prefix: string, idField: string): string; /** * Get artifact files from a directory (per-folder structure only) */ export declare function getArtifactFiles(dir: string, filename: string): string[]; /** * Load provenance config from a directory */ export declare function loadConfig(baseDir: string): ProvenanceConfig | null; /** * Save provenance config */ export declare function saveConfig(baseDir: string, config: ProvenanceConfig): void; /** * Validate DEO v1 decision ID format (both hierarchical and legacy) * Hierarchical: DEC-{2-6}-[{2-6}-]{7digit} * Legacy: DEC-{6digit} */ export declare function validateDecisionId(id: string): boolean; /** * Validate risk ID format */ export declare function validateRiskId(id: string): boolean; /** * Get all decision files in a directory (flat files and per-folder) */ export declare function getDecisionFiles(decisionsPath: string): string[]; /** * Get all risk files in a directory */ export declare function getRiskFiles(risksPath: string): string[]; /** * Format a timestamp as ISO 8601 */ export declare function getCurrentTimestamp(): string; /** * Attempt to resolve the git author email from the repo config */ export declare function resolveGitAuthor(baseDir: string): string | null;