import type { AppFlags } from '@cc-switch/sdk';
import type { Request, Response, NextFunction } from 'express';
export type { McpServerSpec, AppFlags } from '@cc-switch/sdk';
/**
 * MCP 服务器创建输入类型
 * 用于 createMcpServer 方法的参数
 */
export interface CreateMcpServerInput {
    name: string;
    server: import('@cc-switch/sdk').McpServerSpec;
    description?: string;
    apps?: Partial<AppFlags>;
}
/**
 * MCP 服务器更新输入类型
 * 用于 updateMcpServer 方法的参数
 */
export interface UpdateMcpServerInput {
    name?: string;
    server?: import('@cc-switch/sdk').McpServerSpec;
    description?: string;
    apps?: Partial<AppFlags>;
}
export interface Session {
    agentId: string;
    workspacePath: string;
    outputBuffer: string;
    flushTimer: NodeJS.Timeout | null;
    flushInFlight: Promise<void> | null;
    seq: number;
}
export interface SkillPackage {
    downloadUrl?: string;
    fileName?: string;
    sha256?: string;
    skillName?: string;
}
export interface McpPayload {
    id?: string;
    name: string;
    transport?: string;
    command?: string;
    url?: string;
    args?: string[];
    env?: Record<string, string>;
    enabled?: boolean;
    installedAt?: string;
}
export interface McpServerConfig {
    type?: string;
    command?: string;
    url?: string;
    args?: string[];
    env?: Record<string, string>;
    headers?: Record<string, string>;
}
export interface McpServerInput {
    name: string;
    server: unknown;
    description?: string;
    apps?: SdkApps;
}
export interface LegacyMcpStateItem {
    id: string;
    name: string;
    transport: string;
    command: string;
    url: string;
    args: string[];
    env: Record<string, string>;
    enabled: boolean;
    apps?: SdkApps;
    installedAt: string;
}
export interface Skill {
    sourceDir?: string;
    directory?: string;
    filePath?: string;
    name?: string;
    description?: string;
    apps?: SdkApps;
    id?: string;
    installedAt?: string | number;
}
export interface LegacySkillStateItem {
    id: string;
    name: string;
    fileName: string;
    filePath: string;
    bytes: number;
    apps?: SdkApps;
    installedAt: string;
}
export interface SdkApps {
    acode?: boolean;
    claude?: boolean;
    claudecode?: boolean;
    codex?: boolean;
    gemini?: boolean;
    opencode?: boolean;
    openclaw?: boolean;
}
export interface InstanceState {
    initialized: boolean;
    skills: LegacySkillStateItem[];
    mcpServers: LegacyMcpStateItem[];
    enabledTools: string[];
    toolStatus: Record<string, ToolInstallStatus>;
    skillEnabled: boolean;
    mcpEnabled: boolean;
    updatedAt: string | null;
}
export interface ToolInstallStatus {
    tool: string;
    installed: boolean;
    executable: string | null;
    version: string | null;
    installing: boolean;
    error: string | null;
    currentStep?: string | null;
    attempts?: ToolInstallAttempt[];
    failure?: ToolInstallFailure | null;
}
export interface ToolInstallAttempt {
    step: string;
    label: string;
    command: string | null;
    status: 'running' | 'success' | 'error' | 'skipped';
    startedAt: string;
    finishedAt?: string;
    durationMs?: number;
    stdout?: string;
    stderr?: string;
    error?: string | null;
    code?: string | number | null;
    signal?: string | null;
}
export interface ToolInstallFailure {
    step: string;
    command: string | null;
    message: string;
    stdout?: string;
    stderr?: string;
    code?: string | number | null;
    signal?: string | null;
}
export interface InitLogEntry {
    step: string;
    status: 'pending' | 'running' | 'success' | 'error' | 'skipped';
    message: string;
    timestamp: string;
    details?: Record<string, unknown>;
}
export interface AiSourceApplyPayload {
    agentId?: string;
    template?: Record<string, unknown> | null;
    acodeTemplateId?: string | null;
    claudecodeTemplateId?: string | null;
    codexTemplateId?: string | null;
    opencodeTemplateId?: string | null;
    acode?: Record<string, unknown> | null;
    claudecode?: Record<string, unknown> | null;
    codex?: Record<string, unknown> | null;
    opencode?: Record<string, unknown> | null;
}
export interface CcSwitchAppPaths {
    runtimeHome: string;
    acodeConfigFile: string;
    acodeSkillsDir: string;
    claudeConfigFile: string;
    claudeMcpConfigFile: string;
    claudeSkillsDir: string;
    codexConfigFile: string;
    codexSkillsDir: string;
    opencodeConfigFile: string;
    opencodeSkillsDir: string;
}
export interface DownloadResult {
    fileName: string;
    outputPath: string;
    bytes: number;
}
export type RequestHandler = (req: Request, res: Response, next: NextFunction) => void | Promise<void>;
export interface CallbackResponse {
    ok: boolean;
    [key: string]: unknown;
}
export interface InitResult {
    ok: boolean;
    agentId: string;
    workspacePath: string;
    initRoot: string;
    enabledTools: string[];
    toolStatus?: Record<string, ToolInstallStatus>;
    logs?: InitLogEntry[];
    skill: {
        enabled: boolean;
        packagePresent: boolean;
        installedCount?: number;
        installed?: LegacySkillStateItem[];
    };
    mcp: {
        enabled: boolean;
        configPath: string | null;
        installedCount?: number;
    };
    adapterResult?: unknown;
    installed?: {
        skills: LegacySkillStateItem[];
        mcpServers: LegacyMcpStateItem[];
    };
}
export interface SyncStateResult {
    state: InstanceState;
    configPath: string;
    skills: LegacySkillStateItem[];
    mcpServers: LegacyMcpStateItem[];
}
export interface AdapterResult {
    ok: boolean;
    adapter: string;
    action: string;
    agentId: string;
    payload: unknown;
    paths: CcSwitchAppPaths;
    snapshot: {
        skills: number;
        mcpServers: number;
    };
}
export interface PersistedSession {
    sessionId: string;
    agentId: string;
    workspacePath: string;
    command: string;
    startedAt: string;
    status: 'running' | 'stopped';
    runtimeStatus?: string;
    runtimeActionType?: string;
    runtimeActionLabel?: string;
    runtimeActionDetail?: string;
    pid?: number;
    providerSessionId?: string;
    mode?: 'sdk';
    idleInputAutoCommand?: string;
    nonInputAutoCommand?: string;
}
export interface SessionsListResponse {
    ok: boolean;
    active: Array<{
        sessionId: string;
        agentId: string;
        workspacePath: string;
        status: string;
        runtimeStatus?: string;
        runtimeActionType?: string;
        runtimeActionLabel?: string;
        runtimeActionDetail?: string;
        startedAt: string | null;
    }>;
    persisted: PersistedSession[];
}
export interface RecoverSessionRequest {
    agentId: string;
    workspacePath?: string;
    command?: string;
    idleInputAutoCommand?: string;
    nonInputAutoCommand?: string;
}
export interface RecoverSessionResult {
    ok: boolean;
    sessionId: string;
    agentId: string;
    workspacePath: string;
    command: string;
    status: string;
    recovered: boolean;
    mode?: 'sdk';
    message?: string;
}
//# sourceMappingURL=types.d.ts.map