fix: remove hardcoded v0.5.0, show daemon version in status bar

- Removed connect-daemon's hardcoded "* Connected v0.5.0 *" message
  (fired before handshake arrived, was always stale)
- Added :daemon-version slot to state plist, filled by handshake handler
- view-status now shows version: "● passepartout v0.7.2 msgs:N Rules:N"
- passepartout script: force cl-tty recompile (:force t) to pick up
  CSI positioning, ioctl sizing, and detection fixes
This commit is contained in:
2026-05-14 09:11:22 -04:00
parent 1884372660
commit adca69d29c
8 changed files with 194 additions and 66 deletions

View File

@@ -706,6 +706,7 @@ Event handlers + daemon I/O + main loop.
(text (setf (st :busy) nil)
(add-msg :agent text :gate-trace gate-trace))
((eq action :handshake)
(setf (st :daemon-version) (getf payload :version))
(add-msg :system (format nil "Connected v~a" (getf payload :version))))
(t (add-msg :agent (format nil "~a" msg))))))
#+END_SRC
@@ -775,10 +776,9 @@ Event handlers + daemon I/O + main loop.
(let ((s (usocket:socket-connect host port :timeout 5)))
(setf (st :stream) (usocket:socket-stream s)
(st :connected) t)
(bt:make-thread (lambda () (reader-loop (st :stream)))
:name "tui-reader")
(add-msg :system (format nil "* Connected v~a *" "0.5.0"))
(return-from connect-daemon t))
(bt:make-thread (lambda () (reader-loop (st :stream)))
:name "tui-reader")
(return-from connect-daemon t))
(usocket:connection-refused-error (c)
(when (= attempt 3)
(add-msg :system (format nil "* No daemon on port ~a after ~a attempts *"

View File

@@ -197,6 +197,7 @@ All state mutation flows through event handlers in the controller.
:command-palette-active nil ; v0.8.0
:command-palette-dialog nil ; v0.8.0
:session-cost 0.0 ; v0.9.0
:daemon-version nil ; filled by handshake
:dirty (list nil nil nil))))
#+END_SRC

View File

@@ -61,11 +61,14 @@ Returns a list of strings, one per line."
(defun view-status (fb w h)
(let* ((bg (theme-color :status-bg))
(fg (theme-color :status-fg))
(left (format nil " ~a ~a msgs:~d Rules:~a"
(if (st :connected) "●" "○")
(or (st :foveal-id) "passepartout")
(length (st :messages))
(or (st :rule-count) 0)))
(ver (st :daemon-version))
(ver-str (if ver (format nil " v~a" ver) ""))
(left (format nil " ~a ~a~a msgs:~d Rules:~a"
(if (st :connected) "●" "○")
(or (st :foveal-id) "passepartout")
ver-str
(length (st :messages))
(or (st :rule-count) 0)))
(right (format nil "$~,2f ~a" (or (st :session-cost) 0.0) (now))))
(dotimes (col w)
(cl-tty.backend:draw-text fb 0 (- h 1) (make-string w :initial-element #\Space) nil bg))