Initial commit: claude-skills with wordcraft-mcp and gridcraft-mcp 0.1.0.
This commit is contained in:
commit
cf01e22a1e
50 files changed
+2726
No files matched your search
@@ -0,0 +1,99 @@
|
||||
#!/usr/bin/env bash
|
||||
# Checks that the ArtCraft-Launcher CLI is installed and refreshes upstream.json + LICENSES.
|
||||
# Does NOT copy or ship the EXE into the extension package.
|
||||
# Usage: scripts/fetch-cli.sh <skill-name> [cli-path]
|
||||
set -euo pipefail
|
||||
source "$(dirname "$0")/lib.sh"
|
||||
|
||||
name="${1:-}"
|
||||
cli_path="${2:-}"
|
||||
if [[ -z "$name" ]]; then
|
||||
echo "Aufruf: scripts/fetch-cli.sh <skill-name> [cli-path]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ext="$SKILLS_DIR/$name/extension"
|
||||
if [[ ! -f "$ext/manifest.json" ]]; then
|
||||
echo "skills/$name/extension/manifest.json fehlt." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$name" in
|
||||
wordcraft-mcp)
|
||||
exe_name=wordcraft-cli.exe
|
||||
default='C:/Program Files/WordCraft/wordcraft-cli.exe'
|
||||
repo='https://github.com/storytold/wordcraft'
|
||||
repo_slug='storytold/wordcraft'
|
||||
;;
|
||||
gridcraft-mcp)
|
||||
exe_name=gridcraft-cli.exe
|
||||
default='C:/Program Files/GridCraft/gridcraft-cli.exe'
|
||||
repo='https://github.com/storytold/gridcraft'
|
||||
repo_slug='storytold/gridcraft'
|
||||
;;
|
||||
*)
|
||||
echo "Kein CLI-Mapping fuer Skill '$name'." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
src="${cli_path:-$default}"
|
||||
if [[ ! -f "$src" ]]; then
|
||||
echo "CLI fehlt: $src" >&2
|
||||
echo "Bitte WordCraft/GridCraft ueber den ArtCraft-Launcher installieren, oder Pfad als Argument angeben." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$ext/server"
|
||||
rm -f "$ext/server"/*.exe
|
||||
if [[ ! -f "$ext/server/README.txt" ]]; then
|
||||
printf '%s\n' \
|
||||
'Diese Erweiterung enthaelt keine CLI.' \
|
||||
'Installiere die App ueber den ArtCraft-Launcher.' \
|
||||
"Erwarteter Pfad: $src" > "$ext/server/README.txt"
|
||||
fi
|
||||
|
||||
ver_out="$("$src" --version 2>&1 || true)"
|
||||
if [[ ! "$ver_out" =~ [0-9]+\.[0-9]+\.[0-9]+ ]] && [[ "$name" == gridcraft-mcp ]]; then
|
||||
ver_out="$("$src" version 2>&1 || true)"
|
||||
fi
|
||||
if [[ ! "$ver_out" =~ ([0-9]+\.[0-9]+\.[0-9]+) ]]; then
|
||||
echo "Version der CLI nicht lesbar: $ver_out" >&2
|
||||
exit 1
|
||||
fi
|
||||
ver="${BASH_REMATCH[1]}"
|
||||
|
||||
if command -v sha256sum >/dev/null 2>&1; then
|
||||
hash="$(sha256sum "$src" | awk '{print $1}')"
|
||||
elif command -v shasum >/dev/null 2>&1; then
|
||||
hash="$(shasum -a 256 "$src" | awk '{print $1}')"
|
||||
else
|
||||
hash="$(python3 -c "import hashlib,sys; print(hashlib.sha256(open(sys.argv[1],'rb').read()).hexdigest())" "$src")"
|
||||
fi
|
||||
|
||||
python3 -c "
|
||||
import json, sys
|
||||
print(json.dumps({
|
||||
'source': 'ArtCraft-Launcher',
|
||||
'path': sys.argv[1],
|
||||
'exe': sys.argv[2],
|
||||
'version': sys.argv[3],
|
||||
'sha256': sys.argv[4],
|
||||
'repository': sys.argv[5],
|
||||
'tag': 'v' + sys.argv[3],
|
||||
'bundled': False,
|
||||
}, separators=(',', ':')))
|
||||
" "$src" "$exe_name" "$ver" "$hash" "$repo" > "$ext/upstream.json"
|
||||
printf '\n' >> "$ext/upstream.json" || true
|
||||
|
||||
mkdir -p "$ext/LICENSES"
|
||||
tag="v$ver"
|
||||
for f in LICENSE-MIT LICENSE-APACHE NOTICE; do
|
||||
url="https://raw.githubusercontent.com/$repo_slug/$tag/$f"
|
||||
if ! curl -fsSL "$url" -o "$ext/LICENSES/$f"; then
|
||||
echo "Lizenzdatei fehlgeschlagen: $url" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "OK $name $ver (nicht gebundelt) $src"
|
||||
Reference in new issue
Block a user