diff options
| author | Arun Isaac | 2026-04-10 01:07:52 +0100 |
|---|---|---|
| committer | Arun Isaac | 2026-04-10 01:07:52 +0100 |
| commit | a5dc200bf51d3e83eb6288e954909d744d29e9f1 (patch) | |
| tree | fcc8ba8b70e5243c9b580363863f3d4c826beaa8 | |
| parent | 1a55558601d4dec073542ff42910413863e939cc (diff) | |
| download | kaagum-a5dc200bf51d3e83eb6288e954909d744d29e9f1.tar.gz kaagum-a5dc200bf51d3e83eb6288e954909d744d29e9f1.tar.lz kaagum-a5dc200bf51d3e83eb6288e954909d744d29e9f1.zip | |
Add /tools command.
| -rw-r--r-- | kaakaa/tea.scm | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/kaakaa/tea.scm b/kaakaa/tea.scm index b7eaadc..6540c33 100644 --- a/kaakaa/tea.scm +++ b/kaakaa/tea.scm @@ -214,8 +214,30 @@ the table." other-lines)) "\n")))) +(define %tools-command + (command "List available tools and their permission status" + (lambda (state session-id tools argument) + (let* ((allowed-tools (focus (state-allowed-tools session-id) + state)) + (rejected-tools (focus (state-rejected-tools session-id) + state)) + (lines + (cons (list "Tool" "Permission") + (map (match-lambda + ((name . _) + (list name + (cond + ((member name allowed-tools) "allow") + ((member name rejected-tools) "reject") + (else "prompt user"))))) + tools)))) + (values state + (list (agent-message-chunk session-id + (markdown-table lines)))))))) + (define %commands - `(("cwd" . ,%cwd-command))) + `(("cwd" . ,%cwd-command) + ("tools" . ,%tools-command))) (define (next-state-slash-command state session-id tools command-name argument) "Given current @var{state} and an invocation of slash var{command-name} with |
