fn grant_by_agent( state: &AppState, actor: &AgentDefinition, body: &GrantBody, ) -> Result<Value, String>