/**
 * Autonomy Service for elizaOS
 *
 * Provides autonomous operation for agents using the Task system,
 * enabling them to think and act independently without external prompts.
 *
 * This service uses the unified Task system for scheduling instead of
 * timer-based loops, which provides:
 * - Database persistence (survives restarts)
 * - Blocking mode (prevents overlapping executions)
 * - Unified task management across all periodic operations
 */
import { type IAgentRuntime, type UUID } from "../types";
import { Service } from "../types/service";
import type { AutonomyStatus } from "./types";
/**
 * Service type constant for autonomy
 */
export declare const AUTONOMY_SERVICE_TYPE: "AUTONOMY";
/**
 * Task name for autonomy thinking
 */
export declare const AUTONOMY_TASK_NAME: "AUTONOMY_THINK";
/**
 * Tags used for autonomy tasks
 */
export declare const AUTONOMY_TASK_TAGS: readonly ["queue", "repeat", "autonomy"];
/**
 * AutonomyService - Manages autonomous agent operation
 *
 * This service uses the Task system to trigger agent thinking
 * in a dedicated room context, separate from user conversations.
 * The task-based approach ensures:
 * - Persistence across restarts
 * - No overlapping executions (blocking mode)
 * - Unified management with other periodic tasks
 */
export declare class AutonomyService extends Service {
    static serviceType: "AUTONOMY";
    static serviceName: string;
    protected isRunning: boolean;
    protected intervalMs: number;
    protected autonomousRoomId: UUID;
    protected autonomousWorldId: UUID;
    private taskRegistered;
    private isThinking;
    protected autonomyEntityId: UUID;
    private consecutiveFailures;
    private nextAllowedThinkAt;
    private thinkCount;
    private getAutonomyMode;
    private getTargetRoomId;
    private getTargetRoomContextText;
    constructor();
    /**
     * Start the autonomy service
     */
    static start(runtime: IAgentRuntime): Promise<AutonomyService>;
    /**
     * Initialize the service
     */
    private initialize;
    /**
     * Register the task worker for autonomous thinking
     */
    private registerAutonomyTaskWorker;
    /**
     * Create the recurring autonomy task
     */
    private createAutonomyTask;
    /**
     * Delete the autonomy task to stop autonomous operation
     */
    private deleteAutonomyTask;
    /**
     * Ensure autonomous world and room exist
     */
    private ensureAutonomousContext;
    private buildEntityNameLookup;
    private readEntityName;
    /**
     * Perform one iteration of autonomous thinking using the full Eliza agent pipeline.
     * This processes the message through:
     * - All registered providers (context gathering)
     * - The LLM generation pipeline (response creation)
     * - Action processing (executing decided actions)
     * - Evaluators (post-response analysis)
     */
    performAutonomousThink(): Promise<void>;
    /**
     * Create a continuous autonomous operation prompt
     */
    private createContinuousPrompt;
    private createTaskPrompt;
    private fillAutonomyTemplate;
    /**
     * Prune old autonomy entries to prevent unbounded growth.
     * Keeps the most recent MAX_AUTONOMY_ENTRIES in each table
     * (memories + messages) and deletes the rest.
     */
    private pruneAutonomyMemories;
    /**
     * Check if autonomy is currently running
     */
    isLoopRunning(): boolean;
    /**
     * Get current loop interval in milliseconds
     */
    getLoopInterval(): number;
    /**
     * Set loop interval (recreates the task with new interval)
     */
    setLoopInterval(ms: number): Promise<void>;
    /**
     * Get the autonomous room ID
     */
    getAutonomousRoomId(): UUID;
    /**
     * Enable autonomy - creates the recurring task
     */
    enableAutonomy(): Promise<void>;
    /**
     * Disable autonomy - deletes the recurring task
     */
    disableAutonomy(): Promise<void>;
    /**
     * Legacy method names for backwards compatibility
     */
    startLoop(): Promise<void>;
    stopLoop(): Promise<void>;
    /**
     * Trigger an autonomous thinking cycle immediately.
     * Useful for testing or manual intervention without waiting for the interval.
     * @returns true if thinking was triggered, false if already thinking or an error occurred
     */
    triggerThinkNow(): Promise<boolean>;
    /**
     * Get current autonomy status
     */
    getStatus(): AutonomyStatus;
    /**
     * Stop the service
     */
    stop(): Promise<void>;
    get capabilityDescription(): string;
}
//# sourceMappingURL=service.d.ts.map