declare const SERVICE_NAME = "opensip-cli"; export interface ProfileArtifactLabels { readonly service: typeof SERVICE_NAME; readonly runId: string; readonly command: string; } /** Small, content-free description of one local CPU-profile artifact pair. */ export interface ProfileArtifactMetadata { readonly directory: string; readonly containmentRoot: string; readonly profilePath: string; readonly labelsPath: string; readonly labels: ProfileArtifactLabels; readonly startedAt: string; readonly status: 'reserved' | 'complete'; readonly completedAt?: string; } export interface CreateProfileArtifactIndexInput { readonly baseDir: string; /** Existing trusted ancestor beneath which directory links are rejected. */ readonly containmentRoot?: string; readonly command?: string; readonly runId?: string; /** Injectable for deterministic tests. */ readonly startedAt?: Date; /** Injectable for deterministic tests. */ readonly processId?: number; /** Injectable for deterministic collision tests. */ readonly uniqueSuffix?: string; } /** * Construct collision-resistant artifact paths beneath exactly one caller-selected * directory. Command/run labels never become path components without slugging and * bounding first; the original bounded values live only in the JSON sidecar. * * @throws {Error} When the directory is empty, escapes containment, or path construction fails. * @throws {RangeError} When processId/startedAt inputs are invalid. */ export declare function createProfileArtifactIndex(input: CreateProfileArtifactIndexInput): ProfileArtifactMetadata; /** Reserve the labels sidecar without following/overwriting an existing path. */ export declare function writeProfileArtifactLabels(metadata: ProfileArtifactMetadata): void; /** * Atomically publish the CPU profile and only then return complete metadata. * * @throws {Error} When metadata fails its directory binding or the temp path escapes. * @throws {TypeError} When `profile` is not JSON-serializable. * @throws {RangeError} When `completedAt` is not a valid Date. */ export declare function writeCpuProfileArtifact(metadata: ProfileArtifactMetadata, profile: unknown, completedAt?: Date): ProfileArtifactMetadata; /** Remove only the reserved labels sidecar after start/stop failed. */ export declare function discardProfileArtifactLabels(metadata: ProfileArtifactMetadata): void; /** Remove exactly one indexed pair during explicit best-effort cleanup. */ export declare function discardProfileArtifacts(metadata: ProfileArtifactMetadata): void; export {}; //# sourceMappingURL=profile-artifact-index.d.ts.map