Files
skills-here-run-place/dist/server/pages/_slug_/i.astro.mjs
Alejandro Martinez aa477a553b Add author auth, forking, tags, and stats tracking
Introduce token-based author authentication (register/verify API),
   skill forking with EditGate protection, tag metadata on skills,
   and download/push stats. Enhanced push scripts with token auth
   and per-skill filtering. Updated UI with stats, tags, and
   author info on skill cards.
2026-02-12 14:37:40 +01:00

41 lines
1.3 KiB
JavaScript

import { g as getSkill } from '../../chunks/skills_BacVQUiS.mjs';
import { i as isPowerShell } from '../../chunks/sync_BEq_wzpT.mjs';
export { renderers } from '../../renderers.mjs';
const GET = async ({ params, url, request }) => {
const { slug } = params;
const skill = await getSkill(slug);
if (!skill) {
return new Response("Skill not found", { status: 404 });
}
const origin = url.origin;
const ps = isPowerShell(request);
const script = ps ? [
'$ErrorActionPreference = "Stop"',
'$Dir = ".claude\\skills"',
"New-Item -ItemType Directory -Force -Path $Dir | Out-Null",
`Invoke-WebRequest -Uri "${origin}/${slug}" -OutFile (Join-Path $Dir "${slug}.md")`,
`Write-Host "✓ Installed ${skill.name} to $Dir\\${slug}.md"`,
""
].join("\n") : [
"#!/usr/bin/env bash",
"set -euo pipefail",
"mkdir -p .claude/skills",
`curl -fsSL "${origin}/${slug}" -o ".claude/skills/${slug}.md"`,
`echo "✓ Installed ${skill.name} to .claude/skills/${slug}.md"`,
""
].join("\n");
return new Response(script, {
headers: { "Content-Type": "text/plain; charset=utf-8" }
});
};
const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
GET
}, Symbol.toStringTag, { value: 'Module' }));
const page = () => _page;
export { page };