import { type Static, Type } from "typebox";
/**
 * One retrieved-and-classified skill for the closed task. `retrieved`
 * comes from T08 (skill-retriever); `used` from T09 (skill-usage-tracker).
 * `retrievalScore` is the T08 score (informational — surfaces in evidence).
 */
export declare const RetrievedSkillSignalSchema: Type.TObject<{
    skillId: Type.TString;
    retrieved: Type.TBoolean;
    used: Type.TBoolean;
    retrievalScore: Type.TNumber;
}>;
export type RetrievedSkillSignal = Static<typeof RetrievedSkillSignalSchema>;
/** Per-skill historical signal — supplied by caller from sprint history. */
export declare const SkillHistorySchema: Type.TObject<{
    consecutiveUnusedSprints: Type.TInteger;
}>;
export type SkillHistory = Static<typeof SkillHistorySchema>;
/** One pairwise retrieval-overlap measurement for the closed task. */
export declare const PairwiseOverlapSchema: Type.TObject<{
    skillA: Type.TString;
    skillB: Type.TString;
    overlap: Type.TNumber;
}>;
export type PairwiseOverlap = Static<typeof PairwiseOverlapSchema>;
export declare const FrictionInputsSchema: Type.TObject<{
    retrievedSkills: Type.TArray<Type.TObject<{
        skillId: Type.TString;
        retrieved: Type.TBoolean;
        used: Type.TBoolean;
        retrievalScore: Type.TNumber;
    }>>;
    taskSuccess: Type.TBoolean;
    toolErrorCount: Type.TInteger;
    history: Type.TRecord<"^.*$", Type.TObject<{
        consecutiveUnusedSprints: Type.TInteger;
    }>>;
    pairwiseRetrievalOverlap: Type.TOptional<Type.TArray<Type.TObject<{
        skillA: Type.TString;
        skillB: Type.TString;
        overlap: Type.TNumber;
    }>>>;
}>;
export type FrictionInputs = Static<typeof FrictionInputsSchema>;
import { FRICTION_SUBKINDS, type FrictionSubkind } from "../lib/catalog-types.js";
export { FRICTION_SUBKINDS, type FrictionSubkind };
/**
 * One classifier output. `skillId` is `undefined` for `skill_missing`
 * (no skill to attribute) but always set for the other four subkinds.
 */
export interface FrictionSignal {
    subkind: FrictionSubkind;
    skillId: string | undefined;
    evidence: Record<string, unknown>;
}
/** Runtime attribution supplied by the orchestrator (IL10). */
export declare const FrictionEmitRuntimeSchema: Type.TObject<{
    storeCli: Type.TString;
    cwd: Type.TString;
    sprintId: Type.TString;
    taskId: Type.TString;
    /** Orchestrator phase role. @see RoleKind from lib/catalog-types.ts */
    role: Type.TString;
    /** Orchestrator phase action. @see ActionKind from lib/catalog-types.ts */
    action: Type.TString;
    workflow: Type.TString;
    persona: Type.TString;
    phase: Type.TOptional<Type.TString>;
    iteration: Type.TOptional<Type.TInteger>;
    startTimestamp: Type.TString;
    endTimestamp: Type.TString;
    durationMinutes: Type.TNumber;
    model: Type.TString;
    provider: Type.TString;
}>;
export type FrictionEmitRuntime = Static<typeof FrictionEmitRuntimeSchema>;
export interface FrictionEmitResult {
    emitted: number;
    failed: number;
    stderrs: string[];
}
/**
 * Apply the five gating rules and return one signal per matching emit.
 * Pure: no IO, no subprocess. Caller decides whether/when to emit.
 *
 * The `skill_unused` and `skill_failed` gates are mutually exclusive by
 * design — on a failed task we emit `skill_failed` (when used) rather
 * than `skill_unused`, so the two signals never double-count the same
 * outcome.
 */
export declare function computeFrictionSignals(inputs: FrictionInputs): FrictionSignal[];
/**
 * Emit one `friction` event per signal via
 * `node <storeCli> emit <sprintId> <json>`. Runtime attribution
 * (model/provider/timestamps/eventId) is supplied by the caller — never
 * fabricated. Failures surface in the result counter; nothing is thrown
 * for subprocess failure.
 */
export declare function emitFrictionEvents(signals: readonly FrictionSignal[], runtime: FrictionEmitRuntime): FrictionEmitResult;
