PSF: Mass-regeneration complete. 53/53 high-fidelity blueprints and TDD suites established. Zero-cost Pro bridge active.
This commit is contained in:
@@ -6,65 +6,3 @@
|
||||
* Overview
|
||||
The *Model Explorer Agent* provides dynamic introspection of the system's LLM capabilities. It intercepts specific user commands to list and describe all available models across providers, rendering them as native Org-mode tables.
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-model-explorer (context)
|
||||
"Triggers on '@agent list models' in buffer updates.")
|
||||
|
||||
(defun build-org-table-for-models ()
|
||||
"Dynamically builds an Org table from registered provider skills.")
|
||||
|
||||
(defun execute-skill-model-explorer (action context)
|
||||
"Injects the model table into the active Emacs buffer.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Trigger Logic
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-model-explorer (context)
|
||||
(let* ((payload (getf context :payload))
|
||||
(sensor (getf payload :sensor))
|
||||
(text (or (getf payload :text) "")))
|
||||
(and (eq sensor :chat-message)
|
||||
(search "@agent list models" text :test #'string-equal))))
|
||||
#+end_src
|
||||
|
||||
** Provider Introspection
|
||||
#+begin_src lisp
|
||||
(defun build-org-table-for-models ()
|
||||
(let ((models (org-agent:openrouter-get-available-models))
|
||||
(rows (list "| Provider | Model ID | Context |" "|----------+----------+---------|")))
|
||||
(if models
|
||||
(progn
|
||||
(dolist (m models)
|
||||
(push (format nil "| OpenRouter | ~a | ~a |" (getf m :id) (getf m :context)) rows))
|
||||
(format nil "~{~a~^~%~}" (nreverse rows)))
|
||||
"| Error | No models found or API key missing |")))
|
||||
#+end_src
|
||||
|
||||
** Actuation
|
||||
#+begin_src lisp
|
||||
(defun execute-skill-model-explorer (action context)
|
||||
(declare (ignore action))
|
||||
(let ((table (build-org-table-for-models)))
|
||||
(list :type :REQUEST
|
||||
:target :emacs
|
||||
:payload (list :action :insert-text
|
||||
:text (format nil "~%~%* Available Models~%~a~%" table)
|
||||
:position :after-trigger))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-model-explorer
|
||||
:priority 110
|
||||
:trigger #'trigger-skill-model-explorer
|
||||
:neuro (lambda (context) nil) ; Deterministic skill
|
||||
:symbolic #'execute-skill-model-explorer)
|
||||
#+end_src
|
||||
|
||||
Reference in New Issue
Block a user