/**
 * MCP Tools 공통 타입 정의
 */
import { z } from 'zod';
import type Database from 'better-sqlite3';
import type { SearchEngine } from '../domains/search/algorithms/search-engine.js';
import type { HybridSearchEngine } from '../domains/search/algorithms/hybrid-search-engine.js';
import type { MemoryEmbeddingService } from '../domains/memory/services/memory-embedding-service.js';
import type { ForgettingPolicyService } from '../domains/forgetting/services/forgetting-policy-service.js';
import type { ErrorLoggingService } from '../domains/monitoring/services/error-logging-service.js';
import type { PerformanceAlertService } from '../domains/monitoring/services/performance-alert-service.js';
import type { WriteCoalescingManager } from '../shared/utils/write-coalescing.js';
import type { AnchorManager } from '../domains/anchor/services/anchor/anchor-manager.js';
import type { RelationGraphPort } from '../domains/relation/ports/relation-graph.port.js';
import type { VectorSearchEngine } from '../domains/search/algorithms/vector-search-engine.js';
import type { FailureDetector } from '../domains/monitoring/services/failure-detector.js';
import type { IBatchScheduler } from '../shared/interfaces/batch-scheduler.interface.js';
import type { IConsolidationScoreService } from '../shared/interfaces/consolidation-score.interface.js';
import type { IDatabaseOptimizer } from '../shared/interfaces/database-optimizer.interface.js';
import type { IReflexionWorker } from '../shared/interfaces/reflexion-worker.interface.js';
import type { MetaMemoryService } from '../domains/memory/services/meta-memory-service.js';
import type { IntrospectionScanCache } from '../domains/memory/services/introspection-scan-cache.js';
import { getPerformanceMonitor } from '../domains/monitoring/services/performance-monitor.js';
import type { TelemetryService } from '../domains/telemetry/services/telemetry-service.js';
export interface ToolDefinition {
    name: string;
    description: string;
    inputSchema: z.ZodTypeAny | Record<string, unknown>;
    handler: ToolHandler;
}
/**
 * MCP 도구 실행 컨텍스트
 *
 * 모든 서비스는 optional로 정의되어 있어 하위 호환성을 보장합니다.
 * 부트스트랩 함수를 통해 초기화된 서비스들이 포함됩니다.
 */
export interface ToolContext {
    /** 데이터베이스 인스턴스 */
    db: Database.Database;
    /** 다중 에이전트 시 현재 에이전트/소유자 식별자 (미설정 시 remember/recall 기본값 사용) */
    agentId?: string;
    /** Memori Attribution: 프로세스(에이전트/프로그램) 식별자 (Issue #87) */
    processId?: string;
    /** Memori Attribution: 세션(작업 흐름) 식별자 (Issue #87) */
    sessionId?: string;
    services: {
        /** 기본 텍스트 검색 엔진 */
        searchEngine?: SearchEngine;
        /** 하이브리드 검색 엔진 (텍스트 + 벡터) */
        hybridSearchEngine?: HybridSearchEngine;
        /** 벡터 검색 엔진 (context 미제공 시 getVectorSearchEngine() fallback) */
        vectorSearchEngine?: VectorSearchEngine;
        /** 메모리 임베딩 서비스 */
        embeddingService?: MemoryEmbeddingService;
        /** 망각 정책 서비스 */
        forgettingPolicyService?: ForgettingPolicyService;
        /** 성능 모니터링 서비스 (싱글톤) */
        performanceMonitor?: ReturnType<typeof getPerformanceMonitor>;
        /** 데이터베이스 최적화 서비스 */
        databaseOptimizer?: IDatabaseOptimizer;
        /** 에러 로깅 서비스 */
        errorLoggingService?: ErrorLoggingService;
        /** 성능 알림 서비스 */
        performanceAlertService?: PerformanceAlertService;
        /** 성능 모니터링 통합 서비스 (주석 처리됨, 향후 사용 예정) */
        performanceMonitoringIntegration?: unknown;
        /** 통합 점수 서비스 (기능 플래그에 따라 초기화) */
        consolidationScoreService?: IConsolidationScoreService;
        /** 쓰기 결합 관리자 (기능 플래그에 따라 초기화) */
        writeCoalescingManager?: WriteCoalescingManager;
        /** 앵커 관리자 서비스 */
        anchorManager?: AnchorManager;
        /** 관계 그래프 서비스 */
        relationGraph?: RelationGraphPort;
        /** 실패 감지 서비스 (Phase 2) */
        failureDetector?: FailureDetector;
        /** Reflexion Worker 서비스 (Phase 2) */
        reflexionWorker?: IReflexionWorker;
        /** 메타 메모리 통계 서비스 */
        metaMemoryService?: MetaMemoryService;
        /** 배치 스케줄러 (Triple 추출 등 비동기 작업 등록, context 미제공 시 사용 불가) */
        batchScheduler?: IBatchScheduler;
        /** Issue #21 Phase B: 인트로스펙션 스캔 결과 캐시 */
        introspectionScanCache?: IntrospectionScanCache;
        /** 006: MCP 도구 텔레메트리 (fire-and-forget) */
        telemetryService?: TelemetryService;
    };
}
export type ToolHandler = (params: unknown, context: ToolContext) => Promise<ToolResult>;
export interface ToolResult {
    content: Array<{
        type: 'text';
        text: string;
    }>;
    [key: string]: unknown;
}
export interface ToolError {
    error: string;
    message?: string;
    details?: string;
}
/**
 * 공통 스키마 정의
 */
export declare const CommonSchemas: {
    MemoryId: z.ZodString;
    Content: z.ZodOptional<z.ZodString>;
    Query: z.ZodString;
    MemoryType: z.ZodEnum<["working", "episodic", "semantic", "procedural", "core", "vault"]>;
    PrivacyScope: z.ZodEnum<["private", "team", "public"]>;
    Importance: z.ZodNumber;
    Limit: z.ZodDefault<z.ZodNumber>;
    Tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    Source: z.ZodOptional<z.ZodString>;
    HardDelete: z.ZodDefault<z.ZodBoolean>;
    DryRun: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
    Analyze: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
    CreateIndexes: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
    Key: z.ZodString;
    Value: z.ZodString;
    AlwaysLoad: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
    Immutable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
    TaskGoal: z.ZodOptional<z.ZodString>;
    Steps: z.ZodOptional<z.ZodString>;
    ReflectionNotes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    WorkflowName: z.ZodOptional<z.ZodString>;
    SkillName: z.ZodOptional<z.ZodString>;
    TriggerConditions: z.ZodOptional<z.ZodString>;
    UpdateMode: z.ZodOptional<z.ZodEnum<["replace", "incremental", "versioned"]>>;
    EnableTripleExtraction: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
};
//# sourceMappingURL=types.d.ts.map