library: a project's skills can be given to DeepSeek Harness, in the project's .agents/skills
xingchen_c on Discord (#general, 11-04): "资源库按照项目配置能否支持一下dsh".
projectSkillsDirs left dsh out, its comment saying it reads no project
folder magpie can rely on. It does, and always has: the skill provider
every dsh profile mounts (dsh-base's cordis.patch.yml, id skill-filesystem)
scans <projectRoot>/.dsh/skills (rank 100) and <projectRoot>/.agents/skills
(rank 200), the project root being the nearest folder up from the
session's cwd with a .git, else the cwd (roots and findProjectRoot in
@deepseek-ai/dsh-skill-filesystem 0.2.1-rc.5; the same two joins in
0.0.1-rc.3, 0.1.0-rc.6, 0.1.5-rc.3, 0.1.7-rc.2, 0.2.0-rc.2, 0.2.1-rc.1
and 0.2.2-alpha.3). dsh now gets the shared .agents/skills, so the
project row lists it and one link serves it with Codex and the rest.
MCP stays as it was: dsh's servers are dsh-mcp-client rows in a
profile's patch layers (bundles, the profile's and $DSH_HOME's
cordis.patch.yml, --patch overlays; composeProfile in @deepseek-ai/dsh
0.2.1-rc.5), none of them the project's. Said in project_mcp.go and
docs/subsystems/library.md.
Run:
- mote: go test -count=1 ./internal/library/ ok (102.9s); gofmt -l
clean; GOOS=windows and GOOS=linux go vet ./internal/library/ ok.
- Broken by hand: TestProjectSkillsDsh with projects.go at origin/main
fails ("magpie knows of no folder dsh reads a project's skills from").
- Real dsh: @deepseek-ai/dsh 0.2.1-rc.5 from npm on mote, sandbox HOME
and DSH_HOME, headless profile against a fake OpenAI-compatible server.
Run in a folder with .git, a skill linked into its .agents/skills is in
the request's <available_skills>; run in a folder with no .git, its own
.agents/skills is read; run in a subfolder of the repository, only the
root's is read, not the subfolder's (filed as #5172).
- GUI: /api/library's view from library.Read with a sandbox ~/.dsh,
served to the real assets in Chromium and WebKit, en and zh: the
project card's skill rows have a dsh chip (lit where given), and the
"reads no project skills folder" line no longer names it.
Not tried: the dsh Desktop app (its own profile; the same base bundle
is assumed, not checked); the full GUI suite (no GUI file changed);
Windows copy mode with a real dsh.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -37,6 +37,10 @@ import (
|
||||
// (docs.factory.com/cli/configuration/mcp). Qoder and CodeBuddy, like
|
||||
// Claude Code, ask the user to approve a project's server before using
|
||||
// it. Each is written in the shape the agent's user-wide file has.
|
||||
// DeepSeek Harness has none: its servers are @deepseek-ai/dsh-mcp-client
|
||||
// rows in a profile's patch layers (bundles, the profile's and
|
||||
// $DSH_HOME's cordis.patch.yml, --patch overlays; composeProfile in
|
||||
// @deepseek-ai/dsh 0.2.1-rc.5's profile-boot), none of them the project's.
|
||||
var projectMCPFiles = map[string]struct {
|
||||
rel string
|
||||
format mcpFormat
|
||||
|
||||
@@ -129,3 +129,37 @@ func TestProjectServersCodeBuddyMcpJSON(t *testing.T) {
|
||||
t.Errorf("after: %v", s)
|
||||
}
|
||||
}
|
||||
|
||||
// xingchen_c on Discord: DeepSeek Harness couldn't be given a project's
|
||||
// skills. It reads <projectRoot>/.agents/skills (and .dsh/skills), the
|
||||
// project root being the nearest folder with a .git, so the project's
|
||||
// shared folder is where it gets them, listed for it on the page too.
|
||||
func TestProjectSkillsDsh(t *testing.T) {
|
||||
h, proj := projectLib(t)
|
||||
write(t, filepath.Join(h, ".dsh/profiles/web/cordis.patch.yml"), "[]\n")
|
||||
os.MkdirAll(filepath.Join(proj, ".git"), 0o755)
|
||||
ok(t)(ProjectSkill(proj, "pdf", []string{"dsh"}))
|
||||
p := filepath.Join(proj, ".agents/skills/pdf")
|
||||
if !isLink(t, p) || !ours(p, "pdf") {
|
||||
t.Errorf("%s isn't a link to the library's", p)
|
||||
}
|
||||
if g := read(t, filepath.Join(proj, ".gitignore")); !strings.Contains(g, "/.agents/skills/pdf\n") {
|
||||
t.Errorf(".gitignore lacks /.agents/skills/pdf:\n%s", g)
|
||||
}
|
||||
v, err := Read(nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
i := slices.IndexFunc(v.Agents, func(a AgentView) bool { return a.ID == "dsh" })
|
||||
if i < 0 {
|
||||
t.Fatal("no dsh on the page")
|
||||
}
|
||||
if v.Agents[i].ProjectSkills != ".agents/skills" {
|
||||
t.Errorf("dsh's project skills: %q", v.Agents[i].ProjectSkills)
|
||||
}
|
||||
// it reads no project MCP file: its servers are rows in its profiles'
|
||||
// patch lists, which have no project layer
|
||||
if v.Agents[i].ProjectMCP != "" {
|
||||
t.Errorf("dsh's project MCP: %q", v.Agents[i].ProjectMCP)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,9 +57,16 @@ type Project struct {
|
||||
// (getProjectSkillsDir, @qoder-ai/qodercli 1.1.69, whose .agents/skills
|
||||
// a setting can turn off), CodeBuddy Code .codebuddy/skills
|
||||
// (getProjectSkillsDir, @tencent-ai/codebuddy-code 2.164.0) and Command
|
||||
// Code .commandcode/skills (commandcode.ai/docs/skills). MiMo Code, Crush,
|
||||
// ZCode, DeepSeek Harness and oh-my-pi say of no project folder magpie can
|
||||
// rely on.
|
||||
// Code .commandcode/skills (commandcode.ai/docs/skills). DeepSeek Harness
|
||||
// reads <projectRoot>/.dsh/skills and <projectRoot>/.agents/skills, the
|
||||
// project root being the nearest folder up from where it runs with a .git
|
||||
// in it, else that folder itself (the provider's roots and findProjectRoot,
|
||||
// @deepseek-ai/dsh-skill-filesystem 0.2.1-rc.5, mounted by dsh-base's
|
||||
// cordis.patch.yml in every profile; the same since 0.0.1-rc.3), so it is
|
||||
// given the shared one. A project folder inside a repository but not at
|
||||
// its root isn't read by dsh: run there, it looks in the repository's
|
||||
// root (#5172). MiMo Code, Crush,
|
||||
// ZCode and oh-my-pi say of no project folder magpie can rely on.
|
||||
var projectSkillsDirs = map[string]string{
|
||||
"claude": ".claude/skills",
|
||||
"codex": ".agents/skills",
|
||||
@@ -74,6 +81,7 @@ var projectSkillsDirs = map[string]string{
|
||||
"grok": ".agents/skills",
|
||||
"droid": ".agents/skills",
|
||||
"cline": ".agents/skills",
|
||||
"dsh": ".agents/skills",
|
||||
"qoder": ".qoder/skills",
|
||||
"qoder-cn": ".qoder/skills",
|
||||
"codebuddy": ".codebuddy/skills",
|
||||
|
||||
Reference in New Issue
Block a user