2 Commits

Author SHA1 Message Date
5deb4eac5b fix(security): Harden Lisp reader against macro injection in reason loop
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 22s
2026-04-17 16:30:25 -04:00
c9bdf5f070 feat: Add OpenRouter API key prompt to interactive setup 2026-04-17 16:06:08 -04:00
4 changed files with 10 additions and 4 deletions

View File

@@ -69,8 +69,9 @@ The `think` function represents the "intuitive" side of the agent. It identifies
;; Ensure we are working with a string for read-from-string ;; Ensure we are working with a string for read-from-string
(cleaned (if (stringp thought) (string-trim '(#\Space #\Newline #\Tab) thought) thought))) (cleaned (if (stringp thought) (string-trim '(#\Space #\Newline #\Tab) thought) thought)))
(if (stringp cleaned) (if (stringp cleaned)
(let ((*read-eval* nil))
(handler-case (read-from-string cleaned) (handler-case (read-from-string cleaned)
(error (c) (list :type :EVENT :payload (list :sensor :syntax-error :code cleaned :error (format nil "~a" c))))) (error (c) (list :type :EVENT :payload (list :sensor :syntax-error :code cleaned :error (format nil "~a" c))))))
cleaned)) cleaned))
(list :type :LOG :payload (list :text (format nil "Skill '~a' triggered (Deterministic only)" (skill-name active-skill)))))) (list :type :LOG :payload (list :text (format nil "Skill '~a' triggered (Deterministic only)" (skill-name active-skill))))))
nil))) nil)))

View File

@@ -50,6 +50,8 @@ setup_system() {
[ -n "$anthropic_key" ] && sed -i "s|ANTHROPIC_API_KEY=.*|ANTHROPIC_API_KEY=\"$anthropic_key\"|" .env [ -n "$anthropic_key" ] && sed -i "s|ANTHROPIC_API_KEY=.*|ANTHROPIC_API_KEY=\"$anthropic_key\"|" .env
read -p "OpenAI API Key: " openai_key < /dev/tty read -p "OpenAI API Key: " openai_key < /dev/tty
[ -n "$openai_key" ] && sed -i "s|OPENAI_API_KEY=.*|OPENAI_API_KEY=\"$openai_key\"|" .env [ -n "$openai_key" ] && sed -i "s|OPENAI_API_KEY=.*|OPENAI_API_KEY=\"$openai_key\"|" .env
read -p "OpenRouter API Key: " openrouter_key < /dev/tty
[ -n "$openrouter_key" ] && sed -i "s|OPENROUTER_API_KEY=.*|OPENROUTER_API_KEY=\"$openrouter_key\"|" .env
echo -e "\n${YELLOW}--- Memex Folder Structure ---${NC}" echo -e "\n${YELLOW}--- Memex Folder Structure ---${NC}"
echo "Enter the absolute paths for your existing folder structure (press Enter to accept default)." echo "Enter the absolute paths for your existing folder structure (press Enter to accept default)."

View File

@@ -41,6 +41,8 @@ setup_system() {
[ -n "$anthropic_key" ] && sed -i "s|ANTHROPIC_API_KEY=.*|ANTHROPIC_API_KEY=\"$anthropic_key\"|" .env [ -n "$anthropic_key" ] && sed -i "s|ANTHROPIC_API_KEY=.*|ANTHROPIC_API_KEY=\"$anthropic_key\"|" .env
read -p "OpenAI API Key: " openai_key < /dev/tty read -p "OpenAI API Key: " openai_key < /dev/tty
[ -n "$openai_key" ] && sed -i "s|OPENAI_API_KEY=.*|OPENAI_API_KEY=\"$openai_key\"|" .env [ -n "$openai_key" ] && sed -i "s|OPENAI_API_KEY=.*|OPENAI_API_KEY=\"$openai_key\"|" .env
read -p "OpenRouter API Key: " openrouter_key < /dev/tty
[ -n "$openrouter_key" ] && sed -i "s|OPENROUTER_API_KEY=.*|OPENROUTER_API_KEY=\"$openrouter_key\"|" .env
echo -e "\n${YELLOW}--- Memex Folder Structure ---${NC}" echo -e "\n${YELLOW}--- Memex Folder Structure ---${NC}"
echo "Enter the absolute paths for your existing folder structure (press Enter to accept default)." echo "Enter the absolute paths for your existing folder structure (press Enter to accept default)."

View File

@@ -44,8 +44,9 @@
;; Ensure we are working with a string for read-from-string ;; Ensure we are working with a string for read-from-string
(cleaned (if (stringp thought) (string-trim '(#\Space #\Newline #\Tab) thought) thought))) (cleaned (if (stringp thought) (string-trim '(#\Space #\Newline #\Tab) thought) thought)))
(if (stringp cleaned) (if (stringp cleaned)
(let ((*read-eval* nil))
(handler-case (read-from-string cleaned) (handler-case (read-from-string cleaned)
(error (c) (list :type :EVENT :payload (list :sensor :syntax-error :code cleaned :error (format nil "~a" c))))) (error (c) (list :type :EVENT :payload (list :sensor :syntax-error :code cleaned :error (format nil "~a" c))))))
cleaned)) cleaned))
(list :type :LOG :payload (list :text (format nil "Skill '~a' triggered (Deterministic only)" (skill-name active-skill)))))) (list :type :LOG :payload (list :text (format nil "Skill '~a' triggered (Deterministic only)" (skill-name active-skill))))))
nil))) nil)))