Files
skillshare/internal/plugin/targets.go
T
Willie b201caab5b feat(plugin): update Codex plugins by adding them again
Codex has no plugin update command, so Skillshare refused to update a
Codex binding and left that Agent to be maintained by hand. Codex's add
replaces an installed plugin with its marketplace's current copy
atomically, so an update now refreshes the reviewed snapshot, adds the
plugin again, and checks the installed version.

Add always enables the plugin, so one disabled in Codex is skipped with
the reason rather than turned back on. An imported binding is skipped
too, since Codex upgrades Git marketplaces itself. Both are skipped, not
blocked, so the plugin's other Agents still update in the same run.

Refs #309
2026-10-01 16:50:32 +08:00

33 lines
2.2 KiB
Go

package plugin
// TargetDefinition is the shared capability contract for CLI, TUI and dashboard.
// An empty operation list means discovery-only, not an installed/usable target.
type TargetDefinition struct {
Target string `json:"target"`
Label string `json:"label"`
Project bool `json:"project"`
Operations []string `json:"operations"`
Reason string `json:"reason,omitempty"`
// ReasonKey names Reason for the dashboard to translate; Reason is the fallback.
ReasonKey string `json:"reasonKey,omitempty"`
}
func TargetDefinitions() []TargetDefinition {
all := []string{"add", "import", "sync", "check", "update", "remove", "enable", "disable"}
definitions := []TargetDefinition{
{Target: "claude", Label: "Claude Code", Project: true, Operations: all},
{Target: "codex", Label: "Codex", Operations: all},
{Target: "cursor", Label: "Cursor", Operations: []string{"add", "sync", "check", "update", "remove", "enable", "disable"}},
{Target: "antigravity", Label: "Antigravity Desktop", Project: true, Operations: []string{"add", "sync", "check", "update", "remove", "enable", "disable"}},
{Target: "pi", Label: "Pi", Project: true, Operations: all},
{Target: "opencode", Label: "OpenCode", Project: true, Operations: all},
{Target: "antigravity-cli", Label: "Antigravity CLI", Operations: []string{"add", "import", "sync", "check", "remove", "enable", "disable"}, Reason: "Updates require review in Antigravity CLI to preserve native enablement.", ReasonKey: "plugins.reason.antigravity-cli"},
{Target: "copilot", Label: "GitHub Copilot CLI", Operations: all},
{Target: "grok", Label: "Grok Build", Operations: []string{"import", "sync", "check", "remove", "enable", "disable"}, Reason: "Install or update in Grok to complete native trust, then import.", ReasonKey: "plugins.reason.grok"},
{Target: "kimi", Label: "Kimi Code", Operations: []string{}, Reason: automationProblem("kimi"), ReasonKey: "plugins.problem.kimi"},
{Target: "hermes", Label: "Hermes", Operations: []string{}, Reason: automationProblem("hermes"), ReasonKey: "plugins.problem.hermes"},
{Target: "devin", Label: "Devin", Operations: []string{}, Reason: automationProblem("devin"), ReasonKey: "plugins.problem.devin"},
}
return definitions
}