import type { PrimingScriptSummary } from '@longrun-ai/kernel/types/priming';
import type { PersistedDialogRecord } from '@longrun-ai/kernel/types/storage';
import type { DialogPrimingInput, DialogStatusKind } from '@longrun-ai/kernel/types/wire';
import type { Dialog } from './dialog';
import { DialogID } from './dialog';
import { type Reminder } from './tool';
type StripTs<T> = T extends {
    ts: string;
} ? Omit<T, 'ts'> : never;
type PrimingUnsupportedRecord = Extract<PersistedDialogRecord, {
    type: 'sideDialog_created_record' | 'reminders_reconciled_record' | 'questions4human_reconciled_record' | 'active_callees_reconciled_record' | 'sideDialog_registry_reconciled_record' | 'sideDialog_responses_reconciled_record';
}>;
type PrimingReplayRecord = StripTs<Exclude<PersistedDialogRecord, PrimingUnsupportedRecord>>;
export type PrimingScriptValidationIssue = {
    path: string;
    error: string;
};
export type PrimingScriptsValidationResult = {
    checked: number;
    failed: number;
    issues: PrimingScriptValidationIssue[];
};
export type PrimingScriptLoadIssue = {
    path: string;
    error: string;
};
export declare function validateAllPrimingScriptsInRtws(): Promise<PrimingScriptsValidationResult>;
export declare function recordRecentPrimingUsage(agentIdRaw: string, scriptRefs: string[]): Promise<void>;
export declare function listApplicablePrimingScripts(agentIdRaw: string): Promise<{
    recent: PrimingScriptSummary[];
    warnings: PrimingScriptLoadIssue[];
}>;
export declare function searchApplicablePrimingScripts(args: {
    agentId: string;
    query: string;
    limit?: number;
}): Promise<{
    scripts: PrimingScriptSummary[];
    warnings: PrimingScriptLoadIssue[];
}>;
export declare function loadPrimingScriptByRef(scriptRefRaw: string, agentIdRaw: string): Promise<{
    summary: PrimingScriptSummary;
    reminders: Reminder[];
    records: PrimingReplayRecord[];
}>;
export declare function applyPrimingScriptsToDialog(args: {
    dialog: Dialog;
    agentId: string;
    status: DialogStatusKind;
    priming: DialogPrimingInput;
}): Promise<{
    appliedScriptRefs: string[];
    appendedMessageCount: number;
}>;
export declare function saveDialogCourseAsIndividualPrimingScript(args: {
    dialogId: DialogID;
    status: DialogStatusKind;
    course: number;
    slug: string;
    overwrite?: boolean;
}): Promise<{
    script: PrimingScriptSummary;
    messageCount: number;
    path: string;
}>;
export declare function normalizePrimingConfig(raw: unknown): {
    ok: true;
    priming: DialogPrimingInput;
} | {
    ok: false;
    error: string;
};
export declare function normalizePrimingScriptRef(raw: string): string | null;
export declare function normalizePrimingSlug(raw: string): string | null;
export declare function getMainDialogPrimingConfig(metadata: unknown): {
    scriptRefs: string[];
    showInUi: boolean;
} | undefined;
export declare function buildMainDialogPrimingMetadata(priming: DialogPrimingInput | undefined): {
    scriptRefs: string[];
    showInUi: boolean;
} | undefined;
export {};
