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

DeleteRunAsync(string, string, string, CancellationToken)

Deletes one run with its transcript and session. Returns false when the user owns no such run.

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's status, times, result and error for each of the given task IDs, without transcripts or sessions. Tasks that have never run are absent from the returned dictionary.

GetLatestSessionAsync(string, string, CancellationToken)

Returns the latest resume session across skipped runs that saved no session.

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.

GetRunSummariesAsync(string, string, int, CancellationToken)

Returns the most recent runs with their result and error, newest first, without opening transcripts or sessions.

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.

ParseDefinition(string, string)

Parses caller-owned task markdown before validation and saving.

SaveRunAsync(AgentTaskRun, CancellationToken)

Creates or updates the given run record.

SaveTaskAsync(AgentTaskDefinition, CancellationToken, string?)

Creates or updates the given task definition.

ValidateTask(AgentTaskDefinition)

Normalizes and validates a definition before related state is changed.