/**
 * InstanceService - Agent 实例初始化服务
 *
 * 负责 Agent 实例的生命周期管理：
 * - 实例根目录、workspace 路径管理
 * - 实例状态持久化
 * - Skill/MCP 包安装流程
 *
 * 注意：此服务属于 Agent 运行时层，不属于 cc-switch-sdk 配置管理层
 */
import type { AppId, InstalledSkill, McpServer } from '@cc-switch/sdk';
import { CcSwitchSdk } from '@cc-switch/sdk';
export interface SkillPackage {
    downloadUrl?: string;
    fileName?: string;
    sha256?: string;
    skillName?: string;
    localPath?: string;
}
export interface McpServerInput {
    id?: string;
    name: string;
    transport?: string;
    command?: string;
    url?: string;
    args?: string[];
    env?: Record<string, string>;
    enabled?: boolean;
}
export interface InstanceOptions {
    skillEnabled?: boolean;
    mcpEnabled?: boolean;
    enabledApps?: AppId[];
    skillPackage?: SkillPackage;
    skillPackages?: SkillPackage[];
    mcpServers?: McpServerInput[];
}
export interface InstanceState {
    initialized: boolean;
    skills: InstalledSkill[];
    mcpServers: McpServer[];
    enabledApps: AppId[];
    skillEnabled: boolean;
    mcpEnabled: boolean;
    updatedAt: string | null;
}
export interface InstanceInitResult {
    ok: boolean;
    instanceId: string;
    workspacePath: string;
    instanceRoot: string;
    enabledApps: AppId[];
    skill: {
        enabled: boolean;
        packagePresent: boolean;
        installedCount?: number;
        installed?: InstalledSkill[];
    };
    mcp: {
        enabled: boolean;
        installedCount?: number;
        installed?: McpServer[];
    };
}
export interface InstancePaths {
    instanceRoot: string;
    stateFile: string;
    skillsDir: string;
    mcpDir: string;
}
export declare class InstanceService {
    private readonly sdk;
    private readonly instanceRoot;
    private readonly workspacePath;
    constructor(sdk: CcSwitchSdk, instanceRoot: string, workspacePath: string);
    private getPaths;
    loadState(): Promise<InstanceState>;
    saveState(state: InstanceState): Promise<InstanceState>;
    private ensureInstanceRoot;
    private toAppFlags;
    initialize(options?: InstanceOptions): Promise<InstanceInitResult>;
    private installSkillPackage;
    private upsertMcpServer;
    getState(): Promise<InstanceState>;
    updateState(partial: Partial<InstanceState>): Promise<InstanceState>;
    reset(): Promise<void>;
}
//# sourceMappingURL=instance-service.d.ts.map