import { type Static, Type } from "typebox";
import { type ForgePersona } from "../forge-subagent.js";
import type { ForgeToolDefs } from "../forge-tools.js";
/**
 * One retrieved skill (T08 output) supplied to the curator as context.
 * `body` is the actual SKILL.md text the agent was shown during the task —
 * the curator reads it to decide whether the skill needs updating.
 */
export declare const RetrievedSkillBodySchema: Type.TObject<{
    skillId: Type.TString;
    name: Type.TString;
    body: Type.TString;
}>;
export type RetrievedSkillBody = Static<typeof RetrievedSkillBodySchema>;
export declare const TaskOutcomeSchema: Type.TObject<{
    verdict: Type.TUnion<[Type.TLiteral<"approved">, Type.TLiteral<"revision">, Type.TLiteral<"failed">, Type.TLiteral<"aborted">]>;
    notes: Type.TOptional<Type.TString>;
}>;
export type TaskOutcome = Static<typeof TaskOutcomeSchema>;
export declare const CuratorInputSchema: Type.TObject<{
    sprintId: Type.TString;
    taskId: Type.TString;
    cwd: Type.TString;
    ts: Type.TString;
    trajectorySummary: Type.TString;
    retrievedSkills: Type.TArray<Type.TObject<{
        skillId: Type.TString;
        name: Type.TString;
        body: Type.TString;
    }>>;
    outcome: Type.TObject<{
        verdict: Type.TUnion<[Type.TLiteral<"approved">, Type.TLiteral<"revision">, Type.TLiteral<"failed">, Type.TLiteral<"aborted">]>;
        notes: Type.TOptional<Type.TString>;
    }>;
}>;
export type CuratorInput = Static<typeof CuratorInputSchema>;
/**
 * The enhancement proposal schema accepted by this module — mirrors
 * `forge/forge/schemas/proposal.schema.json` (the queue-drain contract).
 * `op` is restricted to the canonical three-op enum; other fields are
 * passed through verbatim if present.
 *
 * Strict on required keys (so malformed items are dropped), permissive on
 * optional keys (so the curator can supply rationale, sourceFrictionIds,
 * generated_at, etc., without us re-enumerating the entire schema here).
 */
declare const ProposalSchema: Type.TObject<{
    op: Type.TUnion<[Type.TLiteral<"insert_skill">, Type.TLiteral<"update_skill">, Type.TLiteral<"delete_skill">]>;
    target_path: Type.TString;
    diff_body: Type.TString;
    rationale: Type.TOptional<Type.TString>;
    sourceFrictionIds: Type.TOptional<Type.TArray<Type.TString>>;
    generated_at: Type.TOptional<Type.TString>;
    sprintId: Type.TOptional<Type.TString>;
    proposalId: Type.TOptional<Type.TString>;
}>;
export type Proposal = Static<typeof ProposalSchema>;
export interface CuratorResult {
    exitCode: 0 | 1;
    written: number;
    queueFile?: string;
    errorMessage?: string;
}
/**
 * Compose the first user message for the curator subagent. The body embeds
 * the trajectory summary, retrieved-skill bodies, and task outcome, and
 * instructs the curator to return zero or more proposals in a fenced JSON
 * block. The schema is described inline so the curator does not need to
 * read an external file.
 */
export declare function composeCuratorTask(input: CuratorInput): string;
/**
 * Pull zero or more proposals from the curator's final assistant text.
 * Strategy: try fenced ```json blocks first (the requested format), then
 * fall back to a bare JSON array scan. Items that fail TypeBox validation
 * are dropped — the failure mode for ill-formed proposals is silent
 * exclusion, not exception, because the curator's output is best-effort.
 */
export declare function parseProposalsFromOutput(text: string): Proposal[];
/**
 * Inline curator persona. We do NOT add a file under
 * `forge/forge/meta/personas/` (Iron Law 1 — forge-cli only). The persona
 * system prompt is small and self-contained; it tells the LLM to act as a
 * skill curator and reiterates the output format and the no-write rule.
 *
 * The persona is exported so tests can introspect it; in production the
 * defaultCuratorPersona() factory is consumed by runSkillCurator.
 */
export declare function defaultCuratorPersona(): ForgePersona;
/**
 * Run the per-task curator subagent and write its proposals to the
 * enhancement-proposals queue. Always returns a typed result; never throws
 * on subagent failure (IL7).
 *
 * Caller (orchestrator) is responsible for:
 *   - assembling `retrievedSkills` from the T08 retriever's output;
 *   - assembling `trajectorySummary` from the task transcript;
 *   - emitting the canonical phase event AFTER this call returns,
 *     using its own captured runtime telemetry (Slice 2 contract).
 */
export declare function runSkillCurator(input: CuratorInput, forgeToolDefs?: ForgeToolDefs): Promise<CuratorResult>;
export {};
