fix(monitor): restore sync helpers lost in rebase

monitorAPIURL, monitorBrainKey, monitorHomeDir, monitorPath were
added by Codex on remote dev but lost when we force-pushed after
rebase conflict. Restored with simplified Core.Env() usage.

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-03-22 15:52:10 +00:00
parent 39255b1766
commit c484eab2fc

View file

@ -48,6 +48,37 @@ func brainKeyPath(home string) string {
return filepath.Join(home, ".claude", "brain.key")
}
func monitorPath(path string) string {
ds := core.Env("DS")
return core.Replace(core.Replace(path, "\\", ds), "/", ds)
}
func monitorHomeDir() string {
if d := core.Env("CORE_HOME"); d != "" {
return d
}
return core.Env("DIR_HOME")
}
func monitorAPIURL() string {
if u := core.Env("CORE_API_URL"); u != "" {
return u
}
return "https://api.lthn.sh"
}
func monitorBrainKey() string {
if k := core.Env("CORE_BRAIN_KEY"); k != "" {
return k
}
if r := fs.Read(brainKeyPath(monitorHomeDir())); r.OK {
if value, ok := resultString(r); ok {
return core.Trim(value)
}
}
return ""
}
func resultString(r core.Result) (string, bool) {
value, ok := r.Value.(string)
if !ok {