use polyc_llm::ToolSpec;
use serde_json::json;
pub const TOOL_NAME: &str = "promote";
pub const ALL: &[&str] = &[TOOL_NAME];
pub const ARG_TARGET_USER_ID: &str = "target_user_id";
#[must_use]
pub fn all_specs() -> Vec<ToolSpec> {
vec![promote_spec()]
}
#[must_use]
pub fn promote_spec() -> ToolSpec {
ToolSpec::new(
TOOL_NAME,
"For an admin only: make a specific person an ADMIN — not inviting them to Polychrome \
(that's invite) and not a wallet. Use it when an admin asks to promote, make someone an \
admin, or grant someone the admin role — for example \"promote @sam\" or \"@Vitor \
should be an admin\". Pass the target's user id EXACTLY as it appears in the mention \
markup in the message (the id inside `<@...>`), never a typed-out name. The target must \
already have used Polychrome and completed their invite — if they haven't, use invite \
first; this never grants someone access to Polychrome as a side effect, only the admin \
role once they already have access. This refuses to promote anyone who is already an \
admin. If the person asking isn't an admin, it returns a refusal rather than changing \
anyone's role.",
json!({
"type": "object",
"properties": {
ARG_TARGET_USER_ID: {
"type": "string",
"description": "The target's provider-native user id, taken \
verbatim from the mention markup (`<@U...>`) in the \
message — not a display name or handle."
}
},
"required": [ARG_TARGET_USER_ID],
"additionalProperties": false
}),
)
.titled("Make someone an admin (admin)")
}