46 lines
1.3 KiB
Org Mode
46 lines
1.3 KiB
Org Mode
#+TITLE: SKILL: Config Manager (org-skill-config-manager.org)
|
|
#+AUTHOR: Agent
|
|
#+FILETAGS: :skill:setup:config:
|
|
#+PROPERTY: header-args:lisp :tangle org-skill-config-manager.lisp
|
|
|
|
* Overview
|
|
The *Config Manager* skill provides the OpenCortex Agent with the capability to manage its own environment variables and provider configurations.
|
|
|
|
* Implementation
|
|
|
|
** Package Context
|
|
#+begin_src lisp
|
|
(in-package :opencortex)
|
|
#+end_src
|
|
|
|
** Configuration Logic
|
|
#+begin_src lisp
|
|
(defun get-oc-config-dir ()
|
|
"Returns the absolute path to the opencortex config directory."
|
|
(let ((xdg (uiop:getenv "OC_CONFIG_DIR))
|
|
(if (and xdg (string/= xdg
|
|
(uiop:ensure-directory-pathname xdg)
|
|
(uiop:ensure-directory-pathname (merge-pathnames ".config/opencortex/" (user-homedir-pathname))))))
|
|
|
|
(defun save-providers ()
|
|
"Stubs for saving provider configuration."
|
|
(harness-log "CONFIG: Providers saved.)
|
|
|
|
(defun configure-provider (id)
|
|
"Stubs for configuring a provider."
|
|
(harness-log "CONFIG: Configured provider ~a" id))
|
|
|
|
(defun run-setup-wizard ()
|
|
"Interactive setup wizard for OpenCortex."
|
|
(format t "--- OpenCortex Setup Wizard ---~%
|
|
(save-providers)
|
|
(doctor-main))
|
|
#+end_src
|
|
|
|
** Skill Registration
|
|
#+begin_src lisp
|
|
(defskill :skill-config-manager
|
|
:priority 100
|
|
:trigger (lambda (ctx) (declare (ignore ctx)) nil))
|
|
#+end_src
|