/**
 * src/knowledge/vault.ts
 *
 * Obsidian-compatible vault mirror. Inspired by OpenHuman's Memory Tree
 * + Obsidian Wiki workflow: every KG entity + every episode of the day
 * lands as a `.md` file in `<dataDir>/vault/<tenantId>/`, with YAML
 * frontmatter and wiki-style `[[links]]`. The owner opens the folder in
 * Obsidian (free, cross-platform) and BROWSES + EDITS the AI employee's
 * entire memory in plain Markdown.
 *
 * Why this matters for B2B sales:
 *   - "Show me what your AI thinks about my business" → open the vault.
 *   - "I want to correct something it learned wrong" → edit the file.
 *   - "Can I export everything?" → it's already plain `.md` on disk.
 *
 * Layout:
 *   <dataDir>/vault/<tenantId>/
 *     README.md                       — quick orientation for the owner
 *     entities/
 *       <Type>/<safe-name>.md         — one entity per file
 *     episodes/
 *       YYYY-MM-DD.md                 — daily rollup of conversation excerpts
 *     skills/
 *       <name>.md                     — skill body + accumulated lessons
 *     PROFILE.md                      — (v2.5.0 PROFILE.md feature)
 *
 * Sync strategy:
 *   - Incremental: each upsert/episode write triggers a single-file refresh.
 *   - Full rebuild: once daily during housekeeping (02:30 KSA).
 *   - Owner edits are PRESERVED on next sync (frontmatter-driven merge).
 *
 * Idempotency: writes are skipped when content unchanged. Mtime preserved
 * so Obsidian's "modified date" reflects the agent's last update, not the
 * sync run.
 */
export declare function getVaultRoot(tenantId: string): string;
/** Ensure the vault tree exists + drop a README so the owner knows what
 * they're looking at. Idempotent. */
export declare function ensureVaultForTenant(tenantId: string): Promise<void>;
/**
 * Mirror one KG entity to its `.md` file. Called on every upsertEntity.
 * Cheap: a short write to local disk.
 */
export declare function syncEntityToVault(tenantId: string, entity: {
    id?: string;
    name: string;
    type: string;
    kind?: string;
    customer_id?: string | null;
    properties?: Record<string, unknown> | null;
    episode_count?: number;
    updated_at?: string;
}, options?: {
    relatedEntityNames?: string[];
}): Promise<void>;
/**
 * Full vault rebuild — exports EVERY kg_entity for the tenant as a markdown
 * file with proper wiki-links from kg_relationships. After this runs, the
 * vault directory can be opened directly in Obsidian and the graph view
 * shows the complete knowledge graph with all connections.
 *
 * Used by:
 *   POST /api/knowledge/vault/rebuild (owner-triggered from Memory tab)
 *
 * Returns counts so the UI can show "synced 200 entities + 47 relationships".
 */
export declare function rebuildVaultForTenant(tenantId: string): Promise<{
    entities: number;
    relationships: number;
    path: string;
}>;
/**
 * Append today's conversation excerpts to `episodes/YYYY-MM-DD.md`.
 * Coalesces multiple appends per day into one file.
 */
export declare function appendEpisodeToVault(tenantId: string, episode: {
    customerId: string;
    customerName: string;
    content: string;
    createdAt?: Date | string;
}): Promise<void>;
/** Full vault rebuild — used by housekeeping or first-boot. Reads all KG
 * rows for the tenant and rewrites the vault from scratch. Preserves
 * user-edited content via mergeUserSection. */
export declare function rebuildVault(tenantId: string): Promise<{
    entities: number;
    episodes: number;
    skills: number;
}>;
//# sourceMappingURL=vault.d.ts.map