feat(desktopctl): add thinking proxy status monitoring

This commit is contained in:
Finessse
2025-12-25 05:48:29 +07:00
parent a6eecfb8d5
commit 3c72b950d3
2 changed files with 25 additions and 19 deletions
+13 -9
View File
@@ -47,15 +47,19 @@ func StatusFor(configPath string) (Status, error) {
}
out := Status{
Running: running,
Managed: managed,
AutoStartProxy: s != nil && s.AutoStartProxy,
PID: pidOrZero(s),
Port: port,
BaseURL: baseURL,
ConfigPath: resolvedConfig,
ExePath: exeOrEmpty(s),
StartedAt: startedAtOrZero(s),
Running: running,
Managed: managed,
AutoStartProxy: s != nil && s.AutoStartProxy,
PID: pidOrZero(s),
Port: port,
ThinkingPort: 8317,
BaseURL: baseURL,
ConfigPath: resolvedConfig,
ExePath: exeOrEmpty(s),
StartedAt: startedAtOrZero(s),
}
if inUse, _ := isLocalPortInUse(8317); inUse {
out.ThinkingRunning = true
}
if healthErr != nil {
out.LastError = healthErr.Error()
+12 -10
View File
@@ -3,16 +3,18 @@ package desktopctl
import "time"
type Status struct {
Running bool `json:"running"`
Managed bool `json:"managed"`
AutoStartProxy bool `json:"auto_start_proxy,omitempty"`
PID int `json:"pid,omitempty"`
Port int `json:"port,omitempty"`
BaseURL string `json:"base_url,omitempty"`
ConfigPath string `json:"config_path,omitempty"`
ExePath string `json:"exe_path,omitempty"`
StartedAt time.Time `json:"started_at,omitempty"`
LastError string `json:"last_error,omitempty"`
Running bool `json:"running"`
Managed bool `json:"managed"`
AutoStartProxy bool `json:"auto_start_proxy,omitempty"`
PID int `json:"pid,omitempty"`
Port int `json:"port,omitempty"`
ThinkingPort int `json:"thinking_port,omitempty"`
ThinkingRunning bool `json:"thinking_running,omitempty"`
BaseURL string `json:"base_url,omitempty"`
ConfigPath string `json:"config_path,omitempty"`
ExePath string `json:"exe_path,omitempty"`
StartedAt time.Time `json:"started_at,omitempty"`
LastError string `json:"last_error,omitempty"`
}
type StartOptions struct {