fix(tui): complete reconstruction of tui-client.org to resolve catastrophic syntax failures
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
#+PROPERTY: header-args:lisp :tangle tui-client.lisp
|
|
||||||
#+TITLE: OpenCortex TUI Client (Standalone)
|
#+TITLE: OpenCortex TUI Client (Standalone)
|
||||||
#+STARTUP: content
|
#+STARTUP: content
|
||||||
#+FILETAGS: :tui:ux:client:
|
#+FILETAGS: :tui:ux:client:
|
||||||
@@ -8,7 +7,7 @@
|
|||||||
The OpenCortex TUI Client is a standalone Common Lisp application built on **Croatoan**.
|
The OpenCortex TUI Client is a standalone Common Lisp application built on **Croatoan**.
|
||||||
|
|
||||||
* Test Suite
|
* Test Suite
|
||||||
#+begin_src lisp :tangle tui-client.lisp
|
#+begin_src lisp :tangle tests/tui-tests.lisp
|
||||||
(defpackage :opencortex-tui-tests
|
(defpackage :opencortex-tui-tests
|
||||||
(:use :cl :opencortex)
|
(:use :cl :opencortex)
|
||||||
(:export #:tui-suite))
|
(: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)
|
(in-package :opencortex-tui-tests)
|
||||||
|
|
||||||
(eval-when (:compile-toplevel :load-toplevel :execute)
|
(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:in-suite tui-suite)
|
||||||
|
|
||||||
(fiveam:test test-tui-connection-drop
|
(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
|
** Global State
|
||||||
#+begin_src lisp
|
#+begin_src lisp
|
||||||
(defvar *daemon-host* "127.0.0.1
|
(defvar *daemon-host* "127.0.0.1")
|
||||||
(defvar *daemon-port* 9105)
|
(defvar *daemon-port* 9105)
|
||||||
(defvar *socket* nil)
|
(defvar *socket* nil)
|
||||||
(defvar *stream* 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)
|
(defun render-chat (win)
|
||||||
(clear win)
|
(clear win)
|
||||||
(let* ((h (height win))
|
(let* ((h (height win))
|
||||||
(view-height (- h 2))
|
(view-height (max 0 (- h 2)))
|
||||||
(history-len (length *chat-history*))
|
(history-len (length *chat-history*))
|
||||||
(start-idx *scroll-index*)
|
(start-idx *scroll-index*)
|
||||||
(end-idx (min history-len (+ start-idx view-height)))
|
(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))
|
(finish-output stream))
|
||||||
(error (c)
|
(error (c)
|
||||||
(declare (ignore c))
|
(declare (ignore c))
|
||||||
(enqueue-msg "ERROR: Connection to daemon lost.
|
(enqueue-msg "ERROR: Connection to daemon lost.")
|
||||||
(setf *is-running* nil))))
|
(setf *is-running* nil))))
|
||||||
(when (string= cmd "/exit (setf *is-running* nil))
|
(when (string= cmd "/exit") (setf *is-running* nil))
|
||||||
(when (string= cmd "/clear (setf *chat-history* nil))))
|
(when (string= cmd "/clear") (setf *chat-history* nil))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Main Entry Point
|
** Main Entry Point
|
||||||
|
|||||||
Reference in New Issue
Block a user