- Updated all 22 skill org files to use $OC_DATA_DIR/skills/ paths - Removed manually created .lisp file (tangling now targets XDG) - Files will now tangle to ~/.local/share/opencortex/skills/
1.0 KiB
1.0 KiB
SKILL: Shell Actuator (org-skill-shell-actuator.org)
Overview
The Shell Actuator provides the agent with the capability to execute bash commands.
Implementation
Shell Execution (shell-execute)
(defun shell-execute (action context)
"Executes a bash command and returns the output."
(declare (ignore context))
(let* ((payload (getf action :payload))
(cmd (getf payload :cmd)))
(harness-log "ACT [Shell]: ~a" cmd)
(multiple-value-bind (out err code)
(uiop:run-program (list "bash" "-c" cmd) :output :string :error-output :string :ignore-error-status t)
(if (= code 0)
out
(format nil "ERROR [~a]: ~a" code err)))))
Skill Registration
(register-actuator :shell #'shell-execute)
(defskill :skill-shell-actuator
:priority 50
:trigger (lambda (ctx) (declare (ignore ctx)) nil))