/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import * as grpc from '@grpc/grpc-js';
import type { Message, TaskState, AgentCard } from '@a2a-js/sdk';
import type { SendMessageResult } from './a2a-client-manager.js';
export declare const AUTH_REQUIRED_MSG = "[Authorization Required] The agent has indicated it requires authorization to proceed. Please follow the agent's instructions.";
/**
 * Reassembles incremental A2A streaming updates into a coherent result.
 * Shows sequential status/messages followed by all reassembled artifacts.
 */
export declare class A2AResultReassembler {
    private messageLog;
    private artifacts;
    private artifactChunks;
    /**
     * Processes a new chunk from the A2A stream.
     */
    update(chunk: SendMessageResult): void;
    private appendStateInstructions;
    private pushMessage;
    /**
     * Returns a human-readable string representation of the current reassembled state.
     */
    toString(): string;
}
/**
 * Extracts a human-readable text representation from a Message object.
 * Handles Text, Data (JSON), and File parts.
 */
export declare function extractMessageText(message: Message | undefined): string;
/**
 * Normalizes an agent card by ensuring it has the required properties
 * and resolving any inconsistencies between protocol versions.
 */
export declare function normalizeAgentCard(card: unknown): AgentCard;
/**
 * Returns gRPC channel credentials based on the URL scheme.
 */
export declare function getGrpcCredentials(url: string): grpc.ChannelCredentials;
/**
 * Returns gRPC channel options to ensure SSL/authority matches the original hostname
 * when connecting via a pinned IP address.
 */
export declare function getGrpcChannelOptions(hostname: string): Record<string, unknown>;
/**
 * Resolves a hostname to its IP address and validates it against SSRF.
 * Returns the pinned IP-based URL and the original hostname.
 */
export declare function pinUrlToIp(url: string, agentName: string): Promise<{
    pinnedUrl: string;
    hostname: string;
}>;
/**
 * Splts an agent card URL into a baseUrl and a standard path if it already
 * contains '.well-known/agent-card.json'.
 */
export declare function splitAgentCardUrl(url: string): {
    baseUrl: string;
    path?: string;
};
/**
 * Extracts contextId and taskId from a Message, Task, or Update response.
 * Follows the pattern from the A2A CLI sample to maintain conversational continuity.
 */
export declare function extractIdsFromResponse(result: SendMessageResult): {
    contextId?: string;
    taskId?: string;
    clearTaskId?: boolean;
};
/**
 * Returns true if the given state is a terminal state for a task.
 */
export declare function isTerminalState(state: TaskState | undefined): boolean;
