/**
 * `Skill.requires:` AND-semantic precondition evaluator (T-ASC, ASC.2).
 *
 * Slots into the dispatcher between `matchesEvent` (per-skill activation
 * filter) and the rule walk. AND-semantics: every entry must hold; empty
 * array trivially holds (back-compat with every existing skill).
 *
 * Precondition kinds (discriminated-union by `kind`):
 *   automation_mode_on  — stat `<home>/sessions/<id>/automation.flag`
 *   active_task_present — stat `<home>/sessions/<id>/active-task.json`
 * (The former `chain_stage` precondition was removed with chain_state — a pack
 *  now gates on lifecycle state directly via the `read_fsm_state` primitive in
 *  a rule `if:`. See T-WORKFLOW-AS-PACK-FSM.)
 *
 * Fail-open in the engaged direction (T-ASC L5 / L6 lock): any stat error
 * OTHER than ENOENT (EACCES, EPERM, EIO, EROFS, …) ⇒ assume engaged, return
 * true. Wrong direction would silently disable every personal-pack skill on
 * a `chmod 000 ~/.opensquid` event. The probe's contract: TRUE (= present /
 * engaged) is the default for uncertainty.
 *
 * Per-fire cache (L6): the dispatcher constructs ONE `RequiresCache` per
 * `dispatchEvent` call and threads it to every `skillRequiresHold` invocation
 * across all loaded skills. N skills sharing `automation_mode_on` stat the
 * flag ONCE per fire. The cache is per-CALL, NEVER module-level — hook bins
 * are short-lived processes; long-lived state would cross process boundaries
 * meaninglessly.
 *
 * Imports from: node:fs/promises, zod, ./automation_state.js, ./paths.js.
 * Imported by: src/packs/schemas/skill.ts (the Skill schema's `requires:`
 *   field type), src/runtime/types.ts (the runtime type mirror),
 *   src/runtime/hooks/dispatch.ts (the dispatcher integration point).
 */
import { z } from 'zod';
/**
 * SkillRequires variant. Discriminated by `kind`. Adding a new precondition
 * kind means adding a variant here AND a branch in `skillRequiresHold`'s
 * switch AND a getter on `RequiresCache`. Exhaustiveness is enforced by
 * TypeScript narrowing in the switch.
 */
export declare const SkillRequires: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
    kind: z.ZodLiteral<"automation_mode_on">;
}, "strict", z.ZodTypeAny, {
    kind: "automation_mode_on";
}, {
    kind: "automation_mode_on";
}>, z.ZodObject<{
    kind: z.ZodLiteral<"active_task_present">;
}, "strict", z.ZodTypeAny, {
    kind: "active_task_present";
}, {
    kind: "active_task_present";
}>]>;
export type SkillRequires = z.infer<typeof SkillRequires>;
/**
 * Per-fire cache. The dispatcher constructs ONE instance per `dispatchEvent`
 * call. One map per precondition kind, keyed by sessionId (each precondition's
 * single relevant input), so N skills sharing a kind probe disk ONCE per fire.
 *
 * Strictly avoid making this a module-level cache: hook bins are short-lived
 * processes (one per host event) and per-call caching is the right scope.
 */
export declare class RequiresCache {
    private readonly automation;
    private readonly activeTask;
    automationModeOn(sessionId: string): Promise<boolean>;
    activeTaskPresent(sessionId: string): Promise<boolean>;
}
/**
 * AND-evaluate every precondition. Empty array → trivially true (back-compat
 * with every Phase 1+ pack). Short-circuits on first false: skills that
 * declare multiple preconditions don't pay for later checks once one fails.
 *
 * The exhaustive switch keeps TypeScript narrowing — adding a new variant
 * to `SkillRequires` without adding a case here is a typecheck error.
 */
export declare function skillRequiresHold(preconds: readonly SkillRequires[], sessionId: string, cache: RequiresCache): Promise<boolean>;
//# sourceMappingURL=skill_requires.d.ts.map