| use super::AppSummary; |
| use super::HookEventName; |
| use super::HookSource; |
| use super::HookTrustStatus; |
| use crate::JsonSchema; |
| use crate::TS; |
| use codex_protocol::protocol::SkillDependencies as CoreSkillDependencies; |
| use codex_protocol::protocol::SkillInterface as CoreSkillInterface; |
| use codex_protocol::protocol::SkillMetadata as CoreSkillMetadata; |
| use codex_protocol::protocol::SkillScope as CoreSkillScope; |
| use codex_protocol::protocol::SkillToolDependency as CoreSkillToolDependency; |
| use codex_utils_absolute_path::AbsolutePathBuf; |
| use serde::Deserialize; |
| use serde::Serialize; |
| use std::path::PathBuf; |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillsListParams { |
| |
| #[serde(default, skip_serializing_if = "Vec::is_empty")] |
| pub cwds: Vec<PathBuf>, |
|
|
| |
| #[serde(default, skip_serializing_if = "std::ops::Not::not")] |
| pub force_reload: bool, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillsListResponse { |
| pub data: Vec<SkillsListEntry>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillsExtraRootsSetParams { |
| pub extra_roots: Vec<AbsolutePathBuf>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillsExtraRootsSetResponse {} |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct HooksListParams { |
| |
| #[serde(default, skip_serializing_if = "Vec::is_empty")] |
| pub cwds: Vec<PathBuf>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct HooksListResponse { |
| pub data: Vec<HooksListEntry>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct MarketplaceAddParams { |
| pub source: String, |
| #[ts(optional = nullable)] |
| pub ref_name: Option<String>, |
| #[ts(optional = nullable)] |
| pub sparse_paths: Option<Vec<String>>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct MarketplaceAddResponse { |
| pub marketplace_name: String, |
| pub installed_root: AbsolutePathBuf, |
| pub already_added: bool, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct MarketplaceRemoveParams { |
| pub marketplace_name: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct MarketplaceRemoveResponse { |
| pub marketplace_name: String, |
| pub installed_root: Option<AbsolutePathBuf>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct MarketplaceUpgradeParams { |
| #[ts(optional = nullable)] |
| pub marketplace_name: Option<String>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct MarketplaceUpgradeResponse { |
| pub selected_marketplaces: Vec<String>, |
| pub upgraded_roots: Vec<AbsolutePathBuf>, |
| pub errors: Vec<MarketplaceUpgradeErrorInfo>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct MarketplaceUpgradeErrorInfo { |
| pub marketplace_name: String, |
| pub message: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginListParams { |
| |
| |
| #[ts(optional = nullable)] |
| pub cwds: Option<Vec<AbsolutePathBuf>>, |
| |
| |
| #[ts(optional = nullable)] |
| pub marketplace_kinds: Option<Vec<PluginListMarketplaceKind>>, |
| |
| #[serde(default, skip_serializing_if = "std::ops::Not::not")] |
| pub force_refetch: bool, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginInstalledParams { |
| |
| #[ts(optional = nullable)] |
| pub cwds: Option<Vec<AbsolutePathBuf>>, |
| |
| |
| #[ts(optional = nullable)] |
| pub install_suggestion_plugin_names: Option<Vec<String>>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[ts(export_to = "v2/")] |
| pub enum PluginListMarketplaceKind { |
| #[serde(rename = "local")] |
| #[ts(rename = "local")] |
| Local, |
| #[serde(rename = "vertical")] |
| #[ts(rename = "vertical")] |
| Vertical, |
| #[serde(rename = "workspace-directory")] |
| #[ts(rename = "workspace-directory")] |
| WorkspaceDirectory, |
| #[serde(rename = "shared-with-me")] |
| #[ts(rename = "shared-with-me")] |
| SharedWithMe, |
| #[serde(rename = "created-by-me-remote")] |
| #[ts(rename = "created-by-me-remote")] |
| CreatedByMeRemote, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginListResponse { |
| pub marketplaces: Vec<PluginMarketplaceEntry>, |
| #[serde(default)] |
| pub marketplace_load_errors: Vec<MarketplaceLoadErrorInfo>, |
| #[serde(default)] |
| pub featured_plugin_ids: Vec<String>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginInstalledResponse { |
| pub marketplaces: Vec<PluginMarketplaceEntry>, |
| #[serde(default)] |
| pub marketplace_load_errors: Vec<MarketplaceLoadErrorInfo>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginReconcileParams { |
| |
| #[ts(optional = nullable)] |
| pub reason: Option<String>, |
| } |
|
|
| |
| |
| |
| #[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginReconcileResponse { |
| |
| |
| |
| pub changed_plugins: Vec<PluginReconcileChangedPlugin>, |
| |
| pub failed_remote_plugin_ids: Vec<String>, |
| |
| |
| pub failed_materialization_remote_plugin_ids: Vec<String>, |
| } |
|
|
| |
| |
| |
| |
| #[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginReconcileChangedPlugin { |
| |
| pub id: String, |
| pub has_mcps: bool, |
| pub has_apps: bool, |
| pub has_hooks: bool, |
| |
| pub has_skills: bool, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct MarketplaceLoadErrorInfo { |
| pub marketplace_path: AbsolutePathBuf, |
| pub message: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginReadParams { |
| #[ts(optional = nullable)] |
| pub marketplace_path: Option<AbsolutePathBuf>, |
| #[ts(optional = nullable)] |
| pub remote_marketplace_name: Option<String>, |
| pub plugin_name: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginReadResponse { |
| pub plugin: PluginDetail, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginSkillReadParams { |
| pub remote_marketplace_name: String, |
| pub remote_plugin_id: String, |
| pub skill_name: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginSkillReadResponse { |
| pub contents: Option<String>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareSaveParams { |
| pub plugin_path: AbsolutePathBuf, |
| #[ts(optional = nullable)] |
| pub remote_plugin_id: Option<String>, |
| #[ts(optional = nullable)] |
| pub discoverability: Option<PluginShareDiscoverability>, |
| #[ts(optional = nullable)] |
| pub share_targets: Option<Vec<PluginShareTarget>>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareSaveResponse { |
| pub remote_plugin_id: String, |
| pub share_url: String, |
| #[serde(default)] |
| pub can_publish_to_workspace: Option<bool>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareUpdateTargetsParams { |
| pub remote_plugin_id: String, |
| pub discoverability: PluginShareUpdateDiscoverability, |
| pub share_targets: Vec<PluginShareTarget>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareUpdateTargetsResponse { |
| pub principals: Vec<PluginSharePrincipal>, |
| pub discoverability: PluginShareDiscoverability, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareListParams {} |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareListResponse { |
| pub data: Vec<PluginShareListItem>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareCheckoutParams { |
| pub remote_plugin_id: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareCheckoutResponse { |
| pub remote_plugin_id: String, |
| pub plugin_id: String, |
| pub plugin_name: String, |
| pub plugin_path: AbsolutePathBuf, |
| pub marketplace_name: String, |
| pub marketplace_path: AbsolutePathBuf, |
| pub remote_version: Option<String>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareDeleteParams { |
| pub remote_plugin_id: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareDeleteResponse {} |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareListItem { |
| pub plugin: PluginSummary, |
| pub local_plugin_path: Option<AbsolutePathBuf>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[ts(export_to = "v2/")] |
| pub enum PluginShareDiscoverability { |
| #[serde(rename = "LISTED")] |
| #[ts(rename = "LISTED")] |
| Listed, |
| #[serde(rename = "UNLISTED")] |
| #[ts(rename = "UNLISTED")] |
| Unlisted, |
| #[serde(rename = "PRIVATE")] |
| #[ts(rename = "PRIVATE")] |
| Private, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[ts(export_to = "v2/")] |
| pub enum PluginShareUpdateDiscoverability { |
| #[serde(rename = "UNLISTED")] |
| #[ts(rename = "UNLISTED")] |
| Unlisted, |
| #[serde(rename = "PRIVATE")] |
| #[ts(rename = "PRIVATE")] |
| Private, |
| #[serde(rename = "LISTED")] |
| #[ts(rename = "LISTED")] |
| Listed, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[ts(export_to = "v2/")] |
| pub enum PluginSharePrincipalType { |
| #[serde(rename = "user")] |
| #[ts(rename = "user")] |
| User, |
| #[serde(rename = "group")] |
| #[ts(rename = "group")] |
| Group, |
| #[serde(rename = "workspace")] |
| #[ts(rename = "workspace")] |
| Workspace, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareTarget { |
| pub principal_type: PluginSharePrincipalType, |
| pub principal_id: String, |
| pub role: PluginShareTargetRole, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginSharePrincipal { |
| pub principal_type: PluginSharePrincipalType, |
| pub principal_id: String, |
| pub role: PluginSharePrincipalRole, |
| pub name: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "lowercase")] |
| #[ts(rename_all = "lowercase")] |
| #[ts(export_to = "v2/")] |
| pub enum PluginShareTargetRole { |
| Reader, |
| Editor, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "lowercase")] |
| #[ts(rename_all = "lowercase")] |
| #[ts(export_to = "v2/")] |
| pub enum PluginSharePrincipalRole { |
| Reader, |
| Editor, |
| Owner, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "snake_case")] |
| #[ts(rename_all = "snake_case")] |
| #[ts(export_to = "v2/")] |
| pub enum SkillScope { |
| User, |
| Repo, |
| System, |
| Admin, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillMetadata { |
| pub name: String, |
| pub description: String, |
| #[serde(default, skip_serializing_if = "Option::is_none")] |
| #[ts(optional)] |
| |
| pub short_description: Option<String>, |
| #[serde(default, skip_serializing_if = "Option::is_none")] |
| #[ts(optional)] |
| pub interface: Option<SkillInterface>, |
| #[serde(default, skip_serializing_if = "Option::is_none")] |
| #[ts(optional)] |
| pub dependencies: Option<SkillDependencies>, |
| pub path: AbsolutePathBuf, |
| pub scope: SkillScope, |
| pub enabled: bool, |
| |
| pub plugin_id: Option<String>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillInterface { |
| #[ts(optional)] |
| pub display_name: Option<String>, |
| #[ts(optional)] |
| pub short_description: Option<String>, |
| #[ts(optional)] |
| pub icon_small: Option<AbsolutePathBuf>, |
| #[ts(optional)] |
| pub icon_large: Option<AbsolutePathBuf>, |
| |
| pub icon_small_url: Option<String>, |
| |
| pub icon_large_url: Option<String>, |
| #[ts(optional)] |
| pub brand_color: Option<String>, |
| #[ts(optional)] |
| pub default_prompt: Option<String>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillDependencies { |
| pub tools: Vec<SkillToolDependency>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillToolDependency { |
| #[serde(rename = "type")] |
| #[ts(rename = "type")] |
| pub r#type: String, |
| pub value: String, |
| #[serde(default, skip_serializing_if = "Option::is_none")] |
| #[ts(optional)] |
| pub description: Option<String>, |
| #[serde(default, skip_serializing_if = "Option::is_none")] |
| #[ts(optional)] |
| pub transport: Option<String>, |
| #[serde(default, skip_serializing_if = "Option::is_none")] |
| #[ts(optional)] |
| pub command: Option<String>, |
| #[serde(default, skip_serializing_if = "Option::is_none")] |
| #[ts(optional)] |
| pub url: Option<String>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillErrorInfo { |
| pub path: PathBuf, |
| pub message: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillsListEntry { |
| pub cwd: PathBuf, |
| pub skills: Vec<SkillMetadata>, |
| pub errors: Vec<SkillErrorInfo>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct HooksListEntry { |
| pub cwd: PathBuf, |
| pub hooks: Vec<HookMetadata>, |
| pub warnings: Vec<String>, |
| pub errors: Vec<HookErrorInfo>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(tag = "handlerType", rename_all = "camelCase")] |
| #[ts(tag = "handlerType", export_to = "v2/")] |
| pub enum HookHandlerMetadata { |
| Command { |
| command: String, |
| #[serde(default)] |
| r#async: bool, |
| }, |
| McpTool { |
| server: String, |
| tool: String, |
| }, |
| Prompt {}, |
| Agent {}, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct HookMetadata { |
| pub key: String, |
| pub event_name: HookEventName, |
| #[serde(flatten)] |
| pub handler: HookHandlerMetadata, |
| pub matcher: Option<String>, |
| pub timeout_sec: u64, |
| pub status_message: Option<String>, |
| |
| |
| pub additional_context_limit: Option<usize>, |
| pub source_path: AbsolutePathBuf, |
| pub source: HookSource, |
| pub plugin_id: Option<String>, |
| pub display_order: i64, |
| pub enabled: bool, |
| pub is_managed: bool, |
| pub current_hash: String, |
| pub trust_status: HookTrustStatus, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct HookErrorInfo { |
| pub path: PathBuf, |
| pub message: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginMarketplaceEntry { |
| pub name: String, |
| |
| |
| pub path: Option<AbsolutePathBuf>, |
| pub interface: Option<MarketplaceInterface>, |
| pub plugins: Vec<PluginSummary>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct MarketplaceInterface { |
| pub display_name: Option<String>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[ts(export_to = "v2/")] |
| pub enum PluginInstallPolicy { |
| #[serde(rename = "NOT_AVAILABLE")] |
| #[ts(rename = "NOT_AVAILABLE")] |
| NotAvailable, |
| #[serde(rename = "AVAILABLE")] |
| #[ts(rename = "AVAILABLE")] |
| Available, |
| #[serde(rename = "INSTALLED_BY_DEFAULT")] |
| #[ts(rename = "INSTALLED_BY_DEFAULT")] |
| InstalledByDefault, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[ts(export_to = "v2/")] |
| pub enum PluginInstallPolicySource { |
| #[serde(rename = "WORKSPACE_SETTING")] |
| #[ts(rename = "WORKSPACE_SETTING")] |
| WorkspaceSetting, |
| #[serde(rename = "IMPLICIT_CANONICAL_APP")] |
| #[ts(rename = "IMPLICIT_CANONICAL_APP")] |
| ImplicitCanonicalApp, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[ts(export_to = "v2/")] |
| pub enum PluginAuthPolicy { |
| #[serde(rename = "ON_INSTALL")] |
| #[ts(rename = "ON_INSTALL")] |
| OnInstall, |
| #[serde(rename = "ON_USE")] |
| #[ts(rename = "ON_USE")] |
| OnUse, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Default, JsonSchema, TS)] |
| #[ts(export_to = "v2/")] |
| pub enum PluginAvailability { |
| |
| |
| |
| #[serde(rename = "AVAILABLE", alias = "ENABLED")] |
| #[ts(rename = "AVAILABLE")] |
| #[default] |
| Available, |
| #[serde(rename = "DISABLED_BY_ADMIN")] |
| #[ts(rename = "DISABLED_BY_ADMIN")] |
| DisabledByAdmin, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "snake_case")] |
| #[ts(export_to = "v2/", rename_all = "snake_case")] |
| pub enum PluginDisabledReason { |
| DisabledByAdmin, |
| PlanNotEligible, |
| RequiredAppUnavailable, |
| #[serde(other)] |
| Unknown, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginSummary { |
| pub id: String, |
| |
| pub remote_plugin_id: Option<String>, |
| |
| #[serde(default)] |
| pub version: Option<String>, |
| |
| #[serde(default)] |
| pub local_version: Option<String>, |
| pub name: String, |
| |
| pub share_context: Option<PluginShareContext>, |
| pub source: PluginSource, |
| pub installed: bool, |
| |
| #[serde(default)] |
| #[ts(type = "number | null")] |
| pub installed_at: Option<i64>, |
| pub enabled: bool, |
| pub install_policy: PluginInstallPolicy, |
| pub install_policy_source: Option<PluginInstallPolicySource>, |
| #[serde(default)] |
| pub must_show_installation_interstitial: Option<bool>, |
| pub auth_policy: PluginAuthPolicy, |
| |
| #[serde(default)] |
| pub availability: PluginAvailability, |
| |
| #[serde(default)] |
| pub disabled_reason: Option<PluginDisabledReason>, |
| |
| #[serde(default)] |
| pub eligible_plan_types: Option<Vec<String>>, |
| pub interface: Option<PluginInterface>, |
| #[serde(default)] |
| pub keywords: Vec<String>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginShareContext { |
| pub remote_plugin_id: String, |
| |
| #[serde(default)] |
| pub remote_version: Option<String>, |
| pub discoverability: Option<PluginShareDiscoverability>, |
| pub share_url: Option<String>, |
| pub creator_account_user_id: Option<String>, |
| pub creator_name: Option<String>, |
| pub share_principals: Option<Vec<PluginSharePrincipal>>, |
| #[serde(default)] |
| pub can_publish_to_workspace: Option<bool>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginDetail { |
| pub marketplace_name: String, |
| pub marketplace_path: Option<AbsolutePathBuf>, |
| pub summary: PluginSummary, |
| pub share_url: Option<String>, |
| pub description: Option<String>, |
| pub skills: Vec<SkillSummary>, |
| pub hooks: Vec<PluginHookSummary>, |
| pub apps: Vec<AppSummary>, |
| pub app_templates: Vec<AppTemplateSummary>, |
| pub mcp_servers: Vec<String>, |
| pub scheduled_tasks: Option<Vec<ScheduledTaskSummary>>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct ScheduledTaskSummary { |
| pub key: String, |
| pub name: String, |
| pub prompt: String, |
| pub schedule: ScheduledTaskSchedule, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(tag = "type", rename_all = "camelCase")] |
| #[ts(tag = "type")] |
| #[ts(export_to = "v2/")] |
| pub enum ScheduledTaskSchedule { |
| #[serde(rename_all = "camelCase")] |
| #[ts(rename_all = "camelCase")] |
| Hourly { |
| interval_hours: u32, |
| days: Option<Vec<ScheduledTaskWeekday>>, |
| }, |
| #[serde(rename_all = "camelCase")] |
| #[ts(rename_all = "camelCase")] |
| Daily { time: String }, |
| #[serde(rename_all = "camelCase")] |
| #[ts(rename_all = "camelCase")] |
| Weekdays { time: String }, |
| #[serde(rename_all = "camelCase")] |
| #[ts(rename_all = "camelCase")] |
| Weekly { |
| days: Vec<ScheduledTaskWeekday>, |
| time: String, |
| }, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "SCREAMING_SNAKE_CASE")] |
| #[ts(export_to = "v2/")] |
| pub enum ScheduledTaskWeekday { |
| Mo, |
| Tu, |
| We, |
| Th, |
| Fr, |
| Sa, |
| Su, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] |
| #[serde(rename_all = "SCREAMING_SNAKE_CASE")] |
| #[ts(export_to = "v2/")] |
| pub enum AppTemplateUnavailableReason { |
| NotConfiguredForWorkspace, |
| NoActiveWorkspace, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct AppTemplateSummary { |
| pub template_id: String, |
| pub name: String, |
| pub description: Option<String>, |
| pub category: Option<String>, |
| pub canonical_connector_id: Option<String>, |
| pub logo_url: Option<String>, |
| pub logo_url_dark: Option<String>, |
| pub materialized_app_ids: Vec<String>, |
| pub reason: Option<AppTemplateUnavailableReason>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginHookSummary { |
| pub key: String, |
| pub event_name: HookEventName, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillSummary { |
| pub name: String, |
| pub description: String, |
| pub short_description: Option<String>, |
| pub interface: Option<SkillInterface>, |
| pub path: Option<AbsolutePathBuf>, |
| pub enabled: bool, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginInterface { |
| pub display_name: Option<String>, |
| pub short_description: Option<String>, |
| pub long_description: Option<String>, |
| pub developer_name: Option<String>, |
| pub category: Option<String>, |
| pub capabilities: Vec<String>, |
| pub website_url: Option<String>, |
| pub privacy_policy_url: Option<String>, |
| pub terms_of_service_url: Option<String>, |
| |
| |
| pub default_prompt: Option<Vec<String>>, |
| pub brand_color: Option<String>, |
| |
| pub composer_icon: Option<AbsolutePathBuf>, |
| |
| pub composer_icon_url: Option<String>, |
| |
| pub logo: Option<AbsolutePathBuf>, |
| |
| pub logo_dark: Option<AbsolutePathBuf>, |
| |
| pub logo_url: Option<String>, |
| |
| pub logo_url_dark: Option<String>, |
| |
| pub screenshots: Vec<AbsolutePathBuf>, |
| |
| pub screenshot_urls: Vec<String>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(tag = "type", rename_all = "camelCase")] |
| #[ts(tag = "type")] |
| #[ts(export_to = "v2/")] |
| pub enum PluginSource { |
| #[serde(rename_all = "camelCase")] |
| #[ts(rename_all = "camelCase")] |
| Local { path: AbsolutePathBuf }, |
| #[serde(rename_all = "camelCase")] |
| #[ts(rename_all = "camelCase")] |
| Git { |
| url: String, |
| path: Option<String>, |
| ref_name: Option<String>, |
| sha: Option<String>, |
| }, |
| #[serde(rename_all = "camelCase")] |
| #[ts(rename_all = "camelCase")] |
| Npm { |
| package: String, |
| |
| version: Option<String>, |
| |
| registry: Option<String>, |
| }, |
| |
| |
| Remote, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillsConfigWriteParams { |
| |
| #[ts(optional = nullable)] |
| pub path: Option<AbsolutePathBuf>, |
| |
| #[ts(optional = nullable)] |
| pub name: Option<String>, |
| pub enabled: bool, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct SkillsConfigWriteResponse { |
| pub effective_enabled: bool, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginInstallParams { |
| #[ts(optional = nullable)] |
| pub marketplace_path: Option<AbsolutePathBuf>, |
| #[ts(optional = nullable)] |
| pub remote_marketplace_name: Option<String>, |
| |
| #[ts(optional = nullable)] |
| pub install_attempt_id: Option<String>, |
| pub plugin_name: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginInstallResponse { |
| pub auth_policy: PluginAuthPolicy, |
| pub apps_needing_auth: Vec<AppSummary>, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginUninstallParams { |
| pub plugin_id: String, |
| } |
|
|
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| pub struct PluginUninstallResponse {} |
|
|
| impl From<CoreSkillMetadata> for SkillMetadata { |
| fn from(value: CoreSkillMetadata) -> Self { |
| Self { |
| name: value.name, |
| description: value.description, |
| short_description: value.short_description, |
| interface: value.interface.map(SkillInterface::from), |
| dependencies: value.dependencies.map(SkillDependencies::from), |
| path: value.path, |
| scope: value.scope.into(), |
| enabled: true, |
| plugin_id: None, |
| } |
| } |
| } |
|
|
| impl From<CoreSkillInterface> for SkillInterface { |
| fn from(value: CoreSkillInterface) -> Self { |
| Self { |
| display_name: value.display_name, |
| short_description: value.short_description, |
| brand_color: value.brand_color, |
| default_prompt: value.default_prompt, |
| icon_small: value.icon_small, |
| icon_large: value.icon_large, |
| icon_small_url: None, |
| icon_large_url: None, |
| } |
| } |
| } |
|
|
| impl From<CoreSkillDependencies> for SkillDependencies { |
| fn from(value: CoreSkillDependencies) -> Self { |
| Self { |
| tools: value |
| .tools |
| .into_iter() |
| .map(SkillToolDependency::from) |
| .collect(), |
| } |
| } |
| } |
|
|
| impl From<CoreSkillToolDependency> for SkillToolDependency { |
| fn from(value: CoreSkillToolDependency) -> Self { |
| Self { |
| r#type: value.r#type, |
| value: value.value, |
| description: value.description, |
| transport: value.transport, |
| command: value.command, |
| url: value.url, |
| } |
| } |
| } |
|
|
| impl From<CoreSkillScope> for SkillScope { |
| fn from(value: CoreSkillScope) -> Self { |
| match value { |
| CoreSkillScope::User => Self::User, |
| CoreSkillScope::Repo => Self::Repo, |
| CoreSkillScope::System => Self::System, |
| CoreSkillScope::Admin => Self::Admin, |
| } |
| } |
| } |
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] |
| #[serde(rename_all = "camelCase")] |
| #[ts(export_to = "v2/")] |
| |
| |
| |
| |
| pub struct SkillsChangedNotification {} |
|
|