diff --git a/internal/desktopctl/desktopctl.go b/internal/desktopctl/desktopctl.go index aa862581..1182fc08 100644 --- a/internal/desktopctl/desktopctl.go +++ b/internal/desktopctl/desktopctl.go @@ -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() diff --git a/internal/desktopctl/types.go b/internal/desktopctl/types.go index 169b6b14..17d194c3 100644 --- a/internal/desktopctl/types.go +++ b/internal/desktopctl/types.go @@ -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 {