import type { Artifact } from "./types/artifact.js"; import type { KnownAssetClassificationEvidence } from "./types/known-classification.js"; import type { Diagnostic } from "./types/diagnostics.js"; import type { ScanConfig } from "./types/configuration.js"; import type { RepositoryPathState } from "./repository-paths.js"; import { type ReservedSkillSupportDirectory, type CanonicalSkillEntrypointPath, type SkillRoot } from "./skill-path-contract.js"; export type RepositorySkillPath = { kind: "entrypoint"; currentPath: string; root: SkillRoot; skillDirectory: string; skillName: string; domainPath: string[]; relativeToSkillDirectory: string; entrypoint: CanonicalSkillEntrypointPath; } | { kind: "support"; currentPath: string; root: SkillRoot; skillDirectory: string; skillName: string; domainPath: string[]; relativeToSkillDirectory: string; supportDirectory: ReservedSkillSupportDirectory; } | { kind: "reserved-root"; currentPath: string; root: SkillRoot; supportDirectory: ReservedSkillSupportDirectory; }; export interface RepositoryClassificationPathOptions { /** Explicit repository root supplied by a caller that already resolved it. */ repositoryRoot?: string; /** Base directory used only to resolve a relative target path. */ cwd?: string; /** Internal fixture seam; production callers leave marker traversal unbounded. */ markerSearchBoundary?: string; } export type RepositoryClassificationPathResolution = { state: "resolved"; source: "explicit" | "marker" | "structural"; root: string; relativePath: string; absolutePath: string; marker?: ".git" | "renma.config.jsonc" | "renma.config.json"; } | { state: "unresolved"; reasonCode: "repository-boundary-unresolved" | "repository-boundary-ambiguous"; reason: string; absolutePath: string; candidateRoots: string[]; }; /** Classify canonical entrypoints and reserved support paths at explicit Skill roots. */ export declare function classifyRepositorySkillPath(relativePath: string): RepositorySkillPath | undefined; /** Resolve the logical directory shared by every supported Skill path form. */ export declare function logicalSkillDirectory(relativePath: string): string | undefined; /** Classify a repository-relative Skill entrypoint only at an explicit root. */ export declare function classifyRepositorySkillEntrypointPath(relativePath: string): CanonicalSkillEntrypointPath | undefined; /** Classify an absolute Skill path only when it contains one unambiguous root. */ export declare function classifyAbsoluteSkillEntrypointPath(absolutePath: string): CanonicalSkillEntrypointPath | undefined; /** Normalize a repository-relative Skill path without allowing root escape. */ export declare function normalizeRepositorySkillRelativePath(filePath: string): string | undefined; /** * Normalize a repository-relative asset path. * * All parent-directory (`..`) segments are rejected rather than resolved, * including segments that would remain inside the repository. */ export declare function normalizeAssetRepositoryRelativePath(filePath: string): string | undefined; /** Resolve one repository boundary without treating cwd containment as proof. */ export declare function repositoryClassificationPath(filePath: string, options?: RepositoryClassificationPathOptions | string): RepositoryClassificationPathResolution; /** * Classify one normalized repository path using the documented precedence. * Metadata may refine a Context Asset to Context Lens without changing the * path rule that established its repository boundary. */ export declare function classifyAssetPath(relativePath: string, options?: { metadataType?: string; }): KnownAssetClassificationEvidence; /** Discover and read scan artifacts according to the provided scan configuration. */ export declare function discoverArtifacts(root: string, config: ScanConfig): Promise<{ artifacts: Artifact[]; diagnostics: Diagnostic[]; discoveredPaths: ReadonlySet; skippedPathStates: ReadonlyMap; blockedTraversalPaths: ReadonlySet; traversedDirectoryPaths: ReadonlySet; excludedSupportDirectoryPaths: ReadonlySet; }>; export interface ExplicitArtifactInspectionResult { artifacts: Artifact[]; diagnostics: Diagnostic[]; skippedPathStates: ReadonlyMap; blockedTraversalPaths: ReadonlySet; } /** Inspect only statically referenced repository files, without recursive discovery. */ export declare function inspectExplicitRepositoryArtifacts(root: string, config: ScanConfig, candidatePaths: readonly string[]): Promise; /** Return whether a path has an intentionally opaque built-in asset type. */ export declare function isOpaqueArtifactPath(relativePath: string): boolean; export declare function isExcluded(relativePath: string, excludes: string[]): boolean; export declare function repositoryPathDepth(relativePath: string): number;