//#region src/types/a2a.d.ts
interface PartBase {
  metadata?: {
    [key: string]: any;
  };
}
interface TextPart extends PartBase {
  kind: 'text';
  text: string;
}
interface FileBase {
  name?: string;
  mimeType?: string;
}
interface FileWithBytes extends FileBase {
  bytes: string;
  uri?: never;
}
interface FileWithUri extends FileBase {
  uri: string;
  bytes?: never;
}
interface FilePart extends PartBase {
  kind: 'file';
  file: FileWithBytes | FileWithUri;
}
interface DataPart extends PartBase {
  kind: 'data';
  data: {
    [key: string]: any;
  };
}
type Part = TextPart | FilePart | DataPart;
declare enum TaskState {
  Submitted = "submitted",
  Working = "working",
  InputRequired = "input-required",
  Completed = "completed",
  Canceled = "canceled",
  Failed = "failed",
  Rejected = "rejected",
  AuthRequired = "auth-required",
  Unknown = "unknown",
}
interface AgentCapabilities {
  streaming?: boolean;
  pushNotifications?: boolean;
  stateTransitionHistory?: boolean;
}
interface AgentProvider {
  organization: string;
  url: string;
}
interface AgentSkill {
  id: string;
  name: string;
  description: string;
  tags: string[];
  examples?: string[];
  inputModes?: string[];
  outputModes?: string[];
}
interface SecuritySchemeBase {
  description?: string;
}
interface APIKeySecurityScheme extends SecuritySchemeBase {
  type: 'apiKey';
  in: 'query' | 'header' | 'cookie';
  name: string;
}
interface HTTPAuthSecurityScheme extends SecuritySchemeBase {
  type: 'http';
  scheme: string;
  bearerFormat?: string;
}
interface OAuthFlows {
  authorizationCode?: AuthorizationCodeOAuthFlow;
  clientCredentials?: ClientCredentialsOAuthFlow;
  implicit?: ImplicitOAuthFlow;
  password?: PasswordOAuthFlow;
}
interface AuthorizationCodeOAuthFlow {
  authorizationUrl: string;
  tokenUrl: string;
  refreshUrl?: string;
  scopes: {
    [name: string]: string;
  };
}
interface ClientCredentialsOAuthFlow {
  tokenUrl: string;
  refreshUrl?: string;
  scopes: {
    [name: string]: string;
  };
}
interface ImplicitOAuthFlow {
  authorizationUrl: string;
  refreshUrl?: string;
  scopes: {
    [name: string]: string;
  };
}
interface PasswordOAuthFlow {
  tokenUrl: string;
  refreshUrl?: string;
  scopes: {
    [name: string]: string;
  };
}
interface OAuth2SecurityScheme extends SecuritySchemeBase {
  type: 'oauth2';
  flows: OAuthFlows;
}
interface OpenIdConnectSecurityScheme extends SecuritySchemeBase {
  type: 'openIdConnect';
  openIdConnectUrl: string;
}
type SecurityScheme = APIKeySecurityScheme | HTTPAuthSecurityScheme | OAuth2SecurityScheme | OpenIdConnectSecurityScheme;
interface AgentCard {
  name: string;
  description: string;
  url: string;
  provider?: AgentProvider;
  version: string;
  documentationUrl?: string;
  capabilities: AgentCapabilities;
  securitySchemes?: {
    [scheme: string]: SecurityScheme;
  };
  security?: {
    [scheme: string]: string[];
  }[];
  defaultInputModes: string[];
  defaultOutputModes: string[];
  skills: AgentSkill[];
  supportsAuthenticatedExtendedCard?: boolean;
}
interface Artifact {
  artifactId: string;
  name?: string;
  description?: string;
  type?: string;
  parts: Part[];
  taskId?: string;
  toolCallId?: string;
  metadata?: {
    [key: string]: any;
  };
  createdAt: string;
}
interface Message {
  role: 'user' | 'agent';
  parts: Part[];
  metadata?: {
    [key: string]: any;
  };
  referenceTaskIds?: string[];
  messageId: string;
  taskId?: string;
  contextId?: string;
  kind: 'message';
}
interface TaskStatus {
  state: TaskState;
  message?: Message;
  timestamp?: string;
}
interface Task {
  id: string;
  contextId: string;
  status: TaskStatus;
  history?: Message[];
  artifacts?: Artifact[];
  metadata?: {
    [key: string]: any;
  };
  kind: 'task';
}
interface TaskStatusUpdateEvent {
  taskId: string;
  contextId: string;
  kind: 'status-update';
  status: TaskStatus;
  final: boolean;
  metadata?: {
    [key: string]: any;
  };
}
interface TaskArtifactUpdateEvent {
  taskId: string;
  contextId: string;
  kind: 'artifact-update';
  artifact: Artifact;
  append?: boolean;
  lastChunk?: boolean;
  metadata?: {
    [key: string]: any;
  };
}
interface JSONParseError extends JSONRPCError {
  code: -32700;
  message: string;
}
interface InvalidRequestError extends JSONRPCError {
  code: -32600;
  message: string;
}
interface MethodNotFoundError extends JSONRPCError {
  code: -32601;
  message: string;
}
interface InvalidParamsError extends JSONRPCError {
  code: -32602;
  message: string;
}
interface InternalError extends JSONRPCError {
  code: -32603;
  message: string;
}
interface TaskNotFoundError extends JSONRPCError {
  code: -32001;
  message: string;
}
interface TaskNotCancelableError extends JSONRPCError {
  code: -32002;
  message: string;
}
interface PushNotificationNotSupportedError extends JSONRPCError {
  code: -32003;
  message: string;
}
interface UnsupportedOperationError extends JSONRPCError {
  code: -32004;
  message: string;
}
interface ContentTypeNotSupportedError extends JSONRPCError {
  code: -32005;
  message: string;
}
interface InvalidAgentResponseError extends JSONRPCError {
  code: -32006;
  message: string;
}
/**
 * Union of all A2A specific and standard JSON-RPC errors.
 */
