export declare const REQUEST_BRIEF_FILE = "request-brief.json";
export declare const SELECTION_PLAN_FILE = "selection-plan.json";
export declare const CONTEXT_LOG_FILE = "context-log.jsonl";
export declare const DECISION_LOG_FILE = "decision-log.jsonl";
export type RequestIntent = 'inspect' | 'plan' | 'mutate' | 'verify' | 'release' | 'operate';
export type RiskLevel = 'low' | 'medium' | 'high' | 'critical';
export type ArtifactType = 'answer' | 'plan' | 'patch' | 'test' | 'release' | 'dashboard-command';
export type ModelTier = 'T0' | 'T1' | 'T2' | 'T3' | 'T4';
export interface RequestBrief {
    schemaVersion: 1;
    id: string;
    runId: string;
    rawPrompt: string;
    rewrittenPrompt: string;
    intent: RequestIntent;
    confidence: number;
    risk: RiskLevel;
    artifactType: ArtifactType;
    constraints: string[];
    acceptanceCriteria: string[];
    openQuestions: string[];
    taskClass: string;
    candidateMemories: string[];
    candidateFiles: string[];
    candidateSkills: string[];
    candidateAgents: string[];
    modelPolicy: ModelRoute;
    createdAt: number;
}
export interface ModelRoute {
    workerTier: ModelTier;
    reviewerTier?: ModelTier;
    reason: string;
    estimatedCostUsd: number;
    confidence: number;
    escalationPolicy: string[];
}
export interface SelectionPlan {
    schemaVersion: 1;
    id: string;
    runId: string;
    requestBriefId?: string;
    workspaceKey?: string;
    intent: RequestIntent;
    topology: string;
    candidates: CandidateSet;
    selected: SelectedSet;
    budgets: SourceBudgets;
    modelRoute: ModelRoute;
    executionPolicy: ExecutionPolicy;
    riskGates: RiskGate[];
    provenance: SelectionProvenance[];
    confidence: number;
    createdAt: number;
}
export interface CandidateSet {
    files: string[];
    memories: string[];
    skills: string[];
    workflows: string[];
    hooks: string[];
    automations: string[];
    specialists: string[];
    crews: string[];
}
export interface SelectedSet extends CandidateSet {
    workers: string[];
    verifyCommands: string[];
    actions: string[];
}
export interface SourceBudgets {
    totalTokens: number;
    prompt: number;
    memory: number;
    repo: number;
    graph: number;
    runtime: number;
    skills: number;
    reasoning: number;
    codeBlocks: number;
    verification: number;
    reserve: number;
    codeBlockPolicy: {
        detectedBlocks: number;
        templateBlocks: number;
        reservedTokens: number;
        languages: string[];
        templates: string[];
    };
}
export interface RiskGate {
    gate: string;
    status: string;
    reason?: string;
}
export interface ExecutionPolicy {
    topology: string;
    workerCount: number;
    maxParallelWorkers: number;
    allowedTools: string[];
    subagents: Array<{
        role: string;
        modelTier: ModelTier;
        authority: 'read' | 'write' | 'verify';
        reviewRequired: boolean;
    }>;
    verificationRequired: boolean;
    reviewMode: 'none' | 'self-check' | 'reviewer' | 'escalated-review';
    escalationPolicy: string[];
    reasons: string[];
    agentFlow: {
        enabled: true;
        boardSource: 'nexus-runtime';
        maxTaskCostUsd: number;
        hardStopUsd: number;
        crashRecovery: string;
        dispatchPolicy: string;
        deterministicGates: string[];
        stages: Array<{
            stage: 'research' | 'build' | 'review' | 'test' | 'integrate' | 'done';
            ownerRole: 'planner' | 'coder' | 'researcher' | 'reviewer' | 'verifier' | 'integrator';
            gate: string;
            modelTier: ModelTier;
            budgetShare: number;
        }>;
    };
}
export interface SelectionProvenance {
    targetType: 'file' | 'memory' | 'skill' | 'workflow' | 'crew' | 'specialist' | 'model' | 'hook' | 'automation';
    targetId: string;
    signals: Array<{
        source: 'ngram' | 'atlas' | 'repo-graph' | 'memory' | 'session-dna' | 'semantic' | 'catalog' | 'user' | 'planner' | 'runtime';
        score: number;
        reason: string;
    }>;
}
export interface ContextLogEntry {
    schemaVersion: 1;
    id: string;
    runId: string;
    planId?: string;
    actor: 'system' | 'user' | 'worker' | 'reviewer';
    phase: 'compile' | 'select' | 'approve' | 'execute' | 'verify' | 'summarize';
    contextRefs: string[];
    memoryRefs: string[];
    fileRefs: string[];
    evidenceRefs: string[];
    reason: string;
    createdAt: number;
}
export interface DecisionLogEntry {
    schemaVersion: 1;
    id: string;
    runId: string;
    actor: string;
    surface: 'dashboard' | 'mcp' | 'cli' | 'worker' | 'runtime';
    verb: 'plan' | 'execute' | 'hire' | 'dispatch' | 'approve' | 'cancel' | 'replay' | 'verify' | 'complete';
    decision: string;
    reason: string;
    beforeRef?: string;
    afterRef?: string;
    createdAt: number;
}
type AnyRecord = Record<string, any>;
export declare function inferModelRoute(input: {
    task?: AnyRecord;
    run?: AnyRecord;
    risk?: RiskLevel;
    confidence?: number;
}): ModelRoute;
export declare function buildExecutionPolicy(input: {
    task?: AnyRecord;
    run?: AnyRecord;
    plannerState?: AnyRecord;
    modelRoute?: ModelRoute;
    risk?: RiskLevel;
}): ExecutionPolicy;
export declare function buildRequestBrief(input: {
    runId: string;
    task: AnyRecord;
    plannerState?: AnyRecord;
    createdAt?: number;
}): RequestBrief;
export declare function buildSelectionPlan(input: {
    run: AnyRecord;
    task: AnyRecord;
    plannerState?: AnyRecord;
    fileRefs?: AnyRecord[];
    memoryMatches?: unknown[];
    readingPlan?: AnyRecord;
    createdAt?: number;
}): SelectionPlan;
export declare function buildContextLog(run: AnyRecord, createdAt?: number): ContextLogEntry[];
export declare function buildDecisionLog(run: AnyRecord, createdAt?: number): DecisionLogEntry[];
export declare function toJsonl(entries: unknown[]): string;
export {};
