Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/agentsetup/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (p CursorProvider) Detect() Status {
}
status.Detected = true
status.ExecutablePath = binPath
status.Status = StatusMissing
status.Status = StatusUnknown
// Signal to the TUI that this row is not actionable from the CLI.
status.Error = "run /add-plugin stripe inside Cursor agent"
return status
Expand Down
4 changes: 2 additions & 2 deletions pkg/agentsetup/cursor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestCursor_NotDetected(t *testing.T) {
require.Equal(t, StatusNotDetected, status.Status)
}

func TestCursor_DetectedAlwaysMissing(t *testing.T) {
func TestCursor_DetectedAlwaysUnknown(t *testing.T) {
provider := CursorProvider{
Scanner: Scanner{LookPath: func(string) (string, error) { return "/usr/local/bin/cursor", nil }},
}
Expand All @@ -29,7 +29,7 @@ func TestCursor_DetectedAlwaysMissing(t *testing.T) {

require.True(t, status.Detected)
require.Equal(t, "/usr/local/bin/cursor", status.ExecutablePath)
require.Equal(t, StatusMissing, status.Status)
require.Equal(t, StatusUnknown, status.Status)
require.False(t, status.Plugin.Installed)
}

Expand Down
1 change: 1 addition & 0 deletions pkg/agentsetup/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const (
StatusNotDetected = "not_detected"
StatusInstalled = "installed"
StatusMissing = "missing"
StatusUnknown = "unknown"
StatusError = "error"

ActionNone = "none"
Expand Down
26 changes: 0 additions & 26 deletions pkg/cmd/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ type agentSetupCmd struct {
}

type agentSetupJSON struct {
Status string `json:"status"`
Clients []agentsetup.Status `json:"clients"`
Skills *skillsScopesJSON `json:"skills,omitempty"`
Actions []agentsetup.Plan `json:"actions,omitempty"`
Expand Down Expand Up @@ -584,7 +583,6 @@ func skillsScopeVisible(d agentskills.DirStatus, scopes skillsScopes) bool {

func (asc *agentSetupCmd) writeJSON(w io.Writer, providers map[string]agentsetup.Provider, statuses []agentsetup.Status, view skillsStatusView) error {
result := agentSetupJSON{
Status: aggregateStatus(statuses),
Clients: statuses,
}
for _, status := range statuses {
Expand Down Expand Up @@ -678,30 +676,6 @@ func detectedStatuses(statuses []agentsetup.Status) []agentsetup.Status {
return detected
}

// aggregateStatus collapses per-client statuses into a single headline status,
// surfacing the most actionable state first.
func aggregateStatus(statuses []agentsetup.Status) string {
var missing, installed bool
for _, s := range statuses {
switch s.Status {
case agentsetup.StatusError:
return agentsetup.StatusError
case agentsetup.StatusMissing:
missing = true
case agentsetup.StatusInstalled:
installed = true
}
}
switch {
case missing:
return agentsetup.StatusMissing
case installed:
return agentsetup.StatusInstalled
default:
return agentsetup.StatusNotDetected
}
}

// printStatusTable renders a compact, aligned, color-coded view of each client
// and its Stripe plugin state. Colors are disabled automatically when the writer
// is not a TTY (via ansi.Color).
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func TestAgentSetupJSONReportsActionWithoutInstalling(t *testing.T) {

var result agentSetupJSON
require.NoError(t, json.Unmarshal([]byte(output), &result))
require.Equal(t, agentsetup.StatusMissing, result.Status)
require.Len(t, result.Clients, 1)
require.True(t, result.Clients[0].Detected)
require.False(t, result.Clients[0].Plugin.Installed)
Expand Down
Loading