"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.DEFAULT_EVIDENCE = exports.DOMAIN_ALIASES = exports.DEFAULT_CONFIG = exports.AGENT_IDS = void 0;
exports.normalizeDomain = normalizeDomain;
exports.concludeDecision = concludeDecision;
exports.translateStrategy = translateStrategy;
// =============================================================================
// Agent ID Constants
// =============================================================================
exports.AGENT_IDS = {
    FRAME: 'frame_agent',
    CPU: 'cpu_agent',
    MEMORY: 'memory_agent',
    BINDER: 'binder_agent',
    STARTUP: 'startup_agent',
    INTERACTION: 'interaction_agent',
    ANR: 'anr_agent',
    SYSTEM: 'system_agent',
};
exports.DEFAULT_CONFIG = {
    maxRounds: 5,
    maxConcurrentTasks: 3,
    taskTimeoutMs: Number.parseInt(process.env.AGENT_TASK_TIMEOUT_MS || '', 10) || 180000,
    confidenceThreshold: 0.7,
    maxNoProgressRounds: 2,
    maxFailureRounds: 2,
    enableLogging: true,
};
// =============================================================================
// Domain Mappings
// =============================================================================
exports.DOMAIN_ALIASES = {
    gpu: 'frame',
    render: 'frame',
    rendering: 'frame',
    surfaceflinger: 'frame',
    sf: 'frame',
    choreographer: 'frame',
    ui: 'frame',
    input: 'interaction',
    touch: 'interaction',
    interaction: 'interaction',
    binder: 'binder',
    ipc: 'binder',
    lock: 'binder',
    memory: 'memory',
    gc: 'memory',
    art: 'memory',
    startup: 'startup',
    launch: 'startup',
    coldstart: 'startup',
    anr: 'anr',
    systemserver: 'system',
    system: 'system',
    thermal: 'system',
    io: 'system',
    power: 'system',
};
exports.DEFAULT_EVIDENCE = {
    frame: ['jank frames', 'frame durations', 'fps', 'frame timeline'],
    cpu: ['cpu load', 'runqueue latency', 'cpu frequency', 'thread hotspots'],
    binder: ['binder call latency', 'thread blocking', 'lock contention'],
    memory: ['heap usage', 'gc pauses', 'allocation spikes', 'lmk events'],
    startup: ['cold start duration', 'main thread blocking', 'io latency'],
    interaction: ['input latency', 'dispatch delay', 'response time'],
    anr: ['anr traces', 'blocked main thread', 'binder waits'],
    system: ['thermal throttling', 'io stalls', 'system_server workload'],
};
// =============================================================================
// Utility
// =============================================================================
function normalizeDomain(domain) {
    const normalized = domain.toLowerCase();
    return exports.DOMAIN_ALIASES[normalized] || normalized;
}
function concludeDecision(confidence, reasoning) {
    return { strategy: 'conclude', confidence, reasoning };
}
function translateStrategy(strategy) {
    const translations = {
        'continue': '继续分析',
        'deep_dive': '深入分析',
        'pivot': '转向新方向',
        'conclude': '生成结论',
    };
    return translations[strategy] || strategy;
}
//# sourceMappingURL=orchestratorTypes.js.map