/**
 * src/autonomy/profile.ts
 *
 * PROFILE.md self-learning. Inspired by OpenHuman's user_profile_facets +
 * PROFILE.md pipeline (docs/AGENT_SELF_LEARNING.md).
 *
 * Six fact classes, each emitted from observable signal:
 *   - style/*        — verbosity, format, language, emoji use, formality (formal/Hijazi/Najdi)
 *   - identity/*     — owner_name, business_name, timezone, role, employer
 *   - tooling/*      — accounting (Zoho/QuickBooks/Foodics), POS, CRM, payment gateway
 *   - veto/*         — banned tones / banned actions
 *   - goal/*         — free-form goal sentences
 *   - channel/preference — primary delivery channel (WhatsApp/Telegram/email/dashboard)
 *
 * Storage: `customer_memories` table (already exists), namespace='profile',
 * key=`<class>/<slug>`, value=`<value>`. This piggybacks on the existing
 * journaled-memory pipeline so we don't add a new table or schema.
 *
 * Materialization: `<dataDir>/vault/<tenantId>/PROFILE.md`. The owner
 * opens this file in Obsidian and edits values directly. The next time
 * we run `loadProfileForPrompt()`, we re-read the file and surface its
 * `<!-- USER:BEGIN -->` block as overrides (file beats DB on conflict).
 *
 * Extraction: a daily cron (`__autonomy:profile-extract__`) walks the last
 * 24h of journaled messages + tool calls and emits LearningCandidate
 * objects to the memories table. No extra LLM calls — pattern-driven.
 */
export type FacetClass = 'style' | 'identity' | 'tooling' | 'veto' | 'goal' | 'channel';
export interface ProfileFacet {
    class: FacetClass;
    key: string;
    value: string;
    confidence: number;
    evidenceCount: number;
    lastSeenAt: string;
}
/** Try every rule against a message; return all distinct facets that fire. */
export declare function extractFacetsFromMessage(message: string): Array<{
    class: FacetClass;
    key: string;
    value: string;
    confidence: number;
}>;
/** Public entry: observe a message and persist any facets it implies.
 * Cheap — pattern-driven, no LLM call. */
export declare function observeMessageForProfile(tenantId: string, message: string): Promise<number>;
/** Load all profile facets for a tenant. Sorted by class then key. */
export declare function loadProfile(tenantId: string): Promise<ProfileFacet[]>;
/** Render profile facets as a compact prompt block. Inject into every
 * system prompt. Returns empty string when there are no high-confidence
 * facts (no value in noisy injection). */
export declare function buildProfilePromptBlock(tenantId: string, opts?: {
    minConfidence?: number;
    maxFacets?: number;
}): Promise<string>;
/** Materialize PROFILE.md in the vault. Preserves the USER:BEGIN/END
 * block so owner edits survive each rebuild. */
export declare function materializeProfileMd(tenantId: string): Promise<void>;
/** Daily cron entry — runs in housekeeping window (02:30 KSA). Walks the
 * last 24h of inbound user messages and re-extracts facets. Cheap because
 * extraction is pattern-only. Materializes PROFILE.md when done. */
export declare function runProfileExtraction(tenantId: string): Promise<{
    messagesScanned: number;
    facetsLearned: number;
}>;
//# sourceMappingURL=profile.d.ts.map