Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930"""Start a kernel: albedo_cells runs as __main__.
A script is compiled from source each time it starts; a module loads itscached bytecode. The kernel is long, so this keeps about 4 MB of compilework out of every kernel's memory.
With `--run <dir>` the daemon starts this file directly: it leaves thedaemon's session and sends what it writes before its own output capturestarts to `<dir>/kernel.log`."""
import osimport sys
if sys.argv[1:2] == ["--run"]: if os.getpgrp() != os.getpid(): os.setsid() os.makedirs(sys.argv[2], mode=0o700, exist_ok=True) log = os.open( os.path.join(sys.argv[2], "kernel.log"), os.O_WRONLY | os.O_CREAT | os.O_APPEND, 0o600, ) os.dup2(log, 2) os.close(log)
import runpy # noqa: E402
runpy.run_module("albedo_cells", run_name="__main__", alter_sys=True)