import { TrainingExportAdapter, TrainingExportRecord } from '@remnic/core'; /** * WeClone Alpaca-format training export adapter. * * Converts TrainingExportRecord[] into the JSON format that * WeClone / LLaMA Factory expects for fine-tuning: * * [{ "instruction": "...", "input": "", "output": "..." }, ...] * * Only the three Alpaca fields are emitted; Remnic-specific * metadata (category, confidence, sourceIds) is stripped. */ declare const wecloneExportAdapter: TrainingExportAdapter; /** * Communication style marker extraction. * * Analyzes text samples using simple heuristics to produce * a StyleMarkers profile. No LLM calls — pure regex and * counting. */ interface StyleMarkers { avgSentenceLength: number; usesEmoji: boolean; formality: "formal" | "casual" | "mixed"; usesLowercase: boolean; commonPhrases: string[]; } /** * Analyse text samples and extract communication style markers. */ declare function extractStyleMarkers(samples: string[]): StyleMarkers; /** * Training-pair synthesizer. * * Converts Remnic's flat TrainingExportRecord[] — where * `instruction` is a natural-language description and * `category` identifies the memory type — into natural * conversational question-answer pairs suitable for * WeClone / LLaMA Factory fine-tuning. * * Uses template-based question generation (no LLM calls). */ interface SynthesizerOptions { styleMarkers?: StyleMarkers; maxPairsPerRecord?: number; } /** * Synthesize natural conversational training pairs from * category-tagged memory records. */ declare function synthesizeTrainingPairs(records: TrainingExportRecord[], options?: SynthesizerOptions): TrainingExportRecord[]; /** * PII privacy sweep for training export records. * * Belt-and-suspenders check that runs after Remnic's own * privacy controls. Scans instruction, input, and output * fields for common PII patterns and replaces matches with * [REDACTED]. */ interface PrivacySweepResult { cleanRecords: TrainingExportRecord[]; redactedCount: number; redactionDetails: { index: number; field: string; pattern: string; }[]; } /** * Scan and redact PII from training export records. * * Returns a new array of cleaned records, leaving the originals * unmodified. The `redactedCount` is the number of records that * had at least one redaction. `redactionDetails` lists every * individual match with its record index, field, and pattern name. */ declare function sweepPii(records: TrainingExportRecord[]): PrivacySweepResult; /** * @remnic/export-weclone * * WeClone-specific training-data export adapter that converts * Remnic memories into Alpaca-format fine-tuning datasets * compatible with WeClone / LLaMA Factory. */ interface TrainingExportRegistry { getTrainingExportAdapter(name: string): TrainingExportAdapter | undefined; registerTrainingExportAdapter(adapter: TrainingExportAdapter): void; } /** * Idempotently register the WeClone adapter with the core training-export * registry. Callable multiple times without throwing (CLAUDE.md #13: * secondary calls must not crash host processes that pre-register the * adapter for test fixtures). * * Returns true when the adapter was newly registered, false when an adapter * with the same name already exists. */ declare function ensureWecloneExportAdapterRegistered(registry?: TrainingExportRegistry): boolean; export { type PrivacySweepResult, type StyleMarkers, type SynthesizerOptions, type TrainingExportRegistry, ensureWecloneExportAdapterRegistered, extractStyleMarkers, sweepPii, synthesizeTrainingPairs, wecloneExportAdapter };