Changeset 0.27.1.1 (#168)
This commit is contained in:
30
server/store/task_iface.go
Normal file
30
server/store/task_iface.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.gobha.me/xcaliber/chat-switchboard/models"
|
||||
)
|
||||
|
||||
// TaskStore manages task definitions and run history.
|
||||
type TaskStore interface {
|
||||
// Task CRUD
|
||||
Create(ctx context.Context, t *models.Task) error
|
||||
GetByID(ctx context.Context, id string) (*models.Task, error)
|
||||
Update(ctx context.Context, id string, patch models.TaskPatch) error
|
||||
Delete(ctx context.Context, id string) error
|
||||
ListByOwner(ctx context.Context, ownerID string) ([]models.Task, error)
|
||||
ListByTeam(ctx context.Context, teamID string) ([]models.Task, error)
|
||||
ListAll(ctx context.Context) ([]models.Task, error)
|
||||
|
||||
// Scheduler queries
|
||||
ListDue(ctx context.Context, limit int) ([]models.Task, error)
|
||||
SetNextRun(ctx context.Context, id string, nextRun interface{}) error
|
||||
IncrementRunCount(ctx context.Context, id string) error
|
||||
|
||||
// Run history
|
||||
CreateRun(ctx context.Context, r *models.TaskRun) error
|
||||
UpdateRun(ctx context.Context, id string, status string, tokensUsed, toolCalls, wallClock int, errMsg string) error
|
||||
GetActiveRun(ctx context.Context, taskID string) (*models.TaskRun, error)
|
||||
ListRuns(ctx context.Context, taskID string, limit int) ([]models.TaskRun, error)
|
||||
}
|
||||
Reference in New Issue
Block a user