feat: pin agent definitions next to skills
A source can install agents (agents/<name>.md files with a frontmatter name) alongside or instead of skills. - manifest: optional "agents" selection; lock: "agents" map - add --agent / --all-agents, remove --agent, list shows the kind - check/update diff agents like skills (files, not directories) - dashboard lists and removes agents - home-manager module: agentTargets (default .claude/agents) links <name>.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0aedef8c8c
commit
df8d11d8cb
15 files changed
+648
-131
No files matched your search
@@ -25,8 +25,11 @@ const (
|
||||
modeSub
|
||||
)
|
||||
|
||||
// row is a source header (skill == "") or one of its installed skills.
|
||||
type row struct{ source, skill, path string }
|
||||
// row is a source header (skill == "") or one of its installed skills or agents.
|
||||
type row struct {
|
||||
source, skill, path string
|
||||
agent bool
|
||||
}
|
||||
|
||||
type statusMsg struct {
|
||||
source string
|
||||
@@ -110,7 +113,7 @@ func (d *dashboard) reload() error {
|
||||
for _, src := range slices.Sorted(maps.Keys(bySource)) {
|
||||
d.rows = append(d.rows, row{source: src})
|
||||
for _, i := range bySource[src] {
|
||||
d.rows = append(d.rows, row{source: src, skill: i.Name, path: i.Path})
|
||||
d.rows = append(d.rows, row{source: src, skill: i.Name, path: i.Path, agent: i.Agent})
|
||||
}
|
||||
}
|
||||
for src := range d.status {
|
||||
@@ -281,7 +284,7 @@ func (d *dashboard) key(msg tea.KeyPressMsg) tea.Cmd {
|
||||
d.review([]core.SourceStatus{d.status[r.source]})
|
||||
case "d":
|
||||
if r.skill != "" {
|
||||
d.ask(fmt.Sprintf("remove %s from %s?", r.skill, r.source), func() tea.Cmd { return d.remove(r.skill) })
|
||||
d.ask(fmt.Sprintf("remove %s from %s?", r.skill, r.source), func() tea.Cmd { return d.remove(r.skill, r.agent) })
|
||||
} else {
|
||||
d.ask(fmt.Sprintf("remove source %s and all its skills?", r.source), func() tea.Cmd { return d.removeSource(r.source) })
|
||||
}
|
||||
@@ -325,10 +328,14 @@ func (d *dashboard) add(url string, found, chosen []skills.Skill) tea.Cmd {
|
||||
}
|
||||
}
|
||||
|
||||
func (d *dashboard) remove(skill string) tea.Cmd {
|
||||
func (d *dashboard) remove(skill string, agent bool) tea.Cmd {
|
||||
store := d.store
|
||||
return func() tea.Msg {
|
||||
key, err := store.Remove(skill)
|
||||
rm := store.Remove
|
||||
if agent {
|
||||
rm = store.RemoveAgent
|
||||
}
|
||||
key, err := rm(skill)
|
||||
return doneMsg{fmt.Sprintf("removed %s from %s", skill, key), []string{key}, err}
|
||||
}
|
||||
}
|
||||
@@ -367,11 +374,15 @@ func (d *dashboard) render() string {
|
||||
}
|
||||
mark := " "
|
||||
for _, ch := range st.Changes {
|
||||
if ch.Name == r.skill {
|
||||
if ch.Name == r.skill && ch.Agent == r.agent {
|
||||
mark = symbol(ch.Kind)
|
||||
}
|
||||
}
|
||||
fmt.Fprintf(&b, "%s %s %s %s\n", cursor, mark, r.skill, dim.Render(r.path))
|
||||
name := r.skill
|
||||
if r.agent {
|
||||
name += " " + dim.Render("(agent)")
|
||||
}
|
||||
fmt.Fprintf(&b, "%s %s %s %s\n", cursor, mark, name, dim.Render(r.path))
|
||||
}
|
||||
if len(d.rows) == 0 {
|
||||
b.WriteString(dim.Render(" no skills yet; press a to add a source") + "\n")
|
||||
|
||||
@@ -132,7 +132,7 @@ func (r *review) view() string {
|
||||
|
||||
var left strings.Builder
|
||||
for j, ch := range st.Changes {
|
||||
line := symbol(ch.Kind) + " " + ch.Name
|
||||
line := symbol(ch.Kind) + " " + ch.Label()
|
||||
if j == r.sel {
|
||||
line = selected.Render("› ") + line
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user