import type { ModuleInstructionEntry, WorkflowModule } from "../contracts/module-contract.js";
import { buildErrorRemediationCatalog } from "./cli-remediation.js";
import type { ModuleActivationReport, ModuleRegistry } from "./module-registry.js";
export type AgentInstructionDegradation = {
    kind: "executable";
} | {
    kind: "module_disabled";
} | {
    kind: "peer_disabled";
    missingPeers: string[];
};
export type AgentInstructionSurfaceRow = {
    commandName: string;
    moduleId: string;
    /** Repo-relative path to the instruction markdown file. */
    instructionPath: string;
    executable: boolean;
    degradation: AgentInstructionDegradation;
    /** When `effectiveConfig` was supplied to the builder and the row is executable: Tier A/B sensitive runs need JSON `policyApproval`. */
    jsonApprovalRequired?: boolean;
    /** Stable operation id when sensitivity is registered (often absent for Tier C). */
    policyOperationId?: string | null;
};
export type ErrorRemediationCatalogPayload = {
    schemaVersion: 1;
    entries: ReturnType<typeof buildErrorRemediationCatalog>;
};
/** Bounded CAE advisory block (**`T865`** / **`.ai/cae/advisory-surfacing.md`**). */
export type AgentInstructionSurfaceCae = {
    schemaVersion: 1;
    advisory: true;
    traceId?: string;
    summary: {
        policyCount: number;
        thinkCount: number;
        doCount: number;
        reviewCount: number;
        shadow: boolean;
    };
    issues: Array<{
        code: string;
        detail?: string;
    }>;
    truncated?: boolean;
    /** Optional diagnostic: trace event count from inline evaluate. */
    traceEventCount?: number;
};
export type AgentInstructionSurfaceCommandCounts = {
    total: number;
    executable: number;
    documentationOnly: number;
};
/** Full instruction catalog — every declared row (token-heavy). */
export type AgentInstructionSurfacePayloadFull = {
    schemaVersion: 1;
    /** Absent or `full` — default machine projection. */
    projection?: "full";
    commands: AgentInstructionSurfaceRow[];
    activationReport: ModuleActivationReport;
    /** Stable `code` values with repo-relative doc/instruction hints (Phase 52). */
    errorRemediationCatalog: ErrorRemediationCatalogPayload;
    /** Present when `kit.cae.enabled` + `kit.cae.advisoryInstructionSurface` are true. */
    cae?: AgentInstructionSurfaceCae;
};
/**
 * Digest-only projection: compare `instructionSurfaceDigest` to a cached full payload;
 * when unchanged, agents skip reloading `commands[]`.
 */
export type AgentInstructionSurfacePayloadLean = {
    schemaVersion: 1;
    projection: "lean";
    instructionSurfaceDigest: string;
    commandCounts: AgentInstructionSurfaceCommandCounts;
    activationReport: ModuleActivationReport;
    errorRemediationCatalog: ErrorRemediationCatalogPayload;
    cae?: AgentInstructionSurfaceCae;
};
export type AgentInstructionSurfacePayload = AgentInstructionSurfacePayloadFull | AgentInstructionSurfacePayloadLean;
export declare function isAgentInstructionSurfaceFull(surface: AgentInstructionSurfacePayload): surface is AgentInstructionSurfacePayloadFull;
/**
 * Classifies whether an instruction can be executed via the command router for the
 * current enabled module set (owning module enabled + all requiresPeers enabled).
 */
export declare function classifyInstructionExecution(mod: WorkflowModule, entry: ModuleInstructionEntry, registry: ModuleRegistry): AgentInstructionDegradation;
export declare function isInstructionExecutableForRegistry(mod: WorkflowModule, entry: ModuleInstructionEntry, registry: ModuleRegistry): boolean;
/**
 * Full catalog for agents: every declared instruction, with executable vs documentation-only.
 */
export type BuildAgentInstructionSurfaceOptions = {
    workspacePath?: string;
    effectiveConfig?: Record<string, unknown>;
    /** When `"lean"`, omit `commands` and return a stable digest for cache checks (Phase 76). */
    projection?: "full" | "lean";
};
/** Stable digest over the sorted command row set (for lean projection cache hits). */
export declare function digestAgentInstructionSurfaceCommands(commands: AgentInstructionSurfaceRow[]): string;
export declare function buildAgentInstructionSurface(allModules: WorkflowModule[], registry: ModuleRegistry, options?: BuildAgentInstructionSurfaceOptions): AgentInstructionSurfacePayload;
