"use strict";
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2024-2026 Gracker (Chris)
// This file is part of SmartPerfetto. See LICENSE for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.StreamingUpdateType = exports.SSEEventType = exports.CompletenessLevel = exports.SQLResultStatus = exports.AnalysisState = void 0;
/**
 * Analysis System Type Definitions
 *
 * Core types for the AI-powered trace analysis system
 */
// ============================================================================
// Enums
// ============================================================================
/**
 * Analysis state machine states
 */
var AnalysisState;
(function (AnalysisState) {
    AnalysisState["IDLE"] = "idle";
    AnalysisState["GENERATING_SQL"] = "generating_sql";
    AnalysisState["EXECUTING_SQL"] = "executing_sql";
    AnalysisState["VALIDATING_RESULT"] = "validating_result";
    AnalysisState["RETRYING"] = "retrying";
    AnalysisState["COMPLETED"] = "completed";
    AnalysisState["FAILED"] = "failed";
})(AnalysisState || (exports.AnalysisState = AnalysisState = {}));
/**
 * SQL execution result status
 */
var SQLResultStatus;
(function (SQLResultStatus) {
    SQLResultStatus["SUCCESS"] = "success";
    SQLResultStatus["SYNTAX_ERROR"] = "syntax_error";
    SQLResultStatus["RUNTIME_ERROR"] = "runtime_error";
    SQLResultStatus["EMPTY_RESULT"] = "empty_result";
    SQLResultStatus["TIMEOUT"] = "timeout";
})(SQLResultStatus || (exports.SQLResultStatus = SQLResultStatus = {}));
/**
 * Result completeness evaluation
 */
var CompletenessLevel;
(function (CompletenessLevel) {
    CompletenessLevel["INSUFFICIENT"] = "insufficient";
    CompletenessLevel["PARTIAL"] = "partial";
    CompletenessLevel["COMPLETE"] = "complete";
    CompletenessLevel["UNCERTAIN"] = "uncertain";
})(CompletenessLevel || (exports.CompletenessLevel = CompletenessLevel = {}));
// ============================================================================
// SSE Event Types
// ============================================================================
/**
 * SSE Event Type Enum
 *
 * Centralized definition of all SSE event types to avoid string literals
 * scattered across the codebase. This improves type safety and makes
 * refactoring easier.
 *
 * Usage:
 *   import { SSEEventType } from '../types/analysis';
 *   emitSSE(sessionId, { type: SSEEventType.PROGRESS, ... });
 */
var SSEEventType;
(function (SSEEventType) {
    // === Connection Events ===
    SSEEventType["CONNECTED"] = "connected";
    // === Progress Events ===
    SSEEventType["PROGRESS"] = "progress";
    // === SQL Events ===
    SSEEventType["SQL_GENERATED"] = "sql_generated";
    SSEEventType["SQL_EXECUTED"] = "sql_executed";
    // === Step Events ===
    SSEEventType["STEP_COMPLETED"] = "step_completed";
    // === Skill Events ===
    SSEEventType["SKILL_SECTION"] = "skill_section";
    SSEEventType["SKILL_DIAGNOSTICS"] = "skill_diagnostics";
    SSEEventType["SKILL_LAYERED_RESULT"] = "skill_layered_result";
    /** @deprecated Use SKILL_LAYERED_RESULT instead */
    SSEEventType["SKILL_DATA"] = "skill_data";
    // === Agent Events ===
    SSEEventType["WORKER_THOUGHT"] = "worker_thought";
    SSEEventType["THOUGHT"] = "thought";
    SSEEventType["FINDING"] = "finding";
    SSEEventType["ANSWER_TOKEN"] = "answer_token";
    SSEEventType["CONCLUSION"] = "conclusion";
    // === Circuit Breaker Events ===
    SSEEventType["CIRCUIT_BREAKER"] = "circuit_breaker";
    // === Terminal Events ===
    SSEEventType["SNAPSHOT_CREATED"] = "snapshot_created";
    SSEEventType["ANALYSIS_COMPLETED"] = "analysis_completed";
    SSEEventType["ERROR"] = "error";
    // === v2.0 DataEnvelope Events ===
    SSEEventType["DATA"] = "data";
})(SSEEventType || (exports.SSEEventType = SSEEventType = {}));
/**
 * Streaming update types from AgentRuntime
 * These are internal event types before SSE conversion
 */
var StreamingUpdateType;
(function (StreamingUpdateType) {
    StreamingUpdateType["PROGRESS"] = "progress";
    StreamingUpdateType["FINDING"] = "finding";
    StreamingUpdateType["SKILL_LAYERED_RESULT"] = "skill_layered_result";
    /** @deprecated Use SKILL_LAYERED_RESULT instead. Will be removed in v3.0 */
    StreamingUpdateType["SKILL_DATA"] = "skill_data";
    StreamingUpdateType["DATA"] = "data";
    StreamingUpdateType["CONCLUSION"] = "conclusion";
    StreamingUpdateType["ERROR"] = "error";
    StreamingUpdateType["WORKER_THOUGHT"] = "worker_thought";
    StreamingUpdateType["THOUGHT"] = "thought";
})(StreamingUpdateType || (exports.StreamingUpdateType = StreamingUpdateType = {}));
//# sourceMappingURL=analysis.js.map