Base RequestContext interface (local definition based on actual usage)

This defines the structure that the A2A SDK RequestContext actually has based on how it's used in PaymentsRequestHandler.

interface RequestContext {
    contextId: string;
    existingTask?: Task;
    referenceTasks?: Task[];
    requestMetadata?: Record<string, any>;
    task?: Task;
    taskId: string;
    userMessage: Message;
}

Properties

contextId: string

Unique identifier for the context/conversation

existingTask?: Task

Any existing task state (for task continuation scenarios)

referenceTasks?: Task[]

Reference tasks for multi-turn conversations

requestMetadata?: Record<string, any>

Additional metadata from the original request

task?: Task

Any existing task state (for task continuation scenarios)

taskId: string

Unique identifier for the task

userMessage: Message

The original message from the user containing the request