@artinet/sdk
Version:
TypeScript SDK for Agentic Communication
45 lines • 2.14 kB
TypeScript
import { CreateJSONRPCServerParams, JSONRPCCallback } from "../../server/index.js";
import { Task, Message, TaskResubscriptionRequest, SendStreamingMessageRequest, A2ARequest, A2AResponse } from "../../types/index.js";
import { AgentEngine, ExecutionContext, A2AExecutionContext } from "../../types/services/context.js";
import { Protocol } from "../../types/services/protocol.js";
import { Response } from "express";
import { A2AServiceInterface, A2AServiceOptions } from "../../types/services/a2a/service.js";
import { A2ARepository } from "./repository.js";
export declare class A2AService implements A2AServiceInterface {
readonly name: string;
readonly protocol: Protocol;
readonly engine: AgentEngine;
readonly state: A2ARepository;
constructor(options: A2AServiceOptions);
/**
* Handles the message/stream method.
* @param req The SendTaskRequest object
* @param res The Express Response object
*/
handleSendStreamingMessage(req: SendStreamingMessageRequest, res: Response): Promise<void>;
/**
* Handles the tasks/resubscribe method.
* @param req The TaskResubscriptionRequest object
* @param res The Express Response object
*/
handleTaskResubscribe(req: TaskResubscriptionRequest, res: Response): Promise<void>;
/**
* Executes a method on the A2A service.
* @param executionContext The execution context.
* @param engine The agent engine.
*/
execute({ executionContext, engine, }: {
executionContext: ExecutionContext<A2AExecutionContext>;
engine: AgentEngine;
}): Promise<void>;
stop(): Promise<void>;
/**
* Dispatches a method to the A2A service.
* @param method The method to dispatch.
* @param params The parameters to dispatch.
* @param callback The callback to dispatch.
* @param deps The dependencies to dispatch.
*/
static dispatchMethod<T extends A2ARequest>(method: T["method"], params: T["params"], callback: JSONRPCCallback<A2AResponse | Task | Message | null>, deps: CreateJSONRPCServerParams): Promise<void>;
}
//# sourceMappingURL=service.d.ts.map