type A2AError = JSONParseError | InvalidRequestError | MethodNotFoundError | InvalidParamsError | InternalError | TaskNotFoundError | TaskNotCancelableError | PushNotificationNotSupportedError | UnsupportedOperationError | ContentTypeNotSupportedError | InvalidAgentResponseError;
interface PushNotificationAuthenticationInfo {
  schemes: string[];
  credentials?: string;
}
interface PushNotificationConfig {
  url: string;
  token?: string;
  authentication?: PushNotificationAuthenticationInfo;
}
interface TaskPushNotificationConfig {
  taskId: string;
  pushNotificationConfig: PushNotificationConfig;
}
interface TaskIdParams {
  id: string;
  metadata?: {
    [key: string]: any;
  };
}
interface TaskQueryParams extends TaskIdParams {
  historyLength?: number;
}
interface MessageSendConfiguration {
  acceptedOutputModes: string[];
  historyLength?: number;
  pushNotificationConfig?: PushNotificationConfig;
  blocking?: boolean;
}
interface MessageSendParams {
  message: Message;
  configuration?: MessageSendConfiguration;
  metadata?: {
    [key: string]: any;
  };
}
/**
 * Base interface for all JSON-RPC messages (Requests and Responses).
 */
interface JSONRPCMessage {
  id?: number | string | null;
  readonly jsonrpc: '2.0';
}
/**
 * Represents a JSON-RPC request object base structure.
 */
interface JSONRPCRequest extends JSONRPCMessage {
  method: string;
  params?: {
    [key: string]: any;
  };
}
/**
 * Represents a JSON-RPC 2.0 Error object.
 */
interface JSONRPCError {
  code: number;
  message: string;
  data?: any;
}
/**
 * Represents a JSON-RPC 2.0 Result object (for successful responses).
 * @template R Type of the result field.
 */
interface JSONRPCResult<R = any> extends JSONRPCMessage {
  result: R;
  error?: never;
}
/**
 * Represents a JSON-RPC 2.0 Error Response object.
 */
