import type { MastraDBMessage } from '@mastra/core/agent';
/**
 * Select which extraction instructions to use based on environment variable.
 * Set OM_USE_LEGACY_PROMPT=1 to use the smaller Jan 7 prompt for A/B testing.
 * Set OM_USE_CONDENSED_PROMPT=1 to use the new condensed V3 prompt.
 */
export declare const OBSERVER_EXTRACTION_INSTRUCTIONS: string;
/**
 * Base output format for Observer (without patterns section)
 */
export declare const OBSERVER_OUTPUT_FORMAT_BASE = "Use priority levels:\n- \uD83D\uDD34 High: explicit user facts, preferences, goals achieved, critical context\n- \uD83D\uDFE1 Medium: project details, learned information, tool results\n- \uD83D\uDFE2 Low: minor details, uncertain observations\n\nGroup related observations (like tool sequences) by indenting:\n* \uD83D\uDFE1 (14:33) Agent debugging auth issue\n  * -> ran git status, found 3 modified files\n  * -> viewed auth.ts:45-60, found missing null check\n  * -> applied fix, tests now pass\n\nGroup observations by date, then list each with 24-hour time.\n\n<observations>\nDate: Dec 4, 2025\n* \uD83D\uDD34 (14:30) User prefers direct answers\n* \uD83D\uDFE1 (14:31) Working on feature X\n* \uD83D\uDFE2 (14:32) User might prefer dark mode\n\nDate: Dec 5, 2025\n* \uD83D\uDFE1 (09:15) Continued work on feature X\n</observations>\n\n<current-task>\nState the current task(s) explicitly. Can be single or multiple:\n- Primary: What the agent is currently working on\n- Secondary: Other pending tasks (mark as \"waiting for user\" if appropriate)\n\nIf the agent started doing something without user approval, note that it's off-task.\n</current-task>\n\n<suggested-response>\nHint for the agent's immediate next message. Examples:\n- \"I've updated the navigation model. Let me walk you through the changes...\"\n- \"The assistant should wait for the user to respond before continuing.\"\n- Call the view tool on src/example.ts to continue debugging.\n</suggested-response>";
/**
 * The guidelines for the Observer.
 * This is exported so the Reflector can reference them.
 */
export declare const OBSERVER_GUIDELINES: string;
/**
 * Build the complete observer system prompt.
 * @param multiThread - Whether this is for multi-thread batched observation (default: false)
 */
export declare function buildObserverSystemPrompt(multiThread?: boolean): string;
/**
 * Observer Agent System Prompt (default - for backwards compatibility)
 *
 * This prompt instructs the Observer to extract observations from message history.
 * The observations become the agent's "subconscious memory" - the ONLY information
 * the main agent will have about past interactions.
 */
export declare const OBSERVER_SYSTEM_PROMPT: string;
/**
 * Result from the Observer agent
 */
export interface ObserverResult {
    /** The extracted observations in markdown format */
    observations: string;
    /** The current task extracted from observations (for thread metadata) */
    currentTask?: string;
    /** Suggested continuation message for the Actor */
    suggestedContinuation?: string;
    /** Raw output from the model (for debugging) */
    rawOutput?: string;
}
/**
 * Format messages for the Observer's input.
 * Includes timestamps for temporal context.
 */
export declare function formatMessagesForObserver(messages: MastraDBMessage[], options?: {
    maxPartLength?: number;
}): string;
/**
 * Format messages from multiple threads for batched observation.
 * Each thread's messages are wrapped in a <thread id="..."> block.
 */
export declare function formatMultiThreadMessagesForObserver(messagesByThread: Map<string, MastraDBMessage[]>, threadOrder: string[]): string;
/**
 * Build the prompt for multi-thread batched observation.
 */
export declare function buildMultiThreadObserverPrompt(existingObservations: string | undefined, messagesByThread: Map<string, MastraDBMessage[]>, threadOrder: string[]): string;
/**
 * Result from parsing multi-thread Observer output
 */
export interface MultiThreadObserverResult {
    /** Results per thread */
    threads: Map<string, ObserverResult>;
    /** Raw output from the model (for debugging) */
    rawOutput: string;
}
/**
 * Parse multi-thread Observer output to extract per-thread results.
 */
export declare function parseMultiThreadObserverOutput(output: string): MultiThreadObserverResult;
/**
 * Build the full prompt for the Observer agent.
 * Includes emphasis on the most recent user message for priority handling.
 */
export declare function buildObserverPrompt(existingObservations: string | undefined, messagesToObserve: MastraDBMessage[], options?: {
    skipContinuationHints?: boolean;
}): string;
/**
 * Parse the Observer's output to extract observations, current task, and suggested response.
 * Uses XML tag parsing for structured extraction.
 */
export declare function parseObserverOutput(output: string): ObserverResult;
/**
 * Parsed result from XML memory section
 */
interface ParsedMemorySection {
    observations: string;
    currentTask: string;
    suggestedResponse: string;
}
/**
 * Parse XML tags from observer/reflector output.
 * Extracts content from <observations>, <current-task>, and <suggested-response> tags.
 */
export declare function parseMemorySectionXml(content: string): ParsedMemorySection;
/**
 * Check if observations contain a Current Task section.
 * Supports both XML format and legacy markdown format.
 */
export declare function hasCurrentTaskSection(observations: string): boolean;
/**
 * Extract the Current Task content from observations.
 */
export declare function extractCurrentTask(observations: string): string | null;
/**
 * Optimize observations for token efficiency before presenting to the Actor.
 *
 * This removes:
 * - Non-critical emojis (🟡 and 🟢, keeping only 🔴)
 * - Semantic tags [label, label]
 * - Arrow indicators (->)
 * - Extra whitespace
 *
 * The full format is preserved in storage for analysis.
 */
export declare function optimizeObservationsForContext(observations: string): string;
export {};
//# sourceMappingURL=observer-agent.d.ts.map