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,97 @@
|
||||
# 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.ps1 -Name <skill-name> [-CliPath <path>]
|
||||
param(
|
||||
[Parameter(Mandatory = $true)][string]$Name,
|
||||
[string]$CliPath
|
||||
)
|
||||
. (Join-Path $PSScriptRoot 'lib.ps1')
|
||||
|
||||
$dir = Join-Path $SkillsDir $Name
|
||||
$ext = Join-Path $dir 'extension'
|
||||
if (-not (Test-Path (Join-Path $ext 'manifest.json'))) {
|
||||
Write-Host "skills/$Name/extension/manifest.json fehlt."
|
||||
exit 1
|
||||
}
|
||||
|
||||
$defaults = @{
|
||||
'wordcraft-mcp' = @{
|
||||
ExeName = 'wordcraft-cli.exe'
|
||||
Default = 'C:\Program Files\WordCraft\wordcraft-cli.exe'
|
||||
Repo = 'https://github.com/storytold/wordcraft'
|
||||
RepoSlug = 'storytold/wordcraft'
|
||||
}
|
||||
'gridcraft-mcp' = @{
|
||||
ExeName = 'gridcraft-cli.exe'
|
||||
Default = 'C:\Program Files\GridCraft\gridcraft-cli.exe'
|
||||
Repo = 'https://github.com/storytold/gridcraft'
|
||||
RepoSlug = 'storytold/gridcraft'
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $defaults.ContainsKey($Name)) {
|
||||
Write-Host "Kein CLI-Mapping fuer Skill '$Name'."
|
||||
exit 1
|
||||
}
|
||||
$meta = $defaults[$Name]
|
||||
$src = if ($CliPath) { $CliPath } else { $meta.Default }
|
||||
if (-not (Test-Path -LiteralPath $src)) {
|
||||
Write-Host "CLI fehlt: $src"
|
||||
Write-Host "Bitte WordCraft/GridCraft ueber den ArtCraft-Launcher installieren, oder -CliPath angeben."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Ensure no EXE is left in the extension package from older builds.
|
||||
$serverDir = Join-Path $ext 'server'
|
||||
New-Item -ItemType Directory -Force -Path $serverDir | Out-Null
|
||||
Get-ChildItem -LiteralPath $serverDir -Filter '*.exe' -ErrorAction SilentlyContinue | Remove-Item -Force
|
||||
$readme = Join-Path $serverDir 'README.txt'
|
||||
if (-not (Test-Path $readme)) {
|
||||
Write-Text $readme @"
|
||||
Diese Erweiterung enthaelt keine CLI.
|
||||
Installiere die App ueber den ArtCraft-Launcher.
|
||||
Erwarteter Pfad: $src
|
||||
"@
|
||||
}
|
||||
|
||||
$verOut = & $src --version 2>&1 | Out-String
|
||||
if ($LASTEXITCODE -ne 0 -and $Name -eq 'gridcraft-mcp') {
|
||||
$verOut = & $src version 2>&1 | Out-String
|
||||
}
|
||||
$ver = ''
|
||||
if ($verOut -match '(\d+\.\d+\.\d+)') { $ver = $Matches[1] }
|
||||
if (-not $ver) {
|
||||
Write-Host "Version der CLI nicht lesbar: $verOut"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$hash = (Get-FileHash -LiteralPath $src -Algorithm SHA256).Hash.ToLowerInvariant()
|
||||
$upstream = @{
|
||||
source = 'ArtCraft-Launcher'
|
||||
path = $src
|
||||
exe = $meta.ExeName
|
||||
version = $ver
|
||||
sha256 = $hash
|
||||
repository = $meta.Repo
|
||||
tag = "v$ver"
|
||||
bundled = $false
|
||||
} | ConvertTo-Json -Compress
|
||||
Write-Text (Join-Path $ext 'upstream.json') ($upstream + "`n")
|
||||
|
||||
$licDir = Join-Path $ext 'LICENSES'
|
||||
New-Item -ItemType Directory -Force -Path $licDir | Out-Null
|
||||
$tag = "v$ver"
|
||||
foreach ($f in @('LICENSE-MIT', 'LICENSE-APACHE', 'NOTICE')) {
|
||||
$url = "https://raw.githubusercontent.com/$($meta.RepoSlug)/$tag/$f"
|
||||
$out = Join-Path $licDir $f
|
||||
try {
|
||||
Invoke-WebRequest -Uri $url -OutFile $out -UseBasicParsing
|
||||
}
|
||||
catch {
|
||||
Write-Host "Lizenzdatei fehlgeschlagen: $url"
|
||||
Write-Host $_
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "OK $Name $ver (nicht gebundelt) $src"
|
||||
Reference in new issue
Block a user