about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2026-04-09 18:08:57 +0100
committerArun Isaac2026-04-09 18:08:57 +0100
commit9a60e760e4a5ad6d274f887d91b43ee9db436779 (patch)
treee329630f0f8dbfb8240b3cb4e173ee79317f5c68
parentad86dff6e07e6836719c94b9265acf420c511f14 (diff)
downloadkaagum-9a60e760e4a5ad6d274f887d91b43ee9db436779.tar.gz
kaagum-9a60e760e4a5ad6d274f887d91b43ee9db436779.tar.lz
kaagum-9a60e760e4a5ad6d274f887d91b43ee9db436779.zip
Implement /cwd command.
-rw-r--r--kaakaa/tea.scm20
1 files changed, 19 insertions, 1 deletions
diff --git a/kaakaa/tea.scm b/kaakaa/tea.scm
index 8480ad9..e9c00c9 100644
--- a/kaakaa/tea.scm
+++ b/kaakaa/tea.scm
@@ -86,8 +86,26 @@
   `(("name" . ,name)
     ("description" . ,(command-description command))))
 
+(define %cwd-command
+  (command "Print current working directory of the session"
+           (lambda (state session-id _)
+             (values state
+                     (list (acp-message
+                            `(("jsonrpc" . "2.0")
+                              ("method" . "session/update")
+                              ("params"
+                               ("sessionId" . ,session-id)
+                               ("update"
+                                ("sessionUpdate" . "agent_message_chunk")
+                                ("content"
+                                 ("type" . "text")
+                                 ("text" . ,(focus (compose session-cwd
+                                                            (key-ref session-id)
+                                                            state-sessions)
+                                                   state))))))))))))
+
 (define %commands
-  '())
+  `(("cwd" . ,%cwd-command)))
 
 (define (state-messages session-id)
   "Return a lens to focus on messages of session with @var{session-id} in state."