ART Framework API Docs
    Preparing search index...

    Interface IA2ATaskRepository

    Interface for managing A2A (Agent-to-Agent) task persistence and retrieval.

    interface IA2ATaskRepository {
        createTask(task: A2ATask): Promise<void>;
        deleteTask(taskId: string): Promise<void>;
        getTask(taskId: string): Promise<null | A2ATask>;
        getTasksByAgent(
            agentId: string,
            filter?: {
                priority?: A2ATaskPriority;
                status?: A2ATaskStatus | A2ATaskStatus[];
            },
        ): Promise<A2ATask[]>;
        getTasksByStatus(
            status: A2ATaskStatus | A2ATaskStatus[],
            options?: { limit?: number; offset?: number },
        ): Promise<A2ATask[]>;
        getTasksByThread(
            threadId: string,
            filter?: {
                assignedAgentId?: string;
                priority?: A2ATaskPriority;
                status?: A2ATaskStatus | A2ATaskStatus[];
            },
        ): Promise<A2ATask[]>;
        updateTask(taskId: string, updates: Partial<A2ATask>): Promise<void>;
    }
    Index

    Methods

    • Creates a new A2A task in the repository.

      Parameters

      • task: A2ATask

        The A2ATask object to create.

      Returns Promise<void>

      A promise that resolves when the task is successfully stored.

      If the task cannot be created (e.g., duplicate taskId, validation errors).

    • Removes an A2A task from the repository.

      Parameters

      • taskId: string

        The unique identifier of the task to delete.

      Returns Promise<void>

      A promise that resolves when the task is successfully deleted.

      If the task is not found or cannot be deleted.

    • Retrieves an A2A task by its unique identifier.

      Parameters

      • taskId: string

        The unique identifier of the task.

      Returns Promise<null | A2ATask>

      A promise resolving to the A2ATask object if found, or null if not found.

      If an error occurs during retrieval.

    • Retrieves tasks based on their current status.

      Parameters

      • status: A2ATaskStatus | A2ATaskStatus[]

        The task status(es) to filter by.

      • Optionaloptions: { limit?: number; offset?: number }

        Optional query parameters like limit and pagination.

      Returns Promise<A2ATask[]>

      A promise resolving to an array of A2ATask objects with the specified status.

    • Retrieves tasks associated with a specific thread.

      Parameters

      • threadId: string

        The thread identifier to filter tasks.

      • Optionalfilter: {
            assignedAgentId?: string;
            priority?: A2ATaskPriority;
            status?: A2ATaskStatus | A2ATaskStatus[];
        }

        Optional filter criteria for task status, priority, or assigned agent.

      Returns Promise<A2ATask[]>

      A promise resolving to an array of A2ATask objects matching the criteria.

    • Updates an existing A2A task with new information.

      Parameters

      • taskId: string

        The unique identifier of the task to update.

      • updates: Partial<A2ATask>

        Partial A2ATask object containing the fields to update.

      Returns Promise<void>

      A promise that resolves when the task is successfully updated.

      If the task is not found or cannot be updated.