def frame_io
cswap-bend-cli@0.1.0.0 · tui/run.bend:151
import cswap-bend-cli@0.1.0.0/tui/run.bend as Run
import Base
import cswap-bend-cli@0.1.0.0/tui/model.bend as M
151def frame_io(+v: M.View, +version: String, +root: String, +state: String) -> IO(String):
152 do IO<String>:
153 now : U32 <- clock_now()
154 off : U32 <- local_off()
155 seq_t : String <- read_text(root ++ "/sequence.json")
156 cache_t : String <- read_text(root ++ "/cache/usage.json")
157 settings_t : String <- read_text(root ++ "/settings.json")
158 +status_t : String <- read_text(state ++ "/daemon-status.json")
159 log_t : String <- tail_text(state ++ "/daemon.log", "8")
160 live : Bool <- alive(pid_of(status_t))
161 IO.pure(String, frame_of(v, version, now, off, live, seq_t, cache_t, status_t, settings_t, log_t))