/**
 * Agent MCP Client 类型定义
 */
export interface AgentConfig {
    roleName: string;
    agentId?: string;
    projectName: string;
    workspacePath: string;
    prompt: string;
    describe: string;
}
/**
 * YAML 角色配置
 */
export interface YmlAgentRole {
    name: string;
    path: string;
    project: string;
    description: string;
    prompt: string;
    mcp?: {
        "wait-reply-timeout-ms"?: number;
        "timeout-default-message"?: string;
        [key: string]: unknown;
    };
}
export interface ServerConfig {
    serverUrl: string;
    heartbeatInterval: number;
    heartbeatTimeout?: number;
    reconnectInterval: number;
    /**
     * 最大重连次数。
     * -1 表示无限重试。
     */
    maxReconnectAttempts: number;
    /**
     * 调度器下发给 runtime bridge 的访问令牌，MCP HTTP 调用会随请求携带。
     */
    runtimeAccessToken?: string;
    runtimeAccessTokenExpiresAt?: string;
    /**
     * 运行时令牌归属用户 ID，用于 bridge 按 userId + serverIp 读取本地令牌。
     */
    userId?: string;
    /**
     * 当前机器 runtime-bridge 地址；当 runtimeAccessToken 缺失时用于向 bridge 申请。
     */
    runtimeBridgeBaseUrl?: string;
    /**
     * 可选：MCP HTTP 调用地址。
     * 支持完整地址（推荐），若仅提供主机地址会自动补全为 /mcp/call。
     */
    mcpHttpUrl?: string;
    /**
     * 后台 runtime token 主动刷新间隔，毫秒。用于在 24h 服务端 TTL 过期前稳定续期。
     */
    runtimeTokenRefreshIntervalMs?: number;
    /**
     * MCP HTTP 请求硬超时，毫秒。避免 fetch 半开或服务端卡住导致工具调用永久挂起。
     */
    mcpHttpRequestTimeoutMs?: number;
    /**
     * MCP HTTP 请求失败重试间隔，毫秒。默认 5000（5 秒）。
     */
    mcpRetryIntervalMs?: number;
    /**
     * MCP HTTP 请求失败累计最大重试时间，毫秒。默认 30000（30 秒）。
     * 设置为 0 可禁用重试。
     */
    mcpRetryMaxAccumulatedMs?: number;
    /**
     * 最近一次已尝试强制刷新的被拒绝 runtime token。
     */
    lastForceRefreshAttemptedForToken?: string;
    /**
     * 当前共享 runtime token 刷新任务。
     * 主流程：HTTP 与 WebSocket 共用该 promise，避免同一 MCP 进程内并发刷新轮换互相作废 token。
     */
    runtimeAccessTokenRefreshPromise?: Promise<void>;
    /**
     * 当前共享刷新任务是否为强制刷新。
     */
    runtimeAccessTokenRefreshForce?: boolean;
}
export interface RuntimeLaunchBinding {
    ok?: boolean;
    agentId?: string;
    workspacePath?: string;
    runtimeAccessToken?: string;
    runtimeAccessTokenExpiresAt?: string;
    userId?: string;
    schedulerBaseUrl?: string;
    serverUrl?: string;
    mcpHttpUrl?: string;
    bindingId?: string;
}
export interface RegisterResult {
    agentId: string;
    displayName: string;
    status: string;
    instanceName?: string;
    projectName?: string;
    workspacePath?: string;
    runtimeStatus?: string;
    runtimeSessionId?: string | null;
}
export interface OnlineUser {
    id: string;
    displayName?: string;
    nickname: string;
    onlineSince: string;
}
export interface OnlineAgent {
    id: string;
    displayName: string;
    roleName: string;
    projectName?: string;
    prompt: string;
    onlineSince: string;
}
export interface OnlineListResponse {
    humans: OnlineUser[];
    agents: OnlineAgent[];
}
export interface GroupRoomInfo {
    id: string;
    projectName: string;
    roomType: "project" | "inner_group" | string;
    scopeRefId: string;
    name: string;
    memberUserIds: string[];
}
export interface GroupRoomsResponse {
    groups: GroupRoomInfo[];
}
export interface GroupMessage {
    msgId: number;
    senderId: string;
    senderName: string;
    projectName?: string;
    roomId?: string;
    content: string;
    timestamp: string;
}
export interface GroupMessagesResponse {
    messages: GroupMessage[];
    currentReadPos: number;
    hasMore: boolean;
}
export interface DirectMessage {
    msgId: string;
    _msgId?: string;
    _requireAck?: boolean;
    callId?: string;
    senderId: string;
    senderName: string;
    receiverId?: string;
    content: string;
    requireReply: boolean;
    prompt?: string;
    timestamp: string;
}
export interface DirectMessagesResponse {
    messages: DirectMessage[];
}
export interface DmHistoryResponse {
    messages: DirectMessage[];
    count: number;
}
export interface GroupHistoryResponse {
    messages: GroupMessage[];
    count: number;
}
export interface UnreadMessagesResult {
    directMessages: DirectMessage[];
    groupMessages: GroupMessage[];
}
export interface FetchUnreadMessagesOptions {
    since?: string;
    blockIfEmpty?: boolean;
    blockTimeoutMs?: number;
    includePipelineTasks?: boolean;
}
export interface SendMessageResult {
    msgId: string | number;
    timestamp: string;
}
export interface SendDmResult {
    msgId?: string;
    timestamp?: string;
    reply?: DirectMessage;
}
export interface WebSocketMessage<T = unknown> {
    type: "GROUP_MSG" | "DM_MSG" | "ONLINE_CHANGE" | "DM_REPLY" | "HEARTBEAT" | "PROFILE_INFO" | "AGENT_STATUS" | "MCP_NODE_LOG" | "MESSAGE_ACK" | "TERMINAL_OUTPUT" | "TERMINAL_STATUS" | "GROUP_READ_RECEIPT" | "DM_READ_RECEIPT";
    data: T;
    timestamp: string;
}
/**
 * PROFILE_INFO 消息类型
 * 用于在 Agent 连接时自动推送 profile 信息
 */
