@artinet/sdk
Version:
A TypeScript SDK for building collaborative AI agents.
62 lines (61 loc) • 2.93 kB
TypeScript
/**
* Copyright 2025 The Artinet Project
* SPDX-License-Identifier: Apache-2.0
*/
import { A2A, MCP } from "../types/index.js";
/**
* @since 0.6.0
*/
export declare class SystemError<T extends MCP.JSONRPCErrorResponse> extends Error {
code: T["error"]["code"];
data?: T["error"]["data"];
taskId?: string;
message: string;
constructor(message: string, code: T["error"]["code"], data?: T["error"]["data"], taskId?: string);
}
/**
* @since 0.6.0
*/
export declare const PARSE_ERROR: <T extends A2A.JSONParseError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
/**
* @since 0.6.0
*/
export declare const INVALID_REQUEST: <T extends A2A.InvalidRequestError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
/**
* @since 0.6.0
*/
export declare const METHOD_NOT_FOUND: <T extends A2A.MethodNotFoundError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
export declare const INVALID_PARAMS: <T extends A2A.InvalidParamsError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
export declare const INTERNAL_ERROR: <T extends A2A.InternalError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
export declare const TASK_NOT_FOUND: <T extends A2A.TaskNotFoundError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
export declare const TASK_NOT_CANCELABLE: <T extends A2A.TaskNotCancelableError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
/**
* @deprecated Use errors from the `@a2a-js/sdk` package instead
* @since 0.6.0
*/
export declare const PUSH_NOTIFICATION_NOT_SUPPORTED: <T extends A2A.PushNotificationNotSupportedError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
/**
* @deprecated Use errors from the `@a2a-js/sdk` package instead
* @since 0.6.0
*/
export declare const AUTHENTICATED_EXTENDED_CARD_NOT_CONFIGURED: <T extends A2A.AuthenticatedExtendedCardNotConfiguredError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
/**
* @deprecated Use errors from the `@a2a-js/sdk` package instead
* @since 0.6.0
*/
export declare const UNSUPPORTED_OPERATION: <T extends A2A.A2AError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
/**
* @deprecated Use errors from the `@a2a-js/sdk` package instead
* @since 0.6.0
*/
export declare const CONTENT_TYPE_NOT_SUPPORTED: <T extends A2A.ContentTypeNotSupportedError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
/**
* @deprecated Use errors from the `@a2a-js/sdk` package instead
* @since 0.6.0
*/
export declare const INVALID_AGENT_RESPONSE: <T extends A2A.InvalidAgentResponseError>(data: T["error"]["data"], taskId?: string) => SystemError<T>;
/**
* @deprecated Use {@link describe.update.failed} instead
* @since 0.6.0
*/
export declare const FAILED_UPDATE: (taskId: string, contextId: string, messageId: string | undefined, errMessage: string) => A2A.TaskStatusUpdateEvent;