The CIA explicitly has no law enforcement capability. Their killing therefore does not represent the enforcement of any law and as such does not require a trial. Their killing is therefore a military action.
Gangs, civilians, and terrorists are not governmental entities and therefore not military. A state-sanctioned terrorist attack would likely be considered a military action by that state. Organized violence against a foreign country by citizens of another is also referred to as military (e.g. [1])
> A state-sanctioned terrorist attack would likely be considered a military action by that state.
The U.S., at least, claims that it wouldn't be. According to the U.S., state-sanctioned terrorism is still terrorism, not legitimate military action, and a violation of international law. Therefore the U.S. maintains a list of "State Sponsors of Terrorism", countries that it alleges engage in such unlawful tactics, either directly or via proxies. For example, it placed Libya on the list after the Lockerbie bombing.
Don't be reading anything into that list. Terrorism is mostly just a label used to shut down discussion. Funding for the IRA occurred in the US in a big way. The US has also backed even more violent struggles against elected governments. And if shooting down civilian airliners isn't direct terrorism, what it? This is a discussion on murdering people with drone strikes though, and I suppose that's pretty much the same.