SolidCraft-MCP 0.2.0: unklare Befehle in den Skill aufnehmen, damit der naechste Lauf Nut, Durchmesser, Drehrichtung und die Boolean-Warnung nicht erneut raten muss.
Uebersicht und Download-Links zeigen dieselbe Version.
This commit is contained in:
1 parent
f3e49b5d37
commit
d374ee7fff
10 files changed
+184
-59
No files matched your search
+41
-16
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Erzeugt die Skill-Tabelle in README.md zwischen <!-- skills:start --> und <!-- skills:end -->
|
||||
# neu. Mit --check wird nur geprüft, ob die Tabelle aktuell ist (Exit-Code 1, wenn nicht).
|
||||
# Erzeugt die Skill-Übersicht in README.md zwischen <!-- skills:start --> und <!-- skills:end -->
|
||||
# neu. Mit --check wird nur geprüft, ob sie aktuell ist (Exit-Code 1, wenn nicht).
|
||||
# Aufruf: scripts/update-index.sh [--check]
|
||||
set -euo pipefail
|
||||
source "$(dirname "$0")/lib.sh"
|
||||
@@ -18,24 +18,16 @@ fi
|
||||
table="$(mktemp)"
|
||||
trap 'rm -f "$table"' EXIT
|
||||
{
|
||||
echo '| Skill | Kurzbeschreibung | Version | Doku | Download | Erweiterung (.mcpb) | Cursor-Plugin | Cursor 1-Klick |'
|
||||
echo '|---|---|---|---|---|---|---|---|'
|
||||
first=1
|
||||
while IFS= read -r name; do
|
||||
[[ -z "$name" ]] && continue
|
||||
desc=""
|
||||
ver="$(skill_version "$SKILLS_DIR/$name")"
|
||||
desc=""
|
||||
if fm="$(frontmatter "$SKILLS_DIR/$name/SKILL.md" 2>/dev/null)"; then
|
||||
desc="$(fm_value "$fm" description || true)"
|
||||
fi
|
||||
desc="${desc//|/\\|}"
|
||||
tag_enc="$(python3 -c 'import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1], safe=""))' "$name/v$ver")"
|
||||
zip_link="[${name}-v${ver}.zip](${REPO_WEB}/releases/download/${tag_enc}/${name}-v${ver}.zip)"
|
||||
mcpb=""
|
||||
cursor_zip=""
|
||||
deeplink=""
|
||||
if [[ -f "$SKILLS_DIR/$name/extension/manifest.json" ]]; then
|
||||
mcpb="[${name}-v${ver}.mcpb](${REPO_WEB}/releases/download/${tag_enc}/${name}-v${ver}.mcpb)"
|
||||
cursor_zip="[${name}-cursor-v${ver}.zip](${REPO_WEB}/releases/download/${tag_enc}/${name}-cursor-v${ver}.zip)"
|
||||
deeplink="$(python3 - "$SKILLS_DIR/$name/extension/manifest.json" "$name" <<'PY'
|
||||
import json, base64, sys, urllib.parse, re
|
||||
man = json.load(open(sys.argv[1], encoding="utf-8"))
|
||||
@@ -61,13 +53,46 @@ if len(cmd) >= 3 and cmd[1] == ":" and "\\" in cmd:
|
||||
cmd = cmd.replace("\\", "/")
|
||||
transport = {"command": cmd, "args": args}
|
||||
b64 = base64.urlsafe_b64encode(json.dumps(transport, separators=(",", ":")).encode()).decode().rstrip("=")
|
||||
link = f"cursor://anysphere.cursor-deeplink/mcp/install?name={urllib.parse.quote(sk)}&config={b64}"
|
||||
print(f"[Add to Cursor]({link})")
|
||||
print(f"cursor://anysphere.cursor-deeplink/mcp/install?name={urllib.parse.quote(sk)}&config={b64}")
|
||||
PY
|
||||
)"
|
||||
fi
|
||||
printf '| [%s](skills/%s/) | %s | %s | [README](skills/%s/README.md) | %s | %s | %s | %s |\n' \
|
||||
"$name" "$name" "$desc" "$ver" "$name" "$zip_link" "$mcpb" "$cursor_zip" "$deeplink"
|
||||
if [[ $first -eq 0 ]]; then
|
||||
printf '\n---\n\n'
|
||||
fi
|
||||
first=0
|
||||
python3 -c 'import sys, urllib.parse
|
||||
name, ver, desc, repo, link = sys.argv[1:]
|
||||
def md(s):
|
||||
out = []
|
||||
trans = {"\\": "\\\\", "*": "\\*", "_": "\\_", "`": "\\`", "[": "\\["}
|
||||
for ch in s:
|
||||
out.append(trans.get(ch, ch))
|
||||
return "".join(out)
|
||||
lead, note = desc.strip(), ""
|
||||
cut = lead.find(" Verwenden")
|
||||
if cut > 0:
|
||||
note = lead[cut + 1:].strip()
|
||||
lead = lead[:cut].strip()
|
||||
if lead[:1].islower():
|
||||
lead = lead[0].upper() + lead[1:]
|
||||
tag = urllib.parse.quote(f"{name}/v{ver}", safe="")
|
||||
base = f"{repo}/releases/download/{tag}"
|
||||
parts = [
|
||||
f"[Doku](skills/{name}/README.md)",
|
||||
f"[Skill-ZIP]({base}/{name}-v{ver}.zip \"{name}-v{ver}.zip\")",
|
||||
]
|
||||
if link:
|
||||
parts.append(f"[Erweiterung]({base}/{name}-v{ver}.mcpb \"{name}-v{ver}.mcpb\")")
|
||||
parts.append(f"[Cursor-Plugin]({base}/{name}-cursor-v{ver}.zip \"{name}-cursor-v{ver}.zip\")")
|
||||
parts.append(f"[Add to Cursor]({link})")
|
||||
lines = [f"### [{name}](skills/{name}/) · `v{ver}`", "", "> " + md(lead), ""]
|
||||
if note:
|
||||
lines += ["*" + md(note) + "*", ""]
|
||||
lines.append(" · ".join(parts))
|
||||
sys.stdout.write("\n".join(lines))
|
||||
' "$name" "$ver" "$desc" "$REPO_WEB" "$deeplink"
|
||||
printf '\n'
|
||||
done < <(skill_names)
|
||||
} > "$table"
|
||||
|
||||
|
||||
Reference in new issue
Block a user