mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
feat(skills): add effective skill resolution and actions (#377)
* feat(skills): add effective skill resolution and actions * refactor(workspace): normalize skill-related env and prompt * chore(api): regenerate skills OpenAPI and SDK artifacts * feat(web): surface effective skill state in console * test(skills): cover API and runtime effective state * fix(web): show adopt action for discovered skills * fix(web): align skill header and show stateful visibility icon * refactor(web): compact skill metadata on narrow layouts * fix(web): constrain long skill text in cards * refactor(skills): narrow default discovery roots * fix(skills): harden managed skill path validation * feat: add path in the results of `use_skill` --------- Co-authored-by: Acbox <acbox0328@gmail.com>
This commit is contained in:
@@ -44,6 +44,7 @@ type SkillEntry struct {
|
||||
Name string
|
||||
Description string
|
||||
Content string
|
||||
Path string
|
||||
Metadata map[string]any
|
||||
}
|
||||
|
||||
@@ -703,6 +704,7 @@ func normalizeGatewaySkill(entry SkillEntry) (agentpkg.SkillEntry, bool) {
|
||||
Name: name,
|
||||
Description: description,
|
||||
Content: content,
|
||||
Path: strings.TrimSpace(entry.Path),
|
||||
Metadata: entry.Metadata,
|
||||
}, true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package flow
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNormalizeGatewaySkillPreservesPath(t *testing.T) {
|
||||
got, ok := normalizeGatewaySkill(SkillEntry{
|
||||
Name: "pdf",
|
||||
Description: "Read PDF instructions",
|
||||
Content: "Use a PDF-aware workflow.",
|
||||
Path: " /data/.agents/skills/pdf ",
|
||||
})
|
||||
if !ok {
|
||||
t.Fatal("normalizeGatewaySkill returned ok=false")
|
||||
}
|
||||
if got.Path != "/data/.agents/skills/pdf" {
|
||||
t.Fatalf("path = %q, want %q", got.Path, "/data/.agents/skills/pdf")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user