interface JSONRPCErrorResponse extends JSONRPCMessage {
  result?: never;
  error: JSONRPCError | A2AError;
}
interface SendMessageRequest extends JSONRPCRequest {
  method: 'message/send';
  params: MessageSendParams;
}
interface SendStreamingMessageRequest extends JSONRPCRequest {
  method: 'message/stream';
  params: MessageSendParams;
}
interface GetTaskRequest extends JSONRPCRequest {
  method: 'tasks/get';
  params: TaskQueryParams;
}
interface CancelTaskRequest extends JSONRPCRequest {
  method: 'tasks/cancel';
  params: TaskIdParams;
}
interface SetTaskPushNotificationConfigRequest extends JSONRPCRequest {
  method: 'tasks/pushNotificationConfig/set';
  params: TaskPushNotificationConfig;
}
interface GetTaskPushNotificationConfigRequest extends JSONRPCRequest {
  method: 'tasks/pushNotificationConfig/get';
  params: TaskIdParams;
}
interface TaskResubscriptionRequest extends JSONRPCRequest {
  method: 'tasks/resubscribe';
  params: TaskIdParams;
}
interface SendMessageSuccessResponse extends JSONRPCResult<Message | Task> {}
type SendMessageResponse = SendMessageSuccessResponse | JSONRPCErrorResponse;
interface SendStreamingMessageSuccessResponse extends JSONRPCResult<Message | Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent> {}
type SendStreamingMessageResponse = SendStreamingMessageSuccessResponse | JSONRPCErrorResponse;
interface GetTaskSuccessResponse extends JSONRPCResult<Task> {}
type GetTaskResponse = GetTaskSuccessResponse | JSONRPCErrorResponse;
interface CancelTaskSuccessResponse extends JSONRPCResult<Task> {}
type CancelTaskResponse = CancelTaskSuccessResponse | JSONRPCErrorResponse;
interface SetTaskPushNotificationConfigSuccessResponse extends JSONRPCResult<TaskPushNotificationConfig> {}
type SetTaskPushNotificationConfigResponse = SetTaskPushNotificationConfigSuccessResponse | JSONRPCErrorResponse;
interface GetTaskPushNotificationConfigSuccessResponse extends JSONRPCResult<TaskPushNotificationConfig> {}
type GetTaskPushNotificationConfigResponse = GetTaskPushNotificationConfigSuccessResponse | JSONRPCErrorResponse;
type A2ARequest = SendMessageRequest | SendStreamingMessageRequest | GetTaskRequest | CancelTaskRequest | SetTaskPushNotificationConfigRequest | GetTaskPushNotificationConfigRequest | TaskResubscriptionRequest;
/**
 * Represents any valid JSON-RPC response defined in the A2A protocol.
 */
type A2AResponse = SendMessageResponse | SendStreamingMessageResponse | GetTaskResponse | CancelTaskResponse | SetTaskPushNotificationConfigResponse | GetTaskPushNotificationConfigResponse | JSONRPCErrorResponse;
type MessagePart = Part;
type TaskArtifact = Artifact;
//#endregion
export { A2AError, A2ARequest, A2AResponse, APIKeySecurityScheme, AgentCapabilities, AgentCard, AgentProvider, AgentSkill, Artifact, AuthorizationCodeOAuthFlow, CancelTaskRequest, CancelTaskResponse, CancelTaskSuccessResponse, ClientCredentialsOAuthFlow, ContentTypeNotSupportedError, DataPart, FileBase, FilePart, FileWithBytes, FileWithUri, GetTaskPushNotificationConfigRequest, GetTaskPushNotificationConfigResponse, GetTaskPushNotificationConfigSuccessResponse, GetTaskRequest, GetTaskResponse, GetTaskSuccessResponse, HTTPAuthSecurityScheme, ImplicitOAuthFlow, InternalError, InvalidAgentResponseError, InvalidParamsError, InvalidRequestError, JSONParseError, JSONRPCError, JSONRPCErrorResponse, JSONRPCMessage, JSONRPCRequest, JSONRPCResult, Message, MessagePart, MessageSendConfiguration, MessageSendParams, MethodNotFoundError, OAuth2SecurityScheme, OAuthFlows, OpenIdConnectSecurityScheme, Part, PartBase, PasswordOAuthFlow, PushNotificationAuthenticationInfo, PushNotificationConfig, PushNotificationNotSupportedError, SecurityScheme, SecuritySchemeBase, SendMessageRequest, SendMessageResponse, SendMessageSuccessResponse, SendStreamingMessageRequest, SendStreamingMessageResponse, SendStreamingMessageSuccessResponse, SetTaskPushNotificationConfigRequest, SetTaskPushNotificationConfigResponse, SetTaskPushNotificationConfigSuccessResponse, Task, TaskArtifact, TaskArtifactUpdateEvent, TaskIdParams, TaskNotCancelableError, TaskNotFoundError, TaskPushNotificationConfig, TaskQueryParams, TaskResubscriptionRequest, TaskState, TaskStatus, TaskStatusUpdateEvent, TextPart, UnsupportedOperationError };