export declare const ACP_PROTOCOL_VERSION: 1;
export declare const ACP_METHODS: {
    readonly INITIALIZE: "initialize";
    readonly SESSION_NEW: "session/new";
    readonly SESSION_PROMPT: "session/prompt";
    readonly SESSION_CLOSE: "session/close";
    readonly SESSION_SET_CONFIG: "session/set_config_option";
    readonly SESSION_SET_MODEL: "session/set_model";
    readonly SESSION_SET_MODE: "session/set_mode";
    readonly SESSION_LOAD: "session/load";
    readonly SESSION_CANCEL: "session/cancel";
    readonly SESSION_UPDATE: "session/update";
    readonly SESSION_REQUEST_PERMISSION: "session/request_permission";
    readonly FS_READ_TEXT_FILE: "fs/read_text_file";
    readonly FS_WRITE_TEXT_FILE: "fs/write_text_file";
};
export type AcpStandardMethod = (typeof ACP_METHODS)[keyof typeof ACP_METHODS];
export declare const ACP_EXTENDED_METHODS: {
    readonly ABORT: "x/abort";
    readonly DREAM: "x/dream";
    readonly AGENTS_LIST: "x/agents.list";
    readonly SOLO_START: "x/solo.start";
    readonly SOLO_STATUS: "x/solo.status";
    readonly SOLO_SELECT: "x/solo.select";
    readonly SOLO_CANCEL: "x/solo.cancel";
    readonly PRODUCT_CREATE: "x/product.create";
    readonly PRODUCT_PLAN: "x/product.plan";
    readonly PRODUCT_CONFIRM: "x/product.confirm";
    readonly PRODUCT_MESSAGE: "x/product.message";
    readonly PRODUCT_RESUME: "x/product.resume";
    readonly PRODUCT_PAUSE: "x/product.pause";
    readonly PRODUCT_CANCEL: "x/product.cancel";
    readonly PRODUCT_ROLLBACK: "x/product.rollback";
    readonly PRODUCT_STATUS: "x/product.status";
    readonly SOLO_SUBSCRIBE: "x/solo.subscribe";
    readonly SOLO_MESSAGE: "x/solo.message";
    readonly SOLO_EVALUATE: "x/solo.evaluate";
    readonly SOLO_SPEC_CHAT: "x/solo.specChat";
    readonly SOLO_SPEC_JUDGE: "x/solo.specJudge";
    readonly WORKFLOW_CHAT: "x/workflow.chat";
    readonly WORKFLOW_MATCH_INTENT: "x/workflow.matchIntent";
    readonly PRODUCT_SUBSCRIBE: "x/product.subscribe";
};
export type AcpExtendedMethod = (typeof ACP_EXTENDED_METHODS)[keyof typeof ACP_EXTENDED_METHODS];
/** qlogicagent 专属扩展套件的协商开关(host 与 agent 双向声明)。存在即启用扩展。 */
export interface AcpQlogicagentCapability {
    /** Extension protocol version, fixed at 1 this round. */
    version: number;
    /** x_* session/update extended events (x_session_info / x_relay / x_skill_instruction). */
    events?: boolean;
    /** x/* extended RPC methods (x/solo.* / x/product.* / x/team.* etc). */
    methods?: boolean;
    /** Multi-agent orchestration (solo / product / team). */
    orchestration?: boolean;
    /** Config options (agent side only). */
    configOptions?: AcpConfigOptionDescriptor[];
}
/** Host (openclaw / AionUI) capabilities declared at initialize. */
export interface AcpHostCapabilities {
    /** Standard ACP (server does not consume this round; typed to match real hosts). */
    fs?: {
        readTextFile?: boolean;
        writeTextFile?: boolean;
    };
    /** Standard ACP (same as above). */
    terminal?: boolean;
    /** Extension master switch. */
    qlogicagent?: AcpQlogicagentCapability;
}
/** Agent capabilities declared in the initialize response. */
export interface AcpAgentCapabilities {
    /** Standard (agent-process reads it; implemented in subproject 2). */
    loadSession?: boolean;
    /** Standard (used when reading third-party agents like copilot). */
    promptCapabilities?: Record<string, unknown>;
    /** Standard (same as above). */
    mcpCapabilities?: Record<string, unknown>;
    /** Standard (same as above). */
    sessionCapabilities?: Record<string, unknown>;
    /** Extension master switch. */
    qlogicagent?: AcpQlogicagentCapability;
}
export interface AcpConfigOptionDescriptor {
    name: string;
    type: "string" | "boolean" | "number" | "enum";
    values?: string[];
    description?: string;
}
export interface AcpInitializeParams {
    protocolVersion: number | string;
    clientInfo?: {
        name: string;
        version: string;
    };
    clientCapabilities?: AcpHostCapabilities;
}
export interface AcpInitializeResult {
    protocolVersion: number;
    agentInfo: {
        name: string;
        version: string;
    };
    agentCapabilities?: AcpAgentCapabilities;
}
export interface AcpSessionMeta {
    projectId?: string;
    sessionType?: string;
    groupKey?: string;
    groupName?: string;
    permissions?: Record<string, unknown>;
    reasoning?: {
        effort?: string;
    };
    /** Runtime turn-config tweaks applied via session/set_config_option. */
    temperature?: number;
    maxRounds?: number;
}
export interface AcpSessionNewParams {
    /** Working directory for the session (standard ACP field from host). */
    cwd?: string;
    /** MCP servers to inject into this session. */
    mcpServers?: Array<{
        name: string;
        uri?: string;
        command?: string;
        args?: string[];
    }>;
    /** Optional session ID (host-assigned). If omitted, agent generates one. */
    sessionId?: string;
    /** Resume: fork an existing session into a new one */
    resumeSessionId?: string;
    forkSession?: boolean;
    /** Per-session context supplement (no standard ACP home). Inherited by every session/prompt. */
    _meta?: AcpSessionMeta;
}
export interface AcpSessionLoadParams {
    sessionId: string;
    /** Working directory for the resumed session (standard ACP field). */
    cwd?: string;
}
/** A selectable permission mode advertised to the host (standard ACP). */
export interface AcpMode {
    id: string;
    name: string;
    description?: string;
}
/** Current mode + the full set the host may switch between (standard ACP). */
export interface AcpSessionModeState {
    currentModeId: string;
    availableModes: AcpMode[];
}
export interface AcpSessionNewResult {
    sessionId: string;
    /** Permission modes the host may switch between (standard ACP). */
    modes?: AcpSessionModeState;
}
export interface AcpSessionPromptParams {
    sessionId: string;
    /** User prompt content blocks (standard ACP field). */
    prompt: AcpContentBlock[];
    /** Per-turn context overrides (permissions/reasoning/mcpServers/...), merged over session _meta. */
    _meta?: AcpSessionMeta;
}
export interface AcpSessionPromptResult {
    /** Stop reason (required by ACP standard). */
    stopReason: AcpStopReason;
    /** Token usage for this turn. */
    usage?: AcpUsage;
    /** Model that actually ran the turn (agent-resolved). Lets the host attribute
     *  usage to the real model instead of falling back to "unknown" when no host
     *  override was supplied. Rides the prompt response alongside usage. */
    model?: string;
    /** Provider that actually ran the turn (agent-resolved). */
    provider?: string;
}
export interface AcpSessionCloseParams {
    sessionId: string;
}
export interface AcpSessionCancelParams {
    sessionId: string;
    /** Turn to cancel. If omitted, the agent cancels the active turn. */
    turnId?: string;
}
export interface AcpSessionSetConfigParams {
    sessionId: string;
    option: string;
    value: unknown;
}
export type AcpContentBlock = {
    type: "text";
    text: string;
} | {
    type: "image";
    url: string;
    mimeType?: string;
} | {
    type: "video";
    url: string;
    mimeType?: string;
} | {
    type: "audio";
    url: string;
    mimeType?: string;
} | {
    type: "file";
    fileId: string;
    mimeType?: string;
    size?: number;
};
/**
 * The `session/update` notification params.
 * Standard format: { sessionId, update: { sessionUpdate: "<type>", ...payload } }
 */
