Skip to content

Commit 8a37c44

Browse files
committed
Add approval arg to preToolCall hook input.
1 parent aa276f2 commit 8a37c44

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Prefix tool name with server to LLM: <server>__<toolname>. #196
66
- Remove `eca_` prefix from eca tools, we already pass server prefix (eca) after #196.
7+
- Add `approval` arg to preToolCall hook input.
78

89
## 0.77.1
910

docs/configuration.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ Examples:
359359
"hooks": {
360360
"notify-me": {
361361
"type": "postRequest",
362+
"visible": false,
362363
"actions": [
363364
{
364365
"type": "shell",
@@ -370,6 +371,26 @@ Examples:
370371
}
371372
```
372373

374+
=== "Ring bell sound when pending tool call approval"
375+
376+
```javascript title="~/.config/eca/config.json"
377+
{
378+
"hooks": {
379+
"notify-me": {
380+
"type": "preToolCall",
381+
"visible": false,
382+
"actions": [
383+
{
384+
"type": "shell",
385+
"shell": "[[ $(jq '.approval == \"ask\"' <<< \"$1\") ]] && canberra-gtk-play -i complete"
386+
}
387+
]
388+
}
389+
}
390+
}
391+
```
392+
393+
373394
=== "Block specific tool call checking hook arg"
374395

375396
```javascript title="~/.config/eca/config.json"
@@ -378,7 +399,6 @@ Examples:
378399
"check-my-tool": {
379400
"type": "preToolCall",
380401
"matcher": "my-mcp__some-tool",
381-
"visible": false,
382402
"actions": [
383403
{
384404
"type": "shell",

src/eca/features/chat.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,8 @@
685685
{:chat-id chat-id
686686
:tool-name name
687687
:server server-name
688-
:arguments arguments}
688+
:arguments arguments
689+
:approval approval}
689690
{:on-before-action (partial notify-before-hook-action! chat-ctx)
690691
:on-after-action (fn [result]
691692
(when (= 2 (:status result))

0 commit comments

Comments
 (0)