import type { ProjectHookDeliveryServices } from '@cleocode/contracts/project-hook-delivery.js'; import { type HookActivation, type ProjectHookContext, type ProjectHookDefinition, type ProjectHookInspection, type ProjectHooksLocalState, type ProjectHooksManifest } from '@cleocode/contracts/project-hooks.js'; export { HooksV1UnreleasedError } from './release-gate.js'; /** Read a hook definition or private record with a hard allocation bound, including racing growth. */ export declare function readProjectHookRecord(path: string, maxBytes: number): Promise; /** * Supply canonical cold-path utilities through the provider delivery contracts port. * @remarks * This keeps provider delivery independent of the SDK at runtime while reusing its bounded reader. * Git receives a snapshot without ambient repository overrides; the process environment is unchanged. * @returns The bounded reader and sanitized Git discovery environment for one delivery invocation. * @example * ```typescript * const services = createProjectHookDeliveryServices(); * const canReadConfiguration = typeof services.readTextFile === 'function'; * ``` */ export declare function createProjectHookDeliveryServices(): ProjectHookDeliveryServices; /** Resolve checkout and hook paths through Git without reading CLEO stores. */ export declare function resolveProjectHookContext(cwd: string): ProjectHookContext; /** Resolve a real path inside this checkout, refusing symlink escapes. */ export declare function resolveProjectHookFile(root: string, file: string): Promise; /** Read a bounded tracked definition and reject malformed or duplicate entries. */ export declare function readProjectHooksManifest(context: ProjectHookContext): Promise; /** Resolve a shell-free executable; project executable paths must remain inside checkout. */ export declare function resolveProjectHookExecutable(root: string, executable: string): Promise; /** A project-relative hook input could not be hashed, so its approval no longer holds (T13742). */ export declare class HookInputUnavailableError extends Error { readonly input: string; /** * @param input - Checkout-relative path of the unavailable input. * @param cause - The failure; its `HOOK_*` code, when present, is kept as the message. */ constructor(input: string, cause: Error | undefined); } /** * Digest approved bindings so a corrupted activation record is detectable (T13742). * @param bindings - Approved bindings by hook ID. * @returns Hex SHA-256 of their serialization. */ export declare function hookBindingsDigest(bindings: NonNullable): string; /** Compute the executable inputs bound by explicit activation. */ export declare function computeHookActivation(context: ProjectHookContext, manifest: ProjectHooksManifest, deadline?: number, signal?: AbortSignal): Promise; /** Resolve a private receipt path and reject redirected state directories or files. */ export declare function resolveProjectHookStateFile(context: ProjectHookContext, name: string): Promise; /** Read machine-local feature state; no record means disabled. */ export declare function readProjectHooksLocalState(context: ProjectHookContext): Promise; /** Check that the explicit local approval still matches all declared code inputs. */ export declare function inspectProjectHooks(cwd: string, deadline?: number, signal?: AbortSignal): Promise; /** Explicitly activate the present definitions; does not install or grant harness trust. */ export declare function activateProjectHooks(cwd: string): Promise; /** Disable machine-local execution without modifying project or native harness configuration. */ export declare function disableProjectHooks(cwd: string): Promise; /** Match a project's binding without treating shell command text as a Git operation. */ export declare function matchesProjectHook(hook: Pick, source: string, event: string): boolean; //# sourceMappingURL=project-state.d.ts.map