export interface AcpSessionUpdateNotification {
    sessionId: string;
    update: {
        sessionUpdate: AcpSessionUpdateType;
        [key: string]: unknown;
    };
}
export declare const ACP_SESSION_UPDATE_TYPES: {
    readonly USER_MESSAGE_CHUNK: "user_message_chunk";
    readonly AGENT_MESSAGE_CHUNK: "agent_message_chunk";
    readonly AGENT_THOUGHT_CHUNK: "agent_thought_chunk";
    readonly TOOL_CALL: "tool_call";
    readonly TOOL_CALL_UPDATE: "tool_call_update";
    readonly PLAN: "plan";
    readonly USAGE_UPDATE: "usage_update";
    readonly CONFIG_OPTION_UPDATE: "config_option_update";
    readonly SESSION_INFO_UPDATE: "session_info_update";
    readonly AVAILABLE_COMMANDS_UPDATE: "available_commands_update";
    readonly CURRENT_MODE_UPDATE: "current_mode_update";
};
export type AcpStandardSessionUpdateType = (typeof ACP_SESSION_UPDATE_TYPES)[keyof typeof ACP_SESSION_UPDATE_TYPES];
export declare const ACP_EXTENDED_SESSION_UPDATE_TYPES: {
    readonly X_SKILL_INSTRUCTION: "x_skill_instruction";
    readonly X_SESSION_INFO: "x_session_info";
    /** Generic passthrough for turn-scoped events with no specific ACP mapping (lossless relay). */
    readonly X_RELAY: "x_relay";
};
export type AcpExtendedSessionUpdateType = (typeof ACP_EXTENDED_SESSION_UPDATE_TYPES)[keyof typeof ACP_EXTENDED_SESSION_UPDATE_TYPES];
export type AcpSessionUpdateType = AcpStandardSessionUpdateType | AcpExtendedSessionUpdateType;
export interface AcpAgentMessageChunkPayload {
    text: string;
}
export interface AcpAgentThoughtChunkPayload {
    text: string;
}
export interface AcpToolCallPayload {
    callId: string;
    toolName: string;
    arguments: string;
    /** Whether the tool call is streaming (partial arguments) */
    streaming?: boolean;
}
export interface AcpToolCallUpdatePayload {
    callId: string;
    toolName: string;
    /** Tool execution result (text) */
    result?: string;
    /** Tool execution error */
    error?: string;
    /** Whether the tool call was approved and executed */
    status: "completed" | "failed" | "rejected";
}
export interface AcpPlanPayload {
    steps: Array<{
        description: string;
        status: "pending" | "in_progress" | "done" | "skipped";
    }>;
}
export interface AcpUsageUpdatePayload {
    usage: AcpUsage;
}
export interface AcpConfigOptionUpdatePayload {
    option: string;
    value: unknown;
}
export interface AcpEndTurnPayload {
    stopReason: AcpStopReason;
    usage?: AcpUsage;
}
export interface AcpXSkillInstructionPayload {
    skillId: string;
    instruction: string;
}
export interface AcpXSessionInfoPayload {
    sessionId: string;
    projectId?: string;
    provider?: string;
    model?: string;
    metadata?: Record<string, unknown>;
}
export interface AcpPermissionRequestParams {
    sessionId: string;
    permissionId: string;
    toolCall: {
        toolCallId: string;
        title: string;
        rawInput: Record<string, unknown>;
    };
    message?: string;
    category?: string;
    options: AcpPermissionOption[];
}
export interface AcpPermissionOption {
    optionId: string;
    name: string;
    kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
}
export interface AcpPermissionRequestResult {
    optionId: string;
}
export interface AcpFsReadTextFileParams {
    path: string;
    startLine?: number;
    endLine?: number;
}
export interface AcpFsReadTextFileResult {
    content: string;
    totalLines: number;
}
export interface AcpFsWriteTextFileParams {
    path: string;
    content: string;
    createDirectories?: boolean;
}
export interface AcpFsWriteTextFileResult {
    bytesWritten: number;
}
export interface AcpUsage {
    inputTokens: number;
    outputTokens: number;
    cacheReadTokens?: number;
    cacheWriteTokens?: number;
    totalCost?: number;
}
export type AcpStopReason = "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
export interface AcpJsonRpcRequest {
    jsonrpc: "2.0";
    method: string;
    params?: Record<string, unknown>;
    id: string | number;
}
export interface AcpJsonRpcNotification {
    jsonrpc: "2.0";
    method: string;
    params?: Record<string, unknown>;
}
export interface AcpJsonRpcResponse {
    jsonrpc: "2.0";
    id: string | number;
    result?: unknown;
    error?: AcpJsonRpcError;
}
export interface AcpJsonRpcError {
    code: number;
    message: string;
    data?: unknown;
}
export type AcpJsonRpcMessage = AcpJsonRpcRequest | AcpJsonRpcResponse | AcpJsonRpcNotification;
export declare function isAcpJsonRpcRequest(msg: unknown): msg is AcpJsonRpcRequest;
export declare function isAcpJsonRpcNotification(msg: unknown): msg is AcpJsonRpcNotification;
export declare function isAcpJsonRpcResponse(msg: unknown): msg is AcpJsonRpcResponse;
export declare function parseAcpMessage(raw: string): AcpJsonRpcMessage | null;
/** Check if a sessionUpdate type is a standard ACP v1 type */
export declare function isStandardSessionUpdateType(type: string): type is AcpStandardSessionUpdateType;
/** Check if a sessionUpdate type is an x_ extended type */
export declare function isExtendedSessionUpdateType(type: string): type is AcpExtendedSessionUpdateType;
