fix(tui): complete reconstruction of tui-client.org to resolve catastrophic syntax failures

This commit is contained in:
2026-04-28 19:40:22 -04:00
parent 8a54e769c4
commit 553c93e2c7

View File

@@ -1,4 +1,3 @@
#+PROPERTY: header-args:lisp :tangle tui-client.lisp
#+TITLE: OpenCortex TUI Client (Standalone)
#+STARTUP: content
#+FILETAGS: :tui:ux:client:
@@ -8,7 +7,7 @@
The OpenCortex TUI Client is a standalone Common Lisp application built on **Croatoan**.
* Test Suite
#+begin_src lisp :tangle tui-client.lisp
#+begin_src lisp :tangle tests/tui-tests.lisp
(defpackage :opencortex-tui-tests
(:use :cl :opencortex)
(:export #:tui-suite))
@@ -16,9 +15,9 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro
(in-package :opencortex-tui-tests)
(eval-when (:compile-toplevel :load-toplevel :execute)
(ql:quickload :fiveam))
(ql:quickload :fiveam :silent t))
(fiveam:def-suite tui-suite :description "Verification of the TUI parsing and styling logic
(fiveam:def-suite tui-suite :description "Verification of the TUI parsing and styling logic")
(fiveam:in-suite tui-suite)
(fiveam:test test-tui-connection-drop
@@ -46,7 +45,7 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro
** Global State
#+begin_src lisp
(defvar *daemon-host* "127.0.0.1
(defvar *daemon-host* "127.0.0.1")
(defvar *daemon-port* 9105)
(defvar *socket* nil)
(defvar *stream* nil)
@@ -86,7 +85,7 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro
(defun render-chat (win)
(clear win)
(let* ((h (height win))
(view-height (- h 2))
(view-height (max 0 (- h 2)))
(history-len (length *chat-history*))
(start-idx *scroll-index*)
(end-idx (min history-len (+ start-idx view-height)))
@@ -116,10 +115,10 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro
(finish-output stream))
(error (c)
(declare (ignore c))
(enqueue-msg "ERROR: Connection to daemon lost.
(enqueue-msg "ERROR: Connection to daemon lost.")
(setf *is-running* nil))))
(when (string= cmd "/exit (setf *is-running* nil))
(when (string= cmd "/clear (setf *chat-history* nil))))
(when (string= cmd "/exit") (setf *is-running* nil))
(when (string= cmd "/clear") (setf *chat-history* nil))))
#+end_src
** Main Entry Point