Skip to main content

tasks_tool/registry/
task.rs

1//! A persisted task definition and its computed next execution time.
2
3use agent_storage::FamilyId;
4use chrono::{DateTime, FixedOffset, Utc};
5use serde::{Deserialize, Serialize};
6use uuid::Uuid;
7
8#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(deny_unknown_fields)]
10pub struct Task {
11    pub id: Uuid,
12    pub user_id: String,
13    pub name: String,
14    #[serde(default)]
15    pub description: String,
16    pub agent: String,
17    pub prompt: String,
18    #[serde(default)]
19    pub schedule: Option<String>,
20    #[serde(default)]
21    pub at: Option<DateTime<FixedOffset>>,
22    #[serde(default)]
23    pub timezone: Option<String>,
24    #[serde(default)]
25    pub family_id: Option<FamilyId>,
26    #[serde(default = "super::default_enabled")]
27    pub enabled: bool,
28    #[serde(skip)]
29    pub next_run: Option<DateTime<Utc>>,
30}