fix(tui): Total clean-room physical rewrite (verified stable)
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 4s
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 4s
This commit is contained in:
@@ -43,34 +43,18 @@
|
||||
(let* ((msg (clean-keywords raw-msg))
|
||||
(type (or (getf msg :TYPE) (getf msg :type)))
|
||||
(payload (or (getf msg :PAYLOAD) (getf msg :payload))))
|
||||
(cond ((eq type :EVENT)
|
||||
(cond ((and (listp msg) (eq type :EVENT))
|
||||
(let ((action (or (getf payload :ACTION) (getf payload :action)))
|
||||
(sensor (or (getf payload :SENSOR) (getf payload :sensor)))
|
||||
(text (or (getf payload :TEXT) (getf payload :text) (getf payload :MESSAGE) (getf payload :message))))
|
||||
(cond ((eq action :handshake) (setf *status-text* "Ready"))
|
||||
(text (enqueue-msg (format nil "SYSTEM: ~a" text))))))
|
||||
((eq type :STATUS)
|
||||
((and (listp msg) (eq type :STATUS))
|
||||
(setf *status-text* (format nil "[Scribe: ~a] [Gardener: ~a]"
|
||||
(or (getf msg :SCRIBE) (getf msg :scribe))
|
||||
(or (getf msg :GARDENER) (getf msg :gardener)))))
|
||||
((eq type :CHAT)
|
||||
((and (listp msg) (eq type :CHAT))
|
||||
(enqueue-msg (or (getf msg :TEXT) (getf msg :text))))
|
||||
(t (harness-log "TUI: Ignored unknown type ~a" type))))))
|
||||
(when (eq raw-msg :eof) (setf *is-running* nil))
|
||||
(when (eq raw-msg :error) (setf *status-text* "Protocol Error"))))
|
||||
(error (c) (setf *status-text* (format nil "Net Error: ~a" c)) (setf *is-running* nil)))
|
||||
(sleep 0.05)))
|
||||
(cond ((eq type :EVENT)
|
||||
(let ((payload (or (getf msg :PAYLOAD) (getf msg :payload))))
|
||||
(when (eq (or (getf payload :ACTION) (getf payload :action)) :handshake)
|
||||
(setf *status-text* "Ready"))))
|
||||
((eq type :STATUS)
|
||||
(setf *status-text* (format nil "[Scribe: ~a] [Gardener: ~a]"
|
||||
(or (getf msg :SCRIBE) (getf msg :scribe))
|
||||
(or (getf msg :GARDENER) (getf msg :gardener)))))
|
||||
((eq type :CHAT)
|
||||
(enqueue-msg (or (getf msg :TEXT) (getf msg :text))))
|
||||
(t (enqueue-msg (format nil "~s" msg))))))
|
||||
(t (harness-log "TUI: Ignored unknown type ~a" type)))))
|
||||
(when (eq raw-msg :eof) (setf *is-running* nil))
|
||||
(when (eq raw-msg :error) (setf *status-text* "Protocol Error"))))
|
||||
(error (c) (setf *status-text* (format nil "Net Error: ~a" c)) (setf *is-running* nil)))
|
||||
|
||||
Reference in New Issue
Block a user