feat(psf): transition to Order 2 (Sovereign Architect) with advanced skill graph and philosophical alignment
This commit is contained in:
@@ -57,12 +57,52 @@ Interfaces for web I/O and content synthesis. Source of truth is the global inte
|
||||
(let ((cmd (format nil "curl -sL '~a'" url)))
|
||||
(uiop:run-program cmd :output :string :ignore-error-status t)))
|
||||
|
||||
(defun vision-browse (url)
|
||||
"Uses a headless browser (Node/Playwright) to fetch text and a screenshot."
|
||||
(let* ((proj-dir (or (uiop:getenv "PROJECTS_DIR") "projects/"))
|
||||
(script-path (format nil "~aorg-skill-web-research/src/browse.js" proj-dir))
|
||||
(cmd (format nil "node ~a '~a'" script-path url)))
|
||||
(handler-case
|
||||
(let* ((output (uiop:run-program cmd :output :string :ignore-error-status t))
|
||||
(json (cl-json:decode-json-from-string output)))
|
||||
json)
|
||||
(error (c)
|
||||
(list :error (format nil "Vision Browse Failure: ~a" c))))))
|
||||
|
||||
(defun web-fetch (url &optional engine)
|
||||
(case engine
|
||||
(:curl (fetch-with-curl url))
|
||||
(:vision (vision-browse url))
|
||||
(t (fetch-with-lynx url))))
|
||||
#+end_src
|
||||
|
||||
** Neuro-Cognitive Intelligence
|
||||
#+begin_src lisp :tangle projects/org-skill-web-research/src/research-logic.lisp
|
||||
(defun neuro-skill-web-research (context)
|
||||
"Neural stage for multi-modal web research.
|
||||
If the user asks for visual details or the site is JS-heavy, it defaults to :vision."
|
||||
(let* ((payload (getf context :payload))
|
||||
(url (getf payload :url))
|
||||
(query (getf payload :query))
|
||||
(prefer-vision (getf payload :vision-p)))
|
||||
|
||||
(if url
|
||||
(let* ((engine (if prefer-vision :vision :curl))
|
||||
(content (web-fetch url engine)))
|
||||
(format nil "
|
||||
I fetched the following content from ~a using ~a:
|
||||
---
|
||||
~a
|
||||
---
|
||||
|
||||
TASK:
|
||||
If a screenshot was provided (as base64), it will be analyzed by the multimodal layer.
|
||||
Summarize the key information or answer the original query: ~a
|
||||
" url engine (getf content :text) query))
|
||||
;; If no URL, we might need to search first
|
||||
(format nil "No URL provided for research. Query: ~a" query))))
|
||||
#+end_src
|
||||
|
||||
** Trigger Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-web-research/src/research-logic.lisp
|
||||
(defun trigger-skill-web-research (context)
|
||||
|
||||
Reference in New Issue
Block a user