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.
This commit is contained in:
15
dist/server/pages/_slug_/edit.astro.mjs
vendored
15
dist/server/pages/_slug_/edit.astro.mjs
vendored
@@ -1,11 +1,11 @@
|
||||
import { e as createComponent, k as renderComponent, r as renderTemplate, h as createAstro, m as maybeRenderHead, g as addAttribute } from '../../chunks/astro/server_B-2LxKLH.mjs';
|
||||
import { e as createAstro, f as createComponent, k as renderComponent, r as renderTemplate, m as maybeRenderHead, h as addAttribute } from '../../chunks/astro/server_CF97kUu8.mjs';
|
||||
import 'piccolore';
|
||||
import { $ as $$Base } from '../../chunks/_plugin-vue_export-helper_B1lnwsE2.mjs';
|
||||
import { g as getAvailableTools, a as getAvailableModels, S as SkillEditor } from '../../chunks/models_DPfuEi7q.mjs';
|
||||
import { g as getSkill } from '../../chunks/skills_COWfD5oy.mjs';
|
||||
import { $ as $$Base } from '../../chunks/_plugin-vue_export-helper_CEgY73aA.mjs';
|
||||
import { g as getAvailableTools, a as getAvailableModels, S as SkillEditor } from '../../chunks/models_BK7lP4G3.mjs';
|
||||
import { g as getSkill, a as getAllTags } from '../../chunks/skills_BacVQUiS.mjs';
|
||||
export { renderers } from '../../renderers.mjs';
|
||||
|
||||
const $$Astro = createAstro();
|
||||
const $$Astro = createAstro("https://skills.here.run.place");
|
||||
const $$Edit = createComponent(async ($$result, $$props, $$slots) => {
|
||||
const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
|
||||
Astro2.self = $$Edit;
|
||||
@@ -18,8 +18,9 @@ const $$Edit = createComponent(async ($$result, $$props, $$slots) => {
|
||||
const availableModels = await getAvailableModels();
|
||||
const allowedTools = skill["allowed-tools"].join(", ");
|
||||
const hooksJson = skill.hooks ? JSON.stringify(skill.hooks, null, 2) : "";
|
||||
return renderTemplate`${renderComponent($$result, "Base", $$Base, { "title": `Edit ${skill.name} \u2014 Skillit` }, { "default": async ($$result2) => renderTemplate` ${maybeRenderHead()}<a${addAttribute(`/${slug}`, "href")} class="inline-flex items-center gap-1 text-sm text-gray-600 hover:text-gray-300 transition-colors mb-4"> <svg class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5"></path> </svg>
|
||||
Back to ${skill.name} </a> <h1 class="text-2xl font-bold tracking-tight text-white mb-2">Edit Skill</h1> <p class="text-sm text-gray-500 mb-8">Editing <strong class="text-gray-400">${skill.name}</strong>. Users who already installed this skill will get the updated version on their next sync.</p> ${renderComponent($$result2, "SkillEditor", SkillEditor, { "mode": "edit", "slug": slug, "initialName": skill.name, "initialDescription": skill.description, "initialAllowedTools": allowedTools, "initialArgumentHint": skill["argument-hint"], "initialModel": skill.model, "initialUserInvocable": skill["user-invocable"], "initialDisableModelInvocation": skill["disable-model-invocation"], "initialContext": skill.context, "initialAgent": skill.agent, "initialHooks": hooksJson, "initialBody": skill.content, ":availableTools": availableTools, ":availableModels": availableModels, "client:load": true, "client:component-hydration": "load", "client:component-path": "/Users/alex/projects/skillit/src/components/SkillEditor.vue", "client:component-export": "default" })} ` })}`;
|
||||
const availableTags = await getAllTags();
|
||||
return renderTemplate`${renderComponent($$result, "Base", $$Base, { "title": `Edit ${skill.name} \u2014 Skills Here` }, { "default": async ($$result2) => renderTemplate` ${maybeRenderHead()}<a${addAttribute(`/${slug}`, "href")} class="inline-flex items-center gap-1 text-sm text-gray-600 hover:text-gray-300 transition-colors mb-4"> <svg class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5"></path> </svg>
|
||||
Back to ${skill.name} </a> <h1 class="text-2xl font-bold tracking-tight text-white mb-2">Edit Skill</h1> <p class="text-sm text-gray-500 mb-8">Editing <strong class="text-gray-400">${skill.name}</strong>. Users who already installed this skill will get the updated version on their next sync.</p> ${renderComponent($$result2, "SkillEditor", SkillEditor, { "mode": "edit", "slug": slug, "initialName": skill.name, "initialDescription": skill.description, "initialAllowedTools": allowedTools, "initialArgumentHint": skill["argument-hint"], "initialModel": skill.model, "initialUserInvocable": skill["user-invocable"], "initialDisableModelInvocation": skill["disable-model-invocation"], "initialContext": skill.context, "initialAgent": skill.agent, "initialHooks": hooksJson, "initialBody": skill.content, "initialAuthor": skill.author, "initialAuthorEmail": skill["author-email"], "initialTags": skill.tags.join(", "), ":availableTools": availableTools, ":availableModels": availableModels, "availableTags": availableTags.join(","), "client:load": true, "client:component-hydration": "load", "client:component-path": "/Users/alex/projects/skillit/src/components/SkillEditor.vue", "client:component-export": "default" })} ` })}`;
|
||||
}, "/Users/alex/projects/skillit/src/pages/[slug]/edit.astro", void 0);
|
||||
|
||||
const $$file = "/Users/alex/projects/skillit/src/pages/[slug]/edit.astro";
|
||||
|
||||
40
dist/server/pages/_slug_/gi.astro.mjs
vendored
Normal file
40
dist/server/pages/_slug_/gi.astro.mjs
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
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 = Join-Path $HOME ".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} globally 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} globally 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 };
|
||||
40
dist/server/pages/_slug_/i.astro.mjs
vendored
Normal file
40
dist/server/pages/_slug_/i.astro.mjs
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user