dead code cleanup (#210)
This commit is contained in:
parent
bb0424e1e2
commit
d167b47431
1 changed files with 0 additions and 53 deletions
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -24,12 +23,6 @@ type AvailableSkill struct {
|
||||||
Tags []string `json:"tags"`
|
Tags []string `json:"tags"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type BuiltinSkill struct {
|
|
||||||
Name string `json:"name"`
|
|
||||||
Path string `json:"path"`
|
|
||||||
Enabled bool `json:"enabled"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewSkillInstaller(workspace string) *SkillInstaller {
|
func NewSkillInstaller(workspace string) *SkillInstaller {
|
||||||
return &SkillInstaller{
|
return &SkillInstaller{
|
||||||
workspace: workspace,
|
workspace: workspace,
|
||||||
|
|
@ -123,49 +116,3 @@ func (si *SkillInstaller) ListAvailableSkills(ctx context.Context) ([]AvailableS
|
||||||
|
|
||||||
return skills, nil
|
return skills, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (si *SkillInstaller) ListBuiltinSkills() []BuiltinSkill {
|
|
||||||
builtinSkillsDir := filepath.Join(filepath.Dir(si.workspace), "picoclaw", "skills")
|
|
||||||
|
|
||||||
entries, err := os.ReadDir(builtinSkillsDir)
|
|
||||||
if err != nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var skills []BuiltinSkill
|
|
||||||
for _, entry := range entries {
|
|
||||||
if entry.IsDir() {
|
|
||||||
_ = entry
|
|
||||||
skillName := entry.Name()
|
|
||||||
skillFile := filepath.Join(builtinSkillsDir, skillName, "SKILL.md")
|
|
||||||
|
|
||||||
data, err := os.ReadFile(skillFile)
|
|
||||||
description := ""
|
|
||||||
if err == nil {
|
|
||||||
content := string(data)
|
|
||||||
if idx := strings.Index(content, "\n"); idx > 0 {
|
|
||||||
firstLine := content[:idx]
|
|
||||||
if strings.Contains(firstLine, "description:") {
|
|
||||||
descLine := strings.Index(content[idx:], "\n")
|
|
||||||
if descLine > 0 {
|
|
||||||
description = strings.TrimSpace(content[idx+descLine : idx+descLine])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// skill := BuiltinSkill{
|
|
||||||
// Name: skillName,
|
|
||||||
// Path: description,
|
|
||||||
// Enabled: true,
|
|
||||||
// }
|
|
||||||
|
|
||||||
status := "✓"
|
|
||||||
fmt.Printf(" %s %s\n", status, entry.Name())
|
|
||||||
if description != "" {
|
|
||||||
fmt.Printf(" %s\n", description)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return skills
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue