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:
Abhinav authored and copyberry committed 2026-07-10 21:13:38 +00:00
1 parent bca577d69a
commit 431ad23be4
16 files changed
+589 -2

No files matched your search

+19
View File
@@ -96,6 +96,24 @@ fn unknown_installation_policy_source_maps_to_none() {
assert_eq!(summary.install_policy_source, None);
}
#[test]
fn scheduled_task_metadata_distinguishes_unavailable_from_empty() {
let release = serde_json::json!({
"display_name": "Example",
"description": "Example plugin",
"interface": {},
});
let without_metadata: RemotePluginReleaseResponse =
serde_json::from_value(release.clone()).expect("release should deserialize");
assert_eq!(without_metadata.scheduled_tasks, None);
let mut with_empty_metadata = release;
with_empty_metadata["scheduled_tasks"] = serde_json::json!([]);
let with_empty_metadata: RemotePluginReleaseResponse =
serde_json::from_value(with_empty_metadata).expect("release should deserialize");
assert_eq!(with_empty_metadata.scheduled_tasks, Some(Vec::new()));
}
fn directory_plugin(id: &str, name: &str) -> RemotePluginDirectoryItem {
RemotePluginDirectoryItem {
id: id.to_string(),
@@ -138,6 +156,7 @@ fn directory_plugin(id: &str, name: &str) -> RemotePluginDirectoryItem {
},
skills: Vec::new(),
mcp_servers: Vec::new(),
scheduled_tasks: None,
},
}
}