import { WebpiecesRulesConfig, BranchStateGuardConfig } from '@webpieces/rules-config'; import type { Rule } from './types'; /** * The value on a branch-state ENTRY, or the default — for the four guard classes, which are handed * their own typed config and never see the whole file. * * The four used to spell this inline as `this.config.hangTimeoutMinutes ?? DEFAULT_HANG_TIMEOUT_MINUTES`, * which is a fourth copy of the resolution and exactly the shape that let the four DECLARATIONS drift * apart in the first place. One reader, one fallback. */ export declare function hangTimeoutOf(config: BranchStateGuardConfig): number; /** The configured value for a caller that has ALREADY loaded the whole config. */ export declare function branchStateHangTimeout(config: WebpiecesRulesConfig): number; /** * The configured value for a caller that has NOT loaded the config — the hook adapter's two pre-rule * refresh triggers (the webpieces.config.json edit bypass, and the Read fast path). * * Fails back to the default on an unloadable config: warming a cache must never throw on the tool path. */ export declare function branchStateHangTimeoutFor(cwd: string): number; /** Test-only: clears the per-process memo above. */ export declare function resetHangTimeoutCacheForTest(): void; /** * Fire-and-forget the detached refresher when the branch-state policy is loaded and active, so the * cache stays fresh as the AI works. The guard rules themselves also trigger it; this covers the Bash * path so the cache is warm on every command. * * Keyed on `feature-branch-guard` — the rule NAME, not the config key. Any of the four branch-state * classes would do (they share one entry, so they are on or off together); this one is asked because it * is the class whose cache freshness matters on the very next Write. */ export declare function maybeRefreshMainSync(rules: readonly Rule[], workspaceRoot: string, hangTimeoutMinutes: number): void;