fix: setup to org/lisp dirs, TUI protocol, deploy test
- Rewrite setup_system: deploy to org/ and lisp/ instead of harness/ and skills/ - Rewrite doctor_repair: same paths - TUI: add fallback for tui subcommand (matching daemon) - Fix send-message: use ~s instead of (~a) to avoid double-wrapping - Fix input-submit: send proper (:type :event :payload ...) plist format - Remove :timeout arg from get-char (croatoan doesn't support it) - Remove debug log-message from event loop (was noisy) - Verify: TUI runs from XDG deploy, sends messages, daemon processes
This commit is contained in:
@@ -44,12 +44,12 @@ The TUI Client is a Croatoan-based ncurses chat interface for Passepartout. It c
|
||||
#+begin_src lisp
|
||||
(defun send-message (stream msg)
|
||||
"Send a framed s-expression over TCP."
|
||||
(let* ((sexp (format nil "(~a)" msg))
|
||||
(let* ((sexp (format nil "~s" msg))
|
||||
(len (length sexp))
|
||||
(header (format nil "~6,'0x" len)))
|
||||
(write-sequence (babel:string-to-octets (concatenate 'string header sexp)) stream)
|
||||
(force-output stream)
|
||||
(log-message "SENT: ~a" sexp)))
|
||||
(force-output stream)))
|
||||
|
||||
|
||||
(defun read-message (stream)
|
||||
"Read a framed s-expression from TCP."
|
||||
@@ -108,7 +108,7 @@ The TUI Client is a Croatoan-based ncurses chat interface for Passepartout. It c
|
||||
(when (> (length text) 0)
|
||||
(push text *input-history*)
|
||||
(setf *input-history-pos* 0)
|
||||
(send-message stream text)
|
||||
(send-message stream (list :type :event :payload (list :sensor :user-input :text text)))
|
||||
(push (cons :sent text) *chat-history*)
|
||||
(setf *input-buffer* nil))))
|
||||
|
||||
@@ -326,7 +326,7 @@ The TUI Client is a Croatoan-based ncurses chat interface for Passepartout. It c
|
||||
(or (proto-get p :text) (format nil "~a" msg))))
|
||||
*chat-history*))
|
||||
;; handle input
|
||||
(let ((ch (get-char input-win :timeout 0.1)))
|
||||
(let ((ch (get-char input-win)))
|
||||
(when (and ch (not (equal ch -1)))
|
||||
(log-message "KEY: ~s type=~s" ch (type-of ch))
|
||||
(cond
|
||||
|
||||
Reference in New Issue
Block a user