Files
skills-here-run-place/dist/server/pages/_slug_/edit.astro.mjs
Alejandro Martinez f09af719cf Initial commit
2026-02-12 02:04:10 +01:00

38 lines
3.0 KiB
JavaScript

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 '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';
export { renderers } from '../../renderers.mjs';
const $$Astro = createAstro();
const $$Edit = createComponent(async ($$result, $$props, $$slots) => {
const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
Astro2.self = $$Edit;
const { slug } = Astro2.params;
const skill = await getSkill(slug);
if (!skill) {
return Astro2.redirect("/");
}
const availableTools = await getAvailableTools();
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" })} ` })}`;
}, "/Users/alex/projects/skillit/src/pages/[slug]/edit.astro", void 0);
const $$file = "/Users/alex/projects/skillit/src/pages/[slug]/edit.astro";
const $$url = "/[slug]/edit";
const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
default: $$Edit,
file: $$file,
url: $$url
}, Symbol.toStringTag, { value: 'Module' }));
const page = () => _page;
export { page };