/**
 * AP.1 — mirror the harness task store into opensquid's active-task signal.
 *
 * The whole automation gate-set keys off `active-task.json` (design rules
 * #1/#8/#16). This module is the ONLY place that knows the Claude-Code-specific
 * task-store path — every gate reads opensquid's own `active-task.json`,
 * harness-agnostic (substrate-vs-consumer discipline).
 *
 * WHY mirror the store rather than reconstruct from the tool-call args: a
 * `TaskCreate` PreToolUse payload carries `subject` but NO id (the harness
 * assigns the id in the RESPONSE, which a PreToolUse hook never sees), and a
 * `TaskUpdate(in_progress)` payload carries `taskId` but NO subject — and the
 * two events share no key, so they cannot be correlated. The canonical store
 * `~/.claude/tasks/<session-id>/<task-id>.json` carries `{id, subject, status,
 * metadata}` together; we read it and pick the `in_progress` task.
 *
 * Timing (H4a): `PreToolUse` fires BEFORE the tool executes, so on a status
 * TRANSITION the on-disk file still holds the OLD status. We therefore honor the
 * pending `args` for both directions — the task being moved to `in_progress`
 * becomes active even though disk still says `pending`; the task being
 * `completed`/`deleted` is excluded even though disk still says `in_progress`.
 *
 * Best-effort + fail-open: never throws into the hook (the caller also guards).
 *
 * Imports from: node:fs/promises, node:os, node:path, ../session_state.js.
 * Imported by: src/runtime/hooks/pre-tool-use.ts.
 */
/**
 * T-ATSC L1 (2026-05-29) — mirror re-derives `active-task.json` on EVERY
 * PreToolUse, not only on `TaskCreate`/`TaskUpdate` ticks. Pre-T-ATSC the
 * mirror short-circuited on the harness task tools, leaving a race window
 * where `active-task.json` could stay absent across the whole code phase
 * (root cause of SIC commit fc0801a sailing past the workflow gate). With
 * L1 the mirror reads the harness store on every PreToolUse: the H4a
 * status overlay + AP.7 metadata overlay safely no-op for non-task tools
 * (activatingId / completingId both null, args.metadata undefined → falls
 * through to the on-disk store-derived view). Cost: ~5 ms per call
 * (readdir + N small readFile); benefit: race-class elimination. The
 * write path stays idempotent (writeActiveTask is tmp+rename atomic), so
 * unchanged-state PreToolUse calls cost just the read.
 */
export interface HarnessTask {
    id: string;
    subject: string;
    status: string;
    metadata?: {
        taskId?: string;
        spec?: string;
    };
}
/**
 * Harness task-store directory for a session. `base` is injectable (the mirror
 * passes it in tests); when omitted, an `OPENSQUID_HARNESS_TASKS_DIR` env
 * override wins (lets the Gate B primitive — which has no `base` seam — be
 * tested, and lets a user relocate the store), else the codebase-convention
 * default `join(homedir(), '.claude', 'tasks')`.
 */
export declare const harnessTasksDir: (sessionId: string, base?: string) => string;
/**
 * Read + parse the harness task store for a session. Returns `[]` on an absent
 * dir (no tasks yet) and skips malformed / shape-invalid entries. Never throws.
 */
export declare function readHarnessTasks(sessionId: string, base?: string): Promise<HarnessTask[]>;
/**
 * Mirror the harness in-progress task into opensquid's `active-task.json`.
 * No-op for non-task tools. Writes the signal when a task is active, clears it
 * when none is. Best-effort: resolves without throwing on any I/O failure.
 */
export declare function mirrorActiveTask(sessionId: string, tool: string, args: Record<string, unknown>, base?: string, transcriptPath?: string): Promise<void>;
//# sourceMappingURL=active_task_mirror.d.ts.map