-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile_workspace.rs
More file actions
33 lines (27 loc) · 1.11 KB
/
Copy pathfile_workspace.rs
File metadata and controls
33 lines (27 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use super::{HostEnrichContext, NssPlugin, PluginCapability, PluginManifest};
use crate::ssh_config::HostConfig;
use anyhow::Result;
pub const NSS_COMMANDER_PLUGIN_ID: &str = "dev.nosuckshell.plugin.nss-commander";
pub struct FileWorkspacePlugin;
impl NssPlugin for FileWorkspacePlugin {
fn manifest(&self) -> PluginManifest {
PluginManifest {
id: NSS_COMMANDER_PLUGIN_ID.to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
display_name: "NSS-Commander".to_string(),
capabilities: vec![PluginCapability::SettingsUi],
}
}
fn required_entitlement(&self) -> Option<&'static str> {
Some("dev.nosuckshell.addon.file-workspace")
}
fn enrich_host_config(&self, _host: &mut HostConfig, _ctx: &HostEnrichContext) -> Result<()> {
Ok(())
}
fn invoke(&self, method: &str, arg: &serde_json::Value) -> Result<serde_json::Value> {
match method {
"ping" => Ok(serde_json::json!({ "ok": true, "message": "pong", "echo": arg })),
_ => anyhow::bail!("unknown method: {method}"),
}
}
}