dsh-skill-mcp 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -0
- package/cordis.patch.yml +6 -0
- package/lib/client.js +537 -0
- package/lib/index.js +834 -0
- package/package.json +57 -0
- package/scripts/link-skills.mjs +43 -0
- package/scripts/link-skills.ps1 +20 -0
- package/scripts/link-skills.sh +32 -0
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-skill-mcp",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Management center: link skill directories into the user skills root (enable/disable/unlink/delete) and auto-load each project's own MCP servers via the loader",
|
|
5
|
+
"license": "BSD-3-Clause",
|
|
6
|
+
"homepage": "https://github.com/LvanLa/deepseek-harness-ex/tree/master/plugins/dsh-skill-mcp",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/LvanLa/deepseek-harness-ex.git",
|
|
10
|
+
"directory": "plugins/dsh-skill-mcp"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"dsh",
|
|
14
|
+
"dsh-plugin",
|
|
15
|
+
"deepseek-harness",
|
|
16
|
+
"skills",
|
|
17
|
+
"junction",
|
|
18
|
+
"mcp"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "lib/index.js",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": "./lib/index.js",
|
|
24
|
+
"./client": "./lib/client.js",
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"lib/index.js",
|
|
29
|
+
"lib/client.js",
|
|
30
|
+
"cordis.patch.yml",
|
|
31
|
+
"scripts/link-skills.ps1",
|
|
32
|
+
"scripts/link-skills.sh",
|
|
33
|
+
"scripts/link-skills.mjs",
|
|
34
|
+
"README.md"
|
|
35
|
+
],
|
|
36
|
+
"dsh": {
|
|
37
|
+
"bundle": {
|
|
38
|
+
"patch": "./cordis.patch.yml"
|
|
39
|
+
},
|
|
40
|
+
"client": {
|
|
41
|
+
"platform": "web",
|
|
42
|
+
"inject": [
|
|
43
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
44
|
+
"@deepseek-ai/dsh-client-connection",
|
|
45
|
+
"@deepseek-ai/dsh-client-locale",
|
|
46
|
+
"@deepseek-ai/dsh-client-ui-slots"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
52
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.2",
|
|
53
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.1-rc.2",
|
|
54
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.1-rc.2",
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.2"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Cross-platform entry for the scripted equivalent of the plugin's link
|
|
4
|
+
* feature. Dispatches by OS:
|
|
5
|
+
* win32 -> link-skills.ps1 (NTFS junctions, via PowerShell)
|
|
6
|
+
* darwin / linux -> link-skills.sh (POSIX symlinks, via bash)
|
|
7
|
+
*
|
|
8
|
+
* usage: node link-skills.mjs <source-directory> [target-directory]
|
|
9
|
+
* Target defaults to $DSH_HOME/skills or ~/.dsh/skills.
|
|
10
|
+
*/
|
|
11
|
+
import { spawnSync } from 'node:child_process'
|
|
12
|
+
import { statSync } from 'node:fs'
|
|
13
|
+
import { homedir } from 'node:os'
|
|
14
|
+
import path from 'node:path'
|
|
15
|
+
import { fileURLToPath } from 'node:url'
|
|
16
|
+
|
|
17
|
+
const here = path.dirname(fileURLToPath(import.meta.url))
|
|
18
|
+
const [source, targetArg] = process.argv.slice(2)
|
|
19
|
+
|
|
20
|
+
if (!source || !path.isAbsolute(source)) {
|
|
21
|
+
console.error('usage: node link-skills.mjs <absolute-source-directory> [target-directory]')
|
|
22
|
+
process.exit(2)
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
if (!statSync(source).isDirectory()) throw new Error('not a directory')
|
|
26
|
+
} catch {
|
|
27
|
+
console.error(`Source directory not found: ${source}`)
|
|
28
|
+
process.exit(1)
|
|
29
|
+
}
|
|
30
|
+
const home = process.env.DSH_HOME || path.join(homedir(), '.dsh')
|
|
31
|
+
const target = targetArg || path.join(home, 'skills')
|
|
32
|
+
|
|
33
|
+
const win32 = process.platform === 'win32'
|
|
34
|
+
const script = path.join(here, win32 ? 'link-skills.ps1' : 'link-skills.sh')
|
|
35
|
+
const result = win32
|
|
36
|
+
? spawnSync('powershell.exe', ['-NoProfile', '-NonInteractive', '-File', script, '-SourceDirectory', source, '-TargetDirectory', target], { stdio: 'inherit' })
|
|
37
|
+
: spawnSync('bash', [script, source, target], { stdio: 'inherit' })
|
|
38
|
+
|
|
39
|
+
if (result.error) {
|
|
40
|
+
console.error(result.error.message)
|
|
41
|
+
process.exit(1)
|
|
42
|
+
}
|
|
43
|
+
process.exit(result.status ?? 1)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[Parameter(Mandatory=$true)]
|
|
3
|
+
[string]$SourceDirectory,
|
|
4
|
+
[string]$TargetDirectory = ''
|
|
5
|
+
)
|
|
6
|
+
$ErrorActionPreference = 'Stop'
|
|
7
|
+
if (-not $TargetDirectory) {
|
|
8
|
+
$TargetDirectory = if ($env:DSH_HOME) { Join-Path $env:DSH_HOME 'skills' } else { Join-Path $env:USERPROFILE '.dsh\skills' }
|
|
9
|
+
}
|
|
10
|
+
$source = (Resolve-Path -LiteralPath $SourceDirectory).Path
|
|
11
|
+
New-Item -ItemType Directory -Force -Path $TargetDirectory | Out-Null
|
|
12
|
+
Get-ChildItem -LiteralPath $source -Directory -Force | ForEach-Object {
|
|
13
|
+
$link = Join-Path $TargetDirectory $_.Name
|
|
14
|
+
if (Test-Path -LiteralPath $link) {
|
|
15
|
+
$item = Get-Item -LiteralPath $link -Force
|
|
16
|
+
if ($item.Attributes -band [IO.FileAttributes]::ReparsePoint) { Remove-Item -LiteralPath $link -Force -Recurse }
|
|
17
|
+
else { throw "Target exists and is not a link: $link" }
|
|
18
|
+
}
|
|
19
|
+
New-Item -ItemType Junction -Path $link -Target $_.FullName | Out-Null
|
|
20
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Link every skill subdirectory under a source directory into the user
|
|
3
|
+
# skills root — the macOS/Linux counterpart of link-skills.ps1 (which uses
|
|
4
|
+
# NTFS junctions; POSIX gets plain symlinks). Same semantics: an existing
|
|
5
|
+
# link at the target is replaced, a real directory or file aborts the run.
|
|
6
|
+
#
|
|
7
|
+
# usage: link-skills.sh <source-directory> [target-directory]
|
|
8
|
+
set -euo pipefail
|
|
9
|
+
|
|
10
|
+
if [ $# -lt 1 ]; then
|
|
11
|
+
echo "usage: link-skills.sh <source-directory> [target-directory]" >&2
|
|
12
|
+
exit 2
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
SOURCE=$(cd "$1" 2>/dev/null && pwd) || { echo "Source directory not found: $1" >&2; exit 1; }
|
|
16
|
+
TARGET="${2:-${DSH_HOME:-$HOME/.dsh}/skills}"
|
|
17
|
+
|
|
18
|
+
[ -d "$SOURCE" ] || { echo "Not a directory: $SOURCE" >&2; exit 1; }
|
|
19
|
+
mkdir -p "$TARGET"
|
|
20
|
+
|
|
21
|
+
shopt -s nullglob dotglob
|
|
22
|
+
for src in "$SOURCE"/*/; do
|
|
23
|
+
name=$(basename "$src")
|
|
24
|
+
link="$TARGET/$name"
|
|
25
|
+
if [ -L "$link" ]; then
|
|
26
|
+
rm "$link"
|
|
27
|
+
elif [ -e "$link" ]; then
|
|
28
|
+
echo "Target exists and is not a link: $link" >&2
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
ln -s "${src%/}" "$link"
|
|
32
|
+
done
|