import { SkillCardRegistry } from './skill-card.js';
import { type CatalogOrigin, type CatalogSelectionPolicy, type RuntimeBinding, type RuntimeBindingType, type SkillCheckpoint, type SkillRiskClass, type SkillScope } from './runtime-assets.js';
export type { SkillCheckpoint, SkillRiskClass, SkillScope, RuntimeBinding as SkillBinding, RuntimeBindingType as SkillBindingType };
export interface SkillValidationResult {
    valid: boolean;
    errors: string[];
    hotDeployAllowed: boolean;
}
export interface SkillDeploymentRecord {
    workerId: string;
    checkpoint: SkillCheckpoint;
    deployedAt: number;
    worktreeDir: string;
}
export interface SkillDistributionEntry {
    skillId: string;
    name: string;
    scope: SkillScope;
    rolloutStatus: SkillArtifact['rolloutStatus'];
    riskClass: SkillRiskClass;
    validationStatus: SkillArtifact['validationStatus'];
    distributableTo: string[];
}
export interface SkillDistributionManifest {
    generatedAt: number;
    serverGoverned: true;
    targetClientIds: string[];
    skills: SkillDistributionEntry[];
}
export interface SkillArtifact {
    skillId: string;
    version: number;
    name: string;
    domain?: string;
    instructions: string;
    toolBindings: RuntimeBinding[];
    riskClass: SkillRiskClass;
    scope: SkillScope;
    provenance: string;
    validationStatus: 'pending' | 'validated' | 'rejected';
    rolloutStatus: 'staged' | 'hot' | 'promoted' | 'revoked';
    catalogOrigin: CatalogOrigin;
    catalogPath?: string;
    catalogPriority: number;
    effectiveness: {
        successes: number;
        failures: number;
        tokenDelta: number;
        retriesAvoided: number;
        verificationPasses: number;
    };
    deploymentPoints: SkillDeploymentRecord[];
    embedding?: number[];
}
export interface SkillRuntimeMetrics {
    success: boolean;
    tokenDelta?: number;
    retriesAvoided?: number;
    verificationPassed?: boolean;
}
export interface SkillDerivationSignal {
    goal: string;
    workerCount: number;
    memoryMatches?: string[];
    repeatedFailures?: number;
    sessionHints?: string[];
}
export declare class SkillRuntime {
    private rootDir;
    private workspaceRoot;
    private artifacts;
    private bootstrapped;
    private embedder?;
    private ngramIndex;
    private registry?;
    constructor(registry?: SkillCardRegistry, rootDir?: string, workspaceRoot?: string);
    private getEmbedder;
    getArtifact(skillId: string): SkillArtifact | undefined;
    findByName(name: string): SkillArtifact | undefined;
    importPeerSkill(sourcePeerId: string, payload: unknown): SkillArtifact;
    listArtifacts(options?: {
        selectionPolicy?: CatalogSelectionPolicy;
        dedupe?: boolean;
    }): SkillArtifact[];
    createSkill(input: {
        name: string;
        domain?: string;
        instructions: string;
        toolBindings: RuntimeBinding[];
        riskClass: SkillRiskClass;
        scope: SkillScope;
        provenance: string;
    }): SkillArtifact;
    resolveSkillSelectors(names: string[], goal: string): Promise<SkillArtifact[]>;
    generateRuntimeSkills(goal: string, workerCount: number, signal?: Partial<SkillDerivationSignal>): SkillArtifact[];
    deriveFromSignals(signal: SkillDerivationSignal): SkillArtifact[];
    validate(artifact: SkillArtifact): SkillValidationResult;
    listDistributableArtifacts(): SkillArtifact[];
    buildDistributionManifest(targetClientIds?: string[]): SkillDistributionManifest;
    stage(artifact: SkillArtifact, options?: {
        bulk?: boolean;
    }): SkillArtifact;
    deploy(artifact: SkillArtifact, workerId: string, worktreeDir: string, checkpoint: SkillCheckpoint): SkillArtifact;
    recordOutcome(skillId: string, metrics: SkillRuntimeMetrics): SkillArtifact | undefined;
    promote(skillId: string, scope?: SkillScope): SkillArtifact | undefined;
    revoke(skillId: string): SkillArtifact | undefined;
    private lastLocalRefresh;
    private ensureBootstrapped;
    private loadBundledDefaults;
    private loadLocalOverrides;
    private persistArtifact;
    private renderMarkdown;
    private registerSkillCard;
    private isDistributableArtifact;
    private persistCanonicalArtifact;
}
export declare const createSkillRuntime: (registry?: SkillCardRegistry, rootDir?: string, workspaceRoot?: string) => SkillRuntime;
