import { type Static, Type } from "typebox";
/** Per-phase token usage, captured from the subagent transcript header. */
export declare const PhaseUsageSchema: Type.TObject<{
    input: Type.TNumber;
    output: Type.TNumber;
    cacheRead: Type.TNumber;
    cacheWrite: Type.TNumber;
    cost: Type.TNumber;
    contextTokens: Type.TOptional<Type.TNumber>;
    turns: Type.TOptional<Type.TNumber>;
}>;
export type PhaseUsage = Static<typeof PhaseUsageSchema>;
/** One pipeline phase within an archived run. */
export declare const PhaseRecordSchema: Type.TObject<{
    role: Type.TString;
    attempt: Type.TNumber;
    /** Verdict from the orchestrator phase-end event; "n/a" when none applies. */
    verdict: Type.TString;
    model: Type.TOptional<Type.TString>;
    provider: Type.TOptional<Type.TString>;
    usage: Type.TOptional<Type.TObject<{
        input: Type.TNumber;
        output: Type.TNumber;
        cacheRead: Type.TNumber;
        cacheWrite: Type.TNumber;
        cost: Type.TNumber;
        contextTokens: Type.TOptional<Type.TNumber>;
        turns: Type.TOptional<Type.TNumber>;
    }>>;
    /** Archived phase-transcript filename (without the .gz suffix). */
    file: Type.TOptional<Type.TString>;
    /**
     * Archived live tail-log filename (without the .gz suffix) — the exact
     * lines the dashboard rendered during the run (`*.tail.jsonl`). Replay
     * prefers this over reconstructing a digest from the transcript.
     */
    tailFile: Type.TOptional<Type.TString>;
    startedAt: Type.TOptional<Type.TString>;
    elapsedMs: Type.TOptional<Type.TNumber>;
}>;
export type PhaseRecord = Static<typeof PhaseRecordSchema>;
/** Aggregate bucket used for both byModel and byProvider rollups. */
export declare const UsageAggregateSchema: Type.TObject<{
    input: Type.TNumber;
    output: Type.TNumber;
    cost: Type.TNumber;
    phases: Type.TNumber;
}>;
export type UsageAggregate = Static<typeof UsageAggregateSchema>;
export declare const RunTotalsSchema: Type.TObject<{
    input: Type.TNumber;
    output: Type.TNumber;
    cacheRead: Type.TNumber;
    cacheWrite: Type.TNumber;
    cost: Type.TNumber;
    byModel: Type.TRecord<"^.*$", Type.TObject<{
        input: Type.TNumber;
        output: Type.TNumber;
        cost: Type.TNumber;
        phases: Type.TNumber;
    }>>;
    byProvider: Type.TRecord<"^.*$", Type.TObject<{
        input: Type.TNumber;
        output: Type.TNumber;
        cost: Type.TNumber;
        phases: Type.TNumber;
    }>>;
    /** Count of phase-loopback events (revision loops) in the run. */
    revisionLoops: Type.TNumber;
}>;
export type RunTotals = Static<typeof RunTotalsSchema>;
export declare const RunOutcomeSchema: Type.TUnion<[Type.TLiteral<"complete">, Type.TLiteral<"halted">, Type.TLiteral<"cancelled">, Type.TLiteral<"error">, Type.TLiteral<"incomplete">]>;
export type RunOutcome = Static<typeof RunOutcomeSchema>;
export declare const EntityKindSchema: Type.TUnion<[Type.TLiteral<"task">, Type.TLiteral<"bug">, Type.TLiteral<"sprint">, Type.TLiteral<"unknown">]>;
export type EntityKind = Static<typeof EntityKindSchema>;
/** manifest.json — full metadata for one archived run. */
export declare const RunManifestSchema: Type.TObject<{
    schema: Type.TLiteral<"forge-run-manifest/v1">;
    runId: Type.TString;
    projectKey: Type.TString;
    projectPath: Type.TString;
    projectName: Type.TString;
    projectPrefix: Type.TString;
    entityId: Type.TString;
    entityKind: Type.TUnion<[Type.TLiteral<"task">, Type.TLiteral<"bug">, Type.TLiteral<"sprint">, Type.TLiteral<"unknown">]>;
    /** Back-reference for sprint-nested task runs — no synthetic sprint container. */
    sprintId: Type.TOptional<Type.TString>;
    startedAt: Type.TString;
    finishedAt: Type.TOptional<Type.TString>;
    durationMs: Type.TOptional<Type.TNumber>;
    outcome: Type.TUnion<[Type.TLiteral<"complete">, Type.TLiteral<"halted">, Type.TLiteral<"cancelled">, Type.TLiteral<"error">, Type.TLiteral<"incomplete">]>;
    phases: Type.TArray<Type.TObject<{
        role: Type.TString;
        attempt: Type.TNumber;
        /** Verdict from the orchestrator phase-end event; "n/a" when none applies. */
        verdict: Type.TString;
        model: Type.TOptional<Type.TString>;
        provider: Type.TOptional<Type.TString>;
        usage: Type.TOptional<Type.TObject<{
            input: Type.TNumber;
            output: Type.TNumber;
            cacheRead: Type.TNumber;
            cacheWrite: Type.TNumber;
            cost: Type.TNumber;
            contextTokens: Type.TOptional<Type.TNumber>;
            turns: Type.TOptional<Type.TNumber>;
        }>>;
        /** Archived phase-transcript filename (without the .gz suffix). */
        file: Type.TOptional<Type.TString>;
        /**
         * Archived live tail-log filename (without the .gz suffix) — the exact
         * lines the dashboard rendered during the run (`*.tail.jsonl`). Replay
         * prefers this over reconstructing a digest from the transcript.
         */
        tailFile: Type.TOptional<Type.TString>;
        startedAt: Type.TOptional<Type.TString>;
        elapsedMs: Type.TOptional<Type.TNumber>;
    }>>;
    totals: Type.TObject<{
        input: Type.TNumber;
        output: Type.TNumber;
        cacheRead: Type.TNumber;
        cacheWrite: Type.TNumber;
        cost: Type.TNumber;
        byModel: Type.TRecord<"^.*$", Type.TObject<{
            input: Type.TNumber;
            output: Type.TNumber;
            cost: Type.TNumber;
            phases: Type.TNumber;
        }>>;
        byProvider: Type.TRecord<"^.*$", Type.TObject<{
            input: Type.TNumber;
            output: Type.TNumber;
            cost: Type.TNumber;
            phases: Type.TNumber;
        }>>;
        /** Count of phase-loopback events (revision loops) in the run. */
        revisionLoops: Type.TNumber;
    }>;
    archivedAt: Type.TString;
}>;
export type RunManifest = Static<typeof RunManifestSchema>;
/** One line of index.jsonl — the append-only global run timeline. */
export declare const IndexEntrySchema: Type.TObject<{
    runId: Type.TString;
    projectKey: Type.TString;
    entityId: Type.TString;
    entityKind: Type.TUnion<[Type.TLiteral<"task">, Type.TLiteral<"bug">, Type.TLiteral<"sprint">, Type.TLiteral<"unknown">]>;
    sprintId: Type.TOptional<Type.TString>;
    startedAt: Type.TString;
    outcome: Type.TUnion<[Type.TLiteral<"complete">, Type.TLiteral<"halted">, Type.TLiteral<"cancelled">, Type.TLiteral<"error">, Type.TLiteral<"incomplete">]>;
    input: Type.TNumber;
    output: Type.TNumber;
    cost: Type.TNumber;
    durationMs: Type.TOptional<Type.TNumber>;
    archivedAt: Type.TString;
}>;
export type IndexEntry = Static<typeof IndexEntrySchema>;
/** projects.json — projectKey → identity registry. */
export declare const ProjectsRegistrySchema: Type.TObject<{
    version: Type.TLiteral<1>;
    projects: Type.TRecord<"^.*$", Type.TObject<{
        path: Type.TString;
        prefix: Type.TString;
        name: Type.TString;
        firstSeen: Type.TString;
        lastSeen: Type.TString;
        runCount: Type.TNumber;
    }>>;
}>;
export type ProjectsRegistry = Static<typeof ProjectsRegistrySchema>;
