branch: externals/ellama
commit 204555283191f5a477931f87727978aa88a71038
Author: Sergey Kostyaev <[email protected]>
Commit: Sergey Kostyaev <[email protected]>

    Add tools menu to transient interface
    
    Added a new transient menu for managing tools with commands to 
enable/disable
    individual tools or all tools. The new menu is accessible from the main
    transient interface with the "T" key binding. Also updated the main 
transient
    menu to include the new tools menu in the "Tools Commands" section.
---
 ellama-transient.el | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/ellama-transient.el b/ellama-transient.el
index 81c9a56feb..9d89c938dd 100644
--- a/ellama-transient.el
+++ b/ellama-transient.el
@@ -430,6 +430,24 @@ ARGS used for transient arguments."
     ("k" "Kill" ellama-kill-current-buffer)
     ("q" "Quit" transient-quit-one)]])
 
+;;;###autoload (autoload 'ellama-transient-tools-menu "ellama-transient" nil t)
+(transient-define-prefix ellama-transient-tools-menu ()
+  ["Tools Commands"
+   :description (lambda ()
+                  (format "Enabled tools:\n%s"
+                          (string-join (mapcar (lambda (tool)
+                                                 (llm-tool-name tool))
+                                               ellama-tools-enabled)
+                                       " ")))
+   ["Tools"
+    ("e" "Enable tool" ellama-tools-enable-by-name)
+    ("E" "Enable all tools" ellama-tools-enable-all)
+    ("d" "Disable tool" ellama-tools-disable-by-name)
+    ("D" "Disable all tools" ellama-tools-disable-all)]
+   ["Quit"
+    ("k" "Kill" ellama-kill-current-buffer)
+    ("q" "Quit" transient-quit-one)]])
+
 (transient-define-suffix ellama-transient-chat (&optional args)
   "Chat with Ellama.  ARGS used for transient arguments."
   (interactive (list (transient-args transient-current-command)))
@@ -450,7 +468,8 @@ ARGS used for transient arguments."
   ["Main"
    [("c" "Chat" ellama-transient-chat)
     ("b" "Chat with blueprint" ellama-blueprint-select)
-    ("B" "Blueprint Commands" ellama-transient-blueprint-menu)]
+    ("B" "Blueprint Commands" ellama-transient-blueprint-menu)
+    ("T" "Tools Commands" ellama-transient-tools-menu)]
    [("a" "Ask Commands" ellama-transient-ask-menu)
     ("C" "Code Commands" ellama-transient-code-menu)]]
   ["Text"

Reply via email to