/**
 * src/workflows/recorder.ts
 *
 * Workflow capture-and-recall — Muassis remembers how it handled prior
 * requests so it can replay the recipe next time.
 *
 * After each successful tool-using turn we save:
 *   - The user's original message + a normalized keyword set
 *   - The intent the router classified
 *   - The full tool-call sequence (name + args)
 *   - A short response excerpt for context
 *
 * Before the next turn's LLM call we look up the closest prior recipe
 * using keyword Jaccard similarity. The match (if good enough) is
 * injected into the system prompt as a worked example: "When a customer
 * asked X last time, you called these tools in this order — they were
 * happy with the outcome." The LLM doesn't blindly replay — it adapts
 * the pattern, swapping out parameters as needed.
 *
 * After 3+ successful invocations of similar workflows we promote the
 * pattern to a permanent skill .md file under <dataDir>/skills/, so it
 * becomes part of the universal toolbelt.
 *
 * Storage: workflows table in the existing SQLite DB (or Postgres if
 * MUASSIS_MODE=control-plane). Schema is created lazily on first write
 * so we don't need a migration step.
 */
export interface ToolCallRecord {
    name: string;
    args: Record<string, unknown>;
}
export interface WorkflowRecord {
    id: string;
    tenant_id: string;
    user_message: string;
    keywords: string;
    intent: string;
    tool_sequence: string;
    response_excerpt: string;
    invocation_count: number;
    last_invoked_at: string;
    created_at: string;
}
/**
 * Record a successful tool-using turn as a workflow. Either creates a
 * new row or bumps invocation_count on the closest existing match (so
 * "fetch latest AI news" + "what's today's AI news" merge into one
 * recipe rather than fragmenting).
 */
export declare function recordWorkflow(params: {
    tenantId: string;
    userMessage: string;
    intent: string;
    toolSequence: ToolCallRecord[];
    responseExcerpt: string;
}): Promise<void>;
/**
 * Look up the closest prior workflow for an incoming message. Returns
 * formatted prompt-injection text, or null if no match crosses the
 * keyword-overlap threshold.
 */
export declare function recallWorkflow(params: {
    tenantId: string;
    userMessage: string;
    intent?: string;
}): Promise<string | null>;
//# sourceMappingURL=recorder.d.ts.map