mofa_plugins/skill/
metadata.rs1use chrono::{DateTime, Utc};
4use serde::{Deserialize, Serialize};
5use std::path::PathBuf;
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct SkillMetadata {
10 pub name: String,
12 pub description: String,
14 #[serde(default)]
16 pub category: Option<String>,
17 #[serde(default)]
19 pub tags: Vec<String>,
20 #[serde(default)]
22 pub version: Option<String>,
23 #[serde(default)]
25 pub author: Option<String>,
26 #[serde(default)]
28 pub always: bool,
29 #[serde(default)]
31 pub requires: Option<SkillRequirements>,
32 #[serde(default)]
34 pub install: Option<String>,
35}
36
37#[derive(Debug, Clone, Serialize, Deserialize)]
39pub struct SkillVersion {
40 pub content_hash: String,
42 pub updated_at: DateTime<Utc>,
44}
45
46#[derive(Debug, Clone, PartialEq)]
48pub enum SkillState {
49 Active,
50 Updating,
51 RolledBack,
52 Disabled,
53}
54
55#[derive(Debug, Clone, Serialize, Deserialize)]
57pub struct CodeFile {
58 pub path: PathBuf,
60 pub language: String,
62 pub command: Option<String>,
64}
65
66#[derive(Debug, Clone, Serialize, Deserialize, Default)]
68pub struct SkillRequirements {
69 #[serde(default)]
71 pub cli_tools: Vec<String>,
72 #[serde(default)]
74 pub env_vars: Vec<String>,
75}
76
77#[derive(Debug, Clone, PartialEq)]
79pub enum Requirement {
80 CliTool(String),
82 EnvVar(String),
84}
85
86#[derive(Debug, Clone, Default)]
88pub struct RequirementCheck {
89 pub satisfied: bool,
91 pub missing: Vec<Requirement>,
93}