Files
skillshare/internal/plugin/targets.go
T
Krishnaswamy Subramanian eb9b2b28f9 feat(plugin): add --all flag to plugin update and enable antigravity-cli updates (#656)
* Add --all flag to plugin update and enable agy

Add -a/--all to skillshare plugin update so users can update all
tracked plugins in a single command without tying slow target CLI runs
to skillshare update --all or sync --all.

- Reject --all outside plugin update or when combined with a plugin
  name or --source-ref
- Share source repository discoveries and discovery errors across the
  Preview and Apply lifecycle via Service.WithDiscoveryCache so multi-
  plugin marketplaces are cloned at most once per command
- Isolate source, manifest, and target failures per binding when --all
  is active so healthy plugins update while partial failures exit
  non-zero and leave failed bindings unchanged in config.yaml
- Skip unfiltered OMP bindings during --all updates so sibling targets
  on the same package still update without failing the batch
- Enable plugin update for antigravity-cli while skipping disabled
  plugins when agy extensions list reports an entry as disabled

Closes #653

* Add plugin update --all to docs and completions

Advertise -a/--all for skillshare plugin across all five shell
completion scripts and document the bulk update workflow and
antigravity-cli update support in the user and built-in skill docs.

- Add --all and -a to plugin completions in bash, zsh, fish,
  PowerShell, and Nushell with TestPluginCompletionsIncludeAllFlag
- Document update [NAME | --all], -a/--all, and antigravity-cli source
  updates in website/docs/reference/commands/plugin.md (and its
  zh-Hans, zh-Hant, ja, and ko translations), sharing-plugins.md, and
  quick-reference.md
- Document plugin update --all and antigravity-cli enablement checks in
  skills/skillshare/references/plugins.md

* Require known enabled state for native updates

Require a matching EnabledKnown && Enabled inventory entry before
updating copilot or antigravity-cli bindings, and align the localized
plugin workflow pages with the English docs.

- Skip copilot and antigravity-cli updates in Service.Preview and
  refuse reinstallation in applyNativeTarget when the binding is absent
  from native inventory or not known to be enabled
- Cover absent native inventory in
  TestAntigravityCLIUpdateRespectsEnablement
- Synchronize plugin update [name | --all] and Antigravity CLI update
  guidance across the ja, ko, zh-Hans, and zh-Hant copies of
  quick-reference.md and sharing-plugins.md
2026-10-27 20:57:43 +08:00

36 lines
2.5 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"`
// Npm marks a target that installs npm: packages (see pi_npm.go).
Npm bool `json:"npm,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: "omp", Label: "Oh My Pi", Project: true, Operations: []string{"add", "import", "sync", "check", "remove", "enable", "disable"}, Reason: "Reviewed marketplace installs and scoped removals are supported. Removal retains shared cache and settings; native updates remain blocked because they can damage other projects.", ReasonKey: "plugins.reason.omp"},
{Target: "antigravity-cli", Label: "Antigravity CLI", Operations: all},
{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
}