/** * Profile YAML / JSON serializer (v2.20) * * Exports profiles to a vendor-neutral text format (YAML v1.2 minimal subset * or JSON), with password redaction by default. Imports validate profiles * and reject unknown types. * * The chosen YAML subset is intentionally small — keys/strings/ints/bools, * lists and nested maps — sufficient for profile documents and parseable by * humans. We hand-roll a parser to avoid pulling in js-yaml. */ import type { Profile, ProfileRole } from './profile-manager.js'; /** Redaction placeholder for sensitive fields when includeSecrets=false. */ export declare const REDACTED = "REDACTED"; /** Profile as exposed to YAML/JSON — config may have REDACTED passwords. */ export interface ProfileExport { name: string; description: string; type: string; config: Record; role: ProfileRole; tags: string[]; enabled: boolean; created_by: string; created_at: string; updated_at: string; use_count: number; } /** Top-level YAML document with version tag. */ export interface ProfileYAML { version: 1; profiles: ProfileExport[]; } export type ImportMode = 'merge' | 'replace'; export interface ImportResult { inserted: number; updated: number; skipped: number; errors: string[]; } /** Deep clone a config object, replacing sensitive fields with REDACTED. */ export declare function redactConfig(config: Record): Record; /** Convert a stored Profile → export shape. */ export declare function profileToExport(p: Profile, opts?: { includeSecrets?: boolean; }): ProfileExport; /** * Validate a profile export. Returns array of error strings (empty = OK). * Does NOT validate REDACTED config — that's the caller's import logic. */ export declare function validateProfileExport(p: ProfileExport): string[]; /** Serialize a {@link ProfileYAML} to YAML text. */ export declare function toYAML(doc: ProfileYAML): string; /** * Minimal YAML parser — supports the subset {@link toYAML} emits: * - 2-space indentation (no tabs) * - `version: N` * - `profiles:` then a list of ` - ...` blocks * - `key: value` lines * - `[a, b, c]` flow lists * - bare strings / quoted JSON strings / numbers / booleans */ export declare function parseYAML(input: string): ProfileYAML; export declare function toJSON(doc: ProfileYAML): string; export declare function parseJSON(input: string): ProfileYAML; export declare class ProfileSerializer { static toYAML(profiles: Profile[], opts?: { includeSecrets?: boolean; }): string; static toJSON(profiles: Profile[], opts?: { includeSecrets?: boolean; }): string; static parse(input: string, format: 'yaml' | 'json'): ProfileYAML; static validate(p: ProfileExport): string[]; } //# sourceMappingURL=profile-serializer.d.ts.map