claude_cli: tool calls on the event bus, extensions can block, permissions deny/extensions-only (#182)
This commit is contained in:
1 parent
6ebf1c3180
commit
6978aad27a
12 files changed
+297
-12
No files matched your search
@@ -161,6 +161,12 @@ impl Extension {
|
||||
|
||||
#[async_trait]
|
||||
impl Hook for Extension {
|
||||
fn guard(&self) -> Option<bool> {
|
||||
self.subscribe
|
||||
.iter()
|
||||
.any(|s| s == "tool_call" || s == "*")
|
||||
.then(|| self.alive.load(Ordering::SeqCst))
|
||||
}
|
||||
async fn on(&self, ev: &Event) -> HookAction {
|
||||
if !self.subscribe.iter().any(|s| s == ev.kind() || s == "*") {
|
||||
return HookAction::Continue;
|
||||
|
||||
Reference in new issue
Block a user