mirror of
https://github.com/openai/codex.git
synced 2026-11-10 08:43:33 +00:00
Expose scheduled tasks in plugin details (#32272)
## What changed - Add optional `scheduledTasks` metadata to `plugin/read` responses for remote plugins, including hourly, daily, weekday, and weekly schedules. - Preserve the distinction between unavailable metadata (`null`) and a catalog response containing no scheduled tasks (`[]`). Local plugin details return `null`. - Export the corresponding Rust, JSON Schema, and TypeScript protocol types. ## Testing - Cover scheduled-task deserialization and propagation through `plugin/read`. - Verify missing and empty remote metadata remain distinct. GitOrigin-RevId: 7af223ed0a1bf6d8f054293084a73f34c6d0332d
This commit is contained in:
1 parent
bca577d69a
commit
431ad23be4
16 files changed
+589
-2
No files matched your search
@@ -663,6 +663,55 @@ pub struct PluginDetail {
|
||||
pub apps: Vec<AppSummary>,
|
||||
pub app_templates: Vec<AppTemplateSummary>,
|
||||
pub mcp_servers: Vec<String>,
|
||||
pub scheduled_tasks: Option<Vec<ScheduledTaskSummary>>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ScheduledTaskSummary {
|
||||
pub key: String,
|
||||
pub name: String,
|
||||
pub prompt: String,
|
||||
pub schedule: ScheduledTaskSchedule,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(tag = "type", rename_all = "camelCase")]
|
||||
#[ts(tag = "type")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub enum ScheduledTaskSchedule {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(rename_all = "camelCase")]
|
||||
Hourly {
|
||||
interval_hours: u32,
|
||||
days: Option<Vec<ScheduledTaskWeekday>>,
|
||||
},
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(rename_all = "camelCase")]
|
||||
Daily { time: String },
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(rename_all = "camelCase")]
|
||||
Weekdays { time: String },
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(rename_all = "camelCase")]
|
||||
Weekly {
|
||||
days: Vec<ScheduledTaskWeekday>,
|
||||
time: String,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub enum ScheduledTaskWeekday {
|
||||
Mo,
|
||||
Tu,
|
||||
We,
|
||||
Th,
|
||||
Fr,
|
||||
Sa,
|
||||
Su,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
|
||||
Reference in new issue
Block a user