Skip to main content

objectiveai_sdk/cli/output/notification/
plugins.rs

1use crate::filesystem::plugins::ManifestWithNameAndSource;
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4
5/// Wire shape: `{"type":"notification","value":{"plugins":[...]}}`.
6/// Emitted by `objectiveai plugins list`. One entry per `.json`
7/// manifest discovered in `<base_dir>/plugins/`; failures during
8/// discovery are silently dropped (see `Client::list_plugins`).
9#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)]
10#[schemars(rename = "cli.output.notification.Plugins")]
11pub struct Plugins {
12    pub plugins: Vec<ManifestWithNameAndSource>,
13}
14
15/// Wire shape: `{"type":"notification","value":{"plugin": <manifest> | null}}`.
16/// Emitted by `objectiveai plugins get <name>`. The value is the
17/// resolved `ManifestWithNameAndSource` when the manifest file exists
18/// and parses, or JSON `null` when it doesn't (same silent-skip policy
19/// as `list`).
20#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)]
21#[schemars(rename = "cli.output.notification.Plugin")]
22pub struct Plugin {
23    pub plugin: Option<ManifestWithNameAndSource>,
24}
25
26/// Wire shape: `{"type":"notification","value":{"installed": true|false}}`.
27/// Emitted by `objectiveai plugins install`. `true` means the binary
28/// landed at `<base_dir>/plugins/<repository>/plugin[.exe]`; `false`
29/// means the manifest fetched OK but this platform isn't in its
30/// `binaries` map (nothing to install, not an error).
31#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)]
32#[schemars(rename = "cli.output.notification.Installed")]
33pub struct Installed {
34    pub installed: bool,
35}