Skip to main content

eoka_protocol/
metadata.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq)]
4pub enum OperationExposure {
5    DefaultAgent,
6    OptIn,
7    Lifecycle,
8}
9
10impl OperationExposure {
11    pub fn as_str(self) -> &'static str {
12        match self {
13            Self::DefaultAgent => "defaultAgent",
14            Self::OptIn => "optIn",
15            Self::Lifecycle => "lifecycle",
16        }
17    }
18}
19
20#[derive(Debug, Clone, Copy, PartialEq, Eq)]
21pub enum OperationCapability {
22    Navigation,
23    Observation,
24    Interaction,
25    JavaScript,
26    BrowserState,
27    Tabs,
28    Spa,
29    Wasm,
30    Network,
31    Policy,
32    Media,
33    Captcha,
34    Lifecycle,
35}
36
37impl OperationCapability {
38    pub fn as_str(self) -> &'static str {
39        match self {
40            Self::Navigation => "navigation",
41            Self::Observation => "observation",
42            Self::Interaction => "interaction",
43            Self::JavaScript => "javascript",
44            Self::BrowserState => "browser-state",
45            Self::Tabs => "tabs",
46            Self::Spa => "spa",
47            Self::Wasm => "wasm",
48            Self::Network => "network",
49            Self::Policy => "policy",
50            Self::Media => "media",
51            Self::Captcha => "captcha",
52            Self::Lifecycle => "lifecycle",
53        }
54    }
55}
56
57#[derive(Debug, Clone, Serialize, Deserialize)]
58#[serde(rename_all = "camelCase")]
59pub struct ToolManifestEntry {
60    pub path: String,
61    pub cmd: &'static str,
62    pub name: &'static str,
63    pub description: &'static str,
64    pub capability: &'static str,
65    pub exposure: &'static str,
66    pub read_only: bool,
67    pub destructive: bool,
68    pub input_schema: serde_json::Value,
69    pub tags: Vec<&'static str>,
70}