Table of Contents

Interface IAgentTaskRepository

Namespace
Oscova.Agents.Tasks
Assembly
Oscova.Agents.dll

Persists and retrieves agent task definitions and their execution run records.

public interface IAgentTaskRepository

Methods

DeleteTaskAsync(string, string, CancellationToken)

Permanently deletes the specified task definition and its run history.

GetAllEnabledTasksAsync(CancellationToken)

Returns all task definitions that are currently enabled, across all users. Used by the scheduler to determine which tasks are eligible to run.

GetLatestRunAsync(string, string, CancellationToken)

Returns the most recent run for the given task, or null if the task has never run.

GetLatestRunMetadataAsync(string, string, CancellationToken)

Returns the most recent run without opening confidential content.

GetLatestRunsAsync(IEnumerable<string>, CancellationToken)

Returns the most recent run for each of the given task IDs in a single query. Tasks that have never run are absent from the returned dictionary.

GetRunAsync(string, string, string, CancellationToken)

Returns a persisted task run by identifier, or null if not found.

GetRunMetadataAsync(string, string, string, CancellationToken)

Returns a persisted run without opening confidential content.

GetRunsAsync(string, string, int, CancellationToken)

Returns the most recent runs for the given task, newest first, up to limit records.

GetTaskAsync(string, string, CancellationToken)

Returns a single task definition by user and task ID, or null if not found.

GetTaskByExternalTriggerSlugAsync(string, CancellationToken)

Returns the task whose external trigger is enabled for the specified slug, or null if none exists.

GetTasksByUserAsync(string, CancellationToken)

Returns all task definitions belonging to the specified user, ordered by name.

SaveRunAsync(AgentTaskRun, CancellationToken)

Creates or updates the given run record.

SaveTaskAsync(AgentTaskDefinition, CancellationToken)

Creates or updates the given task definition.