Member Junction
    Preparing search index...

    In-memory implementation of IA2ATaskStore for unit testing and non-persistent dev runs.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _abortControllers: UUIDMap<AbortController> = ...
    _listeners: UUIDMap<Set<(task: Task) => void>> = ...
    _owners: UUIDMap<string> = ...

    The ID of the user each task was created for. Kept beside the task rather than on it, because the task is the wire shape returned to clients.

    _tasks: UUIDMap<Task> = ...

    Accessors

    • get ShutdownName(): string

      Optional human-readable identifier surfaced in shutdown logs and used for de-duplication when Register is called repeatedly with the same instance but no name. Falls back to the constructor name.

      Returns string

    Methods

    • Cancel an in-flight task, aborting its registered AbortController (if any) and notifying any active SSE subscribers immediately.

      Parameters

      • taskId: string
      • reason: string = 'Task cancelled via A2A'

      Returns boolean

    • The task with this ID when it belongs to userId, otherwise undefined. A task that belongs to someone else is indistinguishable from one that does not exist, so a caller cannot learn another user's task IDs, nor read, continue or cancel their tasks.

      Parameters

      • id: string
      • userId: string

      Returns Task

    • Register an AbortController for an in-flight task so CancelTask can propagate cancellation down to AgentOperations / AgentRunner.

      Parameters

      • taskId: string
      • controller: AbortController = ...

      Returns AbortController

    • Stores a task.

      Parameters

      • id: string
      • task: Task
      • OptionalownerUserId: string

        The user the task was created for. Only that user can retrieve it through GetForUser; a task stored without an owner is retrievable by no one. Omit it when replacing a stored task, to keep its owner.

      Returns this

    • Begin the periodic sweep. Idempotent; calling twice is safe. Uses unref() so the sweep timer doesn't hold the process alive on its own.

      Returns void

    • Subscribe to event-driven updates for a specific task ID (replaces 500ms polling). Returns an unsubscribe function.

      Parameters

      • taskId: string
      • listener: (task: Task) => void

      Returns () => void

    • Drop terminal-state tasks that haven't been updated in retentionMs. Returns the count evicted (useful for tests and diagnostics).

      Parameters

      • now: number = ...

      Returns number