engine: explicit layer/prop params bypass selection-based enablement
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3a59a8470d
commit
dee16181fe
@@ -165,7 +165,11 @@ impl Session {
|
|||||||
pub fn execute(&mut self, id: &str, params: Value) -> Result<Value> {
|
pub fn execute(&mut self, id: &str, params: Value) -> Result<Value> {
|
||||||
let spec = commands::find(id).ok_or_else(|| EngineError::UnknownCommand(id.to_string()))?;
|
let spec = commands::find(id).ok_or_else(|| EngineError::UnknownCommand(id.to_string()))?;
|
||||||
if let Err(why) = (spec.enabled)(self) {
|
if let Err(why) = (spec.enabled)(self) {
|
||||||
return Err(EngineError::Disabled(id.to_string(), why));
|
// Explicit targets (agents, scripts) don't need a UI selection.
|
||||||
|
let explicit = ["layer", "layers", "prop", "keys"].iter().any(|k| params.get(k).is_some()) && commands::has_comp(self).is_ok();
|
||||||
|
if !explicit {
|
||||||
|
return Err(EngineError::Disabled(id.to_string(), why));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let r = (spec.run)(self, ¶ms)?;
|
let r = (spec.run)(self, ¶ms)?;
|
||||||
if spec.journal {
|
if spec.journal {
|
||||||
|
|||||||
Reference in New Issue
Block a user