chore: move start-agent.sh and test-shell.lisp to their correct scopes
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
export SKILLS_WHITELIST="org-skill-shell-actuator,org-skill-chat,org-skill-emacs-bridge,org-skill-object-store-persistence,org-skill-inbox-processor,org-skill-scribe"
|
||||
cd /home/user/memex/projects/org-agent
|
||||
./org-agent-server > /home/user/memex/org-agent-whitelist.log 2>&1
|
||||
@@ -1,29 +0,0 @@
|
||||
(require :usocket)
|
||||
|
||||
(defun test-shell-execution ()
|
||||
(let* ((socket (usocket:socket-connect "127.0.0.1" 9105))
|
||||
(stream (usocket:socket-stream socket))
|
||||
;; We send a chat message asking to run date
|
||||
(msg "(:type :event :payload (:sensor :chat-message :text \"run date\"))")
|
||||
(len (length msg))
|
||||
(framed (format nil "~6,'0x~a" len msg)))
|
||||
(format t "Sending request: ~a~%" msg)
|
||||
(write-string framed stream)
|
||||
(finish-output stream)
|
||||
(format t "Waiting for Shell Actuator response...~%")
|
||||
(handler-case
|
||||
(loop
|
||||
(let* ((len-prefix (make-string 6)))
|
||||
(read-sequence len-prefix stream)
|
||||
(let* ((msg-len (parse-integer len-prefix :radix 16))
|
||||
(payload (make-string msg-len)))
|
||||
(read-sequence payload stream)
|
||||
(format t "AGENT REPLY: ~a~%" payload)
|
||||
;; We look for the Shell Command Result headline in the response
|
||||
(when (search "Shell Command Result" payload)
|
||||
(format t "SUCCESS: Shell output received!~%")
|
||||
(return)))))
|
||||
(error (c) (format t "ERROR: ~a~%" c)))
|
||||
(usocket:socket-close socket)))
|
||||
|
||||
(test-shell-execution)
|
||||
Reference in New Issue
Block a user