objectiveai_cli_sdk/output/notification/items.rs
1use serde::{Deserialize, Serialize};
2
3/// Generic wire wrapper for every list-style notification:
4/// `{"type":"notification","items":[...]}`. The element type varies
5/// (e.g. `Items<ListItem>` for `agents list`, `Items<PairListItem>` for
6/// `pairs list`, `Items<objectiveai_sdk::filesystem::config::Favorite>` for
7/// favorites listings, `Items<objectiveai_sdk::filesystem::logs::ListItem>`
8/// for log listings).
9#[derive(Serialize, Deserialize, Debug, Clone)]
10pub struct Items<T> {
11 pub items: Vec<T>,
12}
13
14/// One entry in a non-pair resource listing — either a favorite that
15/// matches a remote resource or a resolved remote path. Untagged so the
16/// wire shape is whichever underlying object matches.
17#[derive(Serialize, Deserialize, Debug, Clone)]
18#[serde(untagged)]
19pub enum ListItem {
20 Favorite(objectiveai_sdk::filesystem::config::Favorite),
21 Item(objectiveai_sdk::RemotePath),
22}
23
24/// One entry in a function-profile pair listing.
25#[derive(Serialize, Deserialize, Debug, Clone)]
26#[serde(untagged)]
27pub enum PairListItem {
28 Favorite(objectiveai_sdk::filesystem::config::PairFavorite),
29 Item(objectiveai_sdk::functions::response::ListFunctionProfilePairItem),
30}