move Permission into hive-types, drop swarm-controller's hive-sh4re dep
This commit is contained in:
parent
04786da58f
commit
e4a9005468
27 changed files with 221 additions and 175 deletions
|
|
@ -6,7 +6,7 @@
|
|||
//! running MCP server (a separate binary) — the `send` allow-list check that
|
||||
//! server enforces lives alongside it in the `hive-agent-mcp` crate.
|
||||
|
||||
use hive_sh4re::permissions::Permission;
|
||||
use hive_types::Permission;
|
||||
|
||||
/// Name of the hyperhive MCP server inside claude's view. Claude prefixes
|
||||
/// tools as `mcp__<this>__<tool>` (e.g. `mcp__hyperhive__send`).
|
||||
|
|
@ -55,7 +55,7 @@ fn extra_server_enabled(server: &str, perms: &[Permission]) -> bool {
|
|||
#[cfg(test)]
|
||||
mod extra_server_gate_tests {
|
||||
use super::{extra_server_enabled, extra_server_required_permission};
|
||||
use hive_sh4re::permissions::Permission;
|
||||
use hive_types::Permission;
|
||||
|
||||
#[test]
|
||||
fn bash_is_gated_behind_execution() {
|
||||
|
|
@ -84,7 +84,7 @@ mod extra_server_gate_tests {
|
|||
|
||||
/// MCP tools claude is allowed to call without prompting, derived from
|
||||
/// the supplied permissions. Adding a new `#[tool]` fn to a server impl
|
||||
/// requires updating the matching `Permission::tools()` slice in hive-sh4re
|
||||
/// requires updating the matching `Permission::tools()` slice in hive-types
|
||||
/// (single source of truth).
|
||||
#[must_use]
|
||||
pub fn allowed_mcp_tools(perms: &[Permission]) -> Vec<String> {
|
||||
|
|
@ -212,7 +212,7 @@ fn build_mcp_servers() -> serde_json::Map<String, serde_json::Value> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{SERVER_NAME, allowed_mcp_tools};
|
||||
use hive_sh4re::permissions::Permission;
|
||||
use hive_types::Permission;
|
||||
|
||||
fn qualified(tool: &str) -> String {
|
||||
format!("mcp__{SERVER_NAME}__{tool}")
|
||||
|
|
|
|||
Loading…
Reference in a new issue