/**
 * @fileoverview A TaskStore implementation backed by the framework's StorageService.
 * This provides persistent task storage that survives server restarts, using
 * whatever storage backend is configured (filesystem, Supabase, SurrealDB, etc.).
 *
 * Use this instead of InMemoryTaskStore when you need task durability.
 *
 * @experimental These APIs are experimental and may change without notice.
 * @module src/mcp-server/tasks/core/storageBackedTaskStore
 */
import type { Request, RequestId, Result } from '@modelcontextprotocol/sdk/types.js';
import type { StorageService } from '../../../storage/core/StorageService.js';
import type { CreateTaskOptions, Task, TaskStore } from './taskTypes.js';
/**
 * Configuration options for StorageBackedTaskStore.
 */
export interface StorageBackedTaskStoreOptions {
    /**
     * Default TTL in milliseconds if not specified in task creation.
     * Set to null for unlimited lifetime.
     * @default null
     */
    defaultTtl?: number | null;
    /**
     * Prefix for storage keys.
     * @default 'tasks'
     */
    keyPrefix?: string;
    /**
     * Page size for listTasks pagination.
     * @default 10
     */
    pageSize?: number;
    /**
     * The tenant ID to use for storage operations.
     * Tasks are stored under this tenant for isolation.
     * @default 'system-tasks'
     */
    tenantId?: string;
}
/**
 * A TaskStore implementation backed by StorageService for persistent task storage.
 *
 * Unlike InMemoryTaskStore, this implementation:
 * - Persists tasks across server restarts
 * - Works with any configured storage backend (filesystem, Supabase, SurrealDB, etc.)
 * - Supports TTL via storage provider options
 *
 * @example
 * ```typescript
 * const taskStore = new StorageBackedTaskStore(storageService, {
 *   tenantId: 'my-app-tasks',
 *   defaultTtl: 3600000, // 1 hour
 * });
 * ```
 *
 * @experimental
 */
export declare class StorageBackedTaskStore implements TaskStore {
    private readonly storage;
    private readonly tenantId;
    private readonly keyPrefix;
    private readonly defaultTtl;
    private readonly pageSize;
    constructor(storage: StorageService, options?: StorageBackedTaskStoreOptions);
    /**
     * Creates a request context for storage operations.
     */
    private createContext;
    /**
     * Generates the storage key for a task.
     */
    private getTaskKey;
    /**
     * Validates that the caller's sessionId matches the stored task's sessionId.
     * Tasks created without a sessionId (legacy/pre-ownership) are accessible by any session.
     * @throws {McpError} Forbidden if sessionId mismatch
     */
    private assertOwnership;
    /**
     * Generates a unique task ID.
     * Uses the framework's idGenerator for consistent ID format.
     */
    private generateTaskId;
    createTask(taskParams: CreateTaskOptions, requestId: RequestId, request: Request, sessionId?: string): Promise<Task>;
    getTask(taskId: string, sessionId?: string): Promise<Task | null>;
    storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result, sessionId?: string): Promise<void>;
    getTaskResult(taskId: string, sessionId?: string): Promise<Result>;
    updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string, sessionId?: string): Promise<void>;
    listTasks(cursor?: string, sessionId?: string): Promise<{
        tasks: Task[];
        nextCursor?: string;
    }>;
    /**
     * Deletes a task from storage.
     * Useful for manual cleanup or testing.
     *
     * @param taskId - The task ID to delete
     */
    deleteTask(taskId: string): Promise<void>;
    /**
     * Clears all tasks from storage.
     * Useful for testing or administrative purposes.
     *
     * WARNING: This deletes ALL tasks for the configured tenant.
     */
    clearAllTasks(): Promise<void>;
}
//# sourceMappingURL=storageBackedTaskStore.d.ts.map