export declare const TYPE_PROFILE_INFO = "PROFILE_INFO";
export type MessageHandler = (message: DirectMessage | GroupMessage) => Promise<string | undefined>;
export interface AgentState {
    agentId: string | null;
    displayName: string | null;
    isConnected: boolean;
    isRegistered: boolean;
}
export interface ProfileInfo {
    id: string;
    displayName: string;
    roleName: string;
    instanceName?: string;
    projectName?: string;
    workspacePath?: string;
    prompt: string;
    globalAgentPrompt?: string;
    defaultCli?: string;
    currentCli?: string;
    runtimeMode?: string;
    runtimeCliCommand?: string | null;
    describe?: string;
    isOnline: boolean;
    runtimeStatus?: string;
    runtimeSessionId?: string | null;
    onlineSince: string | null;
    createdAt: string;
}
export interface HireColleagueArgs {
    projectName?: string;
    roleName?: string;
    newRoleName?: string;
    displayName?: string;
    prompt?: string;
    workspacePath: string;
    myYmlPath?: string;
    myYmlContent?: string;
    runtimeSkillEnabled?: boolean;
    runtimeMcpEnabled?: boolean;
    runtimeCcSwitchEnabledTools?: string;
}
export type HireColleagueBatchItem = HireColleagueArgs;
export interface HireColleaguesBatchArgs {
    projectName?: string;
    items: HireColleagueBatchItem[];
}
export interface RecordTaskChangeArgs {
    taskInstanceId?: string;
    nodeId: string;
    operation: "CREATE" | "UPDATE" | "DELETE" | string;
    targetType: "file" | "content" | string;
    path: string;
    summary?: string;
    beforeHash?: string;
    afterHash?: string;
    metadata?: string;
}
export interface StartTaskRollbackArgs {
    rollbackTaskId: string;
}
export interface FinishTaskRollbackArgs {
    rollbackTaskId: string;
    resultMessage?: string;
}
export interface HiredColleagueResult {
    id: string;
    nickname?: string;
    displayName: string;
    roleName: string;
    projectName?: string;
    workspacePath?: string;
    runtimeBridgeBaseUrl?: string;
    prompt?: string;
    isOnline?: boolean;
    runtimeStatus?: string;
    runtimeSessionId?: string | null;
    runtimeCliCommand?: string;
    runtimeIdleInputAutoCommand?: string;
    runtimeNonInputAutoCommand?: string;
    myYmlPath?: string;
    myYmlContent?: string;
    runtimeSkillEnabled?: boolean;
    runtimeMcpEnabled?: boolean;
    runtimeCcSwitchEnabledTools?: string;
}
export type HireBatchDecisionStatus = "APPROVED" | "REJECTED";
export type HireBatchItemStatus = "CREATED" | "REJECTED" | "CREATE_FAILED";
export interface HireBatchDecision {
    itemId: string;
    approved: boolean;
    reason?: string;
}
export interface HireBatchSummary {
    total: number;
    approved: number;
    rejected: number;
    created: number;
    failed: number;
}
export interface HireBatchItemResult {
    itemId: string;
    decision: HireBatchDecisionStatus;
    status: HireBatchItemStatus;
    reason?: string;
    createdAgent?: HiredColleagueResult;
}
export interface HireBatchResult {
    batchId: string;
    projectName?: string;
    summary: HireBatchSummary;
    results: HireBatchItemResult[];
}
/** MCP 工具名称枚举 */
export type McpToolName = "get_colleague" | "get_group_rooms" | "get_profile" | "get_status" | "hire_colleague" | "hire_colleagues_batch" | "send_group" | "send_private" | "poll_message" | "get_message" | "get_dm_history" | "get_group_history" | "start_listening" | "stop_listening";
/** send_private 工具参数 */
export interface SendPrivateArgs {
    targetId: string;
    content: string;
    waitReply?: boolean;
    replyToCallId?: string;
    timeoutMs?: number;
}
/** send_group 工具参数 */
export interface SendGroupArgs {
    content: string;
    projectName?: string;
    roomId?: string;
}
/** get_dm_history 工具参数 */
export interface GetDmHistoryArgs {
    targetUserId?: string;
    limit?: number;
    since?: string;
}
/** get_group_history 工具参数 */
export interface GetGroupHistoryArgs {
    roomId?: string;
    limit?: number;
    since?: string;
}
/** create_task_instance_comment 工具参数 */
export interface TaskInstanceCommentArgs {
    taskInstanceId: string;
    content: string;
}
/** poll_message 返回结果 */
export interface PollMessageResult {
    directMessages: DirectMessage[];
    groupMessages: GroupMessage[];
    fromBuffer: boolean;
}
/** Agent 运行状态 */
export interface AgentRuntimeState {
    agentId: string | null;
    displayName: string | null;
    projectName: string | null;
    isConnected: boolean;
    isRunning: boolean;
}
/** Agent 动作类型 */
export type AgentActionType = "skill" | "mcp" | "idle" | "edit_file" | "write_file" | "read_file" | "bash" | "search" | "web" | "thinking" | "tool_using";
/** Agent 状态更新消息 */
export interface AgentStatusUpdate {
    agentId: string;
    status: "running" | "starting" | "waiting_input" | "thinking" | "tool_using" | "stopped" | "error";
    actionType?: AgentActionType;
    actionLabel?: string;
    actionDetail?: string;
    actionResult?: string;
    actionId?: string;
    timestamp: string;
}
//# sourceMappingURL=types.d.ts.map